MK3-E3DREVO_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 36 56 jmp 0xac6c ; 0xac6c <__dtors_end> 4: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 8: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> c: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 10: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 14: 0d 94 72 60 jmp 0x2c0e4 ; 0x2c0e4 <__vector_5> 18: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 1c: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 20: 0c 94 6e 74 jmp 0xe8dc ; 0xe8dc <__vector_8> 24: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 28: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 2c: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 30: 0c 94 f3 66 jmp 0xcde6 ; 0xcde6 <__vector_12> 34: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 38: 0d 94 db 33 jmp 0x267b6 ; 0x267b6 <__vector_14> 3c: 0d 94 68 2d jmp 0x25ad0 ; 0x25ad0 <__vector_15> 40: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 44: 0d 94 63 44 jmp 0x288c6 ; 0x288c6 <__vector_17> 48: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 4c: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 50: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 54: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 58: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 5c: 0c 94 a2 73 jmp 0xe744 ; 0xe744 <__vector_23> 60: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 64: 0d 94 9c d6 jmp 0x3ad38 ; 0x3ad38 <__vector_25> 68: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 6c: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 70: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 74: 0c 94 c7 8c jmp 0x1198e ; 0x1198e <__vector_29> 78: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 7c: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 80: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 84: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 88: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 8c: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 90: 0d 94 58 d6 jmp 0x3acb0 ; 0x3acb0 <__vector_36> 94: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 98: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> 9c: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> a0: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> a4: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> a8: 0d 94 82 23 jmp 0x24704 ; 0x24704 <__vector_42> ac: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> b0: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> b4: 0d 94 64 23 jmp 0x246c8 ; 0x246c8 <__vector_45> b8: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> bc: 0d 94 25 39 jmp 0x2724a ; 0x2724a <__vector_47> c0: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> c4: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> c8: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> cc: 0d 94 24 23 jmp 0x24648 ; 0x24648 <__vector_51> d0: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> d4: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> d8: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> dc: 0c 94 67 56 jmp 0xacce ; 0xacce <__bad_interrupt> e0: 0c 94 67 56 jmp 0xacce ; 0xacce <__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 45 78 74 72 75 64 65 72 00 ..Extruder. 00003a3d : 3a3d: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00003a46 : 3a46: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00003a4f : 3a4f: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00003a58 : 3a58: ff ff 43 72 61 73 68 20 64 65 74 65 63 74 69 6f ..Crash detectio 3a68: 6e 20 63 61 6e 0a 62 65 20 74 75 72 6e 65 64 20 n can.be turned 3a78: 6f 6e 20 6f 6e 6c 79 20 69 6e 0a 4e 6f 72 6d 61 on only in.Norma 3a88: 6c 20 6d 6f 64 65 00 l mode. 00003a8f : 3a8f: ff ff 57 41 52 4e 49 4e 47 3a 0a 43 72 61 73 68 ..WARNING:.Crash 3a9f: 20 64 65 74 65 63 74 69 6f 6e 0a 64 69 73 61 62 detection.disab 3aaf: 6c 65 64 20 69 6e 0a 53 74 65 61 6c 74 68 20 6d led in.Stealth m 3abf: 6f 64 65 00 ode. 00003ac3 : 3ac3: ff ff 4d 6f 64 65 20 63 68 61 6e 67 65 20 69 6e ..Mode change in 3ad3: 20 70 72 6f 67 72 65 73 73 2e 2e 2e 00 progress.... 00003ae0 : 3ae0: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 3af0: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00003afa : 3afa: ff ff 43 6f 6d 6d 75 6e 69 74 79 20 6d 61 64 65 ..Community made ... 00003b0b : 3b0b: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 3b1b: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 3b2b: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 3b3b: 65 74 00 et. 00003b3e : 3b3e: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 3b4e: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00003b5c : 3b5c: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3b6c: 74 3a 00 t:. 00003b6f : 3b6f: ff ff 43 61 6e 63 65 6c 00 ..Cancel. 00003b78 : 3b78: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 3b88: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 3b98: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 3ba8: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 3bb8: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 3bc8: 6e 6e 69 6e 67 2e 00 nning.. 00003bcf : 3bcf: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 3bdf: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 3bef: 2e 00 .. 00003bf1 : 3bf1: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 3c01: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 3c11: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 3c21: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 3c31: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00003c3d : 3c3d: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 3c4d: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 3c5d: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 3c6d: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 3c7d: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 3c8d: 6c 6f 61 64 20 69 74 2e 00 load it.. 00003c96 : 3c96: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 3ca6: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 3cb6: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 3cc6: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 3cd6: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 3ce6: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 3cf6: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 3d06: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 3d16: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 3d26: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 00003d36 : 3d36: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 3d46: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 3d56: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 3d66: 2e 00 .. 00003d68 : 3d68: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 3d78: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 3d88: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 3d98: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 3da8: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 3db8: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 00003dc1 : 3dc1: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 3dd1: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 3de1: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 3df1: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 3e01: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 00003e10 : 3e10: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 3e20: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 3e30: 20 69 74 20 6e 6f 77 3f 00 it now?. 00003e39 : 3e39: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 3e49: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 3e59: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 00003e63 : 3e63: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 3e73: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 00003e80 : 3e80: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 3e90: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 3ea0: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 3eb0: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 3ec0: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 3ed0: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 3ee0: 2e 00 .. 00003ee2 : 3ee2: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 3ef2: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 00003f01 : 3f01: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 3f11: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 3f21: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 3f31: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 00003f40 : 3f40: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 3f50: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 3f60: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 3f70: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 3f80: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 3f90: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 3fa0: 65 65 74 73 2e 00 eets.. 00003fa6 : 3fa6: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 3fb6: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 3fc6: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 00003fd6 : 3fd6: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 3fe6: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 3ff6: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 4006: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 4016: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 4026: 64 3f 00 d?. 00004029 : 4029: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 4039: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 4049: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 4059: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 0000406a : 406a: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 407a: 61 64 65 64 3f 00 aded?. 00004080 : 4080: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 4090: 63 61 6c 2e 20 74 61 6b 65 73 20 61 70 70 72 6f cal. takes appro 40a0: 78 2e 20 31 32 20 6d 69 6e 73 2e 20 53 65 65 0a x. 12 mins. See. 40b0: 70 72 75 73 61 2e 69 6f 2f 74 6d 2d 63 61 6c 00 prusa.io/tm-cal. 000040c0 : 40c0: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 40d0: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 40e0: 50 4c 41 2e 00 PLA.. 000040e5 : 40e5: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 40f5: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 00004105 : 4105: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 4115: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 4125: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 00004133 : 4133: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 4143: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 4153: 20 66 69 72 73 74 2e 00 first.. 0000415b : 415b: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 416b: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 417b: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 418b: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 00004199 : 4199: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 41a9: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 41b9: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 41c9: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 41d9: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 000041e2 : 41e2: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 41f2: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 4202: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 4212: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 4222: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 4232: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 4242: 65 73 73 3f 00 ess?. 00004247 : 4247: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 4257: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 4267: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 4277: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 4287: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 4297: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 42a7: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 42b7: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 42c7: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 42d7: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 42e7: 69 6e 74 2e 00 int.. 000042ec : 42ec: ff ff 45 2d 63 6f 72 72 65 63 74 00 ..E-correct. 000042f8 : 42f8: ff ff 5a 2d 63 6f 72 72 65 63 74 00 ..Z-correct. 00004304 : 4304: ff ff 59 2d 63 6f 72 72 65 63 74 00 ..Y-correct. 00004310 : 4310: ff ff 58 2d 63 6f 72 72 65 63 74 00 ..X-correct. 0000431c : 431c: ff ff 50 61 75 73 65 00 ..Pause. 00004324 : 4324: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 00004330 : 4330: ff ff 43 6f 6e 74 2e 00 ..Cont.. 00004338 : 4338: ff ff 46 2e 20 6a 61 6d 20 64 65 74 65 63 74 00 ..F. jam detect. 00004348 : 4348: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 00004356 : 4356: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 00004362 : 4362: ff ff 4d 4d 55 20 4d 6f 64 65 00 ..MMU Mode. 0000436d : 436d: ff ff 43 75 74 74 65 72 00 ..Cutter. 00004376 : 4376: ff ff 53 74 65 61 6c 74 68 00 ..Stealth. 00004380 : 4380: ff ff 43 72 61 73 68 20 64 65 74 2e 00 ..Crash det.. 0000438d : 438d: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 00004399 : 4399: ff ff 42 65 64 00 ..Bed. 0000439f : 439f: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 000043ac : 43ac: ff ff 4d 6f 64 65 6c 00 ..Model. 000043b4 : 43b4: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 000043bd : 43bd: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 43cd: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 43dd: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 43ed: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 000043fa : 43fa: ff ff 43 68 65 63 6b 73 00 ..Checks. 00004403 : 4403: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00004413 : 4413: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 0000441e : 441e: ff ff 53 6f 72 74 00 ..Sort. 00004425 : 4425: ff ff 54 69 6d 65 00 ..Time. 0000442c : 442c: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00004435 : 4435: ff ff 53 44 20 63 61 72 64 00 ..SD card. 0000443f : 443f: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 444f: 65 00 e. 00004451 : 4451: ff ff 52 50 69 20 70 6f 72 74 00 ..RPi port. 0000445c : 445c: ff ff 4c 69 6e 2e 20 63 6f 72 72 65 63 74 69 6f ..Lin. correctio 446c: 6e 00 n. 0000446e : 446e: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 00004479 : 4479: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 00004488 : 4488: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 4498: 72 73 00 rs. 0000449b : 449b: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 000044a7 : 44a7: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 000044b5 : 44b5: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 000044c2 : 44c2: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 44d2: 62 72 2e 00 br.. 000044d6 : 44d6: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 44e6: 6e 00 n. 000044e8 : 44e8: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 44f8: 65 63 74 00 ect. 000044fc : 44fc: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 450c: 69 6e 67 00 ing. 00004510 : 4510: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 0000451e : 451e: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 0000452e : 452e: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 00004539 : 4539: ff ff 42 65 6c 74 20 74 65 73 74 00 ..Belt test. 00004545 : 4545: ff ff 57 69 7a 61 72 64 00 ..Wizard. 0000454e : 454e: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 455e: 6e 74 00 nt. 00004561 : 4561: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 0000456c : 456c: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 457c: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 458c: 69 61 74 65 6c 79 00 iately. 00004593 : 4593: ff ff 52 65 73 65 74 00 ..Reset. 0000459b : 459b: ff ff 52 65 6e 61 6d 65 00 ..Rename. 000045a4 : 45a4: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 45b4: 6c 2e 00 l.. 000045b7 : 45b7: ff ff 53 65 6c 65 63 74 00 ..Select. 000045c0 : 45c0: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 000045cf : 45cf: ff ff 53 75 70 70 6f 72 74 00 ..Support. 000045d9 : 45d9: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 000045ea : 45ea: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 000045f7 : 45f7: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 00004604 : 4604: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 00004612 : 4612: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 4622: 65 6e 74 00 ent. 00004626 : 4626: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 00004636 : 4636: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 4646: 74 00 t. 00004648 : 4648: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 00004659 : 4659: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 0000466a : 466a: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 00004676 : 4676: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 00004683 : 4683: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00004693 : 4693: ff ff 43 6c 65 61 72 20 54 4d 20 65 72 72 6f 72 ..Clear TM error ... 000046a4 : 46a4: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 000046b3 : 46b3: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 000046c1 : 46c1: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 000046cd : 46cd: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 000046dd : 46dd: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 000046e7 : 46e7: ff ff 54 75 6e 65 00 ..Tune. 000046ee : 46ee: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 000046fe : 46fe: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00004708 : 4708: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00004716 : 4716: ff ff 42 72 69 67 68 74 6e 65 73 73 00 ..Brightness. 00004723 : 4723: ff ff 41 73 73 69 73 74 00 ..Assist. 0000472c : 472c: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00004735 : 4735: ff ff 4f 6e 63 65 00 ..Once. 0000473c : 473c: ff ff 53 6f 75 6e 64 00 ..Sound. 00004744 : 4744: ff ff 4c 6f 75 64 00 ..Loud. 0000474b : 474b: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 00004759 : 4759: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 4769: 74 00 t. 0000476b : 476b: ff ff 46 6c 6f 77 00 ..Flow. 00004772 : 4772: ff ff 53 70 65 65 64 00 ..Speed. 0000477a : 477a: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 0000478a : 478a: ff ff 4e 2f 41 00 ..N/A. 00004790 : 4790: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 0000479e : 479e: ff ff 4d 65 73 68 00 ..Mesh. 000047a5 : 47a5: ff ff 54 69 6d 65 6f 75 74 00 ..Timeout. 000047af : 47af: ff ff 4d 6f 64 65 00 ..Mode. 000047b6 : 47b6: ff ff 41 75 74 6f 00 ..Auto. 000047bd : 47bd: ff ff 44 69 6d 00 ..Dim. 000047c3 : 47c3: ff ff 42 72 69 67 68 74 00 ..Bright. 000047cc : 47cc: ff ff 4c 65 76 65 6c 20 44 69 6d 6d 65 64 00 ..Level Dimmed. 000047db : 47db: ff ff 4c 65 76 65 6c 20 42 72 69 67 68 74 00 ..Level Bright. 000047ea : 47ea: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 000047f5 : 47f5: ff ff 59 65 73 00 ..Yes. 000047fb : 47fb: ff ff 4e 6f 00 ..No. 00004800 : 4800: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 0000480d : 480d: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 0000481d : 481d: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 482d: 65 2e 00 e.. 00004830 : 4830: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 0000483b : 483b: ff ff 4d 61 69 6e 00 ..Main. 00004842 : 4842: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 4852: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 4862: 6c 69 6e 67 00 ling. 00004867 : 4867: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00004875 : 4875: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00004886 : 4886: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00004893 : 4893: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 000048a1 : 48a1: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 48b1: 6d 65 00 me. 000048b4 : 48b4: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 000048c2 : 48c2: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 48d2: 72 73 00 rs. 000048d5 : 48d5: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 48e5: 64 00 d. 000048e7 : 48e7: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 000048f6 : 48f6: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 4906: 73 00 s. 00004908 : 4908: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 4918: 73 00 s. 0000491a : 491a: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 492a: 73 00 s. 0000492c : 492c: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 493c: 6f 70 73 00 ops. 00004940 : 4940: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 0000494f : 494f: ff ff 42 61 63 6b 00 ..Back. 00004956 : 4956: ff ff 53 74 72 69 63 74 00 ..Strict. 0000495f : 495f: ff ff 57 61 72 6e 00 ..Warn. 00004966 : 4966: ff ff 4e 6f 6e 65 00 ..None. 0000496d : 496d: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ..Nozzle changed 497d: 3f 00 ?. 0000497f : 497f: ff ff 4e 6f 7a 7a 6c 65 20 69 73 20 68 6f 74 21 ..Nozzle is hot! 498f: 20 57 61 69 74 20 66 6f 72 20 63 6f 6f 6c 64 6f Wait for cooldo 499f: 77 6e 2e 00 wn.. 000049a3 : 49a3: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 49b3: 68 65 64 00 hed. 000049b7 : 49b7: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 000049c2 : 49c2: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 000049d1 : 49d1: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 000049e1 : 49e1: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 49f1: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4a01: 68 65 20 47 2d 63 6f 64 65 2e 00 he G-code.. 00004a0c : 4a0c: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4a1c: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4a2c: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4a3c: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4a4c: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 00 e in settings.. 00004a5b : 4a5b: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4a6b: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 00 lament loaded.. 00004a7a : 4a7a: ff ff 4d 4b 33 20 66 69 72 6d 77 61 72 65 20 64 ..MK3 firmware d 4a8a: 65 74 65 63 74 65 64 20 6f 6e 20 4d 4b 33 53 20 etected on MK3S 4a9a: 70 72 69 6e 74 65 72 00 printer. 00004aa2 : 4aa2: ff ff 42 6c 61 63 6b 6f 75 74 20 6f 63 63 75 72 ..Blackout occur 4ab2: 72 65 64 2e 20 52 65 63 6f 76 65 72 20 70 72 69 red. Recover pri 4ac2: 6e 74 3f 00 nt?. 00004ac6 : 4ac6: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 4ad6: 6e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 20 79 not calibrated y 4ae6: 65 74 2e 00 et.. 00004aea : 4aea: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 4afa: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 4b0a: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 4b1a: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 4b2a: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 4b3a: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 4b4a: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4b5a: 6e 20 66 6c 6f 77 2e 00 n flow.. 00004b62 : 4b62: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 4b72: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 4b82: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 4b92: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 4ba2: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 4bb2: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 4bc2: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 00004bd2 : 4bd2: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 4be2: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 4bf2: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 4c02: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 4c12: 2e 00 .. 00004c14 : 4c14: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 4c24: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 4c34: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 4c44: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 00004c50 : 4c50: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 4c60: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 4c70: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 4c80: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004c8b : 4c8b: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4c9b: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 00004cac : 4cac: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 4cbc: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 4ccc: 67 65 64 2e 00 ged.. 00004cd1 : 4cd1: ff ff 53 68 65 65 74 00 ..Sheet. 00004cd9 : 4cd9: ff ff 52 65 63 6f 76 65 72 69 6e 67 20 70 72 69 ..Recovering pri 4ce9: 6e 74 00 nt. 00004cec : 4cec: ff ff 54 48 45 52 4d 41 4c 20 41 4e 4f 4d 41 4c ..THERMAL ANOMAL 4cfc: 59 00 Y. 00004cfe : 4cfe: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00004d0f : 4d0f: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00004d1f : 4d1f: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 4d2f: 6e 65 00 ne. 00004d32 : 4d32: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 00004d42 : 4d42: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 00004d4d : 4d4d: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 00004d5b : 4d5b: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00004d6b : 4d6b: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 00004d75 : 4d75: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 00004d81 : 4d81: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00004d92 : 4d92: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4da2: 73 00 s. 00004da4 : 4da4: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4db4: 65 73 00 es. 00004db7 : 4db7: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004dc8 : 4dc8: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 4dd8: 6c 75 72 65 73 00 lures. 00004dde : 4dde: ff ff 50 6f 77 65 72 20 66 61 69 6c 75 72 65 73 ..Power failures ... 00004def : 4def: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004dfe : 4dfe: ff ff 43 72 61 73 68 00 ..Crash. 00004e06 : 4e06: ff ff 54 6f 74 61 6c 00 ..Total. 00004e0e : 4e0e: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00004e1b : 4e1b: ff ff 41 6d 62 69 65 6e 74 00 ..Ambient. 00004e25 : 4e25: ff ff 56 6f 6c 74 61 67 65 73 00 ..Voltages. 00004e30 : 4e30: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004e3f : 4e3f: ff ff 42 65 6c 74 20 73 74 61 74 75 73 00 ..Belt status. 00004e4d : 4e4d: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004e5b : 4e5b: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004e6b : 4e6b: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4e7b: 6c 73 00 ls. 00004e7e : 4e7e: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4e8e: 72 3a 00 r:. 00004e91 : 4e91: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004e9b : 4e9b: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004eab : 4eab: ff ff 44 61 74 65 3a 00 ..Date:. 00004eb3 : 4eb3: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4ec3: 6d 65 6e 74 00 ment. 00004ec8 : 4ec8: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4ed8: 6e 74 00 nt. 00004edb : 4edb: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004eec : 4eec: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4efc: 63 75 74 00 cut. 00004f00 : 4f00: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4f10: 65 6a 65 63 74 00 eject. 00004f16 : 4f16: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4f26: 75 6e 6c 6f 61 64 00 unload. 00004f2d : 4f2d: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4f3d: 6c 6f 61 64 00 load. 00004f42 : 4f42: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00004f4d : 4f4d: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 4f5d: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 4f6d: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00004f78 : 4f78: ff ff 45 6a 65 63 74 00 ..Eject. 00004f80 : 4f80: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 4f90: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 4fa0: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 4fb0: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 4fc0: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 00004fcd : 4fcd: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 00004fde : 4fde: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 4fee: 6d 65 00 me. 00004ff1 : 4ff1: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00005001 : 5001: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 0000500e : 500e: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 501e: 7a 7a 6c 65 21 00 zzle!. 00005024 : 5024: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 0000502d : 502d: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 503d: 6d 20 6d 69 6e 00 m min. 00005043 : 5043: ff ff 4c 65 66 74 00 ..Left. 0000504a : 504a: ff ff 52 69 67 68 74 00 ..Right. 00005052 : 5052: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00005062 : 5062: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00005070 : 5070: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 0000507e : 507e: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 508e: 66 73 65 74 00 fset. 00005093 : 5093: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 000050a1 : 50a1: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 000050b2 : 50b2: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 000050c3 : 50c3: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 000050d4 : 50d4: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 000050e5 : 50e5: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 50f5: 65 3a 00 e:. 000050f8 : 50f8: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 5108: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00005113 : 5113: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 5123: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 5133: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 5143: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 5153: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 5163: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 0000516f : 516f: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 517f: 6e 73 6f 72 00 nsor. 00005184 : 5184: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 5194: 72 00 r. 00005196 : 5196: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 0000519f : 519f: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 51af: 49 4e 44 41 00 INDA. 000051b4 : 51b4: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 51c4: 65 6e 74 00 ent. 000051c8 : 51c8: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 51d8: 6f 72 00 or. 000051db : 51db: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 51eb: 63 74 6f 72 00 ctor. 000051f0 : 51f0: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 00005201 : 5201: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 5211: 6e 74 00 nt. 00005214 : 5214: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 5224: 65 00 e. 00005226 : 5226: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 5236: 20 73 6c 6f 74 00 slot. 0000523c : 523c: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 524c: 6d 65 6e 74 00 ment. 00005251 : 5251: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 00005262 : 5262: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5272: 65 6e 74 00 ent. 00005276 : 5276: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 00005285 : 5285: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 5295: 73 65 72 00 ser. 00005299 : 5299: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 52a9: 6d 65 6e 74 73 00 ments. 000052af : 52af: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 000052c0 : 52c0: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 52d0: 7a 6c 65 00 zle. 000052d4 : 52d4: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 52e4: 72 75 64 65 72 00 ruder. 000052ea : 52ea: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 52fa: 44 41 00 DA. 000052fd : 52fd: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 530d: 75 6c 6c 65 79 00 ulley. 00005313 : 5313: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 5323: 49 4e 44 41 00 INDA. 00005328 : 5328: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 5338: 6c 65 72 00 ler. 0000533c : 533c: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 0000534d : 534d: ff ff 4f 4b 00 ..OK. 00005352 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.530>: 5352: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005362 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.529>: 5362: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5372: 45 00 E. 00005374 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.528>: 5374: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5384: 45 44 00 ED. 00005387 <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.527>: 5387: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5397: 59 00 Y. 00005399 <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.526>: 5399: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 53a9: 4f 52 00 OR. 000053ac <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.525>: 53ac: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 53bc: 4e 45 45 44 45 44 00 NEEDED. 000053c3 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.524>: 53c3: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 000053d0 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.523>: 53d0: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 000053df <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.522>: 53df: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 53ef: 4f 41 44 45 44 00 OADED. 000053f5 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.521>: 53f5: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5405: 45 52 52 4f 52 00 ERROR. 0000540b <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.520>: 540b: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 541b: 44 49 4e 47 00 DING. 00005420 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.519>: 5420: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005430 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.518>: 5430: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5440: 41 49 4c 45 44 00 AILED. 00005446 <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.517>: 5446: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5456: 52 54 45 44 00 RTED. 0000545b <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.516>: 545b: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 546b: 47 45 20 45 52 52 00 GE ERR. 00005472 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.515>: 5472: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5482: 45 54 00 ET. 00005485 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.514>: 5485: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5495: 4f 52 00 OR. 00005498 <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.513>: 5498: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 54a8: 52 52 4f 52 00 RROR. 000054ad <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.512>: 54ad: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 54bd: 4f 20 48 4f 54 00 O HOT. 000054c3 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.511>: 54c3: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 54d3: 4f 56 45 00 OVE. 000054d7 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.510>: 54d7: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 54e7: 4f 4d 45 00 OME. 000054eb <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.509>: 54eb: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 54fb: 54 20 4d 4f 56 45 00 T MOVE. 00005502 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.508>: 5502: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5512: 54 20 48 4f 4d 45 00 T HOME. 00005519 <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.507>: 5519: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5529: 46 41 49 4c 45 44 00 FAILED. 00005530 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.506>: 5530: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005540 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.505>: 5540: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5550: 52 4c 59 00 RLY. 00005554 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.504>: 5554: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5564: 4d 4f 56 45 00 MOVE. 00005569 <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.503>: 5569: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5579: 54 55 43 4b 00 TUCK. 0000557e <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.502>: 557e: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 558e: 54 52 49 47 47 2e 00 TRIGG.. 00005595 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.501>: 5595: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 55a5: 54 55 43 4b 00 TUCK. 000055aa <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.500>: 55aa: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 55ba: 49 47 47 45 52 00 IGGER. 000055c0 : 55c0: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 000055cf : 55cf: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 000055da : 55da: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000055e5 : 55e5: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 55f5: 64 00 d. 000055f7 : 55f7: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 5607: 72 00 r. 00005609 : 5609: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 00005613 : 5613: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 5623: 73 00 s. 00005625 : 5625: ff ff 41 78 69 73 00 ..Axis. 0000562c : 562c: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 0000563a : 563a: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00005649 : 5649: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 5659: 6e 3f 00 n?. 0000565c : 565c: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 566c: 6e 3f 00 n?. 0000566f : 566f: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 567f: 74 00 t. 00005681 : 5681: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 0000568b : 568b: ff ff 4d 6f 74 6f 72 00 ..Motor. 00005693 : 5693: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 0000569e : 569e: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 000056ad : 56ad: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 000056ba : 56ba: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 000056ca : 56ca: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 56da: 74 6f 72 00 tor. 000056de : 56de: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 000056ee : 56ee: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 56fe: 21 00 !. 00005700 : 5700: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5710: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 5720: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 5730: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 5740: 79 2e 00 y.. 00005743 : 5743: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5753: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 5763: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 5773: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 5783: 6a 6f 62 21 00 job!. 00005788 : 5788: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5798: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 57a8: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 57b8: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 57c8: 73 21 00 s!. 000057cb : 57cb: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 57db: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 57eb: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 57fb: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 580b: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 00005817 : 5817: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5827: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 5837: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 5847: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 5857: 68 61 62 6c 65 2e 00 hable.. 0000585e : 585e: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 586e: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 587e: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 588e: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 589e: 68 61 62 6c 65 2e 00 hable.. 000058a5 : 58a5: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 58b5: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 58c5: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 58d5: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 58e5: 2e 00 .. 000058e7 : 58e7: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 58f7: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 5907: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 5917: 75 61 6c 2e 00 ual.. 0000591c : 591c: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 592c: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 593c: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 594c: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 0000595b : 595b: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 596b: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 597b: 61 74 62 65 64 2e 00 atbed.. 00005982 : 5982: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 5992: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 59a2: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 59b2: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 59c2: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 59d2: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 59e2: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 59f2: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 5a02: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 5a12: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 00005a21 : 5a21: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 5a31: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 5a41: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 5a51: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 5a61: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 5a71: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 5a81: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 5a91: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 5aa1: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 5ab1: 69 61 74 65 6c 79 2e 00 iately.. 00005ab9 : 5ab9: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 5ac9: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 5ad9: 74 00 t. 00005adb : 5adb: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 5aeb: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 5afb: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 5b0b: 74 00 t. 00005b0d : 5b0d: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 5b1d: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 5b2d: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 5b3d: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00005b49 : 5b49: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 00005b55 : 5b55: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005b64 : 5b64: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005b75 : 5b75: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5b85: 6e 74 00 nt. 00005b88 : 5b88: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5b98: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5ba8: 72 65 2e 2e 2e 00 re.... 00005bae : 5bae: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005bbe : 5bbe: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5bce: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5bde: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5bee: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5bfe: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5c0e: 30 2e 00 0.. 00005c11 : 5c11: ff ff 4f 66 66 00 ..Off. 00005c17 : 5c17: ff ff 4f 6e 00 ..On. 00005c1c : 5c1c: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5c2c: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005c39 : 5c39: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5c49: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5c59: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5c69: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5c79: 2e 00 .. 00005c7b : 5c7b: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5c8b: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5c9b: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5cab: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005cb4 : 5cb4: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5cc4: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5cd4: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5ce4: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5cf4: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5d04: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005d12 : 5d12: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5d22: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5d32: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5d42: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5d52: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005d5c : 5d5c: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5d6c: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5d7c: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5d8c: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5d9c: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005da6 : 5da6: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5db6: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5dc6: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5dd6: 4d 4d 55 2e 00 MMU.. 00005ddb : 5ddb: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5deb: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5dfb: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5e0b: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 5e1b: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 5e2b: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 5e3b: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 5e4b: 29 2e 00 ).. 00005e4e : 5e4e: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5e5e: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5e6e: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5e7e: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5e8e: 69 74 20 66 69 72 73 74 2e 00 it first.. 00005e98 : 5e98: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5ea8: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 5eb8: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 5ec8: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 00005ed9 : 5ed9: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5ee9: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 5ef9: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 5f09: 63 74 6f 72 73 2e 00 ctors.. 00005f10 : 5f10: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 5f20: 6e 6c 69 6e 65 2e 00 nline.. 00005f27 : 5f27: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 5f37: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 5f47: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 5f57: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 5f67: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 00005f73 : 5f73: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 5f83: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 00005f93 : 5f93: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 5fa3: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 5fb3: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 5fc3: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 5fd3: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 00005fe2 : 5fe2: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 5ff2: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 6002: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 6012: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 6022: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 6032: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 6042: 6e 65 65 64 65 64 2e 00 needed.. 0000604a : 604a: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 605a: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 606a: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 607a: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 608a: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 609a: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 60aa: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 60ba: 6f 70 65 72 6c 79 2e 00 operly.. 000060c2 : 60c2: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 60d2: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 60e2: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 60f2: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 6102: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 6112: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 6122: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 6132: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 6142: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 6152: 2e 00 .. 00006154 : 6154: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 6164: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 6174: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 6184: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 6194: 20 77 69 72 69 6e 67 2e 00 wiring.. 0000619d : 619d: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 61ad: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 61bd: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 61cd: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 61dd: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 61ed: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 61fd: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 0000620a : 620a: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 621a: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 622a: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 623a: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 624a: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 625a: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 626a: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 627a: 61 63 68 65 64 20 69 74 2e 00 ached it.. 00006284 : 6284: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 6294: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 62a4: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 62b4: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 62c4: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 62d4: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 62e4: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 62f4: 6f 72 6b 73 2e 00 orks.. 000062fa : 62fa: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 630a: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 631a: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 632a: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 633a: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 634a: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 0000635b : 635b: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00006365 : 6365: ff ff 53 74 6f 70 00 ..Stop. 0000636c : 636c: ff ff 4c 6f 61 64 00 ..Load. 00006373 : 6373: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 0000637c : 637c: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 00006387 : 6387: ff ff 52 65 74 72 79 00 ..Retry. 0000638f : 638f: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 639f: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 63af: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 63bf: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 63cf: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 63df: 74 2e 00 t.. 000063e2 : 63e2: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 000063f0 : 63f0: ff ff 44 6f 6e 65 00 ..Done. 000063f7 <__loc_pri_end>: 63f7: 65 6e ori r22, 0xE5 ; 229 63f9: 71 75 andi r23, 0x51 ; 81 63fb: 65 69 ori r22, 0x95 ; 149 63fd: 6e 67 ori r22, 0x7E ; 126 63ff: 20 22 and r2, r16 ... 00006402 : 6402: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 6412: 6c 65 00 le. 00006415 : 6415: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 6425: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 6435: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 0000643f : 643f: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 644f: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 645f: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006469 : 6469: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 6479: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 00006488 : 6488: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 6498: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 64a8: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 64b8: 3a 20 00 : . 000064bb : 64bb: 25 6c 75 20 62 79 74 65 73 20 77 72 69 74 74 65 %lu bytes writte 64cb: 6e 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 n to %S at addre 64db: 73 73 20 30 78 25 30 34 6c 78 0a 00 ss 0x%04lx.. 000064e7 : 64e7: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 64f7: 20 25 53 0a 00 %S.. 000064fc <__c.2368>: 64fc: 3f 3f 00 ??. 000064ff <__c.2366>: 64ff: 52 6f 6d 61 6e 61 00 Romana. 00006506 <__c.2363>: 6506: 48 72 76 61 74 73 6b 69 00 Hrvatski. 0000650f <__c.2360>: 650f: 4d 61 67 79 61 72 00 Magyar. 00006516 <__c.2357>: 6516: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 00006521 <__c.2354>: 6521: 4e 6f 72 73 6b 00 Norsk. 00006527 <__c.2351>: 6527: 53 76 65 6e 73 6b 61 00 Svenska. 0000652f <__c.2348>: 652f: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 0000653a <__c.2345>: 653a: 50 6f 6c 73 6b 69 00 Polski. 00006541 <__c.2342>: 6541: 49 74 61 6c 69 61 6e 6f 00 Italiano. 0000654a <__c.2339>: 654a: 46 72 61 6e 63 61 69 73 00 Francais. 00006553 <__c.2336>: 6553: 45 73 70 61 6e 6f 6c 00 Espanol. 0000655b <__c.2333>: 655b: 44 65 75 74 73 63 68 00 Deutsch. 00006563 <__c.2330>: 6563: 43 65 73 74 69 6e 61 00 Cestina. 0000656b <__c.2327>: 656b: 45 6e 67 6c 69 73 68 00 English. 00006573 : 6573: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 0000657e : 657e: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 658e: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 659e: 31 40 3a 25 75 0a 00 1@:%u.. 000065a5 : 65a5: 52 65 73 65 6e 64 00 Resend. 000065ac : 65ac: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 000065b8 : 65b8: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 65c8: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 000065d2 : 65d2: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 65e2: 64 65 74 65 63 74 65 64 21 00 detected!. 000065ec : 65ec: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 65fc: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 660c: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 661c: 72 65 64 2e 00 red.. 00006621 : 6621: 64 75 6d 70 20 63 6c 65 61 72 65 64 0a 00 dump cleared.. 0000662f : 662f: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 663f: 65 0a 00 e.. 00006642 : 6642: 44 32 31 20 2d 20 72 65 61 64 20 63 72 61 73 68 D21 - read crash 6652: 20 64 75 6d 70 0a 00 dump.. 00006659 : 6659: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 6669: 65 0a 00 e.. 0000666c : 666c: 64 75 6d 70 20 63 6f 6d 70 6c 65 74 65 64 20 69 dump completed i 667c: 6e 20 25 6c 75 6d 73 0a 00 n %lums.. 00006685 : 6685: 58 46 4c 41 53 48 00 XFLASH. 0000668c : 668c: 45 45 50 52 4f 4d 00 EEPROM. 00006693 : 6693: 53 52 41 4d 00 SRAM. 00006698 : 6698: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 66a8: 6f 70 0a 00 op.. 000066ac : 66ac: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 66bc: 20 30 00 0. 000066bf : 66bf: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 000066d0 : 66d0: 74 6d 63 32 31 33 30 5f 70 72 69 6e 74 5f 63 75 tmc2130_print_cu 66e0: 72 72 65 6e 74 73 28 29 0a 09 48 09 52 0a 58 09 rrents()..H.R.X. 66f0: 25 64 09 25 64 0a 59 09 25 64 09 25 64 0a 5a 09 %d.%d.Y.%d.%d.Z. 6700: 25 64 09 25 64 0a 45 09 25 64 09 25 64 0a 00 %d.%d.E.%d.%d.. 0000670f : 670f: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 671f: 20 00 . 00006721 : 6721: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 6731: 20 22 00 ". 00006734 <_ZZ16process_commandsvE3__c__65_>: 6734: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 6744: 72 75 64 65 72 20 00 ruder . 0000674b : 674b: 7a 5f 6d 61 78 3a 20 00 z_max: . 00006753 : 6753: 7a 5f 6d 69 6e 3a 20 00 z_min: . 0000675b <_ZZ16process_commandsvE3__c__64_>: 675b: 79 5f 6d 61 78 3a 20 00 y_max: . 00006763 <_ZZ16process_commandsvE3__c__63_>: 6763: 79 5f 6d 69 6e 3a 20 00 y_min: . 0000676b <_ZZ16process_commandsvE3__c__62_>: 676b: 78 5f 6d 61 78 3a 20 00 x_max: . 00006773 : 6773: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 0000677d : 677d: 6f 70 65 6e 00 open. 00006782 <_ZZ16process_commandsvE3__c__61_>: 6782: 78 5f 6d 69 6e 3a 20 00 x_min: . 0000678a <_ZZ16process_commandsvE3__c__60_>: 678a: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 679a: 70 20 73 74 61 74 75 73 00 p status. 000067a3 : 67a3: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 67b3: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 000067c0 : 67c0: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 67d0: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 000067dd : 67dd: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 61 75 //action:uvlo_au 67ed: 74 6f 5f 72 65 63 6f 76 65 72 79 5f 72 65 61 64 to_recovery_read 67fd: 79 00 y. 000067ff <_ZZ16process_commandsvE3__c__46_>: 67ff: 25 53 3a 25 6c 75 20 63 6d 0a 25 53 3a 25 6c 75 %S:%lu cm.%S:%lu 680f: 20 6d 69 6e 0a 00 min.. 00006815 <_ZZ16process_commandsvE3__c__45_>: 6815: 53 49 4c 45 4e 54 00 SILENT. 0000681c <_ZZ16process_commandsvE3__c__44_>: 681c: 4e 4f 52 4d 41 4c 00 NORMAL. 00006823 <_ZZ16process_commandsvE3__c__43_>: 6823: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 6833: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 6843: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 6853: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 6863: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 6873: 64 0a 00 d.. 00006876 <_ZZ16process_commandsvE3__c__42_>: 6876: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 6886: 0a 00 .. 00006888 <_ZZ16process_commandsvE3__c__38_>: 6888: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 00006896 <_ZZ16process_commandsvE3__c__37_>: 6896: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 000068a6 : 68a6: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 68b6: 20 25 73 0a 00 %s.. 000068bb <_ZZ16process_commandsvE3__c__35_>: 68bb: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 68cb: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 68db: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 000068e7 <_ZZ16process_commandsvE3__c__34_>: 68e7: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 000068f4 <_ZZ16process_commandsvE3__c__33_>: 68f4: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 6904: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 6914: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6924: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 00006930 <_ZZ16process_commandsvE3__c__32_>: 6930: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 0000693d <_ZZ16process_commandsvE3__c__31_>: 693d: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 694d: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006956 <_ZZ16process_commandsvE3__c__28_>: 6956: 25 64 20 20 25 2e 32 66 00 %d %.2f. 0000695f <_ZZ16process_commandsvE3__c__27_>: 695f: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 696f: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 0000697b <_ZZ16process_commandsvE3__c__26_>: 697b: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006984 <_ZZ16process_commandsvE3__c__10_>: 6984: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6994: 64 20 52 50 4d 0a 00 d RPM.. 0000699b : 699b: 47 39 30 00 G90. 0000699f : 699f: 4d 31 30 37 00 M107. 000069a4 : 69a4: 42 3a 20 25 33 64 20 20 20 20 20 58 64 3a 25 36 B: %3d Xd:%6 69b4: 64 0a 53 3a 20 25 33 64 20 20 20 20 20 59 64 3a d.S: %3d Yd: 69c4: 25 36 64 00 %6d. 000069c8 : 69c8: 46 49 4e 44 41 00 FINDA. 000069ce : 69ce: 50 49 4e 44 41 00 PINDA. 000069d4 : 69d4: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 69e4: 3a 20 25 64 0a 00 : %d.. 000069ea : 69ea: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 000069f4 : 69f4: 46 69 72 6d 77 61 72 65 00 Firmware. 000069fd : 69fd: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00006a0a : 6a0a: 46 6c 61 73 68 41 69 72 00 FlashAir. 00006a13 : 6a13: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 63 61 Thermal Model ca 6a23: 6c 2e 00 l.. 00006a26 : 6a26: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6a36: 52 4f 52 00 ROR. 00006a3a : 6a3a: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6a4a: 52 52 4f 52 00 RROR. 00006a4f : 6a4f: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006a60 : 6a60: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006a70 : 6a70: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006a7f : 6a7f: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6a8f: 64 79 00 dy. 00006a92 : 6a92: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006aa2 : 6aa2: 4d 38 34 00 M84. 00006aa6 : 6aa6: 41 78 69 73 20 6c 65 6e 67 74 68 20 64 69 66 66 Axis length diff 6ab6: 65 72 65 6e 63 65 3a 25 2e 33 66 0a 00 erence:%.3f.. 00006ac3 : 6ac3: 4d 65 61 73 75 72 65 64 20 61 78 69 73 20 6c 65 Measured axis le 6ad3: 6e 67 74 68 3a 25 2e 33 66 0a 00 ngth:%.3f.. 00006ade : 6ade: 4f 4b 00 OK. 00006ae1 : 6ae1: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6af1: 65 64 00 ed. 00006af4 <_ZZN10CardReader7releaseEvE3__c.lto_priv.536>: 6af4: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006b05 : 6b05: 46 61 6b 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 Fake serial numb 6b15: 65 72 00 er. 00006b18 : 6b18: 45 2d 63 6f 6f 6c 20 6d 6f 64 65 00 E-cool mode. 00006b24 : 6b24: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006b33 : 6b33: 47 39 31 00 G91. 00006b37 : 6b37: 4d 37 30 32 00 M702. 00006b3c : 6b3c: 4d 38 33 00 M83. 00006b40 : 6b40: 47 32 38 20 57 00 G28 W. 00006b46 : 6b46: 4d 35 30 30 00 M500. 00006b4b : 6b4b: 45 78 74 65 72 6e 61 6c 20 53 50 49 20 66 6c 61 External SPI fla 6b5b: 73 68 0a 58 46 4c 41 53 48 20 69 73 20 6e 6f 74 sh.XFLASH is not 6b6b: 20 72 65 73 2d 0a 70 6f 6e 64 69 6e 67 2e 20 4c res-.ponding. L 6b7b: 61 6e 67 75 61 67 65 0a 73 77 69 74 63 68 20 75 anguage.switch u 6b8b: 6e 61 76 61 69 6c 61 62 6c 65 2e 00 navailable.. 00006b97 : 6b97: 58 46 4c 41 53 48 20 6e 6f 74 20 72 65 73 70 6f XFLASH not respo 6ba7: 6e 64 69 6e 67 2e 00 nding.. 00006bae : 6bae: 46 57 20 63 72 61 73 68 20 64 65 74 65 63 74 65 FW crash detecte 6bbe: 64 21 20 59 6f 75 20 63 61 6e 20 63 6f 6e 74 69 d! You can conti 6bce: 6e 75 65 20 70 72 69 6e 74 69 6e 67 2e 20 44 65 nue printing. De 6bde: 62 75 67 20 64 61 74 61 20 61 76 61 69 6c 61 62 bug data availab 6bee: 6c 65 20 66 6f 72 20 61 6e 61 6c 79 73 69 73 2e le for analysis. 6bfe: 20 43 6f 6e 74 61 63 74 20 73 75 70 70 6f 72 74 Contact support 6c0e: 20 74 6f 20 73 75 62 6d 69 74 20 64 65 74 61 69 to submit detai 6c1e: 6c 73 2e 00 ls.. 00006c22 : 6c22: 2f 2f 61 63 74 69 6f 6e 3a 64 75 6d 70 5f 61 76 //action:dump_av 6c32: 61 69 6c 61 62 6c 65 00 ailable. 00006c3a <_ZZ5setupE3__c__11_>: 6c3a: 43 72 61 73 68 44 65 74 65 63 74 20 44 49 53 41 CrashDetect DISA 6c4a: 42 4c 45 44 00 BLED. 00006c4f <_ZZ5setupE3__c__10_>: 6c4f: 43 72 61 73 68 44 65 74 65 63 74 20 45 4e 41 42 CrashDetect ENAB 6c5f: 4c 45 44 21 00 LED!. 00006c64 : 6c64: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6c74: 79 74 65 73 3a 20 00 ytes: . 00006c7b : 6c7b: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006c8a : 6c8a: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006c96 : 6c96: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006ca6 : 6ca6: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006cb6 : 6cb6: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006cc6 : 6cc6: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006cd7 : 6cd7: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006ce7 : 6ce7: 50 6f 77 65 72 55 70 00 PowerUp. 00006cef : 6cef: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6cff: 20 66 69 6c 65 00 file. 00006d05 : 6d05: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6d15: 2e 00 .. 00006d17 : 6d17: 6f 6b 00 ok. 00006d1a : 6d1a: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006d23 : 6d23: 50 4f 57 45 52 20 50 41 4e 49 43 20 44 45 54 45 POWER PANIC DETE 6d33: 43 54 45 44 00 CTED. 00006d38 : 6d38: 55 56 4c 4f 20 2d 20 65 6e 64 20 25 64 0a 00 UVLO - end %d.. 00006d47 : 6d47: 55 56 4c 4f 5f 54 49 4e 59 20 2d 20 65 6e 64 20 UVLO_TINY - end 6d57: 25 64 0a 00 %d.. 00006d5b : 6d5b: 77 6f 72 6c 64 20 63 6f 6f 72 64 69 6e 61 74 65 world coordinate 6d6b: 73 3a 20 28 25 2e 33 66 2c 20 25 2e 33 66 2c 20 s: (%.3f, %.3f, 6d7b: 25 2e 33 66 29 0a 00 %.3f).. 00006d82 : 6d82: 4d 32 32 30 20 53 25 64 00 M220 S%d. 00006d8b : 6d8b: 44 6f 6e 65 20 72 65 61 64 69 6e 67 20 45 45 50 Done reading EEP 6d9b: 52 4f 4d 0a 00 ROM.. 00006da0 : 6da0: 54 65 6d 70 65 72 61 74 75 72 65 20 52 65 73 74 Temperature Rest 6db0: 6f 72 65 64 0a 00 ored.. 00006db6 : 6db6: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00006dc6 : 6dc6: 54 4d 43 20 44 52 49 56 45 52 20 4f 56 45 52 54 TMC DRIVER OVERT 6dd6: 45 4d 50 00 EMP. 00006dda : 6dda: 48 6f 6c 64 20 63 75 72 72 65 6e 74 20 74 72 75 Hold current tru 6dea: 6e 63 61 74 65 64 20 74 6f 20 52 75 6e 20 63 75 ncated to Run cu 6dfa: 72 72 65 6e 74 00 rrent. 00006e00 : 6e00: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006e0a : 6e0a: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006e13 : 6e13: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006e1c : 6e1c: 86 25 33 64 25 25 00 .%3d%%. 00006e23 : 6e23: 2d 2d 2d 25 25 00 ---%%. 00006e29 : 6e29: 25 33 64 25 25 00 %3d%%. 00006e2f : 6e2f: 20 53 44 00 SD. 00006e33 : 6e33: 20 20 20 00 . 00006e37 : 6e37: 20 48 4f 00 HO. 00006e3b : 6e3b: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006e46 : 6e46: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006e55 : 6e55: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006e65 : 6e65: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006e74 <_ZZL16lcd_support_menuvE3__c__16_>: 6e74: 44 75 6d 70 20 6d 65 6d 6f 72 79 00 Dump memory. 00006e80 : 6e80: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006e91 : 6e91: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6ea1: 6d 00 m. 00006ea3 : 6ea3: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006eaf : 6eaf: 4d 37 30 31 00 M701. 00006eb4 : 6eb4: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6ec4: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6ed4: 32 64 6d 00 2dm. 00006ed8 : 6ed8: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6ee8: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6ef8: 32 64 73 00 2ds. 00006efc : 6efc: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00006f04 : 6f04: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00006f12 : 6f12: 25 33 2e 32 66 81 00 %3.2f.. 00006f19 : 6f19: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 6f29: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 6f39: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 00006f46 : 6f46: 20 20 30 00 0. 00006f4a : 6f4a: 20 20 31 00 1. 00006f4e : 6f4e: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 6f5e: 25 66 20 25 66 0a 00 %f %f.. 00006f65 : 6f65: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6f75: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6f85: 69 6c 65 64 2e 0a 00 iled... 00006f8c : 6f8c: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6f9c: 65 73 73 2e 0a 00 ess... 00006fa2 : 6fa2: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6fb2: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006fc3 : 6fc3: 31 2f 34 00 1/4. 00006fc7 : 6fc7: 31 2f 34 00 1/4. 00006fcb : 6fcb: 31 2f 39 00 1/9. 00006fcf : 6fcf: 50 72 75 73 61 20 69 33 20 4d 4b 33 2d 52 20 4f Prusa i3 MK3-R O 6fdf: 4b 2e 00 K.. 00006fe2 : 6fe2: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00006fed : 6fed: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 00006ffd : 6ffd: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 700d: 65 64 00 ed. 00007010 : 7010: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 0000701d : 701d: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 702d: 65 3a 20 00 e: . 00007031 : 7031: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 7041: 64 69 72 3a 20 00 dir: . 00007047 : 7047: 4d 36 30 30 00 M600. 0000704c : 704c: 4d 32 34 00 M24. 00007050 : 7050: 4d 32 33 20 25 73 00 M23 %s. 00007057 : 7057: 31 2f 39 00 1/9. 0000705b : 705b: 88 00 .. 0000705d : 705d: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 706d: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 0000707b : 707b: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 708b: 70 72 65 76 65 6e 74 65 64 00 prevented. 00007095 : 7095: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 000070a2 <__noloc_end>: 70a2: 08 4a sbci r16, 0xA8 ; 168 70a4: d7 3b cpi r29, 0xB7 ; 183 70a6: 3b ce rjmp .-906 ; 0x6d1e 70a8: 01 6e ori r16, 0xE1 ; 225 70aa: 84 bc out 0x24, r8 ; 36 70ac: bf fd .word 0xfdbf ; ???? 70ae: c1 2f mov r28, r17 70b0: 3d 6c ori r19, 0xCD ; 205 70b2: 74 31 cpi r23, 0x14 ; 20 70b4: 9a bd out 0x2a, r25 ; 42 70b6: 56 83 std Z+6, r21 ; 0x06 70b8: 3d da rcall .-2950 ; 0x6534 <__c.2348+0x5> 70ba: 3d 00 .word 0x003d ; ???? 70bc: c7 7f andi r28, 0xF7 ; 247 70be: 11 be out 0x31, r1 ; 49 70c0: d9 e4 ldi r29, 0x49 ; 73 70c2: bb 4c sbci r27, 0xCB ; 203 70c4: 3e 91 ld r19, -X 70c6: 6b aa std Y+51, r6 ; 0x33 70c8: aa be out 0x3a, r10 ; 58 70ca: 00 00 nop 70cc: 00 80 ld r0, Z 70ce: 3f 05 cpc r19, r15 70d0: a8 4c sbci r26, 0xC8 ; 200 70d2: cd b2 in r12, 0x1d ; 29 70d4: d4 4e sbci r29, 0xE4 ; 228 70d6: b9 38 cpi r27, 0x89 ; 137 70d8: 36 a9 ldd r19, Z+54 ; 0x36 70da: 02 0c add r0, r2 70dc: 50 b9 out 0x00, r21 ; 0 70de: 91 86 std Z+9, r9 ; 0x09 70e0: 88 08 sbc r8, r8 70e2: 3c a6 std Y+44, r3 ; 0x2c 70e4: aa aa std Y+50, r10 ; 0x32 70e6: 2a be out 0x3a, r2 ; 58 70e8: 00 00 nop 70ea: 00 80 ld r0, Z 70ec: 3f 07 cpc r19, r31 70ee: 63 42 sbci r22, 0x23 ; 35 70f0: 36 b7 in r19, 0x36 ; 54 70f2: 9b d8 rcall .-3786 ; 0x622a 70f4: a7 1a sub r10, r23 70f6: 39 68 ori r19, 0x89 ; 137 70f8: 56 18 sub r5, r6 70fa: ae ba out 0x1e, r10 ; 30 70fc: ab 55 subi r26, 0x5B ; 91 70fe: 8c 1d adc r24, r12 7100: 3c b7 in r19, 0x3c ; 60 7102: cc 57 subi r28, 0x7C ; 124 7104: 63 bd out 0x23, r22 ; 35 7106: 6d ed ldi r22, 0xDD ; 221 7108: fd 75 andi r31, 0x5D ; 93 710a: 3e f6 brtc .-114 ; 0x709a 710c: 17 72 andi r17, 0x27 ; 39 710e: 31 bf out 0x31, r19 ; 49 7110: 00 00 nop 7112: 00 80 ld r0, Z 7114: 3f 08 sbc r3, r15 7116: 00 00 nop 7118: 00 be out 0x30, r0 ; 48 711a: 92 24 eor r9, r2 711c: 49 12 cpse r4, r25 711e: 3e ab std Y+54, r19 ; 0x36 7120: aa aa std Y+50, r10 ; 0x32 7122: 2a be out 0x3a, r2 ; 58 7124: cd cc rjmp .-1638 ; 0x6ac0 7126: cc 4c sbci r28, 0xCC ; 204 7128: 3e 00 .word 0x003e ; ???? 712a: 00 00 nop 712c: 80 be out 0x30, r8 ; 48 712e: ab aa std Y+51, r10 ; 0x33 7130: aa aa std Y+50, r10 ; 0x32 7132: 3e 00 .word 0x003e ; ???? 7134: 00 00 nop 7136: 00 bf out 0x30, r16 ; 48 7138: 00 00 nop 713a: 00 80 ld r0, Z 713c: 3f 00 .word 0x003f ; ???? 713e: 00 00 nop 7140: 00 00 nop 7142: 08 41 sbci r16, 0x18 ; 24 7144: 78 d3 rcall .+1776 ; 0x7836 7146: bb 43 sbci r27, 0x3B ; 59 7148: 87 d1 rcall .+782 ; 0x7458 <__trampolines_start+0x2e8> 714a: 13 3d cpi r17, 0xD3 ; 211 714c: 19 0e add r1, r25 714e: 3c c3 rjmp .+1656 ; 0x77c8 7150: bd 42 sbci r27, 0x2D ; 45 7152: 82 ad ldd r24, Z+58 ; 0x3a 7154: 2b 3e cpi r18, 0xEB ; 235 7156: 68 ec ldi r22, 0xC8 ; 200 7158: 82 76 andi r24, 0x62 ; 98 715a: be d9 rcall .-3204 ; 0x64d8 715c: 8f e1 ldi r24, 0x1F ; 31 715e: a9 3e cpi r26, 0xE9 ; 233 7160: 4c 80 ldd r4, Y+4 ; 0x04 7162: ef ff .word 0xffef ; ???? 7164: be 01 movw r22, r28 7166: c4 ff sbrs r28, 4 7168: 7f 3f cpi r23, 0xFF ; 255 716a: 00 00 nop 716c: 00 00 nop ... 00007170 <__trampolines_start>: 7170: 0c 94 8a ef jmp 0x1df14 ; 0x1df14 7174: 0c 94 22 fb jmp 0x1f644 ; 0x1f644 7178: 0c 94 71 ea jmp 0x1d4e2 ; 0x1d4e2 717c: 0d 94 c8 08 jmp 0x21190 ; 0x21190 7180: 0d 94 62 1d jmp 0x23ac4 ; 0x23ac4 7184: 0c 94 53 e2 jmp 0x1c4a6 ; 0x1c4a6 7188: 0c 94 ac e0 jmp 0x1c158 ; 0x1c158 718c: 0d 94 d1 22 jmp 0x245a2 ; 0x245a2 7190: 0c 94 7b cf jmp 0x19ef6 ; 0x19ef6 7194: 0c 94 9e ea jmp 0x1d53c ; 0x1d53c 7198: 0c 94 36 74 jmp 0xe86c ; 0xe86c <__vector_23+0x128> 719c: 0c 94 f6 f0 jmp 0x1e1ec ; 0x1e1ec 71a0: 0c 94 e1 e0 jmp 0x1c1c2 ; 0x1c1c2 71a4: 0c 94 99 d2 jmp 0x1a532 ; 0x1a532 71a8: 0c 94 ed d0 jmp 0x1a1da ; 0x1a1da 71ac: 0d 94 26 a7 jmp 0x34e4c ; 0x34e4c 71b0: 0c 94 cb f5 jmp 0x1eb96 ; 0x1eb96 71b4: 0d 94 8d 0a jmp 0x2151a ; 0x2151a 71b8: 0c 94 b6 d5 jmp 0x1ab6c ; 0x1ab6c 71bc: 0d 94 c4 19 jmp 0x23388 ; 0x23388 71c0: 0c 94 c6 ea jmp 0x1d58c ; 0x1d58c 71c4: 0c 94 08 f1 jmp 0x1e210 ; 0x1e210 71c8: 0c 94 94 d1 jmp 0x1a328 ; 0x1a328 71cc: 0c 94 a8 ea jmp 0x1d550 ; 0x1d550 71d0: 0c 94 4d fb jmp 0x1f69a ; 0x1f69a 71d4: 0c 94 af e3 jmp 0x1c75e ; 0x1c75e 71d8: 0d 94 35 2c jmp 0x2586a ; 0x2586a 71dc: 0c 94 13 74 jmp 0xe826 ; 0xe826 <__vector_23+0xe2> 71e0: 0c 94 e0 cd jmp 0x19bc0 ; 0x19bc0 71e4: 0d 94 3e 51 jmp 0x2a27c ; 0x2a27c 71e8: 0c 94 6b fa jmp 0x1f4d6 ; 0x1f4d6 71ec: 0d 94 3a ad jmp 0x35a74 ; 0x35a74 71f0: 0c 94 73 70 jmp 0xe0e6 ; 0xe0e6 71f4: 0c 94 6b da jmp 0x1b4d6 ; 0x1b4d6 71f8: 0c 94 ae ce jmp 0x19d5c ; 0x19d5c 71fc: 0c 94 d8 cd jmp 0x19bb0 ; 0x19bb0 7200: 0d 94 6f a0 jmp 0x340de ; 0x340de 7204: 0d 94 91 0a jmp 0x21522 ; 0x21522 7208: 0d 94 48 17 jmp 0x22e90 ; 0x22e90 720c: 0d 94 4f 19 jmp 0x2329e ; 0x2329e 7210: 0c 94 da d0 jmp 0x1a1b4 ; 0x1a1b4 7214: 0d 94 27 52 jmp 0x2a44e ; 0x2a44e 7218: 0c 94 a3 d4 jmp 0x1a946 ; 0x1a946 721c: 0d 94 72 52 jmp 0x2a4e4 ; 0x2a4e4 7220: 0c 94 f4 cd jmp 0x19be8 ; 0x19be8 7224: 0c 94 1b fa jmp 0x1f436 ; 0x1f436 7228: 0c 94 6d dc jmp 0x1b8da ; 0x1b8da 722c: 0c 94 86 d4 jmp 0x1a90c ; 0x1a90c ()> 7230: 0c 94 b3 cd jmp 0x19b66 ; 0x19b66 7234: 0d 94 72 a0 jmp 0x340e4 ; 0x340e4 7238: 0c 94 3f e2 jmp 0x1c47e ; 0x1c47e 723c: 0c 94 a8 ce jmp 0x19d50 ; 0x19d50 7240: 0c 94 29 ef jmp 0x1de52 ; 0x1de52 7244: 0c 94 e1 fa jmp 0x1f5c2 ; 0x1f5c2 7248: 0c 94 e6 e2 jmp 0x1c5cc ; 0x1c5cc 724c: 0c 94 d2 cd jmp 0x19ba4 ; 0x19ba4 7250: 0d 94 91 2c jmp 0x25922 ; 0x25922 7254: 0c 94 b2 ea jmp 0x1d564 ; 0x1d564 7258: 0c 94 ce cd jmp 0x19b9c ; 0x19b9c 725c: 0c 94 ae e2 jmp 0x1c55c ; 0x1c55c 7260: 0c 94 9c d0 jmp 0x1a138 ; 0x1a138 7264: 0d 94 59 1d jmp 0x23ab2 ; 0x23ab2 7268: 0d 94 05 18 jmp 0x2300a ; 0x2300a 726c: 0d 94 29 a7 jmp 0x34e52 ; 0x34e52 7270: 0d 94 da 3f jmp 0x27fb4 ; 0x27fb4 7274: 0c 94 43 ea jmp 0x1d486 ; 0x1d486 7278: 0c 94 ed fa jmp 0x1f5da ; 0x1f5da 727c: 0c 94 94 ea jmp 0x1d528 ; 0x1d528 7280: 0c 94 34 ea jmp 0x1d468 ; 0x1d468 7284: 0c 94 85 ea jmp 0x1d50a ; 0x1d50a 7288: 0c 94 b9 e1 jmp 0x1c372 ; 0x1c372 728c: 0c 94 9f d4 jmp 0x1a93e ; 0x1a93e ()> 7290: 0c 94 dc cd jmp 0x19bb8 ; 0x19bb8 7294: 0d 94 9b 21 jmp 0x24336 ; 0x24336 7298: 0d 94 ce 08 jmp 0x2119c ; 0x2119c 729c: 0c 94 e3 75 jmp 0xebc6 ; 0xebc6 72a0: 0c 94 57 ea jmp 0x1d4ae ; 0x1d4ae 72a4: 0c 94 bc ea jmp 0x1d578 ; 0x1d578 72a8: 0c 94 95 d4 jmp 0x1a92a ; 0x1a92a ()> 72ac: 0d 94 06 a0 jmp 0x3400c ; 0x3400c 72b0: 0d 94 60 17 jmp 0x22ec0 ; 0x22ec0 72b4: 0c 94 ad f8 jmp 0x1f15a ; 0x1f15a 72b8: 0c 94 c5 cd jmp 0x19b8a ; 0x19b8a 72bc: 0d 94 2b 1a jmp 0x23456 ; 0x23456 72c0: 0c 94 68 d0 jmp 0x1a0d0 ; 0x1a0d0 72c4: 0d 94 c1 51 jmp 0x2a382 ; 0x2a382 72c8: 0c 94 8d d1 jmp 0x1a31a ; 0x1a31a 72cc: 0c 94 aa e1 jmp 0x1c354 ; 0x1c354 72d0: 0c 94 81 d4 jmp 0x1a902 ; 0x1a902 ()> 72d4: 0c 94 4b da jmp 0x1b496 ; 0x1b496 72d8: 0d 94 4f 11 jmp 0x2229e ; 0x2229e 72dc: 0c 94 06 d8 jmp 0x1b00c ; 0x1b00c 72e0: 0c 94 07 fb jmp 0x1f60e ; 0x1f60e 72e4: 0c 94 05 e4 jmp 0x1c80a ; 0x1c80a 72e8: 0d 94 c4 2c jmp 0x25988 ; 0x25988 72ec: 0c 94 25 d5 jmp 0x1aa4a ; 0x1aa4a 72f0: 0c 94 53 f5 jmp 0x1eaa6 ; 0x1eaa6 72f4: 0d 94 ed 51 jmp 0x2a3da ; 0x2a3da 72f8: 0d 94 2c a7 jmp 0x34e58 ; 0x34e58 72fc: 0d 94 9c 0c jmp 0x21938 ; 0x21938 7300: 0c 94 6d e2 jmp 0x1c4da ; 0x1c4da 7304: 0c 94 5e e2 jmp 0x1c4bc ; 0x1c4bc 7308: 0d 94 05 1b jmp 0x2360a ; 0x2360a 730c: 0d 94 9e 15 jmp 0x22b3c ; 0x22b3c 7310: 0c 94 bf f0 jmp 0x1e17e ; 0x1e17e 7314: 0c 94 49 d0 jmp 0x1a092 ; 0x1a092 7318: 0d 94 09 ad jmp 0x35a12 ; 0x35a12 731c: 0d 94 22 0b jmp 0x21644 ; 0x21644 7320: 0c 94 a4 e1 jmp 0x1c348 ; 0x1c348 7324: 0d 94 75 a0 jmp 0x340ea ; 0x340ea 7328: 0c 94 e1 d4 jmp 0x1a9c2 ; 0x1a9c2 732c: 0c 94 4d ea jmp 0x1d49a ; 0x1d49a 7330: 0c 94 a1 e1 jmp 0x1c342 ; 0x1c342 7334: 0c 94 2e d5 jmp 0x1aa5c ; 0x1aa5c 7338: 0d 94 d1 18 jmp 0x231a2 ; 0x231a2 733c: 0d 94 56 51 jmp 0x2a2ac ; 0x2a2ac 7340: 0c 94 a7 fa jmp 0x1f54e ; 0x1f54e 7344: 0c 94 0a 74 jmp 0xe814 ; 0xe814 <__vector_23+0xd0> 7348: 0d 94 65 17 jmp 0x22eca ; 0x22eca 734c: 0d 94 28 ad jmp 0x35a50 ; 0x35a50 7350: 0d 94 62 52 jmp 0x2a4c4 ; 0x2a4c4 7354: 0d 94 6a 52 jmp 0x2a4d4 ; 0x2a4d4 7358: 0c 94 2f db jmp 0x1b65e ; 0x1b65e 735c: 0c 94 1b d0 jmp 0x1a036 ; 0x1a036 7360: 0c 94 f8 cd jmp 0x19bf0 ; 0x19bf0 7364: 0d 94 7a 52 jmp 0x2a4f4 ; 0x2a4f4 7368: 0c 94 82 cf jmp 0x19f04 ; 0x19f04 736c: 0d 94 54 17 jmp 0x22ea8 ; 0x22ea8 7370: 0d 94 5a 52 jmp 0x2a4b4 ; 0x2a4b4 7374: 0c 94 72 d0 jmp 0x1a0e4 ; 0x1a0e4 7378: 0d 94 48 22 jmp 0x24490 ; 0x24490 737c: 0c 94 c3 d0 jmp 0x1a186 ; 0x1a186 7380: 0d 94 54 10 jmp 0x220a8 ; 0x220a8 7384: 0c 94 7c d0 jmp 0x1a0f8 ; 0x1a0f8 7388: 0d 94 2a 52 jmp 0x2a454 ; 0x2a454 738c: 0c 94 0e e0 jmp 0x1c01c ; 0x1c01c 7390: 0d 94 ea 0f jmp 0x21fd4 ; 0x21fd4 7394: 0d 94 c7 a6 jmp 0x34d8e ; 0x34d8e 7398: 0d 94 a2 15 jmp 0x22b44 ; 0x22b44 739c: 0c 94 14 e0 jmp 0x1c028 ; 0x1c028 73a0: 0c 94 e6 73 jmp 0xe7cc ; 0xe7cc <__vector_23+0x88> 73a4: 0c 94 b9 cd jmp 0x19b72 ; 0x19b72 73a8: 0d 94 32 52 jmp 0x2a464 ; 0x2a464 73ac: 0d 94 79 0b jmp 0x216f2 ; 0x216f2 73b0: 0c 94 18 fb jmp 0x1f630 ; 0x1f630 73b4: 0d 94 b3 17 jmp 0x22f66 ; 0x22f66 73b8: 0d 94 be d4 jmp 0x3a97c ; 0x3a97c 73bc: 0d 94 47 1d jmp 0x23a8e ; 0x23a8e 73c0: 0c 94 89 cf jmp 0x19f12 ; 0x19f12 73c4: 0c 94 79 d9 jmp 0x1b2f2 ; 0x1b2f2 73c8: 0d 94 48 2c jmp 0x25890 ; 0x25890 73cc: 0d 94 20 19 jmp 0x23240 ; 0x23240 73d0: 0c 94 e3 cf jmp 0x19fc6 ; 0x19fc6 73d4: 0d 94 25 ad jmp 0x35a4a ; 0x35a4a 73d8: 0c 94 c1 cd jmp 0x19b82 ; 0x19b82 73dc: 0c 94 cc e4 jmp 0x1c998 ; 0x1c998 73e0: 0c 94 a6 d0 jmp 0x1a14c ; 0x1a14c 73e4: 0c 94 9d fa jmp 0x1f53a ; 0x1f53a 73e8: 0c 94 88 d0 jmp 0x1a110 ; 0x1a110 73ec: 0d 94 8c 1f jmp 0x23f18 ; 0x23f18 73f0: 0d 94 32 30 jmp 0x26064 ; 0x26064 73f4: 0d 94 80 16 jmp 0x22d00 ; 0x22d00 73f8: 0d 94 85 51 jmp 0x2a30a ; 0x2a30a 73fc: 0c 94 4c f1 jmp 0x1e298 ; 0x1e298 7400: 0c 94 b8 d0 jmp 0x1a170 ; 0x1a170 7404: 0d 94 90 a0 jmp 0x34120 ; 0x34120 7408: 0c 94 2c ea jmp 0x1d458 ; 0x1d458 740c: 0d 94 20 0a jmp 0x21440 ; 0x21440 7410: 0c 94 8b d4 jmp 0x1a916 ; 0x1a916 ()> 7414: 0c 94 f5 f8 jmp 0x1f1ea ; 0x1f1ea 7418: 0d 94 21 52 jmp 0x2a442 ; 0x2a442 741c: 0d 94 cc 0d jmp 0x21b98 ; 0x21b98 7420: 0c 94 a7 e1 jmp 0x1c34e ; 0x1c34e 7424: 0d 94 f3 51 jmp 0x2a3e6 ; 0x2a3e6 7428: 0c 94 30 fb jmp 0x1f660 ; 0x1f660 742c: 0c 94 47 f0 jmp 0x1e08e ; 0x1e08e 7430: 0d 94 24 52 jmp 0x2a448 ; 0x2a448 7434: 0c 94 0f d0 jmp 0x1a01e ; 0x1a01e 7438: 0d 94 37 11 jmp 0x2226e ; 0x2226e 743c: 0c 94 2f e2 jmp 0x1c45e ; 0x1c45e 7440: 0d 94 ae a6 jmp 0x34d5c ; 0x34d5c 7444: 0c 94 b0 d1 jmp 0x1a360 ; 0x1a360 7448: 0d 94 d5 2c jmp 0x259aa ; 0x259aa 744c: 0d 94 ba 40 jmp 0x28174 ; 0x28174 7450: 0c 94 ad e1 jmp 0x1c35a ; 0x1c35a 7454: 0c 94 2e d0 jmp 0x1a05c ; 0x1a05c 7458: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 745c: 0d 94 e3 0b jmp 0x217c6 ; 0x217c6 7460: 0d 94 70 1a jmp 0x234e0 ; 0x234e0 7464: 0d 94 35 ad jmp 0x35a6a ; 0x35a6a 7468: 0d 94 c3 ac jmp 0x35986 ; 0x35986 746c: 0d 94 4a 52 jmp 0x2a494 ; 0x2a494 7470: 0c 94 92 d0 jmp 0x1a124 ; 0x1a124 7474: 0c 94 c1 73 jmp 0xe782 ; 0xe782 <__vector_23+0x3e> 7478: 0d 94 1e a0 jmp 0x3403c ; 0x3403c 747c: 0d 94 52 52 jmp 0x2a4a4 ; 0x2a4a4 7480: 0c 94 7c d4 jmp 0x1a8f8 ; 0x1a8f8 ()> 7484: 0c 94 5e d0 jmp 0x1a0bc ; 0x1a0bc 7488: 0c 94 91 fa jmp 0x1f522 ; 0x1f522 748c: 0c 94 05 ce jmp 0x19c0a ; 0x19c0a 7490: 0d 94 69 10 jmp 0x220d2 ; 0x220d2 7494: 0c 94 28 e0 jmp 0x1c050 ; 0x1c050 7498: 0c 94 db 73 jmp 0xe7b6 ; 0xe7b6 <__vector_23+0x72> 749c: 0d 94 3a 52 jmp 0x2a474 ; 0x2a474 74a0: 0c 94 54 d0 jmp 0x1a0a8 ; 0x1a0a8 74a4: 0c 94 90 d4 jmp 0x1a920 ; 0x1a920 ()> 74a8: 0d 94 09 a7 jmp 0x34e12 ; 0x34e12 74ac: 0d 94 fa 9f jmp 0x33ff4 ; 0x33ff4 74b0: 0c 94 cb 76 jmp 0xed96 ; 0xed96 74b4: 0c 94 9a d4 jmp 0x1a934 ; 0x1a934 ()> 74b8: 0d 94 84 a0 jmp 0x34108 ; 0x34108 74bc: 0d 94 63 a0 jmp 0x340c6 ; 0x340c6 74c0: 0c 94 4c f2 jmp 0x1e498 ; 0x1e498 74c4: 0c 94 b6 e0 jmp 0x1c16c ; 0x1c16c 74c8: 0c 94 48 74 jmp 0xe890 ; 0xe890 <__vector_23+0x14c> 74cc: 0d 94 88 51 jmp 0x2a310 ; 0x2a310 74d0: 0d 94 f0 51 jmp 0x2a3e0 ; 0x2a3e0 74d4: 0d 94 2c ad jmp 0x35a58 ; 0x35a58 74d8: 0c 94 e6 cd jmp 0x19bcc ; 0x19bcc 74dc: 0c 94 6a e1 jmp 0x1c2d4 ; 0x1c2d4 74e0: 0d 94 6d 17 jmp 0x22eda ; 0x22eda 74e4: 0c 94 b5 e5 jmp 0x1cb6a ; 0x1cb6a 74e8: 0c 94 f4 73 jmp 0xe7e8 ; 0xe7e8 <__vector_23+0xa4> 74ec: 0c 94 39 fb jmp 0x1f672 ; 0x1f672 74f0: 0d 94 b7 d2 jmp 0x3a56e ; 0x3a56e <_menu_edit_P()> 74f4: 0d 94 42 52 jmp 0x2a484 ; 0x2a484 74f8: 0c 94 f3 cd jmp 0x19be6 ; 0x19be6 74fc: 0c 94 b0 e1 jmp 0x1c360 ; 0x1c360 7500: 0c 94 f5 63 jmp 0xc7ea ; 0xc7ea <_GLOBAL__sub_D_card> 7504: 0d 94 cf 1d jmp 0x23b9e ; 0x23b9e 7508: 0c 94 24 f9 jmp 0x1f248 ; 0x1f248 750c: 0d 94 50 1d jmp 0x23aa0 ; 0x23aa0 7510: 0d 94 8b 28 jmp 0x25116 ; 0x25116 7514: 0c 94 7b ea jmp 0x1d4f6 ; 0x1d4f6 7518: 0c 94 5a e1 jmp 0x1c2b4 ; 0x1c2b4 751c: 0c 94 bd cd jmp 0x19b7a ; 0x19b7a 7520: 0c 94 37 e2 jmp 0x1c46e ; 0x1c46e 7524: 0c 94 c8 cd jmp 0x19b90 ; 0x19b90 7528: 0d 94 78 a0 jmp 0x340f0 ; 0x340f0 752c: 0d 94 70 18 jmp 0x230e0 ; 0x230e0 7530: 0c 94 67 ea jmp 0x1d4ce ; 0x1d4ce 7534: 0d 94 7e 51 jmp 0x2a2fc ; 0x2a2fc 7538: 0d 94 81 0d jmp 0x21b02 ; 0x21b02 753c: 0c 94 3d d0 jmp 0x1a07a ; 0x1a07a 7540: 0c 94 39 ea jmp 0x1d472 ; 0x1d472 7544: 0c 94 ea cd jmp 0x19bd4 ; 0x19bd4 7548: 0d 94 9d 10 jmp 0x2213a ; 0x2213a 754c: 0c 94 68 d3 jmp 0x1a6d0 ; 0x1a6d0 7550: 0c 94 00 ce jmp 0x19c00 ; 0x19c00 7554: 0d 94 90 1d jmp 0x23b20 ; 0x23b20 7558: 0c 94 5f ea jmp 0x1d4be ; 0x1d4be 755c: 0c 94 1e fb jmp 0x1f63c ; 0x1f63c 7560: 0c 94 6d cf jmp 0x19eda ; 0x19eda 7564: 0d 94 7b 51 jmp 0x2a2f6 ; 0x2a2f6 7568: 0d 94 e7 0b jmp 0x217ce ; 0x217ce 756c: 0c 94 47 e2 jmp 0x1c48e ; 0x1c48e 7570: 0c 94 96 ce jmp 0x19d2c ; 0x19d2c 7574: 0d 94 f1 2c jmp 0x259e2 ; 0x259e2 7578: 0c 94 fc cd jmp 0x19bf8 ; 0x19bf8 757c: 0c 94 2b d3 jmp 0x1a656 ; 0x1a656 7580: 0d 94 6a 74 jmp 0x2e8d4 ; 0x2e8d4 7584: 0d 94 bc 1f jmp 0x23f78 ; 0x23f78 7588: 0c 94 1e e0 jmp 0x1c03c ; 0x1c03c 758c: 0c 94 74 cf jmp 0x19ee8 ; 0x19ee8 7590: 0d 94 bc 29 jmp 0x25378 ; 0x25378 7594: 0c 94 ee cd jmp 0x19bdc ; 0x19bdc 7598: 0d 94 5d 2a jmp 0x254ba ; 0x254ba 0000759c <__trampolines_end>: 759c: 6e 61 ori r22, 0x1E ; 30 759e: 6e 00 .word 0x006e ; ???? 000075a0 <__c.2228>: 75a0: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 75b0: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 75c0: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 75d0: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 75e0: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 75f0: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 7600: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 7610: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 7620: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 7630: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 7640: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 7650: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 7660: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 7670: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 7680: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 7690: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 0000769e : 769e: 22 00 ". 000076a0 : ... 000076a1 : 76a1: 20 45 53 50 00 ESP. 000076a6 : 76a6: 20 4e 53 50 00 NSP. 000076ab : 76ab: 20 4f 46 46 00 OFF. 000076b0 : 76b0: 20 4f 4e 00 ON. 000076b4 : 76b4: 50 56 30 31 00 PV01. 000076b9 : 76b9: 20 5b 4d 50 5d 20 00 [MP] . 000076c0 : 76c0: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 76d0: 74 65 73 00 tes. 000076d4 : 76d4: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 000076df : 76df: 4d 33 31 30 00 M310. 000076e4 : 76e4: 4d 31 31 32 00 M112. 000076e9 : 76e9: 4d 31 31 30 00 M110. 000076ee : 76ee: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 000076fd : 76fd: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 0000770d : 770d: 54 4d 3a 20 73 74 6f 72 65 64 20 63 61 6c 69 62 TM: stored calib 771d: 72 61 74 69 6f 6e 20 69 6e 76 61 6c 69 64 2c 20 ration invalid, 772d: 72 65 73 65 74 74 69 6e 67 00 resetting. 00007737 : 7737: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 7747: 72 65 74 72 69 65 76 65 64 00 retrieved. 00007751 : 7751: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 7761: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 7771: 64 00 d. 00007773 : 7773: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 7783: 00 00 8c 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 7793: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 77a3: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 77b3: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 77c3: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 77d3: 00 00 00 00 cd cc cc 3e 00 00 c8 41 9c 53 49 3f .......>...A.SI? 77e3: 80 f9 46 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ..FC.B.B.Z4?Lb.E 77f3: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 7803: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 c8 42 ......A....?...B 7813: 00 00 c8 42 00 00 40 41 00 00 f0 42 c0 03 00 00 ...B..@A...B.... 7823: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 20 ............... 7833: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 00007844 : 7844: 43 75 73 74 6f 6d 00 Custom. 0000784b : 784b: 4e 79 6c 6f 6e 50 41 00 NylonPA. 00007853 : 7853: 53 61 74 69 6e 20 20 00 Satin . 0000785b : 785b: 54 65 78 74 75 72 00 Textur. 00007862 : 7862: 53 6d 6f 6f 74 68 00 Smooth. 00007869 : 7869: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 7879: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 7889: 78 70 65 63 74 65 64 00 xpected. 00007891 : 7891: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 78a1: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 78b1: 70 65 63 74 65 64 00 pected. 000078b8 : 78b8: 31 2e 30 00 1.0. 000078bc : 78bc: 31 2e 35 00 1.5. 000078c0 : 78c0: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 000078c8 : 78c8: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 78d8: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 000078e5 : 78e5: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 78f5: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 000078fe <_PRI_LANG_SIGNATURE>: 78fe: ff ff ff ff .... 00007902 : 7902: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7912: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7922: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7932: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7942: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7952: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7962: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7972: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7982: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7992: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 79a2: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 79b2: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 79c2: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 79d2: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 79e2: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 79f2: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7a02: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7a12: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7a22: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7a32: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7a42: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7a52: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7a62: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7a72: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7a82: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7abe: 00 40 14 54 .@.T 00007ac2 : 7ac2: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7ad2: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007ada : 7ada: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7aea: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007af2 : 7af2: 4e 41 4e NAN 00007af5 : 7af5: 49 4e 46 INF 00007af8 : 7af8: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7b08: 20 69 6e 70 75 74 00 input. 00007b0f : 7b0f: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7b1f: 20 75 73 65 72 00 user. 00007b25 : 7b25: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007b36 : 7b36: 00 00 7f 43 00 80 54 43 00 00 52 43 ...C..TC..RC 00007b42 : 7b42: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007b4e : 7b4e: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007b5a : 7b5a: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00007b66 : 7b66: 25 33 64 20 73 74 65 70 3d 25 32 64 20 6d 73 63 %3d step=%2d msc 7b76: 6e 74 3d 25 34 64 0a 00 nt=%4d.. 00007b7e : 7b7e: 00 00 7f 43 00 80 58 43 9a d9 51 43 ...C..XC..QC 00007b8a : 7b8a: ff ff ff ... 00007b8d : 7b8d: 20 41 3a 00 A:. 00007b91 : 7b91: 20 50 3a 00 P:. 00007b95 : 7b95: 20 42 40 3a 00 B@:. 00007b9a : 7b9a: 20 40 3a 00 @:. 00007b9e : 7b9e: 20 2f 00 /. 00007ba1 : 7ba1: 20 54 30 3a 00 T0:. 00007ba6 : 7ba6: 20 2f 00 /. 00007ba9 : 7ba9: 20 42 3a 00 B:. 00007bad : 7bad: 20 2f 00 /. 00007bb0 : 7bb0: 54 3a 00 T:. 00007bb3 : 7bb3: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7bc3: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7bd3: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007be4 : 7be4: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7bf4: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7c04: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 7c14: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007c1d : 7c1d: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7c2d: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7c3d: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007c4c : 7c4c: 20 20 00 . 00007c4f : 7c4f: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007c60 : 7c60: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7c70: 20 35 2e 30 66 00 5.0f. 00007c76 : 7c76: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007c83 : 7c83: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7c93: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007ca1 : 7ca1: 20 45 3a 00 E:. 00007ca5 : 7ca5: 20 5a 3a 00 Z:. 00007ca9 : 7ca9: 20 59 3a 00 Y:. 00007cad : 7cad: 20 45 3a 00 E:. 00007cb1 : 7cb1: 20 5a 3a 00 Z:. 00007cb5 : 7cb5: 20 59 3a 00 Y:. 00007cb9 : 7cb9: 58 3a 00 X:. 00007cbc : 7cbc: 20 2d 3e 20 00 -> . 00007cc1 : 7cc1: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007ccd : 7ccd: 2c 20 00 , . 00007cd0 : 7cd0: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7ce0: 6f 77 6e 00 own. 00007ce4 : 7ce4: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007cec : 7cec: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7cfc: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007d0b : 7d0b: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7d1b: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7d2b: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7d3b: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007d48 : 7d48: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7d58: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7d68: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007d71 : 7d71: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007d79 : 7d79: 54 3a 00 T:. 00007d7c : 7d7c: 47 31 20 5a 25 2d 2e 33 66 20 46 25 2d 2e 33 66 G1 Z%-.3f F%-.3f ... 00007d8d : 7d8d: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 00007d9d : 7d9d: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 7dad: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00007db7 : 7db7: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00007dc2 : 7dc2: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 7dd2: 20 72 61 6e 67 65 21 00 range!. 00007dda <_sPrinterName>: 7dda: 4d 4b 33 00 MK3. 00007dde <_sPrinterMmuName>: 7dde: 4d 4b 33 4d 4d 55 33 00 MK3MMU3. 00007de6 <_nPrinterMmuType>: 7de6: 5c 76 \v 00007de8 <_nPrinterType>: 7de8: 2c 01 ,. 00007dea : 7dea: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007df2 : 7df2: 25 33 64 00 %3d. 00007df6 : 7df6: 20 0a 20 0a 20 0a 20 00 . . . . 00007dfe : 7dfe: 25 53 53 74 61 74 69 73 74 69 63 73 3a 0a 25 53 %SStatistics:.%S 7e0e: 20 20 4d 37 38 20 53 25 6c 75 20 54 25 6c 75 0a M78 S%lu T%lu. ... 00007e1f : 7e1f: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 7e2f: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 7e3f: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 7e4f: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 7e5f: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 7e6f: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 7e7f: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 7e8f: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 7e9f: 0a 00 .. 00007ea1 : 7ea1: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7eb1: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 00007ec0 : 7ec0: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7ed0: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 7ee0: 25 2e 32 66 0a 00 %.2f.. 00007ee6 : 7ee6: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 7ef6: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 7f06: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 7f16: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 7f26: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 7f36: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 7f46: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 7f56: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 7f66: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 7f76: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 7f86: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 7f96: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 7fa6: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 7fb6: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 7fc6: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 7fd6: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00007fe7 : 7fe7: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 7ff7: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 8007: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 8017: 2e 32 66 0a 00 .2f.. 0000801c : 801c: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 802c: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 803c: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 00008049 : 8049: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 8059: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 8069: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 8079: 66 0a 25 53 55 53 74 65 70 20 72 65 73 6f 6c 75 f.%SUStep resolu 8089: 74 69 6f 6e 3a 20 0a 25 53 20 4d 33 35 30 20 58 tion: .%S M350 X 8099: 25 64 20 59 25 64 20 5a 25 64 20 45 25 64 0a 25 %d Y%d Z%d E%d.% 80a9: 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 72 61 74 SMaximum feedrat 80b9: 65 73 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f es - normal (mm/ 80c9: 73 29 3a 0a 25 53 20 20 4d 32 30 33 20 58 25 2e s):.%S M203 X%. 80d9: 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 2f Y%.2f Z%.2f E 80e9: 25 2e 32 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 %.2f.%SMaximum f 80f9: 65 65 64 72 61 74 65 73 20 2d 20 73 74 65 61 6c eedrates - steal 8109: 74 68 20 28 6d 6d 2f 73 29 3a 0a 25 53 20 20 4d th (mm/s):.%S M 8119: 32 30 33 20 58 25 2e 32 66 20 59 25 2e 32 66 20 203 X%.2f Y%.2f 8129: 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 4d 61 Z%.2f E%.2f.%SMa 8139: 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 61 74 69 ximum accelerati 8149: 6f 6e 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f on - normal (mm/ 8159: 73 32 29 3a 0a 25 53 20 20 4d 32 30 31 20 58 25 s2):.%S M201 X% 8169: 6c 75 20 59 25 6c 75 20 5a 25 6c 75 20 45 25 6c lu Y%lu Z%lu E%l 8179: 75 0a 25 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 u.%SMaximum acce 8189: 6c 65 72 61 74 69 6f 6e 20 2d 20 73 74 65 61 6c leration - steal 8199: 74 68 20 28 6d 6d 2f 73 32 29 3a 0a 25 53 20 20 th (mm/s2):.%S 81a9: 4d 32 30 31 20 58 25 6c 75 20 59 25 6c 75 20 5a M201 X%lu Y%lu Z 81b9: 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 63 65 6c %lu E%lu.%SAccel 81c9: 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 69 6e 74 eration: P=print 81d9: 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 54 3d 74 , R=retract, T=t 81e9: 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 34 20 50 ravel.%S M204 P 81f9: 25 2e 32 66 20 52 25 2e 32 66 20 54 25 2e 32 66 %.2f R%.2f T%.2f 8209: 0a 25 53 41 64 76 61 6e 63 65 64 20 76 61 72 69 .%SAdvanced vari 8219: 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 66 65 65 ables: S=Min fee 8229: 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 54 3d drate (mm/s), T= 8239: 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 65 64 72 Min travel feedr 8249: 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 3d 6d 69 ate (mm/s), B=mi 8259: 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 20 74 69 nimum segment ti 8269: 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 78 69 6d me (us), X=maxim 8279: 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d 6d 2f 73 um XY jerk (mm/s 8289: 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d 20 5a 20 ), Z=maximum Z 8299: 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 20 45 3d jerk (mm/s), E= 82a9: 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 6b 20 28 maximum E jerk ( 82b9: 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 35 20 53 mm/s).%S M205 S 82c9: 25 2e 32 66 20 54 25 2e 32 66 20 42 25 6c 75 20 %.2f T%.2f B%lu 82d9: 58 25 2e 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 X%.2f Y%.2f Z%.2 82e9: 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d 65 20 6f f E%.2f.%SHome o 82f9: 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 53 20 20 ffset (mm):.%S 8309: 4d 32 30 36 20 58 25 2e 32 66 20 59 25 2e 32 66 M206 X%.2f Y%.2f 8319: 20 5a 25 2e 32 66 0a 00 Z%.2f.. 00008321 : 8321: 54 4d 3a 20 52 5b 25 75 5d 20 65 73 74 69 6d 61 TM: R[%u] estima 8331: 74 65 2e 00 te.. 00008335 : 8335: 54 4d 3a 20 25 53 20 52 20 25 64 43 00 TM: %S R %dC. 00008342 : 8342: 54 4d 3a 20 25 53 20 43 20 65 73 74 2e 00 TM: %S C est.. 00008350 : 8350: 54 4d 3a 20 63 6f 6f 6c 20 64 6f 77 6e 20 3c 25 TM: cool down <% 8360: 64 43 00 dC. 00008363 : 8363: 72 65 66 69 6e 65 00 refine. 0000836a : 836a: 69 6e 69 74 69 61 6c 00 initial. 00008372 : 8372: 54 4d 3a 20 63 61 6c 69 62 72 2e 20 66 61 69 6c TM: calibr. fail 8382: 65 64 21 00 ed!. 00008386 : 8386: 54 4d 3a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 TM: calibration 8396: 73 74 61 72 74 00 start. 0000839c : 839c: 54 4d 3a 20 43 61 6c 2e 20 4e 4f 54 20 49 44 4c TM: Cal. NOT IDL 83ac: 45 00 E. 000083ae : 83ae: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 000083b9 : 83b9: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 000083c4 : 83c4: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 000083d1 : 83d1: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 83e1: 49 4f 4e 00 ION. 000083e5 : 83e5: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 000083f5 : 83f5: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 00008405 : ... 00008406 : 8406: 33 2e 31 34 2e 31 00 3.14.1. 0000840d : 840d: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 841d: 20 46 69 6c 65 3a 20 00 File: . 00008425 : 8425: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 00008433 : 8433: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 00008443 : 8443: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 0000844f : 844f: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 0000845f : 845f: 25 33 64 2f 25 33 64 00 %3d/%3d. 00008467 : 8467: 4f 4b 00 OK. 0000846a : 846a: 42 41 44 00 BAD. 0000846e : 846e: 52 41 4d 42 6f 20 46 41 4e 20 00 RAMBo FAN . 00008479 : 8479: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008486 : 8486: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008494 : 8494: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 000084a2 <_ZZ16process_commandsvE3__c__97_>: 84a2: 22 28 32 29 00 "(2). 000084a7 <_ZZ16process_commandsvE3__c__96_>: 84a7: 25 53 3a 20 25 53 0a 00 %S: %S.. 000084af <_ZZ16process_commandsvE3__c__95_>: 84af: 2c 20 4d 39 30 37 20 45 20 69 67 6e 6f 72 65 64 , M907 E ignored ... 000084c0 <_ZZ16process_commandsvE3__c__94_>: 84c0: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 000084d1 <_ZZ16process_commandsvE3__c__93_>: 84d1: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 000084db <_ZZ16process_commandsvE3__c__92_>: 84db: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 000084ec <_ZZ16process_commandsvE3__c__90_>: 84ec: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 84fc: 65 70 2c 20 75 6d 00 ep, um. 00008503 <_ZZ16process_commandsvE3__c__91_>: 8503: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 8513: 3a 20 00 : . 00008516 <_ZZ16process_commandsvE3__c__89_>: 8516: 50 3a 00 P:. 00008519 <_ZZ16process_commandsvE3__c__88_>: 8519: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 8529: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 8539: 65 3a 00 e:. 0000853c <_ZZ16process_commandsvE3__c__87_>: 853c: 20 41 00 A. 0000853f <_ZZ16process_commandsvE3__c__86_>: 853f: 20 50 00 P. 00008542 <_ZZ16process_commandsvE3__c__85_>: 8542: 20 42 00 B. 00008545 <_ZZ16process_commandsvE3__c__84_>: 8545: 20 4c 00 L. 00008548 <_ZZ16process_commandsvE3__c__83_>: 8548: 20 52 00 R. 0000854b <_ZZ16process_commandsvE3__c__82_>: 854b: 20 5a 00 Z. 0000854e <_ZZ16process_commandsvE3__c__81_>: 854e: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 0000855f <_ZZ16process_commandsvE3__c__80_>: 855f: 53 68 65 65 74 20 00 Sheet . 00008566 <_ZZ16process_commandsvE3__c__79_>: 8566: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 8576: 52 41 4e 47 45 00 RANGE. 0000857c <_ZZ16process_commandsvE3__c__78_>: 857c: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 858c: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 0000859b <_ZZ16process_commandsvE3__c__77_>: 859b: 41 55 54 4f 00 AUTO. 000085a0 <_ZZ16process_commandsvE3__c__76_>: 85a0: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 000085b0 <_ZZ16process_commandsvE3__c__75_>: 85b0: 4d 32 35 36 20 42 25 64 20 44 25 64 20 53 25 64 M256 B%d D%d S%d 85c0: 20 54 25 75 0a 00 T%u.. 000085c6 <_ZZ16process_commandsvE3__c__74_>: 85c6: 20 64 3a 00 d:. 000085ca <_ZZ16process_commandsvE3__c__73_>: 85ca: 20 69 3a 00 i:. 000085ce <_ZZ16process_commandsvE3__c__72_>: 85ce: 20 70 3a 00 p:. 000085d2 <_ZZ16process_commandsvE3__c__71_>: 85d2: 20 64 3a 00 d:. 000085d6 <_ZZ16process_commandsvE3__c__70_>: 85d6: 20 69 3a 00 i:. 000085da <_ZZ16process_commandsvE3__c__69_>: 85da: 20 70 3a 00 p:. 000085de <_ZZ16process_commandsvE3__c__68_>: 85de: 25 69 25 25 0a 00 %i%%.. 000085e4 <_ZZ16process_commandsvE3__c__67_>: 85e4: 25 69 25 25 0a 00 %i%%.. 000085ea <_ZZ16process_commandsvE3__c__66_>: 85ea: 22 28 31 29 00 "(1). 000085ef <_ZZ16process_commandsvE3__c__59_>: 85ef: 2f 2f 00 //. 000085f2 <_ZZ16process_commandsvE3__c__58_>: ... 000085f3 <_ZZ16process_commandsvE3__c__57_>: 85f3: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 8603: 31 00 1. 00008605 <_ZZ16process_commandsvE3__c__56_>: 8605: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 00008614 <_ZZ16process_commandsvE3__c__55_>: 8614: 31 2e 30 00 1.0. 00008618 <_ZZ16process_commandsvE3__c__54_>: 8618: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 8628: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 8638: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 8648: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 8658: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 8668: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 00008672 <_ZZ16process_commandsvE3__c__53_>: 8672: 37 37 33 31 30 32 34 65 64 00 7731024ed. 0000867c <_ZZ16process_commandsvE3__c__52_>: 867c: 5f 00 _. 0000867e <_ZZ16process_commandsvE3__c__51_>: 867e: 38 32 37 39 00 8279. 00008683 <_ZZ16process_commandsvE3__c__50_>: 8683: 2b 00 +. 00008685 <_ZZ16process_commandsvE3__c__49_>: 8685: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 8695: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 000086a3 <_ZZ16process_commandsvE3__c__48_>: 86a3: 4d 31 31 33 20 53 00 M113 S. 000086aa <_ZZ16process_commandsvE3__c__47_>: 86aa: 6f 6b 20 00 ok . 000086ae <_ZZ16process_commandsvE3__c__41_>: 86ae: 6e 2f 61 00 n/a. 000086b2 <_ZZ16process_commandsvE3__c__40_>: 86b2: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 86c2: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 000086d2 : 86d2: 00 01 25 31 1d 0c 40 24 30 1c 0b 45 23 2f 1b 0a ..%1..@$0..E#/.. 86e2: 17 ff 04 06 22 2b 1a 03 36 37 35 38 ...."+..6758 000086ee <_ZZ16process_commandsvE3__c__39_>: 86ee: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 000086fd <_ZZ16process_commandsvE3__c__36_>: 86fd: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 870d: 25 73 0a 00 %s.. 00008711 <_ZZ16process_commandsvE3__c__30_>: 8711: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 8721: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 0000872f <_ZZ16process_commandsvE3__c__29_>: 872f: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 873f: 74 6f 72 00 tor. 00008743 <_ZZ16process_commandsvE3__c__25_>: 8743: 73 65 74 00 set. 00008747 <_ZZ16process_commandsvE3__c__24_>: 8747: 6e 6f 7a 7a 6c 65 00 nozzle. 0000874e <_ZZ16process_commandsvE3__c__23_>: 874e: 4d 42 4c 00 MBL. 00008752 <_ZZ16process_commandsvE3__c__22_>: 8752: 46 52 00 FR. 00008755 <_ZZ16process_commandsvE3__c__21_>: 8755: 4c 7a 00 Lz. 00008758 <_ZZ16process_commandsvE3__c__20_>: 8758: 4c 61 6e 67 00 Lang. 0000875d <_ZZ16process_commandsvE3__c__19_>: 875d: 31 5f 37 35 6d 6d 5f 4d 4b 33 2d 45 49 4e 53 79 1_75mm_MK3-EINSy 876d: 5f 31 30 61 2d 45 33 44 52 45 56 4f 00 _10a-E3DREVO. 0000877a <_ZZ16process_commandsvE3__c__18_>: 877a: 52 65 76 00 Rev. 0000877e <_ZZ16process_commandsvE3__c__17_>: 877e: 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 0000878a <_ZZ16process_commandsvE3__c__16_>: 878a: 46 69 72 00 Fir. 0000878e <_ZZ16process_commandsvE3__c__15_>: 878e: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 00008799 <_ZZ16process_commandsvE3__c__14_>: 8799: 53 4e 00 SN. 0000879c <_ZZ16process_commandsvE3__c__13_>: 879c: 52 45 53 45 54 00 RESET. 000087a2 <_ZZ16process_commandsvE3__c__12_>: 87a2: 4d 4d 55 52 45 53 00 MMURES. 000087a9 <_ZZ16process_commandsvE3__c__11_>: 87a9: 75 76 6c 6f 00 uvlo. 000087ae : 87ae: 46 41 4e 00 FAN. 000087b2 : 87b2: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 000087bc : 87bc: 50 52 55 53 41 00 PRUSA. 000087c2 : 87c2: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 000087cc : 87cc: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 000087d6 : 87d6: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 000087e0 : 87e0: 54 4d 43 5f 00 TMC_. 000087e5 : 87e5: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 000087f2 : 87f2: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008800 : 8800: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 0000880f : 880f: 43 52 41 53 48 5f 00 CRASH_. 00008816 : 8816: 4d 31 30 34 53 30 00 M104S0. 0000881d : 881d: 47 31 58 31 30 59 31 38 30 46 34 30 30 30 00 G1X10Y180F4000. 0000882c : 882c: 47 31 5a 31 30 46 31 33 30 30 00 G1Z10F1300. 00008837 : 8837: 4d 31 34 30 53 30 00 M140S0. 0000883e : 883e: 47 31 45 2d 30 2e 30 37 35 46 32 31 30 30 00 G1E-0.075F2100. 0000884d : 884d: 4d 32 30 34 53 31 30 30 30 00 M204S1000. 00008857 : 8857: 47 31 5a 35 46 37 32 30 30 00 G1Z5F7200. 00008861 : 8861: 47 31 45 2d 31 2e 35 46 32 31 30 30 00 G1E-1.5F2100. 0000886e : 886e: 47 31 5a 30 2e 32 00 G1Z0.2. 00008875 : 8875: 47 31 58 32 30 32 2e 35 45 38 46 31 34 30 30 00 G1X202.5E8F1400. 00008885 : 8885: 47 31 59 2d 32 46 31 30 30 30 00 G1Y-2F1000. 00008890 : 8890: 47 31 58 32 34 30 45 32 35 46 32 32 30 30 00 G1X240E25F2200. 0000889f : 889f: 47 31 5a 30 2e 33 46 31 30 30 30 00 G1Z0.3F1000. 000088ab : 88ab: 47 31 58 35 35 45 38 46 32 30 30 30 00 G1X55E8F2000. 000088b8 : 88b8: 47 31 58 35 45 32 39 46 31 38 30 30 00 G1X5E29F1800. 000088c5 : 88c5: 47 31 58 35 35 45 32 39 46 31 30 37 33 00 G1X55E29F1073. 000088d3 : 88d3: 47 39 32 45 30 00 G92E0. 000088d9 : 88d9: 47 32 38 00 G28. 000088dd : 88dd: 4d 31 30 39 00 M109. 000088e2 : 88e2: 4d 31 39 30 00 M190. 000088e7 : 88e7: 47 38 30 00 G80. 000088eb : 88eb: 4d 34 35 00 M45. 000088ef : 88ef: 4d 34 35 20 5a 00 M45 Z. 000088f5 : 88f5: 47 37 36 00 G76. 000088f9 : 88f9: 4d 37 30 31 20 50 30 00 M701 P0. 00008901 : 8901: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d 8911: 0a 00 .. 00008913 : 8913: 4d 39 31 34 00 M914. 00008918 : 8918: 4d 39 31 35 00 M915. 0000891d : 891d: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 0000892a : 892a: 30 2e 38 30 00 0.80. 0000892f : 892f: 30 2e 36 30 00 0.60. 00008934 : 8934: 30 2e 34 30 00 0.40. 00008939 : 8939: 30 2e 32 35 00 0.25. 0000893e : 893e: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 00008948 : 8948: 4d 4d 55 00 MMU. 0000894c : 894c: 4d 34 34 00 M44. 00008950 : 8950: 30 2e 38 30 00 0.80. 00008955 : 8955: 30 2e 36 30 00 0.60. 0000895a : 895a: 30 2e 34 30 00 0.40. 0000895f : 895f: 30 2e 32 35 00 0.25. 00008964 : 8964: 47 32 38 20 58 59 00 G28 XY. 0000896b : 896b: 4d 20 38 34 00 M 84. 00008970 : 8970: 85 2e 2e 00 .... 00008974 : 8974: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008981 : 8981: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 0000898e : 898e: 25 33 64 2f 30 00 %3d/0. 00008994 : 8994: 25 33 64 2f 30 00 %3d/0. 0000899a : 899a: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 000089aa : 89aa: 48 6f 74 65 6e 64 00 Hotend. 000089b1 : 89b1: 42 65 64 00 Bed. 000089b5 : 89b5: 5a 00 Z. 000089b7 : 89b7: 59 00 Y. 000089b9 : 89b9: 58 00 X. 000089bb <_ZL13STR_SEPARATOR.lto_priv.444>: 89bb: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 89cb: 2d 2d 2d 2d 00 ----. 000089d0 : 89d0: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 89e0: 6c 4e 72 00 lNr. 000089e4 : 89e4: 9b 69 9f 69 3e 88 37 88 2c 88 1d 88 37 6b 16 88 .i.i>.7.,...7k.. 89f4: a2 6a .j 000089f6 : 89f6: 47 31 59 25 2e 34 66 45 25 2e 34 66 00 G1Y%.4fE%.4f. 00008a03 : 8a03: 47 31 5a 25 2e 32 66 00 G1Z%.2f. 00008a0b : 8a0b: 47 31 58 35 30 59 31 35 35 00 G1X50Y155. 00008a15 : 8a15: d3 88 9b 69 3c 6b 61 88 57 88 4d 88 ...i: 8a21: 47 31 58 25 2e 34 66 45 25 2e 34 66 00 G1X%.4fE%.4f. 00008a2e : 8a2e: 47 31 46 31 30 38 30 00 G1F1080. 00008a36 : 8a36: c5 88 b8 88 ab 88 9f 88 d3 88 90 88 85 88 75 88 ..............u. 8a46: 6e 88 n. 00008a48 : 8a48: 54 25 64 00 T%d. 00008a4c : 8a4c: 47 31 5a 30 2e 34 00 G1Z0.4. 00008a53 : 8a53: 47 31 59 2d 33 46 31 30 30 30 00 G1Y-3F1000. 00008a5e : 8a5e: 9f 69 e2 88 dd 88 d9 88 d3 88 .i........ 00008a68 : 8a68: 4d 38 34 20 58 59 00 M84 XY. 00008a6f : 8a6f: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8a7f: 30 30 00 00. 00008a82 : 8a82: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008a8c : 8a8c: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8a9c: 46 38 30 30 30 00 F8000. 00008aa2 : 8aa2: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8ab2: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8ac2: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008ad2 : 8ad2: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8ae2: 20 44 25 2e 32 66 00 D%.2f. 00008ae9 : 8ae9: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008af6 : 8af6: 52 43 00 RC. 00008af9 : 8af9: 44 45 56 00 DEV. 00008afd : 8afd: 42 45 54 41 00 BETA. 00008b02 : 8b02: 41 4c 50 48 41 00 ALPHA. 00008b08 : 8b08: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8b18: 01 01 00 00 04 01 07 01 0a 01 .......... 00008b22 : 8b22: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8b32: 02 01 00 00 05 01 08 01 0b 01 .......... 00008b3c : 8b3c: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8b4c: 00 01 00 00 03 01 06 01 09 01 .......... 00008b56 : 8b56: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8b66: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8b76: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8b86: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8b96: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8ba6: 05 04 04 04 08 08 ...... 00008bac : 8bac: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8bbc: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8bcc: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8bdc: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8bec: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8bfc: 80 10 20 40 04 80 .. @.. 00008c02 : 8c02: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8c2e: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008c58 : 8c58: 33 2e 31 34 2e 31 00 3.14.1. 00008c5f : 8c5f: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8c6f: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8c7f: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008c8d : 8c8d: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 00008c9d : 8c9d: 43 5a 50 58 00 CZPX. 00008ca2 : 8ca2: 3b 53 00 ;S. 00008ca5 : 8ca5: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00008cb3 : 8cb3: 61 64 63 5f 69 6e 69 74 00 adc_init. 00008cbc : 8cbc: 20 0a 20 0a 20 0a 20 00 . . . . 00008cc4 : 8cc4: 41 6c 6c 20 44 61 74 61 00 All Data. 00008ccd : 8ccd: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008cda : 8cda: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008ce8 : 8ce8: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00008cf3 : 8cf3: 4c 61 6e 67 75 61 67 65 00 Language. 00008cfc <_ZZL13factory_resetcE3__c.lto_priv.535>: 8cfc: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00008d0d : 8d0d: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008d1b : 8d1b: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008d25 <_ZL8MSG_INT4.lto_priv.484>: 8d25: 49 4e 54 34 00 INT4. 00008d2a : 8d2a: 03 00 0e 00 01 00 40 00 ......@. 00008d32 : 8d32: 03 00 02 00 00 00 04 00 ........ 00008d3a : 8d3a: 70 72 75 73 61 33 64 00 prusa3d. 00008d42 : 8d42: 32 30 32 35 2d 30 34 2d 32 32 20 32 32 3a 30 33 2025-04-22 22:03 8d52: 3a 35 33 00 :53. 00008d56 : 8d56: 20 33 2e 31 34 2e 31 2d 38 32 37 39 5f 37 37 33 3.14.1-8279_773 8d66: 31 30 32 34 65 64 00 1024ed. 00008d6d : 8d6d: 73 74 61 72 74 00 start. 00008d73 : 8d73: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 00008d84 : 8d84: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 00008d8f : 8d8f: 43 5a 50 58 00 CZPX. 00008d94 : 8d94: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 00008da5 : 8da5: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 00008db5 : 8db5: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 00008dc5 : 8dc5: 4d 32 39 00 M29. 00008dc9 : 8dc9: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 00008dd1 : 8dd1: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 8de1: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 00008df0 : 8df0: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 8e00: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 00008e0a : 8e0a: 20 0a 20 0a 20 00 . . . 00008e10 : 8e10: 00 00 48 42 00 00 58 41 9a 99 8d 41 33 33 53 40 ..HB..XA...A33S@ 00008e20 : 8e20: 4d 4d 55 32 3a 00 MMU2:. 00008e26 : 8e26: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 8e36: 64 00 d. 00008e38 : 8e38: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 8e48: 69 78 65 64 00 ixed. 00008e4d : 8e4d: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ 8e5d: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe 8e6d: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial 8e7d: 20 00 . 00008e7f <_ZZL25restore_print_from_eeprombE3__c__12_>: 8e7f: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 00008e8a <_ZZL25restore_print_from_eeprombE3__c__11_>: 8e8a: 47 34 20 53 30 00 G4 S0. 00008e90 <_ZZL25restore_print_from_eeprombE3__c__10_>: 8e90: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 00008e9a : 8e9a: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 00008ea3 : 8ea3: 4d 31 30 36 20 53 25 75 00 M106 S%u. 00008eac : 8eac: 47 31 20 46 25 64 00 G1 F%d. 00008eb3 : 8eb3: 4d 38 32 00 M82. 00008eb7 : 8eb7: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 00008ec2 : 8ec2: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. 8ed2: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 00008edc : 8edc: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 00008ee6 : 8ee6: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 00008ef3 : 8ef3: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f 8f03: 20 46 33 30 30 30 00 F3000. 00008f0a : 8f0a: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 00008f1a : 8f1a: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 00008f24 : 8f24: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 00008f2f : 8f2f: 4d 31 30 39 20 53 25 64 00 M109 S%d. 00008f38 : 8f38: 4d 31 34 30 20 53 25 64 00 M140 S%d. 00008f41 : 8f41: 4d 31 30 34 20 53 25 64 00 M104 S%d. 00008f4a : 8f4a: 47 32 38 20 58 20 59 00 G28 X Y. 00008f52 : 8f52: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 00008f60 : 8f60: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p 8f70: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... 8f80: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b 8f90: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... 8fa0: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T 8fb0: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... 8fc0: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F 8fd0: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... 8fe0: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 8ff0: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. 9000: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* 9010: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... 9020: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. 9030: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. 9040: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. 9050: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. 9060: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. 9070: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` 9080: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. 9090: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr 90a0: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... 90b0: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D 90c0: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. 90d0: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V 90e0: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... 90f0: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( 9100: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... 9110: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: 9120: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... 9130: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... 9140: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... 9150: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 00009160 : 9160: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 00009169 : 9169: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 9179: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 9189: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 9199: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 91a9: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 91b9: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 91c9: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 91d9: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 91e9: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 91f9: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 9209: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 9219: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 9229: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 9239: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 9249: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 9259: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 9269: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 9279: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 9289: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 9299: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 92a9: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 92b9: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 92c9: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 92d9: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 92e9: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 92f9: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 9309: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 9319: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 9329: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 9339: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 9349: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 9359: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 9369: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 9379: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 9389: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 9399: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 93a9: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 93b9: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 93c9: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 93d9: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 93e9: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 93f9: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 9409: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 9419: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 9429: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 9439: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 9449: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 9459: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 9469: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 9479: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 9489: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 9499: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 94a9: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 94b9: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 94c9: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 94d9: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 94e9: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 94f9: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 9509: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 9519: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 9529: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 9539: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 9549: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 9559: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 00009569 : 9569: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 9579: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 9589: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 9599: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 95a9: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 95b9: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 95c9: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 95d9: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 95e9: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 95f9: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 9609: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 9619: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 9629: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 9639: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 9649: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 9659: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 9669: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 9679: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 9689: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 9699: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 96a9: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 96b9: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 96c9: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 96d9: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 96e9: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 96f9: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 9709: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 9719: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 9729: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 9739: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 9749: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 9759: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 9769: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 9779: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 9789: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 9799: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 97a9: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 97b9: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 97c9: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 97d9: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 97e9: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 97f9: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 9809: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9819: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9829: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 9839: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 9849: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 9859: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 9869: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 9879: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 9889: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 9899: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 98a9: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 98b9: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 98c9: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 98d9: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 98e9: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 98f9: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9909: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9919: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9929: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9939: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9949: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9959: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009969 <_ZZ12PID_autotunefiiE3__c__16_>: 9969: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9979: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9989: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9999: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 99a9: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 99b9: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 000099c5 <_ZZ12PID_autotunefiiE3__c__15_>: 99c5: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 99d5: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 000099e2 <_ZZ12PID_autotunefiiE3__c__14_>: 99e2: 20 40 3a 00 @:. 000099e6 <_ZZ12PID_autotunefiiE3__c__13_>: 99e6: 54 3a 00 T:. 000099e9 <_ZZ12PID_autotunefiiE3__c__12_>: 99e9: 42 3a 00 B:. 000099ec <_ZZ12PID_autotunefiiE3__c__11_>: 99ec: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 99fc: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9a0c: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009a16 <_ZZ12PID_autotunefiiE3__c__10_>: 9a16: 20 4b 64 3a 20 00 Kd: . 00009a1c : 9a1c: 20 4b 69 3a 20 00 Ki: . 00009a22 : 9a22: 20 4b 70 3a 20 00 Kp: . 00009a28 : 9a28: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009a36 : 9a36: 20 54 75 3a 20 00 Tu: . 00009a3c : 9a3c: 20 4b 75 3a 20 00 Ku: . 00009a42 : 9a42: 20 6d 61 78 3a 20 00 max: . 00009a49 : 9a49: 20 6d 69 6e 3a 20 00 min: . 00009a50 : 9a50: 20 64 3a 20 00 d: . 00009a55 : 9a55: 20 62 69 61 73 3a 20 00 bias: . 00009a5d : 9a5d: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9a6d: 72 74 00 rt. 00009a70 : 9a70: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9a80: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9a90: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009a9a : 9a9a: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9aaa: 20 25 6c 78 0a 00 %lx.. 00009ab0 : 9ab0: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009ab8 : 9ab8: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009ac4 : 9ac4: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009ad0 : 9ad0: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009ad8 : 9ad8: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009ae4 : 9ae4: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009af0 : 9af0: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9b00: 64 00 d. 00009b02 : 9b02: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9b12: 72 65 64 21 00 red!. 00009b17 : 9b17: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9b27: 66 0a 00 f.. 00009b2a : 9b2a: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9b3a: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9b4a: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9b5a: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9b6a: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9b7a: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9b8a: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9b9a: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9baa: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9bba: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9bca: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9bda: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9bea: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9bfa: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9c0a: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9c1a: 00 3f 00 00 .?.. 00009c1e : 9c1e: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9c2e: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9c3e: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9c4e: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9c5e: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9c6e: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9c7e: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9c8e: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9c9e: f0 3f dd ff f0 3f d8 ff .?...?.. 00009ca6 : 9ca6: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9cb6: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009cbe : 9cbe: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9cce: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009cd7 : 9cd7: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009ce7 : 9ce7: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9cf7: 57 41 59 00 WAY. 00009cfb : 9cfb: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9d0b: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9d1b: 29 00 ). 00009d1d : 9d1d: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9d2d: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9d3d: 44 29 00 D). 00009d40 : 9d40: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009d4e : 9d4e: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9d5e: 52 00 R. 00009d60 : 9d60: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009d6c : 9d6c: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9d7c: 20 6f 66 66 2e 20 00 off. . 00009d83 : 9d83: 3a 20 00 : . 00009d86 : 9d86: 45 72 72 3a 20 00 Err: . 00009d8c : 9d8c: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009d9c : 9d9c: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009dab : 9dab: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para 9dbb: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e 9dcb: 6e 61 62 6c 65 00 nable. 00009dd1 : 9dd1: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U 9de1: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f 9df1: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B 9e01: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T 9e11: 25 2e 32 66 0a 00 %.2f.. 00009e17 : 9e17: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. 9e27: 32 66 0a 00 2f.. 00009e2b : 9e2b: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se 9e3b: 74 74 69 6e 67 73 3a 00 ttings:. 00009e43 : 9e43: 66 66 ca 41 33 33 bf 41 00 00 b4 41 cd cc 9c 41 ff.A33.A...A...A 9e53: 00 00 98 41 66 66 92 41 9a 99 8d 41 cd cc 88 41 ...Aff.A...A...A 9e63: 66 66 86 41 00 00 84 41 66 66 82 41 00 00 80 41 ff.A...Aff.A...A 9e73: 66 66 7e 41 33 33 7b 41 9a 99 79 41 66 66 76 41 ff~A33{A..yAffvA 00009e83 : 9e83: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current 9e93: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 00009ea3 : 9ea3: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 00009eaf : 9eaf: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent 9ebf: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% 9ecf: 30 32 78 29 0a 00 02x).. 00009ed5 : 9ed5: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi 9ee5: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom 9ef5: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x 9f05: 25 30 32 78 0a 00 %02x.. 00009f0b : 9f0b: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d 9f1b: 0a 00 .. 00009f1d : 9f1d: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v 9f2d: 61 6c 3d 25 32 64 0a 00 al=%2d.. 00009f35 : 9f35: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 00009f3f : 9f3f: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 00009f50 : 9f50: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 00009f60 <__vector_51::__c>: 9f60: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! 9f70: 21 00 !. 00009f72 : 9f72: 3a 20 00 : . 00009f75 : 9f75: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 00009f83 : 9f83: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 00009f8c : 9f8c: 20 3a 20 00 : . 00009f90 : 9f90: 25 33 53 00 %3S. 00009f94 : 9f94: 25 2d 37 73 00 %-7s. 00009f99 : 9f99: 4e 64 20 25 34 2e 32 66 20 00 Nd %4.2f . 00009fa3 : 9fa3: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 9fb3: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 00009fbe : 9fbe: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 9fce: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 00009fdd : 9fdd: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 9fed: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. 9ffd: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a00a : a00a: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a01a: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a02a: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a03a: 25 2d 33 64 00 %-3d. 0000a03f : a03f: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a049 : a049: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a059: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a069: 31 66 56 00 1fV. 0000a06d : a06d: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a07c : a07c: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a088 <_ZZL16lcd_support_menuvE3__c__15_>: a088: 20 00 . 0000a08a <_ZZL16lcd_support_menuvE3__c__14_>: a08a: 20 00 . 0000a08c <_ZZL16lcd_support_menuvE3__c__13_>: a08c: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a09c: 3a 00 :. 0000a09e <_ZZL16lcd_support_menuvE3__c__12_>: a09e: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a0ad <_ZZL16lcd_support_menuvE3__c__11_>: a0ad: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a0b6 <_ZZL16lcd_support_menuvE3__c__10_>: a0b6: 20 46 57 3a 00 FW:. 0000a0bb : a0bb: 32 30 32 35 2d 30 34 2d 32 32 00 2025-04-22. 0000a0c6 : a0c6: 45 33 44 52 45 56 4f 00 E3DREVO. 0000a0ce : a0ce: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a0d8 : a0d8: 31 5f 37 35 6d 6d 5f 4d 4b 33 00 1_75mm_MK3. 0000a0e3 : a0e3: 20 48 61 73 68 3a 37 37 33 31 30 32 34 65 64 00 Hash:7731024ed. 0000a0f3 : a0f3: 20 52 65 70 6f 3a 70 72 75 73 61 33 64 00 Repo:prusa3d. 0000a101 : a101: 20 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 0000a10e : a10e: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a118 : a118: 3e 00 >. 0000a11a <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a11a: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a129 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a129: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a135 <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a135: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a145 <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a145: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a151 <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a151: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a161 <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a161: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a16d <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a16d: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a17d <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a17d: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a189 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a189: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a198 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a198: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a1a4 <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a1a4: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a1b3 : a1b3: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a1bf : a1bf: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a1cf : a1cf: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a1db : a1db: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a1eb : a1eb: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a1f7 : a1f7: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a206 : a206: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a212 : a212: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a221 : a221: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a22d : a22d: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a23c : a23c: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a246 : a246: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a251 : a251: 58 3a 00 X:. 0000a254 : a254: 59 3a 00 Y:. 0000a257 : a257: 5a 3a 00 Z:. 0000a25a : a25a: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a26b : a26b: 25 33 75 00 %3u. 0000a26f : a26f: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a27f: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a28f: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a29f: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a2aa : a2aa: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a2ba: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a2ca: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a2da: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a2e3 : a2e3: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... a2f3: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... a303: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... a313: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ a323: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. a333: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. a343: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. a353: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 0000a363 : a363: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 0000a374 : a374: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e a384: 6e 74 65 72 0a 00 nter.. 0000a38a : a38a: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c a39a: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a3aa: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a3ba: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a3c2 : a3c2: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n a3d2: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld a3e2: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000a3ef : a3ef: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= a3ff: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= a40f: 25 64 0a 00 %d.. 0000a413 : a413: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x a423: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld a433: 0a 00 .. 0000a435 : a435: 25 30 32 78 00 %02x. 0000a43a : a43a: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt a44a: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 0000a456 : a456: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm a466: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 0000a472 : a472: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ a482: fc 03 f8 01 f0 00 00 00 ........ 0000a48a : a48a: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ a49a: f8 01 f0 00 00 00 00 00 ........ 0000a4a2 : a4a2: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l a4b2: 65 61 76 65 0a 00 eave.. 0000a4b8 : a4b8: 20 3c 20 00 < . 0000a4bc : a4bc: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p a4cc: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab a4dc: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate a4ec: 3a 00 :. 0000a4ee : ... 0000a4ef : a4ef: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ a4ff: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 0000a50f : a50f: 25 64 2f 34 00 %d/4. 0000a514 : a514: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 0000a520 : a520: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail a530: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax a540: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again a550: 2e 00 .. 0000a552 : a552: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a562: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a572: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a582: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a58a : a58a: 0a 00 .. 0000a58c : a58c: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a59b : a59b: 25 64 0a 00 %d.. 0000a59f : a59f: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a5b0 : a5b0: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a5c0: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a5d0: 25 25 0a 00 %%.. 0000a5d4 : a5d4: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a5e4: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a5f0 : a5f0: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a600: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a610 <_ZL16ramming_sequence.lto_priv.401>: a610: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a620: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a630: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a640: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a650: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a660: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a670: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a680: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a690: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a6a0 <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.399>: a6a0: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a6b0: 74 73 00 ts. 0000a6b3 : a6b3: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a6c3: 6f 70 70 65 64 00 opped. 0000a6c9 : a6c9: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a6d9 : a6d9: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a6e9: 73 74 61 72 74 65 64 00 started. 0000a6f1 : a6f1: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a701: 6e 67 00 ng. 0000a704 : a704: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a714: 70 65 6e 64 69 6e 67 00 pending. 0000a71c : a71c: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a729 : a729: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a733 <_ZL9mmu2Magic.lto_priv.374>: a733: 4d 4d 55 32 3a 00 MMU2:. 0000a739 : a739: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a749: 20 00 . 0000a74b : a74b: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a75b: 6e 65 64 00 ned. 0000a75f : a75f: 4d 53 3c 53 28 53 13 53 fd 52 ea 52 d4 52 c0 52 MS: a799: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a7a3 : a7a3: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a7b3: 75 6e 6f 75 74 21 00 unout!. 0000a7ba : a7ba: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a7ca: 6d 65 6f 75 74 00 meout. 0000a7d0 : a7d0: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a7df : a7df: 03 00 03 ... 0000a7e2 : a7e2: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a7f3 : a7f3: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a801 : a801: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a812 : a812: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a822: 64 00 d. 0000a824 : a824: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a834: 65 64 00 ed. 0000a837 <_ZN4MMU2L11errorTitlesE.lto_priv.494>: a837: aa 55 95 55 7e 55 69 55 54 55 40 55 30 55 19 55 .U.U~UiUTU@U0U.U a847: 02 55 eb 54 d7 54 c3 54 ad 54 ad 54 ad 54 98 54 .U.T.T.T.T.T.T.T a857: 98 54 98 54 85 54 85 54 85 54 72 54 72 54 72 54 .T.T.T.T.TrTrTrT a867: 5b 54 5b 54 5b 54 46 54 46 54 46 54 30 54 30 54 [T[T[TFTFTFT0T0T a877: 30 54 20 54 0b 54 f5 53 df 53 d0 53 c3 53 ac 53 0T T.T.S.S.S.S.S a887: 99 53 87 53 74 53 62 53 52 53 .S.StSbSRS 0000a891 : a891: 42 75 74 74 6f 6e 00 Button. 0000a898 : a898: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a8a8: 74 6e 4c 4d 52 20 00 tnLMR . 0000a8af <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.493>: a8af: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a8bf: 20 20 20 81 00 .. 0000a8c4 : a8c4: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a8d4: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a8df : a8df: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a8ed : a8ed: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl a8fd: 65 61 72 65 64 00 eared. 0000a903 : a903: 20 57 3a 00 W:. 0000a907 : a907: 20 45 3a 00 E:. 0000a90b : a90b: 54 3a 00 T:. 0000a90e : a90e: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000a91f : a91f: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000a92c : a92c: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000a93a : a93a: 20 53 69 7a 65 3a 20 00 Size: . 0000a942 : a942: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000a950 : a950: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000a961 : a961: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000a972 : a972: 22 20 70 6f 73 00 " pos. 0000a978 : a978: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000a983 : a983: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL a993: 74 61 72 67 65 74 3a 22 00 target:". 0000a99c : a99c: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s a9ac: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w a9bc: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev a9cc: 65 6c 73 2e 00 els.. 0000a9d1 : a9d1: 06 28 33 d0 36 c2 3e 01 3f 15 41 32 42 3b 43 f2 .(3.6.>.?.A2B;C. a9e1: 44 3b 45 f2 46 22 47 3b 48 f2 49 3b 4a f0 58 98 D;E.F"G;H.I;J.X. a9f1: 59 0c 5a 08 5b 0c 5c 08 61 10 67 9b 6e 22 71 07 Y.Z.[.\.a.g.n"q. aa01: 72 08 ff r.. 0000aa04 : aa04: 09 5a 0d 00 0e f0 19 14 5e 08 20 64 2b 6d 32 2f .Z......^. d+m2/ aa14: ff . 0000aa15 : aa15: 20 22 25 73 22 00 "%s". 0000aa1b : aa1b: 20 25 23 6c 78 00 %#lx. 0000aa21 : aa21: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000aa2a : aa2a: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% aa3a: 73 22 0a 00 s".. 0000aa3e : aa3e: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000aa47 : aa47: 04 1a .. 0000aa49 : aa49: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt aa59: 74 65 6d 70 74 73 00 tempts. 0000aa60 : aa60: 08 1b 1c ... 0000aa63 : aa63: 0b 14 .. 0000aa65 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.400>: aa65: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000aa74 : aa74: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000aa83 <_ZL10bufferFull.lto_priv.554>: aa83: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer aa93: 20 66 75 6c 6c 21 00 full!. 0000aa9a : aa9a: 45 72 72 6f 72 3a 00 Error:. 0000aaa1 : aaa1: 22 00 ". 0000aaa3 : aaa3: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the aab3: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000aabc <_ZL9mmu2Magic.lto_priv.375>: aabc: 4d 4d 55 32 3a 00 MMU2:. 0000aac2 : aac2: 65 63 68 6f 3a 00 echo:. 0000aac8 : aac8: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000aad0 : aad0: 4d 4d 55 20 69 73 20 00 MMU is . 0000aad8 : aad8: 25 2e 31 30 53 20 00 %.10S . 0000aadf : aadf: 25 34 64 00 %4d. 0000aae3 : aae3: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t aaf3: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000ab00 : ab00: 25 64 2f 39 00 %d/9. 0000ab05 : ab05: 4d 4d 55 32 3a 00 MMU2:. 0000ab0b : ab0b: 25 33 64 00 %3d. 0000ab0f : ab0f: 18 01 04 19 02 0a ...... 0000ab15 : ab15: fa 62 84 62 0a 62 9d 61 54 61 c2 60 4a 60 e2 5f .b.b.b.aTa.`J`._ ab25: 93 5f 73 5f 27 5f 73 5f 10 5f 10 5f 10 5f 10 5f ._s_'_s_._._._._ ab35: 10 5f 10 5f 10 5f 10 5f 10 5f 10 5f 10 5f 10 5f ._._._._._._._._ ab45: 10 5f 10 5f 10 5f 10 5f 10 5f 10 5f 10 5f 10 5f ._._._._._._._._ ab55: 10 5f 10 5f d9 5e 98 5e 4e 5e db 5d a6 5d 5c 5d ._._.^.^N^.].]\] ab65: 12 5d b4 5c 7b 5c 39 5c 1c 5c .].\{\9\.\ 0000ab6f : ab6f: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. ab7f: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ ab8f: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000ab9c : ab9c: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. abac: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... abbc: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. abcc: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. abdc: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. abec: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000abf6 : abf6: 87 63 f0 63 7c 63 73 63 6c 63 78 4f e7 46 65 63 .c.c|csclcxO.Fec ac06: 5b 63 [c 0000ac08 : ac08: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ac18: 34 25 68 75 00 4%hu. 0000ac1d : ac1d: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ac2d: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ac3d: 6e 65 63 74 21 00 nect!. 0000ac43 : ac43: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000ac51 : ac51: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000ac61 : ac61: 73 74 61 72 74 0a 00 start.. 0000ac68 <__ctors_start>: ac68: c0 3a cpi r28, 0xA0 ; 160 0000ac6a <__ctors_end>: ac6a: f5 63 ori r31, 0x35 ; 53 0000ac6c <__dtors_end>: ac6c: 11 24 eor r1, r1 ac6e: 1f be out 0x3f, r1 ; 63 ac70: cf ef ldi r28, 0xFF ; 255 ac72: d1 e2 ldi r29, 0x21 ; 33 ac74: de bf out 0x3e, r29 ; 62 ac76: cd bf out 0x3d, r28 ; 61 ac78: 00 e0 ldi r16, 0x00 ; 0 ac7a: 0c bf out 0x3c, r16 ; 60 0000ac7c <__do_copy_data>: ac7c: 13 e0 ldi r17, 0x03 ; 3 ac7e: a0 e0 ldi r26, 0x00 ; 0 ac80: b2 e0 ldi r27, 0x02 ; 2 ac82: e0 e4 ldi r30, 0x40 ; 64 ac84: f6 ec ldi r31, 0xC6 ; 198 ac86: 03 e0 ldi r16, 0x03 ; 3 ac88: 0b bf out 0x3b, r16 ; 59 ac8a: 02 c0 rjmp .+4 ; 0xac90 <__do_copy_data+0x14> ac8c: 07 90 elpm r0, Z+ ac8e: 0d 92 st X+, r0 ac90: a4 32 cpi r26, 0x24 ; 36 ac92: b1 07 cpc r27, r17 ac94: d9 f7 brne .-10 ; 0xac8c <__do_copy_data+0x10> 0000ac96 <__do_clear_bss>: ac96: 28 e1 ldi r18, 0x18 ; 24 ac98: a4 e2 ldi r26, 0x24 ; 36 ac9a: b3 e0 ldi r27, 0x03 ; 3 ac9c: 01 c0 rjmp .+2 ; 0xaca0 <.do_clear_bss_start> 0000ac9e <.do_clear_bss_loop>: ac9e: 1d 92 st X+, r1 0000aca0 <.do_clear_bss_start>: aca0: a0 32 cpi r26, 0x20 ; 32 aca2: b2 07 cpc r27, r18 aca4: e1 f7 brne .-8 ; 0xac9e <.do_clear_bss_loop> 0000aca6 <__do_global_ctors>: aca6: 16 e5 ldi r17, 0x56 ; 86 aca8: c5 e3 ldi r28, 0x35 ; 53 acaa: d6 e5 ldi r29, 0x56 ; 86 acac: 00 e0 ldi r16, 0x00 ; 0 acae: 06 c0 rjmp .+12 ; 0xacbc <__do_global_ctors+0x16> acb0: 21 97 sbiw r28, 0x01 ; 1 acb2: 01 09 sbc r16, r1 acb4: 80 2f mov r24, r16 acb6: fe 01 movw r30, r28 acb8: 0f 94 64 dd call 0x3bac8 ; 0x3bac8 <__tablejump2__> acbc: c4 33 cpi r28, 0x34 ; 52 acbe: d1 07 cpc r29, r17 acc0: 80 e0 ldi r24, 0x00 ; 0 acc2: 08 07 cpc r16, r24 acc4: a9 f7 brne .-22 ; 0xacb0 <__do_global_ctors+0xa> acc6: 0e 94 6e fb call 0x1f6dc ; 0x1f6dc
acca: 0d 94 0e e3 jmp 0x3c61c ; 0x3c61c <__do_global_dtors> 0000acce <__bad_interrupt>: acce: 0c 94 eb 66 jmp 0xcdd6 ; 0xcdd6 <__vector_default> 0000acd2 : acd2: 2f 92 push r2 acd4: 3f 92 push r3 acd6: 4f 92 push r4 acd8: 5f 92 push r5 acda: 6f 92 push r6 acdc: 7f 92 push r7 acde: 8f 92 push r8 ace0: 9f 92 push r9 ace2: af 92 push r10 ace4: bf 92 push r11 ace6: cf 92 push r12 ace8: df 92 push r13 acea: ef 92 push r14 acec: ff 92 push r15 acee: 0f 93 push r16 acf0: 1f 93 push r17 acf2: cf 93 push r28 acf4: df 93 push r29 acf6: cd b7 in r28, 0x3d ; 61 acf8: de b7 in r29, 0x3e ; 62 acfa: 2f 97 sbiw r28, 0x0f ; 15 acfc: 0f b6 in r0, 0x3f ; 63 acfe: f8 94 cli ad00: de bf out 0x3e, r29 ; 62 ad02: 0f be out 0x3f, r0 ; 63 ad04: cd bf out 0x3d, r28 ; 61 ad06: 6c 01 movw r12, r24 ad08: 1b 01 movw r2, r22 ad0a: 5a 01 movw r10, r20 ad0c: fc 01 movw r30, r24 ad0e: 17 82 std Z+7, r1 ; 0x07 ad10: 16 82 std Z+6, r1 ; 0x06 ad12: 83 81 ldd r24, Z+3 ; 0x03 ad14: 9e 01 movw r18, r28 ad16: 2f 5f subi r18, 0xFF ; 255 ad18: 3f 4f sbci r19, 0xFF ; 255 ad1a: 49 01 movw r8, r18 ad1c: 81 fd sbrc r24, 1 ad1e: d2 c0 rjmp .+420 ; 0xaec4 ad20: 8f ef ldi r24, 0xFF ; 255 ad22: 9f ef ldi r25, 0xFF ; 255 ad24: ee c2 rjmp .+1500 ; 0xb302 ad26: f1 2c mov r15, r1 ad28: 51 2c mov r5, r1 ad2a: 00 e0 ldi r16, 0x00 ; 0 ad2c: 00 32 cpi r16, 0x20 ; 32 ad2e: 38 f4 brcc .+14 ; 0xad3e ad30: 8b 32 cpi r24, 0x2B ; 43 ad32: 09 f1 breq .+66 ; 0xad76 ad34: 90 f4 brcc .+36 ; 0xad5a ad36: 80 32 cpi r24, 0x20 ; 32 ad38: f9 f0 breq .+62 ; 0xad78 ad3a: 83 32 cpi r24, 0x23 ; 35 ad3c: 09 f1 breq .+66 ; 0xad80 ad3e: 07 fd sbrc r16, 7 ad40: 34 c0 rjmp .+104 ; 0xadaa ad42: 20 ed ldi r18, 0xD0 ; 208 ad44: 28 0f add r18, r24 ad46: 2a 30 cpi r18, 0x0A ; 10 ad48: 20 f5 brcc .+72 ; 0xad92 ad4a: 06 ff sbrs r16, 6 ad4c: 1b c0 rjmp .+54 ; 0xad84 ad4e: fa e0 ldi r31, 0x0A ; 10 ad50: ff 9e mul r15, r31 ad52: 20 0d add r18, r0 ad54: 11 24 eor r1, r1 ad56: f2 2e mov r15, r18 ad58: 05 c0 rjmp .+10 ; 0xad64 ad5a: 8d 32 cpi r24, 0x2D ; 45 ad5c: 79 f0 breq .+30 ; 0xad7c ad5e: 80 33 cpi r24, 0x30 ; 48 ad60: 71 f7 brne .-36 ; 0xad3e ad62: 01 60 ori r16, 0x01 ; 1 ad64: f1 01 movw r30, r2 ad66: 93 fd sbrc r25, 3 ad68: 85 91 lpm r24, Z+ ad6a: 93 ff sbrs r25, 3 ad6c: 81 91 ld r24, Z+ ad6e: 1f 01 movw r2, r30 ad70: 81 11 cpse r24, r1 ad72: dc cf rjmp .-72 ; 0xad2c ad74: 1a c0 rjmp .+52 ; 0xadaa ad76: 02 60 ori r16, 0x02 ; 2 ad78: 04 60 ori r16, 0x04 ; 4 ad7a: f4 cf rjmp .-24 ; 0xad64 ad7c: 08 60 ori r16, 0x08 ; 8 ad7e: f2 cf rjmp .-28 ; 0xad64 ad80: 00 61 ori r16, 0x10 ; 16 ad82: f0 cf rjmp .-32 ; 0xad64 ad84: 3a e0 ldi r19, 0x0A ; 10 ad86: 53 9e mul r5, r19 ad88: 20 0d add r18, r0 ad8a: 11 24 eor r1, r1 ad8c: 52 2e mov r5, r18 ad8e: 00 62 ori r16, 0x20 ; 32 ad90: e9 cf rjmp .-46 ; 0xad64 ad92: 8e 32 cpi r24, 0x2E ; 46 ad94: 21 f4 brne .+8 ; 0xad9e ad96: 06 fd sbrc r16, 6 ad98: b1 c2 rjmp .+1378 ; 0xb2fc ad9a: 00 64 ori r16, 0x40 ; 64 ad9c: e3 cf rjmp .-58 ; 0xad64 ad9e: 8c 36 cpi r24, 0x6C ; 108 ada0: 11 f4 brne .+4 ; 0xada6 ada2: 00 68 ori r16, 0x80 ; 128 ada4: df cf rjmp .-66 ; 0xad64 ada6: 88 36 cpi r24, 0x68 ; 104 ada8: e9 f2 breq .-70 ; 0xad64 adaa: 9b eb ldi r25, 0xBB ; 187 adac: 98 0f add r25, r24 adae: 93 30 cpi r25, 0x03 ; 3 adb0: 08 f0 brcs .+2 ; 0xadb4 adb2: 5f c0 rjmp .+190 ; 0xae72 adb4: 00 61 ori r16, 0x10 ; 16 adb6: 80 5e subi r24, 0xE0 ; 224 adb8: 06 fd sbrc r16, 6 adba: 02 c0 rjmp .+4 ; 0xadc0 adbc: 46 e0 ldi r20, 0x06 ; 6 adbe: f4 2e mov r15, r20 adc0: 10 2f mov r17, r16 adc2: 1f 73 andi r17, 0x3F ; 63 adc4: 85 36 cpi r24, 0x65 ; 101 adc6: 09 f0 breq .+2 ; 0xadca adc8: 5b c0 rjmp .+182 ; 0xae80 adca: 10 64 ori r17, 0x40 ; 64 adcc: 17 ff sbrs r17, 7 adce: 61 c0 rjmp .+194 ; 0xae92 add0: 8f 2d mov r24, r15 add2: 9b e3 ldi r25, 0x3B ; 59 add4: 9f 15 cp r25, r15 add6: 08 f4 brcc .+2 ; 0xadda add8: 8b e3 ldi r24, 0x3B ; 59 adda: 44 24 eor r4, r4 addc: 43 94 inc r4 adde: 48 0e add r4, r24 ade0: 27 e0 ldi r18, 0x07 ; 7 ade2: 35 01 movw r6, r10 ade4: f4 e0 ldi r31, 0x04 ; 4 ade6: 6f 0e add r6, r31 ade8: 71 1c adc r7, r1 adea: f5 01 movw r30, r10 adec: 60 81 ld r22, Z adee: 71 81 ldd r23, Z+1 ; 0x01 adf0: 82 81 ldd r24, Z+2 ; 0x02 adf2: 93 81 ldd r25, Z+3 ; 0x03 adf4: 04 2d mov r16, r4 adf6: a4 01 movw r20, r8 adf8: 0f 94 0d d9 call 0x3b21a ; 0x3b21a <__ftoa_engine> adfc: 5c 01 movw r10, r24 adfe: f9 81 ldd r31, Y+1 ; 0x01 ae00: fc 87 std Y+12, r31 ; 0x0c ae02: f0 ff sbrs r31, 0 ae04: 03 c0 rjmp .+6 ; 0xae0c ae06: 0d e2 ldi r16, 0x2D ; 45 ae08: f3 ff sbrs r31, 3 ae0a: 07 c0 rjmp .+14 ; 0xae1a ae0c: 0b e2 ldi r16, 0x2B ; 43 ae0e: 11 fd sbrc r17, 1 ae10: 04 c0 rjmp .+8 ; 0xae1a ae12: 01 2f mov r16, r17 ae14: 04 70 andi r16, 0x04 ; 4 ae16: 12 fd sbrc r17, 2 ae18: 00 e2 ldi r16, 0x20 ; 32 ae1a: 2c 85 ldd r18, Y+12 ; 0x0c ae1c: 2c 70 andi r18, 0x0C ; 12 ae1e: e2 2e mov r14, r18 ae20: 09 f4 brne .+2 ; 0xae24 ae22: 6b c0 rjmp .+214 ; 0xaefa ae24: 01 11 cpse r16, r1 ae26: d8 c2 rjmp .+1456 ; 0xb3d8 ae28: f3 e0 ldi r31, 0x03 ; 3 ae2a: e1 2c mov r14, r1 ae2c: f5 15 cp r31, r5 ae2e: a0 f4 brcc .+40 ; 0xae58 ae30: 83 e0 ldi r24, 0x03 ; 3 ae32: e5 2c mov r14, r5 ae34: e8 1a sub r14, r24 ae36: 13 fd sbrc r17, 3 ae38: 08 c0 rjmp .+16 ; 0xae4a ae3a: b6 01 movw r22, r12 ae3c: 80 e2 ldi r24, 0x20 ; 32 ae3e: 90 e0 ldi r25, 0x00 ; 0 ae40: 0f 94 bc da call 0x3b578 ; 0x3b578 ae44: ea 94 dec r14 ae46: e1 10 cpse r14, r1 ae48: f8 cf rjmp .-16 ; 0xae3a ae4a: 00 23 and r16, r16 ae4c: 29 f0 breq .+10 ; 0xae58 ae4e: b6 01 movw r22, r12 ae50: 80 2f mov r24, r16 ae52: 90 e0 ldi r25, 0x00 ; 0 ae54: 0f 94 bc da call 0x3b578 ; 0x3b578 ae58: 3c 85 ldd r19, Y+12 ; 0x0c ae5a: 2c e9 ldi r18, 0x9C ; 156 ae5c: a2 2e mov r10, r18 ae5e: 25 e7 ldi r18, 0x75 ; 117 ae60: b2 2e mov r11, r18 ae62: 33 fd sbrc r19, 3 ae64: 04 c0 rjmp .+8 ; 0xae6e ae66: 90 ea ldi r25, 0xA0 ; 160 ae68: a9 2e mov r10, r25 ae6a: 95 e7 ldi r25, 0x75 ; 117 ae6c: b9 2e mov r11, r25 ae6e: 10 71 andi r17, 0x10 ; 16 ae70: 22 c0 rjmp .+68 ; 0xaeb6 ae72: 9b e9 ldi r25, 0x9B ; 155 ae74: 98 0f add r25, r24 ae76: 93 30 cpi r25, 0x03 ; 3 ae78: 08 f0 brcs .+2 ; 0xae7c ae7a: 47 c1 rjmp .+654 ; 0xb10a ae7c: 0f 7e andi r16, 0xEF ; 239 ae7e: 9c cf rjmp .-200 ; 0xadb8 ae80: 86 36 cpi r24, 0x66 ; 102 ae82: 11 f4 brne .+4 ; 0xae88 ae84: 10 68 ori r17, 0x80 ; 128 ae86: a2 cf rjmp .-188 ; 0xadcc ae88: ff 20 and r15, r15 ae8a: 09 f4 brne .+2 ; 0xae8e ae8c: 9f cf rjmp .-194 ; 0xadcc ae8e: fa 94 dec r15 ae90: 9d cf rjmp .-198 ; 0xadcc ae92: e7 e0 ldi r30, 0x07 ; 7 ae94: 2f 2d mov r18, r15 ae96: ef 15 cp r30, r15 ae98: 18 f4 brcc .+6 ; 0xaea0 ae9a: 27 e0 ldi r18, 0x07 ; 7 ae9c: 37 e0 ldi r19, 0x07 ; 7 ae9e: f3 2e mov r15, r19 aea0: 41 2c mov r4, r1 aea2: 9f cf rjmp .-194 ; 0xade2 aea4: 11 11 cpse r17, r1 aea6: 80 52 subi r24, 0x20 ; 32 aea8: b6 01 movw r22, r12 aeaa: 90 e0 ldi r25, 0x00 ; 0 aeac: 0f 94 bc da call 0x3b578 ; 0x3b578 aeb0: 8f ef ldi r24, 0xFF ; 255 aeb2: a8 1a sub r10, r24 aeb4: b8 0a sbc r11, r24 aeb6: f5 01 movw r30, r10 aeb8: 84 91 lpm r24, Z aeba: 81 11 cpse r24, r1 aebc: f3 cf rjmp .-26 ; 0xaea4 aebe: e1 10 cpse r14, r1 aec0: 84 c2 rjmp .+1288 ; 0xb3ca aec2: 53 01 movw r10, r6 aec4: f6 01 movw r30, r12 aec6: 93 81 ldd r25, Z+3 ; 0x03 aec8: f1 01 movw r30, r2 aeca: 93 fd sbrc r25, 3 aecc: 85 91 lpm r24, Z+ aece: 93 ff sbrs r25, 3 aed0: 81 91 ld r24, Z+ aed2: 1f 01 movw r2, r30 aed4: 88 23 and r24, r24 aed6: 09 f4 brne .+2 ; 0xaeda aed8: 11 c2 rjmp .+1058 ; 0xb2fc aeda: 85 32 cpi r24, 0x25 ; 37 aedc: 41 f4 brne .+16 ; 0xaeee aede: 93 fd sbrc r25, 3 aee0: 85 91 lpm r24, Z+ aee2: 93 ff sbrs r25, 3 aee4: 81 91 ld r24, Z+ aee6: 1f 01 movw r2, r30 aee8: 85 32 cpi r24, 0x25 ; 37 aeea: 09 f0 breq .+2 ; 0xaeee aeec: 1c cf rjmp .-456 ; 0xad26 aeee: b6 01 movw r22, r12 aef0: 90 e0 ldi r25, 0x00 ; 0 aef2: 0f 94 bc da call 0x3b578 ; 0x3b578 aef6: 35 01 movw r6, r10 aef8: e4 cf rjmp .-56 ; 0xaec2 aefa: 17 ff sbrs r17, 7 aefc: 6f c0 rjmp .+222 ; 0xafdc aefe: 4a 0c add r4, r10 af00: fc 85 ldd r31, Y+12 ; 0x0c af02: f4 ff sbrs r31, 4 af04: 04 c0 rjmp .+8 ; 0xaf0e af06: 8a 81 ldd r24, Y+2 ; 0x02 af08: 81 33 cpi r24, 0x31 ; 49 af0a: 09 f4 brne .+2 ; 0xaf0e af0c: 4a 94 dec r4 af0e: 14 14 cp r1, r4 af10: 0c f0 brlt .+2 ; 0xaf14 af12: 86 c0 rjmp .+268 ; 0xb020 af14: 28 e0 ldi r18, 0x08 ; 8 af16: 24 15 cp r18, r4 af18: 10 f4 brcc .+4 ; 0xaf1e af1a: 88 e0 ldi r24, 0x08 ; 8 af1c: 48 2e mov r4, r24 af1e: 85 e0 ldi r24, 0x05 ; 5 af20: 90 e0 ldi r25, 0x00 ; 0 af22: 17 ff sbrs r17, 7 af24: 06 c0 rjmp .+12 ; 0xaf32 af26: c5 01 movw r24, r10 af28: b7 fe sbrs r11, 7 af2a: 02 c0 rjmp .+4 ; 0xaf30 af2c: 90 e0 ldi r25, 0x00 ; 0 af2e: 80 e0 ldi r24, 0x00 ; 0 af30: 01 96 adiw r24, 0x01 ; 1 af32: 01 11 cpse r16, r1 af34: 01 96 adiw r24, 0x01 ; 1 af36: ff 20 and r15, r15 af38: 31 f0 breq .+12 ; 0xaf46 af3a: 2f 2d mov r18, r15 af3c: 30 e0 ldi r19, 0x00 ; 0 af3e: 2f 5f subi r18, 0xFF ; 255 af40: 3f 4f sbci r19, 0xFF ; 255 af42: 82 0f add r24, r18 af44: 93 1f adc r25, r19 af46: 58 16 cp r5, r24 af48: 19 06 cpc r1, r25 af4a: 19 f0 breq .+6 ; 0xaf52 af4c: 14 f0 brlt .+4 ; 0xaf52 af4e: e5 2c mov r14, r5 af50: e8 1a sub r14, r24 af52: 81 2f mov r24, r17 af54: 89 70 andi r24, 0x09 ; 9 af56: 11 f4 brne .+4 ; 0xaf5c af58: e1 10 cpse r14, r1 af5a: 67 c0 rjmp .+206 ; 0xb02a af5c: 00 23 and r16, r16 af5e: 29 f0 breq .+10 ; 0xaf6a af60: b6 01 movw r22, r12 af62: 80 2f mov r24, r16 af64: 90 e0 ldi r25, 0x00 ; 0 af66: 0f 94 bc da call 0x3b578 ; 0x3b578 af6a: 13 fd sbrc r17, 3 af6c: 02 c0 rjmp .+4 ; 0xaf72 af6e: e1 10 cpse r14, r1 af70: 63 c0 rjmp .+198 ; 0xb038 af72: 17 ff sbrs r17, 7 af74: 7c c0 rjmp .+248 ; 0xb06e af76: 85 01 movw r16, r10 af78: b7 fe sbrs r11, 7 af7a: 02 c0 rjmp .+4 ; 0xaf80 af7c: 10 e0 ldi r17, 0x00 ; 0 af7e: 00 e0 ldi r16, 0x00 ; 0 af80: c5 01 movw r24, r10 af82: 84 19 sub r24, r4 af84: 91 09 sbc r25, r1 af86: 2c 01 movw r4, r24 af88: 6f 2d mov r22, r15 af8a: 70 e0 ldi r23, 0x00 ; 0 af8c: ee 27 eor r30, r30 af8e: ff 27 eor r31, r31 af90: e6 1b sub r30, r22 af92: f7 0b sbc r31, r23 af94: ff 87 std Y+15, r31 ; 0x0f af96: ee 87 std Y+14, r30 ; 0x0e af98: 0f 3f cpi r16, 0xFF ; 255 af9a: 10 07 cpc r17, r16 af9c: 29 f4 brne .+10 ; 0xafa8 af9e: b6 01 movw r22, r12 afa0: 8e e2 ldi r24, 0x2E ; 46 afa2: 90 e0 ldi r25, 0x00 ; 0 afa4: 0f 94 bc da call 0x3b578 ; 0x3b578 afa8: a0 16 cp r10, r16 afaa: b1 06 cpc r11, r17 afac: 0c f4 brge .+2 ; 0xafb0 afae: 4b c0 rjmp .+150 ; 0xb046 afb0: 40 16 cp r4, r16 afb2: 51 06 cpc r5, r17 afb4: 0c f0 brlt .+2 ; 0xafb8 afb6: 47 c0 rjmp .+142 ; 0xb046 afb8: f5 01 movw r30, r10 afba: e0 1b sub r30, r16 afbc: f1 0b sbc r31, r17 afbe: e8 0d add r30, r8 afc0: f9 1d adc r31, r9 afc2: 81 81 ldd r24, Z+1 ; 0x01 afc4: 01 50 subi r16, 0x01 ; 1 afc6: 11 09 sbc r17, r1 afc8: 2e 85 ldd r18, Y+14 ; 0x0e afca: 3f 85 ldd r19, Y+15 ; 0x0f afcc: 02 17 cp r16, r18 afce: 13 07 cpc r17, r19 afd0: e4 f1 brlt .+120 ; 0xb04a afd2: b6 01 movw r22, r12 afd4: 90 e0 ldi r25, 0x00 ; 0 afd6: 0f 94 bc da call 0x3b578 ; 0x3b578 afda: de cf rjmp .-68 ; 0xaf98 afdc: 16 fd sbrc r17, 6 afde: 9f cf rjmp .-194 ; 0xaf1e afe0: ef 2d mov r30, r15 afe2: f0 e0 ldi r31, 0x00 ; 0 afe4: ea 15 cp r30, r10 afe6: fb 05 cpc r31, r11 afe8: 34 f0 brlt .+12 ; 0xaff6 afea: 3c ef ldi r19, 0xFC ; 252 afec: a3 16 cp r10, r19 afee: 3f ef ldi r19, 0xFF ; 255 aff0: b3 06 cpc r11, r19 aff2: 0c f0 brlt .+2 ; 0xaff6 aff4: 10 68 ori r17, 0x80 ; 128 aff6: 32 96 adiw r30, 0x02 ; 2 aff8: e8 0d add r30, r8 affa: f9 1d adc r31, r9 affc: 01 c0 rjmp .+2 ; 0xb000 affe: fa 94 dec r15 b000: ff 20 and r15, r15 b002: 19 f0 breq .+6 ; 0xb00a b004: 82 91 ld r24, -Z b006: 80 33 cpi r24, 0x30 ; 48 b008: d1 f3 breq .-12 ; 0xaffe b00a: 17 ff sbrs r17, 7 b00c: 88 cf rjmp .-240 ; 0xaf1e b00e: 44 24 eor r4, r4 b010: 43 94 inc r4 b012: 4f 0c add r4, r15 b014: fa 14 cp r15, r10 b016: 1b 04 cpc r1, r11 b018: 31 f0 breq .+12 ; 0xb026 b01a: 2c f0 brlt .+10 ; 0xb026 b01c: fa 18 sub r15, r10 b01e: 7f cf rjmp .-258 ; 0xaf1e b020: 44 24 eor r4, r4 b022: 43 94 inc r4 b024: 7c cf rjmp .-264 ; 0xaf1e b026: f1 2c mov r15, r1 b028: 7a cf rjmp .-268 ; 0xaf1e b02a: b6 01 movw r22, r12 b02c: 80 e2 ldi r24, 0x20 ; 32 b02e: 90 e0 ldi r25, 0x00 ; 0 b030: 0f 94 bc da call 0x3b578 ; 0x3b578 b034: ea 94 dec r14 b036: 90 cf rjmp .-224 ; 0xaf58 b038: b6 01 movw r22, r12 b03a: 80 e3 ldi r24, 0x30 ; 48 b03c: 90 e0 ldi r25, 0x00 ; 0 b03e: 0f 94 bc da call 0x3b578 ; 0x3b578 b042: ea 94 dec r14 b044: 94 cf rjmp .-216 ; 0xaf6e b046: 80 e3 ldi r24, 0x30 ; 48 b048: bd cf rjmp .-134 ; 0xafc4 b04a: a0 16 cp r10, r16 b04c: b1 06 cpc r11, r17 b04e: 41 f4 brne .+16 ; 0xb060 b050: 9a 81 ldd r25, Y+2 ; 0x02 b052: 96 33 cpi r25, 0x36 ; 54 b054: 50 f4 brcc .+20 ; 0xb06a b056: 95 33 cpi r25, 0x35 ; 53 b058: 19 f4 brne .+6 ; 0xb060 b05a: 3c 85 ldd r19, Y+12 ; 0x0c b05c: 34 ff sbrs r19, 4 b05e: 05 c0 rjmp .+10 ; 0xb06a b060: b6 01 movw r22, r12 b062: 90 e0 ldi r25, 0x00 ; 0 b064: 0f 94 bc da call 0x3b578 ; 0x3b578 b068: 2a cf rjmp .-428 ; 0xaebe b06a: 81 e3 ldi r24, 0x31 ; 49 b06c: f9 cf rjmp .-14 ; 0xb060 b06e: 8a 81 ldd r24, Y+2 ; 0x02 b070: 81 33 cpi r24, 0x31 ; 49 b072: 19 f0 breq .+6 ; 0xb07a b074: 9c 85 ldd r25, Y+12 ; 0x0c b076: 9f 7e andi r25, 0xEF ; 239 b078: 9c 87 std Y+12, r25 ; 0x0c b07a: b6 01 movw r22, r12 b07c: 90 e0 ldi r25, 0x00 ; 0 b07e: 0f 94 bc da call 0x3b578 ; 0x3b578 b082: ff 20 and r15, r15 b084: a9 f0 breq .+42 ; 0xb0b0 b086: b6 01 movw r22, r12 b088: 8e e2 ldi r24, 0x2E ; 46 b08a: 90 e0 ldi r25, 0x00 ; 0 b08c: 0f 94 bc da call 0x3b578 ; 0x3b578 b090: f3 94 inc r15 b092: f3 94 inc r15 b094: e2 e0 ldi r30, 0x02 ; 2 b096: 01 e0 ldi r16, 0x01 ; 1 b098: 0e 0f add r16, r30 b09a: e8 0d add r30, r8 b09c: f9 2d mov r31, r9 b09e: f1 1d adc r31, r1 b0a0: 80 81 ld r24, Z b0a2: b6 01 movw r22, r12 b0a4: 90 e0 ldi r25, 0x00 ; 0 b0a6: 0f 94 bc da call 0x3b578 ; 0x3b578 b0aa: e0 2f mov r30, r16 b0ac: 0f 11 cpse r16, r15 b0ae: f3 cf rjmp .-26 ; 0xb096 b0b0: 85 e6 ldi r24, 0x65 ; 101 b0b2: 90 e0 ldi r25, 0x00 ; 0 b0b4: 14 ff sbrs r17, 4 b0b6: 02 c0 rjmp .+4 ; 0xb0bc b0b8: 85 e4 ldi r24, 0x45 ; 69 b0ba: 90 e0 ldi r25, 0x00 ; 0 b0bc: b6 01 movw r22, r12 b0be: 0f 94 bc da call 0x3b578 ; 0x3b578 b0c2: b7 fc sbrc r11, 7 b0c4: 06 c0 rjmp .+12 ; 0xb0d2 b0c6: a1 14 cp r10, r1 b0c8: b1 04 cpc r11, r1 b0ca: c1 f4 brne .+48 ; 0xb0fc b0cc: ec 85 ldd r30, Y+12 ; 0x0c b0ce: e4 ff sbrs r30, 4 b0d0: 15 c0 rjmp .+42 ; 0xb0fc b0d2: b1 94 neg r11 b0d4: a1 94 neg r10 b0d6: b1 08 sbc r11, r1 b0d8: 8d e2 ldi r24, 0x2D ; 45 b0da: b6 01 movw r22, r12 b0dc: 90 e0 ldi r25, 0x00 ; 0 b0de: 0f 94 bc da call 0x3b578 ; 0x3b578 b0e2: 80 e3 ldi r24, 0x30 ; 48 b0e4: 2a e0 ldi r18, 0x0A ; 10 b0e6: a2 16 cp r10, r18 b0e8: b1 04 cpc r11, r1 b0ea: 54 f4 brge .+20 ; 0xb100 b0ec: b6 01 movw r22, r12 b0ee: 90 e0 ldi r25, 0x00 ; 0 b0f0: 0f 94 bc da call 0x3b578 ; 0x3b578 b0f4: b6 01 movw r22, r12 b0f6: c5 01 movw r24, r10 b0f8: c0 96 adiw r24, 0x30 ; 48 b0fa: b4 cf rjmp .-152 ; 0xb064 b0fc: 8b e2 ldi r24, 0x2B ; 43 b0fe: ed cf rjmp .-38 ; 0xb0da b100: 8f 5f subi r24, 0xFF ; 255 b102: fa e0 ldi r31, 0x0A ; 10 b104: af 1a sub r10, r31 b106: b1 08 sbc r11, r1 b108: ed cf rjmp .-38 ; 0xb0e4 b10a: 83 36 cpi r24, 0x63 ; 99 b10c: c9 f0 breq .+50 ; 0xb140 b10e: 83 37 cpi r24, 0x73 ; 115 b110: 71 f1 breq .+92 ; 0xb16e b112: 83 35 cpi r24, 0x53 ; 83 b114: 09 f0 breq .+2 ; 0xb118 b116: 5b c0 rjmp .+182 ; 0xb1ce b118: 35 01 movw r6, r10 b11a: f2 e0 ldi r31, 0x02 ; 2 b11c: 6f 0e add r6, r31 b11e: 71 1c adc r7, r1 b120: f5 01 movw r30, r10 b122: a0 80 ld r10, Z b124: b1 80 ldd r11, Z+1 ; 0x01 b126: 6f 2d mov r22, r15 b128: 70 e0 ldi r23, 0x00 ; 0 b12a: 06 fd sbrc r16, 6 b12c: 02 c0 rjmp .+4 ; 0xb132 b12e: 6f ef ldi r22, 0xFF ; 255 b130: 7f ef ldi r23, 0xFF ; 255 b132: c5 01 movw r24, r10 b134: 0f 94 50 da call 0x3b4a0 ; 0x3b4a0 b138: 9d 87 std Y+13, r25 ; 0x0d b13a: 8c 87 std Y+12, r24 ; 0x0c b13c: 00 68 ori r16, 0x80 ; 128 b13e: 0d c0 rjmp .+26 ; 0xb15a b140: 35 01 movw r6, r10 b142: 32 e0 ldi r19, 0x02 ; 2 b144: 63 0e add r6, r19 b146: 71 1c adc r7, r1 b148: f5 01 movw r30, r10 b14a: 80 81 ld r24, Z b14c: 89 83 std Y+1, r24 ; 0x01 b14e: 21 e0 ldi r18, 0x01 ; 1 b150: 30 e0 ldi r19, 0x00 ; 0 b152: 3d 87 std Y+13, r19 ; 0x0d b154: 2c 87 std Y+12, r18 ; 0x0c b156: 54 01 movw r10, r8 b158: 0f 77 andi r16, 0x7F ; 127 b15a: 03 fd sbrc r16, 3 b15c: 06 c0 rjmp .+12 ; 0xb16a b15e: 2c 85 ldd r18, Y+12 ; 0x0c b160: 3d 85 ldd r19, Y+13 ; 0x0d b162: 52 16 cp r5, r18 b164: 13 06 cpc r1, r19 b166: 09 f0 breq .+2 ; 0xb16a b168: a8 f4 brcc .+42 ; 0xb194 b16a: e5 2c mov r14, r5 b16c: 2b c0 rjmp .+86 ; 0xb1c4 b16e: 35 01 movw r6, r10 b170: 32 e0 ldi r19, 0x02 ; 2 b172: 63 0e add r6, r19 b174: 71 1c adc r7, r1 b176: f5 01 movw r30, r10 b178: a0 80 ld r10, Z b17a: b1 80 ldd r11, Z+1 ; 0x01 b17c: 6f 2d mov r22, r15 b17e: 70 e0 ldi r23, 0x00 ; 0 b180: 06 fd sbrc r16, 6 b182: 02 c0 rjmp .+4 ; 0xb188 b184: 6f ef ldi r22, 0xFF ; 255 b186: 7f ef ldi r23, 0xFF ; 255 b188: c5 01 movw r24, r10 b18a: 0f 94 75 da call 0x3b4ea ; 0x3b4ea b18e: 9d 87 std Y+13, r25 ; 0x0d b190: 8c 87 std Y+12, r24 ; 0x0c b192: e2 cf rjmp .-60 ; 0xb158 b194: b6 01 movw r22, r12 b196: 80 e2 ldi r24, 0x20 ; 32 b198: 90 e0 ldi r25, 0x00 ; 0 b19a: 0f 94 bc da call 0x3b578 ; 0x3b578 b19e: 5a 94 dec r5 b1a0: de cf rjmp .-68 ; 0xb15e b1a2: f5 01 movw r30, r10 b1a4: 07 fd sbrc r16, 7 b1a6: 85 91 lpm r24, Z+ b1a8: 07 ff sbrs r16, 7 b1aa: 81 91 ld r24, Z+ b1ac: 5f 01 movw r10, r30 b1ae: b6 01 movw r22, r12 b1b0: 90 e0 ldi r25, 0x00 ; 0 b1b2: 0f 94 bc da call 0x3b578 ; 0x3b578 b1b6: e1 10 cpse r14, r1 b1b8: ea 94 dec r14 b1ba: 8c 85 ldd r24, Y+12 ; 0x0c b1bc: 9d 85 ldd r25, Y+13 ; 0x0d b1be: 01 97 sbiw r24, 0x01 ; 1 b1c0: 9d 87 std Y+13, r25 ; 0x0d b1c2: 8c 87 std Y+12, r24 ; 0x0c b1c4: ec 85 ldd r30, Y+12 ; 0x0c b1c6: fd 85 ldd r31, Y+13 ; 0x0d b1c8: ef 2b or r30, r31 b1ca: 59 f7 brne .-42 ; 0xb1a2 b1cc: 78 ce rjmp .-784 ; 0xaebe b1ce: 84 36 cpi r24, 0x64 ; 100 b1d0: 19 f0 breq .+6 ; 0xb1d8 b1d2: 89 36 cpi r24, 0x69 ; 105 b1d4: 09 f0 breq .+2 ; 0xb1d8 b1d6: 74 c0 rjmp .+232 ; 0xb2c0 b1d8: 35 01 movw r6, r10 b1da: 07 ff sbrs r16, 7 b1dc: 66 c0 rjmp .+204 ; 0xb2aa b1de: f4 e0 ldi r31, 0x04 ; 4 b1e0: 6f 0e add r6, r31 b1e2: 71 1c adc r7, r1 b1e4: f5 01 movw r30, r10 b1e6: 60 81 ld r22, Z b1e8: 71 81 ldd r23, Z+1 ; 0x01 b1ea: 82 81 ldd r24, Z+2 ; 0x02 b1ec: 93 81 ldd r25, Z+3 ; 0x03 b1ee: 10 2f mov r17, r16 b1f0: 1f 76 andi r17, 0x6F ; 111 b1f2: 97 ff sbrs r25, 7 b1f4: 08 c0 rjmp .+16 ; 0xb206 b1f6: 90 95 com r25 b1f8: 80 95 com r24 b1fa: 70 95 com r23 b1fc: 61 95 neg r22 b1fe: 7f 4f sbci r23, 0xFF ; 255 b200: 8f 4f sbci r24, 0xFF ; 255 b202: 9f 4f sbci r25, 0xFF ; 255 b204: 10 68 ori r17, 0x80 ; 128 b206: 2a e0 ldi r18, 0x0A ; 10 b208: 30 e0 ldi r19, 0x00 ; 0 b20a: a4 01 movw r20, r8 b20c: 0f 94 e3 db call 0x3b7c6 ; 0x3b7c6 <__ultoa_invert> b210: a8 2e mov r10, r24 b212: a8 18 sub r10, r8 b214: ba 2c mov r11, r10 b216: 01 2f mov r16, r17 b218: 16 ff sbrs r17, 6 b21a: 0a c0 rjmp .+20 ; 0xb230 b21c: 0e 7f andi r16, 0xFE ; 254 b21e: af 14 cp r10, r15 b220: 38 f4 brcc .+14 ; 0xb230 b222: 14 ff sbrs r17, 4 b224: 04 c0 rjmp .+8 ; 0xb22e b226: 12 fd sbrc r17, 2 b228: 02 c0 rjmp .+4 ; 0xb22e b22a: 01 2f mov r16, r17 b22c: 0e 7e andi r16, 0xEE ; 238 b22e: bf 2c mov r11, r15 b230: 04 ff sbrs r16, 4 b232: a3 c0 rjmp .+326 ; 0xb37a b234: fe 01 movw r30, r28 b236: ea 0d add r30, r10 b238: f1 1d adc r31, r1 b23a: 80 81 ld r24, Z b23c: 80 33 cpi r24, 0x30 ; 48 b23e: 09 f0 breq .+2 ; 0xb242 b240: 95 c0 rjmp .+298 ; 0xb36c b242: 09 7e andi r16, 0xE9 ; 233 b244: f0 2f mov r31, r16 b246: f8 70 andi r31, 0x08 ; 8 b248: ef 2e mov r14, r31 b24a: 03 fd sbrc r16, 3 b24c: a5 c0 rjmp .+330 ; 0xb398 b24e: 00 ff sbrs r16, 0 b250: 9f c0 rjmp .+318 ; 0xb390 b252: fa 2c mov r15, r10 b254: b5 14 cp r11, r5 b256: 10 f4 brcc .+4 ; 0xb25c b258: f5 0c add r15, r5 b25a: fb 18 sub r15, r11 b25c: 04 ff sbrs r16, 4 b25e: a2 c0 rjmp .+324 ; 0xb3a4 b260: b6 01 movw r22, r12 b262: 80 e3 ldi r24, 0x30 ; 48 b264: 90 e0 ldi r25, 0x00 ; 0 b266: 0f 94 bc da call 0x3b578 ; 0x3b578 b26a: 02 ff sbrs r16, 2 b26c: 09 c0 rjmp .+18 ; 0xb280 b26e: 88 e7 ldi r24, 0x78 ; 120 b270: 90 e0 ldi r25, 0x00 ; 0 b272: 01 ff sbrs r16, 1 b274: 02 c0 rjmp .+4 ; 0xb27a b276: 88 e5 ldi r24, 0x58 ; 88 b278: 90 e0 ldi r25, 0x00 ; 0 b27a: b6 01 movw r22, r12 b27c: 0f 94 bc da call 0x3b578 ; 0x3b578 b280: af 14 cp r10, r15 b282: 08 f4 brcc .+2 ; 0xb286 b284: 9b c0 rjmp .+310 ; 0xb3bc b286: aa 94 dec r10 b288: 0a 2d mov r16, r10 b28a: 10 e0 ldi r17, 0x00 ; 0 b28c: 0f 5f subi r16, 0xFF ; 255 b28e: 1f 4f sbci r17, 0xFF ; 255 b290: 08 0d add r16, r8 b292: 19 1d adc r17, r9 b294: f8 01 movw r30, r16 b296: 82 91 ld r24, -Z b298: 8f 01 movw r16, r30 b29a: b6 01 movw r22, r12 b29c: 90 e0 ldi r25, 0x00 ; 0 b29e: 0f 94 bc da call 0x3b578 ; 0x3b578 b2a2: 80 16 cp r8, r16 b2a4: 91 06 cpc r9, r17 b2a6: b1 f7 brne .-20 ; 0xb294 b2a8: 0a ce rjmp .-1004 ; 0xaebe b2aa: f2 e0 ldi r31, 0x02 ; 2 b2ac: 6f 0e add r6, r31 b2ae: 71 1c adc r7, r1 b2b0: f5 01 movw r30, r10 b2b2: 60 81 ld r22, Z b2b4: 71 81 ldd r23, Z+1 ; 0x01 b2b6: 07 2e mov r0, r23 b2b8: 00 0c add r0, r0 b2ba: 88 0b sbc r24, r24 b2bc: 99 0b sbc r25, r25 b2be: 97 cf rjmp .-210 ; 0xb1ee b2c0: 10 2f mov r17, r16 b2c2: 85 37 cpi r24, 0x75 ; 117 b2c4: a9 f4 brne .+42 ; 0xb2f0 b2c6: 1f 7e andi r17, 0xEF ; 239 b2c8: 2a e0 ldi r18, 0x0A ; 10 b2ca: 30 e0 ldi r19, 0x00 ; 0 b2cc: 35 01 movw r6, r10 b2ce: 17 ff sbrs r17, 7 b2d0: 44 c0 rjmp .+136 ; 0xb35a b2d2: f4 e0 ldi r31, 0x04 ; 4 b2d4: 6f 0e add r6, r31 b2d6: 71 1c adc r7, r1 b2d8: f5 01 movw r30, r10 b2da: 60 81 ld r22, Z b2dc: 71 81 ldd r23, Z+1 ; 0x01 b2de: 82 81 ldd r24, Z+2 ; 0x02 b2e0: 93 81 ldd r25, Z+3 ; 0x03 b2e2: a4 01 movw r20, r8 b2e4: 0f 94 e3 db call 0x3b7c6 ; 0x3b7c6 <__ultoa_invert> b2e8: a8 2e mov r10, r24 b2ea: a8 18 sub r10, r8 b2ec: 1f 77 andi r17, 0x7F ; 127 b2ee: 92 cf rjmp .-220 ; 0xb214 b2f0: 19 7f andi r17, 0xF9 ; 249 b2f2: 8f 36 cpi r24, 0x6F ; 111 b2f4: 79 f1 breq .+94 ; 0xb354 b2f6: f0 f4 brcc .+60 ; 0xb334 b2f8: 88 35 cpi r24, 0x58 ; 88 b2fa: 39 f1 breq .+78 ; 0xb34a b2fc: f6 01 movw r30, r12 b2fe: 86 81 ldd r24, Z+6 ; 0x06 b300: 97 81 ldd r25, Z+7 ; 0x07 b302: 2f 96 adiw r28, 0x0f ; 15 b304: 0f b6 in r0, 0x3f ; 63 b306: f8 94 cli b308: de bf out 0x3e, r29 ; 62 b30a: 0f be out 0x3f, r0 ; 63 b30c: cd bf out 0x3d, r28 ; 61 b30e: df 91 pop r29 b310: cf 91 pop r28 b312: 1f 91 pop r17 b314: 0f 91 pop r16 b316: ff 90 pop r15 b318: ef 90 pop r14 b31a: df 90 pop r13 b31c: cf 90 pop r12 b31e: bf 90 pop r11 b320: af 90 pop r10 b322: 9f 90 pop r9 b324: 8f 90 pop r8 b326: 7f 90 pop r7 b328: 6f 90 pop r6 b32a: 5f 90 pop r5 b32c: 4f 90 pop r4 b32e: 3f 90 pop r3 b330: 2f 90 pop r2 b332: 08 95 ret b334: 80 37 cpi r24, 0x70 ; 112 b336: 39 f0 breq .+14 ; 0xb346 b338: 88 37 cpi r24, 0x78 ; 120 b33a: 01 f7 brne .-64 ; 0xb2fc b33c: 14 fd sbrc r17, 4 b33e: 14 60 ori r17, 0x04 ; 4 b340: 20 e1 ldi r18, 0x10 ; 16 b342: 30 e0 ldi r19, 0x00 ; 0 b344: c3 cf rjmp .-122 ; 0xb2cc b346: 10 61 ori r17, 0x10 ; 16 b348: f9 cf rjmp .-14 ; 0xb33c b34a: 04 fd sbrc r16, 4 b34c: 16 60 ori r17, 0x06 ; 6 b34e: 20 e1 ldi r18, 0x10 ; 16 b350: 32 e0 ldi r19, 0x02 ; 2 b352: bc cf rjmp .-136 ; 0xb2cc b354: 28 e0 ldi r18, 0x08 ; 8 b356: 30 e0 ldi r19, 0x00 ; 0 b358: b9 cf rjmp .-142 ; 0xb2cc b35a: f2 e0 ldi r31, 0x02 ; 2 b35c: 6f 0e add r6, r31 b35e: 71 1c adc r7, r1 b360: f5 01 movw r30, r10 b362: 60 81 ld r22, Z b364: 71 81 ldd r23, Z+1 ; 0x01 b366: 90 e0 ldi r25, 0x00 ; 0 b368: 80 e0 ldi r24, 0x00 ; 0 b36a: bb cf rjmp .-138 ; 0xb2e2 b36c: 02 fd sbrc r16, 2 b36e: 02 c0 rjmp .+4 ; 0xb374 b370: b3 94 inc r11 b372: 68 cf rjmp .-304 ; 0xb244 b374: b3 94 inc r11 b376: b3 94 inc r11 b378: 65 cf rjmp .-310 ; 0xb244 b37a: 80 2f mov r24, r16 b37c: 86 78 andi r24, 0x86 ; 134 b37e: 09 f4 brne .+2 ; 0xb382 b380: 61 cf rjmp .-318 ; 0xb244 b382: f6 cf rjmp .-20 ; 0xb370 b384: b6 01 movw r22, r12 b386: 80 e2 ldi r24, 0x20 ; 32 b388: 90 e0 ldi r25, 0x00 ; 0 b38a: 0f 94 bc da call 0x3b578 ; 0x3b578 b38e: b3 94 inc r11 b390: b5 14 cp r11, r5 b392: c0 f3 brcs .-16 ; 0xb384 b394: e1 2c mov r14, r1 b396: 62 cf rjmp .-316 ; 0xb25c b398: e5 2c mov r14, r5 b39a: eb 18 sub r14, r11 b39c: b5 14 cp r11, r5 b39e: 08 f4 brcc .+2 ; 0xb3a2 b3a0: 5d cf rjmp .-326 ; 0xb25c b3a2: f8 cf rjmp .-16 ; 0xb394 b3a4: 80 2f mov r24, r16 b3a6: 86 78 andi r24, 0x86 ; 134 b3a8: 09 f4 brne .+2 ; 0xb3ac b3aa: 6a cf rjmp .-300 ; 0xb280 b3ac: 8b e2 ldi r24, 0x2B ; 43 b3ae: 01 ff sbrs r16, 1 b3b0: 80 e2 ldi r24, 0x20 ; 32 b3b2: 07 fd sbrc r16, 7 b3b4: 8d e2 ldi r24, 0x2D ; 45 b3b6: b6 01 movw r22, r12 b3b8: 90 e0 ldi r25, 0x00 ; 0 b3ba: 60 cf rjmp .-320 ; 0xb27c b3bc: b6 01 movw r22, r12 b3be: 80 e3 ldi r24, 0x30 ; 48 b3c0: 90 e0 ldi r25, 0x00 ; 0 b3c2: 0f 94 bc da call 0x3b578 ; 0x3b578 b3c6: fa 94 dec r15 b3c8: 5b cf rjmp .-330 ; 0xb280 b3ca: b6 01 movw r22, r12 b3cc: 80 e2 ldi r24, 0x20 ; 32 b3ce: 90 e0 ldi r25, 0x00 ; 0 b3d0: 0f 94 bc da call 0x3b578 ; 0x3b578 b3d4: ea 94 dec r14 b3d6: 73 cd rjmp .-1306 ; 0xaebe b3d8: 24 e0 ldi r18, 0x04 ; 4 b3da: e1 2c mov r14, r1 b3dc: 25 15 cp r18, r5 b3de: 08 f0 brcs .+2 ; 0xb3e2 b3e0: 36 cd rjmp .-1428 ; 0xae4e b3e2: 84 e0 ldi r24, 0x04 ; 4 b3e4: 26 cd rjmp .-1460 ; 0xae32 0000b3e6 : 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 ( b3e6: 20 e0 ldi r18, 0x00 ; 0 b3e8: 30 e0 ldi r19, 0x00 ; 0 b3ea: 40 e8 ldi r20, 0x80 ; 128 b3ec: 5f eb ldi r21, 0xBF ; 191 b3ee: 60 91 83 02 lds r22, 0x0283 ; 0x800283 b3f2: 70 91 84 02 lds r23, 0x0284 ; 0x800284 b3f6: 80 91 85 02 lds r24, 0x0285 ; 0x800285 b3fa: 90 91 86 02 lds r25, 0x0286 ; 0x800286 b3fe: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> b402: 88 23 and r24, r24 b404: 21 f1 breq .+72 ; 0xb44e (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b406: e0 91 92 12 lds r30, 0x1292 ; 0x801292 b40a: f0 91 93 12 lds r31, 0x1293 ; 0x801293 b40e: eb 55 subi r30, 0x5B ; 91 b410: 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) && ( b412: 80 81 ld r24, Z b414: 8b 7f andi r24, 0xFB ; 251 b416: 82 30 cpi r24, 0x02 ; 2 b418: d1 f4 brne .+52 ; 0xb44e (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)); b41a: 80 e1 ldi r24, 0x10 ; 16 b41c: e3 e8 ldi r30, 0x83 ; 131 b41e: f2 e0 ldi r31, 0x02 ; 2 b420: a2 e9 ldi r26, 0x92 ; 146 b422: b6 e0 ldi r27, 0x06 ; 6 b424: 01 90 ld r0, Z+ b426: 0d 92 st X+, r0 b428: 8a 95 dec r24 b42a: e1 f7 brne .-8 ; 0xb424 saved_start_position[0] = SAVED_START_POSITION_UNSET; b42c: 80 e0 ldi r24, 0x00 ; 0 b42e: 90 e0 ldi r25, 0x00 ; 0 b430: a0 e8 ldi r26, 0x80 ; 128 b432: bf eb ldi r27, 0xBF ; 191 b434: 80 93 83 02 sts 0x0283, r24 ; 0x800283 b438: 90 93 84 02 sts 0x0284, r25 ; 0x800284 b43c: a0 93 85 02 sts 0x0285, r26 ; 0x800285 b440: b0 93 86 02 sts 0x0286, r27 ; 0x800286 return saved_segment_idx; b444: 80 91 69 05 lds r24, 0x0569 ; 0x800569 b448: 90 91 6a 05 lds r25, 0x056A ; 0x80056a b44c: 08 95 ret } else return 1; //begin with the first segment b44e: 81 e0 ldi r24, 0x01 ; 1 b450: 90 e0 ldi r25, 0x00 ; 0 } b452: 08 95 ret 0000b454 : 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) { b454: cf 92 push r12 b456: df 92 push r13 b458: ef 92 push r14 b45a: ff 92 push r15 b45c: 0f 93 push r16 b45e: 1f 93 push r17 b460: cf 93 push r28 b462: 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); b464: 90 e0 ldi r25, 0x00 ; 0 b466: ec 01 movw r28, r24 b468: cc 0f add r28, r28 b46a: dd 1f adc r29, r29 b46c: cc 0f add r28, r28 b46e: dd 1f adc r29, r29 b470: fe 01 movw r30, r28 b472: e2 5b subi r30, 0xB2 ; 178 b474: f4 48 sbci r31, 0x84 ; 132 #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); b476: 25 91 lpm r18, Z+ b478: 35 91 lpm r19, Z+ b47a: 45 91 lpm r20, Z+ b47c: 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]; b47e: fe 01 movw r30, r28 b480: ea 5e subi r30, 0xEA ; 234 b482: f1 4f sbci r31, 0xF1 ; 241 b484: c0 80 ld r12, Z b486: d1 80 ldd r13, Z+1 ; 0x01 b488: e2 80 ldd r14, Z+2 ; 0x02 b48a: f3 80 ldd r15, Z+3 ; 0x03 b48c: 8e 01 movw r16, r28 b48e: 0e 56 subi r16, 0x6E ; 110 b490: 19 4f sbci r17, 0xF9 ; 249 b492: c7 01 movw r24, r14 b494: b6 01 movw r22, r12 b496: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> b49a: f8 01 movw r30, r16 b49c: 60 83 st Z, r22 b49e: 71 83 std Z+1, r23 ; 0x01 b4a0: 82 83 std Z+2, r24 ; 0x02 b4a2: 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); b4a4: fe 01 movw r30, r28 b4a6: ee 5b subi r30, 0xBE ; 190 b4a8: f4 48 sbci r31, 0x84 ; 132 #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); b4aa: 25 91 lpm r18, Z+ b4ac: 35 91 lpm r19, Z+ b4ae: 45 91 lpm r20, Z+ b4b0: 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]; b4b2: 8e 01 movw r16, r28 b4b4: 0f 5d subi r16, 0xDF ; 223 b4b6: 1d 4f sbci r17, 0xFD ; 253 b4b8: c7 01 movw r24, r14 b4ba: b6 01 movw r22, r12 b4bc: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> b4c0: f8 01 movw r30, r16 b4c2: 60 83 st Z, r22 b4c4: 71 83 std Z+1, r23 ; 0x01 b4c6: 82 83 std Z+2, r24 ; 0x02 b4c8: 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); b4ca: fe 01 movw r30, r28 b4cc: ea 5c subi r30, 0xCA ; 202 b4ce: f4 48 sbci r31, 0x84 ; 132 #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); b4d0: 25 91 lpm r18, Z+ b4d2: 35 91 lpm r19, Z+ b4d4: 45 91 lpm r20, Z+ b4d6: 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]; b4d8: cb 5e subi r28, 0xEB ; 235 b4da: dd 4f sbci r29, 0xFD ; 253 b4dc: c7 01 movw r24, r14 b4de: b6 01 movw r22, r12 b4e0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> b4e4: 68 83 st Y, r22 b4e6: 79 83 std Y+1, r23 ; 0x01 b4e8: 8a 83 std Y+2, r24 ; 0x02 b4ea: 9b 83 std Y+3, r25 ; 0x03 } b4ec: df 91 pop r29 b4ee: cf 91 pop r28 b4f0: 1f 91 pop r17 b4f2: 0f 91 pop r16 b4f4: ff 90 pop r15 b4f6: ef 90 pop r14 b4f8: df 90 pop r13 b4fa: cf 90 pop r12 b4fc: 08 95 ret 0000b4fe : 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)); } b4fe: 80 e1 ldi r24, 0x10 ; 16 b500: e4 e7 ldi r30, 0x74 ; 116 b502: f6 e0 ldi r31, 0x06 ; 6 b504: a2 e9 ldi r26, 0x92 ; 146 b506: b6 e0 ldi r27, 0x06 ; 6 b508: 01 90 ld r0, Z+ b50a: 0d 92 st X+, r0 b50c: 8a 95 dec r24 b50e: e1 f7 brne .-8 ; 0xb508 b510: 08 95 ret 0000b512 : /// @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)); b512: e1 ec ldi r30, 0xC1 ; 193 b514: fa e7 ldi r31, 0x7A ; 122 b516: 83 30 cpi r24, 0x03 ; 3 b518: 21 f0 breq .+8 ; 0xb522 b51a: e8 2f mov r30, r24 b51c: f0 e0 ldi r31, 0x00 ; 0 b51e: e2 54 subi r30, 0x42 ; 66 b520: f5 48 sbci r31, 0x85 ; 133 b522: 84 91 lpm r24, Z } b524: 08 95 ret 0000b526 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b526: 40 91 a3 10 lds r20, 0x10A3 ; 0x8010a3 b52a: 50 91 a4 10 lds r21, 0x10A4 ; 0x8010a4 return 0; b52e: 90 e0 ldi r25, 0x00 ; 0 b530: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b532: 41 15 cp r20, r1 b534: 51 05 cpc r21, r1 b536: b1 f1 breq .+108 ; 0xb5a4 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b538: 20 91 92 12 lds r18, 0x1292 ; 0x801292 b53c: 30 91 93 12 lds r19, 0x1293 ; 0x801293 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b540: 90 e0 ldi r25, 0x00 ; 0 b542: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b544: f9 01 movw r30, r18 b546: eb 55 subi r30, 0x5B ; 91 b548: ff 4e sbci r31, 0xEF ; 239 b54a: a0 81 ld r26, Z b54c: a2 30 cpi r26, 0x02 ; 2 b54e: 21 f4 brne .+8 ; 0xb558 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b550: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b552: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b554: 86 0f add r24, r22 b556: 97 1f adc r25, r23 } if (-- _buflen == 0) b558: 41 50 subi r20, 0x01 ; 1 b55a: 51 09 sbc r21, r1 b55c: 19 f1 breq .+70 ; 0xb5a4 b55e: f9 01 movw r30, r18 b560: e8 55 subi r30, 0x58 ; 88 b562: 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) ; b564: a1 91 ld r26, Z+ b566: 9f 01 movw r18, r30 b568: 25 5a subi r18, 0xA5 ; 165 b56a: 30 41 sbci r19, 0x10 ; 16 b56c: a1 11 cpse r26, r1 b56e: fa cf rjmp .-12 ; 0xb564 b570: f9 01 movw r30, r18 b572: eb 55 subi r30, 0x5B ; 91 b574: 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) ; b576: 2d 3e cpi r18, 0xED ; 237 b578: a1 e0 ldi r26, 0x01 ; 1 b57a: 3a 07 cpc r19, r26 b57c: 30 f4 brcc .+12 ; 0xb58a b57e: a1 91 ld r26, Z+ b580: a1 11 cpse r26, r1 b582: e0 cf rjmp .-64 ; 0xb544 b584: 2f 5f subi r18, 0xFF ; 255 b586: 3f 4f sbci r19, 0xFF ; 255 b588: f6 cf rjmp .-20 ; 0xb576 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b58a: 2d 3e cpi r18, 0xED ; 237 b58c: e1 e0 ldi r30, 0x01 ; 1 b58e: 3e 07 cpc r19, r30 b590: c9 f6 brne .-78 ; 0xb544 b592: e5 ea ldi r30, 0xA5 ; 165 b594: f0 e1 ldi r31, 0x10 ; 16 b596: 9f 01 movw r18, r30 b598: 25 5a subi r18, 0xA5 ; 165 b59a: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b59c: a1 91 ld r26, Z+ b59e: aa 23 and r26, r26 b5a0: d1 f3 breq .-12 ; 0xb596 b5a2: d0 cf rjmp .-96 ; 0xb544 } } return sdlen; } b5a4: 08 95 ret 0000b5a6 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b5a6: 98 2f mov r25, r24 b5a8: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b5aa: 83 ff sbrs r24, 3 b5ac: 0d c0 rjmp .+26 ; 0xb5c8 b5ae: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b5b2: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b5b4: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b5b8: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b5bc: 88 7f andi r24, 0xF8 ; 248 b5be: 97 70 andi r25, 0x07 ; 7 b5c0: 89 2b or r24, r25 b5c2: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b5c6: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b5c8: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b5cc: 87 7f andi r24, 0xF7 ; 247 b5ce: f2 cf rjmp .-28 ; 0xb5b4 0000b5d0 : 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)); }; b5d0: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b5d4: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b5d8: 4a e0 ldi r20, 0x0A ; 10 b5da: 50 e0 ldi r21, 0x00 ; 0 b5dc: 70 e0 ldi r23, 0x00 ; 0 b5de: 60 e0 ldi r22, 0x00 ; 0 b5e0: 01 96 adiw r24, 0x01 ; 1 b5e2: 0f 94 df d7 call 0x3afbe ; 0x3afbe b5e6: 86 2f mov r24, r22 b5e8: 08 95 ret 0000b5ea : // 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)); }; b5ea: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b5ee: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b5f2: 4a e0 ldi r20, 0x0A ; 10 b5f4: 50 e0 ldi r21, 0x00 ; 0 b5f6: 70 e0 ldi r23, 0x00 ; 0 b5f8: 60 e0 ldi r22, 0x00 ; 0 b5fa: 01 96 adiw r24, 0x01 ; 1 b5fc: 0f 94 df d7 call 0x3afbe ; 0x3afbe b600: cb 01 movw r24, r22 b602: 08 95 ret 0000b604 : // 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); } b604: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b608: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b60c: 4a e0 ldi r20, 0x0A ; 10 b60e: 50 e0 ldi r21, 0x00 ; 0 b610: 70 e0 ldi r23, 0x00 ; 0 b612: 60 e0 ldi r22, 0x00 ; 0 b614: 01 96 adiw r24, 0x01 ; 1 b616: 0d 94 df d7 jmp 0x3afbe ; 0x3afbe 0000b61a : // 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; b61a: 80 91 9b 04 lds r24, 0x049B ; 0x80049b b61e: 90 91 9c 04 lds r25, 0x049C ; 0x80049c b622: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a b626: 80 93 99 04 sts 0x0499, r24 ; 0x800499 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); b62a: 87 e1 ldi r24, 0x17 ; 23 b62c: 9d e6 ldi r25, 0x6D ; 109 b62e: 9f 93 push r25 b630: 8f 93 push r24 b632: 80 91 7a 03 lds r24, 0x037A ; 0x80037a b636: 90 91 7b 03 lds r25, 0x037B ; 0x80037b b63a: a0 91 7c 03 lds r26, 0x037C ; 0x80037c b63e: b0 91 7d 03 lds r27, 0x037D ; 0x80037d b642: 01 96 adiw r24, 0x01 ; 1 b644: a1 1d adc r26, r1 b646: b1 1d adc r27, r1 b648: bf 93 push r27 b64a: af 93 push r26 b64c: 9f 93 push r25 b64e: 8f 93 push r24 b650: 85 ea ldi r24, 0xA5 ; 165 b652: 95 e6 ldi r25, 0x65 ; 101 b654: 9f 93 push r25 b656: 8f 93 push r24 b658: 8c ea ldi r24, 0xAC ; 172 b65a: 95 e6 ldi r25, 0x65 ; 101 b65c: 9f 93 push r25 b65e: 8f 93 push r24 b660: 0f 94 16 db call 0x3b62c ; 0x3b62c b664: 8d b7 in r24, 0x3d ; 61 b666: 9e b7 in r25, 0x3e ; 62 b668: 0a 96 adiw r24, 0x0a ; 10 b66a: 0f b6 in r0, 0x3f ; 63 b66c: f8 94 cli b66e: 9e bf out 0x3e, r25 ; 62 b670: 0f be out 0x3f, r0 ; 63 b672: 8d bf out 0x3d, r24 ; 61 } b674: 08 95 ret 0000b676 : 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) { b676: 0f 93 push r16 b678: 1f 93 push r17 b67a: cf 93 push r28 b67c: df 93 push r29 b67e: ec 01 movw r28, r24 b680: c6 0f add r28, r22 b682: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b684: 8c 17 cp r24, r28 b686: 9d 07 cpc r25, r29 b688: 79 f0 breq .+30 ; 0xb6a8 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b68a: 8c 01 movw r16, r24 b68c: 0f 5f subi r16, 0xFF ; 255 b68e: 1f 4f sbci r17, 0xFF ; 255 b690: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 b694: 8f 3f cpi r24, 0xFF ; 255 b696: 31 f0 breq .+12 ; 0xb6a4 return true; b698: 81 e0 ldi r24, 0x01 ; 1 } return false; } b69a: df 91 pop r29 b69c: cf 91 pop r28 b69e: 1f 91 pop r17 b6a0: 0f 91 pop r16 b6a2: 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) b6a4: c8 01 movw r24, r16 b6a6: ee cf rjmp .-36 ; 0xb684 return true; } return false; b6a8: 80 e0 ldi r24, 0x00 ; 0 b6aa: f7 cf rjmp .-18 ; 0xb69a 0000b6ac : #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; } b6ac: 68 2f mov r22, r24 b6ae: 88 0f add r24, r24 b6b0: 77 0b sbc r23, r23 b6b2: 80 91 92 12 lds r24, 0x1292 ; 0x801292 b6b6: 90 91 93 12 lds r25, 0x1293 ; 0x801293 b6ba: 88 55 subi r24, 0x58 ; 88 b6bc: 9f 4e sbci r25, 0xEF ; 239 b6be: 0f 94 ab e2 call 0x3c556 ; 0x3c556 b6c2: 9c 01 movw r18, r24 b6c4: 90 93 96 03 sts 0x0396, r25 ; 0x800396 b6c8: 80 93 95 03 sts 0x0395, r24 ; 0x800395 b6cc: 81 e0 ldi r24, 0x01 ; 1 b6ce: 23 2b or r18, r19 b6d0: 09 f4 brne .+2 ; 0xb6d4 b6d2: 80 e0 ldi r24, 0x00 ; 0 b6d4: 08 95 ret 0000b6d6 : #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 { b6d6: 0f 93 push r16 b6d8: 1f 93 push r17 b6da: cf 93 push r28 b6dc: df 93 push r29 b6de: 8c 01 movw r16, r24 b6e0: 86 2f mov r24, r22 b6e2: ea 01 movw r28, r20 if (code_seen(code)) { b6e4: 0e 94 56 5b call 0xb6ac ; 0xb6ac b6e8: 88 23 and r24, r24 b6ea: 19 f1 breq .+70 ; 0xb732 // Verify value is within allowed range int16_t temp = code_value_short(); b6ec: 0e 94 f5 5a call 0xb5ea ; 0xb5ea if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { b6f0: 9c 01 movw r18, r24 b6f2: 97 ff sbrs r25, 7 b6f4: 03 c0 rjmp .+6 ; 0xb6fc b6f6: 31 95 neg r19 b6f8: 21 95 neg r18 b6fa: 31 09 sbc r19, r1 b6fc: 25 36 cpi r18, 0x65 ; 101 b6fe: 31 05 cpc r19, r1 b700: 9c f0 brlt .+38 ; 0xb728 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); b702: 9f 93 push r25 b704: 8f 93 push r24 b706: 8a e9 ldi r24, 0x9A ; 154 b708: 9a ea ldi r25, 0xAA ; 170 b70a: 9f 93 push r25 b70c: 8f 93 push r24 b70e: 83 eb ldi r24, 0xB3 ; 179 b710: 9b e7 ldi r25, 0x7B ; 123 b712: 9f 93 push r25 b714: 8f 93 push r24 b716: 0f 94 16 db call 0x3b62c ; 0x3b62c b71a: 0f 90 pop r0 b71c: 0f 90 pop r0 b71e: 0f 90 pop r0 b720: 0f 90 pop r0 b722: 0f 90 pop r0 b724: 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; b726: 80 e0 ldi r24, 0x00 ; 0 }; b728: df 91 pop r29 b72a: cf 91 pop r28 b72c: 1f 91 pop r17 b72e: 0f 91 pop r16 b730: 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) { b732: f8 01 movw r30, r16 b734: 80 81 ld r24, Z b736: 88 23 and r24, r24 b738: b1 f3 breq .-20 ; 0xb726 return (int8_t)eeprom_read_byte(eep_address); b73a: ce 01 movw r24, r28 } return 0; }; b73c: df 91 pop r29 b73e: cf 91 pop r28 b740: 1f 91 pop r17 b742: 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); b744: 0d 94 54 dc jmp 0x3b8a8 ; 0x3b8a8 0000b748 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); b748: 60 e0 ldi r22, 0x00 ; 0 b74a: 86 e6 ldi r24, 0x66 ; 102 b74c: 9f e0 ldi r25, 0x0F ; 15 b74e: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 b752: 60 e0 ldi r22, 0x00 ; 0 b754: 88 e6 ldi r24, 0x68 ; 104 b756: 9f e0 ldi r25, 0x0F ; 15 b758: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 b75c: 60 e0 ldi r22, 0x00 ; 0 b75e: 85 e6 ldi r24, 0x65 ; 101 b760: 9f e0 ldi r25, 0x0F ; 15 b762: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 b766: 60 e0 ldi r22, 0x00 ; 0 b768: 84 e6 ldi r24, 0x64 ; 100 b76a: 9f e0 ldi r25, 0x0F ; 15 b76c: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 b770: 60 e0 ldi r22, 0x00 ; 0 b772: 82 ed ldi r24, 0xD2 ; 210 b774: 9e e0 ldi r25, 0x0E ; 14 b776: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 b77a: 60 e0 ldi r22, 0x00 ; 0 b77c: 8f ec ldi r24, 0xCF ; 207 b77e: 9e e0 ldi r25, 0x0E ; 14 b780: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0000b784 : // 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) b784: 80 36 cpi r24, 0x60 ; 96 b786: 91 05 cpc r25, r1 b788: f8 f4 brcc .+62 ; 0xb7c8 return false; if (bufindr == bufindw && buflen > 0) b78a: 40 91 92 12 lds r20, 0x1292 ; 0x801292 b78e: 50 91 93 12 lds r21, 0x1293 ; 0x801293 b792: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> b796: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> b79a: 42 17 cp r20, r18 b79c: 53 07 cpc r21, r19 b79e: 39 f4 brne .+14 ; 0xb7ae b7a0: 60 91 a3 10 lds r22, 0x10A3 ; 0x8010a3 b7a4: 70 91 a4 10 lds r23, 0x10A4 ; 0x8010a4 b7a8: 16 16 cp r1, r22 b7aa: 17 06 cpc r1, r23 b7ac: 6c f0 brlt .+26 ; 0xb7c8 // 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); b7ae: b9 01 movw r22, r18 b7b0: 68 0f add r22, r24 b7b2: 79 1f adc r23, r25 b7b4: fb 01 movw r30, r22 b7b6: e3 59 subi r30, 0x93 ; 147 b7b8: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) b7ba: 24 17 cp r18, r20 b7bc: 35 07 cpc r19, r21 b7be: 30 f4 brcc .+12 ; 0xb7cc // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; b7c0: 81 e0 ldi r24, 0x01 ; 1 b7c2: 4e 17 cp r20, r30 b7c4: 5f 07 cpc r21, r31 b7c6: 08 f4 brcc .+2 ; 0xb7ca // 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; b7c8: 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; } b7ca: 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? b7cc: ee 3e cpi r30, 0xEE ; 238 b7ce: f1 40 sbci r31, 0x01 ; 1 b7d0: f8 f0 brcs .+62 ; 0xb810 // 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); b7d2: 6c 5f subi r22, 0xFC ; 252 b7d4: 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) || b7d6: 6e 3e cpi r22, 0xEE ; 238 b7d8: 71 40 sbci r23, 0x01 ; 1 b7da: 18 f4 brcc .+6 ; 0xb7e2 // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) b7dc: 49 36 cpi r20, 0x69 ; 105 b7de: 51 05 cpc r21, r1 b7e0: b8 f4 brcc .+46 ; 0xb810 return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { b7e2: 83 59 subi r24, 0x93 ; 147 b7e4: 9f 4f sbci r25, 0xFF ; 255 b7e6: 48 17 cp r20, r24 b7e8: 59 07 cpc r21, r25 b7ea: 70 f3 brcs .-36 ; 0xb7c8 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); b7ec: 4d ee ldi r20, 0xED ; 237 b7ee: 51 e0 ldi r21, 0x01 ; 1 b7f0: 42 1b sub r20, r18 b7f2: 53 0b sbc r21, r19 b7f4: 70 e0 ldi r23, 0x00 ; 0 b7f6: 60 e0 ldi r22, 0x00 ; 0 b7f8: c9 01 movw r24, r18 b7fa: 8b 55 subi r24, 0x5B ; 91 b7fc: 9f 4e sbci r25, 0xEF ; 239 b7fe: 0f 94 86 e2 call 0x3c50c ; 0x3c50c // 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; } b802: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); b804: f8 94 cli b806: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> b80a: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; b80e: 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; b810: 81 e0 ldi r24, 0x01 ; 1 b812: 08 95 ret 0000b814 : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { b814: 2f 92 push r2 b816: 3f 92 push r3 b818: 4f 92 push r4 b81a: 5f 92 push r5 b81c: 6f 92 push r6 b81e: 7f 92 push r7 b820: 8f 92 push r8 b822: 9f 92 push r9 b824: af 92 push r10 b826: bf 92 push r11 b828: cf 92 push r12 b82a: df 92 push r13 b82c: ef 92 push r14 b82e: ff 92 push r15 b830: 0f 93 push r16 b832: 1f 93 push r17 b834: cf 93 push r28 b836: df 93 push r29 b838: cd b7 in r28, 0x3d ; 61 b83a: de b7 in r29, 0x3e ; 62 b83c: cc 58 subi r28, 0x8C ; 140 b83e: d2 40 sbci r29, 0x02 ; 2 b840: 0f b6 in r0, 0x3f ; 63 b842: f8 94 cli b844: de bf out 0x3e, r29 ; 62 b846: 0f be out 0x3f, r0 ; 63 b848: cd bf out 0x3d, r28 ; 61 b84a: cb 58 subi r28, 0x8B ; 139 b84c: dd 4f sbci r29, 0xFD ; 253 b84e: 68 83 st Y, r22 b850: 79 83 std Y+1, r23 ; 0x01 b852: 8a 83 std Y+2, r24 ; 0x02 b854: 9b 83 std Y+3, r25 ; 0x03 b856: c5 57 subi r28, 0x75 ; 117 b858: 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; b85a: fe 01 movw r30, r28 b85c: e7 54 subi r30, 0x47 ; 71 b85e: fe 4f sbci r31, 0xFE ; 254 b860: 88 e2 ldi r24, 0x28 ; 40 b862: df 01 movw r26, r30 b864: 1d 92 st X+, r1 b866: 8a 95 dec r24 b868: e9 f7 brne .-6 ; 0xb864 b86a: e8 5b subi r30, 0xB8 ; 184 b86c: f1 40 sbci r31, 0x01 ; 1 b86e: 1f 01 movw r2, r30 b870: 80 e9 ldi r24, 0x90 ; 144 b872: 91 e0 ldi r25, 0x01 ; 1 b874: df 01 movw r26, r30 b876: fc 01 movw r30, r24 b878: 1d 92 st X+, r1 b87a: 31 97 sbiw r30, 0x01 ; 1 b87c: e9 f7 brne .-6 ; 0xb878 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; b87e: c7 5a subi r28, 0xA7 ; 167 b880: dd 4f sbci r29, 0xFD ; 253 b882: 19 82 std Y+1, r1 ; 0x01 b884: 18 82 st Y, r1 b886: c9 55 subi r28, 0x59 ; 89 b888: d2 40 sbci r29, 0x02 ; 2 b88a: 9e 01 movw r18, r28 b88c: 2f 51 subi r18, 0x1F ; 31 b88e: 3e 4f sbci r19, 0xFE ; 254 b890: c1 59 subi r28, 0x91 ; 145 b892: dd 4f sbci r29, 0xFD ; 253 b894: 39 83 std Y+1, r19 ; 0x01 b896: 28 83 st Y, r18 b898: cf 56 subi r28, 0x6F ; 111 b89a: d2 40 sbci r29, 0x02 ; 2 b89c: 8e 01 movw r16, r28 b89e: 07 5a subi r16, 0xA7 ; 167 b8a0: 1d 4f sbci r17, 0xFD ; 253 b8a2: ce 01 movw r24, r28 b8a4: 8f 5c subi r24, 0xCF ; 207 b8a6: 9d 4f sbci r25, 0xFD ; 253 b8a8: c3 59 subi r28, 0x93 ; 147 b8aa: dd 4f sbci r29, 0xFD ; 253 b8ac: 99 83 std Y+1, r25 ; 0x01 b8ae: 88 83 st Y, r24 b8b0: cd 56 subi r28, 0x6D ; 109 b8b2: d2 40 sbci r29, 0x02 ; 2 b8b4: 3c 01 movw r6, r24 b8b6: 49 01 movw r8, r18 b8b8: 40 eb ldi r20, 0xB0 ; 176 b8ba: a4 2e mov r10, r20 b8bc: 4f e0 ldi r20, 0x0F ; 15 b8be: b4 2e mov r11, r20 b8c0: 53 e2 ldi r21, 0x23 ; 35 b8c2: c5 2e mov r12, r21 b8c4: d1 2c mov r13, r1 for (i = 0; i < n; i++) { b8c6: f1 2c mov r15, r1 b8c8: 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]; b8ca: b6 01 movw r22, r12 b8cc: 0d 2c mov r0, r13 b8ce: 00 0c add r0, r0 b8d0: 88 0b sbc r24, r24 b8d2: 99 0b sbc r25, r25 b8d4: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> b8d8: d4 01 movw r26, r8 b8da: 6d 93 st X+, r22 b8dc: 7d 93 st X+, r23 b8de: 8d 93 st X+, r24 b8e0: 9d 93 st X+, r25 b8e2: 4d 01 movw r8, r26 f[i] = (float)shift[i]; b8e4: f8 01 movw r30, r16 b8e6: 61 91 ld r22, Z+ b8e8: 71 91 ld r23, Z+ b8ea: 8f 01 movw r16, r30 b8ec: 07 2e mov r0, r23 b8ee: 00 0c add r0, r0 b8f0: 88 0b sbc r24, r24 b8f2: 99 0b sbc r25, r25 b8f4: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> b8f8: d3 01 movw r26, r6 b8fa: 6d 93 st X+, r22 b8fc: 7d 93 st X+, r23 b8fe: 8d 93 st X+, r24 b900: 9d 93 st X+, r25 b902: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { b904: bf ef ldi r27, 0xFF ; 255 b906: eb 1a sub r14, r27 b908: fb 0a sbc r15, r27 b90a: e6 e0 ldi r30, 0x06 ; 6 b90c: ee 16 cp r14, r30 b90e: f1 04 cpc r15, r1 b910: 09 f0 breq .+2 ; 0xb914 b912: 38 c3 rjmp .+1648 ; 0xbf84 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; b914: cb 58 subi r28, 0x8B ; 139 b916: dd 4f sbci r29, 0xFD ; 253 b918: 28 81 ld r18, Y b91a: 39 81 ldd r19, Y+1 ; 0x01 b91c: 4a 81 ldd r20, Y+2 ; 0x02 b91e: 5b 81 ldd r21, Y+3 ; 0x03 b920: c5 57 subi r28, 0x75 ; 117 b922: d2 40 sbci r29, 0x02 ; 2 b924: c1 59 subi r28, 0x91 ; 145 b926: dd 4f sbci r29, 0xFD ; 253 b928: a8 81 ld r26, Y b92a: b9 81 ldd r27, Y+1 ; 0x01 b92c: cf 56 subi r28, 0x6F ; 111 b92e: d2 40 sbci r29, 0x02 ; 2 b930: 6d 91 ld r22, X+ b932: 7d 91 ld r23, X+ b934: 8d 91 ld r24, X+ b936: 9c 91 ld r25, X b938: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> b93c: 41 2c mov r4, r1 b93e: 51 2c mov r5, r1 b940: 32 01 movw r6, r4 b942: 18 16 cp r1, r24 b944: 0c f4 brge .+2 ; 0xb948 b946: 02 c3 rjmp .+1540 ; 0xbf4c b948: c3 59 subi r28, 0x93 ; 147 b94a: dd 4f sbci r29, 0xFD ; 253 b94c: 08 81 ld r16, Y b94e: 19 81 ldd r17, Y+1 ; 0x01 b950: cd 56 subi r28, 0x6D ; 109 b952: d2 40 sbci r29, 0x02 ; 2 b954: 0c 5e subi r16, 0xEC ; 236 b956: 1f 4f sbci r17, 0xFF ; 255 b958: c1 59 subi r28, 0x91 ; 145 b95a: dd 4f sbci r29, 0xFD ; 253 b95c: e8 80 ld r14, Y b95e: f9 80 ldd r15, Y+1 ; 0x01 b960: cf 56 subi r28, 0x6F ; 111 b962: d2 40 sbci r29, 0x02 ; 2 b964: b4 e1 ldi r27, 0x14 ; 20 b966: eb 0e add r14, r27 b968: f1 1c adc r15, r1 b96a: 6e 01 movw r12, r28 b96c: ef ed ldi r30, 0xDF ; 223 b96e: ce 1a sub r12, r30 b970: ed ef ldi r30, 0xFD ; 253 b972: de 0a sbc r13, r30 b974: 9e 01 movw r18, r28 b976: 2b 55 subi r18, 0x5B ; 91 b978: 3e 4f sbci r19, 0xFE ; 254 b97a: cf 58 subi r28, 0x8F ; 143 b97c: dd 4f sbci r29, 0xFD ; 253 b97e: 39 83 std Y+1, r19 ; 0x01 b980: 28 83 st Y, r18 b982: c1 57 subi r28, 0x71 ; 113 b984: 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]); b986: d8 01 movw r26, r16 b988: 4d 90 ld r4, X+ b98a: 5d 90 ld r5, X+ b98c: 6d 90 ld r6, X+ b98e: 7c 90 ld r7, X b990: f7 01 movw r30, r14 b992: 60 81 ld r22, Z b994: 71 81 ldd r23, Z+1 ; 0x01 b996: 82 81 ldd r24, Z+2 ; 0x02 b998: 93 81 ldd r25, Z+3 ; 0x03 b99a: d7 01 movw r26, r14 b99c: 5e 91 ld r21, -X b99e: 4e 91 ld r20, -X b9a0: 3e 91 ld r19, -X b9a2: 2e 91 ld r18, -X b9a4: 7d 01 movw r14, r26 b9a6: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> b9aa: 4b 01 movw r8, r22 b9ac: 5c 01 movw r10, r24 b9ae: f8 01 movw r30, r16 b9b0: 52 91 ld r21, -Z b9b2: 42 91 ld r20, -Z b9b4: 32 91 ld r19, -Z b9b6: 22 91 ld r18, -Z b9b8: 8f 01 movw r16, r30 b9ba: c3 01 movw r24, r6 b9bc: b2 01 movw r22, r4 b9be: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> b9c2: a5 01 movw r20, r10 b9c4: 94 01 movw r18, r8 b9c6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> b9ca: d6 01 movw r26, r12 b9cc: 9e 93 st -X, r25 b9ce: 8e 93 st -X, r24 b9d0: 7e 93 st -X, r23 b9d2: 6e 93 st -X, r22 b9d4: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; b9d6: cf 58 subi r28, 0x8F ; 143 b9d8: dd 4f sbci r29, 0xFD ; 253 b9da: e8 81 ld r30, Y b9dc: f9 81 ldd r31, Y+1 ; 0x01 b9de: c1 57 subi r28, 0x71 ; 113 b9e0: d2 40 sbci r29, 0x02 ; 2 b9e2: b2 92 st -Z, r11 b9e4: a2 92 st -Z, r10 b9e6: 92 92 st -Z, r9 b9e8: 82 92 st -Z, r8 b9ea: cf 58 subi r28, 0x8F ; 143 b9ec: dd 4f sbci r29, 0xFD ; 253 b9ee: f9 83 std Y+1, r31 ; 0x01 b9f0: e8 83 st Y, r30 b9f2: c1 57 subi r28, 0x71 ; 113 b9f4: 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--) { b9f6: c3 59 subi r28, 0x93 ; 147 b9f8: dd 4f sbci r29, 0xFD ; 253 b9fa: 28 81 ld r18, Y b9fc: 39 81 ldd r19, Y+1 ; 0x01 b9fe: cd 56 subi r28, 0x6D ; 109 ba00: d2 40 sbci r29, 0x02 ; 2 ba02: 02 17 cp r16, r18 ba04: 13 07 cpc r17, r19 ba06: 09 f0 breq .+2 ; 0xba0a ba08: be cf rjmp .-132 ; 0xb986 ba0a: 4e 01 movw r8, r28 ba0c: 3f e6 ldi r19, 0x6F ; 111 ba0e: 83 1a sub r8, r19 ba10: 3e ef ldi r19, 0xFE ; 254 ba12: 93 0a sbc r9, r19 ba14: 5e 01 movw r10, r28 ba16: 83 ef ldi r24, 0xF3 ; 243 ba18: a8 1a sub r10, r24 ba1a: 8d ef ldi r24, 0xFD ; 253 ba1c: b8 0a sbc r11, r24 ba1e: 61 01 movw r12, r2 ba20: 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 ba44: 9b 01 movw r18, r22 ba46: ac 01 movw r20, r24 ba48: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> ba4c: f8 01 movw r30, r16 ba4e: 64 a7 std Z+44, r22 ; 0x2c ba50: 75 a7 std Z+45, r23 ; 0x2d ba52: 86 a7 std Z+46, r24 ; 0x2e ba54: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { ba56: f1 e0 ldi r31, 0x01 ; 1 ba58: ef 16 cp r14, r31 ba5a: f1 04 cpc r15, r1 ba5c: 61 f0 breq .+24 ; 0xba76 m[i][i - 1] = h[i - 1]; ba5e: d8 01 movw r26, r16 ba60: 98 96 adiw r26, 0x28 ; 40 ba62: 4d 92 st X+, r4 ba64: 5d 92 st X+, r5 ba66: 6d 92 st X+, r6 ba68: 7c 92 st X, r7 ba6a: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; ba6c: f8 01 movw r30, r16 ba6e: 44 82 std Z+4, r4 ; 0x04 ba70: 55 82 std Z+5, r5 ; 0x05 ba72: 66 82 std Z+6, r6 ; 0x06 ba74: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); ba76: ff ef ldi r31, 0xFF ; 255 ba78: ef 1a sub r14, r31 ba7a: ff 0a sbc r15, r31 ba7c: f5 01 movw r30, r10 ba7e: 20 81 ld r18, Z ba80: 31 81 ldd r19, Z+1 ; 0x01 ba82: 42 81 ldd r20, Z+2 ; 0x02 ba84: 53 81 ldd r21, Z+3 ; 0x03 ba86: 84 e0 ldi r24, 0x04 ; 4 ba88: a8 0e add r10, r24 ba8a: b1 1c adc r11, r1 ba8c: 64 81 ldd r22, Z+4 ; 0x04 ba8e: 75 81 ldd r23, Z+5 ; 0x05 ba90: 86 81 ldd r24, Z+6 ; 0x06 ba92: 97 81 ldd r25, Z+7 ; 0x07 ba94: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> ba98: 20 e0 ldi r18, 0x00 ; 0 ba9a: 30 e0 ldi r19, 0x00 ; 0 ba9c: 40 ec ldi r20, 0xC0 ; 192 ba9e: 50 e4 ldi r21, 0x40 ; 64 baa0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> baa4: d6 01 movw r26, r12 baa6: dc 96 adiw r26, 0x3c ; 60 baa8: 6d 93 st X+, r22 baaa: 7d 93 st X+, r23 baac: 8d 93 st X+, r24 baae: 9c 93 st X, r25 bab0: df 97 sbiw r26, 0x3f ; 63 bab2: 04 5d subi r16, 0xD4 ; 212 bab4: 1f 4f sbci r17, 0xFF ; 255 bab6: b8 e2 ldi r27, 0x28 ; 40 bab8: cb 0e add r12, r27 baba: 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 bac4: b1 cf rjmp .-158 ; 0xba28 bac6: 7e 01 movw r14, r28 bac8: fd e2 ldi r31, 0x2D ; 45 baca: ef 0e add r14, r31 bacc: f1 1c adc r15, r1 bace: 28 e2 ldi r18, 0x28 ; 40 bad0: a2 2e mov r10, r18 bad2: b1 2c mov r11, r1 bad4: 00 eb ldi r16, 0xB0 ; 176 bad6: 1f ef ldi r17, 0xFF ; 255 bad8: 24 e0 ldi r18, 0x04 ; 4 bada: 22 0e add r2, r18 badc: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bafa: 2b 01 movw r4, r22 bafc: 3c 01 movw r6, r24 bafe: 61 01 movw r12, r2 bb00: c0 1a sub r12, r16 bb02: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) bb04: 88 24 eor r8, r8 bb06: 83 94 inc r8 bb08: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; bb0a: f6 01 movw r30, r12 bb0c: e0 0f add r30, r16 bb0e: f1 1f adc r31, r17 bb10: ea 0d add r30, r10 bb12: fb 1d adc r31, r11 bb14: 20 81 ld r18, Z bb16: 31 81 ldd r19, Z+1 ; 0x01 bb18: 42 81 ldd r20, Z+2 ; 0x02 bb1a: 53 81 ldd r21, Z+3 ; 0x03 bb1c: c3 01 movw r24, r6 bb1e: b2 01 movw r22, r4 bb20: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> bb24: 9b 01 movw r18, r22 bb26: ac 01 movw r20, r24 bb28: f6 01 movw r30, r12 bb2a: 60 81 ld r22, Z bb2c: 71 81 ldd r23, Z+1 ; 0x01 bb2e: 82 81 ldd r24, Z+2 ; 0x02 bb30: 93 81 ldd r25, Z+3 ; 0x03 bb32: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> bb36: d6 01 movw r26, r12 bb38: 6d 93 st X+, r22 bb3a: 7d 93 st X+, r23 bb3c: 8d 93 st X+, r24 bb3e: 9d 93 st X+, r25 bb40: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bb50: 3c e2 ldi r19, 0x2C ; 44 bb52: e3 0e add r14, r19 bb54: f1 1c adc r15, r1 bb56: 08 52 subi r16, 0x28 ; 40 bb58: 11 09 sbc r17, r1 bb5a: 88 e2 ldi r24, 0x28 ; 40 bb5c: a8 0e add r10, r24 bb5e: 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 bb68: ba cf rjmp .-140 ; 0xbade bb6a: 1e 01 movw r2, r28 bb6c: f5 eb ldi r31, 0xB5 ; 181 bb6e: 2f 0e add r2, r31 bb70: 31 1c adc r3, r1 bb72: 6e 01 movw r12, r28 bb74: 21 eb ldi r18, 0xB1 ; 177 bb76: c2 0e add r12, r18 bb78: d1 1c adc r13, r1 bb7a: 7e 01 movw r14, r28 bb7c: 37 e3 ldi r19, 0x37 ; 55 bb7e: e3 1a sub r14, r19 bb80: 3e ef ldi r19, 0xFE ; 254 bb82: 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--) { bb84: 04 e0 ldi r16, 0x04 ; 4 bb86: 10 e0 ldi r17, 0x00 ; 0 bb88: 48 01 movw r8, r16 bb8a: b1 2c mov r11, r1 bb8c: a1 2c mov r10, r1 sum = 0; bb8e: 41 2c mov r4, r1 bb90: 51 2c mov r5, r1 bb92: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; bb94: f6 01 movw r30, r12 bb96: ea 0d add r30, r10 bb98: fb 1d adc r31, r11 bb9a: d7 01 movw r26, r14 bb9c: aa 0d add r26, r10 bb9e: bb 1d adc r27, r11 bba0: 2d 91 ld r18, X+ bba2: 3d 91 ld r19, X+ bba4: 4d 91 ld r20, X+ bba6: 5c 91 ld r21, X bba8: 60 81 ld r22, Z bbaa: 71 81 ldd r23, Z+1 ; 0x01 bbac: 82 81 ldd r24, Z+2 ; 0x02 bbae: 93 81 ldd r25, Z+3 ; 0x03 bbb0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> bbb4: 9b 01 movw r18, r22 bbb6: ac 01 movw r20, r24 bbb8: c3 01 movw r24, r6 bbba: b2 01 movw r22, r4 bbbc: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> bbc0: 2b 01 movw r4, r22 bbc2: 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++) bbc4: 8f ef ldi r24, 0xFF ; 255 bbc6: 88 1a sub r8, r24 bbc8: 98 0a sbc r9, r24 bbca: 94 e0 ldi r25, 0x04 ; 4 bbcc: a9 0e add r10, r25 bbce: b1 1c adc r11, r1 bbd0: a5 e0 ldi r26, 0x05 ; 5 bbd2: 8a 16 cp r8, r26 bbd4: 91 04 cpc r9, r1 bbd6: f1 f6 brne .-68 ; 0xbb94 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; bbd8: a3 01 movw r20, r6 bbda: 92 01 movw r18, r4 bbdc: f1 01 movw r30, r2 bbde: 60 81 ld r22, Z bbe0: 71 81 ldd r23, Z+1 ; 0x01 bbe2: 82 81 ldd r24, Z+2 ; 0x02 bbe4: 93 81 ldd r25, Z+3 ; 0x03 bbe6: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> bbea: d6 01 movw r26, r12 bbec: 2d 91 ld r18, X+ bbee: 3d 91 ld r19, X+ bbf0: 4d 91 ld r20, X+ bbf2: 5c 91 ld r21, X bbf4: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> bbf8: f7 01 movw r30, r14 bbfa: 60 83 st Z, r22 bbfc: 71 83 std Z+1, r23 ; 0x01 bbfe: 82 83 std Z+2, r24 ; 0x02 bc00: 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--) { bc02: 01 50 subi r16, 0x01 ; 1 bc04: 11 09 sbc r17, r1 bc06: f8 e2 ldi r31, 0x28 ; 40 bc08: 2f 1a sub r2, r31 bc0a: 31 08 sbc r3, r1 bc0c: 2c e2 ldi r18, 0x2C ; 44 bc0e: c2 1a sub r12, r18 bc10: d1 08 sbc r13, r1 bc12: 34 e0 ldi r19, 0x04 ; 4 bc14: e3 1a sub r14, r19 bc16: f1 08 sbc r15, r1 bc18: 01 15 cp r16, r1 bc1a: 11 05 cpc r17, r1 bc1c: 09 f0 breq .+2 ; 0xbc20 bc1e: b4 cf rjmp .-152 ; 0xbb88 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { bc20: cb 50 subi r28, 0x0B ; 11 bc22: de 4f sbci r29, 0xFE ; 254 bc24: 88 81 ld r24, Y bc26: 99 81 ldd r25, Y+1 ; 0x01 bc28: aa 81 ldd r26, Y+2 ; 0x02 bc2a: bb 81 ldd r27, Y+3 ; 0x03 bc2c: c5 5f subi r28, 0xF5 ; 245 bc2e: d1 40 sbci r29, 0x01 ; 1 bc30: cf 57 subi r28, 0x7F ; 127 bc32: dd 4f sbci r29, 0xFD ; 253 bc34: 88 83 st Y, r24 bc36: 99 83 std Y+1, r25 ; 0x01 bc38: aa 83 std Y+2, r26 ; 0x02 bc3a: bb 83 std Y+3, r27 ; 0x03 bc3c: c1 58 subi r28, 0x81 ; 129 bc3e: d2 40 sbci r29, 0x02 ; 2 bc40: 1e 01 movw r2, r28 bc42: 97 e4 ldi r25, 0x47 ; 71 bc44: 29 1a sub r2, r25 bc46: 9e ef ldi r25, 0xFE ; 254 bc48: 39 0a sbc r3, r25 bc4a: 10 e0 ldi r17, 0x00 ; 0 bc4c: 00 e0 ldi r16, 0x00 ; 0 bc4e: c1 59 subi r28, 0x91 ; 145 bc50: dd 4f sbci r29, 0xFD ; 253 bc52: a8 81 ld r26, Y bc54: b9 81 ldd r27, Y+1 ; 0x01 bc56: cf 56 subi r28, 0x6F ; 111 bc58: d2 40 sbci r29, 0x02 ; 2 bc5a: cd 90 ld r12, X+ bc5c: dd 90 ld r13, X+ bc5e: ed 90 ld r14, X+ bc60: fd 90 ld r15, X+ bc62: c1 59 subi r28, 0x91 ; 145 bc64: dd 4f sbci r29, 0xFD ; 253 bc66: b9 83 std Y+1, r27 ; 0x01 bc68: a8 83 st Y, r26 bc6a: cf 56 subi r28, 0x6F ; 111 bc6c: d2 40 sbci r29, 0x02 ; 2 bc6e: cb 58 subi r28, 0x8B ; 139 bc70: dd 4f sbci r29, 0xFD ; 253 bc72: 28 81 ld r18, Y bc74: 39 81 ldd r19, Y+1 ; 0x01 bc76: 4a 81 ldd r20, Y+2 ; 0x02 bc78: 5b 81 ldd r21, Y+3 ; 0x03 bc7a: c5 57 subi r28, 0x75 ; 117 bc7c: d2 40 sbci r29, 0x02 ; 2 bc7e: c7 01 movw r24, r14 bc80: b6 01 movw r22, r12 bc82: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> bc86: 18 16 cp r1, r24 bc88: b4 f0 brlt .+44 ; 0xbcb6 bc8a: cb 58 subi r28, 0x8B ; 139 bc8c: dd 4f sbci r29, 0xFD ; 253 bc8e: 28 81 ld r18, Y bc90: 39 81 ldd r19, Y+1 ; 0x01 bc92: 4a 81 ldd r20, Y+2 ; 0x02 bc94: 5b 81 ldd r21, Y+3 ; 0x03 bc96: c5 57 subi r28, 0x75 ; 117 bc98: d2 40 sbci r29, 0x02 ; 2 bc9a: c1 59 subi r28, 0x91 ; 145 bc9c: dd 4f sbci r29, 0xFD ; 253 bc9e: e8 81 ld r30, Y bca0: f9 81 ldd r31, Y+1 ; 0x01 bca2: cf 56 subi r28, 0x6F ; 111 bca4: d2 40 sbci r29, 0x02 ; 2 bca6: 60 81 ld r22, Z bca8: 71 81 ldd r23, Z+1 ; 0x01 bcaa: 82 81 ldd r24, Z+2 ; 0x02 bcac: 93 81 ldd r25, Z+3 ; 0x03 bcae: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> bcb2: 87 ff sbrs r24, 7 bcb4: 18 c0 rjmp .+48 ; 0xbce6 bcb6: 04 30 cpi r16, 0x04 ; 4 bcb8: 11 05 cpc r17, r1 bcba: 09 f0 breq .+2 ; 0xbcbe bcbc: 30 c1 rjmp .+608 ; 0xbf1e bcbe: cb 58 subi r28, 0x8B ; 139 bcc0: dd 4f sbci r29, 0xFD ; 253 bcc2: 28 81 ld r18, Y bcc4: 39 81 ldd r19, Y+1 ; 0x01 bcc6: 4a 81 ldd r20, Y+2 ; 0x02 bcc8: 5b 81 ldd r21, Y+3 ; 0x03 bcca: c5 57 subi r28, 0x75 ; 117 bccc: d2 40 sbci r29, 0x02 ; 2 bcce: cf 57 subi r28, 0x7F ; 127 bcd0: dd 4f sbci r29, 0xFD ; 253 bcd2: 68 81 ld r22, Y bcd4: 79 81 ldd r23, Y+1 ; 0x01 bcd6: 8a 81 ldd r24, Y+2 ; 0x02 bcd8: 9b 81 ldd r25, Y+3 ; 0x03 bcda: c1 58 subi r28, 0x81 ; 129 bcdc: d2 40 sbci r29, 0x02 ; 2 bcde: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> bce2: 87 ff sbrs r24, 7 bce4: 1c c1 rjmp .+568 ; 0xbf1e a = (s[i + 1] - s[i]) / (6 * h[i]); bce6: d1 01 movw r26, r2 bce8: 14 96 adiw r26, 0x04 ; 4 bcea: 8d 90 ld r8, X+ bcec: 9d 90 ld r9, X+ bcee: ad 90 ld r10, X+ bcf0: bc 90 ld r11, X bcf2: 17 97 sbiw r26, 0x07 ; 7 bcf4: 8d 91 ld r24, X+ bcf6: 9d 91 ld r25, X+ bcf8: 0d 90 ld r0, X+ bcfa: bc 91 ld r27, X bcfc: a0 2d mov r26, r0 bcfe: cf 58 subi r28, 0x8F ; 143 bd00: dd 4f sbci r29, 0xFD ; 253 bd02: 88 83 st Y, r24 bd04: 99 83 std Y+1, r25 ; 0x01 bd06: aa 83 std Y+2, r26 ; 0x02 bd08: bb 83 std Y+3, r27 ; 0x03 bd0a: c1 57 subi r28, 0x71 ; 113 bd0c: d2 40 sbci r29, 0x02 ; 2 bd0e: f8 01 movw r30, r16 bd10: ee 0f add r30, r30 bd12: ff 1f adc r31, r31 bd14: ee 0f add r30, r30 bd16: ff 1f adc r31, r31 bd18: 21 e9 ldi r18, 0x91 ; 145 bd1a: 31 e0 ldi r19, 0x01 ; 1 bd1c: 2c 0f add r18, r28 bd1e: 3d 1f adc r19, r29 bd20: e2 0f add r30, r18 bd22: f3 1f adc r31, r19 bd24: 40 80 ld r4, Z bd26: 51 80 ldd r5, Z+1 ; 0x01 bd28: 62 80 ldd r6, Z+2 ; 0x02 bd2a: 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; bd2c: c3 59 subi r28, 0x93 ; 147 bd2e: dd 4f sbci r29, 0xFD ; 253 bd30: a8 81 ld r26, Y bd32: b9 81 ldd r27, Y+1 ; 0x01 bd34: cd 56 subi r28, 0x6D ; 109 bd36: d2 40 sbci r29, 0x02 ; 2 bd38: 8d 91 ld r24, X+ bd3a: 9d 91 ld r25, X+ bd3c: 0d 90 ld r0, X+ bd3e: bc 91 ld r27, X bd40: a0 2d mov r26, r0 bd42: c3 58 subi r28, 0x83 ; 131 bd44: dd 4f sbci r29, 0xFD ; 253 bd46: 88 83 st Y, r24 bd48: 99 83 std Y+1, r25 ; 0x01 bd4a: aa 83 std Y+2, r26 ; 0x02 bd4c: bb 83 std Y+3, r27 ; 0x03 bd4e: cd 57 subi r28, 0x7D ; 125 bd50: 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; bd52: a7 01 movw r20, r14 bd54: 96 01 movw r18, r12 bd56: cb 58 subi r28, 0x8B ; 139 bd58: dd 4f sbci r29, 0xFD ; 253 bd5a: 68 81 ld r22, Y bd5c: 79 81 ldd r23, Y+1 ; 0x01 bd5e: 8a 81 ldd r24, Y+2 ; 0x02 bd60: 9b 81 ldd r25, Y+3 ; 0x03 bd62: c5 57 subi r28, 0x75 ; 117 bd64: d2 40 sbci r29, 0x02 ; 2 bd66: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> bd6a: 6b 01 movw r12, r22 bd6c: 7c 01 movw r14, r24 bd6e: 20 e0 ldi r18, 0x00 ; 0 bd70: 30 e0 ldi r19, 0x00 ; 0 bd72: 40 e4 ldi r20, 0x40 ; 64 bd74: 50 e4 ldi r21, 0x40 ; 64 bd76: 0f 94 ec e0 call 0x3c1d8 ; 0x3c1d8 bd7a: cb 57 subi r28, 0x7B ; 123 bd7c: dd 4f sbci r29, 0xFD ; 253 bd7e: 68 83 st Y, r22 bd80: 79 83 std Y+1, r23 ; 0x01 bd82: 8a 83 std Y+2, r24 ; 0x02 bd84: 9b 83 std Y+3, r25 ; 0x03 bd86: c5 58 subi r28, 0x85 ; 133 bd88: 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; bd8a: c3 58 subi r28, 0x83 ; 131 bd8c: dd 4f sbci r29, 0xFD ; 253 bd8e: 28 81 ld r18, Y bd90: 39 81 ldd r19, Y+1 ; 0x01 bd92: 4a 81 ldd r20, Y+2 ; 0x02 bd94: 5b 81 ldd r21, Y+3 ; 0x03 bd96: cd 57 subi r28, 0x7D ; 125 bd98: d2 40 sbci r29, 0x02 ; 2 bd9a: c3 59 subi r28, 0x93 ; 147 bd9c: dd 4f sbci r29, 0xFD ; 253 bd9e: e8 81 ld r30, Y bda0: f9 81 ldd r31, Y+1 ; 0x01 bda2: cd 56 subi r28, 0x6D ; 109 bda4: d2 40 sbci r29, 0x02 ; 2 bda6: 64 81 ldd r22, Z+4 ; 0x04 bda8: 75 81 ldd r23, Z+5 ; 0x05 bdaa: 86 81 ldd r24, Z+6 ; 0x06 bdac: 97 81 ldd r25, Z+7 ; 0x07 bdae: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> bdb2: a3 01 movw r20, r6 bdb4: 92 01 movw r18, r4 bdb6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> bdba: c7 58 subi r28, 0x87 ; 135 bdbc: dd 4f sbci r29, 0xFD ; 253 bdbe: 68 83 st Y, r22 bdc0: 79 83 std Y+1, r23 ; 0x01 bdc2: 8a 83 std Y+2, r24 ; 0x02 bdc4: 9b 83 std Y+3, r25 ; 0x03 bdc6: c9 57 subi r28, 0x79 ; 121 bdc8: d2 40 sbci r29, 0x02 ; 2 bdca: a3 01 movw r20, r6 bdcc: 92 01 movw r18, r4 bdce: c3 01 movw r24, r6 bdd0: b2 01 movw r22, r4 bdd2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> bdd6: cf 58 subi r28, 0x8F ; 143 bdd8: dd 4f sbci r29, 0xFD ; 253 bdda: 28 81 ld r18, Y bddc: 39 81 ldd r19, Y+1 ; 0x01 bdde: 4a 81 ldd r20, Y+2 ; 0x02 bde0: 5b 81 ldd r21, Y+3 ; 0x03 bde2: c1 57 subi r28, 0x71 ; 113 bde4: d2 40 sbci r29, 0x02 ; 2 bde6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> bdea: c7 57 subi r28, 0x77 ; 119 bdec: dd 4f sbci r29, 0xFD ; 253 bdee: 68 83 st Y, r22 bdf0: 79 83 std Y+1, r23 ; 0x01 bdf2: 8a 83 std Y+2, r24 ; 0x02 bdf4: 9b 83 std Y+3, r25 ; 0x03 bdf6: c9 58 subi r28, 0x89 ; 137 bdf8: d2 40 sbci r29, 0x02 ; 2 bdfa: a3 01 movw r20, r6 bdfc: 92 01 movw r18, r4 bdfe: c5 01 movw r24, r10 be00: b4 01 movw r22, r8 be02: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> be06: 9b 01 movw r18, r22 be08: ac 01 movw r20, r24 be0a: c7 57 subi r28, 0x77 ; 119 be0c: dd 4f sbci r29, 0xFD ; 253 be0e: 68 81 ld r22, Y be10: 79 81 ldd r23, Y+1 ; 0x01 be12: 8a 81 ldd r24, Y+2 ; 0x02 be14: 9b 81 ldd r25, Y+3 ; 0x03 be16: c9 58 subi r28, 0x89 ; 137 be18: d2 40 sbci r29, 0x02 ; 2 be1a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> be1e: 20 e0 ldi r18, 0x00 ; 0 be20: 30 e0 ldi r19, 0x00 ; 0 be22: 40 ec ldi r20, 0xC0 ; 192 be24: 50 e4 ldi r21, 0x40 ; 64 be26: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> be2a: 9b 01 movw r18, r22 be2c: ac 01 movw r20, r24 be2e: c7 58 subi r28, 0x87 ; 135 be30: dd 4f sbci r29, 0xFD ; 253 be32: 68 81 ld r22, Y be34: 79 81 ldd r23, Y+1 ; 0x01 be36: 8a 81 ldd r24, Y+2 ; 0x02 be38: 9b 81 ldd r25, Y+3 ; 0x03 be3a: c9 57 subi r28, 0x79 ; 121 be3c: d2 40 sbci r29, 0x02 ; 2 be3e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__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; be42: a7 01 movw r20, r14 be44: 96 01 movw r18, r12 be46: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> be4a: c7 58 subi r28, 0x87 ; 135 be4c: dd 4f sbci r29, 0xFD ; 253 be4e: 68 83 st Y, r22 be50: 79 83 std Y+1, r23 ; 0x01 be52: 8a 83 std Y+2, r24 ; 0x02 be54: 9b 83 std Y+3, r25 ; 0x03 be56: c9 57 subi r28, 0x79 ; 121 be58: 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]); be5a: cf 58 subi r28, 0x8F ; 143 be5c: dd 4f sbci r29, 0xFD ; 253 be5e: 28 81 ld r18, Y be60: 39 81 ldd r19, Y+1 ; 0x01 be62: 4a 81 ldd r20, Y+2 ; 0x02 be64: 5b 81 ldd r21, Y+3 ; 0x03 be66: c1 57 subi r28, 0x71 ; 113 be68: d2 40 sbci r29, 0x02 ; 2 be6a: c5 01 movw r24, r10 be6c: b4 01 movw r22, r8 be6e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> be72: 4b 01 movw r8, r22 be74: 5c 01 movw r10, r24 be76: 20 e0 ldi r18, 0x00 ; 0 be78: 30 e0 ldi r19, 0x00 ; 0 be7a: 40 ec ldi r20, 0xC0 ; 192 be7c: 50 e4 ldi r21, 0x40 ; 64 be7e: c3 01 movw r24, r6 be80: b2 01 movw r22, r4 be82: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> be86: 9b 01 movw r18, r22 be88: ac 01 movw r20, r24 be8a: c5 01 movw r24, r10 be8c: b4 01 movw r22, r8 be8e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__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; be92: cb 57 subi r28, 0x7B ; 123 be94: dd 4f sbci r29, 0xFD ; 253 be96: 28 81 ld r18, Y be98: 39 81 ldd r19, Y+1 ; 0x01 be9a: 4a 81 ldd r20, Y+2 ; 0x02 be9c: 5b 81 ldd r21, Y+3 ; 0x03 be9e: c5 58 subi r28, 0x85 ; 133 bea0: d2 40 sbci r29, 0x02 ; 2 bea2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> bea6: 4b 01 movw r8, r22 bea8: 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; beaa: 20 e0 ldi r18, 0x00 ; 0 beac: 30 e0 ldi r19, 0x00 ; 0 beae: 40 e0 ldi r20, 0x00 ; 0 beb0: 5f e3 ldi r21, 0x3F ; 63 beb2: cf 58 subi r28, 0x8F ; 143 beb4: dd 4f sbci r29, 0xFD ; 253 beb6: 68 81 ld r22, Y beb8: 79 81 ldd r23, Y+1 ; 0x01 beba: 8a 81 ldd r24, Y+2 ; 0x02 bebc: 9b 81 ldd r25, Y+3 ; 0x03 bebe: c1 57 subi r28, 0x71 ; 113 bec0: d2 40 sbci r29, 0x02 ; 2 bec2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> bec6: 2b 01 movw r4, r22 bec8: 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; beca: a7 01 movw r20, r14 becc: 96 01 movw r18, r12 bece: c7 01 movw r24, r14 bed0: b6 01 movw r22, r12 bed2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> bed6: 9b 01 movw r18, r22 bed8: ac 01 movw r20, r24 beda: c3 01 movw r24, r6 bedc: b2 01 movw r22, r4 bede: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> bee2: 9b 01 movw r18, r22 bee4: ac 01 movw r20, r24 bee6: c5 01 movw r24, r10 bee8: b4 01 movw r22, r8 beea: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> beee: 9b 01 movw r18, r22 bef0: ac 01 movw r20, r24 bef2: c7 58 subi r28, 0x87 ; 135 bef4: dd 4f sbci r29, 0xFD ; 253 bef6: 68 81 ld r22, Y bef8: 79 81 ldd r23, Y+1 ; 0x01 befa: 8a 81 ldd r24, Y+2 ; 0x02 befc: 9b 81 ldd r25, Y+3 ; 0x03 befe: c9 57 subi r28, 0x79 ; 121 bf00: d2 40 sbci r29, 0x02 ; 2 bf02: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> bf06: c3 58 subi r28, 0x83 ; 131 bf08: dd 4f sbci r29, 0xFD ; 253 bf0a: 28 81 ld r18, Y bf0c: 39 81 ldd r19, Y+1 ; 0x01 bf0e: 4a 81 ldd r20, Y+2 ; 0x02 bf10: 5b 81 ldd r21, Y+3 ; 0x03 bf12: cd 57 subi r28, 0x7D ; 125 bf14: d2 40 sbci r29, 0x02 ; 2 bf16: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> bf1a: 2b 01 movw r4, r22 bf1c: 3c 01 movw r6, r24 bf1e: 0f 5f subi r16, 0xFF ; 255 bf20: 1f 4f sbci r17, 0xFF ; 255 bf22: f4 e0 ldi r31, 0x04 ; 4 bf24: 2f 0e add r2, r31 bf26: 31 1c adc r3, r1 bf28: c3 59 subi r28, 0x93 ; 147 bf2a: dd 4f sbci r29, 0xFD ; 253 bf2c: 28 81 ld r18, Y bf2e: 39 81 ldd r19, Y+1 ; 0x01 bf30: cd 56 subi r28, 0x6D ; 109 bf32: d2 40 sbci r29, 0x02 ; 2 bf34: 2c 5f subi r18, 0xFC ; 252 bf36: 3f 4f sbci r19, 0xFF ; 255 bf38: c3 59 subi r28, 0x93 ; 147 bf3a: dd 4f sbci r29, 0xFD ; 253 bf3c: 39 83 std Y+1, r19 ; 0x01 bf3e: 28 83 st Y, r18 bf40: cd 56 subi r28, 0x6D ; 109 bf42: 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 bf4a: 81 ce rjmp .-766 ; 0xbc4e sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } bf4c: c3 01 movw r24, r6 bf4e: b2 01 movw r22, r4 bf50: c4 57 subi r28, 0x74 ; 116 bf52: dd 4f sbci r29, 0xFD ; 253 bf54: 0f b6 in r0, 0x3f ; 63 bf56: f8 94 cli bf58: de bf out 0x3e, r29 ; 62 bf5a: 0f be out 0x3f, r0 ; 63 bf5c: cd bf out 0x3d, r28 ; 61 bf5e: df 91 pop r29 bf60: cf 91 pop r28 bf62: 1f 91 pop r17 bf64: 0f 91 pop r16 bf66: ff 90 pop r15 bf68: ef 90 pop r14 bf6a: df 90 pop r13 bf6c: cf 90 pop r12 bf6e: bf 90 pop r11 bf70: af 90 pop r10 bf72: 9f 90 pop r9 bf74: 8f 90 pop r8 bf76: 7f 90 pop r7 bf78: 6f 90 pop r6 bf7a: 5f 90 pop r5 bf7c: 4f 90 pop r4 bf7e: 3f 90 pop r3 bf80: 2f 90 pop r2 bf82: 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)); bf84: c5 01 movw r24, r10 bf86: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 bf8a: d8 01 movw r26, r16 bf8c: 8d 93 st X+, r24 bf8e: 9c 93 st X, r25 bf90: b5 e0 ldi r27, 0x05 ; 5 bf92: cb 0e add r12, r27 bf94: d1 1c adc r13, r1 bf96: e2 e0 ldi r30, 0x02 ; 2 bf98: ae 0e add r10, r30 bf9a: b1 1c adc r11, r1 bf9c: 96 cc rjmp .-1748 ; 0xb8ca 0000bf9e : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { bf9e: 0f 93 push r16 bfa0: 1f 93 push r17 bfa2: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) bfa4: 20 91 ba 13 lds r18, 0x13BA ; 0x8013ba bfa8: 21 30 cpi r18, 0x01 ; 1 bfaa: 79 f5 brne .+94 ; 0xc00a bfac: 8c 01 movw r16, r24 bfae: 80 e5 ldi r24, 0x50 ; 80 bfb0: 0e 94 56 5b call 0xb6ac ; 0xb6ac bfb4: 88 23 and r24, r24 bfb6: 49 f1 breq .+82 ; 0xc00a { mmuSlotIndex = code_value_uint8(); bfb8: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 bfbc: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { bfbe: 85 30 cpi r24, 0x05 ; 5 bfc0: 20 f5 brcc .+72 ; 0xc00a switch (gcode) bfc2: 01 3c cpi r16, 0xC1 ; 193 bfc4: 82 e0 ldi r24, 0x02 ; 2 bfc6: 18 07 cpc r17, r24 bfc8: 49 f0 breq .+18 ; 0xbfdc bfca: 02 3c cpi r16, 0xC2 ; 194 bfcc: 12 40 sbci r17, 0x02 ; 2 bfce: 69 f0 breq .+26 ; 0xbfea { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); bfd0: 8c 2f mov r24, r28 default: break; } } } } bfd2: cf 91 pop r28 bfd4: 1f 91 pop r17 bfd6: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); bfd8: 0d 94 8d ad jmp 0x35b1a ; 0x35b1a break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); bfdc: 60 e0 ldi r22, 0x00 ; 0 bfde: 8c 2f mov r24, r28 default: break; } } } } bfe0: cf 91 pop r28 bfe2: 1f 91 pop r17 bfe4: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); bfe6: 0d 94 d0 ad jmp 0x35ba0 ; 0x35ba0 break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ bfea: 8e ec ldi r24, 0xCE ; 206 bfec: 9e e0 ldi r25, 0x0E ; 14 bfee: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 bff2: 88 23 and r24, r24 bff4: 51 f0 breq .+20 ; 0xc00a IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { bff6: 0f 94 bc 88 call 0x31178 ; 0x31178 bffa: 88 23 and r24, r24 bffc: 31 f0 breq .+12 ; 0xc00a bffe: 8c 2f mov r24, r28 default: break; } } } } c000: cf 91 pop r28 c002: 1f 91 pop r17 c004: 0f 91 pop r16 c006: 0d 94 4d ae jmp 0x35c9a ; 0x35c9a c00a: cf 91 pop r28 c00c: 1f 91 pop r17 c00e: 0f 91 pop r16 c010: 08 95 ret 0000c012 : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c012: cf 93 push r28 c014: 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(); c016: 0f 94 ed 43 call 0x287da ; 0x287da cli(); c01a: f8 94 cli tmc2130_mode = mode; c01c: c0 93 8c 06 sts 0x068C, r28 ; 0x80068c update_mode_profile(); c020: 0f 94 dc 64 call 0x2c9b8 ; 0x2c9b8 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(); c024: 0e 94 af f0 call 0x1e15e ; 0x1e15e 1 #else 0 #endif ) , enableECool(enableECool) { } c028: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c02a: 82 70 andi r24, 0x02 ; 2 c02c: 0f 94 65 27 call 0x24eca ; 0x24eca // 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(); c030: 0f 94 47 44 call 0x2888e ; 0x2888e sei(); c034: 78 94 sei } c036: cf 91 pop r28 c038: 08 95 ret 0000c03a : 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);} c03a: 8f 92 push r8 c03c: 9f 92 push r9 c03e: af 92 push r10 c040: bf 92 push r11 c042: cf 92 push r12 c044: df 92 push r13 c046: ef 92 push r14 c048: ff 92 push r15 c04a: 0f 93 push r16 c04c: 1f 93 push r17 c04e: cf 93 push r28 c050: df 93 push r29 c052: 00 91 95 03 lds r16, 0x0395 ; 0x800395 c056: 10 91 96 03 lds r17, 0x0396 ; 0x800396 c05a: 0f 5f subi r16, 0xFF ; 255 c05c: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c05e: 68 01 movw r12, r16 c060: 8f ef ldi r24, 0xFF ; 255 c062: c8 1a sub r12, r24 c064: d8 0a sbc r13, r24 c066: d8 01 movw r26, r16 c068: dc 91 ld r29, X } while (isspace(c)); c06a: 8d 2f mov r24, r29 c06c: 90 e0 ldi r25, 0x00 ; 0 c06e: 0f 94 e5 d9 call 0x3b3ca ; 0x3b3ca c072: 7c 01 movw r14, r24 c074: 89 2b or r24, r25 c076: 01 f5 brne .+64 ; 0xc0b8 flag = 0; if (c == '-') { c078: dd 32 cpi r29, 0x2D ; 45 c07a: 01 f5 brne .+64 ; 0xc0bc flag = FL_MINUS; c = *nptr++; c07c: 68 01 movw r12, r16 c07e: b2 e0 ldi r27, 0x02 ; 2 c080: cb 0e add r12, r27 c082: d1 1c adc r13, r1 c084: f8 01 movw r30, r16 c086: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c088: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c08a: 86 01 movw r16, r12 c08c: 01 50 subi r16, 0x01 ; 1 c08e: 11 09 sbc r17, r1 c090: 43 e0 ldi r20, 0x03 ; 3 c092: 50 e0 ldi r21, 0x00 ; 0 c094: 65 ef ldi r22, 0xF5 ; 245 c096: 7a e7 ldi r23, 0x7A ; 122 c098: c8 01 movw r24, r16 c09a: 0f 94 1b da call 0x3b436 ; 0x3b436 c09e: 89 2b or r24, r25 c0a0: c1 f4 brne .+48 ; 0xc0d2 nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c0a2: 60 e0 ldi r22, 0x00 ; 0 c0a4: 70 e0 ldi r23, 0x00 ; 0 c0a6: 80 e8 ldi r24, 0x80 ; 128 c0a8: 9f ef ldi r25, 0xFF ; 255 c0aa: c1 11 cpse r28, r1 c0ac: db c0 rjmp .+438 ; 0xc264 c0ae: 60 e0 ldi r22, 0x00 ; 0 c0b0: 70 e0 ldi r23, 0x00 ; 0 c0b2: 80 e8 ldi r24, 0x80 ; 128 c0b4: 9f e7 ldi r25, 0x7F ; 127 c0b6: d6 c0 rjmp .+428 ; 0xc264 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c0b8: 86 01 movw r16, r12 c0ba: d1 cf rjmp .-94 ; 0xc05e flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c0bc: db 32 cpi r29, 0x2B ; 43 c0be: 39 f4 brne .+14 ; 0xc0ce c = *nptr++; c0c0: 68 01 movw r12, r16 c0c2: f2 e0 ldi r31, 0x02 ; 2 c0c4: cf 0e add r12, r31 c0c6: d1 1c adc r13, r1 c0c8: d8 01 movw r26, r16 c0ca: 11 96 adiw r26, 0x01 ; 1 c0cc: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c0ce: c0 e0 ldi r28, 0x00 ; 0 c0d0: dc cf rjmp .-72 ; 0xc08a 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)) { c0d2: 43 e0 ldi r20, 0x03 ; 3 c0d4: 50 e0 ldi r21, 0x00 ; 0 c0d6: 62 ef ldi r22, 0xF2 ; 242 c0d8: 7a e7 ldi r23, 0x7A ; 122 c0da: c8 01 movw r24, r16 c0dc: 0f 94 1b da call 0x3b436 ; 0x3b436 c0e0: 89 2b or r24, r25 c0e2: 09 f4 brne .+2 ; 0xc0e6 c0e4: cc c0 rjmp .+408 ; 0xc27e c0e6: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c0e8: 10 e0 ldi r17, 0x00 ; 0 c0ea: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c0ec: 20 e0 ldi r18, 0x00 ; 0 c0ee: 30 e0 ldi r19, 0x00 ; 0 c0f0: a9 01 movw r20, r18 c0f2: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c0f4: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c0f6: da 30 cpi r29, 0x0A ; 10 c0f8: 60 f5 brcc .+88 ; 0xc152 flag |= FL_ANY; c0fa: bc 2e mov r11, r28 c0fc: 68 94 set c0fe: b1 f8 bld r11, 1 c100: 8c 2f mov r24, r28 c102: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c104: c2 ff sbrs r28, 2 c106: 09 c0 rjmp .+18 ; 0xc11a if (!(flag & FL_DOT)) c108: 81 11 cpse r24, r1 c10a: 02 c0 rjmp .+4 ; 0xc110 exp += 1; c10c: 0f 5f subi r16, 0xFF ; 255 c10e: 1f 4f sbci r17, 0xFF ; 255 c110: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c112: d6 01 movw r26, r12 c114: dc 91 ld r29, X c116: cb 2d mov r28, r11 c118: ec cf rjmp .-40 ; 0xc0f2 if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c11a: 88 23 and r24, r24 c11c: 11 f0 breq .+4 ; 0xc122 exp -= 1; c11e: 01 50 subi r16, 0x01 ; 1 c120: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c122: a5 e0 ldi r26, 0x05 ; 5 c124: b0 e0 ldi r27, 0x00 ; 0 c126: 0f 94 e9 dc call 0x3b9d2 ; 0x3b9d2 <__muluhisi3> c12a: 9b 01 movw r18, r22 c12c: ac 01 movw r20, r24 c12e: 22 0f add r18, r18 c130: 33 1f adc r19, r19 c132: 44 1f adc r20, r20 c134: 55 1f adc r21, r21 c136: 2d 0f add r18, r29 c138: 31 1d adc r19, r1 c13a: 41 1d adc r20, r1 c13c: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c13e: 28 39 cpi r18, 0x98 ; 152 c140: b9 e9 ldi r27, 0x99 ; 153 c142: 3b 07 cpc r19, r27 c144: 4b 07 cpc r20, r27 c146: b9 e1 ldi r27, 0x19 ; 25 c148: 5b 07 cpc r21, r27 c14a: 10 f3 brcs .-60 ; 0xc110 flag |= FL_OVFL; c14c: c6 60 ori r28, 0x06 ; 6 c14e: bc 2e mov r11, r28 c150: df cf rjmp .-66 ; 0xc110 } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c152: de 3f cpi r29, 0xFE ; 254 c154: 31 f4 brne .+12 ; 0xc162 c156: c3 fd sbrc r28, 3 c158: 33 c0 rjmp .+102 ; 0xc1c0 flag |= FL_DOT; c15a: bc 2e mov r11, r28 c15c: 68 94 set c15e: b3 f8 bld r11, 3 c160: d7 cf rjmp .-82 ; 0xc110 } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c162: d5 33 cpi r29, 0x35 ; 53 c164: 69 f5 brne .+90 ; 0xc1c0 { int i; c = *nptr++; c166: 80 81 ld r24, Z i = 2; if (c == '-') { c168: 8d 32 cpi r24, 0x2D ; 45 c16a: 31 f4 brne .+12 ; 0xc178 flag |= FL_MEXP; c16c: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c16e: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c170: 6e 5f subi r22, 0xFE ; 254 c172: 7f 4f sbci r23, 0xFF ; 255 c174: 81 81 ldd r24, Z+1 ; 0x01 c176: 05 c0 rjmp .+10 ; 0xc182 c178: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c17a: 8b 32 cpi r24, 0x2B ; 43 c17c: c9 f3 breq .-14 ; 0xc170 // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c17e: 6f 5f subi r22, 0xFF ; 255 c180: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c182: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c184: 8a 30 cpi r24, 0x0A ; 10 c186: e0 f4 brcc .+56 ; 0xc1c0 c188: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c18a: b0 e8 ldi r27, 0x80 ; 128 c18c: eb 16 cp r14, r27 c18e: bc e0 ldi r27, 0x0C ; 12 c190: fb 06 cpc r15, r27 c192: 5c f4 brge .+22 ; 0xc1aa i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c194: b7 01 movw r22, r14 c196: 66 0f add r22, r22 c198: 77 1f adc r23, r23 c19a: 66 0f add r22, r22 c19c: 77 1f adc r23, r23 c19e: e6 0e add r14, r22 c1a0: f7 1e adc r15, r23 c1a2: ee 0c add r14, r14 c1a4: ff 1c adc r15, r15 c1a6: e8 0e add r14, r24 c1a8: f1 1c adc r15, r1 c = *nptr++ - '0'; c1aa: 81 91 ld r24, Z+ c1ac: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c1ae: 8a 30 cpi r24, 0x0A ; 10 c1b0: 60 f3 brcs .-40 ; 0xc18a if (flag & FL_MEXP) c1b2: c4 ff sbrs r28, 4 c1b4: 03 c0 rjmp .+6 ; 0xc1bc i = -i; c1b6: f1 94 neg r15 c1b8: e1 94 neg r14 c1ba: f1 08 sbc r15, r1 exp += i; c1bc: 0e 0d add r16, r14 c1be: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c1c0: ca 01 movw r24, r20 c1c2: b9 01 movw r22, r18 c1c4: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c1c8: c3 70 andi r28, 0x03 ; 3 c1ca: c3 30 cpi r28, 0x03 ; 3 c1cc: 09 f4 brne .+2 ; 0xc1d0 x.flt = -x.flt; c1ce: 90 58 subi r25, 0x80 ; 128 c1d0: 4b 01 movw r8, r22 c1d2: 5c 01 movw r10, r24 if (x.flt != 0) { c1d4: 20 e0 ldi r18, 0x00 ; 0 c1d6: 30 e0 ldi r19, 0x00 ; 0 c1d8: a9 01 movw r20, r18 c1da: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> c1de: 88 23 and r24, r24 c1e0: 09 f4 brne .+2 ; 0xc1e4 c1e2: 3e c0 rjmp .+124 ; 0xc260 if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c1e4: ce ee ldi r28, 0xEE ; 238 c1e6: da e7 ldi r29, 0x7A ; 122 if ((flag & FL_MINUS) && (flag & FL_ANY)) x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { c1e8: 17 ff sbrs r17, 7 c1ea: 05 c0 rjmp .+10 ; 0xc1f6 nptr = (void*)(pwr_m10 + 5); exp = -exp; c1ec: 11 95 neg r17 c1ee: 01 95 neg r16 c1f0: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c1f2: c6 ed ldi r28, 0xD6 ; 214 c1f4: da e7 ldi r29, 0x7A ; 122 c1f6: 6e 01 movw r12, r28 c1f8: e8 e1 ldi r30, 0x18 ; 24 c1fa: ce 1a sub r12, r30 c1fc: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c1fe: 80 e2 ldi r24, 0x20 ; 32 c200: e8 2e mov r14, r24 c202: f1 2c mov r15, r1 c204: 0d c0 rjmp .+26 ; 0xc220 for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c206: fe 01 movw r30, r28 c208: 25 91 lpm r18, Z+ c20a: 35 91 lpm r19, Z+ c20c: 45 91 lpm r20, Z+ c20e: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c210: 0e 19 sub r16, r14 c212: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c214: c5 01 movw r24, r10 c216: b4 01 movw r22, r8 c218: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> c21c: 4b 01 movw r8, r22 c21e: 5c 01 movw r10, r24 c220: d5 01 movw r26, r10 c222: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c224: 0e 15 cp r16, r14 c226: 1f 05 cpc r17, r15 c228: 74 f7 brge .-36 ; 0xc206 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c22a: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c22c: f5 94 asr r15 c22e: e7 94 ror r14 c230: cc 16 cp r12, r28 c232: dd 06 cpc r13, r29 c234: a9 f7 brne .-22 ; 0xc220 not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c236: 8a 2f mov r24, r26 c238: 88 0f add r24, r24 c23a: 8b 2f mov r24, r27 c23c: 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) c23e: 8f 3f cpi r24, 0xFF ; 255 c240: 49 f0 breq .+18 ; 0xc254 c242: 20 e0 ldi r18, 0x00 ; 0 c244: 30 e0 ldi r19, 0x00 ; 0 c246: a9 01 movw r20, r18 c248: c5 01 movw r24, r10 c24a: b4 01 movw r22, r8 c24c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> c250: 81 11 cpse r24, r1 c252: 06 c0 rjmp .+12 ; 0xc260 errno = ERANGE; c254: 82 e2 ldi r24, 0x22 ; 34 c256: 90 e0 ldi r25, 0x00 ; 0 c258: 90 93 15 18 sts 0x1815, r25 ; 0x801815 c25c: 80 93 14 18 sts 0x1814, r24 ; 0x801814 } return x.flt; c260: c5 01 movw r24, r10 c262: b4 01 movw r22, r8 c264: df 91 pop r29 c266: cf 91 pop r28 c268: 1f 91 pop r17 c26a: 0f 91 pop r16 c26c: ff 90 pop r15 c26e: ef 90 pop r14 c270: df 90 pop r13 c272: cf 90 pop r12 c274: bf 90 pop r11 c276: af 90 pop r10 c278: 9f 90 pop r9 c27a: 8f 90 pop r8 c27c: 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; c27e: 60 e0 ldi r22, 0x00 ; 0 c280: 70 e0 ldi r23, 0x00 ; 0 c282: 80 ec ldi r24, 0xC0 ; 192 c284: 9f e7 ldi r25, 0x7F ; 127 c286: ee cf rjmp .-36 ; 0xc264 0000c288 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c288: 2f 92 push r2 c28a: 3f 92 push r3 c28c: 4f 92 push r4 c28e: 5f 92 push r5 c290: 6f 92 push r6 c292: 7f 92 push r7 c294: 8f 92 push r8 c296: 9f 92 push r9 c298: af 92 push r10 c29a: bf 92 push r11 c29c: cf 92 push r12 c29e: df 92 push r13 c2a0: ef 92 push r14 c2a2: ff 92 push r15 c2a4: 0f 93 push r16 c2a6: 1f 93 push r17 c2a8: cf 93 push r28 c2aa: df 93 push r29 c2ac: 00 d0 rcall .+0 ; 0xc2ae c2ae: cd b7 in r28, 0x3d ; 61 c2b0: de b7 in r29, 0x3e ; 62 c2b2: 8d ed ldi r24, 0xDD ; 221 c2b4: c8 2e mov r12, r24 c2b6: 82 e0 ldi r24, 0x02 ; 2 c2b8: d8 2e mov r13, r24 c2ba: 84 e7 ldi r24, 0x74 ; 116 c2bc: 96 e0 ldi r25, 0x06 ; 6 c2be: 9b 83 std Y+3, r25 ; 0x03 c2c0: 8a 83 std Y+2, r24 ; 0x02 c2c2: 92 e9 ldi r25, 0x92 ; 146 c2c4: e9 2e mov r14, r25 c2c6: 96 e0 ldi r25, 0x06 ; 6 c2c8: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c2ca: 33 24 eor r3, r3 c2cc: 33 94 inc r3 c2ce: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c2d0: f6 01 movw r30, r12 c2d2: 81 91 ld r24, Z+ c2d4: 6f 01 movw r12, r30 c2d6: 0e 94 56 5b call 0xb6ac ; 0xb6ac c2da: 28 2e mov r2, r24 c2dc: 88 23 and r24, r24 c2de: 09 f4 brne .+2 ; 0xc2e2 c2e0: a6 c0 rjmp .+332 ; 0xc42e { bool relative = axis_relative_modes & mask; c2e2: 10 91 e5 03 lds r17, 0x03E5 ; 0x8003e5 c2e6: 13 21 and r17, r3 destination[i] = code_value(); c2e8: 0e 94 1d 60 call 0xc03a ; 0xc03a c2ec: 2b 01 movw r4, r22 c2ee: 3c 01 movw r6, r24 c2f0: ea 81 ldd r30, Y+2 ; 0x02 c2f2: fb 81 ldd r31, Y+3 ; 0x03 c2f4: 40 82 st Z, r4 c2f6: 51 82 std Z+1, r5 ; 0x01 c2f8: 62 82 std Z+2, r6 ; 0x02 c2fa: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c2fc: 03 30 cpi r16, 0x03 ; 3 c2fe: 09 f0 breq .+2 ; 0xc302 c300: 46 c0 rjmp .+140 ; 0xc38e 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; c302: f1 e0 ldi r31, 0x01 ; 1 c304: f9 83 std Y+1, r31 ; 0x01 c306: 11 11 cpse r17, r1 c308: 01 c0 rjmp .+2 ; 0xc30c c30a: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c30c: 80 90 93 02 lds r8, 0x0293 ; 0x800293 c310: 90 90 94 02 lds r9, 0x0294 ; 0x800294 c314: a0 90 95 02 lds r10, 0x0295 ; 0x800295 c318: b0 90 96 02 lds r11, 0x0296 ; 0x800296 if (emult != 1.) { c31c: 20 e0 ldi r18, 0x00 ; 0 c31e: 30 e0 ldi r19, 0x00 ; 0 c320: 40 e8 ldi r20, 0x80 ; 128 c322: 5f e3 ldi r21, 0x3F ; 63 c324: c5 01 movw r24, r10 c326: b4 01 movw r22, r8 c328: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> c32c: 88 23 and r24, r24 c32e: 59 f1 breq .+86 ; 0xc386 if (! relative) { c330: 11 11 cpse r17, r1 c332: 15 c0 rjmp .+42 ; 0xc35e destination[i] -= current_position[i]; c334: 20 91 9e 06 lds r18, 0x069E ; 0x80069e c338: 30 91 9f 06 lds r19, 0x069F ; 0x80069f c33c: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 c340: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 c344: c3 01 movw r24, r6 c346: b2 01 movw r22, r4 c348: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> c34c: 60 93 80 06 sts 0x0680, r22 ; 0x800680 c350: 70 93 81 06 sts 0x0681, r23 ; 0x800681 c354: 80 93 82 06 sts 0x0682, r24 ; 0x800682 c358: 90 93 83 06 sts 0x0683, r25 ; 0x800683 relative = true; c35c: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c35e: a5 01 movw r20, r10 c360: 94 01 movw r18, r8 c362: 60 91 80 06 lds r22, 0x0680 ; 0x800680 c366: 70 91 81 06 lds r23, 0x0681 ; 0x800681 c36a: 80 91 82 06 lds r24, 0x0682 ; 0x800682 c36e: 90 91 83 06 lds r25, 0x0683 ; 0x800683 c372: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> c376: 60 93 80 06 sts 0x0680, r22 ; 0x800680 c37a: 70 93 81 06 sts 0x0681, r23 ; 0x800681 c37e: 80 93 82 06 sts 0x0682, r24 ; 0x800682 c382: 90 93 83 06 sts 0x0683, r25 ; 0x800683 } } if (relative) c386: e9 81 ldd r30, Y+1 ; 0x01 c388: e1 11 cpse r30, r1 c38a: 03 c0 rjmp .+6 ; 0xc392 c38c: 22 c0 rjmp .+68 ; 0xc3d2 c38e: 11 23 and r17, r17 c390: 99 f0 breq .+38 ; 0xc3b8 destination[i] += current_position[i]; c392: f7 01 movw r30, r14 c394: 20 81 ld r18, Z c396: 31 81 ldd r19, Z+1 ; 0x01 c398: 42 81 ldd r20, Z+2 ; 0x02 c39a: 53 81 ldd r21, Z+3 ; 0x03 c39c: ea 81 ldd r30, Y+2 ; 0x02 c39e: fb 81 ldd r31, Y+3 ; 0x03 c3a0: 60 81 ld r22, Z c3a2: 71 81 ldd r23, Z+1 ; 0x01 c3a4: 82 81 ldd r24, Z+2 ; 0x02 c3a6: 93 81 ldd r25, Z+3 ; 0x03 c3a8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> c3ac: ea 81 ldd r30, Y+2 ; 0x02 c3ae: fb 81 ldd r31, Y+3 ; 0x03 c3b0: 60 83 st Z, r22 c3b2: 71 83 std Z+1, r23 ; 0x01 c3b4: 82 83 std Z+2, r24 ; 0x02 c3b6: 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) { c3b8: 0f 5f subi r16, 0xFF ; 255 c3ba: 33 0c add r3, r3 c3bc: 8a 81 ldd r24, Y+2 ; 0x02 c3be: 9b 81 ldd r25, Y+3 ; 0x03 c3c0: 04 96 adiw r24, 0x04 ; 4 c3c2: 9b 83 std Y+3, r25 ; 0x03 c3c4: 8a 83 std Y+2, r24 ; 0x02 c3c6: 94 e0 ldi r25, 0x04 ; 4 c3c8: e9 0e add r14, r25 c3ca: f1 1c adc r15, r1 c3cc: 04 30 cpi r16, 0x04 ; 4 c3ce: 09 f0 breq .+2 ; 0xc3d2 c3d0: 7f cf rjmp .-258 ; 0xc2d0 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')) { c3d2: 86 e4 ldi r24, 0x46 ; 70 c3d4: 0e 94 56 5b call 0xb6ac ; 0xb6ac c3d8: 88 23 and r24, r24 c3da: 99 f0 breq .+38 ; 0xc402 const float next_feedrate = code_value(); c3dc: 0e 94 1d 60 call 0xc03a ; 0xc03a c3e0: 6b 01 movw r12, r22 c3e2: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c3e4: 20 e0 ldi r18, 0x00 ; 0 c3e6: 30 e0 ldi r19, 0x00 ; 0 c3e8: a9 01 movw r20, r18 c3ea: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> c3ee: 18 16 cp r1, r24 c3f0: 44 f4 brge .+16 ; 0xc402 c3f2: c0 92 b8 02 sts 0x02B8, r12 ; 0x8002b8 c3f6: d0 92 b9 02 sts 0x02B9, r13 ; 0x8002b9 c3fa: e0 92 ba 02 sts 0x02BA, r14 ; 0x8002ba c3fe: f0 92 bb 02 sts 0x02BB, r15 ; 0x8002bb } } c402: 0f 90 pop r0 c404: 0f 90 pop r0 c406: 0f 90 pop r0 c408: df 91 pop r29 c40a: cf 91 pop r28 c40c: 1f 91 pop r17 c40e: 0f 91 pop r16 c410: ff 90 pop r15 c412: ef 90 pop r14 c414: df 90 pop r13 c416: cf 90 pop r12 c418: bf 90 pop r11 c41a: af 90 pop r10 c41c: 9f 90 pop r9 c41e: 8f 90 pop r8 c420: 7f 90 pop r7 c422: 6f 90 pop r6 c424: 5f 90 pop r5 c426: 4f 90 pop r4 c428: 3f 90 pop r3 c42a: 2f 90 pop r2 c42c: 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? c42e: f7 01 movw r30, r14 c430: 80 81 ld r24, Z c432: 91 81 ldd r25, Z+1 ; 0x01 c434: a2 81 ldd r26, Z+2 ; 0x02 c436: b3 81 ldd r27, Z+3 ; 0x03 c438: ea 81 ldd r30, Y+2 ; 0x02 c43a: fb 81 ldd r31, Y+3 ; 0x03 c43c: 80 83 st Z, r24 c43e: 91 83 std Z+1, r25 ; 0x01 c440: a2 83 std Z+2, r26 ; 0x02 c442: b3 83 std Z+3, r27 ; 0x03 c444: b9 cf rjmp .-142 ; 0xc3b8 0000c446 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c446: 2f 92 push r2 c448: 3f 92 push r3 c44a: 4f 92 push r4 c44c: 5f 92 push r5 c44e: 6f 92 push r6 c450: 7f 92 push r7 c452: 8f 92 push r8 c454: 9f 92 push r9 c456: af 92 push r10 c458: bf 92 push r11 c45a: cf 92 push r12 c45c: df 92 push r13 c45e: ef 92 push r14 c460: ff 92 push r15 c462: 0f 93 push r16 c464: 1f 93 push r17 c466: cf 93 push r28 c468: df 93 push r29 c46a: cd b7 in r28, 0x3d ; 61 c46c: de b7 in r29, 0x3e ; 62 c46e: 65 97 sbiw r28, 0x15 ; 21 c470: 0f b6 in r0, 0x3f ; 63 c472: f8 94 cli c474: de bf out 0x3e, r29 ; 62 c476: 0f be out 0x3f, r0 ; 63 c478: cd bf out 0x3d, r28 ; 61 c47a: 69 8b std Y+17, r22 ; 0x11 c47c: 7a 8b std Y+18, r23 ; 0x12 c47e: 8b 8b std Y+19, r24 ; 0x13 c480: 9c 8b std Y+20, r25 ; 0x14 c482: 49 01 movw r8, r18 c484: 5a 01 movw r10, r20 c486: 30 2e mov r3, r16 c488: cd 8a std Y+21, r12 ; 0x15 c48a: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c48c: 81 e0 ldi r24, 0x01 ; 1 c48e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c492: df 92 push r13 c494: 2d 89 ldd r18, Y+21 ; 0x15 c496: 2f 93 push r18 c498: 1f 92 push r1 c49a: ef 92 push r14 c49c: 87 ee ldi r24, 0xE7 ; 231 c49e: 94 e6 ldi r25, 0x64 ; 100 c4a0: 9f 93 push r25 c4a2: 8f 93 push r24 c4a4: 0f 94 16 db call 0x3b62c ; 0x3b62c daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c4a8: 81 e4 ldi r24, 0x41 ; 65 c4aa: 0e 94 56 5b call 0xb6ac ; 0xb6ac c4ae: 0f 90 pop r0 c4b0: 0f 90 pop r0 c4b2: 0f 90 pop r0 c4b4: 0f 90 pop r0 c4b6: 0f 90 pop r0 c4b8: 0f 90 pop r0 c4ba: 88 23 and r24, r24 c4bc: a1 f0 breq .+40 ; 0xc4e6 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c4be: 80 91 95 03 lds r24, 0x0395 ; 0x800395 c4c2: 90 91 96 03 lds r25, 0x0396 ; 0x800396 c4c6: fc 01 movw r30, r24 c4c8: 21 81 ldd r18, Z+1 ; 0x01 c4ca: 28 37 cpi r18, 0x78 ; 120 c4cc: 09 f0 breq .+2 ; 0xc4d0 c4ce: 69 c0 rjmp .+210 ; 0xc5a2 c4d0: 40 e1 ldi r20, 0x10 ; 16 c4d2: 50 e0 ldi r21, 0x00 ; 0 c4d4: 70 e0 ldi r23, 0x00 ; 0 c4d6: 60 e0 ldi r22, 0x00 ; 0 c4d8: 02 96 adiw r24, 0x02 ; 2 c4da: 0f 94 df d7 call 0x3afbe ; 0x3afbe c4de: 69 8b std Y+17, r22 ; 0x11 c4e0: 7a 8b std Y+18, r23 ; 0x12 c4e2: 8b 8b std Y+19, r24 ; 0x13 c4e4: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c4e6: 83 e4 ldi r24, 0x43 ; 67 c4e8: 0e 94 56 5b call 0xb6ac ; 0xb6ac c4ec: 88 23 and r24, r24 c4ee: 09 f4 brne .+2 ; 0xc4f2 c4f0: 65 c0 rjmp .+202 ; 0xc5bc count = code_value_long(); c4f2: 0e 94 02 5b call 0xb604 ; 0xb604 c4f6: 2b 01 movw r4, r22 c4f8: 3c 01 movw r6, r24 c4fa: c9 88 ldd r12, Y+17 ; 0x11 c4fc: da 88 ldd r13, Y+18 ; 0x12 c4fe: eb 88 ldd r14, Y+19 ; 0x13 c500: fc 88 ldd r15, Y+20 ; 0x14 c502: 8c 14 cp r8, r12 c504: 9d 04 cpc r9, r13 c506: ae 04 cpc r10, r14 c508: bf 04 cpc r11, r15 c50a: 10 f4 brcc .+4 ; 0xc510 c50c: 75 01 movw r14, r10 c50e: 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) c510: d3 01 movw r26, r6 c512: c2 01 movw r24, r4 c514: 8c 0d add r24, r12 c516: 9d 1d adc r25, r13 c518: ae 1d adc r26, r14 c51a: bf 1d adc r27, r15 c51c: 88 16 cp r8, r24 c51e: 99 06 cpc r9, r25 c520: aa 06 cpc r10, r26 c522: bb 06 cpc r11, r27 c524: 28 f0 brcs .+10 ; 0xc530 c526: 8c 15 cp r24, r12 c528: 9d 05 cpc r25, r13 c52a: ae 05 cpc r26, r14 c52c: bf 05 cpc r27, r15 c52e: 30 f4 brcc .+12 ; 0xc53c count = addr_end - addr_start; c530: 24 01 movw r4, r8 c532: 35 01 movw r6, r10 c534: 4c 18 sub r4, r12 c536: 5d 08 sbc r5, r13 c538: 6e 08 sbc r6, r14 c53a: 7f 08 sbc r7, r15 if (code_seen('X')) c53c: 88 e5 ldi r24, 0x58 ; 88 c53e: 0e 94 56 5b call 0xb6ac ; 0xb6ac c542: 88 23 and r24, r24 c544: 09 f4 brne .+2 ; 0xc548 c546: 91 c0 rjmp .+290 ; 0xc66a { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c548: 20 91 95 03 lds r18, 0x0395 ; 0x800395 c54c: 30 91 96 03 lds r19, 0x0396 ; 0x800396 c550: 2f 5f subi r18, 0xFF ; 255 c552: 3f 4f sbci r19, 0xFF ; 255 c554: fe 01 movw r30, r28 c556: 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; c558: 10 e0 ldi r17, 0x00 ; 0 c55a: 00 e0 ldi r16, 0x00 ; 0 c55c: 4f 01 movw r8, r30 c55e: d9 01 movw r26, r18 while (*hex) c560: 8c 91 ld r24, X c562: 2f 5f subi r18, 0xFF ; 255 c564: 3f 4f sbci r19, 0xFF ; 255 c566: 88 23 and r24, r24 c568: 09 f4 brne .+2 ; 0xc56c c56a: 3f c0 rjmp .+126 ; 0xc5ea { if (count && (parsed >= count)) break; c56c: 00 31 cpi r16, 0x10 ; 16 c56e: 11 05 cpc r17, r1 c570: e1 f1 breq .+120 ; 0xc5ea char c = *(hex++); if (c == ' ') continue; c572: 80 32 cpi r24, 0x20 ; 32 c574: a1 f3 breq .-24 ; 0xc55e if (c == '\n') break; c576: 8a 30 cpi r24, 0x0A ; 10 c578: c1 f1 breq .+112 ; 0xc5ea uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c57a: 90 ed ldi r25, 0xD0 ; 208 c57c: 98 0f add r25, r24 c57e: 9a 30 cpi r25, 0x0A ; 10 c580: 10 f5 brcc .+68 ; 0xc5c6 c582: 82 95 swap r24 c584: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c586: 9d 01 movw r18, r26 c588: 2e 5f subi r18, 0xFE ; 254 c58a: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c58c: 11 96 adiw r26, 0x01 ; 1 c58e: 9c 91 ld r25, X c590: 40 ed ldi r20, 0xD0 ; 208 c592: 49 0f add r20, r25 c594: 4a 30 cpi r20, 0x0A ; 10 c596: f8 f4 brcc .+62 ; 0xc5d6 c598: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c59a: 81 93 st Z+, r24 parsed++; c59c: 0f 5f subi r16, 0xFF ; 255 c59e: 1f 4f sbci r17, 0xFF ; 255 c5a0: de cf rjmp .-68 ; 0xc55e { 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(); c5a2: 0e 94 1d 60 call 0xc03a ; 0xc03a c5a6: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> c5aa: 9b 01 movw r18, r22 c5ac: 77 0f add r23, r23 c5ae: 44 0b sbc r20, r20 c5b0: 55 0b sbc r21, r21 c5b2: 29 8b std Y+17, r18 ; 0x11 c5b4: 3a 8b std Y+18, r19 ; 0x12 c5b6: 4b 8b std Y+19, r20 ; 0x13 c5b8: 5c 8b std Y+20, r21 ; 0x14 c5ba: 95 cf rjmp .-214 ; 0xc4e6 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 c5bc: 44 24 eor r4, r4 c5be: 4a 94 dec r4 c5c0: 54 2c mov r5, r4 c5c2: 32 01 movw r6, r4 c5c4: 9a cf rjmp .-204 ; 0xc4fa 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); c5c6: 9f e9 ldi r25, 0x9F ; 159 c5c8: 98 0f add r25, r24 c5ca: 96 30 cpi r25, 0x06 ; 6 c5cc: 58 f4 brcc .+22 ; 0xc5e4 c5ce: 82 95 swap r24 c5d0: 80 7f andi r24, 0xF0 ; 240 c5d2: 80 57 subi r24, 0x70 ; 112 c5d4: d8 cf rjmp .-80 ; 0xc586 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c5d6: 4f e9 ldi r20, 0x9F ; 159 c5d8: 49 0f add r20, r25 c5da: 46 30 cpi r20, 0x06 ; 6 c5dc: 18 f4 brcc .+6 ; 0xc5e4 c5de: 97 55 subi r25, 0x57 ; 87 c5e0: 89 2b or r24, r25 c5e2: db cf rjmp .-74 ; 0xc59a else return -parsed; c5e4: 11 95 neg r17 c5e6: 01 95 neg r16 c5e8: 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); c5ea: 28 01 movw r4, r16 c5ec: 01 2e mov r0, r17 c5ee: 00 0c add r0, r0 c5f0: 66 08 sbc r6, r6 c5f2: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c5f4: da 8a std Y+18, r13 ; 0x12 c5f6: 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++) c5f8: b1 2c mov r11, r1 c5fa: a1 2c mov r10, r1 c5fc: 0a 15 cp r16, r10 c5fe: 1b 05 cpc r17, r11 c600: f1 f0 breq .+60 ; 0xc63e { switch (type) c602: 33 20 and r3, r3 c604: 39 f0 breq .+14 ; 0xc614 c606: 31 e0 ldi r19, 0x01 ; 1 c608: 33 16 cp r3, r19 c60a: 71 f0 breq .+28 ; 0xc628 } // 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++) c60c: 4f ef ldi r20, 0xFF ; 255 c60e: a4 1a sub r10, r20 c610: b4 0a sbc r11, r20 c612: f4 cf rjmp .-24 ; 0xc5fc { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c614: f4 01 movw r30, r8 c616: ea 0d add r30, r10 c618: fb 1d adc r31, r11 c61a: 80 81 ld r24, Z c61c: e9 89 ldd r30, Y+17 ; 0x11 c61e: fa 89 ldd r31, Y+18 ; 0x12 c620: ea 0d add r30, r10 c622: fb 1d adc r31, r11 c624: 80 83 st Z, r24 c626: f2 cf rjmp .-28 ; 0xc60c case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c628: f4 01 movw r30, r8 c62a: ea 0d add r30, r10 c62c: 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); c62e: 60 81 ld r22, Z c630: 89 89 ldd r24, Y+17 ; 0x11 c632: 9a 89 ldd r25, Y+18 ; 0x12 c634: 8a 0d add r24, r10 c636: 9b 1d adc r25, r11 c638: 0f 94 9c dc call 0x3b938 ; 0x3b938 c63c: e7 cf rjmp .-50 ; 0xc60c { 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); c63e: ff 92 push r15 c640: ef 92 push r14 c642: df 92 push r13 c644: cf 92 push r12 c646: 2f 92 push r2 c648: 5d 89 ldd r21, Y+21 ; 0x15 c64a: 5f 93 push r21 c64c: 7f 92 push r7 c64e: 6f 92 push r6 c650: 5f 92 push r5 c652: 4f 92 push r4 c654: 8b eb ldi r24, 0xBB ; 187 c656: 94 e6 ldi r25, 0x64 ; 100 c658: 9f 93 push r25 c65a: 8f 93 push r24 c65c: 0f 94 16 db call 0x3b62c ; 0x3b62c c660: 0f b6 in r0, 0x3f ; 63 c662: f8 94 cli c664: de bf out 0x3e, r29 ; 62 c666: 0f be out 0x3f, r0 ; 63 c668: 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); c66a: 03 2d mov r16, r3 c66c: a3 01 movw r20, r6 c66e: 92 01 movw r18, r4 c670: c7 01 movw r24, r14 c672: b6 01 movw r22, r12 c674: 0f 94 64 87 call 0x30ec8 ; 0x30ec8 } c678: 65 96 adiw r28, 0x15 ; 21 c67a: 0f b6 in r0, 0x3f ; 63 c67c: f8 94 cli c67e: de bf out 0x3e, r29 ; 62 c680: 0f be out 0x3f, r0 ; 63 c682: cd bf out 0x3d, r28 ; 61 c684: df 91 pop r29 c686: cf 91 pop r28 c688: 1f 91 pop r17 c68a: 0f 91 pop r16 c68c: ff 90 pop r15 c68e: ef 90 pop r14 c690: df 90 pop r13 c692: cf 90 pop r12 c694: bf 90 pop r11 c696: af 90 pop r10 c698: 9f 90 pop r9 c69a: 8f 90 pop r8 c69c: 7f 90 pop r7 c69e: 6f 90 pop r6 c6a0: 5f 90 pop r5 c6a2: 4f 90 pop r4 c6a4: 3f 90 pop r3 c6a6: 2f 90 pop r2 c6a8: 08 95 ret 0000c6aa : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); c6aa: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> c6ae: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> c6b2: 90 e0 ldi r25, 0x00 ; 0 c6b4: 8a 30 cpi r24, 0x0A ; 10 c6b6: 20 f0 brcs .+8 ; 0xc6c0 c6b8: 89 5a subi r24, 0xA9 ; 169 c6ba: 9f 4f sbci r25, 0xFF ; 255 c6bc: 0d 94 bc da jmp 0x3b578 ; 0x3b578 c6c0: c0 96 adiw r24, 0x30 ; 48 c6c2: fc cf rjmp .-8 ; 0xc6bc 0000c6c4 : 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); c6c4: 84 ff sbrs r24, 4 c6c6: 18 c0 rjmp .+48 ; 0xc6f8 c6c8: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); c6ca: 85 ff sbrs r24, 5 c6cc: 17 c0 rjmp .+46 ; 0xc6fc c6ce: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); c6d0: 2f b7 in r18, 0x3f ; 63 c6d2: 86 ff sbrs r24, 6 c6d4: 15 c0 rjmp .+42 ; 0xc700 c6d6: f8 94 cli c6d8: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c6dc: 90 68 ori r25, 0x80 ; 128 c6de: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c6e2: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); c6e4: 87 ff sbrs r24, 7 c6e6: 11 c0 rjmp .+34 ; 0xc70a c6e8: 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); c6ea: 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); c6ec: 85 e0 ldi r24, 0x05 ; 5 c6ee: 8a 95 dec r24 c6f0: f1 f7 brne .-4 ; 0xc6ee c6f2: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); c6f4: 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(); } c6f6: 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); c6f8: 8d 98 cbi 0x11, 5 ; 17 c6fa: e7 cf rjmp .-50 ; 0xc6ca WRITE(LCD_PINS_D5, value & 0x20); c6fc: a4 98 cbi 0x14, 4 ; 20 c6fe: e8 cf rjmp .-48 ; 0xc6d0 WRITE(LCD_PINS_D6, value & 0x40); c700: f8 94 cli c702: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c706: 9f 77 andi r25, 0x7F ; 127 c708: ea cf rjmp .-44 ; 0xc6de WRITE(LCD_PINS_D7, value & 0x80); c70a: a3 98 cbi 0x14, 3 ; 20 c70c: ee cf rjmp .-36 ; 0xc6ea 0000c70e : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { c70e: 0f 93 push r16 c710: 1f 93 push r17 c712: cf 93 push r28 c714: df 93 push r29 c716: c8 2f mov r28, r24 c718: d6 2f mov r29, r22 c71a: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); c71c: 60 ff sbrs r22, 0 c71e: 15 c0 rjmp .+42 ; 0xc74a c720: 5d 9a sbi 0x0b, 5 ; 11 c722: 8a e1 ldi r24, 0x1A ; 26 c724: 8a 95 dec r24 c726: f1 f7 brne .-4 ; 0xc724 c728: 00 c0 rjmp .+0 ; 0xc72a _delay_us(5); lcd_writebits(data); c72a: 8c 2f mov r24, r28 c72c: 0e 94 62 63 call 0xc6c4 ; 0xc6c4 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { c730: d1 fd sbrc r29, 1 c732: 04 c0 rjmp .+8 ; 0xc73c // _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 c734: 8c 2f mov r24, r28 c736: 82 95 swap r24 c738: 0e 94 62 63 call 0xc6c4 ; 0xc6c4 } #endif delayMicroseconds(duration); c73c: c8 01 movw r24, r16 } c73e: df 91 pop r29 c740: cf 91 pop r28 c742: 1f 91 pop r17 c744: 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); c746: 0c 94 61 e9 jmp 0x1d2c2 ; 0x1d2c2 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); c74a: 5d 98 cbi 0x0b, 5 ; 11 c74c: ea cf rjmp .-44 ; 0xc722 0000c74e : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { c74e: cf 92 push r12 c750: df 92 push r13 c752: ef 92 push r14 c754: ff 92 push r15 c756: cf 93 push r28 c758: df 93 push r29 c75a: ec 01 movw r28, r24 c75c: 6a 01 movw r12, r20 c75e: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) c760: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 c764: 6f 3f cpi r22, 0xFF ; 255 c766: 7f 4f sbci r23, 0xFF ; 255 c768: 8f 4f sbci r24, 0xFF ; 255 c76a: 9f 4f sbci r25, 0xFF ; 255 c76c: 59 f4 brne .+22 ; 0xc784 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); c76e: b7 01 movw r22, r14 c770: a6 01 movw r20, r12 c772: 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); } c774: df 91 pop r29 c776: cf 91 pop r28 c778: ff 90 pop r15 c77a: ef 90 pop r14 c77c: df 90 pop r13 c77e: 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); c780: 0d 94 aa dc jmp 0x3b954 ; 0x3b954 } 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); } c784: df 91 pop r29 c786: cf 91 pop r28 c788: ff 90 pop r15 c78a: ef 90 pop r14 c78c: df 90 pop r13 c78e: cf 90 pop r12 c790: 08 95 ret 0000c792 : /// 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)); c792: 80 e1 ldi r24, 0x10 ; 16 c794: e2 e9 ldi r30, 0x92 ; 146 c796: f6 e0 ldi r31, 0x06 ; 6 c798: a3 e7 ldi r26, 0x73 ; 115 c79a: b2 e0 ldi r27, 0x02 ; 2 c79c: 01 90 ld r0, Z+ c79e: 0d 92 st X+, r0 c7a0: 8a 95 dec r24 c7a2: e1 f7 brne .-8 ; 0xc79c saved_feedmultiply2 = feedmultiply; //save feedmultiply c7a4: 80 91 39 02 lds r24, 0x0239 ; 0x800239 c7a8: 90 91 3a 02 lds r25, 0x023A ; 0x80023a c7ac: 90 93 72 03 sts 0x0372, r25 ; 0x800372 c7b0: 80 93 71 03 sts 0x0371, r24 ; 0x800371 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); c7b4: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 c7b8: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 c7bc: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad c7c0: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_bed_temperature = (uint8_t)degTargetBed(); c7c4: 80 91 72 06 lds r24, 0x0672 ; 0x800672 c7c8: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; c7cc: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 c7d0: 83 fb bst r24, 3 c7d2: 88 27 eor r24, r24 c7d4: 80 f9 bld r24, 0 c7d6: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; c7da: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 c7de: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab isPartialBackupAvailable = true; c7e2: 81 e0 ldi r24, 0x01 ; 1 c7e4: 80 93 a2 06 sts 0x06A2, r24 ; 0x8006a2 } c7e8: 08 95 ret 0000c7ea <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } c7ea: cf 93 push r28 c7ec: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { c7ee: 80 e2 ldi r24, 0x20 ; 32 c7f0: 97 e1 ldi r25, 0x17 ; 23 c7f2: 0e 94 b1 76 call 0xed62 ; 0xed62 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader c7f6: 8e e5 ldi r24, 0x5E ; 94 c7f8: 95 e1 ldi r25, 0x15 ; 21 c7fa: 89 2b or r24, r25 c7fc: 51 f0 breq .+20 ; 0xc812 <_GLOBAL__sub_D_card+0x28> c7fe: c0 e3 ldi r28, 0x30 ; 48 c800: d6 e1 ldi r29, 0x16 ; 22 c802: a3 97 sbiw r28, 0x23 ; 35 c804: ce 01 movw r24, r28 c806: 0e 94 b1 76 call 0xed62 ; 0xed62 c80a: 85 e1 ldi r24, 0x15 ; 21 c80c: ce 35 cpi r28, 0x5E ; 94 c80e: d8 07 cpc r29, r24 c810: c1 f7 brne .-16 ; 0xc802 <_GLOBAL__sub_D_card+0x18> c812: 8b e3 ldi r24, 0x3B ; 59 c814: 95 e1 ldi r25, 0x15 ; 21 c816: 0e 94 b1 76 call 0xed62 ; 0xed62 c81a: 86 e1 ldi r24, 0x16 ; 22 c81c: 95 e1 ldi r25, 0x15 ; 21 c81e: df 91 pop r29 c820: cf 91 pop r28 c822: 0c 94 b1 76 jmp 0xed62 ; 0xed62 0000c826 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { c826: cf 93 push r28 c828: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; c82a: c2 e9 ldi r28, 0x92 ; 146 c82c: d6 e0 ldi r29, 0x06 ; 6 c82e: 20 e0 ldi r18, 0x00 ; 0 c830: 30 e0 ldi r19, 0x00 ; 0 c832: 48 ec ldi r20, 0xC8 ; 200 c834: 51 e4 ldi r21, 0x41 ; 65 c836: 6c 85 ldd r22, Y+12 ; 0x0c c838: 7d 85 ldd r23, Y+13 ; 0x0d c83a: 8e 85 ldd r24, Y+14 ; 0x0e c83c: 9f 85 ldd r25, Y+15 ; 0x0f c83e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> c842: 6c 87 std Y+12, r22 ; 0x0c c844: 7d 87 std Y+13, r23 ; 0x0d c846: 8e 87 std Y+14, r24 ; 0x0e c848: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c84a: 63 e3 ldi r22, 0x33 ; 51 c84c: 73 e3 ldi r23, 0x33 ; 51 c84e: 83 e5 ldi r24, 0x53 ; 83 c850: 90 e4 ldi r25, 0x40 ; 64 } c852: df 91 pop r29 c854: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c856: 0d 94 81 c0 jmp 0x38102 ; 0x38102 0000c85a : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); c85a: 60 e0 ldi r22, 0x00 ; 0 c85c: 85 ea ldi r24, 0xA5 ; 165 c85e: 9f e0 ldi r25, 0x0F ; 15 c860: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 c864: 60 e0 ldi r22, 0x00 ; 0 c866: 8f e7 ldi r24, 0x7F ; 127 c868: 9c e0 ldi r25, 0x0C ; 12 c86a: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 // 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; c86e: 80 e0 ldi r24, 0x00 ; 0 c870: 90 e0 ldi r25, 0x00 ; 0 c872: a0 e8 ldi r26, 0x80 ; 128 c874: bf eb ldi r27, 0xBF ; 191 c876: 80 93 83 02 sts 0x0283, r24 ; 0x800283 c87a: 90 93 84 02 sts 0x0284, r25 ; 0x800284 c87e: a0 93 85 02 sts 0x0285, r26 ; 0x800285 c882: b0 93 86 02 sts 0x0286, r27 ; 0x800286 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c886: 82 e0 ldi r24, 0x02 ; 2 c888: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; c88c: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 } c890: 08 95 ret 0000c892 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) c892: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac c896: 90 91 ad 05 lds r25, 0x05AD ; 0x8005ad c89a: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 c89e: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 c8a2: 28 17 cp r18, r24 c8a4: 39 07 cpc r19, r25 c8a6: 71 f0 breq .+28 ; 0xc8c4 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; c8a8: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 c8ac: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; c8b0: 81 e0 ldi r24, 0x01 ; 1 c8b2: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 wait_for_heater(_millis(), active_extruder); c8b6: 0f 94 51 2a call 0x254a2 ; 0x254a2 c8ba: 0f 94 1c 83 call 0x30638 ; 0x30638 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; c8be: 82 e0 ldi r24, 0x02 ; 2 c8c0: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 } } c8c4: 08 95 ret 0000c8c6 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { c8c6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 c8ca: 88 23 and r24, r24 c8cc: 41 f0 breq .+16 ; 0xc8de // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; c8ce: 80 91 39 02 lds r24, 0x0239 ; 0x800239 c8d2: 90 91 3a 02 lds r25, 0x023A ; 0x80023a c8d6: 90 93 72 03 sts 0x0372, r25 ; 0x800372 c8da: 80 93 71 03 sts 0x0371, r24 ; 0x800371 } c8de: 08 95 ret 0000c8e0 : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) c8e0: 80 91 a1 05 lds r24, 0x05A1 ; 0x8005a1 c8e4: 90 91 a2 05 lds r25, 0x05A2 ; 0x8005a2 c8e8: 00 97 sbiw r24, 0x00 ; 0 c8ea: 29 f1 breq .+74 ; 0xc936 c8ec: 20 91 a8 0d lds r18, 0x0DA8 ; 0x800da8 c8f0: 21 11 cpse r18, r1 c8f2: 21 c0 rjmp .+66 ; 0xc936 c8f4: 20 91 a7 0d lds r18, 0x0DA7 ; 0x800da7 c8f8: 21 11 cpse r18, r1 c8fa: 1d c0 rjmp .+58 ; 0xc936 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); c8fc: fc 01 movw r30, r24 c8fe: e8 5a subi r30, 0xA8 ; 168 c900: ff 4f sbci r31, 0xFF ; 255 c902: 20 e1 ldi r18, 0x10 ; 16 c904: a3 e8 ldi r26, 0x83 ; 131 c906: b2 e0 ldi r27, 0x02 ; 2 c908: 01 90 ld r0, Z+ c90a: 0d 92 st X+, r0 c90c: 2a 95 dec r18 c90e: e1 f7 brne .-8 ; 0xc908 saved_feedrate2 = current_block->gcode_feedrate; c910: fc 01 movw r30, r24 c912: e6 59 subi r30, 0x96 ; 150 c914: ff 4f sbci r31, 0xFF ; 255 c916: 20 81 ld r18, Z c918: 31 81 ldd r19, Z+1 ; 0x01 c91a: 30 93 5f 05 sts 0x055F, r19 ; 0x80055f c91e: 20 93 5e 05 sts 0x055E, r18 ; 0x80055e saved_segment_idx = current_block->segment_idx; c922: 88 59 subi r24, 0x98 ; 152 c924: 9f 4f sbci r25, 0xFF ; 255 c926: fc 01 movw r30, r24 c928: 80 81 ld r24, Z c92a: 91 81 ldd r25, Z+1 ; 0x01 c92c: 90 93 6a 05 sts 0x056A, r25 ; 0x80056a c930: 80 93 69 05 sts 0x0569, r24 ; 0x800569 c934: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; c936: 80 e0 ldi r24, 0x00 ; 0 c938: 90 e0 ldi r25, 0x00 ; 0 c93a: a0 e8 ldi r26, 0x80 ; 128 c93c: bf eb ldi r27, 0xBF ; 191 c93e: 80 93 83 02 sts 0x0283, r24 ; 0x800283 c942: 90 93 84 02 sts 0x0284, r25 ; 0x800284 c946: a0 93 85 02 sts 0x0285, r26 ; 0x800285 c94a: b0 93 86 02 sts 0x0286, r27 ; 0x800286 saved_feedrate2 = feedrate; c94e: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 c952: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 c956: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba c95a: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb c95e: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> c962: 70 93 5f 05 sts 0x055F, r23 ; 0x80055f c966: 60 93 5e 05 sts 0x055E, r22 ; 0x80055e saved_segment_idx = 0; c96a: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a c96e: 10 92 69 05 sts 0x0569, r1 ; 0x800569 } } c972: 08 95 ret 0000c974 : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { c974: cf 92 push r12 c976: df 92 push r13 c978: ef 92 push r14 c97a: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { c97c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 c980: 88 23 and r24, r24 c982: d9 f1 breq .+118 ; 0xc9fa saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue c984: 80 91 82 03 lds r24, 0x0382 ; 0x800382 c988: 90 91 83 03 lds r25, 0x0383 ; 0x800383 c98c: a0 91 84 03 lds r26, 0x0384 ; 0x800384 c990: b0 91 85 03 lds r27, 0x0385 ; 0x800385 c994: 80 93 60 05 sts 0x0560, r24 ; 0x800560 c998: 90 93 61 05 sts 0x0561, r25 ; 0x800561 c99c: a0 93 62 05 sts 0x0562, r26 ; 0x800562 c9a0: b0 93 63 05 sts 0x0563, r27 ; 0x800563 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner c9a4: 0f 94 6a 64 call 0x2c8d4 ; 0x2c8d4 saved_sdpos -= sdlen_planner; c9a8: c0 90 60 05 lds r12, 0x0560 ; 0x800560 c9ac: d0 90 61 05 lds r13, 0x0561 ; 0x800561 c9b0: e0 90 62 05 lds r14, 0x0562 ; 0x800562 c9b4: f0 90 63 05 lds r15, 0x0563 ; 0x800563 c9b8: c8 1a sub r12, r24 c9ba: d9 0a sbc r13, r25 c9bc: e1 08 sbc r14, r1 c9be: f1 08 sbc r15, r1 c9c0: c0 92 60 05 sts 0x0560, r12 ; 0x800560 c9c4: d0 92 61 05 sts 0x0561, r13 ; 0x800561 c9c8: e0 92 62 05 sts 0x0562, r14 ; 0x800562 c9cc: f0 92 63 05 sts 0x0563, r15 ; 0x800563 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue c9d0: 0e 94 93 5a call 0xb526 ; 0xb526 saved_sdpos -= sdlen_cmdqueue; c9d4: c8 1a sub r12, r24 c9d6: d9 0a sbc r13, r25 c9d8: e1 08 sbc r14, r1 c9da: f1 08 sbc r15, r1 c9dc: c0 92 60 05 sts 0x0560, r12 ; 0x800560 c9e0: d0 92 61 05 sts 0x0561, r13 ; 0x800561 c9e4: e0 92 62 05 sts 0x0562, r14 ; 0x800562 c9e8: f0 92 63 05 sts 0x0563, r15 ; 0x800563 saved_printing_type = PowerPanic::PRINT_TYPE_SD; c9ec: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } c9f0: ff 90 pop r15 c9f2: ef 90 pop r14 c9f4: df 90 pop r13 c9f6: cf 90 pop r12 c9f8: 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 c9fa: 80 91 0e 05 lds r24, 0x050E ; 0x80050e c9fe: 88 23 and r24, r24 ca00: b1 f1 breq .+108 ; 0xca6e saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue ca02: 80 91 7a 03 lds r24, 0x037A ; 0x80037a ca06: 90 91 7b 03 lds r25, 0x037B ; 0x80037b ca0a: a0 91 7c 03 lds r26, 0x037C ; 0x80037c ca0e: b0 91 7d 03 lds r27, 0x037D ; 0x80037d ca12: 80 93 60 05 sts 0x0560, r24 ; 0x800560 ca16: 90 93 61 05 sts 0x0561, r25 ; 0x800561 ca1a: a0 93 62 05 sts 0x0562, r26 ; 0x800562 ca1e: b0 93 63 05 sts 0x0563, r27 ; 0x800563 //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 ca22: 0f 94 6a 64 call 0x2c8d4 ; 0x2c8d4 saved_sdpos -= nlines; ca26: 40 91 60 05 lds r20, 0x0560 ; 0x800560 ca2a: 50 91 61 05 lds r21, 0x0561 ; 0x800561 ca2e: 60 91 62 05 lds r22, 0x0562 ; 0x800562 ca32: 70 91 63 05 lds r23, 0x0563 ; 0x800563 ca36: 48 1b sub r20, r24 ca38: 51 09 sbc r21, r1 ca3a: 61 09 sbc r22, r1 ca3c: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer ca3e: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 ca42: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 ca46: 09 2e mov r0, r25 ca48: 00 0c add r0, r0 ca4a: aa 0b sbc r26, r26 ca4c: bb 0b sbc r27, r27 ca4e: 48 1b sub r20, r24 ca50: 59 0b sbc r21, r25 ca52: 6a 0b sbc r22, r26 ca54: 7b 0b sbc r23, r27 ca56: 40 93 60 05 sts 0x0560, r20 ; 0x800560 ca5a: 50 93 61 05 sts 0x0561, r21 ; 0x800561 ca5e: 60 93 62 05 sts 0x0562, r22 ; 0x800562 ca62: 70 93 63 05 sts 0x0563, r23 ; 0x800563 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; ca66: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; ca68: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a ca6c: c1 cf rjmp .-126 ; 0xc9f0 ca6e: 82 e0 ldi r24, 0x02 ; 2 ca70: fb cf rjmp .-10 ; 0xca68 0000ca72 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { ca72: cf 92 push r12 ca74: df 92 push r13 ca76: ef 92 push r14 ca78: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); ca7a: c0 90 56 0e lds r12, 0x0E56 ; 0x800e56 ca7e: d0 90 57 0e lds r13, 0x0E57 ; 0x800e57 ca82: e0 90 58 0e lds r14, 0x0E58 ; 0x800e58 ca86: f0 90 59 0e lds r15, 0x0E59 ; 0x800e59 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { ca8a: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 ca8e: 88 23 and r24, r24 ca90: 09 f4 brne .+2 ; 0xca94 ca92: 4e c0 rjmp .+156 ; 0xcb30 ca94: 20 e0 ldi r18, 0x00 ; 0 ca96: 30 e0 ldi r19, 0x00 ; 0 ca98: a9 01 movw r20, r18 ca9a: c7 01 movw r24, r14 ca9c: b6 01 movw r22, r12 ca9e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> caa2: 18 16 cp r1, r24 caa4: 0c f0 brlt .+2 ; 0xcaa8 caa6: 44 c0 rjmp .+136 ; 0xcb30 float area = M_PI * diameter * diameter * 0.25; caa8: 2b ed ldi r18, 0xDB ; 219 caaa: 3f e0 ldi r19, 0x0F ; 15 caac: 49 e4 ldi r20, 0x49 ; 73 caae: 50 e4 ldi r21, 0x40 ; 64 cab0: c7 01 movw r24, r14 cab2: b6 01 movw r22, r12 cab4: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> cab8: a7 01 movw r20, r14 caba: 96 01 movw r18, r12 cabc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> cac0: 20 e0 ldi r18, 0x00 ; 0 cac2: 30 e0 ldi r19, 0x00 ; 0 cac4: 40 e8 ldi r20, 0x80 ; 128 cac6: 5e e3 ldi r21, 0x3E ; 62 cac8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> cacc: 9b 01 movw r18, r22 cace: ac 01 movw r20, r24 out = 1.f / area; cad0: 60 e0 ldi r22, 0x00 ; 0 cad2: 70 e0 ldi r23, 0x00 ; 0 cad4: 80 e8 ldi r24, 0x80 ; 128 cad6: 9f e3 ldi r25, 0x3F ; 63 cad8: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> cadc: 6b 01 movw r12, r22 cade: 7c 01 movw r14, r24 } if (extrudemultiply != 100) cae0: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc cae4: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd cae8: 64 36 cpi r22, 0x64 ; 100 caea: 71 05 cpc r23, r1 caec: a1 f0 breq .+40 ; 0xcb16 out *= float(extrudemultiply) * 0.01f; caee: 07 2e mov r0, r23 caf0: 00 0c add r0, r0 caf2: 88 0b sbc r24, r24 caf4: 99 0b sbc r25, r25 caf6: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> cafa: 2a e0 ldi r18, 0x0A ; 10 cafc: 37 ed ldi r19, 0xD7 ; 215 cafe: 43 e2 ldi r20, 0x23 ; 35 cb00: 5c e3 ldi r21, 0x3C ; 60 cb02: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> cb06: 9b 01 movw r18, r22 cb08: ac 01 movw r20, r24 cb0a: c7 01 movw r24, r14 cb0c: b6 01 movw r22, r12 cb0e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> cb12: 6b 01 movw r12, r22 cb14: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cb16: c0 92 93 02 sts 0x0293, r12 ; 0x800293 cb1a: d0 92 94 02 sts 0x0294, r13 ; 0x800294 cb1e: e0 92 95 02 sts 0x0295, r14 ; 0x800295 cb22: f0 92 96 02 sts 0x0296, r15 ; 0x800296 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 } cb26: ff 90 pop r15 cb28: ef 90 pop r14 cb2a: df 90 pop r13 cb2c: cf 90 pop r12 cb2e: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; cb30: c1 2c mov r12, r1 cb32: d1 2c mov r13, r1 cb34: 80 e8 ldi r24, 0x80 ; 128 cb36: e8 2e mov r14, r24 cb38: 8f e3 ldi r24, 0x3F ; 63 cb3a: f8 2e mov r15, r24 cb3c: d1 cf rjmp .-94 ; 0xcae0 0000cb3e : } } #endif //FAST_PWM_FAN void save_statistics() { cb3e: 8f 92 push r8 cb40: 9f 92 push r9 cb42: af 92 push r10 cb44: bf 92 push r11 cb46: cf 92 push r12 cb48: df 92 push r13 cb4a: ef 92 push r14 cb4c: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: centimeter cb4e: 81 ef ldi r24, 0xF1 ; 241 cb50: 9f e0 ldi r25, 0x0F ; 15 cb52: 0f 94 98 7b call 0x2f730 ; 0x2f730 cb56: 6b 01 movw r12, r22 cb58: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cb5a: 8d ee ldi r24, 0xED ; 237 cb5c: 9f e0 ldi r25, 0x0F ; 15 cb5e: 0f 94 98 7b call 0x2f730 ; 0x2f730 cb62: 4b 01 movw r8, r22 cb64: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; cb66: 0f 94 a8 3f call 0x27f50 ; 0x27f50 cb6a: 2c e3 ldi r18, 0x3C ; 60 cb6c: 30 e0 ldi r19, 0x00 ; 0 cb6e: 40 e0 ldi r20, 0x00 ; 0 cb70: 50 e0 ldi r21, 0x00 ; 0 cb72: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min cb76: ba 01 movw r22, r20 cb78: a9 01 movw r20, r18 cb7a: 48 0d add r20, r8 cb7c: 59 1d adc r21, r9 cb7e: 6a 1d adc r22, r10 cb80: 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); cb82: 8d ee ldi r24, 0xED ; 237 cb84: 9f e0 ldi r25, 0x0F ; 15 cb86: 0f 94 8a dc call 0x3b914 ; 0x3b914 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); cb8a: 60 91 65 06 lds r22, 0x0665 ; 0x800665 cb8e: 70 91 66 06 lds r23, 0x0666 ; 0x800666 cb92: 80 91 67 06 lds r24, 0x0667 ; 0x800667 cb96: 90 91 68 06 lds r25, 0x0668 ; 0x800668 cb9a: 28 ee ldi r18, 0xE8 ; 232 cb9c: 33 e0 ldi r19, 0x03 ; 3 cb9e: 40 e0 ldi r20, 0x00 ; 0 cba0: 50 e0 ldi r21, 0x00 ; 0 cba2: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> cba6: ba 01 movw r22, r20 cba8: a9 01 movw r20, r18 cbaa: 4c 0d add r20, r12 cbac: 5d 1d adc r21, r13 cbae: 6e 1d adc r22, r14 cbb0: 7f 1d adc r23, r15 cbb2: 81 ef ldi r24, 0xF1 ; 241 cbb4: 9f e0 ldi r25, 0x0F ; 15 cbb6: 0f 94 8a dc call 0x3b914 ; 0x3b914 print_job_timer.reset(); cbba: 0f 94 77 43 call 0x286ee ; 0x286ee total_filament_used = 0; cbbe: 10 92 65 06 sts 0x0665, r1 ; 0x800665 cbc2: 10 92 66 06 sts 0x0666, r1 ; 0x800666 cbc6: 10 92 67 06 sts 0x0667, r1 ; 0x800667 cbca: 10 92 68 06 sts 0x0668, r1 ; 0x800668 if (MMU2::mmu2.Enabled()) { cbce: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba cbd2: 81 30 cpi r24, 0x01 ; 1 cbd4: 81 f4 brne .+32 ; 0xcbf6 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); cbd6: 60 91 be 13 lds r22, 0x13BE ; 0x8013be cbda: 70 91 bf 13 lds r23, 0x13BF ; 0x8013bf cbde: 90 e0 ldi r25, 0x00 ; 0 cbe0: 80 e0 ldi r24, 0x00 ; 0 cbe2: 0f 94 80 7b call 0x2f700 ; 0x2f700 /// @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; }; cbe6: 10 92 bf 13 sts 0x13BF, r1 ; 0x8013bf cbea: 10 92 be 13 sts 0x13BE, r1 ; 0x8013be inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } cbee: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 cbf2: 10 92 c0 13 sts 0x13C0, r1 ; 0x8013c0 // @@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 } } cbf6: ff 90 pop r15 cbf8: ef 90 pop r14 cbfa: df 90 pop r13 cbfc: cf 90 pop r12 cbfe: bf 90 pop r11 cc00: af 90 pop r10 cc02: 9f 90 pop r9 cc04: 8f 90 pop r8 cc06: 08 95 ret 0000cc08 : } #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); cc08: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 cc0c: 1f 92 push r1 cc0e: 8f 93 push r24 cc10: 80 91 6b 03 lds r24, 0x036B ; 0x80036b cc14: 1f 92 push r1 cc16: 8f 93 push r24 cc18: e9 ec ldi r30, 0xC9 ; 201 cc1a: f3 e0 ldi r31, 0x03 ; 3 cc1c: 42 81 ldd r20, Z+2 ; 0x02 cc1e: 53 81 ldd r21, Z+3 ; 0x03 cc20: 2c e3 ldi r18, 0x3C ; 60 cc22: 24 9f mul r18, r20 cc24: c0 01 movw r24, r0 cc26: 25 9f mul r18, r21 cc28: 90 0d add r25, r0 cc2a: 11 24 eor r1, r1 cc2c: 9f 93 push r25 cc2e: 8f 93 push r24 cc30: 40 81 ld r20, Z cc32: 51 81 ldd r21, Z+1 ; 0x01 cc34: 24 9f mul r18, r20 cc36: c0 01 movw r24, r0 cc38: 25 9f mul r18, r21 cc3a: 90 0d add r25, r0 cc3c: 11 24 eor r1, r1 cc3e: 9f 93 push r25 cc40: 8f 93 push r24 cc42: 8e e7 ldi r24, 0x7E ; 126 cc44: 95 e6 ldi r25, 0x65 ; 101 cc46: 9f 93 push r25 cc48: 8f 93 push r24 cc4a: 0f 94 16 db call 0x3b62c ; 0x3b62c cc4e: 8d b7 in r24, 0x3d ; 61 cc50: 9e b7 in r25, 0x3e ; 62 cc52: 0a 96 adiw r24, 0x0a ; 10 cc54: 0f b6 in r0, 0x3f ; 63 cc56: f8 94 cli cc58: 9e bf out 0x3e, r25 ; 62 cc5a: 0f be out 0x3f, r0 ; 63 cc5c: 8d bf out 0x3d, r24 ; 61 } cc5e: 08 95 ret 0000cc60 : // 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) { cc60: cf 93 push r28 cc62: 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); cc64: 8f ef ldi r24, 0xFF ; 255 cc66: 9f e0 ldi r25, 0x0F ; 15 cc68: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { cc6c: 81 30 cpi r24, 0x01 ; 1 cc6e: 21 f0 breq .+8 ; 0xcc78 cc70: 80 91 8c 06 lds r24, 0x068C ; 0x80068c cc74: 81 30 cpi r24, 0x01 ; 1 cc76: 29 f4 brne .+10 ; 0xcc82 //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); cc78: 81 e0 ldi r24, 0x01 ; 1 cc7a: 8c 27 eor r24, r28 } } cc7c: 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); cc7e: 0c 94 09 60 jmp 0xc012 ; 0xc012 } } cc82: cf 91 pop r28 cc84: 08 95 ret 0000cc86 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cc86: 86 e8 ldi r24, 0x86 ; 134 cc88: 93 e0 ldi r25, 0x03 ; 3 cc8a: 0d 94 f4 2c jmp 0x259e8 ; 0x259e8 ::start()> 0000cc8e : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cc8e: 20 e0 ldi r18, 0x00 ; 0 cc90: 30 e0 ldi r19, 0x00 ; 0 cc92: 40 e7 ldi r20, 0x70 ; 112 cc94: 52 e4 ldi r21, 0x42 ; 66 cc96: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> } cc9a: 08 95 ret 0000cc9c : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cc9c: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> //! @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; cca0: 40 91 66 03 lds r20, 0x0366 ; 0x800366 cca4: 50 91 67 03 lds r21, 0x0367 ; 0x800367 cca8: 60 91 68 03 lds r22, 0x0368 ; 0x800368 ccac: 70 91 69 03 lds r23, 0x0369 ; 0x800369 ccb0: 40 93 b8 02 sts 0x02B8, r20 ; 0x8002b8 ccb4: 50 93 b9 02 sts 0x02B9, r21 ; 0x8002b9 ccb8: 60 93 ba 02 sts 0x02BA, r22 ; 0x8002ba ccbc: 70 93 bb 02 sts 0x02BB, r23 ; 0x8002bb feedmultiply = original_feedmultiply; ccc0: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a ccc4: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); ccc8: 86 e8 ldi r24, 0x86 ; 134 ccca: 93 e0 ldi r25, 0x03 ; 3 cccc: 0d 94 f4 2c jmp 0x259e8 ; 0x259e8 ::start()> 0000ccd0 : 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) { ccd0: 1f 93 push r17 ccd2: cf 93 push r28 ccd4: df 93 push r29 ccd6: 18 2f mov r17, r24 saved_feedrate = feedrate; ccd8: 80 91 b8 02 lds r24, 0x02B8 ; 0x8002b8 ccdc: 90 91 b9 02 lds r25, 0x02B9 ; 0x8002b9 cce0: a0 91 ba 02 lds r26, 0x02BA ; 0x8002ba cce4: b0 91 bb 02 lds r27, 0x02BB ; 0x8002bb cce8: 80 93 66 03 sts 0x0366, r24 ; 0x800366 ccec: 90 93 67 03 sts 0x0367, r25 ; 0x800367 ccf0: a0 93 68 03 sts 0x0368, r26 ; 0x800368 ccf4: b0 93 69 03 sts 0x0369, r27 ; 0x800369 int l_feedmultiply = feedmultiply; ccf8: c0 91 39 02 lds r28, 0x0239 ; 0x800239 ccfc: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; cd00: 84 e6 ldi r24, 0x64 ; 100 cd02: 90 e0 ldi r25, 0x00 ; 0 cd04: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cd08: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cd0c: 86 e8 ldi r24, 0x86 ; 134 cd0e: 93 e0 ldi r25, 0x03 ; 3 cd10: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> cd14: 10 93 b7 02 sts 0x02B7, r17 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(enable_endstops_now); return l_feedmultiply; } cd18: ce 01 movw r24, r28 cd1a: df 91 pop r29 cd1c: cf 91 pop r28 cd1e: 1f 91 pop r17 cd20: 08 95 ret 0000cd22 : cd22: 40 e0 ldi r20, 0x00 ; 0 cd24: 50 e0 ldi r21, 0x00 ; 0 cd26: ba 01 movw r22, r20 cd28: 8d ee ldi r24, 0xED ; 237 cd2a: 9f e0 ldi r25, 0x0F ; 15 cd2c: 0f 94 8a dc call 0x3b914 ; 0x3b914 cd30: 40 e0 ldi r20, 0x00 ; 0 cd32: 50 e0 ldi r21, 0x00 ; 0 cd34: ba 01 movw r22, r20 cd36: 81 ef ldi r24, 0xF1 ; 241 cd38: 9f e0 ldi r25, 0x0F ; 15 cd3a: 0f 94 8a dc call 0x3b914 ; 0x3b914 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(); cd3e: 0e 94 a4 5b call 0xb748 ; 0xb748 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); cd42: 70 e0 ldi r23, 0x00 ; 0 cd44: 60 e0 ldi r22, 0x00 ; 0 cd46: 85 e0 ldi r24, 0x05 ; 5 cd48: 9f e0 ldi r25, 0x0F ; 15 cd4a: 0f 94 96 dc call 0x3b92c ; 0x3b92c cd4e: 70 e0 ldi r23, 0x00 ; 0 cd50: 60 e0 ldi r22, 0x00 ; 0 cd52: 83 e0 ldi r24, 0x03 ; 3 cd54: 9f e0 ldi r25, 0x0F ; 15 cd56: 0f 94 96 dc call 0x3b92c ; 0x3b92c cd5a: 70 e0 ldi r23, 0x00 ; 0 cd5c: 60 e0 ldi r22, 0x00 ; 0 cd5e: 81 e0 ldi r24, 0x01 ; 1 cd60: 9f e0 ldi r25, 0x0F ; 15 cd62: 0f 94 96 dc call 0x3b92c ; 0x3b92c cd66: 70 e0 ldi r23, 0x00 ; 0 cd68: 60 e0 ldi r22, 0x00 ; 0 cd6a: 8f ef ldi r24, 0xFF ; 255 cd6c: 9e e0 ldi r25, 0x0E ; 14 cd6e: 0f 94 96 dc call 0x3b92c ; 0x3b92c cd72: 70 e0 ldi r23, 0x00 ; 0 cd74: 60 e0 ldi r22, 0x00 ; 0 cd76: 83 ed ldi r24, 0xD3 ; 211 cd78: 9e e0 ldi r25, 0x0E ; 14 cd7a: 0f 94 96 dc call 0x3b92c ; 0x3b92c cd7e: 70 e0 ldi r23, 0x00 ; 0 cd80: 60 e0 ldi r22, 0x00 ; 0 cd82: 80 ed ldi r24, 0xD0 ; 208 cd84: 9e e0 ldi r25, 0x0E ; 14 cd86: 0f 94 96 dc call 0x3b92c ; 0x3b92c if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); cd8a: 40 e0 ldi r20, 0x00 ; 0 cd8c: 50 e0 ldi r21, 0x00 ; 0 cd8e: ba 01 movw r22, r20 cd90: 88 ea ldi r24, 0xA8 ; 168 cd92: 9c e0 ldi r25, 0x0C ; 12 cd94: 0d 94 8a dc jmp 0x3b914 ; 0x3b914 0000cd98 : wdt_disable(); } } void softReset(void) { cli(); cd98: 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" ); cd9a: 88 e1 ldi r24, 0x18 ; 24 cd9c: 98 e0 ldi r25, 0x08 ; 8 cd9e: 0f b6 in r0, 0x3f ; 63 cda0: f8 94 cli cda2: a8 95 wdr cda4: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cda8: 0f be out 0x3f, r0 ; 63 cdaa: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cdae: ff cf rjmp .-2 ; 0xcdae 0000cdb0 : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { cdb0: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); cdb2: 9f b7 in r25, 0x3f ; 63 cdb4: f8 94 cli cdb6: e2 e0 ldi r30, 0x02 ; 2 cdb8: f1 e0 ldi r31, 0x01 ; 1 cdba: 80 81 ld r24, Z cdbc: 84 60 ori r24, 0x04 ; 4 cdbe: 80 83 st Z, r24 cdc0: 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); cdc2: 6c 2f mov r22, r28 cdc4: 83 e0 ldi r24, 0x03 ; 3 cdc6: 9d e0 ldi r25, 0x0D ; 13 cdc8: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); cdcc: 8c 2f mov r24, r28 cdce: 0e 94 9a ee call 0x1dd34 ; 0x1dd34 #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); cdd2: 0e 94 cc 66 call 0xcd98 ; 0xcd98 0000cdd6 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { cdd6: 1f 92 push r1 cdd8: 0f 92 push r0 cdda: 0f b6 in r0, 0x3f ; 63 cddc: 0f 92 push r0 cdde: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); cde0: 83 e0 ldi r24, 0x03 ; 3 cde2: 0e 94 d8 66 call 0xcdb0 ; 0xcdb0 0000cde6 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { cde6: 1f 92 push r1 cde8: 0f 92 push r0 cdea: 0f b6 in r0, 0x3f ; 63 cdec: 0f 92 push r0 cdee: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); cdf0: 82 e0 ldi r24, 0x02 ; 2 cdf2: 0e 94 d8 66 call 0xcdb0 ; 0xcdb0 0000cdf6 : } #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); cdf6: 85 ea ldi r24, 0xA5 ; 165 cdf8: 9f e0 ldi r25, 0x0F ; 15 cdfa: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 cdfe: 91 e0 ldi r25, 0x01 ; 1 ce00: 81 11 cpse r24, r1 ce02: 01 c0 rjmp .+2 ; 0xce06 ce04: 90 e0 ldi r25, 0x00 ; 0 } ce06: 89 2f mov r24, r25 ce08: 08 95 ret 0000ce0a : 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(); ce0a: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 ce0e: 81 11 cpse r24, r1 ce10: 06 c0 rjmp .+12 ; 0xce1e ce12: 81 e0 ldi r24, 0x01 ; 1 ce14: 90 91 9d 03 lds r25, 0x039D ; 0x80039d ce18: 92 30 cpi r25, 0x02 ; 2 ce1a: 09 f0 breq .+2 ; 0xce1e ce1c: 80 e0 ldi r24, 0x00 ; 0 } ce1e: 08 95 ret 0000ce20 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); ce20: 80 91 90 14 lds r24, 0x1490 ; 0x801490 ce24: 81 11 cpse r24, r1 ce26: 0a c0 rjmp .+20 ; 0xce3c ce28: 80 91 0e 05 lds r24, 0x050E ; 0x80050e ce2c: 81 11 cpse r24, r1 ce2e: 06 c0 rjmp .+12 ; 0xce3c ce30: 81 e0 ldi r24, 0x01 ; 1 ce32: 90 91 9d 03 lds r25, 0x039D ; 0x80039d ce36: 91 30 cpi r25, 0x01 ; 1 ce38: 09 f0 breq .+2 ; 0xce3c ce3a: 80 e0 ldi r24, 0x00 ; 0 } ce3c: 08 95 ret 0000ce3e : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { ce3e: cf 93 push r28 ce40: df 93 push r29 return ( !homing_flag ce42: c0 91 a7 0d lds r28, 0x0DA7 ; 0x800da7 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) ce46: c1 11 cpse r28, r1 ce48: 1f c0 rjmp .+62 ; 0xce88 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag ce4a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 ce4e: 81 11 cpse r24, r1 ce50: 1c c0 rjmp .+56 ; 0xce8a && !printingIsPaused() ce52: 0e 94 05 67 call 0xce0a ; 0xce0a ce56: 81 11 cpse r24, r1 ce58: 18 c0 rjmp .+48 ; 0xce8a && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) ce5a: d0 91 b4 0d lds r29, 0x0DB4 ; 0x800db4 ce5e: d4 30 cpi r29, 0x04 ; 4 ce60: 61 f4 brne .+24 ; 0xce7a ce62: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 ce66: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 ce6a: 89 2b or r24, r25 ce6c: 91 f4 brne .+36 ; 0xce92 ce6e: 80 91 72 06 lds r24, 0x0672 ; 0x800672 ce72: 90 91 73 06 lds r25, 0x0673 ; 0x800673 ce76: 89 2b or r24, r25 ce78: 61 f4 brne .+24 ; 0xce92 || printJobOngoing() ce7a: 0e 94 10 67 call 0xce20 ; 0xce20 ce7e: c8 2f mov r28, r24 ce80: 81 11 cpse r24, r1 ce82: 03 c0 rjmp .+6 ; 0xce8a || lcd_commands_type == LcdCommands::Idle ce84: c1 e0 ldi r28, 0x01 ; 1 ce86: 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) ce88: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } ce8a: 8c 2f mov r24, r28 ce8c: df 91 pop r29 ce8e: cf 91 pop r28 ce90: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) ce92: c1 e0 ldi r28, 0x01 ; 1 ce94: fa cf rjmp .-12 ; 0xce8a 0000ce96 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); ce96: 0e 94 1f 67 call 0xce3e ; 0xce3e ce9a: 88 23 and r24, r24 ce9c: 89 f0 breq .+34 ; 0xcec0 ce9e: 20 e0 ldi r18, 0x00 ; 0 cea0: 30 e0 ldi r19, 0x00 ; 0 cea2: 40 e0 ldi r20, 0x00 ; 0 cea4: 50 e4 ldi r21, 0x40 ; 64 cea6: 60 91 9a 06 lds r22, 0x069A ; 0x80069a ceaa: 70 91 9b 06 lds r23, 0x069B ; 0x80069b ceae: 80 91 9c 06 lds r24, 0x069C ; 0x80069c ceb2: 90 91 9d 06 lds r25, 0x069D ; 0x80069d ceb6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> ceba: 88 1f adc r24, r24 cebc: 88 27 eor r24, r24 cebe: 88 1f adc r24, r24 } cec0: 08 95 ret 0000cec2 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() cec2: 0e 94 10 67 call 0xce20 ; 0xce20 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; cec6: 81 11 cpse r24, r1 cec8: 18 c0 rjmp .+48 ; 0xcefa return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() ceca: 0e 94 05 67 call 0xce0a ; 0xce0a cece: 81 11 cpse r24, r1 ced0: 14 c0 rjmp .+40 ; 0xcefa || saved_printing ced2: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 ced6: 81 11 cpse r24, r1 ced8: 10 c0 rjmp .+32 ; 0xcefa || (lcd_commands_type != LcdCommands::Idle) ceda: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 cede: 81 11 cpse r24, r1 cee0: 0b c0 rjmp .+22 ; 0xcef8 || MMU2::mmu2.MMU_PRINT_SAVED() cee2: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb cee6: 81 11 cpse r24, r1 cee8: 07 c0 rjmp .+14 ; 0xcef8 || homing_flag ceea: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 ceee: 81 11 cpse r24, r1 cef0: 04 c0 rjmp .+8 ; 0xcefa || mesh_bed_leveling_flag; cef2: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 cef6: 08 95 ret cef8: 81 e0 ldi r24, 0x01 ; 1 } cefa: 08 95 ret 0000cefc : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; cefc: fc 01 movw r30, r24 cefe: 20 81 ld r18, Z cf00: 21 11 cpse r18, r1 cf02: 01 c0 rjmp .+2 ; 0xcf06 cf04: 66 95 lsr r22 cf06: fc 01 movw r30, r24 cf08: 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() } cf0a: 08 95 ret 0000cf0c : 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) { cf0c: fc 01 movw r30, r24 iRun = ir; cf0e: 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); cf10: 21 e0 ldi r18, 0x01 ; 1 cf12: 60 32 cpi r22, 0x20 ; 32 cf14: 08 f0 brcs .+2 ; 0xcf18 cf16: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { cf18: 90 81 ld r25, Z cf1a: 29 17 cp r18, r25 cf1c: 81 f0 breq .+32 ; 0xcf3e cf1e: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { cf20: 99 23 and r25, r25 cf22: 51 f0 breq .+20 ; 0xcf38 // 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; cf24: 90 e0 ldi r25, 0x00 ; 0 cf26: 95 95 asr r25 cf28: 87 95 ror r24 cf2a: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; cf2c: 70 e0 ldi r23, 0x00 ; 0 cf2e: 75 95 asr r23 cf30: 67 95 ror r22 cf32: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; cf34: 20 83 st Z, r18 cf36: 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; cf38: 88 0f add r24, r24 cf3a: 82 83 std Z+2, r24 ; 0x02 cf3c: fb cf rjmp .-10 ; 0xcf34 } // Update vSense vSense = newvSense; } else if (!vSense) { cf3e: 21 11 cpse r18, r1 cf40: 04 c0 rjmp .+8 ; 0xcf4a // 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; cf42: 70 e0 ldi r23, 0x00 ; 0 cf44: 75 95 asr r23 cf46: 67 95 ror r22 cf48: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } cf4a: 08 95 ret 0000cf4c : } #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; } cf4c: 20 91 92 12 lds r18, 0x1292 ; 0x801292 cf50: 30 91 93 12 lds r19, 0x1293 ; 0x801293 cf54: bc 01 movw r22, r24 cf56: c9 01 movw r24, r18 cf58: 88 55 subi r24, 0x58 ; 88 cf5a: 9f 4e sbci r25, 0xEF ; 239 cf5c: 0f 94 5b da call 0x3b4b6 ; 0x3b4b6 cf60: 9c 01 movw r18, r24 cf62: 90 93 96 03 sts 0x0396, r25 ; 0x800396 cf66: 80 93 95 03 sts 0x0395, r24 ; 0x800395 cf6a: 81 e0 ldi r24, 0x01 ; 1 cf6c: 23 2b or r18, r19 cf6e: 09 f4 brne .+2 ; 0xcf72 cf70: 80 e0 ldi r24, 0x00 ; 0 cf72: 08 95 ret 0000cf74 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } cf74: 80 e1 ldi r24, 0x10 ; 16 cf76: e2 e9 ldi r30, 0x92 ; 146 cf78: f6 e0 ldi r31, 0x06 ; 6 cf7a: a4 e7 ldi r26, 0x74 ; 116 cf7c: b6 e0 ldi r27, 0x06 ; 6 cf7e: 01 90 ld r0, Z+ cf80: 0d 92 st X+, r0 cf82: 8a 95 dec r24 cf84: e1 f7 brne .-8 ; 0xcf7e cf86: 08 95 ret 0000cf88 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { cf88: 4f 92 push r4 cf8a: 5f 92 push r5 cf8c: 6f 92 push r6 cf8e: 7f 92 push r7 cf90: 8f 92 push r8 cf92: 9f 92 push r9 cf94: af 92 push r10 cf96: bf 92 push r11 cf98: cf 92 push r12 cf9a: df 92 push r13 cf9c: ef 92 push r14 cf9e: ff 92 push r15 cfa0: 0f 93 push r16 cfa2: 1f 93 push r17 cfa4: cf 93 push r28 cfa6: df 93 push r29 cfa8: 00 d0 rcall .+0 ; 0xcfaa cfaa: 00 d0 rcall .+0 ; 0xcfac cfac: 1f 92 push r1 cfae: 1f 92 push r1 cfb0: cd b7 in r28, 0x3d ; 61 cfb2: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; cfb4: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 cfb8: 22 23 and r18, r18 cfba: 09 f4 brne .+2 ; 0xcfbe cfbc: 73 c1 rjmp .+742 ; 0xd2a4 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; cfbe: 20 91 e6 03 lds r18, 0x03E6 ; 0x8003e6 cfc2: 22 30 cpi r18, 0x02 ; 2 cfc4: 09 f4 brne .+2 ; 0xcfc8 cfc6: 6e c1 rjmp .+732 ; 0xd2a4 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb cfc8: 20 91 e6 03 lds r18, 0x03E6 ; 0x8003e6 cfcc: 21 30 cpi r18, 0x01 ; 1 cfce: 11 f4 brne .+4 ; 0xcfd4 cfd0: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 cfd4: 2b 01 movw r4, r22 cfd6: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; cfd8: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) cfdc: 10 91 ae 05 lds r17, 0x05AE ; 0x8005ae cfe0: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee cfe4: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef cfe8: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 cfec: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 cff0: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> cff4: 61 17 cp r22, r17 cff6: 31 f0 breq .+12 ; 0xd004 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; cff8: 81 2f mov r24, r17 cffa: 90 e0 ldi r25, 0x00 ; 0 cffc: 90 93 73 06 sts 0x0673, r25 ; 0x800673 d000: 80 93 72 06 sts 0x0672, r24 ; 0x800672 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d004: 0e 94 49 64 call 0xc892 ; 0xc892 // Restore saved fan speed fanSpeed = saved_fan_speed; d008: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab d00c: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d010: 90 91 e5 03 lds r25, 0x03E5 ; 0x8003e5 d014: 80 91 64 05 lds r24, 0x0564 ; 0x800564 d018: 81 95 neg r24 d01a: 89 27 eor r24, r25 d01c: 88 70 andi r24, 0x08 ; 8 d01e: 89 27 eor r24, r25 d020: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 float e = saved_pos[E_AXIS] - e_move; d024: a3 01 movw r20, r6 d026: 92 01 movw r18, r4 d028: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d02c: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d030: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d034: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d038: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d03c: 6d 83 std Y+5, r22 ; 0x05 d03e: 7e 83 std Y+6, r23 ; 0x06 d040: 8f 83 std Y+7, r24 ; 0x07 d042: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d044: ce 01 movw r24, r28 d046: 05 96 adiw r24, 0x05 ; 5 d048: 0f 94 f9 64 call 0x2c9f2 ; 0x2c9f2 #ifdef FANCHECK fans_check_enabled = false; d04c: 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) d050: 20 e0 ldi r18, 0x00 ; 0 d052: 30 e0 ldi r19, 0x00 ; 0 d054: 40 e8 ldi r20, 0x80 ; 128 d056: 5f eb ldi r21, 0xBF ; 191 d058: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d05c: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d060: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d064: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d068: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> d06c: 81 11 cpse r24, r1 d06e: 20 c0 rjmp .+64 ; 0xd0b0 { saved_pos[X_AXIS] = current_position[X_AXIS]; d070: 80 91 92 06 lds r24, 0x0692 ; 0x800692 d074: 90 91 93 06 lds r25, 0x0693 ; 0x800693 d078: a0 91 94 06 lds r26, 0x0694 ; 0x800694 d07c: b0 91 95 06 lds r27, 0x0695 ; 0x800695 d080: 80 93 73 02 sts 0x0273, r24 ; 0x800273 d084: 90 93 74 02 sts 0x0274, r25 ; 0x800274 d088: a0 93 75 02 sts 0x0275, r26 ; 0x800275 d08c: b0 93 76 02 sts 0x0276, r27 ; 0x800276 saved_pos[Y_AXIS] = current_position[Y_AXIS]; d090: 80 91 96 06 lds r24, 0x0696 ; 0x800696 d094: 90 91 97 06 lds r25, 0x0697 ; 0x800697 d098: a0 91 98 06 lds r26, 0x0698 ; 0x800698 d09c: b0 91 99 06 lds r27, 0x0699 ; 0x800699 d0a0: 80 93 77 02 sts 0x0277, r24 ; 0x800277 d0a4: 90 93 78 02 sts 0x0278, r25 ; 0x800278 d0a8: a0 93 79 02 sts 0x0279, r26 ; 0x800279 d0ac: b0 93 7a 02 sts 0x027A, r27 ; 0x80027a } //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); d0b0: a3 01 movw r20, r6 d0b2: 92 01 movw r18, r4 d0b4: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d0b8: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d0bc: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d0c0: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d0c4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d0c8: 69 83 std Y+1, r22 ; 0x01 d0ca: 7a 83 std Y+2, r23 ; 0x02 d0cc: 8b 83 std Y+3, r24 ; 0x03 d0ce: 9c 83 std Y+4, r25 ; 0x04 d0d0: e0 90 9a 06 lds r14, 0x069A ; 0x80069a d0d4: f0 90 9b 06 lds r15, 0x069B ; 0x80069b d0d8: 00 91 9c 06 lds r16, 0x069C ; 0x80069c d0dc: 10 91 9d 06 lds r17, 0x069D ; 0x80069d d0e0: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d0e4: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d0e8: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d0ec: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d0f0: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d0f4: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d0f8: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d0fc: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d100: 1f 92 push r1 d102: 1f 92 push r1 d104: 1f 92 push r1 d106: 1f 92 push r1 d108: e2 e6 ldi r30, 0x62 ; 98 d10a: 8e 2e mov r8, r30 d10c: e7 e2 ldi r30, 0x27 ; 39 d10e: 9e 2e mov r9, r30 d110: e6 e7 ldi r30, 0x76 ; 118 d112: ae 2e mov r10, r30 d114: e2 e4 ldi r30, 0x42 ; 66 d116: be 2e mov r11, r30 d118: fe 01 movw r30, r28 d11a: 31 96 adiw r30, 0x01 ; 1 d11c: 6f 01 movw r12, r30 d11e: 0f 94 2c b1 call 0x36258 ; 0x36258 //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); d122: a3 01 movw r20, r6 d124: 92 01 movw r18, r4 d126: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d12a: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d12e: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d132: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d136: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d13a: 69 83 std Y+1, r22 ; 0x01 d13c: 7a 83 std Y+2, r23 ; 0x02 d13e: 8b 83 std Y+3, r24 ; 0x03 d140: 9c 83 std Y+4, r25 ; 0x04 d142: e0 90 7b 02 lds r14, 0x027B ; 0x80027b d146: f0 90 7c 02 lds r15, 0x027C ; 0x80027c d14a: 00 91 7d 02 lds r16, 0x027D ; 0x80027d d14e: 10 91 7e 02 lds r17, 0x027E ; 0x80027e d152: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d156: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d15a: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d15e: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d162: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d166: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d16a: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d16e: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d172: 1f 92 push r1 d174: 1f 92 push r1 d176: 1f 92 push r1 d178: 1f 92 push r1 d17a: 0f 94 2c b1 call 0x36258 ; 0x36258 //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); d17e: e0 90 7b 02 lds r14, 0x027B ; 0x80027b d182: f0 90 7c 02 lds r15, 0x027C ; 0x80027c d186: 00 91 7d 02 lds r16, 0x027D ; 0x80027d d18a: 10 91 7e 02 lds r17, 0x027E ; 0x80027e d18e: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d192: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d196: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d19a: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d19e: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d1a2: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d1a6: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d1aa: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d1ae: 1f 92 push r1 d1b0: 1f 92 push r1 d1b2: 1f 92 push r1 d1b4: 1f 92 push r1 d1b6: 81 2c mov r8, r1 d1b8: 91 2c mov r9, r1 d1ba: f8 ee ldi r31, 0xE8 ; 232 d1bc: af 2e mov r10, r31 d1be: f2 e4 ldi r31, 0x42 ; 66 d1c0: bf 2e mov r11, r31 d1c2: af e7 ldi r26, 0x7F ; 127 d1c4: ca 2e mov r12, r26 d1c6: a2 e0 ldi r26, 0x02 ; 2 d1c8: da 2e mov r13, r26 d1ca: 0f 94 2c b1 call 0x36258 ; 0x36258 st_synchronize(); d1ce: 0f 94 ed 43 call 0x287da ; 0x287da #ifdef FANCHECK fans_check_enabled = true; d1d2: 11 e0 ldi r17, 0x01 ; 1 d1d4: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d1d8: 60 91 5e 05 lds r22, 0x055E ; 0x80055e d1dc: 70 91 5f 05 lds r23, 0x055F ; 0x80055f d1e0: 90 e0 ldi r25, 0x00 ; 0 d1e2: 80 e0 ldi r24, 0x00 ; 0 d1e4: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> d1e8: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 d1ec: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 d1f0: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba d1f4: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb feedmultiply = saved_feedmultiply2; d1f8: 80 91 71 03 lds r24, 0x0371 ; 0x800371 d1fc: 90 91 72 03 lds r25, 0x0372 ; 0x800372 d200: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d204: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d208: 80 e1 ldi r24, 0x10 ; 16 d20a: e3 e7 ldi r30, 0x73 ; 115 d20c: f2 e0 ldi r31, 0x02 ; 2 d20e: a2 e9 ldi r26, 0x92 ; 146 d210: b6 e0 ldi r27, 0x06 ; 6 d212: 01 90 ld r0, Z+ d214: 0d 92 st X+, r0 d216: 8a 95 dec r24 d218: e1 f7 brne .-8 ; 0xd212 set_destination_to_current(); d21a: 0e 94 ba 67 call 0xcf74 ; 0xcf74 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d21e: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d222: 0f b6 in r0, 0x3f ; 63 d224: f8 94 cli d226: de bf out 0x3e, r29 ; 62 d228: 0f be out 0x3f, r0 ; 63 d22a: cd bf out 0x3d, r28 ; 61 d22c: 81 11 cpse r24, r1 d22e: 51 c0 rjmp .+162 ; 0xd2d2 card.setIndex(saved_sdpos); d230: 60 91 60 05 lds r22, 0x0560 ; 0x800560 d234: 70 91 61 05 lds r23, 0x0561 ; 0x800561 d238: 80 91 62 05 lds r24, 0x0562 ; 0x800562 d23c: 90 91 63 05 lds r25, 0x0563 ; 0x800563 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; d240: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 d244: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 d248: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 d24c: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 d250: 0f 94 d7 76 call 0x2edae ; 0x2edae sdpos_atomic = saved_sdpos; d254: 80 91 60 05 lds r24, 0x0560 ; 0x800560 d258: 90 91 61 05 lds r25, 0x0561 ; 0x800561 d25c: a0 91 62 05 lds r26, 0x0562 ; 0x800562 d260: b0 91 63 05 lds r27, 0x0563 ; 0x800563 d264: 80 93 82 03 sts 0x0382, r24 ; 0x800382 d268: 90 93 83 03 sts 0x0383, r25 ; 0x800383 d26c: a0 93 84 03 sts 0x0384, r26 ; 0x800384 d270: b0 93 85 03 sts 0x0385, r27 ; 0x800385 card.sdprinting = true; d274: 10 93 90 14 sts 0x1490, r17 ; 0x801490 d278: 60 e0 ldi r22, 0x00 ; 0 d27a: 85 ea ldi r24, 0xA5 ; 165 d27c: 9f e0 ldi r25, 0x0F ; 15 d27e: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 d282: 60 e0 ldi r22, 0x00 ; 0 d284: 8f e7 ldi r24, 0x7F ; 127 d286: 9c e0 ldi r25, 0x0C ; 12 d288: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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); d28c: 8f ec ldi r24, 0xCF ; 207 d28e: 9f e6 ldi r25, 0x6F ; 111 d290: 0e 94 3b f2 call 0x1e476 ; 0x1e476 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d294: 82 e0 ldi r24, 0x02 ; 2 d296: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d29a: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 planner_aborted = true; // unroll the stack d29e: 81 e0 ldi r24, 0x01 ; 1 d2a0: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } d2a4: 28 96 adiw r28, 0x08 ; 8 d2a6: 0f b6 in r0, 0x3f ; 63 d2a8: f8 94 cli d2aa: de bf out 0x3e, r29 ; 62 d2ac: 0f be out 0x3f, r0 ; 63 d2ae: cd bf out 0x3d, r28 ; 61 d2b0: df 91 pop r29 d2b2: cf 91 pop r28 d2b4: 1f 91 pop r17 d2b6: 0f 91 pop r16 d2b8: ff 90 pop r15 d2ba: ef 90 pop r14 d2bc: df 90 pop r13 d2be: cf 90 pop r12 d2c0: bf 90 pop r11 d2c2: af 90 pop r10 d2c4: 9f 90 pop r9 d2c6: 8f 90 pop r8 d2c8: 7f 90 pop r7 d2ca: 6f 90 pop r6 d2cc: 5f 90 pop r5 d2ce: 4f 90 pop r4 d2d0: 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 d2d2: 81 30 cpi r24, 0x01 ; 1 d2d4: 89 f6 brne .-94 ; 0xd278 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d2d6: 80 91 60 05 lds r24, 0x0560 ; 0x800560 d2da: 90 91 61 05 lds r25, 0x0561 ; 0x800561 d2de: a0 91 62 05 lds r26, 0x0562 ; 0x800562 d2e2: b0 91 63 05 lds r27, 0x0563 ; 0x800563 d2e6: 80 93 7a 03 sts 0x037A, r24 ; 0x80037a d2ea: 90 93 7b 03 sts 0x037B, r25 ; 0x80037b d2ee: a0 93 7c 03 sts 0x037C, r26 ; 0x80037c d2f2: b0 93 7d 03 sts 0x037D, r27 ; 0x80037d serial_count = 0; d2f6: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f d2fa: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e FlushSerialRequestResend(); d2fe: 0e 94 0d 5b call 0xb61a ; 0xb61a d302: ba cf rjmp .-140 ; 0xd278 0000d304 : 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) { d304: 3f 92 push r3 d306: 4f 92 push r4 d308: 5f 92 push r5 d30a: 6f 92 push r6 d30c: 7f 92 push r7 d30e: 8f 92 push r8 d310: 9f 92 push r9 d312: af 92 push r10 d314: bf 92 push r11 d316: cf 92 push r12 d318: df 92 push r13 d31a: ef 92 push r14 d31c: ff 92 push r15 d31e: 0f 93 push r16 d320: 1f 93 push r17 d322: cf 93 push r28 d324: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d326: 30 90 0f 18 lds r3, 0x180F ; 0x80180f d32a: 33 20 and r3, r3 d32c: 09 f4 brne .+2 ; 0xd330 d32e: 80 c0 rjmp .+256 ; 0xd430 d330: 8b 01 movw r16, r22 d332: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d334: 31 fe sbrs r3, 1 d336: 54 c0 rjmp .+168 ; 0xd3e0 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d338: 88 80 ld r8, Y d33a: 99 80 ldd r9, Y+1 ; 0x01 d33c: aa 80 ldd r10, Y+2 ; 0x02 d33e: bb 80 ldd r11, Y+3 ; 0x03 d340: fb 01 movw r30, r22 d342: c0 80 ld r12, Z d344: d1 80 ldd r13, Z+1 ; 0x01 d346: e2 80 ldd r14, Z+2 ; 0x02 d348: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d34a: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 d34e: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 d352: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 d356: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 d35a: c5 01 movw r24, r10 d35c: b4 01 movw r22, r8 d35e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d362: 2b 01 movw r4, r22 d364: 3c 01 movw r6, r24 d366: 20 91 e8 17 lds r18, 0x17E8 ; 0x8017e8 d36a: 30 91 e9 17 lds r19, 0x17E9 ; 0x8017e9 d36e: 40 91 ea 17 lds r20, 0x17EA ; 0x8017ea d372: 50 91 eb 17 lds r21, 0x17EB ; 0x8017eb d376: c7 01 movw r24, r14 d378: b6 01 movw r22, r12 d37a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d37e: 9b 01 movw r18, r22 d380: ac 01 movw r20, r24 d382: c3 01 movw r24, r6 d384: b2 01 movw r22, r4 d386: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d38a: 2b 01 movw r4, r22 d38c: 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; d38e: 20 91 dc 17 lds r18, 0x17DC ; 0x8017dc d392: 30 91 dd 17 lds r19, 0x17DD ; 0x8017dd d396: 40 91 de 17 lds r20, 0x17DE ; 0x8017de d39a: 50 91 df 17 lds r21, 0x17DF ; 0x8017df d39e: c5 01 movw r24, r10 d3a0: b4 01 movw r22, r8 d3a2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d3a6: 4b 01 movw r8, r22 d3a8: 5c 01 movw r10, r24 d3aa: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 d3ae: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 d3b2: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 d3b6: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 d3ba: c7 01 movw r24, r14 d3bc: b6 01 movw r22, r12 d3be: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d3c2: 9b 01 movw r18, r22 d3c4: ac 01 movw r20, r24 d3c6: c5 01 movw r24, r10 d3c8: b4 01 movw r22, r8 d3ca: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d3ce: 68 83 st Y, r22 d3d0: 79 83 std Y+1, r23 ; 0x01 d3d2: 8a 83 std Y+2, r24 ; 0x02 d3d4: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d3d6: f8 01 movw r30, r16 d3d8: 40 82 st Z, r4 d3da: 51 82 std Z+1, r5 ; 0x01 d3dc: 62 82 std Z+2, r6 ; 0x02 d3de: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d3e0: 30 fe sbrs r3, 0 d3e2: 26 c0 rjmp .+76 ; 0xd430 // Then add the offset. x += world2machine_shift[0]; d3e4: 20 91 07 18 lds r18, 0x1807 ; 0x801807 d3e8: 30 91 08 18 lds r19, 0x1808 ; 0x801808 d3ec: 40 91 09 18 lds r20, 0x1809 ; 0x801809 d3f0: 50 91 0a 18 lds r21, 0x180A ; 0x80180a d3f4: 68 81 ld r22, Y d3f6: 79 81 ldd r23, Y+1 ; 0x01 d3f8: 8a 81 ldd r24, Y+2 ; 0x02 d3fa: 9b 81 ldd r25, Y+3 ; 0x03 d3fc: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d400: 68 83 st Y, r22 d402: 79 83 std Y+1, r23 ; 0x01 d404: 8a 83 std Y+2, r24 ; 0x02 d406: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d408: 20 91 0b 18 lds r18, 0x180B ; 0x80180b d40c: 30 91 0c 18 lds r19, 0x180C ; 0x80180c d410: 40 91 0d 18 lds r20, 0x180D ; 0x80180d d414: 50 91 0e 18 lds r21, 0x180E ; 0x80180e d418: f8 01 movw r30, r16 d41a: 60 81 ld r22, Z d41c: 71 81 ldd r23, Z+1 ; 0x01 d41e: 82 81 ldd r24, Z+2 ; 0x02 d420: 93 81 ldd r25, Z+3 ; 0x03 d422: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d426: f8 01 movw r30, r16 d428: 60 83 st Z, r22 d42a: 71 83 std Z+1, r23 ; 0x01 d42c: 82 83 std Z+2, r24 ; 0x02 d42e: 93 83 std Z+3, r25 ; 0x03 } } } d430: df 91 pop r29 d432: cf 91 pop r28 d434: 1f 91 pop r17 d436: 0f 91 pop r16 d438: ff 90 pop r15 d43a: ef 90 pop r14 d43c: df 90 pop r13 d43e: cf 90 pop r12 d440: bf 90 pop r11 d442: af 90 pop r10 d444: 9f 90 pop r9 d446: 8f 90 pop r8 d448: 7f 90 pop r7 d44a: 6f 90 pop r6 d44c: 5f 90 pop r5 d44e: 4f 90 pop r4 d450: 3f 90 pop r3 d452: 08 95 ret 0000d454 : } } } inline bool world2machine_clamp(float &x, float &y) { d454: 2f 92 push r2 d456: 3f 92 push r3 d458: 4f 92 push r4 d45a: 5f 92 push r5 d45c: 6f 92 push r6 d45e: 7f 92 push r7 d460: 8f 92 push r8 d462: 9f 92 push r9 d464: af 92 push r10 d466: bf 92 push r11 d468: cf 92 push r12 d46a: df 92 push r13 d46c: ef 92 push r14 d46e: ff 92 push r15 d470: 0f 93 push r16 d472: 1f 93 push r17 d474: cf 93 push r28 d476: df 93 push r29 d478: 00 d0 rcall .+0 ; 0xd47a d47a: 00 d0 rcall .+0 ; 0xd47c d47c: 1f 92 push r1 d47e: 1f 92 push r1 d480: cd b7 in r28, 0x3d ; 61 d482: de b7 in r29, 0x3e ; 62 d484: 8c 01 movw r16, r24 d486: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d488: fc 01 movw r30, r24 d48a: 80 81 ld r24, Z d48c: 91 81 ldd r25, Z+1 ; 0x01 d48e: a2 81 ldd r26, Z+2 ; 0x02 d490: b3 81 ldd r27, Z+3 ; 0x03 d492: 89 83 std Y+1, r24 ; 0x01 d494: 9a 83 std Y+2, r25 ; 0x02 d496: ab 83 std Y+3, r26 ; 0x03 d498: bc 83 std Y+4, r27 ; 0x04 out_y = y; d49a: fb 01 movw r30, r22 d49c: 80 81 ld r24, Z d49e: 91 81 ldd r25, Z+1 ; 0x01 d4a0: a2 81 ldd r26, Z+2 ; 0x02 d4a2: b3 81 ldd r27, Z+3 ; 0x03 d4a4: 8d 83 std Y+5, r24 ; 0x05 d4a6: 9e 83 std Y+6, r25 ; 0x06 d4a8: af 83 std Y+7, r26 ; 0x07 d4aa: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d4ac: be 01 movw r22, r28 d4ae: 6b 5f subi r22, 0xFB ; 251 d4b0: 7f 4f sbci r23, 0xFF ; 255 d4b2: ce 01 movw r24, r28 d4b4: 01 96 adiw r24, 0x01 ; 1 d4b6: 0e 94 82 69 call 0xd304 ; 0xd304 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d4ba: c9 80 ldd r12, Y+1 ; 0x01 d4bc: da 80 ldd r13, Y+2 ; 0x02 d4be: eb 80 ldd r14, Y+3 ; 0x03 d4c0: fc 80 ldd r15, Y+4 ; 0x04 d4c2: 20 e0 ldi r18, 0x00 ; 0 d4c4: 30 e0 ldi r19, 0x00 ; 0 d4c6: a9 01 movw r20, r18 d4c8: c7 01 movw r24, r14 d4ca: b6 01 movw r22, r12 d4cc: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> d4d0: 87 ff sbrs r24, 7 d4d2: 35 c0 rjmp .+106 ; 0xd53e tmpx = X_MIN_POS; d4d4: 19 82 std Y+1, r1 ; 0x01 d4d6: 1a 82 std Y+2, r1 ; 0x02 d4d8: 1b 82 std Y+3, r1 ; 0x03 d4da: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d4dc: ff 24 eor r15, r15 d4de: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d4e0: 8d 80 ldd r8, Y+5 ; 0x05 d4e2: 9e 80 ldd r9, Y+6 ; 0x06 d4e4: af 80 ldd r10, Y+7 ; 0x07 d4e6: b8 84 ldd r11, Y+8 ; 0x08 d4e8: 20 e0 ldi r18, 0x00 ; 0 d4ea: 30 e0 ldi r19, 0x00 ; 0 d4ec: 40 e8 ldi r20, 0x80 ; 128 d4ee: 50 ec ldi r21, 0xC0 ; 192 d4f0: c5 01 movw r24, r10 d4f2: b4 01 movw r22, r8 d4f4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> d4f8: 87 ff sbrs r24, 7 d4fa: 35 c0 rjmp .+106 ; 0xd566 tmpy = Y_MIN_POS; d4fc: 80 e0 ldi r24, 0x00 ; 0 d4fe: 90 e0 ldi r25, 0x00 ; 0 d500: a0 e8 ldi r26, 0x80 ; 128 d502: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d504: 8d 83 std Y+5, r24 ; 0x05 d506: 9e 83 std Y+6, r25 ; 0x06 d508: af 83 std Y+7, r26 ; 0x07 d50a: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d50c: cd 80 ldd r12, Y+5 ; 0x05 d50e: de 80 ldd r13, Y+6 ; 0x06 d510: ef 80 ldd r14, Y+7 ; 0x07 d512: f8 84 ldd r15, Y+8 ; 0x08 d514: 89 80 ldd r8, Y+1 ; 0x01 d516: 9a 80 ldd r9, Y+2 ; 0x02 d518: ab 80 ldd r10, Y+3 ; 0x03 d51a: 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) { d51c: 70 90 0f 18 lds r7, 0x180F ; 0x80180f d520: 71 10 cpse r7, r1 d522: 4c c0 rjmp .+152 ; 0xd5bc // No correction. out_x = x; d524: f8 01 movw r30, r16 d526: 80 82 st Z, r8 d528: 91 82 std Z+1, r9 ; 0x01 d52a: a2 82 std Z+2, r10 ; 0x02 d52c: b3 82 std Z+3, r11 ; 0x03 out_y = y; d52e: f1 01 movw r30, r2 d530: c0 82 st Z, r12 d532: d1 82 std Z+1, r13 ; 0x01 d534: e2 82 std Z+2, r14 ; 0x02 d536: 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) { d538: ff 24 eor r15, r15 d53a: f3 94 inc r15 d53c: 25 c0 rjmp .+74 ; 0xd588 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) { d53e: 20 e0 ldi r18, 0x00 ; 0 d540: 30 e0 ldi r19, 0x00 ; 0 d542: 4f e7 ldi r20, 0x7F ; 127 d544: 53 e4 ldi r21, 0x43 ; 67 d546: c7 01 movw r24, r14 d548: b6 01 movw r22, r12 d54a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d54e: 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) { d550: 18 16 cp r1, r24 d552: 34 f6 brge .-116 ; 0xd4e0 tmpx = X_MAX_POS; d554: 80 e0 ldi r24, 0x00 ; 0 d556: 90 e0 ldi r25, 0x00 ; 0 d558: af e7 ldi r26, 0x7F ; 127 d55a: b3 e4 ldi r27, 0x43 ; 67 d55c: 89 83 std Y+1, r24 ; 0x01 d55e: 9a 83 std Y+2, r25 ; 0x02 d560: ab 83 std Y+3, r26 ; 0x03 d562: bc 83 std Y+4, r27 ; 0x04 d564: bb cf rjmp .-138 ; 0xd4dc } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d566: 20 e0 ldi r18, 0x00 ; 0 d568: 30 e8 ldi r19, 0x80 ; 128 d56a: 44 e5 ldi r20, 0x54 ; 84 d56c: 53 e4 ldi r21, 0x43 ; 67 d56e: c5 01 movw r24, r10 d570: b4 01 movw r22, r8 d572: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> d576: 18 16 cp r1, r24 d578: 2c f4 brge .+10 ; 0xd584 tmpy = Y_MAX_POS; d57a: 80 e0 ldi r24, 0x00 ; 0 d57c: 90 e8 ldi r25, 0x80 ; 128 d57e: a4 e5 ldi r26, 0x54 ; 84 d580: b3 e4 ldi r27, 0x43 ; 67 d582: c0 cf rjmp .-128 ; 0xd504 clamped = true; } if (clamped) d584: f1 10 cpse r15, r1 d586: c2 cf rjmp .-124 ; 0xd50c machine2world(tmpx, tmpy, x, y); return clamped; } d588: 8f 2d mov r24, r15 d58a: 28 96 adiw r28, 0x08 ; 8 d58c: 0f b6 in r0, 0x3f ; 63 d58e: f8 94 cli d590: de bf out 0x3e, r29 ; 62 d592: 0f be out 0x3f, r0 ; 63 d594: cd bf out 0x3d, r28 ; 61 d596: df 91 pop r29 d598: cf 91 pop r28 d59a: 1f 91 pop r17 d59c: 0f 91 pop r16 d59e: ff 90 pop r15 d5a0: ef 90 pop r14 d5a2: df 90 pop r13 d5a4: cf 90 pop r12 d5a6: bf 90 pop r11 d5a8: af 90 pop r10 d5aa: 9f 90 pop r9 d5ac: 8f 90 pop r8 d5ae: 7f 90 pop r7 d5b0: 6f 90 pop r6 d5b2: 5f 90 pop r5 d5b4: 4f 90 pop r4 d5b6: 3f 90 pop r3 d5b8: 2f 90 pop r2 d5ba: 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) { d5bc: 70 fe sbrs r7, 0 d5be: 1c c0 rjmp .+56 ; 0xd5f8 // Then add the offset. x -= world2machine_shift[0]; d5c0: 20 91 07 18 lds r18, 0x1807 ; 0x801807 d5c4: 30 91 08 18 lds r19, 0x1808 ; 0x801808 d5c8: 40 91 09 18 lds r20, 0x1809 ; 0x801809 d5cc: 50 91 0a 18 lds r21, 0x180A ; 0x80180a d5d0: c5 01 movw r24, r10 d5d2: b4 01 movw r22, r8 d5d4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d5d8: 4b 01 movw r8, r22 d5da: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d5dc: 20 91 0b 18 lds r18, 0x180B ; 0x80180b d5e0: 30 91 0c 18 lds r19, 0x180C ; 0x80180c d5e4: 40 91 0d 18 lds r20, 0x180D ; 0x80180d d5e8: 50 91 0e 18 lds r21, 0x180E ; 0x80180e d5ec: c7 01 movw r24, r14 d5ee: b6 01 movw r22, r12 d5f0: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d5f4: 6b 01 movw r12, r22 d5f6: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d5f8: 71 fe sbrs r7, 1 d5fa: 9e cf rjmp .-196 ; 0xd538 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d5fc: 20 91 f7 17 lds r18, 0x17F7 ; 0x8017f7 d600: 30 91 f8 17 lds r19, 0x17F8 ; 0x8017f8 d604: 40 91 f9 17 lds r20, 0x17F9 ; 0x8017f9 d608: 50 91 fa 17 lds r21, 0x17FA ; 0x8017fa d60c: c5 01 movw r24, r10 d60e: b4 01 movw r22, r8 d610: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d614: 2b 01 movw r4, r22 d616: 3c 01 movw r6, r24 d618: 20 91 fb 17 lds r18, 0x17FB ; 0x8017fb d61c: 30 91 fc 17 lds r19, 0x17FC ; 0x8017fc d620: 40 91 fd 17 lds r20, 0x17FD ; 0x8017fd d624: 50 91 fe 17 lds r21, 0x17FE ; 0x8017fe d628: c7 01 movw r24, r14 d62a: b6 01 movw r22, r12 d62c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d630: 9b 01 movw r18, r22 d632: ac 01 movw r20, r24 d634: c3 01 movw r24, r6 d636: b2 01 movw r22, r4 d638: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d63c: f8 01 movw r30, r16 d63e: 60 83 st Z, r22 d640: 71 83 std Z+1, r23 ; 0x01 d642: 82 83 std Z+2, r24 ; 0x02 d644: 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; d646: 20 91 ff 17 lds r18, 0x17FF ; 0x8017ff d64a: 30 91 00 18 lds r19, 0x1800 ; 0x801800 d64e: 40 91 01 18 lds r20, 0x1801 ; 0x801801 d652: 50 91 02 18 lds r21, 0x1802 ; 0x801802 d656: c5 01 movw r24, r10 d658: b4 01 movw r22, r8 d65a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d65e: 4b 01 movw r8, r22 d660: 5c 01 movw r10, r24 d662: 20 91 03 18 lds r18, 0x1803 ; 0x801803 d666: 30 91 04 18 lds r19, 0x1804 ; 0x801804 d66a: 40 91 05 18 lds r20, 0x1805 ; 0x801805 d66e: 50 91 06 18 lds r21, 0x1806 ; 0x801806 d672: c7 01 movw r24, r14 d674: b6 01 movw r22, r12 d676: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d67a: 9b 01 movw r18, r22 d67c: ac 01 movw r20, r24 d67e: c5 01 movw r24, r10 d680: b4 01 movw r22, r8 d682: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d686: f1 01 movw r30, r2 d688: 60 83 st Z, r22 d68a: 71 83 std Z+1, r23 ; 0x01 d68c: 82 83 std Z+2, r24 ; 0x02 d68e: 93 83 std Z+3, r25 ; 0x03 d690: 53 cf rjmp .-346 ; 0xd538 0000d692 : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d692: cf 92 push r12 d694: df 92 push r13 d696: ef 92 push r14 d698: ff 92 push r15 d69a: cf 93 push r28 d69c: df 93 push r29 d69e: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d6a0: bc 01 movw r22, r24 d6a2: 6c 5f subi r22, 0xFC ; 252 d6a4: 7f 4f sbci r23, 0xFF ; 255 d6a6: 0e 94 2a 6a call 0xd454 ; 0xd454 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d6aa: c0 90 29 02 lds r12, 0x0229 ; 0x800229 d6ae: d0 90 2a 02 lds r13, 0x022A ; 0x80022a d6b2: e0 90 2b 02 lds r14, 0x022B ; 0x80022b d6b6: f0 90 2c 02 lds r15, 0x022C ; 0x80022c d6ba: a7 01 movw r20, r14 d6bc: 96 01 movw r18, r12 d6be: 68 85 ldd r22, Y+8 ; 0x08 d6c0: 79 85 ldd r23, Y+9 ; 0x09 d6c2: 8a 85 ldd r24, Y+10 ; 0x0a d6c4: 9b 85 ldd r25, Y+11 ; 0x0b d6c6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> d6ca: 87 ff sbrs r24, 7 d6cc: 04 c0 rjmp .+8 ; 0xd6d6 d6ce: c8 86 std Y+8, r12 ; 0x08 d6d0: d9 86 std Y+9, r13 ; 0x09 d6d2: ea 86 std Y+10, r14 ; 0x0a d6d4: 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]; d6d6: c0 90 1d 02 lds r12, 0x021D ; 0x80021d d6da: d0 90 1e 02 lds r13, 0x021E ; 0x80021e d6de: e0 90 1f 02 lds r14, 0x021F ; 0x80021f d6e2: f0 90 20 02 lds r15, 0x0220 ; 0x800220 d6e6: a7 01 movw r20, r14 d6e8: 96 01 movw r18, r12 d6ea: 68 85 ldd r22, Y+8 ; 0x08 d6ec: 79 85 ldd r23, Y+9 ; 0x09 d6ee: 8a 85 ldd r24, Y+10 ; 0x0a d6f0: 9b 85 ldd r25, Y+11 ; 0x0b d6f2: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> d6f6: 18 16 cp r1, r24 d6f8: 24 f4 brge .+8 ; 0xd702 d6fa: c8 86 std Y+8, r12 ; 0x08 d6fc: d9 86 std Y+9, r13 ; 0x09 d6fe: ea 86 std Y+10, r14 ; 0x0a d700: fb 86 std Y+11, r15 ; 0x0b } } d702: df 91 pop r29 d704: cf 91 pop r28 d706: ff 90 pop r15 d708: ef 90 pop r14 d70a: df 90 pop r13 d70c: cf 90 pop r12 d70e: 08 95 ret 0000d710 : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d710: 2f 92 push r2 d712: 3f 92 push r3 d714: 4f 92 push r4 d716: 5f 92 push r5 d718: 6f 92 push r6 d71a: 7f 92 push r7 d71c: 8f 92 push r8 d71e: 9f 92 push r9 d720: af 92 push r10 d722: bf 92 push r11 d724: cf 92 push r12 d726: df 92 push r13 d728: ef 92 push r14 d72a: ff 92 push r15 d72c: 0f 93 push r16 d72e: 1f 93 push r17 d730: cf 93 push r28 d732: df 93 push r29 d734: cd b7 in r28, 0x3d ; 61 d736: de b7 in r29, 0x3e ; 62 d738: a2 97 sbiw r28, 0x22 ; 34 d73a: 0f b6 in r0, 0x3f ; 63 d73c: f8 94 cli d73e: de bf out 0x3e, r29 ; 62 d740: 0f be out 0x3f, r0 ; 63 d742: cd bf out 0x3d, r28 ; 61 d744: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d746: 84 e7 ldi r24, 0x74 ; 116 d748: 96 e0 ldi r25, 0x06 ; 6 d74a: 0e 94 49 6b call 0xd692 ; 0xd692 previous_millis_cmd.start(); d74e: 86 e8 ldi r24, 0x86 ; 134 d750: 93 e0 ldi r25, 0x03 ; 3 d752: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::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])) { d756: 40 90 92 06 lds r4, 0x0692 ; 0x800692 d75a: 50 90 93 06 lds r5, 0x0693 ; 0x800693 d75e: 60 90 94 06 lds r6, 0x0694 ; 0x800694 d762: 70 90 95 06 lds r7, 0x0695 ; 0x800695 d766: c0 90 74 06 lds r12, 0x0674 ; 0x800674 d76a: d0 90 75 06 lds r13, 0x0675 ; 0x800675 d76e: e0 90 76 06 lds r14, 0x0676 ; 0x800676 d772: f0 90 77 06 lds r15, 0x0677 ; 0x800677 d776: a7 01 movw r20, r14 d778: 96 01 movw r18, r12 d77a: c3 01 movw r24, r6 d77c: b2 01 movw r22, r4 d77e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> d782: 81 11 cpse r24, r1 d784: 3f c0 rjmp .+126 ; 0xd804 d786: 20 91 78 06 lds r18, 0x0678 ; 0x800678 d78a: 30 91 79 06 lds r19, 0x0679 ; 0x800679 d78e: 40 91 7a 06 lds r20, 0x067A ; 0x80067a d792: 50 91 7b 06 lds r21, 0x067B ; 0x80067b d796: 60 91 96 06 lds r22, 0x0696 ; 0x800696 d79a: 70 91 97 06 lds r23, 0x0697 ; 0x800697 d79e: 80 91 98 06 lds r24, 0x0698 ; 0x800698 d7a2: 90 91 99 06 lds r25, 0x0699 ; 0x800699 d7a6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> d7aa: 81 11 cpse r24, r1 d7ac: 2b c0 rjmp .+86 ; 0xd804 plan_buffer_line_destinationXYZE(feedrate/60); d7ae: 20 e0 ldi r18, 0x00 ; 0 d7b0: 30 e0 ldi r19, 0x00 ; 0 d7b2: 40 e7 ldi r20, 0x70 ; 112 d7b4: 52 e4 ldi r21, 0x42 ; 66 d7b6: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 d7ba: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 d7be: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba d7c2: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb d7c6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> d7ca: 0f 94 4e c0 call 0x3809c ; 0x3809c #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); d7ce: 0e 94 7f 5a call 0xb4fe ; 0xb4fe } d7d2: a2 96 adiw r28, 0x22 ; 34 d7d4: 0f b6 in r0, 0x3f ; 63 d7d6: f8 94 cli d7d8: de bf out 0x3e, r29 ; 62 d7da: 0f be out 0x3f, r0 ; 63 d7dc: cd bf out 0x3d, r28 ; 61 d7de: df 91 pop r29 d7e0: cf 91 pop r28 d7e2: 1f 91 pop r17 d7e4: 0f 91 pop r16 d7e6: ff 90 pop r15 d7e8: ef 90 pop r14 d7ea: df 90 pop r13 d7ec: cf 90 pop r12 d7ee: bf 90 pop r11 d7f0: af 90 pop r10 d7f2: 9f 90 pop r9 d7f4: 8f 90 pop r8 d7f6: 7f 90 pop r7 d7f8: 6f 90 pop r6 d7fa: 5f 90 pop r5 d7fc: 4f 90 pop r4 d7fe: 3f 90 pop r3 d800: 2f 90 pop r2 d802: 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); d804: 60 91 39 02 lds r22, 0x0239 ; 0x800239 d808: 70 91 3a 02 lds r23, 0x023A ; 0x80023a d80c: 07 2e mov r0, r23 d80e: 00 0c add r0, r0 d810: 88 0b sbc r24, r24 d812: 99 0b sbc r25, r25 d814: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> d818: 20 91 b8 02 lds r18, 0x02B8 ; 0x8002b8 d81c: 30 91 b9 02 lds r19, 0x02B9 ; 0x8002b9 d820: 40 91 ba 02 lds r20, 0x02BA ; 0x8002ba d824: 50 91 bb 02 lds r21, 0x02BB ; 0x8002bb d828: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d82c: 2e e3 ldi r18, 0x3E ; 62 d82e: 33 ec ldi r19, 0xC3 ; 195 d830: 4e e2 ldi r20, 0x2E ; 46 d832: 59 e3 ldi r21, 0x39 ; 57 d834: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d838: 6f 83 std Y+7, r22 ; 0x07 d83a: 78 87 std Y+8, r23 ; 0x08 d83c: 89 87 std Y+9, r24 ; 0x09 d83e: 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) { d840: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 d844: 88 23 and r24, r24 d846: 09 f4 brne .+2 ; 0xd84a d848: 0f c1 rjmp .+542 ; 0xda68 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]; d84a: a3 01 movw r20, r6 d84c: 92 01 movw r18, r4 d84e: c7 01 movw r24, r14 d850: b6 01 movw r22, r12 d852: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d856: 2b 01 movw r4, r22 d858: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; d85a: 20 91 96 06 lds r18, 0x0696 ; 0x800696 d85e: 30 91 97 06 lds r19, 0x0697 ; 0x800697 d862: 40 91 98 06 lds r20, 0x0698 ; 0x800698 d866: 50 91 99 06 lds r21, 0x0699 ; 0x800699 d86a: 60 91 78 06 lds r22, 0x0678 ; 0x800678 d86e: 70 91 79 06 lds r23, 0x0679 ; 0x800679 d872: 80 91 7a 06 lds r24, 0x067A ; 0x80067a d876: 90 91 7b 06 lds r25, 0x067B ; 0x80067b d87a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d87e: 6b 87 std Y+11, r22 ; 0x0b d880: 7c 87 std Y+12, r23 ; 0x0c d882: 8d 87 std Y+13, r24 ; 0x0d d884: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); d886: c3 01 movw r24, r6 d888: b2 01 movw r22, r4 d88a: 9f 77 andi r25, 0x7F ; 127 d88c: 2b 85 ldd r18, Y+11 ; 0x0b d88e: 3c 85 ldd r19, Y+12 ; 0x0c d890: 4d 85 ldd r20, Y+13 ; 0x0d d892: 5e 85 ldd r21, Y+14 ; 0x0e d894: 5f 77 andi r21, 0x7F ; 127 d896: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d89a: 6b 01 movw r12, r22 d89c: 7c 01 movw r14, r24 if (len > 0) d89e: 20 e0 ldi r18, 0x00 ; 0 d8a0: 30 e0 ldi r19, 0x00 ; 0 d8a2: a9 01 movw r20, r18 d8a4: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> d8a8: 18 16 cp r1, r24 d8aa: 0c f0 brlt .+2 ; 0xd8ae d8ac: dd c0 rjmp .+442 ; 0xda68 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); d8ae: 20 e0 ldi r18, 0x00 ; 0 d8b0: 30 e0 ldi r19, 0x00 ; 0 d8b2: 40 ef ldi r20, 0xF0 ; 240 d8b4: 51 e4 ldi r21, 0x41 ; 65 d8b6: c7 01 movw r24, r14 d8b8: b6 01 movw r22, r12 d8ba: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> d8be: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 d8c2: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> d8c6: 7e 83 std Y+6, r23 ; 0x06 d8c8: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { d8ca: 62 30 cpi r22, 0x02 ; 2 d8cc: 71 05 cpc r23, r1 d8ce: 08 f4 brcc .+2 ; 0xd8d2 d8d0: cb c0 rjmp .+406 ; 0xda68 d8d2: 21 14 cp r2, r1 d8d4: 31 04 cpc r3, r1 d8d6: 09 f4 brne .+2 ; 0xd8da d8d8: c7 c0 rjmp .+398 ; 0xda68 float dz = z - current_position[Z_AXIS]; d8da: 20 91 9a 06 lds r18, 0x069A ; 0x80069a d8de: 30 91 9b 06 lds r19, 0x069B ; 0x80069b d8e2: 40 91 9c 06 lds r20, 0x069C ; 0x80069c d8e6: 50 91 9d 06 lds r21, 0x069D ; 0x80069d d8ea: 60 91 7c 06 lds r22, 0x067C ; 0x80067c d8ee: 70 91 7d 06 lds r23, 0x067D ; 0x80067d d8f2: 80 91 7e 06 lds r24, 0x067E ; 0x80067e d8f6: 90 91 7f 06 lds r25, 0x067F ; 0x80067f d8fa: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d8fe: 6f 87 std Y+15, r22 ; 0x0f d900: 78 8b std Y+16, r23 ; 0x10 d902: 89 8b std Y+17, r24 ; 0x11 d904: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; d906: 20 91 9e 06 lds r18, 0x069E ; 0x80069e d90a: 30 91 9f 06 lds r19, 0x069F ; 0x80069f d90e: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 d912: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 d916: 60 91 80 06 lds r22, 0x0680 ; 0x800680 d91a: 70 91 81 06 lds r23, 0x0681 ; 0x800681 d91e: 80 91 82 06 lds r24, 0x0682 ; 0x800682 d922: 90 91 83 06 lds r25, 0x0683 ; 0x800683 d926: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> d92a: 6b 8b std Y+19, r22 ; 0x13 d92c: 7c 8b std Y+20, r23 ; 0x14 d92e: 8d 8b std Y+21, r24 ; 0x15 d930: 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); d932: ad 81 ldd r26, Y+5 ; 0x05 d934: be 81 ldd r27, Y+6 ; 0x06 d936: cd 01 movw r24, r26 d938: b0 e0 ldi r27, 0x00 ; 0 d93a: a0 e0 ldi r26, 0x00 ; 0 d93c: 8f 8f std Y+31, r24 ; 0x1f d93e: 98 a3 std Y+32, r25 ; 0x20 d940: a9 a3 std Y+33, r26 ; 0x21 d942: 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) { d944: 2d 81 ldd r18, Y+5 ; 0x05 d946: 3e 81 ldd r19, Y+6 ; 0x06 d948: 22 16 cp r2, r18 d94a: 33 06 cpc r3, r19 d94c: 08 f0 brcs .+2 ; 0xd950 d94e: 8c c0 rjmp .+280 ; 0xda68 float t = float(i) / float(n_segments); d950: b1 01 movw r22, r2 d952: 90 e0 ldi r25, 0x00 ; 0 d954: 80 e0 ldi r24, 0x00 ; 0 d956: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> d95a: 6b 01 movw r12, r22 d95c: 7c 01 movw r14, r24 d95e: 6f 8d ldd r22, Y+31 ; 0x1f d960: 78 a1 ldd r23, Y+32 ; 0x20 d962: 89 a1 ldd r24, Y+33 ; 0x21 d964: 9a a1 ldd r25, Y+34 ; 0x22 d966: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> d96a: 9b 01 movw r18, r22 d96c: ac 01 movw r20, r24 d96e: c7 01 movw r24, r14 d970: b6 01 movw r22, r12 d972: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> d976: 6b 01 movw r12, r22 d978: 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, d97a: ac 01 movw r20, r24 d97c: 9b 01 movw r18, r22 d97e: 6b 89 ldd r22, Y+19 ; 0x13 d980: 7c 89 ldd r23, Y+20 ; 0x14 d982: 8d 89 ldd r24, Y+21 ; 0x15 d984: 9e 89 ldd r25, Y+22 ; 0x16 d986: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> d98a: 9b 01 movw r18, r22 d98c: ac 01 movw r20, r24 d98e: 60 91 9e 06 lds r22, 0x069E ; 0x80069e d992: 70 91 9f 06 lds r23, 0x069F ; 0x80069f d996: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 d99a: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 d99e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d9a2: 69 83 std Y+1, r22 ; 0x01 d9a4: 7a 83 std Y+2, r23 ; 0x02 d9a6: 8b 83 std Y+3, r24 ; 0x03 d9a8: 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, d9aa: a7 01 movw r20, r14 d9ac: 96 01 movw r18, r12 d9ae: 6f 85 ldd r22, Y+15 ; 0x0f d9b0: 78 89 ldd r23, Y+16 ; 0x10 d9b2: 89 89 ldd r24, Y+17 ; 0x11 d9b4: 9a 89 ldd r25, Y+18 ; 0x12 d9b6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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, d9ba: 20 91 9a 06 lds r18, 0x069A ; 0x80069a d9be: 30 91 9b 06 lds r19, 0x069B ; 0x80069b d9c2: 40 91 9c 06 lds r20, 0x069C ; 0x80069c d9c6: 50 91 9d 06 lds r21, 0x069D ; 0x80069d d9ca: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d9ce: 6f 8b std Y+23, r22 ; 0x17 d9d0: 78 8f std Y+24, r23 ; 0x18 d9d2: 89 8f std Y+25, r24 ; 0x19 d9d4: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, d9d6: a7 01 movw r20, r14 d9d8: 96 01 movw r18, r12 d9da: 6b 85 ldd r22, Y+11 ; 0x0b d9dc: 7c 85 ldd r23, Y+12 ; 0x0c d9de: 8d 85 ldd r24, Y+13 ; 0x0d d9e0: 9e 85 ldd r25, Y+14 ; 0x0e d9e2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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, d9e6: 20 91 96 06 lds r18, 0x0696 ; 0x800696 d9ea: 30 91 97 06 lds r19, 0x0697 ; 0x800697 d9ee: 40 91 98 06 lds r20, 0x0698 ; 0x800698 d9f2: 50 91 99 06 lds r21, 0x0699 ; 0x800699 d9f6: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> d9fa: 6b 8f std Y+27, r22 ; 0x1b d9fc: 7c 8f std Y+28, r23 ; 0x1c d9fe: 8d 8f std Y+29, r24 ; 0x1d da00: 9e 8f std Y+30, r25 ; 0x1e da02: a7 01 movw r20, r14 da04: 96 01 movw r18, r12 da06: c3 01 movw r24, r6 da08: b2 01 movw r22, r4 da0a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> da0e: 20 91 92 06 lds r18, 0x0692 ; 0x800692 da12: 30 91 93 06 lds r19, 0x0693 ; 0x800693 da16: 40 91 94 06 lds r20, 0x0694 ; 0x800694 da1a: 50 91 95 06 lds r21, 0x0695 ; 0x800695 da1e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> da22: 3f 92 push r3 da24: 2f 92 push r2 da26: a2 e9 ldi r26, 0x92 ; 146 da28: b6 e0 ldi r27, 0x06 ; 6 da2a: bf 93 push r27 da2c: af 93 push r26 da2e: 8f 80 ldd r8, Y+7 ; 0x07 da30: 98 84 ldd r9, Y+8 ; 0x08 da32: a9 84 ldd r10, Y+9 ; 0x09 da34: ba 84 ldd r11, Y+10 ; 0x0a da36: de 01 movw r26, r28 da38: 11 96 adiw r26, 0x01 ; 1 da3a: 6d 01 movw r12, r26 da3c: ef 88 ldd r14, Y+23 ; 0x17 da3e: f8 8c ldd r15, Y+24 ; 0x18 da40: 09 8d ldd r16, Y+25 ; 0x19 da42: 1a 8d ldd r17, Y+26 ; 0x1a da44: 2b 8d ldd r18, Y+27 ; 0x1b da46: 3c 8d ldd r19, Y+28 ; 0x1c da48: 4d 8d ldd r20, Y+29 ; 0x1d da4a: 5e 8d ldd r21, Y+30 ; 0x1e da4c: 0f 94 2c b1 call 0x36258 ; 0x36258 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) da50: 0f 90 pop r0 da52: 0f 90 pop r0 da54: 0f 90 pop r0 da56: 0f 90 pop r0 da58: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac da5c: 81 11 cpse r24, r1 da5e: b7 ce rjmp .-658 ; 0xd7ce 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) { da60: bf ef ldi r27, 0xFF ; 255 da62: 2b 1a sub r2, r27 da64: 3b 0a sbc r3, r27 da66: 6e cf rjmp .-292 ; 0xd944 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); da68: e0 90 7c 06 lds r14, 0x067C ; 0x80067c da6c: f0 90 7d 06 lds r15, 0x067D ; 0x80067d da70: 00 91 7e 06 lds r16, 0x067E ; 0x80067e da74: 10 91 7f 06 lds r17, 0x067F ; 0x80067f da78: 20 91 78 06 lds r18, 0x0678 ; 0x800678 da7c: 30 91 79 06 lds r19, 0x0679 ; 0x800679 da80: 40 91 7a 06 lds r20, 0x067A ; 0x80067a da84: 50 91 7b 06 lds r21, 0x067B ; 0x80067b da88: 60 91 74 06 lds r22, 0x0674 ; 0x800674 da8c: 70 91 75 06 lds r23, 0x0675 ; 0x800675 da90: 80 91 76 06 lds r24, 0x0676 ; 0x800676 da94: 90 91 77 06 lds r25, 0x0677 ; 0x800677 da98: 1f 92 push r1 da9a: 1f 92 push r1 da9c: e2 e9 ldi r30, 0x92 ; 146 da9e: f6 e0 ldi r31, 0x06 ; 6 daa0: ff 93 push r31 daa2: ef 93 push r30 daa4: 8f 80 ldd r8, Y+7 ; 0x07 daa6: 98 84 ldd r9, Y+8 ; 0x08 daa8: a9 84 ldd r10, Y+9 ; 0x09 daaa: ba 84 ldd r11, Y+10 ; 0x0a daac: e0 e8 ldi r30, 0x80 ; 128 daae: ce 2e mov r12, r30 dab0: e6 e0 ldi r30, 0x06 ; 6 dab2: de 2e mov r13, r30 dab4: 0f 94 2c b1 call 0x36258 ; 0x36258 dab8: 0f 90 pop r0 daba: 0f 90 pop r0 dabc: 0f 90 pop r0 dabe: 0f 90 pop r0 dac0: 86 ce rjmp .-756 ; 0xd7ce 0000dac2 : /// @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) { dac2: cf 92 push r12 dac4: df 92 push r13 dac6: ef 92 push r14 dac8: ff 92 push r15 daca: cf 93 push r28 dacc: 9b 01 movw r18, r22 dace: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; dad0: c0 90 9a 06 lds r12, 0x069A ; 0x80069a dad4: d0 90 9b 06 lds r13, 0x069B ; 0x80069b dad8: e0 90 9c 06 lds r14, 0x069C ; 0x80069c dadc: f0 90 9d 06 lds r15, 0x069D ; 0x80069d // Prepare to move Z axis current_position[Z_AXIS] += delta; dae0: c7 01 movw r24, r14 dae2: b6 01 movw r22, r12 dae4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> dae8: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a daec: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b daf0: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c daf4: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d #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); daf8: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) dafa: 90 91 91 06 lds r25, 0x0691 ; 0x800691 dafe: 91 11 cpse r25, r1 db00: 02 c0 rjmp .+4 ; 0xdb06 db02: 84 ff sbrs r24, 4 db04: 26 c0 rjmp .+76 ; 0xdb52 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); db06: 82 e9 ldi r24, 0x92 ; 146 db08: 96 e0 ldi r25, 0x06 ; 6 db0a: 0e 94 49 6b call 0xd692 ; 0xd692 plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); db0e: e0 91 71 02 lds r30, 0x0271 ; 0x800271 db12: f0 91 72 02 lds r31, 0x0272 ; 0x800272 db16: 60 85 ldd r22, Z+8 ; 0x08 db18: 71 85 ldd r23, Z+9 ; 0x09 db1a: 82 85 ldd r24, Z+10 ; 0x0a db1c: 93 85 ldd r25, Z+11 ; 0x0b db1e: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); db22: 0f 94 ed 43 call 0x287da ; 0x287da // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; db26: a7 01 movw r20, r14 db28: 96 01 movw r18, r12 db2a: 60 91 9a 06 lds r22, 0x069A ; 0x80069a db2e: 70 91 9b 06 lds r23, 0x069B ; 0x80069b db32: 80 91 9c 06 lds r24, 0x069C ; 0x80069c db36: 90 91 9d 06 lds r25, 0x069D ; 0x80069d db3a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> db3e: 6b 01 movw r12, r22 db40: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } db42: c7 01 movw r24, r14 db44: b6 01 movw r22, r12 db46: cf 91 pop r28 db48: ff 90 pop r15 db4a: ef 90 pop r14 db4c: df 90 pop r13 db4e: cf 90 pop r12 db50: 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(); db52: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); db54: 0f 94 ed 43 call 0x287da ; 0x287da // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); db58: 81 e0 ldi r24, 0x01 ; 1 db5a: 0f 94 e7 4e call 0x29dce ; 0x29dce db5e: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); db60: 84 e0 ldi r24, 0x04 ; 4 db62: 0f 94 dd 26 call 0x24dba ; 0x24dba #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); db66: 65 e5 ldi r22, 0x55 ; 85 db68: 75 e5 ldi r23, 0x55 ; 85 db6a: 85 e5 ldi r24, 0x55 ; 85 db6c: 91 e4 ldi r25, 0x41 ; 65 db6e: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); db72: 0f 94 ed 43 call 0x287da ; 0x287da // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; db76: 82 e0 ldi r24, 0x02 ; 2 db78: 0f 94 d9 43 call 0x287b2 ; 0x287b2 db7c: a7 01 movw r20, r14 db7e: 96 01 movw r18, r12 db80: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> db84: 6b 01 movw r12, r22 db86: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) db88: 0f 94 f5 4e call 0x29dea ; 0x29dea db8c: 88 23 and r24, r24 db8e: 91 f0 breq .+36 ; 0xdbb4 { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; db90: 80 91 1d 02 lds r24, 0x021D ; 0x80021d db94: 90 91 1e 02 lds r25, 0x021E ; 0x80021e db98: a0 91 1f 02 lds r26, 0x021F ; 0x80021f db9c: b0 91 20 02 lds r27, 0x0220 ; 0x800220 dba0: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a dba4: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b dba8: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c dbac: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_set_position_curposXYZE(); dbb0: 0f 94 41 bf call 0x37e82 ; 0x37e82 } tmc2130_home_exit(); dbb4: 0f 94 ae 26 call 0x24d5c ; 0x24d5c #endif //TMC2130 enable_z_endstop(z_endstop_enabled); dbb8: 8c 2f mov r24, r28 dbba: 0f 94 e7 4e call 0x29dce ; 0x29dce dbbe: c1 cf rjmp .-126 ; 0xdb42 0000dbc0 : // // 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) { dbc0: 8f 92 push r8 dbc2: 9f 92 push r9 dbc4: af 92 push r10 dbc6: bf 92 push r11 dbc8: cf 92 push r12 dbca: df 92 push r13 dbcc: ef 92 push r14 dbce: ff 92 push r15 dbd0: 4b 01 movw r8, r22 dbd2: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) dbd4: c0 90 9a 06 lds r12, 0x069A ; 0x80069a dbd8: d0 90 9b 06 lds r13, 0x069B ; 0x80069b dbdc: e0 90 9c 06 lds r14, 0x069C ; 0x80069c dbe0: f0 90 9d 06 lds r15, 0x069D ; 0x80069d dbe4: ac 01 movw r20, r24 dbe6: 9b 01 movw r18, r22 dbe8: c7 01 movw r24, r14 dbea: b6 01 movw r22, r12 dbec: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> dbf0: 87 ff sbrs r24, 7 dbf2: 11 c0 rjmp .+34 ; 0xdc16 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); dbf4: a5 01 movw r20, r10 dbf6: 94 01 movw r18, r8 dbf8: c7 01 movw r24, r14 dbfa: b6 01 movw r22, r12 dbfc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> dc00: 9f 77 andi r25, 0x7F ; 127 } dc02: ff 90 pop r15 dc04: ef 90 pop r14 dc06: df 90 pop r13 dc08: cf 90 pop r12 dc0a: bf 90 pop r11 dc0c: af 90 pop r10 dc0e: 9f 90 pop r9 dc10: 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)); dc12: 0c 94 61 6d jmp 0xdac2 ; 0xdac2 } dc16: ff 90 pop r15 dc18: ef 90 pop r14 dc1a: df 90 pop r13 dc1c: cf 90 pop r12 dc1e: bf 90 pop r11 dc20: af 90 pop r10 dc22: 9f 90 pop r9 dc24: 8f 90 pop r8 dc26: 08 95 ret 0000dc28 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { dc28: ee e5 ldi r30, 0x5E ; 94 dc2a: 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; dc2c: 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]; dc2e: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty dc30: 8f 37 cpi r24, 0x7F ; 127 dc32: 31 f0 breq .+12 ; 0xdc40 dc34: df 01 movw r26, r30 dc36: 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 dc38: 87 ff sbrs r24, 7 dc3a: 07 c0 rjmp .+14 ; 0xdc4a lcd_custom_characters[i] = c & 0x7F; dc3c: 8f 77 andi r24, 0x7F ; 127 dc3e: 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++) { dc40: 83 e0 ldi r24, 0x03 ; 3 dc42: e6 36 cpi r30, 0x66 ; 102 dc44: f8 07 cpc r31, r24 dc46: 99 f7 brne .-26 ; 0xdc2e for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dc48: 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; dc4a: 9c 93 st X, r25 dc4c: f9 cf rjmp .-14 ; 0xdc40 0000dc4e : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dc4e: 90 91 6d 02 lds r25, 0x026D ; 0x80026d dc52: 98 17 cp r25, r24 dc54: 10 f4 brcc .+4 ; 0xdc5a lcd_draw_update = lcdDrawUpdateOverride; dc56: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; dc5a: 80 91 6e 02 lds r24, 0x026E ; 0x80026e dc5e: 88 23 and r24, r24 dc60: 39 f0 breq .+14 ; 0xdc70 if (lcd_lcdupdate_func) dc62: e0 91 15 04 lds r30, 0x0415 ; 0x800415 dc66: f0 91 16 04 lds r31, 0x0416 ; 0x800416 dc6a: 30 97 sbiw r30, 0x00 ; 0 dc6c: 09 f0 breq .+2 ; 0xdc70 lcd_lcdupdate_func(); dc6e: 19 94 eijmp } dc70: 08 95 ret 0000dc72 : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { dc72: cf 93 push r28 dc74: df 93 push r29 dc76: cd b7 in r28, 0x3d ; 61 dc78: de b7 in r29, 0x3e ; 62 dc7a: ae 01 movw r20, r28 dc7c: 4a 5f subi r20, 0xFA ; 250 dc7e: 5f 4f sbci r21, 0xFF ; 255 dc80: fa 01 movw r30, r20 dc82: 61 91 ld r22, Z+ dc84: 71 91 ld r23, Z+ dc86: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); dc88: 83 e0 ldi r24, 0x03 ; 3 dc8a: 94 e0 ldi r25, 0x04 ; 4 dc8c: 0f 94 9b db call 0x3b736 ; 0x3b736 va_end(args); return ret; } dc90: df 91 pop r29 dc92: cf 91 pop r28 dc94: 08 95 ret 0000dc96 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); dc96: 63 e0 ldi r22, 0x03 ; 3 dc98: 74 e0 ldi r23, 0x04 ; 4 dc9a: 0d 94 ec da jmp 0x3b5d8 ; 0x3b5d8 0000dc9e : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); dc9e: 63 e0 ldi r22, 0x03 ; 3 dca0: 74 e0 ldi r23, 0x04 ; 4 dca2: 08 2e mov r0, r24 dca4: 00 0c add r0, r0 dca6: 99 0b sbc r25, r25 dca8: 0d 94 bc da jmp 0x3b578 ; 0x3b578 0000dcac : va_end(args); return ret; } void lcd_space(uint8_t n) { dcac: cf 93 push r28 dcae: c8 2f mov r28, r24 while (n--) lcd_putc(' '); dcb0: c1 50 subi r28, 0x01 ; 1 dcb2: 20 f0 brcs .+8 ; 0xdcbc dcb4: 80 e2 ldi r24, 0x20 ; 32 dcb6: 0e 94 4f 6e call 0xdc9e ; 0xdc9e dcba: fa cf rjmp .-12 ; 0xdcb0 } dcbc: cf 91 pop r28 dcbe: 08 95 ret 0000dcc0 : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { dcc0: cf 93 push r28 dcc2: c8 2f mov r28, r24 dcc4: 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); dcc6: 64 30 cpi r22, 0x04 ; 4 dcc8: 08 f0 brcs .+2 ; 0xdccc dcca: 83 e0 ldi r24, 0x03 ; 3 dccc: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d } void lcd_set_cursor(uint8_t col, uint8_t row) { lcd_set_current_row(row); uint8_t addr = col + lcd_get_row_offset(lcd_currline); dcd0: 0e 94 89 5a call 0xb512 ; 0xb512 dcd4: 8c 0f add r24, r28 lcd_ddram_address = addr; dcd6: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); dcda: 44 e6 ldi r20, 0x64 ; 100 dcdc: 50 e0 ldi r21, 0x00 ; 0 dcde: 60 e0 ldi r22, 0x00 ; 0 dce0: 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); } dce2: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); dce4: 0c 94 87 63 jmp 0xc70e ; 0xc70e 0000dce8 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { dce8: cf 93 push r28 dcea: df 93 push r29 dcec: ea 01 movw r28, r20 lcd_set_cursor(c, r); dcee: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 return fputs_P(str, lcdout); dcf2: 63 e0 ldi r22, 0x03 ; 3 dcf4: 74 e0 ldi r23, 0x04 ; 4 dcf6: ce 01 movw r24, r28 } dcf8: df 91 pop r29 dcfa: 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); dcfc: 0d 94 ec da jmp 0x3b5d8 ; 0x3b5d8 0000dd00 : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { dd00: cf 93 push r28 dd02: c4 2f mov r28, r20 lcd_set_cursor(c, r); dd04: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 return fputc(ch, lcdout); dd08: 63 e0 ldi r22, 0x03 ; 3 dd0a: 74 e0 ldi r23, 0x04 ; 4 dd0c: 8c 2f mov r24, r28 dd0e: cc 0f add r28, r28 dd10: 99 0b sbc r25, r25 } dd12: 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); dd14: 0d 94 bc da jmp 0x3b578 ; 0x3b578 0000dd18 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); dd18: 60 e0 ldi r22, 0x00 ; 0 dd1a: 80 e0 ldi r24, 0x00 ; 0 dd1c: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_ddram_address = 0; dd20: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c } dd24: 08 95 ret 0000dd26 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); dd26: 40 e4 ldi r20, 0x40 ; 64 dd28: 56 e0 ldi r21, 0x06 ; 6 dd2a: 60 e0 ldi r22, 0x00 ; 0 dd2c: 81 e0 ldi r24, 0x01 ; 1 dd2e: 0e 94 87 63 call 0xc70e ; 0xc70e // 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; dd32: 10 92 5d 03 sts 0x035D, r1 ; 0x80035d lcd_ddram_address = 0; dd36: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); dd3a: 48 e0 ldi r20, 0x08 ; 8 dd3c: 50 e0 ldi r21, 0x00 ; 0 dd3e: 6f e7 ldi r22, 0x7F ; 127 dd40: 70 e0 ldi r23, 0x00 ; 0 dd42: 8e e5 ldi r24, 0x5E ; 94 dd44: 93 e0 ldi r25, 0x03 ; 3 dd46: 0d 94 86 e2 jmp 0x3c50c ; 0x3c50c 0000dd4a : } 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) dd4a: 90 91 6e 02 lds r25, 0x026E ; 0x80026e dd4e: 98 17 cp r25, r24 dd50: 09 f1 breq .+66 ; 0xdd94 { lcd_update_enabled = enabled; dd52: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) dd56: 88 23 and r24, r24 dd58: e9 f0 breq .+58 ; 0xdd94 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; dd5a: 10 92 71 06 sts 0x0671, r1 ; 0x800671 dd5e: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_encoder_diff = 0; dd62: 10 92 d1 05 sts 0x05D1, r1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.541> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); dd66: 8c ed ldi r24, 0xDC ; 220 dd68: 93 e0 ldi r25, 0x03 ; 3 dd6a: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; dd6e: 0f 94 51 2a call 0x254a2 ; 0x254a2 dd72: 61 50 subi r22, 0x01 ; 1 dd74: 71 09 sbc r23, r1 dd76: 81 09 sbc r24, r1 dd78: 91 09 sbc r25, r1 dd7a: 60 93 d8 03 sts 0x03D8, r22 ; 0x8003d8 dd7e: 70 93 d9 03 sts 0x03D9, r23 ; 0x8003d9 dd82: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da dd86: 90 93 db 03 sts 0x03DB, r25 ; 0x8003db // Full update. lcd_clear(); dd8a: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_update(2); dd8e: 82 e0 ldi r24, 0x02 ; 2 dd90: 0c 94 27 6e jmp 0xdc4e ; 0xdc4e } else { // Clear the LCD always, or let it to the caller? } } } dd94: 08 95 ret 0000dd96 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { dd96: cf 93 push r28 dd98: c8 2f mov r28, r24 lcd_currline = 0; dd9a: 10 92 5d 03 sts 0x035D, r1 ; 0x80035d lcd_ddram_address = 0; dd9e: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); dda2: 48 e0 ldi r20, 0x08 ; 8 dda4: 50 e0 ldi r21, 0x00 ; 0 dda6: 6f e7 ldi r22, 0x7F ; 127 dda8: 70 e0 ldi r23, 0x00 ; 0 ddaa: 8e e5 ldi r24, 0x5E ; 94 ddac: 93 e0 ldi r25, 0x03 ; 3 ddae: 0f 94 86 e2 call 0x3c50c ; 0x3c50c 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 ddb2: 44 e9 ldi r20, 0x94 ; 148 ddb4: 51 e1 ldi r21, 0x11 ; 17 ddb6: 62 e0 ldi r22, 0x02 ; 2 ddb8: 80 e3 ldi r24, 0x30 ; 48 ddba: 0e 94 87 63 call 0xc70e ; 0xc70e // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); ddbe: 46 e9 ldi r20, 0x96 ; 150 ddc0: 50 e0 ldi r21, 0x00 ; 0 ddc2: 62 e0 ldi r22, 0x02 ; 2 ddc4: 80 e3 ldi r24, 0x30 ; 48 ddc6: 0e 94 87 63 call 0xc70e ; 0xc70e // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); ddca: 46 e9 ldi r20, 0x96 ; 150 ddcc: 50 e0 ldi r21, 0x00 ; 0 ddce: 62 e0 ldi r22, 0x02 ; 2 ddd0: 80 e3 ldi r24, 0x30 ; 48 ddd2: 0e 94 87 63 call 0xc70e ; 0xc70e #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); ddd6: 46 e9 ldi r20, 0x96 ; 150 ddd8: 50 e0 ldi r21, 0x00 ; 0 ddda: 62 e0 ldi r22, 0x02 ; 2 dddc: 80 e2 ldi r24, 0x20 ; 32 ddde: 0e 94 87 63 call 0xc70e ; 0xc70e #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); dde2: 80 91 11 04 lds r24, 0x0411 ; 0x800411 <_ZL19lcd_displayfunction.lto_priv.551> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); dde6: 44 e6 ldi r20, 0x64 ; 100 dde8: 50 e0 ldi r21, 0x00 ; 0 ddea: 60 e0 ldi r22, 0x00 ; 0 ddec: 80 62 ori r24, 0x20 ; 32 ddee: 0e 94 87 63 call 0xc70e ; 0xc70e } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; ddf2: 84 e0 ldi r24, 0x04 ; 4 ddf4: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); ddf8: 44 e6 ldi r20, 0x64 ; 100 ddfa: 50 e0 ldi r21, 0x00 ; 0 ddfc: 60 e0 ldi r22, 0x00 ; 0 ddfe: 8c e0 ldi r24, 0x0C ; 12 de00: 0e 94 87 63 call 0xc70e ; 0xc70e 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(); de04: c1 11 cpse r28, r1 de06: 0e 94 93 6e call 0xdd26 ; 0xdd26 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de0a: 44 e6 ldi r20, 0x64 ; 100 de0c: 50 e0 ldi r21, 0x00 ; 0 de0e: 60 e0 ldi r22, 0x00 ; 0 de10: 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); } de12: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de14: 0c 94 87 63 jmp 0xc70e ; 0xc70e 0000de18 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); de18: 81 e0 ldi r24, 0x01 ; 1 de1a: 0c 94 cb 6e jmp 0xdd96 ; 0xdd96 0000de1e : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { de1e: cf 92 push r12 de20: df 92 push r13 de22: ff 92 push r15 de24: 0f 93 push r16 de26: 1f 93 push r17 de28: cf 93 push r28 de2a: df 93 push r29 de2c: 00 d0 rcall .+0 ; 0xde2e de2e: 00 d0 rcall .+0 ; 0xde30 de30: 1f 92 push r1 de32: 1f 92 push r1 de34: cd b7 in r28, 0x3d ; 61 de36: de b7 in r29, 0x3e ; 62 if (value == '\n') { de38: 8a 30 cpi r24, 0x0A ; 10 de3a: d9 f4 brne .+54 ; 0xde72 if (lcd_currline > 3) lcd_currline = -1; de3c: 80 91 5d 03 lds r24, 0x035D ; 0x80035d de40: 84 30 cpi r24, 0x04 ; 4 de42: 18 f0 brcs .+6 ; 0xde4a de44: 8f ef ldi r24, 0xFF ; 255 de46: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d lcd_set_cursor(0, lcd_currline + 1); // LF de4a: 60 91 5d 03 lds r22, 0x035D ; 0x80035d de4e: 6f 5f subi r22, 0xFF ; 255 de50: 80 e0 ldi r24, 0x00 ; 0 de52: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } de56: 28 96 adiw r28, 0x08 ; 8 de58: 0f b6 in r0, 0x3f ; 63 de5a: f8 94 cli de5c: de bf out 0x3e, r29 ; 62 de5e: 0f be out 0x3f, r0 ; 63 de60: cd bf out 0x3d, r28 ; 61 de62: df 91 pop r29 de64: cf 91 pop r28 de66: 1f 91 pop r17 de68: 0f 91 pop r16 de6a: ff 90 pop r15 de6c: df 90 pop r13 de6e: cf 90 pop r12 de70: 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))) { de72: 90 e8 ldi r25, 0x80 ; 128 de74: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); de76: 44 e6 ldi r20, 0x64 ; 100 de78: 50 e0 ldi r21, 0x00 ; 0 de7a: 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))) { de7c: 9a 34 cpi r25, 0x4A ; 74 de7e: 08 f5 brcc .+66 ; 0xdec2 // 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. de80: 48 2f mov r20, r24 de82: 40 58 subi r20, 0x80 ; 128 de84: 55 0b sbc r21, r21 de86: 9a 01 movw r18, r20 de88: 96 e0 ldi r25, 0x06 ; 6 de8a: 92 9f mul r25, r18 de8c: a0 01 movw r20, r0 de8e: 93 9f mul r25, r19 de90: 50 0d add r21, r0 de92: 11 24 eor r1, r1 de94: fa 01 movw r30, r20 de96: e9 5f subi r30, 0xF9 ; 249 de98: f6 48 sbci r31, 0x86 ; 134 de9a: f4 90 lpm r15, Z de9c: ee e5 ldi r30, 0x5E ; 94 de9e: f3 e0 ldi r31, 0x03 ; 3 dea0: 30 e0 ldi r19, 0x00 ; 0 dea2: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; dea4: 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)) { dea6: 61 91 ld r22, Z+ dea8: 78 2f mov r23, r24 deaa: 76 27 eor r23, r22 deac: 7f 77 andi r23, 0x7F ; 127 deae: 89 f4 brne .+34 ; 0xded2 lcd_custom_characters[i] = c; // mark the custom character as used deb0: f9 01 movw r30, r18 deb2: e2 5a subi r30, 0xA2 ; 162 deb4: fc 4f sbci r31, 0xFC ; 252 deb6: 80 83 st Z, r24 deb8: 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); deba: 44 e6 ldi r20, 0x64 ; 100 debc: 50 e0 ldi r21, 0x00 ; 0 debe: 61 e0 ldi r22, 0x01 ; 1 dec0: 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); dec2: 0e 94 87 63 call 0xc70e ; 0xc70e lcd_ddram_address++; // no need for preventing ddram overflow dec6: 80 91 5c 03 lds r24, 0x035C ; 0x80035c deca: 8f 5f subi r24, 0xFF ; 255 decc: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c ded0: c2 cf rjmp .-124 ; 0xde56 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 ded2: 6f 37 cpi r22, 0x7F ; 127 ded4: 09 f0 breq .+2 ; 0xded8 ded6: 3c c0 rjmp .+120 ; 0xdf50 lcd_custom_characters[i] = c; // mark the custom character as used ded8: f9 01 movw r30, r18 deda: e2 5a subi r30, 0xA2 ; 162 dedc: fc 4f sbci r31, 0xFC ; 252 dede: 80 83 st Z, r24 slotToUse = i; dee0: 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; dee2: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); dee4: fa 01 movw r30, r20 dee6: ee 5f subi r30, 0xFE ; 254 dee8: f6 48 sbci r31, 0x86 ; 134 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); deea: 8e 01 movw r16, r28 deec: 0f 5f subi r16, 0xFF ; 255 deee: 1f 4f sbci r17, 0xFF ; 255 def0: d8 01 movw r26, r16 def2: 95 91 lpm r25, Z+ def4: 88 e0 ldi r24, 0x08 ; 8 def6: 18 2e mov r1, r24 0000def8 : def8: 10 fe sbrs r1, 0 defa: 05 90 lpm r0, Z+ defc: 02 94 swap r0 defe: 80 2d mov r24, r0 df00: 97 95 ror r25 df02: 88 1f adc r24, r24 df04: 8d 93 st X+, r24 df06: 1a 94 dec r1 df08: b9 f7 brne .-18 ; 0xdef8 lcd_command(LCD_SETCGRAMADDR | (location << 3)); df0a: bf 2d mov r27, r15 df0c: e8 e0 ldi r30, 0x08 ; 8 df0e: be 02 muls r27, r30 df10: c0 01 movw r24, r0 df12: 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); df14: 44 e6 ldi r20, 0x64 ; 100 df16: 50 e0 ldi r21, 0x00 ; 0 df18: 60 e0 ldi r22, 0x00 ; 0 df1a: 80 64 ori r24, 0x40 ; 64 df1c: 0e 94 87 63 call 0xc70e ; 0xc70e df20: 6e 01 movw r12, r28 df22: f9 e0 ldi r31, 0x09 ; 9 df24: cf 0e add r12, r31 df26: 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); df28: 44 e6 ldi r20, 0x64 ; 100 df2a: 50 e0 ldi r21, 0x00 ; 0 df2c: 61 e0 ldi r22, 0x01 ; 1 df2e: d8 01 movw r26, r16 df30: 8d 91 ld r24, X+ df32: 8d 01 movw r16, r26 df34: 0e 94 87 63 call 0xc70e ; 0xc70e : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { df38: c0 16 cp r12, r16 df3a: d1 06 cpc r13, r17 df3c: a9 f7 brne .-22 ; 0xdf28 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address df3e: 80 91 5c 03 lds r24, 0x035C ; 0x80035c delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df42: 44 e6 ldi r20, 0x64 ; 100 df44: 50 e0 ldi r21, 0x00 ; 0 df46: 60 e0 ldi r22, 0x00 ; 0 df48: 80 68 ori r24, 0x80 ; 128 df4a: 0e 94 87 63 call 0xc70e ; 0xc70e df4e: b5 cf rjmp .-150 ; 0xdeba 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 df50: 67 ff sbrs r22, 7 slotToUse = i; df52: 92 2f mov r25, r18 df54: 2f 5f subi r18, 0xFF ; 255 df56: 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++) { df58: 28 30 cpi r18, 0x08 ; 8 df5a: 31 05 cpc r19, r1 df5c: 09 f0 breq .+2 ; 0xdf60 df5e: a3 cf rjmp .-186 ; 0xdea6 } // 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) { df60: 9f 3f cpi r25, 0xFF ; 255 df62: 09 f0 breq .+2 ; 0xdf66 df64: be cf rjmp .-132 ; 0xdee2 df66: a9 cf rjmp .-174 ; 0xdeba 0000df68 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { df68: 8f 92 push r8 df6a: 9f 92 push r9 df6c: af 92 push r10 df6e: bf 92 push r11 df70: ef 92 push r14 df72: ff 92 push r15 df74: 0f 93 push r16 df76: 1f 93 push r17 df78: cf 93 push r28 df7a: df 93 push r29 df7c: cd b7 in r28, 0x3d ; 61 df7e: de b7 in r29, 0x3e ; 62 df80: a0 97 sbiw r28, 0x20 ; 32 df82: 0f b6 in r0, 0x3f ; 63 df84: f8 94 cli df86: de bf out 0x3e, r29 ; 62 df88: 0f be out 0x3f, r0 ; 63 df8a: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) df8c: 61 15 cp r22, r1 df8e: 71 05 cpc r23, r1 df90: 81 05 cpc r24, r1 df92: 91 05 cpc r25, r1 df94: 99 f4 brne .+38 ; 0xdfbc } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); df96: 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)); } df98: a0 96 adiw r28, 0x20 ; 32 df9a: 0f b6 in r0, 0x3f ; 63 df9c: f8 94 cli df9e: de bf out 0x3e, r29 ; 62 dfa0: 0f be out 0x3f, r0 ; 63 dfa2: cd bf out 0x3d, r28 ; 61 dfa4: df 91 pop r29 dfa6: cf 91 pop r28 dfa8: 1f 91 pop r17 dfaa: 0f 91 pop r16 dfac: ff 90 pop r15 dfae: ef 90 pop r14 dfb0: bf 90 pop r11 dfb2: af 90 pop r10 dfb4: 9f 90 pop r9 dfb6: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); dfb8: 0c 94 0f 6f jmp 0xde1e ; 0xde1e } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; dfbc: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; dfbe: 84 2e mov r8, r20 dfc0: 91 2c mov r9, r1 dfc2: b1 2c mov r11, r1 dfc4: a1 2c mov r10, r1 dfc6: 9e 01 movw r18, r28 dfc8: 2f 5f subi r18, 0xFF ; 255 dfca: 3f 4f sbci r19, 0xFF ; 255 dfcc: 79 01 movw r14, r18 dfce: a5 01 movw r20, r10 dfd0: 94 01 movw r18, r8 dfd2: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> dfd6: f7 01 movw r30, r14 dfd8: e0 0f add r30, r16 dfda: f1 1d adc r31, r1 dfdc: 60 83 st Z, r22 n /= base; dfde: b9 01 movw r22, r18 dfe0: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; dfe2: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) dfe4: 61 15 cp r22, r1 dfe6: 71 05 cpc r23, r1 dfe8: 81 05 cpc r24, r1 dfea: 91 05 cpc r25, r1 dfec: 81 f7 brne .-32 ; 0xdfce dfee: 0e 0d add r16, r14 dff0: 1f 2d mov r17, r15 dff2: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) dff4: e0 16 cp r14, r16 dff6: f1 06 cpc r15, r17 dff8: 59 f0 breq .+22 ; 0xe010 lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); dffa: f8 01 movw r30, r16 dffc: 82 91 ld r24, -Z dffe: 8f 01 movw r16, r30 e000: 8a 30 cpi r24, 0x0A ; 10 e002: 20 f4 brcc .+8 ; 0xe00c e004: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e006: 0e 94 0f 6f call 0xde1e ; 0xde1e e00a: f4 cf rjmp .-24 ; 0xdff4 { 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)); e00c: 89 5c subi r24, 0xC9 ; 201 e00e: fb cf rjmp .-10 ; 0xe006 } e010: a0 96 adiw r28, 0x20 ; 32 e012: 0f b6 in r0, 0x3f ; 63 e014: f8 94 cli e016: de bf out 0x3e, r29 ; 62 e018: 0f be out 0x3f, r0 ; 63 e01a: cd bf out 0x3d, r28 ; 61 e01c: df 91 pop r29 e01e: cf 91 pop r28 e020: 1f 91 pop r17 e022: 0f 91 pop r16 e024: ff 90 pop r15 e026: ef 90 pop r14 e028: bf 90 pop r11 e02a: af 90 pop r10 e02c: 9f 90 pop r9 e02e: 8f 90 pop r8 e030: 08 95 ret 0000e032 : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e032: cf 92 push r12 e034: df 92 push r13 e036: ef 92 push r14 e038: ff 92 push r15 e03a: 6b 01 movw r12, r22 e03c: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e03e: f7 fe sbrs r15, 7 e040: 0b c0 rjmp .+22 ; 0xe058 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e042: 8d e2 ldi r24, 0x2D ; 45 e044: 0e 94 0f 6f call 0xde1e ; 0xde1e else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e048: f0 94 com r15 e04a: e0 94 com r14 e04c: d0 94 com r13 e04e: c0 94 com r12 e050: c1 1c adc r12, r1 e052: d1 1c adc r13, r1 e054: e1 1c adc r14, r1 e056: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e058: 4a e0 ldi r20, 0x0A ; 10 e05a: c7 01 movw r24, r14 e05c: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e05e: ff 90 pop r15 e060: ef 90 pop r14 e062: df 90 pop r13 e064: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e066: 0c 94 b4 6f jmp 0xdf68 ; 0xdf68 0000e06a : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e06a: 0f 93 push r16 e06c: 1f 93 push r17 e06e: cf 93 push r28 e070: 8c 01 movw r16, r24 e072: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e074: cc 23 and r28, r28 e076: 59 f0 breq .+22 ; 0xe08e e078: f8 01 movw r30, r16 e07a: 24 91 lpm r18, Z e07c: 22 23 and r18, r18 e07e: 39 f0 breq .+14 ; 0xe08e lcd_write(pgm_read_byte(s++)); e080: 0f 5f subi r16, 0xFF ; 255 e082: 1f 4f sbci r17, 0xFF ; 255 e084: 84 91 lpm r24, Z e086: 0e 94 0f 6f call 0xde1e ; 0xde1e --len; e08a: c1 50 subi r28, 0x01 ; 1 e08c: f3 cf rjmp .-26 ; 0xe074 } lcd_space(len); e08e: 8c 2f mov r24, r28 e090: 0e 94 56 6e call 0xdcac ; 0xdcac return len; } e094: 8c 2f mov r24, r28 e096: cf 91 pop r28 e098: 1f 91 pop r17 e09a: 0f 91 pop r16 e09c: 08 95 ret 0000e09e : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e09e: 0f 93 push r16 e0a0: 1f 93 push r17 e0a2: cf 93 push r28 e0a4: 8c 01 movw r16, r24 e0a6: c6 2f mov r28, r22 while (len && *s) { e0a8: cc 23 and r28, r28 e0aa: 49 f0 breq .+18 ; 0xe0be e0ac: f8 01 movw r30, r16 e0ae: 81 91 ld r24, Z+ e0b0: 8f 01 movw r16, r30 e0b2: 88 23 and r24, r24 e0b4: 21 f0 breq .+8 ; 0xe0be lcd_write(*(s++)); e0b6: 0e 94 0f 6f call 0xde1e ; 0xde1e --len; e0ba: c1 50 subi r28, 0x01 ; 1 e0bc: f5 cf rjmp .-22 ; 0xe0a8 } lcd_space(len); e0be: 8c 2f mov r24, r28 e0c0: 0e 94 56 6e call 0xdcac ; 0xdcac return len; } e0c4: 8c 2f mov r24, r28 e0c6: cf 91 pop r28 e0c8: 1f 91 pop r17 e0ca: 0f 91 pop r16 e0cc: 08 95 ret 0000e0ce : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e0ce: cf 93 push r28 e0d0: df 93 push r29 e0d2: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e0d4: 89 91 ld r24, Y+ e0d6: 88 23 and r24, r24 e0d8: 19 f0 breq .+6 ; 0xe0e0 e0da: 0e 94 0f 6f call 0xde1e ; 0xde1e e0de: fa cf rjmp .-12 ; 0xe0d4 } e0e0: df 91 pop r29 e0e2: cf 91 pop r28 e0e4: 08 95 ret 0000e0e6 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e0e6: 0e 94 0f 6f call 0xde1e ; 0xde1e return 0; } e0ea: 90 e0 ldi r25, 0x00 ; 0 e0ec: 80 e0 ldi r24, 0x00 ; 0 e0ee: 08 95 ret 0000e0f0 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e0f0: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 lcd_longpress_trigger = 0; e0f4: 10 92 d4 05 sts 0x05D4, r1 ; 0x8005d4 } e0f8: 08 95 ret 0000e0fa : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e0fa: cf 93 push r28 bool clicked = LCD_CLICKED; e0fc: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 e100: c1 e0 ldi r28, 0x01 ; 1 e102: 81 11 cpse r24, r1 e104: 04 c0 rjmp .+8 ; 0xe10e e106: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e108: 8c 2f mov r24, r28 e10a: cf 91 pop r28 e10c: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e10e: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 e112: fa cf rjmp .-12 ; 0xe108 0000e114 : 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 e114: e0 e0 ldi r30, 0x00 ; 0 e116: f1 e0 ldi r31, 0x01 ; 1 e118: 85 91 lpm r24, Z+ e11a: 95 91 lpm r25, Z+ e11c: a5 91 lpm r26, Z+ e11e: b4 91 lpm r27, Z e120: 85 3a cpi r24, 0xA5 ; 165 e122: 9a 45 sbci r25, 0x5A ; 90 e124: a4 4b sbci r26, 0xB4 ; 180 e126: bb 44 sbci r27, 0x4B ; 75 e128: 29 f4 brne .+10 ; 0xe134 return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e12a: ea e0 ldi r30, 0x0A ; 10 e12c: f1 e0 ldi r31, 0x01 ; 1 e12e: 85 91 lpm r24, Z+ e130: 94 91 lpm r25, Z e132: 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 e134: 8f e3 ldi r24, 0x3F ; 63 e136: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e138: 08 95 ret 0000e13a : 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); e13a: 8e ef ldi r24, 0xFE ; 254 e13c: 9f e0 ldi r25, 0x0F ; 15 e13e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e142: 8e 3f cpi r24, 0xFE ; 254 e144: 39 f0 breq .+14 ; 0xe154 e146: 91 e0 ldi r25, 0x01 ; 1 e148: 20 91 5a 03 lds r18, 0x035A ; 0x80035a e14c: 28 13 cpse r18, r24 e14e: 90 e0 ldi r25, 0x00 ; 0 e150: 89 2f mov r24, r25 e152: 08 95 ret e154: 80 e0 ldi r24, 0x00 ; 0 } e156: 08 95 ret 0000e158 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e158: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e15c: 6e ef ldi r22, 0xFE ; 254 e15e: 8e ef ldi r24, 0xFE ; 254 e160: 9f e0 ldi r25, 0x0F ; 15 e162: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0000e166 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e166: 85 37 cpi r24, 0x75 ; 117 e168: 28 e6 ldi r18, 0x68 ; 104 e16a: 92 07 cpc r25, r18 e16c: 09 f4 brne .+2 ; 0xe170 e16e: 59 c0 rjmp .+178 ; 0xe222 e170: f8 f4 brcc .+62 ; 0xe1b0 e172: 8e 36 cpi r24, 0x6E ; 110 e174: 25 e6 ldi r18, 0x65 ; 101 e176: 92 07 cpc r25, r18 e178: 09 f4 brne .+2 ; 0xe17c e17a: 59 c0 rjmp .+178 ; 0xe22e e17c: 50 f4 brcc .+20 ; 0xe192 e17e: 83 37 cpi r24, 0x73 ; 115 e180: 23 e6 ldi r18, 0x63 ; 99 e182: 92 07 cpc r25, r18 e184: b1 f1 breq .+108 ; 0xe1f2 e186: 85 36 cpi r24, 0x65 ; 101 e188: 94 46 sbci r25, 0x64 ; 100 e18a: b1 f1 breq .+108 ; 0xe1f8 //#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("??"); e18c: 8c ef ldi r24, 0xFC ; 252 e18e: 94 e6 ldi r25, 0x64 ; 100 e190: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e192: 82 37 cpi r24, 0x72 ; 114 e194: 26 e6 ldi r18, 0x66 ; 102 e196: 92 07 cpc r25, r18 e198: 91 f1 breq .+100 ; 0xe1fe e19a: 82 37 cpi r24, 0x72 ; 114 e19c: 28 e6 ldi r18, 0x68 ; 104 e19e: 92 07 cpc r25, r18 e1a0: 09 f4 brne .+2 ; 0xe1a4 e1a2: 42 c0 rjmp .+132 ; 0xe228 e1a4: 83 37 cpi r24, 0x73 ; 115 e1a6: 95 46 sbci r25, 0x65 ; 101 e1a8: 89 f7 brne .-30 ; 0xe18c { 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"); e1aa: 83 e5 ldi r24, 0x53 ; 83 e1ac: 95 e6 ldi r25, 0x65 ; 101 e1ae: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e1b0: 8c 36 cpi r24, 0x6C ; 108 e1b2: 20 e7 ldi r18, 0x70 ; 112 e1b4: 92 07 cpc r25, r18 e1b6: 31 f1 breq .+76 ; 0xe204 e1b8: 70 f4 brcc .+28 ; 0xe1d6 e1ba: 8c 36 cpi r24, 0x6C ; 108 e1bc: 2e e6 ldi r18, 0x6E ; 110 e1be: 92 07 cpc r25, r18 e1c0: 21 f1 breq .+72 ; 0xe20a e1c2: 8f 36 cpi r24, 0x6F ; 111 e1c4: 2e e6 ldi r18, 0x6E ; 110 e1c6: 92 07 cpc r25, r18 e1c8: 31 f1 breq .+76 ; 0xe216 e1ca: 84 37 cpi r24, 0x74 ; 116 e1cc: 99 46 sbci r25, 0x69 ; 105 e1ce: f1 f6 brne .-68 ; 0xe18c 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"); e1d0: 81 e4 ldi r24, 0x41 ; 65 e1d2: 95 e6 ldi r25, 0x65 ; 101 e1d4: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e1d6: 8b 36 cpi r24, 0x6B ; 107 e1d8: 23 e7 ldi r18, 0x73 ; 115 e1da: 92 07 cpc r25, r18 e1dc: f9 f0 breq .+62 ; 0xe21c e1de: 86 37 cpi r24, 0x76 ; 118 e1e0: 23 e7 ldi r18, 0x73 ; 115 e1e2: 92 07 cpc r25, r18 e1e4: a9 f0 breq .+42 ; 0xe210 e1e6: 8f 36 cpi r24, 0x6F ; 111 e1e8: 92 47 sbci r25, 0x72 ; 114 e1ea: 81 f6 brne .-96 ; 0xe18c #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 e1ec: 8f ef ldi r24, 0xFF ; 255 e1ee: 94 e6 ldi r25, 0x64 ; 100 e1f0: 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"); e1f2: 83 e6 ldi r24, 0x63 ; 99 e1f4: 95 e6 ldi r25, 0x65 ; 101 e1f6: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e1f8: 8b e5 ldi r24, 0x5B ; 91 e1fa: 95 e6 ldi r25, 0x65 ; 101 e1fc: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e1fe: 8a e4 ldi r24, 0x4A ; 74 e200: 95 e6 ldi r25, 0x65 ; 101 e202: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e204: 8a e3 ldi r24, 0x3A ; 58 e206: 95 e6 ldi r25, 0x65 ; 101 e208: 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 e20a: 8f e2 ldi r24, 0x2F ; 47 e20c: 95 e6 ldi r25, 0x65 ; 101 e20e: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e210: 87 e2 ldi r24, 0x27 ; 39 e212: 95 e6 ldi r25, 0x65 ; 101 e214: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e216: 81 e2 ldi r24, 0x21 ; 33 e218: 95 e6 ldi r25, 0x65 ; 101 e21a: 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 e21c: 86 e1 ldi r24, 0x16 ; 22 e21e: 95 e6 ldi r25, 0x65 ; 101 e220: 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 e222: 8f e0 ldi r24, 0x0F ; 15 e224: 95 e6 ldi r25, 0x65 ; 101 e226: 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 e228: 86 e0 ldi r24, 0x06 ; 6 e22a: 95 e6 ldi r25, 0x65 ; 101 e22c: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e22e: 8b e6 ldi r24, 0x6B ; 107 e230: 95 e6 ldi r25, 0x65 ; 101 // case LANG_CODE_QR: return _n("New language"); //community contribution //#endif // COMMUNITY_LANG_GROUP1_QR #endif // COMMUNITY_LANGUAGE_SUPPORT } return _n("??"); } e232: 08 95 ret 0000e234 : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e234: cf 92 push r12 e236: df 92 push r13 e238: ef 92 push r14 e23a: ff 92 push r15 e23c: 1f 93 push r17 e23e: cf 93 push r28 e240: df 93 push r29 e242: cd b7 in r28, 0x3d ; 61 e244: de b7 in r29, 0x3e ; 62 e246: 60 97 sbiw r28, 0x10 ; 16 e248: 0f b6 in r0, 0x3f ; 63 e24a: f8 94 cli e24c: de bf out 0x3e, r29 ; 62 e24e: 0f be out 0x3f, r0 ; 63 e250: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e252: 88 23 and r24, r24 e254: c1 f1 breq .+112 ; 0xe2c6 e256: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e258: 81 30 cpi r24, 0x01 ; 1 e25a: 81 f4 brne .+32 ; 0xe27c e25c: 0e 94 8a 70 call 0xe114 ; 0xe114 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e260: 60 96 adiw r28, 0x10 ; 16 e262: 0f b6 in r0, 0x3f ; 63 e264: f8 94 cli e266: de bf out 0x3e, r29 ; 62 e268: 0f be out 0x3f, r0 ; 63 e26a: cd bf out 0x3d, r28 ; 61 e26c: df 91 pop r29 e26e: cf 91 pop r28 e270: 1f 91 pop r17 e272: ff 90 pop r15 e274: ef 90 pop r14 e276: df 90 pop r13 e278: cf 90 pop r12 e27a: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e27c: 8c e5 ldi r24, 0x5C ; 92 e27e: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e280: 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--; e282: 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; e284: c1 2c mov r12, r1 e286: d1 2c mov r13, r1 e288: 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 e28a: 20 e1 ldi r18, 0x10 ; 16 e28c: 30 e0 ldi r19, 0x00 ; 0 e28e: ae 01 movw r20, r28 e290: 4f 5f subi r20, 0xFF ; 255 e292: 5f 4f sbci r21, 0xFF ; 255 e294: c7 01 movw r24, r14 e296: b6 01 movw r22, r12 e298: 0e 94 c5 ed call 0x1db8a ; 0x1db8a if (header.magic != LANG_MAGIC) break; //break if not valid e29c: 89 81 ldd r24, Y+1 ; 0x01 e29e: 9a 81 ldd r25, Y+2 ; 0x02 e2a0: ab 81 ldd r26, Y+3 ; 0x03 e2a2: bc 81 ldd r27, Y+4 ; 0x04 e2a4: 85 3a cpi r24, 0xA5 ; 165 e2a6: 9a 45 sbci r25, 0x5A ; 90 e2a8: a4 4b sbci r26, 0xB4 ; 180 e2aa: bb 44 sbci r27, 0x4B ; 75 e2ac: 79 f4 brne .+30 ; 0xe2cc if (--lang == 0) return header.code; e2ae: 11 50 subi r17, 0x01 ; 1 e2b0: 19 f4 brne .+6 ; 0xe2b8 e2b2: 8b 85 ldd r24, Y+11 ; 0x0b e2b4: 9c 85 ldd r25, Y+12 ; 0x0c e2b6: d4 cf rjmp .-88 ; 0xe260 addr += header.size; //calc address of next table e2b8: 8d 81 ldd r24, Y+5 ; 0x05 e2ba: 9e 81 ldd r25, Y+6 ; 0x06 e2bc: c8 0e add r12, r24 e2be: d9 1e adc r13, r25 e2c0: e1 1c adc r14, r1 e2c2: f1 1c adc r15, r1 e2c4: e2 cf rjmp .-60 ; 0xe28a return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e2c6: 8e e6 ldi r24, 0x6E ; 110 e2c8: 95 e6 ldi r25, 0x65 ; 101 e2ca: ca cf rjmp .-108 ; 0xe260 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; e2cc: 8f e3 ldi r24, 0x3F ; 63 e2ce: 9f e3 ldi r25, 0x3F ; 63 e2d0: c7 cf rjmp .-114 ; 0xe260 0000e2d2 : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e2d2: cf 92 push r12 e2d4: df 92 push r13 e2d6: ef 92 push r14 e2d8: ff 92 push r15 e2da: 1f 93 push r17 e2dc: cf 93 push r28 e2de: df 93 push r29 e2e0: cd b7 in r28, 0x3d ; 61 e2e2: de b7 in r29, 0x3e ; 62 e2e4: 60 97 sbiw r28, 0x10 ; 16 e2e6: 0f b6 in r0, 0x3f ; 63 e2e8: f8 94 cli e2ea: de bf out 0x3e, r29 ; 62 e2ec: 0f be out 0x3f, r0 ; 63 e2ee: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e2f0: ee ef ldi r30, 0xFE ; 254 e2f2: f8 e7 ldi r31, 0x78 ; 120 e2f4: 85 91 lpm r24, Z+ e2f6: 95 91 lpm r25, Z+ e2f8: a5 91 lpm r26, Z+ e2fa: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e2fc: 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) e2fe: 8f 3f cpi r24, 0xFF ; 255 e300: 9f 4f sbci r25, 0xFF ; 255 e302: af 4f sbci r26, 0xFF ; 255 e304: bf 4f sbci r27, 0xFF ; 255 e306: 09 f1 breq .+66 ; 0xe34a SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e308: 8c e5 ldi r24, 0x5C ; 92 e30a: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e30c: 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; e30e: c1 2c mov r12, r1 e310: d1 2c mov r13, r1 e312: 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) e314: 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 e316: 20 e1 ldi r18, 0x10 ; 16 e318: 30 e0 ldi r19, 0x00 ; 0 e31a: ae 01 movw r20, r28 e31c: 4f 5f subi r20, 0xFF ; 255 e31e: 5f 4f sbci r21, 0xFF ; 255 e320: c7 01 movw r24, r14 e322: b6 01 movw r22, r12 e324: 0e 94 c5 ed call 0x1db8a ; 0x1db8a if (header.magic != LANG_MAGIC) break; //break if magic not valid e328: 89 81 ldd r24, Y+1 ; 0x01 e32a: 9a 81 ldd r25, Y+2 ; 0x02 e32c: ab 81 ldd r26, Y+3 ; 0x03 e32e: bc 81 ldd r27, Y+4 ; 0x04 e330: 85 3a cpi r24, 0xA5 ; 165 e332: 9a 45 sbci r25, 0x5A ; 90 e334: a4 4b sbci r26, 0xB4 ; 180 e336: bb 44 sbci r27, 0x4B ; 75 e338: 41 f4 brne .+16 ; 0xe34a addr += header.size; //calc address of next table e33a: 8d 81 ldd r24, Y+5 ; 0x05 e33c: 9e 81 ldd r25, Y+6 ; 0x06 e33e: c8 0e add r12, r24 e340: d9 1e adc r13, r25 e342: e1 1c adc r14, r1 e344: f1 1c adc r15, r1 count++; //inc counter e346: 1f 5f subi r17, 0xFF ; 255 e348: e6 cf rjmp .-52 ; 0xe316 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e34a: 81 2f mov r24, r17 e34c: 60 96 adiw r28, 0x10 ; 16 e34e: 0f b6 in r0, 0x3f ; 63 e350: f8 94 cli e352: de bf out 0x3e, r29 ; 62 e354: 0f be out 0x3f, r0 ; 63 e356: cd bf out 0x3d, r28 ; 61 e358: df 91 pop r29 e35a: cf 91 pop r28 e35c: 1f 91 pop r17 e35e: ff 90 pop r15 e360: ef 90 pop r14 e362: df 90 pop r13 e364: cf 90 pop r12 e366: 08 95 ret 0000e368 : 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) { e368: 0f 93 push r16 e36a: 1f 93 push r17 e36c: cf 93 push r28 e36e: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e370: 81 11 cpse r24, r1 e372: 06 c0 rjmp .+12 ; 0xe380 { lang_table = 0; e374: 10 92 59 03 sts 0x0359, r1 ; 0x800359 e378: 10 92 58 03 sts 0x0358, r1 ; 0x800358 lang_selected = lang; e37c: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a } #ifdef XFLASH if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; e380: 8c 2f mov r24, r28 e382: 0e 94 1a 71 call 0xe234 ; 0xe234 e386: 8c 01 movw r16, r24 e388: 0e 94 8a 70 call 0xe114 ; 0xe114 e38c: 08 17 cp r16, r24 e38e: 19 07 cpc r17, r25 e390: 19 f0 breq .+6 ; 0xe398 if (lang == LANG_ID_SEC) //current secondary language e392: c1 30 cpi r28, 0x01 ; 1 e394: 09 f0 breq .+2 ; 0xe398 e396: 3e c0 rjmp .+124 ; 0xe414 { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e398: e0 e0 ldi r30, 0x00 ; 0 e39a: f1 e0 ldi r31, 0x01 ; 1 e39c: 85 91 lpm r24, Z+ e39e: 95 91 lpm r25, Z+ e3a0: a5 91 lpm r26, Z+ e3a2: b4 91 lpm r27, Z e3a4: 85 3a cpi r24, 0xA5 ; 165 e3a6: 9a 45 sbci r25, 0x5A ; 90 e3a8: a4 4b sbci r26, 0xB4 ; 180 e3aa: bb 44 sbci r27, 0x4B ; 75 e3ac: 09 f0 breq .+2 ; 0xe3b0 e3ae: 31 c0 rjmp .+98 ; 0xe412 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e3b0: e4 e0 ldi r30, 0x04 ; 4 e3b2: f1 e0 ldi r31, 0x01 ; 1 e3b4: 65 91 lpm r22, Z+ e3b6: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e3b8: e8 e0 ldi r30, 0x08 ; 8 e3ba: f1 e0 ldi r31, 0x01 ; 1 e3bc: 45 91 lpm r20, Z+ e3be: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e3c0: 30 e0 ldi r19, 0x00 ; 0 e3c2: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e3c4: 90 e0 ldi r25, 0x00 ; 0 e3c6: 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++) e3c8: 62 17 cp r22, r18 e3ca: 73 07 cpc r23, r19 e3cc: 89 f5 brne .+98 ; 0xe430 sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e3ce: 84 1b sub r24, r20 e3d0: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e3d2: 98 27 eor r25, r24 e3d4: 89 27 eor r24, r25 e3d6: 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)) e3d8: 48 17 cp r20, r24 e3da: 59 07 cpc r21, r25 e3dc: d1 f4 brne .+52 ; 0xe412 if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e3de: ec e0 ldi r30, 0x0C ; 12 e3e0: f1 e0 ldi r31, 0x01 ; 1 e3e2: 45 91 lpm r20, Z+ e3e4: 55 91 lpm r21, Z+ e3e6: 65 91 lpm r22, Z+ e3e8: 74 91 lpm r23, Z e3ea: ee ef ldi r30, 0xFE ; 254 e3ec: f8 e7 ldi r31, 0x78 ; 120 e3ee: 85 91 lpm r24, Z+ e3f0: 95 91 lpm r25, Z+ e3f2: a5 91 lpm r26, Z+ e3f4: b4 91 lpm r27, Z e3f6: 48 17 cp r20, r24 e3f8: 59 07 cpc r21, r25 e3fa: 6a 07 cpc r22, r26 e3fc: 7b 07 cpc r23, r27 e3fe: 49 f4 brne .+18 ; 0xe412 { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e400: 80 e0 ldi r24, 0x00 ; 0 e402: 91 e0 ldi r25, 0x01 ; 1 e404: 90 93 59 03 sts 0x0359, r25 ; 0x800359 e408: 80 93 58 03 sts 0x0358, r24 ; 0x800358 lang_selected = lang; // set language id e40c: 81 e0 ldi r24, 0x01 ; 1 e40e: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a if (lang == LANG_ID_SEC) //current secondary language { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid { if (lang_check(_SEC_LANG_TABLE)) if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e412: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e414: 80 91 5a 03 lds r24, 0x035A ; 0x80035a e418: 8c 13 cpse r24, r28 e41a: 1c c0 rjmp .+56 ; 0xe454 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e41c: 6c 2f mov r22, r28 e41e: 8e ef ldi r24, 0xFE ; 254 e420: 9f e0 ldi r25, 0x0F ; 15 e422: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 return 1; e426: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e428: cf 91 pop r28 e42a: 1f 91 pop r17 e42c: 0f 91 pop r16 e42e: 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); e430: f9 01 movw r30, r18 e432: e0 50 subi r30, 0x00 ; 0 e434: ff 4f sbci r31, 0xFF ; 255 e436: e4 91 lpm r30, Z e438: f0 e0 ldi r31, 0x00 ; 0 e43a: a8 e0 ldi r26, 0x08 ; 8 e43c: 20 fd sbrc r18, 0 e43e: a0 e0 ldi r26, 0x00 ; 0 e440: 02 c0 rjmp .+4 ; 0xe446 e442: ee 0f add r30, r30 e444: ff 1f adc r31, r31 e446: aa 95 dec r26 e448: e2 f7 brpl .-8 ; 0xe442 e44a: 8e 0f add r24, r30 e44c: 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++) e44e: 2f 5f subi r18, 0xFF ; 255 e450: 3f 4f sbci r19, 0xFF ; 255 e452: ba cf rjmp .-140 ; 0xe3c8 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e454: 80 e0 ldi r24, 0x00 ; 0 e456: e8 cf rjmp .-48 ; 0xe428 0000e458 : //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. e458: 20 91 5a 03 lds r18, 0x035A ; 0x80035a e45c: 21 11 cpse r18, r1 e45e: 04 c0 rjmp .+8 ; 0xe468 e460: fc 01 movw r30, r24 e462: 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 } e464: cf 01 movw r24, r30 e466: 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. e468: 40 91 58 03 lds r20, 0x0358 ; 0x800358 e46c: 50 91 59 03 lds r21, 0x0359 ; 0x800359 e470: 41 15 cp r20, r1 e472: 51 05 cpc r21, r1 e474: a9 f3 breq .-22 ; 0xe460 uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e476: fc 01 movw r30, r24 e478: 25 91 lpm r18, Z+ e47a: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e47c: 2f 3f cpi r18, 0xFF ; 255 e47e: 32 07 cpc r19, r18 e480: 79 f3 breq .-34 ; 0xe460 ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e482: f9 01 movw r30, r18 e484: 38 96 adiw r30, 0x08 ; 8 e486: ee 0f add r30, r30 e488: ff 1f adc r31, r31 e48a: e4 0f add r30, r20 e48c: f5 1f adc r31, r21 e48e: 25 91 lpm r18, Z+ e490: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e492: fa 01 movw r30, r20 e494: e2 0f add r30, r18 e496: f3 1f adc r31, r19 e498: 24 91 lpm r18, Z e49a: 22 23 and r18, r18 e49c: 09 f3 breq .-62 ; 0xe460 e49e: e2 cf rjmp .-60 ; 0xe464 0000e4a0 : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e4a0: cf 93 push r28 e4a2: df 93 push r29 e4a4: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e4a6: 20 e0 ldi r18, 0x00 ; 0 e4a8: 30 e0 ldi r19, 0x00 ; 0 e4aa: 4c e8 ldi r20, 0x8C ; 140 e4ac: 52 e4 ldi r21, 0x42 ; 66 e4ae: 60 91 9e 06 lds r22, 0x069E ; 0x80069e e4b2: 70 91 9f 06 lds r23, 0x069F ; 0x80069f e4b6: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 e4ba: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 e4be: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> e4c2: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e e4c6: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f e4ca: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 e4ce: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e4d2: 60 e0 ldi r22, 0x00 ; 0 e4d4: 70 e0 ldi r23, 0x00 ; 0 e4d6: 80 ea ldi r24, 0xA0 ; 160 e4d8: 91 e4 ldi r25, 0x41 ; 65 e4da: 0f 94 81 c0 call 0x38102 ; 0x38102 load_filament_final_feed(); e4de: 0e 94 13 64 call 0xc826 ; 0xc826 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e4e2: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e4e6: 85 e7 ldi r24, 0x75 ; 117 e4e8: 9b e5 ldi r25, 0x5B ; 91 e4ea: 0e 94 2c 72 call 0xe458 ; 0xe458 e4ee: ac 01 movw r20, r24 e4f0: 60 e0 ldi r22, 0x00 ; 0 e4f2: 80 e0 ldi r24, 0x00 ; 0 e4f4: 0e 94 74 6e call 0xdce8 ; 0xdce8 if (filament_name[0]) { e4f8: 88 81 ld r24, Y e4fa: 88 23 and r24, r24 e4fc: 39 f0 breq .+14 ; 0xe50c lcd_set_cursor(0, 1); e4fe: 61 e0 ldi r22, 0x01 ; 1 e500: 80 e0 ldi r24, 0x00 ; 0 e502: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print(filament_name); e506: ce 01 movw r24, r28 e508: 0e 94 67 70 call 0xe0ce ; 0xe0ce } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e50c: 89 e9 ldi r24, 0x99 ; 153 e50e: 99 e3 ldi r25, 0x39 ; 57 e510: 0e 94 2c 72 call 0xe458 ; 0xe458 e514: ac 01 movw r20, r24 e516: 62 e0 ldi r22, 0x02 ; 2 e518: 80 e0 ldi r24, 0x00 ; 0 e51a: 0e 94 74 6e call 0xdce8 ; 0xdce8 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 e51e: 83 e4 ldi r24, 0x43 ; 67 e520: 9b e2 ldi r25, 0x2B ; 43 e522: 0f 94 74 21 call 0x242e8 ; 0x242e8 lcd_loading_filament(filament_name); st_synchronize(); } e526: df 91 pop r29 e528: 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(); e52a: 0d 94 ed 43 jmp 0x287da ; 0x287da 0000e52e : * 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; e52e: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 e532: 8f 3f cpi r24, 0xFF ; 255 e534: 11 f1 breq .+68 ; 0xe57a lcd_update_enable(false); e536: 80 e0 ldi r24, 0x00 ; 0 e538: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_clear(); e53c: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e540: 8c e3 ldi r24, 0x3C ; 60 e542: 92 e5 ldi r25, 0x52 ; 82 e544: 0e 94 2c 72 call 0xe458 ; 0xe458 e548: ac 01 movw r20, r24 e54a: 61 e0 ldi r22, 0x01 ; 1 e54c: 80 e0 ldi r24, 0x00 ; 0 e54e: 0e 94 74 6e call 0xdce8 ; 0xdce8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e552: 80 e2 ldi r24, 0x20 ; 32 e554: 0e 94 0f 6f call 0xde1e ; 0xde1e lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e558: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 e55c: 68 2f mov r22, r24 e55e: 70 e0 ldi r23, 0x00 ; 0 e560: 6f 5f subi r22, 0xFF ; 255 e562: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e564: 07 2e mov r0, r23 e566: 00 0c add r0, r0 e568: 88 0b sbc r24, r24 e56a: 99 0b sbc r25, r25 e56c: 0e 94 19 70 call 0xe032 ; 0xe032 // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e570: 0f 94 75 ad call 0x35aea ; 0x35aea lcd_update_enable(true); e574: 81 e0 ldi r24, 0x01 ; 1 e576: 0c 94 a5 6e jmp 0xdd4a ; 0xdd4a } e57a: 08 95 ret 0000e57c : } #ifdef TMC2130 bool calibrate_z_auto() { e57c: 4f 92 push r4 e57e: 5f 92 push r5 e580: 6f 92 push r6 e582: 7f 92 push r7 e584: 8f 92 push r8 e586: 9f 92 push r9 e588: af 92 push r10 e58a: bf 92 push r11 e58c: ef 92 push r14 e58e: ff 92 push r15 e590: 0f 93 push r16 e592: 1f 93 push r17 e594: cf 93 push r28 e596: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e598: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e59c: 82 e3 ldi r24, 0x32 ; 50 e59e: 9d e4 ldi r25, 0x4D ; 77 e5a0: 0e 94 2c 72 call 0xe458 ; 0xe458 e5a4: ac 01 movw r20, r24 e5a6: 61 e0 ldi r22, 0x01 ; 1 e5a8: 80 e0 ldi r24, 0x00 ; 0 e5aa: 0e 94 74 6e call 0xdce8 ; 0xdce8 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e5ae: d0 91 b7 02 lds r29, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> check_endstops = check; e5b2: 81 e0 ldi r24, 0x01 ; 1 e5b4: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> #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); e5b8: ec e8 ldi r30, 0x8C ; 140 e5ba: fb e7 ldi r31, 0x7B ; 123 e5bc: 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); e5be: 84 e0 ldi r24, 0x04 ; 4 e5c0: 0f 94 dd 26 call 0x24dba ; 0x24dba current_position[Z_AXIS] = 0; e5c4: 82 e9 ldi r24, 0x92 ; 146 e5c6: e8 2e mov r14, r24 e5c8: 86 e0 ldi r24, 0x06 ; 6 e5ca: f8 2e mov r15, r24 e5cc: f7 01 movw r30, r14 e5ce: 10 86 std Z+8, r1 ; 0x08 e5d0: 11 86 std Z+9, r1 ; 0x09 e5d2: 12 86 std Z+10, r1 ; 0x0a e5d4: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e5d6: 0f 94 41 bf call 0x37e82 ; 0x37e82 set_destination_to_current(); e5da: 0e 94 ba 67 call 0xcf74 ; 0xcf74 #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); e5de: e6 e8 ldi r30, 0x86 ; 134 e5e0: fb e7 ldi r31, 0x7B ; 123 e5e2: 85 90 lpm r8, Z+ e5e4: 95 90 lpm r9, Z+ e5e6: a5 90 lpm r10, Z+ e5e8: 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); e5ea: 04 e7 ldi r16, 0x74 ; 116 e5ec: 16 e0 ldi r17, 0x06 ; 6 { //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); e5ee: 8c 2f mov r24, r28 e5f0: 99 27 eor r25, r25 e5f2: 81 95 neg r24 e5f4: 0c f4 brge .+2 ; 0xe5f8 e5f6: 90 95 com r25 e5f8: 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); e5fa: 07 2e mov r0, r23 e5fc: 00 0c add r0, r0 e5fe: 88 0b sbc r24, r24 e600: 99 0b sbc r25, r25 e602: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> e606: 2b 01 movw r4, r22 e608: 3c 01 movw r6, r24 e60a: 2d ec ldi r18, 0xCD ; 205 e60c: 3c ec ldi r19, 0xCC ; 204 e60e: 4c e8 ldi r20, 0x8C ; 140 e610: 5f e3 ldi r21, 0x3F ; 63 e612: c5 01 movw r24, r10 e614: b4 01 movw r22, r8 e616: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> e61a: 9b 01 movw r18, r22 e61c: ac 01 movw r20, r24 e61e: c3 01 movw r24, r6 e620: b2 01 movw r22, r4 e622: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> e626: f8 01 movw r30, r16 e628: 20 85 ldd r18, Z+8 ; 0x08 e62a: 31 85 ldd r19, Z+9 ; 0x09 e62c: 42 85 ldd r20, Z+10 ; 0x0a e62e: 53 85 ldd r21, Z+11 ; 0x0b e630: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> e634: f8 01 movw r30, r16 e636: 60 87 std Z+8, r22 ; 0x08 e638: 71 87 std Z+9, r23 ; 0x09 e63a: 82 87 std Z+10, r24 ; 0x0a e63c: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e63e: 80 e0 ldi r24, 0x00 ; 0 e640: 90 e0 ldi r25, 0x00 ; 0 e642: a8 e4 ldi r26, 0x48 ; 72 e644: b4 e4 ldi r27, 0x44 ; 68 e646: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 e64a: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 e64e: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba e652: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb plan_buffer_line_destinationXYZE(feedrate / 60); e656: 65 e5 ldi r22, 0x55 ; 85 e658: 75 e5 ldi r23, 0x55 ; 85 e65a: 85 e5 ldi r24, 0x55 ; 85 e65c: 91 e4 ldi r25, 0x41 ; 65 e65e: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); e662: 0f 94 ed 43 call 0x287da ; 0x287da // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e666: 0f 94 ae 26 call 0x24d5c ; 0x24d5c e66a: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(false); current_position[Z_AXIS] = 0; e66e: f7 01 movw r30, r14 e670: 10 86 std Z+8, r1 ; 0x08 e672: 11 86 std Z+9, r1 ; 0x09 e674: 12 86 std Z+10, r1 ; 0x0a e676: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e678: 0f 94 41 bf call 0x37e82 ; 0x37e82 set_destination_to_current(); e67c: 0e 94 ba 67 call 0xcf74 ; 0xcf74 destination[Z_AXIS] += 10 * axis_up_dir; //10mm up e680: f6 ef ldi r31, 0xF6 ; 246 e682: cf 02 muls r28, r31 e684: b0 01 movw r22, r0 e686: 11 24 eor r1, r1 e688: 07 2e mov r0, r23 e68a: 00 0c add r0, r0 e68c: 88 0b sbc r24, r24 e68e: 99 0b sbc r25, r25 e690: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> e694: 9b 01 movw r18, r22 e696: ac 01 movw r20, r24 e698: f8 01 movw r30, r16 e69a: 60 85 ldd r22, Z+8 ; 0x08 e69c: 71 85 ldd r23, Z+9 ; 0x09 e69e: 82 85 ldd r24, Z+10 ; 0x0a e6a0: 93 85 ldd r25, Z+11 ; 0x0b e6a2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> e6a6: f8 01 movw r30, r16 e6a8: 60 87 std Z+8, r22 ; 0x08 e6aa: 71 87 std Z+9, r23 ; 0x09 e6ac: 82 87 std Z+10, r24 ; 0x0a e6ae: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; e6b0: 80 e0 ldi r24, 0x00 ; 0 e6b2: 90 e0 ldi r25, 0x00 ; 0 e6b4: a8 ec ldi r26, 0xC8 ; 200 e6b6: b3 e4 ldi r27, 0x43 ; 67 e6b8: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 e6bc: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 e6c0: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba e6c4: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb plan_buffer_line_destinationXYZE(feedrate / 60); e6c8: 65 e5 ldi r22, 0x55 ; 85 e6ca: 75 e5 ldi r23, 0x55 ; 85 e6cc: 85 ed ldi r24, 0xD5 ; 213 e6ce: 90 e4 ldi r25, 0x40 ; 64 e6d0: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); e6d4: 0f 94 ed 43 call 0x287da ; 0x287da e6d8: d0 93 b7 02 sts 0x02B7, r29 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(endstops_enabled); current_position[Z_AXIS] = Z_MAX_POS + Z_MAX_POS_XYZ_CALIBRATION_CORRECTION; e6dc: 80 e0 ldi r24, 0x00 ; 0 e6de: 90 e0 ldi r25, 0x00 ; 0 e6e0: a4 e5 ldi r26, 0x54 ; 84 e6e2: b3 e4 ldi r27, 0x43 ; 67 e6e4: f7 01 movw r30, r14 e6e6: 80 87 std Z+8, r24 ; 0x08 e6e8: 91 87 std Z+9, r25 ; 0x09 e6ea: a2 87 std Z+10, r26 ; 0x0a e6ec: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); e6ee: 0f 94 41 bf call 0x37e82 ; 0x37e82 return true; } e6f2: 81 e0 ldi r24, 0x01 ; 1 e6f4: df 91 pop r29 e6f6: cf 91 pop r28 e6f8: 1f 91 pop r17 e6fa: 0f 91 pop r16 e6fc: ff 90 pop r15 e6fe: ef 90 pop r14 e700: bf 90 pop r11 e702: af 90 pop r10 e704: 9f 90 pop r9 e706: 8f 90 pop r8 e708: 7f 90 pop r7 e70a: 6f 90 pop r6 e70c: 5f 90 pop r5 e70e: 4f 90 pop r4 e710: 08 95 ret 0000e712 : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { e712: cf 93 push r28 e714: df 93 push r29 e716: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; e718: 60 ff sbrs r22, 0 e71a: 03 c0 rjmp .+6 ; 0xe722 e71c: 28 e5 ldi r18, 0x58 ; 88 e71e: 28 83 st Y, r18 e720: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; e722: 61 ff sbrs r22, 1 e724: 03 c0 rjmp .+6 ; 0xe72c e726: 29 e5 ldi r18, 0x59 ; 89 e728: 28 83 st Y, r18 e72a: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; e72c: 80 e2 ldi r24, 0x20 ; 32 e72e: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); e730: 80 e0 ldi r24, 0x00 ; 0 e732: 96 e3 ldi r25, 0x36 ; 54 e734: 0e 94 2c 72 call 0xe458 ; 0xe458 e738: bc 01 movw r22, r24 e73a: ce 01 movw r24, r28 } e73c: df 91 pop r29 e73e: 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)); e740: 0d 94 0b da jmp 0x3b416 ; 0x3b416 0000e744 <__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 { e744: 1f 92 push r1 e746: 0f 92 push r0 e748: 0f b6 in r0, 0x3f ; 63 e74a: 0f 92 push r0 e74c: 11 24 eor r1, r1 e74e: 0b b6 in r0, 0x3b ; 59 e750: 0f 92 push r0 e752: 2f 93 push r18 e754: 8f 93 push r24 e756: 9f 93 push r25 e758: ef 93 push r30 e75a: ff 93 push r31 switch(state){ e75c: e0 91 53 03 lds r30, 0x0353 ; 0x800353 e760: e8 30 cpi r30, 0x08 ; 8 e762: e8 f4 brcc .+58 ; 0xe79e <__vector_23+0x5a> e764: f0 e0 ldi r31, 0x00 ; 0 e766: 88 27 eor r24, r24 e768: e7 54 subi r30, 0x47 ; 71 e76a: fc 48 sbci r31, 0x8C ; 140 e76c: 8f 4f sbci r24, 0xFF ; 255 e76e: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> e772: c1 73 andi r28, 0x31 ; 49 e774: db 73 andi r29, 0x3B ; 59 e776: e6 73 andi r30, 0x36 ; 54 e778: f4 73 andi r31, 0x34 ; 52 e77a: 0a 74 andi r16, 0x4A ; 74 e77c: 13 74 andi r17, 0x43 ; 67 e77e: 36 74 andi r19, 0x46 ; 70 e780: 48 74 andi r20, 0x48 ; 72 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin e782: 80 91 8d 06 lds r24, 0x068D ; 0x80068d e786: 81 11 cpse r24, r1 e788: 0a c0 rjmp .+20 ; 0xe79e <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! e78a: 80 91 1d 06 lds r24, 0x061D ; 0x80061d e78e: 88 0f add r24, r24 e790: 80 93 52 03 sts 0x0352, r24 ; 0x800352 if( pwm != 0 ){ e794: 88 23 and r24, r24 e796: 19 f0 breq .+6 ; 0xe79e <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period e798: 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 e79a: 80 93 53 03 sts 0x0353, r24 ; 0x800353 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } e79e: ff 91 pop r31 e7a0: ef 91 pop r30 e7a2: 9f 91 pop r25 e7a4: 8f 91 pop r24 e7a6: 2f 91 pop r18 e7a8: 0f 90 pop r0 e7aa: 0b be out 0x3b, r0 ; 59 e7ac: 0f 90 pop r0 e7ae: 0f be out 0x3f, r0 ; 63 e7b0: 0f 90 pop r0 e7b2: 1f 90 pop r1 e7b4: 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) e7b6: 80 91 51 03 lds r24, 0x0351 ; 0x800351 e7ba: 8f 5f subi r24, 0xFF ; 255 e7bc: 80 93 51 03 sts 0x0351, r24 ; 0x800351 if( slowCounter > pwm ){ e7c0: 90 91 52 03 lds r25, 0x0352 ; 0x800352 e7c4: 98 17 cp r25, r24 e7c6: 58 f3 brcs .-42 ; 0xe79e <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 e7c8: 82 e0 ldi r24, 0x02 ; 2 e7ca: e7 cf rjmp .-50 ; 0xe79a <__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 e7cc: 83 e0 ldi r24, 0x03 ; 3 e7ce: 80 93 53 03 sts 0x0353, r24 ; 0x800353 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE e7d2: 8f e0 ldi r24, 0x0F ; 15 e7d4: 80 93 50 03 sts 0x0350, r24 ; 0x800350 TCNT0 = 255; // force overflow on the next clock cycle e7d8: 8f ef ldi r24, 0xFF ; 255 e7da: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz e7dc: 81 e0 ldi r24, 0x01 ; 1 e7de: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) e7e0: 84 b5 in r24, 0x24 ; 36 e7e2: 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 e7e4: 84 bd out 0x24, r24 ; 36 e7e6: db cf rjmp .-74 ; 0xe79e <__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; e7e8: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e7ec: 82 95 swap r24 e7ee: 80 7f andi r24, 0xF0 ; 240 e7f0: 81 95 neg r24 e7f2: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ e7f4: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e7f8: 88 23 and r24, r24 e7fa: 21 f0 breq .+8 ; 0xe804 <__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; e7fc: 81 50 subi r24, 0x01 ; 1 e7fe: 80 93 50 03 sts 0x0350, r24 ; 0x800350 e802: cd cf rjmp .-102 ; 0xe79e <__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; e804: 84 e0 ldi r24, 0x04 ; 4 e806: 80 93 53 03 sts 0x0353, r24 ; 0x800353 OCR0B = 255; // full duty e80a: 8f ef ldi r24, 0xFF ; 255 e80c: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle e80e: 8e ef ldi r24, 0xFE ; 254 e810: 86 bd out 0x26, r24 ; 38 e812: c5 cf rjmp .-118 ; 0xe79e <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; e814: 85 e0 ldi r24, 0x05 ; 5 e816: 80 93 53 03 sts 0x0353, r24 ; 0x800353 OCR0B = 255; // full duty e81a: 8f ef ldi r24, 0xFF ; 255 e81c: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle e81e: 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 e820: 82 e0 ldi r24, 0x02 ; 2 e822: 85 bd out 0x25, r24 ; 37 e824: bc cf rjmp .-136 ; 0xe79e <__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; e826: 2f ef ldi r18, 0xFF ; 255 e828: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin e82a: 80 91 8d 06 lds r24, 0x068D ; 0x80068d e82e: 81 11 cpse r24, r1 e830: b6 cf rjmp .-148 ; 0xe79e <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less e832: 80 91 51 03 lds r24, 0x0351 ; 0x800351 e836: 8f 5f subi r24, 0xFF ; 255 e838: 80 93 51 03 sts 0x0351, r24 ; 0x800351 if( slowCounter < pwm ){ e83c: 90 91 52 03 lds r25, 0x0352 ; 0x800352 e840: 89 17 cp r24, r25 e842: 08 f4 brcc .+2 ; 0xe846 <__vector_23+0x102> e844: ac cf rjmp .-168 ; 0xe79e <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain e846: 80 91 1d 06 lds r24, 0x061D ; 0x80061d e84a: 90 e0 ldi r25, 0x00 ; 0 e84c: 8f 37 cpi r24, 0x7F ; 127 e84e: 91 05 cpc r25, r1 e850: 0c f0 brlt .+2 ; 0xe854 <__vector_23+0x110> e852: a5 cf rjmp .-182 ; 0xe79e <__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; e854: 86 e0 ldi r24, 0x06 ; 6 e856: 80 93 53 03 sts 0x0353, r24 ; 0x800353 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE e85a: 8f e0 ldi r24, 0x0F ; 15 e85c: 80 93 50 03 sts 0x0350, r24 ; 0x800350 TCNT0 = 255; // force overflow on the next clock cycle e860: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz e862: 81 e0 ldi r24, 0x01 ; 1 e864: 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 e866: 84 b5 in r24, 0x24 ; 36 e868: 80 61 ori r24, 0x10 ; 16 e86a: bc cf rjmp .-136 ; 0xe7e4 <__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 e86c: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e870: 82 95 swap r24 e872: 80 7f andi r24, 0xF0 ; 240 e874: 81 95 neg r24 e876: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ e878: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e87c: 81 11 cpse r24, r1 e87e: be cf rjmp .-132 ; 0xe7fc <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; e880: 87 e0 ldi r24, 0x07 ; 7 e882: 80 93 53 03 sts 0x0353, r24 ; 0x800353 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes e886: 80 e8 ldi r24, 0x80 ; 128 e888: 86 bd out 0x26, r24 ; 38 OCR0B = 255; e88a: 8f ef ldi r24, 0xFF ; 255 e88c: 88 bd out 0x28, r24 ; 40 e88e: 87 cf rjmp .-242 ; 0xe79e <__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 e890: 10 92 53 03 sts 0x0353, r1 ; 0x800353 TCNT0 = 128; e894: 80 e8 ldi r24, 0x80 ; 128 e896: 86 bd out 0x26, r24 ; 38 OCR0B = 255; e898: 8f ef ldi r24, 0xFF ; 255 e89a: 88 bd out 0x28, r24 ; 40 e89c: c1 cf rjmp .-126 ; 0xe820 <__vector_23+0xdc> 0000e89e : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { e89e: cf 93 push r28 e8a0: c8 2f mov r28, r24 e8a2: 68 2f mov r22, r24 e8a4: 87 e6 ldi r24, 0x67 ; 103 e8a6: 9f e0 ldi r25, 0x0F ; 15 e8a8: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { e8ac: cc 23 and r28, r28 e8ae: 19 f0 breq .+6 ; 0xe8b6 fsensor.init(); } else { fsensor.deinit(); } } e8b0: 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(); e8b2: 0d 94 74 7c jmp 0x2f8e8 ; 0x2f8e8 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; e8b6: 10 92 aa 17 sts 0x17AA, r1 ; 0x8017aa filter = 0; e8ba: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } e8be: cf 91 pop r28 e8c0: 08 95 ret 0000e8c2 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; e8c2: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f extruder_autofan_last_check = _millis(); e8c6: 0f 94 51 2a call 0x254a2 ; 0x254a2 e8ca: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 e8ce: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 e8d2: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 e8d6: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 } e8da: 08 95 ret 0000e8dc <__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) { e8dc: 1f 92 push r1 e8de: 0f 92 push r0 e8e0: 0f b6 in r0, 0x3f ; 63 e8e2: 0f 92 push r0 e8e4: 11 24 eor r1, r1 e8e6: 2f 93 push r18 e8e8: 4f 93 push r20 e8ea: 5f 93 push r21 e8ec: 6f 93 push r22 e8ee: 7f 93 push r23 e8f0: 8f 93 push r24 e8f2: 9f 93 push r25 e8f4: af 93 push r26 e8f6: 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; e8f8: 80 91 6f 06 lds r24, 0x066F ; 0x80066f e8fc: 88 23 and r24, r24 e8fe: f1 f0 breq .+60 ; 0xe93c <__vector_8+0x60> e900: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 e904: 8b 34 cpi r24, 0x4B ; 75 e906: d0 f0 brcs .+52 ; 0xe93c <__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 e908: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> e90c: 86 ff sbrs r24, 6 e90e: 24 c0 rjmp .+72 ; 0xe958 <__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; e910: 80 91 3b 06 lds r24, 0x063B ; 0x80063b e914: 90 91 3c 06 lds r25, 0x063C ; 0x80063c e918: a0 91 3d 06 lds r26, 0x063D ; 0x80063d e91c: b0 91 3e 06 lds r27, 0x063E ; 0x80063e t_fan_rising_edge = millis_nc(); e920: 80 93 49 03 sts 0x0349, r24 ; 0x800349 e924: 90 93 4a 03 sts 0x034A, r25 ; 0x80034a e928: a0 93 4b 03 sts 0x034B, r26 ; 0x80034b e92c: b0 93 4c 03 sts 0x034C, r27 ; 0x80034c else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse } } EICRB ^= (1 << 6); //change edge e930: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> e934: 90 e4 ldi r25, 0x40 ; 64 e936: 89 27 eor r24, r25 e938: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } e93c: bf 91 pop r27 e93e: af 91 pop r26 e940: 9f 91 pop r25 e942: 8f 91 pop r24 e944: 7f 91 pop r23 e946: 6f 91 pop r22 e948: 5f 91 pop r21 e94a: 4f 91 pop r20 e94c: 2f 91 pop r18 e94e: 0f 90 pop r0 e950: 0f be out 0x3f, r0 ; 63 e952: 0f 90 pop r0 e954: 1f 90 pop r1 e956: 18 95 reti e958: 80 91 3b 06 lds r24, 0x063B ; 0x80063b e95c: 90 91 3c 06 lds r25, 0x063C ; 0x80063c e960: a0 91 3d 06 lds r26, 0x063D ; 0x80063d e964: b0 91 3e 06 lds r27, 0x063E ; 0x80063e 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 e968: 40 91 49 03 lds r20, 0x0349 ; 0x800349 e96c: 50 91 4a 03 lds r21, 0x034A ; 0x80034a e970: 60 91 4b 03 lds r22, 0x034B ; 0x80034b e974: 70 91 4c 03 lds r23, 0x034C ; 0x80034c e978: 84 1b sub r24, r20 e97a: 95 0b sbc r25, r21 e97c: a6 0b sbc r26, r22 e97e: b7 0b sbc r27, r23 e980: 20 91 e7 03 lds r18, 0x03E7 ; 0x8003e7 e984: 44 e0 ldi r20, 0x04 ; 4 e986: 50 e0 ldi r21, 0x00 ; 0 e988: 60 e0 ldi r22, 0x00 ; 0 e98a: 70 e0 ldi r23, 0x00 ; 0 e98c: 25 36 cpi r18, 0x65 ; 101 e98e: 20 f0 brcs .+8 ; 0xe998 <__vector_8+0xbc> e990: 43 e0 ldi r20, 0x03 ; 3 e992: 50 e0 ldi r21, 0x00 ; 0 e994: 60 e0 ldi r22, 0x00 ; 0 e996: 70 e0 ldi r23, 0x00 ; 0 e998: 84 17 cp r24, r20 e99a: 95 07 cpc r25, r21 e99c: a6 07 cpc r26, r22 e99e: b7 07 cpc r27, r23 e9a0: 38 f2 brcs .-114 ; 0xe930 <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse e9a2: 80 91 e4 05 lds r24, 0x05E4 ; 0x8005e4 e9a6: 90 91 e5 05 lds r25, 0x05E5 ; 0x8005e5 e9aa: 02 96 adiw r24, 0x02 ; 2 e9ac: 90 93 e5 05 sts 0x05E5, r25 ; 0x8005e5 e9b0: 80 93 e4 05 sts 0x05E4, r24 ; 0x8005e4 e9b4: bd cf rjmp .-134 ; 0xe930 <__vector_8+0x54> 0000e9b6 : 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; e9b6: 80 93 4d 03 sts 0x034D, r24 ; 0x80034d newFanSpeed = 0; if (fanState & 0x01) e9ba: 80 fd sbrc r24, 0 e9bc: 1c c0 rjmp .+56 ; 0xe9f6 { //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; newFanSpeed = 0; e9be: 10 92 6b 03 sts 0x036B, r1 ; 0x80036b else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); e9c2: 20 91 6b 03 lds r18, 0x036B ; 0x80036b } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) e9c6: 8f ef ldi r24, 0xFF ; 255 e9c8: 82 0f add r24, r18 e9ca: 8e 3f cpi r24, 0xFE ; 254 e9cc: e8 f0 brcs .+58 ; 0xea08 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); e9ce: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> e9d2: 87 7f andi r24, 0xF7 ; 247 e9d4: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; e9d8: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> e9dc: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); e9e0: 9f b7 in r25, 0x3f ; 63 e9e2: 22 23 and r18, r18 e9e4: 61 f0 breq .+24 ; 0xe9fe e9e6: f8 94 cli e9e8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> e9ec: 80 62 ori r24, 0x20 ; 32 e9ee: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> e9f2: 9f bf out 0x3f, r25 ; 63 e9f4: 08 95 ret { #ifdef EXTRUDER_ALTFAN_DETECT if (altfanStatus.isAltfan && !altfanStatus.altfanOverride) newFanSpeed = EXTRUDER_ALTFAN_SPEED_SILENT; else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; e9f6: 8f ef ldi r24, 0xFF ; 255 e9f8: 80 93 6b 03 sts 0x036B, r24 ; 0x80036b e9fc: e2 cf rjmp .-60 ; 0xe9c2 e9fe: f8 94 cli ea00: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ea04: 8f 7d andi r24, 0xDF ; 223 ea06: f3 cf rjmp .-26 ; 0xe9ee 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; ea08: ef b7 in r30, 0x3f ; 63 ea0a: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); ea0c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ea10: 88 60 ori r24, 0x08 ; 8 ea12: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; ea16: 30 e0 ldi r19, 0x00 ; 0 ea18: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> ea1c: 4f ef ldi r20, 0xFF ; 255 ea1e: 50 e0 ldi r21, 0x00 ; 0 ea20: 81 ff sbrs r24, 1 ea22: 04 c0 rjmp .+8 ; 0xea2c ea24: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> ea28: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> ea2c: 24 9f mul r18, r20 ea2e: c0 01 movw r24, r0 ea30: 25 9f mul r18, r21 ea32: 90 0d add r25, r0 ea34: 34 9f mul r19, r20 ea36: 90 0d add r25, r0 ea38: 11 24 eor r1, r1 ea3a: 6f ef ldi r22, 0xFF ; 255 ea3c: 70 e0 ldi r23, 0x00 ; 0 ea3e: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> ea42: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ea46: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; ea4a: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } ea4c: 08 95 ret 0000ea4e : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { ea4e: 1f 93 push r17 ea50: cf 93 push r28 ea52: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) ea54: d0 91 4d 03 lds r29, 0x034D ; 0x80034d ea58: d1 fd sbrc r29, 1 ea5a: 1d c0 rjmp .+58 ; 0xea96 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; ea5c: 10 91 1b 05 lds r17, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ea60: c1 e0 ldi r28, 0x01 ; 1 ea62: 20 e0 ldi r18, 0x00 ; 0 ea64: 30 e0 ldi r19, 0x00 ; 0 ea66: 48 e4 ldi r20, 0x48 ; 72 ea68: 52 e4 ldi r21, 0x42 ; 66 ea6a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 ea6e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 ea72: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 ea76: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 ea7a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> ea7e: 18 16 cp r1, r24 ea80: 0c f0 brlt .+2 ; 0xea84 ea82: 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; ea84: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ea86: cd 2b or r28, r29 ea88: 81 e0 ldi r24, 0x01 ; 1 ea8a: 11 11 cpse r17, r1 ea8c: 01 c0 rjmp .+2 ; 0xea90 ea8e: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); ea90: c8 2b or r28, r24 ea92: c0 93 4d 03 sts 0x034D, r28 ; 0x80034d } setExtruderAutoFanState(fanState); ea96: 80 91 4d 03 lds r24, 0x034D ; 0x80034d #endif } ea9a: df 91 pop r29 ea9c: cf 91 pop r28 ea9e: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); eaa0: 0c 94 db 74 jmp 0xe9b6 ; 0xe9b6 0000eaa4 : 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) { eaa4: ef 92 push r14 eaa6: ff 92 push r15 eaa8: 0f 93 push r16 eaaa: 1f 93 push r17 eaac: cf 93 push r28 eaae: df 93 push r29 eab0: ec 01 movw r28, r24 eab2: 8b 01 movw r16, r22 eab4: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) eab6: 0e 94 3b 5b call 0xb676 ; 0xb676 eaba: 81 11 cpse r24, r1 eabc: 0b c0 rjmp .+22 ; 0xead4 #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); eabe: a8 01 movw r20, r16 eac0: be 01 movw r22, r28 eac2: 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); } eac4: df 91 pop r29 eac6: cf 91 pop r28 eac8: 1f 91 pop r17 eaca: 0f 91 pop r16 eacc: ff 90 pop r15 eace: 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); ead0: 0d 94 68 dc jmp 0x3b8d0 ; 0x3b8d0 } 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); } ead4: df 91 pop r29 ead6: cf 91 pop r28 ead8: 1f 91 pop r17 eada: 0f 91 pop r16 eadc: ff 90 pop r15 eade: ef 90 pop r14 eae0: 08 95 ret 0000eae2 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { eae2: 0f 93 push r16 eae4: 1f 93 push r17 eae6: cf 93 push r28 eae8: df 93 push r29 eaea: 8c 01 movw r16, r24 eaec: d6 2f mov r29, r22 eaee: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); eaf0: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 if (val == EEPROM_EMPTY_VALUE16) { eaf4: 8f 3f cpi r24, 0xFF ; 255 eaf6: 98 07 cpc r25, r24 eaf8: 39 f4 brne .+14 ; 0xeb08 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); eafa: 6d 2f mov r22, r29 eafc: 7c 2f mov r23, r28 eafe: c8 01 movw r24, r16 eb00: 0f 94 b2 dc call 0x3b964 ; 0x3b964 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; eb04: 8d 2f mov r24, r29 eb06: 9c 2f mov r25, r28 } return val; } eb08: df 91 pop r29 eb0a: cf 91 pop r28 eb0c: 1f 91 pop r17 eb0e: 0f 91 pop r16 eb10: 08 95 ret 0000eb12 : 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) { eb12: 0f 93 push r16 eb14: 1f 93 push r17 eb16: cf 93 push r28 eb18: 8c 01 movw r16, r24 eb1a: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); eb1c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 if (val == EEPROM_EMPTY_VALUE) { eb20: 8f 3f cpi r24, 0xFF ; 255 eb22: 29 f4 brne .+10 ; 0xeb2e 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); eb24: 6c 2f mov r22, r28 eb26: c8 01 movw r24, r16 eb28: 0f 94 9c dc call 0x3b938 ; 0x3b938 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; eb2c: 8c 2f mov r24, r28 } return val; } eb2e: cf 91 pop r28 eb30: 1f 91 pop r17 eb32: 0f 91 pop r16 eb34: 08 95 ret 0000eb36 : 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) { eb36: cf 93 push r28 eb38: df 93 push r29 eb3a: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); eb3c: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 eb40: bc 01 movw r22, r24 eb42: 6f 5f subi r22, 0xFF ; 255 eb44: 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); eb46: 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); } eb48: df 91 pop r29 eb4a: 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); eb4c: 0d 94 b2 dc jmp 0x3b964 ; 0x3b964 0000eb50 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { eb50: cf 93 push r28 eb52: df 93 push r29 eb54: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); eb56: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 eb5a: 61 e0 ldi r22, 0x01 ; 1 eb5c: 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); eb5e: 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); } eb60: df 91 pop r29 eb62: 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); eb64: 0d 94 9c dc jmp 0x3b938 ; 0x3b938 0000eb68 : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { eb68: cf 93 push r28 eb6a: df 93 push r29 eb6c: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); eb6e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 eb72: 61 e0 ldi r22, 0x01 ; 1 eb74: 81 11 cpse r24, r1 eb76: 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); eb78: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } eb7a: df 91 pop r29 eb7c: 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); eb7e: 0d 94 9c dc jmp 0x3b938 ; 0x3b938 0000eb82 : 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); eb82: 2b e0 ldi r18, 0x0B ; 11 eb84: 82 9f mul r24, r18 eb86: c0 01 movw r24, r0 eb88: 11 24 eor r1, r1 eb8a: 80 5b subi r24, 0xB0 ; 176 eb8c: 92 4f sbci r25, 0xF2 ; 242 eb8e: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 eb92: 21 e0 ldi r18, 0x01 ; 1 eb94: 01 96 adiw r24, 0x01 ; 1 eb96: 09 f4 brne .+2 ; 0xeb9a eb98: 20 e0 ldi r18, 0x00 ; 0 } eb9a: 82 2f mov r24, r18 eb9c: 08 95 ret 0000eb9e : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { eb9e: cf 93 push r28 eba0: df 93 push r29 eba2: c8 2f mov r28, r24 eba4: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; eba6: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; eba8: c8 30 cpi r28, 0x08 ; 8 ebaa: 0c f0 brlt .+2 ; 0xebae ebac: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; ebae: 8c 2f mov r24, r28 ebb0: 0e 94 c1 75 call 0xeb82 ; 0xeb82 ebb4: 81 11 cpse r24, r1 ebb6: 03 c0 rjmp .+6 ; 0xebbe ebb8: 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) ebba: a9 f7 brne .-22 ; 0xeba6 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; ebbc: cf ef ldi r28, 0xFF ; 255 } ebbe: 8c 2f mov r24, r28 ebc0: df 91 pop r29 ebc2: cf 91 pop r28 ebc4: 08 95 ret 0000ebc6 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); ebc6: 81 ea ldi r24, 0xA1 ; 161 ebc8: 9d e0 ldi r25, 0x0D ; 13 ebca: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 sheet = eeprom_next_initialized_sheet(sheet); ebce: 0e 94 cf 75 call 0xeb9e ; 0xeb9e if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); ebd2: 87 fd sbrc r24, 7 ebd4: 05 c0 rjmp .+10 ; 0xebe0 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ebd6: 68 2f mov r22, r24 ebd8: 81 ea ldi r24, 0xA1 ; 161 ebda: 9d e0 ldi r25, 0x0D ; 13 ebdc: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 { 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); } ebe0: 08 95 ret 0000ebe2 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { ebe2: 0f 93 push r16 ebe4: 1f 93 push r17 ebe6: cf 93 push r28 ebe8: c8 2f mov r28, r24 ebea: 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")); ebec: 62 e6 ldi r22, 0x62 ; 98 ebee: 78 e7 ldi r23, 0x78 ; 120 //! @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) ebf0: 82 30 cpi r24, 0x02 ; 2 ebf2: 70 f0 brcs .+28 ; 0xec10 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); ebf4: 6b e5 ldi r22, 0x5B ; 91 ebf6: 78 e7 ldi r23, 0x78 ; 120 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) ebf8: 84 30 cpi r24, 0x04 ; 4 ebfa: 50 f0 brcs .+20 ; 0xec10 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); ebfc: 63 e5 ldi r22, 0x53 ; 83 ebfe: 78 e7 ldi r23, 0x78 ; 120 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) ec00: 84 30 cpi r24, 0x04 ; 4 ec02: 31 f0 breq .+12 ; 0xec10 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); ec04: 6b e4 ldi r22, 0x4B ; 75 ec06: 78 e7 ldi r23, 0x78 ; 120 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) ec08: 85 30 cpi r24, 0x05 ; 5 ec0a: 11 f0 breq .+4 ; 0xec10 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); ec0c: 64 e4 ldi r22, 0x44 ; 68 ec0e: 78 e7 ldi r23, 0x78 ; 120 ec10: c8 01 movw r24, r16 ec12: 0f 94 0b da call 0x3b416 ; 0x3b416 } if (index <4 || index >5) ec16: 8c ef ldi r24, 0xFC ; 252 ec18: 8c 0f add r24, r28 ec1a: 82 30 cpi r24, 0x02 ; 2 ec1c: 28 f0 brcs .+10 ; 0xec28 { sheetName.c[6] = '0' + ((index % 2)+1); ec1e: c1 70 andi r28, 0x01 ; 1 ec20: cf 5c subi r28, 0xCF ; 207 ec22: f8 01 movw r30, r16 ec24: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; ec26: 17 82 std Z+7, r1 ; 0x07 } } ec28: cf 91 pop r28 ec2a: 1f 91 pop r17 ec2c: 0f 91 pop r16 ec2e: 08 95 ret 0000ec30 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ec30: 61 e0 ldi r22, 0x01 ; 1 ec32: 80 ec ldi r24, 0xC0 ; 192 ec34: 9f e0 ldi r25, 0x0F ; 15 ec36: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 ec3a: 60 e0 ldi r22, 0x00 ; 0 ec3c: 8f eb ldi r24, 0xBF ; 191 ec3e: 9f e0 ldi r25, 0x0F ; 15 ec40: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 ec44: 60 e0 ldi r22, 0x00 ; 0 ec46: 8e eb ldi r24, 0xBE ; 190 ec48: 9f e0 ldi r25, 0x0F ; 15 ec4a: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 ec4e: 60 e0 ldi r22, 0x00 ; 0 ec50: 8d eb ldi r24, 0xBD ; 189 ec52: 9f e0 ldi r25, 0x0F ; 15 ec54: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 ec58: 60 e0 ldi r22, 0x00 ; 0 ec5a: 8c eb ldi r24, 0xBC ; 188 ec5c: 9f e0 ldi r25, 0x0F ; 15 ec5e: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0000ec62 : } void print_hex_byte(uint8_t val) { ec62: cf 93 push r28 ec64: c8 2f mov r28, r24 print_hex_nibble(val >> 4); ec66: 82 95 swap r24 ec68: 8f 70 andi r24, 0x0F ; 15 ec6a: 0e 94 55 63 call 0xc6aa ; 0xc6aa print_hex_nibble(val & 15); ec6e: 8c 2f mov r24, r28 ec70: 8f 70 andi r24, 0x0F ; 15 } ec72: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); ec74: 0c 94 55 63 jmp 0xc6aa ; 0xc6aa 0000ec78 : // 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) { ec78: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 ec7c: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 ec80: 18 16 cp r1, r24 ec82: 19 06 cpc r1, r25 ec84: 0c f0 brlt .+2 ; 0xec88 ec86: 43 c0 rjmp .+134 ; 0xed0e SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { ec88: 01 97 sbiw r24, 0x01 ; 1 ec8a: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 ec8e: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 ec92: 89 2b or r24, r25 ec94: a1 f4 brne .+40 ; 0xecbe // Empty buffer. if (serial_count == 0) ec96: 80 91 9e 10 lds r24, 0x109E ; 0x80109e ec9a: 90 91 9f 10 lds r25, 0x109F ; 0x80109f ec9e: 89 2b or r24, r25 eca0: 21 f4 brne .+8 ; 0xecaa // No serial communication is pending. Reset both pointers to zero. bufindw = 0; eca2: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> eca6: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> bufindr = bufindw; ecaa: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> ecae: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> ecb2: 90 93 93 12 sts 0x1293, r25 ; 0x801293 ecb6: 80 93 92 12 sts 0x1292, r24 ; 0x801292 SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; ecba: 81 e0 ldi r24, 0x01 ; 1 ecbc: 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) ; ecbe: 80 91 92 12 lds r24, 0x1292 ; 0x801292 ecc2: 90 91 93 12 lds r25, 0x1293 ; 0x801293 ecc6: 03 96 adiw r24, 0x03 ; 3 ecc8: fc 01 movw r30, r24 ecca: eb 55 subi r30, 0x5B ; 91 eccc: ff 4e sbci r31, 0xEF ; 239 ecce: 20 81 ld r18, Z ecd0: 01 96 adiw r24, 0x01 ; 1 ecd2: 21 11 cpse r18, r1 ecd4: f9 cf rjmp .-14 ; 0xecc8 ecd6: fc 01 movw r30, r24 ecd8: eb 55 subi r30, 0x5B ; 91 ecda: 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) ; ecdc: 8d 3e cpi r24, 0xED ; 237 ecde: 21 e0 ldi r18, 0x01 ; 1 ece0: 92 07 cpc r25, r18 ece2: 40 f4 brcc .+16 ; 0xecf4 ece4: 41 91 ld r20, Z+ ece6: 9c 01 movw r18, r24 ece8: 2f 5f subi r18, 0xFF ; 255 ecea: 3f 4f sbci r19, 0xFF ; 255 ecec: 41 11 cpse r20, r1 ecee: e1 cf rjmp .-62 ; 0xecb2 ecf0: c9 01 movw r24, r18 ecf2: f4 cf rjmp .-24 ; 0xecdc // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { ecf4: e5 ea ldi r30, 0xA5 ; 165 ecf6: f0 e1 ldi r31, 0x10 ; 16 ecf8: 8d 3e cpi r24, 0xED ; 237 ecfa: 21 e0 ldi r18, 0x01 ; 1 ecfc: 92 07 cpc r25, r18 ecfe: c9 f6 brne .-78 ; 0xecb2 ed00: cf 01 movw r24, r30 ed02: 85 5a subi r24, 0xA5 ; 165 ed04: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; ed06: 21 91 ld r18, Z+ ed08: 22 23 and r18, r18 ed0a: d1 f3 breq .-12 ; 0xed00 ed0c: d2 cf rjmp .-92 ; 0xecb2 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; ed0e: 80 e0 ldi r24, 0x00 ; 0 } ed10: 08 95 ret 0000ed12 : 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; ed12: 80 91 99 04 lds r24, 0x0499 ; 0x800499 ed16: 90 91 9a 04 lds r25, 0x049A ; 0x80049a ed1a: 20 91 9b 04 lds r18, 0x049B ; 0x80049b ed1e: 30 91 9c 04 lds r19, 0x049C ; 0x80049c ed22: 82 1b sub r24, r18 ed24: 93 0b sbc r25, r19 } ed26: 8f 77 andi r24, 0x7F ; 127 ed28: 99 27 eor r25, r25 ed2a: 08 95 ret 0000ed2c : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; ed2c: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) ed2e: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; ed30: 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; ed32: db 01 movw r26, r22 ed34: 4d 91 ld r20, X+ ed36: bd 01 movw r22, r26 ed38: 40 32 cpi r20, 0x20 ; 32 ed3a: 49 f0 breq .+18 ; 0xed4e if (i == 8) ed3c: 28 30 cpi r18, 0x08 ; 8 ed3e: 11 f4 brne .+4 ; 0xed44 { *pos++='.'; ed40: 30 83 st Z, r19 ed42: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; ed44: db 01 movw r26, r22 ed46: 11 97 sbiw r26, 0x01 ; 1 ed48: 4c 91 ld r20, X ed4a: 40 83 st Z, r20 ed4c: 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++) ed4e: 2f 5f subi r18, 0xFF ; 255 ed50: 2b 30 cpi r18, 0x0B ; 11 ed52: 79 f7 brne .-34 ; 0xed32 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; ed54: 10 82 st Z, r1 return buffer; } ed56: 08 95 ret 0000ed58 : 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);} ed58: 40 e0 ldi r20, 0x00 ; 0 ed5a: 50 e0 ldi r21, 0x00 ; 0 ed5c: ba 01 movw r22, r20 ed5e: 0d 94 cd 57 jmp 0x2af9a ; 0x2af9a 0000ed62 : 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();} ed62: fc 01 movw r30, r24 ed64: 23 81 ldd r18, Z+3 ; 0x03 ed66: 21 11 cpse r18, r1 ed68: 0d 94 ab 59 jmp 0x2b356 ; 0x2b356 ed6c: 08 95 ret 0000ed6e : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) ed6e: 90 91 39 05 lds r25, 0x0539 ; 0x800539 ed72: 91 11 cpse r25, r1 ed74: 07 c0 rjmp .+14 ; 0xed84 { while (!((M_UCSRxA) & (1 << M_UDREx))); ed76: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> ed7a: 95 ff sbrs r25, 5 ed7c: fc cf rjmp .-8 ; 0xed76 M_UDRx = c; ed7e: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> ed82: 08 95 ret } else if (selectedSerialPort == 1) ed84: 91 30 cpi r25, 0x01 ; 1 ed86: 31 f4 brne .+12 ; 0xed94 { while (!((UCSR1A) & (1 << UDRE1))); ed88: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> ed8c: 95 ff sbrs r25, 5 ed8e: fc cf rjmp .-8 ; 0xed88 UDR1 = c; ed90: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } ed94: 08 95 ret 0000ed96 : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); ed96: 0e 94 b7 76 call 0xed6e ; 0xed6e return 0; } ed9a: 90 e0 ldi r25, 0x00 ; 0 ed9c: 80 e0 ldi r24, 0x00 ; 0 ed9e: 08 95 ret 0000eda0 : 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) { eda0: cf 93 push r28 eda2: df 93 push r29 eda4: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { eda6: fe 01 movw r30, r28 eda8: 84 91 lpm r24, Z edaa: 88 23 and r24, r24 edac: 21 f0 breq .+8 ; 0xedb6 MYSERIAL.write((char)ch); edae: 0e 94 b7 76 call 0xed6e ; 0xed6e ++str; edb2: 21 96 adiw r28, 0x01 ; 1 edb4: f8 cf rjmp .-16 ; 0xeda6 } } edb6: df 91 pop r29 edb8: cf 91 pop r28 edba: 08 95 ret 0000edbc : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { edbc: cf 92 push r12 edbe: df 92 push r13 edc0: ef 92 push r14 edc2: 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]; edc4: c0 90 b0 0d lds r12, 0x0DB0 ; 0x800db0 edc8: d0 90 b1 0d lds r13, 0x0DB1 ; 0x800db1 edcc: e0 90 b2 0d lds r14, 0x0DB2 ; 0x800db2 edd0: f0 90 b3 0d lds r15, 0x0DB3 ; 0x800db3 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); edd4: 89 e7 ldi r24, 0x79 ; 121 edd6: 9d e7 ldi r25, 0x7D ; 125 edd8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); eddc: 42 e0 ldi r20, 0x02 ; 2 edde: c7 01 movw r24, r14 ede0: b6 01 movw r22, r12 ede2: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); ede6: 81 e7 ldi r24, 0x71 ; 113 ede8: 9d e7 ldi r25, 0x7D ; 125 edea: 0e 94 d0 76 call 0xeda0 ; 0xeda0 edee: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee edf2: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef edf6: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 edfa: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 edfe: 41 e0 ldi r20, 0x01 ; 1 ee00: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } ee04: ff 90 pop r15 ee06: ef 90 pop r14 ee08: df 90 pop r13 ee0a: 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(); ee0c: 0d 94 35 d6 jmp 0x3ac6a ; 0x3ac6a 0000ee10 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { ee10: 4f 92 push r4 ee12: 5f 92 push r5 ee14: 6f 92 push r6 ee16: 7f 92 push r7 ee18: 8f 92 push r8 ee1a: 9f 92 push r9 ee1c: af 92 push r10 ee1e: bf 92 push r11 ee20: cf 92 push r12 ee22: df 92 push r13 ee24: ef 92 push r14 ee26: ff 92 push r15 ee28: 0f 93 push r16 ee2a: 1f 93 push r17 ee2c: cf 93 push r28 ee2e: df 93 push r29 ee30: cc 24 eor r12, r12 ee32: ca 94 dec r12 ee34: dc 2c mov r13, r12 ee36: 76 01 movw r14, r12 ee38: 0e ea ldi r16, 0xAE ; 174 ee3a: 1f e0 ldi r17, 0x0F ; 15 ee3c: 93 e2 ldi r25, 0x23 ; 35 ee3e: 89 2e mov r8, r25 ee40: 91 2c mov r9, r1 ee42: a1 2c mov r10, r1 ee44: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; ee46: 41 2c mov r4, r1 ee48: 51 2c mov r5, r1 ee4a: 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; ee4c: d0 e0 ldi r29, 0x00 ; 0 ee4e: 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) { ee50: 8f ef ldi r24, 0xFF ; 255 ee52: c8 16 cp r12, r24 ee54: 09 f4 brne .+2 ; 0xee58 ee56: 5d c0 rjmp .+186 ; 0xef12 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); ee58: c8 01 movw r24, r16 ee5a: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 ee5e: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; ee60: bc 01 movw r22, r24 ee62: 99 0f add r25, r25 ee64: 88 0b sbc r24, r24 ee66: 99 0b sbc r25, r25 ee68: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> ee6c: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca ee70: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb ee74: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc ee78: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd ee7c: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> ee80: 2b 01 movw r4, r22 ee82: 3c 01 movw r6, r24 ee84: c7 01 movw r24, r14 ee86: b6 01 movw r22, r12 ee88: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); ee8c: 8d ec ldi r24, 0xCD ; 205 ee8e: 9c e7 ldi r25, 0x7C ; 124 ee90: 0e 94 d0 76 call 0xeda0 ; 0xeda0 ee94: c5 01 movw r24, r10 ee96: b4 01 movw r22, r8 ee98: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); ee9c: 8d ec ldi r24, 0xCD ; 205 ee9e: 9c e7 ldi r25, 0x7C ; 124 eea0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); eea4: be 01 movw r22, r28 eea6: 0d 2e mov r0, r29 eea8: 00 0c add r0, r0 eeaa: 88 0b sbc r24, r24 eeac: 99 0b sbc r25, r25 eeae: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); eeb2: 8d ec ldi r24, 0xCD ; 205 eeb4: 9c e7 ldi r25, 0x7C ; 124 eeb6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLLN(mm * 1000); eeba: 20 e0 ldi r18, 0x00 ; 0 eebc: 30 e0 ldi r19, 0x00 ; 0 eebe: 4a e7 ldi r20, 0x7A ; 122 eec0: 54 e4 ldi r21, 0x44 ; 68 eec2: c3 01 movw r24, r6 eec4: b2 01 movw r22, r4 eec6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> eeca: 0f 94 ef 75 call 0x2ebde ; 0x2ebde eece: 85 e0 ldi r24, 0x05 ; 5 eed0: 88 0e add r8, r24 eed2: 91 1c adc r9, r1 eed4: a1 1c adc r10, r1 eed6: b1 1c adc r11, r1 eed8: 0e 5f subi r16, 0xFE ; 254 eeda: 1f 4f sbci r17, 0xFF ; 255 eedc: 8f ef ldi r24, 0xFF ; 255 eede: c8 1a sub r12, r24 eee0: d8 0a sbc r13, r24 eee2: e8 0a sbc r14, r24 eee4: 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++) { eee6: 0a 3b cpi r16, 0xBA ; 186 eee8: 8f e0 ldi r24, 0x0F ; 15 eeea: 18 07 cpc r17, r24 eeec: 09 f0 breq .+2 ; 0xeef0 eeee: b0 cf rjmp .-160 ; 0xee50 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } eef0: df 91 pop r29 eef2: cf 91 pop r28 eef4: 1f 91 pop r17 eef6: 0f 91 pop r16 eef8: ff 90 pop r15 eefa: ef 90 pop r14 eefc: df 90 pop r13 eefe: cf 90 pop r12 ef00: bf 90 pop r11 ef02: af 90 pop r10 ef04: 9f 90 pop r9 ef06: 8f 90 pop r8 ef08: 7f 90 pop r7 ef0a: 6f 90 pop r6 ef0c: 5f 90 pop r5 ef0e: 4f 90 pop r4 ef10: 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); ef12: 8a e8 ldi r24, 0x8A ; 138 ef14: 97 e4 ldi r25, 0x47 ; 71 ef16: 0e 94 d0 76 call 0xeda0 ; 0xeda0 ef1a: b8 cf rjmp .-144 ; 0xee8c 0000ef1c : /// @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) { ef1c: 88 23 and r24, r24 ef1e: 71 f1 breq .+92 ; 0xef7c currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); ef20: 81 ec ldi r24, 0xC1 ; 193 ef22: 9c e7 ldi r25, 0x7C ; 124 ef24: 0e 94 d0 76 call 0xeda0 ; 0xeda0 ef28: 60 91 49 13 lds r22, 0x1349 ; 0x801349 ef2c: 70 e0 ldi r23, 0x00 ; 0 ef2e: 90 e0 ldi r25, 0x00 ; 0 ef30: 80 e0 ldi r24, 0x00 ; 0 ef32: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; ef36: 80 91 49 13 lds r24, 0x1349 ; 0x801349 ef3a: 84 30 cpi r24, 0x04 ; 4 ef3c: d8 f0 brcs .+54 ; 0xef74 ef3e: 10 92 49 13 sts 0x1349, r1 ; 0x801349 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); ef42: 8c eb ldi r24, 0xBC ; 188 ef44: 9c e7 ldi r25, 0x7C ; 124 ef46: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN((int)currentMMUSlot); ef4a: 80 91 49 13 lds r24, 0x1349 ; 0x801349 ef4e: 90 e0 ldi r25, 0x00 ; 0 ef50: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 return currentMMUSlot; ef54: 80 91 49 13 lds r24, 0x1349 ; 0x801349 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; ef58: 20 91 ac 05 lds r18, 0x05AC ; 0x8005ac ef5c: 30 91 ad 05 lds r19, 0x05AD ; 0x8005ad ef60: 30 93 b7 0d sts 0x0DB7, r19 ; 0x800db7 ef64: 20 93 b6 0d sts 0x0DB6, r18 ; 0x800db6 slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); ef68: 0f 94 b5 0f call 0x21f6a ; 0x21f6a load_filament_final_feed(); // @@TODO verify ef6c: 0e 94 13 64 call 0xc826 ; 0xc826 st_synchronize(); ef70: 0d 94 ed 43 jmp 0x287da ; 0x287da { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; else currentMMUSlot++; ef74: 8f 5f subi r24, 0xFF ; 255 ef76: 80 93 49 13 sts 0x1349, r24 ; 0x801349 ef7a: e3 cf rjmp .-58 ; 0xef42 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); ef7c: 8c e5 ldi r24, 0x5C ; 92 ef7e: 9b e3 ldi r25, 0x3B ; 59 ef80: 0e 94 2c 72 call 0xe458 ; 0xe458 ef84: 70 e0 ldi r23, 0x00 ; 0 ef86: 60 e0 ldi r22, 0x00 ; 0 ef88: 0e 94 e1 e4 call 0x1c9c2 ; 0x1c9c2 ef8c: e5 cf rjmp .-54 ; 0xef58 0000ef8e : return final_result; } void gcode_M114() { ef8e: cf 93 push r28 ef90: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); ef92: 89 eb ldi r24, 0xB9 ; 185 ef94: 9c e7 ldi r25, 0x7C ; 124 ef96: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOL(current_position[X_AXIS]); ef9a: c2 e9 ldi r28, 0x92 ; 146 ef9c: d6 e0 ldi r29, 0x06 ; 6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); ef9e: 68 81 ld r22, Y efa0: 79 81 ldd r23, Y+1 ; 0x01 efa2: 8a 81 ldd r24, Y+2 ; 0x02 efa4: 9b 81 ldd r25, Y+3 ; 0x03 efa6: 42 e0 ldi r20, 0x02 ; 2 efa8: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOLPGM(" Y:"); efac: 85 eb ldi r24, 0xB5 ; 181 efae: 9c e7 ldi r25, 0x7C ; 124 efb0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 efb4: 6c 81 ldd r22, Y+4 ; 0x04 efb6: 7d 81 ldd r23, Y+5 ; 0x05 efb8: 8e 81 ldd r24, Y+6 ; 0x06 efba: 9f 81 ldd r25, Y+7 ; 0x07 efbc: 42 e0 ldi r20, 0x02 ; 2 efbe: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); efc2: 81 eb ldi r24, 0xB1 ; 177 efc4: 9c e7 ldi r25, 0x7C ; 124 efc6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 efca: 68 85 ldd r22, Y+8 ; 0x08 efcc: 79 85 ldd r23, Y+9 ; 0x09 efce: 8a 85 ldd r24, Y+10 ; 0x0a efd0: 9b 85 ldd r25, Y+11 ; 0x0b efd2: 42 e0 ldi r20, 0x02 ; 2 efd4: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); efd8: 8d ea ldi r24, 0xAD ; 173 efda: 9c e7 ldi r25, 0x7C ; 124 efdc: 0e 94 d0 76 call 0xeda0 ; 0xeda0 efe0: 6c 85 ldd r22, Y+12 ; 0x0c efe2: 7d 85 ldd r23, Y+13 ; 0x0d efe4: 8e 85 ldd r24, Y+14 ; 0x0e efe6: 9f 85 ldd r25, Y+15 ; 0x0f efe8: 42 e0 ldi r20, 0x02 ; 2 efea: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X efee: 83 e7 ldi r24, 0x73 ; 115 eff0: 95 e6 ldi r25, 0x65 ; 101 eff2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); eff6: 80 e0 ldi r24, 0x00 ; 0 eff8: 0f 94 cb 43 call 0x28796 ; 0x28796 effc: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f000: ce eb ldi r28, 0xBE ; 190 f002: dd e0 ldi r29, 0x0D ; 13 f004: 2c 81 ldd r18, Y+4 ; 0x04 f006: 3d 81 ldd r19, Y+5 ; 0x05 f008: 4e 81 ldd r20, Y+6 ; 0x06 f00a: 5f 81 ldd r21, Y+7 ; 0x07 f00c: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> f010: 42 e0 ldi r20, 0x02 ; 2 f012: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOLPGM(" Y:"); f016: 89 ea ldi r24, 0xA9 ; 169 f018: 9c e7 ldi r25, 0x7C ; 124 f01a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f01e: 81 e0 ldi r24, 0x01 ; 1 f020: 0f 94 cb 43 call 0x28796 ; 0x28796 f024: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f028: 28 85 ldd r18, Y+8 ; 0x08 f02a: 39 85 ldd r19, Y+9 ; 0x09 f02c: 4a 85 ldd r20, Y+10 ; 0x0a f02e: 5b 85 ldd r21, Y+11 ; 0x0b f030: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> f034: 42 e0 ldi r20, 0x02 ; 2 f036: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOLPGM(" Z:"); f03a: 85 ea ldi r24, 0xA5 ; 165 f03c: 9c e7 ldi r25, 0x7C ; 124 f03e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f042: 82 e0 ldi r24, 0x02 ; 2 f044: 0f 94 cb 43 call 0x28796 ; 0x28796 f048: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f04c: 2c 85 ldd r18, Y+12 ; 0x0c f04e: 3d 85 ldd r19, Y+13 ; 0x0d f050: 4e 85 ldd r20, Y+14 ; 0x0e f052: 5f 85 ldd r21, Y+15 ; 0x0f f054: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> f058: 42 e0 ldi r20, 0x02 ; 2 f05a: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOLPGM(" E:"); f05e: 81 ea ldi r24, 0xA1 ; 161 f060: 9c e7 ldi r25, 0x7C ; 124 f062: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f066: 83 e0 ldi r24, 0x03 ; 3 f068: 0f 94 cb 43 call 0x28796 ; 0x28796 f06c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f070: 28 89 ldd r18, Y+16 ; 0x10 f072: 39 89 ldd r19, Y+17 ; 0x11 f074: 4a 89 ldd r20, Y+18 ; 0x12 f076: 5b 89 ldd r21, Y+19 ; 0x13 f078: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> } f07c: df 91 pop r29 f07e: 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]); f080: 0d 94 ef 75 jmp 0x2ebde ; 0x2ebde 0000f084 : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f084: 80 eb ldi r24, 0xB0 ; 176 f086: 9b e7 ldi r25, 0x7B ; 123 f088: 0e 94 d0 76 call 0xeda0 ; 0xeda0 f08c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 f090: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 f094: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 f098: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 f09c: 41 e0 ldi r20, 0x01 ; 1 f09e: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f0a2: 8d ea ldi r24, 0xAD ; 173 f0a4: 9b e7 ldi r25, 0x7B ; 123 f0a6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f0aa: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 f0ae: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 f0b2: 07 2e mov r0, r23 f0b4: 00 0c add r0, r0 f0b6: 88 0b sbc r24, r24 f0b8: 99 0b sbc r25, r25 f0ba: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f0be: 41 e0 ldi r20, 0x01 ; 1 f0c0: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f0c4: 89 ea ldi r24, 0xA9 ; 169 f0c6: 9b e7 ldi r25, 0x7B ; 123 f0c8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 f0cc: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee f0d0: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef f0d4: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 f0d8: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 f0dc: 41 e0 ldi r20, 0x01 ; 1 f0de: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f0e2: 86 ea ldi r24, 0xA6 ; 166 f0e4: 9b e7 ldi r25, 0x7B ; 123 f0e6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f0ea: 60 91 72 06 lds r22, 0x0672 ; 0x800672 f0ee: 70 91 73 06 lds r23, 0x0673 ; 0x800673 f0f2: 07 2e mov r0, r23 f0f4: 00 0c add r0, r0 f0f6: 88 0b sbc r24, r24 f0f8: 99 0b sbc r25, r25 f0fa: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f0fe: 41 e0 ldi r20, 0x01 ; 1 f100: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f104: 81 ea ldi r24, 0xA1 ; 161 f106: 9b e7 ldi r25, 0x7B ; 123 f108: 0e 94 d0 76 call 0xeda0 ; 0xeda0 f10c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 f110: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 f114: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 f118: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 f11c: 41 e0 ldi r20, 0x01 ; 1 f11e: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f122: 8e e9 ldi r24, 0x9E ; 158 f124: 9b e7 ldi r25, 0x7B ; 123 f126: 0e 94 d0 76 call 0xeda0 ; 0xeda0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f12a: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 f12e: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 f132: 07 2e mov r0, r23 f134: 00 0c add r0, r0 f136: 88 0b sbc r24, r24 f138: 99 0b sbc r25, r25 f13a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f13e: 41 e0 ldi r20, 0x01 ; 1 f140: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f144: 8a e9 ldi r24, 0x9A ; 154 f146: 9b e7 ldi r25, 0x7B ; 123 f148: 0e 94 d0 76 call 0xeda0 ; 0xeda0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f14c: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> f150: 70 e0 ldi r23, 0x00 ; 0 f152: 90 e0 ldi r25, 0x00 ; 0 f154: 80 e0 ldi r24, 0x00 ; 0 f156: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f15a: 85 e9 ldi r24, 0x95 ; 149 f15c: 9b e7 ldi r25, 0x7B ; 123 f15e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 f162: 60 91 1d 06 lds r22, 0x061D ; 0x80061d f166: 70 e0 ldi r23, 0x00 ; 0 f168: 90 e0 ldi r25, 0x00 ; 0 f16a: 80 e0 ldi r24, 0x00 ; 0 f16c: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f170: 81 e9 ldi r24, 0x91 ; 145 f172: 9b e7 ldi r25, 0x7B ; 123 f174: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f178: 60 91 99 03 lds r22, 0x0399 ; 0x800399 f17c: 70 91 9a 03 lds r23, 0x039A ; 0x80039a f180: 80 91 9b 03 lds r24, 0x039B ; 0x80039b f184: 90 91 9c 03 lds r25, 0x039C ; 0x80039c f188: 41 e0 ldi r20, 0x01 ; 1 f18a: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f18e: 8d e8 ldi r24, 0x8D ; 141 f190: 9b e7 ldi r25, 0x7B ; 123 f192: 0e 94 d0 76 call 0xeda0 ; 0xeda0 f196: 60 91 56 06 lds r22, 0x0656 ; 0x800656 f19a: 70 91 57 06 lds r23, 0x0657 ; 0x800657 f19e: 80 91 58 06 lds r24, 0x0658 ; 0x800658 f1a2: 90 91 59 06 lds r25, 0x0659 ; 0x800659 f1a6: 41 e0 ldi r20, 0x01 ; 1 f1a8: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f1ac: 0d 94 35 d6 jmp 0x3ac6a ; 0x3ac6a 0000f1b0 : } } 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); } f1b0: 20 91 88 14 lds r18, 0x1488 ; 0x801488 f1b4: 30 e0 ldi r19, 0x00 ; 0 f1b6: a8 ee ldi r26, 0xE8 ; 232 f1b8: b3 e0 ldi r27, 0x03 ; 3 f1ba: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> f1be: ab 01 movw r20, r22 f1c0: bc 01 movw r22, r24 f1c2: 89 e8 ldi r24, 0x89 ; 137 f1c4: 94 e1 ldi r25, 0x14 ; 20 f1c6: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f1ca: 88 23 and r24, r24 f1cc: 99 f0 breq .+38 ; 0xf1f4 f1ce: 80 91 87 14 lds r24, 0x1487 ; 0x801487 { if(autoReportFeatures.Temp()){ f1d2: 80 fd sbrc r24, 0 gcode_M105(); f1d4: 0e 94 42 78 call 0xf084 ; 0xf084 f1d8: 80 91 87 14 lds r24, 0x1487 ; 0x801487 } if(autoReportFeatures.Pos()){ f1dc: 82 fd sbrc r24, 2 gcode_M114(); f1de: 0e 94 c7 77 call 0xef8e ; 0xef8e f1e2: 80 91 87 14 lds r24, 0x1487 ; 0x801487 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f1e6: 81 fd sbrc r24, 1 gcode_M123(); f1e8: 0e 94 04 66 call 0xcc08 ; 0xcc08 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f1ec: 89 e8 ldi r24, 0x89 ; 137 f1ee: 94 e1 ldi r25, 0x14 ; 20 f1f0: 0d 94 f4 2c jmp 0x259e8 ; 0x259e8 ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f1f4: 08 95 ret 0000f1f6 : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f1f6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 MYSERIAL.println(); f1fa: 0d 94 35 d6 jmp 0x3ac6a ; 0x3ac6a 0000f1fe : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f1fe: 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))); f200: 81 ea ldi r24, 0xA1 ; 161 f202: 9d e0 ldi r25, 0x0D ; 13 f204: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f208: cb e0 ldi r28, 0x0B ; 11 f20a: 8c 9f mul r24, r28 f20c: c0 01 movw r24, r0 f20e: 11 24 eor r1, r1 f210: 80 5b subi r24, 0xB0 ; 176 f212: 92 4f sbci r25, 0xF2 ; 242 f214: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f218: 81 56 subi r24, 0x61 ; 97 f21a: 90 4f sbci r25, 0xF0 ; 240 f21c: 80 3a cpi r24, 0xA0 ; 160 f21e: 9f 40 sbci r25, 0x0F ; 15 f220: c8 f0 brcs .+50 ; 0xf254 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"); f222: 88 e4 ldi r24, 0x48 ; 72 f224: 9d e7 ldi r25, 0x7D ; 125 f226: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f22a: 81 ea ldi r24, 0xA1 ; 161 f22c: 9d e0 ldi r25, 0x0D ; 13 f22e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 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-> f232: 8c 9f mul r24, r28 f234: c0 01 movw r24, r0 f236: 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); f238: 70 e0 ldi r23, 0x00 ; 0 f23a: 60 e0 ldi r22, 0x00 ; 0 f23c: 80 5b subi r24, 0xB0 ; 176 f23e: 92 4f sbci r25, 0xF2 ; 242 f240: 0f 94 b2 dc call 0x3b964 ; 0x3b964 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.")); f244: 8b e0 ldi r24, 0x0B ; 11 f246: 9d e7 ldi r25, 0x7D ; 125 f248: 0f 94 f6 20 call 0x241ec ; 0x241ec lcd_update_enable(true); f24c: 81 e0 ldi r24, 0x01 ; 1 } } f24e: 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); f250: 0c 94 a5 6e jmp 0xdd4a ; 0xdd4a } } f254: cf 91 pop r28 f256: 08 95 ret 0000f258 : // 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) { f258: ff 92 push r15 f25a: 0f 93 push r16 f25c: 1f 93 push r17 f25e: cf 93 push r28 f260: df 93 push r29 if(Stopped == false) { f262: 90 91 11 05 lds r25, 0x0511 ; 0x800511 f266: 91 11 cpse r25, r1 f268: 4f c0 rjmp .+158 ; 0xf308 f26a: c8 2f mov r28, r24 Stopped = true; f26c: 81 e0 ldi r24, 0x01 ; 1 f26e: 80 93 11 05 sts 0x0511, r24 ; 0x800511 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f272: cc 23 and r28, r28 f274: 11 f1 breq .+68 ; 0xf2ba f276: 0e 94 10 67 call 0xce20 ; 0xce20 f27a: 88 23 and r24, r24 f27c: f1 f0 breq .+60 ; 0xf2ba if (!printingIsPaused()) { f27e: 0e 94 05 67 call 0xce0a ; 0xce0a f282: 81 11 cpse r24, r1 f284: 22 c0 rjmp .+68 ; 0xf2ca lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f286: 81 ea ldi r24, 0xA1 ; 161 f288: 96 e3 ldi r25, 0x36 ; 54 f28a: 0e 94 2c 72 call 0xe458 ; 0xe458 f28e: 63 e0 ldi r22, 0x03 ; 3 f290: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 // 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; f294: f0 90 ae 05 lds r15, 0x05AE ; 0x8005ae uint16_t ext_temp = saved_extruder_temperature; f298: 00 91 ac 05 lds r16, 0x05AC ; 0x8005ac f29c: 10 91 ad 05 lds r17, 0x05AD ; 0x8005ad uint8_t fan_speed = saved_fan_speed; f2a0: d0 91 ab 05 lds r29, 0x05AB ; 0x8005ab lcd_pause_print(); f2a4: 0f 94 5d 2a call 0x254ba ; 0x254ba saved_bed_temperature = bed_temp; f2a8: f0 92 ae 05 sts 0x05AE, r15 ; 0x8005ae saved_extruder_temperature = ext_temp; f2ac: 10 93 ad 05 sts 0x05AD, r17 ; 0x8005ad f2b0: 00 93 ac 05 sts 0x05AC, r16 ; 0x8005ac saved_fan_speed = fan_speed; f2b4: d0 93 ab 05 sts 0x05AB, r29 ; 0x8005ab f2b8: 08 c0 rjmp .+16 ; 0xf2ca } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f2ba: 61 e0 ldi r22, 0x01 ; 1 f2bc: 80 e0 ldi r24, 0x00 ; 0 f2be: 0e 94 78 f5 call 0x1eaf0 ; 0x1eaf0 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f2c2: 8a e9 ldi r24, 0x9A ; 154 f2c4: 9a ea ldi r25, 0xAA ; 170 f2c6: cc 23 and r28, r28 f2c8: 11 f0 breq .+4 ; 0xf2ce f2ca: 82 ec ldi r24, 0xC2 ; 194 f2cc: 9a ea ldi r25, 0xAA ; 170 f2ce: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f2d2: 8c ee ldi r24, 0xEC ; 236 f2d4: 95 e6 ldi r25, 0x65 ; 101 f2d6: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 // 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)); f2da: 86 e9 ldi r24, 0x96 ; 150 f2dc: 96 e3 ldi r25, 0x36 ; 54 f2de: 0e 94 2c 72 call 0xe458 ; 0xe458 f2e2: 0e 94 3b f2 call 0x1e476 ; 0x1e476 // 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); f2e6: 9f b7 in r25, 0x3f ; 63 f2e8: f8 94 cli f2ea: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f2ee: 84 60 ori r24, 0x04 ; 4 f2f0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f2f4: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f2f6: 0f 94 ab 1f call 0x23f56 ; 0x23f56 if(!allow_recovery) { f2fa: c1 11 cpse r28, r1 f2fc: 05 c0 rjmp .+10 ; 0xf308 // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f2fe: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 f302: 81 60 ori r24, 0x01 ; 1 f304: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 } } } f308: df 91 pop r29 f30a: cf 91 pop r28 f30c: 1f 91 pop r17 f30e: 0f 91 pop r16 f310: ff 90 pop r15 f312: 08 95 ret 0000f314 : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f314: ec 01 movw r28, r24 cli(); // Stop interrupts f316: f8 94 cli disable_heater(); f318: 0f 94 1d 30 call 0x2603a ; 0x2603a disable_x(); f31c: 17 9a sbi 0x02, 7 ; 2 f31e: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); f322: 16 9a sbi 0x02, 6 ; 2 f324: 10 92 90 06 sts 0x0690, r1 ; 0x800690 poweroff_z(); disable_e0(); f328: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f32a: 8a e9 ldi r24, 0x9A ; 154 f32c: 9a ea ldi r25, 0xAA ; 170 f32e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f332: 8c ee ldi r24, 0xEC ; 236 f334: 9c e7 ldi r25, 0x7C ; 124 f336: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 if (full_screen_message != NULL) { f33a: 20 97 sbiw r28, 0x00 ; 0 f33c: 79 f0 breq .+30 ; 0xf35c SERIAL_ERRORLNRPGM(full_screen_message); f33e: ce 01 movw r24, r28 f340: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 f344: be 01 movw r22, r28 f346: 85 e9 ldi r24, 0x95 ; 149 f348: 9c e0 ldi r25, 0x0C ; 12 f34a: 0f 94 b2 dc call 0x3b964 ; 0x3b964 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); f34e: 62 e4 ldi r22, 0x42 ; 66 f350: 84 e9 ldi r24, 0x94 ; 148 f352: 9c e0 ldi r25, 0x0C ; 12 f354: 0f 94 9c dc call 0x3b938 ; 0x3b938 // 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(); f358: 0e 94 cc 66 call 0xcd98 ; 0xcd98 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f35c: c4 ee ldi r28, 0xE4 ; 228 f35e: dc e7 ldi r29, 0x7C ; 124 f360: f1 cf rjmp .-30 ; 0xf344 0000f362 : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f362: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f366: 86 fd sbrc r24, 6 f368: 35 c0 rjmp .+106 ; 0xf3d4 FORCE_HIGH_POWER_END; f36a: 80 e0 ldi r24, 0x00 ; 0 f36c: 0e 94 30 66 call 0xcc60 ; 0xcc60 current_position[Z_AXIS] = 0; f370: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f374: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f378: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f37c: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f380: 0f 94 41 bf call 0x37e82 ; 0x37e82 current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f384: 20 e0 ldi r18, 0x00 ; 0 f386: 30 e0 ldi r19, 0x00 ; 0 f388: 40 ea ldi r20, 0xA0 ; 160 f38a: 50 e4 ldi r21, 0x40 ; 64 f38c: 60 91 9a 06 lds r22, 0x069A ; 0x80069a f390: 70 91 9b 06 lds r23, 0x069B ; 0x80069b f394: 80 91 9c 06 lds r24, 0x069C ; 0x80069c f398: 90 91 9d 06 lds r25, 0x069D ; 0x80069d f39c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> f3a0: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a f3a4: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b f3a8: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c f3ac: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f3b0: e0 91 71 02 lds r30, 0x0271 ; 0x800271 f3b4: f0 91 72 02 lds r31, 0x0272 ; 0x800272 f3b8: 60 85 ldd r22, Z+8 ; 0x08 f3ba: 71 85 ldd r23, Z+9 ; 0x09 f3bc: 82 85 ldd r24, Z+10 ; 0x0a f3be: 93 85 ldd r25, Z+11 ; 0x0b f3c0: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); f3c4: 0f 94 ed 43 call 0x287da ; 0x287da kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f3c8: 8f e8 ldi r24, 0x8F ; 143 f3ca: 93 e6 ldi r25, 0x63 ; 99 f3cc: 0e 94 2c 72 call 0xe458 ; 0xe458 f3d0: 0e 94 8a 79 call 0xf314 ; 0xf314 } } f3d4: 08 95 ret 0000f3d6 : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f3d6: 2f 92 push r2 f3d8: 3f 92 push r3 f3da: 4f 92 push r4 f3dc: 5f 92 push r5 f3de: 6f 92 push r6 f3e0: 7f 92 push r7 f3e2: 8f 92 push r8 f3e4: 9f 92 push r9 f3e6: af 92 push r10 f3e8: bf 92 push r11 f3ea: cf 92 push r12 f3ec: df 92 push r13 f3ee: ef 92 push r14 f3f0: ff 92 push r15 f3f2: 0f 93 push r16 f3f4: 1f 93 push r17 f3f6: cf 93 push r28 f3f8: df 93 push r29 f3fa: cd b7 in r28, 0x3d ; 61 f3fc: de b7 in r29, 0x3e ; 62 f3fe: 60 97 sbiw r28, 0x10 ; 16 f400: 0f b6 in r0, 0x3f ; 63 f402: f8 94 cli f404: de bf out 0x3e, r29 ; 62 f406: 0f be out 0x3f, r0 ; 63 f408: cd bf out 0x3d, r28 ; 61 f40a: 28 2e mov r2, r24 f40c: 6e 87 std Y+14, r22 ; 0x0e f40e: 5a 87 std Y+10, r21 ; 0x0a f410: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f412: 20 91 b7 02 lds r18, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> f416: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f418: 77 24 eor r7, r7 f41a: 73 94 inc r7 f41c: 70 92 b7 02 sts 0x02B7, r7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> 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) f420: 42 e0 ldi r20, 0x02 ; 2 f422: 84 17 cp r24, r20 f424: 09 f4 brne .+2 ; 0xf428 f426: d4 c1 rjmp .+936 ; 0xf7d0 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); f428: 08 2f mov r16, r24 f42a: 10 e0 ldi r17, 0x00 ; 0 f42c: f8 01 movw r30, r16 f42e: e6 57 subi r30, 0x76 ; 118 f430: f4 48 sbci r31, 0x84 ; 132 #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); f432: 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); f434: 83 2d mov r24, r3 f436: 03 2c mov r0, r3 f438: 00 0c add r0, r0 f43a: 99 0b sbc r25, r25 f43c: 9c 87 std Y+12, r25 ; 0x0c f43e: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f440: d8 01 movw r26, r16 f442: aa 0f add r26, r26 f444: bb 1f adc r27, r27 f446: aa 0f add r26, r26 f448: bb 1f adc r27, r27 f44a: ba 83 std Y+2, r27 ; 0x02 f44c: a9 83 std Y+1, r26 ; 0x01 f44e: fd 01 movw r30, r26 f450: e3 53 subi r30, 0x33 ; 51 f452: fd 4f sbci r31, 0xFD ; 253 f454: 80 81 ld r24, Z f456: 91 81 ldd r25, Z+1 ; 0x01 f458: a2 81 ldd r26, Z+2 ; 0x02 f45a: b3 81 ldd r27, Z+3 ; 0x03 f45c: 8b 83 std Y+3, r24 ; 0x03 f45e: 9c 83 std Y+4, r25 ; 0x04 f460: ad 83 std Y+5, r26 ; 0x05 f462: be 83 std Y+6, r27 ; 0x06 f464: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f468: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f46c: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f470: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb float feedrate_mm_s = get_feedrate_mm_s(feedrate); f474: bc 01 movw r22, r24 f476: cd 01 movw r24, r26 f478: 0e 94 47 66 call 0xcc8e ; 0xcc8e f47c: 6b 01 movw r12, r22 f47e: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f480: 81 e0 ldi r24, 0x01 ; 1 f482: 02 2c mov r0, r2 f484: 01 c0 rjmp .+2 ; 0xf488 f486: 88 0f add r24, r24 f488: 0a 94 dec r0 f48a: ea f7 brpl .-6 ; 0xf486 f48c: 0f 94 dd 26 call 0x24dba ; 0x24dba // 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; f490: a9 81 ldd r26, Y+1 ; 0x01 f492: ba 81 ldd r27, Y+2 ; 0x02 f494: ae 56 subi r26, 0x6E ; 110 f496: b9 4f sbci r27, 0xF9 ; 249 f498: b8 87 std Y+8, r27 ; 0x08 f49a: af 83 std Y+7, r26 ; 0x07 f49c: fd 01 movw r30, r26 f49e: 10 82 st Z, r1 f4a0: 11 82 std Z+1, r1 ; 0x01 f4a2: 12 82 std Z+2, r1 ; 0x02 f4a4: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f4a6: 0f 94 41 bf call 0x37e82 ; 0x37e82 set_destination_to_current(); f4aa: 0e 94 ba 67 call 0xcf74 ; 0xcf74 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f4ae: 63 2d mov r22, r3 f4b0: 03 2c mov r0, r3 f4b2: 00 0c add r0, r0 f4b4: 77 0b sbc r23, r23 f4b6: 88 0b sbc r24, r24 f4b8: 99 0b sbc r25, r25 f4ba: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f4be: 4b 01 movw r8, r22 f4c0: 5c 01 movw r10, r24 f4c2: 49 81 ldd r20, Y+1 ; 0x01 f4c4: 5a 81 ldd r21, Y+2 ; 0x02 f4c6: 4c 58 subi r20, 0x8C ; 140 f4c8: 59 4f sbci r21, 0xF9 ; 249 f4ca: 58 8b std Y+16, r21 ; 0x10 f4cc: 4f 87 std Y+15, r20 ; 0x0f f4ce: 20 e0 ldi r18, 0x00 ; 0 f4d0: 30 e0 ldi r19, 0x00 ; 0 f4d2: 40 e4 ldi r20, 0x40 ; 64 f4d4: 50 ec ldi r21, 0xC0 ; 192 f4d6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f4da: af 85 ldd r26, Y+15 ; 0x0f f4dc: b8 89 ldd r27, Y+16 ; 0x10 f4de: 6d 93 st X+, r22 f4e0: 7d 93 st X+, r23 f4e2: 8d 93 st X+, r24 f4e4: 9c 93 st X, r25 f4e6: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f4e8: c7 01 movw r24, r14 f4ea: b6 01 movw r22, r12 f4ec: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f4f0: 0f 94 ed 43 call 0x287da ; 0x287da // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); f4f4: 0f 94 03 4f call 0x29e06 ; 0x29e06 f4f8: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(false); current_position[axis] = 0; f4fc: ef 81 ldd r30, Y+7 ; 0x07 f4fe: f8 85 ldd r31, Y+8 ; 0x08 f500: 10 82 st Z, r1 f502: 11 82 std Z+1, r1 ; 0x01 f504: 12 82 std Z+2, r1 ; 0x02 f506: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f508: 0f 94 41 bf call 0x37e82 ; 0x37e82 destination[axis] = 1. * axis_home_dir; f50c: af 85 ldd r26, Y+15 ; 0x0f f50e: b8 89 ldd r27, Y+16 ; 0x10 f510: 8d 92 st X+, r8 f512: 9d 92 st X+, r9 f514: ad 92 st X+, r10 f516: bc 92 st X, r11 f518: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f51a: c7 01 movw r24, r14 f51c: b6 01 movw r22, r12 f51e: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f522: 0f 94 ed 43 call 0x287da ; 0x287da f526: 70 92 b7 02 sts 0x02B7, r7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> { 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); f52a: e9 81 ldd r30, Y+1 ; 0x01 f52c: fa 81 ldd r31, Y+2 ; 0x02 f52e: e2 58 subi r30, 0x82 ; 130 f530: f4 48 sbci r31, 0x84 ; 132 #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); f532: 45 90 lpm r4, Z+ f534: 55 90 lpm r5, Z+ f536: 65 90 lpm r6, Z+ f538: 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); f53a: 2d ec ldi r18, 0xCD ; 205 f53c: 3c ec ldi r19, 0xCC ; 204 f53e: 4c e8 ldi r20, 0x8C ; 140 f540: 5f e3 ldi r21, 0x3F ; 63 f542: c5 01 movw r24, r10 f544: b4 01 movw r22, r8 f546: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f54a: a3 01 movw r20, r6 f54c: 92 01 movw r18, r4 f54e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f552: ef 85 ldd r30, Y+15 ; 0x0f f554: f8 89 ldd r31, Y+16 ; 0x10 f556: 60 83 st Z, r22 f558: 71 83 std Z+1, r23 ; 0x01 f55a: 82 83 std Z+2, r24 ; 0x02 f55c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f55e: c7 01 movw r24, r14 f560: b6 01 movw r22, r12 f562: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f566: 0f 94 ed 43 call 0x287da ; 0x287da f56a: 71 2c mov r7, r1 f56c: 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; f56e: 4f 80 ldd r4, Y+7 ; 0x07 f570: 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(); f572: 0f 94 03 4f call 0x29e06 ; 0x29e06 f576: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(false); current_position[axis] = 0; f57a: d2 01 movw r26, r4 f57c: 1d 92 st X+, r1 f57e: 1d 92 st X+, r1 f580: 1d 92 st X+, r1 f582: 1c 92 st X, r1 f584: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f586: 0f 94 41 bf call 0x37e82 ; 0x37e82 destination[axis] = -10.f * axis_home_dir; f58a: 20 e0 ldi r18, 0x00 ; 0 f58c: 30 e0 ldi r19, 0x00 ; 0 f58e: 40 e2 ldi r20, 0x20 ; 32 f590: 51 ec ldi r21, 0xC1 ; 193 f592: c5 01 movw r24, r10 f594: b4 01 movw r22, r8 f596: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f59a: ef 85 ldd r30, Y+15 ; 0x0f f59c: f8 89 ldd r31, Y+16 ; 0x10 f59e: 60 83 st Z, r22 f5a0: 71 83 std Z+1, r23 ; 0x01 f5a2: 82 83 std Z+2, r24 ; 0x02 f5a4: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f5a6: c7 01 movw r24, r14 f5a8: b6 01 movw r22, r12 f5aa: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f5ae: 0f 94 ed 43 call 0x287da ; 0x287da endstops_hit_on_purpose(); f5b2: 0f 94 03 4f call 0x29e06 ; 0x29e06 f5b6: f1 e0 ldi r31, 0x01 ; 1 f5b8: f0 93 b7 02 sts 0x02B7, r31 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> // Now move left up to the collision, this time with a repeatable velocity. enable_endstops(true); destination[axis] = 11.f * axis_home_dir; f5bc: 20 e0 ldi r18, 0x00 ; 0 f5be: 30 e0 ldi r19, 0x00 ; 0 f5c0: 40 e3 ldi r20, 0x30 ; 48 f5c2: 51 e4 ldi r21, 0x41 ; 65 f5c4: c5 01 movw r24, r10 f5c6: b4 01 movw r22, r8 f5c8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f5cc: af 85 ldd r26, Y+15 ; 0x0f f5ce: b8 89 ldd r27, Y+16 ; 0x10 f5d0: 6d 93 st X+, r22 f5d2: 7d 93 st X+, r23 f5d4: 8d 93 st X+, r24 f5d6: 9c 93 st X, r25 f5d8: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; f5da: 8b 81 ldd r24, Y+3 ; 0x03 f5dc: 9c 81 ldd r25, Y+4 ; 0x04 f5de: ad 81 ldd r26, Y+5 ; 0x05 f5e0: be 81 ldd r27, Y+6 ; 0x06 f5e2: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f5e6: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f5ea: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f5ee: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb #else //TMC2130 feedrate = homing_feedrate[axis] / 2; feedrate_mm_s = get_feedrate_mm_s(feedrate); #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); f5f2: c7 01 movw r24, r14 f5f4: b6 01 movw r22, r12 f5f6: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f5fa: 0f 94 ed 43 call 0x287da ; 0x287da #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); f5fe: 82 2d mov r24, r2 f600: 0f 94 7a 25 call 0x24af4 ; 0x24af4 f604: 9c 01 movw r18, r24 f606: 44 e0 ldi r20, 0x04 ; 4 f608: 36 95 lsr r19 f60a: 27 95 ror r18 f60c: 4a 95 dec r20 f60e: e1 f7 brne .-8 ; 0xf608 if (pstep) pstep[i] = mscnt >> 4; f610: a9 85 ldd r26, Y+9 ; 0x09 f612: ba 85 ldd r27, Y+10 ; 0x0a f614: 10 97 sbiw r26, 0x00 ; 0 f616: 21 f0 breq .+8 ; 0xf620 f618: fd 01 movw r30, r26 f61a: e6 0d add r30, r6 f61c: f7 1d adc r31, r7 f61e: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); f620: 9f 93 push r25 f622: 8f 93 push r24 f624: 3f 93 push r19 f626: 2f 93 push r18 f628: 7f 92 push r7 f62a: 6f 92 push r6 f62c: e6 e6 ldi r30, 0x66 ; 102 f62e: fb e7 ldi r31, 0x7B ; 123 f630: ff 93 push r31 f632: ef 93 push r30 f634: 0f 94 16 db call 0x3b62c ; 0x3b62c f638: 4f ef ldi r20, 0xFF ; 255 f63a: 64 1a sub r6, r20 f63c: 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++) f63e: 0f b6 in r0, 0x3f ; 63 f640: f8 94 cli f642: de bf out 0x3e, r29 ; 62 f644: 0f be out 0x3f, r0 ; 63 f646: cd bf out 0x3d, r28 ; 61 f648: 9e 85 ldd r25, Y+14 ; 0x0e f64a: 69 16 cp r6, r25 f64c: 08 f4 brcc .+2 ; 0xf650 f64e: 91 cf rjmp .-222 ; 0xf572 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(); f650: 0f 94 03 4f call 0x29e06 ; 0x29e06 f654: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> 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)) f658: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 f65c: 88 23 and r24, r24 f65e: 09 f4 brne .+2 ; 0xf662 f660: b2 c0 rjmp .+356 ; 0xf7c6 } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; f662: f8 01 movw r30, r16 f664: ed 50 subi r30, 0x0D ; 13 f666: fb 4f sbci r31, 0xFB ; 251 f668: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) f66a: 60 34 cpi r22, 0x40 ; 64 f66c: 08 f0 brcs .+2 ; 0xf670 f66e: ab c0 rjmp .+342 ; 0xf7c6 endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; f670: f8 01 movw r30, r16 f672: e6 5a subi r30, 0xA6 ; 166 f674: fd 4f sbci r31, 0xFD ; 253 f676: a0 81 ld r26, Z f678: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); f67a: f8 01 movw r30, r16 f67c: eb 50 subi r30, 0x0B ; 11 f67e: fb 4f sbci r31, 0xFB ; 251 f680: 80 81 ld r24, Z f682: 40 e0 ldi r20, 0x00 ; 0 f684: 51 e0 ldi r21, 0x01 ; 1 f686: 02 c0 rjmp .+4 ; 0xf68c f688: 56 95 lsr r21 f68a: 47 95 ror r20 f68c: 8a 95 dec r24 f68e: e2 f7 brpl .-8 ; 0xf688 if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); f690: 82 2d mov r24, r2 f692: 0f 94 db 8b call 0x317b6 ; 0x317b6 if (back > 0) f696: bb 81 ldd r27, Y+3 ; 0x03 f698: bb 23 and r27, r27 f69a: 39 f0 breq .+14 ; 0xf6aa tmc2130_do_steps(axis, back, -axis_home_dir, 1000); f69c: 43 2d mov r20, r3 f69e: 41 95 neg r20 f6a0: 6b 2f mov r22, r27 f6a2: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); f6a4: 82 2d mov r24, r2 f6a6: 0f 94 ac 8b call 0x31758 ; 0x31758 tmc2130_home_exit(); f6aa: 0f 94 ae 26 call 0x24d5c ; 0x24d5c #endif //TMC2130 axis_is_at_home(axis); f6ae: 82 2d mov r24, r2 f6b0: 0e 94 2a 5a call 0xb454 ; 0xb454 axis_known_position[axis] = true; f6b4: f8 01 movw r30, r16 f6b6: e1 57 subi r30, 0x71 ; 113 f6b8: f9 4f sbci r31, 0xF9 ; 249 f6ba: 81 e0 ldi r24, 0x01 ; 1 f6bc: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; f6be: 6b 85 ldd r22, Y+11 ; 0x0b f6c0: 7c 85 ldd r23, Y+12 ; 0x0c f6c2: 71 95 neg r23 f6c4: 61 95 neg r22 f6c6: 71 09 sbc r23, r1 f6c8: 07 2e mov r0, r23 f6ca: 00 0c add r0, r0 f6cc: 88 0b sbc r24, r24 f6ce: 99 0b sbc r25, r25 f6d0: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f6d4: 2a e0 ldi r18, 0x0A ; 10 f6d6: 37 ed ldi r19, 0xD7 ; 215 f6d8: 43 e2 ldi r20, 0x23 ; 35 f6da: 5c e3 ldi r21, 0x3C ; 60 f6dc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f6e0: 4b 01 movw r8, r22 f6e2: 5c 01 movw r10, r24 f6e4: f8 01 movw r30, r16 f6e6: e8 5a subi r30, 0xA8 ; 168 f6e8: fd 4f sbci r31, 0xFD ; 253 f6ea: 60 81 ld r22, Z f6ec: 70 e0 ldi r23, 0x00 ; 0 f6ee: 90 e0 ldi r25, 0x00 ; 0 f6f0: 80 e0 ldi r24, 0x00 ; 0 f6f2: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f6f6: 9b 01 movw r18, r22 f6f8: ac 01 movw r20, r24 f6fa: c5 01 movw r24, r10 f6fc: b4 01 movw r22, r8 f6fe: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f702: 4b 01 movw r8, r22 f704: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; f706: e9 81 ldd r30, Y+1 ; 0x01 f708: fa 81 ldd r31, Y+2 ; 0x02 f70a: ee 56 subi r30, 0x6E ; 110 f70c: f9 4f sbci r31, 0xF9 ; 249 f70e: fc 83 std Y+4, r31 ; 0x04 f710: eb 83 std Y+3, r30 ; 0x03 f712: ac 01 movw r20, r24 f714: 9b 01 movw r18, r22 f716: 60 81 ld r22, Z f718: 71 81 ldd r23, Z+1 ; 0x01 f71a: 82 81 ldd r24, Z+2 ; 0x02 f71c: 93 81 ldd r25, Z+3 ; 0x03 f71e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> f722: ab 81 ldd r26, Y+3 ; 0x03 f724: bc 81 ldd r27, Y+4 ; 0x04 f726: 6d 93 st X+, r22 f728: 7d 93 st X+, r23 f72a: 8d 93 st X+, r24 f72c: 9c 93 st X, r25 f72e: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f730: 0f 94 41 bf call 0x37e82 ; 0x37e82 current_position[axis] += dist; f734: eb 81 ldd r30, Y+3 ; 0x03 f736: fc 81 ldd r31, Y+4 ; 0x04 f738: 20 81 ld r18, Z f73a: 31 81 ldd r19, Z+1 ; 0x01 f73c: 42 81 ldd r20, Z+2 ; 0x02 f73e: 53 81 ldd r21, Z+3 ; 0x03 f740: c5 01 movw r24, r10 f742: b4 01 movw r22, r8 f744: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> f748: ab 81 ldd r26, Y+3 ; 0x03 f74a: bc 81 ldd r27, Y+4 ; 0x04 f74c: 6d 93 st X+, r22 f74e: 7d 93 st X+, r23 f750: 8d 93 st X+, r24 f752: 9c 93 st X, r25 f754: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; f756: e9 81 ldd r30, Y+1 ; 0x01 f758: fa 81 ldd r31, Y+2 ; 0x02 f75a: ec 58 subi r30, 0x8C ; 140 f75c: f9 4f sbci r31, 0xF9 ; 249 f75e: 60 83 st Z, r22 f760: 71 83 std Z+1, r23 ; 0x01 f762: 82 83 std Z+2, r24 ; 0x02 f764: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); f766: 20 e0 ldi r18, 0x00 ; 0 f768: 30 e0 ldi r19, 0x00 ; 0 f76a: 40 e0 ldi r20, 0x00 ; 0 f76c: 5f e3 ldi r21, 0x3F ; 63 f76e: c7 01 movw r24, r14 f770: b6 01 movw r22, r12 f772: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f776: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f77a: 0f 94 ed 43 call 0x287da ; 0x287da feedrate = 0.0; f77e: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 f782: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 f786: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba f78a: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb f78e: fd 85 ldd r31, Y+13 ; 0x0d f790: f0 93 b7 02 sts 0x02B7, r31 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } f794: 60 96 adiw r28, 0x10 ; 16 f796: 0f b6 in r0, 0x3f ; 63 f798: f8 94 cli f79a: de bf out 0x3e, r29 ; 62 f79c: 0f be out 0x3f, r0 ; 63 f79e: cd bf out 0x3d, r28 ; 61 f7a0: df 91 pop r29 f7a2: cf 91 pop r28 f7a4: 1f 91 pop r17 f7a6: 0f 91 pop r16 f7a8: ff 90 pop r15 f7aa: ef 90 pop r14 f7ac: df 90 pop r13 f7ae: cf 90 pop r12 f7b0: bf 90 pop r11 f7b2: af 90 pop r10 f7b4: 9f 90 pop r9 f7b6: 8f 90 pop r8 f7b8: 7f 90 pop r7 f7ba: 6f 90 pop r6 f7bc: 5f 90 pop r5 f7be: 4f 90 pop r4 f7c0: 3f 90 pop r3 f7c2: 2f 90 pop r2 f7c4: 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); f7c6: 43 2d mov r20, r3 f7c8: 41 95 neg r20 f7ca: 68 e0 ldi r22, 0x08 ; 8 f7cc: 70 e0 ldi r23, 0x00 ; 0 f7ce: 6a cf rjmp .-300 ; 0xf6a4 feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; f7d0: 81 e0 ldi r24, 0x01 ; 1 f7d2: 0e 94 30 66 call 0xcc60 ; 0xcc60 #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); f7d6: ec e8 ldi r30, 0x8C ; 140 f7d8: fb e7 ldi r31, 0x7B ; 123 f7da: b4 91 lpm r27, Z f7dc: 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; f7de: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f7e2: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f7e6: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f7ea: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f7ee: 0f 94 41 bf call 0x37e82 ; 0x37e82 #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); f7f2: e6 e8 ldi r30, 0x86 ; 134 f7f4: fb e7 ldi r31, 0x7B ; 123 f7f6: 85 90 lpm r8, Z+ f7f8: 95 90 lpm r9, Z+ f7fa: a5 90 lpm r10, Z+ f7fc: 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; f7fe: e9 81 ldd r30, Y+1 ; 0x01 f800: 6e 2f mov r22, r30 f802: ee 0f add r30, r30 f804: 77 0b sbc r23, r23 f806: 88 0b sbc r24, r24 f808: 99 0b sbc r25, r25 f80a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> f80e: 6b 01 movw r12, r22 f810: 7c 01 movw r14, r24 f812: 20 e0 ldi r18, 0x00 ; 0 f814: 30 e0 ldi r19, 0x00 ; 0 f816: 40 ec ldi r20, 0xC0 ; 192 f818: 5f e3 ldi r21, 0x3F ; 63 f81a: c5 01 movw r24, r10 f81c: b4 01 movw r22, r8 f81e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f822: a7 01 movw r20, r14 f824: 96 01 movw r18, r12 f826: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f82a: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f82e: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f832: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f836: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f feedrate = homing_feedrate[axis]; f83a: 80 e0 ldi r24, 0x00 ; 0 f83c: 90 e0 ldi r25, 0x00 ; 0 f83e: a8 e4 ldi r26, 0x48 ; 72 f840: b4 e4 ldi r27, 0x44 ; 68 f842: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f846: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f84a: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f84e: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb float feedrate_mm_s = get_feedrate_mm_s(feedrate); f852: bc 01 movw r22, r24 f854: cd 01 movw r24, r26 f856: 0e 94 47 66 call 0xcc8e ; 0xcc8e f85a: 4b 01 movw r8, r22 f85c: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); f85e: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f862: 0f 94 ed 43 call 0x287da ; 0x287da #ifdef TMC2130 check_Z_crash(); f866: 0e 94 b1 79 call 0xf362 ; 0xf362 #endif //TMC2130 current_position[axis] = 0; f86a: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f86e: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f872: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f876: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f87a: 0f 94 41 bf call 0x37e82 ; 0x37e82 #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); f87e: e2 e6 ldi r30, 0x62 ; 98 f880: fb e7 ldi r31, 0x7B ; 123 f882: 65 91 lpm r22, Z+ f884: 75 91 lpm r23, Z+ f886: 85 91 lpm r24, Z+ f888: 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; f88a: 90 58 subi r25, 0x80 ; 128 f88c: a7 01 movw r20, r14 f88e: 96 01 movw r18, r12 f890: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f894: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f898: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f89c: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f8a0: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f plan_buffer_line_destinationXYZE(feedrate_mm_s); f8a4: c5 01 movw r24, r10 f8a6: b4 01 movw r22, r8 f8a8: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f8ac: 0f 94 ed 43 call 0x287da ; 0x287da #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); f8b0: e2 e6 ldi r30, 0x62 ; 98 f8b2: fb e7 ldi r31, 0x7B ; 123 f8b4: 65 91 lpm r22, Z+ f8b6: 75 91 lpm r23, Z+ f8b8: 85 91 lpm r24, Z+ f8ba: 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; f8bc: 9b 01 movw r18, r22 f8be: ac 01 movw r20, r24 f8c0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> f8c4: a7 01 movw r20, r14 f8c6: 96 01 movw r18, r12 f8c8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> f8cc: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f8d0: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f8d4: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f8d8: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f feedrate = homing_feedrate[axis] / 2; f8dc: 80 e0 ldi r24, 0x00 ; 0 f8de: 90 e0 ldi r25, 0x00 ; 0 f8e0: a8 ec ldi r26, 0xC8 ; 200 f8e2: b3 e4 ldi r27, 0x43 ; 67 f8e4: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f8e8: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f8ec: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f8f0: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb feedrate_mm_s = get_feedrate_mm_s(feedrate); f8f4: bc 01 movw r22, r24 f8f6: cd 01 movw r24, r26 f8f8: 0e 94 47 66 call 0xcc8e ; 0xcc8e plan_buffer_line_destinationXYZE(feedrate_mm_s); f8fc: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); f900: 0f 94 ed 43 call 0x287da ; 0x287da #ifdef TMC2130 check_Z_crash(); f904: 0e 94 b1 79 call 0xf362 ; 0xf362 #endif //TMC2130 axis_is_at_home(axis); f908: 82 e0 ldi r24, 0x02 ; 2 f90a: 0e 94 2a 5a call 0xb454 ; 0xb454 destination[axis] = current_position[axis]; f90e: 80 91 9a 06 lds r24, 0x069A ; 0x80069a f912: 90 91 9b 06 lds r25, 0x069B ; 0x80069b f916: a0 91 9c 06 lds r26, 0x069C ; 0x80069c f91a: b0 91 9d 06 lds r27, 0x069D ; 0x80069d f91e: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c f922: 90 93 7d 06 sts 0x067D, r25 ; 0x80067d f926: a0 93 7e 06 sts 0x067E, r26 ; 0x80067e f92a: b0 93 7f 06 sts 0x067F, r27 ; 0x80067f feedrate = 0.0; f92e: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 f932: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 f936: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba f93a: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb endstops_hit_on_purpose(); f93e: 0f 94 03 4f call 0x29e06 ; 0x29e06 axis_known_position[axis] = true; f942: 70 92 91 06 sts 0x0691, r7 ; 0x800691 #ifdef TMC2130 FORCE_HIGH_POWER_END; f946: 80 e0 ldi r24, 0x00 ; 0 f948: 0e 94 30 66 call 0xcc60 ; 0xcc60 f94c: 20 cf rjmp .-448 ; 0xf78e 0000f94e : #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 { f94e: 2f 92 push r2 f950: 3f 92 push r3 f952: 4f 92 push r4 f954: 5f 92 push r5 f956: 6f 92 push r6 f958: 7f 92 push r7 f95a: 8f 92 push r8 f95c: 9f 92 push r9 f95e: af 92 push r10 f960: bf 92 push r11 f962: cf 92 push r12 f964: df 92 push r13 f966: ef 92 push r14 f968: ff 92 push r15 f96a: 0f 93 push r16 f96c: 1f 93 push r17 f96e: cf 93 push r28 f970: df 93 push r29 f972: 00 d0 rcall .+0 ; 0xf974 f974: 1f 92 push r1 f976: 1f 92 push r1 f978: cd b7 in r28, 0x3d ; 61 f97a: de b7 in r29, 0x3e ; 62 f97c: d8 2e mov r13, r24 f97e: 2a 01 movw r4, r20 f980: 3b 01 movw r6, r22 f982: 32 2e mov r3, r18 f984: e9 82 std Y+1, r14 ; 0x01 f986: fa 82 std Y+2, r15 ; 0x02 f988: 0b 83 std Y+3, r16 ; 0x03 f98a: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); f98c: 0f 94 ed 43 call 0x287da ; 0x287da homing_flag = true; f990: 81 e0 ldi r24, 0x01 ; 1 f992: 80 93 a7 0d sts 0x0DA7, r24 ; 0x800da7 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; f996: fc 2c mov r15, r12 f998: e3 2c mov r14, r3 f99a: d3 10 cpse r13, r3 f99c: 10 c0 rjmp .+32 ; 0xf9be f99e: ed 2c mov r14, r13 f9a0: dc 10 cpse r13, r12 f9a2: 0d c0 rjmp .+26 ; 0xf9be // 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); f9a4: 60 e0 ldi r22, 0x00 ; 0 f9a6: 70 e0 ldi r23, 0x00 ; 0 f9a8: 80 ea ldi r24, 0xA0 ; 160 f9aa: 90 e4 ldi r25, 0x40 ; 64 f9ac: 0e 94 e0 6d call 0xdbc0 ; 0xdbc0 // 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; f9b0: ff 24 eor r15, r15 f9b2: f3 94 inc r15 f9b4: ee 24 eor r14, r14 f9b6: e3 94 inc r14 f9b8: 22 24 eor r2, r2 f9ba: 23 94 inc r2 f9bc: 01 c0 rjmp .+2 ; 0xf9c0 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; f9be: 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(); f9c0: 0f 94 6e ce call 0x39cdc ; 0x39cdc // 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; f9c4: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 f9c8: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; f9ca: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); f9ce: 82 e0 ldi r24, 0x02 ; 2 f9d0: 0f 94 d9 43 call 0x287b2 ; 0x287b2 f9d4: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a f9d8: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b f9dc: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c f9e0: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) f9e4: f1 10 cpse r15, r1 babystep_undo(); f9e6: 0f 94 13 ca call 0x39426 ; 0x39426 int l_feedmultiply = setup_for_endstop_move(); f9ea: 81 e0 ldi r24, 0x01 ; 1 f9ec: 0e 94 68 66 call 0xccd0 ; 0xccd0 f9f0: 8c 01 movw r16, r24 set_destination_to_current(); f9f2: 0e 94 ba 67 call 0xcf74 ; 0xcf74 feedrate = 0.0; f9f6: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 f9fa: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 f9fe: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba fa02: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) fa06: 22 20 and r2, r2 fa08: 09 f4 brne .+2 ; 0xfa0c fa0a: 77 c1 rjmp .+750 ; 0xfcfa { if (!calib) fa0c: 9b 8d ldd r25, Y+27 ; 0x1b fa0e: 91 11 cpse r25, r1 fa10: 6a c1 rjmp .+724 ; 0xfce6 homeaxis(X_AXIS); fa12: 50 e0 ldi r21, 0x00 ; 0 fa14: 40 e0 ldi r20, 0x00 ; 0 fa16: 61 e0 ldi r22, 0x01 ; 1 fa18: 80 e0 ldi r24, 0x00 ; 0 fa1a: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 else tmc2130_home_calibrate(X_AXIS); } if(home_y) fa1e: ee 20 and r14, r14 fa20: 31 f0 breq .+12 ; 0xfa2e { if (!calib) homeaxis(Y_AXIS); fa22: 50 e0 ldi r21, 0x00 ; 0 fa24: 40 e0 ldi r20, 0x00 ; 0 fa26: 61 e0 ldi r22, 0x01 ; 1 fa28: 81 e0 ldi r24, 0x01 ; 1 fa2a: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) fa2e: dd 20 and r13, r13 fa30: e9 f0 breq .+58 ; 0xfa6c fa32: 41 14 cp r4, r1 fa34: 51 04 cpc r5, r1 fa36: 61 04 cpc r6, r1 fa38: 71 04 cpc r7, r1 fa3a: c1 f0 breq .+48 ; 0xfa6c current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; fa3c: c3 01 movw r24, r6 fa3e: b2 01 movw r22, r4 fa40: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> fa44: 9b 01 movw r18, r22 fa46: ac 01 movw r20, r24 fa48: 60 91 16 0e lds r22, 0x0E16 ; 0x800e16 fa4c: 70 91 17 0e lds r23, 0x0E17 ; 0x800e17 fa50: 80 91 18 0e lds r24, 0x0E18 ; 0x800e18 fa54: 90 91 19 0e lds r25, 0x0E19 ; 0x800e19 fa58: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> fa5c: 60 93 92 06 sts 0x0692, r22 ; 0x800692 fa60: 70 93 93 06 sts 0x0693, r23 ; 0x800693 fa64: 80 93 94 06 sts 0x0694, r24 ; 0x800694 fa68: 90 93 95 06 sts 0x0695, r25 ; 0x800695 if(home_y_axis && home_y_value != 0) fa6c: 33 20 and r3, r3 fa6e: 01 f1 breq .+64 ; 0xfab0 fa70: 89 81 ldd r24, Y+1 ; 0x01 fa72: 9a 81 ldd r25, Y+2 ; 0x02 fa74: ab 81 ldd r26, Y+3 ; 0x03 fa76: bc 81 ldd r27, Y+4 ; 0x04 fa78: 00 97 sbiw r24, 0x00 ; 0 fa7a: a1 05 cpc r26, r1 fa7c: b1 05 cpc r27, r1 fa7e: c1 f0 breq .+48 ; 0xfab0 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; fa80: bc 01 movw r22, r24 fa82: cd 01 movw r24, r26 fa84: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> fa88: 9b 01 movw r18, r22 fa8a: ac 01 movw r20, r24 fa8c: 60 91 1a 0e lds r22, 0x0E1A ; 0x800e1a fa90: 70 91 1b 0e lds r23, 0x0E1B ; 0x800e1b fa94: 80 91 1c 0e lds r24, 0x0E1C ; 0x800e1c fa98: 90 91 1d 0e lds r25, 0x0E1D ; 0x800e1d fa9c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> faa0: 60 93 96 06 sts 0x0696, r22 ; 0x800696 faa4: 70 93 97 06 sts 0x0697, r23 ; 0x800697 faa8: 80 93 98 06 sts 0x0698, r24 ; 0x800698 faac: 90 93 99 06 sts 0x0699, r25 ; 0x800699 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { fab0: ff 20 and r15, r15 fab2: 09 f4 brne .+2 ; 0xfab6 fab4: a2 c0 rjmp .+324 ; 0xfbfa #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); fab6: 60 e0 ldi r22, 0x00 ; 0 fab8: 70 e0 ldi r23, 0x00 ; 0 faba: 80 ea ldi r24, 0xA0 ; 160 fabc: 90 e4 ldi r25, 0x40 ; 64 fabe: 0e 94 e0 6d call 0xdbc0 ; 0xdbc0 if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); fac2: 80 91 8f 06 lds r24, 0x068F ; 0x80068f fac6: 81 11 cpse r24, r1 fac8: 05 c0 rjmp .+10 ; 0xfad4 faca: 50 e0 ldi r21, 0x00 ; 0 facc: 40 e0 ldi r20, 0x00 ; 0 face: 61 e0 ldi r22, 0x01 ; 1 fad0: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); fad4: 80 91 90 06 lds r24, 0x0690 ; 0x800690 fad8: 81 11 cpse r24, r1 fada: 06 c0 rjmp .+12 ; 0xfae8 fadc: 50 e0 ldi r21, 0x00 ; 0 fade: 40 e0 ldi r20, 0x00 ; 0 fae0: 61 e0 ldi r22, 0x01 ; 1 fae2: 81 e0 ldi r24, 0x01 ; 1 fae4: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); fae8: 0f 94 d3 ce call 0x39da6 ; 0x39da6 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); faec: e3 ef ldi r30, 0xF3 ; 243 faee: f4 ea ldi r31, 0xA4 ; 164 faf0: 85 91 lpm r24, Z+ faf2: 95 91 lpm r25, Z+ faf4: a5 91 lpm r26, Z+ faf6: b4 91 lpm r27, Z faf8: ef ee ldi r30, 0xEF ; 239 fafa: f4 ea ldi r31, 0xA4 ; 164 fafc: 45 91 lpm r20, Z+ fafe: 55 91 lpm r21, Z+ fb00: 65 91 lpm r22, Z+ fb02: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; fb04: 40 93 74 06 sts 0x0674, r20 ; 0x800674 fb08: 50 93 75 06 sts 0x0675, r21 ; 0x800675 fb0c: 60 93 76 06 sts 0x0676, r22 ; 0x800676 fb10: 70 93 77 06 sts 0x0677, r23 ; 0x800677 out_y = y; fb14: 80 93 78 06 sts 0x0678, r24 ; 0x800678 fb18: 90 93 79 06 sts 0x0679, r25 ; 0x800679 fb1c: a0 93 7a 06 sts 0x067A, r26 ; 0x80067a fb20: b0 93 7b 06 sts 0x067B, r27 ; 0x80067b world2machine(out_x, out_y); fb24: 68 e7 ldi r22, 0x78 ; 120 fb26: 76 e0 ldi r23, 0x06 ; 6 fb28: 84 e7 ldi r24, 0x74 ; 116 fb2a: 96 e0 ldi r25, 0x06 ; 6 fb2c: 0e 94 82 69 call 0xd304 ; 0xd304 world2machine_reset(); fb30: 0f 94 35 ce call 0x39c6a ; 0x39c6a if (destination[Y_AXIS] < Y_MIN_POS) fb34: 20 e0 ldi r18, 0x00 ; 0 fb36: 30 e0 ldi r19, 0x00 ; 0 fb38: 40 e8 ldi r20, 0x80 ; 128 fb3a: 50 ec ldi r21, 0xC0 ; 192 fb3c: 60 91 78 06 lds r22, 0x0678 ; 0x800678 fb40: 70 91 79 06 lds r23, 0x0679 ; 0x800679 fb44: 80 91 7a 06 lds r24, 0x067A ; 0x80067a fb48: 90 91 7b 06 lds r25, 0x067B ; 0x80067b fb4c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> fb50: 87 ff sbrs r24, 7 fb52: 0c c0 rjmp .+24 ; 0xfb6c destination[Y_AXIS] = Y_MIN_POS; fb54: 80 e0 ldi r24, 0x00 ; 0 fb56: 90 e0 ldi r25, 0x00 ; 0 fb58: a0 e8 ldi r26, 0x80 ; 128 fb5a: b0 ec ldi r27, 0xC0 ; 192 fb5c: 80 93 78 06 sts 0x0678, r24 ; 0x800678 fb60: 90 93 79 06 sts 0x0679, r25 ; 0x800679 fb64: a0 93 7a 06 sts 0x067A, r26 ; 0x80067a fb68: b0 93 7b 06 sts 0x067B, r27 ; 0x80067b feedrate = homing_feedrate[X_AXIS] / 20; fb6c: 80 e0 ldi r24, 0x00 ; 0 fb6e: 90 e0 ldi r25, 0x00 ; 0 fb70: a6 e1 ldi r26, 0x16 ; 22 fb72: b3 e4 ldi r27, 0x43 ; 67 fb74: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 fb78: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 fb7c: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba fb80: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb fb84: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> #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(); fb88: 0f 94 41 bf call 0x37e82 ; 0x37e82 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); fb8c: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 fb90: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 fb94: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba fb98: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb fb9c: 0f 94 4e c0 call 0x3809c ; 0x3809c st_synchronize(); fba0: 0f 94 ed 43 call 0x287da ; 0x287da current_position[X_AXIS] = destination[X_AXIS]; fba4: 80 91 74 06 lds r24, 0x0674 ; 0x800674 fba8: 90 91 75 06 lds r25, 0x0675 ; 0x800675 fbac: a0 91 76 06 lds r26, 0x0676 ; 0x800676 fbb0: b0 91 77 06 lds r27, 0x0677 ; 0x800677 fbb4: 80 93 92 06 sts 0x0692, r24 ; 0x800692 fbb8: 90 93 93 06 sts 0x0693, r25 ; 0x800693 fbbc: a0 93 94 06 sts 0x0694, r26 ; 0x800694 fbc0: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = destination[Y_AXIS]; fbc4: 80 91 78 06 lds r24, 0x0678 ; 0x800678 fbc8: 90 91 79 06 lds r25, 0x0679 ; 0x800679 fbcc: a0 91 7a 06 lds r26, 0x067A ; 0x80067a fbd0: b0 91 7b 06 lds r27, 0x067B ; 0x80067b fbd4: 80 93 96 06 sts 0x0696, r24 ; 0x800696 fbd8: 90 93 97 06 sts 0x0697, r25 ; 0x800697 fbdc: a0 93 98 06 sts 0x0698, r26 ; 0x800698 fbe0: b0 93 99 06 sts 0x0699, r27 ; 0x800699 fbe4: 81 e0 ldi r24, 0x01 ; 1 fbe6: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(true); endstops_hit_on_purpose(); fbea: 0f 94 03 4f call 0x29e06 ; 0x29e06 homeaxis(Z_AXIS); fbee: 50 e0 ldi r21, 0x00 ; 0 fbf0: 40 e0 ldi r20, 0x00 ; 0 fbf2: 61 e0 ldi r22, 0x01 ; 1 fbf4: 82 e0 ldi r24, 0x02 ; 2 fbf6: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) fbfa: cc 20 and r12, r12 fbfc: e9 f0 breq .+58 ; 0xfc38 fbfe: 81 14 cp r8, r1 fc00: 91 04 cpc r9, r1 fc02: a1 04 cpc r10, r1 fc04: b1 04 cpc r11, r1 fc06: c1 f0 breq .+48 ; 0xfc38 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; fc08: c5 01 movw r24, r10 fc0a: b4 01 movw r22, r8 fc0c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> fc10: 9b 01 movw r18, r22 fc12: ac 01 movw r20, r24 fc14: 60 91 1e 0e lds r22, 0x0E1E ; 0x800e1e fc18: 70 91 1f 0e lds r23, 0x0E1F ; 0x800e1f fc1c: 80 91 20 0e lds r24, 0x0E20 ; 0x800e20 fc20: 90 91 21 0e lds r25, 0x0E21 ; 0x800e21 fc24: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> fc28: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a fc2c: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b fc30: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c fc34: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d // 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(); fc38: 0f 94 41 bf call 0x37e82 ; 0x37e82 clean_up_after_endstop_move(l_feedmultiply); fc3c: c8 01 movw r24, r16 fc3e: 0e 94 4e 66 call 0xcc9c ; 0xcc9c endstops_hit_on_purpose(); fc42: 0f 94 03 4f call 0x29e06 ; 0x29e06 // Load the machine correction matrix world2machine_initialize(); fc46: 0f 94 d3 ce call 0x39da6 ; 0x39da6 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); fc4a: 0f 94 71 cc call 0x398e2 ; 0x398e2 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) fc4e: d1 10 cpse r13, r1 fc50: 07 c0 rjmp .+14 ; 0xfc60 fc52: 31 10 cpse r3, r1 fc54: 05 c0 rjmp .+10 ; 0xfc60 fc56: 8c 8d ldd r24, Y+28 ; 0x1c fc58: 81 11 cpse r24, r1 fc5a: 02 c0 rjmp .+4 ; 0xfc60 fc5c: cc 20 and r12, r12 fc5e: 39 f1 breq .+78 ; 0xfcae { if (! home_z && mbl_was_active) { fc60: f1 10 cpse r15, r1 fc62: 25 c0 rjmp .+74 ; 0xfcae fc64: 9d 81 ldd r25, Y+5 ; 0x05 fc66: 99 23 and r25, r25 fc68: 11 f1 breq .+68 ; 0xfcae // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; fc6a: 81 e0 ldi r24, 0x01 ; 1 fc6c: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 // 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)); fc70: 0f 94 d9 43 call 0x287b2 ; 0x287b2 fc74: 6b 01 movw r12, r22 fc76: 7c 01 movw r14, r24 fc78: 80 e0 ldi r24, 0x00 ; 0 fc7a: 0f 94 d9 43 call 0x287b2 ; 0x287b2 fc7e: a7 01 movw r20, r14 fc80: 96 01 movw r18, r12 fc82: 0f 94 e9 a1 call 0x343d2 ; 0x343d2 fc86: 9b 01 movw r18, r22 fc88: ac 01 movw r20, r24 fc8a: 60 91 9a 06 lds r22, 0x069A ; 0x80069a fc8e: 70 91 9b 06 lds r23, 0x069B ; 0x80069b fc92: 80 91 9c 06 lds r24, 0x069C ; 0x80069c fc96: 90 91 9d 06 lds r25, 0x069D ; 0x80069d fc9a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> fc9e: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a fca2: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b fca6: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c fcaa: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } #endif prusa_statistics(20); st_synchronize(); fcae: 0f 94 ed 43 call 0x287da ; 0x287da homing_flag = false; fcb2: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 #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 } fcb6: 0f 90 pop r0 fcb8: 0f 90 pop r0 fcba: 0f 90 pop r0 fcbc: 0f 90 pop r0 fcbe: 0f 90 pop r0 fcc0: df 91 pop r29 fcc2: cf 91 pop r28 fcc4: 1f 91 pop r17 fcc6: 0f 91 pop r16 fcc8: ff 90 pop r15 fcca: ef 90 pop r14 fccc: df 90 pop r13 fcce: cf 90 pop r12 fcd0: bf 90 pop r11 fcd2: af 90 pop r10 fcd4: 9f 90 pop r9 fcd6: 8f 90 pop r8 fcd8: 7f 90 pop r7 fcda: 6f 90 pop r6 fcdc: 5f 90 pop r5 fcde: 4f 90 pop r4 fce0: 3f 90 pop r3 fce2: 2f 90 pop r2 fce4: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); fce6: 80 e0 ldi r24, 0x00 ; 0 fce8: 0f 94 a0 23 call 0x24740 ; 0x24740 } if(home_y) fcec: ee 20 and r14, r14 fcee: 09 f4 brne .+2 ; 0xfcf2 fcf0: 9e ce rjmp .-708 ; 0xfa2e { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); fcf2: 81 e0 ldi r24, 0x01 ; 1 fcf4: 0f 94 a0 23 call 0x24740 ; 0x24740 fcf8: 9a ce rjmp .-716 ; 0xfa2e homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) fcfa: ee 20 and r14, r14 fcfc: 09 f4 brne .+2 ; 0xfd00 fcfe: 97 ce rjmp .-722 ; 0xfa2e { if (!calib) fd00: ab 8d ldd r26, Y+27 ; 0x1b fd02: aa 23 and r26, r26 fd04: 09 f4 brne .+2 ; 0xfd08 fd06: 8d ce rjmp .-742 ; 0xfa22 fd08: f4 cf rjmp .-24 ; 0xfcf2 0000fd0a : 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) { fd0a: 8f 92 push r8 fd0c: 9f 92 push r9 fd0e: af 92 push r10 fd10: bf 92 push r11 fd12: cf 92 push r12 fd14: ef 92 push r14 fd16: ff 92 push r15 fd18: 0f 93 push r16 fd1a: 1f 93 push r17 fd1c: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); fd1e: 91 e0 ldi r25, 0x01 ; 1 fd20: 9f 93 push r25 fd22: 1f 92 push r1 fd24: 81 2c mov r8, r1 fd26: 91 2c mov r9, r1 fd28: 54 01 movw r10, r8 fd2a: c4 2e mov r12, r20 fd2c: e1 2c mov r14, r1 fd2e: f1 2c mov r15, r1 fd30: 87 01 movw r16, r14 fd32: 40 e0 ldi r20, 0x00 ; 0 fd34: 50 e0 ldi r21, 0x00 ; 0 fd36: ba 01 movw r22, r20 fd38: 0e 94 a7 7c call 0xf94e ; 0xf94e fd3c: 0f 90 pop r0 fd3e: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } fd40: 1f 91 pop r17 fd42: 0f 91 pop r16 fd44: ff 90 pop r15 fd46: ef 90 pop r14 fd48: cf 90 pop r12 fd4a: bf 90 pop r11 fd4c: af 90 pop r10 fd4e: 9f 90 pop r9 fd50: 8f 90 pop r8 fd52: 08 95 ret 0000fd54 : // 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(); fd54: 86 e8 ldi r24, 0x86 ; 134 fd56: 93 e0 ldi r25, 0x03 ; 3 fd58: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) fd5c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 fd60: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 fd64: 89 2b or r24, r25 fd66: 79 f0 breq .+30 ; 0xfd86 fd68: e0 91 92 12 lds r30, 0x1292 ; 0x801292 fd6c: f0 91 93 12 lds r31, 0x1293 ; 0x801293 fd70: eb 55 subi r30, 0x5B ; 91 fd72: ff 4e sbci r31, 0xEF ; 239 fd74: 80 81 ld r24, Z fd76: 81 30 cpi r24, 0x01 ; 1 fd78: 11 f0 breq .+4 ; 0xfd7e fd7a: 86 30 cpi r24, 0x06 ; 6 fd7c: 21 f4 brne .+8 ; 0xfd86 SERIAL_PROTOCOLLNRPGM(MSG_OK); fd7e: 87 e1 ldi r24, 0x17 ; 23 fd80: 9d e6 ldi r25, 0x6D ; 109 fd82: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 } fd86: 08 95 ret 0000fd88 : void cmdqueue_reset() { while (buflen) fd88: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 fd8c: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 fd90: 89 2b or r24, r25 fd92: 29 f0 breq .+10 ; 0xfd9e { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); fd94: 0e 94 aa 7e call 0xfd54 ; 0xfd54 cmdqueue_pop_front(); fd98: 0e 94 3c 76 call 0xec78 ; 0xec78 fd9c: f5 cf rjmp .-22 ; 0xfd88 } bufindr = 0; fd9e: 10 92 93 12 sts 0x1293, r1 ; 0x801293 fda2: 10 92 92 12 sts 0x1292, r1 ; 0x801292 bufindw = 0; fda6: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> fdaa: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> //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; fdae: 81 e0 ldi r24, 0x01 ; 1 fdb0: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 } fdb4: 08 95 ret 0000fdb6 : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { fdb6: ef 92 push r14 fdb8: ff 92 push r15 fdba: 0f 93 push r16 fdbc: 1f 93 push r17 fdbe: cf 93 push r28 fdc0: df 93 push r29 if (mbl.active) { fdc2: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 fdc6: 88 23 and r24, r24 fdc8: 89 f1 breq .+98 ; 0xfe2c } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); fdca: 86 e7 ldi r24, 0x76 ; 118 fdcc: 9c e7 ldi r25, 0x7C ; 124 fdce: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); fdd2: 80 e6 ldi r24, 0x60 ; 96 fdd4: 9c e7 ldi r25, 0x7C ; 124 fdd6: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 SERIAL_PROTOCOLLNPGM("Measured points:"); fdda: 8f e4 ldi r24, 0x4F ; 79 fddc: 9c e7 ldi r25, 0x7C ; 124 fdde: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { fde2: c7 e0 ldi r28, 0x07 ; 7 fde4: dc e1 ldi r29, 0x1C ; 28 fde6: c1 50 subi r28, 0x01 ; 1 fde8: 58 f1 brcs .+86 ; 0xfe40 fdea: cd 9f mul r28, r29 fdec: 70 01 movw r14, r0 fdee: 11 24 eor r1, r1 fdf0: 01 e0 ldi r16, 0x01 ; 1 fdf2: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); fdf4: 8c e4 ldi r24, 0x4C ; 76 fdf6: 9c e7 ldi r25, 0x7C ; 124 fdf8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOL_F(z_values[y][x], 5); fdfc: f8 01 movw r30, r16 fdfe: ee 0f add r30, r30 fe00: ff 1f adc r31, r31 fe02: ee 0f add r30, r30 fe04: ff 1f adc r31, r31 fe06: ee 0d add r30, r14 fe08: ff 1d adc r31, r15 fe0a: e1 54 subi r30, 0x41 ; 65 fe0c: fc 4e sbci r31, 0xEC ; 236 fe0e: 60 81 ld r22, Z fe10: 71 81 ldd r23, Z+1 ; 0x01 fe12: 82 81 ldd r24, Z+2 ; 0x02 fe14: 93 81 ldd r25, Z+3 ; 0x03 fe16: 45 e0 ldi r20, 0x05 ; 5 fe18: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e fe1c: 0f 5f subi r16, 0xFF ; 255 fe1e: 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++) { fe20: 08 30 cpi r16, 0x08 ; 8 fe22: 11 05 cpc r17, r1 fe24: 39 f7 brne .-50 ; 0xfdf4 SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); fe26: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a fe2a: dd cf rjmp .-70 ; 0xfde6 mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); fe2c: 83 e8 ldi r24, 0x83 ; 131 fe2e: 9c e7 ldi r25, 0x7C ; 124 return; } fe30: df 91 pop r29 fe32: cf 91 pop r28 fe34: 1f 91 pop r17 fe36: 0f 91 pop r16 fe38: ff 90 pop r15 fe3a: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); fe3c: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 return; } fe40: df 91 pop r29 fe42: cf 91 pop r28 fe44: 1f 91 pop r17 fe46: 0f 91 pop r16 fe48: ff 90 pop r15 fe4a: ef 90 pop r14 fe4c: 08 95 ret 0000fe4e : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { fe4e: 8f 92 push r8 fe50: 9f 92 push r9 fe52: af 92 push r10 fe54: bf 92 push r11 fe56: cf 92 push r12 fe58: df 92 push r13 fe5a: ef 92 push r14 fe5c: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); fe5e: 0f 94 51 2a call 0x254a2 ; 0x254a2 fe62: 6b 01 movw r12, r22 fe64: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { fe66: 20 91 2f 02 lds r18, 0x022F ; 0x80022f fe6a: 22 23 and r18, r18 fe6c: 09 f1 breq .+66 ; 0xfeb0 fe6e: 40 91 be 02 lds r20, 0x02BE ; 0x8002be fe72: 41 30 cpi r20, 0x01 ; 1 fe74: e9 f0 breq .+58 ; 0xfeb0 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; fe76: 80 91 10 02 lds r24, 0x0210 ; 0x800210 fe7a: 90 91 11 02 lds r25, 0x0211 ; 0x800211 fe7e: a0 91 12 02 lds r26, 0x0212 ; 0x800212 fe82: b0 91 13 02 lds r27, 0x0213 ; 0x800213 fe86: 46 01 movw r8, r12 fe88: 57 01 movw r10, r14 fe8a: 88 1a sub r8, r24 fe8c: 99 0a sbc r9, r25 fe8e: aa 0a sbc r10, r26 fe90: bb 0a sbc r11, r27 fe92: 30 e0 ldi r19, 0x00 ; 0 fe94: a8 ee ldi r26, 0xE8 ; 232 fe96: b3 e0 ldi r27, 0x03 ; 3 fe98: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> fe9c: 86 16 cp r8, r22 fe9e: 97 06 cpc r9, r23 fea0: a8 06 cpc r10, r24 fea2: b9 06 cpc r11, r25 fea4: 6c f0 brlt .+26 ; 0xfec0 switch (busy_state) { fea6: 44 30 cpi r20, 0x04 ; 4 fea8: 31 f1 breq .+76 ; 0xfef6 feaa: 9c f4 brge .+38 ; 0xfed2 feac: 42 30 cpi r20, 0x02 ; 2 feae: d4 f4 brge .+52 ; 0xfee4 break; default: break; } } prev_busy_signal_ms = ms; feb0: c0 92 10 02 sts 0x0210, r12 ; 0x800210 feb4: d0 92 11 02 sts 0x0211, r13 ; 0x800211 feb8: e0 92 12 02 sts 0x0212, r14 ; 0x800212 febc: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } fec0: ff 90 pop r15 fec2: ef 90 pop r14 fec4: df 90 pop r13 fec6: cf 90 pop r12 fec8: bf 90 pop r11 feca: af 90 pop r10 fecc: 9f 90 pop r9 fece: 8f 90 pop r8 fed0: 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) { fed2: 45 30 cpi r20, 0x05 ; 5 fed4: 69 f7 brne .-38 ; 0xfeb0 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; fed6: 82 ec ldi r24, 0xC2 ; 194 fed8: 9a ea ldi r25, 0xAA ; 170 feda: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM("busy: paused for input"); fede: 88 ef ldi r24, 0xF8 ; 248 fee0: 9a e7 ldi r25, 0x7A ; 122 fee2: 06 c0 rjmp .+12 ; 0xfef0 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; fee4: 82 ec ldi r24, 0xC2 ; 194 fee6: 9a ea ldi r25, 0xAA ; 170 fee8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM("busy: processing"); feec: 85 e2 ldi r24, 0x25 ; 37 feee: 9b e7 ldi r25, 0x7B ; 123 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); fef0: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 fef4: dd cf rjmp .-70 ; 0xfeb0 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; fef6: 82 ec ldi r24, 0xC2 ; 194 fef8: 9a ea ldi r25, 0xAA ; 170 fefa: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM("busy: paused for user"); fefe: 8f e0 ldi r24, 0x0F ; 15 ff00: 9b e7 ldi r25, 0x7B ; 123 ff02: f6 cf rjmp .-20 ; 0xfef0 0000ff04 : //} } #endif //TACH_0 void checkFans() { ff04: cf 92 push r12 ff06: df 92 push r13 ff08: ef 92 push r14 ff0a: ff 92 push r15 ff0c: 0f 93 push r16 ff0e: 1f 93 push r17 ff10: cf 93 push r28 ff12: df 93 push r29 ff14: 1f 92 push r1 ff16: 1f 92 push r1 ff18: cd b7 in r28, 0x3d ; 61 ff1a: 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)) { ff1c: 0f 94 51 2a call 0x254a2 ; 0x254a2 ff20: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 ff24: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 ff28: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 ff2c: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 ff30: 60 1b sub r22, r16 ff32: 71 0b sbc r23, r17 ff34: 82 0b sbc r24, r18 ff36: 93 0b sbc r25, r19 ff38: 69 38 cpi r22, 0x89 ; 137 ff3a: 73 41 sbci r23, 0x13 ; 19 ff3c: 81 05 cpc r24, r1 ff3e: 91 05 cpc r25, r1 ff40: d0 f0 brcs .+52 ; 0xff76 ff42: 80 91 6f 06 lds r24, 0x066F ; 0x80066f ff46: 81 11 cpse r24, r1 ff48: 16 c0 rjmp .+44 ; 0xff76 extruder_autofan_last_check = _millis(); ff4a: 0f 94 51 2a call 0x254a2 ; 0x254a2 ff4e: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 ff52: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 ff56: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 ff5a: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fanSpeedBckp = fanSpeedSoftPwm; ff5e: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 ff62: 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 ff66: 8b 34 cpi r24, 0x4B ; 75 ff68: 18 f0 brcs .+6 ; 0xff70 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; ff6a: 8f ef ldi r24, 0xFF ; 255 ff6c: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 } fan_measuring = true; ff70: 81 e0 ldi r24, 0x01 ; 1 ff72: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { ff76: 0f 94 51 2a call 0x254a2 ; 0x254a2 ff7a: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 ff7e: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 ff82: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 ff86: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 ff8a: 60 1b sub r22, r16 ff8c: 71 0b sbc r23, r17 ff8e: 82 0b sbc r24, r18 ff90: 93 0b sbc r25, r19 ff92: 65 36 cpi r22, 0x65 ; 101 ff94: 71 05 cpc r23, r1 ff96: 81 05 cpc r24, r1 ff98: 91 05 cpc r25, r1 ff9a: 08 f4 brcc .+2 ; 0xff9e ff9c: 57 c1 rjmp .+686 ; 0x1024c ff9e: 80 91 6f 06 lds r24, 0x066F ; 0x80066f ffa2: 88 23 and r24, r24 ffa4: 09 f4 brne .+2 ; 0xffa8 ffa6: 52 c1 rjmp .+676 ; 0x1024c #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) void countFanSpeed() { //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))); ffa8: 60 91 e2 05 lds r22, 0x05E2 ; 0x8005e2 ffac: 70 91 e3 05 lds r23, 0x05E3 ; 0x8005e3 ffb0: 07 2e mov r0, r23 ffb2: 00 0c add r0, r0 ffb4: 88 0b sbc r24, r24 ffb6: 99 0b sbc r25, r25 ffb8: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> ffbc: 6b 01 movw r12, r22 ffbe: 7c 01 movw r14, r24 ffc0: 0f 94 51 2a call 0x254a2 ; 0x254a2 ffc4: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 ffc8: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 ffcc: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 ffd0: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 ffd4: 60 1b sub r22, r16 ffd6: 71 0b sbc r23, r17 ffd8: 82 0b sbc r24, r18 ffda: 93 0b sbc r25, r19 ffdc: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> ffe0: 9b 01 movw r18, r22 ffe2: ac 01 movw r20, r24 ffe4: 60 e0 ldi r22, 0x00 ; 0 ffe6: 70 e0 ldi r23, 0x00 ; 0 ffe8: 8a e7 ldi r24, 0x7A ; 122 ffea: 93 e4 ldi r25, 0x43 ; 67 ffec: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> fff0: a7 01 movw r20, r14 fff2: 96 01 movw r18, r12 fff4: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> fff8: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> fffc: 70 93 ca 03 sts 0x03CA, r23 ; 0x8003ca 10000: 60 93 c9 03 sts 0x03C9, r22 ; 0x8003c9 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 10004: 60 91 e4 05 lds r22, 0x05E4 ; 0x8005e4 10008: 70 91 e5 05 lds r23, 0x05E5 ; 0x8005e5 1000c: 07 2e mov r0, r23 1000e: 00 0c add r0, r0 10010: 88 0b sbc r24, r24 10012: 99 0b sbc r25, r25 10014: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 10018: 6b 01 movw r12, r22 1001a: 7c 01 movw r14, r24 1001c: 0f 94 51 2a call 0x254a2 ; 0x254a2 10020: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 10024: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 10028: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 1002c: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 10030: 60 1b sub r22, r16 10032: 71 0b sbc r23, r17 10034: 82 0b sbc r24, r18 10036: 93 0b sbc r25, r19 10038: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 1003c: 9b 01 movw r18, r22 1003e: ac 01 movw r20, r24 10040: 60 e0 ldi r22, 0x00 ; 0 10042: 70 e0 ldi r23, 0x00 ; 0 10044: 8a e7 ldi r24, 0x7A ; 122 10046: 93 e4 ldi r25, 0x43 ; 67 10048: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 1004c: a7 01 movw r20, r14 1004e: 96 01 movw r18, r12 10050: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 10054: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 10058: 8b 01 movw r16, r22 1005a: 70 93 cc 03 sts 0x03CC, r23 ; 0x8003cc 1005e: 60 93 cb 03 sts 0x03CB, r22 ; 0x8003cb /*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; 10062: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 10066: 10 92 e2 05 sts 0x05E2, r1 ; 0x8005e2 fan_edge_counter[1] = 0; 1006a: 10 92 e5 05 sts 0x05E5, r1 ; 0x8005e5 1006e: 10 92 e4 05 sts 0x05E4, r1 ; 0x8005e4 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 10072: 83 e0 ldi r24, 0x03 ; 3 10074: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 10076: 82 e0 ldi r24, 0x02 ; 2 10078: 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) 1007a: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1007e: 88 23 and r24, r24 10080: 51 f0 breq .+20 ; 0x10096 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 10082: 87 e8 ldi r24, 0x87 ; 135 10084: 9f e0 ldi r25, 0x0F ; 15 10086: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1008a: 91 e0 ldi r25, 0x01 ; 1 1008c: 81 11 cpse r24, r1 1008e: 01 c0 rjmp .+2 ; 0x10092 10090: 90 e0 ldi r25, 0x00 ; 0 10092: 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]++;} 10096: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1009a: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1009e: 44 97 sbiw r24, 0x14 ; 20 100a0: 0c f0 brlt .+2 ; 0x100a4 100a2: 9d c0 rjmp .+314 ; 0x101de 100a4: 20 e0 ldi r18, 0x00 ; 0 100a6: 30 e0 ldi r19, 0x00 ; 0 100a8: 48 e4 ldi r20, 0x48 ; 72 100aa: 52 e4 ldi r21, 0x42 ; 66 100ac: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 100b0: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 100b4: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 100b8: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 100bc: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 100c0: 18 16 cp r1, r24 100c2: 0c f0 brlt .+2 ; 0x100c6 100c4: 8c c0 rjmp .+280 ; 0x101de 100c6: 80 91 4e 03 lds r24, 0x034E ; 0x80034e 100ca: 8f 5f subi r24, 0xFF ; 255 100cc: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e else fan_speed_errors[0] = 0; #endif #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; 100d0: 05 30 cpi r16, 0x05 ; 5 100d2: 11 05 cpc r17, r1 100d4: 0c f0 brlt .+2 ; 0x100d8 100d6: 89 c0 rjmp .+274 ; 0x101ea 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); 100d8: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 100dc: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 100e0: 98 17 cp r25, r24 100e2: 09 f4 brne .+2 ; 0x100e6 100e4: 7f c0 rjmp .+254 ; 0x101e4 100e6: e0 91 a6 0d lds r30, 0x0DA6 ; 0x800da6 100ea: 8e e6 ldi r24, 0x6E ; 110 100ec: e8 9f mul r30, r24 100ee: f0 01 movw r30, r0 100f0: 11 24 eor r1, r1 100f2: e5 5f subi r30, 0xF5 ; 245 100f4: f8 4f sbci r31, 0xF8 ; 248 100f6: 80 81 ld r24, Z 100f8: 8c 34 cpi r24, 0x4C ; 76 100fa: 08 f4 brcc .+2 ; 0x100fe 100fc: 76 c0 rjmp .+236 ; 0x101ea 100fe: 80 91 4f 03 lds r24, 0x034F ; 0x80034f 10102: 8f 5f subi r24, 0xFF ; 255 10104: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f else fan_speed_errors[1] = 0; #endif // drop the fan_check_error flag when both fans are ok if( fan_speed_errors[0] == 0 && fan_speed_errors[1] == 0 && fan_check_error == EFCE_REPORTED){ 10108: 80 91 4e 03 lds r24, 0x034E ; 0x80034e 1010c: 81 11 cpse r24, r1 1010e: 0b c0 rjmp .+22 ; 0x10126 10110: 80 91 4f 03 lds r24, 0x034F ; 0x80034f 10114: 81 11 cpse r24, r1 10116: 07 c0 rjmp .+14 ; 0x10126 10118: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1011c: 82 30 cpi r24, 0x02 ; 2 1011e: 19 f4 brne .+6 ; 0x10126 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 10120: 81 e0 ldi r24, 0x01 ; 1 10122: 80 93 e6 03 sts 0x03E6, r24 ; 0x8003e6 } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 10126: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1012a: 81 30 cpi r24, 0x01 ; 1 1012c: 61 f4 brne .+24 ; 0x10146 1012e: 0e 94 61 67 call 0xcec2 ; 0xcec2 10132: 81 11 cpse r24, r1 10134: 08 c0 rjmp .+16 ; 0x10146 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 10136: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1013a: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> lcd_reset_alert_level(); //for another fan speed error lcd_setstatuspgm(MSG_WELCOME); // Reset the status line message to visually show the error is gone 1013e: 8f ec ldi r24, 0xCF ; 207 10140: 9f e6 ldi r25, 0x6F ; 111 10142: 0e 94 3b f2 call 0x1e476 ; 0x1e476 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 10146: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1014a: 88 23 and r24, r24 1014c: 09 f4 brne .+2 ; 0x10150 1014e: 6e c0 rjmp .+220 ; 0x1022c 10150: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 10154: 82 30 cpi r24, 0x02 ; 2 10156: 09 f4 brne .+2 ; 0x1015a 10158: 69 c0 rjmp .+210 ; 0x1022c 1015a: 8e e4 ldi r24, 0x4E ; 78 1015c: e8 2e mov r14, r24 1015e: 83 e0 ldi r24, 0x03 ; 3 10160: f8 2e mov r15, r24 10162: fe 01 movw r30, r28 10164: 31 96 adiw r30, 0x01 ; 1 10166: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 10168: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 1016a: 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]) 1016c: f7 01 movw r30, r14 1016e: 91 91 ld r25, Z+ 10170: 7f 01 movw r14, r30 10172: f6 01 movw r30, r12 10174: 81 91 ld r24, Z+ 10176: 6f 01 movw r12, r30 10178: 89 17 cp r24, r25 1017a: 68 f5 brcc .+90 ; 0x101d6 { fan_speed_errors[fan] = 0; 1017c: f7 01 movw r30, r14 1017e: 31 97 sbiw r30, 0x01 ; 1 10180: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 10182: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 10186: 82 30 cpi r24, 0x02 ; 2 10188: 31 f1 breq .+76 ; 0x101d6 fan_check_error = EFCE_REPORTED; 1018a: 00 93 e6 03 sts 0x03E6, r16 ; 0x8003e6 if (printJobOngoing()) { 1018e: 0e 94 10 67 call 0xce20 ; 0xce20 10192: 88 23 and r24, r24 10194: 81 f1 breq .+96 ; 0x101f6 // A print is ongoing, pause the print normally if(!printingIsPaused()) { 10196: 0e 94 05 67 call 0xce0a ; 0xce0a 1019a: 81 11 cpse r24, r1 1019c: 06 c0 rjmp .+12 ; 0x101aa if (usb_timer.running()) 1019e: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 101a2: 88 23 and r24, r24 101a4: 29 f1 breq .+74 ; 0x101f0 lcd_pause_usb_print(); 101a6: 0f 94 9e 15 call 0x22b3c ; 0x22b3c else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 101aa: 11 30 cpi r17, 0x01 ; 1 101ac: 59 f1 breq .+86 ; 0x10204 //! 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); 101ae: 89 e6 ldi r24, 0x69 ; 105 101b0: 98 e7 ldi r25, 0x78 ; 120 101b2: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 if (get_message_level() == 0) { 101b6: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> 101ba: 81 11 cpse r24, r1 101bc: 0c c0 rjmp .+24 ; 0x101d6 Sound_MakeCustom(200,0,true); 101be: 41 e0 ldi r20, 0x01 ; 1 101c0: 70 e0 ldi r23, 0x00 ; 0 101c2: 60 e0 ldi r22, 0x00 ; 0 101c4: 88 ec ldi r24, 0xC8 ; 200 101c6: 90 e0 ldi r25, 0x00 ; 0 101c8: 0f 94 81 52 call 0x2a502 ; 0x2a502 LCD_ALERTMESSAGERPGM(lcdMsg); 101cc: 62 e0 ldi r22, 0x02 ; 2 101ce: 8a e3 ldi r24, 0x3A ; 58 101d0: 9a e6 ldi r25, 0x6A ; 106 101d2: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 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++) 101d6: 11 30 cpi r17, 0x01 ; 1 101d8: 49 f1 breq .+82 ; 0x1022c 101da: 11 e0 ldi r17, 0x01 ; 1 101dc: c7 cf rjmp .-114 ; 0x1016c 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; 101de: 10 92 4e 03 sts 0x034E, r1 ; 0x80034e 101e2: 76 cf rjmp .-276 ; 0x100d0 #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]++; 101e4: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 101e8: 87 cf rjmp .-242 ; 0x100f8 else fan_speed_errors[1] = 0; 101ea: 10 92 4f 03 sts 0x034F, r1 ; 0x80034f 101ee: 8c cf rjmp .-232 ; 0x10108 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 101f0: 0f 94 5d 2a call 0x254ba ; 0x254ba 101f4: da cf rjmp .-76 ; 0x101aa return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 101f6: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 101fa: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 101fe: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 10202: d3 cf rjmp .-90 ; 0x101aa //! 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); 10204: 81 e9 ldi r24, 0x91 ; 145 10206: 98 e7 ldi r25, 0x78 ; 120 10208: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 if (get_message_level() == 0) { 1020c: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> 10210: 81 11 cpse r24, r1 10212: 0c c0 rjmp .+24 ; 0x1022c Sound_MakeCustom(200,0,true); 10214: 41 e0 ldi r20, 0x01 ; 1 10216: 70 e0 ldi r23, 0x00 ; 0 10218: 60 e0 ldi r22, 0x00 ; 0 1021a: 88 ec ldi r24, 0xC8 ; 200 1021c: 90 e0 ldi r25, 0x00 ; 0 1021e: 0f 94 81 52 call 0x2a502 ; 0x2a502 LCD_ALERTMESSAGERPGM(lcdMsg); 10222: 62 e0 ldi r22, 0x02 ; 2 10224: 86 e2 ldi r24, 0x26 ; 38 10226: 9a e6 ldi r25, 0x6A ; 106 10228: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 1022c: 80 91 14 02 lds r24, 0x0214 ; 0x800214 10230: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 //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(); 10234: 0f 94 51 2a call 0x254a2 ; 0x254a2 10238: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 1023c: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 10240: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 10244: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fan_measuring = false; 10248: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 1024c: 0f 90 pop r0 1024e: 0f 90 pop r0 10250: df 91 pop r29 10252: cf 91 pop r28 10254: 1f 91 pop r17 10256: 0f 91 pop r16 10258: ff 90 pop r15 1025a: ef 90 pop r14 1025c: df 90 pop r13 1025e: 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(); 10260: 0c 94 27 75 jmp 0xea4e ; 0xea4e 00010264 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 10264: cf 92 push r12 10266: df 92 push r13 10268: ef 92 push r14 1026a: ff 92 push r15 1026c: 6b 01 movw r12, r22 1026e: 7c 01 movw r14, r24 la10c_orig_jerk = j; 10270: c0 92 54 03 sts 0x0354, r12 ; 0x800354 10274: d0 92 55 03 sts 0x0355, r13 ; 0x800355 10278: e0 92 56 03 sts 0x0356, r14 ; 0x800356 1027c: f0 92 57 03 sts 0x0357, r15 ; 0x800357 if(la10c_mode != LA10C_LA10) 10280: 80 91 70 03 lds r24, 0x0370 ; 0x800370 10284: 82 30 cpi r24, 0x02 ; 2 10286: b1 f4 brne .+44 ; 0x102b4 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) 10288: 20 e0 ldi r18, 0x00 ; 0 1028a: 30 e0 ldi r19, 0x00 ; 0 1028c: 40 e9 ldi r20, 0x90 ; 144 1028e: 50 e4 ldi r21, 0x40 ; 64 10290: c7 01 movw r24, r14 10292: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 10296: 87 ff sbrs r24, 7 10298: 14 c0 rjmp .+40 ; 0x102c2 1029a: 80 91 ee 0d lds r24, 0x0DEE ; 0x800dee 1029e: 90 91 ef 0d lds r25, 0x0DEF ; 0x800def 102a2: a0 91 f0 0d lds r26, 0x0DF0 ; 0x800df0 102a6: b0 91 f1 0d lds r27, 0x0DF1 ; 0x800df1 102aa: 80 3d cpi r24, 0xD0 ; 208 102ac: 97 40 sbci r25, 0x07 ; 7 102ae: a1 05 cpc r26, r1 102b0: b1 05 cpc r27, r1 102b2: 20 f5 brcc .+72 ; 0x102fc j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 102b4: c7 01 movw r24, r14 102b6: b6 01 movw r22, r12 102b8: ff 90 pop r15 102ba: ef 90 pop r14 102bc: df 90 pop r13 102be: cf 90 pop r12 102c0: 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: 102c2: 2a e9 ldi r18, 0x9A ; 154 102c4: 39 e9 ldi r19, 0x99 ; 153 102c6: 49 e9 ldi r20, 0x99 ; 153 102c8: 5e e3 ldi r21, 0x3E ; 62 102ca: c7 01 movw r24, r14 102cc: b6 01 movw r22, r12 102ce: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 102d2: 87 ff sbrs r24, 7 102d4: 0a c0 rjmp .+20 ; 0x102ea 102d6: 20 e0 ldi r18, 0x00 ; 0 102d8: 30 e0 ldi r19, 0x00 ; 0 102da: 48 e3 ldi r20, 0x38 ; 56 102dc: 51 e4 ldi r21, 0x41 ; 65 102de: c7 01 movw r24, r14 102e0: b6 01 movw r22, r12 102e2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 102e6: 6b 01 movw r12, r22 102e8: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 102ea: 85 ee ldi r24, 0xE5 ; 229 102ec: 98 e7 ldi r25, 0x78 ; 120 102ee: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(j); 102f2: c7 01 movw r24, r14 102f4: b6 01 movw r22, r12 102f6: 0f 94 ef 75 call 0x2ebde ; 0x2ebde 102fa: dc cf rjmp .-72 ; 0x102b4 // 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: 102fc: 2a e9 ldi r18, 0x9A ; 154 102fe: 39 e9 ldi r19, 0x99 ; 153 10300: 49 e9 ldi r20, 0x99 ; 153 10302: 5e e3 ldi r21, 0x3E ; 62 10304: c7 01 movw r24, r14 10306: b6 01 movw r22, r12 10308: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1030c: 87 fd sbrc r24, 7 1030e: e3 cf rjmp .-58 ; 0x102d6 j < 4.5? j * 0.25 + 3.375: 10310: 20 e0 ldi r18, 0x00 ; 0 10312: 30 e0 ldi r19, 0x00 ; 0 10314: 40 e8 ldi r20, 0x80 ; 128 10316: 5e e3 ldi r21, 0x3E ; 62 10318: c7 01 movw r24, r14 1031a: b6 01 movw r22, r12 1031c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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: 10320: 20 e0 ldi r18, 0x00 ; 0 10322: 30 e0 ldi r19, 0x00 ; 0 10324: 48 e5 ldi r20, 0x58 ; 88 10326: 50 e4 ldi r21, 0x40 ; 64 10328: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1032c: dc cf rjmp .-72 ; 0x102e6 0001032e : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 1032e: cf 92 push r12 10330: df 92 push r13 10332: ef 92 push r14 10334: ff 92 push r15 10336: cf 93 push r28 if(mode == la10c_mode) return; 10338: 90 91 70 03 lds r25, 0x0370 ; 0x800370 1033c: 98 17 cp r25, r24 1033e: b9 f1 breq .+110 ; 0x103ae 10340: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 10342: c0 90 54 03 lds r12, 0x0354 ; 0x800354 10346: d0 90 55 03 lds r13, 0x0355 ; 0x800355 1034a: e0 90 56 03 lds r14, 0x0356 ; 0x800356 1034e: f0 90 57 03 lds r15, 0x0357 ; 0x800357 10352: 20 e0 ldi r18, 0x00 ; 0 10354: 30 e0 ldi r19, 0x00 ; 0 10356: a9 01 movw r20, r18 10358: c7 01 movw r24, r14 1035a: b6 01 movw r22, r12 1035c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 10360: 88 23 and r24, r24 10362: 41 f0 breq .+16 ; 0x10374 cs.max_jerk[E_AXIS] = la10c_orig_jerk; 10364: c0 92 12 0e sts 0x0E12, r12 ; 0x800e12 10368: d0 92 13 0e sts 0x0E13, r13 ; 0x800e13 1036c: e0 92 14 0e sts 0x0E14, r14 ; 0x800e14 10370: f0 92 15 0e sts 0x0E15, r15 ; 0x800e15 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 10374: 88 ec ldi r24, 0xC8 ; 200 10376: 98 e7 ldi r25, 0x78 ; 120 10378: 0e 94 d0 76 call 0xeda0 ; 0xeda0 switch(mode) 1037c: c1 30 cpi r28, 0x01 ; 1 1037e: 11 f1 breq .+68 ; 0x103c4 10380: e0 f0 brcs .+56 ; 0x103ba 10382: c2 30 cpi r28, 0x02 ; 2 10384: 11 f1 breq .+68 ; 0x103ca { 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; 10386: c0 93 70 03 sts 0x0370, r28 ; 0x800370 // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 1038a: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 1038e: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 10392: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 10396: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 1039a: 0e 94 32 81 call 0x10264 ; 0x10264 1039e: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 103a2: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 103a6: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 103aa: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 } 103ae: cf 91 pop r28 103b0: ff 90 pop r15 103b2: ef 90 pop r14 103b4: df 90 pop r13 103b6: cf 90 pop r12 103b8: 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; 103ba: 80 ec ldi r24, 0xC0 ; 192 103bc: 98 e7 ldi r25, 0x78 ; 120 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 103be: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 103c2: e1 cf rjmp .-62 ; 0x10386 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 103c4: 8c eb ldi r24, 0xBC ; 188 103c6: 98 e7 ldi r25, 0x78 ; 120 103c8: fa cf rjmp .-12 ; 0x103be case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 103ca: 88 eb ldi r24, 0xB8 ; 184 103cc: 98 e7 ldi r25, 0x78 ; 120 103ce: f7 cf rjmp .-18 ; 0x103be 000103d0 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 103d0: 0f 94 ed 43 call 0x287da ; 0x287da disable_x(); 103d4: 17 9a sbi 0x02, 7 ; 2 103d6: ef e8 ldi r30, 0x8F ; 143 103d8: f6 e0 ldi r31, 0x06 ; 6 103da: 10 82 st Z, r1 disable_y(); 103dc: 16 9a sbi 0x02, 6 ; 2 103de: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 103e0: 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); } 103e2: 80 e0 ldi r24, 0x00 ; 0 103e4: 0e 94 97 81 call 0x1032e ; 0x1032e return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 103e8: 8f ef ldi r24, 0xFF ; 255 103ea: 9f ef ldi r25, 0xFF ; 255 103ec: 90 93 b2 02 sts 0x02B2, r25 ; 0x8002b2 103f0: 80 93 b1 02 sts 0x02B1, r24 ; 0x8002b1 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 103f4: 2f ef ldi r18, 0xFF ; 255 103f6: 20 93 ae 02 sts 0x02AE, r18 ; 0x8002ae print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 103fa: 90 93 b6 02 sts 0x02B6, r25 ; 0x8002b6 103fe: 80 93 b5 02 sts 0x02B5, r24 ; 0x8002b5 print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 10402: 20 93 ad 02 sts 0x02AD, r18 ; 0x8002ad print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 10406: 90 93 b0 02 sts 0x02B0, r25 ; 0x8002b0 1040a: 80 93 af 02 sts 0x02AF, r24 ; 0x8002af print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 1040e: 90 93 b4 02 sts 0x02B4, r25 ; 0x8002b4 10412: 80 93 b3 02 sts 0x02B3, r24 ; 0x8002b3 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(); } 10416: 08 95 ret 00010418 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 10418: 41 ed ldi r20, 0xD1 ; 209 1041a: 50 e0 ldi r21, 0x00 ; 0 1041c: 63 e7 ldi r22, 0x73 ; 115 1041e: 77 e7 ldi r23, 0x77 ; 119 10420: 8e eb ldi r24, 0xBE ; 190 10422: 9d e0 ldi r25, 0x0D ; 13 10424: 0f 94 ee d9 call 0x3b3dc ; 0x3b3dc // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 10428: 0f 94 9a 64 call 0x2c934 ; 0x2c934 #ifdef PIDTEMP updatePID(); 1042c: 0f 94 d8 3b call 0x277b0 ; 0x277b0 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 10430: 0f 94 ad 32 call 0x2655a ; 0x2655a #endif calculate_extruder_multipliers(); 10434: 0e 94 39 65 call 0xca72 ; 0xca72 SERIAL_ECHO_START; 10438: 82 ec ldi r24, 0xC2 ; 194 1043a: 9a ea ldi r25, 0xAA ; 170 1043c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 10440: 81 e5 ldi r24, 0x51 ; 81 10442: 97 e7 ldi r25, 0x77 ; 119 10444: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 00010448 : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 10448: cf 93 push r28 1044a: df 93 push r29 strcpy_P(cs.version, default_conf.version); 1044c: 63 e7 ldi r22, 0x73 ; 115 1044e: 77 e7 ldi r23, 0x77 ; 119 10450: 8e eb ldi r24, 0xBE ; 190 10452: 9d e0 ldi r25, 0x0D ; 13 10454: 0f 94 0b da call 0x3b416 ; 0x3b416 #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); 10458: 41 ed ldi r20, 0xD1 ; 209 1045a: 50 e0 ldi r21, 0x00 ; 0 1045c: 64 e1 ldi r22, 0x14 ; 20 1045e: 70 e0 ldi r23, 0x00 ; 0 10460: 8e eb ldi r24, 0xBE ; 190 10462: 9d e0 ldi r25, 0x0D ; 13 10464: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10468: 60 91 1d 05 lds r22, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> 1046c: 82 e0 ldi r24, 0x02 ; 2 1046e: 9d e0 ldi r25, 0x0D ; 13 10470: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 } 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); 10474: c0 eb ldi r28, 0xB0 ; 176 10476: 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); 10478: 4a a5 ldd r20, Y+42 ; 0x2a 1047a: 5b a5 ldd r21, Y+43 ; 0x2b 1047c: 6c a5 ldd r22, Y+44 ; 0x2c 1047e: 7d a5 ldd r23, Y+45 ; 0x2d 10480: 8e ef ldi r24, 0xFE ; 254 10482: 9c e0 ldi r25, 0x0C ; 12 10484: 0f 94 8a dc call 0x3b914 ; 0x3b914 10488: 4e a5 ldd r20, Y+46 ; 0x2e 1048a: 5f a5 ldd r21, Y+47 ; 0x2f 1048c: 68 a9 ldd r22, Y+48 ; 0x30 1048e: 79 a9 ldd r23, Y+49 ; 0x31 10490: 82 ea ldi r24, 0xA2 ; 162 10492: 9c e0 ldi r25, 0x0C ; 12 10494: 0f 94 8a dc call 0x3b914 ; 0x3b914 10498: 4a a9 ldd r20, Y+50 ; 0x32 1049a: 5b a9 ldd r21, Y+51 ; 0x33 1049c: 6c a9 ldd r22, Y+52 ; 0x34 1049e: 7d a9 ldd r23, Y+53 ; 0x35 104a0: 8e e9 ldi r24, 0x9E ; 158 104a2: 9c e0 ldi r25, 0x0C ; 12 104a4: 0f 94 8a dc call 0x3b914 ; 0x3b914 104a8: 4e a9 ldd r20, Y+54 ; 0x36 104aa: 5f a9 ldd r21, Y+55 ; 0x37 104ac: 68 ad ldd r22, Y+56 ; 0x38 104ae: 79 ad ldd r23, Y+57 ; 0x39 104b0: 8a ef ldi r24, 0xFA ; 250 104b2: 9c e0 ldi r25, 0x0C ; 12 104b4: 0f 94 8a dc call 0x3b914 ; 0x3b914 104b8: 4a ad ldd r20, Y+58 ; 0x3a 104ba: 5b ad ldd r21, Y+59 ; 0x3b 104bc: 6c ad ldd r22, Y+60 ; 0x3c 104be: 7d ad ldd r23, Y+61 ; 0x3d 104c0: 8a e9 ldi r24, 0x9A ; 154 104c2: 9c e0 ldi r25, 0x0C ; 12 104c4: 0f 94 8a dc call 0x3b914 ; 0x3b914 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 104c8: 6e ad ldd r22, Y+62 ; 0x3e 104ca: 7f ad ldd r23, Y+63 ; 0x3f 104cc: 88 e9 ldi r24, 0x98 ; 152 104ce: 9c e0 ldi r25, 0x0C ; 12 104d0: 0f 94 96 dc call 0x3b92c ; 0x3b92c #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); 104d4: 40 e4 ldi r20, 0x40 ; 64 104d6: 50 e0 ldi r21, 0x00 ; 0 104d8: 6a eb ldi r22, 0xBA ; 186 104da: 7c e0 ldi r23, 0x0C ; 12 104dc: 80 ef ldi r24, 0xF0 ; 240 104de: 92 e1 ldi r25, 0x12 ; 18 104e0: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 104e4: 40 91 30 13 lds r20, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.402+0x80> 104e8: 50 91 31 13 lds r21, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.402+0x81> 104ec: 60 91 32 13 lds r22, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.402+0x82> 104f0: 70 91 33 13 lds r23, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.402+0x83> 104f4: 86 eb ldi r24, 0xB6 ; 182 104f6: 9c e0 ldi r25, 0x0C ; 12 104f8: 0f 94 8a dc call 0x3b914 ; 0x3b914 104fc: 40 91 34 13 lds r20, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 10500: 50 91 35 13 lds r21, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 10504: 60 91 36 13 lds r22, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 10508: 70 91 37 13 lds r23, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> 1050c: 82 eb ldi r24, 0xB2 ; 178 1050e: 9c e0 ldi r25, 0x0C ; 12 10510: 0f 94 8a dc call 0x3b914 ; 0x3b914 10514: 40 91 38 13 lds r20, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.402+0x88> 10518: 50 91 39 13 lds r21, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.402+0x89> 1051c: 60 91 3a 13 lds r22, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.402+0x8a> 10520: 70 91 3b 13 lds r23, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.402+0x8b> 10524: 8e ea ldi r24, 0xAE ; 174 10526: 9c e0 ldi r25, 0x0C ; 12 10528: 0f 94 8a dc call 0x3b914 ; 0x3b914 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; 1052c: 82 ec ldi r24, 0xC2 ; 194 1052e: 9a ea ldi r25, 0xAA ; 170 10530: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM("Settings Stored"); 10534: 8d ef ldi r24, 0xFD ; 253 10536: 96 e7 ldi r25, 0x76 ; 118 } 10538: df 91 pop r29 1053a: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 1053c: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 00010540 : { cmdbuffer_front_already_processed = true; } void get_command() { 10540: 2f 92 push r2 10542: 3f 92 push r3 10544: 4f 92 push r4 10546: 5f 92 push r5 10548: 6f 92 push r6 1054a: 7f 92 push r7 1054c: 8f 92 push r8 1054e: 9f 92 push r9 10550: af 92 push r10 10552: bf 92 push r11 10554: cf 92 push r12 10556: df 92 push r13 10558: ef 92 push r14 1055a: ff 92 push r15 1055c: 0f 93 push r16 1055e: 1f 93 push r17 10560: cf 93 push r28 10562: df 93 push r29 10564: cd b7 in r28, 0x3d ; 61 10566: de b7 in r29, 0x3e ; 62 10568: a2 97 sbiw r28, 0x22 ; 34 1056a: 0f b6 in r0, 0x3f ; 63 1056c: f8 94 cli 1056e: de bf out 0x3e, r29 ; 62 10570: 0f be out 0x3f, r0 ; 63 10572: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 10574: 8f e5 ldi r24, 0x5F ; 95 10576: 90 e0 ldi r25, 0x00 ; 0 10578: 0e 94 c2 5b call 0xb784 ; 0xb784 1057c: 88 23 and r24, r24 1057e: 09 f4 brne .+2 ; 0x10582 10580: 91 c0 rjmp .+290 ; 0x106a4 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 10582: 0e 94 89 76 call 0xed12 ; 0xed12 10586: 8f 37 cpi r24, 0x7F ; 127 10588: 91 05 cpc r25, r1 1058a: 61 f4 brne .+24 ; 0x105a4 // 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; 1058c: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 10590: 90 91 9c 04 lds r25, 0x049C ; 0x80049c 10594: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 10598: 80 93 99 04 sts 0x0499, r24 ; 0x800499 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 1059c: 8e ee ldi r24, 0xEE ; 238 1059e: 96 e7 ldi r25, 0x76 ; 118 105a0: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 105a4: 1e 01 movw r2, r28 105a6: 2f e1 ldi r18, 0x1F ; 31 105a8: 22 0e add r2, r18 105aa: 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; 105ac: dd 24 eor r13, r13 105ae: 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 105b0: 0e 94 89 76 call 0xed12 ; 0xed12 105b4: 18 16 cp r1, r24 105b6: 19 06 cpc r1, r25 105b8: 0c f0 brlt .+2 ; 0x105bc 105ba: 68 c0 rjmp .+208 ; 0x1068c 105bc: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 105c0: 88 23 and r24, r24 105c2: 29 f0 breq .+10 ; 0x105ce 105c4: 0e 94 05 67 call 0xce0a ; 0xce0a 105c8: 88 23 and r24, r24 105ca: 09 f4 brne .+2 ; 0x105ce 105cc: 5f c0 rjmp .+190 ; 0x1068c 105ce: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 105d2: 81 11 cpse r24, r1 105d4: 5b c0 rjmp .+182 ; 0x1068c #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 105d6: 0f 94 3c d6 call 0x3ac78 ; 0x3ac78 if (rec < 0) continue; 105da: 97 fd sbrc r25, 7 105dc: e9 cf rjmp .-46 ; 0x105b0 mp_handle_rx_char((uint8_t)rec); 105de: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 105e0: 8f 3f cpi r24, 0xFF ; 255 105e2: 09 f0 breq .+2 ; 0x105e6 105e4: 7b c0 rjmp .+246 ; 0x106dc if (mp_cmd_count > 0) { 105e6: 80 91 40 03 lds r24, 0x0340 ; 0x800340 105ea: 88 23 and r24, r24 105ec: 09 f4 brne .+2 ; 0x105f0 105ee: 73 c0 rjmp .+230 ; 0x106d6 mp_cmd_active = 1; 105f0: d0 92 3f 03 sts 0x033F, r13 ; 0x80033f mp_cmd_count = 0; 105f4: 10 92 40 03 sts 0x0340, r1 ; 0x800340 char c_res[2] = {0, 0}; 105f8: 1f 8e std Y+31, r1 ; 0x1f 105fa: 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) { 105fc: c0 90 43 03 lds r12, 0x0343 ; 0x800343 10600: cc 20 and r12, r12 10602: b1 f2 breq .-84 ; 0x105b0 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]; 10604: 80 91 41 03 lds r24, 0x0341 ; 0x800341 10608: 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) 1060a: 91 e0 ldi r25, 0x01 ; 1 1060c: 9c 15 cp r25, r12 1060e: 18 f4 brcc .+6 ; 0x10616 out[i] = (char)mp_char_out_buf[i]; 10610: 80 91 42 03 lds r24, 0x0342 ; 0x800342 10614: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10616: 10 92 43 03 sts 0x0343, r1 ; 0x800343 1061a: 3a a2 std Y+34, r3 ; 0x22 1061c: 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]; 1061e: 89 a1 ldd r24, Y+33 ; 0x21 10620: 82 19 sub r24, r2 10622: 8c 15 cp r24, r12 10624: 28 f6 brcc .-118 ; 0x105b0 10626: e9 a1 ldd r30, Y+33 ; 0x21 10628: fa a1 ldd r31, Y+34 ; 0x22 1062a: 11 91 ld r17, Z+ 1062c: fa a3 std Y+34, r31 ; 0x22 1062e: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10630: 86 e4 ldi r24, 0x46 ; 70 10632: 93 e0 ldi r25, 0x03 ; 3 10634: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> if (serial_char < 0) 10638: 17 fd sbrc r17, 7 1063a: f1 cf rjmp .-30 ; 0x1061e 1063c: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10640: 90 91 9f 10 lds r25, 0x109F ; 0x80109f // 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' || 10644: 1a 30 cpi r17, 0x0A ; 10 10646: 09 f4 brne .+2 ; 0x1064a 10648: 4a c1 rjmp .+660 ; 0x108de 1064a: 1d 30 cpi r17, 0x0D ; 13 1064c: 09 f4 brne .+2 ; 0x10650 1064e: 47 c1 rjmp .+654 ; 0x108de serial_char == '\r' || 10650: 8f 35 cpi r24, 0x5F ; 95 10652: 91 05 cpc r25, r1 10654: 0c f0 brlt .+2 ; 0x10658 10656: 48 c1 rjmp .+656 ; 0x108e8 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; 10658: 1b 33 cpi r17, 0x3B ; 59 1065a: 11 f4 brne .+4 ; 0x10660 1065c: d0 92 45 03 sts 0x0345, r13 ; 0x800345 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10660: 20 91 45 03 lds r18, 0x0345 ; 0x800345 10664: 21 11 cpse r18, r1 10666: db cf rjmp .-74 ; 0x1061e 10668: 9c 01 movw r18, r24 1066a: 2f 5f subi r18, 0xFF ; 255 1066c: 3f 4f sbci r19, 0xFF ; 255 1066e: 30 93 9f 10 sts 0x109F, r19 ; 0x80109f 10672: 20 93 9e 10 sts 0x109E, r18 ; 0x80109e 10676: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 1067a: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 1067e: 2b 55 subi r18, 0x5B ; 91 10680: 3f 4e sbci r19, 0xEF ; 239 10682: 82 0f add r24, r18 10684: 93 1f adc r25, r19 10686: fc 01 movw r30, r24 10688: 13 83 std Z+3, r17 ; 0x03 1068a: c9 cf rjmp .-110 ; 0x1061e #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 1068c: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10690: 90 91 9f 10 lds r25, 0x109F ; 0x80109f 10694: 18 16 cp r1, r24 10696: 19 06 cpc r1, r25 10698: 0c f4 brge .+2 ; 0x1069c 1069a: 56 c2 rjmp .+1196 ; 0x10b48 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 1069c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 106a0: 81 11 cpse r24, r1 106a2: 66 c2 rjmp .+1228 ; 0x10b70 prusa_statistics(6); } } #endif //SDSUPPORT } 106a4: a2 96 adiw r28, 0x22 ; 34 106a6: 0f b6 in r0, 0x3f ; 63 106a8: f8 94 cli 106aa: de bf out 0x3e, r29 ; 62 106ac: 0f be out 0x3f, r0 ; 63 106ae: cd bf out 0x3d, r28 ; 61 106b0: df 91 pop r29 106b2: cf 91 pop r28 106b4: 1f 91 pop r17 106b6: 0f 91 pop r16 106b8: ff 90 pop r15 106ba: ef 90 pop r14 106bc: df 90 pop r13 106be: cf 90 pop r12 106c0: bf 90 pop r11 106c2: af 90 pop r10 106c4: 9f 90 pop r9 106c6: 8f 90 pop r8 106c8: 7f 90 pop r7 106ca: 6f 90 pop r6 106cc: 5f 90 pop r5 106ce: 4f 90 pop r4 106d0: 3f 90 pop r3 106d2: 2f 90 pop r2 106d4: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 106d6: d0 92 40 03 sts 0x0340, r13 ; 0x800340 106da: 8e cf rjmp .-228 ; 0x105f8 return; } if (mp_cmd_active > 0) { 106dc: 30 91 3f 03 lds r19, 0x033F ; 0x80033f 106e0: 33 23 and r19, r19 106e2: 09 f4 brne .+2 ; 0x106e6 106e4: 57 c0 rjmp .+174 ; 0x10794 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 106e6: 89 3f cpi r24, 0xF9 ; 249 106e8: 09 f4 brne .+2 ; 0x106ec 106ea: 3f c0 rjmp .+126 ; 0x1076a 106ec: 80 f5 brcc .+96 ; 0x1074e 106ee: 86 3f cpi r24, 0xF6 ; 246 106f0: 09 f4 brne .+2 ; 0x106f4 106f2: 48 c0 rjmp .+144 ; 0x10784 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 106f4: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 106f8: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 106fa: 27 3f cpi r18, 0xF7 ; 247 106fc: 79 f1 breq .+94 ; 0x1075c 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. 106fe: 89 eb ldi r24, 0xB9 ; 185 10700: 96 e7 ldi r25, 0x76 ; 118 10702: 0e 94 d0 76 call 0xeda0 ; 0xeda0 // 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); 10706: 84 eb ldi r24, 0xB4 ; 180 10708: 96 e7 ldi r25, 0x76 ; 118 1070a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 // Echo current state if (mp_config & MPConfig_Active) 1070e: 10 91 3e 03 lds r17, 0x033E ; 0x80033e SERIAL_ECHOPGM(" ON"); 10712: 80 eb ldi r24, 0xB0 ; 176 10714: 96 e7 ldi r25, 0x76 ; 118 // 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) 10716: 10 fd sbrc r17, 0 10718: 02 c0 rjmp .+4 ; 0x1071e SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 1071a: 8b ea ldi r24, 0xAB ; 171 1071c: 96 e7 ldi r25, 0x76 ; 118 1071e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if (mp_config & MPConfig_NoSpaces) 10722: 01 2f mov r16, r17 10724: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10726: 86 ea ldi r24, 0xA6 ; 166 10728: 96 e7 ldi r25, 0x76 ; 118 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 1072a: 11 fd sbrc r17, 1 1072c: 02 c0 rjmp .+4 ; 0x10732 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 1072e: 81 ea ldi r24, 0xA1 ; 161 10730: 96 e7 ldi r25, 0x76 ; 118 10732: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM(""); 10736: 80 ea ldi r24, 0xA0 ; 160 10738: 96 e7 ldi r25, 0x76 ; 118 1073a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 1073e: 00 23 and r16, r16 10740: 29 f1 breq .+74 ; 0x1078c MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10742: 45 e4 ldi r20, 0x45 ; 69 10744: 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; 10748: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f 1074c: 55 cf rjmp .-342 ; 0x105f8 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 1074e: 8a 3f cpi r24, 0xFA ; 250 10750: 41 f0 breq .+16 ; 0x10762 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10752: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10756: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10758: 2b 3f cpi r18, 0xFB ; 251 1075a: 89 f6 brne .-94 ; 0x106fe #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 1075c: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e 10760: ce cf rjmp .-100 ; 0x106fe #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10762: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10766: 8e 7f andi r24, 0xFE ; 254 10768: f9 cf rjmp .-14 ; 0x1075c return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 1076a: 10 92 43 03 sts 0x0343, r1 ; 0x800343 mp_cmd_active = MPCommand_None; 1076e: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f mp_config = MPConfig_None; 10772: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e mp_char_buf = 0; 10776: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d mp_cmd_count = 0; 1077a: 10 92 40 03 sts 0x0340, r1 ; 0x800340 mp_cmd_active = 0; mp_full_char_queue = 0; 1077e: 10 92 3c 03 sts 0x033C, r1 ; 0x80033c 10782: bd cf rjmp .-134 ; 0x106fe #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10784: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10788: 8d 7f andi r24, 0xFD ; 253 1078a: e8 cf rjmp .-48 ; 0x1075c // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 1078c: 50 e2 ldi r21, 0x20 ; 32 1078e: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10792: da cf rjmp .-76 ; 0x10748 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10794: 20 91 40 03 lds r18, 0x0340 ; 0x800340 10798: 40 91 3e 03 lds r20, 0x033E ; 0x80033e 1079c: 22 23 and r18, r18 1079e: 31 f1 breq .+76 ; 0x107ec 107a0: e0 91 43 03 lds r30, 0x0343 ; 0x800343 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 107a4: 40 ff sbrs r20, 0 107a6: 49 c0 rjmp .+146 ; 0x1083a if (mp_full_char_queue > 0) { 107a8: 30 91 3c 03 lds r19, 0x033C ; 0x80033c 107ac: 33 23 and r19, r19 107ae: 09 f4 brne .+2 ; 0x107b2 107b0: 40 c0 rjmp .+128 ; 0x10832 #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; 107b2: 21 e0 ldi r18, 0x01 ; 1 107b4: 2e 0f add r18, r30 107b6: 20 93 43 03 sts 0x0343, r18 ; 0x800343 107ba: ae 2f mov r26, r30 107bc: b0 e0 ldi r27, 0x00 ; 0 107be: af 5b subi r26, 0xBF ; 191 107c0: bc 4f sbci r27, 0xFC ; 252 107c2: ff ef ldi r31, 0xFF ; 255 107c4: 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) { 107c6: 50 91 3d 03 lds r21, 0x033D ; 0x80033d 107ca: 55 23 and r21, r21 107cc: 51 f0 breq .+20 ; 0x107e2 #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; 107ce: ee 5f subi r30, 0xFE ; 254 107d0: e0 93 43 03 sts 0x0343, r30 ; 0x800343 107d4: e2 2f mov r30, r18 107d6: f0 e0 ldi r31, 0x00 ; 0 107d8: ef 5b subi r30, 0xBF ; 191 107da: fc 4f sbci r31, 0xFC ; 252 107dc: 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; 107de: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d } --mp_full_char_queue; 107e2: 31 50 subi r19, 0x01 ; 1 107e4: 30 93 3c 03 sts 0x033C, r19 ; 0x80033c return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 107e8: 10 92 40 03 sts 0x0340, r1 ; 0x800340 107ec: e0 91 43 03 lds r30, 0x0343 ; 0x800343 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 107f0: 40 ff sbrs r20, 0 107f2: 6c c0 rjmp .+216 ; 0x108cc if (mp_full_char_queue > 0) { 107f4: 20 91 3c 03 lds r18, 0x033C ; 0x80033c 107f8: 22 23 and r18, r18 107fa: 49 f1 breq .+82 ; 0x1084e #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; 107fc: 91 e0 ldi r25, 0x01 ; 1 107fe: 9e 0f add r25, r30 10800: 90 93 43 03 sts 0x0343, r25 ; 0x800343 10804: ae 2f mov r26, r30 10806: b0 e0 ldi r27, 0x00 ; 0 10808: af 5b subi r26, 0xBF ; 191 1080a: bc 4f sbci r27, 0xFC ; 252 1080c: 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) { 1080e: 80 91 3d 03 lds r24, 0x033D ; 0x80033d 10812: 88 23 and r24, r24 10814: 51 f0 breq .+20 ; 0x1082a #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; 10816: ee 5f subi r30, 0xFE ; 254 10818: e0 93 43 03 sts 0x0343, r30 ; 0x800343 1081c: e9 2f mov r30, r25 1081e: f0 e0 ldi r31, 0x00 ; 0 10820: ef 5b subi r30, 0xBF ; 191 10822: fc 4f sbci r31, 0xFC ; 252 10824: 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; 10826: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d } --mp_full_char_queue; 1082a: 21 50 subi r18, 0x01 ; 1 1082c: 20 93 3c 03 sts 0x033C, r18 ; 0x80033c 10830: e3 ce rjmp .-570 ; 0x105f8 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; 10832: 22 e0 ldi r18, 0x02 ; 2 10834: 20 93 3c 03 sts 0x033C, r18 ; 0x80033c 10838: d7 cf rjmp .-82 ; 0x107e8 #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; 1083a: 21 e0 ldi r18, 0x01 ; 1 1083c: 2e 0f add r18, r30 1083e: 20 93 43 03 sts 0x0343, r18 ; 0x800343 10842: f0 e0 ldi r31, 0x00 ; 0 10844: ef 5b subi r30, 0xBF ; 191 10846: fc 4f sbci r31, 0xFC ; 252 10848: 5f ef ldi r21, 0xFF ; 255 1084a: 50 83 st Z, r21 1084c: cd cf rjmp .-102 ; 0x107e8 1084e: a8 2f mov r26, r24 10850: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10852: 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; 10854: 31 e0 ldi r19, 0x01 ; 1 10856: af 30 cpi r26, 0x0F ; 15 10858: 29 f0 breq .+10 ; 0x10864 1085a: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 1085c: a0 50 subi r26, 0x00 ; 0 1085e: be 4f sbci r27, 0xFE ; 254 10860: 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; 10862: 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; 10864: 58 2f mov r21, r24 10866: 50 7f andi r21, 0xF0 ; 240 10868: 50 3f cpi r21, 0xF0 ; 240 1086a: 59 f4 brne .+22 ; 0x10882 1086c: 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) { 1086e: 30 ff sbrs r19, 0 10870: 13 c0 rjmp .+38 ; 0x10898 ++mp_full_char_queue; 10872: d0 92 3c 03 sts 0x033C, r13 ; 0x80033c if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10876: 31 ff sbrs r19, 1 10878: 0c c0 rjmp .+24 ; 0x10892 1087a: 82 e0 ldi r24, 0x02 ; 2 1087c: 80 93 3c 03 sts 0x033C, r24 ; 0x80033c 10880: bb ce rjmp .-650 ; 0x105f8 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 10882: 82 95 swap r24 10884: 8f 70 andi r24, 0x0F ; 15 10886: a8 2f mov r26, r24 10888: b0 e0 ldi r27, 0x00 ; 0 1088a: a0 50 subi r26, 0x00 ; 0 1088c: be 4f sbci r27, 0xFE ; 254 1088e: 2c 91 ld r18, X 10890: ee cf rjmp .-36 ; 0x1086e 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]; 10892: 20 93 3d 03 sts 0x033D, r18 ; 0x80033d 10896: b0 ce rjmp .-672 ; 0x105f8 #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; 10898: 81 e0 ldi r24, 0x01 ; 1 1089a: 8e 0f add r24, r30 1089c: 80 93 43 03 sts 0x0343, r24 ; 0x800343 108a0: ae 2f mov r26, r30 108a2: b0 e0 ldi r27, 0x00 ; 0 108a4: af 5b subi r26, 0xBF ; 191 108a6: bc 4f sbci r27, 0xFC ; 252 108a8: 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') { 108aa: 4a 30 cpi r20, 0x0A ; 10 108ac: 09 f4 brne .+2 ; 0x108b0 108ae: a4 ce rjmp .-696 ; 0x105f8 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 108b0: 31 ff sbrs r19, 1 108b2: 03 c0 rjmp .+6 ; 0x108ba 108b4: d0 92 3c 03 sts 0x033C, r13 ; 0x80033c 108b8: 9f ce rjmp .-706 ; 0x105f8 #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; 108ba: ee 5f subi r30, 0xFE ; 254 108bc: e0 93 43 03 sts 0x0343, r30 ; 0x800343 108c0: e8 2f mov r30, r24 108c2: f0 e0 ldi r31, 0x00 ; 0 108c4: ef 5b subi r30, 0xBF ; 191 108c6: fc 4f sbci r31, 0xFC ; 252 108c8: 20 83 st Z, r18 108ca: 96 ce rjmp .-724 ; 0x105f8 108cc: 91 e0 ldi r25, 0x01 ; 1 108ce: 9e 0f add r25, r30 108d0: 90 93 43 03 sts 0x0343, r25 ; 0x800343 108d4: f0 e0 ldi r31, 0x00 ; 0 108d6: ef 5b subi r30, 0xBF ; 191 108d8: fc 4f sbci r31, 0xFC ; 252 108da: 80 83 st Z, r24 108dc: 8d ce rjmp .-742 ; 0x105f8 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 108de: 00 97 sbiw r24, 0x00 ; 0 108e0: 19 f4 brne .+6 ; 0x108e8 comment_mode = false; //for new command 108e2: 10 92 45 03 sts 0x0345, r1 ; 0x800345 108e6: de ce rjmp .-580 ; 0x106a4 108e8: 00 91 a0 10 lds r16, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 108ec: 10 91 a1 10 lds r17, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 108f0: 08 55 subi r16, 0x58 ; 88 108f2: 1f 4e sbci r17, 0xEF ; 239 108f4: 80 0f add r24, r16 108f6: 91 1f adc r25, r17 108f8: fc 01 movw r30, r24 108fa: 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) 108fc: 1a 83 std Y+2, r17 ; 0x02 108fe: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10900: 80 91 45 03 lds r24, 0x0345 ; 0x800345 10904: 81 11 cpse r24, r1 10906: 03 c1 rjmp .+518 ; 0x10b0e long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10908: f8 01 movw r30, r16 1090a: 80 81 ld r24, Z 1090c: 8e 34 cpi r24, 0x4E ; 78 1090e: 09 f0 breq .+2 ; 0x10912 10910: 8a c0 rjmp .+276 ; 0x10a26 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10912: 4a e0 ldi r20, 0x0A ; 10 10914: 50 e0 ldi r21, 0x00 ; 0 10916: be 01 movw r22, r28 10918: 6f 5f subi r22, 0xFF ; 255 1091a: 7f 4f sbci r23, 0xFF ; 255 1091c: c8 01 movw r24, r16 1091e: 01 96 adiw r24, 0x01 ; 1 10920: 0f 94 df d7 call 0x3afbe ; 0x3afbe 10924: 2b 01 movw r4, r22 10926: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10928: e9 80 ldd r14, Y+1 ; 0x01 1092a: fa 80 ldd r15, Y+2 ; 0x02 1092c: f7 01 movw r30, r14 1092e: 80 81 ld r24, Z 10930: 80 32 cpi r24, 0x20 ; 32 10932: 31 f4 brne .+12 ; 0x10940 10934: ff ef ldi r31, 0xFF ; 255 10936: ef 1a sub r14, r31 10938: ff 0a sbc r15, r31 1093a: fa 82 std Y+2, r15 ; 0x02 1093c: e9 82 std Y+1, r14 ; 0x01 1093e: f4 cf rjmp .-24 ; 0x10928 // 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)) { 10940: 80 90 7a 03 lds r8, 0x037A ; 0x80037a 10944: 90 90 7b 03 lds r9, 0x037B ; 0x80037b 10948: a0 90 7c 03 lds r10, 0x037C ; 0x80037c 1094c: b0 90 7d 03 lds r11, 0x037D ; 0x80037d 10950: d5 01 movw r26, r10 10952: c4 01 movw r24, r8 10954: 01 96 adiw r24, 0x01 ; 1 10956: a1 1d adc r26, r1 10958: b1 1d adc r27, r1 1095a: 84 15 cp r24, r4 1095c: 95 05 cpc r25, r5 1095e: a6 05 cpc r26, r6 10960: b7 05 cpc r27, r7 10962: 49 f0 breq .+18 ; 0x10976 10964: 44 e0 ldi r20, 0x04 ; 4 10966: 50 e0 ldi r21, 0x00 ; 0 10968: 69 ee ldi r22, 0xE9 ; 233 1096a: 76 e7 ldi r23, 0x76 ; 118 1096c: c7 01 movw r24, r14 1096e: 0f 94 33 da call 0x3b466 ; 0x3b466 10972: 89 2b or r24, r25 10974: a1 f4 brne .+40 ; 0x1099e FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10976: 6a e2 ldi r22, 0x2A ; 42 10978: 70 e0 ldi r23, 0x00 ; 0 1097a: c7 01 movw r24, r14 1097c: 0f 94 ab e2 call 0x3c556 ; 0x3c556 10980: 90 93 96 03 sts 0x0396, r25 ; 0x800396 10984: 80 93 95 03 sts 0x0395, r24 ; 0x800395 10988: 00 97 sbiw r24, 0x00 ; 0 1098a: 09 f4 brne .+2 ; 0x1098e 1098c: 45 c0 rjmp .+138 ; 0x10a18 1098e: f8 01 movw r30, r16 { byte checksum = 0; 10990: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10992: e8 17 cp r30, r24 10994: f9 07 cpc r31, r25 10996: 71 f0 breq .+28 ; 0x109b4 checksum = checksum^(*p++); 10998: 21 91 ld r18, Z+ 1099a: f2 26 eor r15, r18 1099c: fa cf rjmp .-12 ; 0x10992 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; 1099e: 8a e9 ldi r24, 0x9A ; 154 109a0: 9a ea ldi r25, 0xAA ; 170 109a2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 109a6: 88 e8 ldi r24, 0x88 ; 136 109a8: 94 e6 ldi r25, 0x64 ; 100 *strchr_pointer = 0; } else { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 109aa: 0e 94 d0 76 call 0xeda0 ; 0xeda0 109ae: c5 01 movw r24, r10 109b0: b4 01 movw r22, r8 109b2: 15 c0 rjmp .+42 ; 0x109de { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 109b4: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 109b8: f8 16 cp r15, r24 109ba: 19 06 cpc r1, r25 109bc: d9 f0 breq .+54 ; 0x109f4 SERIAL_ERROR_START; 109be: 8a e9 ldi r24, 0x9A ; 154 109c0: 9a ea ldi r25, 0xAA ; 170 109c2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 109c6: 89 e6 ldi r24, 0x69 ; 105 109c8: 94 e6 ldi r25, 0x64 ; 100 109ca: 0e 94 d0 76 call 0xeda0 ; 0xeda0 109ce: 60 91 7a 03 lds r22, 0x037A ; 0x80037a 109d2: 70 91 7b 03 lds r23, 0x037B ; 0x80037b 109d6: 80 91 7c 03 lds r24, 0x037C ; 0x80037c 109da: 90 91 7d 03 lds r25, 0x037D ; 0x80037d 109de: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 } void MarlinSerial::println(long n, int base) { print(n, base); println(); 109e2: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 109e6: 0e 94 0d 5b call 0xb61a ; 0xb61a serial_count = 0; 109ea: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 109ee: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e 109f2: 58 ce rjmp .-848 ; 0x106a4 return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 109f4: e0 91 95 03 lds r30, 0x0395 ; 0x800395 109f8: f0 91 96 03 lds r31, 0x0396 ; 0x800396 109fc: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 109fe: e9 80 ldd r14, Y+1 ; 0x01 10a00: fa 80 ldd r15, Y+2 ; 0x02 10a02: 64 ee ldi r22, 0xE4 ; 228 10a04: 76 e7 ldi r23, 0x76 ; 118 10a06: c7 01 movw r24, r14 10a08: 0f 94 02 da call 0x3b404 ; 0x3b404 10a0c: 89 2b or r24, r25 10a0e: 39 f5 brne .+78 ; 0x10a5e kill(MSG_M112_KILL); 10a10: 83 ea ldi r24, 0xA3 ; 163 10a12: 97 e6 ldi r25, 0x67 ; 103 10a14: 0e 94 8a 79 call 0xf314 ; 0xf314 // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10a18: 8a e9 ldi r24, 0x9A ; 154 10a1a: 9a ea ldi r25, 0xAA ; 170 10a1c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10a20: 8f e3 ldi r24, 0x3F ; 63 10a22: 94 e6 ldi r25, 0x64 ; 100 10a24: c2 cf rjmp .-124 ; 0x109aa } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10a26: 89 81 ldd r24, Y+1 ; 0x01 10a28: 9a 81 ldd r25, Y+2 ; 0x02 10a2a: fc 01 movw r30, r24 10a2c: 20 81 ld r18, Z 10a2e: 20 32 cpi r18, 0x20 ; 32 10a30: 21 f4 brne .+8 ; 0x10a3a 10a32: 01 96 adiw r24, 0x01 ; 1 10a34: 9a 83 std Y+2, r25 ; 0x02 10a36: 89 83 std Y+1, r24 ; 0x01 10a38: f6 cf rjmp .-20 ; 0x10a26 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10a3a: 6a e2 ldi r22, 0x2A ; 42 10a3c: 70 e0 ldi r23, 0x00 ; 0 10a3e: 0f 94 ab e2 call 0x3c556 ; 0x3c556 10a42: 89 2b or r24, r25 10a44: 39 f0 breq .+14 ; 0x10a54 { SERIAL_ERROR_START; 10a46: 8a e9 ldi r24, 0x9A ; 154 10a48: 9a ea ldi r25, 0xAA ; 170 10a4a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10a4e: 85 e1 ldi r24, 0x15 ; 21 10a50: 94 e6 ldi r25, 0x64 ; 100 10a52: bb cf rjmp .-138 ; 0x109ca 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 10a54: 44 24 eor r4, r4 10a56: 4a 94 dec r4 10a58: 54 2c mov r5, r4 10a5a: 32 01 movw r6, r4 10a5c: d0 cf rjmp .-96 ; 0x109fe 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) 10a5e: 44 e0 ldi r20, 0x04 ; 4 10a60: 50 e0 ldi r21, 0x00 ; 0 10a62: 6f ed ldi r22, 0xDF ; 223 10a64: 76 e7 ldi r23, 0x76 ; 118 10a66: c7 01 movw r24, r14 10a68: 0f 94 33 da call 0x3b466 ; 0x3b466 10a6c: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10a6e: f7 01 movw r30, r14 10a70: 80 81 ld r24, Z 10a72: 87 34 cpi r24, 0x47 ; 71 10a74: 81 f4 brne .+32 ; 0x10a96 10a76: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 10a7a: 85 30 cpi r24, 0x05 ; 5 10a7c: 61 f0 breq .+24 ; 0x10a96 usb_timer.start(); 10a7e: 8e e0 ldi r24, 0x0E ; 14 10a80: 95 e0 ldi r25, 0x05 ; 5 10a82: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10a86: f6 e0 ldi r31, 0x06 ; 6 10a88: f0 93 b8 0d sts 0x0DB8, r31 ; 0x800db8 <_ZL13printer_state.lto_priv.403> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10a8c: 60 e0 ldi r22, 0x00 ; 0 10a8e: 85 ea ldi r24, 0xA5 ; 165 10a90: 9f e0 ldi r25, 0x0F ; 15 10a92: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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) { 10a96: ab 28 or r10, r11 10a98: 21 f0 breq .+8 ; 0x10aa2 10a9a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 10a9e: 81 11 cpse r24, r1 10aa0: a4 cf rjmp .-184 ; 0x109ea } // 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; 10aa2: 26 e0 ldi r18, 0x06 ; 6 10aa4: 77 fc sbrc r7, 7 10aa6: 21 e0 ldi r18, 0x01 ; 1 10aa8: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10aac: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10ab0: fc 01 movw r30, r24 10ab2: eb 55 subi r30, 0x5B ; 91 10ab4: ff 4e sbci r31, 0xEF ; 239 10ab6: 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) 10ab8: 49 81 ldd r20, Y+1 ; 0x01 10aba: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10abc: 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) 10abe: da 01 movw r26, r20 10ac0: 40 17 cp r20, r16 10ac2: 51 07 cpc r21, r17 10ac4: a1 f5 brne .+104 ; 0x10b2e cmd_len = strlen(cmd_start) + 1; 10ac6: 01 90 ld r0, Z+ 10ac8: 00 20 and r0, r0 10aca: e9 f7 brne .-6 ; 0x10ac6 10acc: 9f 01 movw r18, r30 10ace: 20 1b sub r18, r16 10ad0: 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; 10ad2: 03 96 adiw r24, 0x03 ; 3 10ad4: 28 0f add r18, r24 10ad6: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10ad8: 2d 3e cpi r18, 0xED ; 237 10ada: f1 e0 ldi r31, 0x01 ; 1 10adc: 3f 07 cpc r19, r31 10ade: 79 f1 breq .+94 ; 0x10b3e // 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; 10ae0: 30 93 a1 10 sts 0x10A1, r19 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10ae4: 20 93 a0 10 sts 0x10A0, r18 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10ae8: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10aec: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10af0: 01 96 adiw r24, 0x01 ; 1 10af2: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 10af6: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 // Update the processed gcode line if (gcode_N >= 0) 10afa: 77 fc sbrc r7, 7 10afc: 08 c0 rjmp .+16 ; 0x10b0e gcode_LastN = gcode_N; 10afe: 40 92 7a 03 sts 0x037A, r4 ; 0x80037a 10b02: 50 92 7b 03 sts 0x037B, r5 ; 0x80037b 10b06: 60 92 7c 03 sts 0x037C, r6 ; 0x80037c 10b0a: 70 92 7d 03 sts 0x037D, r7 ; 0x80037d SERIAL_ECHOPGM("Number of commands in the buffer: "); SERIAL_ECHO(buflen); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } // end of 'not comment mode' serial_count = 0; //clear buffer 10b0e: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10b12: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e // 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)) 10b16: 0e 94 89 76 call 0xed12 ; 0xed12 10b1a: 89 2b or r24, r25 10b1c: 09 f4 brne .+2 ; 0x10b20 10b1e: c2 cd rjmp .-1148 ; 0x106a4 10b20: 8f e5 ldi r24, 0x5F ; 95 10b22: 90 e0 ldi r25, 0x00 ; 0 10b24: 0e 94 c2 5b call 0xb784 ; 0xb784 10b28: 81 11 cpse r24, r1 10b2a: 79 cd rjmp .-1294 ; 0x1061e 10b2c: bb cd rjmp .-1162 ; 0x106a4 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]; } 10b2e: 6d 91 ld r22, X+ 10b30: 61 93 st Z+, r22 10b32: 9d 01 movw r18, r26 10b34: 24 1b sub r18, r20 10b36: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10b38: 61 11 cpse r22, r1 10b3a: f9 cf rjmp .-14 ; 0x10b2e 10b3c: ca cf rjmp .-108 ; 0x10ad2 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10b3e: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10b42: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10b46: d0 cf rjmp .-96 ; 0x10ae8 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10b48: 60 ed ldi r22, 0xD0 ; 208 10b4a: 77 e0 ldi r23, 0x07 ; 7 10b4c: 86 e4 ldi r24, 0x46 ; 70 10b4e: 93 e0 ldi r25, 0x03 ; 3 10b50: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 10b54: 88 23 and r24, r24 10b56: 09 f4 brne .+2 ; 0x10b5a 10b58: a1 cd rjmp .-1214 ; 0x1069c comment_mode = false; 10b5a: 10 92 45 03 sts 0x0345, r1 ; 0x800345 serial_count = 0; 10b5e: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10b62: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e SERIAL_ECHOLNPGM("RX timeout"); 10b66: 84 ed ldi r24, 0xD4 ; 212 10b68: 96 e7 ldi r25, 0x76 ; 118 10b6a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 10b6e: 9a cd rjmp .-1228 ; 0x106a4 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10b70: 80 91 23 17 lds r24, 0x1723 ; 0x801723 10b74: 88 23 and r24, r24 10b76: 09 f4 brne .+2 ; 0x10b7a 10b78: 95 cd rjmp .-1238 ; 0x106a4 10b7a: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10b7e: 90 91 9f 10 lds r25, 0x109F ; 0x80109f 10b82: 89 2b or r24, r25 10b84: 09 f0 breq .+2 ; 0x10b88 10b86: 8e cd rjmp .-1252 ; 0x106a4 //'#' 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; 10b88: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10b8c: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10b90: 89 2b or r24, r25 10b92: 11 f4 brne .+4 ; 0x10b98 10b94: 10 92 44 03 sts 0x0344, r1 ; 0x800344 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10b98: 2d e9 ldi r18, 0x9D ; 157 10b9a: e2 2e mov r14, r18 10b9c: 20 e1 ldi r18, 0x10 ; 16 10b9e: 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; 10ba0: 32 e0 ldi r19, 0x02 ; 2 10ba2: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10ba4: cc 24 eor r12, r12 10ba6: 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) { 10ba8: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10bac: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10bb0: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10bb4: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10bb8: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10bbc: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10bc0: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10bc4: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10bc8: 48 17 cp r20, r24 10bca: 59 07 cpc r21, r25 10bcc: 6a 07 cpc r22, r26 10bce: 7b 07 cpc r23, r27 10bd0: 08 f0 brcs .+2 ; 0x10bd4 10bd2: 2f c1 rjmp .+606 ; 0x10e32 10bd4: 80 91 44 03 lds r24, 0x0344 ; 0x800344 10bd8: 81 11 cpse r24, r1 10bda: 2b c1 rjmp .+598 ; 0x10e32 : "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() ){ 10bdc: 0f 94 be 7b call 0x2f77c ; 0x2f77c 10be0: 88 23 and r24, r24 10be2: 49 f1 breq .+82 ; 0x10c36 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; 10be4: 20 91 3b 17 lds r18, 0x173B ; 0x80173b 10be8: 30 91 3c 17 lds r19, 0x173C ; 0x80173c // 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; 10bec: 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; 10bee: 9b ef ldi r25, 0xFB ; 251 10bf0: 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 == ';' ){ 10bf2: f8 01 movw r30, r16 10bf4: 80 81 ld r24, Z 10bf6: 8b 33 cpi r24, 0x3B ; 59 10bf8: 51 f5 brne .+84 ; 0x10c4e // 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); 10bfa: f8 01 movw r30, r16 00010bfc : 10bfc: 61 91 ld r22, Z+ 10bfe: 6a 30 cpi r22, 0x0A ; 10 10c00: e9 f7 brne .-6 ; 0x10bfc 10c02: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 10c04: cf 01 movw r24, r30 10c06: 8d 59 subi r24, 0x9D ; 157 10c08: 9e 40 sbci r25, 0x0E ; 14 10c0a: 81 30 cpi r24, 0x01 ; 1 10c0c: 92 40 sbci r25, 0x02 ; 2 10c0e: d4 f0 brlt .+52 ; 0x10c44 // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 10c10: c8 01 movw r24, r16 10c12: 82 1b sub r24, r18 10c14: 93 0b sbc r25, r19 10c16: 01 97 sbiw r24, 0x01 ; 1 10c18: 0f 94 af 7b call 0x2f75e ; 0x2f75e if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10c1c: 80 e2 ldi r24, 0x20 ; 32 10c1e: 97 e1 ldi r25, 0x17 ; 23 10c20: 0f 94 54 57 call 0x2aea8 ; 0x2aea8 10c24: 88 23 and r24, r24 10c26: 39 f0 breq .+14 ; 0x10c36 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 10c28: 0f 94 be 7b call 0x2f77c ; 0x2f77c rdPtr = start = blockBuffBegin; 10c2c: 2d e9 ldi r18, 0x9D ; 157 10c2e: 3e e0 ldi r19, 0x0E ; 14 10c30: 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 10c32: 81 11 cpse r24, r1 10c34: e2 cf rjmp .-60 ; 0x10bfa } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10c36: f0 92 3c 17 sts 0x173C, r15 ; 0x80173c 10c3a: e0 92 3b 17 sts 0x173B, r14 ; 0x80173b return -1; 10c3e: 0f ef ldi r16, 0xFF ; 255 10c40: 1f ef ldi r17, 0xFF ; 255 10c42: 37 c0 rjmp .+110 ; 0x10cb2 10c44: 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){ 10c46: b1 10 cpse r11, r1 10c48: d5 c0 rjmp .+426 ; 0x10df4 // 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 10c4a: 01 50 subi r16, 0x01 ; 1 10c4c: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 10c4e: c8 01 movw r24, r16 10c50: 82 1b sub r24, r18 10c52: 93 0b sbc r25, r19 10c54: 01 96 adiw r24, 0x01 ; 1 10c56: 0f 94 af 7b call 0x2f75e ; 0x2f75e int16_t rv = *rdPtr++; 10c5a: c8 01 movw r24, r16 10c5c: 01 96 adiw r24, 0x01 ; 1 10c5e: f8 01 movw r30, r16 10c60: 00 81 ld r16, Z 10c62: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 10c64: 80 90 28 17 lds r8, 0x1728 ; 0x801728 10c68: 90 90 29 17 lds r9, 0x1729 ; 0x801729 10c6c: a0 90 2a 17 lds r10, 0x172A ; 0x80172a 10c70: b0 90 2b 17 lds r11, 0x172B ; 0x80172b 10c74: 40 91 31 17 lds r20, 0x1731 ; 0x801731 10c78: 50 91 32 17 lds r21, 0x1732 ; 0x801732 10c7c: 60 91 33 17 lds r22, 0x1733 ; 0x801733 10c80: 70 91 34 17 lds r23, 0x1734 ; 0x801734 10c84: 84 16 cp r8, r20 10c86: 95 06 cpc r9, r21 10c88: a6 06 cpc r10, r22 10c8a: b7 06 cpc r11, r23 10c8c: a0 f6 brcc .-88 ; 0x10c36 // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 10c8e: 9c 01 movw r18, r24 10c90: 2d 59 subi r18, 0x9D ; 157 10c92: 3e 40 sbci r19, 0x0E ; 14 10c94: 21 15 cp r18, r1 10c96: 32 40 sbci r19, 0x02 ; 2 10c98: 44 f0 brlt .+16 ; 0x10caa // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10c9a: 80 e2 ldi r24, 0x20 ; 32 10c9c: 97 e1 ldi r25, 0x17 ; 23 10c9e: 0f 94 54 57 call 0x2aea8 ; 0x2aea8 10ca2: 88 23 and r24, r24 10ca4: 41 f2 breq .-112 ; 0x10c36 // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 10ca6: 8d e9 ldi r24, 0x9D ; 157 10ca8: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 10caa: 90 93 3c 17 sts 0x173C, r25 ; 0x80173c 10cae: 80 93 3b 17 sts 0x173B, r24 ; 0x80173b 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_;} 10cb2: 40 91 28 17 lds r20, 0x1728 ; 0x801728 10cb6: 50 91 29 17 lds r21, 0x1729 ; 0x801729 10cba: 60 91 2a 17 lds r22, 0x172A ; 0x80172a 10cbe: 70 91 2b 17 lds r23, 0x172B ; 0x80172b 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(); 10cc2: 40 93 a4 17 sts 0x17A4, r20 ; 0x8017a4 10cc6: 50 93 a5 17 sts 0x17A5, r21 ; 0x8017a5 10cca: 60 93 a6 17 sts 0x17A6, r22 ; 0x8017a6 10cce: 70 93 a7 17 sts 0x17A7, r23 ; 0x8017a7 10cd2: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10cd6: 90 91 9f 10 lds r25, 0x109F ; 0x80109f int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 10cda: 0a 30 cpi r16, 0x0A ; 10 10cdc: 61 f0 breq .+24 ; 0x10cf6 || serial_char == '\r' 10cde: 0d 30 cpi r16, 0x0D ; 13 10ce0: 51 f0 breq .+20 ; 0x10cf6 || serial_char == '#' 10ce2: 03 32 cpi r16, 0x23 ; 35 10ce4: 09 f4 brne .+2 ; 0x10ce8 10ce6: 8c c0 rjmp .+280 ; 0x10e00 || serial_count >= (MAX_CMD_SIZE - 1) 10ce8: 8f 35 cpi r24, 0x5F ; 95 10cea: 91 05 cpc r25, r1 10cec: 3c f4 brge .+14 ; 0x10cfc || n==-1 10cee: 0f 3f cpi r16, 0xFF ; 255 10cf0: 10 07 cpc r17, r16 10cf2: 09 f0 breq .+2 ; 0x10cf6 10cf4: 8c c0 rjmp .+280 ; 0x10e0e ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 10cf6: 00 97 sbiw r24, 0x00 ; 0 10cf8: 09 f4 brne .+2 ; 0x10cfc 10cfa: d4 cc rjmp .-1624 ; 0x106a4 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); }; 10cfc: 20 91 23 17 lds r18, 0x1723 ; 0x801723 10d00: 21 11 cpse r18, r1 10d02: 03 c0 rjmp .+6 ; 0x10d0a 10d04: 40 e0 ldi r20, 0x00 ; 0 10d06: 50 e0 ldi r21, 0x00 ; 0 10d08: 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; 10d0a: 20 91 82 03 lds r18, 0x0382 ; 0x800382 10d0e: 30 91 83 03 lds r19, 0x0383 ; 0x800383 10d12: 42 1b sub r20, r18 10d14: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 10d16: a0 91 a0 10 lds r26, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10d1a: b0 91 a1 10 lds r27, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10d1e: fd 01 movw r30, r26 10d20: eb 55 subi r30, 0x5B ; 91 10d22: ff 4e sbci r31, 0xEF ; 239 10d24: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 10d26: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 10d28: 52 83 std Z+2, r21 ; 0x02 10d2a: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 10d2c: 8b 55 subi r24, 0x5B ; 91 10d2e: 9f 4e sbci r25, 0xEF ; 239 10d30: fc 01 movw r30, r24 10d32: ea 0f add r30, r26 10d34: fb 1f adc r31, r27 10d36: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 10d38: ab 55 subi r26, 0x5B ; 91 10d3a: bf 4e sbci r27, 0xEF ; 239 10d3c: fd 01 movw r30, r26 10d3e: 01 90 ld r0, Z+ 10d40: 00 20 and r0, r0 10d42: e9 f7 brne .-6 ; 0x10d3e 10d44: 31 97 sbiw r30, 0x01 ; 1 10d46: ea 1b sub r30, r26 10d48: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 10d4a: 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; 10d4c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10d50: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10d54: 01 96 adiw r24, 0x01 ; 1 10d56: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 10d5a: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 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); 10d5e: 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; 10d60: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10d64: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10d68: e8 0f add r30, r24 10d6a: f9 2f mov r31, r25 10d6c: f1 1d adc r31, r1 10d6e: f0 93 a1 10 sts 0x10A1, r31 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10d72: e0 93 a0 10 sts 0x10A0, r30 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10d76: 80 91 23 17 lds r24, 0x1723 ; 0x801723 10d7a: 88 23 and r24, r24 10d7c: 09 f4 brne .+2 ; 0x10d80 10d7e: 43 c0 rjmp .+134 ; 0x10e06 10d80: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 10d84: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 10d88: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 10d8c: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 sdpos_atomic = card.get_sdpos(); 10d90: 80 93 82 03 sts 0x0382, r24 ; 0x800382 10d94: 90 93 83 03 sts 0x0383, r25 ; 0x800383 10d98: a0 93 84 03 sts 0x0384, r26 ; 0x800384 10d9c: b0 93 85 03 sts 0x0385, r27 ; 0x800385 if (bufindw == sizeof(cmdbuffer)) 10da0: ed 3e cpi r30, 0xED ; 237 10da2: f1 40 sbci r31, 0x01 ; 1 10da4: 21 f4 brne .+8 ; 0x10dae bufindw = 0; 10da6: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10daa: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> sei(); 10dae: 78 94 sei comment_mode = false; //for new command 10db0: 10 92 45 03 sts 0x0345, r1 ; 0x800345 serial_count = 0; //clear buffer 10db4: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10db8: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e if(card.eof()) break; 10dbc: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10dc0: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10dc4: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10dc8: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10dcc: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10dd0: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10dd4: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10dd8: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10ddc: 48 17 cp r20, r24 10dde: 59 07 cpc r21, r25 10de0: 6a 07 cpc r22, r26 10de2: 7b 07 cpc r23, r27 10de4: 30 f5 brcc .+76 ; 0x10e32 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 10de6: 8f e5 ldi r24, 0x5F ; 95 10de8: 90 e0 ldi r25, 0x00 ; 0 10dea: 0e 94 c2 5b call 0xb784 ; 0xb784 10dee: 81 11 cpse r24, r1 10df0: db ce rjmp .-586 ; 0x10ba8 10df2: 58 cc rjmp .-1872 ; 0x106a4 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 == ';' ){ 10df4: f8 01 movw r30, r16 10df6: 80 81 ld r24, Z 10df8: 8b 33 cpi r24, 0x3B ; 59 10dfa: 09 f4 brne .+2 ; 0x10dfe 10dfc: fa ce rjmp .-524 ; 0x10bf2 10dfe: 25 cf rjmp .-438 ; 0x10c4a || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10e00: c0 92 44 03 sts 0x0344, r12 ; 0x800344 10e04: 78 cf rjmp .-272 ; 0x10cf6 10e06: 80 e0 ldi r24, 0x00 ; 0 10e08: 90 e0 ldi r25, 0x00 ; 0 10e0a: dc 01 movw r26, r24 10e0c: c1 cf rjmp .-126 ; 0x10d90 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10e0e: 9c 01 movw r18, r24 10e10: 2f 5f subi r18, 0xFF ; 255 10e12: 3f 4f sbci r19, 0xFF ; 255 10e14: 30 93 9f 10 sts 0x109F, r19 ; 0x80109f 10e18: 20 93 9e 10 sts 0x109E, r18 ; 0x80109e 10e1c: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10e20: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10e24: 2b 55 subi r18, 0x5B ; 91 10e26: 3f 4e sbci r19, 0xEF ; 239 10e28: 82 0f add r24, r18 10e2a: 93 1f adc r25, r19 10e2c: fc 01 movw r30, r24 10e2e: 03 83 std Z+3, r16 ; 0x03 10e30: bb ce rjmp .-650 ; 0x10ba8 } } if(card.eof()) 10e32: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10e36: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10e3a: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10e3e: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10e42: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10e46: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10e4a: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10e4e: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10e52: 48 17 cp r20, r24 10e54: 59 07 cpc r21, r25 10e56: 6a 07 cpc r22, r26 10e58: 7b 07 cpc r23, r27 10e5a: 08 f4 brcc .+2 ; 0x10e5e 10e5c: 23 cc rjmp .-1978 ; 0x106a4 { // 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()) 10e5e: 0e 94 93 5a call 0xb526 ; 0xb526 10e62: 89 2b or r24, r25 10e64: 09 f0 breq .+2 ; 0x10e68 10e66: 1e cc rjmp .-1988 ; 0x106a4 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 10e68: 80 e2 ldi r24, 0x20 ; 32 10e6a: 97 e1 ldi r25, 0x17 ; 23 10e6c: 0f 94 76 59 call 0x2b2ec ; 0x2b2ec file.close(); 10e70: 80 e2 ldi r24, 0x20 ; 32 10e72: 97 e1 ldi r25, 0x17 ; 23 10e74: 0f 94 ab 59 call 0x2b356 ; 0x2b356 saving = false; 10e78: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 10e7c: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f { // 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 10e80: 82 e0 ldi r24, 0x02 ; 2 10e82: 94 e6 ldi r25, 0x64 ; 100 10e84: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 char time[30]; uint32_t t = print_job_timer.duration() / 60; 10e88: 0f 94 a8 3f call 0x27f50 ; 0x27f50 10e8c: 6b 01 movw r12, r22 10e8e: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 10e90: 0e 94 9f 65 call 0xcb3e ; 0xcb3e // 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; 10e94: 8c e3 ldi r24, 0x3C ; 60 10e96: 88 2e mov r8, r24 10e98: 91 2c mov r9, r1 10e9a: a1 2c mov r10, r1 10e9c: b1 2c mov r11, r1 10e9e: c7 01 movw r24, r14 10ea0: b6 01 movw r22, r12 10ea2: a5 01 movw r20, r10 10ea4: 94 01 movw r18, r8 10ea6: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> int hours, minutes; minutes = t % 60; 10eaa: ca 01 movw r24, r20 10eac: b9 01 movw r22, r18 10eae: a5 01 movw r20, r10 10eb0: 94 01 movw r18, r8 10eb2: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 10eb6: 7f 93 push r23 10eb8: 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; 10eba: c7 01 movw r24, r14 10ebc: b6 01 movw r22, r12 10ebe: 20 e1 ldi r18, 0x10 ; 16 10ec0: 3e e0 ldi r19, 0x0E ; 14 10ec2: 40 e0 ldi r20, 0x00 ; 0 10ec4: 50 e0 ldi r21, 0x00 ; 0 10ec6: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 10eca: 3f 93 push r19 10ecc: 2f 93 push r18 10ece: 80 ec ldi r24, 0xC0 ; 192 10ed0: 96 e7 ldi r25, 0x76 ; 118 10ed2: 9f 93 push r25 10ed4: 8f 93 push r24 10ed6: 8e 01 movw r16, r28 10ed8: 0f 5f subi r16, 0xFF ; 255 10eda: 1f 4f sbci r17, 0xFF ; 255 10edc: 1f 93 push r17 10ede: 0f 93 push r16 10ee0: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 SERIAL_ECHO_START; 10ee4: 82 ec ldi r24, 0xC2 ; 194 10ee6: 9a ea ldi r25, 0xAA ; 170 10ee8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(time); 10eec: c8 01 movw r24, r16 10eee: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 #ifndef SHOW_FILENAME_AFTER_FINISH lcd_setstatus(time); 10ef2: c8 01 movw r24, r16 10ef4: 0e 94 67 f5 call 0x1eace ; 0x1eace #endif //SHOW_FILENAME_AFTER_FINISH card.printingHasFinished(); 10ef8: 0f 94 be 81 call 0x3037c ; 0x3037c if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 10efc: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.553> if(!mounted) 10f00: 0f b6 in r0, 0x3f ; 63 10f02: f8 94 cli 10f04: de bf out 0x3e, r29 ; 62 10f06: 0f be out 0x3f, r0 ; 63 10f08: cd bf out 0x3d, r28 ; 61 10f0a: 80 91 91 14 lds r24, 0x1491 ; 0x801491 10f0e: 88 23 and r24, r24 10f10: 19 f0 breq .+6 ; 0x10f18 10f12: 0f 94 f2 76 call 0x2ede4 ; 0x2ede4 10f16: c6 cb rjmp .-2164 ; 0x106a4 { mount(); 10f18: 81 e0 ldi r24, 0x01 ; 1 10f1a: 0f 94 fd 81 call 0x303fa ; 0x303fa if(!mounted) //fail 10f1e: 80 91 91 14 lds r24, 0x1491 ; 0x801491 10f22: 81 11 cpse r24, r1 10f24: f6 cf rjmp .-20 ; 0x10f12 10f26: be cb rjmp .-2180 ; 0x106a4 00010f28 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 10f28: cf 93 push r28 10f2a: df 93 push r29 10f2c: ec 01 movw r28, r24 { while (*str) 10f2e: 89 91 ld r24, Y+ 10f30: 88 23 and r24, r24 10f32: 19 f0 breq .+6 ; 0x10f3a write(*str++); 10f34: 0e 94 b7 76 call 0xed6e ; 0xed6e 10f38: fa cf rjmp .-12 ; 0x10f2e } 10f3a: df 91 pop r29 10f3c: cf 91 pop r28 10f3e: 08 95 ret 00010f40 : //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) { 10f40: ff 92 push r15 10f42: 0f 93 push r16 10f44: 1f 93 push r17 10f46: cf 93 push r28 10f48: df 93 push r29 10f4a: ec 01 movw r28, r24 10f4c: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 10f4e: 66 23 and r22, r22 10f50: 09 f4 brne .+2 ; 0x10f54 10f52: 4b c0 rjmp .+150 ; 0x10fea #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); 10f54: 0f 94 12 da call 0x3b424 ; 0x3b424 <__strlen_P> 10f58: 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)) { 10f5a: c8 01 movw r24, r16 10f5c: 0e 94 c2 5b call 0xb784 ; 0xb784 10f60: 88 23 and r24, r24 10f62: 09 f4 brne .+2 ; 0x10f66 10f64: 53 c0 rjmp .+166 ; 0x1100c // 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; 10f66: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10f6a: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10f6e: fc 01 movw r30, r24 10f70: eb 55 subi r30, 0x5B ; 91 10f72: ff 4e sbci r31, 0xEF ; 239 10f74: 23 e0 ldi r18, 0x03 ; 3 10f76: 20 83 st Z, r18 10f78: 88 55 subi r24, 0x58 ; 88 10f7a: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 10f7c: 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) 10f7e: ff 20 and r15, r15 10f80: e9 f1 breq .+122 ; 0x10ffc strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 10f82: 0f 94 0b da call 0x3b416 ; 0x3b416 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 10f86: 82 ec ldi r24, 0xC2 ; 194 10f88: 9a ea ldi r25, 0xAA ; 170 10f8a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(MSG_Enqueing); 10f8e: 87 ef ldi r24, 0xF7 ; 247 10f90: 93 e6 ldi r25, 0x63 ; 99 10f92: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 10f96: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10f9a: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 10f9e: 88 55 subi r24, 0x58 ; 88 10fa0: 9f 4e sbci r25, 0xEF ; 239 10fa2: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_ECHOLNPGM("\""); 10fa6: 8e e9 ldi r24, 0x9E ; 158 10fa8: 96 e7 ldi r25, 0x76 ; 118 10faa: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 bufindw += len + (CMDHDRSIZE + 1); 10fae: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 10fb2: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10fb6: 04 96 adiw r24, 0x04 ; 4 10fb8: 08 0f add r16, r24 10fba: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 10fbc: 0d 3e cpi r16, 0xED ; 237 10fbe: 81 e0 ldi r24, 0x01 ; 1 10fc0: 18 07 cpc r17, r24 10fc2: f9 f0 breq .+62 ; 0x11002 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 10fc4: 10 93 a1 10 sts 0x10A1, r17 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 10fc8: 00 93 a0 10 sts 0x10A0, r16 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10fcc: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10fd0: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10fd4: 01 96 adiw r24, 0x01 ; 1 10fd6: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 10fda: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 10fde: df 91 pop r29 10fe0: cf 91 pop r28 10fe2: 1f 91 pop r17 10fe4: 0f 91 pop r16 10fe6: ff 90 pop r15 10fe8: 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); 10fea: fc 01 movw r30, r24 10fec: 01 90 ld r0, Z+ 10fee: 00 20 and r0, r0 10ff0: e9 f7 brne .-6 ; 0x10fec 10ff2: 31 97 sbiw r30, 0x01 ; 1 10ff4: 8f 01 movw r16, r30 10ff6: 08 1b sub r16, r24 10ff8: 19 0b sbc r17, r25 10ffa: af cf rjmp .-162 ; 0x10f5a // 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); 10ffc: 0f 94 bf e2 call 0x3c57e ; 0x3c57e 11000: c2 cf rjmp .-124 ; 0x10f86 SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11002: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 11006: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 1100a: e0 cf rjmp .-64 ; 0x10fcc ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 1100c: 8a e9 ldi r24, 0x9A ; 154 1100e: 9a ea ldi r25, 0xAA ; 170 11010: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(MSG_Enqueing); 11014: 87 ef ldi r24, 0xF7 ; 247 11016: 93 e6 ldi r25, 0x63 ; 99 11018: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 1101c: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 1101e: ff 20 and r15, r15 11020: 59 f0 breq .+22 ; 0x11038 SERIAL_PROTOCOLRPGM(cmd); 11022: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11026: 83 e8 ldi r24, 0x83 ; 131 11028: 9a ea ldi r25, 0xAA ; 170 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 1102a: df 91 pop r29 1102c: cf 91 pop r28 1102e: 1f 91 pop r17 11030: 0f 91 pop r16 11032: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11034: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 11038: 0e 94 94 87 call 0x10f28 ; 0x10f28 1103c: f4 cf rjmp .-24 ; 0x11026 0001103e : { 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) { 1103e: 0f 93 push r16 11040: 1f 93 push r17 11042: cf 93 push r28 11044: df 93 push r29 11046: d6 2f mov r29, r22 11048: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 1104a: c0 e0 ldi r28, 0x00 ; 0 { void * const pgm_ptr = pgm_read_ptr(cmd_sequence + i); 1104c: f8 01 movw r30, r16 1104e: 85 91 lpm r24, Z+ 11050: 94 91 lpm r25, Z // M702 is currently only used with MMU enabled if (pgm_ptr == MSG_M702 && !MMU2::mmu2.Enabled()) { 11052: 2b e6 ldi r18, 0x6B ; 107 11054: 87 33 cpi r24, 0x37 ; 55 11056: 92 07 cpc r25, r18 11058: 21 f4 brne .+8 ; 0x11062 1105a: 20 91 ba 13 lds r18, 0x13BA ; 0x8013ba 1105e: 21 30 cpi r18, 0x01 ; 1 11060: 19 f4 brne .+6 ; 0x11068 continue; } enquecommand_P(static_cast(pgm_ptr)); 11062: 61 e0 ldi r22, 0x01 ; 1 11064: 0e 94 a0 87 call 0x10f40 ; 0x10f40 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) 11068: cf 5f subi r28, 0xFF ; 255 1106a: 0e 5f subi r16, 0xFE ; 254 1106c: 1f 4f sbci r17, 0xFF ; 255 1106e: dc 13 cpse r29, r28 11070: ed cf rjmp .-38 ; 0x1104c continue; } enquecommand_P(static_cast(pgm_ptr)); } } 11072: df 91 pop r29 11074: cf 91 pop r28 11076: 1f 91 pop r17 11078: 0f 91 pop r16 1107a: 08 95 ret 0001107c : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 1107c: cf 93 push r28 1107e: df 93 push r29 11080: cd b7 in r28, 0x3d ; 61 11082: de b7 in r29, 0x3e ; 62 11084: 6e 97 sbiw r28, 0x1e ; 30 11086: 0f b6 in r0, 0x3f ; 63 11088: f8 94 cli 1108a: de bf out 0x3e, r29 ; 62 1108c: 0f be out 0x3f, r0 ; 63 1108e: cd bf out 0x3d, r28 ; 61 11090: 9e 01 movw r18, r28 11092: 2c 5d subi r18, 0xDC ; 220 11094: 3f 4f sbci r19, 0xFF ; 255 11096: f9 01 movw r30, r18 11098: 41 91 ld r20, Z+ 1109a: 51 91 ld r21, Z+ 1109c: 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); 1109e: 6e e1 ldi r22, 0x1E ; 30 110a0: 70 e0 ldi r23, 0x00 ; 0 110a2: ce 01 movw r24, r28 110a4: 01 96 adiw r24, 0x01 ; 1 110a6: 0f 94 aa db call 0x3b754 ; 0x3b754 va_end(ap); enquecommand(cmd_buffer, false); 110aa: 60 e0 ldi r22, 0x00 ; 0 110ac: ce 01 movw r24, r28 110ae: 01 96 adiw r24, 0x01 ; 1 110b0: 0e 94 a0 87 call 0x10f40 ; 0x10f40 } 110b4: 6e 96 adiw r28, 0x1e ; 30 110b6: 0f b6 in r0, 0x3f ; 63 110b8: f8 94 cli 110ba: de bf out 0x3e, r29 ; 62 110bc: 0f be out 0x3f, r0 ; 63 110be: cd bf out 0x3d, r28 ; 61 110c0: df 91 pop r29 110c2: cf 91 pop r28 110c4: 08 95 ret 000110c6 : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 110c6: ef 92 push r14 110c8: ff 92 push r15 110ca: 0f 93 push r16 110cc: 1f 93 push r17 110ce: cf 93 push r28 110d0: df 93 push r29 110d2: cd b7 in r28, 0x3d ; 61 110d4: de b7 in r29, 0x3e ; 62 110d6: 6b 97 sbiw r28, 0x1b ; 27 110d8: 0f b6 in r0, 0x3f ; 63 110da: f8 94 cli 110dc: de bf out 0x3e, r29 ; 62 110de: 0f be out 0x3f, r0 ; 63 110e0: 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); 110e2: 8a e5 ldi r24, 0x5A ; 90 110e4: 9f e0 ldi r25, 0x0F ; 15 110e6: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 110ea: e8 2e mov r14, r24 110ec: 0a e0 ldi r16, 0x0A ; 10 110ee: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 110f0: 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); 110f2: 48 e0 ldi r20, 0x08 ; 8 110f4: 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++) { 110f6: fe 14 cp r15, r14 110f8: 79 f0 breq .+30 ; 0x11118 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 110fa: b8 01 movw r22, r16 110fc: ce 01 movw r24, r28 110fe: 0e 96 adiw r24, 0x0e ; 14 11100: 0f 94 44 dc call 0x3b888 ; 0x3b888 dir_name[8] = '\0'; 11104: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 11106: 60 e0 ldi r22, 0x00 ; 0 11108: ce 01 movw r24, r28 1110a: 0e 96 adiw r24, 0x0e ; 14 1110c: 0f 94 4f 7f call 0x2fe9e ; 0x2fe9e 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++) { 11110: f3 94 inc r15 11112: 08 5f subi r16, 0xF8 ; 248 11114: 1f 4f sbci r17, 0xFF ; 255 11116: ed cf rjmp .-38 ; 0x110f2 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); 11118: 65 e9 ldi r22, 0x95 ; 149 1111a: 7f e0 ldi r23, 0x0F ; 15 1111c: 8e 01 movw r16, r28 1111e: 0f 5f subi r16, 0xFF ; 255 11120: 1f 4f sbci r17, 0xFF ; 255 11122: c8 01 movw r24, r16 11124: 0f 94 44 dc call 0x3b888 ; 0x3b888 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 11128: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 1112a: 8e e2 ldi r24, 0x2E ; 46 1112c: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 1112e: 43 e0 ldi r20, 0x03 ; 3 11130: 50 e0 ldi r21, 0x00 ; 0 11132: 61 e9 ldi r22, 0x91 ; 145 11134: 7c e0 ldi r23, 0x0C ; 12 11136: ce 01 movw r24, r28 11138: 48 96 adiw r24, 0x18 ; 24 1113a: 0f 94 44 dc call 0x3b888 ; 0x3b888 extension_ptr[4] = '\0'; 1113e: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 11140: be 01 movw r22, r28 11142: 69 5e subi r22, 0xE9 ; 233 11144: 7f 4f sbci r23, 0xFF ; 255 11146: c8 01 movw r24, r16 11148: 0f 94 a0 e2 call 0x3c540 ; 0x3c540 enquecommandf_P(MSG_M23, filename); 1114c: 1f 93 push r17 1114e: 0f 93 push r16 11150: 80 e5 ldi r24, 0x50 ; 80 11152: 90 e7 ldi r25, 0x70 ; 112 11154: 9f 93 push r25 11156: 8f 93 push r24 11158: 0e 94 3e 88 call 0x1107c ; 0x1107c 1115c: 0f 90 pop r0 1115e: 0f 90 pop r0 11160: 0f 90 pop r0 11162: 0f 90 pop r0 } 11164: 6b 96 adiw r28, 0x1b ; 27 11166: 0f b6 in r0, 0x3f ; 63 11168: f8 94 cli 1116a: de bf out 0x3e, r29 ; 62 1116c: 0f be out 0x3f, r0 ; 63 1116e: cd bf out 0x3d, r28 ; 61 11170: df 91 pop r29 11172: cf 91 pop r28 11174: 1f 91 pop r17 11176: 0f 91 pop r16 11178: ff 90 pop r15 1117a: ef 90 pop r14 1117c: 08 95 ret 0001117e : //! 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) { 1117e: bf 92 push r11 11180: cf 92 push r12 11182: df 92 push r13 11184: ef 92 push r14 11186: ff 92 push r15 11188: 0f 93 push r16 1118a: 1f 93 push r17 1118c: cf 93 push r28 1118e: df 93 push r29 if (saved_printing) return; 11190: e0 91 a9 0d lds r30, 0x0DA9 ; 0x800da9 11194: e1 11 cpse r30, r1 11196: b1 c0 rjmp .+354 ; 0x112fa 11198: 05 2f mov r16, r21 1119a: 14 2f mov r17, r20 1119c: e9 01 movw r28, r18 1119e: 6b 01 movw r12, r22 111a0: 7c 01 movw r14, r24 cli(); 111a2: f8 94 cli save_print_file_state(); 111a4: 0e 94 ba 64 call 0xc974 ; 0xc974 // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 111a8: b0 90 a8 0d lds r11, 0x0DA8 ; 0x800da8 111ac: b1 10 cpse r11, r1 111ae: 02 c0 rjmp .+4 ; 0x111b4 111b0: b0 90 a7 0d lds r11, 0x0DA7 ; 0x800da7 save_planner_global_state(); 111b4: 0e 94 70 64 call 0xc8e0 ; 0xc8e0 planner_abort_hard(); //abort printing 111b8: 0f 94 fb c1 call 0x383f6 ; 0x383f6 memcpy(saved_pos, current_position, sizeof(saved_pos)); 111bc: 80 e1 ldi r24, 0x10 ; 16 111be: e2 e9 ldi r30, 0x92 ; 146 111c0: f6 e0 ldi r31, 0x06 ; 6 111c2: a3 e7 ldi r26, 0x73 ; 115 111c4: b2 e0 ldi r27, 0x02 ; 2 111c6: 01 90 ld r0, Z+ 111c8: 0d 92 st X+, r0 111ca: 8a 95 dec r24 111cc: e1 f7 brne .-8 ; 0x111c6 if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 111ce: bb 20 and r11, r11 111d0: 61 f0 breq .+24 ; 0x111ea 111d2: 80 e0 ldi r24, 0x00 ; 0 111d4: 90 e0 ldi r25, 0x00 ; 0 111d6: a0 e8 ldi r26, 0x80 ; 128 111d8: bf eb ldi r27, 0xBF ; 191 111da: 80 93 73 02 sts 0x0273, r24 ; 0x800273 111de: 90 93 74 02 sts 0x0274, r25 ; 0x800274 111e2: a0 93 75 02 sts 0x0275, r26 ; 0x800275 111e6: b0 93 76 02 sts 0x0276, r27 ; 0x800276 saved_feedmultiply2 = feedmultiply; //save feedmultiply 111ea: 80 91 39 02 lds r24, 0x0239 ; 0x800239 111ee: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 111f2: 90 93 72 03 sts 0x0372, r25 ; 0x800372 111f6: 80 93 71 03 sts 0x0371, r24 ; 0x800371 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 111fa: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 111fe: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 11202: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 11206: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_bed_temperature = (uint8_t)degTargetBed(); 1120a: 80 91 72 06 lds r24, 0x0672 ; 0x800672 1120e: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 11212: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 11216: 83 fb bst r24, 3 11218: 88 27 eor r24, r24 1121a: 80 f9 bld r24, 0 1121c: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; 11220: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 11224: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab cmdqueue_reset(); //empty cmdqueue 11228: 0e 94 c4 7e call 0xfd88 ; 0xfd88 card.sdprinting = false; 1122c: 10 92 90 14 sts 0x1490, r1 ; 0x801490 // card.closefile(); saved_printing = true; 11230: 81 e0 ldi r24, 0x01 ; 1 11232: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 11236: 0f 94 47 44 call 0x2888e ; 0x2888e sei(); 1123a: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 1123c: 20 e0 ldi r18, 0x00 ; 0 1123e: 30 e0 ldi r19, 0x00 ; 0 11240: a9 01 movw r20, r18 11242: c7 01 movw r24, r14 11244: b6 01 movw r22, r12 11246: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__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) 1124a: 20 e0 ldi r18, 0x00 ; 0 1124c: 30 e0 ldi r19, 0x00 ; 0 1124e: a9 01 movw r20, r18 11250: f8 01 movw r30, r16 11252: 6c 2f mov r22, r28 11254: 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 11256: 81 11 cpse r24, r1 11258: 5a c0 rjmp .+180 ; 0x1130e 1125a: 8f 2f mov r24, r31 1125c: 90 2f mov r25, r16 1125e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 11262: 88 23 and r24, r24 11264: 09 f4 brne .+2 ; 0x11268 11266: 49 c0 rjmp .+146 ; 0x112fa // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 11268: 80 91 64 05 lds r24, 0x0564 ; 0x800564 1126c: 81 11 cpse r24, r1 1126e: 05 c0 rjmp .+10 ; 0x1127a enquecommand_P(MSG_M83); 11270: 61 e0 ldi r22, 0x01 ; 1 11272: 8c e3 ldi r24, 0x3C ; 60 11274: 9b e6 ldi r25, 0x6B ; 107 11276: 0e 94 a0 87 call 0x10f40 ; 0x10f40 // 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); 1127a: 0f 93 push r16 1127c: 1f 93 push r17 1127e: df 93 push r29 11280: cf 93 push r28 11282: 86 eb ldi r24, 0xB6 ; 182 11284: 9d e6 ldi r25, 0x6D ; 109 11286: 9f 93 push r25 11288: 8f 93 push r24 1128a: 0e 94 3e 88 call 0x1107c ; 0x1107c } if(z_move) 1128e: 0f 90 pop r0 11290: 0f 90 pop r0 11292: 0f 90 pop r0 11294: 0f 90 pop r0 11296: 0f 90 pop r0 11298: 0f 90 pop r0 1129a: 20 e0 ldi r18, 0x00 ; 0 1129c: 30 e0 ldi r19, 0x00 ; 0 1129e: a9 01 movw r20, r18 112a0: c7 01 movw r24, r14 112a2: b6 01 movw r22, r12 112a4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 112a8: 88 23 and r24, r24 112aa: 21 f1 breq .+72 ; 0x112f4 { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 112ac: 84 e4 ldi r24, 0x44 ; 68 112ae: 8f 93 push r24 112b0: 88 e4 ldi r24, 0x48 ; 72 112b2: 8f 93 push r24 112b4: 1f 92 push r1 112b6: 1f 92 push r1 112b8: 20 91 7b 02 lds r18, 0x027B ; 0x80027b 112bc: 30 91 7c 02 lds r19, 0x027C ; 0x80027c 112c0: 40 91 7d 02 lds r20, 0x027D ; 0x80027d 112c4: 50 91 7e 02 lds r21, 0x027E ; 0x80027e 112c8: c7 01 movw r24, r14 112ca: b6 01 movw r22, r12 112cc: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 112d0: 9f 93 push r25 112d2: 8f 93 push r24 112d4: 7f 93 push r23 112d6: 6f 93 push r22 112d8: 8c e7 ldi r24, 0x7C ; 124 112da: 9d e7 ldi r25, 0x7D ; 125 112dc: 9f 93 push r25 112de: 8f 93 push r24 112e0: 0e 94 3e 88 call 0x1107c ; 0x1107c 112e4: 8d b7 in r24, 0x3d ; 61 112e6: 9e b7 in r25, 0x3e ; 62 112e8: 0a 96 adiw r24, 0x0a ; 10 112ea: 0f b6 in r0, 0x3f ; 63 112ec: f8 94 cli 112ee: 9e bf out 0x3e, r25 ; 62 112f0: 0f be out 0x3f, r0 ; 63 112f2: 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; 112f4: 81 e0 ldi r24, 0x01 ; 1 112f6: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 // 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(); } } 112fa: df 91 pop r29 112fc: cf 91 pop r28 112fe: 1f 91 pop r17 11300: 0f 91 pop r16 11302: ff 90 pop r15 11304: ef 90 pop r14 11306: df 90 pop r13 11308: cf 90 pop r12 1130a: bf 90 pop r11 1130c: 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) 1130e: 8f 2f mov r24, r31 11310: 90 2f mov r25, r16 11312: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 11316: 88 23 and r24, r24 11318: 49 f2 breq .-110 ; 0x112ac 1131a: a6 cf rjmp .-180 ; 0x11268 0001131c : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 1131c: 80 91 02 04 lds r24, 0x0402 ; 0x800402 11320: 88 23 and r24, r24 11322: 21 f1 breq .+72 ; 0x1136c if (backlightMode == BACKLIGHT_MODE_AUTO) 11324: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 11328: 82 30 cpi r24, 0x02 ; 2 1132a: e9 f4 brne .+58 ; 0x11366 { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 1132c: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 11330: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 11334: 28 ee ldi r18, 0xE8 ; 232 11336: 33 e0 ldi r19, 0x03 ; 3 11338: 0f 94 74 dd call 0x3bae8 ; 0x3bae8 <__usmulhisi3> 1133c: ab 01 movw r20, r22 1133e: bc 01 movw r22, r24 11340: 87 e3 ldi r24, 0x37 ; 55 11342: 93 e0 ldi r25, 0x03 ; 3 11344: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 11348: 88 23 and r24, r24 1134a: 31 f0 breq .+12 ; 0x11358 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); 1134c: 60 91 00 04 lds r22, 0x0400 ; 0x800400 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 11350: 70 e0 ldi r23, 0x00 ; 0 11352: 85 e0 ldi r24, 0x05 ; 5 11354: 0c 94 f4 e9 jmp 0x1d3e8 ; 0x1d3e8 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); 11358: 80 91 37 03 lds r24, 0x0337 ; 0x800337 1135c: 88 23 and r24, r24 1135e: 31 f0 breq .+12 ; 0x1136c 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); 11360: 60 91 01 04 lds r22, 0x0401 ; 0x800401 11364: f5 cf rjmp .-22 ; 0x11350 { 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); 11366: 81 11 cpse r24, r1 11368: fb cf rjmp .-10 ; 0x11360 1136a: f0 cf rjmp .-32 ; 0x1134c else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 1136c: 08 95 ret 0001136e : 1136e: 60 91 01 04 lds r22, 0x0401 ; 0x800401 11372: 84 e3 ldi r24, 0x34 ; 52 11374: 9d e0 ldi r25, 0x0D ; 13 11376: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 1137a: 60 91 00 04 lds r22, 0x0400 ; 0x800400 1137e: 83 e3 ldi r24, 0x33 ; 51 11380: 9d e0 ldi r25, 0x0D ; 13 11382: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 11386: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 1138a: 82 e3 ldi r24, 0x32 ; 50 1138c: 9d e0 ldi r25, 0x0D ; 13 1138e: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 11392: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 11396: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 1139a: 80 e3 ldi r24, 0x30 ; 48 1139c: 9d e0 ldi r25, 0x0D ; 13 1139e: 0d 94 96 dc jmp 0x3b92c ; 0x3b92c 000113a2 : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 113a2: 88 23 and r24, r24 113a4: 61 f0 breq .+24 ; 0x113be { backlightMode = BACKLIGHT_MODE_BRIGHT; 113a6: 81 e0 ldi r24, 0x01 ; 1 113a8: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < LCD_BACKLIGHT_FORCE_ON) backlightLevel_HIGH = LCD_BACKLIGHT_FORCE_ON; 113ac: 80 91 01 04 lds r24, 0x0401 ; 0x800401 113b0: 8e 31 cpi r24, 0x1E ; 30 113b2: 18 f4 brcc .+6 ; 0x113ba 113b4: 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); 113b6: 80 93 01 04 sts 0x0401, r24 ; 0x800401 } backlight_update(); 113ba: 0c 94 8e 89 jmp 0x1131c ; 0x1131c 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); 113be: 82 e3 ldi r24, 0x32 ; 50 113c0: 9d e0 ldi r25, 0x0D ; 13 113c2: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 113c6: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 113ca: 84 e3 ldi r24, 0x34 ; 52 113cc: 9d e0 ldi r25, 0x0D ; 13 113ce: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 113d2: f1 cf rjmp .-30 ; 0x113b6 000113d4 : 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; 113d4: 80 91 02 04 lds r24, 0x0402 ; 0x800402 113d8: 88 23 and r24, r24 113da: 31 f0 breq .+12 ; 0x113e8 backlightTimer.start(); 113dc: 87 e3 ldi r24, 0x37 ; 55 113de: 93 e0 ldi r25, 0x03 ; 3 113e0: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> backlight_update(); 113e4: 0c 94 8e 89 jmp 0x1131c ; 0x1131c } 113e8: 08 95 ret 000113ea : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 113ea: ff 92 push r15 113ec: 0f 93 push r16 113ee: 1f 93 push r17 113f0: cf 93 push r28 113f2: df 93 push r29 if (!backlightSupport) return; 113f4: 90 91 02 04 lds r25, 0x0402 ; 0x800402 113f8: 99 23 and r25, r25 113fa: 99 f1 breq .+102 ; 0x11462 if (flashNo) 113fc: 88 23 and r24, r24 113fe: 51 f1 breq .+84 ; 0x11454 { uint8_t backlightMode_bck = backlightMode; 11400: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 11404: c8 2f mov r28, r24 11406: d0 e0 ldi r29, 0x00 ; 0 11408: cc 0f add r28, r28 1140a: dd 1f adc r29, r29 1140c: 10 e0 ldi r17, 0x00 ; 0 1140e: ff 24 eor r15, r15 11410: f3 94 inc r15 11412: 21 2f mov r18, r17 11414: 30 e0 ldi r19, 0x00 ; 0 11416: 80 91 37 03 lds r24, 0x0337 ; 0x800337 1141a: 8f 25 eor r24, r15 1141c: 02 30 cpi r16, 0x02 ; 2 1141e: 09 f0 breq .+2 ; 0x11422 11420: 80 e0 ldi r24, 0x00 ; 0 11422: 8c 0f add r24, r28 11424: 9d 2f mov r25, r29 11426: 91 1d adc r25, r1 11428: 28 17 cp r18, r24 1142a: 39 07 cpc r19, r25 1142c: 8c f4 brge .+34 ; 0x11450 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 1142e: 81 e0 ldi r24, 0x01 ; 1 11430: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 11434: 91 11 cpse r25, r1 11436: 80 e0 ldi r24, 0x00 ; 0 11438: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 1143c: 0e 94 8e 89 call 0x1131c ; 0x1131c _delay(BL_FLASH_DELAY_MS); 11440: 69 e1 ldi r22, 0x19 ; 25 11442: 70 e0 ldi r23, 0x00 ; 0 11444: 80 e0 ldi r24, 0x00 ; 0 11446: 90 e0 ldi r25, 0x00 ; 0 11448: 0f 94 58 28 call 0x250b0 ; 0x250b0 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++) 1144c: 1f 5f subi r17, 0xFF ; 255 1144e: e1 cf rjmp .-62 ; 0x11412 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 11450: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 11454: df 91 pop r29 11456: cf 91 pop r28 11458: 1f 91 pop r17 1145a: 0f 91 pop r16 1145c: ff 90 pop r15 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 1145e: 0c 94 ea 89 jmp 0x113d4 ; 0x113d4 } 11462: df 91 pop r29 11464: cf 91 pop r28 11466: 1f 91 pop r17 11468: 0f 91 pop r16 1146a: ff 90 pop r15 1146c: 08 95 ret 0001146e : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 1146e: 0f 93 push r16 11470: 1f 93 push r17 11472: cf 93 push r28 11474: df 93 push r29 11476: c8 2f mov r28, r24 state = State::disabled; filter = 0; } bool PAT9125_sensor::update() { switch (state) { 11478: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1147c: 81 30 cpi r24, 0x01 ; 1 1147e: 09 f4 brne .+2 ; 0x11482 11480: 41 c0 rjmp .+130 ; 0x11504 11482: 82 30 cpi r24, 0x02 ; 2 11484: 09 f4 brne .+2 ; 0x11488 11486: 57 c0 rjmp .+174 ; 0x11536 * * 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) 11488: 0e 94 61 67 call 0xcec2 ; 0xcec2 1148c: 81 11 cpse r24, r1 1148e: f9 c0 rjmp .+498 ; 0x11682 11490: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 11494: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 11498: 00 97 sbiw r24, 0x00 ; 0 1149a: 39 f4 brne .+14 ; 0x114aa 1149c: 20 91 72 06 lds r18, 0x0672 ; 0x800672 114a0: 30 91 73 06 lds r19, 0x0673 ; 0x800673 114a4: 23 2b or r18, r19 114a6: 09 f4 brne .+2 ; 0x114aa 114a8: ec c0 rjmp .+472 ; 0x11682 114aa: 40 91 30 02 lds r20, 0x0230 ; 0x800230 114ae: 50 91 31 02 lds r21, 0x0231 ; 0x800231 114b2: 60 91 32 02 lds r22, 0x0232 ; 0x800232 114b6: 70 91 33 02 lds r23, 0x0233 ; 0x800233 114ba: 41 15 cp r20, r1 114bc: 51 05 cpc r21, r1 114be: 61 05 cpc r22, r1 114c0: 71 05 cpc r23, r1 114c2: 09 f4 brne .+2 ; 0x114c6 114c4: de c0 rjmp .+444 ; 0x11682 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 114c6: 89 2b or r24, r25 114c8: 31 f4 brne .+12 ; 0x114d6 114ca: 80 91 72 06 lds r24, 0x0672 ; 0x800672 114ce: 90 91 73 06 lds r25, 0x0673 ; 0x800673 114d2: 89 2b or r24, r25 114d4: 29 f0 breq .+10 ; 0x114e0 114d6: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 114da: 88 23 and r24, r24 114dc: 09 f4 brne .+2 ; 0x114e0 114de: 39 c1 rjmp .+626 ; 0x11752 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 114e0: 8a ed ldi r24, 0xDA ; 218 114e2: 95 e0 ldi r25, 0x05 ; 5 114e4: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 114e8: 88 23 and r24, r24 114ea: 09 f4 brne .+2 ; 0x114ee 114ec: cc c0 rjmp .+408 ; 0x11686 { disable_heater(); 114ee: 0f 94 1d 30 call 0x2603a ; 0x2603a lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 114f2: 82 e7 ldi r24, 0x72 ; 114 114f4: 96 e3 ldi r25, 0x36 ; 54 114f6: 0e 94 2c 72 call 0xe458 ; 0xe458 114fa: 0f 94 f6 20 call 0x241ec ; 0x241ec lcd_return_to_status(); 114fe: 0f 94 ab 1f call 0x23f56 ; 0x23f56 11502: c1 c0 rjmp .+386 ; 0x11686 case State::initializing: if (!updatePAT9125()) { 11504: 0f 94 23 7d call 0x2fa46 ; 0x2fa46 11508: 88 23 and r24, r24 1150a: 09 f4 brne .+2 ; 0x1150e 1150c: bd cf rjmp .-134 ; 0x11488 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 1150e: 81 e0 ldi r24, 0x01 ; 1 11510: 90 91 b7 17 lds r25, 0x17B7 ; 0x8017b7 11514: 91 11 cpse r25, r1 11516: 01 c0 rjmp .+2 ; 0x1151a 11518: 80 e0 ldi r24, 0x00 ; 0 break; // still not stable. Stay in the initialization state. } oldFilamentPresent = 1151a: 80 93 ad 17 sts 0x17AD, r24 ; 0x8017ad getFilamentPresent(); // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldPos = pat9125_y; 1151e: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 11522: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 11526: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 1152a: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 state = State::ready; 1152e: 82 e0 ldi r24, 0x02 ; 2 11530: 80 93 aa 17 sts 0x17AA, r24 ; 0x8017aa 11534: a9 cf rjmp .-174 ; 0x11488 break; case State::ready: { updatePAT9125(); 11536: 0f 94 23 7d call 0x2fa46 ; 0x2fa46 postponedLoadEvent = false; 1153a: 10 92 ae 17 sts 0x17AE, r1 ; 0x8017ae sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 1153e: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 11542: 82 30 cpi r24, 0x02 ; 2 11544: 09 f0 breq .+2 ; 0x11548 11546: a0 cf rjmp .-192 ; 0x11488 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 11548: 80 91 af 17 lds r24, 0x17AF ; 0x8017af 1154c: 81 11 cpse r24, r1 1154e: 40 c0 rjmp .+128 ; 0x115d0 11550: d0 91 b7 17 lds r29, 0x17B7 ; 0x8017b7 11554: 81 e0 ldi r24, 0x01 ; 1 11556: d1 11 cpse r29, r1 11558: 01 c0 rjmp .+2 ; 0x1155c 1155a: 80 e0 ldi r24, 0x00 ; 0 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); if (oldFilamentPresent != newFilamentPresent) { 1155c: 90 91 ad 17 lds r25, 0x17AD ; 0x8017ad 11560: 89 17 cp r24, r25 11562: 09 f4 brne .+2 ; 0x11566 11564: 91 cf rjmp .-222 ; 0x11488 oldFilamentPresent = newFilamentPresent; 11566: 80 93 ad 17 sts 0x17AD, r24 ; 0x8017ad eventBlankingTimer.start(); 1156a: 8f ea ldi r24, 0xAF ; 175 1156c: 97 e1 ldi r25, 0x17 ; 23 1156e: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> if (newFilamentPresent) { // filament insertion 11572: dd 23 and r29, r29 11574: b1 f1 breq .+108 ; 0x115e2 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11576: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1157a: 88 23 and r24, r24 1157c: 11 f1 breq .+68 ; 0x115c2 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1157e: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 11582: 81 11 cpse r24, r1 11584: 1e c0 rjmp .+60 ; 0x115c2 && !( 11586: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1158a: 81 30 cpi r24, 0x01 ; 1 1158c: d1 f0 breq .+52 ; 0x115c2 } //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); 1158e: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 11592: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 11596: 89 1b sub r24, r25 11598: 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 1159a: 99 f4 brne .+38 ; 0x115c2 || printJobOngoing() 1159c: 0e 94 10 67 call 0xce20 ; 0xce20 115a0: 81 11 cpse r24, r1 115a2: 0f c0 rjmp .+30 ; 0x115c2 || (lcd_commands_type == LcdCommands::Layer1Cal) 115a4: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 115a8: 84 30 cpi r24, 0x04 ; 4 115aa: 59 f0 breq .+22 ; 0x115c2 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 115ac: 8f e5 ldi r24, 0x5F ; 95 115ae: 9f e0 ldi r25, 0x0F ; 15 115b0: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 115b4: 81 11 cpse r24, r1 115b6: 05 c0 rjmp .+10 ; 0x115c2 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 115b8: 61 e0 ldi r22, 0x01 ; 1 115ba: 8c e0 ldi r24, 0x0C ; 12 115bc: 9a e3 ldi r25, 0x3A ; 58 115be: 0f 94 3b d3 call 0x3a676 ; 0x3a676 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 115c2: 81 e0 ldi r24, 0x01 ; 1 115c4: 80 93 ae 17 sts 0x17AE, r24 ; 0x8017ae void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { #ifdef FILAMENT_SENSOR if (fsensor.update()) { lcd_draw_update = 1; //cause lcd update so that fsensor event polling can be done from the lcd draw routine. 115c8: 81 e0 ldi r24, 0x01 ; 1 115ca: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 115ce: 5c cf rjmp .-328 ; 0x11488 } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 115d0: 64 e6 ldi r22, 0x64 ; 100 115d2: 70 e0 ldi r23, 0x00 ; 0 115d4: 8f ea ldi r24, 0xAF ; 175 115d6: 97 e1 ldi r25, 0x17 ; 23 115d8: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 115dc: 81 11 cpse r24, r1 115de: b8 cf rjmp .-144 ; 0x11550 115e0: 53 cf rjmp .-346 ; 0x11488 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 115e2: 80 91 ac 17 lds r24, 0x17AC ; 0x8017ac 115e6: 88 23 and r24, r24 115e8: 79 f3 breq .-34 ; 0x115c8 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 115ea: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 115ee: 81 11 cpse r24, r1 115f0: eb cf rjmp .-42 ; 0x115c8 115f2: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 115f6: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 115fa: 89 1b sub r24, r25 115fc: 8f 70 andi r24, 0x0F ; 15 && ( 115fe: 21 f4 brne .+8 ; 0x11608 moves_planned() != 0 || printJobOngoing() 11600: 0e 94 10 67 call 0xce20 ; 0xce20 11604: 88 23 and r24, r24 11606: 01 f3 breq .-64 ; 0x115c8 ) && !( 11608: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 1160c: 81 11 cpse r24, r1 1160e: dc cf rjmp .-72 ; 0x115c8 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11610: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 11614: 81 30 cpi r24, 0x01 ; 1 11616: c1 f2 breq .-80 ; 0x115c8 || (lcd_commands_type == LcdCommands::Layer1Cal) 11618: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1161c: 84 30 cpi r24, 0x04 ; 4 1161e: a1 f2 breq .-88 ; 0x115c8 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11620: 8f e5 ldi r24, 0x5F ; 95 11622: 9f e0 ldi r25, 0x0F ; 15 11624: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11628: 81 11 cpse r24, r1 1162a: ce cf rjmp .-100 ; 0x115c8 } //! @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); 1162c: 82 ed ldi r24, 0xD2 ; 210 1162e: 95 e6 ldi r25, 0x65 ; 101 11630: 9f 93 push r25 11632: 8f 93 push r24 11634: 88 eb ldi r24, 0xB8 ; 184 11636: 95 e6 ldi r25, 0x65 ; 101 11638: 9f 93 push r25 1163a: 8f 93 push r24 1163c: 0f 94 16 db call 0x3b62c ; 0x3b62c void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11640: 10 92 ac 17 sts 0x17AC, r1 ; 0x8017ac autoLoadEnabled = false; 11644: 10 92 ab 17 sts 0x17AB, r1 ; 0x8017ab stop_and_save_print_to_ram(0, 0); 11648: 20 e0 ldi r18, 0x00 ; 0 1164a: 30 e0 ldi r19, 0x00 ; 0 1164c: a9 01 movw r20, r18 1164e: ca 01 movw r24, r20 11650: b9 01 movw r22, r18 11652: 0e 94 bf 88 call 0x1117e ; 0x1117e restore_print_from_ram_and_continue(0); 11656: 60 e0 ldi r22, 0x00 ; 0 11658: 70 e0 ldi r23, 0x00 ; 0 1165a: cb 01 movw r24, r22 1165c: 0e 94 c4 67 call 0xcf88 ; 0xcf88 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11660: 85 e6 ldi r24, 0x65 ; 101 11662: 9f e0 ldi r25, 0x0F ; 15 11664: 0e 94 a8 75 call 0xeb50 ; 0xeb50 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11668: 81 e0 ldi r24, 0x01 ; 1 1166a: 9f e0 ldi r25, 0x0F ; 15 1166c: 0e 94 9b 75 call 0xeb36 ; 0xeb36 enquecommand_front_P(MSG_M600); 11670: 87 e4 ldi r24, 0x47 ; 71 11672: 90 e7 ldi r25, 0x70 ; 112 11674: 0f 94 38 76 call 0x2ec70 ; 0x2ec70 11678: 0f 90 pop r0 1167a: 0f 90 pop r0 1167c: 0f 90 pop r0 1167e: 0f 90 pop r0 11680: a3 cf rjmp .-186 ; 0x115c8 inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11682: 10 92 da 05 sts 0x05DA, r1 ; 0x8005da #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)){ 11686: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 1168a: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 1168e: 03 97 sbiw r24, 0x03 ; 3 11690: 14 f4 brge .+4 ; 0x11696 get_command(); 11692: 0e 94 a0 82 call 0x10540 ; 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); 11696: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1169a: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 1169e: 98 17 cp r25, r24 116a0: 81 f0 breq .+32 ; 0x116c2 116a2: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 116a6: 86 30 cpi r24, 0x06 ; 6 116a8: 61 f4 brne .+24 ; 0x116c2 116aa: 68 e8 ldi r22, 0x88 ; 136 116ac: 73 e1 ldi r23, 0x13 ; 19 116ae: 8e e0 ldi r24, 0x0E ; 14 116b0: 95 e0 ldi r25, 0x05 ; 5 116b2: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 116b6: 88 23 and r24, r24 116b8: 21 f0 breq .+8 ; 0x116c2 { // 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(); 116ba: 8e e0 ldi r24, 0x0E ; 14 116bc: 95 e0 ldi r25, 0x05 ; 5 116be: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 116c2: 40 91 7e 03 lds r20, 0x037E ; 0x80037e 116c6: 50 91 7f 03 lds r21, 0x037F ; 0x80037f 116ca: 60 91 80 03 lds r22, 0x0380 ; 0x800380 116ce: 70 91 81 03 lds r23, 0x0381 ; 0x800381 116d2: 41 15 cp r20, r1 116d4: 51 05 cpc r21, r1 116d6: 61 05 cpc r22, r1 116d8: 71 05 cpc r23, r1 116da: 09 f0 breq .+2 ; 0x116de 116dc: 3f c0 rjmp .+126 ; 0x1175c kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 116de: 40 91 34 02 lds r20, 0x0234 ; 0x800234 116e2: 50 91 35 02 lds r21, 0x0235 ; 0x800235 116e6: 60 91 36 02 lds r22, 0x0236 ; 0x800236 116ea: 70 91 37 02 lds r23, 0x0237 ; 0x800237 116ee: 41 15 cp r20, r1 116f0: 51 05 cpc r21, r1 116f2: 61 05 cpc r22, r1 116f4: 71 05 cpc r23, r1 116f6: a9 f0 breq .+42 ; 0x11722 116f8: 86 e8 ldi r24, 0x86 ; 134 116fa: 93 e0 ldi r25, 0x03 ; 3 116fc: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 11700: 88 23 and r24, r24 11702: 79 f0 breq .+30 ; 0x11722 11704: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 11708: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 if(blocks_queued() == false && ignore_stepper_queue == false) { 1170c: 98 13 cpse r25, r24 1170e: 09 c0 rjmp .+18 ; 0x11722 11710: c1 11 cpse r28, r1 11712: 07 c0 rjmp .+14 ; 0x11722 disable_x(); 11714: 17 9a sbi 0x02, 7 ; 2 11716: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 1171a: 16 9a sbi 0x02, 6 ; 2 1171c: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_z(); disable_e0(); 11720: 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; 11722: c0 91 e7 03 lds r28, 0x03E7 ; 0x8003e7 block_t *block; if(block_buffer_tail != block_buffer_head) 11726: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 1172a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1172e: 98 17 cp r25, r24 11730: 01 f1 breq .+64 ; 0x11772 { uint8_t block_index = block_buffer_tail; 11732: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 tail_fan_speed = block_buffer[block_index].fan_speed; 11736: 9e e6 ldi r25, 0x6E ; 110 11738: 89 9f mul r24, r25 1173a: f0 01 movw r30, r0 1173c: 11 24 eor r1, r1 1173e: e5 5f subi r30, 0xF5 ; 245 11740: f8 4f sbci r31, 0xF8 ; 248 11742: c0 81 ld r28, Z while(block_index != block_buffer_head) 11744: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 11748: 98 17 cp r25, r24 1174a: 99 f0 breq .+38 ; 0x11772 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); 1174c: 8f 5f subi r24, 0xFF ; 255 1174e: 8f 70 andi r24, 0x0F ; 15 11750: f9 cf rjmp .-14 ; 0x11744 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11752: 8a ed ldi r24, 0xDA ; 218 11754: 95 e0 ldi r25, 0x05 ; 5 11756: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> 1175a: 95 cf rjmp .-214 ; 0x11686 // 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)) 1175c: 86 e8 ldi r24, 0x86 ; 134 1175e: 93 e0 ldi r25, 0x03 ; 3 11760: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 11764: 88 23 and r24, r24 11766: 09 f4 brne .+2 ; 0x1176a 11768: ba cf rjmp .-140 ; 0x116de kill(PSTR("Inactivity Shutdown")); 1176a: 80 ed ldi r24, 0xD0 ; 208 1176c: 9c e7 ldi r25, 0x7C ; 124 1176e: 0e 94 8a 79 call 0xf314 ; 0xf314 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) { 11772: cc 23 and r28, r28 11774: 09 f4 brne .+2 ; 0x11778 11776: 9f c0 rjmp .+318 ; 0x118b6 if (fan_kick_end == 0) { 11778: 80 91 6c 03 lds r24, 0x036C ; 0x80036c 1177c: 90 91 6d 03 lds r25, 0x036D ; 0x80036d 11780: a0 91 6e 03 lds r26, 0x036E ; 0x80036e 11784: b0 91 6f 03 lds r27, 0x036F ; 0x80036f 11788: 89 2b or r24, r25 1178a: 8a 2b or r24, r26 1178c: 8b 2b or r24, r27 1178e: 81 f4 brne .+32 ; 0x117b0 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11790: 0f 94 51 2a call 0x254a2 ; 0x254a2 11794: 60 5e subi r22, 0xE0 ; 224 11796: 7c 4f sbci r23, 0xFC ; 252 11798: 8f 4f sbci r24, 0xFF ; 255 1179a: 9f 4f sbci r25, 0xFF ; 255 1179c: 60 93 6c 03 sts 0x036C, r22 ; 0x80036c 117a0: 70 93 6d 03 sts 0x036D, r23 ; 0x80036d 117a4: 80 93 6e 03 sts 0x036E, r24 ; 0x80036e 117a8: 90 93 6f 03 sts 0x036F, r25 ; 0x80036f tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 117ac: cf ef ldi r28, 0xFF ; 255 117ae: 0f c0 rjmp .+30 ; 0x117ce 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()) 117b0: 0f 94 51 2a call 0x254a2 ; 0x254a2 117b4: 00 91 6c 03 lds r16, 0x036C ; 0x80036c 117b8: 10 91 6d 03 lds r17, 0x036D ; 0x80036d 117bc: 20 91 6e 03 lds r18, 0x036E ; 0x80036e 117c0: 30 91 6f 03 lds r19, 0x036F ; 0x80036f 117c4: 60 17 cp r22, r16 117c6: 71 07 cpc r23, r17 117c8: 82 07 cpc r24, r18 117ca: 93 07 cpc r25, r19 117cc: 78 f3 brcs .-34 ; 0x117ac } 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 117ce: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 117d2: 88 23 and r24, r24 117d4: 09 f4 brne .+2 ; 0x117d8 117d6: 78 c0 rjmp .+240 ; 0x118c8 fanSpeedBckp = tail_fan_speed; 117d8: 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) { 117dc: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.542> 117e0: 81 11 cpse r24, r1 117e2: 07 c0 rjmp .+14 ; 0x117f2 return; } avoidRecursion = true; 117e4: 81 e0 ldi r24, 0x01 ; 1 117e6: 80 93 0c 05 sts 0x050C, r24 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.542> mmu_loop_inner(true); 117ea: 0f 94 3a a7 call 0x34e74 ; 0x34e74 avoidRecursion = false; 117ee: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.542> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 117f2: 80 91 d3 05 lds r24, 0x05D3 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.540> 117f6: 88 23 and r24, r24 117f8: e1 f1 breq .+120 ; 0x11872 lcd_backlight_wake_trigger = false; 117fa: 10 92 d3 05 sts 0x05D3, r1 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.540> backlight_wake(); 117fe: 80 e0 ldi r24, 0x00 ; 0 11800: 0e 94 f5 89 call 0x113ea ; 0x113ea bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 11804: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11806: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11808: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.541> 1180c: 28 2f mov r18, r24 1180e: 08 2e mov r0, r24 11810: 00 0c add r0, r0 11812: 33 0b sbc r19, r19 11814: 37 ff sbrs r19, 7 11816: 03 c0 rjmp .+6 ; 0x1181e 11818: 31 95 neg r19 1181a: 21 95 neg r18 1181c: 31 09 sbc r19, r1 1181e: 24 30 cpi r18, 0x04 ; 4 11820: 31 05 cpc r19, r1 11822: 0c f4 brge .+2 ; 0x11826 11824: 54 c0 rjmp .+168 ; 0x118ce lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11826: 98 2f mov r25, r24 11828: 87 ff sbrs r24, 7 1182a: 02 c0 rjmp .+4 ; 0x11830 1182c: 93 e0 ldi r25, 0x03 ; 3 1182e: 98 0f add r25, r24 11830: 95 95 asr r25 11832: 95 95 asr r25 11834: 20 91 70 06 lds r18, 0x0670 ; 0x800670 11838: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1183c: 29 0f add r18, r25 1183e: 31 1d adc r19, r1 11840: 97 fd sbrc r25, 7 11842: 3a 95 dec r19 11844: 30 93 71 06 sts 0x0671, r19 ; 0x800671 11848: 20 93 70 06 sts 0x0670, r18 ; 0x800670 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 1184c: 83 78 andi r24, 0x83 ; 131 1184e: 87 ff sbrs r24, 7 11850: 03 c0 rjmp .+6 ; 0x11858 11852: 81 50 subi r24, 0x01 ; 1 11854: 8c 6f ori r24, 0xFC ; 252 11856: 8f 5f subi r24, 0xFF ; 255 11858: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.541> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1185c: 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); 1185e: 86 e0 ldi r24, 0x06 ; 6 11860: 0f 94 0c 4f call 0x29e18 ; 0x29e18 if (lcd_draw_update == 0) { 11864: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11868: 81 11 cpse r24, r1 1186a: 03 c0 rjmp .+6 ; 0x11872 // Update LCD rendering at minimum lcd_draw_update = 1; 1186c: 81 e0 ldi r24, 0x01 ; 1 1186e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11872: 0e 94 8e 89 call 0x1131c ; 0x1131c // handle longpress if(lcd_longpress_trigger) 11876: 80 91 d4 05 lds r24, 0x05D4 ; 0x8005d4 1187a: 88 23 and r24, r24 1187c: 61 f0 breq .+24 ; 0x11896 { lcd_consume_click(); // Reset trigger to prevent recursion 1187e: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11882: e0 91 17 04 lds r30, 0x0417 ; 0x800417 11886: f0 91 18 04 lds r31, 0x0418 ; 0x800418 1188a: 30 97 sbiw r30, 0x00 ; 0 1188c: 21 f0 breq .+8 ; 0x11896 1188e: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 11892: 81 11 cpse r24, r1 { lcd_longpress_func(); 11894: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 11896: 0e 94 d8 78 call 0xf1b0 ; 0xf1b0 #endif //AUTO_REPORT host_keepalive(); 1189a: 0e 94 27 7f call 0xfe4e ; 0xfe4e bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 1189e: 40 e3 ldi r20, 0x30 ; 48 118a0: 55 e7 ldi r21, 0x75 ; 117 118a2: 60 e0 ldi r22, 0x00 ; 0 118a4: 70 e0 ldi r23, 0x00 ; 0 118a6: 8e e9 ldi r24, 0x9E ; 158 118a8: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 118aa: df 91 pop r29 118ac: cf 91 pop r28 118ae: 1f 91 pop r17 118b0: 0f 91 pop r16 118b2: 0d 94 35 2b jmp 0x2566a ; 0x2566a ::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; 118b6: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c 118ba: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d 118be: 10 92 6e 03 sts 0x036E, r1 ; 0x80036e 118c2: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 118c6: 83 cf rjmp .-250 ; 0x117ce #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; 118c8: c0 93 a6 04 sts 0x04A6, r28 ; 0x8004a6 118cc: 87 cf rjmp .-242 ; 0x117dc 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; 118ce: 10 92 d1 05 sts 0x05D1, r1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.541> 118d2: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 118d4: 80 e0 ldi r24, 0x00 ; 0 118d6: c4 cf rjmp .-120 ; 0x11860 000118d8 : #endif #endif } void delay_keep_alive(unsigned int ms) { 118d8: cf 93 push r28 118da: df 93 push r29 118dc: ec 01 movw r28, r24 for (;;) { manage_heater(); 118de: 0f 94 61 39 call 0x272c2 ; 0x272c2 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 118e2: 81 e0 ldi r24, 0x01 ; 1 118e4: 0e 94 37 8a call 0x1146e ; 0x1146e lcd_update(0); 118e8: 80 e0 ldi r24, 0x00 ; 0 118ea: 0e 94 27 6e call 0xdc4e ; 0xdc4e if (ms == 0) 118ee: 20 97 sbiw r28, 0x00 ; 0 118f0: 99 f0 breq .+38 ; 0x11918 break; else if (ms >= 50) { 118f2: c2 33 cpi r28, 0x32 ; 50 118f4: d1 05 cpc r29, r1 118f6: 40 f0 brcs .+16 ; 0x11908 _delay(50); 118f8: 62 e3 ldi r22, 0x32 ; 50 118fa: 70 e0 ldi r23, 0x00 ; 0 118fc: 80 e0 ldi r24, 0x00 ; 0 118fe: 90 e0 ldi r25, 0x00 ; 0 11900: 0f 94 58 28 call 0x250b0 ; 0x250b0 ms -= 50; 11904: e2 97 sbiw r28, 0x32 ; 50 11906: eb cf rjmp .-42 ; 0x118de } else { _delay(ms); 11908: be 01 movw r22, r28 1190a: 90 e0 ldi r25, 0x00 ; 0 1190c: 80 e0 ldi r24, 0x00 ; 0 1190e: 0f 94 58 28 call 0x250b0 ; 0x250b0 ms = 0; 11912: d0 e0 ldi r29, 0x00 ; 0 11914: c0 e0 ldi r28, 0x00 ; 0 11916: e3 cf rjmp .-58 ; 0x118de } } } 11918: df 91 pop r29 1191a: cf 91 pop r28 1191c: 08 95 ret 0001191e : /// @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) { 1191e: cf 93 push r28 11920: df 93 push r29 11922: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11924: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11926: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 1192a: 81 e0 ldi r24, 0x01 ; 1 1192c: 0e 94 37 8a call 0x1146e ; 0x1146e 11930: 80 91 b8 13 lds r24, 0x13B8 ; 0x8013b8 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11934: 8f 3f cpi r24, 0xFF ; 255 11936: d9 f4 brne .+54 ; 0x1196e // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11938: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 1193c: 84 30 cpi r24, 0x04 ; 4 1193e: 21 f4 brne .+8 ; 0x11948 }; 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 11940: 80 91 50 13 lds r24, 0x1350 ; 0x801350 11944: 81 11 cpse r24, r1 11946: ef cf rjmp .-34 ; 0x11926 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 11948: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 1194c: 90 91 8c 13 lds r25, 0x138C ; 0x80138c 11950: 01 97 sbiw r24, 0x01 ; 1 11952: 49 f7 brne .-46 ; 0x11926 && lastErrorCode != ec) // The error code is not a duplicate 11954: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 11958: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 1195c: 89 32 cpi r24, 0x29 ; 41 1195e: 90 48 sbci r25, 0x80 ; 128 11960: 11 f3 breq .-60 ; 0x11926 { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11962: 60 e0 ldi r22, 0x00 ; 0 11964: 89 e2 ldi r24, 0x29 ; 41 11966: 90 e8 ldi r25, 0x80 ; 128 11968: 0f 94 29 84 call 0x30852 ; 0x30852 1196c: dc cf rjmp .-72 ; 0x11926 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 1196e: d0 93 b8 13 sts 0x13B8, r29 ; 0x8013b8 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11972: 85 30 cpi r24, 0x05 ; 5 11974: 39 f4 brne .+14 ; 0x11984 if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11976: cf 3f cpi r28, 0xFF ; 255 11978: f9 f2 breq .-66 ; 0x11938 MMU2::mmu2.eject_filament(eject_slot, true); 1197a: 61 e0 ldi r22, 0x01 ; 1 1197c: 8c 2f mov r24, r28 1197e: 0f 94 d0 ad call 0x35ba0 ; 0x35ba0 11982: d1 cf rjmp .-94 ; 0x11926 // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11984: 84 30 cpi r24, 0x04 ; 4 11986: c1 f6 brne .-80 ; 0x11938 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11988: df 91 pop r29 1198a: cf 91 pop r28 1198c: 08 95 ret 0001198e <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 1198e: 1f 92 push r1 11990: 0f 92 push r0 11992: 0f b6 in r0, 0x3f ; 63 11994: 0f 92 push r0 11996: 11 24 eor r1, r1 11998: 0b b6 in r0, 0x3b ; 59 1199a: 0f 92 push r0 1199c: 2f 93 push r18 1199e: 3f 93 push r19 119a0: 4f 93 push r20 119a2: 5f 93 push r21 119a4: 6f 93 push r22 119a6: 7f 93 push r23 119a8: 8f 93 push r24 119aa: 9f 93 push r25 119ac: af 93 push r26 119ae: bf 93 push r27 119b0: ef 93 push r30 119b2: ff 93 push r31 adc_values[adc_channel] += ADC; 119b4: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 119b8: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 119bc: e0 91 36 03 lds r30, 0x0336 ; 0x800336 119c0: f0 e0 ldi r31, 0x00 ; 0 119c2: ee 0f add r30, r30 119c4: ff 1f adc r31, r31 119c6: ea 5d subi r30, 0xDA ; 218 119c8: fc 4f sbci r31, 0xFC ; 252 119ca: 80 81 ld r24, Z 119cc: 91 81 ldd r25, Z+1 ; 0x01 119ce: 82 0f add r24, r18 119d0: 93 1f adc r25, r19 119d2: 91 83 std Z+1, r25 ; 0x01 119d4: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 119d6: 80 91 25 03 lds r24, 0x0325 ; 0x800325 119da: 8f 5f subi r24, 0xFF ; 255 119dc: 80 93 25 03 sts 0x0325, r24 ; 0x800325 119e0: 80 31 cpi r24, 0x10 ; 16 119e2: 09 f0 breq .+2 ; 0x119e6 <__vector_29+0x58> 119e4: 56 c0 rjmp .+172 ; 0x11a92 <__vector_29+0x104> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 119e6: 80 91 36 03 lds r24, 0x0336 ; 0x800336 119ea: 8f 5f subi r24, 0xFF ; 255 119ec: 80 93 36 03 sts 0x0336, r24 ; 0x800336 119f0: 88 30 cpi r24, 0x08 ; 8 119f2: 09 f0 breq .+2 ; 0x119f6 <__vector_29+0x68> 119f4: 46 c0 rjmp .+140 ; 0x11a82 <__vector_29+0xf4> #endif // ISR callback from adc when sampling finished void adc_callback() { current_temperature_raw[0] = adc_values[ADC_PIN_IDX(TEMP_0_PIN)]; //heater 119f6: 80 91 26 03 lds r24, 0x0326 ; 0x800326 119fa: 90 91 27 03 lds r25, 0x0327 ; 0x800327 119fe: 90 93 0c 06 sts 0x060C, r25 ; 0x80060c 11a02: 80 93 0b 06 sts 0x060B, r24 ; 0x80060b current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11a06: 80 91 2a 03 lds r24, 0x032A ; 0x80032a 11a0a: 90 91 2b 03 lds r25, 0x032B ; 0x80032b 11a0e: 90 93 0a 06 sts 0x060A, r25 ; 0x80060a 11a12: 80 93 09 06 sts 0x0609, r24 ; 0x800609 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11a16: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11a1a: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11a1e: 90 93 08 06 sts 0x0608, r25 ; 0x800608 11a22: 80 93 07 06 sts 0x0607, r24 ; 0x800607 #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR current_temperature_raw_ambient = adc_values[ADC_PIN_IDX(TEMP_AMBIENT_PIN)]; // 5->6 11a26: 80 91 30 03 lds r24, 0x0330 ; 0x800330 11a2a: 90 91 31 03 lds r25, 0x0331 ; 0x800331 11a2e: 90 93 16 06 sts 0x0616, r25 ; 0x800616 11a32: 80 93 15 06 sts 0x0615, r24 ; 0x800615 #endif //AMBIENT_THERMISTOR #ifdef VOLT_PWR_PIN current_voltage_raw_pwr = adc_values[ADC_PIN_IDX(VOLT_PWR_PIN)]; 11a36: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11a3a: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11a3e: 90 93 5d 06 sts 0x065D, r25 ; 0x80065d 11a42: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c #endif #ifdef VOLT_BED_PIN current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 11a46: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11a4a: 90 91 35 03 lds r25, 0x0335 ; 0x800335 11a4e: 90 93 5b 06 sts 0x065B, r25 ; 0x80065b 11a52: 80 93 5a 06 sts 0x065A, r24 ; 0x80065a #endif #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) fsensor.voltUpdate(adc_values[ADC_PIN_IDX(VOLT_IR_PIN)]); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) adc_values_ready = true; 11a56: 81 e0 ldi r24, 0x01 ; 1 11a58: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16adc_values_ready.lto_priv.459> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11a5c: ff 91 pop r31 11a5e: ef 91 pop r30 11a60: bf 91 pop r27 11a62: af 91 pop r26 11a64: 9f 91 pop r25 11a66: 8f 91 pop r24 11a68: 7f 91 pop r23 11a6a: 6f 91 pop r22 11a6c: 5f 91 pop r21 11a6e: 4f 91 pop r20 11a70: 3f 91 pop r19 11a72: 2f 91 pop r18 11a74: 0f 90 pop r0 11a76: 0b be out 0x3b, r0 ; 59 11a78: 0f 90 pop r0 11a7a: 0f be out 0x3f, r0 ; 63 11a7c: 0f 90 pop r0 11a7e: 1f 90 pop r1 11a80: 18 95 reti 11a82: 80 91 24 03 lds r24, 0x0324 ; 0x800324 <__data_end> return; // do not start the next measurement since there are no channels remaining } // find the next channel while (++adc_channel_idx) { if (ADC_CHAN_MSK & (1 << adc_channel_idx)) { 11a86: 4f e5 ldi r20, 0x5F ; 95 11a88: 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) { 11a8a: 8f 5f subi r24, 0xFF ; 255 11a8c: 41 f4 brne .+16 ; 0x11a9e <__vector_29+0x110> 11a8e: 10 92 24 03 sts 0x0324, r1 ; 0x800324 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11a92: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11a96: 80 64 ori r24, 0x40 ; 64 11a98: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11a9c: df cf rjmp .-66 ; 0x11a5c <__vector_29+0xce> 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)) { 11a9e: 9a 01 movw r18, r20 11aa0: 08 2e mov r0, r24 11aa2: 02 c0 rjmp .+4 ; 0x11aa8 <__vector_29+0x11a> 11aa4: 35 95 asr r19 11aa6: 27 95 ror r18 11aa8: 0a 94 dec r0 11aaa: e2 f7 brpl .-8 ; 0x11aa4 <__vector_29+0x116> 11aac: 20 ff sbrs r18, 0 11aae: ed cf rjmp .-38 ; 0x11a8a <__vector_29+0xfc> 11ab0: 80 93 24 03 sts 0x0324, r24 ; 0x800324 <__data_end> adc_setmux(adc_channel_idx); 11ab4: 0e 94 d3 5a call 0xb5a6 ; 0xb5a6 adc_count = 0; 11ab8: 10 92 25 03 sts 0x0325, r1 ; 0x800325 11abc: ea cf rjmp .-44 ; 0x11a92 <__vector_29+0x104> 00011abe : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 11abe: cf 93 push r28 11ac0: 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 11ac2: ca e7 ldi r28, 0x7A ; 122 11ac4: d0 e0 ldi r29, 0x00 ; 0 11ac6: 88 81 ld r24, Y 11ac8: 8f 7b andi r24, 0xBF ; 191 11aca: 88 83 st Y, r24 adc_count = 0; 11acc: 10 92 25 03 sts 0x0325, r1 ; 0x800325 adc_channel = 0; 11ad0: 10 92 36 03 sts 0x0336, r1 ; 0x800336 adc_channel_idx = first_channel_idx; 11ad4: 10 92 24 03 sts 0x0324, r1 ; 0x800324 <__data_end> adc_setmux(adc_channel_idx); 11ad8: 80 e0 ldi r24, 0x00 ; 0 11ada: 0e 94 d3 5a call 0xb5a6 ; 0xb5a6 memset((void*)adc_values, 0, sizeof(adc_values)); 11ade: e6 e2 ldi r30, 0x26 ; 38 11ae0: f3 e0 ldi r31, 0x03 ; 3 11ae2: 80 e1 ldi r24, 0x10 ; 16 11ae4: df 01 movw r26, r30 11ae6: 1d 92 st X+, r1 11ae8: 8a 95 dec r24 11aea: e9 f7 brne .-6 ; 0x11ae6 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 11aec: 88 81 ld r24, Y 11aee: 80 64 ori r24, 0x40 ; 64 11af0: 88 83 st Y, r24 } 11af2: df 91 pop r29 11af4: cf 91 pop r28 11af6: 08 95 ret 00011af8 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 11af8: 2f 92 push r2 11afa: 3f 92 push r3 11afc: 4f 92 push r4 11afe: 5f 92 push r5 11b00: 6f 92 push r6 11b02: 7f 92 push r7 11b04: 8f 92 push r8 11b06: 9f 92 push r9 11b08: af 92 push r10 11b0a: bf 92 push r11 11b0c: cf 92 push r12 11b0e: df 92 push r13 11b10: ef 92 push r14 11b12: ff 92 push r15 11b14: 0f 93 push r16 11b16: 1f 93 push r17 11b18: cf 93 push r28 11b1a: df 93 push r29 11b1c: cd b7 in r28, 0x3d ; 61 11b1e: de b7 in r29, 0x3e ; 62 11b20: a4 97 sbiw r28, 0x24 ; 36 11b22: 0f b6 in r0, 0x3f ; 63 11b24: f8 94 cli 11b26: de bf out 0x3e, r29 ; 62 11b28: 0f be out 0x3f, r0 ; 63 11b2a: 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(); 11b2c: 0f 94 ed 43 call 0x287da ; 0x287da if (planner_aborted) 11b30: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 11b34: 81 11 cpse r24, r1 11b36: 17 c0 rjmp .+46 ; 0x11b66 return; mesh_bed_leveling_flag = true; 11b38: 81 e0 ldi r24, 0x01 ; 1 11b3a: 80 93 a8 0d sts 0x0DA8, r24 ; 0x800da8 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { 11b3e: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 11b42: 88 23 and r24, r24 11b44: 49 f0 breq .+18 ; 0x11b58 11b46: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11b4a: 88 23 and r24, r24 11b4c: 29 f0 breq .+10 ; 0x11b58 11b4e: 20 91 91 06 lds r18, 0x0691 ; 0x800691 11b52: 2f 83 std Y+7, r18 ; 0x07 11b54: 21 11 cpse r18, r1 11b56: 20 c0 rjmp .+64 ; 0x11b98 11b58: 81 e0 ldi r24, 0x01 ; 1 11b5a: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 // 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); 11b5e: 80 e4 ldi r24, 0x40 ; 64 11b60: 9b e6 ldi r25, 0x6B ; 107 11b62: 0f 94 38 76 call 0x2ec70 ; 0x2ec70 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 11b66: a4 96 adiw r28, 0x24 ; 36 11b68: 0f b6 in r0, 0x3f ; 63 11b6a: f8 94 cli 11b6c: de bf out 0x3e, r29 ; 62 11b6e: 0f be out 0x3f, r0 ; 63 11b70: cd bf out 0x3d, r28 ; 61 11b72: df 91 pop r29 11b74: cf 91 pop r28 11b76: 1f 91 pop r17 11b78: 0f 91 pop r16 11b7a: ff 90 pop r15 11b7c: ef 90 pop r14 11b7e: df 90 pop r13 11b80: cf 90 pop r12 11b82: bf 90 pop r11 11b84: af 90 pop r10 11b86: 9f 90 pop r9 11b88: 8f 90 pop r8 11b8a: 7f 90 pop r7 11b8c: 6f 90 pop r6 11b8e: 5f 90 pop r5 11b90: 4f 90 pop r4 11b92: 3f 90 pop r3 11b94: 2f 90 pop r2 11b96: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 11b98: 8b ea ldi r24, 0xAB ; 171 11b9a: 9d e0 ldi r25, 0x0D ; 13 11b9c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 11ba0: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 11ba2: 8e e4 ldi r24, 0x4E ; 78 11ba4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 11ba8: 08 2f mov r16, r24 11baa: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 11bae: 8e 83 std Y+6, r24 ; 0x06 11bb0: 00 23 and r16, r16 11bb2: 29 f0 breq .+10 ; 0x11bbe 11bb4: 87 30 cpi r24, 0x07 ; 7 11bb6: 09 f4 brne .+2 ; 0x11bba 11bb8: c9 c0 rjmp .+402 ; 0x11d4c 11bba: 83 30 cpi r24, 0x03 ; 3 11bbc: 29 f0 breq .+10 ; 0x11bc8 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; 11bbe: 13 30 cpi r17, 0x03 ; 3 11bc0: 09 f0 breq .+2 ; 0x11bc4 11bc2: c3 c0 rjmp .+390 ; 0x11d4a 11bc4: 63 e0 ldi r22, 0x03 ; 3 11bc6: 6e 83 std Y+6, r22 ; 0x06 11bc8: 80 e0 ldi r24, 0x00 ; 0 11bca: 90 e0 ldi r25, 0x00 ; 0 11bcc: a0 e8 ldi r26, 0x80 ; 128 11bce: bf e3 ldi r27, 0x3F ; 63 11bd0: 8a 83 std Y+2, r24 ; 0x02 11bd2: 9b 83 std Y+3, r25 ; 0x03 11bd4: ac 83 std Y+4, r26 ; 0x04 11bd6: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 11bd8: 8a ea ldi r24, 0xAA ; 170 11bda: 9d e0 ldi r25, 0x0D ; 13 11bdc: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 11be0: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 11be2: 83 e4 ldi r24, 0x43 ; 67 11be4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 11be8: 18 2f mov r17, r24 11bea: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 11bee: 11 23 and r17, r17 11bf0: 29 f0 breq .+10 ; 0x11bfc 11bf2: 88 23 and r24, r24 11bf4: 19 f0 breq .+6 ; 0x11bfc 11bf6: 8b 30 cpi r24, 0x0B ; 11 11bf8: 08 f4 brcc .+2 ; 0x11bfc 11bfa: 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; 11bfc: 88 e5 ldi r24, 0x58 ; 88 11bfe: 0e 94 56 5b call 0xb6ac ; 0xb6ac 11c02: 88 23 and r24, r24 11c04: 09 f4 brne .+2 ; 0x11c08 11c06: ab c0 rjmp .+342 ; 0x11d5e 11c08: 0e 94 1d 60 call 0xc03a ; 0xc03a 11c0c: 20 e0 ldi r18, 0x00 ; 0 11c0e: 30 e0 ldi r19, 0x00 ; 0 11c10: 48 e0 ldi r20, 0x08 ; 8 11c12: 52 e4 ldi r21, 0x42 ; 66 11c14: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 11c18: 20 e0 ldi r18, 0x00 ; 0 11c1a: 30 e0 ldi r19, 0x00 ; 0 11c1c: 48 eb ldi r20, 0xB8 ; 184 11c1e: 51 e4 ldi r21, 0x41 ; 65 11c20: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 11c24: 6a 87 std Y+10, r22 ; 0x0a 11c26: 7b 87 std Y+11, r23 ; 0x0b 11c28: 8c 87 std Y+12, r24 ; 0x0c 11c2a: 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; 11c2c: 89 e5 ldi r24, 0x59 ; 89 11c2e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 11c32: 88 23 and r24, r24 11c34: 09 f4 brne .+2 ; 0x11c38 11c36: 9c c0 rjmp .+312 ; 0x11d70 11c38: 0e 94 1d 60 call 0xc03a ; 0xc03a 11c3c: 20 e0 ldi r18, 0x00 ; 0 11c3e: 30 e0 ldi r19, 0x00 ; 0 11c40: 48 e0 ldi r20, 0x08 ; 8 11c42: 52 e4 ldi r21, 0x42 ; 66 11c44: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 11c48: 20 e0 ldi r18, 0x00 ; 0 11c4a: 30 e0 ldi r19, 0x00 ; 0 11c4c: 40 ea ldi r20, 0xA0 ; 160 11c4e: 50 e4 ldi r21, 0x40 ; 64 11c50: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 11c54: 6c 8b std Y+20, r22 ; 0x14 11c56: 7d 8b std Y+21, r23 ; 0x15 11c58: 8e 8b std Y+22, r24 ; 0x16 11c5a: 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; 11c5c: 87 e5 ldi r24, 0x57 ; 87 11c5e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 11c62: 88 23 and r24, r24 11c64: 09 f4 brne .+2 ; 0x11c68 11c66: 89 c0 rjmp .+274 ; 0x11d7a 11c68: 0e 94 1d 60 call 0xc03a ; 0xc03a 11c6c: 2a 85 ldd r18, Y+10 ; 0x0a 11c6e: 3b 85 ldd r19, Y+11 ; 0x0b 11c70: 4c 85 ldd r20, Y+12 ; 0x0c 11c72: 5d 85 ldd r21, Y+13 ; 0x0d 11c74: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 11c78: 20 e0 ldi r18, 0x00 ; 0 11c7a: 30 e0 ldi r19, 0x00 ; 0 11c7c: 48 e8 ldi r20, 0x88 ; 136 11c7e: 52 e4 ldi r21, 0x42 ; 66 11c80: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 11c84: 69 8f std Y+25, r22 ; 0x19 11c86: 7a 8f std Y+26, r23 ; 0x1a 11c88: 8b 8f std Y+27, r24 ; 0x1b 11c8a: 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; 11c8c: 88 e4 ldi r24, 0x48 ; 72 11c8e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 11c92: 88 23 and r24, r24 11c94: 09 f4 brne .+2 ; 0x11c98 11c96: 7a c0 rjmp .+244 ; 0x11d8c 11c98: 0e 94 1d 60 call 0xc03a ; 0xc03a 11c9c: 2c 89 ldd r18, Y+20 ; 0x14 11c9e: 3d 89 ldd r19, Y+21 ; 0x15 11ca0: 4e 89 ldd r20, Y+22 ; 0x16 11ca2: 5f 89 ldd r21, Y+23 ; 0x17 11ca4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 11ca8: 20 e0 ldi r18, 0x00 ; 0 11caa: 30 e0 ldi r19, 0x00 ; 0 11cac: 48 e8 ldi r20, 0x88 ; 136 11cae: 52 e4 ldi r21, 0x42 ; 66 11cb0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 11cb4: 6d 8f std Y+29, r22 ; 0x1d 11cb6: 7e 8f std Y+30, r23 ; 0x1e 11cb8: 8f 8f std Y+31, r24 ; 0x1f 11cba: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 11cbc: 0f 94 85 8c call 0x3190a ; 0x3190a mbl.z_values[0][0] = min_pos[Z_AXIS]; 11cc0: 80 91 29 02 lds r24, 0x0229 ; 0x800229 11cc4: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 11cc8: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 11ccc: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 11cd0: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 11cd4: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 11cd8: a0 93 c5 13 sts 0x13C5, r26 ; 0x8013c5 11cdc: b0 93 c6 13 sts 0x13C6, r27 ; 0x8013c6 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 11ce0: 0f 94 13 ca call 0x39426 ; 0x39426 11ce4: 05 ec ldi r16, 0xC5 ; 197 11ce6: 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) 11ce8: c8 01 movw r24, r16 11cea: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 11cee: 01 96 adiw r24, 0x01 ; 1 11cf0: 09 f0 breq .+2 ; 0x11cf4 11cf2: 51 c0 rjmp .+162 ; 0x11d96 11cf4: 0e 5f subi r16, 0xFE ; 254 11cf6: 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) { 11cf8: 05 3d cpi r16, 0xD5 ; 213 11cfa: 8f e0 ldi r24, 0x0F ; 15 11cfc: 18 07 cpc r17, r24 11cfe: a1 f7 brne .-24 ; 0x11ce8 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 11d00: 21 2c mov r2, r1 11d02: a2 ec ldi r26, 0xC2 ; 194 11d04: b3 e1 ldi r27, 0x13 ; 19 11d06: ba a3 std Y+34, r27 ; 0x22 11d08: 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; 11d0a: b9 87 std Y+9, r27 ; 0x09 11d0c: a8 87 std Y+8, r26 ; 0x08 11d0e: 51 2c mov r5, r1 11d10: 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; 11d12: 31 2c mov r3, r1 11d14: 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)); 11d16: 84 2d mov r24, r4 11d18: 63 e0 ldi r22, 0x03 ; 3 11d1a: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__udivmodqi4> 11d1e: 98 8b std Y+16, r25 ; 0x10 11d20: 68 84 ldd r6, Y+8 ; 0x08 11d22: 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++) { 11d24: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 11d26: f8 89 ldd r31, Y+16 ; 0x10 11d28: f1 11 cpse r31, r1 11d2a: 37 c0 rjmp .+110 ; 0x11d9a 11d2c: 81 2f mov r24, r17 11d2e: 63 e0 ldi r22, 0x03 ; 3 11d30: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__udivmodqi4> 11d34: 91 11 cpse r25, r1 11d36: 31 c0 rjmp .+98 ; 0x11d9a if (isOn3x3Mesh) { if (has_z && (row || col)) { 11d38: 21 10 cpse r2, r1 11d3a: 3f c1 rjmp .+638 ; 0x11fba } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 11d3c: 7e 81 ldd r23, Y+6 ; 0x06 11d3e: 73 30 cpi r23, 0x03 ; 3 11d40: 09 f4 brne .+2 ; 0x11d44 11d42: 70 c0 rjmp .+224 ; 0x11e24 11d44: 8f 81 ldd r24, Y+7 ; 0x07 11d46: 8e 87 std Y+14, r24 ; 0x0e 11d48: 37 c0 rjmp .+110 ; 0x11db8 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; 11d4a: 1e 83 std Y+6, r17 ; 0x06 11d4c: 6a e9 ldi r22, 0x9A ; 154 11d4e: 79 e9 ldi r23, 0x99 ; 153 11d50: 89 e1 ldi r24, 0x19 ; 25 11d52: 9f e3 ldi r25, 0x3F ; 63 11d54: 6a 83 std Y+2, r22 ; 0x02 11d56: 7b 83 std Y+3, r23 ; 0x03 11d58: 8c 83 std Y+4, r24 ; 0x04 11d5a: 9d 83 std Y+5, r25 ; 0x05 11d5c: 3d cf rjmp .-390 ; 0x11bd8 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; 11d5e: 80 e0 ldi r24, 0x00 ; 0 11d60: 90 e0 ldi r25, 0x00 ; 0 11d62: a0 e8 ldi r26, 0x80 ; 128 11d64: bf ef ldi r27, 0xFF ; 255 11d66: 8a 87 std Y+10, r24 ; 0x0a 11d68: 9b 87 std Y+11, r25 ; 0x0b 11d6a: ac 87 std Y+12, r26 ; 0x0c 11d6c: bd 87 std Y+13, r27 ; 0x0d 11d6e: 5e cf rjmp .-324 ; 0x11c2c const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 11d70: 60 e0 ldi r22, 0x00 ; 0 11d72: 70 e0 ldi r23, 0x00 ; 0 11d74: 80 e8 ldi r24, 0x80 ; 128 11d76: 9f ef ldi r25, 0xFF ; 255 11d78: 6d cf rjmp .-294 ; 0x11c54 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 11d7a: 80 e0 ldi r24, 0x00 ; 0 11d7c: 90 e0 ldi r25, 0x00 ; 0 11d7e: a0 e8 ldi r26, 0x80 ; 128 11d80: bf e7 ldi r27, 0x7F ; 127 11d82: 89 8f std Y+25, r24 ; 0x19 11d84: 9a 8f std Y+26, r25 ; 0x1a 11d86: ab 8f std Y+27, r26 ; 0x1b 11d88: bc 8f std Y+28, r27 ; 0x1c 11d8a: 80 cf rjmp .-256 ; 0x11c8c const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 11d8c: 60 e0 ldi r22, 0x00 ; 0 11d8e: 70 e0 ldi r23, 0x00 ; 0 11d90: 80 e8 ldi r24, 0x80 ; 128 11d92: 9f e7 ldi r25, 0x7F ; 127 11d94: 8f cf rjmp .-226 ; 0x11cb4 11d96: 2f 80 ldd r2, Y+7 ; 0x07 11d98: b4 cf rjmp .-152 ; 0x11d02 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; } 11d9a: 60 e0 ldi r22, 0x00 ; 0 11d9c: 70 e0 ldi r23, 0x00 ; 0 11d9e: 80 ec ldi r24, 0xC0 ; 192 11da0: 9f e7 ldi r25, 0x7F ; 127 11da2: d3 01 movw r26, r6 11da4: 11 96 adiw r26, 0x01 ; 1 11da6: 6d 93 st X+, r22 11da8: 7d 93 st X+, r23 11daa: 8d 93 st X+, r24 11dac: 9c 93 st X, r25 11dae: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 11db0: be 81 ldd r27, Y+6 ; 0x06 11db2: b3 30 cpi r27, 0x03 ; 3 11db4: c1 f1 breq .+112 ; 0x11e26 11db6: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 11db8: 81 2f mov r24, r17 11dba: 0f 94 6d ca call 0x394da ; 0x394da 11dbe: 4b 01 movw r8, r22 11dc0: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 11dc2: 80 2f mov r24, r16 11dc4: 0f 94 6d ca call 0x394da ; 0x394da 11dc8: 6b 01 movw r12, r22 11dca: 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)) { 11dcc: a5 01 movw r20, r10 11dce: 94 01 movw r18, r8 11dd0: 6a 85 ldd r22, Y+10 ; 0x0a 11dd2: 7b 85 ldd r23, Y+11 ; 0x0b 11dd4: 8c 85 ldd r24, Y+12 ; 0x0c 11dd6: 9d 85 ldd r25, Y+13 ; 0x0d 11dd8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 11ddc: 18 16 cp r1, r24 11dde: 0c f4 brge .+2 ; 0x11de2 11de0: 1c c1 rjmp .+568 ; 0x1201a 11de2: 29 8d ldd r18, Y+25 ; 0x19 11de4: 3a 8d ldd r19, Y+26 ; 0x1a 11de6: 4b 8d ldd r20, Y+27 ; 0x1b 11de8: 5c 8d ldd r21, Y+28 ; 0x1c 11dea: c5 01 movw r24, r10 11dec: b4 01 movw r22, r8 11dee: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 11df2: 18 16 cp r1, r24 11df4: 0c f4 brge .+2 ; 0x11df8 11df6: 11 c1 rjmp .+546 ; 0x1201a 11df8: a7 01 movw r20, r14 11dfa: 96 01 movw r18, r12 11dfc: 6c 89 ldd r22, Y+20 ; 0x14 11dfe: 7d 89 ldd r23, Y+21 ; 0x15 11e00: 8e 89 ldd r24, Y+22 ; 0x16 11e02: 9f 89 ldd r25, Y+23 ; 0x17 11e04: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 11e08: 18 16 cp r1, r24 11e0a: 0c f4 brge .+2 ; 0x11e0e 11e0c: 06 c1 rjmp .+524 ; 0x1201a 11e0e: 2d 8d ldd r18, Y+29 ; 0x1d 11e10: 3e 8d ldd r19, Y+30 ; 0x1e 11e12: 4f 8d ldd r20, Y+31 ; 0x1f 11e14: 58 a1 ldd r21, Y+32 ; 0x20 11e16: c7 01 movw r24, r14 11e18: b6 01 movw r22, r12 11e1a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 11e1e: 18 16 cp r1, r24 11e20: 0c f4 brge .+2 ; 0x11e24 11e22: fb c0 rjmp .+502 ; 0x1201a continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 11e24: 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++) { 11e26: 1f 5f subi r17, 0xFF ; 255 11e28: 24 e0 ldi r18, 0x04 ; 4 11e2a: 62 0e add r6, r18 11e2c: 71 1c adc r7, r1 11e2e: 17 30 cpi r17, 0x07 ; 7 11e30: 09 f0 breq .+2 ; 0x11e34 11e32: 79 cf rjmp .-270 ; 0x11d26 11e34: 6f ef ldi r22, 0xFF ; 255 11e36: 46 1a sub r4, r22 11e38: 56 0a sbc r5, r22 11e3a: 88 85 ldd r24, Y+8 ; 0x08 11e3c: 99 85 ldd r25, Y+9 ; 0x09 11e3e: 4c 96 adiw r24, 0x1c ; 28 11e40: 99 87 std Y+9, r25 ; 0x09 11e42: 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++) { 11e44: 97 e0 ldi r25, 0x07 ; 7 11e46: 49 16 cp r4, r25 11e48: 51 04 cpc r5, r1 11e4a: 09 f0 breq .+2 ; 0x11e4e 11e4c: 63 cf rjmp .-314 ; 0x11d14 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 11e4e: 0f 94 2e a3 call 0x3465c ; 0x3465c // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 11e52: a0 91 c4 06 lds r26, 0x06C4 ; 0x8006c4 11e56: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 11e58: b0 91 f7 03 lds r27, 0x03F7 ; 0x8003f7 11e5c: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 11e5e: 81 e0 ldi r24, 0x01 ; 1 11e60: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = meshPointsToProbe + 10; 11e64: 8a e0 ldi r24, 0x0A ; 10 11e66: 83 0d add r24, r3 11e68: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 lcd_update(1); 11e6c: 81 e0 ldi r24, 0x01 ; 1 11e6e: 0e 94 27 6e call 0xdc4e ; 0xdc4e // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11e72: 80 e0 ldi r24, 0x00 ; 0 11e74: 90 e0 ldi r25, 0x00 ; 0 11e76: a0 ea ldi r26, 0xA0 ; 160 11e78: b0 e4 ldi r27, 0x40 ; 64 11e7a: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 11e7e: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 11e82: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 11e86: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 11e8a: 65 e5 ldi r22, 0x55 ; 85 11e8c: 75 e5 ldi r23, 0x55 ; 85 11e8e: 85 e5 ldi r24, 0x55 ; 85 11e90: 91 e4 ldi r25, 0x41 ; 65 11e92: 0f 94 81 c0 call 0x38102 ; 0x38102 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 11e96: 80 e0 ldi r24, 0x00 ; 0 11e98: 0e 94 68 66 call 0xccd0 ; 0xccd0 11e9c: 9c a3 std Y+36, r25 ; 0x24 11e9e: 8b a3 std Y+35, r24 ; 0x23 11ea0: 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 11ea2: 83 2d mov r24, r3 11ea4: 67 e0 ldi r22, 0x07 ; 7 11ea6: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__udivmodqi4> 11eaa: f8 2e mov r15, r24 11eac: 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 11eae: 68 2f mov r22, r24 11eb0: 70 e0 ldi r23, 0x00 ; 0 11eb2: 7f 87 std Y+15, r23 ; 0x0f 11eb4: 6e 87 std Y+14, r22 ; 0x0e 11eb6: 80 ff sbrs r24, 0 11eb8: 03 c0 rjmp .+6 ; 0x11ec0 11eba: 76 e0 ldi r23, 0x06 ; 6 11ebc: 79 1b sub r23, r25 11ebe: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 11ec0: 80 2f mov r24, r16 11ec2: 63 e0 ldi r22, 0x03 ; 3 11ec4: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__udivmodqi4> 11ec8: 91 11 cpse r25, r1 11eca: 05 c0 rjmp .+10 ; 0x11ed6 11ecc: 8f 2d mov r24, r15 11ece: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__udivmodqi4> 11ed2: 11 e0 ldi r17, 0x01 ; 1 11ed4: 91 11 cpse r25, r1 11ed6: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 11ed8: 80 2f mov r24, r16 11eda: 0f 94 6d ca call 0x394da ; 0x394da 11ede: 68 8b std Y+16, r22 ; 0x10 11ee0: 79 8b std Y+17, r23 ; 0x11 11ee2: 8a 8b std Y+18, r24 ; 0x12 11ee4: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 11ee6: 8f 2d mov r24, r15 11ee8: 0f 94 6d ca call 0x394da ; 0x394da 11eec: 4b 01 movw r8, r22 11eee: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 11ef0: 8e 81 ldd r24, Y+6 ; 0x06 11ef2: 83 30 cpi r24, 0x03 ; 3 11ef4: 09 f0 breq .+2 ; 0x11ef8 11ef6: 99 c0 rjmp .+306 ; 0x1202a if (!isOn3x3Mesh) { 11ef8: 11 11 cpse r17, r1 11efa: c8 c0 rjmp .+400 ; 0x1208c 11efc: 27 e0 ldi r18, 0x07 ; 7 11efe: ae 85 ldd r26, Y+14 ; 0x0e 11f00: bf 85 ldd r27, Y+15 ; 0x0f 11f02: 2a 9f mul r18, r26 11f04: f0 01 movw r30, r0 11f06: 2b 9f mul r18, r27 11f08: f0 0d add r31, r0 11f0a: 11 24 eor r1, r1 11f0c: e0 0f add r30, r16 11f0e: f1 1d adc r31, r1 11f10: ee 0f add r30, r30 11f12: ff 1f adc r31, r31 11f14: ee 0f add r30, r30 11f16: ff 1f adc r31, r31 11f18: ee 53 subi r30, 0x3E ; 62 11f1a: fc 4e sbci r31, 0xEC ; 236 11f1c: 60 e0 ldi r22, 0x00 ; 0 11f1e: 70 e0 ldi r23, 0x00 ; 0 11f20: 80 ec ldi r24, 0xC0 ; 192 11f22: 9f e7 ldi r25, 0x7F ; 127 11f24: 61 83 std Z+1, r22 ; 0x01 11f26: 72 83 std Z+2, r23 ; 0x02 11f28: 83 83 std Z+3, r24 ; 0x03 11f2a: 94 83 std Z+4, r25 ; 0x04 11f2c: 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) { 11f2e: e1 e3 ldi r30, 0x31 ; 49 11f30: 3e 12 cpse r3, r30 11f32: b7 cf rjmp .-146 ; 0x11ea2 custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11f34: 80 e0 ldi r24, 0x00 ; 0 11f36: 90 e0 ldi r25, 0x00 ; 0 11f38: a0 ea ldi r26, 0xA0 ; 160 11f3a: b0 e4 ldi r27, 0x40 ; 64 11f3c: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 11f40: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 11f44: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 11f48: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 11f4c: 65 e5 ldi r22, 0x55 ; 85 11f4e: 75 e5 ldi r23, 0x55 ; 85 11f50: 85 e5 ldi r24, 0x55 ; 85 11f52: 91 e4 ldi r25, 0x41 ; 65 11f54: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 11f58: 0f 94 ed 43 call 0x287da ; 0x287da static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 11f5c: b1 e3 ldi r27, 0x31 ; 49 11f5e: 3b 16 cp r3, r27 11f60: 09 f4 brne .+2 ; 0x11f64 11f62: 33 c2 rjmp .+1126 ; 0x123ca if (g80_fail_cnt++ >= 1) { 11f64: 80 91 6a 03 lds r24, 0x036A ; 0x80036a 11f68: 91 e0 ldi r25, 0x01 ; 1 11f6a: 98 0f add r25, r24 11f6c: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a 11f70: 88 23 and r24, r24 11f72: 09 f4 brne .+2 ; 0x11f76 11f74: d3 c1 rjmp .+934 ; 0x1231c print_stop(); 11f76: 60 e0 ldi r22, 0x00 ; 0 11f78: 80 e0 ldi r24, 0x00 ; 0 11f7a: 0e 94 78 f5 call 0x1eaf0 ; 0x1eaf0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 11f7e: 86 e4 ldi r24, 0x46 ; 70 11f80: 96 e3 ldi r25, 0x36 ; 54 11f82: 0e 94 2c 72 call 0xe458 ; 0xe458 11f86: 0f 94 f6 20 call 0x241ec ; 0x241ec lcd_z_calibration_prompt(false); 11f8a: 80 e0 ldi r24, 0x00 ; 0 11f8c: 0f 94 bb 0d call 0x21b76 ; 0x21b76 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 11f90: 81 e0 ldi r24, 0x01 ; 1 11f92: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 11f96: 8f ec ldi r24, 0xCF ; 207 11f98: 9f e6 ldi r25, 0x6F ; 111 11f9a: 0e 94 3b f2 call 0x1e476 ; 0x1e476 custom_message_type = custom_message_type_old; 11f9e: 2f 81 ldd r18, Y+7 ; 0x07 11fa0: 20 93 c4 06 sts 0x06C4, r18 ; 0x8006c4 custom_message_state = custom_message_state_old; 11fa4: 68 85 ldd r22, Y+8 ; 0x08 11fa6: 60 93 f7 03 sts 0x03F7, r22 ; 0x8003f7 lcd_update(2); 11faa: 82 e0 ldi r24, 0x02 ; 2 11fac: 0e 94 27 6e call 0xdc4e ; 0xdc4e st_synchronize(); 11fb0: 0f 94 ed 43 call 0x287da ; 0x287da mesh_bed_leveling_flag = false; 11fb4: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 11fb8: d6 cd rjmp .-1108 ; 0x11b66 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)) { 11fba: 01 11 cpse r16, r1 11fbc: 03 c0 rjmp .+6 ; 0x11fc4 11fbe: 11 23 and r17, r17 11fc0: 09 f4 brne .+2 ; 0x11fc4 11fc2: bc ce rjmp .-648 ; 0x11d3c // 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))); 11fc4: 81 2f mov r24, r17 11fc6: 63 e0 ldi r22, 0x03 ; 3 11fc8: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e <__divmodqi4> 11fcc: 84 0d add r24, r4 11fce: 95 2d mov r25, r5 11fd0: 91 1d adc r25, r1 11fd2: 88 0f add r24, r24 11fd4: 99 1f adc r25, r25 11fd6: 8d 53 subi r24, 0x3D ; 61 11fd8: 90 4f sbci r25, 0xF0 ; 240 11fda: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 11fde: bc 01 movw r22, r24 11fe0: 99 0f add r25, r25 11fe2: 88 0b sbc r24, r24 11fe4: 99 0b sbc r25, r25 11fe6: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 11fea: 2a e0 ldi r18, 0x0A ; 10 11fec: 37 ed ldi r19, 0xD7 ; 215 11fee: 43 e2 ldi r20, 0x23 ; 35 11ff0: 5c e3 ldi r21, 0x3C ; 60 11ff2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 11ff6: 9b 01 movw r18, r22 11ff8: ac 01 movw r20, r24 11ffa: 60 91 c3 13 lds r22, 0x13C3 ; 0x8013c3 11ffe: 70 91 c4 13 lds r23, 0x13C4 ; 0x8013c4 12002: 80 91 c5 13 lds r24, 0x13C5 ; 0x8013c5 12006: 90 91 c6 13 lds r25, 0x13C6 ; 0x8013c6 1200a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1200e: f3 01 movw r30, r6 12010: 61 83 std Z+1, r22 ; 0x01 12012: 72 83 std Z+2, r23 ; 0x02 12014: 83 83 std Z+3, r24 ; 0x03 12016: 94 83 std Z+4, r25 ; 0x04 12018: 91 ce rjmp .-734 ; 0x11d3c 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)) { 1201a: fe 85 ldd r31, Y+14 ; 0x0e 1201c: ff 23 and r31, r31 1201e: 09 f4 brne .+2 ; 0x12022 12020: 02 cf rjmp .-508 ; 0x11e26 12022: 22 20 and r2, r2 12024: 09 f4 brne .+2 ; 0x12028 12026: fe ce rjmp .-516 ; 0x11e24 12028: fe ce rjmp .-516 ; 0x11e26 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)) { 1202a: 28 89 ldd r18, Y+16 ; 0x10 1202c: 39 89 ldd r19, Y+17 ; 0x11 1202e: 4a 89 ldd r20, Y+18 ; 0x12 12030: 5b 89 ldd r21, Y+19 ; 0x13 12032: 6a 85 ldd r22, Y+10 ; 0x0a 12034: 7b 85 ldd r23, Y+11 ; 0x0b 12036: 8c 85 ldd r24, Y+12 ; 0x0c 12038: 9d 85 ldd r25, Y+13 ; 0x0d 1203a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1203e: 18 16 cp r1, r24 12040: 04 f1 brlt .+64 ; 0x12082 12042: 28 89 ldd r18, Y+16 ; 0x10 12044: 39 89 ldd r19, Y+17 ; 0x11 12046: 4a 89 ldd r20, Y+18 ; 0x12 12048: 5b 89 ldd r21, Y+19 ; 0x13 1204a: 69 8d ldd r22, Y+25 ; 0x19 1204c: 7a 8d ldd r23, Y+26 ; 0x1a 1204e: 8b 8d ldd r24, Y+27 ; 0x1b 12050: 9c 8d ldd r25, Y+28 ; 0x1c 12052: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 12056: 87 fd sbrc r24, 7 12058: 14 c0 rjmp .+40 ; 0x12082 1205a: a5 01 movw r20, r10 1205c: 94 01 movw r18, r8 1205e: 6c 89 ldd r22, Y+20 ; 0x14 12060: 7d 89 ldd r23, Y+21 ; 0x15 12062: 8e 89 ldd r24, Y+22 ; 0x16 12064: 9f 89 ldd r25, Y+23 ; 0x17 12066: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1206a: 18 16 cp r1, r24 1206c: 54 f0 brlt .+20 ; 0x12082 1206e: a5 01 movw r20, r10 12070: 94 01 movw r18, r8 12072: 6d 8d ldd r22, Y+29 ; 0x1d 12074: 7e 8d ldd r23, Y+30 ; 0x1e 12076: 8f 8d ldd r24, Y+31 ; 0x1f 12078: 98 a1 ldd r25, Y+32 ; 0x20 1207a: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1207e: 87 ff sbrs r24, 7 12080: 05 c0 rjmp .+10 ; 0x1208c 12082: 11 23 and r17, r17 12084: 09 f4 brne .+2 ; 0x12088 12086: 52 cf rjmp .-348 ; 0x11f2c 12088: 21 10 cpse r2, r1 1208a: 50 cf rjmp .-352 ; 0x11f2c mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 1208c: 10 e0 ldi r17, 0x00 ; 0 1208e: a7 e0 ldi r26, 0x07 ; 7 12090: 8e 85 ldd r24, Y+14 ; 0x0e 12092: 9f 85 ldd r25, Y+15 ; 0x0f 12094: a8 9f mul r26, r24 12096: f0 01 movw r30, r0 12098: a9 9f mul r26, r25 1209a: f0 0d add r31, r0 1209c: 11 24 eor r1, r1 1209e: e0 0f add r30, r16 120a0: f1 1f adc r31, r17 120a2: ee 0f add r30, r30 120a4: ff 1f adc r31, r31 120a6: ee 0f add r30, r30 120a8: ff 1f adc r31, r31 120aa: ee 53 subi r30, 0x3E ; 62 120ac: fc 4e sbci r31, 0xEC ; 236 120ae: 41 80 ldd r4, Z+1 ; 0x01 120b0: 52 80 ldd r5, Z+2 ; 0x02 120b2: 63 80 ldd r6, Z+3 ; 0x03 120b4: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 120b6: c1 2c mov r12, r1 120b8: d1 2c mov r13, r1 120ba: e0 ea ldi r30, 0xA0 ; 160 120bc: ee 2e mov r14, r30 120be: e0 e4 ldi r30, 0x40 ; 64 120c0: fe 2e mov r15, r30 120c2: 22 20 and r2, r2 120c4: 51 f0 breq .+20 ; 0x120da 120c6: 23 e3 ldi r18, 0x33 ; 51 120c8: 33 e3 ldi r19, 0x33 ; 51 120ca: 43 eb ldi r20, 0xB3 ; 179 120cc: 5e e3 ldi r21, 0x3E ; 62 120ce: c3 01 movw r24, r6 120d0: b2 01 movw r22, r4 120d2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 120d6: 6b 01 movw r12, r22 120d8: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 120da: a7 01 movw r20, r14 120dc: 96 01 movw r18, r12 120de: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 120e2: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 120e6: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 120ea: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 120ee: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 120f2: 87 ff sbrs r24, 7 120f4: 10 c0 rjmp .+32 ; 0x12116 current_position[Z_AXIS] = init_z_bckp; 120f6: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 120fa: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 120fe: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 12102: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12106: 65 e5 ldi r22, 0x55 ; 85 12108: 75 e5 ldi r23, 0x55 ; 85 1210a: 85 e5 ldi r24, 0x55 ; 85 1210c: 91 e4 ldi r25, 0x41 ; 65 1210e: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 12112: 0f 94 ed 43 call 0x287da ; 0x287da } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12116: 68 89 ldd r22, Y+16 ; 0x10 12118: 79 89 ldd r23, Y+17 ; 0x11 1211a: 8a 89 ldd r24, Y+18 ; 0x12 1211c: 9b 89 ldd r25, Y+19 ; 0x13 1211e: 60 93 92 06 sts 0x0692, r22 ; 0x800692 12122: 70 93 93 06 sts 0x0693, r23 ; 0x800693 12126: 80 93 94 06 sts 0x0694, r24 ; 0x800694 1212a: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = y_pos; 1212e: 80 92 96 06 sts 0x0696, r8 ; 0x800696 12132: 90 92 97 06 sts 0x0697, r9 ; 0x800697 12136: a0 92 98 06 sts 0x0698, r10 ; 0x800698 1213a: b0 92 99 06 sts 0x0699, r11 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 1213e: 66 e9 ldi r22, 0x96 ; 150 12140: 76 e0 ldi r23, 0x06 ; 6 12142: 82 e9 ldi r24, 0x92 ; 146 12144: 96 e0 ldi r25, 0x06 ; 6 12146: 0e 94 2a 6a call 0xd454 ; 0xd454 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 1214a: 60 e0 ldi r22, 0x00 ; 0 1214c: 70 e0 ldi r23, 0x00 ; 0 1214e: 86 e1 ldi r24, 0x16 ; 22 12150: 93 e4 ldi r25, 0x43 ; 67 12152: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 12156: 0f 94 ed 43 call 0x287da ; 0x287da if (planner_aborted) 1215a: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1215e: 88 23 and r24, r24 12160: 39 f0 breq .+14 ; 0x12170 { custom_message_type = custom_message_type_old; 12162: 7f 81 ldd r23, Y+7 ; 0x07 12164: 70 93 c4 06 sts 0x06C4, r23 ; 0x8006c4 custom_message_state = custom_message_state_old; 12168: 88 85 ldd r24, Y+8 ; 0x08 1216a: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 1216e: fb cc rjmp .-1546 ; 0x11b66 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 12170: 81 2c mov r8, r1 12172: 91 2c mov r9, r1 12174: 70 e2 ldi r23, 0x20 ; 32 12176: a7 2e mov r10, r23 12178: 71 ec ldi r23, 0xC1 ; 193 1217a: b7 2e mov r11, r23 1217c: 22 20 and r2, r2 1217e: 51 f0 breq .+20 ; 0x12194 12180: 2a 81 ldd r18, Y+2 ; 0x02 12182: 3b 81 ldd r19, Y+3 ; 0x03 12184: 4c 81 ldd r20, Y+4 ; 0x04 12186: 5d 81 ldd r21, Y+5 ; 0x05 12188: c3 01 movw r24, r6 1218a: b2 01 movw r22, r4 1218c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 12190: 4b 01 movw r8, r22 12192: 5c 01 movw r10, r24 12194: 48 8d ldd r20, Y+24 ; 0x18 12196: c5 01 movw r24, r10 12198: b4 01 movw r22, r8 1219a: 0f 94 8f 8c call 0x3191e ; 0x3191e 1219e: 81 11 cpse r24, r1 121a0: 0b c0 rjmp .+22 ; 0x121b8 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)); 121a2: 8f e8 ldi r24, 0x8F ; 143 121a4: 93 e6 ldi r25, 0x63 ; 99 121a6: 0e 94 2c 72 call 0xe458 ; 0xe458 121aa: 9f 93 push r25 121ac: 8f 93 push r24 121ae: 0f 94 16 db call 0x3b62c ; 0x3b62c 121b2: 0f 90 pop r0 121b4: 0f 90 pop r0 121b6: be ce rjmp .-644 ; 0x11f34 // 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. 121b8: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 121bc: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 121c0: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 121c4: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 121c8: c7 01 movw r24, r14 121ca: b6 01 movw r22, r12 121cc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 121d0: 20 e0 ldi r18, 0x00 ; 0 121d2: 30 e0 ldi r19, 0x00 ; 0 121d4: a9 01 movw r20, r18 121d6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 121da: 87 ff sbrs r24, 7 121dc: 36 c0 rjmp .+108 ; 0x1224a current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 121de: 60 e0 ldi r22, 0x00 ; 0 121e0: 70 e0 ldi r23, 0x00 ; 0 121e2: 80 ea ldi r24, 0xA0 ; 160 121e4: 90 e4 ldi r25, 0x40 ; 64 121e6: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 121ea: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 121ee: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 121f2: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 121f6: 65 e5 ldi r22, 0x55 ; 85 121f8: 75 e5 ldi r23, 0x55 ; 85 121fa: 85 e5 ldi r24, 0x55 ; 85 121fc: 91 e4 ldi r25, 0x41 ; 65 121fe: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 12202: 0f 94 ed 43 call 0x287da ; 0x287da 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 12206: 48 8d ldd r20, Y+24 ; 0x18 12208: c5 01 movw r24, r10 1220a: b4 01 movw r22, r8 1220c: 0f 94 8f 8c call 0x3191e ; 0x3191e 12210: 88 23 and r24, r24 12212: 39 f2 breq .-114 ; 0x121a2 printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 12214: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 12218: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 1221c: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 12220: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 12224: 60 e0 ldi r22, 0x00 ; 0 12226: 70 e0 ldi r23, 0x00 ; 0 12228: 80 ea ldi r24, 0xA0 ; 160 1222a: 90 e4 ldi r25, 0x40 ; 64 1222c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 12230: 2d ec ldi r18, 0xCD ; 205 12232: 3c ec ldi r19, 0xCC ; 204 12234: 4c ec ldi r20, 0xCC ; 204 12236: 5d e3 ldi r21, 0x3D ; 61 12238: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1223c: 87 ff sbrs r24, 7 1223e: 05 c0 rjmp .+10 ; 0x1224a puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 12240: 8d e1 ldi r24, 0x1D ; 29 12242: 9c e7 ldi r25, 0x7C ; 124 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")); 12244: 0f 94 3d db call 0x3b67a ; 0x3b67a 12248: 75 ce rjmp .-790 ; 0x11f34 1224a: c0 90 9a 06 lds r12, 0x069A ; 0x80069a 1224e: d0 90 9b 06 lds r13, 0x069B ; 0x80069b 12252: e0 90 9c 06 lds r14, 0x069C ; 0x80069c 12256: f0 90 9d 06 lds r15, 0x069D ; 0x80069d 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 1225a: 22 20 and r2, r2 1225c: a1 f0 breq .+40 ; 0x12286 1225e: a7 01 movw r20, r14 12260: 96 01 movw r18, r12 12262: c3 01 movw r24, r6 12264: b2 01 movw r22, r4 12266: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1226a: 9b 01 movw r18, r22 1226c: ac 01 movw r20, r24 1226e: 5f 77 andi r21, 0x7F ; 127 12270: 6a 81 ldd r22, Y+2 ; 0x02 12272: 7b 81 ldd r23, Y+3 ; 0x03 12274: 8c 81 ldd r24, Y+4 ; 0x04 12276: 9d 81 ldd r25, Y+5 ; 0x05 12278: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1227c: 87 ff sbrs r24, 7 1227e: 03 c0 rjmp .+6 ; 0x12286 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 12280: 84 ee ldi r24, 0xE4 ; 228 12282: 9b e7 ldi r25, 0x7B ; 123 12284: df cf rjmp .-66 ; 0x12244 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12286: 8f ea ldi r24, 0xAF ; 175 12288: 9f e0 ldi r25, 0x0F ; 15 1228a: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1228e: 88 23 and r24, r24 12290: 09 f4 brne .+2 ; 0x12294 12292: 40 c0 rjmp .+128 ; 0x12314 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); } 12294: 86 ea ldi r24, 0xA6 ; 166 12296: 9f e0 ldi r25, 0x0F ; 15 12298: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 if (!calibration_status_pinda()) return 0; 1229c: 88 23 and r24, r24 1229e: d1 f1 breq .+116 ; 0x12314 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 122a0: 60 91 99 03 lds r22, 0x0399 ; 0x800399 122a4: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 122a8: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 122ac: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 122b0: 0e 94 0a 5c call 0xb814 ; 0xb814 122b4: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 122b8: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 122bc: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 122c0: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 122c4: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 122c8: 9b 01 movw r18, r22 122ca: ac 01 movw r20, r24 122cc: e7 e0 ldi r30, 0x07 ; 7 122ce: ae 85 ldd r26, Y+14 ; 0x0e 122d0: bf 85 ldd r27, Y+15 ; 0x0f 122d2: ea 9f mul r30, r26 122d4: c0 01 movw r24, r0 122d6: eb 9f mul r30, r27 122d8: 90 0d add r25, r0 122da: 11 24 eor r1, r1 122dc: 08 0f add r16, r24 122de: 19 1f adc r17, r25 122e0: 00 0f add r16, r16 122e2: 11 1f adc r17, r17 122e4: 00 0f add r16, r16 122e6: 11 1f adc r17, r17 122e8: 0e 53 subi r16, 0x3E ; 62 122ea: 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; 122ec: c7 01 movw r24, r14 122ee: b6 01 movw r22, r12 122f0: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 122f4: d8 01 movw r26, r16 122f6: 11 96 adiw r26, 0x01 ; 1 122f8: 6d 93 st X+, r22 122fa: 7d 93 st X+, r23 122fc: 8d 93 st X+, r24 122fe: 9c 93 st X, r25 12300: 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--; 12302: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 12306: 81 50 subi r24, 0x01 ; 1 12308: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 mesh_point++; lcd_update(1); 1230c: 81 e0 ldi r24, 0x01 ; 1 1230e: 0e 94 27 6e call 0xdc4e ; 0xdc4e 12312: 0c ce rjmp .-1000 ; 0x11f2c } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12314: 20 e0 ldi r18, 0x00 ; 0 12316: 30 e0 ldi r19, 0x00 ; 0 12318: a9 01 movw r20, r18 1231a: d8 cf rjmp .-80 ; 0x122cc 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); 1231c: 85 e0 ldi r24, 0x05 ; 5 1231e: 0f 94 0c 4f call 0x29e18 ; 0x29e18 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; 12322: c1 2c mov r12, r1 12324: d1 2c mov r13, r1 12326: 90 ea ldi r25, 0xA0 ; 160 12328: e9 2e mov r14, r25 1232a: 90 e4 ldi r25, 0x40 ; 64 1232c: 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)); 1232e: 82 e1 ldi r24, 0x12 ; 18 12330: 96 e3 ldi r25, 0x36 ; 54 12332: 0e 94 2c 72 call 0xe458 ; 0xe458 12336: 0f 94 e9 20 call 0x241d2 ; 0x241d2 #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 1233a: 8e e1 ldi r24, 0x1E ; 30 1233c: 90 e0 ldi r25, 0x00 ; 0 1233e: 0f 94 34 3b call 0x27668 ; 0x27668 calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 12342: 0e 94 be 72 call 0xe57c ; 0xe57c #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); 12346: 80 e0 ldi r24, 0x00 ; 0 12348: 0f 94 e7 4e call 0x29dce ; 0x29dce 1234c: 18 2f mov r17, r24 raise_z(-1); 1234e: 60 e0 ldi r22, 0x00 ; 0 12350: 70 e0 ldi r23, 0x00 ; 0 12352: 80 e8 ldi r24, 0x80 ; 128 12354: 9f eb ldi r25, 0xBF ; 191 12356: 0e 94 61 6d call 0xdac2 ; 0xdac2 enable_z_endstop(true); 1235a: 81 e0 ldi r24, 0x01 ; 1 1235c: 0f 94 e7 4e call 0x29dce ; 0x29dce #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 12360: 84 e0 ldi r24, 0x04 ; 4 12362: 0f 94 dd 26 call 0x24dba ; 0x24dba #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12366: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 1236a: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 1236e: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 12372: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12376: 65 e5 ldi r22, 0x55 ; 85 12378: 75 e5 ldi r23, 0x55 ; 85 1237a: 85 e5 ldi r24, 0x55 ; 85 1237c: 91 e4 ldi r25, 0x41 ; 65 1237e: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 12382: 0f 94 ed 43 call 0x287da ; 0x287da #ifdef TMC2130 tmc2130_home_exit(); 12386: 0f 94 ae 26 call 0x24d5c ; 0x24d5c #endif // TMC2130 enable_z_endstop(bState); 1238a: 81 2f mov r24, r17 1238c: 0f 94 e7 4e call 0x29dce ; 0x29dce } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 12390: 82 e0 ldi r24, 0x02 ; 2 12392: 0f 94 d9 43 call 0x287b2 ; 0x287b2 12396: 20 e0 ldi r18, 0x00 ; 0 12398: 30 e0 ldi r19, 0x00 ; 0 1239a: 40 ea ldi r20, 0xA0 ; 160 1239c: 50 e4 ldi r21, 0x40 ; 64 1239e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 123a2: 18 16 cp r1, r24 123a4: 24 f2 brlt .-120 ; 0x1232e custom_message_type = custom_message_type_old; 123a6: ef 81 ldd r30, Y+7 ; 0x07 123a8: e0 93 c4 06 sts 0x06C4, r30 ; 0x8006c4 custom_message_state = custom_message_state_old; 123ac: f8 85 ldd r31, Y+8 ; 0x08 123ae: f0 93 f7 03 sts 0x03F7, r31 ; 0x8003f7 lcd_update_enable(true); // display / status-line recovery 123b2: 81 e0 ldi r24, 0x01 ; 1 123b4: 0e 94 a5 6e call 0xdd4a ; 0xdd4a gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 123b8: 41 e0 ldi r20, 0x01 ; 1 123ba: 61 e0 ldi r22, 0x01 ; 1 123bc: 81 e0 ldi r24, 0x01 ; 1 123be: 0e 94 85 7e call 0xfd0a ; 0xfd0a 123c2: 81 e0 ldi r24, 0x01 ; 1 123c4: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 123c8: ce cb rjmp .-2148 ; 0x11b66 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 123ca: 10 92 6a 03 sts 0x036A, r1 ; 0x80036a clean_up_after_endstop_move(l_feedmultiply); 123ce: 8b a1 ldd r24, Y+35 ; 0x23 123d0: 9c a1 ldd r25, Y+36 ; 0x24 123d2: 0e 94 4e 66 call 0xcc9c ; 0xcc9c } } void babystep_apply() { babystep_load(); 123d6: 0f 94 bd c9 call 0x3937a ; 0x3937a shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 123da: 60 91 8a 06 lds r22, 0x068A ; 0x80068a <_ZL13babystepLoadZ.lto_priv.499> 123de: 70 91 8b 06 lds r23, 0x068B ; 0x80068b <_ZL13babystepLoadZ.lto_priv.499+0x1> 123e2: 07 2e mov r0, r23 123e4: 00 0c add r0, r0 123e6: 88 0b sbc r24, r24 123e8: 99 0b sbc r25, r25 123ea: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 123ee: 90 58 subi r25, 0x80 ; 128 123f0: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 123f4: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 123f8: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 123fc: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 12400: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 12404: 0f 94 d9 c9 call 0x393b2 ; 0x393b2 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; 12408: 80 ec ldi r24, 0xC0 ; 192 1240a: 9f e0 ldi r25, 0x0F ; 15 1240c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 12410: 91 e0 ldi r25, 0x01 ; 1 12412: 81 30 cpi r24, 0x01 ; 1 12414: 09 f0 breq .+2 ; 0x12418 12416: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12418: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 1241a: 4f eb ldi r20, 0xBF ; 191 1241c: 5f e0 ldi r21, 0x0F ; 15 1241e: 6c e4 ldi r22, 0x4C ; 76 12420: ce 01 movw r24, r28 12422: 01 96 adiw r24, 0x01 ; 1 12424: 0e 94 6b 5b call 0xb6d6 ; 0xb6d6 12428: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 1242a: 4e eb ldi r20, 0xBE ; 190 1242c: 5f e0 ldi r21, 0x0F ; 15 1242e: 62 e5 ldi r22, 0x52 ; 82 12430: ce 01 movw r24, r28 12432: 01 96 adiw r24, 0x01 ; 1 12434: 0e 94 6b 5b call 0xb6d6 ; 0xb6d6 12438: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 1243a: 4d eb ldi r20, 0xBD ; 189 1243c: 5f e0 ldi r21, 0x0F ; 15 1243e: 66 e4 ldi r22, 0x46 ; 70 12440: ce 01 movw r24, r28 12442: 01 96 adiw r24, 0x01 ; 1 12444: 0e 94 6b 5b call 0xb6d6 ; 0xb6d6 12448: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 1244a: 4c eb ldi r20, 0xBC ; 188 1244c: 5f e0 ldi r21, 0x0F ; 15 1244e: 62 e4 ldi r22, 0x42 ; 66 12450: ce 01 movw r24, r28 12452: 01 96 adiw r24, 0x01 ; 1 12454: 0e 94 6b 5b call 0xb6d6 ; 0xb6d6 12458: 21 2f mov r18, r17 1245a: 11 0f add r17, r17 1245c: 33 0b sbc r19, r19 1245e: 08 2e mov r0, r24 12460: 00 0c add r0, r0 12462: 99 0b sbc r25, r25 12464: 5c 01 movw r10, r24 12466: a2 1a sub r10, r18 12468: b3 0a sbc r11, r19 1246a: 8f 2d mov r24, r15 1246c: ff 0c add r15, r15 1246e: 99 0b sbc r25, r25 12470: 28 0f add r18, r24 12472: 39 1f adc r19, r25 12474: 46 e0 ldi r20, 0x06 ; 6 12476: 42 9f mul r20, r18 12478: 60 01 movw r12, r0 1247a: 43 9f mul r20, r19 1247c: d0 0c add r13, r0 1247e: 11 24 eor r1, r1 12480: f1 2c mov r15, r1 12482: e1 2c mov r14, r1 12484: 00 2e mov r0, r16 12486: 00 0c add r0, r0 12488: 11 0b sbc r17, r17 1248a: 08 1b sub r16, r24 1248c: 19 0b sbc r17, r25 1248e: b7 01 movw r22, r14 12490: 6d 53 subi r22, 0x3D ; 61 12492: 7c 4e sbci r23, 0xEC ; 236 12494: 3b 01 movw r6, r22 12496: 46 01 movw r8, r12 12498: 77 e0 ldi r23, 0x07 ; 7 1249a: 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 * ( 1249c: d3 01 movw r26, r6 1249e: 2d 90 ld r2, X+ 124a0: 3d 90 ld r3, X+ 124a2: 4d 90 ld r4, X+ 124a4: 5d 90 ld r5, X+ 124a6: 3d 01 movw r6, r26 124a8: fd 01 movw r30, r26 124aa: 34 97 sbiw r30, 0x04 ; 4 124ac: fb 87 std Y+11, r31 ; 0x0b 124ae: ea 87 std Y+10, r30 ; 0x0a 124b0: b4 01 movw r22, r8 124b2: 09 2c mov r0, r9 124b4: 00 0c add r0, r0 124b6: 88 0b sbc r24, r24 124b8: 99 0b sbc r25, r25 124ba: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 124be: 2f e3 ldi r18, 0x3F ; 63 124c0: 33 ec ldi r19, 0xC3 ; 195 124c2: 4e e2 ldi r20, 0x2E ; 46 124c4: 59 e3 ldi r21, 0x39 ; 57 124c6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 124ca: a2 01 movw r20, r4 124cc: 91 01 movw r18, r2 124ce: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 124d2: aa 85 ldd r26, Y+10 ; 0x0a 124d4: bb 85 ldd r27, Y+11 ; 0x0b 124d6: 6d 93 st X+, r22 124d8: 7d 93 st X+, r23 124da: 8d 93 st X+, r24 124dc: 9c 93 st X, r25 124de: 13 97 sbiw r26, 0x03 ; 3 124e0: ba 81 ldd r27, Y+2 ; 0x02 124e2: b1 50 subi r27, 0x01 ; 1 124e4: ba 83 std Y+2, r27 ; 0x02 124e6: 80 0e add r8, r16 124e8: 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++) { 124ea: b1 11 cpse r27, r1 124ec: d7 cf rjmp .-82 ; 0x1249c 124ee: ca 0c add r12, r10 124f0: db 1c adc r13, r11 124f2: ec e1 ldi r30, 0x1C ; 28 124f4: ee 0e add r14, r30 124f6: 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++) { 124f8: f4 ec ldi r31, 0xC4 ; 196 124fa: ef 16 cp r14, r31 124fc: f1 04 cpc r15, r1 124fe: 39 f6 brne .-114 ; 0x1248e + 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) 12500: 0f 94 2e a3 call 0x3465c ; 0x3465c { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 12504: 8d e4 ldi r24, 0x4D ; 77 12506: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1250a: 88 23 and r24, r24 1250c: 09 f4 brne .+2 ; 0x12510 1250e: 84 c0 rjmp .+264 ; 0x12618 12510: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 if (nMeasPoints == 7 && useMagnetCompensation) { 12514: 2e 81 ldd r18, Y+6 ; 0x06 12516: 27 30 cpi r18, 0x07 ; 7 12518: 09 f0 breq .+2 ; 0x1251c 1251a: 94 c0 rjmp .+296 ; 0x12644 1251c: 88 23 and r24, r24 1251e: 09 f4 brne .+2 ; 0x12522 12520: 91 c0 rjmp .+290 ; 0x12644 12522: bb 24 eor r11, r11 12524: b3 94 inc r11 12526: aa 24 eor r10, r10 12528: aa 94 dec r10 1252a: ab 0c add r10, r11 1252c: 09 a1 ldd r16, Y+33 ; 0x21 1252e: 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++) { 12530: 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++; } 12532: 8e ef ldi r24, 0xFE ; 254 12534: 88 2e mov r8, r24 12536: 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)) { 12538: 6a 2d mov r22, r10 1253a: 86 2d mov r24, r6 1253c: 0f 94 88 c9 call 0x39310 ; 0x39310 12540: 99 24 eor r9, r9 12542: 93 94 inc r9 12544: 96 0c add r9, r6 12546: 81 11 cpse r24, r1 12548: 6e c0 rjmp .+220 ; 0x12626 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++; } 1254a: 6b 2d mov r22, r11 1254c: 86 2d mov r24, r6 1254e: 0f 94 88 c9 call 0x39310 ; 0x39310 } 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; 12552: c1 2c mov r12, r1 12554: d1 2c mov r13, r1 12556: 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; 12558: 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++; } 1255a: 88 23 and r24, r24 1255c: 81 f0 breq .+32 ; 0x1257e 1255e: 20 e0 ldi r18, 0x00 ; 0 12560: 30 e0 ldi r19, 0x00 ; 0 12562: a9 01 movw r20, r18 12564: d8 01 movw r26, r16 12566: 5d 96 adiw r26, 0x1d ; 29 12568: 6d 91 ld r22, X+ 1256a: 7d 91 ld r23, X+ 1256c: 8d 91 ld r24, X+ 1256e: 9c 91 ld r25, X 12570: 90 97 sbiw r26, 0x20 ; 32 12572: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 12576: 6b 01 movw r12, r22 12578: 7c 01 movw r14, r24 1257a: 77 24 eor r7, r7 1257c: 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++; } 1257e: 68 2d mov r22, r8 12580: 86 2d mov r24, r6 12582: 0f 94 88 c9 call 0x39310 ; 0x39310 12586: 88 23 and r24, r24 12588: 69 f0 breq .+26 ; 0x125a4 1258a: f8 01 movw r30, r16 1258c: 7b 97 sbiw r30, 0x1b ; 27 1258e: 20 81 ld r18, Z 12590: 31 81 ldd r19, Z+1 ; 0x01 12592: 42 81 ldd r20, Z+2 ; 0x02 12594: 53 81 ldd r21, Z+3 ; 0x03 12596: c7 01 movw r24, r14 12598: b6 01 movw r22, r12 1259a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1259e: 6b 01 movw r12, r22 125a0: 7c 01 movw r14, r24 125a2: 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++; } 125a4: 6a 2d mov r22, r10 125a6: 89 2d mov r24, r9 125a8: 0f 94 88 c9 call 0x39310 ; 0x39310 125ac: 88 23 and r24, r24 125ae: 61 f0 breq .+24 ; 0x125c8 125b0: f8 01 movw r30, r16 125b2: 25 81 ldd r18, Z+5 ; 0x05 125b4: 36 81 ldd r19, Z+6 ; 0x06 125b6: 47 81 ldd r20, Z+7 ; 0x07 125b8: 50 85 ldd r21, Z+8 ; 0x08 125ba: c7 01 movw r24, r14 125bc: b6 01 movw r22, r12 125be: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 125c2: 6b 01 movw r12, r22 125c4: 7c 01 movw r14, r24 125c6: 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++; } 125c8: 6a 2d mov r22, r10 125ca: 8f ef ldi r24, 0xFF ; 255 125cc: 86 0d add r24, r6 125ce: 0f 94 88 c9 call 0x39310 ; 0x39310 125d2: 88 23 and r24, r24 125d4: 31 f1 breq .+76 ; 0x12622 125d6: f8 01 movw r30, r16 125d8: 33 97 sbiw r30, 0x03 ; 3 125da: 20 81 ld r18, Z 125dc: 31 81 ldd r19, Z+1 ; 0x01 125de: 42 81 ldd r20, Z+2 ; 0x02 125e0: 53 81 ldd r21, Z+3 ; 0x03 125e2: c7 01 movw r24, r14 125e4: b6 01 movw r22, r12 125e6: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 125ea: 6b 01 movw r12, r22 125ec: 7c 01 movw r14, r24 125ee: 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 125f0: 67 2d mov r22, r7 125f2: 70 e0 ldi r23, 0x00 ; 0 125f4: 90 e0 ldi r25, 0x00 ; 0 125f6: 80 e0 ldi r24, 0x00 ; 0 125f8: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 125fc: 9b 01 movw r18, r22 125fe: ac 01 movw r20, r24 12600: c7 01 movw r24, r14 12602: b6 01 movw r22, r12 12604: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 12608: d8 01 movw r26, r16 1260a: 11 96 adiw r26, 0x01 ; 1 1260c: 6d 93 st X+, r22 1260e: 7d 93 st X+, r23 12610: 8d 93 st X+, r24 12612: 9c 93 st X, r25 12614: 14 97 sbiw r26, 0x04 ; 4 12616: 07 c0 rjmp .+14 ; 0x12626 } 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); 12618: 8c ea ldi r24, 0xAC ; 172 1261a: 9d e0 ldi r25, 0x0D ; 13 1261c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 12620: 79 cf rjmp .-270 ; 0x12514 12622: 71 10 cpse r7, r1 12624: e5 cf rjmp .-54 ; 0x125f0 //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++) { 12626: 69 2c mov r6, r9 12628: 0c 5f subi r16, 0xFC ; 252 1262a: 1f 4f sbci r17, 0xFF ; 255 1262c: b7 e0 ldi r27, 0x07 ; 7 1262e: 9b 12 cpse r9, r27 12630: 83 cf rjmp .-250 ; 0x12538 12632: b3 94 inc r11 12634: e9 a1 ldd r30, Y+33 ; 0x21 12636: fa a1 ldd r31, Y+34 ; 0x22 12638: 7c 96 adiw r30, 0x1c ; 28 1263a: fa a3 std Y+34, r31 ; 0x22 1263c: 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++) { 1263e: f8 e0 ldi r31, 0x08 ; 8 12640: bf 12 cpse r11, r31 12642: 71 cf rjmp .-286 ; 0x12526 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12644: 81 e0 ldi r24, 0x01 ; 1 12646: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 if (code_seen('O') && !code_value_uint8()) { 1264a: 8f e4 ldi r24, 0x4F ; 79 1264c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 12650: 81 11 cpse r24, r1 12652: 03 c0 rjmp .+6 ; 0x1265a // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12654: 0f 94 2e ca call 0x3945c ; 0x3945c 12658: 9b cc rjmp .-1738 ; 0x11f90 } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 1265a: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 1265e: 81 11 cpse r24, r1 12660: f9 cf rjmp .-14 ; 0x12654 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12662: 0e 94 43 66 call 0xcc86 ; 0xcc86 12666: 94 cc rjmp .-1752 ; 0x11f90 00012668 : //! @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() { 12668: 4f 92 push r4 1266a: 5f 92 push r5 1266c: 6f 92 push r6 1266e: 7f 92 push r7 12670: 8f 92 push r8 12672: 9f 92 push r9 12674: af 92 push r10 12676: bf 92 push r11 12678: ef 92 push r14 1267a: ff 92 push r15 1267c: 0f 93 push r16 1267e: 1f 93 push r17 12680: cf 93 push r28 12682: df 93 push r29 12684: 1f 92 push r1 12686: cd b7 in r28, 0x3d ; 61 12688: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 1268a: 44 e0 ldi r20, 0x04 ; 4 1268c: 50 e0 ldi r21, 0x00 ; 0 1268e: 64 e1 ldi r22, 0x14 ; 20 12690: 70 e0 ldi r23, 0x00 ; 0 12692: 8e eb ldi r24, 0xBE ; 190 12694: 9d e0 ldi r25, 0x0D ; 13 12696: 0f 94 44 dc call 0x3b888 ; 0x3b888 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 1269a: 43 e0 ldi r20, 0x03 ; 3 1269c: 50 e0 ldi r21, 0x00 ; 0 1269e: 63 e7 ldi r22, 0x73 ; 115 126a0: 77 e7 ldi r23, 0x77 ; 119 126a2: 8e eb ldi r24, 0xBE ; 190 126a4: 9d e0 ldi r25, 0x0D ; 13 126a6: 0f 94 33 da call 0x3b466 ; 0x3b466 126aa: 89 2b or r24, r25 126ac: 09 f0 breq .+2 ; 0x126b0 126ae: a0 c1 rjmp .+832 ; 0x129f0 { // 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)); 126b0: e7 e3 ldi r30, 0x37 ; 55 126b2: f8 e7 ldi r31, 0x78 ; 120 126b4: 45 91 lpm r20, Z+ 126b6: 55 91 lpm r21, Z+ 126b8: 65 91 lpm r22, Z+ 126ba: 74 91 lpm r23, Z 126bc: 88 ed ldi r24, 0xD8 ; 216 126be: 90 e0 ldi r25, 0x00 ; 0 126c0: 0e 94 a7 63 call 0xc74e ; 0xc74e eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 126c4: eb e3 ldi r30, 0x3B ; 59 126c6: f8 e7 ldi r31, 0x78 ; 120 126c8: 45 91 lpm r20, Z+ 126ca: 55 91 lpm r21, Z+ 126cc: 65 91 lpm r22, Z+ 126ce: 74 91 lpm r23, Z 126d0: 8c ed ldi r24, 0xDC ; 220 126d2: 90 e0 ldi r25, 0x00 ; 0 126d4: 0e 94 a7 63 call 0xc74e ; 0xc74e eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 126d8: ef e3 ldi r30, 0x3F ; 63 126da: f8 e7 ldi r31, 0x78 ; 120 126dc: 64 91 lpm r22, Z 126de: 80 ee ldi r24, 0xE0 ; 224 126e0: 90 e0 ldi r25, 0x00 ; 0 126e2: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 126e6: e0 e4 ldi r30, 0x40 ; 64 126e8: f8 e7 ldi r31, 0x78 ; 120 126ea: 65 91 lpm r22, Z+ 126ec: 74 91 lpm r23, Z 126ee: 81 ee ldi r24, 0xE1 ; 225 126f0: 90 e0 ldi r25, 0x00 ; 0 126f2: 0e 94 71 75 call 0xeae2 ; 0xeae2 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 126f6: e2 e4 ldi r30, 0x42 ; 66 126f8: f8 e7 ldi r31, 0x78 ; 120 126fa: 65 91 lpm r22, Z+ 126fc: 74 91 lpm r23, Z 126fe: 83 ee ldi r24, 0xE3 ; 227 12700: 90 e0 ldi r25, 0x00 ; 0 12702: 0e 94 71 75 call 0xeae2 ; 0xeae2 // 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)); 12706: e3 e3 ldi r30, 0x33 ; 51 12708: f8 e7 ldi r31, 0x78 ; 120 1270a: 45 91 lpm r20, Z+ 1270c: 55 91 lpm r21, Z+ 1270e: 65 91 lpm r22, Z+ 12710: 74 91 lpm r23, Z 12712: 84 ed ldi r24, 0xD4 ; 212 12714: 90 e0 ldi r25, 0x00 ; 0 12716: 0e 94 a7 63 call 0xc74e ; 0xc74e // 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); 1271a: 4f e0 ldi r20, 0x0F ; 15 1271c: 58 e7 ldi r21, 0x78 ; 120 1271e: 60 e1 ldi r22, 0x10 ; 16 12720: 70 e0 ldi r23, 0x00 ; 0 12722: 80 eb ldi r24, 0xB0 ; 176 12724: 90 e0 ldi r25, 0x00 ; 0 12726: 0e 94 52 75 call 0xeaa4 ; 0xeaa4 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); 1272a: 4f e1 ldi r20, 0x1F ; 31 1272c: 58 e7 ldi r21, 0x78 ; 120 1272e: 60 e1 ldi r22, 0x10 ; 16 12730: 70 e0 ldi r23, 0x00 ; 0 12732: 80 ec ldi r24, 0xC0 ; 192 12734: 90 e0 ldi r25, 0x00 ; 0 12736: 0e 94 52 75 call 0xeaa4 ; 0xeaa4 #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 1273a: 4f e2 ldi r20, 0x2F ; 47 1273c: 58 e7 ldi r21, 0x78 ; 120 1273e: 64 e0 ldi r22, 0x04 ; 4 12740: 70 e0 ldi r23, 0x00 ; 0 12742: 80 ed ldi r24, 0xD0 ; 208 12744: 90 e0 ldi r25, 0x00 ; 0 12746: 0e 94 52 75 call 0xeaa4 ; 0xeaa4 #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 1274a: 41 ed ldi r20, 0xD1 ; 209 1274c: 50 e0 ldi r21, 0x00 ; 0 1274e: 64 e1 ldi r22, 0x14 ; 20 12750: 70 e0 ldi r23, 0x00 ; 0 12752: 8e eb ldi r24, 0xBE ; 190 12754: 9d e0 ldi r25, 0x0D ; 13 12756: 0f 94 44 dc call 0x3b888 ; 0x3b888 calculate_extruder_multipliers(); 1275a: 0e 94 39 65 call 0xca72 ; 0xca72 1275e: 0e eb ldi r16, 0xBE ; 190 12760: 1d e0 ldi r17, 0x0D ; 13 12762: 8a e5 ldi r24, 0x5A ; 90 12764: e8 2e mov r14, r24 12766: 8e e0 ldi r24, 0x0E ; 14 12768: 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; 1276a: 94 ec ldi r25, 0xC4 ; 196 1276c: 89 2e mov r8, r25 1276e: 99 e0 ldi r25, 0x09 ; 9 12770: 99 2e mov r9, r25 12772: a1 2c mov r10, r1 12774: 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; 12776: 20 ec ldi r18, 0xC0 ; 192 12778: 42 2e mov r4, r18 1277a: 23 e0 ldi r18, 0x03 ; 3 1277c: 52 2e mov r5, r18 1277e: 61 2c mov r6, r1 12780: 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) 12782: 20 e0 ldi r18, 0x00 ; 0 12784: 30 e0 ldi r19, 0x00 ; 0 12786: 48 e4 ldi r20, 0x48 ; 72 12788: 53 e4 ldi r21, 0x43 ; 67 1278a: f8 01 movw r30, r16 1278c: 64 89 ldd r22, Z+20 ; 0x14 1278e: 75 89 ldd r23, Z+21 ; 0x15 12790: 86 89 ldd r24, Z+22 ; 0x16 12792: 97 89 ldd r25, Z+23 ; 0x17 12794: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 12798: 18 16 cp r1, r24 1279a: 4c f4 brge .+18 ; 0x127ae cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 1279c: 80 e0 ldi r24, 0x00 ; 0 1279e: 90 e0 ldi r25, 0x00 ; 0 127a0: a8 e4 ldi r26, 0x48 ; 72 127a2: b3 e4 ldi r27, 0x43 ; 67 127a4: f8 01 movw r30, r16 127a6: 84 8b std Z+20, r24 ; 0x14 127a8: 95 8b std Z+21, r25 ; 0x15 127aa: a6 8b std Z+22, r26 ; 0x16 127ac: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 127ae: f7 01 movw r30, r14 127b0: 61 91 ld r22, Z+ 127b2: 71 91 ld r23, Z+ 127b4: 81 91 ld r24, Z+ 127b6: 91 91 ld r25, Z+ 127b8: 7f 01 movw r14, r30 127ba: 20 e0 ldi r18, 0x00 ; 0 127bc: 30 e0 ldi r19, 0x00 ; 0 127be: 48 ec ldi r20, 0xC8 ; 200 127c0: 52 e4 ldi r21, 0x42 ; 66 127c2: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 127c6: 18 16 cp r1, r24 127c8: 54 f4 brge .+20 ; 0x127de cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 127ca: 80 e0 ldi r24, 0x00 ; 0 127cc: 90 e0 ldi r25, 0x00 ; 0 127ce: a8 ec ldi r26, 0xC8 ; 200 127d0: b2 e4 ldi r27, 0x42 ; 66 127d2: f7 01 movw r30, r14 127d4: 34 97 sbiw r30, 0x04 ; 4 127d6: 80 83 st Z, r24 127d8: 91 83 std Z+1, r25 ; 0x01 127da: a2 83 std Z+2, r26 ; 0x02 127dc: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 127de: f8 01 movw r30, r16 127e0: 84 a1 ldd r24, Z+36 ; 0x24 127e2: 95 a1 ldd r25, Z+37 ; 0x25 127e4: a6 a1 ldd r26, Z+38 ; 0x26 127e6: b7 a1 ldd r27, Z+39 ; 0x27 127e8: 85 3c cpi r24, 0xC5 ; 197 127ea: 99 40 sbci r25, 0x09 ; 9 127ec: a1 05 cpc r26, r1 127ee: b1 05 cpc r27, r1 127f0: 28 f0 brcs .+10 ; 0x127fc cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 127f2: f8 01 movw r30, r16 127f4: 84 a2 std Z+36, r8 ; 0x24 127f6: 95 a2 std Z+37, r9 ; 0x25 127f8: a6 a2 std Z+38, r10 ; 0x26 127fa: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 127fc: f7 01 movw r30, r14 127fe: 84 85 ldd r24, Z+12 ; 0x0c 12800: 95 85 ldd r25, Z+13 ; 0x0d 12802: a6 85 ldd r26, Z+14 ; 0x0e 12804: b7 85 ldd r27, Z+15 ; 0x0f 12806: 81 3c cpi r24, 0xC1 ; 193 12808: 93 40 sbci r25, 0x03 ; 3 1280a: a1 05 cpc r26, r1 1280c: b1 05 cpc r27, r1 1280e: 28 f0 brcs .+10 ; 0x1281a cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12810: f7 01 movw r30, r14 12812: 44 86 std Z+12, r4 ; 0x0c 12814: 55 86 std Z+13, r5 ; 0x0d 12816: 66 86 std Z+14, r6 ; 0x0e 12818: 77 86 std Z+15, r7 ; 0x0f 1281a: 0c 5f subi r16, 0xFC ; 252 1281c: 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++) 1281e: fd e0 ldi r31, 0x0D ; 13 12820: 06 3c cpi r16, 0xC6 ; 198 12822: 1f 07 cpc r17, r31 12824: 09 f0 breq .+2 ; 0x12828 12826: ad cf rjmp .-166 ; 0x12782 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]); 12828: 60 91 7a 0e lds r22, 0x0E7A ; 0x800e7a 1282c: 70 e0 ldi r23, 0x00 ; 0 1282e: 80 e0 ldi r24, 0x00 ; 0 12830: 0f 94 ff 25 call 0x24bfe ; 0x24bfe tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12834: 60 91 7b 0e lds r22, 0x0E7B ; 0x800e7b 12838: 70 e0 ldi r23, 0x00 ; 0 1283a: 81 e0 ldi r24, 0x01 ; 1 1283c: 0f 94 ff 25 call 0x24bfe ; 0x24bfe tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 12840: 60 91 7c 0e lds r22, 0x0E7C ; 0x800e7c 12844: 70 e0 ldi r23, 0x00 ; 0 12846: 82 e0 ldi r24, 0x02 ; 2 12848: 0f 94 ff 25 call 0x24bfe ; 0x24bfe tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 1284c: 60 91 7d 0e lds r22, 0x0E7D ; 0x800e7d 12850: 70 e0 ldi r23, 0x00 ; 0 12852: 83 e0 ldi r24, 0x03 ; 3 12854: 0f 94 ff 25 call 0x24bfe ; 0x24bfe #endif //TMC2130 reset_acceleration_rates(); 12858: 0f 94 9a 64 call 0x2c934 ; 0x2c934 // Call updatePID (similar to when we have processed M301) updatePID(); 1285c: 0f 94 d8 3b call 0x277b0 ; 0x277b0 } 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; 12860: ce 01 movw r24, r28 12862: 01 96 adiw r24, 0x01 ; 1 12864: 0f 94 9f 32 call 0x2653e ; 0x2653e // 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)); 12868: 44 e3 ldi r20, 0x34 ; 52 1286a: 50 e8 ldi r21, 0x80 ; 128 1286c: 67 eb ldi r22, 0xB7 ; 183 1286e: 7a eb ldi r23, 0xBA ; 186 12870: 82 ea ldi r24, 0xA2 ; 162 12872: 9c e0 ldi r25, 0x0C ; 12 12874: 0e 94 a7 63 call 0xc74e ; 0xc74e eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12878: 46 e6 ldi r20, 0x66 ; 102 1287a: 56 e6 ldi r21, 0x66 ; 102 1287c: 66 e8 ldi r22, 0x86 ; 134 1287e: 7f e3 ldi r23, 0x3F ; 63 12880: 8e e9 ldi r24, 0x9E ; 158 12882: 9c e0 ldi r25, 0x0C ; 12 12884: 0e 94 a7 63 call 0xc74e ; 0xc74e eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 12888: 4a e9 ldi r20, 0x9A ; 154 1288a: 59 e9 ldi r21, 0x99 ; 153 1288c: 69 e1 ldi r22, 0x19 ; 25 1288e: 7e e3 ldi r23, 0x3E ; 62 12890: 8a e9 ldi r24, 0x9A ; 154 12892: 9c e0 ldi r25, 0x0C ; 12 12894: 0e 94 a7 63 call 0xc74e ; 0xc74e eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 12898: 6e e0 ldi r22, 0x0E ; 14 1289a: 71 e0 ldi r23, 0x01 ; 1 1289c: 88 e9 ldi r24, 0x98 ; 152 1289e: 9c e0 ldi r25, 0x0C ; 12 128a0: 0e 94 71 75 call 0xeae2 ; 0xeae2 eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 128a4: 61 e0 ldi r22, 0x01 ; 1 128a6: 87 e9 ldi r24, 0x97 ; 151 128a8: 9c e0 ldi r25, 0x0C ; 12 128aa: 0e 94 89 75 call 0xeb12 ; 0xeb12 thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 128ae: 82 e0 ldi r24, 0x02 ; 2 128b0: 9d e0 ldi r25, 0x0D ; 13 128b2: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 128b6: 91 e0 ldi r25, 0x01 ; 1 128b8: 81 11 cpse r24, r1 128ba: 01 c0 rjmp .+2 ; 0x128be 128bc: 90 e0 ldi r25, 0x00 ; 0 128be: 90 93 1d 05 sts 0x051D, r25 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> thermal_model::data.P = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_P); 128c2: 8e ef ldi r24, 0xFE ; 254 128c4: 9c e0 ldi r25, 0x0C ; 12 128c6: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 128ca: 60 93 da 12 sts 0x12DA, r22 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.402+0x2a> 128ce: 70 93 db 12 sts 0x12DB, r23 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.402+0x2b> 128d2: 80 93 dc 12 sts 0x12DC, r24 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.402+0x2c> 128d6: 90 93 dd 12 sts 0x12DD, r25 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.402+0x2d> thermal_model::data.U = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_U); 128da: 82 ea ldi r24, 0xA2 ; 162 128dc: 9c e0 ldi r25, 0x0C ; 12 128de: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 128e2: 60 93 de 12 sts 0x12DE, r22 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.402+0x2e> 128e6: 70 93 df 12 sts 0x12DF, r23 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.402+0x2f> 128ea: 80 93 e0 12 sts 0x12E0, r24 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x30> 128ee: 90 93 e1 12 sts 0x12E1, r25 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x31> thermal_model::data.V = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_V); 128f2: 8e e9 ldi r24, 0x9E ; 158 128f4: 9c e0 ldi r25, 0x0C ; 12 128f6: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 128fa: 60 93 e2 12 sts 0x12E2, r22 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x32> 128fe: 70 93 e3 12 sts 0x12E3, r23 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x33> 12902: 80 93 e4 12 sts 0x12E4, r24 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x34> 12906: 90 93 e5 12 sts 0x12E5, r25 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x35> thermal_model::data.C = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_C); 1290a: 8a ef ldi r24, 0xFA ; 250 1290c: 9c e0 ldi r25, 0x0C ; 12 1290e: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 12912: 60 93 e6 12 sts 0x12E6, r22 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 12916: 70 93 e7 12 sts 0x12E7, r23 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 1291a: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 1291e: 90 93 e9 12 sts 0x12E9, r25 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> thermal_model::data.fS = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_D); 12922: 8a e9 ldi r24, 0x9A ; 154 12924: 9c e0 ldi r25, 0x0C ; 12 12926: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 1292a: 60 93 ea 12 sts 0x12EA, r22 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.402+0x3a> 1292e: 70 93 eb 12 sts 0x12EB, r23 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.402+0x3b> 12932: 80 93 ec 12 sts 0x12EC, r24 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.402+0x3c> 12936: 90 93 ed 12 sts 0x12ED, r25 ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.402+0x3d> thermal_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_THERMAL_MODEL_L)); 1293a: 88 e9 ldi r24, 0x98 ; 152 1293c: 9c e0 ldi r25, 0x0C ; 12 1293e: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 12942: 0f 94 87 2f call 0x25f0e ; 0x25f0e eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12946: 40 e4 ldi r20, 0x40 ; 64 12948: 50 e0 ldi r21, 0x00 ; 0 1294a: 6a eb ldi r22, 0xBA ; 186 1294c: 7c e0 ldi r23, 0x0C ; 12 1294e: 80 ef ldi r24, 0xF0 ; 240 12950: 92 e1 ldi r25, 0x12 ; 18 12952: 0f 94 44 dc call 0x3b888 ; 0x3b888 thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12956: 86 eb ldi r24, 0xB6 ; 182 12958: 9c e0 ldi r25, 0x0C ; 12 1295a: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 1295e: 60 93 30 13 sts 0x1330, r22 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.402+0x80> 12962: 70 93 31 13 sts 0x1331, r23 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.402+0x81> 12966: 80 93 32 13 sts 0x1332, r24 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.402+0x82> 1296a: 90 93 33 13 sts 0x1333, r25 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.402+0x83> thermal_model::data.warn = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_W); 1296e: 82 eb ldi r24, 0xB2 ; 178 12970: 9c e0 ldi r25, 0x0C ; 12 12972: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 12976: 60 93 34 13 sts 0x1334, r22 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 1297a: 70 93 35 13 sts 0x1335, r23 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 1297e: 80 93 36 13 sts 0x1336, r24 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 12982: 90 93 37 13 sts 0x1337, r25 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> thermal_model::data.err = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_E); 12986: 8e ea ldi r24, 0xAE ; 174 12988: 9c e0 ldi r25, 0x0C ; 12 1298a: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 1298e: 60 93 38 13 sts 0x1338, r22 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.402+0x88> 12992: 70 93 39 13 sts 0x1339, r23 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.402+0x89> 12996: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.402+0x8a> 1299a: 90 93 3b 13 sts 0x133B, r25 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.402+0x8b> if(!thermal_model::calibrated()) { 1299e: 0f 94 a6 2f call 0x25f4c ; 0x25f4c 129a2: 81 11 cpse r24, r1 129a4: 06 c0 rjmp .+12 ; 0x129b2 SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 129a6: 8d e0 ldi r24, 0x0D ; 13 129a8: 97 e7 ldi r25, 0x77 ; 119 129aa: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 thermal_model_reset_settings(); 129ae: 0f 94 ad 32 call 0x2655a ; 0x2655a } thermal_model::setup(); 129b2: 0f 94 0e 30 call 0x2601c ; 0x2601c } 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; 129b6: ce 01 movw r24, r28 129b8: 01 96 adiw r24, 0x01 ; 1 129ba: 0f 94 92 32 call 0x26524 ; 0x26524 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 129be: 82 ec ldi r24, 0xC2 ; 194 129c0: 9a ea ldi r25, 0xAA ; 170 129c2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM("Stored settings retrieved"); 129c6: 87 e3 ldi r24, 0x37 ; 55 129c8: 97 e7 ldi r25, 0x77 ; 119 129ca: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 129ce: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 129d0: 0f 90 pop r0 129d2: df 91 pop r29 129d4: cf 91 pop r28 129d6: 1f 91 pop r17 129d8: 0f 91 pop r16 129da: ff 90 pop r15 129dc: ef 90 pop r14 129de: bf 90 pop r11 129e0: af 90 pop r10 129e2: 9f 90 pop r9 129e4: 8f 90 pop r8 129e6: 7f 90 pop r7 129e8: 6f 90 pop r6 129ea: 5f 90 pop r5 129ec: 4f 90 pop r4 129ee: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 129f0: 0e 94 0c 82 call 0x10418 ; 0x10418 //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))) { 129f4: 64 e0 ldi r22, 0x04 ; 4 129f6: 70 e0 ldi r23, 0x00 ; 0 129f8: 84 e1 ldi r24, 0x14 ; 20 129fa: 90 e0 ldi r25, 0x00 ; 0 129fc: 0e 94 3b 5b call 0xb676 ; 0xb676 12a00: 91 e0 ldi r25, 0x01 ; 1 12a02: 89 27 eor r24, r25 12a04: e5 cf rjmp .-54 ; 0x129d0 00012a06 : 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() 12a06: 2f 92 push r2 12a08: 3f 92 push r3 12a0a: 4f 92 push r4 12a0c: 5f 92 push r5 12a0e: 6f 92 push r6 12a10: 7f 92 push r7 12a12: 8f 92 push r8 12a14: 9f 92 push r9 12a16: af 92 push r10 12a18: bf 92 push r11 12a1a: cf 92 push r12 12a1c: df 92 push r13 12a1e: ef 92 push r14 12a20: ff 92 push r15 12a22: 0f 93 push r16 12a24: 1f 93 push r17 12a26: cf 93 push r28 12a28: df 93 push r29 12a2a: cd b7 in r28, 0x3d ; 61 12a2c: de b7 in r29, 0x3e ; 62 12a2e: cf 58 subi r28, 0x8F ; 143 12a30: d1 09 sbc r29, r1 12a32: 0f b6 in r0, 0x3f ; 63 12a34: f8 94 cli 12a36: de bf out 0x3e, r29 ; 62 12a38: 0f be out 0x3f, r0 ; 63 12a3a: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12a3c: 82 e0 ldi r24, 0x02 ; 2 12a3e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be - 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) 12a42: a0 90 92 12 lds r10, 0x1292 ; 0x801292 12a46: b0 90 93 12 lds r11, 0x1293 ; 0x801293 12a4a: 85 01 movw r16, r10 12a4c: 08 55 subi r16, 0x58 ; 88 12a4e: 1f 4e sbci r17, 0xEF ; 239 12a50: 46 e0 ldi r20, 0x06 ; 6 12a52: 50 e0 ldi r21, 0x00 ; 0 12a54: 6f e0 ldi r22, 0x0F ; 15 12a56: 78 e8 ldi r23, 0x88 ; 136 12a58: c8 01 movw r24, r16 12a5a: 0f 94 33 da call 0x3b466 ; 0x3b466 12a5e: 89 2b or r24, r25 12a60: 09 f0 breq .+2 ; 0x12a64 12a62: b8 c0 rjmp .+368 ; 0x12bd4 { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12a64: 80 e0 ldi r24, 0x00 ; 0 12a66: 98 e8 ldi r25, 0x88 ; 136 12a68: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12a6c: 88 23 and r24, r24 12a6e: 09 f4 brne .+2 ; 0x12a72 12a70: 91 c0 rjmp .+290 ; 0x12b94 { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12a72: 88 e5 ldi r24, 0x58 ; 88 12a74: 0e 94 56 5b call 0xb6ac ; 0xb6ac 12a78: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12a7a: 89 e5 ldi r24, 0x59 ; 89 12a7c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 12a80: 81 11 cpse r24, r1 12a82: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12a84: 0f 94 ed 43 call 0x287da ; 0x287da static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12a88: 1a 82 std Y+2, r1 ; 0x02 12a8a: 19 82 std Y+1, r1 ; 0x01 12a8c: fe 01 movw r30, r28 12a8e: 33 96 adiw r30, 0x03 ; 3 12a90: 83 e1 ldi r24, 0x13 ; 19 12a92: df 01 movw r26, r30 12a94: 1d 92 st X+, r1 12a96: 8a 95 dec r24 12a98: e9 f7 brne .-6 ; 0x12a94 if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12a9a: 48 ec ldi r20, 0xC8 ; 200 12a9c: 5f ea ldi r21, 0xAF ; 175 12a9e: 60 e0 ldi r22, 0x00 ; 0 12aa0: 70 e0 ldi r23, 0x00 ; 0 12aa2: 85 e7 ldi r24, 0x75 ; 117 12aa4: 93 e0 ldi r25, 0x03 ; 3 12aa6: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 12aaa: 81 11 cpse r24, r1 crashDet_counter = 0; 12aac: 10 92 74 03 sts 0x0374, r1 ; 0x800374 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 12ab0: 00 91 74 03 lds r16, 0x0374 ; 0x800374 12ab4: 0f 5f subi r16, 0xFF ; 255 12ab6: 00 93 74 03 sts 0x0374, r16 ; 0x800374 automatic_recovery_after_crash = false; } crashDetTimer.start(); 12aba: 85 e7 ldi r24, 0x75 ; 117 12abc: 93 e0 ldi r25, 0x03 ; 3 12abe: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> crashDet_axes |= mask; 12ac2: 80 91 73 03 lds r24, 0x0373 ; 0x800373 12ac6: 81 2b or r24, r17 12ac8: 80 93 73 03 sts 0x0373, r24 ; 0x800373 if (mask & X_AXIS_MASK) { 12acc: 10 ff sbrs r17, 0 12ace: 08 c0 rjmp .+16 ; 0x12ae0 eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 12ad0: 86 e6 ldi r24, 0x66 ; 102 12ad2: 9f e0 ldi r25, 0x0F ; 15 12ad4: 0e 94 a8 75 call 0xeb50 ; 0xeb50 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 12ad8: 85 e0 ldi r24, 0x05 ; 5 12ada: 9f e0 ldi r25, 0x0F ; 15 12adc: 0e 94 9b 75 call 0xeb36 ; 0xeb36 } if (mask & Y_AXIS_MASK) { 12ae0: 11 ff sbrs r17, 1 12ae2: 08 c0 rjmp .+16 ; 0x12af4 eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 12ae4: 88 e6 ldi r24, 0x68 ; 104 12ae6: 9f e0 ldi r25, 0x0F ; 15 12ae8: 0e 94 a8 75 call 0xeb50 ; 0xeb50 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 12aec: 83 e0 ldi r24, 0x03 ; 3 12aee: 9f e0 ldi r25, 0x0F ; 15 12af0: 0e 94 9b 75 call 0xeb36 ; 0xeb36 } lcd_update_enable(true); 12af4: 81 e0 ldi r24, 0x01 ; 1 12af6: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_update(2); 12afa: 82 e0 ldi r24, 0x02 ; 2 12afc: 0e 94 27 6e call 0xdc4e ; 0xdc4e // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 12b00: 61 2f mov r22, r17 12b02: ce 01 movw r24, r28 12b04: 01 96 adiw r24, 0x01 ; 1 12b06: 0e 94 89 73 call 0xe712 ; 0xe712 lcd_setstatus(msg); 12b0a: ce 01 movw r24, r28 12b0c: 01 96 adiw r24, 0x01 ; 1 12b0e: 0e 94 67 f5 call 0x1eace ; 0x1eace gcode_G28(true, true, false); //home X and Y 12b12: 40 e0 ldi r20, 0x00 ; 0 12b14: 61 e0 ldi r22, 0x01 ; 1 12b16: 81 e0 ldi r24, 0x01 ; 1 12b18: 0e 94 85 7e call 0xfd0a ; 0xfd0a if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 12b1c: 61 e0 ldi r22, 0x01 ; 1 12b1e: 84 e9 ldi r24, 0x94 ; 148 12b20: 94 e8 ldi r25, 0x84 ; 132 crashdet_fmt_error(msg, mask); lcd_setstatus(msg); gcode_G28(true, true, false); //home X and Y if (automatic_recovery_after_crash) { 12b22: 03 30 cpi r16, 0x03 ; 3 12b24: 60 f1 brcs .+88 ; 0x12b7e 12b26: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 12b2a: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 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); 12b2e: 80 e0 ldi r24, 0x00 ; 0 12b30: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_clear(); 12b34: 0e 94 93 6e call 0xdd26 ; 0xdd26 crashdet_fmt_error(msg, crashDet_axes); 12b38: 60 91 73 03 lds r22, 0x0373 ; 0x800373 12b3c: ce 01 movw r24, r28 12b3e: 01 96 adiw r24, 0x01 ; 1 12b40: 0e 94 89 73 call 0xe712 ; 0xe712 crashDet_axes = 0; 12b44: 10 92 73 03 sts 0x0373, r1 ; 0x800373 lcd_print(msg); 12b48: ce 01 movw r24, r28 12b4a: 01 96 adiw r24, 0x01 ; 1 12b4c: 0e 94 67 70 call 0xe0ce ; 0xe0ce // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 12b50: 84 ea ldi r24, 0xA4 ; 164 12b52: 96 e4 ldi r25, 0x46 ; 70 12b54: 0e 94 2c 72 call 0xe458 ; 0xe458 12b58: ac 01 movw r20, r24 12b5a: 61 e0 ldi r22, 0x01 ; 1 12b5c: 80 e0 ldi r24, 0x00 ; 0 12b5e: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_putc('?'); 12b62: 8f e3 ldi r24, 0x3F ; 63 12b64: 0e 94 4f 6e call 0xdc9e ; 0xdc9e //! @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); 12b68: 40 e0 ldi r20, 0x00 ; 0 12b6a: 60 e0 ldi r22, 0x00 ; 0 12b6c: 90 e0 ldi r25, 0x00 ; 0 12b6e: 80 e0 ldi r24, 0x00 ; 0 12b70: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc 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")); 12b74: 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) 12b76: 81 11 cpse r24, r1 12b78: 0a c0 rjmp .+20 ; 0x12b8e { enquecommand_P(PSTR("CRASH_RECOVER")); 12b7a: 86 e8 ldi r24, 0x86 ; 134 12b7c: 94 e8 ldi r25, 0x84 ; 132 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12b7e: 0e 94 a0 87 call 0x10f40 ; 0x10f40 SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 12b82: 81 e0 ldi r24, 0x01 ; 1 12b84: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be ClearToSend(); 12b88: 0e 94 aa 7e call 0xfd54 ; 0xfd54 12b8c: 5e c3 rjmp .+1724 ; 0x1324a { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12b8e: 89 e7 ldi r24, 0x79 ; 121 12b90: 94 e8 ldi r25, 0x84 ; 132 12b92: f5 cf rjmp .-22 ; 0x12b7e crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 12b94: 82 ef ldi r24, 0xF2 ; 242 12b96: 97 e8 ldi r25, 0x87 ; 135 12b98: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12b9c: 88 23 and r24, r24 12b9e: 69 f0 breq .+26 ; 0x12bba } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 12ba0: 0e 94 05 67 call 0xce0a ; 0xce0a 12ba4: 81 11 cpse r24, r1 12ba6: 06 c0 rjmp .+12 ; 0x12bb4 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 12ba8: 60 e0 ldi r22, 0x00 ; 0 12baa: 70 e0 ldi r23, 0x00 ; 0 12bac: 80 e8 ldi r24, 0x80 ; 128 12bae: 9f e3 ldi r25, 0x3F ; 63 12bb0: 0e 94 c4 67 call 0xcf88 ; 0xcf88 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 12bb4: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 12bb8: e4 cf rjmp .-56 ; 0x12b82 else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 12bba: 85 ee ldi r24, 0xE5 ; 229 12bbc: 97 e8 ldi r25, 0x87 ; 135 12bbe: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12bc2: 88 23 and r24, r24 12bc4: f1 f2 breq .-68 ; 0x12b82 } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 12bc6: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 // Abort the print print_stop(); 12bca: 60 e0 ldi r22, 0x00 ; 0 12bcc: 80 e0 ldi r24, 0x00 ; 0 12bce: 0e 94 78 f5 call 0x1eaf0 ; 0x1eaf0 12bd2: d7 cf rjmp .-82 ; 0x12b82 // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 12bd4: 44 e0 ldi r20, 0x04 ; 4 12bd6: 50 e0 ldi r21, 0x00 ; 0 12bd8: 60 ee ldi r22, 0xE0 ; 224 12bda: 77 e8 ldi r23, 0x87 ; 135 12bdc: c8 01 movw r24, r16 12bde: 0f 94 33 da call 0x3b466 ; 0x3b466 12be2: 89 2b or r24, r25 12be4: 09 f0 breq .+2 ; 0x12be8 12be6: fc c0 rjmp .+504 ; 0x12de0 { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 12be8: 85 01 movw r16, r10 12bea: 04 55 subi r16, 0x54 ; 84 12bec: 1f 4e sbci r17, 0xEF ; 239 12bee: 49 e0 ldi r20, 0x09 ; 9 12bf0: 50 e0 ldi r21, 0x00 ; 0 12bf2: 66 ed ldi r22, 0xD6 ; 214 12bf4: 77 e8 ldi r23, 0x87 ; 135 12bf6: c8 01 movw r24, r16 12bf8: 0f 94 33 da call 0x3b466 ; 0x3b466 12bfc: 89 2b or r24, r25 12bfe: c9 f4 brne .+50 ; 0x12c32 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12c00: f5 01 movw r30, r10 12c02: eb 54 subi r30, 0x4B ; 75 12c04: ff 4e sbci r31, 0xEF ; 239 12c06: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 12c08: 15 34 cpi r17, 0x45 ; 69 12c0a: 89 f0 breq .+34 ; 0x12c2e 12c0c: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 12c0e: 14 30 cpi r17, 0x04 ; 4 12c10: 08 f0 brcs .+2 ; 0x12c14 12c12: b7 cf rjmp .-146 ; 0x12b82 { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 12c14: 4a e0 ldi r20, 0x0A ; 10 12c16: 50 e0 ldi r21, 0x00 ; 0 12c18: 70 e0 ldi r23, 0x00 ; 0 12c1a: 60 e0 ldi r22, 0x00 ; 0 12c1c: c5 01 movw r24, r10 12c1e: 8a 54 subi r24, 0x4A ; 74 12c20: 9f 4e sbci r25, 0xEF ; 239 12c22: 0f 94 df d7 call 0x3afbe ; 0x3afbe tmc2130_set_wave(axis, 247, fac); 12c26: 81 2f mov r24, r17 12c28: 0f 94 c4 88 call 0x31188 ; 0x31188 12c2c: aa cf rjmp .-172 ; 0x12b82 // ### 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'); 12c2e: 13 e0 ldi r17, 0x03 ; 3 12c30: f1 cf rjmp .-30 ; 0x12c14 } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 12c32: 49 e0 ldi r20, 0x09 ; 9 12c34: 50 e0 ldi r21, 0x00 ; 0 12c36: 6c ec ldi r22, 0xCC ; 204 12c38: 77 e8 ldi r23, 0x87 ; 135 12c3a: c8 01 movw r24, r16 12c3c: 0f 94 33 da call 0x3b466 ; 0x3b466 12c40: 89 2b or r24, r25 12c42: 51 f5 brne .+84 ; 0x12c98 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12c44: f5 01 movw r30, r10 12c46: eb 54 subi r30, 0x4B ; 75 12c48: ff 4e sbci r31, 0xEF ; 239 12c4a: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 12c4c: 15 34 cpi r17, 0x45 ; 69 12c4e: 11 f1 breq .+68 ; 0x12c94 12c50: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 12c52: 14 30 cpi r17, 0x04 ; 4 12c54: 08 f0 brcs .+2 ; 0x12c58 12c56: 95 cf rjmp .-214 ; 0x12b82 { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 12c58: 4a e0 ldi r20, 0x0A ; 10 12c5a: 50 e0 ldi r21, 0x00 ; 0 12c5c: 70 e0 ldi r23, 0x00 ; 0 12c5e: 60 e0 ldi r22, 0x00 ; 0 12c60: c5 01 movw r24, r10 12c62: 8a 54 subi r24, 0x4A ; 74 12c64: 9f 4e sbci r25, 0xEF ; 239 12c66: 0f 94 df d7 call 0x3afbe ; 0x3afbe 12c6a: e1 2f mov r30, r17 12c6c: f0 e0 ldi r31, 0x00 ; 0 12c6e: eb 50 subi r30, 0x0B ; 11 12c70: fb 4f sbci r31, 0xFB ; 251 12c72: 80 81 ld r24, Z 12c74: 40 e0 ldi r20, 0x00 ; 0 12c76: 51 e0 ldi r21, 0x01 ; 1 12c78: 02 c0 rjmp .+4 ; 0x12c7e 12c7a: 56 95 lsr r21 12c7c: 47 95 ror r20 12c7e: 8a 95 dec r24 12c80: e2 f7 brpl .-8 ; 0x12c7a uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 12c82: 84 2f mov r24, r20 12c84: 88 0f add r24, r24 12c86: 88 0f add r24, r24 12c88: 81 50 subi r24, 0x01 ; 1 12c8a: 68 23 and r22, r24 12c8c: 81 2f mov r24, r17 12c8e: 0f 94 db 8b call 0x317b6 ; 0x317b6 12c92: 77 cf rjmp .-274 ; 0x12b82 // ### 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'); 12c94: 13 e0 ldi r17, 0x03 ; 3 12c96: e0 cf rjmp .-64 ; 0x12c58 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 12c98: 49 e0 ldi r20, 0x09 ; 9 12c9a: 50 e0 ldi r21, 0x00 ; 0 12c9c: 62 ec ldi r22, 0xC2 ; 194 12c9e: 77 e8 ldi r23, 0x87 ; 135 12ca0: c8 01 movw r24, r16 12ca2: 0f 94 33 da call 0x3b466 ; 0x3b466 12ca6: 89 2b or r24, r25 12ca8: 09 f0 breq .+2 ; 0x12cac 12caa: 6b cf rjmp .-298 ; 0x12b82 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12cac: f5 01 movw r30, r10 12cae: eb 54 subi r30, 0x4B ; 75 12cb0: ff 4e sbci r31, 0xEF ; 239 12cb2: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 12cb4: 85 34 cpi r24, 0x45 ; 69 12cb6: 09 f4 brne .+2 ; 0x12cba 12cb8: 90 c0 rjmp .+288 ; 0x12dda 12cba: 98 ea ldi r25, 0xA8 ; 168 12cbc: c9 2e mov r12, r25 12cbe: c8 0e add r12, r24 if (axis < 4) 12cc0: b3 e0 ldi r27, 0x03 ; 3 12cc2: bc 15 cp r27, r12 12cc4: 08 f4 brcc .+2 ; 0x12cc8 12cc6: 5d cf rjmp .-326 ; 0x12b82 { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 12cc8: ec 2c mov r14, r12 12cca: f1 2c mov r15, r1 12ccc: 47 01 movw r8, r14 12cce: 88 0c add r8, r8 12cd0: 99 1c adc r9, r9 12cd2: f4 01 movw r30, r8 12cd4: eb 55 subi r30, 0x5B ; 91 12cd6: fd 4f sbci r31, 0xFD ; 253 12cd8: 00 81 ld r16, Z 12cda: 20 2f mov r18, r16 12cdc: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 12cde: 10 2f mov r17, r16 12ce0: 12 95 swap r17 12ce2: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 12ce4: 00 1f adc r16, r16 12ce6: 00 27 eor r16, r16 12ce8: 00 1f adc r16, r16 12cea: 61 81 ldd r22, Z+1 ; 0x01 12cec: 67 70 andi r22, 0x07 ; 7 12cee: 66 0f add r22, r22 12cf0: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 12cf2: f4 01 movw r30, r8 12cf4: ea 55 subi r30, 0x5A ; 90 12cf6: fd 4f sbci r31, 0xFD ; 253 12cf8: d0 80 ld r13, Z 12cfa: d6 94 lsr r13 12cfc: d6 94 lsr r13 12cfe: d6 94 lsr r13 12d00: ed 2d mov r30, r13 12d02: e3 70 andi r30, 0x03 ; 3 12d04: de 2e mov r13, r30 char* str_end = 0; 12d06: 1a 82 std Y+2, r1 ; 0x02 12d08: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 12d0a: c5 01 movw r24, r10 12d0c: 8a 54 subi r24, 0x4A ; 74 12d0e: 9f 4e sbci r25, 0xEF ; 239 12d10: dc 01 movw r26, r24 12d12: 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; 12d14: 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]) 12d16: 33 23 and r19, r19 12d18: e1 f1 breq .+120 ; 0x12d92 { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 12d1a: 4a e0 ldi r20, 0x0A ; 10 12d1c: 50 e0 ldi r21, 0x00 ; 0 12d1e: be 01 movw r22, r28 12d20: 6f 5f subi r22, 0xFF ; 255 12d22: 7f 4f sbci r23, 0xFF ; 255 12d24: 0f 94 df d7 call 0x3afbe ; 0x3afbe 12d28: 6f 70 andi r22, 0x0F ; 15 12d2a: b6 2e mov r11, r22 if (str_end && *str_end) 12d2c: 89 81 ldd r24, Y+1 ; 0x01 12d2e: 9a 81 ldd r25, Y+2 ; 0x02 12d30: 00 97 sbiw r24, 0x00 ; 0 12d32: 79 f1 breq .+94 ; 0x12d92 12d34: fc 01 movw r30, r24 12d36: 20 81 ld r18, Z 12d38: 22 23 and r18, r18 12d3a: 59 f1 breq .+86 ; 0x12d92 { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 12d3c: 4a e0 ldi r20, 0x0A ; 10 12d3e: 50 e0 ldi r21, 0x00 ; 0 12d40: be 01 movw r22, r28 12d42: 6f 5f subi r22, 0xFF ; 255 12d44: 7f 4f sbci r23, 0xFF ; 255 12d46: 0f 94 df d7 call 0x3afbe ; 0x3afbe 12d4a: 16 2f mov r17, r22 12d4c: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 12d4e: 89 81 ldd r24, Y+1 ; 0x01 12d50: 9a 81 ldd r25, Y+2 ; 0x02 12d52: 00 97 sbiw r24, 0x00 ; 0 12d54: f1 f0 breq .+60 ; 0x12d92 12d56: dc 01 movw r26, r24 12d58: 2c 91 ld r18, X 12d5a: 22 23 and r18, r18 12d5c: d1 f0 breq .+52 ; 0x12d92 { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 12d5e: 4a e0 ldi r20, 0x0A ; 10 12d60: 50 e0 ldi r21, 0x00 ; 0 12d62: be 01 movw r22, r28 12d64: 6f 5f subi r22, 0xFF ; 255 12d66: 7f 4f sbci r23, 0xFF ; 255 12d68: 0f 94 df d7 call 0x3afbe ; 0x3afbe 12d6c: 06 2f mov r16, r22 12d6e: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 12d70: 89 81 ldd r24, Y+1 ; 0x01 12d72: 9a 81 ldd r25, Y+2 ; 0x02 12d74: 00 97 sbiw r24, 0x00 ; 0 12d76: 69 f0 breq .+26 ; 0x12d92 12d78: fc 01 movw r30, r24 12d7a: 20 81 ld r18, Z 12d7c: 22 23 and r18, r18 12d7e: 49 f0 breq .+18 ; 0x12d92 chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 12d80: 4a e0 ldi r20, 0x0A ; 10 12d82: 50 e0 ldi r21, 0x00 ; 0 12d84: be 01 movw r22, r28 12d86: 6f 5f subi r22, 0xFF ; 255 12d88: 7f 4f sbci r23, 0xFF ; 255 12d8a: 0f 94 df d7 call 0x3afbe ; 0x3afbe 12d8e: 63 70 andi r22, 0x03 ; 3 12d90: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 12d92: f4 01 movw r30, r8 12d94: eb 55 subi r30, 0x5B ; 91 12d96: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 12d98: 17 70 andi r17, 0x07 ; 7 12d9a: 12 95 swap r17 12d9c: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 12d9e: 60 2f mov r22, r16 12da0: 67 95 ror r22 12da2: 66 27 eor r22, r22 12da4: 67 95 ror r22 12da6: 1b 29 or r17, r11 12da8: 16 2b or r17, r22 12daa: 10 83 st Z, r17 12dac: 60 2f mov r22, r16 12dae: 66 95 lsr r22 12db0: 01 81 ldd r16, Z+1 ; 0x01 12db2: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 12db4: 2d 2d mov r18, r13 12db6: 23 70 andi r18, 0x03 ; 3 12db8: d2 2e mov r13, r18 12dba: dd 0c add r13, r13 12dbc: dd 0c add r13, r13 12dbe: dd 0c add r13, r13 12dc0: 06 2b or r16, r22 12dc2: d0 2a or r13, r16 12dc4: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 12dc6: f7 01 movw r30, r14 12dc8: eb 50 subi r30, 0x0B ; 11 12dca: fb 4f sbci r31, 0xFB ; 251 12dcc: 50 e0 ldi r21, 0x00 ; 0 12dce: 40 e0 ldi r20, 0x00 ; 0 12dd0: 60 81 ld r22, Z 12dd2: 8c 2d mov r24, r12 12dd4: 0f 94 94 25 call 0x24b28 ; 0x24b28 12dd8: d4 ce rjmp .-600 ; 0x12b82 // ### 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'); 12dda: 03 e0 ldi r16, 0x03 ; 3 12ddc: c0 2e mov r12, r16 12dde: 74 cf rjmp .-280 ; 0x12cc8 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) { 12de0: 45 e0 ldi r20, 0x05 ; 5 12de2: 50 e0 ldi r21, 0x00 ; 0 12de4: 6c eb ldi r22, 0xBC ; 188 12de6: 77 e8 ldi r23, 0x87 ; 135 12de8: c8 01 movw r24, r16 12dea: 0f 94 33 da call 0x3b466 ; 0x3b466 12dee: 89 2b or r24, r25 12df0: 09 f0 breq .+2 ; 0x12df4 12df2: 64 c1 rjmp .+712 ; 0x130bc - `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"))) { 12df4: 82 eb ldi r24, 0xB2 ; 178 12df6: 97 e8 ldi r25, 0x87 ; 135 12df8: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12dfc: 88 23 and r24, r24 12dfe: 09 f4 brne .+2 ; 0x12e02 12e00: 3c c0 rjmp .+120 ; 0x12e7a //! 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 12e02: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f 12e06: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 12e08: c1 2c mov r12, r1 12e0a: d1 2c mov r13, r1 12e0c: 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); 12e0e: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 12e10: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 12e12: 64 e1 ldi r22, 0x14 ; 20 12e14: 70 e0 ldi r23, 0x00 ; 0 12e16: 80 e0 ldi r24, 0x00 ; 0 12e18: 90 e0 ldi r25, 0x00 ; 0 12e1a: 0f 94 58 28 call 0x250b0 ; 0x250b0 unsigned long tachMeasure = _micros(); 12e1e: 0f 94 32 28 call 0x25064 ; 0x25064 12e22: 4b 01 movw r8, r22 12e24: 5c 01 movw r10, r24 cli(); 12e26: f8 94 cli SET_INPUT(TACH_1); 12e28: 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 ) ; 12e2a: 67 9b sbis 0x0c, 7 ; 12 12e2c: fe cf rjmp .-4 ; 0x12e2a sei(); 12e2e: 78 94 sei tachMeasure = _micros() - tachMeasure; 12e30: 0f 94 32 28 call 0x25064 ; 0x25064 12e34: dc 01 movw r26, r24 12e36: cb 01 movw r24, r22 12e38: 88 19 sub r24, r8 12e3a: 99 09 sbc r25, r9 12e3c: aa 09 sbc r26, r10 12e3e: bb 09 sbc r27, r11 12e40: c8 16 cp r12, r24 12e42: d9 06 cpc r13, r25 12e44: ea 06 cpc r14, r26 12e46: fb 06 cpc r15, r27 12e48: 10 f4 brcc .+4 ; 0x12e4e 12e4a: 6c 01 movw r12, r24 12e4c: 7d 01 movw r14, r26 12e4e: 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){ 12e50: f1 f6 brne .-68 ; 0x12e0e 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 "); 12e52: 8e e6 ldi r24, 0x6E ; 110 12e54: 94 e8 ldi r25, 0x84 ; 132 12e56: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 12e5a: 8a e6 ldi r24, 0x6A ; 106 12e5c: 94 e8 ldi r25, 0x84 ; 132 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 ){ 12e5e: 35 ef ldi r19, 0xF5 ; 245 12e60: c3 16 cp r12, r19 12e62: 31 e0 ldi r19, 0x01 ; 1 12e64: d3 06 cpc r13, r19 12e66: e1 04 cpc r14, r1 12e68: f1 04 cpc r15, r1 12e6a: 10 f4 brcc .+4 ; 0x12e70 // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 12e6c: 87 e6 ldi r24, 0x67 ; 103 12e6e: 94 e8 ldi r25, 0x84 ; 132 12e70: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 } // cleanup after the test function SET_INPUT(TACH_1); 12e74: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 12e76: 77 9a sbi 0x0e, 7 ; 14 12e78: 84 ce rjmp .-760 ; 0x12b82 */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 12e7a: 8e ea ldi r24, 0xAE ; 174 12e7c: 97 e8 ldi r25, 0x87 ; 135 12e7e: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12e82: 88 23 and r24, r24 12e84: 21 f1 breq .+72 ; 0x12ece printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 12e86: 40 91 cb 03 lds r20, 0x03CB ; 0x8003cb 12e8a: 50 91 cc 03 lds r21, 0x03CC ; 0x8003cc 12e8e: 2c e3 ldi r18, 0x3C ; 60 12e90: 24 9f mul r18, r20 12e92: c0 01 movw r24, r0 12e94: 25 9f mul r18, r21 12e96: 90 0d add r25, r0 12e98: 11 24 eor r1, r1 12e9a: 9f 93 push r25 12e9c: 8f 93 push r24 12e9e: 40 91 c9 03 lds r20, 0x03C9 ; 0x8003c9 12ea2: 50 91 ca 03 lds r21, 0x03CA ; 0x8003ca 12ea6: 24 9f mul r18, r20 12ea8: c0 01 movw r24, r0 12eaa: 25 9f mul r18, r21 12eac: 90 0d add r25, r0 12eae: 11 24 eor r1, r1 12eb0: 9f 93 push r25 12eb2: 8f 93 push r24 12eb4: 84 e8 ldi r24, 0x84 ; 132 12eb6: 99 e6 ldi r25, 0x69 ; 105 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 12eb8: 9f 93 push r25 12eba: 8f 93 push r24 12ebc: 0f 94 16 db call 0x3b62c ; 0x3b62c 12ec0: 0f 90 pop r0 12ec2: 0f 90 pop r0 12ec4: 0f 90 pop r0 12ec6: 0f 90 pop r0 12ec8: 0f 90 pop r0 12eca: 0f 90 pop r0 12ecc: 5a ce rjmp .-844 ; 0x12b82 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 12ece: 89 ea ldi r24, 0xA9 ; 169 12ed0: 97 e8 ldi r25, 0x87 ; 135 12ed2: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12ed6: 88 23 and r24, r24 12ed8: 11 f1 breq .+68 ; 0x12f1e if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 12eda: 8c e8 ldi r24, 0x8C ; 140 12edc: 9f e0 ldi r25, 0x0F ; 15 12ede: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 12ee2: 81 11 cpse r24, r1 12ee4: 10 c0 rjmp .+32 ; 0x12f06 // M24 - Start SD print enquecommand_P(MSG_M24); 12ee6: 61 e0 ldi r22, 0x01 ; 1 12ee8: 8c e4 ldi r24, 0x4C ; 76 12eea: 90 e7 ldi r25, 0x70 ; 112 12eec: 0e 94 a0 87 call 0x10f40 ; 0x10f40 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 12ef0: 60 e0 ldi r22, 0x00 ; 0 12ef2: 85 ea ldi r24, 0xA5 ; 165 12ef4: 9f e0 ldi r25, 0x0F ; 15 12ef6: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 12efa: 60 e0 ldi r22, 0x00 ; 0 12efc: 8f e7 ldi r24, 0x7F ; 127 12efe: 9c e0 ldi r25, 0x0C ; 12 12f00: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 12f04: 3e ce rjmp .-900 ; 0x12b82 // 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) { 12f06: 81 30 cpi r24, 0x01 ; 1 12f08: 09 f0 breq .+2 ; 0x12f0c 12f0a: 3b ce rjmp .-906 ; 0x12b82 // 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(); 12f0c: 0f 94 92 43 call 0x28724 ; 0x28724 usb_timer.start(); 12f10: 8e e0 ldi r24, 0x0E ; 14 12f12: 95 e0 ldi r25, 0x05 ; 5 12f14: 0f 94 b2 2a call 0x25564 ; 0x25564 ::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(); 12f18: 0f 94 5d 2a call 0x254ba ; 0x254ba 12f1c: 32 ce rjmp .-924 ; 0x12b82 } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 12f1e: 82 ea ldi r24, 0xA2 ; 162 12f20: 97 e8 ldi r25, 0x87 ; 135 12f22: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12f26: 88 23 and r24, r24 12f28: 21 f0 breq .+8 ; 0x12f32 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 12f2a: 80 e0 ldi r24, 0x00 ; 0 12f2c: 0f 94 81 10 call 0x22102 ; 0x22102 12f30: 28 ce rjmp .-944 ; 0x12b82 MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 12f32: 8c e9 ldi r24, 0x9C ; 156 12f34: 97 e8 ldi r25, 0x87 ; 135 12f36: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12f3a: 88 23 and r24, r24 12f3c: 51 f0 breq .+20 ; 0x12f52 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 12f3e: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 12f42: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 12f46: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 12f4a: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7df> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 12f4e: 0e 94 cc 66 call 0xcd98 ; 0xcd98 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 12f52: 89 e9 ldi r24, 0x99 ; 153 12f54: 97 e8 ldi r25, 0x87 ; 135 12f56: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12f5a: 88 23 and r24, r24 12f5c: a9 f0 breq .+42 ; 0x12f88 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 12f5e: 44 e1 ldi r20, 0x14 ; 20 12f60: 50 e0 ldi r21, 0x00 ; 0 12f62: 65 e1 ldi r22, 0x15 ; 21 12f64: 7d e0 ldi r23, 0x0D ; 13 12f66: ce 01 movw r24, r28 12f68: 01 96 adiw r24, 0x01 ; 1 12f6a: 0f 94 44 dc call 0x3b888 ; 0x3b888 if (SN[19]) 12f6e: 8c 89 ldd r24, Y+20 ; 0x14 12f70: 88 23 and r24, r24 12f72: 29 f0 breq .+10 ; 0x12f7e puts_P(PSTR("SN invalid")); 12f74: 8e e8 ldi r24, 0x8E ; 142 12f76: 97 e8 ldi r25, 0x87 ; 135 12f78: 0f 94 3d db call 0x3b67a ; 0x3b67a 12f7c: 02 ce rjmp .-1020 ; 0x12b82 else puts(SN); 12f7e: ce 01 movw r24, r28 12f80: 01 96 adiw r24, 0x01 ; 1 12f82: 0f 94 e3 e2 call 0x3c5c6 ; 0x3c5c6 12f86: fd cd rjmp .-1030 ; 0x12b82 } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 12f88: 8a e8 ldi r24, 0x8A ; 138 12f8a: 97 e8 ldi r25, 0x87 ; 135 12f8c: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12f90: 88 23 and r24, r24 12f92: 29 f0 breq .+10 ; 0x12f9e SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 12f94: 8e e7 ldi r24, 0x7E ; 126 12f96: 97 e8 ldi r25, 0x87 ; 135 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 12f98: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 12f9c: f2 cd rjmp .-1052 ; 0x12b82 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 12f9e: 8a e7 ldi r24, 0x7A ; 122 12fa0: 97 e8 ldi r25, 0x87 ; 135 12fa2: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12fa6: 88 23 and r24, r24 12fa8: 19 f0 breq .+6 ; 0x12fb0 SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 12faa: 8d e5 ldi r24, 0x5D ; 93 12fac: 97 e8 ldi r25, 0x87 ; 135 12fae: f4 cf rjmp .-24 ; 0x12f98 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 12fb0: 88 e5 ldi r24, 0x58 ; 88 12fb2: 97 e8 ldi r25, 0x87 ; 135 12fb4: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12fb8: 88 23 and r24, r24 12fba: 19 f0 breq .+6 ; 0x12fc2 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 12fbc: 0e 94 ac 70 call 0xe158 ; 0xe158 12fc0: e0 cd rjmp .-1088 ; 0x12b82 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 12fc2: 85 e5 ldi r24, 0x55 ; 85 12fc4: 97 e8 ldi r25, 0x87 ; 135 12fc6: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12fca: 88 23 and r24, r24 12fcc: 79 f0 breq .+30 ; 0x12fec eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 12fce: 81 ea ldi r24, 0xA1 ; 161 12fd0: 9d e0 ldi r25, 0x0D ; 13 12fd2: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 12fd6: 4b e0 ldi r20, 0x0B ; 11 12fd8: 84 9f mul r24, r20 12fda: c0 01 movw r24, r0 12fdc: 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); 12fde: 70 e0 ldi r23, 0x00 ; 0 12fe0: 60 e0 ldi r22, 0x00 ; 0 12fe2: 80 5b subi r24, 0xB0 ; 176 12fe4: 92 4f sbci r25, 0xF2 ; 242 12fe6: 0f 94 96 dc call 0x3b92c ; 0x3b92c 12fea: cb cd rjmp .-1130 ; 0x12b82 } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 12fec: 82 e5 ldi r24, 0x52 ; 82 12fee: 97 e8 ldi r25, 0x87 ; 135 12ff0: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 12ff4: 88 23 and r24, r24 12ff6: 51 f0 breq .+20 ; 0x1300c // 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(); 12ff8: 0e 94 93 6e call 0xdd26 ; 0xdd26 Sound_MakeCustom(100,0,false); 12ffc: 40 e0 ldi r20, 0x00 ; 0 12ffe: 70 e0 ldi r23, 0x00 ; 0 13000: 60 e0 ldi r22, 0x00 ; 0 13002: 84 e6 ldi r24, 0x64 ; 100 13004: 90 e0 ldi r25, 0x00 ; 0 13006: 0f 94 81 52 call 0x2a502 ; 0x2a502 1300a: d8 cf rjmp .-80 ; 0x12fbc 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 1300c: 8e e4 ldi r24, 0x4E ; 78 1300e: 97 e8 ldi r25, 0x87 ; 135 13010: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 13014: 88 23 and r24, r24 13016: e1 f0 breq .+56 ; 0x13050 // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13018: 86 e5 ldi r24, 0x56 ; 86 1301a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1301e: 88 23 and r24, r24 13020: 09 f4 brne .+2 ; 0x13024 13022: af cd rjmp .-1186 ; 0x12b82 bool value = code_value_short(); 13024: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 13028: 11 e0 ldi r17, 0x01 ; 1 1302a: 89 2b or r24, r25 1302c: 09 f4 brne .+2 ; 0x13030 1302e: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 13030: 0f 94 ed 43 call 0x287da ; 0x287da if(value != mbl.active) { 13034: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 13038: 90 e0 ldi r25, 0x00 ; 0 1303a: 18 17 cp r17, r24 1303c: 19 06 cpc r1, r25 1303e: 09 f4 brne .+2 ; 0x13042 13040: a0 cd rjmp .-1216 ; 0x12b82 mbl.active = value; 13042: 10 93 c2 13 sts 0x13C2, r17 ; 0x8013c2 // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 13046: 8a e9 ldi r24, 0x9A ; 154 13048: 96 e0 ldi r25, 0x06 ; 6 1304a: 0f 94 2c 65 call 0x2ca58 ; 0x2ca58 1304e: 99 cd rjmp .-1230 ; 0x12b82 } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 13050: 87 e4 ldi r24, 0x47 ; 71 13052: 97 e8 ldi r25, 0x87 ; 135 13054: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 13058: 88 23 and r24, r24 1305a: 09 f4 brne .+2 ; 0x1305e 1305c: 92 cd rjmp .-1244 ; 0x12b82 uint16_t nDiameter; if(code_seen('D')) { 1305e: 84 e4 ldi r24, 0x44 ; 68 13060: 0e 94 56 5b call 0xb6ac ; 0xb6ac 13064: 88 23 and r24, r24 13066: a1 f0 breq .+40 ; 0x13090 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 13068: 0e 94 1d 60 call 0xc03a ; 0xc03a 1306c: 20 e0 ldi r18, 0x00 ; 0 1306e: 30 e0 ldi r19, 0x00 ; 0 13070: 4a e7 ldi r20, 0x7A ; 122 13072: 54 e4 ldi r21, 0x44 ; 68 13074: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13078: 20 e0 ldi r18, 0x00 ; 0 1307a: 30 e0 ldi r19, 0x00 ; 0 1307c: 40 e0 ldi r20, 0x00 ; 0 1307e: 5f e3 ldi r21, 0x3F ; 63 13080: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13084: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> nozzle_diameter_check(nDiameter); 13088: cb 01 movw r24, r22 1308a: 0e 94 0e f6 call 0x1ec1c ; 0x1ec1c 1308e: 79 cd rjmp .-1294 ; 0x12b82 } else if(code_seen_P(PSTR("set")) && farm_mode) { 13090: 83 e4 ldi r24, 0x43 ; 67 13092: 97 e8 ldi r25, 0x87 ; 135 13094: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 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); 13098: 85 ea ldi r24, 0xA5 ; 165 1309a: 9d e0 ldi r25, 0x0D ; 13 1309c: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 130a0: bc 01 movw r22, r24 130a2: 90 e0 ldi r25, 0x00 ; 0 130a4: 80 e0 ldi r24, 0x00 ; 0 130a6: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 130aa: 20 e0 ldi r18, 0x00 ; 0 130ac: 30 e0 ldi r19, 0x00 ; 0 130ae: 4a e7 ldi r20, 0x7A ; 122 130b0: 54 e4 ldi r21, 0x44 ; 68 130b2: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 130b6: 0f 94 ef 75 call 0x2ebde ; 0x2ebde 130ba: 63 cd rjmp .-1338 ; 0x12b82 } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 130bc: d8 01 movw r26, r16 130be: 8c 91 ld r24, X 130c0: 87 34 cpi r24, 0x47 ; 71 130c2: 11 f0 breq .+4 ; 0x130c8 130c4: 0c 94 f9 a3 jmp 0x147f2 ; 0x147f2 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 130c8: 10 93 96 03 sts 0x0396, r17 ; 0x800396 130cc: 00 93 95 03 sts 0x0395, r16 ; 0x800395 gcode_in_progress = code_value_short(); 130d0: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 130d4: 90 93 94 03 sts 0x0394, r25 ; 0x800394 130d8: 80 93 93 03 sts 0x0393, r24 ; 0x800393 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 130dc: 8e 31 cpi r24, 0x1E ; 30 130de: 91 05 cpc r25, r1 130e0: 09 f4 brne .+2 ; 0x130e4 130e2: da c6 rjmp .+3508 ; 0x13e98 130e4: 0c f0 brlt .+2 ; 0x130e8 130e6: 45 c1 rjmp .+650 ; 0x13372 130e8: 84 30 cpi r24, 0x04 ; 4 130ea: 91 05 cpc r25, r1 130ec: 09 f4 brne .+2 ; 0x130f0 130ee: 7e c6 rjmp .+3324 ; 0x13dec 130f0: 0c f0 brlt .+2 ; 0x130f4 130f2: c5 c0 rjmp .+394 ; 0x1327e 130f4: 97 fd sbrc r25, 7 130f6: cb c0 rjmp .+406 ; 0x1328e 130f8: 02 97 sbiw r24, 0x02 ; 2 130fa: 0c f0 brlt .+2 ; 0x130fe 130fc: fc c1 rjmp .+1016 ; 0x134f6 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 130fe: 0e 94 f3 59 call 0xb3e6 ; 0xb3e6 13102: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 13104: 0e 94 44 61 call 0xc288 ; 0xc288 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 13108: 60 91 65 06 lds r22, 0x0665 ; 0x800665 1310c: 70 91 66 06 lds r23, 0x0666 ; 0x800666 13110: 80 91 67 06 lds r24, 0x0667 ; 0x800667 13114: 90 91 68 06 lds r25, 0x0668 ; 0x800668 13118: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 1311c: 6b 01 movw r12, r22 1311e: 7c 01 movw r14, r24 13120: 40 90 9e 06 lds r4, 0x069E ; 0x80069e 13124: 50 90 9f 06 lds r5, 0x069F ; 0x80069f 13128: 60 90 a0 06 lds r6, 0x06A0 ; 0x8006a0 1312c: 70 90 a1 06 lds r7, 0x06A1 ; 0x8006a1 13130: 80 90 80 06 lds r8, 0x0680 ; 0x800680 13134: 90 90 81 06 lds r9, 0x0681 ; 0x800681 13138: a0 90 82 06 lds r10, 0x0682 ; 0x800682 1313c: b0 90 83 06 lds r11, 0x0683 ; 0x800683 13140: a5 01 movw r20, r10 13142: 94 01 movw r18, r8 13144: c3 01 movw r24, r6 13146: b2 01 movw r22, r4 13148: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1314c: 20 e0 ldi r18, 0x00 ; 0 1314e: 30 e0 ldi r19, 0x00 ; 0 13150: 48 ec ldi r20, 0xC8 ; 200 13152: 52 e4 ldi r21, 0x42 ; 66 13154: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13158: 9b 01 movw r18, r22 1315a: ac 01 movw r20, r24 1315c: c7 01 movw r24, r14 1315e: b6 01 movw r22, r12 13160: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 13164: 18 16 cp r1, r24 13166: d4 f4 brge .+52 ; 0x1319c total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 13168: a3 01 movw r20, r6 1316a: 92 01 movw r18, r4 1316c: c5 01 movw r24, r10 1316e: b4 01 movw r22, r8 13170: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 13174: 20 e0 ldi r18, 0x00 ; 0 13176: 30 e0 ldi r19, 0x00 ; 0 13178: 48 ec ldi r20, 0xC8 ; 200 1317a: 52 e4 ldi r21, 0x42 ; 66 1317c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13180: a7 01 movw r20, r14 13182: 96 01 movw r18, r12 13184: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13188: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 1318c: 60 93 65 06 sts 0x0665, r22 ; 0x800665 13190: 70 93 66 06 sts 0x0666, r23 ; 0x800666 13194: 80 93 67 06 sts 0x0667, r24 ; 0x800667 13198: 90 93 68 06 sts 0x0668, r25 ; 0x800668 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 1319c: 80 91 40 0e lds r24, 0x0E40 ; 0x800e40 131a0: 88 23 and r24, r24 131a2: 09 f4 brne .+2 ; 0x131a6 131a4: a4 c1 rjmp .+840 ; 0x134ee if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 131a6: 88 e5 ldi r24, 0x58 ; 88 131a8: 0e 94 56 5b call 0xb6ac ; 0xb6ac 131ac: 81 11 cpse r24, r1 131ae: 9f c1 rjmp .+830 ; 0x134ee 131b0: 89 e5 ldi r24, 0x59 ; 89 131b2: 0e 94 56 5b call 0xb6ac ; 0xb6ac 131b6: 81 11 cpse r24, r1 131b8: 9a c1 rjmp .+820 ; 0x134ee 131ba: 8a e5 ldi r24, 0x5A ; 90 131bc: 0e 94 56 5b call 0xb6ac ; 0xb6ac 131c0: 81 11 cpse r24, r1 131c2: 95 c1 rjmp .+810 ; 0x134ee 131c4: 85 e4 ldi r24, 0x45 ; 69 131c6: 0e 94 56 5b call 0xb6ac ; 0xb6ac 131ca: 88 23 and r24, r24 131cc: 09 f4 brne .+2 ; 0x131d0 131ce: 8f c1 rjmp .+798 ; 0x134ee float echange=destination[E_AXIS]-current_position[E_AXIS]; 131d0: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 131d4: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 131d8: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 131dc: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 131e0: 60 91 80 06 lds r22, 0x0680 ; 0x800680 131e4: 70 91 81 06 lds r23, 0x0681 ; 0x800681 131e8: 80 91 82 06 lds r24, 0x0682 ; 0x800682 131ec: 90 91 83 06 lds r25, 0x0683 ; 0x800683 131f0: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 131f4: 6b 01 movw r12, r22 131f6: 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 131f8: 2d ec ldi r18, 0xCD ; 205 131fa: 3c ec ldi r19, 0xCC ; 204 131fc: 4c ec ldi r20, 0xCC ; 204 131fe: 5d eb ldi r21, 0xBD ; 189 13200: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 13204: 87 ff sbrs r24, 7 13206: 65 c1 rjmp .+714 ; 0x134d2 13208: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 1320c: 81 11 cpse r24, r1 1320e: 0c 94 0d cd jmp 0x19a1a ; 0x19a1a st_synchronize(); 13212: 0f 94 ed 43 call 0x287da ; 0x287da current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13216: 80 91 80 06 lds r24, 0x0680 ; 0x800680 1321a: 90 91 81 06 lds r25, 0x0681 ; 0x800681 1321e: a0 91 82 06 lds r26, 0x0682 ; 0x800682 13222: b0 91 83 06 lds r27, 0x0683 ; 0x800683 13226: 80 93 9e 06 sts 0x069E, r24 ; 0x80069e 1322a: 90 93 9f 06 sts 0x069F, r25 ; 0x80069f 1322e: a0 93 a0 06 sts 0x06A0, r26 ; 0x8006a0 13232: b0 93 a1 06 sts 0x06A1, r27 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 13236: 8e e9 ldi r24, 0x9E ; 158 13238: 96 e0 ldi r25, 0x06 ; 6 1323a: 0f 94 f9 64 call 0x2c9f2 ; 0x2c9f2 retract(!retracted[active_extruder]); 1323e: 90 91 8e 06 lds r25, 0x068E ; 0x80068e 13242: 81 e0 ldi r24, 0x01 ; 1 13244: 89 27 eor r24, r25 13246: 0f 94 60 8a call 0x314c0 ; 0x314c0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 1324a: c1 57 subi r28, 0x71 ; 113 1324c: df 4f sbci r29, 0xFF ; 255 1324e: 0f b6 in r0, 0x3f ; 63 13250: f8 94 cli 13252: de bf out 0x3e, r29 ; 62 13254: 0f be out 0x3f, r0 ; 63 13256: cd bf out 0x3d, r28 ; 61 13258: df 91 pop r29 1325a: cf 91 pop r28 1325c: 1f 91 pop r17 1325e: 0f 91 pop r16 13260: ff 90 pop r15 13262: ef 90 pop r14 13264: df 90 pop r13 13266: cf 90 pop r12 13268: bf 90 pop r11 1326a: af 90 pop r10 1326c: 9f 90 pop r9 1326e: 8f 90 pop r8 13270: 7f 90 pop r7 13272: 6f 90 pop r6 13274: 5f 90 pop r5 13276: 4f 90 pop r4 13278: 3f 90 pop r3 1327a: 2f 90 pop r2 1327c: 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) 1327e: 8b 30 cpi r24, 0x0B ; 11 13280: 91 05 cpc r25, r1 13282: 09 f4 brne .+2 ; 0x13286 13284: 00 c6 rjmp .+3072 ; 0x13e86 13286: dc f4 brge .+54 ; 0x132be 13288: 0a 97 sbiw r24, 0x0a ; 10 1328a: 09 f4 brne .+2 ; 0x1328e 1328c: f8 c5 rjmp .+3056 ; 0x13e7e case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 1328e: 80 91 92 12 lds r24, 0x1292 ; 0x801292 13292: 90 91 93 12 lds r25, 0x1293 ; 0x801293 13296: 88 55 subi r24, 0x58 ; 88 13298: 9f 4e sbci r25, 0xEF ; 239 1329a: 9f 93 push r25 1329c: 8f 93 push r24 1329e: 1f 92 push r1 132a0: 87 e4 ldi r24, 0x47 ; 71 132a2: 8f 93 push r24 132a4: 86 ea ldi r24, 0xA6 ; 166 132a6: 98 e6 ldi r25, 0x68 ; 104 132a8: 9f 93 push r25 132aa: 8f 93 push r24 132ac: 0f 94 16 db call 0x3b62c ; 0x3b62c 132b0: 0f 90 pop r0 132b2: 0f 90 pop r0 132b4: 0f 90 pop r0 132b6: 0f 90 pop r0 132b8: 0f 90 pop r0 132ba: 0f 90 pop r0 132bc: a5 c0 rjmp .+330 ; 0x13408 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) 132be: 85 31 cpi r24, 0x15 ; 21 132c0: 91 05 cpc r25, r1 132c2: 09 f4 brne .+2 ; 0x132c6 132c4: a1 c0 rjmp .+322 ; 0x13408 132c6: 4c 97 sbiw r24, 0x1c ; 28 132c8: 11 f7 brne .-60 ; 0x1328e { 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]); 132ca: 88 e5 ldi r24, 0x58 ; 88 132cc: 0e 94 56 5b call 0xb6ac ; 0xb6ac 132d0: 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; 132d2: 41 2c mov r4, r1 132d4: 51 2c mov r5, r1 132d6: 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(); 132d8: 88 23 and r24, r24 132da: 21 f0 breq .+8 ; 0x132e4 132dc: 0e 94 02 5b call 0xb604 ; 0xb604 132e0: 2b 01 movw r4, r22 132e2: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 132e4: 89 e5 ldi r24, 0x59 ; 89 132e6: 0e 94 56 5b call 0xb6ac ; 0xb6ac 132ea: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 132ec: 88 23 and r24, r24 132ee: 09 f4 brne .+2 ; 0x132f2 132f0: cc c5 rjmp .+2968 ; 0x13e8a 132f2: 0e 94 02 5b call 0xb604 ; 0xb604 132f6: 6e 96 adiw r28, 0x1e ; 30 132f8: 6c af std Y+60, r22 ; 0x3c 132fa: 7d af std Y+61, r23 ; 0x3d 132fc: 8e af std Y+62, r24 ; 0x3e 132fe: 9f af std Y+63, r25 ; 0x3f 13300: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 13302: 8a e5 ldi r24, 0x5A ; 90 13304: 0e 94 56 5b call 0xb6ac ; 0xb6ac 13308: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 1330a: 81 2c mov r8, r1 1330c: 91 2c mov r9, r1 1330e: 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(); 13310: 88 23 and r24, r24 13312: 21 f0 breq .+8 ; 0x1331c 13314: 0e 94 02 5b call 0xb604 ; 0xb604 13318: 4b 01 movw r8, r22 1331a: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 1331c: 87 e5 ldi r24, 0x57 ; 87 1331e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 13322: 67 96 adiw r28, 0x17 ; 23 13324: 8f af std Y+63, r24 ; 0x3f 13326: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13328: 83 e4 ldi r24, 0x43 ; 67 1332a: 0e 94 56 5b call 0xb6ac ; 0xb6ac gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 1332e: 67 96 adiw r28, 0x17 ; 23 13330: ff ad ldd r31, Y+63 ; 0x3f 13332: 67 97 sbiw r28, 0x17 ; 23 13334: ff 93 push r31 13336: 8f 93 push r24 13338: cd 2c mov r12, r13 1333a: 6e 96 adiw r28, 0x1e ; 30 1333c: ec ac ldd r14, Y+60 ; 0x3c 1333e: fd ac ldd r15, Y+61 ; 0x3d 13340: 0e ad ldd r16, Y+62 ; 0x3e 13342: 1f ad ldd r17, Y+63 ; 0x3f 13344: 6e 97 sbiw r28, 0x1e ; 30 13346: 22 2d mov r18, r2 13348: b3 01 movw r22, r6 1334a: a2 01 movw r20, r4 1334c: 83 2d mov r24, r3 1334e: 0e 94 a7 7c call 0xf94e ; 0xf94e #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) { 13352: 0f 90 pop r0 13354: 0f 90 pop r0 13356: 31 10 cpse r3, r1 13358: 57 c0 rjmp .+174 ; 0x13408 1335a: 21 10 cpse r2, r1 1335c: 55 c0 rjmp .+170 ; 0x13408 1335e: 67 96 adiw r28, 0x17 ; 23 13360: 2f ad ldd r18, Y+63 ; 0x3f 13362: 67 97 sbiw r28, 0x17 ; 23 13364: 21 11 cpse r18, r1 13366: 50 c0 rjmp .+160 ; 0x13408 13368: d1 10 cpse r13, r1 1336a: 4e c0 rjmp .+156 ; 0x13408 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 1336c: 0e 94 7c 8d call 0x11af8 ; 0x11af8 13370: 4b c0 rjmp .+150 ; 0x13408 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) 13372: 86 35 cpi r24, 0x56 ; 86 13374: 91 05 cpc r25, r1 13376: 11 f4 brne .+4 ; 0x1337c 13378: 0c 94 a8 a3 jmp 0x14750 ; 0x14750 1337c: b4 f5 brge .+108 ; 0x133ea 1337e: 8c 34 cpi r24, 0x4C ; 76 13380: 91 05 cpc r25, r1 13382: 09 f4 brne .+2 ; 0x13386 13384: df c5 rjmp .+3006 ; 0x13f44 13386: 3c f5 brge .+78 ; 0x133d6 13388: 08 e2 ldi r16, 0x28 ; 40 1338a: 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)); 1338c: f6 e5 ldi r31, 0x56 ; 86 1338e: ef 2e mov r14, r31 13390: f9 e6 ldi r31, 0x69 ; 105 13392: ff 2e mov r15, r31 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) 13394: 8b 34 cpi r24, 0x4B ; 75 13396: 91 05 cpc r25, r1 13398: 09 f0 breq .+2 ; 0x1339c 1339a: 79 cf rjmp .-270 ; 0x1328e 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)); 1339c: 60 2f mov r22, r16 1339e: 70 e0 ldi r23, 0x00 ; 0 133a0: 90 e0 ldi r25, 0x00 ; 0 133a2: 80 e0 ldi r24, 0x00 ; 0 133a4: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 133a8: 0e 94 0a 5c call 0xb814 ; 0xb814 133ac: 9f 93 push r25 133ae: 8f 93 push r24 133b0: 7f 93 push r23 133b2: 6f 93 push r22 133b4: 1f 93 push r17 133b6: 0f 93 push r16 133b8: ff 92 push r15 133ba: ef 92 push r14 133bc: 0f 94 16 db call 0x3b62c ; 0x3b62c 133c0: 0f 5f subi r16, 0xFF ; 255 133c2: 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++) 133c4: 0f b6 in r0, 0x3f ; 63 133c6: f8 94 cli 133c8: de bf out 0x3e, r29 ; 62 133ca: 0f be out 0x3f, r0 ; 63 133cc: cd bf out 0x3d, r28 ; 61 133ce: 0f 36 cpi r16, 0x6F ; 111 133d0: 11 05 cpc r17, r1 133d2: 21 f7 brne .-56 ; 0x1339c 133d4: 19 c0 rjmp .+50 ; 0x13408 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) 133d6: 80 35 cpi r24, 0x50 ; 80 133d8: 91 05 cpc r25, r1 133da: 41 f2 breq .-112 ; 0x1336c 133dc: 81 35 cpi r24, 0x51 ; 81 133de: 91 05 cpc r25, r1 133e0: 09 f0 breq .+2 ; 0x133e4 133e2: 55 cf rjmp .-342 ; 0x1328e /*! ### 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(); 133e4: 0e 94 db 7e call 0xfdb6 ; 0xfdb6 133e8: 0f c0 rjmp .+30 ; 0x13408 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) 133ea: 8a 35 cpi r24, 0x5A ; 90 133ec: 91 05 cpc r25, r1 133ee: 11 f4 brne .+4 ; 0x133f4 133f0: 0c 94 b2 a3 jmp 0x14764 ; 0x14764 133f4: 74 f4 brge .+28 ; 0x13412 133f6: 87 35 cpi r24, 0x57 ; 87 133f8: 91 05 cpc r25, r1 133fa: 11 f4 brne .+4 ; 0x13400 133fc: 0c 94 ad a3 jmp 0x1475a ; 0x1475a 13400: 88 35 cpi r24, 0x58 ; 88 13402: 91 05 cpc r25, r1 13404: 09 f0 breq .+2 ; 0x13408 13406: 43 cf rjmp .-378 ; 0x1328e #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; 13408: 10 92 94 03 sts 0x0394, r1 ; 0x800394 1340c: 10 92 93 03 sts 0x0393, r1 ; 0x800393 13410: b8 cb rjmp .-2192 ; 0x12b82 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) 13412: 8b 35 cpi r24, 0x5B ; 91 13414: 91 05 cpc r25, r1 13416: 11 f4 brne .+4 ; 0x1341c 13418: 0c 94 b9 a3 jmp 0x14772 ; 0x14772 1341c: 8c 35 cpi r24, 0x5C ; 92 1341e: 91 05 cpc r25, r1 13420: 09 f0 breq .+2 ; 0x13424 13422: 35 cf rjmp .-406 ; 0x1328e 13424: bd ed ldi r27, 0xDD ; 221 13426: cb 2e mov r12, r27 13428: b2 e0 ldi r27, 0x02 ; 2 1342a: db 2e mov r13, r27 1342c: 8e 01 movw r16, r28 1342e: 0f 5b subi r16, 0xBF ; 191 13430: 1f 4f sbci r17, 0xFF ; 255 13432: 9e 01 movw r18, r28 13434: 2f 5f subi r18, 0xFF ; 255 13436: 3f 4f sbci r19, 0xFF ; 255 13438: 79 01 movw r14, r18 1343a: 81 ee ldi r24, 0xE1 ; 225 1343c: 88 2e mov r8, r24 1343e: 82 e0 ldi r24, 0x02 ; 2 13440: 98 2e mov r9, r24 13442: 58 01 movw r10, r16 13444: 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]); 13446: d6 01 movw r26, r12 13448: 8d 91 ld r24, X+ 1344a: 6d 01 movw r12, r26 1344c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 13450: f5 01 movw r30, r10 13452: 81 93 st Z+, r24 13454: 5f 01 movw r10, r30 if(codes[i]) 13456: 88 23 and r24, r24 13458: 41 f0 breq .+16 ; 0x1346a values[i] = code_value(); 1345a: 0e 94 1d 60 call 0xc03a ; 0xc03a 1345e: d7 01 movw r26, r14 13460: 6d 93 st X+, r22 13462: 7d 93 st X+, r23 13464: 8d 93 st X+, r24 13466: 9c 93 st X, r25 13468: 13 97 sbiw r26, 0x03 ; 3 1346a: b4 e0 ldi r27, 0x04 ; 4 1346c: eb 0e add r14, r27 1346e: 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) 13470: 8c 14 cp r8, r12 13472: 9d 04 cpc r9, r13 13474: 41 f7 brne .-48 ; 0x13446 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 13476: f8 01 movw r30, r16 13478: d3 80 ldd r13, Z+3 ; 0x03 1347a: dd 20 and r13, r13 1347c: 11 f4 brne .+4 ; 0x13482 1347e: 0c 94 bd a3 jmp 0x1477a ; 0x1477a 13482: 20 e0 ldi r18, 0x00 ; 0 13484: 30 e0 ldi r19, 0x00 ; 0 13486: a9 01 movw r20, r18 13488: 6d 85 ldd r22, Y+13 ; 0x0d 1348a: 7e 85 ldd r23, Y+14 ; 0x0e 1348c: 8f 85 ldd r24, Y+15 ; 0x0f 1348e: 98 89 ldd r25, Y+16 ; 0x10 13490: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 13494: 81 11 cpse r24, r1 13496: 0c 94 bd a3 jmp 0x1477a ; 0x1477a 1349a: d8 01 movw r26, r16 1349c: 8c 91 ld r24, X 1349e: 81 11 cpse r24, r1 134a0: 0c 94 bd a3 jmp 0x1477a ; 0x1477a (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 134a4: 11 96 adiw r26, 0x01 ; 1 134a6: 8c 91 ld r24, X 134a8: 11 97 sbiw r26, 0x01 ; 1 134aa: 81 11 cpse r24, r1 134ac: 0c 94 bd a3 jmp 0x1477a ; 0x1477a 134b0: 12 96 adiw r26, 0x02 ; 2 134b2: 8c 91 ld r24, X 134b4: 81 11 cpse r24, r1 134b6: 0c 94 bd a3 jmp 0x1477a ; 0x1477a { // 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; 134ba: 10 92 9e 06 sts 0x069E, r1 ; 0x80069e 134be: 10 92 9f 06 sts 0x069F, r1 ; 0x80069f 134c2: 10 92 a0 06 sts 0x06A0, r1 ; 0x8006a0 134c6: 10 92 a1 06 sts 0x06A1, r1 ; 0x8006a1 st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 134ca: 81 e0 ldi r24, 0x01 ; 1 134cc: 80 93 b8 04 sts 0x04B8, r24 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.488> 134d0: 9b cf rjmp .-202 ; 0x13408 #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 134d2: 2d ec ldi r18, 0xCD ; 205 134d4: 3c ec ldi r19, 0xCC ; 204 134d6: 4c ec ldi r20, 0xCC ; 204 134d8: 5d e3 ldi r21, 0x3D ; 61 134da: c7 01 movw r24, r14 134dc: b6 01 movw r22, r12 134de: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 134e2: 18 16 cp r1, r24 134e4: 24 f4 brge .+8 ; 0x134ee 134e6: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 134ea: 81 11 cpse r24, r1 134ec: 92 ce rjmp .-732 ; 0x13212 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 134ee: c8 01 movw r24, r16 134f0: 0e 94 88 6b call 0xd710 ; 0xd710 134f4: 89 cf rjmp .-238 ; 0x13408 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 134f6: 0e 94 f3 59 call 0xb3e6 ; 0xb3e6 134fa: e0 96 adiw r28, 0x30 ; 48 134fc: 9f af std Y+63, r25 ; 0x3f 134fe: 8e af std Y+62, r24 ; 0x3e 13500: 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 13502: 0e 94 44 61 call 0xc288 ; 0xc288 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 13506: 89 e4 ldi r24, 0x49 ; 73 13508: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1350c: 88 23 and r24, r24 1350e: 09 f4 brne .+2 ; 0x13512 13510: 00 c4 rjmp .+2048 ; 0x13d12 13512: 0e 94 1d 60 call 0xc03a ; 0xc03a 13516: 60 93 8b 03 sts 0x038B, r22 ; 0x80038b 1351a: 70 93 8c 03 sts 0x038C, r23 ; 0x80038c 1351e: 80 93 8d 03 sts 0x038D, r24 ; 0x80038d 13522: 90 93 8e 03 sts 0x038E, r25 ; 0x80038e offset[1] = code_seen('J') ? code_value() : 0.f; 13526: 8a e4 ldi r24, 0x4A ; 74 13528: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1352c: c1 2c mov r12, r1 1352e: d1 2c mov r13, r1 13530: 76 01 movw r14, r12 13532: 88 23 and r24, r24 13534: 21 f0 breq .+8 ; 0x1353e 13536: 0e 94 1d 60 call 0xc03a ; 0xc03a 1353a: 6b 01 movw r12, r22 1353c: 7c 01 movw r14, r24 1353e: c0 92 8f 03 sts 0x038F, r12 ; 0x80038f 13542: d0 92 90 03 sts 0x0390, r13 ; 0x800390 13546: e0 92 91 03 sts 0x0391, r14 ; 0x800391 1354a: f0 92 92 03 sts 0x0392, r15 ; 0x800392 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 1354e: e0 91 93 03 lds r30, 0x0393 ; 0x800393 13552: f0 91 94 03 lds r31, 0x0394 ; 0x800394 13556: c2 57 subi r28, 0x72 ; 114 13558: df 4f sbci r29, 0xFF ; 255 1355a: f9 83 std Y+1, r31 ; 0x01 1355c: e8 83 st Y, r30 1355e: ce 58 subi r28, 0x8E ; 142 13560: 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 13562: 80 90 8b 03 lds r8, 0x038B ; 0x80038b 13566: 90 90 8c 03 lds r9, 0x038C ; 0x80038c 1356a: a0 90 8d 03 lds r10, 0x038D ; 0x80038d 1356e: b0 90 8e 03 lds r11, 0x038E ; 0x80038e 13572: a7 01 movw r20, r14 13574: 96 01 movw r18, r12 13576: c5 01 movw r24, r10 13578: b4 01 movw r22, r8 1357a: 0f 94 18 e0 call 0x3c030 ; 0x3c030 1357e: ae 96 adiw r28, 0x2e ; 46 13580: 6c af std Y+60, r22 ; 0x3c 13582: 7d af std Y+61, r23 ; 0x3d 13584: 8e af std Y+62, r24 ; 0x3e 13586: 9f af std Y+63, r25 ; 0x3f 13588: 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); 1358a: 60 91 39 02 lds r22, 0x0239 ; 0x800239 1358e: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 13592: 07 2e mov r0, r23 13594: 00 0c add r0, r0 13596: 88 0b sbc r24, r24 13598: 99 0b sbc r25, r25 1359a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1359e: 20 91 b8 02 lds r18, 0x02B8 ; 0x8002b8 135a2: 30 91 b9 02 lds r19, 0x02B9 ; 0x8002b9 135a6: 40 91 ba 02 lds r20, 0x02BA ; 0x8002ba 135aa: 50 91 bb 02 lds r21, 0x02BB ; 0x8002bb 135ae: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 135b2: 2e e3 ldi r18, 0x3E ; 62 135b4: 33 ec ldi r19, 0xC3 ; 195 135b6: 4e e2 ldi r20, 0x2E ; 46 135b8: 59 e3 ldi r21, 0x39 ; 57 135ba: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 135be: aa 96 adiw r28, 0x2a ; 42 135c0: 6c af std Y+60, r22 ; 0x3c 135c2: 7d af std Y+61, r23 ; 0x3d 135c4: 8e af std Y+62, r24 ; 0x3e 135c6: 9f af std Y+63, r25 ; 0x3f 135c8: 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)); 135ca: 80 e1 ldi r24, 0x10 ; 16 135cc: e2 e9 ldi r30, 0x92 ; 146 135ce: f6 e0 ldi r31, 0x06 ; 6 135d0: de 01 movw r26, r28 135d2: 11 96 adiw r26, 0x01 ; 1 135d4: 01 90 ld r0, Z+ 135d6: 0d 92 st X+, r0 135d8: 8a 95 dec r24 135da: e1 f7 brne .-8 ; 0x135d4 float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 135dc: a5 01 movw r20, r10 135de: 94 01 movw r18, r8 135e0: 50 58 subi r21, 0x80 ; 128 135e2: 6a 96 adiw r28, 0x1a ; 26 135e4: 2c af std Y+60, r18 ; 0x3c 135e6: 3d af std Y+61, r19 ; 0x3d 135e8: 4e af std Y+62, r20 ; 0x3e 135ea: 5f af std Y+63, r21 ; 0x3f 135ec: 6a 97 sbiw r28, 0x1a ; 26 float r_axis_y = -offset[Y_AXIS]; 135ee: d7 01 movw r26, r14 135f0: c6 01 movw r24, r12 135f2: b0 58 subi r27, 0x80 ; 128 135f4: 6e 96 adiw r28, 0x1e ; 30 135f6: 8c af std Y+60, r24 ; 0x3c 135f8: 9d af std Y+61, r25 ; 0x3d 135fa: ae af std Y+62, r26 ; 0x3e 135fc: bf af std Y+63, r27 ; 0x3f 135fe: 6e 97 sbiw r28, 0x1e ; 30 float center_axis_x = start_position[X_AXIS] - r_axis_x; 13600: 29 81 ldd r18, Y+1 ; 0x01 13602: 3a 81 ldd r19, Y+2 ; 0x02 13604: 4b 81 ldd r20, Y+3 ; 0x03 13606: 5c 81 ldd r21, Y+4 ; 0x04 13608: e6 96 adiw r28, 0x36 ; 54 1360a: 2c af std Y+60, r18 ; 0x3c 1360c: 3d af std Y+61, r19 ; 0x3d 1360e: 4e af std Y+62, r20 ; 0x3e 13610: 5f af std Y+63, r21 ; 0x3f 13612: e6 97 sbiw r28, 0x36 ; 54 13614: c5 01 movw r24, r10 13616: b4 01 movw r22, r8 13618: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1361c: ea 96 adiw r28, 0x3a ; 58 1361e: 6c af std Y+60, r22 ; 0x3c 13620: 7d af std Y+61, r23 ; 0x3d 13622: 8e af std Y+62, r24 ; 0x3e 13624: 9f af std Y+63, r25 ; 0x3f 13626: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13628: 8d 81 ldd r24, Y+5 ; 0x05 1362a: 9e 81 ldd r25, Y+6 ; 0x06 1362c: af 81 ldd r26, Y+7 ; 0x07 1362e: b8 85 ldd r27, Y+8 ; 0x08 13630: ee 96 adiw r28, 0x3e ; 62 13632: 8c af std Y+60, r24 ; 0x3c 13634: 9d af std Y+61, r25 ; 0x3d 13636: ae af std Y+62, r26 ; 0x3e 13638: bf af std Y+63, r27 ; 0x3f 1363a: ee 97 sbiw r28, 0x3e ; 62 1363c: 9c 01 movw r18, r24 1363e: ad 01 movw r20, r26 13640: c7 01 movw r24, r14 13642: b6 01 movw r22, r12 13644: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13648: ce 57 subi r28, 0x7E ; 126 1364a: df 4f sbci r29, 0xFF ; 255 1364c: 68 83 st Y, r22 1364e: 79 83 std Y+1, r23 ; 0x01 13650: 8a 83 std Y+2, r24 ; 0x02 13652: 9b 83 std Y+3, r25 ; 0x03 13654: c2 58 subi r28, 0x82 ; 130 13656: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13658: 29 85 ldd r18, Y+9 ; 0x09 1365a: 3a 85 ldd r19, Y+10 ; 0x0a 1365c: 4b 85 ldd r20, Y+11 ; 0x0b 1365e: 5c 85 ldd r21, Y+12 ; 0x0c 13660: 60 91 7c 06 lds r22, 0x067C ; 0x80067c 13664: 70 91 7d 06 lds r23, 0x067D ; 0x80067d 13668: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 1366c: 90 91 7f 06 lds r25, 0x067F ; 0x80067f 13670: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 13674: c2 58 subi r28, 0x82 ; 130 13676: df 4f sbci r29, 0xFF ; 255 13678: 68 83 st Y, r22 1367a: 79 83 std Y+1, r23 ; 0x01 1367c: 8a 83 std Y+2, r24 ; 0x02 1367e: 9b 83 std Y+3, r25 ; 0x03 13680: ce 57 subi r28, 0x7E ; 126 13682: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 13684: 20 91 74 06 lds r18, 0x0674 ; 0x800674 13688: 30 91 75 06 lds r19, 0x0675 ; 0x800675 1368c: 40 91 76 06 lds r20, 0x0676 ; 0x800676 13690: 50 91 77 06 lds r21, 0x0677 ; 0x800677 13694: ca 57 subi r28, 0x7A ; 122 13696: df 4f sbci r29, 0xFF ; 255 13698: 28 83 st Y, r18 1369a: 39 83 std Y+1, r19 ; 0x01 1369c: 4a 83 std Y+2, r20 ; 0x02 1369e: 5b 83 std Y+3, r21 ; 0x03 136a0: c6 58 subi r28, 0x86 ; 134 136a2: d0 40 sbci r29, 0x00 ; 0 136a4: ea 96 adiw r28, 0x3a ; 58 136a6: 2c ad ldd r18, Y+60 ; 0x3c 136a8: 3d ad ldd r19, Y+61 ; 0x3d 136aa: 4e ad ldd r20, Y+62 ; 0x3e 136ac: 5f ad ldd r21, Y+63 ; 0x3f 136ae: ea 97 sbiw r28, 0x3a ; 58 136b0: ca 57 subi r28, 0x7A ; 122 136b2: df 4f sbci r29, 0xFF ; 255 136b4: 68 81 ld r22, Y 136b6: 79 81 ldd r23, Y+1 ; 0x01 136b8: 8a 81 ldd r24, Y+2 ; 0x02 136ba: 9b 81 ldd r25, Y+3 ; 0x03 136bc: c6 58 subi r28, 0x86 ; 134 136be: d0 40 sbci r29, 0x00 ; 0 136c0: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 136c4: 6b 01 movw r12, r22 136c6: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 136c8: 80 91 78 06 lds r24, 0x0678 ; 0x800678 136cc: 90 91 79 06 lds r25, 0x0679 ; 0x800679 136d0: a0 91 7a 06 lds r26, 0x067A ; 0x80067a 136d4: b0 91 7b 06 lds r27, 0x067B ; 0x80067b 136d8: c6 57 subi r28, 0x76 ; 118 136da: df 4f sbci r29, 0xFF ; 255 136dc: 88 83 st Y, r24 136de: 99 83 std Y+1, r25 ; 0x01 136e0: aa 83 std Y+2, r26 ; 0x02 136e2: bb 83 std Y+3, r27 ; 0x03 136e4: ca 58 subi r28, 0x8A ; 138 136e6: d0 40 sbci r29, 0x00 ; 0 136e8: ce 57 subi r28, 0x7E ; 126 136ea: df 4f sbci r29, 0xFF ; 255 136ec: 28 81 ld r18, Y 136ee: 39 81 ldd r19, Y+1 ; 0x01 136f0: 4a 81 ldd r20, Y+2 ; 0x02 136f2: 5b 81 ldd r21, Y+3 ; 0x03 136f4: c2 58 subi r28, 0x82 ; 130 136f6: d0 40 sbci r29, 0x00 ; 0 136f8: bc 01 movw r22, r24 136fa: cd 01 movw r24, r26 136fc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 13700: 4b 01 movw r8, r22 13702: 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; 13704: 30 90 82 0e lds r3, 0x0E82 ; 0x800e82 13708: 20 90 83 0e lds r2, 0x0E83 ; 0x800e83 1370c: 90 91 84 0e lds r25, 0x0E84 ; 0x800e84 13710: 6f 96 adiw r28, 0x1f ; 31 13712: 9f af std Y+63, r25 ; 0x3f 13714: 6f 97 sbiw r28, 0x1f ; 31 13716: a0 91 85 0e lds r26, 0x0E85 ; 0x800e85 1371a: a3 96 adiw r28, 0x23 ; 35 1371c: af af std Y+63, r26 ; 0x3f 1371e: 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); 13720: a7 01 movw r20, r14 13722: 96 01 movw r18, r12 13724: 6a 96 adiw r28, 0x1a ; 26 13726: 6c ad ldd r22, Y+60 ; 0x3c 13728: 7d ad ldd r23, Y+61 ; 0x3d 1372a: 8e ad ldd r24, Y+62 ; 0x3e 1372c: 9f ad ldd r25, Y+63 ; 0x3f 1372e: 6a 97 sbiw r28, 0x1a ; 26 13730: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13734: 2b 01 movw r4, r22 13736: 3c 01 movw r6, r24 13738: a5 01 movw r20, r10 1373a: 94 01 movw r18, r8 1373c: 6e 96 adiw r28, 0x1e ; 30 1373e: 6c ad ldd r22, Y+60 ; 0x3c 13740: 7d ad ldd r23, Y+61 ; 0x3d 13742: 8e ad ldd r24, Y+62 ; 0x3e 13744: 9f ad ldd r25, Y+63 ; 0x3f 13746: 6e 97 sbiw r28, 0x1e ; 30 13748: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1374c: 9b 01 movw r18, r22 1374e: ac 01 movw r20, r24 13750: c3 01 movw r24, r6 13752: b2 01 movw r22, r4 13754: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13758: 2b 01 movw r4, r22 1375a: 3c 01 movw r6, r24 1375c: a5 01 movw r20, r10 1375e: 94 01 movw r18, r8 13760: 6a 96 adiw r28, 0x1a ; 26 13762: 6c ad ldd r22, Y+60 ; 0x3c 13764: 7d ad ldd r23, Y+61 ; 0x3d 13766: 8e ad ldd r24, Y+62 ; 0x3e 13768: 9f ad ldd r25, Y+63 ; 0x3f 1376a: 6a 97 sbiw r28, 0x1a ; 26 1376c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13770: 4b 01 movw r8, r22 13772: 5c 01 movw r10, r24 13774: a7 01 movw r20, r14 13776: 96 01 movw r18, r12 13778: 6e 96 adiw r28, 0x1e ; 30 1377a: 6c ad ldd r22, Y+60 ; 0x3c 1377c: 7d ad ldd r23, Y+61 ; 0x3d 1377e: 8e ad ldd r24, Y+62 ; 0x3e 13780: 9f ad ldd r25, Y+63 ; 0x3f 13782: 6e 97 sbiw r28, 0x1e ; 30 13784: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13788: 9b 01 movw r18, r22 1378a: ac 01 movw r20, r24 1378c: c5 01 movw r24, r10 1378e: b4 01 movw r22, r8 13790: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 13794: a3 01 movw r20, r6 13796: 92 01 movw r18, r4 13798: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 1379c: 6b 01 movw r12, r22 1379e: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 137a0: 20 e0 ldi r18, 0x00 ; 0 137a2: 30 e0 ldi r19, 0x00 ; 0 137a4: a9 01 movw r20, r18 137a6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 137aa: 87 ff sbrs r24, 7 137ac: 0a c0 rjmp .+20 ; 0x137c2 137ae: 2b ed ldi r18, 0xDB ; 219 137b0: 3f e0 ldi r19, 0x0F ; 15 137b2: 49 ec ldi r20, 0xC9 ; 201 137b4: 50 e4 ldi r21, 0x40 ; 64 137b6: c7 01 movw r24, r14 137b8: b6 01 movw r22, r12 137ba: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 137be: 6b 01 movw r12, r22 137c0: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 137c2: 60 91 8b 0e lds r22, 0x0E8B ; 0x800e8b 137c6: 70 91 8c 0e lds r23, 0x0E8C ; 0x800e8c 137ca: 61 15 cp r22, r1 137cc: 71 05 cpc r23, r1 137ce: 09 f4 brne .+2 ; 0x137d2 137d0: a4 c2 rjmp .+1352 ; 0x13d1a { // 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); 137d2: 90 e0 ldi r25, 0x00 ; 0 137d4: 80 e0 ldi r24, 0x00 ; 0 137d6: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 137da: 9b 01 movw r18, r22 137dc: ac 01 movw r20, r24 137de: 6b ed ldi r22, 0xDB ; 219 137e0: 7f e0 ldi r23, 0x0F ; 15 137e2: 89 ec ldi r24, 0xC9 ; 201 137e4: 90 e4 ldi r25, 0x40 ; 64 137e6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 137ea: ae 96 adiw r28, 0x2e ; 46 137ec: 2c ad ldd r18, Y+60 ; 0x3c 137ee: 3d ad ldd r19, Y+61 ; 0x3d 137f0: 4e ad ldd r20, Y+62 ; 0x3e 137f2: 5f ad ldd r21, Y+63 ; 0x3f 137f4: ae 97 sbiw r28, 0x2e ; 46 137f6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 137fa: 5b 01 movw r10, r22 137fc: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 137fe: 60 91 8d 0e lds r22, 0x0E8D ; 0x800e8d 13802: 70 91 8e 0e lds r23, 0x0E8E ; 0x800e8e 13806: 61 15 cp r22, r1 13808: 71 05 cpc r23, r1 1380a: f1 f0 breq .+60 ; 0x13848 { // 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)); 1380c: 90 e0 ldi r25, 0x00 ; 0 1380e: 80 e0 ldi r24, 0x00 ; 0 13810: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 13814: 20 e0 ldi r18, 0x00 ; 0 13816: 30 e0 ldi r19, 0x00 ; 0 13818: 40 e7 ldi r20, 0x70 ; 112 1381a: 52 e4 ldi r21, 0x42 ; 66 1381c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13820: 9b 01 movw r18, r22 13822: ac 01 movw r20, r24 13824: aa 96 adiw r28, 0x2a ; 42 13826: 6c ad ldd r22, Y+60 ; 0x3c 13828: 7d ad ldd r23, Y+61 ; 0x3d 1382a: 8e ad ldd r24, Y+62 ; 0x3e 1382c: 9f ad ldd r25, Y+63 ; 0x3f 1382e: aa 97 sbiw r28, 0x2a ; 42 13830: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 13834: 3b 01 movw r6, r22 13836: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13838: 95 01 movw r18, r10 1383a: a8 01 movw r20, r16 1383c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 13840: 87 ff sbrs r24, 7 13842: 02 c0 rjmp .+4 ; 0x13848 mm_per_arc_segment = mm_per_arc_segment_sec; 13844: 53 01 movw r10, r6 13846: 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) 13848: 40 90 86 0e lds r4, 0x0E86 ; 0x800e86 1384c: 50 90 87 0e lds r5, 0x0E87 ; 0x800e87 13850: 60 90 88 0e lds r6, 0x0E88 ; 0x800e88 13854: 70 90 89 0e lds r7, 0x0E89 ; 0x800e89 13858: 95 01 movw r18, r10 1385a: a8 01 movw r20, r16 1385c: b2 01 movw r22, r4 1385e: c3 01 movw r24, r6 13860: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 13864: 18 16 cp r1, r24 13866: c4 f0 brlt .+48 ; 0x13898 { // 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) { 13868: 95 01 movw r18, r10 1386a: a8 01 movw r20, r16 1386c: 63 2d mov r22, r3 1386e: 72 2d mov r23, r2 13870: 6f 96 adiw r28, 0x1f ; 31 13872: 8f ad ldd r24, Y+63 ; 0x3f 13874: 6f 97 sbiw r28, 0x1f ; 31 13876: a3 96 adiw r28, 0x23 ; 35 13878: 9f ad ldd r25, Y+63 ; 0x3f 1387a: a3 97 sbiw r28, 0x23 ; 35 1387c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 13880: 25 01 movw r4, r10 13882: 38 01 movw r6, r16 13884: 87 ff sbrs r24, 7 13886: 08 c0 rjmp .+16 ; 0x13898 // 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; 13888: 43 2c mov r4, r3 1388a: 52 2c mov r5, r2 1388c: 6f 96 adiw r28, 0x1f ; 31 1388e: 6f ac ldd r6, Y+63 ; 0x3f 13890: 6f 97 sbiw r28, 0x1f ; 31 13892: a3 96 adiw r28, 0x23 ; 35 13894: 7f ac ldd r7, Y+63 ; 0x3f 13896: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 13898: c2 57 subi r28, 0x72 ; 114 1389a: df 4f sbci r29, 0xFF ; 255 1389c: e8 81 ld r30, Y 1389e: f9 81 ldd r31, Y+1 ; 0x01 138a0: ce 58 subi r28, 0x8E ; 142 138a2: d0 40 sbci r29, 0x00 ; 0 138a4: 32 97 sbiw r30, 0x02 ; 2 138a6: 51 f4 brne .+20 ; 0x138bc 138a8: 2b ed ldi r18, 0xDB ; 219 138aa: 3f e0 ldi r19, 0x0F ; 15 138ac: 49 ec ldi r20, 0xC9 ; 201 138ae: 50 e4 ldi r21, 0x40 ; 64 138b0: c7 01 movw r24, r14 138b2: b6 01 movw r22, r12 138b4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 138b8: 6b 01 movw r12, r22 138ba: 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) 138bc: ca 57 subi r28, 0x7A ; 122 138be: df 4f sbci r29, 0xFF ; 255 138c0: 28 81 ld r18, Y 138c2: 39 81 ldd r19, Y+1 ; 0x01 138c4: 4a 81 ldd r20, Y+2 ; 0x02 138c6: 5b 81 ldd r21, Y+3 ; 0x03 138c8: c6 58 subi r28, 0x86 ; 134 138ca: d0 40 sbci r29, 0x00 ; 0 138cc: e6 96 adiw r28, 0x36 ; 54 138ce: 6c ad ldd r22, Y+60 ; 0x3c 138d0: 7d ad ldd r23, Y+61 ; 0x3d 138d2: 8e ad ldd r24, Y+62 ; 0x3e 138d4: 9f ad ldd r25, Y+63 ; 0x3f 138d6: e6 97 sbiw r28, 0x36 ; 54 138d8: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 138dc: 81 11 cpse r24, r1 138de: 25 c0 rjmp .+74 ; 0x1392a 138e0: c6 57 subi r28, 0x76 ; 118 138e2: df 4f sbci r29, 0xFF ; 255 138e4: 28 81 ld r18, Y 138e6: 39 81 ldd r19, Y+1 ; 0x01 138e8: 4a 81 ldd r20, Y+2 ; 0x02 138ea: 5b 81 ldd r21, Y+3 ; 0x03 138ec: ca 58 subi r28, 0x8A ; 138 138ee: d0 40 sbci r29, 0x00 ; 0 138f0: ee 96 adiw r28, 0x3e ; 62 138f2: 6c ad ldd r22, Y+60 ; 0x3c 138f4: 7d ad ldd r23, Y+61 ; 0x3d 138f6: 8e ad ldd r24, Y+62 ; 0x3e 138f8: 9f ad ldd r25, Y+63 ; 0x3f 138fa: ee 97 sbiw r28, 0x3e ; 62 138fc: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 13900: 81 11 cpse r24, r1 13902: 13 c0 rjmp .+38 ; 0x1392a 13904: 20 e0 ldi r18, 0x00 ; 0 13906: 30 e0 ldi r19, 0x00 ; 0 13908: a9 01 movw r20, r18 1390a: c7 01 movw r24, r14 1390c: b6 01 movw r22, r12 1390e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 13912: 81 11 cpse r24, r1 13914: 0a c0 rjmp .+20 ; 0x1392a { angular_travel_total += 2 * M_PI; 13916: 2b ed ldi r18, 0xDB ; 219 13918: 3f e0 ldi r19, 0x0F ; 15 1391a: 49 ec ldi r20, 0xC9 ; 201 1391c: 50 e4 ldi r21, 0x40 ; 64 1391e: c7 01 movw r24, r14 13920: b6 01 movw r22, r12 13922: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13926: 6b 01 movw r12, r22 13928: 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)); 1392a: a7 01 movw r20, r14 1392c: 96 01 movw r18, r12 1392e: ae 96 adiw r28, 0x2e ; 46 13930: 6c ad ldd r22, Y+60 ; 0x3c 13932: 7d ad ldd r23, Y+61 ; 0x3d 13934: 8e ad ldd r24, Y+62 ; 0x3e 13936: 9f ad ldd r25, Y+63 ; 0x3f 13938: ae 97 sbiw r28, 0x2e ; 46 1393a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1393e: c2 58 subi r28, 0x82 ; 130 13940: df 4f sbci r29, 0xFF ; 255 13942: 28 81 ld r18, Y 13944: 39 81 ldd r19, Y+1 ; 0x01 13946: 4a 81 ldd r20, Y+2 ; 0x02 13948: 5b 81 ldd r21, Y+3 ; 0x03 1394a: ce 57 subi r28, 0x7E ; 126 1394c: d0 40 sbci r29, 0x00 ; 0 1394e: 0f 94 18 e0 call 0x3c030 ; 0x3c030 13952: 4b 01 movw r8, r22 13954: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13956: 2f e6 ldi r18, 0x6F ; 111 13958: 32 e1 ldi r19, 0x12 ; 18 1395a: 43 e8 ldi r20, 0x83 ; 131 1395c: 5a e3 ldi r21, 0x3A ; 58 1395e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 13962: 87 fd sbrc r24, 7 13964: cf c1 rjmp .+926 ; 0x13d04 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13966: 92 01 movw r18, r4 13968: a3 01 movw r20, r6 1396a: c5 01 movw r24, r10 1396c: b4 01 movw r22, r8 1396e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 13972: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 13976: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 1397a: a4 96 adiw r28, 0x24 ; 36 1397c: 7f af std Y+63, r23 ; 0x3f 1397e: 6e af std Y+62, r22 ; 0x3e 13980: 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) 13982: 62 30 cpi r22, 0x02 ; 2 13984: 71 05 cpc r23, r1 13986: 08 f4 brcc .+2 ; 0x1398a 13988: 8b c1 rjmp .+790 ; 0x13ca0 1398a: e0 96 adiw r28, 0x30 ; 48 1398c: 4e ad ldd r20, Y+62 ; 0x3e 1398e: 5f ad ldd r21, Y+63 ; 0x3f 13990: e0 97 sbiw r28, 0x30 ; 48 13992: 45 2b or r20, r21 13994: 09 f4 brne .+2 ; 0x13998 13996: 84 c1 rjmp .+776 ; 0x13ca0 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; 13998: 50 91 8a 0e lds r21, 0x0E8A ; 0x800e8a 1399c: 6f 96 adiw r28, 0x1f ; 31 1399e: 5f af std Y+63, r21 ; 0x3f 139a0: 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, 139a2: 90 e0 ldi r25, 0x00 ; 0 139a4: 80 e0 ldi r24, 0x00 ; 0 139a6: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 139aa: 4b 01 movw r8, r22 139ac: 5c 01 movw r10, r24 139ae: ac 01 movw r20, r24 139b0: 9b 01 movw r18, r22 139b2: c7 01 movw r24, r14 139b4: b6 01 movw r22, r12 139b6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 139ba: 2b 01 movw r4, r22 139bc: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 139be: a5 01 movw r20, r10 139c0: 94 01 movw r18, r8 139c2: c2 58 subi r28, 0x82 ; 130 139c4: df 4f sbci r29, 0xFF ; 255 139c6: 68 81 ld r22, Y 139c8: 79 81 ldd r23, Y+1 ; 0x01 139ca: 8a 81 ldd r24, Y+2 ; 0x02 139cc: 9b 81 ldd r25, Y+3 ; 0x03 139ce: ce 57 subi r28, 0x7E ; 126 139d0: d0 40 sbci r29, 0x00 ; 0 139d2: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 139d6: ee 96 adiw r28, 0x3e ; 62 139d8: 6c af std Y+60, r22 ; 0x3c 139da: 7d af std Y+61, r23 ; 0x3d 139dc: 8e af std Y+62, r24 ; 0x3e 139de: 9f af std Y+63, r25 ; 0x3f 139e0: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 139e2: 2d 85 ldd r18, Y+13 ; 0x0d 139e4: 3e 85 ldd r19, Y+14 ; 0x0e 139e6: 4f 85 ldd r20, Y+15 ; 0x0f 139e8: 58 89 ldd r21, Y+16 ; 0x10 139ea: 60 91 80 06 lds r22, 0x0680 ; 0x800680 139ee: 70 91 81 06 lds r23, 0x0681 ; 0x800681 139f2: 80 91 82 06 lds r24, 0x0682 ; 0x800682 139f6: 90 91 83 06 lds r25, 0x0683 ; 0x800683 139fa: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 139fe: a5 01 movw r20, r10 13a00: 94 01 movw r18, r8 13a02: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 13a06: c2 58 subi r28, 0x82 ; 130 13a08: df 4f sbci r29, 0xFF ; 255 13a0a: 68 83 st Y, r22 13a0c: 79 83 std Y+1, r23 ; 0x01 13a0e: 8a 83 std Y+2, r24 ; 0x02 13a10: 9b 83 std Y+3, r25 ; 0x03 13a12: ce 57 subi r28, 0x7E ; 126 13a14: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13a16: a3 01 movw r20, r6 13a18: 92 01 movw r18, r4 13a1a: c3 01 movw r24, r6 13a1c: b2 01 movw r22, r4 13a1e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13a22: 6b 01 movw r12, r22 13a24: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13a26: ac 01 movw r20, r24 13a28: 9b 01 movw r18, r22 13a2a: c3 01 movw r24, r6 13a2c: b2 01 movw r22, r4 13a2e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13a32: 20 e0 ldi r18, 0x00 ; 0 13a34: 30 e0 ldi r19, 0x00 ; 0 13a36: 40 ec ldi r20, 0xC0 ; 192 13a38: 50 e4 ldi r21, 0x40 ; 64 13a3a: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 13a3e: 9b 01 movw r18, r22 13a40: ac 01 movw r20, r24 13a42: c3 01 movw r24, r6 13a44: b2 01 movw r22, r4 13a46: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 13a4a: ae 96 adiw r28, 0x2e ; 46 13a4c: 6c af std Y+60, r22 ; 0x3c 13a4e: 7d af std Y+61, r23 ; 0x3d 13a50: 8e af std Y+62, r24 ; 0x3e 13a52: 9f af std Y+63, r25 ; 0x3f 13a54: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13a56: 20 e0 ldi r18, 0x00 ; 0 13a58: 30 e0 ldi r19, 0x00 ; 0 13a5a: 40 e0 ldi r20, 0x00 ; 0 13a5c: 5f e3 ldi r21, 0x3F ; 63 13a5e: c7 01 movw r24, r14 13a60: b6 01 movw r22, r12 13a62: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13a66: 9b 01 movw r18, r22 13a68: ac 01 movw r20, r24 13a6a: 60 e0 ldi r22, 0x00 ; 0 13a6c: 70 e0 ldi r23, 0x00 ; 0 13a6e: 80 e8 ldi r24, 0x80 ; 128 13a70: 9f e3 ldi r25, 0x3F ; 63 13a72: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 13a76: e6 96 adiw r28, 0x36 ; 54 13a78: 6c af std Y+60, r22 ; 0x3c 13a7a: 7d af std Y+61, r23 ; 0x3d 13a7c: 8e af std Y+62, r24 ; 0x3e 13a7e: 9f af std Y+63, r25 ; 0x3f 13a80: 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++) { 13a82: 22 24 eor r2, r2 13a84: 23 94 inc r2 13a86: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13a88: 6f 96 adiw r28, 0x1f ; 31 13a8a: 8f ad ldd r24, Y+63 ; 0x3f 13a8c: 6f 97 sbiw r28, 0x1f ; 31 13a8e: 81 11 cpse r24, r1 13a90: 4d c1 rjmp .+666 ; 0x13d2c // 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); 13a92: b1 01 movw r22, r2 13a94: 90 e0 ldi r25, 0x00 ; 0 13a96: 80 e0 ldi r24, 0x00 ; 0 13a98: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 13a9c: a3 01 movw r20, r6 13a9e: 92 01 movw r18, r4 13aa0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13aa4: 6b 01 movw r12, r22 13aa6: 7c 01 movw r14, r24 13aa8: 0f 94 76 de call 0x3bcec ; 0x3bcec 13aac: 6e 96 adiw r28, 0x1e ; 30 13aae: 6c af std Y+60, r22 ; 0x3c 13ab0: 7d af std Y+61, r23 ; 0x3d 13ab2: 8e af std Y+62, r24 ; 0x3e 13ab4: 9f af std Y+63, r25 ; 0x3f 13ab6: 6e 97 sbiw r28, 0x1e ; 30 13ab8: c7 01 movw r24, r14 13aba: b6 01 movw r22, r12 13abc: 0f 94 3c e1 call 0x3c278 ; 0x3c278 13ac0: 4b 01 movw r8, r22 13ac2: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 13ac4: c0 90 8b 03 lds r12, 0x038B ; 0x80038b 13ac8: d0 90 8c 03 lds r13, 0x038C ; 0x80038c 13acc: e0 90 8d 03 lds r14, 0x038D ; 0x80038d 13ad0: f0 90 8e 03 lds r15, 0x038E ; 0x80038e 13ad4: f7 fa bst r15, 7 13ad6: f0 94 com r15 13ad8: f7 f8 bld r15, 7 13ada: f0 94 com r15 13adc: 20 91 8f 03 lds r18, 0x038F ; 0x80038f 13ae0: 30 91 90 03 lds r19, 0x0390 ; 0x800390 13ae4: 40 91 91 03 lds r20, 0x0391 ; 0x800391 13ae8: 50 91 92 03 lds r21, 0x0392 ; 0x800392 13aec: a2 96 adiw r28, 0x22 ; 34 13aee: 2c af std Y+60, r18 ; 0x3c 13af0: 3d af std Y+61, r19 ; 0x3d 13af2: 4e af std Y+62, r20 ; 0x3e 13af4: 5f af std Y+63, r21 ; 0x3f 13af6: a2 97 sbiw r28, 0x22 ; 34 13af8: a7 01 movw r20, r14 13afa: 96 01 movw r18, r12 13afc: 6e 96 adiw r28, 0x1e ; 30 13afe: 6c ad ldd r22, Y+60 ; 0x3c 13b00: 7d ad ldd r23, Y+61 ; 0x3d 13b02: 8e ad ldd r24, Y+62 ; 0x3e 13b04: 9f ad ldd r25, Y+63 ; 0x3f 13b06: 6e 97 sbiw r28, 0x1e ; 30 13b08: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13b0c: 6a 96 adiw r28, 0x1a ; 26 13b0e: 6c af std Y+60, r22 ; 0x3c 13b10: 7d af std Y+61, r23 ; 0x3d 13b12: 8e af std Y+62, r24 ; 0x3e 13b14: 9f af std Y+63, r25 ; 0x3f 13b16: 6a 97 sbiw r28, 0x1a ; 26 13b18: a2 96 adiw r28, 0x22 ; 34 13b1a: 2c ad ldd r18, Y+60 ; 0x3c 13b1c: 3d ad ldd r19, Y+61 ; 0x3d 13b1e: 4e ad ldd r20, Y+62 ; 0x3e 13b20: 5f ad ldd r21, Y+63 ; 0x3f 13b22: a2 97 sbiw r28, 0x22 ; 34 13b24: c5 01 movw r24, r10 13b26: b4 01 movw r22, r8 13b28: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13b2c: 9b 01 movw r18, r22 13b2e: ac 01 movw r20, r24 13b30: 6a 96 adiw r28, 0x1a ; 26 13b32: 6c ad ldd r22, Y+60 ; 0x3c 13b34: 7d ad ldd r23, Y+61 ; 0x3d 13b36: 8e ad ldd r24, Y+62 ; 0x3e 13b38: 9f ad ldd r25, Y+63 ; 0x3f 13b3a: 6a 97 sbiw r28, 0x1a ; 26 13b3c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13b40: 6a 96 adiw r28, 0x1a ; 26 13b42: 6c af std Y+60, r22 ; 0x3c 13b44: 7d af std Y+61, r23 ; 0x3d 13b46: 8e af std Y+62, r24 ; 0x3e 13b48: 9f af std Y+63, r25 ; 0x3f 13b4a: 6a 97 sbiw r28, 0x1a ; 26 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 13b4c: a7 01 movw r20, r14 13b4e: 96 01 movw r18, r12 13b50: c5 01 movw r24, r10 13b52: b4 01 movw r22, r8 13b54: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13b58: 6b 01 movw r12, r22 13b5a: 7c 01 movw r14, r24 13b5c: a2 96 adiw r28, 0x22 ; 34 13b5e: 2c ad ldd r18, Y+60 ; 0x3c 13b60: 3d ad ldd r19, Y+61 ; 0x3d 13b62: 4e ad ldd r20, Y+62 ; 0x3e 13b64: 5f ad ldd r21, Y+63 ; 0x3f 13b66: a2 97 sbiw r28, 0x22 ; 34 13b68: 6e 96 adiw r28, 0x1e ; 30 13b6a: 6c ad ldd r22, Y+60 ; 0x3c 13b6c: 7d ad ldd r23, Y+61 ; 0x3d 13b6e: 8e ad ldd r24, Y+62 ; 0x3e 13b70: 9f ad ldd r25, Y+63 ; 0x3f 13b72: 6e 97 sbiw r28, 0x1e ; 30 13b74: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13b78: 9b 01 movw r18, r22 13b7a: ac 01 movw r20, r24 13b7c: c7 01 movw r24, r14 13b7e: b6 01 movw r22, r12 13b80: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 13b84: 6e 96 adiw r28, 0x1e ; 30 13b86: 6c af std Y+60, r22 ; 0x3c 13b88: 7d af std Y+61, r23 ; 0x3d 13b8a: 8e af std Y+62, r24 ; 0x3e 13b8c: 9f af std Y+63, r25 ; 0x3f 13b8e: 6e 97 sbiw r28, 0x1e ; 30 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 13b90: 30 91 8a 0e lds r19, 0x0E8A ; 0x800e8a 13b94: 6f 96 adiw r28, 0x1f ; 31 13b96: 3f af std Y+63, r19 ; 0x3f 13b98: 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; 13b9a: 6a 96 adiw r28, 0x1a ; 26 13b9c: 2c ad ldd r18, Y+60 ; 0x3c 13b9e: 3d ad ldd r19, Y+61 ; 0x3d 13ba0: 4e ad ldd r20, Y+62 ; 0x3e 13ba2: 5f ad ldd r21, Y+63 ; 0x3f 13ba4: 6a 97 sbiw r28, 0x1a ; 26 13ba6: ea 96 adiw r28, 0x3a ; 58 13ba8: 6c ad ldd r22, Y+60 ; 0x3c 13baa: 7d ad ldd r23, Y+61 ; 0x3d 13bac: 8e ad ldd r24, Y+62 ; 0x3e 13bae: 9f ad ldd r25, Y+63 ; 0x3f 13bb0: ea 97 sbiw r28, 0x3a ; 58 13bb2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13bb6: 69 83 std Y+1, r22 ; 0x01 13bb8: 7a 83 std Y+2, r23 ; 0x02 13bba: 8b 83 std Y+3, r24 ; 0x03 13bbc: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 13bbe: 6e 96 adiw r28, 0x1e ; 30 13bc0: 2c ad ldd r18, Y+60 ; 0x3c 13bc2: 3d ad ldd r19, Y+61 ; 0x3d 13bc4: 4e ad ldd r20, Y+62 ; 0x3e 13bc6: 5f ad ldd r21, Y+63 ; 0x3f 13bc8: 6e 97 sbiw r28, 0x1e ; 30 13bca: ce 57 subi r28, 0x7E ; 126 13bcc: df 4f sbci r29, 0xFF ; 255 13bce: 68 81 ld r22, Y 13bd0: 79 81 ldd r23, Y+1 ; 0x01 13bd2: 8a 81 ldd r24, Y+2 ; 0x02 13bd4: 9b 81 ldd r25, Y+3 ; 0x03 13bd6: c2 58 subi r28, 0x82 ; 130 13bd8: d0 40 sbci r29, 0x00 ; 0 13bda: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13bde: 6d 83 std Y+5, r22 ; 0x05 13be0: 7e 83 std Y+6, r23 ; 0x06 13be2: 8f 83 std Y+7, r24 ; 0x07 13be4: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 13be6: ee 96 adiw r28, 0x3e ; 62 13be8: 2c ad ldd r18, Y+60 ; 0x3c 13bea: 3d ad ldd r19, Y+61 ; 0x3d 13bec: 4e ad ldd r20, Y+62 ; 0x3e 13bee: 5f ad ldd r21, Y+63 ; 0x3f 13bf0: ee 97 sbiw r28, 0x3e ; 62 13bf2: 69 85 ldd r22, Y+9 ; 0x09 13bf4: 7a 85 ldd r23, Y+10 ; 0x0a 13bf6: 8b 85 ldd r24, Y+11 ; 0x0b 13bf8: 9c 85 ldd r25, Y+12 ; 0x0c 13bfa: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13bfe: 69 87 std Y+9, r22 ; 0x09 13c00: 7a 87 std Y+10, r23 ; 0x0a 13c02: 8b 87 std Y+11, r24 ; 0x0b 13c04: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 13c06: c2 58 subi r28, 0x82 ; 130 13c08: df 4f sbci r29, 0xFF ; 255 13c0a: 28 81 ld r18, Y 13c0c: 39 81 ldd r19, Y+1 ; 0x01 13c0e: 4a 81 ldd r20, Y+2 ; 0x02 13c10: 5b 81 ldd r21, Y+3 ; 0x03 13c12: ce 57 subi r28, 0x7E ; 126 13c14: d0 40 sbci r29, 0x00 ; 0 13c16: 6d 85 ldd r22, Y+13 ; 0x0d 13c18: 7e 85 ldd r23, Y+14 ; 0x0e 13c1a: 8f 85 ldd r24, Y+15 ; 0x0f 13c1c: 98 89 ldd r25, Y+16 ; 0x10 13c1e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13c22: 6d 87 std Y+13, r22 ; 0x0d 13c24: 7e 87 std Y+14, r23 ; 0x0e 13c26: 8f 87 std Y+15, r24 ; 0x0f 13c28: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 13c2a: ce 01 movw r24, r28 13c2c: 01 96 adiw r24, 0x01 ; 1 13c2e: 0e 94 49 6b call 0xd692 ; 0xd692 // Insert the segment into the buffer if (i >= start_segment_idx) 13c32: e0 96 adiw r28, 0x30 ; 48 13c34: 8e ad ldd r24, Y+62 ; 0x3e 13c36: 9f ad ldd r25, Y+63 ; 0x3f 13c38: e0 97 sbiw r28, 0x30 ; 48 13c3a: 28 16 cp r2, r24 13c3c: 39 06 cpc r3, r25 13c3e: 08 f1 brcs .+66 ; 0x13c82 plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 13c40: e9 84 ldd r14, Y+9 ; 0x09 13c42: fa 84 ldd r15, Y+10 ; 0x0a 13c44: 0b 85 ldd r16, Y+11 ; 0x0b 13c46: 1c 85 ldd r17, Y+12 ; 0x0c 13c48: 2d 81 ldd r18, Y+5 ; 0x05 13c4a: 3e 81 ldd r19, Y+6 ; 0x06 13c4c: 4f 81 ldd r20, Y+7 ; 0x07 13c4e: 58 85 ldd r21, Y+8 ; 0x08 13c50: 69 81 ldd r22, Y+1 ; 0x01 13c52: 7a 81 ldd r23, Y+2 ; 0x02 13c54: 8b 81 ldd r24, Y+3 ; 0x03 13c56: 9c 81 ldd r25, Y+4 ; 0x04 13c58: 3f 92 push r3 13c5a: 2f 92 push r2 13c5c: a2 e9 ldi r26, 0x92 ; 146 13c5e: b6 e0 ldi r27, 0x06 ; 6 13c60: bf 93 push r27 13c62: af 93 push r26 13c64: aa 96 adiw r28, 0x2a ; 42 13c66: 8c ac ldd r8, Y+60 ; 0x3c 13c68: 9d ac ldd r9, Y+61 ; 0x3d 13c6a: ae ac ldd r10, Y+62 ; 0x3e 13c6c: bf ac ldd r11, Y+63 ; 0x3f 13c6e: aa 97 sbiw r28, 0x2a ; 42 13c70: de 01 movw r26, r28 13c72: 1d 96 adiw r26, 0x0d ; 13 13c74: 6d 01 movw r12, r26 13c76: 0f 94 2c b1 call 0x36258 ; 0x36258 13c7a: 0f 90 pop r0 13c7c: 0f 90 pop r0 13c7e: 0f 90 pop r0 13c80: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 13c82: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 13c86: 81 11 cpse r24, r1 13c88: 3d c0 rjmp .+122 ; 0x13d04 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++) { 13c8a: bf ef ldi r27, 0xFF ; 255 13c8c: 2b 1a sub r2, r27 13c8e: 3b 0a sbc r3, r27 13c90: a4 96 adiw r28, 0x24 ; 36 13c92: ee ad ldd r30, Y+62 ; 0x3e 13c94: ff ad ldd r31, Y+63 ; 0x3f 13c96: a4 97 sbiw r28, 0x24 ; 36 13c98: e2 15 cp r30, r2 13c9a: f3 05 cpc r31, r3 13c9c: 09 f0 breq .+2 ; 0x13ca0 13c9e: f4 ce rjmp .-536 ; 0x13a88 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 13ca0: 84 e7 ldi r24, 0x74 ; 116 13ca2: 96 e0 ldi r25, 0x06 ; 6 13ca4: 0e 94 49 6b call 0xd692 ; 0xd692 // 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); 13ca8: e0 90 7c 06 lds r14, 0x067C ; 0x80067c 13cac: f0 90 7d 06 lds r15, 0x067D ; 0x80067d 13cb0: 00 91 7e 06 lds r16, 0x067E ; 0x80067e 13cb4: 10 91 7f 06 lds r17, 0x067F ; 0x80067f 13cb8: 20 91 78 06 lds r18, 0x0678 ; 0x800678 13cbc: 30 91 79 06 lds r19, 0x0679 ; 0x800679 13cc0: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 13cc4: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 13cc8: 60 91 74 06 lds r22, 0x0674 ; 0x800674 13ccc: 70 91 75 06 lds r23, 0x0675 ; 0x800675 13cd0: 80 91 76 06 lds r24, 0x0676 ; 0x800676 13cd4: 90 91 77 06 lds r25, 0x0677 ; 0x800677 13cd8: 1f 92 push r1 13cda: 1f 92 push r1 13cdc: e2 e9 ldi r30, 0x92 ; 146 13cde: f6 e0 ldi r31, 0x06 ; 6 13ce0: ff 93 push r31 13ce2: ef 93 push r30 13ce4: aa 96 adiw r28, 0x2a ; 42 13ce6: 8c ac ldd r8, Y+60 ; 0x3c 13ce8: 9d ac ldd r9, Y+61 ; 0x3d 13cea: ae ac ldd r10, Y+62 ; 0x3e 13cec: bf ac ldd r11, Y+63 ; 0x3f 13cee: aa 97 sbiw r28, 0x2a ; 42 13cf0: a0 e8 ldi r26, 0x80 ; 128 13cf2: ca 2e mov r12, r26 13cf4: a6 e0 ldi r26, 0x06 ; 6 13cf6: da 2e mov r13, r26 13cf8: 0f 94 2c b1 call 0x36258 ; 0x36258 13cfc: 0f 90 pop r0 13cfe: 0f 90 pop r0 13d00: 0f 90 pop r0 13d02: 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(); 13d04: 0e 94 7f 5a call 0xb4fe ; 0xb4fe previous_millis_cmd.start(); 13d08: 86 e8 ldi r24, 0x86 ; 134 13d0a: 93 e0 ldi r25, 0x03 ; 3 13d0c: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> 13d10: 7b cb rjmp .-2314 ; 0x13408 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; 13d12: 60 e0 ldi r22, 0x00 ; 0 13d14: 70 e0 ldi r23, 0x00 ; 0 13d16: cb 01 movw r24, r22 13d18: fe cb rjmp .-2052 ; 0x13516 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; 13d1a: a3 2c mov r10, r3 13d1c: b2 2c mov r11, r2 13d1e: 6f 96 adiw r28, 0x1f ; 31 13d20: 0f ad ldd r16, Y+63 ; 0x3f 13d22: 6f 97 sbiw r28, 0x1f ; 31 13d24: a3 96 adiw r28, 0x23 ; 35 13d26: 1f ad ldd r17, Y+63 ; 0x3f 13d28: a3 97 sbiw r28, 0x23 ; 35 13d2a: 69 cd rjmp .-1326 ; 0x137fe 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) { 13d2c: 6f 96 adiw r28, 0x1f ; 31 13d2e: 4f ad ldd r20, Y+63 ; 0x3f 13d30: 6f 97 sbiw r28, 0x1f ; 31 13d32: 41 50 subi r20, 0x01 ; 1 13d34: 6f 96 adiw r28, 0x1f ; 31 13d36: 4f af std Y+63, r20 ; 0x3f 13d38: 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; 13d3a: ae 96 adiw r28, 0x2e ; 46 13d3c: 2c ad ldd r18, Y+60 ; 0x3c 13d3e: 3d ad ldd r19, Y+61 ; 0x3d 13d40: 4e ad ldd r20, Y+62 ; 0x3e 13d42: 5f ad ldd r21, Y+63 ; 0x3f 13d44: ae 97 sbiw r28, 0x2e ; 46 13d46: 6a 96 adiw r28, 0x1a ; 26 13d48: 6c ad ldd r22, Y+60 ; 0x3c 13d4a: 7d ad ldd r23, Y+61 ; 0x3d 13d4c: 8e ad ldd r24, Y+62 ; 0x3e 13d4e: 9f ad ldd r25, Y+63 ; 0x3f 13d50: 6a 97 sbiw r28, 0x1a ; 26 13d52: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13d56: 6b 01 movw r12, r22 13d58: 7c 01 movw r14, r24 13d5a: e6 96 adiw r28, 0x36 ; 54 13d5c: 2c ad ldd r18, Y+60 ; 0x3c 13d5e: 3d ad ldd r19, Y+61 ; 0x3d 13d60: 4e ad ldd r20, Y+62 ; 0x3e 13d62: 5f ad ldd r21, Y+63 ; 0x3f 13d64: e6 97 sbiw r28, 0x36 ; 54 13d66: 6e 96 adiw r28, 0x1e ; 30 13d68: 6c ad ldd r22, Y+60 ; 0x3c 13d6a: 7d ad ldd r23, Y+61 ; 0x3d 13d6c: 8e ad ldd r24, Y+62 ; 0x3e 13d6e: 9f ad ldd r25, Y+63 ; 0x3f 13d70: 6e 97 sbiw r28, 0x1e ; 30 13d72: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13d76: 9b 01 movw r18, r22 13d78: ac 01 movw r20, r24 13d7a: c7 01 movw r24, r14 13d7c: b6 01 movw r22, r12 13d7e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 13d82: 7b 01 movw r14, r22 13d84: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 13d86: e6 96 adiw r28, 0x36 ; 54 13d88: 2c ad ldd r18, Y+60 ; 0x3c 13d8a: 3d ad ldd r19, Y+61 ; 0x3d 13d8c: 4e ad ldd r20, Y+62 ; 0x3e 13d8e: 5f ad ldd r21, Y+63 ; 0x3f 13d90: e6 97 sbiw r28, 0x36 ; 54 13d92: 6a 96 adiw r28, 0x1a ; 26 13d94: 6c ad ldd r22, Y+60 ; 0x3c 13d96: 7d ad ldd r23, Y+61 ; 0x3d 13d98: 8e ad ldd r24, Y+62 ; 0x3e 13d9a: 9f ad ldd r25, Y+63 ; 0x3f 13d9c: 6a 97 sbiw r28, 0x1a ; 26 13d9e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13da2: 4b 01 movw r8, r22 13da4: 5c 01 movw r10, r24 13da6: ae 96 adiw r28, 0x2e ; 46 13da8: 2c ad ldd r18, Y+60 ; 0x3c 13daa: 3d ad ldd r19, Y+61 ; 0x3d 13dac: 4e ad ldd r20, Y+62 ; 0x3e 13dae: 5f ad ldd r21, Y+63 ; 0x3f 13db0: ae 97 sbiw r28, 0x2e ; 46 13db2: 6e 96 adiw r28, 0x1e ; 30 13db4: 6c ad ldd r22, Y+60 ; 0x3c 13db6: 7d ad ldd r23, Y+61 ; 0x3d 13db8: 8e ad ldd r24, Y+62 ; 0x3e 13dba: 9f ad ldd r25, Y+63 ; 0x3f 13dbc: 6e 97 sbiw r28, 0x1e ; 30 13dbe: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13dc2: 9b 01 movw r18, r22 13dc4: ac 01 movw r20, r24 13dc6: c5 01 movw r24, r10 13dc8: b4 01 movw r22, r8 13dca: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 13dce: 6a 96 adiw r28, 0x1a ; 26 13dd0: 6c af std Y+60, r22 ; 0x3c 13dd2: 7d af std Y+61, r23 ; 0x3d 13dd4: 8e af std Y+62, r24 ; 0x3e 13dd6: 9f af std Y+63, r25 ; 0x3f 13dd8: 6a 97 sbiw r28, 0x1a ; 26 r_axis_y = r_axisi; 13dda: c7 01 movw r24, r14 13ddc: d8 01 movw r26, r16 13dde: 6e 96 adiw r28, 0x1e ; 30 13de0: 8c af std Y+60, r24 ; 0x3c 13de2: 9d af std Y+61, r25 ; 0x3d 13de4: ae af std Y+62, r26 ; 0x3e 13de6: bf af std Y+63, r27 ; 0x3f 13de8: 6e 97 sbiw r28, 0x1e ; 30 13dea: d7 ce rjmp .-594 ; 0x13b9a - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 13dec: 80 e5 ldi r24, 0x50 ; 80 13dee: 0e 94 56 5b call 0xb6ac ; 0xb6ac - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 13df2: c1 2c mov r12, r1 13df4: d1 2c mov r13, r1 13df6: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 13df8: 88 23 and r24, r24 13dfa: 31 f0 breq .+12 ; 0x13e08 13dfc: 0e 94 1d 60 call 0xc03a ; 0xc03a 13e00: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 13e04: 6b 01 movw r12, r22 13e06: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 13e08: 83 e5 ldi r24, 0x53 ; 83 13e0a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 13e0e: 88 23 and r24, r24 13e10: 61 f0 breq .+24 ; 0x13e2a 13e12: 0e 94 1d 60 call 0xc03a ; 0xc03a 13e16: 20 e0 ldi r18, 0x00 ; 0 13e18: 30 e0 ldi r19, 0x00 ; 0 13e1a: 4a e7 ldi r20, 0x7A ; 122 13e1c: 54 e4 ldi r21, 0x44 ; 68 13e1e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 13e22: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 13e26: 6b 01 movw r12, r22 13e28: 7c 01 movw r14, r24 if(codenum != 0) 13e2a: c1 14 cp r12, r1 13e2c: d1 04 cpc r13, r1 13e2e: e1 04 cpc r14, r1 13e30: f1 04 cpc r15, r1 13e32: 41 f0 breq .+16 ; 0x13e44 { if(custom_message_type != CustomMsg::M117) 13e34: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 13e38: 87 30 cpi r24, 0x07 ; 7 13e3a: 21 f0 breq .+8 ; 0x13e44 { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 13e3c: 8b e7 ldi r24, 0x7B ; 123 13e3e: 99 e6 ldi r25, 0x69 ; 105 13e40: 0e 94 3b f2 call 0x1e476 ; 0x1e476 } } st_synchronize(); 13e44: 0f 94 ed 43 call 0x287da ; 0x287da codenum += _millis(); // keep track of when we started waiting 13e48: 0f 94 51 2a call 0x254a2 ; 0x254a2 13e4c: c6 0e add r12, r22 13e4e: d7 1e adc r13, r23 13e50: e8 1e adc r14, r24 13e52: f9 1e adc r15, r25 previous_millis_cmd.start(); 13e54: 86 e8 ldi r24, 0x86 ; 134 13e56: 93 e0 ldi r25, 0x03 ; 3 13e58: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> while(_millis() < codenum) { 13e5c: 0f 94 51 2a call 0x254a2 ; 0x254a2 13e60: 6c 15 cp r22, r12 13e62: 7d 05 cpc r23, r13 13e64: 8e 05 cpc r24, r14 13e66: 9f 05 cpc r25, r15 13e68: 08 f0 brcs .+2 ; 0x13e6c 13e6a: ce ca rjmp .-2660 ; 0x13408 manage_heater(); 13e6c: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(); 13e70: 80 e0 ldi r24, 0x00 ; 0 13e72: 0e 94 37 8a call 0x1146e ; 0x1146e lcd_update(0); 13e76: 80 e0 ldi r24, 0x00 ; 0 13e78: 0e 94 27 6e call 0xdc4e ; 0xdc4e 13e7c: ef cf rjmp .-34 ; 0x13e5c 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); 13e7e: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 13e80: 0f 94 60 8a call 0x314c0 ; 0x314c0 13e84: c1 ca rjmp .-2686 ; 0x13408 13e86: 80 e0 ldi r24, 0x00 ; 0 13e88: fb cf rjmp .-10 ; 0x13e80 - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 13e8a: 6e 96 adiw r28, 0x1e ; 30 13e8c: 1c ae std Y+60, r1 ; 0x3c 13e8e: 1d ae std Y+61, r1 ; 0x3d 13e90: 1e ae std Y+62, r1 ; 0x3e 13e92: 1f ae std Y+63, r1 ; 0x3f 13e94: 6e 97 sbiw r28, 0x1e ; 30 13e96: 35 ca rjmp .-2966 ; 0x13302 Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 13e98: 0f 94 ed 43 call 0x287da ; 0x287da homing_flag = true; 13e9c: 81 e0 ldi r24, 0x01 ; 1 13e9e: 80 93 a7 0d sts 0x0DA7, r24 ; 0x800da7 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 13ea2: 0e 94 68 66 call 0xccd0 ; 0xccd0 13ea6: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 13ea8: 80 e0 ldi r24, 0x00 ; 0 13eaa: 90 e0 ldi r25, 0x00 ; 0 13eac: a8 e4 ldi r26, 0x48 ; 72 13eae: b4 e4 ldi r27, 0x44 ; 68 13eb0: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 13eb4: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 13eb8: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba 13ebc: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb find_bed_induction_sensor_point_z(-10.f, 3); 13ec0: 43 e0 ldi r20, 0x03 ; 3 13ec2: 60 e0 ldi r22, 0x00 ; 0 13ec4: 70 e0 ldi r23, 0x00 ; 0 13ec6: 80 e2 ldi r24, 0x20 ; 32 13ec8: 91 ec ldi r25, 0xC1 ; 193 13eca: 0f 94 8f 8c call 0x3191e ; 0x3191e printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 13ece: 70 90 9a 06 lds r7, 0x069A ; 0x80069a 13ed2: 60 90 9b 06 lds r6, 0x069B ; 0x80069b 13ed6: 50 90 9c 06 lds r5, 0x069C ; 0x80069c 13eda: 40 90 9d 06 lds r4, 0x069D ; 0x80069d 13ede: b0 90 96 06 lds r11, 0x0696 ; 0x800696 13ee2: a0 90 97 06 lds r10, 0x0697 ; 0x800697 13ee6: 90 90 98 06 lds r9, 0x0698 ; 0x800698 13eea: 80 90 99 06 lds r8, 0x0699 ; 0x800699 13eee: f0 90 92 06 lds r15, 0x0692 ; 0x800692 13ef2: e0 90 93 06 lds r14, 0x0693 ; 0x800693 13ef6: d0 90 94 06 lds r13, 0x0694 ; 0x800694 13efa: c0 90 95 06 lds r12, 0x0695 ; 0x800695 13efe: 89 e9 ldi r24, 0x99 ; 153 13f00: 93 e4 ldi r25, 0x43 ; 67 13f02: 0e 94 2c 72 call 0xe458 ; 0xe458 13f06: 4f 92 push r4 13f08: 5f 92 push r5 13f0a: 6f 92 push r6 13f0c: 7f 92 push r7 13f0e: 8f 92 push r8 13f10: 9f 92 push r9 13f12: af 92 push r10 13f14: bf 92 push r11 13f16: cf 92 push r12 13f18: df 92 push r13 13f1a: ef 92 push r14 13f1c: ff 92 push r15 13f1e: 9f 93 push r25 13f20: 8f 93 push r24 13f22: 8f e5 ldi r24, 0x5F ; 95 13f24: 99 e6 ldi r25, 0x69 ; 105 13f26: 9f 93 push r25 13f28: 8f 93 push r24 13f2a: 0f 94 16 db call 0x3b62c ; 0x3b62c clean_up_after_endstop_move(l_feedmultiply); 13f2e: c8 01 movw r24, r16 13f30: 0e 94 4e 66 call 0xcc9c ; 0xcc9c homing_flag = false; 13f34: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 13f38: 0f b6 in r0, 0x3f ; 63 13f3a: f8 94 cli 13f3c: de bf out 0x3e, r29 ; 62 13f3e: 0f be out 0x3f, r0 ; 63 13f40: cd bf out 0x3d, r28 ; 61 13f42: 62 ca rjmp .-2876 ; 0x13408 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 13f44: 20 e0 ldi r18, 0x00 ; 0 13f46: 30 e0 ldi r19, 0x00 ; 0 13f48: 40 e2 ldi r20, 0x20 ; 32 13f4a: 51 e4 ldi r21, 0x41 ; 65 13f4c: 60 91 99 03 lds r22, 0x0399 ; 0x800399 13f50: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 13f54: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 13f58: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 13f5c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 13f60: 87 ff sbrs r24, 7 13f62: 05 c0 rjmp .+10 ; 0x13f6e { SERIAL_ECHOLNPGM("No PINDA thermistor"); 13f64: 8f e2 ldi r24, 0x2F ; 47 13f66: 97 e8 ldi r25, 0x87 ; 135 13f68: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 13f6c: 4d ca rjmp .-2918 ; 0x13408 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 13f6e: 82 e0 ldi r24, 0x02 ; 2 13f70: 0e 94 7d ef call 0x1defa ; 0x1defa 13f74: 81 11 cpse r24, r1 13f76: 07 c0 rjmp .+14 ; 0x13f86 //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)); 13f78: 8e e0 ldi r24, 0x0E ; 14 13f7a: 9a e3 ldi r25, 0x3A ; 58 13f7c: 0e 94 2c 72 call 0xe458 ; 0xe458 13f80: 0f 94 f6 20 call 0x241ec ; 0x241ec 13f84: 41 ca rjmp .-2942 ; 0x13408 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 13f86: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 13f8a: 88 23 and r24, r24 13f8c: 41 f0 breq .+16 ; 0x13f9e 13f8e: 80 91 90 06 lds r24, 0x0690 ; 0x800690 13f92: 88 23 and r24, r24 13f94: 21 f0 breq .+8 ; 0x13f9e 13f96: 10 91 91 06 lds r17, 0x0691 ; 0x800691 13f9a: 11 11 cpse r17, r1 13f9c: 08 c0 rjmp .+16 ; 0x13fae 13f9e: 81 e0 ldi r24, 0x01 ; 1 13fa0: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 { // 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); 13fa4: 80 e4 ldi r24, 0x40 ; 64 13fa6: 9b e6 ldi r25, 0x6B ; 107 13fa8: 0f 94 38 76 call 0x2ec70 ; 0x2ec70 13fac: 2d ca rjmp .-2982 ; 0x13408 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 13fae: 85 ec ldi r24, 0xC5 ; 197 13fb0: 99 e3 ldi r25, 0x39 ; 57 13fb2: 0e 94 2c 72 call 0xe458 ; 0xe458 13fb6: 0f 94 f6 20 call 0x241ec ; 0x241ec uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 13fba: 83 e6 ldi r24, 0x63 ; 99 13fbc: 9e e3 ldi r25, 0x3E ; 62 13fbe: 0e 94 2c 72 call 0xe458 ; 0xe458 13fc2: 41 e0 ldi r20, 0x01 ; 1 13fc4: 60 e0 ldi r22, 0x00 ; 0 13fc6: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc if (result == LCD_LEFT_BUTTON_CHOICE) 13fca: 81 11 cpse r24, r1 13fcc: 61 c0 rjmp .+194 ; 0x14090 { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 13fce: 80 e0 ldi r24, 0x00 ; 0 13fd0: 90 e0 ldi r25, 0x00 ; 0 13fd2: a0 ea ldi r26, 0xA0 ; 160 13fd4: b0 e4 ldi r27, 0x40 ; 64 13fd6: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 13fda: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 13fde: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 13fe2: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 13fe6: 60 e0 ldi r22, 0x00 ; 0 13fe8: 70 e0 ldi r23, 0x00 ; 0 13fea: 88 e4 ldi r24, 0x48 ; 72 13fec: 92 e4 ldi r25, 0x42 ; 66 13fee: 0f 94 81 c0 call 0x38102 ; 0x38102 current_position[Z_AXIS] = 50; 13ff2: 80 e0 ldi r24, 0x00 ; 0 13ff4: 90 e0 ldi r25, 0x00 ; 0 13ff6: a8 e4 ldi r26, 0x48 ; 72 13ff8: b2 e4 ldi r27, 0x42 ; 66 13ffa: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 13ffe: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 14002: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 14006: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d current_position[Y_AXIS] = 180; 1400a: 80 e0 ldi r24, 0x00 ; 0 1400c: 90 e0 ldi r25, 0x00 ; 0 1400e: a4 e3 ldi r26, 0x34 ; 52 14010: b3 e4 ldi r27, 0x43 ; 67 14012: 80 93 96 06 sts 0x0696, r24 ; 0x800696 14016: 90 93 97 06 sts 0x0697, r25 ; 0x800697 1401a: a0 93 98 06 sts 0x0698, r26 ; 0x800698 1401e: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 14022: 60 e0 ldi r22, 0x00 ; 0 14024: 70 e0 ldi r23, 0x00 ; 0 14026: 88 e4 ldi r24, 0x48 ; 72 14028: 92 e4 ldi r25, 0x42 ; 66 1402a: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1402e: 0f 94 ed 43 call 0x287da ; 0x287da lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 14032: 89 e3 ldi r24, 0x39 ; 57 14034: 9e e3 ldi r25, 0x3E ; 62 14036: 0e 94 2c 72 call 0xe458 ; 0xe458 1403a: 0f 94 f6 20 call 0x241ec ; 0x241ec current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1403e: e3 ef ldi r30, 0xF3 ; 243 14040: f4 ea ldi r31, 0xA4 ; 164 14042: 85 91 lpm r24, Z+ 14044: 95 91 lpm r25, Z+ 14046: a5 91 lpm r26, Z+ 14048: b4 91 lpm r27, Z 1404a: 80 93 96 06 sts 0x0696, r24 ; 0x800696 1404e: 90 93 97 06 sts 0x0697, r25 ; 0x800697 14052: a0 93 98 06 sts 0x0698, r26 ; 0x800698 14056: b0 93 99 06 sts 0x0699, r27 ; 0x800699 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1405a: ef ee ldi r30, 0xEF ; 239 1405c: f4 ea ldi r31, 0xA4 ; 164 1405e: 85 91 lpm r24, Z+ 14060: 95 91 lpm r25, Z+ 14062: a5 91 lpm r26, Z+ 14064: b4 91 lpm r27, Z 14066: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1406a: 90 93 93 06 sts 0x0693, r25 ; 0x800693 1406e: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14072: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(3000 / 60); 14076: 60 e0 ldi r22, 0x00 ; 0 14078: 70 e0 ldi r23, 0x00 ; 0 1407a: 88 e4 ldi r24, 0x48 ; 72 1407c: 92 e4 ldi r25, 0x42 ; 66 1407e: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 14082: 0f 94 ed 43 call 0x287da ; 0x287da gcode_G28(false, false, true); 14086: 41 e0 ldi r20, 0x01 ; 1 14088: 60 e0 ldi r22, 0x00 ; 0 1408a: 80 e0 ldi r24, 0x00 ; 0 1408c: 0e 94 85 7e call 0xfd0a ; 0xfd0a } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 14090: 20 e0 ldi r18, 0x00 ; 0 14092: 30 e0 ldi r19, 0x00 ; 0 14094: 4c e0 ldi r20, 0x0C ; 12 14096: 52 e4 ldi r21, 0x42 ; 66 14098: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1409c: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 140a0: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 140a4: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 140a8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 140ac: 18 16 cp r1, r24 140ae: 0c f0 brlt .+2 ; 0x140b2 140b0: 73 c0 rjmp .+230 ; 0x14198 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 140b2: 80 e0 ldi r24, 0x00 ; 0 140b4: 90 e0 ldi r25, 0x00 ; 0 140b6: a8 ec ldi r26, 0xC8 ; 200 140b8: b2 e4 ldi r27, 0x42 ; 66 140ba: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 140be: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 140c2: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 140c6: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 140ca: 60 e0 ldi r22, 0x00 ; 0 140cc: 70 e0 ldi r23, 0x00 ; 0 140ce: 88 e4 ldi r24, 0x48 ; 72 140d0: 92 e4 ldi r25, 0x42 ; 66 140d2: 0f 94 81 c0 call 0x38102 ; 0x38102 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 140d6: 0f 94 1d 30 call 0x2603a ; 0x2603a LongTimer pinda_timeout; 140da: 19 82 std Y+1, r1 ; 0x01 140dc: 1a 82 std Y+2, r1 ; 0x02 140de: 1b 82 std Y+3, r1 ; 0x03 140e0: 1c 82 std Y+4, r1 ; 0x04 140e2: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 140e4: ce 01 movw r24, r28 140e6: 01 96 adiw r24, 0x01 ; 1 140e8: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::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); 140ec: 03 e2 ldi r16, 0x23 ; 35 140ee: ef e5 ldi r30, 0x5F ; 95 140f0: ee 2e mov r14, r30 140f2: e4 e8 ldi r30, 0x84 ; 132 140f4: fe 2e mov r15, r30 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 140f6: 20 e0 ldi r18, 0x00 ; 0 140f8: 30 e0 ldi r19, 0x00 ; 0 140fa: 4c e0 ldi r20, 0x0C ; 12 140fc: 52 e4 ldi r21, 0x42 ; 66 140fe: 60 91 99 03 lds r22, 0x0399 ; 0x800399 14102: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14106: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1410a: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1410e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 14112: 18 16 cp r1, r24 14114: c4 f5 brge .+112 ; 0x14186 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14116: 87 e7 ldi r24, 0x77 ; 119 14118: 99 e3 ldi r25, 0x39 ; 57 1411a: 0e 94 2c 72 call 0xe458 ; 0xe458 1411e: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 14122: 42 e8 ldi r20, 0x82 ; 130 14124: 64 e0 ldi r22, 0x04 ; 4 14126: 80 e0 ldi r24, 0x00 ; 0 14128: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 1412c: 1f 92 push r1 1412e: 0f 93 push r16 14130: 60 91 99 03 lds r22, 0x0399 ; 0x800399 14134: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14138: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1413c: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 14140: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 14144: 7f 93 push r23 14146: 6f 93 push r22 14148: ff 92 push r15 1414a: ef 92 push r14 1414c: 0e 94 39 6e call 0xdc72 ; 0xdc72 lcd_putc(LCD_STR_DEGREE[0]); 14150: 81 e8 ldi r24, 0x81 ; 129 14152: 0e 94 4f 6e call 0xdc9e ; 0xdc9e delay_keep_alive(1000); 14156: 88 ee ldi r24, 0xE8 ; 232 14158: 93 e0 ldi r25, 0x03 ; 3 1415a: 0e 94 6c 8c call 0x118d8 ; 0x118d8 serialecho_temperatures(); 1415e: 0e 94 de 76 call 0xedbc ; 0xedbc if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 14162: 40 e0 ldi r20, 0x00 ; 0 14164: 53 e5 ldi r21, 0x53 ; 83 14166: 67 e0 ldi r22, 0x07 ; 7 14168: 70 e0 ldi r23, 0x00 ; 0 1416a: ce 01 movw r24, r28 1416c: 01 96 adiw r24, 0x01 ; 1 1416e: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 14172: 0f 90 pop r0 14174: 0f 90 pop r0 14176: 0f 90 pop r0 14178: 0f 90 pop r0 1417a: 0f 90 pop r0 1417c: 0f 90 pop r0 1417e: 88 23 and r24, r24 14180: 09 f4 brne .+2 ; 0x14184 14182: b9 cf rjmp .-142 ; 0x140f6 target_temp_reached = false; 14184: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 14186: 81 e0 ldi r24, 0x01 ; 1 14188: 0e 94 a5 6e call 0xdd4a ; 0xdd4a if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 1418c: 11 11 cpse r17, r1 1418e: 04 c0 rjmp .+8 ; 0x14198 lcd_temp_cal_show_result(false); 14190: 80 e0 ldi r24, 0x00 ; 0 14192: 0f 94 41 21 call 0x24282 ; 0x24282 14196: 38 c9 rjmp .-3472 ; 0x13408 break; } } st_synchronize(); 14198: 0f 94 ed 43 call 0x287da ; 0x287da homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 1419c: 81 e0 ldi r24, 0x01 ; 1 1419e: 80 93 a7 0d sts 0x0DA7, r24 ; 0x800da7 lcd_update_enable(true); 141a2: 0e 94 a5 6e call 0xdd4a ; 0xdd4a SERIAL_ECHOLNPGM("PINDA probe calibration start"); 141a6: 81 e1 ldi r24, 0x11 ; 17 141a8: 97 e8 ldi r25, 0x87 ; 135 141aa: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 141ae: 80 90 99 03 lds r8, 0x0399 ; 0x800399 141b2: 90 90 9a 03 lds r9, 0x039A ; 0x80039a 141b6: a0 90 9b 03 lds r10, 0x039B ; 0x80039b 141ba: b0 90 9c 03 lds r11, 0x039C ; 0x80039c 141be: 20 e0 ldi r18, 0x00 ; 0 141c0: 30 e0 ldi r19, 0x00 ; 0 141c2: 40 ea ldi r20, 0xA0 ; 160 141c4: 50 e4 ldi r21, 0x40 ; 64 141c6: c5 01 movw r24, r10 141c8: b4 01 movw r22, r8 141ca: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 141ce: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 141d2: 25 e0 ldi r18, 0x05 ; 5 141d4: 26 9f mul r18, r22 141d6: a0 01 movw r20, r0 141d8: 27 9f mul r18, r23 141da: 50 0d add r21, r0 141dc: 11 24 eor r1, r1 141de: ba 01 movw r22, r20 141e0: 55 0f add r21, r21 141e2: 88 0b sbc r24, r24 141e4: 99 0b sbc r25, r25 141e6: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 141ea: 1b 01 movw r2, r22 141ec: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 141ee: 20 e0 ldi r18, 0x00 ; 0 141f0: 30 e0 ldi r19, 0x00 ; 0 141f2: 4c e0 ldi r20, 0x0C ; 12 141f4: 52 e4 ldi r21, 0x42 ; 66 141f6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 141fa: 87 ff sbrs r24, 7 141fc: 06 c0 rjmp .+12 ; 0x1420a 141fe: 21 2c mov r2, r1 14200: 31 2c mov r3, r1 14202: 6c e0 ldi r22, 0x0C ; 12 14204: e6 2e mov r14, r22 14206: 72 e4 ldi r23, 0x42 ; 66 14208: f7 2e mov r15, r23 if (start_temp < current_temperature_pinda) start_temp += 5; 1420a: 22 2d mov r18, r2 1420c: 33 2d mov r19, r3 1420e: 4e 2d mov r20, r14 14210: 5f 2d mov r21, r15 14212: c5 01 movw r24, r10 14214: b4 01 movw r22, r8 14216: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1421a: 18 16 cp r1, r24 1421c: 64 f4 brge .+24 ; 0x14236 1421e: 20 e0 ldi r18, 0x00 ; 0 14220: 30 e0 ldi r19, 0x00 ; 0 14222: 40 ea ldi r20, 0xA0 ; 160 14224: 50 e4 ldi r21, 0x40 ; 64 14226: 62 2d mov r22, r2 14228: 73 2d mov r23, r3 1422a: 8e 2d mov r24, r14 1422c: 9f 2d mov r25, r15 1422e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 14232: 1b 01 movw r2, r22 14234: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 14236: ff 92 push r15 14238: ef 92 push r14 1423a: 3f 92 push r3 1423c: 2f 92 push r2 1423e: 8d e3 ldi r24, 0x3D ; 61 14240: 99 e6 ldi r25, 0x69 ; 105 14242: 9f 93 push r25 14244: 8f 93 push r24 14246: 0f 94 16 db call 0x3b62c ; 0x3b62c setTargetBed(70 + (start_temp - 30)); 1424a: 20 e0 ldi r18, 0x00 ; 0 1424c: 30 e0 ldi r19, 0x00 ; 0 1424e: 40 ef ldi r20, 0xF0 ; 240 14250: 51 e4 ldi r21, 0x41 ; 65 14252: 62 2d mov r22, r2 14254: 73 2d mov r23, r3 14256: 8e 2d mov r24, r14 14258: 9f 2d mov r25, r15 1425a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1425e: 20 e0 ldi r18, 0x00 ; 0 14260: 30 e0 ldi r19, 0x00 ; 0 14262: 4c e8 ldi r20, 0x8C ; 140 14264: 52 e4 ldi r21, 0x42 ; 66 14266: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1426a: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1426e: 70 93 73 06 sts 0x0673, r23 ; 0x800673 14272: 60 93 72 06 sts 0x0672, r22 ; 0x800672 custom_message_type = CustomMsg::TempCal; 14276: 84 e0 ldi r24, 0x04 ; 4 14278: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = 1; 1427c: 81 e0 ldi r24, 0x01 ; 1 1427e: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 14282: 85 eb ldi r24, 0xB5 ; 181 14284: 94 e4 ldi r25, 0x44 ; 68 14286: 0e 94 2c 72 call 0xe458 ; 0xe458 1428a: 0e 94 3b f2 call 0x1e476 ; 0x1e476 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1428e: 80 e0 ldi r24, 0x00 ; 0 14290: 90 e0 ldi r25, 0x00 ; 0 14292: a0 ea ldi r26, 0xA0 ; 160 14294: b0 e4 ldi r27, 0x40 ; 64 14296: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 1429a: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1429e: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 142a2: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 142a6: 60 e0 ldi r22, 0x00 ; 0 142a8: 70 e0 ldi r23, 0x00 ; 0 142aa: 88 e4 ldi r24, 0x48 ; 72 142ac: 92 e4 ldi r25, 0x42 ; 66 142ae: 0f 94 81 c0 call 0x38102 ; 0x38102 current_position[X_AXIS] = PINDA_PREHEAT_X; 142b2: 80 e0 ldi r24, 0x00 ; 0 142b4: 90 e0 ldi r25, 0x00 ; 0 142b6: a0 ea ldi r26, 0xA0 ; 160 142b8: b1 e4 ldi r27, 0x41 ; 65 142ba: 80 93 92 06 sts 0x0692, r24 ; 0x800692 142be: 90 93 93 06 sts 0x0693, r25 ; 0x800693 142c2: a0 93 94 06 sts 0x0694, r26 ; 0x800694 142c6: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 142ca: 80 e0 ldi r24, 0x00 ; 0 142cc: 90 e0 ldi r25, 0x00 ; 0 142ce: a0 e7 ldi r26, 0x70 ; 112 142d0: b2 e4 ldi r27, 0x42 ; 66 142d2: 80 93 96 06 sts 0x0696, r24 ; 0x800696 142d6: 90 93 97 06 sts 0x0697, r25 ; 0x800697 142da: a0 93 98 06 sts 0x0698, r26 ; 0x800698 142de: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 142e2: 60 e0 ldi r22, 0x00 ; 0 142e4: 70 e0 ldi r23, 0x00 ; 0 142e6: 88 e4 ldi r24, 0x48 ; 72 142e8: 92 e4 ldi r25, 0x42 ; 66 142ea: 0f 94 81 c0 call 0x38102 ; 0x38102 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 142ee: 8a e9 ldi r24, 0x9A ; 154 142f0: 99 e9 ldi r25, 0x99 ; 153 142f2: a9 e1 ldi r26, 0x19 ; 25 142f4: be e3 ldi r27, 0x3E ; 62 142f6: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 142fa: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 142fe: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 14302: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14306: 60 e0 ldi r22, 0x00 ; 0 14308: 70 e0 ldi r23, 0x00 ; 0 1430a: 88 e4 ldi r24, 0x48 ; 72 1430c: 92 e4 ldi r25, 0x42 ; 66 1430e: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 14312: 0f 94 ed 43 call 0x287da ; 0x287da 14316: 0f 90 pop r0 14318: 0f 90 pop r0 1431a: 0f 90 pop r0 1431c: 0f 90 pop r0 1431e: 0f 90 pop r0 14320: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 14322: 20 91 99 03 lds r18, 0x0399 ; 0x800399 14326: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 1432a: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 1432e: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 14332: 62 2d mov r22, r2 14334: 73 2d mov r23, r3 14336: 8e 2d mov r24, r14 14338: 9f 2d mov r25, r15 1433a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1433e: 18 16 cp r1, r24 14340: 3c f4 brge .+14 ; 0x14350 { delay_keep_alive(1000); 14342: 88 ee ldi r24, 0xE8 ; 232 14344: 93 e0 ldi r25, 0x03 ; 3 14346: 0e 94 6c 8c call 0x118d8 ; 0x118d8 serialecho_temperatures(); 1434a: 0e 94 de 76 call 0xedbc ; 0xedbc 1434e: e9 cf rjmp .-46 ; 0x14322 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 14350: 60 e0 ldi r22, 0x00 ; 0 14352: 86 ea ldi r24, 0xA6 ; 166 14354: 9f e0 ldi r25, 0x0F ; 15 14356: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 } 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; 1435a: 80 e0 ldi r24, 0x00 ; 0 1435c: 90 e0 ldi r25, 0x00 ; 0 1435e: a0 ea ldi r26, 0xA0 ; 160 14360: b0 e4 ldi r27, 0x40 ; 64 14362: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14366: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1436a: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1436e: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14372: 60 e0 ldi r22, 0x00 ; 0 14374: 70 e0 ldi r23, 0x00 ; 0 14376: 88 e4 ldi r24, 0x48 ; 72 14378: 92 e4 ldi r25, 0x42 ; 66 1437a: 0f 94 81 c0 call 0x38102 ; 0x38102 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1437e: ef ee ldi r30, 0xEF ; 239 14380: f4 ea ldi r31, 0xA4 ; 164 14382: 85 91 lpm r24, Z+ 14384: 95 91 lpm r25, Z+ 14386: a5 91 lpm r26, Z+ 14388: b4 91 lpm r27, Z 1438a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1438e: 90 93 93 06 sts 0x0693, r25 ; 0x800693 14392: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14396: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1439a: e3 ef ldi r30, 0xF3 ; 243 1439c: f4 ea ldi r31, 0xA4 ; 164 1439e: 85 91 lpm r24, Z+ 143a0: 95 91 lpm r25, Z+ 143a2: a5 91 lpm r26, Z+ 143a4: b4 91 lpm r27, Z 143a6: 80 93 96 06 sts 0x0696, r24 ; 0x800696 143aa: 90 93 97 06 sts 0x0697, r25 ; 0x800697 143ae: a0 93 98 06 sts 0x0698, r26 ; 0x800698 143b2: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 143b6: 60 e0 ldi r22, 0x00 ; 0 143b8: 70 e0 ldi r23, 0x00 ; 0 143ba: 88 e4 ldi r24, 0x48 ; 72 143bc: 92 e4 ldi r25, 0x42 ; 66 143be: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 143c2: 0f 94 ed 43 call 0x287da ; 0x287da bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 143c6: 43 e0 ldi r20, 0x03 ; 3 143c8: 60 e0 ldi r22, 0x00 ; 0 143ca: 70 e0 ldi r23, 0x00 ; 0 143cc: 80 e8 ldi r24, 0x80 ; 128 143ce: 9f eb ldi r25, 0xBF ; 191 143d0: 0f 94 8f 8c call 0x3191e ; 0x3191e if (find_z_result == false) { 143d4: 81 11 cpse r24, r1 143d6: 06 c0 rjmp .+12 ; 0x143e4 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); 143d8: 0f 94 41 21 call 0x24282 ; 0x24282 homing_flag = false; 143dc: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 143e0: 0c 94 04 9a jmp 0x13408 ; 0x13408 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 143e4: 90 91 9a 06 lds r25, 0x069A ; 0x80069a 143e8: 67 96 adiw r28, 0x17 ; 23 143ea: 9f af std Y+63, r25 ; 0x3f 143ec: 67 97 sbiw r28, 0x17 ; 23 143ee: a0 91 9b 06 lds r26, 0x069B ; 0x80069b 143f2: 6b 96 adiw r28, 0x1b ; 27 143f4: af af std Y+63, r26 ; 0x3f 143f6: 6b 97 sbiw r28, 0x1b ; 27 143f8: b0 91 9c 06 lds r27, 0x069C ; 0x80069c 143fc: 6f 96 adiw r28, 0x1f ; 31 143fe: bf af std Y+63, r27 ; 0x3f 14400: 6f 97 sbiw r28, 0x1f ; 31 14402: e0 91 9d 06 lds r30, 0x069D ; 0x80069d 14406: a7 96 adiw r28, 0x27 ; 39 14408: ef af std Y+63, r30 ; 0x3f 1440a: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 1440c: ef 93 push r30 1440e: bf 93 push r27 14410: af 93 push r26 14412: 9f 93 push r25 14414: 80 e3 ldi r24, 0x30 ; 48 14416: 99 e6 ldi r25, 0x69 ; 105 14418: 9f 93 push r25 1441a: 8f 93 push r24 1441c: 0f 94 16 db call 0x3b62c ; 0x3b62c 14420: 0f 90 pop r0 14422: 0f 90 pop r0 14424: 0f 90 pop r0 14426: 0f 90 pop r0 14428: 0f 90 pop r0 1442a: 0f 90 pop r0 1442c: 4e ea ldi r20, 0xAE ; 174 1442e: 84 2e mov r8, r20 14430: 4f e0 ldi r20, 0x0F ; 15 14432: 94 2e mov r9, r20 14434: 53 e2 ldi r21, 0x23 ; 35 14436: c5 2e mov r12, r21 14438: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 1443a: 0f ef ldi r16, 0xFF ; 255 1443c: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 1443e: b6 01 movw r22, r12 14440: 0d 2c mov r0, r13 14442: 00 0c add r0, r0 14444: 88 0b sbc r24, r24 14446: 99 0b sbc r25, r25 14448: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1444c: 2b 01 movw r4, r22 1444e: 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)); 14450: df 92 push r13 14452: cf 92 push r12 14454: c8 01 movw r24, r16 14456: 02 96 adiw r24, 0x02 ; 2 14458: 9f 93 push r25 1445a: 8f 93 push r24 1445c: 24 ef ldi r18, 0xF4 ; 244 1445e: 38 e6 ldi r19, 0x68 ; 104 14460: 3f 93 push r19 14462: 2f 93 push r18 14464: 0f 94 16 db call 0x3b62c ; 0x3b62c 14468: 58 01 movw r10, r16 1446a: 5f ef ldi r21, 0xFF ; 255 1446c: a5 1a sub r10, r21 1446e: b5 0a sbc r11, r21 if (i >= 0) { 14470: 0f 90 pop r0 14472: 0f 90 pop r0 14474: 0f 90 pop r0 14476: 0f 90 pop r0 14478: 0f 90 pop r0 1447a: 0f 90 pop r0 1447c: 11 f4 brne .+4 ; 0x14482 1447e: 0c 94 1b cd jmp 0x19a36 ; 0x19a36 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 14482: 70 e0 ldi r23, 0x00 ; 0 14484: 60 e0 ldi r22, 0x00 ; 0 14486: c4 01 movw r24, r8 14488: 0f 94 96 dc call 0x3b92c ; 0x3b92c eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 1448c: a3 01 movw r20, r6 1448e: 92 01 movw r18, r4 14490: 62 2d mov r22, r2 14492: 73 2d mov r23, r3 14494: 8e 2d mov r24, r14 14496: 9f 2d mov r25, r15 14498: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1449c: 18 16 cp r1, r24 1449e: 44 f4 brge .+16 ; 0x144b0 } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 144a0: 85 e0 ldi r24, 0x05 ; 5 144a2: a8 16 cp r10, r24 144a4: b1 04 cpc r11, r1 144a6: 11 f0 breq .+4 ; 0x144ac 144a8: 0c 94 27 cd jmp 0x19a4e ; 0x19a4e 144ac: 05 e0 ldi r16, 0x05 ; 5 144ae: 10 e0 ldi r17, 0x00 ; 0 144b0: 58 01 movw r10, r16 144b2: 97 e2 ldi r25, 0x27 ; 39 144b4: a9 1a sub r10, r25 144b6: 98 ef ldi r25, 0xF8 ; 248 144b8: b9 0a sbc r11, r25 144ba: aa 0c add r10, r10 144bc: bb 1c adc r11, r11 144be: 85 e0 ldi r24, 0x05 ; 5 144c0: 80 9f mul r24, r16 144c2: 10 01 movw r2, r0 144c4: 81 9f mul r24, r17 144c6: 30 0c add r3, r0 144c8: 11 24 eor r1, r1 144ca: 0d 5f subi r16, 0xFD ; 253 144cc: 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; 144ce: 2a e9 ldi r18, 0x9A ; 154 144d0: 42 2e mov r4, r18 144d2: 29 e9 ldi r18, 0x99 ; 153 144d4: 52 2e mov r5, r18 144d6: 29 e1 ldi r18, 0x19 ; 25 144d8: 62 2e mov r6, r18 144da: 2e e3 ldi r18, 0x3E ; 62 144dc: 72 2e mov r7, r18 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); 144de: 3b eb ldi r19, 0xBB ; 187 144e0: 83 2e mov r8, r19 144e2: 38 e6 ldi r19, 0x68 ; 104 144e4: 93 2e mov r9, r19 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; } for (i++; i < 5; i++) 144e6: c8 01 movw r24, r16 144e8: 02 97 sbiw r24, 0x02 ; 2 144ea: 05 97 sbiw r24, 0x05 ; 5 144ec: 0c f0 brlt .+2 ; 0x144f0 144ee: d4 c0 rjmp .+424 ; 0x14698 { float temp = (40 + i * 5); 144f0: b1 01 movw r22, r2 144f2: 63 5d subi r22, 0xD3 ; 211 144f4: 7f 4f sbci r23, 0xFF ; 255 144f6: 07 2e mov r0, r23 144f8: 00 0c add r0, r0 144fa: 88 0b sbc r24, r24 144fc: 99 0b sbc r25, r25 144fe: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 14502: 6b 01 movw r12, r22 14504: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 14506: 1f 93 push r17 14508: 0f 93 push r16 1450a: a7 ee ldi r26, 0xE7 ; 231 1450c: b8 e6 ldi r27, 0x68 ; 104 1450e: bf 93 push r27 14510: af 93 push r26 14512: 0f 94 16 db call 0x3b62c ; 0x3b62c custom_message_state = i + 2; 14516: 00 93 f7 03 sts 0x03F7, r16 ; 0x8003f7 setTargetBed(50 + 10 * (temp - 30) / 5); 1451a: 20 e0 ldi r18, 0x00 ; 0 1451c: 30 e0 ldi r19, 0x00 ; 0 1451e: 40 ef ldi r20, 0xF0 ; 240 14520: 51 e4 ldi r21, 0x41 ; 65 14522: c7 01 movw r24, r14 14524: b6 01 movw r22, r12 14526: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1452a: 20 e0 ldi r18, 0x00 ; 0 1452c: 30 e0 ldi r19, 0x00 ; 0 1452e: 40 e2 ldi r20, 0x20 ; 32 14530: 51 e4 ldi r21, 0x41 ; 65 14532: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 14536: 20 e0 ldi r18, 0x00 ; 0 14538: 30 e0 ldi r19, 0x00 ; 0 1453a: 40 ea ldi r20, 0xA0 ; 160 1453c: 50 e4 ldi r21, 0x40 ; 64 1453e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 14542: 20 e0 ldi r18, 0x00 ; 0 14544: 30 e0 ldi r19, 0x00 ; 0 14546: 48 e4 ldi r20, 0x48 ; 72 14548: 52 e4 ldi r21, 0x42 ; 66 1454a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1454e: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 14552: 70 93 73 06 sts 0x0673, r23 ; 0x800673 14556: 60 93 72 06 sts 0x0672, r22 ; 0x800672 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1455a: 80 e0 ldi r24, 0x00 ; 0 1455c: 90 e0 ldi r25, 0x00 ; 0 1455e: a0 ea ldi r26, 0xA0 ; 160 14560: b0 e4 ldi r27, 0x40 ; 64 14562: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14566: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1456a: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1456e: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14572: 60 e0 ldi r22, 0x00 ; 0 14574: 70 e0 ldi r23, 0x00 ; 0 14576: 88 e4 ldi r24, 0x48 ; 72 14578: 92 e4 ldi r25, 0x42 ; 66 1457a: 0f 94 81 c0 call 0x38102 ; 0x38102 current_position[X_AXIS] = PINDA_PREHEAT_X; 1457e: 20 e0 ldi r18, 0x00 ; 0 14580: 30 e0 ldi r19, 0x00 ; 0 14582: 40 ea ldi r20, 0xA0 ; 160 14584: 51 e4 ldi r21, 0x41 ; 65 14586: 20 93 92 06 sts 0x0692, r18 ; 0x800692 1458a: 30 93 93 06 sts 0x0693, r19 ; 0x800693 1458e: 40 93 94 06 sts 0x0694, r20 ; 0x800694 14592: 50 93 95 06 sts 0x0695, r21 ; 0x800695 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14596: 80 e0 ldi r24, 0x00 ; 0 14598: 90 e0 ldi r25, 0x00 ; 0 1459a: a0 e7 ldi r26, 0x70 ; 112 1459c: b2 e4 ldi r27, 0x42 ; 66 1459e: 80 93 96 06 sts 0x0696, r24 ; 0x800696 145a2: 90 93 97 06 sts 0x0697, r25 ; 0x800697 145a6: a0 93 98 06 sts 0x0698, r26 ; 0x800698 145aa: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 145ae: 60 e0 ldi r22, 0x00 ; 0 145b0: 70 e0 ldi r23, 0x00 ; 0 145b2: 88 e4 ldi r24, 0x48 ; 72 145b4: 92 e4 ldi r25, 0x42 ; 66 145b6: 0f 94 81 c0 call 0x38102 ; 0x38102 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 145ba: 40 92 9a 06 sts 0x069A, r4 ; 0x80069a 145be: 50 92 9b 06 sts 0x069B, r5 ; 0x80069b 145c2: 60 92 9c 06 sts 0x069C, r6 ; 0x80069c 145c6: 70 92 9d 06 sts 0x069D, r7 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 145ca: 60 e0 ldi r22, 0x00 ; 0 145cc: 70 e0 ldi r23, 0x00 ; 0 145ce: 88 e4 ldi r24, 0x48 ; 72 145d0: 92 e4 ldi r25, 0x42 ; 66 145d2: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 145d6: 0f 94 ed 43 call 0x287da ; 0x287da 145da: 0f 90 pop r0 145dc: 0f 90 pop r0 145de: 0f 90 pop r0 145e0: 0f 90 pop r0 while (current_temperature_pinda < temp) 145e2: 20 91 99 03 lds r18, 0x0399 ; 0x800399 145e6: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 145ea: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 145ee: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 145f2: c7 01 movw r24, r14 145f4: b6 01 movw r22, r12 145f6: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 145fa: 18 16 cp r1, r24 145fc: 3c f4 brge .+14 ; 0x1460c { delay_keep_alive(1000); 145fe: 88 ee ldi r24, 0xE8 ; 232 14600: 93 e0 ldi r25, 0x03 ; 3 14602: 0e 94 6c 8c call 0x118d8 ; 0x118d8 serialecho_temperatures(); 14606: 0e 94 de 76 call 0xedbc ; 0xedbc 1460a: eb cf rjmp .-42 ; 0x145e2 } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1460c: 80 e0 ldi r24, 0x00 ; 0 1460e: 90 e0 ldi r25, 0x00 ; 0 14610: a0 ea ldi r26, 0xA0 ; 160 14612: b0 e4 ldi r27, 0x40 ; 64 14614: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14618: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1461c: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 14620: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14624: 60 e0 ldi r22, 0x00 ; 0 14626: 70 e0 ldi r23, 0x00 ; 0 14628: 88 e4 ldi r24, 0x48 ; 72 1462a: 92 e4 ldi r25, 0x42 ; 66 1462c: 0f 94 81 c0 call 0x38102 ; 0x38102 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14630: ef ee ldi r30, 0xEF ; 239 14632: f4 ea ldi r31, 0xA4 ; 164 14634: 85 91 lpm r24, Z+ 14636: 95 91 lpm r25, Z+ 14638: a5 91 lpm r26, Z+ 1463a: b4 91 lpm r27, Z 1463c: 80 93 92 06 sts 0x0692, r24 ; 0x800692 14640: 90 93 93 06 sts 0x0693, r25 ; 0x800693 14644: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14648: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1464c: e3 ef ldi r30, 0xF3 ; 243 1464e: f4 ea ldi r31, 0xA4 ; 164 14650: 85 91 lpm r24, Z+ 14652: 95 91 lpm r25, Z+ 14654: a5 91 lpm r26, Z+ 14656: b4 91 lpm r27, Z 14658: 80 93 96 06 sts 0x0696, r24 ; 0x800696 1465c: 90 93 97 06 sts 0x0697, r25 ; 0x800697 14660: a0 93 98 06 sts 0x0698, r26 ; 0x800698 14664: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 14668: 60 e0 ldi r22, 0x00 ; 0 1466a: 70 e0 ldi r23, 0x00 ; 0 1466c: 88 e4 ldi r24, 0x48 ; 72 1466e: 92 e4 ldi r25, 0x42 ; 66 14670: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 14674: 0f 94 ed 43 call 0x287da ; 0x287da find_z_result = find_bed_induction_sensor_point_z(-1.f); 14678: 43 e0 ldi r20, 0x03 ; 3 1467a: 60 e0 ldi r22, 0x00 ; 0 1467c: 70 e0 ldi r23, 0x00 ; 0 1467e: 80 e8 ldi r24, 0x80 ; 128 14680: 9f eb ldi r25, 0xBF ; 191 14682: 0f 94 8f 8c call 0x3191e ; 0x3191e 14686: 95 e0 ldi r25, 0x05 ; 5 14688: 29 0e add r2, r25 1468a: 31 1c adc r3, r1 1468c: 0f 5f subi r16, 0xFF ; 255 1468e: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 14690: 81 11 cpse r24, r1 14692: 04 c0 rjmp .+8 ; 0x1469c lcd_temp_cal_show_result(find_z_result); 14694: 0f 94 41 21 call 0x24282 ; 0x24282 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); 14698: 81 e0 ldi r24, 0x01 ; 1 1469a: 9e ce rjmp .-708 ; 0x143d8 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]); 1469c: 67 96 adiw r28, 0x17 ; 23 1469e: 7f ad ldd r23, Y+63 ; 0x3f 146a0: 67 97 sbiw r28, 0x17 ; 23 146a2: 6b 96 adiw r28, 0x1b ; 27 146a4: 6f ad ldd r22, Y+63 ; 0x3f 146a6: 6b 97 sbiw r28, 0x1b ; 27 146a8: 6f 96 adiw r28, 0x1f ; 31 146aa: 9f ad ldd r25, Y+63 ; 0x3f 146ac: 6f 97 sbiw r28, 0x1f ; 31 146ae: a7 96 adiw r28, 0x27 ; 39 146b0: 8f ad ldd r24, Y+63 ; 0x3f 146b2: a7 97 sbiw r28, 0x27 ; 39 146b4: 27 2f mov r18, r23 146b6: 36 2f mov r19, r22 146b8: 49 2f mov r20, r25 146ba: 58 2f mov r21, r24 146bc: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 146c0: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 146c4: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 146c8: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 146cc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 146d0: f6 2e mov r15, r22 146d2: e7 2e mov r14, r23 146d4: d8 2e mov r13, r24 146d6: c9 2e mov r12, r25 146d8: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 146dc: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 146e0: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 146e4: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 146e8: d7 01 movw r26, r14 146ea: f6 01 movw r30, r12 146ec: 6b 2f mov r22, r27 146ee: 7a 2f mov r23, r26 146f0: 8f 2f mov r24, r31 146f2: 9e 2f mov r25, r30 146f4: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 146f8: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 146fc: a6 96 adiw r28, 0x26 ; 38 146fe: 6c af std Y+60, r22 ; 0x3c 14700: 7d af std Y+61, r23 ; 0x3d 14702: 8e af std Y+62, r24 ; 0x3e 14704: 9f af std Y+63, r25 ; 0x3f 14706: 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); 14708: cf 92 push r12 1470a: df 92 push r13 1470c: ef 92 push r14 1470e: ff 92 push r15 14710: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 14714: 8f 93 push r24 14716: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1471a: 8f 93 push r24 1471c: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 14720: 8f 93 push r24 14722: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14726: 8f 93 push r24 14728: 9f 92 push r9 1472a: 8f 92 push r8 1472c: 0f 94 16 db call 0x3b62c ; 0x3b62c 14730: a4 96 adiw r28, 0x24 ; 36 14732: 6e ad ldd r22, Y+62 ; 0x3e 14734: 7f ad ldd r23, Y+63 ; 0x3f 14736: a4 97 sbiw r28, 0x24 ; 36 14738: c5 01 movw r24, r10 1473a: 0f 94 96 dc call 0x3b92c ; 0x3b92c 1473e: a2 e0 ldi r26, 0x02 ; 2 14740: aa 0e add r10, r26 14742: b1 1c adc r11, r1 14744: 0f b6 in r0, 0x3f ; 63 14746: f8 94 cli 14748: de bf out 0x3e, r29 ; 62 1474a: 0f be out 0x3f, r0 ; 63 1474c: cd bf out 0x3d, r28 ; 61 1474e: cb ce rjmp .-618 ; 0x144e6 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 14750: 80 e1 ldi r24, 0x10 ; 16 14752: 0e 94 1b ef call 0x1de36 ; 0x1de36 14756: 0c 94 04 9a jmp 0x13408 ; 0x13408 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 1475a: 80 e1 ldi r24, 0x10 ; 16 1475c: 0e 94 70 ef call 0x1dee0 ; 0x1dee0 14760: 0c 94 04 9a jmp 0x13408 ; 0x13408 /*! ### 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); 14764: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14768: 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; 1476a: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 1476e: 0c 94 04 9a jmp 0x13408 ; 0x13408 14772: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14776: 87 60 ori r24, 0x07 ; 7 14778: f8 cf rjmp .-16 ; 0x1476a plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 1477a: 0f 94 ed 43 call 0x287da ; 0x287da 1477e: f1 2c mov r15, r1 14780: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 14782: f8 01 movw r30, r16 14784: 81 91 ld r24, Z+ 14786: 8f 01 movw r16, r30 14788: 88 23 and r24, r24 1478a: d1 f0 breq .+52 ; 0x147c0 current_position[i] = values[i] + cs.add_homing[i]; 1478c: 97 01 movw r18, r14 1478e: 2e 56 subi r18, 0x6E ; 110 14790: 39 4f sbci r19, 0xF9 ; 249 14792: 59 01 movw r10, r18 14794: f3 01 movw r30, r6 14796: ee 0d add r30, r14 14798: ff 1d adc r31, r15 1479a: 20 81 ld r18, Z 1479c: 31 81 ldd r19, Z+1 ; 0x01 1479e: 42 81 ldd r20, Z+2 ; 0x02 147a0: 53 81 ldd r21, Z+3 ; 0x03 147a2: f7 01 movw r30, r14 147a4: ea 5e subi r30, 0xEA ; 234 147a6: f1 4f sbci r31, 0xF1 ; 241 147a8: 60 81 ld r22, Z 147aa: 71 81 ldd r23, Z+1 ; 0x01 147ac: 82 81 ldd r24, Z+2 ; 0x02 147ae: 93 81 ldd r25, Z+3 ; 0x03 147b0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 147b4: d5 01 movw r26, r10 147b6: 6d 93 st X+, r22 147b8: 7d 93 st X+, r23 147ba: 8d 93 st X+, r24 147bc: 9c 93 st X, r25 147be: 13 97 sbiw r26, 0x03 ; 3 147c0: b4 e0 ldi r27, 0x04 ; 4 147c2: eb 0e add r14, r27 147c4: 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) 147c6: ec e0 ldi r30, 0x0C ; 12 147c8: ee 16 cp r14, r30 147ca: f1 04 cpc r15, r1 147cc: d1 f6 brne .-76 ; 0x14782 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 147ce: dd 20 and r13, r13 147d0: 61 f0 breq .+24 ; 0x147ea current_position[E_AXIS] = values[E_AXIS]; 147d2: 8d 85 ldd r24, Y+13 ; 0x0d 147d4: 9e 85 ldd r25, Y+14 ; 0x0e 147d6: af 85 ldd r26, Y+15 ; 0x0f 147d8: b8 89 ldd r27, Y+16 ; 0x10 147da: 80 93 9e 06 sts 0x069E, r24 ; 0x80069e 147de: 90 93 9f 06 sts 0x069F, r25 ; 0x80069f 147e2: a0 93 a0 06 sts 0x06A0, r26 ; 0x8006a0 147e6: b0 93 a1 06 sts 0x06A1, r27 ; 0x8006a1 // Set all at once plan_set_position_curposXYZE(); 147ea: 0f 94 41 bf call 0x37e82 ; 0x37e82 147ee: 0c 94 04 9a jmp 0x13408 ; 0x13408 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 147f2: 8d 34 cpi r24, 0x4D ; 77 147f4: 11 f0 breq .+4 ; 0x147fa 147f6: 0c 94 8c cb jmp 0x19718 ; 0x19718 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 147fa: 10 93 96 03 sts 0x0396, r17 ; 0x800396 147fe: 00 93 95 03 sts 0x0395, r16 ; 0x800395 14802: f8 01 movw r30, r16 14804: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 14806: 81 91 ld r24, Z+ 14808: 80 32 cpi r24, 0x20 ; 32 1480a: e9 f3 breq .-6 ; 0x14806 1480c: 89 30 cpi r24, 0x09 ; 9 1480e: d9 f3 breq .-10 ; 0x14806 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 14810: 80 53 subi r24, 0x30 ; 48 14812: 8a 30 cpi r24, 0x0A ; 10 14814: 70 f0 brcs .+28 ; 0x14832 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14816: 1f 93 push r17 14818: 0f 93 push r16 1481a: 8d ef ldi r24, 0xFD ; 253 1481c: 96 e8 ldi r25, 0x86 ; 134 1481e: 9f 93 push r25 14820: 8f 93 push r24 14822: 0f 94 16 db call 0x3b62c ; 0x3b62c 14826: 0f 90 pop r0 14828: 0f 90 pop r0 1482a: 0f 90 pop r0 1482c: 0f 90 pop r0 1482e: 0c 94 c1 95 jmp 0x12b82 ; 0x12b82 } else { mcode_in_progress = code_value_short(); 14832: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 14836: 90 93 ab 0d sts 0x0DAB, r25 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.532+0x1> 1483a: 80 93 aa 0d sts 0x0DAA, r24 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.532> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1483e: 89 3c cpi r24, 0xC9 ; 201 14840: 91 05 cpc r25, r1 14842: 11 f4 brne .+4 ; 0x14848 14844: 0c 94 45 b8 jmp 0x1708a ; 0x1708a 14848: 0c f0 brlt .+2 ; 0x1484c 1484a: 40 c3 rjmp .+1664 ; 0x14ecc 1484c: 8e 34 cpi r24, 0x4E ; 78 1484e: 91 05 cpc r25, r1 14850: 11 f4 brne .+4 ; 0x14856 14852: 0c 94 a7 b3 jmp 0x1674e ; 0x1674e 14856: 0c f0 brlt .+2 ; 0x1485a 14858: 35 c2 rjmp .+1130 ; 0x14cc4 1485a: 8c 31 cpi r24, 0x1C ; 28 1485c: 91 05 cpc r25, r1 1485e: 11 f4 brne .+4 ; 0x14864 14860: 0c 94 06 b2 jmp 0x1640c ; 0x1640c 14864: 0c f0 brlt .+2 ; 0x14868 14866: 00 c1 rjmp .+512 ; 0x14a68 14868: 85 31 cpi r24, 0x15 ; 21 1486a: 91 05 cpc r25, r1 1486c: 11 f4 brne .+4 ; 0x14872 1486e: 0c 94 1f b1 jmp 0x1623e ; 0x1623e 14872: 0c f0 brlt .+2 ; 0x14876 14874: 5e c0 rjmp .+188 ; 0x14932 14876: 81 31 cpi r24, 0x11 ; 17 14878: 91 05 cpc r25, r1 1487a: 11 f4 brne .+4 ; 0x14880 1487c: 0c 94 14 b1 jmp 0x16228 ; 0x16228 14880: ec f4 brge .+58 ; 0x148bc 14882: 02 97 sbiw r24, 0x02 ; 2 14884: 10 f4 brcc .+4 ; 0x1488a 14886: 0c 94 88 b0 jmp 0x16110 ; 0x16110 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 1488a: 80 91 92 12 lds r24, 0x1292 ; 0x801292 1488e: 90 91 93 12 lds r25, 0x1293 ; 0x801293 14892: 88 55 subi r24, 0x58 ; 88 14894: 9f 4e sbci r25, 0xEF ; 239 14896: 9f 93 push r25 14898: 8f 93 push r24 1489a: 1f 92 push r1 1489c: 8d e4 ldi r24, 0x4D ; 77 1489e: 8f 93 push r24 148a0: 86 ea ldi r24, 0xA6 ; 166 148a2: 98 e6 ldi r25, 0x68 ; 104 148a4: 9f 93 push r25 148a6: 8f 93 push r24 148a8: 0f 94 16 db call 0x3b62c ; 0x3b62c 148ac: 0f 90 pop r0 148ae: 0f 90 pop r0 148b0: 0f 90 pop r0 148b2: 0f 90 pop r0 148b4: 0f 90 pop r0 148b6: 0f 90 pop r0 148b8: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 148bc: 82 31 cpi r24, 0x12 ; 18 148be: 91 05 cpc r25, r1 148c0: 11 f4 brne .+4 ; 0x148c6 148c2: 0c 94 5e b5 jmp 0x16abc ; 0x16abc 148c6: 44 97 sbiw r24, 0x14 ; 20 148c8: 01 f7 brne .-64 ; 0x1488a #### 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() 148ca: 81 e0 ldi r24, 0x01 ; 1 148cc: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 148d0: 86 e9 ldi r24, 0x96 ; 150 148d2: 98 e6 ldi r25, 0x68 ; 104 148d4: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 148d8: 84 e5 ldi r24, 0x54 ; 84 148da: 0e 94 56 5b call 0xb6ac ; 0xb6ac 148de: 18 2f mov r17, r24 148e0: 8c e4 ldi r24, 0x4C ; 76 148e2: 0e 94 56 5b call 0xb6ac ; 0xb6ac 148e6: 00 e0 ldi r16, 0x00 ; 0 148e8: 80 fb bst r24, 0 148ea: 00 f9 bld r16, 0 148ec: 10 fb bst r17, 0 148ee: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 148f0: 86 e1 ldi r24, 0x16 ; 22 148f2: 95 e1 ldi r25, 0x15 ; 21 148f4: 0e 94 ac 76 call 0xed58 ; 0xed58 lsDive("",root, NULL, LS_SerialPrint, params); 148f8: 83 e2 ldi r24, 0x23 ; 35 148fa: e6 e1 ldi r30, 0x16 ; 22 148fc: f5 e1 ldi r31, 0x15 ; 21 148fe: de 01 movw r26, r28 14900: 11 96 adiw r26, 0x01 ; 1 14902: 01 90 ld r0, Z+ 14904: 0d 92 st X+, r0 14906: 8a 95 dec r24 14908: e1 f7 brne .-8 ; 0x14902 1490a: 20 e0 ldi r18, 0x00 ; 0 1490c: 50 e0 ldi r21, 0x00 ; 0 1490e: 40 e0 ldi r20, 0x00 ; 0 14910: be 01 movw r22, r28 14912: 6f 5f subi r22, 0xFF ; 255 14914: 7f 4f sbci r23, 0xFF ; 255 14916: 88 ef ldi r24, 0xF8 ; 248 14918: 92 e0 ldi r25, 0x02 ; 2 1491a: 0f 94 4a 78 call 0x2f094 ; 0x2f094 1491e: ce 01 movw r24, r28 14920: 01 96 adiw r24, 0x01 ; 1 14922: 0e 94 b1 76 call 0xed62 ; 0xed62 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14926: 88 e8 ldi r24, 0x88 ; 136 14928: 98 e6 ldi r25, 0x68 ; 104 1492a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 1492e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14932: 88 31 cpi r24, 0x18 ; 24 14934: 91 05 cpc r25, r1 14936: 11 f4 brne .+4 ; 0x1493c 14938: 0c 94 30 b1 jmp 0x16260 ; 0x16260 1493c: 94 f4 brge .+36 ; 0x14962 1493e: 86 31 cpi r24, 0x16 ; 22 14940: 91 05 cpc r25, r1 14942: 11 f4 brne .+4 ; 0x14948 14944: 0c 94 23 b1 jmp 0x16246 ; 0x16246 14948: 47 97 sbiw r24, 0x17 ; 23 1494a: 09 f0 breq .+2 ; 0x1494e 1494c: 9e cf rjmp .-196 ; 0x1488a M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 1494e: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14952: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14956: 61 e0 ldi r22, 0x01 ; 1 14958: 04 96 adiw r24, 0x04 ; 4 1495a: 0f 94 86 80 call 0x3010c ; 0x3010c 1495e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14962: 8a 31 cpi r24, 0x1A ; 26 14964: 91 05 cpc r25, r1 14966: 11 f4 brne .+4 ; 0x1496c 14968: 0c 94 76 b1 jmp 0x162ec ; 0x162ec 1496c: 14 f0 brlt .+4 ; 0x14972 1496e: 0c 94 98 b1 jmp 0x16330 ; 0x16330 14972: 0d ed ldi r16, 0xDD ; 221 14974: 12 e0 ldi r17, 0x02 ; 2 14976: ff e3 ldi r31, 0x3F ; 63 14978: af 2e mov r10, r31 1497a: f2 e0 ldi r31, 0x02 ; 2 1497c: bf 2e mov r11, r31 1497e: a1 e2 ldi r26, 0x21 ; 33 14980: ca 2e mov r12, r26 14982: a2 e0 ldi r26, 0x02 ; 2 14984: da 2e mov r13, r26 14986: b5 e1 ldi r27, 0x15 ; 21 14988: eb 2e mov r14, r27 1498a: b2 e0 ldi r27, 0x02 ; 2 1498c: fb 2e mov r15, r27 1498e: 80 ee ldi r24, 0xE0 ; 224 14990: 88 2e mov r8, r24 14992: 82 e0 ldi r24, 0x02 ; 2 14994: 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])) { 14996: f8 01 movw r30, r16 14998: 81 91 ld r24, Z+ 1499a: 8f 01 movw r16, r30 1499c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 149a0: 88 23 and r24, r24 149a2: 21 f1 breq .+72 ; 0x149ec //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 149a4: 0e 94 1d 60 call 0xc03a ; 0xc03a 149a8: d6 01 movw r26, r12 149aa: 4d 90 ld r4, X+ 149ac: 5d 90 ld r5, X+ 149ae: 6d 90 ld r6, X+ 149b0: 7c 90 ld r7, X 149b2: a3 01 movw r20, r6 149b4: 92 01 movw r18, r4 149b6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 149ba: 87 fd sbrc r24, 7 149bc: 11 c0 rjmp .+34 ; 0x149e0 149be: 0e 94 1d 60 call 0xc03a ; 0xc03a 149c2: f7 01 movw r30, r14 149c4: 40 80 ld r4, Z 149c6: 51 80 ldd r5, Z+1 ; 0x01 149c8: 62 80 ldd r6, Z+2 ; 0x02 149ca: 73 80 ldd r7, Z+3 ; 0x03 149cc: a3 01 movw r20, r6 149ce: 92 01 movw r18, r4 149d0: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 149d4: 18 16 cp r1, r24 149d6: 24 f0 brlt .+8 ; 0x149e0 149d8: 0e 94 1d 60 call 0xc03a ; 0xc03a 149dc: 2b 01 movw r4, r22 149de: 3c 01 movw r6, r24 149e0: d5 01 movw r26, r10 149e2: 4d 92 st X+, r4 149e4: 5d 92 st X+, r5 149e6: 6d 92 st X+, r6 149e8: 7c 92 st X, r7 149ea: 13 97 sbiw r26, 0x03 ; 3 149ec: b4 e0 ldi r27, 0x04 ; 4 149ee: ab 0e add r10, r27 149f0: b1 1c adc r11, r1 149f2: e4 e0 ldi r30, 0x04 ; 4 149f4: ce 0e add r12, r30 149f6: d1 1c adc r13, r1 149f8: f4 e0 ldi r31, 0x04 ; 4 149fa: ef 0e add r14, r31 149fc: 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++) { 149fe: 80 16 cp r8, r16 14a00: 91 06 cpc r9, r17 14a02: 49 f6 brne .-110 ; 0x14996 //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')) { 14a04: 83 e5 ldi r24, 0x53 ; 83 14a06: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14a0a: 88 23 and r24, r24 14a0c: 11 f4 brne .+4 ; 0x14a12 14a0e: 0c 94 0a c4 jmp 0x18814 ; 0x18814 if ( code_value_uint8() == 0 ) { 14a12: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 14a16: 81 11 cpse r24, r1 14a18: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 pause_position[X_AXIS] = X_PAUSE_POS; 14a1c: 80 e0 ldi r24, 0x00 ; 0 14a1e: 90 e0 ldi r25, 0x00 ; 0 14a20: a8 e4 ldi r26, 0x48 ; 72 14a22: b2 e4 ldi r27, 0x42 ; 66 14a24: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.483> 14a28: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.483+0x1> 14a2c: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.483+0x2> 14a30: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.483+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14a34: 80 e0 ldi r24, 0x00 ; 0 14a36: 90 e0 ldi r25, 0x00 ; 0 14a38: ae e3 ldi r26, 0x3E ; 62 14a3a: b3 e4 ldi r27, 0x43 ; 67 14a3c: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.483+0x4> 14a40: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.483+0x5> 14a44: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.483+0x6> 14a48: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.483+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14a4c: 80 e0 ldi r24, 0x00 ; 0 14a4e: 90 e0 ldi r25, 0x00 ; 0 14a50: a0 ea ldi r26, 0xA0 ; 160 14a52: b1 e4 ldi r27, 0x41 ; 65 14a54: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.483+0x8> 14a58: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.483+0x9> 14a5c: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.483+0xa> 14a60: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.483+0xb> 14a64: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14a68: 8d 32 cpi r24, 0x2D ; 45 14a6a: 91 05 cpc r25, r1 14a6c: 11 f4 brne .+4 ; 0x14a72 14a6e: 0c 94 ab b2 jmp 0x16556 ; 0x16556 14a72: 0c f0 brlt .+2 ; 0x14a76 14a74: f0 c0 rjmp .+480 ; 0x14c56 14a76: 8f 31 cpi r24, 0x1F ; 31 14a78: 91 05 cpc r25, r1 14a7a: 11 f4 brne .+4 ; 0x14a80 14a7c: 0c 94 38 b2 jmp 0x16470 ; 0x16470 14a80: 0c f0 brlt .+2 ; 0x14a84 14a82: 6a c0 rjmp .+212 ; 0x14b58 14a84: 8d 31 cpi r24, 0x1D ; 29 14a86: 91 05 cpc r25, r1 14a88: 11 f4 brne .+4 ; 0x14a8e 14a8a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 14a8e: 4e 97 sbiw r24, 0x1e ; 30 14a90: 09 f0 breq .+2 ; 0x14a94 14a92: fb ce rjmp .-522 ; 0x1488a M30 [filename] */ case 30: if (card.mounted){ 14a94: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14a98: 88 23 and r24, r24 14a9a: 11 f4 brne .+4 ; 0x14aa0 14a9c: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14aa0: 80 e2 ldi r24, 0x20 ; 32 14aa2: 97 e1 ldi r25, 0x17 ; 23 14aa4: 0f 94 76 59 call 0x2b2ec ; 0x2b2ec file.close(); 14aa8: 80 e2 ldi r24, 0x20 ; 32 14aaa: 97 e1 ldi r25, 0x17 ; 23 14aac: 0f 94 ab 59 call 0x2b356 ; 0x2b356 saving = false; 14ab0: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 14ab4: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f card.closefile(); card.removeFile(strchr_pointer + 4); 14ab8: 00 91 95 03 lds r16, 0x0395 ; 0x800395 14abc: 10 91 96 03 lds r17, 0x0396 ; 0x800396 14ac0: 0c 5f subi r16, 0xFC ; 252 14ac2: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14ac4: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14ac8: 88 23 and r24, r24 14aca: 11 f4 brne .+4 ; 0x14ad0 14acc: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 file.close(); 14ad0: 80 e2 ldi r24, 0x20 ; 32 14ad2: 97 e1 ldi r25, 0x17 ; 23 14ad4: 0f 94 ab 59 call 0x2b356 ; 0x2b356 sdprinting = false; 14ad8: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 14adc: 23 96 adiw r28, 0x03 ; 3 14ade: 1f af std Y+63, r17 ; 0x3f 14ae0: 0e af std Y+62, r16 ; 0x3e 14ae2: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 14ae4: ce 01 movw r24, r28 14ae6: 8f 5b subi r24, 0xBF ; 191 14ae8: 9f 4f sbci r25, 0xFF ; 255 14aea: 0f 94 01 80 call 0x30002 ; 0x30002 14aee: 88 23 and r24, r24 14af0: 11 f4 brne .+4 ; 0x14af6 14af2: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 return; if (file.remove(curDir, fname)) 14af6: 23 96 adiw r28, 0x03 ; 3 14af8: 4e ad ldd r20, Y+62 ; 0x3e 14afa: 5f ad ldd r21, Y+63 ; 0x3f 14afc: 23 97 sbiw r28, 0x03 ; 3 14afe: 60 91 39 15 lds r22, 0x1539 ; 0x801539 14b02: 70 91 3a 15 lds r23, 0x153A ; 0x80153a * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 14b06: 19 82 std Y+1, r1 ; 0x01 14b08: 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; 14b0a: 22 e0 ldi r18, 0x02 ; 2 14b0c: ce 01 movw r24, r28 14b0e: 01 96 adiw r24, 0x01 ; 1 14b10: 0f 94 53 65 call 0x2caa6 ; 0x2caa6 14b14: 81 11 cpse r24, r1 14b16: 0c 94 0e b2 jmp 0x1641c ; 0x1641c return file.remove(); fail: // can't set iostate - static function return false; 14b1a: 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; 14b1c: ce 01 movw r24, r28 14b1e: 01 96 adiw r24, 0x01 ; 1 14b20: 0e 94 b1 76 call 0xed62 ; 0xed62 14b24: 11 23 and r17, r17 14b26: 11 f4 brne .+4 ; 0x14b2c 14b28: 0c 94 28 b2 jmp 0x16450 ; 0x16450 { SERIAL_PROTOCOLPGM("File deleted:"); 14b2c: 85 e2 ldi r24, 0x25 ; 37 14b2e: 94 e8 ldi r25, 0x84 ; 132 14b30: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLLN(fname); 14b34: 23 96 adiw r28, 0x03 ; 3 14b36: 8e ad ldd r24, Y+62 ; 0x3e 14b38: 9f ad ldd r25, Y+63 ; 0x3f 14b3a: 23 97 sbiw r28, 0x03 ; 3 14b3c: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 sdpos = 0; 14b40: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 14b44: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 14b48: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 14b4c: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 #ifdef SDCARD_SORT_ALPHA presort(); 14b50: 0f 94 cd 7d call 0x2fb9a ; 0x2fb9a 14b54: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14b58: 8a 32 cpi r24, 0x2A ; 42 14b5a: 91 05 cpc r25, r1 14b5c: 11 f4 brne .+4 ; 0x14b62 14b5e: 0c 94 5f b2 jmp 0x164be ; 0x164be 14b62: 8c 32 cpi r24, 0x2C ; 44 14b64: 91 05 cpc r25, r1 14b66: 11 f4 brne .+4 ; 0x14b6c 14b68: 0c 94 92 b2 jmp 0x16524 ; 0x16524 14b6c: 80 97 sbiw r24, 0x20 ; 32 14b6e: 09 f0 breq .+2 ; 0x14b72 14b70: 8c ce rjmp .-744 ; 0x1488a - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14b72: 80 91 90 14 lds r24, 0x1490 ; 0x801490 14b76: 81 11 cpse r24, r1 st_synchronize(); 14b78: 0f 94 ed 43 call 0x287da ; 0x287da } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 14b7c: 00 91 95 03 lds r16, 0x0395 ; 0x800395 14b80: 10 91 96 03 lds r17, 0x0396 ; 0x800396 14b84: 0c 5f subi r16, 0xFC ; 252 14b86: 1f 4f sbci r17, 0xFF ; 255 14b88: 61 e2 ldi r22, 0x21 ; 33 14b8a: 70 e0 ldi r23, 0x00 ; 0 14b8c: c8 01 movw r24, r16 14b8e: 0f 94 ab e2 call 0x3c556 ; 0x3c556 if(namestartpos==NULL) 14b92: 00 97 sbiw r24, 0x00 ; 0 14b94: 19 f0 breq .+6 ; 0x14b9c { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 14b96: 8c 01 movw r16, r24 14b98: 0f 5f subi r16, 0xFF ; 255 14b9a: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 14b9c: 80 e5 ldi r24, 0x50 ; 80 14b9e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14ba2: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 14ba4: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14ba8: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14bac: 08 17 cp r16, r24 14bae: 19 07 cpc r17, r25 14bb0: 08 f4 brcc .+2 ; 0x14bb4 call_procedure=false; //false alert, 'P' found within filename 14bb2: f1 2c mov r15, r1 if( card.mounted ) 14bb4: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14bb8: 88 23 and r24, r24 14bba: 11 f4 brne .+4 ; 0x14bc0 14bbc: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 14bc0: 61 e0 ldi r22, 0x01 ; 1 14bc2: 6f 25 eor r22, r15 14bc4: c8 01 movw r24, r16 14bc6: 0f 94 86 80 call 0x3010c ; 0x3010c if(code_seen('S')) 14bca: 83 e5 ldi r24, 0x53 ; 83 14bcc: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14bd0: 88 23 and r24, r24 14bd2: 99 f0 breq .+38 ; 0x14bfa if(strchr_pointer 14bd8: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14bdc: 80 17 cp r24, r16 14bde: 91 07 cpc r25, r17 14be0: 60 f4 brcc .+24 ; 0x14bfa card.setIndex(code_value_long()); 14be2: 0e 94 02 5b call 0xb604 ; 0xb604 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 14be6: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 14bea: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 14bee: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 14bf2: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 14bf6: 0f 94 d7 76 call 0x2edae ; 0x2edae SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 14bfa: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14bfe: 88 23 and r24, r24 14c00: 31 f0 breq .+12 ; 0x14c0e { sdprinting = true; 14c02: 81 e0 ldi r24, 0x01 ; 1 14c04: 80 93 90 14 sts 0x1490, r24 ; 0x801490 14c08: 85 e0 ldi r24, 0x05 ; 5 14c0a: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> card.startFileprint(); if(!call_procedure) 14c0e: f1 10 cpse r15, r1 14c10: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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); }; 14c14: 80 91 23 17 lds r24, 0x1723 ; 0x801723 14c18: 88 23 and r24, r24 14c1a: 61 f0 breq .+24 ; 0x14c34 { if(!card.get_sdpos()) 14c1c: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 14c20: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 14c24: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 14c28: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 14c2c: 89 2b or r24, r25 14c2e: 8a 2b or r24, r26 14c30: 8b 2b or r24, r27 14c32: 69 f4 brne .+26 ; 0x14c4e { // A new print has started from scratch, reset stats failstats_reset_print(); 14c34: 0e 94 a4 5b call 0xb748 ; 0xb748 sdpos_atomic = 0; 14c38: 10 92 82 03 sts 0x0382, r1 ; 0x800382 14c3c: 10 92 83 03 sts 0x0383, r1 ; 0x800383 14c40: 10 92 84 03 sts 0x0384, r1 ; 0x800384 14c44: 10 92 85 03 sts 0x0385, r1 ; 0x800385 14c48: 80 e0 ldi r24, 0x00 ; 0 14c4a: 0e 94 97 81 call 0x1032e ; 0x1032e #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 14c4e: 0f 94 92 43 call 0x28724 ; 0x28724 14c52: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14c56: 89 34 cpi r24, 0x49 ; 73 14c58: 91 05 cpc r25, r1 14c5a: 11 f4 brne .+4 ; 0x14c60 14c5c: 0c 94 ef b2 jmp 0x165de ; 0x165de 14c60: f4 f4 brge .+60 ; 0x14c9e 14c62: 8e 32 cpi r24, 0x2E ; 46 14c64: 91 05 cpc r25, r1 14c66: 11 f4 brne .+4 ; 0x14c6c 14c68: 0c 94 b1 b2 jmp 0x16562 ; 0x16562 14c6c: 88 34 cpi r24, 0x48 ; 72 14c6e: 91 05 cpc r25, r1 14c70: 09 f0 breq .+2 ; 0x14c74 14c72: 0b ce rjmp .-1002 ; 0x1488a #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 14c74: 83 e5 ldi r24, 0x53 ; 83 14c76: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14c7a: 88 23 and r24, r24 14c7c: 11 f4 brne .+4 ; 0x14c82 14c7e: 0c 94 e0 b2 jmp 0x165c0 ; 0x165c0 switch (code_value_uint8()){ 14c82: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 14c86: 88 23 and r24, r24 14c88: 11 f4 brne .+4 ; 0x14c8e 14c8a: 0c 94 dd b2 jmp 0x165ba ; 0x165ba 14c8e: 81 30 cpi r24, 0x01 ; 1 14c90: 11 f0 breq .+4 ; 0x14c96 14c92: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 14c96: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 14c9a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14c9e: 8c 34 cpi r24, 0x4C ; 76 14ca0: 91 05 cpc r25, r1 14ca2: 11 f4 brne .+4 ; 0x14ca8 14ca4: 0c 94 8f b3 jmp 0x1671e ; 0x1671e 14ca8: 14 f0 brlt .+4 ; 0x14cae 14caa: 0c 94 a2 b3 jmp 0x16744 ; 0x16744 14cae: 8b 34 cpi r24, 0x4B ; 75 14cb0: 91 05 cpc r25, r1 14cb2: 09 f0 breq .+2 ; 0x14cb6 14cb4: ea cd rjmp .-1068 ; 0x1488a /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 14cb6: 0e 94 e0 f5 call 0x1ebc0 ; 0x1ebc0 14cba: 88 23 and r24, r24 14cbc: 11 f4 brne .+4 ; 0x14cc2 14cbe: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 14cc2: c5 cf rjmp .-118 ; 0x14c4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14cc4: 8e 36 cpi r24, 0x6E ; 110 14cc6: 91 05 cpc r25, r1 14cc8: 11 f4 brne .+4 ; 0x14cce 14cca: 0c 94 55 b6 jmp 0x16caa ; 0x16caa 14cce: 0c f0 brlt .+2 ; 0x14cd2 14cd0: 86 c0 rjmp .+268 ; 0x14dde 14cd2: 86 35 cpi r24, 0x56 ; 86 14cd4: 91 05 cpc r25, r1 14cd6: 11 f4 brne .+4 ; 0x14cdc 14cd8: 0c 94 ae b5 jmp 0x16b5c ; 0x16b5c 14cdc: d4 f5 brge .+116 ; 0x14d52 14cde: 83 35 cpi r24, 0x53 ; 83 14ce0: 91 05 cpc r25, r1 14ce2: 11 f4 brne .+4 ; 0x14ce8 14ce4: 0c 94 58 b5 jmp 0x16ab0 ; 0x16ab0 14ce8: 84 f4 brge .+32 ; 0x14d0a 14cea: 8f 34 cpi r24, 0x4F ; 79 14cec: 91 05 cpc r25, r1 14cee: 11 f4 brne .+4 ; 0x14cf4 14cf0: 0c 94 12 b4 jmp 0x16824 ; 0x16824 14cf4: 82 35 cpi r24, 0x52 ; 82 14cf6: 91 05 cpc r25, r1 14cf8: 09 f0 breq .+2 ; 0x14cfc 14cfa: c7 cd rjmp .-1138 ; 0x1488a /*! ### 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; 14cfc: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14d00: 87 7f andi r24, 0xF7 ; 247 14d02: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 14d06: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d0a: 84 35 cpi r24, 0x54 ; 84 14d0c: 91 05 cpc r25, r1 14d0e: 11 f4 brne .+4 ; 0x14d14 14d10: 0c 94 5e b5 jmp 0x16abc ; 0x16abc 14d14: 85 35 cpi r24, 0x55 ; 85 14d16: 91 05 cpc r25, r1 14d18: 09 f0 breq .+2 ; 0x14d1c 14d1a: b7 cd rjmp .-1170 ; 0x1488a #### 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')) { 14d1c: 83 e5 ldi r24, 0x53 ; 83 14d1e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14d22: 88 23 and r24, r24 14d24: 11 f4 brne .+4 ; 0x14d2a 14d26: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 max_inactive_time = code_value() * 1000; 14d2a: 0e 94 1d 60 call 0xc03a ; 0xc03a 14d2e: 20 e0 ldi r18, 0x00 ; 0 14d30: 30 e0 ldi r19, 0x00 ; 0 14d32: 4a e7 ldi r20, 0x7A ; 122 14d34: 54 e4 ldi r21, 0x44 ; 68 14d36: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 14d3a: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 14d3e: 60 93 7e 03 sts 0x037E, r22 ; 0x80037e 14d42: 70 93 7f 03 sts 0x037F, r23 ; 0x80037f 14d46: 80 93 80 03 sts 0x0380, r24 ; 0x800380 14d4a: 90 93 81 03 sts 0x0381, r25 ; 0x800381 14d4e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d52: 89 36 cpi r24, 0x69 ; 105 14d54: 91 05 cpc r25, r1 14d56: 11 f4 brne .+4 ; 0x14d5c 14d58: 0c 94 6e b4 jmp 0x168dc ; 0x168dc 14d5c: d4 f4 brge .+52 ; 0x14d92 14d5e: 8c 35 cpi r24, 0x5C ; 92 14d60: 91 05 cpc r25, r1 14d62: 11 f4 brne .+4 ; 0x14d68 14d64: 0c 94 cb b5 jmp 0x16b96 ; 0x16b96 14d68: 88 36 cpi r24, 0x68 ; 104 14d6a: 91 05 cpc r25, r1 14d6c: 09 f0 breq .+2 ; 0x14d70 14d6e: 8d cd rjmp .-1254 ; 0x1488a #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 14d70: 83 e5 ldi r24, 0x53 ; 83 14d72: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14d76: 88 23 and r24, r24 14d78: 11 f4 brne .+4 ; 0x14d7e 14d7a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { setTargetHotend(code_value()); 14d7e: 0e 94 1d 60 call 0xc03a ; 0xc03a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14d82: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 14d86: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 14d8a: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 14d8e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d92: 8b 36 cpi r24, 0x6B ; 107 14d94: 91 05 cpc r25, r1 14d96: 11 f4 brne .+4 ; 0x14d9c 14d98: 0c 94 55 b5 jmp 0x16aaa ; 0x16aaa 14d9c: 14 f4 brge .+4 ; 0x14da2 14d9e: 0c 94 47 b5 jmp 0x16a8e ; 0x16a8e 14da2: 8d 36 cpi r24, 0x6D ; 109 14da4: 91 05 cpc r25, r1 14da6: 09 f0 breq .+2 ; 0x14daa 14da8: 70 cd rjmp .-1312 ; 0x1488a 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)); 14daa: 8b e6 ldi r24, 0x6B ; 107 14dac: 9d e4 ldi r25, 0x4D ; 77 14dae: 0e 94 2c 72 call 0xe458 ; 0xe458 14db2: 0e 94 3b f2 call 0x1e476 ; 0x1e476 heating_status = HeatingStatus::EXTRUDER_HEATING; 14db6: 81 e0 ldi r24, 0x01 ; 1 14db8: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 14dbc: 83 e5 ldi r24, 0x53 ; 83 14dbe: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14dc2: 88 23 and r24, r24 14dc4: 11 f4 brne .+4 ; 0x14dca 14dc6: 0c 94 82 b4 jmp 0x16904 ; 0x16904 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 14dca: 0e 94 1d 60 call 0xc03a ; 0xc03a 14dce: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 14dd2: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 14dd6: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 14dda: 0c 94 88 b4 jmp 0x16910 ; 0x16910 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14dde: 87 37 cpi r24, 0x77 ; 119 14de0: 91 05 cpc r25, r1 14de2: 11 f4 brne .+4 ; 0x14de8 14de4: 0c 94 9a b7 jmp 0x16f34 ; 0x16f34 14de8: ac f5 brge .+106 ; 0x14e54 14dea: 82 37 cpi r24, 0x72 ; 114 14dec: 91 05 cpc r25, r1 14dee: 11 f4 brne .+4 ; 0x14df4 14df0: 0c 94 4f b7 jmp 0x16e9e ; 0x16e9e 14df4: b4 f4 brge .+44 ; 0x14e22 14df6: 80 37 cpi r24, 0x70 ; 112 14df8: 91 05 cpc r25, r1 14dfa: 11 f4 brne .+4 ; 0x14e00 14dfc: 0c 94 5b b4 jmp 0x168b6 ; 0x168b6 14e00: 81 37 cpi r24, 0x71 ; 113 14e02: 91 05 cpc r25, r1 14e04: 09 f0 breq .+2 ; 0x14e08 14e06: 41 cd rjmp .-1406 ; 0x1488a #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 14e08: 83 e5 ldi r24, 0x53 ; 83 14e0a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14e0e: 88 23 and r24, r24 14e10: 11 f4 brne .+4 ; 0x14e16 14e12: 0c 94 66 b6 jmp 0x16ccc ; 0x16ccc host_keepalive_interval = code_value_uint8(); 14e16: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 14e1a: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 14e1e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e22: 85 37 cpi r24, 0x75 ; 117 14e24: 91 05 cpc r25, r1 14e26: 11 f4 brne .+4 ; 0x14e2c 14e28: 0c 94 52 b7 jmp 0x16ea4 ; 0x16ea4 14e2c: 14 f0 brlt .+4 ; 0x14e32 14e2e: 0c 94 62 b7 jmp 0x16ec4 ; 0x16ec4 14e32: 83 37 cpi r24, 0x73 ; 115 14e34: 91 05 cpc r25, r1 14e36: 09 f0 breq .+2 ; 0x14e3a 14e38: 28 cd rjmp .-1456 ; 0x1488a #### 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')) { 14e3a: 86 e5 ldi r24, 0x56 ; 86 14e3c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14e40: 88 23 and r24, r24 14e42: 11 f4 brne .+4 ; 0x14e48 14e44: 0c 94 7b b6 jmp 0x16cf6 ; 0x16cf6 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 14e48: 86 e0 ldi r24, 0x06 ; 6 14e4a: 94 e8 ldi r25, 0x84 ; 132 14e4c: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 14e50: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e54: 8c 38 cpi r24, 0x8C ; 140 14e56: 91 05 cpc r25, r1 14e58: 11 f4 brne .+4 ; 0x14e5e 14e5a: 0c 94 5f b4 jmp 0x168be ; 0x168be 14e5e: 54 f4 brge .+20 ; 0x14e74 14e60: 8b 37 cpi r24, 0x7B ; 123 14e62: 91 05 cpc r25, r1 14e64: 11 f4 brne .+4 ; 0x14e6a 14e66: 0c 94 ff b7 jmp 0x16ffe ; 0x16ffe 14e6a: 8d 37 cpi r24, 0x7D ; 125 14e6c: 91 05 cpc r25, r1 14e6e: 09 f4 brne .+2 ; 0x14e72 14e70: 80 cd rjmp .-1280 ; 0x14972 14e72: 0b cd rjmp .-1514 ; 0x1488a 14e74: 8e 3b cpi r24, 0xBE ; 190 14e76: 91 05 cpc r25, r1 14e78: 11 f4 brne .+4 ; 0x14e7e 14e7a: 0c 94 b8 b4 jmp 0x16970 ; 0x16970 14e7e: 88 3c cpi r24, 0xC8 ; 200 14e80: 91 05 cpc r25, r1 14e82: 11 f4 brne .+4 ; 0x14e88 14e84: 0c 94 02 b8 jmp 0x17004 ; 0x17004 14e88: 8b 39 cpi r24, 0x9B ; 155 14e8a: 91 05 cpc r25, r1 14e8c: 09 f0 breq .+2 ; 0x14e90 14e8e: fd cc rjmp .-1542 ; 0x1488a bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 14e90: 83 e5 ldi r24, 0x53 ; 83 14e92: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14e96: 88 23 and r24, r24 14e98: 61 f0 breq .+24 ; 0x14eb2 autoReportFeatures.SetPeriod( code_value_uint8() ); 14e9a: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 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; 14e9e: 80 93 88 14 sts 0x1488, r24 ; 0x801488 if (auto_report_period != 0){ 14ea2: 88 23 and r24, r24 14ea4: 11 f4 brne .+4 ; 0x14eaa 14ea6: 0c 94 7a b4 jmp 0x168f4 ; 0x168f4 auto_report_timer.start(); 14eaa: 89 e8 ldi r24, 0x89 ; 137 14eac: 94 e1 ldi r25, 0x14 ; 20 14eae: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 14eb2: 83 e4 ldi r24, 0x43 ; 67 14eb4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14eb8: 88 23 and r24, r24 14eba: 11 f4 brne .+4 ; 0x14ec0 14ebc: 0c 94 7e b4 jmp 0x168fc ; 0x168fc autoReportFeatures.SetMask(code_value_uint8()); 14ec0: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 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; } 14ec4: 80 93 87 14 sts 0x1487, r24 ; 0x801487 14ec8: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14ecc: 85 3f cpi r24, 0xF5 ; 245 14ece: f1 e0 ldi r31, 0x01 ; 1 14ed0: 9f 07 cpc r25, r31 14ed2: 11 f4 brne .+4 ; 0x14ed8 14ed4: 0c 94 ec bf jmp 0x17fd8 ; 0x17fd8 14ed8: 0c f0 brlt .+2 ; 0x14edc 14eda: 60 c4 rjmp .+2240 ; 0x1579c 14edc: 81 15 cp r24, r1 14ede: 31 e0 ldi r19, 0x01 ; 1 14ee0: 93 07 cpc r25, r19 14ee2: 11 f4 brne .+4 ; 0x14ee8 14ee4: 0c 94 6e bb jmp 0x176dc ; 0x176dc 14ee8: 0c f0 brlt .+2 ; 0x14eec 14eea: 24 c1 rjmp .+584 ; 0x15134 14eec: 80 3d cpi r24, 0xD0 ; 208 14eee: 91 05 cpc r25, r1 14ef0: 11 f4 brne .+4 ; 0x14ef6 14ef2: 0c 94 b1 b9 jmp 0x17362 ; 0x17362 14ef6: 0c f0 brlt .+2 ; 0x14efa 14ef8: 77 c0 rjmp .+238 ; 0x14fe8 14efa: 8d 3c cpi r24, 0xCD ; 205 14efc: 91 05 cpc r25, r1 14efe: 11 f4 brne .+4 ; 0x14f04 14f00: 0c 94 1b b9 jmp 0x17236 ; 0x17236 14f04: ac f5 brge .+106 ; 0x14f70 14f06: 8b 3c cpi r24, 0xCB ; 203 14f08: 91 05 cpc r25, r1 14f0a: 11 f4 brne .+4 ; 0x14f10 14f0c: 0c 94 92 b8 jmp 0x17124 ; 0x17124 14f10: 8c 3c cpi r24, 0xCC ; 204 14f12: 91 05 cpc r25, r1 14f14: 09 f0 breq .+2 ; 0x14f18 14f16: b9 cc rjmp .-1678 ; 0x1488a - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 14f18: 83 e5 ldi r24, 0x53 ; 83 14f1a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14f1e: 88 23 and r24, r24 14f20: 11 f4 brne .+4 ; 0x14f26 14f22: 0c 94 ea b8 jmp 0x171d4 ; 0x171d4 // 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(); 14f26: 0e 94 1d 60 call 0xc03a ; 0xc03a 14f2a: 60 93 7e 0e sts 0x0E7E, r22 ; 0x800e7e 14f2e: 70 93 7f 0e sts 0x0E7F, r23 ; 0x800e7f 14f32: 80 93 80 0e sts 0x0E80, r24 ; 0x800e80 14f36: 90 93 81 0e sts 0x0E81, r25 ; 0x800e81 14f3a: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 14f3e: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 14f42: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 14f46: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 14f4a: 84 e5 ldi r24, 0x54 ; 84 14f4c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14f50: 88 23 and r24, r24 14f52: 11 f4 brne .+4 ; 0x14f58 14f54: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 cs.retract_acceleration = code_value(); 14f58: 0e 94 1d 60 call 0xc03a ; 0xc03a 14f5c: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 14f60: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 14f64: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 14f68: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 14f6c: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14f70: 8e 3c cpi r24, 0xCE ; 206 14f72: 91 05 cpc r25, r1 14f74: 11 f4 brne .+4 ; 0x14f7a 14f76: 0c 94 94 b9 jmp 0x17328 ; 0x17328 14f7a: 8f 3c cpi r24, 0xCF ; 207 14f7c: 91 05 cpc r25, r1 14f7e: 09 f0 breq .+2 ; 0x14f82 14f80: 84 cc rjmp .-1784 ; 0x1488a - `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')) 14f82: 83 e5 ldi r24, 0x53 ; 83 14f84: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14f88: 88 23 and r24, r24 14f8a: 51 f0 breq .+20 ; 0x14fa0 { cs.retract_length = code_value() ; 14f8c: 0e 94 1d 60 call 0xc03a ; 0xc03a 14f90: 60 93 41 0e sts 0x0E41, r22 ; 0x800e41 14f94: 70 93 42 0e sts 0x0E42, r23 ; 0x800e42 14f98: 80 93 43 0e sts 0x0E43, r24 ; 0x800e43 14f9c: 90 93 44 0e sts 0x0E44, r25 ; 0x800e44 } if(code_seen('F')) 14fa0: 86 e4 ldi r24, 0x46 ; 70 14fa2: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14fa6: 88 23 and r24, r24 14fa8: 61 f0 breq .+24 ; 0x14fc2 { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 14faa: 0e 94 1d 60 call 0xc03a ; 0xc03a 14fae: 0e 94 47 66 call 0xcc8e ; 0xcc8e 14fb2: 60 93 45 0e sts 0x0E45, r22 ; 0x800e45 14fb6: 70 93 46 0e sts 0x0E46, r23 ; 0x800e46 14fba: 80 93 47 0e sts 0x0E47, r24 ; 0x800e47 14fbe: 90 93 48 0e sts 0x0E48, r25 ; 0x800e48 } if(code_seen('Z')) 14fc2: 8a e5 ldi r24, 0x5A ; 90 14fc4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 14fc8: 88 23 and r24, r24 14fca: 11 f4 brne .+4 ; 0x14fd0 14fcc: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { cs.retract_zlift = code_value() ; 14fd0: 0e 94 1d 60 call 0xc03a ; 0xc03a 14fd4: 60 93 49 0e sts 0x0E49, r22 ; 0x800e49 14fd8: 70 93 4a 0e sts 0x0E4A, r23 ; 0x800e4a 14fdc: 80 93 4b 0e sts 0x0E4B, r24 ; 0x800e4b 14fe0: 90 93 4c 0e sts 0x0E4C, r25 ; 0x800e4c 14fe4: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14fe8: 8c 3d cpi r24, 0xDC ; 220 14fea: 91 05 cpc r25, r1 14fec: 11 f4 brne .+4 ; 0x14ff2 14fee: 0c 94 18 ba jmp 0x17430 ; 0x17430 14ff2: 0c f0 brlt .+2 ; 0x14ff6 14ff4: 82 c0 rjmp .+260 ; 0x150fa 14ff6: 81 3d cpi r24, 0xD1 ; 209 14ff8: 91 05 cpc r25, r1 14ffa: 11 f4 brne .+4 ; 0x15000 14ffc: 0c 94 d5 b9 jmp 0x173aa ; 0x173aa 15000: 86 3d cpi r24, 0xD6 ; 214 15002: 91 05 cpc r25, r1 15004: 09 f0 breq .+2 ; 0x15008 15006: 41 cc rjmp .-1918 ; 0x1488a 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; 15008: 80 e5 ldi r24, 0x50 ; 80 1500a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1500e: 88 23 and r24, r24 15010: 11 f4 brne .+4 ; 0x15016 15012: 0c 94 04 ba jmp 0x17408 ; 0x17408 15016: 0e 94 1d 60 call 0xc03a ; 0xc03a 1501a: 2b 01 movw r4, r22 1501c: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 1501e: 83 e5 ldi r24, 0x53 ; 83 15020: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15024: 88 23 and r24, r24 15026: 11 f4 brne .+4 ; 0x1502c 15028: 0c 94 0e ba jmp 0x1741c ; 0x1741c 1502c: 0e 94 1d 60 call 0xc03a ; 0xc03a 15030: 4b 01 movw r8, r22 15032: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 15034: 8e e4 ldi r24, 0x4E ; 78 15036: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1503a: d0 90 8a 0e lds r13, 0x0E8A ; 0x800e8a 1503e: 88 23 and r24, r24 15040: 29 f0 breq .+10 ; 0x1504c 15042: 0e 94 1d 60 call 0xc03a ; 0xc03a 15046: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 1504a: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 1504c: 82 e5 ldi r24, 0x52 ; 82 1504e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15052: e0 90 8b 0e lds r14, 0x0E8B ; 0x800e8b 15056: f0 90 8c 0e lds r15, 0x0E8C ; 0x800e8c 1505a: 88 23 and r24, r24 1505c: 29 f0 breq .+10 ; 0x15068 1505e: 0e 94 1d 60 call 0xc03a ; 0xc03a 15062: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 15066: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 15068: 86 e4 ldi r24, 0x46 ; 70 1506a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1506e: 00 91 8d 0e lds r16, 0x0E8D ; 0x800e8d 15072: 10 91 8e 0e lds r17, 0x0E8E ; 0x800e8e 15076: 88 23 and r24, r24 15078: 29 f0 breq .+10 ; 0x15084 1507a: 0e 94 1d 60 call 0xc03a ; 0xc03a 1507e: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 15082: 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) 15084: 20 e0 ldi r18, 0x00 ; 0 15086: 30 e0 ldi r19, 0x00 ; 0 15088: a9 01 movw r20, r18 1508a: c3 01 movw r24, r6 1508c: b2 01 movw r22, r4 1508e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 15092: 18 16 cp r1, r24 15094: 14 f0 brlt .+4 ; 0x1509a 15096: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 1509a: 20 e0 ldi r18, 0x00 ; 0 1509c: 30 e0 ldi r19, 0x00 ; 0 1509e: a9 01 movw r20, r18 150a0: c5 01 movw r24, r10 150a2: b4 01 movw r22, r8 150a4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 150a8: 87 ff sbrs r24, 7 150aa: 02 c0 rjmp .+4 ; 0x150b0 150ac: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 150b0: a5 01 movw r20, r10 150b2: 94 01 movw r18, r8 150b4: c3 01 movw r24, r6 150b6: b2 01 movw r22, r4 150b8: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 150bc: 87 ff sbrs r24, 7 150be: 02 c0 rjmp .+4 ; 0x150c4 150c0: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 150c4: 40 92 82 0e sts 0x0E82, r4 ; 0x800e82 150c8: 50 92 83 0e sts 0x0E83, r5 ; 0x800e83 150cc: 60 92 84 0e sts 0x0E84, r6 ; 0x800e84 150d0: 70 92 85 0e sts 0x0E85, r7 ; 0x800e85 cs.min_mm_per_arc_segment = s; 150d4: 80 92 86 0e sts 0x0E86, r8 ; 0x800e86 150d8: 90 92 87 0e sts 0x0E87, r9 ; 0x800e87 150dc: a0 92 88 0e sts 0x0E88, r10 ; 0x800e88 150e0: b0 92 89 0e sts 0x0E89, r11 ; 0x800e89 cs.n_arc_correction = n; 150e4: d0 92 8a 0e sts 0x0E8A, r13 ; 0x800e8a cs.min_arc_segments = r; 150e8: f0 92 8c 0e sts 0x0E8C, r15 ; 0x800e8c 150ec: e0 92 8b 0e sts 0x0E8B, r14 ; 0x800e8b cs.arc_segments_per_sec = f; 150f0: 10 93 8e 0e sts 0x0E8E, r17 ; 0x800e8e 150f4: 00 93 8d 0e sts 0x0E8D, r16 ; 0x800e8d 150f8: ef c7 rjmp .+4062 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 150fa: 82 3e cpi r24, 0xE2 ; 226 150fc: 91 05 cpc r25, r1 150fe: 11 f4 brne .+4 ; 0x15104 15100: 0c 94 69 ba jmp 0x174d2 ; 0x174d2 15104: 80 3f cpi r24, 0xF0 ; 240 15106: 91 05 cpc r25, r1 15108: 09 f4 brne .+2 ; 0x1510c 1510a: e6 c7 rjmp .+4044 ; 0x160d8 1510c: 8d 3d cpi r24, 0xDD ; 221 1510e: 91 05 cpc r25, r1 15110: 09 f0 breq .+2 ; 0x15114 15112: bb cb rjmp .-2186 ; 0x1488a #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 15114: 83 e5 ldi r24, 0x53 ; 83 15116: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1511a: 88 23 and r24, r24 1511c: 11 f4 brne .+4 ; 0x15122 1511e: 0c 94 57 ba jmp 0x174ae ; 0x174ae { extrudemultiply = code_value_short(); 15122: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 15126: 90 93 bd 02 sts 0x02BD, r25 ; 0x8002bd 1512a: 80 93 bc 02 sts 0x02BC, r24 ; 0x8002bc calculate_extruder_multipliers(); 1512e: 0e 94 39 65 call 0xca72 ; 0xca72 15132: d2 c7 rjmp .+4004 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15134: 8e 35 cpi r24, 0x5E ; 94 15136: 51 e0 ldi r21, 0x01 ; 1 15138: 95 07 cpc r25, r21 1513a: 11 f4 brne .+4 ; 0x15140 1513c: 0c 94 9e c9 jmp 0x1933c ; 0x1933c 15140: 0c f0 brlt .+2 ; 0x15144 15142: ec c2 rjmp .+1496 ; 0x1571c 15144: 8e 32 cpi r24, 0x2E ; 46 15146: b1 e0 ldi r27, 0x01 ; 1 15148: 9b 07 cpc r25, r27 1514a: 11 f4 brne .+4 ; 0x15150 1514c: 0c 94 cc bb jmp 0x17798 ; 0x17798 15150: 0c f0 brlt .+2 ; 0x15154 15152: 82 c0 rjmp .+260 ; 0x15258 15154: 8c 32 cpi r24, 0x2C ; 44 15156: f1 e0 ldi r31, 0x01 ; 1 15158: 9f 07 cpc r25, r31 1515a: 11 f4 brne .+4 ; 0x15160 1515c: 0c 94 c2 ba jmp 0x17584 ; 0x17584 15160: 8d 32 cpi r24, 0x2D ; 45 15162: 91 40 sbci r25, 0x01 ; 1 15164: 09 f0 breq .+2 ; 0x15168 15166: 91 cb rjmp .-2270 ; 0x1488a - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 15168: 80 e5 ldi r24, 0x50 ; 80 1516a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1516e: 88 23 and r24, r24 15170: 51 f0 breq .+20 ; 0x15186 15172: 0e 94 1d 60 call 0xc03a ; 0xc03a 15176: 60 93 26 0e sts 0x0E26, r22 ; 0x800e26 1517a: 70 93 27 0e sts 0x0E27, r23 ; 0x800e27 1517e: 80 93 28 0e sts 0x0E28, r24 ; 0x800e28 15182: 90 93 29 0e sts 0x0E29, r25 ; 0x800e29 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 15186: 89 e4 ldi r24, 0x49 ; 73 15188: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1518c: 88 23 and r24, r24 1518e: 81 f0 breq .+32 ; 0x151b0 15190: 0e 94 1d 60 call 0xc03a ; 0xc03a #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15194: 2c ea ldi r18, 0xAC ; 172 15196: 35 ec ldi r19, 0xC5 ; 197 15198: 47 e2 ldi r20, 0x27 ; 39 1519a: 5e e3 ldi r21, 0x3E ; 62 1519c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 151a0: 60 93 2a 0e sts 0x0E2A, r22 ; 0x800e2a 151a4: 70 93 2b 0e sts 0x0E2B, r23 ; 0x800e2b 151a8: 80 93 2c 0e sts 0x0E2C, r24 ; 0x800e2c 151ac: 90 93 2d 0e sts 0x0E2D, r25 ; 0x800e2d if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 151b0: 84 e4 ldi r24, 0x44 ; 68 151b2: 0e 94 56 5b call 0xb6ac ; 0xb6ac 151b6: 88 23 and r24, r24 151b8: 81 f0 breq .+32 ; 0x151da 151ba: 0e 94 1d 60 call 0xc03a ; 0xc03a } float unscalePID_i(float i) { return i/PID_dT; 151be: 2c ea ldi r18, 0xAC ; 172 151c0: 35 ec ldi r19, 0xC5 ; 197 151c2: 47 e2 ldi r20, 0x27 ; 39 151c4: 5e e3 ldi r21, 0x3E ; 62 151c6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 151ca: 60 93 2e 0e sts 0x0E2E, r22 ; 0x800e2e 151ce: 70 93 2f 0e sts 0x0E2F, r23 ; 0x800e2f 151d2: 80 93 30 0e sts 0x0E30, r24 ; 0x800e30 151d6: 90 93 31 0e sts 0x0E31, r25 ; 0x800e31 updatePID(); 151da: 0f 94 d8 3b call 0x277b0 ; 0x277b0 SERIAL_PROTOCOLRPGM(MSG_OK); 151de: 87 e1 ldi r24, 0x17 ; 23 151e0: 9d e6 ldi r25, 0x6D ; 109 151e2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLPGM(" p:"); 151e6: 8a ed ldi r24, 0xDA ; 218 151e8: 95 e8 ldi r25, 0x85 ; 133 151ea: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 151ee: 60 91 26 0e lds r22, 0x0E26 ; 0x800e26 151f2: 70 91 27 0e lds r23, 0x0E27 ; 0x800e27 151f6: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 151fa: 90 91 29 0e lds r25, 0x0E29 ; 0x800e29 151fe: 42 e0 ldi r20, 0x02 ; 2 15200: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 15204: 86 ed ldi r24, 0xD6 ; 214 15206: 95 e8 ldi r25, 0x85 ; 133 15208: 0e 94 d0 76 call 0xeda0 ; 0xeda0 1520c: 2c ea ldi r18, 0xAC ; 172 1520e: 35 ec ldi r19, 0xC5 ; 197 15210: 47 e2 ldi r20, 0x27 ; 39 15212: 5e e3 ldi r21, 0x3E ; 62 15214: 60 91 2a 0e lds r22, 0x0E2A ; 0x800e2a 15218: 70 91 2b 0e lds r23, 0x0E2B ; 0x800e2b 1521c: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 15220: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 15224: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 15228: 42 e0 ldi r20, 0x02 ; 2 1522a: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 1522e: 82 ed ldi r24, 0xD2 ; 210 15230: 95 e8 ldi r25, 0x85 ; 133 15232: 0e 94 d0 76 call 0xeda0 ; 0xeda0 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15236: 2c ea ldi r18, 0xAC ; 172 15238: 35 ec ldi r19, 0xC5 ; 197 1523a: 47 e2 ldi r20, 0x27 ; 39 1523c: 5e e3 ldi r21, 0x3E ; 62 1523e: 60 91 2e 0e lds r22, 0x0E2E ; 0x800e2e 15242: 70 91 2f 0e lds r23, 0x0E2F ; 0x800e2f 15246: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 1524a: 90 91 31 0e lds r25, 0x0E31 ; 0x800e31 1524e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 15252: 0f 94 ef 75 call 0x2ebde ; 0x2ebde 15256: 40 c7 rjmp .+3712 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15258: 80 33 cpi r24, 0x30 ; 48 1525a: 31 e0 ldi r19, 0x01 ; 1 1525c: 93 07 cpc r25, r19 1525e: 11 f4 brne .+4 ; 0x15264 15260: 0c 94 f5 ba jmp 0x175ea ; 0x175ea 15264: 14 f4 brge .+4 ; 0x1526a 15266: 0c 94 dc bb jmp 0x177b8 ; 0x177b8 1526a: 86 33 cpi r24, 0x36 ; 54 1526c: 91 40 sbci r25, 0x01 ; 1 1526e: 09 f0 breq .+2 ; 0x15272 15270: 0c cb rjmp .-2536 ; 0x1488a { // 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(); 15272: 89 e4 ldi r24, 0x49 ; 73 15274: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15278: 88 23 and r24, r24 1527a: 11 f4 brne .+4 ; 0x15280 1527c: 0c 94 0f bc jmp 0x1781e ; 0x1781e 15280: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 15284: ab 96 adiw r28, 0x2b ; 43 15286: 8f af std Y+63, r24 ; 0x3f 15288: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 1528a: 82 e5 ldi r24, 0x52 ; 82 1528c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15290: 88 23 and r24, r24 15292: 11 f4 brne .+4 ; 0x15298 15294: 0c 94 15 bc jmp 0x1782a ; 0x1782a 15298: 0e 94 1d 60 call 0xc03a ; 0xc03a 1529c: e2 96 adiw r28, 0x32 ; 50 1529e: 6c af std Y+60, r22 ; 0x3c 152a0: 7d af std Y+61, r23 ; 0x3d 152a2: 8e af std Y+62, r24 ; 0x3e 152a4: 9f af std Y+63, r25 ; 0x3f 152a6: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 152a8: 80 e5 ldi r24, 0x50 ; 80 152aa: 0e 94 56 5b call 0xb6ac ; 0xb6ac - `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; 152ae: c1 2c mov r12, r1 152b0: d1 2c mov r13, r1 152b2: f0 ec ldi r31, 0xC0 ; 192 152b4: ef 2e mov r14, r31 152b6: ff e7 ldi r31, 0x7F ; 127 152b8: ff 2e mov r15, r31 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(); 152ba: 88 23 and r24, r24 152bc: 21 f0 breq .+8 ; 0x152c6 152be: 0e 94 1d 60 call 0xc03a ; 0xc03a 152c2: 6b 01 movw r12, r22 152c4: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 152c6: 85 e5 ldi r24, 0x55 ; 85 152c8: 0e 94 56 5b call 0xb6ac ; 0xb6ac 152cc: 88 23 and r24, r24 152ce: 11 f4 brne .+4 ; 0x152d4 152d0: 0c 94 21 bc jmp 0x17842 ; 0x17842 152d4: 0e 94 1d 60 call 0xc03a ; 0xc03a 152d8: 6e 96 adiw r28, 0x1e ; 30 152da: 6c af std Y+60, r22 ; 0x3c 152dc: 7d af std Y+61, r23 ; 0x3d 152de: 8e af std Y+62, r24 ; 0x3e 152e0: 9f af std Y+63, r25 ; 0x3f 152e2: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 152e4: 86 e5 ldi r24, 0x56 ; 86 152e6: 0e 94 56 5b call 0xb6ac ; 0xb6ac 152ea: 88 23 and r24, r24 152ec: 11 f4 brne .+4 ; 0x152f2 152ee: 0c 94 2d bc jmp 0x1785a ; 0x1785a 152f2: 0e 94 1d 60 call 0xc03a ; 0xc03a 152f6: a2 96 adiw r28, 0x22 ; 34 152f8: 6c af std Y+60, r22 ; 0x3c 152fa: 7d af std Y+61, r23 ; 0x3d 152fc: 8e af std Y+62, r24 ; 0x3e 152fe: 9f af std Y+63, r25 ; 0x3f 15300: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 15302: 83 e4 ldi r24, 0x43 ; 67 15304: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15308: 88 23 and r24, r24 1530a: 11 f4 brne .+4 ; 0x15310 1530c: 0c 94 39 bc jmp 0x17872 ; 0x17872 15310: 0e 94 1d 60 call 0xc03a ; 0xc03a 15314: 6a 96 adiw r28, 0x1a ; 26 15316: 6c af std Y+60, r22 ; 0x3c 15318: 7d af std Y+61, r23 ; 0x3d 1531a: 8e af std Y+62, r24 ; 0x3e 1531c: 9f af std Y+63, r25 ; 0x3f 1531e: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 15320: 84 e4 ldi r24, 0x44 ; 68 15322: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15326: 88 23 and r24, r24 15328: 11 f4 brne .+4 ; 0x1532e 1532a: 0c 94 45 bc jmp 0x1788a ; 0x1788a 1532e: 0e 94 1d 60 call 0xc03a ; 0xc03a 15332: aa 96 adiw r28, 0x2a ; 42 15334: 6c af std Y+60, r22 ; 0x3c 15336: 7d af std Y+61, r23 ; 0x3d 15338: 8e af std Y+62, r24 ; 0x3e 1533a: 9f af std Y+63, r25 ; 0x3f 1533c: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 1533e: 8c e4 ldi r24, 0x4C ; 76 15340: 0e 94 56 5b call 0xb6ac ; 0xb6ac 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; 15344: 0f ef ldi r16, 0xFF ; 255 15346: 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(); 15348: 88 23 and r24, r24 1534a: 19 f0 breq .+6 ; 0x15352 1534c: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 15350: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 15352: 83 e5 ldi r24, 0x53 ; 83 15354: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15358: 88 23 and r24, r24 1535a: 11 f4 brne .+4 ; 0x15360 1535c: 0c 94 51 bc jmp 0x178a2 ; 0x178a2 15360: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 15364: e3 96 adiw r28, 0x33 ; 51 15366: 8f af std Y+63, r24 ; 0x3f 15368: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 1536a: 82 e4 ldi r24, 0x42 ; 66 1536c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15370: 88 23 and r24, r24 15372: 11 f4 brne .+4 ; 0x15378 15374: 0c 94 57 bc jmp 0x178ae ; 0x178ae 15378: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 1537c: e7 96 adiw r28, 0x37 ; 55 1537e: 8f af std Y+63, r24 ; 0x3f 15380: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 15382: 84 e5 ldi r24, 0x54 ; 84 15384: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15388: 88 23 and r24, r24 1538a: 11 f4 brne .+4 ; 0x15390 1538c: 0c 94 5d bc jmp 0x178ba ; 0x178ba 15390: 0e 94 1d 60 call 0xc03a ; 0xc03a 15394: a6 96 adiw r28, 0x26 ; 38 15396: 6c af std Y+60, r22 ; 0x3c 15398: 7d af std Y+61, r23 ; 0x3d 1539a: 8e af std Y+62, r24 ; 0x3e 1539c: 9f af std Y+63, r25 ; 0x3f 1539e: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 153a0: 85 e4 ldi r24, 0x45 ; 69 153a2: 0e 94 56 5b call 0xb6ac ; 0xb6ac - `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; 153a6: 41 2c mov r4, r1 153a8: 51 2c mov r5, r1 153aa: e0 ec ldi r30, 0xC0 ; 192 153ac: 6e 2e mov r6, r30 153ae: ef e7 ldi r30, 0x7F ; 127 153b0: 7e 2e mov r7, r30 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(); 153b2: 88 23 and r24, r24 153b4: 21 f0 breq .+8 ; 0x153be 153b6: 0e 94 1d 60 call 0xc03a ; 0xc03a 153ba: 2b 01 movw r4, r22 153bc: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 153be: 87 e5 ldi r24, 0x57 ; 87 153c0: 0e 94 56 5b call 0xb6ac ; 0xb6ac - `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; 153c4: 81 2c mov r8, r1 153c6: 91 2c mov r9, r1 153c8: 70 ec ldi r23, 0xC0 ; 192 153ca: a7 2e mov r10, r23 153cc: 7f e7 ldi r23, 0x7F ; 127 153ce: b7 2e mov r11, r23 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(); 153d0: 88 23 and r24, r24 153d2: 21 f0 breq .+8 ; 0x153dc 153d4: 0e 94 1d 60 call 0xc03a ; 0xc03a 153d8: 4b 01 movw r8, r22 153da: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 153dc: 81 e4 ldi r24, 0x41 ; 65 153de: 0e 94 56 5b call 0xb6ac ; 0xb6ac 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; 153e2: 22 24 eor r2, r2 153e4: 2a 94 dec r2 153e6: 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(); 153e8: 88 23 and r24, r24 153ea: 19 f0 breq .+6 ; 0x153f2 153ec: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 153f0: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 153f2: 86 e4 ldi r24, 0x46 ; 70 153f4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 153f8: 88 23 and r24, r24 153fa: 11 f4 brne .+4 ; 0x15400 153fc: 0c 94 69 bc jmp 0x178d2 ; 0x178d2 15400: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 15404: eb 96 adiw r28, 0x3b ; 59 15406: 8f af std Y+63, r24 ; 0x3f 15408: 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) 1540a: e2 96 adiw r28, 0x32 ; 50 1540c: 2c ad ldd r18, Y+60 ; 0x3c 1540e: 3d ad ldd r19, Y+61 ; 0x3d 15410: 4e ad ldd r20, Y+62 ; 0x3e 15412: 5f ad ldd r21, Y+63 ; 0x3f 15414: e2 97 sbiw r28, 0x32 ; 50 15416: ca 01 movw r24, r20 15418: b9 01 movw r22, r18 1541a: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1541e: 88 23 and r24, r24 15420: 11 f4 brne .+4 ; 0x15426 15422: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 15426: a7 01 movw r20, r14 15428: 96 01 movw r18, r12 1542a: c7 01 movw r24, r14 1542c: b6 01 movw r22, r12 1542e: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 15432: 88 23 and r24, r24 15434: 11 f4 brne .+4 ; 0x1543a 15436: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 1543a: 6e 96 adiw r28, 0x1e ; 30 1543c: 2c ad ldd r18, Y+60 ; 0x3c 1543e: 3d ad ldd r19, Y+61 ; 0x3d 15440: 4e ad ldd r20, Y+62 ; 0x3e 15442: 5f ad ldd r21, Y+63 ; 0x3f 15444: 6e 97 sbiw r28, 0x1e ; 30 15446: ca 01 movw r24, r20 15448: b9 01 movw r22, r18 1544a: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1544e: 88 23 and r24, r24 15450: 11 f4 brne .+4 ; 0x15456 15452: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 15456: a2 96 adiw r28, 0x22 ; 34 15458: 2c ad ldd r18, Y+60 ; 0x3c 1545a: 3d ad ldd r19, Y+61 ; 0x3d 1545c: 4e ad ldd r20, Y+62 ; 0x3e 1545e: 5f ad ldd r21, Y+63 ; 0x3f 15460: a2 97 sbiw r28, 0x22 ; 34 15462: ca 01 movw r24, r20 15464: b9 01 movw r22, r18 15466: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1546a: 88 23 and r24, r24 1546c: 11 f4 brne .+4 ; 0x15472 1546e: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 15472: 6a 96 adiw r28, 0x1a ; 26 15474: 2c ad ldd r18, Y+60 ; 0x3c 15476: 3d ad ldd r19, Y+61 ; 0x3d 15478: 4e ad ldd r20, Y+62 ; 0x3e 1547a: 5f ad ldd r21, Y+63 ; 0x3f 1547c: 6a 97 sbiw r28, 0x1a ; 26 1547e: ca 01 movw r24, r20 15480: b9 01 movw r22, r18 15482: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 15486: 88 23 and r24, r24 15488: 11 f4 brne .+4 ; 0x1548e 1548a: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 1548e: aa 96 adiw r28, 0x2a ; 42 15490: 2c ad ldd r18, Y+60 ; 0x3c 15492: 3d ad ldd r19, Y+61 ; 0x3d 15494: 4e ad ldd r20, Y+62 ; 0x3e 15496: 5f ad ldd r21, Y+63 ; 0x3f 15498: aa 97 sbiw r28, 0x2a ; 42 1549a: ca 01 movw r24, r20 1549c: b9 01 movw r22, r18 1549e: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 154a2: 88 23 and r24, r24 154a4: 11 f4 brne .+4 ; 0x154aa 154a6: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 154aa: a6 96 adiw r28, 0x26 ; 38 154ac: 2c ad ldd r18, Y+60 ; 0x3c 154ae: 3d ad ldd r19, Y+61 ; 0x3d 154b0: 4e ad ldd r20, Y+62 ; 0x3e 154b2: 5f ad ldd r21, Y+63 ; 0x3f 154b4: a6 97 sbiw r28, 0x26 ; 38 154b6: ca 01 movw r24, r20 154b8: b9 01 movw r22, r18 154ba: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 154be: 88 23 and r24, r24 154c0: 11 f4 brne .+4 ; 0x154c6 154c2: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 154c6: a5 01 movw r20, r10 154c8: 94 01 movw r18, r8 154ca: c5 01 movw r24, r10 154cc: b4 01 movw r22, r8 154ce: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 154d2: 88 23 and r24, r24 154d4: 11 f4 brne .+4 ; 0x154da 154d6: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 154da: a3 01 movw r20, r6 154dc: 92 01 movw r18, r4 154de: c3 01 movw r24, r6 154e0: b2 01 movw r22, r4 154e2: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 154e6: 88 23 and r24, r24 154e8: 11 f4 brne .+4 ; 0x154ee 154ea: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 154ee: ab 96 adiw r28, 0x2b ; 43 154f0: af ad ldd r26, Y+63 ; 0x3f 154f2: ab 97 sbiw r28, 0x2b ; 43 154f4: a7 fd sbrc r26, 7 154f6: 02 c0 rjmp .+4 ; 0x154fc 154f8: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 154fc: e3 96 adiw r28, 0x33 ; 51 154fe: bf ad ldd r27, Y+63 ; 0x3f 15500: e3 97 sbiw r28, 0x33 ; 51 15502: b7 fd sbrc r27, 7 15504: 02 c0 rjmp .+4 ; 0x1550a 15506: 0c 94 73 bc jmp 0x178e6 ; 0x178e6 1550a: e7 96 adiw r28, 0x37 ; 55 1550c: ef ad ldd r30, Y+63 ; 0x3f 1550e: e7 97 sbiw r28, 0x37 ; 55 15510: e7 fd sbrc r30, 7 15512: 02 c0 rjmp .+4 ; 0x15518 15514: 0c 94 78 bc jmp 0x178f0 ; 0x178f0 15518: 37 fc sbrc r3, 7 1551a: 02 c0 rjmp .+4 ; 0x15520 1551c: 0c 94 c3 bc jmp 0x17986 ; 0x17986 15520: 17 ff sbrs r17, 7 15522: 02 c0 rjmp .+4 ; 0x15528 15524: 0c 94 6f bc jmp 0x178de ; 0x178de 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; 15528: ce 01 movw r24, r28 1552a: 01 96 adiw r24, 0x01 ; 1 1552c: 0f 94 9f 32 call 0x2653e ; 0x2653e if(!isnan(P) && P > 0) thermal_model::data.P = P; 15530: a7 01 movw r20, r14 15532: 96 01 movw r18, r12 15534: c7 01 movw r24, r14 15536: b6 01 movw r22, r12 15538: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1553c: 88 23 and r24, r24 1553e: 11 f4 brne .+4 ; 0x15544 15540: 0c 94 67 bd jmp 0x17ace ; 0x17ace if(!isnan(U)) thermal_model::data.U = U; 15544: 6e 96 adiw r28, 0x1e ; 30 15546: 2c ad ldd r18, Y+60 ; 0x3c 15548: 3d ad ldd r19, Y+61 ; 0x3d 1554a: 4e ad ldd r20, Y+62 ; 0x3e 1554c: 5f ad ldd r21, Y+63 ; 0x3f 1554e: 6e 97 sbiw r28, 0x1e ; 30 15550: ca 01 movw r24, r20 15552: b9 01 movw r22, r18 15554: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 15558: 81 11 cpse r24, r1 1555a: 0e c0 rjmp .+28 ; 0x15578 1555c: 6e 96 adiw r28, 0x1e ; 30 1555e: 8c ad ldd r24, Y+60 ; 0x3c 15560: 9d ad ldd r25, Y+61 ; 0x3d 15562: ae ad ldd r26, Y+62 ; 0x3e 15564: bf ad ldd r27, Y+63 ; 0x3f 15566: 6e 97 sbiw r28, 0x1e ; 30 15568: 80 93 de 12 sts 0x12DE, r24 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.402+0x2e> 1556c: 90 93 df 12 sts 0x12DF, r25 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.402+0x2f> 15570: a0 93 e0 12 sts 0x12E0, r26 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x30> 15574: b0 93 e1 12 sts 0x12E1, r27 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x31> if(!isnan(V)) thermal_model::data.V = V; 15578: a2 96 adiw r28, 0x22 ; 34 1557a: 2c ad ldd r18, Y+60 ; 0x3c 1557c: 3d ad ldd r19, Y+61 ; 0x3d 1557e: 4e ad ldd r20, Y+62 ; 0x3e 15580: 5f ad ldd r21, Y+63 ; 0x3f 15582: a2 97 sbiw r28, 0x22 ; 34 15584: ca 01 movw r24, r20 15586: b9 01 movw r22, r18 15588: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1558c: 81 11 cpse r24, r1 1558e: 0e c0 rjmp .+28 ; 0x155ac 15590: a2 96 adiw r28, 0x22 ; 34 15592: 2c ad ldd r18, Y+60 ; 0x3c 15594: 3d ad ldd r19, Y+61 ; 0x3d 15596: 4e ad ldd r20, Y+62 ; 0x3e 15598: 5f ad ldd r21, Y+63 ; 0x3f 1559a: a2 97 sbiw r28, 0x22 ; 34 1559c: 20 93 e2 12 sts 0x12E2, r18 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x32> 155a0: 30 93 e3 12 sts 0x12E3, r19 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x33> 155a4: 40 93 e4 12 sts 0x12E4, r20 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x34> 155a8: 50 93 e5 12 sts 0x12E5, r21 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 155ac: 6a 96 adiw r28, 0x1a ; 26 155ae: 2c ad ldd r18, Y+60 ; 0x3c 155b0: 3d ad ldd r19, Y+61 ; 0x3d 155b2: 4e ad ldd r20, Y+62 ; 0x3e 155b4: 5f ad ldd r21, Y+63 ; 0x3f 155b6: 6a 97 sbiw r28, 0x1a ; 26 155b8: ca 01 movw r24, r20 155ba: b9 01 movw r22, r18 155bc: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 155c0: 81 11 cpse r24, r1 155c2: 1b c0 rjmp .+54 ; 0x155fa 155c4: 20 e0 ldi r18, 0x00 ; 0 155c6: 30 e0 ldi r19, 0x00 ; 0 155c8: a9 01 movw r20, r18 155ca: 6a 96 adiw r28, 0x1a ; 26 155cc: 6c ad ldd r22, Y+60 ; 0x3c 155ce: 7d ad ldd r23, Y+61 ; 0x3d 155d0: 8e ad ldd r24, Y+62 ; 0x3e 155d2: 9f ad ldd r25, Y+63 ; 0x3f 155d4: 6a 97 sbiw r28, 0x1a ; 26 155d6: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 155da: 18 16 cp r1, r24 155dc: 74 f4 brge .+28 ; 0x155fa 155de: 6a 96 adiw r28, 0x1a ; 26 155e0: 8c ad ldd r24, Y+60 ; 0x3c 155e2: 9d ad ldd r25, Y+61 ; 0x3d 155e4: ae ad ldd r26, Y+62 ; 0x3e 155e6: bf ad ldd r27, Y+63 ; 0x3f 155e8: 6a 97 sbiw r28, 0x1a ; 26 155ea: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 155ee: 90 93 e7 12 sts 0x12E7, r25 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 155f2: a0 93 e8 12 sts 0x12E8, r26 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 155f6: b0 93 e9 12 sts 0x12E9, r27 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> if(!isnan(D)) thermal_model::data.fS = D; 155fa: aa 96 adiw r28, 0x2a ; 42 155fc: 2c ad ldd r18, Y+60 ; 0x3c 155fe: 3d ad ldd r19, Y+61 ; 0x3d 15600: 4e ad ldd r20, Y+62 ; 0x3e 15602: 5f ad ldd r21, Y+63 ; 0x3f 15604: aa 97 sbiw r28, 0x2a ; 42 15606: ca 01 movw r24, r20 15608: b9 01 movw r22, r18 1560a: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1560e: 81 11 cpse r24, r1 15610: 0e c0 rjmp .+28 ; 0x1562e 15612: aa 96 adiw r28, 0x2a ; 42 15614: 2c ad ldd r18, Y+60 ; 0x3c 15616: 3d ad ldd r19, Y+61 ; 0x3d 15618: 4e ad ldd r20, Y+62 ; 0x3e 1561a: 5f ad ldd r21, Y+63 ; 0x3f 1561c: aa 97 sbiw r28, 0x2a ; 42 1561e: 20 93 ea 12 sts 0x12EA, r18 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.402+0x3a> 15622: 30 93 eb 12 sts 0x12EB, r19 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.402+0x3b> 15626: 40 93 ec 12 sts 0x12EC, r20 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.402+0x3c> 1562a: 50 93 ed 12 sts 0x12ED, r21 ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.402+0x3d> if(L >= 0) thermal_model_set_lag(L); 1562e: 17 fd sbrc r17, 7 15630: 03 c0 rjmp .+6 ; 0x15638 15632: c8 01 movw r24, r16 15634: 0f 94 87 2f call 0x25f0e ; 0x25f0e if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 15638: a6 96 adiw r28, 0x26 ; 38 1563a: 2c ad ldd r18, Y+60 ; 0x3c 1563c: 3d ad ldd r19, Y+61 ; 0x3d 1563e: 4e ad ldd r20, Y+62 ; 0x3e 15640: 5f ad ldd r21, Y+63 ; 0x3f 15642: a6 97 sbiw r28, 0x26 ; 38 15644: ca 01 movw r24, r20 15646: b9 01 movw r22, r18 15648: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1564c: 81 11 cpse r24, r1 1564e: 0e c0 rjmp .+28 ; 0x1566c 15650: a6 96 adiw r28, 0x26 ; 38 15652: 8c ad ldd r24, Y+60 ; 0x3c 15654: 9d ad ldd r25, Y+61 ; 0x3d 15656: ae ad ldd r26, Y+62 ; 0x3e 15658: bf ad ldd r27, Y+63 ; 0x3f 1565a: a6 97 sbiw r28, 0x26 ; 38 1565c: 80 93 30 13 sts 0x1330, r24 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.402+0x80> 15660: 90 93 31 13 sts 0x1331, r25 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.402+0x81> 15664: a0 93 32 13 sts 0x1332, r26 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.402+0x82> 15668: b0 93 33 13 sts 0x1333, r27 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.402+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 1566c: a5 01 movw r20, r10 1566e: 94 01 movw r18, r8 15670: c5 01 movw r24, r10 15672: b4 01 movw r22, r8 15674: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 15678: 81 11 cpse r24, r1 1567a: 11 c0 rjmp .+34 ; 0x1569e 1567c: 20 e0 ldi r18, 0x00 ; 0 1567e: 30 e0 ldi r19, 0x00 ; 0 15680: a9 01 movw r20, r18 15682: c5 01 movw r24, r10 15684: b4 01 movw r22, r8 15686: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1568a: 18 16 cp r1, r24 1568c: 44 f4 brge .+16 ; 0x1569e 1568e: 80 92 34 13 sts 0x1334, r8 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 15692: 90 92 35 13 sts 0x1335, r9 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 15696: a0 92 36 13 sts 0x1336, r10 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 1569a: b0 92 37 13 sts 0x1337, r11 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 1569e: a3 01 movw r20, r6 156a0: 92 01 movw r18, r4 156a2: c3 01 movw r24, r6 156a4: b2 01 movw r22, r4 156a6: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 156aa: 81 11 cpse r24, r1 156ac: 11 c0 rjmp .+34 ; 0x156d0 156ae: 20 e0 ldi r18, 0x00 ; 0 156b0: 30 e0 ldi r19, 0x00 ; 0 156b2: a9 01 movw r20, r18 156b4: c3 01 movw r24, r6 156b6: b2 01 movw r22, r4 156b8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 156bc: 18 16 cp r1, r24 156be: 44 f4 brge .+16 ; 0x156d0 156c0: 40 92 38 13 sts 0x1338, r4 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.402+0x88> 156c4: 50 92 39 13 sts 0x1339, r5 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.402+0x89> 156c8: 60 92 3a 13 sts 0x133A, r6 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.402+0x8a> 156cc: 70 92 3b 13 sts 0x133B, r7 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.402+0x8b> // ensure warn <= err if (thermal_model::data.warn > thermal_model::data.err) 156d0: c0 90 38 13 lds r12, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.402+0x88> 156d4: d0 90 39 13 lds r13, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.402+0x89> 156d8: e0 90 3a 13 lds r14, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.402+0x8a> 156dc: f0 90 3b 13 lds r15, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.402+0x8b> 156e0: a7 01 movw r20, r14 156e2: 96 01 movw r18, r12 156e4: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 156e8: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 156ec: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 156f0: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> 156f4: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 156f8: 18 16 cp r1, r24 156fa: 44 f4 brge .+16 ; 0x1570c thermal_model::data.warn = thermal_model::data.err; 156fc: c0 92 34 13 sts 0x1334, r12 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 15700: d0 92 35 13 sts 0x1335, r13 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 15704: e0 92 36 13 sts 0x1336, r14 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 15708: f0 92 37 13 sts 0x1337, r15 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> thermal_model::setup(); 1570c: 0f 94 0e 30 call 0x2601c ; 0x2601c 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; 15710: ce 01 movw r24, r28 15712: 01 96 adiw r24, 0x01 ; 1 15714: 0f 94 92 32 call 0x26524 ; 0x26524 15718: 0c 94 e9 bc jmp 0x179d2 ; 0x179d2 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1571c: 85 39 cpi r24, 0x95 ; 149 1571e: a1 e0 ldi r26, 0x01 ; 1 15720: 9a 07 cpc r25, r26 15722: 11 f4 brne .+4 ; 0x15728 15724: 0c 94 df bf jmp 0x17fbe ; 0x17fbe 15728: 2c f5 brge .+74 ; 0x15774 1572a: 80 39 cpi r24, 0x90 ; 144 1572c: e1 e0 ldi r30, 0x01 ; 1 1572e: 9e 07 cpc r25, r30 15730: 11 f4 brne .+4 ; 0x15736 15732: 0c 94 db bf jmp 0x17fb6 ; 0x17fb6 15736: 83 39 cpi r24, 0x93 ; 147 15738: 91 40 sbci r25, 0x01 ; 1 1573a: 09 f0 breq .+2 ; 0x1573e 1573c: a6 c8 rjmp .-3764 ; 0x1488a */ 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()) 1573e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 15742: 81 30 cpi r24, 0x01 ; 1 15744: 09 f0 breq .+2 ; 0x15748 15746: c8 c4 rjmp .+2448 ; 0x160d8 { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 15748: 85 e4 ldi r24, 0x45 ; 69 1574a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1574e: 81 11 cpse r24, r1 15750: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 if(code_seen('F')) filament = code_value_uint8(); 15754: 86 e4 ldi r24, 0x46 ; 70 15756: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1575a: 81 11 cpse r24, r1 1575c: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 15760: 0f 94 bc 88 call 0x31178 ; 0x31178 15764: 88 23 and r24, r24 15766: 09 f4 brne .+2 ; 0x1576a 15768: b7 c4 rjmp .+2414 ; 0x160d8 // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 1576a: 60 e0 ldi r22, 0x00 ; 0 1576c: 80 e0 ldi r24, 0x00 ; 0 1576e: 0f 94 ae ac call 0x3595c ; 0x3595c 15772: b2 c4 rjmp .+2404 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15774: 84 3a cpi r24, 0xA4 ; 164 15776: 21 e0 ldi r18, 0x01 ; 1 15778: 92 07 cpc r25, r18 1577a: 11 f4 brne .+4 ; 0x15780 1577c: 0c 94 e4 bf jmp 0x17fc8 ; 0x17fc8 15780: 84 3f cpi r24, 0xF4 ; 244 15782: 31 e0 ldi r19, 0x01 ; 1 15784: 93 07 cpc r25, r19 15786: 11 f4 brne .+4 ; 0x1578c 15788: 0c 94 e8 bf jmp 0x17fd0 ; 0x17fd0 1578c: 86 39 cpi r24, 0x96 ; 150 1578e: 91 40 sbci r25, 0x01 ; 1 15790: 09 f0 breq .+2 ; 0x15794 15792: 7b c8 rjmp .-3850 ; 0x1488a */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 15794: 80 e0 ldi r24, 0x00 ; 0 15796: 0e 94 4f 74 call 0xe89e ; 0xe89e 1579a: 9e c4 rjmp .+2364 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1579c: 83 3c cpi r24, 0xC3 ; 195 1579e: 52 e0 ldi r21, 0x02 ; 2 157a0: 95 07 cpc r25, r21 157a2: 11 f4 brne .+4 ; 0x157a8 157a4: 0c 94 22 cb jmp 0x19644 ; 0x19644 157a8: 0c f0 brlt .+2 ; 0x157ac 157aa: e3 c3 rjmp .+1990 ; 0x15f72 157ac: 8a 35 cpi r24, 0x5A ; 90 157ae: b2 e0 ldi r27, 0x02 ; 2 157b0: 9b 07 cpc r25, r27 157b2: 11 f4 brne .+4 ; 0x157b8 157b4: 0c 94 19 c4 jmp 0x18832 ; 0x18832 157b8: 0c f0 brlt .+2 ; 0x157bc 157ba: 76 c3 rjmp .+1772 ; 0x15ea8 157bc: 8d 3f cpi r24, 0xFD ; 253 157be: f1 e0 ldi r31, 0x01 ; 1 157c0: 9f 07 cpc r25, r31 157c2: 11 f4 brne .+4 ; 0x157c8 157c4: 0c 94 02 c0 jmp 0x18004 ; 0x18004 157c8: 0c f0 brlt .+2 ; 0x157cc 157ca: 2e c3 rjmp .+1628 ; 0x15e28 157cc: 86 3f cpi r24, 0xF6 ; 246 157ce: 31 e0 ldi r19, 0x01 ; 1 157d0: 93 07 cpc r25, r19 157d2: 11 f4 brne .+4 ; 0x157d8 157d4: 0c 94 f0 bf jmp 0x17fe0 ; 0x17fe0 157d8: 87 3f cpi r24, 0xF7 ; 247 157da: 91 40 sbci r25, 0x01 ; 1 157dc: 09 f0 breq .+2 ; 0x157e0 157de: 55 c8 rjmp .-3926 ; 0x1488a #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( 157e0: 80 91 21 0e lds r24, 0x0E21 ; 0x800e21 157e4: 8f 93 push r24 157e6: 80 91 20 0e lds r24, 0x0E20 ; 0x800e20 157ea: 8f 93 push r24 157ec: 80 91 1f 0e lds r24, 0x0E1F ; 0x800e1f 157f0: 8f 93 push r24 157f2: 80 91 1e 0e lds r24, 0x0E1E ; 0x800e1e 157f6: 8f 93 push r24 157f8: 80 91 1d 0e lds r24, 0x0E1D ; 0x800e1d 157fc: 8f 93 push r24 157fe: 80 91 1c 0e lds r24, 0x0E1C ; 0x800e1c 15802: 8f 93 push r24 15804: 80 91 1b 0e lds r24, 0x0E1B ; 0x800e1b 15808: 8f 93 push r24 1580a: 80 91 1a 0e lds r24, 0x0E1A ; 0x800e1a 1580e: 8f 93 push r24 15810: 80 91 19 0e lds r24, 0x0E19 ; 0x800e19 15814: 8f 93 push r24 15816: 80 91 18 0e lds r24, 0x0E18 ; 0x800e18 1581a: 8f 93 push r24 1581c: 80 91 17 0e lds r24, 0x0E17 ; 0x800e17 15820: 8f 93 push r24 15822: 80 91 16 0e lds r24, 0x0E16 ; 0x800e16 15826: 8f 93 push r24 15828: 02 ec ldi r16, 0xC2 ; 194 1582a: 1a ea ldi r17, 0xAA ; 170 1582c: 1f 93 push r17 1582e: 0f 93 push r16 15830: 1f 93 push r17 15832: 0f 93 push r16 15834: 80 91 15 0e lds r24, 0x0E15 ; 0x800e15 15838: 8f 93 push r24 1583a: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 1583e: 8f 93 push r24 15840: 80 91 13 0e lds r24, 0x0E13 ; 0x800e13 15844: 8f 93 push r24 15846: 80 91 12 0e lds r24, 0x0E12 ; 0x800e12 1584a: 8f 93 push r24 1584c: 80 91 11 0e lds r24, 0x0E11 ; 0x800e11 15850: 8f 93 push r24 15852: 80 91 10 0e lds r24, 0x0E10 ; 0x800e10 15856: 8f 93 push r24 15858: 80 91 0f 0e lds r24, 0x0E0F ; 0x800e0f 1585c: 8f 93 push r24 1585e: 80 91 0e 0e lds r24, 0x0E0E ; 0x800e0e 15862: 8f 93 push r24 15864: 80 91 0d 0e lds r24, 0x0E0D ; 0x800e0d 15868: 8f 93 push r24 1586a: 80 91 0c 0e lds r24, 0x0E0C ; 0x800e0c 1586e: 8f 93 push r24 15870: 80 91 0b 0e lds r24, 0x0E0B ; 0x800e0b 15874: 8f 93 push r24 15876: 80 91 0a 0e lds r24, 0x0E0A ; 0x800e0a 1587a: 8f 93 push r24 1587c: 80 91 09 0e lds r24, 0x0E09 ; 0x800e09 15880: 8f 93 push r24 15882: 80 91 08 0e lds r24, 0x0E08 ; 0x800e08 15886: 8f 93 push r24 15888: 80 91 07 0e lds r24, 0x0E07 ; 0x800e07 1588c: 8f 93 push r24 1588e: 80 91 06 0e lds r24, 0x0E06 ; 0x800e06 15892: 8f 93 push r24 15894: 80 91 05 0e lds r24, 0x0E05 ; 0x800e05 15898: 8f 93 push r24 1589a: 80 91 04 0e lds r24, 0x0E04 ; 0x800e04 1589e: 8f 93 push r24 158a0: 80 91 03 0e lds r24, 0x0E03 ; 0x800e03 158a4: 8f 93 push r24 158a6: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 158aa: 8f 93 push r24 158ac: 80 91 01 0e lds r24, 0x0E01 ; 0x800e01 158b0: 8f 93 push r24 158b2: 80 91 00 0e lds r24, 0x0E00 ; 0x800e00 158b6: 8f 93 push r24 158b8: 80 91 ff 0d lds r24, 0x0DFF ; 0x800dff 158bc: 8f 93 push r24 158be: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe 158c2: 8f 93 push r24 158c4: 80 91 fd 0d lds r24, 0x0DFD ; 0x800dfd 158c8: 8f 93 push r24 158ca: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 158ce: 8f 93 push r24 158d0: 80 91 fb 0d lds r24, 0x0DFB ; 0x800dfb 158d4: 8f 93 push r24 158d6: 80 91 fa 0d lds r24, 0x0DFA ; 0x800dfa 158da: 8f 93 push r24 158dc: 1f 93 push r17 158de: 0f 93 push r16 158e0: 1f 93 push r17 158e2: 0f 93 push r16 158e4: 80 91 81 0e lds r24, 0x0E81 ; 0x800e81 158e8: 8f 93 push r24 158ea: 80 91 80 0e lds r24, 0x0E80 ; 0x800e80 158ee: 8f 93 push r24 158f0: 80 91 7f 0e lds r24, 0x0E7F ; 0x800e7f 158f4: 8f 93 push r24 158f6: 80 91 7e 0e lds r24, 0x0E7E ; 0x800e7e 158fa: 8f 93 push r24 158fc: 80 91 f9 0d lds r24, 0x0DF9 ; 0x800df9 15900: 8f 93 push r24 15902: 80 91 f8 0d lds r24, 0x0DF8 ; 0x800df8 15906: 8f 93 push r24 15908: 80 91 f7 0d lds r24, 0x0DF7 ; 0x800df7 1590c: 8f 93 push r24 1590e: 80 91 f6 0d lds r24, 0x0DF6 ; 0x800df6 15912: 8f 93 push r24 15914: 80 91 f5 0d lds r24, 0x0DF5 ; 0x800df5 15918: 8f 93 push r24 1591a: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 1591e: 8f 93 push r24 15920: 80 91 f3 0d lds r24, 0x0DF3 ; 0x800df3 15924: 8f 93 push r24 15926: 80 91 f2 0d lds r24, 0x0DF2 ; 0x800df2 1592a: 8f 93 push r24 1592c: 1f 93 push r17 1592e: 0f 93 push r16 15930: 1f 93 push r17 15932: 0f 93 push r16 15934: 80 91 79 0e lds r24, 0x0E79 ; 0x800e79 15938: 8f 93 push r24 1593a: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 1593e: 8f 93 push r24 15940: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 15944: 8f 93 push r24 15946: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 1594a: 8f 93 push r24 1594c: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 15950: 8f 93 push r24 15952: 80 91 74 0e lds r24, 0x0E74 ; 0x800e74 15956: 8f 93 push r24 15958: 80 91 73 0e lds r24, 0x0E73 ; 0x800e73 1595c: 8f 93 push r24 1595e: 80 91 72 0e lds r24, 0x0E72 ; 0x800e72 15962: 8f 93 push r24 15964: 80 91 71 0e lds r24, 0x0E71 ; 0x800e71 15968: 8f 93 push r24 1596a: 80 91 70 0e lds r24, 0x0E70 ; 0x800e70 1596e: 8f 93 push r24 15970: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 15974: 8f 93 push r24 15976: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 1597a: 8f 93 push r24 1597c: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 15980: 8f 93 push r24 15982: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 15986: 8f 93 push r24 15988: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 1598c: 8f 93 push r24 1598e: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 15992: 8f 93 push r24 15994: 1f 93 push r17 15996: 0f 93 push r16 15998: 1f 93 push r17 1599a: 0f 93 push r16 1599c: 80 91 f1 0d lds r24, 0x0DF1 ; 0x800df1 159a0: 8f 93 push r24 159a2: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 159a6: 8f 93 push r24 159a8: 80 91 ef 0d lds r24, 0x0DEF ; 0x800def 159ac: 8f 93 push r24 159ae: 80 91 ee 0d lds r24, 0x0DEE ; 0x800dee 159b2: 8f 93 push r24 159b4: 80 91 ed 0d lds r24, 0x0DED ; 0x800ded 159b8: 8f 93 push r24 159ba: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 159be: 8f 93 push r24 159c0: 80 91 eb 0d lds r24, 0x0DEB ; 0x800deb 159c4: 8f 93 push r24 159c6: 80 91 ea 0d lds r24, 0x0DEA ; 0x800dea 159ca: 8f 93 push r24 159cc: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 159d0: 8f 93 push r24 159d2: 80 91 e8 0d lds r24, 0x0DE8 ; 0x800de8 159d6: 8f 93 push r24 159d8: 80 91 e7 0d lds r24, 0x0DE7 ; 0x800de7 159dc: 8f 93 push r24 159de: 80 91 e6 0d lds r24, 0x0DE6 ; 0x800de6 159e2: 8f 93 push r24 159e4: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 159e8: 8f 93 push r24 159ea: 80 91 e4 0d lds r24, 0x0DE4 ; 0x800de4 159ee: 8f 93 push r24 159f0: 80 91 e3 0d lds r24, 0x0DE3 ; 0x800de3 159f4: 8f 93 push r24 159f6: 80 91 e2 0d lds r24, 0x0DE2 ; 0x800de2 159fa: 8f 93 push r24 159fc: 1f 93 push r17 159fe: 0f 93 push r16 15a00: 1f 93 push r17 15a02: 0f 93 push r16 15a04: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 15a08: 8f 93 push r24 15a0a: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 15a0e: 8f 93 push r24 15a10: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 15a14: 8f 93 push r24 15a16: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 15a1a: 8f 93 push r24 15a1c: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 15a20: 8f 93 push r24 15a22: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 15a26: 8f 93 push r24 15a28: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 15a2c: 8f 93 push r24 15a2e: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 15a32: 8f 93 push r24 15a34: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 15a38: 8f 93 push r24 15a3a: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 15a3e: 8f 93 push r24 15a40: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f 15a44: 8f 93 push r24 15a46: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e 15a4a: 8f 93 push r24 15a4c: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 15a50: 8f 93 push r24 15a52: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c 15a56: 8f 93 push r24 15a58: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 15a5c: 8f 93 push r24 15a5e: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 15a62: 8f 93 push r24 15a64: 1f 93 push r17 15a66: 0f 93 push r16 15a68: 1f 93 push r17 15a6a: 0f 93 push r16 15a6c: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 15a70: 8f 93 push r24 15a72: 80 91 e0 0d lds r24, 0x0DE0 ; 0x800de0 15a76: 8f 93 push r24 15a78: 80 91 df 0d lds r24, 0x0DDF ; 0x800ddf 15a7c: 8f 93 push r24 15a7e: 80 91 de 0d lds r24, 0x0DDE ; 0x800dde 15a82: 8f 93 push r24 15a84: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 15a88: 8f 93 push r24 15a8a: 80 91 dc 0d lds r24, 0x0DDC ; 0x800ddc 15a8e: 8f 93 push r24 15a90: 80 91 db 0d lds r24, 0x0DDB ; 0x800ddb 15a94: 8f 93 push r24 15a96: 80 91 da 0d lds r24, 0x0DDA ; 0x800dda 15a9a: 8f 93 push r24 15a9c: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 15aa0: 8f 93 push r24 15aa2: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 15aa6: 8f 93 push r24 15aa8: 80 91 d7 0d lds r24, 0x0DD7 ; 0x800dd7 15aac: 8f 93 push r24 15aae: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 15ab2: 8f 93 push r24 15ab4: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 15ab8: 8f 93 push r24 15aba: 80 91 d4 0d lds r24, 0x0DD4 ; 0x800dd4 15abe: 8f 93 push r24 15ac0: 80 91 d3 0d lds r24, 0x0DD3 ; 0x800dd3 15ac4: 8f 93 push r24 15ac6: 80 91 d2 0d lds r24, 0x0DD2 ; 0x800dd2 15aca: 8f 93 push r24 15acc: 1f 93 push r17 15ace: 0f 93 push r16 15ad0: 1f 93 push r17 15ad2: 0f 93 push r16 15ad4: 80 91 7d 0e lds r24, 0x0E7D ; 0x800e7d 15ad8: 1f 92 push r1 15ada: 8f 93 push r24 15adc: 80 91 7c 0e lds r24, 0x0E7C ; 0x800e7c 15ae0: 1f 92 push r1 15ae2: 8f 93 push r24 15ae4: 80 91 7b 0e lds r24, 0x0E7B ; 0x800e7b 15ae8: 1f 92 push r1 15aea: 8f 93 push r24 15aec: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 15af0: 1f 92 push r1 15af2: 8f 93 push r24 15af4: 1f 93 push r17 15af6: 0f 93 push r16 15af8: 1f 93 push r17 15afa: 0f 93 push r16 15afc: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 15b00: 8f 93 push r24 15b02: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 15b06: 8f 93 push r24 15b08: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 15b0c: 8f 93 push r24 15b0e: 80 91 ce 0d lds r24, 0x0DCE ; 0x800dce 15b12: 8f 93 push r24 15b14: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 15b18: 8f 93 push r24 15b1a: 80 91 cc 0d lds r24, 0x0DCC ; 0x800dcc 15b1e: 8f 93 push r24 15b20: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb 15b24: 8f 93 push r24 15b26: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 15b2a: 8f 93 push r24 15b2c: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 15b30: 8f 93 push r24 15b32: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 15b36: 8f 93 push r24 15b38: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 15b3c: 8f 93 push r24 15b3e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 15b42: 8f 93 push r24 15b44: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 15b48: 8f 93 push r24 15b4a: 80 91 c4 0d lds r24, 0x0DC4 ; 0x800dc4 15b4e: 8f 93 push r24 15b50: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 15b54: 8f 93 push r24 15b56: 80 91 c2 0d lds r24, 0x0DC2 ; 0x800dc2 15b5a: 8f 93 push r24 15b5c: 1f 93 push r17 15b5e: 0f 93 push r16 15b60: 1f 93 push r17 15b62: 0f 93 push r16 15b64: 89 e4 ldi r24, 0x49 ; 73 15b66: 90 e8 ldi r25, 0x80 ; 128 15b68: 9f 93 push r25 15b6a: 8f 93 push r24 15b6c: 0f 94 16 db call 0x3b62c ; 0x3b62c 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"), 15b70: 0f b6 in r0, 0x3f ; 63 15b72: f8 94 cli 15b74: de bf out 0x3e, r29 ; 62 15b76: 0f be out 0x3f, r0 ; 63 15b78: 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; 15b7a: 2c ea ldi r18, 0xAC ; 172 15b7c: 35 ec ldi r19, 0xC5 ; 197 15b7e: 47 e2 ldi r20, 0x27 ; 39 15b80: 5e e3 ldi r21, 0x3E ; 62 15b82: 60 91 2e 0e lds r22, 0x0E2E ; 0x800e2e 15b86: 70 91 2f 0e lds r23, 0x0E2F ; 0x800e2f 15b8a: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 15b8e: 90 91 31 0e lds r25, 0x0E31 ; 0x800e31 15b92: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 15b96: 9f 93 push r25 15b98: 8f 93 push r24 15b9a: 7f 93 push r23 15b9c: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15b9e: 2c ea ldi r18, 0xAC ; 172 15ba0: 35 ec ldi r19, 0xC5 ; 197 15ba2: 47 e2 ldi r20, 0x27 ; 39 15ba4: 5e e3 ldi r21, 0x3E ; 62 15ba6: 60 91 2a 0e lds r22, 0x0E2A ; 0x800e2a 15baa: 70 91 2b 0e lds r23, 0x0E2B ; 0x800e2b 15bae: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 15bb2: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 15bb6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 15bba: 9f 93 push r25 15bbc: 8f 93 push r24 15bbe: 7f 93 push r23 15bc0: 6f 93 push r22 15bc2: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 15bc6: 8f 93 push r24 15bc8: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 15bcc: 8f 93 push r24 15bce: 80 91 27 0e lds r24, 0x0E27 ; 0x800e27 15bd2: 8f 93 push r24 15bd4: 80 91 26 0e lds r24, 0x0E26 ; 0x800e26 15bd8: 8f 93 push r24 15bda: 1f 93 push r17 15bdc: 0f 93 push r16 15bde: 1f 93 push r17 15be0: 0f 93 push r16 15be2: 8c e1 ldi r24, 0x1C ; 28 15be4: 90 e8 ldi r25, 0x80 ; 128 15be6: 9f 93 push r25 15be8: 8f 93 push r24 15bea: 0f 94 16 db call 0x3b62c ; 0x3b62c #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15bee: 2c ea ldi r18, 0xAC ; 172 15bf0: 35 ec ldi r19, 0xC5 ; 197 15bf2: 47 e2 ldi r20, 0x27 ; 39 15bf4: 5e e3 ldi r21, 0x3E ; 62 15bf6: 60 91 3a 0e lds r22, 0x0E3A ; 0x800e3a 15bfa: 70 91 3b 0e lds r23, 0x0E3B ; 0x800e3b 15bfe: 80 91 3c 0e lds r24, 0x0E3C ; 0x800e3c 15c02: 90 91 3d 0e lds r25, 0x0E3D ; 0x800e3d 15c06: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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"), 15c0a: 9f 93 push r25 15c0c: 8f 93 push r24 15c0e: 7f 93 push r23 15c10: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15c12: 2c ea ldi r18, 0xAC ; 172 15c14: 35 ec ldi r19, 0xC5 ; 197 15c16: 47 e2 ldi r20, 0x27 ; 39 15c18: 5e e3 ldi r21, 0x3E ; 62 15c1a: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 15c1e: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 15c22: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 15c26: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 15c2a: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 15c2e: 9f 93 push r25 15c30: 8f 93 push r24 15c32: 7f 93 push r23 15c34: 6f 93 push r22 15c36: 80 91 35 0e lds r24, 0x0E35 ; 0x800e35 15c3a: 8f 93 push r24 15c3c: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 15c40: 8f 93 push r24 15c42: 80 91 33 0e lds r24, 0x0E33 ; 0x800e33 15c46: 8f 93 push r24 15c48: 80 91 32 0e lds r24, 0x0E32 ; 0x800e32 15c4c: 8f 93 push r24 15c4e: 1f 93 push r17 15c50: 0f 93 push r16 15c52: 1f 93 push r17 15c54: 0f 93 push r16 15c56: 87 ee ldi r24, 0xE7 ; 231 15c58: 9f e7 ldi r25, 0x7F ; 127 15c5a: 9f 93 push r25 15c5c: 8f 93 push r24 15c5e: 0f 94 16 db call 0x3b62c ; 0x3b62c echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 15c62: 0f b6 in r0, 0x3f ; 63 15c64: f8 94 cli 15c66: de bf out 0x3e, r29 ; 62 15c68: 0f be out 0x3f, r0 ; 63 15c6a: cd bf out 0x3d, r28 ; 61 15c6c: 80 91 40 0e lds r24, 0x0E40 ; 0x800e40 15c70: 1f 92 push r1 15c72: 8f 93 push r24 15c74: 1f 93 push r17 15c76: 0f 93 push r16 15c78: 1f 93 push r17 15c7a: 0f 93 push r16 15c7c: 20 e0 ldi r18, 0x00 ; 0 15c7e: 30 e0 ldi r19, 0x00 ; 0 15c80: 40 e7 ldi r20, 0x70 ; 112 15c82: 52 e4 ldi r21, 0x42 ; 66 15c84: 60 91 51 0e lds r22, 0x0E51 ; 0x800e51 15c88: 70 91 52 0e lds r23, 0x0E52 ; 0x800e52 15c8c: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 15c90: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 15c94: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 15c98: 9f 93 push r25 15c9a: 8f 93 push r24 15c9c: 7f 93 push r23 15c9e: 6f 93 push r22 15ca0: 80 91 50 0e lds r24, 0x0E50 ; 0x800e50 15ca4: 8f 93 push r24 15ca6: 80 91 4f 0e lds r24, 0x0E4F ; 0x800e4f 15caa: 8f 93 push r24 15cac: 80 91 4e 0e lds r24, 0x0E4E ; 0x800e4e 15cb0: 8f 93 push r24 15cb2: 80 91 4d 0e lds r24, 0x0E4D ; 0x800e4d 15cb6: 8f 93 push r24 15cb8: 1f 93 push r17 15cba: 0f 93 push r16 15cbc: 1f 93 push r17 15cbe: 0f 93 push r16 15cc0: 80 91 4c 0e lds r24, 0x0E4C ; 0x800e4c 15cc4: 8f 93 push r24 15cc6: 80 91 4b 0e lds r24, 0x0E4B ; 0x800e4b 15cca: 8f 93 push r24 15ccc: 80 91 4a 0e lds r24, 0x0E4A ; 0x800e4a 15cd0: 8f 93 push r24 15cd2: 80 91 49 0e lds r24, 0x0E49 ; 0x800e49 15cd6: 8f 93 push r24 15cd8: 20 e0 ldi r18, 0x00 ; 0 15cda: 30 e0 ldi r19, 0x00 ; 0 15cdc: 40 e7 ldi r20, 0x70 ; 112 15cde: 52 e4 ldi r21, 0x42 ; 66 15ce0: 60 91 45 0e lds r22, 0x0E45 ; 0x800e45 15ce4: 70 91 46 0e lds r23, 0x0E46 ; 0x800e46 15ce8: 80 91 47 0e lds r24, 0x0E47 ; 0x800e47 15cec: 90 91 48 0e lds r25, 0x0E48 ; 0x800e48 15cf0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 15cf4: 9f 93 push r25 15cf6: 8f 93 push r24 15cf8: 7f 93 push r23 15cfa: 6f 93 push r22 15cfc: 80 91 44 0e lds r24, 0x0E44 ; 0x800e44 15d00: 8f 93 push r24 15d02: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 15d06: 8f 93 push r24 15d08: 80 91 42 0e lds r24, 0x0E42 ; 0x800e42 15d0c: 8f 93 push r24 15d0e: 80 91 41 0e lds r24, 0x0E41 ; 0x800e41 15d12: 8f 93 push r24 15d14: 1f 93 push r17 15d16: 0f 93 push r16 15d18: 1f 93 push r17 15d1a: 0f 93 push r16 15d1c: 86 ee ldi r24, 0xE6 ; 230 15d1e: 9e e7 ldi r25, 0x7E ; 126 15d20: 9f 93 push r25 15d22: 8f 93 push r24 15d24: 0f 94 16 db call 0x3b62c ; 0x3b62c ); #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) { 15d28: 0f b6 in r0, 0x3f ; 63 15d2a: f8 94 cli 15d2c: de bf out 0x3e, r29 ; 62 15d2e: 0f be out 0x3f, r0 ; 63 15d30: cd bf out 0x3d, r28 ; 61 15d32: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 15d36: 88 23 and r24, r24 15d38: 11 f4 brne .+4 ; 0x15d3e 15d3a: 0c 94 f4 bf jmp 0x17fe8 ; 0x17fe8 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 15d3e: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 15d42: 8f 93 push r24 15d44: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 15d48: 8f 93 push r24 15d4a: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 15d4e: 8f 93 push r24 15d50: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 15d54: 8f 93 push r24 15d56: 1f 93 push r17 15d58: 0f 93 push r16 15d5a: 1f 93 push r17 15d5c: 0f 93 push r16 15d5e: 80 ec ldi r24, 0xC0 ; 192 15d60: 9e e7 ldi r25, 0x7E ; 126 15d62: 9f 93 push r25 15d64: 8f 93 push r24 15d66: 0f 94 16 db call 0x3b62c ; 0x3b62c 15d6a: 0f b6 in r0, 0x3f ; 63 15d6c: f8 94 cli 15d6e: de bf out 0x3e, r29 ; 62 15d70: 0f be out 0x3f, r0 ; 63 15d72: 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( 15d74: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 15d78: 8f 93 push r24 15d7a: 80 91 8d 0e lds r24, 0x0E8D ; 0x800e8d 15d7e: 8f 93 push r24 15d80: 80 91 8c 0e lds r24, 0x0E8C ; 0x800e8c 15d84: 8f 93 push r24 15d86: 80 91 8b 0e lds r24, 0x0E8B ; 0x800e8b 15d8a: 8f 93 push r24 15d8c: 80 91 8a 0e lds r24, 0x0E8A ; 0x800e8a 15d90: 1f 92 push r1 15d92: 8f 93 push r24 15d94: 80 91 89 0e lds r24, 0x0E89 ; 0x800e89 15d98: 8f 93 push r24 15d9a: 80 91 88 0e lds r24, 0x0E88 ; 0x800e88 15d9e: 8f 93 push r24 15da0: 80 91 87 0e lds r24, 0x0E87 ; 0x800e87 15da4: 8f 93 push r24 15da6: 80 91 86 0e lds r24, 0x0E86 ; 0x800e86 15daa: 8f 93 push r24 15dac: 80 91 85 0e lds r24, 0x0E85 ; 0x800e85 15db0: 8f 93 push r24 15db2: 80 91 84 0e lds r24, 0x0E84 ; 0x800e84 15db6: 8f 93 push r24 15db8: 80 91 83 0e lds r24, 0x0E83 ; 0x800e83 15dbc: 8f 93 push r24 15dbe: 80 91 82 0e lds r24, 0x0E82 ; 0x800e82 15dc2: 8f 93 push r24 15dc4: 02 ec ldi r16, 0xC2 ; 194 15dc6: 1a ea ldi r17, 0xAA ; 170 15dc8: 1f 93 push r17 15dca: 0f 93 push r16 15dcc: 1f 93 push r17 15dce: 0f 93 push r16 15dd0: 8f e1 ldi r24, 0x1F ; 31 15dd2: 9e e7 ldi r25, 0x7E ; 126 15dd4: 9f 93 push r25 15dd6: 8f 93 push r24 15dd8: 0f 94 16 db call 0x3b62c ; 0x3b62c "%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(); 15ddc: 0f 94 c6 2e call 0x25d8c ; 0x25d8c #endif printf_P(PSTR( 15de0: 8d ee ldi r24, 0xED ; 237 15de2: 9f e0 ldi r25, 0x0F ; 15 15de4: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 15de8: f6 2e mov r15, r22 15dea: e7 2e mov r14, r23 15dec: d8 2e mov r13, r24 15dee: c9 2e mov r12, r25 15df0: 81 ef ldi r24, 0xF1 ; 241 15df2: 9f e0 ldi r25, 0x0F ; 15 15df4: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 15df8: cf 92 push r12 15dfa: df 92 push r13 15dfc: ef 92 push r14 15dfe: ff 92 push r15 15e00: 9f 93 push r25 15e02: 8f 93 push r24 15e04: 7f 93 push r23 15e06: 6f 93 push r22 15e08: 1f 93 push r17 15e0a: 0f 93 push r16 15e0c: 1f 93 push r17 15e0e: 0f 93 push r16 15e10: 8e ef ldi r24, 0xFE ; 254 15e12: 9d e7 ldi r25, 0x7D ; 125 15e14: 9f 93 push r25 15e16: 8f 93 push r24 15e18: 0f 94 16 db call 0x3b62c ; 0x3b62c 15e1c: 0f b6 in r0, 0x3f ; 63 15e1e: f8 94 cli 15e20: de bf out 0x3e, r29 ; 62 15e22: 0f be out 0x3f, r0 ; 63 15e24: cd bf out 0x3d, r28 ; 61 15e26: 58 c1 rjmp .+688 ; 0x160d8 15e28: 88 35 cpi r24, 0x58 ; 88 15e2a: 52 e0 ldi r21, 0x02 ; 2 15e2c: 95 07 cpc r25, r21 15e2e: 11 f4 brne .+4 ; 0x15e34 15e30: 0c 94 0e c0 jmp 0x1801c ; 0x1801c 15e34: 14 f0 brlt .+4 ; 0x15e3a 15e36: 0c 94 b9 a4 jmp 0x14972 ; 0x14972 15e3a: 88 32 cpi r24, 0x28 ; 40 15e3c: 92 40 sbci r25, 0x02 ; 2 15e3e: 11 f0 breq .+4 ; 0x15e44 15e40: 0c 94 45 a4 jmp 0x1488a ; 0x1488a #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 15e44: 80 e5 ldi r24, 0x50 ; 80 15e46: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15e4a: 88 23 and r24, r24 15e4c: 09 f4 brne .+2 ; 0x15e50 15e4e: 44 c1 rjmp .+648 ; 0x160d8 { uint8_t valCnt = 0; IP_address = 0; 15e50: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 15e54: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f 15e58: 10 92 60 06 sts 0x0660, r1 ; 0x800660 15e5c: 10 92 61 06 sts 0x0661, r1 ; 0x800661 15e60: 0e e5 ldi r16, 0x5E ; 94 15e62: 16 e0 ldi r17, 0x06 ; 6 15e64: 42 e6 ldi r20, 0x62 ; 98 15e66: e4 2e mov r14, r20 15e68: 46 e0 ldi r20, 0x06 ; 6 15e6a: f4 2e mov r15, r20 do { *strchr_pointer = '*'; 15e6c: 5a e2 ldi r21, 0x2A ; 42 15e6e: d5 2e mov r13, r21 15e70: e0 91 95 03 lds r30, 0x0395 ; 0x800395 15e74: f0 91 96 03 lds r31, 0x0396 ; 0x800396 15e78: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 15e7a: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 15e7e: d8 01 movw r26, r16 15e80: 8d 93 st X+, r24 15e82: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 15e84: ea 16 cp r14, r26 15e86: fb 06 cpc r15, r27 15e88: 09 f4 brne .+2 ; 0x15e8c 15e8a: 26 c1 rjmp .+588 ; 0x160d8 15e8c: 8e e2 ldi r24, 0x2E ; 46 15e8e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15e92: 81 11 cpse r24, r1 15e94: ed cf rjmp .-38 ; 0x15e70 if (valCnt != 4) IP_address = 0; 15e96: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 15e9a: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f 15e9e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 15ea2: 10 92 61 06 sts 0x0661, r1 ; 0x800661 15ea6: 18 c1 rjmp .+560 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15ea8: 8e 3b cpi r24, 0xBE ; 190 15eaa: e2 e0 ldi r30, 0x02 ; 2 15eac: 9e 07 cpc r25, r30 15eae: 11 f4 brne .+4 ; 0x15eb4 15eb0: 0c 94 e2 ca jmp 0x195c4 ; 0x195c4 15eb4: 0c f0 brlt .+2 ; 0x15eb8 15eb6: 4a c0 rjmp .+148 ; 0x15f4c 15eb8: 8b 35 cpi r24, 0x5B ; 91 15eba: 22 e0 ldi r18, 0x02 ; 2 15ebc: 92 07 cpc r25, r18 15ebe: 11 f4 brne .+4 ; 0x15ec4 15ec0: 0c 94 21 c4 jmp 0x18842 ; 0x18842 15ec4: 8d 3b cpi r24, 0xBD ; 189 15ec6: 92 40 sbci r25, 0x02 ; 2 15ec8: 11 f0 breq .+4 ; 0x15ece 15eca: 0c 94 45 a4 jmp 0x1488a ; 0x1488a case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 15ece: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 15ed2: 81 30 cpi r24, 0x01 ; 1 15ed4: 11 f4 brne .+4 ; 0x15eda 15ed6: 0c 94 83 ca jmp 0x19506 ; 0x19506 - `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; 15eda: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15edc: 8c e4 ldi r24, 0x4C ; 76 15ede: 0e 94 56 5b call 0xb6ac ; 0xb6ac - `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 15ee2: c1 2c mov r12, r1 15ee4: d1 2c mov r13, r1 15ee6: 6c e8 ldi r22, 0x8C ; 140 15ee8: e6 2e mov r14, r22 15eea: 62 e4 ldi r22, 0x42 ; 66 15eec: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15eee: 88 23 and r24, r24 15ef0: 21 f0 breq .+8 ; 0x15efa 15ef2: 0e 94 1d 60 call 0xc03a ; 0xc03a 15ef6: 6b 01 movw r12, r22 15ef8: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15efa: 8a e5 ldi r24, 0x5A ; 90 15efc: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15f00: 88 23 and r24, r24 15f02: 11 f4 brne .+4 ; 0x15f08 15f04: 0c 94 94 ca jmp 0x19528 ; 0x19528 15f08: 0e 94 1d 60 call 0xc03a ; 0xc03a 15f0c: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15f0e: 0e 94 61 6d call 0xdac2 ; 0xdac2 15f12: 4b 01 movw r8, r22 15f14: 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 15f16: 8a e5 ldi r24, 0x5A ; 90 15f18: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15f1c: 08 2f mov r16, r24 } custom_message_type = CustomMsg::Status; } void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){ FSensorBlockRunout fsBlockRunout; 15f1e: 0f 94 e9 87 call 0x30fd2 ; 0x30fd2 prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 15f22: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 15f26: 81 30 cpi r24, 0x01 ; 1 15f28: 11 f0 breq .+4 ; 0x15f2e 15f2a: 0c 94 99 ca jmp 0x19532 ; 0x19532 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 15f2e: 15 30 cpi r17, 0x05 ; 5 15f30: 18 f4 brcc .+6 ; 0x15f38 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 15f32: 81 2f mov r24, r17 15f34: 0f 94 b5 0f call 0x21f6a ; 0x21f6a lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15f38: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 15f3c: 0f 94 2d 7c call 0x2f85a ; 0x2f85a // 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); 15f40: c5 01 movw r24, r10 15f42: b4 01 movw r22, r8 15f44: 90 58 subi r25, 0x80 ; 128 15f46: 0e 94 61 6d call 0xdac2 ; 0xdac2 15f4a: c6 c0 rjmp .+396 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15f4c: 81 3c cpi r24, 0xC1 ; 193 15f4e: 42 e0 ldi r20, 0x02 ; 2 15f50: 94 07 cpc r25, r20 15f52: 11 f4 brne .+4 ; 0x15f58 15f54: 0c 94 16 cb jmp 0x1962c ; 0x1962c 15f58: 14 f0 brlt .+4 ; 0x15f5e 15f5a: 0c 94 1c cb jmp 0x19638 ; 0x19638 15f5e: 80 3c cpi r24, 0xC0 ; 192 15f60: 92 40 sbci r25, 0x02 ; 2 15f62: 11 f0 breq .+4 ; 0x15f68 15f64: 0c 94 45 a4 jmp 0x1488a ; 0x1488a #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 15f68: 80 ec ldi r24, 0xC0 ; 192 15f6a: 92 e0 ldi r25, 0x02 ; 2 15f6c: 0e 94 cf 5f call 0xbf9e ; 0xbf9e 15f70: b3 c0 rjmp .+358 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15f72: 84 38 cpi r24, 0x84 ; 132 15f74: b3 e0 ldi r27, 0x03 ; 3 15f76: 9b 07 cpc r25, r27 15f78: 11 f4 brne .+4 ; 0x15f7e 15f7a: 0c 94 cb c7 jmp 0x18f96 ; 0x18f96 15f7e: 0c f0 brlt .+2 ; 0x15f82 15f80: 99 c0 rjmp .+306 ; 0x160b4 15f82: 82 35 cpi r24, 0x52 ; 82 15f84: f3 e0 ldi r31, 0x03 ; 3 15f86: 9f 07 cpc r25, r31 15f88: 11 f4 brne .+4 ; 0x15f8e 15f8a: 0c 94 27 c4 jmp 0x1884e ; 0x1884e 15f8e: 9c f5 brge .+102 ; 0x15ff6 15f90: 84 3c cpi r24, 0xC4 ; 196 15f92: 32 e0 ldi r19, 0x02 ; 2 15f94: 93 07 cpc r25, r19 15f96: 11 f4 brne .+4 ; 0x15f9c 15f98: 0c 94 3f cb jmp 0x1967e ; 0x1967e 15f9c: 85 3c cpi r24, 0xC5 ; 197 15f9e: 92 40 sbci r25, 0x02 ; 2 15fa0: 11 f0 breq .+4 ; 0x15fa6 15fa2: 0c 94 45 a4 jmp 0x1488a ; 0x1488a M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 15fa6: 83 e5 ldi r24, 0x53 ; 83 15fa8: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15fac: 88 23 and r24, r24 15fae: 51 f0 breq .+20 ; 0x15fc4 { switch (code_value_uint8()) 15fb0: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 15fb4: 88 23 and r24, r24 15fb6: 11 f4 brne .+4 ; 0x15fbc 15fb8: 0c 94 6b cb jmp 0x196d6 ; 0x196d6 15fbc: 81 30 cpi r24, 0x01 ; 1 15fbe: 11 f4 brne .+4 ; 0x15fc4 15fc0: 0c 94 78 cb jmp 0x196f0 ; 0x196f0 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 15fc4: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 15fc8: 81 30 cpi r24, 0x01 ; 1 15fca: 91 f4 brne .+36 ; 0x15ff0 15fcc: 88 e5 ldi r24, 0x58 ; 88 15fce: 0e 94 56 5b call 0xb6ac ; 0xb6ac 15fd2: 88 23 and r24, r24 15fd4: 69 f0 breq .+26 ; 0x15ff0 { switch (code_value_uint8()) 15fd6: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 15fda: 81 30 cpi r24, 0x01 ; 1 15fdc: 11 f4 brne .+4 ; 0x15fe2 15fde: 0c 94 86 cb jmp 0x1970c ; 0x1970c 15fe2: 10 f4 brcc .+4 ; 0x15fe8 15fe4: 0c 94 81 cb jmp 0x19702 ; 0x19702 15fe8: 8a 32 cpi r24, 0x2A ; 42 15fea: 11 f4 brne .+4 ; 0x15ff0 15fec: 0c 94 8a cb jmp 0x19714 ; 0x19714 break; default: break; } } MMU2::mmu2.Status(); 15ff0: 0f 94 1e 76 call 0x2ec3c ; 0x2ec3c 15ff4: 71 c0 rjmp .+226 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15ff6: 8d 35 cpi r24, 0x5D ; 93 15ff8: 53 e0 ldi r21, 0x03 ; 3 15ffa: 95 07 cpc r25, r21 15ffc: 11 f4 brne .+4 ; 0x16002 15ffe: 0c 94 9d c5 jmp 0x18b3a ; 0x18b3a 16002: 8e 35 cpi r24, 0x5E ; 94 16004: a3 e0 ldi r26, 0x03 ; 3 16006: 9a 07 cpc r25, r26 16008: 11 f4 brne .+4 ; 0x1600e 1600a: 0c 94 35 c6 jmp 0x18c6a ; 0x18c6a 1600e: 8c 35 cpi r24, 0x5C ; 92 16010: 93 40 sbci r25, 0x03 ; 3 16012: 11 f0 breq .+4 ; 0x16018 16014: 0c 94 45 a4 jmp 0x1488a ; 0x1488a */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 16018: 83 e5 ldi r24, 0x53 ; 83 1601a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1601e: 88 23 and r24, r24 16020: 09 f4 brne .+2 ; 0x16024 16022: 5a c0 rjmp .+180 ; 0x160d8 set_target_pinda = code_value_short(); 16024: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 16028: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1602a: 89 e9 ldi r24, 0x99 ; 153 1602c: 99 e3 ldi r25, 0x39 ; 57 1602e: 0e 94 2c 72 call 0xe458 ; 0xe458 16032: 0e 94 3b f2 call 0x1e476 ; 0x1e476 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 16036: 89 e1 ldi r24, 0x19 ; 25 16038: 95 e8 ldi r25, 0x85 ; 133 1603a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLLN(set_target_pinda); 1603e: c8 01 movw r24, r16 16040: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 codenum = _millis(); 16044: 0f 94 51 2a call 0x254a2 ; 0x254a2 16048: 4b 01 movw r8, r22 1604a: 5c 01 movw r10, r24 cancel_heatup = false; 1604c: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.410> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 16050: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 16054: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 16058: 89 2b or r24, r25 1605a: 41 f4 brne .+16 ; 0x1606c 1605c: ff 24 eor r15, r15 1605e: f3 94 inc r15 16060: 80 91 72 06 lds r24, 0x0672 ; 0x800672 16064: 90 91 73 06 lds r25, 0x0673 ; 0x800673 16068: 89 2b or r24, r25 1606a: 09 f0 breq .+2 ; 0x1606e SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 1606c: 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)) ) { 1606e: 28 01 movw r4, r16 16070: 01 2e mov r0, r17 16072: 00 0c add r0, r0 16074: 66 08 sbc r6, r6 16076: 77 08 sbc r7, r7 16078: f1 10 cpse r15, r1 1607a: 0c 94 5d c5 jmp 0x18aba ; 0x18aba 1607e: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.410> 16082: 81 11 cpse r24, r1 16084: 12 c0 rjmp .+36 ; 0x160aa 16086: c3 01 movw r24, r6 16088: b2 01 movw r22, r4 1608a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1608e: 20 91 99 03 lds r18, 0x0399 ; 0x800399 16092: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 16096: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 1609a: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 1609e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 160a2: 18 16 cp r1, r24 160a4: 14 f4 brge .+4 ; 0x160aa 160a6: 0c 94 6f c5 jmp 0x18ade ; 0x18ade } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 160aa: 87 e1 ldi r24, 0x17 ; 23 160ac: 9d e6 ldi r25, 0x6D ; 109 160ae: 0e 94 3b f2 call 0x1e476 ; 0x1e476 160b2: 12 c0 rjmp .+36 ; 0x160d8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 160b4: 81 39 cpi r24, 0x91 ; 145 160b6: e3 e0 ldi r30, 0x03 ; 3 160b8: 9e 07 cpc r25, r30 160ba: 11 f4 brne .+4 ; 0x160c0 160bc: 0c 94 fe c8 jmp 0x191fc ; 0x191fc 160c0: 8c f4 brge .+34 ; 0x160e4 160c2: 8b 38 cpi r24, 0x8B ; 139 160c4: 23 e0 ldi r18, 0x03 ; 3 160c6: 92 07 cpc r25, r18 160c8: 11 f4 brne .+4 ; 0x160ce 160ca: 0c 94 7a c8 jmp 0x190f4 ; 0x190f4 160ce: 8c 38 cpi r24, 0x8C ; 140 160d0: 93 40 sbci r25, 0x03 ; 3 160d2: 11 f0 breq .+4 ; 0x160d8 160d4: 0c 94 45 a4 jmp 0x1488a ; 0x1488a */ 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; 160d8: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.532+0x1> 160dc: 10 92 aa 0d sts 0x0DAA, r1 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.532> 160e0: 0c 94 c1 95 jmp 0x12b82 ; 0x12b82 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 160e4: 84 39 cpi r24, 0x94 ; 148 160e6: 43 e0 ldi r20, 0x03 ; 3 160e8: 94 07 cpc r25, r20 160ea: 14 f4 brge .+4 ; 0x160f0 160ec: 0c 94 4d c9 jmp 0x1929a ; 0x1929a 160f0: 80 3a cpi r24, 0xA0 ; 160 160f2: 93 40 sbci r25, 0x03 ; 3 160f4: 11 f0 breq .+4 ; 0x160fa 160f6: 0c 94 45 a4 jmp 0x1488a ; 0x1488a M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 160fa: 80 91 95 03 lds r24, 0x0395 ; 0x800395 160fe: 90 91 96 03 lds r25, 0x0396 ; 0x800396 } } void CardReader::openLogFile(const char* name) { logging = true; 16102: 21 e0 ldi r18, 0x01 ; 1 16104: 20 93 8f 14 sts 0x148F, r18 ; 0x80148f openFileWrite(name); 16108: 05 96 adiw r24, 0x05 ; 5 1610a: 0f 94 a1 86 call 0x30d42 ; 0x30d42 1610e: e4 cf rjmp .-56 ; 0x160d8 - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 16110: 00 91 95 03 lds r16, 0x0395 ; 0x800395 16114: 10 91 96 03 lds r17, 0x0396 ; 0x800396 16118: 0e 5f subi r16, 0xFE ; 254 1611a: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1611c: 80 e5 ldi r24, 0x50 ; 80 1611e: 0e 94 56 5b call 0xb6ac ; 0xb6ac */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 16122: c1 2c mov r12, r1 16124: d1 2c mov r13, r1 16126: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 16128: 88 23 and r24, r24 1612a: 21 f0 breq .+8 ; 0x16134 1612c: 0e 94 02 5b call 0xb604 ; 0xb604 16130: 6b 01 movw r12, r22 16132: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 16134: 83 e5 ldi r24, 0x53 ; 83 16136: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1613a: 88 23 and r24, r24 1613c: 51 f0 breq .+20 ; 0x16152 1613e: 0e 94 02 5b call 0xb604 ; 0xb604 16142: 9b 01 movw r18, r22 16144: ac 01 movw r20, r24 16146: a8 ee ldi r26, 0xE8 ; 232 16148: b3 e0 ldi r27, 0x03 ; 3 1614a: 0f 94 e9 dc call 0x3b9d2 ; 0x3b9d2 <__muluhisi3> 1614e: 6b 01 movw r12, r22 16150: 7c 01 movw r14, r24 16152: c8 01 movw r24, r16 16154: 0f 5f subi r16, 0xFF ; 255 16156: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 16158: dc 01 movw r26, r24 1615a: 4c 91 ld r20, X 1615c: 40 32 cpi r20, 0x20 ; 32 1615e: c9 f3 breq .-14 ; 0x16152 custom_message_type = CustomMsg::M0Wait; 16160: 26 e0 ldi r18, 0x06 ; 6 16162: 20 93 c4 06 sts 0x06C4, r18 ; 0x8006c4 if (!expiration_time_set && *src != '\0') { 16166: c1 14 cp r12, r1 16168: d1 04 cpc r13, r1 1616a: e1 04 cpc r14, r1 1616c: f1 04 cpc r15, r1 1616e: a1 f5 brne .+104 ; 0x161d8 16170: 2c 91 ld r18, X 16172: 22 23 and r18, r18 16174: 89 f1 breq .+98 ; 0x161d8 lcd_setstatus(src); 16176: 0e 94 67 f5 call 0x1eace ; 0x1eace 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(); 1617a: 0f 94 ed 43 call 0x287da ; 0x287da menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 1617e: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 16182: 84 60 ori r24, 0x04 ; 4 16184: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 previous_millis_cmd.start(); 16188: 86 e8 ldi r24, 0x86 ; 134 1618a: 93 e0 ldi r25, 0x03 ; 3 1618c: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> if (expiration_time_set) { 16190: c1 14 cp r12, r1 16192: d1 04 cpc r13, r1 16194: e1 04 cpc r14, r1 16196: f1 04 cpc r15, r1 16198: 79 f1 breq .+94 ; 0x161f8 codenum += _millis(); // keep track of when we started waiting 1619a: 0f 94 51 2a call 0x254a2 ; 0x254a2 1619e: c6 0e add r12, r22 161a0: d7 1e adc r13, r23 161a2: e8 1e adc r14, r24 161a4: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 161a6: 84 e0 ldi r24, 0x04 ; 4 161a8: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be while(_millis() < codenum && !lcd_clicked()) { 161ac: 0f 94 51 2a call 0x254a2 ; 0x254a2 161b0: 6c 15 cp r22, r12 161b2: 7d 05 cpc r23, r13 161b4: 8e 05 cpc r24, r14 161b6: 9f 05 cpc r25, r15 161b8: b0 f0 brcs .+44 ; 0x161e6 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 161ba: 82 e0 ldi r24, 0x02 ; 2 161bc: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 161c0: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 161c4: 8b 7f andi r24, 0xFB ; 251 161c6: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 if (IS_SD_PRINTING) 161ca: 80 91 90 14 lds r24, 0x1490 ; 0x801490 161ce: 88 23 and r24, r24 161d0: 31 f1 breq .+76 ; 0x1621e custom_message_type = CustomMsg::Status; 161d2: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 161d6: 80 cf rjmp .-256 ; 0x160d8 } 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)); 161d8: 82 eb ldi r24, 0xB2 ; 178 161da: 99 e3 ldi r25, 0x39 ; 57 161dc: 0e 94 2c 72 call 0xe458 ; 0xe458 161e0: 0e 94 3b f2 call 0x1e476 ; 0x1e476 161e4: ca cf rjmp .-108 ; 0x1617a 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()) { 161e6: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 161ea: 81 11 cpse r24, r1 161ec: e6 cf rjmp .-52 ; 0x161ba delay_keep_alive(0); 161ee: 90 e0 ldi r25, 0x00 ; 0 161f0: 80 e0 ldi r24, 0x00 ; 0 161f2: 0e 94 6c 8c call 0x118d8 ; 0x118d8 161f6: da cf rjmp .-76 ; 0x161ac //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 161f8: 10 91 be 02 lds r17, 0x02BE ; 0x8002be KEEPALIVE_STATE(PAUSED_FOR_USER); 161fc: 84 e0 ldi r24, 0x04 ; 4 161fe: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_consume_click(); 16202: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 while(!lcd_clicked()) 16206: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 1620a: 81 11 cpse r24, r1 1620c: 05 c0 rjmp .+10 ; 0x16218 { delay_keep_alive(0); 1620e: 90 e0 ldi r25, 0x00 ; 0 16210: 80 e0 ldi r24, 0x00 ; 0 16212: 0e 94 6c 8c call 0x118d8 ; 0x118d8 16216: f7 cf rjmp .-18 ; 0x16206 } KEEPALIVE_STATE(busy_state_backup); 16218: 10 93 be 02 sts 0x02BE, r17 ; 0x8002be 1621c: d1 cf rjmp .-94 ; 0x161c0 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 1621e: 8f ec ldi r24, 0xCF ; 207 16220: 9f e6 ldi r25, 0x6F ; 111 16222: 0e 94 3b f2 call 0x1e476 ; 0x1e476 16226: 58 cf rjmp .-336 ; 0x160d8 /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 16228: 87 ea ldi r24, 0xA7 ; 167 1622a: 99 e3 ldi r25, 0x39 ; 57 1622c: 0e 94 2c 72 call 0xe458 ; 0xe458 16230: 0e 94 3b f2 call 0x1e476 ; 0x1e476 enable_x(); 16234: 17 98 cbi 0x02, 7 ; 2 enable_y(); 16236: 16 98 cbi 0x02, 6 ; 2 enable_z(); 16238: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1623a: 14 98 cbi 0x02, 4 ; 2 1623c: 4d cf rjmp .-358 ; 0x160d8 /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 1623e: 81 e0 ldi r24, 0x01 ; 1 16240: 0f 94 fd 81 call 0x303fa ; 0x303fa 16244: 49 cf rjmp .-366 ; 0x160d8 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 16246: 10 92 90 14 sts 0x1490, r1 ; 0x801490 mounted = false; 1624a: 10 92 91 14 sts 0x1491, r1 ; 0x801491 SERIAL_ECHO_START; 1624e: 82 ec ldi r24, 0xC2 ; 194 16250: 9a ea ldi r25, 0xAA ; 170 16252: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 16256: 84 ef ldi r24, 0xF4 ; 244 16258: 9a e6 ldi r25, 0x6A ; 106 1625a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 1625e: 3c cf rjmp .-392 ; 0x160d8 /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 16260: 0e 94 05 67 call 0xce0a ; 0xce0a 16264: 88 23 and r24, r24 16266: 19 f0 breq .+6 ; 0x1626e lcd_resume_print(); 16268: 0e 94 f5 f8 call 0x1f1ea ; 0x1f1ea 1626c: 35 cf rjmp .-406 ; 0x160d8 else { if (!filament_presence_check()) { 1626e: 0e 94 e0 f5 call 0x1ebc0 ; 0x1ebc0 16272: 88 23 and r24, r24 16274: 09 f4 brne .+2 ; 0x16278 16276: 30 cf rjmp .-416 ; 0x160d8 16278: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1627c: 88 23 and r24, r24 1627e: 61 f0 breq .+24 ; 0x16298 // Print was aborted break; } if (!card.get_sdpos()) 16280: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 16284: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 16288: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 1628c: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 16290: 89 2b or r24, r25 16292: 8a 2b or r24, r26 16294: 8b 2b or r24, r27 16296: 69 f4 brne .+26 ; 0x162b2 { // A new print has started from scratch, reset stats failstats_reset_print(); 16298: 0e 94 a4 5b call 0xb748 ; 0xb748 sdpos_atomic = 0; 1629c: 10 92 82 03 sts 0x0382, r1 ; 0x800382 162a0: 10 92 83 03 sts 0x0383, r1 ; 0x800383 162a4: 10 92 84 03 sts 0x0384, r1 ; 0x800384 162a8: 10 92 85 03 sts 0x0385, r1 ; 0x800385 162ac: 80 e0 ldi r24, 0x00 ; 0 162ae: 0e 94 97 81 call 0x1032e ; 0x1032e } void CardReader::startFileprint() { if(mounted) 162b2: 80 91 91 14 lds r24, 0x1491 ; 0x801491 162b6: 88 23 and r24, r24 162b8: 31 f0 breq .+12 ; 0x162c6 { sdprinting = true; 162ba: 81 e0 ldi r24, 0x01 ; 1 162bc: 80 93 90 14 sts 0x1490, r24 ; 0x801490 162c0: 85 e0 ldi r24, 0x05 ; 5 162c2: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 162c6: 0f 94 92 43 call 0x28724 ; 0x28724 if (MMU2::mmu2.Enabled()) 162ca: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 162ce: 81 30 cpi r24, 0x01 ; 1 162d0: 09 f0 breq .+2 ; 0x162d4 162d2: 02 cf rjmp .-508 ; 0x160d8 { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 162d4: 80 91 90 13 lds r24, 0x1390 ; 0x801390 162d8: 88 23 and r24, r24 162da: 09 f4 brne .+2 ; 0x162de 162dc: fd ce rjmp .-518 ; 0x160d8 162de: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 162e2: 81 11 cpse r24, r1 162e4: f9 ce rjmp .-526 ; 0x160d8 { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 162e6: 0f 94 75 ad call 0x35aea ; 0x35aea 162ea: f6 ce rjmp .-532 ; 0x160d8 #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 162ec: 80 91 91 14 lds r24, 0x1491 ; 0x801491 162f0: 88 23 and r24, r24 162f2: 09 f4 brne .+2 ; 0x162f6 162f4: f1 ce rjmp .-542 ; 0x160d8 162f6: 83 e5 ldi r24, 0x53 ; 83 162f8: 0e 94 56 5b call 0xb6ac ; 0xb6ac 162fc: 88 23 and r24, r24 162fe: 09 f4 brne .+2 ; 0x16302 16300: eb ce rjmp .-554 ; 0x160d8 long index = code_value_long(); 16302: 0e 94 02 5b call 0xb604 ; 0xb604 16306: 6b 01 movw r12, r22 16308: 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);}; 1630a: c0 92 a4 17 sts 0x17A4, r12 ; 0x8017a4 1630e: d0 92 a5 17 sts 0x17A5, r13 ; 0x8017a5 16312: e0 92 a6 17 sts 0x17A6, r14 ; 0x8017a6 16316: f0 92 a7 17 sts 0x17A7, r15 ; 0x8017a7 1631a: 0f 94 d7 76 call 0x2edae ; 0x2edae 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; 1631e: c0 92 82 03 sts 0x0382, r12 ; 0x800382 16322: d0 92 83 03 sts 0x0383, r13 ; 0x800383 16326: e0 92 84 03 sts 0x0384, r14 ; 0x800384 1632a: f0 92 85 03 sts 0x0385, r15 ; 0x800385 1632e: d4 ce rjmp .-600 ; 0x160d8 #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 16330: 80 e5 ldi r24, 0x50 ; 80 16332: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16336: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 16338: 0e 94 05 67 call 0xce0a ; 0xce0a 1633c: 88 23 and r24, r24 1633e: 91 f0 breq .+36 ; 0x16364 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 16340: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 16344: 88 23 and r24, r24 16346: 49 f0 breq .+18 ; 0x1635a 16348: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1634c: 81 11 cpse r24, r1 1634e: 05 c0 rjmp .+10 ; 0x1635a SERIAL_PROTOCOLLNPGM("SD print paused"); 16350: 8f e4 ldi r24, 0x4F ; 79 16352: 94 e8 ldi r25, 0x84 ; 132 16354: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 16358: bf ce rjmp .-642 ; 0x160d8 else SERIAL_PROTOCOLLNPGM("Print saved"); 1635a: 83 e4 ldi r24, 0x43 ; 67 1635c: 94 e8 ldi r25, 0x84 ; 132 1635e: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 16362: ba ce rjmp .-652 ; 0x160d8 } else if (sdprinting) 16364: 80 91 90 14 lds r24, 0x1490 ; 0x801490 16368: 88 23 and r24, r24 1636a: 09 f4 brne .+2 ; 0x1636e 1636c: 4a c0 rjmp .+148 ; 0x16402 { if (arg_P) 1636e: 11 23 and r17, r17 16370: e1 f1 breq .+120 ; 0x163ea { printAbsFilenameFast(); 16372: 0f 94 5c 7b call 0x2f6b8 ; 0x2f6b8 SERIAL_PROTOCOLLN(); 16376: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 1637a: 8f e0 ldi r24, 0x0F ; 15 1637c: 97 e6 ldi r25, 0x67 ; 103 1637e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 16382: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 16386: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 1638a: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 1638e: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 16392: 4a e0 ldi r20, 0x0A ; 10 16394: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 16398: 8f e2 ldi r24, 0x2F ; 47 1639a: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 1639e: 60 91 9d 17 lds r22, 0x179D ; 0x80179d 163a2: 70 91 9e 17 lds r23, 0x179E ; 0x80179e 163a6: 80 91 9f 17 lds r24, 0x179F ; 0x80179f 163aa: 90 91 a0 17 lds r25, 0x17A0 ; 0x8017a0 163ae: 4a e0 ldi r20, 0x0A ; 10 163b0: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 163b4: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 163b8: 0f 94 a8 3f call 0x27f50 ; 0x27f50 163bc: 2c e3 ldi r18, 0x3C ; 60 163be: 30 e0 ldi r19, 0x00 ; 0 163c0: 40 e0 ldi r20, 0x00 ; 0 163c2: 50 e0 ldi r21, 0x00 ; 0 163c4: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 163c8: c9 01 movw r24, r18 163ca: 6c e3 ldi r22, 0x3C ; 60 163cc: 70 e0 ldi r23, 0x00 ; 0 163ce: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 163d2: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 163d4: 90 e0 ldi r25, 0x00 ; 0 163d6: 80 e0 ldi r24, 0x00 ; 0 163d8: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 163dc: 8a e3 ldi r24, 0x3A ; 58 163de: 0e 94 b7 76 call 0xed6e ; 0xed6e SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 163e2: c8 01 movw r24, r16 163e4: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 163e8: 77 ce rjmp .-786 ; 0x160d8 { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 163ea: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 163ee: 88 23 and r24, r24 163f0: 29 f0 breq .+10 ; 0x163fc 163f2: 87 ea ldi r24, 0xA7 ; 167 163f4: 94 e1 ldi r25, 0x14 ; 20 163f6: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 163fa: bf cf rjmp .-130 ; 0x1637a 163fc: 82 e9 ldi r24, 0x92 ; 146 163fe: 94 e1 ldi r25, 0x14 ; 20 16400: fa cf rjmp .-12 ; 0x163f6 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 16402: 83 e3 ldi r24, 0x33 ; 51 16404: 94 e8 ldi r25, 0x84 ; 132 16406: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 1640a: 66 ce rjmp .-820 ; 0x160d8 /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1640c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 16410: 90 91 96 03 lds r25, 0x0396 ; 0x800396 16414: 04 96 adiw r24, 0x04 ; 4 16416: 0f 94 a1 86 call 0x30d42 ; 0x30d42 1641a: 5e ce rjmp .-836 ; 0x160d8 * 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; 1641c: ce 01 movw r24, r28 1641e: 01 96 adiw r24, 0x01 ; 1 16420: 0f 94 b8 77 call 0x2ef70 ; 0x2ef70 16424: 88 23 and r24, r24 16426: 11 f4 brne .+4 ; 0x1642c 16428: 0c 94 8d a5 jmp 0x14b1a ; 0x14b1a // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1642c: 61 e0 ldi r22, 0x01 ; 1 1642e: ce 01 movw r24, r28 16430: 01 96 adiw r24, 0x01 ; 1 16432: 0f 94 5c 59 call 0x2b2b8 ; 0x2b2b8 if (!d) goto fail; 16436: 00 97 sbiw r24, 0x00 ; 0 16438: 11 f4 brne .+4 ; 0x1643e 1643a: 0c 94 8d a5 jmp 0x14b1a ; 0x14b1a // mark entry deleted d->name[0] = DIR_NAME_DELETED; 1643e: 25 ee ldi r18, 0xE5 ; 229 16440: fc 01 movw r30, r24 16442: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 16444: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 16446: 0f 94 50 54 call 0x2a8a0 ; 0x2a8a0 1644a: 18 2f mov r17, r24 1644c: 0c 94 8e a5 jmp 0x14b1c ; 0x14b1c presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 16450: 8d e0 ldi r24, 0x0D ; 13 16452: 94 e8 ldi r25, 0x84 ; 132 16454: 0e 94 d0 76 call 0xeda0 ; 0xeda0 16458: 23 96 adiw r28, 0x03 ; 3 1645a: 8e ad ldd r24, Y+62 ; 0x3e 1645c: 9f ad ldd r25, Y+63 ; 0x3f 1645e: 23 97 sbiw r28, 0x03 ; 3 16460: 0e 94 94 87 call 0x10f28 ; 0x10f28 16464: 8e e2 ldi r24, 0x2E ; 46 16466: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 1646a: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a 1646e: 34 ce rjmp .-920 ; 0x160d8 ### 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(); 16470: 0f 94 a8 3f call 0x27f50 ; 0x27f50 int16_t sec, min; min = t / 60; sec = t % 60; 16474: 2c e3 ldi r18, 0x3C ; 60 16476: 30 e0 ldi r19, 0x00 ; 0 16478: 40 e0 ldi r20, 0x00 ; 0 1647a: 50 e0 ldi r21, 0x00 ; 0 1647c: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 16480: 7f 93 push r23 16482: 6f 93 push r22 16484: 3f 93 push r19 16486: 2f 93 push r18 16488: 8e ee ldi r24, 0xEE ; 238 1648a: 96 e8 ldi r25, 0x86 ; 134 1648c: 9f 93 push r25 1648e: 8f 93 push r24 16490: 8e 01 movw r16, r28 16492: 0f 5f subi r16, 0xFF ; 255 16494: 1f 4f sbci r17, 0xFF ; 255 16496: 1f 93 push r17 16498: 0f 93 push r16 1649a: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 SERIAL_ECHO_START; 1649e: 82 ec ldi r24, 0xC2 ; 194 164a0: 9a ea ldi r25, 0xAA ; 170 164a2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(time); 164a6: c8 01 movw r24, r16 164a8: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 lcd_setstatus(time); 164ac: c8 01 movw r24, r16 164ae: 0e 94 67 f5 call 0x1eace ; 0x1eace autotempShutdown(); 164b2: 0f b6 in r0, 0x3f ; 63 164b4: f8 94 cli 164b6: de bf out 0x3e, r29 ; 62 164b8: 0f be out 0x3f, r0 ; 63 164ba: cd bf out 0x3d, r28 ; 61 164bc: 0d ce rjmp .-998 ; 0x160d8 #### 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')) 164be: 83 e5 ldi r24, 0x53 ; 83 164c0: 0e 94 56 5b call 0xb6ac ; 0xb6ac 164c4: 88 23 and r24, r24 164c6: 09 f4 brne .+2 ; 0x164ca 164c8: 07 ce rjmp .-1010 ; 0x160d8 { uint8_t pin_status = code_value_uint8(); 164ca: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 164ce: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 164d0: 80 e5 ldi r24, 0x50 ; 80 164d2: 0e 94 56 5b call 0xb6ac ; 0xb6ac */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 164d6: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 164d8: 88 23 and r24, r24 164da: 19 f0 breq .+6 ; 0x164e2 pin_number = code_value_uint8(); 164dc: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 164e0: 18 2f mov r17, r24 164e2: e2 ed ldi r30, 0xD2 ; 210 164e4: f6 e8 ldi r31, 0x86 ; 134 164e6: 8e ee ldi r24, 0xEE ; 238 164e8: 96 e8 ldi r25, 0x86 ; 134 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) 164ea: 24 91 lpm r18, Z 164ec: 21 17 cp r18, r17 164ee: 09 f4 brne .+2 ; 0x164f2 164f0: f3 cd rjmp .-1050 ; 0x160d8 164f2: 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++) 164f4: 8e 17 cp r24, r30 164f6: 9f 07 cpc r25, r31 164f8: c1 f7 brne .-16 ; 0x164ea pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 164fa: 16 30 cpi r17, 0x06 ; 6 164fc: 81 f4 brne .+32 ; 0x1651e fanSpeed = pin_status; 164fe: 00 93 e7 03 sts 0x03E7, r16 ; 0x8003e7 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 16502: 61 e0 ldi r22, 0x01 ; 1 16504: 81 2f mov r24, r17 16506: 0e 94 c3 e9 call 0x1d386 ; 0x1d386 digitalWrite(pin_number, pin_status); 1650a: 60 2f mov r22, r16 1650c: 81 2f mov r24, r17 1650e: 0e 94 95 e9 call 0x1d32a ; 0x1d32a analogWrite(pin_number, pin_status); 16512: 60 2f mov r22, r16 16514: 70 e0 ldi r23, 0x00 ; 0 16516: 81 2f mov r24, r17 16518: 0e 94 f4 e9 call 0x1d3e8 ; 0x1d3e8 1651c: dd cd rjmp .-1094 ; 0x160d8 } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 1651e: 17 fd sbrc r17, 7 16520: db cd rjmp .-1098 ; 0x160d8 16522: ef cf rjmp .-34 ; 0x16502 ### 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); 16524: 80 e1 ldi r24, 0x10 ; 16 16526: 0e 94 1b ef call 0x1de36 ; 0x1de36 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1652a: 81 ea ldi r24, 0xA1 ; 161 1652c: 9d e0 ldi r25, 0x0D ; 13 1652e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 16532: 3b e0 ldi r19, 0x0B ; 11 16534: 83 9f mul r24, r19 16536: c0 01 movw r24, r0 16538: 11 24 eor r1, r1 1653a: 70 e0 ldi r23, 0x00 ; 0 1653c: 60 e0 ldi r22, 0x00 ; 0 1653e: 80 5b subi r24, 0xB0 ; 176 16540: 92 4f sbci r25, 0xF2 ; 242 16542: 0f 94 96 dc call 0x3b92c ; 0x3b92c // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 16546: 82 e0 ldi r24, 0x02 ; 2 16548: 0e 94 1b ef call 0x1de36 ; 0x1de36 reset_bed_offset_and_skew(); 1654c: 0f 94 8d ce call 0x39d1a ; 0x39d1a // 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(); 16550: 0f 94 6e ce call 0x39cdc ; 0x39cdc 16554: c1 cd rjmp .-1150 ; 0x160d8 */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 16556: 8a e5 ldi r24, 0x5A ; 90 16558: 0e 94 56 5b call 0xb6ac ; 0xb6ac // 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); 1655c: 0f 94 dd 8d call 0x31bba ; 0x31bba 16560: bb cd rjmp .-1162 ; 0x160d8 ### 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()) { 16562: 80 91 01 17 lds r24, 0x1701 ; 0x801701 16566: 88 23 and r24, r24 16568: 19 f1 breq .+70 ; 0x165b0 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 1656a: ce 01 movw r24, r28 1656c: 01 96 adiw r24, 0x01 ; 1 1656e: 0f 94 09 87 call 0x30e12 ; 0x30e12 16572: 88 23 and r24, r24 16574: c1 f0 breq .+48 ; 0x165a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 16576: 89 81 ldd r24, Y+1 ; 0x01 16578: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1657c: 8e e2 ldi r24, 0x2E ; 46 1657e: 0e 94 b7 76 call 0xed6e ; 0xed6e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 16582: 8a 81 ldd r24, Y+2 ; 0x02 16584: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 16588: 8e e2 ldi r24, 0x2E ; 46 1658a: 0e 94 b7 76 call 0xed6e ; 0xed6e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1658e: 8b 81 ldd r24, Y+3 ; 0x03 16590: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 16594: 8e e2 ldi r24, 0x2E ; 46 16596: 0e 94 b7 76 call 0xed6e ; 0xed6e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1659a: 8c 81 ldd r24, Y+4 ; 0x04 1659c: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 165a0: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a 165a4: 99 cd rjmp .-1230 ; 0x160d8 SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 165a6: 82 eb ldi r24, 0xB2 ; 178 165a8: 96 e8 ldi r25, 0x86 ; 134 165aa: 0e 94 d0 76 call 0xeda0 ; 0xeda0 165ae: 94 cd rjmp .-1240 ; 0x160d8 } } else { SERIAL_PROTOCOLLNPGM("n/a"); 165b0: 8e ea ldi r24, 0xAE ; 174 165b2: 96 e8 ldi r25, 0x86 ; 134 165b4: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 165b8: 8f cd rjmp .-1250 ; 0x160d8 165ba: 10 92 b8 0d sts 0x0DB8, r1 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 165be: 8c cd rjmp .-1256 ; 0x160d8 break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 165c0: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 165c4: 1f 92 push r1 165c6: 8f 93 push r24 165c8: 86 e7 ldi r24, 0x76 ; 118 165ca: 98 e6 ldi r25, 0x68 ; 104 165cc: 9f 93 push r25 165ce: 8f 93 push r24 165d0: 0f 94 16 db call 0x3b62c ; 0x3b62c 165d4: 0f 90 pop r0 165d6: 0f 90 pop r0 165d8: 0f 90 pop r0 165da: 0f 90 pop r0 165dc: 7d cd rjmp .-1286 ; 0x160d8 - `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(); 165de: 80 e5 ldi r24, 0x50 ; 80 165e0: 0e 94 56 5b call 0xb6ac ; 0xb6ac 165e4: 88 23 and r24, r24 165e6: 21 f0 breq .+8 ; 0x165f0 165e8: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 165ec: 80 93 ae 02 sts 0x02AE, r24 ; 0x8002ae if(code_seen('R')) print_time_remaining_normal = code_value(); 165f0: 82 e5 ldi r24, 0x52 ; 82 165f2: 0e 94 56 5b call 0xb6ac ; 0xb6ac 165f6: 88 23 and r24, r24 165f8: 41 f0 breq .+16 ; 0x1660a 165fa: 0e 94 1d 60 call 0xc03a ; 0xc03a 165fe: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 16602: 70 93 b2 02 sts 0x02B2, r23 ; 0x8002b2 16606: 60 93 b1 02 sts 0x02B1, r22 ; 0x8002b1 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 1660a: 81 e5 ldi r24, 0x51 ; 81 1660c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16610: 88 23 and r24, r24 16612: 21 f0 breq .+8 ; 0x1661c 16614: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 16618: 80 93 ad 02 sts 0x02AD, r24 ; 0x8002ad if(code_seen('S')) print_time_remaining_silent = code_value(); 1661c: 83 e5 ldi r24, 0x53 ; 83 1661e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16622: 88 23 and r24, r24 16624: 41 f0 breq .+16 ; 0x16636 16626: 0e 94 1d 60 call 0xc03a ; 0xc03a 1662a: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 1662e: 70 93 b6 02 sts 0x02B6, r23 ; 0x8002b6 16632: 60 93 b5 02 sts 0x02B5, r22 ; 0x8002b5 if(code_seen('C')){ 16636: 83 e4 ldi r24, 0x43 ; 67 16638: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1663c: 88 23 and r24, r24 1663e: a9 f0 breq .+42 ; 0x1666a float print_time_to_change_normal_f = code_value(); 16640: 0e 94 1d 60 call 0xc03a ; 0xc03a 16644: 6b 01 movw r12, r22 16646: 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; 16648: 20 e0 ldi r18, 0x00 ; 0 1664a: 30 e0 ldi r19, 0x00 ; 0 1664c: a9 01 movw r20, r18 1664e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 16652: 6f ef ldi r22, 0xFF ; 255 16654: 7f ef ldi r23, 0xFF ; 255 16656: 18 16 cp r1, r24 16658: 24 f4 brge .+8 ; 0x16662 1665a: c7 01 movw r24, r14 1665c: b6 01 movw r22, r12 1665e: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 16662: 70 93 b0 02 sts 0x02B0, r23 ; 0x8002b0 16666: 60 93 af 02 sts 0x02AF, r22 ; 0x8002af } if(code_seen('D')){ 1666a: 84 e4 ldi r24, 0x44 ; 68 1666c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16670: 88 23 and r24, r24 16672: a9 f0 breq .+42 ; 0x1669e float print_time_to_change_silent_f = code_value(); 16674: 0e 94 1d 60 call 0xc03a ; 0xc03a 16678: 6b 01 movw r12, r22 1667a: 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; 1667c: 20 e0 ldi r18, 0x00 ; 0 1667e: 30 e0 ldi r19, 0x00 ; 0 16680: a9 01 movw r20, r18 16682: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 16686: 6f ef ldi r22, 0xFF ; 255 16688: 7f ef ldi r23, 0xFF ; 255 1668a: 18 16 cp r1, r24 1668c: 24 f4 brge .+8 ; 0x16696 1668e: c7 01 movw r24, r14 16690: b6 01 movw r22, r12 16692: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 16696: 70 93 b4 02 sts 0x02B4, r23 ; 0x8002b4 1669a: 60 93 b3 02 sts 0x02B3, r22 ; 0x8002b3 } { 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); 1669e: 80 91 b0 02 lds r24, 0x02B0 ; 0x8002b0 166a2: 8f 93 push r24 166a4: 80 91 af 02 lds r24, 0x02AF ; 0x8002af 166a8: 8f 93 push r24 166aa: 80 91 b2 02 lds r24, 0x02B2 ; 0x8002b2 166ae: 8f 93 push r24 166b0: 80 91 b1 02 lds r24, 0x02B1 ; 0x8002b1 166b4: 8f 93 push r24 166b6: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 166ba: 28 2f mov r18, r24 166bc: 08 2e mov r0, r24 166be: 00 0c add r0, r0 166c0: 33 0b sbc r19, r19 166c2: 3f 93 push r19 166c4: 8f 93 push r24 166c6: 8c e1 ldi r24, 0x1C ; 28 166c8: 98 e6 ldi r25, 0x68 ; 104 166ca: 9f 93 push r25 166cc: 8f 93 push r24 166ce: 03 e2 ldi r16, 0x23 ; 35 166d0: 18 e6 ldi r17, 0x68 ; 104 166d2: 1f 93 push r17 166d4: 0f 93 push r16 166d6: 0f 94 16 db call 0x3b62c ; 0x3b62c printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 166da: 80 91 b4 02 lds r24, 0x02B4 ; 0x8002b4 166de: 8f 93 push r24 166e0: 80 91 b3 02 lds r24, 0x02B3 ; 0x8002b3 166e4: 8f 93 push r24 166e6: 80 91 b6 02 lds r24, 0x02B6 ; 0x8002b6 166ea: 8f 93 push r24 166ec: 80 91 b5 02 lds r24, 0x02B5 ; 0x8002b5 166f0: 8f 93 push r24 166f2: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad 166f6: 28 2f mov r18, r24 166f8: 08 2e mov r0, r24 166fa: 00 0c add r0, r0 166fc: 33 0b sbc r19, r19 166fe: 3f 93 push r19 16700: 8f 93 push r24 16702: 85 e1 ldi r24, 0x15 ; 21 16704: 98 e6 ldi r25, 0x68 ; 104 16706: 9f 93 push r25 16708: 8f 93 push r24 1670a: 1f 93 push r17 1670c: 0f 93 push r16 1670e: 0f 94 16 db call 0x3b62c ; 0x3b62c 16712: 0f b6 in r0, 0x3f ; 63 16714: f8 94 cli 16716: de bf out 0x3e, r29 ; 62 16718: 0f be out 0x3f, r0 ; 63 1671a: cd bf out 0x3d, r28 ; 61 1671c: dd cc rjmp .-1606 ; 0x160d8 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 1671e: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 16722: 81 30 cpi r24, 0x01 ; 1 16724: 09 f0 breq .+2 ; 0x16728 16726: d8 cc rjmp .-1616 ; 0x160d8 state = PAUSED; 16728: 82 e0 ldi r24, 0x02 ; 2 1672a: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 1672e: 0f 94 51 2a call 0x254a2 ; 0x254a2 16732: 60 93 52 06 sts 0x0652, r22 ; 0x800652 16736: 70 93 53 06 sts 0x0653, r23 ; 0x800653 1673a: 80 93 54 06 sts 0x0654, r24 ; 0x800654 1673e: 90 93 55 06 sts 0x0655, r25 ; 0x800655 16742: ca cc rjmp .-1644 ; 0x160d8 /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 16744: 0f 94 b6 43 call 0x2876c ; 0x2876c save_statistics(); 16748: 0e 94 9f 65 call 0xcb3e ; 0xcb3e 1674c: c5 cc rjmp .-1654 ; 0x160d8 const char *_m_fil; const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { 1674e: 0e 94 10 67 call 0xce20 ; 0xce20 16752: 88 23 and r24, r24 16754: c1 f1 breq .+112 ; 0x167c6 _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; 16756: 60 91 65 06 lds r22, 0x0665 ; 0x800665 1675a: 70 91 66 06 lds r23, 0x0666 ; 0x800666 1675e: 80 91 67 06 lds r24, 0x0667 ; 0x800667 16762: 90 91 68 06 lds r25, 0x0668 ; 0x800668 16766: 28 ee ldi r18, 0xE8 ; 232 16768: 33 e0 ldi r19, 0x03 ; 3 1676a: 40 e0 ldi r20, 0x00 ; 0 1676c: 50 e0 ldi r21, 0x00 ; 0 1676e: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 16772: 12 2f mov r17, r18 16774: 03 2f mov r16, r19 16776: f4 2e mov r15, r20 16778: e5 2e mov r14, r21 _min = print_job_timer.duration() / 60; 1677a: 0f 94 a8 3f call 0x27f50 ; 0x27f50 1677e: 2c e3 ldi r18, 0x3C ; 60 16780: 30 e0 ldi r19, 0x00 ; 0 16782: 40 e0 ldi r20, 0x00 ; 0 16784: 50 e0 ldi r21, 0x00 ; 0 16786: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 1678a: b9 01 movw r22, r18 1678c: 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); 1678e: 43 e0 ldi r20, 0x03 ; 3 16790: 50 e5 ldi r21, 0x50 ; 80 const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { _m_fil = _O(MSG_FILAMENT_USED); 16792: 23 ef ldi r18, 0xF3 ; 243 16794: 3f e4 ldi r19, 0x4F ; 79 _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); 16796: 9f 93 push r25 16798: 8f 93 push r24 1679a: 7f 93 push r23 1679c: 6f 93 push r22 1679e: 5f 93 push r21 167a0: 4f 93 push r20 167a2: ef 92 push r14 167a4: ff 92 push r15 167a6: 0f 93 push r16 167a8: 1f 93 push r17 167aa: 3f 93 push r19 167ac: 2f 93 push r18 167ae: 8f ef ldi r24, 0xFF ; 255 167b0: 97 e6 ldi r25, 0x67 ; 103 167b2: 9f 93 push r25 167b4: 8f 93 push r24 167b6: 0f 94 16 db call 0x3b62c ; 0x3b62c 167ba: 0f b6 in r0, 0x3f ; 63 167bc: f8 94 cli 167be: de bf out 0x3e, r29 ; 62 167c0: 0f be out 0x3f, r0 ; 63 167c2: cd bf out 0x3d, r28 ; 61 167c4: 89 cc rjmp .-1774 ; 0x160d8 _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')) { 167c6: 83 e5 ldi r24, 0x53 ; 83 167c8: 0e 94 56 5b call 0xb6ac ; 0xb6ac 167cc: 88 23 and r24, r24 167ce: 51 f0 breq .+20 ; 0x167e4 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); 167d0: 0e 94 1d 60 call 0xc03a ; 0xc03a 167d4: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 167d8: ab 01 movw r20, r22 167da: 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); 167dc: 81 ef ldi r24, 0xF1 ; 241 167de: 9f e0 ldi r25, 0x0F ; 15 167e0: 0f 94 8a dc call 0x3b914 ; 0x3b914 } if (code_seen('T')) { 167e4: 84 e5 ldi r24, 0x54 ; 84 167e6: 0e 94 56 5b call 0xb6ac ; 0xb6ac 167ea: 88 23 and r24, r24 167ec: 51 f0 breq .+20 ; 0x16802 eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); 167ee: 0e 94 1d 60 call 0xc03a ; 0xc03a 167f2: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 167f6: ab 01 movw r20, r22 167f8: bc 01 movw r22, r24 167fa: 8d ee ldi r24, 0xED ; 237 167fc: 9f e0 ldi r25, 0x0F ; 15 167fe: 0f 94 8a dc call 0x3b914 ; 0x3b914 } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); 16802: 81 ef ldi r24, 0xF1 ; 241 16804: 9f e0 ldi r25, 0x0F ; 15 16806: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 1680a: 16 2f mov r17, r22 1680c: 07 2f mov r16, r23 1680e: f8 2e mov r15, r24 16810: e9 2e mov r14, r25 _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); 16812: 8d ee ldi r24, 0xED ; 237 16814: 9f e0 ldi r25, 0x0F ; 15 16816: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 } 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); 1681a: 40 ee ldi r20, 0xE0 ; 224 1681c: 5f e4 ldi r21, 0x4F ; 79 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); 1681e: 2f ec ldi r18, 0xCF ; 207 16820: 3f e4 ldi r19, 0x4F ; 79 16822: b9 cf rjmp .-142 ; 0x16796 void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 16824: 8e e9 ldi r24, 0x9E ; 158 16826: 93 e0 ldi r25, 0x03 ; 3 16828: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 1682c: 83 e5 ldi r24, 0x53 ; 83 1682e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16832: 88 23 and r24, r24 16834: 09 f1 breq .+66 ; 0x16878 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 16836: 62 e2 ldi r22, 0x22 ; 34 16838: 70 e0 ldi r23, 0x00 ; 0 1683a: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1683e: 90 91 96 03 lds r25, 0x0396 ; 0x800396 16842: 0f 94 ab e2 call 0x3c556 ; 0x3c556 16846: 8c 01 movw r16, r24 if (!this->ptr) { 16848: 89 2b or r24, r25 1684a: b1 f0 breq .+44 ; 0x16878 // First quote not found return; } // Skip the leading quote this->ptr++; 1684c: 0f 5f subi r16, 0xFF ; 255 1684e: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 16850: 62 e2 ldi r22, 0x22 ; 34 16852: 70 e0 ldi r23, 0x00 ; 0 16854: c8 01 movw r24, r16 16856: 0f 94 ab e2 call 0x3c556 ; 0x3c556 if(!pStrEnd) { 1685a: 89 2b or r24, r25 1685c: 69 f0 breq .+26 ; 0x16878 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 1685e: ec e4 ldi r30, 0x4C ; 76 16860: f6 e0 ldi r31, 0x06 ; 6 16862: 83 e0 ldi r24, 0x03 ; 3 16864: df 01 movw r26, r30 16866: 1d 92 st X+, r1 16868: 8a 95 dec r24 1686a: e9 f7 brne .-6 ; 0x16866 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 1686c: 42 e0 ldi r20, 0x02 ; 2 1686e: 50 e0 ldi r21, 0x00 ; 0 16870: b8 01 movw r22, r16 16872: cf 01 movw r24, r30 16874: 0f 94 d4 e2 call 0x3c5a8 ; 0x3c5a8 } #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 16878: 8c e8 ldi r24, 0x8C ; 140 1687a: 9f e0 ldi r25, 0x0F ; 15 1687c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 && printer_recovering() && printingIsPaused()) { 16880: 81 30 cpi r24, 0x01 ; 1 16882: 09 f0 breq .+2 ; 0x16886 16884: 29 cc rjmp .-1966 ; 0x160d8 #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() 16886: 0e 94 fb 66 call 0xcdf6 ; 0xcdf6 1688a: 88 23 and r24, r24 1688c: 09 f4 brne .+2 ; 0x16890 1688e: 24 cc rjmp .-1976 ; 0x160d8 && printingIsPaused()) { 16890: 0e 94 05 67 call 0xce0a ; 0xce0a 16894: 88 23 and r24, r24 16896: 09 f4 brne .+2 ; 0x1689a 16898: 1f cc rjmp .-1986 ; 0x160d8 // 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) { 1689a: 80 91 ed 04 lds r24, 0x04ED ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.533> 1689e: 88 23 and r24, r24 168a0: 29 f0 breq .+10 ; 0x168ac SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 168a2: 8d ed ldi r24, 0xDD ; 221 168a4: 97 e6 ldi r25, 0x67 ; 103 168a6: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 168aa: 16 cc rjmp .-2004 ; 0x160d8 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 168ac: 80 ec ldi r24, 0xC0 ; 192 168ae: 97 e6 ldi r25, 0x67 ; 103 168b0: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 168b4: 11 cc rjmp .-2014 ; 0x160d8 /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 168b6: 83 ea ldi r24, 0xA3 ; 163 168b8: 97 e6 ldi r25, 0x67 ; 103 168ba: 0e 94 8a 79 call 0xf314 ; 0xf314 #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 168be: 83 e5 ldi r24, 0x53 ; 83 168c0: 0e 94 56 5b call 0xb6ac ; 0xb6ac 168c4: 88 23 and r24, r24 168c6: 09 f4 brne .+2 ; 0x168ca 168c8: 07 cc rjmp .-2034 ; 0x160d8 168ca: 0e 94 1d 60 call 0xc03a ; 0xc03a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 168ce: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 168d2: 70 93 73 06 sts 0x0673, r23 ; 0x800673 168d6: 60 93 72 06 sts 0x0672, r22 ; 0x800672 168da: fe cb rjmp .-2052 ; 0x160d8 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 "); 168dc: 8a ea ldi r24, 0xAA ; 170 168de: 96 e8 ldi r25, 0x86 ; 134 168e0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 gcode_M105(); 168e4: 0e 94 42 78 call 0xf084 ; 0xf084 cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 168e8: 0e 94 3c 76 call 0xec78 ; 0xec78 cmdbuffer_front_already_processed = true; 168ec: 81 e0 ldi r24, 0x01 ; 1 168ee: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 168f2: f2 cb rjmp .-2076 ; 0x160d8 168f4: 10 92 89 14 sts 0x1489, r1 ; 0x801489 168f8: 0c 94 59 a7 jmp 0x14eb2 ; 0x14eb2 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; } 168fc: 81 e0 ldi r24, 0x01 ; 1 168fe: 80 93 87 14 sts 0x1487, r24 ; 0x801487 16902: ea cb rjmp .-2092 ; 0x160d8 #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 16904: 82 e5 ldi r24, 0x52 ; 82 16906: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1690a: 81 11 cpse r24, r1 1690c: 0c 94 e5 a6 jmp 0x14dca ; 0x14dca autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 16910: 0f 94 51 2a call 0x254a2 ; 0x254a2 16914: 6b 01 movw r12, r22 16916: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 16918: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 1691c: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 16920: 07 2e mov r0, r23 16922: 00 0c add r0, r0 16924: 88 0b sbc r24, r24 16926: 99 0b sbc r25, r25 16928: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1692c: 11 e0 ldi r17, 0x01 ; 1 1692e: 20 91 b0 0d lds r18, 0x0DB0 ; 0x800db0 16932: 30 91 b1 0d lds r19, 0x0DB1 ; 0x800db1 16936: 40 91 b2 0d lds r20, 0x0DB2 ; 0x800db2 1693a: 50 91 b3 0d lds r21, 0x0DB3 ; 0x800db3 1693e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 16942: 18 16 cp r1, r24 16944: 0c f0 brlt .+2 ; 0x16948 16946: 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 16948: 10 93 af 0d sts 0x0DAF, r17 ; 0x800daf <_ZL16target_direction.lto_priv.534> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 1694c: c7 01 movw r24, r14 1694e: b6 01 movw r22, r12 16950: 0f 94 1c 83 call 0x30638 ; 0x30638 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 16954: 8b e5 ldi r24, 0x5B ; 91 16956: 9d e4 ldi r25, 0x4D ; 77 16958: 0e 94 2c 72 call 0xe458 ; 0xe458 1695c: 0e 94 3b f2 call 0x1e476 ; 0x1e476 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 16960: 82 e0 ldi r24, 0x02 ; 2 16962: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(2); previous_millis_cmd.start(); 16966: 86 e8 ldi r24, 0x86 ; 134 16968: 93 e0 ldi r25, 0x03 ; 3 1696a: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> 1696e: b4 cb rjmp .-2200 ; 0x160d8 */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 16970: 8d e4 ldi r24, 0x4D ; 77 16972: 9d e4 ldi r25, 0x4D ; 77 16974: 0e 94 2c 72 call 0xe458 ; 0xe458 16978: 0e 94 3b f2 call 0x1e476 ; 0x1e476 heating_status = HeatingStatus::BED_HEATING; 1697c: 83 e0 ldi r24, 0x03 ; 3 1697e: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(1); if (code_seen('S')) 16982: 83 e5 ldi r24, 0x53 ; 83 16984: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16988: 18 2f mov r17, r24 1698a: 88 23 and r24, r24 1698c: 49 f0 breq .+18 ; 0x169a0 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 1698e: 0e 94 1d 60 call 0xc03a ; 0xc03a target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 16992: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 16996: 70 93 73 06 sts 0x0673, r23 ; 0x800673 1699a: 60 93 72 06 sts 0x0672, r22 ; 0x800672 1699e: 05 c0 rjmp .+10 ; 0x169aa if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 169a0: 82 e5 ldi r24, 0x52 ; 82 169a2: 0e 94 56 5b call 0xb6ac ; 0xb6ac 169a6: 81 11 cpse r24, r1 169a8: f2 cf rjmp .-28 ; 0x1698e { setTargetBed(code_value()); } codenum = _millis(); 169aa: 0f 94 51 2a call 0x254a2 ; 0x254a2 169ae: 6b 01 movw r12, r22 169b0: 7c 01 movw r14, r24 cancel_heatup = false; 169b2: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.410> 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; 169b6: 60 91 72 06 lds r22, 0x0672 ; 0x800672 169ba: 70 91 73 06 lds r23, 0x0673 ; 0x800673 169be: 07 2e mov r0, r23 169c0: 00 0c add r0, r0 169c2: 88 0b sbc r24, r24 169c4: 99 0b sbc r25, r25 169c6: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 169ca: 01 e0 ldi r16, 0x01 ; 1 169cc: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 169d0: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 169d4: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 169d8: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 169dc: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 169e0: 18 16 cp r1, r24 169e2: 0c f0 brlt .+2 ; 0x169e6 169e4: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 169e6: 00 93 af 0d sts 0x0DAF, r16 ; 0x800daf <_ZL16target_direction.lto_priv.534> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 169ea: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.410> 169ee: 81 11 cpse r24, r1 169f0: 1c c0 rjmp .+56 ; 0x16a2a 169f2: 60 91 72 06 lds r22, 0x0672 ; 0x800672 169f6: 70 91 73 06 lds r23, 0x0673 ; 0x800673 169fa: 07 2e mov r0, r23 169fc: 00 0c add r0, r0 169fe: 88 0b sbc r24, r24 16a00: 99 0b sbc r25, r25 16a02: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 16a06: 9b 01 movw r18, r22 16a08: ac 01 movw r20, r24 16a0a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 16a0e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 16a12: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 16a16: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 16a1a: e0 91 af 0d lds r30, 0x0DAF ; 0x800daf <_ZL16target_direction.lto_priv.534> 16a1e: ee 23 and r30, r30 16a20: 91 f0 breq .+36 ; 0x16a46 16a22: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 16a26: 87 fd sbrc r24, 7 16a28: 14 c0 rjmp .+40 ; 0x16a52 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 16a2a: 82 e4 ldi r24, 0x42 ; 66 16a2c: 9d e4 ldi r25, 0x4D ; 77 16a2e: 0e 94 2c 72 call 0xe458 ; 0xe458 16a32: 0e 94 3b f2 call 0x1e476 ; 0x1e476 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 16a36: 84 e0 ldi r24, 0x04 ; 4 16a38: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 previous_millis_cmd.start(); 16a3c: 86 e8 ldi r24, 0x86 ; 134 16a3e: 93 e0 ldi r25, 0x03 ; 3 16a40: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> 16a44: 49 cb rjmp .-2414 ; 0x160d8 codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 16a46: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 16a4a: 18 16 cp r1, r24 16a4c: 74 f7 brge .-36 ; 0x16a2a 16a4e: 11 11 cpse r17, r1 16a50: ec cf rjmp .-40 ; 0x16a2a { if (lcd_commands_type == LcdCommands::LongPause) { 16a52: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 16a56: 82 30 cpi r24, 0x02 ; 2 16a58: 41 f3 breq .-48 ; 0x16a2a // 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. 16a5a: 0f 94 51 2a call 0x254a2 ; 0x254a2 16a5e: 6c 19 sub r22, r12 16a60: 7d 09 sbc r23, r13 16a62: 8e 09 sbc r24, r14 16a64: 9f 09 sbc r25, r15 16a66: 69 3e cpi r22, 0xE9 ; 233 16a68: 73 40 sbci r23, 0x03 ; 3 16a6a: 81 05 cpc r24, r1 16a6c: 91 05 cpc r25, r1 16a6e: 30 f0 brcs .+12 ; 0x16a7c { if (!farm_mode) { serialecho_temperatures(); 16a70: 0e 94 de 76 call 0xedbc ; 0xedbc } codenum = _millis(); 16a74: 0f 94 51 2a call 0x254a2 ; 0x254a2 16a78: 6b 01 movw r12, r22 16a7a: 7c 01 movw r14, r24 } manage_heater(); 16a7c: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(); 16a80: 80 e0 ldi r24, 0x00 ; 0 16a82: 0e 94 37 8a call 0x1146e ; 0x1146e lcd_update(0); 16a86: 80 e0 ldi r24, 0x00 ; 0 16a88: 0e 94 27 6e call 0xdc4e ; 0xdc4e 16a8c: ae cf rjmp .-164 ; 0x169ea #### 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')){ 16a8e: 83 e5 ldi r24, 0x53 ; 83 16a90: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16a94: 88 23 and r24, r24 16a96: 29 f0 breq .+10 ; 0x16aa2 fanSpeed = code_value_uint8(); 16a98: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 16a9c: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 16aa0: 1b cb rjmp .-2506 ; 0x160d8 } else { fanSpeed = 255; 16aa2: 8f ef ldi r24, 0xFF ; 255 16aa4: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 16aa8: 17 cb rjmp .-2514 ; 0x160d8 /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 16aaa: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 16aae: 14 cb rjmp .-2520 ; 0x160d8 /*! ### 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; 16ab0: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 16ab4: 88 60 ori r24, 0x08 ; 8 16ab6: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 16aba: 0e cb rjmp .-2532 ; 0x160d8 ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 16abc: 83 e5 ldi r24, 0x53 ; 83 16abe: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16ac2: 88 23 and r24, r24 16ac4: 99 f0 breq .+38 ; 0x16aec stepper_inactive_time = code_value() * 1000; 16ac6: 0e 94 1d 60 call 0xc03a ; 0xc03a 16aca: 20 e0 ldi r18, 0x00 ; 0 16acc: 30 e0 ldi r19, 0x00 ; 0 16ace: 4a e7 ldi r20, 0x7A ; 122 16ad0: 54 e4 ldi r21, 0x44 ; 68 16ad2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 16ad6: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 16ada: 60 93 34 02 sts 0x0234, r22 ; 0x800234 16ade: 70 93 35 02 sts 0x0235, r23 ; 0x800235 16ae2: 80 93 36 02 sts 0x0236, r24 ; 0x800236 16ae6: 90 93 37 02 sts 0x0237, r25 ; 0x800237 16aea: f6 ca rjmp .-2580 ; 0x160d8 } 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]))); 16aec: 88 e5 ldi r24, 0x58 ; 88 16aee: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16af2: 88 23 and r24, r24 16af4: d1 f0 breq .+52 ; 0x16b2a disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 16af6: 0f 94 ed 43 call 0x287da ; 0x287da if (code_seen('X')) disable_x(); 16afa: 88 e5 ldi r24, 0x58 ; 88 16afc: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16b00: 81 11 cpse r24, r1 16b02: 28 c0 rjmp .+80 ; 0x16b54 if (code_seen('Y')) disable_y(); 16b04: 89 e5 ldi r24, 0x59 ; 89 16b06: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16b0a: 88 23 and r24, r24 16b0c: 19 f0 breq .+6 ; 0x16b14 16b0e: 16 9a sbi 0x02, 6 ; 2 16b10: 10 92 90 06 sts 0x0690, r1 ; 0x800690 if (code_seen('Z')) disable_z(); 16b14: 8a e5 ldi r24, 0x5A ; 90 16b16: 0e 94 56 5b call 0xb6ac ; 0xb6ac #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 16b1a: 85 e4 ldi r24, 0x45 ; 69 16b1c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16b20: 88 23 and r24, r24 16b22: 09 f4 brne .+2 ; 0x16b26 16b24: d9 ca rjmp .-2638 ; 0x160d8 16b26: 14 9a sbi 0x02, 4 ; 2 16b28: d7 ca rjmp .-2642 ; 0x160d8 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]))); 16b2a: 89 e5 ldi r24, 0x59 ; 89 16b2c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16b30: 81 11 cpse r24, r1 16b32: e1 cf rjmp .-62 ; 0x16af6 16b34: 8a e5 ldi r24, 0x5A ; 90 16b36: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16b3a: 81 11 cpse r24, r1 16b3c: dc cf rjmp .-72 ; 0x16af6 16b3e: 85 e4 ldi r24, 0x45 ; 69 16b40: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16b44: 81 11 cpse r24, r1 16b46: d7 cf rjmp .-82 ; 0x16af6 if(all_axis) { st_synchronize(); 16b48: 0f 94 ed 43 call 0x287da ; 0x287da disable_e0(); 16b4c: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 16b4e: 0e 94 e8 81 call 0x103d0 ; 0x103d0 16b52: c2 ca rjmp .-2684 ; 0x160d8 } else { st_synchronize(); if (code_seen('X')) disable_x(); 16b54: 17 9a sbi 0x02, 7 ; 2 16b56: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f 16b5a: d4 cf rjmp .-88 ; 0x16b04 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 16b5c: 83 e5 ldi r24, 0x53 ; 83 16b5e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16b62: 88 23 and r24, r24 16b64: 09 f4 brne .+2 ; 0x16b68 16b66: b8 ca rjmp .-2704 ; 0x160d8 safetytimer_inactive_time = code_value() * 1000; 16b68: 0e 94 1d 60 call 0xc03a ; 0xc03a 16b6c: 20 e0 ldi r18, 0x00 ; 0 16b6e: 30 e0 ldi r19, 0x00 ; 0 16b70: 4a e7 ldi r20, 0x7A ; 122 16b72: 54 e4 ldi r21, 0x44 ; 68 16b74: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 16b78: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 16b7c: 60 93 30 02 sts 0x0230, r22 ; 0x800230 16b80: 70 93 31 02 sts 0x0231, r23 ; 0x800231 16b84: 80 93 32 02 sts 0x0232, r24 ; 0x800232 16b88: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 16b8c: 8a ed ldi r24, 0xDA ; 218 16b8e: 95 e0 ldi r25, 0x05 ; 5 16b90: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> 16b94: a1 ca rjmp .-2750 ; 0x160d8 16b96: fd ed ldi r31, 0xDD ; 221 16b98: cf 2e mov r12, r31 16b9a: f2 e0 ldi r31, 0x02 ; 2 16b9c: df 2e mov r13, r31 16b9e: ae eb ldi r26, 0xBE ; 190 16ba0: ea 2e mov r14, r26 16ba2: ad e0 ldi r26, 0x0D ; 13 16ba4: fa 2e mov r15, r26 - `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++) 16ba6: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 16ba8: f6 01 movw r30, r12 16baa: 81 91 ld r24, Z+ 16bac: 6f 01 movw r12, r30 16bae: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16bb2: 88 23 and r24, r24 16bb4: 09 f4 brne .+2 ; 0x16bb8 16bb6: 67 c0 rjmp .+206 ; 0x16c86 { float value = code_value(); 16bb8: 0e 94 1d 60 call 0xc03a ; 0xc03a 16bbc: 2b 01 movw r4, r22 16bbe: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 16bc0: 13 30 cpi r17, 0x03 ; 3 16bc2: 09 f0 breq .+2 ; 0x16bc6 16bc4: 6a c0 rjmp .+212 ; 0x16c9a if(value < 20.0) { 16bc6: 20 e0 ldi r18, 0x00 ; 0 16bc8: 30 e0 ldi r19, 0x00 ; 0 16bca: 40 ea ldi r20, 0xA0 ; 160 16bcc: 51 e4 ldi r21, 0x41 ; 65 16bce: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 16bd2: 87 ff sbrs r24, 7 16bd4: 4e c0 rjmp .+156 ; 0x16c72 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 16bd6: a3 01 movw r20, r6 16bd8: 92 01 movw r18, r4 16bda: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 16bde: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 16be2: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 16be6: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 16bea: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 16bee: 4b 01 movw r8, r22 16bf0: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 16bf2: ac 01 movw r20, r24 16bf4: 9b 01 movw r18, r22 16bf6: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 16bfa: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 16bfe: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 16c02: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 16c06: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 16c0a: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 16c0e: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 16c12: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 16c16: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 max_feedrate[E_AXIS] *= factor; 16c1a: 20 90 71 02 lds r2, 0x0271 ; 0x800271 16c1e: 30 90 72 02 lds r3, 0x0272 ; 0x800272 16c22: a5 01 movw r20, r10 16c24: 94 01 movw r18, r8 16c26: d1 01 movw r26, r2 16c28: 1c 96 adiw r26, 0x0c ; 12 16c2a: 6d 91 ld r22, X+ 16c2c: 7d 91 ld r23, X+ 16c2e: 8d 91 ld r24, X+ 16c30: 9c 91 ld r25, X 16c32: 1f 97 sbiw r26, 0x0f ; 15 16c34: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 16c38: f1 01 movw r30, r2 16c3a: 64 87 std Z+12, r22 ; 0x0c 16c3c: 75 87 std Z+13, r23 ; 0x0d 16c3e: 86 87 std Z+14, r24 ; 0x0e 16c40: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 16c42: 60 91 5a 05 lds r22, 0x055A ; 0x80055a 16c46: 70 91 5b 05 lds r23, 0x055B ; 0x80055b 16c4a: 80 91 5c 05 lds r24, 0x055C ; 0x80055c 16c4e: 90 91 5d 05 lds r25, 0x055D ; 0x80055d 16c52: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 16c56: a5 01 movw r20, r10 16c58: 94 01 movw r18, r8 16c5a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 16c5e: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 16c62: 60 93 5a 05 sts 0x055A, r22 ; 0x80055a 16c66: 70 93 5b 05 sts 0x055B, r23 ; 0x80055b 16c6a: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 16c6e: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d } cs.axis_steps_per_mm[E_AXIS] = value; 16c72: 40 92 ce 0d sts 0x0DCE, r4 ; 0x800dce 16c76: 50 92 cf 0d sts 0x0DCF, r5 ; 0x800dcf 16c7a: 60 92 d0 0d sts 0x0DD0, r6 ; 0x800dd0 16c7e: 70 92 d1 0d sts 0x0DD1, r7 ; 0x800dd1 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.init(); 16c82: 0f 94 74 7c call 0x2f8e8 ; 0x2f8e8 16c86: b4 e0 ldi r27, 0x04 ; 4 16c88: eb 0e add r14, r27 16c8a: f1 1c adc r15, r1 16c8c: 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++) 16c8e: 14 30 cpi r17, 0x04 ; 4 16c90: 09 f0 breq .+2 ; 0x16c94 16c92: 8a cf rjmp .-236 ; 0x16ba8 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 16c94: 0f 94 9a 64 call 0x2c934 ; 0x2c934 16c98: 1f ca rjmp .-3010 ; 0x160d8 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; 16c9a: d7 01 movw r26, r14 16c9c: 14 96 adiw r26, 0x04 ; 4 16c9e: 4d 92 st X+, r4 16ca0: 5d 92 st X+, r5 16ca2: 6d 92 st X+, r6 16ca4: 7c 92 st X, r7 16ca6: 17 97 sbiw r26, 0x07 ; 7 16ca8: ee cf rjmp .-36 ; 0x16c86 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 16caa: 8e e4 ldi r24, 0x4E ; 78 16cac: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16cb0: 88 23 and r24, r24 16cb2: 09 f4 brne .+2 ; 0x16cb6 16cb4: 11 ca rjmp .-3038 ; 0x160d8 gcode_LastN = code_value_long(); 16cb6: 0e 94 02 5b call 0xb604 ; 0xb604 16cba: 60 93 7a 03 sts 0x037A, r22 ; 0x80037a 16cbe: 70 93 7b 03 sts 0x037B, r23 ; 0x80037b 16cc2: 80 93 7c 03 sts 0x037C, r24 ; 0x80037c 16cc6: 90 93 7d 03 sts 0x037D, r25 ; 0x80037d 16cca: 06 ca rjmp .-3060 ; 0x160d8 case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 16ccc: 82 ec ldi r24, 0xC2 ; 194 16cce: 9a ea ldi r25, 0xAA ; 170 16cd0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 16cd4: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 16cd8: d1 2c mov r13, r1 16cda: f1 2c mov r15, r1 16cdc: 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); } 16cde: 83 ea ldi r24, 0xA3 ; 163 16ce0: 96 e8 ldi r25, 0x86 ; 134 16ce2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 16ce6: 4a e0 ldi r20, 0x0A ; 10 16ce8: c7 01 movw r24, r14 16cea: b6 01 movw r22, r12 16cec: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 16cf0: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a 16cf4: f1 c9 rjmp .-3102 ; 0x160d8 */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 16cf6: 85 e5 ldi r24, 0x55 ; 85 16cf8: 0e 94 56 5b call 0xb6ac ; 0xb6ac 16cfc: 88 23 and r24, r24 16cfe: 09 f4 brne .+2 ; 0x16d02 16d00: 5a c0 rjmp .+180 ; 0x16db6 // 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); 16d02: 00 91 95 03 lds r16, 0x0395 ; 0x800395 16d06: 10 91 96 03 lds r17, 0x0396 ; 0x800396 16d0a: 0f 5f subi r16, 0xFF ; 255 16d0c: 1f 4f sbci r17, 0xFF ; 255 16d0e: 10 93 96 03 sts 0x0396, r17 ; 0x800396 16d12: 00 93 95 03 sts 0x0395, r16 ; 0x800395 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 16d16: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 16d1a: 88 23 and r24, r24 16d1c: 09 f4 brne .+2 ; 0x16d20 16d1e: dc c9 rjmp .-3144 ; 0x160d8 // 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)) 16d20: be 01 movw r22, r28 16d22: 6f 5f subi r22, 0xFF ; 255 16d24: 7f 4f sbci r23, 0xFF ; 255 16d26: c8 01 movw r24, r16 16d28: 0e 94 4f f0 call 0x1e09e ; 0x1e09e 16d2c: 88 23 and r24, r24 16d2e: 09 f4 brne .+2 ; 0x16d32 16d30: d3 c9 rjmp .-3162 ; 0x160d8 16d32: 8a e2 ldi r24, 0x2A ; 42 16d34: 9d e8 ldi r25, 0x8D ; 141 16d36: de 01 movw r26, r28 16d38: 11 96 adiw r26, 0x01 ; 1 16d3a: be 01 movw r22, r28 16d3c: 67 5f subi r22, 0xF7 ; 247 16d3e: 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]); 16d40: fc 01 movw r30, r24 16d42: 45 91 lpm r20, Z+ 16d44: 54 91 lpm r21, Z if (ver_gcode[i] > v) 16d46: 2d 91 ld r18, X+ 16d48: 3d 91 ld r19, X+ 16d4a: 42 17 cp r20, r18 16d4c: 53 07 cpc r21, r19 16d4e: 10 f4 brcc .+4 ; 0x16d54 16d50: 0c 94 3d cd jmp 0x19a7a ; 0x19a7a return 1; else if (ver_gcode[i] < v) 16d54: 24 17 cp r18, r20 16d56: 35 07 cpc r19, r21 16d58: 08 f4 brcc .+2 ; 0x16d5c 16d5a: be c9 rjmp .-3204 ; 0x160d8 16d5c: 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) 16d5e: a6 17 cp r26, r22 16d60: b7 07 cpc r27, r23 16d62: 71 f7 brne .-36 ; 0x16d40 16d64: b9 c9 rjmp .-3214 ; 0x160d8 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)); 16d66: 83 e4 ldi r24, 0x43 ; 67 16d68: 99 e3 ldi r25, 0x39 ; 57 16d6a: 0e 94 2c 72 call 0xe458 ; 0xe458 16d6e: ac 01 movw r20, r24 16d70: 63 e0 ldi r22, 0x03 ; 3 16d72: 80 e0 ldi r24, 0x00 ; 0 16d74: 0e 94 74 6e call 0xdce8 ; 0xdce8 Sound_MakeCustom(50,1000,false); 16d78: 40 e0 ldi r20, 0x00 ; 0 16d7a: 68 ee ldi r22, 0xE8 ; 232 16d7c: 73 e0 ldi r23, 0x03 ; 3 16d7e: 82 e3 ldi r24, 0x32 ; 50 16d80: 90 e0 ldi r25, 0x00 ; 0 16d82: 0f 94 81 52 call 0x2a502 ; 0x2a502 delay_keep_alive(500); 16d86: 84 ef ldi r24, 0xF4 ; 244 16d88: 91 e0 ldi r25, 0x01 ; 1 16d8a: 0e 94 6c 8c call 0x118d8 ; 0x118d8 Sound_MakeCustom(50,1000,false); 16d8e: 40 e0 ldi r20, 0x00 ; 0 16d90: 68 ee ldi r22, 0xE8 ; 232 16d92: 73 e0 ldi r23, 0x03 ; 3 16d94: 82 e3 ldi r24, 0x32 ; 50 16d96: 90 e0 ldi r25, 0x00 ; 0 16d98: 0f 94 81 52 call 0x2a502 ; 0x2a502 lcd_wait_for_click_delay(30); 16d9c: 8e e1 ldi r24, 0x1E ; 30 16d9e: 90 e0 ldi r25, 0x00 ; 0 16da0: 0f 94 34 3b call 0x27668 ; 0x27668 lcd_update_enable(true); 16da4: 81 e0 ldi r24, 0x01 ; 1 16da6: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_clear(); 16daa: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_update(0); 16dae: 80 e0 ldi r24, 0x00 ; 0 16db0: 0e 94 27 6e call 0xdc4e ; 0xdc4e 16db4: 91 c9 rjmp .-3294 ; 0x160d8 } 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); 16db6: 41 e1 ldi r20, 0x11 ; 17 16db8: 50 e0 ldi r21, 0x00 ; 0 16dba: 60 e8 ldi r22, 0x80 ; 128 16dbc: 7c e0 ldi r23, 0x0C ; 12 16dbe: ce 01 movw r24, r28 16dc0: 01 96 adiw r24, 0x01 ; 1 16dc2: 0f 94 44 dc call 0x3b888 ; 0x3b888 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 16dc6: 85 e8 ldi r24, 0x85 ; 133 16dc8: 96 e8 ldi r25, 0x86 ; 134 16dca: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 16dce: 86 e0 ldi r24, 0x06 ; 6 16dd0: 94 e8 ldi r25, 0x84 ; 132 16dd2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM("+"); 16dd6: 83 e8 ldi r24, 0x83 ; 131 16dd8: 96 e8 ldi r25, 0x86 ; 134 16dda: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 16dde: 8e e7 ldi r24, 0x7E ; 126 16de0: 96 e8 ldi r25, 0x86 ; 134 16de2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM("_"); 16de6: 8c e7 ldi r24, 0x7C ; 124 16de8: 96 e8 ldi r25, 0x86 ; 134 16dea: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM(FW_COMMIT_HASH); 16dee: 82 e7 ldi r24, 0x72 ; 114 16df0: 96 e8 ldi r25, 0x86 ; 134 16df2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 16df6: 88 e1 ldi r24, 0x18 ; 24 16df8: 96 e8 ldi r25, 0x86 ; 134 16dfa: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM(PROTOCOL_VERSION); 16dfe: 84 e1 ldi r24, 0x14 ; 20 16e00: 96 e8 ldi r25, 0x86 ; 134 16e02: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 16e06: 85 e0 ldi r24, 0x05 ; 5 16e08: 96 e8 ldi r25, 0x86 ; 134 16e0a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 16e0e: ce 01 movw r24, r28 16e10: 01 96 adiw r24, 0x01 ; 1 16e12: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 16e16: 83 ef ldi r24, 0xF3 ; 243 16e18: 95 e8 ldi r25, 0x85 ; 133 16e1a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 16e1e: 82 ef ldi r24, 0xF2 ; 242 16e20: 95 e8 ldi r25, 0x85 ; 133 16e22: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 } #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'); 16e26: 1f 92 push r1 16e28: e1 e3 ldi r30, 0x31 ; 49 16e2a: fe 2e mov r15, r30 16e2c: ff 92 push r15 16e2e: 85 ef ldi r24, 0xF5 ; 245 16e30: 93 e8 ldi r25, 0x83 ; 131 16e32: 9f 93 push r25 16e34: 8f 93 push r24 16e36: 0e ea ldi r16, 0xAE ; 174 16e38: 13 e8 ldi r17, 0x83 ; 131 16e3a: 1f 93 push r17 16e3c: 0f 93 push r16 16e3e: 0f 94 16 db call 0x3b62c ; 0x3b62c 16e42: 1f 92 push r1 16e44: ff 92 push r15 16e46: 85 ee ldi r24, 0xE5 ; 229 16e48: 93 e8 ldi r25, 0x83 ; 131 16e4a: 9f 93 push r25 16e4c: 8f 93 push r24 16e4e: 1f 93 push r17 16e50: 0f 93 push r16 16e52: 0f 94 16 db call 0x3b62c ; 0x3b62c 16e56: 1f 92 push r1 16e58: ff 92 push r15 16e5a: 81 ed ldi r24, 0xD1 ; 209 16e5c: 93 e8 ldi r25, 0x83 ; 131 16e5e: 9f 93 push r25 16e60: 8f 93 push r24 16e62: 1f 93 push r17 16e64: 0f 93 push r16 16e66: 0f 94 16 db call 0x3b62c ; 0x3b62c 16e6a: 1f 92 push r1 16e6c: ff 92 push r15 16e6e: 84 ec ldi r24, 0xC4 ; 196 16e70: 93 e8 ldi r25, 0x83 ; 131 16e72: 9f 93 push r25 16e74: 8f 93 push r24 16e76: 1f 93 push r17 16e78: 0f 93 push r16 16e7a: 0f 94 16 db call 0x3b62c ; 0x3b62c 16e7e: 1f 92 push r1 16e80: ff 92 push r15 16e82: 89 eb ldi r24, 0xB9 ; 185 16e84: 93 e8 ldi r25, 0x83 ; 131 16e86: 9f 93 push r25 16e88: 8f 93 push r24 16e8a: 1f 93 push r17 16e8c: 0f 93 push r16 16e8e: 0f 94 16 db call 0x3b62c ; 0x3b62c 16e92: 0f b6 in r0, 0x3f ; 63 16e94: f8 94 cli 16e96: de bf out 0x3e, r29 ; 62 16e98: 0f be out 0x3f, r0 ; 63 16e9a: cd bf out 0x3d, r28 ; 61 16e9c: 1d c9 rjmp .-3526 ; 0x160d8 /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 16e9e: 0e 94 c7 77 call 0xef8e ; 0xef8e 16ea2: 1a c9 rjmp .-3532 ; 0x160d8 /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 16ea4: e0 91 95 03 lds r30, 0x0395 ; 0x800395 16ea8: f0 91 96 03 lds r31, 0x0396 ; 0x800396 16eac: cf 01 movw r24, r30 16eae: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 16eb0: 24 81 ldd r18, Z+4 ; 0x04 16eb2: 20 32 cpi r18, 0x20 ; 32 16eb4: 09 f4 brne .+2 ; 0x16eb8 16eb6: 01 96 adiw r24, 0x01 ; 1 16eb8: 0e 94 67 f5 call 0x1eace ; 0x1eace custom_message_type = CustomMsg::M117; 16ebc: 87 e0 ldi r24, 0x07 ; 7 16ebe: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 16ec2: 0a c9 rjmp .-3564 ; 0x160d8 - `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; 16ec4: 00 91 95 03 lds r16, 0x0395 ; 0x800395 16ec8: 10 91 96 03 lds r17, 0x0396 ; 0x800396 16ecc: 0b 5f subi r16, 0xFB ; 251 16ece: 1f 4f sbci r17, 0xFF ; 255 16ed0: 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; 16ed2: f1 2c mov r15, r1 16ed4: 40 e0 ldi r20, 0x00 ; 0 16ed6: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 16ed8: e9 f0 breq .+58 ; 0x16f14 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 16eda: d8 01 movw r26, r16 16edc: 9c 91 ld r25, X 16ede: 29 2f mov r18, r25 16ee0: 2b 7f andi r18, 0xFB ; 251 16ee2: 21 34 cpi r18, 0x41 ; 65 16ee4: b9 f4 brne .+46 ; 0x16f14 16ee6: 11 96 adiw r26, 0x01 ; 1 16ee8: 2c 91 ld r18, X 16eea: 21 33 cpi r18, 0x31 ; 49 16eec: 99 f4 brne .+38 ; 0x16f14 switch (p[0]) { 16eee: 91 34 cpi r25, 0x41 ; 65 16ef0: 71 f0 breq .+28 ; 0x16f0e 16ef2: 95 34 cpi r25, 0x45 ; 69 16ef4: 09 f4 brne .+2 ; 0x16ef8 case 'A': hasA = true; break; case 'E': hasE = true; break; 16ef6: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 16ef8: 98 01 movw r18, r16 16efa: 2e 5f subi r18, 0xFE ; 254 16efc: 3f 4f sbci r19, 0xFF ; 255 16efe: 89 01 movw r16, r18 16f00: 2f 5f subi r18, 0xFF ; 255 16f02: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 16f04: f8 01 movw r30, r16 16f06: 90 81 ld r25, Z 16f08: 90 32 cpi r25, 0x20 ; 32 16f0a: c9 f3 breq .-14 ; 0x16efe 16f0c: e4 cf rjmp .-56 ; 0x16ed6 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; 16f0e: ff 24 eor r15, r15 16f10: f3 94 inc r15 16f12: f2 cf rjmp .-28 ; 0x16ef8 } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 16f14: 44 23 and r20, r20 16f16: 21 f0 breq .+8 ; 0x16f20 16f18: 82 ec ldi r24, 0xC2 ; 194 16f1a: 9a ea ldi r25, 0xAA ; 170 16f1c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if (hasA) SERIAL_ECHOPGM("//"); 16f20: ff 20 and r15, r15 16f22: 21 f0 breq .+8 ; 0x16f2c 16f24: 8f ee ldi r24, 0xEF ; 239 16f26: 95 e8 ldi r25, 0x85 ; 133 16f28: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(p); 16f2c: c8 01 movw r24, r16 16f2e: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 16f32: d2 c8 rjmp .-3676 ; 0x160d8 /*! ### 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 16f34: 8a e8 ldi r24, 0x8A ; 138 16f36: 97 e6 ldi r25, 0x67 ; 103 16f38: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLLN(); 16f3c: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 16f40: 82 e8 ldi r24, 0x82 ; 130 16f42: 97 e6 ldi r25, 0x67 ; 103 16f44: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 16f48: 1e 99 sbic 0x03, 6 ; 3 16f4a: 47 c0 rjmp .+142 ; 0x16fda SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16f4c: 8d e7 ldi r24, 0x7D ; 125 16f4e: 97 e6 ldi r25, 0x67 ; 103 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); 16f50: 0e 94 d0 76 call 0xeda0 ; 0xeda0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16f54: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 16f58: 8b e6 ldi r24, 0x6B ; 107 16f5a: 97 e6 ldi r25, 0x67 ; 103 16f5c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 16f60: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 16f64: 82 fd sbrc r24, 2 16f66: 3c c0 rjmp .+120 ; 0x16fe0 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16f68: 8d e7 ldi r24, 0x7D ; 125 16f6a: 97 e6 ldi r25, 0x67 ; 103 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); 16f6c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16f70: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 16f74: 83 e6 ldi r24, 0x63 ; 99 16f76: 97 e6 ldi r25, 0x67 ; 103 16f78: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 16f7c: 1d 99 sbic 0x03, 5 ; 3 16f7e: 33 c0 rjmp .+102 ; 0x16fe6 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16f80: 8d e7 ldi r24, 0x7D ; 125 16f82: 97 e6 ldi r25, 0x67 ; 103 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); 16f84: 0e 94 d0 76 call 0xeda0 ; 0xeda0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16f88: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 16f8c: 8b e5 ldi r24, 0x5B ; 91 16f8e: 97 e6 ldi r25, 0x67 ; 103 16f90: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 16f94: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 16f98: 87 fd sbrc r24, 7 16f9a: 28 c0 rjmp .+80 ; 0x16fec SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16f9c: 8d e7 ldi r24, 0x7D ; 125 16f9e: 97 e6 ldi r25, 0x67 ; 103 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); 16fa0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16fa4: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 16fa8: 83 e5 ldi r24, 0x53 ; 83 16faa: 97 e6 ldi r25, 0x67 ; 103 16fac: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 16fb0: 1c 99 sbic 0x03, 4 ; 3 16fb2: 1f c0 rjmp .+62 ; 0x16ff2 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16fb4: 8d e7 ldi r24, 0x7D ; 125 16fb6: 97 e6 ldi r25, 0x67 ; 103 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); 16fb8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16fbc: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 16fc0: 8b e4 ldi r24, 0x4B ; 75 16fc2: 97 e6 ldi r25, 0x67 ; 103 16fc4: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 16fc8: 01 9b sbis 0x00, 1 ; 0 16fca: 16 c0 rjmp .+44 ; 0x16ff8 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16fcc: 8d e7 ldi r24, 0x7D ; 125 16fce: 97 e6 ldi r25, 0x67 ; 103 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); 16fd0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16fd4: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a 16fd8: 7f c8 rjmp .-3842 ; 0x160d8 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); 16fda: 83 e7 ldi r24, 0x73 ; 115 16fdc: 97 e6 ldi r25, 0x67 ; 103 16fde: b8 cf rjmp .-144 ; 0x16f50 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); 16fe0: 83 e7 ldi r24, 0x73 ; 115 16fe2: 97 e6 ldi r25, 0x67 ; 103 16fe4: c3 cf rjmp .-122 ; 0x16f6c 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); 16fe6: 83 e7 ldi r24, 0x73 ; 115 16fe8: 97 e6 ldi r25, 0x67 ; 103 16fea: cc cf rjmp .-104 ; 0x16f84 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); 16fec: 83 e7 ldi r24, 0x73 ; 115 16fee: 97 e6 ldi r25, 0x67 ; 103 16ff0: d7 cf rjmp .-82 ; 0x16fa0 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); 16ff2: 83 e7 ldi r24, 0x73 ; 115 16ff4: 97 e6 ldi r25, 0x67 ; 103 16ff6: e0 cf rjmp .-64 ; 0x16fb8 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); 16ff8: 83 e7 ldi r24, 0x73 ; 115 16ffa: 97 e6 ldi r25, 0x67 ; 103 16ffc: e9 cf rjmp .-46 ; 0x16fd0 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 16ffe: 0e 94 04 66 call 0xcc08 ; 0xcc08 17002: 6a c8 rjmp .-3884 ; 0x160d8 */ 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')) { 17004: 84 e5 ldi r24, 0x54 ; 84 17006: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1700a: 88 23 and r24, r24 1700c: 69 f0 breq .+26 ; 0x17028 extruder = code_value_uint8(); 1700e: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 if(extruder >= EXTRUDERS) { 17012: 88 23 and r24, r24 17014: 49 f0 breq .+18 ; 0x17028 SERIAL_ECHO_START; 17016: 82 ec ldi r24, 0xC2 ; 194 17018: 9a ea ldi r25, 0xAA ; 170 1701a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 1701e: 84 e3 ldi r24, 0x34 ; 52 17020: 97 e6 ldi r25, 0x67 ; 103 17022: 0e 94 94 87 call 0x10f28 ; 0x10f28 17026: 58 c8 rjmp .-3920 ; 0x160d8 SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 17028: 84 e4 ldi r24, 0x44 ; 68 1702a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1702e: 88 23 and r24, r24 17030: 09 f4 brne .+2 ; 0x17034 17032: 52 c8 rjmp .-3932 ; 0x160d8 float diameter = code_value(); 17034: 0e 94 1d 60 call 0xc03a ; 0xc03a if (diameter == 0.0) { 17038: 20 e0 ldi r18, 0x00 ; 0 1703a: 30 e0 ldi r19, 0x00 ; 0 1703c: a9 01 movw r20, r18 1703e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 17042: 81 11 cpse r24, r1 17044: 05 c0 rjmp .+10 ; 0x17050 // 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; 17046: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 1704a: 0e 94 39 65 call 0xca72 ; 0xca72 1704e: 44 c8 rjmp .-3960 ; 0x160d8 // 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(); 17050: 0e 94 1d 60 call 0xc03a ; 0xc03a 17054: 6b 01 movw r12, r22 17056: 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]); 17058: 20 e0 ldi r18, 0x00 ; 0 1705a: 30 e0 ldi r19, 0x00 ; 0 1705c: a9 01 movw r20, r18 1705e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 17062: 81 11 cpse r24, r1 17064: 06 c0 rjmp .+12 ; 0x17072 17066: c1 2c mov r12, r1 17068: d1 2c mov r13, r1 1706a: 70 ee ldi r23, 0xE0 ; 224 1706c: e7 2e mov r14, r23 1706e: 7f e3 ldi r23, 0x3F ; 63 17070: f7 2e mov r15, r23 17072: c0 92 56 0e sts 0x0E56, r12 ; 0x800e56 17076: d0 92 57 0e sts 0x0E57, r13 ; 0x800e57 1707a: e0 92 58 0e sts 0x0E58, r14 ; 0x800e58 1707e: f0 92 59 0e sts 0x0E59, r15 ; 0x800e59 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; 17082: 81 e0 ldi r24, 0x01 ; 1 17084: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 17088: e0 cf rjmp .-64 ; 0x1704a 1708a: 5d ed ldi r21, 0xDD ; 221 1708c: c5 2e mov r12, r21 1708e: 52 e0 ldi r21, 0x02 ; 2 17090: d5 2e mov r13, r21 17092: 6e eb ldi r22, 0xBE ; 190 17094: e6 2e mov r14, r22 17096: 6d e0 ldi r22, 0x0D ; 13 17098: f6 2e mov r15, r22 - `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++) 1709a: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 1709c: d6 01 movw r26, r12 1709e: 8d 91 ld r24, X+ 170a0: 6d 01 movw r12, r26 170a2: 0e 94 56 5b call 0xb6ac ; 0xb6ac 170a6: 88 23 and r24, r24 170a8: 41 f1 breq .+80 ; 0x170fa { unsigned long val = code_value(); 170aa: 0e 94 1d 60 call 0xc03a ; 0xc03a 170ae: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 170b2: 12 30 cpi r17, 0x02 ; 2 170b4: 4c f5 brge .+82 ; 0x17108 { if (val > NORMAL_MAX_ACCEL_XY) 170b6: 65 3c cpi r22, 0xC5 ; 197 170b8: b9 e0 ldi r27, 0x09 ; 9 170ba: 7b 07 cpc r23, r27 170bc: 81 05 cpc r24, r1 170be: 91 05 cpc r25, r1 170c0: 40 f5 brcc .+80 ; 0x17112 170c2: 56 2f mov r21, r22 170c4: 47 2f mov r20, r23 170c6: 38 2f mov r19, r24 170c8: 29 2f mov r18, r25 170ca: 61 3c cpi r22, 0xC1 ; 193 170cc: e3 e0 ldi r30, 0x03 ; 3 170ce: 7e 07 cpc r23, r30 170d0: 81 05 cpc r24, r1 170d2: 91 05 cpc r25, r1 170d4: 20 f0 brcs .+8 ; 0x170de 170d6: 50 ec ldi r21, 0xC0 ; 192 170d8: 43 e0 ldi r20, 0x03 ; 3 170da: 30 e0 ldi r19, 0x00 ; 0 170dc: 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; 170de: d7 01 movw r26, r14 170e0: 94 96 adiw r26, 0x24 ; 36 170e2: 6d 93 st X+, r22 170e4: 7d 93 st X+, r23 170e6: 8d 93 st X+, r24 170e8: 9c 93 st X, r25 170ea: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 170ec: f7 01 movw r30, r14 170ee: e4 55 subi r30, 0x54 ; 84 170f0: ff 4f sbci r31, 0xFF ; 255 170f2: 50 83 st Z, r21 170f4: 41 83 std Z+1, r20 ; 0x01 170f6: 32 83 std Z+2, r19 ; 0x02 170f8: 23 83 std Z+3, r18 ; 0x03 170fa: b4 e0 ldi r27, 0x04 ; 4 170fc: eb 0e add r14, r27 170fe: f1 1c adc r15, r1 17100: 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++) 17102: 14 30 cpi r17, 0x04 ; 4 17104: 59 f6 brne .-106 ; 0x1709c 17106: c6 cd rjmp .-1140 ; 0x16c94 { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 17108: 56 2f mov r21, r22 1710a: 47 2f mov r20, r23 1710c: 38 2f mov r19, r24 1710e: 29 2f mov r18, r25 17110: e6 cf rjmp .-52 ; 0x170de 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; 17112: 50 ec ldi r21, 0xC0 ; 192 17114: 43 e0 ldi r20, 0x03 ; 3 17116: 30 e0 ldi r19, 0x00 ; 0 17118: 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; 1711a: 64 ec ldi r22, 0xC4 ; 196 1711c: 79 e0 ldi r23, 0x09 ; 9 1711e: 80 e0 ldi r24, 0x00 ; 0 17120: 90 e0 ldi r25, 0x00 ; 0 17122: dd cf rjmp .-70 ; 0x170de 17124: 3d ed ldi r19, 0xDD ; 221 17126: a3 2e mov r10, r19 17128: 32 e0 ldi r19, 0x02 ; 2 1712a: b3 2e mov r11, r19 1712c: 4e eb ldi r20, 0xBE ; 190 1712e: c4 2e mov r12, r20 17130: 4d e0 ldi r20, 0x0D ; 13 17132: d4 2e mov r13, r20 - `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++) 17134: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 17136: f5 01 movw r30, r10 17138: 81 91 ld r24, Z+ 1713a: 5f 01 movw r10, r30 1713c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17140: 88 23 and r24, r24 17142: 71 f1 breq .+92 ; 0x171a0 { float val = code_value(); 17144: 0e 94 1d 60 call 0xc03a ; 0xc03a 17148: 7b 01 movw r14, r22 1714a: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 1714c: f1 e0 ldi r31, 0x01 ; 1 1714e: f9 15 cp r31, r9 17150: b8 f1 brcs .+110 ; 0x171c0 { if (val > NORMAL_MAX_FEEDRATE_XY) 17152: 20 e0 ldi r18, 0x00 ; 0 17154: 30 e0 ldi r19, 0x00 ; 0 17156: 48 e4 ldi r20, 0x48 ; 72 17158: 53 e4 ldi r21, 0x43 ; 67 1715a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1715e: 18 16 cp r1, r24 17160: 44 f1 brlt .+80 ; 0x171b2 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(); 17162: 5e 2c mov r5, r14 17164: 6f 2c mov r6, r15 17166: 70 2e mov r7, r16 17168: 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) 1716a: 20 e0 ldi r18, 0x00 ; 0 1716c: 30 e0 ldi r19, 0x00 ; 0 1716e: 48 ec ldi r20, 0xC8 ; 200 17170: 52 e4 ldi r21, 0x42 ; 66 17172: b7 01 movw r22, r14 17174: c8 01 movw r24, r16 17176: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1717a: 18 16 cp r1, r24 1717c: 34 f1 brlt .+76 ; 0x171ca val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 1717e: 85 2d mov r24, r5 17180: 96 2d mov r25, r6 17182: a7 2d mov r26, r7 17184: b8 2d mov r27, r8 17186: f6 01 movw r30, r12 17188: 84 8b std Z+20, r24 ; 0x14 1718a: 95 8b std Z+21, r25 ; 0x15 1718c: a6 8b std Z+22, r26 ; 0x16 1718e: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 17190: c7 01 movw r24, r14 17192: d8 01 movw r26, r16 17194: e4 56 subi r30, 0x64 ; 100 17196: ff 4f sbci r31, 0xFF ; 255 17198: 80 83 st Z, r24 1719a: 91 83 std Z+1, r25 ; 0x01 1719c: a2 83 std Z+2, r26 ; 0x02 1719e: 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++) 171a0: 93 94 inc r9 171a2: f4 e0 ldi r31, 0x04 ; 4 171a4: cf 0e add r12, r31 171a6: d1 1c adc r13, r1 171a8: 24 e0 ldi r18, 0x04 ; 4 171aa: 92 12 cpse r9, r18 171ac: c4 cf rjmp .-120 ; 0x17136 171ae: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 171b2: 51 2c mov r5, r1 171b4: 61 2c mov r6, r1 171b6: 98 e4 ldi r25, 0x48 ; 72 171b8: 79 2e mov r7, r25 171ba: 23 e4 ldi r18, 0x43 ; 67 171bc: 82 2e mov r8, r18 171be: d5 cf rjmp .-86 ; 0x1716a 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(); 171c0: 56 2e mov r5, r22 171c2: 6f 2c mov r6, r15 171c4: 78 2e mov r7, r24 171c6: 81 2e mov r8, r17 171c8: da cf rjmp .-76 ; 0x1717e 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; 171ca: e1 2c mov r14, r1 171cc: f1 2c mov r15, r1 171ce: 08 ec ldi r16, 0xC8 ; 200 171d0: 12 e4 ldi r17, 0x42 ; 66 171d2: d5 cf rjmp .-86 ; 0x1717e // 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')) 171d4: 80 e5 ldi r24, 0x50 ; 80 171d6: 0e 94 56 5b call 0xb6ac ; 0xb6ac 171da: 88 23 and r24, r24 171dc: 51 f0 breq .+20 ; 0x171f2 cs.acceleration = code_value(); 171de: 0e 94 1d 60 call 0xc03a ; 0xc03a 171e2: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 171e6: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 171ea: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 171ee: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 if(code_seen('R')) 171f2: 82 e5 ldi r24, 0x52 ; 82 171f4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 171f8: 88 23 and r24, r24 171fa: 51 f0 breq .+20 ; 0x17210 cs.retract_acceleration = code_value(); 171fc: 0e 94 1d 60 call 0xc03a ; 0xc03a 17200: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 17204: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 17208: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 1720c: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 if(code_seen('T')) 17210: 84 e5 ldi r24, 0x54 ; 84 17212: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17216: 88 23 and r24, r24 17218: 11 f4 brne .+4 ; 0x1721e 1721a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 cs.travel_acceleration = code_value(); 1721e: 0e 94 1d 60 call 0xc03a ; 0xc03a 17222: 60 93 7e 0e sts 0x0E7E, r22 ; 0x800e7e 17226: 70 93 7f 0e sts 0x0E7F, r23 ; 0x800e7f 1722a: 80 93 80 0e sts 0x0E80, r24 ; 0x800e80 1722e: 90 93 81 0e sts 0x0E81, r25 ; 0x800e81 17232: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 17236: 83 e5 ldi r24, 0x53 ; 83 17238: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1723c: 88 23 and r24, r24 1723e: 51 f0 breq .+20 ; 0x17254 17240: 0e 94 1d 60 call 0xc03a ; 0xc03a 17244: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 17248: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 1724c: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 17250: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd if(code_seen('T')) cs.mintravelfeedrate = code_value(); 17254: 84 e5 ldi r24, 0x54 ; 84 17256: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1725a: 88 23 and r24, r24 1725c: 51 f0 breq .+20 ; 0x17272 1725e: 0e 94 1d 60 call 0xc03a ; 0xc03a 17262: 60 93 fe 0d sts 0x0DFE, r22 ; 0x800dfe 17266: 70 93 ff 0d sts 0x0DFF, r23 ; 0x800dff 1726a: 80 93 00 0e sts 0x0E00, r24 ; 0x800e00 1726e: 90 93 01 0e sts 0x0E01, r25 ; 0x800e01 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 17272: 82 e4 ldi r24, 0x42 ; 66 17274: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17278: 88 23 and r24, r24 1727a: 61 f0 breq .+24 ; 0x17294 1727c: 0e 94 1d 60 call 0xc03a ; 0xc03a 17280: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 17284: 60 93 02 0e sts 0x0E02, r22 ; 0x800e02 17288: 70 93 03 0e sts 0x0E03, r23 ; 0x800e03 1728c: 80 93 04 0e sts 0x0E04, r24 ; 0x800e04 17290: 90 93 05 0e sts 0x0E05, r25 ; 0x800e05 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 17294: 88 e5 ldi r24, 0x58 ; 88 17296: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1729a: 88 23 and r24, r24 1729c: 91 f0 breq .+36 ; 0x172c2 1729e: 0e 94 1d 60 call 0xc03a ; 0xc03a 172a2: 60 93 0a 0e sts 0x0E0A, r22 ; 0x800e0a 172a6: 70 93 0b 0e sts 0x0E0B, r23 ; 0x800e0b 172aa: 80 93 0c 0e sts 0x0E0C, r24 ; 0x800e0c 172ae: 90 93 0d 0e sts 0x0E0D, r25 ; 0x800e0d 172b2: 60 93 06 0e sts 0x0E06, r22 ; 0x800e06 172b6: 70 93 07 0e sts 0x0E07, r23 ; 0x800e07 172ba: 80 93 08 0e sts 0x0E08, r24 ; 0x800e08 172be: 90 93 09 0e sts 0x0E09, r25 ; 0x800e09 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 172c2: 89 e5 ldi r24, 0x59 ; 89 172c4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 172c8: 88 23 and r24, r24 172ca: 51 f0 breq .+20 ; 0x172e0 172cc: 0e 94 1d 60 call 0xc03a ; 0xc03a 172d0: 60 93 0a 0e sts 0x0E0A, r22 ; 0x800e0a 172d4: 70 93 0b 0e sts 0x0E0B, r23 ; 0x800e0b 172d8: 80 93 0c 0e sts 0x0E0C, r24 ; 0x800e0c 172dc: 90 93 0d 0e sts 0x0E0D, r25 ; 0x800e0d if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 172e0: 8a e5 ldi r24, 0x5A ; 90 172e2: 0e 94 56 5b call 0xb6ac ; 0xb6ac 172e6: 88 23 and r24, r24 172e8: 51 f0 breq .+20 ; 0x172fe 172ea: 0e 94 1d 60 call 0xc03a ; 0xc03a 172ee: 60 93 0e 0e sts 0x0E0E, r22 ; 0x800e0e 172f2: 70 93 0f 0e sts 0x0E0F, r23 ; 0x800e0f 172f6: 80 93 10 0e sts 0x0E10, r24 ; 0x800e10 172fa: 90 93 11 0e sts 0x0E11, r25 ; 0x800e11 if(code_seen('E')) 172fe: 85 e4 ldi r24, 0x45 ; 69 17300: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17304: 88 23 and r24, r24 17306: 11 f4 brne .+4 ; 0x1730c 17308: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { float e = code_value(); 1730c: 0e 94 1d 60 call 0xc03a ; 0xc03a #ifndef LA_NOCOMPAT e = la10c_jerk(e); 17310: 0e 94 32 81 call 0x10264 ; 0x10264 #endif cs.max_jerk[E_AXIS] = e; 17314: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 17318: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 1731c: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 17320: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 17324: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 17328: 0d ed ldi r16, 0xDD ; 221 1732a: 12 e0 ldi r17, 0x02 ; 2 1732c: 86 e1 ldi r24, 0x16 ; 22 1732e: e8 2e mov r14, r24 17330: 8e e0 ldi r24, 0x0E ; 14 17332: f8 2e mov r15, r24 - `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(); 17334: d8 01 movw r26, r16 17336: 8d 91 ld r24, X+ 17338: 8d 01 movw r16, r26 1733a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1733e: 88 23 and r24, r24 17340: 39 f0 breq .+14 ; 0x17350 17342: 0e 94 1d 60 call 0xc03a ; 0xc03a 17346: f7 01 movw r30, r14 17348: 60 83 st Z, r22 1734a: 71 83 std Z+1, r23 ; 0x01 1734c: 82 83 std Z+2, r24 ; 0x02 1734e: 93 83 std Z+3, r25 ; 0x03 17350: f4 e0 ldi r31, 0x04 ; 4 17352: ef 0e add r14, r31 17354: 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++) 17356: 22 e0 ldi r18, 0x02 ; 2 17358: 00 3e cpi r16, 0xE0 ; 224 1735a: 12 07 cpc r17, r18 1735c: 59 f7 brne .-42 ; 0x17334 1735e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 - `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')) 17362: 83 e5 ldi r24, 0x53 ; 83 17364: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17368: 88 23 and r24, r24 1736a: 51 f0 breq .+20 ; 0x17380 { cs.retract_recover_length = code_value() ; 1736c: 0e 94 1d 60 call 0xc03a ; 0xc03a 17370: 60 93 4d 0e sts 0x0E4D, r22 ; 0x800e4d 17374: 70 93 4e 0e sts 0x0E4E, r23 ; 0x800e4e 17378: 80 93 4f 0e sts 0x0E4F, r24 ; 0x800e4f 1737c: 90 93 50 0e sts 0x0E50, r25 ; 0x800e50 } if(code_seen('F')) 17380: 86 e4 ldi r24, 0x46 ; 70 17382: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17386: 88 23 and r24, r24 17388: 11 f4 brne .+4 ; 0x1738e 1738a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 1738e: 0e 94 1d 60 call 0xc03a ; 0xc03a 17392: 0e 94 47 66 call 0xcc8e ; 0xcc8e 17396: 60 93 51 0e sts 0x0E51, r22 ; 0x800e51 1739a: 70 93 52 0e sts 0x0E52, r23 ; 0x800e52 1739e: 80 93 53 0e sts 0x0E53, r24 ; 0x800e53 173a2: 90 93 54 0e sts 0x0E54, r25 ; 0x800e54 173a6: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 #### 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')) 173aa: 83 e5 ldi r24, 0x53 ; 83 173ac: 0e 94 56 5b call 0xb6ac ; 0xb6ac 173b0: 88 23 and r24, r24 173b2: 11 f4 brne .+4 ; 0x173b8 173b4: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { switch(code_value_uint8()) 173b8: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 173bc: 88 23 and r24, r24 173be: c1 f0 breq .+48 ; 0x173f0 173c0: 81 30 cpi r24, 0x01 ; 1 173c2: e1 f0 breq .+56 ; 0x173fc #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 173c4: 82 ec ldi r24, 0xC2 ; 194 173c6: 9a ea ldi r25, 0xAA ; 170 173c8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 173cc: 81 e2 ldi r24, 0x21 ; 33 173ce: 97 e6 ldi r25, 0x67 ; 103 173d0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 173d4: 80 91 92 12 lds r24, 0x1292 ; 0x801292 173d8: 90 91 93 12 lds r25, 0x1293 ; 0x801293 173dc: 88 55 subi r24, 0x58 ; 88 173de: 9f 4e sbci r25, 0xEF ; 239 173e0: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_ECHOLNPGM("\"(1)"); 173e4: 8a ee ldi r24, 0xEA ; 234 173e6: 95 e8 ldi r25, 0x85 ; 133 173e8: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 173ec: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 173f0: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 retracted[0]=false; 173f4: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e 173f8: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 173fc: 80 93 40 0e sts 0x0E40, r24 ; 0x800e40 retracted[0]=false; 17400: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e 17404: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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; 17408: 40 90 82 0e lds r4, 0x0E82 ; 0x800e82 1740c: 50 90 83 0e lds r5, 0x0E83 ; 0x800e83 17410: 60 90 84 0e lds r6, 0x0E84 ; 0x800e84 17414: 70 90 85 0e lds r7, 0x0E85 ; 0x800e85 17418: 0c 94 0f a8 jmp 0x1501e ; 0x1501e float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 1741c: 80 90 86 0e lds r8, 0x0E86 ; 0x800e86 17420: 90 90 87 0e lds r9, 0x0E87 ; 0x800e87 17424: a0 90 88 0e lds r10, 0x0E88 ; 0x800e88 17428: b0 90 89 0e lds r11, 0x0E89 ; 0x800e89 1742c: 0c 94 1a a8 jmp 0x15034 ; 0x15034 - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 17430: 82 e4 ldi r24, 0x42 ; 66 17432: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17436: 18 2f mov r17, r24 17438: 88 23 and r24, r24 1743a: 41 f0 breq .+16 ; 0x1744c { saved_feedmultiply_mm = feedmultiply; 1743c: 80 91 39 02 lds r24, 0x0239 ; 0x800239 17440: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 17444: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 17448: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 1744c: 83 e5 ldi r24, 0x53 ; 83 1744e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17452: 08 2f mov r16, r24 17454: 88 23 and r24, r24 17456: 39 f0 breq .+14 ; 0x17466 { feedmultiply = code_value_short(); 17458: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 1745c: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 17460: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 17464: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 17466: 82 e5 ldi r24, 0x52 ; 82 17468: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1746c: 88 23 and r24, r24 1746e: 51 f0 breq .+20 ; 0x17484 { feedmultiply = saved_feedmultiply_mm; 17470: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 17474: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 17478: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 1747c: 80 93 39 02 sts 0x0239, r24 ; 0x800239 17480: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 codesWereSeen = true; } if (!codesWereSeen) 17484: 11 11 cpse r17, r1 17486: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { printf_P(PSTR("%i%%\n"), feedmultiply); 1748a: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 1748e: 8f 93 push r24 17490: 80 91 39 02 lds r24, 0x0239 ; 0x800239 17494: 8f 93 push r24 17496: 84 ee ldi r24, 0xE4 ; 228 17498: 95 e8 ldi r25, 0x85 ; 133 1749a: 9f 93 push r25 1749c: 8f 93 push r24 1749e: 0f 94 16 db call 0x3b62c ; 0x3b62c 174a2: 0f 90 pop r0 174a4: 0f 90 pop r0 174a6: 0f 90 pop r0 174a8: 0f 90 pop r0 174aa: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 174ae: 80 91 bd 02 lds r24, 0x02BD ; 0x8002bd 174b2: 8f 93 push r24 174b4: 80 91 bc 02 lds r24, 0x02BC ; 0x8002bc 174b8: 8f 93 push r24 174ba: 8e ed ldi r24, 0xDE ; 222 174bc: 95 e8 ldi r25, 0x85 ; 133 174be: 9f 93 push r25 174c0: 8f 93 push r24 174c2: 0f 94 16 db call 0x3b62c ; 0x3b62c 174c6: 0f 90 pop r0 174c8: 0f 90 pop r0 174ca: 0f 90 pop r0 174cc: 0f 90 pop r0 174ce: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 174d2: 80 e5 ldi r24, 0x50 ; 80 174d4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 174d8: 88 23 and r24, r24 174da: 11 f4 brne .+4 ; 0x174e0 174dc: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 int pin_number = code_value_short(); // pin number 174e0: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 174e4: 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 174e6: 83 e5 ldi r24, 0x53 ; 83 174e8: 0e 94 56 5b call 0xb6ac ; 0xb6ac */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 174ec: 0f ef ldi r16, 0xFF ; 255 174ee: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 174f0: 88 23 and r24, r24 174f2: 19 f0 breq .+6 ; 0x174fa 174f4: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 174f8: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 174fa: c8 01 movw r24, r16 174fc: 01 96 adiw r24, 0x01 ; 1 174fe: 03 97 sbiw r24, 0x03 ; 3 17500: 10 f0 brcs .+4 ; 0x17506 17502: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 17506: e2 ed ldi r30, 0xD2 ; 210 17508: f6 e8 ldi r31, 0x86 ; 134 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)) 1750a: 84 91 lpm r24, Z 1750c: 08 2e mov r0, r24 1750e: 00 0c add r0, r0 17510: 99 0b sbc r25, r25 17512: e8 16 cp r14, r24 17514: f9 06 cpc r15, r25 17516: 11 f4 brne .+4 ; 0x1751c 17518: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 1751c: 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++) 1751e: 36 e8 ldi r19, 0x86 ; 134 17520: ee 3e cpi r30, 0xEE ; 238 17522: f3 07 cpc r31, r19 17524: 91 f7 brne .-28 ; 0x1750a pin_number = -1; break; } } if (pin_number > -1) 17526: f7 fe sbrs r15, 7 17528: 02 c0 rjmp .+4 ; 0x1752e 1752a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { int target = LOW; st_synchronize(); 1752e: 0f 94 ed 43 call 0x287da ; 0x287da pinMode(pin_number, INPUT); 17532: de 2c mov r13, r14 17534: 60 e0 ldi r22, 0x00 ; 0 17536: 8e 2d mov r24, r14 17538: 0e 94 c3 e9 call 0x1d386 ; 0x1d386 switch(pin_state){ 1753c: 0f 3f cpi r16, 0xFF ; 255 1753e: 10 07 cpc r17, r16 17540: b1 f0 breq .+44 ; 0x1756e 17542: 01 30 cpi r16, 0x01 ; 1 17544: 11 05 cpc r17, r1 17546: 11 f0 breq .+4 ; 0x1754c } } if (pin_number > -1) { int target = LOW; 17548: 10 e0 ldi r17, 0x00 ; 0 1754a: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 1754c: 8d 2d mov r24, r13 1754e: 0e 94 6c e9 call 0x1d2d8 ; 0x1d2d8 17552: 80 17 cp r24, r16 17554: 91 07 cpc r25, r17 17556: 11 f4 brne .+4 ; 0x1755c 17558: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 manage_heater(); 1755c: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(); 17560: 80 e0 ldi r24, 0x00 ; 0 17562: 0e 94 37 8a call 0x1146e ; 0x1146e lcd_update(0); 17566: 80 e0 ldi r24, 0x00 ; 0 17568: 0e 94 27 6e call 0xdc4e ; 0xdc4e 1756c: ef cf rjmp .-34 ; 0x1754c case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 1756e: 8e 2d mov r24, r14 17570: 0e 94 6c e9 call 0x1d2d8 ; 0x1d2d8 17574: 31 e0 ldi r19, 0x01 ; 1 17576: 20 e0 ldi r18, 0x00 ; 0 17578: 89 2b or r24, r25 1757a: 09 f0 breq .+2 ; 0x1757e 1757c: 30 e0 ldi r19, 0x00 ; 0 1757e: 03 2f mov r16, r19 17580: 12 2f mov r17, r18 17582: e4 cf rjmp .-56 ; 0x1754c - `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; 17584: 80 e5 ldi r24, 0x50 ; 80 17586: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1758a: 08 ee ldi r16, 0xE8 ; 232 1758c: 13 e0 ldi r17, 0x03 ; 3 1758e: 88 23 and r24, r24 17590: 89 f0 breq .+34 ; 0x175b4 17592: 0e 94 1d 60 call 0xc03a ; 0xc03a 17596: 20 e0 ldi r18, 0x00 ; 0 17598: 30 ec ldi r19, 0xC0 ; 192 1759a: 4a e5 ldi r20, 0x5A ; 90 1759c: 55 e4 ldi r21, 0x45 ; 69 1759e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 175a2: 0c ea ldi r16, 0xAC ; 172 175a4: 1d e0 ldi r17, 0x0D ; 13 175a6: 87 ff sbrs r24, 7 175a8: 05 c0 rjmp .+10 ; 0x175b4 175aa: 0e 94 1d 60 call 0xc03a ; 0xc03a 175ae: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 175b2: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 175b4: 83 e5 ldi r24, 0x53 ; 83 175b6: 0e 94 56 5b call 0xb6ac ; 0xb6ac 175ba: 88 23 and r24, r24 175bc: 71 f0 breq .+28 ; 0x175da beepS = 0; else { beepS = code_value(); 175be: 0e 94 1d 60 call 0xc03a ; 0xc03a 175c2: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> if (!beepS) { 175c6: 61 15 cp r22, r1 175c8: 71 05 cpc r23, r1 175ca: 49 f4 brne .+18 ; 0x175de // handle S0 as a pause _delay(beepP); 175cc: b8 01 movw r22, r16 175ce: 90 e0 ldi r25, 0x00 ; 0 175d0: 80 e0 ldi r24, 0x00 ; 0 175d2: 0f 94 58 28 call 0x250b0 ; 0x250b0 175d6: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 175da: 70 e0 ldi r23, 0x00 ; 0 175dc: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 175de: 40 e0 ldi r20, 0x00 ; 0 175e0: c8 01 movw r24, r16 175e2: 0f 94 81 52 call 0x2a502 ; 0x2a502 175e6: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 175ea: 80 e5 ldi r24, 0x50 ; 80 175ec: 0e 94 56 5b call 0xb6ac ; 0xb6ac 175f0: 88 23 and r24, r24 175f2: 51 f0 breq .+20 ; 0x17608 175f4: 0e 94 1d 60 call 0xc03a ; 0xc03a 175f8: 60 93 32 0e sts 0x0E32, r22 ; 0x800e32 175fc: 70 93 33 0e sts 0x0E33, r23 ; 0x800e33 17600: 80 93 34 0e sts 0x0E34, r24 ; 0x800e34 17604: 90 93 35 0e sts 0x0E35, r25 ; 0x800e35 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 17608: 89 e4 ldi r24, 0x49 ; 73 1760a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1760e: 88 23 and r24, r24 17610: 81 f0 breq .+32 ; 0x17632 17612: 0e 94 1d 60 call 0xc03a ; 0xc03a #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17616: 2c ea ldi r18, 0xAC ; 172 17618: 35 ec ldi r19, 0xC5 ; 197 1761a: 47 e2 ldi r20, 0x27 ; 39 1761c: 5e e3 ldi r21, 0x3E ; 62 1761e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 17622: 60 93 36 0e sts 0x0E36, r22 ; 0x800e36 17626: 70 93 37 0e sts 0x0E37, r23 ; 0x800e37 1762a: 80 93 38 0e sts 0x0E38, r24 ; 0x800e38 1762e: 90 93 39 0e sts 0x0E39, r25 ; 0x800e39 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 17632: 84 e4 ldi r24, 0x44 ; 68 17634: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17638: 88 23 and r24, r24 1763a: 81 f0 breq .+32 ; 0x1765c 1763c: 0e 94 1d 60 call 0xc03a ; 0xc03a } float unscalePID_i(float i) { return i/PID_dT; 17640: 2c ea ldi r18, 0xAC ; 172 17642: 35 ec ldi r19, 0xC5 ; 197 17644: 47 e2 ldi r20, 0x27 ; 39 17646: 5e e3 ldi r21, 0x3E ; 62 17648: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 1764c: 60 93 3a 0e sts 0x0E3A, r22 ; 0x800e3a 17650: 70 93 3b 0e sts 0x0E3B, r23 ; 0x800e3b 17654: 80 93 3c 0e sts 0x0E3C, r24 ; 0x800e3c 17658: 90 93 3d 0e sts 0x0E3D, r25 ; 0x800e3d updatePID(); 1765c: 0f 94 d8 3b call 0x277b0 ; 0x277b0 SERIAL_PROTOCOLRPGM(MSG_OK); 17660: 87 e1 ldi r24, 0x17 ; 23 17662: 9d e6 ldi r25, 0x6D ; 109 17664: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLPGM(" p:"); 17668: 8e ec ldi r24, 0xCE ; 206 1766a: 95 e8 ldi r25, 0x85 ; 133 1766c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 17670: 60 91 32 0e lds r22, 0x0E32 ; 0x800e32 17674: 70 91 33 0e lds r23, 0x0E33 ; 0x800e33 17678: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 1767c: 90 91 35 0e lds r25, 0x0E35 ; 0x800e35 17680: 42 e0 ldi r20, 0x02 ; 2 17682: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 17686: 8a ec ldi r24, 0xCA ; 202 17688: 95 e8 ldi r25, 0x85 ; 133 1768a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 1768e: 2c ea ldi r18, 0xAC ; 172 17690: 35 ec ldi r19, 0xC5 ; 197 17692: 47 e2 ldi r20, 0x27 ; 39 17694: 5e e3 ldi r21, 0x3E ; 62 17696: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 1769a: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 1769e: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 176a2: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 176a6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 176aa: 42 e0 ldi r20, 0x02 ; 2 176ac: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 176b0: 86 ec ldi r24, 0xC6 ; 198 176b2: 95 e8 ldi r25, 0x85 ; 133 176b4: 0e 94 d0 76 call 0xeda0 ; 0xeda0 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 176b8: 2c ea ldi r18, 0xAC ; 172 176ba: 35 ec ldi r19, 0xC5 ; 197 176bc: 47 e2 ldi r20, 0x27 ; 39 176be: 5e e3 ldi r21, 0x3E ; 62 176c0: 60 91 3a 0e lds r22, 0x0E3A ; 0x800e3a 176c4: 70 91 3b 0e lds r23, 0x0E3B ; 0x800e3b 176c8: 80 91 3c 0e lds r24, 0x0E3C ; 0x800e3c 176cc: 90 91 3d 0e lds r25, 0x0E3D ; 0x800e3d 176d0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 176d4: 0f 94 ef 75 call 0x2ebde ; 0x2ebde 176d8: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 - `T` - Brightness timeout (15 - 900), default 15 seconds */ #ifdef LCD_BL_PIN case 256: { if (backlightSupport) { 176dc: 80 91 02 04 lds r24, 0x0402 ; 0x800402 176e0: 88 23 and r24, r24 176e2: 11 f4 brne .+4 ; 0x176e8 176e4: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 if (code_seen('B') ) backlightLevel_HIGH = code_value_uint8(); 176e8: 82 e4 ldi r24, 0x42 ; 66 176ea: 0e 94 56 5b call 0xb6ac ; 0xb6ac 176ee: 88 23 and r24, r24 176f0: 21 f0 breq .+8 ; 0x176fa 176f2: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 176f6: 80 93 01 04 sts 0x0401, r24 ; 0x800401 if (code_seen('D')) backlightLevel_LOW = code_value_uint8(); 176fa: 84 e4 ldi r24, 0x44 ; 68 176fc: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17700: 88 23 and r24, r24 17702: 21 f0 breq .+8 ; 0x1770c 17704: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 17708: 80 93 00 04 sts 0x0400, r24 ; 0x800400 if (code_seen('S')) { 1770c: 83 e5 ldi r24, 0x53 ; 83 1770e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17712: 88 23 and r24, r24 17714: 31 f0 breq .+12 ; 0x17722 uint8_t mode = code_value_uint8(); 17716: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 if (mode <= BACKLIGHT_MODE_AUTO) { 1771a: 83 30 cpi r24, 0x03 ; 3 1771c: 10 f4 brcc .+4 ; 0x17722 backlightMode = static_cast(mode); 1771e: 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); 17722: 84 e5 ldi r24, 0x54 ; 84 17724: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17728: 88 23 and r24, r24 1772a: 79 f0 breq .+30 ; 0x1774a 1772c: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 17730: 0f 97 sbiw r24, 0x0f ; 15 17732: 64 f1 brlt .+88 ; 0x1778c 17734: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 17738: 85 38 cpi r24, 0x85 ; 133 1773a: 93 40 sbci r25, 0x03 ; 3 1773c: 54 f5 brge .+84 ; 0x17792 1773e: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 17742: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 17746: 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); 1774a: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 1774e: 8f 93 push r24 17750: 80 91 4d 02 lds r24, 0x024D ; 0x80024d 17754: 8f 93 push r24 17756: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1775a: 1f 92 push r1 1775c: 8f 93 push r24 1775e: 80 91 00 04 lds r24, 0x0400 ; 0x800400 17762: 1f 92 push r1 17764: 8f 93 push r24 17766: 80 91 01 04 lds r24, 0x0401 ; 0x800401 1776a: 1f 92 push r1 1776c: 8f 93 push r24 1776e: 80 eb ldi r24, 0xB0 ; 176 17770: 95 e8 ldi r25, 0x85 ; 133 17772: 9f 93 push r25 17774: 8f 93 push r24 17776: 0f 94 16 db call 0x3b62c ; 0x3b62c backlight_save(); 1777a: 0e 94 b7 89 call 0x1136e ; 0x1136e 1777e: 0f b6 in r0, 0x3f ; 63 17780: f8 94 cli 17782: de bf out 0x3e, r29 ; 62 17784: 0f be out 0x3f, r0 ; 63 17786: cd bf out 0x3d, r28 ; 61 17788: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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); 1778c: 8f e0 ldi r24, 0x0F ; 15 1778e: 90 e0 ldi r25, 0x00 ; 0 17790: d8 cf rjmp .-80 ; 0x17742 17792: 84 e8 ldi r24, 0x84 ; 132 17794: 93 e0 ldi r25, 0x03 ; 3 17796: d5 cf rjmp .-86 ; 0x17742 - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 17798: 83 e5 ldi r24, 0x53 ; 83 1779a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1779e: 88 23 and r24, r24 177a0: 41 f0 breq .+16 ; 0x177b2 177a2: 0e 94 f5 5a call 0xb5ea ; 0xb5ea } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 177a6: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 177aa: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 177ae: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 177b2: 90 e0 ldi r25, 0x00 ; 0 177b4: 80 e0 ldi r24, 0x00 ; 0 177b6: f7 cf rjmp .-18 ; 0x177a6 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 177b8: 85 e4 ldi r24, 0x45 ; 69 177ba: 0e 94 56 5b call 0xb6ac ; 0xb6ac - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 177be: 10 e0 ldi r17, 0x00 ; 0 177c0: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 177c2: 88 23 and r24, r24 177c4: 59 f0 breq .+22 ; 0x177dc 177c6: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 177ca: 8c 01 movw r16, r24 if (e < 0) temp = 70; 177cc: c1 2c mov r12, r1 177ce: d1 2c mov r13, r1 177d0: ac e8 ldi r26, 0x8C ; 140 177d2: ea 2e mov r14, r26 177d4: a2 e4 ldi r26, 0x42 ; 66 177d6: fa 2e mov r15, r26 { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); if (e < 0) 177d8: 97 fd sbrc r25, 7 177da: 06 c0 rjmp .+12 ; 0x177e8 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 177dc: c1 2c mov r12, r1 177de: d1 2c mov r13, r1 177e0: b6 e1 ldi r27, 0x16 ; 22 177e2: eb 2e mov r14, r27 177e4: b3 e4 ldi r27, 0x43 ; 67 177e6: fb 2e mov r15, r27 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(); 177e8: 83 e5 ldi r24, 0x53 ; 83 177ea: 0e 94 56 5b call 0xb6ac ; 0xb6ac 177ee: 88 23 and r24, r24 177f0: 21 f0 breq .+8 ; 0x177fa 177f2: 0e 94 1d 60 call 0xc03a ; 0xc03a 177f6: 6b 01 movw r12, r22 177f8: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 177fa: 83 e4 ldi r24, 0x43 ; 67 177fc: 0e 94 56 5b call 0xb6ac ; 0xb6ac 17800: 88 23 and r24, r24 17802: 51 f0 breq .+20 ; 0x17818 17804: 0e 94 f5 5a call 0xb5ea ; 0xb5ea PID_autotune(temp, e, c); 17808: 9c 01 movw r18, r24 1780a: a8 01 movw r20, r16 1780c: c7 01 movw r24, r14 1780e: b6 01 movw r22, r12 17810: 0f 94 05 3c call 0x2780a ; 0x2780a 17814: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 */ case 303: { float temp = 150.0; int e = 0; int c = 5; 17818: 85 e0 ldi r24, 0x05 ; 5 1781a: 90 e0 ldi r25, 0x00 ; 0 1781c: f5 cf rjmp .-22 ; 0x17808 */ 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; 1781e: 9f ef ldi r25, 0xFF ; 255 17820: ab 96 adiw r28, 0x2b ; 43 17822: 9f af std Y+63, r25 ; 0x3f 17824: ab 97 sbiw r28, 0x2b ; 43 17826: 0c 94 45 a9 jmp 0x1528a ; 0x1528a - `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; 1782a: 20 e0 ldi r18, 0x00 ; 0 1782c: 30 e0 ldi r19, 0x00 ; 0 1782e: 40 ec ldi r20, 0xC0 ; 192 17830: 5f e7 ldi r21, 0x7F ; 127 17832: e2 96 adiw r28, 0x32 ; 50 17834: 2c af std Y+60, r18 ; 0x3c 17836: 3d af std Y+61, r19 ; 0x3d 17838: 4e af std Y+62, r20 ; 0x3e 1783a: 5f af std Y+63, r21 ; 0x3f 1783c: e2 97 sbiw r28, 0x32 ; 50 1783e: 0c 94 54 a9 jmp 0x152a8 ; 0x152a8 17842: 80 e0 ldi r24, 0x00 ; 0 17844: 90 e0 ldi r25, 0x00 ; 0 17846: a0 ec ldi r26, 0xC0 ; 192 17848: bf e7 ldi r27, 0x7F ; 127 1784a: 6e 96 adiw r28, 0x1e ; 30 1784c: 8c af std Y+60, r24 ; 0x3c 1784e: 9d af std Y+61, r25 ; 0x3d 17850: ae af std Y+62, r26 ; 0x3e 17852: bf af std Y+63, r27 ; 0x3f 17854: 6e 97 sbiw r28, 0x1e ; 30 17856: 0c 94 72 a9 jmp 0x152e4 ; 0x152e4 1785a: 20 e0 ldi r18, 0x00 ; 0 1785c: 30 e0 ldi r19, 0x00 ; 0 1785e: 40 ec ldi r20, 0xC0 ; 192 17860: 5f e7 ldi r21, 0x7F ; 127 17862: a2 96 adiw r28, 0x22 ; 34 17864: 2c af std Y+60, r18 ; 0x3c 17866: 3d af std Y+61, r19 ; 0x3d 17868: 4e af std Y+62, r20 ; 0x3e 1786a: 5f af std Y+63, r21 ; 0x3f 1786c: a2 97 sbiw r28, 0x22 ; 34 1786e: 0c 94 81 a9 jmp 0x15302 ; 0x15302 17872: 80 e0 ldi r24, 0x00 ; 0 17874: 90 e0 ldi r25, 0x00 ; 0 17876: a0 ec ldi r26, 0xC0 ; 192 17878: bf e7 ldi r27, 0x7F ; 127 1787a: 6a 96 adiw r28, 0x1a ; 26 1787c: 8c af std Y+60, r24 ; 0x3c 1787e: 9d af std Y+61, r25 ; 0x3d 17880: ae af std Y+62, r26 ; 0x3e 17882: bf af std Y+63, r27 ; 0x3f 17884: 6a 97 sbiw r28, 0x1a ; 26 17886: 0c 94 90 a9 jmp 0x15320 ; 0x15320 1788a: 20 e0 ldi r18, 0x00 ; 0 1788c: 30 e0 ldi r19, 0x00 ; 0 1788e: 40 ec ldi r20, 0xC0 ; 192 17890: 5f e7 ldi r21, 0x7F ; 127 17892: aa 96 adiw r28, 0x2a ; 42 17894: 2c af std Y+60, r18 ; 0x3c 17896: 3d af std Y+61, r19 ; 0x3d 17898: 4e af std Y+62, r20 ; 0x3e 1789a: 5f af std Y+63, r21 ; 0x3f 1789c: aa 97 sbiw r28, 0x2a ; 42 1789e: 0c 94 9f a9 jmp 0x1533e ; 0x1533e int8_t I = -1, S = -1, B = -1, F = -1; 178a2: 3f ef ldi r19, 0xFF ; 255 178a4: e3 96 adiw r28, 0x33 ; 51 178a6: 3f af std Y+63, r19 ; 0x3f 178a8: e3 97 sbiw r28, 0x33 ; 51 178aa: 0c 94 b5 a9 jmp 0x1536a ; 0x1536a 178ae: 4f ef ldi r20, 0xFF ; 255 178b0: e7 96 adiw r28, 0x37 ; 55 178b2: 4f af std Y+63, r20 ; 0x3f 178b4: e7 97 sbiw r28, 0x37 ; 55 178b6: 0c 94 c1 a9 jmp 0x15382 ; 0x15382 - `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; 178ba: 80 e0 ldi r24, 0x00 ; 0 178bc: 90 e0 ldi r25, 0x00 ; 0 178be: a0 ec ldi r26, 0xC0 ; 192 178c0: bf e7 ldi r27, 0x7F ; 127 178c2: a6 96 adiw r28, 0x26 ; 38 178c4: 8c af std Y+60, r24 ; 0x3c 178c6: 9d af std Y+61, r25 ; 0x3d 178c8: ae af std Y+62, r26 ; 0x3e 178ca: bf af std Y+63, r27 ; 0x3f 178cc: a6 97 sbiw r28, 0x26 ; 38 178ce: 0c 94 d0 a9 jmp 0x153a0 ; 0x153a0 int8_t I = -1, S = -1, B = -1, F = -1; 178d2: 9f ef ldi r25, 0xFF ; 255 178d4: eb 96 adiw r28, 0x3b ; 59 178d6: 9f af std Y+63, r25 ; 0x3f 178d8: eb 97 sbiw r28, 0x3b ; 59 178da: 0c 94 05 aa jmp 0x1540a ; 0x1540a 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(); 178de: 0f 94 c6 2e call 0x25d8c ; 0x25d8c 178e2: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 break; } // update all parameters if(B >= 0) 178e6: e7 96 adiw r28, 0x37 ; 55 178e8: ff ad ldd r31, Y+63 ; 0x3f 178ea: e7 97 sbiw r28, 0x37 ; 55 178ec: f7 fd sbrc r31, 7 178ee: 09 c0 rjmp .+18 ; 0x17902 thermal_model_set_warn_beep(B); 178f0: 81 e0 ldi r24, 0x01 ; 1 178f2: e7 96 adiw r28, 0x37 ; 55 178f4: 2f ad ldd r18, Y+63 ; 0x3f 178f6: e7 97 sbiw r28, 0x37 ; 55 178f8: 21 11 cpse r18, r1 178fa: 01 c0 rjmp .+2 ; 0x178fe 178fc: 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; 178fe: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.457> if(!isnan(P) || !isnan(U) || !isnan(V) || !isnan(C) || !isnan(D) || (L >= 0) || !isnan(T) || !isnan(W) || !isnan(E)) 17902: a7 01 movw r20, r14 17904: 96 01 movw r18, r12 17906: c7 01 movw r24, r14 17908: b6 01 movw r22, r12 1790a: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1790e: 88 23 and r24, r24 17910: 11 f4 brne .+4 ; 0x17916 17912: 0c 94 94 aa jmp 0x15528 ; 0x15528 17916: 6e 96 adiw r28, 0x1e ; 30 17918: 2c ad ldd r18, Y+60 ; 0x3c 1791a: 3d ad ldd r19, Y+61 ; 0x3d 1791c: 4e ad ldd r20, Y+62 ; 0x3e 1791e: 5f ad ldd r21, Y+63 ; 0x3f 17920: 6e 97 sbiw r28, 0x1e ; 30 17922: ca 01 movw r24, r20 17924: b9 01 movw r22, r18 17926: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1792a: 88 23 and r24, r24 1792c: 11 f4 brne .+4 ; 0x17932 1792e: 0c 94 94 aa jmp 0x15528 ; 0x15528 17932: a2 96 adiw r28, 0x22 ; 34 17934: 2c ad ldd r18, Y+60 ; 0x3c 17936: 3d ad ldd r19, Y+61 ; 0x3d 17938: 4e ad ldd r20, Y+62 ; 0x3e 1793a: 5f ad ldd r21, Y+63 ; 0x3f 1793c: a2 97 sbiw r28, 0x22 ; 34 1793e: ca 01 movw r24, r20 17940: b9 01 movw r22, r18 17942: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 17946: 88 23 and r24, r24 17948: 11 f4 brne .+4 ; 0x1794e 1794a: 0c 94 94 aa jmp 0x15528 ; 0x15528 1794e: 6a 96 adiw r28, 0x1a ; 26 17950: 2c ad ldd r18, Y+60 ; 0x3c 17952: 3d ad ldd r19, Y+61 ; 0x3d 17954: 4e ad ldd r20, Y+62 ; 0x3e 17956: 5f ad ldd r21, Y+63 ; 0x3f 17958: 6a 97 sbiw r28, 0x1a ; 26 1795a: ca 01 movw r24, r20 1795c: b9 01 movw r22, r18 1795e: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 17962: 88 23 and r24, r24 17964: 11 f4 brne .+4 ; 0x1796a 17966: 0c 94 94 aa jmp 0x15528 ; 0x15528 1796a: aa 96 adiw r28, 0x2a ; 42 1796c: 2c ad ldd r18, Y+60 ; 0x3c 1796e: 3d ad ldd r19, Y+61 ; 0x3d 17970: 4e ad ldd r20, Y+62 ; 0x3e 17972: 5f ad ldd r21, Y+63 ; 0x3f 17974: aa 97 sbiw r28, 0x2a ; 42 17976: ca 01 movw r24, r20 17978: b9 01 movw r22, r18 1797a: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1797e: 88 23 and r24, r24 17980: 11 f4 brne .+4 ; 0x17986 17982: 0c 94 94 aa jmp 0x15528 ; 0x15528 17986: 17 fd sbrc r17, 7 17988: 02 c0 rjmp .+4 ; 0x1798e 1798a: 0c 94 5e cd jmp 0x19abc ; 0x19abc 1798e: a6 96 adiw r28, 0x26 ; 38 17990: 2c ad ldd r18, Y+60 ; 0x3c 17992: 3d ad ldd r19, Y+61 ; 0x3d 17994: 4e ad ldd r20, Y+62 ; 0x3e 17996: 5f ad ldd r21, Y+63 ; 0x3f 17998: a6 97 sbiw r28, 0x26 ; 38 1799a: ca 01 movw r24, r20 1799c: b9 01 movw r22, r18 1799e: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 179a2: 88 23 and r24, r24 179a4: 11 f4 brne .+4 ; 0x179aa 179a6: 0c 94 94 aa jmp 0x15528 ; 0x15528 179aa: a5 01 movw r20, r10 179ac: 94 01 movw r18, r8 179ae: c5 01 movw r24, r10 179b0: b4 01 movw r22, r8 179b2: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 179b6: 88 23 and r24, r24 179b8: 11 f4 brne .+4 ; 0x179be 179ba: 0c 94 94 aa jmp 0x15528 ; 0x15528 179be: a3 01 movw r20, r6 179c0: 92 01 movw r18, r4 179c2: c3 01 movw r24, r6 179c4: b2 01 movw r22, r4 179c6: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 179ca: 88 23 and r24, r24 179cc: 11 f4 brne .+4 ; 0x179d2 179ce: 0c 94 94 aa jmp 0x15528 ; 0x15528 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 179d2: ab 96 adiw r28, 0x2b ; 43 179d4: 9f ad ldd r25, Y+63 ; 0x3f 179d6: ab 97 sbiw r28, 0x2b ; 43 179d8: 97 fd sbrc r25, 7 179da: 3b c0 rjmp .+118 ; 0x17a52 179dc: e2 96 adiw r28, 0x32 ; 50 179de: 2c ad ldd r18, Y+60 ; 0x3c 179e0: 3d ad ldd r19, Y+61 ; 0x3d 179e2: 4e ad ldd r20, Y+62 ; 0x3e 179e4: 5f ad ldd r21, Y+63 ; 0x3f 179e6: e2 97 sbiw r28, 0x32 ; 50 179e8: ca 01 movw r24, r20 179ea: b9 01 movw r22, r18 179ec: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 179f0: 81 11 cpse r24, r1 179f2: 2f c0 rjmp .+94 ; 0x17a52 thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 179f4: ab 96 adiw r28, 0x2b ; 43 179f6: af ad ldd r26, Y+63 ; 0x3f 179f8: ab 97 sbiw r28, 0x2b ; 43 179fa: a0 31 cpi r26, 0x10 ; 16 179fc: 54 f5 brge .+84 ; 0x17a52 179fe: 20 e0 ldi r18, 0x00 ; 0 17a00: 30 e0 ldi r19, 0x00 ; 0 17a02: a9 01 movw r20, r18 17a04: e2 96 adiw r28, 0x32 ; 50 17a06: 6c ad ldd r22, Y+60 ; 0x3c 17a08: 7d ad ldd r23, Y+61 ; 0x3d 17a0a: 8e ad ldd r24, Y+62 ; 0x3e 17a0c: 9f ad ldd r25, Y+63 ; 0x3f 17a0e: e2 97 sbiw r28, 0x32 ; 50 17a10: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 17a14: 18 16 cp r1, r24 17a16: ec f4 brge .+58 ; 0x17a52 return; TempMgrGuard temp_mgr_guard; 17a18: ce 01 movw r24, r28 17a1a: 01 96 adiw r24, 0x01 ; 1 17a1c: 0f 94 9f 32 call 0x2653e ; 0x2653e thermal_model::data.R[index] = R; 17a20: ab 96 adiw r28, 0x2b ; 43 17a22: bf ad ldd r27, Y+63 ; 0x3f 17a24: ab 97 sbiw r28, 0x2b ; 43 17a26: 24 e0 ldi r18, 0x04 ; 4 17a28: b2 02 muls r27, r18 17a2a: f0 01 movw r30, r0 17a2c: 11 24 eor r1, r1 17a2e: e0 51 subi r30, 0x10 ; 16 17a30: fd 4e sbci r31, 0xED ; 237 17a32: e2 96 adiw r28, 0x32 ; 50 17a34: 8c ad ldd r24, Y+60 ; 0x3c 17a36: 9d ad ldd r25, Y+61 ; 0x3d 17a38: ae ad ldd r26, Y+62 ; 0x3e 17a3a: bf ad ldd r27, Y+63 ; 0x3f 17a3c: e2 97 sbiw r28, 0x32 ; 50 17a3e: 80 83 st Z, r24 17a40: 91 83 std Z+1, r25 ; 0x01 17a42: a2 83 std Z+2, r26 ; 0x02 17a44: b3 83 std Z+3, r27 ; 0x03 thermal_model::setup(); 17a46: 0f 94 0e 30 call 0x2601c ; 0x2601c void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 17a4a: ce 01 movw r24, r28 17a4c: 01 96 adiw r24, 0x01 ; 1 17a4e: 0f 94 92 32 call 0x26524 ; 0x26524 thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17a52: e3 96 adiw r28, 0x33 ; 51 17a54: 9f ad ldd r25, Y+63 ; 0x3f 17a56: e3 97 sbiw r28, 0x33 ; 51 17a58: 97 fd sbrc r25, 7 17a5a: 06 c0 rjmp .+12 ; 0x17a68 17a5c: 81 e0 ldi r24, 0x01 ; 1 17a5e: 91 11 cpse r25, r1 17a60: 01 c0 rjmp .+2 ; 0x17a64 17a62: 80 e0 ldi r24, 0x00 ; 0 17a64: 0f 94 42 33 call 0x26684 ; 0x26684 // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 17a68: 37 fe sbrs r3, 7 17a6a: 02 c0 rjmp .+4 ; 0x17a70 17a6c: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 17a70: 11 e0 ldi r17, 0x01 ; 1 17a72: eb 96 adiw r28, 0x3b ; 59 17a74: af ad ldd r26, Y+63 ; 0x3f 17a76: eb 97 sbiw r28, 0x3b ; 59 17a78: 1a 16 cp r1, r26 17a7a: 0c f0 brlt .+2 ; 0x17a7e 17a7c: 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; 17a7e: 81 e0 ldi r24, 0x01 ; 1 17a80: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.538> } //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); 17a84: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 17a88: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 17a8c: 89 1b sub r24, r25 17a8e: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 17a90: 41 f4 brne .+16 ; 0x17aa2 17a92: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 17a96: 85 30 cpi r24, 0x05 ; 5 17a98: 79 f1 breq .+94 ; 0x17af8 17a9a: 0e 94 61 67 call 0xcec2 ; 0xcec2 17a9e: 88 23 and r24, r24 17aa0: 59 f1 breq .+86 ; 0x17af8 sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 17aa2: 8c e9 ldi r24, 0x9C ; 156 17aa4: 93 e8 ldi r25, 0x83 ; 131 17aa6: 9f 93 push r25 17aa8: 8f 93 push r24 17aaa: e1 e0 ldi r30, 0x01 ; 1 17aac: f0 e0 ldi r31, 0x00 ; 0 17aae: ec 0f add r30, r28 17ab0: fd 1f adc r31, r29 17ab2: ff 93 push r31 17ab4: ef 93 push r30 17ab6: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 lcd_setstatus_serial(tm_message); 17aba: ce 01 movw r24, r28 17abc: 01 96 adiw r24, 0x01 ; 1 17abe: 0e 94 2a f2 call 0x1e454 ; 0x1e454 return; 17ac2: 0f 90 pop r0 17ac4: 0f 90 pop r0 17ac6: 0f 90 pop r0 17ac8: 0f 90 pop r0 17aca: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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; 17ace: 20 e0 ldi r18, 0x00 ; 0 17ad0: 30 e0 ldi r19, 0x00 ; 0 17ad2: a9 01 movw r20, r18 17ad4: c7 01 movw r24, r14 17ad6: b6 01 movw r22, r12 17ad8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 17adc: 18 16 cp r1, r24 17ade: 14 f0 brlt .+4 ; 0x17ae4 17ae0: 0c 94 a2 aa jmp 0x15544 ; 0x15544 17ae4: c0 92 da 12 sts 0x12DA, r12 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.402+0x2a> 17ae8: d0 92 db 12 sts 0x12DB, r13 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.402+0x2b> 17aec: e0 92 dc 12 sts 0x12DC, r14 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.402+0x2c> 17af0: f0 92 dd 12 sts 0x12DD, r15 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.402+0x2d> 17af4: 0c 94 a2 aa jmp 0x15544 ; 0x15544 lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 17af8: 83 e0 ldi r24, 0x03 ; 3 17afa: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 17afe: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 17b02: 82 60 ori r24, 0x02 ; 2 17b04: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 lcd_return_to_status(); 17b08: 0f 94 ab 1f call 0x23f56 ; 0x23f56 // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 17b0c: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 17b10: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 17b14: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 17b18: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> 17b1c: 6e 96 adiw r28, 0x1e ; 30 17b1e: 2c af std Y+60, r18 ; 0x3c 17b20: 3d af std Y+61, r19 ; 0x3d 17b22: 4e af std Y+62, r20 ; 0x3e 17b24: 5f af std Y+63, r21 ; 0x3f 17b26: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 17b28: 80 e4 ldi r24, 0x40 ; 64 17b2a: e0 ef ldi r30, 0xF0 ; 240 17b2c: f2 e1 ldi r31, 0x12 ; 18 17b2e: de 01 movw r26, r28 17b30: 11 96 adiw r26, 0x01 ; 1 17b32: 01 90 ld r0, Z+ 17b34: 0d 92 st X+, r0 17b36: 8a 95 dec r24 17b38: e1 f7 brne .-8 ; 0x17b32 orig_enabled = thermal_model::enabled; 17b3a: 30 91 1d 05 lds r19, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> 17b3e: 67 96 adiw r28, 0x17 ; 23 17b40: 3f af std Y+63, r19 ; 0x3f 17b42: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 17b44: 81 2f mov r24, r17 17b46: 0f 94 64 33 call 0x266c8 ; 0x266c8 // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 17b4a: 86 e8 ldi r24, 0x86 ; 134 17b4c: 93 e8 ldi r25, 0x83 ; 131 17b4e: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17b52: 21 14 cp r2, r1 17b54: 31 04 cpc r3, r1 17b56: 19 f4 brne .+6 ; 0x17b5e 17b58: 56 ee ldi r21, 0xE6 ; 230 17b5a: 25 2e mov r2, r21 17b5c: 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); 17b5e: 80 e0 ldi r24, 0x00 ; 0 17b60: 0f 94 bc 2e call 0x25d78 ; 0x25d78 17b64: 32 e0 ldi r19, 0x02 ; 2 17b66: 43 2e mov r4, r19 17b68: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 17b6a: 4a e6 ldi r20, 0x6A ; 106 17b6c: 64 2e mov r6, r20 17b6e: 43 e8 ldi r20, 0x83 ; 131 17b70: 74 2e mov r7, r20 17b72: ae 01 movw r20, r28 17b74: 4f 5b subi r20, 0xBF ; 191 17b76: 5f 4f sbci r21, 0xFF ; 255 17b78: 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); 17b7a: 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; 17b7c: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 17b80: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 17b84: 20 e0 ldi r18, 0x00 ; 0 17b86: 30 e0 ldi r19, 0x00 ; 0 17b88: 48 e4 ldi r20, 0x48 ; 72 17b8a: 52 e4 ldi r21, 0x42 ; 66 17b8c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 17b90: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 17b94: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 17b98: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 17b9c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 17ba0: 87 fd sbrc r24, 7 17ba2: 58 c0 rjmp .+176 ; 0x17c54 sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 17ba4: 1f 92 push r1 17ba6: 1f 93 push r17 17ba8: 80 e5 ldi r24, 0x50 ; 80 17baa: 93 e8 ldi r25, 0x83 ; 131 17bac: 9f 93 push r25 17bae: 8f 93 push r24 17bb0: 9f 92 push r9 17bb2: 8f 92 push r8 17bb4: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 lcd_setstatus_serial(tm_message); 17bb8: c4 01 movw r24, r8 17bba: 0e 94 2a f2 call 0x1e454 ; 0x1e454 } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 17bbe: 00 91 e7 03 lds r16, 0x03E7 ; 0x8003e7 set_fan_speed(255); 17bc2: 8f ef ldi r24, 0xFF ; 255 17bc4: 0f 94 bc 2e call 0x25d78 ; 0x25d78 17bc8: 0f 90 pop r0 17bca: 0f 90 pop r0 17bcc: 0f 90 pop r0 17bce: 0f 90 pop r0 17bd0: 0f 90 pop r0 17bd2: 0f 90 pop r0 while(current_temperature[0] >= temp) { 17bd4: c0 90 b0 0d lds r12, 0x0DB0 ; 0x800db0 17bd8: d0 90 b1 0d lds r13, 0x0DB1 ; 0x800db1 17bdc: e0 90 b2 0d lds r14, 0x0DB2 ; 0x800db2 17be0: f0 90 b3 0d lds r15, 0x0DB3 ; 0x800db3 17be4: 20 e0 ldi r18, 0x00 ; 0 17be6: 30 e0 ldi r19, 0x00 ; 0 17be8: 48 e4 ldi r20, 0x48 ; 72 17bea: 52 e4 ldi r21, 0x42 ; 66 17bec: c7 01 movw r24, r14 17bee: b6 01 movw r22, r12 17bf0: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 17bf4: 87 fd sbrc r24, 7 17bf6: 27 c0 rjmp .+78 ; 0x17c46 if(temp_error_state.v) break; 17bf8: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 17bfc: 81 11 cpse r24, r1 17bfe: 23 c0 rjmp .+70 ; 0x17c46 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 17c00: 20 91 56 06 lds r18, 0x0656 ; 0x800656 17c04: 30 91 57 06 lds r19, 0x0657 ; 0x800657 17c08: 40 91 58 06 lds r20, 0x0658 ; 0x800658 17c0c: 50 91 59 06 lds r21, 0x0659 ; 0x800659 17c10: 60 91 30 13 lds r22, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.402+0x80> 17c14: 70 91 31 13 lds r23, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.402+0x81> 17c18: 80 91 32 13 lds r24, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.402+0x82> 17c1c: 90 91 33 13 lds r25, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.402+0x83> 17c20: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 17c24: 20 e0 ldi r18, 0x00 ; 0 17c26: 30 e0 ldi r19, 0x00 ; 0 17c28: 40 ea ldi r20, 0xA0 ; 160 17c2a: 50 e4 ldi r21, 0x40 ; 64 17c2c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 17c30: 9b 01 movw r18, r22 17c32: ac 01 movw r20, r24 17c34: c7 01 movw r24, r14 17c36: b6 01 movw r22, r12 17c38: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 17c3c: 87 fd sbrc r24, 7 17c3e: 03 c0 rjmp .+6 ; 0x17c46 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 17c40: 0f 94 89 3b call 0x27712 ; 0x27712 17c44: c7 cf rjmp .-114 ; 0x17bd4 } set_fan_speed(old_speed); 17c46: 80 2f mov r24, r16 17c48: 0f 94 bc 2e call 0x25d78 ; 0x25d78 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); 17c4c: 80 e1 ldi r24, 0x10 ; 16 17c4e: 97 e2 ldi r25, 0x27 ; 39 17c50: 0f 94 b6 3b call 0x2776c ; 0x2776c } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 17c54: 7f 92 push r7 17c56: 6f 92 push r6 17c58: e2 e4 ldi r30, 0x42 ; 66 17c5a: f3 e8 ldi r31, 0x83 ; 131 17c5c: ff 93 push r31 17c5e: ef 93 push r30 17c60: 9f 92 push r9 17c62: 8f 92 push r8 17c64: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 lcd_setstatus_serial(tm_message); 17c68: c4 01 movw r24, r8 17c6a: 0e 94 2a f2 call 0x1e454 ; 0x1e454 target_temperature[0] = cal_temp; 17c6e: 30 92 b7 0d sts 0x0DB7, r3 ; 0x800db7 17c72: 20 92 b6 0d sts 0x0DB6, r2 ; 0x800db6 samples = record(); 17c76: 0f 94 d1 10 call 0x221a2 ; 0x221a2 17c7a: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 17c7c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 17c80: 0f 90 pop r0 17c82: 0f 90 pop r0 17c84: 0f 90 pop r0 17c86: 0f 90 pop r0 17c88: 0f 90 pop r0 17c8a: 0f 90 pop r0 17c8c: 81 11 cpse r24, r1 17c8e: 7a c0 rjmp .+244 ; 0x17d84 17c90: a1 14 cp r10, r1 17c92: b1 04 cpc r11, r1 17c94: 09 f4 brne .+2 ; 0x17c98 17c96: 76 c0 rjmp .+236 ; 0x17d84 return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 17c98: 60 91 f0 12 lds r22, 0x12F0 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x40> 17c9c: 70 91 f1 12 lds r23, 0x12F1 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x41> 17ca0: 80 91 f2 12 lds r24, 0x12F2 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x42> 17ca4: 90 91 f3 12 lds r25, 0x12F3 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x43> 17ca8: 9b 01 movw r18, r22 17caa: ac 01 movw r20, r24 17cac: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 17cb0: 88 23 and r24, r24 17cb2: 61 f0 breq .+24 ; 0x17ccc thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 17cb4: 80 e0 ldi r24, 0x00 ; 0 17cb6: 90 e0 ldi r25, 0x00 ; 0 17cb8: a8 e4 ldi r26, 0x48 ; 72 17cba: b2 e4 ldi r27, 0x42 ; 66 17cbc: 80 93 f0 12 sts 0x12F0, r24 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x40> 17cc0: 90 93 f1 12 sts 0x12F1, r25 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x41> 17cc4: a0 93 f2 12 sts 0x12F2, r26 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x42> 17cc8: b0 93 f3 12 sts 0x12F3, r27 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x43> e = estimate(samples, &thermal_model::data.C, 17ccc: c0 90 56 06 lds r12, 0x0656 ; 0x800656 17cd0: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17cd4: e0 90 58 06 lds r14, 0x0658 ; 0x800658 17cd8: f0 90 59 06 lds r15, 0x0659 ; 0x800659 17cdc: 00 e0 ldi r16, 0x00 ; 0 17cde: 20 e0 ldi r18, 0x00 ; 0 17ce0: 30 e0 ldi r19, 0x00 ; 0 17ce2: 40 ea ldi r20, 0xA0 ; 160 17ce4: 51 e4 ldi r21, 0x41 ; 65 17ce6: 66 ee ldi r22, 0xE6 ; 230 17ce8: 72 e1 ldi r23, 0x12 ; 18 17cea: c5 01 movw r24, r10 17cec: 0e 94 95 e7 call 0x1cf2a ; 0x1cf2a 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)) 17cf0: 9b 01 movw r18, r22 17cf2: ac 01 movw r20, r24 17cf4: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 17cf8: 81 11 cpse r24, r1 17cfa: 44 c0 rjmp .+136 ; 0x17d84 return true; wait_temp(); 17cfc: 0f 94 94 3b call 0x27728 ; 0x27728 if(i) break; // we don't need to refine R 17d00: 4a 94 dec r4 17d02: 45 28 or r4, r5 17d04: 09 f4 brne .+2 ; 0x17d08 17d06: 85 c0 rjmp .+266 ; 0x17e12 wait(30000); // settle PID regulation 17d08: 80 e3 ldi r24, 0x30 ; 48 17d0a: 95 e7 ldi r25, 0x75 ; 117 17d0c: 0f 94 b6 3b call 0x2776c ; 0x2776c sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 17d10: 3f 92 push r3 17d12: 2f 92 push r2 17d14: 7f 92 push r7 17d16: 6f 92 push r6 17d18: 45 e3 ldi r20, 0x35 ; 53 17d1a: 53 e8 ldi r21, 0x83 ; 131 17d1c: 5f 93 push r21 17d1e: 4f 93 push r20 17d20: 9f 92 push r9 17d22: 8f 92 push r8 17d24: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 lcd_setstatus_serial(tm_message); 17d28: c4 01 movw r24, r8 17d2a: 0e 94 2a f2 call 0x1e454 ; 0x1e454 samples = record(); 17d2e: 0f 94 d1 10 call 0x221a2 ; 0x221a2 if(temp_error_state.v || !samples) 17d32: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 17d36: 0f b6 in r0, 0x3f ; 63 17d38: f8 94 cli 17d3a: de bf out 0x3e, r29 ; 62 17d3c: 0f be out 0x3f, r0 ; 63 17d3e: cd bf out 0x3d, r28 ; 61 17d40: 21 11 cpse r18, r1 17d42: 20 c0 rjmp .+64 ; 0x17d84 17d44: 00 97 sbiw r24, 0x00 ; 0 17d46: f1 f0 breq .+60 ; 0x17d84 return true; e = estimate(samples, &thermal_model::data.R[0], 17d48: c0 90 56 06 lds r12, 0x0656 ; 0x800656 17d4c: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17d50: e0 90 58 06 lds r14, 0x0658 ; 0x800658 17d54: f0 90 59 06 lds r15, 0x0659 ; 0x800659 17d58: 20 e0 ldi r18, 0x00 ; 0 17d5a: 30 e0 ldi r19, 0x00 ; 0 17d5c: 48 e4 ldi r20, 0x48 ; 72 17d5e: 52 e4 ldi r21, 0x42 ; 66 17d60: 60 ef ldi r22, 0xF0 ; 240 17d62: 72 e1 ldi r23, 0x12 ; 18 17d64: 0e 94 95 e7 call 0x1cf2a ; 0x1cf2a // 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")); 17d68: 03 e6 ldi r16, 0x63 ; 99 17d6a: 60 2e mov r6, r16 17d6c: 03 e8 ldi r16, 0x83 ; 131 17d6e: 70 2e mov r7, r16 17d70: 44 24 eor r4, r4 17d72: 43 94 inc r4 17d74: 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)) 17d76: 9b 01 movw r18, r22 17d78: ac 01 movw r20, r24 17d7a: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 17d7e: 88 23 and r24, r24 17d80: 09 f4 brne .+2 ; 0x17d84 17d82: fc ce rjmp .-520 ; 0x17b7c 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; 17d84: 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); 17d86: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.538> // always reset temperature disable_heater(); 17d8a: 0f 94 1d 30 call 0x2603a ; 0x2603a if(thermal_model_autotune_err) { 17d8e: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.538> 17d92: 88 23 and r24, r24 17d94: 09 f4 brne .+2 ; 0x17d98 17d96: fd c0 rjmp .+506 ; 0x17f92 sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 17d98: 82 e7 ldi r24, 0x72 ; 114 17d9a: 93 e8 ldi r25, 0x83 ; 131 17d9c: 9f 93 push r25 17d9e: 8f 93 push r24 17da0: 9f 92 push r9 17da2: 8f 92 push r8 17da4: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 lcd_setstatus_serial(tm_message); 17da8: c4 01 movw r24, r8 17daa: 0e 94 2a f2 call 0x1e454 ; 0x1e454 if(temp_error_state.v) 17dae: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 17db2: 0f 90 pop r0 17db4: 0f 90 pop r0 17db6: 0f 90 pop r0 17db8: 0f 90 pop r0 17dba: 88 23 and r24, r24 17dbc: 19 f0 breq .+6 ; 0x17dc4 thermal_model_cal::set_fan_speed(255); 17dbe: 8f ef ldi r24, 0xFF ; 255 17dc0: 0f 94 bc 2e call 0x25d78 ; 0x25d78 // show calibrated values before overwriting them thermal_model_report_settings(); 17dc4: 0f 94 c6 2e call 0x25d8c ; 0x25d8c // restore original state thermal_model::data.C = orig_C; 17dc8: 6e 96 adiw r28, 0x1e ; 30 17dca: 2c ad ldd r18, Y+60 ; 0x3c 17dcc: 3d ad ldd r19, Y+61 ; 0x3d 17dce: 4e ad ldd r20, Y+62 ; 0x3e 17dd0: 5f ad ldd r21, Y+63 ; 0x3f 17dd2: 6e 97 sbiw r28, 0x1e ; 30 17dd4: 20 93 e6 12 sts 0x12E6, r18 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 17dd8: 30 93 e7 12 sts 0x12E7, r19 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 17ddc: 40 93 e8 12 sts 0x12E8, r20 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 17de0: 50 93 e9 12 sts 0x12E9, r21 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); 17de4: 80 e4 ldi r24, 0x40 ; 64 17de6: fe 01 movw r30, r28 17de8: 31 96 adiw r30, 0x01 ; 1 17dea: a0 ef ldi r26, 0xF0 ; 240 17dec: b2 e1 ldi r27, 0x12 ; 18 17dee: 01 90 ld r0, Z+ 17df0: 0d 92 st X+, r0 17df2: 8a 95 dec r24 17df4: e1 f7 brne .-8 ; 0x17dee thermal_model_set_enabled(orig_enabled); 17df6: 67 96 adiw r28, 0x17 ; 23 17df8: 8f ad ldd r24, Y+63 ; 0x3f 17dfa: 67 97 sbiw r28, 0x17 ; 23 17dfc: 0f 94 42 33 call 0x26684 ; 0x26684 thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 17e00: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 17e04: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 17e08: 8d 7f andi r24, 0xFD ; 253 17e0a: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 17e0e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 // 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); 17e12: 8f ef ldi r24, 0xFF ; 255 17e14: 0f 94 bc 2e call 0x25d78 ; 0x25d78 wait(30000); 17e18: 80 e3 ldi r24, 0x30 ; 48 17e1a: 95 e7 ldi r25, 0x75 ; 117 17e1c: 0f 94 b6 3b call 0x2776c ; 0x2776c 17e20: fc e2 ldi r31, 0x2C ; 44 17e22: 6f 2e mov r6, r31 17e24: f3 e1 ldi r31, 0x13 ; 19 17e26: 7f 2e mov r7, r31 17e28: 1f ef ldi r17, 0xFF ; 255 17e2a: af e0 ldi r26, 0x0F ; 15 17e2c: aa 2e mov r10, r26 17e2e: 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; 17e30: 21 2c mov r2, r1 17e32: 31 2c mov r3, r1 17e34: b0 ec ldi r27, 0xC0 ; 192 17e36: 4b 2e mov r4, r27 17e38: bf e7 ldi r27, 0x7F ; 127 17e3a: 5b 2e mov r5, r27 17e3c: f3 01 movw r30, r6 17e3e: 20 82 st Z, r2 17e40: 31 82 std Z+1, r3 ; 0x01 17e42: 42 82 std Z+2, r4 ; 0x02 17e44: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 17e46: 81 2f mov r24, r17 17e48: 0f 94 bc 2e call 0x25d78 ; 0x25d78 wait(10000); 17e4c: 80 e1 ldi r24, 0x10 ; 16 17e4e: 97 e2 ldi r25, 0x27 ; 39 17e50: 0f 94 b6 3b call 0x2776c ; 0x2776c sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 17e54: bf 92 push r11 17e56: af 92 push r10 17e58: 21 e2 ldi r18, 0x21 ; 33 17e5a: 33 e8 ldi r19, 0x83 ; 131 17e5c: 3f 93 push r19 17e5e: 2f 93 push r18 17e60: 9f 92 push r9 17e62: 8f 92 push r8 17e64: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 lcd_setstatus_serial(tm_message); 17e68: c4 01 movw r24, r8 17e6a: 0e 94 2a f2 call 0x1e454 ; 0x1e454 samples = record(); 17e6e: 0f 94 d1 10 call 0x221a2 ; 0x221a2 if(temp_error_state.v || !samples) 17e72: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 17e76: 0f 90 pop r0 17e78: 0f 90 pop r0 17e7a: 0f 90 pop r0 17e7c: 0f 90 pop r0 17e7e: 0f 90 pop r0 17e80: 0f 90 pop r0 17e82: 21 11 cpse r18, r1 17e84: 7f cf rjmp .-258 ; 0x17d84 17e86: 00 97 sbiw r24, 0x00 ; 0 17e88: 09 f4 brne .+2 ; 0x17e8c 17e8a: 7c cf rjmp .-264 ; 0x17d84 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], 17e8c: c0 90 56 06 lds r12, 0x0656 ; 0x800656 17e90: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17e94: e0 90 58 06 lds r14, 0x0658 ; 0x800658 17e98: f0 90 59 06 lds r15, 0x0659 ; 0x800659 17e9c: 20 91 f0 12 lds r18, 0x12F0 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x40> 17ea0: 30 91 f1 12 lds r19, 0x12F1 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x41> 17ea4: 40 91 f2 12 lds r20, 0x12F2 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x42> 17ea8: 50 91 f3 12 lds r21, 0x12F3 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x43> 17eac: 0a 2d mov r16, r10 17eae: b3 01 movw r22, r6 17eb0: 0e 94 95 e7 call 0x1cf2a ; 0x1cf2a 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)) 17eb4: 9b 01 movw r18, r22 17eb6: ac 01 movw r20, r24 17eb8: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 17ebc: 81 11 cpse r24, r1 17ebe: 62 cf rjmp .-316 ; 0x17d84 17ec0: 54 e0 ldi r21, 0x04 ; 4 17ec2: a5 1a sub r10, r21 17ec4: b1 08 sbc r11, r1 17ec6: 80 e1 ldi r24, 0x10 ; 16 17ec8: 68 1a sub r6, r24 17eca: 71 08 sbc r7, r1 17ecc: 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) { 17ece: 9f ef ldi r25, 0xFF ; 255 17ed0: a9 16 cp r10, r25 17ed2: b9 06 cpc r11, r25 17ed4: 09 f0 breq .+2 ; 0x17ed8 17ed6: b2 cf rjmp .-156 ; 0x17e3c 17ed8: 78 e2 ldi r23, 0x28 ; 40 17eda: e7 2e mov r14, r23 17edc: 73 e1 ldi r23, 0x13 ; 19 17ede: f7 2e mov r15, r23 17ee0: 0e e0 ldi r16, 0x0E ; 14 17ee2: 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; 17ee4: ef e0 ldi r30, 0x0F ; 15 17ee6: 3e 2e mov r3, r30 for(uint8_t i = THERMAL_MODEL_R_SIZE - 2; i != 0; --i) { if(!((THERMAL_MODEL_R_SIZE - i - 1) % THERMAL_MODEL_CAL_R_STEP)) { 17ee8: 8f e0 ldi r24, 0x0F ; 15 17eea: 90 e0 ldi r25, 0x00 ; 0 17eec: 80 1b sub r24, r16 17eee: 91 0b sbc r25, r17 17ef0: 83 70 andi r24, 0x03 ; 3 17ef2: 99 27 eor r25, r25 17ef4: 89 2b or r24, r25 17ef6: 59 f4 brne .+22 ; 0x17f0e next = i; 17ef8: 30 2e mov r3, r16 17efa: 01 50 subi r16, 0x01 ; 1 17efc: 11 09 sbc r17, r1 17efe: f4 e0 ldi r31, 0x04 ; 4 17f00: ef 1a sub r14, r31 17f02: 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) { 17f04: 01 15 cp r16, r1 17f06: 11 05 cpc r17, r1 17f08: 79 f7 brne .-34 ; 0x17ee8 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; 17f0a: 80 e0 ldi r24, 0x00 ; 0 17f0c: 3c cf rjmp .-392 ; 0x17d86 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; 17f0e: 8c ef ldi r24, 0xFC ; 252 17f10: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 17f12: 87 fd sbrc r24, 7 17f14: 80 e0 ldi r24, 0x00 ; 0 17f16: 08 2e mov r0, r24 17f18: 00 0c add r0, r0 17f1a: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17f1c: fc 01 movw r30, r24 17f1e: ee 0f add r30, r30 17f20: ff 1f adc r31, r31 17f22: ee 0f add r30, r30 17f24: ff 1f adc r31, r31 17f26: e0 51 subi r30, 0x10 ; 16 17f28: fd 4e sbci r31, 0xED ; 237 17f2a: 40 80 ld r4, Z 17f2c: 51 80 ldd r5, Z+1 ; 0x01 17f2e: 62 80 ldd r6, Z+2 ; 0x02 17f30: 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; 17f32: b8 01 movw r22, r16 17f34: 68 1b sub r22, r24 17f36: 79 0b sbc r23, r25 17f38: 07 2e mov r0, r23 17f3a: 00 0c add r0, r0 17f3c: 88 0b sbc r24, r24 17f3e: 99 0b sbc r25, r25 17f40: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 17f44: 20 e0 ldi r18, 0x00 ; 0 17f46: 30 e0 ldi r19, 0x00 ; 0 17f48: 40 e8 ldi r20, 0x80 ; 128 17f4a: 5e e3 ldi r21, 0x3E ; 62 17f4c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 17f50: 5b 01 movw r10, r22 17f52: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17f54: a3 2d mov r26, r3 17f56: b4 e0 ldi r27, 0x04 ; 4 17f58: ab 02 muls r26, r27 17f5a: f0 01 movw r30, r0 17f5c: 11 24 eor r1, r1 17f5e: e0 51 subi r30, 0x10 ; 16 17f60: fd 4e sbci r31, 0xED ; 237 17f62: a3 01 movw r20, r6 17f64: 92 01 movw r18, r4 17f66: 60 81 ld r22, Z 17f68: 71 81 ldd r23, Z+1 ; 0x01 17f6a: 82 81 ldd r24, Z+2 ; 0x02 17f6c: 93 81 ldd r25, Z+3 ; 0x03 17f6e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 17f72: 9b 01 movw r18, r22 17f74: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 17f76: c6 01 movw r24, r12 17f78: b5 01 movw r22, r10 17f7a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 17f7e: a3 01 movw r20, r6 17f80: 92 01 movw r18, r4 17f82: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 17f86: f7 01 movw r30, r14 17f88: 60 83 st Z, r22 17f8a: 71 83 std Z+1, r23 ; 0x01 17f8c: 82 83 std Z+2, r24 ; 0x02 17f8e: 93 83 std Z+3, r25 ; 0x03 17f90: b4 cf rjmp .-152 ; 0x17efa // 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); 17f92: 88 e0 ldi r24, 0x08 ; 8 17f94: 0e 94 70 ef call 0x1dee0 ; 0x1dee0 lcd_setstatuspgm(MSG_WELCOME); 17f98: 8f ec ldi r24, 0xCF ; 207 17f9a: 9f e6 ldi r25, 0x6F ; 111 17f9c: 0e 94 3b f2 call 0x1e476 ; 0x1e476 thermal_model_cal::set_fan_speed(0); 17fa0: 80 e0 ldi r24, 0x00 ; 0 17fa2: 0f 94 bc 2e call 0x25d78 ; 0x25d78 thermal_model_set_enabled(orig_enabled); 17fa6: 67 96 adiw r28, 0x17 ; 23 17fa8: 8f ad ldd r24, Y+63 ; 0x3f 17faa: 67 97 sbiw r28, 0x17 ; 23 17fac: 0f 94 42 33 call 0x26684 ; 0x26684 thermal_model_report_settings(); 17fb0: 0f 94 c6 2e call 0x25d8c ; 0x25d8c 17fb4: 25 cf rjmp .-438 ; 0x17e00 M400 */ case 400: { st_synchronize(); 17fb6: 0f 94 ed 43 call 0x287da ; 0x287da 17fba: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 17fbe: 81 e0 ldi r24, 0x01 ; 1 17fc0: 0e 94 4f 74 call 0xe89e ; 0xe89e 17fc4: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 17fc8: 0e 94 db 7e call 0xfdb6 ; 0xfdb6 17fcc: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 M500 */ case 500: { Config_StoreSettings(); 17fd0: 0e 94 24 82 call 0x10448 ; 0x10448 17fd4: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 M501 */ case 501: { Config_RetrieveSettings(); 17fd8: 0e 94 34 93 call 0x12668 ; 0x12668 17fdc: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 M502 */ case 502: { Config_ResetDefault(); 17fe0: 0e 94 0c 82 call 0x10418 ; 0x10418 17fe4: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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); 17fe8: 1f 93 push r17 17fea: 0f 93 push r16 17fec: 81 ea ldi r24, 0xA1 ; 161 17fee: 9e e7 ldi r25, 0x7E ; 126 17ff0: 9f 93 push r25 17ff2: 8f 93 push r24 17ff4: 0f 94 16 db call 0x3b62c ; 0x3b62c 17ff8: 0f 90 pop r0 17ffa: 0f 90 pop r0 17ffc: 0f 90 pop r0 17ffe: 0f 90 pop r0 18000: 0c 94 ba ae jmp 0x15d74 ; 0x15d74 M509 */ case 509: { lang_reset(); 18004: 0e 94 ac 70 call 0xe158 ; 0xe158 SERIAL_ECHO_START; 18008: 82 ec ldi r24, 0xC2 ; 194 1800a: 9a ea ldi r25, 0xAA ; 170 1800c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 18010: 80 ea ldi r24, 0xA0 ; 160 18012: 95 e8 ldi r25, 0x85 ; 133 18014: 0e 94 d0 76 call 0xeda0 ; 0xeda0 18018: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 - `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(); 1801c: 0f 94 ed 43 call 0x287da ; 0x287da /// 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; 18020: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 18024: 81 11 cpse r24, r1 18026: 02 c0 rjmp .+4 ; 0x1802c 18028: 0e 94 c9 63 call 0xc792 ; 0xc792 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(); 1802c: 85 e4 ldi r24, 0x45 ; 69 1802e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 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; 18032: 81 2c mov r8, r1 18034: 91 2c mov r9, r1 18036: a1 2c mov r10, r1 18038: 30 ec ldi r19, 0xC0 ; 192 1803a: b3 2e mov r11, r19 float e_shift_late = FILAMENTCHANGE_FINALRETRACT; bool automatic = false; //Retract extruder if (code_seen('E')) e_shift_init = code_value(); 1803c: 88 23 and r24, r24 1803e: 21 f0 breq .+8 ; 0x18048 18040: 0e 94 1d 60 call 0xc03a ; 0xc03a 18044: 4b 01 movw r8, r22 18046: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 18048: 8c e4 ldi r24, 0x4C ; 76 1804a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 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; 1804e: c1 2c mov r12, r1 18050: d1 2c mov r13, r1 18052: 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(); 18054: 88 23 and r24, r24 18056: 21 f0 breq .+8 ; 0x18060 18058: 0e 94 1d 60 call 0xc03a ; 0xc03a 1805c: 6b 01 movw r12, r22 1805e: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 18060: 8a e5 ldi r24, 0x5A ; 90 18062: 0e 94 56 5b call 0xb6ac ; 0xb6ac // 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; 18066: 41 2c mov r4, r1 18068: 51 2c mov r5, r1 1806a: 28 ed ldi r18, 0xD8 ; 216 1806c: 62 2e mov r6, r18 1806e: 21 e4 ldi r18, 0x41 ; 65 18070: 72 2e mov r7, r18 //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()); 18072: 88 23 and r24, r24 18074: 31 f0 breq .+12 ; 0x18082 18076: 0e 94 1d 60 call 0xc03a ; 0xc03a 1807a: 2b 01 movw r4, r22 1807c: 3c 01 movw r6, r24 1807e: e8 94 clt 18080: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 18082: 88 e5 ldi r24, 0x58 ; 88 18084: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18088: 88 23 and r24, r24 1808a: 09 f4 brne .+2 ; 0x1808e 1808c: 49 c1 rjmp .+658 ; 0x18320 1808e: 0e 94 1d 60 call 0xc03a ; 0xc03a 18092: 6a 96 adiw r28, 0x1a ; 26 18094: 6c af std Y+60, r22 ; 0x3c 18096: 7d af std Y+61, r23 ; 0x3d 18098: 8e af std Y+62, r24 ; 0x3e 1809a: 9f af std Y+63, r25 ; 0x3f 1809c: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 1809e: 89 e5 ldi r24, 0x59 ; 89 180a0: 0e 94 56 5b call 0xb6ac ; 0xb6ac 180a4: 88 23 and r24, r24 180a6: 09 f4 brne .+2 ; 0x180aa 180a8: 46 c1 rjmp .+652 ; 0x18336 180aa: 0e 94 1d 60 call 0xc03a ; 0xc03a 180ae: 6e 96 adiw r28, 0x1e ; 30 180b0: 6c af std Y+60, r22 ; 0x3c 180b2: 7d af std Y+61, r23 ; 0x3d 180b4: 8e af std Y+62, r24 ; 0x3e 180b6: 9f af std Y+63, r25 ; 0x3f 180b8: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 180ba: 1a 82 std Y+2, r1 ; 0x02 180bc: 19 82 std Y+1, r1 ; 0x01 180be: fe 01 movw r30, r28 180c0: 33 96 adiw r30, 0x03 ; 3 180c2: 83 e1 ldi r24, 0x13 ; 19 180c4: df 01 movw r26, r30 180c6: 1d 92 st X+, r1 180c8: 8a 95 dec r24 180ca: e9 f7 brne .-6 ; 0x180c6 if (code_seen('C')) { 180cc: 83 e4 ldi r24, 0x43 ; 67 180ce: 0e 94 56 5b call 0xb6ac ; 0xb6ac 180d2: 88 23 and r24, r24 180d4: f9 f0 breq .+62 ; 0x18114 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 180d6: 62 e2 ldi r22, 0x22 ; 34 180d8: 70 e0 ldi r23, 0x00 ; 0 180da: 80 91 95 03 lds r24, 0x0395 ; 0x800395 180de: 90 91 96 03 lds r25, 0x0396 ; 0x800396 180e2: 0f 94 ab e2 call 0x3c556 ; 0x3c556 180e6: 8c 01 movw r16, r24 if (!this->ptr) { 180e8: 89 2b or r24, r25 180ea: a1 f0 breq .+40 ; 0x18114 // First quote not found return; } // Skip the leading quote this->ptr++; 180ec: 0f 5f subi r16, 0xFF ; 255 180ee: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 180f0: 62 e2 ldi r22, 0x22 ; 34 180f2: 70 e0 ldi r23, 0x00 ; 0 180f4: c8 01 movw r24, r16 180f6: 0f 94 ab e2 call 0x3c556 ; 0x3c556 if(!pStrEnd) { 180fa: 00 97 sbiw r24, 0x00 ; 0 180fc: 59 f0 breq .+22 ; 0x18114 // Second quote not found return; } this->len = pStrEnd - this->ptr; 180fe: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 18100: 84 31 cpi r24, 0x14 ; 20 18102: 08 f0 brcs .+2 ; 0x18106 18104: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 18106: 48 2f mov r20, r24 18108: 50 e0 ldi r21, 0x00 ; 0 1810a: b8 01 movw r22, r16 1810c: ce 01 movw r24, r28 1810e: 01 96 adiw r24, 0x01 ; 1 18110: 0f 94 7d e2 call 0x3c4fa ; 0x3c4fa } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 18114: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 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; 18118: 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"))) 1811a: 81 30 cpi r24, 0x01 ; 1 1811c: 29 f4 brne .+10 ; 0x18128 1811e: 8b e9 ldi r24, 0x9B ; 155 18120: 95 e8 ldi r25, 0x85 ; 133 18122: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 18126: 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(); 18128: 0f 94 ed 43 call 0x287da ; 0x287da uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 1812c: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 // Retract E if (!printingIsPaused()) 18130: 0e 94 05 67 call 0xce0a ; 0xce0a 18134: 81 11 cpse r24, r1 18136: 06 c1 rjmp .+524 ; 0x18344 { current_position[E_AXIS] += e_shift; 18138: a5 01 movw r20, r10 1813a: 94 01 movw r18, r8 1813c: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 18140: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 18144: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 18148: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1814c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 18150: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 18154: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 18158: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1815c: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 18160: 60 e0 ldi r22, 0x00 ; 0 18162: 70 e0 ldi r23, 0x00 ; 0 18164: 88 ee ldi r24, 0xE8 ; 232 18166: 92 e4 ldi r25, 0x42 ; 66 18168: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1816c: 0f 94 ed 43 call 0x287da ; 0x287da SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 18170: 85 e5 ldi r24, 0x55 ; 85 18172: 9e e6 ldi r25, 0x6E ; 110 18174: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 18178: c3 01 movw r24, r6 1817a: b2 01 movw r22, r4 1817c: 0e 94 61 6d call 0xdac2 ; 0xdac2 // Move XY to side current_position[X_AXIS] = x_position; 18180: 6a 96 adiw r28, 0x1a ; 26 18182: 2c ad ldd r18, Y+60 ; 0x3c 18184: 3d ad ldd r19, Y+61 ; 0x3d 18186: 4e ad ldd r20, Y+62 ; 0x3e 18188: 5f ad ldd r21, Y+63 ; 0x3f 1818a: 6a 97 sbiw r28, 0x1a ; 26 1818c: 20 93 92 06 sts 0x0692, r18 ; 0x800692 18190: 30 93 93 06 sts 0x0693, r19 ; 0x800693 18194: 40 93 94 06 sts 0x0694, r20 ; 0x800694 18198: 50 93 95 06 sts 0x0695, r21 ; 0x800695 current_position[Y_AXIS] = y_position; 1819c: 6e 96 adiw r28, 0x1e ; 30 1819e: 8c ad ldd r24, Y+60 ; 0x3c 181a0: 9d ad ldd r25, Y+61 ; 0x3d 181a2: ae ad ldd r26, Y+62 ; 0x3e 181a4: bf ad ldd r27, Y+63 ; 0x3f 181a6: 6e 97 sbiw r28, 0x1e ; 30 181a8: 80 93 96 06 sts 0x0696, r24 ; 0x800696 181ac: 90 93 97 06 sts 0x0697, r25 ; 0x800697 181b0: a0 93 98 06 sts 0x0698, r26 ; 0x800698 181b4: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 181b8: 60 e0 ldi r22, 0x00 ; 0 181ba: 70 e0 ldi r23, 0x00 ; 0 181bc: 88 e4 ldi r24, 0x48 ; 72 181be: 92 e4 ldi r25, 0x42 ; 66 181c0: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 181c4: 0f 94 ed 43 call 0x287da ; 0x287da bool repeat = false; 181c8: 67 96 adiw r28, 0x17 ; 23 181ca: 1f ae std Y+63, r1 ; 0x3f 181cc: 67 97 sbiw r28, 0x17 ; 23 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; 181ce: b1 2c mov r11, 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)); 181d0: 0a ee ldi r16, 0xEA ; 234 181d2: 20 2e mov r2, r16 181d4: 0d e7 ldi r16, 0x7D ; 125 181d6: 30 2e mov r3, r16 delay_keep_alive(4); if (lcd_clicked()) { setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 181d8: 82 e0 ldi r24, 0x02 ; 2 181da: a8 2e mov r10, r24 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)); 181dc: 92 ef ldi r25, 0xF2 ; 242 181de: 89 2e mov r8, r25 181e0: 9d e7 ldi r25, 0x7D ; 125 181e2: 99 2e mov r9, r25 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 181e4: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 181e8: 81 30 cpi r24, 0x01 ; 1 181ea: 09 f0 breq .+2 ; 0x181ee 181ec: ae c0 rjmp .+348 ; 0x1834a eject_slot = MMU2::mmu2.get_current_tool(); 181ee: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 181f2: b8 2e mov r11, r24 mmu_M600_unload_filament(); 181f4: 0e 94 97 72 call 0xe52e ; 0xe52e } 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 181f8: 0f 94 ed 43 call 0x287da ; 0x287da FSensorBlockRunout fsBlockRunout; 181fc: 0f 94 e9 87 call 0x30fd2 ; 0x30fd2 if (!MMU2::mmu2.Enabled()) 18200: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 18204: 81 30 cpi r24, 0x01 ; 1 18206: 09 f4 brne .+2 ; 0x1820a 18208: 6e c1 rjmp .+732 ; 0x184e6 { KEEPALIVE_STATE(PAUSED_FOR_USER); 1820a: 84 e0 ldi r24, 0x04 ; 4 1820c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_UNLOAD_SUCCESSFUL), false, LCD_LEFT_BUTTON_CHOICE); 18210: 81 e2 ldi r24, 0x21 ; 33 18212: 99 e3 ldi r25, 0x39 ; 57 18214: 0e 94 2c 72 call 0xe458 ; 0xe458 18218: 40 e0 ldi r20, 0x00 ; 0 1821a: 60 e0 ldi r22, 0x00 ; 0 1821c: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc 18220: 08 2f mov r16, r24 lcd_update_enable(false); 18222: 80 e0 ldi r24, 0x00 ; 0 18224: 0e 94 a5 6e call 0xdd4a ; 0xdd4a if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 18228: 01 30 cpi r16, 0x01 ; 1 1822a: 29 f5 brne .+74 ; 0x18276 lcd_clear(); 1822c: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18230: 89 e9 ldi r24, 0x99 ; 153 18232: 99 e3 ldi r25, 0x39 ; 57 18234: 0e 94 2c 72 call 0xe458 ; 0xe458 18238: ac 01 movw r20, r24 1823a: 62 e0 ldi r22, 0x02 ; 2 1823c: 80 e0 ldi r24, 0x00 ; 0 1823e: 0e 94 74 6e call 0xdce8 ; 0xdce8 current_position[X_AXIS] = 100; 18242: 80 e0 ldi r24, 0x00 ; 0 18244: 90 e0 ldi r25, 0x00 ; 0 18246: a8 ec ldi r26, 0xC8 ; 200 18248: b2 e4 ldi r27, 0x42 ; 66 1824a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1824e: 90 93 93 06 sts 0x0693, r25 ; 0x800693 18252: a0 93 94 06 sts 0x0694, r26 ; 0x800694 18256: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 1825a: 60 e0 ldi r22, 0x00 ; 0 1825c: 70 e0 ldi r23, 0x00 ; 0 1825e: 88 e4 ldi r24, 0x48 ; 72 18260: 92 e4 ldi r25, 0x42 ; 66 18262: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 18266: 0f 94 ed 43 call 0x287da ; 0x287da lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 1826a: 8f ee ldi r24, 0xEF ; 239 1826c: 98 e3 ldi r25, 0x38 ; 56 1826e: 0e 94 2c 72 call 0xe458 ; 0xe458 18272: 0f 94 f6 20 call 0x241ec ; 0x241ec preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 18276: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 1827a: 8d e7 ldi r24, 0x7D ; 125 1827c: 98 e3 ldi r25, 0x38 ; 56 1827e: 0e 94 2c 72 call 0xe458 ; 0xe458 18282: ac 01 movw r20, r24 18284: 60 e0 ldi r22, 0x00 ; 0 18286: 80 e0 ldi r24, 0x00 ; 0 18288: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(0, 1); 1828c: 61 e0 ldi r22, 0x01 ; 1 1828e: 80 e0 ldi r24, 0x00 ; 0 18290: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 if (filament_name[0]) { 18294: 89 81 ldd r24, Y+1 ; 0x01 18296: 88 23 and r24, r24 18298: 41 f0 breq .+16 ; 0x182aa lcd_print(filament_name); 1829a: ce 01 movw r24, r28 1829c: 01 96 adiw r24, 0x01 ; 1 1829e: 0e 94 67 70 call 0xe0ce ; 0xe0ce lcd_set_cursor(0, 2); 182a2: 62 e0 ldi r22, 0x02 ; 2 182a4: 80 e0 ldi r24, 0x00 ; 0 182a6: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 182aa: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 182ae: 81 11 cpse r24, r1 182b0: 06 c0 rjmp .+12 ; 0x182be #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 182b2: 88 e6 ldi r24, 0x68 ; 104 182b4: 98 e3 ldi r25, 0x38 ; 56 182b6: 0e 94 2c 72 call 0xe458 ; 0xe458 182ba: 0e 94 4b 6e call 0xdc96 ; 0xdc96 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); 182be: 84 e0 ldi r24, 0x04 ; 4 182c0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be while(!lcd_clicked()) 182c4: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 182c8: 81 11 cpse r24, r1 182ca: 10 c0 rjmp .+32 ; 0x182ec { manage_heater(); 182cc: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 182d0: 81 e0 ldi r24, 0x01 ; 1 182d2: 0e 94 37 8a call 0x1146e ; 0x1146e #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 182d6: 80 91 ae 17 lds r24, 0x17AE ; 0x8017ae 182da: 88 23 and r24, r24 182dc: 99 f3 breq .-26 ; 0x182c4 Sound_MakeCustom(50,1000,false); 182de: 40 e0 ldi r20, 0x00 ; 0 182e0: 68 ee ldi r22, 0xE8 ; 232 182e2: 73 e0 ldi r23, 0x03 ; 3 182e4: 82 e3 ldi r24, 0x32 ; 50 182e6: 90 e0 ldi r25, 0x00 ; 0 182e8: 0f 94 81 52 call 0x2a502 ; 0x2a502 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 182ec: a0 92 be 02 sts 0x02BE, r10 ; 0x8002be M600_load_filament_movements(filament_name); 182f0: ce 01 movw r24, r28 182f2: 01 96 adiw r24, 0x01 ; 1 182f4: 0e 94 50 72 call 0xe4a0 ; 0xe4a0 Sound_MakeCustom(50,1000,false); 182f8: 40 e0 ldi r20, 0x00 ; 0 182fa: 68 ee ldi r22, 0xE8 ; 232 182fc: 73 e0 ldi r23, 0x03 ; 3 182fe: 82 e3 ldi r24, 0x32 ; 50 18300: 90 e0 ldi r25, 0x00 ; 0 18302: 0f 94 81 52 call 0x2a502 ; 0x2a502 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); 18306: b4 e0 ldi r27, 0x04 ; 4 18308: 7b 2e mov r7, r27 else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 1830a: 11 23 and r17, r17 1830c: 09 f4 brne .+2 ; 0x18310 1830e: 00 c1 rjmp .+512 ; 0x18510 18310: 0f 94 2d 7c call 0x2f85a ; 0x2f85a current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 18314: 67 96 adiw r28, 0x17 ; 23 18316: 4f ad ldd r20, Y+63 ; 0x3f 18318: 67 97 sbiw r28, 0x17 ; 23 1831a: 41 11 cpse r20, r1 1831c: 63 cf rjmp .-314 ; 0x181e4 1831e: a1 c1 rjmp .+834 ; 0x18662 // 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; 18320: 20 e0 ldi r18, 0x00 ; 0 18322: 30 e0 ldi r19, 0x00 ; 0 18324: 43 e5 ldi r20, 0x53 ; 83 18326: 53 e4 ldi r21, 0x43 ; 67 18328: 6a 96 adiw r28, 0x1a ; 26 1832a: 2c af std Y+60, r18 ; 0x3c 1832c: 3d af std Y+61, r19 ; 0x3d 1832e: 4e af std Y+62, r20 ; 0x3e 18330: 5f af std Y+63, r21 ; 0x3f 18332: 6a 97 sbiw r28, 0x1a ; 26 18334: b4 ce rjmp .-664 ; 0x1809e float y_position = FILAMENTCHANGE_YPOS; 18336: 6e 96 adiw r28, 0x1e ; 30 18338: 1c ae std Y+60, r1 ; 0x3c 1833a: 1d ae std Y+61, r1 ; 0x3d 1833c: 1e ae std Y+62, r1 ; 0x3e 1833e: 1f ae std Y+63, r1 ; 0x3f 18340: 6e 97 sbiw r28, 0x1e ; 30 18342: bb ce rjmp .-650 ; 0x180ba 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(); 18344: 0e 94 49 64 call 0xc892 ; 0xc892 18348: 17 cf rjmp .-466 ; 0x18178 //! //! 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); 1834a: 84 e0 ldi r24, 0x04 ; 4 1834c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be unsigned long waiting_start_time = _millis(); 18350: 0f 94 51 2a call 0x254a2 ; 0x254a2 18354: 2b 01 movw r4, r22 18356: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 18358: 8d e3 ldi r24, 0x3D ; 61 1835a: 98 e3 ldi r25, 0x38 ; 56 1835c: 0e 94 2c 72 call 0xe458 ; 0xe458 18360: 0f 94 e9 20 call 0x241d2 ; 0x241d2 while (!(wait_for_user_state == 0 && lcd_clicked())){ 18364: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 18368: 08 2f mov r16, r24 1836a: 81 11 cpse r24, r1 1836c: 38 c0 rjmp .+112 ; 0x183de 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) { 1836e: a3 01 movw r20, r6 18370: 92 01 movw r18, r4 18372: 20 54 subi r18, 0x40 ; 64 18374: 38 4d sbci r19, 0xD8 ; 216 18376: 46 4f sbci r20, 0xF6 ; 246 18378: 5f 4f sbci r21, 0xFF ; 255 1837a: 6e 96 adiw r28, 0x1e ; 30 1837c: 2c af std Y+60, r18 ; 0x3c 1837e: 3d af std Y+61, r19 ; 0x3d 18380: 4e af std Y+62, r20 ; 0x3e 18382: 5f af std Y+63, r21 ; 0x3f 18384: 6e 97 sbiw r28, 0x1e ; 30 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(); 18386: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 1838a: 81 e0 ldi r24, 0x01 ; 1 1838c: 0e 94 37 8a call 0x1146e ; 0x1146e if (wait_for_user_state != 2) sound_wait_for_user(); 18390: 02 30 cpi r16, 0x02 ; 2 18392: 09 f4 brne .+2 ; 0x18396 18394: 67 c0 rjmp .+206 ; 0x18464 18396: 0f 94 25 53 call 0x2a64a ; 0x2a64a 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); 1839a: 84 e0 ldi r24, 0x04 ; 4 1839c: 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) { 1839e: 01 30 cpi r16, 0x01 ; 1 183a0: 39 f1 breq .+78 ; 0x183f0 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 183a2: 0e 94 6c 8c call 0x118d8 ; 0x118d8 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 183a6: 0f 94 51 2a call 0x254a2 ; 0x254a2 183aa: 6e 96 adiw r28, 0x1e ; 30 183ac: 2c ad ldd r18, Y+60 ; 0x3c 183ae: 3d ad ldd r19, Y+61 ; 0x3d 183b0: 4e ad ldd r20, Y+62 ; 0x3e 183b2: 5f ad ldd r21, Y+63 ; 0x3f 183b4: 6e 97 sbiw r28, 0x1e ; 30 183b6: 26 17 cp r18, r22 183b8: 37 07 cpc r19, r23 183ba: 48 07 cpc r20, r24 183bc: 59 07 cpc r21, r25 183be: 90 f6 brcc .-92 ; 0x18364 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 183c0: 8c e0 ldi r24, 0x0C ; 12 183c2: 98 e3 ldi r25, 0x38 ; 56 183c4: 0e 94 2c 72 call 0xe458 ; 0xe458 183c8: 0f 94 e9 20 call 0x241d2 ; 0x241d2 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 183cc: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 183d0: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 183d4: 0f 94 ed 43 call 0x287da ; 0x287da disable_e0(); 183d8: 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; 183da: 01 e0 ldi r16, 0x01 ; 1 183dc: d4 cf rjmp .-88 ; 0x18386 183de: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_ZL10beep_timer.lto_priv.496> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 183e2: 10 92 6e 05 sts 0x056E, r1 ; 0x80056e <_ZL6bFirst.lto_priv.497> 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); 183e6: c7 01 movw r24, r14 183e8: b6 01 movw r22, r12 183ea: 0e 94 2d f9 call 0x1f25a ; 0x1f25a 183ee: 04 cf rjmp .-504 ; 0x181f8 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); 183f0: 0e 94 6c 8c call 0x118d8 ; 0x118d8 if (lcd_clicked()) { 183f4: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 183f8: 88 23 and r24, r24 183fa: 29 f2 breq .-118 ; 0x18386 183fc: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 18400: 90 91 ad 05 lds r25, 0x05AD ; 0x8005ad 18404: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 18408: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1840c: 8f ec ldi r24, 0xCF ; 207 1840e: 9b e3 ldi r25, 0x3B ; 59 18410: 0e 94 2c 72 call 0xe458 ; 0xe458 18414: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 18418: 42 e8 ldi r20, 0x82 ; 130 1841a: 64 e0 ldi r22, 0x04 ; 4 1841c: 80 e0 ldi r24, 0x00 ; 0 1841e: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 18422: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 18426: 8f 93 push r24 18428: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 1842c: 8f 93 push r24 1842e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 18432: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 18436: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1843a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1843e: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 18442: 7f 93 push r23 18444: 6f 93 push r22 18446: 3f 92 push r3 18448: 2f 92 push r2 1844a: 0e 94 39 6e call 0xdc72 ; 0xdc72 lcd_putc(LCD_STR_DEGREE[0]); 1844e: 81 e8 ldi r24, 0x81 ; 129 18450: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 18454: 0f 90 pop r0 18456: 0f 90 pop r0 18458: 0f 90 pop r0 1845a: 0f 90 pop r0 1845c: 0f 90 pop r0 1845e: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 18460: 02 e0 ldi r16, 0x02 ; 2 18462: 91 cf rjmp .-222 ; 0x18386 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 18464: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 18468: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 1846c: 07 2e mov r0, r23 1846e: 00 0c add r0, r0 18470: 88 0b sbc r24, r24 18472: 99 0b sbc r25, r25 18474: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 18478: 20 91 b0 0d lds r18, 0x0DB0 ; 0x800db0 1847c: 30 91 b1 0d lds r19, 0x0DB1 ; 0x800db1 18480: 40 91 b2 0d lds r20, 0x0DB2 ; 0x800db2 18484: 50 91 b3 0d lds r21, 0x0DB3 ; 0x800db3 18488: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1848c: 9f 77 andi r25, 0x7F ; 127 1848e: 20 e0 ldi r18, 0x00 ; 0 18490: 30 e0 ldi r19, 0x00 ; 0 18492: 40 ea ldi r20, 0xA0 ; 160 18494: 50 e4 ldi r21, 0x40 ; 64 18496: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1849a: 87 ff sbrs r24, 7 1849c: 0b c0 rjmp .+22 ; 0x184b4 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 1849e: 8d e3 ldi r24, 0x3D ; 61 184a0: 98 e3 ldi r25, 0x38 ; 56 184a2: 0e 94 2c 72 call 0xe458 ; 0xe458 184a6: 0f 94 e9 20 call 0x241d2 ; 0x241d2 waiting_start_time = _millis(); 184aa: 0f 94 51 2a call 0x254a2 ; 0x254a2 184ae: 2b 01 movw r4, r22 184b0: 3c 01 movw r6, r24 184b2: 58 cf rjmp .-336 ; 0x18364 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 184b4: 64 e0 ldi r22, 0x04 ; 4 184b6: 81 e0 ldi r24, 0x01 ; 1 184b8: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 184bc: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 184c0: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 184c4: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 184c8: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 184cc: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 184d0: 7f 93 push r23 184d2: 6f 93 push r22 184d4: 9f 92 push r9 184d6: 8f 92 push r8 184d8: 0e 94 39 6e call 0xdc72 ; 0xdc72 184dc: 0f 90 pop r0 184de: 0f 90 pop r0 184e0: 0f 90 pop r0 184e2: 0f 90 pop r0 184e4: 50 cf rjmp .-352 ; 0x18386 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 184e6: 11 11 cpse r17, r1 184e8: 03 c0 rjmp .+6 ; 0x184f0 184ea: 8b 2d mov r24, r11 184ec: 0e 94 8f 8c call 0x1191e ; 0x1191e mmu_M600_load_filament(automatic); 184f0: 81 2f mov r24, r17 184f2: 0e 94 8e 77 call 0xef1c ; 0xef1c 184f6: 07 cf rjmp .-498 ; 0x18306 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 184f8: 03 30 cpi r16, 0x03 ; 3 184fa: 10 f4 brcc .+4 ; 0x18500 cursor_pos++; 184fc: 0f 5f subi r16, 0xFF ; 255 184fe: 49 c0 rjmp .+146 ; 0x18592 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18500: 87 e0 ldi r24, 0x07 ; 7 18502: 0f 94 0c 4f call 0x29e18 ; 0x29e18 18506: 45 c0 rjmp .+138 ; 0x18592 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); 18508: ce 01 movw r24, r28 1850a: 01 96 adiw r24, 0x01 ; 1 1850c: 0e 94 50 72 call 0xe4a0 ; 0xe4a0 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); 18510: 70 92 be 02 sts 0x02BE, r7 ; 0x8002be uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 18514: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 18518: 89 eb ldi r24, 0xB9 ; 185 1851a: 98 e3 ldi r25, 0x38 ; 56 1851c: 0e 94 2c 72 call 0xe458 ; 0xe458 18520: ac 01 movw r20, r24 18522: 60 e0 ldi r22, 0x00 ; 0 18524: 81 e0 ldi r24, 0x01 ; 1 18526: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 1852a: 83 ea ldi r24, 0xA3 ; 163 1852c: 98 e3 ldi r25, 0x38 ; 56 1852e: 0e 94 2c 72 call 0xe458 ; 0xe458 18532: ac 01 movw r20, r24 18534: 61 e0 ldi r22, 0x01 ; 1 18536: 81 e0 ldi r24, 0x01 ; 1 18538: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 1853c: 8f e8 ldi r24, 0x8F ; 143 1853e: 98 e3 ldi r25, 0x38 ; 56 18540: 0e 94 2c 72 call 0xe458 ; 0xe458 18544: ac 01 movw r20, r24 18546: 62 e0 ldi r22, 0x02 ; 2 18548: 81 e0 ldi r24, 0x01 ; 1 1854a: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 1854e: 86 e3 ldi r24, 0x36 ; 54 18550: 96 e4 ldi r25, 0x46 ; 70 18552: 0e 94 2c 72 call 0xe458 ; 0xe458 18556: ac 01 movw r20, r24 18558: 63 e0 ldi r22, 0x03 ; 3 1855a: 81 e0 ldi r24, 0x01 ; 1 1855c: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_putc_at(0, cursor_pos, '>'); 18560: 4e e3 ldi r20, 0x3E ; 62 18562: 60 e0 ldi r22, 0x00 ; 0 18564: 80 e0 ldi r24, 0x00 ; 0 18566: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_consume_click(); 1856a: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 1856e: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 18570: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 18574: 81 e0 ldi r24, 0x01 ; 1 18576: 0e 94 37 8a call 0x1146e ; 0x1146e if (lcd_encoder) 1857a: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1857e: 90 91 71 06 lds r25, 0x0671 ; 0x800671 18582: 00 97 sbiw r24, 0x00 ; 0 18584: d9 f0 breq .+54 ; 0x185bc { if (lcd_encoder < 0 ) { 18586: 97 ff sbrs r25, 7 18588: b7 cf rjmp .-146 ; 0x184f8 // Rotating knob counter clockwise if (cursor_pos > 0) 1858a: 00 23 and r16, r16 1858c: 09 f4 brne .+2 ; 0x18590 1858e: b8 cf rjmp .-144 ; 0x18500 cursor_pos--; 18590: 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 ")); 18592: 46 ef ldi r20, 0xF6 ; 246 18594: 5d e7 ldi r21, 0x7D ; 125 18596: 60 e0 ldi r22, 0x00 ; 0 18598: 80 e0 ldi r24, 0x00 ; 0 1859a: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_putc_at(0, cursor_pos, '>'); 1859e: 4e e3 ldi r20, 0x3E ; 62 185a0: 60 2f mov r22, r16 185a2: 80 e0 ldi r24, 0x00 ; 0 185a4: 0e 94 80 6e call 0xdd00 ; 0xdd00 // Consume rotation event and make feedback sound lcd_encoder = 0; 185a8: 10 92 71 06 sts 0x0671, r1 ; 0x800671 185ac: 10 92 70 06 sts 0x0670, r1 ; 0x800670 _delay(100); 185b0: 64 e6 ldi r22, 0x64 ; 100 185b2: 70 e0 ldi r23, 0x00 ; 0 185b4: 80 e0 ldi r24, 0x00 ; 0 185b6: 90 e0 ldi r25, 0x00 ; 0 185b8: 0f 94 58 28 call 0x250b0 ; 0x250b0 } if (lcd_clicked()) 185bc: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 185c0: 88 23 and r24, r24 185c2: b1 f2 breq .-84 ; 0x18570 { lcd_clear(); 185c4: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_return_to_status(); 185c8: 0f 94 ab 1f call 0x23f56 ; 0x23f56 lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 185cc: a0 92 be 02 sts 0x02BE, r10 ; 0x8002be switch(lcd_change_filament_state) 185d0: 02 30 cpi r16, 0x02 ; 2 185d2: b1 f0 breq .+44 ; 0x18600 185d4: 03 30 cpi r16, 0x03 ; 3 185d6: 09 f4 brne .+2 ; 0x185da 185d8: f8 c0 rjmp .+496 ; 0x187ca 185da: 01 30 cpi r16, 0x01 ; 1 185dc: 81 f5 brne .+96 ; 0x1863e { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 185de: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 185e2: 81 30 cpi r24, 0x01 ; 1 185e4: 09 f0 breq .+2 ; 0x185e8 185e6: 90 cf rjmp .-224 ; 0x18508 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 185e8: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 185ec: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 185ee: 0e 94 97 72 call 0xe52e ; 0xe52e // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 185f2: 80 2f mov r24, r16 185f4: 0e 94 8f 8c call 0x1191e ; 0x1191e // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 185f8: 80 e0 ldi r24, 0x00 ; 0 185fa: 0e 94 8e 77 call 0xef1c ; 0xef1c 185fe: 88 cf rjmp .-240 ; 0x18510 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 18600: 0f 94 ed 43 call 0x287da ; 0x287da load_filament_final_feed(); 18604: 0e 94 13 64 call 0xc826 ; 0xc826 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(); 18608: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 1860c: 8d ec ldi r24, 0xCD ; 205 1860e: 98 e3 ldi r25, 0x38 ; 56 18610: 0e 94 2c 72 call 0xe458 ; 0xe458 18614: ac 01 movw r20, r24 18616: 60 e0 ldi r22, 0x00 ; 0 18618: 80 e0 ldi r24, 0x00 ; 0 1861a: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 1861e: 89 e9 ldi r24, 0x99 ; 153 18620: 99 e3 ldi r25, 0x39 ; 57 18622: 0e 94 2c 72 call 0xe458 ; 0xe458 18626: ac 01 movw r20, r24 18628: 62 e0 ldi r22, 0x02 ; 2 1862a: 80 e0 ldi r24, 0x00 ; 0 1862c: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 18630: 87 e9 ldi r24, 0x97 ; 151 18632: 9d e1 ldi r25, 0x1D ; 29 18634: 0f 94 74 21 call 0x242e8 ; 0x242e8 lcd_loading_color(); st_synchronize(); 18638: 0f 94 ed 43 call 0x287da ; 0x287da 1863c: 69 cf rjmp .-302 ; 0x18510 } void lcd_change_success() { lcd_clear(); 1863e: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 18642: 8d ed ldi r24, 0xDD ; 221 18644: 98 e3 ldi r25, 0x38 ; 56 18646: 0e 94 2c 72 call 0xe458 ; 0xe458 1864a: ac 01 movw r20, r24 1864c: 62 e0 ldi r22, 0x02 ; 2 1864e: 80 e0 ldi r24, 0x00 ; 0 18650: 0e 94 74 6e call 0xdce8 ; 0xdce8 //! @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) 18654: 00 23 and r16, r16 18656: 19 f0 breq .+6 ; 0x1865e 18658: 03 30 cpi r16, 0x03 ; 3 1865a: 09 f0 breq .+2 ; 0x1865e 1865c: 59 cf rjmp .-334 ; 0x18510 1865e: 0f 94 2d 7c call 0x2f85a ; 0x2f85a if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 18662: 81 e0 ldi r24, 0x01 ; 1 18664: 0e 94 a5 6e call 0xdd4a ; 0xdd4a // Not let's go back to print fanSpeed = saved_fan_speed; 18668: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 1866c: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 // Feed a little of filament to stabilize pressure if (!automatic) { 18670: 11 11 cpse r17, r1 18672: 27 c0 rjmp .+78 ; 0x186c2 if (printingIsPaused()) 18674: 0e 94 05 67 call 0xce0a ; 0xce0a 18678: c0 90 9e 06 lds r12, 0x069E ; 0x80069e 1867c: d0 90 9f 06 lds r13, 0x069F ; 0x80069f 18680: e0 90 a0 06 lds r14, 0x06A0 ; 0x8006a0 18684: f0 90 a1 06 lds r15, 0x06A1 ; 0x8006a1 18688: 88 23 and r24, r24 1868a: 09 f4 brne .+2 ; 0x1868e 1868c: a3 c0 rjmp .+326 ; 0x187d4 { // 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; 1868e: 20 e0 ldi r18, 0x00 ; 0 18690: 30 e0 ldi r19, 0x00 ; 0 18692: 40 e8 ldi r20, 0x80 ; 128 18694: 5f e3 ldi r21, 0x3F ; 63 18696: c7 01 movw r24, r14 18698: b6 01 movw r22, r12 1869a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1869e: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 186a2: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 186a6: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 186aa: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 186ae: 60 e0 ldi r22, 0x00 ; 0 186b0: 70 e0 ldi r23, 0x00 ; 0 186b2: 88 ee ldi r24, 0xE8 ; 232 186b4: 92 e4 ldi r25, 0x42 ; 66 186b6: 0f 94 81 c0 call 0x38102 ; 0x38102 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 186ba: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 186be: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 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); 186c2: e0 90 9a 06 lds r14, 0x069A ; 0x80069a 186c6: f0 90 9b 06 lds r15, 0x069B ; 0x80069b 186ca: 00 91 9c 06 lds r16, 0x069C ; 0x80069c 186ce: 10 91 9d 06 lds r17, 0x069D ; 0x80069d 186d2: 20 91 77 02 lds r18, 0x0277 ; 0x800277 186d6: 30 91 78 02 lds r19, 0x0278 ; 0x800278 186da: 40 91 79 02 lds r20, 0x0279 ; 0x800279 186de: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 186e2: 60 91 73 02 lds r22, 0x0273 ; 0x800273 186e6: 70 91 74 02 lds r23, 0x0274 ; 0x800274 186ea: 80 91 75 02 lds r24, 0x0275 ; 0x800275 186ee: 90 91 76 02 lds r25, 0x0276 ; 0x800276 186f2: 1f 92 push r1 186f4: 1f 92 push r1 186f6: 1f 92 push r1 186f8: 1f 92 push r1 186fa: 81 2c mov r8, r1 186fc: 91 2c mov r9, r1 186fe: e8 e4 ldi r30, 0x48 ; 72 18700: ae 2e mov r10, r30 18702: e2 e4 ldi r30, 0x42 ; 66 18704: be 2e mov r11, r30 18706: fe e9 ldi r31, 0x9E ; 158 18708: cf 2e mov r12, r31 1870a: f6 e0 ldi r31, 0x06 ; 6 1870c: df 2e mov r13, r31 1870e: 0f 94 2c b1 call 0x36258 ; 0x36258 st_synchronize(); 18712: 0f 94 ed 43 call 0x287da ; 0x287da // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 18716: e0 90 7b 02 lds r14, 0x027B ; 0x80027b 1871a: f0 90 7c 02 lds r15, 0x027C ; 0x80027c 1871e: 00 91 7d 02 lds r16, 0x027D ; 0x80027d 18722: 10 91 7e 02 lds r17, 0x027E ; 0x80027e 18726: 20 91 77 02 lds r18, 0x0277 ; 0x800277 1872a: 30 91 78 02 lds r19, 0x0278 ; 0x800278 1872e: 40 91 79 02 lds r20, 0x0279 ; 0x800279 18732: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 18736: 60 91 73 02 lds r22, 0x0273 ; 0x800273 1873a: 70 91 74 02 lds r23, 0x0274 ; 0x800274 1873e: 80 91 75 02 lds r24, 0x0275 ; 0x800275 18742: 90 91 76 02 lds r25, 0x0276 ; 0x800276 18746: 1f 92 push r1 18748: 1f 92 push r1 1874a: 1f 92 push r1 1874c: 1f 92 push r1 1874e: 81 2c mov r8, r1 18750: 91 2c mov r9, r1 18752: a0 e7 ldi r26, 0x70 ; 112 18754: aa 2e mov r10, r26 18756: a1 e4 ldi r26, 0x41 ; 65 18758: ba 2e mov r11, r26 1875a: 0f 94 2c b1 call 0x36258 ; 0x36258 st_synchronize(); 1875e: 0f 94 ed 43 call 0x287da ; 0x287da // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 18762: 8f e7 ldi r24, 0x7F ; 127 18764: 92 e0 ldi r25, 0x02 ; 2 18766: 0f 94 f9 64 call 0x2c9f2 ; 0x2c9f2 memcpy(current_position, saved_pos, sizeof(saved_pos)); 1876a: 80 e1 ldi r24, 0x10 ; 16 1876c: e3 e7 ldi r30, 0x73 ; 115 1876e: f2 e0 ldi r31, 0x02 ; 2 18770: a2 e9 ldi r26, 0x92 ; 146 18772: b6 e0 ldi r27, 0x06 ; 6 18774: 01 90 ld r0, Z+ 18776: 0d 92 st X+, r0 18778: 8a 95 dec r24 1877a: e1 f7 brne .-8 ; 0x18774 set_destination_to_current(); 1877c: 0e 94 ba 67 call 0xcf74 ; 0xcf74 // Recover feed rate feedmultiply = saved_feedmultiply2; 18780: 80 91 71 03 lds r24, 0x0371 ; 0x800371 18784: 90 91 72 03 lds r25, 0x0372 ; 0x800372 18788: 80 93 39 02 sts 0x0239, r24 ; 0x800239 1878c: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 18790: 9f 93 push r25 18792: 8f 93 push r24 18794: 82 e8 ldi r24, 0x82 ; 130 18796: 9d e6 ldi r25, 0x6D ; 109 18798: 9f 93 push r25 1879a: 8f 93 push r24 1879c: 0e 94 3e 88 call 0x1107c ; 0x1107c if (printingIsPaused()) { 187a0: 0e 94 05 67 call 0xce0a ; 0xce0a 187a4: 0f b6 in r0, 0x3f ; 63 187a6: f8 94 cli 187a8: de bf out 0x3e, r29 ; 62 187aa: 0f be out 0x3f, r0 ; 63 187ac: cd bf out 0x3d, r28 ; 61 187ae: 88 23 and r24, r24 187b0: 41 f1 breq .+80 ; 0x18802 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 187b2: 82 ec ldi r24, 0xC2 ; 194 187b4: 99 e4 ldi r25, 0x49 ; 73 187b6: 0e 94 2c 72 call 0xe458 ; 0xe458 187ba: 0e 94 3b f2 call 0x1e476 ; 0x1e476 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 187be: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 187c2: 10 92 a2 06 sts 0x06A2, r1 ; 0x8006a2 187c6: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 st_synchronize(); break; // Unload filament case 3: return true; 187ca: 31 e0 ldi r19, 0x01 ; 1 187cc: 67 96 adiw r28, 0x17 ; 23 187ce: 3f af std Y+63, r19 ; 0x3f 187d0: 67 97 sbiw r28, 0x17 ; 23 187d2: 9e cd rjmp .-1220 ; 0x18310 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 187d4: 20 e0 ldi r18, 0x00 ; 0 187d6: 30 e0 ldi r19, 0x00 ; 0 187d8: 40 ea ldi r20, 0xA0 ; 160 187da: 50 e4 ldi r21, 0x40 ; 64 187dc: c7 01 movw r24, r14 187de: b6 01 movw r22, r12 187e0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 187e4: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 187e8: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 187ec: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 187f0: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 187f4: 60 e0 ldi r22, 0x00 ; 0 187f6: 70 e0 ldi r23, 0x00 ; 0 187f8: 80 e0 ldi r24, 0x00 ; 0 187fa: 90 e4 ldi r25, 0x40 ; 64 187fc: 0f 94 81 c0 call 0x38102 ; 0x38102 18800: 60 cf rjmp .-320 ; 0x186c2 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18802: 8f ec ldi r24, 0xCF ; 207 18804: 9f e6 ldi r25, 0x6F ; 111 18806: 0e 94 3b f2 call 0x1e476 ; 0x1e476 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 1880a: 8f e4 ldi r24, 0x4F ; 79 1880c: 9a e6 ldi r25, 0x6A ; 106 1880e: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 18812: d5 cf rjmp .-86 ; 0x187be SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18814: 0e 94 05 67 call 0xce0a ; 0xce0a 18818: 81 11 cpse r24, r1 1881a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 st_synchronize(); 1881e: 0f 94 ed 43 call 0x287da ; 0x287da ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18822: 0e 94 aa 7e call 0xfd54 ; 0xfd54 cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18826: 0e 94 3c 76 call 0xec78 ; 0xec78 lcd_pause_print(); 1882a: 0f 94 5d 2a call 0x254ba ; 0x254ba 1882e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 18832: 0e 94 05 67 call 0xce0a ; 0xce0a 18836: 88 23 and r24, r24 18838: 11 f4 brne .+4 ; 0x1883e 1883a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 1883e: 0c 94 34 b1 jmp 0x16268 ; 0x16268 /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 18842: 60 e0 ldi r22, 0x00 ; 0 18844: 80 e0 ldi r24, 0x00 ; 0 18846: 0e 94 78 f5 call 0x1eaf0 ; 0x1eaf0 1884a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 1884e: 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')) { 18850: 83 e5 ldi r24, 0x53 ; 83 18852: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18856: 88 23 and r24, r24 18858: b1 f0 breq .+44 ; 0x18886 iSel = code_value_uint8(); 1885a: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 1885e: 18 2f mov r17, r24 if (iSel>=max_sheets) 18860: 88 30 cpi r24, 0x08 ; 8 18862: b0 f0 brcs .+44 ; 0x18890 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 18864: 8c e7 ldi r24, 0x7C ; 124 18866: 95 e8 ldi r25, 0x85 ; 133 18868: 0e 94 d0 76 call 0xeda0 ; 0xeda0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 1886c: 4a e0 ldi r20, 0x0A ; 10 1886e: 67 e0 ldi r22, 0x07 ; 7 18870: 70 e0 ldi r23, 0x00 ; 0 18872: 80 e0 ldi r24, 0x00 ; 0 18874: 90 e0 ldi r25, 0x00 ; 0 18876: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 1887a: 88 ef ldi r24, 0xF8 ; 248 1887c: 92 e0 ldi r25, 0x02 ; 2 1887e: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 18882: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18886: 81 ea ldi r24, 0xA1 ; 161 18888: 9d e0 ldi r25, 0x0D ; 13 1888a: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1888e: 18 2f mov r17, r24 } if (code_seen('Z')){ 18890: 8a e5 ldi r24, 0x5A ; 90 18892: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18896: 88 23 and r24, r24 18898: 09 f4 brne .+2 ; 0x1889c 1889a: d7 c0 rjmp .+430 ; 0x18a4a z_val = code_value(); 1889c: 0e 94 1d 60 call 0xc03a ; 0xc03a 188a0: 2b 01 movw r4, r22 188a2: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 188a4: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 188a8: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 188ac: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 188b0: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 188b4: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 188b8: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 188bc: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 188be: 9b 01 movw r18, r22 188c0: 21 56 subi r18, 0x61 ; 97 188c2: 30 4f sbci r19, 0xF0 ; 240 188c4: 20 3a cpi r18, 0xA0 ; 160 188c6: 3f 40 sbci r19, 0x0F ; 15 188c8: 30 f0 brcs .+12 ; 0x188d6 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 188ca: 86 e6 ldi r24, 0x66 ; 102 188cc: 95 e8 ldi r25, 0x85 ; 133 188ce: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 188d2: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 188d6: 5b e0 ldi r21, 0x0B ; 11 188d8: 15 9f mul r17, r21 188da: 90 01 movw r18, r0 188dc: 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); 188de: c9 01 movw r24, r18 188e0: 80 5b subi r24, 0xB0 ; 176 188e2: 92 4f sbci r25, 0xF2 ; 242 188e4: 0f 94 96 dc call 0x3b92c ; 0x3b92c { 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')) 188e8: 8c e4 ldi r24, 0x4C ; 76 188ea: 0e 94 56 5b call 0xb6ac ; 0xb6ac 188ee: bb e0 ldi r27, 0x0B ; 11 188f0: 1b 9f mul r17, r27 188f2: 70 01 movw r14, r0 188f4: 11 24 eor r1, r1 188f6: 57 01 movw r10, r14 188f8: e7 eb ldi r30, 0xB7 ; 183 188fa: ae 1a sub r10, r30 188fc: e2 ef ldi r30, 0xF2 ; 242 188fe: be 0a sbc r11, r30 18900: 88 23 and r24, r24 18902: 09 f4 brne .+2 ; 0x18906 18904: be c0 rjmp .+380 ; 0x18a82 { char *src = strchr_pointer + 1; 18906: e0 91 95 03 lds r30, 0x0395 ; 0x800395 1890a: f0 91 96 03 lds r31, 0x0396 ; 0x800396 1890e: 31 96 adiw r30, 0x01 ; 1 18910: bf 01 movw r22, r30 while (*src == ' ') ++src; 18912: 81 91 ld r24, Z+ 18914: 80 32 cpi r24, 0x20 ; 32 18916: e1 f3 breq .-8 ; 0x18910 if (*src != '\0') 18918: 88 23 and r24, r24 1891a: 31 f0 breq .+12 ; 0x18928 { strncpy(strLabel,src,7); 1891c: 47 e0 ldi r20, 0x07 ; 7 1891e: 50 e0 ldi r21, 0x00 ; 0 18920: ce 01 movw r24, r28 18922: 01 96 adiw r24, 0x01 ; 1 18924: 0f 94 d4 e2 call 0x3c5a8 ; 0x3c5a8 #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); 18928: 47 e0 ldi r20, 0x07 ; 7 1892a: 50 e0 ldi r21, 0x00 ; 0 1892c: b5 01 movw r22, r10 1892e: ce 01 movw r24, r28 18930: 01 96 adiw r24, 0x01 ; 1 18932: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 18936: 82 e4 ldi r24, 0x42 ; 66 18938: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1893c: 57 01 movw r10, r14 1893e: fe ea ldi r31, 0xAE ; 174 18940: af 1a sub r10, r31 18942: f2 ef ldi r31, 0xF2 ; 242 18944: bf 0a sbc r11, r31 18946: 88 23 and r24, r24 18948: 09 f4 brne .+2 ; 0x1894c 1894a: a3 c0 rjmp .+326 ; 0x18a92 { iBedC = code_value_uint8(); 1894c: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 18950: 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); 18952: 68 2f mov r22, r24 18954: c5 01 movw r24, r10 18956: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 1895a: 80 e5 ldi r24, 0x50 ; 80 1895c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18960: 2d ea ldi r18, 0xAD ; 173 18962: e2 1a sub r14, r18 18964: 22 ef ldi r18, 0xF2 ; 242 18966: f2 0a sbc r15, r18 18968: 88 23 and r24, r24 1896a: 09 f4 brne .+2 ; 0x1896e 1896c: 97 c0 rjmp .+302 ; 0x18a9c { iPindaC = code_value_uint8(); 1896e: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 18972: b8 2e mov r11, r24 18974: 68 2f mov r22, r24 18976: c7 01 movw r24, r14 18978: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 1897c: 81 e4 ldi r24, 0x41 ; 65 1897e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18982: 88 23 and r24, r24 18984: 09 f4 brne .+2 ; 0x18988 18986: 8f c0 rjmp .+286 ; 0x18aa6 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18988: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 1898c: 81 11 cpse r24, r1 1898e: 06 c0 rjmp .+12 ; 0x1899c 18990: 81 ea ldi r24, 0xA1 ; 161 18992: 9d e0 ldi r25, 0x0D ; 13 18994: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 18998: 18 13 cpse r17, r24 1899a: 8d c0 rjmp .+282 ; 0x18ab6 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 1899c: 81 2f mov r24, r17 1899e: 0e 94 c1 75 call 0xeb82 ; 0xeb82 189a2: 08 2f mov r16, r24 189a4: 88 23 and r24, r24 189a6: 29 f0 breq .+10 ; 0x189b2 189a8: 61 2f mov r22, r17 189aa: 81 ea ldi r24, 0xA1 ; 161 189ac: 9d e0 ldi r25, 0x0D ; 13 189ae: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 189b2: 8f e5 ldi r24, 0x5F ; 95 189b4: 95 e8 ldi r25, 0x85 ; 133 189b6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 189ba: 61 2f mov r22, r17 189bc: 70 e0 ldi r23, 0x00 ; 0 189be: 90 e0 ldi r25, 0x00 ; 0 189c0: 80 e0 ldi r24, 0x00 ; 0 189c2: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 189c6: 81 2f mov r24, r17 189c8: 0e 94 c1 75 call 0xeb82 ; 0xeb82 189cc: 81 11 cpse r24, r1 189ce: 04 c0 rjmp .+8 ; 0x189d8 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 189d0: 8e e4 ldi r24, 0x4E ; 78 189d2: 95 e8 ldi r25, 0x85 ; 133 189d4: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 SERIAL_PROTOCOLPGM(" Z"); 189d8: 8b e4 ldi r24, 0x4B ; 75 189da: 95 e8 ldi r25, 0x85 ; 133 189dc: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 189e0: 44 e0 ldi r20, 0x04 ; 4 189e2: c3 01 movw r24, r6 189e4: b2 01 movw r22, r4 189e6: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 189ea: 88 e4 ldi r24, 0x48 ; 72 189ec: 95 e8 ldi r25, 0x85 ; 133 189ee: 0e 94 d0 76 call 0xeda0 ; 0xeda0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 189f2: b6 01 movw r22, r12 189f4: dd 0c add r13, r13 189f6: 88 0b sbc r24, r24 189f8: 99 0b sbc r25, r25 189fa: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 189fe: 85 e4 ldi r24, 0x45 ; 69 18a00: 95 e8 ldi r25, 0x85 ; 133 18a02: 0e 94 d0 76 call 0xeda0 ; 0xeda0 18a06: ce 01 movw r24, r28 18a08: 01 96 adiw r24, 0x01 ; 1 18a0a: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 18a0e: 82 e4 ldi r24, 0x42 ; 66 18a10: 95 e8 ldi r25, 0x85 ; 133 18a12: 0e 94 d0 76 call 0xeda0 ; 0xeda0 18a16: 69 2d mov r22, r9 18a18: 70 e0 ldi r23, 0x00 ; 0 18a1a: 90 e0 ldi r25, 0x00 ; 0 18a1c: 80 e0 ldi r24, 0x00 ; 0 18a1e: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18a22: 8f e3 ldi r24, 0x3F ; 63 18a24: 95 e8 ldi r25, 0x85 ; 133 18a26: 0e 94 d0 76 call 0xeda0 ; 0xeda0 18a2a: 6b 2d mov r22, r11 18a2c: 70 e0 ldi r23, 0x00 ; 0 18a2e: 90 e0 ldi r25, 0x00 ; 0 18a30: 80 e0 ldi r24, 0x00 ; 0 18a32: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 18a36: 8c e3 ldi r24, 0x3C ; 60 18a38: 95 e8 ldi r25, 0x85 ; 133 18a3a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLLN((int)bIsActive); 18a3e: 80 2f mov r24, r16 18a40: 90 e0 ldi r25, 0x00 ; 0 18a42: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 18a46: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } 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))); 18a4a: ab e0 ldi r26, 0x0B ; 11 18a4c: 1a 9f mul r17, r26 18a4e: c0 01 movw r24, r0 18a50: 11 24 eor r1, r1 18a52: 80 5b subi r24, 0xB0 ; 176 18a54: 92 4f sbci r25, 0xF2 ; 242 18a56: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 18a5a: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 18a5c: bc 01 movw r22, r24 18a5e: 99 0f add r25, r25 18a60: 88 0b sbc r24, r24 18a62: 99 0b sbc r25, r25 18a64: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 18a68: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 18a6c: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 18a70: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 18a74: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 18a78: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 18a7c: 2b 01 movw r4, r22 18a7e: 3c 01 movw r6, r24 18a80: 33 cf rjmp .-410 ; 0x188e8 } 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)); 18a82: 47 e0 ldi r20, 0x07 ; 7 18a84: 50 e0 ldi r21, 0x00 ; 0 18a86: b5 01 movw r22, r10 18a88: ce 01 movw r24, r28 18a8a: 01 96 adiw r24, 0x01 ; 1 18a8c: 0f 94 44 dc call 0x3b888 ; 0x3b888 18a90: 52 cf rjmp .-348 ; 0x18936 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); 18a92: c5 01 movw r24, r10 18a94: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 18a98: 98 2e mov r9, r24 18a9a: 5f cf rjmp .-322 ; 0x1895a 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); 18a9c: c7 01 movw r24, r14 18a9e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 18aa2: b8 2e mov r11, r24 18aa4: 6b cf rjmp .-298 ; 0x1897c bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18aa6: 81 ea ldi r24, 0xA1 ; 161 18aa8: 9d e0 ldi r25, 0x0D ; 13 18aaa: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 18aae: 01 e0 ldi r16, 0x01 ; 1 18ab0: 18 17 cp r17, r24 18ab2: 09 f4 brne .+2 ; 0x18ab6 18ab4: 7e cf rjmp .-260 ; 0x189b2 { 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; 18ab6: 00 e0 ldi r16, 0x00 ; 0 18ab8: 7c cf rjmp .-264 ; 0x189b2 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)) ) { 18aba: c3 01 movw r24, r6 18abc: b2 01 movw r22, r4 18abe: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 18ac2: 20 91 99 03 lds r18, 0x0399 ; 0x800399 18ac6: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 18aca: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 18ace: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 18ad2: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 18ad6: 87 fd sbrc r24, 7 18ad8: 02 c0 rjmp .+4 ; 0x18ade 18ada: 0c 94 55 b0 jmp 0x160aa ; 0x160aa if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 18ade: 0f 94 51 2a call 0x254a2 ; 0x254a2 18ae2: 68 19 sub r22, r8 18ae4: 79 09 sbc r23, r9 18ae6: 8a 09 sbc r24, r10 18ae8: 9b 09 sbc r25, r11 18aea: 69 3e cpi r22, 0xE9 ; 233 18aec: 73 40 sbci r23, 0x03 ; 3 18aee: 81 05 cpc r24, r1 18af0: 91 05 cpc r25, r1 18af2: c8 f0 brcs .+50 ; 0x18b26 { SERIAL_PROTOCOLPGM("P:"); 18af4: 86 e1 ldi r24, 0x16 ; 22 18af6: 95 e8 ldi r25, 0x85 ; 133 18af8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18afc: 60 91 99 03 lds r22, 0x0399 ; 0x800399 18b00: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 18b04: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 18b08: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 18b0c: 41 e0 ldi r20, 0x01 ; 1 18b0e: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18b12: 8f e2 ldi r24, 0x2F ; 47 18b14: 0e 94 b7 76 call 0xed6e ; 0xed6e SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 18b18: c8 01 movw r24, r16 18b1a: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 codenum = _millis(); 18b1e: 0f 94 51 2a call 0x254a2 ; 0x254a2 18b22: 4b 01 movw r8, r22 18b24: 5c 01 movw r10, r24 } manage_heater(); 18b26: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(); 18b2a: 80 e0 ldi r24, 0x00 ; 0 18b2c: 0e 94 37 8a call 0x1146e ; 0x1146e lcd_update(0); 18b30: 80 e0 ldi r24, 0x00 ; 0 18b32: 0e 94 27 6e call 0xdc4e ; 0xdc4e 18b36: 0c 94 3c b0 jmp 0x16078 ; 0x16078 - `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 18b3a: 8f e3 ldi r24, 0x3F ; 63 18b3c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18b40: 88 23 and r24, r24 18b42: c9 f0 breq .+50 ; 0x18b76 SERIAL_PROTOCOLPGM("PINDA cal status: "); 18b44: 83 e0 ldi r24, 0x03 ; 3 18b46: 95 e8 ldi r25, 0x85 ; 133 18b48: 0e 94 d0 76 call 0xeda0 ; 0xeda0 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); } 18b4c: 86 ea ldi r24, 0xA6 ; 166 18b4e: 9f e0 ldi r25, 0x0F ; 15 18b50: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 18b54: 21 e0 ldi r18, 0x01 ; 1 18b56: 30 e0 ldi r19, 0x00 ; 0 18b58: 81 11 cpse r24, r1 18b5a: 02 c0 rjmp .+4 ; 0x18b60 18b5c: 30 e0 ldi r19, 0x00 ; 0 18b5e: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 18b60: c9 01 movw r24, r18 18b62: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 SERIAL_PROTOCOLLNRPGM(_header); 18b66: 8c ee ldi r24, 0xEC ; 236 18b68: 94 e8 ldi r25, 0x84 ; 132 18b6a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 gcode_M861_print_pinda_cal_eeprom(); 18b6e: 0e 94 08 77 call 0xee10 ; 0xee10 18b72: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else if (code_seen('!')) { // ! - Set factory default values 18b76: 81 e2 ldi r24, 0x21 ; 33 18b78: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18b7c: 88 23 and r24, r24 18b7e: 49 f1 breq .+82 ; 0x18bd2 18b80: 61 e0 ldi r22, 0x01 ; 1 18b82: 86 ea ldi r24, 0xA6 ; 166 18b84: 9f e0 ldi r25, 0x0F ; 15 18b86: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 18b8a: 68 e0 ldi r22, 0x08 ; 8 18b8c: 70 e0 ldi r23, 0x00 ; 0 18b8e: 80 eb ldi r24, 0xB0 ; 176 18b90: 9f e0 ldi r25, 0x0F ; 15 18b92: 0f 94 96 dc call 0x3b92c ; 0x3b92c 18b96: 68 e1 ldi r22, 0x18 ; 24 18b98: 70 e0 ldi r23, 0x00 ; 0 18b9a: 82 eb ldi r24, 0xB2 ; 178 18b9c: 9f e0 ldi r25, 0x0F ; 15 18b9e: 0f 94 96 dc call 0x3b92c ; 0x3b92c 18ba2: 60 e3 ldi r22, 0x30 ; 48 18ba4: 70 e0 ldi r23, 0x00 ; 0 18ba6: 84 eb ldi r24, 0xB4 ; 180 18ba8: 9f e0 ldi r25, 0x0F ; 15 18baa: 0f 94 96 dc call 0x3b92c ; 0x3b92c 18bae: 60 e5 ldi r22, 0x50 ; 80 18bb0: 70 e0 ldi r23, 0x00 ; 0 18bb2: 86 eb ldi r24, 0xB6 ; 182 18bb4: 9f e0 ldi r25, 0x0F ; 15 18bb6: 0f 94 96 dc call 0x3b92c ; 0x3b92c 18bba: 68 e7 ldi r22, 0x78 ; 120 18bbc: 70 e0 ldi r23, 0x00 ; 0 18bbe: 88 eb ldi r24, 0xB8 ; 184 18bc0: 9f e0 ldi r25, 0x0F ; 15 18bc2: 0f 94 96 dc call 0x3b92c ; 0x3b92c 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"); 18bc6: 8b ed ldi r24, 0xDB ; 219 18bc8: 94 e8 ldi r25, 0x84 ; 132 18bca: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 18bce: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 18bd2: 8a e5 ldi r24, 0x5A ; 90 18bd4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18bd8: 88 23 and r24, r24 18bda: c1 f0 breq .+48 ; 0x18c0c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 18bdc: 61 e0 ldi r22, 0x01 ; 1 18bde: 86 ea ldi r24, 0xA6 ; 166 18be0: 9f e0 ldi r25, 0x0F ; 15 18be2: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 18be6: 00 eb ldi r16, 0xB0 ; 176 18be8: 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); 18bea: 70 e0 ldi r23, 0x00 ; 0 18bec: 60 e0 ldi r22, 0x00 ; 0 18bee: c8 01 movw r24, r16 18bf0: 0f 94 96 dc call 0x3b92c ; 0x3b92c 18bf4: 0e 5f subi r16, 0xFE ; 254 18bf6: 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++) { 18bf8: 0a 3b cpi r16, 0xBA ; 186 18bfa: 4f e0 ldi r20, 0x0F ; 15 18bfc: 14 07 cpc r17, r20 18bfe: a9 f7 brne .-22 ; 0x18bea eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 18c00: 81 ed ldi r24, 0xD1 ; 209 18c02: 94 e8 ldi r25, 0x84 ; 132 18c04: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 18c08: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 18c0c: 83 e5 ldi r24, 0x53 ; 83 18c0e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18c12: 88 23 and r24, r24 18c14: 21 f1 breq .+72 ; 0x18c5e int16_t usteps = code_value_short(); 18c16: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 18c1a: 8c 01 movw r16, r24 if (code_seen('I')) { 18c1c: 89 e4 ldi r24, 0x49 ; 73 18c1e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18c22: 88 23 and r24, r24 18c24: 11 f4 brne .+4 ; 0x18c2a 18c26: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 uint8_t index = code_value_uint8(); 18c2a: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 if (index < 5) { 18c2e: 85 30 cpi r24, 0x05 ; 5 18c30: 10 f0 brcs .+4 ; 0x18c36 18c32: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 18c36: 90 e0 ldi r25, 0x00 ; 0 18c38: 88 52 subi r24, 0x28 ; 40 18c3a: 98 4f sbci r25, 0xF8 ; 248 18c3c: b8 01 movw r22, r16 18c3e: 88 0f add r24, r24 18c40: 99 1f adc r25, r25 18c42: 0f 94 96 dc call 0x3b92c ; 0x3b92c SERIAL_PROTOCOLLNRPGM(MSG_OK); 18c46: 87 e1 ldi r24, 0x17 ; 23 18c48: 9d e6 ldi r25, 0x6D ; 109 18c4a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 SERIAL_PROTOCOLLNRPGM(_header); 18c4e: 8c ee ldi r24, 0xEC ; 236 18c50: 94 e8 ldi r25, 0x84 ; 132 18c52: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 gcode_M861_print_pinda_cal_eeprom(); 18c56: 0e 94 08 77 call 0xee10 ; 0xee10 18c5a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 18c5e: 80 ec ldi r24, 0xC0 ; 192 18c60: 94 e8 ldi r25, 0x84 ; 132 18c62: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 18c66: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 */ 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); 18c6a: 0e 94 1d 60 call 0xc03a ; 0xc03a 18c6e: 20 e0 ldi r18, 0x00 ; 0 18c70: 30 e0 ldi r19, 0x00 ; 0 18c72: 40 e2 ldi r20, 0x20 ; 32 18c74: 51 e4 ldi r21, 0x41 ; 65 18c76: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 18c7a: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 18c7e: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 18c80: 63 30 cpi r22, 0x03 ; 3 18c82: 09 f4 brne .+2 ; 0x18c86 18c84: a2 c0 rjmp .+324 ; 0x18dca 18c86: 98 f5 brcc .+102 ; 0x18cee 18c88: 61 30 cpi r22, 0x01 ; 1 18c8a: 09 f4 brne .+2 ; 0x18c8e 18c8c: 59 c0 rjmp .+178 ; 0x18d40 18c8e: 62 30 cpi r22, 0x02 ; 2 18c90: 11 f0 breq .+4 ; 0x18c96 18c92: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18c96: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba return pgm_read_word(&_nPrinterMmuType); 18c9a: e6 ee ldi r30, 0xE6 ; 230 18c9c: fd e7 ldi r31, 0x7D ; 125 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18c9e: 81 30 cpi r24, 0x01 ; 1 18ca0: 11 f0 breq .+4 ; 0x18ca6 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 18ca2: e8 ee ldi r30, 0xE8 ; 232 18ca4: fd e7 ldi r31, 0x7D ; 125 18ca6: 05 91 lpm r16, Z+ 18ca8: 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')) 18caa: 80 e5 ldi r24, 0x50 ; 80 18cac: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18cb0: 88 23 and r24, r24 18cb2: 09 f4 brne .+2 ; 0x18cb6 18cb4: 79 c0 rjmp .+242 ; 0x18da8 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 18cb6: 0e 94 02 5b call 0xb604 ; 0xb604 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 18cba: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 18cbe: ff 20 and r15, r15 18cc0: 11 f4 brne .+4 ; 0x18cc6 18cc2: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 return; if (nPrinterModel == actualPrinterModel) 18cc6: 60 17 cp r22, r16 18cc8: 71 07 cpc r23, r17 18cca: 11 f4 brne .+4 ; 0x18cd0 18ccc: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 18cd0: 8d eb ldi r24, 0xBD ; 189 18cd2: 97 e3 ldi r25, 0x37 ; 55 18cd4: 0e 94 2c 72 call 0xe458 ; 0xe458 18cd8: 8c 01 movw r16, r24 18cda: 8f e8 ldi r24, 0x8F ; 143 18cdc: 97 e3 ldi r25, 0x37 ; 55 18cde: 0e 94 2c 72 call 0xe458 ; 0xe458 18ce2: 4f 2d mov r20, r15 18ce4: b8 01 movw r22, r16 18ce6: 0e 94 cf f5 call 0x1eb9e ; 0x1eb9e 18cea: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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) 18cee: 64 30 cpi r22, 0x04 ; 4 18cf0: 09 f4 brne .+2 ; 0x18cf4 18cf2: be c0 rjmp .+380 ; 0x18e70 18cf4: 65 30 cpi r22, 0x05 ; 5 18cf6: 11 f0 breq .+4 ; 0x18cfc 18cf8: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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')) 18cfc: 80 e5 ldi r24, 0x50 ; 80 18cfe: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18d02: 88 23 and r24, r24 18d04: 09 f4 brne .+2 ; 0x18d08 18d06: 3a c1 rjmp .+628 ; 0x18f7c { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 18d08: 0e 94 02 5b call 0xb604 ; 0xb604 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 18d0c: 10 91 e8 04 lds r17, 0x04E8 ; 0x8004e8 18d10: 11 23 and r17, r17 18d12: 11 f4 brne .+4 ; 0x18d18 18d14: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 18d18: 62 30 cpi r22, 0x02 ; 2 18d1a: 71 05 cpc r23, r1 18d1c: 10 f4 brcc .+4 ; 0x18d22 18d1e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 18d22: 8f ed ldi r24, 0xDF ; 223 18d24: 96 e3 ldi r25, 0x36 ; 54 18d26: 0e 94 2c 72 call 0xe458 ; 0xe458 18d2a: 7c 01 movw r14, r24 18d2c: 88 eb ldi r24, 0xB8 ; 184 18d2e: 96 e3 ldi r25, 0x36 ; 54 18d30: 0e 94 2c 72 call 0xe458 ; 0xe458 18d34: 41 2f mov r20, r17 18d36: b7 01 movw r22, r14 18d38: 0e 94 cf f5 call 0x1eb9e ; 0x1eb9e 18d3c: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 18d40: 80 e5 ldi r24, 0x50 ; 80 18d42: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18d46: 88 23 and r24, r24 18d48: a9 f0 breq .+42 ; 0x18d74 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 18d4a: 0e 94 1d 60 call 0xc03a ; 0xc03a 18d4e: 20 e0 ldi r18, 0x00 ; 0 18d50: 30 e0 ldi r19, 0x00 ; 0 18d52: 4a e7 ldi r20, 0x7A ; 122 18d54: 54 e4 ldi r21, 0x44 ; 68 18d56: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 18d5a: 20 e0 ldi r18, 0x00 ; 0 18d5c: 30 e0 ldi r19, 0x00 ; 0 18d5e: 40 e0 ldi r20, 0x00 ; 0 18d60: 5f e3 ldi r21, 0x3F ; 63 18d62: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 18d66: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> nozzle_diameter_check(nDiameter); 18d6a: cb 01 movw r24, r22 18d6c: 0e 94 0e f6 call 0x1ec1c ; 0x1ec1c 18d70: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } else if(code_seen('Q')) 18d74: 81 e5 ldi r24, 0x51 ; 81 18d76: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18d7a: 88 23 and r24, r24 18d7c: 11 f4 brne .+4 ; 0x18d82 18d7e: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 18d82: 85 ea ldi r24, 0xA5 ; 165 18d84: 9d e0 ldi r25, 0x0D ; 13 18d86: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 18d8a: bc 01 movw r22, r24 18d8c: 90 e0 ldi r25, 0x00 ; 0 18d8e: 80 e0 ldi r24, 0x00 ; 0 18d90: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 18d94: 20 e0 ldi r18, 0x00 ; 0 18d96: 30 e0 ldi r19, 0x00 ; 0 18d98: 4a e7 ldi r20, 0x7A ; 122 18d9a: 54 e4 ldi r21, 0x44 ; 68 18d9c: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 18da0: 0f 94 ef 75 call 0x2ebde ; 0x2ebde 18da4: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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')) 18da8: 81 e5 ldi r24, 0x51 ; 81 18daa: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18dae: 88 23 and r24, r24 18db0: 11 f4 brne .+4 ; 0x18db6 18db2: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 18db6: b8 01 movw r22, r16 18db8: 90 e0 ldi r25, 0x00 ; 0 18dba: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18dbc: 4a e0 ldi r20, 0x0A ; 10 18dbe: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 18dc2: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a 18dc6: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 18dca: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba return _sPrinterMmuName; 18dce: 6e ed ldi r22, 0xDE ; 222 18dd0: e6 2e mov r14, r22 18dd2: 6d e7 ldi r22, 0x7D ; 125 18dd4: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 18dd6: 81 30 cpi r24, 0x01 ; 1 18dd8: 21 f0 breq .+8 ; 0x18de2 return _sPrinterMmuName; } else { return _sPrinterName; 18dda: 5a ed ldi r21, 0xDA ; 218 18ddc: e5 2e mov r14, r21 18dde: 5d e7 ldi r21, 0x7D ; 125 18de0: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 18de2: 80 e5 ldi r24, 0x50 ; 80 18de4: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18de8: 88 23 and r24, r24 18dea: b1 f1 breq .+108 ; 0x18e58 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18dec: 62 e2 ldi r22, 0x22 ; 34 18dee: 70 e0 ldi r23, 0x00 ; 0 18df0: 80 91 95 03 lds r24, 0x0395 ; 0x800395 18df4: 90 91 96 03 lds r25, 0x0396 ; 0x800396 18df8: 0f 94 ab e2 call 0x3c556 ; 0x3c556 18dfc: 8c 01 movw r16, r24 if (!this->ptr) { 18dfe: 89 2b or r24, r25 18e00: d1 f0 breq .+52 ; 0x18e36 // First quote not found return; } // Skip the leading quote this->ptr++; 18e02: 0f 5f subi r16, 0xFF ; 255 18e04: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 18e06: 62 e2 ldi r22, 0x22 ; 34 18e08: 70 e0 ldi r23, 0x00 ; 0 18e0a: c8 01 movw r24, r16 18e0c: 0f 94 ab e2 call 0x3c556 ; 0x3c556 if(!pStrEnd) { 18e10: 00 97 sbiw r24, 0x00 ; 0 18e12: 89 f0 breq .+34 ; 0x18e36 // Second quote not found return; } this->len = pStrEnd - this->ptr; 18e14: d8 2e mov r13, r24 18e16: d0 1a sub r13, r16 18e18: c7 01 movw r24, r14 18e1a: 0f 94 12 da call 0x3b424 ; 0x3b424 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 18e1e: d8 12 cpse r13, r24 18e20: 0a c0 rjmp .+20 ; 0x18e36 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 18e22: ac 01 movw r20, r24 18e24: 55 27 eor r21, r21 18e26: b7 01 movw r22, r14 18e28: c8 01 movw r24, r16 18e2a: 0f 94 33 da call 0x3b466 ; 0x3b466 18e2e: 89 2b or r24, r25 18e30: 11 f4 brne .+4 ; 0x18e36 18e32: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } } render_M862_warnings( 18e36: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 18e3a: 8d eb ldi r24, 0xBD ; 189 18e3c: 97 e3 ldi r25, 0x37 ; 55 18e3e: 0e 94 2c 72 call 0xe458 ; 0xe458 18e42: 8c 01 movw r16, r24 18e44: 8f e8 ldi r24, 0x8F ; 143 18e46: 97 e3 ldi r25, 0x37 ; 55 18e48: 0e 94 2c 72 call 0xe458 ; 0xe458 18e4c: 4f 2d mov r20, r15 18e4e: b8 01 movw r22, r16 18e50: 0e 94 cf f5 call 0x1eb9e ; 0x1eb9e 18e54: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 18e58: 81 e5 ldi r24, 0x51 ; 81 18e5a: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18e5e: 88 23 and r24, r24 18e60: 11 f4 brne .+4 ; 0x18e66 18e62: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 SERIAL_PROTOCOLLNRPGM(type); 18e66: c7 01 movw r24, r14 18e68: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 18e6c: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 18e70: 80 e5 ldi r24, 0x50 ; 80 18e72: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18e76: 88 23 and r24, r24 18e78: 09 f4 brne .+2 ; 0x18e7c 18e7a: 77 c0 rjmp .+238 ; 0x18f6a fw_version_check(++strchr_pointer); 18e7c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 18e80: 90 91 96 03 lds r25, 0x0396 ; 0x800396 18e84: 01 96 adiw r24, 0x01 ; 1 18e86: 90 93 96 03 sts 0x0396, r25 ; 0x800396 18e8a: 80 93 95 03 sts 0x0395, r24 ; 0x800395 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 18e8e: 20 91 e9 04 lds r18, 0x04E9 ; 0x8004e9 18e92: 22 23 and r18, r18 18e94: 11 f4 brne .+4 ; 0x18e9a 18e96: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 18e9a: be 01 movw r22, r28 18e9c: 6f 5f subi r22, 0xFF ; 255 18e9e: 7f 4f sbci r23, 0xFF ; 255 18ea0: 0e 94 4f f0 call 0x1e09e ; 0x1e09e nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 18ea4: 8a e0 ldi r24, 0x0A ; 10 18ea6: 90 e0 ldi r25, 0x00 ; 0 18ea8: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 18eac: 29 81 ldd r18, Y+1 ; 0x01 18eae: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18eb0: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18eb2: 82 17 cp r24, r18 18eb4: 93 07 cpc r25, r19 18eb6: 28 f0 brcs .+10 ; 0x18ec2 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18eb8: 11 e0 ldi r17, 0x01 ; 1 18eba: 28 17 cp r18, r24 18ebc: 39 07 cpc r19, r25 18ebe: 08 f4 brcc .+2 ; 0x18ec2 18ec0: 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; 18ec2: 12 95 swap r17 18ec4: 11 0f add r17, r17 18ec6: 11 0f add r17, r17 18ec8: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 18eca: 8c e0 ldi r24, 0x0C ; 12 18ecc: 90 e0 ldi r25, 0x00 ; 0 18ece: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 18ed2: ac 01 movw r20, r24 18ed4: 2b 81 ldd r18, Y+3 ; 0x03 18ed6: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18ed8: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18eda: 42 17 cp r20, r18 18edc: 53 07 cpc r21, r19 18ede: 28 f0 brcs .+10 ; 0x18eea return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18ee0: 81 e0 ldi r24, 0x01 ; 1 18ee2: 24 17 cp r18, r20 18ee4: 35 07 cpc r19, r21 18ee6: 08 f4 brcc .+2 ; 0x18eea 18ee8: 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; 18eea: 50 e1 ldi r21, 0x10 ; 16 18eec: 85 9f mul r24, r21 18eee: c0 01 movw r24, r0 18ef0: 11 24 eor r1, r1 18ef2: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 18ef4: 8e e0 ldi r24, 0x0E ; 14 18ef6: 90 e0 ldi r25, 0x00 ; 0 18ef8: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 18efc: ac 01 movw r20, r24 18efe: 2d 81 ldd r18, Y+5 ; 0x05 18f00: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18f02: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18f04: 42 17 cp r20, r18 18f06: 53 07 cpc r21, r19 18f08: 28 f0 brcs .+10 ; 0x18f14 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18f0a: 81 e0 ldi r24, 0x01 ; 1 18f0c: 24 17 cp r18, r20 18f0e: 35 07 cpc r19, r21 18f10: 08 f4 brcc .+2 ; 0x18f14 18f12: 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; 18f14: a4 e0 ldi r26, 0x04 ; 4 18f16: 8a 9f mul r24, r26 18f18: c0 01 movw r24, r0 18f1a: 11 24 eor r1, r1 18f1c: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 18f1e: 80 e1 ldi r24, 0x10 ; 16 18f20: 90 e0 ldi r25, 0x00 ; 0 18f22: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 18f26: ac 01 movw r20, r24 18f28: 2f 81 ldd r18, Y+7 ; 0x07 18f2a: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18f2c: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18f2e: 42 17 cp r20, r18 18f30: 53 07 cpc r21, r19 18f32: 28 f0 brcs .+10 ; 0x18f3e return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18f34: 91 e0 ldi r25, 0x01 ; 1 18f36: 24 17 cp r18, r20 18f38: 35 07 cpc r19, r21 18f3a: 08 f4 brcc .+2 ; 0x18f3e 18f3c: 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)); 18f3e: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 18f40: 16 35 cpi r17, 0x56 ; 86 18f42: 10 f4 brcc .+4 ; 0x18f48 18f44: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 18f48: f0 90 e9 04 lds r15, 0x04E9 ; 0x8004e9 18f4c: 8d e4 ldi r24, 0x4D ; 77 18f4e: 97 e3 ldi r25, 0x37 ; 55 18f50: 0e 94 2c 72 call 0xe458 ; 0xe458 18f54: 8c 01 movw r16, r24 18f56: 87 e2 ldi r24, 0x27 ; 39 18f58: 97 e3 ldi r25, 0x37 ; 55 18f5a: 0e 94 2c 72 call 0xe458 ; 0xe458 18f5e: 4f 2d mov r20, r15 18f60: b8 01 movw r22, r16 18f62: 0e 94 cf f5 call 0x1eb9e ; 0x1eb9e 18f66: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 else if(code_seen('Q')) 18f6a: 81 e5 ldi r24, 0x51 ; 81 18f6c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18f70: 88 23 and r24, r24 18f72: 11 f4 brne .+4 ; 0x18f78 18f74: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 18f78: 0c 94 24 a7 jmp 0x14e48 ; 0x14e48 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 18f7c: 81 e5 ldi r24, 0x51 ; 81 18f7e: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18f82: 88 23 and r24, r24 18f84: 11 f4 brne .+4 ; 0x18f8a 18f86: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 SERIAL_PROTOCOLLN(GCODE_LEVEL); 18f8a: 81 e0 ldi r24, 0x01 ; 1 18f8c: 90 e0 ldi r25, 0x00 ; 0 18f8e: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 18f92: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 * 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; 18f96: 8b e4 ldi r24, 0x4B ; 75 18f98: 0e 94 56 5b call 0xb6ac ; 0xb6ac 18f9c: c1 2c mov r12, r1 18f9e: d1 2c mov r13, r1 18fa0: e1 2c mov r14, r1 18fa2: 40 ec ldi r20, 0xC0 ; 192 18fa4: f4 2e mov r15, r20 18fa6: 88 23 and r24, r24 18fa8: 49 f1 breq .+82 ; 0x18ffc 18faa: 0e 94 1d 60 call 0xc03a ; 0xc03a 18fae: 6b 01 movw r12, r22 18fb0: 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) 18fb2: 20 e0 ldi r18, 0x00 ; 0 18fb4: 30 e0 ldi r19, 0x00 ; 0 18fb6: a9 01 movw r20, r18 18fb8: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 18fbc: 81 11 cpse r24, r1 18fbe: 1e c0 rjmp .+60 ; 0x18ffc { extruder_advance_K = 0; 18fc0: 10 92 65 05 sts 0x0565, r1 ; 0x800565 18fc4: 10 92 66 05 sts 0x0566, r1 ; 0x800566 18fc8: 10 92 67 05 sts 0x0567, r1 ; 0x800567 18fcc: 10 92 68 05 sts 0x0568, r1 ; 0x800568 18fd0: 0e 94 97 81 call 0x1032e ; 0x1032e else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 18fd4: 82 ec ldi r24, 0xC2 ; 194 18fd6: 9a ea ldi r25, 0xAA ; 170 18fd8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM("Advance K="); 18fdc: 87 eb ldi r24, 0xB7 ; 183 18fde: 9d e7 ldi r25, 0x7D ; 125 18fe0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(extruder_advance_K); 18fe4: 60 91 65 05 lds r22, 0x0565 ; 0x800565 18fe8: 70 91 66 05 lds r23, 0x0566 ; 0x800566 18fec: 80 91 67 05 lds r24, 0x0567 ; 0x800567 18ff0: 90 91 68 05 lds r25, 0x0568 ; 0x800568 18ff4: 0f 94 ef 75 call 0x2ebde ; 0x2ebde 18ff8: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 18ffc: 80 91 70 03 lds r24, 0x0370 ; 0x800370 19000: 81 11 cpse r24, r1 19002: 1b c0 rjmp .+54 ; 0x1903a { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 19004: 20 e0 ldi r18, 0x00 ; 0 19006: 30 e0 ldi r19, 0x00 ; 0 19008: a9 01 movw r20, r18 1900a: c7 01 movw r24, r14 1900c: b6 01 movw r22, r12 1900e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 19012: 87 ff sbrs r24, 7 19014: 05 c0 rjmp .+10 ; 0x19020 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 19016: 82 ec ldi r24, 0xC2 ; 194 19018: 9d e7 ldi r25, 0x7D ; 125 1901a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 1901e: da cf rjmp .-76 ; 0x18fd4 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 19020: 20 e0 ldi r18, 0x00 ; 0 19022: 30 e0 ldi r19, 0x00 ; 0 19024: 40 e2 ldi r20, 0x20 ; 32 19026: 51 e4 ldi r21, 0x41 ; 65 19028: c7 01 movw r24, r14 1902a: b6 01 movw r22, r12 1902c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 19030: 87 ff sbrs r24, 7 19032: 2c c0 rjmp .+88 ; 0x1908c 19034: 81 e0 ldi r24, 0x01 ; 1 19036: 0e 94 97 81 call 0x1032e ; 0x1032e } if(la10c_mode == LA10C_LA15) 1903a: 80 91 70 03 lds r24, 0x0370 ; 0x800370 return (k >= 0 && k < LA_K_MAX? k: -1); 1903e: 20 e0 ldi r18, 0x00 ; 0 19040: 30 e0 ldi r19, 0x00 ; 0 19042: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 19044: 81 30 cpi r24, 0x01 ; 1 19046: 21 f5 brne .+72 ; 0x19090 return (k >= 0 && k < LA_K_MAX? k: -1); 19048: c7 01 movw r24, r14 1904a: b6 01 movw r22, r12 1904c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 19050: 87 fd sbrc r24, 7 19052: e1 cf rjmp .-62 ; 0x19016 19054: 20 e0 ldi r18, 0x00 ; 0 19056: 30 e0 ldi r19, 0x00 ; 0 19058: 40 e2 ldi r20, 0x20 ; 32 1905a: 51 e4 ldi r21, 0x41 ; 65 1905c: c7 01 movw r24, r14 1905e: b6 01 movw r22, r12 19060: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 19064: 87 ff sbrs r24, 7 19066: d7 cf rjmp .-82 ; 0x19016 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 19068: 20 e0 ldi r18, 0x00 ; 0 1906a: 30 e0 ldi r19, 0x00 ; 0 1906c: a9 01 movw r20, r18 1906e: c7 01 movw r24, r14 19070: b6 01 movw r22, r12 19072: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 19076: 87 fd sbrc r24, 7 19078: ce cf rjmp .-100 ; 0x19016 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 1907a: c0 92 65 05 sts 0x0565, r12 ; 0x800565 1907e: d0 92 66 05 sts 0x0566, r13 ; 0x800566 19082: e0 92 67 05 sts 0x0567, r14 ; 0x800567 19086: f0 92 68 05 sts 0x0568, r15 ; 0x800568 1908a: a4 cf rjmp .-184 ; 0x18fd4 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 1908c: 82 e0 ldi r24, 0x02 ; 2 1908e: d3 cf rjmp .-90 ; 0x19036 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 19090: c7 01 movw r24, r14 19092: b6 01 movw r22, r12 19094: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 19098: 87 fd sbrc r24, 7 1909a: bd cf rjmp .-134 ; 0x19016 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 1909c: 2f e6 ldi r18, 0x6F ; 111 1909e: 32 e1 ldi r19, 0x12 ; 18 190a0: 43 e0 ldi r20, 0x03 ; 3 190a2: 5b e3 ldi r21, 0x3B ; 59 190a4: c7 01 movw r24, r14 190a6: b6 01 movw r22, r12 190a8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 190ac: 2a e0 ldi r18, 0x0A ; 10 190ae: 37 ed ldi r19, 0xD7 ; 215 190b0: 43 e2 ldi r20, 0x23 ; 35 190b2: 5c e3 ldi r21, 0x3C ; 60 190b4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 190b8: 6b 01 movw r12, r22 190ba: 7c 01 movw r14, r24 return new_K < 0? 0: 190bc: 20 e0 ldi r18, 0x00 ; 0 190be: 30 e0 ldi r19, 0x00 ; 0 190c0: a9 01 movw r20, r18 190c2: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 190c6: 87 fd sbrc r24, 7 190c8: 11 c0 rjmp .+34 ; 0x190ec new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 190ca: 20 e0 ldi r18, 0x00 ; 0 190cc: 30 e0 ldi r19, 0x00 ; 0 190ce: 40 e2 ldi r20, 0x20 ; 32 190d0: 51 e4 ldi r21, 0x41 ; 65 190d2: c7 01 movw r24, r14 190d4: b6 01 movw r22, r12 190d6: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 190da: 18 16 cp r1, r24 190dc: 2c f6 brge .-118 ; 0x19068 190de: c1 2c mov r12, r1 190e0: d1 2c mov r13, r1 190e2: 30 e2 ldi r19, 0x20 ; 32 190e4: e3 2e mov r14, r19 190e6: 31 e4 ldi r19, 0x41 ; 65 190e8: f3 2e mov r15, r19 190ea: c7 cf rjmp .-114 ; 0x1907a // 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: 190ec: c1 2c mov r12, r1 190ee: d1 2c mov r13, r1 190f0: 76 01 movw r14, r12 190f2: c3 cf rjmp .-122 ; 0x1907a 190f4: 9d ed ldi r25, 0xDD ; 221 190f6: 89 2e mov r8, r25 190f8: 92 e0 ldi r25, 0x02 ; 2 190fa: 99 2e mov r9, r25 190fc: 0d e5 ldi r16, 0x5D ; 93 190fe: 12 e0 ldi r17, 0x02 ; 2 19100: 25 ef ldi r18, 0xF5 ; 245 19102: a2 2e mov r10, r18 19104: 24 e0 ldi r18, 0x04 ; 4 19106: 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++){ 19108: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 1910a: f4 01 movw r30, r8 1910c: 81 91 ld r24, Z+ 1910e: 4f 01 movw r8, r30 19110: 0e 94 56 5b call 0xb6ac ; 0xb6ac 19114: 88 23 and r24, r24 19116: 09 f4 brne .+2 ; 0x1911a 19118: 45 c0 rjmp .+138 ; 0x191a4 if( i == E_AXIS && FarmOrUserECool() ){ 1911a: f3 e0 ldi r31, 0x03 ; 3 1911c: 7f 12 cpse r7, r31 1911e: 04 c0 rjmp .+8 ; 0x19128 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(); 19120: 0e 94 af f0 call 0x1e15e ; 0x1e15e 19124: 81 11 cpse r24, r1 19126: 61 c0 rjmp .+194 ; 0x191ea SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 19128: 0e 94 1d 60 call 0xc03a ; 0xc03a 1912c: 6b 01 movw r12, r22 1912e: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 19130: 20 e0 ldi r18, 0x00 ; 0 19132: 30 e0 ldi r19, 0x00 ; 0 19134: a9 01 movw r20, r18 19136: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1913a: 87 fd sbrc r24, 7 1913c: 46 c0 rjmp .+140 ; 0x191ca if (cur > 1029) cur = 1029; //limit max 1913e: 20 e0 ldi r18, 0x00 ; 0 19140: 30 ea ldi r19, 0xA0 ; 160 19142: 40 e8 ldi r20, 0x80 ; 128 19144: 54 e4 ldi r21, 0x44 ; 68 19146: c7 01 movw r24, r14 19148: b6 01 movw r22, r12 1914a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1914e: 18 16 cp r1, r24 19150: a4 f1 brlt .+104 ; 0x191ba //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; 19152: 20 e0 ldi r18, 0x00 ; 0 19154: 30 e0 ldi r19, 0x00 ; 0 19156: 47 e0 ldi r20, 0x07 ; 7 19158: 54 e4 ldi r21, 0x44 ; 68 1915a: c7 01 movw r24, r14 1915c: b6 01 movw r22, r12 1915e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 19162: 87 fd sbrc r24, 7 19164: 35 c0 rjmp .+106 ; 0x191d0 19166: 20 e0 ldi r18, 0x00 ; 0 19168: 30 e0 ldi r19, 0x00 ; 0 1916a: 4c e7 ldi r20, 0x7C ; 124 1916c: 52 e4 ldi r21, 0x42 ; 66 1916e: c7 01 movw r24, r14 19170: b6 01 movw r22, r12 19172: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 19176: 20 e0 ldi r18, 0x00 ; 0 19178: 30 ea ldi r19, 0xA0 ; 160 1917a: 40 e8 ldi r20, 0x80 ; 128 1917c: 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); 1917e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 19182: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 19186: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 19188: c8 01 movw r24, r16 1918a: 0e 94 7e 67 call 0xcefc ; 0xcefc currents[i].setiRun(val); 1918e: 6f 2d mov r22, r15 19190: c8 01 movw r24, r16 19192: 0e 94 86 67 call 0xcf0c ; 0xcf0c tmc2130_setup_chopper(i, tmc2130_mres[i]); 19196: 50 e0 ldi r21, 0x00 ; 0 19198: 40 e0 ldi r20, 0x00 ; 0 1919a: d5 01 movw r26, r10 1919c: 6c 91 ld r22, X 1919e: 87 2d mov r24, r7 191a0: 0f 94 94 25 call 0x24b28 ; 0x24b28 */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 191a4: 73 94 inc r7 191a6: 0d 5f subi r16, 0xFD ; 253 191a8: 1f 4f sbci r17, 0xFF ; 255 191aa: bf ef ldi r27, 0xFF ; 255 191ac: ab 1a sub r10, r27 191ae: bb 0a sbc r11, r27 191b0: e4 e0 ldi r30, 0x04 ; 4 191b2: 7e 12 cpse r7, r30 191b4: aa cf rjmp .-172 ; 0x1910a 191b6: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 191ba: c1 2c mov r12, r1 191bc: 80 ea ldi r24, 0xA0 ; 160 191be: d8 2e mov r13, r24 191c0: 80 e8 ldi r24, 0x80 ; 128 191c2: e8 2e mov r14, r24 191c4: 84 e4 ldi r24, 0x44 ; 68 191c6: f8 2e mov r15, r24 191c8: ce cf rjmp .-100 ; 0x19166 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 191ca: c1 2c mov r12, r1 191cc: d1 2c mov r13, r1 191ce: 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); 191d0: 20 e0 ldi r18, 0x00 ; 0 191d2: 30 e0 ldi r19, 0x00 ; 0 191d4: 4c e7 ldi r20, 0x7C ; 124 191d6: 52 e4 ldi r21, 0x42 ; 66 191d8: c7 01 movw r24, r14 191da: b6 01 movw r22, r12 191dc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 191e0: 20 e0 ldi r18, 0x00 ; 0 191e2: 34 eb ldi r19, 0xB4 ; 180 191e4: 40 e9 ldi r20, 0x90 ; 144 191e6: 54 e4 ldi r21, 0x44 ; 68 191e8: ca cf rjmp .-108 ; 0x1917e if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 191ea: 83 e8 ldi r24, 0x83 ; 131 191ec: 9e e9 ldi r25, 0x9E ; 158 191ee: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM(", M907 E ignored"); 191f2: 8f ea ldi r24, 0xAF ; 175 191f4: 94 e8 ldi r25, 0x84 ; 132 191f6: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 191fa: d4 cf rjmp .-88 ; 0x191a4 191fc: 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; } 19200: 80 91 66 02 lds r24, 0x0266 ; 0x800266 19204: 81 11 cpse r24, r1 19206: 01 c0 rjmp .+2 ; 0x1920a 19208: 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"), 1920a: 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() 1920c: 86 e6 ldi r24, 0x66 ; 102 1920e: 92 e0 ldi r25, 0x02 ; 2 19210: 0f 94 1b 28 call 0x25036 ; 0x25036 19214: 88 2e mov r8, r24 19216: c0 90 64 02 lds r12, 0x0264 ; 0x800264 1921a: 80 91 63 02 lds r24, 0x0263 ; 0x800263 1921e: 81 11 cpse r24, r1 19220: 01 c0 rjmp .+2 ; 0x19224 19222: 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"), 19224: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 19226: 83 e6 ldi r24, 0x63 ; 99 19228: 92 e0 ldi r25, 0x02 ; 2 1922a: 0f 94 1b 28 call 0x25036 ; 0x25036 1922e: 98 2e mov r9, r24 19230: 00 91 61 02 lds r16, 0x0261 ; 0x800261 19234: 80 91 60 02 lds r24, 0x0260 ; 0x800260 19238: 81 11 cpse r24, r1 1923a: 01 c0 rjmp .+2 ; 0x1923e 1923c: 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"), 1923e: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 19240: 80 e6 ldi r24, 0x60 ; 96 19242: 92 e0 ldi r25, 0x02 ; 2 19244: 0f 94 1b 28 call 0x25036 ; 0x25036 19248: e8 2e mov r14, r24 1924a: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 1924e: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 19252: 81 11 cpse r24, r1 19254: 01 c0 rjmp .+2 ; 0x19258 19256: 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(), 19258: 8d e5 ldi r24, 0x5D ; 93 1925a: 92 e0 ldi r25, 0x02 ; 2 1925c: 0f 94 1b 28 call 0x25036 ; 0x25036 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"), 19260: bf 92 push r11 19262: af 92 push r10 19264: 1f 92 push r1 19266: 8f 92 push r8 19268: df 92 push r13 1926a: cf 92 push r12 1926c: 1f 92 push r1 1926e: 9f 92 push r9 19270: 1f 93 push r17 19272: 0f 93 push r16 19274: 1f 92 push r1 19276: ef 92 push r14 19278: 1f 92 push r1 1927a: ff 92 push r15 1927c: 1f 92 push r1 1927e: 8f 93 push r24 19280: 80 ed ldi r24, 0xD0 ; 208 19282: 96 e6 ldi r25, 0x66 ; 102 19284: 9f 93 push r25 19286: 8f 93 push r24 19288: 0f 94 16 db call 0x3b62c ; 0x3b62c 1928c: 0f b6 in r0, 0x3f ; 63 1928e: f8 94 cli 19290: de bf out 0x3e, r29 ; 62 19292: 0f be out 0x3f, r0 ; 63 19294: cd bf out 0x3d, r28 ; 61 19296: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 - `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; 1929a: 11 e0 ldi r17, 0x01 ; 1 1929c: 82 39 cpi r24, 0x92 ; 146 1929e: 93 40 sbci r25, 0x03 ; 3 192a0: 09 f4 brne .+2 ; 0x192a4 192a2: 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')) 192a4: 82 e5 ldi r24, 0x52 ; 82 192a6: 0e 94 56 5b call 0xb6ac ; 0xb6ac 192aa: 88 23 and r24, r24 192ac: 81 f0 breq .+32 ; 0x192ce { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 192ae: 8f ef ldi r24, 0xFF ; 255 192b0: 9f e0 ldi r25, 0x0F ; 15 192b2: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 192b6: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 192b8: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 192bc: 81 17 cp r24, r17 192be: 11 f4 brne .+4 ; 0x192c4 192c0: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 192c4: 81 2f mov r24, r17 192c6: 0e 94 09 60 call 0xc012 ; 0xc012 192ca: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 //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')) 192ce: 80 e5 ldi r24, 0x50 ; 80 192d0: 0e 94 56 5b call 0xb6ac ; 0xb6ac 192d4: 88 23 and r24, r24 192d6: 89 f0 breq .+34 ; 0x192fa { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 192d8: 01 e0 ldi r16, 0x01 ; 1 192da: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.532> 192de: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.532+0x1> 192e2: 82 39 cpi r24, 0x92 ; 146 192e4: 93 40 sbci r25, 0x03 ; 3 192e6: 09 f4 brne .+2 ; 0x192ea 192e8: 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); 192ea: 60 2f mov r22, r16 192ec: 8f ef ldi r24, 0xFF ; 255 192ee: 9f e0 ldi r25, 0x0F ; 15 192f0: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 192f4: 00 93 a4 03 sts 0x03A4, r16 ; 0x8003a4 192f8: df cf rjmp .-66 ; 0x192b8 //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')) 192fa: 81 e5 ldi r24, 0x51 ; 81 192fc: 0e 94 56 5b call 0xb6ac ; 0xb6ac 19300: 88 23 and r24, r24 19302: d1 f2 breq .-76 ; 0x192b8 { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 19304: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 19308: 81 11 cpse r24, r1 1930a: 15 c0 rjmp .+42 ; 0x19336 1930c: 8e e2 ldi r24, 0x2E ; 46 1930e: 94 e4 ldi r25, 0x44 ; 68 19310: 9f 93 push r25 19312: 8f 93 push r24 19314: 81 eb ldi r24, 0xB1 ; 177 19316: 97 e4 ldi r25, 0x47 ; 71 19318: 9f 93 push r25 1931a: 8f 93 push r24 1931c: 87 ea ldi r24, 0xA7 ; 167 1931e: 94 e8 ldi r25, 0x84 ; 132 19320: 9f 93 push r25 19322: 8f 93 push r24 19324: 0f 94 16 db call 0x3b62c ; 0x3b62c 19328: 0f 90 pop r0 1932a: 0f 90 pop r0 1932c: 0f 90 pop r0 1932e: 0f 90 pop r0 19330: 0f 90 pop r0 19332: 0f 90 pop r0 19334: c1 cf rjmp .-126 ; 0x192b8 19336: 8e e2 ldi r24, 0x2E ; 46 19338: 97 e4 ldi r25, 0x47 ; 71 1933a: ea cf rjmp .-44 ; 0x19310 1933c: 8d ed ldi r24, 0xDD ; 221 1933e: 92 e0 ldi r25, 0x02 ; 2 19340: 6c 96 adiw r28, 0x1c ; 28 19342: 9f af std Y+63, r25 ; 0x3f 19344: 8e af std Y+62, r24 ; 0x3e 19346: 6c 97 sbiw r28, 0x1c ; 28 19348: ee eb ldi r30, 0xBE ; 190 1934a: ee 2e mov r14, r30 1934c: ed e0 ldi r30, 0x0D ; 13 1934e: fe 2e mov r15, r30 19350: f3 ea ldi r31, 0xA3 ; 163 19352: cf 2e mov r12, r31 19354: f6 e0 ldi r31, 0x06 ; 6 19356: df 2e mov r13, r31 19358: a5 ef ldi r26, 0xF5 ; 245 1935a: 8a 2e mov r8, r26 1935c: a4 e0 ldi r26, 0x04 ; 4 1935e: 9a 2e mov r9, r26 19360: ba e7 ldi r27, 0x7A ; 122 19362: 2b 2e mov r2, r27 19364: be e0 ldi r27, 0x0E ; 14 19366: 3b 2e mov r3, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 19384: b8 2e mov r11, r24 19386: 88 23 and r24, r24 19388: 09 f4 brne .+2 ; 0x1938c 1938a: 7c c0 rjmp .+248 ; 0x19484 { uint16_t res_new = code_value(); 1938c: 0e 94 1d 60 call 0xc03a ; 0xc03a 19390: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 19394: 2b 01 movw r4, r22 19396: 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 19398: 68 30 cpi r22, 0x08 ; 8 1939a: 71 05 cpc r23, r1 1939c: 09 f4 brne .+2 ; 0x193a0 1939e: 60 c3 rjmp .+1728 ; 0x19a60 193a0: 60 31 cpi r22, 0x10 ; 16 193a2: 71 05 cpc r23, r1 193a4: 09 f4 brne .+2 ; 0x193a8 193a6: 5c c3 rjmp .+1720 ; 0x19a60 193a8: 81 e0 ldi r24, 0x01 ; 1 193aa: 00 32 cpi r16, 0x20 ; 32 193ac: 11 05 cpc r17, r1 193ae: 09 f0 breq .+2 ; 0x193b2 193b0: 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 193b2: 67 96 adiw r28, 0x17 ; 23 193b4: bf ad ldd r27, Y+63 ; 0x3f 193b6: 67 97 sbiw r28, 0x17 ; 23 193b8: b3 30 cpi r27, 0x03 ; 3 193ba: 09 f4 brne .+2 ; 0x193be 193bc: 5c c3 rjmp .+1720 ; 0x19a76 193be: 92 01 movw r18, r4 193c0: 21 50 subi r18, 0x01 ; 1 193c2: 31 09 sbc r19, r1 193c4: 22 30 cpi r18, 0x02 ; 2 193c6: 31 05 cpc r19, r1 193c8: 08 f0 brcs .+2 ; 0x193cc 193ca: 50 c3 rjmp .+1696 ; 0x19a6c 193cc: 9b 2d mov r25, r11 193ce: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 193d0: 67 96 adiw r28, 0x17 ; 23 193d2: ef ad ldd r30, Y+63 ; 0x3f 193d4: 67 97 sbiw r28, 0x17 ; 23 193d6: e3 30 cpi r30, 0x03 ; 3 193d8: 41 f4 brne .+16 ; 0x193ea 193da: 00 34 cpi r16, 0x40 ; 64 193dc: 11 05 cpc r17, r1 193de: 31 f0 breq .+12 ; 0x193ec 193e0: bb 24 eor r11, r11 193e2: b3 94 inc r11 193e4: 00 38 cpi r16, 0x80 ; 128 193e6: 11 05 cpc r17, r1 193e8: 09 f0 breq .+2 ; 0x193ec 193ea: b1 2c mov r11, r1 #endif if (res_valid) 193ec: 81 11 cpse r24, r1 193ee: 03 c0 rjmp .+6 ; 0x193f6 193f0: bb 20 and r11, r11 193f2: 09 f4 brne .+2 ; 0x193f6 193f4: 47 c0 rjmp .+142 ; 0x19484 { st_synchronize(); 193f6: 0f 94 ed 43 call 0x287da ; 0x287da return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 193fa: d4 01 movw r26, r8 193fc: 8c 91 ld r24, X 193fe: a1 2c mov r10, r1 19400: bb 24 eor r11, r11 19402: b3 94 inc r11 19404: 02 c0 rjmp .+4 ; 0x1940a 19406: b6 94 lsr r11 19408: a7 94 ror r10 1940a: 8a 95 dec r24 1940c: e2 f7 brpl .-8 ; 0x19406 uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 1940e: b2 01 movw r22, r4 19410: 67 96 adiw r28, 0x17 ; 23 19412: 8f ad ldd r24, Y+63 ; 0x3f 19414: 67 97 sbiw r28, 0x17 ; 23 19416: 0f 94 ff 25 call 0x24bfe ; 0x24bfe cs.axis_ustep_resolution[i] = res_new; 1941a: f1 01 movw r30, r2 1941c: 40 82 st Z, r4 if (res_new > res) 1941e: a0 16 cp r10, r16 19420: b1 06 cpc r11, r17 19422: 08 f0 brcs .+2 ; 0x19426 19424: 47 c0 rjmp .+142 ; 0x194b4 { uint16_t fac = (res_new / res); 19426: c8 01 movw r24, r16 19428: b5 01 movw r22, r10 1942a: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 1942e: 2b 01 movw r4, r22 19430: 71 2c mov r7, r1 19432: 61 2c mov r6, r1 19434: c3 01 movw r24, r6 19436: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 1943a: 9b 01 movw r18, r22 1943c: ac 01 movw r20, r24 1943e: d7 01 movw r26, r14 19440: 14 96 adiw r26, 0x04 ; 4 19442: 6d 91 ld r22, X+ 19444: 7d 91 ld r23, X+ 19446: 8d 91 ld r24, X+ 19448: 9c 91 ld r25, X 1944a: 17 97 sbiw r26, 0x07 ; 7 1944c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 19450: f7 01 movw r30, r14 19452: 64 83 std Z+4, r22 ; 0x04 19454: 75 83 std Z+5, r23 ; 0x05 19456: 86 83 std Z+6, r24 ; 0x06 19458: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 1945a: d6 01 movw r26, r12 1945c: 2d 91 ld r18, X+ 1945e: 3d 91 ld r19, X+ 19460: 4d 91 ld r20, X+ 19462: 5c 91 ld r21, X 19464: c3 01 movw r24, r6 19466: b2 01 movw r22, r4 19468: 0f 94 b7 dc call 0x3b96e ; 0x3b96e <__mulsi3> 1946c: f6 01 movw r30, r12 1946e: 60 83 st Z, r22 19470: 71 83 std Z+1, r23 ; 0x01 19472: 82 83 std Z+2, r24 ; 0x02 19474: 93 83 std Z+3, r25 ; 0x03 uint16_t fac = (res / res_new); cs.axis_steps_per_mm[i] /= fac; position[i] /= fac; } #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) if (i == E_AXIS) 19476: 67 96 adiw r28, 0x17 ; 23 19478: ff ad ldd r31, Y+63 ; 0x3f 1947a: 67 97 sbiw r28, 0x17 ; 23 1947c: f3 30 cpi r31, 0x03 ; 3 1947e: 11 f4 brne .+4 ; 0x19484 fsensor.init(); 19480: 0f 94 74 7c call 0x2f8e8 ; 0x2f8e8 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 194ae: 5f cf rjmp .-322 ; 0x1936e 194b0: 0c 94 4a b6 jmp 0x16c94 ; 0x16c94 cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 194b4: c5 01 movw r24, r10 194b6: b8 01 movw r22, r16 194b8: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 194bc: 2b 01 movw r4, r22 194be: 71 2c mov r7, r1 194c0: 61 2c mov r6, r1 194c2: c3 01 movw r24, r6 194c4: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 194c8: 9b 01 movw r18, r22 194ca: ac 01 movw r20, r24 194cc: d7 01 movw r26, r14 194ce: 14 96 adiw r26, 0x04 ; 4 194d0: 6d 91 ld r22, X+ 194d2: 7d 91 ld r23, X+ 194d4: 8d 91 ld r24, X+ 194d6: 9c 91 ld r25, X 194d8: 17 97 sbiw r26, 0x07 ; 7 194da: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 194de: f7 01 movw r30, r14 194e0: 64 83 std Z+4, r22 ; 0x04 194e2: 75 83 std Z+5, r23 ; 0x05 194e4: 86 83 std Z+6, r24 ; 0x06 194e6: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 194e8: d6 01 movw r26, r12 194ea: 6d 91 ld r22, X+ 194ec: 7d 91 ld r23, X+ 194ee: 8d 91 ld r24, X+ 194f0: 9c 91 ld r25, X 194f2: a3 01 movw r20, r6 194f4: 92 01 movw r18, r4 194f6: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a <__divmodsi4> 194fa: f6 01 movw r30, r12 194fc: 20 83 st Z, r18 194fe: 31 83 std Z+1, r19 ; 0x01 19500: 42 83 std Z+2, r20 ; 0x02 19502: 53 83 std Z+3, r21 ; 0x03 19504: b8 cf rjmp .-144 ; 0x19476 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') ) { 19506: 80 e5 ldi r24, 0x50 ; 80 19508: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1950c: 88 23 and r24, r24 1950e: 29 f0 breq .+10 ; 0x1951a mmuSlotIndex = code_value_uint8(); 19510: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 19514: 18 2f mov r17, r24 19516: 0c 94 6e af jmp 0x15edc ; 0x15edc 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') ) { 1951a: 84 e5 ldi r24, 0x54 ; 84 1951c: 0e 94 56 5b call 0xb6ac ; 0xb6ac 19520: 81 11 cpse r24, r1 19522: f6 cf rjmp .-20 ; 0x19510 19524: 0c 94 6d af jmp 0x15eda ; 0x15eda */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 19528: 60 e0 ldi r22, 0x00 ; 0 1952a: 70 e0 ldi r23, 0x00 ; 0 1952c: cb 01 movw r24, r22 1952e: 0c 94 87 af jmp 0x15f0e ; 0x15f0e 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; 19532: 82 e0 ldi r24, 0x02 ; 2 19534: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 19538: 85 e7 ldi r24, 0x75 ; 117 1953a: 9b e5 ldi r25, 0x5B ; 91 1953c: 0e 94 2c 72 call 0xe458 ; 0xe458 19540: 0e 94 3b f2 call 0x1e476 ; 0x1e476 current_position[E_AXIS] += fastLoadLength; 19544: a7 01 movw r20, r14 19546: 96 01 movw r18, r12 19548: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1954c: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 19550: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 19554: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 19558: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1955c: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 19560: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 19564: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 19568: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 1956c: 60 e0 ldi r22, 0x00 ; 0 1956e: 70 e0 ldi r23, 0x00 ; 0 19570: 80 ea ldi r24, 0xA0 ; 160 19572: 91 e4 ldi r25, 0x41 ; 65 19574: 0f 94 81 c0 call 0x38102 ; 0x38102 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 19578: 01 11 cpse r16, r1 1957a: 06 c0 rjmp .+12 ; 0x19588 raise_z_above(MIN_Z_FOR_LOAD); 1957c: 60 e0 ldi r22, 0x00 ; 0 1957e: 70 e0 ldi r23, 0x00 ; 0 19580: 8c e0 ldi r24, 0x0C ; 12 19582: 92 e4 ldi r25, 0x42 ; 66 19584: 0e 94 e0 6d call 0xdbc0 ; 0xdbc0 } load_filament_final_feed(); // slow sequence 19588: 0e 94 13 64 call 0xc826 ; 0xc826 st_synchronize(); 1958c: 0f 94 ed 43 call 0x287da ; 0x287da Sound_MakeCustom(50, 500, false); 19590: 40 e0 ldi r20, 0x00 ; 0 19592: 64 ef ldi r22, 0xF4 ; 244 19594: 71 e0 ldi r23, 0x01 ; 1 19596: 82 e3 ldi r24, 0x32 ; 50 19598: 90 e0 ldi r25, 0x00 ; 0 1959a: 0f 94 81 52 call 0x2a502 ; 0x2a502 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 1959e: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 195a2: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 195a4: 0f 94 97 50 call 0x2a12e ; 0x2a12e #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 195a8: 81 e0 ldi r24, 0x01 ; 1 195aa: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_update(2); 195ae: 82 e0 ldi r24, 0x02 ; 2 195b0: 0e 94 27 6e call 0xdc4e ; 0xdc4e lcd_setstatuspgm(MSG_WELCOME); 195b4: 8f ec ldi r24, 0xCF ; 207 195b6: 9f e6 ldi r25, 0x6F ; 111 195b8: 0e 94 3b f2 call 0x1e476 ; 0x1e476 custom_message_type = CustomMsg::Status; 195bc: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 195c0: 0c 94 9c af jmp 0x15f38 ; 0x15f38 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 195c4: 85 e5 ldi r24, 0x55 ; 85 195c6: 0e 94 56 5b call 0xb6ac ; 0xb6ac - `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; 195ca: c1 2c mov r12, r1 195cc: d1 2c mov r13, r1 195ce: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 195d0: 88 23 and r24, r24 195d2: 21 f0 breq .+8 ; 0x195dc 195d4: 0e 94 1d 60 call 0xc03a ; 0xc03a 195d8: 6b 01 movw r12, r22 195da: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 195dc: 8a e5 ldi r24, 0x5A ; 90 195de: 0e 94 56 5b call 0xb6ac ; 0xb6ac 195e2: 88 23 and r24, r24 195e4: a1 f0 breq .+40 ; 0x1960e 195e6: 0e 94 1d 60 call 0xc03a ; 0xc03a 195ea: 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); 195ec: 0e 94 61 6d call 0xdac2 ; 0xdac2 195f0: 4b 01 movw r8, r22 195f2: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 195f4: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 195f8: 81 30 cpi r24, 0x01 ; 1 195fa: 99 f4 brne .+38 ; 0x19622 195fc: 0f 94 75 ad call 0x35aea ; 0x35aea else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 19600: c5 01 movw r24, r10 19602: b4 01 movw r22, r8 19604: 90 58 subi r25, 0x80 ; 128 19606: 0e 94 61 6d call 0xdac2 ; 0xdac2 1960a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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 1960e: 60 e0 ldi r22, 0x00 ; 0 19610: 70 e0 ldi r23, 0x00 ; 0 19612: 8c e0 ldi r24, 0x0C ; 12 19614: 92 e4 ldi r25, 0x42 ; 66 19616: 0e 94 e0 6d call 0xdbc0 ; 0xdbc0 - `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; 1961a: 60 e0 ldi r22, 0x00 ; 0 1961c: 70 e0 ldi r23, 0x00 ; 0 1961e: cb 01 movw r24, r22 19620: e5 cf rjmp .-54 ; 0x195ec // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 19622: c7 01 movw r24, r14 19624: b6 01 movw r22, r12 19626: 0e 94 2d f9 call 0x1f25a ; 0x1f25a 1962a: ea cf rjmp .-44 ; 0x19600 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 1962c: 81 ec ldi r24, 0xC1 ; 193 1962e: 92 e0 ldi r25, 0x02 ; 2 19630: 0e 94 cf 5f call 0xbf9e ; 0xbf9e 19634: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 19638: 82 ec ldi r24, 0xC2 ; 194 1963a: 92 e0 ldi r25, 0x02 ; 2 1963c: 0e 94 cf 5f call 0xbf9e ; 0xbf9e 19640: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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() ) { 19644: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19648: 81 30 cpi r24, 0x01 ; 1 1964a: 11 f0 breq .+4 ; 0x19650 1964c: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 if( code_seen('A') ) { 19650: 81 e4 ldi r24, 0x41 ; 65 19652: 0e 94 56 5b call 0xb6ac ; 0xb6ac 19656: 88 23 and r24, r24 19658: 11 f4 brne .+4 ; 0x1965e 1965a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 1965e: 80 91 95 03 lds r24, 0x0395 ; 0x800395 19662: 90 91 96 03 lds r25, 0x0396 ; 0x800396 19666: 40 e1 ldi r20, 0x10 ; 16 19668: 50 e0 ldi r21, 0x00 ; 0 1966a: 70 e0 ldi r23, 0x00 ; 0 1966c: 60 e0 ldi r22, 0x00 ; 0 1966e: 01 96 adiw r24, 0x01 ; 1 19670: 0f 94 df d7 call 0x3afbe ; 0x3afbe 19674: 86 2f mov r24, r22 19676: 0f 94 a0 10 call 0x22140 ; 0x22140 1967a: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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() ){ 1967e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19682: 81 30 cpi r24, 0x01 ; 1 19684: 11 f0 breq .+4 ; 0x1968a 19686: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 uint8_t addr = 0; if( code_seen('A') ) { 1968a: 81 e4 ldi r24, 0x41 ; 65 1968c: 0e 94 56 5b call 0xb6ac ; 0xb6ac Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 19690: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 19692: 88 23 and r24, r24 19694: 61 f0 breq .+24 ; 0x196ae addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 19696: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1969a: 90 91 96 03 lds r25, 0x0396 ; 0x800396 1969e: 40 e1 ldi r20, 0x10 ; 16 196a0: 50 e0 ldi r21, 0x00 ; 0 196a2: 70 e0 ldi r23, 0x00 ; 0 196a4: 60 e0 ldi r22, 0x00 ; 0 196a6: 01 96 adiw r24, 0x01 ; 1 196a8: 0f 94 df d7 call 0x3afbe ; 0x3afbe 196ac: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 196ae: 88 e5 ldi r24, 0x58 ; 88 196b0: 0e 94 56 5b call 0xb6ac ; 0xb6ac 196b4: 88 23 and r24, r24 196b6: 61 f0 breq .+24 ; 0x196d0 data = code_value_short(); 196b8: 0e 94 f5 5a call 0xb5ea ; 0xb5ea } if(addr){ 196bc: 11 23 and r17, r17 196be: 11 f4 brne .+4 ; 0x196c4 196c0: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 MMU2::mmu2.WriteRegister(addr, data); 196c4: bc 01 movw r22, r24 196c6: 81 2f mov r24, r17 196c8: 0e 94 22 e9 call 0x1d244 ; 0x1d244 196cc: 0c 94 6c b0 jmp 0x160d8 ; 0x160d8 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; 196d0: 90 e0 ldi r25, 0x00 ; 0 196d2: 80 e0 ldi r24, 0x00 ; 0 196d4: f3 cf rjmp .-26 ; 0x196bc 196d6: 60 e0 ldi r22, 0x00 ; 0 196d8: 8c ea ldi r24, 0xAC ; 172 196da: 9c e0 ldi r25, 0x0C ; 12 196dc: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 196e0: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 196e4: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 196e8: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d 196ec: 0c 94 e2 af jmp 0x15fc4 ; 0x15fc4 196f0: 61 e0 ldi r22, 0x01 ; 1 196f2: 8c ea ldi r24, 0xAC ; 172 196f4: 9c e0 ldi r25, 0x0C ; 12 196f6: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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(); 196fa: 0e 94 6e e4 call 0x1c8dc ; 0x1c8dc 196fe: 0c 94 e2 af jmp 0x15fc4 ; 0x15fc4 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19702: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 19704: 0f 94 81 10 call 0x22102 ; 0x22102 19708: 0c 94 f8 af jmp 0x15ff0 ; 0x15ff0 } void MMU2::TriggerResetPin() { reset(); 1970c: 0f 94 d2 c5 call 0x38ba4 ; 0x38ba4 19710: 0c 94 f8 af jmp 0x15ff0 ; 0x15ff0 void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 19714: 8a e2 ldi r24, 0x2A ; 42 19716: f6 cf rjmp .-20 ; 0x19704 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') { 19718: 84 35 cpi r24, 0x54 ; 84 1971a: 09 f0 breq .+2 ; 0x1971e 1971c: 79 c0 rjmp .+242 ; 0x19810 strchr_pointer = CMDBUFFER_CURRENT_STRING; 1971e: 10 93 96 03 sts 0x0396, r17 ; 0x800396 19722: 00 93 95 03 sts 0x0395, r16 ; 0x800395 processing_tcode = true; 19726: 81 e0 ldi r24, 0x01 ; 1 19728: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 TCodes(strchr_pointer, code_value_uint8()); 1972c: 0e 94 e8 5a call 0xb5d0 ; 0xb5d0 19730: 18 2f mov r17, r24 19732: 20 91 95 03 lds r18, 0x0395 ; 0x800395 19736: 30 91 96 03 lds r19, 0x0396 ; 0x800396 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 1973a: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 1973c: 79 01 movw r14, r18 1973e: e9 0e add r14, r25 19740: f1 1c adc r15, r1 19742: d7 01 movw r26, r14 19744: 8c 91 ld r24, X 19746: 80 32 cpi r24, 0x20 ; 32 19748: 11 f0 breq .+4 ; 0x1974e 1974a: 89 30 cpi r24, 0x09 ; 9 1974c: 11 f4 brne .+4 ; 0x19752 1974e: 9f 5f subi r25, 0xFF ; 255 19750: f5 cf rjmp .-22 ; 0x1973c ; strchr_pointer[index] = tolower(strchr_pointer[index]); 19752: 08 2e mov r0, r24 19754: 00 0c add r0, r0 19756: 99 0b sbc r25, r25 19758: 0f 94 68 e2 call 0x3c4d0 ; 0x3c4d0 1975c: f7 01 movw r30, r14 1975e: 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'); 19760: 90 ed ldi r25, 0xD0 ; 208 19762: 98 0f add r25, r24 19764: 95 30 cpi r25, 0x05 ; 5 19766: 58 f0 brcs .+22 ; 0x1977e 19768: 8f 33 cpi r24, 0x3F ; 63 1976a: 59 f0 breq .+22 ; 0x19782 1976c: 88 37 cpi r24, 0x78 ; 120 1976e: 49 f0 breq .+18 ; 0x19782 19770: 83 36 cpi r24, 0x63 ; 99 19772: f1 f0 breq .+60 ; 0x197b0 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 19774: 8d e8 ldi r24, 0x8D ; 141 19776: 9d e7 ldi r25, 0x7D ; 125 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19778: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 1977c: 13 c0 rjmp .+38 ; 0x197a4 strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 1977e: 8f 33 cpi r24, 0x3F ; 63 19780: a9 f4 brne .+42 ; 0x197ac // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 19782: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19786: 81 30 cpi r24, 0x01 ; 1 19788: 69 f4 brne .+26 ; 0x197a4 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 1978a: 8c e5 ldi r24, 0x5C ; 92 1978c: 9b e3 ldi r25, 0x3B ; 59 1978e: 0e 94 2c 72 call 0xe458 ; 0xe458 19792: 70 e0 ldi r23, 0x00 ; 0 19794: 60 e0 ldi r22, 0x00 ; 0 19796: 0e 94 e1 e4 call 0x1c9c2 ; 0x1c9c2 1979a: 68 2f mov r22, r24 1979c: d7 01 movw r26, r14 1979e: 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()); 197a0: 0f 94 1f 10 call 0x2203e ; 0x2203e processing_tcode = false; 197a4: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 197a8: 0c 94 c1 95 jmp 0x12b82 ; 0x12b82 } 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'){ 197ac: 83 36 cpi r24, 0x63 ; 99 197ae: 49 f4 brne .+18 ; 0x197c2 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 197b0: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 197b4: 81 30 cpi r24, 0x01 ; 1 197b6: b1 f7 brne .-20 ; 0x197a4 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 197b8: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 197bc: 68 2f mov r22, r24 197be: 83 e6 ldi r24, 0x63 ; 99 197c0: ef cf rjmp .-34 ; 0x197a0 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 197c2: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 197c6: 81 30 cpi r24, 0x01 ; 1 197c8: 69 f4 brne .+26 ; 0x197e4 if (codeValue == MMU2::mmu2.get_current_tool()){ 197ca: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 197ce: 18 13 cpse r17, r24 197d0: 05 c0 rjmp .+10 ; 0x197dc // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 197d2: 8d e9 ldi r24, 0x9D ; 157 197d4: 9d e7 ldi r25, 0x7D ; 125 197d6: 0f 94 3d db call 0x3b67a ; 0x3b67a 197da: e4 cf rjmp .-56 ; 0x197a4 #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); 197dc: 81 2f mov r24, r17 197de: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 197e2: e0 cf rjmp .-64 ; 0x197a4 } } else { SERIAL_ECHO_START; 197e4: 82 ec ldi r24, 0xC2 ; 194 197e6: 9a ea ldi r25, 0xAA ; 170 197e8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if (codeValue >= EXTRUDERS) { 197ec: 11 23 and r17, r17 197ee: 59 f0 breq .+22 ; 0x19806 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 197f0: 84 e5 ldi r24, 0x54 ; 84 197f2: 0e 94 b7 76 call 0xed6e ; 0xed6e SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 197f6: 81 2f mov r24, r17 197f8: 90 e0 ldi r25, 0x00 ; 0 197fa: c0 96 adiw r24, 0x30 ; 48 197fc: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19800: 8f eb ldi r24, 0xBF ; 191 19802: 96 e6 ldi r25, 0x66 ; 102 19804: b9 cf rjmp .-142 ; 0x19778 // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19806: 8c ea ldi r24, 0xAC ; 172 19808: 96 e6 ldi r25, 0x66 ; 102 1980a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 1980e: ca cf rjmp .-108 ; 0x197a4 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19810: 84 34 cpi r24, 0x44 ; 68 19812: 09 f0 breq .+2 ; 0x19816 19814: ee c0 rjmp .+476 ; 0x199f2 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19816: 10 93 96 03 sts 0x0396, r17 ; 0x800396 1981a: 00 93 95 03 sts 0x0395, r16 ; 0x800395 switch(code_value_short()) 1981e: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 19822: 86 30 cpi r24, 0x06 ; 6 19824: 91 05 cpc r25, r1 19826: 09 f4 brne .+2 ; 0x1982a 19828: 79 c0 rjmp .+242 ; 0x1991c 1982a: 9c f4 brge .+38 ; 0x19852 1982c: 82 30 cpi r24, 0x02 ; 2 1982e: 91 05 cpc r25, r1 19830: 09 f4 brne .+2 ; 0x19834 19832: 52 c0 rjmp .+164 ; 0x198d8 19834: 83 30 cpi r24, 0x03 ; 3 19836: 91 05 cpc r25, r1 19838: 09 f4 brne .+2 ; 0x1983c 1983a: 61 c0 rjmp .+194 ; 0x198fe 1983c: 01 96 adiw r24, 0x01 ; 1 1983e: 89 f4 brne .+34 ; 0x19862 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 19840: 88 e9 ldi r24, 0x98 ; 152 19842: 96 e6 ldi r25, 0x66 ; 102 19844: 9f 93 push r25 19846: 8f 93 push r24 19848: 0f 94 16 db call 0x3b62c ; 0x3b62c 1984c: 0f 90 pop r0 1984e: 0f 90 pop r0 19850: ff cf rjmp .-2 ; 0x19850 19852: 85 31 cpi r24, 0x15 ; 21 19854: 91 05 cpc r25, r1 19856: 09 f4 brne .+2 ; 0x1985a 19858: 8d c0 rjmp .+282 ; 0x19974 1985a: 94 f4 brge .+36 ; 0x19880 1985c: 44 97 sbiw r24, 0x14 ; 20 1985e: 09 f4 brne .+2 ; 0x19862 19860: 69 c0 rjmp .+210 ; 0x19934 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 19862: 80 91 92 12 lds r24, 0x1292 ; 0x801292 19866: 90 91 93 12 lds r25, 0x1293 ; 0x801293 1986a: 88 55 subi r24, 0x58 ; 88 1986c: 9f 4e sbci r25, 0xEF ; 239 1986e: 9f 93 push r25 19870: 8f 93 push r24 19872: 1f 92 push r1 19874: 84 e4 ldi r24, 0x44 ; 68 19876: 8f 93 push r24 19878: 86 ea ldi r24, 0xA6 ; 166 1987a: 98 e6 ldi r25, 0x68 ; 104 1987c: 0c 94 5c 97 jmp 0x12eb8 ; 0x12eb8 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 19880: 86 31 cpi r24, 0x16 ; 22 19882: 91 05 cpc r25, r1 19884: 09 f4 brne .+2 ; 0x19888 19886: 9b c0 rjmp .+310 ; 0x199be 19888: 86 34 cpi r24, 0x46 ; 70 1988a: 91 05 cpc r25, r1 1988c: 51 f7 brne .-44 ; 0x19862 #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 1988e: 83 e5 ldi r24, 0x53 ; 83 19890: 0e 94 56 5b call 0xb6ac ; 0xb6ac 19894: 88 23 and r24, r24 19896: 11 f4 brne .+4 ; 0x1989c 19898: 0c 94 c1 95 jmp 0x12b82 ; 0x12b82 thermal_model_log_enable(code_value_short()); 1989c: 0e 94 f5 5a call 0xb5ea ; 0xb5ea 198a0: 11 e0 ldi r17, 0x01 ; 1 198a2: 00 97 sbiw r24, 0x00 ; 0 198a4: 09 f4 brne .+2 ; 0x198a8 198a6: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 198a8: 89 2b or r24, r25 198aa: 91 f0 breq .+36 ; 0x198d0 TempMgrGuard temp_mgr_guard; 198ac: ce 01 movw r24, r28 198ae: 01 96 adiw r24, 0x01 ; 1 198b0: 0f 94 9f 32 call 0x2653e ; 0x2653e thermal_model::log_buf.entry.stamp = _millis(); 198b4: 0f 94 51 2a call 0x254a2 ; 0x254a2 198b8: 60 93 24 06 sts 0x0624, r22 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.539> 198bc: 70 93 25 06 sts 0x0625, r23 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x1> 198c0: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x2> 198c4: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x3> #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { TempMgrGuard temp_mgr_guard; 198c8: ce 01 movw r24, r28 198ca: 01 96 adiw r24, 0x01 ; 1 198cc: 0f 94 92 32 call 0x26524 ; 0x26524 thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 198d0: 10 93 34 06 sts 0x0634, r17 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x10> 198d4: 0c 94 c1 95 jmp 0x12b82 ; 0x12b82 - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 198d8: 43 e9 ldi r20, 0x93 ; 147 198da: c4 2e mov r12, r20 198dc: 46 e6 ldi r20, 0x66 ; 102 198de: d4 2e mov r13, r20 198e0: 52 e0 ldi r21, 0x02 ; 2 198e2: e5 2e mov r14, r21 198e4: 00 e0 ldi r16, 0x00 ; 0 198e6: 20 e0 ldi r18, 0x00 ; 0 198e8: 32 e2 ldi r19, 0x22 ; 34 198ea: 40 e0 ldi r20, 0x00 ; 0 198ec: 50 e0 ldi r21, 0x00 ; 0 198ee: 60 e0 ldi r22, 0x00 ; 0 198f0: 72 e0 ldi r23, 0x02 ; 2 198f2: 80 e0 ldi r24, 0x00 ; 0 198f4: 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")); 198f6: 0e 94 23 62 call 0xc446 ; 0xc446 198fa: 0c 94 c1 95 jmp 0x12b82 ; 0x12b82 - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 198fe: 2c e8 ldi r18, 0x8C ; 140 19900: c2 2e mov r12, r18 19902: 26 e6 ldi r18, 0x66 ; 102 19904: d2 2e mov r13, r18 19906: 33 e0 ldi r19, 0x03 ; 3 19908: e3 2e mov r14, r19 1990a: 01 e0 ldi r16, 0x01 ; 1 1990c: 20 e0 ldi r18, 0x00 ; 0 1990e: 30 e1 ldi r19, 0x10 ; 16 19910: 40 e0 ldi r20, 0x00 ; 0 19912: 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")); 19914: 60 e0 ldi r22, 0x00 ; 0 19916: 70 e0 ldi r23, 0x00 ; 0 19918: cb 01 movw r24, r22 1991a: ed cf rjmp .-38 ; 0x198f6 1991c: 85 e8 ldi r24, 0x85 ; 133 1991e: c8 2e mov r12, r24 19920: 86 e6 ldi r24, 0x66 ; 102 19922: d8 2e mov r13, r24 19924: 96 e0 ldi r25, 0x06 ; 6 19926: e9 2e mov r14, r25 19928: 03 e0 ldi r16, 0x03 ; 3 1992a: 20 e0 ldi r18, 0x00 ; 0 1992c: 30 e0 ldi r19, 0x00 ; 0 1992e: 44 e0 ldi r20, 0x04 ; 4 19930: 50 e0 ldi r21, 0x00 ; 0 19932: f0 cf rjmp .-32 ; 0x19914 #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 19934: 85 e4 ldi r24, 0x45 ; 69 19936: 0e 94 56 5b call 0xb6ac ; 0xb6ac 1993a: 88 23 and r24, r24 1993c: 29 f0 breq .+10 ; 0x19948 xfdump_full_dump_and_reset(); 1993e: 80 e0 ldi r24, 0x00 ; 0 19940: 0e 94 9a ee call 0x1dd34 ; 0x1dd34 19944: 0c 94 c1 95 jmp 0x12b82 ; 0x12b82 else { unsigned long ts = _millis(); 19948: 0f 94 51 2a call 0x254a2 ; 0x254a2 1994c: 6b 01 movw r12, r22 1994e: 7c 01 movw r14, r24 xfdump_dump(); 19950: 0e 94 c8 ee call 0x1dd90 ; 0x1dd90 ts = _millis() - ts; 19954: 0f 94 51 2a call 0x254a2 ; 0x254a2 19958: dc 01 movw r26, r24 1995a: cb 01 movw r24, r22 1995c: 8c 19 sub r24, r12 1995e: 9d 09 sbc r25, r13 19960: ae 09 sbc r26, r14 19962: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 19964: bf 93 push r27 19966: af 93 push r26 19968: 9f 93 push r25 1996a: 8f 93 push r24 1996c: 8c e6 ldi r24, 0x6C ; 108 1996e: 96 e6 ldi r25, 0x66 ; 102 19970: 0c 94 5c 97 jmp 0x12eb8 ; 0x12eb8 } } void dcode_21() { if(!xfdump_check_state()) 19974: 90 e0 ldi r25, 0x00 ; 0 19976: 80 e0 ldi r24, 0x00 ; 0 19978: 0e 94 e6 ed call 0x1dbcc ; 0x1dbcc 1997c: 81 11 cpse r24, r1 1997e: 07 c0 rjmp .+14 ; 0x1998e DBG(_N("no dump available\n")); 19980: 89 e5 ldi r24, 0x59 ; 89 19982: 96 e6 ldi r25, 0x66 ; 102 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19984: 9f 93 push r25 19986: 8f 93 push r24 19988: 0f 94 16 db call 0x3b62c ; 0x3b62c 1998c: 14 c0 rjmp .+40 ; 0x199b6 { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 1998e: 81 e0 ldi r24, 0x01 ; 1 19990: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be DBG(_N("D21 - read crash dump\n")); 19994: 82 e4 ldi r24, 0x42 ; 66 19996: 96 e6 ldi r25, 0x66 ; 102 19998: 9f 93 push r25 1999a: 8f 93 push r24 1999c: 0f 94 16 db call 0x3b62c ; 0x3b62c print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 199a0: 03 e0 ldi r16, 0x03 ; 3 199a2: 20 e0 ldi r18, 0x00 ; 0 199a4: 33 e2 ldi r19, 0x23 ; 35 199a6: 40 e0 ldi r20, 0x00 ; 0 199a8: 50 e0 ldi r21, 0x00 ; 0 199aa: 60 e0 ldi r22, 0x00 ; 0 199ac: 70 ed ldi r23, 0xD0 ; 208 199ae: 83 e0 ldi r24, 0x03 ; 3 199b0: 90 e0 ldi r25, 0x00 ; 0 199b2: 0f 94 64 87 call 0x30ec8 ; 0x30ec8 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 199b6: 0f 90 pop r0 199b8: 0f 90 pop r0 199ba: 0c 94 c1 95 jmp 0x12b82 ; 0x12b82 } } void dcode_22() { if(!xfdump_check_state()) 199be: 90 e0 ldi r25, 0x00 ; 0 199c0: 80 e0 ldi r24, 0x00 ; 0 199c2: 0e 94 e6 ed call 0x1dbcc ; 0x1dbcc 199c6: 81 11 cpse r24, r1 199c8: 03 c0 rjmp .+6 ; 0x199d0 DBG(_N("no dump available\n")); 199ca: 8f e2 ldi r24, 0x2F ; 47 199cc: 96 e6 ldi r25, 0x66 ; 102 199ce: da cf rjmp .-76 ; 0x19984 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 199d0: 8c e5 ldi r24, 0x5C ; 92 199d2: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 199d4: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 199d6: 0e 94 1e ee call 0x1dc3c ; 0x1dc3c _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 199da: 40 e0 ldi r20, 0x00 ; 0 199dc: 50 ed ldi r21, 0xD0 ; 208 199de: 63 e0 ldi r22, 0x03 ; 3 199e0: 70 e0 ldi r23, 0x00 ; 0 199e2: 80 e2 ldi r24, 0x20 ; 32 199e4: 0e 94 a0 ed call 0x1db40 ; 0x1db40 xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 199e8: 0e 94 82 ed call 0x1db04 ; 0x1db04 else { xfdump_reset(); DBG(_N("dump cleared\n")); 199ec: 81 e2 ldi r24, 0x21 ; 33 199ee: 96 e6 ldi r25, 0x66 ; 102 199f0: c9 cf rjmp .-110 ; 0x19984 } } else { SERIAL_ECHO_START; 199f2: 82 ec ldi r24, 0xC2 ; 194 199f4: 9a ea ldi r25, 0xAA ; 170 199f6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 199fa: 81 e2 ldi r24, 0x21 ; 33 199fc: 97 e6 ldi r25, 0x67 ; 103 199fe: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19a02: 80 91 92 12 lds r24, 0x1292 ; 0x801292 19a06: 90 91 93 12 lds r25, 0x1293 ; 0x801293 19a0a: 88 55 subi r24, 0x58 ; 88 19a0c: 9f 4e sbci r25, 0xEF ; 239 19a0e: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_ECHOLNPGM("\"(2)"); 19a12: 82 ea ldi r24, 0xA2 ; 162 19a14: 94 e8 ldi r25, 0x84 ; 132 19a16: 0c 94 cc 97 jmp 0x12f98 ; 0x12f98 #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 19a1a: 2d ec ldi r18, 0xCD ; 205 19a1c: 3c ec ldi r19, 0xCC ; 204 19a1e: 4c ec ldi r20, 0xCC ; 204 19a20: 5d e3 ldi r21, 0x3D ; 61 19a22: c7 01 movw r24, r14 19a24: b6 01 movw r22, r12 19a26: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 19a2a: 18 16 cp r1, r24 19a2c: 14 f4 brge .+4 ; 0x19a32 19a2e: 0c 94 09 99 jmp 0x13212 ; 0x13212 19a32: 0c 94 77 9a jmp 0x134ee ; 0x134ee 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; 19a36: a3 01 movw r20, r6 19a38: 92 01 movw r18, r4 19a3a: 62 2d mov r22, r2 19a3c: 73 2d mov r23, r3 19a3e: 8e 2d mov r24, r14 19a40: 9f 2d mov r25, r15 19a42: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 19a46: 18 16 cp r1, r24 19a48: 14 f0 brlt .+4 ; 0x19a4e 19a4a: 0c 94 58 a2 jmp 0x144b0 ; 0x144b0 19a4e: e5 e0 ldi r30, 0x05 ; 5 19a50: ce 0e add r12, r30 19a52: d1 1c adc r13, r1 19a54: f2 e0 ldi r31, 0x02 ; 2 19a56: 8f 0e add r8, r31 19a58: 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; 19a5a: 85 01 movw r16, r10 19a5c: 0c 94 1f a2 jmp 0x1443e ; 0x1443e 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 19a60: 67 96 adiw r28, 0x17 ; 23 19a62: 2f ad ldd r18, Y+63 ; 0x3f 19a64: 67 97 sbiw r28, 0x17 ; 23 19a66: 8b 2d mov r24, r11 19a68: 23 30 cpi r18, 0x03 ; 3 19a6a: 29 f0 breq .+10 ; 0x19a76 19a6c: 91 e0 ldi r25, 0x01 ; 1 19a6e: 04 30 cpi r16, 0x04 ; 4 19a70: 11 05 cpc r17, r1 19a72: 09 f4 brne .+2 ; 0x19a76 19a74: ac cc rjmp .-1704 ; 0x193ce 19a76: 90 e0 ldi r25, 0x00 ; 0 19a78: aa cc rjmp .-1708 ; 0x193ce 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)); 19a7a: 85 e5 ldi r24, 0x55 ; 85 19a7c: 99 e3 ldi r25, 0x39 ; 57 19a7e: 0e 94 2c 72 call 0xe458 ; 0xe458 19a82: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_puts_at_P(0, 2, PSTR("")); 19a86: 45 e0 ldi r20, 0x05 ; 5 19a88: 54 e8 ldi r21, 0x84 ; 132 19a8a: 62 e0 ldi r22, 0x02 ; 2 19a8c: 80 e0 ldi r24, 0x00 ; 0 19a8e: 0e 94 74 6e call 0xdce8 ; 0xdce8 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 19a92: f8 01 movw r30, r16 19a94: 81 91 ld r24, Z+ 19a96: 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'; 19a98: 98 2f mov r25, r24 19a9a: 9f 7d andi r25, 0xDF ; 223 19a9c: 11 f4 brne .+4 ; 0x19aa2 19a9e: 0c 94 b3 b6 jmp 0x16d66 ; 0x16d66 19aa2: 97 ef ldi r25, 0xF7 ; 247 19aa4: 98 0f add r25, r24 19aa6: 92 30 cpi r25, 0x02 ; 2 19aa8: 10 f4 brcc .+4 ; 0x19aae 19aaa: 0c 94 b3 b6 jmp 0x16d66 ; 0x16d66 19aae: 8d 30 cpi r24, 0x0D ; 13 19ab0: 11 f4 brne .+4 ; 0x19ab6 19ab2: 0c 94 b3 b6 jmp 0x16d66 ; 0x16d66 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); 19ab6: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 19aba: eb cf rjmp .-42 ; 0x19a92 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; 19abc: ce 01 movw r24, r28 19abe: 01 96 adiw r24, 0x01 ; 1 19ac0: 0f 94 9f 32 call 0x2653e ; 0x2653e 19ac4: 0c 94 a2 aa jmp 0x15544 ; 0x15544 00019ac8 : uint8_t check_pinda_0() { return _PINDA?0:1; } 19ac8: 22 e0 ldi r18, 0x02 ; 2 19aca: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 19ace: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> 19ad2: 90 e1 ldi r25, 0x10 ; 16 19ad4: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> 19ad8: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19adc: 80 61 ori r24, 0x10 ; 16 19ade: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19ae2: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19ae6: 88 60 ori r24, 0x08 ; 8 19ae8: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19aec: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19af0: 80 68 ori r24, 0x80 ; 128 19af2: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19af6: 80 91 39 05 lds r24, 0x0539 ; 0x800539 19afa: 81 30 cpi r24, 0x01 ; 1 19afc: a9 f4 brne .+42 ; 0x19b28 19afe: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> 19b02: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> 19b06: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> 19b0a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19b0e: 80 61 ori r24, 0x10 ; 16 19b10: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19b14: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19b18: 88 60 ori r24, 0x08 ; 8 19b1a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19b1e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19b22: 80 68 ori r24, 0x80 ; 128 19b24: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19b28: 08 95 ret 00019b2a : 19b2a: 81 50 subi r24, 0x01 ; 1 19b2c: 82 31 cpi r24, 0x12 ; 18 19b2e: 08 f0 brcs .+2 ; 0x19b32 19b30: 5a c0 rjmp .+180 ; 0x19be6 19b32: e8 2f mov r30, r24 19b34: f0 e0 ldi r31, 0x00 ; 0 19b36: 88 27 eor r24, r24 19b38: ef 55 subi r30, 0x5F ; 95 19b3a: f2 43 sbci r31, 0x32 ; 50 19b3c: 8f 4f sbci r24, 0xFF ; 255 19b3e: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 19b42: c1 cd rjmp .-1150 ; 0x196c6 19b44: c5 cd rjmp .-1142 ; 0x196d0 19b46: b3 cd rjmp .-1178 ; 0x196ae 19b48: b9 cd rjmp .-1166 ; 0x196bc 19b4a: bd cd rjmp .-1158 ; 0x196c6 19b4c: f3 cd rjmp .-1050 ; 0x19734 19b4e: c8 cd rjmp .-1136 ; 0x196e0 19b50: ce cd rjmp .-1124 ; 0x196ee 19b52: d2 cd rjmp .-1116 ; 0x196f8 19b54: d8 cd rjmp .-1104 ; 0x19706 19b56: dc cd rjmp .-1096 ; 0x19710 19b58: e0 cd rjmp .-1088 ; 0x1971a 19b5a: e6 cd rjmp .-1076 ; 0x19728 19b5c: ea cd rjmp .-1068 ; 0x19732 19b5e: f3 cd rjmp .-1050 ; 0x19746 19b60: ee cd rjmp .-1060 ; 0x1973e 19b62: f4 cd rjmp .-1048 ; 0x1974c 19b64: f8 cd rjmp .-1040 ; 0x19756 19b66: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19b6a: 8f 77 andi r24, 0x7F ; 127 19b6c: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19b70: 08 95 ret 19b72: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19b76: 8f 7d andi r24, 0xDF ; 223 19b78: f9 cf rjmp .-14 ; 0x19b6c 19b7a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19b7e: 87 7f andi r24, 0xF7 ; 247 19b80: f5 cf rjmp .-22 ; 0x19b6c 19b82: 84 b5 in r24, 0x24 ; 36 19b84: 8f 77 andi r24, 0x7F ; 127 19b86: 84 bd out 0x24, r24 ; 36 19b88: 08 95 ret 19b8a: 84 b5 in r24, 0x24 ; 36 19b8c: 8f 7d andi r24, 0xDF ; 223 19b8e: fb cf rjmp .-10 ; 0x19b86 19b90: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19b94: 8f 77 andi r24, 0x7F ; 127 19b96: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19b9a: 08 95 ret 19b9c: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19ba0: 8f 7d andi r24, 0xDF ; 223 19ba2: f9 cf rjmp .-14 ; 0x19b96 19ba4: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19ba8: 8f 77 andi r24, 0x7F ; 127 19baa: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19bae: 08 95 ret 19bb0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19bb4: 8f 7d andi r24, 0xDF ; 223 19bb6: f9 cf rjmp .-14 ; 0x19baa 19bb8: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19bbc: 87 7f andi r24, 0xF7 ; 247 19bbe: f5 cf rjmp .-22 ; 0x19baa 19bc0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19bc4: 8f 77 andi r24, 0x7F ; 127 19bc6: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19bca: 08 95 ret 19bcc: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19bd0: 8f 7d andi r24, 0xDF ; 223 19bd2: f9 cf rjmp .-14 ; 0x19bc6 19bd4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19bd8: 87 7f andi r24, 0xF7 ; 247 19bda: f5 cf rjmp .-22 ; 0x19bc6 19bdc: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19be0: 8f 77 andi r24, 0x7F ; 127 19be2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19be6: 08 95 ret 19be8: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19bec: 8f 7d andi r24, 0xDF ; 223 19bee: f9 cf rjmp .-14 ; 0x19be2 19bf0: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19bf4: 87 7f andi r24, 0xF7 ; 247 19bf6: f5 cf rjmp .-22 ; 0x19be2 00019bf8 : 19bf8: 83 b1 in r24, 0x03 ; 3 19bfa: 82 95 swap r24 19bfc: 81 70 andi r24, 0x01 ; 1 19bfe: 08 95 ret 00019c00 : } #else //SM4_ACCEL_TEST uint16_t xyzcal_calc_delay(uint16_t, uint16_t) { return xyzcal_sm4_delay; } 19c00: 80 91 fd 03 lds r24, 0x03FD ; 0x8003fd 19c04: 90 91 fe 03 lds r25, 0x03FE ; 0x8003fe 19c08: 08 95 ret 00019c0a : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19c0a: cf 92 push r12 19c0c: df 92 push r13 19c0e: ef 92 push r14 19c10: 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; 19c12: 20 91 ff 03 lds r18, 0x03FF ; 0x8003ff 19c16: b0 e0 ldi r27, 0x00 ; 0 19c18: a0 e0 ldi r26, 0x00 ; 0 19c1a: c0 90 b3 06 lds r12, 0x06B3 ; 0x8006b3 19c1e: d0 90 b4 06 lds r13, 0x06B4 ; 0x8006b4 19c22: e0 90 b5 06 lds r14, 0x06B5 ; 0x8006b5 19c26: f0 90 b6 06 lds r15, 0x06B6 ; 0x8006b6 19c2a: 20 ff sbrs r18, 0 19c2c: 42 c0 rjmp .+132 ; 0x19cb2 19c2e: c8 1a sub r12, r24 19c30: d9 0a sbc r13, r25 19c32: ea 0a sbc r14, r26 19c34: fb 0a sbc r15, r27 19c36: c0 92 b3 06 sts 0x06B3, r12 ; 0x8006b3 19c3a: d0 92 b4 06 sts 0x06B4, r13 ; 0x8006b4 19c3e: e0 92 b5 06 sts 0x06B5, r14 ; 0x8006b5 19c42: f0 92 b6 06 sts 0x06B6, r15 ; 0x8006b6 19c46: cb 01 movw r24, r22 19c48: b0 e0 ldi r27, 0x00 ; 0 19c4a: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19c4c: c0 90 b7 06 lds r12, 0x06B7 ; 0x8006b7 19c50: d0 90 b8 06 lds r13, 0x06B8 ; 0x8006b8 19c54: e0 90 b9 06 lds r14, 0x06B9 ; 0x8006b9 19c58: f0 90 ba 06 lds r15, 0x06BA ; 0x8006ba 19c5c: 21 ff sbrs r18, 1 19c5e: 36 c0 rjmp .+108 ; 0x19ccc 19c60: c8 1a sub r12, r24 19c62: d9 0a sbc r13, r25 19c64: ea 0a sbc r14, r26 19c66: fb 0a sbc r15, r27 19c68: c0 92 b7 06 sts 0x06B7, r12 ; 0x8006b7 19c6c: d0 92 b8 06 sts 0x06B8, r13 ; 0x8006b8 19c70: e0 92 b9 06 sts 0x06B9, r14 ; 0x8006b9 19c74: f0 92 ba 06 sts 0x06BA, r15 ; 0x8006ba 19c78: 70 e0 ldi r23, 0x00 ; 0 19c7a: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19c7c: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 19c80: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 19c84: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 19c88: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 19c8c: 22 ff sbrs r18, 2 19c8e: 2b c0 rjmp .+86 ; 0x19ce6 19c90: 84 1b sub r24, r20 19c92: 95 0b sbc r25, r21 19c94: a6 0b sbc r26, r22 19c96: b7 0b sbc r27, r23 19c98: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 19c9c: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 19ca0: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 19ca4: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 19ca8: ff 90 pop r15 19caa: ef 90 pop r14 19cac: df 90 pop r13 19cae: cf 90 pop r12 19cb0: 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; 19cb2: 8c 0d add r24, r12 19cb4: 9d 1d adc r25, r13 19cb6: ae 1d adc r26, r14 19cb8: bf 1d adc r27, r15 19cba: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 19cbe: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 19cc2: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 19cc6: b0 93 b6 06 sts 0x06B6, r27 ; 0x8006b6 19cca: bd cf rjmp .-134 ; 0x19c46 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19ccc: 8c 0d add r24, r12 19cce: 9d 1d adc r25, r13 19cd0: ae 1d adc r26, r14 19cd2: bf 1d adc r27, r15 19cd4: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 19cd8: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 19cdc: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 19ce0: b0 93 ba 06 sts 0x06BA, r27 ; 0x8006ba 19ce4: c9 cf rjmp .-110 ; 0x19c78 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19ce6: 84 0f add r24, r20 19ce8: 95 1f adc r25, r21 19cea: a6 1f adc r26, r22 19cec: b7 1f adc r27, r23 19cee: d4 cf rjmp .-88 ; 0x19c98 00019cf0 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 19cf0: fb 01 movw r30, r22 *v = 0; 19cf2: 11 82 std Z+1, r1 ; 0x01 19cf4: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 19cf6: 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'; 19cf8: dc 01 movw r26, r24 19cfa: 2c 91 ld r18, X 19cfc: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 19cfe: 2a 30 cpi r18, 0x0A ; 10 19d00: a0 f4 brcc .+40 ; 0x19d2a *v *= 10; 19d02: 40 81 ld r20, Z 19d04: 51 81 ldd r21, Z+1 ; 0x01 19d06: 64 9f mul r22, r20 19d08: 90 01 movw r18, r0 19d0a: 65 9f mul r22, r21 19d0c: 30 0d add r19, r0 19d0e: 11 24 eor r1, r1 19d10: 31 83 std Z+1, r19 ; 0x01 19d12: 20 83 st Z, r18 *v += *str - '0'; 19d14: 4d 91 ld r20, X+ 19d16: cd 01 movw r24, r26 19d18: 20 53 subi r18, 0x30 ; 48 19d1a: 31 09 sbc r19, r1 19d1c: 24 0f add r18, r20 19d1e: 31 1d adc r19, r1 19d20: 47 fd sbrc r20, 7 19d22: 3a 95 dec r19 19d24: 31 83 std Z+1, r19 ; 0x01 19d26: 20 83 st Z, r18 19d28: e7 cf rjmp .-50 ; 0x19cf8 ++str; } return str; } 19d2a: 08 95 ret 00019d2c : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 19d2c: 85 e0 ldi r24, 0x05 ; 5 19d2e: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 19d32: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 00019d36 : 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) { 19d36: fc 01 movw r30, r24 switch(*oCheckSetting) { 19d38: 80 81 ld r24, Z 19d3a: 88 23 and r24, r24 19d3c: 21 f0 breq .+8 ; 0x19d46 19d3e: 81 30 cpi r24, 0x01 ; 1 19d40: 29 f4 brne .+10 ; 0x19d4c case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 19d42: 82 e0 ldi r24, 0x02 ; 2 19d44: 01 c0 rjmp .+2 ; 0x19d48 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 19d46: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 19d48: 80 83 st Z, r24 19d4a: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 19d4c: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 19d4e: 08 95 ret 00019d50 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 19d50: 84 e2 ldi r24, 0x24 ; 36 19d52: 9b e6 ldi r25, 0x6B ; 107 19d54: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 lcd_return_to_status(); 19d58: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 00019d5c : //! 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) { 19d5c: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 19d60: 81 30 cpi r24, 0x01 ; 1 19d62: 21 f4 brne .+8 ; 0x19d6c SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 19d64: 8f e7 ldi r24, 0x7F ; 127 19d66: 9a e6 ldi r25, 0x6A ; 106 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 19d68: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 19d6c: 80 e7 ldi r24, 0x70 ; 112 19d6e: 9a e6 ldi r25, 0x6A ; 106 19d70: fb cf rjmp .-10 ; 0x19d68 00019d72 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 19d72: cf 93 push r28 19d74: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 19d76: 0f 94 ed 43 call 0x287da ; 0x287da float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 19d7a: c2 e9 ldi r28, 0x92 ; 146 19d7c: d6 e0 ldi r29, 0x06 ; 6 planner_synchronize(); // Compensate for configurable Extra Loading Distance planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU2_FILAMENT_SENSOR_POSITION)); 19d7e: 60 91 97 13 lds r22, 0x1397 ; 0x801397 19d82: 70 e0 ldi r23, 0x00 ; 0 19d84: 90 e0 ldi r25, 0x00 ; 0 19d86: 80 e0 ldi r24, 0x00 ; 0 19d88: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 19d8c: 20 e0 ldi r18, 0x00 ; 0 19d8e: 30 e0 ldi r19, 0x00 ; 0 19d90: 40 e8 ldi r20, 0x80 ; 128 19d92: 51 e4 ldi r21, 0x41 ; 65 19d94: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 19d98: 9b 01 movw r18, r22 19d9a: ac 01 movw r20, r24 19d9c: 6c 85 ldd r22, Y+12 ; 0x0c 19d9e: 7d 85 ldd r23, Y+13 ; 0x0d 19da0: 8e 85 ldd r24, Y+14 ; 0x0e 19da2: 9f 85 ldd r25, Y+15 ; 0x0f 19da4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 19da8: 6c 87 std Y+12, r22 ; 0x0c 19daa: 7d 87 std Y+13, r23 ; 0x0d 19dac: 8e 87 std Y+14, r24 ; 0x0e 19dae: 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])); 19db0: 62 e0 ldi r22, 0x02 ; 2 19db2: 80 e1 ldi r24, 0x10 ; 16 19db4: 9e e8 ldi r25, 0x8E ; 142 } 19db6: df 91 pop r29 19db8: 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])); 19dba: 0d 94 93 88 jmp 0x31126 ; 0x31126 00019dbe : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 19dbe: df 92 push r13 19dc0: ef 92 push r14 19dc2: ff 92 push r15 19dc4: 0f 93 push r16 19dc6: 1f 93 push r17 19dc8: cf 93 push r28 19dca: df 93 push r29 19dcc: cd b7 in r28, 0x3d ; 61 19dce: de b7 in r29, 0x3e ; 62 19dd0: 63 97 sbiw r28, 0x13 ; 19 19dd2: 0f b6 in r0, 0x3f ; 63 19dd4: f8 94 cli 19dd6: de bf out 0x3e, r29 ; 62 19dd8: 0f be out 0x3f, r0 ; 63 19dda: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 19ddc: 30 91 15 05 lds r19, 0x0515 ; 0x800515 19de0: 20 91 14 05 lds r18, 0x0514 ; 0x800514 19de4: 32 13 cpse r19, r18 19de6: 73 c0 rjmp .+230 ; 0x19ece 19de8: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 19dea: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 19dee: 88 23 and r24, r24 19df0: 09 f4 brne .+2 ; 0x19df4 19df2: 45 c0 rjmp .+138 ; 0x19e7e //! //! @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)); 19df4: 81 ed ldi r24, 0xD1 ; 209 19df6: 9c e4 ldi r25, 0x4C ; 76 19df8: 0e 94 2c 72 call 0xe458 ; 0xe458 19dfc: 9f 93 push r25 19dfe: 8f 93 push r24 19e00: 89 ec ldi r24, 0xC9 ; 201 19e02: 9d e8 ldi r25, 0x8D ; 141 19e04: 9f 93 push r25 19e06: 8f 93 push r24 19e08: 8e 01 movw r16, r28 19e0a: 0f 5f subi r16, 0xFF ; 255 19e0c: 1f 4f sbci r17, 0xFF ; 255 19e0e: 1f 93 push r17 19e10: 0f 93 push r16 19e12: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 19e16: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 19e18: 47 e0 ldi r20, 0x07 ; 7 19e1a: 50 e0 ldi r21, 0x00 ; 0 19e1c: b7 01 movw r22, r14 19e1e: 80 0f add r24, r16 19e20: 91 2f mov r25, r17 19e22: 91 1d adc r25, r1 19e24: 0f 94 44 dc call 0x3b888 ; 0x3b888 19e28: 0f 90 pop r0 19e2a: 0f 90 pop r0 19e2c: 0f 90 pop r0 19e2e: 0f 90 pop r0 19e30: 0f 90 pop r0 19e32: 0f 90 pop r0 19e34: 20 e0 ldi r18, 0x00 ; 0 19e36: 82 2f mov r24, r18 19e38: 8d 0d add r24, r13 19e3a: 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) 19e3c: 27 30 cpi r18, 0x07 ; 7 19e3e: 39 f0 breq .+14 ; 0x19e4e 19e40: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 19e42: f8 01 movw r30, r16 19e44: e8 0f add r30, r24 19e46: f9 1f adc r31, r25 19e48: 30 81 ld r19, Z 19e4a: 31 11 cpse r19, r1 19e4c: f4 cf rjmp .-24 ; 0x19e36 } buffer.c[index] = ']'; 19e4e: f8 01 movw r30, r16 19e50: e8 0f add r30, r24 19e52: f9 1f adc r31, r25 19e54: 2d e5 ldi r18, 0x5D ; 93 19e56: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 19e58: 8c 0f add r24, r28 19e5a: 9d 1f adc r25, r29 19e5c: fc 01 movw r30, r24 19e5e: 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()); 19e60: 0f 94 90 d0 call 0x3a120 ; 0x3a120 19e64: 48 2f mov r20, r24 19e66: 60 91 12 05 lds r22, 0x0512 ; 0x800512 19e6a: 80 e0 ldi r24, 0x00 ; 0 19e6c: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 19e70: 62 e1 ldi r22, 0x12 ; 18 19e72: c8 01 movw r24, r16 19e74: 0e 94 4f 70 call 0xe09e ; 0xe09e lcd_putc(type_char); 19e78: 80 e2 ldi r24, 0x20 ; 32 19e7a: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 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)) 19e7e: 80 91 13 05 lds r24, 0x0513 ; 0x800513 19e82: 88 23 and r24, r24 19e84: 21 f1 breq .+72 ; 0x19ece 19e86: 20 91 15 05 lds r18, 0x0515 ; 0x800515 19e8a: 80 91 70 06 lds r24, 0x0670 ; 0x800670 19e8e: 90 91 71 06 lds r25, 0x0671 ; 0x800671 19e92: 28 17 cp r18, r24 19e94: 19 06 cpc r1, r25 19e96: d9 f4 brne .+54 ; 0x19ece { lcd_update_enabled = 0; 19e98: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 19e9c: 83 ee ldi r24, 0xE3 ; 227 19e9e: 95 e7 ldi r25, 0x75 ; 117 19ea0: 89 2b or r24, r25 19ea2: 11 f0 breq .+4 ; 0x19ea8 19ea4: 0e 94 e3 75 call 0xebc6 ; 0xebc6 lcd_update_enabled = 1; 19ea8: 81 e0 ldi r24, 0x01 ; 1 19eaa: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 19eae: 0f 94 b4 d0 call 0x3a168 ; 0x3a168 return; } } menu_item++; } 19eb2: 63 96 adiw r28, 0x13 ; 19 19eb4: 0f b6 in r0, 0x3f ; 63 19eb6: f8 94 cli 19eb8: de bf out 0x3e, r29 ; 62 19eba: 0f be out 0x3f, r0 ; 63 19ebc: cd bf out 0x3d, r28 ; 61 19ebe: df 91 pop r29 19ec0: cf 91 pop r28 19ec2: 1f 91 pop r17 19ec4: 0f 91 pop r16 19ec6: ff 90 pop r15 19ec8: ef 90 pop r14 19eca: df 90 pop r13 19ecc: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 19ece: 80 91 15 05 lds r24, 0x0515 ; 0x800515 19ed2: 8f 5f subi r24, 0xFF ; 255 19ed4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 19ed8: ec cf rjmp .-40 ; 0x19eb2 00019eda : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 19eda: 61 e0 ldi r22, 0x01 ; 1 19edc: 8b ee ldi r24, 0xEB ; 235 19ede: 98 e8 ldi r25, 0x88 ; 136 19ee0: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_return_to_status(); 19ee4: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 00019ee8 : } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 19ee8: 61 e0 ldi r22, 0x01 ; 1 19eea: 8f ee ldi r24, 0xEF ; 239 19eec: 98 e8 ldi r25, 0x88 ; 136 19eee: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_return_to_status(); 19ef2: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 00019ef6 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 19ef6: 61 e0 ldi r22, 0x01 ; 1 19ef8: 87 ee ldi r24, 0xE7 ; 231 19efa: 98 e8 ldi r25, 0x88 ; 136 19efc: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_return_to_status(); 19f00: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 00019f04 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 19f04: 61 e0 ldi r22, 0x01 ; 1 19f06: 85 ef ldi r24, 0xF5 ; 245 19f08: 98 e8 ldi r25, 0x88 ; 136 19f0a: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_return_to_status(); 19f0e: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 00019f12 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 19f12: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 19f16: 88 23 and r24, r24 19f18: 61 f0 breq .+24 ; 0x19f32 19f1a: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 19f1e: 88 23 and r24, r24 19f20: 41 f0 breq .+16 ; 0x19f32 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 19f22: 8d eb ldi r24, 0xBD ; 189 19f24: 93 e4 ldi r25, 0x43 ; 67 19f26: 0e 94 2c 72 call 0xe458 ; 0xe458 19f2a: 0f 94 f6 20 call 0x241ec ; 0x241ec lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 19f2e: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 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; 19f32: 86 e0 ldi r24, 0x06 ; 6 19f34: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 19f38: fa cf rjmp .-12 ; 0x19f2e 00019f3a : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 19f3a: cf 93 push r28 19f3c: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 19f3e: 81 ec ldi r24, 0xC1 ; 193 19f40: 9d e3 ldi r25, 0x3D ; 61 19f42: 0e 94 2c 72 call 0xe458 ; 0xe458 19f46: 0f 94 f6 20 call 0x241ec ; 0x241ec _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 19f4a: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19f4e: 81 30 cpi r24, 0x01 ; 1 19f50: 69 f4 brne .+26 ; 0x19f6c { lcd_show_fullscreen_message_and_wait_P( 19f52: 88 e6 ldi r24, 0x68 ; 104 19f54: 9d e3 ldi r25, 0x3D ; 61 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 19f56: 0e 94 2c 72 call 0xe458 ; 0xe458 19f5a: 0f 94 f6 20 call 0x241ec ; 0x241ec _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 19f5e: 86 e9 ldi r24, 0x96 ; 150 19f60: 9c e3 ldi r25, 0x3C ; 60 19f62: 0e 94 2c 72 call 0xe458 ; 0xe458 _T(MSG_WIZARD_V2_CAL_2)); } 19f66: 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( 19f68: 0d 94 f6 20 jmp 0x241ec ; 0x241ec if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 19f6c: cc 23 and r28, r28 19f6e: b9 f3 breq .-18 ; 0x19f5e { lcd_show_fullscreen_message_and_wait_P( 19f70: 86 e3 ldi r24, 0x36 ; 54 19f72: 9d e3 ldi r25, 0x3D ; 61 19f74: f0 cf rjmp .-32 ; 0x19f56 00019f76 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 19f76: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19f7a: 81 30 cpi r24, 0x01 ; 1 19f7c: 71 f4 brne .+28 ; 0x19f9a lcd_show_fullscreen_message_and_wait_P( 19f7e: 8d e3 ldi r24, 0x3D ; 61 19f80: 9c e3 ldi r25, 0x3C ; 60 19f82: 0e 94 2c 72 call 0xe458 ; 0xe458 19f86: 0f 94 f6 20 call 0x241ec ; 0x241ec _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; 19f8a: 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; 19f8c: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 19f90: 61 e0 ldi r22, 0x01 ; 1 19f92: 89 ef ldi r24, 0xF9 ; 249 19f94: 98 e8 ldi r25, 0x88 ; 136 19f96: 0c 94 a0 87 jmp 0x10f40 ; 0x10f40 // 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( 19f9a: 81 ef ldi r24, 0xF1 ; 241 19f9c: 9b e3 ldi r25, 0x3B ; 59 19f9e: 0e 94 2c 72 call 0xe458 ; 0xe458 19fa2: 0f 94 f6 20 call 0x241ec ; 0x241ec _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 19fa6: 80 e0 ldi r24, 0x00 ; 0 19fa8: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_clear(); 19fac: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 19fb0: 85 e7 ldi r24, 0x75 ; 117 19fb2: 9b e5 ldi r25, 0x5B ; 91 19fb4: 0e 94 2c 72 call 0xe458 ; 0xe458 19fb8: ac 01 movw r20, r24 19fba: 62 e0 ldi r22, 0x02 ; 2 19fbc: 80 e0 ldi r24, 0x00 ; 0 19fbe: 0e 94 74 6e call 0xdce8 ; 0xdce8 eFilamentAction = FilamentAction::Load; 19fc2: 81 e0 ldi r24, 0x01 ; 1 19fc4: e3 cf rjmp .-58 ; 0x19f8c 00019fc6 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 19fc6: 0d 94 74 7c jmp 0x2f8e8 ; 0x2f8e8 00019fca : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 19fca: cf 92 push r12 19fcc: df 92 push r13 19fce: ef 92 push r14 19fd0: ff 92 push r15 19fd2: 0f 93 push r16 19fd4: 1f 93 push r17 19fd6: cf 93 push r28 19fd8: df 93 push r29 19fda: 6c 01 movw r12, r24 19fdc: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 19fde: c4 2f mov r28, r20 19fe0: d0 e0 ldi r29, 0x00 ; 0 19fe2: ae 01 movw r20, r28 19fe4: 0f 94 33 da call 0x3b466 ; 0x3b466 19fe8: 89 2b or r24, r25 19fea: b9 f4 brne .+46 ; 0x1a01a Number(str + tagSize, v); 19fec: b8 01 movw r22, r16 19fee: c6 01 movw r24, r12 19ff0: 8c 0f add r24, r28 19ff2: 9d 1f adc r25, r29 19ff4: 0e 94 78 ce call 0x19cf0 ; 0x19cf0 *v |= tagMask; 19ff8: f8 01 movw r30, r16 19ffa: 20 81 ld r18, Z 19ffc: 31 81 ldd r19, Z+1 ; 0x01 19ffe: 2e 29 or r18, r14 1a000: 3f 29 or r19, r15 1a002: 31 83 std Z+1, r19 ; 0x01 1a004: 20 83 st Z, r18 return true; 1a006: 81 e0 ldi r24, 0x01 ; 1 } return false; } 1a008: df 91 pop r29 1a00a: cf 91 pop r28 1a00c: 1f 91 pop r17 1a00e: 0f 91 pop r16 1a010: ff 90 pop r15 1a012: ef 90 pop r14 1a014: df 90 pop r13 1a016: cf 90 pop r12 1a018: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 1a01a: 80 e0 ldi r24, 0x00 ; 0 1a01c: f5 cf rjmp .-22 ; 0x1a008 0001a01e : } #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); 1a01e: 87 ea ldi r24, 0xA7 ; 167 1a020: 9c e0 ldi r25, 0x0C ; 12 1a022: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 if (value > 1) value = 1; 1a026: 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) 1a028: 82 30 cpi r24, 0x02 ; 2 1a02a: 08 f4 brcc .+2 ; 0x1a02e 1a02c: 68 27 eor r22, r24 1a02e: 87 ea ldi r24, 0xA7 ; 167 1a030: 9c e0 ldi r25, 0x0C ; 12 1a032: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a036 : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 1a036: cf 93 push r28 1a038: df 93 push r29 1a03a: c5 e1 ldi r28, 0x15 ; 21 1a03c: 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++)); 1a03e: fe 01 movw r30, r28 1a040: e5 54 subi r30, 0x45 ; 69 1a042: f3 48 sbci r31, 0x83 ; 131 1a044: 64 91 lpm r22, Z 1a046: ce 01 movw r24, r28 1a048: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 1a04c: 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++) { 1a04e: c9 32 cpi r28, 0x29 ; 41 1a050: 8d e0 ldi r24, 0x0D ; 13 1a052: d8 07 cpc r29, r24 1a054: a1 f7 brne .-24 ; 0x1a03e eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 1a056: df 91 pop r29 1a058: cf 91 pop r28 1a05a: 08 95 ret 0001a05c : 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); 1a05c: 8a ea ldi r24, 0xAA ; 170 1a05e: 9d e0 ldi r25, 0x0D ; 13 1a060: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 1a064: 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) { 1a066: 83 30 cpi r24, 0x03 ; 3 1a068: 21 f0 breq .+8 ; 0x1a072 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 1a06a: 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) { 1a06c: 85 30 cpi r24, 0x05 ; 5 1a06e: 09 f0 breq .+2 ; 0x1a072 case 1: mbl_z_probe_nr = 3; break; 1a070: 63 e0 ldi r22, 0x03 ; 3 1a072: 8a ea ldi r24, 0xAA ; 170 1a074: 9d e0 ldi r25, 0x0D ; 13 1a076: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a07a : 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); 1a07a: 8b ea ldi r24, 0xAB ; 171 1a07c: 9d e0 ldi r25, 0x0D ; 13 1a07e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 1a082: 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; 1a084: 83 30 cpi r24, 0x03 ; 3 1a086: 09 f4 brne .+2 ; 0x1a08a 1a088: 67 e0 ldi r22, 0x07 ; 7 1a08a: 8b ea ldi r24, 0xAB ; 171 1a08c: 9d e0 ldi r25, 0x0D ; 13 1a08e: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a092 : #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); 1a092: 8c ea ldi r24, 0xAC ; 172 1a094: 9d e0 ldi r25, 0x0D ; 13 1a096: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 magnet_elimination = !magnet_elimination; 1a09a: 61 e0 ldi r22, 0x01 ; 1 1a09c: 81 11 cpse r24, r1 1a09e: 60 e0 ldi r22, 0x00 ; 0 1a0a0: 8c ea ldi r24, 0xAC ; 172 1a0a2: 9d e0 ldi r25, 0x0D ; 13 1a0a4: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a0a8 : 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); 1a0a8: 87 ee ldi r24, 0xE7 ; 231 1a0aa: 94 e0 ldi r25, 0x04 ; 4 1a0ac: 0e 94 9b ce call 0x19d36 ; 0x19d36 1a0b0: 60 91 e7 04 lds r22, 0x04E7 ; 0x8004e7 1a0b4: 80 e2 ldi r24, 0x20 ; 32 1a0b6: 9c e0 ldi r25, 0x0C ; 12 1a0b8: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a0bc : 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); 1a0bc: 89 ee ldi r24, 0xE9 ; 233 1a0be: 94 e0 ldi r25, 0x04 ; 4 1a0c0: 0e 94 9b ce call 0x19d36 ; 0x19d36 1a0c4: 60 91 e9 04 lds r22, 0x04E9 ; 0x8004e9 1a0c8: 83 ea ldi r24, 0xA3 ; 163 1a0ca: 9d e0 ldi r25, 0x0D ; 13 1a0cc: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a0d0 : 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); 1a0d0: 8a ee ldi r24, 0xEA ; 234 1a0d2: 94 e0 ldi r25, 0x04 ; 4 1a0d4: 0e 94 9b ce call 0x19d36 ; 0x19d36 1a0d8: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 1a0dc: 84 ea ldi r24, 0xA4 ; 164 1a0de: 9d e0 ldi r25, 0x0D ; 13 1a0e0: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a0e4 : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 1a0e4: 8c ee ldi r24, 0xEC ; 236 1a0e6: 94 e0 ldi r25, 0x04 ; 4 1a0e8: 0e 94 9b ce call 0x19d36 ; 0x19d36 1a0ec: 60 91 ec 04 lds r22, 0x04EC ; 0x8004ec 1a0f0: 88 ea ldi r24, 0xA8 ; 168 1a0f2: 9d e0 ldi r25, 0x0D ; 13 1a0f4: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a0f8 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 1a0f8: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 1a0fc: 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) { 1a0fe: 81 11 cpse r24, r1 1a100: 01 c0 rjmp .+2 ; 0x1a104 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 1a102: 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; 1a104: 60 93 b2 17 sts 0x17B2, r22 ; 0x8017b2 1a108: 87 e4 ldi r24, 0x47 ; 71 1a10a: 9d e0 ldi r25, 0x0D ; 13 1a10c: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a110 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 1a110: ea ea ldi r30, 0xAA ; 170 1a112: f7 e1 ldi r31, 0x17 ; 23 1a114: 61 81 ldd r22, Z+1 ; 0x01 1a116: 81 e0 ldi r24, 0x01 ; 1 1a118: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1a11a: 61 83 std Z+1, r22 ; 0x01 1a11c: 87 e0 ldi r24, 0x07 ; 7 1a11e: 9f e0 ldi r25, 0x0F ; 15 1a120: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a124 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 1a124: ea ea ldi r30, 0xAA ; 170 1a126: f7 e1 ldi r31, 0x17 ; 23 1a128: 62 81 ldd r22, Z+2 ; 0x02 1a12a: 81 e0 ldi r24, 0x01 ; 1 1a12c: 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; 1a12e: 62 83 std Z+2, r22 ; 0x02 1a130: 85 ed ldi r24, 0xD5 ; 213 1a132: 9e e0 ldi r25, 0x0E ; 14 1a134: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a138 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 1a138: e1 e0 ldi r30, 0x01 ; 1 1a13a: f7 e1 ldi r31, 0x17 ; 23 1a13c: 60 81 ld r22, Z 1a13e: 81 e0 ldi r24, 0x01 ; 1 1a140: 68 27 eor r22, r24 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; } 1a142: 60 83 st Z, r22 1a144: 8b eb ldi r24, 0xBB ; 187 1a146: 9f e0 ldi r25, 0x0F ; 15 1a148: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a14c : 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; 1a14c: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1a150: 81 30 cpi r24, 0x01 ; 1 1a152: 51 f4 brne .+20 ; 0x1a168 1a154: 10 92 39 05 sts 0x0539, r1 ; 0x800539 1a158: 60 91 39 05 lds r22, 0x0539 ; 0x800539 1a15c: 88 e0 ldi r24, 0x08 ; 8 1a15e: 9f e0 ldi r25, 0x0F ; 15 1a160: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 1a164: 0c 94 64 cd jmp 0x19ac8 ; 0x19ac8 } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 1a168: 81 e0 ldi r24, 0x01 ; 1 1a16a: 80 93 39 05 sts 0x0539, r24 ; 0x800539 1a16e: f4 cf rjmp .-24 ; 0x1a158 0001a170 : 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); 1a170: 8f ea ldi r24, 0xAF ; 175 1a172: 9f e0 ldi r25, 0x0F ; 15 1a174: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 temp_cal_active = !temp_cal_active; 1a178: 61 e0 ldi r22, 0x01 ; 1 1a17a: 81 11 cpse r24, r1 1a17c: 60 e0 ldi r22, 0x00 ; 0 1a17e: 8f ea ldi r24, 0xAF ; 175 1a180: 9f e0 ldi r25, 0x0F ; 15 1a182: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a186 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 1a186: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1a18a: 81 30 cpi r24, 0x01 ; 1 1a18c: 71 f0 breq .+28 ; 0x1a1aa 1a18e: 20 f0 brcs .+8 ; 0x1a198 1a190: 82 30 cpi r24, 0x02 ; 2 1a192: 69 f4 brne .+26 ; 0x1a1ae break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 1a194: 83 e0 ldi r24, 0x03 ; 3 1a196: 01 c0 rjmp .+2 ; 0x1a19a void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 1a198: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 1a19a: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de 1a19e: 60 91 de 04 lds r22, 0x04DE ; 0x8004de 1a1a2: 87 ed ldi r24, 0xD7 ; 215 1a1a4: 9e e0 ldi r25, 0x0E ; 14 1a1a6: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 1a1aa: 82 e0 ldi r24, 0x02 ; 2 1a1ac: f6 cf rjmp .-20 ; 0x1a19a break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 1a1ae: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de 1a1b2: f5 cf rjmp .-22 ; 0x1a19e 0001a1b4 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 1a1b4: 89 e0 ldi r24, 0x09 ; 9 1a1b6: 9f e0 ldi r25, 0x0F ; 15 1a1b8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 1a1bc: 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) { 1a1be: 88 23 and r24, r24 1a1c0: 21 f0 breq .+8 ; 0x1a1ca case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 1a1c2: 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) { 1a1c4: 81 30 cpi r24, 0x01 ; 1 1a1c6: 09 f0 breq .+2 ; 0x1a1ca case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 1a1c8: 60 e0 ldi r22, 0x00 ; 0 1a1ca: 89 e0 ldi r24, 0x09 ; 9 1a1cc: 9f e0 ldi r25, 0x0F ; 15 1a1ce: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 1a1d2: 81 e0 ldi r24, 0x01 ; 1 1a1d4: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df } 1a1d8: 08 95 ret 0001a1da : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 1a1da: cf 93 push r28 1a1dc: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 1a1de: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1a1e2: 8c 33 cpi r24, 0x3C ; 60 1a1e4: e1 f0 breq .+56 ; 0x1a21e 1a1e6: 80 35 cpi r24, 0x50 ; 80 1a1e8: 01 f1 breq .+64 ; 0x1a22a 1a1ea: 88 32 cpi r24, 0x28 ; 40 1a1ec: 91 f0 breq .+36 ; 0x1a212 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 1a1ee: 88 e2 ldi r24, 0x28 ; 40 1a1f0: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=400; 1a1f4: c0 e9 ldi r28, 0x90 ; 144 1a1f6: d1 e0 ldi r29, 0x01 ; 1 1a1f8: 60 91 eb 04 lds r22, 0x04EB ; 0x8004eb 1a1fc: 87 ea ldi r24, 0xA7 ; 167 1a1fe: 9d e0 ldi r25, 0x0D ; 13 1a200: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1a204: be 01 movw r22, r28 1a206: 85 ea ldi r24, 0xA5 ; 165 1a208: 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); } 1a20a: df 91 pop r29 1a20c: cf 91 pop r28 1a20e: 0d 94 96 dc jmp 0x3b92c ; 0x3b92c case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 1a212: 8c e3 ldi r24, 0x3C ; 60 1a214: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=600; 1a218: c8 e5 ldi r28, 0x58 ; 88 1a21a: d2 e0 ldi r29, 0x02 ; 2 1a21c: ed cf rjmp .-38 ; 0x1a1f8 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 1a21e: 80 e5 ldi r24, 0x50 ; 80 1a220: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=800; 1a224: c0 e2 ldi r28, 0x20 ; 32 1a226: d3 e0 ldi r29, 0x03 ; 3 1a228: e7 cf rjmp .-50 ; 0x1a1f8 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 1a22a: 89 e1 ldi r24, 0x19 ; 25 1a22c: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=250; 1a230: ca ef ldi r28, 0xFA ; 250 1a232: d0 e0 ldi r29, 0x00 ; 0 1a234: e1 cf rjmp .-62 ; 0x1a1f8 0001a236 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a236: 0f 93 push r16 1a238: 1f 93 push r17 1a23a: cf 93 push r28 1a23c: df 93 push r29 1a23e: 00 d0 rcall .+0 ; 0x1a240 1a240: 00 d0 rcall .+0 ; 0x1a242 1a242: 1f 92 push r1 1a244: 1f 92 push r1 1a246: cd b7 in r28, 0x3d ; 61 1a248: de b7 in r29, 0x3e ; 62 1a24a: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a24c: 8a e0 ldi r24, 0x0A ; 10 1a24e: 90 e0 ldi r25, 0x00 ; 0 1a250: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1a254: 9a 83 std Y+2, r25 ; 0x02 1a256: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a258: 8c e0 ldi r24, 0x0C ; 12 1a25a: 90 e0 ldi r25, 0x00 ; 0 1a25c: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1a260: 9c 83 std Y+4, r25 ; 0x04 1a262: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a264: 8e e0 ldi r24, 0x0E ; 14 1a266: 90 e0 ldi r25, 0x00 ; 0 1a268: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1a26c: 9e 83 std Y+6, r25 ; 0x06 1a26e: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a270: 80 e1 ldi r24, 0x10 ; 16 1a272: 90 e0 ldi r25, 0x00 ; 0 1a274: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1a278: 98 87 std Y+8, r25 ; 0x08 1a27a: 8f 83 std Y+7, r24 ; 0x07 1a27c: c8 01 movw r24, r16 1a27e: de 01 movw r26, r28 1a280: 11 96 adiw r26, 0x01 ; 1 1a282: be 01 movw r22, r28 1a284: 67 5f subi r22, 0xF7 ; 247 1a286: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a288: fc 01 movw r30, r24 1a28a: 25 91 lpm r18, Z+ 1a28c: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a28e: 4d 91 ld r20, X+ 1a290: 5d 91 ld r21, X+ 1a292: 42 17 cp r20, r18 1a294: 53 07 cpc r21, r19 1a296: 48 f0 brcs .+18 ; 0x1a2aa return true; else if (v < ver_eeprom[i]) 1a298: 24 17 cp r18, r20 1a29a: 35 07 cpc r19, r21 1a29c: 20 f0 brcs .+8 ; 0x1a2a6 1a29e: 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) { 1a2a0: a6 17 cp r26, r22 1a2a2: b7 07 cpc r27, r23 1a2a4: 89 f7 brne .-30 ; 0x1a288 return true; else if (v < ver_eeprom[i]) break; } return false; 1a2a6: 80 e0 ldi r24, 0x00 ; 0 1a2a8: 01 c0 rjmp .+2 ; 0x1a2ac 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; 1a2aa: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a2ac: 28 96 adiw r28, 0x08 ; 8 1a2ae: 0f b6 in r0, 0x3f ; 63 1a2b0: f8 94 cli 1a2b2: de bf out 0x3e, r29 ; 62 1a2b4: 0f be out 0x3f, r0 ; 63 1a2b6: cd bf out 0x3d, r28 ; 61 1a2b8: df 91 pop r29 1a2ba: cf 91 pop r28 1a2bc: 1f 91 pop r17 1a2be: 0f 91 pop r16 1a2c0: 08 95 ret 0001a2c2 : 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) { 1a2c2: 0f 93 push r16 1a2c4: 1f 93 push r17 1a2c6: cf 93 push r28 1a2c8: df 93 push r29 1a2ca: 98 2f mov r25, r24 1a2cc: 86 2f mov r24, r22 1a2ce: 14 2f mov r17, r20 1a2d0: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a2d2: 69 2f mov r22, r25 1a2d4: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 switch (_state) 1a2d8: 11 30 cpi r17, 0x01 ; 1 1a2da: 21 f0 breq .+8 ; 0x1a2e4 1a2dc: 12 30 cpi r17, 0x02 ; 2 1a2de: 79 f0 breq .+30 ; 0x1a2fe lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a2e0: ce 01 movw r24, r28 1a2e2: 15 c0 rjmp .+42 ; 0x1a30e { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a2e4: ce 01 movw r24, r28 1a2e6: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_putc(':'); 1a2ea: 8a e3 ldi r24, 0x3A ; 58 1a2ec: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_putc(_indicator); 1a2f0: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a2f2: df 91 pop r29 1a2f4: cf 91 pop r28 1a2f6: 1f 91 pop r17 1a2f8: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a2fa: 0c 94 4f 6e jmp 0xdc9e ; 0xdc9e break; case 2: lcd_puts_P(_name_PROGMEM); 1a2fe: ce 01 movw r24, r28 1a300: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_putc(':'); 1a304: 8a e3 ldi r24, 0x3A ; 58 1a306: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_puts_P(MSG_OK_CAPS); 1a30a: 8e ed ldi r24, 0xDE ; 222 1a30c: 9a e6 ldi r25, 0x6A ; 106 break; default: lcd_puts_P(_name_PROGMEM); } } 1a30e: df 91 pop r29 1a310: cf 91 pop r28 1a312: 1f 91 pop r17 1a314: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a316: 0c 94 4b 6e jmp 0xdc96 ; 0xdc96 0001a31a : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 1a31a: 81 e0 ldi r24, 0x01 ; 1 1a31c: 90 91 aa 17 lds r25, 0x17AA ; 0x8017aa 1a320: 91 11 cpse r25, r1 1a322: 80 e0 ldi r24, 0x00 ; 0 1a324: 0c 94 4f 74 jmp 0xe89e ; 0xe89e 0001a328 : static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); } #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_jam_detection_set() { 1a328: 0f 93 push r16 1a32a: 1f 93 push r17 1a32c: cf 93 push r28 fsensor.setJamDetectionEnabled(!fsensor.getJamDetectionEnabled(), true); 1a32e: 0a ea ldi r16, 0xAA ; 170 1a330: 17 e1 ldi r17, 0x17 ; 23 1a332: f8 01 movw r30, r16 1a334: c6 85 ldd r28, Z+14 ; 0x0e 1a336: 81 e0 ldi r24, 0x01 ; 1 1a338: c8 27 eor r28, r24 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 1a33a: c6 87 std Z+14, r28 ; 0x0e oldPos = pat9125_y; 1a33c: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 1a340: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 1a344: 90 8b std Z+16, r25 ; 0x10 1a346: 87 87 std Z+15, r24 ; 0x0f resetStepCount(); 1a348: 0f 94 25 7c call 0x2f84a ; 0x2f84a jamErrCnt = 0; 1a34c: f8 01 movw r30, r16 1a34e: 15 8a std Z+21, r1 ; 0x15 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1a350: 6c 2f mov r22, r28 1a352: 8d ea ldi r24, 0xAD ; 173 1a354: 9c e0 ldi r25, 0x0C ; 12 } 1a356: cf 91 pop r28 1a358: 1f 91 pop r17 1a35a: 0f 91 pop r16 1a35c: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001a360 : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 1a360: 89 ea ldi r24, 0xA9 ; 169 1a362: 9d e0 ldi r25, 0x0D ; 13 1a364: 0c 94 b4 75 jmp 0xeb68 ; 0xeb68 0001a368 : 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)) { 1a368: 0f 93 push r16 1a36a: 1f 93 push r17 1a36c: cf 93 push r28 1a36e: df 93 push r29 1a370: eb 01 movw r28, r22 1a372: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1a374: 81 30 cpi r24, 0x01 ; 1 1a376: 81 f0 breq .+32 ; 0x1a398 1a378: 82 30 cpi r24, 0x02 ; 2 1a37a: 89 f0 breq .+34 ; 0x1a39e case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1a37c: 86 e6 ldi r24, 0x66 ; 102 1a37e: 99 e4 ldi r25, 0x49 ; 73 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); 1a380: 0e 94 2c 72 call 0xe458 ; 0xe458 1a384: 22 e0 ldi r18, 0x02 ; 2 1a386: a8 01 movw r20, r16 1a388: bc 01 movw r22, r24 1a38a: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1a38c: df 91 pop r29 1a38e: cf 91 pop r28 1a390: 1f 91 pop r17 1a392: 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); 1a394: 0d 94 5d d3 jmp 0x3a6ba ; 0x3a6ba 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); 1a398: 8f e5 ldi r24, 0x5F ; 95 1a39a: 99 e4 ldi r25, 0x49 ; 73 1a39c: f1 cf rjmp .-30 ; 0x1a380 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1a39e: 86 e5 ldi r24, 0x56 ; 86 1a3a0: 99 e4 ldi r25, 0x49 ; 73 1a3a2: ee cf rjmp .-36 ; 0x1a380 0001a3a4 : 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() { 1a3a4: cf 93 push r28 1a3a6: 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); 1a3a8: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1a3ac: 88 23 and r24, r24 1a3ae: 89 f0 breq .+34 ; 0x1a3d2 1a3b0: 87 e1 ldi r24, 0x17 ; 23 1a3b2: 9c e5 ldi r25, 0x5C ; 92 1a3b4: 0e 94 2c 72 call 0xe458 ; 0xe458 1a3b8: ec 01 movw r28, r24 1a3ba: 8f e9 ldi r24, 0x9F ; 159 1a3bc: 93 e4 ldi r25, 0x43 ; 67 1a3be: 0e 94 2c 72 call 0xe458 ; 0xe458 1a3c2: 22 e0 ldi r18, 0x02 ; 2 1a3c4: 4c ec ldi r20, 0xCC ; 204 1a3c6: 59 e3 ldi r21, 0x39 ; 57 1a3c8: be 01 movw r22, r28 } 1a3ca: df 91 pop r29 1a3cc: 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); 1a3ce: 0d 94 5d d3 jmp 0x3a6ba ; 0x3a6ba 1a3d2: 81 e1 ldi r24, 0x11 ; 17 1a3d4: 9c e5 ldi r25, 0x5C ; 92 1a3d6: ee cf rjmp .-36 ; 0x1a3b4 0001a3d8 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 1a3d8: cf 93 push r28 1a3da: 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); 1a3dc: 8f ef ldi r24, 0xFF ; 255 1a3de: 9f e0 ldi r25, 0x0F ; 15 1a3e0: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 bool bDesync = tmc2130_mode ^ eeprom_mode; 1a3e4: 90 91 8c 06 lds r25, 0x068C ; 0x80068c if (eeprom_mode == SILENT_MODE_NORMAL) 1a3e8: 81 11 cpse r24, r1 1a3ea: 35 c0 rjmp .+106 ; 0x1a456 { if (bDesync) 1a3ec: 99 23 and r25, r25 1a3ee: 11 f1 breq .+68 ; 0x1a434 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 1a3f0: 8f ea ldi r24, 0xAF ; 175 1a3f2: 97 e4 ldi r25, 0x47 ; 71 1a3f4: 0e 94 2c 72 call 0xe458 ; 0xe458 1a3f8: 22 e0 ldi r18, 0x02 ; 2 1a3fa: 48 e0 ldi r20, 0x08 ; 8 1a3fc: 51 ef ldi r21, 0xF1 ; 241 1a3fe: 68 e1 ldi r22, 0x18 ; 24 1a400: 79 e8 ldi r23, 0x89 ; 137 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 1a402: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 1a406: 89 e6 ldi r24, 0x69 ; 105 1a408: 9f e0 ldi r25, 0x0F ; 15 1a40a: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1a40e: 88 23 and r24, r24 1a410: f9 f0 breq .+62 ; 0x1a450 1a412: 87 e1 ldi r24, 0x17 ; 23 1a414: 9c e5 ldi r25, 0x5C ; 92 1a416: 0e 94 2c 72 call 0xe458 ; 0xe458 1a41a: ec 01 movw r28, r24 1a41c: 80 e8 ldi r24, 0x80 ; 128 1a41e: 93 e4 ldi r25, 0x43 ; 67 1a420: 0e 94 2c 72 call 0xe458 ; 0xe458 1a424: 22 e0 ldi r18, 0x02 ; 2 1a426: 4e e0 ldi r20, 0x0E ; 14 1a428: 50 ee ldi r21, 0xE0 ; 224 1a42a: 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 } } 1a42c: df 91 pop r29 1a42e: 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); 1a430: 0d 94 5d d3 jmp 0x3a6ba ; 0x3a6ba { 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); 1a434: 8c e2 ldi r24, 0x2C ; 44 1a436: 94 e4 ldi r25, 0x44 ; 68 1a438: 0e 94 2c 72 call 0xe458 ; 0xe458 1a43c: ec 01 movw r28, r24 1a43e: 8f ea ldi r24, 0xAF ; 175 1a440: 97 e4 ldi r25, 0x47 ; 71 1a442: 0e 94 2c 72 call 0xe458 ; 0xe458 1a446: 22 e0 ldi r18, 0x02 ; 2 1a448: 48 e0 ldi r20, 0x08 ; 8 1a44a: 51 ef ldi r21, 0xF1 ; 241 1a44c: be 01 movw r22, r28 1a44e: d9 cf rjmp .-78 ; 0x1a402 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 1a450: 81 e1 ldi r24, 0x11 ; 17 1a452: 9c e5 ldi r25, 0x5C ; 92 1a454: e0 cf rjmp .-64 ; 0x1a416 } else { if (bDesync) 1a456: 98 17 cp r25, r24 1a458: a9 f0 breq .+42 ; 0x1a484 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 1a45a: 8f ea ldi r24, 0xAF ; 175 1a45c: 97 e4 ldi r25, 0x47 ; 71 1a45e: 0e 94 2c 72 call 0xe458 ; 0xe458 1a462: 22 e0 ldi r18, 0x02 ; 2 1a464: 48 e0 ldi r20, 0x08 ; 8 1a466: 51 ef ldi r21, 0xF1 ; 241 1a468: 63 e1 ldi r22, 0x13 ; 19 1a46a: 79 e8 ldi r23, 0x89 ; 137 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 1a46c: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 1a470: 80 e8 ldi r24, 0x80 ; 128 1a472: 93 e4 ldi r25, 0x43 ; 67 1a474: 0e 94 2c 72 call 0xe458 ; 0xe458 1a478: 22 e0 ldi r18, 0x02 ; 2 1a47a: 44 e1 ldi r20, 0x14 ; 20 1a47c: 50 ee ldi r21, 0xE0 ; 224 1a47e: 70 e0 ldi r23, 0x00 ; 0 1a480: 60 e0 ldi r22, 0x00 ; 0 1a482: d4 cf rjmp .-88 ; 0x1a42c { 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); 1a484: 86 e7 ldi r24, 0x76 ; 118 1a486: 93 e4 ldi r25, 0x43 ; 67 1a488: 0e 94 2c 72 call 0xe458 ; 0xe458 1a48c: ec 01 movw r28, r24 1a48e: 8f ea ldi r24, 0xAF ; 175 1a490: 97 e4 ldi r25, 0x47 ; 71 1a492: 0e 94 2c 72 call 0xe458 ; 0xe458 1a496: 22 e0 ldi r18, 0x02 ; 2 1a498: 48 e0 ldi r20, 0x08 ; 8 1a49a: 51 ef ldi r21, 0xF1 ; 241 1a49c: be 01 movw r22, r28 1a49e: e6 cf rjmp .-52 ; 0x1a46c 0001a4a0 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 1a4a0: cf 93 push r28 1a4a2: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 1a4a4: 86 ed ldi r24, 0xD6 ; 214 1a4a6: 9e e0 ldi r25, 0x0E ; 14 1a4a8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1a4ac: 81 30 cpi r24, 0x01 ; 1 1a4ae: c1 f5 brne .+112 ; 0x1a520 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 1a4b0: 87 e1 ldi r24, 0x17 ; 23 1a4b2: 9c e5 ldi r25, 0x5C ; 92 1a4b4: 0e 94 2c 72 call 0xe458 ; 0xe458 1a4b8: 22 e0 ldi r18, 0x02 ; 2 1a4ba: 46 eb ldi r20, 0xB6 ; 182 1a4bc: 59 e3 ldi r21, 0x39 ; 57 1a4be: bc 01 movw r22, r24 1a4c0: 8a ee ldi r24, 0xEA ; 234 1a4c2: 99 e6 ldi r25, 0x69 ; 105 1a4c4: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 1a4c8: 8e ec ldi r24, 0xCE ; 206 1a4ca: 9e e0 ldi r25, 0x0E ; 14 1a4cc: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1a4d0: 81 30 cpi r24, 0x01 ; 1 1a4d2: 49 f5 brne .+82 ; 0x1a526 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 1a4d4: 87 e1 ldi r24, 0x17 ; 23 1a4d6: 9c e5 ldi r25, 0x5C ; 92 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); 1a4d8: 0e 94 2c 72 call 0xe458 ; 0xe458 1a4dc: ec 01 movw r28, r24 1a4de: 8d e6 ldi r24, 0x6D ; 109 1a4e0: 93 e4 ldi r25, 0x43 ; 67 1a4e2: 0e 94 2c 72 call 0xe458 ; 0xe458 1a4e6: 22 e0 ldi r18, 0x02 ; 2 1a4e8: 44 e0 ldi r20, 0x04 ; 4 1a4ea: 59 e3 ldi r21, 0x39 ; 57 1a4ec: be 01 movw r22, r28 1a4ee: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba } #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); 1a4f2: 89 ea ldi r24, 0xA9 ; 169 1a4f4: 9d e0 ldi r25, 0x0D ; 13 1a4f6: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1a4fa: 88 23 and r24, r24 1a4fc: b9 f0 breq .+46 ; 0x1a52c 1a4fe: 86 e7 ldi r24, 0x76 ; 118 1a500: 93 e4 ldi r25, 0x43 ; 67 1a502: 0e 94 2c 72 call 0xe458 ; 0xe458 1a506: ec 01 movw r28, r24 1a508: 82 e6 ldi r24, 0x62 ; 98 1a50a: 93 e4 ldi r25, 0x43 ; 67 1a50c: 0e 94 2c 72 call 0xe458 ; 0xe458 1a510: 22 e0 ldi r18, 0x02 ; 2 1a512: 40 eb ldi r20, 0xB0 ; 176 1a514: 51 ed ldi r21, 0xD1 ; 209 1a516: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 1a518: df 91 pop r29 1a51a: 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); 1a51c: 0d 94 5d d3 jmp 0x3a6ba ; 0x3a6ba #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); 1a520: 81 e1 ldi r24, 0x11 ; 17 1a522: 9c e5 ldi r25, 0x5C ; 92 1a524: c7 cf rjmp .-114 ; 0x1a4b4 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); 1a526: 81 e1 ldi r24, 0x11 ; 17 1a528: 9c e5 ldi r25, 0x5C ; 92 1a52a: d6 cf rjmp .-84 ; 0x1a4d8 } #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); 1a52c: 8c e2 ldi r24, 0x2C ; 44 1a52e: 94 e4 ldi r25, 0x44 ; 68 1a530: e8 cf rjmp .-48 ; 0x1a502 0001a532 : 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) 1a532: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1a536: 88 23 and r24, r24 1a538: 21 f0 breq .+8 ; 0x1a542 1a53a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a53e: 88 23 and r24, r24 1a540: 51 f0 breq .+20 ; 0x1a556 { _md->status = 1; 1a542: 81 e0 ldi r24, 0x01 ; 1 1a544: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 1a548: 60 e0 ldi r22, 0x00 ; 0 1a54a: 8a e2 ldi r24, 0x2A ; 42 1a54c: 9d e0 ldi r25, 0x0D ; 13 1a54e: 0e 94 89 75 call 0xeb12 ; 0xeb12 1a552: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } MENU_BEGIN(); 1a556: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1a55a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a55e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a562: 84 30 cpi r24, 0x04 ; 4 1a564: 08 f0 brcs .+2 ; 0x1a568 1a566: 76 c0 rjmp .+236 ; 0x1a654 1a568: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 1a56c: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 1a570: 81 11 cpse r24, r1 1a572: 3f c0 rjmp .+126 ; 0x1a5f2 1a574: 8f e4 ldi r24, 0x4F ; 79 1a576: 99 e4 ldi r25, 0x49 ; 73 1a578: 0e 94 2c 72 call 0xe458 ; 0xe458 1a57c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 1a580: 80 ec ldi r24, 0xC0 ; 192 1a582: 95 e4 ldi r25, 0x45 ; 69 1a584: 0e 94 2c 72 call 0xe458 ; 0xe458 1a588: 66 ee ldi r22, 0xE6 ; 230 1a58a: 72 ee ldi r23, 0xE2 ; 226 1a58c: 0f 94 4c d4 call 0x3a898 ; 0x3a898 SETTINGS_NOZZLE; 1a590: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1a594: 8c 33 cpi r24, 0x3C ; 60 1a596: 09 f4 brne .+2 ; 0x1a59a 1a598: 49 c0 rjmp .+146 ; 0x1a62c 1a59a: 70 f5 brcc .+92 ; 0x1a5f8 1a59c: 89 31 cpi r24, 0x19 ; 25 1a59e: d1 f1 breq .+116 ; 0x1a614 1a5a0: 88 32 cpi r24, 0x28 ; 40 1a5a2: 71 f1 breq .+92 ; 0x1a600 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 1a5a4: 83 e0 ldi r24, 0x03 ; 3 1a5a6: 94 e4 ldi r25, 0x44 ; 68 1a5a8: 0e 94 2c 72 call 0xe458 ; 0xe458 1a5ac: 69 e8 ldi r22, 0x89 ; 137 1a5ae: 7f ec ldi r23, 0xCF ; 207 1a5b0: 0f 94 4b d1 call 0x3a296 ; 0x3a296 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 1a5b4: 8a ef ldi r24, 0xFA ; 250 1a5b6: 93 e4 ldi r25, 0x43 ; 67 1a5b8: 0e 94 2c 72 call 0xe458 ; 0xe458 1a5bc: 61 ee ldi r22, 0xE1 ; 225 1a5be: 74 ed ldi r23, 0xD4 ; 212 1a5c0: 0f 94 4c d4 call 0x3a898 ; 0x3a898 //! 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); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (_md->experimental_menu_visibility) 1a5c4: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1a5c8: 88 23 and r24, r24 1a5ca: 31 f0 breq .+12 ; 0x1a5d8 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 1a5cc: 6f eb ldi r22, 0xBF ; 191 1a5ce: 70 ef ldi r23, 0xF0 ; 240 1a5d0: 8d e1 ldi r24, 0x1D ; 29 1a5d2: 99 e8 ldi r25, 0x89 ; 137 1a5d4: 0f 94 4c d4 call 0x3a898 ; 0x3a898 //! //! 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(); 1a5d8: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 1a5dc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a5e0: 8f 5f subi r24, 0xFF ; 255 1a5e2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a5e6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a5ea: 8f 5f subi r24, 0xFF ; 255 1a5ec: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a5f0: b6 cf rjmp .-148 ; 0x1a55e MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 1a5f2: 8a ee ldi r24, 0xEA ; 234 1a5f4: 97 e4 ldi r25, 0x47 ; 71 1a5f6: c0 cf rjmp .-128 ; 0x1a578 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 1a5f8: 80 35 cpi r24, 0x50 ; 80 1a5fa: 11 f1 breq .+68 ; 0x1a640 1a5fc: 8f 3f cpi r24, 0xFF ; 255 1a5fe: 91 f6 brne .-92 ; 0x1a5a4 1a600: 8a e6 ldi r24, 0x6A ; 106 1a602: 96 e4 ldi r25, 0x46 ; 70 1a604: 0e 94 2c 72 call 0xe458 ; 0xe458 1a608: 22 e0 ldi r18, 0x02 ; 2 1a60a: 4d ee ldi r20, 0xED ; 237 1a60c: 50 ed ldi r21, 0xD0 ; 208 1a60e: 64 e3 ldi r22, 0x34 ; 52 1a610: 79 e8 ldi r23, 0x89 ; 137 1a612: 09 c0 rjmp .+18 ; 0x1a626 1a614: 8a e6 ldi r24, 0x6A ; 106 1a616: 96 e4 ldi r25, 0x46 ; 70 1a618: 0e 94 2c 72 call 0xe458 ; 0xe458 1a61c: 22 e0 ldi r18, 0x02 ; 2 1a61e: 4d ee ldi r20, 0xED ; 237 1a620: 50 ed ldi r21, 0xD0 ; 208 1a622: 69 e3 ldi r22, 0x39 ; 57 1a624: 79 e8 ldi r23, 0x89 ; 137 1a626: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba 1a62a: bc cf rjmp .-136 ; 0x1a5a4 1a62c: 8a e6 ldi r24, 0x6A ; 106 1a62e: 96 e4 ldi r25, 0x46 ; 70 1a630: 0e 94 2c 72 call 0xe458 ; 0xe458 1a634: 22 e0 ldi r18, 0x02 ; 2 1a636: 4d ee ldi r20, 0xED ; 237 1a638: 50 ed ldi r21, 0xD0 ; 208 1a63a: 6f e2 ldi r22, 0x2F ; 47 1a63c: 79 e8 ldi r23, 0x89 ; 137 1a63e: f3 cf rjmp .-26 ; 0x1a626 1a640: 8a e6 ldi r24, 0x6A ; 106 1a642: 96 e4 ldi r25, 0x46 ; 70 1a644: 0e 94 2c 72 call 0xe458 ; 0xe458 1a648: 22 e0 ldi r18, 0x02 ; 2 1a64a: 4d ee ldi r20, 0xED ; 237 1a64c: 50 ed ldi r21, 0xD0 ; 208 1a64e: 6a e2 ldi r22, 0x2A ; 42 1a650: 79 e8 ldi r23, 0x89 ; 137 1a652: e9 cf rjmp .-46 ; 0x1a626 //! 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(); } 1a654: 08 95 ret 0001a656 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a656: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a658: 80 e0 ldi r24, 0x00 ; 0 1a65a: 98 e4 ldi r25, 0x48 ; 72 1a65c: 0e 94 2c 72 call 0xe458 ; 0xe458 1a660: ac 01 movw r20, r24 1a662: 60 e0 ldi r22, 0x00 ; 0 1a664: 80 e0 ldi r24, 0x00 ; 0 1a666: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_putc_at(0, 1, '\n'); 1a66a: 4a e0 ldi r20, 0x0A ; 10 1a66c: 61 e0 ldi r22, 0x01 ; 1 1a66e: 80 e0 ldi r24, 0x00 ; 0 1a670: 0e 94 80 6e call 0xdd00 ; 0xdd00 MENU_BEGIN(); 1a674: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1a678: 10 92 12 05 sts 0x0512, r1 ; 0x800512 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a67c: 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(); 1a67e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a682: 84 30 cpi r24, 0x04 ; 4 1a684: 18 f5 brcc .+70 ; 0x1a6cc 1a686: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a68a: 81 11 cpse r24, r1 1a68c: 02 c0 rjmp .+4 ; 0x1a692 1a68e: c0 93 12 05 sts 0x0512, r28 ; 0x800512 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1a692: 8b ef ldi r24, 0xFB ; 251 1a694: 97 e4 ldi r25, 0x47 ; 71 1a696: 0e 94 2c 72 call 0xe458 ; 0xe458 1a69a: 6c e2 ldi r22, 0x2C ; 44 1a69c: 7a e3 ldi r23, 0x3A ; 58 1a69e: 0f 94 4b d1 call 0x3a296 ; 0x3a296 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a6a2: 85 ef ldi r24, 0xF5 ; 245 1a6a4: 97 e4 ldi r25, 0x47 ; 71 1a6a6: 0e 94 2c 72 call 0xe458 ; 0xe458 1a6aa: 6b ec ldi r22, 0xCB ; 203 1a6ac: 75 ef ldi r23, 0xF5 ; 245 1a6ae: 0f 94 4b d1 call 0x3a296 ; 0x3a296 MENU_END(); 1a6b2: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a6b6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a6ba: 8f 5f subi r24, 0xFF ; 255 1a6bc: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a6c0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a6c4: 8f 5f subi r24, 0xFF ; 255 1a6c6: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a6ca: d9 cf rjmp .-78 ; 0x1a67e // 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(); } 1a6cc: cf 91 pop r28 1a6ce: 08 95 ret 0001a6d0 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1a6d0: cf 93 push r28 1a6d2: df 93 push r29 MENU_BEGIN(); 1a6d4: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1a6d8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a6dc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a6e0: 84 30 cpi r24, 0x04 ; 4 1a6e2: 08 f0 brcs .+2 ; 0x1a6e6 1a6e4: bd c0 rjmp .+378 ; 0x1a860 1a6e6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1a6ea: 8f e4 ldi r24, 0x4F ; 79 1a6ec: 99 e4 ldi r25, 0x49 ; 73 1a6ee: 0e 94 2c 72 call 0xe458 ; 0xe458 1a6f2: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1a6f6: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1a6fa: 88 23 and r24, r24 1a6fc: 09 f4 brne .+2 ; 0x1a700 1a6fe: 4e c0 rjmp .+156 ; 0x1a79c 1a700: 87 e1 ldi r24, 0x17 ; 23 1a702: 9c e5 ldi r25, 0x5C ; 92 1a704: 0e 94 2c 72 call 0xe458 ; 0xe458 1a708: ec 01 movw r28, r24 1a70a: 8b e4 ldi r24, 0x4B ; 75 1a70c: 97 e4 ldi r25, 0x47 ; 71 1a70e: 0e 94 2c 72 call 0xe458 ; 0xe458 1a712: 22 e0 ldi r18, 0x02 ; 2 1a714: 4d e8 ldi r20, 0x8D ; 141 1a716: 51 ed ldi r21, 0xD1 ; 209 1a718: be 01 movw r22, r28 1a71a: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba 1a71e: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa if (fsensor.isEnabled()) { 1a722: 88 23 and r24, r24 1a724: 09 f4 brne .+2 ; 0x1a728 1a726: 8c c0 rjmp .+280 ; 0x1a840 if (fsensor.isError()) { 1a728: 83 30 cpi r24, 0x03 ; 3 1a72a: d9 f5 brne .+118 ; 0x1a7a2 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 1a72c: 8a e8 ldi r24, 0x8A ; 138 1a72e: 97 e4 ldi r25, 0x47 ; 71 1a730: 0e 94 2c 72 call 0xe458 ; 0xe458 1a734: ec 01 movw r28, r24 1a736: 86 e5 ldi r24, 0x56 ; 86 1a738: 93 e4 ldi r25, 0x43 ; 67 1a73a: 0e 94 2c 72 call 0xe458 ; 0xe458 1a73e: 22 e0 ldi r18, 0x02 ; 2 1a740: 43 ee ldi r20, 0xE3 ; 227 1a742: 5f ec ldi r21, 0xCF ; 207 1a744: be 01 movw r22, r28 1a746: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 1a74a: 8a e8 ldi r24, 0x8A ; 138 1a74c: 97 e4 ldi r25, 0x47 ; 71 1a74e: 0e 94 2c 72 call 0xe458 ; 0xe458 1a752: ec 01 movw r28, r24 1a754: 88 e4 ldi r24, 0x48 ; 72 1a756: 93 e4 ldi r25, 0x43 ; 67 1a758: 0e 94 2c 72 call 0xe458 ; 0xe458 1a75c: 22 e0 ldi r18, 0x02 ; 2 1a75e: 43 ee ldi r20, 0xE3 ; 227 1a760: 5f ec ldi r21, 0xCF ; 207 1a762: be 01 movw r22, r28 1a764: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); 1a768: 8a e8 ldi r24, 0x8A ; 138 1a76a: 97 e4 ldi r25, 0x47 ; 71 1a76c: 0e 94 2c 72 call 0xe458 ; 0xe458 1a770: ec 01 movw r28, r24 1a772: 88 e3 ldi r24, 0x38 ; 56 1a774: 93 e4 ldi r25, 0x43 ; 67 1a776: 0e 94 2c 72 call 0xe458 ; 0xe458 1a77a: 22 e0 ldi r18, 0x02 ; 2 1a77c: 43 ee ldi r20, 0xE3 ; 227 1a77e: 5f ec ldi r21, 0xCF ; 207 } 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); #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); 1a780: be 01 movw r22, r28 1a782: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 1a786: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 1a78a: 88 23 and r24, r24 1a78c: 09 f4 brne .+2 ; 0x1a790 1a78e: 49 c0 rjmp .+146 ; 0x1a822 1a790: 81 30 cpi r24, 0x01 ; 1 1a792: 09 f4 brne .+2 ; 0x1a796 1a794: 62 c0 rjmp .+196 ; 0x1a85a 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(); 1a796: 0e 94 7c d0 call 0x1a0f8 ; 0x1a0f8 1a79a: 52 c0 rjmp .+164 ; 0x1a840 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); 1a79c: 81 e1 ldi r24, 0x11 ; 17 1a79e: 9c e5 ldi r25, 0x5C ; 92 1a7a0: b1 cf rjmp .-158 ; 0x1a704 #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); 1a7a2: 80 91 ac 17 lds r24, 0x17AC ; 0x8017ac 1a7a6: 88 23 and r24, r24 1a7a8: 99 f1 breq .+102 ; 0x1a810 1a7aa: 87 e1 ldi r24, 0x17 ; 23 1a7ac: 9c e5 ldi r25, 0x5C ; 92 1a7ae: 0e 94 2c 72 call 0xe458 ; 0xe458 1a7b2: ec 01 movw r28, r24 1a7b4: 86 e5 ldi r24, 0x56 ; 86 1a7b6: 93 e4 ldi r25, 0x43 ; 67 1a7b8: 0e 94 2c 72 call 0xe458 ; 0xe458 1a7bc: 22 e0 ldi r18, 0x02 ; 2 1a7be: 42 e9 ldi r20, 0x92 ; 146 1a7c0: 50 ed ldi r21, 0xD0 ; 208 1a7c2: be 01 movw r22, r28 1a7c4: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1a7c8: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1a7cc: 88 23 and r24, r24 1a7ce: 19 f1 breq .+70 ; 0x1a816 1a7d0: 87 e1 ldi r24, 0x17 ; 23 1a7d2: 9c e5 ldi r25, 0x5C ; 92 1a7d4: 0e 94 2c 72 call 0xe458 ; 0xe458 1a7d8: ec 01 movw r28, r24 1a7da: 88 e4 ldi r24, 0x48 ; 72 1a7dc: 93 e4 ldi r25, 0x43 ; 67 1a7de: 0e 94 2c 72 call 0xe458 ; 0xe458 1a7e2: 22 e0 ldi r18, 0x02 ; 2 1a7e4: 48 e8 ldi r20, 0x88 ; 136 1a7e6: 50 ed ldi r21, 0xD0 ; 208 1a7e8: be 01 movw r22, r28 1a7ea: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #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); 1a7ee: 80 91 b8 17 lds r24, 0x17B8 ; 0x8017b8 1a7f2: 88 23 and r24, r24 1a7f4: 99 f0 breq .+38 ; 0x1a81c 1a7f6: 87 e1 ldi r24, 0x17 ; 23 1a7f8: 9c e5 ldi r25, 0x5C ; 92 1a7fa: 0e 94 2c 72 call 0xe458 ; 0xe458 1a7fe: ec 01 movw r28, r24 1a800: 88 e3 ldi r24, 0x38 ; 56 1a802: 93 e4 ldi r25, 0x43 ; 67 1a804: 0e 94 2c 72 call 0xe458 ; 0xe458 1a808: 22 e0 ldi r18, 0x02 ; 2 1a80a: 44 e9 ldi r20, 0x94 ; 148 1a80c: 51 ed ldi r21, 0xD1 ; 209 1a80e: b8 cf rjmp .-144 ; 0x1a780 #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); 1a810: 81 e1 ldi r24, 0x11 ; 17 1a812: 9c e5 ldi r25, 0x5C ; 92 1a814: cc cf rjmp .-104 ; 0x1a7ae MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1a816: 81 e1 ldi r24, 0x11 ; 17 1a818: 9c e5 ldi r25, 0x5C ; 92 1a81a: dc cf rjmp .-72 ; 0x1a7d4 #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); 1a81c: 81 e1 ldi r24, 0x11 ; 17 1a81e: 9c e5 ldi r25, 0x5C ; 92 1a820: ec cf rjmp .-40 ; 0x1a7fa #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); 1a822: 80 e3 ldi r24, 0x30 ; 48 1a824: 93 e4 ldi r25, 0x43 ; 67 break; case Filament_sensor::SensorActionOnError::_Pause: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_PAUSE), lcd_fsensor_actionNA_set); 1a826: 0e 94 2c 72 call 0xe458 ; 0xe458 1a82a: ec 01 movw r28, r24 1a82c: 84 e2 ldi r24, 0x24 ; 36 1a82e: 93 e4 ldi r25, 0x43 ; 67 1a830: 0e 94 2c 72 call 0xe458 ; 0xe458 1a834: 22 e0 ldi r18, 0x02 ; 2 1a836: 4c e7 ldi r20, 0x7C ; 124 1a838: 50 ed ldi r21, 0xD0 ; 208 1a83a: be 01 movw r22, r28 1a83c: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1a840: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1a844: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a848: 8f 5f subi r24, 0xFF ; 255 1a84a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a84e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a852: 8f 5f subi r24, 0xFF ; 255 1a854: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a858: 41 cf rjmp .-382 ; 0x1a6dc 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); 1a85a: 8c e1 ldi r24, 0x1C ; 28 1a85c: 93 e4 ldi r25, 0x43 ; 67 1a85e: e3 cf rjmp .-58 ; 0x1a826 lcd_fsensor_actionNA_set(); } } MENU_END(); } 1a860: df 91 pop r29 1a862: cf 91 pop r28 1a864: 08 95 ret 0001a866 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a866: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1a86a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a86e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a872: 84 30 cpi r24, 0x04 ; 4 1a874: 08 f0 brcs .+2 ; 0x1a878 1a876: 3f c0 rjmp .+126 ; 0x1a8f6 1a878: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a87c: 80 ec ldi r24, 0xC0 ; 192 1a87e: 95 e4 ldi r25, 0x45 ; 69 1a880: 0e 94 2c 72 call 0xe458 ; 0xe458 1a884: 0f 94 99 d4 call 0x3a932 ; 0x3a932 if(eeprom_is_sheet_initialized(selected_sheet)){ 1a888: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1a88c: 0e 94 c1 75 call 0xeb82 ; 0xeb82 1a890: 88 23 and r24, r24 1a892: 41 f0 breq .+16 ; 0x1a8a4 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a894: 87 eb ldi r24, 0xB7 ; 183 1a896: 95 e4 ldi r25, 0x45 ; 69 1a898: 0e 94 2c 72 call 0xe458 ; 0xe458 1a89c: 60 eb ldi r22, 0xB0 ; 176 1a89e: 71 ee ldi r23, 0xE1 ; 225 1a8a0: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } if (lcd_commands_type == LcdCommands::Idle) 1a8a4: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1a8a8: 81 11 cpse r24, r1 1a8aa: 08 c0 rjmp .+16 ; 0x1a8bc { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a8ac: 84 ea ldi r24, 0xA4 ; 164 1a8ae: 95 e4 ldi r25, 0x45 ; 69 1a8b0: 0e 94 2c 72 call 0xe458 ; 0xe458 1a8b4: 67 e4 ldi r22, 0x47 ; 71 1a8b6: 70 ef ldi r23, 0xF0 ; 240 1a8b8: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a8bc: 8b e9 ldi r24, 0x9B ; 155 1a8be: 95 e4 ldi r25, 0x45 ; 69 1a8c0: 0e 94 2c 72 call 0xe458 ; 0xe458 1a8c4: 6d e6 ldi r22, 0x6D ; 109 1a8c6: 7c ed ldi r23, 0xDC ; 220 1a8c8: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a8cc: 83 e9 ldi r24, 0x93 ; 147 1a8ce: 95 e4 ldi r25, 0x45 ; 69 1a8d0: 0e 94 2c 72 call 0xe458 ; 0xe458 1a8d4: 69 e2 ldi r22, 0x29 ; 41 1a8d6: 7f ee ldi r23, 0xEF ; 239 1a8d8: 0f 94 4b d1 call 0x3a296 ; 0x3a296 MENU_END(); 1a8dc: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a8e0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a8e4: 8f 5f subi r24, 0xFF ; 255 1a8e6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a8ea: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a8ee: 8f 5f subi r24, 0xFF ; 255 1a8f0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a8f4: bc cf rjmp .-136 ; 0x1a86e } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a8f6: 08 95 ret 0001a8f8 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a8f8: 87 e0 ldi r24, 0x07 ; 7 1a8fa: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a8fe: 0c 94 33 d4 jmp 0x1a866 ; 0x1a866 0001a902 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a902: 86 e0 ldi r24, 0x06 ; 6 1a904: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a908: 0c 94 33 d4 jmp 0x1a866 ; 0x1a866 0001a90c ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a90c: 85 e0 ldi r24, 0x05 ; 5 1a90e: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a912: 0c 94 33 d4 jmp 0x1a866 ; 0x1a866 0001a916 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a916: 84 e0 ldi r24, 0x04 ; 4 1a918: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a91c: 0c 94 33 d4 jmp 0x1a866 ; 0x1a866 0001a920 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a920: 83 e0 ldi r24, 0x03 ; 3 1a922: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a926: 0c 94 33 d4 jmp 0x1a866 ; 0x1a866 0001a92a ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a92a: 82 e0 ldi r24, 0x02 ; 2 1a92c: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a930: 0c 94 33 d4 jmp 0x1a866 ; 0x1a866 0001a934 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a934: 81 e0 ldi r24, 0x01 ; 1 1a936: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a93a: 0c 94 33 d4 jmp 0x1a866 ; 0x1a866 0001a93e ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a93e: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_sheet_menu(); 1a942: 0c 94 33 d4 jmp 0x1a866 ; 0x1a866 0001a946 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1a946: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1a94a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a94e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a952: 84 30 cpi r24, 0x04 ; 4 1a954: a8 f5 brcc .+106 ; 0x1a9c0 1a956: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a95a: 8a ee ldi r24, 0xEA ; 234 1a95c: 97 e4 ldi r25, 0x47 ; 71 1a95e: 0e 94 2c 72 call 0xe458 ; 0xe458 1a962: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1a966: 8f e4 ldi r24, 0x4F ; 79 1a968: 9a e3 ldi r25, 0x3A ; 58 1a96a: 0e 94 2c 72 call 0xe458 ; 0xe458 1a96e: 62 e3 ldi r22, 0x32 ; 50 1a970: 79 e3 ldi r23, 0x39 ; 57 1a972: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1a976: 86 e4 ldi r24, 0x46 ; 70 1a978: 9a e3 ldi r25, 0x3A ; 58 1a97a: 0e 94 2c 72 call 0xe458 ; 0xe458 1a97e: 66 e8 ldi r22, 0x86 ; 134 1a980: 7a e3 ldi r23, 0x3A ; 58 1a982: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1a986: 8d e3 ldi r24, 0x3D ; 61 1a988: 9a e3 ldi r25, 0x3A ; 58 1a98a: 0e 94 2c 72 call 0xe458 ; 0xe458 1a98e: 6e ed ldi r22, 0xDE ; 222 1a990: 79 e3 ldi r23, 0x39 ; 57 1a992: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1a996: 82 e3 ldi r24, 0x32 ; 50 1a998: 9a e3 ldi r25, 0x3A ; 58 1a99a: 0e 94 2c 72 call 0xe458 ; 0xe458 1a99e: 68 ec ldi r22, 0xC8 ; 200 1a9a0: 7a e3 ldi r23, 0x3A ; 58 1a9a2: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_END(); 1a9a6: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1a9aa: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a9ae: 8f 5f subi r24, 0xFF ; 255 1a9b0: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a9b4: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a9b8: 8f 5f subi r24, 0xFF ; 255 1a9ba: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a9be: c7 cf rjmp .-114 ; 0x1a94e 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(); } 1a9c0: 08 95 ret 0001a9c2 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1a9c2: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1a9c6: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a9ca: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a9ce: 84 30 cpi r24, 0x04 ; 4 1a9d0: d8 f5 brcc .+118 ; 0x1aa48 1a9d2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1a9d6: 8e e6 ldi r24, 0x6E ; 110 1a9d8: 94 e4 ldi r25, 0x44 ; 68 1a9da: 0e 94 2c 72 call 0xe458 ; 0xe458 1a9de: 0f 94 99 d4 call 0x3a932 ; 0x3a932 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 1a9e2: 84 eb ldi r24, 0xB4 ; 180 1a9e4: 93 e4 ldi r25, 0x43 ; 67 1a9e6: 0e 94 2c 72 call 0xe458 ; 0xe458 1a9ea: 42 e7 ldi r20, 0x72 ; 114 1a9ec: 50 ed ldi r21, 0xD0 ; 208 1a9ee: bc 01 movw r22, r24 1a9f0: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 1a9f4: 0e 94 b4 d1 call 0x1a368 ; 0x1a368 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 1a9f8: 8c ea ldi r24, 0xAC ; 172 1a9fa: 93 e4 ldi r25, 0x43 ; 67 1a9fc: 0e 94 2c 72 call 0xe458 ; 0xe458 1aa00: 48 e6 ldi r20, 0x68 ; 104 1aa02: 50 ed ldi r21, 0xD0 ; 208 1aa04: bc 01 movw r22, r24 1aa06: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 1aa0a: 0e 94 b4 d1 call 0x1a368 ; 0x1a368 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 1aa0e: 4e e5 ldi r20, 0x5E ; 94 1aa10: 50 ed ldi r21, 0xD0 ; 208 1aa12: 64 ef ldi r22, 0xF4 ; 244 1aa14: 79 e6 ldi r23, 0x69 ; 105 1aa16: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 1aa1a: 0e 94 b4 d1 call 0x1a368 ; 0x1a368 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 1aa1e: 44 e5 ldi r20, 0x54 ; 84 1aa20: 50 ed ldi r21, 0xD0 ; 208 1aa22: 6a e1 ldi r22, 0x1A ; 26 1aa24: 7d e6 ldi r23, 0x6D ; 109 1aa26: 80 91 e7 04 lds r24, 0x04E7 ; 0x8004e7 1aa2a: 0e 94 b4 d1 call 0x1a368 ; 0x1a368 MENU_END(); 1aa2e: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1aa32: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1aa36: 8f 5f subi r24, 0xFF ; 255 1aa38: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1aa3c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1aa40: 8f 5f subi r24, 0xFF ; 255 1aa42: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1aa46: c1 cf rjmp .-126 ; 0x1a9ca 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(); } 1aa48: 08 95 ret 0001aa4a : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1aa4a: 0e 94 63 88 call 0x110c6 ; 0x110c6 // M24: Start/resume SD print enquecommand_P(MSG_M24); 1aa4e: 61 e0 ldi r22, 0x01 ; 1 1aa50: 8c e4 ldi r24, 0x4C ; 76 1aa52: 90 e7 ldi r25, 0x70 ; 112 1aa54: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_return_to_status(); 1aa58: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 0001aa5c : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1aa5c: cf 93 push r28 1aa5e: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1aa60: 8c ed ldi r24, 0xDC ; 220 1aa62: 93 e0 ldi r25, 0x03 ; 3 1aa64: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1aa68: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 1aa6c: 81 11 cpse r24, r1 1aa6e: 18 c0 rjmp .+48 ; 0x1aaa0 1aa70: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 1aa74: 81 11 cpse r24, r1 1aa76: 14 c0 rjmp .+40 ; 0x1aaa0 1aa78: c0 91 13 04 lds r28, 0x0413 ; 0x800413 1aa7c: d0 91 14 04 lds r29, 0x0414 ; 0x800414 1aa80: 8a e3 ldi r24, 0x3A ; 58 1aa82: c8 38 cpi r28, 0x88 ; 136 1aa84: d8 07 cpc r29, r24 1aa86: 61 f0 breq .+24 ; 0x1aaa0 1aa88: 89 e3 ldi r24, 0x39 ; 57 1aa8a: ce 3d cpi r28, 0xDE ; 222 1aa8c: d8 07 cpc r29, r24 1aa8e: 41 f0 breq .+16 ; 0x1aaa0 1aa90: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 1aa94: 81 11 cpse r24, r1 1aa96: 04 c0 rjmp .+8 ; 0x1aaa0 1aa98: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1aa9c: 88 23 and r24, r24 1aa9e: 31 f0 breq .+12 ; 0x1aaac { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1aaa0: 82 e0 ldi r24, 0x02 ; 2 1aaa2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1aaa6: df 91 pop r29 1aaa8: cf 91 pop r28 1aaaa: 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) 1aaac: 82 ed ldi r24, 0xD2 ; 210 1aaae: c9 39 cpi r28, 0x99 ; 153 1aab0: d8 07 cpc r29, r24 1aab2: 49 f4 brne .+18 ; 0x1aac6 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1aab4: 82 e0 ldi r24, 0x02 ; 2 1aab6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1aaba: 8a e2 ldi r24, 0x2A ; 42 1aabc: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1aabe: df 91 pop r29 1aac0: 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); 1aac2: 0c 94 b4 75 jmp 0xeb68 ; 0xeb68 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); 1aac6: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1aaca: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 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 1aace: 98 13 cpse r25, r24 1aad0: 04 c0 rjmp .+8 ; 0x1aada 1aad2: 0e 94 10 67 call 0xce20 ; 0xce20 1aad6: 88 23 and r24, r24 1aad8: 61 f0 breq .+24 ; 0x1aaf2 if ( babystep_allowed_strict() 1aada: 0e 94 4b 67 call 0xce96 ; 0xce96 && (menu_menu == lcd_status_screen // and in listed menus... 1aade: 81 11 cpse r24, r1 1aae0: 10 c0 rjmp .+32 ; 0x1ab02 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1aae2: 82 e0 ldi r24, 0x02 ; 2 1aae4: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1aae8: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1aaea: df 91 pop r29 1aaec: cf 91 pop r28 1aaee: 0d 94 0c 4f jmp 0x29e18 ; 0x29e18 menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1aaf2: 8a e3 ldi r24, 0x3A ; 58 1aaf4: c6 32 cpi r28, 0x26 ; 38 1aaf6: d8 07 cpc r29, r24 1aaf8: e1 f4 brne .+56 ; 0x1ab32 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1aafa: 60 e0 ldi r22, 0x00 ; 0 1aafc: 8e ed ldi r24, 0xDE ; 222 1aafe: 99 e3 ldi r25, 0x39 ; 57 1ab00: 14 c0 rjmp .+40 ; 0x1ab2a // 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... 1ab02: 8a e3 ldi r24, 0x3A ; 58 1ab04: c6 32 cpi r28, 0x26 ; 38 1ab06: d8 07 cpc r29, r24 1ab08: 59 f0 breq .+22 ; 0x1ab20 || menu_menu == lcd_main_menu 1ab0a: 85 ed ldi r24, 0xD5 ; 213 1ab0c: c6 3b cpi r28, 0xB6 ; 182 1ab0e: d8 07 cpc r29, r24 1ab10: 39 f0 breq .+14 ; 0x1ab20 || menu_menu == lcd_tune_menu 1ab12: 8a ed ldi r24, 0xDA ; 218 1ab14: cb 36 cpi r28, 0x6B ; 107 1ab16: d8 07 cpc r29, r24 1ab18: 19 f0 breq .+6 ; 0x1ab20 || menu_menu == lcd_support_menu 1ab1a: c2 58 subi r28, 0x82 ; 130 1ab1c: da 43 sbci r29, 0x3A ; 58 1ab1e: 09 f7 brne .-62 ; 0x1aae2 ) ){ lcd_clear(); 1ab20: 0e 94 93 6e call 0xdd26 ; 0xdd26 menu_submenu(lcd_babystep_z); 1ab24: 60 e0 ldi r22, 0x00 ; 0 1ab26: 88 e8 ldi r24, 0x88 ; 136 1ab28: 9a e3 ldi r25, 0x3A ; 58 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1ab2a: df 91 pop r29 1ab2c: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1ab2e: 0d 94 3b d3 jmp 0x3a676 ; 0x3a676 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1ab32: 85 ed ldi r24, 0xD5 ; 213 1ab34: c6 3b cpi r28, 0xB6 ; 182 1ab36: d8 07 cpc r29, r24 1ab38: 01 f3 breq .-64 ; 0x1aafa || menu_menu == lcd_preheat_menu 1ab3a: 89 e3 ldi r24, 0x39 ; 57 1ab3c: cc 3b cpi r28, 0xBC ; 188 1ab3e: d8 07 cpc r29, r24 1ab40: e1 f2 breq .-72 ; 0x1aafa || menu_menu == lcd_sdcard_menu 1ab42: 82 ef ldi r24, 0xF2 ; 242 1ab44: cc 34 cpi r28, 0x4C ; 76 1ab46: d8 07 cpc r29, r24 1ab48: c1 f2 breq .-80 ; 0x1aafa || menu_menu == lcd_settings_menu 1ab4a: 88 ed ldi r24, 0xD8 ; 216 1ab4c: c6 30 cpi r28, 0x06 ; 6 1ab4e: d8 07 cpc r29, r24 1ab50: a1 f2 breq .-88 ; 0x1aafa || menu_menu == lcd_control_temperature_menu 1ab52: 8a ed ldi r24, 0xDA ; 218 1ab54: cb 34 cpi r28, 0x4B ; 75 1ab56: d8 07 cpc r29, r24 1ab58: 81 f2 breq .-96 ; 0x1aafa #if (LANG_MODE != 0) || menu_menu == lcd_language 1ab5a: 8b ed ldi r24, 0xDB ; 219 1ab5c: cf 32 cpi r28, 0x2F ; 47 1ab5e: d8 07 cpc r29, r24 1ab60: 61 f2 breq .-104 ; 0x1aafa #endif || menu_menu == lcd_support_menu 1ab62: c2 58 subi r28, 0x82 ; 130 1ab64: da 43 sbci r29, 0x3A ; 58 1ab66: 09 f0 breq .+2 ; 0x1ab6a 1ab68: bc cf rjmp .-136 ; 0x1aae2 1ab6a: c7 cf rjmp .-114 ; 0x1aafa 0001ab6c : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1ab6c: 1f 93 push r17 1ab6e: cf 93 push r28 1ab70: df 93 push r29 MENU_BEGIN(); 1ab72: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1ab76: 10 92 12 05 sts 0x0512, r1 ; 0x800512 #endif //SDSUPPORT if(!farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1ab7a: 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 1ab7c: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1ab7e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1ab82: 84 30 cpi r24, 0x04 ; 4 1ab84: 08 f0 brcs .+2 ; 0x1ab88 1ab86: 3e c2 rjmp .+1148 ; 0x1b004 1ab88: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1ab8c: 88 e0 ldi r24, 0x08 ; 8 1ab8e: 97 e4 ldi r25, 0x47 ; 71 1ab90: 0e 94 2c 72 call 0xe458 ; 0xe458 1ab94: 0f 94 99 d4 call 0x3a932 ; 0x3a932 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)) { 1ab98: 0e 94 61 67 call 0xcec2 ; 0xcec2 1ab9c: 81 11 cpse r24, r1 1ab9e: 19 c0 rjmp .+50 ; 0x1abd2 1aba0: 0e 94 fb 66 call 0xcdf6 ; 0xcdf6 1aba4: 81 11 cpse r24, r1 1aba6: 15 c0 rjmp .+42 ; 0x1abd2 1aba8: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 1abac: 81 11 cpse r24, r1 1abae: 11 c0 rjmp .+34 ; 0x1abd2 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1abb0: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.403> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1abb4: 83 30 cpi r24, 0x03 ; 3 1abb6: 09 f0 breq .+2 ; 0x1abba 1abb8: 51 c0 rjmp .+162 ; 0x1ac5c 1abba: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1abbe: 88 23 and r24, r24 1abc0: 41 f0 breq .+16 ; 0x1abd2 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1abc2: 8e ef ldi r24, 0xFE ; 254 1abc4: 96 e4 ldi r25, 0x46 ; 70 1abc6: 0e 94 2c 72 call 0xe458 ; 0xe458 1abca: 65 e2 ldi r22, 0x25 ; 37 1abcc: 75 ed ldi r23, 0xD5 ; 213 } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) { MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1abce: 0f 94 4b d1 call 0x3a296 ; 0x3a296 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1abd2: 0e 94 4b 67 call 0xce96 ; 0xce96 1abd6: 88 23 and r24, r24 1abd8: 81 f0 breq .+32 ; 0x1abfa 1abda: 0e 94 10 67 call 0xce20 ; 0xce20 1abde: 81 11 cpse r24, r1 1abe0: 04 c0 rjmp .+8 ; 0x1abea 1abe2: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1abe6: 84 30 cpi r24, 0x04 ; 4 1abe8: 41 f4 brne .+16 ; 0x1abfa MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1abea: 8e ee ldi r24, 0xEE ; 238 1abec: 96 e4 ldi r25, 0x46 ; 70 1abee: 0e 94 2c 72 call 0xe458 ; 0xe458 1abf2: 68 e8 ldi r22, 0x88 ; 136 1abf4: 7a e3 ldi r23, 0x3A ; 58 1abf6: 0f 94 4c d4 call 0x3a898 ; 0x3a898 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1abfa: 0e 94 fb 66 call 0xcdf6 ; 0xcdf6 1abfe: 81 11 cpse r24, r1 1ac00: 61 c0 rjmp .+194 ; 0x1acc4 } //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); 1ac02: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1ac06: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 1ac0a: 89 1b sub r24, r25 1ac0c: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1ac0e: a9 f5 brne .+106 ; 0x1ac7a if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1ac10: 0e 94 61 67 call 0xcec2 ; 0xcec2 1ac14: 81 11 cpse r24, r1 1ac16: 31 c0 rjmp .+98 ; 0x1ac7a #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1ac18: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1ac1c: 82 30 cpi r24, 0x02 ; 2 1ac1e: 69 f1 breq .+90 ; 0x1ac7a #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1ac20: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ac24: 81 11 cpse r24, r1 1ac26: 31 c0 rjmp .+98 ; 0x1ac8a MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1ac28: 8d ed ldi r24, 0xDD ; 221 1ac2a: 96 e4 ldi r25, 0x46 ; 70 1ac2c: 0e 94 2c 72 call 0xe458 ; 0xe458 1ac30: 6c eb ldi r22, 0xBC ; 188 1ac32: 79 e3 ldi r23, 0x39 ; 57 1ac34: 0f 94 4c d4 call 0x3a898 ; 0x3a898 if (M79_timer_get_status()) { 1ac38: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.452> 1ac3c: 88 23 and r24, r24 1ac3e: 29 f1 breq .+74 ; 0x1ac8a #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1ac40: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 1ac44: 81 30 cpi r24, 0x01 ; 1 1ac46: 09 f0 breq .+2 ; 0x1ac4a 1ac48: 7e c0 rjmp .+252 ; 0x1ad46 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1ac4a: 8d ec ldi r24, 0xCD ; 205 1ac4c: 96 e4 ldi r25, 0x46 ; 70 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1ac4e: 0e 94 2c 72 call 0xe458 ; 0xe458 1ac52: 6e ea ldi r22, 0xAE ; 174 1ac54: 7e ec ldi r23, 0xCE ; 206 1ac56: 0f 94 4b d1 call 0x3a296 ; 0x3a296 1ac5a: 17 c0 rjmp .+46 ; 0x1ac8a // 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()) { 1ac5c: 84 30 cpi r24, 0x04 ; 4 1ac5e: 09 f0 breq .+2 ; 0x1ac62 1ac60: b8 cf rjmp .-144 ; 0x1abd2 1ac62: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.452> 1ac66: 88 23 and r24, r24 1ac68: 09 f4 brne .+2 ; 0x1ac6c 1ac6a: b3 cf rjmp .-154 ; 0x1abd2 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1ac6c: 8e ef ldi r24, 0xFE ; 254 1ac6e: 96 e4 ldi r25, 0x46 ; 70 1ac70: 0e 94 2c 72 call 0xe458 ; 0xe458 1ac74: 68 ea ldi r22, 0xA8 ; 168 1ac76: 7e ec ldi r23, 0xCE ; 206 1ac78: aa cf rjmp .-172 ; 0x1abce 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); 1ac7a: 87 ee ldi r24, 0xE7 ; 231 1ac7c: 96 e4 ldi r25, 0x46 ; 70 1ac7e: 0e 94 2c 72 call 0xe458 ; 0xe458 1ac82: 6b e6 ldi r22, 0x6B ; 107 1ac84: 7a ed ldi r23, 0xDA ; 218 1ac86: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #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) { 1ac8a: c0 91 a8 0d lds r28, 0x0DA8 ; 0x800da8 1ac8e: 0e 94 05 67 call 0xce0a ; 0xce0a 1ac92: c1 11 cpse r28, r1 1ac94: 17 c0 rjmp .+46 ; 0x1acc4 1ac96: 90 91 a7 0d lds r25, 0x0DA7 ; 0x800da7 1ac9a: 91 11 cpse r25, r1 1ac9c: 13 c0 rjmp .+38 ; 0x1acc4 1ac9e: 81 11 cpse r24, r1 1aca0: 15 c0 rjmp .+42 ; 0x1accc 1aca2: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1aca6: 81 11 cpse r24, r1 1aca8: 0d c0 rjmp .+26 ; 0x1acc4 if (usb_timer.running()) { 1acaa: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1acae: 88 23 and r24, r24 1acb0: 09 f4 brne .+2 ; 0x1acb4 1acb2: 4c c0 rjmp .+152 ; 0x1ad4c MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1acb4: 83 eb ldi r24, 0xB3 ; 179 1acb6: 96 e4 ldi r25, 0x46 ; 70 1acb8: 0e 94 2c 72 call 0xe458 ; 0xe458 1acbc: 66 e8 ldi r22, 0x86 ; 134 1acbe: 79 e3 ldi r23, 0x39 ; 57 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1acc0: 0f 94 4b d1 call 0x3a296 ; 0x3a296 } } } if (printingIsPaused() 1acc4: 0e 94 05 67 call 0xce0a ; 0xce0a && !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) { 1acc8: 88 23 and r24, r24 1acca: f1 f0 breq .+60 ; 0x1ad08 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1accc: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 1acd0: 81 11 cpse r24, r1 1acd2: 1a c0 rjmp .+52 ; 0x1ad08 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1acd4: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1acd8: 82 30 cpi r24, 0x02 ; 2 1acda: b1 f0 breq .+44 ; 0x1ad08 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1acdc: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1ace0: 82 30 cpi r24, 0x02 ; 2 1ace2: 21 f4 brne .+8 ; 0x1acec 1ace4: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 1ace8: 99 23 and r25, r25 1acea: 71 f0 breq .+28 ; 0x1ad08 && custom_message_type != CustomMsg::Resuming) { 1acec: 90 91 c4 06 lds r25, 0x06C4 ; 0x8006c4 1acf0: 98 30 cpi r25, 0x08 ; 8 1acf2: 51 f0 breq .+20 ; 0x1ad08 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1acf4: 81 11 cpse r24, r1 1acf6: 36 c0 rjmp .+108 ; 0x1ad64 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1acf8: 84 ea ldi r24, 0xA4 ; 164 1acfa: 96 e4 ldi r25, 0x46 ; 70 1acfc: 0e 94 2c 72 call 0xe458 ; 0xe458 1ad00: 65 ef ldi r22, 0xF5 ; 245 1ad02: 78 ef ldi r23, 0xF8 ; 248 } 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); 1ad04: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1ad08: 0e 94 10 67 call 0xce20 ; 0xce20 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1ad0c: 81 11 cpse r24, r1 1ad0e: 08 c0 rjmp .+16 ; 0x1ad20 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())) 1ad10: 0e 94 05 67 call 0xce0a ; 0xce0a 1ad14: 81 11 cpse r24, r1 1ad16: 04 c0 rjmp .+8 ; 0x1ad20 1ad18: 0e 94 fb 66 call 0xcdf6 ; 0xcdf6 1ad1c: 88 23 and r24, r24 1ad1e: 41 f0 breq .+16 ; 0x1ad30 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1ad20: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 1ad24: 81 30 cpi r24, 0x01 ; 1 1ad26: 21 f0 breq .+8 ; 0x1ad30 1ad28: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1ad2c: 88 23 and r24, r24 1ad2e: 39 f1 breq .+78 ; 0x1ad7e MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1ad30: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ad34: 88 23 and r24, r24 1ad36: 59 f1 breq .+86 ; 0x1ad8e MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1ad38: 83 e9 ldi r24, 0x93 ; 147 1ad3a: 96 e4 ldi r25, 0x46 ; 70 1ad3c: 0e 94 2c 72 call 0xe458 ; 0xe458 1ad40: 6b ec ldi r22, 0xCB ; 203 1ad42: 75 ef ldi r23, 0xF5 ; 245 1ad44: 22 c0 rjmp .+68 ; 0x1ad8a 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); 1ad46: 81 ec ldi r24, 0xC1 ; 193 1ad48: 96 e4 ldi r25, 0x46 ; 70 1ad4a: 81 cf rjmp .-254 ; 0x1ac4e } } 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) { 1ad4c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 1ad50: 88 23 and r24, r24 1ad52: 09 f4 brne .+2 ; 0x1ad56 1ad54: b7 cf rjmp .-146 ; 0x1acc4 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1ad56: 83 eb ldi r24, 0xB3 ; 179 1ad58: 96 e4 ldi r25, 0x46 ; 70 1ad5a: 0e 94 2c 72 call 0xe458 ; 0xe458 1ad5e: 6c ec ldi r22, 0xCC ; 204 1ad60: 7a e3 ldi r23, 0x3A ; 58 1ad62: ae cf rjmp .-164 ; 0x1acc0 #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())) { 1ad64: 81 30 cpi r24, 0x01 ; 1 1ad66: 81 f6 brne .-96 ; 0x1ad08 1ad68: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.452> 1ad6c: 88 23 and r24, r24 1ad6e: 61 f2 breq .-104 ; 0x1ad08 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1ad70: 84 ea ldi r24, 0xA4 ; 164 1ad72: 96 e4 ldi r25, 0x46 ; 70 1ad74: 0e 94 2c 72 call 0xe458 ; 0xe458 1ad78: 64 e2 ldi r22, 0x24 ; 36 1ad7a: 79 ef ldi r23, 0xF9 ; 249 1ad7c: c3 cf rjmp .-122 ; 0x1ad04 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1ad7e: 80 e0 ldi r24, 0x00 ; 0 1ad80: 98 e4 ldi r25, 0x48 ; 72 1ad82: 0e 94 2c 72 call 0xe458 ; 0xe458 1ad86: 6b e2 ldi r22, 0x2B ; 43 1ad88: 73 ed ldi r23, 0xD3 ; 211 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1ad8a: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1ad8e: 0e 94 fb 66 call 0xcdf6 ; 0xcdf6 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ad92: 81 11 cpse r24, r1 1ad94: 9e c0 rjmp .+316 ; 0x1aed2 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() 1ad96: 0e 94 61 67 call 0xcec2 ; 0xcec2 1ad9a: 81 11 cpse r24, r1 1ad9c: 9a c0 rjmp .+308 ; 0x1aed2 1ad9e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 1ada2: 81 11 cpse r24, r1 1ada4: 96 c0 rjmp .+300 ; 0x1aed2 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ada6: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1adaa: 82 30 cpi r24, 0x02 ; 2 1adac: 09 f4 brne .+2 ; 0x1adb0 1adae: 91 c0 rjmp .+290 ; 0x1aed2 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1adb0: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1adb4: 81 11 cpse r24, r1 1adb6: 05 c0 rjmp .+10 ; 0x1adc2 || lcd_commands_type != LcdCommands::Idle) { 1adb8: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1adbc: 88 23 and r24, r24 1adbe: 09 f4 brne .+2 ; 0x1adc2 1adc0: b9 c0 rjmp .+370 ; 0x1af34 if (!card.isFileOpen()) { 1adc2: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1adc6: 81 11 cpse r24, r1 1adc8: 12 c0 rjmp .+36 ; 0x1adee if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1adca: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1adce: 81 11 cpse r24, r1 1add0: 0e c0 rjmp .+28 ; 0x1adee 1add2: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1add6: 81 11 cpse r24, r1 1add8: 0a c0 rjmp .+20 ; 0x1adee bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1adda: d0 93 e1 03 sts 0x03E1, r29 ; 0x8003e1 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1adde: 83 e8 ldi r24, 0x83 ; 131 1ade0: 96 e4 ldi r25, 0x46 ; 70 1ade2: 0e 94 2c 72 call 0xe458 ; 0xe458 1ade6: 6c e4 ldi r22, 0x4C ; 76 1ade8: 72 ef ldi r23, 0xF2 ; 242 1adea: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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)); 1adee: 81 ea ldi r24, 0xA1 ; 161 1adf0: 9d e0 ldi r25, 0x0D ; 13 1adf2: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1adf6: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1adf8: 0e 94 cf 75 call 0xeb9e ; 0xeb9e if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1adfc: 87 fd sbrc r24, 7 1adfe: 09 c0 rjmp .+18 ; 0x1ae12 1ae00: c8 17 cp r28, r24 1ae02: 39 f0 breq .+14 ; 0x1ae12 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1ae04: c1 02 muls r28, r17 1ae06: c0 01 movw r24, r0 1ae08: 11 24 eor r1, r1 1ae0a: 87 5b subi r24, 0xB7 ; 183 1ae0c: 92 4f sbci r25, 0xF2 ; 242 1ae0e: 0e 94 df ce call 0x19dbe ; 0x19dbe } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1ae12: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1ae16: 8c 33 cpi r24, 0x3C ; 60 1ae18: 09 f4 brne .+2 ; 0x1ae1c 1ae1a: b0 c0 rjmp .+352 ; 0x1af7c 1ae1c: 08 f0 brcs .+2 ; 0x1ae20 1ae1e: 93 c0 rjmp .+294 ; 0x1af46 1ae20: 89 31 cpi r24, 0x19 ; 25 1ae22: 09 f4 brne .+2 ; 0x1ae26 1ae24: 9f c0 rjmp .+318 ; 0x1af64 1ae26: 88 32 cpi r24, 0x28 ; 40 1ae28: 09 f4 brne .+2 ; 0x1ae2c 1ae2a: 92 c0 rjmp .+292 ; 0x1af50 #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1ae2c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1ae30: 81 11 cpse r24, r1 1ae32: 4f c0 rjmp .+158 ; 0x1aed2 1ae34: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ae38: 81 11 cpse r24, r1 1ae3a: 4b c0 rjmp .+150 ; 0x1aed2 if (MMU2::mmu2.Enabled()) { 1ae3c: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1ae40: 81 30 cpi r24, 0x01 ; 1 1ae42: 09 f0 breq .+2 ; 0x1ae46 1ae44: af c0 rjmp .+350 ; 0x1afa4 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1ae46: 80 91 90 13 lds r24, 0x1390 ; 0x801390 1ae4a: 81 11 cpse r24, r1 1ae4c: 0c c0 rjmp .+24 ; 0x1ae66 1ae4e: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ae52: 81 11 cpse r24, r1 1ae54: 08 c0 rjmp .+16 ; 0x1ae66 // 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); 1ae56: 89 e5 ldi r24, 0x59 ; 89 1ae58: 96 e4 ldi r25, 0x46 ; 70 1ae5a: 0e 94 2c 72 call 0xe458 ; 0xe458 1ae5e: 6a e6 ldi r22, 0x6A ; 106 1ae60: 71 ee ldi r23, 0xE1 ; 225 1ae62: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1ae66: 88 e4 ldi r24, 0x48 ; 72 1ae68: 96 e4 ldi r25, 0x46 ; 70 1ae6a: 0e 94 2c 72 call 0xe458 ; 0xe458 1ae6e: 61 ea ldi r22, 0xA1 ; 161 1ae70: 71 ee ldi r23, 0xE1 ; 225 1ae72: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1ae76: 86 e3 ldi r24, 0x36 ; 54 1ae78: 96 e4 ldi r25, 0x46 ; 70 1ae7a: 0e 94 2c 72 call 0xe458 ; 0xe458 1ae7e: 64 ea ldi r22, 0xA4 ; 164 1ae80: 71 ee ldi r23, 0xE1 ; 225 1ae82: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1ae86: 84 e6 ldi r24, 0x64 ; 100 1ae88: 9b e5 ldi r25, 0x5B ; 91 1ae8a: 0e 94 2c 72 call 0xe458 ; 0xe458 1ae8e: 67 ea ldi r22, 0xA7 ; 167 1ae90: 71 ee ldi r23, 0xE1 ; 225 1ae92: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1ae96: 8e ec ldi r24, 0xCE ; 206 1ae98: 9e e0 ldi r25, 0x0E ; 14 1ae9a: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1ae9e: 88 23 and r24, r24 1aea0: 41 f0 breq .+16 ; 0x1aeb2 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1aea2: 85 e5 ldi r24, 0x55 ; 85 1aea4: 9b e5 ldi r25, 0x5B ; 91 1aea6: 0e 94 2c 72 call 0xe458 ; 0xe458 1aeaa: 6a ea ldi r22, 0xAA ; 170 1aeac: 71 ee ldi r23, 0xE1 ; 225 } #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); 1aeae: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1aeb2: 8a ee ldi r24, 0xEA ; 234 1aeb4: 97 e4 ldi r25, 0x47 ; 71 1aeb6: 0e 94 2c 72 call 0xe458 ; 0xe458 1aeba: 66 e0 ldi r22, 0x06 ; 6 1aebc: 78 ed ldi r23, 0xD8 ; 216 1aebe: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1aec2: 84 e0 ldi r24, 0x04 ; 4 1aec4: 96 e4 ldi r25, 0x46 ; 70 1aec6: 0e 94 2c 72 call 0xe458 ; 0xe458 1aeca: 69 e7 ldi r22, 0x79 ; 121 1aecc: 79 ed ldi r23, 0xD9 ; 217 1aece: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1aed2: 87 ef ldi r24, 0xF7 ; 247 1aed4: 95 e4 ldi r25, 0x45 ; 69 1aed6: 0e 94 2c 72 call 0xe458 ; 0xe458 1aeda: 68 e3 ldi r22, 0x38 ; 56 1aedc: 79 e3 ldi r23, 0x39 ; 57 1aede: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1aee2: 8a ee ldi r24, 0xEA ; 234 1aee4: 95 e4 ldi r25, 0x45 ; 69 1aee6: 0e 94 2c 72 call 0xe458 ; 0xe458 1aeea: 60 ec ldi r22, 0xC0 ; 192 1aeec: 78 e3 ldi r23, 0x38 ; 56 1aeee: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #endif if (MMU2::mmu2.Enabled()) { 1aef2: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1aef6: 81 30 cpi r24, 0x01 ; 1 1aef8: 41 f4 brne .+16 ; 0x1af0a MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1aefa: 89 ed ldi r24, 0xD9 ; 217 1aefc: 95 e4 ldi r25, 0x45 ; 69 1aefe: 0e 94 2c 72 call 0xe458 ; 0xe458 1af02: 6a ea ldi r22, 0xAA ; 170 1af04: 7a e3 ldi r23, 0x3A ; 58 1af06: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 1af0a: 8f ec ldi r24, 0xCF ; 207 1af0c: 95 e4 ldi r25, 0x45 ; 69 1af0e: 0e 94 2c 72 call 0xe458 ; 0xe458 1af12: 62 e8 ldi r22, 0x82 ; 130 1af14: 7a e3 ldi r23, 0x3A ; 58 1af16: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_END(); 1af1a: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1af1e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1af22: 8f 5f subi r24, 0xFF ; 255 1af24: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1af28: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1af2c: 8f 5f subi r24, 0xFF ; 255 1af2e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1af32: 25 ce rjmp .-950 ; 0x1ab7e #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 1af34: d0 93 e1 03 sts 0x03E1, r29 ; 0x8003e1 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1af38: 86 e7 ldi r24, 0x76 ; 118 1af3a: 96 e4 ldi r25, 0x46 ; 70 1af3c: 0e 94 2c 72 call 0xe458 ; 0xe458 1af40: 0f 94 99 d4 call 0x3a932 ; 0x3a932 1af44: 54 cf rjmp .-344 ; 0x1adee 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; 1af46: 80 35 cpi r24, 0x50 ; 80 1af48: 19 f1 breq .+70 ; 0x1af90 1af4a: 8f 3f cpi r24, 0xFF ; 255 1af4c: 09 f0 breq .+2 ; 0x1af50 1af4e: 6e cf rjmp .-292 ; 0x1ae2c 1af50: 8a e6 ldi r24, 0x6A ; 106 1af52: 96 e4 ldi r25, 0x46 ; 70 1af54: 0e 94 2c 72 call 0xe458 ; 0xe458 1af58: 22 e0 ldi r18, 0x02 ; 2 1af5a: 4d ee ldi r20, 0xED ; 237 1af5c: 50 ed ldi r21, 0xD0 ; 208 1af5e: 6a e5 ldi r22, 0x5A ; 90 1af60: 79 e8 ldi r23, 0x89 ; 137 1af62: 09 c0 rjmp .+18 ; 0x1af76 1af64: 8a e6 ldi r24, 0x6A ; 106 1af66: 96 e4 ldi r25, 0x46 ; 70 1af68: 0e 94 2c 72 call 0xe458 ; 0xe458 1af6c: 22 e0 ldi r18, 0x02 ; 2 1af6e: 4d ee ldi r20, 0xED ; 237 1af70: 50 ed ldi r21, 0xD0 ; 208 1af72: 6f e5 ldi r22, 0x5F ; 95 1af74: 79 e8 ldi r23, 0x89 ; 137 1af76: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba 1af7a: 58 cf rjmp .-336 ; 0x1ae2c 1af7c: 8a e6 ldi r24, 0x6A ; 106 1af7e: 96 e4 ldi r25, 0x46 ; 70 1af80: 0e 94 2c 72 call 0xe458 ; 0xe458 1af84: 22 e0 ldi r18, 0x02 ; 2 1af86: 4d ee ldi r20, 0xED ; 237 1af88: 50 ed ldi r21, 0xD0 ; 208 1af8a: 65 e5 ldi r22, 0x55 ; 85 1af8c: 79 e8 ldi r23, 0x89 ; 137 1af8e: f3 cf rjmp .-26 ; 0x1af76 1af90: 8a e6 ldi r24, 0x6A ; 106 1af92: 96 e4 ldi r25, 0x46 ; 70 1af94: 0e 94 2c 72 call 0xe458 ; 0xe458 1af98: 22 e0 ldi r18, 0x02 ; 2 1af9a: 4d ee ldi r20, 0xED ; 237 1af9c: 50 ed ldi r21, 0xD0 ; 208 1af9e: 60 e5 ldi r22, 0x50 ; 80 1afa0: 79 e8 ldi r23, 0x89 ; 137 1afa2: e9 cf rjmp .-46 ; 0x1af76 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1afa4: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1afa8: 88 23 and r24, r24 1afaa: 19 f1 breq .+70 ; 0x1aff2 if (!fsensor.getAutoLoadEnabled()) { 1afac: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1afb0: 81 11 cpse r24, r1 1afb2: 08 c0 rjmp .+16 ; 0x1afc4 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1afb4: 86 e2 ldi r24, 0x26 ; 38 1afb6: 96 e4 ldi r25, 0x46 ; 70 1afb8: 0e 94 2c 72 call 0xe458 ; 0xe458 1afbc: 68 e1 ldi r22, 0x18 ; 24 1afbe: 7a e3 ldi r23, 0x3A ; 58 1afc0: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } if (fsensor.getFilamentPresent()) { 1afc4: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1afc8: 88 23 and r24, r24 1afca: 39 f0 breq .+14 ; 0x1afda } #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); 1afcc: 86 e3 ldi r24, 0x36 ; 54 1afce: 96 e4 ldi r25, 0x46 ; 70 1afd0: 0e 94 2c 72 call 0xe458 ; 0xe458 1afd4: 6a e0 ldi r22, 0x0A ; 10 1afd6: 79 e3 ldi r23, 0x39 ; 57 1afd8: 6a cf rjmp .-300 ; 0x1aeae if (fsensor.getFilamentPresent()) { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } #ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY else { if (fsensor.getAutoLoadEnabled()) { 1afda: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1afde: 88 23 and r24, r24 1afe0: 09 f4 brne .+2 ; 0x1afe4 1afe2: 67 cf rjmp .-306 ; 0x1aeb2 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1afe4: 82 e1 ldi r24, 0x12 ; 18 1afe6: 96 e4 ldi r25, 0x46 ; 70 1afe8: 0e 94 2c 72 call 0xe458 ; 0xe458 1afec: 64 ea ldi r22, 0xA4 ; 164 1afee: 79 e3 ldi r23, 0x39 ; 57 1aff0: 5e cf rjmp .-324 ; 0x1aeae } } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1aff2: 86 e2 ldi r24, 0x26 ; 38 1aff4: 96 e4 ldi r25, 0x46 ; 70 1aff6: 0e 94 2c 72 call 0xe458 ; 0xe458 1affa: 68 e1 ldi r22, 0x18 ; 24 1affc: 7a e3 ldi r23, 0x3A ; 58 1affe: 0f 94 4c d4 call 0x3a898 ; 0x3a898 1b002: e4 cf rjmp .-56 ; 0x1afcc #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1b004: df 91 pop r29 1b006: cf 91 pop r28 1b008: 1f 91 pop r17 1b00a: 08 95 ret 0001b00c : MENU_END(); } static void lcd_settings_menu() { 1b00c: 1f 93 push r17 1b00e: cf 93 push r28 1b010: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 1b012: 8f ef ldi r24, 0xFF ; 255 1b014: 9f e0 ldi r25, 0x0F ; 15 1b016: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1b01a: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 1b01e: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1b022: 10 92 12 05 sts 0x0512, r1 ; 0x800512 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1b026: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b028: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b02c: 84 30 cpi r24, 0x04 ; 4 1b02e: 08 f0 brcs .+2 ; 0x1b032 1b030: 5c c1 rjmp .+696 ; 0x1b2ea 1b032: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b036: 8b e3 ldi r24, 0x3B ; 59 1b038: 98 e4 ldi r25, 0x48 ; 72 1b03a: 0e 94 2c 72 call 0xe458 ; 0xe458 1b03e: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 1b042: 87 ea ldi r24, 0xA7 ; 167 1b044: 94 e4 ldi r25, 0x44 ; 68 1b046: 0e 94 2c 72 call 0xe458 ; 0xe458 1b04a: 6b e4 ldi r22, 0x4B ; 75 1b04c: 7a ed ldi r23, 0xDA ; 218 1b04e: 0f 94 4c d4 call 0x3a898 ; 0x3a898 if (!printer_active() || printingIsPaused()) 1b052: 0e 94 61 67 call 0xcec2 ; 0xcec2 1b056: 88 23 and r24, r24 1b058: 21 f0 breq .+8 ; 0x1b062 1b05a: 0e 94 05 67 call 0xce0a ; 0xce0a 1b05e: 88 23 and r24, r24 1b060: 81 f0 breq .+32 ; 0x1b082 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 1b062: 8b e9 ldi r24, 0x9B ; 155 1b064: 94 e4 ldi r25, 0x44 ; 68 1b066: 0e 94 2c 72 call 0xe458 ; 0xe458 1b06a: 63 ea ldi r22, 0xA3 ; 163 1b06c: 74 ed ldi r23, 0xD4 ; 212 1b06e: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 1b072: 88 e8 ldi r24, 0x88 ; 136 1b074: 94 e4 ldi r25, 0x44 ; 68 1b076: 0e 94 2c 72 call 0xe458 ; 0xe458 1b07a: 62 ea ldi r22, 0xA2 ; 162 1b07c: 7a e6 ldi r23, 0x6A ; 106 1b07e: 0f 94 c4 d0 call 0x3a188 ; 0x3a188 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1b082: 8b e4 ldi r24, 0x4B ; 75 1b084: 97 e4 ldi r25, 0x47 ; 71 1b086: 0e 94 2c 72 call 0xe458 ; 0xe458 1b08a: 68 e6 ldi r22, 0x68 ; 104 1b08c: 73 ed ldi r23, 0xD3 ; 211 1b08e: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #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); 1b092: 8c ea ldi r24, 0xAC ; 172 1b094: 9c e0 ldi r25, 0x0C ; 12 1b096: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1b09a: 88 23 and r24, r24 1b09c: 09 f4 brne .+2 ; 0x1b0a0 1b09e: ac c0 rjmp .+344 ; 0x1b1f8 1b0a0: 87 e1 ldi r24, 0x17 ; 23 1b0a2: 9c e5 ldi r25, 0x5C ; 92 1b0a4: 0e 94 2c 72 call 0xe458 ; 0xe458 1b0a8: 22 e0 ldi r18, 0x02 ; 2 1b0aa: 4c ec ldi r20, 0xCC ; 204 1b0ac: 54 ee ldi r21, 0xE4 ; 228 1b0ae: bc 01 movw r22, r24 1b0b0: 88 e4 ldi r24, 0x48 ; 72 1b0b2: 99 e8 ldi r25, 0x89 ; 137 1b0b4: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 1b0b8: 8c ea ldi r24, 0xAC ; 172 1b0ba: 9c e0 ldi r25, 0x0C ; 12 1b0bc: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1b0c0: 88 23 and r24, r24 1b0c2: 31 f0 breq .+12 ; 0x1b0d0 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 1b0c4: 64 ea ldi r22, 0xA4 ; 164 1b0c6: 7a e3 ldi r23, 0x3A ; 58 1b0c8: 8e e3 ldi r24, 0x3E ; 62 1b0ca: 99 e8 ldi r25, 0x89 ; 137 1b0cc: 0f 94 4b d1 call 0x3a296 ; 0x3a296 } if (MMU2::mmu2.Enabled()) 1b0d0: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1b0d4: 81 30 cpi r24, 0x01 ; 1 1b0d6: 51 f4 brne .+20 ; 0x1b0ec { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 1b0d8: 0e 94 50 d2 call 0x1a4a0 ; 0x1a4a0 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 1b0dc: 89 e7 ldi r24, 0x79 ; 121 1b0de: 94 e4 ldi r25, 0x44 ; 68 1b0e0: 0e 94 2c 72 call 0xe458 ; 0xe458 1b0e4: 6d ea ldi r22, 0xAD ; 173 1b0e6: 71 ee ldi r23, 0xE1 ; 225 1b0e8: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } SETTINGS_FANS_CHECK(); 1b0ec: 0e 94 d2 d1 call 0x1a3a4 ; 0x1a3a4 SETTINGS_SILENT_MODE(); 1b0f0: 0e 94 ec d1 call 0x1a3d8 ; 0x1a3d8 if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1b0f4: 10 93 fc 03 sts 0x03FC, r17 ; 0x8003fc MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 1b0f8: 8e e6 ldi r24, 0x6E ; 110 1b0fa: 94 e4 ldi r25, 0x44 ; 68 1b0fc: 0e 94 2c 72 call 0xe458 ; 0xe458 1b100: 69 e9 ldi r22, 0x99 ; 153 1b102: 72 ed ldi r23, 0xD2 ; 210 1b104: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } 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); 1b108: 8c ef ldi r24, 0xFC ; 252 1b10a: 94 e4 ldi r25, 0x44 ; 68 1b10c: 0e 94 2c 72 call 0xe458 ; 0xe458 1b110: 6e e0 ldi r22, 0x0E ; 14 1b112: 7a e3 ldi r23, 0x3A ; 58 1b114: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 1b118: 8c e5 ldi r24, 0x5C ; 92 1b11a: 94 e4 ldi r25, 0x44 ; 68 1b11c: 0e 94 2c 72 call 0xe458 ; 0xe458 1b120: 6c e4 ldi r22, 0x4C ; 76 1b122: 71 ef ldi r23, 0xF1 ; 241 1b124: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1b128: 20 e0 ldi r18, 0x00 ; 0 1b12a: 30 e0 ldi r19, 0x00 ; 0 1b12c: 40 e2 ldi r20, 0x20 ; 32 1b12e: 51 e4 ldi r21, 0x41 ; 65 1b130: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1b134: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1b138: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1b13c: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1b140: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1b144: 87 fd sbrc r24, 7 1b146: 16 c0 rjmp .+44 ; 0x1b174 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); 1b148: 8f ea ldi r24, 0xAF ; 175 1b14a: 9f e0 ldi r25, 0x0F ; 15 1b14c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1b150: 88 23 and r24, r24 1b152: 09 f4 brne .+2 ; 0x1b156 1b154: 54 c0 rjmp .+168 ; 0x1b1fe 1b156: 87 e1 ldi r24, 0x17 ; 23 1b158: 9c e5 ldi r25, 0x5C ; 92 1b15a: 0e 94 2c 72 call 0xe458 ; 0xe458 1b15e: ec 01 movw r28, r24 1b160: 85 eb ldi r24, 0xB5 ; 181 1b162: 94 e4 ldi r25, 0x44 ; 68 1b164: 0e 94 2c 72 call 0xe458 ; 0xe458 1b168: 22 e0 ldi r18, 0x02 ; 2 1b16a: 48 eb ldi r20, 0xB8 ; 184 1b16c: 50 ed ldi r21, 0xD0 ; 208 1b16e: be 01 movw r22, r28 1b170: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #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); 1b174: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1b178: 81 11 cpse r24, r1 1b17a: 44 c0 rjmp .+136 ; 0x1b204 1b17c: 81 e1 ldi r24, 0x11 ; 17 1b17e: 9c e5 ldi r25, 0x5C ; 92 1b180: 0e 94 2c 72 call 0xe458 ; 0xe458 1b184: ec 01 movw r28, r24 1b186: 81 e5 ldi r24, 0x51 ; 81 1b188: 94 e4 ldi r25, 0x44 ; 68 1b18a: 0e 94 2c 72 call 0xe458 ; 0xe458 1b18e: 22 e0 ldi r18, 0x02 ; 2 1b190: 46 ea ldi r20, 0xA6 ; 166 1b192: 50 ed ldi r21, 0xD0 ; 208 1b194: be 01 movw r22, r28 1b196: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 1b19a: 0e 94 05 67 call 0xce0a ; 0xce0a 1b19e: 81 11 cpse r24, r1 1b1a0: 08 c0 rjmp .+16 ; 0x1b1b2 1b1a2: 8e ee ldi r24, 0xEE ; 238 1b1a4: 96 e4 ldi r25, 0x46 ; 70 1b1a6: 0e 94 2c 72 call 0xe458 ; 0xe458 1b1aa: 68 e8 ldi r22, 0x88 ; 136 1b1ac: 7a e3 ldi r23, 0x3A ; 58 1b1ae: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 1b1b2: 8f e3 ldi r24, 0x3F ; 63 1b1b4: 94 e4 ldi r25, 0x44 ; 68 1b1b6: 0e 94 2c 72 call 0xe458 ; 0xe458 1b1ba: 6f ea ldi r22, 0xAF ; 175 1b1bc: 73 ee ldi r23, 0xE3 ; 227 1b1be: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 1b1c2: 80 91 01 17 lds r24, 0x1701 ; 0x801701 1b1c6: 88 23 and r24, r24 1b1c8: 01 f1 breq .+64 ; 0x1b20a MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 1b1ca: 85 e3 ldi r24, 0x35 ; 53 1b1cc: 94 e4 ldi r25, 0x44 ; 68 1b1ce: 0e 94 2c 72 call 0xe458 ; 0xe458 1b1d2: 22 e0 ldi r18, 0x02 ; 2 1b1d4: 4c e9 ldi r20, 0x9C ; 156 1b1d6: 50 ed ldi r21, 0xD0 ; 208 1b1d8: 6a e0 ldi r22, 0x0A ; 10 1b1da: 7a e6 ldi r23, 0x6A ; 106 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 1b1dc: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 1b1e0: 89 e0 ldi r24, 0x09 ; 9 1b1e2: 9f e0 ldi r25, 0x0F ; 15 1b1e4: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1b1e8: 88 23 and r24, r24 1b1ea: e9 f0 breq .+58 ; 0x1b226 1b1ec: 81 30 cpi r24, 0x01 ; 1 1b1ee: 09 f4 brne .+2 ; 0x1b1f2 1b1f0: 6d c0 rjmp .+218 ; 0x1b2cc 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); 1b1f2: 86 e6 ldi r24, 0x66 ; 102 1b1f4: 99 e4 ldi r25, 0x49 ; 73 1b1f6: 19 c0 rjmp .+50 ; 0x1b22a #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); 1b1f8: 81 e1 ldi r24, 0x11 ; 17 1b1fa: 9c e5 ldi r25, 0x5C ; 92 1b1fc: 53 cf rjmp .-346 ; 0x1b0a4 #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); 1b1fe: 81 e1 ldi r24, 0x11 ; 17 1b200: 9c e5 ldi r25, 0x5C ; 92 1b202: ab cf rjmp .-170 ; 0x1b15a #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); 1b204: 87 e1 ldi r24, 0x17 ; 23 1b206: 9c e5 ldi r25, 0x5C ; 92 1b208: bb cf rjmp .-138 ; 0x1b180 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); 1b20a: 8c e2 ldi r24, 0x2C ; 44 1b20c: 94 e4 ldi r25, 0x44 ; 68 1b20e: 0e 94 2c 72 call 0xe458 ; 0xe458 1b212: ec 01 movw r28, r24 1b214: 85 e3 ldi r24, 0x35 ; 53 1b216: 94 e4 ldi r25, 0x44 ; 68 1b218: 0e 94 2c 72 call 0xe458 ; 0xe458 1b21c: 22 e0 ldi r18, 0x02 ; 2 1b21e: 4c e9 ldi r20, 0x9C ; 156 1b220: 50 ed ldi r21, 0xD0 ; 208 1b222: be 01 movw r22, r28 1b224: db cf rjmp .-74 ; 0x1b1dc #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; 1b226: 85 e2 ldi r24, 0x25 ; 37 1b228: 94 e4 ldi r25, 0x44 ; 68 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); 1b22a: 0e 94 2c 72 call 0xe458 ; 0xe458 1b22e: ec 01 movw r28, r24 1b230: 8e e1 ldi r24, 0x1E ; 30 1b232: 94 e4 ldi r25, 0x44 ; 68 1b234: 0e 94 2c 72 call 0xe458 ; 0xe458 1b238: 22 e0 ldi r18, 0x02 ; 2 1b23a: 4a ed ldi r20, 0xDA ; 218 1b23c: 50 ed ldi r21, 0xD0 ; 208 1b23e: be 01 movw r22, r28 1b240: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1b244: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1b248: 82 30 cpi r24, 0x02 ; 2 1b24a: 09 f4 brne .+2 ; 0x1b24e 1b24c: 45 c0 rjmp .+138 ; 0x1b2d8 1b24e: 83 30 cpi r24, 0x03 ; 3 1b250: 09 f4 brne .+2 ; 0x1b254 1b252: 45 c0 rjmp .+138 ; 0x1b2de 1b254: 81 30 cpi r24, 0x01 ; 1 1b256: e9 f1 breq .+122 ; 0x1b2d2 1b258: 84 e4 ldi r24, 0x44 ; 68 1b25a: 97 e4 ldi r25, 0x47 ; 71 1b25c: 0e 94 2c 72 call 0xe458 ; 0xe458 1b260: ec 01 movw r28, r24 1b262: 8c e3 ldi r24, 0x3C ; 60 1b264: 97 e4 ldi r25, 0x47 ; 71 1b266: 0e 94 2c 72 call 0xe458 ; 0xe458 1b26a: 22 e0 ldi r18, 0x02 ; 2 1b26c: 43 ec ldi r20, 0xC3 ; 195 1b26e: 50 ed ldi r21, 0xD0 ; 208 1b270: be 01 movw r22, r28 1b272: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #ifdef LCD_BL_PIN if (backlightSupport) 1b276: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1b27a: 88 23 and r24, r24 1b27c: 41 f0 breq .+16 ; 0x1b28e { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1b27e: 86 e1 ldi r24, 0x16 ; 22 1b280: 97 e4 ldi r25, 0x47 ; 71 1b282: 0e 94 2c 72 call 0xe458 ; 0xe458 1b286: 61 ee ldi r22, 0xE1 ; 225 1b288: 70 ee ldi r23, 0xE0 ; 224 1b28a: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } #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 1b28e: 87 ea ldi r24, 0xA7 ; 167 1b290: 9c e0 ldi r25, 0x0C ; 12 1b292: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1b296: 88 23 and r24, r24 1b298: 29 f1 breq .+74 ; 0x1b2e4 1b29a: 85 ef ldi r24, 0xF5 ; 245 1b29c: 97 e4 ldi r25, 0x47 ; 71 1b29e: 0e 94 2c 72 call 0xe458 ; 0xe458 1b2a2: 22 e0 ldi r18, 0x02 ; 2 1b2a4: 4f e0 ldi r20, 0x0F ; 15 1b2a6: 50 ed ldi r21, 0xD0 ; 208 1b2a8: bc 01 movw r22, r24 1b2aa: 8d ef ldi r24, 0xFD ; 253 1b2ac: 99 e6 ldi r25, 0x69 ; 105 1b2ae: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 1b2b2: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b2b6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b2ba: 8f 5f subi r24, 0xFF ; 255 1b2bc: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b2c0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b2c4: 8f 5f subi r24, 0xFF ; 255 1b2c6: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b2ca: ae ce rjmp .-676 ; 0x1b028 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; 1b2cc: 83 e1 ldi r24, 0x13 ; 19 1b2ce: 94 e4 ldi r25, 0x44 ; 68 1b2d0: ac cf rjmp .-168 ; 0x1b22a default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1b2d2: 85 e3 ldi r24, 0x35 ; 53 1b2d4: 97 e4 ldi r25, 0x47 ; 71 1b2d6: c2 cf rjmp .-124 ; 0x1b25c 1b2d8: 8c e2 ldi r24, 0x2C ; 44 1b2da: 97 e4 ldi r25, 0x47 ; 71 1b2dc: bf cf rjmp .-130 ; 0x1b25c 1b2de: 83 e2 ldi r24, 0x23 ; 35 1b2e0: 97 e4 ldi r25, 0x47 ; 71 1b2e2: bc cf rjmp .-136 ; 0x1b25c 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 1b2e4: 8b ef ldi r24, 0xFB ; 251 1b2e6: 97 e4 ldi r25, 0x47 ; 71 1b2e8: da cf rjmp .-76 ; 0x1b29e { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 1b2ea: df 91 pop r29 1b2ec: cf 91 pop r28 1b2ee: 1f 91 pop r17 1b2f0: 08 95 ret 0001b2f2 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1b2f2: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1b2f6: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b2fa: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b2fe: 84 30 cpi r24, 0x04 ; 4 1b300: 08 f0 brcs .+2 ; 0x1b304 1b302: 8f c0 rjmp .+286 ; 0x1b422 1b304: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b308: 8b e3 ldi r24, 0x3B ; 59 1b30a: 98 e4 ldi r25, 0x48 ; 72 1b30c: 0e 94 2c 72 call 0xe458 ; 0xe458 1b310: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1b314: 85 e4 ldi r24, 0x45 ; 69 1b316: 95 e4 ldi r25, 0x45 ; 69 1b318: 0e 94 2c 72 call 0xe458 ; 0xe458 1b31c: 6c e9 ldi r22, 0x9C ; 156 1b31e: 7a e3 ldi r23, 0x3A ; 58 1b320: 0f 94 4b d1 call 0x3a296 ; 0x3a296 if (lcd_commands_type == LcdCommands::Idle) 1b324: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1b328: 81 11 cpse r24, r1 1b32a: 08 c0 rjmp .+16 ; 0x1b33c { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1b32c: 84 ea ldi r24, 0xA4 ; 164 1b32e: 95 e4 ldi r25, 0x45 ; 69 1b330: 0e 94 2c 72 call 0xe458 ; 0xe458 1b334: 6a e8 ldi r22, 0x8A ; 138 1b336: 7f ee ldi r23, 0xEF ; 239 1b338: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1b33c: 89 e4 ldi r24, 0x49 ; 73 1b33e: 9b e5 ldi r25, 0x5B ; 91 1b340: 0e 94 2c 72 call 0xe458 ; 0xe458 1b344: 60 e4 ldi r22, 0x40 ; 64 1b346: 7b e6 ldi r23, 0x6B ; 107 1b348: 0f 94 c4 d0 call 0x3a188 ; 0x3a188 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1b34c: 89 e3 ldi r24, 0x39 ; 57 1b34e: 95 e4 ldi r25, 0x45 ; 69 1b350: 0e 94 2c 72 call 0xe458 ; 0xe458 1b354: 68 e2 ldi r22, 0x28 ; 40 1b356: 70 ee ldi r23, 0xE0 ; 224 1b358: 0f 94 4b d1 call 0x3a296 ; 0x3a296 #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1b35c: 8e e2 ldi r24, 0x2E ; 46 1b35e: 95 e4 ldi r25, 0x45 ; 69 1b360: 0e 94 2c 72 call 0xe458 ; 0xe458 1b364: 6d ea ldi r22, 0xAD ; 173 1b366: 78 ef ldi r23, 0xF8 ; 248 1b368: 0f 94 4b d1 call 0x3a296 ; 0x3a296 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1b36c: 8e e1 ldi r24, 0x1E ; 30 1b36e: 95 e4 ldi r25, 0x45 ; 69 1b370: 0e 94 2c 72 call 0xe458 ; 0xe458 1b374: 6d e6 ldi r22, 0x6D ; 109 1b376: 7f ec ldi r23, 0xCF ; 207 1b378: 0f 94 4b d1 call 0x3a296 ; 0x3a296 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1b37c: 80 e1 ldi r24, 0x10 ; 16 1b37e: 95 e4 ldi r25, 0x45 ; 69 1b380: 0e 94 2c 72 call 0xe458 ; 0xe458 1b384: 64 e7 ldi r22, 0x74 ; 116 1b386: 7f ec ldi r23, 0xCF ; 207 1b388: 0f 94 4b d1 call 0x3a296 ; 0x3a296 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1b38c: 8c ef ldi r24, 0xFC ; 252 1b38e: 94 e4 ldi r25, 0x44 ; 68 1b390: 0e 94 2c 72 call 0xe458 ; 0xe458 1b394: 6b e7 ldi r22, 0x7B ; 123 1b396: 7f ec ldi r23, 0xCF ; 207 1b398: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1b39c: 88 ee ldi r24, 0xE8 ; 232 1b39e: 94 e4 ldi r25, 0x44 ; 68 1b3a0: 0e 94 2c 72 call 0xe458 ; 0xe458 1b3a4: 6a ef ldi r22, 0xFA ; 250 1b3a6: 79 e3 ldi r23, 0x39 ; 57 1b3a8: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1b3ac: 86 ed ldi r24, 0xD6 ; 214 1b3ae: 94 e4 ldi r25, 0x44 ; 68 1b3b0: 0e 94 2c 72 call 0xe458 ; 0xe458 1b3b4: 62 ec ldi r22, 0xC2 ; 194 1b3b6: 7a e3 ldi r23, 0x3A ; 58 1b3b8: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #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")); 1b3bc: 82 ec ldi r24, 0xC2 ; 194 1b3be: 94 e4 ldi r25, 0x44 ; 68 1b3c0: 0e 94 2c 72 call 0xe458 ; 0xe458 1b3c4: 6c e4 ldi r22, 0x4C ; 76 1b3c6: 79 e8 ldi r23, 0x89 ; 137 1b3c8: 0f 94 c4 d0 call 0x3a188 ; 0x3a188 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1b3cc: 20 e0 ldi r18, 0x00 ; 0 1b3ce: 30 e0 ldi r19, 0x00 ; 0 1b3d0: 40 e2 ldi r20, 0x20 ; 32 1b3d2: 51 e4 ldi r21, 0x41 ; 65 1b3d4: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1b3d8: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1b3dc: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1b3e0: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1b3e4: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1b3e8: 87 fd sbrc r24, 7 1b3ea: 08 c0 rjmp .+16 ; 0x1b3fc MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1b3ec: 85 eb ldi r24, 0xB5 ; 181 1b3ee: 94 e4 ldi r25, 0x44 ; 68 1b3f0: 0e 94 2c 72 call 0xe458 ; 0xe458 1b3f4: 62 e8 ldi r22, 0x82 ; 130 1b3f6: 7f ec ldi r23, 0xCF ; 207 1b3f8: 0f 94 4b d1 call 0x3a296 ; 0x3a296 #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1b3fc: 66 e9 ldi r22, 0x96 ; 150 1b3fe: 7e ec ldi r23, 0xCE ; 206 1b400: 83 e1 ldi r24, 0x13 ; 19 1b402: 9a e6 ldi r25, 0x6A ; 106 1b404: 0f 94 4b d1 call 0x3a296 ; 0x3a296 #endif //THERMAL_MODEL MENU_END(); 1b408: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1b40c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b410: 8f 5f subi r24, 0xFF ; 255 1b412: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b416: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b41a: 8f 5f subi r24, 0xFF ; 255 1b41c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b420: 6c cf rjmp .-296 ; 0x1b2fa #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1b422: 08 95 ret 0001b424 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 1b424: ef 92 push r14 1b426: ff 92 push r15 1b428: 0f 93 push r16 1b42a: 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); 1b42c: 84 eb ldi r24, 0xB4 ; 180 1b42e: 93 e4 ldi r25, 0x43 ; 67 1b430: 0e 94 2c 72 call 0xe458 ; 0xe458 1b434: 28 ec ldi r18, 0xC8 ; 200 1b436: e2 2e mov r14, r18 1b438: f1 2c mov r15, r1 1b43a: 07 e2 ldi r16, 0x27 ; 39 1b43c: 11 e0 ldi r17, 0x01 ; 1 1b43e: 30 e0 ldi r19, 0x00 ; 0 1b440: 20 e0 ldi r18, 0x00 ; 0 1b442: 40 e1 ldi r20, 0x10 ; 16 1b444: 66 eb ldi r22, 0xB6 ; 182 1b446: 7d e0 ldi r23, 0x0D ; 13 1b448: 0f 94 1e d2 call 0x3a43c ; 0x3a43c #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); 1b44c: 89 e9 ldi r24, 0x99 ; 153 1b44e: 93 e4 ldi r25, 0x43 ; 67 1b450: 0e 94 2c 72 call 0xe458 ; 0xe458 1b454: 32 e3 ldi r19, 0x32 ; 50 1b456: e3 2e mov r14, r19 1b458: f1 2c mov r15, r1 1b45a: 08 e7 ldi r16, 0x78 ; 120 1b45c: 10 e0 ldi r17, 0x00 ; 0 1b45e: 30 e0 ldi r19, 0x00 ; 0 1b460: 20 e0 ldi r18, 0x00 ; 0 1b462: 40 e1 ldi r20, 0x10 ; 16 1b464: 62 e7 ldi r22, 0x72 ; 114 1b466: 76 e0 ldi r23, 0x06 ; 6 1b468: 0f 94 1e d2 call 0x3a43c ; 0x3a43c #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 1b46c: 8d e8 ldi r24, 0x8D ; 141 1b46e: 93 e4 ldi r25, 0x43 ; 67 1b470: 0e 94 2c 72 call 0xe458 ; 0xe458 1b474: 4f e7 ldi r20, 0x7F ; 127 1b476: e4 2e mov r14, r20 1b478: f1 2c mov r15, r1 1b47a: 0f ef ldi r16, 0xFF ; 255 1b47c: 10 e0 ldi r17, 0x00 ; 0 1b47e: 30 e0 ldi r19, 0x00 ; 0 1b480: 20 e0 ldi r18, 0x00 ; 0 1b482: 48 e0 ldi r20, 0x08 ; 8 1b484: 67 ee ldi r22, 0xE7 ; 231 1b486: 73 e0 ldi r23, 0x03 ; 3 1b488: 0f 94 1e d2 call 0x3a43c ; 0x3a43c } 1b48c: 1f 91 pop r17 1b48e: 0f 91 pop r16 1b490: ff 90 pop r15 1b492: ef 90 pop r14 1b494: 08 95 ret 0001b496 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1b496: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1b49a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b49e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b4a2: 84 30 cpi r24, 0x04 ; 4 1b4a4: b8 f4 brcc .+46 ; 0x1b4d4 1b4a6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1b4aa: 8a ee ldi r24, 0xEA ; 234 1b4ac: 97 e4 ldi r25, 0x47 ; 71 1b4ae: 0e 94 2c 72 call 0xe458 ; 0xe458 1b4b2: 0f 94 99 d4 call 0x3a932 ; 0x3a932 menuitems_temperature_common(); 1b4b6: 0e 94 12 da call 0x1b424 ; 0x1b424 MENU_END(); 1b4ba: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1b4be: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b4c2: 8f 5f subi r24, 0xFF ; 255 1b4c4: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b4c8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b4cc: 8f 5f subi r24, 0xFF ; 255 1b4ce: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b4d2: e5 cf rjmp .-54 ; 0x1b49e MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1b4d4: 08 95 ret 0001b4d6 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1b4d6: ef 92 push r14 1b4d8: ff 92 push r15 1b4da: 0f 93 push r16 1b4dc: 1f 93 push r17 1b4de: cf 93 push r28 1b4e0: df 93 push r29 1b4e2: 80 91 bc 02 lds r24, 0x02BC ; 0x8002bc 1b4e6: 90 91 bd 02 lds r25, 0x02BD ; 0x8002bd //! 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) 1b4ea: 20 91 b6 03 lds r18, 0x03B6 ; 0x8003b6 1b4ee: 21 11 cpse r18, r1 1b4f0: 97 c0 rjmp .+302 ; 0x1b620 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1b4f2: 21 e0 ldi r18, 0x01 ; 1 1b4f4: 20 93 b6 03 sts 0x03B6, r18 ; 0x8003b6 _md->extrudemultiply = extrudemultiply; 1b4f8: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1b4fc: 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); 1b500: 8f ef ldi r24, 0xFF ; 255 1b502: 9f e0 ldi r25, 0x0F ; 15 1b504: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1b508: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 1b50c: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1b510: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b514: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b518: 84 30 cpi r24, 0x04 ; 4 1b51a: 08 f0 brcs .+2 ; 0x1b51e 1b51c: 99 c0 rjmp .+306 ; 0x1b650 1b51e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1b522: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 1b526: 81 11 cpse r24, r1 1b528: 0e 94 63 64 call 0xc8c6 ; 0xc8c6 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b52c: 8b e3 ldi r24, 0x3B ; 59 1b52e: 98 e4 ldi r25, 0x48 ; 72 1b530: 0e 94 2c 72 call 0xe458 ; 0xe458 1b534: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1b538: 82 e7 ldi r24, 0x72 ; 114 1b53a: 97 e4 ldi r25, 0x47 ; 71 1b53c: 0e 94 2c 72 call 0xe458 ; 0xe458 1b540: f1 2c mov r15, r1 1b542: e1 2c mov r14, r1 1b544: 07 ee ldi r16, 0xE7 ; 231 1b546: 13 e0 ldi r17, 0x03 ; 3 1b548: 2a e0 ldi r18, 0x0A ; 10 1b54a: 30 e0 ldi r19, 0x00 ; 0 1b54c: 40 e1 ldi r20, 0x10 ; 16 1b54e: 69 e3 ldi r22, 0x39 ; 57 1b550: 72 e0 ldi r23, 0x02 ; 2 1b552: 0f 94 1e d2 call 0x3a43c ; 0x3a43c menuitems_temperature_common(); 1b556: 0e 94 12 da call 0x1b424 ; 0x1b424 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1b55a: 8b e6 ldi r24, 0x6B ; 107 1b55c: 97 e4 ldi r25, 0x47 ; 71 1b55e: 0e 94 2c 72 call 0xe458 ; 0xe458 1b562: 2a e0 ldi r18, 0x0A ; 10 1b564: 30 e0 ldi r19, 0x00 ; 0 1b566: 40 e1 ldi r20, 0x10 ; 16 1b568: 6c eb ldi r22, 0xBC ; 188 1b56a: 72 e0 ldi r23, 0x02 ; 2 1b56c: 0f 94 1e d2 call 0x3a43c ; 0x3a43c #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); 1b570: 89 e5 ldi r24, 0x59 ; 89 1b572: 97 e4 ldi r25, 0x47 ; 71 1b574: 0e 94 2c 72 call 0xe458 ; 0xe458 1b578: 63 e5 ldi r22, 0x53 ; 83 1b57a: 75 ef ldi r23, 0xF5 ; 245 1b57c: 0f 94 4b d1 call 0x3a296 ; 0x3a296 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1b580: 0e 94 05 67 call 0xce0a ; 0xce0a 1b584: 88 23 and r24, r24 1b586: 41 f0 breq .+16 ; 0x1b598 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1b588: 89 e4 ldi r24, 0x49 ; 73 1b58a: 9b e5 ldi r25, 0x5B ; 91 1b58c: 0e 94 2c 72 call 0xe458 ; 0xe458 1b590: 64 e6 ldi r22, 0x64 ; 100 1b592: 79 e8 ldi r23, 0x89 ; 137 1b594: 0f 94 c4 d0 call 0x3a188 ; 0x3a188 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1b598: 8b e4 ldi r24, 0x4B ; 75 1b59a: 97 e4 ldi r25, 0x47 ; 71 1b59c: 0e 94 2c 72 call 0xe458 ; 0xe458 1b5a0: 68 e6 ldi r22, 0x68 ; 104 1b5a2: 73 ed ldi r23, 0xD3 ; 211 1b5a4: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1b5a8: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1b5ac: 81 30 cpi r24, 0x01 ; 1 1b5ae: 11 f4 brne .+4 ; 0x1b5b4 { menuitems_MMU_settings_common(); 1b5b0: 0e 94 50 d2 call 0x1a4a0 ; 0x1a4a0 } SETTINGS_FANS_CHECK(); 1b5b4: 0e 94 d2 d1 call 0x1a3a4 ; 0x1a3a4 SETTINGS_SILENT_MODE(); 1b5b8: 0e 94 ec d1 call 0x1a3d8 ; 0x1a3d8 SETTINGS_SOUND; 1b5bc: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1b5c0: 82 30 cpi r24, 0x02 ; 2 1b5c2: 09 f4 brne .+2 ; 0x1b5c6 1b5c4: 3f c0 rjmp .+126 ; 0x1b644 1b5c6: 83 30 cpi r24, 0x03 ; 3 1b5c8: 09 f4 brne .+2 ; 0x1b5cc 1b5ca: 3f c0 rjmp .+126 ; 0x1b64a 1b5cc: 81 30 cpi r24, 0x01 ; 1 1b5ce: b9 f1 breq .+110 ; 0x1b63e 1b5d0: 84 e4 ldi r24, 0x44 ; 68 1b5d2: 97 e4 ldi r25, 0x47 ; 71 1b5d4: 0e 94 2c 72 call 0xe458 ; 0xe458 1b5d8: ec 01 movw r28, r24 1b5da: 8c e3 ldi r24, 0x3C ; 60 1b5dc: 97 e4 ldi r25, 0x47 ; 71 1b5de: 0e 94 2c 72 call 0xe458 ; 0xe458 1b5e2: 22 e0 ldi r18, 0x02 ; 2 1b5e4: 43 ec ldi r20, 0xC3 ; 195 1b5e6: 50 ed ldi r21, 0xD0 ; 208 1b5e8: be 01 movw r22, r28 1b5ea: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #ifdef LCD_BL_PIN if (backlightSupport) 1b5ee: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1b5f2: 88 23 and r24, r24 1b5f4: 41 f0 breq .+16 ; 0x1b606 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1b5f6: 86 e1 ldi r24, 0x16 ; 22 1b5f8: 97 e4 ldi r25, 0x47 ; 71 1b5fa: 0e 94 2c 72 call 0xe458 ; 0xe458 1b5fe: 61 ee ldi r22, 0xE1 ; 225 1b600: 70 ee ldi r23, 0xE0 ; 224 1b602: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } #endif //LCD_BL_PIN MENU_END(); 1b606: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b60a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b60e: 8f 5f subi r24, 0xFF ; 255 1b610: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b614: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b618: 8f 5f subi r24, 0xFF ; 255 1b61a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b61e: 7a cf rjmp .-268 ; 0x1b514 { // 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) 1b620: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 1b624: 30 91 b8 03 lds r19, 0x03B8 ; 0x8003b8 1b628: 28 17 cp r18, r24 1b62a: 39 07 cpc r19, r25 1b62c: 09 f4 brne .+2 ; 0x1b630 1b62e: 68 cf rjmp .-304 ; 0x1b500 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1b630: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1b634: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 calculate_extruder_multipliers(); 1b638: 0e 94 39 65 call 0xca72 ; 0xca72 1b63c: 61 cf rjmp .-318 ; 0x1b500 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1b63e: 85 e3 ldi r24, 0x35 ; 53 1b640: 97 e4 ldi r25, 0x47 ; 71 1b642: c8 cf rjmp .-112 ; 0x1b5d4 1b644: 8c e2 ldi r24, 0x2C ; 44 1b646: 97 e4 ldi r25, 0x47 ; 71 1b648: c5 cf rjmp .-118 ; 0x1b5d4 1b64a: 83 e2 ldi r24, 0x23 ; 35 1b64c: 97 e4 ldi r25, 0x47 ; 71 1b64e: c2 cf rjmp .-124 ; 0x1b5d4 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1b650: df 91 pop r29 1b652: cf 91 pop r28 1b654: 1f 91 pop r17 1b656: 0f 91 pop r16 1b658: ff 90 pop r15 1b65a: ef 90 pop r14 1b65c: 08 95 ret 0001b65e : } } #if (LANG_MODE != 0) void lcd_language() { 1b65e: cf 93 push r28 1b660: df 93 push r29 lcd_update_enable(true); 1b662: 81 e0 ldi r24, 0x01 ; 1 1b664: 0e 94 a5 6e call 0xdd4a ; 0xdd4a menu_goto(lcd_language_menu, 0, true, true); 1b668: 21 e0 ldi r18, 0x01 ; 1 1b66a: 41 e0 ldi r20, 0x01 ; 1 1b66c: 70 e0 ldi r23, 0x00 ; 0 1b66e: 60 e0 ldi r22, 0x00 ; 0 1b670: 8f ea ldi r24, 0xAF ; 175 1b672: 93 ee ldi r25, 0xE3 ; 227 1b674: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 1b678: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 1b67c: c0 91 13 04 lds r28, 0x0413 ; 0x800413 1b680: d0 91 14 04 lds r29, 0x0414 ; 0x800414 1b684: 0e 94 9d 70 call 0xe13a ; 0xe13a 1b688: c6 52 subi r28, 0x26 ; 38 1b68a: da 43 sbci r29, 0x3A ; 58 1b68c: 39 f0 breq .+14 ; 0x1b69c 1b68e: 81 11 cpse r24, r1 1b690: 07 c0 rjmp .+14 ; 0x1b6a0 { delay_keep_alive(50); 1b692: 82 e3 ldi r24, 0x32 ; 50 1b694: 90 e0 ldi r25, 0x00 ; 0 1b696: 0e 94 6c 8c call 0x118d8 ; 0x118d8 1b69a: f0 cf rjmp .-32 ; 0x1b67c } if (lang_is_selected()) 1b69c: 88 23 and r24, r24 1b69e: 21 f0 breq .+8 ; 0x1b6a8 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 1b6a0: df 91 pop r29 1b6a2: 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(); 1b6a4: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 else lang_select(LANG_ID_PRI); 1b6a8: 80 e0 ldi r24, 0x00 ; 0 } 1b6aa: df 91 pop r29 1b6ac: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 1b6ae: 0c 94 b4 71 jmp 0xe368 ; 0xe368 0001b6b2 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1b6b2: bf 92 push r11 1b6b4: cf 92 push r12 1b6b6: df 92 push r13 1b6b8: ef 92 push r14 1b6ba: ff 92 push r15 1b6bc: 0f 93 push r16 1b6be: 1f 93 push r17 1b6c0: cf 93 push r28 1b6c2: df 93 push r29 1b6c4: c8 2f mov r28, r24 1b6c6: f6 2e mov r15, r22 1b6c8: e4 2e mov r14, r20 1b6ca: b2 2e mov r11, r18 1b6cc: 68 01 movw r12, r16 lcd_update_enable(false); 1b6ce: 80 e0 ldi r24, 0x00 ; 0 1b6d0: 0e 94 a5 6e call 0xdd4a ; 0xdd4a const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1b6d4: dc e7 ldi r29, 0x7C ; 124 1b6d6: fe 14 cp r15, r14 1b6d8: 08 f0 brcs .+2 ; 0x1b6dc 1b6da: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1b6dc: bb 20 and r11, r11 1b6de: 09 f1 breq .+66 ; 0x1b722 lcd_clear(); 1b6e0: 0e 94 93 6e call 0xdd26 ; 0xdd26 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b6e4: c1 11 cpse r28, r1 1b6e6: 20 c0 rjmp .+64 ; 0x1b728 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b6e8: 8a ed ldi r24, 0xDA ; 218 1b6ea: 95 e5 ldi r25, 0x55 ; 85 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)); 1b6ec: 0e 94 2c 72 call 0xe458 ; 0xe458 1b6f0: 0e 94 4b 6e call 0xdc96 ; 0xdc96 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1b6f4: 88 ef ldi r24, 0xF8 ; 248 1b6f6: 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 1b6f8: 82 30 cpi r24, 0x02 ; 2 1b6fa: 78 f5 brcc .+94 ; 0x1b75a || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1b6fc: 85 ed ldi r24, 0xD5 ; 213 1b6fe: 98 e4 ldi r25, 0x48 ; 72 1b700: 0e 94 2c 72 call 0xe458 ; 0xe458 1b704: 0e 94 4b 6e call 0xdc96 ; 0xdc96 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)); 1b708: 84 eb ldi r24, 0xB4 ; 180 1b70a: 98 e4 ldi r25, 0x48 ; 72 1b70c: cc 30 cpi r28, 0x0C ; 12 1b70e: 49 f1 breq .+82 ; 0x1b762 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1b710: 85 ee ldi r24, 0xE5 ; 229 1b712: 95 e5 ldi r25, 0x55 ; 85 1b714: cd 30 cpi r28, 0x0D ; 13 1b716: 29 f1 breq .+74 ; 0x1b762 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1b718: ce 30 cpi r28, 0x0E ; 14 1b71a: 39 f5 brne .+78 ; 0x1b76a 1b71c: 81 ea ldi r24, 0xA1 ; 161 1b71e: 98 e4 ldi r25, 0x48 ; 72 1b720: 20 c0 rjmp .+64 ; 0x1b762 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1b722: 0e 94 8c 6e call 0xdd18 ; 0xdd18 1b726: de cf rjmp .-68 ; 0x1b6e4 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b728: c1 30 cpi r28, 0x01 ; 1 1b72a: f1 f2 breq .-68 ; 0x1b6e8 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b72c: c2 30 cpi r28, 0x02 ; 2 1b72e: e1 f2 breq .-72 ; 0x1b6e8 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1b730: 8c e2 ldi r24, 0x2C ; 44 1b732: 99 e4 ldi r25, 0x49 ; 73 1b734: c3 30 cpi r28, 0x03 ; 3 1b736: d1 f2 breq .-76 ; 0x1b6ec if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1b738: 8a e1 ldi r24, 0x1A ; 26 1b73a: 99 e4 ldi r25, 0x49 ; 73 1b73c: c4 30 cpi r28, 0x04 ; 4 1b73e: b1 f2 breq .-84 ; 0x1b6ec if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1b740: 88 e0 ldi r24, 0x08 ; 8 1b742: 99 e4 ldi r25, 0x49 ; 73 1b744: c5 30 cpi r28, 0x05 ; 5 1b746: 91 f2 breq .-92 ; 0x1b6ec if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1b748: 86 ef ldi r24, 0xF6 ; 246 1b74a: 98 e4 ldi r25, 0x48 ; 72 1b74c: c6 30 cpi r28, 0x06 ; 6 1b74e: 71 f2 breq .-100 ; 0x1b6ec if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1b750: c7 30 cpi r28, 0x07 ; 7 1b752: 81 f6 brne .-96 ; 0x1b6f4 1b754: 87 ee ldi r24, 0xE7 ; 231 1b756: 98 e4 ldi r25, 0x48 ; 72 1b758: c9 cf rjmp .-110 ; 0x1b6ec 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)); 1b75a: ca 30 cpi r28, 0x0A ; 10 1b75c: 99 f5 brne .+102 ; 0x1b7c4 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1b75e: 82 ec ldi r24, 0xC2 ; 194 1b760: 98 e4 ldi r25, 0x48 ; 72 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)); 1b762: 0e 94 2c 72 call 0xe458 ; 0xe458 1b766: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1b76a: 4b eb ldi r20, 0xBB ; 187 1b76c: 59 e8 ldi r21, 0x89 ; 137 1b76e: 61 e0 ldi r22, 0x01 ; 1 1b770: 80 e0 ldi r24, 0x00 ; 0 1b772: 0e 94 74 6e call 0xdce8 ; 0xdce8 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1b776: c3 30 cpi r28, 0x03 ; 3 1b778: 70 f5 brcc .+92 ; 0x1b7d6 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1b77a: 83 e9 ldi r24, 0x93 ; 147 1b77c: 98 e4 ldi r25, 0x48 ; 72 1b77e: 0e 94 2c 72 call 0xe458 ; 0xe458 1b782: ac 01 movw r20, r24 1b784: 62 e0 ldi r22, 0x02 ; 2 1b786: 80 e0 ldi r24, 0x00 ; 0 1b788: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(18, 2); 1b78c: 62 e0 ldi r22, 0x02 ; 2 1b78e: 82 e1 ldi r24, 0x12 ; 18 1b790: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b794: c1 11 cpse r28, r1 1b796: 1a c0 rjmp .+52 ; 0x1b7cc 1b798: 8d 2f mov r24, r29 1b79a: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1b79e: 86 e8 ldi r24, 0x86 ; 134 1b7a0: 98 e4 ldi r25, 0x48 ; 72 1b7a2: 0e 94 2c 72 call 0xe458 ; 0xe458 1b7a6: ac 01 movw r20, r24 1b7a8: 63 e0 ldi r22, 0x03 ; 3 1b7aa: 80 e0 ldi r24, 0x00 ; 0 1b7ac: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(18, 3); 1b7b0: 63 e0 ldi r22, 0x03 ; 3 1b7b2: 82 e1 ldi r24, 0x12 ; 18 1b7b4: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b7b8: c2 30 cpi r28, 0x02 ; 2 1b7ba: 19 f1 breq .+70 ; 0x1b802 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); 1b7bc: 8d 2f mov r24, r29 1b7be: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 1b7c2: 23 c0 rjmp .+70 ; 0x1b80a 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)); 1b7c4: cb 30 cpi r28, 0x0B ; 11 1b7c6: 09 f0 breq .+2 ; 0x1b7ca 1b7c8: 9f cf rjmp .-194 ; 0x1b708 1b7ca: c9 cf rjmp .-110 ; 0x1b75e 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); 1b7cc: 8e ed ldi r24, 0xDE ; 222 1b7ce: 9a e6 ldi r25, 0x6A ; 106 1b7d0: 0e 94 4b 6e call 0xdc96 ; 0xdc96 1b7d4: e4 cf rjmp .-56 ; 0x1b79e 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) 1b7d6: 86 ef ldi r24, 0xF6 ; 246 1b7d8: 8c 0f add r24, r28 1b7da: 82 30 cpi r24, 0x02 ; 2 1b7dc: a8 f5 brcc .+106 ; 0x1b848 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1b7de: 87 ef ldi r24, 0xF7 ; 247 1b7e0: 95 e5 ldi r25, 0x55 ; 85 1b7e2: 0e 94 2c 72 call 0xe458 ; 0xe458 1b7e6: ac 01 movw r20, r24 1b7e8: 62 e0 ldi r22, 0x02 ; 2 1b7ea: 80 e0 ldi r24, 0x00 ; 0 1b7ec: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_putc(':'); 1b7f0: 8a e3 ldi r24, 0x3A ; 58 1b7f2: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_set_cursor(18, 2); 1b7f6: 62 e0 ldi r22, 0x02 ; 2 1b7f8: 82 e1 ldi r24, 0x12 ; 18 1b7fa: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b7fe: ca 30 cpi r28, 0x0A ; 10 1b800: e9 f2 breq .-70 ; 0x1b7bc 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); 1b802: 8e ed ldi r24, 0xDE ; 222 1b804: 9a e6 ldi r25, 0x6A ; 106 1b806: 0e 94 4b 6e call 0xdc96 ; 0xdc96 _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); 1b80a: c1 14 cp r12, r1 1b80c: d1 04 cpc r13, r1 1b80e: 19 f0 breq .+6 ; 0x1b816 1b810: c6 01 movw r24, r12 1b812: 0e 94 6c 8c call 0x118d8 ; 0x118d8 _progress++; 1b816: 81 e0 ldi r24, 0x01 ; 1 1b818: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1b81a: 48 2f mov r20, r24 1b81c: 50 e0 ldi r21, 0x00 ; 0 1b81e: 92 e0 ldi r25, 0x02 ; 2 1b820: 24 e0 ldi r18, 0x04 ; 4 1b822: 30 e0 ldi r19, 0x00 ; 0 1b824: e9 16 cp r14, r25 1b826: 11 f0 breq .+4 ; 0x1b82c 1b828: 26 e0 ldi r18, 0x06 ; 6 1b82a: 30 e0 ldi r19, 0x00 ; 0 1b82c: 42 17 cp r20, r18 1b82e: 53 07 cpc r21, r19 1b830: 0c f0 brlt .+2 ; 0x1b834 1b832: 80 e0 ldi r24, 0x00 ; 0 } 1b834: df 91 pop r29 1b836: cf 91 pop r28 1b838: 1f 91 pop r17 1b83a: 0f 91 pop r16 1b83c: ff 90 pop r15 1b83e: ef 90 pop r14 1b840: df 90 pop r13 1b842: cf 90 pop r12 1b844: bf 90 pop r11 1b846: 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) 1b848: ca 30 cpi r28, 0x0A ; 10 1b84a: f8 f6 brcc .-66 ; 0x1b80a { //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); 1b84c: 41 e0 ldi r20, 0x01 ; 1 1b84e: c4 30 cpi r28, 0x04 ; 4 1b850: 21 f0 breq .+8 ; 0x1b85a 1b852: 42 e0 ldi r20, 0x02 ; 2 1b854: c3 30 cpi r28, 0x03 ; 3 1b856: 09 f4 brne .+2 ; 0x1b85a 1b858: 40 e0 ldi r20, 0x00 ; 0 1b85a: 0d 2f mov r16, r29 1b85c: 29 eb ldi r18, 0xB9 ; 185 1b85e: 39 e8 ldi r19, 0x89 ; 137 1b860: 62 e0 ldi r22, 0x02 ; 2 1b862: 82 e0 ldi r24, 0x02 ; 2 1b864: 0e 94 61 d1 call 0x1a2c2 ; 0x1a2c2 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1b868: 41 e0 ldi r20, 0x01 ; 1 1b86a: c5 30 cpi r28, 0x05 ; 5 1b86c: 21 f0 breq .+8 ; 0x1b876 1b86e: 42 e0 ldi r20, 0x02 ; 2 1b870: c5 30 cpi r28, 0x05 ; 5 1b872: 08 f4 brcc .+2 ; 0x1b876 1b874: 40 e0 ldi r20, 0x00 ; 0 1b876: 0d 2f mov r16, r29 1b878: 27 eb ldi r18, 0xB7 ; 183 1b87a: 39 e8 ldi r19, 0x89 ; 137 1b87c: 68 e0 ldi r22, 0x08 ; 8 1b87e: 82 e0 ldi r24, 0x02 ; 2 1b880: 0e 94 61 d1 call 0x1a2c2 ; 0x1a2c2 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1b884: 41 e0 ldi r20, 0x01 ; 1 1b886: c6 30 cpi r28, 0x06 ; 6 1b888: 21 f0 breq .+8 ; 0x1b892 1b88a: 42 e0 ldi r20, 0x02 ; 2 1b88c: c6 30 cpi r28, 0x06 ; 6 1b88e: 08 f4 brcc .+2 ; 0x1b892 1b890: 40 e0 ldi r20, 0x00 ; 0 1b892: 0d 2f mov r16, r29 1b894: 25 eb ldi r18, 0xB5 ; 181 1b896: 39 e8 ldi r19, 0x89 ; 137 1b898: 6e e0 ldi r22, 0x0E ; 14 1b89a: 82 e0 ldi r24, 0x02 ; 2 1b89c: 0e 94 61 d1 call 0x1a2c2 ; 0x1a2c2 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1b8a0: 41 e0 ldi r20, 0x01 ; 1 1b8a2: c7 30 cpi r28, 0x07 ; 7 1b8a4: 21 f0 breq .+8 ; 0x1b8ae 1b8a6: 42 e0 ldi r20, 0x02 ; 2 1b8a8: c7 30 cpi r28, 0x07 ; 7 1b8aa: 08 f4 brcc .+2 ; 0x1b8ae 1b8ac: 40 e0 ldi r20, 0x00 ; 0 1b8ae: 0d 2f mov r16, r29 1b8b0: 21 eb ldi r18, 0xB1 ; 177 1b8b2: 39 e8 ldi r19, 0x89 ; 137 1b8b4: 60 e0 ldi r22, 0x00 ; 0 1b8b6: 83 e0 ldi r24, 0x03 ; 3 1b8b8: 0e 94 61 d1 call 0x1a2c2 ; 0x1a2c2 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1b8bc: 41 e0 ldi r20, 0x01 ; 1 1b8be: c8 30 cpi r28, 0x08 ; 8 1b8c0: 21 f0 breq .+8 ; 0x1b8ca 1b8c2: 42 e0 ldi r20, 0x02 ; 2 1b8c4: c8 30 cpi r28, 0x08 ; 8 1b8c6: 08 f4 brcc .+2 ; 0x1b8ca 1b8c8: 40 e0 ldi r20, 0x00 ; 0 1b8ca: 0d 2f mov r16, r29 1b8cc: 2a ea ldi r18, 0xAA ; 170 1b8ce: 39 e8 ldi r19, 0x89 ; 137 1b8d0: 69 e0 ldi r22, 0x09 ; 9 1b8d2: 83 e0 ldi r24, 0x03 ; 3 1b8d4: 0e 94 61 d1 call 0x1a2c2 ; 0x1a2c2 1b8d8: 98 cf rjmp .-208 ; 0x1b80a 0001b8da : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1b8da: cf 93 push r28 1b8dc: 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) 1b8de: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1b8e2: 81 11 cpse r24, r1 1b8e4: 18 c0 rjmp .+48 ; 0x1b916 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1b8e6: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1b8ea: 8b e0 ldi r24, 0x0B ; 11 1b8ec: 68 9f mul r22, r24 1b8ee: b0 01 movw r22, r0 1b8f0: 11 24 eor r1, r1 1b8f2: 67 5b subi r22, 0xB7 ; 183 1b8f4: 72 4f sbci r23, 0xF2 ; 242 1b8f6: 47 e0 ldi r20, 0x07 ; 7 1b8f8: 50 e0 ldi r21, 0x00 ; 0 1b8fa: 8b ea ldi r24, 0xAB ; 171 1b8fc: 93 e0 ldi r25, 0x03 ; 3 1b8fe: 0f 94 44 dc call 0x3b888 ; 0x3b888 lcd_encoder = menuData->name[0]; 1b902: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1b906: 90 e0 ldi r25, 0x00 ; 0 1b908: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b90c: 80 93 70 06 sts 0x0670, r24 ; 0x800670 menuData->initialized = true; 1b910: 81 e0 ldi r24, 0x01 ; 1 1b912: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1b916: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b91a: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1b91e: 80 97 sbiw r24, 0x20 ; 32 1b920: 34 f4 brge .+12 ; 0x1b92e 1b922: 80 e2 ldi r24, 0x20 ; 32 1b924: 90 e0 ldi r25, 0x00 ; 0 1b926: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b92a: 80 93 70 06 sts 0x0670, r24 ; 0x800670 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1b92e: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b932: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1b936: 8f 3f cpi r24, 0xFF ; 255 1b938: 91 05 cpc r25, r1 1b93a: 39 f0 breq .+14 ; 0x1b94a 1b93c: 34 f0 brlt .+12 ; 0x1b94a 1b93e: 8f ef ldi r24, 0xFF ; 255 1b940: 90 e0 ldi r25, 0x00 ; 0 1b942: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b946: 80 93 70 06 sts 0x0670, r24 ; 0x800670 menuData->name[menuData->selected] = lcd_encoder; 1b94a: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1b94e: f0 e0 ldi r31, 0x00 ; 0 1b950: e7 55 subi r30, 0x57 ; 87 1b952: fc 4f sbci r31, 0xFC ; 252 1b954: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b958: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1b95a: 0e 94 8c 6e call 0xdd18 ; 0xdd18 1b95e: cb ea ldi r28, 0xAB ; 171 1b960: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1b962: 89 91 ld r24, Y+ 1b964: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 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) 1b968: 83 e0 ldi r24, 0x03 ; 3 1b96a: c2 3b cpi r28, 0xB2 ; 178 1b96c: d8 07 cpc r29, r24 1b96e: c9 f7 brne .-14 ; 0x1b962 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1b970: 4e e5 ldi r20, 0x5E ; 94 1b972: 61 e0 ldi r22, 0x01 ; 1 1b974: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1b978: 0e 94 80 6e call 0xdd00 ; 0xdd00 if (menuData->selected > 0) 1b97c: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1b980: 88 23 and r24, r24 1b982: 29 f0 breq .+10 ; 0x1b98e { lcd_putc_at(menuData->selected-1, 1, ' '); 1b984: 40 e2 ldi r20, 0x20 ; 32 1b986: 61 e0 ldi r22, 0x01 ; 1 1b988: 81 50 subi r24, 0x01 ; 1 1b98a: 0e 94 80 6e call 0xdd00 ; 0xdd00 } if (lcd_clicked()) 1b98e: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 1b992: 88 23 and r24, r24 1b994: 99 f0 breq .+38 ; 0x1b9bc { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1b996: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1b99a: 8e 2f mov r24, r30 1b99c: 90 e0 ldi r25, 0x00 ; 0 1b99e: 01 96 adiw r24, 0x01 ; 1 1b9a0: 07 97 sbiw r24, 0x07 ; 7 1b9a2: 78 f4 brcc .+30 ; 0x1b9c2 { lcd_encoder = menuData->name[++(menuData->selected)]; 1b9a4: ef 5f subi r30, 0xFF ; 255 1b9a6: e0 93 aa 03 sts 0x03AA, r30 ; 0x8003aa 1b9aa: f0 e0 ldi r31, 0x00 ; 0 1b9ac: e7 55 subi r30, 0x57 ; 87 1b9ae: fc 4f sbci r31, 0xFC ; 252 1b9b0: 82 81 ldd r24, Z+2 ; 0x02 1b9b2: 90 e0 ldi r25, 0x00 ; 0 1b9b4: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b9b8: 80 93 70 06 sts 0x0670, r24 ; 0x800670 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1b9bc: df 91 pop r29 1b9be: cf 91 pop r28 1b9c0: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1b9c2: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1b9c6: 8b e0 ldi r24, 0x0B ; 11 1b9c8: 68 9f mul r22, r24 1b9ca: b0 01 movw r22, r0 1b9cc: 11 24 eor r1, r1 1b9ce: 67 5b subi r22, 0xB7 ; 183 1b9d0: 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); 1b9d2: 47 e0 ldi r20, 0x07 ; 7 1b9d4: 50 e0 ldi r21, 0x00 ; 0 1b9d6: 8b ea ldi r24, 0xAB ; 171 1b9d8: 93 e0 ldi r25, 0x03 ; 3 1b9da: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1b9de: df 91 pop r29 1b9e0: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1b9e2: 0d 94 96 d4 jmp 0x3a92c ; 0x3a92c 0001b9e6 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1b9e6: 8f 92 push r8 1b9e8: 9f 92 push r9 1b9ea: af 92 push r10 1b9ec: bf 92 push r11 1b9ee: cf 92 push r12 1b9f0: df 92 push r13 1b9f2: ef 92 push r14 1b9f4: ff 92 push r15 1b9f6: 0f 93 push r16 1b9f8: 1f 93 push r17 1b9fa: cf 93 push r28 1b9fc: df 93 push r29 1b9fe: f8 2e mov r15, r24 1ba00: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1ba04: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1ba08: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1ba0c: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1ba10: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1ba14: 4b 01 movw r8, r22 1ba16: 6b 01 movw r12, r22 1ba18: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1ba1c: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1ba20: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1ba24: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1ba28: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1ba2c: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 1ba2e: ff 20 and r15, r15 1ba30: 09 f4 brne .+2 ; 0x1ba34 1ba32: a6 c0 rjmp .+332 ; 0x1bb80 1ba34: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1ba36: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1ba38: 24 eb ldi r18, 0xB4 ; 180 1ba3a: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1ba3c: 90 e0 ldi r25, 0x00 ; 0 1ba3e: 80 e0 ldi r24, 0x00 ; 0 1ba40: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 1ba44: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 target_temperature_bed = (_isbed) ? 100 : 0; 1ba48: 84 e6 ldi r24, 0x64 ; 100 1ba4a: 90 e0 ldi r25, 0x00 ; 0 1ba4c: f1 10 cpse r15, r1 1ba4e: 02 c0 rjmp .+4 ; 0x1ba54 1ba50: 90 e0 ldi r25, 0x00 ; 0 1ba52: 80 e0 ldi r24, 0x00 ; 0 1ba54: 90 93 73 06 sts 0x0673, r25 ; 0x800673 1ba58: 80 93 72 06 sts 0x0672, r24 ; 0x800672 thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 1ba5c: e0 90 1d 05 lds r14, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); 1ba60: 80 e0 ldi r24, 0x00 ; 0 1ba62: 0f 94 42 33 call 0x26684 ; 0x26684 #endif //THERMAL_MODEL manage_heater(); 1ba66: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 1ba6a: 81 e0 ldi r24, 0x01 ; 1 1ba6c: 0e 94 37 8a call 0x1146e ; 0x1146e for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1ba70: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1ba72: 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 1ba74: 85 e0 ldi r24, 0x05 ; 5 1ba76: 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) 1ba78: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ba7c: 81 11 cpse r24, r1 1ba7e: 1c c0 rjmp .+56 ; 0x1bab8 { manage_heater(); 1ba80: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 1ba84: 81 e0 ldi r24, 0x01 ; 1 1ba86: 0e 94 37 8a call 0x1146e ; 0x1146e _progress = (_isbed? 1ba8a: 00 e9 ldi r16, 0x90 ; 144 1ba8c: 11 e0 ldi r17, 0x01 ; 1 1ba8e: 20 e0 ldi r18, 0x00 ; 0 1ba90: 42 e0 ldi r20, 0x02 ; 2 1ba92: 6a 2d mov r22, r10 1ba94: 87 e0 ldi r24, 0x07 ; 7 1ba96: f1 10 cpse r15, r1 1ba98: 01 c0 rjmp .+2 ; 0x1ba9c 1ba9a: 88 e0 ldi r24, 0x08 ; 8 1ba9c: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1baa0: 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 1baa2: 8b 2d mov r24, r11 1baa4: 68 2d mov r22, r8 1baa6: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__udivmodqi4> 1baaa: 91 11 cpse r25, r1 1baac: 02 c0 rjmp .+4 ; 0x1bab2 1baae: 0e 94 de 76 call 0xedbc ; 0xedbc thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1bab2: b3 94 inc r11 1bab4: b9 10 cpse r11, r9 1bab6: e0 cf rjmp .-64 ; 0x1ba78 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1bab8: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 1babc: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 target_temperature_bed = 0; 1bac0: 10 92 73 06 sts 0x0673, r1 ; 0x800673 1bac4: 10 92 72 06 sts 0x0672, r1 ; 0x800672 manage_heater(); 1bac8: 0f 94 61 39 call 0x272c2 ; 0x272c2 1bacc: b6 01 movw r22, r12 1bace: dd 0c add r13, r13 1bad0: 88 0b sbc r24, r24 1bad2: 99 0b sbc r25, r25 1bad4: 4e 01 movw r8, r28 1bad6: dd 0f add r29, r29 1bad8: aa 08 sbc r10, r10 1bada: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1badc: ff 20 and r15, r15 1bade: 09 f4 brne .+2 ; 0x1bae2 1bae0: 54 c0 rjmp .+168 ; 0x1bb8a 1bae2: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1bae6: 9b 01 movw r18, r22 1bae8: ac 01 movw r20, r24 1baea: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1baee: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1baf2: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1baf6: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1bafa: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1bafe: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1bb02: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1bb04: c5 01 movw r24, r10 1bb06: b4 01 movw r22, r8 1bb08: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1bb0c: 9b 01 movw r18, r22 1bb0e: ac 01 movw r20, r24 1bb10: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1bb14: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1bb18: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1bb1c: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1bb20: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1bb24: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1bb28: 10 91 11 05 lds r17, 0x0511 ; 0x800511 1bb2c: 11 11 cpse r17, r1 1bb2e: 0c c0 rjmp .+24 ; 0x1bb48 1bb30: f1 10 cpse r15, r1 1bb32: 4b c0 rjmp .+150 ; 0x1bbca 1bb34: 69 30 cpi r22, 0x09 ; 9 1bb36: 71 05 cpc r23, r1 1bb38: 0c f0 brlt .+2 ; 0x1bb3c 1bb3a: 4d c0 rjmp .+154 ; 0x1bbd6 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1bb3c: 8e e1 ldi r24, 0x1E ; 30 1bb3e: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1bb40: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1bb42: c8 17 cp r28, r24 1bb44: d9 07 cpc r29, r25 1bb46: 34 f4 brge .+12 ; 0x1bb54 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1bb48: 68 ef ldi r22, 0xF8 ; 248 1bb4a: 72 e0 ldi r23, 0x02 ; 2 1bb4c: 80 e0 ldi r24, 0x00 ; 0 1bb4e: 0f 94 a6 9f call 0x33f4c ; 0x33f4c MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1bb52: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 1bb54: 8e 2d mov r24, r14 1bb56: 0f 94 42 33 call 0x26684 ; 0x26684 #endif //THERMAL_MODEL manage_heater(); 1bb5a: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 1bb5e: 81 e0 ldi r24, 0x01 ; 1 1bb60: 0e 94 37 8a call 0x1146e ; 0x1146e return _stepresult; } 1bb64: 81 2f mov r24, r17 1bb66: df 91 pop r29 1bb68: cf 91 pop r28 1bb6a: 1f 91 pop r17 1bb6c: 0f 91 pop r16 1bb6e: ff 90 pop r15 1bb70: ef 90 pop r14 1bb72: df 90 pop r13 1bb74: cf 90 pop r12 1bb76: bf 90 pop r11 1bb78: af 90 pop r10 1bb7a: 9f 90 pop r9 1bb7c: 8f 90 pop r8 1bb7e: 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 1bb80: 9c e3 ldi r25, 0x3C ; 60 1bb82: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1bb84: 88 ec ldi r24, 0xC8 ; 200 1bb86: 90 e0 ldi r25, 0x00 ; 0 1bb88: 5b cf rjmp .-330 ; 0x1ba40 target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1bb8a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1bb8e: 9b 01 movw r18, r22 1bb90: ac 01 movw r20, r24 1bb92: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1bb96: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1bb9a: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1bb9e: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1bba2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1bba6: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1bbaa: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1bbac: c5 01 movw r24, r10 1bbae: b4 01 movw r22, r8 1bbb0: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1bbb4: 9b 01 movw r18, r22 1bbb6: ac 01 movw r20, r24 1bbb8: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1bbbc: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1bbc0: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1bbc4: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1bbc8: ab cf rjmp .-170 ; 0x1bb20 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1bbca: 89 e0 ldi r24, 0x09 ; 9 1bbcc: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1bbce: 6e 31 cpi r22, 0x1E ; 30 1bbd0: 71 05 cpc r23, r1 1bbd2: 0c f4 brge .+2 ; 0x1bbd6 1bbd4: b5 cf rjmp .-150 ; 0x1bb40 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1bbd6: 68 ef ldi r22, 0xF8 ; 248 1bbd8: 72 e0 ldi r23, 0x02 ; 2 1bbda: 81 e0 ldi r24, 0x01 ; 1 1bbdc: 0f 94 a6 9f call 0x33f4c ; 0x33f4c 1bbe0: b9 cf rjmp .-142 ; 0x1bb54 0001bbe2 : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1bbe2: cf 93 push r28 1bbe4: df 93 push r29 current_position[axis] += 10; 1bbe6: 94 e0 ldi r25, 0x04 ; 4 1bbe8: 89 9f mul r24, r25 1bbea: e0 01 movw r28, r0 1bbec: 11 24 eor r1, r1 1bbee: ce 56 subi r28, 0x6E ; 110 1bbf0: d9 4f sbci r29, 0xF9 ; 249 1bbf2: 20 e0 ldi r18, 0x00 ; 0 1bbf4: 30 e0 ldi r19, 0x00 ; 0 1bbf6: 40 e2 ldi r20, 0x20 ; 32 1bbf8: 51 e4 ldi r21, 0x41 ; 65 1bbfa: 68 81 ld r22, Y 1bbfc: 79 81 ldd r23, Y+1 ; 0x01 1bbfe: 8a 81 ldd r24, Y+2 ; 0x02 1bc00: 9b 81 ldd r25, Y+3 ; 0x03 1bc02: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1bc06: 68 83 st Y, r22 1bc08: 79 83 std Y+1, r23 ; 0x01 1bc0a: 8a 83 std Y+2, r24 ; 0x02 1bc0c: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bc0e: 60 e0 ldi r22, 0x00 ; 0 1bc10: 70 e0 ldi r23, 0x00 ; 0 1bc12: 84 e3 ldi r24, 0x34 ; 52 1bc14: 92 e4 ldi r25, 0x42 ; 66 1bc16: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1bc1a: 0f 94 ed 43 call 0x287da ; 0x287da crashdet_use_eeprom_setting(); } 1bc1e: df 91 pop r29 1bc20: 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(); 1bc22: 0d 94 5a 27 jmp 0x24eb4 ; 0x24eb4 0001bc26 : } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 1bc26: 2f 92 push r2 1bc28: 3f 92 push r3 1bc2a: 4f 92 push r4 1bc2c: 5f 92 push r5 1bc2e: 6f 92 push r6 1bc30: 7f 92 push r7 1bc32: 8f 92 push r8 1bc34: 9f 92 push r9 1bc36: af 92 push r10 1bc38: bf 92 push r11 1bc3a: cf 92 push r12 1bc3c: df 92 push r13 1bc3e: ef 92 push r14 1bc40: ff 92 push r15 1bc42: 1f 93 push r17 1bc44: cf 93 push r28 1bc46: df 93 push r29 1bc48: 00 d0 rcall .+0 ; 0x1bc4a 1bc4a: 00 d0 rcall .+0 ; 0x1bc4c 1bc4c: 1f 92 push r1 1bc4e: cd b7 in r28, 0x3d ; 61 1bc50: de b7 in r29, 0x3e ; 62 1bc52: 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) { 1bc54: 68 2e mov r6, r24 1bc56: 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; 1bc58: 81 2c mov r8, r1 1bc5a: 20 e8 ldi r18, 0x80 ; 128 1bc5c: 92 2e mov r9, r18 1bc5e: 2c e5 ldi r18, 0x5C ; 92 1bc60: a2 2e mov r10, r18 1bc62: 23 e4 ldi r18, 0x43 ; 67 1bc64: 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) { 1bc66: 81 30 cpi r24, 0x01 ; 1 1bc68: 31 f0 breq .+12 ; 0x1bc76 case 0: axis_length = X_MAX_POS; break; 1bc6a: 81 2c mov r8, r1 1bc6c: 91 2c mov r9, r1 1bc6e: 9f e7 ldi r25, 0x7F ; 127 1bc70: a9 2e mov r10, r25 1bc72: 93 e4 ldi r25, 0x43 ; 67 1bc74: 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; 1bc76: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 1bc7a: 0f 94 ae 26 call 0x24d5c ; 0x24d5c 1bc7e: 81 e0 ldi r24, 0x01 ; 1 1bc80: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 1bc84: 60 e0 ldi r22, 0x00 ; 0 1bc86: 70 e0 ldi r23, 0x00 ; 0 1bc88: 80 ea ldi r24, 0xA0 ; 160 1bc8a: 90 e4 ldi r25, 0x40 ; 64 1bc8c: 0e 94 e0 6d call 0xdbc0 ; 0xdbc0 tmc2130_home_enter(1 << axis); 1bc90: 81 e0 ldi r24, 0x01 ; 1 1bc92: 01 2e mov r0, r17 1bc94: 01 c0 rjmp .+2 ; 0x1bc98 1bc96: 88 0f add r24, r24 1bc98: 0a 94 dec r0 1bc9a: ea f7 brpl .-6 ; 0x1bc96 1bc9c: 0f 94 dd 26 call 0x24dba ; 0x24dba // first axis length measurement begin current_position[axis] -= (axis_length + margin); 1bca0: 20 e0 ldi r18, 0x00 ; 0 1bca2: 30 e0 ldi r19, 0x00 ; 0 1bca4: 40 e7 ldi r20, 0x70 ; 112 1bca6: 52 e4 ldi r21, 0x42 ; 66 1bca8: c5 01 movw r24, r10 1bcaa: b4 01 movw r22, r8 1bcac: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1bcb0: 69 83 std Y+1, r22 ; 0x01 1bcb2: 7a 83 std Y+2, r23 ; 0x02 1bcb4: 8b 83 std Y+3, r24 ; 0x03 1bcb6: 9c 83 std Y+4, r25 ; 0x04 1bcb8: 13 01 movw r2, r6 1bcba: 22 0c add r2, r2 1bcbc: 33 1c adc r3, r3 1bcbe: 22 0c add r2, r2 1bcc0: 33 1c adc r3, r3 1bcc2: c1 01 movw r24, r2 1bcc4: 8e 56 subi r24, 0x6E ; 110 1bcc6: 99 4f sbci r25, 0xF9 ; 249 1bcc8: 9e 83 std Y+6, r25 ; 0x06 1bcca: 8d 83 std Y+5, r24 ; 0x05 1bccc: 29 81 ldd r18, Y+1 ; 0x01 1bcce: 3a 81 ldd r19, Y+2 ; 0x02 1bcd0: 4b 81 ldd r20, Y+3 ; 0x03 1bcd2: 5c 81 ldd r21, Y+4 ; 0x04 1bcd4: fc 01 movw r30, r24 1bcd6: 60 81 ld r22, Z 1bcd8: 71 81 ldd r23, Z+1 ; 0x01 1bcda: 82 81 ldd r24, Z+2 ; 0x02 1bcdc: 93 81 ldd r25, Z+3 ; 0x03 1bcde: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1bce2: ed 81 ldd r30, Y+5 ; 0x05 1bce4: fe 81 ldd r31, Y+6 ; 0x06 1bce6: 60 83 st Z, r22 1bce8: 71 83 std Z+1, r23 ; 0x01 1bcea: 82 83 std Z+2, r24 ; 0x02 1bcec: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bcee: 60 e0 ldi r22, 0x00 ; 0 1bcf0: 70 e0 ldi r23, 0x00 ; 0 1bcf2: 84 e3 ldi r24, 0x34 ; 52 1bcf4: 92 e4 ldi r25, 0x42 ; 66 1bcf6: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1bcfa: 0f 94 ed 43 call 0x287da ; 0x287da #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 1bcfe: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.475> tmc2130_sg_measure_cnt = 0; 1bd02: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.477> 1bd06: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x1> 1bd0a: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x2> 1bd0e: 10 92 d0 03 sts 0x03D0, r1 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x3> tmc2130_sg_measure_val = 0; 1bd12: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.476> 1bd16: 10 92 d2 03 sts 0x03D2, r1 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x1> 1bd1a: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x2> 1bd1e: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x3> tmc2130_sg_measure_start(axis); current_position_init = st_get_position_mm(axis); 1bd22: 81 2f mov r24, r17 1bd24: 0f 94 d9 43 call 0x287b2 ; 0x287b2 1bd28: 6b 01 movw r12, r22 1bd2a: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 1bd2c: 20 e0 ldi r18, 0x00 ; 0 1bd2e: 30 e0 ldi r19, 0x00 ; 0 1bd30: 40 ef ldi r20, 0xF0 ; 240 1bd32: 52 e4 ldi r21, 0x42 ; 66 1bd34: ed 81 ldd r30, Y+5 ; 0x05 1bd36: fe 81 ldd r31, Y+6 ; 0x06 1bd38: 60 81 ld r22, Z 1bd3a: 71 81 ldd r23, Z+1 ; 0x01 1bd3c: 82 81 ldd r24, Z+2 ; 0x02 1bd3e: 93 81 ldd r25, Z+3 ; 0x03 1bd40: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1bd44: ed 81 ldd r30, Y+5 ; 0x05 1bd46: fe 81 ldd r31, Y+6 ; 0x06 1bd48: 60 83 st Z, r22 1bd4a: 71 83 std Z+1, r23 ; 0x01 1bd4c: 82 83 std Z+2, r24 ; 0x02 1bd4e: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bd50: 60 e0 ldi r22, 0x00 ; 0 1bd52: 70 e0 ldi r23, 0x00 ; 0 1bd54: 84 e3 ldi r24, 0x34 ; 52 1bd56: 92 e4 ldi r25, 0x42 ; 66 1bd58: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1bd5c: 0f 94 ed 43 call 0x287da ; 0x287da current_position[axis] += axis_length; 1bd60: a5 01 movw r20, r10 1bd62: 94 01 movw r18, r8 1bd64: ed 81 ldd r30, Y+5 ; 0x05 1bd66: fe 81 ldd r31, Y+6 ; 0x06 1bd68: 60 81 ld r22, Z 1bd6a: 71 81 ldd r23, Z+1 ; 0x01 1bd6c: 82 81 ldd r24, Z+2 ; 0x02 1bd6e: 93 81 ldd r25, Z+3 ; 0x03 1bd70: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1bd74: ed 81 ldd r30, Y+5 ; 0x05 1bd76: fe 81 ldd r31, Y+6 ; 0x06 1bd78: 60 83 st Z, r22 1bd7a: 71 83 std Z+1, r23 ; 0x01 1bd7c: 82 83 std Z+2, r24 ; 0x02 1bd7e: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bd80: 60 e0 ldi r22, 0x00 ; 0 1bd82: 70 e0 ldi r23, 0x00 ; 0 1bd84: 84 e3 ldi r24, 0x34 ; 52 1bd86: 92 e4 ldi r25, 0x42 ; 66 1bd88: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1bd8c: 0f 94 ed 43 call 0x287da ; 0x287da } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 1bd90: 8f ef ldi r24, 0xFF ; 255 1bd92: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.475> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 1bd96: 60 91 d1 03 lds r22, 0x03D1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.476> 1bd9a: 70 91 d2 03 lds r23, 0x03D2 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x1> 1bd9e: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x2> 1bda2: 90 91 d4 03 lds r25, 0x03D4 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x3> 1bda6: 20 91 cd 03 lds r18, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.477> 1bdaa: 30 91 ce 03 lds r19, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x1> 1bdae: 40 91 cf 03 lds r20, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x2> 1bdb2: 50 91 d0 03 lds r21, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x3> 1bdb6: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 1bdba: 2d 83 std Y+5, r18 ; 0x05 1bdbc: 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); 1bdbe: 3f 93 push r19 1bdc0: 2f 93 push r18 1bdc2: f8 e5 ldi r31, 0x58 ; 88 1bdc4: 6f 0e add r6, r31 1bdc6: 71 1c adc r7, r1 1bdc8: 7f 92 push r7 1bdca: 6f 92 push r6 1bdcc: 8a e9 ldi r24, 0x9A ; 154 1bdce: 99 e8 ldi r25, 0x89 ; 137 1bdd0: 9f 93 push r25 1bdd2: 8f 93 push r24 1bdd4: 0f 94 16 db call 0x3b62c ; 0x3b62c eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 1bdd8: 0f 90 pop r0 1bdda: 0f 90 pop r0 1bddc: 0f 90 pop r0 1bdde: 0f 90 pop r0 1bde0: 0f 90 pop r0 1bde2: 0f 90 pop r0 1bde4: 8b e5 ldi r24, 0x5B ; 91 1bde6: 9f e0 ldi r25, 0x0F ; 15 1bde8: 11 11 cpse r17, r1 1bdea: 02 c0 rjmp .+4 ; 0x1bdf0 1bdec: 8d e5 ldi r24, 0x5D ; 93 1bdee: 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); 1bdf0: 6d 81 ldd r22, Y+5 ; 0x05 1bdf2: 7f 81 ldd r23, Y+7 ; 0x07 1bdf4: 0f 94 b2 dc call 0x3b964 ; 0x3b964 current_position_final = st_get_position_mm(axis); 1bdf8: 81 2f mov r24, r17 1bdfa: 0f 94 d9 43 call 0x287b2 ; 0x287b2 1bdfe: 2b 01 movw r4, r22 1be00: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 1be02: a7 01 movw r20, r14 1be04: 96 01 movw r18, r12 1be06: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1be0a: 6b 01 movw r12, r22 1be0c: 7c 01 movw r14, r24 1be0e: e8 94 clt 1be10: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 1be12: c1 01 movw r24, r2 1be14: 8e 56 subi r24, 0x6E ; 110 1be16: 99 4f sbci r25, 0xF9 ; 249 1be18: 9e 83 std Y+6, r25 ; 0x06 1be1a: 8d 83 std Y+5, r24 ; 0x05 1be1c: 20 e0 ldi r18, 0x00 ; 0 1be1e: 30 e0 ldi r19, 0x00 ; 0 1be20: 40 e7 ldi r20, 0x70 ; 112 1be22: 52 e4 ldi r21, 0x42 ; 66 1be24: fc 01 movw r30, r24 1be26: 60 81 ld r22, Z 1be28: 71 81 ldd r23, Z+1 ; 0x01 1be2a: 82 81 ldd r24, Z+2 ; 0x02 1be2c: 93 81 ldd r25, Z+3 ; 0x03 1be2e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1be32: ed 81 ldd r30, Y+5 ; 0x05 1be34: fe 81 ldd r31, Y+6 ; 0x06 1be36: 60 83 st Z, r22 1be38: 71 83 std Z+1, r23 ; 0x01 1be3a: 82 83 std Z+2, r24 ; 0x02 1be3c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1be3e: 60 e0 ldi r22, 0x00 ; 0 1be40: 70 e0 ldi r23, 0x00 ; 0 1be42: 84 e3 ldi r24, 0x34 ; 52 1be44: 92 e4 ldi r25, 0x42 ; 66 1be46: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1be4a: 0f 94 ed 43 call 0x287da ; 0x287da current_position[axis] -= (axis_length + margin); 1be4e: 29 81 ldd r18, Y+1 ; 0x01 1be50: 3a 81 ldd r19, Y+2 ; 0x02 1be52: 4b 81 ldd r20, Y+3 ; 0x03 1be54: 5c 81 ldd r21, Y+4 ; 0x04 1be56: ed 81 ldd r30, Y+5 ; 0x05 1be58: fe 81 ldd r31, Y+6 ; 0x06 1be5a: 60 81 ld r22, Z 1be5c: 71 81 ldd r23, Z+1 ; 0x01 1be5e: 82 81 ldd r24, Z+2 ; 0x02 1be60: 93 81 ldd r25, Z+3 ; 0x03 1be62: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1be66: ed 81 ldd r30, Y+5 ; 0x05 1be68: fe 81 ldd r31, Y+6 ; 0x06 1be6a: 60 83 st Z, r22 1be6c: 71 83 std Z+1, r23 ; 0x01 1be6e: 82 83 std Z+2, r24 ; 0x02 1be70: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1be72: 60 e0 ldi r22, 0x00 ; 0 1be74: 70 e0 ldi r23, 0x00 ; 0 1be76: 84 e3 ldi r24, 0x34 ; 52 1be78: 92 e4 ldi r25, 0x42 ; 66 1be7a: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1be7e: 0f 94 ed 43 call 0x287da ; 0x287da current_position_init = st_get_position_mm(axis); 1be82: 81 2f mov r24, r17 1be84: 0f 94 d9 43 call 0x287b2 ; 0x287b2 1be88: 9b 01 movw r18, r22 1be8a: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 1be8c: c3 01 movw r24, r6 1be8e: b2 01 movw r22, r4 1be90: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1be94: 2b 01 movw r4, r22 1be96: 3c 01 movw r6, r24 1be98: e8 94 clt 1be9a: 77 f8 bld r7, 7 tmc2130_home_exit(); 1be9c: 0f 94 ae 26 call 0x24d5c ; 0x24d5c //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]); 1bea0: ff 92 push r15 1bea2: ef 92 push r14 1bea4: df 92 push r13 1bea6: cf 92 push r12 1bea8: 83 ec ldi r24, 0xC3 ; 195 1beaa: 9a e6 ldi r25, 0x6A ; 106 1beac: 9f 93 push r25 1beae: 8f 93 push r24 1beb0: 0f 94 16 db call 0x3b62c ; 0x3b62c if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 1beb4: a5 01 movw r20, r10 1beb6: 94 01 movw r18, r8 1beb8: c7 01 movw r24, r14 1beba: b6 01 movw r22, r12 1bebc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1bec0: 9f 77 andi r25, 0x7F ; 127 1bec2: 0f 90 pop r0 1bec4: 0f 90 pop r0 1bec6: 0f 90 pop r0 1bec8: 0f 90 pop r0 1beca: 0f 90 pop r0 1becc: 0f 90 pop r0 1bece: 20 e0 ldi r18, 0x00 ; 0 1bed0: 30 e0 ldi r19, 0x00 ; 0 1bed2: 40 ea ldi r20, 0xA0 ; 160 1bed4: 50 e4 ldi r21, 0x40 ; 64 1bed6: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1beda: 18 16 cp r1, r24 1bedc: 0c f4 brge .+2 ; 0x1bee0 1bede: 53 c0 rjmp .+166 ; 0x1bf86 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]); 1bee0: 7f 92 push r7 1bee2: 6f 92 push r6 1bee4: 5f 92 push r5 1bee6: 4f 92 push r4 1bee8: 83 ec ldi r24, 0xC3 ; 195 1beea: 9a e6 ldi r25, 0x6A ; 106 1beec: 9f 93 push r25 1beee: 8f 93 push r24 1bef0: 0f 94 16 db call 0x3b62c ; 0x3b62c if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 1bef4: a5 01 movw r20, r10 1bef6: 94 01 movw r18, r8 1bef8: c3 01 movw r24, r6 1befa: b2 01 movw r22, r4 1befc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1bf00: 9f 77 andi r25, 0x7F ; 127 1bf02: 0f 90 pop r0 1bf04: 0f 90 pop r0 1bf06: 0f 90 pop r0 1bf08: 0f 90 pop r0 1bf0a: 0f 90 pop r0 1bf0c: 0f 90 pop r0 1bf0e: 20 e0 ldi r18, 0x00 ; 0 1bf10: 30 e0 ldi r19, 0x00 ; 0 1bf12: 40 ea ldi r20, 0xA0 ; 160 1bf14: 50 e4 ldi r21, 0x40 ; 64 1bf16: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1bf1a: 18 16 cp r1, r24 1bf1c: a4 f1 brlt .+104 ; 0x1bf86 endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 1bf1e: a3 01 movw r20, r6 1bf20: 92 01 movw r18, r4 1bf22: c7 01 movw r24, r14 1bf24: b6 01 movw r22, r12 1bf26: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1bf2a: 6b 01 movw r12, r22 1bf2c: 7c 01 movw r14, r24 1bf2e: e8 94 clt 1bf30: f7 f8 bld r15, 7 1bf32: ff 92 push r15 1bf34: ef 92 push r14 1bf36: df 92 push r13 1bf38: cf 92 push r12 1bf3a: 86 ea ldi r24, 0xA6 ; 166 1bf3c: 9a e6 ldi r25, 0x6A ; 106 1bf3e: 9f 93 push r25 1bf40: 8f 93 push r24 1bf42: 0f 94 16 db call 0x3b62c ; 0x3b62c if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 1bf46: 0f 90 pop r0 1bf48: 0f 90 pop r0 1bf4a: 0f 90 pop r0 1bf4c: 0f 90 pop r0 1bf4e: 0f 90 pop r0 1bf50: 0f 90 pop r0 1bf52: 20 e0 ldi r18, 0x00 ; 0 1bf54: 30 e0 ldi r19, 0x00 ; 0 1bf56: 40 e8 ldi r20, 0x80 ; 128 1bf58: 5f e3 ldi r21, 0x3F ; 63 1bf5a: c7 01 movw r24, r14 1bf5c: b6 01 movw r22, r12 1bf5e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1bf62: 18 16 cp r1, r24 1bf64: 0c f4 brge .+2 ; 0x1bf68 1bf66: 44 c0 rjmp .+136 ; 0x1bff0 plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 1bf68: ed 81 ldd r30, Y+5 ; 0x05 1bf6a: fe 81 ldd r31, Y+6 ; 0x06 1bf6c: 10 82 st Z, r1 1bf6e: 11 82 std Z+1, r1 ; 0x01 1bf70: 12 82 std Z+2, r1 ; 0x02 1bf72: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1bf74: 0f 94 41 bf call 0x37e82 ; 0x37e82 reset_crash_det(axis); 1bf78: 81 2f mov r24, r17 1bf7a: 0e 94 f1 dd call 0x1bbe2 ; 0x1bbe2 endstops_hit_on_purpose(); 1bf7e: 0f 94 03 4f call 0x29e06 ; 0x29e06 return true; 1bf82: 81 e0 ldi r24, 0x01 ; 1 1bf84: 1d c0 rjmp .+58 ; 0x1bfc0 1bf86: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(false); const char *_error_1; if (axis == X_AXIS) _error_1 = "X"; if (axis == Y_AXIS) _error_1 = "Y"; 1bf8a: 63 ee ldi r22, 0xE3 ; 227 1bf8c: 72 e0 ldi r23, 0x02 ; 2 1bf8e: 11 30 cpi r17, 0x01 ; 1 1bf90: 11 f0 breq .+4 ; 0x1bf96 1bf92: 61 ee ldi r22, 0xE1 ; 225 1bf94: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 1bf96: 88 e0 ldi r24, 0x08 ; 8 1bf98: 0f 94 a6 9f call 0x33f4c ; 0x33f4c current_position[axis] = 0; 1bf9c: f1 01 movw r30, r2 1bf9e: ee 56 subi r30, 0x6E ; 110 1bfa0: f9 4f sbci r31, 0xF9 ; 249 1bfa2: 10 82 st Z, r1 1bfa4: 11 82 std Z+1, r1 ; 0x01 1bfa6: 12 82 std Z+2, r1 ; 0x02 1bfa8: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1bfaa: 0f 94 41 bf call 0x37e82 ; 0x37e82 reset_crash_det(axis); 1bfae: 81 2f mov r24, r17 1bfb0: 0e 94 f1 dd call 0x1bbe2 ; 0x1bbe2 1bfb4: 81 e0 ldi r24, 0x01 ; 1 1bfb6: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> lcd_selftest_error(TestError::Pulley, _error_1, ""); current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); 1bfba: 0f 94 03 4f call 0x29e06 ; 0x29e06 return false; 1bfbe: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 1bfc0: 27 96 adiw r28, 0x07 ; 7 1bfc2: 0f b6 in r0, 0x3f ; 63 1bfc4: f8 94 cli 1bfc6: de bf out 0x3e, r29 ; 62 1bfc8: 0f be out 0x3f, r0 ; 63 1bfca: cd bf out 0x3d, r28 ; 61 1bfcc: df 91 pop r29 1bfce: cf 91 pop r28 1bfd0: 1f 91 pop r17 1bfd2: ff 90 pop r15 1bfd4: ef 90 pop r14 1bfd6: df 90 pop r13 1bfd8: cf 90 pop r12 1bfda: bf 90 pop r11 1bfdc: af 90 pop r10 1bfde: 9f 90 pop r9 1bfe0: 8f 90 pop r8 1bfe2: 7f 90 pop r7 1bfe4: 6f 90 pop r6 1bfe6: 5f 90 pop r5 1bfe8: 4f 90 pop r4 1bfea: 3f 90 pop r3 1bfec: 2f 90 pop r2 1bfee: 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"; 1bff0: 63 ee ldi r22, 0xE3 ; 227 1bff2: 72 e0 ldi r23, 0x02 ; 2 1bff4: 11 30 cpi r17, 0x01 ; 1 1bff6: 11 f0 breq .+4 ; 0x1bffc 1bff8: 61 ee ldi r22, 0xE1 ; 225 1bffa: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 1bffc: 87 e0 ldi r24, 0x07 ; 7 1bffe: 0f 94 a6 9f call 0x33f4c ; 0x33f4c current_position[axis] = 0; 1c002: f1 01 movw r30, r2 1c004: ee 56 subi r30, 0x6E ; 110 1c006: f9 4f sbci r31, 0xF9 ; 249 1c008: 10 82 st Z, r1 1c00a: 11 82 std Z+1, r1 ; 0x01 1c00c: 12 82 std Z+2, r1 ; 0x02 1c00e: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1c010: 0f 94 41 bf call 0x37e82 ; 0x37e82 reset_crash_det(axis); 1c014: 81 2f mov r24, r17 1c016: 0e 94 f1 dd call 0x1bbe2 ; 0x1bbe2 1c01a: cf cf rjmp .-98 ; 0x1bfba 0001c01c : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 1c01c: 89 e6 ldi r24, 0x69 ; 105 1c01e: 9f e0 ldi r25, 0x0F ; 15 1c020: 0e 94 b4 75 call 0xeb68 ; 0xeb68 crashdet_use_eeprom_setting(); 1c024: 0d 94 5a 27 jmp 0x24eb4 ; 0x24eb4 0001c028 : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 1c028: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 1c02c: 88 e5 ldi r24, 0x58 ; 88 1c02e: 9a e3 ldi r25, 0x3A ; 58 1c030: 0e 94 2c 72 call 0xe458 ; 0xe458 1c034: 0e 94 4b 6e call 0xdc96 ; 0xdc96 menu_back_if_clicked(); 1c038: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 0001c03c : } static void lcd_crash_mode_info2() { lcd_home(); 1c03c: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 1c040: 8f e8 ldi r24, 0x8F ; 143 1c042: 9a e3 ldi r25, 0x3A ; 58 1c044: 0e 94 2c 72 call 0xe458 ; 0xe458 1c048: 0e 94 4b 6e call 0xdc96 ; 0xdc96 menu_back_if_clicked(); 1c04c: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 0001c050 : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 1c050: 0f 93 push r16 1c052: 1f 93 push r17 1c054: cf 93 push r28 1c056: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 1c058: 0e 94 93 6e call 0xdd26 ; 0xdd26 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 1c05c: 81 e0 ldi r24, 0x01 ; 1 1c05e: 0e 94 30 66 call 0xcc60 ; 0xcc60 uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 1c062: 8d e5 ldi r24, 0x5D ; 93 1c064: 9f e0 ldi r25, 0x0F ; 15 1c066: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1c06a: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 1c06c: 8b e5 ldi r24, 0x5B ; 91 1c06e: 9f e0 ldi r25, 0x0F ; 15 1c070: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1c074: 18 2f mov r17, r24 1c076: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 1c078: 8a e1 ldi r24, 0x1A ; 26 1c07a: 99 e4 ldi r25, 0x49 ; 73 1c07c: 0e 94 2c 72 call 0xe458 ; 0xe458 1c080: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 1c084: 61 e0 ldi r22, 0x01 ; 1 1c086: 80 e0 ldi r24, 0x00 ; 0 1c088: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 1c08c: df 93 push r29 1c08e: cf 93 push r28 1c090: 81 e8 ldi r24, 0x81 ; 129 1c092: 99 e8 ldi r25, 0x89 ; 137 1c094: 9f 93 push r25 1c096: 8f 93 push r24 1c098: 0e 94 39 6e call 0xdc72 ; 0xdc72 KEEPALIVE_STATE(IN_HANDLER); 1c09c: 82 e0 ldi r24, 0x02 ; 2 1c09e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // 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)){ 1c0a2: 80 e0 ldi r24, 0x00 ; 0 1c0a4: 0e 94 13 de call 0x1bc26 ; 0x1bc26 1c0a8: 0f 90 pop r0 1c0aa: 0f 90 pop r0 1c0ac: 0f 90 pop r0 1c0ae: 0f 90 pop r0 1c0b0: 88 23 and r24, r24 1c0b2: 09 f4 brne .+2 ; 0x1c0b6 1c0b4: 45 c0 rjmp .+138 ; 0x1c140 X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 1c0b6: 8d e5 ldi r24, 0x5D ; 93 1c0b8: 9f e0 ldi r25, 0x0F ; 15 1c0ba: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1c0be: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 1c0c0: 61 e0 ldi r22, 0x01 ; 1 1c0c2: 8a e0 ldi r24, 0x0A ; 10 1c0c4: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 1c0c8: be 01 movw r22, r28 1c0ca: 90 e0 ldi r25, 0x00 ; 0 1c0cc: 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); 1c0ce: 4a e0 ldi r20, 0x0A ; 10 1c0d0: 0e 94 b4 6f call 0xdf68 ; 0xdf68 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 1c0d4: 88 e0 ldi r24, 0x08 ; 8 1c0d6: 99 e4 ldi r25, 0x49 ; 73 1c0d8: 0e 94 2c 72 call 0xe458 ; 0xe458 1c0dc: ac 01 movw r20, r24 1c0de: 62 e0 ldi r22, 0x02 ; 2 1c0e0: 80 e0 ldi r24, 0x00 ; 0 1c0e2: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 1c0e6: 63 e0 ldi r22, 0x03 ; 3 1c0e8: 80 e0 ldi r24, 0x00 ; 0 1c0ea: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 1c0ee: 0f 93 push r16 1c0f0: 1f 93 push r17 1c0f2: 84 e7 ldi r24, 0x74 ; 116 1c0f4: 99 e8 ldi r25, 0x89 ; 137 1c0f6: 9f 93 push r25 1c0f8: 8f 93 push r24 1c0fa: 0e 94 39 6e call 0xdc72 ; 0xdc72 if (lcd_selfcheck_axis_sg(Y_AXIS)) 1c0fe: 81 e0 ldi r24, 0x01 ; 1 1c100: 0e 94 13 de call 0x1bc26 ; 0x1bc26 1c104: 0f 90 pop r0 1c106: 0f 90 pop r0 1c108: 0f 90 pop r0 1c10a: 0f 90 pop r0 1c10c: 88 23 and r24, r24 1c10e: c1 f0 breq .+48 ; 0x1c140 { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 1c110: 8b e5 ldi r24, 0x5B ; 91 1c112: 9f e0 ldi r25, 0x0F ; 15 1c114: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1c118: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 1c11a: 63 e0 ldi r22, 0x03 ; 3 1c11c: 8a e0 ldi r24, 0x0A ; 10 1c11e: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 1c122: be 01 movw r22, r28 1c124: 90 e0 ldi r25, 0x00 ; 0 1c126: 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); 1c128: 4a e0 ldi r20, 0x0A ; 10 1c12a: 0e 94 b4 6f call 0xdf68 ; 0xdf68 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 1c12e: 43 e8 ldi r20, 0x83 ; 131 1c130: 63 e0 ldi r22, 0x03 ; 3 1c132: 83 e1 ldi r24, 0x13 ; 19 1c134: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_wait_for_click_delay(10); 1c138: 8a e0 ldi r24, 0x0A ; 10 1c13a: 90 e0 ldi r25, 0x00 ; 0 1c13c: 0f 94 34 3b call 0x27668 ; 0x27668 } } FORCE_HIGH_POWER_END; 1c140: 80 e0 ldi r24, 0x00 ; 0 1c142: 0e 94 30 66 call 0xcc60 ; 0xcc60 KEEPALIVE_STATE(NOT_BUSY); 1c146: 81 e0 ldi r24, 0x01 ; 1 1c148: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 1c14c: df 91 pop r29 1c14e: cf 91 pop r28 1c150: 1f 91 pop r17 1c152: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 1c154: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 0001c158 : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1c158: 0f 94 cd 7d call 0x2fb9a ; 0x2fb9a #endif menu_top = 0; 1c15c: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1c160: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1c164: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1c168: 0d 94 f0 d1 jmp 0x3a3e0 ; 0x3a3e0 0001c16c : } } void CardReader::updir() { if(workDirDepth > 0) 1c16c: 80 91 30 16 lds r24, 0x1630 ; 0x801630 1c170: 88 23 and r24, r24 1c172: f9 f0 breq .+62 ; 0x1c1b2 { --workDirDepth; 1c174: 81 50 subi r24, 0x01 ; 1 1c176: 80 93 30 16 sts 0x1630, r24 ; 0x801630 workDir = workDirParents[0]; 1c17a: 93 e2 ldi r25, 0x23 ; 35 1c17c: ee e5 ldi r30, 0x5E ; 94 1c17e: f5 e1 ldi r31, 0x15 ; 21 1c180: ab e3 ldi r26, 0x3B ; 59 1c182: b5 e1 ldi r27, 0x15 ; 21 1c184: 01 90 ld r0, Z+ 1c186: 0d 92 st X+, r0 1c188: 9a 95 dec r25 1c18a: e1 f7 brne .-8 ; 0x1c184 1c18c: 2e e5 ldi r18, 0x5E ; 94 1c18e: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1c190: 90 e0 ldi r25, 0x00 ; 0 1c192: 98 17 cp r25, r24 1c194: 60 f4 brcc .+24 ; 0x1c1ae { workDirParents[d] = workDirParents[d+1]; 1c196: 43 e2 ldi r20, 0x23 ; 35 1c198: f9 01 movw r30, r18 1c19a: b3 96 adiw r30, 0x23 ; 35 1c19c: d9 01 movw r26, r18 1c19e: 01 90 ld r0, Z+ 1c1a0: 0d 92 st X+, r0 1c1a2: 4a 95 dec r20 1c1a4: e1 f7 brne .-8 ; 0x1c19e { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1c1a6: 9f 5f subi r25, 0xFF ; 255 1c1a8: 2d 5d subi r18, 0xDD ; 221 1c1aa: 3f 4f sbci r19, 0xFF ; 255 1c1ac: f2 cf rjmp .-28 ; 0x1c192 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1c1ae: 0f 94 cd 7d call 0x2fb9a ; 0x2fb9a } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1c1b2: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1c1b6: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1c1ba: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1c1be: 0d 94 f0 d1 jmp 0x3a3e0 ; 0x3a3e0 0001c1c2 : } backlight_save(); } static void lcd_backlight_menu() { 1c1c2: ef 92 push r14 1c1c4: ff 92 push r15 1c1c6: 0f 93 push r16 1c1c8: 1f 93 push r17 1c1ca: cf 93 push r28 1c1cc: df 93 push r29 MENU_BEGIN(); 1c1ce: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1c1d2: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c1d6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c1da: 84 30 cpi r24, 0x04 ; 4 1c1dc: 08 f0 brcs .+2 ; 0x1c1e0 1c1de: 63 c0 rjmp .+198 ; 0x1c2a6 1c1e0: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c1e4: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 1c1e8: 81 11 cpse r24, r1 1c1ea: 0e 94 b7 89 call 0x1136e ; 0x1136e backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1c1ee: 8f e4 ldi r24, 0x4F ; 79 1c1f0: 99 e4 ldi r25, 0x49 ; 73 1c1f2: 0e 94 2c 72 call 0xe458 ; 0xe458 1c1f6: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1c1fa: c0 91 00 04 lds r28, 0x0400 ; 0x800400 1c1fe: d0 e0 ldi r29, 0x00 ; 0 1c200: 8b ed ldi r24, 0xDB ; 219 1c202: 97 e4 ldi r25, 0x47 ; 71 1c204: 0e 94 2c 72 call 0xe458 ; 0xe458 1c208: f1 2c mov r15, r1 1c20a: e1 2c mov r14, r1 1c20c: 0f ef ldi r16, 0xFF ; 255 1c20e: 10 e0 ldi r17, 0x00 ; 0 1c210: 9e 01 movw r18, r28 1c212: 48 e0 ldi r20, 0x08 ; 8 1c214: 61 e0 ldi r22, 0x01 ; 1 1c216: 74 e0 ldi r23, 0x04 ; 4 1c218: 0f 94 1e d2 call 0x3a43c ; 0x3a43c MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1c21c: 00 91 01 04 lds r16, 0x0401 ; 0x800401 1c220: 10 e0 ldi r17, 0x00 ; 0 1c222: 8c ec ldi r24, 0xCC ; 204 1c224: 97 e4 ldi r25, 0x47 ; 71 1c226: 0e 94 2c 72 call 0xe458 ; 0xe458 1c22a: 30 e0 ldi r19, 0x00 ; 0 1c22c: 20 e0 ldi r18, 0x00 ; 0 1c22e: 48 e0 ldi r20, 0x08 ; 8 1c230: 60 e0 ldi r22, 0x00 ; 0 1c232: 74 e0 ldi r23, 0x04 ; 4 1c234: 0f 94 1e d2 call 0x3a43c ; 0x3a43c 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); 1c238: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1c23c: 81 30 cpi r24, 0x01 ; 1 1c23e: 59 f5 brne .+86 ; 0x1c296 1c240: 83 ec ldi r24, 0xC3 ; 195 1c242: 97 e4 ldi r25, 0x47 ; 71 1c244: 0e 94 2c 72 call 0xe458 ; 0xe458 1c248: ec 01 movw r28, r24 1c24a: 8f ea ldi r24, 0xAF ; 175 1c24c: 97 e4 ldi r25, 0x47 ; 71 1c24e: 0e 94 2c 72 call 0xe458 ; 0xe458 1c252: 22 e0 ldi r18, 0x02 ; 2 1c254: 4a e5 ldi r20, 0x5A ; 90 1c256: 51 ee ldi r21, 0xE1 ; 225 1c258: be 01 movw r22, r28 1c25a: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); 1c25e: 85 ea ldi r24, 0xA5 ; 165 1c260: 97 e4 ldi r25, 0x47 ; 71 1c262: 0e 94 2c 72 call 0xe458 ; 0xe458 1c266: f1 2c mov r15, r1 1c268: e1 2c mov r14, r1 1c26a: 04 e8 ldi r16, 0x84 ; 132 1c26c: 13 e0 ldi r17, 0x03 ; 3 1c26e: 2f e0 ldi r18, 0x0F ; 15 1c270: 30 e0 ldi r19, 0x00 ; 0 1c272: 40 e1 ldi r20, 0x10 ; 16 1c274: 6d e4 ldi r22, 0x4D ; 77 1c276: 72 e0 ldi r23, 0x02 ; 2 1c278: 0f 94 1e d2 call 0x3a43c ; 0x3a43c MENU_END(); 1c27c: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1c280: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c284: 8f 5f subi r24, 0xFF ; 255 1c286: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c28a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c28e: 8f 5f subi r24, 0xFF ; 255 1c290: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c294: a0 cf rjmp .-192 ; 0x1c1d6 ); 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); 1c296: 81 11 cpse r24, r1 1c298: 03 c0 rjmp .+6 ; 0x1c2a0 1c29a: 8d eb ldi r24, 0xBD ; 189 1c29c: 97 e4 ldi r25, 0x47 ; 71 1c29e: d2 cf rjmp .-92 ; 0x1c244 1c2a0: 86 eb ldi r24, 0xB6 ; 182 1c2a2: 97 e4 ldi r25, 0x47 ; 71 1c2a4: cf cf rjmp .-98 ; 0x1c244 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); MENU_END(); } 1c2a6: df 91 pop r29 1c2a8: cf 91 pop r28 1c2aa: 1f 91 pop r17 1c2ac: 0f 91 pop r16 1c2ae: ff 90 pop r15 1c2b0: ef 90 pop r14 1c2b2: 08 95 ret 0001c2b4 : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1c2b4: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1c2b8: 88 23 and r24, r24 1c2ba: 31 f0 breq .+12 ; 0x1c2c8 1c2bc: 81 30 cpi r24, 0x01 ; 1 1c2be: 41 f4 brne .+16 ; 0x1c2d0 { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1c2c0: 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(); 1c2c4: 0c 94 b7 89 jmp 0x1136e ; 0x1136e 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; 1c2c8: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1c2ca: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1c2ce: fa cf rjmp .-12 ; 0x1c2c4 1c2d0: 81 e0 ldi r24, 0x01 ; 1 1c2d2: fb cf rjmp .-10 ; 0x1c2ca 0001c2d4 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1c2d4: cf 93 push r28 MENU_BEGIN(); 1c2d6: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1c2da: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c2de: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c2e2: 84 30 cpi r24, 0x04 ; 4 1c2e4: 60 f5 brcc .+88 ; 0x1c33e 1c2e6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c2ea: 8b e3 ldi r24, 0x3B ; 59 1c2ec: 98 e4 ldi r25, 0x48 ; 72 1c2ee: 0e 94 2c 72 call 0xe458 ; 0xe458 1c2f2: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1c2f6: 81 e6 ldi r24, 0x61 ; 97 1c2f8: 95 e4 ldi r25, 0x45 ; 69 1c2fa: 0e 94 2c 72 call 0xe458 ; 0xe458 1c2fe: 6e e5 ldi r22, 0x5E ; 94 1c300: 72 ee ldi r23, 0xE2 ; 226 1c302: 0f 94 4b d1 call 0x3a296 ; 0x3a296 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c306: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1c308: 86 e2 ldi r24, 0x26 ; 38 1c30a: 96 e4 ldi r25, 0x46 ; 70 1c30c: 0e 94 2c 72 call 0xe458 ; 0xe458 1c310: 61 e3 ldi r22, 0x31 ; 49 1c312: 6c 0f add r22, r28 1c314: 2c 2f mov r18, r28 1c316: 4d e6 ldi r20, 0x6D ; 109 1c318: 52 ee ldi r21, 0xE2 ; 226 1c31a: 0f 94 f4 d0 call 0x3a1e8 ; 0x3a1e8 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++) 1c31e: cf 5f subi r28, 0xFF ; 255 1c320: c5 30 cpi r28, 0x05 ; 5 1c322: 91 f7 brne .-28 ; 0x1c308 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1c324: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1c328: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c32c: 8f 5f subi r24, 0xFF ; 255 1c32e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c332: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c336: 8f 5f subi r24, 0xFF ; 255 1c338: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c33c: d0 cf rjmp .-96 ; 0x1c2de 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(); } 1c33e: cf 91 pop r28 1c340: 08 95 ret 0001c342 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1c342: 84 e0 ldi r24, 0x04 ; 4 1c344: 0d 94 f6 51 jmp 0x2a3ec ; 0x2a3ec 0001c348 : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1c348: 85 e0 ldi r24, 0x05 ; 5 1c34a: 0d 94 f6 51 jmp 0x2a3ec ; 0x2a3ec 0001c34e : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1c34e: 86 e0 ldi r24, 0x06 ; 6 1c350: 0d 94 f6 51 jmp 0x2a3ec ; 0x2a3ec 0001c354 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1c354: 87 e0 ldi r24, 0x07 ; 7 1c356: 0d 94 f6 51 jmp 0x2a3ec ; 0x2a3ec 0001c35a : 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); 1c35a: 88 e0 ldi r24, 0x08 ; 8 1c35c: 0d 94 f6 51 jmp 0x2a3ec ; 0x2a3ec 0001c360 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1c360: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1c364: 81 ea ldi r24, 0xA1 ; 161 1c366: 9d e0 ldi r25, 0x0D ; 13 1c368: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1c36c: 83 e0 ldi r24, 0x03 ; 3 1c36e: 0d 94 7a d4 jmp 0x3a8f4 ; 0x3a8f4 0001c372 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1c372: cf 93 push r28 MENU_BEGIN(); 1c374: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1c378: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c37c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c380: 84 30 cpi r24, 0x04 ; 4 1c382: 88 f5 brcc .+98 ; 0x1c3e6 1c384: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c388: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 1c38c: 81 11 cpse r24, r1 1c38e: 0f 94 98 21 call 0x24330 ; 0x24330 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c392: 8b e3 ldi r24, 0x3B ; 59 1c394: 98 e4 ldi r25, 0x48 ; 72 1c396: 0e 94 2c 72 call 0xe458 ; 0xe458 1c39a: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1c39e: 81 e6 ldi r24, 0x61 ; 97 1c3a0: 95 e4 ldi r25, 0x45 ; 69 1c3a2: 0e 94 2c 72 call 0xe458 ; 0xe458 1c3a6: 68 e4 ldi r22, 0x48 ; 72 1c3a8: 7a e3 ldi r23, 0x3A ; 58 1c3aa: 0f 94 4b d1 call 0x3a296 ; 0x3a296 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c3ae: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1c3b0: 86 e2 ldi r24, 0x26 ; 38 1c3b2: 96 e4 ldi r25, 0x46 ; 70 1c3b4: 0e 94 2c 72 call 0xe458 ; 0xe458 1c3b8: 61 e3 ldi r22, 0x31 ; 49 1c3ba: 6c 0f add r22, r28 1c3bc: 2c 2f mov r18, r28 1c3be: 40 ec ldi r20, 0xC0 ; 192 1c3c0: 59 e3 ldi r21, 0x39 ; 57 1c3c2: 0f 94 f4 d0 call 0x3a1e8 ; 0x3a1e8 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++) 1c3c6: cf 5f subi r28, 0xFF ; 255 1c3c8: c5 30 cpi r28, 0x05 ; 5 1c3ca: 91 f7 brne .-28 ; 0x1c3b0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1c3cc: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1c3d0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c3d4: 8f 5f subi r24, 0xFF ; 255 1c3d6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c3da: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c3de: 8f 5f subi r24, 0xFF ; 255 1c3e0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c3e4: cb cf rjmp .-106 ; 0x1c37c 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(); } 1c3e6: cf 91 pop r28 1c3e8: 08 95 ret 0001c3ea : } // 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)) { 1c3ea: ef 92 push r14 1c3ec: ff 92 push r15 1c3ee: 0f 93 push r16 1c3f0: 1f 93 push r17 1c3f2: cf 93 push r28 1c3f4: 8c 01 movw r16, r24 1c3f6: 7b 01 movw r14, r22 MENU_BEGIN(); 1c3f8: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1c3fc: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c400: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c404: 84 30 cpi r24, 0x04 ; 4 1c406: 28 f5 brcc .+74 ; 0x1c452 1c408: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c40c: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 1c410: 81 11 cpse r24, r1 1c412: 0f 94 98 21 call 0x24330 ; 0x24330 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c416: 8b e3 ldi r24, 0x3B ; 59 1c418: 98 e4 ldi r25, 0x48 ; 72 1c41a: 0e 94 2c 72 call 0xe458 ; 0xe458 1c41e: 0f 94 99 d4 call 0x3a932 ; 0x3a932 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c422: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1c424: 61 e3 ldi r22, 0x31 ; 49 1c426: 6c 0f add r22, r28 1c428: 2c 2f mov r18, r28 1c42a: a7 01 movw r20, r14 1c42c: c8 01 movw r24, r16 1c42e: 0f 94 f4 d0 call 0x3a1e8 ; 0x3a1e8 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c432: cf 5f subi r28, 0xFF ; 255 1c434: c5 30 cpi r28, 0x05 ; 5 1c436: b1 f7 brne .-20 ; 0x1c424 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1c438: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 // 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(); 1c43c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c440: 8f 5f subi r24, 0xFF ; 255 1c442: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c446: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c44a: 8f 5f subi r24, 0xFF ; 255 1c44c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c450: d7 cf rjmp .-82 ; 0x1c400 ); 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(); } 1c452: cf 91 pop r28 1c454: 1f 91 pop r17 1c456: 0f 91 pop r16 1c458: ff 90 pop r15 1c45a: ef 90 pop r14 1c45c: 08 95 ret 0001c45e : 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); 1c45e: 85 e5 ldi r24, 0x55 ; 85 1c460: 9b e5 ldi r25, 0x5B ; 91 1c462: 0e 94 2c 72 call 0xe458 ; 0xe458 1c466: 67 e4 ldi r22, 0x47 ; 71 1c468: 72 ee ldi r23, 0xE2 ; 226 1c46a: 0c 94 f5 e1 jmp 0x1c3ea ; 0x1c3ea 0001c46e : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1c46e: 84 e6 ldi r24, 0x64 ; 100 1c470: 9b e5 ldi r25, 0x5B ; 91 1c472: 0e 94 2c 72 call 0xe458 ; 0xe458 1c476: 63 e5 ldi r22, 0x53 ; 83 1c478: 72 ee ldi r23, 0xE2 ; 226 1c47a: 0c 94 f5 e1 jmp 0x1c3ea ; 0x1c3ea 0001c47e : 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); 1c47e: 86 e2 ldi r24, 0x26 ; 38 1c480: 96 e4 ldi r25, 0x46 ; 70 1c482: 0e 94 2c 72 call 0xe458 ; 0xe458 1c486: 68 ec ldi r22, 0xC8 ; 200 1c488: 79 e3 ldi r23, 0x39 ; 57 1c48a: 0c 94 f5 e1 jmp 0x1c3ea ; 0x1c3ea 0001c48e : 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){ 1c48e: cf 93 push r28 1c490: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1c492: 0f 94 bc 88 call 0x31178 ; 0x31178 1c496: 88 23 and r24, r24 1c498: 21 f0 breq .+8 ; 0x1c4a2 1c49a: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1c49c: cf 91 pop r28 1c49e: 0d 94 4d ae jmp 0x35c9a ; 0x35c9a 1c4a2: cf 91 pop r28 1c4a4: 08 95 ret 0001c4a6 : 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) { 1c4a6: cf 93 push r28 1c4a8: c8 2f mov r28, r24 menu_back(); 1c4aa: 0f 94 96 d4 call 0x3a92c ; 0x3a92c MMU2::mmu2.eject_filament(filament, true); 1c4ae: 61 e0 ldi r22, 0x01 ; 1 1c4b0: 8c 2f mov r24, r28 1c4b2: 0f 94 d0 ad call 0x35ba0 ; 0x35ba0 // Clear the filament action clearFilamentAction(); } 1c4b6: 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(); 1c4b8: 0d 94 98 21 jmp 0x24330 ; 0x24330 0001c4bc : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.load_filament(i); 1c4bc: 80 e0 ldi r24, 0x00 ; 0 1c4be: 0f 94 8d ad call 0x35b1a ; 0x35b1a 1c4c2: 81 e0 ldi r24, 0x01 ; 1 1c4c4: 0f 94 8d ad call 0x35b1a ; 0x35b1a 1c4c8: 82 e0 ldi r24, 0x02 ; 2 1c4ca: 0f 94 8d ad call 0x35b1a ; 0x35b1a 1c4ce: 83 e0 ldi r24, 0x03 ; 3 1c4d0: 0f 94 8d ad call 0x35b1a ; 0x35b1a 1c4d4: 84 e0 ldi r24, 0x04 ; 4 1c4d6: 0d 94 8d ad jmp 0x35b1a ; 0x35b1a 0001c4da : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1c4da: 0d 94 8d ad jmp 0x35b1a ; 0x35b1a 0001c4de : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 1c4de: cf 93 push r28 1c4e0: c8 2f mov r28, r24 if (!lang_select(lang)) 1c4e2: 0e 94 b4 71 call 0xe368 ; 0xe368 1c4e6: 81 11 cpse r24, r1 1c4e8: 37 c0 rjmp .+110 ; 0x1c558 { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 1c4ea: 80 ee ldi r24, 0xE0 ; 224 1c4ec: 9a e3 ldi r25, 0x3A ; 58 1c4ee: 0e 94 2c 72 call 0xe458 ; 0xe458 1c4f2: 40 e0 ldi r20, 0x00 ; 0 1c4f4: 60 e0 ldi r22, 0x00 ; 0 1c4f6: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc 1c4fa: 81 11 cpse r24, r1 1c4fc: 20 c0 rjmp .+64 ; 0x1c53e #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c4fe: 0e 94 69 71 call 0xe2d2 ; 0xe2d2 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c502: c2 30 cpi r28, 0x02 ; 2 1c504: e0 f0 brcs .+56 ; 0x1c53e 1c506: 8c 17 cp r24, r28 1c508: d0 f0 brcs .+52 ; 0x1c53e softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c50a: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c50c: 8a ea ldi r24, 0xAA ; 170 1c50e: 95 e5 ldi r25, 0x55 ; 85 1c510: dc 01 movw r26, r24 1c512: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7dc> 1c516: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7dd> 1c51a: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7de> 1c51e: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7df> boot_app_flags = BOOT_APP_FLG_USER0; 1c522: 80 e8 ldi r24, 0x80 ; 128 1c524: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7db> boot_copy_size = 0; 1c528: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7d9> 1c52c: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7d8> bootapp_reboot_user0(lang << 3); 1c530: cc 0f add r28, r28 1c532: cc 0f add r28, r28 1c534: cc 0f add r28, r28 boot_reserved = reserved; 1c536: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7da> // bootapp_print_vars(); softReset(); 1c53a: 0e 94 cc 66 call 0xcd98 ; 0xcd98 lang_boot_update_start(lang); lcd_update_enable(true); 1c53e: 81 e0 ldi r24, 0x01 ; 1 1c540: 0e 94 a5 6e call 0xdd4a ; 0xdd4a menu_goto(lcd_language_menu, 0, true, true); 1c544: 21 e0 ldi r18, 0x01 ; 1 1c546: 41 e0 ldi r20, 0x01 ; 1 1c548: 70 e0 ldi r23, 0x00 ; 0 1c54a: 60 e0 ldi r22, 0x00 ; 0 1c54c: 8f ea ldi r24, 0xAF ; 175 1c54e: 93 ee ldi r25, 0xE3 ; 227 1c550: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 1c554: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout } } 1c558: cf 91 pop r28 1c55a: 08 95 ret 0001c55c : #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 1c55c: cf 93 push r28 1c55e: df 93 push r29 MENU_BEGIN(); 1c560: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1c564: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c568: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c56c: 84 30 cpi r24, 0x04 ; 4 1c56e: 58 f5 brcc .+86 ; 0x1c5c6 1c570: 10 92 15 05 sts 0x0515, r1 ; 0x800515 uint8_t cnt = lang_get_count(); 1c574: 0e 94 69 71 call 0xe2d2 ; 0xe2d2 1c578: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 1c57a: 8f e3 ldi r24, 0x3F ; 63 1c57c: 94 e4 ldi r25, 0x44 ; 68 1c57e: 0e 94 2c 72 call 0xe458 ; 0xe458 1c582: 0f 94 99 d4 call 0x3a932 ; 0x3a932 for (uint8_t i = 8; i < cnt; i++) //all community languages 1c586: c8 e0 ldi r28, 0x08 ; 8 1c588: cd 17 cp r28, r29 1c58a: 80 f4 brcc .+32 ; 0x1c5ac if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 1c58c: 8c 2f mov r24, r28 1c58e: 0e 94 1a 71 call 0xe234 ; 0xe234 1c592: 0e 94 b3 70 call 0xe166 ; 0xe166 1c596: 0f 94 7c d1 call 0x3a2f8 ; 0x3a2f8 1c59a: 88 23 and r24, r24 1c59c: 29 f0 breq .+10 ; 0x1c5a8 { menu_setlang(i); 1c59e: 8c 2f mov r24, r28 return; } MENU_END(); } 1c5a0: df 91 pop r29 1c5a2: 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); 1c5a4: 0c 94 6f e2 jmp 0x1c4de ; 0x1c4de 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 1c5a8: cf 5f subi r28, 0xFF ; 255 1c5aa: ee cf rjmp .-36 ; 0x1c588 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 1c5ac: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 1c5b0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c5b4: 8f 5f subi r24, 0xFF ; 255 1c5b6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c5ba: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c5be: 8f 5f subi r24, 0xFF ; 255 1c5c0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c5c4: d1 cf rjmp .-94 ; 0x1c568 { menu_setlang(i); return; } MENU_END(); } 1c5c6: df 91 pop r29 1c5c8: cf 91 pop r28 1c5ca: 08 95 ret 0001c5cc : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1c5cc: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1c5d0: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c5d4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c5d8: 84 30 cpi r24, 0x04 ; 4 1c5da: 08 f0 brcs .+2 ; 0x1c5de 1c5dc: 45 c0 rjmp .+138 ; 0x1c668 1c5de: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1c5e2: 8e e6 ldi r24, 0x6E ; 110 1c5e4: 94 e4 ldi r25, 0x44 ; 68 1c5e6: 0e 94 2c 72 call 0xe458 ; 0xe458 1c5ea: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 1c5ee: 6f e9 ldi r22, 0x9F ; 159 1c5f0: 74 ed ldi r23, 0xD4 ; 212 1c5f2: 89 e4 ldi r24, 0x49 ; 73 1c5f4: 9d e0 ldi r25, 0x0D ; 13 1c5f6: 0f 94 fc d3 call 0x3a7f8 ; 0x3a7f8 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 1c5fa: 6a e9 ldi r22, 0x9A ; 154 1c5fc: 74 ed ldi r23, 0xD4 ; 212 1c5fe: 84 e5 ldi r24, 0x54 ; 84 1c600: 9d e0 ldi r25, 0x0D ; 13 1c602: 0f 94 fc d3 call 0x3a7f8 ; 0x3a7f8 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 1c606: 65 e9 ldi r22, 0x95 ; 149 1c608: 74 ed ldi r23, 0xD4 ; 212 1c60a: 8f e5 ldi r24, 0x5F ; 95 1c60c: 9d e0 ldi r25, 0x0D ; 13 1c60e: 0f 94 fc d3 call 0x3a7f8 ; 0x3a7f8 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 1c612: 60 e9 ldi r22, 0x90 ; 144 1c614: 74 ed ldi r23, 0xD4 ; 212 1c616: 8a e6 ldi r24, 0x6A ; 106 1c618: 9d e0 ldi r25, 0x0D ; 13 1c61a: 0f 94 fc d3 call 0x3a7f8 ; 0x3a7f8 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 1c61e: 6b e8 ldi r22, 0x8B ; 139 1c620: 74 ed ldi r23, 0xD4 ; 212 1c622: 85 e7 ldi r24, 0x75 ; 117 1c624: 9d e0 ldi r25, 0x0D ; 13 1c626: 0f 94 fc d3 call 0x3a7f8 ; 0x3a7f8 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 1c62a: 66 e8 ldi r22, 0x86 ; 134 1c62c: 74 ed ldi r23, 0xD4 ; 212 1c62e: 80 e8 ldi r24, 0x80 ; 128 1c630: 9d e0 ldi r25, 0x0D ; 13 1c632: 0f 94 fc d3 call 0x3a7f8 ; 0x3a7f8 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 1c636: 61 e8 ldi r22, 0x81 ; 129 1c638: 74 ed ldi r23, 0xD4 ; 212 1c63a: 8b e8 ldi r24, 0x8B ; 139 1c63c: 9d e0 ldi r25, 0x0D ; 13 1c63e: 0f 94 fc d3 call 0x3a7f8 ; 0x3a7f8 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 1c642: 6c e7 ldi r22, 0x7C ; 124 1c644: 74 ed ldi r23, 0xD4 ; 212 1c646: 86 e9 ldi r24, 0x96 ; 150 1c648: 9d e0 ldi r25, 0x0D ; 13 1c64a: 0f 94 fc d3 call 0x3a7f8 ; 0x3a7f8 MENU_END(); 1c64e: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1c652: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c656: 8f 5f subi r24, 0xFF ; 255 1c658: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c65c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c660: 8f 5f subi r24, 0xFF ; 255 1c662: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c666: b6 cf rjmp .-148 ; 0x1c5d4 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(); } 1c668: 08 95 ret 0001c66a : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 1c66a: cf 92 push r12 1c66c: df 92 push r13 1c66e: ef 92 push r14 1c670: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 1c672: 80 e0 ldi r24, 0x00 ; 0 1c674: 90 e0 ldi r25, 0x00 ; 0 1c676: a8 ec ldi r26, 0xC8 ; 200 1c678: b2 e4 ldi r27, 0x42 ; 66 1c67a: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 1c67e: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1c682: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1c686: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 1c68a: 65 e5 ldi r22, 0x55 ; 85 1c68c: 75 e5 ldi r23, 0x55 ; 85 1c68e: 85 e5 ldi r24, 0x55 ; 85 1c690: 91 e4 ldi r25, 0x41 ; 65 1c692: 0f 94 81 c0 call 0x38102 ; 0x38102 delay_keep_alive(2000); 1c696: 80 ed ldi r24, 0xD0 ; 208 1c698: 97 e0 ldi r25, 0x07 ; 7 1c69a: 0e 94 6c 8c call 0x118d8 ; 0x118d8 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c69e: 8f ec ldi r24, 0xCF ; 207 1c6a0: 9b e3 ldi r25, 0x3B ; 59 1c6a2: 0e 94 2c 72 call 0xe458 ; 0xe458 1c6a6: 0f 94 e9 20 call 0x241d2 ; 0x241d2 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1c6aa: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 1c6ae: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 1c6b2: 07 2e mov r0, r23 1c6b4: 00 0c add r0, r0 1c6b6: 88 0b sbc r24, r24 1c6b8: 99 0b sbc r25, r25 1c6ba: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1c6be: 9b 01 movw r18, r22 1c6c0: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 1c6c2: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1c6c6: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1c6ca: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1c6ce: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1c6d2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1c6d6: 9f 77 andi r25, 0x7F ; 127 1c6d8: 20 e0 ldi r18, 0x00 ; 0 1c6da: 30 e0 ldi r19, 0x00 ; 0 1c6dc: 40 ea ldi r20, 0xA0 ; 160 1c6de: 50 e4 ldi r21, 0x40 ; 64 1c6e0: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1c6e4: 18 16 cp r1, r24 1c6e6: b4 f5 brge .+108 ; 0x1c754 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c6e8: 8f ec ldi r24, 0xCF ; 207 1c6ea: 9b e3 ldi r25, 0x3B ; 59 1c6ec: 0e 94 2c 72 call 0xe458 ; 0xe458 1c6f0: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_set_cursor(0, 4); 1c6f4: 64 e0 ldi r22, 0x04 ; 4 1c6f6: 80 e0 ldi r24, 0x00 ; 0 1c6f8: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 1c6fc: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 1c700: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 1c704: 07 2e mov r0, r23 1c706: 00 0c add r0, r0 1c708: 88 0b sbc r24, r24 1c70a: 99 0b sbc r25, r25 1c70c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__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)); 1c710: 20 e0 ldi r18, 0x00 ; 0 1c712: 30 e0 ldi r19, 0x00 ; 0 1c714: 40 e0 ldi r20, 0x00 ; 0 1c716: 5f e3 ldi r21, 0x3F ; 63 1c718: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1c71c: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1c720: 6b 01 movw r12, r22 1c722: 20 e0 ldi r18, 0x00 ; 0 1c724: 30 e0 ldi r19, 0x00 ; 0 1c726: 40 e0 ldi r20, 0x00 ; 0 1c728: 5f e3 ldi r21, 0x3F ; 63 1c72a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1c72e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1c732: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1c736: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1c73a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1c73e: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1c742: a6 01 movw r20, r12 1c744: 82 e8 ldi r24, 0x82 ; 130 1c746: 0f 94 7e 22 call 0x244fc ; 0x244fc delay_keep_alive(1000); 1c74a: 88 ee ldi r24, 0xE8 ; 232 1c74c: 93 e0 ldi r25, 0x03 ; 3 1c74e: 0e 94 6c 8c call 0x118d8 ; 0x118d8 1c752: ab cf rjmp .-170 ; 0x1c6aa } } 1c754: ff 90 pop r15 1c756: ef 90 pop r14 1c758: df 90 pop r13 1c75a: cf 90 pop r12 1c75c: 08 95 ret 0001c75e : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 1c75e: cf 93 push r28 MENU_BEGIN(); 1c760: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1c764: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c768: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c76c: 84 30 cpi r24, 0x04 ; 4 1c76e: 08 f0 brcs .+2 ; 0x1c772 1c770: 4a c0 rjmp .+148 ; 0x1c806 1c772: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 1c776: 0e 94 9d 70 call 0xe13a ; 0xe13a 1c77a: 88 23 and r24, r24 1c77c: 31 f0 breq .+12 ; 0x1c78a 1c77e: 8a ee ldi r24, 0xEA ; 234 1c780: 97 e4 ldi r25, 0x47 ; 71 1c782: 0e 94 2c 72 call 0xe458 ; 0xe458 1c786: 0f 94 99 d4 call 0x3a932 ; 0x3a932 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 1c78a: 8e e6 ldi r24, 0x6E ; 110 1c78c: 95 e6 ldi r25, 0x65 ; 101 1c78e: 0e 94 b3 70 call 0xe166 ; 0xe166 1c792: 0f 94 7c d1 call 0x3a2f8 ; 0x3a2f8 1c796: 88 23 and r24, r24 1c798: 21 f0 breq .+8 ; 0x1c7a2 { menu_setlang(0); 1c79a: 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(); } 1c79c: 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); 1c79e: 0c 94 6f e2 jmp 0x1c4de ; 0x1c4de 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(); 1c7a2: 0e 94 69 71 call 0xe2d2 ; 0xe2d2 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 1c7a6: 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 1c7a8: 82 30 cpi r24, 0x02 ; 2 1c7aa: 51 f4 brne .+20 ; 0x1c7c0 1c7ac: 0e 94 8a 70 call 0xe114 ; 0xe114 { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 1c7b0: 0e 94 b3 70 call 0xe166 ; 0xe166 1c7b4: 0f 94 7c d1 call 0x3a2f8 ; 0x3a2f8 1c7b8: 88 23 and r24, r24 1c7ba: 81 f0 breq .+32 ; 0x1c7dc { menu_setlang(1); 1c7bc: 81 e0 ldi r24, 0x01 ; 1 1c7be: ee cf rjmp .-36 ; 0x1c79c 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)))) 1c7c0: 8c 2f mov r24, r28 1c7c2: 0e 94 1a 71 call 0xe234 ; 0xe234 1c7c6: 0e 94 b3 70 call 0xe166 ; 0xe166 1c7ca: 0f 94 7c d1 call 0x3a2f8 ; 0x3a2f8 1c7ce: 88 23 and r24, r24 1c7d0: 11 f0 breq .+4 ; 0x1c7d6 { menu_setlang(i); 1c7d2: 8c 2f mov r24, r28 1c7d4: e3 cf rjmp .-58 ; 0x1c79c 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 1c7d6: cf 5f subi r28, 0xFF ; 255 1c7d8: c8 30 cpi r28, 0x08 ; 8 1c7da: 91 f7 brne .-28 ; 0x1c7c0 return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 1c7dc: 8a ef ldi r24, 0xFA ; 250 1c7de: 9a e3 ldi r25, 0x3A ; 58 1c7e0: 0e 94 2c 72 call 0xe458 ; 0xe458 1c7e4: 6e ea ldi r22, 0xAE ; 174 1c7e6: 72 ee ldi r23, 0xE2 ; 226 1c7e8: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 1c7ec: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 1c7f0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c7f4: 8f 5f subi r24, 0xFF ; 255 1c7f6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c7fa: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c7fe: 8f 5f subi r24, 0xFF ; 255 1c800: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c804: b1 cf rjmp .-158 ; 0x1c768 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c806: cf 91 pop r28 1c808: 08 95 ret 0001c80a : 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()") { 1c80a: cf 93 push r28 1c80c: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc { //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); 1c810: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 1c812: 4e ec ldi r20, 0xCE ; 206 1c814: 59 e6 ldi r21, 0x69 ; 105 1c816: 60 e0 ldi r22, 0x00 ; 0 1c818: 80 e0 ldi r24, 0x00 ; 0 1c81a: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(LCD_WIDTH - 14, 0); 1c81e: 60 e0 ldi r22, 0x00 ; 0 1c820: 86 e0 ldi r24, 0x06 ; 6 1c822: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print_state(pinda_state); 1c826: c4 fb bst r28, 4 1c828: 88 27 eor r24, r24 1c82a: 80 f9 bld r24, 0 1c82c: 0f 94 8f 20 call 0x2411e ; 0x2411e if (MMU2::mmu2.Enabled()) { 1c830: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1c834: 81 30 cpi r24, 0x01 ; 1 1c836: 99 f4 brne .+38 ; 0x1c85e inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 1c838: c1 e0 ldi r28, 0x01 ; 1 1c83a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 1c83e: 81 11 cpse r24, r1 1c840: 01 c0 rjmp .+2 ; 0x1c844 1c842: 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 1c844: 48 ec ldi r20, 0xC8 ; 200 1c846: 59 e6 ldi r21, 0x69 ; 105 1c848: 60 e0 ldi r22, 0x00 ; 0 1c84a: 8a e0 ldi r24, 0x0A ; 10 1c84c: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(LCD_WIDTH - 3, 0); 1c850: 60 e0 ldi r22, 0x00 ; 0 1c852: 81 e1 ldi r24, 0x11 ; 17 1c854: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print_state(finda_state); 1c858: 8c 2f mov r24, r28 1c85a: 0f 94 8f 20 call 0x2411e ; 0x2411e 1c85e: c1 e0 ldi r28, 0x01 ; 1 1c860: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1c864: 81 11 cpse r24, r1 1c866: 01 c0 rjmp .+2 ; 0x1c86a 1c868: c0 e0 ldi r28, 0x00 ; 0 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 1c86a: 8b e4 ldi r24, 0x4B ; 75 1c86c: 97 e4 ldi r25, 0x47 ; 71 1c86e: 0e 94 2c 72 call 0xe458 ; 0xe458 1c872: ac 01 movw r20, r24 1c874: 61 e0 ldi r22, 0x01 ; 1 1c876: 80 e0 ldi r24, 0x00 ; 0 1c878: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(LCD_WIDTH - 3, 1); 1c87c: 61 e0 ldi r22, 0x01 ; 1 1c87e: 81 e1 ldi r24, 0x11 ; 17 1c880: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print_state(idler_state); 1c884: 8c 2f mov r24, r28 1c886: 0f 94 8f 20 call 0x2411e ; 0x2411e // auto-exposure algorithm. When the chip is tracking on a reflective surface, the Shutter is small. // When the chip is tracking on a surface that absorbs IR (or doesn't reflect it), the Shutter is large. // The maximum value of the shutter is 17. The value of 16 seems to be reported as 17 even though the // Brightness value changes correctly as if the shutter changed to 16 (probably some bug with the sensor). // The shutter algorithm tries to keep the B value in the 70-110 range. lcd_set_cursor(0, 2); 1c88a: 62 e0 ldi r22, 0x02 ; 2 1c88c: 80 e0 ldi r24, 0x00 ; 0 1c88e: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(_N("B: %3d Xd:%6d\n" 1c892: 80 91 90 0e lds r24, 0x0E90 ; 0x800e90 1c896: 8f 93 push r24 1c898: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 1c89c: 8f 93 push r24 1c89e: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 1c8a2: 1f 92 push r1 1c8a4: 8f 93 push r24 1c8a6: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1c8aa: 8f 93 push r24 1c8ac: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1c8b0: 8f 93 push r24 1c8b2: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 1c8b6: 1f 92 push r1 1c8b8: 8f 93 push r24 1c8ba: 84 ea ldi r24, 0xA4 ; 164 1c8bc: 99 e6 ldi r25, 0x69 ; 105 1c8be: 9f 93 push r25 1c8c0: 8f 93 push r24 1c8c2: 0e 94 39 6e call 0xdc72 ; 0xdc72 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(); 1c8c6: 8d b7 in r24, 0x3d ; 61 1c8c8: 9e b7 in r25, 0x3e ; 62 1c8ca: 0a 96 adiw r24, 0x0a ; 10 1c8cc: 0f b6 in r0, 0x3f ; 63 1c8ce: f8 94 cli 1c8d0: 9e bf out 0x3e, r25 ; 62 1c8d2: 0f be out 0x3f, r0 ; 63 1c8d4: 8d bf out 0x3d, r24 ; 61 } 1c8d6: 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(); 1c8d8: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 0001c8dc : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1c8dc: 1f 93 push r17 1c8de: cf 93 push r28 1c8e0: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1c8e2: e1 e0 ldi r30, 0x01 ; 1 1c8e4: f1 e0 ldi r31, 0x01 ; 1 1c8e6: 80 81 ld r24, Z 1c8e8: 8e 7f andi r24, 0xFE ; 254 1c8ea: 80 83 st Z, r24 PORTH |= 0x01; 1c8ec: e2 e0 ldi r30, 0x02 ; 2 1c8ee: f1 e0 ldi r31, 0x01 ; 1 1c8f0: 80 81 ld r24, Z 1c8f2: 81 60 ori r24, 0x01 ; 1 1c8f4: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1c8f6: ea e3 ldi r30, 0x3A ; 58 1c8f8: f5 e0 ldi r31, 0x05 ; 5 1c8fa: 90 e1 ldi r25, 0x10 ; 16 1c8fc: 90 83 st Z, r25 ptr[1] = 0; 1c8fe: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1c900: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1c902: e0 ed ldi r30, 0xD0 ; 208 1c904: f0 e0 ldi r31, 0x00 ; 0 1c906: 80 81 ld r24, Z 1c908: 82 60 ori r24, 0x02 ; 2 1c90a: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1c90c: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1c910: e1 ed ldi r30, 0xD1 ; 209 1c912: f0 e0 ldi r31, 0x00 ; 0 1c914: 88 e1 ldi r24, 0x18 ; 24 1c916: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1c918: 80 81 ld r24, Z 1c91a: 80 68 ori r24, 0x80 ; 128 1c91c: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1c91e: e4 e9 ldi r30, 0x94 ; 148 1c920: f2 e1 ldi r31, 0x12 ; 18 1c922: 8c e6 ldi r24, 0x6C ; 108 1c924: 99 e3 ldi r25, 0x39 ; 57 1c926: 91 87 std Z+9, r25 ; 0x09 1c928: 80 87 std Z+8, r24 ; 0x08 1c92a: 8c e1 ldi r24, 0x1C ; 28 1c92c: 9a e3 ldi r25, 0x3A ; 58 1c92e: 93 87 std Z+11, r25 ; 0x0b 1c930: 82 87 std Z+10, r24 ; 0x0a 1c932: 13 e0 ldi r17, 0x03 ; 3 1c934: 13 83 std Z+3, r17 ; 0x03 1c936: 15 86 std Z+13, r1 ; 0x0d 1c938: 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); 1c93a: 9f b7 in r25, 0x3f ; 63 1c93c: f8 94 cli 1c93e: e5 e0 ldi r30, 0x05 ; 5 1c940: f1 e0 ldi r31, 0x01 ; 1 1c942: 80 81 ld r24, Z 1c944: 80 62 ori r24, 0x20 ; 32 1c946: 80 83 st Z, r24 1c948: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1c94a: e4 e0 ldi r30, 0x04 ; 4 1c94c: f1 e0 ldi r31, 0x01 ; 1 1c94e: 80 81 ld r24, Z 1c950: 80 62 ori r24, 0x20 ; 32 1c952: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1c954: 0f 94 d2 c5 call 0x38ba4 ; 0x38ba4 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1c958: 83 e6 ldi r24, 0x63 ; 99 1c95a: 0f 94 3b 88 call 0x31076 ; 0x31076 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1c95e: 80 ea ldi r24, 0xA0 ; 160 1c960: 96 ea ldi r25, 0xA6 ; 166 1c962: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 retryAttempts = MAX_RETRIES; 1c966: cb e4 ldi r28, 0x4B ; 75 1c968: d3 e1 ldi r29, 0x13 ; 19 1c96a: 10 93 9f 13 sts 0x139F, r17 ; 0x80139f } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1c96e: 85 e6 ldi r24, 0x65 ; 101 1c970: 9a ea ldi r25, 0xAA ; 170 1c972: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 /// @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; } 1c976: 8a e0 ldi r24, 0x0A ; 10 1c978: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1c97a: 82 e0 ldi r24, 0x02 ; 2 1c97c: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1c980: 81 e0 ldi r24, 0x01 ; 1 1c982: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1c984: 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; 1c986: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1c988: 86 e0 ldi r24, 0x06 ; 6 1c98a: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1c98c: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1c98e: df 91 pop r29 1c990: cf 91 pop r28 1c992: 1f 91 pop r17 1c994: 0d 94 b4 a5 jmp 0x34b68 ; 0x34b68 0001c998 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 1c998: 8c ea ldi r24, 0xAC ; 172 1c99a: 9c e0 ldi r25, 0x0C ; 12 1c99c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 if (current_state) 1c9a0: 88 23 and r24, r24 1c9a2: 61 f0 breq .+24 ; 0x1c9bc StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1c9a4: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 1c9a8: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 1c9ac: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 1c9b0: 8c ea ldi r24, 0xAC ; 172 1c9b2: 9c e0 ldi r25, 0x0C ; 12 1c9b4: 0e 94 b4 75 call 0xeb68 ; 0xeb68 MMU2::mmu2.Status(); 1c9b8: 0d 94 1e 76 jmp 0x2ec3c ; 0x2ec3c { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 1c9bc: 0e 94 6e e4 call 0x1c8dc ; 0x1c8dc 1c9c0: f7 cf rjmp .-18 ; 0x1c9b0 0001c9c2 : //! //! @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) 1c9c2: 4f 92 push r4 1c9c4: 5f 92 push r5 1c9c6: 6f 92 push r6 1c9c8: 7f 92 push r7 1c9ca: 8f 92 push r8 1c9cc: 9f 92 push r9 1c9ce: af 92 push r10 1c9d0: bf 92 push r11 1c9d2: cf 92 push r12 1c9d4: df 92 push r13 1c9d6: ef 92 push r14 1c9d8: ff 92 push r15 1c9da: 0f 93 push r16 1c9dc: 1f 93 push r17 1c9de: cf 93 push r28 1c9e0: df 93 push r29 1c9e2: 6c 01 movw r12, r24 1c9e4: 7b 01 movw r14, r22 1c9e6: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba { //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); 1c9ea: 67 2b or r22, r23 1c9ec: 29 f0 breq .+10 ; 0x1c9f8 1c9ee: 06 e0 ldi r16, 0x06 ; 6 1c9f0: 81 30 cpi r24, 0x01 ; 1 1c9f2: 29 f0 breq .+10 ; 0x1c9fe 1c9f4: 05 e0 ldi r16, 0x05 ; 5 1c9f6: 03 c0 rjmp .+6 ; 0x1c9fe 1c9f8: 04 e0 ldi r16, 0x04 ; 4 1c9fa: 81 30 cpi r24, 0x01 ; 1 1c9fc: d9 f3 breq .-10 ; 0x1c9f4 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1c9fe: 0e 94 93 6e call 0xdd26 ; 0xdd26 KEEPALIVE_STATE(PAUSED_FOR_USER); 1ca02: 84 e0 ldi r24, 0x04 ; 4 1ca04: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be { //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; 1ca08: 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; 1ca0a: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1ca0c: 03 50 subi r16, 0x03 ; 3 1ca0e: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1ca10: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 1ca14: 81 e0 ldi r24, 0x01 ; 1 1ca16: 0e 94 37 8a call 0x1146e ; 0x1146e if (lcd_encoder) 1ca1a: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1ca1e: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1ca22: 00 97 sbiw r24, 0x00 ; 0 1ca24: 09 f4 brne .+2 ; 0x1ca28 1ca26: 9d c0 rjmp .+314 ; 0x1cb62 { if (lcd_encoder < 0) 1ca28: 97 ff sbrs r25, 7 1ca2a: 88 c0 rjmp .+272 ; 0x1cb3c { cursor_pos--; 1ca2c: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1ca2e: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1ca32: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } if (cursor_pos > 3) 1ca36: c4 30 cpi r28, 0x04 ; 4 1ca38: 0c f4 brge .+2 ; 0x1ca3c 1ca3a: 86 c0 rjmp .+268 ; 0x1cb48 { cursor_pos = 3; if (first < items_no - 3) 1ca3c: 88 2d mov r24, r8 1ca3e: 08 2c mov r0, r8 1ca40: 00 0c add r0, r0 1ca42: 99 0b sbc r25, r25 1ca44: 80 17 cp r24, r16 1ca46: 91 07 cpc r25, r17 1ca48: 0c f0 brlt .+2 ; 0x1ca4c 1ca4a: 7a c0 rjmp .+244 ; 0x1cb40 { first++; 1ca4c: 83 94 inc r8 lcd_clear(); 1ca4e: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1ca52: 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); 1ca54: c1 14 cp r12, r1 1ca56: d1 04 cpc r13, r1 1ca58: 29 f0 breq .+10 ; 0x1ca64 1ca5a: a6 01 movw r20, r12 1ca5c: 60 e0 ldi r22, 0x00 ; 0 1ca5e: 80 e0 ldi r24, 0x00 ; 0 1ca60: 0e 94 74 6e call 0xdce8 ; 0xdce8 const bool last_visible = (first == items_no - 3); 1ca64: a8 2c mov r10, r8 1ca66: 08 2c mov r0, r8 1ca68: 00 0c add r0, r0 1ca6a: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1ca6c: e1 14 cp r14, r1 1ca6e: f1 04 cpc r15, r1 1ca70: 29 f0 breq .+10 ; 0x1ca7c 1ca72: 82 e0 ldi r24, 0x02 ; 2 1ca74: 98 2e mov r9, r24 1ca76: a0 16 cp r10, r16 1ca78: b1 06 cpc r11, r17 1ca7a: 11 f0 breq .+4 ; 0x1ca80 1ca7c: 93 e0 ldi r25, 0x03 ; 3 1ca7e: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1ca80: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1ca82: df 5f subi r29, 0xFF ; 255 1ca84: 4a e1 ldi r20, 0x1A ; 26 1ca86: 5d e6 ldi r21, 0x6D ; 109 1ca88: 6d 2f mov r22, r29 1ca8a: 81 e0 ldi r24, 0x01 ; 1 1ca8c: 0e 94 74 6e call 0xdce8 ; 0xdce8 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++) 1ca90: 9d 12 cpse r9, r29 1ca92: f7 cf rjmp .-18 ; 0x1ca82 1ca94: 48 2c mov r4, r8 1ca96: 08 2c mov r0, r8 1ca98: 00 0c add r0, r0 1ca9a: 55 08 sbc r5, r5 1ca9c: 66 08 sbc r6, r6 1ca9e: 77 08 sbc r7, r7 1caa0: 8f ef ldi r24, 0xFF ; 255 1caa2: 48 1a sub r4, r24 1caa4: 58 0a sbc r5, r24 1caa6: 68 0a sbc r6, r24 1caa8: 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++) 1caaa: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1caac: 93 94 inc r9 1caae: 69 2d mov r22, r9 1cab0: 8a e0 ldi r24, 0x0A ; 10 1cab2: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 1cab6: c3 01 movw r24, r6 1cab8: b2 01 movw r22, r4 1caba: 0e 94 19 70 call 0xe032 ; 0xe032 1cabe: 8f ef ldi r24, 0xFF ; 255 1cac0: 48 1a sub r4, r24 1cac2: 58 0a sbc r5, r24 1cac4: 68 0a sbc r6, r24 1cac6: 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++) 1cac8: d9 11 cpse r29, r9 1caca: f0 cf rjmp .-32 ; 0x1caac { 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); 1cacc: e1 14 cp r14, r1 1cace: f1 04 cpc r15, r1 1cad0: 41 f0 breq .+16 ; 0x1cae2 1cad2: a0 16 cp r10, r16 1cad4: b1 06 cpc r11, r17 1cad6: 29 f4 brne .+10 ; 0x1cae2 1cad8: a7 01 movw r20, r14 1cada: 63 e0 ldi r22, 0x03 ; 3 1cadc: 81 e0 ldi r24, 0x01 ; 1 1cade: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1cae2: 4a e0 ldi r20, 0x0A ; 10 1cae4: 5e e8 ldi r21, 0x8E ; 142 1cae6: 61 e0 ldi r22, 0x01 ; 1 1cae8: 80 e0 ldi r24, 0x00 ; 0 1caea: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_putc_at(0, cursor_pos, '>'); 1caee: 4e e3 ldi r20, 0x3E ; 62 1caf0: 6c 2f mov r22, r28 1caf2: 80 e0 ldi r24, 0x00 ; 0 1caf4: 0e 94 80 6e call 0xdd00 ; 0xdd00 _delay(100); 1caf8: 64 e6 ldi r22, 0x64 ; 100 1cafa: 70 e0 ldi r23, 0x00 ; 0 1cafc: 80 e0 ldi r24, 0x00 ; 0 1cafe: 90 e0 ldi r25, 0x00 ; 0 1cb00: 0f 94 58 28 call 0x250b0 ; 0x250b0 if (lcd_clicked()) 1cb04: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 1cb08: 88 23 and r24, r24 1cb0a: 09 f4 brne .+2 ; 0x1cb0e 1cb0c: 81 cf rjmp .-254 ; 0x1ca10 { KEEPALIVE_STATE(IN_HANDLER); 1cb0e: 82 e0 ldi r24, 0x02 ; 2 1cb10: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return(cursor_pos + first - 1); 1cb14: 8f ef ldi r24, 0xFF ; 255 1cb16: 8c 0f add r24, r28 1cb18: 88 0d add r24, r8 } } } 1cb1a: df 91 pop r29 1cb1c: cf 91 pop r28 1cb1e: 1f 91 pop r17 1cb20: 0f 91 pop r16 1cb22: ff 90 pop r15 1cb24: ef 90 pop r14 1cb26: df 90 pop r13 1cb28: cf 90 pop r12 1cb2a: bf 90 pop r11 1cb2c: af 90 pop r10 1cb2e: 9f 90 pop r9 1cb30: 8f 90 pop r8 1cb32: 7f 90 pop r7 1cb34: 6f 90 pop r6 1cb36: 5f 90 pop r5 1cb38: 4f 90 pop r4 1cb3a: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1cb3c: cf 5f subi r28, 0xFF ; 255 1cb3e: 77 cf rjmp .-274 ; 0x1ca2e 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); 1cb40: 87 e0 ldi r24, 0x07 ; 7 1cb42: 0f 94 0c 4f call 0x29e18 ; 0x29e18 1cb46: 85 cf rjmp .-246 ; 0x1ca52 } } if (cursor_pos < 1) 1cb48: c1 11 cpse r28, r1 1cb4a: 84 cf rjmp .-248 ; 0x1ca54 { cursor_pos = 1; if (first > 0) 1cb4c: 18 14 cp r1, r8 1cb4e: 2c f4 brge .+10 ; 0x1cb5a { first--; 1cb50: 8a 94 dec r8 lcd_clear(); 1cb52: 0e 94 93 6e call 0xdd26 ; 0xdd26 } } if (cursor_pos < 1) { cursor_pos = 1; 1cb56: c1 e0 ldi r28, 0x01 ; 1 1cb58: 7d cf rjmp .-262 ; 0x1ca54 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1cb5a: 87 e0 ldi r24, 0x07 ; 7 1cb5c: 0f 94 0c 4f call 0x29e18 ; 0x29e18 1cb60: fa cf rjmp .-12 ; 0x1cb56 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1cb62: c4 30 cpi r28, 0x04 ; 4 1cb64: 0c f0 brlt .+2 ; 0x1cb68 1cb66: 6a cf rjmp .-300 ; 0x1ca3c 1cb68: 75 cf rjmp .-278 ; 0x1ca54 0001cb6a : 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() { 1cb6a: cf 93 push r28 1cb6c: df 93 push r29 if (MMU2::mmu2.Enabled()) { 1cb6e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1cb72: 81 30 cpi r24, 0x01 ; 1 1cb74: e9 f4 brne .+58 ; 0x1cbb0 const uint8_t filament = choose_menu_P( 1cb76: 8f e6 ldi r24, 0x6F ; 111 1cb78: 9b e3 ldi r25, 0x3B ; 59 1cb7a: 0e 94 2c 72 call 0xe458 ; 0xe458 1cb7e: ec 01 movw r28, r24 1cb80: 8c e5 ldi r24, 0x5C ; 92 1cb82: 9b e3 ldi r25, 0x3B ; 59 1cb84: 0e 94 2c 72 call 0xe458 ; 0xe458 _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,_T(MSG_CANCEL)); 1cb88: be 01 movw r22, r28 1cb8a: 0e 94 e1 e4 call 0x1c9c2 ; 0x1c9c2 if (filament < MMU_FILAMENT_COUNT) { 1cb8e: 85 30 cpi r24, 0x05 ; 5 1cb90: 98 f5 brcc .+102 ; 0x1cbf8 lay1cal_filament = filament; 1cb92: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 1cb96: 8a e0 ldi r24, 0x0A ; 10 1cb98: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 menu_goto(lcd_generic_preheat_menu, 0, true); 1cb9c: 20 e0 ldi r18, 0x00 ; 0 1cb9e: 41 e0 ldi r20, 0x01 ; 1 1cba0: 70 e0 ldi r23, 0x00 ; 0 1cba2: 60 e0 ldi r22, 0x00 ; 0 1cba4: 8a e4 ldi r24, 0x4A ; 74 1cba6: 99 e3 ldi r25, 0x39 ; 57 } 1cba8: df 91 pop r29 1cbaa: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 1cbac: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1cbb0: 8f e5 ldi r24, 0x5F ; 95 1cbb2: 9f e0 ldi r25, 0x0F ; 15 1cbb4: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1cbb8: 81 11 cpse r24, r1 1cbba: ed cf rjmp .-38 ; 0x1cb96 { bool loaded = false; if (fsensor.isReady()) { 1cbbc: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1cbc0: 82 30 cpi r24, 0x02 ; 2 1cbc2: f1 f4 brne .+60 ; 0x1cc00 1cbc4: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1cbc8: 81 11 cpse r24, r1 1cbca: e5 cf rjmp .-54 ; 0x1cb96 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) { lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 1cbcc: 8e e3 ldi r24, 0x3E ; 62 1cbce: 9b e3 ldi r25, 0x3B ; 59 1cbd0: 0e 94 2c 72 call 0xe458 ; 0xe458 1cbd4: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_consume_click(); 1cbd8: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 1cbdc: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 1cbde: 84 e6 ldi r24, 0x64 ; 100 1cbe0: 90 e0 ldi r25, 0x00 ; 0 1cbe2: 0e 94 6c 8c call 0x118d8 ; 0x118d8 if (lcd_clicked()) { 1cbe6: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 1cbea: 81 11 cpse r24, r1 1cbec: 02 c0 rjmp .+4 ; 0x1cbf2 1cbee: 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 1cbf0: b1 f7 brne .-20 ; 0x1cbde delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 1cbf2: 81 e0 ldi r24, 0x01 ; 1 1cbf4: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 1cbf8: df 91 pop r29 1cbfa: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 1cbfc: 0d 94 96 d4 jmp 0x3a92c ; 0x3a92c { 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); 1cc00: 8a e6 ldi r24, 0x6A ; 106 1cc02: 90 e4 ldi r25, 0x40 ; 64 1cc04: 0e 94 2c 72 call 0xe458 ; 0xe458 1cc08: 41 e0 ldi r20, 0x01 ; 1 1cc0a: 60 e0 ldi r22, 0x00 ; 0 1cc0c: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc 1cc10: 91 e0 ldi r25, 0x01 ; 1 1cc12: 81 11 cpse r24, r1 1cc14: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 1cc16: 81 e0 ldi r24, 0x01 ; 1 1cc18: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } if (!loaded) { 1cc1c: 91 11 cpse r25, r1 1cc1e: bb cf rjmp .-138 ; 0x1cb96 1cc20: d5 cf rjmp .-86 ; 0x1cbcc 0001cc22 : { 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) 1cc22: 2f 92 push r2 1cc24: 3f 92 push r3 1cc26: 4f 92 push r4 1cc28: 5f 92 push r5 1cc2a: 6f 92 push r6 1cc2c: 7f 92 push r7 1cc2e: 8f 92 push r8 1cc30: 9f 92 push r9 1cc32: af 92 push r10 1cc34: bf 92 push r11 1cc36: cf 92 push r12 1cc38: df 92 push r13 1cc3a: ef 92 push r14 1cc3c: ff 92 push r15 1cc3e: 0f 93 push r16 1cc40: 1f 93 push r17 1cc42: cf 93 push r28 1cc44: df 93 push r29 1cc46: 00 d0 rcall .+0 ; 0x1cc48 1cc48: 00 d0 rcall .+0 ; 0x1cc4a 1cc4a: 1f 92 push r1 1cc4c: cd b7 in r28, 0x3d ; 61 1cc4e: de b7 in r29, 0x3e ; 62 1cc50: 69 83 std Y+1, r22 ; 0x01 1cc52: 49 01 movw r8, r18 1cc54: 5a 01 movw r10, r20 1cc56: 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; 1cc58: 68 2f mov r22, r24 1cc5a: 70 e0 ldi r23, 0x00 ; 0 1cc5c: 90 e0 ldi r25, 0x00 ; 0 1cc5e: 80 e0 ldi r24, 0x00 ; 0 1cc60: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1cc64: 24 e0 ldi r18, 0x04 ; 4 1cc66: 32 e0 ldi r19, 0x02 ; 2 1cc68: 41 e0 ldi r20, 0x01 ; 1 1cc6a: 5c e3 ldi r21, 0x3C ; 60 1cc6c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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] 1cc70: 20 91 da 12 lds r18, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.402+0x2a> 1cc74: 30 91 db 12 lds r19, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.402+0x2b> 1cc78: 40 91 dc 12 lds r20, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.402+0x2c> 1cc7c: 50 91 dd 12 lds r21, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.402+0x2d> 1cc80: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1cc84: 6b 01 movw r12, r22 1cc86: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1cc88: 20 91 de 12 lds r18, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.402+0x2e> 1cc8c: 30 91 df 12 lds r19, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.402+0x2f> 1cc90: 40 91 e0 12 lds r20, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x30> 1cc94: 50 91 e1 12 lds r21, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x31> 1cc98: c5 01 movw r24, r10 1cc9a: b4 01 movw r22, r8 1cc9c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1cca0: 20 91 e2 12 lds r18, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x32> 1cca4: 30 91 e3 12 lds r19, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x33> 1cca8: 40 91 e4 12 lds r20, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x34> 1ccac: 50 91 e5 12 lds r21, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x35> 1ccb0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1ccb4: a7 01 movw r20, r14 1ccb6: 96 01 movw r18, r12 1ccb8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1ccbc: 6b 01 movw r12, r22 1ccbe: 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; 1ccc0: 20 91 30 13 lds r18, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.402+0x80> 1ccc4: 30 91 31 13 lds r19, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.402+0x81> 1ccc8: 40 91 32 13 lds r20, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.402+0x82> 1cccc: 50 91 33 13 lds r21, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.402+0x83> 1ccd0: c8 01 movw r24, r16 1ccd2: b2 01 movw r22, r4 1ccd4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1ccd8: 9b 01 movw r18, r22 1ccda: 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 1ccdc: c5 01 movw r24, r10 1ccde: b4 01 movw r22, r8 1cce0: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__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) 1cce4: 39 81 ldd r19, Y+1 ; 0x01 1cce6: 24 e0 ldi r18, 0x04 ; 4 1cce8: 32 9f mul r19, r18 1ccea: f0 01 movw r30, r0 1ccec: 11 24 eor r1, r1 1ccee: e0 51 subi r30, 0x10 ; 16 1ccf0: 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 1ccf2: 20 81 ld r18, Z 1ccf4: 31 81 ldd r19, Z+1 ; 0x01 1ccf6: 42 81 ldd r20, Z+2 ; 0x02 1ccf8: 53 81 ldd r21, Z+3 ; 0x03 1ccfa: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 1ccfe: 9b 01 movw r18, r22 1cd00: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1cd02: c7 01 movw r24, r14 1cd04: b6 01 movw r22, r12 1cd06: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1cd0a: 20 91 3d 13 lds r18, 0x133D ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.402+0x8d> 1cd0e: 30 91 3e 13 lds r19, 0x133E ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.402+0x8e> 1cd12: 40 91 3f 13 lds r20, 0x133F ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.402+0x8f> 1cd16: 50 91 40 13 lds r21, 0x1340 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.402+0x90> 1cd1a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1cd1e: 6f 83 std Y+7, r22 ; 0x07 1cd20: 79 83 std Y+1, r23 ; 0x01 1cd22: 18 2f mov r17, r24 1cd24: 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); 1cd26: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x21> 1cd2a: e2 2f mov r30, r18 1cd2c: f0 e0 ldi r31, 0x00 ; 0 1cd2e: 80 91 d0 12 lds r24, 0x12D0 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x20> 1cd32: 81 50 subi r24, 0x01 ; 1 1cd34: 99 0b sbc r25, r25 1cd36: e8 17 cp r30, r24 1cd38: f9 07 cpc r31, r25 1cd3a: 09 f4 brne .+2 ; 0x1cd3e 1cd3c: f4 c0 rjmp .+488 ; 0x1cf26 1cd3e: 2f 5f subi r18, 0xFF ; 255 1cd40: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1cd42: 5e 81 ldd r21, Y+6 ; 0x06 1cd44: 44 e0 ldi r20, 0x04 ; 4 1cd46: 54 9f mul r21, r20 1cd48: 10 01 movw r2, r0 1cd4a: 11 24 eor r1, r1 1cd4c: d1 01 movw r26, r2 1cd4e: a0 55 subi r26, 0x50 ; 80 1cd50: bd 4e sbci r27, 0xED ; 237 1cd52: 2d 91 ld r18, X+ 1cd54: 3d 91 ld r19, X+ 1cd56: 4d 91 ld r20, X+ 1cd58: 5c 91 ld r21, X 1cd5a: 2a 83 std Y+2, r18 ; 0x02 1cd5c: 3b 83 std Y+3, r19 ; 0x03 1cd5e: 4c 83 std Y+4, r20 ; 0x04 1cd60: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1cd62: ee 0f add r30, r30 1cd64: ff 1f adc r31, r31 1cd66: ee 0f add r30, r30 1cd68: ff 1f adc r31, r31 1cd6a: e0 55 subi r30, 0x50 ; 80 1cd6c: fd 4e sbci r31, 0xED ; 237 1cd6e: 40 80 ld r4, Z 1cd70: 51 80 ldd r5, Z+1 ; 0x01 1cd72: 62 80 ldd r6, Z+2 ; 0x02 1cd74: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1cd76: c0 90 ea 12 lds r12, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.402+0x3a> 1cd7a: d0 90 eb 12 lds r13, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.402+0x3b> 1cd7e: e0 90 ec 12 lds r14, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.402+0x3c> 1cd82: f0 90 ed 12 lds r15, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.402+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; 1cd86: 92 01 movw r18, r4 1cd88: a3 01 movw r20, r6 1cd8a: b2 01 movw r22, r4 1cd8c: c3 01 movw r24, r6 1cd8e: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1cd92: 88 23 and r24, r24 1cd94: 21 f0 breq .+8 ; 0x1cd9e 1cd96: 4f 80 ldd r4, Y+7 ; 0x07 1cd98: 59 80 ldd r5, Y+1 ; 0x01 1cd9a: 61 2e mov r6, r17 1cd9c: 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; 1cd9e: a1 01 movw r20, r2 1cda0: 40 55 subi r20, 0x50 ; 80 1cda2: 5d 4e sbci r21, 0xED ; 237 1cda4: 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); 1cda6: a7 01 movw r20, r14 1cda8: 96 01 movw r18, r12 1cdaa: 60 e0 ldi r22, 0x00 ; 0 1cdac: 70 e0 ldi r23, 0x00 ; 0 1cdae: 80 e8 ldi r24, 0x80 ; 128 1cdb0: 9f e3 ldi r25, 0x3F ; 63 1cdb2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1cdb6: 92 01 movw r18, r4 1cdb8: a3 01 movw r20, r6 1cdba: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1cdbe: 2b 01 movw r4, r22 1cdc0: 3c 01 movw r6, r24 1cdc2: a7 01 movw r20, r14 1cdc4: 96 01 movw r18, r12 1cdc6: 6f 81 ldd r22, Y+7 ; 0x07 1cdc8: 79 81 ldd r23, Y+1 ; 0x01 1cdca: 81 2f mov r24, r17 1cdcc: 90 2f mov r25, r16 1cdce: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1cdd2: 9b 01 movw r18, r22 1cdd4: ac 01 movw r20, r24 1cdd6: c3 01 movw r24, r6 1cdd8: b2 01 movw r22, r4 1cdda: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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; 1cdde: f1 01 movw r30, r2 1cde0: 60 83 st Z, r22 1cde2: 71 83 std Z+1, r23 ; 0x01 1cde4: 82 83 std Z+2, r24 ; 0x02 1cde6: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1cde8: fe 81 ldd r31, Y+6 ; 0x06 1cdea: f0 93 d1 12 sts 0x12D1, r31 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x21> // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; 1cdee: 20 91 d6 12 lds r18, 0x12D6 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x26> 1cdf2: 30 91 d7 12 lds r19, 0x12D7 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x27> 1cdf6: 40 91 d8 12 lds r20, 0x12D8 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x28> 1cdfa: 50 91 d9 12 lds r21, 0x12D9 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x29> 1cdfe: c5 01 movw r24, r10 1ce00: b4 01 movw r22, r8 1ce02: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1ce06: 2a 81 ldd r18, Y+2 ; 0x02 1ce08: 3b 81 ldd r19, Y+3 ; 0x03 1ce0a: 4c 81 ldd r20, Y+4 ; 0x04 1ce0c: 5d 81 ldd r21, Y+5 ; 0x05 1ce0e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1ce12: 2b 01 movw r4, r22 1ce14: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1ce16: c0 90 d2 12 lds r12, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x22> 1ce1a: d0 90 d3 12 lds r13, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x23> 1ce1e: e0 90 d4 12 lds r14, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x24> 1ce22: f0 90 d5 12 lds r15, 0x12D5 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.402+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; 1ce26: a7 01 movw r20, r14 1ce28: 96 01 movw r18, r12 1ce2a: c7 01 movw r24, r14 1ce2c: b6 01 movw r22, r12 1ce2e: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 1ce32: 88 23 and r24, r24 1ce34: 19 f0 breq .+6 ; 0x1ce3c 1ce36: c1 2c mov r12, r1 1ce38: d1 2c mov r13, r1 1ce3a: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1ce3c: 23 e3 ldi r18, 0x33 ; 51 1ce3e: 33 e3 ldi r19, 0x33 ; 51 1ce40: 43 e7 ldi r20, 0x73 ; 115 1ce42: 5f e3 ldi r21, 0x3F ; 63 1ce44: c7 01 movw r24, r14 1ce46: b6 01 movw r22, r12 1ce48: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1ce4c: 6b 01 movw r12, r22 1ce4e: 7c 01 movw r14, r24 1ce50: 2d ec ldi r18, 0xCD ; 205 1ce52: 3c ec ldi r19, 0xCC ; 204 1ce54: 4c e4 ldi r20, 0x4C ; 76 1ce56: 5d e3 ldi r21, 0x3D ; 61 1ce58: c3 01 movw r24, r6 1ce5a: b2 01 movw r22, r4 1ce5c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1ce60: 9b 01 movw r18, r22 1ce62: ac 01 movw r20, r24 1ce64: c7 01 movw r24, r14 1ce66: b6 01 movw r22, r12 1ce68: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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; 1ce6c: 80 92 d6 12 sts 0x12D6, r8 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x26> 1ce70: 90 92 d7 12 sts 0x12D7, r9 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x27> 1ce74: a0 92 d8 12 sts 0x12D8, r10 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x28> 1ce78: b0 92 d9 12 sts 0x12D9, r11 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x29> dT_err_prev = dT_err_f; 1ce7c: 60 93 d2 12 sts 0x12D2, r22 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x22> 1ce80: 70 93 d3 12 sts 0x12D3, r23 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x23> 1ce84: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x24> 1ce88: 90 93 d5 12 sts 0x12D5, r25 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x25> // check and trigger errors flag_bits.error = (fabsf(dT_err_f) > err_s); 1ce8c: 6b 01 movw r12, r22 1ce8e: 7c 01 movw r14, r24 1ce90: e8 94 clt 1ce92: f7 f8 bld r15, 7 1ce94: 21 e0 ldi r18, 0x01 ; 1 1ce96: 29 83 std Y+1, r18 ; 0x01 1ce98: 20 91 45 13 lds r18, 0x1345 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.402+0x95> 1ce9c: 30 91 46 13 lds r19, 0x1346 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.402+0x96> 1cea0: 40 91 47 13 lds r20, 0x1347 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.402+0x97> 1cea4: 50 91 48 13 lds r21, 0x1348 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.402+0x98> 1cea8: c7 01 movw r24, r14 1ceaa: b6 01 movw r22, r12 1ceac: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1ceb0: 18 16 cp r1, r24 1ceb2: 0c f0 brlt .+2 ; 0x1ceb6 1ceb4: 19 82 std Y+1, r1 ; 0x01 1ceb6: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> 1ceba: 39 81 ldd r19, Y+1 ; 0x01 1cebc: 30 fb bst r19, 0 1cebe: 81 f9 bld r24, 1 1cec0: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1cec4: 41 e0 ldi r20, 0x01 ; 1 1cec6: 49 83 std Y+1, r20 ; 0x01 1cec8: 20 91 41 13 lds r18, 0x1341 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.402+0x91> 1cecc: 30 91 42 13 lds r19, 0x1342 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.402+0x92> 1ced0: 40 91 43 13 lds r20, 0x1343 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.402+0x93> 1ced4: 50 91 44 13 lds r21, 0x1344 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.402+0x94> 1ced8: c7 01 movw r24, r14 1ceda: b6 01 movw r22, r12 1cedc: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1cee0: 18 16 cp r1, r24 1cee2: 0c f0 brlt .+2 ; 0x1cee6 1cee4: 19 82 std Y+1, r1 ; 0x01 1cee6: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> 1ceea: 59 81 ldd r21, Y+1 ; 0x01 1ceec: 50 fb bst r21, 0 1ceee: 82 f9 bld r24, 2 1cef0: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> } 1cef4: 27 96 adiw r28, 0x07 ; 7 1cef6: 0f b6 in r0, 0x3f ; 63 1cef8: f8 94 cli 1cefa: de bf out 0x3e, r29 ; 62 1cefc: 0f be out 0x3f, r0 ; 63 1cefe: cd bf out 0x3d, r28 ; 61 1cf00: df 91 pop r29 1cf02: cf 91 pop r28 1cf04: 1f 91 pop r17 1cf06: 0f 91 pop r16 1cf08: ff 90 pop r15 1cf0a: ef 90 pop r14 1cf0c: df 90 pop r13 1cf0e: cf 90 pop r12 1cf10: bf 90 pop r11 1cf12: af 90 pop r10 1cf14: 9f 90 pop r9 1cf16: 8f 90 pop r8 1cf18: 7f 90 pop r7 1cf1a: 6f 90 pop r6 1cf1c: 5f 90 pop r5 1cf1e: 4f 90 pop r4 1cf20: 3f 90 pop r3 1cf22: 2f 90 pop r2 1cf24: 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); 1cf26: 1e 82 std Y+6, r1 ; 0x06 1cf28: 0c cf rjmp .-488 ; 0x1cd42 0001cf2a : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1cf2a: 2f 92 push r2 1cf2c: 3f 92 push r3 1cf2e: 4f 92 push r4 1cf30: 5f 92 push r5 1cf32: 6f 92 push r6 1cf34: 7f 92 push r7 1cf36: 8f 92 push r8 1cf38: 9f 92 push r9 1cf3a: af 92 push r10 1cf3c: bf 92 push r11 1cf3e: cf 92 push r12 1cf40: df 92 push r13 1cf42: ef 92 push r14 1cf44: ff 92 push r15 1cf46: 0f 93 push r16 1cf48: 1f 93 push r17 1cf4a: cf 93 push r28 1cf4c: df 93 push r29 1cf4e: cd b7 in r28, 0x3d ; 61 1cf50: de b7 in r29, 0x3e ; 62 1cf52: a4 97 sbiw r28, 0x24 ; 36 1cf54: 0f b6 in r0, 0x3f ; 63 1cf56: f8 94 cli 1cf58: de bf out 0x3e, r29 ; 62 1cf5a: 0f be out 0x3f, r0 ; 63 1cf5c: cd bf out 0x3d, r28 ; 61 1cf5e: 9b 8f std Y+27, r25 ; 0x1b 1cf60: 8a 8f std Y+26, r24 ; 0x1a 1cf62: 7a 8b std Y+18, r23 ; 0x12 1cf64: 69 8b std Y+17, r22 ; 0x11 1cf66: 2b 8b std Y+19, r18 ; 0x13 1cf68: 3c 8b std Y+20, r19 ; 0x14 1cf6a: 4d 8b std Y+21, r20 ; 0x15 1cf6c: 5e 8b std Y+22, r21 ; 0x16 1cf6e: 0c 8f std Y+28, r16 ; 0x1c 1cf70: cd 8e std Y+29, r12 ; 0x1d 1cf72: de 8e std Y+30, r13 ; 0x1e 1cf74: ef 8e std Y+31, r14 ; 0x1f 1cf76: 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; 1cf78: 20 91 1d 05 lds r18, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> 1cf7c: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1cf7e: 80 e0 ldi r24, 0x00 ; 0 1cf80: 0f 94 64 33 call 0x266c8 ; 0x266c8 float orig = *var; 1cf84: a9 89 ldd r26, Y+17 ; 0x11 1cf86: ba 89 ldd r27, Y+18 ; 0x12 1cf88: 8d 91 ld r24, X+ 1cf8a: 9d 91 ld r25, X+ 1cf8c: 0d 90 ld r0, X+ 1cf8e: bc 91 ld r27, X 1cf90: a0 2d mov r26, r0 1cf92: 89 a3 std Y+33, r24 ; 0x21 1cf94: 9a a3 std Y+34, r25 ; 0x22 1cf96: ab a3 std Y+35, r26 ; 0x23 1cf98: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1cf9a: 80 e0 ldi r24, 0x00 ; 0 1cf9c: 90 e0 ldi r25, 0x00 ; 0 1cf9e: a0 ea ldi r26, 0xA0 ; 160 1cfa0: b0 e4 ldi r27, 0x40 ; 64 1cfa2: 89 83 std Y+1, r24 ; 0x01 1cfa4: 9a 83 std Y+2, r25 ; 0x02 1cfa6: ab 83 std Y+3, r26 ; 0x03 1cfa8: bc 83 std Y+4, r27 ; 0x04 1cfaa: 8b 89 ldd r24, Y+19 ; 0x13 1cfac: 9c 89 ldd r25, Y+20 ; 0x14 1cfae: ad 89 ldd r26, Y+21 ; 0x15 1cfb0: be 89 ldd r27, Y+22 ; 0x16 1cfb2: 8d 83 std Y+5, r24 ; 0x05 1cfb4: 9e 83 std Y+6, r25 ; 0x06 1cfb6: af 83 std Y+7, r26 ; 0x07 1cfb8: 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]); 1cfba: 20 e0 ldi r18, 0x00 ; 0 1cfbc: 30 e0 ldi r19, 0x00 ; 0 1cfbe: 40 ea ldi r20, 0xA0 ; 160 1cfc0: 50 e4 ldi r21, 0x40 ; 64 1cfc2: bc 01 movw r22, r24 1cfc4: cd 01 movw r24, r26 1cfc6: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1cfca: 2a e7 ldi r18, 0x7A ; 122 1cfcc: 37 e3 ldi r19, 0x37 ; 55 1cfce: 4e e1 ldi r20, 0x1E ; 30 1cfd0: 5f e3 ldi r21, 0x3F ; 63 1cfd2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1cfd6: 6b 01 movw r12, r22 1cfd8: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 1cfda: 20 e0 ldi r18, 0x00 ; 0 1cfdc: 30 e0 ldi r19, 0x00 ; 0 1cfde: 40 ea ldi r20, 0xA0 ; 160 1cfe0: 50 e4 ldi r21, 0x40 ; 64 1cfe2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1cfe6: 69 87 std Y+9, r22 ; 0x09 1cfe8: 7a 87 std Y+10, r23 ; 0x0a 1cfea: 8b 87 std Y+11, r24 ; 0x0b 1cfec: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1cfee: a7 01 movw r20, r14 1cff0: 96 01 movw r18, r12 1cff2: 6b 89 ldd r22, Y+19 ; 0x13 1cff4: 7c 89 ldd r23, Y+20 ; 0x14 1cff6: 8d 89 ldd r24, Y+21 ; 0x15 1cff8: 9e 89 ldd r25, Y+22 ; 0x16 1cffa: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1cffe: 6d 87 std Y+13, r22 ; 0x0d 1d000: 7e 87 std Y+14, r23 ; 0x0e 1d002: 8f 87 std Y+15, r24 ; 0x0f 1d004: 98 8b std Y+16, r25 ; 0x10 1d006: 31 2c mov r3, r1 1d008: 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); 1d00a: 29 85 ldd r18, Y+9 ; 0x09 1d00c: 3a 85 ldd r19, Y+10 ; 0x0a 1d00e: 4b 85 ldd r20, Y+11 ; 0x0b 1d010: 5c 85 ldd r21, Y+12 ; 0x0c 1d012: cd 8c ldd r12, Y+29 ; 0x1d 1d014: de 8c ldd r13, Y+30 ; 0x1e 1d016: ef 8c ldd r14, Y+31 ; 0x1f 1d018: f8 a0 ldd r15, Y+32 ; 0x20 1d01a: 0c 8d ldd r16, Y+28 ; 0x1c 1d01c: 69 89 ldd r22, Y+17 ; 0x11 1d01e: 7a 89 ldd r23, Y+18 ; 0x12 1d020: 8a 8d ldd r24, Y+26 ; 0x1a 1d022: 9b 8d ldd r25, Y+27 ; 0x1b 1d024: 0f 94 b2 2d call 0x25b64 ; 0x25b64 1d028: 4b 01 movw r8, r22 1d02a: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1d02c: 2d 85 ldd r18, Y+13 ; 0x0d 1d02e: 3e 85 ldd r19, Y+14 ; 0x0e 1d030: 4f 85 ldd r20, Y+15 ; 0x0f 1d032: 58 89 ldd r21, Y+16 ; 0x10 1d034: cd 8c ldd r12, Y+29 ; 0x1d 1d036: de 8c ldd r13, Y+30 ; 0x1e 1d038: ef 8c ldd r14, Y+31 ; 0x1f 1d03a: f8 a0 ldd r15, Y+32 ; 0x20 1d03c: 0c 8d ldd r16, Y+28 ; 0x1c 1d03e: 69 89 ldd r22, Y+17 ; 0x11 1d040: 7a 89 ldd r23, Y+18 ; 0x12 1d042: 8a 8d ldd r24, Y+26 ; 0x1a 1d044: 9b 8d ldd r25, Y+27 ; 0x1b 1d046: 0f 94 b2 2d call 0x25b64 ; 0x25b64 1d04a: 9b 01 movw r18, r22 1d04c: ac 01 movw r20, r24 bool dir = (c2 < c1); 1d04e: 11 e0 ldi r17, 0x01 ; 1 1d050: c5 01 movw r24, r10 1d052: b4 01 movw r22, r8 1d054: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1d058: 18 16 cp r1, r24 1d05a: 0c f0 brlt .+2 ; 0x1d05e 1d05c: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1d05e: 01 e0 ldi r16, 0x01 ; 1 1d060: 01 27 eor r16, r17 1d062: 80 2f mov r24, r16 1d064: 90 e0 ldi r25, 0x00 ; 0 1d066: e1 2f mov r30, r17 1d068: f0 e0 ldi r31, 0x00 ; 0 1d06a: ee 0f add r30, r30 1d06c: ff 1f adc r31, r31 1d06e: ee 0f add r30, r30 1d070: ff 1f adc r31, r31 1d072: 41 e0 ldi r20, 0x01 ; 1 1d074: 50 e0 ldi r21, 0x00 ; 0 1d076: 4c 0f add r20, r28 1d078: 5d 1f adc r21, r29 1d07a: 4e 0f add r20, r30 1d07c: 5f 1f adc r21, r31 1d07e: 8c 01 movw r16, r24 1d080: 00 0f add r16, r16 1d082: 11 1f adc r17, r17 1d084: 00 0f add r16, r16 1d086: 11 1f adc r17, r17 1d088: a1 e0 ldi r26, 0x01 ; 1 1d08a: b0 e0 ldi r27, 0x00 ; 0 1d08c: ac 0f add r26, r28 1d08e: bd 1f adc r27, r29 1d090: 0a 0f add r16, r26 1d092: 1b 1f adc r17, r27 1d094: f8 01 movw r30, r16 1d096: 38 96 adiw r30, 0x08 ; 8 1d098: f8 8f std Y+24, r31 ; 0x18 1d09a: ef 8b std Y+23, r30 ; 0x17 1d09c: f8 01 movw r30, r16 1d09e: 80 85 ldd r24, Z+8 ; 0x08 1d0a0: 91 85 ldd r25, Z+9 ; 0x09 1d0a2: a2 85 ldd r26, Z+10 ; 0x0a 1d0a4: b3 85 ldd r27, Z+11 ; 0x0b 1d0a6: fa 01 movw r30, r20 1d0a8: 80 83 st Z, r24 1d0aa: 91 83 std Z+1, r25 ; 0x01 1d0ac: a2 83 std Z+2, r26 ; 0x02 1d0ae: 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]); 1d0b0: 8d 80 ldd r8, Y+5 ; 0x05 1d0b2: 9e 80 ldd r9, Y+6 ; 0x06 1d0b4: af 80 ldd r10, Y+7 ; 0x07 1d0b6: b8 84 ldd r11, Y+8 ; 0x08 1d0b8: c9 80 ldd r12, Y+1 ; 0x01 1d0ba: da 80 ldd r13, Y+2 ; 0x02 1d0bc: eb 80 ldd r14, Y+3 ; 0x03 1d0be: fc 80 ldd r15, Y+4 ; 0x04 1d0c0: a7 01 movw r20, r14 1d0c2: 96 01 movw r18, r12 1d0c4: c5 01 movw r24, r10 1d0c6: b4 01 movw r22, r8 1d0c8: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1d0cc: 2a e7 ldi r18, 0x7A ; 122 1d0ce: 37 e3 ldi r19, 0x37 ; 55 1d0d0: 4e e1 ldi r20, 0x1E ; 30 1d0d2: 5f e3 ldi r21, 0x3F ; 63 1d0d4: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1d0d8: 2b 01 movw r4, r22 1d0da: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1d0dc: ac 01 movw r20, r24 1d0de: 9b 01 movw r18, r22 1d0e0: c7 01 movw r24, r14 1d0e2: b6 01 movw r22, r12 1d0e4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1d0e8: 69 87 std Y+9, r22 ; 0x09 1d0ea: 7a 87 std Y+10, r23 ; 0x0a 1d0ec: 8b 87 std Y+11, r24 ; 0x0b 1d0ee: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1d0f0: a3 01 movw r20, r6 1d0f2: 92 01 movw r18, r4 1d0f4: c5 01 movw r24, r10 1d0f6: b4 01 movw r22, r8 1d0f8: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1d0fc: 6d 87 std Y+13, r22 ; 0x0d 1d0fe: 7e 87 std Y+14, r23 ; 0x0e 1d100: 8f 87 std Y+15, r24 ; 0x0f 1d102: 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]; 1d104: d8 01 movw r26, r16 1d106: 18 96 adiw r26, 0x08 ; 8 1d108: 4c 90 ld r4, X 1d10a: ef 89 ldd r30, Y+23 ; 0x17 1d10c: f8 8d ldd r31, Y+24 ; 0x18 1d10e: 51 80 ldd r5, Z+1 ; 0x01 1d110: 62 80 ldd r6, Z+2 ; 0x02 1d112: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1d114: a5 01 movw r20, r10 1d116: 94 01 movw r18, r8 1d118: c7 01 movw r24, r14 1d11a: b6 01 movw r22, r12 1d11c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1d120: 24 2d mov r18, r4 1d122: 35 2d mov r19, r5 1d124: 46 2d mov r20, r6 1d126: 57 2d mov r21, r7 1d128: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 1d12c: 9f 77 andi r25, 0x7F ; 127 1d12e: 2c e0 ldi r18, 0x0C ; 12 1d130: 31 e9 ldi r19, 0x91 ; 145 1d132: 43 ec ldi r20, 0xC3 ; 195 1d134: 5e e3 ldi r21, 0x3E ; 62 1d136: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1d13a: 6b 01 movw r12, r22 1d13c: 7c 01 movw r14, r24 1d13e: 5b 01 movw r10, r22 1d140: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1d142: ff 92 push r15 1d144: 8f 93 push r24 1d146: df 92 push r13 1d148: 6f 93 push r22 1d14a: 7f 92 push r7 1d14c: 6f 92 push r6 1d14e: 5f 92 push r5 1d150: 4f 92 push r4 1d152: 3f 92 push r3 1d154: 2f 92 push r2 1d156: 20 ef ldi r18, 0xF0 ; 240 1d158: 3d e8 ldi r19, 0x8D ; 141 1d15a: 3f 93 push r19 1d15c: 2f 93 push r18 1d15e: 0f 94 16 db call 0x3b62c ; 0x3b62c if(e < thr) { 1d162: 0f b6 in r0, 0x3f ; 63 1d164: f8 94 cli 1d166: de bf out 0x3e, r29 ; 62 1d168: 0f be out 0x3f, r0 ; 63 1d16a: cd bf out 0x3d, r28 ; 61 1d16c: 2a e0 ldi r18, 0x0A ; 10 1d16e: 37 ed ldi r19, 0xD7 ; 215 1d170: 43 e2 ldi r20, 0x23 ; 35 1d172: 5c e3 ldi r21, 0x3C ; 60 1d174: 6c 2d mov r22, r12 1d176: 7d 2d mov r23, r13 1d178: 8e 2d mov r24, r14 1d17a: 9f 2d mov r25, r15 1d17c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1d180: 87 ff sbrs r24, 7 1d182: 42 c0 rjmp .+132 ; 0x1d208 if(x == min || x == max) { 1d184: 20 e0 ldi r18, 0x00 ; 0 1d186: 30 e0 ldi r19, 0x00 ; 0 1d188: 40 ea ldi r20, 0xA0 ; 160 1d18a: 50 e4 ldi r21, 0x40 ; 64 1d18c: 64 2d mov r22, r4 1d18e: 75 2d mov r23, r5 1d190: 86 2d mov r24, r6 1d192: 97 2d mov r25, r7 1d194: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1d198: 88 23 and r24, r24 1d19a: f1 f1 breq .+124 ; 0x1d218 1d19c: 24 2d mov r18, r4 1d19e: 35 2d mov r19, r5 1d1a0: 46 2d mov r20, r6 1d1a2: 57 2d mov r21, r7 1d1a4: 6b 89 ldd r22, Y+19 ; 0x13 1d1a6: 7c 89 ldd r23, Y+20 ; 0x14 1d1a8: 8d 89 ldd r24, Y+21 ; 0x15 1d1aa: 9e 89 ldd r25, Y+22 ; 0x16 1d1ac: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1d1b0: 88 23 and r24, r24 1d1b2: 91 f1 breq .+100 ; 0x1d218 // real value likely outside of the search boundaries break; } *var = x; 1d1b4: 84 2d mov r24, r4 1d1b6: 95 2d mov r25, r5 1d1b8: a6 2d mov r26, r6 1d1ba: b7 2d mov r27, r7 1d1bc: e9 89 ldd r30, Y+17 ; 0x11 1d1be: fa 89 ldd r31, Y+18 ; 0x12 1d1c0: 80 83 st Z, r24 1d1c2: 91 83 std Z+1, r25 ; 0x01 1d1c4: a2 83 std Z+2, r26 ; 0x02 1d1c6: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1d1c8: 89 8d ldd r24, Y+25 ; 0x19 1d1ca: 0f 94 64 33 call 0x266c8 ; 0x266c8 SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1d1ce: 6a 2d mov r22, r10 1d1d0: 7b 2d mov r23, r11 1d1d2: 80 2f mov r24, r16 1d1d4: 91 2f mov r25, r17 1d1d6: a4 96 adiw r28, 0x24 ; 36 1d1d8: 0f b6 in r0, 0x3f ; 63 1d1da: f8 94 cli 1d1dc: de bf out 0x3e, r29 ; 62 1d1de: 0f be out 0x3f, r0 ; 63 1d1e0: cd bf out 0x3d, r28 ; 61 1d1e2: df 91 pop r29 1d1e4: cf 91 pop r28 1d1e6: 1f 91 pop r17 1d1e8: 0f 91 pop r16 1d1ea: ff 90 pop r15 1d1ec: ef 90 pop r14 1d1ee: df 90 pop r13 1d1f0: cf 90 pop r12 1d1f2: bf 90 pop r11 1d1f4: af 90 pop r10 1d1f6: 9f 90 pop r9 1d1f8: 8f 90 pop r8 1d1fa: 7f 90 pop r7 1d1fc: 6f 90 pop r6 1d1fe: 5f 90 pop r5 1d200: 4f 90 pop r4 1d202: 3f 90 pop r3 1d204: 2f 90 pop r2 1d206: 08 95 ret 1d208: ff ef ldi r31, 0xFF ; 255 1d20a: 2f 1a sub r2, r31 1d20c: 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) { 1d20e: 2e e1 ldi r18, 0x1E ; 30 1d210: 22 16 cp r2, r18 1d212: 31 04 cpc r3, r1 1d214: 09 f0 breq .+2 ; 0x1d218 1d216: f9 ce rjmp .-526 ; 0x1d00a thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1d218: 81 ed ldi r24, 0xD1 ; 209 1d21a: 9d e8 ldi r25, 0x8D ; 141 1d21c: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 *var = orig; 1d220: 89 a1 ldd r24, Y+33 ; 0x21 1d222: 9a a1 ldd r25, Y+34 ; 0x22 1d224: ab a1 ldd r26, Y+35 ; 0x23 1d226: bc a1 ldd r27, Y+36 ; 0x24 1d228: e9 89 ldd r30, Y+17 ; 0x11 1d22a: fa 89 ldd r31, Y+18 ; 0x12 1d22c: 80 83 st Z, r24 1d22e: 91 83 std Z+1, r25 ; 0x01 1d230: a2 83 std Z+2, r26 ; 0x02 1d232: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1d234: 89 8d ldd r24, Y+25 ; 0x19 1d236: 0f 94 64 33 call 0x266c8 ; 0x266c8 return NAN; 1d23a: a1 2c mov r10, r1 1d23c: b1 2c mov r11, r1 1d23e: 00 ec ldi r16, 0xC0 ; 192 1d240: 1f e7 ldi r17, 0x7F ; 127 1d242: c5 cf rjmp .-118 ; 0x1d1ce 0001d244 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1d244: ef 92 push r14 1d246: ff 92 push r15 1d248: 0f 93 push r16 1d24a: 1f 93 push r17 1d24c: cf 93 push r28 1d24e: df 93 push r29 1d250: 00 d0 rcall .+0 ; 0x1d252 1d252: 1f 92 push r1 1d254: 1f 92 push r1 1d256: cd b7 in r28, 0x3d ; 61 1d258: de b7 in r29, 0x3e ; 62 1d25a: 08 2f mov r16, r24 1d25c: 16 2f mov r17, r22 1d25e: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1d260: 0f 94 bc 88 call 0x31178 ; 0x31178 1d264: 88 23 and r24, r24 1d266: d9 f0 breq .+54 ; 0x1d29e 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) { 1d268: 0b 30 cpi r16, 0x0B ; 11 1d26a: 29 f1 breq .+74 ; 0x1d2b6 1d26c: 04 31 cpi r16, 0x14 ; 20 1d26e: 31 f1 breq .+76 ; 0x1d2bc /// @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()) { 1d270: 87 e5 ldi r24, 0x57 ; 87 1d272: e8 2e mov r14, r24 1d274: e9 82 std Y+1, r14 ; 0x01 1d276: 0a 83 std Y+2, r16 ; 0x02 1d278: 1b 83 std Y+3, r17 ; 0x03 1d27a: fc 82 std Y+4, r15 ; 0x04 1d27c: ce 01 movw r24, r28 1d27e: 01 96 adiw r24, 0x01 ; 1 1d280: 0f 94 a1 c5 call 0x38b42 ; 0x38b42 1d284: 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)); 1d286: 47 e5 ldi r20, 0x57 ; 87 1d288: 50 2f mov r21, r16 1d28a: 61 2f mov r22, r17 1d28c: 7f 2d mov r23, r15 1d28e: 0f 94 8a a5 call 0x34b14 ; 0x34b14 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)); 1d292: 60 e0 ldi r22, 0x00 ; 0 1d294: 80 e0 ldi r24, 0x00 ; 0 1d296: 0f 94 ae ac call 0x3595c ; 0x3595c 1d29a: 88 23 and r24, r24 1d29c: 59 f3 breq .-42 ; 0x1d274 return true; } 1d29e: 0f 90 pop r0 1d2a0: 0f 90 pop r0 1d2a2: 0f 90 pop r0 1d2a4: 0f 90 pop r0 1d2a6: 0f 90 pop r0 1d2a8: df 91 pop r29 1d2aa: cf 91 pop r28 1d2ac: 1f 91 pop r17 1d2ae: 0f 91 pop r16 1d2b0: ff 90 pop r15 1d2b2: ef 90 pop r14 1d2b4: 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); 1d2b6: 10 93 97 13 sts 0x1397, r17 ; 0x801397 1d2ba: da cf rjmp .-76 ; 0x1d270 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1d2bc: 10 93 98 13 sts 0x1398, r17 ; 0x801398 1d2c0: d7 cf rjmp .-82 ; 0x1d270 0001d2c2 : #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) 1d2c2: 82 30 cpi r24, 0x02 ; 2 1d2c4: 91 05 cpc r25, r1 1d2c6: 38 f0 brcs .+14 ; 0x1d2d6 // 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 1d2c8: 88 0f add r24, r24 1d2ca: 99 1f adc r25, r25 1d2cc: 88 0f add r24, r24 1d2ce: 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, 1d2d0: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1d2d2: 01 97 sbiw r24, 0x01 ; 1 1d2d4: f1 f7 brne .-4 ; 0x1d2d2 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1d2d6: 08 95 ret 0001d2d8 : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1d2d8: cf 93 push r28 1d2da: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1d2dc: 28 2f mov r18, r24 1d2de: 30 e0 ldi r19, 0x00 ; 0 1d2e0: f9 01 movw r30, r18 1d2e2: ee 5f subi r30, 0xFE ; 254 1d2e4: f3 47 sbci r31, 0x73 ; 115 1d2e6: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1d2e8: f9 01 movw r30, r18 1d2ea: e4 55 subi r30, 0x54 ; 84 1d2ec: f4 47 sbci r31, 0x74 ; 116 1d2ee: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1d2f0: f9 01 movw r30, r18 1d2f2: ea 5a subi r30, 0xAA ; 170 1d2f4: f4 47 sbci r31, 0x74 ; 116 1d2f6: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1d2f8: cc 23 and r28, r28 1d2fa: a1 f0 breq .+40 ; 0x1d324 // 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); 1d2fc: 81 11 cpse r24, r1 1d2fe: 0e 94 95 cd call 0x19b2a ; 0x19b2a if (*portInputRegister(port) & bit) return HIGH; 1d302: ec 2f mov r30, r28 1d304: f0 e0 ldi r31, 0x00 ; 0 1d306: ee 0f add r30, r30 1d308: ff 1f adc r31, r31 1d30a: e4 5c subi r30, 0xC4 ; 196 1d30c: f4 47 sbci r31, 0x74 ; 116 1d30e: a5 91 lpm r26, Z+ 1d310: b4 91 lpm r27, Z 1d312: ec 91 ld r30, X 1d314: ed 23 and r30, r29 1d316: 81 e0 ldi r24, 0x01 ; 1 1d318: 90 e0 ldi r25, 0x00 ; 0 1d31a: 09 f4 brne .+2 ; 0x1d31e 1d31c: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1d31e: df 91 pop r29 1d320: cf 91 pop r28 1d322: 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; 1d324: 80 e0 ldi r24, 0x00 ; 0 1d326: 90 e0 ldi r25, 0x00 ; 0 1d328: fa cf rjmp .-12 ; 0x1d31e 0001d32a : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1d32a: 1f 93 push r17 1d32c: cf 93 push r28 1d32e: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1d330: 28 2f mov r18, r24 1d332: 30 e0 ldi r19, 0x00 ; 0 1d334: f9 01 movw r30, r18 1d336: ee 5f subi r30, 0xFE ; 254 1d338: f3 47 sbci r31, 0x73 ; 115 1d33a: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1d33c: f9 01 movw r30, r18 1d33e: e4 55 subi r30, 0x54 ; 84 1d340: f4 47 sbci r31, 0x74 ; 116 1d342: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1d344: f9 01 movw r30, r18 1d346: ea 5a subi r30, 0xAA ; 170 1d348: f4 47 sbci r31, 0x74 ; 116 1d34a: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1d34c: cc 23 and r28, r28 1d34e: a9 f0 breq .+42 ; 0x1d37a 1d350: 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); 1d352: 81 11 cpse r24, r1 1d354: 0e 94 95 cd call 0x19b2a ; 0x19b2a out = portOutputRegister(port); 1d358: ec 2f mov r30, r28 1d35a: f0 e0 ldi r31, 0x00 ; 0 1d35c: ee 0f add r30, r30 1d35e: ff 1f adc r31, r31 1d360: ee 5d subi r30, 0xDE ; 222 1d362: f4 47 sbci r31, 0x74 ; 116 1d364: a5 91 lpm r26, Z+ 1d366: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1d368: 8f b7 in r24, 0x3f ; 63 cli(); 1d36a: f8 94 cli if (val == LOW) { *out &= ~bit; 1d36c: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1d36e: 11 11 cpse r17, r1 1d370: 08 c0 rjmp .+16 ; 0x1d382 *out &= ~bit; 1d372: d0 95 com r29 1d374: de 23 and r29, r30 } else { *out |= bit; 1d376: dc 93 st X, r29 } SREG = oldSREG; 1d378: 8f bf out 0x3f, r24 ; 63 } 1d37a: df 91 pop r29 1d37c: cf 91 pop r28 1d37e: 1f 91 pop r17 1d380: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1d382: de 2b or r29, r30 1d384: f8 cf rjmp .-16 ; 0x1d376 0001d386 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1d386: cf 93 push r28 1d388: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1d38a: 90 e0 ldi r25, 0x00 ; 0 1d38c: fc 01 movw r30, r24 1d38e: e4 55 subi r30, 0x54 ; 84 1d390: f4 47 sbci r31, 0x74 ; 116 1d392: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1d394: 8a 5a subi r24, 0xAA ; 170 1d396: 94 47 sbci r25, 0x74 ; 116 1d398: fc 01 movw r30, r24 1d39a: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1d39c: 88 23 and r24, r24 1d39e: d1 f0 breq .+52 ; 0x1d3d4 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1d3a0: 90 e0 ldi r25, 0x00 ; 0 1d3a2: 88 0f add r24, r24 1d3a4: 99 1f adc r25, r25 1d3a6: fc 01 movw r30, r24 1d3a8: e8 5f subi r30, 0xF8 ; 248 1d3aa: f4 47 sbci r31, 0x74 ; 116 1d3ac: a5 91 lpm r26, Z+ 1d3ae: b4 91 lpm r27, Z out = portOutputRegister(port); 1d3b0: fc 01 movw r30, r24 1d3b2: ee 5d subi r30, 0xDE ; 222 1d3b4: f4 47 sbci r31, 0x74 ; 116 1d3b6: c5 91 lpm r28, Z+ 1d3b8: d4 91 lpm r29, Z if (mode == INPUT) { 1d3ba: 61 11 cpse r22, r1 1d3bc: 0e c0 rjmp .+28 ; 0x1d3da uint8_t oldSREG = SREG; 1d3be: 9f b7 in r25, 0x3f ; 63 cli(); 1d3c0: f8 94 cli *reg &= ~bit; 1d3c2: 8c 91 ld r24, X 1d3c4: e2 2f mov r30, r18 1d3c6: e0 95 com r30 1d3c8: 8e 23 and r24, r30 1d3ca: 8c 93 st X, r24 *out &= ~bit; 1d3cc: 28 81 ld r18, Y 1d3ce: e2 23 and r30, r18 1d3d0: e8 83 st Y, r30 SREG = oldSREG; 1d3d2: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1d3d4: df 91 pop r29 1d3d6: cf 91 pop r28 1d3d8: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1d3da: 8f b7 in r24, 0x3f ; 63 cli(); 1d3dc: f8 94 cli *reg |= bit; 1d3de: ec 91 ld r30, X 1d3e0: e2 2b or r30, r18 1d3e2: ec 93 st X, r30 SREG = oldSREG; 1d3e4: 8f bf out 0x3f, r24 ; 63 1d3e6: f6 cf rjmp .-20 ; 0x1d3d4 0001d3e8 : // 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) { 1d3e8: 1f 93 push r17 1d3ea: cf 93 push r28 1d3ec: df 93 push r29 1d3ee: 18 2f mov r17, r24 1d3f0: 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); 1d3f2: 61 e0 ldi r22, 0x01 ; 1 1d3f4: 0e 94 c3 e9 call 0x1d386 ; 0x1d386 if (val == 0) 1d3f8: 20 97 sbiw r28, 0x00 ; 0 1d3fa: 39 f4 brne .+14 ; 0x1d40a { digitalWrite(pin, LOW); 1d3fc: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1d3fe: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1d400: df 91 pop r29 1d402: cf 91 pop r28 1d404: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1d406: 0c 94 95 e9 jmp 0x1d32a ; 0x1d32a pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1d40a: cf 3f cpi r28, 0xFF ; 255 1d40c: d1 05 cpc r29, r1 1d40e: 11 f4 brne .+4 ; 0x1d414 { digitalWrite(pin, HIGH); 1d410: 61 e0 ldi r22, 0x01 ; 1 1d412: f5 cf rjmp .-22 ; 0x1d3fe } else { switch(digitalPinToTimer(pin)) 1d414: e1 2f mov r30, r17 1d416: f0 e0 ldi r31, 0x00 ; 0 1d418: ee 5f subi r30, 0xFE ; 254 1d41a: f3 47 sbci r31, 0x73 ; 115 1d41c: e4 91 lpm r30, Z 1d41e: e1 50 subi r30, 0x01 ; 1 1d420: e2 31 cpi r30, 0x12 ; 18 1d422: 08 f0 brcs .+2 ; 0x1d426 1d424: b3 c0 rjmp .+358 ; 0x1d58c 1d426: f0 e0 ldi r31, 0x00 ; 0 1d428: 88 27 eor r24, r24 1d42a: e6 5e subi r30, 0xE6 ; 230 1d42c: f5 41 sbci r31, 0x15 ; 21 1d42e: 8f 4f sbci r24, 0xFF ; 255 1d430: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 1d434: 2c ea ldi r18, 0xAC ; 172 1d436: 34 ea ldi r19, 0xA4 ; 164 1d438: 39 ea ldi r19, 0xA9 ; 169 1d43a: 43 ea ldi r20, 0xA3 ; 163 1d43c: 4d ea ldi r20, 0xAD ; 173 1d43e: c6 ea ldi r28, 0xA6 ; 166 1d440: 57 ea ldi r21, 0xA7 ; 167 1d442: 5f ea ldi r21, 0xAF ; 175 1d444: 67 ea ldi r22, 0xA7 ; 167 1d446: 71 ea ldi r23, 0xA1 ; 161 1d448: 7b ea ldi r23, 0xAB ; 171 1d44a: 85 ea ldi r24, 0xA5 ; 165 1d44c: 94 ea ldi r25, 0xA4 ; 164 1d44e: 9e ea ldi r25, 0xAE ; 174 1d450: c6 ea ldi r28, 0xA6 ; 166 1d452: a8 ea ldi r26, 0xA8 ; 168 1d454: b2 ea ldi r27, 0xA2 ; 162 1d456: bc ea ldi r27, 0xAC ; 172 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1d458: 84 b5 in r24, 0x24 ; 36 1d45a: 80 68 ori r24, 0x80 ; 128 1d45c: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1d45e: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1d460: df 91 pop r29 1d462: cf 91 pop r28 1d464: 1f 91 pop r17 1d466: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1d468: 84 b5 in r24, 0x24 ; 36 1d46a: 80 62 ori r24, 0x20 ; 32 1d46c: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1d46e: c8 bd out 0x28, r28 ; 40 1d470: f7 cf rjmp .-18 ; 0x1d460 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1d472: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d476: 80 68 ori r24, 0x80 ; 128 1d478: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1d47c: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1d480: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1d484: ed cf rjmp .-38 ; 0x1d460 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1d486: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d48a: 80 62 ori r24, 0x20 ; 32 1d48c: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1d490: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1d494: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1d498: e3 cf rjmp .-58 ; 0x1d460 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1d49a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d49e: 88 60 ori r24, 0x08 ; 8 1d4a0: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1d4a4: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1d4a8: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1d4ac: d9 cf rjmp .-78 ; 0x1d460 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1d4ae: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d4b2: 80 68 ori r24, 0x80 ; 128 1d4b4: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1d4b8: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1d4bc: d1 cf rjmp .-94 ; 0x1d460 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1d4be: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d4c2: 80 62 ori r24, 0x20 ; 32 1d4c4: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1d4c8: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1d4cc: c9 cf rjmp .-110 ; 0x1d460 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1d4ce: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d4d2: 80 68 ori r24, 0x80 ; 128 1d4d4: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1d4d8: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1d4dc: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1d4e0: bf cf rjmp .-130 ; 0x1d460 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1d4e2: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d4e6: 80 62 ori r24, 0x20 ; 32 1d4e8: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1d4ec: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1d4f0: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1d4f4: b5 cf rjmp .-150 ; 0x1d460 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1d4f6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d4fa: 88 60 ori r24, 0x08 ; 8 1d4fc: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1d500: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1d504: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1d508: ab cf rjmp .-170 ; 0x1d460 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1d50a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d50e: 80 68 ori r24, 0x80 ; 128 1d510: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1d514: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d518: 8f 7b andi r24, 0xBF ; 191 1d51a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1d51e: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1d522: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1d526: 9c cf rjmp .-200 ; 0x1d460 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1d528: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d52c: 80 62 ori r24, 0x20 ; 32 1d52e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1d532: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1d536: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1d53a: 92 cf rjmp .-220 ; 0x1d460 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1d53c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d540: 88 60 ori r24, 0x08 ; 8 1d542: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1d546: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1d54a: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1d54e: 88 cf rjmp .-240 ; 0x1d460 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1d550: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d554: 80 68 ori r24, 0x80 ; 128 1d556: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1d55a: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1d55e: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1d562: 7e cf rjmp .-260 ; 0x1d460 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1d564: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d568: 80 62 ori r24, 0x20 ; 32 1d56a: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1d56e: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1d572: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1d576: 74 cf rjmp .-280 ; 0x1d460 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1d578: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d57c: 88 60 ori r24, 0x08 ; 8 1d57e: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1d582: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1d586: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1d58a: 6a cf rjmp .-300 ; 0x1d460 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1d58c: c0 38 cpi r28, 0x80 ; 128 1d58e: d1 05 cpc r29, r1 1d590: 0c f0 brlt .+2 ; 0x1d594 1d592: 3e cf rjmp .-388 ; 0x1d410 1d594: 33 cf rjmp .-410 ; 0x1d3fc 0001d596 : } } /// 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){ 1d596: 4f 92 push r4 1d598: 5f 92 push r5 1d59a: 6f 92 push r6 1d59c: 7f 92 push r7 1d59e: 8f 92 push r8 1d5a0: 9f 92 push r9 1d5a2: af 92 push r10 1d5a4: bf 92 push r11 1d5a6: cf 92 push r12 1d5a8: df 92 push r13 1d5aa: ef 92 push r14 1d5ac: ff 92 push r15 1d5ae: 0f 93 push r16 1d5b0: 1f 93 push r17 1d5b2: cf 93 push r28 1d5b4: 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 1d5b6: 86 b9 out 0x06, r24 ; 6 1d5b8: fa 01 movw r30, r20 1d5ba: e0 80 ld r14, Z 1d5bc: 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){ 1d5be: 16 16 cp r1, r22 1d5c0: 17 06 cpc r1, r23 1d5c2: b4 f4 brge .+44 ; 0x1d5f0 1d5c4: e2 16 cp r14, r18 1d5c6: f3 06 cpc r15, r19 1d5c8: 99 f4 brne .+38 ; 0x1d5f0 delayMicroseconds(delay_us); 1d5ca: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1d5cc: df 91 pop r29 1d5ce: cf 91 pop r28 1d5d0: 1f 91 pop r17 1d5d2: 0f 91 pop r16 1d5d4: ff 90 pop r15 1d5d6: ef 90 pop r14 1d5d8: df 90 pop r13 1d5da: cf 90 pop r12 1d5dc: bf 90 pop r11 1d5de: af 90 pop r10 1d5e0: 9f 90 pop r9 1d5e2: 8f 90 pop r8 1d5e4: 7f 90 pop r7 1d5e6: 6f 90 pop r6 1d5e8: 5f 90 pop r5 1d5ea: 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); 1d5ec: 0c 94 61 e9 jmp 0x1d2c2 ; 0x1d2c2 1d5f0: 89 01 movw r16, r18 1d5f2: 6a 01 movw r12, r20 1d5f4: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1d5f6: b7 01 movw r22, r14 1d5f8: 90 e0 ldi r25, 0x00 ; 0 1d5fa: 80 e0 ldi r24, 0x00 ; 0 1d5fc: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 1d600: 2d eb ldi r18, 0xBD ; 189 1d602: 37 e3 ldi r19, 0x37 ; 55 1d604: 46 e8 ldi r20, 0x86 ; 134 1d606: 55 e3 ldi r21, 0x35 ; 53 1d608: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1d60c: 4b 01 movw r8, r22 1d60e: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1d610: be 01 movw r22, r28 1d612: 0d 2e mov r0, r29 1d614: 00 0c add r0, r0 1d616: 88 0b sbc r24, r24 1d618: 99 0b sbc r25, r25 1d61a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1d61e: a5 01 movw r20, r10 1d620: 94 01 movw r18, r8 1d622: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1d626: 2b 01 movw r4, r22 1d628: 3c 01 movw r6, r24 1d62a: a5 01 movw r20, r10 1d62c: 94 01 movw r18, r8 1d62e: 6a e0 ldi r22, 0x0A ; 10 1d630: 77 ed ldi r23, 0xD7 ; 215 1d632: 83 e2 ldi r24, 0x23 ; 35 1d634: 9c e3 ldi r25, 0x3C ; 60 1d636: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 1d63a: 9b 01 movw r18, r22 1d63c: ac 01 movw r20, r24 1d63e: c3 01 movw r24, r6 1d640: b2 01 movw r22, r4 1d642: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1d646: 4b 01 movw r8, r22 1d648: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1d64a: 2a e0 ldi r18, 0x0A ; 10 1d64c: 37 ed ldi r19, 0xD7 ; 215 1d64e: 43 e2 ldi r20, 0x23 ; 35 1d650: 5e e3 ldi r21, 0x3E ; 62 1d652: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1d656: 18 16 cp r1, r24 1d658: dc f5 brge .+118 ; 0x1d6d0 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)); 1d65a: a5 01 movw r20, r10 1d65c: 94 01 movw r18, r8 1d65e: 6a e0 ldi r22, 0x0A ; 10 1d660: 77 ed ldi r23, 0xD7 ; 215 1d662: 83 e2 ldi r24, 0x23 ; 35 1d664: 9c e3 ldi r25, 0x3C ; 60 1d666: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 1d66a: 20 e0 ldi r18, 0x00 ; 0 1d66c: 34 e2 ldi r19, 0x24 ; 36 1d66e: 44 e7 ldi r20, 0x74 ; 116 1d670: 59 e4 ldi r21, 0x49 ; 73 1d672: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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); 1d676: 20 e0 ldi r18, 0x00 ; 0 1d678: 30 e0 ldi r19, 0x00 ; 0 1d67a: 40 e0 ldi r20, 0x00 ; 0 1d67c: 5f e3 ldi r21, 0x3F ; 63 1d67e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1d682: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 1d686: 5b 01 movw r10, r22 1d688: 60 17 cp r22, r16 1d68a: 71 07 cpc r23, r17 1d68c: 08 f4 brcc .+2 ; 0x1d690 1d68e: 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){ 1d690: ea 14 cp r14, r10 1d692: fb 04 cpc r15, r11 1d694: 31 f4 brne .+12 ; 0x1d6a2 1d696: 20 97 sbiw r28, 0x00 ; 0 1d698: 21 f0 breq .+8 ; 0x1d6a2 if (acc > 0) 1d69a: fc f0 brlt .+62 ; 0x1d6da t1--; 1d69c: f1 e0 ldi r31, 0x01 ; 1 1d69e: af 1a sub r10, r31 1d6a0: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1d6a2: c5 01 movw r24, r10 1d6a4: 0e 94 61 e9 call 0x1d2c2 ; 0x1d2c2 delay_us = t1; 1d6a8: f6 01 movw r30, r12 1d6aa: b1 82 std Z+1, r11 ; 0x01 1d6ac: a0 82 st Z, r10 } 1d6ae: df 91 pop r29 1d6b0: cf 91 pop r28 1d6b2: 1f 91 pop r17 1d6b4: 0f 91 pop r16 1d6b6: ff 90 pop r15 1d6b8: ef 90 pop r14 1d6ba: df 90 pop r13 1d6bc: cf 90 pop r12 1d6be: bf 90 pop r11 1d6c0: af 90 pop r10 1d6c2: 9f 90 pop r9 1d6c4: 8f 90 pop r8 1d6c6: 7f 90 pop r7 1d6c8: 6f 90 pop r6 1d6ca: 5f 90 pop r5 1d6cc: 4f 90 pop r4 1d6ce: 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 1d6d0: 80 e1 ldi r24, 0x10 ; 16 1d6d2: a8 2e mov r10, r24 1d6d4: 87 e2 ldi r24, 0x27 ; 39 1d6d6: b8 2e mov r11, r24 1d6d8: db cf rjmp .-74 ; 0x1d690 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1d6da: 8f ef ldi r24, 0xFF ; 255 1d6dc: a8 1a sub r10, r24 1d6de: b8 0a sbc r11, r24 1d6e0: e0 cf rjmp .-64 ; 0x1d6a2 0001d6e2 : /// 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){ 1d6e2: 2f 92 push r2 1d6e4: 3f 92 push r3 1d6e6: 4f 92 push r4 1d6e8: 5f 92 push r5 1d6ea: 6f 92 push r6 1d6ec: 7f 92 push r7 1d6ee: 8f 92 push r8 1d6f0: 9f 92 push r9 1d6f2: af 92 push r10 1d6f4: bf 92 push r11 1d6f6: cf 92 push r12 1d6f8: df 92 push r13 1d6fa: ef 92 push r14 1d6fc: ff 92 push r15 1d6fe: 0f 93 push r16 1d700: 1f 93 push r17 1d702: cf 93 push r28 1d704: df 93 push r29 1d706: 00 d0 rcall .+0 ; 0x1d708 1d708: cd b7 in r28, 0x3d ; 61 1d70a: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1d70c: f9 01 movw r30, r18 1d70e: e0 80 ld r14, Z 1d710: f1 80 ldd r15, Z+1 ; 0x01 1d712: e1 14 cp r14, r1 1d714: f1 04 cpc r15, r1 1d716: 09 f4 brne .+2 ; 0x1d71a 1d718: 6b c0 rjmp .+214 ; 0x1d7f0 1d71a: 16 16 cp r1, r22 1d71c: 17 06 cpc r1, r23 1d71e: 0c f0 brlt .+2 ; 0x1d722 1d720: 67 c0 rjmp .+206 ; 0x1d7f0 1d722: 19 01 movw r2, r18 1d724: 5b 83 std Y+3, r21 ; 0x03 1d726: 4a 83 std Y+2, r20 ; 0x02 1d728: 6b 01 movw r12, r22 1d72a: 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)); 1d72c: fa 01 movw r30, r20 1d72e: 00 81 ld r16, Z 1d730: 11 81 ldd r17, Z+1 ; 0x01 1d732: b8 01 movw r22, r16 1d734: 90 e0 ldi r25, 0x00 ; 0 1d736: 80 e0 ldi r24, 0x00 ; 0 1d738: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 1d73c: 4b 01 movw r8, r22 1d73e: 5c 01 movw r10, r24 1d740: b6 01 movw r22, r12 1d742: 0d 2c mov r0, r13 1d744: 00 0c add r0, r0 1d746: 88 0b sbc r24, r24 1d748: 99 0b sbc r25, r25 1d74a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1d74e: 2b 01 movw r4, r22 1d750: 3c 01 movw r6, r24 1d752: a5 01 movw r20, r10 1d754: 94 01 movw r18, r8 1d756: c5 01 movw r24, r10 1d758: b4 01 movw r22, r8 1d75a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1d75e: 9b 01 movw r18, r22 1d760: ac 01 movw r20, r24 1d762: c3 01 movw r24, r6 1d764: b2 01 movw r22, r4 1d766: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 1d76a: 9b 01 movw r18, r22 1d76c: ac 01 movw r20, r24 1d76e: 6a e0 ldi r22, 0x0A ; 10 1d770: 77 ed ldi r23, 0xD7 ; 215 1d772: 83 ea ldi r24, 0xA3 ; 163 1d774: 9b e3 ldi r25, 0x3B ; 59 1d776: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__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); 1d77a: 20 e0 ldi r18, 0x00 ; 0 1d77c: 30 e0 ldi r19, 0x00 ; 0 1d77e: 40 e0 ldi r20, 0x00 ; 0 1d780: 5f e3 ldi r21, 0x3F ; 63 1d782: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1d786: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__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){ 1d78a: 6e 15 cp r22, r14 1d78c: 7f 05 cpc r23, r15 1d78e: 28 f5 brcc .+74 ; 0x1d7da 1d790: f9 81 ldd r31, Y+1 ; 0x01 1d792: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1d794: ea 81 ldd r30, Y+2 ; 0x02 1d796: fb 81 ldd r31, Y+3 ; 0x03 1d798: 80 81 ld r24, Z 1d79a: 91 81 ldd r25, Z+1 ; 0x01 1d79c: 0e 94 61 e9 call 0x1d2c2 ; 0x1d2c2 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1d7a0: f1 01 movw r30, r2 1d7a2: 80 81 ld r24, Z 1d7a4: 91 81 ldd r25, Z+1 ; 0x01 1d7a6: 01 97 sbiw r24, 0x01 ; 1 1d7a8: 91 83 std Z+1, r25 ; 0x01 1d7aa: 80 83 st Z, r24 return true; 1d7ac: 81 e0 ldi r24, 0x01 ; 1 } 1d7ae: 0f 90 pop r0 1d7b0: 0f 90 pop r0 1d7b2: 0f 90 pop r0 1d7b4: df 91 pop r29 1d7b6: cf 91 pop r28 1d7b8: 1f 91 pop r17 1d7ba: 0f 91 pop r16 1d7bc: ff 90 pop r15 1d7be: ef 90 pop r14 1d7c0: df 90 pop r13 1d7c2: cf 90 pop r12 1d7c4: bf 90 pop r11 1d7c6: af 90 pop r10 1d7c8: 9f 90 pop r9 1d7ca: 8f 90 pop r8 1d7cc: 7f 90 pop r7 1d7ce: 6f 90 pop r6 1d7d0: 5f 90 pop r5 1d7d2: 4f 90 pop r4 1d7d4: 3f 90 pop r3 1d7d6: 2f 90 pop r2 1d7d8: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1d7da: 66 27 eor r22, r22 1d7dc: 77 27 eor r23, r23 1d7de: 6c 19 sub r22, r12 1d7e0: 7d 09 sbc r23, r13 1d7e2: 98 01 movw r18, r16 1d7e4: 4a 81 ldd r20, Y+2 ; 0x02 1d7e6: 5b 81 ldd r21, Y+3 ; 0x03 1d7e8: 89 81 ldd r24, Y+1 ; 0x01 1d7ea: 0e 94 cb ea call 0x1d596 ; 0x1d596 1d7ee: d8 cf rjmp .-80 ; 0x1d7a0 /// 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; 1d7f0: 80 e0 ldi r24, 0x00 ; 0 1d7f2: dd cf rjmp .-70 ; 0x1d7ae 0001d7f4 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1d7f4: 0f 93 push r16 1d7f6: 1f 93 push r17 1d7f8: cf 93 push r28 1d7fa: df 93 push r29 1d7fc: 18 2f mov r17, r24 1d7fe: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1d800: d1 e0 ldi r29, 0x01 ; 1 1d802: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1d804: 81 2f mov r24, r17 1d806: 8d 23 and r24, r29 1d808: 29 f0 breq .+10 ; 0x1d814 sm4_set_dir(i, dir & mask); 1d80a: 60 2f mov r22, r16 1d80c: 6d 23 and r22, r29 1d80e: 8c 2f mov r24, r28 1d810: 0f 94 57 53 call 0x2a6ae ; 0x2a6ae } } } 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) { 1d814: cf 5f subi r28, 0xFF ; 255 1d816: dd 0f add r29, r29 1d818: c3 30 cpi r28, 0x03 ; 3 1d81a: a1 f7 brne .-24 ; 0x1d804 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1d81c: df 91 pop r29 1d81e: cf 91 pop r28 1d820: 1f 91 pop r17 1d822: 0f 91 pop r16 1d824: 08 95 ret 0001d826 : //@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) { 1d826: 8f 92 push r8 1d828: 9f 92 push r9 1d82a: af 92 push r10 1d82c: bf 92 push r11 1d82e: cf 92 push r12 1d830: df 92 push r13 1d832: ef 92 push r14 1d834: ff 92 push r15 1d836: 30 e0 ldi r19, 0x00 ; 0 1d838: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1d83a: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1d83c: 48 2f mov r20, r24 1d83e: 49 23 and r20, r25 1d840: 19 f1 breq .+70 ; 0x1d888 count_position[i] += dir & mask ? -1L : 1L; 1d842: a9 01 movw r20, r18 1d844: 44 0f add r20, r20 1d846: 55 1f adc r21, r21 1d848: 44 0f add r20, r20 1d84a: 55 1f adc r21, r21 1d84c: fa 01 movw r30, r20 1d84e: ed 54 subi r30, 0x4D ; 77 1d850: f9 4f sbci r31, 0xF9 ; 249 1d852: c0 80 ld r12, Z 1d854: d1 80 ldd r13, Z+1 ; 0x01 1d856: e2 80 ldd r14, Z+2 ; 0x02 1d858: f3 80 ldd r15, Z+3 ; 0x03 1d85a: 76 2f mov r23, r22 1d85c: 79 23 and r23, r25 1d85e: 81 2c mov r8, r1 1d860: 91 2c mov r9, r1 1d862: 54 01 movw r10, r8 1d864: 83 94 inc r8 1d866: 77 23 and r23, r23 1d868: 21 f0 breq .+8 ; 0x1d872 1d86a: 88 24 eor r8, r8 1d86c: 8a 94 dec r8 1d86e: 98 2c mov r9, r8 1d870: 54 01 movw r10, r8 1d872: c8 0c add r12, r8 1d874: d9 1c adc r13, r9 1d876: ea 1c adc r14, r10 1d878: fb 1c adc r15, r11 1d87a: 4d 54 subi r20, 0x4D ; 77 1d87c: 59 4f sbci r21, 0xF9 ; 249 1d87e: fa 01 movw r30, r20 1d880: c0 82 st Z, r12 1d882: d1 82 std Z+1, r13 ; 0x01 1d884: e2 82 std Z+2, r14 ; 0x02 1d886: 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) { 1d888: 99 0f add r25, r25 1d88a: 2f 5f subi r18, 0xFF ; 255 1d88c: 3f 4f sbci r19, 0xFF ; 255 1d88e: 23 30 cpi r18, 0x03 ; 3 1d890: 31 05 cpc r19, r1 1d892: a1 f6 brne .-88 ; 0x1d83c if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1d894: ff 90 pop r15 1d896: ef 90 pop r14 1d898: df 90 pop r13 1d89a: cf 90 pop r12 1d89c: bf 90 pop r11 1d89e: af 90 pop r10 1d8a0: 9f 90 pop r9 1d8a2: 8f 90 pop r8 1d8a4: 08 95 ret 0001d8a6 : /// 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) { 1d8a6: 2f 92 push r2 1d8a8: 3f 92 push r3 1d8aa: 4f 92 push r4 1d8ac: 5f 92 push r5 1d8ae: 6f 92 push r6 1d8b0: 7f 92 push r7 1d8b2: 8f 92 push r8 1d8b4: 9f 92 push r9 1d8b6: af 92 push r10 1d8b8: bf 92 push r11 1d8ba: cf 92 push r12 1d8bc: df 92 push r13 1d8be: ef 92 push r14 1d8c0: ff 92 push r15 1d8c2: 0f 93 push r16 1d8c4: 1f 93 push r17 1d8c6: cf 93 push r28 1d8c8: df 93 push r29 1d8ca: 00 d0 rcall .+0 ; 0x1d8cc 1d8cc: 00 d0 rcall .+0 ; 0x1d8ce 1d8ce: cd b7 in r28, 0x3d ; 61 1d8d0: 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]; 1d8d2: c0 90 b3 06 lds r12, 0x06B3 ; 0x8006b3 1d8d6: d0 90 b4 06 lds r13, 0x06B4 ; 0x8006b4 1d8da: e0 90 b5 06 lds r14, 0x06B5 ; 0x8006b5 1d8de: f0 90 b6 06 lds r15, 0x06B6 ; 0x8006b6 1d8e2: 7c 01 movw r14, r24 1d8e4: ec 18 sub r14, r12 1d8e6: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1d8e8: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 1d8ec: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 1d8f0: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 1d8f4: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 1d8f8: 68 1b sub r22, r24 1d8fa: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1d8fc: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 1d900: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 1d904: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 1d908: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 1d90c: fa 01 movw r30, r20 1d90e: e8 1b sub r30, r24 1d910: f9 0b sbc r31, r25 1d912: fa 83 std Y+2, r31 ; 0x02 1d914: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1d916: fb 01 movw r30, r22 1d918: ff 0f add r31, r31 1d91a: ee 0b sbc r30, r30 1d91c: ff 0f add r31, r31 1d91e: fe 2f mov r31, r30 1d920: ee 1f adc r30, r30 1d922: e2 70 andi r30, 0x02 ; 2 1d924: 89 81 ldd r24, Y+1 ; 0x01 1d926: 9a 81 ldd r25, Y+2 ; 0x02 1d928: 88 e0 ldi r24, 0x08 ; 8 1d92a: 98 02 muls r25, r24 1d92c: 81 2d mov r24, r1 1d92e: 99 0b sbc r25, r25 1d930: 11 24 eor r1, r1 1d932: 84 70 andi r24, 0x04 ; 4 1d934: e8 2b or r30, r24 1d936: 8f 2d mov r24, r15 1d938: 88 1f adc r24, r24 1d93a: 88 27 eor r24, r24 1d93c: 88 1f adc r24, r24 1d93e: e8 2b or r30, r24 1d940: e0 93 ff 03 sts 0x03FF, r30 ; 0x8003ff asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1d944: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1d948: 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; 1d94a: 8a e0 ldi r24, 0x0A ; 10 1d94c: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1d94e: e0 fd sbrc r30, 0 1d950: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1d952: e1 fd sbrc r30, 1 1d954: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1d956: e2 fd sbrc r30, 2 1d958: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1d95a: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1d95c: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1d960: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1d962: 8c ef ldi r24, 0xFC ; 252 1d964: 9d ec ldi r25, 0xCD ; 205 1d966: 01 11 cpse r16, r1 1d968: 02 c0 rjmp .+4 ; 0x1d96e 1d96a: 90 e0 ldi r25, 0x00 ; 0 1d96c: 80 e0 ldi r24, 0x00 ; 0 1d96e: 90 93 89 06 sts 0x0689, r25 ; 0x800689 1d972: 80 93 88 06 sts 0x0688, r24 ; 0x800688 xyzcal_sm4_delay = delay_us; 1d976: 30 93 fe 03 sts 0x03FE, r19 ; 0x8003fe 1d97a: 20 93 fd 03 sts 0x03FD, r18 ; 0x8003fd // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1d97e: 29 81 ldd r18, Y+1 ; 0x01 1d980: 3a 81 ldd r19, Y+2 ; 0x02 1d982: 3e 83 std Y+6, r19 ; 0x06 1d984: 2d 83 std Y+5, r18 ; 0x05 1d986: 37 ff sbrs r19, 7 1d988: 05 c0 rjmp .+10 ; 0x1d994 1d98a: 31 95 neg r19 1d98c: 21 95 neg r18 1d98e: 31 09 sbc r19, r1 1d990: 3e 83 std Y+6, r19 ; 0x06 1d992: 2d 83 std Y+5, r18 ; 0x05 1d994: 8b 01 movw r16, r22 1d996: 77 ff sbrs r23, 7 1d998: 03 c0 rjmp .+6 ; 0x1d9a0 1d99a: 11 95 neg r17 1d99c: 01 95 neg r16 1d99e: 11 09 sbc r17, r1 1d9a0: f7 fe sbrs r15, 7 1d9a2: 03 c0 rjmp .+6 ; 0x1d9aa 1d9a4: f1 94 neg r15 1d9a6: e1 94 neg r14 1d9a8: 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); 1d9aa: 98 01 movw r18, r16 1d9ac: d8 01 movw r26, r16 1d9ae: 0f 94 6c dd call 0x3bad8 ; 0x3bad8 <__mulhisi3> 1d9b2: 4b 01 movw r8, r22 1d9b4: 5c 01 movw r10, r24 1d9b6: 2d 81 ldd r18, Y+5 ; 0x05 1d9b8: 3e 81 ldd r19, Y+6 ; 0x06 1d9ba: d9 01 movw r26, r18 1d9bc: 0f 94 6c dd call 0x3bad8 ; 0x3bad8 <__mulhisi3> 1d9c0: 86 0e add r8, r22 1d9c2: 97 1e adc r9, r23 1d9c4: a8 1e adc r10, r24 1d9c6: b9 1e adc r11, r25 1d9c8: 97 01 movw r18, r14 1d9ca: d7 01 movw r26, r14 1d9cc: 0f 94 6c dd call 0x3bad8 ; 0x3bad8 <__mulhisi3> 1d9d0: 68 0d add r22, r8 1d9d2: 79 1d adc r23, r9 1d9d4: 8a 1d adc r24, r10 1d9d6: 9b 1d adc r25, r11 1d9d8: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 1d9dc: 0f 94 4a e1 call 0x3c294 ; 0x3c294 1d9e0: 20 e0 ldi r18, 0x00 ; 0 1d9e2: 30 e0 ldi r19, 0x00 ; 0 1d9e4: 40 e0 ldi r20, 0x00 ; 0 1d9e6: 5f e3 ldi r21, 0x3F ; 63 1d9e8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1d9ec: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 1d9f0: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1d9f2: 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; 1d9f4: 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; 1d9f6: 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; 1d9f8: 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; 1d9fa: 1c 82 std Y+4, r1 ; 0x04 1d9fc: 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; 1d9fe: 31 2c mov r3, r1 1da00: 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; 1da02: 1a 82 std Y+2, r1 ; 0x02 1da04: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1da06: 61 14 cp r6, r1 1da08: 71 04 cpc r7, r1 1da0a: 09 f4 brne .+2 ; 0x1da0e 1da0c: 47 c0 rjmp .+142 ; 0x1da9c if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1da0e: e0 91 88 06 lds r30, 0x0688 ; 0x800688 1da12: f0 91 89 06 lds r31, 0x0689 ; 0x800689 1da16: 30 97 sbiw r30, 0x00 ; 0 1da18: e9 f5 brne .+122 ; 0x1da94 uint8_t sm = 0; //step mask 1da1a: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1da1c: ec 14 cp r14, r12 1da1e: fd 04 cpc r15, r13 1da20: 40 f0 brcs .+16 ; 0x1da32 sm |= 1; cx += dd; 1da22: c4 0c add r12, r4 1da24: d5 1c adc r13, r5 x++; 1da26: 89 81 ldd r24, Y+1 ; 0x01 1da28: 9a 81 ldd r25, Y+2 ; 0x02 1da2a: 01 96 adiw r24, 0x01 ; 1 1da2c: 9a 83 std Y+2, r25 ; 0x02 1da2e: 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; 1da30: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1da32: 0a 15 cp r16, r10 1da34: 1b 05 cpc r17, r11 1da36: 30 f0 brcs .+12 ; 0x1da44 sm |= 2; 1da38: 82 60 ori r24, 0x02 ; 2 cy += dd; 1da3a: a4 0c add r10, r4 1da3c: b5 1c adc r11, r5 y++; 1da3e: 9f ef ldi r25, 0xFF ; 255 1da40: 29 1a sub r2, r25 1da42: 39 0a sbc r3, r25 } if (cz <= dz){ 1da44: ed 81 ldd r30, Y+5 ; 0x05 1da46: fe 81 ldd r31, Y+6 ; 0x06 1da48: e8 15 cp r30, r8 1da4a: f9 05 cpc r31, r9 1da4c: 48 f0 brcs .+18 ; 0x1da60 sm |= 4; 1da4e: 84 60 ori r24, 0x04 ; 4 cz += dd; 1da50: 84 0c add r8, r4 1da52: 95 1c adc r9, r5 z++; 1da54: 2b 81 ldd r18, Y+3 ; 0x03 1da56: 3c 81 ldd r19, Y+4 ; 0x04 1da58: 2f 5f subi r18, 0xFF ; 255 1da5a: 3f 4f sbci r19, 0xFF ; 255 1da5c: 3c 83 std Y+4, r19 ; 0x04 1da5e: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1da60: ce 18 sub r12, r14 1da62: df 08 sbc r13, r15 cy -= dy; 1da64: a0 1a sub r10, r16 1da66: b1 0a sbc r11, r17 cz -= dz; 1da68: ed 81 ldd r30, Y+5 ; 0x05 1da6a: fe 81 ldd r31, Y+6 ; 0x06 1da6c: 8e 1a sub r8, r30 1da6e: 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 1da70: 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); 1da72: e0 91 84 06 lds r30, 0x0684 ; 0x800684 1da76: f0 91 85 06 lds r31, 0x0685 ; 0x800685 1da7a: 30 97 sbiw r30, 0x00 ; 0 1da7c: d1 f1 breq .+116 ; 0x1daf2 1da7e: b2 01 movw r22, r4 1da80: c3 01 movw r24, r6 1da82: 19 95 eicall if (delay) delayMicroseconds(delay); 1da84: 00 97 sbiw r24, 0x00 ; 0 1da86: 11 f0 breq .+4 ; 0x1da8c 1da88: 0e 94 61 e9 call 0x1d2c2 ; 0x1d2c2 nd--; 1da8c: f1 e0 ldi r31, 0x01 ; 1 1da8e: 6f 1a sub r6, r31 1da90: 71 08 sbc r7, r1 1da92: b9 cf rjmp .-142 ; 0x1da06 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; 1da94: 19 95 eicall 1da96: 88 23 and r24, r24 1da98: 09 f4 brne .+2 ; 0x1da9c 1da9a: bf cf rjmp .-130 ; 0x1da1a 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) 1da9c: e0 91 86 06 lds r30, 0x0686 ; 0x800686 1daa0: f0 91 87 06 lds r31, 0x0687 ; 0x800687 1daa4: 30 97 sbiw r30, 0x00 ; 0 1daa6: 41 f0 breq .+16 ; 0x1dab8 (*sm4_update_pos_cb)(x, y, z, 0); 1daa8: 30 e0 ldi r19, 0x00 ; 0 1daaa: 20 e0 ldi r18, 0x00 ; 0 1daac: 4b 81 ldd r20, Y+3 ; 0x03 1daae: 5c 81 ldd r21, Y+4 ; 0x04 1dab0: b1 01 movw r22, r2 1dab2: 89 81 ldd r24, Y+1 ; 0x01 1dab4: 9a 81 ldd r25, Y+2 ; 0x02 1dab6: 19 95 eicall 1dab8: 81 e0 ldi r24, 0x01 ; 1 1daba: 67 28 or r6, r7 1dabc: 09 f4 brne .+2 ; 0x1dac0 1dabe: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1dac0: 26 96 adiw r28, 0x06 ; 6 1dac2: 0f b6 in r0, 0x3f ; 63 1dac4: f8 94 cli 1dac6: de bf out 0x3e, r29 ; 62 1dac8: 0f be out 0x3f, r0 ; 63 1daca: cd bf out 0x3d, r28 ; 61 1dacc: df 91 pop r29 1dace: cf 91 pop r28 1dad0: 1f 91 pop r17 1dad2: 0f 91 pop r16 1dad4: ff 90 pop r15 1dad6: ef 90 pop r14 1dad8: df 90 pop r13 1dada: cf 90 pop r12 1dadc: bf 90 pop r11 1dade: af 90 pop r10 1dae0: 9f 90 pop r9 1dae2: 8f 90 pop r8 1dae4: 7f 90 pop r7 1dae6: 6f 90 pop r6 1dae8: 5f 90 pop r5 1daea: 4f 90 pop r4 1daec: 3f 90 pop r3 1daee: 2f 90 pop r2 1daf0: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1daf2: 84 ef ldi r24, 0xF4 ; 244 1daf4: 91 e0 ldi r25, 0x01 ; 1 1daf6: c8 cf rjmp .-112 ; 0x1da88 0001daf8 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1daf8: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1dafa: 0d b4 in r0, 0x2d ; 45 1dafc: 07 fe sbrs r0, 7 1dafe: fd cf rjmp .-6 ; 0x1dafa return SPDR; 1db00: 8e b5 in r24, 0x2e ; 46 } 1db02: 08 95 ret 0001db04 : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1db04: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1db06: 85 e0 ldi r24, 0x05 ; 5 1db08: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 uint8_t val = _SPI_RX(); // receive value 1db0c: 8f ef ldi r24, 0xFF ; 255 1db0e: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 _CS_HIGH(); 1db12: 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) ; 1db14: 80 fd sbrc r24, 0 1db16: f6 cf rjmp .-20 ; 0x1db04 } 1db18: 08 95 ret 0001db1a : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1db1a: 1f 93 push r17 1db1c: cf 93 push r28 1db1e: df 93 push r29 1db20: ea 01 movw r28, r20 1db22: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1db24: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1db28: 81 2f mov r24, r17 1db2a: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1db2e: 8d 2f mov r24, r29 1db30: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1db34: 8c 2f mov r24, r28 } 1db36: df 91 pop r29 1db38: cf 91 pop r28 1db3a: 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 1db3c: 0c 94 7c ed jmp 0x1daf8 ; 0x1daf8 0001db40 : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1db40: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1db42: 0e 94 8d ed call 0x1db1a ; 0x1db1a _CS_HIGH(); 1db46: 45 9a sbi 0x08, 5 ; 8 } 1db48: 08 95 ret 0001db4a : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1db4a: ef 92 push r14 1db4c: ff 92 push r15 1db4e: 0f 93 push r16 1db50: 1f 93 push r17 1db52: cf 93 push r28 1db54: df 93 push r29 1db56: 7a 01 movw r14, r20 1db58: 89 01 movw r16, r18 _CS_LOW(); 1db5a: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1db5c: ab 01 movw r20, r22 1db5e: bc 01 movw r22, r24 1db60: 82 e0 ldi r24, 0x02 ; 2 1db62: 0e 94 8d ed call 0x1db1a ; 0x1db1a 1db66: e7 01 movw r28, r14 1db68: 0e 0d add r16, r14 1db6a: 1f 1d adc r17, r15 while (cnt--) // send data 1db6c: c0 17 cp r28, r16 1db6e: d1 07 cpc r29, r17 1db70: 41 f4 brne .+16 ; 0x1db82 _SPI_TX(*(data++)); _CS_HIGH(); 1db72: 45 9a sbi 0x08, 5 ; 8 } 1db74: df 91 pop r29 1db76: cf 91 pop r28 1db78: 1f 91 pop r17 1db7a: 0f 91 pop r16 1db7c: ff 90 pop r15 1db7e: ef 90 pop r14 1db80: 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++)); 1db82: 89 91 ld r24, Y+ 1db84: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 1db88: f1 cf rjmp .-30 ; 0x1db6c 0001db8a : _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) { 1db8a: ef 92 push r14 1db8c: ff 92 push r15 1db8e: 0f 93 push r16 1db90: 1f 93 push r17 1db92: cf 93 push r28 1db94: df 93 push r29 1db96: 7a 01 movw r14, r20 1db98: 89 01 movw r16, r18 _CS_LOW(); 1db9a: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1db9c: ab 01 movw r20, r22 1db9e: bc 01 movw r22, r24 1dba0: 83 e0 ldi r24, 0x03 ; 3 1dba2: 0e 94 8d ed call 0x1db1a ; 0x1db1a 1dba6: e7 01 movw r28, r14 1dba8: 0e 0d add r16, r14 1dbaa: 1f 1d adc r17, r15 while (cnt--) // receive data 1dbac: c0 17 cp r28, r16 1dbae: d1 07 cpc r29, r17 1dbb0: 41 f4 brne .+16 ; 0x1dbc2 *(data++) = _SPI_RX(); _CS_HIGH(); 1dbb2: 45 9a sbi 0x08, 5 ; 8 } 1dbb4: df 91 pop r29 1dbb6: cf 91 pop r28 1dbb8: 1f 91 pop r17 1dbba: 0f 91 pop r16 1dbbc: ff 90 pop r15 1dbbe: ef 90 pop r14 1dbc0: 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(); 1dbc2: 8f ef ldi r24, 0xFF ; 255 1dbc4: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 1dbc8: 89 93 st Y+, r24 1dbca: f0 cf rjmp .-32 ; 0x1dbac 0001dbcc : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1dbcc: 0f 93 push r16 1dbce: 1f 93 push r17 1dbd0: cf 93 push r28 1dbd2: df 93 push r29 1dbd4: 00 d0 rcall .+0 ; 0x1dbd6 1dbd6: 1f 92 push r1 1dbd8: cd b7 in r28, 0x3d ; 61 1dbda: de b7 in r29, 0x3e ; 62 1dbdc: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1dbde: 8c e5 ldi r24, 0x5C ; 92 1dbe0: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1dbe2: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1dbe4: 24 e0 ldi r18, 0x04 ; 4 1dbe6: 30 e0 ldi r19, 0x00 ; 0 1dbe8: ae 01 movw r20, r28 1dbea: 4f 5f subi r20, 0xFF ; 255 1dbec: 5f 4f sbci r21, 0xFF ; 255 1dbee: 60 e0 ldi r22, 0x00 ; 0 1dbf0: 70 ed ldi r23, 0xD0 ; 208 1dbf2: 83 e0 ldi r24, 0x03 ; 3 1dbf4: 90 e0 ldi r25, 0x00 ; 0 1dbf6: 0e 94 c5 ed call 0x1db8a ; 0x1db8a (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1dbfa: 89 81 ldd r24, Y+1 ; 0x01 1dbfc: 9a 81 ldd r25, Y+2 ; 0x02 1dbfe: ab 81 ldd r26, Y+3 ; 0x03 1dc00: bc 81 ldd r27, Y+4 ; 0x04 1dc02: 87 34 cpi r24, 0x47 ; 71 1dc04: 95 45 sbci r25, 0x55 ; 85 1dc06: a2 45 sbci r26, 0x52 ; 82 1dc08: b5 45 sbci r27, 0x55 ; 85 1dc0a: 71 f4 brne .+28 ; 0x1dc28 return false; if (reason) 1dc0c: 01 15 cp r16, r1 1dc0e: 11 05 cpc r17, r1 1dc10: 49 f0 breq .+18 ; 0x1dc24 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1dc12: 21 e0 ldi r18, 0x01 ; 1 1dc14: 30 e0 ldi r19, 0x00 ; 0 1dc16: a8 01 movw r20, r16 1dc18: 65 e0 ldi r22, 0x05 ; 5 1dc1a: 70 ed ldi r23, 0xD0 ; 208 1dc1c: 83 e0 ldi r24, 0x03 ; 3 1dc1e: 90 e0 ldi r25, 0x00 ; 0 1dc20: 0e 94 c5 ed call 0x1db8a ; 0x1db8a (uint8_t*)reason, sizeof(*reason)); } return true; 1dc24: 81 e0 ldi r24, 0x01 ; 1 1dc26: 01 c0 rjmp .+2 ; 0x1dc2a XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1dc28: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1dc2a: 0f 90 pop r0 1dc2c: 0f 90 pop r0 1dc2e: 0f 90 pop r0 1dc30: 0f 90 pop r0 1dc32: df 91 pop r29 1dc34: cf 91 pop r28 1dc36: 1f 91 pop r17 1dc38: 0f 91 pop r16 1dc3a: 08 95 ret 0001dc3c : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1dc3c: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1dc3e: 86 e0 ldi r24, 0x06 ; 6 1dc40: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 _CS_HIGH(); 1dc44: 45 9a sbi 0x08, 5 ; 8 } 1dc46: 08 95 ret 0001dc48 : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1dc48: 4f 92 push r4 1dc4a: 5f 92 push r5 1dc4c: 6f 92 push r6 1dc4e: 7f 92 push r7 1dc50: 8f 92 push r8 1dc52: 9f 92 push r9 1dc54: af 92 push r10 1dc56: bf 92 push r11 1dc58: ef 92 push r14 1dc5a: ff 92 push r15 1dc5c: 0f 93 push r16 1dc5e: 1f 93 push r17 1dc60: cf 93 push r28 1dc62: df 93 push r29 1dc64: 7c 01 movw r14, r24 1dc66: 4a 01 movw r8, r20 1dc68: 5b 01 movw r10, r22 1dc6a: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1dc6c: 8c e5 ldi r24, 0x5C ; 92 1dc6e: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1dc70: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1dc72: 41 2c mov r4, r1 1dc74: 80 ed ldi r24, 0xD0 ; 208 1dc76: 58 2e mov r5, r24 1dc78: 83 e0 ldi r24, 0x03 ; 3 1dc7a: 68 2e mov r6, r24 1dc7c: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1dc7e: 0e 94 1e ee call 0x1dc3c ; 0x1dc3c _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1dc82: b3 01 movw r22, r6 1dc84: a2 01 movw r20, r4 1dc86: 80 e2 ldi r24, 0x20 ; 32 1dc88: 0e 94 a0 ed call 0x1db40 ; 0x1db40 xflash_sector_erase(addr); xflash_wait_busy(); 1dc8c: 0e 94 82 ed call 0x1db04 ; 0x1db04 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1dc90: 80 e1 ldi r24, 0x10 ; 16 1dc92: 58 0e add r5, r24 1dc94: 61 1c adc r6, r1 1dc96: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1dc98: 41 14 cp r4, r1 1dc9a: 51 04 cpc r5, r1 1dc9c: e4 e0 ldi r30, 0x04 ; 4 1dc9e: 6e 06 cpc r6, r30 1dca0: 71 04 cpc r7, r1 1dca2: 69 f7 brne .-38 ; 0x1dc7e // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1dca4: 8d b7 in r24, 0x3d ; 61 1dca6: 9e b7 in r25, 0x3e ; 62 1dca8: f7 01 movw r30, r14 1dcaa: 93 87 std Z+11, r25 ; 0x0b 1dcac: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1dcae: 00 d0 rcall .+0 ; 0x1dcb0 1dcb0: 8f 91 pop r24 1dcb2: 9f 91 pop r25 1dcb4: af 91 pop r26 hdr.pc = GETPC(); 1dcb6: b0 e0 ldi r27, 0x00 ; 0 1dcb8: 86 83 std Z+6, r24 ; 0x06 1dcba: 97 83 std Z+7, r25 ; 0x07 1dcbc: a0 87 std Z+8, r26 ; 0x08 1dcbe: 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(); 1dcc0: 0e 94 1e ee call 0x1dc3c ; 0x1dc3c xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1dcc4: 2c e0 ldi r18, 0x0C ; 12 1dcc6: 30 e0 ldi r19, 0x00 ; 0 1dcc8: a7 01 movw r20, r14 1dcca: 60 e0 ldi r22, 0x00 ; 0 1dccc: 70 ed ldi r23, 0xD0 ; 208 1dcce: 83 e0 ldi r24, 0x03 ; 3 1dcd0: 90 e0 ldi r25, 0x00 ; 0 1dcd2: 0e 94 a5 ed call 0x1db4a ; 0x1db4a xflash_wait_busy(); 1dcd6: 0e 94 82 ed call 0x1db04 ; 0x1db04 void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1dcda: 0e 94 1e ee call 0x1dc3c ; 0x1dc3c _CS_LOW(); 1dcde: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1dce0: b5 01 movw r22, r10 1dce2: a4 01 movw r20, r8 1dce4: 82 e0 ldi r24, 0x02 ; 2 1dce6: 0e 94 8d ed call 0x1db1a ; 0x1db1a 1dcea: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1dcec: 21 96 adiw r28, 0x01 ; 1 1dcee: 80 81 ld r24, Z 1dcf0: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 if(!--cnt || !(++addr & 0xFF)) 1dcf4: 01 50 subi r16, 0x01 ; 1 1dcf6: 11 09 sbc r17, r1 1dcf8: 41 f0 breq .+16 ; 0x1dd0a 1dcfa: ff ef ldi r31, 0xFF ; 255 1dcfc: 8f 1a sub r8, r31 1dcfe: 9f 0a sbc r9, r31 1dd00: af 0a sbc r10, r31 1dd02: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1dd04: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1dd06: 81 10 cpse r8, r1 1dd08: f1 cf rjmp .-30 ; 0x1dcec { // on a page boundary or end of write _CS_HIGH(); 1dd0a: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1dd0c: 0e 94 82 ed call 0x1db04 ; 0x1db04 _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1dd10: 01 15 cp r16, r1 1dd12: 11 05 cpc r17, r1 1dd14: 11 f7 brne .-60 ; 0x1dcda // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1dd16: df 91 pop r29 1dd18: cf 91 pop r28 1dd1a: 1f 91 pop r17 1dd1c: 0f 91 pop r16 1dd1e: ff 90 pop r15 1dd20: ef 90 pop r14 1dd22: bf 90 pop r11 1dd24: af 90 pop r10 1dd26: 9f 90 pop r9 1dd28: 8f 90 pop r8 1dd2a: 7f 90 pop r7 1dd2c: 6f 90 pop r6 1dd2e: 5f 90 pop r5 1dd30: 4f 90 pop r4 1dd32: 08 95 ret 0001dd34 : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1dd34: cf 93 push r28 1dd36: df 93 push r29 1dd38: cd b7 in r28, 0x3d ; 61 1dd3a: de b7 in r29, 0x3e ; 62 1dd3c: 2c 97 sbiw r28, 0x0c ; 12 1dd3e: 0f b6 in r0, 0x3f ; 63 1dd40: f8 94 cli 1dd42: de bf out 0x3e, r29 ; 62 1dd44: 0f be out 0x3f, r0 ; 63 1dd46: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1dd48: 47 e4 ldi r20, 0x47 ; 71 1dd4a: 55 e5 ldi r21, 0x55 ; 85 1dd4c: 62 e5 ldi r22, 0x52 ; 82 1dd4e: 75 e5 ldi r23, 0x55 ; 85 1dd50: 49 83 std Y+1, r20 ; 0x01 1dd52: 5a 83 std Y+2, r21 ; 0x02 1dd54: 6b 83 std Y+3, r22 ; 0x03 1dd56: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1dd58: 91 e0 ldi r25, 0x01 ; 1 1dd5a: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1dd5c: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1dd5e: f8 94 cli 1dd60: 88 e1 ldi r24, 0x18 ; 24 1dd62: 9d e0 ldi r25, 0x0D ; 13 1dd64: 0f b6 in r0, 0x3f ; 63 1dd66: f8 94 cli 1dd68: a8 95 wdr 1dd6a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1dd6e: 0f be out 0x3f, r0 ; 63 1dd70: 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); 1dd74: 00 e0 ldi r16, 0x00 ; 0 1dd76: 12 e2 ldi r17, 0x22 ; 34 1dd78: 30 e0 ldi r19, 0x00 ; 0 1dd7a: 20 e0 ldi r18, 0x00 ; 0 1dd7c: 40 e0 ldi r20, 0x00 ; 0 1dd7e: 51 ed ldi r21, 0xD1 ; 209 1dd80: 63 e0 ldi r22, 0x03 ; 3 1dd82: 70 e0 ldi r23, 0x00 ; 0 1dd84: ce 01 movw r24, r28 1dd86: 01 96 adiw r24, 0x01 ; 1 1dd88: 0e 94 24 ee call 0x1dc48 ; 0x1dc48 // force a reset even sooner softReset(); 1dd8c: 0e 94 cc 66 call 0xcd98 ; 0xcd98 0001dd90 : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1dd90: 0f 93 push r16 1dd92: 1f 93 push r17 1dd94: cf 93 push r28 1dd96: df 93 push r29 1dd98: cd b7 in r28, 0x3d ; 61 1dd9a: de b7 in r29, 0x3e ; 62 1dd9c: 2c 97 sbiw r28, 0x0c ; 12 1dd9e: 0f b6 in r0, 0x3f ; 63 1dda0: f8 94 cli 1dda2: de bf out 0x3e, r29 ; 62 1dda4: 0f be out 0x3f, r0 ; 63 1dda6: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1dda8: 87 e4 ldi r24, 0x47 ; 71 1ddaa: 95 e5 ldi r25, 0x55 ; 85 1ddac: a2 e5 ldi r26, 0x52 ; 82 1ddae: b5 e5 ldi r27, 0x55 ; 85 1ddb0: 89 83 std Y+1, r24 ; 0x01 1ddb2: 9a 83 std Y+2, r25 ; 0x02 1ddb4: ab 83 std Y+3, r26 ; 0x03 1ddb6: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1ddb8: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1ddba: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1ddbc: 00 e0 ldi r16, 0x00 ; 0 1ddbe: 10 e2 ldi r17, 0x20 ; 32 1ddc0: 20 e0 ldi r18, 0x00 ; 0 1ddc2: 32 e0 ldi r19, 0x02 ; 2 1ddc4: 40 e0 ldi r20, 0x00 ; 0 1ddc6: 53 ed ldi r21, 0xD3 ; 211 1ddc8: 63 e0 ldi r22, 0x03 ; 3 1ddca: 70 e0 ldi r23, 0x00 ; 0 1ddcc: ce 01 movw r24, r28 1ddce: 01 96 adiw r24, 0x01 ; 1 1ddd0: 0e 94 24 ee call 0x1dc48 ; 0x1dc48 (uint8_t*)RAMSTART, RAMSIZE); } 1ddd4: 2c 96 adiw r28, 0x0c ; 12 1ddd6: 0f b6 in r0, 0x3f ; 63 1ddd8: f8 94 cli 1ddda: de bf out 0x3e, r29 ; 62 1dddc: 0f be out 0x3f, r0 ; 63 1ddde: cd bf out 0x3d, r28 ; 61 1dde0: df 91 pop r29 1dde2: cf 91 pop r28 1dde4: 1f 91 pop r17 1dde6: 0f 91 pop r16 1dde8: 08 95 ret 0001ddea : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1ddea: cf 93 push r28 _CS_HIGH(); 1ddec: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1ddee: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1ddf0: 8c e5 ldi r24, 0x5C ; 92 1ddf2: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1ddf4: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1ddf6: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1ddf8: 80 e9 ldi r24, 0x90 ; 144 1ddfa: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1ddfe: 80 e0 ldi r24, 0x00 ; 0 1de00: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 1de04: 80 e0 ldi r24, 0x00 ; 0 1de06: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 1de0a: 80 e0 ldi r24, 0x00 ; 0 1de0c: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1de10: 8f ef ldi r24, 0xFF ; 255 1de12: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 1de16: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1de18: 8f ef ldi r24, 0xFF ; 255 1de1a: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 1de1e: 98 2f mov r25, r24 _CS_HIGH(); 1de20: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1de22: cf 3e cpi r28, 0xEF ; 239 1de24: 11 f0 breq .+4 ; 0x1de2a 1de26: c8 3c cpi r28, 0xC8 ; 200 1de28: 19 f4 brne .+6 ; 0x1de30 1de2a: 81 e0 ldi r24, 0x01 ; 1 1de2c: 91 31 cpi r25, 0x11 ; 17 1de2e: 09 f0 breq .+2 ; 0x1de32 int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1de30: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1de32: cf 91 pop r28 1de34: 08 95 ret 0001de36 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1de36: cf 93 push r28 1de38: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1de3a: 86 ea ldi r24, 0xA6 ; 166 1de3c: 9c e0 ldi r25, 0x0C ; 12 1de3e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 status &= ~components; 1de42: c0 95 com r28 1de44: 6c 2f mov r22, r28 1de46: 68 23 and r22, r24 1de48: 86 ea ldi r24, 0xA6 ; 166 1de4a: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1de4c: cf 91 pop r28 1de4e: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001de52 : } } } static void lcd_reset_sheet() { 1de52: 1f 93 push r17 1de54: cf 93 push r28 1de56: df 93 push r29 1de58: 00 d0 rcall .+0 ; 0x1de5a 1de5a: 00 d0 rcall .+0 ; 0x1de5c 1de5c: 1f 92 push r1 1de5e: 1f 92 push r1 1de60: cd b7 in r28, 0x3d ; 61 1de62: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1de64: be 01 movw r22, r28 1de66: 6f 5f subi r22, 0xFF ; 255 1de68: 7f 4f sbci r23, 0xFF ; 255 1de6a: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1de6e: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1de72: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1de76: 1b e0 ldi r17, 0x0B ; 11 1de78: 81 9f mul r24, r17 1de7a: c0 01 movw r24, r0 1de7c: 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); 1de7e: 6f ef ldi r22, 0xFF ; 255 1de80: 7f ef ldi r23, 0xFF ; 255 1de82: 80 5b subi r24, 0xB0 ; 176 1de84: 92 4f sbci r25, 0xF2 ; 242 1de86: 0f 94 96 dc call 0x3b92c ; 0x3b92c eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1de8a: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1de8e: 61 9f mul r22, r17 1de90: b0 01 movw r22, r0 1de92: 11 24 eor r1, r1 1de94: 67 5b subi r22, 0xB7 ; 183 1de96: 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); 1de98: 47 e0 ldi r20, 0x07 ; 7 1de9a: 50 e0 ldi r21, 0x00 ; 0 1de9c: ce 01 movw r24, r28 1de9e: 01 96 adiw r24, 0x01 ; 1 1dea0: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1dea4: 81 ea ldi r24, 0xA1 ; 161 1dea6: 9d e0 ldi r25, 0x0D ; 13 1dea8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1deac: 90 91 e2 03 lds r25, 0x03E2 ; 0x8003e2 1deb0: 89 13 cpse r24, r25 1deb2: 0a c0 rjmp .+20 ; 0x1dec8 { eeprom_switch_to_next_sheet(); 1deb4: 0e 94 e3 75 call 0xebc6 ; 0xebc6 if (-1 == eeprom_next_initialized_sheet(0)) 1deb8: 80 e0 ldi r24, 0x00 ; 0 1deba: 0e 94 cf 75 call 0xeb9e ; 0xeb9e 1debe: 8f 3f cpi r24, 0xFF ; 255 1dec0: 19 f4 brne .+6 ; 0x1dec8 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1dec2: 80 e1 ldi r24, 0x10 ; 16 1dec4: 0e 94 1b ef call 0x1de36 ; 0x1de36 } menu_back(); 1dec8: 0f 94 96 d4 call 0x3a92c ; 0x3a92c } 1decc: 28 96 adiw r28, 0x08 ; 8 1dece: 0f b6 in r0, 0x3f ; 63 1ded0: f8 94 cli 1ded2: de bf out 0x3e, r29 ; 62 1ded4: 0f be out 0x3f, r0 ; 63 1ded6: cd bf out 0x3d, r28 ; 61 1ded8: df 91 pop r29 1deda: cf 91 pop r28 1dedc: 1f 91 pop r17 1dede: 08 95 ret 0001dee0 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1dee0: cf 93 push r28 1dee2: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dee4: 86 ea ldi r24, 0xA6 ; 166 1dee6: 9c e0 ldi r25, 0x0C ; 12 1dee8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 status |= components; 1deec: 68 2f mov r22, r24 1deee: 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); 1def0: 86 ea ldi r24, 0xA6 ; 166 1def2: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1def4: cf 91 pop r28 1def6: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0001defa : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1defa: cf 93 push r28 1defc: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1defe: 86 ea ldi r24, 0xA6 ; 166 1df00: 9c e0 ldi r25, 0x0C ; 12 1df02: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 return ((status & components) == components); 1df06: 98 2f mov r25, r24 1df08: 9c 23 and r25, r28 1df0a: 81 e0 ldi r24, 0x01 ; 1 1df0c: 9c 13 cpse r25, r28 1df0e: 80 e0 ldi r24, 0x00 ; 0 } 1df10: cf 91 pop r28 1df12: 08 95 ret 0001df14 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 1df14: af 92 push r10 1df16: bf 92 push r11 1df18: cf 92 push r12 1df1a: df 92 push r13 1df1c: ef 92 push r14 1df1e: ff 92 push r15 1df20: 0f 93 push r16 1df22: 1f 93 push r17 1df24: cf 93 push r28 1df26: df 93 push r29 1df28: 00 d0 rcall .+0 ; 0x1df2a 1df2a: 00 d0 rcall .+0 ; 0x1df2c 1df2c: 1f 92 push r1 1df2e: cd b7 in r28, 0x3d ; 61 1df30: 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)) || 1df32: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1df36: 81 11 cpse r24, r1 1df38: 18 c0 rjmp .+48 ; 0x1df6a 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))) || 1df3a: 81 ea ldi r24, 0xA1 ; 161 1df3c: 9d e0 ldi r25, 0x0D ; 13 1df3e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1df42: 18 2f mov r17, r24 1df44: 0e 94 c1 75 call 0xeb82 ; 0xeb82 1df48: 88 23 and r24, r24 1df4a: 79 f0 breq .+30 ; 0x1df6a (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 1df4c: 80 e1 ldi r24, 0x10 ; 16 1df4e: 0e 94 7d ef call 0x1defa ; 0x1defa 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))) || 1df52: 88 23 and r24, r24 1df54: 51 f0 breq .+20 ; 0x1df6a (!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))))) 1df56: 2b e0 ldi r18, 0x0B ; 11 1df58: 12 9f mul r17, r18 1df5a: c0 01 movw r24, r0 1df5c: 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 1df5e: 80 5b subi r24, 0xB0 ; 176 1df60: 92 4f sbci r25, 0xF2 ; 242 1df62: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 } 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)) || 1df66: 89 2b or r24, r25 1df68: f1 f4 brne .+60 ; 0x1dfa6 (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) 1df6a: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1df6e: 88 23 and r24, r24 1df70: 71 f0 breq .+28 ; 0x1df8e { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 1df72: 81 ea ldi r24, 0xA1 ; 161 1df74: 9d e0 ldi r25, 0x0D ; 13 1df76: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1df7a: 2b e0 ldi r18, 0x0B ; 11 1df7c: 82 9f mul r24, r18 1df7e: c0 01 movw r24, r0 1df80: 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); 1df82: 6f ef ldi r22, 0xFF ; 255 1df84: 7f ef ldi r23, 0xFF ; 255 1df86: 80 5b subi r24, 0xB0 ; 176 1df88: 92 4f sbci r25, 0xF2 ; 242 1df8a: 0f 94 96 dc call 0x3b92c ; 0x3b92c } // 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()); 1df8e: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 1df92: 21 e0 ldi r18, 0x01 ; 1 1df94: 81 11 cpse r24, r1 1df96: 20 e0 ldi r18, 0x00 ; 0 1df98: 41 e0 ldi r20, 0x01 ; 1 1df9a: 70 e0 ldi r23, 0x00 ; 0 1df9c: 60 e0 ldi r22, 0x00 ; 0 1df9e: 85 eb ldi r24, 0xB5 ; 181 1dfa0: 95 ee ldi r25, 0xE5 ; 229 1dfa2: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 } if (lcd_encoder) { 1dfa6: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1dfaa: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1dfae: 21 15 cp r18, r1 1dfb0: 31 05 cpc r19, r1 1dfb2: 59 f0 breq .+22 ; 0x1dfca menuData->reset = lcd_encoder > 0; 1dfb4: 81 e0 ldi r24, 0x01 ; 1 1dfb6: 12 16 cp r1, r18 1dfb8: 13 06 cpc r1, r19 1dfba: 0c f0 brlt .+2 ; 0x1dfbe 1dfbc: 80 e0 ldi r24, 0x00 ; 0 1dfbe: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 lcd_encoder = 0; // Reset 1dfc2: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1dfc6: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } 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)); 1dfca: 81 ea ldi r24, 0xA1 ; 161 1dfcc: 9d e0 ldi r25, 0x0D ; 13 1dfce: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1dfd2: 1b e0 ldi r17, 0x0B ; 11 1dfd4: 81 9f mul r24, r17 1dfd6: b0 01 movw r22, r0 1dfd8: 11 24 eor r1, r1 1dfda: 67 5b subi r22, 0xB7 ; 183 1dfdc: 72 4f sbci r23, 0xF2 ; 242 1dfde: 47 e0 ldi r20, 0x07 ; 7 1dfe0: 50 e0 ldi r21, 0x00 ; 0 1dfe2: ce 01 movw r24, r28 1dfe4: 01 96 adiw r24, 0x01 ; 1 1dfe6: 7c 01 movw r14, r24 1dfe8: 0f 94 44 dc call 0x3b888 ; 0x3b888 lcd_home(); 1dfec: 0e 94 8c 6e call 0xdd18 ; 0xdd18 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]; 1dff0: 81 ea ldi r24, 0xA1 ; 161 1dff2: 9d e0 ldi r25, 0x0D ; 13 1dff4: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1dff8: 81 9f mul r24, r17 1dffa: c0 01 movw r24, r0 1dffc: 11 24 eor r1, r1 1dffe: 80 5b subi r24, 0xB0 ; 176 1e000: 92 4f sbci r25, 0xF2 ; 242 1e002: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 1e006: bc 01 movw r22, r24 1e008: 99 0f add r25, r25 1e00a: 88 0b sbc r24, r24 1e00c: 99 0b sbc r25, r25 1e00e: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 1e012: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 1e016: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 1e01a: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 1e01e: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 1e022: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 1e026: d6 2e mov r13, r22 1e028: c7 2e mov r12, r23 1e02a: b8 2e mov r11, r24 1e02c: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 1e02e: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1e032: 0e e3 ldi r16, 0x3E ; 62 1e034: 10 e2 ldi r17, 0x20 ; 32 1e036: 81 11 cpse r24, r1 1e038: 02 c0 rjmp .+4 ; 0x1e03e 1e03a: 00 e2 ldi r16, 0x20 ; 32 1e03c: 1e e3 ldi r17, 0x3E ; 62 1e03e: 8b e0 ldi r24, 0x0B ; 11 1e040: 9b e3 ldi r25, 0x3B ; 59 1e042: 0e 94 2c 72 call 0xe458 ; 0xe458 1e046: 1f 92 push r1 1e048: 0f 93 push r16 1e04a: 1f 92 push r1 1e04c: 1f 93 push r17 1e04e: af 92 push r10 1e050: bf 92 push r11 1e052: cf 92 push r12 1e054: df 92 push r13 1e056: ff 92 push r15 1e058: ef 92 push r14 1e05a: 9f 93 push r25 1e05c: 8f 93 push r24 1e05e: 0e 94 39 6e call 0xdc72 ; 0xdc72 1e062: 0f b6 in r0, 0x3f ; 63 1e064: f8 94 cli 1e066: de bf out 0x3e, r29 ; 62 1e068: 0f be out 0x3f, r0 ; 63 1e06a: 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. } 1e06c: 27 96 adiw r28, 0x07 ; 7 1e06e: 0f b6 in r0, 0x3f ; 63 1e070: f8 94 cli 1e072: de bf out 0x3e, r29 ; 62 1e074: 0f be out 0x3f, r0 ; 63 1e076: cd bf out 0x3d, r28 ; 61 1e078: df 91 pop r29 1e07a: cf 91 pop r28 1e07c: 1f 91 pop r17 1e07e: 0f 91 pop r16 1e080: ff 90 pop r15 1e082: ef 90 pop r14 1e084: df 90 pop r13 1e086: cf 90 pop r12 1e088: bf 90 pop r11 1e08a: af 90 pop r10 1e08c: 08 95 ret 0001e08e : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e08e: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1e092: 81 ea ldi r24, 0xA1 ; 161 1e094: 9d e0 ldi r25, 0x0D ; 13 1e096: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 //! @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(); 1e09a: 0c 94 8a ef jmp 0x1df14 ; 0x1df14 0001e09e : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1e09e: 0f 93 push r16 1e0a0: 1f 93 push r17 1e0a2: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1e0a4: 0e 94 78 ce call 0x19cf0 ; 0x19cf0 if (*str != '.') 1e0a8: fc 01 movw r30, r24 1e0aa: 20 81 ld r18, Z 1e0ac: 2e 32 cpi r18, 0x2E ; 46 1e0ae: 11 f0 breq .+4 ; 0x1e0b4 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 1e0b0: 80 e0 ldi r24, 0x00 ; 0 1e0b2: 34 c0 rjmp .+104 ; 0x1e11c // 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); 1e0b4: b8 01 movw r22, r16 1e0b6: 6e 5f subi r22, 0xFE ; 254 1e0b8: 7f 4f sbci r23, 0xFF ; 255 1e0ba: 01 96 adiw r24, 0x01 ; 1 1e0bc: 0e 94 78 ce call 0x19cf0 ; 0x19cf0 if (*str != '.') 1e0c0: fc 01 movw r30, r24 1e0c2: 20 81 ld r18, Z 1e0c4: 2e 32 cpi r18, 0x2E ; 46 1e0c6: a1 f7 brne .-24 ; 0x1e0b0 return false; ++str; } str = Number(str, version + 2); 1e0c8: b8 01 movw r22, r16 1e0ca: 6c 5f subi r22, 0xFC ; 252 1e0cc: 7f 4f sbci r23, 0xFF ; 255 1e0ce: 01 96 adiw r24, 0x01 ; 1 1e0d0: 0e 94 78 ce call 0x19cf0 ; 0x19cf0 version[3] = FIRMWARE_REVISION_RELEASED; 1e0d4: 20 e4 ldi r18, 0x40 ; 64 1e0d6: 30 e0 ldi r19, 0x00 ; 0 1e0d8: f8 01 movw r30, r16 1e0da: 37 83 std Z+7, r19 ; 0x07 1e0dc: 26 83 std Z+6, r18 ; 0x06 1e0de: fc 01 movw r30, r24 1e0e0: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1e0e2: 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'; 1e0e4: 89 2f mov r24, r25 1e0e6: 8f 7d andi r24, 0xDF ; 223 1e0e8: c1 f1 breq .+112 ; 0x1e15a 1e0ea: 87 ef ldi r24, 0xF7 ; 247 1e0ec: 89 0f add r24, r25 1e0ee: 82 30 cpi r24, 0x02 ; 2 1e0f0: a0 f1 brcs .+104 ; 0x1e15a 1e0f2: 9d 30 cpi r25, 0x0D ; 13 1e0f4: 91 f1 breq .+100 ; 0x1e15a 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 == '-'){ 1e0f6: 9d 32 cpi r25, 0x2D ; 45 1e0f8: 99 f7 brne .-26 ; 0x1e0e0 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1e0fa: 11 96 adiw r26, 0x01 ; 1 1e0fc: 9c 91 ld r25, X 1e0fe: 92 34 cpi r25, 0x42 ; 66 1e100: e1 f0 breq .+56 ; 0x1e13a 1e102: 7c f4 brge .+30 ; 0x1e122 1e104: 91 34 cpi r25, 0x41 ; 65 1e106: a1 f6 brne .-88 ; 0x1e0b0 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); 1e108: 0a 5f subi r16, 0xFA ; 250 1e10a: 1f 4f sbci r17, 0xFF ; 255 1e10c: 28 e0 ldi r18, 0x08 ; 8 1e10e: 30 e0 ldi r19, 0x00 ; 0 1e110: 45 e0 ldi r20, 0x05 ; 5 1e112: 62 e0 ldi r22, 0x02 ; 2 1e114: 7b e8 ldi r23, 0x8B ; 139 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); 1e116: cf 01 movw r24, r30 1e118: 0e 94 e5 cf call 0x19fca ; 0x19fca // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1e11c: 1f 91 pop r17 1e11e: 0f 91 pop r16 1e120: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1e122: 94 34 cpi r25, 0x44 ; 68 1e124: 91 f0 breq .+36 ; 0x1e14a 1e126: 92 35 cpi r25, 0x52 ; 82 1e128: 19 f6 brne .-122 ; 0x1e0b0 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); 1e12a: 0a 5f subi r16, 0xFA ; 250 1e12c: 1f 4f sbci r17, 0xFF ; 255 1e12e: 20 e2 ldi r18, 0x20 ; 32 1e130: 30 e0 ldi r19, 0x00 ; 0 1e132: 42 e0 ldi r20, 0x02 ; 2 1e134: 66 ef ldi r22, 0xF6 ; 246 1e136: 7a e8 ldi r23, 0x8A ; 138 1e138: ee cf rjmp .-36 ; 0x1e116 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); 1e13a: 0a 5f subi r16, 0xFA ; 250 1e13c: 1f 4f sbci r17, 0xFF ; 255 1e13e: 20 e1 ldi r18, 0x10 ; 16 1e140: 30 e0 ldi r19, 0x00 ; 0 1e142: 44 e0 ldi r20, 0x04 ; 4 1e144: 6d ef ldi r22, 0xFD ; 253 1e146: 7a e8 ldi r23, 0x8A ; 138 1e148: e6 cf rjmp .-52 ; 0x1e116 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); 1e14a: 0a 5f subi r16, 0xFA ; 250 1e14c: 1f 4f sbci r17, 0xFF ; 255 1e14e: 30 e0 ldi r19, 0x00 ; 0 1e150: 20 e0 ldi r18, 0x00 ; 0 1e152: 43 e0 ldi r20, 0x03 ; 3 1e154: 69 ef ldi r22, 0xF9 ; 249 1e156: 7a e8 ldi r23, 0x8A ; 138 1e158: de cf rjmp .-68 ; 0x1e116 // 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; 1e15a: 81 e0 ldi r24, 0x01 ; 1 1e15c: df cf rjmp .-66 ; 0x1e11c 0001e15e : /// (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 ) 1e15e: 84 e0 ldi r24, 0x04 ; 4 1e160: 9d e0 ldi r25, 0x0D ; 13 1e162: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1e166: 8a 32 cpi r24, 0x2A ; 42 1e168: 39 f4 brne .+14 ; 0x1e178 1e16a: 8a e2 ldi r24, 0x2A ; 42 1e16c: 9d e0 ldi r25, 0x0D ; 13 1e16e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1e172: 91 e0 ldi r25, 0x01 ; 1 1e174: 81 30 cpi r24, 0x01 ; 1 1e176: 09 f0 breq .+2 ; 0x1e17a 1e178: 90 e0 ldi r25, 0x00 ; 0 } 1e17a: 89 2f mov r24, r25 1e17c: 08 95 ret 0001e17e : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1e17e: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1e182: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1e186: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e18a: 84 30 cpi r24, 0x04 ; 4 1e18c: 70 f5 brcc .+92 ; 0x1e1ea 1e18e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1e192: 8f e4 ldi r24, 0x4F ; 79 1e194: 99 e4 ldi r25, 0x49 ; 73 1e196: 0e 94 2c 72 call 0xe458 ; 0xe458 1e19a: 0f 94 99 d4 call 0x3a932 ; 0x3a932 #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 #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 1e19e: 0e 94 af f0 call 0x1e15e ; 0x1e15e 1e1a2: 88 23 and r24, r24 1e1a4: f9 f0 breq .+62 ; 0x1e1e4 1e1a6: 87 e1 ldi r24, 0x17 ; 23 1e1a8: 9c e5 ldi r25, 0x5C ; 92 1e1aa: 0e 94 2c 72 call 0xe458 ; 0xe458 1e1ae: 22 e0 ldi r18, 0x02 ; 2 1e1b0: 46 ef ldi r20, 0xF6 ; 246 1e1b2: 50 ef ldi r21, 0xF0 ; 240 1e1b4: bc 01 movw r22, r24 1e1b6: 88 e1 ldi r24, 0x18 ; 24 1e1b8: 9b e6 ldi r25, 0x6B ; 107 1e1ba: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba #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 1e1be: 6b e1 ldi r22, 0x1B ; 27 1e1c0: 70 ed ldi r23, 0xD0 ; 208 1e1c2: 85 e0 ldi r24, 0x05 ; 5 1e1c4: 9b e6 ldi r25, 0x6B ; 107 1e1c6: 0f 94 4b d1 call 0x3a296 ; 0x3a296 #endif //PRUSA_SN_SUPPORT MENU_END(); 1e1ca: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1e1ce: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e1d2: 8f 5f subi r24, 0xFF ; 255 1e1d4: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e1d8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e1dc: 8f 5f subi r24, 0xFF ; 255 1e1de: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e1e2: d1 cf rjmp .-94 ; 0x1e186 #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 #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 1e1e4: 81 e1 ldi r24, 0x11 ; 17 1e1e6: 9c e5 ldi r25, 0x5C ; 92 1e1e8: e0 cf rjmp .-64 ; 0x1e1aa #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(); } 1e1ea: 08 95 ret 0001e1ec : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 1e1ec: 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(); 1e1ee: 0e 94 af f0 call 0x1e15e ; 0x1e15e 1e1f2: c1 e0 ldi r28, 0x01 ; 1 1e1f4: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 1e1f6: 6f ef ldi r22, 0xFF ; 255 1e1f8: 09 f0 breq .+2 ; 0x1e1fc 1e1fa: 6a e2 ldi r22, 0x2A ; 42 1e1fc: 84 e0 ldi r24, 0x04 ; 4 1e1fe: 9d e0 ldi r25, 0x0D ; 13 1e200: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 1 #else 0 #endif ) , enableECool(enableECool) { } 1e204: 8c 2f mov r24, r28 1e206: 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)); 1e208: 82 70 andi r24, 0x02 ; 2 } 1e20a: 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)); 1e20c: 0d 94 65 27 jmp 0x24eca ; 0x24eca 0001e210 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 1e210: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 1e214: 81 11 cpse r24, r1 1e216: 3c c0 rjmp .+120 ; 0x1e290 #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 1e218: 81 e0 ldi r24, 0x01 ; 1 1e21a: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 1e21e: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 1e222: 8f ef ldi r24, 0xFF ; 255 1e224: 9f e0 ldi r25, 0x0F ; 15 1e226: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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); 1e22a: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1e22e: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 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()) 1e232: 98 17 cp r25, r24 1e234: 41 f0 breq .+16 ; 0x1e246 { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 1e236: 83 ec ldi r24, 0xC3 ; 195 1e238: 9a e3 ldi r25, 0x3A ; 58 1e23a: 0e 94 2c 72 call 0xe458 ; 0xe458 1e23e: 0f 94 e9 20 call 0x241d2 ; 0x241d2 // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 1e242: 0f 94 ed 43 call 0x287da ; 0x287da } tmc2130_wait_standstill_xy(1000); 1e246: 0f 94 50 88 call 0x310a0 ; 0x310a0 cli(); 1e24a: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 1e24c: 81 e0 ldi r24, 0x01 ; 1 1e24e: 90 91 a4 03 lds r25, 0x03A4 ; 0x8003a4 1e252: 91 11 cpse r25, r1 1e254: 01 c0 rjmp .+2 ; 0x1e258 1e256: 80 e0 ldi r24, 0x00 ; 0 1e258: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c update_mode_profile(); 1e25c: 0f 94 dc 64 call 0x2c9b8 ; 0x2c9b8 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(); 1e260: 0e 94 af f0 call 0x1e15e ; 0x1e15e 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) { } 1e264: 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())); 1e266: 82 70 andi r24, 0x02 ; 2 1e268: 0f 94 65 27 call 0x24eca ; 0x24eca // 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(); 1e26c: 0f 94 47 44 call 0x2888e ; 0x2888e sei(); 1e270: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 1e272: 89 e6 ldi r24, 0x69 ; 105 1e274: 9f e0 ldi r25, 0x0F ; 15 1e276: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1e27a: 88 23 and r24, r24 1e27c: 61 f0 breq .+24 ; 0x1e296 1e27e: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 1e282: 88 23 and r24, r24 1e284: 41 f0 breq .+16 ; 0x1e296 menu_submenu(lcd_crash_mode_info2); 1e286: 60 e0 ldi r22, 0x00 ; 0 1e288: 8e e1 ldi r24, 0x1E ; 30 1e28a: 90 ee ldi r25, 0xE0 ; 224 1e28c: 0d 94 3b d3 jmp 0x3a676 ; 0x3a676 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; 1e290: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 1e294: c4 cf rjmp .-120 ; 0x1e21e #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 1e296: 08 95 ret 0001e298 : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 1e298: df 92 push r13 1e29a: ef 92 push r14 1e29c: ff 92 push r15 1e29e: 0f 93 push r16 1e2a0: 1f 93 push r17 1e2a2: cf 93 push r28 1e2a4: df 93 push r29 MENU_BEGIN(); 1e2a6: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1e2aa: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1e2ae: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e2b2: 84 30 cpi r24, 0x04 ; 4 1e2b4: 08 f0 brcs .+2 ; 0x1e2b8 1e2b6: 66 c0 rjmp .+204 ; 0x1e384 1e2b8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1e2bc: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 1e2c0: 88 23 and r24, r24 1e2c2: e9 f0 breq .+58 ; 0x1e2fe 1e2c4: 09 ef ldi r16, 0xF9 ; 249 1e2c6: 14 e0 ldi r17, 0x04 ; 4 1e2c8: c7 ef ldi r28, 0xF7 ; 247 1e2ca: 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) { 1e2cc: f8 01 movw r30, r16 1e2ce: 80 81 ld r24, Z 1e2d0: 8e 31 cpi r24, 0x1E ; 30 1e2d2: 08 f4 brcc .+2 ; 0x1e2d6 tmc2130_wave_fac[axis] = 0; 1e2d4: 10 82 st Z, r1 1e2d6: f8 01 movw r30, r16 1e2d8: 61 91 ld r22, Z+ 1e2da: 8f 01 movw r16, r30 1e2dc: ce 01 movw r24, r28 1e2de: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 1e2e2: 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++) { 1e2e4: c3 3f cpi r28, 0xF3 ; 243 1e2e6: fe e0 ldi r31, 0x0E ; 14 1e2e8: df 07 cpc r29, r31 1e2ea: 81 f7 brne .-32 ; 0x1e2cc 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(); 1e2ec: 0e 94 af f0 call 0x1e15e ; 0x1e15e 1e2f0: e8 94 clt 1e2f2: d0 f8 bld r13, 0 1e2f4: 80 fb bst r24, 0 1e2f6: 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())); 1e2f8: 8d 2d mov r24, r13 1e2fa: 0f 94 65 27 call 0x24eca ; 0x24eca { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1e2fe: 8a ee ldi r24, 0xEA ; 234 1e300: 97 e4 ldi r25, 0x47 ; 71 1e302: 0e 94 2c 72 call 0xe458 ; 0xe458 1e306: 0f 94 99 d4 call 0x3a932 ; 0x3a932 #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); 1e30a: 80 e1 ldi r24, 0x10 ; 16 1e30c: 93 e4 ldi r25, 0x43 ; 67 1e30e: 0e 94 2c 72 call 0xe458 ; 0xe458 1e312: f1 2c mov r15, r1 1e314: e1 2c mov r14, r1 1e316: 08 ec ldi r16, 0xC8 ; 200 1e318: 10 e0 ldi r17, 0x00 ; 0 1e31a: 2d e1 ldi r18, 0x1D ; 29 1e31c: 30 e0 ldi r19, 0x00 ; 0 1e31e: 48 e0 ldi r20, 0x08 ; 8 1e320: 69 ef ldi r22, 0xF9 ; 249 1e322: 74 e0 ldi r23, 0x04 ; 4 1e324: 0f 94 1e d2 call 0x3a43c ; 0x3a43c 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); 1e328: 84 e0 ldi r24, 0x04 ; 4 1e32a: 93 e4 ldi r25, 0x43 ; 67 1e32c: 0e 94 2c 72 call 0xe458 ; 0xe458 1e330: 2d e1 ldi r18, 0x1D ; 29 1e332: 30 e0 ldi r19, 0x00 ; 0 1e334: 48 e0 ldi r20, 0x08 ; 8 1e336: 6a ef ldi r22, 0xFA ; 250 1e338: 74 e0 ldi r23, 0x04 ; 4 1e33a: 0f 94 1e d2 call 0x3a43c ; 0x3a43c 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); 1e33e: 88 ef ldi r24, 0xF8 ; 248 1e340: 92 e4 ldi r25, 0x42 ; 66 1e342: 0e 94 2c 72 call 0xe458 ; 0xe458 1e346: 2d e1 ldi r18, 0x1D ; 29 1e348: 30 e0 ldi r19, 0x00 ; 0 1e34a: 48 e0 ldi r20, 0x08 ; 8 1e34c: 6b ef ldi r22, 0xFB ; 251 1e34e: 74 e0 ldi r23, 0x04 ; 4 1e350: 0f 94 1e d2 call 0x3a43c ; 0x3a43c #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); 1e354: 8c ee ldi r24, 0xEC ; 236 1e356: 92 e4 ldi r25, 0x42 ; 66 1e358: 0e 94 2c 72 call 0xe458 ; 0xe458 1e35c: 2d e1 ldi r18, 0x1D ; 29 1e35e: 30 e0 ldi r19, 0x00 ; 0 1e360: 48 e0 ldi r20, 0x08 ; 8 1e362: 6c ef ldi r22, 0xFC ; 252 1e364: 74 e0 ldi r23, 0x04 ; 4 1e366: 0f 94 1e d2 call 0x3a43c ; 0x3a43c MENU_END(); 1e36a: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 1e36e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e372: 8f 5f subi r24, 0xFF ; 255 1e374: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e378: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e37c: 8f 5f subi r24, 0xFF ; 255 1e37e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e382: 95 cf rjmp .-214 ; 0x1e2ae 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(); } 1e384: df 91 pop r29 1e386: cf 91 pop r28 1e388: 1f 91 pop r17 1e38a: 0f 91 pop r16 1e38c: ff 90 pop r15 1e38e: ef 90 pop r14 1e390: df 90 pop r13 1e392: 08 95 ret 0001e394 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1e394: 44 e1 ldi r20, 0x14 ; 20 1e396: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1e398: 66 23 and r22, r22 1e39a: 89 f0 breq .+34 ; 0x1e3be strncpy_P(lcd_status_message, message, LCD_WIDTH); 1e39c: bc 01 movw r22, r24 1e39e: 8f e1 ldi r24, 0x1F ; 31 1e3a0: 95 e0 ldi r25, 0x05 ; 5 1e3a2: 0f 94 41 da call 0x3b482 ; 0x3b482 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1e3a6: 10 92 33 05 sts 0x0533, r1 ; 0x800533 <_ZL18lcd_status_message.lto_priv.455+0x14> lcd_status_message_idx = 0; // Print message from beginning 1e3aa: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.450> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1e3ae: 81 ee ldi r24, 0xE1 ; 225 1e3b0: 9a e6 ldi r25, 0x6A ; 106 1e3b2: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1e3b6: 81 e0 ldi r24, 0x01 ; 1 1e3b8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 1e3bc: 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); 1e3be: bc 01 movw r22, r24 1e3c0: 8f e1 ldi r24, 0x1F ; 31 1e3c2: 95 e0 ldi r25, 0x05 ; 5 1e3c4: 0f 94 d4 e2 call 0x3c5a8 ; 0x3c5a8 1e3c8: ee cf rjmp .-36 ; 0x1e3a6 0001e3ca : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1e3ca: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> 1e3ce: 89 17 cp r24, r25 1e3d0: 80 f4 brcc .+32 ; 0x1e3f2 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1e3d2: 91 30 cpi r25, 0x01 ; 1 1e3d4: 61 f4 brne .+24 ; 0x1e3ee } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1e3d6: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.454> 1e3da: 88 23 and r24, r24 1e3dc: 51 f0 breq .+20 ; 0x1e3f2 1e3de: 40 e2 ldi r20, 0x20 ; 32 1e3e0: 5e e4 ldi r21, 0x4E ; 78 1e3e2: 60 e0 ldi r22, 0x00 ; 0 1e3e4: 70 e0 ldi r23, 0x00 ; 0 1e3e6: 84 e3 ldi r24, 0x34 ; 52 1e3e8: 95 e0 ldi r25, 0x05 ; 5 1e3ea: 0d 94 35 2b jmp 0x2566a ; 0x2566a ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1e3ee: 80 e0 ldi r24, 0x00 ; 0 1e3f0: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1e3f2: 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; } 1e3f4: 08 95 ret 0001e3f6 : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1e3f6: ef 92 push r14 1e3f8: ff 92 push r15 1e3fa: 1f 93 push r17 1e3fc: cf 93 push r28 1e3fe: df 93 push r29 1e400: ec 01 movw r28, r24 1e402: 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)) { 1e404: 86 2f mov r24, r22 1e406: 0e 94 e5 f1 call 0x1e3ca ; 0x1e3ca 1e40a: 88 23 and r24, r24 1e40c: e9 f0 breq .+58 ; 0x1e448 bool same = !(progmem? strcmp_P(lcd_status_message, message): 1e40e: be 01 movw r22, r28 1e410: 8f e1 ldi r24, 0x1F ; 31 1e412: 95 e0 ldi r25, 0x05 ; 5 1e414: 0f 94 02 da call 0x3b404 ; 0x3b404 1e418: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1e41a: 84 e3 ldi r24, 0x34 ; 52 1e41c: 95 e0 ldi r25, 0x05 ; 5 1e41e: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> lcd_status_message_level = severity; 1e422: 10 93 d5 03 sts 0x03D5, r17 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> custom_message_type = CustomMsg::Status; 1e426: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 custom_message_state = 0; 1e42a: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 if (!same) { 1e42e: ef 28 or r14, r15 1e430: 59 f0 breq .+22 ; 0x1e448 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1e432: 61 e0 ldi r22, 0x01 ; 1 1e434: ce 01 movw r24, r28 1e436: 0e 94 ca f1 call 0x1e394 ; 0x1e394 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1e43a: df 91 pop r29 1e43c: cf 91 pop r28 1e43e: 1f 91 pop r17 1e440: ff 90 pop r15 1e442: 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(); 1e444: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1e448: df 91 pop r29 1e44a: cf 91 pop r28 1e44c: 1f 91 pop r17 1e44e: ff 90 pop r15 1e450: ef 90 pop r14 1e452: 08 95 ret 0001e454 : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 1e454: cf 93 push r28 1e456: df 93 push r29 1e458: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e45a: 80 e0 ldi r24, 0x00 ; 0 1e45c: 0e 94 e5 f1 call 0x1e3ca ; 0x1e3ca 1e460: 88 23 and r24, r24 1e462: 21 f0 breq .+8 ; 0x1e46c lcd_updatestatus(message); 1e464: 60 e0 ldi r22, 0x00 ; 0 1e466: ce 01 movw r24, r28 1e468: 0e 94 ca f1 call 0x1e394 ; 0x1e394 SERIAL_ECHOLN(message); 1e46c: ce 01 movw r24, r28 } 1e46e: df 91 pop r29 1e470: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 1e472: 0d 94 38 d6 jmp 0x3ac70 ; 0x3ac70 0001e476 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1e476: cf 93 push r28 1e478: df 93 push r29 1e47a: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e47c: 80 e0 ldi r24, 0x00 ; 0 1e47e: 0e 94 e5 f1 call 0x1e3ca ; 0x1e3ca 1e482: 88 23 and r24, r24 1e484: 31 f0 breq .+12 ; 0x1e492 lcd_updatestatus(message, true); 1e486: 61 e0 ldi r22, 0x01 ; 1 1e488: ce 01 movw r24, r28 } 1e48a: df 91 pop r29 1e48c: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1e48e: 0c 94 ca f1 jmp 0x1e394 ; 0x1e394 } 1e492: df 91 pop r29 1e494: cf 91 pop r28 1e496: 08 95 ret 0001e498 : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1e498: 2f 92 push r2 1e49a: 3f 92 push r3 1e49c: 4f 92 push r4 1e49e: 5f 92 push r5 1e4a0: 6f 92 push r6 1e4a2: 7f 92 push r7 1e4a4: 8f 92 push r8 1e4a6: 9f 92 push r9 1e4a8: af 92 push r10 1e4aa: bf 92 push r11 1e4ac: cf 92 push r12 1e4ae: df 92 push r13 1e4b0: ef 92 push r14 1e4b2: ff 92 push r15 1e4b4: 0f 93 push r16 1e4b6: 1f 93 push r17 1e4b8: cf 93 push r28 1e4ba: df 93 push r29 1e4bc: cd b7 in r28, 0x3d ; 61 1e4be: de b7 in r29, 0x3e ; 62 1e4c0: 2d 97 sbiw r28, 0x0d ; 13 1e4c2: 0f b6 in r0, 0x3f ; 63 1e4c4: f8 94 cli 1e4c6: de bf out 0x3e, r29 ; 62 1e4c8: 0f be out 0x3f, r0 ; 63 1e4ca: 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) 1e4cc: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1e4d0: 81 30 cpi r24, 0x01 ; 1 1e4d2: 31 f1 breq .+76 ; 0x1e520 1e4d4: 30 f0 brcs .+12 ; 0x1e4e2 1e4d6: 82 30 cpi r24, 0x02 ; 2 1e4d8: 09 f4 brne .+2 ; 0x1e4dc 1e4da: 7d c2 rjmp .+1274 ; 0x1e9d6 { _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. 1e4dc: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 1e4e0: fe c0 rjmp .+508 ; 0x1e6de switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1e4e2: 80 91 df 14 lds r24, 0x14DF ; 0x8014df 1e4e6: 88 23 and r24, r24 1e4e8: 49 f0 breq .+18 ; 0x1e4fc { card.presort_flag = false; 1e4ea: 10 92 df 14 sts 0x14DF, r1 ; 0x8014df lcd_update_enabled = false; 1e4ee: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 1e4f2: 0f 94 cd 7d call 0x2fb9a ; 0x2fb9a lcd_update_enabled = true; 1e4f6: 81 e0 ldi r24, 0x01 ; 1 1e4f8: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 1e4fc: 0f 94 0f 7b call 0x2f61e ; 0x2f61e 1e500: 90 93 b1 03 sts 0x03B1, r25 ; 0x8003b1 1e504: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1e508: 89 e0 ldi r24, 0x09 ; 9 1e50a: 9f e0 ldi r25, 0x0F ; 15 1e50c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1e510: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 _md->menuState = _standard; 1e514: 81 e0 ldi r24, 0x01 ; 1 1e516: 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. 1e51a: 8f ef ldi r24, 0xFF ; 255 1e51c: 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. 1e520: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 1e524: 81 11 cpse r24, r1 1e526: 07 c0 rjmp .+14 ; 0x1e536 { _md->lcd_scrollTimer.start(); 1e528: 84 eb ldi r24, 0xB4 ; 180 1e52a: 93 e0 ldi r25, 0x03 ; 3 1e52c: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> lcd_draw_update = 1; 1e530: 81 e0 ldi r24, 0x01 ; 1 1e532: 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. 1e536: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e53a: 81 11 cpse r24, r1 1e53c: 21 c0 rjmp .+66 ; 0x1e580 1e53e: 64 ef ldi r22, 0xF4 ; 244 1e540: 71 e0 ldi r23, 0x01 ; 1 1e542: 84 eb ldi r24, 0xB4 ; 180 1e544: 93 e0 ldi r25, 0x03 ; 3 1e546: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 1e54a: 88 23 and r24, r24 1e54c: a1 f0 breq .+40 ; 0x1e576 1e54e: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 1e552: 8f 3f cpi r24, 0xFF ; 255 1e554: 81 f0 breq .+32 ; 0x1e576 { _md->menuState = _scrolling; 1e556: 82 e0 ldi r24, 0x02 ; 2 1e558: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->offset = 0; 1e55c: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->scrollPointer = NULL; 1e560: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad 1e564: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac _md->lcd_scrollTimer.start(); 1e568: 84 eb ldi r24, 0xB4 ; 180 1e56a: 93 e0 ldi r25, 0x03 ; 3 1e56c: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1e570: 81 e0 ldi r24, 0x01 ; 1 1e572: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 1e576: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e57a: 88 23 and r24, r24 1e57c: 09 f4 brne .+2 ; 0x1e580 1e57e: ab c0 rjmp .+342 ; 0x1e6d6 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. 1e580: 8f ef ldi r24, 0xFF ; 255 1e582: 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(); 1e586: 84 eb ldi r24, 0xB4 ; 180 1e588: 93 e0 ldi r25, 0x03 ; 3 1e58a: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> MENU_BEGIN(); 1e58e: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 1e592: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if(eFilamentAction != FilamentAction::None) return; // Create a copy of card.filename on the stack since card.filename pointer // will be modified by the SD card library when searching for the file char selected_filename[FILENAME_LENGTH]; strcpy(selected_filename, filename); 1e596: ce 01 movw r24, r28 1e598: 01 96 adiw r24, 0x01 ; 1 1e59a: 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); 1e59c: f0 e5 ldi r31, 0x50 ; 80 1e59e: 2f 2e mov r2, r31 1e5a0: f0 e7 ldi r31, 0x70 ; 112 1e5a2: 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(); 1e5a4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e5a8: 84 30 cpi r24, 0x04 ; 4 1e5aa: 08 f0 brcs .+2 ; 0x1e5ae 1e5ac: 98 c0 rjmp .+304 ; 0x1e6de 1e5ae: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 1e5b2: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1e5b6: 88 23 and r24, r24 1e5b8: 09 f4 brne .+2 ; 0x1e5bc 1e5ba: aa c0 rjmp .+340 ; 0x1e710 1e5bc: 8b e3 ldi r24, 0x3B ; 59 1e5be: 98 e4 ldi r25, 0x48 ; 72 1e5c0: 0e 94 2c 72 call 0xe458 ; 0xe458 1e5c4: 0f 94 99 d4 call 0x3a932 ; 0x3a932 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;}; 1e5c8: 62 e9 ldi r22, 0x92 ; 146 1e5ca: 74 e1 ldi r23, 0x14 ; 20 1e5cc: 8b e3 ldi r24, 0x3B ; 59 1e5ce: 95 e1 ldi r25, 0x15 ; 21 1e5d0: 0f 94 b4 59 call 0x2b368 ; 0x2b368 card.getWorkDirName(); if (card.filename[0] == '/') 1e5d4: 80 91 92 14 lds r24, 0x1492 ; 0x801492 1e5d8: 8f 32 cpi r24, 0x2F ; 47 1e5da: 09 f0 breq .+2 ; 0x1e5de 1e5dc: 9c c0 rjmp .+312 ; 0x1e716 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1e5de: 80 91 01 17 lds r24, 0x1701 ; 0x801701 1e5e2: 88 23 and r24, r24 1e5e4: 41 f0 breq .+16 ; 0x1e5f6 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1e5e6: 80 e3 ldi r24, 0x30 ; 48 1e5e8: 98 e4 ldi r25, 0x48 ; 72 1e5ea: 0e 94 2c 72 call 0xe458 ; 0xe458 1e5ee: 6c ea ldi r22, 0xAC ; 172 1e5f0: 70 ee ldi r23, 0xE0 ; 224 #endif } else MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); //Show the updir button if in a subdir. 1e5f2: 0f 94 4b d1 call 0x3a296 ; 0x3a296 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1e5f6: c0 90 b0 03 lds r12, 0x03B0 ; 0x8003b0 1e5fa: 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; 1e5fe: 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. 1e600: 91 e0 ldi r25, 0x01 ; 1 1e602: c9 1a sub r12, r25 1e604: d1 08 sbc r13, r1 1e606: 08 f4 brcc .+2 ; 0x1e60a 1e608: d9 c1 rjmp .+946 ; 0x1e9bc { if (menu_item == menu_line) //If the file is on the screen. 1e60a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1e60e: 90 91 14 05 lds r25, 0x0514 ; 0x800514 1e612: 89 13 cpse r24, r25 1e614: cf c1 rjmp .+926 ; 0x1e9b4 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1e616: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 1e61a: c6 01 movw r24, r12 1e61c: 0f 94 3b 86 call 0x30c76 ; 0x30c76 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1e620: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1e624: 90 e0 ldi r25, 0x00 ; 0 1e626: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e62a: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e62e: 10 91 dc 14 lds r17, 0x14DC ; 0x8014dc 1e632: 82 17 cp r24, r18 1e634: 93 07 cpc r25, r19 1e636: 51 f4 brne .+20 ; 0x1e64c { _md->selectedFileID = i; 1e638: d0 92 af 03 sts 0x03AF, r13 ; 0x8003af 1e63c: c0 92 ae 03 sts 0x03AE, r12 ; 0x8003ae _md->isDir = card.filenameIsDir; 1e640: 10 93 ab 03 sts 0x03AB, r17 ; 0x8003ab _md->row = menu_row; 1e644: 40 91 12 05 lds r20, 0x0512 ; 0x800512 1e648: 40 93 b2 03 sts 0x03B2, r20 ; 0x8003b2 1e64c: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 1e650: 11 23 and r17, r17 1e652: 09 f4 brne .+2 ; 0x1e656 1e654: 65 c0 rjmp .+202 ; 0x1e720 #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) 1e656: 44 23 and r20, r20 1e658: e9 f0 breq .+58 ; 0x1e694 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1e65a: 40 91 a7 14 lds r20, 0x14A7 ; 0x8014a7 1e65e: e2 e9 ldi r30, 0x92 ; 146 1e660: ae 2e mov r10, r30 1e662: e4 e1 ldi r30, 0x14 ; 20 1e664: be 2e mov r11, r30 1e666: 44 23 and r20, r20 1e668: 21 f0 breq .+8 ; 0x1e672 1e66a: 77 ea ldi r23, 0xA7 ; 167 1e66c: a7 2e mov r10, r23 1e66e: 74 e1 ldi r23, 0x14 ; 20 1e670: b7 2e mov r11, r23 1e672: 60 91 12 05 lds r22, 0x0512 ; 0x800512 } static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 2; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 1e676: 4e e3 ldi r20, 0x3E ; 62 1e678: 82 17 cp r24, r18 1e67a: 93 07 cpc r25, r19 1e67c: 09 f0 breq .+2 ; 0x1e680 1e67e: 40 e2 ldi r20, 0x20 ; 32 1e680: 80 e0 ldi r24, 0x00 ; 0 1e682: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_putc(LCD_STR_FOLDER[0]); 1e686: 85 e8 ldi r24, 0x85 ; 133 1e688: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_print_pad(longFilename, len); 1e68c: 62 e1 ldi r22, 0x12 ; 18 1e68e: c5 01 movw r24, r10 1e690: 0e 94 4f 70 call 0xe09e ; 0xe09e 1e694: 80 91 15 05 lds r24, 0x0515 ; 0x800515 { if (lcd_draw_update) { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 1e698: 90 91 13 05 lds r25, 0x0513 ; 0x800513 1e69c: 99 23 and r25, r25 1e69e: 09 f4 brne .+2 ; 0x1e6a2 1e6a0: 89 c1 rjmp .+786 ; 0x1e9b4 1e6a2: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e6a6: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e6aa: 82 17 cp r24, r18 1e6ac: 13 06 cpc r1, r19 1e6ae: 09 f0 breq .+2 ; 0x1e6b2 1e6b0: 81 c1 rjmp .+770 ; 0x1e9b4 { lcd_update_enabled = false; 1e6b2: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1e6b6: 61 e0 ldi r22, 0x01 ; 1 1e6b8: 82 e9 ldi r24, 0x92 ; 146 1e6ba: 94 e1 ldi r25, 0x14 ; 20 1e6bc: 0f 94 4f 7f call 0x2fe9e ; 0x2fe9e lcd_encoder = 0; 1e6c0: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1e6c4: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1e6c8: 0f 94 f0 d1 call 0x3a3e0 ; 0x3a3e0 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1e6cc: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 1e6d0: 0f 94 b4 d0 call 0x3a168 ; 0x3a168 1e6d4: 95 cf rjmp .-214 ; 0x1e600 _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()) 1e6d6: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 1e6da: 81 11 cpse r24, r1 1e6dc: 51 cf rjmp .-350 ; 0x1e580 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1e6de: 2d 96 adiw r28, 0x0d ; 13 1e6e0: 0f b6 in r0, 0x3f ; 63 1e6e2: f8 94 cli 1e6e4: de bf out 0x3e, r29 ; 62 1e6e6: 0f be out 0x3f, r0 ; 63 1e6e8: cd bf out 0x3d, r28 ; 61 1e6ea: df 91 pop r29 1e6ec: cf 91 pop r28 1e6ee: 1f 91 pop r17 1e6f0: 0f 91 pop r16 1e6f2: ff 90 pop r15 1e6f4: ef 90 pop r14 1e6f6: df 90 pop r13 1e6f8: cf 90 pop r12 1e6fa: bf 90 pop r11 1e6fc: af 90 pop r10 1e6fe: 9f 90 pop r9 1e700: 8f 90 pop r8 1e702: 7f 90 pop r7 1e704: 6f 90 pop r6 1e706: 5f 90 pop r5 1e708: 4f 90 pop r4 1e70a: 3f 90 pop r3 1e70c: 2f 90 pop r2 1e70e: 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 1e710: 8f e4 ldi r24, 0x4F ; 79 1e712: 99 e4 ldi r25, 0x49 ; 73 1e714: 55 cf rjmp .-342 ; 0x1e5c0 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. 1e716: 66 eb ldi r22, 0xB6 ; 182 1e718: 70 ee ldi r23, 0xE0 ; 224 1e71a: 80 e7 ldi r24, 0x70 ; 112 1e71c: 99 e8 ldi r25, 0x89 ; 137 1e71e: 69 cf rjmp .-302 ; 0x1e5f2 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1e720: 44 23 and r20, r20 1e722: d1 f0 breq .+52 ; 0x1e758 { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1e724: 40 91 a7 14 lds r20, 0x14A7 ; 0x8014a7 1e728: 62 e9 ldi r22, 0x92 ; 146 1e72a: a6 2e mov r10, r22 1e72c: 64 e1 ldi r22, 0x14 ; 20 1e72e: b6 2e mov r11, r22 1e730: 44 23 and r20, r20 1e732: 21 f0 breq .+8 ; 0x1e73c 1e734: 57 ea ldi r21, 0xA7 ; 167 1e736: a5 2e mov r10, r21 1e738: 54 e1 ldi r21, 0x14 ; 20 1e73a: b5 2e mov r11, r21 1e73c: 60 91 12 05 lds r22, 0x0512 ; 0x800512 bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 1; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 1e740: 4e e3 ldi r20, 0x3E ; 62 1e742: 82 17 cp r24, r18 1e744: 93 07 cpc r25, r19 1e746: 09 f0 breq .+2 ; 0x1e74a 1e748: 40 e2 ldi r20, 0x20 ; 32 1e74a: 80 e0 ldi r24, 0x00 ; 0 1e74c: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_print_pad(longFilename, len); 1e750: 63 e1 ldi r22, 0x13 ; 19 1e752: c5 01 movw r24, r10 1e754: 0e 94 4f 70 call 0xe09e ; 0xe09e 1e758: 80 91 15 05 lds r24, 0x0515 ; 0x800515 { if (lcd_draw_update) { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 1e75c: 90 91 13 05 lds r25, 0x0513 ; 0x800513 1e760: 99 23 and r25, r25 1e762: 09 f4 brne .+2 ; 0x1e766 1e764: 27 c1 rjmp .+590 ; 0x1e9b4 1e766: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e76a: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e76e: 82 17 cp r24, r18 1e770: 13 06 cpc r1, r19 1e772: 09 f0 breq .+2 ; 0x1e776 1e774: 1f c1 rjmp .+574 ; 0x1e9b4 { lcd_update_enabled = false; 1e776: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1e77a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1e77e: 81 11 cpse r24, r1 1e780: a5 cf rjmp .-182 ; 0x1e6cc // 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); 1e782: 62 e9 ldi r22, 0x92 ; 146 1e784: 74 e1 ldi r23, 0x14 ; 20 1e786: c7 01 movw r24, r14 1e788: 0f 94 bf e2 call 0x3c57e ; 0x3c57e 1e78c: 47 01 movw r8, r14 1e78e: 45 e9 ldi r20, 0x95 ; 149 1e790: a4 2e mov r10, r20 1e792: 4f e0 ldi r20, 0x0F ; 15 1e794: 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] == '.') { 1e796: f4 01 movw r30, r8 1e798: 61 91 ld r22, Z+ 1e79a: 4f 01 movw r8, r30 1e79c: 66 23 and r22, r22 1e79e: 19 f0 breq .+6 ; 0x1e7a6 1e7a0: 6e 32 cpi r22, 0x2E ; 46 1e7a2: 09 f0 breq .+2 ; 0x1e7a6 1e7a4: 4b c0 rjmp .+150 ; 0x1e83c 1e7a6: 60 e0 ldi r22, 0x00 ; 0 1e7a8: c5 01 movw r24, r10 1e7aa: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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, '.'); 1e7ae: 6e e2 ldi r22, 0x2E ; 46 1e7b0: 70 e0 ldi r23, 0x00 ; 0 1e7b2: c7 01 movw r24, r14 1e7b4: 0f 94 ab e2 call 0x3c556 ; 0x3c556 1e7b8: 3c 01 movw r6, r24 if (extension_ptr) { 1e7ba: 89 2b or r24, r25 1e7bc: 19 f0 breq .+6 ; 0x1e7c4 extension_ptr++; // skip the '.' 1e7be: 8f ef ldi r24, 0xFF ; 255 1e7c0: 68 1a sub r6, r24 1e7c2: 78 0a sbc r7, r24 1e7c4: 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); 1e7c6: 31 e9 ldi r19, 0x91 ; 145 1e7c8: a3 2e mov r10, r19 1e7ca: 3c e0 ldi r19, 0x0C ; 12 1e7cc: 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') { 1e7ce: 61 14 cp r6, r1 1e7d0: 71 04 cpc r7, r1 1e7d2: 21 f0 breq .+8 ; 0x1e7dc 1e7d4: f4 01 movw r30, r8 1e7d6: 60 81 ld r22, Z 1e7d8: 61 11 cpse r22, r1 1e7da: 01 c0 rjmp .+2 ; 0x1e7de 1e7dc: 60 e0 ldi r22, 0x00 ; 0 1e7de: c5 01 movw r24, r10 1e7e0: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 1e7e4: ff ef ldi r31, 0xFF ; 255 1e7e6: af 1a sub r10, r31 1e7e8: bf 0a sbc r11, r31 1e7ea: 2f ef ldi r18, 0xFF ; 255 1e7ec: 82 1a sub r8, r18 1e7ee: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1e7f0: 84 e9 ldi r24, 0x94 ; 148 1e7f2: a8 16 cp r10, r24 1e7f4: 8c e0 ldi r24, 0x0C ; 12 1e7f6: b8 06 cpc r11, r24 1e7f8: 51 f7 brne .-44 ; 0x1e7ce { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1e7fa: 60 90 30 16 lds r6, 0x1630 ; 0x801630 1e7fe: 66 2d mov r22, r6 1e800: 8a e5 ldi r24, 0x5A ; 90 1e802: 9f e0 ldi r25, 0x0F ; 15 1e804: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 1e808: 8e e8 ldi r24, 0x8E ; 142 1e80a: 94 e1 ldi r25, 0x14 ; 20 1e80c: 2a e0 ldi r18, 0x0A ; 10 1e80e: a2 2e mov r10, r18 1e810: 2f e0 ldi r18, 0x0F ; 15 1e812: 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++) { 1e814: 71 2c mov r7, r1 1e816: 4c 01 movw r8, r24 1e818: e9 e0 ldi r30, 0x09 ; 9 1e81a: 8e 0e add r8, r30 1e81c: 91 1c adc r9, r1 1e81e: 76 14 cp r7, r6 1e820: d1 f0 breq .+52 ; 0x1e856 #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); 1e822: 48 e0 ldi r20, 0x08 ; 8 1e824: 50 e0 ldi r21, 0x00 ; 0 1e826: b5 01 movw r22, r10 1e828: 8e 5a subi r24, 0xAE ; 174 1e82a: 9f 4f sbci r25, 0xFF ; 255 1e82c: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 1e830: 73 94 inc r7 1e832: f8 e0 ldi r31, 0x08 ; 8 1e834: af 0e add r10, r31 1e836: b1 1c adc r11, r1 1e838: c4 01 movw r24, r8 1e83a: ed cf rjmp .-38 ; 0x1e816 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e83c: c5 01 movw r24, r10 1e83e: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 1e842: ff ef ldi r31, 0xFF ; 255 1e844: af 1a sub r10, r31 1e846: 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++) { 1e848: 2d e9 ldi r18, 0x9D ; 157 1e84a: a2 16 cp r10, r18 1e84c: 2f e0 ldi r18, 0x0F ; 15 1e84e: b2 06 cpc r11, r18 1e850: 09 f0 breq .+2 ; 0x1e854 1e852: a1 cf rjmp .-190 ; 0x1e796 1e854: ac cf rjmp .-168 ; 0x1e7ae /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1e856: 61 e0 ldi r22, 0x01 ; 1 1e858: c7 01 movw r24, r14 1e85a: 0f 94 86 80 call 0x3010c ; 0x3010c } uint32_t CardReader::getFileSize() { return filesize; 1e85e: 40 90 9d 17 lds r4, 0x179D ; 0x80179d 1e862: 50 90 9e 17 lds r5, 0x179E ; 0x80179e 1e866: 60 90 9f 17 lds r6, 0x179F ; 0x80179f 1e86a: 70 90 a0 17 lds r7, 0x17A0 ; 0x8017a0 bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 1e86e: 94 2d mov r25, r4 1e870: 85 2d mov r24, r5 1e872: 21 e0 ldi r18, 0x01 ; 1 1e874: 42 16 cp r4, r18 1e876: 28 e7 ldi r18, 0x78 ; 120 1e878: 52 06 cpc r5, r18 1e87a: 61 04 cpc r6, r1 1e87c: 71 04 cpc r7, r1 1e87e: 10 f0 brcs .+4 ; 0x1e884 1e880: 90 e0 ldi r25, 0x00 ; 0 1e882: 88 e7 ldi r24, 0x78 ; 120 1e884: a9 2e mov r10, r25 1e886: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1e888: 81 e0 ldi r24, 0x01 ; 1 1e88a: 48 16 cp r4, r24 1e88c: 88 e7 ldi r24, 0x78 ; 120 1e88e: 58 06 cpc r5, r24 1e890: 61 04 cpc r6, r1 1e892: 71 04 cpc r7, r1 1e894: 08 f4 brcc .+2 ; 0x1e898 1e896: 5d c0 rjmp .+186 ; 0x1e952 startPos = filesize - END_FILE_SECTION; 1e898: 98 e7 ldi r25, 0x78 ; 120 1e89a: 59 1a sub r5, r25 1e89c: 61 08 sbc r6, r1 1e89e: 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);}; 1e8a0: 40 92 a4 17 sts 0x17A4, r4 ; 0x8017a4 1e8a4: 50 92 a5 17 sts 0x17A5, r5 ; 0x8017a5 1e8a8: 60 92 a6 17 sts 0x17A6, r6 ; 0x8017a6 1e8ac: 70 92 a7 17 sts 0x17A7, r7 ; 0x8017a7 1e8b0: c3 01 movw r24, r6 1e8b2: b2 01 movw r22, r4 1e8b4: 0f 94 d7 76 call 0x2edae ; 0x2edae card.setIndex(startPos); } cmdqueue_reset(); 1e8b8: 0e 94 c4 7e call 0xfd88 ; 0xfd88 cmdqueue_serial_disabled = true; 1e8bc: 00 93 a6 03 sts 0x03A6, r16 ; 0x8003a6 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1e8c0: 8d e0 ldi r24, 0x0D ; 13 1e8c2: 98 e4 ldi r25, 0x48 ; 72 1e8c4: 0e 94 2c 72 call 0xe458 ; 0xe458 1e8c8: bc 01 movw r22, r24 1e8ca: c5 01 movw r24, r10 1e8cc: 0f 94 30 d0 call 0x3a060 ; 0x3a060 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; } 1e8d0: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 1e8d4: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 1e8d8: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 1e8dc: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 while (!card.eof() && !result) { 1e8e0: 40 91 9d 17 lds r20, 0x179D ; 0x80179d 1e8e4: 50 91 9e 17 lds r21, 0x179E ; 0x80179e 1e8e8: 60 91 9f 17 lds r22, 0x179F ; 0x80179f 1e8ec: 70 91 a0 17 lds r23, 0x17A0 ; 0x8017a0 1e8f0: 84 17 cp r24, r20 1e8f2: 95 07 cpc r25, r21 1e8f4: a6 07 cpc r26, r22 1e8f6: b7 07 cpc r27, r23 1e8f8: 80 f5 brcc .+96 ; 0x1e95a 1e8fa: 11 11 cpse r17, r1 1e8fc: 2e c0 rjmp .+92 ; 0x1e95a 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); }; 1e8fe: 20 91 23 17 lds r18, 0x1723 ; 0x801723 1e902: 21 11 cpse r18, r1 1e904: 03 c0 rjmp .+6 ; 0x1e90c 1e906: 80 e0 ldi r24, 0x00 ; 0 1e908: 90 e0 ldi r25, 0x00 ; 0 1e90a: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1e90c: 84 19 sub r24, r4 1e90e: 95 09 sbc r25, r5 1e910: 0f 94 01 d0 call 0x3a002 ; 0x3a002 card.sdprinting = true; 1e914: 00 93 90 14 sts 0x1490, r16 ; 0x801490 get_command(); 1e918: 0e 94 a0 82 call 0x10540 ; 0x10540 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1e91c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 1e920: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 1e924: 89 2b or r24, r25 1e926: a1 f2 breq .-88 ; 0x1e8d0 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1e928: 82 ea ldi r24, 0xA2 ; 162 1e92a: 9a e6 ldi r25, 0x6A ; 106 1e92c: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 1e930: 81 11 cpse r24, r1 1e932: 05 c0 rjmp .+10 ; 0x1e93e 1e934: 8b e6 ldi r24, 0x6B ; 107 1e936: 99 e8 ldi r25, 0x89 ; 137 1e938: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 1e93c: 81 11 cpse r24, r1 1e93e: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1e940: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 1e944: 81 11 cpse r24, r1 1e946: 02 c0 rjmp .+4 ; 0x1e94c cmdqueue_pop_front(); 1e948: 0e 94 3c 76 call 0xec78 ; 0xec78 cmdbuffer_front_already_processed = false; 1e94c: 10 92 a2 10 sts 0x10A2, r1 ; 0x8010a2 1e950: e5 cf rjmp .-54 ; 0x1e91c 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; 1e952: 41 2c mov r4, r1 1e954: 51 2c mov r5, r1 1e956: 32 01 movw r6, r4 1e958: af cf rjmp .-162 ; 0x1e8b8 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1e95a: 0f 94 22 d0 call 0x3a044 ; 0x3a044 cmdqueue_serial_disabled = false; 1e95e: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 card.printingHasFinished(); 1e962: 0f 94 be 81 call 0x3037c ; 0x3037c lcd_setstatuspgm(MSG_WELCOME); 1e966: 8f ec ldi r24, 0xCF ; 207 1e968: 9f e6 ldi r25, 0x6F ; 111 1e96a: 0e 94 3b f2 call 0x1e476 ; 0x1e476 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)) { 1e96e: 11 23 and r17, r17 1e970: 91 f0 breq .+36 ; 0x1e996 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); 1e972: ff 92 push r15 1e974: ef 92 push r14 1e976: 3f 92 push r3 1e978: 2f 92 push r2 1e97a: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommand_P(MSG_M24); 1e97e: 61 e0 ldi r22, 0x01 ; 1 1e980: 8c e4 ldi r24, 0x4C ; 76 1e982: 90 e7 ldi r25, 0x70 ; 112 1e984: 0e 94 a0 87 call 0x10f40 ; 0x10f40 1e988: 0f 90 pop r0 1e98a: 0f 90 pop r0 1e98c: 0f 90 pop r0 1e98e: 0f 90 pop r0 } lcd_return_to_status(); 1e990: 0f 94 ab 1f call 0x23f56 ; 0x23f56 1e994: 9b ce rjmp .-714 ; 0x1e6cc 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); 1e996: 8d e1 ldi r24, 0x1D ; 29 1e998: 98 e4 ldi r25, 0x48 ; 72 1e99a: 0e 94 2c 72 call 0xe458 ; 0xe458 1e99e: 41 e0 ldi r20, 0x01 ; 1 1e9a0: 60 e0 ldi r22, 0x00 ; 0 1e9a2: 0f 94 45 50 call 0x2a08a ; 0x2a08a 1e9a6: 18 2f mov r17, r24 lcd_update_enable(true); 1e9a8: 81 e0 ldi r24, 0x01 ; 1 1e9aa: 0e 94 a5 6e call 0xdd4a ; 0xdd4a } if (result) { 1e9ae: 11 23 and r17, r17 1e9b0: 01 f3 breq .-64 ; 0x1e972 1e9b2: ee cf rjmp .-36 ; 0x1e990 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1e9b4: 8f 5f subi r24, 0xFF ; 255 1e9b6: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1e9ba: 22 ce rjmp .-956 ; 0x1e600 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1e9bc: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 _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(); 1e9c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e9c4: 8f 5f subi r24, 0xFF ; 255 1e9c6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e9ca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e9ce: 8f 5f subi r24, 0xFF ; 255 1e9d0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e9d4: e7 cd rjmp .-1074 ; 0x1e5a4 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. 1e9d6: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1e9da: 11 e0 ldi r17, 0x01 ; 1 1e9dc: 81 11 cpse r24, r1 1e9de: 05 c0 rjmp .+10 ; 0x1e9ea 1e9e0: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e9e4: 81 11 cpse r24, r1 1e9e6: 01 c0 rjmp .+2 ; 0x1e9ea 1e9e8: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1e9ea: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 1e9ee: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 1e9f2: 89 2b or r24, r25 1e9f4: 91 f4 brne .+36 ; 0x1ea1a { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1e9f6: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 1e9fa: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 1e9fe: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 1ea02: 0f 94 3b 86 call 0x30c76 ; 0x30c76 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1ea06: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 1ea0a: 81 11 cpse r24, r1 1ea0c: 46 c0 rjmp .+140 ; 0x1ea9a 1ea0e: 82 e9 ldi r24, 0x92 ; 146 1ea10: 94 e1 ldi r25, 0x14 ; 20 1ea12: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 1ea16: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac } if (rewindFlag) 1ea1a: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1ea1c: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1ea20: 6c e2 ldi r22, 0x2C ; 44 1ea22: 71 e0 ldi r23, 0x01 ; 1 1ea24: 84 eb ldi r24, 0xB4 ; 180 1ea26: 93 e0 ldi r25, 0x03 ; 3 1ea28: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 1ea2c: 81 11 cpse r24, r1 1ea2e: 03 c0 rjmp .+6 ; 0x1ea36 1ea30: 11 23 and r17, r17 1ea32: 09 f4 brne .+2 ; 0x1ea36 1ea34: 54 ce rjmp .-856 ; 0x1e6de { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1ea36: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1ea3a: 02 e1 ldi r16, 0x12 ; 18 1ea3c: 81 11 cpse r24, r1 1ea3e: 01 c0 rjmp .+2 ; 0x1ea42 1ea40: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1ea42: 4e e3 ldi r20, 0x3E ; 62 1ea44: 60 91 b2 03 lds r22, 0x03B2 ; 0x8003b2 1ea48: 80 e0 ldi r24, 0x00 ; 0 1ea4a: 0e 94 80 6e call 0xdd00 ; 0xdd00 if (_md->isDir) 1ea4e: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1ea52: 88 23 and r24, r24 1ea54: 19 f0 breq .+6 ; 0x1ea5c } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1ea56: 85 e8 ldi r24, 0x85 ; 133 1ea58: 0e 94 0f 6f call 0xde1e ; 0xde1e lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1ea5c: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 1ea60: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 1ea64: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 1ea68: 60 2f mov r22, r16 1ea6a: 82 0f add r24, r18 1ea6c: 91 1d adc r25, r1 1ea6e: 0e 94 4f 70 call 0xe09e ; 0xe09e 1ea72: 81 11 cpse r24, r1 1ea74: 15 c0 rjmp .+42 ; 0x1eaa0 { _md->lcd_scrollTimer.start(); 1ea76: 84 eb ldi r24, 0xB4 ; 180 1ea78: 93 e0 ldi r25, 0x03 ; 3 1ea7a: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> _md->offset++; 1ea7e: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1ea82: 8f 5f subi r24, 0xFF ; 255 1ea84: 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. 1ea88: 11 23 and r17, r17 1ea8a: 09 f4 brne .+2 ; 0x1ea8e 1ea8c: 28 ce rjmp .-944 ; 0x1e6de 1ea8e: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1ea92: 81 e0 ldi r24, 0x01 ; 1 1ea94: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 1ea98: 22 ce rjmp .-956 ; 0x1e6de #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; 1ea9a: 87 ea ldi r24, 0xA7 ; 167 1ea9c: 94 e1 ldi r25, 0x14 ; 20 1ea9e: b9 cf rjmp .-142 ; 0x1ea12 1eaa0: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 1eaa4: f1 cf rjmp .-30 ; 0x1ea88 0001eaa6 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1eaa6: 61 e0 ldi r22, 0x01 ; 1 1eaa8: 87 e4 ldi r24, 0x47 ; 71 1eaaa: 90 e7 ldi r25, 0x70 ; 112 1eaac: 0e 94 a0 87 call 0x10f40 ; 0x10f40 custom_message_type = CustomMsg::FilamentLoading; //just print status message 1eab0: 82 e0 ldi r24, 0x02 ; 2 1eab2: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1eab6: 89 e9 ldi r24, 0x99 ; 153 1eab8: 92 e5 ldi r25, 0x52 ; 82 1eaba: 0e 94 2c 72 call 0xe458 ; 0xe458 1eabe: 0e 94 3b f2 call 0x1e476 ; 0x1e476 lcd_return_to_status(); 1eac2: 0f 94 ab 1f call 0x23f56 ; 0x23f56 lcd_draw_update = 3; 1eac6: 83 e0 ldi r24, 0x03 ; 3 1eac8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 1eacc: 08 95 ret 0001eace : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1eace: cf 93 push r28 1ead0: df 93 push r29 1ead2: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1ead4: 80 e0 ldi r24, 0x00 ; 0 1ead6: 0e 94 e5 f1 call 0x1e3ca ; 0x1e3ca 1eada: 88 23 and r24, r24 1eadc: 31 f0 breq .+12 ; 0x1eaea lcd_updatestatus(message); 1eade: 60 e0 ldi r22, 0x00 ; 0 1eae0: ce 01 movw r24, r28 } 1eae2: df 91 pop r29 1eae4: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1eae6: 0c 94 ca f1 jmp 0x1e394 ; 0x1e394 } 1eaea: df 91 pop r29 1eaec: cf 91 pop r28 1eaee: 08 95 ret 0001eaf0 : 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) { 1eaf0: cf 93 push r28 1eaf2: df 93 push r29 1eaf4: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1eaf6: 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) { 1eaf8: 66 23 and r22, r22 1eafa: d9 f1 breq .+118 ; 0x1eb72 1eafc: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1eafe: 0f 94 1d 30 call 0x2603a ; 0x2603a cancel_heatup = true; 1eb02: 81 e0 ldi r24, 0x01 ; 1 1eb04: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.410> heating_status = HeatingStatus::NO_HEATING; 1eb08: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // Clear any saved printing state cancel_saved_printing(); 1eb0c: 0e 94 2d 64 call 0xc85a ; 0xc85a // Abort the planner planner_abort_hard(); 1eb10: 0f 94 fb c1 call 0x383f6 ; 0x383f6 // Reset the queue cmdqueue_reset(); 1eb14: 0e 94 c4 7e call 0xfd88 ; 0xfd88 cmdqueue_serial_disabled = false; 1eb18: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 1eb1c: 0f 94 47 44 call 0x2888e ; 0x2888e CRITICAL_SECTION_END; 1eb20: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1eb22: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 print_job_timer.stop(); 1eb26: 0f 94 b6 43 call 0x2876c ; 0x2876c } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1eb2a: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1eb2e: 88 23 and r24, r24 1eb30: 71 f0 breq .+28 ; 0x1eb4e // Reset the sd status card.sdprinting = false; 1eb32: 10 92 90 14 sts 0x1490, r1 ; 0x801490 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 1eb36: 80 e2 ldi r24, 0x20 ; 32 1eb38: 97 e1 ldi r25, 0x17 ; 23 1eb3a: 0f 94 76 59 call 0x2b2ec ; 0x2b2ec file.close(); 1eb3e: 80 e2 ldi r24, 0x20 ; 32 1eb40: 97 e1 ldi r25, 0x17 ; 23 1eb42: 0f 94 ab 59 call 0x2b356 ; 0x2b356 saving = false; 1eb46: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 1eb4a: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1eb4e: 82 e9 ldi r24, 0x92 ; 146 1eb50: 9a e6 ldi r25, 0x6A ; 106 1eb52: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 #ifdef MESH_BED_LEVELING mbl.active = false; 1eb56: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 #endif if (interactive) { 1eb5a: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1eb5c: 10 92 11 05 sts 0x0511, r1 ; 0x800511 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 1eb60: 81 e0 ldi r24, 0x01 ; 1 1eb62: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1eb66: 10 92 b8 0d sts 0x0DB8, r1 ; 0x800db8 <_ZL13printer_state.lto_priv.403> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 1eb6a: df 91 pop r29 1eb6c: 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(); 1eb6e: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 } void ConditionalStop() { CRITICAL_SECTION_START; 1eb72: 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; 1eb74: 81 e0 ldi r24, 0x01 ; 1 1eb76: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.410> heating_status = HeatingStatus::NO_HEATING; 1eb7a: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // Clear any saved printing state cancel_saved_printing(); 1eb7e: 0e 94 2d 64 call 0xc85a ; 0xc85a // Abort the planner planner_abort_hard(); 1eb82: 0f 94 fb c1 call 0x383f6 ; 0x383f6 // Reset the queue cmdqueue_reset(); 1eb86: 0e 94 c4 7e call 0xfd88 ; 0xfd88 cmdqueue_serial_disabled = false; 1eb8a: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 1eb8e: 0f 94 47 44 call 0x2888e ; 0x2888e CRITICAL_SECTION_END; 1eb92: df bf out 0x3f, r29 ; 63 1eb94: ca cf rjmp .-108 ; 0x1eb2a 0001eb96 : } void lcd_print_stop() { print_stop(true); 1eb96: 60 e0 ldi r22, 0x00 ; 0 1eb98: 81 e0 ldi r24, 0x01 ; 1 1eb9a: 0c 94 78 f5 jmp 0x1eaf0 ; 0x1eaf0 0001eb9e : oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); } static void render_M862_warnings(const char* warning, const char* strict, uint8_t check) { if (check == 1) { // Warning, stop print if user selects 'No' 1eb9e: 41 30 cpi r20, 0x01 ; 1 1eba0: 41 f4 brne .+16 ; 0x1ebb2 if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1eba2: 40 e0 ldi r20, 0x00 ; 0 1eba4: 61 e0 ldi r22, 0x01 ; 1 1eba6: 0f 94 45 50 call 0x2a08a ; 0x2a08a 1ebaa: 81 30 cpi r24, 0x01 ; 1 1ebac: 41 f4 brne .+16 ; 0x1ebbe lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1ebae: 0c 94 cb f5 jmp 0x1eb96 ; 0x1eb96 { 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 1ebb2: 42 30 cpi r20, 0x02 ; 2 1ebb4: 21 f4 brne .+8 ; 0x1ebbe lcd_show_fullscreen_message_and_wait_P(strict); 1ebb6: cb 01 movw r24, r22 1ebb8: 0f 94 f6 20 call 0x241ec ; 0x241ec 1ebbc: f8 cf rjmp .-16 ; 0x1ebae lcd_print_stop(); } } 1ebbe: 08 95 ret 0001ebc0 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1ebc0: 0f 93 push r16 1ebc2: 1f 93 push r17 1ebc4: 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)) { 1ebc6: 8c ea ldi r24, 0xAC ; 172 1ebc8: 9c e0 ldi r25, 0x0C ; 12 1ebca: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1ebce: 81 11 cpse r24, r1 1ebd0: 23 c0 rjmp .+70 ; 0x1ec18 goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 1ebd2: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1ebd6: 88 23 and r24, r24 1ebd8: f9 f0 breq .+62 ; 0x1ec18 1ebda: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ebde: 81 11 cpse r24, r1 1ebe0: 1b c0 rjmp .+54 ; 0x1ec18 if (oCheckFilament == ClCheckMode::_None) { 1ebe2: c0 91 e7 04 lds r28, 0x04E7 ; 0x8004e7 1ebe6: cc 23 and r28, r28 1ebe8: b9 f0 breq .+46 ; 0x1ec18 goto done; } render_M862_warnings( 1ebea: 8b e5 ldi r24, 0x5B ; 91 1ebec: 9a e4 ldi r25, 0x4A ; 74 1ebee: 0e 94 2c 72 call 0xe458 ; 0xe458 1ebf2: 8c 01 movw r16, r24 1ebf4: 8b e5 ldi r24, 0x5B ; 91 1ebf6: 9a e4 ldi r25, 0x4A ; 74 1ebf8: 0e 94 2c 72 call 0xe458 ; 0xe458 1ebfc: 4c 2f mov r20, r28 1ebfe: b8 01 movw r22, r16 1ec00: 0e 94 cf f5 call 0x1eb9e ; 0x1eb9e _T(MSG_MISSING_FILAMENT) ,_T(MSG_MISSING_FILAMENT) //Identical messages ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1ec04: 81 e0 ldi r24, 0x01 ; 1 1ec06: 90 91 b4 0d lds r25, 0x0DB4 ; 0x800db4 1ec0a: 91 30 cpi r25, 0x01 ; 1 1ec0c: 09 f4 brne .+2 ; 0x1ec10 1ec0e: 80 e0 ldi r24, 0x00 ; 0 } } done: return true; } 1ec10: cf 91 pop r28 1ec12: 1f 91 pop r17 1ec14: 0f 91 pop r16 1ec16: 08 95 ret return false; } } done: return true; 1ec18: 81 e0 ldi r24, 0x01 ; 1 1ec1a: fa cf rjmp .-12 ; 0x1ec10 0001ec1c : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1ec1c: 1f 93 push r17 1ec1e: cf 93 push r28 1ec20: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1ec22: 10 91 ec 04 lds r17, 0x04EC ; 0x8004ec 1ec26: 11 23 and r17, r17 1ec28: f9 f0 breq .+62 ; 0x1ec68 1ec2a: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1ec2c: 85 ea ldi r24, 0xA5 ; 165 1ec2e: 9d e0 ldi r25, 0x0D ; 13 1ec30: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 if (nDiameter == nDiameter_um) 1ec34: 8c 17 cp r24, r28 1ec36: 9d 07 cpc r25, r29 1ec38: b9 f0 breq .+46 ; 0x1ec68 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1ec3a: 8c e0 ldi r24, 0x0C ; 12 1ec3c: 9a e4 ldi r25, 0x4A ; 74 1ec3e: 0e 94 2c 72 call 0xe458 ; 0xe458 1ec42: ec 01 movw r28, r24 1ec44: 81 ee ldi r24, 0xE1 ; 225 1ec46: 99 e4 ldi r25, 0x49 ; 73 1ec48: 0e 94 2c 72 call 0xe458 ; 0xe458 1ec4c: 41 2f mov r20, r17 1ec4e: be 01 movw r22, r28 1ec50: 0e 94 cf f5 call 0x1eb9e ; 0x1eb9e ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1ec54: 10 92 fc 03 sts 0x03FC, r1 ; 0x8003fc menu_submenu(lcd_hw_setup_menu); 1ec58: 60 e0 ldi r22, 0x00 ; 0 1ec5a: 89 e9 ldi r24, 0x99 ; 153 1ec5c: 92 ed ldi r25, 0xD2 ; 210 } } 1ec5e: df 91 pop r29 1ec60: cf 91 pop r28 1ec62: 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); 1ec64: 0d 94 3b d3 jmp 0x3a676 ; 0x3a676 } } 1ec68: df 91 pop r29 1ec6a: cf 91 pop r28 1ec6c: 1f 91 pop r17 1ec6e: 08 95 ret 0001ec70 : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1ec70: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1ec74: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 #endif manage_heater(); 1ec78: 0d 94 61 39 jmp 0x272c2 ; 0x272c2 0001ec7c : { (void)lcd_selftest(); } bool lcd_selftest() { 1ec7c: cf 92 push r12 1ec7e: df 92 push r13 1ec80: ef 92 push r14 1ec82: ff 92 push r15 1ec84: 0f 93 push r16 1ec86: 1f 93 push r17 1ec88: cf 93 push r28 1ec8a: df 93 push r29 1ec8c: 00 d0 rcall .+0 ; 0x1ec8e 1ec8e: 1f 92 push r1 1ec90: cd b7 in r28, 0x3d ; 61 1ec92: de b7 in r29, 0x3e ; 62 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(); 1ec94: 0f 94 1d 30 call 0x2603a ; 0x2603a uint8_t fanSpeedBckp = fanSpeed; 1ec98: d0 90 e7 03 lds r13, 0x03E7 ; 0x8003e7 fanSpeed = 255; 1ec9c: 8f ef ldi r24, 0xFF ; 255 1ec9e: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 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)); 1eca2: 84 e9 ldi r24, 0x94 ; 148 1eca4: e8 2e mov r14, r24 1eca6: 89 e8 ldi r24, 0x89 ; 137 1eca8: 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()); 1ecaa: 0e e8 ldi r16, 0x8E ; 142 1ecac: 19 e8 ldi r17, 0x89 ; 137 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)) { 1ecae: 20 e0 ldi r18, 0x00 ; 0 1ecb0: 30 e0 ldi r19, 0x00 ; 0 1ecb2: 48 e4 ldi r20, 0x48 ; 72 1ecb4: 52 e4 ldi r21, 0x42 ; 66 1ecb6: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1ecba: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1ecbe: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1ecc2: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1ecc6: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1ecca: 18 16 cp r1, r24 1eccc: 8c f0 brlt .+34 ; 0x1ecf0 1ecce: 20 e0 ldi r18, 0x00 ; 0 1ecd0: 30 e0 ldi r19, 0x00 ; 0 1ecd2: 48 e4 ldi r20, 0x48 ; 72 1ecd4: 52 e4 ldi r21, 0x42 ; 66 1ecd6: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1ecda: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1ecde: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1ece2: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1ece6: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1ecea: 18 16 cp r1, r24 1ecec: 0c f0 brlt .+2 ; 0x1ecf0 1ecee: 42 c0 rjmp .+132 ; 0x1ed74 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1ecf0: 82 e4 ldi r24, 0x42 ; 66 1ecf2: 98 e4 ldi r25, 0x48 ; 72 1ecf4: 0e 94 2c 72 call 0xe458 ; 0xe458 1ecf8: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1ecfc: 42 e8 ldi r20, 0x82 ; 130 1ecfe: 64 e0 ldi r22, 0x04 ; 4 1ed00: 80 e0 ldi r24, 0x00 ; 0 1ed02: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1ed06: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1ed0a: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1ed0e: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1ed12: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1ed16: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1ed1a: 7f 93 push r23 1ed1c: 6f 93 push r22 1ed1e: ff 92 push r15 1ed20: ef 92 push r14 1ed22: 0e 94 39 6e call 0xdc72 ; 0xdc72 lcd_putc(LCD_STR_DEGREE[0]); 1ed26: 81 e8 ldi r24, 0x81 ; 129 1ed28: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1ed2c: 40 e8 ldi r20, 0x80 ; 128 1ed2e: 64 e0 ldi r22, 0x04 ; 4 1ed30: 89 e0 ldi r24, 0x09 ; 9 1ed32: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1ed36: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1ed3a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1ed3e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1ed42: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1ed46: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 1ed4a: 7f 93 push r23 1ed4c: 6f 93 push r22 1ed4e: 1f 93 push r17 1ed50: 0f 93 push r16 1ed52: 0e 94 39 6e call 0xdc72 ; 0xdc72 lcd_putc(LCD_STR_DEGREE[0]); 1ed56: 81 e8 ldi r24, 0x81 ; 129 1ed58: 0e 94 4f 6e call 0xdc9e ; 0xdc9e delay_keep_alive(1000); 1ed5c: 88 ee ldi r24, 0xE8 ; 232 1ed5e: 93 e0 ldi r25, 0x03 ; 3 1ed60: 0e 94 6c 8c call 0x118d8 ; 0x118d8 serialecho_temperatures(); 1ed64: 0e 94 de 76 call 0xedbc ; 0xedbc 1ed68: 0f b6 in r0, 0x3f ; 63 1ed6a: f8 94 cli 1ed6c: de bf out 0x3e, r29 ; 62 1ed6e: 0f be out 0x3f, r0 ; 63 1ed70: cd bf out 0x3d, r28 ; 61 1ed72: 9d cf rjmp .-198 ; 0x1ecae } fanSpeed = fanSpeedBckp; 1ed74: d0 92 e7 03 sts 0x03E7, r13 ; 0x8003e7 lcd_update_enable(true); 1ed78: 81 e0 ldi r24, 0x01 ; 1 1ed7a: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1ed7e: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1ed82: 85 e7 ldi r24, 0x75 ; 117 1ed84: 98 e4 ldi r25, 0x48 ; 72 1ed86: 0e 94 2c 72 call 0xe458 ; 0xe458 1ed8a: ac 01 movw r20, r24 1ed8c: 60 e0 ldi r22, 0x00 ; 0 1ed8e: 80 e0 ldi r24, 0x00 ; 0 1ed90: 0e 94 74 6e call 0xdce8 ; 0xdce8 #ifdef TMC2130 FORCE_HIGH_POWER_START; 1ed94: 81 e0 ldi r24, 0x01 ; 1 1ed96: 0e 94 30 66 call 0xcc60 ; 0xcc60 #endif // TMC2130 FORCE_BL_ON_START; 1ed9a: 81 e0 ldi r24, 0x01 ; 1 1ed9c: 0e 94 d1 89 call 0x113a2 ; 0x113a2 _delay(2000); 1eda0: 60 ed ldi r22, 0xD0 ; 208 1eda2: 77 e0 ldi r23, 0x07 ; 7 1eda4: 80 e0 ldi r24, 0x00 ; 0 1eda6: 90 e0 ldi r25, 0x00 ; 0 1eda8: 0f 94 58 28 call 0x250b0 ; 0x250b0 KEEPALIVE_STATE(IN_HANDLER); 1edac: 82 e0 ldi r24, 0x02 ; 2 1edae: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1edb2: 00 ed ldi r16, 0xD0 ; 208 1edb4: 17 e0 ldi r17, 0x07 ; 7 1edb6: 21 e0 ldi r18, 0x01 ; 1 1edb8: 43 e0 ldi r20, 0x03 ; 3 1edba: 60 e0 ldi r22, 0x00 ; 0 1edbc: 80 e0 ldi r24, 0x00 ; 0 1edbe: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1edc2: 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 1edc4: 83 e0 ldi r24, 0x03 ; 3 1edc6: 0e 94 db 74 call 0xe9b6 ; 0xe9b6 lcd_selftest_setfan(0); // print fan off 1edca: 80 e0 ldi r24, 0x00 ; 0 1edcc: 0e 94 38 f6 call 0x1ec70 ; 0x1ec70 lcd_selftest_measure_fans(2, 18, 2); 1edd0: 62 e0 ldi r22, 0x02 ; 2 1edd2: 82 e0 ldi r24, 0x02 ; 2 1edd4: 0f 94 21 a1 call 0x34242 ; 0x34242 setExtruderAutoFanState(0); // hotend fan off 1edd8: 80 e0 ldi r24, 0x00 ; 0 1edda: 0e 94 db 74 call 0xe9b6 ; 0xe9b6 if (fan_speed[0] < failThr) { 1edde: c0 90 c9 03 lds r12, 0x03C9 ; 0x8003c9 1ede2: d0 90 ca 03 lds r13, 0x03CA ; 0x8003ca 1ede6: 94 e1 ldi r25, 0x14 ; 20 1ede8: c9 16 cp r12, r25 1edea: d1 04 cpc r13, r1 1edec: 5c f1 brlt .+86 ; 0x1ee44 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1edee: 21 e0 ldi r18, 0x01 ; 1 1edf0: 43 e0 ldi r20, 0x03 ; 3 1edf2: 6f 2d mov r22, r15 1edf4: 81 e0 ldi r24, 0x01 ; 1 1edf6: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1edfa: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 1edfc: 8f ef ldi r24, 0xFF ; 255 1edfe: 0e 94 38 f6 call 0x1ec70 ; 0x1ec70 lcd_selftest_measure_fans(5, 18, 3); 1ee02: 63 e0 ldi r22, 0x03 ; 3 1ee04: 85 e0 ldi r24, 0x05 ; 5 1ee06: 0f 94 21 a1 call 0x34242 ; 0x34242 lcd_selftest_setfan(0); 1ee0a: 80 e0 ldi r24, 0x00 ; 0 1ee0c: 0e 94 38 f6 call 0x1ec70 ; 0x1ec70 if (fan_speed[1] < failThr) { 1ee10: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 1ee14: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc 1ee18: 84 31 cpi r24, 0x14 ; 20 1ee1a: 91 05 cpc r25, r1 1ee1c: cc f4 brge .+50 ; 0x1ee50 #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 1ee1e: 68 ef ldi r22, 0xF8 ; 248 1ee20: 72 e0 ldi r23, 0x02 ; 2 1ee22: 85 e0 ldi r24, 0x05 ; 5 1ee24: 0f 94 a6 9f call 0x33f4c ; 0x33f4c } } if (_swapped_fan) { 1ee28: 96 e4 ldi r25, 0x46 ; 70 1ee2a: c9 16 cp r12, r25 1ee2c: d1 04 cpc r13, r1 1ee2e: 9c f4 brge .+38 ; 0x1ee56 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1ee30: 08 e8 ldi r16, 0x88 ; 136 1ee32: 13 e1 ldi r17, 0x13 ; 19 1ee34: 21 e0 ldi r18, 0x01 ; 1 1ee36: 43 e0 ldi r20, 0x03 ; 3 1ee38: 6f 2d mov r22, r15 1ee3a: 8d e0 ldi r24, 0x0D ; 13 1ee3c: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1ee40: e1 2c mov r14, r1 1ee42: 49 c1 rjmp .+658 ; 0x1f0d6 #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1ee44: 68 ef ldi r22, 0xF8 ; 248 1ee46: 72 e0 ldi r23, 0x02 ; 2 1ee48: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ee4a: 0f 94 a6 9f call 0x33f4c ; 0x33f4c 1ee4e: f0 cf rjmp .-32 ; 0x1ee30 lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 1ee50: 86 34 cpi r24, 0x46 ; 70 1ee52: 91 05 cpc r25, r1 1ee54: 54 f4 brge .+20 ; 0x1ee6a } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1ee56: 60 e0 ldi r22, 0x00 ; 0 1ee58: 81 e0 ldi r24, 0x01 ; 1 1ee5a: 0f 94 93 a0 call 0x34126 ; 0x34126 if (_result) { 1ee5e: 81 11 cpse r24, r1 1ee60: 68 c1 rjmp .+720 ; 0x1f132 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ee62: 68 ef ldi r22, 0xF8 ; 248 1ee64: 72 e0 ldi r23, 0x02 ; 2 1ee66: 89 e0 ldi r24, 0x09 ; 9 1ee68: f0 cf rjmp .-32 ; 0x1ee4a { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1ee6a: 86 e4 ldi r24, 0x46 ; 70 1ee6c: c8 16 cp r12, r24 1ee6e: d1 04 cpc r13, r1 1ee70: 94 f7 brge .-28 ; 0x1ee56 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1ee72: 00 ed ldi r16, 0xD0 ; 208 1ee74: 17 e0 ldi r17, 0x07 ; 7 1ee76: 21 e0 ldi r18, 0x01 ; 1 1ee78: 43 e0 ldi r20, 0x03 ; 3 1ee7a: 6f 2d mov r22, r15 1ee7c: 82 e0 ldi r24, 0x02 ; 2 1ee7e: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1ee82: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 1ee84: 1c 9b sbis 0x03, 4 ; 3 1ee86: 18 c0 rjmp .+48 ; 0x1eeb8 { #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; 1ee88: 1c 9b sbis 0x03, 4 ; 3 1ee8a: 16 c0 rjmp .+44 ; 0x1eeb8 1ee8c: 20 e0 ldi r18, 0x00 ; 0 1ee8e: 30 e0 ldi r19, 0x00 ; 0 1ee90: 40 e2 ldi r20, 0x20 ; 32 1ee92: 51 e4 ldi r21, 0x41 ; 65 1ee94: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 1ee98: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 1ee9c: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 1eea0: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 1eea4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1eea8: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 1eeac: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 1eeb0: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 1eeb4: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1eeb8: 60 e0 ldi r22, 0x00 ; 0 1eeba: 70 e0 ldi r23, 0x00 ; 0 1eebc: 84 e3 ldi r24, 0x34 ; 52 1eebe: 92 e4 ldi r25, 0x42 ; 66 1eec0: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1eec4: 0f 94 ed 43 call 0x287da ; 0x287da if ( 1eec8: 1c 9b sbis 0x03, 4 ; 3 1eeca: 3d c1 rjmp .+634 ; 0x1f146 ((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] = ""; 1eecc: 1a 82 std Y+2, r1 ; 0x02 1eece: 19 82 std Y+1, r1 ; 0x01 1eed0: 1c 82 std Y+4, r1 ; 0x04 1eed2: 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"); 1eed4: 1c 9b sbis 0x03, 4 ; 3 1eed6: 06 c0 rjmp .+12 ; 0x1eee4 1eed8: 65 ee ldi r22, 0xE5 ; 229 1eeda: 72 e0 ldi r23, 0x02 ; 2 1eedc: ce 01 movw r24, r28 1eede: 01 96 adiw r24, 0x01 ; 1 1eee0: 0f 94 a0 e2 call 0x3c540 ; 0x3c540 lcd_selftest_error(TestError::Endstops, _error, ""); 1eee4: be 01 movw r22, r28 1eee6: 6f 5f subi r22, 0xFF ; 255 1eee8: 7f 4f sbci r23, 0xFF ; 255 1eeea: 82 e0 ldi r24, 0x02 ; 2 1eeec: 0f 94 a6 9f call 0x33f4c ; 0x33f4c ((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; 1eef0: 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(); 1eef2: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 1eef6: 81 e0 ldi r24, 0x01 ; 1 1eef8: 0e 94 37 8a call 0x1146e ; 0x1146e { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1eefc: 11 23 and r17, r17 1eefe: 09 f4 brne .+2 ; 0x1ef02 1ef00: 97 cf rjmp .-210 ; 0x1ee30 { //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); 1ef02: 00 ed ldi r16, 0xD0 ; 208 1ef04: 17 e0 ldi r17, 0x07 ; 7 1ef06: 21 e0 ldi r18, 0x01 ; 1 1ef08: 43 e0 ldi r20, 0x03 ; 3 1ef0a: 6f 2d mov r22, r15 1ef0c: 84 e0 ldi r24, 0x04 ; 4 1ef0e: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1ef12: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 1ef14: 80 e0 ldi r24, 0x00 ; 0 1ef16: 0e 94 13 de call 0x1bc26 ; 0x1bc26 } if (_result) 1ef1a: 88 23 and r24, r24 1ef1c: 09 f4 brne .+2 ; 0x1ef20 1ef1e: 88 cf rjmp .-240 ; 0x1ee30 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1ef20: 10 e0 ldi r17, 0x00 ; 0 1ef22: 00 e0 ldi r16, 0x00 ; 0 1ef24: 21 e0 ldi r18, 0x01 ; 1 1ef26: 43 e0 ldi r20, 0x03 ; 3 1ef28: 6f 2d mov r22, r15 1ef2a: 84 e0 ldi r24, 0x04 ; 4 1ef2c: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1ef30: 0c ed ldi r16, 0xDC ; 220 1ef32: 15 e0 ldi r17, 0x05 ; 5 1ef34: 21 e0 ldi r18, 0x01 ; 1 1ef36: 43 e0 ldi r20, 0x03 ; 3 1ef38: 68 2f mov r22, r24 1ef3a: 85 e0 ldi r24, 0x05 ; 5 1ef3c: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1ef40: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 1ef42: 81 e0 ldi r24, 0x01 ; 1 1ef44: 0e 94 13 de call 0x1bc26 ; 0x1bc26 #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 1ef48: 88 23 and r24, r24 1ef4a: 09 f4 brne .+2 ; 0x1ef4e 1ef4c: 71 cf rjmp .-286 ; 0x1ee30 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1ef4e: 10 e0 ldi r17, 0x00 ; 0 1ef50: 00 e0 ldi r16, 0x00 ; 0 1ef52: 21 e0 ldi r18, 0x01 ; 1 1ef54: 43 e0 ldi r20, 0x03 ; 3 1ef56: 6f 2d mov r22, r15 1ef58: 86 e0 ldi r24, 0x06 ; 6 1ef5a: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1ef5e: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 1ef60: 0f 94 ae 26 call 0x24d5c ; 0x24d5c 1ef64: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1ef68: ef ee ldi r30, 0xEF ; 239 1ef6a: f4 ea ldi r31, 0xA4 ; 164 1ef6c: 85 91 lpm r24, Z+ 1ef6e: 95 91 lpm r25, Z+ 1ef70: a5 91 lpm r26, Z+ 1ef72: b4 91 lpm r27, Z 1ef74: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1ef78: 90 93 93 06 sts 0x0693, r25 ; 0x800693 1ef7c: a0 93 94 06 sts 0x0694, r26 ; 0x800694 1ef80: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1ef84: e3 ef ldi r30, 0xF3 ; 243 1ef86: f4 ea ldi r31, 0xA4 ; 164 1ef88: 65 91 lpm r22, Z+ 1ef8a: 75 91 lpm r23, Z+ 1ef8c: 85 91 lpm r24, Z+ 1ef8e: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 1ef90: 20 e0 ldi r18, 0x00 ; 0 1ef92: 30 e0 ldi r19, 0x00 ; 0 1ef94: 40 e8 ldi r20, 0x80 ; 128 1ef96: 50 e4 ldi r21, 0x40 ; 64 1ef98: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1ef9c: 60 93 96 06 sts 0x0696, r22 ; 0x800696 1efa0: 70 93 97 06 sts 0x0697, r23 ; 0x800697 1efa4: 80 93 98 06 sts 0x0698, r24 ; 0x800698 1efa8: 90 93 99 06 sts 0x0699, r25 ; 0x800699 #endif //TMC2130 raise_z(10); 1efac: 60 e0 ldi r22, 0x00 ; 0 1efae: 70 e0 ldi r23, 0x00 ; 0 1efb0: 80 e2 ldi r24, 0x20 ; 32 1efb2: 91 e4 ldi r25, 0x41 ; 65 1efb4: 0e 94 61 6d call 0xdac2 ; 0xdac2 set_destination_to_current(); 1efb8: 0e 94 ba 67 call 0xcf74 ; 0xcf74 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1efbc: 0c ed ldi r16, 0xDC ; 220 1efbe: 15 e0 ldi r17, 0x05 ; 5 1efc0: 21 e0 ldi r18, 0x01 ; 1 1efc2: 43 e0 ldi r20, 0x03 ; 3 1efc4: 6f 2d mov r22, r15 1efc6: 86 e0 ldi r24, 0x06 ; 6 1efc8: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 1efcc: 50 e0 ldi r21, 0x00 ; 0 1efce: 40 e0 ldi r20, 0x00 ; 0 1efd0: 61 e0 ldi r22, 0x01 ; 1 1efd2: 82 e0 ldi r24, 0x02 ; 2 1efd4: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 #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); 1efd8: 60 e0 ldi r22, 0x00 ; 0 1efda: 70 e0 ldi r23, 0x00 ; 0 1efdc: 80 ea ldi r24, 0xA0 ; 160 1efde: 91 e4 ldi r25, 0x41 ; 65 1efe0: 0e 94 61 6d call 0xdac2 ; 0xdac2 } #ifdef TMC2130 if (_result) { raise_z(10); 1efe4: 60 e0 ldi r22, 0x00 ; 0 1efe6: 70 e0 ldi r23, 0x00 ; 0 1efe8: 80 e2 ldi r24, 0x20 ; 32 1efea: 91 e4 ldi r25, 0x41 ; 65 1efec: 0e 94 61 6d call 0xdac2 ; 0xdac2 _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 1eff0: 10 e0 ldi r17, 0x00 ; 0 1eff2: 00 e0 ldi r16, 0x00 ; 0 1eff4: 21 e0 ldi r18, 0x01 ; 1 1eff6: 42 e0 ldi r20, 0x02 ; 2 1eff8: 60 e0 ldi r22, 0x00 ; 0 1effa: 8e e0 ldi r24, 0x0E ; 14 1effc: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 bool bres = tmc2130_home_calibrate(X_AXIS); 1f000: 80 e0 ldi r24, 0x00 ; 0 1f002: 0f 94 a0 23 call 0x24740 ; 0x24740 1f006: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 1f008: 21 e0 ldi r18, 0x01 ; 1 1f00a: 42 e0 ldi r20, 0x02 ; 2 1f00c: 61 e0 ldi r22, 0x01 ; 1 1f00e: 8e e0 ldi r24, 0x0E ; 14 1f010: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 bres &= tmc2130_home_calibrate(Y_AXIS); 1f014: 81 e0 ldi r24, 0x01 ; 1 1f016: 0f 94 a0 23 call 0x24740 ; 0x24740 1f01a: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 1f01c: 21 e0 ldi r18, 0x01 ; 1 1f01e: 42 e0 ldi r20, 0x02 ; 2 1f020: 62 e0 ldi r22, 0x02 ; 2 1f022: 8e e0 ldi r24, 0x0E ; 14 1f024: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1f028: f8 2e mov r15, r24 if (bres) 1f02a: ee 20 and r14, r14 1f02c: 09 f4 brne .+2 ; 0x1f030 1f02e: 00 cf rjmp .-512 ; 0x1ee30 1f030: 61 e0 ldi r22, 0x01 ; 1 1f032: 88 ef ldi r24, 0xF8 ; 248 1f034: 9e e0 ldi r25, 0x0E ; 14 1f036: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1f03a: 00 ed ldi r16, 0xD0 ; 208 1f03c: 17 e0 ldi r17, 0x07 ; 7 1f03e: 21 e0 ldi r18, 0x01 ; 1 1f040: 43 e0 ldi r20, 0x03 ; 3 1f042: 6f 2d mov r22, r15 1f044: 87 e0 ldi r24, 0x07 ; 7 1f046: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1f04a: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1f04c: 81 e0 ldi r24, 0x01 ; 1 1f04e: 0e 94 f3 dc call 0x1b9e6 ; 0x1b9e6 } if (_result) 1f052: 88 23 and r24, r24 1f054: 09 f4 brne .+2 ; 0x1f058 1f056: ec ce rjmp .-552 ; 0x1ee30 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1f058: 08 ee ldi r16, 0xE8 ; 232 1f05a: 13 e0 ldi r17, 0x03 ; 3 1f05c: 21 e0 ldi r18, 0x01 ; 1 1f05e: 43 e0 ldi r20, 0x03 ; 3 1f060: 6f 2d mov r22, r15 1f062: 88 e0 ldi r24, 0x08 ; 8 1f064: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1f068: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1f06a: 80 e0 ldi r24, 0x00 ; 0 1f06c: 0e 94 f3 dc call 0x1b9e6 ; 0x1b9e6 1f070: e8 2e mov r14, r24 } if (_result) 1f072: 88 23 and r24, r24 1f074: 09 f4 brne .+2 ; 0x1f078 1f076: dc ce rjmp .-584 ; 0x1ee30 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1f078: 00 ed ldi r16, 0xD0 ; 208 1f07a: 17 e0 ldi r17, 0x07 ; 7 1f07c: 21 e0 ldi r18, 0x01 ; 1 1f07e: 43 e0 ldi r20, 0x03 ; 3 1f080: 6f 2d mov r22, r15 1f082: 89 e0 ldi r24, 0x09 ; 9 1f084: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 } } else #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) { #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 1f088: 21 e0 ldi r18, 0x01 ; 1 1f08a: 43 e0 ldi r20, 0x03 ; 3 1f08c: 68 2f mov r22, r24 1f08e: 8a e0 ldi r24, 0x0A ; 10 1f090: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 1f094: f8 2e mov r15, r24 #ifdef FILAMENT_SENSOR #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static bool lcd_selftest_fsensor(void) { fsensor.init(); 1f096: 0f 94 74 7c call 0x2f8e8 ; 0x2f8e8 if (fsensor.isError()) 1f09a: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1f09e: 83 30 cpi r24, 0x03 ; 3 1f0a0: 29 f4 brne .+10 ; 0x1f0ac { lcd_selftest_error(TestError::WiringFsensor, "", ""); 1f0a2: 68 ef ldi r22, 0xF8 ; 248 1f0a4: 72 e0 ldi r23, 0x02 ; 2 1f0a6: 8a e0 ldi r24, 0x0A ; 10 1f0a8: 0f 94 a6 9f call 0x33f4c ; 0x33f4c #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) { #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor _result = lcd_selftest_fsensor(); if (_result) 1f0ac: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1f0b0: 83 30 cpi r24, 0x03 ; 3 1f0b2: 09 f4 brne .+2 ; 0x1f0b6 1f0b4: bd ce rjmp .-646 ; 0x1ee30 { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 1f0b6: 00 ed ldi r16, 0xD0 ; 208 1f0b8: 17 e0 ldi r17, 0x07 ; 7 1f0ba: 21 e0 ldi r18, 0x01 ; 1 1f0bc: 43 e0 ldi r20, 0x03 ; 3 1f0be: 6f 2d mov r22, r15 1f0c0: 8b e0 ldi r24, 0x0B ; 11 1f0c2: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1f0c6: 08 e8 ldi r16, 0x88 ; 136 1f0c8: 13 e1 ldi r17, 0x13 ; 19 1f0ca: 21 e0 ldi r18, 0x01 ; 1 1f0cc: 43 e0 ldi r20, 0x03 ; 3 1f0ce: 68 2f mov r22, r24 1f0d0: 8c e0 ldi r24, 0x0C ; 12 1f0d2: 0e 94 59 db call 0x1b6b2 ; 0x1b6b2 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f0d6: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 1f0da: 61 e0 ldi r22, 0x01 ; 1 1f0dc: 82 ea ldi r24, 0xA2 ; 162 1f0de: 9a e6 ldi r25, 0x6A ; 106 1f0e0: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_update_enable(true); 1f0e4: 81 e0 ldi r24, 0x01 ; 1 1f0e6: 0e 94 a5 6e call 0xdd4a ; 0xdd4a if (_result) 1f0ea: ee 20 and r14, r14 1f0ec: 71 f1 breq .+92 ; 0x1f14a { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1f0ee: 81 e0 ldi r24, 0x01 ; 1 1f0f0: 0e 94 70 ef call 0x1dee0 ; 0x1dee0 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1f0f4: 87 e6 ldi r24, 0x67 ; 103 1f0f6: 98 e4 ldi r25, 0x48 ; 72 1f0f8: 0e 94 2c 72 call 0xe458 ; 0xe458 1f0fc: 0e 94 3b f2 call 0x1e476 ; 0x1e476 lcd_return_to_status(); 1f100: 0f 94 ab 1f call 0x23f56 ; 0x23f56 else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 1f104: 80 e0 ldi r24, 0x00 ; 0 1f106: 0e 94 30 66 call 0xcc60 ; 0xcc60 #endif // TMC2130 FORCE_BL_ON_END; 1f10a: 80 e0 ldi r24, 0x00 ; 0 1f10c: 0e 94 d1 89 call 0x113a2 ; 0x113a2 KEEPALIVE_STATE(NOT_BUSY); 1f110: 81 e0 ldi r24, 0x01 ; 1 1f112: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return(_result); } 1f116: 8e 2d mov r24, r14 1f118: 0f 90 pop r0 1f11a: 0f 90 pop r0 1f11c: 0f 90 pop r0 1f11e: 0f 90 pop r0 1f120: df 91 pop r29 1f122: cf 91 pop r28 1f124: 1f 91 pop r17 1f126: 0f 91 pop r16 1f128: ff 90 pop r15 1f12a: ef 90 pop r14 1f12c: df 90 pop r13 1f12e: cf 90 pop r12 1f130: 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); 1f132: 61 e0 ldi r22, 0x01 ; 1 1f134: 80 e0 ldi r24, 0x00 ; 0 1f136: 0f 94 93 a0 call 0x34126 ; 0x34126 if (!_result){ 1f13a: 81 11 cpse r24, r1 1f13c: 9a ce rjmp .-716 ; 0x1ee72 lcd_selftest_error(TestError::PrintFan, "", ""); 1f13e: 68 ef ldi r22, 0xF8 ; 248 1f140: 72 e0 ldi r23, 0x02 ; 2 1f142: 85 e0 ldi r24, 0x05 ; 5 1f144: 82 ce rjmp .-764 ; 0x1ee4a #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1f146: 11 e0 ldi r17, 0x01 ; 1 1f148: d4 ce rjmp .-600 ; 0x1eef2 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1f14a: 85 ee ldi r24, 0xE5 ; 229 1f14c: 95 e5 ldi r25, 0x55 ; 85 1f14e: 0e 94 2c 72 call 0xe458 ; 0xe458 1f152: 62 e0 ldi r22, 0x02 ; 2 1f154: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 1f158: d5 cf rjmp .-86 ; 0x1f104 0001f15a : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1f15a: 0c 94 3e f6 jmp 0x1ec7c ; 0x1ec7c 0001f15e : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1f15e: 0f 94 ab 1f call 0x23f56 ; 0x23f56 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f162: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1f166: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 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() 1f16a: 81 11 cpse r24, r1 1f16c: 32 c0 rjmp .+100 ; 0x1f1d2 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1f16e: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1f172: 81 11 cpse r24, r1 1f174: 02 c0 rjmp .+4 ; 0x1f17a #endif ) { return false; // abort if error persists } return true; 1f176: 81 e0 ldi r24, 0x01 ; 1 1f178: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 1f17a: 8f ef ldi r24, 0xFF ; 255 1f17c: 0e 94 38 f6 call 0x1ec70 ; 0x1ec70 setExtruderAutoFanState(3); //force enables the hotend fan 1f180: 83 e0 ldi r24, 0x03 ; 3 1f182: 0e 94 db 74 call 0xe9b6 ; 0xe9b6 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1f186: 0f 94 51 2a call 0x254a2 ; 0x254a2 1f18a: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 1f18e: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 1f192: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 1f196: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fan_measuring = true; 1f19a: 81 e0 ldi r24, 0x01 ; 1 1f19c: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 1f1a0: 68 ee ldi r22, 0xE8 ; 232 1f1a2: 73 e0 ldi r23, 0x03 ; 3 1f1a4: 80 e0 ldi r24, 0x00 ; 0 1f1a6: 90 e0 ldi r25, 0x00 ; 0 1f1a8: 0f 94 58 28 call 0x250b0 ; 0x250b0 manage_heater(); 1f1ac: 0f 94 61 39 call 0x272c2 ; 0x272c2 setExtruderAutoFanState(1); //releases lock on the hotend fan 1f1b0: 81 e0 ldi r24, 0x01 ; 1 1f1b2: 0e 94 db 74 call 0xe9b6 ; 0xe9b6 lcd_selftest_setfan(0); 1f1b6: 80 e0 ldi r24, 0x00 ; 0 1f1b8: 0e 94 38 f6 call 0x1ec70 ; 0x1ec70 #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 1f1bc: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1f1c0: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1f1c4: 45 97 sbiw r24, 0x15 ; 21 1f1c6: 3c f4 brge .+14 ; 0x1f1d6 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1f1c8: 62 e0 ldi r22, 0x02 ; 2 1f1ca: 8a e3 ldi r24, 0x3A ; 58 1f1cc: 9a e6 ldi r25, 0x6A ; 106 return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 1f1ce: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1f1d2: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1f1d4: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 1f1d6: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 1f1da: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc 1f1de: 45 97 sbiw r24, 0x15 ; 21 1f1e0: 54 f6 brge .-108 ; 0x1f176 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 1f1e2: 62 e0 ldi r22, 0x02 ; 2 1f1e4: 86 e2 ldi r24, 0x26 ; 38 1f1e6: 9a e6 ldi r25, 0x6A ; 106 1f1e8: f2 cf rjmp .-28 ; 0x1f1ce 0001f1ea : //! @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; 1f1ea: 0e 94 af f8 call 0x1f15e ; 0x1f15e 1f1ee: 88 23 and r24, r24 1f1f0: 51 f1 breq .+84 ; 0x1f246 cmdqueue_serial_disabled = false; 1f1f2: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1f1f6: 89 e9 ldi r24, 0x99 ; 153 1f1f8: 92 e5 ldi r25, 0x52 ; 82 1f1fa: 0e 94 2c 72 call 0xe458 ; 0xe458 1f1fe: 0e 94 3b f2 call 0x1e476 ; 0x1e476 st_synchronize(); 1f202: 0f 94 ed 43 call 0x287da ; 0x287da custom_message_type = CustomMsg::Resuming; 1f206: 88 e0 ldi r24, 0x08 ; 8 1f208: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 { #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); #endif resetFanCheck(); 1f20c: 0e 94 61 74 call 0xe8c2 ; 0xe8c2 setExtruderAutoFanState(1); 1f210: 81 e0 ldi r24, 0x01 ; 1 1f212: 0e 94 db 74 call 0xe9b6 ; 0xe9b6 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1f216: 10 92 11 05 sts 0x0511, r1 ; 0x800511 restore_print_from_ram_and_continue(default_retraction); 1f21a: 60 e0 ldi r22, 0x00 ; 0 1f21c: 70 e0 ldi r23, 0x00 ; 0 1f21e: 80 e8 ldi r24, 0x80 ; 128 1f220: 9f e3 ldi r25, 0x3F ; 63 1f222: 0e 94 c4 67 call 0xcf88 ; 0xcf88 did_pause_print = false; 1f226: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 1f22a: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 1f22e: 82 30 cpi r24, 0x02 ; 2 1f230: 11 f4 brne .+4 ; 0x1f236 1f232: 0f 94 92 43 call 0x28724 ; 0x28724 refresh_cmd_timeout(); 1f236: 0e 94 43 66 call 0xcc86 ; 0xcc86 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1f23a: 8f e4 ldi r24, 0x4F ; 79 1f23c: 9a e6 ldi r25, 0x6A ; 106 1f23e: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 custom_message_type = CustomMsg::Status; 1f242: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } 1f246: 08 95 ret 0001f248 : //! @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; 1f248: 0e 94 af f8 call 0x1f15e ; 0x1f15e 1f24c: 88 23 and r24, r24 1f24e: 21 f0 breq .+8 ; 0x1f258 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1f250: 80 e6 ldi r24, 0x60 ; 96 1f252: 9a e6 ldi r25, 0x6A ; 106 1f254: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 } 1f258: 08 95 ret 0001f25a : } /// @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) { 1f25a: cf 92 push r12 1f25c: df 92 push r13 1f25e: ef 92 push r14 1f260: ff 92 push r15 1f262: cf 93 push r28 1f264: 6b 01 movw r12, r22 1f266: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1f268: 82 e0 ldi r24, 0x02 ; 2 1f26a: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1f26e: 8c e3 ldi r24, 0x3C ; 60 1f270: 92 e5 ldi r25, 0x52 ; 82 1f272: 0e 94 2c 72 call 0xe458 ; 0xe458 1f276: 0e 94 3b f2 call 0x1e476 ; 0x1e476 FSensorBlockRunout fsBlockRunout; 1f27a: 0f 94 e9 87 call 0x30fd2 ; 0x30fd2 current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1f27e: 20 e0 ldi r18, 0x00 ; 0 1f280: 30 e0 ldi r19, 0x00 ; 0 1f282: 44 e3 ldi r20, 0x34 ; 52 1f284: 52 e4 ldi r21, 0x42 ; 66 1f286: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f28a: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f28e: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f292: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f296: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1f29a: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f29e: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f2a2: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f2a6: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1f2aa: 6a e0 ldi r22, 0x0A ; 10 1f2ac: 77 e5 ldi r23, 0x57 ; 87 1f2ae: 8d ea ldi r24, 0xAD ; 173 1f2b0: 92 e4 ldi r25, 0x42 ; 66 1f2b2: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1f2b6: 0f 94 ed 43 call 0x287da ; 0x287da current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1f2ba: 20 e0 ldi r18, 0x00 ; 0 1f2bc: 30 e0 ldi r19, 0x00 ; 0 1f2be: 4c e0 ldi r20, 0x0C ; 12 1f2c0: 52 e4 ldi r21, 0x42 ; 66 1f2c2: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f2c6: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f2ca: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f2ce: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f2d2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 1f2d6: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f2da: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f2de: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f2e2: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1f2e6: 69 e2 ldi r22, 0x29 ; 41 1f2e8: 7c e5 ldi r23, 0x5C ; 92 1f2ea: 85 e8 ldi r24, 0x85 ; 133 1f2ec: 91 e4 ldi r25, 0x41 ; 65 1f2ee: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1f2f2: 0f 94 ed 43 call 0x287da ; 0x287da // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1f2f6: 20 e0 ldi r18, 0x00 ; 0 1f2f8: 30 e0 ldi r19, 0x00 ; 0 1f2fa: a9 01 movw r20, r18 1f2fc: c7 01 movw r24, r14 1f2fe: b6 01 movw r22, r12 1f300: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1f304: 88 23 and r24, r24 1f306: e1 f0 breq .+56 ; 0x1f340 { current_position[E_AXIS] += unloadLength; 1f308: a7 01 movw r20, r14 1f30a: 96 01 movw r18, r12 1f30c: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f310: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f314: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f318: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f31c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 1f320: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f324: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f328: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f32c: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1f330: 60 e0 ldi r22, 0x00 ; 0 1f332: 70 e0 ldi r23, 0x00 ; 0 1f334: 80 e2 ldi r24, 0x20 ; 32 1f336: 91 e4 ldi r25, 0x41 ; 65 1f338: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 1f33c: 0f 94 ed 43 call 0x287da ; 0x287da } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1f340: 8c e6 ldi r24, 0x6C ; 108 1f342: 95 e4 ldi r25, 0x45 ; 69 1f344: 0e 94 2c 72 call 0xe458 ; 0xe458 1f348: 0f 94 e9 20 call 0x241d2 ; 0x241d2 //disable extruder steppers so filament can be removed disable_e0(); 1f34c: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1f34e: 64 e6 ldi r22, 0x64 ; 100 1f350: 70 e0 ldi r23, 0x00 ; 0 1f352: 80 e0 ldi r24, 0x00 ; 0 1f354: 90 e0 ldi r25, 0x00 ; 0 1f356: 0f 94 58 28 call 0x250b0 ; 0x250b0 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1f35a: 82 e0 ldi r24, 0x02 ; 2 1f35c: 0f 94 0c 4f call 0x29e18 ; 0x29e18 1f360: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1f362: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 1f366: 81 11 cpse r24, r1 1f368: 07 c0 rjmp .+14 ; 0x1f378 1f36a: c1 50 subi r28, 0x01 ; 1 1f36c: 29 f0 breq .+10 ; 0x1f378 delay_keep_alive(100); 1f36e: 84 e6 ldi r24, 0x64 ; 100 1f370: 90 e0 ldi r25, 0x00 ; 0 1f372: 0e 94 6c 8c call 0x118d8 ; 0x118d8 1f376: f5 cf rjmp .-22 ; 0x1f362 counterBeep++; } st_synchronize(); 1f378: 0f 94 ed 43 call 0x287da ; 0x287da while (lcd_clicked()) delay_keep_alive(100); 1f37c: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 1f380: 88 23 and r24, r24 1f382: 29 f0 breq .+10 ; 0x1f38e 1f384: 84 e6 ldi r24, 0x64 ; 100 1f386: 90 e0 ldi r25, 0x00 ; 0 1f388: 0e 94 6c 8c call 0x118d8 ; 0x118d8 1f38c: f7 cf rjmp .-18 ; 0x1f37c lcd_update_enable(true); 1f38e: 81 e0 ldi r24, 0x01 ; 1 1f390: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_setstatuspgm(MSG_WELCOME); 1f394: 8f ec ldi r24, 0xCF ; 207 1f396: 9f e6 ldi r25, 0x6F ; 111 1f398: 0e 94 3b f2 call 0x1e476 ; 0x1e476 custom_message_type = CustomMsg::Status; 1f39c: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 clearFilamentAction(); 1f3a0: 0f 94 98 21 call 0x24330 ; 0x24330 } 1f3a4: cf 91 pop r28 1f3a6: ff 90 pop r15 1f3a8: ef 90 pop r14 1f3aa: df 90 pop r13 1f3ac: cf 90 pop r12 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1f3ae: 0d 94 2d 7c jmp 0x2f85a ; 0x2f85a 0001f3b2 : //! ---------------------- | ---------------- //! 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) { 1f3b2: af 92 push r10 1f3b4: bf 92 push r11 1f3b6: cf 92 push r12 1f3b8: df 92 push r13 1f3ba: ef 92 push r14 1f3bc: ff 92 push r15 1f3be: 0f 93 push r16 1f3c0: 1f 93 push r17 1f3c2: cf 93 push r28 1f3c4: 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); 1f3c6: 88 23 and r24, r24 1f3c8: 29 f0 breq .+10 ; 0x1f3d4 1f3ca: 61 e0 ldi r22, 0x01 ; 1 1f3cc: 8f e5 ldi r24, 0x5F ; 95 1f3ce: 9f e0 ldi r25, 0x0F ; 15 1f3d0: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 FORCE_BL_ON_START; 1f3d4: 81 e0 ldi r24, 0x01 ; 1 1f3d6: 0e 94 d1 89 call 0x113a2 ; 0x113a2 while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 1f3da: 81 e0 ldi r24, 0x01 ; 1 1f3dc: e8 2e mov r14, r24 1f3de: 89 e8 ldi r24, 0x89 ; 137 1f3e0: f8 2e mov r15, r24 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1f3e2: 97 ed ldi r25, 0xD7 ; 215 1f3e4: c9 2e mov r12, r25 1f3e6: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f3e8: 2c e3 ldi r18, 0x3C ; 60 1f3ea: a2 2e mov r10, r18 1f3ec: b1 2c mov r11, r1 1f3ee: 0c 2f mov r16, r28 1f3f0: 10 e0 ldi r17, 0x00 ; 0 1f3f2: 1f 92 push r1 1f3f4: cf 93 push r28 1f3f6: ff 92 push r15 1f3f8: ef 92 push r14 1f3fa: 0f 94 16 db call 0x3b62c ; 0x3b62c switch (state) { 1f3fe: 0f 90 pop r0 1f400: 0f 90 pop r0 1f402: 0f 90 pop r0 1f404: 0f 90 pop r0 1f406: cf 30 cpi r28, 0x0F ; 15 1f408: a0 f7 brcc .-24 ; 0x1f3f2 1f40a: f8 01 movw r30, r16 1f40c: 88 27 eor r24, r24 1f40e: e4 5f subi r30, 0xF4 ; 244 1f410: f5 40 sbci r31, 0x05 ; 5 1f412: 8f 4f sbci r24, 0xFF ; 255 1f414: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 1f418: 1b fa .word 0xfa1b ; ???? 1f41a: 6b fa .word 0xfa6b ; ???? 1f41c: 91 fa bst r9, 1 1f41e: 9d fa .word 0xfa9d ; ???? 1f420: a7 fa bst r10, 7 1f422: e1 fa bst r14, 1 1f424: ed fa .word 0xfaed ; ???? 1f426: 07 fb bst r16, 7 1f428: 1e fb .word 0xfb1e ; ???? 1f42a: 18 fb .word 0xfb18 ; ???? 1f42c: 22 fb bst r18, 2 1f42e: 30 fb bst r19, 0 1f430: 39 fb .word 0xfb39 ; ???? 1f432: 4d fb .word 0xfb4d ; ???? 1f434: 4d fb .word 0xfb4d ; ???? // 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; 1f436: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 1f43a: 8f e5 ldi r24, 0x5F ; 95 1f43c: 9f e0 ldi r25, 0x0F ; 15 1f43e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 1f442: 82 30 cpi r24, 0x02 ; 2 1f444: 39 f4 brne .+14 ; 0x1f454 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 1f446: 87 e4 ldi r24, 0x47 ; 71 1f448: 92 e4 ldi r25, 0x42 ; 66 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)); 1f44a: 0e 94 2c 72 call 0xe458 ; 0xe458 1f44e: 0f 94 f6 20 call 0x241ec ; 0x241ec 1f452: 0f c0 rjmp .+30 ; 0x1f472 // 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); 1f454: 82 ee ldi r24, 0xE2 ; 226 1f456: 91 e4 ldi r25, 0x41 ; 65 1f458: 0e 94 2c 72 call 0xe458 ; 0xe458 1f45c: 40 e0 ldi r20, 0x00 ; 0 1f45e: 60 e0 ldi r22, 0x00 ; 0 1f460: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1f464: 81 11 cpse r24, r1 1f466: 07 c0 rjmp .+14 ; 0x1f476 1f468: 61 e0 ldi r22, 0x01 ; 1 1f46a: 8f e5 ldi r24, 0x5F ; 95 1f46c: 9f e0 ldi r25, 0x0F ; 15 1f46e: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 1f472: c1 e0 ldi r28, 0x01 ; 1 1f474: bc cf rjmp .-136 ; 0x1f3ee 1f476: 60 e0 ldi r22, 0x00 ; 0 1f478: 8f e5 ldi r24, 0x5F ; 95 1f47a: 9f e0 ldi r25, 0x0F ; 15 1f47c: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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); 1f480: 10 e0 ldi r17, 0x00 ; 0 1f482: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 1f484: 80 e0 ldi r24, 0x00 ; 0 1f486: 0e 94 d1 89 call 0x113a2 ; 0x113a2 const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 1f48a: 1f 93 push r17 1f48c: 0f 93 push r16 1f48e: 84 ed ldi r24, 0xD4 ; 212 1f490: 99 e6 ldi r25, 0x69 ; 105 1f492: 9f 93 push r25 1f494: 8f 93 push r24 1f496: 0f 94 16 db call 0x3b62c ; 0x3b62c switch (state) { 1f49a: 0f 90 pop r0 1f49c: 0f 90 pop r0 1f49e: 0f 90 pop r0 1f4a0: 0f 90 pop r0 1f4a2: cd 30 cpi r28, 0x0D ; 13 1f4a4: 09 f4 brne .+2 ; 0x1f4a8 1f4a6: ff c0 rjmp .+510 ; 0x1f6a6 1f4a8: ce 30 cpi r28, 0x0E ; 14 1f4aa: 09 f4 brne .+2 ; 0x1f4ae 1f4ac: 11 c1 rjmp .+546 ; 0x1f6d0 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 1f4ae: 81 e0 ldi r24, 0x01 ; 1 1f4b0: 9f e3 ldi r25, 0x3F ; 63 FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); switch (state) { 1f4b2: cc 23 and r28, r28 1f4b4: 09 f4 brne .+2 ; 0x1f4b8 1f4b6: 0e c1 rjmp .+540 ; 0x1f6d4 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 1f4b8: 81 e0 ldi r24, 0x01 ; 1 1f4ba: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_update(2); 1f4be: 82 e0 ldi r24, 0x02 ; 2 } 1f4c0: cf 91 pop r28 1f4c2: 1f 91 pop r17 1f4c4: 0f 91 pop r16 1f4c6: ff 90 pop r15 1f4c8: ef 90 pop r14 1f4ca: df 90 pop r13 1f4cc: cf 90 pop r12 1f4ce: bf 90 pop r11 1f4d0: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 1f4d2: 0c 94 27 6e jmp 0xdc4e ; 0xdc4e lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f4d6: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> case S::Restore: // clear any previous error for make _new_ errors visible lcd_reset_alert_level(); // determine the next step in the required order if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 1f4da: 81 e0 ldi r24, 0x01 ; 1 1f4dc: 0e 94 7d ef call 0x1defa ; 0x1defa state = S::Selftest; 1f4e0: 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)) { 1f4e2: 88 23 and r24, r24 1f4e4: 09 f4 brne .+2 ; 0x1f4e8 1f4e6: 83 cf rjmp .-250 ; 0x1f3ee state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1f4e8: 82 e0 ldi r24, 0x02 ; 2 1f4ea: 0e 94 7d ef call 0x1defa ; 0x1defa // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 1f4ee: 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)) { 1f4f0: 88 23 and r24, r24 1f4f2: 09 f4 brne .+2 ; 0x1f4f6 1f4f4: 7c cf rjmp .-264 ; 0x1f3ee // 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)) { 1f4f6: 84 e0 ldi r24, 0x04 ; 4 1f4f8: 0e 94 7d ef call 0x1defa ; 0x1defa state = S::Z; 1f4fc: 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)) { 1f4fe: 88 23 and r24, r24 1f500: 09 f4 brne .+2 ; 0x1f504 1f502: 75 cf rjmp .-278 ; 0x1f3ee state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 1f504: 88 e0 ldi r24, 0x08 ; 8 1f506: 0e 94 7d ef call 0x1defa ; 0x1defa state = S::ThermalModel; 1f50a: 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)) { 1f50c: 88 23 and r24, r24 1f50e: 09 f4 brne .+2 ; 0x1f512 1f510: 6e cf rjmp .-292 ; 0x1f3ee state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 1f512: 80 e1 ldi r24, 0x10 ; 16 1f514: 0e 94 7d ef call 0x1defa ; 0x1defa state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 1f518: 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)) { 1f51a: 81 11 cpse r24, r1 1f51c: 68 cf rjmp .-304 ; 0x1f3ee state = S::IsFil; 1f51e: c6 e0 ldi r28, 0x06 ; 6 1f520: 66 cf rjmp .-308 ; 0x1f3ee // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 1f522: 89 e9 ldi r24, 0x99 ; 153 1f524: 91 e4 ldi r25, 0x41 ; 65 1f526: 0e 94 2c 72 call 0xe458 ; 0xe458 1f52a: 0f 94 f6 20 call 0x241ec ; 0x241ec wizard_event = lcd_selftest(); 1f52e: 0e 94 3e f6 call 0x1ec7c ; 0x1ec7c 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); 1f532: 81 11 cpse r24, r1 1f534: 9e cf rjmp .-196 ; 0x1f472 } 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); 1f536: ce e0 ldi r28, 0x0E ; 14 1f538: 5a cf rjmp .-332 ; 0x1f3ee break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 1f53a: 8b e5 ldi r24, 0x5B ; 91 1f53c: 91 e4 ldi r25, 0x41 ; 65 1f53e: 0e 94 2c 72 call 0xe458 ; 0xe458 1f542: 0f 94 f6 20 call 0x241ec ; 0x241ec wizard_event = gcode_M45(false, 0); 1f546: 80 e0 ldi r24, 0x00 ; 0 1f548: 0f 94 dd 8d call 0x31bba ; 0x31bba 1f54c: f2 cf rjmp .-28 ; 0x1f532 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 1f54e: 83 e3 ldi r24, 0x33 ; 51 1f550: 91 e4 ldi r25, 0x41 ; 65 1f552: 0e 94 2c 72 call 0xe458 ; 0xe458 1f556: 0f 94 f6 20 call 0x241ec ; 0x241ec lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 1f55a: 85 e0 ldi r24, 0x05 ; 5 1f55c: 91 e4 ldi r25, 0x41 ; 65 1f55e: 0e 94 2c 72 call 0xe458 ; 0xe458 1f562: 0f 94 f6 20 call 0x241ec ; 0x241ec lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 1f566: 85 ee ldi r24, 0xE5 ; 229 1f568: 90 e4 ldi r25, 0x40 ; 64 1f56a: 0e 94 2c 72 call 0xe458 ; 0xe458 1f56e: 0f 94 f6 20 call 0x241ec ; 0x241ec wizard_event = gcode_M45(true, 0); 1f572: 81 e0 ldi r24, 0x01 ; 1 1f574: 0f 94 dd 8d call 0x31bba ; 0x31bba if (!wizard_event) { 1f578: 88 23 and r24, r24 1f57a: e9 f2 breq .-70 ; 0x1f536 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 1f57c: 60 e0 ldi r22, 0x00 ; 0 1f57e: 70 e0 ldi r23, 0x00 ; 0 1f580: 88 ed ldi r24, 0xD8 ; 216 1f582: 91 e4 ldi r25, 0x41 ; 65 1f584: 0e 94 e0 6d call 0xdbc0 ; 0xdbc0 if(!MMU2::mmu2.Enabled()) { 1f588: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1f58c: 81 30 cpi r24, 0x01 ; 1 1f58e: 09 f4 brne .+2 ; 0x1f592 1f590: 70 cf rjmp .-288 ; 0x1f472 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1f592: d0 92 b7 0d sts 0x0DB7, r13 ; 0x800db7 1f596: c0 92 b6 0d sts 0x0DB6, r12 ; 0x800db6 //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)); 1f59a: 80 ec ldi r24, 0xC0 ; 192 1f59c: 90 e4 ldi r25, 0x40 ; 64 1f59e: 0e 94 2c 72 call 0xe458 ; 0xe458 1f5a2: 0f 94 e9 20 call 0x241d2 ; 0x241d2 wait_preheat(); 1f5a6: 0e 94 35 e3 call 0x1c66a ; 0x1c66a unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 1f5aa: 60 e0 ldi r22, 0x00 ; 0 1f5ac: 70 e0 ldi r23, 0x00 ; 0 1f5ae: cb 01 movw r24, r22 1f5b0: 0e 94 2d f9 call 0x1f25a ; 0x1f25a lcd_wizard_load(); // load filament 1f5b4: 0e 94 bb cf call 0x19f76 ; 0x19f76 1f5b8: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 1f5bc: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 1f5c0: 58 cf rjmp .-336 ; 0x1f472 state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 1f5c2: 80 e8 ldi r24, 0x80 ; 128 1f5c4: 90 e4 ldi r25, 0x40 ; 64 1f5c6: 0e 94 2c 72 call 0xe458 ; 0xe458 1f5ca: 0f 94 f6 20 call 0x241ec ; 0x241ec lcd_commands_type = LcdCommands::ThermalModel; 1f5ce: 85 e0 ldi r24, 0x05 ; 5 1f5d0: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 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); 1f5d4: 05 e0 ldi r16, 0x05 ; 5 1f5d6: 10 e0 ldi r17, 0x00 ; 0 1f5d8: 55 cf rjmp .-342 ; 0x1f484 1f5da: d0 92 b7 0d sts 0x0DB7, r13 ; 0x800db7 1f5de: c0 92 b6 0d sts 0x0DB6, r12 ; 0x800db6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f5e2: b0 92 73 06 sts 0x0673, r11 ; 0x800673 1f5e6: a0 92 72 06 sts 0x0672, r10 ; 0x800672 #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); 1f5ea: 8a e6 ldi r24, 0x6A ; 106 1f5ec: 90 e4 ldi r25, 0x40 ; 64 1f5ee: 0e 94 2c 72 call 0xe458 ; 0xe458 1f5f2: 41 e0 ldi r20, 0x01 ; 1 1f5f4: 60 e0 ldi r22, 0x00 ; 0 1f5f6: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1f5fa: 88 23 and r24, r24 1f5fc: 09 f1 breq .+66 ; 0x1f640 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 1f5fe: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba else state = S::Preheat; 1f602: 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; 1f604: 81 30 cpi r24, 0x01 ; 1 1f606: 09 f0 breq .+2 ; 0x1f60a 1f608: f2 ce rjmp .-540 ; 0x1f3ee 1f60a: c8 e0 ldi r28, 0x08 ; 8 1f60c: f0 ce rjmp .-544 ; 0x1f3ee else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 1f60e: 20 e0 ldi r18, 0x00 ; 0 1f610: 41 e0 ldi r20, 0x01 ; 1 1f612: 70 e0 ldi r23, 0x00 ; 0 1f614: 60 e0 ldi r22, 0x00 ; 0 1f616: 8c eb ldi r24, 0xBC ; 188 1f618: 99 e3 ldi r25, 0x39 ; 57 1f61a: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 1f61e: 89 e2 ldi r24, 0x29 ; 41 1f620: 90 e4 ldi r25, 0x40 ; 64 1f622: 0e 94 2c 72 call 0xe458 ; 0xe458 1f626: 0f 94 f6 20 call 0x241ec ; 0x241ec 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); 1f62a: 07 e0 ldi r16, 0x07 ; 7 1f62c: 10 e0 ldi r17, 0x00 ; 0 1f62e: 2a cf rjmp .-428 ; 0x1f484 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(); 1f630: 0e 94 35 e3 call 0x1c66a ; 0x1c66a lcd_wizard_load(); 1f634: 0e 94 bb cf call 0x19f76 ; 0x19f76 state = S::Lay1CalHot; 1f638: cb e0 ldi r28, 0x0B ; 11 1f63a: d9 ce rjmp .-590 ; 0x1f3ee break; case S::LoadFilCold: lcd_wizard_load(); 1f63c: 0e 94 bb cf call 0x19f76 ; 0x19f76 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; 1f640: ca e0 ldi r28, 0x0A ; 10 1f642: d5 ce rjmp .-598 ; 0x1f3ee case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 1f644: 81 e0 ldi r24, 0x01 ; 1 1f646: 0e 94 9d cf call 0x19f3a ; 0x19f3a menu_goto(lcd_v2_calibration, 0, true); 1f64a: 20 e0 ldi r18, 0x00 ; 0 1f64c: 41 e0 ldi r20, 0x01 ; 1 1f64e: 70 e0 ldi r23, 0x00 ; 0 1f650: 60 e0 ldi r22, 0x00 ; 0 1f652: 85 eb ldi r24, 0xB5 ; 181 1f654: 95 ee ldi r25, 0xE5 ; 229 1f656: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 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); 1f65a: 0a e0 ldi r16, 0x0A ; 10 1f65c: 10 e0 ldi r17, 0x00 ; 0 1f65e: 12 cf rjmp .-476 ; 0x1f484 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); 1f660: 80 e0 ldi r24, 0x00 ; 0 1f662: 0e 94 9d cf call 0x19f3a ; 0x19f3a lcd_commands_type = LcdCommands::Layer1Cal; 1f666: 84 e0 ldi r24, 0x04 ; 4 1f668: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 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); 1f66c: 0b e0 ldi r16, 0x0B ; 11 1f66e: 10 e0 ldi r17, 0x00 ; 0 1f670: 09 cf rjmp .-494 ; 0x1f484 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); 1f672: 86 ed ldi r24, 0xD6 ; 214 1f674: 9f e3 ldi r25, 0x3F ; 63 1f676: 0e 94 2c 72 call 0xe458 ; 0xe458 1f67a: 41 e0 ldi r20, 0x01 ; 1 1f67c: 60 e0 ldi r22, 0x00 ; 0 1f67e: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 1f682: 81 11 cpse r24, r1 1f684: 07 c0 rjmp .+14 ; 0x1f694 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 1f686: 86 ea ldi r24, 0xA6 ; 166 1f688: 9f e3 ldi r25, 0x3F ; 63 1f68a: 0e 94 2c 72 call 0xe458 ; 0xe458 1f68e: 0f 94 f6 20 call 0x241ec ; 0x241ec 1f692: d6 cf rjmp .-84 ; 0x1f640 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 1f694: 80 e4 ldi r24, 0x40 ; 64 1f696: 9f e3 ldi r25, 0x3F ; 63 1f698: d8 ce rjmp .-592 ; 0x1f44a 1f69a: 60 e0 ldi r22, 0x00 ; 0 1f69c: 8f e5 ldi r24, 0x5F ; 95 1f69e: 9f e0 ldi r25, 0x0F ; 15 1f6a0: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 1f6a4: ef ce rjmp .-546 ; 0x1f484 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 1f6a6: 82 ee ldi r24, 0xE2 ; 226 1f6a8: 9e e3 ldi r25, 0x3E ; 62 1f6aa: 0e 94 2c 72 call 0xe458 ; 0xe458 1f6ae: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f6b0: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 1f6b4: 8f ec ldi r24, 0xCF ; 207 1f6b6: 9f e6 ldi r25, 0x6F ; 111 1f6b8: 0e 94 3b f2 call 0x1e476 ; 0x1e476 lcd_return_to_status(); 1f6bc: 0f 94 ab 1f call 0x23f56 ; 0x23f56 default: // exiting for later re-entry break; } if (msg) { 1f6c0: 01 15 cp r16, r1 1f6c2: 11 05 cpc r17, r1 1f6c4: 09 f4 brne .+2 ; 0x1f6c8 1f6c6: f8 ce rjmp .-528 ; 0x1f4b8 lcd_show_fullscreen_message_and_wait_P(msg); 1f6c8: c8 01 movw r24, r16 1f6ca: 0f 94 f6 20 call 0x241ec ; 0x241ec 1f6ce: f4 ce rjmp .-536 ; 0x1f4b8 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 1f6d0: 80 e8 ldi r24, 0x80 ; 128 1f6d2: 9e e3 ldi r25, 0x3E ; 62 1f6d4: 0e 94 2c 72 call 0xe458 ; 0xe458 1f6d8: 8c 01 movw r16, r24 1f6da: f2 cf rjmp .-28 ; 0x1f6c0 0001f6dc
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f6dc: cf 93 push r28 1f6de: df 93 push r29 1f6e0: cd b7 in r28, 0x3d ; 61 1f6e2: de b7 in r29, 0x3e ; 62 1f6e4: 67 97 sbiw r28, 0x17 ; 23 1f6e6: 0f b6 in r0, 0x3f ; 63 1f6e8: f8 94 cli 1f6ea: de bf out 0x3e, r29 ; 62 1f6ec: 0f be out 0x3f, r0 ; 63 1f6ee: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f6f0: 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); 1f6f2: 84 b5 in r24, 0x24 ; 36 1f6f4: 82 60 ori r24, 0x02 ; 2 1f6f6: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f6f8: 84 b5 in r24, 0x24 ; 36 1f6fa: 81 60 ori r24, 0x01 ; 1 1f6fc: 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); 1f6fe: 85 b5 in r24, 0x25 ; 37 1f700: 82 60 ori r24, 0x02 ; 2 1f702: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f704: 85 b5 in r24, 0x25 ; 37 1f706: 81 60 ori r24, 0x01 ; 1 1f708: 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); 1f70a: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f70e: 81 60 ori r24, 0x01 ; 1 1f710: 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; 1f714: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f718: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f71c: 82 60 ori r24, 0x02 ; 2 1f71e: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f722: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f726: 81 60 ori r24, 0x01 ; 1 1f728: 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); 1f72c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f730: 81 60 ori r24, 0x01 ; 1 1f732: 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); 1f736: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f73a: 84 60 ori r24, 0x04 ; 4 1f73c: 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); 1f740: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f744: 81 60 ori r24, 0x01 ; 1 1f746: 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 1f74a: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f74e: 82 60 ori r24, 0x02 ; 2 1f750: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f754: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f758: 81 60 ori r24, 0x01 ; 1 1f75a: 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 1f75e: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f762: 81 60 ori r24, 0x01 ; 1 1f764: 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 1f768: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f76c: 82 60 ori r24, 0x02 ; 2 1f76e: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f772: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f776: 81 60 ori r24, 0x01 ; 1 1f778: 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 1f77c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f780: 81 60 ori r24, 0x01 ; 1 1f782: 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 1f786: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f78a: 82 60 ori r24, 0x02 ; 2 1f78c: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f790: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f794: 81 60 ori r24, 0x01 ; 1 1f796: 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 1f79a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f79e: 81 60 ori r24, 0x01 ; 1 1f7a0: 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); 1f7a4: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f7a8: 84 60 ori r24, 0x04 ; 4 1f7aa: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f7ae: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f7b2: 82 60 ori r24, 0x02 ; 2 1f7b4: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f7b8: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f7bc: 81 60 ori r24, 0x01 ; 1 1f7be: 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); 1f7c2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f7c6: 80 68 ori r24, 0x80 ; 128 1f7c8: 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; 1f7cc: 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) { 1f7d0: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f7d2: f8 94 cli wdt_reset(); 1f7d4: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f7d6: 84 b7 in r24, 0x34 ; 52 1f7d8: 87 7f andi r24, 0xF7 ; 247 1f7da: 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" ); 1f7dc: 0f b6 in r0, 0x3f ; 63 1f7de: f8 94 cli 1f7e0: a8 95 wdr 1f7e2: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f7e6: 88 61 ori r24, 0x18 ; 24 1f7e8: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f7ec: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f7f0: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f7f2: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f7f4: 9f b7 in r25, 0x3f ; 63 1f7f6: 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 1f7f8: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f7fc: 84 e0 ldi r24, 0x04 ; 4 1f7fe: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f806: 81 60 ori r24, 0x01 ; 1 1f808: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f810: 8d 7f andi r24, 0xFD ; 253 1f812: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f81a: 8b 7f andi r24, 0xFB ; 251 1f81c: 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; 1f820: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f824: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f826: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f828: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f82a: 6a e0 ldi r22, 0x0A ; 10 1f82c: 70 e0 ldi r23, 0x00 ; 0 1f82e: 80 e0 ldi r24, 0x00 ; 0 1f830: 90 e0 ldi r25, 0x00 ; 0 1f832: 0f 94 58 28 call 0x250b0 ; 0x250b0 backlightSupport = !READ(LCD_BL_PIN); 1f836: 9c b1 in r25, 0x0c ; 12 1f838: 81 e0 ldi r24, 0x01 ; 1 1f83a: 29 2f mov r18, r25 1f83c: 28 70 andi r18, 0x08 ; 8 1f83e: 93 fd sbrc r25, 3 1f840: 80 e0 ldi r24, 0x00 ; 0 1f842: 80 93 02 04 sts 0x0402, r24 ; 0x800402 if (!backlightSupport) return; 1f846: 21 11 cpse r18, r1 1f848: 22 c0 rjmp .+68 ; 0x1f88e //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f84a: 62 e0 ldi r22, 0x02 ; 2 1f84c: 82 e3 ldi r24, 0x32 ; 50 1f84e: 9d e0 ldi r25, 0x0D ; 13 1f850: 0e 94 89 75 call 0xeb12 ; 0xeb12 1f854: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, LCD_BACKLIGHT_LEVEL_HIGH); 1f858: 62 e8 ldi r22, 0x82 ; 130 1f85a: 84 e3 ldi r24, 0x34 ; 52 1f85c: 9d e0 ldi r25, 0x0D ; 13 1f85e: 0e 94 89 75 call 0xeb12 ; 0xeb12 1f862: 80 93 01 04 sts 0x0401, r24 ; 0x800401 backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, LCD_BACKLIGHT_LEVEL_LOW); 1f866: 62 e3 ldi r22, 0x32 ; 50 1f868: 83 e3 ldi r24, 0x33 ; 51 1f86a: 9d e0 ldi r25, 0x0D ; 13 1f86c: 0e 94 89 75 call 0xeb12 ; 0xeb12 1f870: 80 93 00 04 sts 0x0400, r24 ; 0x800400 backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT); // in seconds 1f874: 6f e0 ldi r22, 0x0F ; 15 1f876: 70 e0 ldi r23, 0x00 ; 0 1f878: 80 e3 ldi r24, 0x30 ; 48 1f87a: 9d e0 ldi r25, 0x0D ; 13 1f87c: 0e 94 71 75 call 0xeae2 ; 0xeae2 1f880: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f884: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f888: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f88a: 0e 94 ea 89 call 0x113d4 ; 0x113d4 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f88e: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f890: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f892: 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); 1f894: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f896: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f898: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f89c: 80 68 ori r24, 0x80 ; 128 1f89e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f8a2: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f8a4: 80 91 11 04 lds r24, 0x0411 ; 0x800411 <_ZL19lcd_displayfunction.lto_priv.551> 1f8a8: 88 60 ori r24, 0x08 ; 8 1f8aa: 80 93 11 04 sts 0x0411, r24 ; 0x800411 <_ZL19lcd_displayfunction.lto_priv.551> 1f8ae: 2f ef ldi r18, 0xFF ; 255 1f8b0: 30 e7 ldi r19, 0x70 ; 112 1f8b2: 82 e0 ldi r24, 0x02 ; 2 1f8b4: 21 50 subi r18, 0x01 ; 1 1f8b6: 30 40 sbci r19, 0x00 ; 0 1f8b8: 80 40 sbci r24, 0x00 ; 0 1f8ba: e1 f7 brne .-8 ; 0x1f8b4 1f8bc: 00 c0 rjmp .+0 ; 0x1f8be 1f8be: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f8c0: 81 e0 ldi r24, 0x01 ; 1 1f8c2: 0e 94 cb 6e call 0xdd96 ; 0xdd96 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f8c6: 83 e7 ldi r24, 0x73 ; 115 1f8c8: 90 e7 ldi r25, 0x70 ; 112 1f8ca: 90 93 0c 04 sts 0x040C, r25 ; 0x80040c <_lcdout+0x9> 1f8ce: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b <_lcdout+0x8> 1f8d2: 10 92 0e 04 sts 0x040E, r1 ; 0x80040e <_lcdout+0xb> 1f8d6: 10 92 0d 04 sts 0x040D, r1 ; 0x80040d <_lcdout+0xa> 1f8da: 12 e0 ldi r17, 0x02 ; 2 1f8dc: 10 93 06 04 sts 0x0406, r17 ; 0x800406 <_lcdout+0x3> 1f8e0: 10 92 10 04 sts 0x0410, r1 ; 0x800410 <_lcdout+0xd> 1f8e4: 10 92 0f 04 sts 0x040F, r1 ; 0x80040f <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f8e8: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_longpress_func = menu_lcd_longpress_func; 1f8ec: 8e e2 ldi r24, 0x2E ; 46 1f8ee: 95 ed ldi r25, 0xD5 ; 213 1f8f0: 90 93 18 04 sts 0x0418, r25 ; 0x800418 1f8f4: 80 93 17 04 sts 0x0417, r24 ; 0x800417 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f8f8: 8e e7 ldi r24, 0x7E ; 126 1f8fa: 99 e3 ldi r25, 0x39 ; 57 1f8fc: 90 93 16 04 sts 0x0416, r25 ; 0x800416 1f900: 80 93 15 04 sts 0x0415, r24 ; 0x800415 menu_menu = lcd_status_screen; 1f904: 86 e2 ldi r24, 0x26 ; 38 1f906: 9a e3 ldi r25, 0x3A ; 58 1f908: 90 93 14 04 sts 0x0414, r25 ; 0x800414 1f90c: 80 93 13 04 sts 0x0413, r24 ; 0x800413 SET_INPUT(BTN_EN1); 1f910: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f914: 8b 7f andi r24, 0xFB ; 251 1f916: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f91a: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f91e: 8d 7f andi r24, 0xFD ; 253 1f920: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f924: 9f b7 in r25, 0x3f ; 63 1f926: f8 94 cli 1f928: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f92c: 84 60 ori r24, 0x04 ; 4 1f92e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f932: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f934: 9f b7 in r25, 0x3f ; 63 1f936: f8 94 cli 1f938: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f93c: 82 60 ori r24, 0x02 ; 2 1f93e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f942: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f944: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f948: 8f 7b andi r24, 0xBF ; 191 1f94a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f94e: 9f b7 in r25, 0x3f ; 63 1f950: f8 94 cli 1f952: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f956: 80 64 ori r24, 0x40 ; 64 1f958: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f95c: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f95e: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f962: 8e 7f andi r24, 0xFE ; 254 1f964: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f968: 9f b7 in r25, 0x3f ; 63 1f96a: f8 94 cli 1f96c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f970: 81 60 ori r24, 0x01 ; 1 1f972: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f976: 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); 1f978: af e9 ldi r26, 0x9F ; 159 1f97a: bf e0 ldi r27, 0x0F ; 15 1f97c: 11 97 sbiw r26, 0x01 ; 1 1f97e: f1 f7 brne .-4 ; 0x1f97c 1f980: 00 c0 rjmp .+0 ; 0x1f982 1f982: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f984: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f988: 80 95 com r24 1f98a: 81 70 andi r24, 0x01 ; 1 1f98c: 80 93 12 04 sts 0x0412, r24 ; 0x800412 #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f990: 44 e1 ldi r20, 0x14 ; 20 1f992: 50 e0 ldi r21, 0x00 ; 0 1f994: 6f ec ldi r22, 0xCF ; 207 1f996: 7f e6 ldi r23, 0x6F ; 111 1f998: 8f e1 ldi r24, 0x1F ; 31 1f99a: 95 e0 ldi r25, 0x05 ; 5 1f99c: 0f 94 41 da call 0x3b482 ; 0x3b482 timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f9a0: 0f 94 06 c3 call 0x3860c ; 0x3860c } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f9a4: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f9a8: 88 e5 ldi r24, 0x58 ; 88 1f9aa: 9c e8 ldi r25, 0x8C ; 140 1f9ac: 9f 93 push r25 1f9ae: 8f 93 push r24 1f9b0: 8f e5 ldi r24, 0x5F ; 95 1f9b2: 9c e8 ldi r25, 0x8C ; 140 1f9b4: 9f 93 push r25 1f9b6: 8f 93 push r24 1f9b8: 0e 94 39 6e call 0xdc72 ; 0xdc72 static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f9bc: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f9c0: 84 60 ori r24, 0x04 ; 4 1f9c2: 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)); 1f9c6: 60 e0 ldi r22, 0x00 ; 0 1f9c8: 87 ed ldi r24, 0xD7 ; 215 1f9ca: 9e e0 ldi r25, 0x0E ; 14 1f9cc: 0e 94 89 75 call 0xeb12 ; 0xeb12 1f9d0: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1f9d4: 60 e0 ldi r22, 0x00 ; 0 1f9d6: 88 e0 ldi r24, 0x08 ; 8 1f9d8: 9f e0 ldi r25, 0x0F ; 15 1f9da: 0e 94 89 75 call 0xeb12 ; 0xeb12 1f9de: 80 93 39 05 sts 0x0539, r24 ; 0x800539 MYSERIAL.begin(BAUDRATE); 1f9e2: 0e 94 64 cd call 0x19ac8 ; 0x19ac8 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f9e6: 8b ec ldi r24, 0xCB ; 203 1f9e8: 96 e7 ldi r25, 0x76 ; 118 1f9ea: 90 93 06 05 sts 0x0506, r25 ; 0x800506 <_uartout+0x9> 1f9ee: 80 93 05 05 sts 0x0505, r24 ; 0x800505 <_uartout+0x8> 1f9f2: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_uartout+0xb> 1f9f6: 10 92 07 05 sts 0x0507, r1 ; 0x800507 <_uartout+0xa> 1f9fa: 10 93 00 05 sts 0x0500, r17 ; 0x800500 <_uartout+0x3> 1f9fe: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_uartout+0xd> 1fa02: 10 92 09 05 sts 0x0509, r1 ; 0x800509 <_uartout+0xc> stdout = uartout; 1fa06: 8d ef ldi r24, 0xFD ; 253 1fa08: 94 e0 ldi r25, 0x04 ; 4 1fa0a: 90 93 1d 18 sts 0x181D, r25 ; 0x80181d <__iob+0x3> 1fa0e: 80 93 1c 18 sts 0x181C, r24 ; 0x80181c <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1fa12: 0e 94 f5 ee call 0x1ddea ; 0x1ddea 1fa16: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1fa18: 0f 90 pop r0 1fa1a: 0f 90 pop r0 1fa1c: 0f 90 pop r0 1fa1e: 0f 90 pop r0 1fa20: 8e 01 movw r16, r28 1fa22: 0f 5f subi r16, 0xFF ; 255 1fa24: 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; 1fa26: aa 24 eor r10, r10 1fa28: a3 94 inc r10 if (xflash_success) 1fa2a: 88 23 and r24, r24 1fa2c: 09 f4 brne .+2 ; 0x1fa30 1fa2e: d8 c0 rjmp .+432 ; 0x1fbe0 { optiboot_status = optiboot_xflash_enter(); 1fa30: 0f 94 14 c3 call 0x38628 ; 0x38628 1fa34: 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)) 1fa36: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7dc> 1fa3a: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7dd> 1fa3e: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7de> 1fa42: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7df> 1fa46: 8a 3a cpi r24, 0xAA ; 170 1fa48: 95 45 sbci r25, 0x55 ; 85 1fa4a: aa 4a sbci r26, 0xAA ; 170 1fa4c: b5 45 sbci r27, 0x55 ; 85 1fa4e: 09 f0 breq .+2 ; 0x1fa52 1fa50: bf c0 rjmp .+382 ; 0x1fbd0 1fa52: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 1fa56: 87 ff sbrs r24, 7 1fa58: bb c0 rjmp .+374 ; 0x1fbd0 { uint8_t lang = boot_reserved >> 3; 1fa5a: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7da> 1fa5e: 98 2c mov r9, r8 1fa60: 96 94 lsr r9 1fa62: 96 94 lsr r9 1fa64: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1fa66: f8 2d mov r31, r8 1fa68: f7 70 andi r31, 0x07 ; 7 1fa6a: 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 1fa6c: 99 20 and r9, r9 1fa6e: 09 f4 brne .+2 ; 0x1fa72 1fa70: af c0 rjmp .+350 ; 0x1fbd0 #ifdef XFLASH if (lang == LANG_ID_SEC) 1fa72: 21 e0 ldi r18, 0x01 ; 1 1fa74: 92 12 cpse r9, r18 1fa76: 24 c0 rjmp .+72 ; 0x1fac0 { 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 1fa78: 40 e1 ldi r20, 0x10 ; 16 1fa7a: 50 e0 ldi r21, 0x00 ; 0 1fa7c: 60 e0 ldi r22, 0x00 ; 0 1fa7e: 71 e0 ldi r23, 0x01 ; 1 1fa80: c8 01 movw r24, r16 1fa82: 0f 94 ee d9 call 0x3b3dc ; 0x3b3dc if (offset) *offset = ui; 1fa86: 60 e0 ldi r22, 0x00 ; 0 1fa88: 71 e0 ldi r23, 0x01 ; 1 1fa8a: 6b 01 movw r12, r22 1fa8c: f1 2c mov r15, r1 1fa8e: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 1fa90: 89 81 ldd r24, Y+1 ; 0x01 1fa92: 9a 81 ldd r25, Y+2 ; 0x02 1fa94: ab 81 ldd r26, Y+3 ; 0x03 1fa96: bc 81 ldd r27, Y+4 ; 0x04 1fa98: 85 3a cpi r24, 0xA5 ; 165 1fa9a: 9a 45 sbci r25, 0x5A ; 90 1fa9c: a4 4b sbci r26, 0xB4 ; 180 1fa9e: bb 44 sbci r27, 0x4B ; 75 1faa0: 09 f0 breq .+2 ; 0x1faa4 1faa2: 96 c0 rjmp .+300 ; 0x1fbd0 { lcd_puts_at_P(1,0,PSTR("Language update")); 1faa4: 4d e8 ldi r20, 0x8D ; 141 1faa6: 5c e8 ldi r21, 0x8C ; 140 1faa8: 60 e0 ldi r22, 0x00 ; 0 1faaa: 81 e0 ldi r24, 0x01 ; 1 1faac: 0e 94 74 6e call 0xdce8 ; 0xdce8 for (uint8_t i = 0; i < state; i++) 1fab0: 91 2c mov r9, r1 1fab2: 89 14 cp r8, r9 1fab4: 39 f1 breq .+78 ; 0x1fb04 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1fab6: 8e e2 ldi r24, 0x2E ; 46 1fab8: 0e 94 0f 6f call 0xde1e ; 0xde1e 1fabc: 93 94 inc r9 1fabe: f9 cf rjmp .-14 ; 0x1fab2 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1fac0: 8c e5 ldi r24, 0x5C ; 92 1fac2: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1fac4: 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; 1fac6: c1 2c mov r12, r1 1fac8: d1 2c mov r13, r1 1faca: 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 1facc: 20 e1 ldi r18, 0x10 ; 16 1face: 30 e0 ldi r19, 0x00 ; 0 1fad0: a8 01 movw r20, r16 1fad2: c7 01 movw r24, r14 1fad4: b6 01 movw r22, r12 1fad6: 0e 94 c5 ed call 0x1db8a ; 0x1db8a if (header->magic != LANG_MAGIC) break; //break if not valid 1fada: 89 81 ldd r24, Y+1 ; 0x01 1fadc: 9a 81 ldd r25, Y+2 ; 0x02 1fade: ab 81 ldd r26, Y+3 ; 0x03 1fae0: bc 81 ldd r27, Y+4 ; 0x04 1fae2: 85 3a cpi r24, 0xA5 ; 165 1fae4: 9a 45 sbci r25, 0x5A ; 90 1fae6: a4 4b sbci r26, 0xB4 ; 180 1fae8: bb 44 sbci r27, 0x4B ; 75 1faea: 09 f0 breq .+2 ; 0x1faee 1faec: 71 c0 rjmp .+226 ; 0x1fbd0 if (offset) *offset = addr; if (--lang == 0) return 1; 1faee: f2 e0 ldi r31, 0x02 ; 2 1faf0: 9f 16 cp r9, r31 1faf2: c1 f2 breq .-80 ; 0x1faa4 addr += header->size; //calc address of next table 1faf4: 8d 81 ldd r24, Y+5 ; 0x05 1faf6: 9e 81 ldd r25, Y+6 ; 0x06 1faf8: c8 0e add r12, r24 1fafa: d9 1e adc r13, r25 1fafc: e1 1c adc r14, r1 1fafe: f1 1c adc r15, r1 1fb00: 9a 94 dec r9 1fb02: e4 cf rjmp .-56 ; 0x1facc lcd_print('.'); _delay(100); 1fb04: 64 e6 ldi r22, 0x64 ; 100 1fb06: 70 e0 ldi r23, 0x00 ; 0 1fb08: 80 e0 ldi r24, 0x00 ; 0 1fb0a: 90 e0 ldi r25, 0x00 ; 0 1fb0c: 0f 94 58 28 call 0x250b0 ; 0x250b0 boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1fb10: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7da> 1fb14: 88 7f andi r24, 0xF8 ; 248 1fb16: 91 e0 ldi r25, 0x01 ; 1 1fb18: 98 0d add r25, r8 1fb1a: 97 70 andi r25, 0x07 ; 7 1fb1c: 89 2b or r24, r25 1fb1e: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7da> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1fb22: 91 2c mov r9, r1 1fb24: 98 2c mov r9, r8 1fb26: 88 24 eor r8, r8 1fb28: 92 94 swap r9 1fb2a: 80 ef ldi r24, 0xF0 ; 240 1fb2c: 98 22 and r9, r24 1fb2e: 8d 81 ldd r24, Y+5 ; 0x05 1fb30: 9e 81 ldd r25, Y+6 ; 0x06 1fb32: 88 16 cp r8, r24 1fb34: 99 06 cpc r9, r25 1fb36: 08 f0 brcs .+2 ; 0x1fb3a 1fb38: 46 c0 rjmp .+140 ; 0x1fbc6 { cli(); 1fb3a: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1fb3c: 0d 81 ldd r16, Y+5 ; 0x05 1fb3e: 1e 81 ldd r17, Y+6 ; 0x06 1fb40: 08 19 sub r16, r8 1fb42: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1fb44: 01 30 cpi r16, 0x01 ; 1 1fb46: 20 e1 ldi r18, 0x10 ; 16 1fb48: 12 07 cpc r17, r18 1fb4a: 10 f0 brcs .+4 ; 0x1fb50 1fb4c: 00 e0 ldi r16, 0x00 ; 0 1fb4e: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1fb50: c7 01 movw r24, r14 1fb52: b6 01 movw r22, r12 1fb54: 68 0d add r22, r8 1fb56: 79 1d adc r23, r9 1fb58: 81 1d adc r24, r1 1fb5a: 91 1d adc r25, r1 1fb5c: 98 01 movw r18, r16 1fb5e: 40 e0 ldi r20, 0x00 ; 0 1fb60: 58 e0 ldi r21, 0x08 ; 8 1fb62: 0e 94 c5 ed call 0x1db8a ; 0x1db8a } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1fb66: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1fb68: 8a ea ldi r24, 0xAA ; 170 1fb6a: 95 e5 ldi r25, 0x55 ; 85 1fb6c: dc 01 movw r26, r24 1fb6e: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7dc> 1fb72: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7dd> 1fb76: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7de> 1fb7a: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7df> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1fb7e: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 1fb82: 83 60 ori r24, 0x03 ; 3 1fb84: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7db> boot_copy_size = (uint16_t)size; 1fb88: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7d9> 1fb8c: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7d8> boot_src_addr = (uint32_t)rptr; 1fb90: 80 e0 ldi r24, 0x00 ; 0 1fb92: 98 e0 ldi r25, 0x08 ; 8 1fb94: a0 e0 ldi r26, 0x00 ; 0 1fb96: b0 e0 ldi r27, 0x00 ; 0 1fb98: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7d0> 1fb9c: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7d1> 1fba0: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7d2> 1fba4: b0 93 f3 1f sts 0x1FF3, r27 ; 0x801ff3 <__bss_end+0x7d3> if (state == 0) { //TODO - check header integrity } bootapp_ram2flash(LANGBOOT_RAMBUFFER, _SEC_LANG_TABLE + state * LANGBOOT_BLOCKSIZE, size); 1fba8: c4 01 movw r24, r8 1fbaa: 80 50 subi r24, 0x00 ; 0 1fbac: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1fbae: b0 e0 ldi r27, 0x00 ; 0 1fbb0: a0 e0 ldi r26, 0x00 ; 0 1fbb2: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7d4> 1fbb6: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7d5> 1fbba: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7d6> 1fbbe: b0 93 f7 1f sts 0x1FF7, r27 ; 0x801ff7 <__bss_end+0x7d7> 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(); 1fbc2: 0e 94 cc 66 call 0xcd98 ; 0xcd98 1fbc6: 61 e0 ldi r22, 0x01 ; 1 1fbc8: 8e ef ldi r24, 0xFE ; 254 1fbca: 9f e0 ldi r25, 0x0F ; 15 1fbcc: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1fbd0: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 1fbd4: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 1fbd8: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 1fbdc: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7df> 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(); 1fbe0: 0e 94 af f0 call 0x1e15e ; 0x1e15e setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1fbe4: 88 23 and r24, r24 1fbe6: 51 f0 breq .+20 ; 0x1fbfc //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1fbe8: 64 e2 ldi r22, 0x24 ; 36 1fbea: 86 e6 ldi r24, 0x66 ; 102 1fbec: 92 e0 ldi r25, 0x02 ; 2 1fbee: 0e 94 86 67 call 0xcf0c ; 0xcf0c currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1fbf2: 64 e2 ldi r22, 0x24 ; 36 1fbf4: 86 e6 ldi r24, 0x66 ; 102 1fbf6: 92 e0 ldi r25, 0x02 ; 2 1fbf8: 0e 94 7e 67 call 0xcefc ; 0xcefc #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); 1fbfc: 44 e1 ldi r20, 0x14 ; 20 1fbfe: 50 e0 ldi r21, 0x00 ; 0 1fc00: 65 e1 ldi r22, 0x15 ; 21 1fc02: 7d e0 ldi r23, 0x0D ; 13 1fc04: c8 01 movw r24, r16 1fc06: 0f 94 44 dc call 0x3b888 ; 0x3b888 if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1fc0a: 8c 89 ldd r24, Y+20 ; 0x14 1fc0c: 81 11 cpse r24, r1 1fc0e: 0a c0 rjmp .+20 ; 0x1fc24 1fc10: 44 e0 ldi r20, 0x04 ; 4 1fc12: 50 e0 ldi r21, 0x00 ; 0 1fc14: 6f e8 ldi r22, 0x8F ; 143 1fc16: 7d e8 ldi r23, 0x8D ; 141 1fc18: c8 01 movw r24, r16 1fc1a: 0f 94 33 da call 0x3b466 ; 0x3b466 1fc1e: 89 2b or r24, r25 1fc20: 09 f4 brne .+2 ; 0x1fc24 1fc22: 51 c0 rjmp .+162 ; 0x1fcc6 * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1fc24: e0 90 39 05 lds r14, 0x0539 ; 0x800539 uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1fc28: 1d 8a std Y+21, r1 ; 0x15 1fc2a: 1f 8a std Y+23, r1 ; 0x17 1fc2c: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1fc2e: 10 92 39 05 sts 0x0539, r1 ; 0x800539 timeout.start(); 1fc32: ce 01 movw r24, r28 1fc34: 45 96 adiw r24, 0x15 ; 21 1fc36: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1fc3a: 62 e3 ldi r22, 0x32 ; 50 1fc3c: 70 e0 ldi r23, 0x00 ; 0 1fc3e: 80 e0 ldi r24, 0x00 ; 0 1fc40: 90 e0 ldi r25, 0x00 ; 0 1fc42: 0f 94 58 28 call 0x250b0 ; 0x250b0 // 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; 1fc46: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 1fc4a: 90 91 9c 04 lds r25, 0x049C ; 0x80049c 1fc4e: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 1fc52: 80 93 99 04 sts 0x0499, r24 ; 0x800499 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1fc56: 82 ea ldi r24, 0xA2 ; 162 1fc58: 9c e8 ldi r25, 0x8C ; 140 1fc5a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 1fc5e: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1fc60: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1fc62: 33 e1 ldi r19, 0x13 ; 19 1fc64: f3 16 cp r15, r19 1fc66: a1 f0 breq .+40 ; 0x1fc90 { if (timeout.expired(250u)) 1fc68: 6a ef ldi r22, 0xFA ; 250 1fc6a: 70 e0 ldi r23, 0x00 ; 0 1fc6c: ce 01 movw r24, r28 1fc6e: 45 96 adiw r24, 0x15 ; 21 1fc70: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 1fc74: 81 11 cpse r24, r1 1fc76: c1 c0 rjmp .+386 ; 0x1fdfa goto exit; if (MYSERIAL.available() > 0) 1fc78: 0e 94 89 76 call 0xed12 ; 0xed12 1fc7c: 18 16 cp r1, r24 1fc7e: 19 06 cpc r1, r25 1fc80: 84 f7 brge .-32 ; 0x1fc62 { SN[rxIndex] = MYSERIAL.read(); 1fc82: 0f 94 3c d6 call 0x3ac78 ; 0x3ac78 1fc86: d6 01 movw r26, r12 1fc88: 8d 93 st X+, r24 1fc8a: 6d 01 movw r12, r26 rxIndex++; 1fc8c: f3 94 inc r15 1fc8e: e9 cf rjmp .-46 ; 0x1fc62 } } SN[rxIndex] = 0; 1fc90: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1fc92: 44 e0 ldi r20, 0x04 ; 4 1fc94: 50 e0 ldi r21, 0x00 ; 0 1fc96: 6d e9 ldi r22, 0x9D ; 157 1fc98: 7c e8 ldi r23, 0x8C ; 140 1fc9a: c8 01 movw r24, r16 1fc9c: 0f 94 33 da call 0x3b466 ; 0x3b466 ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1fca0: 89 2b or r24, r25 1fca2: 59 f6 brne .-106 ; 0x1fc3a 1fca4: 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; 1fca6: e0 92 39 05 sts 0x0539, r14 ; 0x800539 { 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)) 1fcaa: 88 23 and r24, r24 1fcac: 09 f4 brne .+2 ; 0x1fcb0 1fcae: a7 c0 rjmp .+334 ; 0x1fdfe #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); 1fcb0: 44 e1 ldi r20, 0x14 ; 20 1fcb2: 50 e0 ldi r21, 0x00 ; 0 1fcb4: 65 e1 ldi r22, 0x15 ; 21 1fcb6: 7d e0 ldi r23, 0x0D ; 13 1fcb8: c8 01 movw r24, r16 1fcba: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1fcbe: 84 e8 ldi r24, 0x84 ; 132 1fcc0: 9d e8 ldi r25, 0x8D ; 141 } else puts_P(PSTR("SN update failed")); 1fcc2: 0f 94 3d db call 0x3b67a ; 0x3b67a #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1fcc6: a1 10 cpse r10, r1 1fcc8: 04 c0 rjmp .+8 ; 0x1fcd2 1fcca: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1fcce: 88 23 and r24, r24 1fcd0: 21 f0 breq .+8 ; 0x1fcda SERIAL_PROTOCOLLNPGM("start"); 1fcd2: 8d e6 ldi r24, 0x6D ; 109 1fcd4: 9d e8 ldi r25, 0x8D ; 141 1fcd6: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 #endif SERIAL_ECHO_START; 1fcda: 82 ec ldi r24, 0xC2 ; 194 1fcdc: 9a ea ldi r25, 0xAA ; 170 1fcde: 0e 94 d0 76 call 0xeda0 ; 0xeda0 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1fce2: 86 e5 ldi r24, 0x56 ; 86 1fce4: 9d e8 ldi r25, 0x8D ; 141 1fce6: 0f 94 3d db call 0x3b67a ; 0x3b67a // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1fcea: 60 e0 ldi r22, 0x00 ; 0 1fcec: 8c ea ldi r24, 0xAC ; 172 1fcee: 9c e0 ldi r25, 0x0C ; 12 1fcf0: 0e 94 89 75 call 0xeb12 ; 0xeb12 1fcf4: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1fcf6: 0e 94 6e e4 call 0x1c8dc ; 0x1c8dc } MMU2::mmu2.Status(); 1fcfa: 0f 94 1e 76 call 0x2ec3c ; 0x2ec3c } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1fcfe: 85 ea ldi r24, 0xA5 ; 165 1fd00: 9c e8 ldi r25, 0x8C ; 140 1fd02: 0e 94 d0 76 call 0xeda0 ; 0xeda0 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1fd06: 62 e0 ldi r22, 0x02 ; 2 1fd08: 86 ed ldi r24, 0xD6 ; 214 1fd0a: 9e e0 ldi r25, 0x0E ; 14 1fd0c: 0e 94 89 75 call 0xeb12 ; 0xeb12 if (status == (uint8_t)EEPROM::Enabled) 1fd10: 81 30 cpi r24, 0x01 ; 1 1fd12: 09 f0 breq .+2 ; 0x1fd16 1fd14: 77 c0 rjmp .+238 ; 0x1fe04 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1fd16: 89 e1 ldi r24, 0x19 ; 25 1fd18: 9c e5 ldi r25, 0x5C ; 92 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1fd1a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1fd1e: 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); 1fd20: f0 fe sbrs r15, 0 1fd22: 04 c0 rjmp .+8 ; 0x1fd2c 1fd24: 87 ee ldi r24, 0xE7 ; 231 1fd26: 9c e6 ldi r25, 0x6C ; 108 1fd28: 0f 94 3d db call 0x3b67a ; 0x3b67a if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1fd2c: f1 fe sbrs r15, 1 1fd2e: 04 c0 rjmp .+8 ; 0x1fd38 1fd30: 87 ed ldi r24, 0xD7 ; 215 1fd32: 9c e6 ldi r25, 0x6C ; 108 1fd34: 0f 94 3d db call 0x3b67a ; 0x3b67a if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1fd38: f2 fe sbrs r15, 2 1fd3a: 04 c0 rjmp .+8 ; 0x1fd44 1fd3c: 86 ec ldi r24, 0xC6 ; 198 1fd3e: 9c e6 ldi r25, 0x6C ; 108 1fd40: 0f 94 3d db call 0x3b67a ; 0x3b67a if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1fd44: f3 fe sbrs r15, 3 1fd46: 04 c0 rjmp .+8 ; 0x1fd50 1fd48: 86 eb ldi r24, 0xB6 ; 182 1fd4a: 9c e6 ldi r25, 0x6C ; 108 1fd4c: 0f 94 3d db call 0x3b67a ; 0x3b67a if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1fd50: f5 fe sbrs r15, 5 1fd52: 04 c0 rjmp .+8 ; 0x1fd5c 1fd54: 86 ea ldi r24, 0xA6 ; 166 1fd56: 9c e6 ldi r25, 0x6C ; 108 1fd58: 0f 94 3d db call 0x3b67a ; 0x3b67a MCUSR = 0; 1fd5c: 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; 1fd5e: 82 ec ldi r24, 0xC2 ; 194 1fd60: 9a ea ldi r25, 0xAA ; 170 1fd62: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1fd66: 86 e9 ldi r24, 0x96 ; 150 1fd68: 9c e6 ldi r25, 0x6C ; 108 1fd6a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1fd6e: 82 e4 ldi r24, 0x42 ; 66 1fd70: 9d e8 ldi r25, 0x8D ; 141 1fd72: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1fd76: 8a e8 ldi r24, 0x8A ; 138 1fd78: 9c e6 ldi r25, 0x6C ; 108 1fd7a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1fd7e: 8a e3 ldi r24, 0x3A ; 58 1fd80: 9d e8 ldi r25, 0x8D ; 141 1fd82: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 #endif #endif SERIAL_ECHO_START; 1fd86: 82 ec ldi r24, 0xC2 ; 194 1fd88: 9a ea ldi r25, 0xAA ; 170 1fd8a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1fd8e: 8b e7 ldi r24, 0x7B ; 123 1fd90: 9c e6 ldi r25, 0x6C ; 108 1fd92: 0e 94 d0 76 call 0xeda0 ; 0xeda0 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1fd96: 80 91 16 18 lds r24, 0x1816 ; 0x801816 <__brkval> 1fd9a: 90 91 17 18 lds r25, 0x1817 ; 0x801817 <__brkval+0x1> 1fd9e: 00 97 sbiw r24, 0x00 ; 0 1fda0: a1 f1 breq .+104 ; 0x1fe0a 1fda2: 08 1b sub r16, r24 1fda4: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1fda6: b8 01 movw r22, r16 1fda8: 11 0f add r17, r17 1fdaa: 88 0b sbc r24, r24 1fdac: 99 0b sbc r25, r25 1fdae: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1fdb2: 84 e6 ldi r24, 0x64 ; 100 1fdb4: 9c e6 ldi r25, 0x6C ; 108 1fdb6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1fdba: 80 ee ldi r24, 0xE0 ; 224 1fdbc: 96 e0 ldi r25, 0x06 ; 6 1fdbe: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 #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); 1fdc2: 6c e2 ldi r22, 0x2C ; 44 1fdc4: 71 e0 ldi r23, 0x01 ; 1 1fdc6: 8e ee ldi r24, 0xEE ; 238 1fdc8: 9e e0 ldi r25, 0x0E ; 14 1fdca: 0e 94 71 75 call 0xeae2 ; 0xeae2 1fdce: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1fdd0: 66 e3 ldi r22, 0x36 ; 54 1fdd2: 71 e0 ldi r23, 0x01 ; 1 1fdd4: 8c ee ldi r24, 0xEC ; 236 1fdd6: 9e e0 ldi r25, 0x0E ; 14 1fdd8: 0e 94 71 75 call 0xeae2 ; 0xeae2 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1fddc: 0c 32 cpi r16, 0x2C ; 44 1fdde: 11 40 sbci r17, 0x01 ; 1 1fde0: 11 f0 breq .+4 ; 0x1fde6 1fde2: 0d 94 e9 06 jmp 0x20dd2 ; 0x20dd2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1fde6: 01 e0 ldi r16, 0x01 ; 1 1fde8: 86 33 cpi r24, 0x36 ; 54 1fdea: 91 40 sbci r25, 0x01 ; 1 1fdec: 09 f4 brne .+2 ; 0x1fdf0 1fdee: 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(); 1fdf0: 0e 94 34 93 call 0x12668 ; 0x12668 1fdf4: f8 2e mov r15, r24 1fdf6: 0d 94 f1 06 jmp 0x20de2 ; 0x20de2 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1fdfa: 80 e0 ldi r24, 0x00 ; 0 1fdfc: 54 cf rjmp .-344 ; 0x1fca6 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1fdfe: 83 e7 ldi r24, 0x73 ; 115 1fe00: 9d e8 ldi r25, 0x8D ; 141 1fe02: 5f cf rjmp .-322 ; 0x1fcc2 1fe04: 83 e1 ldi r24, 0x13 ; 19 1fe06: 9c e5 ldi r25, 0x5C ; 92 1fe08: 88 cf rjmp .-240 ; 0x1fd1a 1fe0a: 00 52 subi r16, 0x20 ; 32 1fe0c: 18 41 sbci r17, 0x18 ; 24 1fe0e: cb cf rjmp .-106 ; 0x1fda6 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1fe10: 81 e3 ldi r24, 0x31 ; 49 1fe12: 91 e0 ldi r25, 0x01 ; 1 1fe14: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.472+0x1> 1fe18: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.472> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1fe1c: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.465> 1fe20: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.465+0x1> 1fe24: 0f 94 54 a1 call 0x342a8 ; 0x342a8 1fe28: 20 e0 ldi r18, 0x00 ; 0 1fe2a: 30 e8 ldi r19, 0x80 ; 128 1fe2c: 48 e9 ldi r20, 0x98 ; 152 1fe2e: 53 e4 ldi r21, 0x43 ; 67 1fe30: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1fe34: 18 16 cp r1, r24 1fe36: 54 f4 brge .+20 ; 0x1fe4c #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1fe38: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.465> 1fe3c: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.465+0x1> 1fe40: 40 96 adiw r24, 0x10 ; 16 1fe42: 90 93 a2 04 sts 0x04A2, r25 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.465+0x1> 1fe46: 80 93 a1 04 sts 0x04A1, r24 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.465> 1fe4a: e8 cf rjmp .-48 ; 0x1fe1c #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1fe4c: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.473> 1fe50: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.473+0x1> 1fe54: 0f 94 bb 35 call 0x26b76 ; 0x26b76 1fe58: 20 e0 ldi r18, 0x00 ; 0 1fe5a: 30 e0 ldi r19, 0x00 ; 0 1fe5c: 40 e2 ldi r20, 0x20 ; 32 1fe5e: 51 e4 ldi r21, 0x41 ; 65 1fe60: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1fe64: 87 ff sbrs r24, 7 1fe66: 0a c0 rjmp .+20 ; 0x1fe7c #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1fe68: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.473> 1fe6c: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.473+0x1> 1fe70: 40 97 sbiw r24, 0x10 ; 16 1fe72: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.473+0x1> 1fe76: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.473> 1fe7a: e8 cf rjmp .-48 ; 0x1fe4c #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1fe7c: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.466> 1fe80: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.466+0x1> 1fe84: 0f 94 bb 35 call 0x26b76 ; 0x26b76 1fe88: 20 e0 ldi r18, 0x00 ; 0 1fe8a: 30 e0 ldi r19, 0x00 ; 0 1fe8c: 4a ef ldi r20, 0xFA ; 250 1fe8e: 52 e4 ldi r21, 0x42 ; 66 1fe90: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1fe94: 18 16 cp r1, r24 1fe96: 54 f4 brge .+20 ; 0x1feac #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1fe98: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.466> 1fe9c: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.466+0x1> 1fea0: 40 96 adiw r24, 0x10 ; 16 1fea2: 90 93 a0 04 sts 0x04A0, r25 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.466+0x1> 1fea6: 80 93 9f 04 sts 0x049F, r24 ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.466> 1feaa: e8 cf rjmp .-48 ; 0x1fe7c #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1feac: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.464> 1feb0: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.464+0x1> 1feb4: 0f 94 26 35 call 0x26a4c ; 0x26a4c 1feb8: 20 e0 ldi r18, 0x00 ; 0 1feba: 30 e0 ldi r19, 0x00 ; 0 1febc: 40 ef ldi r20, 0xF0 ; 240 1febe: 51 ec ldi r21, 0xC1 ; 193 1fec0: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 1fec4: 87 ff sbrs r24, 7 1fec6: 0a c0 rjmp .+20 ; 0x1fedc #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1fec8: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.464> 1fecc: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.464+0x1> 1fed0: 40 97 sbiw r24, 0x10 ; 16 1fed2: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.464+0x1> 1fed6: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.464> 1feda: e8 cf rjmp .-48 ; 0x1feac #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1fedc: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.467> 1fee0: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.467+0x1> 1fee4: 0f 94 26 35 call 0x26a4c ; 0x26a4c 1fee8: 20 e0 ldi r18, 0x00 ; 0 1feea: 30 e0 ldi r19, 0x00 ; 0 1feec: 40 ea ldi r20, 0xA0 ; 160 1feee: 52 e4 ldi r21, 0x42 ; 66 1fef0: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 1fef4: 18 16 cp r1, r24 1fef6: 54 f4 brge .+20 ; 0x1ff0c #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1fef8: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.467> 1fefc: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.467+0x1> 1ff00: 40 96 adiw r24, 0x10 ; 16 1ff02: 90 93 9e 04 sts 0x049E, r25 ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.467+0x1> 1ff06: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.467> 1ff0a: e8 cf rjmp .-48 ; 0x1fedc #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1ff0c: 9f b7 in r25, 0x3f ; 63 1ff0e: f8 94 cli TCNT0 = 0; 1ff10: 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; 1ff12: 8f ef ldi r24, 0xFF ; 255 1ff14: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1ff16: 83 e3 ldi r24, 0x33 ; 51 1ff18: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1ff1a: 12 e0 ldi r17, 0x02 ; 2 1ff1c: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1ff1e: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1ff22: 81 60 ori r24, 0x01 ; 1 1ff24: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1ff28: 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; 1ff2a: 80 e8 ldi r24, 0x80 ; 128 1ff2c: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1ff30: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1ff34: 84 60 ori r24, 0x04 ; 4 1ff36: 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; 1ff3a: 2f b7 in r18, 0x3f ; 63 1ff3c: f8 94 cli SET_OUTPUT(BEEPER); 1ff3e: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1ff42: 84 60 ori r24, 0x04 ; 4 1ff44: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1ff48: 9f b7 in r25, 0x3f ; 63 1ff4a: f8 94 cli 1ff4c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff50: 8b 7f andi r24, 0xFB ; 251 1ff52: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff56: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1ff58: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1ff5c: 80 62 ori r24, 0x20 ; 32 1ff5e: 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); 1ff62: 81 e0 ldi r24, 0x01 ; 1 1ff64: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1ff68: 85 e1 ldi r24, 0x15 ; 21 1ff6a: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1ff6e: 8f ef ldi r24, 0xFF ; 255 1ff70: 90 e0 ldi r25, 0x00 ; 0 1ff72: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1ff76: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1ff7a: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1ff7e: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1ff82: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1ff86: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1ff8a: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1ff8e: 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")); 1ff90: 83 eb ldi r24, 0xB3 ; 179 1ff92: 9c e8 ldi r25, 0x8C ; 140 1ff94: 0f 94 3d db call 0x3b67a ; 0x3b67a DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1ff98: 8f e5 ldi r24, 0x5F ; 95 1ff9a: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1ff9e: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1ffa2: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1ffa6: 80 64 ori r24, 0x40 ; 64 1ffa8: 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); 1ffac: 8f e9 ldi r24, 0x9F ; 159 1ffae: 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(); 1ffb2: 0e 94 5f 8d call 0x11abe ; 0x11abe // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1ffb6: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1ffb8: f8 94 cli // CTC TCCRxB &= ~(1< 1ffbe: 8f 7e andi r24, 0xEF ; 239 1ffc0: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1ffc8: 88 60 ori r24, 0x08 ; 8 1ffca: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1ffd2: 8d 7f andi r24, 0xFD ; 253 1ffd4: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1ffdc: 8e 7f andi r24, 0xFE ; 254 1ffde: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1ffe6: 8f 73 andi r24, 0x3F ; 63 1ffe8: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1fff0: 8f 7c andi r24, 0xCF ; 207 1fff2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fffa: 84 60 ori r24, 0x04 ; 4 1fffc: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 20004: 8d 7f andi r24, 0xFD ; 253 20006: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 2000e: 8e 7f andi r24, 0xFE ; 254 20010: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 20014: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 20018: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 2001c: 2b ee ldi r18, 0xEB ; 235 2001e: 31 e4 ldi r19, 0x41 ; 65 20020: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 20024: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 20028: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 2002a: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 2002e: 82 60 ori r24, 0x02 ; 2 20030: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 20034: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 20036: 10 92 a5 0d sts 0x0DA5, r1 ; 0x800da5 block_buffer_tail = 0; 2003a: 10 92 a6 0d sts 0x0DA6, r1 ; 0x800da6 memset(position, 0, sizeof(position)); // clear position 2003e: 80 e1 ldi r24, 0x10 ; 16 20040: e3 ea ldi r30, 0xA3 ; 163 20042: f6 e0 ldi r31, 0x06 ; 6 20044: df 01 movw r26, r30 20046: 28 2f mov r18, r24 20048: 1d 92 st X+, r1 2004a: 2a 95 dec r18 2004c: e9 f7 brne .-6 ; 0x20048 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 2004e: ed ec ldi r30, 0xCD ; 205 20050: f4 e0 ldi r31, 0x04 ; 4 20052: df 01 movw r26, r30 20054: 28 2f mov r18, r24 20056: 1d 92 st X+, r1 20058: 2a 95 dec r18 2005a: e9 f7 brne .-6 ; 0x20056 #endif memset(previous_speed, 0, sizeof(previous_speed)); 2005c: ed eb ldi r30, 0xBD ; 189 2005e: f4 e0 ldi r31, 0x04 ; 4 20060: df 01 movw r26, r30 20062: 1d 92 st X+, r1 20064: 8a 95 dec r24 20066: e9 f7 brne .-6 ; 0x20062 previous_nominal_speed = 0.0; 20068: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.490> 2006c: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.490+0x1> 20070: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.490+0x2> 20074: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.490+0x3> plan_reset_next_e_queue = false; 20078: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.488> plan_reset_next_e_sched = false; 2007c: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.489> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 20080: 84 e0 ldi r24, 0x04 ; 4 20082: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be if (!READ(BTN_ENC)) 20086: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 2008a: 86 fd sbrc r24, 6 2008c: ca c0 rjmp .+404 ; 0x20222 2008e: bf ef ldi r27, 0xFF ; 255 20090: e3 ed ldi r30, 0xD3 ; 211 20092: f0 e3 ldi r31, 0x30 ; 48 20094: b1 50 subi r27, 0x01 ; 1 20096: e0 40 sbci r30, 0x00 ; 0 20098: f0 40 sbci r31, 0x00 ; 0 2009a: e1 f7 brne .-8 ; 0x20094 2009c: 00 c0 rjmp .+0 ; 0x2009e 2009e: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 200a0: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 200a4: 86 fd sbrc r24, 6 200a6: bd c0 rjmp .+378 ; 0x20222 { lcd_clear(); 200a8: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_P(PSTR("Factory RESET")); 200ac: 8d e0 ldi r24, 0x0D ; 13 200ae: 9d e8 ldi r25, 0x8D ; 141 200b0: 0e 94 4b 6e call 0xdc96 ; 0xdc96 SET_OUTPUT(BEEPER); 200b4: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 200b8: 84 60 ori r24, 0x04 ; 4 200ba: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 200be: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 200c2: 82 30 cpi r24, 0x02 ; 2 200c4: 41 f0 breq .+16 ; 0x200d6 WRITE(BEEPER, HIGH); 200c6: 9f b7 in r25, 0x3f ; 63 200c8: f8 94 cli 200ca: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 200ce: 84 60 ori r24, 0x04 ; 4 200d0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 200d4: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 200d6: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 200da: 86 ff sbrs r24, 6 200dc: fc cf rjmp .-8 ; 0x200d6 WRITE(BEEPER, LOW); 200de: 9f b7 in r25, 0x3f ; 63 200e0: f8 94 cli 200e2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 200e6: 8b 7f andi r24, 0xFB ; 251 200e8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 200ec: 9f bf out 0x3f, r25 ; 63 200ee: 2f ef ldi r18, 0xFF ; 255 200f0: 37 ea ldi r19, 0xA7 ; 167 200f2: 81 e6 ldi r24, 0x61 ; 97 200f4: 21 50 subi r18, 0x01 ; 1 200f6: 30 40 sbci r19, 0x00 ; 0 200f8: 80 40 sbci r24, 0x00 ; 0 200fa: e1 f7 brne .-8 ; 0x200f4 200fc: 00 c0 rjmp .+0 ; 0x200fe 200fe: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 20100: 83 ef ldi r24, 0xF3 ; 243 20102: 9c e8 ldi r25, 0x8C ; 140 20104: 9a 83 std Y+2, r25 ; 0x02 20106: 89 83 std Y+1, r24 ; 0x01 20108: 88 ee ldi r24, 0xE8 ; 232 2010a: 9c e8 ldi r25, 0x8C ; 140 2010c: 9c 83 std Y+4, r25 ; 0x04 2010e: 8b 83 std Y+3, r24 ; 0x03 20110: 8a ed ldi r24, 0xDA ; 218 20112: 9c e8 ldi r25, 0x8C ; 140 20114: 9e 83 std Y+6, r25 ; 0x06 20116: 8d 83 std Y+5, r24 ; 0x05 20118: 8d ec ldi r24, 0xCD ; 205 2011a: 9c e8 ldi r25, 0x8C ; 140 2011c: 98 87 std Y+8, r25 ; 0x08 2011e: 8f 83 std Y+7, r24 ; 0x07 20120: 84 ec ldi r24, 0xC4 ; 196 20122: 9c e8 ldi r25, 0x8C ; 140 20124: 9a 87 std Y+10, r25 ; 0x0a 20126: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 20128: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_putc_at(0, 0, '>'); 2012c: 4e e3 ldi r20, 0x3E ; 62 2012e: 60 e0 ldi r22, 0x00 ; 0 20130: 80 e0 ldi r24, 0x00 ; 0 20132: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_consume_click(); 20136: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 2013a: 10 e0 ldi r17, 0x00 ; 0 2013c: d1 2c mov r13, r1 2013e: 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]); 20140: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 20144: f6 01 movw r30, r12 20146: e8 0f add r30, r24 20148: f1 1d adc r31, r1 2014a: 87 fd sbrc r24, 7 2014c: fa 95 dec r31 2014e: ee 0f add r30, r30 20150: ff 1f adc r31, r31 20152: a1 e0 ldi r26, 0x01 ; 1 20154: b0 e0 ldi r27, 0x00 ; 0 20156: ac 0f add r26, r28 20158: bd 1f adc r27, r29 2015a: ea 0f add r30, r26 2015c: fb 1f adc r31, r27 2015e: 40 81 ld r20, Z 20160: 51 81 ldd r21, Z+1 ; 0x01 20162: 6c 2d mov r22, r12 20164: 81 e0 ldi r24, 0x01 ; 1 20166: 0e 94 74 6e call 0xdce8 ; 0xdce8 2016a: bf ef ldi r27, 0xFF ; 255 2016c: cb 1a sub r12, r27 2016e: 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++) { 20170: e4 e0 ldi r30, 0x04 ; 4 20172: ce 16 cp r12, r30 20174: d1 04 cpc r13, r1 20176: 21 f7 brne .-56 ; 0x20140 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 20178: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 2017c: 81 e0 ldi r24, 0x01 ; 1 2017e: 0e 94 37 8a call 0x1146e ; 0x1146e if (lcd_encoder) { 20182: 80 91 70 06 lds r24, 0x0670 ; 0x800670 20186: 90 91 71 06 lds r25, 0x0671 ; 0x800671 2018a: 00 97 sbiw r24, 0x00 ; 0 2018c: 71 f1 breq .+92 ; 0x201ea if (lcd_encoder < 0) { 2018e: 97 ff sbrs r25, 7 20190: 12 c0 rjmp .+36 ; 0x201b6 cursor_pos--; 20192: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 20194: 14 30 cpi r17, 0x04 ; 4 20196: 0c f4 brge .+2 ; 0x2019a 20198: a6 c0 rjmp .+332 ; 0x202e6 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 2019a: 87 e0 ldi r24, 0x07 ; 7 2019c: 0f 94 0c 4f call 0x29e18 ; 0x29e18 if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 201a0: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 201a4: 18 16 cp r1, r24 201a6: 2c f0 brlt .+10 ; 0x201b2 first++; 201a8: 8f 5f subi r24, 0xFF ; 255 201aa: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 201ae: 0e 94 93 6e call 0xdd26 ; 0xdd26 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 201b2: 13 e0 ldi r17, 0x03 ; 3 201b4: 03 c0 rjmp .+6 ; 0x201bc if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 201b6: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 201b8: 14 30 cpi r17, 0x04 ; 4 201ba: 78 f7 brcc .-34 ; 0x2019a if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 201bc: 4c eb ldi r20, 0xBC ; 188 201be: 5c e8 ldi r21, 0x8C ; 140 201c0: 60 e0 ldi r22, 0x00 ; 0 201c2: 80 e0 ldi r24, 0x00 ; 0 201c4: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(0, cursor_pos); 201c8: 61 2f mov r22, r17 201ca: 80 e0 ldi r24, 0x00 ; 0 201cc: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_putc('>'); 201d0: 8e e3 ldi r24, 0x3E ; 62 201d2: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_encoder = 0; 201d6: 10 92 71 06 sts 0x0671, r1 ; 0x800671 201da: 10 92 70 06 sts 0x0670, r1 ; 0x800670 _delay(100); 201de: 64 e6 ldi r22, 0x64 ; 100 201e0: 70 e0 ldi r23, 0x00 ; 0 201e2: 80 e0 ldi r24, 0x00 ; 0 201e4: 90 e0 ldi r25, 0x00 ; 0 201e6: 0f 94 58 28 call 0x250b0 ; 0x250b0 } if (lcd_clicked()) { 201ea: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 201ee: 88 23 and r24, r24 201f0: 09 f4 brne .+2 ; 0x201f4 201f2: a4 cf rjmp .-184 ; 0x2013c return(cursor_pos + first); 201f4: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 201f8: 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(); 201fa: 0e 94 93 6e call 0xdd26 ; 0xdd26 Sound_MakeCustom(100,0,false); 201fe: 40 e0 ldi r20, 0x00 ; 0 20200: 70 e0 ldi r23, 0x00 ; 0 20202: 60 e0 ldi r22, 0x00 ; 0 20204: 84 e6 ldi r24, 0x64 ; 100 20206: 90 e0 ldi r25, 0x00 ; 0 20208: 0f 94 81 52 call 0x2a502 ; 0x2a502 switch (level) { 2020c: 12 30 cpi r17, 0x02 ; 2 2020e: 09 f4 brne .+2 ; 0x20212 20210: a0 c0 rjmp .+320 ; 0x20352 20212: 08 f0 brcs .+2 ; 0x20216 20214: 79 c0 rjmp .+242 ; 0x20308 20216: 11 23 and r17, r17 20218: 09 f4 brne .+2 ; 0x2021c 2021a: 93 c0 rjmp .+294 ; 0x20342 2021c: 11 30 cpi r17, 0x01 ; 1 2021e: 09 f4 brne .+2 ; 0x20222 20220: 93 c0 rjmp .+294 ; 0x20348 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 20222: 82 e0 ldi r24, 0x02 ; 2 20224: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be plan_init(); // Initialize planner; factory_reset(); eeprom_init_default_byte((uint8_t*)EEPROM_SILENT, SILENT_MODE_OFF); 20228: 60 e0 ldi r22, 0x00 ; 0 2022a: 8f ef ldi r24, 0xFF ; 255 2022c: 9f e0 ldi r25, 0x0F ; 15 2022e: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 20232: 61 e0 ldi r22, 0x01 ; 1 20234: 8f e5 ldi r24, 0x5F ; 95 20236: 9f e0 ldi r25, 0x0F ; 15 20238: 0e 94 89 75 call 0xeb12 ; 0xeb12 #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 2023c: 8f ef ldi r24, 0xFF ; 255 2023e: 9f e0 ldi r25, 0x0F ; 15 20240: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 20244: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 20246: 8f 3f cpi r24, 0xFF ; 255 20248: 09 f4 brne .+2 ; 0x2024c 2024a: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 2024c: 10 92 8c 06 sts 0x068C, r1 ; 0x80068c tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); 20250: 61 e0 ldi r22, 0x01 ; 1 20252: 89 e6 ldi r24, 0x69 ; 105 20254: 9f e0 ldi r25, 0x0F ; 15 20256: 0e 94 89 75 call 0xeb12 ; 0xeb12 2025a: 91 e0 ldi r25, 0x01 ; 1 2025c: 81 11 cpse r24, r1 2025e: 01 c0 rjmp .+2 ; 0x20262 20260: 90 e0 ldi r25, 0x00 ; 0 20262: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 20266: 88 23 and r24, r24 20268: 09 f4 brne .+2 ; 0x2026c 2026a: a5 c0 rjmp .+330 ; 0x203b6 puts_P(_N("CrashDetect ENABLED!")); 2026c: 8f e4 ldi r24, 0x4F ; 79 2026e: 9c e6 ldi r25, 0x6C ; 108 } else { puts_P(_N("CrashDetect DISABLED")); 20270: 0f 94 3d db call 0x3b67a ; 0x3b67a } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 20274: 87 ef ldi r24, 0xF7 ; 247 20276: 9e e0 ldi r25, 0x0E ; 14 20278: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2027c: c8 2e mov r12, r24 2027e: 80 93 f9 04 sts 0x04F9, r24 ; 0x8004f9 tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 20282: 86 ef ldi r24, 0xF6 ; 246 20284: 9e e0 ldi r25, 0x0E ; 14 20286: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2028a: d8 2e mov r13, r24 2028c: 80 93 fa 04 sts 0x04FA, r24 ; 0x8004fa tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 20290: 85 ef ldi r24, 0xF5 ; 245 20292: 9e e0 ldi r25, 0x0E ; 14 20294: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 20298: e8 2e mov r14, r24 2029a: 80 93 fb 04 sts 0x04FB, r24 ; 0x8004fb #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[E_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_E_FAC); 2029e: 84 ef ldi r24, 0xF4 ; 244 202a0: 9e e0 ldi r25, 0x0E ; 14 202a2: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 202a6: 80 93 fc 04 sts 0x04FC, r24 ; 0x8004fc if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 202aa: 2f ef ldi r18, 0xFF ; 255 202ac: c2 12 cpse r12, r18 202ae: 02 c0 rjmp .+4 ; 0x202b4 202b0: 10 92 f9 04 sts 0x04F9, r1 ; 0x8004f9 if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 202b4: 3f ef ldi r19, 0xFF ; 255 202b6: d3 12 cpse r13, r19 202b8: 02 c0 rjmp .+4 ; 0x202be 202ba: 10 92 fa 04 sts 0x04FA, r1 ; 0x8004fa if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 202be: 9f ef ldi r25, 0xFF ; 255 202c0: e9 12 cpse r14, r25 202c2: 02 c0 rjmp .+4 ; 0x202c8 202c4: 10 92 fb 04 sts 0x04FB, r1 ; 0x8004fb if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 202c8: 8f 3f cpi r24, 0xFF ; 255 202ca: 11 f4 brne .+4 ; 0x202d0 202cc: 10 92 fc 04 sts 0x04FC, r1 ; 0x8004fc #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 202d0: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 202d4: 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--; 202d6: 28 e0 ldi r18, 0x08 ; 8 202d8: 96 95 lsr r25 202da: 87 95 ror r24 202dc: 00 97 sbiw r24, 0x00 ; 0 202de: 09 f4 brne .+2 ; 0x202e2 202e0: 6d c0 rjmp .+218 ; 0x203bc 202e2: 21 50 subi r18, 0x01 ; 1 202e4: f9 cf rjmp .-14 ; 0x202d8 first++; lcd_clear(); } } if (cursor_pos < 0) { 202e6: 1f 3f cpi r17, 0xFF ; 255 202e8: 09 f0 breq .+2 ; 0x202ec 202ea: 68 cf rjmp .-304 ; 0x201bc cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 202ec: 87 e0 ldi r24, 0x07 ; 7 202ee: 0f 94 0c 4f call 0x29e18 ; 0x29e18 if (first > 0) { 202f2: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 202f6: 18 16 cp r1, r24 202f8: 2c f4 brge .+10 ; 0x20304 first--; 202fa: 81 50 subi r24, 0x01 ; 1 202fc: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 20300: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 20304: 10 e0 ldi r17, 0x00 ; 0 20306: 5a cf rjmp .-332 ; 0x201bc // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 20308: 13 30 cpi r17, 0x03 ; 3 2030a: 29 f1 breq .+74 ; 0x20356 2030c: 14 30 cpi r17, 0x04 ; 4 2030e: 09 f0 breq .+2 ; 0x20312 20310: 88 cf rjmp .-240 ; 0x20222 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 20312: 6c ef ldi r22, 0xFC ; 252 20314: 7c e8 ldi r23, 0x8C ; 140 20316: 80 e0 ldi r24, 0x00 ; 0 20318: 90 e1 ldi r25, 0x10 ; 16 2031a: 0f 94 30 d0 call 0x3a060 ; 0x3a060 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 2031e: 10 e0 ldi r17, 0x00 ; 0 20320: 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); 20322: 6f ef ldi r22, 0xFF ; 255 20324: c8 01 movw r24, r16 20326: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 2032a: c8 01 movw r24, r16 2032c: 0f 94 01 d0 call 0x3a002 ; 0x3a002 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 20330: 0f 5f subi r16, 0xFF ; 255 20332: 1f 4f sbci r17, 0xFF ; 255 20334: 01 15 cp r16, r1 20336: f0 e1 ldi r31, 0x10 ; 16 20338: 1f 07 cpc r17, r31 2033a: 99 f7 brne .-26 ; 0x20322 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 2033c: 0f 94 22 d0 call 0x3a044 ; 0x3a044 20340: 40 cc rjmp .-1920 ; 0x1fbc2 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 20342: 0e 94 ac 70 call 0xe158 ; 0xe158 20346: 6d cf rjmp .-294 ; 0x20222 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 20348: 0e 94 91 66 call 0xcd22 ; 0xcd22 lcd_menu_statistics(); 2034c: 0f 94 da 3f call 0x27fb4 ; 0x27fb4 20350: 68 cf rjmp .-304 ; 0x20222 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 20352: 0e 94 91 66 call 0xcd22 ; 0xcd22 // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 20356: 0e 94 ac 70 call 0xe158 ; 0xe158 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 2035a: 84 e0 ldi r24, 0x04 ; 4 2035c: 0e 94 1b ef call 0x1de36 ; 0x1de36 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); 20360: 62 e0 ldi r22, 0x02 ; 2 20362: 8f e5 ldi r24, 0x5F ; 95 20364: 9f e0 ldi r25, 0x0F ; 15 20366: 0f 94 9c dc call 0x3b938 ; 0x3b938 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 2036a: 81 e0 ldi r24, 0x01 ; 1 2036c: 0e 94 4f 74 call 0xe89e ; 0xe89e fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 20370: 11 e0 ldi r17, 0x01 ; 1 20372: 10 93 ab 17 sts 0x17AB, r17 ; 0x8017ab if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20376: 61 e0 ldi r22, 0x01 ; 1 20378: 87 e0 ldi r24, 0x07 ; 7 2037a: 9f e0 ldi r25, 0x0F ; 15 2037c: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 20380: 10 93 ac 17 sts 0x17AC, r17 ; 0x8017ac 20384: 61 e0 ldi r22, 0x01 ; 1 20386: 85 ed ldi r24, 0xD5 ; 213 20388: 9e e0 ldi r25, 0x0E ; 14 2038a: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2038e: 10 93 b8 17 sts 0x17B8, r17 ; 0x8017b8 oldPos = pat9125_y; 20392: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 20396: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 2039a: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 2039e: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 resetStepCount(); 203a2: 0f 94 25 7c call 0x2f84a ; 0x2f84a jamErrCnt = 0; 203a6: 10 92 bf 17 sts 0x17BF, r1 ; 0x8017bf 203aa: 61 e0 ldi r22, 0x01 ; 1 203ac: 8d ea ldi r24, 0xAD ; 173 203ae: 9c e0 ldi r25, 0x0C ; 12 203b0: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 203b4: 36 cf rjmp .-404 ; 0x20222 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")); 203b6: 8a e3 ldi r24, 0x3A ; 58 203b8: 9c e6 ldi r25, 0x6C ; 108 203ba: 5a cf rjmp .-332 ; 0x20270 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]); 203bc: 20 93 f5 04 sts 0x04F5, r18 ; 0x8004f5 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 203c0: 80 91 7b 0e lds r24, 0x0E7B ; 0x800e7b 203c4: 90 e0 ldi r25, 0x00 ; 0 203c6: 28 e0 ldi r18, 0x08 ; 8 203c8: 96 95 lsr r25 203ca: 87 95 ror r24 203cc: 00 97 sbiw r24, 0x00 ; 0 203ce: 11 f0 breq .+4 ; 0x203d4 203d0: 21 50 subi r18, 0x01 ; 1 203d2: fa cf rjmp .-12 ; 0x203c8 203d4: 20 93 f6 04 sts 0x04F6, r18 ; 0x8004f6 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 203d8: 80 91 7c 0e lds r24, 0x0E7C ; 0x800e7c 203dc: 90 e0 ldi r25, 0x00 ; 0 203de: 28 e0 ldi r18, 0x08 ; 8 203e0: 96 95 lsr r25 203e2: 87 95 ror r24 203e4: 00 97 sbiw r24, 0x00 ; 0 203e6: 11 f0 breq .+4 ; 0x203ec 203e8: 21 50 subi r18, 0x01 ; 1 203ea: fa cf rjmp .-12 ; 0x203e0 203ec: 20 93 f7 04 sts 0x04F7, r18 ; 0x8004f7 tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 203f0: 80 91 7d 0e lds r24, 0x0E7D ; 0x800e7d 203f4: 90 e0 ldi r25, 0x00 ; 0 203f6: 28 e0 ldi r18, 0x08 ; 8 203f8: 96 95 lsr r25 203fa: 87 95 ror r24 203fc: 00 97 sbiw r24, 0x00 ; 0 203fe: 11 f0 breq .+4 ; 0x20404 20400: 21 50 subi r18, 0x01 ; 1 20402: fa cf rjmp .-12 ; 0x203f8 20404: 20 93 f8 04 sts 0x04F8, r18 ; 0x8004f8 return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 20408: 0e 94 af f0 call 0x1e15e ; 0x1e15e 2040c: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 2040e: 82 70 andi r24, 0x02 ; 2 20410: 0f 94 65 27 call 0x24eca ; 0x24eca microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 20414: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20418: 81 60 ori r24, 0x01 ; 1 2041a: 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); 2041e: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20422: 82 60 ori r24, 0x02 ; 2 20424: 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); 20428: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2042c: 84 60 ori r24, 0x04 ; 4 2042e: 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); 20432: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20436: 80 64 ori r24, 0x40 ; 64 20438: 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); 2043c: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 2043e: 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); 20440: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 20442: 16 9a sbi 0x02, 6 ; 2 #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 20444: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 20446: 15 9a sbi 0x02, 5 ; 2 #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 20448: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 2044a: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 2044c: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 2044e: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 20450: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 20452: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 20454: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 20456: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 20458: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2045c: 8b 7f andi r24, 0xFB ; 251 2045e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 20462: 9f b7 in r25, 0x3f ; 63 20464: f8 94 cli 20466: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2046a: 84 60 ori r24, 0x04 ; 4 2046c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20470: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 20472: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 20476: 8f 77 andi r24, 0x7F ; 127 20478: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 2047c: 9f b7 in r25, 0x3f ; 63 2047e: f8 94 cli 20480: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20484: 80 68 ori r24, 0x80 ; 128 20486: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2048a: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 2048c: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 2048e: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 20490: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 20492: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 20494: 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(); 20496: 17 9a sbi 0x02, 7 ; 2 20498: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f 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); 2049c: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 2049e: 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(); 204a0: 16 9a sbi 0x02, 6 ; 2 204a2: 10 92 90 06 sts 0x0690, r1 ; 0x800690 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 204a6: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 204a8: 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); 204aa: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 204ac: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 204ae: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 204b4: 8f 7e andi r24, 0xEF ; 239 204b6: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 204be: 88 60 ori r24, 0x08 ; 8 204c0: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 204c8: 8d 7f andi r24, 0xFD ; 253 204ca: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 204d2: 8e 7f andi r24, 0xFE ; 254 204d4: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 204dc: 8f 73 andi r24, 0x3F ; 63 204de: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 204e6: 8f 7c andi r24, 0xCF ; 207 204e8: 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< 204f0: 88 7f andi r24, 0xF8 ; 248 204f2: 82 60 ori r24, 0x02 ; 2 204f4: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 204f8: 80 e0 ldi r24, 0x00 ; 0 204fa: 90 e4 ldi r25, 0x40 ; 64 204fc: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 20500: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 20504: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 20508: 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; 2050c: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 20510: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> nextAdvanceISR = ADV_NEVER; 20514: 8f ef ldi r24, 0xFF ; 255 20516: 9f ef ldi r25, 0xFF ; 255 20518: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 2051c: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> main_Rate = ADV_NEVER; 20520: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.480+0x1> 20524: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.480> current_adv_steps = 0; 20528: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 2052c: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 20530: 81 e0 ldi r24, 0x01 ; 1 20532: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> current_adv_steps = 0; #endif enable_endstops(true); // Start with endstops active. After homing they can be disabled ENABLE_STEPPER_DRIVER_INTERRUPT(); 20536: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2053a: 82 60 ori r24, 0x02 ; 2 2053c: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 20540: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 20542: 81 e0 ldi r24, 0x01 ; 1 20544: 11 11 cpse r17, r1 20546: 01 c0 rjmp .+2 ; 0x2054a 20548: 80 e0 ldi r24, 0x00 ; 0 2054a: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c update_mode_profile(); 2054e: 0f 94 dc 64 call 0x2c9b8 ; 0x2c9b8 20552: 0e 94 af f0 call 0x1e15e ; 0x1e15e 20556: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 20558: 82 70 andi r24, 0x02 ; 2 2055a: 0f 94 65 27 call 0x24eca ; 0x24eca setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 2055e: 0f 94 35 ce call 0x39c6a ; 0x39c6a // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 20562: 82 e9 ldi r24, 0x92 ; 146 20564: 96 e0 ldi r25, 0x06 ; 6 20566: 0e 94 49 6b call 0xd692 ; 0xd692 plan_set_position_curposXYZE(); 2056a: 0f 94 41 bf call 0x37e82 ; 0x37e82 // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 2056e: b1 10 cpse r11, r1 20570: 08 c0 rjmp .+16 ; 0x20582 } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 20572: 87 e9 ldi r24, 0x97 ; 151 20574: 9b e6 ldi r25, 0x6B ; 107 20576: 0f 94 3d db call 0x3b67a ; 0x3b67a lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 2057a: 8b e4 ldi r24, 0x4B ; 75 2057c: 9b e6 ldi r25, 0x6B ; 107 2057e: 0f 94 f6 20 call 0x241ec ; 0x241ec } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 20582: 84 e9 ldi r24, 0x94 ; 148 20584: 9c e0 ldi r25, 0x0C ; 12 20586: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2058a: 82 34 cpi r24, 0x42 ; 66 2058c: 59 f4 brne .+22 ; 0x205a4 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); 2058e: 6f ef ldi r22, 0xFF ; 255 20590: 84 e9 ldi r24, 0x94 ; 148 20592: 9c e0 ldi r25, 0x0C ; 12 20594: 0f 94 9c dc call 0x3b938 ; 0x3b938 // 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); 20598: 85 e9 ldi r24, 0x95 ; 149 2059a: 9c e0 ldi r25, 0x0C ; 12 2059c: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 lcd_show_fullscreen_message_and_wait_P(kill_msg); 205a0: 0f 94 f6 20 call 0x241ec ; 0x241ec // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 205a4: 0f 94 74 7c call 0x2f8e8 ; 0x2f8e8 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 205a8: 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); 205aa: 8b eb ldi r24, 0xBB ; 187 205ac: 9f e0 ldi r25, 0x0F ; 15 205ae: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 205b2: 91 e0 ldi r25, 0x01 ; 1 205b4: 81 30 cpi r24, 0x01 ; 1 205b6: 09 f0 breq .+2 ; 0x205ba 205b8: 90 e0 ldi r25, 0x00 ; 0 205ba: 90 93 01 17 sts 0x1701, r25 ; 0x801701 // 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(); 205be: 81 e0 ldi r24, 0x01 ; 1 205c0: 0f 94 fd 81 call 0x303fa ; 0x303fa #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 205c4: 60 e0 ldi r22, 0x00 ; 0 205c6: 84 e6 ldi r24, 0x64 ; 100 205c8: 9f e0 ldi r25, 0x0F ; 15 205ca: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 205ce: 60 e0 ldi r22, 0x00 ; 0 205d0: 86 e6 ldi r24, 0x66 ; 102 205d2: 9f e0 ldi r25, 0x0F ; 15 205d4: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 205d8: 60 e0 ldi r22, 0x00 ; 0 205da: 88 e6 ldi r24, 0x68 ; 104 205dc: 9f e0 ldi r25, 0x0F ; 15 205de: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 205e2: 60 e0 ldi r22, 0x00 ; 0 205e4: 85 e6 ldi r24, 0x65 ; 101 205e6: 9f e0 ldi r25, 0x0F ; 15 205e8: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 205ec: 70 e0 ldi r23, 0x00 ; 0 205ee: 60 e0 ldi r22, 0x00 ; 0 205f0: 8f ef ldi r24, 0xFF ; 255 205f2: 9e e0 ldi r25, 0x0E ; 14 205f4: 0e 94 71 75 call 0xeae2 ; 0xeae2 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 205f8: 70 e0 ldi r23, 0x00 ; 0 205fa: 60 e0 ldi r22, 0x00 ; 0 205fc: 85 e0 ldi r24, 0x05 ; 5 205fe: 9f e0 ldi r25, 0x0F ; 15 20600: 0e 94 71 75 call 0xeae2 ; 0xeae2 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 20604: 70 e0 ldi r23, 0x00 ; 0 20606: 60 e0 ldi r22, 0x00 ; 0 20608: 83 e0 ldi r24, 0x03 ; 3 2060a: 9f e0 ldi r25, 0x0F ; 15 2060c: 0e 94 71 75 call 0xeae2 ; 0xeae2 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 20610: 70 e0 ldi r23, 0x00 ; 0 20612: 60 e0 ldi r22, 0x00 ; 0 20614: 81 e0 ldi r24, 0x01 ; 1 20616: 9f e0 ldi r25, 0x0F ; 15 20618: 0e 94 71 75 call 0xeae2 ; 0xeae2 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 2061c: 70 e0 ldi r23, 0x00 ; 0 2061e: 60 e0 ldi r22, 0x00 ; 0 20620: 83 ed ldi r24, 0xD3 ; 211 20622: 9e e0 ldi r25, 0x0E ; 14 20624: 0e 94 71 75 call 0xeae2 ; 0xeae2 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 20628: 70 e0 ldi r23, 0x00 ; 0 2062a: 60 e0 ldi r22, 0x00 ; 0 2062c: 80 ed ldi r24, 0xD0 ; 208 2062e: 9e e0 ldi r25, 0x0E ; 14 20630: 0e 94 71 75 call 0xeae2 ; 0xeae2 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 20634: 60 e0 ldi r22, 0x00 ; 0 20636: 82 ed ldi r24, 0xD2 ; 210 20638: 9e e0 ldi r25, 0x0E ; 14 2063a: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 2063e: 60 e0 ldi r22, 0x00 ; 0 20640: 8f ec ldi r24, 0xCF ; 207 20642: 9e e0 ldi r25, 0x0E ; 14 20644: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 20648: 88 ea ldi r24, 0xA8 ; 168 2064a: 9c e0 ldi r25, 0x0C ; 12 2064c: 0f 94 98 7b call 0x2f730 ; 0x2f730 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 20650: 81 ea ldi r24, 0xA1 ; 161 20652: 9d e0 ldi r25, 0x0D ; 13 20654: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 20658: 8f 3f cpi r24, 0xFF ; 255 2065a: 71 f4 brne .+28 ; 0x20678 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2065c: 60 e0 ldi r22, 0x00 ; 0 2065e: 81 ea ldi r24, 0xA1 ; 161 20660: 9d e0 ldi r25, 0x0D ; 13 20662: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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); 20666: 88 ef ldi r24, 0xF8 ; 248 20668: 9f e0 ldi r25, 0x0F ; 15 2066a: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 2066e: bc 01 movw r22, r24 20670: 80 e5 ldi r24, 0x50 ; 80 20672: 9d e0 ldi r25, 0x0D ; 13 20674: 0f 94 96 dc call 0x3b92c ; 0x3b92c 20678: 39 e4 ldi r19, 0x49 ; 73 2067a: c3 2e mov r12, r19 2067c: 3d e0 ldi r19, 0x0D ; 13 2067e: d3 2e mov r13, r19 20680: 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); 20682: be 01 movw r22, r28 20684: 6f 5f subi r22, 0xFF ; 255 20686: 7f 4f sbci r23, 0xFF ; 255 20688: 81 2f mov r24, r17 2068a: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 2068e: ae 01 movw r20, r28 20690: 4f 5f subi r20, 0xFF ; 255 20692: 5f 4f sbci r21, 0xFF ; 255 20694: 67 e0 ldi r22, 0x07 ; 7 20696: 70 e0 ldi r23, 0x00 ; 0 20698: c6 01 movw r24, r12 2069a: 0e 94 52 75 call 0xeaa4 ; 0xeaa4 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++) { 2069e: 1f 5f subi r17, 0xFF ; 255 206a0: ab e0 ldi r26, 0x0B ; 11 206a2: ca 0e add r12, r26 206a4: d1 1c adc r13, r1 206a6: 18 30 cpi r17, 0x08 ; 8 206a8: 61 f7 brne .-40 ; 0x20682 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)))) 206aa: 81 ea ldi r24, 0xA1 ; 161 206ac: 9d e0 ldi r25, 0x0D ; 13 206ae: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 206b2: 0e 94 c1 75 call 0xeb82 ; 0xeb82 206b6: 81 11 cpse r24, r1 206b8: 02 c0 rjmp .+4 ; 0x206be { eeprom_switch_to_next_sheet(); 206ba: 0e 94 e3 75 call 0xebc6 ; 0xebc6 } check_babystep(); 206be: 0e 94 ff 78 call 0xf1fe ; 0xf1fe // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 206c2: 80 e8 ldi r24, 0x80 ; 128 206c4: 9c e0 ldi r25, 0x0C ; 12 206c6: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 206ca: 8f 3f cpi r24, 0xFF ; 255 206cc: 41 f4 brne .+16 ; 0x206de #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); 206ce: 4f e0 ldi r20, 0x0F ; 15 206d0: 50 e0 ldi r21, 0x00 ; 0 206d2: 60 e8 ldi r22, 0x80 ; 128 206d4: 7c e0 ldi r23, 0x0C ; 12 206d6: 87 ee ldi r24, 0xE7 ; 231 206d8: 92 e0 ldi r25, 0x02 ; 2 206da: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 #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); 206de: 85 e0 ldi r24, 0x05 ; 5 206e0: 9d e0 ldi r25, 0x0D ; 13 206e2: 0f 94 98 7b call 0x2f730 ; 0x2f730 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 206e6: 8d ee ldi r24, 0xED ; 237 206e8: 9f e0 ldi r25, 0x0F ; 15 206ea: 0f 94 98 7b call 0x2f730 ; 0x2f730 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 206ee: 81 ef ldi r24, 0xF1 ; 241 206f0: 9f e0 ldi r25, 0x0F ; 15 206f2: 0f 94 98 7b call 0x2f730 ; 0x2f730 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 206f6: 60 e0 ldi r22, 0x00 ; 0 206f8: 8e ec ldi r24, 0xCE ; 206 206fa: 9e e0 ldi r25, 0x0E ; 14 206fc: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 20700: 61 e0 ldi r22, 0x01 ; 1 20702: 87 ea ldi r24, 0xA7 ; 167 20704: 9c e0 ldi r25, 0x0C ; 12 20706: 0e 94 89 75 call 0xeb12 ; 0xeb12 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 2070a: 8e ef ldi r24, 0xFE ; 254 2070c: 9f e0 ldi r25, 0x0F ; 15 2070e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 20712: 0e 94 b4 71 call 0xe368 ; 0xe368 20716: 81 11 cpse r24, r1 20718: 02 c0 rjmp .+4 ; 0x2071e lcd_language(); 2071a: 0e 94 2f db call 0x1b65e ; 0x1b65e lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 2071e: 60 e0 ldi r22, 0x00 ; 0 20720: 8f ea ldi r24, 0xAF ; 175 20722: 9f e0 ldi r25, 0x0F ; 15 20724: 0e 94 89 75 call 0xeb12 ; 0xeb12 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 20728: 86 ea ldi r24, 0xA6 ; 166 2072a: 9f e0 ldi r25, 0x0F ; 15 2072c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 20730: 8f 3f cpi r24, 0xFF ; 255 20732: d9 f4 brne .+54 ; 0x2076a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20734: 61 e0 ldi r22, 0x01 ; 1 20736: 86 ea ldi r24, 0xA6 ; 166 20738: 9f e0 ldi r25, 0x0F ; 15 2073a: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 2073e: 20 eb ldi r18, 0xB0 ; 176 20740: c2 2e mov r12, r18 20742: 2f e0 ldi r18, 0x0F ; 15 20744: 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); 20746: 70 e0 ldi r23, 0x00 ; 0 20748: 60 e0 ldi r22, 0x00 ; 0 2074a: c6 01 movw r24, r12 2074c: 0f 94 96 dc call 0x3b92c ; 0x3b92c 20750: b2 e0 ldi r27, 0x02 ; 2 20752: cb 0e add r12, r27 20754: 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++) { 20756: ea eb ldi r30, 0xBA ; 186 20758: ce 16 cp r12, r30 2075a: ef e0 ldi r30, 0x0F ; 15 2075c: de 06 cpc r13, r30 2075e: 99 f7 brne .-26 ; 0x20746 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20760: 60 e0 ldi r22, 0x00 ; 0 20762: 8f ea ldi r24, 0xAF ; 175 20764: 9f e0 ldi r25, 0x0F ; 15 20766: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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); 2076a: 60 e0 ldi r22, 0x00 ; 0 2076c: 85 ea ldi r24, 0xA5 ; 165 2076e: 9f e0 ldi r25, 0x0F ; 15 20770: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 20774: 60 e0 ldi r22, 0x00 ; 0 20776: 8f e7 ldi r24, 0x7F ; 127 20778: 9c e0 ldi r25, 0x0C ; 12 2077a: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 2077e: 60 e0 ldi r22, 0x00 ; 0 20780: 89 e0 ldi r24, 0x09 ; 9 20782: 9f e0 ldi r25, 0x0F ; 15 20784: 0e 94 89 75 call 0xeb12 ; 0xeb12 } 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); 20788: 61 e0 ldi r22, 0x01 ; 1 2078a: 8c ea ldi r24, 0xAC ; 172 2078c: 9d e0 ldi r25, 0x0D ; 13 2078e: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 20792: 63 e0 ldi r22, 0x03 ; 3 20794: 8b ea ldi r24, 0xAB ; 171 20796: 9d e0 ldi r25, 0x0D ; 13 20798: 0e 94 89 75 call 0xeb12 ; 0xeb12 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 2079c: 63 e0 ldi r22, 0x03 ; 3 2079e: 8a ea ldi r24, 0xAA ; 170 207a0: 9d e0 ldi r25, 0x0D ; 13 207a2: 0e 94 89 75 call 0xeb12 ; 0xeb12 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 207a6: 61 e0 ldi r22, 0x01 ; 1 207a8: 89 ea ldi r24, 0xA9 ; 169 207aa: 9d e0 ldi r25, 0x0D ; 13 207ac: 0e 94 89 75 call 0xeb12 ; 0xeb12 #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 207b0: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 207b2: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 207b4: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 207b8: 8f 7b andi r24, 0xBF ; 191 207ba: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 207be: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 207c2: 80 68 ori r24, 0x80 ; 128 207c4: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 207c8: 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); 207ca: 84 e0 ldi r24, 0x04 ; 4 207cc: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return false; } #ifdef FSENSOR_PROBING bool PAT9125_sensor::probeOtherType() { SET_INPUT(IR_SENSOR_PIN); // input mode 207d0: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 207d4: 8e 7f andi r24, 0xFE ; 254 207d6: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 207da: 9f b7 in r25, 0x3f ; 63 207dc: f8 94 cli 207de: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 207e2: 81 60 ori r24, 0x01 ; 1 207e4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 207e8: 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); 207ea: 8f e8 ldi r24, 0x8F ; 143 207ec: 91 e0 ldi r25, 0x01 ; 1 207ee: 01 97 sbiw r24, 0x01 ; 1 207f0: f1 f7 brne .-4 ; 0x207ee 207f2: 00 c0 rjmp .+0 ; 0x207f4 207f4: 00 00 nop _delay_us(100); // wait for the pullup to pull the line high (might be needed, not really sure. The internal pullups are quite weak and there might be a // long wire attached). bool fsensorDetected = !READ(IR_SENSOR_PIN); 207f6: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> WRITE(IR_SENSOR_PIN, 0); // no pullup 207fa: 2f b7 in r18, 0x3f ; 63 207fc: f8 94 cli 207fe: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20802: 8e 7f andi r24, 0xFE ; 254 20804: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20808: 2f bf out 0x3f, r18 ; 63 } #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()) { 2080a: 90 fd sbrc r25, 0 2080c: 06 c0 rjmp .+12 ; 0x2081a lcd_show_fullscreen_message_and_wait_P(_T(MSG_FW_MK3_DETECTED)); 2080e: 8a e7 ldi r24, 0x7A ; 122 20810: 9a e4 ldi r25, 0x4A ; 74 20812: 0e 94 2c 72 call 0xe458 ; 0xe458 20816: 0f 94 f6 20 call 0x241ec ; 0x241ec #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 2081a: 02 30 cpi r16, 0x02 ; 2 2081c: 81 f0 breq .+32 ; 0x2083e 2081e: 03 30 cpi r16, 0x03 ; 3 20820: 09 f4 brne .+2 ; 0x20824 20822: 37 c1 rjmp .+622 ; 0x20a92 20824: 01 30 cpi r16, 0x01 ; 1 20826: b9 f4 brne .+46 ; 0x20856 //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)); 20828: 8c ea ldi r24, 0xAC ; 172 2082a: 9c e4 ldi r25, 0x4C ; 76 2082c: 0e 94 2c 72 call 0xe458 ; 0xe458 20830: 0f 94 f6 20 call 0x241ec ; 0x241ec 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); 20834: 66 e3 ldi r22, 0x36 ; 54 20836: 71 e0 ldi r23, 0x01 ; 1 20838: 8c ee ldi r24, 0xEC ; 236 2083a: 9e e0 ldi r25, 0x0E ; 14 2083c: 0a c0 rjmp .+20 ; 0x20852 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 2083e: 8b e8 ldi r24, 0x8B ; 139 20840: 9c e4 ldi r25, 0x4C ; 76 20842: 0e 94 2c 72 call 0xe458 ; 0xe458 20846: 0f 94 f6 20 call 0x241ec ; 0x241ec 2084a: 6c e2 ldi r22, 0x2C ; 44 2084c: 71 e0 ldi r23, 0x01 ; 1 2084e: 8e ee ldi r24, 0xEE ; 238 20850: 9e e0 ldi r25, 0x0E ; 14 20852: 0f 94 b2 dc call 0x3b964 ; 0x3b964 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 20856: f1 10 cpse r15, r1 20858: 08 c0 rjmp .+16 ; 0x2086a 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 2085a: 84 e1 ldi r24, 0x14 ; 20 2085c: 9c e4 ldi r25, 0x4C ; 76 2085e: 0e 94 2c 72 call 0xe458 ; 0xe458 20862: 0f 94 f6 20 call 0x241ec ; 0x241ec Config_StoreSettings(); 20866: 0e 94 24 82 call 0x10448 ; 0x10448 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 2086a: 80 e8 ldi r24, 0x80 ; 128 2086c: 0e 94 7d ef call 0x1defa ; 0x1defa 20870: 88 23 and r24, r24 20872: c9 f0 breq .+50 ; 0x208a6 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 20874: 87 ef ldi r24, 0xF7 ; 247 20876: 9f e0 ldi r25, 0x0F ; 15 20878: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 2087c: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 2087e: 81 30 cpi r24, 0x01 ; 1 20880: 71 f4 brne .+28 ; 0x2089e // 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)) { 20882: 82 e3 ldi r24, 0x32 ; 50 20884: 9d e8 ldi r25, 0x8D ; 141 20886: 0e 94 1b d1 call 0x1a236 ; 0x1a236 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); 2088a: 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)) { 2088c: 88 23 and r24, r24 2088e: 39 f0 breq .+14 ; 0x2089e // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 20890: 82 ed ldi r24, 0xD2 ; 210 20892: 9b e4 ldi r25, 0x4B ; 75 20894: 0e 94 2c 72 call 0xe458 ; 0xe458 20898: 0f 94 f6 20 call 0x241ec ; 0x241ec calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 2089c: 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); 2089e: 86 ea ldi r24, 0xA6 ; 166 208a0: 9c e0 ldi r25, 0x0C ; 12 208a2: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 208a6: 8a e2 ldi r24, 0x2A ; 42 208a8: 9d e8 ldi r25, 0x8D ; 141 208aa: 0e 94 1b d1 call 0x1a236 ; 0x1a236 208ae: f8 2e mov r15, r24 208b0: 88 23 and r24, r24 208b2: 31 f0 breq .+12 ; 0x208c0 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 208b4: 8f e1 ldi r24, 0x1F ; 31 208b6: 0e 94 7d ef call 0x1defa ; 0x1defa 208ba: 91 e0 ldi r25, 0x01 ; 1 208bc: f8 2e mov r15, r24 208be: 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; 208c0: 10 e0 ldi r17, 0x00 ; 0 208c2: 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)); 208c4: f8 01 movw r30, r16 208c6: e5 5e subi r30, 0xE5 ; 229 208c8: f2 47 sbci r31, 0x72 ; 114 208ca: 64 91 lpm r22, Z 208cc: c8 01 movw r24, r16 208ce: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 208d2: 0f 5f subi r16, 0xFF ; 255 208d4: 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){ 208d6: 0a 30 cpi r16, 0x0A ; 10 208d8: 11 05 cpc r17, r1 208da: a1 f7 brne .-24 ; 0x208c4 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])); 208dc: ea e2 ldi r30, 0x2A ; 42 208de: fd e8 ldi r31, 0x8D ; 141 208e0: 65 91 lpm r22, Z+ 208e2: 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); 208e4: 8a e0 ldi r24, 0x0A ; 10 208e6: 90 e0 ldi r25, 0x00 ; 0 208e8: 0f 94 96 dc call 0x3b92c ; 0x3b92c eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 208ec: ec e2 ldi r30, 0x2C ; 44 208ee: fd e8 ldi r31, 0x8D ; 141 208f0: 65 91 lpm r22, Z+ 208f2: 74 91 lpm r23, Z 208f4: 8c e0 ldi r24, 0x0C ; 12 208f6: 90 e0 ldi r25, 0x00 ; 0 208f8: 0f 94 96 dc call 0x3b92c ; 0x3b92c eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 208fc: ee e2 ldi r30, 0x2E ; 46 208fe: fd e8 ldi r31, 0x8D ; 141 20900: 65 91 lpm r22, Z+ 20902: 74 91 lpm r23, Z 20904: 8e e0 ldi r24, 0x0E ; 14 20906: 90 e0 ldi r25, 0x00 ; 0 20908: 0f 94 96 dc call 0x3b92c ; 0x3b92c // 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])); 2090c: e0 e3 ldi r30, 0x30 ; 48 2090e: fd e8 ldi r31, 0x8D ; 141 20910: 65 91 lpm r22, Z+ 20912: 74 91 lpm r23, Z 20914: 80 e1 ldi r24, 0x10 ; 16 20916: 90 e0 ldi r25, 0x00 ; 0 20918: 0f 94 96 dc call 0x3b92c ; 0x3b92c run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 2091c: 8f e5 ldi r24, 0x5F ; 95 2091e: 9f e0 ldi r25, 0x0F ; 15 20920: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 20924: 88 23 and r24, r24 20926: 09 f4 brne .+2 ; 0x2092a 20928: c1 c0 rjmp .+386 ; 0x20aac // first time run of wizard or service prep lcd_wizard(WizState::Run); 2092a: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 2092c: 0e 94 d9 f9 call 0x1f3b2 ; 0x1f3b2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 20930: 83 e0 ldi r24, 0x03 ; 3 20932: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 20936: 81 e0 ldi r24, 0x01 ; 1 20938: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_clear(); 2093c: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_update(2); 20940: 82 e0 ldi r24, 0x02 ; 2 20942: 0e 94 27 6e call 0xdc4e ; 0xdc4e #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 20946: 60 e0 ldi r22, 0x00 ; 0 20948: 8e ef ldi r24, 0xFE ; 254 2094a: 9e e0 ldi r25, 0x0E ; 14 2094c: 0e 94 89 75 call 0xeb12 ; 0xeb12 20950: 80 93 f3 04 sts 0x04F3, r24 ; 0x8004f3 tmc2130_home_bsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_BSTEPS, 48); 20954: 60 e3 ldi r22, 0x30 ; 48 20956: 8d ef ldi r24, 0xFD ; 253 20958: 9e e0 ldi r25, 0x0E ; 14 2095a: 0e 94 89 75 call 0xeb12 ; 0xeb12 2095e: 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); 20962: 60 e3 ldi r22, 0x30 ; 48 20964: 8c ef ldi r24, 0xFC ; 252 20966: 9e e0 ldi r25, 0x0E ; 14 20968: 0e 94 89 75 call 0xeb12 ; 0xeb12 2096c: 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); 20970: 60 e0 ldi r22, 0x00 ; 0 20972: 8b ef ldi r24, 0xFB ; 251 20974: 9e e0 ldi r25, 0x0E ; 14 20976: 0e 94 89 75 call 0xeb12 ; 0xeb12 2097a: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 tmc2130_home_bsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_BSTEPS, 48); 2097e: 60 e3 ldi r22, 0x30 ; 48 20980: 8a ef ldi r24, 0xFA ; 250 20982: 9e e0 ldi r25, 0x0E ; 14 20984: 0e 94 89 75 call 0xeb12 ; 0xeb12 20988: 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); 2098c: 60 e3 ldi r22, 0x30 ; 48 2098e: 89 ef ldi r24, 0xF9 ; 249 20990: 9e e0 ldi r25, 0x0E ; 14 20992: 0e 94 89 75 call 0xeb12 ; 0xeb12 20996: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 2099a: 60 e0 ldi r22, 0x00 ; 0 2099c: 88 ef ldi r24, 0xF8 ; 248 2099e: 9e e0 ldi r25, 0x0E ; 14 209a0: 0e 94 89 75 call 0xeb12 ; 0xeb12 209a4: 80 93 f2 04 sts 0x04F2, r24 ; 0x8004f2 static void fw_crash_init() { #ifdef XFLASH_DUMP dump_crash_reason crash_reason; if(xfdump_check_state(&crash_reason)) 209a8: ce 01 movw r24, r28 209aa: 01 96 adiw r24, 0x01 ; 1 209ac: 0e 94 e6 ed call 0x1dbcc ; 0x1dbcc 209b0: 88 23 and r24, r24 209b2: 89 f0 breq .+34 ; 0x209d6 { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 209b4: 82 e2 ldi r24, 0x22 ; 34 209b6: 9c e6 ldi r25, 0x6C ; 108 209b8: 0f 94 3d db call 0x3b67a ; 0x3b67a #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 209bc: 89 81 ldd r24, Y+1 ; 0x01 209be: 88 23 and r24, r24 209c0: 51 f0 breq .+20 ; 0x209d6 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 209c2: 83 e0 ldi r24, 0x03 ; 3 209c4: 9d e0 ldi r25, 0x0D ; 13 209c6: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 { // 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 && 209ca: 8f 3f cpi r24, 0xFF ; 255 209cc: 21 f0 breq .+8 ; 0x209d6 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 209ce: 8e ea ldi r24, 0xAE ; 174 209d0: 9b e6 ldi r25, 0x6B ; 107 209d2: 0f 94 f6 20 call 0x241ec ; 0x241ec if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 209d6: 6f ef ldi r22, 0xFF ; 255 209d8: 83 e0 ldi r24, 0x03 ; 3 209da: 9d e0 ldi r25, 0x0D ; 13 209dc: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 209e0: 0e 94 fb 66 call 0xcdf6 ; 0xcdf6 209e4: 88 23 and r24, r24 209e6: d9 f1 breq .+118 ; 0x20a5e manage_heater(); // Update temperatures 209e8: 0f 94 61 39 call 0x272c2 ; 0x272c2 //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 209ec: 8c e8 ldi r24, 0x8C ; 140 209ee: 9f e0 ldi r25, 0x0F ; 15 209f0: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 209f4: 08 2f mov r16, r24 209f6: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 209fa: 80 90 ee 04 lds r8, 0x04EE ; 0x8004ee 209fe: 90 90 ef 04 lds r9, 0x04EF ; 0x8004ef 20a02: a0 90 f0 04 lds r10, 0x04F0 ; 0x8004f0 20a06: b0 90 f1 04 lds r11, 0x04F1 ; 0x8004f1 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER printf_P(_N("Power panic detected!\nCurrent bed temp:%d\nSaved bed temp:%d\n"), (int)degBed(), eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED)); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER uvlo_auto_recovery_ready = (degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET)); 20a0a: 8b e8 ldi r24, 0x8B ; 139 20a0c: 9f e0 ldi r25, 0x0F ; 15 20a0e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 20a12: 68 2f mov r22, r24 20a14: 70 e0 ldi r23, 0x00 ; 0 20a16: 90 e0 ldi r25, 0x00 ; 0 20a18: 80 e0 ldi r24, 0x00 ; 0 20a1a: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 20a1e: 20 e0 ldi r18, 0x00 ; 0 20a20: 30 e0 ldi r19, 0x00 ; 0 20a22: 40 ea ldi r20, 0xA0 ; 160 20a24: 50 e4 ldi r21, 0x40 ; 64 20a26: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 20a2a: 6b 01 movw r12, r22 20a2c: 7c 01 movw r14, r24 20a2e: 11 e0 ldi r17, 0x01 ; 1 20a30: ac 01 movw r20, r24 20a32: 9b 01 movw r18, r22 20a34: c5 01 movw r24, r10 20a36: b4 01 movw r22, r8 20a38: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 20a3c: 18 16 cp r1, r24 20a3e: 0c f0 brlt .+2 ; 0x20a42 20a40: 10 e0 ldi r17, 0x00 ; 0 20a42: 10 93 ed 04 sts 0x04ED, r17 ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.533> if (uvlo_auto_recovery_ready){ 20a46: a7 01 movw r20, r14 20a48: 96 01 movw r18, r12 20a4a: c5 01 movw r24, r10 20a4c: b4 01 movw r22, r8 20a4e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 20a52: 18 16 cp r1, r24 20a54: 0c f0 brlt .+2 ; 0x20a58 20a56: 58 c0 rjmp .+176 ; 0x20b08 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 20a58: 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); 20a5a: 0f 94 3b 5d call 0x2ba76 ; 0x2ba76 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 20a5e: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 20a60: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 20a62: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20a66: 81 60 ori r24, 0x01 ; 1 20a68: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 20a6c: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20a70: 8d 7f andi r24, 0xFD ; 253 20a72: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 20a76: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 20a78: 64 99 sbic 0x0c, 4 ; 12 20a7a: 57 c0 rjmp .+174 ; 0x20b2a 20a7c: 0e 94 fb 66 call 0xcdf6 ; 0xcdf6 20a80: 88 23 and r24, r24 20a82: 09 f4 brne .+2 ; 0x20a86 20a84: 52 c0 rjmp .+164 ; 0x20b2a { SERIAL_ECHOLNRPGM(MSG_INT4); 20a86: 85 e2 ldi r24, 0x25 ; 37 20a88: 9d e8 ldi r25, 0x8D ; 141 20a8a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 uvlo_drain_reset(); 20a8e: 0f 94 57 60 call 0x2c0ae ; 0x2c0ae 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)); 20a92: 80 e5 ldi r24, 0x50 ; 80 20a94: 9c e4 ldi r25, 0x4C ; 76 20a96: 0e 94 2c 72 call 0xe458 ; 0xe458 20a9a: 0f 94 f6 20 call 0x241ec ; 0x241ec 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); 20a9e: 6c e2 ldi r22, 0x2C ; 44 20aa0: 71 e0 ldi r23, 0x01 ; 1 20aa2: 8e ee ldi r24, 0xEE ; 238 20aa4: 9e e0 ldi r25, 0x0E ; 14 20aa6: 0f 94 b2 dc call 0x3b964 ; 0x3b964 20aaa: c4 ce rjmp .-632 ; 0x20834 // 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); 20aac: 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) { 20aae: f1 10 cpse r15, r1 20ab0: 3d cf rjmp .-390 ; 0x2092c // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 20ab2: 0e 94 7d ef call 0x1defa ; 0x1defa 20ab6: 81 11 cpse r24, r1 20ab8: 07 c0 rjmp .+14 ; 0x20ac8 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 20aba: 82 e6 ldi r24, 0x62 ; 98 20abc: 9b e4 ldi r25, 0x4B ; 75 // 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)); 20abe: 0e 94 2c 72 call 0xe458 ; 0xe458 20ac2: 0f 94 f6 20 call 0x241ec ; 0x241ec 20ac6: 34 cf rjmp .-408 ; 0x20930 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)) { 20ac8: 84 e0 ldi r24, 0x04 ; 4 20aca: 0e 94 7d ef call 0x1defa ; 0x1defa 20ace: 81 11 cpse r24, r1 20ad0: 03 c0 rjmp .+6 ; 0x20ad8 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 20ad2: 8a ee ldi r24, 0xEA ; 234 20ad4: 9a e4 ldi r25, 0x4A ; 74 20ad6: f3 cf rjmp .-26 ; 0x20abe } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 20ad8: 80 e1 ldi r24, 0x10 ; 16 20ada: 0e 94 7d ef call 0x1defa ; 0x1defa 20ade: 81 11 cpse r24, r1 20ae0: 06 c0 rjmp .+12 ; 0x20aee lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 20ae2: 82 e8 ldi r24, 0x82 ; 130 20ae4: 99 e5 ldi r25, 0x59 ; 89 20ae6: 0e 94 2c 72 call 0xe458 ; 0xe458 20aea: 0f 94 f6 20 call 0x241ec ; 0x241ec #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 20aee: 88 e0 ldi r24, 0x08 ; 8 20af0: 0e 94 7d ef call 0x1defa ; 0x1defa 20af4: 81 11 cpse r24, r1 20af6: 1c cf rjmp .-456 ; 0x20930 20af8: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> 20afc: 88 23 and r24, r24 20afe: 09 f4 brne .+2 ; 0x20b02 20b00: 17 cf rjmp .-466 ; 0x20930 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 20b02: 86 ec ldi r24, 0xC6 ; 198 20b04: 9a e4 ldi r25, 0x4A ; 74 20b06: db cf rjmp .-74 ; 0x20abe 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) { 20b08: 01 30 cpi r16, 0x01 ; 1 20b0a: 11 f4 brne .+4 ; 0x20b10 recover_print(0); 20b0c: 80 e0 ldi r24, 0x00 ; 0 20b0e: a5 cf rjmp .-182 ; 0x20a5a } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 20b10: 82 ea ldi r24, 0xA2 ; 162 20b12: 9a e4 ldi r25, 0x4A ; 74 20b14: 0e 94 2c 72 call 0xe458 ; 0xe458 20b18: 41 e0 ldi r20, 0x01 ; 1 20b1a: 60 e0 ldi r22, 0x00 ; 0 20b1c: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc if ( btn == LCD_LEFT_BUTTON_CHOICE) { 20b20: 88 23 and r24, r24 20b22: a1 f3 breq .-24 ; 0x20b0c recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 20b24: 0e 94 2d 64 call 0xc85a ; 0xc85a 20b28: 9a cf rjmp .-204 ; 0x20a5e ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 20b2a: 61 e0 ldi r22, 0x01 ; 1 20b2c: 88 ea ldi r24, 0xA8 ; 168 20b2e: 9d e0 ldi r25, 0x0D ; 13 20b30: 0e 94 89 75 call 0xeb12 ; 0xeb12 20b34: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec if (farm_mode) { oCheckMode = ClCheckMode::_Strict; eeprom_update_byte_notify((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Strict); } oNozzleDiameter = (ClNozzleDiameter)eeprom_init_default_byte((uint8_t *)EEPROM_NOZZLE_DIAMETER, (uint8_t)ClNozzleDiameter::_Diameter_400); 20b38: 68 e2 ldi r22, 0x28 ; 40 20b3a: 87 ea ldi r24, 0xA7 ; 167 20b3c: 9d e0 ldi r25, 0x0D ; 13 20b3e: 0e 94 89 75 call 0xeb12 ; 0xeb12 20b42: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 20b46: 60 e9 ldi r22, 0x90 ; 144 20b48: 71 e0 ldi r23, 0x01 ; 1 20b4a: 85 ea ldi r24, 0xA5 ; 165 20b4c: 9d e0 ldi r25, 0x0D ; 13 20b4e: 0e 94 71 75 call 0xeae2 ; 0xeae2 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 20b52: 61 e0 ldi r22, 0x01 ; 1 20b54: 84 ea ldi r24, 0xA4 ; 164 20b56: 9d e0 ldi r25, 0x0D ; 13 20b58: 0e 94 89 75 call 0xeb12 ; 0xeb12 20b5c: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 20b60: 61 e0 ldi r22, 0x01 ; 1 20b62: 83 ea ldi r24, 0xA3 ; 163 20b64: 9d e0 ldi r25, 0x0D ; 13 20b66: 0e 94 89 75 call 0xeb12 ; 0xeb12 20b6a: 80 93 e9 04 sts 0x04E9, r24 ; 0x8004e9 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 20b6e: 61 e0 ldi r22, 0x01 ; 1 20b70: 82 ea ldi r24, 0xA2 ; 162 20b72: 9d e0 ldi r25, 0x0D ; 13 20b74: 0e 94 89 75 call 0xeb12 ; 0xeb12 20b78: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 20b7c: 61 e0 ldi r22, 0x01 ; 1 20b7e: 80 e2 ldi r24, 0x20 ; 32 20b80: 9c e0 ldi r25, 0x0C ; 12 20b82: 0e 94 89 75 call 0xeb12 ; 0xeb12 20b86: 80 93 e7 04 sts 0x04E7, r24 ; 0x8004e7 // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 20b8a: 81 e0 ldi r24, 0x01 ; 1 20b8c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be : "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" ); 20b90: 88 e1 ldi r24, 0x18 ; 24 20b92: 98 e2 ldi r25, 0x28 ; 40 20b94: 0f b6 in r0, 0x3f ; 63 20b96: f8 94 cli 20b98: a8 95 wdr 20b9a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 20b9e: 0f be out 0x3f, r0 ; 63 20ba0: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 20ba4: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 20ba8: 80 64 ori r24, 0x40 ; 64 20baa: 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; 20bae: 85 e0 ldi r24, 0x05 ; 5 20bb0: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 20bb2: 00 e0 ldi r16, 0x00 ; 0 20bb4: 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); 20bb6: cc 24 eor r12, r12 20bb8: 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); 20bba: 94 e0 ldi r25, 0x04 ; 4 20bbc: 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; 20bbe: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac if(Stopped) { 20bc2: 80 91 11 05 lds r24, 0x0511 ; 0x800511 20bc6: 88 23 and r24, r24 20bc8: 09 f4 brne .+2 ; 0x20bcc 20bca: c4 c0 rjmp .+392 ; 0x20d54 // 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); 20bcc: b0 92 be 02 sts 0x02BE, r11 ; 0x8002be } 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. 20bd0: 0e 94 05 67 call 0xce0a ; 0xce0a 20bd4: 88 23 and r24, r24 20bd6: 09 f4 brne .+2 ; 0x20bda 20bd8: c0 c0 rjmp .+384 ; 0x20d5a 20bda: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 20bde: 81 30 cpi r24, 0x01 ; 1 20be0: 09 f0 breq .+2 ; 0x20be4 20be2: bb c0 rjmp .+374 ; 0x20d5a usb_timer.start(); 20be4: 8e e0 ldi r24, 0x0E ; 14 20be6: 95 e0 ldi r25, 0x05 ; 5 20be8: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> } else #endif { get_command(); 20bec: 0e 94 a0 82 call 0x10540 ; 0x10540 // 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) 20bf0: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.553> 20bf4: 88 23 and r24, r24 20bf6: 89 f0 breq .+34 ; 0x20c1a return; if(autostart_atmillis.expired(5000)) 20bf8: 68 e8 ldi r22, 0x88 ; 136 20bfa: 73 e1 ldi r23, 0x13 ; 19 20bfc: 81 ea ldi r24, 0xA1 ; 161 20bfe: 97 e1 ldi r25, 0x17 ; 23 20c00: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 20c04: 81 11 cpse r24, r1 20c06: 09 c0 rjmp .+18 ; 0x20c1a return; } autostart_stilltocheck = false; 20c08: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.553> if(!mounted) 20c0c: 80 91 91 14 lds r24, 0x1491 ; 0x801491 20c10: 88 23 and r24, r24 20c12: 09 f4 brne .+2 ; 0x20c16 20c14: ae c0 rjmp .+348 ; 0x20d72 20c16: 0f 94 f2 76 call 0x2ede4 ; 0x2ede4 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 20c1a: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20c1e: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20c22: 89 2b or r24, r25 20c24: 09 f4 brne .+2 ; 0x20c28 20c26: 61 c0 rjmp .+194 ; 0x20cea { cmdbuffer_front_already_processed = false; 20c28: 10 92 a2 10 sts 0x10A2, r1 ; 0x8010a2 #ifdef SDSUPPORT if(card.saving) 20c2c: 80 91 8e 14 lds r24, 0x148E ; 0x80148e 20c30: 88 23 and r24, r24 20c32: d1 f1 breq .+116 ; 0x20ca8 { // 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) { 20c34: 80 91 92 12 lds r24, 0x1292 ; 0x801292 20c38: 90 91 93 12 lds r25, 0x1293 ; 0x801293 20c3c: dc 01 movw r26, r24 20c3e: a8 55 subi r26, 0x58 ; 88 20c40: bf 4e sbci r27, 0xEF ; 239 20c42: 7d 01 movw r14, r26 20c44: 65 ec ldi r22, 0xC5 ; 197 20c46: 7d e8 ldi r23, 0x8D ; 141 20c48: cd 01 movw r24, r26 20c4a: 0f 94 5b da call 0x3b4b6 ; 0x3b4b6 20c4e: 89 2b or r24, r25 20c50: 09 f0 breq .+2 ; 0x20c54 20c52: 9c c0 rjmp .+312 ; 0x20d8c else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 20c54: 10 92 20 17 sts 0x1720, r1 ; 0x801720 /** 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)); 20c58: f7 01 movw r30, r14 20c5a: 01 90 ld r0, Z+ 20c5c: 00 20 and r0, r0 20c5e: e9 f7 brne .-6 ; 0x20c5a 20c60: 31 97 sbiw r30, 0x01 ; 1 20c62: bf 01 movw r22, r30 20c64: 6e 19 sub r22, r14 20c66: 7f 09 sbc r23, r15 20c68: c7 01 movw r24, r14 20c6a: 0f 94 9b 84 call 0x30936 ; 0x30936 20c6e: 62 e0 ldi r22, 0x02 ; 2 20c70: 70 e0 ldi r23, 0x00 ; 0 20c72: 86 ef ldi r24, 0xF6 ; 246 20c74: 92 e0 ldi r25, 0x02 ; 2 20c76: 0f 94 9b 84 call 0x30936 ; 0x30936 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 20c7a: 80 91 20 17 lds r24, 0x1720 ; 0x801720 20c7e: 88 23 and r24, r24 20c80: 41 f0 breq .+16 ; 0x20c92 { SERIAL_ERROR_START; 20c82: 8a e9 ldi r24, 0x9A ; 154 20c84: 9a ea ldi r25, 0xAA ; 170 20c86: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 20c8a: 8f ee ldi r24, 0xEF ; 239 20c8c: 9c e6 ldi r25, 0x6C ; 108 20c8e: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 20c92: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 20c96: 88 23 and r24, r24 20c98: 09 f4 brne .+2 ; 0x20c9c 20c9a: 73 c0 rjmp .+230 ; 0x20d82 */ void process_commands() { if (!buflen) return; //empty command 20c9c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20ca0: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20ca4: 89 2b or r24, r25 20ca6: 11 f0 breq .+4 ; 0x20cac 20ca8: 0e 94 03 95 call 0x12a06 ; 0x12a06 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 20cac: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 20cb0: 81 11 cpse r24, r1 20cb2: 19 c0 rjmp .+50 ; 0x20ce6 20cb4: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20cb8: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20cbc: 89 2b or r24, r25 20cbe: 99 f0 breq .+38 ; 0x20ce6 { // 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; 20cc0: e0 91 92 12 lds r30, 0x1292 ; 0x801292 20cc4: f0 91 93 12 lds r31, 0x1293 ; 0x801293 20cc8: eb 55 subi r30, 0x5B ; 91 20cca: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 20ccc: 80 81 ld r24, Z 20cce: 82 30 cpi r24, 0x02 ; 2 20cd0: 09 f0 breq .+2 ; 0x20cd4 20cd2: 6b c0 rjmp .+214 ; 0x20daa { // 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(); 20cd4: 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; 20cd6: 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); 20cd8: 81 81 ldd r24, Z+1 ; 0x01 20cda: 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); 20cdc: 0f 94 81 64 call 0x2c902 ; 0x2c902 sei(); 20ce0: 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(); 20ce2: 0e 94 3c 76 call 0xec78 ; 0xec78 } host_keepalive(); 20ce6: 0e 94 27 7f call 0xfe4e ; 0xfe4e } } //check heater every n milliseconds manage_heater(); 20cea: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(printingIsPaused()); 20cee: 0e 94 05 67 call 0xce0a ; 0xce0a 20cf2: 0e 94 37 8a call 0x1146e ; 0x1146e //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 20cf6: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.482> 20cfa: 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; 20cfc: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.482> checkHitEndstops(); lcd_update(0); 20d00: 80 e0 ldi r24, 0x00 ; 0 20d02: 0e 94 27 6e call 0xdc4e ; 0xdc4e #ifdef TMC2130 tmc2130_check_overtemp(); 20d06: 0f 94 ec 2a call 0x255d8 ; 0x255d8 if (tmc2130_sg_crash) 20d0a: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 20d0e: 88 23 and r24, r24 20d10: 79 f0 breq .+30 ; 0x20d30 { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 20d12: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d // crashdet_stop_and_save_print(); switch (crash) 20d16: 82 30 cpi r24, 0x02 ; 2 20d18: 09 f4 brne .+2 ; 0x20d1c 20d1a: 53 c0 rjmp .+166 ; 0x20dc2 20d1c: 83 30 cpi r24, 0x03 ; 3 20d1e: 09 f4 brne .+2 ; 0x20d22 20d20: 54 c0 rjmp .+168 ; 0x20dca 20d22: 81 30 cpi r24, 0x01 ; 1 20d24: 29 f4 brne .+10 ; 0x20d30 { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 20d26: 61 e0 ldi r22, 0x01 ; 1 20d28: 85 eb ldi r24, 0xB5 ; 181 20d2a: 9d e8 ldi r25, 0x8D ; 141 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20d2c: 0e 94 a0 87 call 0x10f40 ; 0x10f40 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) { 20d30: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.542> 20d34: 81 11 cpse r24, r1 20d36: 07 c0 rjmp .+14 ; 0x20d46 return; } avoidRecursion = true; 20d38: c0 92 0c 05 sts 0x050C, r12 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.542> mmu_loop_inner(true); 20d3c: 81 e0 ldi r24, 0x01 ; 1 20d3e: 0f 94 3a a7 call 0x34e74 ; 0x34e74 avoidRecursion = false; 20d42: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.542> 20d46: 01 15 cp r16, r1 20d48: 11 05 cpc r17, r1 20d4a: 09 f4 brne .+2 ; 0x20d4e 20d4c: 38 cf rjmp .-400 ; 0x20bbe 20d4e: 0e 94 00 00 call 0 ; 0x0 <__vectors> 20d52: 35 cf rjmp .-406 ; 0x20bbe // 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); 20d54: c0 92 be 02 sts 0x02BE, r12 ; 0x8002be 20d58: 3b cf rjmp .-394 ; 0x20bd0 } 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. 20d5a: 60 e1 ldi r22, 0x10 ; 16 20d5c: 77 e2 ldi r23, 0x27 ; 39 20d5e: 8e e0 ldi r24, 0x0E ; 14 20d60: 95 e0 ldi r25, 0x05 ; 5 20d62: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 20d66: 88 23 and r24, r24 20d68: 09 f4 brne .+2 ; 0x20d6c 20d6a: 40 cf rjmp .-384 ; 0x20bec 20d6c: b0 92 b8 0d sts 0x0DB8, r11 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 20d70: 3d cf rjmp .-390 ; 0x20bec return; } autostart_stilltocheck = false; if(!mounted) { mount(); 20d72: 81 e0 ldi r24, 0x01 ; 1 20d74: 0f 94 fd 81 call 0x303fa ; 0x303fa if(!mounted) //fail 20d78: 80 91 91 14 lds r24, 0x1491 ; 0x801491 20d7c: 81 11 cpse r24, r1 20d7e: 4b cf rjmp .-362 ; 0x20c16 20d80: 4c cf rjmp .-360 ; 0x20c1a 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); 20d82: 87 e1 ldi r24, 0x17 ; 23 20d84: 9d e6 ldi r25, 0x6D ; 109 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 20d86: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 20d8a: 90 cf rjmp .-224 ; 0x20cac lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20d8c: 80 e2 ldi r24, 0x20 ; 32 20d8e: 97 e1 ldi r25, 0x17 ; 23 20d90: 0f 94 76 59 call 0x2b2ec ; 0x2b2ec file.close(); 20d94: 80 e2 ldi r24, 0x20 ; 32 20d96: 97 e1 ldi r25, 0x17 ; 23 20d98: 0f 94 ab 59 call 0x2b356 ; 0x2b356 saving = false; 20d9c: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 20da0: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f 20da4: 85 e0 ldi r24, 0x05 ; 5 20da6: 9d e6 ldi r25, 0x6D ; 109 20da8: ee cf rjmp .-36 ; 0x20d86 // 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){ 20daa: 86 30 cpi r24, 0x06 ; 6 20dac: 09 f0 breq .+2 ; 0x20db0 20dae: 99 cf rjmp .-206 ; 0x20ce2 20db0: 80 91 90 14 lds r24, 0x1490 ; 0x801490 20db4: 81 11 cpse r24, r1 20db6: 95 cf rjmp .-214 ; 0x20ce2 cli(); 20db8: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 20dba: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 20dbc: 81 e0 ldi r24, 0x01 ; 1 20dbe: 90 e0 ldi r25, 0x00 ; 0 20dc0: 8d cf rjmp .-230 ; 0x20cdc 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; 20dc2: 61 e0 ldi r22, 0x01 ; 1 20dc4: 85 ea ldi r24, 0xA5 ; 165 20dc6: 9d e8 ldi r25, 0x8D ; 141 20dc8: b1 cf rjmp .-158 ; 0x20d2c case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20dca: 61 e0 ldi r22, 0x01 ; 1 20dcc: 84 e9 ldi r24, 0x94 ; 148 20dce: 9d e8 ldi r25, 0x8D ; 141 20dd0: ad cf rjmp .-166 ; 0x20d2c { 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; 20dd2: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 20dd4: 86 33 cpi r24, 0x36 ; 54 20dd6: 91 40 sbci r25, 0x01 ; 1 20dd8: 09 f0 breq .+2 ; 0x20ddc 20dda: 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(); 20ddc: 0e 94 0c 82 call 0x10418 ; 0x10418 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; 20de0: 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; 20de2: 82 ea ldi r24, 0xA2 ; 162 20de4: 92 ea ldi r25, 0xA2 ; 162 20de6: a0 e0 ldi r26, 0x00 ; 0 20de8: b0 e0 ldi r27, 0x00 ; 0 20dea: 80 93 40 18 sts 0x1840, r24 ; 0x801840 <__bss_end+0x20> 20dee: 90 93 41 18 sts 0x1841, r25 ; 0x801841 <__bss_end+0x21> 20df2: a0 93 42 18 sts 0x1842, r26 ; 0x801842 <__bss_end+0x22> 20df6: b0 93 43 18 sts 0x1843, r27 ; 0x801843 <__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; 20dfa: 10 92 b3 04 sts 0x04B3, r1 ; 0x8004b3 <_ZL14iState_sum_min.lto_priv.470> 20dfe: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 <_ZL14iState_sum_min.lto_priv.470+0x1> 20e02: 10 92 b5 04 sts 0x04B5, r1 ; 0x8004b5 <_ZL14iState_sum_min.lto_priv.470+0x2> 20e06: 10 92 b6 04 sts 0x04B6, r1 ; 0x8004b6 <_ZL14iState_sum_min.lto_priv.470+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 20e0a: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 20e0e: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 20e12: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 20e16: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 20e1a: 60 e0 ldi r22, 0x00 ; 0 20e1c: 70 e0 ldi r23, 0x00 ; 0 20e1e: 8f e7 ldi r24, 0x7F ; 127 20e20: 93 e4 ldi r25, 0x43 ; 67 20e22: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 20e26: 60 93 af 04 sts 0x04AF, r22 ; 0x8004af <_ZL14iState_sum_max.lto_priv.471> 20e2a: 70 93 b0 04 sts 0x04B0, r23 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.471+0x1> 20e2e: 80 93 b1 04 sts 0x04B1, r24 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.471+0x2> 20e32: 90 93 b2 04 sts 0x04B2, r25 ; 0x8004b2 <_ZL14iState_sum_max.lto_priv.471+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 20e36: 10 92 ab 04 sts 0x04AB, r1 ; 0x8004ab <_ZL19temp_iState_min_bed.lto_priv.468> 20e3a: 10 92 ac 04 sts 0x04AC, r1 ; 0x8004ac <_ZL19temp_iState_min_bed.lto_priv.468+0x1> 20e3e: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL19temp_iState_min_bed.lto_priv.468+0x2> 20e42: 10 92 ae 04 sts 0x04AE, r1 ; 0x8004ae <_ZL19temp_iState_min_bed.lto_priv.468+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 20e46: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 20e4a: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 20e4e: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 20e52: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 20e56: 60 e0 ldi r22, 0x00 ; 0 20e58: 70 e0 ldi r23, 0x00 ; 0 20e5a: 8f e7 ldi r24, 0x7F ; 127 20e5c: 93 e4 ldi r25, 0x43 ; 67 20e5e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 20e62: 60 93 a7 04 sts 0x04A7, r22 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.469> 20e66: 70 93 a8 04 sts 0x04A8, r23 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.469+0x1> 20e6a: 80 93 a9 04 sts 0x04A9, r24 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.469+0x2> 20e6e: 90 93 aa 04 sts 0x04AA, r25 ; 0x8004aa <_ZL19temp_iState_max_bed.lto_priv.469+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 20e72: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20e74: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20e76: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20e7a: 88 60 ori r24, 0x08 ; 8 20e7c: 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)); 20e80: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 20e84: 90 e0 ldi r25, 0x00 ; 0 20e86: b4 e0 ldi r27, 0x04 ; 4 20e88: 95 95 asr r25 20e8a: 87 95 ror r24 20e8c: ba 95 dec r27 20e8e: e1 f7 brne .-8 ; 0x20e88 20e90: 80 93 a5 04 sts 0x04A5, r24 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.462> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 20e94: 8a e0 ldi r24, 0x0A ; 10 20e96: 90 e0 ldi r25, 0x00 ; 0 20e98: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 <_ZL8minttemp.lto_priv.463+0x1> 20e9c: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 <_ZL8minttemp.lto_priv.463> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20ea0: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.474> 20ea4: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.474+0x1> 20ea8: 0f 94 54 a1 call 0x342a8 ; 0x342a8 20eac: 20 e0 ldi r18, 0x00 ; 0 20eae: 30 e0 ldi r19, 0x00 ; 0 20eb0: 40 e2 ldi r20, 0x20 ; 32 20eb2: 51 e4 ldi r21, 0x41 ; 65 20eb4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 20eb8: 87 fd sbrc r24, 7 20eba: 02 c0 rjmp .+4 ; 0x20ec0 20ebc: 0c 94 08 ff jmp 0x1fe10 ; 0x1fe10 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20ec0: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.474> 20ec4: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.474+0x1> 20ec8: 40 97 sbiw r24, 0x10 ; 16 20eca: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL12minttemp_raw.lto_priv.474+0x1> 20ece: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL12minttemp_raw.lto_priv.474> 20ed2: e6 cf rjmp .-52 ; 0x20ea0 00020ed4 : } } void lcd_print_stop_finish(); void lcd_commands() 20ed4: 2f 92 push r2 20ed6: 3f 92 push r3 20ed8: 4f 92 push r4 20eda: 5f 92 push r5 20edc: 6f 92 push r6 20ede: 7f 92 push r7 20ee0: 8f 92 push r8 20ee2: 9f 92 push r9 20ee4: af 92 push r10 20ee6: bf 92 push r11 20ee8: cf 92 push r12 20eea: df 92 push r13 20eec: ef 92 push r14 20eee: ff 92 push r15 20ef0: 0f 93 push r16 20ef2: 1f 93 push r17 20ef4: cf 93 push r28 20ef6: 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) 20ef8: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 20efc: 81 30 cpi r24, 0x01 ; 1 20efe: 09 f0 breq .+2 ; 0x20f02 20f00: 61 c0 rjmp .+194 ; 0x20fc4 20f02: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 20f06: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && !homing_flag) 20f0a: 98 13 cpse r25, r24 20f0c: 5b c0 rjmp .+182 ; 0x20fc4 20f0e: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 20f12: 81 11 cpse r24, r1 20f14: 57 c0 rjmp .+174 ; 0x20fc4 { custom_message_type = CustomMsg::Status; 20f16: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 20f1a: 81 ed ldi r24, 0xD1 ; 209 20f1c: 99 e4 ldi r25, 0x49 ; 73 20f1e: 0e 94 2c 72 call 0xe458 ; 0xe458 20f22: 0e 94 3b f2 call 0x1e476 ; 0x1e476 lcd_commands_type = LcdCommands::Idle; 20f26: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 20f2a: 82 e0 ldi r24, 0x02 ; 2 20f2c: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 20f30: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb #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(); 20f34: 0f 94 b6 43 call 0x2876c ; 0x2876c save_statistics(); 20f38: 0e 94 9f 65 call 0xcb3e ; 0xcb3e // lift Z raise_z(10); 20f3c: 60 e0 ldi r22, 0x00 ; 0 20f3e: 70 e0 ldi r23, 0x00 ; 0 20f40: 80 e2 ldi r24, 0x20 ; 32 20f42: 91 e4 ldi r25, 0x41 ; 65 20f44: 0e 94 61 6d call 0xdac2 ; 0xdac2 // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 20f48: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 20f4c: 88 23 and r24, r24 20f4e: 21 f1 breq .+72 ; 0x20f98 20f50: 80 91 90 06 lds r24, 0x0690 ; 0x800690 20f54: 88 23 and r24, r24 20f56: 01 f1 breq .+64 ; 0x20f98 current_position[X_AXIS] = X_CANCEL_POS; 20f58: 80 e0 ldi r24, 0x00 ; 0 20f5a: 90 e0 ldi r25, 0x00 ; 0 20f5c: a8 e4 ldi r26, 0x48 ; 72 20f5e: b2 e4 ldi r27, 0x42 ; 66 20f60: 80 93 92 06 sts 0x0692, r24 ; 0x800692 20f64: 90 93 93 06 sts 0x0693, r25 ; 0x800693 20f68: a0 93 94 06 sts 0x0694, r26 ; 0x800694 20f6c: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = Y_CANCEL_POS; 20f70: 80 e0 ldi r24, 0x00 ; 0 20f72: 90 e0 ldi r25, 0x00 ; 0 20f74: ae e3 ldi r26, 0x3E ; 62 20f76: b3 e4 ldi r27, 0x43 ; 67 20f78: 80 93 96 06 sts 0x0696, r24 ; 0x800696 20f7c: 90 93 97 06 sts 0x0697, r25 ; 0x800697 20f80: a0 93 98 06 sts 0x0698, r26 ; 0x800698 20f84: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 20f88: 60 e0 ldi r22, 0x00 ; 0 20f8a: 70 e0 ldi r23, 0x00 ; 0 20f8c: 84 e3 ldi r24, 0x34 ; 52 20f8e: 92 e4 ldi r25, 0x42 ; 66 20f90: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 20f94: 0f 94 ed 43 call 0x287da ; 0x287da temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 20f98: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> // 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()) { 20f9c: 88 23 and r24, r24 20f9e: 09 f4 brne .+2 ; 0x20fa2 20fa0: c8 c0 rjmp .+400 ; 0x21132 // time to stop the error beep WRITE(BEEPER, LOW); 20fa2: 9f b7 in r25, 0x3f ; 63 20fa4: f8 94 cli 20fa6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20faa: 8b 7f andi r24, 0xFB ; 251 20fac: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20fb0: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 20fb2: 0f 94 32 30 call 0x26064 ; 0x26064 finishAndDisableSteppers(); //M84 20fb6: 0e 94 e8 81 call 0x103d0 ; 0x103d0 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 20fba: 88 e0 ldi r24, 0x08 ; 8 20fbc: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 did_pause_print = false; // Clear pause state in case the print was aborted while paused 20fc0: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 20fc4: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 20fc8: 82 30 cpi r24, 0x02 ; 2 20fca: 09 f0 breq .+2 ; 0x20fce 20fcc: 6a c0 rjmp .+212 ; 0x210a2 20fce: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 20fd2: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && !homing_flag) 20fd6: 98 13 cpse r25, r24 20fd8: 64 c0 rjmp .+200 ; 0x210a2 20fda: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 20fde: 81 11 cpse r24, r1 20fe0: 60 c0 rjmp .+192 ; 0x210a2 { if (custom_message_type != CustomMsg::M117) 20fe2: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 20fe6: 87 30 cpi r24, 0x07 ; 7 20fe8: 41 f0 breq .+16 ; 0x20ffa { custom_message_type = CustomMsg::Status; 20fea: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 20fee: 82 ec ldi r24, 0xC2 ; 194 20ff0: 99 e4 ldi r25, 0x49 ; 73 20ff2: 0e 94 2c 72 call 0xe458 ; 0xe458 20ff6: 0e 94 3b f2 call 0x1e476 ; 0x1e476 } lcd_commands_type = LcdCommands::Idle; 20ffa: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 20ffe: 82 e0 ldi r24, 0x02 ; 2 21000: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 21004: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 21008: 0f 94 ed 43 call 0x287da ; 0x287da // Stop heaters heating_status = HeatingStatus::NO_HEATING; 2100c: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 21010: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 21014: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 21018: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.483+0x8> 2101c: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.483+0x9> 21020: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.483+0xa> 21024: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.483+0xb> 21028: 0e 94 61 6d call 0xdac2 ; 0xdac2 // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 2102c: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 21030: 88 23 and r24, r24 21032: 51 f1 breq .+84 ; 0x21088 21034: 80 91 90 06 lds r24, 0x0690 ; 0x800690 21038: 88 23 and r24, r24 2103a: 31 f1 breq .+76 ; 0x21088 current_position[X_AXIS] = pause_position[X_AXIS]; 2103c: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.483> 21040: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.483+0x1> 21044: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.483+0x2> 21048: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.483+0x3> 2104c: 80 93 92 06 sts 0x0692, r24 ; 0x800692 21050: 90 93 93 06 sts 0x0693, r25 ; 0x800693 21054: a0 93 94 06 sts 0x0694, r26 ; 0x800694 21058: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pause_position[Y_AXIS]; 2105c: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.483+0x4> 21060: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.483+0x5> 21064: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.483+0x6> 21068: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.483+0x7> 2106c: 80 93 96 06 sts 0x0696, r24 ; 0x800696 21070: 90 93 97 06 sts 0x0697, r25 ; 0x800697 21074: a0 93 98 06 sts 0x0698, r26 ; 0x800698 21078: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(50); 2107c: 60 e0 ldi r22, 0x00 ; 0 2107e: 70 e0 ldi r23, 0x00 ; 0 21080: 88 e4 ldi r24, 0x48 ; 72 21082: 92 e4 ldi r25, 0x42 ; 66 21084: 0f 94 81 c0 call 0x38102 ; 0x38102 21088: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> } // did we come here from a thermal error? if(get_temp_error()) { 2108c: 88 23 and r24, r24 2108e: 09 f4 brne .+2 ; 0x21092 21090: 7a c0 rjmp .+244 ; 0x21186 // time to stop the error beep WRITE(BEEPER, LOW); 21092: 9f b7 in r25, 0x3f ; 63 21094: f8 94 cli 21096: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2109a: 8b 7f andi r24, 0xFB ; 251 2109c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 210a0: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 210a2: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 210a6: 84 30 cpi r24, 0x04 ; 4 210a8: 09 f0 breq .+2 ; 0x210ac 210aa: a7 c0 rjmp .+334 ; 0x211fa { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 210ac: 85 ea ldi r24, 0xA5 ; 165 210ae: 9d e0 ldi r25, 0x0D ; 13 210b0: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 210b4: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 210b8: 20 91 a6 0d lds r18, 0x0DA6 ; 0x800da6 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 210bc: 32 13 cpse r19, r18 210be: 74 c1 rjmp .+744 ; 0x213a8 210c0: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 210c4: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 210c8: 23 2b or r18, r19 210ca: 09 f0 breq .+2 ; 0x210ce 210cc: 6d c1 rjmp .+730 ; 0x213a8 210ce: c0 91 a9 0d lds r28, 0x0DA9 ; 0x800da9 210d2: c1 11 cpse r28, r1 210d4: 69 c1 rjmp .+722 ; 0x213a8 { if (lcd_commands_step == 0) 210d6: 20 91 fb 03 lds r18, 0x03FB ; 0x8003fb 210da: 21 11 cpse r18, r1 210dc: 57 c0 rjmp .+174 ; 0x2118c lcd_commands_step = 12; 210de: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 210e0: 20 93 fb 03 sts 0x03FB, r18 ; 0x8003fb } 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; 210e4: 44 96 adiw r24, 0x14 ; 20 210e6: bc 01 movw r22, r24 210e8: 90 e0 ldi r25, 0x00 ; 0 210ea: 80 e0 ldi r24, 0x00 ; 0 210ec: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 210f0: 20 e0 ldi r18, 0x00 ; 0 210f2: 30 e0 ldi r19, 0x00 ; 0 210f4: 4a e7 ldi r20, 0x7A ; 122 210f6: 54 e4 ldi r21, 0x44 ; 68 210f8: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 210fc: 4b 01 movw r8, r22 210fe: 5c 01 movw r10, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 21100: e0 91 fb 03 lds r30, 0x03FB ; 0x8003fb 21104: e1 50 subi r30, 0x01 ; 1 21106: ec 30 cpi r30, 0x0C ; 12 21108: 08 f0 brcs .+2 ; 0x2110c 2110a: 77 c0 rjmp .+238 ; 0x211fa 2110c: f0 e0 ldi r31, 0x00 ; 0 2110e: 88 27 eor r24, r24 21110: e3 57 subi r30, 0x73 ; 115 21112: f7 4f sbci r31, 0xF7 ; 247 21114: 8e 4f sbci r24, 0xFE ; 254 21116: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 2111a: b4 3a cpi r27, 0xA4 ; 164 2111c: 2e 3a cpi r18, 0xAE ; 174 2111e: d6 39 cpi r29, 0x96 ; 150 21120: d6 39 cpi r29, 0x96 ; 150 21122: d6 39 cpi r29, 0x96 ; 150 21124: d6 39 cpi r29, 0x96 ; 150 21126: 8e 39 cpi r24, 0x9E ; 158 21128: 02 39 cpi r16, 0x92 ; 146 2112a: da 38 cpi r29, 0x8A ; 138 2112c: 06 3a cpi r16, 0xA6 ; 166 2112e: 4c 39 cpi r20, 0x9C ; 156 21130: be 38 cpi r27, 0x8E ; 142 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 21132: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 { #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); #endif resetFanCheck(); 21136: 0e 94 61 74 call 0xe8c2 ; 0xe8c2 setExtruderAutoFanState(1); 2113a: 81 e0 ldi r24, 0x01 ; 1 2113c: 0e 94 db 74 call 0xe9b6 ; 0xe9b6 // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21140: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 21144: 81 30 cpi r24, 0x01 ; 1 21146: 09 f0 breq .+2 ; 0x2114a 21148: 34 cf rjmp .-408 ; 0x20fb2 fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 2114a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 2114e: 88 23 and r24, r24 21150: 09 f4 brne .+2 ; 0x21154 21152: 2f cf rjmp .-418 ; 0x20fb2 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21154: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 21158: 82 30 cpi r24, 0x02 ; 2 2115a: 09 f4 brne .+2 ; 0x2115e 2115c: 2a cf rjmp .-428 ; 0x20fb2 #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()) 2115e: 0e 94 05 67 call 0xce0a ; 0xce0a 21162: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 21164: 0e 94 49 64 call 0xc892 ; 0xc892 } // 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) { 21168: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 2116c: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 21170: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 21174: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 21178: 28 17 cp r18, r24 2117a: 39 07 cpc r19, r25 2117c: 0c f4 brge .+2 ; 0x21180 2117e: 19 cf rjmp .-462 ; 0x20fb2 MMU2::mmu2.unload(); // M702 21180: 0f 94 75 ad call 0x35aea ; 0x35aea 21184: 16 cf rjmp .-468 ; 0x20fb2 } else { // Turn off the print fan fanSpeed = 0; 21186: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 2118a: 8b cf rjmp .-234 ; 0x210a2 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 2118c: 21 50 subi r18, 0x01 ; 1 2118e: a8 cf rjmp .-176 ; 0x210e0 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 21190: 65 e0 ldi r22, 0x05 ; 5 21192: 8e e5 ldi r24, 0x5E ; 94 21194: 9a e8 ldi r25, 0x8A ; 138 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]))); 21196: 0e 94 1f 88 call 0x1103e ; 0x1103e 2119a: 2f c0 rjmp .+94 ; 0x211fa //! @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()) 2119c: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 211a0: 81 30 cpi r24, 0x01 ; 1 211a2: 49 f5 brne .+82 ; 0x211f6 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 211a4: d0 91 fa 03 lds r29, 0x03FA ; 0x8003fa { enquecommand_P(MSG_M83); 211a8: 61 e0 ldi r22, 0x01 ; 1 211aa: 8c e3 ldi r24, 0x3C ; 60 211ac: 9b e6 ldi r25, 0x6B ; 107 211ae: 0e 94 a0 87 call 0x10f40 ; 0x10f40 enquecommand_P(PSTR("G1Y-3F1000")); 211b2: 61 e0 ldi r22, 0x01 ; 1 211b4: 83 e5 ldi r24, 0x53 ; 83 211b6: 9a e8 ldi r25, 0x8A ; 138 211b8: 0e 94 a0 87 call 0x10f40 ; 0x10f40 enquecommand_P(PSTR("G1Z0.4")); 211bc: 61 e0 ldi r22, 0x01 ; 1 211be: 8c e4 ldi r24, 0x4C ; 76 211c0: 9a e8 ldi r25, 0x8A ; 138 211c2: 0e 94 a0 87 call 0x10f40 ; 0x10f40 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 211c6: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 if(currentTool == filament ){ 211ca: d8 17 cp r29, r24 211cc: a1 f0 breq .+40 ; 0x211f6 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 211ce: 8f 3f cpi r24, 0xFF ; 255 211d0: 29 f0 breq .+10 ; 0x211dc // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 211d2: 61 e0 ldi r22, 0x01 ; 1 211d4: 87 e3 ldi r24, 0x37 ; 55 211d6: 9b e6 ldi r25, 0x6B ; 107 211d8: 0e 94 a0 87 call 0x10f40 ; 0x10f40 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 211dc: 1f 92 push r1 211de: df 93 push r29 211e0: 88 e4 ldi r24, 0x48 ; 72 211e2: 9a e8 ldi r25, 0x8A ; 138 211e4: 9f 93 push r25 211e6: 8f 93 push r24 211e8: 0e 94 3e 88 call 0x1107c ; 0x1107c 211ec: 0f 90 pop r0 211ee: 0f 90 pop r0 211f0: 0f 90 pop r0 211f2: 0f 90 pop r0 return true; 211f4: c1 e0 ldi r28, 0x01 ; 1 211f6: c0 93 f9 03 sts 0x03F9, r28 ; 0x8003f9 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 211fa: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 211fe: 83 30 cpi r24, 0x03 ; 3 21200: 09 f0 breq .+2 ; 0x21204 21202: d2 c0 rjmp .+420 ; 0x213a8 if (lcd_commands_step == 0) { 21204: 90 91 fb 03 lds r25, 0x03FB ; 0x8003fb 21208: 91 11 cpse r25, r1 2120a: 09 c0 rjmp .+18 ; 0x2121e custom_message_type = CustomMsg::PidCal; 2120c: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = 1; 21210: 91 e0 ldi r25, 0x01 ; 1 21212: 90 93 f7 03 sts 0x03F7, r25 ; 0x8003f7 lcd_draw_update = 3; 21216: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 2121a: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 2121e: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 21222: 83 30 cpi r24, 0x03 ; 3 21224: 19 f5 brne .+70 ; 0x2126c 21226: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 2122a: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 2122e: 98 13 cpse r25, r24 21230: 1d c0 rjmp .+58 ; 0x2126c return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 21232: 0f 94 1d 30 call 0x2603a ; 0x2603a pid_tuning_finished = false; 21236: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.460> 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); 2123a: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.443+0x1> 2123e: 8f 93 push r24 21240: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.443> 21244: 8f 93 push r24 21246: 89 ee ldi r24, 0xE9 ; 233 21248: 9a e8 ldi r25, 0x8A ; 138 2124a: 9f 93 push r25 2124c: 8f 93 push r24 2124e: 0e 94 3e 88 call 0x1107c ; 0x1107c lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 21252: 87 eb ldi r24, 0xB7 ; 183 21254: 99 e4 ldi r25, 0x49 ; 73 21256: 0e 94 2c 72 call 0xe458 ; 0xe458 2125a: 0e 94 3b f2 call 0x1e476 ; 0x1e476 lcd_commands_step = 2; 2125e: 82 e0 ldi r24, 0x02 ; 2 21260: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb 21264: 0f 90 pop r0 21266: 0f 90 pop r0 21268: 0f 90 pop r0 2126a: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 2126c: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 21270: 82 30 cpi r24, 0x02 ; 2 21272: 09 f0 breq .+2 ; 0x21276 21274: 7a c0 rjmp .+244 ; 0x2136a 21276: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.460> 2127a: 88 23 and r24, r24 2127c: 09 f4 brne .+2 ; 0x21280 2127e: 75 c0 rjmp .+234 ; 0x2136a custom_message_state = 0; 21280: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 21284: 83 ea ldi r24, 0xA3 ; 163 21286: 99 e4 ldi r25, 0x49 ; 73 21288: 0e 94 2c 72 call 0xe458 ; 0xe458 2128c: 0e 94 3b f2 call 0x1e476 ; 0x1e476 21290: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 21294: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 21298: c0 91 f3 03 lds r28, 0x03F3 ; 0x8003f3 <_Kp> 2129c: d0 91 f4 03 lds r29, 0x03F4 ; 0x8003f4 <_Kp+0x1> 212a0: 10 91 f5 03 lds r17, 0x03F5 ; 0x8003f5 <_Kp+0x2> 212a4: 00 91 f6 03 lds r16, 0x03F6 ; 0x8003f6 <_Kp+0x3> 212a8: 20 e0 ldi r18, 0x00 ; 0 212aa: 30 e0 ldi r19, 0x00 ; 0 212ac: a9 01 movw r20, r18 212ae: f8 01 movw r30, r16 212b0: 6c 2f mov r22, r28 212b2: 7d 2f mov r23, r29 212b4: 8f 2f mov r24, r31 212b6: 9e 2f mov r25, r30 212b8: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 212bc: 81 11 cpse r24, r1 212be: 1f c0 rjmp .+62 ; 0x212fe 212c0: 20 e0 ldi r18, 0x00 ; 0 212c2: 30 e0 ldi r19, 0x00 ; 0 212c4: a9 01 movw r20, r18 212c6: 60 91 ef 03 lds r22, 0x03EF ; 0x8003ef <_Ki> 212ca: 70 91 f0 03 lds r23, 0x03F0 ; 0x8003f0 <_Ki+0x1> 212ce: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 212d2: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 <_Ki+0x3> 212d6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 212da: 81 11 cpse r24, r1 212dc: 10 c0 rjmp .+32 ; 0x212fe 212de: 20 e0 ldi r18, 0x00 ; 0 212e0: 30 e0 ldi r19, 0x00 ; 0 212e2: a9 01 movw r20, r18 212e4: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Kd> 212e8: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Kd+0x1> 212ec: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 212f0: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Kd+0x3> 212f4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 212f8: 88 23 and r24, r24 212fa: 09 f4 brne .+2 ; 0x212fe 212fc: 7e c2 rjmp .+1276 ; 0x217fa enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 212fe: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_Kd+0x3> 21302: 8f 93 push r24 21304: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 21308: 8f 93 push r24 2130a: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Kd+0x1> 2130e: 8f 93 push r24 21310: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Kd> 21314: 8f 93 push r24 21316: 80 91 f2 03 lds r24, 0x03F2 ; 0x8003f2 <_Ki+0x3> 2131a: 8f 93 push r24 2131c: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 21320: 8f 93 push r24 21322: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 <_Ki+0x1> 21326: 8f 93 push r24 21328: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_Ki> 2132c: 8f 93 push r24 2132e: 0f 93 push r16 21330: 1f 93 push r17 21332: df 93 push r29 21334: cf 93 push r28 21336: 82 ed ldi r24, 0xD2 ; 210 21338: 9a e8 ldi r25, 0x8A ; 138 2133a: 9f 93 push r25 2133c: 8f 93 push r24 2133e: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommand_P(MSG_M500); 21342: 61 e0 ldi r22, 0x01 ; 1 21344: 86 e4 ldi r24, 0x46 ; 70 21346: 9b e6 ldi r25, 0x6B ; 107 21348: 0e 94 a0 87 call 0x10f40 ; 0x10f40 2134c: 8d b7 in r24, 0x3d ; 61 2134e: 9e b7 in r25, 0x3e ; 62 21350: 0e 96 adiw r24, 0x0e ; 14 21352: 0f b6 in r0, 0x3f ; 63 21354: f8 94 cli 21356: 9e bf out 0x3e, r25 ; 62 21358: 0f be out 0x3f, r0 ; 63 2135a: 8d bf out 0x3d, r24 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 2135c: 88 ee ldi r24, 0xE8 ; 232 2135e: 93 e0 ldi r25, 0x03 ; 3 21360: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> lcd_commands_step = 1; 21364: 81 e0 ldi r24, 0x01 ; 1 21366: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 2136a: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 2136e: 81 30 cpi r24, 0x01 ; 1 21370: d9 f4 brne .+54 ; 0x213a8 21372: 60 ed ldi r22, 0xD0 ; 208 21374: 77 e0 ldi r23, 0x07 ; 7 21376: 88 ee ldi r24, 0xE8 ; 232 21378: 93 e0 ldi r25, 0x03 ; 3 2137a: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 2137e: 88 23 and r24, r24 21380: 99 f0 breq .+38 ; 0x213a8 lcd_setstatuspgm(MSG_WELCOME); 21382: 8f ec ldi r24, 0xCF ; 207 21384: 9f e6 ldi r25, 0x6F ; 111 21386: 0e 94 3b f2 call 0x1e476 ; 0x1e476 custom_message_type = CustomMsg::Status; 2138a: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 pid_temp = DEFAULT_PID_TEMP; 2138e: 82 ed ldi r24, 0xD2 ; 210 21390: 90 e0 ldi r25, 0x00 ; 0 21392: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.443+0x1> 21396: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.443> lcd_commands_step = 0; 2139a: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 2139e: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 213a2: 82 e0 ldi r24, 0x02 ; 2 213a4: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> SetPrinterState(PrinterState::Idle); } } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) 213a8: 90 91 b4 0d lds r25, 0x0DB4 ; 0x800db4 213ac: 95 30 cpi r25, 0x05 ; 5 213ae: 99 f4 brne .+38 ; 0x213d6 213b0: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 213b4: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 213b8: 23 2b or r18, r19 213ba: 79 f5 brne .+94 ; 0x2141a { switch (lcd_commands_step) 213bc: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 213c0: 82 30 cpi r24, 0x02 ; 2 213c2: 09 f4 brne .+2 ; 0x213c6 213c4: 43 c2 rjmp .+1158 ; 0x2184c 213c6: 08 f0 brcs .+2 ; 0x213ca 213c8: 1d c2 rjmp .+1082 ; 0x21804 213ca: 88 23 and r24, r24 213cc: 09 f4 brne .+2 ; 0x213d0 213ce: 2e c2 rjmp .+1116 ; 0x2182c 213d0: 81 30 cpi r24, 0x01 ; 1 213d2: 09 f4 brne .+2 ; 0x213d6 213d4: 46 c2 rjmp .+1164 ; 0x21862 break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 213d6: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 213da: 86 30 cpi r24, 0x06 ; 6 213dc: f1 f4 brne .+60 ; 0x2141a 213de: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 213e2: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 213e6: 98 13 cpse r25, r24 213e8: 18 c0 rjmp .+48 ; 0x2141a 213ea: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 213ee: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 213f2: 89 2b or r24, r25 213f4: 91 f4 brne .+36 ; 0x2141a 213f6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 213fa: 81 11 cpse r24, r1 213fc: 0e c0 rjmp .+28 ; 0x2141a #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) 213fe: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 21402: 81 30 cpi r24, 0x01 ; 1 21404: 09 f4 brne .+2 ; 0x21408 21406: 85 c2 rjmp .+1290 ; 0x21912 21408: 08 f4 brcc .+2 ; 0x2140c 2140a: 45 c2 rjmp .+1162 ; 0x21896 2140c: 82 30 cpi r24, 0x02 ; 2 2140e: 09 f4 brne .+2 ; 0x21412 21410: 6d c2 rjmp .+1242 ; 0x218ec 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 21412: 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) 21414: 83 30 cpi r24, 0x03 ; 3 21416: 09 f4 brne .+2 ; 0x2141a 21418: 42 c2 rjmp .+1156 ; 0x2189e menu_depth = 3; break; } } } } 2141a: df 91 pop r29 2141c: cf 91 pop r28 2141e: 1f 91 pop r17 21420: 0f 91 pop r16 21422: ff 90 pop r15 21424: ef 90 pop r14 21426: df 90 pop r13 21428: cf 90 pop r12 2142a: bf 90 pop r11 2142c: af 90 pop r10 2142e: 9f 90 pop r9 21430: 8f 90 pop r8 21432: 7f 90 pop r7 21434: 6f 90 pop r6 21436: 5f 90 pop r5 21438: 4f 90 pop r4 2143a: 3f 90 pop r3 2143c: 2f 90 pop r2 2143e: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 21440: 0e 94 93 6e call 0xdd26 ; 0xdd26 menu_depth = 0; 21444: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 menu_submenu(lcd_babystep_z, true); 21448: 61 e0 ldi r22, 0x01 ; 1 2144a: 88 e8 ldi r24, 0x88 ; 136 2144c: 9a e3 ldi r25, 0x3A ; 58 2144e: 0f 94 3b d3 call 0x3a676 ; 0x3a676 cmd_intro_mmu_9, cmd_intro_mmu_10, cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) 21452: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 21456: 81 30 cpi r24, 0x01 ; 1 21458: b9 f4 brne .+46 ; 0x21488 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 2145a: 80 91 f9 03 lds r24, 0x03F9 ; 0x8003f9 2145e: 10 e0 ldi r17, 0x00 ; 0 21460: 81 11 cpse r24, r1 21462: 01 c0 rjmp .+2 ; 0x21466 21464: 12 e0 ldi r17, 0x02 ; 2 21466: c1 2f mov r28, r17 21468: d0 e0 ldi r29, 0x00 ; 0 2146a: cc 0f add r28, r28 2146c: dd 1f adc r29, r29 2146e: ca 5c subi r28, 0xCA ; 202 21470: d5 47 sbci r29, 0x75 ; 117 { enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); 21472: fe 01 movw r30, r28 21474: 85 91 lpm r24, Z+ 21476: 94 91 lpm r25, Z 21478: 61 e0 ldi r22, 0x01 ; 1 2147a: 0e 94 a0 87 call 0x10f40 ; 0x10f40 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) 2147e: 1f 5f subi r17, 0xFF ; 255 21480: 22 96 adiw r28, 0x02 ; 2 21482: 19 30 cpi r17, 0x09 ; 9 21484: b1 f7 brne .-20 ; 0x21472 21486: b9 ce rjmp .-654 ; 0x211fa enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); } } else { enquecommand_P(feedrate_F1080); //fixed velocity for the intro line 21488: 61 e0 ldi r22, 0x01 ; 1 2148a: 8e e2 ldi r24, 0x2E ; 46 2148c: 9a e8 ldi r25, 0x8A ; 138 2148e: 0e 94 a0 87 call 0x10f40 ; 0x10f40 enquecommandf_P(extrude_fmt_X, 60.f, count_e(layer_height, extrusion_width * 4.f, 60)); 21492: 20 e0 ldi r18, 0x00 ; 0 21494: 30 e0 ldi r19, 0x00 ; 0 21496: 40 e8 ldi r20, 0x80 ; 128 21498: 50 e4 ldi r21, 0x40 ; 64 2149a: c5 01 movw r24, r10 2149c: b4 01 movw r22, r8 2149e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 214a2: 20 e0 ldi r18, 0x00 ; 0 214a4: 30 e0 ldi r19, 0x00 ; 0 214a6: 40 e7 ldi r20, 0x70 ; 112 214a8: 52 e4 ldi r21, 0x42 ; 66 214aa: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 214ae: 9f 93 push r25 214b0: 8f 93 push r24 214b2: 7f 93 push r23 214b4: 6f 93 push r22 214b6: 82 e4 ldi r24, 0x42 ; 66 214b8: 8f 93 push r24 214ba: 80 e7 ldi r24, 0x70 ; 112 214bc: 8f 93 push r24 214be: 1f 92 push r1 214c0: 1f 92 push r1 214c2: c1 e2 ldi r28, 0x21 ; 33 214c4: da e8 ldi r29, 0x8A ; 138 214c6: df 93 push r29 214c8: cf 93 push r28 214ca: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(extrude_fmt_X, 202.5f, count_e(layer_height, extrusion_width * 8.f, 142.5)); 214ce: 20 e0 ldi r18, 0x00 ; 0 214d0: 30 e0 ldi r19, 0x00 ; 0 214d2: 40 e0 ldi r20, 0x00 ; 0 214d4: 51 e4 ldi r21, 0x41 ; 65 214d6: c5 01 movw r24, r10 214d8: b4 01 movw r22, r8 214da: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 214de: 20 e0 ldi r18, 0x00 ; 0 214e0: 30 e8 ldi r19, 0x80 ; 128 214e2: 4e e0 ldi r20, 0x0E ; 14 214e4: 53 e4 ldi r21, 0x43 ; 67 214e6: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 214ea: 9f 93 push r25 214ec: 8f 93 push r24 214ee: 7f 93 push r23 214f0: 6f 93 push r22 214f2: 83 e4 ldi r24, 0x43 ; 67 214f4: 8f 93 push r24 214f6: 8a e4 ldi r24, 0x4A ; 74 214f8: 8f 93 push r24 214fa: 80 e8 ldi r24, 0x80 ; 128 214fc: 8f 93 push r24 214fe: 1f 92 push r1 21500: df 93 push r29 21502: cf 93 push r28 21504: 0e 94 3e 88 call 0x1107c ; 0x1107c 21508: 8d b7 in r24, 0x3d ; 61 2150a: 9e b7 in r25, 0x3e ; 62 2150c: 44 96 adiw r24, 0x14 ; 20 2150e: 0f b6 in r0, 0x3f ; 63 21510: f8 94 cli 21512: 9e bf out 0x3e, r25 ; 62 21514: 0f be out 0x3f, r0 ; 63 21516: 8d bf out 0x3d, r24 ; 61 21518: 70 ce rjmp .-800 ; 0x211fa 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]))); 2151a: 66 e0 ldi r22, 0x06 ; 6 2151c: 85 e1 ldi r24, 0x15 ; 21 2151e: 9a e8 ldi r25, 0x8A ; 138 21520: 3a ce rjmp .-908 ; 0x21196 //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { #ifndef NEW_FIRST_LAYER_CAL enquecommand_P(PSTR("G1X50Y155")); 21522: 61 e0 ldi r22, 0x01 ; 1 21524: 8b e0 ldi r24, 0x0B ; 11 21526: 9a e8 ldi r25, 0x8A ; 138 21528: 0e 94 a0 87 call 0x10f40 ; 0x10f40 #endif //_NEW_FIRST_LAYER_CAL static const char fmt1[] PROGMEM = "G1Z%.2f"; enquecommandf_P(fmt1, layer_height); 2152c: 8e e3 ldi r24, 0x3E ; 62 2152e: 8f 93 push r24 21530: 8c e4 ldi r24, 0x4C ; 76 21532: 8f 93 push r24 21534: 8c ec ldi r24, 0xCC ; 204 21536: 8f 93 push r24 21538: 8d ec ldi r24, 0xCD ; 205 2153a: 8f 93 push r24 2153c: 83 e0 ldi r24, 0x03 ; 3 2153e: 9a e8 ldi r25, 0x8A ; 138 21540: 9f 93 push r25 21542: 8f 93 push r24 21544: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommand_P(feedrate_F1080); 21548: 61 e0 ldi r22, 0x01 ; 1 2154a: 8e e2 ldi r24, 0x2E ; 46 2154c: 9a e8 ldi r25, 0x8A ; 138 2154e: 0e 94 a0 87 call 0x10f40 ; 0x10f40 enquecommand_P(MSG_G91); //enable relative XYZ 21552: 61 e0 ldi r22, 0x01 ; 1 21554: 83 e3 ldi r24, 0x33 ; 51 21556: 9b e6 ldi r25, 0x6B ; 107 21558: 0e 94 a0 87 call 0x10f40 ; 0x10f40 #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)); 2155c: 20 e0 ldi r18, 0x00 ; 0 2155e: 30 e0 ldi r19, 0x00 ; 0 21560: 40 e8 ldi r20, 0x80 ; 128 21562: 50 e4 ldi r21, 0x40 ; 64 21564: c5 01 movw r24, r10 21566: b4 01 movw r22, r8 21568: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2156c: 20 e0 ldi r18, 0x00 ; 0 2156e: 30 e0 ldi r19, 0x00 ; 0 21570: 48 ec ldi r20, 0xC8 ; 200 21572: 51 e4 ldi r21, 0x41 ; 65 21574: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 21578: 9f 93 push r25 2157a: 8f 93 push r24 2157c: 7f 93 push r23 2157e: 6f 93 push r22 21580: 01 e4 ldi r16, 0x41 ; 65 21582: 0f 93 push r16 21584: 18 ec ldi r17, 0xC8 ; 200 21586: 1f 93 push r17 21588: 1f 92 push r1 2158a: 1f 92 push r1 2158c: c1 e2 ldi r28, 0x21 ; 33 2158e: da e8 ldi r29, 0x8A ; 138 21590: df 93 push r29 21592: cf 93 push r28 21594: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 2.f, 25)); 21598: a5 01 movw r20, r10 2159a: 94 01 movw r18, r8 2159c: c5 01 movw r24, r10 2159e: b4 01 movw r22, r8 215a0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 215a4: 20 e0 ldi r18, 0x00 ; 0 215a6: 30 e0 ldi r19, 0x00 ; 0 215a8: 48 ec ldi r20, 0xC8 ; 200 215aa: 51 e4 ldi r21, 0x41 ; 65 215ac: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 215b0: 9f 93 push r25 215b2: 8f 93 push r24 215b4: 7f 93 push r23 215b6: 6f 93 push r22 215b8: 0f 93 push r16 215ba: 1f 93 push r17 215bc: 1f 92 push r1 215be: 1f 92 push r1 215c0: df 93 push r29 215c2: cf 93 push r28 215c4: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(extrude_fmt_X, 100.f*invert, count_e(layer_height, extrusion_width, 100)); 215c8: 20 e0 ldi r18, 0x00 ; 0 215ca: 30 e0 ldi r19, 0x00 ; 0 215cc: 48 ec ldi r20, 0xC8 ; 200 215ce: 52 e4 ldi r21, 0x42 ; 66 215d0: c5 01 movw r24, r10 215d2: b4 01 movw r22, r8 215d4: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 215d8: 9f 93 push r25 215da: 8f 93 push r24 215dc: 7f 93 push r23 215de: 6f 93 push r22 215e0: 82 e4 ldi r24, 0x42 ; 66 215e2: 8f 93 push r24 215e4: 1f 93 push r17 215e6: 1f 92 push r1 215e8: 1f 92 push r1 215ea: df 93 push r29 215ec: cf 93 push r28 215ee: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(extrude_fmt_Y, -20.f*invert, count_e(layer_height, extrusion_width, 20)); 215f2: 8d b7 in r24, 0x3d ; 61 215f4: 9e b7 in r25, 0x3e ; 62 215f6: 84 96 adiw r24, 0x24 ; 36 215f8: 0f b6 in r0, 0x3f ; 63 215fa: f8 94 cli 215fc: 9e bf out 0x3e, r25 ; 62 215fe: 0f be out 0x3f, r0 ; 63 21600: 8d bf out 0x3d, r24 ; 61 21602: 20 e0 ldi r18, 0x00 ; 0 21604: 30 e0 ldi r19, 0x00 ; 0 21606: 40 ea ldi r20, 0xA0 ; 160 21608: 51 e4 ldi r21, 0x41 ; 65 2160a: c5 01 movw r24, r10 2160c: b4 01 movw r22, r8 2160e: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 21612: 9f 93 push r25 21614: 8f 93 push r24 21616: 7f 93 push r23 21618: 6f 93 push r22 2161a: 81 ec ldi r24, 0xC1 ; 193 2161c: 8f 93 push r24 2161e: 80 ea ldi r24, 0xA0 ; 160 21620: 8f 93 push r24 21622: 1f 92 push r1 21624: 1f 92 push r1 21626: 86 ef ldi r24, 0xF6 ; 246 21628: 99 e8 ldi r25, 0x89 ; 137 2162a: 9f 93 push r25 2162c: 8f 93 push r24 2162e: 0e 94 3e 88 call 0x1107c ; 0x1107c 21632: 8d b7 in r24, 0x3d ; 61 21634: 9e b7 in r25, 0x3e ; 62 21636: 0a 96 adiw r24, 0x0a ; 10 21638: 0f b6 in r0, 0x3f ; 63 2163a: f8 94 cli 2163c: 9e bf out 0x3e, r25 ; 62 2163e: 0f be out 0x3f, r0 ; 63 21640: 8d bf out 0x3d, r24 ; 61 21642: db cd rjmp .-1098 ; 0x211fa //! @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); 21644: 20 e0 ldi r18, 0x00 ; 0 21646: 30 e0 ldi r19, 0x00 ; 0 21648: 46 e1 ldi r20, 0x16 ; 22 2164a: 53 e4 ldi r21, 0x43 ; 67 2164c: c5 01 movw r24, r10 2164e: b4 01 movw r22, r8 21650: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 21654: 76 2e mov r7, r22 21656: 67 2e mov r6, r23 21658: 58 2e mov r5, r24 2165a: 49 2e mov r4, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 2165c: 20 e0 ldi r18, 0x00 ; 0 2165e: 30 e0 ldi r19, 0x00 ; 0 21660: 40 ea ldi r20, 0xA0 ; 160 21662: 51 e4 ldi r21, 0x41 ; 65 21664: c5 01 movw r24, r10 21666: b4 01 movw r22, r8 21668: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 2166c: b6 2e mov r11, r22 2166e: a7 2e mov r10, r23 21670: 98 2e mov r9, r24 21672: 89 2e mov r8, r25 21674: c5 e0 ldi r28, 0x05 ; 5 for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 21676: df ef ldi r29, 0xFF ; 255 { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 21678: 21 e2 ldi r18, 0x21 ; 33 2167a: e2 2e mov r14, r18 2167c: 2a e8 ldi r18, 0x8A ; 138 2167e: f2 2e mov r15, r18 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 21680: 31 ec ldi r19, 0xC1 ; 193 21682: c3 2e mov r12, r19 21684: 40 ea ldi r20, 0xA0 ; 160 21686: d4 2e mov r13, r20 21688: 06 ef ldi r16, 0xF6 ; 246 2168a: 19 e8 ldi r17, 0x89 ; 137 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); 2168c: 4f 92 push r4 2168e: 5f 92 push r5 21690: 6f 92 push r6 21692: 7f 92 push r7 21694: 6d 2f mov r22, r29 21696: 0d 2e mov r0, r29 21698: 00 0c add r0, r0 2169a: 77 0b sbc r23, r23 2169c: 88 0b sbc r24, r24 2169e: 99 0b sbc r25, r25 216a0: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 216a4: 20 e0 ldi r18, 0x00 ; 0 216a6: 30 e0 ldi r19, 0x00 ; 0 216a8: 46 e1 ldi r20, 0x16 ; 22 216aa: 53 e4 ldi r21, 0x43 ; 67 216ac: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 216b0: 9f 93 push r25 216b2: 8f 93 push r24 216b4: 7f 93 push r23 216b6: 6f 93 push r22 216b8: ff 92 push r15 216ba: ef 92 push r14 216bc: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 216c0: 8f 92 push r8 216c2: 9f 92 push r9 216c4: af 92 push r10 216c6: bf 92 push r11 216c8: cf 92 push r12 216ca: df 92 push r13 216cc: 1f 92 push r1 216ce: 1f 92 push r1 216d0: 1f 93 push r17 216d2: 0f 93 push r16 216d4: 0e 94 3e 88 call 0x1107c ; 0x1107c 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) 216d8: d1 95 neg r29 216da: c1 50 subi r28, 0x01 ; 1 216dc: 8d b7 in r24, 0x3d ; 61 216de: 9e b7 in r25, 0x3e ; 62 216e0: 44 96 adiw r24, 0x14 ; 20 216e2: 0f b6 in r0, 0x3f ; 63 216e4: f8 94 cli 216e6: 9e bf out 0x3e, r25 ; 62 216e8: 0f be out 0x3f, r0 ; 63 216ea: 8d bf out 0x3d, r24 ; 61 216ec: c1 11 cpse r28, r1 216ee: ce cf rjmp .-100 ; 0x2168c 216f0: 84 cd rjmp .-1272 ; 0x211fa //! @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); 216f2: 23 e4 ldi r18, 0x43 ; 67 216f4: 3d ec ldi r19, 0xCD ; 205 216f6: 4f e2 ldi r20, 0x2F ; 47 216f8: 5d e3 ldi r21, 0x3D ; 61 216fa: c5 01 movw r24, r10 216fc: b4 01 movw r22, r8 216fe: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 21702: 6b 01 movw r12, r22 21704: 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); 21706: 20 e0 ldi r18, 0x00 ; 0 21708: 30 e0 ldi r19, 0x00 ; 0 2170a: 40 ea ldi r20, 0xA0 ; 160 2170c: 51 e4 ldi r21, 0x41 ; 65 2170e: c5 01 movw r24, r10 21710: b4 01 movw r22, r8 21712: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 21716: 66 2e mov r6, r22 21718: 57 2e mov r5, r23 2171a: 48 2e mov r4, r24 2171c: 39 2e mov r3, r25 const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); 2171e: a7 01 movw r20, r14 21720: 96 01 movw r18, r12 21722: c5 01 movw r24, r10 21724: b4 01 movw r22, r8 21726: 0f 94 fc 87 call 0x30ff8 ; 0x30ff8 2172a: 26 2e mov r2, r22 2172c: a7 2e mov r10, r23 2172e: 98 2e mov r9, r24 21730: 89 2e mov r8, r25 21732: 84 e0 ldi r24, 0x04 ; 4 21734: b8 2e mov r11, r24 for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 21736: 90 ea ldi r25, 0xA0 ; 160 21738: 79 2e mov r7, r25 2173a: 01 e2 ldi r16, 0x21 ; 33 2173c: 1a e8 ldi r17, 0x8A ; 138 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 2173e: f7 fa bst r15, 7 21740: f0 94 com r15 21742: f7 f8 bld r15, 7 21744: f0 94 com r15 21746: c6 ef ldi r28, 0xF6 ; 246 21748: d9 e8 ldi r29, 0x89 ; 137 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); 2174a: 3f 92 push r3 2174c: 4f 92 push r4 2174e: 5f 92 push r5 21750: 6f 92 push r6 21752: 91 e4 ldi r25, 0x41 ; 65 21754: 9f 93 push r25 21756: 7f 92 push r7 21758: 1f 92 push r1 2175a: 1f 92 push r1 2175c: 1f 93 push r17 2175e: 0f 93 push r16 21760: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 21764: 8f 92 push r8 21766: 9f 92 push r9 21768: af 92 push r10 2176a: 2f 92 push r2 2176c: ff 92 push r15 2176e: ef 92 push r14 21770: df 92 push r13 21772: cf 92 push r12 21774: df 93 push r29 21776: cf 93 push r28 21778: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(extrude_fmt_X, -square_width*invert, long_extrusion); 2177c: 3f 92 push r3 2177e: 4f 92 push r4 21780: 5f 92 push r5 21782: 6f 92 push r6 21784: 81 ec ldi r24, 0xC1 ; 193 21786: 8f 93 push r24 21788: 7f 92 push r7 2178a: 1f 92 push r1 2178c: 1f 92 push r1 2178e: 1f 93 push r17 21790: 0f 93 push r16 21792: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 21796: 8f 92 push r8 21798: 9f 92 push r9 2179a: af 92 push r10 2179c: 2f 92 push r2 2179e: ff 92 push r15 217a0: ef 92 push r14 217a2: df 92 push r13 217a4: cf 92 push r12 217a6: df 93 push r29 217a8: cf 93 push r28 217aa: 0e 94 3e 88 call 0x1107c ; 0x1107c 217ae: 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++) 217b0: 8d b7 in r24, 0x3d ; 61 217b2: 9e b7 in r25, 0x3e ; 62 217b4: 88 96 adiw r24, 0x28 ; 40 217b6: 0f b6 in r0, 0x3f ; 63 217b8: f8 94 cli 217ba: 9e bf out 0x3e, r25 ; 62 217bc: 0f be out 0x3f, r0 ; 63 217be: 8d bf out 0x3d, r24 ; 61 217c0: b1 10 cpse r11, r1 217c2: c3 cf rjmp .-122 ; 0x2174a 217c4: 1a cd rjmp .-1484 ; 0x211fa 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]))); 217c6: 69 e0 ldi r22, 0x09 ; 9 217c8: 84 ee ldi r24, 0xE4 ; 228 217ca: 99 e8 ldi r25, 0x89 ; 137 217cc: e4 cc rjmp .-1592 ; 0x21196 break; case 2: lay1cal_finish(); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 217ce: 8f ec ldi r24, 0xCF ; 207 217d0: 9f e6 ldi r25, 0x6F ; 111 217d2: 0e 94 3b f2 call 0x1e476 ; 0x1e476 lcd_commands_step = 0; 217d6: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 217da: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 217de: 82 e0 ldi r24, 0x02 ; 2 217e0: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 217e4: 8f e5 ldi r24, 0x5F ; 95 217e6: 9f e0 ldi r25, 0x0F ; 15 217e8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 217ec: 88 23 and r24, r24 217ee: 09 f4 brne .+2 ; 0x217f2 217f0: db cd rjmp .-1098 ; 0x213a8 lcd_wizard(WizState::RepeatLay1Cal); 217f2: 8c e0 ldi r24, 0x0C ; 12 217f4: 0e 94 d9 f9 call 0x1f3b2 ; 0x1f3b2 217f8: 00 cd rjmp .-1536 ; 0x211fa 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."); 217fa: 82 ea ldi r24, 0xA2 ; 162 217fc: 9a e8 ldi r25, 0x8A ; 138 217fe: 0e 94 d0 76 call 0xeda0 ; 0xeda0 21802: ac cd rjmp .-1192 ; 0x2135c } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 21804: 84 30 cpi r24, 0x04 ; 4 21806: a9 f0 breq .+42 ; 0x21832 21808: c0 f0 brcs .+48 ; 0x2183a 2180a: 85 30 cpi r24, 0x05 ; 5 2180c: 09 f0 breq .+2 ; 0x21810 2180e: e3 cd rjmp .-1082 ; 0x213d6 case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 21810: 61 e0 ldi r22, 0x01 ; 1 21812: 80 e4 ldi r24, 0x40 ; 64 21814: 9b e6 ldi r25, 0x6B ; 107 21816: 0e 94 a0 87 call 0x10f40 ; 0x10f40 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 2181a: 61 e0 ldi r22, 0x01 ; 1 2181c: 8c e8 ldi r24, 0x8C ; 140 2181e: 9a e8 ldi r25, 0x8A ; 138 21820: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_commands_step = 4; 21824: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 21826: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb 2182a: d5 cd rjmp .-1110 ; 0x213d6 if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 2182c: 90 93 fb 03 sts 0x03FB, r25 ; 0x8003fb 21830: ef cf rjmp .-34 ; 0x21810 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 21832: 0f 94 ed 43 call 0x287da ; 0x287da lcd_commands_step = 3; 21836: 83 e0 ldi r24, 0x03 ; 3 21838: f6 cf rjmp .-20 ; 0x21826 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 2183a: 10 92 3d 02 sts 0x023D, r1 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.457> break; case 3: thermal_model_set_warn_beep(false); enquecommand_P(PSTR("M310 A F1")); 2183e: 61 e0 ldi r22, 0x01 ; 1 21840: 82 e8 ldi r24, 0x82 ; 130 21842: 9a e8 ldi r25, 0x8A ; 138 21844: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_commands_step = 2; 21848: 82 e0 ldi r24, 0x02 ; 2 2184a: ed cf rjmp .-38 ; 0x21826 break; case 2: if (thermal_model_autotune_result()) 2184c: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.538> 21850: 81 11 cpse r24, r1 21852: 05 c0 rjmp .+10 ; 0x2185e enquecommand_P(MSG_M500); 21854: 61 e0 ldi r22, 0x01 ; 1 21856: 86 e4 ldi r24, 0x46 ; 70 21858: 9b e6 ldi r25, 0x6B ; 107 2185a: 0e 94 a0 87 call 0x10f40 ; 0x10f40 lcd_commands_step = 1; 2185e: 81 e0 ldi r24, 0x01 ; 1 21860: e2 cf rjmp .-60 ; 0x21826 break; case 1: lcd_commands_step = 0; 21862: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 21866: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 2186a: 92 e0 ldi r25, 0x02 ; 2 2186c: 90 93 b8 0d sts 0x0DB8, r25 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 21870: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.457> SetPrinterState(PrinterState::Idle); thermal_model_set_warn_beep(true); bool res = thermal_model_autotune_result(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 21874: 8f e5 ldi r24, 0x5F ; 95 21876: 9f e0 ldi r25, 0x0F ; 15 21878: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2187c: 88 23 and r24, r24 2187e: 09 f4 brne .+2 ; 0x21882 21880: cc cd rjmp .-1128 ; 0x2141a // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 21882: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.538> 21886: 81 11 cpse r24, r1 21888: 04 c0 rjmp .+8 ; 0x21892 2188a: 81 e0 ldi r24, 0x01 ; 1 2188c: 0e 94 d9 f9 call 0x1f3b2 ; 0x1f3b2 21890: a2 cd rjmp .-1212 ; 0x213d6 21892: 8e e0 ldi r24, 0x0E ; 14 21894: fb cf rjmp .-10 ; 0x2188c #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 21896: 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; 21898: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb 2189c: be cd rjmp .-1156 ; 0x2141a #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 2189e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 218a2: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 218a6: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 218aa: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 218ae: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 218b2: 69 32 cpi r22, 0x29 ; 41 218b4: 71 05 cpc r23, r1 218b6: 74 f0 brlt .+28 ; 0x218d4 fanSpeed = 255; //turn on fan 218b8: c0 93 e7 03 sts 0x03E7, r28 ; 0x8003e7 disable_heater(); 218bc: 0f 94 1d 30 call 0x2603a ; 0x2603a uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_COOLDOWN), true, LCD_LEFT_BUTTON_CHOICE); 218c0: 8f e7 ldi r24, 0x7F ; 127 218c2: 99 e4 ldi r25, 0x49 ; 73 218c4: 0e 94 2c 72 call 0xe458 ; 0xe458 218c8: 40 e0 ldi r20, 0x00 ; 0 218ca: 61 e0 ldi r22, 0x01 ; 1 218cc: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 218d0: 81 30 cpi r24, 0x01 ; 1 218d2: 29 f7 brne .-54 ; 0x2189e break; } } enquecommand_P(G28W); //home 218d4: 61 e0 ldi r22, 0x01 ; 1 218d6: 80 e4 ldi r24, 0x40 ; 64 218d8: 9b e6 ldi r25, 0x6B ; 107 218da: 0e 94 a0 87 call 0x10f40 ; 0x10f40 enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center 218de: 61 e0 ldi r22, 0x01 ; 1 218e0: 8f e6 ldi r24, 0x6F ; 111 218e2: 9a e8 ldi r25, 0x8A ; 138 218e4: 0e 94 a0 87 call 0x10f40 ; 0x10f40 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 218e8: 82 e0 ldi r24, 0x02 ; 2 218ea: d6 cf rjmp .-84 ; 0x21898 break; case 2: enquecommand_P(PSTR("M84 XY")); 218ec: 61 e0 ldi r22, 0x01 ; 1 218ee: 88 e6 ldi r24, 0x68 ; 104 218f0: 9a e8 ldi r25, 0x8A ; 138 218f2: 0e 94 a0 87 call 0x10f40 ; 0x10f40 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 218f6: 8d e6 ldi r24, 0x6D ; 109 218f8: 99 e4 ldi r25, 0x49 ; 73 218fa: 0e 94 2c 72 call 0xe458 ; 0xe458 218fe: 41 e0 ldi r20, 0x01 ; 1 21900: 60 e0 ldi r22, 0x00 ; 0 21902: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc 21906: 81 11 cpse r24, r1 21908: 88 cd rjmp .-1264 ; 0x2141a setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan 2190a: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 2190e: 81 e0 ldi r24, 0x01 ; 1 21910: c3 cf rjmp .-122 ; 0x21898 } break; case 1: lcd_commands_step = 0; 21912: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 21916: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 2191a: 82 e0 ldi r24, 0x02 ; 2 2191c: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 21920: 20 e0 ldi r18, 0x00 ; 0 21922: 41 e0 ldi r20, 0x01 ; 1 21924: 62 e0 ldi r22, 0x02 ; 2 21926: 70 e0 ldi r23, 0x00 ; 0 21928: 89 e9 ldi r24, 0x99 ; 153 2192a: 92 ed ldi r25, 0xD2 ; 210 2192c: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 menu_depth = 3; 21930: 83 e0 ldi r24, 0x03 ; 3 21932: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 21936: 71 cd rjmp .-1310 ; 0x2141a 00021938 : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 21938: 0f 93 push r16 2193a: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 2193c: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 21940: 80 95 com r24 21942: 81 70 andi r24, 0x01 ; 1 21944: 90 91 12 04 lds r25, 0x0412 ; 0x800412 21948: 89 17 cp r24, r25 2194a: a1 f1 breq .+104 ; 0x219b4 { if(menu_menu == lcd_sdcard_menu) { 2194c: 80 91 13 04 lds r24, 0x0413 ; 0x800413 21950: 90 91 14 04 lds r25, 0x0414 ; 0x800414 21954: 8c 54 subi r24, 0x4C ; 76 21956: 92 4f sbci r25, 0xF2 ; 242 21958: 11 f4 brne .+4 ; 0x2195e // 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(); 2195a: 0f 94 96 d4 call 0x3a92c ; 0x3a92c } lcd_draw_update = 2; 2195e: 82 e0 ldi r24, 0x02 ; 2 21960: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 21964: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 21968: 80 95 com r24 2196a: 81 70 andi r24, 0x01 ; 1 2196c: 80 93 12 04 sts 0x0412, r24 ; 0x800412 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 21970: 0e 94 0c 6f call 0xde18 ; 0xde18 backlight_wake(); 21974: 80 e0 ldi r24, 0x00 ; 0 21976: 0e 94 f5 89 call 0x113ea ; 0x113ea if (lcd_oldcardstatus) 2197a: 80 91 12 04 lds r24, 0x0412 ; 0x800412 2197e: 88 23 and r24, r24 21980: 09 f4 brne .+2 ; 0x21984 21982: 71 c0 rjmp .+226 ; 0x21a66 { if (!card.mounted) 21984: 80 91 91 14 lds r24, 0x1491 ; 0x801491 21988: 81 11 cpse r24, r1 2198a: 05 c0 rjmp .+10 ; 0x21996 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 2198c: 0f 94 fd 81 call 0x303fa ; 0x303fa card.presort_flag = true; //force sorting of the SD menu 21990: 81 e0 ldi r24, 0x01 ; 1 21992: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df } LCD_MESSAGERPGM(MSG_WELCOME); 21996: 8f ec ldi r24, 0xCF ; 207 21998: 9f e6 ldi r25, 0x6F ; 111 2199a: 0e 94 3b f2 call 0x1e476 ; 0x1e476 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 2199e: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 menu_submenu(lcd_sdcard_menu, true); 219a2: 61 e0 ldi r22, 0x01 ; 1 219a4: 8c e4 ldi r24, 0x4C ; 76 219a6: 92 ef ldi r25, 0xF2 ; 242 219a8: 0f 94 3b d3 call 0x3a676 ; 0x3a676 lcd_timeoutToStatus.start(); 219ac: 8c ed ldi r24, 0xDC ; 220 219ae: 93 e0 ldi r25, 0x03 ; 3 219b0: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 219b4: 0f 94 51 2a call 0x254a2 ; 0x254a2 219b8: 00 91 d8 03 lds r16, 0x03D8 ; 0x8003d8 219bc: 10 91 d9 03 lds r17, 0x03D9 ; 0x8003d9 219c0: 20 91 da 03 lds r18, 0x03DA ; 0x8003da 219c4: 30 91 db 03 lds r19, 0x03DB ; 0x8003db 219c8: 06 17 cp r16, r22 219ca: 17 07 cpc r17, r23 219cc: 28 07 cpc r18, r24 219ce: 39 07 cpc r19, r25 219d0: e8 f5 brcc .+122 ; 0x21a4c { if (lcd_draw_update) { 219d2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 219d6: 88 23 and r24, r24 219d8: 31 f0 breq .+12 ; 0x219e6 lcd_timeoutToStatus.start(); 219da: 8c ed ldi r24, 0xDC ; 220 219dc: 93 e0 ldi r25, 0x03 ; 3 219de: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> lcd_frame_start(); 219e2: 0e 94 14 6e call 0xdc28 ; 0xdc28 } (*menu_menu)(); 219e6: e0 91 13 04 lds r30, 0x0413 ; 0x800413 219ea: f0 91 14 04 lds r31, 0x0414 ; 0x800414 219ee: 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)))); 219f0: 80 91 13 04 lds r24, 0x0413 ; 0x800413 219f4: 90 91 14 04 lds r25, 0x0414 ; 0x800414 219f8: 88 58 subi r24, 0x88 ; 136 219fa: 9a 43 sbci r25, 0x3A ; 58 219fc: 09 f4 brne .+2 ; 0x21a00 219fe: 46 c0 rjmp .+140 ; 0x21a8c } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 21a00: 80 91 13 04 lds r24, 0x0413 ; 0x800413 21a04: 90 91 14 04 lds r25, 0x0414 ; 0x800414 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 21a08: 2a e3 ldi r18, 0x3A ; 58 21a0a: 86 32 cpi r24, 0x26 ; 38 21a0c: 92 07 cpc r25, r18 21a0e: 09 f0 breq .+2 ; 0x21a12 21a10: 5e c0 rjmp .+188 ; 0x21ace } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 21a12: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 21a16: 82 30 cpi r24, 0x02 ; 2 21a18: 21 f4 brne .+8 ; 0x21a22 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 21a1a: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_status_message_idx = 0; // Re-draw message from beginning 21a1e: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.450> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 21a22: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 21a26: 88 23 and r24, r24 21a28: 19 f0 breq .+6 ; 0x21a30 21a2a: 81 50 subi r24, 0x01 ; 1 21a2c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 21a30: 0f 94 51 2a call 0x254a2 ; 0x254a2 21a34: 6c 59 subi r22, 0x9C ; 156 21a36: 7f 4f sbci r23, 0xFF ; 255 21a38: 8f 4f sbci r24, 0xFF ; 255 21a3a: 9f 4f sbci r25, 0xFF ; 255 21a3c: 60 93 d8 03 sts 0x03D8, r22 ; 0x8003d8 21a40: 70 93 d9 03 sts 0x03D9, r23 ; 0x8003d9 21a44: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da 21a48: 90 93 db 03 sts 0x03DB, r25 ; 0x8003db } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 21a4c: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 21a50: 84 30 cpi r24, 0x04 ; 4 21a52: 09 f0 breq .+2 ; 0x21a56 21a54: 53 c0 rjmp .+166 ; 0x21afc 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) { 21a56: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 21a5a: 81 11 cpse r24, r1 21a5c: 4f c0 rjmp .+158 ; 0x21afc 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(); } 21a5e: 1f 91 pop r17 21a60: 0f 91 pop r16 21a62: 0d 94 6a 07 jmp 0x20ed4 ; 0x20ed4 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 21a66: 10 92 90 14 sts 0x1490, r1 ; 0x801490 mounted = false; 21a6a: 10 92 91 14 sts 0x1491, r1 ; 0x801491 SERIAL_ECHO_START; 21a6e: 82 ec ldi r24, 0xC2 ; 194 21a70: 9a ea ldi r25, 0xAA ; 170 21a72: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 21a76: 84 ef ldi r24, 0xF4 ; 244 21a78: 9a e6 ldi r25, 0x6A ; 106 21a7a: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 21a7e: 80 e4 ldi r24, 0x40 ; 64 21a80: 99 e4 ldi r25, 0x49 ; 73 21a82: 0e 94 2c 72 call 0xe458 ; 0xe458 21a86: 0e 94 3b f2 call 0x1e476 ; 0x1e476 21a8a: 94 cf rjmp .-216 ; 0x219b4 // 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)))); 21a8c: 0e 94 1f 67 call 0xce3e ; 0xce3e 21a90: 81 11 cpse r24, r1 21a92: 0e c0 rjmp .+28 ; 0x21ab0 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) 21a94: e0 91 13 04 lds r30, 0x0413 ; 0x800413 21a98: f0 91 14 04 lds r31, 0x0414 ; 0x800414 21a9c: 30 97 sbiw r30, 0x00 ; 0 21a9e: 39 f5 brne .+78 ; 0x21aee { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 21aa0: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_return_to_status(); 21aa4: 0f 94 ab 1f call 0x23f56 ; 0x23f56 lcd_draw_update = 2; 21aa8: 82 e0 ldi r24, 0x02 ; 2 21aaa: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 21aae: b1 cf rjmp .-158 ; 0x21a12 // 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)))); 21ab0: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 21ab4: 81 11 cpse r24, r1 21ab6: a4 cf rjmp .-184 ; 0x21a00 21ab8: 40 e9 ldi r20, 0x90 ; 144 21aba: 5f e5 ldi r21, 0x5F ; 95 21abc: 61 e0 ldi r22, 0x01 ; 1 21abe: 70 e0 ldi r23, 0x00 ; 0 21ac0: 8c ed ldi r24, 0xDC ; 220 21ac2: 93 e0 ldi r25, 0x03 ; 3 21ac4: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 21ac8: 81 11 cpse r24, r1 21aca: e4 cf rjmp .-56 ; 0x21a94 21acc: 99 cf rjmp .-206 ; 0x21a00 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 21ace: 88 58 subi r24, 0x88 ; 136 21ad0: 9a 43 sbci r25, 0x3A ; 58 21ad2: 09 f4 brne .+2 ; 0x21ad6 21ad4: 9e cf rjmp .-196 ; 0x21a12 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 21ad6: 40 e3 ldi r20, 0x30 ; 48 21ad8: 55 e7 ldi r21, 0x75 ; 117 21ada: 60 e0 ldi r22, 0x00 ; 0 21adc: 70 e0 ldi r23, 0x00 ; 0 21ade: 8c ed ldi r24, 0xDC ; 220 21ae0: 93 e0 ldi r25, 0x03 ; 3 21ae2: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 21ae6: 88 23 and r24, r24 21ae8: 09 f4 brne .+2 ; 0x21aec 21aea: 93 cf rjmp .-218 ; 0x21a12 21aec: d3 cf rjmp .-90 ; 0x21a94 // 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; 21aee: 81 e0 ldi r24, 0x01 ; 1 21af0: 80 93 d7 03 sts 0x03D7, r24 ; 0x8003d7 (*menu_menu)(); 21af4: 19 95 eicall menu_leaving = 0; 21af6: 10 92 d7 03 sts 0x03D7, r1 ; 0x8003d7 21afa: d2 cf rjmp .-92 ; 0x21aa0 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(); } 21afc: 1f 91 pop r17 21afe: 0f 91 pop r16 21b00: 08 95 ret 00021b02 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 21b02: 8f e1 ldi r24, 0x1F ; 31 21b04: 0e 94 7d ef call 0x1defa ; 0x1defa 21b08: 81 11 cpse r24, r1 21b0a: 06 c0 rjmp .+12 ; 0x21b18 // 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); 21b0c: 8f e1 ldi r24, 0x1F ; 31 21b0e: 0e 94 1b ef call 0x1de36 ; 0x1de36 lcd_wizard(WizState::Run); 21b12: 80 e0 ldi r24, 0x00 ; 0 21b14: 0c 94 d9 f9 jmp 0x1f3b2 ; 0x1f3b2 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); 21b18: 88 e7 ldi r24, 0x78 ; 120 21b1a: 9b e3 ldi r25, 0x3B ; 59 21b1c: 0e 94 2c 72 call 0xe458 ; 0xe458 21b20: 41 e0 ldi r20, 0x01 ; 1 21b22: 60 e0 ldi r22, 0x00 ; 0 21b24: 0f 94 45 50 call 0x2a08a ; 0x2a08a } if (result) { 21b28: 88 23 and r24, r24 21b2a: 81 f3 breq .-32 ; 0x21b0c calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 21b2c: 0f 94 ab 1f call 0x23f56 ; 0x23f56 lcd_update_enable(true); 21b30: 81 e0 ldi r24, 0x01 ; 1 21b32: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_update(2); 21b36: 82 e0 ldi r24, 0x02 ; 2 21b38: 0c 94 27 6e jmp 0xdc4e ; 0xdc4e 00021b3c : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 21b3c: cf 93 push r28 21b3e: 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); 21b40: 83 e6 ldi r24, 0x63 ; 99 21b42: 9e e3 ldi r25, 0x3E ; 62 21b44: 0e 94 2c 72 call 0xe458 ; 0xe458 21b48: 41 e0 ldi r20, 0x01 ; 1 21b4a: 4c 27 eor r20, r28 21b4c: 60 e0 ldi r22, 0x00 ; 0 21b4e: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc 21b52: 91 e0 ldi r25, 0x01 ; 1 21b54: 81 11 cpse r24, r1 21b56: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 21b58: c9 17 cp r28, r25 21b5a: 59 f0 breq .+22 ; 0x21b72 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 21b5c: 89 e3 ldi r24, 0x39 ; 57 21b5e: 9e e3 ldi r25, 0x3E ; 62 21b60: cc 23 and r28, r28 21b62: 11 f0 breq .+4 ; 0x21b68 21b64: 8b e5 ldi r24, 0x5B ; 91 21b66: 99 e5 ldi r25, 0x59 ; 89 21b68: 0e 94 2c 72 call 0xe458 ; 0xe458 } #endif //STEEL_SHEET } 21b6c: 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)); 21b6e: 0d 94 f6 20 jmp 0x241ec ; 0x241ec } #endif //STEEL_SHEET } 21b72: cf 91 pop r28 21b74: 08 95 ret 00021b76 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 21b76: cf 93 push r28 21b78: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 21b7a: 80 e1 ldi r24, 0x10 ; 16 21b7c: 9e e3 ldi r25, 0x3E ; 62 21b7e: 0e 94 2c 72 call 0xe458 ; 0xe458 21b82: 40 e0 ldi r20, 0x00 ; 0 21b84: 6c 2f mov r22, r28 21b86: 0f 94 6e 50 call 0x2a0dc ; 0x2a0dc if (result == LCD_LEFT_BUTTON_CHOICE) { 21b8a: 81 11 cpse r24, r1 21b8c: 03 c0 rjmp .+6 ; 0x21b94 lcd_mesh_calibration_z(); } } 21b8e: 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(); 21b90: 0c 94 74 cf jmp 0x19ee8 ; 0x19ee8 } } 21b94: cf 91 pop r28 21b96: 08 95 ret 00021b98 : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 21b98: bf 92 push r11 21b9a: cf 92 push r12 21b9c: df 92 push r13 21b9e: ef 92 push r14 21ba0: ff 92 push r15 21ba2: 0f 93 push r16 21ba4: 1f 93 push r17 21ba6: cf 93 push r28 21ba8: df 93 push r29 21baa: 00 d0 rcall .+0 ; 0x21bac 21bac: 1f 92 push r1 21bae: cd b7 in r28, 0x3d ; 61 21bb0: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 21bb2: 8c ea ldi r24, 0xAC ; 172 21bb4: 9d e0 ldi r25, 0x0D ; 13 21bb6: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 21bba: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 21bbc: 8b ea ldi r24, 0xAB ; 171 21bbe: 9d e0 ldi r25, 0x0D ; 13 21bc0: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 21bc4: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 21bc6: 8a ea ldi r24, 0xAA ; 170 21bc8: 9d e0 ldi r25, 0x0D ; 13 21bca: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 21bce: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 21bd0: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 21bd4: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 21bd8: 80 e3 ldi r24, 0x30 ; 48 21bda: d8 2e mov r13, r24 21bdc: df 0c add r13, r15 sToggle[1] = 'x'; 21bde: 98 e7 ldi r25, 0x78 ; 120 21be0: 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'; 21be2: 20 e3 ldi r18, 0x30 ; 48 21be4: e2 2e mov r14, r18 21be6: 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(); 21be8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 21bec: 84 30 cpi r24, 0x04 ; 4 21bee: 08 f0 brcs .+2 ; 0x21bf2 21bf0: 56 c0 rjmp .+172 ; 0x21c9e 21bf2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 21bf6: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 21bfa: 88 23 and r24, r24 21bfc: 31 f0 breq .+12 ; 0x21c0a 21bfe: 87 e0 ldi r24, 0x07 ; 7 21c00: f8 12 cpse r15, r24 21c02: 03 c0 rjmp .+6 ; 0x21c0a 21c04: 81 e0 ldi r24, 0x01 ; 1 21c06: 0f 94 bb 0d call 0x21b76 ; 0x21b76 // 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)); 21c0a: 8a ee ldi r24, 0xEA ; 234 21c0c: 97 e4 ldi r25, 0x47 ; 71 21c0e: 0e 94 2c 72 call 0xe458 ; 0xe458 21c12: 0f 94 99 d4 call 0x3a932 ; 0x3a932 sToggle[0] = points_nr + '0'; 21c16: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 21c18: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 21c1a: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 21c1c: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 21c1e: 8e e9 ldi r24, 0x9E ; 158 21c20: 97 e4 ldi r25, 0x47 ; 71 21c22: 0e 94 2c 72 call 0xe458 ; 0xe458 21c26: 20 e0 ldi r18, 0x00 ; 0 21c28: 4d e3 ldi r20, 0x3D ; 61 21c2a: 50 ed ldi r21, 0xD0 ; 208 21c2c: be 01 movw r22, r28 21c2e: 6f 5f subi r22, 0xFF ; 255 21c30: 7f 4f sbci r23, 0xFF ; 255 21c32: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba sToggle[0] = mbl_z_probe_nr + '0'; 21c36: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 21c38: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 21c3a: 80 e9 ldi r24, 0x90 ; 144 21c3c: 97 e4 ldi r25, 0x47 ; 71 21c3e: 0e 94 2c 72 call 0xe458 ; 0xe458 21c42: 20 e0 ldi r18, 0x00 ; 0 21c44: 4e e2 ldi r20, 0x2E ; 46 21c46: 50 ed ldi r21, 0xD0 ; 208 21c48: be 01 movw r22, r28 21c4a: 6f 5f subi r22, 0xFF ; 255 21c4c: 7f 4f sbci r23, 0xFF ; 255 21c4e: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba 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); 21c52: 87 e0 ldi r24, 0x07 ; 7 21c54: f8 12 cpse r15, r24 21c56: 20 c0 rjmp .+64 ; 0x21c98 21c58: 87 e1 ldi r24, 0x17 ; 23 21c5a: 9c e5 ldi r25, 0x5C ; 92 21c5c: c1 10 cpse r12, r1 21c5e: 02 c0 rjmp .+4 ; 0x21c64 21c60: 81 e1 ldi r24, 0x11 ; 17 21c62: 9c e5 ldi r25, 0x5C ; 92 21c64: 0e 94 2c 72 call 0xe458 ; 0xe458 21c68: 8c 01 movw r16, r24 21c6a: 8a e7 ldi r24, 0x7A ; 122 21c6c: 97 e4 ldi r25, 0x47 ; 71 21c6e: 0e 94 2c 72 call 0xe458 ; 0xe458 21c72: 22 e0 ldi r18, 0x02 ; 2 21c74: 49 e4 ldi r20, 0x49 ; 73 21c76: 50 ed ldi r21, 0xD0 ; 208 21c78: b8 01 movw r22, r16 21c7a: 0f 94 5d d3 call 0x3a6ba ; 0x3a6ba MENU_END(); 21c7e: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 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(); 21c82: 90 91 12 05 lds r25, 0x0512 ; 0x800512 21c86: 9f 5f subi r25, 0xFF ; 255 21c88: 90 93 12 05 sts 0x0512, r25 ; 0x800512 21c8c: 90 91 14 05 lds r25, 0x0514 ; 0x800514 21c90: 9f 5f subi r25, 0xFF ; 255 21c92: 90 93 14 05 sts 0x0514, r25 ; 0x800514 21c96: a8 cf rjmp .-176 ; 0x21be8 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); 21c98: 8a e8 ldi r24, 0x8A ; 138 21c9a: 97 e4 ldi r25, 0x47 ; 71 21c9c: e3 cf rjmp .-58 ; 0x21c64 MENU_END(); } 21c9e: 0f 90 pop r0 21ca0: 0f 90 pop r0 21ca2: 0f 90 pop r0 21ca4: 0f 90 pop r0 21ca6: df 91 pop r29 21ca8: cf 91 pop r28 21caa: 1f 91 pop r17 21cac: 0f 91 pop r16 21cae: ff 90 pop r15 21cb0: ef 90 pop r14 21cb2: df 90 pop r13 21cb4: cf 90 pop r12 21cb6: bf 90 pop r11 21cb8: 08 95 ret 00021cba : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 21cba: 2f 92 push r2 21cbc: 3f 92 push r3 21cbe: 4f 92 push r4 21cc0: 5f 92 push r5 21cc2: 6f 92 push r6 21cc4: 7f 92 push r7 21cc6: 8f 92 push r8 21cc8: 9f 92 push r9 21cca: af 92 push r10 21ccc: bf 92 push r11 21cce: cf 92 push r12 21cd0: df 92 push r13 21cd2: ef 92 push r14 21cd4: ff 92 push r15 21cd6: 0f 93 push r16 21cd8: 1f 93 push r17 21cda: cf 93 push r28 21cdc: df 93 push r29 21cde: cd b7 in r28, 0x3d ; 61 21ce0: de b7 in r29, 0x3e ; 62 21ce2: 67 97 sbiw r28, 0x17 ; 23 21ce4: 0f b6 in r0, 0x3f ; 63 21ce6: f8 94 cli 21ce8: de bf out 0x3e, r29 ; 62 21cea: 0f be out 0x3f, r0 ; 63 21cec: cd bf out 0x3d, r28 ; 61 21cee: 08 2f mov r16, r24 21cf0: ce 01 movw r24, r28 21cf2: 46 96 adiw r24, 0x16 ; 22 21cf4: 9f 8b std Y+23, r25 ; 0x17 21cf6: 8e 8b std Y+22, r24 ; 0x16 21cf8: 83 e0 ldi r24, 0x03 ; 3 21cfa: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 21cfc: 95 e1 ldi r25, 0x15 ; 21 21cfe: 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 21d00: 0f 94 e7 c5 call 0x38bce ; 0x38bce tool_change_extruder = slot; 21d04: 00 93 a2 13 sts 0x13A2, r16 ; 0x8013a2 state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 21d08: 40 2f mov r20, r16 21d0a: 64 e5 ldi r22, 0x54 ; 84 21d0c: ce 01 movw r24, r28 21d0e: 01 96 adiw r24, 0x01 ; 1 21d10: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 21d14: 49 81 ldd r20, Y+1 ; 0x01 21d16: 5a 81 ldd r21, Y+2 ; 0x02 21d18: 6b 81 ldd r22, Y+3 ; 0x03 21d1a: 7c 81 ldd r23, Y+4 ; 0x04 21d1c: 8d 81 ldd r24, Y+5 ; 0x05 21d1e: 0f 94 8a a5 call 0x34b14 ; 0x34b14 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 21d22: 61 e0 ldi r22, 0x01 ; 1 21d24: 81 e0 ldi r24, 0x01 ; 1 21d26: 0f 94 ae ac call 0x3595c ; 0x3595c 21d2a: 18 2f mov r17, r24 21d2c: 81 11 cpse r24, r1 21d2e: 07 c0 rjmp .+14 ; 0x21d3e break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 21d30: 0f 94 26 c5 call 0x38a4c ; 0x38a4c // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 21d34: 0f 94 4c ac call 0x35898 ; 0x35898 // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 21d38: 0f 94 3c ad call 0x35a78 ; 0x35a78 21d3c: e1 cf rjmp .-62 ; 0x21d00 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 21d3e: 0f 94 ed 43 call 0x287da ; 0x287da } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 21d42: 0f 94 1d c6 call 0x38c3a ; 0x38c3a 21d46: 81 30 cpi r24, 0x01 ; 1 21d48: 79 f1 breq .+94 ; 0x21da8 // 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(); 21d4a: 0f 94 3c ad call 0x35a78 ; 0x35a78 if (retries == 2 && cutter_enabled()) { 21d4e: 92 e0 ldi r25, 0x02 ; 2 21d50: f9 12 cpse r15, r25 21d52: 09 c0 rjmp .+18 ; 0x21d66 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; 21d54: 8e ec ldi r24, 0xCE ; 206 21d56: 9e e0 ldi r25, 0x0E ; 14 21d58: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 21d5c: 81 30 cpi r24, 0x01 ; 1 21d5e: 19 f4 brne .+6 ; 0x21d66 CutFilamentInner(slot); // try cutting filament tip at the last attempt 21d60: 80 2f mov r24, r16 21d62: 0f 94 23 ae call 0x35c46 ; 0x35c46 21d66: 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) { 21d68: f1 10 cpse r15, r1 21d6a: ca cf rjmp .-108 ; 0x21d00 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()) { 21d6c: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 21d70: 88 23 and r24, r24 21d72: 09 f4 brne .+2 ; 0x21d76 21d74: ef c0 rjmp .+478 ; 0x21f54 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 21d76: 67 96 adiw r28, 0x17 ; 23 21d78: 0f b6 in r0, 0x3f ; 63 21d7a: f8 94 cli 21d7c: de bf out 0x3e, r29 ; 62 21d7e: 0f be out 0x3f, r0 ; 63 21d80: cd bf out 0x3d, r28 ; 61 21d82: df 91 pop r29 21d84: cf 91 pop r28 21d86: 1f 91 pop r17 21d88: 0f 91 pop r16 21d8a: ff 90 pop r15 21d8c: ef 90 pop r14 21d8e: df 90 pop r13 21d90: cf 90 pop r12 21d92: bf 90 pop r11 21d94: af 90 pop r10 21d96: 9f 90 pop r9 21d98: 8f 90 pop r8 21d9a: 7f 90 pop r7 21d9c: 6f 90 pop r6 21d9e: 5f 90 pop r5 21da0: 4f 90 pop r4 21da2: 3f 90 pop r3 21da4: 2f 90 pop r2 21da6: 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(); 21da8: 60 91 97 13 lds r22, 0x1397 ; 0x801397 21dac: 70 e0 ldi r23, 0x00 ; 0 21dae: 90 e0 ldi r25, 0x00 ; 0 21db0: 80 e0 ldi r24, 0x00 ; 0 21db2: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 21db6: 9b 01 movw r18, r22 21db8: ac 01 movw r20, r24 21dba: 66 e6 ldi r22, 0x66 ; 102 21dbc: 76 e6 ldi r23, 0x66 ; 102 21dbe: 8d e9 ldi r24, 0x9D ; 157 21dc0: 92 e4 ldi r25, 0x42 ; 66 21dc2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 21dc6: 36 2e mov r3, r22 21dc8: 87 2e mov r8, r23 21dca: 98 2e mov r9, r24 21dcc: 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)) 21dce: 26 2f mov r18, r22 21dd0: 37 2f mov r19, r23 21dd2: 48 2f mov r20, r24 21dd4: 59 2f mov r21, r25 21dd6: 60 e0 ldi r22, 0x00 ; 0 21dd8: 70 e0 ldi r23, 0x00 ; 0 21dda: 80 e2 ldi r24, 0x20 ; 32 21ddc: 91 e4 ldi r25, 0x41 ; 65 21dde: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 21de2: 2b 01 movw r4, r22 21de4: 3c 01 movw r6, r24 21de6: ef e1 ldi r30, 0x1F ; 31 21de8: f5 e0 ldi r31, 0x05 ; 5 21dea: 82 2d mov r24, r2 21dec: 11 92 st Z+, r1 21dee: 8a 95 dec r24 21df0: e9 f7 brne .-6 ; 0x21dec lcd_status_message_idx = 0; 21df2: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.450> 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); 21df6: 83 2d mov r24, r3 21df8: 98 2d mov r25, r8 21dfa: a9 2d mov r26, r9 21dfc: be 2d mov r27, r14 21dfe: bc 01 movw r22, r24 21e00: 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++) { 21e02: 91 2c mov r9, r1 21e04: 31 2c mov r3, r1 21e06: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 21e08: 5b 01 movw r10, r22 21e0a: 6c 01 movw r12, r24 21e0c: d7 fa bst r13, 7 21e0e: d0 94 com r13 21e10: d7 f8 bld r13, 7 21e12: d0 94 com r13 21e14: 20 e0 ldi r18, 0x00 ; 0 21e16: 30 e0 ldi r19, 0x00 ; 0 21e18: 48 e4 ldi r20, 0x48 ; 72 21e1a: 52 e4 ldi r21, 0x42 ; 66 21e1c: 0f 94 e9 c5 call 0x38bd2 ; 0x38bd2 21e20: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 21e24: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while (planner_any_moves()) { 21e28: 98 17 cp r25, r24 21e2a: 09 f4 brne .+2 ; 0x21e2e 21e2c: 49 c0 rjmp .+146 ; 0x21ec0 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 21e2e: 11 23 and r17, r17 21e30: 31 f0 breq .+12 ; 0x21e3e 21e32: 0f 94 1d c6 call 0x38c3a ; 0x38c3a 21e36: 11 e0 ldi r17, 0x01 ; 1 21e38: 81 30 cpi r24, 0x01 ; 1 21e3a: 09 f0 breq .+2 ; 0x21e3e 21e3c: 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); 21e3e: 83 e0 ldi r24, 0x03 ; 3 21e40: 0f 94 d9 43 call 0x287b2 ; 0x287b2 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); 21e44: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 21e48: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 21e4c: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 21e50: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 21e54: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 21e58: a3 01 movw r20, r6 21e5a: 92 01 movw r18, r4 21e5c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 21e60: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 21e64: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 21e68: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 21e6a: e6 16 cp r14, r22 21e6c: c1 f0 breq .+48 ; 0x21e9e 21e6e: e3 2d mov r30, r3 21e70: e4 31 cpi r30, 0x14 ; 20 21e72: 08 f0 brcs .+2 ; 0x21e76 21e74: 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); 21e76: 33 24 eor r3, r3 21e78: 33 94 inc r3 21e7a: 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] : '-'); 21e7c: 8f ef ldi r24, 0xFF ; 255 21e7e: 11 11 cpse r17, r1 21e80: 01 c0 rjmp .+2 ; 0x21e84 21e82: 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; 21e84: f0 e0 ldi r31, 0x00 ; 0 21e86: e1 5e subi r30, 0xE1 ; 225 21e88: fa 4f sbci r31, 0xFA ; 250 21e8a: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 21e8c: 91 e0 ldi r25, 0x01 ; 1 21e8e: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 21e92: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 21e96: 81 11 cpse r24, r1 21e98: 02 c0 rjmp .+4 ; 0x21e9e 21e9a: 0f 94 78 2b call 0x256f0 ; 0x256f0 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 21e9e: 90 e0 ldi r25, 0x00 ; 0 21ea0: 80 e0 ldi r24, 0x00 ; 0 21ea2: 0e 94 6c 8c call 0x118d8 ; 0x118d8 } 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); 21ea6: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 21ea8: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 21eac: 88 23 and r24, r24 21eae: 09 f4 brne .+2 ; 0x21eb2 21eb0: b7 cf rjmp .-146 ; 0x21e20 return false; // power panic or a similar issue happened, bail out fast 21eb2: 10 e0 ldi r17, 0x00 ; 0 21eb4: 37 c0 rjmp .+110 ; 0x21f24 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); 21eb6: c6 01 movw r24, r12 21eb8: b5 01 movw r22, r10 21eba: 99 24 eor r9, r9 21ebc: 93 94 inc r9 21ebe: aa cf rjmp .-172 ; 0x21e14 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++) { 21ec0: 91 e0 ldi r25, 0x01 ; 1 21ec2: 99 12 cpse r9, r25 21ec4: f8 cf rjmp .-16 ; 0x21eb6 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 21ec6: 0f 94 e7 c5 call 0x38bce ; 0x38bce if (!filament_inserted) { 21eca: 11 11 cpse r17, r1 21ecc: 08 c0 rjmp .+16 ; 0x21ede eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 21ece: 8f ec ldi r24, 0xCF ; 207 21ed0: 9e e0 ldi r25, 0x0E ; 14 21ed2: 0e 94 a8 75 call 0xeb50 ; 0xeb50 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 21ed6: 80 ed ldi r24, 0xD0 ; 208 21ed8: 9e e0 ldi r25, 0x0E ; 14 21eda: 0e 94 9b 75 call 0xeb36 ; 0xeb36 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); 21ede: 44 e1 ldi r20, 0x14 ; 20 21ee0: 50 e0 ldi r21, 0x00 ; 0 21ee2: 6f e1 ldi r22, 0x1F ; 31 21ee4: 75 e0 ldi r23, 0x05 ; 5 21ee6: ce 01 movw r24, r28 21ee8: 01 96 adiw r24, 0x01 ; 1 21eea: 0f 94 d4 e2 call 0x3c5a8 ; 0x3c5a8 21eee: fe 01 movw r30, r28 21ef0: 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'; 21ef2: 81 91 ld r24, Z+ 21ef4: 87 fd sbrc r24, 7 21ef6: 2c c0 rjmp .+88 ; 0x21f50 21ef8: 80 e3 ldi r24, 0x30 ; 48 21efa: df 01 movw r26, r30 21efc: 11 97 sbiw r26, 0x01 ; 1 21efe: 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++) { 21f00: 8e 89 ldd r24, Y+22 ; 0x16 21f02: 9f 89 ldd r25, Y+23 ; 0x17 21f04: 8e 17 cp r24, r30 21f06: 9f 07 cpc r25, r31 21f08: a1 f7 brne .-24 ; 0x21ef2 // 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; 21f0a: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 21f0c: 82 ec ldi r24, 0xC2 ; 194 21f0e: 9a ea ldi r25, 0xAA ; 170 21f10: 0e 94 d0 76 call 0xeda0 ; 0xeda0 21f14: 80 e2 ldi r24, 0x20 ; 32 21f16: 9e e8 ldi r25, 0x8E ; 142 21f18: 0e 94 d0 76 call 0xeda0 ; 0xeda0 21f1c: ce 01 movw r24, r28 21f1e: 01 96 adiw r24, 0x01 ; 1 21f20: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 21f24: 84 e3 ldi r24, 0x34 ; 52 21f26: 95 e0 ldi r25, 0x05 ; 5 21f28: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::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()) { 21f2c: 11 23 and r17, r17 21f2e: 09 f4 brne .+2 ; 0x21f32 21f30: 0c cf rjmp .-488 ; 0x21d4a // 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 21f32: 80 2f mov r24, r16 21f34: 0f 94 3b 88 call 0x31076 ; 0x31076 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 21f38: 00 93 49 13 sts 0x1349, r16 ; 0x801349 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 21f3c: 80 91 be 13 lds r24, 0x13BE ; 0x8013be 21f40: 90 91 bf 13 lds r25, 0x13BF ; 0x8013bf 21f44: 01 96 adiw r24, 0x01 ; 1 21f46: 90 93 bf 13 sts 0x13BF, r25 ; 0x8013bf 21f4a: 80 93 be 13 sts 0x13BE, r24 ; 0x8013be 21f4e: 13 cf rjmp .-474 ; 0x21d76 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'; 21f50: 81 e3 ldi r24, 0x31 ; 49 21f52: d3 cf rjmp .-90 ; 0x21efa void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 21f54: 8a e2 ldi r24, 0x2A ; 42 21f56: 90 e8 ldi r25, 0x80 ; 128 21f58: 90 93 4c 13 sts 0x134C, r25 ; 0x80134c 21f5c: 80 93 4b 13 sts 0x134B, r24 ; 0x80134b 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 21f60: 61 e0 ldi r22, 0x01 ; 1 21f62: 81 e0 ldi r24, 0x01 ; 1 21f64: 0f 94 ae ac call 0x3595c ; 0x3595c 21f68: c7 ce rjmp .-626 ; 0x21cf8 00021f6a : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 21f6a: cf 93 push r28 21f6c: df 93 push r29 21f6e: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 21f70: 0f 94 bc 88 call 0x31178 ; 0x31178 21f74: c8 2f mov r28, r24 21f76: 88 23 and r24, r24 21f78: 49 f1 breq .+82 ; 0x21fcc safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 21f7a: 88 ec ldi r24, 0xC8 ; 200 21f7c: 90 e0 ldi r25, 0x00 ; 0 21f7e: 0f 94 6b c9 call 0x392d6 ; 0x392d6 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> 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); 21f82: 82 e0 ldi r24, 0x02 ; 2 21f84: 0f 94 0c 4f call 0x29e18 ; 0x29e18 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 21f88: 85 e7 ldi r24, 0x75 ; 117 21f8a: 9b e5 ldi r25, 0x5B ; 91 21f8c: 0e 94 2c 72 call 0xe458 ; 0xe458 21f90: 6d 2f mov r22, r29 21f92: 0f 94 07 c5 call 0x38a0e ; 0x38a0e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 21f96: 0f 94 30 88 call 0x31060 ; 0x31060 FullScreenMsgLoad(slot); { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 21f9a: 0f 94 e9 87 call 0x30fd2 ; 0x30fd2 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 21f9e: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 21fa2: 83 36 cpi r24, 0x63 ; 99 21fa4: 29 f0 breq .+10 ; 0x21fb0 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 21fa6: 62 e1 ldi r22, 0x12 ; 18 21fa8: 80 e1 ldi r24, 0x10 ; 16 21faa: 96 ea ldi r25, 0xA6 ; 166 21fac: 0f 94 93 88 call 0x31126 ; 0x31126 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 21fb0: 8d 2f mov r24, r29 21fb2: 0f 94 5d 0e call 0x21cba ; 0x21cba // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 21fb6: 0e 94 b9 ce call 0x19d72 ; 0x19d72 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); 21fba: 83 e0 ldi r24, 0x03 ; 3 21fbc: 0f 94 0c 4f call 0x29e18 ; 0x29e18 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 21fc0: 0f 94 2d 7c call 0x2f85a ; 0x2f85a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 21fc4: 0f 94 b1 88 call 0x31162 ; 0x31162 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 21fc8: 0f 94 04 c5 call 0x38a08 ; 0x38a08 return true; } 21fcc: 8c 2f mov r24, r28 21fce: df 91 pop r29 21fd0: cf 91 pop r28 21fd2: 08 95 ret 00021fd4 : 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); 21fd4: 0f 94 b5 0f call 0x21f6a ; 0x21f6a // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 21fd8: 0e 94 13 64 call 0xc826 ; 0xc826 st_synchronize(); 21fdc: 0f 94 ed 43 call 0x287da ; 0x287da // Ask user if the extruded color is correct: lcd_return_to_status(); 21fe0: 0f 94 ab 1f call 0x23f56 ; 0x23f56 lcd_load_filament_color_check(); 21fe4: 0f 94 97 50 call 0x2a12e ; 0x2a12e lcd_setstatuspgm(MSG_WELCOME); 21fe8: 8f ec ldi r24, 0xCF ; 207 21fea: 9f e6 ldi r25, 0x6F ; 111 21fec: 0e 94 3b f2 call 0x1e476 ; 0x1e476 custom_message_type = CustomMsg::Status; 21ff0: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 // Clear the filament action clearFilamentAction(); 21ff4: 0d 94 98 21 jmp 0x24330 ; 0x24330 00021ff8 : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 21ff8: cf 93 push r28 21ffa: df 93 push r29 21ffc: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 21ffe: 0f 94 bc 88 call 0x31178 ; 0x31178 22002: c8 2f mov r28, r24 22004: 88 23 and r24, r24 22006: b9 f0 breq .+46 ; 0x22036 return false; } if (slot != extruder) { 22008: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 2200c: 8d 17 cp r24, r29 2200e: 99 f0 breq .+38 ; 0x22036 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(); 22010: 0e 94 61 67 call 0xcec2 ; 0xcec2 if (/*FindaDetectsFilament()*/ 22014: 81 11 cpse r24, r1 22016: 02 c0 rjmp .+4 ; 0x2201c /*!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(); 22018: 0f 94 75 ad call 0x35aea ; 0x35aea struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2201c: 0f 94 30 88 call 0x31060 ; 0x31060 // we need to unload manually as well -- but only if FINDA detects filament unload(); } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 22020: 0f 94 e9 87 call 0x30fd2 ; 0x30fd2 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 22024: 0f 94 ed 43 call 0x287da ; 0x287da planner_synchronize(); ToolChangeCommon(slot); 22028: 8d 2f mov r24, r29 2202a: 0f 94 5d 0e call 0x21cba ; 0x21cba 2202e: 0f 94 2d 7c call 0x2f85a ; 0x2f85a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 22032: 0f 94 b1 88 call 0x31162 ; 0x31162 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 22036: 8c 2f mov r24, r28 22038: df 91 pop r29 2203a: cf 91 pop r28 2203c: 08 95 ret 0002203e : /// 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) { 2203e: 1f 93 push r17 22040: cf 93 push r28 22042: df 93 push r29 22044: c8 2f mov r28, r24 22046: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 22048: 0f 94 bc 88 call 0x31178 ; 0x31178 2204c: d8 2f mov r29, r24 2204e: 88 23 and r24, r24 22050: 89 f0 breq .+34 ; 0x22074 return false; } FSensorBlockRunout blockRunout; 22052: 0f 94 e9 87 call 0x30fd2 ; 0x30fd2 switch (code) { 22056: c3 36 cpi r28, 0x63 ; 99 22058: 01 f1 breq .+64 ; 0x2209a 2205a: c8 37 cpi r28, 0x78 ; 120 2205c: 81 f0 breq .+32 ; 0x2207e 2205e: cf 33 cpi r28, 0x3F ; 63 22060: 39 f4 brne .+14 ; 0x22070 case '?': { waitForHotendTargetTemp(100, [] {}); 22062: 84 e6 ldi r24, 0x64 ; 100 22064: 90 e0 ldi r25, 0x00 ; 0 22066: 0f 94 6b c9 call 0x392d6 ; 0x392d6 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> load_filament_to_nozzle(slot); 2206a: 81 2f mov r24, r17 2206c: 0f 94 b5 0f call 0x21f6a ; 0x21f6a 22070: 0f 94 2d 7c call 0x2f85a ; 0x2f85a execute_load_to_nozzle_sequence(); } break; } return true; } 22074: 8d 2f mov r24, r29 22076: df 91 pop r29 22078: cf 91 pop r28 2207a: 1f 91 pop r17 2207c: 08 95 ret } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 2207e: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 22082: 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); 22086: 81 2f mov r24, r17 22088: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2208c: 8f ea ldi r24, 0xAF ; 175 2208e: 90 e0 ldi r25, 0x00 ; 0 22090: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 22094: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 22098: eb cf rjmp .-42 ; 0x22070 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 2209a: 84 e6 ldi r24, 0x64 ; 100 2209c: 90 e0 ldi r25, 0x00 ; 0 2209e: 0f 94 6b c9 call 0x392d6 ; 0x392d6 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> execute_load_to_nozzle_sequence(); 220a2: 0e 94 b9 ce call 0x19d72 ; 0x19d72 220a6: e4 cf rjmp .-56 ; 0x22070 000220a8 : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 220a8: cf 93 push r28 220aa: 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); 220ac: 8e e4 ldi r24, 0x4E ; 78 220ae: 95 e4 ldi r25, 0x45 ; 69 220b0: 0e 94 2c 72 call 0xe458 ; 0xe458 220b4: 6c 2f mov r22, r28 220b6: 0f 94 07 c5 call 0x38a0e ; 0x38a0e return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 220ba: 8c 2f mov r24, r28 220bc: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 220c0: 0f 94 ed 43 call 0x287da ; 0x287da planner_synchronize(); unload(); 220c4: 0f 94 75 ad call 0x35aea ; 0x35aea ScreenUpdateEnable(); 220c8: 0f 94 04 c5 call 0x38a08 ; 0x38a08 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 220cc: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 220ce: 0d 94 98 21 jmp 0x24330 ; 0x24330 000220d2 : 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(){ 220d2: cf 93 push r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ 220d4: c0 e0 ldi r28, 0x00 ; 0 220d6: 8e e4 ldi r24, 0x4E ; 78 220d8: 95 e4 ldi r25, 0x45 ; 69 220da: 0e 94 2c 72 call 0xe458 ; 0xe458 220de: 6c 2f mov r22, r28 220e0: 0f 94 07 c5 call 0x38a0e ; 0x38a0e return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 220e4: 8c 2f mov r24, r28 220e6: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 220ea: 0f 94 ed 43 call 0x287da ; 0x287da planner_synchronize(); unload(); 220ee: 0f 94 75 ad call 0x35aea ; 0x35aea ScreenUpdateEnable(); 220f2: 0f 94 04 c5 call 0x38a08 ; 0x38a08 220f6: cf 5f subi r28, 0xFF ; 255 220f8: c5 30 cpi r28, 0x05 ; 5 220fa: 69 f7 brne .-38 ; 0x220d6 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 220fc: cf 91 pop r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 220fe: 0d 94 98 21 jmp 0x24330 ; 0x24330 00022102 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 22102: cf 93 push r28 22104: df 93 push r29 22106: 00 d0 rcall .+0 ; 0x22108 22108: 1f 92 push r1 2210a: 1f 92 push r1 2210c: cd b7 in r28, 0x3d ; 61 2210e: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 22110: 48 2f mov r20, r24 22112: 68 e5 ldi r22, 0x58 ; 88 22114: ce 01 movw r24, r28 22116: 01 96 adiw r24, 0x01 ; 1 22118: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 2211c: 49 81 ldd r20, Y+1 ; 0x01 2211e: 5a 81 ldd r21, Y+2 ; 0x02 22120: 6b 81 ldd r22, Y+3 ; 0x03 22122: 7c 81 ldd r23, Y+4 ; 0x04 22124: 8d 81 ldd r24, Y+5 ; 0x05 22126: 0f 94 8a a5 call 0x34b14 ; 0x34b14 } 2212a: 0f 90 pop r0 2212c: 0f 90 pop r0 2212e: 0f 90 pop r0 22130: 0f 90 pop r0 22132: 0f 90 pop r0 22134: df 91 pop r29 22136: cf 91 pop r28 22138: 08 95 ret 0002213a : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2213a: 80 e0 ldi r24, 0x00 ; 0 2213c: 0d 94 81 10 jmp 0x22102 ; 0x22102 00022140 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 22140: 1f 93 push r17 22142: cf 93 push r28 22144: df 93 push r29 22146: 00 d0 rcall .+0 ; 0x22148 22148: 1f 92 push r1 2214a: 1f 92 push r1 2214c: cd b7 in r28, 0x3d ; 61 2214e: de b7 in r29, 0x3e ; 62 22150: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 22152: 0f 94 bc 88 call 0x31178 ; 0x31178 22156: 88 23 and r24, r24 22158: d9 f0 breq .+54 ; 0x22190 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 2215a: 41 2f mov r20, r17 2215c: 62 e5 ldi r22, 0x52 ; 82 2215e: ce 01 movw r24, r28 22160: 01 96 adiw r24, 0x01 ; 1 22162: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 22166: 49 81 ldd r20, Y+1 ; 0x01 22168: 5a 81 ldd r21, Y+2 ; 0x02 2216a: 6b 81 ldd r22, Y+3 ; 0x03 2216c: 7c 81 ldd r23, Y+4 ; 0x04 2216e: 8d 81 ldd r24, Y+5 ; 0x05 22170: 0f 94 8a a5 call 0x34b14 ; 0x34b14 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)); 22174: 60 e0 ldi r22, 0x00 ; 0 22176: 80 e0 ldi r24, 0x00 ; 0 22178: 0f 94 ae ac call 0x3595c ; 0x3595c 2217c: 88 23 and r24, r24 2217e: 69 f3 breq .-38 ; 0x2215a // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 22180: 20 91 66 13 lds r18, 0x1366 ; 0x801366 22184: 30 91 67 13 lds r19, 0x1367 ; 0x801367 22188: 30 93 b7 13 sts 0x13B7, r19 ; 0x8013b7 2218c: 20 93 b6 13 sts 0x13B6, r18 ; 0x8013b6 return true; } 22190: 0f 90 pop r0 22192: 0f 90 pop r0 22194: 0f 90 pop r0 22196: 0f 90 pop r0 22198: 0f 90 pop r0 2219a: df 91 pop r29 2219c: cf 91 pop r28 2219e: 1f 91 pop r17 221a0: 08 95 ret 000221a2 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 221a2: ff 92 push r15 221a4: 0f 93 push r16 221a6: 1f 93 push r17 221a8: cf 93 push r28 221aa: df 93 push r29 221ac: 1f 92 push r1 221ae: cd b7 in r28, 0x3d ; 61 221b0: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 221b2: ce 01 movw r24, r28 221b4: 01 96 adiw r24, 0x01 ; 1 221b6: 0f 94 9f 32 call 0x2653e ; 0x2653e uint16_t pos = 0; 221ba: 10 e0 ldi r17, 0x00 ; 0 221bc: 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]; 221be: 85 e0 ldi r24, 0x05 ; 5 221c0: 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()) { 221c2: d1 99 sbic 0x1a, 1 ; 26 221c4: 11 c0 rjmp .+34 ; 0x221e8 // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 221c6: 0f 94 61 39 call 0x272c2 ; 0x272c2 static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 221ca: 0e 3d cpi r16, 0xDE ; 222 221cc: 11 05 cpc r17, r1 221ce: c9 f7 brne .-14 ; 0x221c2 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 221d0: ce 01 movw r24, r28 221d2: 01 96 adiw r24, 0x01 ; 1 221d4: 0f 94 92 32 call 0x26524 ; 0x26524 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 221d8: c8 01 movw r24, r16 221da: 0f 90 pop r0 221dc: df 91 pop r29 221de: cf 91 pop r28 221e0: 1f 91 pop r17 221e2: 0f 91 pop r16 221e4: ff 90 pop r15 221e6: 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(); 221e8: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 221ea: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.459> 221ee: 88 23 and r24, r24 221f0: 61 f3 breq .-40 ; 0x221ca adc_values_ready = false; 221f2: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.459> adc_start_cycle(); 221f6: 0e 94 5f 8d call 0x11abe ; 0x11abe temp_mgr_isr(); 221fa: 0f 94 be 36 call 0x26d7c ; 0x26d7c // stop recording for an hard error condition if(temp_error_state.v) 221fe: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 22202: 81 11 cpse r24, r1 22204: 1b c0 rjmp .+54 ; 0x2223c return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 22206: f0 9e mul r15, r16 22208: f0 01 movw r30, r0 2220a: f1 9e mul r15, r17 2220c: f0 0d add r31, r0 2220e: 11 24 eor r1, r1 22210: eb 53 subi r30, 0x3B ; 59 22212: f9 4f sbci r31, 0xF9 ; 249 entry.temp = current_temperature_isr[0]; 22214: 80 91 17 05 lds r24, 0x0517 ; 0x800517 22218: 90 91 18 05 lds r25, 0x0518 ; 0x800518 2221c: a0 91 19 05 lds r26, 0x0519 ; 0x800519 22220: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 22224: 80 83 st Z, r24 22226: 91 83 std Z+1, r25 ; 0x01 22228: a2 83 std Z+2, r26 ; 0x02 2222a: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 2222c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 22230: 84 83 std Z+4, r24 ; 0x04 ++pos; 22232: 0f 5f subi r16, 0xFF ; 255 22234: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 22236: 0f 94 89 3b call 0x27712 ; 0x27712 2223a: c7 cf rjmp .-114 ; 0x221ca adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 2223c: 10 e0 ldi r17, 0x00 ; 0 2223e: 00 e0 ldi r16, 0x00 ; 0 22240: c7 cf rjmp .-114 ; 0x221d0 00022242 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 22242: fc 01 movw r30, r24 22244: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 22246: 90 32 cpi r25, 0x20 ; 32 22248: 49 f0 breq .+18 ; 0x2225c 2224a: 87 ef ldi r24, 0xF7 ; 247 2224c: 89 0f add r24, r25 2224e: 82 30 cpi r24, 0x02 ; 2 22250: 28 f0 brcs .+10 ; 0x2225c 22252: 81 e0 ldi r24, 0x01 ; 1 22254: 9d 30 cpi r25, 0x0D ; 13 22256: 19 f0 breq .+6 ; 0x2225e 22258: 80 e0 ldi r24, 0x00 ; 0 2225a: 08 95 ret 2225c: 81 e0 ldi r24, 0x01 ; 1 } 2225e: 08 95 ret 00022260 : 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; 22260: 88 3e cpi r24, 0xE8 ; 232 22262: 23 e0 ldi r18, 0x03 ; 3 22264: 92 07 cpc r25, r18 22266: 10 f0 brcs .+4 ; 0x2226c 22268: 87 ee ldi r24, 0xE7 ; 231 2226a: 93 e0 ldi r25, 0x03 ; 3 } 2226c: 08 95 ret 0002226e : return 0; } static int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 2226e: 90 91 3c 05 lds r25, 0x053C ; 0x80053c 22272: 80 91 3b 05 lds r24, 0x053B ; 0x80053b 22276: 2f ef ldi r18, 0xFF ; 255 22278: 3f ef ldi r19, 0xFF ; 255 2227a: 89 17 cp r24, r25 2227c: 71 f0 breq .+28 ; 0x2229a _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 2227e: e9 2f mov r30, r25 22280: f0 e0 ldi r31, 0x00 ; 0 22282: e2 5c subi r30, 0xC2 ; 194 22284: fa 4f sbci r31, 0xFA ; 250 22286: 20 81 ld r18, Z 22288: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 2228a: 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 2228c: 80 91 3a 05 lds r24, 0x053A ; 0x80053a 22290: 98 17 cp r25, r24 22292: 08 f0 brcs .+2 ; 0x22296 22294: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 22296: 90 93 3c 05 sts 0x053C, r25 ; 0x80053c return rbuf_get(uart2_ibuf); } 2229a: c9 01 movw r24, r18 2229c: 08 95 ret 0002229e : uint8_t uart2_ibuf[20] = {0, 0}; FILE _uart2io; static int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 2229e: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 222a2: 95 ff sbrs r25, 5 222a4: fc cf rjmp .-8 ; 0x2229e UDR2 = c; // transmit byte 222a6: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> return 0; } 222aa: 90 e0 ldi r25, 0x00 ; 0 222ac: 80 e0 ldi r24, 0x00 ; 0 222ae: 08 95 ret 000222b0 : } 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) { 222b0: cf 92 push r12 222b2: df 92 push r13 222b4: ef 92 push r14 222b6: ff 92 push r15 222b8: 0f 93 push r16 222ba: 1f 93 push r17 222bc: cf 93 push r28 222be: df 93 push r29 222c0: 8c 01 movw r16, r24 222c2: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 222c4: 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; 222c6: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 222c8: 61 50 subi r22, 0x01 ; 1 222ca: 77 0b sbc r23, r23 222cc: 29 2f mov r18, r25 222ce: 30 e0 ldi r19, 0x00 ; 0 222d0: 26 17 cp r18, r22 222d2: 37 07 cpc r19, r23 222d4: 2c f0 brlt .+10 ; 0x222e0 } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 222d6: 55 23 and r21, r21 222d8: 19 f1 breq .+70 ; 0x22320 { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 222da: 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; 222dc: 50 e0 ldi r21, 0x00 ; 0 222de: f6 cf rjmp .-20 ; 0x222cc for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 222e0: 78 01 movw r14, r16 222e2: e2 0e add r14, r18 222e4: f3 1e adc r15, r19 222e6: f7 01 movw r30, r14 222e8: 80 81 ld r24, Z 222ea: d9 01 movw r26, r18 222ec: 11 96 adiw r26, 0x01 ; 1 222ee: 68 01 movw r12, r16 222f0: ca 0e add r12, r26 222f2: db 1e adc r13, r27 222f4: f6 01 movw r30, r12 222f6: 40 81 ld r20, Z 222f8: 48 17 cp r20, r24 222fa: 80 f4 brcc .+32 ; 0x2231c { uint8_t d = data[i]; data[i] = data[i+1]; 222fc: f7 01 movw r30, r14 222fe: 40 83 st Z, r20 data[i+1] = d; 22300: f6 01 movw r30, r12 22302: 80 83 st Z, r24 if (data2) 22304: 20 97 sbiw r28, 0x00 ; 0 22306: 49 f0 breq .+18 ; 0x2231a { d = data2[i]; 22308: fe 01 movw r30, r28 2230a: e2 0f add r30, r18 2230c: f3 1f adc r31, r19 2230e: 80 81 ld r24, Z data2[i] = data2[i+1]; 22310: ac 0f add r26, r28 22312: bd 1f adc r27, r29 22314: 2c 91 ld r18, X 22316: 20 83 st Z, r18 data2[i+1] = d; 22318: 8c 93 st X, r24 } changed = 1; 2231a: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 2231c: 9f 5f subi r25, 0xFF ; 255 2231e: d6 cf rjmp .-84 ; 0x222cc data2[i+1] = d; } changed = 1; } } } 22320: df 91 pop r29 22322: cf 91 pop r28 22324: 1f 91 pop r17 22326: 0f 91 pop r16 22328: ff 90 pop r15 2232a: ef 90 pop r14 2232c: df 90 pop r13 2232e: cf 90 pop r12 22330: 08 95 ret 00022332 : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 22332: 81 30 cpi r24, 0x01 ; 1 22334: 41 f0 breq .+16 ; 0x22346 22336: 28 f0 brcs .+10 ; 0x22342 22338: 82 30 cpi r24, 0x02 ; 2 2233a: 39 f0 breq .+14 ; 0x2234a 2233c: 83 30 cpi r24, 0x03 ; 3 2233e: 71 f0 breq .+28 ; 0x2235c 22340: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 22342: a0 9a sbi 0x14, 0 ; 20 22344: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 22346: a2 9a sbi 0x14, 2 ; 20 22348: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 2234a: 9f b7 in r25, 0x3f ; 63 2234c: f8 94 cli 2234e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22352: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 22354: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22358: 9f bf out 0x3f, r25 ; 63 } } 2235a: 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; 2235c: 9f b7 in r25, 0x3f ; 63 2235e: f8 94 cli 22360: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22364: 80 61 ori r24, 0x10 ; 16 22366: f6 cf rjmp .-20 ; 0x22354 00022368 : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 22368: 81 30 cpi r24, 0x01 ; 1 2236a: 41 f0 breq .+16 ; 0x2237c 2236c: 28 f0 brcs .+10 ; 0x22378 2236e: 82 30 cpi r24, 0x02 ; 2 22370: 39 f0 breq .+14 ; 0x22380 22372: 83 30 cpi r24, 0x03 ; 3 22374: 71 f0 breq .+28 ; 0x22392 22376: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 22378: a0 98 cbi 0x14, 0 ; 20 2237a: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 2237c: a2 98 cbi 0x14, 2 ; 20 2237e: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 22380: 9f b7 in r25, 0x3f ; 63 22382: f8 94 cli 22384: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22388: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 2238a: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2238e: 9f bf out 0x3f, r25 ; 63 } } 22390: 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; 22392: 9f b7 in r25, 0x3f ; 63 22394: f8 94 cli 22396: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2239a: 8f 7e andi r24, 0xEF ; 239 2239c: f6 cf rjmp .-20 ; 0x2238a 0002239e : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 2239e: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 223a0: 0d b4 in r0, 0x2d ; 45 223a2: 07 fe sbrs r0, 7 223a4: fd cf rjmp .-6 ; 0x223a0 return SPDR; 223a6: 8e b5 in r24, 0x2e ; 46 } 223a8: 08 95 ret 000223aa : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 223aa: 2f 92 push r2 223ac: 3f 92 push r3 223ae: 4f 92 push r4 223b0: 5f 92 push r5 223b2: 6f 92 push r6 223b4: 7f 92 push r7 223b6: 8f 92 push r8 223b8: 9f 92 push r9 223ba: af 92 push r10 223bc: bf 92 push r11 223be: cf 92 push r12 223c0: df 92 push r13 223c2: ef 92 push r14 223c4: ff 92 push r15 223c6: 0f 93 push r16 223c8: 1f 93 push r17 223ca: cf 93 push r28 223cc: df 93 push r29 223ce: cd b7 in r28, 0x3d ; 61 223d0: de b7 in r29, 0x3e ; 62 223d2: 2e 97 sbiw r28, 0x0e ; 14 223d4: 0f b6 in r0, 0x3f ; 63 223d6: f8 94 cli 223d8: de bf out 0x3e, r29 ; 62 223da: 0f be out 0x3f, r0 ; 63 223dc: 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]); 223de: 20 90 1e 06 lds r2, 0x061E ; 0x80061e 223e2: 30 90 1f 06 lds r3, 0x061F ; 0x80061f 223e6: 40 90 17 05 lds r4, 0x0517 ; 0x800517 223ea: 50 90 18 05 lds r5, 0x0518 ; 0x800518 223ee: 60 90 19 05 lds r6, 0x0519 ; 0x800519 223f2: 70 90 1a 05 lds r7, 0x051A ; 0x80051a #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 223f6: 21 14 cp r2, r1 223f8: 31 04 cpc r3, r1 223fa: 39 f4 brne .+14 ; 0x2240a pid_output = 0; pid_reset[e] = true; 223fc: 81 e0 ldi r24, 0x01 ; 1 223fe: 80 93 f5 05 sts 0x05F5, r24 ; 0x8005f5 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; 22402: 81 2c mov r8, r1 22404: 91 2c mov r9, r1 22406: 54 01 movw r10, r8 22408: f9 c0 rjmp .+498 ; 0x225fc #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 2240a: b1 01 movw r22, r2 2240c: 03 2c mov r0, r3 2240e: 00 0c add r0, r0 22410: 88 0b sbc r24, r24 22412: 99 0b sbc r25, r25 22414: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 22418: a3 01 movw r20, r6 2241a: 92 01 movw r18, r4 2241c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 22420: 6b 01 movw r12, r22 22422: 7c 01 movw r14, r24 if(pid_reset[e]) { 22424: 80 91 f5 05 lds r24, 0x05F5 ; 0x8005f5 22428: 88 23 and r24, r24 2242a: 91 f0 breq .+36 ; 0x22450 iState_sum[e] = 0.0; 2242c: 10 92 f1 05 sts 0x05F1, r1 ; 0x8005f1 22430: 10 92 f2 05 sts 0x05F2, r1 ; 0x8005f2 22434: 10 92 f3 05 sts 0x05F3, r1 ; 0x8005f3 22438: 10 92 f4 05 sts 0x05F4, r1 ; 0x8005f4 dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 2243c: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 22440: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 22444: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef 22448: 10 92 f0 05 sts 0x05F0, r1 ; 0x8005f0 pid_reset[e] = false; 2244c: 10 92 f5 05 sts 0x05F5, r1 ; 0x8005f5 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 22450: 20 91 26 0e lds r18, 0x0E26 ; 0x800e26 22454: 30 91 27 0e lds r19, 0x0E27 ; 0x800e27 22458: 40 91 28 0e lds r20, 0x0E28 ; 0x800e28 2245c: 50 91 29 0e lds r21, 0x0E29 ; 0x800e29 22460: c7 01 movw r24, r14 22462: b6 01 movw r22, r12 22464: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 22468: 69 83 std Y+1, r22 ; 0x01 2246a: 7a 83 std Y+2, r23 ; 0x02 2246c: 8b 83 std Y+3, r24 ; 0x03 2246e: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 22470: 20 91 f1 05 lds r18, 0x05F1 ; 0x8005f1 22474: 30 91 f2 05 lds r19, 0x05F2 ; 0x8005f2 22478: 40 91 f3 05 lds r20, 0x05F3 ; 0x8005f3 2247c: 50 91 f4 05 lds r21, 0x05F4 ; 0x8005f4 22480: c7 01 movw r24, r14 22482: b6 01 movw r22, r12 22484: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 22488: 4b 01 movw r8, r22 2248a: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 2248c: 20 91 b3 04 lds r18, 0x04B3 ; 0x8004b3 <_ZL14iState_sum_min.lto_priv.470> 22490: 2d 87 std Y+13, r18 ; 0x0d 22492: 30 91 b4 04 lds r19, 0x04B4 ; 0x8004b4 <_ZL14iState_sum_min.lto_priv.470+0x1> 22496: 39 87 std Y+9, r19 ; 0x09 22498: 10 91 b5 04 lds r17, 0x04B5 ; 0x8004b5 <_ZL14iState_sum_min.lto_priv.470+0x2> 2249c: 00 91 b6 04 lds r16, 0x04B6 ; 0x8004b6 <_ZL14iState_sum_min.lto_priv.470+0x3> 224a0: 41 2f mov r20, r17 224a2: 50 2f mov r21, r16 224a4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 224a8: 87 fd sbrc r24, 7 224aa: 17 c0 rjmp .+46 ; 0x224da 224ac: 80 91 af 04 lds r24, 0x04AF ; 0x8004af <_ZL14iState_sum_max.lto_priv.471> 224b0: 8d 87 std Y+13, r24 ; 0x0d 224b2: 90 91 b0 04 lds r25, 0x04B0 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.471+0x1> 224b6: 99 87 std Y+9, r25 ; 0x09 224b8: 10 91 b1 04 lds r17, 0x04B1 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.471+0x2> 224bc: 00 91 b2 04 lds r16, 0x04B2 ; 0x8004b2 <_ZL14iState_sum_max.lto_priv.471+0x3> 224c0: 9c 01 movw r18, r24 224c2: 41 2f mov r20, r17 224c4: 50 2f mov r21, r16 224c6: b4 01 movw r22, r8 224c8: c5 01 movw r24, r10 224ca: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 224ce: 18 16 cp r1, r24 224d0: 24 f0 brlt .+8 ; 0x224da 224d2: 8d 86 std Y+13, r8 ; 0x0d 224d4: 99 86 std Y+9, r9 ; 0x09 224d6: 1a 2d mov r17, r10 224d8: 0b 2d mov r16, r11 224da: 8d 85 ldd r24, Y+13 ; 0x0d 224dc: 99 85 ldd r25, Y+9 ; 0x09 224de: a1 2f mov r26, r17 224e0: b0 2f mov r27, r16 224e2: 80 93 f1 05 sts 0x05F1, r24 ; 0x8005f1 224e6: 90 93 f2 05 sts 0x05F2, r25 ; 0x8005f2 224ea: a0 93 f3 05 sts 0x05F3, r26 ; 0x8005f3 224ee: b0 93 f4 05 sts 0x05F4, r27 ; 0x8005f4 iTerm[e] = cs.Ki * iState_sum[e]; 224f2: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 224f6: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 224fa: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 224fe: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 22502: bc 01 movw r22, r24 22504: 81 2f mov r24, r17 22506: 90 2f mov r25, r16 22508: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2250c: 6d 83 std Y+5, r22 ; 0x05 2250e: 7e 83 std Y+6, r23 ; 0x06 22510: 8f 83 std Y+7, r24 ; 0x07 22512: 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 22514: 20 91 e9 05 lds r18, 0x05E9 ; 0x8005e9 22518: 30 91 ea 05 lds r19, 0x05EA ; 0x8005ea 2251c: 40 91 eb 05 lds r20, 0x05EB ; 0x8005eb 22520: 50 91 ec 05 lds r21, 0x05EC ; 0x8005ec 22524: c3 01 movw r24, r6 22526: b2 01 movw r22, r4 22528: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2252c: 20 91 2e 0e lds r18, 0x0E2E ; 0x800e2e 22530: 30 91 2f 0e lds r19, 0x0E2F ; 0x800e2f 22534: 40 91 30 0e lds r20, 0x0E30 ; 0x800e30 22538: 50 91 31 0e lds r21, 0x0E31 ; 0x800e31 2253c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 22540: 20 ed ldi r18, 0xD0 ; 208 22542: 3c ec ldi r19, 0xCC ; 204 22544: 4c e4 ldi r20, 0x4C ; 76 22546: 5d e3 ldi r21, 0x3D ; 61 22548: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2254c: 4b 01 movw r8, r22 2254e: 5c 01 movw r10, r24 22550: 23 e3 ldi r18, 0x33 ; 51 22552: 33 e3 ldi r19, 0x33 ; 51 22554: 43 e7 ldi r20, 0x73 ; 115 22556: 5f e3 ldi r21, 0x3F ; 63 22558: 60 91 ed 05 lds r22, 0x05ED ; 0x8005ed 2255c: 70 91 ee 05 lds r23, 0x05EE ; 0x8005ee 22560: 80 91 ef 05 lds r24, 0x05EF ; 0x8005ef 22564: 90 91 f0 05 lds r25, 0x05F0 ; 0x8005f0 22568: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2256c: 9b 01 movw r18, r22 2256e: ac 01 movw r20, r24 22570: c5 01 movw r24, r10 22572: b4 01 movw r22, r8 22574: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 22578: 4b 01 movw r8, r22 2257a: 5c 01 movw r10, r24 2257c: 80 92 ed 05 sts 0x05ED, r8 ; 0x8005ed 22580: 90 92 ee 05 sts 0x05EE, r9 ; 0x8005ee 22584: a0 92 ef 05 sts 0x05EF, r10 ; 0x8005ef 22588: b0 92 f0 05 sts 0x05F0, r11 ; 0x8005f0 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) 2258c: 2d 81 ldd r18, Y+5 ; 0x05 2258e: 3e 81 ldd r19, Y+6 ; 0x06 22590: 4f 81 ldd r20, Y+7 ; 0x07 22592: 58 85 ldd r21, Y+8 ; 0x08 22594: 69 81 ldd r22, Y+1 ; 0x01 22596: 7a 81 ldd r23, Y+2 ; 0x02 22598: 8b 81 ldd r24, Y+3 ; 0x03 2259a: 9c 81 ldd r25, Y+4 ; 0x04 2259c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 225a0: a5 01 movw r20, r10 225a2: 94 01 movw r18, r8 225a4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 225a8: 4b 01 movw r8, r22 225aa: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 225ac: 20 e0 ldi r18, 0x00 ; 0 225ae: 30 e0 ldi r19, 0x00 ; 0 225b0: 4f e7 ldi r20, 0x7F ; 127 225b2: 53 e4 ldi r21, 0x43 ; 67 225b4: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 225b8: 20 e0 ldi r18, 0x00 ; 0 225ba: 30 e0 ldi r19, 0x00 ; 0 225bc: 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) { 225be: 18 16 cp r1, r24 225c0: 0c f0 brlt .+2 ; 0x225c4 225c2: 6d c1 rjmp .+730 ; 0x2289e if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 225c4: c7 01 movw r24, r14 225c6: b6 01 movw r22, r12 225c8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 225cc: 18 16 cp r1, r24 225ce: 84 f4 brge .+32 ; 0x225f0 225d0: a7 01 movw r20, r14 225d2: 96 01 movw r18, r12 225d4: 6d 85 ldd r22, Y+13 ; 0x0d 225d6: 79 85 ldd r23, Y+9 ; 0x09 225d8: 81 2f mov r24, r17 225da: 90 2f mov r25, r16 225dc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 225e0: 60 93 f1 05 sts 0x05F1, r22 ; 0x8005f1 225e4: 70 93 f2 05 sts 0x05F2, r23 ; 0x8005f2 225e8: 80 93 f3 05 sts 0x05F3, r24 ; 0x8005f3 225ec: 90 93 f4 05 sts 0x05F4, r25 ; 0x8005f4 pid_output=PID_MAX; 225f0: 81 2c mov r8, r1 225f2: 91 2c mov r9, r1 225f4: 3f e7 ldi r19, 0x7F ; 127 225f6: a3 2e mov r10, r19 225f8: 33 e4 ldi r19, 0x43 ; 67 225fa: 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; 225fc: 40 92 e9 05 sts 0x05E9, r4 ; 0x8005e9 22600: 50 92 ea 05 sts 0x05EA, r5 ; 0x8005ea 22604: 60 92 eb 05 sts 0x05EB, r6 ; 0x8005eb 22608: 70 92 ec 05 sts 0x05EC, r7 ; 0x8005ec pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 2260c: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.472> 22610: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.472+0x1> 22614: 07 2e mov r0, r23 22616: 00 0c add r0, r0 22618: 88 0b sbc r24, r24 2261a: 99 0b sbc r25, r25 2261c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 22620: 9b 01 movw r18, r22 22622: ac 01 movw r20, r24 22624: c3 01 movw r24, r6 22626: b2 01 movw r22, r4 22628: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2262c: 87 ff sbrs r24, 7 2262e: 57 c1 rjmp .+686 ; 0x228de 22630: 23 28 or r2, r3 22632: 09 f4 brne .+2 ; 0x22636 22634: 54 c1 rjmp .+680 ; 0x228de soft_pwm[e] = (int)pid_output >> 1; 22636: c5 01 movw r24, r10 22638: b4 01 movw r22, r8 2263a: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2263e: 75 95 asr r23 22640: 67 95 ror r22 22642: 60 93 16 05 sts 0x0516, r22 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 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); 22646: 20 91 17 06 lds r18, 0x0617 ; 0x800617 2264a: 30 91 18 06 lds r19, 0x0618 ; 0x800618 2264e: 3a 83 std Y+2, r19 ; 0x02 22650: 29 83 std Y+1, r18 ; 0x01 22652: 40 90 19 06 lds r4, 0x0619 ; 0x800619 22656: 50 90 1a 06 lds r5, 0x061A ; 0x80061a 2265a: 60 90 1b 06 lds r6, 0x061B ; 0x80061b 2265e: 70 90 1c 06 lds r7, 0x061C ; 0x80061c #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 22662: b9 01 movw r22, r18 22664: 33 0f add r19, r19 22666: 88 0b sbc r24, r24 22668: 99 0b sbc r25, r25 2266a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2266e: a3 01 movw r20, r6 22670: 92 01 movw r18, r4 22672: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 22676: 6b 01 movw r12, r22 22678: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 2267a: 20 91 32 0e lds r18, 0x0E32 ; 0x800e32 2267e: 30 91 33 0e lds r19, 0x0E33 ; 0x800e33 22682: 40 91 34 0e lds r20, 0x0E34 ; 0x800e34 22686: 50 91 35 0e lds r21, 0x0E35 ; 0x800e35 2268a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2268e: 6d 83 std Y+5, r22 ; 0x05 22690: 7e 83 std Y+6, r23 ; 0x06 22692: 8f 83 std Y+7, r24 ; 0x07 22694: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 22696: 20 91 fe 05 lds r18, 0x05FE ; 0x8005fe 2269a: 30 91 ff 05 lds r19, 0x05FF ; 0x8005ff 2269e: 40 91 00 06 lds r20, 0x0600 ; 0x800600 226a2: 50 91 01 06 lds r21, 0x0601 ; 0x800601 226a6: c7 01 movw r24, r14 226a8: b6 01 movw r22, r12 226aa: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 226ae: 5b 01 movw r10, r22 226b0: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 226b2: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab <_ZL19temp_iState_min_bed.lto_priv.468> 226b6: 3e 87 std Y+14, r19 ; 0x0e 226b8: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac <_ZL19temp_iState_min_bed.lto_priv.468+0x1> 226bc: 8d 87 std Y+13, r24 ; 0x0d 226be: 30 90 ad 04 lds r3, 0x04AD ; 0x8004ad <_ZL19temp_iState_min_bed.lto_priv.468+0x2> 226c2: 20 90 ae 04 lds r2, 0x04AE ; 0x8004ae <_ZL19temp_iState_min_bed.lto_priv.468+0x3> 226c6: 23 2f mov r18, r19 226c8: 38 2f mov r19, r24 226ca: 43 2d mov r20, r3 226cc: 52 2d mov r21, r2 226ce: b5 01 movw r22, r10 226d0: c8 01 movw r24, r16 226d2: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 226d6: 87 fd sbrc r24, 7 226d8: 18 c0 rjmp .+48 ; 0x2270a 226da: 90 91 a7 04 lds r25, 0x04A7 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.469> 226de: 9e 87 std Y+14, r25 ; 0x0e 226e0: 20 91 a8 04 lds r18, 0x04A8 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.469+0x1> 226e4: 2d 87 std Y+13, r18 ; 0x0d 226e6: 30 90 a9 04 lds r3, 0x04A9 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.469+0x2> 226ea: 20 90 aa 04 lds r2, 0x04AA ; 0x8004aa <_ZL19temp_iState_max_bed.lto_priv.469+0x3> 226ee: 29 2f mov r18, r25 226f0: 3d 85 ldd r19, Y+13 ; 0x0d 226f2: 43 2d mov r20, r3 226f4: 52 2d mov r21, r2 226f6: b5 01 movw r22, r10 226f8: c8 01 movw r24, r16 226fa: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 226fe: 18 16 cp r1, r24 22700: 24 f0 brlt .+8 ; 0x2270a 22702: ae 86 std Y+14, r10 ; 0x0e 22704: bd 86 std Y+13, r11 ; 0x0d 22706: 30 2e mov r3, r16 22708: 21 2e mov r2, r17 2270a: 8e 85 ldd r24, Y+14 ; 0x0e 2270c: 9d 85 ldd r25, Y+13 ; 0x0d 2270e: a3 2d mov r26, r3 22710: b2 2d mov r27, r2 22712: 80 93 fe 05 sts 0x05FE, r24 ; 0x8005fe 22716: 90 93 ff 05 sts 0x05FF, r25 ; 0x8005ff 2271a: a0 93 00 06 sts 0x0600, r26 ; 0x800600 2271e: b0 93 01 06 sts 0x0601, r27 ; 0x800601 iTerm_bed = cs.bedKi * temp_iState_bed; 22722: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 22726: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 2272a: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 2272e: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 22732: bc 01 movw r22, r24 22734: 83 2d mov r24, r3 22736: 92 2d mov r25, r2 22738: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2273c: 69 87 std Y+9, r22 ; 0x09 2273e: 7a 87 std Y+10, r23 ; 0x0a 22740: 8b 87 std Y+11, r24 ; 0x0b 22742: 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); 22744: 20 91 fa 05 lds r18, 0x05FA ; 0x8005fa 22748: 30 91 fb 05 lds r19, 0x05FB ; 0x8005fb 2274c: 40 91 fc 05 lds r20, 0x05FC ; 0x8005fc 22750: 50 91 fd 05 lds r21, 0x05FD ; 0x8005fd 22754: c3 01 movw r24, r6 22756: b2 01 movw r22, r4 22758: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2275c: 20 91 3a 0e lds r18, 0x0E3A ; 0x800e3a 22760: 30 91 3b 0e lds r19, 0x0E3B ; 0x800e3b 22764: 40 91 3c 0e lds r20, 0x0E3C ; 0x800e3c 22768: 50 91 3d 0e lds r21, 0x0E3D ; 0x800e3d 2276c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 22770: 20 ed ldi r18, 0xD0 ; 208 22772: 3c ec ldi r19, 0xCC ; 204 22774: 4c e4 ldi r20, 0x4C ; 76 22776: 5d e3 ldi r21, 0x3D ; 61 22778: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2277c: 4b 01 movw r8, r22 2277e: 5c 01 movw r10, r24 22780: 23 e3 ldi r18, 0x33 ; 51 22782: 33 e3 ldi r19, 0x33 ; 51 22784: 43 e7 ldi r20, 0x73 ; 115 22786: 5f e3 ldi r21, 0x3F ; 63 22788: 60 91 f6 05 lds r22, 0x05F6 ; 0x8005f6 2278c: 70 91 f7 05 lds r23, 0x05F7 ; 0x8005f7 22790: 80 91 f8 05 lds r24, 0x05F8 ; 0x8005f8 22794: 90 91 f9 05 lds r25, 0x05F9 ; 0x8005f9 22798: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2279c: 9b 01 movw r18, r22 2279e: ac 01 movw r20, r24 227a0: c5 01 movw r24, r10 227a2: b4 01 movw r22, r8 227a4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 227a8: 4b 01 movw r8, r22 227aa: 5c 01 movw r10, r24 227ac: 80 92 f6 05 sts 0x05F6, r8 ; 0x8005f6 227b0: 90 92 f7 05 sts 0x05F7, r9 ; 0x8005f7 227b4: a0 92 f8 05 sts 0x05F8, r10 ; 0x8005f8 227b8: b0 92 f9 05 sts 0x05F9, r11 ; 0x8005f9 temp_dState_bed = pid_input; 227bc: 40 92 fa 05 sts 0x05FA, r4 ; 0x8005fa 227c0: 50 92 fb 05 sts 0x05FB, r5 ; 0x8005fb 227c4: 60 92 fc 05 sts 0x05FC, r6 ; 0x8005fc 227c8: 70 92 fd 05 sts 0x05FD, r7 ; 0x8005fd pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 227cc: 29 85 ldd r18, Y+9 ; 0x09 227ce: 3a 85 ldd r19, Y+10 ; 0x0a 227d0: 4b 85 ldd r20, Y+11 ; 0x0b 227d2: 5c 85 ldd r21, Y+12 ; 0x0c 227d4: 6d 81 ldd r22, Y+5 ; 0x05 227d6: 7e 81 ldd r23, Y+6 ; 0x06 227d8: 8f 81 ldd r24, Y+7 ; 0x07 227da: 98 85 ldd r25, Y+8 ; 0x08 227dc: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 227e0: a5 01 movw r20, r10 227e2: 94 01 movw r18, r8 227e4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 227e8: 4b 01 movw r8, r22 227ea: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 227ec: 20 e0 ldi r18, 0x00 ; 0 227ee: 30 e0 ldi r19, 0x00 ; 0 227f0: 4f e7 ldi r20, 0x7F ; 127 227f2: 53 e4 ldi r21, 0x43 ; 67 227f4: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 227f8: 20 e0 ldi r18, 0x00 ; 0 227fa: 30 e0 ldi r19, 0x00 ; 0 227fc: 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) { 227fe: 18 16 cp r1, r24 22800: 0c f0 brlt .+2 ; 0x22804 22802: 70 c0 rjmp .+224 ; 0x228e4 if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 22804: c7 01 movw r24, r14 22806: b6 01 movw r22, r12 22808: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2280c: 18 16 cp r1, r24 2280e: 84 f4 brge .+32 ; 0x22830 22810: a7 01 movw r20, r14 22812: 96 01 movw r18, r12 22814: 6e 85 ldd r22, Y+14 ; 0x0e 22816: 7d 85 ldd r23, Y+13 ; 0x0d 22818: 83 2d mov r24, r3 2281a: 92 2d mov r25, r2 2281c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 22820: 60 93 fe 05 sts 0x05FE, r22 ; 0x8005fe 22824: 70 93 ff 05 sts 0x05FF, r23 ; 0x8005ff 22828: 80 93 00 06 sts 0x0600, r24 ; 0x800600 2282c: 90 93 01 06 sts 0x0601, r25 ; 0x800601 pid_output=MAX_BED_POWER; 22830: 81 2c mov r8, r1 22832: 91 2c mov r9, r1 22834: 9f e7 ldi r25, 0x7F ; 127 22836: a9 2e mov r10, r25 22838: 93 e4 ldi r25, 0x43 ; 67 2283a: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 2283c: 20 e0 ldi r18, 0x00 ; 0 2283e: 30 e0 ldi r19, 0x00 ; 0 22840: 4a ef ldi r20, 0xFA ; 250 22842: 52 e4 ldi r21, 0x42 ; 66 22844: c3 01 movw r24, r6 22846: b2 01 movw r22, r4 22848: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2284c: 87 ff sbrs r24, 7 2284e: 6d c0 rjmp .+218 ; 0x2292a { soft_pwm_bed = (int)pid_output >> 1; 22850: c5 01 movw r24, r10 22852: b4 01 movw r22, r8 22854: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 22858: 75 95 asr r23 2285a: 67 95 ror r22 2285c: 60 93 1d 06 sts 0x061D, r22 ; 0x80061d soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 22860: 89 81 ldd r24, Y+1 ; 0x01 22862: 9a 81 ldd r25, Y+2 ; 0x02 22864: 89 2b or r24, r25 22866: 11 f4 brne .+4 ; 0x2286c { soft_pwm_bed = 0; 22868: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d 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); } 2286c: 2e 96 adiw r28, 0x0e ; 14 2286e: 0f b6 in r0, 0x3f ; 63 22870: f8 94 cli 22872: de bf out 0x3e, r29 ; 62 22874: 0f be out 0x3f, r0 ; 63 22876: cd bf out 0x3d, r28 ; 61 22878: df 91 pop r29 2287a: cf 91 pop r28 2287c: 1f 91 pop r17 2287e: 0f 91 pop r16 22880: ff 90 pop r15 22882: ef 90 pop r14 22884: df 90 pop r13 22886: cf 90 pop r12 22888: bf 90 pop r11 2288a: af 90 pop r10 2288c: 9f 90 pop r9 2288e: 8f 90 pop r8 22890: 7f 90 pop r7 22892: 6f 90 pop r6 22894: 5f 90 pop r5 22896: 4f 90 pop r4 22898: 3f 90 pop r3 2289a: 2f 90 pop r2 2289c: 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) { 2289e: c5 01 movw r24, r10 228a0: b4 01 movw r22, r8 228a2: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 228a6: 87 ff sbrs r24, 7 228a8: a9 ce rjmp .-686 ; 0x225fc if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 228aa: 20 e0 ldi r18, 0x00 ; 0 228ac: 30 e0 ldi r19, 0x00 ; 0 228ae: a9 01 movw r20, r18 228b0: c7 01 movw r24, r14 228b2: b6 01 movw r22, r12 228b4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 228b8: 87 ff sbrs r24, 7 228ba: a3 cd rjmp .-1210 ; 0x22402 228bc: a7 01 movw r20, r14 228be: 96 01 movw r18, r12 228c0: 6d 85 ldd r22, Y+13 ; 0x0d 228c2: 79 85 ldd r23, Y+9 ; 0x09 228c4: 81 2f mov r24, r17 228c6: 90 2f mov r25, r16 228c8: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 228cc: 60 93 f1 05 sts 0x05F1, r22 ; 0x8005f1 228d0: 70 93 f2 05 sts 0x05F2, r23 ; 0x8005f2 228d4: 80 93 f3 05 sts 0x05F3, r24 ; 0x8005f3 228d8: 90 93 f4 05 sts 0x05F4, r25 ; 0x8005f4 228dc: 92 cd rjmp .-1244 ; 0x22402 // 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; 228de: 10 92 16 05 sts 0x0516, r1 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 228e2: b1 ce rjmp .-670 ; 0x22646 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){ 228e4: c5 01 movw r24, r10 228e6: b4 01 movw r22, r8 228e8: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 228ec: 87 ff sbrs r24, 7 228ee: a6 cf rjmp .-180 ; 0x2283c if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 228f0: 20 e0 ldi r18, 0x00 ; 0 228f2: 30 e0 ldi r19, 0x00 ; 0 228f4: a9 01 movw r20, r18 228f6: c7 01 movw r24, r14 228f8: b6 01 movw r22, r12 228fa: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 228fe: 87 ff sbrs r24, 7 22900: 10 c0 rjmp .+32 ; 0x22922 22902: a7 01 movw r20, r14 22904: 96 01 movw r18, r12 22906: 6e 85 ldd r22, Y+14 ; 0x0e 22908: 7d 85 ldd r23, Y+13 ; 0x0d 2290a: 83 2d mov r24, r3 2290c: 92 2d mov r25, r2 2290e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 22912: 60 93 fe 05 sts 0x05FE, r22 ; 0x8005fe 22916: 70 93 ff 05 sts 0x05FF, r23 ; 0x8005ff 2291a: 80 93 00 06 sts 0x0600, r24 ; 0x800600 2291e: 90 93 01 06 sts 0x0601, r25 ; 0x800601 pid_output=0; 22922: 81 2c mov r8, r1 22924: 91 2c mov r9, r1 22926: 54 01 movw r10, r8 22928: 89 cf rjmp .-238 ; 0x2283c { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 2292a: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d 2292e: 98 cf rjmp .-208 ; 0x22860 00022930 : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 22934: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 22938: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 2293c: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e target_temperature_bed_isr = target_temperature_bed; 22940: 80 91 72 06 lds r24, 0x0672 ; 0x800672 22944: 90 91 73 06 lds r25, 0x0673 ; 0x800673 22948: 90 93 18 06 sts 0x0618, r25 ; 0x800618 2294c: 80 93 17 06 sts 0x0617, r24 ; 0x800617 } 22950: 08 95 ret 00022952 : { // 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) 22952: 81 30 cpi r24, 0x01 ; 1 22954: 41 f1 breq .+80 ; 0x229a6 22956: 20 f0 brcs .+8 ; 0x22960 22958: 82 30 cpi r24, 0x02 ; 2 2295a: 09 f4 brne .+2 ; 0x2295e 2295c: 45 c0 rjmp .+138 ; 0x229e8 2295e: 08 95 ret { case X_AXIS: { enable_x(); 22960: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); 22962: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 22966: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 22968: 91 e0 ldi r25, 0x01 ; 1 2296a: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 2296c: 86 17 cp r24, r22 2296e: 59 f0 breq .+22 ; 0x22986 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 22970: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22974: 66 23 and r22, r22 22976: 89 f0 breq .+34 ; 0x2299a 22978: 91 60 ori r25, 0x01 ; 1 2297a: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 2297e: eb e4 ldi r30, 0x4B ; 75 22980: f0 e0 ldi r31, 0x00 ; 0 22982: 31 97 sbiw r30, 0x01 ; 1 22984: f1 f7 brne .-4 ; 0x22982 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 22986: 91 e0 ldi r25, 0x01 ; 1 22988: 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); 2298a: 88 23 and r24, r24 2298c: 41 f0 breq .+16 ; 0x2299e 2298e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22992: 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); 22994: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 22998: 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); 2299a: 9e 7f andi r25, 0xFE ; 254 2299c: ee cf rjmp .-36 ; 0x2297a #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); 2299e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 229a2: 8e 7f andi r24, 0xFE ; 254 229a4: f7 cf rjmp .-18 ; 0x22994 } break; case Y_AXIS: { enable_y(); 229a6: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); 229a8: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 229ac: 81 e0 ldi r24, 0x01 ; 1 229ae: 29 2f mov r18, r25 229b0: 22 70 andi r18, 0x02 ; 2 229b2: 91 ff sbrs r25, 1 229b4: 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) { 229b6: 86 17 cp r24, r22 229b8: 59 f0 breq .+22 ; 0x229d0 WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 229ba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 229be: 66 23 and r22, r22 229c0: 79 f0 breq .+30 ; 0x229e0 229c2: 82 60 ori r24, 0x02 ; 2 229c4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 229c8: 8b e4 ldi r24, 0x4B ; 75 229ca: 90 e0 ldi r25, 0x00 ; 0 229cc: 01 97 sbiw r24, 0x01 ; 1 229ce: f1 f7 brne .-4 ; 0x229cc delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 229d0: 82 e0 ldi r24, 0x02 ; 2 229d2: 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); 229d4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 229d8: 22 23 and r18, r18 229da: 21 f0 breq .+8 ; 0x229e4 229dc: 82 60 ori r24, 0x02 ; 2 229de: da cf rjmp .-76 ; 0x22994 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); 229e0: 8d 7f andi r24, 0xFD ; 253 229e2: f0 cf rjmp .-32 ; 0x229c4 #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); 229e4: 8d 7f andi r24, 0xFD ; 253 229e6: d6 cf rjmp .-84 ; 0x22994 } break; case Z_AXIS: { enable_z(); 229e8: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); 229ea: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 229ee: 81 e0 ldi r24, 0x01 ; 1 229f0: 29 2f mov r18, r25 229f2: 24 70 andi r18, 0x04 ; 4 229f4: 92 ff sbrs r25, 2 229f6: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 229f8: 91 e0 ldi r25, 0x01 ; 1 229fa: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 229fc: 86 17 cp r24, r22 229fe: 59 f0 breq .+22 ; 0x22a16 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 22a00: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22a04: 66 23 and r22, r22 22a06: 91 f0 breq .+36 ; 0x22a2c 22a08: 94 60 ori r25, 0x04 ; 4 22a0a: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22a0e: eb e4 ldi r30, 0x4B ; 75 22a10: f0 e0 ldi r31, 0x00 ; 0 22a12: 31 97 sbiw r30, 0x01 ; 1 22a14: f1 f7 brne .-4 ; 0x22a12 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 22a16: 94 e0 ldi r25, 0x04 ; 4 22a18: 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) { 22a1a: 86 17 cp r24, r22 22a1c: 09 f4 brne .+2 ; 0x22a20 22a1e: bc cf rjmp .-136 ; 0x22998 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 22a20: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22a24: 22 23 and r18, r18 22a26: 21 f0 breq .+8 ; 0x22a30 22a28: 84 60 ori r24, 0x04 ; 4 22a2a: b4 cf rjmp .-152 ; 0x22994 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); 22a2c: 9b 7f andi r25, 0xFB ; 251 22a2e: ed cf rjmp .-38 ; 0x22a0a 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); 22a30: 8b 7f andi r24, 0xFB ; 251 22a32: b0 cf rjmp .-160 ; 0x22994 00022a34 : } } static void checkRx(void) { if (selectedSerialPort == 0) { 22a34: 80 91 39 05 lds r24, 0x0539 ; 0x800539 22a38: 81 11 cpse r24, r1 22a3a: 25 c0 rjmp .+74 ; 0x22a86 if((M_UCSRxA & (1< 22a40: 87 ff sbrs r24, 7 22a42: 3d c0 rjmp .+122 ; 0x22abe // Test for a framing error. if (M_UCSRxA & (1< 22a48: 84 ff sbrs r24, 4 22a4a: 03 c0 rjmp .+6 ; 0x22a52 // 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); 22a4c: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 22a50: 08 95 ret } else { unsigned char c = M_UDRx; 22a52: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 22a56: 20 91 99 04 lds r18, 0x0499 ; 0x800499 22a5a: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 22a5e: c9 01 movw r24, r18 22a60: 01 96 adiw r24, 0x01 ; 1 22a62: 8f 77 andi r24, 0x7F ; 127 22a64: 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) { 22a66: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 22a6a: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 22a6e: 86 17 cp r24, r22 22a70: 97 07 cpc r25, r23 22a72: 29 f1 breq .+74 ; 0x22abe // 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; 22a74: 27 5e subi r18, 0xE7 ; 231 22a76: 3b 4f sbci r19, 0xFB ; 251 22a78: f9 01 movw r30, r18 22a7a: 40 83 st Z, r20 rx_buffer.head = i; 22a7c: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 22a80: 80 93 99 04 sts 0x0499, r24 ; 0x800499 22a84: 1c c0 rjmp .+56 ; 0x22abe UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 22a8a: 87 ff sbrs r24, 7 22a8c: 18 c0 rjmp .+48 ; 0x22abe // Test for a framing error. if (UCSR1A & (1< 22a92: 84 ff sbrs r24, 4 22a94: 03 c0 rjmp .+6 ; 0x22a9c // 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); 22a96: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 22a9a: 08 95 ret } else { unsigned char c = UDR1; 22a9c: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 22aa0: 20 91 99 04 lds r18, 0x0499 ; 0x800499 22aa4: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 22aa8: c9 01 movw r24, r18 22aaa: 01 96 adiw r24, 0x01 ; 1 22aac: 8f 77 andi r24, 0x7F ; 127 22aae: 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) { 22ab0: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 22ab4: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 22ab8: 68 17 cp r22, r24 22aba: 79 07 cpc r23, r25 22abc: d9 f6 brne .-74 ; 0x22a74 M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 22abe: 08 95 ret 00022ac0 : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 22ac0: 23 e0 ldi r18, 0x03 ; 3 22ac2: 81 11 cpse r24, r1 22ac4: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 22ad8: 94 60 ori r25, 0x04 ; 4 22ada: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22ade: 3f bf out 0x3f, r19 ; 63 22ae0: fb 01 movw r30, r22 22ae2: 31 97 sbiw r30, 0x01 ; 1 22ae4: f1 f7 brne .-4 ; 0x22ae2 delayMicroseconds(200); WRITE(BEEPER,LOW); 22ae6: 3f b7 in r19, 0x3f ; 63 22ae8: f8 94 cli 22aea: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22aee: 9b 7f andi r25, 0xFB ; 251 22af0: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22af4: 3f bf out 0x3f, r19 ; 63 22af6: fa 01 movw r30, r20 22af8: 31 97 sbiw r30, 0x01 ; 1 22afa: f1 f7 brne .-4 ; 0x22af8 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); } } 22b02: 08 95 ret 00022b04 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 22b04: 8a e0 ldi r24, 0x0A ; 10 22b06: 2b e8 ldi r18, 0x8B ; 139 22b08: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 22b0a: 4f b7 in r20, 0x3f ; 63 22b0c: f8 94 cli 22b0e: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22b12: 94 60 ori r25, 0x04 ; 4 22b14: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22b18: 4f bf out 0x3f, r20 ; 63 22b1a: f9 01 movw r30, r18 22b1c: 31 97 sbiw r30, 0x01 ; 1 22b1e: f1 f7 brne .-4 ; 0x22b1c delayMicroseconds(100); WRITE(BEEPER,LOW); 22b20: 4f b7 in r20, 0x3f ; 63 22b22: f8 94 cli 22b24: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22b28: 9b 7f andi r25, 0xFB ; 251 22b2a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22b2e: 4f bf out 0x3f, r20 ; 63 22b30: f9 01 movw r30, r18 22b32: 31 97 sbiw r30, 0x01 ; 1 22b34: f1 f7 brne .-4 ; 0x22b32 22b36: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 22b38: 41 f7 brne .-48 ; 0x22b0a WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 22b3a: 08 95 ret 00022b3c : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 22b3c: 85 e6 ldi r24, 0x65 ; 101 22b3e: 9e e6 ldi r25, 0x6E ; 110 22b40: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 00022b44 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 22b44: 60 91 38 02 lds r22, 0x0238 ; 0x800238 22b48: 81 e0 ldi r24, 0x01 ; 1 22b4a: 68 27 eor r22, r24 22b4c: 60 93 38 02 sts 0x0238, r22 ; 0x800238 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 22b50: 87 e8 ldi r24, 0x87 ; 135 22b52: 9f e0 ldi r25, 0x0F ; 15 22b54: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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. 22b58: 80 91 38 02 lds r24, 0x0238 ; 0x800238 22b5c: 81 11 cpse r24, r1 22b5e: 02 c0 rjmp .+4 ; 0x22b64 22b60: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 #endif //FANCHECK } 22b64: 08 95 ret 00022b66 : * 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) { 22b66: af 92 push r10 22b68: bf 92 push r11 22b6a: cf 92 push r12 22b6c: df 92 push r13 22b6e: ef 92 push r14 22b70: ff 92 push r15 22b72: 0f 93 push r16 22b74: 1f 93 push r17 22b76: cf 93 push r28 22b78: df 93 push r29 22b7a: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 22b7c: 0e 94 14 6e call 0xdc28 ; 0xdc28 * @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; 22b80: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 22b82: 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; 22b84: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 22b86: 6f 2d mov r22, r15 22b88: 80 e0 ldi r24, 0x00 ; 0 22b8a: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 // 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) 22b8e: c6 01 movw r24, r12 22b90: 0f 94 21 11 call 0x22242 ; 0x22242 22b94: 88 23 and r24, r24 22b96: 29 f0 breq .+10 ; 0x22ba2 22b98: 8f ef ldi r24, 0xFF ; 255 22b9a: c8 1a sub r12, r24 22b9c: d8 0a sbc r13, r24 22b9e: 09 f4 brne .+2 ; 0x22ba2 22ba0: 49 c0 rjmp .+146 ; 0x22c34 22ba2: c6 01 movw r24, r12 22ba4: 0f 94 12 da call 0x3b424 ; 0x3b424 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 22ba8: 84 31 cpi r24, 0x14 ; 20 22baa: 91 05 cpc r25, r1 22bac: 10 f0 brcs .+4 ; 0x22bb2 22bae: 84 e1 ldi r24, 0x14 ; 20 22bb0: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 22bb2: e6 01 movw r28, r12 22bb4: c8 0f add r28, r24 22bb6: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 22bb8: e3 e0 ldi r30, 0x03 ; 3 22bba: fe 12 cpse r15, r30 22bbc: 0a c0 rjmp .+20 ; 0x22bd2 22bbe: 84 31 cpi r24, 0x14 ; 20 22bc0: 41 f4 brne .+16 ; 0x22bd2 // 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; 22bc2: fe 01 movw r30, r28 22bc4: 84 91 lpm r24, Z 22bc6: e1 2c mov r14, r1 if (multi_screen) 22bc8: 88 23 and r24, r24 22bca: 19 f0 breq .+6 ; 0x22bd2 msgend = (msgend2 -= 2); 22bcc: 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; 22bce: ee 24 eor r14, r14 22bd0: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 22bd2: fe 01 movw r30, r28 22bd4: 84 91 lpm r24, Z 22bd6: 88 23 and r24, r24 22bd8: 09 f4 brne .+2 ; 0x22bdc 22bda: 40 c0 rjmp .+128 ; 0x22c5c 22bdc: ce 01 movw r24, r28 22bde: 0f 94 21 11 call 0x22242 ; 0x22242 22be2: 81 11 cpse r24, r1 22be4: 3b c0 rjmp .+118 ; 0x22c5c 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); 22be6: fe 01 movw r30, r28 22be8: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 22bea: 92 ed ldi r25, 0xD2 ; 210 22bec: 98 0f add r25, r24 22bee: 92 30 cpi r25, 0x02 ; 2 22bf0: a8 f1 brcs .+106 ; 0x22c5c 22bf2: 8c 32 cpi r24, 0x2C ; 44 22bf4: 99 f1 breq .+102 ; 0x22c5c 22bf6: 96 ec ldi r25, 0xC6 ; 198 22bf8: 98 0f add r25, r24 22bfa: 92 30 cpi r25, 0x02 ; 2 22bfc: 78 f1 brcs .+94 ; 0x22c5c 22bfe: 8f 33 cpi r24, 0x3F ; 63 22c00: 69 f1 breq .+90 ; 0x22c5c 22c02: 81 32 cpi r24, 0x21 ; 33 22c04: 59 f1 breq .+86 ; 0x22c5c 22c06: 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)) 22c08: c0 16 cp r12, r16 22c0a: d1 06 cpc r13, r17 22c0c: 58 f4 brcc .+22 ; 0x22c24 22c0e: 58 01 movw r10, r16 22c10: f1 e0 ldi r31, 0x01 ; 1 22c12: af 1a sub r10, r31 22c14: b1 08 sbc r11, r1 22c16: c5 01 movw r24, r10 22c18: 0f 94 21 11 call 0x22242 ; 0x22242 22c1c: 81 11 cpse r24, r1 22c1e: 1d c0 rjmp .+58 ; 0x22c5a -- msgend; 22c20: 85 01 movw r16, r10 22c22: f2 cf rjmp .-28 ; 0x22c08 if (msgend == msg) 22c24: c0 16 cp r12, r16 22c26: d1 06 cpc r13, r17 22c28: c9 f0 breq .+50 ; 0x22c5c 22c2a: 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) { 22c2c: f3 94 inc r15 22c2e: 84 e0 ldi r24, 0x04 ; 4 22c30: f8 12 cpse r15, r24 22c32: a9 cf rjmp .-174 ; 0x22b86 } lcd_print(c); } } if (multi_screen) { 22c34: ee 20 and r14, r14 22c36: f9 f0 breq .+62 ; 0x22c76 // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 22c38: 48 e8 ldi r20, 0x88 ; 136 22c3a: 63 e0 ldi r22, 0x03 ; 3 22c3c: 83 e1 ldi r24, 0x13 ; 19 22c3e: 0e 94 80 6e call 0xdd00 ; 0xdd00 } return multi_screen ? msgend : NULL; } 22c42: ce 01 movw r24, r28 22c44: df 91 pop r29 22c46: cf 91 pop r28 22c48: 1f 91 pop r17 22c4a: 0f 91 pop r16 22c4c: ff 90 pop r15 22c4e: ef 90 pop r14 22c50: df 90 pop r13 22c52: cf 90 pop r12 22c54: bf 90 pop r11 22c56: af 90 pop r10 22c58: 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)) 22c5a: 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) { 22c5c: cc 16 cp r12, r28 22c5e: dd 06 cpc r13, r29 22c60: 28 f7 brcc .-54 ; 0x22c2c char c = char(pgm_read_byte(msg)); 22c62: f6 01 movw r30, r12 22c64: 84 91 lpm r24, Z if (c == '\n') { 22c66: 8a 30 cpi r24, 0x0A ; 10 22c68: 09 f3 breq .-62 ; 0x22c2c 22c6a: 0e 94 0f 6f call 0xde1e ; 0xde1e -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 22c6e: ff ef ldi r31, 0xFF ; 255 22c70: cf 1a sub r12, r31 22c72: df 0a sbc r13, r31 22c74: f3 cf rjmp .-26 ; 0x22c5c if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 22c76: d0 e0 ldi r29, 0x00 ; 0 22c78: c0 e0 ldi r28, 0x00 ; 0 22c7a: e3 cf rjmp .-58 ; 0x22c42 00022c7c : #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){ 22c7c: cf 93 push r28 22c7e: df 93 push r29 22c80: cd b7 in r28, 0x3d ; 61 22c82: de b7 in r29, 0x3e ; 62 22c84: 2f 97 sbiw r28, 0x0f ; 15 22c86: 0f b6 in r0, 0x3f ; 63 22c88: f8 94 cli 22c8a: de bf out 0x3e, r29 ; 62 22c8c: 0f be out 0x3f, r0 ; 63 22c8e: cd bf out 0x3d, r28 ; 61 22c90: fc 01 movw r30, r24 22c92: de 01 movw r26, r28 22c94: 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; 22c96: 90 e0 ldi r25, 0x00 ; 0 22c98: 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); 22c9a: 84 91 lpm r24, Z 22c9c: 41 e0 ldi r20, 0x01 ; 1 22c9e: 49 0f add r20, r25 if( ! b ) 22ca0: 88 23 and r24, r24 22ca2: 29 f0 breq .+10 ; 0x22cae break; dst[i] = b; 22ca4: 8d 93 st X+, r24 22ca6: 31 96 adiw r30, 0x01 ; 1 22ca8: 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 22caa: 4d 30 cpi r20, 0x0D ; 13 22cac: b1 f7 brne .-20 ; 0x22c9a uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 22cae: f9 01 movw r30, r18 22cb0: e9 0f add r30, r25 22cb2: f1 1d adc r31, r1 22cb4: 8a e3 ldi r24, 0x3A ; 58 22cb6: 80 83 st Z, r24 ++i; 22cb8: 9f 5f subi r25, 0xFF ; 255 22cba: f9 01 movw r30, r18 22cbc: e9 0f add r30, r25 22cbe: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 22cc0: 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 22cc2: 9e 30 cpi r25, 0x0E ; 14 22cc4: 19 f0 breq .+6 ; 0x22ccc dst[i] = ' '; 22cc6: 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 22cc8: 9f 5f subi r25, 0xFF ; 255 22cca: fb cf rjmp .-10 ; 0x22cc2 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 22ccc: 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 22cce: 7f 93 push r23 22cd0: 6f 93 push r22 22cd2: 3f 93 push r19 22cd4: 2f 93 push r18 22cd6: 8f e3 ldi r24, 0x3F ; 63 22cd8: 90 ea ldi r25, 0xA0 ; 160 22cda: 9f 93 push r25 22cdc: 8f 93 push r24 22cde: 0e 94 39 6e call 0xdc72 ; 0xdc72 22ce2: 0f 90 pop r0 22ce4: 0f 90 pop r0 22ce6: 0f 90 pop r0 22ce8: 0f 90 pop r0 22cea: 0f 90 pop r0 22cec: 0f 90 pop r0 } 22cee: 2f 96 adiw r28, 0x0f ; 15 22cf0: 0f b6 in r0, 0x3f ; 63 22cf2: f8 94 cli 22cf4: de bf out 0x3e, r29 ; 62 22cf6: 0f be out 0x3f, r0 ; 63 22cf8: cd bf out 0x3d, r28 ; 61 22cfa: df 91 pop r29 22cfc: cf 91 pop r28 22cfe: 08 95 ret 00022d00 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 22d00: ef 92 push r14 22d02: ff 92 push r15 22d04: 0f 93 push r16 22d06: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 22d08: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 22d0c: 81 11 cpse r24, r1 22d0e: 35 c0 rjmp .+106 ; 0x22d7a { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 22d10: 80 ec ldi r24, 0xC0 ; 192 22d12: 9f e0 ldi r25, 0x0F ; 15 22d14: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 22d18: 81 30 cpi r24, 0x01 ; 1 22d1a: 61 f5 brne .+88 ; 0x22d74 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 22d1c: 8f eb ldi r24, 0xBF ; 191 22d1e: 9f e0 ldi r25, 0x0F ; 15 22d20: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 22d24: 08 2e mov r0, r24 22d26: 00 0c add r0, r0 22d28: 99 0b sbc r25, r25 22d2a: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 22d2e: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 22d32: 8e eb ldi r24, 0xBE ; 190 22d34: 9f e0 ldi r25, 0x0F ; 15 22d36: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 22d3a: 08 2e mov r0, r24 22d3c: 00 0c add r0, r0 22d3e: 99 0b sbc r25, r25 22d40: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 22d44: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 22d48: 8d eb ldi r24, 0xBD ; 189 22d4a: 9f e0 ldi r25, 0x0F ; 15 22d4c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 22d50: 08 2e mov r0, r24 22d52: 00 0c add r0, r0 22d54: 99 0b sbc r25, r25 22d56: 90 93 bc 03 sts 0x03BC, r25 ; 0x8003bc 22d5a: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 22d5e: 8c eb ldi r24, 0xBC ; 188 22d60: 9f e0 ldi r25, 0x0F ; 15 22d62: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 22d66: 08 2e mov r0, r24 22d68: 00 0c add r0, r0 22d6a: 99 0b sbc r25, r25 22d6c: 90 93 be 03 sts 0x03BE, r25 ; 0x8003be 22d70: 80 93 bd 03 sts 0x03BD, r24 ; 0x8003bd } _md->status = 1; 22d74: 81 e0 ldi r24, 0x01 ; 1 22d76: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 } MENU_BEGIN(); 22d7a: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 22d7e: 10 92 12 05 sts 0x0512, r1 ; 0x800512 22d82: 80 91 12 05 lds r24, 0x0512 ; 0x800512 22d86: 84 30 cpi r24, 0x04 ; 4 22d88: 08 f0 brcs .+2 ; 0x22d8c 22d8a: 6e c0 rjmp .+220 ; 0x22e68 22d8c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 22d90: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 22d94: 88 23 and r24, r24 22d96: e9 f0 breq .+58 ; 0x22dd2 22d98: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 22d9c: 8f eb ldi r24, 0xBF ; 191 22d9e: 9f e0 ldi r25, 0x0F ; 15 22da0: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 22da4: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 22da8: 8d eb ldi r24, 0xBD ; 189 22daa: 9f e0 ldi r25, 0x0F ; 15 22dac: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 22db0: 60 91 bd 03 lds r22, 0x03BD ; 0x8003bd 22db4: 8c eb ldi r24, 0xBC ; 188 22db6: 9f e0 ldi r25, 0x0F ; 15 22db8: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 22dbc: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 22dc0: 8e eb ldi r24, 0xBE ; 190 22dc2: 9f e0 ldi r25, 0x0F ; 15 22dc4: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 22dc8: 61 e0 ldi r22, 0x01 ; 1 22dca: 80 ec ldi r24, 0xC0 ; 192 22dcc: 9f e0 ldi r25, 0x0F ; 15 22dce: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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)); 22dd2: 8f e4 ldi r24, 0x4F ; 79 22dd4: 99 e4 ldi r25, 0x49 ; 73 22dd6: 0e 94 2c 72 call 0xe458 ; 0xe458 22dda: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22dde: 84 ed ldi r24, 0xD4 ; 212 22de0: 90 e5 ldi r25, 0x50 ; 80 22de2: 0e 94 2c 72 call 0xe458 ; 0xe458 22de6: f1 2c mov r15, r1 22de8: e1 2c mov r14, r1 22dea: 04 e6 ldi r16, 0x64 ; 100 22dec: 10 e0 ldi r17, 0x00 ; 0 22dee: 2c e9 ldi r18, 0x9C ; 156 22df0: 3f ef ldi r19, 0xFF ; 255 22df2: 40 e1 ldi r20, 0x10 ; 16 22df4: 67 eb ldi r22, 0xB7 ; 183 22df6: 73 e0 ldi r23, 0x03 ; 3 22df8: 0f 94 1e d2 call 0x3a43c ; 0x3a43c MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22dfc: 83 ec ldi r24, 0xC3 ; 195 22dfe: 90 e5 ldi r25, 0x50 ; 80 22e00: 0e 94 2c 72 call 0xe458 ; 0xe458 22e04: 2c e9 ldi r18, 0x9C ; 156 22e06: 3f ef ldi r19, 0xFF ; 255 22e08: 40 e1 ldi r20, 0x10 ; 16 22e0a: 69 eb ldi r22, 0xB9 ; 185 22e0c: 73 e0 ldi r23, 0x03 ; 3 22e0e: 0f 94 1e d2 call 0x3a43c ; 0x3a43c MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22e12: 82 eb ldi r24, 0xB2 ; 178 22e14: 90 e5 ldi r25, 0x50 ; 80 22e16: 0e 94 2c 72 call 0xe458 ; 0xe458 22e1a: 2c e9 ldi r18, 0x9C ; 156 22e1c: 3f ef ldi r19, 0xFF ; 255 22e1e: 40 e1 ldi r20, 0x10 ; 16 22e20: 6b eb ldi r22, 0xBB ; 187 22e22: 73 e0 ldi r23, 0x03 ; 3 22e24: 0f 94 1e d2 call 0x3a43c ; 0x3a43c MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22e28: 81 ea ldi r24, 0xA1 ; 161 22e2a: 90 e5 ldi r25, 0x50 ; 80 22e2c: 0e 94 2c 72 call 0xe458 ; 0xe458 22e30: 2c e9 ldi r18, 0x9C ; 156 22e32: 3f ef ldi r19, 0xFF ; 255 22e34: 40 e1 ldi r20, 0x10 ; 16 22e36: 6d eb ldi r22, 0xBD ; 189 22e38: 73 e0 ldi r23, 0x03 ; 3 22e3a: 0f 94 1e d2 call 0x3a43c ; 0x3a43c MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 22e3e: 83 e9 ldi r24, 0x93 ; 147 22e40: 95 e4 ldi r25, 0x45 ; 69 22e42: 0e 94 2c 72 call 0xe458 ; 0xe458 22e46: 68 e5 ldi r22, 0x58 ; 88 22e48: 79 e3 ldi r23, 0x39 ; 57 22e4a: 0f 94 4b d1 call 0x3a296 ; 0x3a296 MENU_END(); 22e4e: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 _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(); 22e52: 80 91 12 05 lds r24, 0x0512 ; 0x800512 22e56: 8f 5f subi r24, 0xFF ; 255 22e58: 80 93 12 05 sts 0x0512, r24 ; 0x800512 22e5c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 22e60: 8f 5f subi r24, 0xFF ; 255 22e62: 80 93 14 05 sts 0x0514, r24 ; 0x800514 22e66: 8d cf rjmp .-230 ; 0x22d82 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(); } 22e68: 1f 91 pop r17 22e6a: 0f 91 pop r16 22e6c: ff 90 pop r15 22e6e: ef 90 pop r14 22e70: 08 95 ret 00022e72 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 22e72: 87 ea ldi r24, 0xA7 ; 167 22e74: 9c e0 ldi r25, 0x0C ; 12 22e76: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 if (eeprom_setting != 0) 22e7a: 81 11 cpse r24, r1 22e7c: 05 c0 rjmp .+10 ; 0x22e88 return false; switch(eFilamentAction) { 22e7e: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 22e82: 81 50 subi r24, 0x01 ; 1 22e84: 88 30 cpi r24, 0x08 ; 8 22e86: 10 f0 brcs .+4 ; 0x22e8c #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; 22e88: 80 e0 ldi r24, 0x00 ; 0 22e8a: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 22e8c: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 22e8e: 08 95 ret 00022e90 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 22e90: 8e ec ldi r24, 0xCE ; 206 22e92: 9e e0 ldi r25, 0x0E ; 14 22e94: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 22e98: 60 e0 ldi r22, 0x00 ; 0 22e9a: 81 30 cpi r24, 0x01 ; 1 22e9c: 09 f0 breq .+2 ; 0x22ea0 22e9e: 61 e0 ldi r22, 0x01 ; 1 22ea0: 8e ec ldi r24, 0xCE ; 206 22ea2: 9e e0 ldi r25, 0x0E ; 14 22ea4: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 00022ea8 : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 22ea8: 86 ed ldi r24, 0xD6 ; 214 22eaa: 9e e0 ldi r25, 0x0E ; 14 22eac: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 22eb0: 61 e0 ldi r22, 0x01 ; 1 22eb2: 82 30 cpi r24, 0x02 ; 2 22eb4: 09 f0 breq .+2 ; 0x22eb8 22eb6: 62 e0 ldi r22, 0x02 ; 2 22eb8: 86 ed ldi r24, 0xD6 ; 214 22eba: 9e e0 ldi r25, 0x0E ; 14 22ebc: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 00022ec0 : } _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(); 22ec0: 0e 94 18 76 call 0xec30 ; 0xec30 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 22ec4: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 } 22ec8: 08 95 ret 00022eca : } #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)); 22eca: 80 e8 ldi r24, 0x80 ; 128 22ecc: 9f e4 ldi r25, 0x4F ; 79 22ece: 0e 94 2c 72 call 0xe458 ; 0xe458 22ed2: 0f 94 b3 15 call 0x22b66 ; 0x22b66 menu_back_if_clicked(); 22ed6: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 00022eda : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 22eda: df 92 push r13 22edc: ef 92 push r14 22ede: ff 92 push r15 22ee0: 0f 93 push r16 22ee2: 1f 93 push r17 22ee4: cf 93 push r28 22ee6: df 93 push r29 22ee8: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22eec: 0e 94 8c 6e call 0xdd18 ; 0xdd18 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] ); 22ef0: c9 ec ldi r28, 0xC9 ; 201 22ef2: d3 e0 ldi r29, 0x03 ; 3 22ef4: 8a 81 ldd r24, Y+2 ; 0x02 22ef6: 9b 81 ldd r25, Y+3 ; 0x03 22ef8: 2c e3 ldi r18, 0x3C ; 60 22efa: f2 2e mov r15, r18 22efc: f8 9e mul r15, r24 22efe: 80 01 movw r16, r0 22f00: f9 9e mul r15, r25 22f02: 10 0d add r17, r0 22f04: 11 24 eor r1, r1 22f06: 86 e8 ldi r24, 0x86 ; 134 22f08: 98 e4 ldi r25, 0x48 ; 72 22f0a: 0e 94 2c 72 call 0xe458 ; 0xe458 22f0e: e8 2e mov r14, r24 22f10: d9 2e mov r13, r25 22f12: 88 81 ld r24, Y 22f14: 99 81 ldd r25, Y+1 ; 0x01 22f16: f8 9e mul r15, r24 22f18: e0 01 movw r28, r0 22f1a: f9 9e mul r15, r25 22f1c: d0 0d add r29, r0 22f1e: 11 24 eor r1, r1 22f20: 83 e9 ldi r24, 0x93 ; 147 22f22: 98 e4 ldi r25, 0x48 ; 72 22f24: 0e 94 2c 72 call 0xe458 ; 0xe458 22f28: 1f 93 push r17 22f2a: 0f 93 push r16 22f2c: df 92 push r13 22f2e: ef 92 push r14 22f30: df 93 push r29 22f32: cf 93 push r28 22f34: 9f 93 push r25 22f36: 8f 93 push r24 22f38: 83 ea ldi r24, 0xA3 ; 163 22f3a: 9f e9 ldi r25, 0x9F ; 159 22f3c: 9f 93 push r25 22f3e: 8f 93 push r24 22f40: 0e 94 39 6e call 0xdc72 ; 0xdc72 menu_back_if_clicked(); 22f44: 8d b7 in r24, 0x3d ; 61 22f46: 9e b7 in r25, 0x3e ; 62 22f48: 0a 96 adiw r24, 0x0a ; 10 22f4a: 0f b6 in r0, 0x3f ; 63 22f4c: f8 94 cli 22f4e: 9e bf out 0x3e, r25 ; 62 22f50: 0f be out 0x3f, r0 ; 63 22f52: 8d bf out 0x3d, r24 ; 61 } 22f54: df 91 pop r29 22f56: cf 91 pop r28 22f58: 1f 91 pop r17 22f5a: 0f 91 pop r16 22f5c: ff 90 pop r15 22f5e: ef 90 pop r14 22f60: 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(); 22f62: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 00022f66 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 22f66: cf 92 push r12 22f68: df 92 push r13 22f6a: ef 92 push r14 22f6c: ff 92 push r15 22f6e: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22f72: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 22f76: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 22f7a: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 22f7e: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 22f82: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 22f86: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 22f8a: 6b 01 movw r12, r22 22f8c: 84 eb ldi r24, 0xB4 ; 180 22f8e: 93 e4 ldi r25, 0x43 ; 67 22f90: 0e 94 2c 72 call 0xe458 ; 0xe458 22f94: b6 01 movw r22, r12 22f96: 0f 94 3e 16 call 0x22c7c ; 0x22c7c lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 22f9a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 22f9e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 22fa2: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 22fa6: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 22faa: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 22fae: 6b 01 movw r12, r22 22fb0: 89 e9 ldi r24, 0x99 ; 153 22fb2: 93 e4 ldi r25, 0x43 ; 67 22fb4: 0e 94 2c 72 call 0xe458 ; 0xe458 22fb8: b6 01 movw r22, r12 22fba: 0f 94 3e 16 call 0x22c7c ; 0x22c7c #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 22fbe: 60 91 56 06 lds r22, 0x0656 ; 0x800656 22fc2: 70 91 57 06 lds r23, 0x0657 ; 0x800657 22fc6: 80 91 58 06 lds r24, 0x0658 ; 0x800658 22fca: 90 91 59 06 lds r25, 0x0659 ; 0x800659 22fce: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 22fd2: 6b 01 movw r12, r22 22fd4: 8b e1 ldi r24, 0x1B ; 27 22fd6: 9e e4 ldi r25, 0x4E ; 78 22fd8: 0e 94 2c 72 call 0xe458 ; 0xe458 22fdc: b6 01 movw r22, r12 22fde: 0f 94 3e 16 call 0x22c7c ; 0x22c7c #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 22fe2: 60 91 99 03 lds r22, 0x0399 ; 0x800399 22fe6: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 22fea: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 22fee: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 22ff2: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 22ff6: 8e ec ldi r24, 0xCE ; 206 22ff8: 99 e6 ldi r25, 0x69 ; 105 22ffa: 0f 94 3e 16 call 0x22c7c ; 0x22c7c #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 22ffe: ff 90 pop r15 23000: ef 90 pop r14 23002: df 90 pop r13 23004: 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(); 23006: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 0002300a : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 2300a: cf 92 push r12 2300c: df 92 push r13 2300e: ef 92 push r14 23010: ff 92 push r15 23012: 0f 93 push r16 23014: 1f 93 push r17 23016: cf 93 push r28 23018: df 93 push r29 2301a: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 2301e: 60 91 5c 06 lds r22, 0x065C ; 0x80065c 23022: 70 91 5d 06 lds r23, 0x065D ; 0x80065d 23026: 07 2e mov r0, r23 23028: 00 0c add r0, r0 2302a: 88 0b sbc r24, r24 2302c: 99 0b sbc r25, r25 2302e: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 23032: 20 e0 ldi r18, 0x00 ; 0 23034: 30 ec ldi r19, 0xC0 ; 192 23036: 4f e7 ldi r20, 0x7F ; 127 23038: 56 e4 ldi r21, 0x46 ; 70 2303a: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 2303e: 20 e0 ldi r18, 0x00 ; 0 23040: 30 e0 ldi r19, 0x00 ; 0 23042: 40 ea ldi r20, 0xA0 ; 160 23044: 50 e4 ldi r21, 0x40 ; 64 23046: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2304a: 27 ed ldi r18, 0xD7 ; 215 2304c: 30 e3 ldi r19, 0x30 ; 48 2304e: 44 e4 ldi r20, 0x44 ; 68 23050: 5e e3 ldi r21, 0x3E ; 62 23052: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 23056: eb 01 movw r28, r22 23058: 18 2f mov r17, r24 2305a: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 2305c: 60 91 5a 06 lds r22, 0x065A ; 0x80065a 23060: 70 91 5b 06 lds r23, 0x065B ; 0x80065b 23064: 07 2e mov r0, r23 23066: 00 0c add r0, r0 23068: 88 0b sbc r24, r24 2306a: 99 0b sbc r25, r25 2306c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 23070: 20 e0 ldi r18, 0x00 ; 0 23072: 30 ec ldi r19, 0xC0 ; 192 23074: 4f e7 ldi r20, 0x7F ; 127 23076: 56 e4 ldi r21, 0x46 ; 70 23078: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 2307c: 20 e0 ldi r18, 0x00 ; 0 2307e: 30 e0 ldi r19, 0x00 ; 0 23080: 40 ea ldi r20, 0xA0 ; 160 23082: 50 e4 ldi r21, 0x40 ; 64 23084: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 23088: 27 ed ldi r18, 0xD7 ; 215 2308a: 30 e3 ldi r19, 0x30 ; 48 2308c: 44 e4 ldi r20, 0x44 ; 68 2308e: 5e e3 ldi r21, 0x3E ; 62 23090: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 23094: f6 2e mov r15, r22 23096: e7 2e mov r14, r23 23098: d8 2e mov r13, r24 2309a: c9 2e mov r12, r25 lcd_home(); 2309c: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 230a0: cf 92 push r12 230a2: df 92 push r13 230a4: ef 92 push r14 230a6: ff 92 push r15 230a8: 0f 93 push r16 230aa: 1f 93 push r17 230ac: df 93 push r29 230ae: cf 93 push r28 230b0: 89 e4 ldi r24, 0x49 ; 73 230b2: 90 ea ldi r25, 0xA0 ; 160 230b4: 9f 93 push r25 230b6: 8f 93 push r24 230b8: 0e 94 39 6e call 0xdc72 ; 0xdc72 #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(); 230bc: 8d b7 in r24, 0x3d ; 61 230be: 9e b7 in r25, 0x3e ; 62 230c0: 0a 96 adiw r24, 0x0a ; 10 230c2: 0f b6 in r0, 0x3f ; 63 230c4: f8 94 cli 230c6: 9e bf out 0x3e, r25 ; 62 230c8: 0f be out 0x3f, r0 ; 63 230ca: 8d bf out 0x3d, r24 ; 61 } 230cc: df 91 pop r29 230ce: cf 91 pop r28 230d0: 1f 91 pop r17 230d2: 0f 91 pop r16 230d4: ff 90 pop r15 230d6: ef 90 pop r14 230d8: df 90 pop r13 230da: 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(); 230dc: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 000230e0 : //! | 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() { 230e0: af 92 push r10 230e2: bf 92 push r11 230e4: cf 92 push r12 230e6: df 92 push r13 230e8: ef 92 push r14 230ea: ff 92 push r15 230ec: 0f 93 push r16 230ee: 1f 93 push r17 230f0: cf 93 push r28 230f2: df 93 push r29 230f4: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 230f8: 84 e6 ldi r24, 0x64 ; 100 230fa: 9f e0 ldi r25, 0x0F ; 15 230fc: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 23100: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 23102: 85 e6 ldi r24, 0x65 ; 101 23104: 9f e0 ldi r25, 0x0F ; 15 23106: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2310a: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 2310c: 86 e6 ldi r24, 0x66 ; 102 2310e: 9f e0 ldi r25, 0x0F ; 15 23110: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 23114: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 23116: 88 e6 ldi r24, 0x68 ; 104 23118: 9f e0 ldi r25, 0x0F ; 15 2311a: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2311e: a8 2e mov r10, r24 lcd_home(); 23120: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_printf_P(failStatsFmt, 23124: 8e ef ldi r24, 0xFE ; 254 23126: 9d e4 ldi r25, 0x4D ; 77 23128: 0e 94 2c 72 call 0xe458 ; 0xe458 2312c: d8 2e mov r13, r24 2312e: c9 2e mov r12, r25 23130: 8f ee ldi r24, 0xEF ; 239 23132: 9d e4 ldi r25, 0x4D ; 77 23134: 0e 94 2c 72 call 0xe458 ; 0xe458 23138: 08 2f mov r16, r24 2313a: f9 2e mov r15, r25 2313c: 8e ed ldi r24, 0xDE ; 222 2313e: 9d e4 ldi r25, 0x4D ; 77 23140: 0e 94 2c 72 call 0xe458 ; 0xe458 23144: ec 01 movw r28, r24 23146: 88 ec ldi r24, 0xC8 ; 200 23148: 9d e4 ldi r25, 0x4D ; 77 2314a: 0e 94 2c 72 call 0xe458 ; 0xe458 2314e: 1f 92 push r1 23150: af 92 push r10 23152: 1f 92 push r1 23154: bf 92 push r11 23156: cf 92 push r12 23158: df 92 push r13 2315a: 1f 92 push r1 2315c: ef 92 push r14 2315e: ff 92 push r15 23160: 0f 93 push r16 23162: 1f 92 push r1 23164: 1f 93 push r17 23166: df 93 push r29 23168: cf 93 push r28 2316a: 9f 93 push r25 2316c: 8f 93 push r24 2316e: 8a e0 ldi r24, 0x0A ; 10 23170: 90 ea ldi r25, 0xA0 ; 160 23172: 9f 93 push r25 23174: 8f 93 push r24 23176: 0e 94 39 6e call 0xdc72 ; 0xdc72 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 2317a: 8d b7 in r24, 0x3d ; 61 2317c: 9e b7 in r25, 0x3e ; 62 2317e: 42 96 adiw r24, 0x12 ; 18 23180: 0f b6 in r0, 0x3f ; 63 23182: f8 94 cli 23184: 9e bf out 0x3e, r25 ; 62 23186: 0f be out 0x3f, r0 ; 63 23188: 8d bf out 0x3d, r24 ; 61 } 2318a: df 91 pop r29 2318c: cf 91 pop r28 2318e: 1f 91 pop r17 23190: 0f 91 pop r16 23192: ff 90 pop r15 23194: ef 90 pop r14 23196: df 90 pop r13 23198: cf 90 pop r12 2319a: bf 90 pop r11 2319c: 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(); 2319e: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 000231a2 : //! | 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() { 231a2: cf 92 push r12 231a4: df 92 push r13 231a6: ef 92 push r14 231a8: ff 92 push r15 231aa: 0f 93 push r16 231ac: 1f 93 push r17 231ae: cf 93 push r28 231b0: df 93 push r29 231b2: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 231b6: 0e 94 8c 6e call 0xdd18 ; 0xdd18 " %-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) )); 231ba: 8f ec ldi r24, 0xCF ; 207 231bc: 9e e0 ldi r25, 0x0E ; 14 231be: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 231c2: 90 e0 ldi r25, 0x00 ; 0 231c4: 0f 94 30 11 call 0x22260 ; 0x22260 231c8: d8 2e mov r13, r24 231ca: c9 2e mov r12, r25 231cc: 81 e8 ldi r24, 0x81 ; 129 231ce: 9d e4 ldi r25, 0x4D ; 77 231d0: 0e 94 2c 72 call 0xe458 ; 0xe458 231d4: f8 2e mov r15, r24 231d6: 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) ), 231d8: 82 ed ldi r24, 0xD2 ; 210 231da: 9e e0 ldi r25, 0x0E ; 14 231dc: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 231e0: 90 e0 ldi r25, 0x00 ; 0 231e2: 0f 94 30 11 call 0x22260 ; 0x22260 231e6: 18 2f mov r17, r24 231e8: 09 2f mov r16, r25 231ea: 85 e7 ldi r24, 0x75 ; 117 231ec: 9d e4 ldi r25, 0x4D ; 77 231ee: 0e 94 2c 72 call 0xe458 ; 0xe458 231f2: ec 01 movw r28, r24 231f4: 88 ec ldi r24, 0xC8 ; 200 231f6: 9d e4 ldi r25, 0x4D ; 77 231f8: 0e 94 2c 72 call 0xe458 ; 0xe458 231fc: cf 92 push r12 231fe: df 92 push r13 23200: ef 92 push r14 23202: ff 92 push r15 23204: 0f 93 push r16 23206: 1f 93 push r17 23208: df 93 push r29 2320a: cf 93 push r28 2320c: 9f 93 push r25 2320e: 8f 93 push r24 23210: 8e eb ldi r24, 0xBE ; 190 23212: 9f e9 ldi r25, 0x9F ; 159 23214: 9f 93 push r25 23216: 8f 93 push r24 23218: 0e 94 39 6e call 0xdc72 ; 0xdc72 " %-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(); 2321c: 8d b7 in r24, 0x3d ; 61 2321e: 9e b7 in r25, 0x3e ; 62 23220: 0c 96 adiw r24, 0x0c ; 12 23222: 0f b6 in r0, 0x3f ; 63 23224: f8 94 cli 23226: 9e bf out 0x3e, r25 ; 62 23228: 0f be out 0x3f, r0 ; 63 2322a: 8d bf out 0x3d, r24 ; 61 } 2322c: df 91 pop r29 2322e: cf 91 pop r28 23230: 1f 91 pop r17 23232: 0f 91 pop r16 23234: ff 90 pop r15 23236: ef 90 pop r14 23238: df 90 pop r13 2323a: 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(); 2323c: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 00023240 : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 23240: 0f 93 push r16 23242: 1f 93 push r17 23244: cf 93 push r28 23246: df 93 push r29 lcd_home(); 23248: 0e 94 8c 6e call 0xdd18 ; 0xdd18 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))); 2324c: 8b e5 ldi r24, 0x5B ; 91 2324e: 9f e0 ldi r25, 0x0F ; 15 23250: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 23254: 18 2f mov r17, r24 23256: 09 2f mov r16, r25 23258: 8d e5 ldi r24, 0x5D ; 93 2325a: 9f e0 ldi r25, 0x0F ; 15 2325c: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 23260: ec 01 movw r28, r24 23262: 8f e3 ldi r24, 0x3F ; 63 23264: 9e e4 ldi r25, 0x4E ; 78 23266: 0e 94 2c 72 call 0xe458 ; 0xe458 2326a: 0f 93 push r16 2326c: 1f 93 push r17 2326e: df 93 push r29 23270: cf 93 push r28 23272: 9f 93 push r25 23274: 8f 93 push r24 23276: 8d e6 ldi r24, 0x6D ; 109 23278: 90 ea ldi r25, 0xA0 ; 160 2327a: 9f 93 push r25 2327c: 8f 93 push r24 2327e: 0e 94 39 6e call 0xdc72 ; 0xdc72 menu_back_if_clicked(); 23282: 8d b7 in r24, 0x3d ; 61 23284: 9e b7 in r25, 0x3e ; 62 23286: 08 96 adiw r24, 0x08 ; 8 23288: 0f b6 in r0, 0x3f ; 63 2328a: f8 94 cli 2328c: 9e bf out 0x3e, r25 ; 62 2328e: 0f be out 0x3f, r0 ; 63 23290: 8d bf out 0x3d, r24 ; 61 } 23292: df 91 pop r29 23294: cf 91 pop r28 23296: 1f 91 pop r17 23298: 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(); 2329a: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 0002329e : //! | 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() { 2329e: 6f 92 push r6 232a0: 7f 92 push r7 232a2: 8f 92 push r8 232a4: 9f 92 push r9 232a6: af 92 push r10 232a8: bf 92 push r11 232aa: cf 92 push r12 232ac: df 92 push r13 232ae: ef 92 push r14 232b0: ff 92 push r15 232b2: 0f 93 push r16 232b4: 1f 93 push r17 232b6: cf 93 push r28 232b8: df 93 push r29 232ba: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 232be: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_printf_P(failStatsFmt, 232c2: 83 e0 ldi r24, 0x03 ; 3 232c4: 9f e0 ldi r25, 0x0F ; 15 232c6: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 232ca: 0f 94 30 11 call 0x22260 ; 0x22260 232ce: 78 2e mov r7, r24 232d0: 69 2e mov r6, r25 232d2: 85 e0 ldi r24, 0x05 ; 5 232d4: 9f e0 ldi r25, 0x0F ; 15 232d6: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 232da: 0f 94 30 11 call 0x22260 ; 0x22260 232de: 98 2e mov r9, r24 232e0: 89 2e mov r8, r25 232e2: 8e ef ldi r24, 0xFE ; 254 232e4: 9d e4 ldi r25, 0x4D ; 77 232e6: 0e 94 2c 72 call 0xe458 ; 0xe458 232ea: b8 2e mov r11, r24 232ec: a9 2e mov r10, r25 232ee: 81 e0 ldi r24, 0x01 ; 1 232f0: 9f e0 ldi r25, 0x0F ; 15 232f2: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 232f6: 0f 94 30 11 call 0x22260 ; 0x22260 232fa: d8 2e mov r13, r24 232fc: c9 2e mov r12, r25 232fe: 8f ee ldi r24, 0xEF ; 239 23300: 9d e4 ldi r25, 0x4D ; 77 23302: 0e 94 2c 72 call 0xe458 ; 0xe458 23306: f8 2e mov r15, r24 23308: e9 2e mov r14, r25 2330a: 8f ef ldi r24, 0xFF ; 255 2330c: 9e e0 ldi r25, 0x0E ; 14 2330e: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 23312: 0f 94 30 11 call 0x22260 ; 0x22260 23316: 18 2f mov r17, r24 23318: 09 2f mov r16, r25 2331a: 8e ed ldi r24, 0xDE ; 222 2331c: 9d e4 ldi r25, 0x4D ; 77 2331e: 0e 94 2c 72 call 0xe458 ; 0xe458 23322: ec 01 movw r28, r24 23324: 87 eb ldi r24, 0xB7 ; 183 23326: 9d e4 ldi r25, 0x4D ; 77 23328: 0e 94 2c 72 call 0xe458 ; 0xe458 2332c: 6f 92 push r6 2332e: 7f 92 push r7 23330: 8f 92 push r8 23332: 9f 92 push r9 23334: af 92 push r10 23336: bf 92 push r11 23338: cf 92 push r12 2333a: df 92 push r13 2333c: ef 92 push r14 2333e: ff 92 push r15 23340: 0f 93 push r16 23342: 1f 93 push r17 23344: df 93 push r29 23346: cf 93 push r28 23348: 9f 93 push r25 2334a: 8f 93 push r24 2334c: 8a e0 ldi r24, 0x0A ; 10 2334e: 90 ea ldi r25, 0xA0 ; 160 23350: 9f 93 push r25 23352: 8f 93 push r24 23354: 0e 94 39 6e call 0xdc72 ; 0xdc72 _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(); 23358: 8d b7 in r24, 0x3d ; 61 2335a: 9e b7 in r25, 0x3e ; 62 2335c: 42 96 adiw r24, 0x12 ; 18 2335e: 0f b6 in r0, 0x3f ; 63 23360: f8 94 cli 23362: 9e bf out 0x3e, r25 ; 62 23364: 0f be out 0x3f, r0 ; 63 23366: 8d bf out 0x3d, r24 ; 61 } 23368: df 91 pop r29 2336a: cf 91 pop r28 2336c: 1f 91 pop r17 2336e: 0f 91 pop r16 23370: ff 90 pop r15 23372: ef 90 pop r14 23374: df 90 pop r13 23376: cf 90 pop r12 23378: bf 90 pop r11 2337a: af 90 pop r10 2337c: 9f 90 pop r9 2337e: 8f 90 pop r8 23380: 7f 90 pop r7 23382: 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(); 23384: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 00023388 : //! | 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() { 23388: 8f 92 push r8 2338a: 9f 92 push r9 2338c: af 92 push r10 2338e: bf 92 push r11 23390: cf 92 push r12 23392: df 92 push r13 23394: ef 92 push r14 23396: ff 92 push r15 23398: 0f 93 push r16 2339a: 1f 93 push r17 2339c: cf 93 push r28 2339e: df 93 push r29 233a0: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 233a4: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_printf_P( 233a8: 80 91 c0 13 lds r24, 0x13C0 ; 0x8013c0 233ac: 90 91 c1 13 lds r25, 0x13C1 ; 0x8013c1 233b0: 0f 94 30 11 call 0x22260 ; 0x22260 233b4: 98 2e mov r9, r24 233b6: 89 2e mov r8, r25 233b8: 82 e9 ldi r24, 0x92 ; 146 233ba: 9d e4 ldi r25, 0x4D ; 77 233bc: 0e 94 2c 72 call 0xe458 ; 0xe458 233c0: b8 2e mov r11, r24 233c2: a9 2e mov r10, r25 233c4: 80 ed ldi r24, 0xD0 ; 208 233c6: 9e e0 ldi r25, 0x0E ; 14 233c8: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 233cc: 0f 94 30 11 call 0x22260 ; 0x22260 233d0: d8 2e mov r13, r24 233d2: c9 2e mov r12, r25 233d4: 81 e8 ldi r24, 0x81 ; 129 233d6: 9d e4 ldi r25, 0x4D ; 77 233d8: 0e 94 2c 72 call 0xe458 ; 0xe458 233dc: f8 2e mov r15, r24 233de: e9 2e mov r14, r25 233e0: 83 ed ldi r24, 0xD3 ; 211 233e2: 9e e0 ldi r25, 0x0E ; 14 233e4: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 233e8: 0f 94 30 11 call 0x22260 ; 0x22260 233ec: 18 2f mov r17, r24 233ee: 09 2f mov r16, r25 233f0: 85 e7 ldi r24, 0x75 ; 117 233f2: 9d e4 ldi r25, 0x4D ; 77 233f4: 0e 94 2c 72 call 0xe458 ; 0xe458 233f8: ec 01 movw r28, r24 233fa: 87 eb ldi r24, 0xB7 ; 183 233fc: 9d e4 ldi r25, 0x4D ; 77 233fe: 0e 94 2c 72 call 0xe458 ; 0xe458 23402: 8f 92 push r8 23404: 9f 92 push r9 23406: af 92 push r10 23408: bf 92 push r11 2340a: cf 92 push r12 2340c: df 92 push r13 2340e: ef 92 push r14 23410: ff 92 push r15 23412: 0f 93 push r16 23414: 1f 93 push r17 23416: df 93 push r29 23418: cf 93 push r28 2341a: 9f 93 push r25 2341c: 8f 93 push r24 2341e: 8d ed ldi r24, 0xDD ; 221 23420: 9f e9 ldi r25, 0x9F ; 159 23422: 9f 93 push r25 23424: 8f 93 push r24 23426: 0e 94 39 6e call 0xdc72 ; 0xdc72 ), _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(); 2342a: 8d b7 in r24, 0x3d ; 61 2342c: 9e b7 in r25, 0x3e ; 62 2342e: 40 96 adiw r24, 0x10 ; 16 23430: 0f b6 in r0, 0x3f ; 63 23432: f8 94 cli 23434: 9e bf out 0x3e, r25 ; 62 23436: 0f be out 0x3f, r0 ; 63 23438: 8d bf out 0x3d, r24 ; 61 } 2343a: df 91 pop r29 2343c: cf 91 pop r28 2343e: 1f 91 pop r17 23440: 0f 91 pop r16 23442: ff 90 pop r15 23444: ef 90 pop r14 23446: df 90 pop r13 23448: cf 90 pop r12 2344a: bf 90 pop r11 2344c: af 90 pop r10 2344e: 9f 90 pop r9 23450: 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(); 23452: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 00023456 : //! |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() { 23456: cf 93 push r28 23458: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 2345a: 8e e7 ldi r24, 0x7E ; 126 2345c: 90 e5 ldi r25, 0x50 ; 80 2345e: 0e 94 2c 72 call 0xe458 ; 0xe458 23462: ac 01 movw r20, r24 23464: 60 e0 ldi r22, 0x00 ; 0 23466: 80 e0 ldi r24, 0x00 ; 0 23468: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 1, STR_SEPARATOR); 2346c: 4b eb ldi r20, 0xBB ; 187 2346e: 59 e8 ldi r21, 0x89 ; 137 23470: 61 e0 ldi r22, 0x01 ; 1 23472: 80 e0 ldi r24, 0x00 ; 0 23474: 0e 94 74 6e call 0xdce8 ; 0xdce8 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 23478: 62 e0 ldi r22, 0x02 ; 2 2347a: 80 e0 ldi r24, 0x00 ; 0 2347c: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 23480: 85 ee ldi r24, 0xE5 ; 229 23482: 9f e0 ldi r25, 0x0F ; 15 23484: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 23488: 9f 93 push r25 2348a: 8f 93 push r24 2348c: 7f 93 push r23 2348e: 6f 93 push r22 23490: 1f 92 push r1 23492: 88 e5 ldi r24, 0x58 ; 88 23494: 8f 93 push r24 23496: c6 e4 ldi r28, 0x46 ; 70 23498: d2 ea ldi r29, 0xA2 ; 162 2349a: df 93 push r29 2349c: cf 93 push r28 2349e: 0e 94 39 6e call 0xdc72 ; 0xdc72 { 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); 234a2: 63 e0 ldi r22, 0x03 ; 3 234a4: 80 e0 ldi r24, 0x00 ; 0 234a6: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 234aa: 89 ee ldi r24, 0xE9 ; 233 234ac: 9f e0 ldi r25, 0x0F ; 15 234ae: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 234b2: 9f 93 push r25 234b4: 8f 93 push r24 234b6: 7f 93 push r23 234b8: 6f 93 push r22 234ba: 1f 92 push r1 234bc: 89 e5 ldi r24, 0x59 ; 89 234be: 8f 93 push r24 234c0: df 93 push r29 234c2: cf 93 push r28 234c4: 0e 94 39 6e call 0xdc72 ; 0xdc72 } menu_back_if_clicked(); 234c8: 8d b7 in r24, 0x3d ; 61 234ca: 9e b7 in r25, 0x3e ; 62 234cc: 40 96 adiw r24, 0x10 ; 16 234ce: 0f b6 in r0, 0x3f ; 63 234d0: f8 94 cli 234d2: 9e bf out 0x3e, r25 ; 62 234d4: 0f be out 0x3f, r0 ; 63 234d6: 8d bf out 0x3d, r24 ; 61 } 234d8: df 91 pop r29 234da: 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(); 234dc: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 000234e0 : //! ---------------------- //! 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() { 234e0: cf 92 push r12 234e2: df 92 push r13 234e4: ef 92 push r14 234e6: ff 92 push r15 234e8: 0f 93 push r16 234ea: 1f 93 push r17 234ec: cf 93 push r28 234ee: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 234f0: 80 e6 ldi r24, 0x60 ; 96 234f2: 9f e0 ldi r25, 0x0F ; 15 234f4: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 234f8: 6b 01 movw r12, r22 234fa: 7c 01 movw r14, r24 lcd_home(); 234fc: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_printf_P(_N( 23500: 80 e7 ldi r24, 0x70 ; 112 23502: 90 e5 ldi r25, 0x50 ; 80 23504: 0e 94 2c 72 call 0xe458 ; 0xe458 23508: 18 2f mov r17, r24 2350a: 09 2f mov r16, r25 2350c: 82 e6 ldi r24, 0x62 ; 98 2350e: 90 e5 ldi r25, 0x50 ; 80 23510: 0e 94 2c 72 call 0xe458 ; 0xe458 23514: ec 01 movw r28, r24 23516: 82 e5 ldi r24, 0x52 ; 82 23518: 90 e5 ldi r25, 0x50 ; 80 2351a: 0e 94 2c 72 call 0xe458 ; 0xe458 2351e: 2e e3 ldi r18, 0x3E ; 62 23520: 2f 93 push r18 23522: 20 e8 ldi r18, 0x80 ; 128 23524: 2f 93 push r18 23526: 1f 92 push r1 23528: 1f 92 push r1 2352a: 0f 93 push r16 2352c: 1f 93 push r17 2352e: 2d e3 ldi r18, 0x3D ; 61 23530: 2f 93 push r18 23532: 25 ef ldi r18, 0xF5 ; 245 23534: 2f 93 push r18 23536: 22 ec ldi r18, 0xC2 ; 194 23538: 2f 93 push r18 2353a: 20 e9 ldi r18, 0x90 ; 144 2353c: 2f 93 push r18 2353e: df 93 push r29 23540: cf 93 push r28 23542: 2b eb ldi r18, 0xBB ; 187 23544: 39 e8 ldi r19, 0x89 ; 137 23546: 3f 93 push r19 23548: 2f 93 push r18 2354a: 9f 93 push r25 2354c: 8f 93 push r24 2354e: 89 e1 ldi r24, 0x19 ; 25 23550: 9f e6 ldi r25, 0x6F ; 111 23552: 9f 93 push r25 23554: 8f 93 push r24 23556: 0e 94 39 6e call 0xdc72 ; 0xdc72 _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); 2355a: 60 e0 ldi r22, 0x00 ; 0 2355c: 8f e0 ldi r24, 0x0F ; 15 2355e: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 if (angleDiff < 100){ 23562: 8d b7 in r24, 0x3d ; 61 23564: 9e b7 in r25, 0x3e ; 62 23566: 42 96 adiw r24, 0x12 ; 18 23568: 0f b6 in r0, 0x3f ; 63 2356a: f8 94 cli 2356c: 9e bf out 0x3e, r25 ; 62 2356e: 0f be out 0x3f, r0 ; 63 23570: 8d bf out 0x3d, r24 ; 61 23572: 20 e0 ldi r18, 0x00 ; 0 23574: 30 e0 ldi r19, 0x00 ; 0 23576: 48 ec ldi r20, 0xC8 ; 200 23578: 52 e4 ldi r21, 0x42 ; 66 2357a: c7 01 movw r24, r14 2357c: b6 01 movw r22, r12 2357e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 23582: 87 ff sbrs r24, 7 23584: 32 c0 rjmp .+100 ; 0x235ea } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 23586: 20 e0 ldi r18, 0x00 ; 0 23588: 30 e0 ldi r19, 0x00 ; 0 2358a: 44 e3 ldi r20, 0x34 ; 52 2358c: 53 e4 ldi r21, 0x43 ; 67 2358e: c7 01 movw r24, r14 23590: b6 01 movw r22, r12 23592: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 23596: 2b ed ldi r18, 0xDB ; 219 23598: 3f e0 ldi r19, 0x0F ; 15 2359a: 49 e4 ldi r20, 0x49 ; 73 2359c: 50 e4 ldi r21, 0x40 ; 64 2359e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__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)); 235a2: 9f 93 push r25 235a4: 8f 93 push r24 235a6: 7f 93 push r23 235a8: 6f 93 push r22 235aa: 82 e1 ldi r24, 0x12 ; 18 235ac: 9f e6 ldi r25, 0x6F ; 111 235ae: 9f 93 push r25 235b0: 8f 93 push r24 235b2: 0e 94 39 6e call 0xdc72 ; 0xdc72 235b6: 0f 90 pop r0 235b8: 0f 90 pop r0 235ba: 0f 90 pop r0 235bc: 0f 90 pop r0 235be: 0f 90 pop r0 235c0: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 235c2: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 235c6: 88 23 and r24, r24 235c8: b9 f0 breq .+46 ; 0x235f8 menu_goto(lcd_menu_xyz_offset, 0, true); 235ca: 20 e0 ldi r18, 0x00 ; 0 235cc: 41 e0 ldi r20, 0x01 ; 1 235ce: 70 e0 ldi r23, 0x00 ; 0 235d0: 60 e0 ldi r22, 0x00 ; 0 235d2: 8e e5 ldi r24, 0x5E ; 94 235d4: 99 e3 ldi r25, 0x39 ; 57 } 235d6: df 91 pop r29 235d8: cf 91 pop r28 235da: 1f 91 pop r17 235dc: 0f 91 pop r16 235de: ff 90 pop r15 235e0: ef 90 pop r14 235e2: df 90 pop r13 235e4: 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); 235e6: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 ); 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)); 235ea: 8a e8 ldi r24, 0x8A ; 138 235ec: 97 e4 ldi r25, 0x47 ; 71 235ee: 0e 94 2c 72 call 0xe458 ; 0xe458 235f2: 0e 94 4b 6e call 0xdc96 ; 0xdc96 235f6: e5 cf rjmp .-54 ; 0x235c2 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 235f8: df 91 pop r29 235fa: cf 91 pop r28 235fc: 1f 91 pop r17 235fe: 0f 91 pop r16 23600: ff 90 pop r15 23602: ef 90 pop r14 23604: df 90 pop r13 23606: cf 90 pop r12 23608: 08 95 ret 0002360a : //! |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() { 2360a: 2f 92 push r2 2360c: 3f 92 push r3 2360e: 4f 92 push r4 23610: 5f 92 push r5 23612: 6f 92 push r6 23614: 7f 92 push r7 23616: 8f 92 push r8 23618: 9f 92 push r9 2361a: af 92 push r10 2361c: bf 92 push r11 2361e: cf 92 push r12 23620: df 92 push r13 23622: ef 92 push r14 23624: ff 92 push r15 23626: 0f 93 push r16 23628: 1f 93 push r17 2362a: cf 93 push r28 2362c: df 93 push r29 2362e: cd b7 in r28, 0x3d ; 61 23630: de b7 in r29, 0x3e ; 62 23632: a8 97 sbiw r28, 0x28 ; 40 23634: 0f b6 in r0, 0x3f ; 63 23636: f8 94 cli 23638: de bf out 0x3e, r29 ; 62 2363a: 0f be out 0x3f, r0 ; 63 2363c: 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); 2363e: 48 e0 ldi r20, 0x08 ; 8 23640: 50 e0 ldi r21, 0x00 ; 0 23642: 65 ee ldi r22, 0xE5 ; 229 23644: 7f e0 ldi r23, 0x0F ; 15 23646: ce 01 movw r24, r28 23648: 41 96 adiw r24, 0x11 ; 17 2364a: 0f 94 44 dc call 0x3b888 ; 0x3b888 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 2364e: 48 e0 ldi r20, 0x08 ; 8 23650: 50 e0 ldi r21, 0x00 ; 0 23652: 6d ed ldi r22, 0xDD ; 221 23654: 7f e0 ldi r23, 0x0F ; 15 23656: ce 01 movw r24, r28 23658: 09 96 adiw r24, 0x09 ; 9 2365a: 0f 94 44 dc call 0x3b888 ; 0x3b888 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 2365e: 48 e0 ldi r20, 0x08 ; 8 23660: 50 e0 ldi r21, 0x00 ; 0 23662: 65 ed ldi r22, 0xD5 ; 213 23664: 7f e0 ldi r23, 0x0F ; 15 23666: ce 01 movw r24, r28 23668: 01 96 adiw r24, 0x01 ; 1 2366a: 0f 94 44 dc call 0x3b888 ; 0x3b888 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]; 2366e: 8d 84 ldd r8, Y+13 ; 0x0d 23670: 9e 84 ldd r9, Y+14 ; 0x0e 23672: af 84 ldd r10, Y+15 ; 0x0f 23674: b8 88 ldd r11, Y+16 ; 0x10 23676: ef ee ldi r30, 0xEF ; 239 23678: f4 ea ldi r31, 0xA4 ; 164 2367a: 25 91 lpm r18, Z+ 2367c: 35 91 lpm r19, Z+ 2367e: 45 91 lpm r20, Z+ 23680: 54 91 lpm r21, Z 23682: cd 80 ldd r12, Y+5 ; 0x05 23684: de 80 ldd r13, Y+6 ; 0x06 23686: ef 80 ldd r14, Y+7 ; 0x07 23688: f8 84 ldd r15, Y+8 ; 0x08 2368a: e3 ef ldi r30, 0xF3 ; 243 2368c: f4 ea ldi r31, 0xA4 ; 164 2368e: 85 91 lpm r24, Z+ 23690: 95 91 lpm r25, Z+ 23692: a5 91 lpm r26, Z+ 23694: b4 91 lpm r27, Z 23696: 8d a3 std Y+37, r24 ; 0x25 23698: 9e a3 std Y+38, r25 ; 0x26 2369a: af a3 std Y+39, r26 ; 0x27 2369c: b8 a7 std Y+40, r27 ; 0x28 2369e: 8d 89 ldd r24, Y+21 ; 0x15 236a0: 9e 89 ldd r25, Y+22 ; 0x16 236a2: af 89 ldd r26, Y+23 ; 0x17 236a4: b8 8d ldd r27, Y+24 ; 0x18 236a6: 89 a3 std Y+33, r24 ; 0x21 236a8: 9a a3 std Y+34, r25 ; 0x22 236aa: ab a3 std Y+35, r26 ; 0x23 236ac: bc a3 std Y+36, r27 ; 0x24 236ae: c5 01 movw r24, r10 236b0: b4 01 movw r22, r8 236b2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 236b6: 2b 01 movw r4, r22 236b8: 3c 01 movw r6, r24 236ba: 2d a1 ldd r18, Y+37 ; 0x25 236bc: 3e a1 ldd r19, Y+38 ; 0x26 236be: 4f a1 ldd r20, Y+39 ; 0x27 236c0: 58 a5 ldd r21, Y+40 ; 0x28 236c2: c7 01 movw r24, r14 236c4: b6 01 movw r22, r12 236c6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 236ca: 9b 01 movw r18, r22 236cc: ac 01 movw r20, r24 236ce: c3 01 movw r24, r6 236d0: b2 01 movw r22, r4 236d2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 236d6: 29 a1 ldd r18, Y+33 ; 0x21 236d8: 3a a1 ldd r19, Y+34 ; 0x22 236da: 4b a1 ldd r20, Y+35 ; 0x23 236dc: 5c a1 ldd r21, Y+36 ; 0x24 236de: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 236e2: 20 e0 ldi r18, 0x00 ; 0 236e4: 30 e0 ldi r19, 0x00 ; 0 236e6: 40 e9 ldi r20, 0x90 ; 144 236e8: 50 e4 ldi r21, 0x40 ; 64 236ea: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 236ee: 1b 01 movw r2, r22 236f0: 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]; 236f2: e7 ef ldi r30, 0xF7 ; 247 236f4: f4 ea ldi r31, 0xA4 ; 164 236f6: 25 91 lpm r18, Z+ 236f8: 35 91 lpm r19, Z+ 236fa: 45 91 lpm r20, Z+ 236fc: 54 91 lpm r21, Z 236fe: eb ef ldi r30, 0xFB ; 251 23700: f4 ea ldi r31, 0xA4 ; 164 23702: 45 90 lpm r4, Z+ 23704: 55 90 lpm r5, Z+ 23706: 65 90 lpm r6, Z+ 23708: 74 90 lpm r7, Z 2370a: c5 01 movw r24, r10 2370c: b4 01 movw r22, r8 2370e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 23712: 4b 01 movw r8, r22 23714: 5c 01 movw r10, r24 23716: a3 01 movw r20, r6 23718: 92 01 movw r18, r4 2371a: c7 01 movw r24, r14 2371c: b6 01 movw r22, r12 2371e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 23722: 9b 01 movw r18, r22 23724: ac 01 movw r20, r24 23726: c5 01 movw r24, r10 23728: b4 01 movw r22, r8 2372a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2372e: 29 a1 ldd r18, Y+33 ; 0x21 23730: 3a a1 ldd r19, Y+34 ; 0x22 23732: 4b a1 ldd r20, Y+35 ; 0x23 23734: 5c a1 ldd r21, Y+36 ; 0x24 23736: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 2373a: 20 e0 ldi r18, 0x00 ; 0 2373c: 30 e0 ldi r19, 0x00 ; 0 2373e: 40 e9 ldi r20, 0x90 ; 144 23740: 50 e4 ldi r21, 0x40 ; 64 23742: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 23746: 6d 8f std Y+29, r22 ; 0x1d 23748: 7e 8f std Y+30, r23 ; 0x1e 2374a: 8f 8f std Y+31, r24 ; 0x1f 2374c: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 2374e: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_printf_P(_N( 23752: 8a e4 ldi r24, 0x4A ; 74 23754: 90 e5 ldi r25, 0x50 ; 80 23756: 0e 94 2c 72 call 0xe458 ; 0xe458 2375a: d8 2e mov r13, r24 2375c: c9 2e mov r12, r25 2375e: 83 e4 ldi r24, 0x43 ; 67 23760: 90 e5 ldi r25, 0x50 ; 80 23762: 0e 94 2c 72 call 0xe458 ; 0xe458 23766: f8 2e mov r15, r24 23768: e9 2e mov r14, r25 2376a: 8d e2 ldi r24, 0x2D ; 45 2376c: 90 e5 ldi r25, 0x50 ; 80 2376e: 0e 94 2c 72 call 0xe458 ; 0xe458 23772: cf 92 push r12 23774: df 92 push r13 23776: ef 92 push r14 23778: ff 92 push r15 2377a: 2b eb ldi r18, 0xBB ; 187 2377c: 39 e8 ldi r19, 0x89 ; 137 2377e: 3f 93 push r19 23780: 2f 93 push r18 23782: 9f 93 push r25 23784: 8f 93 push r24 23786: 84 e0 ldi r24, 0x04 ; 4 23788: 9f e6 ldi r25, 0x6F ; 111 2378a: 9f 93 push r25 2378c: 8f 93 push r24 2378e: 0e 94 39 6e call 0xdc72 ; 0xdc72 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 23792: 62 e0 ldi r22, 0x02 ; 2 23794: 8b e0 ldi r24, 0x0B ; 11 23796: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2379a: 0f b6 in r0, 0x3f ; 63 2379c: f8 94 cli 2379e: de bf out 0x3e, r29 ; 62 237a0: 0f be out 0x3f, r0 ; 63 237a2: cd bf out 0x3d, r28 ; 61 237a4: 20 e0 ldi r18, 0x00 ; 0 237a6: 30 e0 ldi r19, 0x00 ; 0 237a8: 48 e4 ldi r20, 0x48 ; 72 237aa: 53 e4 ldi r21, 0x43 ; 67 237ac: 62 2d mov r22, r2 237ae: 73 2d mov r23, r3 237b0: 80 2f mov r24, r16 237b2: 91 2f mov r25, r17 237b4: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 237b8: 87 ff sbrs r24, 7 237ba: 51 c0 rjmp .+162 ; 0x2385e else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 237bc: 1f 93 push r17 237be: 0f 93 push r16 237c0: 3f 92 push r3 237c2: 2f 92 push r2 237c4: 8c ef ldi r24, 0xFC ; 252 237c6: 9e e6 ldi r25, 0x6E ; 110 237c8: 9f 93 push r25 237ca: 8f 93 push r24 237cc: 0e 94 39 6e call 0xdc72 ; 0xdc72 237d0: 0f 90 pop r0 237d2: 0f 90 pop r0 237d4: 0f 90 pop r0 237d6: 0f 90 pop r0 237d8: 0f 90 pop r0 237da: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 237dc: 63 e0 ldi r22, 0x03 ; 3 237de: 8b e0 ldi r24, 0x0B ; 11 237e0: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 237e4: 1d 8d ldd r17, Y+29 ; 0x1d 237e6: 0e 8d ldd r16, Y+30 ; 0x1e 237e8: ff 8c ldd r15, Y+31 ; 0x1f 237ea: e8 a0 ldd r14, Y+32 ; 0x20 237ec: 20 e0 ldi r18, 0x00 ; 0 237ee: 30 e0 ldi r19, 0x00 ; 0 237f0: 48 e4 ldi r20, 0x48 ; 72 237f2: 53 e4 ldi r21, 0x43 ; 67 237f4: d8 01 movw r26, r16 237f6: f7 01 movw r30, r14 237f8: 6b 2f mov r22, r27 237fa: 7a 2f mov r23, r26 237fc: 8f 2f mov r24, r31 237fe: 9e 2f mov r25, r30 23800: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 23804: 87 fd sbrc r24, 7 23806: 32 c0 rjmp .+100 ; 0x2386c 23808: 8a e8 ldi r24, 0x8A ; 138 2380a: 97 e4 ldi r25, 0x47 ; 71 2380c: 0e 94 2c 72 call 0xe458 ; 0xe458 23810: 0e 94 4b 6e call 0xdc96 ; 0xdc96 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 23814: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 23818: 88 23 and r24, r24 2381a: 41 f0 breq .+16 ; 0x2382c menu_goto(lcd_menu_xyz_skew, 0, true); 2381c: 20 e0 ldi r18, 0x00 ; 0 2381e: 41 e0 ldi r20, 0x01 ; 1 23820: 70 e0 ldi r23, 0x00 ; 0 23822: 60 e0 ldi r22, 0x00 ; 0 23824: 80 e3 ldi r24, 0x30 ; 48 23826: 9a e3 ldi r25, 0x3A ; 58 23828: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 } 2382c: a8 96 adiw r28, 0x28 ; 40 2382e: 0f b6 in r0, 0x3f ; 63 23830: f8 94 cli 23832: de bf out 0x3e, r29 ; 62 23834: 0f be out 0x3f, r0 ; 63 23836: cd bf out 0x3d, r28 ; 61 23838: df 91 pop r29 2383a: cf 91 pop r28 2383c: 1f 91 pop r17 2383e: 0f 91 pop r16 23840: ff 90 pop r15 23842: ef 90 pop r14 23844: df 90 pop r13 23846: cf 90 pop r12 23848: bf 90 pop r11 2384a: af 90 pop r10 2384c: 9f 90 pop r9 2384e: 8f 90 pop r8 23850: 7f 90 pop r7 23852: 6f 90 pop r6 23854: 5f 90 pop r5 23856: 4f 90 pop r4 23858: 3f 90 pop r3 2385a: 2f 90 pop r2 2385c: 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)); 2385e: 8a e8 ldi r24, 0x8A ; 138 23860: 97 e4 ldi r25, 0x47 ; 71 23862: 0e 94 2c 72 call 0xe458 ; 0xe458 23866: 0e 94 4b 6e call 0xdc96 ; 0xdc96 2386a: b8 cf rjmp .-144 ; 0x237dc else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 2386c: ef 92 push r14 2386e: ff 92 push r15 23870: 0f 93 push r16 23872: 1f 93 push r17 23874: 8c ef ldi r24, 0xFC ; 252 23876: 9e e6 ldi r25, 0x6E ; 110 23878: 9f 93 push r25 2387a: 8f 93 push r24 2387c: 0e 94 39 6e call 0xdc72 ; 0xdc72 23880: 0f 90 pop r0 23882: 0f 90 pop r0 23884: 0f 90 pop r0 23886: 0f 90 pop r0 23888: 0f 90 pop r0 2388a: 0f 90 pop r0 2388c: c3 cf rjmp .-122 ; 0x23814 0002388e <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 2388e: 2f 92 push r2 23890: 3f 92 push r3 23892: 4f 92 push r4 23894: 5f 92 push r5 23896: 6f 92 push r6 23898: 7f 92 push r7 2389a: 9f 92 push r9 2389c: af 92 push r10 2389e: bf 92 push r11 238a0: cf 92 push r12 238a2: df 92 push r13 238a4: ef 92 push r14 238a6: ff 92 push r15 238a8: 0f 93 push r16 238aa: 1f 93 push r17 238ac: cf 93 push r28 238ae: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 238b0: 70 91 a7 0d lds r23, 0x0DA7 ; 0x800da7 238b4: 71 11 cpse r23, r1 238b6: 04 c0 rjmp .+8 ; 0x238c0 <_lcd_move(char const*, unsigned char, int, int)+0x32> 238b8: 70 91 a8 0d lds r23, 0x0DA8 ; 0x800da8 238bc: 77 23 and r23, r23 238be: 99 f0 breq .+38 ; 0x238e6 <_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(); } 238c0: df 91 pop r29 238c2: cf 91 pop r28 238c4: 1f 91 pop r17 238c6: 0f 91 pop r16 238c8: ff 90 pop r15 238ca: ef 90 pop r14 238cc: df 90 pop r13 238ce: cf 90 pop r12 238d0: bf 90 pop r11 238d2: af 90 pop r10 238d4: 9f 90 pop r9 238d6: 7f 90 pop r7 238d8: 6f 90 pop r6 238da: 5f 90 pop r5 238dc: 4f 90 pop r4 238de: 3f 90 pop r3 238e0: 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(); 238e2: 0d 94 96 d4 jmp 0x3a92c ; 0x3a92c 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) 238e6: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 238ea: 71 11 cpse r23, r1 238ec: 09 c0 rjmp .+18 ; 0x23900 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 238ee: 70 91 b7 02 lds r23, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> check_endstops = check; 238f2: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> { _md->endstopsEnabledPrevious = enable_endstops(false); 238f6: 70 93 aa 03 sts 0x03AA, r23 ; 0x8003aa _md->initialized = true; 238fa: 71 e0 ldi r23, 0x01 ; 1 238fc: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 23900: 19 01 movw r2, r18 23902: 6a 01 movw r12, r20 23904: c6 2f mov r28, r22 23906: d9 2f mov r29, r25 23908: 98 2e mov r9, r24 } if (lcd_encoder != 0) 2390a: 80 91 70 06 lds r24, 0x0670 ; 0x800670 2390e: 90 91 71 06 lds r25, 0x0671 ; 0x800671 23912: 89 2b or r24, r25 23914: 09 f4 brne .+2 ; 0x23918 <_lcd_move(char const*, unsigned char, int, int)+0x8a> 23916: 71 c0 rjmp .+226 ; 0x239fa <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 23918: 0e 94 43 66 call 0xcc86 ; 0xcc86 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; 2391c: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 if (++ next_block_index == BLOCK_BUFFER_SIZE) 23920: 8f 5f subi r24, 0xFF ; 255 23922: 80 31 cpi r24, 0x10 ; 16 23924: 09 f4 brne .+2 ; 0x23928 <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 23926: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 23928: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 if (! planner_queue_full()) 2392c: 98 17 cp r25, r24 2392e: 09 f4 brne .+2 ; 0x23932 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 23930: 64 c0 rjmp .+200 ; 0x239fa <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 23932: 84 e0 ldi r24, 0x04 ; 4 23934: c8 9f mul r28, r24 23936: 80 01 movw r16, r0 23938: 11 24 eor r1, r1 2393a: f8 01 movw r30, r16 2393c: ee 56 subi r30, 0x6E ; 110 2393e: f9 4f sbci r31, 0xF9 ; 249 23940: 5f 01 movw r10, r30 23942: 60 91 70 06 lds r22, 0x0670 ; 0x800670 23946: 70 91 71 06 lds r23, 0x0671 ; 0x800671 2394a: 07 2e mov r0, r23 2394c: 00 0c add r0, r0 2394e: 88 0b sbc r24, r24 23950: 99 0b sbc r25, r25 23952: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 23956: f5 01 movw r30, r10 23958: 20 81 ld r18, Z 2395a: 31 81 ldd r19, Z+1 ; 0x01 2395c: 42 81 ldd r20, Z+2 ; 0x02 2395e: 53 81 ldd r21, Z+3 ; 0x03 23960: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 23964: 2b 01 movw r4, r22 23966: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 23968: b6 01 movw r22, r12 2396a: dd 0c add r13, r13 2396c: 88 0b sbc r24, r24 2396e: 99 0b sbc r25, r25 23970: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 23974: 6b 01 movw r12, r22 23976: 7c 01 movw r14, r24 23978: ac 01 movw r20, r24 2397a: 9b 01 movw r18, r22 2397c: c3 01 movw r24, r6 2397e: b2 01 movw r22, r4 23980: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 23984: f5 01 movw r30, r10 23986: 87 fd sbrc r24, 7 23988: 7d c0 rjmp .+250 ; 0x23a84 <_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; 2398a: 40 82 st Z, r4 2398c: 51 82 std Z+1, r5 ; 0x01 2398e: 62 82 std Z+2, r6 ; 0x02 23990: 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; 23992: b1 01 movw r22, r2 23994: 33 0c add r3, r3 23996: 88 0b sbc r24, r24 23998: 99 0b sbc r25, r25 2399a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2399e: 2b 01 movw r4, r22 239a0: 3c 01 movw r6, r24 239a2: c8 01 movw r24, r16 239a4: 8e 56 subi r24, 0x6E ; 110 239a6: 99 4f sbci r25, 0xF9 ; 249 239a8: 7c 01 movw r14, r24 239aa: a3 01 movw r20, r6 239ac: 92 01 movw r18, r4 239ae: fc 01 movw r30, r24 239b0: 60 81 ld r22, Z 239b2: 71 81 ldd r23, Z+1 ; 0x01 239b4: 82 81 ldd r24, Z+2 ; 0x02 239b6: 93 81 ldd r25, Z+3 ; 0x03 239b8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 239bc: 18 16 cp r1, r24 239be: 2c f4 brge .+10 ; 0x239ca <_lcd_move(char const*, unsigned char, int, int)+0x13c> 239c0: f7 01 movw r30, r14 239c2: 40 82 st Z, r4 239c4: 51 82 std Z+1, r5 ; 0x01 239c6: 62 82 std Z+2, r6 ; 0x02 239c8: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 239ca: 10 92 71 06 sts 0x0671, r1 ; 0x800671 239ce: 10 92 70 06 sts 0x0670, r1 ; 0x800670 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 239d2: 66 e9 ldi r22, 0x96 ; 150 239d4: 76 e0 ldi r23, 0x06 ; 6 239d6: 82 e9 ldi r24, 0x92 ; 146 239d8: 96 e0 ldi r25, 0x06 ; 6 239da: 0e 94 2a 6a call 0xd454 ; 0xd454 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 239de: f8 01 movw r30, r16 239e0: e7 50 subi r30, 0x07 ; 7 239e2: fd 4f sbci r31, 0xFD ; 253 239e4: 60 81 ld r22, Z 239e6: 71 81 ldd r23, Z+1 ; 0x01 239e8: 82 81 ldd r24, Z+2 ; 0x02 239ea: 93 81 ldd r25, Z+3 ; 0x03 239ec: 0e 94 47 66 call 0xcc8e ; 0xcc8e 239f0: 0f 94 81 c0 call 0x38102 ; 0x38102 lcd_draw_update = 1; 239f4: 81 e0 ldi r24, 0x01 ; 1 239f6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 239fa: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 239fe: 88 23 and r24, r24 23a00: 11 f1 breq .+68 ; 0x23a46 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 23a02: 61 e0 ldi r22, 0x01 ; 1 23a04: 80 e0 ldi r24, 0x00 ; 0 23a06: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 menu_draw_float31(name, current_position[axis]); 23a0a: 84 e0 ldi r24, 0x04 ; 4 23a0c: c8 9f mul r28, r24 23a0e: f0 01 movw r30, r0 23a10: 11 24 eor r1, r1 23a12: ee 56 subi r30, 0x6E ; 110 23a14: f9 4f sbci r31, 0xF9 ; 249 //! 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); 23a16: 83 81 ldd r24, Z+3 ; 0x03 23a18: 8f 93 push r24 23a1a: 82 81 ldd r24, Z+2 ; 0x02 23a1c: 8f 93 push r24 23a1e: 81 81 ldd r24, Z+1 ; 0x01 23a20: 8f 93 push r24 23a22: 80 81 ld r24, Z 23a24: 8f 93 push r24 23a26: df 93 push r29 23a28: 9f 92 push r9 23a2a: 8d e2 ldi r24, 0x2D ; 45 23a2c: 92 ea ldi r25, 0xA2 ; 162 23a2e: 9f 93 push r25 23a30: 8f 93 push r24 23a32: 0e 94 39 6e call 0xdc72 ; 0xdc72 23a36: ed b7 in r30, 0x3d ; 61 23a38: fe b7 in r31, 0x3e ; 62 23a3a: 38 96 adiw r30, 0x08 ; 8 23a3c: 0f b6 in r0, 0x3f ; 63 23a3e: f8 94 cli 23a40: fe bf out 0x3e, r31 ; 62 23a42: 0f be out 0x3f, r0 ; 63 23a44: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 23a46: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 23a4a: 81 11 cpse r24, r1 23a4c: 04 c0 rjmp .+8 ; 0x23a56 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 23a4e: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 23a52: 88 23 and r24, r24 23a54: 21 f0 breq .+8 ; 0x23a5e <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 23a56: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 23a5a: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> menu_back_if_clicked(); } 23a5e: df 91 pop r29 23a60: cf 91 pop r28 23a62: 1f 91 pop r17 23a64: 0f 91 pop r16 23a66: ff 90 pop r15 23a68: ef 90 pop r14 23a6a: df 90 pop r13 23a6c: cf 90 pop r12 23a6e: bf 90 pop r11 23a70: af 90 pop r10 23a72: 9f 90 pop r9 23a74: 7f 90 pop r7 23a76: 6f 90 pop r6 23a78: 5f 90 pop r5 23a7a: 4f 90 pop r4 23a7c: 3f 90 pop r3 23a7e: 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(); 23a80: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 23a84: c0 82 st Z, r12 23a86: d1 82 std Z+1, r13 ; 0x01 23a88: e2 82 std Z+2, r14 ; 0x02 23a8a: f3 82 std Z+3, r15 ; 0x03 23a8c: 82 cf rjmp .-252 ; 0x23992 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00023a8e : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 23a8e: 22 ed ldi r18, 0xD2 ; 210 23a90: 30 e0 ldi r19, 0x00 ; 0 23a92: 50 e0 ldi r21, 0x00 ; 0 23a94: 40 e0 ldi r20, 0x00 ; 0 23a96: 62 e0 ldi r22, 0x02 ; 2 23a98: 87 e5 ldi r24, 0x57 ; 87 23a9a: 92 ea ldi r25, 0xA2 ; 162 23a9c: 0d 94 47 1c jmp 0x2388e ; 0x2388e <_lcd_move(char const*, unsigned char, int, int)> 00023aa0 : // the implementation of menu_draw_float31 static void lcd_move_x() { _lcd_move(PSTR("X:"), X_AXIS, X_MIN_POS, X_MAX_POS); } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 23aa0: 24 ed ldi r18, 0xD4 ; 212 23aa2: 30 e0 ldi r19, 0x00 ; 0 23aa4: 4c ef ldi r20, 0xFC ; 252 23aa6: 5f ef ldi r21, 0xFF ; 255 23aa8: 61 e0 ldi r22, 0x01 ; 1 23aaa: 84 e5 ldi r24, 0x54 ; 84 23aac: 92 ea ldi r25, 0xA2 ; 162 23aae: 0d 94 47 1c jmp 0x2388e ; 0x2388e <_lcd_move(char const*, unsigned char, int, int)> 00023ab2 : } // 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); 23ab2: 2f ef ldi r18, 0xFF ; 255 23ab4: 30 e0 ldi r19, 0x00 ; 0 23ab6: 50 e0 ldi r21, 0x00 ; 0 23ab8: 40 e0 ldi r20, 0x00 ; 0 23aba: 60 e0 ldi r22, 0x00 ; 0 23abc: 81 e5 ldi r24, 0x51 ; 81 23abe: 92 ea ldi r25, 0xA2 ; 162 23ac0: 0d 94 47 1c jmp 0x2388e ; 0x2388e <_lcd_move(char const*, unsigned char, int, int)> 00023ac4 : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 23ac4: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 23ac8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 23acc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23ad0: 84 30 cpi r24, 0x04 ; 4 23ad2: 28 f5 brcc .+74 ; 0x23b1e 23ad4: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 23ad8: 8b e3 ldi r24, 0x3B ; 59 23ada: 98 e4 ldi r25, 0x48 ; 72 23adc: 0e 94 2c 72 call 0xe458 ; 0xe458 23ae0: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 23ae4: 8e e0 ldi r24, 0x0E ; 14 23ae6: 9e e4 ldi r25, 0x4E ; 78 23ae8: 0e 94 2c 72 call 0xe458 ; 0xe458 23aec: 66 e9 ldi r22, 0x96 ; 150 23aee: 7a e3 ldi r23, 0x3A ; 58 23af0: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 23af4: 86 e0 ldi r24, 0x06 ; 6 23af6: 9e e4 ldi r25, 0x4E ; 78 23af8: 0e 94 2c 72 call 0xe458 ; 0xe458 23afc: 66 e0 ldi r22, 0x06 ; 6 23afe: 79 e3 ldi r23, 0x39 ; 57 23b00: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_END(); 23b04: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 23b08: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23b0c: 8f 5f subi r24, 0xFF ; 255 23b0e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23b12: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23b16: 8f 5f subi r24, 0xFF ; 255 23b18: 80 93 14 05 sts 0x0514, r24 ; 0x800514 23b1c: d7 cf rjmp .-82 ; 0x23acc 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(); } 23b1e: 08 95 ret 00023b20 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 23b20: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 23b24: 10 92 12 05 sts 0x0512, r1 ; 0x800512 23b28: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23b2c: 84 30 cpi r24, 0x04 ; 4 23b2e: 68 f5 brcc .+90 ; 0x23b8a 23b30: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 23b34: 8b e3 ldi r24, 0x3B ; 59 23b36: 98 e4 ldi r25, 0x48 ; 72 23b38: 0e 94 2c 72 call 0xe458 ; 0xe458 23b3c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 23b40: 8e e0 ldi r24, 0x0E ; 14 23b42: 9e e4 ldi r25, 0x4E ; 78 23b44: 0e 94 2c 72 call 0xe458 ; 0xe458 23b48: 6c e9 ldi r22, 0x9C ; 156 23b4a: 79 e3 ldi r23, 0x39 ; 57 23b4c: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 23b50: 86 e0 ldi r24, 0x06 ; 6 23b52: 9e e4 ldi r25, 0x4E ; 78 23b54: 0e 94 2c 72 call 0xe458 ; 0xe458 23b58: 6e ed ldi r22, 0xDE ; 222 23b5a: 78 e3 ldi r23, 0x38 ; 56 23b5c: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 23b60: 84 ea ldi r24, 0xA4 ; 164 23b62: 9d e4 ldi r25, 0x4D ; 77 23b64: 0e 94 2c 72 call 0xe458 ; 0xe458 23b68: 66 ef ldi r22, 0xF6 ; 246 23b6a: 79 e3 ldi r23, 0x39 ; 57 23b6c: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_END(); 23b70: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 23b74: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23b78: 8f 5f subi r24, 0xFF ; 255 23b7a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23b7e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23b82: 8f 5f subi r24, 0xFF ; 255 23b84: 80 93 14 05 sts 0x0514, r24 ; 0x800514 23b88: cf cf rjmp .-98 ; 0x23b28 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(); } 23b8a: 08 95 ret 00023b8c : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 23b8c: 80 91 63 06 lds r24, 0x0663 ; 0x800663 23b90: 81 11 cpse r24, r1 23b92: 03 c0 rjmp .+6 ; 0x23b9a 23b94: 82 e0 ldi r24, 0x02 ; 2 23b96: 0d 94 7a d4 jmp 0x3a8f4 ; 0x3a8f4 23b9a: 81 e0 ldi r24, 0x01 ; 1 23b9c: fc cf rjmp .-8 ; 0x23b96 00023b9e : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 23b9e: ef 92 push r14 23ba0: ff 92 push r15 23ba2: 0f 93 push r16 23ba4: 1f 93 push r17 23ba6: cf 93 push r28 23ba8: 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) 23baa: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 23bae: 88 23 and r24, r24 23bb0: 29 f0 breq .+10 ; 0x23bbc 23bb2: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 23bb6: 92 30 cpi r25, 0x02 ; 2 23bb8: 09 f0 breq .+2 ; 0x23bbc 23bba: 80 c1 rjmp .+768 ; 0x23ebc { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 23bbc: 81 e0 ldi r24, 0x01 ; 1 23bbe: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 23bc2: 80 91 01 17 lds r24, 0x1701 ; 0x801701 _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 23bc6: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa if (_md->is_flash_air) { 23bca: 88 23 and r24, r24 23bcc: 21 f0 breq .+8 ; 0x23bd6 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 23bce: 8b ea ldi r24, 0xAB ; 171 23bd0: 93 e0 ldi r25, 0x03 ; 3 23bd2: 0f 94 09 87 call 0x30e12 ; 0x30e12 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 23bd6: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 23bda: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if (((menu_item - 1) == menu_line) && lcd_draw_update) { lcd_set_cursor(6, menu_row); MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 23bde: 8d ea ldi r24, 0xAD ; 173 23be0: e8 2e mov r14, r24 23be2: 80 ea ldi r24, 0xA0 ; 160 23be4: 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]); 23be6: cc e7 ldi r28, 0x7C ; 124 23be8: d0 ea ldi r29, 0xA0 ; 160 23bea: 0f ea ldi r16, 0xAF ; 175 23bec: 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(); 23bee: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23bf2: 84 30 cpi r24, 0x04 ; 4 23bf4: 08 f0 brcs .+2 ; 0x23bf8 23bf6: 89 c1 rjmp .+786 ; 0x23f0a 23bf8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 23bfc: 8b e3 ldi r24, 0x3B ; 59 23bfe: 98 e4 ldi r25, 0x48 ; 72 23c00: 0e 94 2c 72 call 0xe458 ; 0xe458 23c04: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR("Firmware:")); 23c08: 8e e0 ldi r24, 0x0E ; 14 23c0a: 91 ea ldi r25, 0xA1 ; 161 23c0c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 23c10: 81 e0 ldi r24, 0x01 ; 1 23c12: 91 ea ldi r25, 0xA1 ; 161 23c14: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 23c18: 83 ef ldi r24, 0xF3 ; 243 23c1a: 90 ea ldi r25, 0xA0 ; 160 23c1c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 23c20: 83 ee ldi r24, 0xE3 ; 227 23c22: 90 ea ldi r25, 0xA0 ; 160 23c24: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 23c28: 83 ea ldi r24, 0xA3 ; 163 23c2a: 9e e6 ldi r25, 0x6E ; 110 23c2c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 23c30: 81 e9 ldi r24, 0x91 ; 145 23c32: 9e e6 ldi r25, 0x6E ; 110 23c34: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 23c38: 80 e8 ldi r24, 0x80 ; 128 23c3a: 9e e6 ldi r25, 0x6E ; 110 23c3c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(STR_SEPARATOR); 23c40: 8b eb ldi r24, 0xBB ; 187 23c42: 99 e8 ldi r25, 0x89 ; 137 23c44: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 23c48: 88 ed ldi r24, 0xD8 ; 216 23c4a: 90 ea ldi r25, 0xA0 ; 160 23c4c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 23c50: 8e ec ldi r24, 0xCE ; 206 23c52: 90 ea ldi r25, 0xA0 ; 160 23c54: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 23c58: 86 ec ldi r24, 0xC6 ; 198 23c5a: 90 ea ldi r25, 0xA0 ; 160 23c5c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(STR_SEPARATOR); 23c60: 8b eb ldi r24, 0xBB ; 187 23c62: 99 e8 ldi r25, 0x89 ; 137 23c64: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(_T(MSG_DATE)); 23c68: 8b ea ldi r24, 0xAB ; 171 23c6a: 9e e4 ldi r25, 0x4E ; 78 23c6c: 0e 94 2c 72 call 0xe458 ; 0xe458 23c70: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 23c74: 8b eb ldi r24, 0xBB ; 187 23c76: 90 ea ldi r25, 0xA0 ; 160 23c78: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(STR_SEPARATOR); MENU_ITEM_BACK_P(PSTR("Fil. sensor v.:")); MENU_ITEM_BACK_P(fsensor.getIRVersionText()); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 23c7c: 8b eb ldi r24, 0xBB ; 187 23c7e: 99 e8 ldi r25, 0x89 ; 137 23c80: 0f 94 99 d4 call 0x3a932 ; 0x3a932 if (MMU2::mmu2.Enabled()) 23c84: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 23c88: 81 30 cpi r24, 0x01 ; 1 23c8a: 09 f0 breq .+2 ; 0x23c8e 23c8c: 39 c1 rjmp .+626 ; 0x23f00 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 23c8e: 8b e9 ldi r24, 0x9B ; 155 23c90: 9e e4 ldi r25, 0x4E ; 78 23c92: 0e 94 2c 72 call 0xe458 ; 0xe458 23c96: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 23c9a: 86 eb ldi r24, 0xB6 ; 182 23c9c: 90 ea ldi r25, 0xA0 ; 160 23c9e: 0f 94 99 d4 call 0x3a932 ; 0x3a932 if (((menu_item - 1) == menu_line) && lcd_draw_update) 23ca2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23ca6: 81 50 subi r24, 0x01 ; 1 23ca8: 99 0b sbc r25, r25 23caa: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23cae: 28 17 cp r18, r24 23cb0: 19 06 cpc r1, r25 23cb2: 49 f5 brne .+82 ; 0x23d06 23cb4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23cb8: 88 23 and r24, r24 23cba: 29 f1 breq .+74 ; 0x23d06 { lcd_set_cursor(6, menu_row); 23cbc: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23cc0: 86 e0 ldi r24, 0x06 ; 6 23cc2: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 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) { 23cc6: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 23cca: 81 30 cpi r24, 0x01 ; 1 23ccc: 09 f0 breq .+2 ; 0x23cd0 23cce: 11 c1 rjmp .+546 ; 0x23ef2 23cd0: 80 91 9a 13 lds r24, 0x139A ; 0x80139a 23cd4: 90 91 9b 13 lds r25, 0x139B ; 0x80139b 23cd8: 20 91 9c 13 lds r18, 0x139C ; 0x80139c MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 23cdc: 88 23 and r24, r24 23cde: 09 f4 brne .+2 ; 0x23ce2 23ce0: 08 c1 rjmp .+528 ; 0x23ef2 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 23ce2: 1f 92 push r1 23ce4: 2f 93 push r18 23ce6: 1f 92 push r1 23ce8: 9f 93 push r25 23cea: 1f 92 push r1 23cec: 8f 93 push r24 23cee: ff 92 push r15 23cf0: ef 92 push r14 23cf2: 0e 94 39 6e call 0xdc72 ; 0xdc72 23cf6: 8d b7 in r24, 0x3d ; 61 23cf8: 9e b7 in r25, 0x3e ; 62 23cfa: 08 96 adiw r24, 0x08 ; 8 23cfc: 0f b6 in r0, 0x3f ; 63 23cfe: f8 94 cli 23d00: 9e bf out 0x3e, r25 ; 62 23d02: 0f be out 0x3f, r0 ; 63 23d04: 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) { 23d06: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 23d0a: 88 23 and r24, r24 23d0c: 09 f4 brne .+2 ; 0x23d10 23d0e: 40 c0 rjmp .+128 ; 0x23d90 MENU_ITEM_BACK_P(STR_SEPARATOR); 23d10: 8b eb ldi r24, 0xBB ; 187 23d12: 99 e8 ldi r25, 0x89 ; 137 23d14: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 23d18: 8c e8 ldi r24, 0x8C ; 140 23d1a: 90 ea ldi r25, 0xA0 ; 160 23d1c: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(" ")); 23d20: 8a e8 ldi r24, 0x8A ; 138 23d22: 90 ea ldi r25, 0xA0 ; 160 23d24: 0f 94 99 d4 call 0x3a932 ; 0x3a932 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 23d28: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23d2c: 81 50 subi r24, 0x01 ; 1 23d2e: 99 0b sbc r25, r25 23d30: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23d34: 28 17 cp r18, r24 23d36: 19 06 cpc r1, r25 23d38: 59 f5 brne .+86 ; 0x23d90 23d3a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23d3e: 88 23 and r24, r24 23d40: 39 f1 breq .+78 ; 0x23d90 lcd_set_cursor(2, menu_row); 23d42: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23d46: 82 e0 ldi r24, 0x02 ; 2 23d48: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 23d4c: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 23d50: 1f 92 push r1 23d52: 8f 93 push r24 23d54: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 23d58: 1f 92 push r1 23d5a: 8f 93 push r24 23d5c: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 23d60: 1f 92 push r1 23d62: 8f 93 push r24 23d64: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 23d68: 1f 92 push r1 23d6a: 8f 93 push r24 23d6c: df 93 push r29 23d6e: cf 93 push r28 23d70: 1f 93 push r17 23d72: 0f 93 push r16 23d74: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 23d78: 8f ea ldi r24, 0xAF ; 175 23d7a: 93 e0 ldi r25, 0x03 ; 3 23d7c: 0e 94 67 70 call 0xe0ce ; 0xe0ce 23d80: 8d b7 in r24, 0x3d ; 61 23d82: 9e b7 in r25, 0x3e ; 62 23d84: 0c 96 adiw r24, 0x0c ; 12 23d86: 0f b6 in r0, 0x3f ; 63 23d88: f8 94 cli 23d8a: 9e bf out 0x3e, r25 ; 62 23d8c: 0f be out 0x3f, r0 ; 63 23d8e: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 23d90: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 23d94: 90 91 5f 06 lds r25, 0x065F ; 0x80065f 23d98: a0 91 60 06 lds r26, 0x0660 ; 0x800660 23d9c: b0 91 61 06 lds r27, 0x0661 ; 0x800661 23da0: 89 2b or r24, r25 23da2: 8a 2b or r24, r26 23da4: 8b 2b or r24, r27 23da6: 09 f4 brne .+2 ; 0x23daa 23da8: 42 c0 rjmp .+132 ; 0x23e2e MENU_ITEM_BACK_P(STR_SEPARATOR); 23daa: 8b eb ldi r24, 0xBB ; 187 23dac: 99 e8 ldi r25, 0x89 ; 137 23dae: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 23db2: 8e e7 ldi r24, 0x7E ; 126 23db4: 9e e4 ldi r25, 0x4E ; 78 23db6: 0e 94 2c 72 call 0xe458 ; 0xe458 23dba: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_BACK_P(PSTR(" ")); 23dbe: 88 e8 ldi r24, 0x88 ; 136 23dc0: 90 ea ldi r25, 0xA0 ; 160 23dc2: 0f 94 99 d4 call 0x3a932 ; 0x3a932 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 23dc6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23dca: 81 50 subi r24, 0x01 ; 1 23dcc: 99 0b sbc r25, r25 23dce: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23dd2: 28 17 cp r18, r24 23dd4: 19 06 cpc r1, r25 23dd6: 59 f5 brne .+86 ; 0x23e2e 23dd8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23ddc: 88 23 and r24, r24 23dde: 39 f1 breq .+78 ; 0x23e2e lcd_set_cursor(2, menu_row); 23de0: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23de4: 82 e0 ldi r24, 0x02 ; 2 23de6: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 23dea: 80 91 61 06 lds r24, 0x0661 ; 0x800661 23dee: 1f 92 push r1 23df0: 8f 93 push r24 23df2: 80 91 60 06 lds r24, 0x0660 ; 0x800660 23df6: 1f 92 push r1 23df8: 8f 93 push r24 23dfa: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 23dfe: 1f 92 push r1 23e00: 8f 93 push r24 23e02: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 23e06: 1f 92 push r1 23e08: 8f 93 push r24 23e0a: df 93 push r29 23e0c: cf 93 push r28 23e0e: 1f 93 push r17 23e10: 0f 93 push r16 23e12: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 23e16: 8f ea ldi r24, 0xAF ; 175 23e18: 93 e0 ldi r25, 0x03 ; 3 23e1a: 0e 94 67 70 call 0xe0ce ; 0xe0ce 23e1e: 8d b7 in r24, 0x3d ; 61 23e20: 9e b7 in r25, 0x3e ; 62 23e22: 0c 96 adiw r24, 0x0c ; 12 23e24: 0f b6 in r0, 0x3f ; 63 23e26: f8 94 cli 23e28: 9e bf out 0x3e, r25 ; 62 23e2a: 0f be out 0x3f, r0 ; 63 23e2c: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 23e2e: 8b eb ldi r24, 0xBB ; 187 23e30: 99 e8 ldi r25, 0x89 ; 137 23e32: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 23e36: 8b e6 ldi r24, 0x6B ; 107 23e38: 9e e4 ldi r25, 0x4E ; 78 23e3a: 0e 94 2c 72 call 0xe458 ; 0xe458 23e3e: 64 e8 ldi r22, 0x84 ; 132 23e40: 79 e3 ldi r23, 0x39 ; 57 23e42: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 23e46: 8b e5 ldi r24, 0x5B ; 91 23e48: 9e e4 ldi r25, 0x4E ; 78 23e4a: 0e 94 2c 72 call 0xe458 ; 0xe458 23e4e: 60 e7 ldi r22, 0x70 ; 112 23e50: 7a e3 ldi r23, 0x3A ; 58 23e52: 0f 94 4c d4 call 0x3a898 ; 0x3a898 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 23e56: 8d e4 ldi r24, 0x4D ; 77 23e58: 9e e4 ldi r25, 0x4E ; 78 23e5a: 0e 94 2c 72 call 0xe458 ; 0xe458 23e5e: 65 e0 ldi r22, 0x05 ; 5 23e60: 74 ee ldi r23, 0xE4 ; 228 23e62: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 23e66: 8f e3 ldi r24, 0x3F ; 63 23e68: 9e e4 ldi r25, 0x4E ; 78 23e6a: 0e 94 2c 72 call 0xe458 ; 0xe458 23e6e: 66 ee ldi r22, 0xE6 ; 230 23e70: 79 e3 ldi r23, 0x39 ; 57 23e72: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 23e76: 80 e3 ldi r24, 0x30 ; 48 23e78: 9e e4 ldi r25, 0x4E ; 78 23e7a: 0e 94 2c 72 call 0xe458 ; 0xe458 23e7e: 6a ed ldi r22, 0xDA ; 218 23e80: 79 e3 ldi r23, 0x39 ; 57 23e82: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 23e86: 85 e2 ldi r24, 0x25 ; 37 23e88: 9e e4 ldi r25, 0x4E ; 78 23e8a: 0e 94 2c 72 call 0xe458 ; 0xe458 23e8e: 64 e3 ldi r22, 0x34 ; 52 23e90: 79 e3 ldi r23, 0x39 ; 57 23e92: 0f 94 4c d4 call 0x3a898 ; 0x3a898 #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 23e96: 62 eb ldi r22, 0xB2 ; 178 23e98: 79 e3 ldi r23, 0x39 ; 57 23e9a: 84 e7 ldi r24, 0x74 ; 116 23e9c: 9e e6 ldi r25, 0x6E ; 110 23e9e: 0f 94 4b d1 call 0x3a296 ; 0x3a296 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(); 23ea2: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 23ea6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23eaa: 8f 5f subi r24, 0xFF ; 255 23eac: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23eb0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23eb4: 8f 5f subi r24, 0xFF ; 255 23eb6: 80 93 14 05 sts 0x0514, r24 ; 0x800514 23eba: 99 ce rjmp .-718 ; 0x23bee _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) 23ebc: 90 91 aa 03 lds r25, 0x03AA ; 0x8003aa 23ec0: 99 23 and r25, r25 23ec2: 09 f4 brne .+2 ; 0x23ec6 23ec4: 88 ce rjmp .-752 ; 0x23bd6 23ec6: 40 91 ab 03 lds r20, 0x03AB ; 0x8003ab 23eca: 50 91 ac 03 lds r21, 0x03AC ; 0x8003ac 23ece: 60 91 ad 03 lds r22, 0x03AD ; 0x8003ad 23ed2: 70 91 ae 03 lds r23, 0x03AE ; 0x8003ae 23ed6: 45 2b or r20, r21 23ed8: 46 2b or r20, r22 23eda: 47 2b or r20, r23 23edc: 09 f0 breq .+2 ; 0x23ee0 23ede: 7b ce rjmp .-778 ; 0x23bd6 23ee0: 8f 5f subi r24, 0xFF ; 255 23ee2: 80 31 cpi r24, 0x10 ; 16 23ee4: 19 f0 breq .+6 ; 0x23eec 23ee6: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 23eea: 75 ce rjmp .-790 ; 0x23bd6 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 23eec: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 23ef0: 72 ce rjmp .-796 ; 0x23bd6 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)); 23ef2: 81 e9 ldi r24, 0x91 ; 145 23ef4: 9e e4 ldi r25, 0x4E ; 78 23ef6: 0e 94 2c 72 call 0xe458 ; 0xe458 23efa: 0e 94 4b 6e call 0xdc96 ; 0xdc96 23efe: 03 cf rjmp .-506 ; 0x23d06 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 23f00: 8e e9 ldi r24, 0x9E ; 158 23f02: 90 ea ldi r25, 0xA0 ; 160 23f04: 0f 94 99 d4 call 0x3a932 ; 0x3a932 23f08: fe ce rjmp .-516 ; 0x23d06 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 23f0a: df 91 pop r29 23f0c: cf 91 pop r28 23f0e: 1f 91 pop r17 23f10: 0f 91 pop r16 23f12: ff 90 pop r15 23f14: ef 90 pop r14 23f16: 08 95 ret 00023f18 : { 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) { 23f18: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 23f1c: 81 11 cpse r24, r1 23f1e: 19 c0 rjmp .+50 ; 0x23f52 lcd_clear(); 23f20: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 23f24: 84 ea ldi r24, 0xA4 ; 164 23f26: 9d e4 ldi r25, 0x4D ; 77 23f28: 0e 94 2c 72 call 0xe458 ; 0xe458 23f2c: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_putc(':'); 23f30: 8a e3 ldi r24, 0x3A ; 58 23f32: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_set_cursor(10, 1); 23f36: 61 e0 ldi r22, 0x01 ; 1 23f38: 8a e0 ldi r24, 0x0A ; 10 23f3a: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 23f3e: 88 ea ldi r24, 0xA8 ; 168 23f40: 9c e0 ldi r25, 0x0C ; 12 23f42: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 23f46: 4a e0 ldi r20, 0x0A ; 10 23f48: 0e 94 b4 6f call 0xdf68 ; 0xdf68 _md->initialized = true; 23f4c: 81 e0 ldi r24, 0x01 ; 1 23f4e: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } menu_back_if_clicked(); 23f52: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 00023f56 : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 23f56: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_status_message_idx = 0; // Re-draw message from beginning 23f5a: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.450> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 23f5e: 20 e0 ldi r18, 0x00 ; 0 23f60: 41 e0 ldi r20, 0x01 ; 1 23f62: 70 e0 ldi r23, 0x00 ; 0 23f64: 60 e0 ldi r22, 0x00 ; 0 23f66: 86 e2 ldi r24, 0x26 ; 38 23f68: 9a e3 ldi r25, 0x3A ; 58 23f6a: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 menu_depth = 0; 23f6e: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 23f72: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 } 23f76: 08 95 ret 00023f78 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 23f78: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 23f7c: 85 ee ldi r24, 0xE5 ; 229 23f7e: 90 e5 ldi r25, 0x50 ; 80 23f80: 0e 94 2c 72 call 0xe458 ; 0xe458 23f84: ac 01 movw r20, r24 23f86: 60 e0 ldi r22, 0x00 ; 0 23f88: 80 e0 ldi r24, 0x00 ; 0 23f8a: 0e 94 74 6e call 0xdce8 ; 0xdce8 pid_temp += lcd_encoder; 23f8e: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.443> 23f92: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.443+0x1> 23f96: 20 91 70 06 lds r18, 0x0670 ; 0x800670 23f9a: 30 91 71 06 lds r19, 0x0671 ; 0x800671 23f9e: 82 0f add r24, r18 23fa0: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 23fa2: 82 33 cpi r24, 0x32 ; 50 23fa4: 21 e0 ldi r18, 0x01 ; 1 23fa6: 92 07 cpc r25, r18 23fa8: 50 f1 brcs .+84 ; 0x23ffe 23faa: 81 e3 ldi r24, 0x31 ; 49 23fac: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 23fae: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.443+0x1> 23fb2: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.443> lcd_encoder = 0; 23fb6: 10 92 71 06 sts 0x0671, r1 ; 0x800671 23fba: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_set_cursor(1, 2); 23fbe: 62 e0 ldi r22, 0x02 ; 2 23fc0: 81 e0 ldi r24, 0x01 ; 1 23fc2: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%3u"), pid_temp); 23fc6: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.443+0x1> 23fca: 8f 93 push r24 23fcc: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.443> 23fd0: 8f 93 push r24 23fd2: 8b e6 ldi r24, 0x6B ; 107 23fd4: 92 ea ldi r25, 0xA2 ; 162 23fd6: 9f 93 push r25 23fd8: 8f 93 push r24 23fda: 0e 94 39 6e call 0xdc72 ; 0xdc72 if (lcd_clicked()) { 23fde: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 23fe2: 0f 90 pop r0 23fe4: 0f 90 pop r0 23fe6: 0f 90 pop r0 23fe8: 0f 90 pop r0 23fea: 88 23 and r24, r24 23fec: 71 f0 breq .+28 ; 0x2400a lcd_commands_type = LcdCommands::PidExtruder; 23fee: 83 e0 ldi r24, 0x03 ; 3 23ff0: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 23ff4: 0f 94 ab 1f call 0x23f56 ; 0x23f56 lcd_update(2); 23ff8: 82 e0 ldi r24, 0x02 ; 2 23ffa: 0c 94 27 6e jmp 0xdc4e ; 0xdc4e { 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; 23ffe: 8a 30 cpi r24, 0x0A ; 10 24000: 91 05 cpc r25, r1 24002: a8 f6 brcc .-86 ; 0x23fae 24004: 8a e0 ldi r24, 0x0A ; 10 24006: 90 e0 ldi r25, 0x00 ; 0 24008: d2 cf rjmp .-92 ; 0x23fae lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 2400a: 08 95 ret 0002400c : } 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){ 2400c: 0f 93 push r16 2400e: 1f 93 push r17 24010: cf 93 push r28 24012: df 93 push r29 24014: ec 01 movw r28, r24 24016: cb 01 movw r24, r22 24018: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 2401a: 4a 81 ldd r20, Y+2 ; 0x02 2401c: 41 30 cpi r20, 0x01 ; 1 2401e: 29 f0 breq .+10 ; 0x2402a 24020: 88 f0 brcs .+34 ; 0x24044 24022: 42 30 cpi r20, 0x02 ; 2 24024: 09 f1 breq .+66 ; 0x24068 24026: 43 30 cpi r20, 0x03 ; 3 24028: d1 f4 brne .+52 ; 0x2405e 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 ){ 2402a: 8b 81 ldd r24, Y+3 ; 0x03 2402c: 81 11 cpse r24, r1 2402e: 25 c0 rjmp .+74 ; 0x2407a state = next_state; // advance to the next state 24030: 82 e0 ldi r24, 0x02 ; 2 24032: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 24034: 63 e0 ldi r22, 0x03 ; 3 24036: 8c e9 ldi r24, 0x9C ; 156 24038: 9d e9 ldi r25, 0x9D ; 157 2403a: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 2403e: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 24040: 8b 83 std Y+3, r24 ; 0x03 24042: 0d c0 rjmp .+26 ; 0x2405e //! @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 ){ 24044: a9 01 movw r20, r18 24046: 98 01 movw r18, r16 24048: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2404c: 18 16 cp r1, r24 2404e: 3c f4 brge .+14 ; 0x2405e lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 24050: 63 e0 ldi r22, 0x03 ; 3 24052: 88 81 ld r24, Y 24054: 99 81 ldd r25, Y+1 ; 0x01 24056: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 state = States::TempAboveMintemp; 2405a: 81 e0 ldi r24, 0x01 ; 1 2405c: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 2405e: df 91 pop r29 24060: cf 91 pop r28 24062: 1f 91 pop r17 24064: 0f 91 pop r16 24066: 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 ){ 24068: 8b 81 ldd r24, Y+3 ; 0x03 2406a: 81 11 cpse r24, r1 2406c: 06 c0 rjmp .+12 ; 0x2407a 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); 2406e: 88 81 ld r24, Y 24070: 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 24072: 23 e0 ldi r18, 0x03 ; 3 24074: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 24076: 63 e0 ldi r22, 0x03 ; 3 24078: e0 cf rjmp .-64 ; 0x2403a repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 2407a: 81 50 subi r24, 0x01 ; 1 2407c: e1 cf rjmp .-62 ; 0x24040 0002407e : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 2407e: cf 93 push r28 if(IsStopped() == false) { 24080: 90 91 11 05 lds r25, 0x0511 ; 0x800511 24084: 91 11 cpse r25, r1 24086: 18 c0 rjmp .+48 ; 0x240b8 24088: c6 2f mov r28, r22 if (isPreheat) { 2408a: 88 23 and r24, r24 2408c: c9 f0 breq .+50 ; 0x240c0 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 2408e: 80 e4 ldi r24, 0x40 ; 64 24090: 9d e9 ldi r25, 0x9D ; 157 24092: 66 23 and r22, r22 24094: 11 f0 breq .+4 ; 0x2409a 24096: 8e e4 ldi r24, 0x4E ; 78 24098: 9d e9 ldi r25, 0x9D ; 157 2409a: 63 e0 ldi r22, 0x03 ; 3 2409c: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 SERIAL_ERROR_START; 240a0: 8a e9 ldi r24, 0x9A ; 154 240a2: 9a ea ldi r25, 0xAA ; 170 240a4: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 240a8: 8d e1 ldi r24, 0x1D ; 29 240aa: 9d e9 ldi r25, 0x9D ; 157 { if(IsStopped() == false) { if (isPreheat) { lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 240ac: c1 11 cpse r28, r1 240ae: 02 c0 rjmp .+4 ; 0x240b4 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 240b0: 8b ef ldi r24, 0xFB ; 251 240b2: 9c e9 ldi r25, 0x9C ; 156 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"); 240b4: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 240b8: 80 e0 ldi r24, 0x00 ; 0 } 240ba: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 240bc: 0c 94 2c 79 jmp 0xf258 ; 0xf258 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); 240c0: 87 ed ldi r24, 0xD7 ; 215 240c2: 9c e9 ldi r25, 0x9C ; 156 240c4: 66 23 and r22, r22 240c6: 11 f0 breq .+4 ; 0x240cc 240c8: 87 ee ldi r24, 0xE7 ; 231 240ca: 9c e9 ldi r25, 0x9C ; 156 240cc: 63 e0 ldi r22, 0x03 ; 3 240ce: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 SERIAL_ERROR_START; 240d2: 8a e9 ldi r24, 0x9A ; 154 240d4: 9a ea ldi r25, 0xAA ; 170 240d6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 240da: 8e eb ldi r24, 0xBE ; 190 240dc: 9c e9 ldi r25, 0x9C ; 156 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) { 240de: c1 11 cpse r28, r1 240e0: e9 cf rjmp .-46 ; 0x240b4 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 240e2: 86 ea ldi r24, 0xA6 ; 166 240e4: 9c e9 ldi r25, 0x9C ; 156 240e6: e6 cf rjmp .-52 ; 0x240b4 000240e8 : static void Sound_DoSound_Prompt(void) { backlight_wake(2); 240e8: 82 e0 ldi r24, 0x02 ; 2 240ea: 0e 94 f5 89 call 0x113ea ; 0x113ea WRITE(BEEPER,HIGH); 240ee: 9f b7 in r25, 0x3f ; 63 240f0: f8 94 cli 240f2: e2 e0 ldi r30, 0x02 ; 2 240f4: f1 e0 ldi r31, 0x01 ; 1 240f6: 80 81 ld r24, Z 240f8: 84 60 ori r24, 0x04 ; 4 240fa: 80 83 st Z, r24 240fc: 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); 240fe: 2f ef ldi r18, 0xFF ; 255 24100: 89 e6 ldi r24, 0x69 ; 105 24102: 98 e1 ldi r25, 0x18 ; 24 24104: 21 50 subi r18, 0x01 ; 1 24106: 80 40 sbci r24, 0x00 ; 0 24108: 90 40 sbci r25, 0x00 ; 0 2410a: e1 f7 brne .-8 ; 0x24104 2410c: 00 c0 rjmp .+0 ; 0x2410e 2410e: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 24110: 9f b7 in r25, 0x3f ; 63 24112: f8 94 cli 24114: 80 81 ld r24, Z 24116: 8b 7f andi r24, 0xFB ; 251 24118: 80 83 st Z, r24 2411a: 9f bf out 0x3f, r25 ; 63 } 2411c: 08 95 ret 0002411e : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 2411e: 81 30 cpi r24, 0x01 ; 1 24120: 21 f4 brne .+8 ; 0x2412a case STATE_ON: lcd_puts_P(_N(" 1")); 24122: 8a e4 ldi r24, 0x4A ; 74 24124: 9f e6 ldi r25, 0x6F ; 111 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 24126: 0c 94 4b 6e jmp 0xdc96 ; 0xdc96 2412a: 86 e4 ldi r24, 0x46 ; 70 2412c: 9f e6 ldi r25, 0x6F ; 111 2412e: fb cf rjmp .-10 ; 0x24126 00024130 : //! @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) { 24130: cf 92 push r12 24132: df 92 push r13 24134: ef 92 push r14 24136: ff 92 push r15 24138: 0f 93 push r16 2413a: 1f 93 push r17 2413c: cf 93 push r28 2413e: df 93 push r29 24140: d8 2f mov r29, r24 24142: 6b 01 movw r12, r22 24144: 7a 01 movw r14, r20 24146: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 24148: 40 e2 ldi r20, 0x20 ; 32 2414a: 81 11 cpse r24, r1 2414c: 01 c0 rjmp .+2 ; 0x24150 2414e: 4e e3 ldi r20, 0x3E ; 62 24150: 63 e0 ldi r22, 0x03 ; 3 24152: 80 e0 ldi r24, 0x00 ; 0 24154: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_puts_P(first_choice); 24158: c6 01 movw r24, r12 2415a: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2415e: 40 e2 ldi r20, 0x20 ; 32 24160: d1 30 cpi r29, 0x01 ; 1 24162: 09 f4 brne .+2 ; 0x24166 24164: 4e e3 ldi r20, 0x3E ; 62 24166: 63 e0 ldi r22, 0x03 ; 3 24168: 8c 2f mov r24, r28 2416a: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_puts_P(second_choice); 2416e: c7 01 movw r24, r14 24170: 0e 94 4b 6e call 0xdc96 ; 0xdc96 if (third_choice) { 24174: 01 15 cp r16, r1 24176: 11 05 cpc r17, r1 24178: 19 f1 breq .+70 ; 0x241c0 2417a: c8 01 movw r24, r16 2417c: 0f 94 12 da call 0x3b424 ; 0x3b424 <__strlen_P> 24180: d8 2e mov r13, r24 24182: c7 01 movw r24, r14 24184: 0f 94 12 da call 0x3b424 ; 0x3b424 <__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; 24188: 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;} 2418a: 93 e1 ldi r25, 0x13 ; 19 2418c: 9d 19 sub r25, r13 2418e: 8c 0f add r24, r28 24190: 89 17 cp r24, r25 24192: 08 f4 brcc .+2 ; 0x24196 24194: 89 2f mov r24, r25 24196: 83 31 cpi r24, 0x13 ; 19 24198: 08 f0 brcs .+2 ; 0x2419c 2419a: 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 ? '>': ' '); 2419c: 40 e2 ldi r20, 0x20 ; 32 2419e: d2 30 cpi r29, 0x02 ; 2 241a0: 09 f4 brne .+2 ; 0x241a4 241a2: 4e e3 ldi r20, 0x3E ; 62 241a4: 63 e0 ldi r22, 0x03 ; 3 241a6: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_puts_P(third_choice); 241aa: c8 01 movw r24, r16 } } 241ac: df 91 pop r29 241ae: cf 91 pop r28 241b0: 1f 91 pop r17 241b2: 0f 91 pop r16 241b4: ff 90 pop r15 241b6: ef 90 pop r14 241b8: df 90 pop r13 241ba: 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); 241bc: 0c 94 4b 6e jmp 0xdc96 ; 0xdc96 } } 241c0: df 91 pop r29 241c2: cf 91 pop r28 241c4: 1f 91 pop r17 241c6: 0f 91 pop r16 241c8: ff 90 pop r15 241ca: ef 90 pop r14 241cc: df 90 pop r13 241ce: cf 90 pop r12 241d0: 08 95 ret 000241d2 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 241d2: cf 93 push r28 241d4: df 93 push r29 241d6: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 241d8: 80 e0 ldi r24, 0x00 ; 0 241da: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_clear(); 241de: 0e 94 93 6e call 0xdd26 ; 0xdd26 return lcd_display_message_fullscreen_nonBlocking_P(msg); 241e2: ce 01 movw r24, r28 } 241e4: df 91 pop r29 241e6: 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); 241e8: 0d 94 b3 15 jmp 0x22b66 ; 0x22b66 000241ec : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 241ec: cf 92 push r12 241ee: df 92 push r13 241f0: ef 92 push r14 241f2: ff 92 push r15 241f4: 0f 93 push r16 241f6: 1f 93 push r17 241f8: cf 93 push r28 241fa: df 93 push r29 241fc: d8 2e mov r13, r24 241fe: 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) 24200: 01 e0 ldi r16, 0x01 ; 1 24202: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 24206: 81 11 cpse r24, r1 24208: 01 c0 rjmp .+2 ; 0x2420c 2420a: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 2420c: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 24210: 8d 2d mov r24, r13 24212: 9c 2d mov r25, r12 24214: 0f 94 e9 20 call 0x241d2 ; 0x241d2 24218: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 2421a: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 KEEPALIVE_STATE(PAUSED_FOR_USER); 2421e: 84 e0 ldi r24, 0x04 ; 4 24220: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be * @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); 24224: 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) { 24226: 20 97 sbiw r28, 0x00 ; 0 24228: 29 f4 brne .+10 ; 0x24234 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 2422a: 49 e8 ldi r20, 0x89 ; 137 2422c: 63 e0 ldi r22, 0x03 ; 3 2422e: 83 e1 ldi r24, 0x13 ; 19 24230: 0e 94 80 6e call 0xdd00 ; 0xdd00 * @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); 24234: 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); 24236: 82 e3 ldi r24, 0x32 ; 50 24238: 90 e0 ldi r25, 0x00 ; 0 2423a: 0e 94 6c 8c call 0x118d8 ; 0x118d8 if (lcd_clicked()) { 2423e: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 24242: 88 23 and r24, r24 24244: 81 f0 breq .+32 ; 0x24266 if (msg_next == NULL) { 24246: 20 97 sbiw r28, 0x00 ; 0 24248: 81 f4 brne .+32 ; 0x2426a KEEPALIVE_STATE(IN_HANDLER); 2424a: 82 e0 ldi r24, 0x02 ; 2 2424c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 24250: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 24254: df 91 pop r29 24256: cf 91 pop r28 24258: 1f 91 pop r17 2425a: 0f 91 pop r16 2425c: ff 90 pop r15 2425e: ef 90 pop r14 24260: df 90 pop r13 24262: cf 90 pop r12 24264: 08 95 ret 24266: 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) { 24268: 31 f7 brne .-52 ; 0x24236 else { break; } } } if (multi_screen) { 2426a: e1 14 cp r14, r1 2426c: f1 04 cpc r15, r1 2426e: d9 f2 breq .-74 ; 0x24226 if (msg_next == NULL) 24270: 20 97 sbiw r28, 0x00 ; 0 24272: 11 f4 brne .+4 ; 0x24278 msg_next = msg; 24274: cd 2d mov r28, r13 24276: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 24278: ce 01 movw r24, r28 2427a: 0f 94 e9 20 call 0x241d2 ; 0x241d2 2427e: ec 01 movw r28, r24 24280: d2 cf rjmp .-92 ; 0x24226 00024282 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 24282: cf 93 push r28 24284: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 24286: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 disable_x(); 2428a: 17 9a sbi 0x02, 7 ; 2 2428c: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 24290: 16 9a sbi 0x02, 6 ; 2 24292: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_z(); disable_e0(); 24296: 14 9a sbi 0x02, 4 ; 2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 24298: 10 92 73 06 sts 0x0673, r1 ; 0x800673 2429c: 10 92 72 06 sts 0x0672, r1 ; 0x800672 242a0: 68 2f mov r22, r24 242a2: 86 ea ldi r24, 0xA6 ; 166 242a4: 9f e0 ldi r25, 0x0F ; 15 242a6: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 242aa: 6c 2f mov r22, r28 242ac: 8f ea ldi r24, 0xAF ; 175 242ae: 9f e0 ldi r25, 0x0F ; 15 242b0: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 // 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) { 242b4: cc 23 and r28, r28 242b6: 89 f0 breq .+34 ; 0x242da SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 242b8: 8a ea ldi r24, 0xAA ; 170 242ba: 92 ea ldi r25, 0xA2 ; 162 242bc: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 242c0: 83 e1 ldi r24, 0x13 ; 19 242c2: 91 e5 ldi r25, 0x51 ; 81 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 242c4: 0e 94 2c 72 call 0xe458 ; 0xe458 242c8: 0f 94 f6 20 call 0x241ec ; 0x241ec } lcd_update_enable(true); 242cc: 81 e0 ldi r24, 0x01 ; 1 242ce: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_update(2); 242d2: 82 e0 ldi r24, 0x02 ; 2 } 242d4: 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); 242d6: 0c 94 27 6e jmp 0xdc4e ; 0xdc4e 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."); 242da: 8f e6 ldi r24, 0x6F ; 111 242dc: 92 ea ldi r25, 0xA2 ; 162 242de: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 242e2: 88 ef ldi r24, 0xF8 ; 248 242e4: 90 e5 ldi r25, 0x50 ; 80 242e6: ee cf rjmp .-36 ; 0x242c4 000242e8 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 242e8: 1f 93 push r17 242ea: cf 93 push r28 242ec: 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); 242ee: 64 e6 ldi r22, 0x64 ; 100 242f0: 70 e0 ldi r23, 0x00 ; 0 242f2: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 242f6: 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++) { 242f8: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 242fa: 4e e2 ldi r20, 0x2E ; 46 242fc: 63 e0 ldi r22, 0x03 ; 3 242fe: 81 2f mov r24, r17 24300: 0e 94 80 6e call 0xdd00 ; 0xdd00 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 24304: ce 01 movw r24, r28 24306: 0e 94 6c 8c call 0x118d8 ; 0x118d8 2430a: ce 01 movw r24, r28 2430c: 0e 94 6c 8c call 0x118d8 ; 0x118d8 24310: ce 01 movw r24, r28 24312: 0e 94 6c 8c call 0x118d8 ; 0x118d8 24316: ce 01 movw r24, r28 24318: 0e 94 6c 8c call 0x118d8 ; 0x118d8 2431c: ce 01 movw r24, r28 2431e: 0e 94 6c 8c call 0x118d8 ; 0x118d8 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 24322: 1f 5f subi r17, 0xFF ; 255 24324: 14 31 cpi r17, 0x14 ; 20 24326: 49 f7 brne .-46 ; 0x242fa //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 24328: df 91 pop r29 2432a: cf 91 pop r28 2432c: 1f 91 pop r17 2432e: 08 95 ret 00024330 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 24330: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 24334: 08 95 ret 00024336 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 24336: cf 93 push r28 MENU_BEGIN(); 24338: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 2433c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24340: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24344: 84 30 cpi r24, 0x04 ; 4 24346: 08 f0 brcs .+2 ; 0x2434a 24348: a1 c0 rjmp .+322 ; 0x2448c 2434a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2434e: 8f e5 ldi r24, 0x5F ; 95 24350: 9f e0 ldi r25, 0x0F ; 15 24352: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 24356: 81 11 cpse r24, r1 24358: 10 c0 rjmp .+32 ; 0x2437a { ON_MENU_LEAVE( 2435a: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 2435e: 81 11 cpse r24, r1 24360: 0f 94 98 21 call 0x24330 ; 0x24330 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 24364: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 24368: 8a 30 cpi r24, 0x0A ; 10 2436a: 09 f4 brne .+2 ; 0x2436e 2436c: 8c c0 rjmp .+280 ; 0x24486 2436e: 8b e3 ldi r24, 0x3B ; 59 24370: 98 e4 ldi r25, 0x48 ; 72 24372: 0e 94 2c 72 call 0xe458 ; 0xe458 24376: 0f 94 99 d4 call 0x3a932 ; 0x3a932 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(); 2437a: 0f 94 39 17 call 0x22e72 ; 0x22e72 2437e: 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); 24380: 82 e1 ldi r24, 0x12 ; 18 24382: 92 ea ldi r25, 0xA2 ; 162 24384: cc 23 and r28, r28 24386: 11 f0 breq .+4 ; 0x2438c 24388: 81 e2 ldi r24, 0x21 ; 33 2438a: 92 ea ldi r25, 0xA2 ; 162 2438c: 64 ec ldi r22, 0xC4 ; 196 2438e: 79 e3 ldi r23, 0x39 ; 57 24390: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 24394: 87 ef ldi r24, 0xF7 ; 247 24396: 91 ea ldi r25, 0xA1 ; 161 24398: cc 23 and r28, r28 2439a: 11 f0 breq .+4 ; 0x243a0 2439c: 86 e0 ldi r24, 0x06 ; 6 2439e: 92 ea ldi r25, 0xA2 ; 162 243a0: 64 ed ldi r22, 0xD4 ; 212 243a2: 79 e3 ldi r23, 0x39 ; 57 243a4: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 243a8: 8b ed ldi r24, 0xDB ; 219 243aa: 91 ea ldi r25, 0xA1 ; 161 243ac: cc 23 and r28, r28 243ae: 11 f0 breq .+4 ; 0x243b4 243b0: 8b ee ldi r24, 0xEB ; 235 243b2: 91 ea ldi r25, 0xA1 ; 161 243b4: 6e e4 ldi r22, 0x4E ; 78 243b6: 7a e3 ldi r23, 0x3A ; 58 243b8: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 243bc: 8f eb ldi r24, 0xBF ; 191 243be: 91 ea ldi r25, 0xA1 ; 161 243c0: cc 23 and r28, r28 243c2: 11 f0 breq .+4 ; 0x243c8 243c4: 8f ec ldi r24, 0xCF ; 207 243c6: 91 ea ldi r25, 0xA1 ; 161 243c8: 6a e7 ldi r22, 0x7A ; 122 243ca: 7a e3 ldi r23, 0x3A ; 58 243cc: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 243d0: 84 ea ldi r24, 0xA4 ; 164 243d2: 91 ea ldi r25, 0xA1 ; 161 243d4: cc 23 and r28, r28 243d6: 11 f0 breq .+4 ; 0x243dc 243d8: 83 eb ldi r24, 0xB3 ; 179 243da: 91 ea ldi r25, 0xA1 ; 161 243dc: 66 e3 ldi r22, 0x36 ; 54 243de: 7a e3 ldi r23, 0x3A ; 58 243e0: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 243e4: 89 e8 ldi r24, 0x89 ; 137 243e6: 91 ea ldi r25, 0xA1 ; 161 243e8: cc 23 and r28, r28 243ea: 11 f0 breq .+4 ; 0x243f0 243ec: 88 e9 ldi r24, 0x98 ; 152 243ee: 91 ea ldi r25, 0xA1 ; 161 243f0: 6e e3 ldi r22, 0x3E ; 62 243f2: 7a e3 ldi r23, 0x3A ; 58 243f4: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 243f8: 8d e6 ldi r24, 0x6D ; 109 243fa: 91 ea ldi r25, 0xA1 ; 161 243fc: cc 23 and r28, r28 243fe: 11 f0 breq .+4 ; 0x24404 24400: 8d e7 ldi r24, 0x7D ; 125 24402: 91 ea ldi r25, 0xA1 ; 161 24404: 68 eb ldi r22, 0xB8 ; 184 24406: 79 e3 ldi r23, 0x39 ; 57 24408: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 2440c: 81 e5 ldi r24, 0x51 ; 81 2440e: 91 ea ldi r25, 0xA1 ; 161 24410: cc 23 and r28, r28 24412: 11 f0 breq .+4 ; 0x24418 24414: 81 e6 ldi r24, 0x61 ; 97 24416: 91 ea ldi r25, 0xA1 ; 161 24418: 68 ea ldi r22, 0xA8 ; 168 2441a: 79 e3 ldi r23, 0x39 ; 57 2441c: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 24420: 85 e3 ldi r24, 0x35 ; 53 24422: 91 ea ldi r25, 0xA1 ; 161 24424: cc 23 and r28, r28 24426: 11 f0 breq .+4 ; 0x2442c 24428: 85 e4 ldi r24, 0x45 ; 69 2442a: 91 ea ldi r25, 0xA1 ; 161 2442c: 6a ea ldi r22, 0xAA ; 170 2442e: 79 e3 ldi r23, 0x39 ; 57 24430: 0f 94 4c d4 call 0x3a898 ; 0x3a898 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); 24434: 8a e1 ldi r24, 0x1A ; 26 24436: 91 ea ldi r25, 0xA1 ; 161 24438: cc 23 and r28, r28 2443a: 11 f0 breq .+4 ; 0x24440 2443c: 89 e2 ldi r24, 0x29 ; 41 2443e: 91 ea ldi r25, 0xA1 ; 161 24440: 6e e0 ldi r22, 0x0E ; 14 24442: 79 e3 ldi r23, 0x39 ; 57 24444: 0f 94 4c d4 call 0x3a898 ; 0x3a898 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 24448: 8f e5 ldi r24, 0x5F ; 95 2444a: 9f e0 ldi r25, 0x0F ; 15 2444c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 24450: 81 11 cpse r24, r1 24452: 0c c0 rjmp .+24 ; 0x2446c 24454: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 24458: 89 30 cpi r24, 0x09 ; 9 2445a: 41 f4 brne .+16 ; 0x2446c 2445c: 82 e4 ldi r24, 0x42 ; 66 2445e: 9f e4 ldi r25, 0x4F ; 79 24460: 0e 94 2c 72 call 0xe458 ; 0xe458 24464: 68 ef ldi r22, 0xF8 ; 248 24466: 79 e3 ldi r23, 0x39 ; 57 24468: 0f 94 4b d1 call 0x3a296 ; 0x3a296 MENU_END(); 2446c: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 24470: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24474: 8f 5f subi r24, 0xFF ; 255 24476: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2447a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2447e: 8f 5f subi r24, 0xFF ; 255 24480: 80 93 14 05 sts 0x0514, r24 ; 0x800514 24484: 5d cf rjmp .-326 ; 0x24340 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)); 24486: 8f e4 ldi r24, 0x4F ; 79 24488: 99 e4 ldi r25, 0x49 ; 73 2448a: 73 cf rjmp .-282 ; 0x24372 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(); } 2448c: cf 91 pop r28 2448e: 08 95 ret 00024490 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 24490: 89 e0 ldi r24, 0x09 ; 9 24492: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 lcd_generic_preheat_menu(); 24496: 0d 94 9b 21 jmp 0x24336 ; 0x24336 0002449a : // 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); 2449a: 81 e0 ldi r24, 0x01 ; 1 2449c: 0e 94 56 6e call 0xdcac ; 0xdcac if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 244a0: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 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; 244a4: 90 91 a2 13 lds r25, 0x13A2 ; 0x8013a2 244a8: 93 36 cpi r25, 0x63 ; 99 244aa: 09 f4 brne .+2 ; 0x244ae 244ac: 9f ef ldi r25, 0xFF ; 255 244ae: 89 13 cpse r24, r25 244b0: 0e c0 rjmp .+28 ; 0x244ce lcd_putc('F'); 244b2: 86 e4 ldi r24, 0x46 ; 70 244b4: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 244b8: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 244bc: 8f 3f cpi r24, 0xFF ; 255 244be: 29 f0 breq .+10 ; 0x244ca 244c0: 8f 5c subi r24, 0xCF ; 207 244c2: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 244c6: 83 e0 ldi r24, 0x03 ; 3 244c8: 08 95 ret 244ca: 8f e3 ldi r24, 0x3F ; 63 244cc: fa cf rjmp .-12 ; 0x244c2 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 244ce: 8f 3f cpi r24, 0xFF ; 255 244d0: 89 f0 breq .+34 ; 0x244f4 244d2: 8f 5c subi r24, 0xCF ; 207 244d4: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_putc('>'); 244d8: 8e e3 ldi r24, 0x3E ; 62 244da: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 244de: 80 91 a2 13 lds r24, 0x13A2 ; 0x8013a2 244e2: 83 36 cpi r24, 0x63 ; 99 244e4: 49 f0 breq .+18 ; 0x244f8 lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 244e6: 8f 3f cpi r24, 0xFF ; 255 244e8: 39 f0 breq .+14 ; 0x244f8 244ea: 8f 5c subi r24, 0xCF ; 207 244ec: 0e 94 4f 6e call 0xdc9e ; 0xdc9e chars += 3; 244f0: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 244f2: 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'); 244f4: 8f e3 ldi r24, 0x3F ; 63 244f6: ee cf rjmp .-36 ; 0x244d4 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 244f8: 8f e3 ldi r24, 0x3F ; 63 244fa: f8 cf rjmp .-16 ; 0x244ec 000244fc : } // 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); 244fc: 5f 93 push r21 244fe: 4f 93 push r20 24500: 7f 93 push r23 24502: 6f 93 push r22 24504: 28 2f mov r18, r24 24506: 08 2e mov r0, r24 24508: 00 0c add r0, r0 2450a: 33 0b sbc r19, r19 2450c: 3f 93 push r19 2450e: 8f 93 push r24 24510: 80 e0 ldi r24, 0x00 ; 0 24512: 9e e6 ldi r25, 0x6E ; 110 24514: 9f 93 push r25 24516: 8f 93 push r24 24518: 0e 94 39 6e call 0xdc72 ; 0xdc72 lcd_space(9 - chars); 2451c: 2d b7 in r18, 0x3d ; 61 2451e: 3e b7 in r19, 0x3e ; 62 24520: 28 5f subi r18, 0xF8 ; 248 24522: 3f 4f sbci r19, 0xFF ; 255 24524: 0f b6 in r0, 0x3f ; 63 24526: f8 94 cli 24528: 3e bf out 0x3e, r19 ; 62 2452a: 0f be out 0x3f, r0 ; 63 2452c: 2d bf out 0x3d, r18 ; 61 2452e: 99 e0 ldi r25, 0x09 ; 9 24530: 98 1b sub r25, r24 24532: 89 2f mov r24, r25 24534: 0c 94 56 6e jmp 0xdcac ; 0xdcac 00024538 : default: return false; } } void lcd_print_target_temps_first_line() { 24538: cf 93 push r28 2453a: df 93 push r29 lcd_home(); 2453c: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 24540: c0 91 b6 0d lds r28, 0x0DB6 ; 0x800db6 24544: d0 91 b7 0d lds r29, 0x0DB7 ; 0x800db7 24548: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 2454c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 24550: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 24554: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 24558: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2455c: ae 01 movw r20, r28 2455e: 82 e8 ldi r24, 0x82 ; 130 24560: 0f 94 7e 22 call 0x244fc ; 0x244fc lcd_set_cursor(10, 0); 24564: 60 e0 ldi r22, 0x00 ; 0 24566: 8a e0 ldi r24, 0x0A ; 10 24568: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 2456c: c0 91 72 06 lds r28, 0x0672 ; 0x800672 24570: d0 91 73 06 lds r29, 0x0673 ; 0x800673 int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 24574: 20 97 sbiw r28, 0x00 ; 0 24576: 81 f0 breq .+32 ; 0x24598 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 24578: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 2457c: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 24580: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 24584: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 24588: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2458c: ae 01 movw r20, r28 2458e: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 24590: df 91 pop r29 24592: 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); 24594: 0d 94 7e 22 jmp 0x244fc ; 0x244fc } else { lcd_space(10); 24598: 8a e0 ldi r24, 0x0A ; 10 } } 2459a: df 91 pop r29 2459c: 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); 2459e: 0c 94 56 6e jmp 0xdcac ; 0xdcac 000245a2 : 245a2: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 245a6: 0f 94 9c 22 call 0x24538 ; 0x24538 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 245aa: 8b ed ldi r24, 0xDB ; 219 245ac: 9e e4 ldi r25, 0x4E ; 78 245ae: 0e 94 2c 72 call 0xe458 ; 0xe458 245b2: ac 01 movw r20, r24 245b4: 61 e0 ldi r22, 0x01 ; 1 245b6: 80 e0 ldi r24, 0x00 ; 0 245b8: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(0,2); 245bc: 62 e0 ldi r22, 0x02 ; 2 245be: 80 e0 ldi r24, 0x00 ; 0 245c0: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 switch(eFilamentAction) { 245c4: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 245c8: 83 30 cpi r24, 0x03 ; 3 245ca: 81 f1 breq .+96 ; 0x2462c 245cc: 48 f4 brcc .+18 ; 0x245e0 245ce: 81 30 cpi r24, 0x01 ; 1 245d0: 60 f0 brcs .+24 ; 0x245ea case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 245d2: 88 ec ldi r24, 0xC8 ; 200 245d4: 9e e4 ldi r25, 0x4E ; 78 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 245d6: 0e 94 2c 72 call 0xe458 ; 0xe458 245da: 0e 94 4b 6e call 0xdc96 ; 0xdc96 245de: 05 c0 rjmp .+10 ; 0x245ea 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) { 245e0: 85 30 cpi r24, 0x05 ; 5 245e2: 21 f1 breq .+72 ; 0x2462c 245e4: b0 f3 brcs .-20 ; 0x245d2 245e6: 88 30 cpi r24, 0x08 ; 8 245e8: a1 f3 breq .-24 ; 0x245d2 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 245ea: 0e 94 7d 70 call 0xe0fa ; 0xe0fa #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 245ee: 81 11 cpse r24, r1 245f0: 09 c0 rjmp .+18 ; 0x24604 245f2: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 245f6: 81 50 subi r24, 0x01 ; 1 245f8: 82 30 cpi r24, 0x02 ; 2 245fa: 28 f5 brcc .+74 ; 0x24646 245fc: 80 91 ae 17 lds r24, 0x17AE ; 0x8017ae 24600: 88 23 and r24, r24 24602: 09 f1 breq .+66 ; 0x24646 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 24604: 80 91 63 06 lds r24, 0x0663 ; 0x800663 24608: 81 11 cpse r24, r1 2460a: 13 c0 rjmp .+38 ; 0x24632 2460c: 83 e0 ldi r24, 0x03 ; 3 2460e: 0f 94 7a d4 call 0x3a8f4 ; 0x3a8f4 switch(eFilamentAction) { 24612: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 24616: 82 30 cpi r24, 0x02 ; 2 24618: 71 f0 breq .+28 ; 0x24636 2461a: 83 30 cpi r24, 0x03 ; 3 2461c: 81 f0 breq .+32 ; 0x2463e 2461e: 81 30 cpi r24, 0x01 ; 1 24620: 91 f4 brne .+36 ; 0x24646 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 24622: 61 e0 ldi r22, 0x01 ; 1 24624: 8f ea ldi r24, 0xAF ; 175 24626: 9e e6 ldi r25, 0x6E ; 110 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 24628: 0c 94 a0 87 jmp 0x10f40 ; 0x10f40 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)); 2462c: 83 eb ldi r24, 0xB3 ; 179 2462e: 9e e4 ldi r25, 0x4E ; 78 24630: d2 cf rjmp .-92 ; 0x245d6 #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); 24632: 82 e0 ldi r24, 0x02 ; 2 24634: ec cf rjmp .-40 ; 0x2460e switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 24636: 81 e0 ldi r24, 0x01 ; 1 24638: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 2463c: f2 cf rjmp .-28 ; 0x24622 [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 2463e: 61 e0 ldi r22, 0x01 ; 1 24640: 87 e3 ldi r24, 0x37 ; 55 24642: 9b e6 ldi r25, 0x6B ; 107 24644: f1 cf rjmp .-30 ; 0x24628 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 24646: 08 95 ret 00024648 <__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) { 24648: 1f 92 push r1 2464a: 0f 92 push r0 2464c: 0f b6 in r0, 0x3f ; 63 2464e: 0f 92 push r0 24650: 11 24 eor r1, r1 24652: 0b b6 in r0, 0x3b ; 59 24654: 0f 92 push r0 24656: 2f 93 push r18 24658: 3f 93 push r19 2465a: 4f 93 push r20 2465c: 5f 93 push r21 2465e: 6f 93 push r22 24660: 7f 93 push r23 24662: 8f 93 push r24 24664: 9f 93 push r25 24666: af 93 push r26 24668: bf 93 push r27 2466a: ef 93 push r30 2466c: ff 93 push r31 if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 2466e: 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 24672: 80 91 3b 05 lds r24, 0x053B ; 0x80053b uint8_t buf_r = ptr[2]; //get read index 24676: 90 91 3c 05 lds r25, 0x053C ; 0x80053c _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 2467a: e8 2f mov r30, r24 2467c: f0 e0 ldi r31, 0x00 ; 0 2467e: e2 5c subi r30, 0xC2 ; 194 24680: fa 4f sbci r31, 0xFA ; 250 24682: 20 83 st Z, r18 buf_w++; //incerment write index 24684: 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 24686: 20 91 3a 05 lds r18, 0x053A ; 0x80053a 2468a: 82 17 cp r24, r18 2468c: 08 f0 brcs .+2 ; 0x24690 <__vector_51+0x48> 2468e: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 24690: 98 13 cpse r25, r24 24692: 17 c0 rjmp .+46 ; 0x246c2 <__vector_51+0x7a> { //rx buffer full puts_P(PSTR("USART2 rx Full!!!")); 24694: 80 e6 ldi r24, 0x60 ; 96 24696: 9f e9 ldi r25, 0x9F ; 159 24698: 0f 94 3d db call 0x3b67a ; 0x3b67a } } 2469c: ff 91 pop r31 2469e: ef 91 pop r30 246a0: bf 91 pop r27 246a2: af 91 pop r26 246a4: 9f 91 pop r25 246a6: 8f 91 pop r24 246a8: 7f 91 pop r23 246aa: 6f 91 pop r22 246ac: 5f 91 pop r21 246ae: 4f 91 pop r20 246b0: 3f 91 pop r19 246b2: 2f 91 pop r18 246b4: 0f 90 pop r0 246b6: 0b be out 0x3b, r0 ; 59 246b8: 0f 90 pop r0 246ba: 0f be out 0x3f, r0 ; 63 246bc: 0f 90 pop r0 246be: 1f 90 pop r1 246c0: 18 95 reti ptr[1] = buf_w; //store write index 246c2: 80 93 3b 05 sts 0x053B, r24 ; 0x80053b 246c6: ea cf rjmp .-44 ; 0x2469c <__vector_51+0x54> 000246c8 <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 246c8: 1f 92 push r1 246ca: 0f 92 push r0 246cc: 0f b6 in r0, 0x3f ; 63 246ce: 0f 92 push r0 246d0: 11 24 eor r1, r1 246d2: 0b b6 in r0, 0x3b ; 59 246d4: 0f 92 push r0 246d6: 8f 93 push r24 246d8: 9f 93 push r25 246da: ef 93 push r30 246dc: ff 93 push r31 WRITE(BEEPER, 0); 246de: 9f b7 in r25, 0x3f ; 63 246e0: f8 94 cli 246e2: e2 e0 ldi r30, 0x02 ; 2 246e4: f1 e0 ldi r31, 0x01 ; 1 246e6: 80 81 ld r24, Z 246e8: 8b 7f andi r24, 0xFB ; 251 246ea: 80 83 st Z, r24 246ec: 9f bf out 0x3f, r25 ; 63 } 246ee: ff 91 pop r31 246f0: ef 91 pop r30 246f2: 9f 91 pop r25 246f4: 8f 91 pop r24 246f6: 0f 90 pop r0 246f8: 0b be out 0x3b, r0 ; 59 246fa: 0f 90 pop r0 246fc: 0f be out 0x3f, r0 ; 63 246fe: 0f 90 pop r0 24700: 1f 90 pop r1 24702: 18 95 reti 00024704 <__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) { 24704: 1f 92 push r1 24706: 0f 92 push r0 24708: 0f b6 in r0, 0x3f ; 63 2470a: 0f 92 push r0 2470c: 11 24 eor r1, r1 2470e: 0b b6 in r0, 0x3b ; 59 24710: 0f 92 push r0 24712: 8f 93 push r24 24714: 9f 93 push r25 24716: ef 93 push r30 24718: ff 93 push r31 WRITE(BEEPER, 1); 2471a: 9f b7 in r25, 0x3f ; 63 2471c: f8 94 cli 2471e: e2 e0 ldi r30, 0x02 ; 2 24720: f1 e0 ldi r31, 0x01 ; 1 24722: 80 81 ld r24, Z 24724: 84 60 ori r24, 0x04 ; 4 24726: 80 83 st Z, r24 24728: 9f bf out 0x3f, r25 ; 63 } 2472a: ff 91 pop r31 2472c: ef 91 pop r30 2472e: 9f 91 pop r25 24730: 8f 91 pop r24 24732: 0f 90 pop r0 24734: 0b be out 0x3b, r0 ; 59 24736: 0f 90 pop r0 24738: 0f be out 0x3f, r0 ; 63 2473a: 0f 90 pop r0 2473c: 1f 90 pop r1 2473e: 18 95 reti 00024740 : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 24740: 6f 92 push r6 24742: 7f 92 push r7 24744: 8f 92 push r8 24746: 9f 92 push r9 24748: af 92 push r10 2474a: bf 92 push r11 2474c: df 92 push r13 2474e: ef 92 push r14 24750: ff 92 push r15 24752: 0f 93 push r16 24754: 1f 93 push r17 24756: cf 93 push r28 24758: df 93 push r29 2475a: cd b7 in r28, 0x3d ; 61 2475c: de b7 in r29, 0x3e ; 62 2475e: e0 97 sbiw r28, 0x30 ; 48 24760: 0f b6 in r0, 0x3f ; 63 24762: f8 94 cli 24764: de bf out 0x3e, r29 ; 62 24766: 0f be out 0x3f, r0 ; 63 24768: cd bf out 0x3d, r28 ; 61 2476a: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 2476c: ae 01 movw r20, r28 2476e: 4f 5f subi r20, 0xFF ; 255 24770: 5f 4f sbci r21, 0xFF ; 255 24772: 60 e1 ldi r22, 0x10 ; 16 24774: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 bubblesort_uint8(step, 16, 0); 24778: 50 e0 ldi r21, 0x00 ; 0 2477a: 40 e0 ldi r20, 0x00 ; 0 2477c: 60 e1 ldi r22, 0x10 ; 16 2477e: ce 01 movw r24, r28 24780: 01 96 adiw r24, 0x01 ; 1 24782: 0f 94 58 11 call 0x222b0 ; 0x222b0 puts_P(PSTR("sorted samples:")); 24786: 80 e5 ldi r24, 0x50 ; 80 24788: 9f e9 ldi r25, 0x9F ; 159 2478a: 0f 94 3d db call 0x3b67a ; 0x3b67a 2478e: 9e 01 movw r18, r28 24790: 2f 5f subi r18, 0xFF ; 255 24792: 3f 4f sbci r19, 0xFF ; 255 24794: 59 01 movw r10, r18 24796: 10 e0 ldi r17, 0x00 ; 0 24798: 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]); 2479a: 2f e3 ldi r18, 0x3F ; 63 2479c: e2 2e mov r14, r18 2479e: 2f e9 ldi r18, 0x9F ; 159 247a0: f2 2e mov r15, r18 247a2: d5 01 movw r26, r10 247a4: 8d 91 ld r24, X+ 247a6: 5d 01 movw r10, r26 247a8: 1f 92 push r1 247aa: 8f 93 push r24 247ac: 1f 93 push r17 247ae: 0f 93 push r16 247b0: ff 92 push r15 247b2: ef 92 push r14 247b4: 0f 94 16 db call 0x3b62c ; 0x3b62c 247b8: 0f 5f subi r16, 0xFF ; 255 247ba: 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++) 247bc: 0f 90 pop r0 247be: 0f 90 pop r0 247c0: 0f 90 pop r0 247c2: 0f 90 pop r0 247c4: 0f 90 pop r0 247c6: 0f 90 pop r0 247c8: 00 31 cpi r16, 0x10 ; 16 247ca: 11 05 cpc r17, r1 247cc: 51 f7 brne .-44 ; 0x247a2 } 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]; 247ce: 09 81 ldd r16, Y+1 ; 0x01 247d0: 10 e0 ldi r17, 0x00 ; 0 247d2: 5e 01 movw r10, r28 247d4: b2 e0 ldi r27, 0x02 ; 2 247d6: ab 0e add r10, r27 247d8: b1 1c adc r11, r1 247da: ee 24 eor r14, r14 247dc: e3 94 inc r14 247de: f1 2c mov r15, r1 247e0: ec 0e add r14, r28 247e2: fd 1e adc r15, r29 247e4: e0 e1 ldi r30, 0x10 ; 16 247e6: ee 0e add r14, r30 247e8: f1 1c adc r15, r1 uint8_t cl = 0; 247ea: 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; 247ec: 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]; 247ee: d5 01 movw r26, r10 247f0: 3d 91 ld r19, X+ 247f2: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 247f4: 62 2f mov r22, r18 247f6: 70 e0 ldi r23, 0x00 ; 0 247f8: c8 01 movw r24, r16 247fa: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 247fe: 46 2f mov r20, r22 24800: 43 1b sub r20, r19 24802: 36 17 cp r19, r22 24804: 10 f0 brcs .+4 ; 0x2480a else dif = d - val; 24806: 43 2f mov r20, r19 24808: 46 1b sub r20, r22 2480a: 83 2f mov r24, r19 2480c: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 2480e: 42 30 cpi r20, 0x02 ; 2 24810: 08 f0 brcs .+2 ; 0x24814 24812: 47 c0 rjmp .+142 ; 0x248a2 { cnt += 1; 24814: 2f 5f subi r18, 0xFF ; 255 sum += d; 24816: 08 0f add r16, r24 24818: 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++) 2481a: ae 14 cp r10, r14 2481c: bf 04 cpc r11, r15 2481e: 39 f7 brne .-50 ; 0x247ee cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 24820: ae 2e mov r10, r30 24822: b1 2c mov r11, r1 24824: a1 e1 ldi r26, 0x11 ; 17 24826: b0 e0 ldi r27, 0x00 ; 0 24828: ac 0f add r26, r28 2482a: bd 1f adc r27, r29 2482c: aa 0d add r26, r10 2482e: bb 1d adc r27, r11 24830: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 24832: 7e 01 movw r14, r28 24834: b1 e2 ldi r27, 0x21 ; 33 24836: eb 0e add r14, r27 24838: f1 1c adc r15, r1 2483a: ae 0c add r10, r14 2483c: bf 1c adc r11, r15 2483e: 62 2f mov r22, r18 24840: 70 e0 ldi r23, 0x00 ; 0 24842: c8 01 movw r24, r16 24844: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 24848: d5 01 movw r26, r10 2484a: 6c 93 st X, r22 return ++cl; 2484c: 11 e0 ldi r17, 0x01 ; 1 2484e: 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:")); 24850: 85 e3 ldi r24, 0x35 ; 53 24852: 9f e9 ldi r25, 0x9F ; 159 24854: 0f 94 3d db call 0x3b67a ; 0x3b67a 24858: fe 01 movw r30, r28 2485a: 71 96 adiw r30, 0x11 ; 17 2485c: 3f 01 movw r6, r30 2485e: 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]); 24860: 8d e1 ldi r24, 0x1D ; 29 24862: 88 2e mov r8, r24 24864: 8f e9 ldi r24, 0x9F ; 159 24866: 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++) 24868: 8a 2d mov r24, r10 2486a: 8e 19 sub r24, r14 2486c: 81 17 cp r24, r17 2486e: 70 f5 brcc .+92 ; 0x248cc 24870: c5 01 movw r24, r10 24872: 8e 19 sub r24, r14 24874: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 24876: d5 01 movw r26, r10 24878: 3d 91 ld r19, X+ 2487a: 5d 01 movw r10, r26 2487c: f3 01 movw r30, r6 2487e: 21 91 ld r18, Z+ 24880: 3f 01 movw r6, r30 24882: 1f 92 push r1 24884: 3f 93 push r19 24886: 1f 92 push r1 24888: 2f 93 push r18 2488a: 9f 93 push r25 2488c: 8f 93 push r24 2488e: 9f 92 push r9 24890: 8f 92 push r8 24892: 0f 94 16 db call 0x3b62c ; 0x3b62c 24896: 0f b6 in r0, 0x3f ; 63 24898: f8 94 cli 2489a: de bf out 0x3e, r29 ; 62 2489c: 0f be out 0x3f, r0 ; 63 2489e: cd bf out 0x3d, r28 ; 61 248a0: e3 cf rjmp .-58 ; 0x24868 248a2: 4e 2f mov r20, r30 248a4: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 248a6: a1 e1 ldi r26, 0x11 ; 17 248a8: b0 e0 ldi r27, 0x00 ; 0 248aa: ac 0f add r26, r28 248ac: bd 1f adc r27, r29 248ae: a4 0f add r26, r20 248b0: b5 1f adc r27, r21 248b2: ef 5f subi r30, 0xFF ; 255 248b4: 2c 93 st X, r18 if (cval) cval[cl] = val; 248b6: 21 e2 ldi r18, 0x21 ; 33 248b8: 30 e0 ldi r19, 0x00 ; 0 248ba: 2c 0f add r18, r28 248bc: 3d 1f adc r19, r29 248be: 42 0f add r20, r18 248c0: 53 1f adc r21, r19 248c2: da 01 movw r26, r20 248c4: 6c 93 st X, r22 cnt = 1; sum = d; 248c6: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 248c8: 21 e0 ldi r18, 0x01 ; 1 248ca: a7 cf rjmp .-178 ; 0x2481a 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); 248cc: a7 01 movw r20, r14 248ce: 61 2f mov r22, r17 248d0: ce 01 movw r24, r28 248d2: 41 96 adiw r24, 0x11 ; 17 248d4: 0f 94 58 11 call 0x222b0 ; 0x222b0 tmc2130_home_origin[axis] = val[cl-1]; 248d8: fe 01 movw r30, r28 248da: e1 0f add r30, r17 248dc: f1 1d adc r31, r1 248de: 80 a1 ldd r24, Z+32 ; 0x20 248e0: ed 2d mov r30, r13 248e2: f0 e0 ldi r31, 0x00 ; 0 248e4: ed 50 subi r30, 0x0D ; 13 248e6: fb 4f sbci r31, 0xFB ; 251 248e8: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 248ea: 1f 92 push r1 248ec: 8f 93 push r24 248ee: 8b e0 ldi r24, 0x0B ; 11 248f0: 9f e9 ldi r25, 0x9F ; 159 248f2: 9f 93 push r25 248f4: 8f 93 push r24 248f6: 0f 94 16 db call 0x3b62c ; 0x3b62c if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 248fa: 0f 90 pop r0 248fc: 0f 90 pop r0 248fe: 0f 90 pop r0 24900: 0f 90 pop r0 24902: 60 91 f3 04 lds r22, 0x04F3 ; 0x8004f3 24906: 8e ef ldi r24, 0xFE ; 254 24908: 9e e0 ldi r25, 0x0E ; 14 2490a: dd 20 and r13, r13 2490c: 21 f0 breq .+8 ; 0x24916 2490e: 60 91 f4 04 lds r22, 0x04F4 ; 0x8004f4 24912: 8b ef ldi r24, 0xFB ; 251 24914: 9e e0 ldi r25, 0x0E ; 14 24916: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 2491a: 81 e0 ldi r24, 0x01 ; 1 2491c: e0 96 adiw r28, 0x30 ; 48 2491e: 0f b6 in r0, 0x3f ; 63 24920: f8 94 cli 24922: de bf out 0x3e, r29 ; 62 24924: 0f be out 0x3f, r0 ; 63 24926: cd bf out 0x3d, r28 ; 61 24928: df 91 pop r29 2492a: cf 91 pop r28 2492c: 1f 91 pop r17 2492e: 0f 91 pop r16 24930: ff 90 pop r15 24932: ef 90 pop r14 24934: df 90 pop r13 24936: bf 90 pop r11 24938: af 90 pop r10 2493a: 9f 90 pop r9 2493c: 8f 90 pop r8 2493e: 7f 90 pop r7 24940: 6f 90 pop r6 24942: 08 95 ret 00024944 : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 24944: 81 30 cpi r24, 0x01 ; 1 24946: 49 f0 breq .+18 ; 0x2495a 24948: 28 f0 brcs .+10 ; 0x24954 2494a: 82 30 cpi r24, 0x02 ; 2 2494c: 41 f0 breq .+16 ; 0x2495e 2494e: 83 30 cpi r24, 0x03 ; 3 24950: 41 f0 breq .+16 ; 0x24962 24952: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 24954: 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; 24956: 86 b9 out 0x06, r24 ; 6 } } 24958: 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; 2495a: 82 e0 ldi r24, 0x02 ; 2 2495c: fc cf rjmp .-8 ; 0x24956 case Z_AXIS: _DO_STEP_Z; break; 2495e: 84 e0 ldi r24, 0x04 ; 4 24960: fa cf rjmp .-12 ; 0x24956 case E_AXIS: _DO_STEP_E; break; 24962: 88 e0 ldi r24, 0x08 ; 8 24964: f8 cf rjmp .-16 ; 0x24956 00024966 : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 24966: 81 30 cpi r24, 0x01 ; 1 24968: d1 f0 breq .+52 ; 0x2499e 2496a: 48 f0 brcs .+18 ; 0x2497e 2496c: 82 30 cpi r24, 0x02 ; 2 2496e: 21 f1 breq .+72 ; 0x249b8 24970: 83 30 cpi r24, 0x03 ; 3 24972: 79 f1 breq .+94 ; 0x249d2 24974: 8b e4 ldi r24, 0x4B ; 75 24976: 90 e0 ldi r25, 0x00 ; 0 24978: 01 97 sbiw r24, 0x01 ; 1 2497a: f1 f7 brne .-4 ; 0x24978 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); } 2497c: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 2497e: 9f b7 in r25, 0x3f ; 63 24980: 66 23 and r22, r22 24982: 41 f0 breq .+16 ; 0x24994 24984: f8 94 cli 24986: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2498a: 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; 2498c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24990: 9f bf out 0x3f, r25 ; 63 24992: f0 cf rjmp .-32 ; 0x24974 void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 24994: f8 94 cli 24996: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2499a: 8e 7f andi r24, 0xFE ; 254 2499c: f7 cf rjmp .-18 ; 0x2498c case Y_AXIS: _SET_DIR_Y(dir); break; 2499e: 9f b7 in r25, 0x3f ; 63 249a0: 61 11 cpse r22, r1 249a2: 05 c0 rjmp .+10 ; 0x249ae 249a4: f8 94 cli 249a6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 249aa: 82 60 ori r24, 0x02 ; 2 249ac: ef cf rjmp .-34 ; 0x2498c 249ae: f8 94 cli 249b0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 249b4: 8d 7f andi r24, 0xFD ; 253 249b6: ea cf rjmp .-44 ; 0x2498c case Z_AXIS: _SET_DIR_Z(dir); break; 249b8: 9f b7 in r25, 0x3f ; 63 249ba: 66 23 and r22, r22 249bc: 29 f0 breq .+10 ; 0x249c8 249be: f8 94 cli 249c0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 249c4: 84 60 ori r24, 0x04 ; 4 249c6: e2 cf rjmp .-60 ; 0x2498c 249c8: f8 94 cli 249ca: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 249ce: 8b 7f andi r24, 0xFB ; 251 249d0: dd cf rjmp .-70 ; 0x2498c case E_AXIS: _SET_DIR_E(dir); break; 249d2: 9f b7 in r25, 0x3f ; 63 249d4: 61 11 cpse r22, r1 249d6: 05 c0 rjmp .+10 ; 0x249e2 249d8: f8 94 cli 249da: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 249de: 80 64 ori r24, 0x40 ; 64 249e0: d5 cf rjmp .-86 ; 0x2498c 249e2: f8 94 cli 249e4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 249e8: 8f 7b andi r24, 0xBF ; 191 249ea: d0 cf rjmp .-96 ; 0x2498c 000249ec : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 249ec: cf 92 push r12 249ee: df 92 push r13 249f0: ef 92 push r14 249f2: ff 92 push r15 249f4: 0f 93 push r16 249f6: 1f 93 push r17 249f8: cf 93 push r28 249fa: df 93 push r29 249fc: 18 2f mov r17, r24 249fe: f6 2e mov r15, r22 24a00: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 24a02: 0c e5 ldi r16, 0x5C ; 92 24a04: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 24a06: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 24a08: 0f 94 b4 11 call 0x22368 ; 0x22368 TMC2130_SPI_TXRX(addr); // address 24a0c: 8f 2d mov r24, r15 24a0e: 0f 94 cf 11 call 0x2239e ; 0x2239e TMC2130_SPI_TXRX(0); // MSB 24a12: 80 e0 ldi r24, 0x00 ; 0 24a14: 0f 94 cf 11 call 0x2239e ; 0x2239e TMC2130_SPI_TXRX(0); 24a18: 80 e0 ldi r24, 0x00 ; 0 24a1a: 0f 94 cf 11 call 0x2239e ; 0x2239e TMC2130_SPI_TXRX(0); 24a1e: 80 e0 ldi r24, 0x00 ; 0 24a20: 0f 94 cf 11 call 0x2239e ; 0x2239e TMC2130_SPI_TXRX(0); // LSB 24a24: 80 e0 ldi r24, 0x00 ; 0 24a26: 0f 94 cf 11 call 0x2239e ; 0x2239e tmc2130_cs_high(axis); 24a2a: 81 2f mov r24, r17 24a2c: 0f 94 99 11 call 0x22332 ; 0x22332 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 24a30: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 24a32: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 24a34: 81 2f mov r24, r17 24a36: 0f 94 b4 11 call 0x22368 ; 0x22368 uint8_t stat = TMC2130_SPI_TXRX(0); // status 24a3a: 80 e0 ldi r24, 0x00 ; 0 24a3c: 0f 94 cf 11 call 0x2239e ; 0x2239e 24a40: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 24a42: 80 e0 ldi r24, 0x00 ; 0 24a44: 0f 94 cf 11 call 0x2239e ; 0x2239e 24a48: 90 e0 ldi r25, 0x00 ; 0 24a4a: b0 e0 ldi r27, 0x00 ; 0 24a4c: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 24a4e: cc 24 eor r12, r12 24a50: d8 2e mov r13, r24 24a52: e9 2e mov r14, r25 24a54: fa 2e mov r15, r26 24a56: 80 e0 ldi r24, 0x00 ; 0 24a58: 0f 94 cf 11 call 0x2239e ; 0x2239e 24a5c: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 24a5e: fe 2c mov r15, r14 24a60: ed 2c mov r14, r13 24a62: dc 2c mov r13, r12 24a64: cc 24 eor r12, r12 24a66: 80 e0 ldi r24, 0x00 ; 0 24a68: 0f 94 cf 11 call 0x2239e ; 0x2239e 24a6c: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 24a6e: fe 2c mov r15, r14 24a70: ed 2c mov r14, r13 24a72: dc 2c mov r13, r12 24a74: cc 24 eor r12, r12 24a76: 80 e0 ldi r24, 0x00 ; 0 24a78: 0f 94 cf 11 call 0x2239e ; 0x2239e 24a7c: c8 2a or r12, r24 tmc2130_cs_high(axis); 24a7e: 81 2f mov r24, r17 24a80: 0f 94 99 11 call 0x22332 ; 0x22332 TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 24a84: c8 82 st Y, r12 24a86: d9 82 std Y+1, r13 ; 0x01 24a88: ea 82 std Y+2, r14 ; 0x02 24a8a: fb 82 std Y+3, r15 ; 0x03 return stat; } 24a8c: 80 2f mov r24, r16 24a8e: df 91 pop r29 24a90: cf 91 pop r28 24a92: 1f 91 pop r17 24a94: 0f 91 pop r16 24a96: ff 90 pop r15 24a98: ef 90 pop r14 24a9a: df 90 pop r13 24a9c: cf 90 pop r12 24a9e: 08 95 ret 00024aa0 : #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) { 24aa0: ef 92 push r14 24aa2: ff 92 push r15 24aa4: 0f 93 push r16 24aa6: 1f 93 push r17 24aa8: cf 93 push r28 24aaa: df 93 push r29 24aac: c8 2f mov r28, r24 24aae: e6 2e mov r14, r22 24ab0: d2 2f mov r29, r18 24ab2: 13 2f mov r17, r19 24ab4: 04 2f mov r16, r20 24ab6: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 24ab8: 8c e5 ldi r24, 0x5C ; 92 24aba: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 24abc: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 24abe: 8c 2f mov r24, r28 24ac0: 0f 94 b4 11 call 0x22368 ; 0x22368 TMC2130_SPI_TXRX(addr); // address 24ac4: 8e 2d mov r24, r14 24ac6: 0f 94 cf 11 call 0x2239e ; 0x2239e TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 24aca: 8f 2d mov r24, r15 24acc: 0f 94 cf 11 call 0x2239e ; 0x2239e TMC2130_SPI_TXRX((wval >> 16) & 0xff); 24ad0: 80 2f mov r24, r16 24ad2: 0f 94 cf 11 call 0x2239e ; 0x2239e TMC2130_SPI_TXRX((wval >> 8) & 0xff); 24ad6: 81 2f mov r24, r17 24ad8: 0f 94 cf 11 call 0x2239e ; 0x2239e TMC2130_SPI_TXRX(wval & 0xff); // LSB 24adc: 8d 2f mov r24, r29 24ade: 0f 94 cf 11 call 0x2239e ; 0x2239e tmc2130_cs_high(axis); 24ae2: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 24ae4: df 91 pop r29 24ae6: cf 91 pop r28 24ae8: 1f 91 pop r17 24aea: 0f 91 pop r16 24aec: ff 90 pop r15 24aee: 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); 24af0: 0d 94 99 11 jmp 0x22332 ; 0x22332 00024af4 : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 24af4: cf 93 push r28 24af6: df 93 push r29 24af8: 00 d0 rcall .+0 ; 0x24afa 24afa: 1f 92 push r1 24afc: cd b7 in r28, 0x3d ; 61 24afe: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 24b00: 19 82 std Y+1, r1 ; 0x01 24b02: 1a 82 std Y+2, r1 ; 0x02 24b04: 1b 82 std Y+3, r1 ; 0x03 24b06: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 24b08: ae 01 movw r20, r28 24b0a: 4f 5f subi r20, 0xFF ; 255 24b0c: 5f 4f sbci r21, 0xFF ; 255 24b0e: 6a e6 ldi r22, 0x6A ; 106 24b10: 0f 94 f6 24 call 0x249ec ; 0x249ec return val32 & 0x3ff; 24b14: 89 81 ldd r24, Y+1 ; 0x01 24b16: 9a 81 ldd r25, Y+2 ; 0x02 } 24b18: 93 70 andi r25, 0x03 ; 3 24b1a: 0f 90 pop r0 24b1c: 0f 90 pop r0 24b1e: 0f 90 pop r0 24b20: 0f 90 pop r0 24b22: df 91 pop r29 24b24: cf 91 pop r28 24b26: 08 95 ret 00024b28 : #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 */) { 24b28: ff 92 push r15 24b2a: 0f 93 push r16 24b2c: 1f 93 push r17 24b2e: cf 93 push r28 24b30: df 93 push r29 24b32: f8 2e mov r15, r24 24b34: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 24b36: e8 2f mov r30, r24 24b38: f0 e0 ldi r31, 0x00 ; 0 24b3a: 83 e0 ldi r24, 0x03 ; 3 24b3c: f8 9e mul r15, r24 24b3e: 80 01 movw r16, r0 24b40: 11 24 eor r1, r1 24b42: 03 5a subi r16, 0xA3 ; 163 24b44: 1d 4f sbci r17, 0xFD ; 253 24b46: d8 01 movw r26, r16 24b48: 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) {} 24b4a: 30 e0 ldi r19, 0x00 ; 0 24b4c: 37 7f andi r19, 0xF7 ; 247 24b4e: 3f 7e andi r19, 0xEF ; 239 24b50: 3f 7d andi r19, 0xDF ; 223 24b52: 3f 7b andi r19, 0xBF ; 191 24b54: 40 e0 ldi r20, 0x00 ; 0 24b56: 80 fb bst r24, 0 24b58: 41 f9 bld r20, 1 24b5a: 43 70 andi r20, 0x03 ; 3 24b5c: 56 2f mov r21, r22 24b5e: 5f 70 andi r21, 0x0F ; 15 24b60: 50 62 ori r21, 0x20 ; 32 24b62: 5f 7b andi r21, 0xBF ; 191 24b64: 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 24b66: 81 e0 ldi r24, 0x01 ; 1 24b68: 61 11 cpse r22, r1 24b6a: 01 c0 rjmp .+2 ; 0x24b6e 24b6c: 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); 24b6e: 80 fb bst r24, 0 24b70: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 24b72: bf 01 movw r22, r30 24b74: 66 0f add r22, r22 24b76: 77 1f adc r23, r23 24b78: fb 01 movw r30, r22 24b7a: eb 55 subi r30, 0x5B ; 91 24b7c: fd 4f sbci r31, 0xFD ; 253 24b7e: 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 24b80: 92 2f mov r25, r18 24b82: 99 1f adc r25, r25 24b84: 99 27 eor r25, r25 24b86: 99 1f adc r25, r25 24b88: 81 81 ldd r24, Z+1 ; 0x01 24b8a: 87 70 andi r24, 0x07 ; 7 24b8c: 88 0f add r24, r24 24b8e: 89 2b or r24, r25 24b90: 80 fb bst r24, 0 24b92: 27 f9 bld r18, 7 24b94: 86 95 lsr r24 24b96: 87 70 andi r24, 0x07 ; 7 24b98: 38 7f andi r19, 0xF8 ; 248 24b9a: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 24b9c: 6a 55 subi r22, 0x5A ; 90 24b9e: 7d 4f sbci r23, 0xFD ; 253 24ba0: fb 01 movw r30, r22 24ba2: 80 81 ld r24, Z 24ba4: 86 95 lsr r24 24ba6: 86 95 lsr r24 24ba8: 86 95 lsr r24 24baa: 80 fb bst r24, 0 24bac: 37 f9 bld r19, 7 24bae: 81 fb bst r24, 1 24bb0: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 24bb2: 6c ee ldi r22, 0xEC ; 236 24bb4: 8f 2d mov r24, r15 24bb6: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 if (curr == nullptr) { 24bba: 20 97 sbiw r28, 0x00 ; 0 24bbc: 09 f4 brne .+2 ; 0x24bc0 curr = ¤ts[axis]; 24bbe: e8 01 movw r28, r16 24bc0: 19 81 ldd r17, Y+1 ; 0x01 24bc2: 8a 81 ldd r24, Y+2 ; 0x02 24bc4: c1 2f mov r28, r17 24bc6: 81 17 cp r24, r17 24bc8: 08 f4 brcc .+2 ; 0x24bcc 24bca: 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()) { 24bcc: 18 17 cp r17, r24 24bce: 40 f4 brcc .+16 ; 0x24be0 // Let user know firmware modified the value SERIAL_ECHO_START; 24bd0: 82 ec ldi r24, 0xC2 ; 194 24bd2: 9a ea ldi r25, 0xAA ; 170 24bd4: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 24bd8: 8a ed ldi r24, 0xDA ; 218 24bda: 9d e6 ldi r25, 0x6D ; 109 24bdc: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 24be0: 2c 2f mov r18, r28 24be2: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 24be4: 31 2f mov r19, r17 24be6: 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); 24be8: 4f e0 ldi r20, 0x0F ; 15 24bea: 50 e0 ldi r21, 0x00 ; 0 24bec: 60 e9 ldi r22, 0x90 ; 144 24bee: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 24bf0: df 91 pop r29 24bf2: cf 91 pop r28 24bf4: 1f 91 pop r17 24bf6: 0f 91 pop r16 24bf8: 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); 24bfa: 0d 94 50 25 jmp 0x24aa0 ; 0x24aa0 00024bfe : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 24bfe: e8 2f mov r30, r24 24c00: 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--; 24c02: 98 e0 ldi r25, 0x08 ; 8 24c04: 76 95 lsr r23 24c06: 67 95 ror r22 24c08: 61 15 cp r22, r1 24c0a: 71 05 cpc r23, r1 24c0c: 11 f0 breq .+4 ; 0x24c12 24c0e: 91 50 subi r25, 0x01 ; 1 24c10: f9 cf rjmp .-14 ; 0x24c04 return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 24c12: eb 50 subi r30, 0x0B ; 11 24c14: fb 4f sbci r31, 0xFB ; 251 24c16: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 24c18: 50 e0 ldi r21, 0x00 ; 0 24c1a: 40 e0 ldi r20, 0x00 ; 0 24c1c: 69 2f mov r22, r25 24c1e: 0d 94 94 25 jmp 0x24b28 ; 0x24b28 00024c22 : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 24c22: 0f 93 push r16 24c24: 1f 93 push r17 24c26: cf 93 push r28 24c28: df 93 push r29 24c2a: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 24c2c: 08 2f mov r16, r24 24c2e: 10 e0 ldi r17, 0x00 ; 0 24c30: f8 01 movw r30, r16 24c32: eb 50 subi r30, 0x0B ; 11 24c34: fb 4f sbci r31, 0xFB ; 251 24c36: 50 e0 ldi r21, 0x00 ; 0 24c38: 40 e0 ldi r20, 0x00 ; 0 24c3a: 60 81 ld r22, Z 24c3c: 0f 94 94 25 call 0x24b28 ; 0x24b28 tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 24c40: 20 e0 ldi r18, 0x00 ; 0 24c42: 30 e0 ldi r19, 0x00 ; 0 24c44: a9 01 movw r20, r18 24c46: 61 e9 ldi r22, 0x91 ; 145 24c48: 8c 2f mov r24, r28 24c4a: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 24c4e: d0 91 8c 06 lds r29, 0x068C ; 0x80068c if (axis == Z_AXIS) { 24c52: c2 30 cpi r28, 0x02 ; 2 24c54: e1 f5 brne .+120 ; 0x24cce #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 24c56: 20 e0 ldi r18, 0x00 ; 0 24c58: 30 e0 ldi r19, 0x00 ; 0 24c5a: 44 e0 ldi r20, 0x04 ; 4 24c5c: 51 e0 ldi r21, 0x01 ; 1 24c5e: 6d ee ldi r22, 0xED ; 237 24c60: 82 e0 ldi r24, 0x02 ; 2 24c62: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24c66: 24 ef ldi r18, 0xF4 ; 244 24c68: 31 e0 ldi r19, 0x01 ; 1 24c6a: 40 e0 ldi r20, 0x00 ; 0 24c6c: 50 e0 ldi r21, 0x00 ; 0 24c6e: d1 30 cpi r29, 0x01 ; 1 24c70: 19 f4 brne .+6 ; 0x24c78 24c72: 20 e0 ldi r18, 0x00 ; 0 24c74: 30 e0 ldi r19, 0x00 ; 0 24c76: a9 01 movw r20, r18 24c78: 64 e9 ldi r22, 0x94 ; 148 24c7a: 82 e0 ldi r24, 0x02 ; 2 24c7c: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 24c80: 24 e8 ldi r18, 0x84 ; 132 24c82: 31 e0 ldi r19, 0x01 ; 1 24c84: 40 e0 ldi r20, 0x00 ; 0 24c86: 50 e0 ldi r21, 0x00 ; 0 24c88: d1 30 cpi r29, 0x01 ; 1 24c8a: 21 f4 brne .+8 ; 0x24c94 24c8c: 24 e0 ldi r18, 0x04 ; 4 24c8e: 30 e0 ldi r19, 0x00 ; 0 24c90: 40 e0 ldi r20, 0x00 ; 0 24c92: 50 e0 ldi r21, 0x00 ; 0 24c94: 60 e8 ldi r22, 0x80 ; 128 24c96: 82 e0 ldi r24, 0x02 ; 2 24c98: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 24c9c: 28 ec ldi r18, 0xC8 ; 200 24c9e: 34 e0 ldi r19, 0x04 ; 4 24ca0: 46 e0 ldi r20, 0x06 ; 6 24ca2: 50 e0 ldi r21, 0x00 ; 0 24ca4: 60 ef ldi r22, 0xF0 ; 240 24ca6: 82 e0 ldi r24, 0x02 ; 2 24ca8: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 24cac: 20 ef ldi r18, 0xF0 ; 240 24cae: 3f ef ldi r19, 0xFF ; 255 24cb0: 4f e0 ldi r20, 0x0F ; 15 24cb2: 50 e0 ldi r21, 0x00 ; 0 24cb4: d1 30 cpi r29, 0x01 ; 1 24cb6: 19 f4 brne .+6 ; 0x24cbe 24cb8: 20 e0 ldi r18, 0x00 ; 0 24cba: 30 e0 ldi r19, 0x00 ; 0 24cbc: a9 01 movw r20, r18 24cbe: 63 e9 ldi r22, 0x93 ; 147 24cc0: 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); } } 24cc2: df 91 pop r29 24cc4: cf 91 pop r28 24cc6: 1f 91 pop r17 24cc8: 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); 24cca: 0d 94 50 25 jmp 0x24aa0 ; 0x24aa0 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)); 24cce: f8 01 movw r30, r16 24cd0: e7 5e subi r30, 0xE7 ; 231 24cd2: fc 4f sbci r31, 0xFC ; 252 24cd4: 20 81 ld r18, Z 24cd6: 30 e0 ldi r19, 0x00 ; 0 24cd8: 50 e0 ldi r21, 0x00 ; 0 24cda: 40 e0 ldi r20, 0x00 ; 0 24cdc: a9 01 movw r20, r18 24cde: 33 27 eor r19, r19 24ce0: 22 27 eor r18, r18 24ce2: 51 60 ori r21, 0x01 ; 1 24ce4: 6d ee ldi r22, 0xED ; 237 24ce6: 8c 2f mov r24, r28 24ce8: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24cec: 20 e0 ldi r18, 0x00 ; 0 24cee: 30 e0 ldi r19, 0x00 ; 0 24cf0: a9 01 movw r20, r18 24cf2: d1 30 cpi r29, 0x01 ; 1 24cf4: 61 f0 breq .+24 ; 0x24d0e uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 24cf6: 2e ea ldi r18, 0xAE ; 174 24cf8: 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) 24cfa: c2 30 cpi r28, 0x02 ; 2 24cfc: 30 f0 brcs .+12 ; 0x24d0a { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 24cfe: 24 ef ldi r18, 0xF4 ; 244 24d00: 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) 24d02: c2 30 cpi r28, 0x02 ; 2 24d04: 11 f0 breq .+4 ; 0x24d0a { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 24d06: 30 e0 ldi r19, 0x00 ; 0 24d08: 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)); 24d0a: 50 e0 ldi r21, 0x00 ; 0 24d0c: 40 e0 ldi r20, 0x00 ; 0 24d0e: 64 e9 ldi r22, 0x94 ; 148 24d10: 8c 2f mov r24, r28 24d12: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 24d16: 20 e8 ldi r18, 0x80 ; 128 24d18: 31 e0 ldi r19, 0x01 ; 1 24d1a: 40 e0 ldi r20, 0x00 ; 0 24d1c: 50 e0 ldi r21, 0x00 ; 0 24d1e: d1 30 cpi r29, 0x01 ; 1 24d20: 21 f4 brne .+8 ; 0x24d2a 24d22: 24 e0 ldi r18, 0x04 ; 4 24d24: 30 e0 ldi r19, 0x00 ; 0 24d26: 40 e0 ldi r20, 0x00 ; 0 24d28: 50 e0 ldi r21, 0x00 ; 0 24d2a: 60 e8 ldi r22, 0x80 ; 128 24d2c: 8c 2f mov r24, r28 24d2e: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 24d32: 00 0f add r16, r16 24d34: 11 1f adc r17, r17 24d36: 00 0f add r16, r16 24d38: 11 1f adc r17, r17 24d3a: f8 01 movw r30, r16 24d3c: e7 5f subi r30, 0xF7 ; 247 24d3e: fc 4f sbci r31, 0xFC ; 252 24d40: 20 81 ld r18, Z 24d42: 31 81 ldd r19, Z+1 ; 0x01 24d44: 42 81 ldd r20, Z+2 ; 0x02 24d46: 53 81 ldd r21, Z+3 ; 0x03 24d48: 60 ef ldi r22, 0xF0 ; 240 24d4a: 8c 2f mov r24, r28 24d4c: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 24d50: 20 e0 ldi r18, 0x00 ; 0 24d52: 30 e0 ldi r19, 0x00 ; 0 24d54: a9 01 movw r20, r18 24d56: 63 e9 ldi r22, 0x93 ; 147 24d58: 8c 2f mov r24, r28 24d5a: b3 cf rjmp .-154 ; 0x24cc2 00024d5c : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 24d5c: 1f 93 push r17 24d5e: cf 93 push r28 24d60: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 24d62: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24d66: 1f 92 push r1 24d68: 8f 93 push r24 24d6a: 85 ed ldi r24, 0xD5 ; 213 24d6c: 9e e9 ldi r25, 0x9E ; 158 24d6e: 9f 93 push r25 24d70: 8f 93 push r24 24d72: 0f 94 16 db call 0x3b62c ; 0x3b62c #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 24d76: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24d7a: 83 70 andi r24, 0x03 ; 3 24d7c: 0f 90 pop r0 24d7e: 0f 90 pop r0 24d80: 0f 90 pop r0 24d82: 0f 90 pop r0 24d84: 11 f0 breq .+4 ; 0x24d8a tmc2130_wait_standstill_xy(1000); 24d86: 0f 94 50 88 call 0x310a0 ; 0x310a0 if (tmc2130_sg_homing_axes_mask) 24d8a: 10 91 43 06 lds r17, 0x0643 ; 0x800643 24d8e: 11 23 and r17, r17 24d90: 71 f0 breq .+28 ; 0x24dae { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 24d92: d1 e0 ldi r29, 0x01 ; 1 24d94: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 24d96: 81 2f mov r24, r17 24d98: 8d 23 and r24, r29 24d9a: 19 f0 breq .+6 ; 0x24da2 tmc2130_XYZ_reg_init(axis); 24d9c: 8c 2f mov r24, r28 24d9e: 0f 94 11 26 call 0x24c22 ; 0x24c22 #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 24da2: cf 5f subi r28, 0xFF ; 255 24da4: dd 0f add r29, r29 24da6: c3 30 cpi r28, 0x03 ; 3 24da8: b1 f7 brne .-20 ; 0x24d96 { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 24daa: 10 92 43 06 sts 0x0643, r1 ; 0x800643 } tmc2130_sg_crash = false; 24dae: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d #endif } 24db2: df 91 pop r29 24db4: cf 91 pop r28 24db6: 1f 91 pop r17 24db8: 08 95 ret 00024dba : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 24dba: df 92 push r13 24dbc: ef 92 push r14 24dbe: ff 92 push r15 24dc0: 0f 93 push r16 24dc2: 1f 93 push r17 24dc4: cf 93 push r28 24dc6: df 93 push r29 24dc8: 00 d0 rcall .+0 ; 0x24dca 24dca: cd b7 in r28, 0x3d ; 61 24dcc: de b7 in r29, 0x3e ; 62 24dce: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 24dd0: 1f 92 push r1 24dd2: 8f 93 push r24 24dd4: 8f ea ldi r24, 0xAF ; 175 24dd6: 9e e9 ldi r25, 0x9E ; 158 24dd8: 9f 93 push r25 24dda: 8f 93 push r24 24ddc: 0f 94 16 db call 0x3b62c ; 0x3b62c #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 24de0: 8d 2d mov r24, r13 24de2: 83 70 andi r24, 0x03 ; 3 24de4: 0f 90 pop r0 24de6: 0f 90 pop r0 24de8: 0f 90 pop r0 24dea: 0f 90 pop r0 24dec: 11 f0 breq .+4 ; 0x24df2 tmc2130_wait_standstill_xy(1000); 24dee: 0f 94 50 88 call 0x310a0 ; 0x310a0 } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 24df2: 10 e0 ldi r17, 0x00 ; 0 24df4: 00 e0 ldi r16, 0x00 ; 0 24df6: ff 24 eor r15, r15 24df8: f3 94 inc r15 24dfa: 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) 24dfc: 8d 2d mov r24, r13 24dfe: 8f 21 and r24, r15 24e00: 09 f4 brne .+2 ; 0x24e04 24e02: 46 c0 rjmp .+140 ; 0x24e90 { tmc2130_sg_homing_axes_mask |= mask; 24e04: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24e08: 8f 29 or r24, r15 24e0a: 80 93 43 06 sts 0x0643, r24 ; 0x800643 //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 24e0e: 20 e0 ldi r18, 0x00 ; 0 24e10: 30 e0 ldi r19, 0x00 ; 0 24e12: a9 01 movw r20, r18 24e14: 60 e8 ldi r22, 0x80 ; 128 24e16: 80 2f mov r24, r16 24e18: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 24e1c: f8 01 movw r30, r16 24e1e: e7 5e subi r30, 0xE7 ; 231 24e20: fc 4f sbci r31, 0xFC ; 252 24e22: 20 81 ld r18, Z 24e24: 30 e0 ldi r19, 0x00 ; 0 24e26: 50 e0 ldi r21, 0x00 ; 0 24e28: 40 e0 ldi r20, 0x00 ; 0 24e2a: a9 01 movw r20, r18 24e2c: 33 27 eor r19, r19 24e2e: 22 27 eor r18, r18 24e30: 6d ee ldi r22, 0xED ; 237 24e32: 80 2f mov r24, r16 24e34: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 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) 24e38: 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; 24e3a: 24 ef ldi r18, 0xF4 ; 244 24e3c: 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) 24e3e: 08 17 cp r16, r24 24e40: 11 f0 breq .+4 ; 0x24e46 { case X_AXIS: return TMC2130_TCOOLTHRS_X; 24e42: 2e ea ldi r18, 0xAE ; 174 24e44: 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)); 24e46: 50 e0 ldi r21, 0x00 ; 0 24e48: 40 e0 ldi r20, 0x00 ; 0 24e4a: 64 e9 ldi r22, 0x94 ; 148 24e4c: 8e 2d mov r24, r14 24e4e: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 24e52: b8 01 movw r22, r16 24e54: 66 0f add r22, r22 24e56: 77 1f adc r23, r23 24e58: 60 0f add r22, r16 24e5a: 71 1f adc r23, r17 24e5c: 6d 55 subi r22, 0x5D ; 93 24e5e: 71 46 sbci r23, 0x61 ; 97 24e60: 43 e0 ldi r20, 0x03 ; 3 24e62: 50 e0 ldi r21, 0x00 ; 0 24e64: ce 01 movw r24, r28 24e66: 01 96 adiw r24, 0x01 ; 1 24e68: 0f 94 ee d9 call 0x3b3dc ; 0x3b3dc MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 24e6c: ae 01 movw r20, r28 24e6e: 4f 5f subi r20, 0xFF ; 255 24e70: 5f 4f sbci r21, 0xFF ; 255 24e72: f8 01 movw r30, r16 24e74: eb 50 subi r30, 0x0B ; 11 24e76: fb 4f sbci r31, 0xFB ; 251 24e78: 60 81 ld r22, Z 24e7a: 8e 2d mov r24, r14 24e7c: 0f 94 94 25 call 0x24b28 ; 0x24b28 tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 24e80: 20 e8 ldi r18, 0x80 ; 128 24e82: 31 e0 ldi r19, 0x01 ; 1 24e84: 40 e0 ldi r20, 0x00 ; 0 24e86: 50 e0 ldi r21, 0x00 ; 0 24e88: 60 e8 ldi r22, 0x80 ; 128 24e8a: 8e 2d mov r24, r14 24e8c: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 { 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 24e90: ff 0c add r15, r15 24e92: 0f 5f subi r16, 0xFF ; 255 24e94: 1f 4f sbci r17, 0xFF ; 255 24e96: 03 30 cpi r16, 0x03 ; 3 24e98: 11 05 cpc r17, r1 24e9a: 09 f0 breq .+2 ; 0x24e9e 24e9c: ae cf rjmp .-164 ; 0x24dfa 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 } 24e9e: 0f 90 pop r0 24ea0: 0f 90 pop r0 24ea2: 0f 90 pop r0 24ea4: df 91 pop r29 24ea6: cf 91 pop r28 24ea8: 1f 91 pop r17 24eaa: 0f 91 pop r16 24eac: ff 90 pop r15 24eae: ef 90 pop r14 24eb0: df 90 pop r13 24eb2: 08 95 ret 00024eb4 : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 24eb4: 89 e6 ldi r24, 0x69 ; 105 24eb6: 9f e0 ldi r25, 0x0F ; 15 24eb8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 24ebc: 91 e0 ldi r25, 0x01 ; 1 24ebe: 81 11 cpse r24, r1 24ec0: 01 c0 rjmp .+2 ; 0x24ec4 24ec2: 90 e0 ldi r25, 0x00 ; 0 24ec4: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 24ec8: 08 95 ret 00024eca : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 24eca: cf 93 push r28 24ecc: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 24ece: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 24ed0: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 24ed2: 9f b7 in r25, 0x3f ; 63 24ed4: f8 94 cli 24ed6: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24eda: 80 62 ori r24, 0x20 ; 32 24edc: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24ee0: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, HIGH); 24ee2: 9f b7 in r25, 0x3f ; 63 24ee4: f8 94 cli 24ee6: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24eea: 80 61 ori r24, 0x10 ; 16 24eec: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24ef0: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 24ef2: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 24ef4: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 24ef6: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24efa: 80 62 ori r24, 0x20 ; 32 24efc: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 24f00: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24f04: 80 61 ori r24, 0x10 ; 16 24f06: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 24f0a: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24f0e: 8b 7f andi r24, 0xFB ; 251 24f10: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 24f14: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24f18: 8f 77 andi r24, 0x7F ; 127 24f1a: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 24f1e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24f22: 8f 7b andi r24, 0xBF ; 191 24f24: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 24f28: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24f2c: 87 7f andi r24, 0xF7 ; 247 24f2e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,HIGH); 24f32: 9f b7 in r25, 0x3f ; 63 24f34: f8 94 cli 24f36: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24f3a: 84 60 ori r24, 0x04 ; 4 24f3c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24f40: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 24f42: 9f b7 in r25, 0x3f ; 63 24f44: f8 94 cli 24f46: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24f4a: 80 68 ori r24, 0x80 ; 128 24f4c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24f50: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 24f52: 9f b7 in r25, 0x3f ; 63 24f54: f8 94 cli 24f56: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24f5a: 80 64 ori r24, 0x40 ; 64 24f5c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24f60: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 24f62: 9f b7 in r25, 0x3f ; 63 24f64: f8 94 cli 24f66: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24f6a: 88 60 ori r24, 0x08 ; 8 24f6c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24f70: 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); 24f72: 80 e0 ldi r24, 0x00 ; 0 24f74: 0f 94 11 26 call 0x24c22 ; 0x24c22 24f78: 81 e0 ldi r24, 0x01 ; 1 24f7a: 0f 94 11 26 call 0x24c22 ; 0x24c22 24f7e: 82 e0 ldi r24, 0x02 ; 2 24f80: 0f 94 11 26 call 0x24c22 ; 0x24c22 } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 24f84: 50 e0 ldi r21, 0x00 ; 0 24f86: 40 e0 ldi r20, 0x00 ; 0 24f88: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 24f8c: 83 e0 ldi r24, 0x03 ; 3 24f8e: 0f 94 94 25 call 0x24b28 ; 0x24b28 tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 24f92: 20 e0 ldi r18, 0x00 ; 0 24f94: 30 e0 ldi r19, 0x00 ; 0 24f96: a9 01 movw r20, r18 24f98: 61 e9 ldi r22, 0x91 ; 145 24f9a: 83 e0 ldi r24, 0x03 ; 3 24f9c: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 24fa0: c1 fd sbrc r28, 1 24fa2: 1d c0 rjmp .+58 ; 0x24fde tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 24fa4: 20 e8 ldi r18, 0x80 ; 128 24fa6: 31 e0 ldi r19, 0x01 ; 1 24fa8: 40 e0 ldi r20, 0x00 ; 0 24faa: 50 e0 ldi r21, 0x00 ; 0 24fac: 60 e8 ldi r22, 0x80 ; 128 24fae: 83 e0 ldi r24, 0x03 ; 3 24fb0: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 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]); 24fb4: 60 91 f9 04 lds r22, 0x04F9 ; 0x8004f9 24fb8: 80 e0 ldi r24, 0x00 ; 0 24fba: 0f 94 c4 88 call 0x31188 ; 0x31188 tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 24fbe: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 24fc2: 81 e0 ldi r24, 0x01 ; 1 24fc4: 0f 94 c4 88 call 0x31188 ; 0x31188 tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 24fc8: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 24fcc: 82 e0 ldi r24, 0x02 ; 2 24fce: 0f 94 c4 88 call 0x31188 ; 0x31188 #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 24fd2: 60 91 fc 04 lds r22, 0x04FC ; 0x8004fc 24fd6: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 24fd8: 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]); 24fda: 0d 94 c4 88 jmp 0x31188 ; 0x31188 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)); 24fde: 20 e0 ldi r18, 0x00 ; 0 24fe0: 30 e0 ldi r19, 0x00 ; 0 24fe2: 43 e0 ldi r20, 0x03 ; 3 24fe4: 50 e0 ldi r21, 0x00 ; 0 24fe6: 6d ee ldi r22, 0xED ; 237 24fe8: 83 e0 ldi r24, 0x03 ; 3 24fea: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 24fee: 20 e0 ldi r18, 0x00 ; 0 24ff0: 30 e0 ldi r19, 0x00 ; 0 24ff2: a9 01 movw r20, r18 24ff4: 64 e9 ldi r22, 0x94 ; 148 24ff6: 83 e0 ldi r24, 0x03 ; 3 24ff8: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 24ffc: 24 e0 ldi r18, 0x04 ; 4 24ffe: 30 e0 ldi r19, 0x00 ; 0 25000: 40 e0 ldi r20, 0x00 ; 0 25002: 50 e0 ldi r21, 0x00 ; 0 25004: 60 e8 ldi r22, 0x80 ; 128 25006: 83 e0 ldi r24, 0x03 ; 3 25008: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 2500c: 2b e2 ldi r18, 0x2B ; 43 2500e: 34 e5 ldi r19, 0x54 ; 84 25010: 42 e0 ldi r20, 0x02 ; 2 25012: 50 e0 ldi r21, 0x00 ; 0 25014: 60 ef ldi r22, 0xF0 ; 240 25016: 83 e0 ldi r24, 0x03 ; 3 25018: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 2501c: 23 e9 ldi r18, 0x93 ; 147 2501e: 31 e0 ldi r19, 0x01 ; 1 25020: 40 e0 ldi r20, 0x00 ; 0 25022: 50 e0 ldi r21, 0x00 ; 0 25024: 63 e9 ldi r22, 0x93 ; 147 25026: 83 e0 ldi r24, 0x03 ; 3 25028: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 2502c: 83 e8 ldi r24, 0x83 ; 131 2502e: 9e e9 ldi r25, 0x9E ; 158 25030: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 25034: bf cf rjmp .-130 ; 0x24fb4 00025036 : , 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()); } 25036: fc 01 movw r30, r24 25038: 20 81 ld r18, Z 2503a: 92 81 ldd r25, Z+2 ; 0x02 2503c: 49 2f mov r20, r25 2503e: 50 e0 ldi r21, 0x00 ; 0 25040: 21 11 cpse r18, r1 25042: 02 c0 rjmp .+4 ; 0x25048 25044: 44 0f add r20, r20 25046: 55 1f adc r21, r21 25048: 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; } 2504a: 21 11 cpse r18, r1 2504c: 01 c0 rjmp .+2 ; 0x25050 2504e: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 25050: 84 17 cp r24, r20 25052: 15 06 cpc r1, r21 25054: 31 f0 breq .+12 ; 0x25062 25056: 2c f0 brlt .+10 ; 0x25062 25058: 89 2f mov r24, r25 2505a: 21 11 cpse r18, r1 2505c: 02 c0 rjmp .+4 ; 0x25062 2505e: 88 0f add r24, r24 25060: 08 95 ret 25062: 08 95 ret 00025064 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 25064: 3f b7 in r19, 0x3f ; 63 cli(); 25066: f8 94 cli m = timer2_overflow_count; 25068: 80 91 3f 06 lds r24, 0x063F ; 0x80063f 2506c: 90 91 40 06 lds r25, 0x0640 ; 0x800640 25070: a0 91 41 06 lds r26, 0x0641 ; 0x800641 25074: b0 91 42 06 lds r27, 0x0642 ; 0x800642 #if defined(TCNT2) t = TCNT2; 25078: 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)) 2507c: b8 9b sbis 0x17, 0 ; 23 2507e: 05 c0 rjmp .+10 ; 0x2508a 25080: 2f 3f cpi r18, 0xFF ; 255 25082: 19 f0 breq .+6 ; 0x2508a m++; 25084: 01 96 adiw r24, 0x01 ; 1 25086: a1 1d adc r26, r1 25088: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 2508a: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 2508c: ba 2f mov r27, r26 2508e: a9 2f mov r26, r25 25090: 98 2f mov r25, r24 25092: 88 27 eor r24, r24 25094: bc 01 movw r22, r24 25096: cd 01 movw r24, r26 25098: 62 0f add r22, r18 2509a: 71 1d adc r23, r1 2509c: 81 1d adc r24, r1 2509e: 91 1d adc r25, r1 250a0: 42 e0 ldi r20, 0x02 ; 2 250a2: 66 0f add r22, r22 250a4: 77 1f adc r23, r23 250a6: 88 1f adc r24, r24 250a8: 99 1f adc r25, r25 250aa: 4a 95 dec r20 250ac: d1 f7 brne .-12 ; 0x250a2 } 250ae: 08 95 ret 000250b0 : void delay2(unsigned long ms) { 250b0: 8f 92 push r8 250b2: 9f 92 push r9 250b4: af 92 push r10 250b6: bf 92 push r11 250b8: cf 92 push r12 250ba: df 92 push r13 250bc: ef 92 push r14 250be: ff 92 push r15 250c0: 6b 01 movw r12, r22 250c2: 7c 01 movw r14, r24 uint32_t start = micros2(); 250c4: 0f 94 32 28 call 0x25064 ; 0x25064 250c8: 4b 01 movw r8, r22 250ca: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 250cc: c1 14 cp r12, r1 250ce: d1 04 cpc r13, r1 250d0: e1 04 cpc r14, r1 250d2: f1 04 cpc r15, r1 250d4: b9 f0 breq .+46 ; 0x25104 250d6: 0f 94 32 28 call 0x25064 ; 0x25064 250da: 68 19 sub r22, r8 250dc: 79 09 sbc r23, r9 250de: 8a 09 sbc r24, r10 250e0: 9b 09 sbc r25, r11 250e2: 68 3e cpi r22, 0xE8 ; 232 250e4: 73 40 sbci r23, 0x03 ; 3 250e6: 81 05 cpc r24, r1 250e8: 91 05 cpc r25, r1 250ea: 80 f3 brcs .-32 ; 0x250cc { ms--; 250ec: 21 e0 ldi r18, 0x01 ; 1 250ee: c2 1a sub r12, r18 250f0: d1 08 sbc r13, r1 250f2: e1 08 sbc r14, r1 250f4: f1 08 sbc r15, r1 start += 1000; 250f6: 88 ee ldi r24, 0xE8 ; 232 250f8: 88 0e add r8, r24 250fa: 83 e0 ldi r24, 0x03 ; 3 250fc: 98 1e adc r9, r24 250fe: a1 1c adc r10, r1 25100: b1 1c adc r11, r1 25102: e4 cf rjmp .-56 ; 0x250cc } } } 25104: ff 90 pop r15 25106: ef 90 pop r14 25108: df 90 pop r13 2510a: cf 90 pop r12 2510c: bf 90 pop r11 2510e: af 90 pop r10 25110: 9f 90 pop r9 25112: 8f 90 pop r8 25114: 08 95 ret 00025116 : * @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() { 25116: ef 92 push r14 25118: ff 92 push r15 2511a: 0f 93 push r16 2511c: 1f 93 push r17 2511e: cf 93 push r28 25120: df 93 push r29 25122: cd b7 in r28, 0x3d ; 61 25124: de b7 in r29, 0x3e ; 62 25126: 63 97 sbiw r28, 0x13 ; 19 25128: 0f b6 in r0, 0x3f ; 63 2512a: f8 94 cli 2512c: de bf out 0x3e, r29 ; 62 2512e: 0f be out 0x3f, r0 ; 63 25130: 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) 25132: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 25136: 81 11 cpse r24, r1 25138: 3a c0 rjmp .+116 ; 0x251ae { // Menu was entered. // Initialize its status. _md->status = 1; 2513a: 81 e0 ldi r24, 0x01 ; 1 2513c: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 check_babystep(); 25140: 0e 94 ff 78 call 0xf1fe ; 0xf1fe if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 25144: 81 ea ldi r24, 0xA1 ; 161 25146: 9d e0 ldi r25, 0x0D ; 13 25148: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2514c: 18 2f mov r17, r24 2514e: 0e 94 c1 75 call 0xeb82 ; 0xeb82 25152: 81 11 cpse r24, r1 25154: ee c0 rjmp .+476 ; 0x25332 _md->babystepMemZ = 0; 25156: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 2515a: 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)) 2515e: 80 e1 ldi r24, 0x10 ; 16 25160: 0e 94 7d ef call 0x1defa ; 0x1defa 25164: 81 11 cpse r24, r1 25166: 04 c0 rjmp .+8 ; 0x25170 _md->babystepMemZ = 0; 25168: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 2516c: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 25170: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 25174: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 25178: 07 2e mov r0, r23 2517a: 00 0c add r0, r0 2517c: 88 0b sbc r24, r24 2517e: 99 0b sbc r25, r25 25180: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 25184: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 25188: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2518c: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 25190: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 25194: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 25198: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 2519c: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 251a0: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 251a4: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af lcd_draw_update = 1; 251a8: 81 e0 ldi r24, 0x01 ; 1 251aa: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 251ae: 80 91 70 06 lds r24, 0x0670 ; 0x800670 251b2: 90 91 71 06 lds r25, 0x0671 ; 0x800671 251b6: 00 97 sbiw r24, 0x00 ; 0 251b8: f1 f1 breq .+124 ; 0x25236 { _md->babystepMemZ += lcd_encoder; 251ba: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 251be: 30 91 ab 03 lds r19, 0x03AB ; 0x8003ab 251c2: 28 0f add r18, r24 251c4: 39 1f adc r19, r25 251c6: 30 93 ab 03 sts 0x03AB, r19 ; 0x8003ab 251ca: 20 93 aa 03 sts 0x03AA, r18 ; 0x8003aa if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 251ce: 21 36 cpi r18, 0x61 ; 97 251d0: 40 ef ldi r20, 0xF0 ; 240 251d2: 34 07 cpc r19, r20 251d4: 0c f0 brlt .+2 ; 0x251d8 251d6: ba c0 rjmp .+372 ; 0x2534c 251d8: 81 e6 ldi r24, 0x61 ; 97 251da: 90 ef ldi r25, 0xF0 ; 240 251dc: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 251e0: 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]; 251e4: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 251e8: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 251ec: 07 2e mov r0, r23 251ee: 00 0c add r0, r0 251f0: 88 0b sbc r24, r24 251f2: 99 0b sbc r25, r25 251f4: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 251f8: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 251fc: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 25200: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 25204: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 25208: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 2520c: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 25210: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 25214: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 25218: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af _delay(50); 2521c: 62 e3 ldi r22, 0x32 ; 50 2521e: 70 e0 ldi r23, 0x00 ; 0 25220: 80 e0 ldi r24, 0x00 ; 0 25222: 90 e0 ldi r25, 0x00 ; 0 25224: 0f 94 58 28 call 0x250b0 ; 0x250b0 lcd_encoder = 0; 25228: 10 92 71 06 sts 0x0671, r1 ; 0x800671 2522c: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_draw_update = 1; 25230: 81 e0 ldi r24, 0x01 ; 1 25232: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 25236: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2523a: 88 23 and r24, r24 2523c: c9 f1 breq .+114 ; 0x252b0 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 2523e: 81 ea ldi r24, 0xA1 ; 161 25240: 9d e0 ldi r25, 0x0D ; 13 25242: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 25246: 2b e0 ldi r18, 0x0B ; 11 25248: 82 9f mul r24, r18 2524a: c0 01 movw r24, r0 2524c: 11 24 eor r1, r1 2524e: be 01 movw r22, r28 25250: 6f 5f subi r22, 0xFF ; 255 25252: 7f 4f sbci r23, 0xFF ; 255 25254: 87 5b subi r24, 0xB7 ; 183 25256: 92 4f sbci r25, 0xF2 ; 242 25258: 0f 94 68 d0 call 0x3a0d0 ; 0x3a0d0 lcd_home(); 2525c: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_print(buffer.c); 25260: ce 01 movw r24, r28 25262: 01 96 adiw r24, 0x01 ; 1 25264: 0e 94 67 70 call 0xe0ce ; 0xe0ce lcd_set_cursor(0, 1); 25268: 61 e0 ldi r22, 0x01 ; 1 2526a: 80 e0 ldi r24, 0x00 ; 0 2526c: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 25270: 10 91 ac 03 lds r17, 0x03AC ; 0x8003ac 25274: 00 91 ad 03 lds r16, 0x03AD ; 0x8003ad 25278: f0 90 ae 03 lds r15, 0x03AE ; 0x8003ae 2527c: e0 90 af 03 lds r14, 0x03AF ; 0x8003af 25280: 83 e9 ldi r24, 0x93 ; 147 25282: 90 e5 ldi r25, 0x50 ; 80 25284: 0e 94 2c 72 call 0xe458 ; 0xe458 //! (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); 25288: ef 92 push r14 2528a: ff 92 push r15 2528c: 0f 93 push r16 2528e: 1f 93 push r17 25290: 9f 93 push r25 25292: 8f 93 push r24 25294: 1f 92 push r1 25296: 80 e2 ldi r24, 0x20 ; 32 25298: 8f 93 push r24 2529a: 8a e5 ldi r24, 0x5A ; 90 2529c: 92 ea ldi r25, 0xA2 ; 162 2529e: 9f 93 push r25 252a0: 8f 93 push r24 252a2: 0e 94 39 6e call 0xdc72 ; 0xdc72 252a6: 0f b6 in r0, 0x3f ; 63 252a8: f8 94 cli 252aa: de bf out 0x3e, r29 ; 62 252ac: 0f be out 0x3f, r0 ; 63 252ae: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 252b0: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 252b4: 81 11 cpse r24, r1 252b6: 04 c0 rjmp .+8 ; 0x252c0 252b8: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 252bc: 88 23 and r24, r24 252be: 51 f1 breq .+84 ; 0x25314 { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 252c0: 81 ea ldi r24, 0xA1 ; 161 252c2: 9d e0 ldi r25, 0x0D ; 13 252c4: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 252c8: 9b e0 ldi r25, 0x0B ; 11 252ca: 89 9f mul r24, r25 252cc: 80 01 movw r16, r0 252ce: 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); 252d0: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 252d4: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 252d8: c8 01 movw r24, r16 252da: 80 5b subi r24, 0xB0 ; 176 252dc: 92 4f sbci r25, 0xF2 ; 242 252de: 0f 94 96 dc call 0x3b92c ; 0x3b92c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 252e2: 60 91 72 06 lds r22, 0x0672 ; 0x800672 252e6: c8 01 movw r24, r16 252e8: 8e 5a subi r24, 0xAE ; 174 252ea: 92 4f sbci r25, 0xF2 ; 242 252ec: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 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); 252f0: 60 91 99 03 lds r22, 0x0399 ; 0x800399 252f4: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 252f8: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 252fc: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 25300: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 25304: c8 01 movw r24, r16 25306: 8d 5a subi r24, 0xAD ; 173 25308: 92 4f sbci r25, 0xF2 ; 242 2530a: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 2530e: 80 e1 ldi r24, 0x10 ; 16 25310: 0e 94 70 ef call 0x1dee0 ; 0x1dee0 } menu_back_if_clicked(); 25314: 0f 94 38 d5 call 0x3aa70 ; 0x3aa70 } 25318: 63 96 adiw r28, 0x13 ; 19 2531a: 0f b6 in r0, 0x3f ; 63 2531c: f8 94 cli 2531e: de bf out 0x3e, r29 ; 62 25320: 0f be out 0x3f, r0 ; 63 25322: cd bf out 0x3d, r28 ; 61 25324: df 91 pop r29 25326: cf 91 pop r28 25328: 1f 91 pop r17 2532a: 0f 91 pop r16 2532c: ff 90 pop r15 2532e: ef 90 pop r14 25330: 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-> 25332: 2b e0 ldi r18, 0x0B ; 11 25334: 12 9f mul r17, r18 25336: c0 01 movw r24, r0 25338: 11 24 eor r1, r1 2533a: 80 5b subi r24, 0xB0 ; 176 2533c: 92 4f sbci r25, 0xF2 ; 242 2533e: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 25342: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 25346: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 2534a: 09 cf rjmp .-494 ; 0x2515e 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 2534c: 12 16 cp r1, r18 2534e: 13 06 cpc r1, r19 25350: 2c f4 brge .+10 ; 0x2535c 25352: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 25356: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa 2535a: 44 cf rjmp .-376 ; 0x251e4 extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 2535c: 2f b7 in r18, 0x3f ; 63 2535e: f8 94 cli babystepsTodo[Z_AXIS] += n; 25360: 40 91 6d 06 lds r20, 0x066D ; 0x80066d 25364: 50 91 6e 06 lds r21, 0x066E ; 0x80066e 25368: 84 0f add r24, r20 2536a: 95 1f adc r25, r21 2536c: 90 93 6e 06 sts 0x066E, r25 ; 0x80066e 25370: 80 93 6d 06 sts 0x066D, r24 ; 0x80066d CRITICAL_SECTION_END 25374: 2f bf out 0x3f, r18 ; 63 25376: 36 cf rjmp .-404 ; 0x251e4 00025378 : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 25378: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 2537c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 25380: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 25384: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 25388: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2538c: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 25390: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 25394: 26 17 cp r18, r22 25396: 37 07 cpc r19, r23 25398: 0c f0 brlt .+2 ; 0x2539c 2539a: 65 c0 rjmp .+202 ; 0x25466 { if (lcd_encoder != 0) 2539c: 80 91 70 06 lds r24, 0x0670 ; 0x800670 253a0: 90 91 71 06 lds r25, 0x0671 ; 0x800671 253a4: 89 2b or r24, r25 253a6: b9 f1 breq .+110 ; 0x25416 { refresh_cmd_timeout(); 253a8: 0e 94 43 66 call 0xcc86 ; 0xcc86 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; 253ac: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 if (++ next_block_index == BLOCK_BUFFER_SIZE) 253b0: 8f 5f subi r24, 0xFF ; 255 253b2: 80 31 cpi r24, 0x10 ; 16 253b4: 09 f4 brne .+2 ; 0x253b8 next_block_index = 0; 253b6: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 253b8: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 if (! planner_queue_full()) 253bc: 98 17 cp r25, r24 253be: 59 f1 breq .+86 ; 0x25416 { current_position[E_AXIS] += lcd_encoder; 253c0: 60 91 70 06 lds r22, 0x0670 ; 0x800670 253c4: 70 91 71 06 lds r23, 0x0671 ; 0x800671 253c8: 07 2e mov r0, r23 253ca: 00 0c add r0, r0 253cc: 88 0b sbc r24, r24 253ce: 99 0b sbc r25, r25 253d0: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 253d4: 9b 01 movw r18, r22 253d6: ac 01 movw r20, r24 253d8: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 253dc: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 253e0: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 253e4: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 253e8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 253ec: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 253f0: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 253f4: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 253f8: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 lcd_encoder = 0; 253fc: 10 92 71 06 sts 0x0671, r1 ; 0x800671 25400: 10 92 70 06 sts 0x0670, r1 ; 0x800670 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 25404: 65 e5 ldi r22, 0x55 ; 85 25406: 75 e5 ldi r23, 0x55 ; 85 25408: 85 ed ldi r24, 0xD5 ; 213 2540a: 9f e3 ldi r25, 0x3F ; 63 2540c: 0f 94 81 c0 call 0x38102 ; 0x38102 lcd_draw_update = 1; 25410: 81 e0 ldi r24, 0x01 ; 1 25412: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 25416: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2541a: 88 23 and r24, r24 2541c: 11 f1 breq .+68 ; 0x25462 { lcd_set_cursor(0, 1); 2541e: 61 e0 ldi r22, 0x01 ; 1 25420: 80 e0 ldi r24, 0x00 ; 0 25422: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 //! 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); 25426: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 2542a: 8f 93 push r24 2542c: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 25430: 8f 93 push r24 25432: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 25436: 8f 93 push r24 25438: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 2543c: 8f 93 push r24 2543e: 8c e3 ldi r24, 0x3C ; 60 25440: 92 ea ldi r25, 0xA2 ; 162 25442: 9f 93 push r25 25444: 8f 93 push r24 25446: 8d e2 ldi r24, 0x2D ; 45 25448: 92 ea ldi r25, 0xA2 ; 162 2544a: 9f 93 push r25 2544c: 8f 93 push r24 2544e: 0e 94 39 6e call 0xdc72 ; 0xdc72 25452: 8d b7 in r24, 0x3d ; 61 25454: 9e b7 in r25, 0x3e ; 62 25456: 08 96 adiw r24, 0x08 ; 8 25458: 0f b6 in r0, 0x3f ; 63 2545a: f8 94 cli 2545c: 9e bf out 0x3e, r25 ; 62 2545e: 0f be out 0x3f, r0 ; 63 25460: 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(); 25462: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 }; } void show_preheat_nozzle_warning() { lcd_clear(); 25466: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 2546a: 84 e2 ldi r24, 0x24 ; 36 2546c: 90 e5 ldi r25, 0x50 ; 80 2546e: 0e 94 2c 72 call 0xe458 ; 0xe458 25472: ac 01 movw r20, r24 25474: 60 e0 ldi r22, 0x00 ; 0 25476: 80 e0 ldi r24, 0x00 ; 0 25478: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 2547c: 8e e0 ldi r24, 0x0E ; 14 2547e: 90 e5 ldi r25, 0x50 ; 80 25480: 0e 94 2c 72 call 0xe458 ; 0xe458 25484: ac 01 movw r20, r24 25486: 62 e0 ldi r22, 0x02 ; 2 25488: 80 e0 ldi r24, 0x00 ; 0 2548a: 0e 94 74 6e call 0xdce8 ; 0xdce8 _delay(2000); 2548e: 60 ed ldi r22, 0xD0 ; 208 25490: 77 e0 ldi r23, 0x07 ; 7 25492: 80 e0 ldi r24, 0x00 ; 0 25494: 90 e0 ldi r25, 0x00 ; 0 25496: 0f 94 58 28 call 0x250b0 ; 0x250b0 lcd_clear(); 2549a: 0e 94 93 6e call 0xdd26 ; 0xdd26 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 2549e: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 000254a2 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 254a2: 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(); 254a4: f8 94 cli m = timer2_millis; 254a6: 60 91 3b 06 lds r22, 0x063B ; 0x80063b 254aa: 70 91 3c 06 lds r23, 0x063C ; 0x80063c 254ae: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 254b2: 90 91 3e 06 lds r25, 0x063E ; 0x80063e SREG = oldSREG; 254b6: 2f bf out 0x3f, r18 ; 63 return m; } 254b8: 08 95 ret 000254ba : } //! @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); 254ba: 20 e0 ldi r18, 0x00 ; 0 254bc: 30 e0 ldi r19, 0x00 ; 0 254be: 40 e8 ldi r20, 0x80 ; 128 254c0: 5f eb ldi r21, 0xBF ; 191 254c2: 60 e0 ldi r22, 0x00 ; 0 254c4: 70 e0 ldi r23, 0x00 ; 0 254c6: cb 01 movw r24, r22 254c8: 0e 94 bf 88 call 0x1117e ; 0x1117e SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 254cc: 85 e5 ldi r24, 0x55 ; 85 254ce: 9e e6 ldi r25, 0x6E ; 110 254d0: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 // Indicate that the printer is paused did_pause_print = true; 254d4: 81 e0 ldi r24, 0x01 ; 1 254d6: 80 93 e4 03 sts 0x03E4, r24 ; 0x8003e4 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 254da: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 254de: 81 30 cpi r24, 0x01 ; 1 254e0: 69 f4 brne .+26 ; 0x254fc state = PAUSED; 254e2: 82 e0 ldi r24, 0x02 ; 2 254e4: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 254e8: 0f 94 51 2a call 0x254a2 ; 0x254a2 254ec: 60 93 52 06 sts 0x0652, r22 ; 0x800652 254f0: 70 93 53 06 sts 0x0653, r23 ; 0x800653 254f4: 80 93 54 06 sts 0x0654, r24 ; 0x800654 254f8: 90 93 55 06 sts 0x0655, r25 ; 0x800655 print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 254fc: 82 e0 ldi r24, 0x02 ; 2 254fe: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 25502: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 00025506 ::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) 25506: ff 92 push r15 25508: 0f 93 push r16 2550a: 1f 93 push r17 2550c: cf 93 push r28 2550e: df 93 push r29 { if (!m_isRunning) return false; 25510: fc 01 movw r30, r24 25512: f0 80 ld r15, Z 25514: f1 10 cpse r15, r1 25516: 08 c0 rjmp .+16 ; 0x25528 ::expired(unsigned short)+0x22> 25518: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 2551a: 8f 2d mov r24, r15 2551c: df 91 pop r29 2551e: cf 91 pop r28 25520: 1f 91 pop r17 25522: 0f 91 pop r16 25524: ff 90 pop r15 25526: 08 95 ret 25528: 8b 01 movw r16, r22 2552a: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 2552c: 0f 94 51 2a call 0x254a2 ; 0x254a2 if (m_started <= m_started + msPeriod) 25530: 89 81 ldd r24, Y+1 ; 0x01 25532: 9a 81 ldd r25, Y+2 ; 0x02 25534: 08 0f add r16, r24 25536: 19 1f adc r17, r25 25538: 08 17 cp r16, r24 2553a: 19 07 cpc r17, r25 2553c: 40 f0 brcs .+16 ; 0x2554e ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 2553e: 60 17 cp r22, r16 25540: 71 07 cpc r23, r17 25542: 18 f4 brcc .+6 ; 0x2554a ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 25544: 68 17 cp r22, r24 25546: 79 07 cpc r23, r25 25548: 38 f7 brcc .-50 ; 0x25518 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 2554a: 18 82 st Y, r1 2554c: e6 cf rjmp .-52 ; 0x2551a ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2554e: 60 17 cp r22, r16 25550: 71 07 cpc r23, r17 25552: c0 f7 brcc .-16 ; 0x25544 ::expired(unsigned short)+0x3e> 25554: e1 cf rjmp .-62 ; 0x25518 ::expired(unsigned short)+0x12> 00025556 ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 25556: fc 01 movw r30, r24 25558: 20 81 ld r18, Z 2555a: 21 11 cpse r18, r1 2555c: 0d 94 83 2a jmp 0x25506 ; 0x25506 ::expired(unsigned short)> } 25560: 81 e0 ldi r24, 0x01 ; 1 25562: 08 95 ret 00025564 ::start()>: /** * @brief Start timer */ template void Timer::start() 25564: cf 93 push r28 25566: df 93 push r29 25568: ec 01 movw r28, r24 { m_started = _millis(); 2556a: 0f 94 51 2a call 0x254a2 ; 0x254a2 2556e: 7a 83 std Y+2, r23 ; 0x02 25570: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 25572: 81 e0 ldi r24, 0x01 ; 1 25574: 88 83 st Y, r24 } 25576: df 91 pop r29 25578: cf 91 pop r28 2557a: 08 95 ret 0002557c : TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); } static uint8_t twi_wait(uint8_t status) { 2557c: 1f 93 push r17 2557e: cf 93 push r28 25580: df 93 push r29 25582: 00 d0 rcall .+0 ; 0x25584 25584: cd b7 in r28, 0x3d ; 61 25586: de b7 in r29, 0x3e ; 62 25588: 18 2f mov r17, r24 ShortTimer timmy; 2558a: 19 82 std Y+1, r1 ; 0x01 2558c: 1b 82 std Y+3, r1 ; 0x03 2558e: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 25590: ce 01 movw r24, r28 25592: 01 96 adiw r24, 0x01 ; 1 25594: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> while(!(TWCR & _BV(TWINT))) { 25598: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 2559c: 87 fd sbrc r24, 7 2559e: 0a c0 rjmp .+20 ; 0x255b4 if (timmy.expired(TWI_TIMEOUT_MS)) { 255a0: 6a e0 ldi r22, 0x0A ; 10 255a2: 70 e0 ldi r23, 0x00 ; 0 255a4: ce 01 movw r24, r28 255a6: 01 96 adiw r24, 0x01 ; 1 255a8: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 255ac: 88 23 and r24, r24 255ae: a1 f3 breq .-24 ; 0x25598 return 2; 255b0: 82 e0 ldi r24, 0x02 ; 2 255b2: 09 c0 rjmp .+18 ; 0x255c6 } } if(TW_STATUS != status) 255b4: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 255b8: 88 7f andi r24, 0xF8 ; 248 255ba: 18 17 cp r17, r24 255bc: 59 f0 breq .+22 ; 0x255d4 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 255be: 84 e9 ldi r24, 0x94 ; 148 255c0: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 255c4: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 255c6: 0f 90 pop r0 255c8: 0f 90 pop r0 255ca: 0f 90 pop r0 255cc: df 91 pop r29 255ce: cf 91 pop r28 255d0: 1f 91 pop r17 255d2: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 255d4: 80 e0 ldi r24, 0x00 ; 0 255d6: f7 cf rjmp .-18 ; 0x255c6 000255d8 : } return standstill; } void tmc2130_check_overtemp() { 255d8: 1f 93 push r17 255da: cf 93 push r28 255dc: df 93 push r29 255de: 00 d0 rcall .+0 ; 0x255e0 255e0: 1f 92 push r1 255e2: cd b7 in r28, 0x3d ; 61 255e4: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 255e6: 68 ee ldi r22, 0xE8 ; 232 255e8: 73 e0 ldi r23, 0x03 ; 3 255ea: 84 e4 ldi r24, 0x44 ; 68 255ec: 96 e0 ldi r25, 0x06 ; 6 255ee: 0f 94 ab 2a call 0x25556 ; 0x25556 ::expired_cont(unsigned short)> 255f2: 88 23 and r24, r24 255f4: 91 f1 breq .+100 ; 0x2565a { for (uint_least8_t i = 0; i < 4; i++) 255f6: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 255f8: 19 82 std Y+1, r1 ; 0x01 255fa: 1a 82 std Y+2, r1 ; 0x02 255fc: 1b 82 std Y+3, r1 ; 0x03 255fe: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 25600: ae 01 movw r20, r28 25602: 4f 5f subi r20, 0xFF ; 255 25604: 5f 4f sbci r21, 0xFF ; 255 25606: 6f e6 ldi r22, 0x6F ; 111 25608: 81 2f mov r24, r17 2560a: 0f 94 f6 24 call 0x249ec ; 0x249ec if (drv_status & ((uint32_t)1 << 26)) 2560e: 89 81 ldd r24, Y+1 ; 0x01 25610: 9a 81 ldd r25, Y+2 ; 0x02 25612: ab 81 ldd r26, Y+3 ; 0x03 25614: bc 81 ldd r27, Y+4 ; 0x04 25616: b2 ff sbrs r27, 2 25618: 19 c0 rjmp .+50 ; 0x2564c { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 2561a: 86 ec ldi r24, 0xC6 ; 198 2561c: 9d e6 ldi r25, 0x6D ; 109 2561e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 25622: 81 2f mov r24, r17 25624: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 25628: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 2562c: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 2562e: 20 e0 ldi r18, 0x00 ; 0 25630: 30 e0 ldi r19, 0x00 ; 0 25632: 41 e0 ldi r20, 0x01 ; 1 25634: 50 e0 ldi r21, 0x00 ; 0 25636: 6c ee ldi r22, 0xEC ; 236 25638: 81 2f mov r24, r17 2563a: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 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++) 2563e: 1f 5f subi r17, 0xFF ; 255 25640: 14 30 cpi r17, 0x04 ; 4 25642: a9 f7 brne .-22 ; 0x2562e tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 25644: 86 ec ldi r24, 0xC6 ; 198 25646: 9d e6 ldi r25, 0x6D ; 109 25648: 0e 94 8a 79 call 0xf314 ; 0xf314 void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 2564c: 1f 5f subi r17, 0xFF ; 255 2564e: 14 30 cpi r17, 0x04 ; 4 25650: 99 f6 brne .-90 ; 0x255f8 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 25652: 84 e4 ldi r24, 0x44 ; 68 25654: 96 e0 ldi r25, 0x06 ; 6 25656: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> } } 2565a: 0f 90 pop r0 2565c: 0f 90 pop r0 2565e: 0f 90 pop r0 25660: 0f 90 pop r0 25662: df 91 pop r29 25664: cf 91 pop r28 25666: 1f 91 pop r17 25668: 08 95 ret 0002566a ::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) 2566a: 8f 92 push r8 2566c: 9f 92 push r9 2566e: af 92 push r10 25670: bf 92 push r11 25672: cf 92 push r12 25674: df 92 push r13 25676: ef 92 push r14 25678: ff 92 push r15 2567a: 1f 93 push r17 2567c: cf 93 push r28 2567e: df 93 push r29 { if (!m_isRunning) return false; 25680: fc 01 movw r30, r24 25682: 10 81 ld r17, Z 25684: 11 11 cpse r17, r1 25686: 0e c0 rjmp .+28 ; 0x256a4 ::expired(unsigned long)+0x3a> 25688: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 2568a: 81 2f mov r24, r17 2568c: df 91 pop r29 2568e: cf 91 pop r28 25690: 1f 91 pop r17 25692: ff 90 pop r15 25694: ef 90 pop r14 25696: df 90 pop r13 25698: cf 90 pop r12 2569a: bf 90 pop r11 2569c: af 90 pop r10 2569e: 9f 90 pop r9 256a0: 8f 90 pop r8 256a2: 08 95 ret 256a4: 6a 01 movw r12, r20 256a6: 7b 01 movw r14, r22 256a8: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 256aa: 0f 94 51 2a call 0x254a2 ; 0x254a2 256ae: 4b 01 movw r8, r22 256b0: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 256b2: 89 81 ldd r24, Y+1 ; 0x01 256b4: 9a 81 ldd r25, Y+2 ; 0x02 256b6: ab 81 ldd r26, Y+3 ; 0x03 256b8: bc 81 ldd r27, Y+4 ; 0x04 256ba: c8 0e add r12, r24 256bc: d9 1e adc r13, r25 256be: ea 1e adc r14, r26 256c0: fb 1e adc r15, r27 256c2: c8 16 cp r12, r24 256c4: d9 06 cpc r13, r25 256c6: ea 06 cpc r14, r26 256c8: fb 06 cpc r15, r27 256ca: 60 f0 brcs .+24 ; 0x256e4 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 256cc: 8c 14 cp r8, r12 256ce: 9d 04 cpc r9, r13 256d0: ae 04 cpc r10, r14 256d2: bf 04 cpc r11, r15 256d4: 28 f4 brcc .+10 ; 0x256e0 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 256d6: 88 16 cp r8, r24 256d8: 99 06 cpc r9, r25 256da: aa 06 cpc r10, r26 256dc: bb 06 cpc r11, r27 256de: a0 f6 brcc .-88 ; 0x25688 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 256e0: 18 82 st Y, r1 256e2: d3 cf rjmp .-90 ; 0x2568a ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 256e4: 8c 14 cp r8, r12 256e6: 9d 04 cpc r9, r13 256e8: ae 04 cpc r10, r14 256ea: bf 04 cpc r11, r15 256ec: a0 f7 brcc .-24 ; 0x256d6 ::expired(unsigned long)+0x6c> 256ee: cc cf rjmp .-104 ; 0x25688 ::expired(unsigned long)+0x1e> 000256f0 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 256f0: 0f 93 push r16 256f2: 1f 93 push r17 256f4: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 256f6: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 256fa: 88 23 and r24, r24 256fc: 09 f4 brne .+2 ; 0x25700 256fe: 4d c0 rjmp .+154 ; 0x2579a heating_status_counter++; 25700: 80 91 4b 06 lds r24, 0x064B ; 0x80064b 25704: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 25706: 8e 30 cpi r24, 0x0E ; 14 25708: b0 f4 brcc .+44 ; 0x25736 //! @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++; 2570a: 80 93 4b 06 sts 0x064B, r24 ; 0x80064b if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 2570e: 63 e0 ldi r22, 0x03 ; 3 25710: 87 e0 ldi r24, 0x07 ; 7 25712: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_space(13); 25716: 8d e0 ldi r24, 0x0D ; 13 25718: 0e 94 56 6e call 0xdcac ; 0xdcac for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 2571c: c0 e0 ldi r28, 0x00 ; 0 2571e: 80 91 4b 06 lds r24, 0x064B ; 0x80064b 25722: c8 17 cp r28, r24 25724: 58 f4 brcc .+22 ; 0x2573c lcd_putc_at(7 + dots, 3, '.'); 25726: 4e e2 ldi r20, 0x2E ; 46 25728: 63 e0 ldi r22, 0x03 ; 3 2572a: 87 e0 ldi r24, 0x07 ; 7 2572c: 8c 0f add r24, r28 2572e: 0e 94 80 6e call 0xdd00 ; 0xdd00 heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 25732: cf 5f subi r28, 0xFF ; 255 25734: f4 cf rjmp .-24 ; 0x2571e 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; 25736: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b 2573a: e9 cf rjmp .-46 ; 0x2570e lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 2573c: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 25740: 82 30 cpi r24, 0x02 ; 2 25742: d1 f0 breq .+52 ; 0x25778 25744: 30 f4 brcc .+12 ; 0x25752 25746: 81 30 cpi r24, 0x01 ; 1 25748: 59 f0 breq .+22 ; 0x25760 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2574a: cf 91 pop r28 2574c: 1f 91 pop r17 2574e: 0f 91 pop r16 25750: 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) { 25752: 83 30 cpi r24, 0x03 ; 3 25754: f9 f0 breq .+62 ; 0x25794 25756: 84 30 cpi r24, 0x04 ; 4 25758: c1 f7 brne .-16 ; 0x2574a 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)); 2575a: 82 e4 ldi r24, 0x42 ; 66 2575c: 9d e4 ldi r25, 0x4D ; 77 2575e: 0e c0 rjmp .+28 ; 0x2577c 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)); 25760: 8b e6 ldi r24, 0x6B ; 107 25762: 9d e4 ldi r25, 0x4D ; 77 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 25764: 0e 94 2c 72 call 0xe458 ; 0xe458 25768: ac 01 movw r20, r24 2576a: 63 e0 ldi r22, 0x03 ; 3 2576c: 80 e0 ldi r24, 0x00 ; 0 break; } } } 2576e: cf 91 pop r28 25770: 1f 91 pop r17 25772: 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)); 25774: 0c 94 74 6e jmp 0xdce8 ; 0xdce8 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)); 25778: 8b e5 ldi r24, 0x5B ; 91 2577a: 9d e4 ldi r25, 0x4D ; 77 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)); 2577c: 0e 94 2c 72 call 0xe458 ; 0xe458 25780: ac 01 movw r20, r24 25782: 63 e0 ldi r22, 0x03 ; 3 25784: 80 e0 ldi r24, 0x00 ; 0 25786: 0e 94 74 6e call 0xdce8 ; 0xdce8 heating_status = HeatingStatus::NO_HEATING; 2578a: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 heating_status_counter = 0; 2578e: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b 25792: db cf rjmp .-74 ; 0x2574a 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)); 25794: 8d e4 ldi r24, 0x4D ; 77 25796: 9d e4 ldi r25, 0x4D ; 77 25798: e5 cf rjmp .-54 ; 0x25764 #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) && 2579a: 80 91 90 14 lds r24, 0x1490 ; 0x801490 2579e: 88 23 and r24, r24 257a0: 61 f1 breq .+88 ; 0x257fa } else if (((IS_SD_PRINTING) #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && 257a2: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 257a6: 81 11 cpse r24, r1 257a8: 28 c0 rjmp .+80 ; 0x257fa (custom_message_type == CustomMsg::Status) && 257aa: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> 257ae: 82 30 cpi r24, 0x02 ; 2 257b0: 20 f5 brcc .+72 ; 0x257fa } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 257b2: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.454> 257b6: 81 11 cpse r24, r1 257b8: 16 c0 rjmp .+44 ; 0x257e6 (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); 257ba: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 257be: 88 23 and r24, r24 257c0: 09 f4 brne .+2 ; 0x257c4 257c2: 35 c0 rjmp .+106 ; 0x2582e 257c4: 87 ea ldi r24, 0xA7 ; 167 257c6: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 257c8: 20 91 b9 0d lds r18, 0x0DB9 ; 0x800db9 257cc: 64 e1 ldi r22, 0x14 ; 20 257ce: 82 0f add r24, r18 257d0: 91 1d adc r25, r1 257d2: 0e 94 4f 70 call 0xe09e ; 0xe09e 257d6: 81 11 cpse r24, r1 257d8: 2d c0 rjmp .+90 ; 0x25834 { scrollstuff++; 257da: 80 91 b9 0d lds r24, 0x0DB9 ; 0x800db9 257de: 8f 5f subi r24, 0xFF ; 255 257e0: 80 93 b9 0d sts 0x0DB9, r24 ; 0x800db9 257e4: b2 cf rjmp .-156 ; 0x2574a 257e6: 40 e2 ldi r20, 0x20 ; 32 257e8: 5e e4 ldi r21, 0x4E ; 78 257ea: 60 e0 ldi r22, 0x00 ; 0 257ec: 70 e0 ldi r23, 0x00 ; 0 257ee: 84 e3 ldi r24, 0x34 ; 52 257f0: 95 e0 ldi r25, 0x05 ; 5 257f2: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 257f6: 81 11 cpse r24, r1 257f8: e0 cf rjmp .-64 ; 0x257ba 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) 257fa: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 257fe: 81 11 cpse r24, r1 25800: 1c c0 rjmp .+56 ; 0x2583a { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 25802: e0 91 c4 06 lds r30, 0x06C4 ; 0x8006c4 25806: ea 30 cpi r30, 0x0A ; 10 25808: 08 f0 brcs .+2 ; 0x2580c 2580a: 9f cf rjmp .-194 ; 0x2574a 2580c: f0 e0 ldi r31, 0x00 ; 0 2580e: 88 27 eor r24, r24 25810: e3 5f subi r30, 0xF3 ; 243 25812: f3 4d sbci r31, 0xD3 ; 211 25814: 8e 4f sbci r24, 0xFE ; 254 25816: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 2581a: ec 38 cpi r30, 0x8C ; 140 2581c: e4 39 cpi r30, 0x94 ; 148 2581e: ec 38 cpi r30, 0x8C ; 140 25820: 28 39 cpi r18, 0x98 ; 152 25822: 74 39 cpi r23, 0x94 ; 148 25824: 24 3a cpi r18, 0xA4 ; 164 25826: ec 38 cpi r30, 0x8C ; 140 25828: ec 38 cpi r30, 0x8C ; 140 2582a: ba 3a cpi r27, 0xAA ; 170 2582c: ec 38 cpi r30, 0x8C ; 140 (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); 2582e: 82 e9 ldi r24, 0x92 ; 146 25830: 94 e1 ldi r25, 0x14 ; 20 25832: ca cf rjmp .-108 ; 0x257c8 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 25834: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 25838: 88 cf rjmp .-240 ; 0x2574a } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 2583a: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.454> 2583e: 88 23 and r24, r24 25840: 01 f3 breq .-64 ; 0x25802 * 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; 25842: 0f 94 51 2a call 0x254a2 ; 0x254a2 25846: 00 91 35 05 lds r16, 0x0535 ; 0x800535 <_ZL26lcd_status_message_timeout.lto_priv.454+0x1> 2584a: 10 91 36 05 lds r17, 0x0536 ; 0x800536 <_ZL26lcd_status_message_timeout.lto_priv.454+0x2> 2584e: 20 91 37 05 lds r18, 0x0537 ; 0x800537 <_ZL26lcd_status_message_timeout.lto_priv.454+0x3> 25852: 30 91 38 05 lds r19, 0x0538 ; 0x800538 <_ZL26lcd_status_message_timeout.lto_priv.454+0x4> 25856: 60 1b sub r22, r16 25858: 71 0b sbc r23, r17 2585a: 82 0b sbc r24, r18 2585c: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 2585e: 60 3a cpi r22, 0xA0 ; 160 25860: 7f 40 sbci r23, 0x0F ; 15 25862: 81 05 cpc r24, r1 25864: 91 05 cpc r25, r1 25866: 68 f6 brcc .-102 ; 0x25802 25868: 70 cf rjmp .-288 ; 0x2574a 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); 2586a: 63 e0 ldi r22, 0x03 ; 3 2586c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.450> 25870: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 25874: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.450> 25878: c4 e1 ldi r28, 0x14 ; 20 2587a: 6c 2f mov r22, r28 2587c: 68 1b sub r22, r24 2587e: 90 e0 ldi r25, 0x00 ; 0 25880: 81 5e subi r24, 0xE1 ; 225 25882: 9a 4f sbci r25, 0xFA ; 250 25884: 0e 94 4f 70 call 0xe09e ; 0xe09e lcd_status_message_idx = LCD_WIDTH - padding; 25888: c8 1b sub r28, r24 2588a: c0 93 1e 05 sts 0x051E, r28 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.450> 2588e: 5d cf rjmp .-326 ; 0x2574a } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 25890: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 25894: 8b 30 cpi r24, 0x0B ; 11 25896: 08 f1 brcs .+66 ; 0x258da lcd_set_cursor(0, 3); 25898: 63 e0 ldi r22, 0x03 ; 3 2589a: 80 e0 ldi r24, 0x00 ; 0 2589c: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_space(LCD_WIDTH); 258a0: 84 e1 ldi r24, 0x14 ; 20 258a2: 0e 94 56 6e call 0xdcac ; 0xdcac lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 258a6: 82 e3 ldi r24, 0x32 ; 50 258a8: 9d e4 ldi r25, 0x4D ; 77 258aa: 0e 94 2c 72 call 0xe458 ; 0xe458 258ae: ac 01 movw r20, r24 258b0: 63 e0 ldi r22, 0x03 ; 3 258b2: 80 e0 ldi r24, 0x00 ; 0 258b4: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_P(PSTR(" : ")); 258b8: 8c e8 ldi r24, 0x8C ; 140 258ba: 9f e9 ldi r25, 0x9F ; 159 258bc: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_print(custom_message_state - 10); 258c0: 60 91 f7 03 lds r22, 0x03F7 ; 0x8003f7 258c4: 6a 50 subi r22, 0x0A ; 10 258c6: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 258c8: 07 2e mov r0, r23 258ca: 00 0c add r0, r0 258cc: 88 0b sbc r24, r24 258ce: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 258d0: cf 91 pop r28 258d2: 1f 91 pop r17 258d4: 0f 91 pop r16 258d6: 0c 94 19 70 jmp 0xe032 ; 0xe032 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) { 258da: 83 30 cpi r24, 0x03 ; 3 258dc: 31 f4 brne .+12 ; 0x258ea lcd_setstatuspgm(MSG_WELCOME); 258de: 8f ec ldi r24, 0xCF ; 207 258e0: 9f e6 ldi r25, 0x6F ; 111 258e2: 0e 94 3b f2 call 0x1e476 ; 0x1e476 custom_message_type = CustomMsg::Status; 258e6: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } if (custom_message_state > 3 && custom_message_state <= 10) { 258ea: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 258ee: 84 50 subi r24, 0x04 ; 4 258f0: 87 30 cpi r24, 0x07 ; 7 258f2: 08 f0 brcs .+2 ; 0x258f6 258f4: 2a cf rjmp .-428 ; 0x2574a lcd_set_cursor(0, 3); 258f6: 63 e0 ldi r22, 0x03 ; 3 258f8: 80 e0 ldi r24, 0x00 ; 0 258fa: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_space(19); 258fe: 83 e1 ldi r24, 0x13 ; 19 25900: 0e 94 56 6e call 0xdcac ; 0xdcac lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 25904: 8f e1 ldi r24, 0x1F ; 31 25906: 9d e4 ldi r25, 0x4D ; 77 25908: 0e 94 2c 72 call 0xe458 ; 0xe458 2590c: ac 01 movw r20, r24 2590e: 63 e0 ldi r22, 0x03 ; 3 25910: 80 e0 ldi r24, 0x00 ; 0 25912: 0e 94 74 6e call 0xdce8 ; 0xdce8 custom_message_state--; 25916: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 2591a: 81 50 subi r24, 0x01 ; 1 2591c: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 25920: 14 cf rjmp .-472 ; 0x2574a } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 25922: 64 e1 ldi r22, 0x14 ; 20 25924: 8f e1 ldi r24, 0x1F ; 31 25926: 95 e0 ldi r25, 0x05 ; 5 25928: 0e 94 4f 70 call 0xe09e ; 0xe09e if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 2592c: 20 91 49 06 lds r18, 0x0649 ; 0x800649 25930: 30 91 4a 06 lds r19, 0x064A ; 0x80064a 25934: 80 91 47 06 lds r24, 0x0647 ; 0x800647 25938: 90 91 48 06 lds r25, 0x0648 ; 0x800648 2593c: 82 17 cp r24, r18 2593e: 93 07 cpc r25, r19 25940: 0c f4 brge .+2 ; 0x25944 25942: 03 cf rjmp .-506 ; 0x2574a 25944: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 25948: 88 23 and r24, r24 2594a: 09 f4 brne .+2 ; 0x2594e 2594c: fe ce rjmp .-516 ; 0x2574a lcd_set_cursor(10, 3); 2594e: 63 e0 ldi r22, 0x03 ; 3 25950: 8a e0 ldi r24, 0x0A ; 10 25952: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 25956: 80 91 48 06 lds r24, 0x0648 ; 0x800648 2595a: 8f 93 push r24 2595c: 80 91 47 06 lds r24, 0x0647 ; 0x800647 25960: 8f 93 push r24 25962: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 25966: 8f 93 push r24 25968: 80 91 49 06 lds r24, 0x0649 ; 0x800649 2596c: 8f 93 push r24 2596e: 83 e8 ldi r24, 0x83 ; 131 25970: 9f e9 ldi r25, 0x9F ; 159 } 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); 25972: 9f 93 push r25 25974: 8f 93 push r24 25976: 0e 94 39 6e call 0xdc72 ; 0xdc72 2597a: 0f 90 pop r0 2597c: 0f 90 pop r0 2597e: 0f 90 pop r0 25980: 0f 90 pop r0 25982: 0f 90 pop r0 25984: 0f 90 pop r0 25986: e1 ce rjmp .-574 ; 0x2574a 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); 25988: 63 e0 ldi r22, 0x03 ; 3 2598a: 80 e0 ldi r24, 0x00 ; 0 2598c: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 25990: c0 91 f7 03 lds r28, 0x03F7 ; 0x8003f7 25994: 85 eb ldi r24, 0xB5 ; 181 25996: 94 e4 ldi r25, 0x44 ; 68 25998: 0e 94 2c 72 call 0xe458 ; 0xe458 2599c: 1f 92 push r1 2599e: cf 93 push r28 259a0: 9f 93 push r25 259a2: 8f 93 push r24 259a4: 85 e7 ldi r24, 0x75 ; 117 259a6: 9f e9 ldi r25, 0x9F ; 159 259a8: e4 cf rjmp .-56 ; 0x25972 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 259aa: 8f e0 ldi r24, 0x0F ; 15 259ac: 9d e4 ldi r25, 0x4D ; 77 259ae: 0e 94 2c 72 call 0xe458 ; 0xe458 259b2: ac 01 movw r20, r24 259b4: 63 e0 ldi r22, 0x03 ; 3 259b6: 80 e0 ldi r24, 0x00 ; 0 259b8: 0e 94 74 6e call 0xdce8 ; 0xdce8 if (custom_message_state <= PINDA_HEAT_T) { 259bc: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 259c0: 89 37 cpi r24, 0x79 ; 121 259c2: 08 f0 brcs .+2 ; 0x259c6 259c4: c2 ce rjmp .-636 ; 0x2574a lcd_puts_P(PSTR(": ")); 259c6: 82 e7 ldi r24, 0x72 ; 114 259c8: 9f e9 ldi r25, 0x9F ; 159 259ca: 0e 94 4b 6e call 0xdc96 ; 0xdc96 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 259ce: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 259d2: 0e 94 0f 6f call 0xde1e ; 0xde1e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 259d6: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 259d8: cf 91 pop r28 259da: 1f 91 pop r17 259dc: 0f 91 pop r16 259de: 0c 94 0f 6f jmp 0xde1e ; 0xde1e lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 259e2: 8e ef ldi r24, 0xFE ; 254 259e4: 9c e4 ldi r25, 0x4C ; 76 259e6: be ce rjmp .-644 ; 0x25764 000259e8 ::start()>: /** * @brief Start timer */ template void Timer::start() 259e8: cf 93 push r28 259ea: df 93 push r29 259ec: ec 01 movw r28, r24 { m_started = _millis(); 259ee: 0f 94 51 2a call 0x254a2 ; 0x254a2 259f2: 69 83 std Y+1, r22 ; 0x01 259f4: 7a 83 std Y+2, r23 ; 0x02 259f6: 8b 83 std Y+3, r24 ; 0x03 259f8: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 259fa: 81 e0 ldi r24, 0x01 ; 1 259fc: 88 83 st Y, r24 } 259fe: df 91 pop r29 25a00: cf 91 pop r28 25a02: 08 95 ret 00025a04 : //! 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) { 25a04: cf 92 push r12 25a06: df 92 push r13 25a08: ff 92 push r15 25a0a: 0f 93 push r16 25a0c: 1f 93 push r17 25a0e: cf 93 push r28 25a10: df 93 push r29 25a12: cd b7 in r28, 0x3d ; 61 25a14: de b7 in r29, 0x3e ; 62 25a16: 64 97 sbiw r28, 0x14 ; 20 25a18: 0f b6 in r0, 0x3f ; 63 25a1a: f8 94 cli 25a1c: de bf out 0x3e, r29 ; 62 25a1e: 0f be out 0x3f, r0 ; 63 25a20: cd bf out 0x3d, r28 ; 61 25a22: 8c 01 movw r16, r24 25a24: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 25a26: 66 e8 ldi r22, 0x86 ; 134 25a28: 7d e9 ldi r23, 0x9D ; 157 25a2a: ce 01 movw r24, r28 25a2c: 01 96 adiw r24, 0x01 ; 1 25a2e: 0f 94 0b da call 0x3b416 ; 0x3b416 strcat_P(msg, type); 25a32: b8 01 movw r22, r16 25a34: ce 01 movw r24, r28 25a36: 01 96 adiw r24, 0x01 ; 1 25a38: 0f 94 f7 d9 call 0x3b3ee ; 0x3b3ee lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 25a3c: 83 e0 ldi r24, 0x03 ; 3 25a3e: 0e 94 e5 f1 call 0x1e3ca ; 0x1e3ca 25a42: 88 23 and r24, r24 25a44: e1 f0 breq .+56 ; 0x25a7e bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 25a46: be 01 movw r22, r28 25a48: 6f 5f subi r22, 0xFF ; 255 25a4a: 7f 4f sbci r23, 0xFF ; 255 25a4c: 8f e1 ldi r24, 0x1F ; 31 25a4e: 95 e0 ldi r25, 0x05 ; 5 25a50: 0f 94 b6 e2 call 0x3c56c ; 0x3c56c 25a54: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 25a56: 84 e3 ldi r24, 0x34 ; 52 25a58: 95 e0 ldi r25, 0x05 ; 5 25a5a: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> lcd_status_message_level = severity; 25a5e: 83 e0 ldi r24, 0x03 ; 3 25a60: 80 93 d5 03 sts 0x03D5, r24 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.453> custom_message_type = CustomMsg::Status; 25a64: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 custom_message_state = 0; 25a68: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 if (!same) { 25a6c: cd 28 or r12, r13 25a6e: 39 f0 breq .+14 ; 0x25a7e // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 25a70: 60 e0 ldi r22, 0x00 ; 0 25a72: ce 01 movw r24, r28 25a74: 01 96 adiw r24, 0x01 ; 1 25a76: 0e 94 ca f1 call 0x1e394 ; 0x1e394 lcd_return_to_status(); 25a7a: 0f 94 ab 1f call 0x23f56 ; 0x23f56 lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 25a7e: 8a e9 ldi r24, 0x9A ; 154 25a80: 9a ea ldi r25, 0xAA ; 170 25a82: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if(e != EXTRUDERS) { 25a86: 81 e0 ldi r24, 0x01 ; 1 25a88: f8 16 cp r15, r24 25a8a: 49 f0 breq .+18 ; 0x25a9e 25a8c: 60 e0 ldi r22, 0x00 ; 0 25a8e: 70 e0 ldi r23, 0x00 ; 0 25a90: cb 01 movw r24, r22 25a92: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 25a96: 83 e8 ldi r24, 0x83 ; 131 25a98: 9d e9 ldi r25, 0x9D ; 157 25a9a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 } SERIAL_ERRORPGM("Heaters switched off. "); 25a9e: 8c e6 ldi r24, 0x6C ; 108 25aa0: 9d e9 ldi r25, 0x9D ; 157 25aa2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORRPGM(type); 25aa6: c8 01 movw r24, r16 25aa8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORLNPGM(" triggered!"); 25aac: 80 e6 ldi r24, 0x60 ; 96 25aae: 9d e9 ldi r25, 0x9D ; 157 25ab0: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 } 25ab4: 64 96 adiw r28, 0x14 ; 20 25ab6: 0f b6 in r0, 0x3f ; 63 25ab8: f8 94 cli 25aba: de bf out 0x3e, r29 ; 62 25abc: 0f be out 0x3f, r0 ; 63 25abe: cd bf out 0x3d, r28 ; 61 25ac0: df 91 pop r29 25ac2: cf 91 pop r28 25ac4: 1f 91 pop r17 25ac6: 0f 91 pop r16 25ac8: ff 90 pop r15 25aca: df 90 pop r13 25acc: cf 90 pop r12 25ace: 08 95 ret 00025ad0 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 25ad0: 1f 92 push r1 25ad2: 0f 92 push r0 25ad4: 0f b6 in r0, 0x3f ; 63 25ad6: 0f 92 push r0 25ad8: 11 24 eor r1, r1 25ada: 2f 93 push r18 25adc: 3f 93 push r19 25ade: 8f 93 push r24 25ae0: 9f 93 push r25 25ae2: af 93 push r26 25ae4: 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; 25ae6: 80 91 3b 06 lds r24, 0x063B ; 0x80063b 25aea: 90 91 3c 06 lds r25, 0x063C ; 0x80063c 25aee: a0 91 3d 06 lds r26, 0x063D ; 0x80063d 25af2: b0 91 3e 06 lds r27, 0x063E ; 0x80063e unsigned char f = timer2_fract; 25af6: 30 91 3a 06 lds r19, 0x063A ; 0x80063a m += MILLIS_INC; f += FRACT_INC; 25afa: 23 e0 ldi r18, 0x03 ; 3 25afc: 23 0f add r18, r19 if (f >= FRACT_MAX) 25afe: 2d 37 cpi r18, 0x7D ; 125 25b00: 58 f5 brcc .+86 ; 0x25b58 <__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; 25b02: 01 96 adiw r24, 0x01 ; 1 25b04: a1 1d adc r26, r1 25b06: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 25b08: 20 93 3a 06 sts 0x063A, r18 ; 0x80063a timer2_millis = m; 25b0c: 80 93 3b 06 sts 0x063B, r24 ; 0x80063b 25b10: 90 93 3c 06 sts 0x063C, r25 ; 0x80063c 25b14: a0 93 3d 06 sts 0x063D, r26 ; 0x80063d 25b18: b0 93 3e 06 sts 0x063E, r27 ; 0x80063e timer2_overflow_count++; 25b1c: 80 91 3f 06 lds r24, 0x063F ; 0x80063f 25b20: 90 91 40 06 lds r25, 0x0640 ; 0x800640 25b24: a0 91 41 06 lds r26, 0x0641 ; 0x800641 25b28: b0 91 42 06 lds r27, 0x0642 ; 0x800642 25b2c: 01 96 adiw r24, 0x01 ; 1 25b2e: a1 1d adc r26, r1 25b30: b1 1d adc r27, r1 25b32: 80 93 3f 06 sts 0x063F, r24 ; 0x80063f 25b36: 90 93 40 06 sts 0x0640, r25 ; 0x800640 25b3a: a0 93 41 06 sts 0x0641, r26 ; 0x800641 25b3e: b0 93 42 06 sts 0x0642, r27 ; 0x800642 } 25b42: bf 91 pop r27 25b44: af 91 pop r26 25b46: 9f 91 pop r25 25b48: 8f 91 pop r24 25b4a: 3f 91 pop r19 25b4c: 2f 91 pop r18 25b4e: 0f 90 pop r0 25b50: 0f be out 0x3f, r0 ; 63 25b52: 0f 90 pop r0 25b54: 1f 90 pop r1 25b56: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 25b58: 26 e8 ldi r18, 0x86 ; 134 25b5a: 23 0f add r18, r19 m += 1; 25b5c: 02 96 adiw r24, 0x02 ; 2 25b5e: a1 1d adc r26, r1 25b60: b1 1d adc r27, r1 25b62: d2 cf rjmp .-92 ; 0x25b08 <__vector_15+0x38> 00025b64 : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 25b64: 2f 92 push r2 25b66: 3f 92 push r3 25b68: 4f 92 push r4 25b6a: 5f 92 push r5 25b6c: 6f 92 push r6 25b6e: 7f 92 push r7 25b70: 8f 92 push r8 25b72: 9f 92 push r9 25b74: af 92 push r10 25b76: bf 92 push r11 25b78: cf 92 push r12 25b7a: df 92 push r13 25b7c: ef 92 push r14 25b7e: ff 92 push r15 25b80: 0f 93 push r16 25b82: 1f 93 push r17 25b84: cf 93 push r28 25b86: df 93 push r29 25b88: 00 d0 rcall .+0 ; 0x25b8a 25b8a: 00 d0 rcall .+0 ; 0x25b8c 25b8c: 1f 92 push r1 25b8e: cd b7 in r28, 0x3d ; 61 25b90: de b7 in r29, 0x3e ; 62 25b92: 9c 83 std Y+4, r25 ; 0x04 25b94: 8b 83 std Y+3, r24 ; 0x03 25b96: 0d 83 std Y+5, r16 ; 0x05 25b98: 26 01 movw r4, r12 25b9a: 37 01 movw r6, r14 *var = v; 25b9c: fb 01 movw r30, r22 25b9e: 20 83 st Z, r18 25ba0: 31 83 std Z+1, r19 ; 0x01 25ba2: 42 83 std Z+2, r20 ; 0x02 25ba4: 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); 25ba6: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 25baa: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 25bae: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 25bb2: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> 25bb6: 61 e7 ldi r22, 0x71 ; 113 25bb8: 7d e3 ldi r23, 0x3D ; 61 25bba: 8a e8 ldi r24, 0x8A ; 138 25bbc: 9e e3 ldi r25, 0x3E ; 62 25bbe: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 25bc2: 60 93 3d 13 sts 0x133D, r22 ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.402+0x8d> 25bc6: 70 93 3e 13 sts 0x133E, r23 ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.402+0x8e> 25bca: 80 93 3f 13 sts 0x133F, r24 ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.402+0x8f> 25bce: 90 93 40 13 sts 0x1340, r25 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.402+0x90> warn_s = warn * TEMP_MGR_INTV; 25bd2: 21 e7 ldi r18, 0x71 ; 113 25bd4: 3d e3 ldi r19, 0x3D ; 61 25bd6: 4a e8 ldi r20, 0x8A ; 138 25bd8: 5e e3 ldi r21, 0x3E ; 62 25bda: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 25bde: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 25be2: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 25be6: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> 25bea: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 25bee: 60 93 41 13 sts 0x1341, r22 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.402+0x91> 25bf2: 70 93 42 13 sts 0x1342, r23 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.402+0x92> 25bf6: 80 93 43 13 sts 0x1343, r24 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.402+0x93> 25bfa: 90 93 44 13 sts 0x1344, r25 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.402+0x94> err_s = err * TEMP_MGR_INTV; 25bfe: 21 e7 ldi r18, 0x71 ; 113 25c00: 3d e3 ldi r19, 0x3D ; 61 25c02: 4a e8 ldi r20, 0x8A ; 138 25c04: 5e e3 ldi r21, 0x3E ; 62 25c06: 60 91 38 13 lds r22, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.402+0x88> 25c0a: 70 91 39 13 lds r23, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.402+0x89> 25c0e: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.402+0x8a> 25c12: 90 91 3b 13 lds r25, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.402+0x8b> 25c16: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 25c1a: 60 93 45 13 sts 0x1345, r22 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.402+0x95> 25c1e: 70 93 46 13 sts 0x1346, r23 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.402+0x96> 25c22: 80 93 47 13 sts 0x1347, r24 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.402+0x97> 25c26: 90 93 48 13 sts 0x1348, r25 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.402+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 25c2a: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.402+0x3e> 25c2e: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.402+0x3f> 25c32: 6e e0 ldi r22, 0x0E ; 14 25c34: 71 e0 ldi r23, 0x01 ; 1 25c36: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 25c3a: 60 93 d0 12 sts 0x12D0, r22 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x20> 25c3e: e0 eb ldi r30, 0xB0 ; 176 25c40: 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; 25c42: 80 e0 ldi r24, 0x00 ; 0 25c44: 90 e0 ldi r25, 0x00 ; 0 25c46: a0 ec ldi r26, 0xC0 ; 192 25c48: bf e7 ldi r27, 0x7F ; 127 25c4a: 81 93 st Z+, r24 25c4c: 91 93 st Z+, r25 25c4e: a1 93 st Z+, r26 25c50: 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) 25c52: 22 e1 ldi r18, 0x12 ; 18 25c54: e0 3d cpi r30, 0xD0 ; 208 25c56: f2 07 cpc r31, r18 25c58: c1 f7 brne .-16 ; 0x25c4a dT_lag_buf[i] = NAN; dT_lag_idx = 0; 25c5a: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x21> dT_err_prev = 0; 25c5e: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x22> 25c62: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x23> 25c66: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x24> 25c6a: 10 92 d5 12 sts 0x12D5, r1 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x25> T_prev = NAN; 25c6e: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x26> 25c72: 90 93 d7 12 sts 0x12D7, r25 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x27> 25c76: a0 93 d8 12 sts 0x12D8, r26 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x28> 25c7a: b0 93 d9 12 sts 0x12D9, r27 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x29> // clear the initialization flag flag_bits.uninitialized = false; 25c7e: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> 25c82: 8e 7f andi r24, 0xFE ; 254 25c84: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> 25c88: 85 ec ldi r24, 0xC5 ; 197 25c8a: 96 e0 ldi r25, 0x06 ; 6 25c8c: 9f 83 std Y+7, r25 ; 0x07 25c8e: 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) { 25c90: e1 e0 ldi r30, 0x01 ; 1 25c92: f0 e0 ldi r31, 0x00 ; 0 25c94: fa 83 std Y+2, r31 ; 0x02 25c96: 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; 25c98: 31 2c mov r3, r1 25c9a: 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; 25c9c: 81 2c mov r8, r1 25c9e: 91 2c mov r9, r1 25ca0: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 25ca2: 29 81 ldd r18, Y+1 ; 0x01 25ca4: 3a 81 ldd r19, Y+2 ; 0x02 25ca6: 8b 81 ldd r24, Y+3 ; 0x03 25ca8: 9c 81 ldd r25, Y+4 ; 0x04 25caa: 28 17 cp r18, r24 25cac: 39 07 cpc r19, r25 25cae: c8 f5 brcc .+114 ; 0x25d22 thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 25cb0: ee 81 ldd r30, Y+6 ; 0x06 25cb2: ff 81 ldd r31, Y+7 ; 0x07 25cb4: 25 81 ldd r18, Z+5 ; 0x05 25cb6: 36 81 ldd r19, Z+6 ; 0x06 25cb8: 47 81 ldd r20, Z+7 ; 0x07 25cba: 50 85 ldd r21, Z+8 ; 0x08 25cbc: 83 01 movw r16, r6 25cbe: 72 01 movw r14, r4 25cc0: 6d 81 ldd r22, Y+5 ; 0x05 25cc2: 81 85 ldd r24, Z+9 ; 0x09 25cc4: 0e 94 11 e6 call 0x1cc22 ; 0x1cc22 float err_v = thermal_model::data.dT_err_prev; 25cc8: c0 90 d2 12 lds r12, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x22> 25ccc: d0 90 d3 12 lds r13, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x23> 25cd0: e0 90 d4 12 lds r14, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x24> 25cd4: f0 90 d5 12 lds r15, 0x12D5 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x25> if(!isnan(err_v)) { 25cd8: a7 01 movw r20, r14 25cda: 96 01 movw r18, r12 25cdc: c7 01 movw r24, r14 25cde: b6 01 movw r22, r12 25ce0: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 25ce4: 81 11 cpse r24, r1 25ce6: 11 c0 rjmp .+34 ; 0x25d0a err += err_v * err_v; 25ce8: a7 01 movw r20, r14 25cea: 96 01 movw r18, r12 25cec: c7 01 movw r24, r14 25cee: b6 01 movw r22, r12 25cf0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 25cf4: 9b 01 movw r18, r22 25cf6: ac 01 movw r20, r24 25cf8: c5 01 movw r24, r10 25cfa: b4 01 movw r22, r8 25cfc: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 25d00: 4b 01 movw r8, r22 25d02: 5c 01 movw r10, r24 ++cnt; 25d04: ff ef ldi r31, 0xFF ; 255 25d06: 2f 1a sub r2, r31 25d08: 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) { 25d0a: 29 81 ldd r18, Y+1 ; 0x01 25d0c: 3a 81 ldd r19, Y+2 ; 0x02 25d0e: 2f 5f subi r18, 0xFF ; 255 25d10: 3f 4f sbci r19, 0xFF ; 255 25d12: 3a 83 std Y+2, r19 ; 0x02 25d14: 29 83 std Y+1, r18 ; 0x01 25d16: 8e 81 ldd r24, Y+6 ; 0x06 25d18: 9f 81 ldd r25, Y+7 ; 0x07 25d1a: 05 96 adiw r24, 0x05 ; 5 25d1c: 9f 83 std Y+7, r25 ; 0x07 25d1e: 8e 83 std Y+6, r24 ; 0x06 25d20: c0 cf rjmp .-128 ; 0x25ca2 if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 25d22: 60 e0 ldi r22, 0x00 ; 0 25d24: 70 e0 ldi r23, 0x00 ; 0 25d26: 80 ec ldi r24, 0xC0 ; 192 25d28: 9f e7 ldi r25, 0x7F ; 127 25d2a: 21 14 cp r2, r1 25d2c: 31 04 cpc r3, r1 25d2e: 59 f0 breq .+22 ; 0x25d46 25d30: b1 01 movw r22, r2 25d32: 90 e0 ldi r25, 0x00 ; 0 25d34: 80 e0 ldi r24, 0x00 ; 0 25d36: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 25d3a: 9b 01 movw r18, r22 25d3c: ac 01 movw r20, r24 25d3e: c5 01 movw r24, r10 25d40: b4 01 movw r22, r8 25d42: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> } 25d46: 27 96 adiw r28, 0x07 ; 7 25d48: 0f b6 in r0, 0x3f ; 63 25d4a: f8 94 cli 25d4c: de bf out 0x3e, r29 ; 62 25d4e: 0f be out 0x3f, r0 ; 63 25d50: cd bf out 0x3d, r28 ; 61 25d52: df 91 pop r29 25d54: cf 91 pop r28 25d56: 1f 91 pop r17 25d58: 0f 91 pop r16 25d5a: ff 90 pop r15 25d5c: ef 90 pop r14 25d5e: df 90 pop r13 25d60: cf 90 pop r12 25d62: bf 90 pop r11 25d64: af 90 pop r10 25d66: 9f 90 pop r9 25d68: 8f 90 pop r8 25d6a: 7f 90 pop r7 25d6c: 6f 90 pop r6 25d6e: 5f 90 pop r5 25d70: 4f 90 pop r4 25d72: 3f 90 pop r3 25d74: 2f 90 pop r2 25d76: 08 95 ret 00025d78 : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 25d78: cf 93 push r28 25d7a: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 25d7c: 0e 94 61 74 call 0xe8c2 ; 0xe8c2 fanSpeed = fan_speed; 25d80: c0 93 e7 03 sts 0x03E7, r28 ; 0x8003e7 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 25d84: c0 93 a6 04 sts 0x04A6, r28 ; 0x8004a6 #endif } 25d88: cf 91 pop r28 25d8a: 08 95 ret 00025d8c : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 25d8c: cf 92 push r12 25d8e: df 92 push r13 25d90: ef 92 push r14 25d92: ff 92 push r15 25d94: 0f 93 push r16 25d96: 1f 93 push r17 25d98: cf 93 push r28 25d9a: df 93 push r29 SERIAL_ECHO_START; 25d9c: 82 ec ldi r24, 0xC2 ; 194 25d9e: 9a ea ldi r25, 0xAA ; 170 25da0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNPGM("Thermal Model settings:"); 25da4: 8b e2 ldi r24, 0x2B ; 43 25da6: 9e e9 ldi r25, 0x9E ; 158 25da8: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 25dac: c0 ef ldi r28, 0xF0 ; 240 25dae: d2 e1 ldi r29, 0x12 ; 18 25db0: 10 e0 ldi r17, 0x00 ; 0 25db2: 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]); 25db4: 82 ec ldi r24, 0xC2 ; 194 25db6: e8 2e mov r14, r24 25db8: 8a ea ldi r24, 0xAA ; 170 25dba: f8 2e mov r15, r24 25dbc: 97 e1 ldi r25, 0x17 ; 23 25dbe: c9 2e mov r12, r25 25dc0: 9e e9 ldi r25, 0x9E ; 158 25dc2: d9 2e mov r13, r25 25dc4: 88 81 ld r24, Y 25dc6: 99 81 ldd r25, Y+1 ; 0x01 25dc8: 2a 81 ldd r18, Y+2 ; 0x02 25dca: 3b 81 ldd r19, Y+3 ; 0x03 25dcc: 24 96 adiw r28, 0x04 ; 4 25dce: 3f 93 push r19 25dd0: 2f 93 push r18 25dd2: 9f 93 push r25 25dd4: 8f 93 push r24 25dd6: 1f 93 push r17 25dd8: 0f 93 push r16 25dda: ff 92 push r15 25ddc: ef 92 push r14 25dde: df 92 push r13 25de0: cf 92 push r12 25de2: 0f 94 16 db call 0x3b62c ; 0x3b62c 25de6: 0f 5f subi r16, 0xFF ; 255 25de8: 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) 25dea: 8d b7 in r24, 0x3d ; 61 25dec: 9e b7 in r25, 0x3e ; 62 25dee: 0a 96 adiw r24, 0x0a ; 10 25df0: 0f b6 in r0, 0x3f ; 63 25df2: f8 94 cli 25df4: 9e bf out 0x3e, r25 ; 62 25df6: 0f be out 0x3f, r0 ; 63 25df8: 8d bf out 0x3d, r24 ; 61 25dfa: 00 31 cpi r16, 0x10 ; 16 25dfc: 11 05 cpc r17, r1 25dfe: 11 f7 brne .-60 ; 0x25dc4 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"), 25e00: 80 91 33 13 lds r24, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.402+0x83> 25e04: 8f 93 push r24 25e06: 80 91 32 13 lds r24, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.402+0x82> 25e0a: 8f 93 push r24 25e0c: 80 91 31 13 lds r24, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.402+0x81> 25e10: 8f 93 push r24 25e12: 80 91 30 13 lds r24, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.402+0x80> 25e16: 8f 93 push r24 25e18: 80 91 37 13 lds r24, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> 25e1c: 8f 93 push r24 25e1e: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 25e22: 8f 93 push r24 25e24: 80 91 35 13 lds r24, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 25e28: 8f 93 push r24 25e2a: 80 91 34 13 lds r24, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 25e2e: 8f 93 push r24 25e30: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.402+0x8b> 25e34: 8f 93 push r24 25e36: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.402+0x8a> 25e3a: 8f 93 push r24 25e3c: 80 91 39 13 lds r24, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.402+0x89> 25e40: 8f 93 push r24 25e42: 80 91 38 13 lds r24, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.402+0x88> 25e46: 8f 93 push r24 25e48: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.457> 25e4c: 1f 92 push r1 25e4e: 8f 93 push r24 25e50: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> 25e54: 1f 92 push r1 25e56: 8f 93 push r24 25e58: 80 91 ef 12 lds r24, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.402+0x3f> 25e5c: 8f 93 push r24 25e5e: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.402+0x3e> 25e62: 8f 93 push r24 25e64: 80 91 ed 12 lds r24, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.402+0x3d> 25e68: 8f 93 push r24 25e6a: 80 91 ec 12 lds r24, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.402+0x3c> 25e6e: 8f 93 push r24 25e70: 80 91 eb 12 lds r24, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.402+0x3b> 25e74: 8f 93 push r24 25e76: 80 91 ea 12 lds r24, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.402+0x3a> 25e7a: 8f 93 push r24 25e7c: 80 91 e9 12 lds r24, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> 25e80: 8f 93 push r24 25e82: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 25e86: 8f 93 push r24 25e88: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 25e8c: 8f 93 push r24 25e8e: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 25e92: 8f 93 push r24 25e94: 80 91 e5 12 lds r24, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x35> 25e98: 8f 93 push r24 25e9a: 80 91 e4 12 lds r24, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x34> 25e9e: 8f 93 push r24 25ea0: 80 91 e3 12 lds r24, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x33> 25ea4: 8f 93 push r24 25ea6: 80 91 e2 12 lds r24, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x32> 25eaa: 8f 93 push r24 25eac: 80 91 e1 12 lds r24, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x31> 25eb0: 8f 93 push r24 25eb2: 80 91 e0 12 lds r24, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x30> 25eb6: 8f 93 push r24 25eb8: 80 91 df 12 lds r24, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.402+0x2f> 25ebc: 8f 93 push r24 25ebe: 80 91 de 12 lds r24, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.402+0x2e> 25ec2: 8f 93 push r24 25ec4: 80 91 dd 12 lds r24, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.402+0x2d> 25ec8: 8f 93 push r24 25eca: 80 91 dc 12 lds r24, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.402+0x2c> 25ece: 8f 93 push r24 25ed0: 80 91 db 12 lds r24, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.402+0x2b> 25ed4: 8f 93 push r24 25ed6: 80 91 da 12 lds r24, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.402+0x2a> 25eda: 8f 93 push r24 25edc: ff 92 push r15 25ede: ef 92 push r14 25ee0: 81 ed ldi r24, 0xD1 ; 209 25ee2: 9d e9 ldi r25, 0x9D ; 157 25ee4: 9f 93 push r25 25ee6: 8f 93 push r24 25ee8: 0f 94 16 db call 0x3b62c ; 0x3b62c 25eec: 8d b7 in r24, 0x3d ; 61 25eee: 9e b7 in r25, 0x3e ; 62 25ef0: 8a 96 adiw r24, 0x2a ; 42 25ef2: 0f b6 in r0, 0x3f ; 63 25ef4: f8 94 cli 25ef6: 9e bf out 0x3e, r25 ; 62 25ef8: 0f be out 0x3f, r0 ; 63 25efa: 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); } 25efc: df 91 pop r29 25efe: cf 91 pop r28 25f00: 1f 91 pop r17 25f02: 0f 91 pop r16 25f04: ff 90 pop r15 25f06: ef 90 pop r14 25f08: df 90 pop r13 25f0a: cf 90 pop r12 25f0c: 08 95 ret 00025f0e : // 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); 25f0e: 89 57 subi r24, 0x79 ; 121 25f10: 9f 4f sbci r25, 0xFF ; 255 25f12: 6e e0 ldi r22, 0x0E ; 14 25f14: 71 e0 ldi r23, 0x01 ; 1 25f16: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 25f1a: 61 15 cp r22, r1 25f1c: 71 05 cpc r23, r1 25f1e: 99 f0 breq .+38 ; 0x25f46 25f20: 69 30 cpi r22, 0x09 ; 9 25f22: 71 05 cpc r23, r1 25f24: 10 f0 brcs .+4 ; 0x25f2a 25f26: 68 e0 ldi r22, 0x08 ; 8 25f28: 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; 25f2a: 2e e0 ldi r18, 0x0E ; 14 25f2c: 31 e0 ldi r19, 0x01 ; 1 25f2e: 62 9f mul r22, r18 25f30: c0 01 movw r24, r0 25f32: 63 9f mul r22, r19 25f34: 90 0d add r25, r0 25f36: 72 9f mul r23, r18 25f38: 90 0d add r25, r0 25f3a: 11 24 eor r1, r1 25f3c: 90 93 ef 12 sts 0x12EF, r25 ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.402+0x3f> 25f40: 80 93 ee 12 sts 0x12EE, r24 ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.402+0x3e> } 25f44: 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; 25f46: 61 e0 ldi r22, 0x01 ; 1 25f48: 70 e0 ldi r23, 0x00 ; 0 25f4a: ef cf rjmp .-34 ; 0x25f2a 00025f4c : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 25f4c: cf 93 push r28 25f4e: df 93 push r29 if(!(data.P > 0)) return false; 25f50: 20 e0 ldi r18, 0x00 ; 0 25f52: 30 e0 ldi r19, 0x00 ; 0 25f54: a9 01 movw r20, r18 25f56: 60 91 da 12 lds r22, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.402+0x2a> 25f5a: 70 91 db 12 lds r23, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.402+0x2b> 25f5e: 80 91 dc 12 lds r24, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.402+0x2c> 25f62: 90 91 dd 12 lds r25, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.402+0x2d> 25f66: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 25f6a: 18 16 cp r1, r24 25f6c: 0c f0 brlt .+2 ; 0x25f70 25f6e: 54 c0 rjmp .+168 ; 0x26018 if(isnan(data.U)) return false; 25f70: 60 91 de 12 lds r22, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.402+0x2e> 25f74: 70 91 df 12 lds r23, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.402+0x2f> 25f78: 80 91 e0 12 lds r24, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x30> 25f7c: 90 91 e1 12 lds r25, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x31> 25f80: 9b 01 movw r18, r22 25f82: ac 01 movw r20, r24 25f84: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 25f88: 81 11 cpse r24, r1 25f8a: 46 c0 rjmp .+140 ; 0x26018 if(isnan(data.V)) return false; 25f8c: 60 91 e2 12 lds r22, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x32> 25f90: 70 91 e3 12 lds r23, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x33> 25f94: 80 91 e4 12 lds r24, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x34> 25f98: 90 91 e5 12 lds r25, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x35> 25f9c: 9b 01 movw r18, r22 25f9e: ac 01 movw r20, r24 25fa0: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 25fa4: 81 11 cpse r24, r1 25fa6: 38 c0 rjmp .+112 ; 0x26018 if(!(data.C > 0)) return false; 25fa8: 20 e0 ldi r18, 0x00 ; 0 25faa: 30 e0 ldi r19, 0x00 ; 0 25fac: a9 01 movw r20, r18 25fae: 60 91 e6 12 lds r22, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 25fb2: 70 91 e7 12 lds r23, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 25fb6: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 25fba: 90 91 e9 12 lds r25, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> 25fbe: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 25fc2: 18 16 cp r1, r24 25fc4: 4c f5 brge .+82 ; 0x26018 if(isnan(data.fS)) return false; 25fc6: 60 91 ea 12 lds r22, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.402+0x3a> 25fca: 70 91 eb 12 lds r23, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.402+0x3b> 25fce: 80 91 ec 12 lds r24, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.402+0x3c> 25fd2: 90 91 ed 12 lds r25, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.402+0x3d> 25fd6: 9b 01 movw r18, r22 25fd8: ac 01 movw r20, r24 25fda: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 25fde: 81 11 cpse r24, r1 25fe0: 1b c0 rjmp .+54 ; 0x26018 if(!(data.L > 0)) return false; 25fe2: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.402+0x3e> 25fe6: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.402+0x3f> 25fea: 89 2b or r24, r25 25fec: a9 f0 breq .+42 ; 0x26018 25fee: c0 ef ldi r28, 0xF0 ; 240 25ff0: 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)) 25ff2: 69 91 ld r22, Y+ 25ff4: 79 91 ld r23, Y+ 25ff6: 89 91 ld r24, Y+ 25ff8: 99 91 ld r25, Y+ 25ffa: 20 e0 ldi r18, 0x00 ; 0 25ffc: 30 e0 ldi r19, 0x00 ; 0 25ffe: a9 01 movw r20, r18 26000: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 26004: 87 fd sbrc r24, 7 26006: 08 c0 rjmp .+16 ; 0x26018 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) { 26008: 83 e1 ldi r24, 0x13 ; 19 2600a: c0 33 cpi r28, 0x30 ; 48 2600c: d8 07 cpc r29, r24 2600e: 89 f7 brne .-30 ; 0x25ff2 if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 26010: 81 e0 ldi r24, 0x01 ; 1 } 26012: df 91 pop r29 26014: cf 91 pop r28 26016: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 26018: 80 e0 ldi r24, 0x00 ; 0 2601a: fb cf rjmp .-10 ; 0x26012 0002601c : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 2601c: 0f 94 a6 2f call 0x25f4c ; 0x25f4c 26020: 81 11 cpse r24, r1 26022: 02 c0 rjmp .+4 ; 0x26028 26024: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 26028: 81 e0 ldi r24, 0x01 ; 1 2602a: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> warning_state.assert = false; // explicitly clear assertions 2602e: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26032: 8d 7f andi r24, 0xFD ; 253 26034: 80 93 39 06 sts 0x0639, r24 ; 0x800639 // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; reinitialize(); } 26038: 08 95 ret 0002603a : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 2603a: 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; 2603c: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 26040: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 26044: 10 92 73 06 sts 0x0673, r1 ; 0x800673 26048: 10 92 72 06 sts 0x0672, r1 ; 0x800672 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2604c: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2604e: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 26050: 0f 94 98 14 call 0x22930 ; 0x22930 temp_mgr_pid(); 26054: 0f 94 d5 11 call 0x223aa ; 0x223aa // 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); 26058: 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; 2605a: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2605e: cf bf out 0x3f, r28 ; 63 #endif } } 26060: cf 91 pop r28 26062: 08 95 ret 00026064 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 26064: 0f 94 1d 30 call 0x2603a ; 0x2603a fanSpeed = 0; 26068: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 lcd_return_to_status(); 2606c: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 00026070 : // 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) { 26070: 1f 93 push r17 26072: cf 93 push r28 26074: df 93 push r29 26076: c8 2f mov r28, r24 26078: 16 2f mov r17, r22 2607a: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 2607c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 26080: 80 fd sbrc r24, 0 26082: 18 c0 rjmp .+48 ; 0x260b4 26084: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 26088: 81 11 cpse r24, r1 2608a: 14 c0 rjmp .+40 ; 0x260b4 saved_bed_temperature = target_temperature_bed; 2608c: 80 91 72 06 lds r24, 0x0672 ; 0x800672 26090: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_temperature = target_temperature[index]; 26094: e6 2f mov r30, r22 26096: f0 e0 ldi r31, 0x00 ; 0 26098: ee 0f add r30, r30 2609a: ff 1f adc r31, r31 2609c: ea 54 subi r30, 0x4A ; 74 2609e: f2 4f sbci r31, 0xF2 ; 242 260a0: 80 81 ld r24, Z 260a2: 91 81 ldd r25, Z+1 ; 0x01 260a4: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 260a8: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_fan_speed = fanSpeed; 260ac: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 260b0: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 260b4: 0f 94 1d 30 call 0x2603a ; 0x2603a void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 260b8: 0e 94 61 74 call 0xe8c2 ; 0xe8c2 setExtruderAutoFanState(3); 260bc: 83 e0 ldi r24, 0x03 ; 3 260be: 0e 94 db 74 call 0xe9b6 ; 0xe9b6 SET_OUTPUT(FAN_PIN); 260c2: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 260c6: 88 60 ori r24, 0x08 ; 8 260c8: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 260cc: 8f ef ldi r24, 0xFF ; 255 260ce: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 260d2: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 260d6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 260da: 80 ff sbrs r24, 0 260dc: 07 c0 rjmp .+14 ; 0x260ec 260de: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 260e2: 82 95 swap r24 260e4: 86 95 lsr r24 260e6: 87 70 andi r24, 0x07 ; 7 260e8: d8 17 cp r29, r24 260ea: c0 f4 brcc .+48 ; 0x2611c temp_error_state.source = (uint8_t)source; 260ec: c3 70 andi r28, 0x03 ; 3 260ee: cc 0f add r28, r28 260f0: cc 0f add r28, r28 260f2: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 260f6: 83 7f andi r24, 0xF3 ; 243 260f8: 8c 2b or r24, r28 260fa: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.456> temp_error_state.index = index; 260fe: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 26102: 10 fb bst r17, 0 26104: 84 f9 bld r24, 4 26106: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.456> temp_error_state.type = (uint8_t)type; 2610a: d2 95 swap r29 2610c: dd 0f add r29, r29 2610e: d0 7e andi r29, 0xE0 ; 224 26110: 40 91 1b 05 lds r20, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 26114: 4f 71 andi r20, 0x1F ; 31 26116: 4d 2b or r20, r29 26118: 40 93 1b 05 sts 0x051B, r20 ; 0x80051b <_ZL16temp_error_state.lto_priv.456> } // always set the error state temp_error_state.error = true; 2611c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 26120: 81 60 ori r24, 0x01 ; 1 26122: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.456> temp_error_state.assert = true; 26126: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 2612a: 82 60 ori r24, 0x02 ; 2 2612c: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.456> } 26130: df 91 pop r29 26132: cf 91 pop r28 26134: 1f 91 pop r17 26136: 08 95 ret 00026138 : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 26138: 20 91 09 06 lds r18, 0x0609 ; 0x800609 2613c: 30 91 0a 06 lds r19, 0x060A ; 0x80060a 26140: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.473> 26144: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.473+0x1> 26148: 28 17 cp r18, r24 2614a: 39 07 cpc r19, r25 2614c: 2c f0 brlt .+10 ; 0x26158 #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 2614e: 41 e0 ldi r20, 0x01 ; 1 26150: 60 e0 ldi r22, 0x00 ; 0 26152: 81 e0 ldi r24, 0x01 ; 1 26154: 0d 94 38 30 jmp 0x26070 ; 0x26070 } } 26158: 08 95 ret 0002615a : 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]) { 2615a: 20 91 0b 06 lds r18, 0x060B ; 0x80060b 2615e: 30 91 0c 06 lds r19, 0x060C ; 0x80060c 26162: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.474> 26166: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.474+0x1> 2616a: 28 17 cp r18, r24 2616c: 39 07 cpc r19, r25 2616e: 2c f0 brlt .+10 ; 0x2617a #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 26170: 41 e0 ldi r20, 0x01 ; 1 26172: 60 e0 ldi r22, 0x00 ; 0 26174: 80 e0 ldi r24, 0x00 ; 0 26176: 0d 94 38 30 jmp 0x26070 ; 0x26070 } } 2617a: 08 95 ret 0002617c : 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) { 2617c: 2f 92 push r2 2617e: 3f 92 push r3 26180: 4f 92 push r4 26182: 5f 92 push r5 26184: 6f 92 push r6 26186: 7f 92 push r7 26188: 8f 92 push r8 2618a: 9f 92 push r9 2618c: af 92 push r10 2618e: bf 92 push r11 26190: cf 92 push r12 26192: df 92 push r13 26194: ef 92 push r14 26196: ff 92 push r15 26198: 0f 93 push r16 2619a: 1f 93 push r17 2619c: cf 93 push r28 2619e: df 93 push r29 261a0: cd b7 in r28, 0x3d ; 61 261a2: de b7 in r29, 0x3e ; 62 261a4: 2c 97 sbiw r28, 0x0c ; 12 261a6: 0f b6 in r0, 0x3f ; 63 261a8: f8 94 cli 261aa: de bf out 0x3e, r29 ; 62 261ac: 0f be out 0x3f, r0 ; 63 261ae: cd bf out 0x3d, r28 ; 61 261b0: 28 2e mov r2, r24 261b2: 49 83 std Y+1, r20 ; 0x01 261b4: 5a 83 std Y+2, r21 ; 0x02 261b6: 6b 83 std Y+3, r22 ; 0x03 261b8: 7c 83 std Y+4, r23 ; 0x04 261ba: 28 01 movw r4, r16 261bc: 39 01 movw r6, r18 261be: 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) 261c0: 0f 94 51 2a call 0x254a2 ; 0x254a2 261c4: 02 2d mov r16, r2 261c6: 10 e0 ldi r17, 0x00 ; 0 261c8: 98 01 movw r18, r16 261ca: 22 0f add r18, r18 261cc: 33 1f adc r19, r19 261ce: 22 0f add r18, r18 261d0: 33 1f adc r19, r19 261d2: 3c 87 std Y+12, r19 ; 0x0c 261d4: 2b 87 std Y+11, r18 ; 0x0b 261d6: f9 01 movw r30, r18 261d8: e7 53 subi r30, 0x37 ; 55 261da: fa 4f sbci r31, 0xFA ; 250 261dc: 80 80 ld r8, Z 261de: 91 80 ldd r9, Z+1 ; 0x01 261e0: a2 80 ldd r10, Z+2 ; 0x02 261e2: b3 80 ldd r11, Z+3 ; 0x03 261e4: 68 19 sub r22, r8 261e6: 79 09 sbc r23, r9 261e8: 8a 09 sbc r24, r10 261ea: 9b 09 sbc r25, r11 261ec: 61 3d cpi r22, 0xD1 ; 209 261ee: 77 40 sbci r23, 0x07 ; 7 261f0: 81 05 cpc r24, r1 261f2: 91 05 cpc r25, r1 261f4: 08 f4 brcc .+2 ; 0x261f8 261f6: ea c0 rjmp .+468 ; 0x263cc { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 261f8: 33 20 and r3, r3 261fa: 09 f4 brne .+2 ; 0x261fe 261fc: 75 c0 rjmp .+234 ; 0x262e8 { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 261fe: 88 e6 ldi r24, 0x68 ; 104 26200: 91 e0 ldi r25, 0x01 ; 1 26202: 9a 87 std Y+10, r25 ; 0x0a 26204: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 26206: 80 e0 ldi r24, 0x00 ; 0 26208: 90 e0 ldi r25, 0x00 ; 0 2620a: a0 ea ldi r26, 0xA0 ; 160 2620c: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 2620e: 8d 83 std Y+5, r24 ; 0x05 26210: 9e 83 std Y+6, r25 ; 0x06 26212: af 83 std Y+7, r26 ; 0x07 26214: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 26216: 0f 94 51 2a call 0x254a2 ; 0x254a2 2621a: eb 85 ldd r30, Y+11 ; 0x0b 2621c: fc 85 ldd r31, Y+12 ; 0x0c 2621e: e7 53 subi r30, 0x37 ; 55 26220: fa 4f sbci r31, 0xFA ; 250 26222: 60 83 st Z, r22 26224: 71 83 std Z+1, r23 ; 0x01 26226: 82 83 std Z+2, r24 ; 0x02 26228: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 2622a: 20 e0 ldi r18, 0x00 ; 0 2622c: 30 e0 ldi r19, 0x00 ; 0 2622e: a9 01 movw r20, r18 26230: c7 01 movw r24, r14 26232: b6 01 movw r22, r12 26234: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 26238: 81 11 cpse r24, r1 2623a: 07 c0 rjmp .+14 ; 0x2624a { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 2623c: f8 01 movw r30, r16 2623e: ee 0f add r30, r30 26240: ff 1f adc r31, r31 26242: eb 53 subi r30, 0x3B ; 59 26244: fa 4f sbci r31, 0xFA ; 250 26246: 11 82 std Z+1, r1 ; 0x01 26248: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 2624a: ab 85 ldd r26, Y+11 ; 0x0b 2624c: bc 85 ldd r27, Y+12 ; 0x0c 2624e: a3 54 subi r26, 0x43 ; 67 26250: ba 4f sbci r27, 0xFA ; 250 26252: 5d 01 movw r10, r26 26254: 29 81 ldd r18, Y+1 ; 0x01 26256: 3a 81 ldd r19, Y+2 ; 0x02 26258: 4b 81 ldd r20, Y+3 ; 0x03 2625a: 5c 81 ldd r21, Y+4 ; 0x04 2625c: 6d 91 ld r22, X+ 2625e: 7d 91 ld r23, X+ 26260: 8d 91 ld r24, X+ 26262: 9c 91 ld r25, X 26264: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 26268: 88 23 and r24, r24 2626a: 09 f4 brne .+2 ; 0x2626e 2626c: 91 c0 rjmp .+290 ; 0x26390 { if (_target_temperature > 0) 2626e: 20 e0 ldi r18, 0x00 ; 0 26270: 30 e0 ldi r19, 0x00 ; 0 26272: a9 01 movw r20, r18 26274: 69 81 ldd r22, Y+1 ; 0x01 26276: 7a 81 ldd r23, Y+2 ; 0x02 26278: 8b 81 ldd r24, Y+3 ; 0x03 2627a: 9c 81 ldd r25, Y+4 ; 0x04 2627c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 26280: f8 01 movw r30, r16 26282: e5 54 subi r30, 0x45 ; 69 26284: fa 4f sbci r31, 0xFA ; 250 26286: 18 16 cp r1, r24 26288: c4 f5 brge .+112 ; 0x262fa { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 2628a: 81 e0 ldi r24, 0x01 ; 1 2628c: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 2628e: 89 81 ldd r24, Y+1 ; 0x01 26290: 9a 81 ldd r25, Y+2 ; 0x02 26292: ab 81 ldd r26, Y+3 ; 0x03 26294: bc 81 ldd r27, Y+4 ; 0x04 26296: f5 01 movw r30, r10 26298: 80 83 st Z, r24 2629a: 91 83 std Z+1, r25 ; 0x01 2629c: a2 83 std Z+2, r26 ; 0x02 2629e: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 262a0: eb 85 ldd r30, Y+11 ; 0x0b 262a2: fc 85 ldd r31, Y+12 ; 0x0c 262a4: ed 54 subi r30, 0x4D ; 77 262a6: fa 4f sbci r31, 0xFA ; 250 262a8: 40 82 st Z, r4 262aa: 51 82 std Z+1, r5 ; 0x01 262ac: 62 82 std Z+2, r6 ; 0x02 262ae: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 262b0: f8 01 movw r30, r16 262b2: ef 54 subi r30, 0x4F ; 79 262b4: fa 4f sbci r31, 0xFA ; 250 262b6: 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)) 262b8: a3 01 movw r20, r6 262ba: 92 01 movw r18, r4 262bc: bc 01 movw r22, r24 262be: cd 01 movw r24, r26 262c0: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 262c4: 18 16 cp r1, r24 262c6: 1c f5 brge .+70 ; 0x2630e { __preheat_counter[_heater_id]++; 262c8: f8 01 movw r30, r16 262ca: ef 54 subi r30, 0x4F ; 79 262cc: fa 4f sbci r31, 0xFA ; 250 262ce: 80 81 ld r24, Z 262d0: 8f 5f subi r24, 0xFF ; 255 262d2: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 262d4: 31 10 cpse r3, r1 262d6: c7 c0 rjmp .+398 ; 0x26466 262d8: 89 30 cpi r24, 0x09 ; 9 262da: c8 f0 brcs .+50 ; 0x2630e { __delta=2.0; 262dc: 81 2c mov r8, r1 262de: 91 2c mov r9, r1 262e0: a1 2c mov r10, r1 262e2: 50 e4 ldi r21, 0x40 ; 64 262e4: b5 2e mov r11, r21 262e6: e8 c0 rjmp .+464 ; 0x264b8 #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 262e8: ad e2 ldi r26, 0x2D ; 45 262ea: b0 e0 ldi r27, 0x00 ; 0 262ec: ba 87 std Y+10, r27 ; 0x0a 262ee: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 262f0: 80 e0 ldi r24, 0x00 ; 0 262f2: 90 e0 ldi r25, 0x00 ; 0 262f4: a0 e7 ldi r26, 0x70 ; 112 262f6: b1 e4 ldi r27, 0x41 ; 65 262f8: 8a cf rjmp .-236 ; 0x2620e __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 262fa: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 262fc: 89 81 ldd r24, Y+1 ; 0x01 262fe: 9a 81 ldd r25, Y+2 ; 0x02 26300: ab 81 ldd r26, Y+3 ; 0x03 26302: bc 81 ldd r27, Y+4 ; 0x04 26304: f5 01 movw r30, r10 26306: 80 83 st Z, r24 26308: 91 83 std Z+1, r25 ; 0x01 2630a: a2 83 std Z+2, r26 ; 0x02 2630c: 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) 2630e: 2d 81 ldd r18, Y+5 ; 0x05 26310: 3e 81 ldd r19, Y+6 ; 0x06 26312: 4f 81 ldd r20, Y+7 ; 0x07 26314: 58 85 ldd r21, Y+8 ; 0x08 26316: 69 81 ldd r22, Y+1 ; 0x01 26318: 7a 81 ldd r23, Y+2 ; 0x02 2631a: 8b 81 ldd r24, Y+3 ; 0x03 2631c: 9c 81 ldd r25, Y+4 ; 0x04 2631e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 26322: a3 01 movw r20, r6 26324: 92 01 movw r18, r4 26326: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2632a: 87 ff sbrs r24, 7 2632c: 46 c0 rjmp .+140 ; 0x263ba 2632e: f8 01 movw r30, r16 26330: e5 54 subi r30, 0x45 ; 69 26332: fa 4f sbci r31, 0xFA ; 250 26334: 80 81 ld r24, Z 26336: 81 30 cpi r24, 0x01 ; 1 26338: 49 f4 brne .+18 ; 0x2634c { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 2633a: 82 e0 ldi r24, 0x02 ; 2 2633c: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 2633e: f8 01 movw r30, r16 26340: ee 0f add r30, r30 26342: ff 1f adc r31, r31 26344: eb 53 subi r30, 0x3B ; 59 26346: fa 4f sbci r31, 0xFA ; 250 26348: 11 82 std Z+1, r1 ; 0x01 2634a: 10 82 st Z, r1 } if (_output > 0) 2634c: 20 e0 ldi r18, 0x00 ; 0 2634e: 30 e0 ldi r19, 0x00 ; 0 26350: a9 01 movw r20, r18 26352: c7 01 movw r24, r14 26354: b6 01 movw r22, r12 26356: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2635a: 18 16 cp r1, r24 2635c: bc f5 brge .+110 ; 0x263cc if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 2635e: 29 81 ldd r18, Y+1 ; 0x01 26360: 3a 81 ldd r19, Y+2 ; 0x02 26362: 4b 81 ldd r20, Y+3 ; 0x03 26364: 5c 81 ldd r21, Y+4 ; 0x04 26366: 6d 81 ldd r22, Y+5 ; 0x05 26368: 7e 81 ldd r23, Y+6 ; 0x06 2636a: 8f 81 ldd r24, Y+7 ; 0x07 2636c: 98 85 ldd r25, Y+8 ; 0x08 2636e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 26372: a3 01 movw r20, r6 26374: 92 01 movw r18, r4 26376: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2637a: 18 16 cp r1, r24 2637c: 0c f0 brlt .+2 ; 0x26380 2637e: 3f c0 rjmp .+126 ; 0x263fe { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 26380: 00 0f add r16, r16 26382: 11 1f adc r17, r17 26384: f8 01 movw r30, r16 26386: eb 53 subi r30, 0x3B ; 59 26388: fa 4f sbci r31, 0xFA ; 250 2638a: 11 82 std Z+1, r1 ; 0x01 2638c: 10 82 st Z, r1 2638e: 1e c0 rjmp .+60 ; 0x263cc 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)) 26390: a3 01 movw r20, r6 26392: 92 01 movw r18, r4 26394: 69 81 ldd r22, Y+1 ; 0x01 26396: 7a 81 ldd r23, Y+2 ; 0x02 26398: 8b 81 ldd r24, Y+3 ; 0x03 2639a: 9c 81 ldd r25, Y+4 ; 0x04 2639c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 263a0: 18 16 cp r1, r24 263a2: 0c f0 brlt .+2 ; 0x263a6 263a4: b4 cf rjmp .-152 ; 0x2630e 263a6: f8 01 movw r30, r16 263a8: e5 54 subi r30, 0x45 ; 69 263aa: fa 4f sbci r31, 0xFA ; 250 263ac: 80 81 ld r24, Z 263ae: 81 30 cpi r24, 0x01 ; 1 263b0: 09 f0 breq .+2 ; 0x263b4 263b2: ad cf rjmp .-166 ; 0x2630e 263b4: 89 cf rjmp .-238 ; 0x262c8 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; 263b6: 10 82 st Z, r1 263b8: 97 c0 rjmp .+302 ; 0x264e8 temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 263ba: 20 e0 ldi r18, 0x00 ; 0 263bc: 30 e0 ldi r19, 0x00 ; 0 263be: a9 01 movw r20, r18 263c0: c7 01 movw r24, r14 263c2: b6 01 movw r22, r12 263c4: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 263c8: 18 16 cp r1, r24 263ca: cc f0 brlt .+50 ; 0x263fe } } } } } 263cc: 2c 96 adiw r28, 0x0c ; 12 263ce: 0f b6 in r0, 0x3f ; 63 263d0: f8 94 cli 263d2: de bf out 0x3e, r29 ; 62 263d4: 0f be out 0x3f, r0 ; 63 263d6: cd bf out 0x3d, r28 ; 61 263d8: df 91 pop r29 263da: cf 91 pop r28 263dc: 1f 91 pop r17 263de: 0f 91 pop r16 263e0: ff 90 pop r15 263e2: ef 90 pop r14 263e4: df 90 pop r13 263e6: cf 90 pop r12 263e8: bf 90 pop r11 263ea: af 90 pop r10 263ec: 9f 90 pop r9 263ee: 8f 90 pop r8 263f0: 7f 90 pop r7 263f2: 6f 90 pop r6 263f4: 5f 90 pop r5 263f6: 4f 90 pop r4 263f8: 3f 90 pop r3 263fa: 2f 90 pop r2 263fc: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 263fe: f8 01 movw r30, r16 26400: e5 54 subi r30, 0x45 ; 69 26402: fa 4f sbci r31, 0xFA ; 250 26404: 80 81 ld r24, Z 26406: 82 30 cpi r24, 0x02 ; 2 26408: 08 f3 brcs .-62 ; 0x263cc { temp_runaway_error_counter[_heater_id]++; 2640a: 00 0f add r16, r16 2640c: 11 1f adc r17, r17 2640e: f8 01 movw r30, r16 26410: eb 53 subi r30, 0x3B ; 59 26412: fa 4f sbci r31, 0xFA ; 250 26414: 80 81 ld r24, Z 26416: 91 81 ldd r25, Z+1 ; 0x01 26418: 01 96 adiw r24, 0x01 ; 1 2641a: 91 83 std Z+1, r25 ; 0x01 2641c: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 2641e: 88 0f add r24, r24 26420: 99 1f adc r25, r25 26422: e9 85 ldd r30, Y+9 ; 0x09 26424: fa 85 ldd r31, Y+10 ; 0x0a 26426: e8 17 cp r30, r24 26428: f9 07 cpc r31, r25 2642a: 80 f6 brcc .-96 ; 0x263cc set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 2642c: 43 e0 ldi r20, 0x03 ; 3 2642e: 62 2d mov r22, r2 26430: 83 2d mov r24, r3 } } } } } 26432: 2c 96 adiw r28, 0x0c ; 12 26434: 0f b6 in r0, 0x3f ; 63 26436: f8 94 cli 26438: de bf out 0x3e, r29 ; 62 2643a: 0f be out 0x3f, r0 ; 63 2643c: cd bf out 0x3d, r28 ; 61 2643e: df 91 pop r29 26440: cf 91 pop r28 26442: 1f 91 pop r17 26444: 0f 91 pop r16 26446: ff 90 pop r15 26448: ef 90 pop r14 2644a: df 90 pop r13 2644c: cf 90 pop r12 2644e: bf 90 pop r11 26450: af 90 pop r10 26452: 9f 90 pop r9 26454: 8f 90 pop r8 26456: 7f 90 pop r7 26458: 6f 90 pop r6 2645a: 5f 90 pop r5 2645c: 4f 90 pop r4 2645e: 3f 90 pop r3 26460: 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); 26462: 0d 94 38 30 jmp 0x26070 ; 0x26070 } 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 26466: 81 31 cpi r24, 0x11 ; 17 26468: 08 f4 brcc .+2 ; 0x2646c 2646a: 51 cf rjmp .-350 ; 0x2630e { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 2646c: 20 e0 ldi r18, 0x00 ; 0 2646e: 30 e0 ldi r19, 0x00 ; 0 26470: 44 eb ldi r20, 0xB4 ; 180 26472: 52 e4 ldi r21, 0x42 ; 66 26474: c3 01 movw r24, r6 26476: b2 01 movw r22, r4 26478: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 2647c: 81 2c mov r8, r1 2647e: 91 2c mov r9, r1 26480: e0 e4 ldi r30, 0x40 ; 64 26482: ae 2e mov r10, r30 26484: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 26486: 18 16 cp r1, r24 26488: 2c f4 brge .+10 ; 0x26494 2648a: 81 2c mov r8, r1 2648c: 91 2c mov r9, r1 2648e: a1 2c mov r10, r1 26490: 70 e4 ldi r23, 0x40 ; 64 26492: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 26494: 20 e0 ldi r18, 0x00 ; 0 26496: 30 e0 ldi r19, 0x00 ; 0 26498: 42 ed ldi r20, 0xD2 ; 210 2649a: 52 e4 ldi r21, 0x42 ; 66 2649c: c3 01 movw r24, r6 2649e: b2 01 movw r22, r4 264a0: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 264a4: 18 16 cp r1, r24 264a6: 44 f4 brge .+16 ; 0x264b8 264a8: 6a e9 ldi r22, 0x9A ; 154 264aa: 86 2e mov r8, r22 264ac: 69 e9 ldi r22, 0x99 ; 153 264ae: 96 2e mov r9, r22 264b0: 69 e1 ldi r22, 0x19 ; 25 264b2: a6 2e mov r10, r22 264b4: 6f e3 ldi r22, 0x3F ; 63 264b6: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 264b8: eb 85 ldd r30, Y+11 ; 0x0b 264ba: fc 85 ldd r31, Y+12 ; 0x0c 264bc: ed 54 subi r30, 0x4D ; 77 264be: fa 4f sbci r31, 0xFA ; 250 264c0: 20 81 ld r18, Z 264c2: 31 81 ldd r19, Z+1 ; 0x01 264c4: 42 81 ldd r20, Z+2 ; 0x02 264c6: 53 81 ldd r21, Z+3 ; 0x03 264c8: c3 01 movw r24, r6 264ca: b2 01 movw r22, r4 264cc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 264d0: a5 01 movw r20, r10 264d2: 94 01 movw r18, r8 264d4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 264d8: f8 01 movw r30, r16 264da: e1 55 subi r30, 0x51 ; 81 264dc: fa 4f sbci r31, 0xFA ; 250 264de: 87 ff sbrs r24, 7 264e0: 6a cf rjmp .-300 ; 0x263b6 __preheat_errors[_heater_id]++; 264e2: 80 81 ld r24, Z 264e4: 8f 5f subi r24, 0xFF ; 255 264e6: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 264e8: 80 81 ld r24, Z 264ea: 90 e0 ldi r25, 0x00 ; 0 264ec: 31 10 cpse r3, r1 264ee: 04 c0 rjmp .+8 ; 0x264f8 264f0: 06 97 sbiw r24, 0x06 ; 6 264f2: 4c f0 brlt .+18 ; 0x26506 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 264f4: 80 e0 ldi r24, 0x00 ; 0 264f6: 03 c0 rjmp .+6 ; 0x264fe __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 264f8: 04 97 sbiw r24, 0x04 ; 4 264fa: 2c f0 brlt .+10 ; 0x26506 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 264fc: 81 e0 ldi r24, 0x01 ; 1 264fe: 42 e0 ldi r20, 0x02 ; 2 26500: 62 2d mov r22, r2 26502: 0f 94 38 30 call 0x26070 ; 0x26070 __preheat_start[_heater_id] = _current_temperature; 26506: 2b 85 ldd r18, Y+11 ; 0x0b 26508: 3c 85 ldd r19, Y+12 ; 0x0c 2650a: 2d 54 subi r18, 0x4D ; 77 2650c: 3a 4f sbci r19, 0xFA ; 250 2650e: d9 01 movw r26, r18 26510: 4d 92 st X+, r4 26512: 5d 92 st X+, r5 26514: 6d 92 st X+, r6 26516: 7c 92 st X, r7 26518: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 2651a: f8 01 movw r30, r16 2651c: ef 54 subi r30, 0x4F ; 79 2651e: fa 4f sbci r31, 0xFA ; 250 26520: 10 82 st Z, r1 26522: f5 ce rjmp .-534 ; 0x2630e 00026524 : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 26524: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 26526: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 26528: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 2652a: 80 81 ld r24, Z 2652c: 88 23 and r24, r24 2652e: 29 f0 breq .+10 ; 0x2653a 26530: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 26534: 82 60 ori r24, 0x02 ; 2 26536: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2653a: 9f bf out 0x3f, r25 ; 63 } } 2653c: 08 95 ret 0002653e : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 2653e: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 26540: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 26542: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 26544: e3 e7 ldi r30, 0x73 ; 115 26546: f0 e0 ldi r31, 0x00 ; 0 26548: 90 81 ld r25, Z 2654a: 96 95 lsr r25 2654c: 91 70 andi r25, 0x01 ; 1 2654e: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 26550: 80 81 ld r24, Z 26552: 8d 7f andi r24, 0xFD ; 253 26554: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 26556: 2f bf out 0x3f, r18 ; 63 } } 26558: 08 95 ret 0002655a : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 2655a: cf 93 push r28 2655c: df 93 push r29 2655e: 1f 92 push r1 26560: cd b7 in r28, 0x3d ; 61 26562: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 26564: ce 01 movw r24, r28 26566: 01 96 adiw r24, 0x01 ; 1 26568: 0f 94 9f 32 call 0x2653e ; 0x2653e thermal_model::data.P = THERMAL_MODEL_DEF(P); 2656c: 80 e0 ldi r24, 0x00 ; 0 2656e: 90 e0 ldi r25, 0x00 ; 0 26570: a0 e2 ldi r26, 0x20 ; 32 26572: b2 e4 ldi r27, 0x42 ; 66 26574: 80 93 da 12 sts 0x12DA, r24 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.402+0x2a> 26578: 90 93 db 12 sts 0x12DB, r25 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.402+0x2b> 2657c: a0 93 dc 12 sts 0x12DC, r26 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.402+0x2c> 26580: b0 93 dd 12 sts 0x12DD, r27 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.402+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 26584: 84 e3 ldi r24, 0x34 ; 52 26586: 90 e8 ldi r25, 0x80 ; 128 26588: a7 eb ldi r26, 0xB7 ; 183 2658a: ba eb ldi r27, 0xBA ; 186 2658c: 80 93 de 12 sts 0x12DE, r24 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.402+0x2e> 26590: 90 93 df 12 sts 0x12DF, r25 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.402+0x2f> 26594: a0 93 e0 12 sts 0x12E0, r26 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x30> 26598: b0 93 e1 12 sts 0x12E1, r27 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 2659c: 86 e6 ldi r24, 0x66 ; 102 2659e: 96 e6 ldi r25, 0x66 ; 102 265a0: a6 e8 ldi r26, 0x86 ; 134 265a2: bf e3 ldi r27, 0x3F ; 63 265a4: 80 93 e2 12 sts 0x12E2, r24 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x32> 265a8: 90 93 e3 12 sts 0x12E3, r25 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x33> 265ac: a0 93 e4 12 sts 0x12E4, r26 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x34> 265b0: b0 93 e5 12 sts 0x12E5, r27 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 265b4: 8c ee ldi r24, 0xEC ; 236 265b6: 91 e5 ldi r25, 0x51 ; 81 265b8: ac e0 ldi r26, 0x0C ; 12 265ba: b1 e4 ldi r27, 0x41 ; 65 265bc: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 265c0: 90 93 e7 12 sts 0x12E7, r25 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 265c4: a0 93 e8 12 sts 0x12E8, r26 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 265c8: b0 93 e9 12 sts 0x12E9, r27 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 265cc: 8a e9 ldi r24, 0x9A ; 154 265ce: 99 e9 ldi r25, 0x99 ; 153 265d0: a9 e1 ldi r26, 0x19 ; 25 265d2: be e3 ldi r27, 0x3E ; 62 265d4: 80 93 ea 12 sts 0x12EA, r24 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.402+0x3a> 265d8: 90 93 eb 12 sts 0x12EB, r25 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.402+0x3b> 265dc: a0 93 ec 12 sts 0x12EC, r26 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.402+0x3c> 265e0: b0 93 ed 12 sts 0x12ED, r27 ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.402+0x3d> thermal_model::data.L = (uint16_t)(THERMAL_MODEL_DEF(LAG) / (TEMP_MGR_INTV * 1000) + 0.5) * (uint16_t)(TEMP_MGR_INTV * 1000); 265e4: 8e e0 ldi r24, 0x0E ; 14 265e6: 91 e0 ldi r25, 0x01 ; 1 265e8: 90 93 ef 12 sts 0x12EF, r25 ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.402+0x3f> 265ec: 80 93 ee 12 sts 0x12EE, r24 ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.402+0x3e> 265f0: 83 e4 ldi r24, 0x43 ; 67 265f2: 9e e9 ldi r25, 0x9E ; 158 265f4: a0 ef ldi r26, 0xF0 ; 240 265f6: 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); 265f8: fc 01 movw r30, r24 265fa: 45 91 lpm r20, Z+ 265fc: 55 91 lpm r21, Z+ 265fe: 65 91 lpm r22, Z+ 26600: 74 91 lpm r23, Z 26602: 4d 93 st X+, r20 26604: 5d 93 st X+, r21 26606: 6d 93 st X+, r22 26608: 7d 93 st X+, r23 2660a: 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) 2660c: 23 e1 ldi r18, 0x13 ; 19 2660e: a0 33 cpi r26, 0x30 ; 48 26610: b2 07 cpc r27, r18 26612: 91 f7 brne .-28 ; 0x265f8 thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 26614: 80 e0 ldi r24, 0x00 ; 0 26616: 90 e0 ldi r25, 0x00 ; 0 26618: a0 ee ldi r26, 0xE0 ; 224 2661a: b0 ec ldi r27, 0xC0 ; 192 2661c: 80 93 30 13 sts 0x1330, r24 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.402+0x80> 26620: 90 93 31 13 sts 0x1331, r25 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.402+0x81> 26624: a0 93 32 13 sts 0x1332, r26 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.402+0x82> 26628: b0 93 33 13 sts 0x1333, r27 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.402+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 2662c: 8a e9 ldi r24, 0x9A ; 154 2662e: 99 e9 ldi r25, 0x99 ; 153 26630: a9 e5 ldi r26, 0x59 ; 89 26632: bf e3 ldi r27, 0x3F ; 63 26634: 80 93 34 13 sts 0x1334, r24 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 26638: 90 93 35 13 sts 0x1335, r25 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 2663c: a0 93 36 13 sts 0x1336, r26 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 26640: b0 93 37 13 sts 0x1337, r27 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 26644: 84 ea ldi r24, 0xA4 ; 164 26646: 90 e7 ldi r25, 0x70 ; 112 26648: ad e9 ldi r26, 0x9D ; 157 2664a: bf e3 ldi r27, 0x3F ; 63 2664c: 80 93 38 13 sts 0x1338, r24 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.402+0x88> 26650: 90 93 39 13 sts 0x1339, r25 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.402+0x89> 26654: a0 93 3a 13 sts 0x133A, r26 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.402+0x8a> 26658: b0 93 3b 13 sts 0x133B, r27 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.402+0x8b> thermal_model::warn_beep = true; 2665c: 81 e0 ldi r24, 0x01 ; 1 2665e: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.457> thermal_model::enabled = true; 26662: 80 93 1d 05 sts 0x051D, r24 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 26666: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> warning_state.assert = false; // explicitly clear assertions 2666a: 80 91 39 06 lds r24, 0x0639 ; 0x800639 2666e: 8d 7f andi r24, 0xFD ; 253 26670: 80 93 39 06 sts 0x0639, r24 ; 0x800639 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 26674: ce 01 movw r24, r28 26676: 01 96 adiw r24, 0x01 ; 1 26678: 0f 94 92 32 call 0x26524 ; 0x26524 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(); } 2667c: 0f 90 pop r0 2667e: df 91 pop r29 26680: cf 91 pop r28 26682: 08 95 ret 00026684 : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 26684: 1f 93 push r17 26686: cf 93 push r28 26688: df 93 push r29 2668a: 1f 92 push r1 2668c: cd b7 in r28, 0x3d ; 61 2668e: de b7 in r29, 0x3e ; 62 26690: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 26692: ce 01 movw r24, r28 26694: 01 96 adiw r24, 0x01 ; 1 26696: 0f 94 9f 32 call 0x2653e ; 0x2653e thermal_model::enabled = enabled; 2669a: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> thermal_model::setup(); 2669e: 0f 94 0e 30 call 0x2601c ; 0x2601c void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 266a2: ce 01 movw r24, r28 266a4: 01 96 adiw r24, 0x01 ; 1 266a6: 0f 94 92 32 call 0x26524 ; 0x26524 thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 266aa: 11 23 and r17, r17 266ac: 41 f0 breq .+16 ; 0x266be 266ae: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> 266b2: 81 11 cpse r24, r1 266b4: 04 c0 rjmp .+8 ; 0x266be SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 266b6: 8b ea ldi r24, 0xAB ; 171 266b8: 9d e9 ldi r25, 0x9D ; 157 266ba: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 } 266be: 0f 90 pop r0 266c0: df 91 pop r29 266c2: cf 91 pop r28 266c4: 1f 91 pop r17 266c6: 08 95 ret 000266c8 : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 266c8: 1f 93 push r17 266ca: cf 93 push r28 266cc: df 93 push r29 266ce: 1f 92 push r1 266d0: cd b7 in r28, 0x3d ; 61 266d2: de b7 in r29, 0x3e ; 62 266d4: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 266d6: ce 01 movw r24, r28 266d8: 01 96 adiw r24, 0x01 ; 1 266da: 0f 94 9f 32 call 0x2653e ; 0x2653e thermal_model::enabled = enabled; 266de: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 266e2: 81 e0 ldi r24, 0x01 ; 1 266e4: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> warning_state.assert = false; // explicitly clear assertions 266e8: e9 e3 ldi r30, 0x39 ; 57 266ea: f6 e0 ldi r31, 0x06 ; 6 266ec: 80 81 ld r24, Z 266ee: 8d 7f andi r24, 0xFD ; 253 266f0: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 266f2: ce 01 movw r24, r28 266f4: 01 96 adiw r24, 0x01 ; 1 266f6: 0f 94 92 32 call 0x26524 ; 0x26524 thermal_model::enabled = enabled; thermal_model::reinitialize(); } 266fa: 0f 90 pop r0 266fc: df 91 pop r29 266fe: cf 91 pop r28 26700: 1f 91 pop r17 26702: 08 95 ret 00026704 : /* 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() { 26704: cf 93 push r28 26706: df 93 push r29 26708: 1f 92 push r1 2670a: cd b7 in r28, 0x3d ; 61 2670c: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 2670e: ce 01 movw r24, r28 26710: 01 96 adiw r24, 0x01 ; 1 26712: 0f 94 9f 32 call 0x2653e ; 0x2653e } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 2671a: 90 91 18 05 lds r25, 0x0518 ; 0x800518 2671e: a0 91 19 05 lds r26, 0x0519 ; 0x800519 26722: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 26726: 80 93 b0 0d sts 0x0DB0, r24 ; 0x800db0 2672a: 90 93 b1 0d sts 0x0DB1, r25 ; 0x800db1 2672e: a0 93 b2 0d sts 0x0DB2, r26 ; 0x800db2 26732: b0 93 b3 0d sts 0x0DB3, r27 ; 0x800db3 current_temperature_bed = current_temperature_bed_isr; 26736: 80 91 19 06 lds r24, 0x0619 ; 0x800619 2673a: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 2673e: a0 91 1b 06 lds r26, 0x061B ; 0x80061b 26742: b0 91 1c 06 lds r27, 0x061C ; 0x80061c 26746: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee 2674a: 90 93 ef 04 sts 0x04EF, r25 ; 0x8004ef 2674e: a0 93 f0 04 sts 0x04F0, r26 ; 0x8004f0 26752: b0 93 f1 04 sts 0x04F1, r27 ; 0x8004f1 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 26756: 80 91 03 06 lds r24, 0x0603 ; 0x800603 2675a: 90 91 04 06 lds r25, 0x0604 ; 0x800604 2675e: a0 91 05 06 lds r26, 0x0605 ; 0x800605 26762: b0 91 06 06 lds r27, 0x0606 ; 0x800606 26766: 80 93 99 03 sts 0x0399, r24 ; 0x800399 2676a: 90 93 9a 03 sts 0x039A, r25 ; 0x80039a 2676e: a0 93 9b 03 sts 0x039B, r26 ; 0x80039b 26772: b0 93 9c 03 sts 0x039C, r27 ; 0x80039c #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 26776: 80 91 20 06 lds r24, 0x0620 ; 0x800620 2677a: 90 91 21 06 lds r25, 0x0621 ; 0x800621 2677e: a0 91 22 06 lds r26, 0x0622 ; 0x800622 26782: b0 91 23 06 lds r27, 0x0623 ; 0x800623 26786: 80 93 56 06 sts 0x0656, r24 ; 0x800656 2678a: 90 93 57 06 sts 0x0657, r25 ; 0x800657 2678e: a0 93 58 06 sts 0x0658, r26 ; 0x800658 26792: b0 93 59 06 sts 0x0659, r27 ; 0x800659 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 26796: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 2679a: 81 11 cpse r24, r1 2679c: 02 c0 rjmp .+4 ; 0x267a2 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 2679e: 0f 94 98 14 call 0x22930 ; 0x22930 } temp_meas_ready = false; 267a2: 10 92 02 06 sts 0x0602, r1 ; 0x800602 - 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; 267a6: ce 01 movw r24, r28 267a8: 01 96 adiw r24, 0x01 ; 1 267aa: 0f 94 92 32 call 0x26524 ; 0x26524 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 267ae: 0f 90 pop r0 267b0: df 91 pop r29 267b2: cf 91 pop r28 267b4: 08 95 ret 000267b6 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 267b6: 1f 92 push r1 267b8: 0f 92 push r0 267ba: 0f b6 in r0, 0x3f ; 63 267bc: 0f 92 push r0 267be: 11 24 eor r1, r1 267c0: 0b b6 in r0, 0x3b ; 59 267c2: 0f 92 push r0 267c4: ff 92 push r15 267c6: 0f 93 push r16 267c8: 1f 93 push r17 267ca: 2f 93 push r18 267cc: 3f 93 push r19 267ce: 4f 93 push r20 267d0: 5f 93 push r21 267d2: 6f 93 push r22 267d4: 7f 93 push r23 267d6: 8f 93 push r24 267d8: 9f 93 push r25 267da: af 93 push r26 267dc: bf 93 push r27 267de: cf 93 push r28 267e0: df 93 push r29 267e2: ef 93 push r30 267e4: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 267e6: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 267ea: 8b 7f andi r24, 0xFB ; 251 267ec: 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(); 267f0: 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) 267f2: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 267f6: 86 fd sbrc r24, 6 267f8: c8 c0 rjmp .+400 ; 0x2698a <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 267fa: 68 ec ldi r22, 0xC8 ; 200 267fc: 70 e0 ldi r23, 0x00 ; 0 267fe: 8f ed ldi r24, 0xDF ; 223 26800: 95 e0 ldi r25, 0x05 ; 5 26802: 0f 94 ab 2a call 0x25556 ; 0x25556 ::expired_cont(unsigned short)> 26806: 88 23 and r24, r24 26808: b9 f0 breq .+46 ; 0x26838 <__vector_14+0x82> buttonBlanking.start(); 2680a: 8f ed ldi r24, 0xDF ; 223 2680c: 95 e0 ldi r25, 0x05 ; 5 2680e: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> safetyTimer.start(); 26812: 8a ed ldi r24, 0xDA ; 218 26814: 95 e0 ldi r25, 0x05 ; 5 26816: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 2681a: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 2681e: 81 11 cpse r24, r1 26820: a5 c0 rjmp .+330 ; 0x2696c <__vector_14+0x1b6> 26822: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 26826: 81 11 cpse r24, r1 26828: a1 c0 rjmp .+322 ; 0x2696c <__vector_14+0x1b6> { longPressTimer.start(); 2682a: 85 ed ldi r24, 0xD5 ; 213 2682c: 95 e0 ldi r25, 0x05 ; 5 2682e: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> lcd_button_pressed = 1; 26832: 81 e0 ldi r24, 0x01 ; 1 26834: 80 93 d9 05 sts 0x05D9, r24 ; 0x8005d9 -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 26838: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2683c: 82 fb bst r24, 2 2683e: 88 27 eor r24, r24 26840: 80 f9 bld r24, 0 26842: 91 e0 ldi r25, 0x01 ; 1 26844: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 26846: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2684a: 91 ff sbrs r25, 1 2684c: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 2684e: e0 91 d2 05 lds r30, 0x05D2 ; 0x8005d2 26852: e8 17 cp r30, r24 26854: e1 f0 breq .+56 ; 0x2688e <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 26856: 24 e0 ldi r18, 0x04 ; 4 26858: e2 9f mul r30, r18 2685a: f0 01 movw r30, r0 2685c: 11 24 eor r1, r1 2685e: e8 2b or r30, r24 26860: e4 57 subi r30, 0x74 ; 116 26862: f2 46 sbci r31, 0x62 ; 98 26864: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 26866: 90 91 d1 05 lds r25, 0x05D1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.541> 2686a: e9 0f add r30, r25 2686c: e0 93 d1 05 sts 0x05D1, r30 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.541> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 26870: 0e 2e mov r0, r30 26872: 00 0c add r0, r0 26874: ff 0b sbc r31, r31 26876: f7 ff sbrs r31, 7 26878: 03 c0 rjmp .+6 ; 0x26880 <__vector_14+0xca> 2687a: f1 95 neg r31 2687c: e1 95 neg r30 2687e: f1 09 sbc r31, r1 26880: 34 97 sbiw r30, 0x04 ; 4 26882: 1c f0 brlt .+6 ; 0x2688a <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 26884: 91 e0 ldi r25, 0x01 ; 1 26886: 90 93 d3 05 sts 0x05D3, r25 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.540> } enc_bits_old = enc_bits; 2688a: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 2688e: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 26892: 81 11 cpse r24, r1 26894: 08 c0 rjmp .+16 ; 0x268a6 <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 26896: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 2689a: 80 93 e8 05 sts 0x05E8, r24 ; 0x8005e8 if(soft_pwm_0 > 0) 2689e: 88 23 and r24, r24 268a0: 09 f4 brne .+2 ; 0x268a4 <__vector_14+0xee> 268a2: 87 c0 rjmp .+270 ; 0x269b2 <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 268a4: 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) 268a6: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 268aa: 8f 70 andi r24, 0x0F ; 15 268ac: a9 f4 brne .+42 ; 0x268d8 <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 268ae: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 268b2: 90 e0 ldi r25, 0x00 ; 0 268b4: 24 e0 ldi r18, 0x04 ; 4 268b6: 95 95 asr r25 268b8: 87 95 ror r24 268ba: 2a 95 dec r18 268bc: e1 f7 brne .-8 ; 0x268b6 <__vector_14+0x100> 268be: 80 93 a5 04 sts 0x04A5, r24 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.462> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 268c2: 89 2b or r24, r25 268c4: 09 f4 brne .+2 ; 0x268c8 <__vector_14+0x112> 268c6: 77 c0 rjmp .+238 ; 0x269b6 <__vector_14+0x200> 268c8: 9f b7 in r25, 0x3f ; 63 268ca: f8 94 cli 268cc: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 268d0: 88 60 ori r24, 0x08 ; 8 268d2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 268d6: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 268d8: 90 91 e8 05 lds r25, 0x05E8 ; 0x8005e8 268dc: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 268e0: 98 17 cp r25, r24 268e2: 08 f4 brcc .+2 ; 0x268e6 <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 268e4: 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); 268e6: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 268ea: 8f 70 andi r24, 0x0F ; 15 268ec: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.462> 268f0: 98 17 cp r25, r24 268f2: 40 f4 brcc .+16 ; 0x26904 <__vector_14+0x14e> 268f4: 9f b7 in r25, 0x3f ; 63 268f6: f8 94 cli 268f8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 268fc: 87 7f andi r24, 0xF7 ; 247 268fe: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26902: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 26904: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 26908: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 2690a: 8f 77 andi r24, 0x7F ; 127 2690c: 80 93 a4 02 sts 0x02A4, r24 ; 0x8002a4 26910: 10 e0 ldi r17, 0x00 ; 0 26912: 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 26914: e8 01 movw r28, r16 26916: cc 0f add r28, r28 26918: dd 1f adc r29, r29 2691a: c7 59 subi r28, 0x97 ; 151 2691c: d9 4f sbci r29, 0xF9 ; 249 2691e: 88 81 ld r24, Y 26920: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 26922: 18 16 cp r1, r24 26924: 19 06 cpc r1, r25 26926: 0c f0 brlt .+2 ; 0x2692a <__vector_14+0x174> 26928: 4c c0 rjmp .+152 ; 0x269c2 <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2692a: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2692c: f8 94 cli babystep(axis,/*fwd*/true); 2692e: 61 e0 ldi r22, 0x01 ; 1 26930: 80 2f mov r24, r16 26932: 0f 94 a9 14 call 0x22952 ; 0x22952 babystepsTodo[axis]--; //less to do next time 26936: 88 81 ld r24, Y 26938: 99 81 ldd r25, Y+1 ; 0x01 2693a: 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 2693c: 99 83 std Y+1, r25 ; 0x01 2693e: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 26940: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 26942: 0f 5f subi r16, 0xFF ; 255 26944: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 26946: 03 30 cpi r16, 0x03 ; 3 26948: 11 05 cpc r17, r1 2694a: 21 f7 brne .-56 ; 0x26914 <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 2694c: 80 91 40 18 lds r24, 0x1840 ; 0x801840 <__bss_end+0x20> 26950: 90 91 41 18 lds r25, 0x1841 ; 0x801841 <__bss_end+0x21> 26954: a0 91 42 18 lds r26, 0x1842 ; 0x801842 <__bss_end+0x22> 26958: b0 91 43 18 lds r27, 0x1843 ; 0x801843 <__bss_end+0x23> 2695c: 82 3a cpi r24, 0xA2 ; 162 2695e: 92 4a sbci r25, 0xA2 ; 162 26960: a1 05 cpc r26, r1 26962: b1 05 cpc r27, r1 26964: d9 f1 breq .+118 ; 0x269dc <__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); 26966: 81 e0 ldi r24, 0x01 ; 1 26968: 0e 94 d8 66 call 0xcdb0 ; 0xcdb0 if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 2696c: 68 ee ldi r22, 0xE8 ; 232 2696e: 73 e0 ldi r23, 0x03 ; 3 26970: 85 ed ldi r24, 0xD5 ; 213 26972: 95 e0 ldi r25, 0x05 ; 5 26974: 0f 94 83 2a call 0x25506 ; 0x25506 ::expired(unsigned short)> 26978: 88 23 and r24, r24 2697a: 09 f4 brne .+2 ; 0x2697e <__vector_14+0x1c8> 2697c: 5d cf rjmp .-326 ; 0x26838 <__vector_14+0x82> { lcd_long_press_active = 1; 2697e: 81 e0 ldi r24, 0x01 ; 1 26980: 80 93 d8 05 sts 0x05D8, r24 ; 0x8005d8 lcd_longpress_trigger = 1; 26984: 80 93 d4 05 sts 0x05D4, r24 ; 0x8005d4 26988: 57 cf rjmp .-338 ; 0x26838 <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 2698a: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 2698e: 88 23 and r24, r24 26990: 09 f4 brne .+2 ; 0x26994 <__vector_14+0x1de> 26992: 52 cf rjmp .-348 ; 0x26838 <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 26994: 10 92 d9 05 sts 0x05D9, r1 ; 0x8005d9 if (!lcd_long_press_active) 26998: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 2699c: 81 11 cpse r24, r1 2699e: 03 c0 rjmp .+6 ; 0x269a6 <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 269a0: 81 e0 ldi r24, 0x01 ; 1 269a2: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 269a6: 81 e0 ldi r24, 0x01 ; 1 269a8: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.540> lcd_long_press_active = 0; 269ac: 10 92 d8 05 sts 0x05D8, r1 ; 0x8005d8 269b0: 43 cf rjmp .-378 ; 0x26838 <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 269b2: 75 98 cbi 0x0e, 5 ; 14 269b4: 78 cf rjmp .-272 ; 0x268a6 <__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); 269b6: 9f b7 in r25, 0x3f ; 63 269b8: f8 94 cli 269ba: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 269be: 87 7f andi r24, 0xF7 ; 247 269c0: 88 cf rjmp .-240 ; 0x268d2 <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 269c2: 89 2b or r24, r25 269c4: 09 f4 brne .+2 ; 0x269c8 <__vector_14+0x212> 269c6: bd cf rjmp .-134 ; 0x26942 <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 269c8: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 269ca: f8 94 cli babystep(axis,/*fwd*/false); 269cc: 60 e0 ldi r22, 0x00 ; 0 269ce: 80 2f mov r24, r16 269d0: 0f 94 a9 14 call 0x22952 ; 0x22952 babystepsTodo[axis]++; //less to do next time 269d4: 88 81 ld r24, Y 269d6: 99 81 ldd r25, Y+1 ; 0x01 269d8: 01 96 adiw r24, 0x01 ; 1 269da: b0 cf rjmp .-160 ; 0x2693c <__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]) { 269dc: 9c b1 in r25, 0x0c ; 12 269de: 80 91 e6 05 lds r24, 0x05E6 ; 0x8005e6 269e2: 96 fb bst r25, 6 269e4: 99 27 eor r25, r25 269e6: 90 f9 bld r25, 0 269e8: 98 17 cp r25, r24 269ea: 91 f0 breq .+36 ; 0x26a10 <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 269ec: 90 91 6f 06 lds r25, 0x066F ; 0x80066f 269f0: 99 23 and r25, r25 269f2: 51 f0 breq .+20 ; 0x26a08 <__vector_14+0x252> 269f4: 20 91 e2 05 lds r18, 0x05E2 ; 0x8005e2 269f8: 30 91 e3 05 lds r19, 0x05E3 ; 0x8005e3 269fc: 2f 5f subi r18, 0xFF ; 255 269fe: 3f 4f sbci r19, 0xFF ; 255 26a00: 30 93 e3 05 sts 0x05E3, r19 ; 0x8005e3 26a04: 20 93 e2 05 sts 0x05E2, r18 ; 0x8005e2 fan_state[0] = !fan_state[0]; 26a08: 91 e0 ldi r25, 0x01 ; 1 26a0a: 89 27 eor r24, r25 26a0c: 80 93 e6 05 sts 0x05E6, r24 ; 0x8005e6 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 26a10: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 26a12: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 26a16: 84 60 ori r24, 0x04 ; 4 26a18: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 26a1c: ff 91 pop r31 26a1e: ef 91 pop r30 26a20: df 91 pop r29 26a22: cf 91 pop r28 26a24: bf 91 pop r27 26a26: af 91 pop r26 26a28: 9f 91 pop r25 26a2a: 8f 91 pop r24 26a2c: 7f 91 pop r23 26a2e: 6f 91 pop r22 26a30: 5f 91 pop r21 26a32: 4f 91 pop r20 26a34: 3f 91 pop r19 26a36: 2f 91 pop r18 26a38: 1f 91 pop r17 26a3a: 0f 91 pop r16 26a3c: ff 90 pop r15 26a3e: 0f 90 pop r0 26a40: 0b be out 0x3b, r0 ; 59 26a42: 0f 90 pop r0 26a44: 0f be out 0x3f, r0 ; 63 26a46: 0f 90 pop r0 26a48: 1f 90 pop r1 26a4a: 18 95 reti 00026a4c : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 26a4c: 4f 92 push r4 26a4e: 5f 92 push r5 26a50: 6f 92 push r6 26a52: 7f 92 push r7 26a54: af 92 push r10 26a56: bf 92 push r11 26a58: cf 92 push r12 26a5a: df 92 push r13 26a5c: ef 92 push r14 26a5e: ff 92 push r15 26a60: 0f 93 push r16 26a62: 1f 93 push r17 26a64: cf 93 push r28 26a66: df 93 push r29 26a68: 24 e0 ldi r18, 0x04 ; 4 26a6a: 30 e0 ldi r19, 0x00 ; 0 26a6c: 41 e0 ldi r20, 0x01 ; 1 26a6e: 50 e0 ldi r21, 0x00 ; 0 26a70: d9 01 movw r26, r18 26a72: a2 5e subi r26, 0xE2 ; 226 26a74: b3 46 sbci r27, 0x63 ; 99 float celsius = 0; byte i; for (i=1; i raw) 26a76: fd 01 movw r30, r26 26a78: 65 91 lpm r22, Z+ 26a7a: 74 91 lpm r23, Z 26a7c: 86 17 cp r24, r22 26a7e: 97 07 cpc r25, r23 26a80: 0c f0 brlt .+2 ; 0x26a84 26a82: 66 c0 rjmp .+204 ; 0x26b50 { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 26a84: 41 50 subi r20, 0x01 ; 1 26a86: 51 09 sbc r21, r1 26a88: 44 0f add r20, r20 26a8a: 55 1f adc r21, r21 26a8c: 44 0f add r20, r20 26a8e: 55 1f adc r21, r21 26a90: ea 01 movw r28, r20 26a92: c0 5e subi r28, 0xE0 ; 224 26a94: d3 46 sbci r29, 0x63 ; 99 26a96: fe 01 movw r30, r28 26a98: 05 91 lpm r16, Z+ 26a9a: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 26a9c: 42 5e subi r20, 0xE2 ; 226 26a9e: 53 46 sbci r21, 0x63 ; 99 26aa0: fa 01 movw r30, r20 26aa2: 65 91 lpm r22, Z+ 26aa4: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 26aa6: f9 01 movw r30, r18 26aa8: e0 5e subi r30, 0xE0 ; 224 26aaa: f3 46 sbci r31, 0x63 ; 99 26aac: e5 90 lpm r14, Z+ 26aae: f4 90 lpm r15, Z 26ab0: fe 01 movw r30, r28 26ab2: c5 90 lpm r12, Z+ 26ab4: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 26ab6: fd 01 movw r30, r26 26ab8: c5 91 lpm r28, Z+ 26aba: d4 91 lpm r29, Z 26abc: fa 01 movw r30, r20 26abe: a5 90 lpm r10, Z+ 26ac0: 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])) * 26ac2: 86 1b sub r24, r22 26ac4: 97 0b sbc r25, r23 26ac6: bc 01 movw r22, r24 26ac8: 99 0f add r25, r25 26aca: 88 0b sbc r24, r24 26acc: 99 0b sbc r25, r25 26ace: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26ad2: 2b 01 movw r4, r22 26ad4: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 26ad6: b7 01 movw r22, r14 26ad8: 6c 19 sub r22, r12 26ada: 7d 09 sbc r23, r13 26adc: 07 2e mov r0, r23 26ade: 00 0c add r0, r0 26ae0: 88 0b sbc r24, r24 26ae2: 99 0b sbc r25, r25 26ae4: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26ae8: 9b 01 movw r18, r22 26aea: 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])) * 26aec: c3 01 movw r24, r6 26aee: b2 01 movw r22, r4 26af0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 26af4: 6b 01 movw r12, r22 26af6: 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])); 26af8: be 01 movw r22, r28 26afa: 6a 19 sub r22, r10 26afc: 7b 09 sbc r23, r11 26afe: 07 2e mov r0, r23 26b00: 00 0c add r0, r0 26b02: 88 0b sbc r24, r24 26b04: 99 0b sbc r25, r25 26b06: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26b0a: 9b 01 movw r18, r22 26b0c: 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])) / 26b0e: c7 01 movw r24, r14 26b10: b6 01 movw r22, r12 26b12: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 26b16: 6b 01 movw r12, r22 26b18: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 26b1a: b8 01 movw r22, r16 26b1c: 11 0f add r17, r17 26b1e: 88 0b sbc r24, r24 26b20: 99 0b sbc r25, r25 26b22: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26b26: 9b 01 movw r18, r22 26b28: ac 01 movw r20, r24 26b2a: c7 01 movw r24, r14 26b2c: b6 01 movw r22, r12 26b2e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 26b32: df 91 pop r29 26b34: cf 91 pop r28 26b36: 1f 91 pop r17 26b38: 0f 91 pop r16 26b3a: ff 90 pop r15 26b3c: ef 90 pop r14 26b3e: df 90 pop r13 26b40: cf 90 pop r12 26b42: bf 90 pop r11 26b44: af 90 pop r10 26b46: 7f 90 pop r7 26b48: 6f 90 pop r6 26b4a: 5f 90 pop r5 26b4c: 4f 90 pop r4 26b4e: 08 95 ret 26b50: 4f 5f subi r20, 0xFF ; 255 26b52: 5f 4f sbci r21, 0xFF ; 255 26b54: 2c 5f subi r18, 0xFC ; 252 26b56: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 26b5e: 88 cf rjmp .-240 ; 0x26a70 (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]); 26b60: e4 ea ldi r30, 0xA4 ; 164 26b62: fc e9 ldi r31, 0x9C ; 156 26b64: 65 91 lpm r22, Z+ 26b66: 74 91 lpm r23, Z 26b68: 07 2e mov r0, r23 26b6a: 00 0c add r0, r0 26b6c: 88 0b sbc r24, r24 26b6e: 99 0b sbc r25, r25 26b70: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26b74: de cf rjmp .-68 ; 0x26b32 00026b76 : 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) { 26b76: 4f 92 push r4 26b78: 5f 92 push r5 26b7a: 6f 92 push r6 26b7c: 7f 92 push r7 26b7e: af 92 push r10 26b80: bf 92 push r11 26b82: cf 92 push r12 26b84: df 92 push r13 26b86: ef 92 push r14 26b88: ff 92 push r15 26b8a: 0f 93 push r16 26b8c: 1f 93 push r17 26b8e: cf 93 push r28 26b90: df 93 push r29 26b92: 24 e0 ldi r18, 0x04 ; 4 26b94: 30 e0 ldi r19, 0x00 ; 0 26b96: 41 e0 ldi r20, 0x01 ; 1 26b98: 50 e0 ldi r21, 0x00 ; 0 26b9a: d9 01 movw r26, r18 26b9c: a6 5d subi r26, 0xD6 ; 214 26b9e: b4 46 sbci r27, 0x64 ; 100 float celsius = 0; byte i; for (i=1; i raw) 26ba0: fd 01 movw r30, r26 26ba2: 65 91 lpm r22, Z+ 26ba4: 74 91 lpm r23, Z 26ba6: 86 17 cp r24, r22 26ba8: 97 07 cpc r25, r23 26baa: 0c f0 brlt .+2 ; 0x26bae 26bac: 80 c0 rjmp .+256 ; 0x26cae { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 26bae: 41 50 subi r20, 0x01 ; 1 26bb0: 51 09 sbc r21, r1 26bb2: 44 0f add r20, r20 26bb4: 55 1f adc r21, r21 26bb6: 44 0f add r20, r20 26bb8: 55 1f adc r21, r21 26bba: 8a 01 movw r16, r20 26bbc: 04 5d subi r16, 0xD4 ; 212 26bbe: 14 46 sbci r17, 0x64 ; 100 26bc0: f8 01 movw r30, r16 26bc2: c5 90 lpm r12, Z+ 26bc4: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 26bc6: 46 5d subi r20, 0xD6 ; 214 26bc8: 54 46 sbci r21, 0x64 ; 100 26bca: fa 01 movw r30, r20 26bcc: 65 91 lpm r22, Z+ 26bce: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 26bd0: f9 01 movw r30, r18 26bd2: e4 5d subi r30, 0xD4 ; 212 26bd4: f4 46 sbci r31, 0x64 ; 100 26bd6: c5 91 lpm r28, Z+ 26bd8: d4 91 lpm r29, Z 26bda: f8 01 movw r30, r16 26bdc: 05 91 lpm r16, Z+ 26bde: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 26be0: fd 01 movw r30, r26 26be2: e5 90 lpm r14, Z+ 26be4: f4 90 lpm r15, Z 26be6: fa 01 movw r30, r20 26be8: a5 90 lpm r10, Z+ 26bea: 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])) * 26bec: 86 1b sub r24, r22 26bee: 97 0b sbc r25, r23 26bf0: bc 01 movw r22, r24 26bf2: 99 0f add r25, r25 26bf4: 88 0b sbc r24, r24 26bf6: 99 0b sbc r25, r25 26bf8: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26bfc: 2b 01 movw r4, r22 26bfe: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 26c00: be 01 movw r22, r28 26c02: 60 1b sub r22, r16 26c04: 71 0b sbc r23, r17 26c06: 07 2e mov r0, r23 26c08: 00 0c add r0, r0 26c0a: 88 0b sbc r24, r24 26c0c: 99 0b sbc r25, r25 26c0e: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26c12: 9b 01 movw r18, r22 26c14: 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])) * 26c16: c3 01 movw r24, r6 26c18: b2 01 movw r22, r4 26c1a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 26c1e: 2b 01 movw r4, r22 26c20: 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])); 26c22: b7 01 movw r22, r14 26c24: 6a 19 sub r22, r10 26c26: 7b 09 sbc r23, r11 26c28: 07 2e mov r0, r23 26c2a: 00 0c add r0, r0 26c2c: 88 0b sbc r24, r24 26c2e: 99 0b sbc r25, r25 26c30: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26c34: 9b 01 movw r18, r22 26c36: 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])) / 26c38: c3 01 movw r24, r6 26c3a: b2 01 movw r22, r4 26c3c: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 26c40: 2b 01 movw r4, r22 26c42: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 26c44: b6 01 movw r22, r12 26c46: dd 0c add r13, r13 26c48: 88 0b sbc r24, r24 26c4a: 99 0b sbc r25, r25 26c4c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26c50: 9b 01 movw r18, r22 26c52: ac 01 movw r20, r24 26c54: c3 01 movw r24, r6 26c56: b2 01 movw r22, r4 26c58: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 26c5c: 6b 01 movw r12, r22 26c5e: 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) 26c60: 20 e0 ldi r18, 0x00 ; 0 26c62: 30 e0 ldi r19, 0x00 ; 0 26c64: 40 e2 ldi r20, 0x20 ; 32 26c66: 52 e4 ldi r21, 0x42 ; 66 26c68: c7 01 movw r24, r14 26c6a: b6 01 movw r22, r12 26c6c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 26c70: 87 fd sbrc r24, 7 26c72: 30 c0 rjmp .+96 ; 0x26cd4 26c74: 20 e0 ldi r18, 0x00 ; 0 26c76: 30 e0 ldi r19, 0x00 ; 0 26c78: 48 e4 ldi r20, 0x48 ; 72 26c7a: 52 e4 ldi r21, 0x42 ; 66 26c7c: c7 01 movw r24, r14 26c7e: b6 01 movw r22, r12 26c80: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 26c84: 18 16 cp r1, r24 26c86: 34 f1 brlt .+76 ; 0x26cd4 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 26c88: 20 e0 ldi r18, 0x00 ; 0 26c8a: 30 e0 ldi r19, 0x00 ; 0 26c8c: 40 e2 ldi r20, 0x20 ; 32 26c8e: 52 e4 ldi r21, 0x42 ; 66 26c90: c7 01 movw r24, r14 26c92: b6 01 movw r22, r12 26c94: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 26c98: 20 e0 ldi r18, 0x00 ; 0 26c9a: 30 e0 ldi r19, 0x00 ; 0 26c9c: 40 e0 ldi r20, 0x00 ; 0 26c9e: 5f e3 ldi r21, 0x3F ; 63 26ca0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 26ca4: 9b 01 movw r18, r22 26ca6: 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; 26ca8: c7 01 movw r24, r14 26caa: b6 01 movw r22, r12 26cac: 43 c0 rjmp .+134 ; 0x26d34 26cae: 4f 5f subi r20, 0xFF ; 255 26cb0: 5f 4f sbci r21, 0xFF ; 255 26cb2: 2c 5f subi r18, 0xFC ; 252 26cb4: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 26cbc: 6e cf rjmp .-292 ; 0x26b9a break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 26cbe: ec e1 ldi r30, 0x1C ; 28 26cc0: fc e9 ldi r31, 0x9C ; 156 26cc2: 65 91 lpm r22, Z+ 26cc4: 74 91 lpm r23, Z 26cc6: 07 2e mov r0, r23 26cc8: 00 0c add r0, r0 26cca: 88 0b sbc r24, r24 26ccc: 99 0b sbc r25, r25 26cce: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26cd2: c4 cf rjmp .-120 ; 0x26c5c if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 26cd4: 20 e0 ldi r18, 0x00 ; 0 26cd6: 30 e0 ldi r19, 0x00 ; 0 26cd8: 48 e4 ldi r20, 0x48 ; 72 26cda: 52 e4 ldi r21, 0x42 ; 66 26cdc: c7 01 movw r24, r14 26cde: b6 01 movw r22, r12 26ce0: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 26ce4: 18 16 cp r1, r24 26ce6: dc f5 brge .+118 ; 0x26d5e 26ce8: 20 e0 ldi r18, 0x00 ; 0 26cea: 30 e0 ldi r19, 0x00 ; 0 26cec: 48 ec ldi r20, 0xC8 ; 200 26cee: 52 e4 ldi r21, 0x42 ; 66 26cf0: c7 01 movw r24, r14 26cf2: b6 01 movw r22, r12 26cf4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 26cf8: 18 16 cp r1, r24 26cfa: 8c f1 brlt .+98 ; 0x26d5e { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 26cfc: 20 e0 ldi r18, 0x00 ; 0 26cfe: 30 e0 ldi r19, 0x00 ; 0 26d00: 40 ea ldi r20, 0xA0 ; 160 26d02: 50 e4 ldi r21, 0x40 ; 64 26d04: c7 01 movw r24, r14 26d06: b6 01 movw r22, r12 26d08: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 26d0c: 2b 01 movw r4, r22 26d0e: 3c 01 movw r6, r24 26d10: 20 e0 ldi r18, 0x00 ; 0 26d12: 30 e0 ldi r19, 0x00 ; 0 26d14: 48 e4 ldi r20, 0x48 ; 72 26d16: 52 e4 ldi r21, 0x42 ; 66 26d18: c7 01 movw r24, r14 26d1a: b6 01 movw r22, r12 26d1c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 26d20: 2d ec ldi r18, 0xCD ; 205 26d22: 3c ec ldi r19, 0xCC ; 204 26d24: 4c ec ldi r20, 0xCC ; 204 26d26: 5d e3 ldi r21, 0x3D ; 61 26d28: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 26d2c: 9b 01 movw r18, r22 26d2e: ac 01 movw r20, r24 26d30: c3 01 movw r24, r6 26d32: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 26d34: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 26d38: 6b 01 movw r12, r22 26d3a: 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 } 26d3c: c7 01 movw r24, r14 26d3e: b6 01 movw r22, r12 26d40: df 91 pop r29 26d42: cf 91 pop r28 26d44: 1f 91 pop r17 26d46: 0f 91 pop r16 26d48: ff 90 pop r15 26d4a: ef 90 pop r14 26d4c: df 90 pop r13 26d4e: cf 90 pop r12 26d50: bf 90 pop r11 26d52: af 90 pop r10 26d54: 7f 90 pop r7 26d56: 6f 90 pop r6 26d58: 5f 90 pop r5 26d5a: 4f 90 pop r4 26d5c: 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) 26d5e: 20 e0 ldi r18, 0x00 ; 0 26d60: 30 e0 ldi r19, 0x00 ; 0 26d62: 48 ec ldi r20, 0xC8 ; 200 26d64: 52 e4 ldi r21, 0x42 ; 66 26d66: c7 01 movw r24, r14 26d68: b6 01 movw r22, r12 26d6a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 26d6e: 18 16 cp r1, r24 26d70: 2c f7 brge .-54 ; 0x26d3c { celsius = celsius + _offset; 26d72: 20 e0 ldi r18, 0x00 ; 0 26d74: 30 e0 ldi r19, 0x00 ; 0 26d76: 40 e2 ldi r20, 0x20 ; 32 26d78: 51 e4 ldi r21, 0x41 ; 65 26d7a: 96 cf rjmp .-212 ; 0x26ca8 00026d7c : } static void check_temp_raw(); static void temp_mgr_isr() { 26d7c: 4f 92 push r4 26d7e: 5f 92 push r5 26d80: 6f 92 push r6 26d82: 7f 92 push r7 26d84: af 92 push r10 26d86: cf 92 push r12 26d88: df 92 push r13 26d8a: ef 92 push r14 26d8c: ff 92 push r15 26d8e: 0f 93 push r16 26d90: 1f 93 push r17 26d92: cf 93 push r28 26d94: 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 26d9a: 90 91 0c 06 lds r25, 0x060C ; 0x80060c 26d9e: 0f 94 54 a1 call 0x342a8 ; 0x342a8 26da2: 60 93 17 05 sts 0x0517, r22 ; 0x800517 26da6: 70 93 18 05 sts 0x0518, r23 ; 0x800518 26daa: 80 93 19 05 sts 0x0519, r24 ; 0x800519 26dae: 90 93 1a 05 sts 0x051A, r25 ; 0x80051a current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 26db2: 60 90 09 06 lds r6, 0x0609 ; 0x800609 26db6: 70 90 0a 06 lds r7, 0x060A ; 0x80060a 26dba: c3 01 movw r24, r6 26dbc: 0f 94 bb 35 call 0x26b76 ; 0x26b76 26dc0: 6b 01 movw r12, r22 26dc2: 7c 01 movw r14, r24 26dc4: c0 92 19 06 sts 0x0619, r12 ; 0x800619 26dc8: d0 92 1a 06 sts 0x061A, r13 ; 0x80061a 26dcc: e0 92 1b 06 sts 0x061B, r14 ; 0x80061b 26dd0: f0 92 1c 06 sts 0x061C, r15 ; 0x80061c #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 26dd4: 80 91 07 06 lds r24, 0x0607 ; 0x800607 26dd8: 90 91 08 06 lds r25, 0x0608 ; 0x800608 26ddc: 0f 94 bb 35 call 0x26b76 ; 0x26b76 26de0: 60 93 03 06 sts 0x0603, r22 ; 0x800603 26de4: 70 93 04 06 sts 0x0604, r23 ; 0x800604 26de8: 80 93 05 06 sts 0x0605, r24 ; 0x800605 26dec: 90 93 06 06 sts 0x0606, r25 ; 0x800606 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) 26df0: c0 91 15 06 lds r28, 0x0615 ; 0x800615 26df4: d0 91 16 06 lds r29, 0x0616 ; 0x800616 26df8: ce 01 movw r24, r28 26dfa: 0f 94 26 35 call 0x26a4c ; 0x26a4c 26dfe: 60 93 20 06 sts 0x0620, r22 ; 0x800620 26e02: 70 93 21 06 sts 0x0621, r23 ; 0x800621 26e06: 80 93 22 06 sts 0x0622, r24 ; 0x800622 26e0a: 90 93 23 06 sts 0x0623, r25 ; 0x800623 #endif temp_meas_ready = true; 26e0e: 81 e0 ldi r24, 0x01 ; 1 26e10: 80 93 02 06 sts 0x0602, r24 ; 0x800602 { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 26e14: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 26e18: 8d 7f andi r24, 0xFD ; 253 26e1a: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 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]) { 26e1e: 20 91 0b 06 lds r18, 0x060B ; 0x80060b 26e22: 30 91 0c 06 lds r19, 0x060C ; 0x80060c 26e26: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.465> 26e2a: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.465+0x1> 26e2e: 82 17 cp r24, r18 26e30: 93 07 cpc r25, r19 26e32: 2c f0 brlt .+10 ; 0x26e3e #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 26e34: 40 e0 ldi r20, 0x00 ; 0 26e36: 60 e0 ldi r22, 0x00 ; 0 26e38: 80 e0 ldi r24, 0x00 ; 0 26e3a: 0f 94 38 30 call 0x26070 ; 0x26070 } //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) { 26e3e: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.466> 26e42: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.466+0x1> 26e46: 86 15 cp r24, r6 26e48: 97 05 cpc r25, r7 26e4a: 2c f0 brlt .+10 ; 0x26e56 #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 26e4c: 40 e0 ldi r20, 0x00 ; 0 26e4e: 60 e0 ldi r22, 0x00 ; 0 26e50: 81 e0 ldi r24, 0x01 ; 1 26e52: 0f 94 38 30 call 0x26070 ; 0x26070 } #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) { 26e56: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.467> 26e5a: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.467+0x1> 26e5e: 8c 17 cp r24, r28 26e60: 9d 07 cpc r25, r29 26e62: 2c f0 brlt .+10 ; 0x26e6e #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 26e64: 40 e0 ldi r20, 0x00 ; 0 26e66: 60 e0 ldi r22, 0x00 ; 0 26e68: 82 e0 ldi r24, 0x02 ; 2 26e6a: 0f 94 38 30 call 0x26070 ; 0x26070 #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) { 26e6e: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.464> 26e72: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.464+0x1> 26e76: c8 17 cp r28, r24 26e78: d9 07 cpc r29, r25 26e7a: 2c f0 brlt .+10 ; 0x26e86 #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 26e7c: 41 e0 ldi r20, 0x01 ; 1 26e7e: 60 e0 ldi r22, 0x00 ; 0 26e80: 82 e0 ldi r24, 0x02 ; 2 26e82: 0f 94 38 30 call 0x26070 ; 0x26070 #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 26e86: c1 3a cpi r28, 0xA1 ; 161 26e88: de 43 sbci r29, 0x3E ; 62 26e8a: 0c f4 brge .+2 ; 0x26e8e 26e8c: cd c1 rjmp .+922 ; 0x27228 { // 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]) { 26e8e: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 <_ZL8minttemp.lto_priv.463> 26e92: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 <_ZL8minttemp.lto_priv.463+0x1> 26e96: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 26e9a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 26e9e: 68 17 cp r22, r24 26ea0: 79 07 cpc r23, r25 26ea2: 0c f0 brlt .+2 ; 0x26ea6 26ea4: 55 c0 rjmp .+170 ; 0x26f50 // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 26ea6: c0 91 14 06 lds r28, 0x0614 ; 0x800614 26eaa: c1 11 cpse r28, r1 26eac: 18 c0 rjmp .+48 ; 0x26ede 26eae: 6b 5f subi r22, 0xFB ; 251 26eb0: 7f 4f sbci r23, 0xFF ; 255 26eb2: 07 2e mov r0, r23 26eb4: 00 0c add r0, r0 26eb6: 88 0b sbc r24, r24 26eb8: 99 0b sbc r25, r25 26eba: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26ebe: 9b 01 movw r18, r22 26ec0: ac 01 movw r20, r24 26ec2: c1 e0 ldi r28, 0x01 ; 1 26ec4: 60 91 17 05 lds r22, 0x0517 ; 0x800517 26ec8: 70 91 18 05 lds r23, 0x0518 ; 0x800518 26ecc: 80 91 19 05 lds r24, 0x0519 ; 0x800519 26ed0: 90 91 1a 05 lds r25, 0x051A ; 0x80051a 26ed4: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 26ed8: 18 16 cp r1, r24 26eda: 0c f0 brlt .+2 ; 0x26ede 26edc: c0 e0 ldi r28, 0x00 ; 0 26ede: c0 93 14 06 sts 0x0614, r28 ; 0x800614 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 26ee2: 68 e9 ldi r22, 0x98 ; 152 26ee4: 7a e3 ldi r23, 0x3A ; 58 26ee6: 81 e1 ldi r24, 0x11 ; 17 26ee8: 96 e0 ldi r25, 0x06 ; 6 26eea: 0f 94 ab 2a call 0x25556 ; 0x25556 ::expired_cont(unsigned short)> 26eee: 81 11 cpse r24, r1 26ef0: 02 c0 rjmp .+4 ; 0x26ef6 26ef2: cc 23 and r28, r28 26ef4: 29 f0 breq .+10 ; 0x26f00 bCheckingOnHeater=true; // not necessary 26ef6: 81 e0 ldi r24, 0x01 ; 1 26ef8: 80 93 14 06 sts 0x0614, r24 ; 0x800614 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active 26efc: 0f 94 ad 30 call 0x2615a ; 0x2615a // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 26f00: 80 91 17 06 lds r24, 0x0617 ; 0x800617 26f04: 90 91 18 06 lds r25, 0x0618 ; 0x800618 26f08: 0b 97 sbiw r24, 0x0b ; 11 26f0a: 4c f1 brlt .+82 ; 0x26f5e // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 26f0c: c0 91 10 06 lds r28, 0x0610 ; 0x800610 26f10: c1 11 cpse r28, r1 26f12: 0c c0 rjmp .+24 ; 0x26f2c 26f14: c1 e0 ldi r28, 0x01 ; 1 26f16: 20 e0 ldi r18, 0x00 ; 0 26f18: 30 e0 ldi r19, 0x00 ; 0 26f1a: 40 e7 ldi r20, 0x70 ; 112 26f1c: 51 e4 ldi r21, 0x41 ; 65 26f1e: c7 01 movw r24, r14 26f20: b6 01 movw r22, r12 26f22: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 26f26: 18 16 cp r1, r24 26f28: 0c f0 brlt .+2 ; 0x26f2c 26f2a: c0 e0 ldi r28, 0x00 ; 0 26f2c: c0 93 10 06 sts 0x0610, r28 ; 0x800610 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 26f30: 60 e5 ldi r22, 0x50 ; 80 26f32: 73 ec ldi r23, 0xC3 ; 195 26f34: 8d e0 ldi r24, 0x0D ; 13 26f36: 96 e0 ldi r25, 0x06 ; 6 26f38: 0f 94 ab 2a call 0x25556 ; 0x25556 ::expired_cont(unsigned short)> 26f3c: 81 11 cpse r24, r1 26f3e: 02 c0 rjmp .+4 ; 0x26f44 26f40: cc 23 and r28, r28 26f42: 99 f0 breq .+38 ; 0x26f6a bCheckingOnBed=true; // not necessary 26f44: 81 e0 ldi r24, 0x01 ; 1 26f46: 80 93 10 06 sts 0x0610, r24 ; 0x800610 #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 26f4a: 0f 94 9c 30 call 0x26138 ; 0x26138 26f4e: 0d c0 rjmp .+26 ; 0x26f6a check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 26f50: 81 e1 ldi r24, 0x11 ; 17 26f52: 96 e0 ldi r25, 0x06 ; 6 26f54: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> bCheckingOnHeater=false; 26f58: 10 92 14 06 sts 0x0614, r1 ; 0x800614 26f5c: d1 cf rjmp .-94 ; 0x26f00 check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 26f5e: 8d e0 ldi r24, 0x0D ; 13 26f60: 96 e0 ldi r25, 0x06 ; 6 26f62: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> bCheckingOnBed=false; 26f66: 10 92 10 06 sts 0x0610, r1 ; 0x800610 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); 26f6a: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 26f6e: 70 e0 ldi r23, 0x00 ; 0 26f70: 90 e0 ldi r25, 0x00 ; 0 26f72: 80 e0 ldi r24, 0x00 ; 0 26f74: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 26f78: 6b 01 movw r12, r22 26f7a: 7c 01 movw r14, r24 26f7c: 40 90 17 05 lds r4, 0x0517 ; 0x800517 26f80: 50 90 18 05 lds r5, 0x0518 ; 0x800518 26f84: 60 90 19 05 lds r6, 0x0519 ; 0x800519 26f88: 70 90 1a 05 lds r7, 0x051A ; 0x80051a 26f8c: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 26f90: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 26f94: 07 2e mov r0, r23 26f96: 00 0c add r0, r0 26f98: 88 0b sbc r24, r24 26f9a: 99 0b sbc r25, r25 26f9c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26fa0: ab 01 movw r20, r22 26fa2: bc 01 movw r22, r24 26fa4: a1 2c mov r10, r1 26fa6: 93 01 movw r18, r6 26fa8: 82 01 movw r16, r4 26faa: 81 e0 ldi r24, 0x01 ; 1 26fac: 0f 94 be 30 call 0x2617c ; 0x2617c #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 26fb0: 60 91 1d 06 lds r22, 0x061D ; 0x80061d 26fb4: 70 e0 ldi r23, 0x00 ; 0 26fb6: 90 e0 ldi r25, 0x00 ; 0 26fb8: 80 e0 ldi r24, 0x00 ; 0 26fba: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 26fbe: 6b 01 movw r12, r22 26fc0: 7c 01 movw r14, r24 26fc2: 40 90 19 06 lds r4, 0x0619 ; 0x800619 26fc6: 50 90 1a 06 lds r5, 0x061A ; 0x80061a 26fca: 60 90 1b 06 lds r6, 0x061B ; 0x80061b 26fce: 70 90 1c 06 lds r7, 0x061C ; 0x80061c 26fd2: 60 91 17 06 lds r22, 0x0617 ; 0x800617 26fd6: 70 91 18 06 lds r23, 0x0618 ; 0x800618 26fda: 07 2e mov r0, r23 26fdc: 00 0c add r0, r0 26fde: 88 0b sbc r24, r24 26fe0: 99 0b sbc r25, r25 26fe2: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 26fe6: ab 01 movw r20, r22 26fe8: bc 01 movw r22, r24 26fea: aa 24 eor r10, r10 26fec: a3 94 inc r10 26fee: 93 01 movw r18, r6 26ff0: 82 01 movw r16, r4 26ff2: 80 e0 ldi r24, 0x00 ; 0 26ff4: 0f 94 be 30 call 0x2617c ; 0x2617c return true; } static void check() { if(!enabled) return; 26ff8: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.458> 26ffc: 88 23 and r24, r24 26ffe: 09 f4 brne .+2 ; 0x27002 27000: bc c0 rjmp .+376 ; 0x2717a uint8_t heater_pwm = soft_pwm[0]; 27002: c0 91 16 05 lds r28, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> uint8_t fan_pwm = soft_pwm_fan; 27006: d0 91 a5 04 lds r29, 0x04A5 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.462> float heater_temp = current_temperature_isr[0]; 2700a: 40 90 17 05 lds r4, 0x0517 ; 0x800517 2700e: 50 90 18 05 lds r5, 0x0518 ; 0x800518 27012: 60 90 19 05 lds r6, 0x0519 ; 0x800519 27016: 70 90 1a 05 lds r7, 0x051A ; 0x80051a float ambient_temp = current_temperature_ambient_isr; 2701a: c0 90 20 06 lds r12, 0x0620 ; 0x800620 2701e: d0 90 21 06 lds r13, 0x0621 ; 0x800621 27022: e0 90 22 06 lds r14, 0x0622 ; 0x800622 27026: f0 90 23 06 lds r15, 0x0623 ; 0x800623 // 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) 2702a: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> 2702e: 80 ff sbrs r24, 0 27030: 72 c0 rjmp .+228 ; 0x27116 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); 27032: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x36> 27036: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x37> 2703a: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x38> 2703e: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x39> 27042: 61 e7 ldi r22, 0x71 ; 113 27044: 7d e3 ldi r23, 0x3D ; 61 27046: 8a e8 ldi r24, 0x8A ; 138 27048: 9e e3 ldi r25, 0x3E ; 62 2704a: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 2704e: 60 93 3d 13 sts 0x133D, r22 ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.402+0x8d> 27052: 70 93 3e 13 sts 0x133E, r23 ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.402+0x8e> 27056: 80 93 3f 13 sts 0x133F, r24 ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.402+0x8f> 2705a: 90 93 40 13 sts 0x1340, r25 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.402+0x90> warn_s = warn * TEMP_MGR_INTV; 2705e: 21 e7 ldi r18, 0x71 ; 113 27060: 3d e3 ldi r19, 0x3D ; 61 27062: 4a e8 ldi r20, 0x8A ; 138 27064: 5e e3 ldi r21, 0x3E ; 62 27066: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 2706a: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 2706e: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 27072: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> 27076: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2707a: 60 93 41 13 sts 0x1341, r22 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.402+0x91> 2707e: 70 93 42 13 sts 0x1342, r23 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.402+0x92> 27082: 80 93 43 13 sts 0x1343, r24 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.402+0x93> 27086: 90 93 44 13 sts 0x1344, r25 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.402+0x94> err_s = err * TEMP_MGR_INTV; 2708a: 21 e7 ldi r18, 0x71 ; 113 2708c: 3d e3 ldi r19, 0x3D ; 61 2708e: 4a e8 ldi r20, 0x8A ; 138 27090: 5e e3 ldi r21, 0x3E ; 62 27092: 60 91 38 13 lds r22, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.402+0x88> 27096: 70 91 39 13 lds r23, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.402+0x89> 2709a: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.402+0x8a> 2709e: 90 91 3b 13 lds r25, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.402+0x8b> 270a2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 270a6: 60 93 45 13 sts 0x1345, r22 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.402+0x95> 270aa: 70 93 46 13 sts 0x1346, r23 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.402+0x96> 270ae: 80 93 47 13 sts 0x1347, r24 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.402+0x97> 270b2: 90 93 48 13 sts 0x1348, r25 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.402+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 270b6: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.402+0x3e> 270ba: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.402+0x3f> 270be: 6e e0 ldi r22, 0x0E ; 14 270c0: 71 e0 ldi r23, 0x01 ; 1 270c2: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 270c6: 60 93 d0 12 sts 0x12D0, r22 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.402+0x20> 270ca: e0 eb ldi r30, 0xB0 ; 176 270cc: f2 e1 ldi r31, 0x12 ; 18 270ce: 80 ed ldi r24, 0xD0 ; 208 270d0: 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; 270d2: 40 e0 ldi r20, 0x00 ; 0 270d4: 50 e0 ldi r21, 0x00 ; 0 270d6: 60 ec ldi r22, 0xC0 ; 192 270d8: 7f e7 ldi r23, 0x7F ; 127 270da: 41 93 st Z+, r20 270dc: 51 93 st Z+, r21 270de: 61 93 st Z+, r22 270e0: 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) 270e2: 8e 17 cp r24, r30 270e4: 9f 07 cpc r25, r31 270e6: c9 f7 brne .-14 ; 0x270da dT_lag_buf[i] = NAN; dT_lag_idx = 0; 270e8: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.402+0x21> dT_err_prev = 0; 270ec: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x22> 270f0: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x23> 270f4: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x24> 270f8: 10 92 d5 12 sts 0x12D5, r1 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x25> T_prev = NAN; 270fc: 40 93 d6 12 sts 0x12D6, r20 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.402+0x26> 27100: 50 93 d7 12 sts 0x12D7, r21 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.402+0x27> 27104: 60 93 d8 12 sts 0x12D8, r22 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.402+0x28> 27108: 70 93 d9 12 sts 0x12D9, r23 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.402+0x29> // clear the initialization flag flag_bits.uninitialized = false; 2710c: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> 27110: 8e 7f andi r24, 0xFE ; 254 27112: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+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); 27116: 87 01 movw r16, r14 27118: 76 01 movw r14, r12 2711a: a3 01 movw r20, r6 2711c: 92 01 movw r18, r4 2711e: 6d 2f mov r22, r29 27120: 8c 2f mov r24, r28 27122: 0e 94 11 e6 call 0x1cc22 ; 0x1cc22 // handle errors if(data.flag_bits.error) 27126: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> 2712a: 81 ff sbrs r24, 1 2712c: 05 c0 rjmp .+10 ; 0x27138 set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 2712e: 44 e0 ldi r20, 0x04 ; 4 27130: 60 e0 ldi r22, 0x00 ; 0 27132: 80 e0 ldi r24, 0x00 ; 0 27134: 0f 94 38 30 call 0x26070 ; 0x26070 // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 27138: 90 91 3c 13 lds r25, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.402+0x8c> 2713c: 80 91 39 06 lds r24, 0x0639 ; 0x800639 27140: 92 fb bst r25, 2 27142: 81 f9 bld r24, 1 27144: 80 93 39 06 sts 0x0639, r24 ; 0x800639 if(warning_state.assert) { 27148: 80 91 39 06 lds r24, 0x0639 ; 0x800639 2714c: 81 ff sbrs r24, 1 2714e: 15 c0 rjmp .+42 ; 0x2717a warning_state.warning = true; 27150: 80 91 39 06 lds r24, 0x0639 ; 0x800639 27154: 81 60 ori r24, 0x01 ; 1 27156: 80 93 39 06 sts 0x0639, r24 ; 0x800639 warning_state.dT_err = thermal_model::data.dT_err_prev; 2715a: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.402+0x22> 2715e: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.402+0x23> 27162: a0 91 d4 12 lds r26, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.402+0x24> 27166: b0 91 d5 12 lds r27, 0x12D5 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.402+0x25> 2716a: 80 93 35 06 sts 0x0635, r24 ; 0x800635 2716e: 90 93 36 06 sts 0x0636, r25 ; 0x800636 27172: a0 93 37 06 sts 0x0637, r26 ; 0x800637 27176: b0 93 38 06 sts 0x0638, r27 ; 0x800638 (int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b); } static void log_isr() { if(!log_buf.enabled) return; 2717a: 80 91 34 06 lds r24, 0x0634 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x10> 2717e: 88 23 and r24, r24 27180: 09 f4 brne .+2 ; 0x27184 27182: 3f c0 rjmp .+126 ; 0x27202 uint32_t stamp = _millis(); 27184: 0f 94 51 2a call 0x254a2 ; 0x254a2 uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 27188: c0 90 24 06 lds r12, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.539> 2718c: d0 90 25 06 lds r13, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x1> 27190: e0 90 26 06 lds r14, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x2> 27194: f0 90 27 06 lds r15, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x3> log_buf.entry.stamp = stamp; 27198: 60 93 24 06 sts 0x0624, r22 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.539> 2719c: 70 93 25 06 sts 0x0625, r23 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x1> 271a0: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x2> 271a4: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x3> ++log_buf.entry.counter; 271a8: 20 91 29 06 lds r18, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x5> 271ac: 2f 5f subi r18, 0xFF ; 255 271ae: 20 93 29 06 sts 0x0629, r18 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.539+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); 271b2: 6c 19 sub r22, r12 271b4: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 271b6: 60 93 28 06 sts 0x0628, r22 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 271ba: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 271be: 80 93 2a 06 sts 0x062A, r24 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 271c2: 80 91 17 05 lds r24, 0x0517 ; 0x800517 271c6: 90 91 18 05 lds r25, 0x0518 ; 0x800518 271ca: a0 91 19 05 lds r26, 0x0519 ; 0x800519 271ce: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 271d2: 80 93 2b 06 sts 0x062B, r24 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x7> 271d6: 90 93 2c 06 sts 0x062C, r25 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x8> 271da: a0 93 2d 06 sts 0x062D, r26 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x9> 271de: b0 93 2e 06 sts 0x062E, r27 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 271e2: 80 91 20 06 lds r24, 0x0620 ; 0x800620 271e6: 90 91 21 06 lds r25, 0x0621 ; 0x800621 271ea: a0 91 22 06 lds r26, 0x0622 ; 0x800622 271ee: b0 91 23 06 lds r27, 0x0623 ; 0x800623 271f2: 80 93 2f 06 sts 0x062F, r24 ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xb> 271f6: 90 93 30 06 sts 0x0630, r25 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xc> 271fa: a0 93 31 06 sts 0x0631, r26 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xd> 271fe: b0 93 32 06 sts 0x0632, r27 ; 0x800632 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xe> thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 27202: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.460> 27206: 88 23 and r24, r24 27208: 91 f0 breq .+36 ; 0x2722e temp_mgr_pid(); } 2720a: df 91 pop r29 2720c: cf 91 pop r28 2720e: 1f 91 pop r17 27210: 0f 91 pop r16 27212: ff 90 pop r15 27214: ef 90 pop r14 27216: df 90 pop r13 27218: cf 90 pop r12 2721a: af 90 pop r10 2721c: 7f 90 pop r7 2721e: 6f 90 pop r6 27220: 5f 90 pop r5 27222: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 27224: 0d 94 d5 11 jmp 0x223aa ; 0x223aa // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 27228: 0f 94 ad 30 call 0x2615a ; 0x2615a 2722c: 8e ce rjmp .-740 ; 0x26f4a #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 2722e: df 91 pop r29 27230: cf 91 pop r28 27232: 1f 91 pop r17 27234: 0f 91 pop r16 27236: ff 90 pop r15 27238: ef 90 pop r14 2723a: df 90 pop r13 2723c: cf 90 pop r12 2723e: af 90 pop r10 27240: 7f 90 pop r7 27242: 6f 90 pop r6 27244: 5f 90 pop r5 27246: 4f 90 pop r4 27248: 08 95 ret 0002724a <__vector_47>: ISR(TIMERx_COMPA_vect) { 2724a: 1f 92 push r1 2724c: 0f 92 push r0 2724e: 0f b6 in r0, 0x3f ; 63 27250: 0f 92 push r0 27252: 11 24 eor r1, r1 27254: 0b b6 in r0, 0x3b ; 59 27256: 0f 92 push r0 27258: 2f 93 push r18 2725a: 3f 93 push r19 2725c: 4f 93 push r20 2725e: 5f 93 push r21 27260: 6f 93 push r22 27262: 7f 93 push r23 27264: 8f 93 push r24 27266: 9f 93 push r25 27268: af 93 push r26 2726a: bf 93 push r27 2726c: ef 93 push r30 2726e: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 27270: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.459> 27274: 88 23 and r24, r24 27276: 91 f0 breq .+36 ; 0x2729c <__vector_47+0x52> adc_values_ready = false; 27278: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.459> adc_start_cycle(); 2727c: 0e 94 5f 8d call 0x11abe ; 0x11abe // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 27280: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 27284: 8d 7f andi r24, 0xFD ; 253 27286: 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(); 2728a: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 2728c: 0f 94 be 36 call 0x26d7c ; 0x26d7c (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 27290: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 27292: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 27296: 82 60 ori r24, 0x02 ; 2 27298: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 2729c: ff 91 pop r31 2729e: ef 91 pop r30 272a0: bf 91 pop r27 272a2: af 91 pop r26 272a4: 9f 91 pop r25 272a6: 8f 91 pop r24 272a8: 7f 91 pop r23 272aa: 6f 91 pop r22 272ac: 5f 91 pop r21 272ae: 4f 91 pop r20 272b0: 3f 91 pop r19 272b2: 2f 91 pop r18 272b4: 0f 90 pop r0 272b6: 0b be out 0x3b, r0 ; 59 272b8: 0f 90 pop r0 272ba: 0f be out 0x3f, r0 ; 63 272bc: 0f 90 pop r0 272be: 1f 90 pop r1 272c0: 18 95 reti 000272c2 : } void handle_temp_error(); void manage_heater() { 272c2: 6f 92 push r6 272c4: 7f 92 push r7 272c6: 8f 92 push r8 272c8: 9f 92 push r9 272ca: af 92 push r10 272cc: bf 92 push r11 272ce: cf 92 push r12 272d0: df 92 push r13 272d2: ef 92 push r14 272d4: ff 92 push r15 272d6: 0f 93 push r16 272d8: 1f 93 push r17 272da: cf 93 push r28 272dc: df 93 push r29 272de: 1f 92 push r1 272e0: cd b7 in r28, 0x3d ; 61 272e2: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 272e4: 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) 272e6: 80 91 02 06 lds r24, 0x0602 ; 0x800602 272ea: 88 23 and r24, r24 272ec: 09 f4 brne .+2 ; 0x272f0 272ee: bb c0 rjmp .+374 ; 0x27466 return; // syncronize temperatures with isr updateTemperatures(); 272f0: 0f 94 82 33 call 0x26704 ; 0x26704 #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 272f4: 80 91 39 06 lds r24, 0x0639 ; 0x800639 272f8: 80 ff sbrs r24, 0 272fa: 51 c0 rjmp .+162 ; 0x2739e } static void handle_warning() { // update values float warn = data.warn; 272fc: 10 91 34 13 lds r17, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.402+0x84> 27300: 00 91 35 13 lds r16, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.402+0x85> 27304: b0 90 36 13 lds r11, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.402+0x86> 27308: a0 90 37 13 lds r10, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.402+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 2730c: ce 01 movw r24, r28 2730e: 01 96 adiw r24, 0x01 ; 1 27310: 0f 94 9f 32 call 0x2653e ; 0x2653e dT_err = warning_state.dT_err; 27314: c0 90 35 06 lds r12, 0x0635 ; 0x800635 27318: d0 90 36 06 lds r13, 0x0636 ; 0x800636 2731c: e0 90 37 06 lds r14, 0x0637 ; 0x800637 27320: f0 90 38 06 lds r15, 0x0638 ; 0x800638 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 27324: ce 01 movw r24, r28 27326: 01 96 adiw r24, 0x01 ; 1 27328: 0f 94 92 32 call 0x26524 ; 0x26524 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); 2732c: af 92 push r10 2732e: bf 92 push r11 27330: 0f 93 push r16 27332: 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 27334: 21 e7 ldi r18, 0x71 ; 113 27336: 3d e3 ldi r19, 0x3D ; 61 27338: 4a e8 ldi r20, 0x8A ; 138 2733a: 5e e3 ldi r21, 0x3E ; 62 2733c: c7 01 movw r24, r14 2733e: b6 01 movw r22, r12 27340: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 27344: 9f 93 push r25 27346: 8f 93 push r24 27348: 7f 93 push r23 2734a: 6f 93 push r22 2734c: 87 e1 ldi r24, 0x17 ; 23 2734e: 9b e9 ldi r25, 0x9B ; 155 27350: 9f 93 push r25 27352: 8f 93 push r24 27354: 0f 94 16 db call 0x3b62c ; 0x3b62c static bool first = true; if(warning_state.assert) { 27358: 90 91 39 06 lds r25, 0x0639 ; 0x800639 2735c: 0f b6 in r0, 0x3f ; 63 2735e: f8 94 cli 27360: de bf out 0x3e, r29 ; 62 27362: 0f be out 0x3f, r0 ; 63 27364: cd bf out 0x3d, r28 ; 61 27366: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.457> 2736a: 91 ff sbrs r25, 1 2736c: 93 c0 rjmp .+294 ; 0x27494 if (first) { 2736e: 90 91 a3 02 lds r25, 0x02A3 ; 0x8002a3 27372: 99 23 and r25, r25 27374: 09 f4 brne .+2 ; 0x27378 27376: 87 c0 rjmp .+270 ; 0x27486 if(warn_beep) { 27378: 88 23 and r24, r24 2737a: 79 f0 breq .+30 ; 0x2739a lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 2737c: 8c ee ldi r24, 0xEC ; 236 2737e: 9c e4 ldi r25, 0x4C ; 76 27380: 0e 94 2c 72 call 0xe458 ; 0xe458 27384: 61 e0 ldi r22, 0x01 ; 1 27386: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 WRITE(BEEPER, HIGH); 2738a: 9f b7 in r25, 0x3f ; 63 2738c: f8 94 cli 2738e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27392: 84 60 ori r24, 0x04 ; 4 27394: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27398: 9f bf out 0x3f, r25 ; 63 } first = false; 2739a: 10 92 a3 02 sts 0x02A3, r1 ; 0x8002a3 if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 2739e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 273a2: 88 23 and r24, r24 273a4: 89 f0 breq .+34 ; 0x273c8 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 273a6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 273aa: 82 95 swap r24 273ac: 86 95 lsr r24 273ae: 87 70 andi r24, 0x07 ; 7 273b0: 84 30 cpi r24, 0x04 ; 4 273b2: 08 f0 brcs .+2 ; 0x273b6 273b4: 82 c0 rjmp .+260 ; 0x274ba 273b6: 82 30 cpi r24, 0x02 ; 2 273b8: 08 f0 brcs .+2 ; 0x273bc 273ba: 1d c1 rjmp .+570 ; 0x275f6 273bc: 88 23 and r24, r24 273be: 09 f4 brne .+2 ; 0x273c2 273c0: f4 c0 rjmp .+488 ; 0x275aa 273c2: 81 30 cpi r24, 0x01 ; 1 273c4: 09 f4 brne .+2 ; 0x273c8 273c6: 94 c0 rjmp .+296 ; 0x274f0 // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 273c8: 0e 94 82 7f call 0xff04 ; 0xff04 } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 273cc: 80 91 34 06 lds r24, 0x0634 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x10> 273d0: 88 23 and r24, r24 273d2: 09 f4 brne .+2 ; 0x273d6 273d4: 48 c0 rjmp .+144 ; 0x27466 uint8_t counter = log_buf.entry.counter; 273d6: 80 91 29 06 lds r24, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x5> if (counter == log_buf.serial) return; 273da: 70 90 33 06 lds r7, 0x0633 ; 0x800633 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xf> 273de: 87 15 cp r24, r7 273e0: 09 f4 brne .+2 ; 0x273e4 273e2: 41 c0 rjmp .+130 ; 0x27466 // 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; 273e4: ce 01 movw r24, r28 273e6: 01 96 adiw r24, 0x01 ; 1 273e8: 0f 94 9f 32 call 0x2653e ; 0x2653e delta_ms = log_buf.entry.delta_ms; 273ec: 00 91 28 06 lds r16, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x4> counter = log_buf.entry.counter; 273f0: 10 91 29 06 lds r17, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x5> cur_pwm = log_buf.entry.cur_pwm; 273f4: 60 90 2a 06 lds r6, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x6> cur_temp = log_buf.entry.cur_temp; 273f8: c0 90 2b 06 lds r12, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x7> 273fc: d0 90 2c 06 lds r13, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x8> 27400: e0 90 2d 06 lds r14, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.539+0x9> 27404: f0 90 2e 06 lds r15, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xa> cur_amb = log_buf.entry.cur_amb; 27408: 80 90 2f 06 lds r8, 0x062F ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xb> 2740c: 90 90 30 06 lds r9, 0x0630 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xc> 27410: a0 90 31 06 lds r10, 0x0631 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xd> 27414: b0 90 32 06 lds r11, 0x0632 ; 0x800632 <_ZN13thermal_modelL7log_bufE.lto_priv.539+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; 27418: ce 01 movw r24, r28 2741a: 01 96 adiw r24, 0x01 ; 1 2741c: 0f 94 92 32 call 0x26524 ; 0x26524 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; 27420: 10 93 33 06 sts 0x0633, r17 ; 0x800633 <_ZN13thermal_modelL7log_bufE.lto_priv.539+0xf> printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 27424: bf 92 push r11 27426: af 92 push r10 27428: 9f 92 push r9 2742a: 8f 92 push r8 2742c: ff 92 push r15 2742e: ef 92 push r14 27430: df 92 push r13 27432: cf 92 push r12 27434: 1f 92 push r1 27436: 6f 92 push r6 27438: 80 2f mov r24, r16 2743a: 00 0f add r16, r16 2743c: 99 0b sbc r25, r25 2743e: 01 96 adiw r24, 0x01 ; 1 27440: 9f 93 push r25 27442: 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; 27444: 81 2f mov r24, r17 27446: 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, 27448: 81 50 subi r24, 0x01 ; 1 2744a: 99 0b sbc r25, r25 2744c: 9f 93 push r25 2744e: 8f 93 push r24 27450: 8a e9 ldi r24, 0x9A ; 154 27452: 9a e9 ldi r25, 0x9A ; 154 27454: 9f 93 push r25 27456: 8f 93 push r24 27458: 0f 94 16 db call 0x3b62c ; 0x3b62c 2745c: 0f b6 in r0, 0x3f ; 63 2745e: f8 94 cli 27460: de bf out 0x3e, r29 ; 62 27462: 0f be out 0x3f, r0 ; 63 27464: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 27466: 0f 90 pop r0 27468: df 91 pop r29 2746a: cf 91 pop r28 2746c: 1f 91 pop r17 2746e: 0f 91 pop r16 27470: ff 90 pop r15 27472: ef 90 pop r14 27474: df 90 pop r13 27476: cf 90 pop r12 27478: bf 90 pop r11 2747a: af 90 pop r10 2747c: 9f 90 pop r9 2747e: 8f 90 pop r8 27480: 7f 90 pop r7 27482: 6f 90 pop r6 27484: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 27486: 88 23 and r24, r24 27488: 09 f4 brne .+2 ; 0x2748c 2748a: 89 cf rjmp .-238 ; 0x2739e 2748c: 84 e0 ldi r24, 0x04 ; 4 2748e: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 27492: 85 cf rjmp .-246 ; 0x2739e } } else { // warning cleared, reset state warning_state.warning = false; 27494: 90 91 39 06 lds r25, 0x0639 ; 0x800639 27498: 9e 7f andi r25, 0xFE ; 254 2749a: 90 93 39 06 sts 0x0639, r25 ; 0x800639 if(warn_beep) WRITE(BEEPER, LOW); 2749e: 88 23 and r24, r24 274a0: 41 f0 breq .+16 ; 0x274b2 274a2: 9f b7 in r25, 0x3f ; 63 274a4: f8 94 cli 274a6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 274aa: 8b 7f andi r24, 0xFB ; 251 274ac: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 274b0: 9f bf out 0x3f, r25 ; 63 first = true; 274b2: 81 e0 ldi r24, 0x01 ; 1 274b4: 80 93 a3 02 sts 0x02A3, r24 ; 0x8002a3 274b8: 72 cf rjmp .-284 ; 0x2739e #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 274ba: 84 30 cpi r24, 0x04 ; 4 274bc: 09 f0 breq .+2 ; 0x274c0 274be: 84 cf rjmp .-248 ; 0x273c8 #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 274c0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 274c4: 81 ff sbrs r24, 1 274c6: b4 c0 rjmp .+360 ; 0x27630 if(IsStopped() == false) { 274c8: 80 91 11 05 lds r24, 0x0511 ; 0x800511 274cc: 81 11 cpse r24, r1 274ce: 04 c0 rjmp .+8 ; 0x274d8 SERIAL_ECHOLNPGM("TM: error triggered!"); 274d0: 82 e0 ldi r24, 0x02 ; 2 274d2: 9b e9 ldi r25, 0x9B ; 155 274d4: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 } ThermalStop(true); 274d8: 81 e0 ldi r24, 0x01 ; 1 274da: 0e 94 2c 79 call 0xf258 ; 0xf258 WRITE(BEEPER, HIGH); 274de: 9f b7 in r25, 0x3f ; 63 274e0: f8 94 cli 274e2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 274e6: 84 60 ori r24, 0x04 ; 4 274e8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 274ec: 9f bf out 0x3f, r25 ; 63 274ee: 6c cf rjmp .-296 ; 0x273c8 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 274f0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 274f4: 86 95 lsr r24 274f6: 86 95 lsr r24 274f8: 83 70 andi r24, 0x03 ; 3 274fa: 81 30 cpi r24, 0x01 ; 1 274fc: d9 f1 breq .+118 ; 0x27574 274fe: 58 f0 brcs .+22 ; 0x27516 27500: 82 30 cpi r24, 0x02 ; 2 27502: 09 f0 breq .+2 ; 0x27506 27504: 61 cf rjmp .-318 ; 0x273c8 } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 27506: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2750a: 81 11 cpse r24, r1 2750c: 14 c0 rjmp .+40 ; 0x27536 temp_error_messagepgm(PSTR("MINTEMP AMB")); 2750e: 61 e0 ldi r22, 0x01 ; 1 27510: 84 ec ldi r24, 0xC4 ; 196 27512: 9a e9 ldi r25, 0x9A ; 154 27514: 0e c0 rjmp .+28 ; 0x27532 // 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) { 27516: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 2751a: 81 ff sbrs r24, 1 2751c: 10 c0 rjmp .+32 ; 0x2753e min_temp_error(temp_error_state.index); 2751e: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 27522: 62 95 swap r22 27524: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 27526: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2752a: 81 11 cpse r24, r1 2752c: 04 c0 rjmp .+8 ; 0x27536 temp_error_messagepgm(err, e); 2752e: 80 eb ldi r24, 0xB0 ; 176 27530: 9a e9 ldi r25, 0x9A ; 154 27532: 0f 94 02 2d call 0x25a04 ; 0x25a04 prusa_statistics(92); } ThermalStop(); 27536: 80 e0 ldi r24, 0x00 ; 0 27538: 0e 94 2c 79 call 0xf258 ; 0xf258 2753c: 45 cf rjmp .-374 ; 0x273c8 // 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); 2753e: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 <_ZL8minttemp.lto_priv.463> 27542: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 <_ZL8minttemp.lto_priv.463+0x1> 27546: 6b 5f subi r22, 0xFB ; 251 27548: 7f 4f sbci r23, 0xFF ; 255 2754a: 07 2e mov r0, r23 2754c: 00 0c add r0, r0 2754e: 88 0b sbc r24, r24 27550: 99 0b sbc r25, r25 27552: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 27556: 8b 01 movw r16, r22 27558: 9c 01 movw r18, r24 2755a: 40 91 b0 0d lds r20, 0x0DB0 ; 0x800db0 2755e: 50 91 b1 0d lds r21, 0x0DB1 ; 0x800db1 27562: 60 91 b2 0d lds r22, 0x0DB2 ; 0x800db2 27566: 70 91 b3 0d lds r23, 0x0DB3 ; 0x800db3 2756a: 8f e9 ldi r24, 0x9F ; 159 2756c: 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); 2756e: 0f 94 06 20 call 0x2400c ; 0x2400c 27572: 2a cf rjmp .-428 ; 0x273c8 // 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) { 27574: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 27578: 81 ff sbrs r24, 1 2757a: 08 c0 rjmp .+16 ; 0x2758c ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 2757c: 80 91 11 05 lds r24, 0x0511 ; 0x800511 27580: 81 11 cpse r24, r1 27582: d9 cf rjmp .-78 ; 0x27536 temp_error_messagepgm(err); 27584: 61 e0 ldi r22, 0x01 ; 1 27586: 88 eb ldi r24, 0xB8 ; 184 27588: 9a e9 ldi r25, 0x9A ; 154 2758a: d3 cf rjmp .-90 ; 0x27532 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); 2758c: 40 91 ee 04 lds r20, 0x04EE ; 0x8004ee 27590: 50 91 ef 04 lds r21, 0x04EF ; 0x8004ef 27594: 60 91 f0 04 lds r22, 0x04F0 ; 0x8004f0 27598: 70 91 f1 04 lds r23, 0x04F1 ; 0x8004f1 2759c: 00 e0 ldi r16, 0x00 ; 0 2759e: 10 e0 ldi r17, 0x00 ; 0 275a0: 20 e7 ldi r18, 0x70 ; 112 275a2: 31 e4 ldi r19, 0x41 ; 65 275a4: 8b e9 ldi r24, 0x9B ; 155 275a6: 92 e0 ldi r25, 0x02 ; 2 275a8: e2 cf rjmp .-60 ; 0x2756e break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 275aa: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 275ae: 86 95 lsr r24 275b0: 86 95 lsr r24 275b2: 83 70 andi r24, 0x03 ; 3 275b4: 81 30 cpi r24, 0x01 ; 1 275b6: b9 f0 breq .+46 ; 0x275e6 275b8: 58 f0 brcs .+22 ; 0x275d0 275ba: 82 30 cpi r24, 0x02 ; 2 275bc: 09 f0 breq .+2 ; 0x275c0 275be: 04 cf rjmp .-504 ; 0x273c8 } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 275c0: 80 91 11 05 lds r24, 0x0511 ; 0x800511 275c4: 81 11 cpse r24, r1 275c6: b7 cf rjmp .-146 ; 0x27536 temp_error_messagepgm(PSTR("MAXTEMP AMB")); 275c8: 61 e0 ldi r22, 0x01 ; 1 275ca: 84 ee ldi r24, 0xE4 ; 228 275cc: 9a e9 ldi r25, 0x9A ; 154 275ce: b1 cf rjmp .-158 ; 0x27532 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 275d0: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 275d4: 62 95 swap r22 275d6: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 275d8: 80 91 11 05 lds r24, 0x0511 ; 0x800511 275dc: 81 11 cpse r24, r1 275de: ab cf rjmp .-170 ; 0x27536 temp_error_messagepgm(PSTR("MAXTEMP"), e); 275e0: 80 ed ldi r24, 0xD0 ; 208 275e2: 9a e9 ldi r25, 0x9A ; 154 275e4: a6 cf rjmp .-180 ; 0x27532 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 275e6: 80 91 11 05 lds r24, 0x0511 ; 0x800511 275ea: 81 11 cpse r24, r1 275ec: a4 cf rjmp .-184 ; 0x27536 temp_error_messagepgm(PSTR("MAXTEMP BED")); 275ee: 61 e0 ldi r22, 0x01 ; 1 275f0: 88 ed ldi r24, 0xD8 ; 216 275f2: 9a e9 ldi r25, 0x9A ; 154 275f4: 9e cf rjmp .-196 ; 0x27532 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 275f6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 275fa: 86 95 lsr r24 275fc: 86 95 lsr r24 275fe: 83 70 andi r24, 0x03 ; 3 27600: 82 30 cpi r24, 0x02 ; 2 27602: 08 f0 brcs .+2 ; 0x27606 27604: e1 ce rjmp .-574 ; 0x273c8 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 27606: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 2760a: 86 95 lsr r24 2760c: 86 95 lsr r24 2760e: 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), 27610: 90 91 1b 05 lds r25, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 27614: 92 95 swap r25 27616: 96 95 lsr r25 27618: 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( 2761a: 61 e0 ldi r22, 0x01 ; 1 2761c: 81 30 cpi r24, 0x01 ; 1 2761e: 09 f0 breq .+2 ; 0x27622 27620: 60 e0 ldi r22, 0x00 ; 0 27622: 81 e0 ldi r24, 0x01 ; 1 27624: 92 30 cpi r25, 0x02 ; 2 27626: 09 f0 breq .+2 ; 0x2762a 27628: 80 e0 ldi r24, 0x00 ; 0 2762a: 0f 94 3f 20 call 0x2407e ; 0x2407e 2762e: cc ce rjmp .-616 ; 0x273c8 SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 27630: 10 92 1b 05 sts 0x051B, r1 ; 0x80051b <_ZL16temp_error_state.lto_priv.456> WRITE(BEEPER, LOW); 27634: 9f b7 in r25, 0x3f ; 63 27636: f8 94 cli 27638: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2763c: 8b 7f andi r24, 0xFB ; 251 2763e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27642: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 27644: 80 91 72 06 lds r24, 0x0672 ; 0x800672 27648: 90 91 73 06 lds r25, 0x0673 ; 0x800673 2764c: 89 2b or r24, r25 2764e: 39 f4 brne .+14 ; 0x2765e target_temperature_bed = saved_bed_temperature; 27650: 80 91 ae 05 lds r24, 0x05AE ; 0x8005ae 27654: 90 e0 ldi r25, 0x00 ; 0 27656: 90 93 73 06 sts 0x0673, r25 ; 0x800673 2765a: 80 93 72 06 sts 0x0672, r24 ; 0x800672 SERIAL_ECHOLNPGM("TM: error cleared"); 2765e: 80 ef ldi r24, 0xF0 ; 240 27660: 9a e9 ldi r25, 0x9A ; 154 27662: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 27666: b0 ce rjmp .-672 ; 0x273c8 00027668 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 27668: 4f 92 push r4 2766a: 5f 92 push r5 2766c: 6f 92 push r6 2766e: 7f 92 push r7 27670: 8f 92 push r8 27672: 9f 92 push r9 27674: af 92 push r10 27676: bf 92 push r11 27678: cf 92 push r12 2767a: df 92 push r13 2767c: ef 92 push r14 2767e: ff 92 push r15 27680: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 27682: 0f 94 51 2a call 0x254a2 ; 0x254a2 27686: 28 ee ldi r18, 0xE8 ; 232 27688: 33 e0 ldi r19, 0x03 ; 3 2768a: 40 e0 ldi r20, 0x00 ; 0 2768c: 50 e0 ldi r21, 0x00 ; 0 2768e: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 27692: 29 01 movw r4, r18 27694: 3a 01 movw r6, r20 lcd_consume_click(); 27696: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 KEEPALIVE_STATE(PAUSED_FOR_USER); 2769a: 84 e0 ldi r24, 0x04 ; 4 2769c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 276a0: f1 2c mov r15, r1 276a2: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 276a4: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 276a8: 81 e0 ldi r24, 0x01 ; 1 276aa: 0e 94 37 8a call 0x1146e ; 0x1146e bDelayed = ((_millis()/1000-nTime0) > nDelay); 276ae: 0f 94 51 2a call 0x254a2 ; 0x254a2 276b2: 28 ee ldi r18, 0xE8 ; 232 276b4: 33 e0 ldi r19, 0x03 ; 3 276b6: 40 e0 ldi r20, 0x00 ; 0 276b8: 50 e0 ldi r21, 0x00 ; 0 276ba: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 276be: 49 01 movw r8, r18 276c0: 5a 01 movw r10, r20 276c2: 84 18 sub r8, r4 276c4: 95 08 sbc r9, r5 276c6: a6 08 sbc r10, r6 276c8: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 276ca: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 276ce: 81 11 cpse r24, r1 276d0: 07 c0 rjmp .+14 ; 0x276e0 276d2: c8 14 cp r12, r8 276d4: d9 04 cpc r13, r9 276d6: ea 04 cpc r14, r10 276d8: fb 04 cpc r15, r11 276da: 20 f7 brcc .-56 ; 0x276a4 276dc: 81 e0 ldi r24, 0x01 ; 1 276de: 07 c0 rjmp .+14 ; 0x276ee 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 276e0: 81 e0 ldi r24, 0x01 ; 1 276e2: c8 14 cp r12, r8 276e4: d9 04 cpc r13, r9 276e6: ea 04 cpc r14, r10 276e8: fb 04 cpc r15, r11 276ea: 08 f0 brcs .+2 ; 0x276ee 276ec: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 276ee: 92 e0 ldi r25, 0x02 ; 2 276f0: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be return(!bDelayed); } } } 276f4: 91 e0 ldi r25, 0x01 ; 1 276f6: 89 27 eor r24, r25 276f8: ff 90 pop r15 276fa: ef 90 pop r14 276fc: df 90 pop r13 276fe: cf 90 pop r12 27700: bf 90 pop r11 27702: af 90 pop r10 27704: 9f 90 pop r9 27706: 8f 90 pop r8 27708: 7f 90 pop r7 2770a: 6f 90 pop r6 2770c: 5f 90 pop r5 2770e: 4f 90 pop r4 27710: 08 95 ret 00027712 : #endif } static void waiting_handler() { manage_heater(); 27712: 0f 94 61 39 call 0x272c2 ; 0x272c2 host_keepalive(); 27716: 0e 94 27 7f call 0xfe4e ; 0xfe4e host_autoreport(); 2771a: 0e 94 d8 78 call 0xf1b0 ; 0xf1b0 checkFans(); 2771e: 0e 94 82 7f call 0xff04 ; 0xff04 lcd_update(0); 27722: 80 e0 ldi r24, 0x00 ; 0 27724: 0c 94 27 6e jmp 0xdc4e ; 0xdc4e 00027728 : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 27728: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 2772c: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 27730: 65 50 subi r22, 0x05 ; 5 27732: 71 09 sbc r23, r1 27734: 07 2e mov r0, r23 27736: 00 0c add r0, r0 27738: 88 0b sbc r24, r24 2773a: 99 0b sbc r25, r25 2773c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 27740: 9b 01 movw r18, r22 27742: ac 01 movw r20, r24 27744: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 27748: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 2774c: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 27750: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 27754: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 27758: 87 ff sbrs r24, 7 2775a: 07 c0 rjmp .+14 ; 0x2776a if(temp_error_state.v) break; 2775c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 27760: 81 11 cpse r24, r1 27762: 03 c0 rjmp .+6 ; 0x2776a waiting_handler(); 27764: 0f 94 89 3b call 0x27712 ; 0x27712 27768: df cf rjmp .-66 ; 0x27728 } } 2776a: 08 95 ret 0002776c : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 2776c: cf 92 push r12 2776e: df 92 push r13 27770: ef 92 push r14 27772: ff 92 push r15 27774: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 27776: 0f 94 51 2a call 0x254a2 ; 0x254a2 2777a: 9b 01 movw r18, r22 2777c: ac 01 movw r20, r24 2777e: 2e 0d add r18, r14 27780: 3f 1d adc r19, r15 27782: 41 1d adc r20, r1 27784: 51 1d adc r21, r1 27786: 69 01 movw r12, r18 27788: 7a 01 movw r14, r20 while(_millis() < mark) { 2778a: 0f 94 51 2a call 0x254a2 ; 0x254a2 2778e: 6c 15 cp r22, r12 27790: 7d 05 cpc r23, r13 27792: 8e 05 cpc r24, r14 27794: 9f 05 cpc r25, r15 27796: 38 f4 brcc .+14 ; 0x277a6 if(temp_error_state.v) break; 27798: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.456> 2779c: 81 11 cpse r24, r1 2779e: 03 c0 rjmp .+6 ; 0x277a6 waiting_handler(); 277a0: 0f 94 89 3b call 0x27712 ; 0x27712 277a4: f2 cf rjmp .-28 ; 0x2778a } } 277a6: ff 90 pop r15 277a8: ef 90 pop r14 277aa: df 90 pop r13 277ac: cf 90 pop r12 277ae: 08 95 ret 000277b0 : 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; 277b0: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 277b4: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 277b8: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 277bc: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 277c0: 60 e0 ldi r22, 0x00 ; 0 277c2: 70 e0 ldi r23, 0x00 ; 0 277c4: 8f e7 ldi r24, 0x7F ; 127 277c6: 93 e4 ldi r25, 0x43 ; 67 277c8: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 277cc: 60 93 af 04 sts 0x04AF, r22 ; 0x8004af <_ZL14iState_sum_max.lto_priv.471> 277d0: 70 93 b0 04 sts 0x04B0, r23 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.471+0x1> 277d4: 80 93 b1 04 sts 0x04B1, r24 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.471+0x2> 277d8: 90 93 b2 04 sts 0x04B2, r25 ; 0x8004b2 <_ZL14iState_sum_max.lto_priv.471+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 277dc: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 277e0: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 277e4: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 277e8: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 277ec: 60 e0 ldi r22, 0x00 ; 0 277ee: 70 e0 ldi r23, 0x00 ; 0 277f0: 8f e7 ldi r24, 0x7F ; 127 277f2: 93 e4 ldi r25, 0x43 ; 67 277f4: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 277f8: 60 93 a7 04 sts 0x04A7, r22 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.469> 277fc: 70 93 a8 04 sts 0x04A8, r23 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.469+0x1> 27800: 80 93 a9 04 sts 0x04A9, r24 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.469+0x2> 27804: 90 93 aa 04 sts 0x04AA, r25 ; 0x8004aa <_ZL19temp_iState_max_bed.lto_priv.469+0x3> #endif } 27808: 08 95 ret 0002780a : #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) { 2780a: 2f 92 push r2 2780c: 3f 92 push r3 2780e: 4f 92 push r4 27810: 5f 92 push r5 27812: 6f 92 push r6 27814: 7f 92 push r7 27816: 8f 92 push r8 27818: 9f 92 push r9 2781a: af 92 push r10 2781c: bf 92 push r11 2781e: cf 92 push r12 27820: df 92 push r13 27822: ef 92 push r14 27824: ff 92 push r15 27826: 0f 93 push r16 27828: 1f 93 push r17 2782a: cf 93 push r28 2782c: df 93 push r29 2782e: cd b7 in r28, 0x3d ; 61 27830: de b7 in r29, 0x3e ; 62 27832: e0 97 sbiw r28, 0x30 ; 48 27834: 0f b6 in r0, 0x3f ; 63 27836: f8 94 cli 27838: de bf out 0x3e, r29 ; 62 2783a: 0f be out 0x3f, r0 ; 63 2783c: cd bf out 0x3d, r28 ; 61 2783e: 6a 87 std Y+10, r22 ; 0x0a 27840: 7b 87 std Y+11, r23 ; 0x0b 27842: 8c 87 std Y+12, r24 ; 0x0c 27844: 9d 87 std Y+13, r25 ; 0x0d 27846: 1a 01 movw r2, r20 27848: 3a a7 std Y+42, r19 ; 0x2a 2784a: 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(); 2784c: 0f 94 1d 30 call 0x2603a ; 0x2603a pid_tuning_finished = false; 27850: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.460> // 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; 27854: 29 a5 ldd r18, Y+41 ; 0x29 27856: 3a a5 ldd r19, Y+42 ; 0x2a 27858: 30 93 48 06 sts 0x0648, r19 ; 0x800648 2785c: 20 93 47 06 sts 0x0647, r18 ; 0x800647 float input = 0.0; pid_cycle=0; 27860: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 27864: 10 92 49 06 sts 0x0649, r1 ; 0x800649 bool heating = true; unsigned long temp_millis = _millis(); 27868: 0f 94 51 2a call 0x254a2 ; 0x254a2 2786c: 6e 83 std Y+6, r22 ; 0x06 2786e: 7f 83 std Y+7, r23 ; 0x07 27870: 88 87 std Y+8, r24 ; 0x08 27872: 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 27874: 37 fe sbrs r3, 7 27876: ff c0 rjmp .+510 ; 0x27a76 27878: 3d e2 ldi r19, 0x2D ; 45 2787a: 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(); 2787c: 0f 94 51 2a call 0x254a2 ; 0x254a2 27880: 6c a3 std Y+36, r22 ; 0x24 27882: 7d a3 std Y+37, r23 ; 0x25 27884: 8e a3 std Y+38, r24 ; 0x26 27886: 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."); 27888: 80 e7 ldi r24, 0x70 ; 112 2788a: 9a e9 ldi r25, 0x9A ; 154 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); #endif if ((extruder >= EXTRUDERS) 2788c: 12 14 cp r1, r2 2788e: 13 04 cpc r1, r3 27890: 0c f4 brge .+2 ; 0x27894 27892: 8a c2 rjmp .+1300 ; 0x27da8 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 27894: 8d e5 ldi r24, 0x5D ; 93 27896: 9a e9 ldi r25, 0x9A ; 154 27898: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 2789c: 6a 85 ldd r22, Y+10 ; 0x0a 2789e: 7b 85 ldd r23, Y+11 ; 0x0b 278a0: 8c 85 ldd r24, Y+12 ; 0x0c 278a2: 9d 85 ldd r25, Y+13 ; 0x0d 278a4: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 278a8: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 278aa: 21 14 cp r2, r1 278ac: 31 04 cpc r3, r1 278ae: 09 f4 brne .+2 ; 0x278b2 278b0: e5 c0 rjmp .+458 ; 0x27a7c { soft_pwm_bed = (MAX_BED_POWER)/2; 278b2: 20 93 1d 06 sts 0x061D, r18 ; 0x80061d bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 278b6: 70 93 73 06 sts 0x0673, r23 ; 0x800673 278ba: 60 93 72 06 sts 0x0672, r22 ; 0x800672 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 278be: 8e 81 ldd r24, Y+6 ; 0x06 278c0: 9f 81 ldd r25, Y+7 ; 0x07 278c2: a8 85 ldd r26, Y+8 ; 0x08 278c4: b9 85 ldd r27, Y+9 ; 0x09 278c6: 8e 87 std Y+14, r24 ; 0x0e 278c8: 9f 87 std Y+15, r25 ; 0x0f 278ca: a8 8b std Y+16, r26 ; 0x10 278cc: b9 8b std Y+17, r27 ; 0x11 278ce: 88 a3 std Y+32, r24 ; 0x20 278d0: 99 a3 std Y+33, r25 ; 0x21 278d2: aa a3 std Y+34, r26 ; 0x22 278d4: bb a3 std Y+35, r27 ; 0x23 278d6: 1a 8a std Y+18, r1 ; 0x12 278d8: 90 e4 ldi r25, 0x40 ; 64 278da: 9b 8b std Y+19, r25 ; 0x13 278dc: ac e1 ldi r26, 0x1C ; 28 278de: ac 8b std Y+20, r26 ; 0x14 278e0: b6 e4 ldi r27, 0x46 ; 70 278e2: bd 8b std Y+21, r27 ; 0x15 278e4: 1e 8a std Y+22, r1 ; 0x16 278e6: 1f 8a std Y+23, r1 ; 0x17 278e8: 18 8e std Y+24, r1 ; 0x18 278ea: 19 8e std Y+25, r1 ; 0x19 278ec: 6f e7 ldi r22, 0x7F ; 127 278ee: c6 2e mov r12, r22 278f0: d1 2c mov r13, r1 278f2: e1 2c mov r14, r1 278f4: f1 2c mov r15, r1 278f6: 00 e0 ldi r16, 0x00 ; 0 278f8: 10 e0 ldi r17, 0x00 ; 0 278fa: 18 aa std Y+48, r1 ; 0x30 278fc: 1f a6 std Y+47, r1 ; 0x2f 278fe: 1d 82 std Y+5, r1 ; 0x05 27900: 2f e7 ldi r18, 0x7F ; 127 27902: 30 e0 ldi r19, 0x00 ; 0 27904: 40 e0 ldi r20, 0x00 ; 0 27906: 50 e0 ldi r21, 0x00 ; 0 27908: 29 83 std Y+1, r18 ; 0x01 2790a: 3a 83 std Y+2, r19 ; 0x02 2790c: 4b 83 std Y+3, r20 ; 0x03 2790e: 5c 83 std Y+4, r21 ; 0x04 27910: 1b 8e std Y+27, r1 ; 0x1b 27912: 1c 8e std Y+28, r1 ; 0x1c 27914: 1d 8e std Y+29, r1 ; 0x1d 27916: 1e 8e std Y+30, r1 ; 0x1e 27918: 31 e0 ldi r19, 0x01 ; 1 2791a: 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(); 2791c: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2791e: 40 91 02 06 lds r20, 0x0602 ; 0x800602 27922: 48 a7 std Y+40, r20 ; 0x28 27924: 44 23 and r20, r20 27926: 09 f4 brne .+2 ; 0x2792a 27928: 2c c2 rjmp .+1112 ; 0x27d82 updateTemperatures(); 2792a: 0f 94 82 33 call 0x26704 ; 0x26704 input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2792e: 21 14 cp r2, r1 27930: 31 04 cpc r3, r1 27932: 09 f0 breq .+2 ; 0x27936 27934: aa c0 rjmp .+340 ; 0x27a8a 27936: 00 91 b0 0d lds r16, 0x0DB0 ; 0x800db0 2793a: 10 91 b1 0d lds r17, 0x0DB1 ; 0x800db1 2793e: 50 91 b2 0d lds r21, 0x0DB2 ; 0x800db2 27942: 58 ab std Y+48, r21 ; 0x30 27944: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 27948: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2794a: 2e 89 ldd r18, Y+22 ; 0x16 2794c: 3f 89 ldd r19, Y+23 ; 0x17 2794e: 48 8d ldd r20, Y+24 ; 0x18 27950: 59 8d ldd r21, Y+25 ; 0x19 27952: b8 01 movw r22, r16 27954: 88 a9 ldd r24, Y+48 ; 0x30 27956: 9f a5 ldd r25, Y+47 ; 0x2f 27958: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2795c: 87 fd sbrc r24, 7 2795e: 06 c0 rjmp .+12 ; 0x2796c 27960: 0e 8b std Y+22, r16 ; 0x16 27962: 1f 8b std Y+23, r17 ; 0x17 27964: b8 a9 ldd r27, Y+48 ; 0x30 27966: b8 8f std Y+24, r27 ; 0x18 27968: 2f a5 ldd r18, Y+47 ; 0x2f 2796a: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 2796c: 2a 89 ldd r18, Y+18 ; 0x12 2796e: 3b 89 ldd r19, Y+19 ; 0x13 27970: 4c 89 ldd r20, Y+20 ; 0x14 27972: 5d 89 ldd r21, Y+21 ; 0x15 27974: b8 01 movw r22, r16 27976: 88 a9 ldd r24, Y+48 ; 0x30 27978: 9f a5 ldd r25, Y+47 ; 0x2f 2797a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2797e: 18 16 cp r1, r24 27980: 34 f0 brlt .+12 ; 0x2798e 27982: 0a 8b std Y+18, r16 ; 0x12 27984: 1b 8b std Y+19, r17 ; 0x13 27986: 38 a9 ldd r19, Y+48 ; 0x30 27988: 3c 8b std Y+20, r19 ; 0x14 2798a: 4f a5 ldd r20, Y+47 ; 0x2f 2798c: 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) { 2798e: 0f 94 51 2a call 0x254a2 ; 0x254a2 27992: 2c a1 ldd r18, Y+36 ; 0x24 27994: 3d a1 ldd r19, Y+37 ; 0x25 27996: 4e a1 ldd r20, Y+38 ; 0x26 27998: 5f a1 ldd r21, Y+39 ; 0x27 2799a: 62 1b sub r22, r18 2799c: 73 0b sbc r23, r19 2799e: 84 0b sbc r24, r20 279a0: 95 0b sbc r25, r21 279a2: 65 3c cpi r22, 0xC5 ; 197 279a4: 79 40 sbci r23, 0x09 ; 9 279a6: 81 05 cpc r24, r1 279a8: 91 05 cpc r25, r1 279aa: 40 f0 brcs .+16 ; 0x279bc checkExtruderAutoFans(); 279ac: 0e 94 27 75 call 0xea4e ; 0xea4e extruder_autofan_last_check = _millis(); 279b0: 0f 94 51 2a call 0x254a2 ; 0x254a2 279b4: 6c a3 std Y+36, r22 ; 0x24 279b6: 7d a3 std Y+37, r23 ; 0x25 279b8: 8e a3 std Y+38, r24 ; 0x26 279ba: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 279bc: 4a 8d ldd r20, Y+26 ; 0x1a 279be: 44 23 and r20, r20 279c0: 09 f4 brne .+2 ; 0x279c4 279c2: 4c c0 rjmp .+152 ; 0x27a5c 279c4: 2a 85 ldd r18, Y+10 ; 0x0a 279c6: 3b 85 ldd r19, Y+11 ; 0x0b 279c8: 4c 85 ldd r20, Y+12 ; 0x0c 279ca: 5d 85 ldd r21, Y+13 ; 0x0d 279cc: b8 01 movw r22, r16 279ce: 88 a9 ldd r24, Y+48 ; 0x30 279d0: 9f a5 ldd r25, Y+47 ; 0x2f 279d2: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 279d6: 18 16 cp r1, r24 279d8: 0c f0 brlt .+2 ; 0x279dc 279da: d3 c1 rjmp .+934 ; 0x27d82 if(_millis() - t2 > 5000) { 279dc: 0f 94 51 2a call 0x254a2 ; 0x254a2 279e0: 2e 85 ldd r18, Y+14 ; 0x0e 279e2: 3f 85 ldd r19, Y+15 ; 0x0f 279e4: 48 89 ldd r20, Y+16 ; 0x10 279e6: 59 89 ldd r21, Y+17 ; 0x11 279e8: 62 1b sub r22, r18 279ea: 73 0b sbc r23, r19 279ec: 84 0b sbc r24, r20 279ee: 95 0b sbc r25, r21 279f0: 69 38 cpi r22, 0x89 ; 137 279f2: 73 41 sbci r23, 0x13 ; 19 279f4: 81 05 cpc r24, r1 279f6: 91 05 cpc r25, r1 279f8: 08 f4 brcc .+2 ; 0x279fc 279fa: c3 c1 rjmp .+902 ; 0x27d82 279fc: d7 01 movw r26, r14 279fe: c6 01 movw r24, r12 27a00: 29 81 ldd r18, Y+1 ; 0x01 27a02: 3a 81 ldd r19, Y+2 ; 0x02 27a04: 4b 81 ldd r20, Y+3 ; 0x03 27a06: 5c 81 ldd r21, Y+4 ; 0x04 27a08: 82 1b sub r24, r18 27a0a: 93 0b sbc r25, r19 27a0c: a4 0b sbc r26, r20 27a0e: b5 0b sbc r27, r21 27a10: b5 95 asr r27 27a12: a7 95 ror r26 27a14: 97 95 ror r25 27a16: 87 95 ror r24 heating=false; if (extruder<0) { 27a18: 21 14 cp r2, r1 27a1a: 31 04 cpc r3, r1 27a1c: 09 f4 brne .+2 ; 0x27a20 27a1e: 40 c0 rjmp .+128 ; 0x27aa0 soft_pwm_bed = (bias - d) >> 1; 27a20: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 27a24: 0f 94 51 2a call 0x254a2 ; 0x254a2 27a28: 6e 83 std Y+6, r22 ; 0x06 27a2a: 7f 83 std Y+7, r23 ; 0x07 27a2c: 88 87 std Y+8, r24 ; 0x08 27a2e: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 27a30: dc 01 movw r26, r24 27a32: cb 01 movw r24, r22 27a34: 2e 85 ldd r18, Y+14 ; 0x0e 27a36: 3f 85 ldd r19, Y+15 ; 0x0f 27a38: 48 89 ldd r20, Y+16 ; 0x10 27a3a: 59 89 ldd r21, Y+17 ; 0x11 27a3c: 82 1b sub r24, r18 27a3e: 93 0b sbc r25, r19 27a40: a4 0b sbc r26, r20 27a42: b5 0b sbc r27, r21 27a44: 8b 8f std Y+27, r24 ; 0x1b 27a46: 9c 8f std Y+28, r25 ; 0x1c 27a48: ad 8f std Y+29, r26 ; 0x1d 27a4a: be 8f std Y+30, r27 ; 0x1e max=temp; 27a4c: 3a 85 ldd r19, Y+10 ; 0x0a 27a4e: 3e 8b std Y+22, r19 ; 0x16 27a50: 4b 85 ldd r20, Y+11 ; 0x0b 27a52: 4f 8b std Y+23, r20 ; 0x17 27a54: 5c 85 ldd r21, Y+12 ; 0x0c 27a56: 58 8f std Y+24, r21 ; 0x18 27a58: 8d 85 ldd r24, Y+13 ; 0x0d 27a5a: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 27a5c: 2a 85 ldd r18, Y+10 ; 0x0a 27a5e: 3b 85 ldd r19, Y+11 ; 0x0b 27a60: 4c 85 ldd r20, Y+12 ; 0x0c 27a62: 5d 85 ldd r21, Y+13 ; 0x0d 27a64: b8 01 movw r22, r16 27a66: 88 a9 ldd r24, Y+48 ; 0x30 27a68: 9f a5 ldd r25, Y+47 ; 0x2f 27a6a: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 27a6e: 87 fd sbrc r24, 7 27a70: 1a c0 rjmp .+52 ; 0x27aa6 if(_millis() - t1 > 5000) { 27a72: 1a 8e std Y+26, r1 ; 0x1a 27a74: 86 c1 rjmp .+780 ; 0x27d82 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 27a76: 4a e0 ldi r20, 0x0A ; 10 27a78: 4f 8f std Y+31, r20 ; 0x1f 27a7a: 00 cf rjmp .-512 ; 0x2787c 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; 27a7c: 20 93 16 05 sts 0x0516, r18 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 27a80: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 27a84: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 27a88: 1a cf rjmp .-460 ; 0x278be wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 27a8a: 00 91 ee 04 lds r16, 0x04EE ; 0x8004ee 27a8e: 10 91 ef 04 lds r17, 0x04EF ; 0x8004ef 27a92: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 27a96: 98 ab std Y+48, r25 ; 0x30 27a98: a0 91 f1 04 lds r26, 0x04F1 ; 0x8004f1 27a9c: af a7 std Y+47, r26 ; 0x2f 27a9e: 55 cf rjmp .-342 ; 0x2794a heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 27aa0: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 27aa4: bf cf rjmp .-130 ; 0x27a24 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 27aa6: 0f 94 51 2a call 0x254a2 ; 0x254a2 27aaa: 2e 81 ldd r18, Y+6 ; 0x06 27aac: 3f 81 ldd r19, Y+7 ; 0x07 27aae: 48 85 ldd r20, Y+8 ; 0x08 27ab0: 59 85 ldd r21, Y+9 ; 0x09 27ab2: 62 1b sub r22, r18 27ab4: 73 0b sbc r23, r19 27ab6: 84 0b sbc r24, r20 27ab8: 95 0b sbc r25, r21 27aba: 69 38 cpi r22, 0x89 ; 137 27abc: 73 41 sbci r23, 0x13 ; 19 27abe: 81 05 cpc r24, r1 27ac0: 91 05 cpc r25, r1 27ac2: b8 f2 brcs .-82 ; 0x27a72 heating=true; t2=_millis(); 27ac4: 0f 94 51 2a call 0x254a2 ; 0x254a2 27ac8: 6e 87 std Y+14, r22 ; 0x0e 27aca: 7f 87 std Y+15, r23 ; 0x0f 27acc: 88 8b std Y+16, r24 ; 0x10 27ace: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 27ad0: 80 91 49 06 lds r24, 0x0649 ; 0x800649 27ad4: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 27ad8: 18 16 cp r1, r24 27ada: 19 06 cpc r1, r25 27adc: 0c f0 brlt .+2 ; 0x27ae0 27ade: 2c c1 rjmp .+600 ; 0x27d38 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 27ae0: 8e 85 ldd r24, Y+14 ; 0x0e 27ae2: 9f 85 ldd r25, Y+15 ; 0x0f 27ae4: a8 89 ldd r26, Y+16 ; 0x10 27ae6: b9 89 ldd r27, Y+17 ; 0x11 27ae8: 2e 81 ldd r18, Y+6 ; 0x06 27aea: 3f 81 ldd r19, Y+7 ; 0x07 27aec: 48 85 ldd r20, Y+8 ; 0x08 27aee: 59 85 ldd r21, Y+9 ; 0x09 27af0: 82 1b sub r24, r18 27af2: 93 0b sbc r25, r19 27af4: a4 0b sbc r26, r20 27af6: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 27af8: 4b 8c ldd r4, Y+27 ; 0x1b 27afa: 5c 8c ldd r5, Y+28 ; 0x1c 27afc: 6d 8c ldd r6, Y+29 ; 0x1d 27afe: 7e 8c ldd r7, Y+30 ; 0x1e 27b00: 48 0e add r4, r24 27b02: 59 1e adc r5, r25 27b04: 6a 1e adc r6, r26 27b06: 7b 1e adc r7, r27 27b08: 2b 8d ldd r18, Y+27 ; 0x1b 27b0a: 3c 8d ldd r19, Y+28 ; 0x1c 27b0c: 4d 8d ldd r20, Y+29 ; 0x1d 27b0e: 5e 8d ldd r21, Y+30 ; 0x1e 27b10: 28 1b sub r18, r24 27b12: 39 0b sbc r19, r25 27b14: 4a 0b sbc r20, r26 27b16: 5b 0b sbc r21, r27 27b18: 69 81 ldd r22, Y+1 ; 0x01 27b1a: 7a 81 ldd r23, Y+2 ; 0x02 27b1c: 8b 81 ldd r24, Y+3 ; 0x03 27b1e: 9c 81 ldd r25, Y+4 ; 0x04 27b20: 0f 94 b7 dc call 0x3b96e ; 0x3b96e <__mulsi3> 27b24: a3 01 movw r20, r6 27b26: 92 01 movw r18, r4 27b28: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a <__divmodsi4> 27b2c: da 01 movw r26, r20 27b2e: c9 01 movw r24, r18 27b30: 8c 0d add r24, r12 27b32: 9d 1d adc r25, r13 27b34: ae 1d adc r26, r14 27b36: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 27b38: 84 31 cpi r24, 0x14 ; 20 27b3a: 91 05 cpc r25, r1 27b3c: a1 05 cpc r26, r1 27b3e: b1 05 cpc r27, r1 27b40: 0c f4 brge .+2 ; 0x27b44 27b42: 3c c1 rjmp .+632 ; 0x27dbc 27b44: 6c 01 movw r12, r24 27b46: 7d 01 movw r14, r26 27b48: 3c ee ldi r19, 0xEC ; 236 27b4a: c3 16 cp r12, r19 27b4c: d1 04 cpc r13, r1 27b4e: e1 04 cpc r14, r1 27b50: f1 04 cpc r15, r1 27b52: 2c f0 brlt .+10 ; 0x27b5e 27b54: 4b ee ldi r20, 0xEB ; 235 27b56: c4 2e mov r12, r20 27b58: d1 2c mov r13, r1 27b5a: e1 2c mov r14, r1 27b5c: 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; 27b5e: 80 38 cpi r24, 0x80 ; 128 27b60: 91 05 cpc r25, r1 27b62: a1 05 cpc r26, r1 27b64: b1 05 cpc r27, r1 27b66: 0c f4 brge .+2 ; 0x27b6a 27b68: 37 c1 rjmp .+622 ; 0x27dd8 27b6a: 8e ef ldi r24, 0xFE ; 254 27b6c: 90 e0 ldi r25, 0x00 ; 0 27b6e: a0 e0 ldi r26, 0x00 ; 0 27b70: b0 e0 ldi r27, 0x00 ; 0 27b72: 8c 19 sub r24, r12 27b74: 9d 09 sbc r25, r13 27b76: ae 09 sbc r26, r14 27b78: bf 09 sbc r27, r15 27b7a: 89 83 std Y+1, r24 ; 0x01 27b7c: 9a 83 std Y+2, r25 ; 0x02 27b7e: ab 83 std Y+3, r26 ; 0x03 27b80: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 27b82: 85 e5 ldi r24, 0x55 ; 85 27b84: 9a e9 ldi r25, 0x9A ; 154 27b86: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27b8a: c7 01 movw r24, r14 27b8c: b6 01 movw r22, r12 27b8e: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 27b92: 80 e5 ldi r24, 0x50 ; 80 27b94: 9a e9 ldi r25, 0x9A ; 154 27b96: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27b9a: 69 81 ldd r22, Y+1 ; 0x01 27b9c: 7a 81 ldd r23, Y+2 ; 0x02 27b9e: 8b 81 ldd r24, Y+3 ; 0x03 27ba0: 9c 81 ldd r25, Y+4 ; 0x04 27ba2: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 27ba6: 89 e4 ldi r24, 0x49 ; 73 27ba8: 9a e9 ldi r25, 0x9A ; 154 27baa: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 27bae: 42 e0 ldi r20, 0x02 ; 2 27bb0: 6a 89 ldd r22, Y+18 ; 0x12 27bb2: 7b 89 ldd r23, Y+19 ; 0x13 27bb4: 8c 89 ldd r24, Y+20 ; 0x14 27bb6: 9d 89 ldd r25, Y+21 ; 0x15 27bb8: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 27bbc: 82 e4 ldi r24, 0x42 ; 66 27bbe: 9a e9 ldi r25, 0x9A ; 154 27bc0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27bc4: 6e 89 ldd r22, Y+22 ; 0x16 27bc6: 7f 89 ldd r23, Y+23 ; 0x17 27bc8: 88 8d ldd r24, Y+24 ; 0x18 27bca: 99 8d ldd r25, Y+25 ; 0x19 27bcc: 0f 94 ef 75 call 0x2ebde ; 0x2ebde if(pid_cycle > 2) { 27bd0: 80 91 49 06 lds r24, 0x0649 ; 0x800649 27bd4: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 27bd8: 03 97 sbiw r24, 0x03 ; 3 27bda: 0c f4 brge .+2 ; 0x27bde 27bdc: ad c0 rjmp .+346 ; 0x27d38 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 27bde: 69 81 ldd r22, Y+1 ; 0x01 27be0: 7a 81 ldd r23, Y+2 ; 0x02 27be2: 8b 81 ldd r24, Y+3 ; 0x03 27be4: 9c 81 ldd r25, Y+4 ; 0x04 27be6: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 27bea: 20 e0 ldi r18, 0x00 ; 0 27bec: 30 e0 ldi r19, 0x00 ; 0 27bee: 40 e8 ldi r20, 0x80 ; 128 27bf0: 50 e4 ldi r21, 0x40 ; 64 27bf2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 27bf6: 4b 01 movw r8, r22 27bf8: 5c 01 movw r10, r24 27bfa: 2a 89 ldd r18, Y+18 ; 0x12 27bfc: 3b 89 ldd r19, Y+19 ; 0x13 27bfe: 4c 89 ldd r20, Y+20 ; 0x14 27c00: 5d 89 ldd r21, Y+21 ; 0x15 27c02: 6e 89 ldd r22, Y+22 ; 0x16 27c04: 7f 89 ldd r23, Y+23 ; 0x17 27c06: 88 8d ldd r24, Y+24 ; 0x18 27c08: 99 8d ldd r25, Y+25 ; 0x19 27c0a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 27c0e: 20 ed ldi r18, 0xD0 ; 208 27c10: 3f e0 ldi r19, 0x0F ; 15 27c12: 49 e4 ldi r20, 0x49 ; 73 27c14: 50 e4 ldi r21, 0x40 ; 64 27c16: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 27c1a: 20 e0 ldi r18, 0x00 ; 0 27c1c: 30 e0 ldi r19, 0x00 ; 0 27c1e: 40 e0 ldi r20, 0x00 ; 0 27c20: 5f e3 ldi r21, 0x3F ; 63 27c22: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 27c26: 9b 01 movw r18, r22 27c28: ac 01 movw r20, r24 27c2a: c5 01 movw r24, r10 27c2c: b4 01 movw r22, r8 27c2e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 27c32: 4b 01 movw r8, r22 27c34: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 27c36: c3 01 movw r24, r6 27c38: b2 01 movw r22, r4 27c3a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 27c3e: 20 e0 ldi r18, 0x00 ; 0 27c40: 30 e0 ldi r19, 0x00 ; 0 27c42: 4a e7 ldi r20, 0x7A ; 122 27c44: 54 e4 ldi r21, 0x44 ; 68 27c46: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 27c4a: 2b 01 movw r4, r22 27c4c: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 27c4e: 8c e3 ldi r24, 0x3C ; 60 27c50: 9a e9 ldi r25, 0x9A ; 154 27c52: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27c56: 42 e0 ldi r20, 0x02 ; 2 27c58: c5 01 movw r24, r10 27c5a: b4 01 movw r22, r8 27c5c: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 27c60: 86 e3 ldi r24, 0x36 ; 54 27c62: 9a e9 ldi r25, 0x9A ; 154 27c64: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27c68: c3 01 movw r24, r6 27c6a: b2 01 movw r22, r4 27c6c: 0f 94 ef 75 call 0x2ebde ; 0x2ebde _Kp = 0.6*Ku; 27c70: 2a e9 ldi r18, 0x9A ; 154 27c72: 39 e9 ldi r19, 0x99 ; 153 27c74: 49 e1 ldi r20, 0x19 ; 25 27c76: 5f e3 ldi r21, 0x3F ; 63 27c78: c5 01 movw r24, r10 27c7a: b4 01 movw r22, r8 27c7c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 27c80: 4b 01 movw r8, r22 27c82: 5c 01 movw r10, r24 27c84: 80 92 f3 03 sts 0x03F3, r8 ; 0x8003f3 <_Kp> 27c88: 90 92 f4 03 sts 0x03F4, r9 ; 0x8003f4 <_Kp+0x1> 27c8c: a0 92 f5 03 sts 0x03F5, r10 ; 0x8003f5 <_Kp+0x2> 27c90: b0 92 f6 03 sts 0x03F6, r11 ; 0x8003f6 <_Kp+0x3> _Ki = 2*_Kp/Tu; 27c94: ac 01 movw r20, r24 27c96: 9b 01 movw r18, r22 27c98: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 27c9c: a3 01 movw r20, r6 27c9e: 92 01 movw r18, r4 27ca0: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 27ca4: 60 93 ef 03 sts 0x03EF, r22 ; 0x8003ef <_Ki> 27ca8: 70 93 f0 03 sts 0x03F0, r23 ; 0x8003f0 <_Ki+0x1> 27cac: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 <_Ki+0x2> 27cb0: 90 93 f2 03 sts 0x03F2, r25 ; 0x8003f2 <_Ki+0x3> _Kd = _Kp*Tu/8; 27cb4: a3 01 movw r20, r6 27cb6: 92 01 movw r18, r4 27cb8: c5 01 movw r24, r10 27cba: b4 01 movw r22, r8 27cbc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 27cc0: 20 e0 ldi r18, 0x00 ; 0 27cc2: 30 e0 ldi r19, 0x00 ; 0 27cc4: 40 e0 ldi r20, 0x00 ; 0 27cc6: 5e e3 ldi r21, 0x3E ; 62 27cc8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 27ccc: 60 93 eb 03 sts 0x03EB, r22 ; 0x8003eb <_Kd> 27cd0: 70 93 ec 03 sts 0x03EC, r23 ; 0x8003ec <_Kd+0x1> 27cd4: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed <_Kd+0x2> 27cd8: 90 93 ee 03 sts 0x03EE, r25 ; 0x8003ee <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 27cdc: 88 e2 ldi r24, 0x28 ; 40 27cde: 9a e9 ldi r25, 0x9A ; 154 27ce0: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 27ce4: 82 e2 ldi r24, 0x22 ; 34 27ce6: 9a e9 ldi r25, 0x9A ; 154 27ce8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27cec: 60 91 f3 03 lds r22, 0x03F3 ; 0x8003f3 <_Kp> 27cf0: 70 91 f4 03 lds r23, 0x03F4 ; 0x8003f4 <_Kp+0x1> 27cf4: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 <_Kp+0x2> 27cf8: 90 91 f6 03 lds r25, 0x03F6 ; 0x8003f6 <_Kp+0x3> 27cfc: 0f 94 ef 75 call 0x2ebde ; 0x2ebde SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 27d00: 8c e1 ldi r24, 0x1C ; 28 27d02: 9a e9 ldi r25, 0x9A ; 154 27d04: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27d08: 60 91 ef 03 lds r22, 0x03EF ; 0x8003ef <_Ki> 27d0c: 70 91 f0 03 lds r23, 0x03F0 ; 0x8003f0 <_Ki+0x1> 27d10: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 27d14: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 <_Ki+0x3> 27d18: 0f 94 ef 75 call 0x2ebde ; 0x2ebde SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 27d1c: 86 e1 ldi r24, 0x16 ; 22 27d1e: 9a e9 ldi r25, 0x9A ; 154 27d20: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27d24: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Kd> 27d28: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Kd+0x1> 27d2c: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 27d30: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Kd+0x3> 27d34: 0f 94 ef 75 call 0x2ebde ; 0x2ebde 27d38: 89 81 ldd r24, Y+1 ; 0x01 27d3a: 9a 81 ldd r25, Y+2 ; 0x02 27d3c: ab 81 ldd r26, Y+3 ; 0x03 27d3e: bc 81 ldd r27, Y+4 ; 0x04 27d40: 8c 0d add r24, r12 27d42: 9d 1d adc r25, r13 27d44: ae 1d adc r26, r14 27d46: bf 1d adc r27, r15 27d48: b5 95 asr r27 27d4a: a7 95 ror r26 27d4c: 97 95 ror r25 27d4e: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 27d50: 21 14 cp r2, r1 27d52: 31 04 cpc r3, r1 27d54: 09 f4 brne .+2 ; 0x27d58 27d56: 45 c0 rjmp .+138 ; 0x27de2 { soft_pwm_bed = (bias + d) >> 1; 27d58: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 27d5c: 80 91 49 06 lds r24, 0x0649 ; 0x800649 27d60: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 27d64: 01 96 adiw r24, 0x01 ; 1 27d66: 90 93 4a 06 sts 0x064A, r25 ; 0x80064a 27d6a: 80 93 49 06 sts 0x0649, r24 ; 0x800649 min=temp; 27d6e: 3a 85 ldd r19, Y+10 ; 0x0a 27d70: 3a 8b std Y+18, r19 ; 0x12 27d72: 4b 85 ldd r20, Y+11 ; 0x0b 27d74: 4b 8b std Y+19, r20 ; 0x13 27d76: 5c 85 ldd r21, Y+12 ; 0x0c 27d78: 5c 8b std Y+20, r21 ; 0x14 27d7a: 8d 85 ldd r24, Y+13 ; 0x0d 27d7c: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 27d7e: 98 a5 ldd r25, Y+40 ; 0x28 27d80: 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)) { 27d82: 20 e0 ldi r18, 0x00 ; 0 27d84: 30 e0 ldi r19, 0x00 ; 0 27d86: 40 ea ldi r20, 0xA0 ; 160 27d88: 51 e4 ldi r21, 0x41 ; 65 27d8a: 6a 85 ldd r22, Y+10 ; 0x0a 27d8c: 7b 85 ldd r23, Y+11 ; 0x0b 27d8e: 8c 85 ldd r24, Y+12 ; 0x0c 27d90: 9d 85 ldd r25, Y+13 ; 0x0d 27d92: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 27d96: 98 01 movw r18, r16 27d98: 48 a9 ldd r20, Y+48 ; 0x30 27d9a: 5f a5 ldd r21, Y+47 ; 0x2f 27d9c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 27da0: 87 ff sbrs r24, 7 27da2: 22 c0 rjmp .+68 ; 0x27de8 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 27da4: 8c ee ldi r24, 0xEC ; 236 27da6: 99 e9 ldi r25, 0x99 ; 153 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"); 27da8: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 pid_tuning_finished = true; 27dac: 81 e0 ldi r24, 0x01 ; 1 27dae: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.460> pid_cycle = 0; 27db2: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 27db6: 10 92 49 06 sts 0x0649, r1 ; 0x800649 27dba: 98 c0 rjmp .+304 ; 0x27eec 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); 27dbc: 34 e1 ldi r19, 0x14 ; 20 27dbe: c3 2e mov r12, r19 27dc0: d1 2c mov r13, r1 27dc2: e1 2c mov r14, r1 27dc4: f1 2c mov r15, r1 27dc6: 24 e1 ldi r18, 0x14 ; 20 27dc8: 30 e0 ldi r19, 0x00 ; 0 27dca: 40 e0 ldi r20, 0x00 ; 0 27dcc: 50 e0 ldi r21, 0x00 ; 0 27dce: 29 83 std Y+1, r18 ; 0x01 27dd0: 3a 83 std Y+2, r19 ; 0x02 27dd2: 4b 83 std Y+3, r20 ; 0x03 27dd4: 5c 83 std Y+4, r21 ; 0x04 27dd6: d5 ce rjmp .-598 ; 0x27b82 27dd8: c9 82 std Y+1, r12 ; 0x01 27dda: da 82 std Y+2, r13 ; 0x02 27ddc: eb 82 std Y+3, r14 ; 0x03 27dde: fc 82 std Y+4, r15 ; 0x04 27de0: d0 ce rjmp .-608 ; 0x27b82 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 27de2: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 27de6: ba cf rjmp .-140 ; 0x27d5c SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 27de8: 0f 94 51 2a call 0x254a2 ; 0x254a2 27dec: 28 a1 ldd r18, Y+32 ; 0x20 27dee: 39 a1 ldd r19, Y+33 ; 0x21 27df0: 4a a1 ldd r20, Y+34 ; 0x22 27df2: 5b a1 ldd r21, Y+35 ; 0x23 27df4: 62 1b sub r22, r18 27df6: 73 0b sbc r23, r19 27df8: 84 0b sbc r24, r20 27dfa: 95 0b sbc r25, r21 27dfc: 61 3d cpi r22, 0xD1 ; 209 27dfe: 77 40 sbci r23, 0x07 ; 7 27e00: 81 05 cpc r24, r1 27e02: 91 05 cpc r25, r1 27e04: 58 f1 brcs .+86 ; 0x27e5c int p; if (extruder<0){ p=soft_pwm_bed; 27e06: a0 90 1d 06 lds r10, 0x061D ; 0x80061d 27e0a: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 27e0c: 89 ee ldi r24, 0xE9 ; 233 27e0e: 99 e9 ldi r25, 0x99 ; 153 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 27e10: 21 14 cp r2, r1 27e12: 31 04 cpc r3, r1 27e14: 29 f4 brne .+10 ; 0x27e20 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 27e16: a0 90 16 05 lds r10, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.461> 27e1a: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 27e1c: 86 ee ldi r24, 0xE6 ; 230 27e1e: 99 e9 ldi r25, 0x99 ; 153 27e20: 0e 94 d0 76 call 0xeda0 ; 0xeda0 27e24: 42 e0 ldi r20, 0x02 ; 2 27e26: b8 01 movw r22, r16 27e28: 88 a9 ldd r24, Y+48 ; 0x30 27e2a: 9f a5 ldd r25, Y+47 ; 0x2f 27e2c: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 27e30: 82 ee ldi r24, 0xE2 ; 226 27e32: 99 e9 ldi r25, 0x99 ; 153 27e34: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_PROTOCOLLN(p); 27e38: c5 01 movw r24, r10 27e3a: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 if (safety_check_cycles == 0) { //save ambient temp 27e3e: 4d 81 ldd r20, Y+5 ; 0x05 27e40: 44 23 and r20, r20 27e42: 09 f4 brne .+2 ; 0x27e46 27e44: 6c c0 rjmp .+216 ; 0x27f1e temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 27e46: 5f 8d ldd r21, Y+31 ; 0x1f 27e48: 45 17 cp r20, r21 27e4a: 70 f5 brcc .+92 ; 0x27ea8 safety_check_cycles++; 27e4c: 4f 5f subi r20, 0xFF ; 255 27e4e: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 27e50: 0f 94 51 2a call 0x254a2 ; 0x254a2 27e54: 68 a3 std Y+32, r22 ; 0x20 27e56: 79 a3 std Y+33, r23 ; 0x21 27e58: 8a a3 std Y+34, r24 ; 0x22 27e5a: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 27e5c: 0f 94 51 2a call 0x254a2 ; 0x254a2 27e60: 4b 01 movw r8, r22 27e62: 5c 01 movw r10, r24 27e64: 0f 94 51 2a call 0x254a2 ; 0x254a2 27e68: 4e 80 ldd r4, Y+6 ; 0x06 27e6a: 5f 80 ldd r5, Y+7 ; 0x07 27e6c: 68 84 ldd r6, Y+8 ; 0x08 27e6e: 79 84 ldd r7, Y+9 ; 0x09 27e70: 2e 85 ldd r18, Y+14 ; 0x0e 27e72: 3f 85 ldd r19, Y+15 ; 0x0f 27e74: 48 89 ldd r20, Y+16 ; 0x10 27e76: 59 89 ldd r21, Y+17 ; 0x11 27e78: 42 0e add r4, r18 27e7a: 53 1e adc r5, r19 27e7c: 64 1e adc r6, r20 27e7e: 75 1e adc r7, r21 27e80: 84 18 sub r8, r4 27e82: 95 08 sbc r9, r5 27e84: a6 08 sbc r10, r6 27e86: b7 08 sbc r11, r7 27e88: 86 0e add r8, r22 27e8a: 97 1e adc r9, r23 27e8c: a8 1e adc r10, r24 27e8e: b9 1e adc r11, r25 27e90: 31 e8 ldi r19, 0x81 ; 129 27e92: 83 16 cp r8, r19 27e94: 3f e4 ldi r19, 0x4F ; 79 27e96: 93 06 cpc r9, r19 27e98: 32 e1 ldi r19, 0x12 ; 18 27e9a: a3 06 cpc r10, r19 27e9c: b1 04 cpc r11, r1 27e9e: 08 f4 brcc .+2 ; 0x27ea2 27ea0: 47 c0 rjmp .+142 ; 0x27f30 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 27ea2: 85 ec ldi r24, 0xC5 ; 197 27ea4: 99 e9 ldi r25, 0x99 ; 153 27ea6: 80 cf rjmp .-256 ; 0x27da8 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 27ea8: 8d 81 ldd r24, Y+5 ; 0x05 27eaa: 9f 8d ldd r25, Y+31 ; 0x1f 27eac: 89 13 cpse r24, r25 27eae: d0 cf rjmp .-96 ; 0x27e50 safety_check_cycles++; 27eb0: 8f 5f subi r24, 0xFF ; 255 27eb2: 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) { 27eb4: 2b a5 ldd r18, Y+43 ; 0x2b 27eb6: 3c a5 ldd r19, Y+44 ; 0x2c 27eb8: 4d a5 ldd r20, Y+45 ; 0x2d 27eba: 5e a5 ldd r21, Y+46 ; 0x2e 27ebc: b8 01 movw r22, r16 27ebe: 88 a9 ldd r24, Y+48 ; 0x30 27ec0: 9f a5 ldd r25, Y+47 ; 0x2f 27ec2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 27ec6: 9f 77 andi r25, 0x7F ; 127 27ec8: 20 e0 ldi r18, 0x00 ; 0 27eca: 30 e0 ldi r19, 0x00 ; 0 27ecc: 40 ea ldi r20, 0xA0 ; 160 27ece: 50 e4 ldi r21, 0x40 ; 64 27ed0: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 27ed4: 87 ff sbrs r24, 7 27ed6: bc cf rjmp .-136 ; 0x27e50 temp_runaway_stop(false, (extruder<0)); 27ed8: 63 2d mov r22, r3 27eda: 66 1f adc r22, r22 27edc: 66 27 eor r22, r22 27ede: 66 1f adc r22, r22 27ee0: 80 e0 ldi r24, 0x00 ; 0 27ee2: 0f 94 3f 20 call 0x2407e ; 0x2407e pid_tuning_finished = true; 27ee6: 81 e0 ldi r24, 0x01 ; 1 27ee8: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.460> pid_cycle = 0; return; } lcd_update(0); } } 27eec: e0 96 adiw r28, 0x30 ; 48 27eee: 0f b6 in r0, 0x3f ; 63 27ef0: f8 94 cli 27ef2: de bf out 0x3e, r29 ; 62 27ef4: 0f be out 0x3f, r0 ; 63 27ef6: cd bf out 0x3d, r28 ; 61 27ef8: df 91 pop r29 27efa: cf 91 pop r28 27efc: 1f 91 pop r17 27efe: 0f 91 pop r16 27f00: ff 90 pop r15 27f02: ef 90 pop r14 27f04: df 90 pop r13 27f06: cf 90 pop r12 27f08: bf 90 pop r11 27f0a: af 90 pop r10 27f0c: 9f 90 pop r9 27f0e: 8f 90 pop r8 27f10: 7f 90 pop r7 27f12: 6f 90 pop r6 27f14: 5f 90 pop r5 27f16: 4f 90 pop r4 27f18: 3f 90 pop r3 27f1a: 2f 90 pop r2 27f1c: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 27f1e: 0b a7 std Y+43, r16 ; 0x2b 27f20: 1c a7 std Y+44, r17 ; 0x2c 27f22: a8 a9 ldd r26, Y+48 ; 0x30 27f24: ad a7 std Y+45, r26 ; 0x2d 27f26: bf a5 ldd r27, Y+47 ; 0x2f 27f28: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 27f2a: 21 e0 ldi r18, 0x01 ; 1 27f2c: 2d 83 std Y+5, r18 ; 0x05 27f2e: 90 cf rjmp .-224 ; 0x27e50 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 27f30: 80 91 49 06 lds r24, 0x0649 ; 0x800649 27f34: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 27f38: 49 a5 ldd r20, Y+41 ; 0x29 27f3a: 5a a5 ldd r21, Y+42 ; 0x2a 27f3c: 48 17 cp r20, r24 27f3e: 59 07 cpc r21, r25 27f40: 1c f4 brge .+6 ; 0x27f48 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 27f42: 89 e6 ldi r24, 0x69 ; 105 27f44: 99 e9 ldi r25, 0x99 ; 153 27f46: 30 cf rjmp .-416 ; 0x27da8 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 27f48: 80 e0 ldi r24, 0x00 ; 0 27f4a: 0e 94 27 6e call 0xdc4e ; 0xdc4e 27f4e: e6 cc rjmp .-1588 ; 0x2791c 00027f50 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 27f50: 0f 93 push r16 27f52: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 27f54: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 27f58: 81 30 cpi r24, 0x01 ; 1 27f5a: 19 f5 brne .+70 ; 0x27fa2 27f5c: 0f 94 51 2a call 0x254a2 ; 0x254a2 27f60: 00 91 a7 05 lds r16, 0x05A7 ; 0x8005a7 27f64: 10 91 a8 05 lds r17, 0x05A8 ; 0x8005a8 27f68: 20 91 a9 05 lds r18, 0x05A9 ; 0x8005a9 27f6c: 30 91 aa 05 lds r19, 0x05AA ; 0x8005aa 27f70: 60 1b sub r22, r16 27f72: 71 0b sbc r23, r17 27f74: 82 0b sbc r24, r18 27f76: 93 0b sbc r25, r19 27f78: 28 ee ldi r18, 0xE8 ; 232 27f7a: 33 e0 ldi r19, 0x03 ; 3 27f7c: 40 e0 ldi r20, 0x00 ; 0 27f7e: 50 e0 ldi r21, 0x00 ; 0 27f80: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 27f84: 60 91 a3 05 lds r22, 0x05A3 ; 0x8005a3 27f88: 70 91 a4 05 lds r23, 0x05A4 ; 0x8005a4 27f8c: 80 91 a5 05 lds r24, 0x05A5 ; 0x8005a5 27f90: 90 91 a6 05 lds r25, 0x05A6 ; 0x8005a6 27f94: 62 0f add r22, r18 27f96: 73 1f adc r23, r19 27f98: 84 1f adc r24, r20 27f9a: 95 1f adc r25, r21 } 27f9c: 1f 91 pop r17 27f9e: 0f 91 pop r16 27fa0: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 27fa2: 60 91 52 06 lds r22, 0x0652 ; 0x800652 27fa6: 70 91 53 06 lds r23, 0x0653 ; 0x800653 27faa: 80 91 54 06 lds r24, 0x0654 ; 0x800654 27fae: 90 91 55 06 lds r25, 0x0655 ; 0x800655 27fb2: d6 cf rjmp .-84 ; 0x27f60 00027fb4 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 27fb4: 4f 92 push r4 27fb6: 5f 92 push r5 27fb8: 6f 92 push r6 27fba: 7f 92 push r7 27fbc: 8f 92 push r8 27fbe: 9f 92 push r9 27fc0: af 92 push r10 27fc2: bf 92 push r11 27fc4: cf 92 push r12 27fc6: df 92 push r13 27fc8: ef 92 push r14 27fca: ff 92 push r15 27fcc: 0f 93 push r16 27fce: 1f 93 push r17 27fd0: cf 93 push r28 27fd2: df 93 push r29 27fd4: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 27fd8: 0e 94 10 67 call 0xce20 ; 0xce20 27fdc: 88 23 and r24, r24 27fde: 09 f4 brne .+2 ; 0x27fe2 27fe0: 6e c0 rjmp .+220 ; 0x280be { const float _met = ((float)total_filament_used) / (100000.f); 27fe2: 60 91 65 06 lds r22, 0x0665 ; 0x800665 27fe6: 70 91 66 06 lds r23, 0x0666 ; 0x800666 27fea: 80 91 67 06 lds r24, 0x0667 ; 0x800667 27fee: 90 91 68 06 lds r25, 0x0668 ; 0x800668 27ff2: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 27ff6: 20 e0 ldi r18, 0x00 ; 0 27ff8: 30 e5 ldi r19, 0x50 ; 80 27ffa: 43 ec ldi r20, 0xC3 ; 195 27ffc: 57 e4 ldi r21, 0x47 ; 71 27ffe: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 28002: 56 2e mov r5, r22 28004: 47 2e mov r4, r23 28006: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 28008: 0f 94 a8 3f call 0x27f50 ; 0x27f50 2800c: 6b 01 movw r12, r22 2800e: 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(); 28010: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_printf_P(_N( 28014: 81 e0 ldi r24, 0x01 ; 1 28016: 90 e5 ldi r25, 0x50 ; 80 28018: 0e 94 2c 72 call 0xe458 ; 0xe458 2801c: 18 2f mov r17, r24 2801e: 09 2f mov r16, r25 28020: 81 ef ldi r24, 0xF1 ; 241 28022: 9f e4 ldi r25, 0x4F ; 79 28024: 0e 94 2c 72 call 0xe458 ; 0xe458 28028: 78 2e mov r7, r24 2802a: 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; 2802c: 8c e3 ldi r24, 0x3C ; 60 2802e: 88 2e mov r8, r24 28030: 91 2c mov r9, r1 28032: a1 2c mov r10, r1 28034: b1 2c mov r11, r1 28036: c7 01 movw r24, r14 28038: b6 01 movw r22, r12 2803a: a5 01 movw r20, r10 2803c: 94 01 movw r18, r8 2803e: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 28042: 7f 93 push r23 28044: 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; 28046: ca 01 movw r24, r20 28048: b9 01 movw r22, r18 2804a: a5 01 movw r20, r10 2804c: 94 01 movw r18, r8 2804e: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 28052: 7f 93 push r23 28054: 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; 28056: c7 01 movw r24, r14 28058: b6 01 movw r22, r12 2805a: 20 e1 ldi r18, 0x10 ; 16 2805c: 3e e0 ldi r19, 0x0E ; 14 2805e: 40 e0 ldi r20, 0x00 ; 0 28060: 50 e0 ldi r21, 0x00 ; 0 28062: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 28066: 5f 93 push r21 28068: 4f 93 push r20 2806a: 3f 93 push r19 2806c: 2f 93 push r18 2806e: 0f 93 push r16 28070: 1f 93 push r17 28072: df 93 push r29 28074: cf 93 push r28 28076: 4f 92 push r4 28078: 5f 92 push r5 2807a: 6f 92 push r6 2807c: 7f 92 push r7 2807e: 88 ed ldi r24, 0xD8 ; 216 28080: 9e e6 ldi r25, 0x6E ; 110 28082: 9f 93 push r25 28084: 8f 93 push r24 28086: 0e 94 39 6e call 0xdc72 ; 0xdc72 "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 2808a: 8d b7 in r24, 0x3d ; 61 2808c: 9e b7 in r25, 0x3e ; 62 2808e: 42 96 adiw r24, 0x12 ; 18 28090: 0f b6 in r0, 0x3f ; 63 28092: f8 94 cli 28094: 9e bf out 0x3e, r25 ; 62 28096: 0f be out 0x3f, r0 ; 63 28098: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 2809a: df 91 pop r29 2809c: cf 91 pop r28 2809e: 1f 91 pop r17 280a0: 0f 91 pop r16 280a2: ff 90 pop r15 280a4: ef 90 pop r14 280a6: df 90 pop r13 280a8: cf 90 pop r12 280aa: bf 90 pop r11 280ac: af 90 pop r10 280ae: 9f 90 pop r9 280b0: 8f 90 pop r8 280b2: 7f 90 pop r7 280b4: 6f 90 pop r6 280b6: 5f 90 pop r5 280b8: 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(); 280ba: 0d 94 38 d5 jmp 0x3aa70 ; 0x3aa70 _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 280be: 81 ef ldi r24, 0xF1 ; 241 280c0: 9f e0 ldi r25, 0x0F ; 15 280c2: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 280c6: 2b 01 movw r4, r22 280c8: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 280ca: 8d ee ldi r24, 0xED ; 237 280cc: 9f e0 ldi r25, 0x0F ; 15 280ce: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 280d2: 6b 01 movw r12, r22 280d4: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 280d6: 0e 94 8c 6e call 0xdd18 ; 0xdd18 lcd_printf_P(_N( 280da: 8e ed ldi r24, 0xDE ; 222 280dc: 9f e4 ldi r25, 0x4F ; 79 280de: 0e 94 2c 72 call 0xe458 ; 0xe458 280e2: 98 2e mov r9, r24 280e4: 89 2e mov r8, r25 280e6: 8d ec ldi r24, 0xCD ; 205 280e8: 9f e4 ldi r25, 0x4F ; 79 280ea: 0e 94 2c 72 call 0xe458 ; 0xe458 280ee: b8 2e mov r11, r24 280f0: 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; 280f2: c7 01 movw r24, r14 280f4: b6 01 movw r22, r12 280f6: 2c e3 ldi r18, 0x3C ; 60 280f8: 30 e0 ldi r19, 0x00 ; 0 280fa: 40 e0 ldi r20, 0x00 ; 0 280fc: 50 e0 ldi r21, 0x00 ; 0 280fe: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 28102: 7f 93 push r23 28104: 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; 28106: ca 01 movw r24, r20 28108: b9 01 movw r22, r18 2810a: 28 e1 ldi r18, 0x18 ; 24 2810c: 30 e0 ldi r19, 0x00 ; 0 2810e: 40 e0 ldi r20, 0x00 ; 0 28110: 50 e0 ldi r21, 0x00 ; 0 28112: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 28116: 7f 93 push r23 28118: 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; 2811a: c7 01 movw r24, r14 2811c: b6 01 movw r22, r12 2811e: 20 ea ldi r18, 0xA0 ; 160 28120: 35 e0 ldi r19, 0x05 ; 5 28122: 40 e0 ldi r20, 0x00 ; 0 28124: 50 e0 ldi r21, 0x00 ; 0 28126: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2812a: 5f 93 push r21 2812c: 4f 93 push r20 2812e: 3f 93 push r19 28130: 2f 93 push r18 28132: 8f 92 push r8 28134: 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; 28136: c3 01 movw r24, r6 28138: b2 01 movw r22, r4 2813a: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 2813e: 20 e0 ldi r18, 0x00 ; 0 28140: 30 e0 ldi r19, 0x00 ; 0 28142: 48 ec ldi r20, 0xC8 ; 200 28144: 52 e4 ldi r21, 0x42 ; 66 28146: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2814a: 9f 93 push r25 2814c: 8f 93 push r24 2814e: 7f 93 push r23 28150: 6f 93 push r22 28152: af 92 push r10 28154: bf 92 push r11 28156: 84 eb ldi r24, 0xB4 ; 180 28158: 9e e6 ldi r25, 0x6E ; 110 2815a: 9f 93 push r25 2815c: 8f 93 push r24 2815e: 0e 94 39 6e call 0xdc72 ; 0xdc72 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 28162: 8d b7 in r24, 0x3d ; 61 28164: 9e b7 in r25, 0x3e ; 62 28166: 42 96 adiw r24, 0x12 ; 18 28168: 0f b6 in r0, 0x3f ; 63 2816a: f8 94 cli 2816c: 9e bf out 0x3e, r25 ; 62 2816e: 0f be out 0x3f, r0 ; 63 28170: 8d bf out 0x3d, r24 ; 61 28172: 93 cf rjmp .-218 ; 0x2809a 00028174 : 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()") { 28174: cf 92 push r12 28176: df 92 push r13 28178: ef 92 push r14 2817a: ff 92 push r15 2817c: 0f 93 push r16 2817e: 1f 93 push r17 28180: cf 93 push r28 28182: df 93 push r29 28184: 00 d0 rcall .+0 ; 0x28186 28186: 00 d0 rcall .+0 ; 0x28188 28188: 1f 92 push r1 2818a: 1f 92 push r1 2818c: cd b7 in r28, 0x3d ; 61 2818e: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 28190: 80 91 70 06 lds r24, 0x0670 ; 0x800670 28194: 90 91 71 06 lds r25, 0x0671 ; 0x800671 28198: 00 97 sbiw r24, 0x00 ; 0 2819a: e1 f1 breq .+120 ; 0x28214 { const int16_t initial_feedmultiply = feedmultiply; 2819c: 20 91 39 02 lds r18, 0x0239 ; 0x800239 281a0: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 281a4: 24 36 cpi r18, 0x64 ; 100 281a6: 31 05 cpc r19, r1 281a8: 4c f4 brge .+18 ; 0x281bc 281aa: ac 01 movw r20, r24 281ac: 42 0f add r20, r18 281ae: 53 1f adc r21, r19 281b0: 45 36 cpi r20, 0x65 ; 101 281b2: 51 05 cpc r21, r1 281b4: 6c f4 brge .+26 ; 0x281d0 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; 281b6: 82 0f add r24, r18 281b8: 93 1f adc r25, r19 281ba: 0c c0 rjmp .+24 ; 0x281d4 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 281bc: 24 36 cpi r18, 0x64 ; 100 281be: 31 05 cpc r19, r1 281c0: 09 f4 brne .+2 ; 0x281c4 281c2: 55 c0 rjmp .+170 ; 0x2826e (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 281c4: ac 01 movw r20, r24 281c6: 42 0f add r20, r18 281c8: 53 1f adc r21, r19 281ca: 44 36 cpi r20, 0x64 ; 100 281cc: 51 05 cpc r21, r1 281ce: 9c f7 brge .-26 ; 0x281b6 { feedmultiply = 100; 281d0: 84 e6 ldi r24, 0x64 ; 100 281d2: 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; 281d4: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 281d8: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 281dc: 80 91 39 02 lds r24, 0x0239 ; 0x800239 281e0: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 281e4: 82 17 cp r24, r18 281e6: 93 07 cpc r25, r19 281e8: a9 f0 breq .+42 ; 0x28214 feedmultiply = constrain(feedmultiply, 10, 999); 281ea: 88 3e cpi r24, 0xE8 ; 232 281ec: 53 e0 ldi r21, 0x03 ; 3 281ee: 95 07 cpc r25, r21 281f0: 14 f0 brlt .+4 ; 0x281f6 281f2: 87 ee ldi r24, 0xE7 ; 231 281f4: 93 e0 ldi r25, 0x03 ; 3 281f6: 8a 30 cpi r24, 0x0A ; 10 281f8: 91 05 cpc r25, r1 281fa: 14 f4 brge .+4 ; 0x28200 281fc: 8a e0 ldi r24, 0x0A ; 10 281fe: 90 e0 ldi r25, 0x00 ; 0 28200: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 28204: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 28208: 10 92 71 06 sts 0x0671, r1 ; 0x800671 2820c: 10 92 70 06 sts 0x0670, r1 ; 0x800670 refresh_saved_feedrate_multiplier_in_ram(); 28210: 0e 94 63 64 call 0xc8c6 ; 0xc8c6 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 28214: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 28218: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 2821a: 10 92 51 06 sts 0x0651, r1 ; 0x800651 } if (lcd_status_update_delay) 2821e: 10 91 51 06 lds r17, 0x0651 ; 0x800651 28222: 11 23 and r17, r17 28224: 91 f1 breq .+100 ; 0x2828a lcd_status_update_delay--; 28226: 2f ef ldi r18, 0xFF ; 255 28228: 21 0f add r18, r17 2822a: 20 93 51 06 sts 0x0651, r18 ; 0x800651 if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 2822e: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 28232: 81 11 cpse r24, r1 28234: 0d c0 rjmp .+26 ; 0x28250 28236: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 2823a: 88 23 and r24, r24 2823c: 49 f0 breq .+18 ; 0x28250 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 2823e: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 menu_submenu(lcd_main_menu); 28242: 60 e0 ldi r22, 0x00 ; 0 28244: 86 eb ldi r24, 0xB6 ; 182 28246: 95 ed ldi r25, 0xD5 ; 213 28248: 0f 94 3b d3 call 0x3a676 ; 0x3a676 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2824c: 0e 94 0c 6f call 0xde18 ; 0xde18 } } 28250: 28 96 adiw r28, 0x08 ; 8 28252: 0f b6 in r0, 0x3f ; 63 28254: f8 94 cli 28256: de bf out 0x3e, r29 ; 62 28258: 0f be out 0x3f, r0 ; 63 2825a: cd bf out 0x3d, r28 ; 61 2825c: df 91 pop r29 2825e: cf 91 pop r28 28260: 1f 91 pop r17 28262: 0f 91 pop r16 28264: ff 90 pop r15 28266: ef 90 pop r14 28268: df 90 pop r13 2826a: cf 90 pop r12 2826c: 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) { 2826e: 8b 30 cpi r24, 0x0B ; 11 28270: 91 05 cpc r25, r1 28272: 1c f0 brlt .+6 ; 0x2827a feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 28274: 86 5a subi r24, 0xA6 ; 166 28276: 9f 4f sbci r25, 0xFF ; 255 28278: ad cf rjmp .-166 ; 0x281d4 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 2827a: 86 3f cpi r24, 0xF6 ; 246 2827c: 4f ef ldi r20, 0xFF ; 255 2827e: 94 07 cpc r25, r20 28280: 0c f0 brlt .+2 ; 0x28284 28282: ac cf rjmp .-168 ; 0x281dc feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 28284: 82 59 subi r24, 0x92 ; 146 28286: 9f 4f sbci r25, 0xFF ; 255 28288: a5 cf rjmp .-182 ; 0x281d4 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; 2828a: 6a e0 ldi r22, 0x0A ; 10 2828c: 60 93 51 06 sts 0x0651, r22 ; 0x800651 ReInitLCD++; 28290: 80 91 50 06 lds r24, 0x0650 ; 0x800650 28294: 8f 5f subi r24, 0xFF ; 255 28296: 80 93 50 06 sts 0x0650, r24 ; 0x800650 if (ReInitLCD == 30) 2829a: 8e 31 cpi r24, 0x1E ; 30 2829c: 09 f0 breq .+2 ; 0x282a0 2829e: 9f c0 rjmp .+318 ; 0x283de { ReInitLCD = 0 ; 282a0: 10 92 50 06 sts 0x0650, r1 ; 0x800650 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 282a4: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_status_message_idx = 0; // Re-draw message from beginning 282a8: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.450> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 282ac: 0e 94 14 6e call 0xdc28 ; 0xdc28 lcd_home(); //line 0 282b0: 0e 94 8c 6e call 0xdd18 ; 0xdd18 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 282b4: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 282b8: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 282bc: 07 2e mov r0, r23 282be: 00 0c add r0, r0 282c0: 88 0b sbc r24, r24 282c2: 99 0b sbc r25, r25 282c4: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__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)); 282c8: 20 e0 ldi r18, 0x00 ; 0 282ca: 30 e0 ldi r19, 0x00 ; 0 282cc: 40 e0 ldi r20, 0x00 ; 0 282ce: 5f e3 ldi r21, 0x3F ; 63 282d0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 282d4: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 282d8: 6b 01 movw r12, r22 282da: 20 e0 ldi r18, 0x00 ; 0 282dc: 30 e0 ldi r19, 0x00 ; 0 282de: 40 e0 ldi r20, 0x00 ; 0 282e0: 5f e3 ldi r21, 0x3F ; 63 282e2: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 282e6: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 282ea: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 282ee: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 282f2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 282f6: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 282fa: a6 01 movw r20, r12 282fc: 82 e8 ldi r24, 0x82 ; 130 282fe: 0f 94 7e 22 call 0x244fc ; 0x244fc lcd_space(3); //3 spaces 28302: 83 e0 ldi r24, 0x03 ; 3 28304: 0e 94 56 6e call 0xdcac ; 0xdcac } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 28308: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 2830c: 81 30 cpi r24, 0x01 ; 1 2830e: 09 f0 breq .+2 ; 0x28312 28310: 6e c0 rjmp .+220 ; 0x283ee lcd_puts_P(_N("Z --- ")); 28312: 83 e1 ldi r24, 0x13 ; 19 28314: 9e e6 ldi r25, 0x6E ; 110 28316: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 2831a: 61 e0 ldi r22, 0x01 ; 1 2831c: 80 e0 ldi r24, 0x00 ; 0 2831e: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 28322: 60 91 72 06 lds r22, 0x0672 ; 0x800672 28326: 70 91 73 06 lds r23, 0x0673 ; 0x800673 2832a: 07 2e mov r0, r23 2832c: 00 0c add r0, r0 2832e: 88 0b sbc r24, r24 28330: 99 0b sbc r25, r25 28332: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 28336: 20 e0 ldi r18, 0x00 ; 0 28338: 30 e0 ldi r19, 0x00 ; 0 2833a: 40 e0 ldi r20, 0x00 ; 0 2833c: 5f e3 ldi r21, 0x3F ; 63 2833e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 28342: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 28346: 6b 01 movw r12, r22 28348: 20 e0 ldi r18, 0x00 ; 0 2834a: 30 e0 ldi r19, 0x00 ; 0 2834c: 40 e0 ldi r20, 0x00 ; 0 2834e: 5f e3 ldi r21, 0x3F ; 63 28350: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 28354: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 28358: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 2835c: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 28360: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 28364: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 28368: a6 01 movw r20, r12 2836a: 80 e8 ldi r24, 0x80 ; 128 2836c: 0f 94 7e 22 call 0x244fc ; 0x244fc lcd_space(3); //3 spaces 28370: 83 e0 ldi r24, 0x03 ; 3 28372: 0e 94 56 6e call 0xdcac ; 0xdcac #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 28376: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 2837a: 8f 93 push r24 2837c: 80 91 39 02 lds r24, 0x0239 ; 0x800239 28380: 8f 93 push r24 28382: 8c e1 ldi r24, 0x1C ; 28 28384: 9e e6 ldi r25, 0x6E ; 110 28386: 9f 93 push r25 28388: 8f 93 push r24 2838a: 0e 94 39 6e call 0xdc72 ; 0xdc72 lcd_space(8 - chars); 2838e: 98 e0 ldi r25, 0x08 ; 8 28390: 98 1b sub r25, r24 28392: 89 2f mov r24, r25 28394: 0e 94 56 6e call 0xdcac ; 0xdcac #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 28398: 62 e0 ldi r22, 0x02 ; 2 2839a: 80 e0 ldi r24, 0x00 ; 0 2839c: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 } // 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(" ")); 283a0: 0f 90 pop r0 283a2: 0f 90 pop r0 283a4: 0f 90 pop r0 283a6: 0f 90 pop r0 283a8: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 283ac: e0 90 90 14 lds r14, 0x1490 ; 0x801490 283b0: 81 11 cpse r24, r1 283b2: 3e c0 rjmp .+124 ; 0x28430 283b4: 2f e2 ldi r18, 0x2F ; 47 283b6: c2 2e mov r12, r18 283b8: 2e e6 ldi r18, 0x6E ; 110 283ba: d2 2e mov r13, r18 283bc: e1 10 cpse r14, r1 283be: 3c c0 rjmp .+120 ; 0x28438 283c0: 83 e3 ldi r24, 0x33 ; 51 283c2: c8 2e mov r12, r24 283c4: 8e e6 ldi r24, 0x6E ; 110 283c6: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 283c8: 0e 94 61 67 call 0xcec2 ; 0xcec2 283cc: f8 2e mov r15, r24 283ce: 88 23 and r24, r24 283d0: e1 f1 breq .+120 ; 0x2844a 283d2: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 283d6: 8f 3f cpi r24, 0xFF ; 255 283d8: 89 f5 brne .+98 ; 0x2843c 283da: f1 2c mov r15, r1 283dc: 36 c0 rjmp .+108 ; 0x2844a ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 283de: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e <__divmodqi4> 283e2: 91 11 cpse r25, r1 283e4: 63 cf rjmp .-314 ; 0x282ac lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 283e6: 80 e0 ldi r24, 0x00 ; 0 283e8: 0e 94 cb 6e call 0xdd96 ; 0xdd96 283ec: 5d cf rjmp .-326 ; 0x282a8 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]?' ':'?'); 283ee: 80 91 91 06 lds r24, 0x0691 ; 0x800691 283f2: 88 23 and r24, r24 283f4: d9 f0 breq .+54 ; 0x2842c 283f6: 80 e2 ldi r24, 0x20 ; 32 283f8: 1f 92 push r1 283fa: 8f 93 push r24 283fc: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 28400: 8f 93 push r24 28402: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 28406: 8f 93 push r24 28408: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 2840c: 8f 93 push r24 2840e: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 28412: 8f 93 push r24 28414: 8a e0 ldi r24, 0x0A ; 10 28416: 9e e6 ldi r25, 0x6E ; 110 28418: 9f 93 push r25 2841a: 8f 93 push r24 2841c: 0e 94 39 6e call 0xdc72 ; 0xdc72 28420: 0f b6 in r0, 0x3f ; 63 28422: f8 94 cli 28424: de bf out 0x3e, r29 ; 62 28426: 0f be out 0x3f, r0 ; 63 28428: cd bf out 0x3d, r28 ; 61 2842a: 77 cf rjmp .-274 ; 0x2831a 2842c: 8f e3 ldi r24, 0x3F ; 63 2842e: e4 cf rjmp .-56 ; 0x283f8 } // 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(" ")); 28430: 97 e3 ldi r25, 0x37 ; 55 28432: c9 2e mov r12, r25 28434: 9e e6 ldi r25, 0x6E ; 110 28436: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 28438: ee 20 and r14, r14 2843a: 31 f2 breq .-116 ; 0x283c8 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2843c: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 // 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)); 28440: ff 24 eor r15, r15 28442: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 28444: 88 23 and r24, r24 28446: 09 f4 brne .+2 ; 0x2844a 28448: bb c0 rjmp .+374 ; 0x285c0 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 2844a: 81 ea ldi r24, 0xA1 ; 161 2844c: 9d e0 ldi r25, 0x0D ; 13 2844e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 28452: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 28454: 0e 94 cf 75 call 0xeb9e ; 0xeb9e if ((nextSheet >= 0) && (sheetNR != nextSheet)) 28458: 87 fd sbrc r24, 7 2845a: b2 c0 rjmp .+356 ; 0x285c0 2845c: 08 17 cp r16, r24 2845e: 09 f4 brne .+2 ; 0x28462 28460: af c0 rjmp .+350 ; 0x285c0 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 28462: 9b e0 ldi r25, 0x0B ; 11 28464: 09 02 muls r16, r25 28466: b0 01 movw r22, r0 28468: 11 24 eor r1, r1 2846a: 67 5b subi r22, 0xB7 ; 183 2846c: 72 4f sbci r23, 0xF2 ; 242 2846e: 47 e0 ldi r20, 0x07 ; 7 28470: 50 e0 ldi r21, 0x00 ; 0 28472: 8e 01 movw r16, r28 28474: 0f 5f subi r16, 0xFF ; 255 28476: 1f 4f sbci r17, 0xFF ; 255 28478: c8 01 movw r24, r16 2847a: 0f 94 44 dc call 0x3b888 ; 0x3b888 sheet[7] = '\0'; 2847e: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 28480: 1f 93 push r17 28482: 0f 93 push r16 28484: 84 e9 ldi r24, 0x94 ; 148 28486: 9f e9 ldi r25, 0x9F ; 159 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 28488: 9f 93 push r25 2848a: 8f 93 push r24 2848c: 0e 94 39 6e call 0xdc72 ; 0xdc72 28490: 0f 90 pop r0 28492: 0f 90 pop r0 28494: 0f 90 pop r0 28496: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 28498: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 2849c: 81 30 cpi r24, 0x01 ; 1 2849e: 09 f0 breq .+2 ; 0x284a2 284a0: e9 c0 rjmp .+466 ; 0x28674 // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 284a2: 0f 94 4d 22 call 0x2449a ; 0x2449a 284a6: 95 e0 ldi r25, 0x05 ; 5 284a8: 98 1b sub r25, r24 284aa: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 284ac: 0e 94 56 6e call 0xdcac ; 0xdcac 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()) { 284b0: 0e 94 61 67 call 0xcec2 ; 0xcec2 284b4: 88 23 and r24, r24 284b6: 09 f4 brne .+2 ; 0x284ba 284b8: fa c0 rjmp .+500 ; 0x286ae uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 284ba: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 284be: 88 23 and r24, r24 284c0: 09 f4 brne .+2 ; 0x284c4 284c2: da c0 rjmp .+436 ; 0x28678 if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 284c4: c0 90 b5 02 lds r12, 0x02B5 ; 0x8002b5 284c8: d0 90 b6 02 lds r13, 0x02B6 ; 0x8002b6 print_tr = print_time_remaining_silent; //#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT) 284cc: e0 90 b3 02 lds r14, 0x02B3 ; 0x8002b3 284d0: f0 90 b4 02 lds r15, 0x02B4 ; 0x8002b4 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 284d4: 80 91 4f 06 lds r24, 0x064F ; 0x80064f 284d8: 8a 30 cpi r24, 0x0A ; 10 284da: 11 f4 brne .+4 ; 0x284e0 clock_interval = 0; 284dc: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f clock_interval++; 284e0: 80 91 4f 06 lds r24, 0x064F ; 0x80064f 284e4: 8f 5f subi r24, 0xFF ; 255 284e6: 80 93 4f 06 sts 0x064F, r24 ; 0x80064f if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 284ea: 2f ef ldi r18, 0xFF ; 255 284ec: e2 16 cp r14, r18 284ee: f2 06 cpc r15, r18 284f0: 21 f0 breq .+8 ; 0x284fa 284f2: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 284f4: 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) { 284f6: 86 30 cpi r24, 0x06 ; 6 284f8: 70 f4 brcc .+28 ; 0x28516 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 284fa: 3f ef ldi r19, 0xFF ; 255 284fc: c3 16 cp r12, r19 284fe: d3 06 cpc r13, r19 28500: 09 f0 breq .+2 ; 0x28504 28502: c3 c0 rjmp .+390 ; 0x2868a print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 28504: 0f 94 a8 3f call 0x27f50 ; 0x27f50 28508: 2c e3 ldi r18, 0x3C ; 60 2850a: 30 e0 ldi r19, 0x00 ; 0 2850c: 40 e0 ldi r20, 0x00 ; 0 2850e: 50 e0 ldi r21, 0x00 ; 0 28510: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__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 = ' '; 28514: 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)) { 28516: 40 91 39 02 lds r20, 0x0239 ; 0x800239 2851a: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 2851e: 44 36 cpi r20, 0x64 ; 100 28520: 51 05 cpc r21, r1 28522: 09 f4 brne .+2 ; 0x28526 28524: b5 c0 rjmp .+362 ; 0x28690 28526: c2 16 cp r12, r18 28528: d3 06 cpc r13, r19 2852a: 21 f0 breq .+8 ; 0x28534 2852c: e2 16 cp r14, r18 2852e: f3 06 cpc r15, r19 28530: 09 f0 breq .+2 ; 0x28534 28532: ae c0 rjmp .+348 ; 0x28690 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); 28534: a4 e6 ldi r26, 0x64 ; 100 28536: b0 e0 ldi r27, 0x00 ; 0 28538: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> 2853c: 9a 01 movw r18, r20 2853e: 55 0f add r21, r21 28540: 44 0b sbc r20, r20 28542: 55 0b sbc r21, r21 28544: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 28548: 4f e3 ldi r20, 0x3F ; 63 2854a: e4 2e mov r14, r20 2854c: 04 2e mov r0, r20 2854e: 00 0c add r0, r0 28550: ff 08 sbc r15, r15 28552: e1 2f mov r30, r17 28554: 01 2e mov r0, r17 28556: 00 0c add r0, r0 28558: ff 0b sbc r31, r31 2855a: c9 01 movw r24, r18 2855c: 6c e3 ldi r22, 0x3C ; 60 2855e: 70 e0 ldi r23, 0x00 ; 0 28560: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__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 28564: 20 37 cpi r18, 0x70 ; 112 28566: 37 41 sbci r19, 0x17 ; 23 28568: 08 f0 brcs .+2 ; 0x2856c 2856a: 94 c0 rjmp .+296 ; 0x28694 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 2856c: ff 92 push r15 2856e: 4f 93 push r20 28570: ff 93 push r31 28572: 1f 93 push r17 28574: 9f 93 push r25 28576: 8f 93 push r24 28578: 7f 93 push r23 2857a: 6f 93 push r22 2857c: 86 e4 ldi r24, 0x46 ; 70 2857e: 9e e6 ldi r25, 0x6E ; 110 28580: 9f 93 push r25 28582: 8f 93 push r24 28584: 0e 94 39 6e call 0xdc72 ; 0xdc72 else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 28588: 0f b6 in r0, 0x3f ; 63 2858a: f8 94 cli 2858c: de bf out 0x3e, r29 ; 62 2858e: 0f be out 0x3f, r0 ; 63 28590: 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); 28592: 98 e0 ldi r25, 0x08 ; 8 28594: 98 1b sub r25, r24 28596: 89 2f mov r24, r25 28598: 0e 94 56 6e call 0xdcac ; 0xdcac #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 2859c: 63 e0 ldi r22, 0x03 ; 3 2859e: 80 e0 ldi r24, 0x00 ; 0 285a0: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 285a4: 0f 94 78 2b call 0x256f0 ; 0x256f0 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 285a8: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 285ac: 88 23 and r24, r24 285ae: 09 f4 brne .+2 ; 0x285b2 285b0: 3e ce rjmp .-900 ; 0x2822e 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) { 285b2: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 285b6: 81 11 cpse r24, r1 285b8: 3a ce rjmp .-908 ; 0x2822e 285ba: 0f 94 6a 07 call 0x20ed4 ; 0x20ed4 285be: 37 ce rjmp .-914 ; 0x2822e lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 285c0: e1 10 cpse r14, r1 285c2: 04 c0 rjmp .+8 ; 0x285cc 285c4: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.452> 285c8: 81 11 cpse r24, r1 285ca: 4a c0 rjmp .+148 ; 0x28660 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 285cc: df 92 push r13 285ce: cf 92 push r12 285d0: 80 e9 ldi r24, 0x90 ; 144 285d2: 9f e9 ldi r25, 0x9F ; 159 285d4: 9f 93 push r25 285d6: 8f 93 push r24 285d8: 0e 94 39 6e call 0xdc72 ; 0xdc72 285dc: 0f 90 pop r0 285de: 0f 90 pop r0 285e0: 0f 90 pop r0 285e2: 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) 285e4: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 285e8: 81 11 cpse r24, r1 285ea: 04 c0 rjmp .+8 ; 0x285f4 285ec: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 285f0: 85 36 cpi r24, 0x65 ; 101 285f2: f0 f1 brcs .+124 ; 0x28670 { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 285f4: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad 285f8: 85 36 cpi r24, 0x65 ; 101 285fa: d0 f1 brcs .+116 ; 0x28670 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;}; 285fc: 80 91 23 17 lds r24, 0x1723 ; 0x801723 28600: 88 23 and r24, r24 28602: 19 f1 breq .+70 ; 0x2864a 28604: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 28608: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 2860c: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 28610: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 28614: 00 97 sbiw r24, 0x00 ; 0 28616: a1 05 cpc r26, r1 28618: b1 05 cpc r27, r1 2861a: b9 f0 breq .+46 ; 0x2864a 2861c: bc 01 movw r22, r24 2861e: cd 01 movw r24, r26 28620: 6d 59 subi r22, 0x9D ; 157 28622: 7f 4f sbci r23, 0xFF ; 255 28624: 8f 4f sbci r24, 0xFF ; 255 28626: 9f 4f sbci r25, 0xFF ; 255 28628: 24 e6 ldi r18, 0x64 ; 100 2862a: 30 e0 ldi r19, 0x00 ; 0 2862c: 40 e0 ldi r20, 0x00 ; 0 2862e: 50 e0 ldi r21, 0x00 ; 0 28630: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 28634: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 28638: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 2863c: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 28640: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 28644: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 28648: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2864a: 21 2f mov r18, r17 2864c: 30 e0 ldi r19, 0x00 ; 0 2864e: 89 e2 ldi r24, 0x29 ; 41 28650: 9e e6 ldi r25, 0x6E ; 110 28652: f1 10 cpse r15, r1 28654: 02 c0 rjmp .+4 ; 0x2865a 28656: 83 e2 ldi r24, 0x23 ; 35 28658: 9e e6 ldi r25, 0x6E ; 110 2865a: 3f 93 push r19 2865c: 2f 93 push r18 2865e: 14 cf rjmp .-472 ; 0x28488 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 28660: 81 e0 ldi r24, 0x01 ; 1 28662: 0e 94 56 6e call 0xdcac ; 0xdcac lcd_print(hostName); // Two characters 28666: 8c e4 ldi r24, 0x4C ; 76 28668: 96 e0 ldi r25, 0x06 ; 6 2866a: 0e 94 67 70 call 0xe0ce ; 0xe0ce 2866e: ba cf rjmp .-140 ; 0x285e4 28670: 18 2f mov r17, r24 28672: eb cf rjmp .-42 ; 0x2864a lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 28674: 85 e0 ldi r24, 0x05 ; 5 28676: 1a cf rjmp .-460 ; 0x284ac 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) 28678: c0 90 b1 02 lds r12, 0x02B1 ; 0x8002b1 2867c: d0 90 b2 02 lds r13, 0x02B2 ; 0x8002b2 print_tr = print_time_remaining_normal; //#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT) 28680: e0 90 af 02 lds r14, 0x02AF ; 0x8002af 28684: f0 90 b0 02 lds r15, 0x02B0 ; 0x8002b0 28688: 25 cf rjmp .-438 ; 0x284d4 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) { 2868a: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 2868c: 12 e5 ldi r17, 0x52 ; 82 2868e: 43 cf rjmp .-378 ; 0x28516 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 = ' '; 28690: 40 e2 ldi r20, 0x20 ; 32 28692: 5b cf rjmp .-330 ; 0x2854a } 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); 28694: ff 92 push r15 28696: 4f 93 push r20 28698: ff 93 push r31 2869a: 1f 93 push r17 2869c: 7f 93 push r23 2869e: 6f 93 push r22 286a0: 8b e3 ldi r24, 0x3B ; 59 286a2: 9e e6 ldi r25, 0x6E ; 110 286a4: 9f 93 push r25 286a6: 8f 93 push r24 286a8: 0e 94 39 6e call 0xdc72 ; 0xdc72 286ac: 6d cf rjmp .-294 ; 0x28588 } 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); 286ae: 85 ea ldi r24, 0xA5 ; 165 286b0: 9d e0 ldi r25, 0x0D ; 13 286b2: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 286b6: bc 01 movw r22, r24 286b8: 90 e0 ldi r25, 0x00 ; 0 286ba: 80 e0 ldi r24, 0x00 ; 0 286bc: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 286c0: 20 e0 ldi r18, 0x00 ; 0 286c2: 30 e0 ldi r19, 0x00 ; 0 286c4: 4a e7 ldi r20, 0x7A ; 122 286c6: 54 e4 ldi r21, 0x44 ; 68 286c8: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 286cc: 9f 93 push r25 286ce: 8f 93 push r24 286d0: 7f 93 push r23 286d2: 6f 93 push r22 286d4: 89 e9 ldi r24, 0x99 ; 153 286d6: 9f e9 ldi r25, 0x9F ; 159 286d8: 9f 93 push r25 286da: 8f 93 push r24 286dc: 0e 94 39 6e call 0xdc72 ; 0xdc72 286e0: 0f 90 pop r0 286e2: 0f 90 pop r0 286e4: 0f 90 pop r0 286e6: 0f 90 pop r0 286e8: 0f 90 pop r0 286ea: 0f 90 pop r0 286ec: 52 cf rjmp .-348 ; 0x28592 000286ee : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 286ee: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d startTimestamp = 0; 286f2: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 286f6: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 286fa: 10 92 a9 05 sts 0x05A9, r1 ; 0x8005a9 286fe: 10 92 aa 05 sts 0x05AA, r1 ; 0x8005aa stopTimestamp = 0; 28702: 10 92 52 06 sts 0x0652, r1 ; 0x800652 28706: 10 92 53 06 sts 0x0653, r1 ; 0x800653 2870a: 10 92 54 06 sts 0x0654, r1 ; 0x800654 2870e: 10 92 55 06 sts 0x0655, r1 ; 0x800655 accumulator = 0; 28712: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 28716: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 2871a: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 2871e: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 } 28722: 08 95 ret 00028724 : /** * @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; } 28724: 80 91 9d 03 lds r24, 0x039D ; 0x80039d } else return false; } bool Stopwatch::start() { if (!isRunning()) { 28728: 81 30 cpi r24, 0x01 ; 1 2872a: f1 f0 breq .+60 ; 0x28768 if (isPaused()) accumulator = duration(); 2872c: 82 30 cpi r24, 0x02 ; 2 2872e: c9 f4 brne .+50 ; 0x28762 28730: 0f 94 a8 3f call 0x27f50 ; 0x27f50 28734: 60 93 a3 05 sts 0x05A3, r22 ; 0x8005a3 28738: 70 93 a4 05 sts 0x05A4, r23 ; 0x8005a4 2873c: 80 93 a5 05 sts 0x05A5, r24 ; 0x8005a5 28740: 90 93 a6 05 sts 0x05A6, r25 ; 0x8005a6 else reset(); state = RUNNING; 28744: 81 e0 ldi r24, 0x01 ; 1 28746: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d startTimestamp = _millis(); 2874a: 0f 94 51 2a call 0x254a2 ; 0x254a2 2874e: 60 93 a7 05 sts 0x05A7, r22 ; 0x8005a7 28752: 70 93 a8 05 sts 0x05A8, r23 ; 0x8005a8 28756: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 2875a: 90 93 aa 05 sts 0x05AA, r25 ; 0x8005aa 2875e: 81 e0 ldi r24, 0x01 ; 1 28760: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 28762: 0f 94 77 43 call 0x286ee ; 0x286ee 28766: ee cf rjmp .-36 ; 0x28744 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 28768: 80 e0 ldi r24, 0x00 ; 0 } 2876a: 08 95 ret 0002876c : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 2876c: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 28770: 81 50 subi r24, 0x01 ; 1 28772: 82 30 cpi r24, 0x02 ; 2 28774: 70 f4 brcc .+28 ; 0x28792 state = STOPPED; 28776: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d stopTimestamp = _millis(); 2877a: 0f 94 51 2a call 0x254a2 ; 0x254a2 2877e: 60 93 52 06 sts 0x0652, r22 ; 0x800652 28782: 70 93 53 06 sts 0x0653, r23 ; 0x800653 28786: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2878a: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2878e: 81 e0 ldi r24, 0x01 ; 1 28790: 08 95 ret return true; } else return false; 28792: 80 e0 ldi r24, 0x00 ; 0 } 28794: 08 95 ret 00028796 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 28796: 2f b7 in r18, 0x3f ; 63 28798: f8 94 cli count_pos = count_position[axis]; 2879a: 94 e0 ldi r25, 0x04 ; 4 2879c: 89 9f mul r24, r25 2879e: f0 01 movw r30, r0 287a0: 11 24 eor r1, r1 287a2: ed 54 subi r30, 0x4D ; 77 287a4: f9 4f sbci r31, 0xF9 ; 249 287a6: 60 81 ld r22, Z 287a8: 71 81 ldd r23, Z+1 ; 0x01 287aa: 82 81 ldd r24, Z+2 ; 0x02 287ac: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 287ae: 2f bf out 0x3f, r18 ; 63 return count_pos; } 287b0: 08 95 ret 000287b2 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 287b2: cf 93 push r28 287b4: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 287b6: 0f 94 cb 43 call 0x28796 ; 0x28796 287ba: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 287be: 24 e0 ldi r18, 0x04 ; 4 287c0: c2 9f mul r28, r18 287c2: f0 01 movw r30, r0 287c4: 11 24 eor r1, r1 287c6: ee 53 subi r30, 0x3E ; 62 287c8: f2 4f sbci r31, 0xF2 ; 242 287ca: 20 81 ld r18, Z 287cc: 31 81 ldd r19, Z+1 ; 0x01 287ce: 42 81 ldd r20, Z+2 ; 0x02 287d0: 53 81 ldd r21, Z+3 ; 0x03 287d2: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> } 287d6: cf 91 pop r28 287d8: 08 95 ret 000287da : } // Block until all buffered steps are executed void st_synchronize() { 287da: cf 93 push r28 287dc: df 93 push r29 287de: 00 d0 rcall .+0 ; 0x287e0 287e0: 1f 92 push r1 287e2: cd b7 in r28, 0x3d ; 61 287e4: 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); 287e6: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 287ea: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while(blocks_queued()) 287ee: 98 17 cp r25, r24 287f0: 09 f4 brne .+2 ; 0x287f4 287f2: 46 c0 rjmp .+140 ; 0x28880 { #ifdef TMC2130 manage_heater(); 287f4: 0f 94 61 39 call 0x272c2 ; 0x272c2 tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 287f8: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.475> 287fc: 84 30 cpi r24, 0x04 ; 4 287fe: 38 f0 brcs .+14 ; 0x2880e // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 28800: 81 e0 ldi r24, 0x01 ; 1 28802: 0e 94 37 8a call 0x1146e ; 0x1146e lcd_update(0); 28806: 80 e0 ldi r24, 0x00 ; 0 28808: 0e 94 27 6e call 0xdc4e ; 0xdc4e 2880c: ec cf rjmp .-40 ; 0x287e6 { uint32_t val32 = 0; 2880e: 19 82 std Y+1, r1 ; 0x01 28810: 1a 82 std Y+2, r1 ; 0x02 28812: 1b 82 std Y+3, r1 ; 0x03 28814: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 28816: ae 01 movw r20, r28 28818: 4f 5f subi r20, 0xFF ; 255 2881a: 5f 4f sbci r21, 0xFF ; 255 2881c: 6f e6 ldi r22, 0x6F ; 111 2881e: 0f 94 f6 24 call 0x249ec ; 0x249ec tmc2130_sg_measure_val += (val32 & 0x3ff); 28822: 89 81 ldd r24, Y+1 ; 0x01 28824: 9a 81 ldd r25, Y+2 ; 0x02 28826: ab 81 ldd r26, Y+3 ; 0x03 28828: bc 81 ldd r27, Y+4 ; 0x04 2882a: 93 70 andi r25, 0x03 ; 3 2882c: aa 27 eor r26, r26 2882e: bb 27 eor r27, r27 28830: 40 91 d1 03 lds r20, 0x03D1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.476> 28834: 50 91 d2 03 lds r21, 0x03D2 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x1> 28838: 60 91 d3 03 lds r22, 0x03D3 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x2> 2883c: 70 91 d4 03 lds r23, 0x03D4 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x3> 28840: 84 0f add r24, r20 28842: 95 1f adc r25, r21 28844: a6 1f adc r26, r22 28846: b7 1f adc r27, r23 28848: 80 93 d1 03 sts 0x03D1, r24 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.476> 2884c: 90 93 d2 03 sts 0x03D2, r25 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x1> 28850: a0 93 d3 03 sts 0x03D3, r26 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x2> 28854: b0 93 d4 03 sts 0x03D4, r27 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.476+0x3> tmc2130_sg_measure_cnt++; 28858: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.477> 2885c: 90 91 ce 03 lds r25, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x1> 28860: a0 91 cf 03 lds r26, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x2> 28864: b0 91 d0 03 lds r27, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x3> 28868: 01 96 adiw r24, 0x01 ; 1 2886a: a1 1d adc r26, r1 2886c: b1 1d adc r27, r1 2886e: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.477> 28872: 90 93 ce 03 sts 0x03CE, r25 ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x1> 28876: a0 93 cf 03 sts 0x03CF, r26 ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x2> 2887a: b0 93 d0 03 sts 0x03D0, r27 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.477+0x3> 2887e: b3 cf rjmp .-154 ; 0x287e6 #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 28880: 0f 90 pop r0 28882: 0f 90 pop r0 28884: 0f 90 pop r0 28886: 0f 90 pop r0 28888: df 91 pop r29 2888a: cf 91 pop r28 2888c: 08 95 ret 0002888e : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 2888e: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 28890: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 28894: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 28898: 80 ed ldi r24, 0xD0 ; 208 2889a: 97 e0 ldi r25, 0x07 ; 7 2889c: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 288a0: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 288a4: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 288a8: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 288ac: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> 288b0: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 288b4: 01 97 sbiw r24, 0x01 ; 1 288b6: 8e 3f cpi r24, 0xFE ; 254 288b8: 9f 4f sbci r25, 0xFF ; 255 288ba: 20 f4 brcc .+8 ; 0x288c4 nextAdvanceISR = 0; 288bc: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 288c0: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> #endif } 288c4: 08 95 ret 000288c6 <__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) { 288c6: 1f 92 push r1 288c8: 0f 92 push r0 288ca: 0f b6 in r0, 0x3f ; 63 288cc: 0f 92 push r0 288ce: 11 24 eor r1, r1 288d0: 0b b6 in r0, 0x3b ; 59 288d2: 0f 92 push r0 288d4: 6f 92 push r6 288d6: 7f 92 push r7 288d8: 8f 92 push r8 288da: cf 92 push r12 288dc: df 92 push r13 288de: ef 92 push r14 288e0: ff 92 push r15 288e2: 0f 93 push r16 288e4: 1f 93 push r17 288e6: 2f 93 push r18 288e8: 3f 93 push r19 288ea: 4f 93 push r20 288ec: 5f 93 push r21 288ee: 6f 93 push r22 288f0: 7f 93 push r23 288f2: 8f 93 push r24 288f4: 9f 93 push r25 288f6: af 93 push r26 288f8: bf 93 push r27 288fa: cf 93 push r28 288fc: df 93 push r29 288fe: ef 93 push r30 28900: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 28902: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> 28906: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 2890a: 9c 01 movw r18, r24 2890c: 21 50 subi r18, 0x01 ; 1 2890e: 31 09 sbc r19, r1 28910: 2e 3f cpi r18, 0xFE ; 254 28912: 3f 4f sbci r19, 0xFF ; 255 28914: 90 f4 brcc .+36 ; 0x2893a <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 28916: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2891a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2891e: 28 17 cp r18, r24 28920: 39 07 cpc r19, r25 28922: 08 f0 brcs .+2 ; 0x28926 <__vector_17+0x60> 28924: f9 c0 rjmp .+498 ; 0x28b18 <__vector_17+0x252> nextAdvanceISR -= OCR1A; 28926: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2892a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2892e: 82 1b sub r24, r18 28930: 93 0b sbc r25, r19 28932: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 28936: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2893a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2893e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28942: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> 28946: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 2894a: 28 17 cp r18, r24 2894c: 39 07 cpc r19, r25 2894e: 08 f0 brcs .+2 ; 0x28952 <__vector_17+0x8c> 28950: e8 c0 rjmp .+464 ; 0x28b22 <__vector_17+0x25c> nextMainISR -= OCR1A; 28952: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 28956: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2895a: 82 1b sub r24, r18 2895c: 93 0b sbc r25, r19 2895e: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 28962: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 28966: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> 2896a: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 2896e: 89 2b or r24, r25 28970: 11 f0 breq .+4 ; 0x28976 <__vector_17+0xb0> 28972: 0d 94 b3 4d jmp 0x29b66 ; 0x29b66 <__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) 28976: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 2897a: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 2897e: 30 97 sbiw r30, 0x00 ; 0 28980: 09 f0 breq .+2 ; 0x28984 <__vector_17+0xbe> 28982: 87 c1 rjmp .+782 ; 0x28c92 <__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) { 28984: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 28988: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 2898c: 98 17 cp r25, r24 2898e: 09 f4 brne .+2 ; 0x28992 <__vector_17+0xcc> 28990: f9 c1 rjmp .+1010 ; 0x28d84 <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 28992: c0 91 a6 0d lds r28, 0x0DA6 ; 0x800da6 28996: 2c 2f mov r18, r28 28998: 30 e0 ldi r19, 0x00 ; 0 2899a: 5e e6 ldi r21, 0x6E ; 110 2899c: c5 9f mul r28, r21 2899e: e0 01 movw r28, r0 289a0: 11 24 eor r1, r1 289a2: cb 53 subi r28, 0x3B ; 59 289a4: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 289a6: fe 01 movw r30, r28 289a8: e9 5b subi r30, 0xB9 ; 185 289aa: ff 4f sbci r31, 0xFF ; 255 289ac: 41 e0 ldi r20, 0x01 ; 1 289ae: 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(); 289b0: d0 93 a2 05 sts 0x05A2, r29 ; 0x8005a2 289b4: c0 93 a1 05 sts 0x05A1, r28 ; 0x8005a1 if (current_block != NULL) { 289b8: 20 97 sbiw r28, 0x00 ; 0 289ba: 09 f4 brne .+2 ; 0x289be <__vector_17+0xf8> 289bc: e3 c1 rjmp .+966 ; 0x28d84 <__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; 289be: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d 289c2: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e 289c6: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f 289ca: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 // 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; 289ce: 10 92 9c 05 sts 0x059C, r1 ; 0x80059c acc_step_rate = uint16_t(current_block->initial_rate); 289d2: 8a ad ldd r24, Y+58 ; 0x3a 289d4: 9b ad ldd r25, Y+59 ; 0x3b 289d6: 90 93 9b 05 sts 0x059B, r25 ; 0x80059b 289da: 80 93 9a 05 sts 0x059A, r24 ; 0x80059a #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 289de: 81 34 cpi r24, 0x41 ; 65 289e0: ec e9 ldi r30, 0x9C ; 156 289e2: 9e 07 cpc r25, r30 289e4: 08 f0 brcs .+2 ; 0x289e8 <__vector_17+0x122> 289e6: a2 c0 rjmp .+324 ; 0x28b2c <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 289e8: 81 32 cpi r24, 0x21 ; 33 289ea: fe e4 ldi r31, 0x4E ; 78 289ec: 9f 07 cpc r25, r31 289ee: 08 f4 brcc .+2 ; 0x289f2 <__vector_17+0x12c> 289f0: a0 c0 rjmp .+320 ; 0x28b32 <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 289f2: 96 95 lsr r25 289f4: 87 95 ror r24 289f6: 96 95 lsr r25 289f8: 87 95 ror r24 step_loops = 4; 289fa: 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; 289fc: 40 93 99 05 sts 0x0599, r20 ; 0x800599 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 28a00: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 28a02: 81 15 cp r24, r1 28a04: e8 e0 ldi r30, 0x08 ; 8 28a06: 9e 07 cpc r25, r30 28a08: 08 f4 brcc .+2 ; 0x28a0c <__vector_17+0x146> 28a0a: a4 c0 rjmp .+328 ; 0x28b54 <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 28a0c: e9 2f mov r30, r25 28a0e: ff 27 eor r31, r31 28a10: ee 0f add r30, r30 28a12: ff 1f adc r31, r31 28a14: ee 0f add r30, r30 28a16: ff 1f adc r31, r31 28a18: af 01 movw r20, r30 28a1a: 47 59 subi r20, 0x97 ; 151 28a1c: 5a 46 sbci r21, 0x6A ; 106 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 28a1e: fa 01 movw r30, r20 28a20: 32 96 adiw r30, 0x02 ; 2 28a22: a5 91 lpm r26, Z+ 28a24: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 28a26: fa 01 movw r30, r20 28a28: 45 91 lpm r20, Z+ 28a2a: 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. ); 28a2c: b8 9f mul r27, r24 28a2e: b0 01 movw r22, r0 28a30: a8 9f mul r26, r24 28a32: 00 0c add r0, r0 28a34: 61 1d adc r22, r1 28a36: 11 24 eor r1, r1 28a38: 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); 28a3a: ca 01 movw r24, r20 28a3c: 86 1b sub r24, r22 28a3e: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 28a40: 84 36 cpi r24, 0x64 ; 100 28a42: 91 05 cpc r25, r1 28a44: 10 f4 brcc .+4 ; 0x28a4a <__vector_17+0x184> 28a46: 84 e6 ldi r24, 0x64 ; 100 28a48: 90 e0 ldi r25, 0x00 ; 0 28a4a: b0 e0 ldi r27, 0x00 ; 0 28a4c: a0 e0 ldi r26, 0x00 ; 0 28a4e: 80 93 95 05 sts 0x0595, r24 ; 0x800595 28a52: 90 93 96 05 sts 0x0596, r25 ; 0x800596 28a56: a0 93 97 05 sts 0x0597, r26 ; 0x800597 28a5a: b0 93 98 05 sts 0x0598, r27 ; 0x800598 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 28a5e: 4e e6 ldi r20, 0x6E ; 110 28a60: 42 9f mul r20, r18 28a62: c0 01 movw r24, r0 28a64: 43 9f mul r20, r19 28a66: 90 0d add r25, r0 28a68: 11 24 eor r1, r1 28a6a: 8b 53 subi r24, 0x3B ; 59 28a6c: 99 4f sbci r25, 0xF9 ; 249 28a6e: fc 01 movw r30, r24 28a70: e4 5b subi r30, 0xB4 ; 180 28a72: ff 4f sbci r31, 0xFF ; 255 28a74: 40 81 ld r20, Z 28a76: 44 23 and r20, r20 28a78: 49 f0 breq .+18 ; 0x28a8c <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 28a7a: 81 5b subi r24, 0xB1 ; 177 28a7c: 9f 4f sbci r25, 0xFF ; 255 28a7e: fc 01 movw r30, r24 28a80: 80 81 ld r24, Z 28a82: 91 81 ldd r25, Z+1 ; 0x01 28a84: 90 93 94 05 sts 0x0594, r25 ; 0x800594 28a88: 80 93 93 05 sts 0x0593, r24 ; 0x800593 } e_steps = 0; 28a8c: 10 92 92 05 sts 0x0592, r1 ; 0x800592 nextAdvanceISR = ADV_NEVER; 28a90: 8f ef ldi r24, 0xFF ; 255 28a92: 9f ef ldi r25, 0xFF ; 255 28a94: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 28a98: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> LA_phase = -1; 28a9c: 80 93 91 05 sts 0x0591, r24 ; 0x800591 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 28aa0: 8e e6 ldi r24, 0x6E ; 110 28aa2: 82 9f mul r24, r18 28aa4: f0 01 movw r30, r0 28aa6: 83 9f mul r24, r19 28aa8: f0 0d add r31, r0 28aaa: 11 24 eor r1, r1 28aac: eb 53 subi r30, 0x3B ; 59 28aae: f9 4f sbci r31, 0xF9 ; 249 28ab0: 85 a9 ldd r24, Z+53 ; 0x35 28ab2: 84 ff sbrs r24, 4 28ab4: 08 c0 rjmp .+16 ; 0x28ac6 <__vector_17+0x200> count_position[E_AXIS] = 0; 28ab6: 10 92 bf 06 sts 0x06BF, r1 ; 0x8006bf 28aba: 10 92 c0 06 sts 0x06C0, r1 ; 0x8006c0 28abe: 10 92 c1 06 sts 0x06C1, r1 ; 0x8006c1 28ac2: 10 92 c2 06 sts 0x06C2, r1 ; 0x8006c2 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 28ac6: 83 ff sbrs r24, 3 28ac8: 66 c0 rjmp .+204 ; 0x28b96 <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 28aca: 8e e6 ldi r24, 0x6E ; 110 28acc: 82 9f mul r24, r18 28ace: f0 01 movw r30, r0 28ad0: 83 9f mul r24, r19 28ad2: f0 0d add r31, r0 28ad4: 11 24 eor r1, r1 28ad6: eb 53 subi r30, 0x3B ; 59 28ad8: f9 4f sbci r31, 0xF9 ; 249 28ada: 80 89 ldd r24, Z+16 ; 0x10 28adc: 91 89 ldd r25, Z+17 ; 0x11 28ade: 96 95 lsr r25 28ae0: 87 95 ror r24 28ae2: 91 95 neg r25 28ae4: 81 95 neg r24 28ae6: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 28ae8: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28aec: 80 93 81 05 sts 0x0581, r24 ; 0x800581 28af0: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28af4: 80 93 85 05 sts 0x0585, r24 ; 0x800585 28af8: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 28afc: 80 93 89 05 sts 0x0589, r24 ; 0x800589 28b00: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 28b04: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 28b08: 81 e0 ldi r24, 0x01 ; 1 28b0a: 24 85 ldd r18, Z+12 ; 0x0c 28b0c: 35 85 ldd r19, Z+13 ; 0x0d 28b0e: 23 2b or r18, r19 28b10: 09 f0 breq .+2 ; 0x28b14 <__vector_17+0x24e> 28b12: 82 c0 rjmp .+260 ; 0x28c18 <__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; 28b14: 80 e0 ldi r24, 0x00 ; 0 28b16: 80 c0 rjmp .+256 ; 0x28c18 <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 28b18: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 28b1c: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> 28b20: 0c cf rjmp .-488 ; 0x2893a <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 28b22: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 28b26: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> 28b2a: 1d cf rjmp .-454 ; 0x28966 <__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; 28b2c: 80 e4 ldi r24, 0x40 ; 64 28b2e: 9c e9 ldi r25, 0x9C ; 156 28b30: 60 cf rjmp .-320 ; 0x289f2 <__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 28b32: 81 31 cpi r24, 0x11 ; 17 28b34: 57 e2 ldi r21, 0x27 ; 39 28b36: 95 07 cpc r25, r21 28b38: 20 f0 brcs .+8 ; 0x28b42 <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 28b3a: 96 95 lsr r25 28b3c: 87 95 ror r24 step_loops = 2; 28b3e: 42 e0 ldi r20, 0x02 ; 2 28b40: 5d cf rjmp .-326 ; 0x289fc <__vector_17+0x136> } else { step_loops = 1; 28b42: 40 93 99 05 sts 0x0599, r20 ; 0x800599 28b46: 80 32 cpi r24, 0x20 ; 32 28b48: 91 05 cpc r25, r1 28b4a: 08 f0 brcs .+2 ; 0x28b4e <__vector_17+0x288> 28b4c: 59 cf rjmp .-334 ; 0x28a00 <__vector_17+0x13a> 28b4e: 80 e2 ldi r24, 0x20 ; 32 28b50: 90 e0 ldi r25, 0x00 ; 0 28b52: 56 cf rjmp .-340 ; 0x28a00 <__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; 28b54: ac 01 movw r20, r24 28b56: 56 95 lsr r21 28b58: 47 95 ror r20 28b5a: 4c 7f andi r20, 0xFC ; 252 28b5c: 47 59 subi r20, 0x97 ; 151 28b5e: 5e 46 sbci r21, 0x6E ; 110 timer = (unsigned short)pgm_read_word_near(table_address); 28b60: fa 01 movw r30, r20 28b62: 65 91 lpm r22, Z+ 28b64: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 28b66: fa 01 movw r30, r20 28b68: 32 96 adiw r30, 0x02 ; 2 28b6a: a5 91 lpm r26, Z+ 28b6c: b4 91 lpm r27, Z 28b6e: ac 01 movw r20, r24 28b70: 47 70 andi r20, 0x07 ; 7 28b72: 55 27 eor r21, r21 28b74: 4a 9f mul r20, r26 28b76: c0 01 movw r24, r0 28b78: 4b 9f mul r20, r27 28b7a: 90 0d add r25, r0 28b7c: 5a 9f mul r21, r26 28b7e: 90 0d add r25, r0 28b80: 11 24 eor r1, r1 28b82: e3 e0 ldi r30, 0x03 ; 3 28b84: 96 95 lsr r25 28b86: 87 95 ror r24 28b88: ea 95 dec r30 28b8a: e1 f7 brne .-8 ; 0x28b84 <__vector_17+0x2be> 28b8c: ab 01 movw r20, r22 28b8e: 48 1b sub r20, r24 28b90: 59 0b sbc r21, r25 28b92: ca 01 movw r24, r20 28b94: 55 cf rjmp .-342 ; 0x28a40 <__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); 28b96: 8e e6 ldi r24, 0x6E ; 110 28b98: 82 9f mul r24, r18 28b9a: f0 01 movw r30, r0 28b9c: 83 9f mul r24, r19 28b9e: f0 0d add r31, r0 28ba0: 11 24 eor r1, r1 28ba2: eb 53 subi r30, 0x3B ; 59 28ba4: f9 4f sbci r31, 0xF9 ; 249 28ba6: 80 89 ldd r24, Z+16 ; 0x10 28ba8: 91 89 ldd r25, Z+17 ; 0x11 28baa: a2 89 ldd r26, Z+18 ; 0x12 28bac: b3 89 ldd r27, Z+19 ; 0x13 28bae: b6 95 lsr r27 28bb0: a7 95 ror r26 28bb2: 97 95 ror r25 28bb4: 87 95 ror r24 28bb6: b0 95 com r27 28bb8: a0 95 com r26 28bba: 90 95 com r25 28bbc: 81 95 neg r24 28bbe: 9f 4f sbci r25, 0xFF ; 255 28bc0: af 4f sbci r26, 0xFF ; 255 28bc2: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 28bc4: 80 93 81 05 sts 0x0581, r24 ; 0x800581 28bc8: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28bcc: a0 93 83 05 sts 0x0583, r26 ; 0x800583 28bd0: b0 93 84 05 sts 0x0584, r27 ; 0x800584 28bd4: 80 93 85 05 sts 0x0585, r24 ; 0x800585 28bd8: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28bdc: a0 93 87 05 sts 0x0587, r26 ; 0x800587 28be0: b0 93 88 05 sts 0x0588, r27 ; 0x800588 28be4: 80 93 89 05 sts 0x0589, r24 ; 0x800589 28be8: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 28bec: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 28bf0: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c 28bf4: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 28bf8: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 28bfc: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 28c00: b0 93 90 05 sts 0x0590, r27 ; 0x800590 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 28c04: 81 e0 ldi r24, 0x01 ; 1 28c06: 44 85 ldd r20, Z+12 ; 0x0c 28c08: 55 85 ldd r21, Z+13 ; 0x0d 28c0a: 66 85 ldd r22, Z+14 ; 0x0e 28c0c: 77 85 ldd r23, Z+15 ; 0x0f 28c0e: 45 2b or r20, r21 28c10: 46 2b or r20, r22 28c12: 47 2b or r20, r23 28c14: 09 f4 brne .+2 ; 0x28c18 <__vector_17+0x352> 28c16: 7e cf rjmp .-260 ; 0x28b14 <__vector_17+0x24e> 28c18: 80 93 80 05 sts 0x0580, r24 ; 0x800580 #endif } step_events_completed.wide = 0; 28c1c: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 28c20: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 28c24: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e 28c28: 10 92 7f 05 sts 0x057F, r1 ; 0x80057f // Set directions. out_bits = current_block->direction_bits; 28c2c: 88 8d ldd r24, Y+24 ; 0x18 28c2e: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b // 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); 28c36: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28c3a: 81 60 ori r24, 0x01 ; 1 28c3c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 28c40: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 28c42: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } if((out_bits & (1< 28c4a: 81 ff sbrs r24, 1 28c4c: 8b c0 rjmp .+278 ; 0x28d64 <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 28c4e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28c52: 8d 7f andi r24, 0xFD ; 253 28c54: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 28c58: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 28c5a: 80 93 98 02 sts 0x0298, r24 ; 0x800298 } if ((out_bits & (1< 28c62: 82 ff sbrs r24, 2 28c64: 86 c0 rjmp .+268 ; 0x28d72 <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 28c66: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28c6a: 84 60 ori r24, 0x04 ; 4 28c6c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 28c70: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 28c72: 80 93 99 02 sts 0x0299, r24 ; 0x800299 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 28c76: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 28c7a: 83 ff sbrs r24, 3 28c7c: 81 c0 rjmp .+258 ; 0x28d80 <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 28c7e: 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; 28c80: 80 93 9a 02 sts 0x029A, r24 ; 0x80029a //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) 28c84: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28c88: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28c8c: 30 97 sbiw r30, 0x00 ; 0 28c8e: 09 f4 brne .+2 ; 0x28c92 <__vector_17+0x3cc> 28c90: 3d c7 rjmp .+3706 ; 0x29b0c <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 28c92: 80 91 b7 02 lds r24, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> 28c96: 50 91 78 05 lds r21, 0x0578 ; 0x800578 28c9a: 88 23 and r24, r24 28c9c: 09 f4 brne .+2 ; 0x28ca0 <__vector_17+0x3da> 28c9e: cb c0 rjmp .+406 ; 0x28e36 <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 28ca0: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.482> uint8_t _endstop = endstop; 28ca4: 80 91 7a 05 lds r24, 0x057A ; 0x80057a uint8_t _old_endstop = old_endstop; 28ca8: 90 91 79 05 lds r25, 0x0579 ; 0x800579 #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))); 28cb0: 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))); 28cb8: 42 fd sbrc r20, 2 28cba: 83 c0 rjmp .+262 ; 0x28dc2 <__vector_17+0x4fc> 28cbc: 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)) { 28cbe: 49 2f mov r20, r25 28cc0: 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)){ 28cc2: 48 23 and r20, r24 28cc4: b1 f0 breq .+44 ; 0x28cf2 <__vector_17+0x42c> 28cc6: c0 80 ld r12, Z 28cc8: d1 80 ldd r13, Z+1 ; 0x01 28cca: e2 80 ldd r14, Z+2 ; 0x02 28ccc: f3 80 ldd r15, Z+3 ; 0x03 28cce: 1c 14 cp r1, r12 28cd0: 1d 04 cpc r1, r13 28cd2: 1e 04 cpc r1, r14 28cd4: 1f 04 cpc r1, r15 28cd6: 6c f4 brge .+26 ; 0x28cf2 <__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); 28cd8: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 28cda: c0 88 ldd r12, Z+16 ; 0x10 28cdc: d1 88 ldd r13, Z+17 ; 0x11 28cde: e2 88 ldd r14, Z+18 ; 0x12 28ce0: f3 88 ldd r15, Z+19 ; 0x13 28ce2: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28ce6: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28cea: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28cee: f0 92 7f 05 sts 0x057F, r15 ; 0x80057f #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))); 28cf2: 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))); 28cfa: 47 fd sbrc r20, 7 28cfc: 6c c0 rjmp .+216 ; 0x28dd6 <__vector_17+0x510> 28cfe: 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)) { 28d00: 49 2f mov r20, r25 28d02: 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)){ 28d04: 48 23 and r20, r24 28d06: b1 f0 breq .+44 ; 0x28d34 <__vector_17+0x46e> 28d08: c4 80 ldd r12, Z+4 ; 0x04 28d0a: d5 80 ldd r13, Z+5 ; 0x05 28d0c: e6 80 ldd r14, Z+6 ; 0x06 28d0e: f7 80 ldd r15, Z+7 ; 0x07 28d10: 1c 14 cp r1, r12 28d12: 1d 04 cpc r1, r13 28d14: 1e 04 cpc r1, r14 28d16: 1f 04 cpc r1, r15 28d18: 6c f4 brge .+26 ; 0x28d34 <__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); 28d1a: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 28d1c: c0 88 ldd r12, Z+16 ; 0x10 28d1e: d1 88 ldd r13, Z+17 ; 0x11 28d20: e2 88 ldd r14, Z+18 ; 0x12 28d22: f3 88 ldd r15, Z+19 ; 0x13 28d24: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28d28: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28d2c: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28d30: f0 92 7f 05 sts 0x057F, r15 ; 0x80057f } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 28d38: 51 11 cpse r21, r1 28d3a: 77 c0 rjmp .+238 ; 0x28e2a <__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)) 28d3c: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28d40: 31 30 cpi r19, 0x01 ; 1 28d42: 09 f0 breq .+2 ; 0x28d46 <__vector_17+0x480> 28d44: 52 c0 rjmp .+164 ; 0x28dea <__vector_17+0x524> 28d46: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28d4a: 32 fd sbrc r19, 2 28d4c: 4e c0 rjmp .+156 ; 0x28dea <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 28d4e: 1c 9b sbis 0x03, 4 ; 3 28d50: 52 c0 rjmp .+164 ; 0x28df6 <__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))); 28d52: 84 60 ori r24, 0x04 ; 4 28d54: 51 c0 rjmp .+162 ; 0x28df8 <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 28d5a: 8e 7f andi r24, 0xFE ; 254 28d5c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 28d60: 81 e0 ldi r24, 0x01 ; 1 28d62: 6f cf rjmp .-290 ; 0x28c42 <__vector_17+0x37c> } if((out_bits & (1< 28d68: 82 60 ori r24, 0x02 ; 2 28d6a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 28d6e: 81 e0 ldi r24, 0x01 ; 1 28d70: 74 cf rjmp .-280 ; 0x28c5a <__vector_17+0x394> } if ((out_bits & (1< 28d76: 8b 7f andi r24, 0xFB ; 251 28d78: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 28d7c: 81 e0 ldi r24, 0x01 ; 1 28d7e: 79 cf rjmp .-270 ; 0x28c72 <__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; 28d80: 81 e0 ldi r24, 0x01 ; 1 28d82: 7e cf rjmp .-260 ; 0x28c80 <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 28d84: 80 ed ldi r24, 0xD0 ; 208 28d86: 97 e0 ldi r25, 0x07 ; 7 28d88: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 28d8c: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> 28d90: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.480+0x1> 28d94: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.480> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 28d98: 8f ef ldi r24, 0xFF ; 255 28d9a: 9f ef ldi r25, 0xFF ; 255 28d9c: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 28da0: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> e_steps = 0; 28da4: 10 92 92 05 sts 0x0592, r1 ; 0x800592 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 28da8: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 28dac: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 28db0: 00 97 sbiw r24, 0x00 ; 0 28db2: 09 f4 brne .+2 ; 0x28db6 <__vector_17+0x4f0> 28db4: 67 cf rjmp .-306 ; 0x28c84 <__vector_17+0x3be> --current_adv_steps; 28db6: 01 97 sbiw r24, 0x01 ; 1 28db8: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 28dbc: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 28dc0: 61 cf rjmp .-318 ; 0x28c84 <__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))); 28dc2: 8e 7f andi r24, 0xFE ; 254 28dc4: 7c cf rjmp .-264 ; 0x28cbe <__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))); 28dc6: 42 fd sbrc r20, 2 28dc8: 04 c0 rjmp .+8 ; 0x28dd2 <__vector_17+0x50c> 28dca: 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)){ 28dcc: 49 2f mov r20, r25 28dce: 40 71 andi r20, 0x10 ; 16 28dd0: 78 cf rjmp .-272 ; 0x28cc2 <__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))); 28dd2: 8f 7e andi r24, 0xEF ; 239 28dd4: fb cf rjmp .-10 ; 0x28dcc <__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))); 28dd6: 8d 7f andi r24, 0xFD ; 253 28dd8: 93 cf rjmp .-218 ; 0x28d00 <__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))); 28dda: 47 fd sbrc r20, 7 28ddc: 04 c0 rjmp .+8 ; 0x28de6 <__vector_17+0x520> 28dde: 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)){ 28de0: 49 2f mov r20, r25 28de2: 40 72 andi r20, 0x20 ; 32 28de4: 8f cf rjmp .-226 ; 0x28d04 <__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))); 28de6: 8f 7d andi r24, 0xDF ; 223 28de8: fb cf rjmp .-10 ; 0x28de0 <__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))); 28dea: 1c 99 sbic 0x03, 4 ; 3 28dec: b2 cf rjmp .-156 ; 0x28d52 <__vector_17+0x48c> 28dee: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28df2: 36 ff sbrs r19, 6 28df4: ae cf rjmp .-164 ; 0x28d52 <__vector_17+0x48c> 28df6: 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)) { 28df8: 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)) { 28dfa: 98 23 and r25, r24 28dfc: b1 f0 breq .+44 ; 0x28e2a <__vector_17+0x564> 28dfe: c0 84 ldd r12, Z+8 ; 0x08 28e00: d1 84 ldd r13, Z+9 ; 0x09 28e02: e2 84 ldd r14, Z+10 ; 0x0a 28e04: f3 84 ldd r15, Z+11 ; 0x0b 28e06: 1c 14 cp r1, r12 28e08: 1d 04 cpc r1, r13 28e0a: 1e 04 cpc r1, r14 28e0c: 1f 04 cpc r1, r15 28e0e: 6c f4 brge .+26 ; 0x28e2a <__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); 28e10: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 28e12: c0 88 ldd r12, Z+16 ; 0x10 28e14: d1 88 ldd r13, Z+17 ; 0x11 28e16: e2 88 ldd r14, Z+18 ; 0x12 28e18: f3 88 ldd r15, Z+19 ; 0x13 28e1a: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28e1e: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28e22: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28e26: f0 92 7f 05 sts 0x057F, r15 ; 0x80057f } #endif } endstop = _endstop; 28e2a: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a old_endstop = _endstop; //apply current endstop state to the old endstop 28e2e: 80 93 79 05 sts 0x0579, r24 ; 0x800579 endstop_hit = _endstop_hit; 28e32: 20 93 0b 05 sts 0x050B, r18 ; 0x80050b <_ZL11endstop_hit.lto_priv.482> } // 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) { 28e36: 55 23 and r21, r21 28e38: 09 f4 brne .+2 ; 0x28e3c <__vector_17+0x576> 28e3a: 40 c0 rjmp .+128 ; 0x28ebc <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 28e3c: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.482> uint8_t _endstop = endstop; 28e40: 80 91 7a 05 lds r24, 0x057A ; 0x80057a uint8_t _old_endstop = old_endstop; 28e44: 90 91 79 05 lds r25, 0x0579 ; 0x800579 // 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)) 28e48: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28e4c: 31 30 cpi r19, 0x01 ; 1 28e4e: c9 f4 brne .+50 ; 0x28e82 <__vector_17+0x5bc> 28e50: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28e54: 32 fd sbrc r19, 2 28e56: 15 c0 rjmp .+42 ; 0x28e82 <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 28e58: 1c 9b sbis 0x03, 4 ; 3 28e5a: 19 c0 rjmp .+50 ; 0x28e8e <__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))); 28e5c: 84 60 ori r24, 0x04 ; 4 28e5e: 18 c0 rjmp .+48 ; 0x28e90 <__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)) 28e60: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28e64: 31 30 cpi r19, 0x01 ; 1 28e66: 31 f4 brne .+12 ; 0x28e74 <__vector_17+0x5ae> 28e68: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28e6c: 32 fd sbrc r19, 2 28e6e: 02 c0 rjmp .+4 ; 0x28e74 <__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))); 28e70: 8f 7b andi r24, 0xBF ; 191 28e72: 05 c0 rjmp .+10 ; 0x28e7e <__vector_17+0x5b8> 28e74: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28e78: 36 fd sbrc r19, 6 28e7a: fa cf rjmp .-12 ; 0x28e70 <__vector_17+0x5aa> 28e7c: 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)) { 28e7e: 90 74 andi r25, 0x40 ; 64 28e80: bc cf rjmp .-136 ; 0x28dfa <__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))); 28e82: 1c 99 sbic 0x03, 4 ; 3 28e84: eb cf rjmp .-42 ; 0x28e5c <__vector_17+0x596> 28e86: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28e8a: 36 ff sbrs r19, 6 28e8c: e7 cf rjmp .-50 ; 0x28e5c <__vector_17+0x596> 28e8e: 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)) { 28e90: 94 70 andi r25, 0x04 ; 4 28e92: 98 23 and r25, r24 28e94: 69 f0 breq .+26 ; 0x28eb0 <__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); 28e96: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 28e98: 40 89 ldd r20, Z+16 ; 0x10 28e9a: 51 89 ldd r21, Z+17 ; 0x11 28e9c: 62 89 ldd r22, Z+18 ; 0x12 28e9e: 73 89 ldd r23, Z+19 ; 0x13 28ea0: 40 93 7c 05 sts 0x057C, r20 ; 0x80057c 28ea4: 50 93 7d 05 sts 0x057D, r21 ; 0x80057d 28ea8: 60 93 7e 05 sts 0x057E, r22 ; 0x80057e 28eac: 70 93 7f 05 sts 0x057F, r23 ; 0x80057f } endstop = _endstop; 28eb0: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a old_endstop = _endstop; //apply current endstop state to the old endstop 28eb4: 80 93 79 05 sts 0x0579, r24 ; 0x800579 endstop_hit = _endstop_hit; 28eb8: 20 93 0b 05 sts 0x050B, r18 ; 0x80050b <_ZL11endstop_hit.lto_priv.482> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 28ebc: 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) 28ebe: 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); 28ec0: 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); 28ec2: 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); 28ec4: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 28ec6: 83 ff sbrs r24, 3 28ec8: 08 c1 rjmp .+528 ; 0x290da <__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) 28eca: 80 91 99 05 lds r24, 0x0599 ; 0x800599 28ece: c8 17 cp r28, r24 28ed0: 08 f0 brcs .+2 ; 0x28ed4 <__vector_17+0x60e> 28ed2: 72 c2 rjmp .+1252 ; 0x293b8 <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 28ed4: 0f 94 1a 15 call 0x22a34 ; 0x22a34 // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 28ed8: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28edc: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28ee0: 80 81 ld r24, Z 28ee2: 91 81 ldd r25, Z+1 ; 0x01 28ee4: 20 91 81 05 lds r18, 0x0581 ; 0x800581 28ee8: 30 91 82 05 lds r19, 0x0582 ; 0x800582 28eec: 82 0f add r24, r18 28eee: 93 1f adc r25, r19 28ef0: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28ef4: 80 93 81 05 sts 0x0581, r24 ; 0x800581 if (counter[X_AXIS].lo > 0) { 28ef8: 18 16 cp r1, r24 28efa: 19 06 cpc r1, r25 28efc: 64 f5 brge .+88 ; 0x28f56 <__vector_17+0x690> STEP_NC_HI(X_AXIS); 28efe: 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; 28f00: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28f04: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28f08: 80 91 81 05 lds r24, 0x0581 ; 0x800581 28f0c: 90 91 82 05 lds r25, 0x0582 ; 0x800582 28f10: 20 89 ldd r18, Z+16 ; 0x10 28f12: 31 89 ldd r19, Z+17 ; 0x11 28f14: 82 1b sub r24, r18 28f16: 93 0b sbc r25, r19 28f18: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28f1c: 80 93 81 05 sts 0x0581, r24 ; 0x800581 count_position[X_AXIS]+=count_direction[X_AXIS]; 28f20: 90 91 97 02 lds r25, 0x0297 ; 0x800297 28f24: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 28f28: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 28f2c: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 28f30: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 28f34: 89 2f mov r24, r25 28f36: 99 0f add r25, r25 28f38: 99 0b sbc r25, r25 28f3a: aa 0b sbc r26, r26 28f3c: bb 0b sbc r27, r27 28f3e: 84 0f add r24, r20 28f40: 95 1f adc r25, r21 28f42: a6 1f adc r26, r22 28f44: b7 1f adc r27, r23 28f46: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 28f4a: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 28f4e: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 28f52: b0 93 b6 06 sts 0x06B6, r27 ; 0x8006b6 #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; 28f56: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28f5a: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28f5e: 84 81 ldd r24, Z+4 ; 0x04 28f60: 95 81 ldd r25, Z+5 ; 0x05 28f62: 20 91 85 05 lds r18, 0x0585 ; 0x800585 28f66: 30 91 86 05 lds r19, 0x0586 ; 0x800586 28f6a: 82 0f add r24, r18 28f6c: 93 1f adc r25, r19 28f6e: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28f72: 80 93 85 05 sts 0x0585, r24 ; 0x800585 if (counter[Y_AXIS].lo > 0) { 28f76: 18 16 cp r1, r24 28f78: 19 06 cpc r1, r25 28f7a: 44 f5 brge .+80 ; 0x28fcc <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 28f7c: 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; 28f7e: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28f82: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28f86: 20 89 ldd r18, Z+16 ; 0x10 28f88: 31 89 ldd r19, Z+17 ; 0x11 28f8a: 82 1b sub r24, r18 28f8c: 93 0b sbc r25, r19 28f8e: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28f92: 80 93 85 05 sts 0x0585, r24 ; 0x800585 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 28f96: 90 91 98 02 lds r25, 0x0298 ; 0x800298 28f9a: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 28f9e: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 28fa2: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 28fa6: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 28faa: 89 2f mov r24, r25 28fac: 99 0f add r25, r25 28fae: 99 0b sbc r25, r25 28fb0: aa 0b sbc r26, r26 28fb2: bb 0b sbc r27, r27 28fb4: 84 0f add r24, r20 28fb6: 95 1f adc r25, r21 28fb8: a6 1f adc r26, r22 28fba: b7 1f adc r27, r23 28fbc: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 28fc0: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 28fc4: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 28fc8: b0 93 ba 06 sts 0x06BA, r27 ; 0x8006ba #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; 28fcc: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28fd0: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28fd4: 80 85 ldd r24, Z+8 ; 0x08 28fd6: 91 85 ldd r25, Z+9 ; 0x09 28fd8: 20 91 89 05 lds r18, 0x0589 ; 0x800589 28fdc: 30 91 8a 05 lds r19, 0x058A ; 0x80058a 28fe0: 82 0f add r24, r18 28fe2: 93 1f adc r25, r19 28fe4: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 28fe8: 80 93 89 05 sts 0x0589, r24 ; 0x800589 if (counter[Z_AXIS].lo > 0) { 28fec: 18 16 cp r1, r24 28fee: 19 06 cpc r1, r25 28ff0: 44 f5 brge .+80 ; 0x29042 <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 28ff2: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 28ff4: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28ff8: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28ffc: 20 89 ldd r18, Z+16 ; 0x10 28ffe: 31 89 ldd r19, Z+17 ; 0x11 29000: 82 1b sub r24, r18 29002: 93 0b sbc r25, r19 29004: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 29008: 80 93 89 05 sts 0x0589, r24 ; 0x800589 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2900c: 90 91 99 02 lds r25, 0x0299 ; 0x800299 29010: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 29014: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 29018: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 2901c: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 29020: 89 2f mov r24, r25 29022: 99 0f add r25, r25 29024: 99 0b sbc r25, r25 29026: aa 0b sbc r26, r26 29028: bb 0b sbc r27, r27 2902a: 84 0f add r24, r20 2902c: 95 1f adc r25, r21 2902e: a6 1f adc r26, r22 29030: b7 1f adc r27, r23 29032: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 29036: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2903a: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2903e: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 29042: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 29046: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 2904a: 80 91 8d 05 lds r24, 0x058D ; 0x80058d 2904e: 90 91 8e 05 lds r25, 0x058E ; 0x80058e 29052: 24 85 ldd r18, Z+12 ; 0x0c 29054: 35 85 ldd r19, Z+13 ; 0x0d 29056: 82 0f add r24, r18 29058: 93 1f adc r25, r19 2905a: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 2905e: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 29062: 20 89 ldd r18, Z+16 ; 0x10 29064: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 29066: 18 16 cp r1, r24 29068: 19 06 cpc r1, r25 2906a: 44 f5 brge .+80 ; 0x290bc <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 2906c: 82 1b sub r24, r18 2906e: 93 0b sbc r25, r19 29070: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 29074: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d count_position[E_AXIS] += count_direction[E_AXIS]; 29078: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 2907c: 40 91 bf 06 lds r20, 0x06BF ; 0x8006bf 29080: 50 91 c0 06 lds r21, 0x06C0 ; 0x8006c0 29084: 60 91 c1 06 lds r22, 0x06C1 ; 0x8006c1 29088: 70 91 c2 06 lds r23, 0x06C2 ; 0x8006c2 2908c: 89 2f mov r24, r25 2908e: 99 0f add r25, r25 29090: 99 0b sbc r25, r25 29092: aa 0b sbc r26, r26 29094: bb 0b sbc r27, r27 29096: 84 0f add r24, r20 29098: 95 1f adc r25, r21 2909a: a6 1f adc r26, r22 2909c: b7 1f adc r27, r23 2909e: 80 93 bf 06 sts 0x06BF, r24 ; 0x8006bf 290a2: 90 93 c0 06 sts 0x06C0, r25 ; 0x8006c0 290a6: a0 93 c1 06 sts 0x06C1, r26 ; 0x8006c1 290aa: b0 93 c2 06 sts 0x06C2, r27 ; 0x8006c2 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 290ae: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 290b2: 80 91 92 05 lds r24, 0x0592 ; 0x800592 290b6: 89 0f add r24, r25 290b8: 80 93 92 05 sts 0x0592, r24 ; 0x800592 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) 290bc: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 290c0: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 290c4: 01 96 adiw r24, 0x01 ; 1 290c6: 90 93 7d 05 sts 0x057D, r25 ; 0x80057d 290ca: 80 93 7c 05 sts 0x057C, r24 ; 0x80057c 290ce: 82 17 cp r24, r18 290d0: 93 07 cpc r25, r19 290d2: 08 f0 brcs .+2 ; 0x290d6 <__vector_17+0x810> 290d4: 71 c1 rjmp .+738 ; 0x293b8 <__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) 290d6: cf 5f subi r28, 0xFF ; 255 290d8: f8 ce rjmp .-528 ; 0x28eca <__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) 290da: 80 91 99 05 lds r24, 0x0599 ; 0x800599 290de: c8 17 cp r28, r24 290e0: 08 f0 brcs .+2 ; 0x290e4 <__vector_17+0x81e> 290e2: 6a c1 rjmp .+724 ; 0x293b8 <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 290e4: 0f 94 1a 15 call 0x22a34 ; 0x22a34 // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 290e8: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 290ec: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 290f0: 80 81 ld r24, Z 290f2: 91 81 ldd r25, Z+1 ; 0x01 290f4: a2 81 ldd r26, Z+2 ; 0x02 290f6: b3 81 ldd r27, Z+3 ; 0x03 290f8: 40 91 81 05 lds r20, 0x0581 ; 0x800581 290fc: 50 91 82 05 lds r21, 0x0582 ; 0x800582 29100: 60 91 83 05 lds r22, 0x0583 ; 0x800583 29104: 70 91 84 05 lds r23, 0x0584 ; 0x800584 29108: 84 0f add r24, r20 2910a: 95 1f adc r25, r21 2910c: a6 1f adc r26, r22 2910e: b7 1f adc r27, r23 29110: 80 93 81 05 sts 0x0581, r24 ; 0x800581 29114: 90 93 82 05 sts 0x0582, r25 ; 0x800582 29118: a0 93 83 05 sts 0x0583, r26 ; 0x800583 2911c: b0 93 84 05 sts 0x0584, r27 ; 0x800584 if (counter[X_AXIS].wide > 0) { 29120: 18 16 cp r1, r24 29122: 19 06 cpc r1, r25 29124: 1a 06 cpc r1, r26 29126: 1b 06 cpc r1, r27 29128: c4 f5 brge .+112 ; 0x2919a <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 2912a: 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; 2912c: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 29130: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 29134: 80 91 81 05 lds r24, 0x0581 ; 0x800581 29138: 90 91 82 05 lds r25, 0x0582 ; 0x800582 2913c: a0 91 83 05 lds r26, 0x0583 ; 0x800583 29140: b0 91 84 05 lds r27, 0x0584 ; 0x800584 29144: 40 89 ldd r20, Z+16 ; 0x10 29146: 51 89 ldd r21, Z+17 ; 0x11 29148: 62 89 ldd r22, Z+18 ; 0x12 2914a: 73 89 ldd r23, Z+19 ; 0x13 2914c: 84 1b sub r24, r20 2914e: 95 0b sbc r25, r21 29150: a6 0b sbc r26, r22 29152: b7 0b sbc r27, r23 29154: 80 93 81 05 sts 0x0581, r24 ; 0x800581 29158: 90 93 82 05 sts 0x0582, r25 ; 0x800582 2915c: a0 93 83 05 sts 0x0583, r26 ; 0x800583 29160: b0 93 84 05 sts 0x0584, r27 ; 0x800584 count_position[X_AXIS]+=count_direction[X_AXIS]; 29164: 90 91 97 02 lds r25, 0x0297 ; 0x800297 29168: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 2916c: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 29170: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 29174: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 29178: 89 2f mov r24, r25 2917a: 99 0f add r25, r25 2917c: 99 0b sbc r25, r25 2917e: aa 0b sbc r26, r26 29180: bb 0b sbc r27, r27 29182: 84 0f add r24, r20 29184: 95 1f adc r25, r21 29186: a6 1f adc r26, r22 29188: b7 1f adc r27, r23 2918a: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 2918e: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 29192: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 29196: b0 93 b6 06 sts 0x06B6, r27 ; 0x8006b6 #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; 2919a: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 2919e: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 291a2: 84 81 ldd r24, Z+4 ; 0x04 291a4: 95 81 ldd r25, Z+5 ; 0x05 291a6: a6 81 ldd r26, Z+6 ; 0x06 291a8: b7 81 ldd r27, Z+7 ; 0x07 291aa: 40 91 85 05 lds r20, 0x0585 ; 0x800585 291ae: 50 91 86 05 lds r21, 0x0586 ; 0x800586 291b2: 60 91 87 05 lds r22, 0x0587 ; 0x800587 291b6: 70 91 88 05 lds r23, 0x0588 ; 0x800588 291ba: 84 0f add r24, r20 291bc: 95 1f adc r25, r21 291be: a6 1f adc r26, r22 291c0: b7 1f adc r27, r23 291c2: 80 93 85 05 sts 0x0585, r24 ; 0x800585 291c6: 90 93 86 05 sts 0x0586, r25 ; 0x800586 291ca: a0 93 87 05 sts 0x0587, r26 ; 0x800587 291ce: b0 93 88 05 sts 0x0588, r27 ; 0x800588 if (counter[Y_AXIS].wide > 0) { 291d2: 18 16 cp r1, r24 291d4: 19 06 cpc r1, r25 291d6: 1a 06 cpc r1, r26 291d8: 1b 06 cpc r1, r27 291da: 84 f5 brge .+96 ; 0x2923c <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 291dc: 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; 291de: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 291e2: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 291e6: 40 89 ldd r20, Z+16 ; 0x10 291e8: 51 89 ldd r21, Z+17 ; 0x11 291ea: 62 89 ldd r22, Z+18 ; 0x12 291ec: 73 89 ldd r23, Z+19 ; 0x13 291ee: 84 1b sub r24, r20 291f0: 95 0b sbc r25, r21 291f2: a6 0b sbc r26, r22 291f4: b7 0b sbc r27, r23 291f6: 80 93 85 05 sts 0x0585, r24 ; 0x800585 291fa: 90 93 86 05 sts 0x0586, r25 ; 0x800586 291fe: a0 93 87 05 sts 0x0587, r26 ; 0x800587 29202: b0 93 88 05 sts 0x0588, r27 ; 0x800588 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 29206: 90 91 98 02 lds r25, 0x0298 ; 0x800298 2920a: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 2920e: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 29212: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 29216: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 2921a: 89 2f mov r24, r25 2921c: 99 0f add r25, r25 2921e: 99 0b sbc r25, r25 29220: aa 0b sbc r26, r26 29222: bb 0b sbc r27, r27 29224: 84 0f add r24, r20 29226: 95 1f adc r25, r21 29228: a6 1f adc r26, r22 2922a: b7 1f adc r27, r23 2922c: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 29230: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 29234: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 29238: b0 93 ba 06 sts 0x06BA, r27 ; 0x8006ba #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; 2923c: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 29240: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 29244: 80 85 ldd r24, Z+8 ; 0x08 29246: 91 85 ldd r25, Z+9 ; 0x09 29248: a2 85 ldd r26, Z+10 ; 0x0a 2924a: b3 85 ldd r27, Z+11 ; 0x0b 2924c: 40 91 89 05 lds r20, 0x0589 ; 0x800589 29250: 50 91 8a 05 lds r21, 0x058A ; 0x80058a 29254: 60 91 8b 05 lds r22, 0x058B ; 0x80058b 29258: 70 91 8c 05 lds r23, 0x058C ; 0x80058c 2925c: 84 0f add r24, r20 2925e: 95 1f adc r25, r21 29260: a6 1f adc r26, r22 29262: b7 1f adc r27, r23 29264: 80 93 89 05 sts 0x0589, r24 ; 0x800589 29268: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 2926c: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 29270: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c if (counter[Z_AXIS].wide > 0) { 29274: 18 16 cp r1, r24 29276: 19 06 cpc r1, r25 29278: 1a 06 cpc r1, r26 2927a: 1b 06 cpc r1, r27 2927c: 84 f5 brge .+96 ; 0x292de <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 2927e: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 29280: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 29284: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 29288: 40 89 ldd r20, Z+16 ; 0x10 2928a: 51 89 ldd r21, Z+17 ; 0x11 2928c: 62 89 ldd r22, Z+18 ; 0x12 2928e: 73 89 ldd r23, Z+19 ; 0x13 29290: 84 1b sub r24, r20 29292: 95 0b sbc r25, r21 29294: a6 0b sbc r26, r22 29296: b7 0b sbc r27, r23 29298: 80 93 89 05 sts 0x0589, r24 ; 0x800589 2929c: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 292a0: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 292a4: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c count_position[Z_AXIS]+=count_direction[Z_AXIS]; 292a8: 90 91 99 02 lds r25, 0x0299 ; 0x800299 292ac: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 292b0: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 292b4: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 292b8: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 292bc: 89 2f mov r24, r25 292be: 99 0f add r25, r25 292c0: 99 0b sbc r25, r25 292c2: aa 0b sbc r26, r26 292c4: bb 0b sbc r27, r27 292c6: 84 0f add r24, r20 292c8: 95 1f adc r25, r21 292ca: a6 1f adc r26, r22 292cc: b7 1f adc r27, r23 292ce: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 292d2: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 292d6: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 292da: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 292de: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 292e2: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 292e6: 80 91 8d 05 lds r24, 0x058D ; 0x80058d 292ea: 90 91 8e 05 lds r25, 0x058E ; 0x80058e 292ee: a0 91 8f 05 lds r26, 0x058F ; 0x80058f 292f2: b0 91 90 05 lds r27, 0x0590 ; 0x800590 292f6: 44 85 ldd r20, Z+12 ; 0x0c 292f8: 55 85 ldd r21, Z+13 ; 0x0d 292fa: 66 85 ldd r22, Z+14 ; 0x0e 292fc: 77 85 ldd r23, Z+15 ; 0x0f 292fe: 84 0f add r24, r20 29300: 95 1f adc r25, r21 29302: a6 1f adc r26, r22 29304: b7 1f adc r27, r23 29306: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 2930a: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 2930e: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 29312: b0 93 90 05 sts 0x0590, r27 ; 0x800590 29316: 40 89 ldd r20, Z+16 ; 0x10 29318: 51 89 ldd r21, Z+17 ; 0x11 2931a: 62 89 ldd r22, Z+18 ; 0x12 2931c: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 2931e: 18 16 cp r1, r24 29320: 19 06 cpc r1, r25 29322: 1a 06 cpc r1, r26 29324: 1b 06 cpc r1, r27 29326: 74 f5 brge .+92 ; 0x29384 <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 29328: 84 1b sub r24, r20 2932a: 95 0b sbc r25, r21 2932c: a6 0b sbc r26, r22 2932e: b7 0b sbc r27, r23 29330: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 29334: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 29338: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 2933c: b0 93 90 05 sts 0x0590, r27 ; 0x800590 count_position[E_AXIS] += count_direction[E_AXIS]; 29340: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 29344: c0 90 bf 06 lds r12, 0x06BF ; 0x8006bf 29348: d0 90 c0 06 lds r13, 0x06C0 ; 0x8006c0 2934c: e0 90 c1 06 lds r14, 0x06C1 ; 0x8006c1 29350: f0 90 c2 06 lds r15, 0x06C2 ; 0x8006c2 29354: 89 2f mov r24, r25 29356: 99 0f add r25, r25 29358: 99 0b sbc r25, r25 2935a: aa 0b sbc r26, r26 2935c: bb 0b sbc r27, r27 2935e: 8c 0d add r24, r12 29360: 9d 1d adc r25, r13 29362: ae 1d adc r26, r14 29364: bf 1d adc r27, r15 29366: 80 93 bf 06 sts 0x06BF, r24 ; 0x8006bf 2936a: 90 93 c0 06 sts 0x06C0, r25 ; 0x8006c0 2936e: a0 93 c1 06 sts 0x06C1, r26 ; 0x8006c1 29372: b0 93 c2 06 sts 0x06C2, r27 ; 0x8006c2 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 29376: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 2937a: 80 91 92 05 lds r24, 0x0592 ; 0x800592 2937e: 89 0f add r24, r25 29380: 80 93 92 05 sts 0x0592, r24 ; 0x800592 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) 29384: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 29388: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 2938c: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 29390: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 29394: 01 96 adiw r24, 0x01 ; 1 29396: a1 1d adc r26, r1 29398: b1 1d adc r27, r1 2939a: 80 93 7c 05 sts 0x057C, r24 ; 0x80057c 2939e: 90 93 7d 05 sts 0x057D, r25 ; 0x80057d 293a2: a0 93 7e 05 sts 0x057E, r26 ; 0x80057e 293a6: b0 93 7f 05 sts 0x057F, r27 ; 0x80057f 293aa: 84 17 cp r24, r20 293ac: 95 07 cpc r25, r21 293ae: a6 07 cpc r26, r22 293b0: b7 07 cpc r27, r23 293b2: 10 f4 brcc .+4 ; 0x293b8 <__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) 293b4: cf 5f subi r28, 0xFF ; 255 293b6: 91 ce rjmp .-734 ; 0x290da <__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); 293b8: 80 91 92 05 lds r24, 0x0592 ; 0x800592 293bc: 88 23 and r24, r24 293be: 39 f0 breq .+14 ; 0x293ce <__vector_17+0xb08> 293c0: 87 fd sbrc r24, 7 293c2: ee c0 rjmp .+476 ; 0x295a0 <__vector_17+0xcda> 293c4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 293c8: 80 64 ori r24, 0x40 ; 64 293ca: 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) { 293ce: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 293d2: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 293d6: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 293da: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 293de: c0 91 a1 05 lds r28, 0x05A1 ; 0x8005a1 293e2: d0 91 a2 05 lds r29, 0x05A2 ; 0x8005a2 293e6: 89 8d ldd r24, Y+25 ; 0x19 293e8: 9a 8d ldd r25, Y+26 ; 0x1a 293ea: ab 8d ldd r26, Y+27 ; 0x1b 293ec: bc 8d ldd r27, Y+28 ; 0x1c 293ee: 84 17 cp r24, r20 293f0: 95 07 cpc r25, r21 293f2: a6 07 cpc r26, r22 293f4: b7 07 cpc r27, r23 293f6: 08 f4 brcc .+2 ; 0x293fa <__vector_17+0xb34> 293f8: 34 c1 rjmp .+616 ; 0x29662 <__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); 293fa: 40 91 95 05 lds r20, 0x0595 ; 0x800595 293fe: 50 91 96 05 lds r21, 0x0596 ; 0x800596 29402: 60 91 97 05 lds r22, 0x0597 ; 0x800597 29406: 70 91 98 05 lds r23, 0x0598 ; 0x800598 "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. ); 2940a: cc 88 ldd r12, Y+20 ; 0x14 2940c: dd 88 ldd r13, Y+21 ; 0x15 2940e: ee 88 ldd r14, Y+22 ; 0x16 29410: aa 27 eor r26, r26 29412: 4d 9d mul r20, r13 29414: b1 2d mov r27, r1 29416: 5e 9d mul r21, r14 29418: c0 01 movw r24, r0 2941a: 6e 9d mul r22, r14 2941c: 90 0d add r25, r0 2941e: 6d 9d mul r22, r13 29420: 80 0d add r24, r0 29422: 91 1d adc r25, r1 29424: 4e 9d mul r20, r14 29426: b0 0d add r27, r0 29428: 81 1d adc r24, r1 2942a: 9a 1f adc r25, r26 2942c: 5d 9d mul r21, r13 2942e: b0 0d add r27, r0 29430: 81 1d adc r24, r1 29432: 9a 1f adc r25, r26 29434: 6c 9d mul r22, r12 29436: b0 0d add r27, r0 29438: 81 1d adc r24, r1 2943a: 9a 1f adc r25, r26 2943c: 5c 9d mul r21, r12 2943e: b1 0d add r27, r1 29440: 8a 1f adc r24, r26 29442: 9a 1f adc r25, r26 29444: bb 0f add r27, r27 29446: 8a 1f adc r24, r26 29448: 9a 1f adc r25, r26 2944a: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 2944c: 2a ad ldd r18, Y+58 ; 0x3a 2944e: 3b ad ldd r19, Y+59 ; 0x3b 29450: 82 0f add r24, r18 29452: 93 1f adc r25, r19 29454: 90 93 9b 05 sts 0x059B, r25 ; 0x80059b 29458: 80 93 9a 05 sts 0x059A, r24 ; 0x80059a // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 2945c: 2e a9 ldd r18, Y+54 ; 0x36 2945e: 3f a9 ldd r19, Y+55 ; 0x37 29460: 28 17 cp r18, r24 29462: 39 07 cpc r19, r25 29464: 20 f4 brcc .+8 ; 0x2946e <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 29466: 30 93 9b 05 sts 0x059B, r19 ; 0x80059b 2946a: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 2946e: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 29472: 90 91 9b 05 lds r25, 0x059B ; 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; 29476: 81 34 cpi r24, 0x41 ; 65 29478: fc e9 ldi r31, 0x9C ; 156 2947a: 9f 07 cpc r25, r31 2947c: 08 f0 brcs .+2 ; 0x29480 <__vector_17+0xbba> 2947e: 94 c0 rjmp .+296 ; 0x295a8 <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 29480: 81 32 cpi r24, 0x21 ; 33 29482: 2e e4 ldi r18, 0x4E ; 78 29484: 92 07 cpc r25, r18 29486: 08 f4 brcc .+2 ; 0x2948a <__vector_17+0xbc4> 29488: 92 c0 rjmp .+292 ; 0x295ae <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 2948a: 96 95 lsr r25 2948c: 87 95 ror r24 2948e: 96 95 lsr r25 29490: 87 95 ror r24 step_loops = 4; 29492: 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; 29494: 20 93 99 05 sts 0x0599, r18 ; 0x800599 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 29498: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2949a: 81 15 cp r24, r1 2949c: f8 e0 ldi r31, 0x08 ; 8 2949e: 9f 07 cpc r25, r31 294a0: 08 f4 brcc .+2 ; 0x294a4 <__vector_17+0xbde> 294a2: 97 c0 rjmp .+302 ; 0x295d2 <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 294a4: e9 2f mov r30, r25 294a6: ff 27 eor r31, r31 294a8: ee 0f add r30, r30 294aa: ff 1f adc r31, r31 294ac: ee 0f add r30, r30 294ae: ff 1f adc r31, r31 294b0: 9f 01 movw r18, r30 294b2: 27 59 subi r18, 0x97 ; 151 294b4: 3a 46 sbci r19, 0x6A ; 106 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 294b6: f9 01 movw r30, r18 294b8: 32 96 adiw r30, 0x02 ; 2 294ba: a5 91 lpm r26, Z+ 294bc: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 294be: f9 01 movw r30, r18 294c0: 25 91 lpm r18, Z+ 294c2: 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. ); 294c4: b8 9f mul r27, r24 294c6: f0 01 movw r30, r0 294c8: a8 9f mul r26, r24 294ca: 00 0c add r0, r0 294cc: e1 1d adc r30, r1 294ce: 11 24 eor r1, r1 294d0: 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); 294d2: c9 01 movw r24, r18 294d4: 8e 1b sub r24, r30 294d6: 9f 0b sbc r25, r31 294d8: 84 36 cpi r24, 0x64 ; 100 294da: 91 05 cpc r25, r1 294dc: 10 f4 brcc .+4 ; 0x294e2 <__vector_17+0xc1c> 294de: 84 e6 ldi r24, 0x64 ; 100 294e0: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 294e2: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 294e6: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> 294ea: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.480+0x1> 294ee: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.480> acceleration_time += timer; 294f2: 48 0f add r20, r24 294f4: 59 1f adc r21, r25 294f6: 61 1d adc r22, r1 294f8: 71 1d adc r23, r1 294fa: 40 93 95 05 sts 0x0595, r20 ; 0x800595 294fe: 50 93 96 05 sts 0x0596, r21 ; 0x800596 29502: 60 93 97 05 sts 0x0597, r22 ; 0x800597 29506: 70 93 98 05 sts 0x0598, r23 ; 0x800598 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2950a: fe 01 movw r30, r28 2950c: e4 5b subi r30, 0xB4 ; 180 2950e: ff 4f sbci r31, 0xFF ; 255 29510: 80 81 ld r24, Z 29512: 81 11 cpse r24, r1 29514: 7d c0 rjmp .+250 ; 0x29610 <__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; 29516: 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) { 29518: 80 ff sbrs r24, 0 2951a: 16 c0 rjmp .+44 ; 0x29548 <__vector_17+0xc82> LA_phase = -1; 2951c: 9f ef ldi r25, 0xFF ; 255 2951e: 90 93 91 05 sts 0x0591, r25 ; 0x800591 if (current_adv_steps == target_adv_steps) { 29522: e0 91 df 04 lds r30, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 29526: f0 91 e0 04 lds r31, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 2952a: 20 91 93 05 lds r18, 0x0593 ; 0x800593 2952e: 30 91 94 05 lds r19, 0x0594 ; 0x800594 29532: e2 17 cp r30, r18 29534: f3 07 cpc r31, r19 29536: 09 f0 breq .+2 ; 0x2953a <__vector_17+0xc74> 29538: 24 c2 rjmp .+1096 ; 0x29982 <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 2953a: 8f ef ldi r24, 0xFF ; 255 2953c: 9f ef ldi r25, 0xFF ; 255 2953e: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 29542: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> 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; 29546: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 29548: 80 fd sbrc r24, 0 2954a: 07 c0 rjmp .+14 ; 0x2955a <__vector_17+0xc94> 2954c: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> 29550: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 29554: 01 96 adiw r24, 0x01 ; 1 29556: 09 f4 brne .+2 ; 0x2955a <__vector_17+0xc94> 29558: b2 c2 rjmp .+1380 ; 0x29abe <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 2955a: e0 91 e1 04 lds r30, 0x04E1 ; 0x8004e1 <_ZL9main_Rate.lto_priv.480> 2955e: f0 91 e2 04 lds r31, 0x04E2 ; 0x8004e2 <_ZL9main_Rate.lto_priv.480+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 29562: 80 91 72 05 lds r24, 0x0572 ; 0x800572 29566: 90 91 73 05 lds r25, 0x0573 ; 0x800573 2956a: a0 91 74 05 lds r26, 0x0574 ; 0x800574 2956e: b0 91 75 05 lds r27, 0x0575 ; 0x800575 29572: 8e 0f add r24, r30 29574: 9f 1f adc r25, r31 29576: a1 1d adc r26, r1 29578: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 2957a: c3 5b subi r28, 0xB3 ; 179 2957c: df 4f sbci r29, 0xFF ; 255 2957e: 08 81 ld r16, Y 29580: 19 81 ldd r17, Y+1 ; 0x01 29582: 30 e0 ldi r19, 0x00 ; 0 29584: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 29586: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 29588: 80 17 cp r24, r16 2958a: 91 07 cpc r25, r17 2958c: a2 07 cpc r26, r18 2958e: b3 07 cpc r27, r19 29590: 08 f4 brcc .+2 ; 0x29594 <__vector_17+0xcce> 29592: 27 c2 rjmp .+1102 ; 0x299e2 <__vector_17+0x111c> { ++ticks; 29594: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 29596: 80 1b sub r24, r16 29598: 91 0b sbc r25, r17 2959a: a2 0b sbc r26, r18 2959c: b3 0b sbc r27, r19 2959e: f4 cf rjmp .-24 ; 0x29588 <__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); 295a0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 295a4: 8f 7b andi r24, 0xBF ; 191 295a6: 11 cf rjmp .-478 ; 0x293ca <__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; 295a8: 80 e4 ldi r24, 0x40 ; 64 295aa: 9c e9 ldi r25, 0x9C ; 156 295ac: 6e cf rjmp .-292 ; 0x2948a <__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 295ae: 81 31 cpi r24, 0x11 ; 17 295b0: e7 e2 ldi r30, 0x27 ; 39 295b2: 9e 07 cpc r25, r30 295b4: 20 f0 brcs .+8 ; 0x295be <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 295b6: 96 95 lsr r25 295b8: 87 95 ror r24 step_loops = 2; 295ba: 22 e0 ldi r18, 0x02 ; 2 295bc: 6b cf rjmp .-298 ; 0x29494 <__vector_17+0xbce> } else { step_loops = 1; 295be: 21 e0 ldi r18, 0x01 ; 1 295c0: 20 93 99 05 sts 0x0599, r18 ; 0x800599 295c4: 80 32 cpi r24, 0x20 ; 32 295c6: 91 05 cpc r25, r1 295c8: 08 f0 brcs .+2 ; 0x295cc <__vector_17+0xd06> 295ca: 66 cf rjmp .-308 ; 0x29498 <__vector_17+0xbd2> 295cc: 80 e2 ldi r24, 0x20 ; 32 295ce: 90 e0 ldi r25, 0x00 ; 0 295d0: 63 cf rjmp .-314 ; 0x29498 <__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; 295d2: 9c 01 movw r18, r24 295d4: 36 95 lsr r19 295d6: 27 95 ror r18 295d8: 2c 7f andi r18, 0xFC ; 252 295da: 27 59 subi r18, 0x97 ; 151 295dc: 3e 46 sbci r19, 0x6E ; 110 timer = (unsigned short)pgm_read_word_near(table_address); 295de: f9 01 movw r30, r18 295e0: a5 91 lpm r26, Z+ 295e2: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 295e4: f9 01 movw r30, r18 295e6: 32 96 adiw r30, 0x02 ; 2 295e8: 05 91 lpm r16, Z+ 295ea: 14 91 lpm r17, Z 295ec: 87 70 andi r24, 0x07 ; 7 295ee: 99 27 eor r25, r25 295f0: 80 9f mul r24, r16 295f2: 90 01 movw r18, r0 295f4: 81 9f mul r24, r17 295f6: 30 0d add r19, r0 295f8: 90 9f mul r25, r16 295fa: 30 0d add r19, r0 295fc: 11 24 eor r1, r1 295fe: f3 e0 ldi r31, 0x03 ; 3 29600: 36 95 lsr r19 29602: 27 95 ror r18 29604: fa 95 dec r31 29606: e1 f7 brne .-8 ; 0x29600 <__vector_17+0xd3a> 29608: cd 01 movw r24, r26 2960a: 82 1b sub r24, r18 2960c: 93 0b sbc r25, r19 2960e: 64 cf rjmp .-312 ; 0x294d8 <__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) { 29610: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 29614: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 29618: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 2961c: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 29620: 80 91 99 05 lds r24, 0x0599 ; 0x800599 29624: 90 e0 ldi r25, 0x00 ; 0 29626: b0 e0 ldi r27, 0x00 ; 0 29628: a0 e0 ldi r26, 0x00 ; 0 2962a: 84 17 cp r24, r20 2962c: 95 07 cpc r25, r21 2962e: a6 07 cpc r26, r22 29630: b7 07 cpc r27, r23 29632: 08 f4 brcc .+2 ; 0x29636 <__vector_17+0xd70> 29634: 70 cf rjmp .-288 ; 0x29516 <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 29636: 80 91 80 05 lds r24, 0x0580 ; 0x800580 2963a: 81 11 cpse r24, r1 2963c: 02 c0 rjmp .+4 ; 0x29642 <__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; 2963e: 83 e0 ldi r24, 0x03 ; 3 29640: 6b cf rjmp .-298 ; 0x29518 <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 29642: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 29646: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 2964a: 20 91 93 05 lds r18, 0x0593 ; 0x800593 2964e: 30 91 94 05 lds r19, 0x0594 ; 0x800594 29652: 28 17 cp r18, r24 29654: 39 07 cpc r19, r25 29656: 98 f7 brcc .-26 ; 0x2963e <__vector_17+0xd78> target_adv_steps = current_adv_steps; 29658: 90 93 94 05 sts 0x0594, r25 ; 0x800594 2965c: 80 93 93 05 sts 0x0593, r24 ; 0x800593 29660: ee cf rjmp .-36 ; 0x2963e <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 29662: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 29666: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 2966a: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 2966e: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 29672: 4d 8d ldd r20, Y+29 ; 0x1d 29674: 5e 8d ldd r21, Y+30 ; 0x1e 29676: 6f 8d ldd r22, Y+31 ; 0x1f 29678: 78 a1 ldd r23, Y+32 ; 0x20 2967a: 48 17 cp r20, r24 2967c: 59 07 cpc r21, r25 2967e: 6a 07 cpc r22, r26 29680: 7b 07 cpc r23, r27 29682: 08 f0 brcs .+2 ; 0x29686 <__vector_17+0xdc0> 29684: e3 c0 rjmp .+454 ; 0x2984c <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 29686: c0 90 9d 05 lds r12, 0x059D ; 0x80059d 2968a: d0 90 9e 05 lds r13, 0x059E ; 0x80059e 2968e: e0 90 9f 05 lds r14, 0x059F ; 0x80059f 29692: f0 90 a0 05 lds r15, 0x05A0 ; 0x8005a0 "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. ); 29696: 6c 88 ldd r6, Y+20 ; 0x14 29698: 7d 88 ldd r7, Y+21 ; 0x15 2969a: 8e 88 ldd r8, Y+22 ; 0x16 2969c: aa 27 eor r26, r26 2969e: c7 9c mul r12, r7 296a0: b1 2d mov r27, r1 296a2: d8 9c mul r13, r8 296a4: f0 01 movw r30, r0 296a6: e8 9c mul r14, r8 296a8: f0 0d add r31, r0 296aa: e7 9c mul r14, r7 296ac: e0 0d add r30, r0 296ae: f1 1d adc r31, r1 296b0: c8 9c mul r12, r8 296b2: b0 0d add r27, r0 296b4: e1 1d adc r30, r1 296b6: fa 1f adc r31, r26 296b8: d7 9c mul r13, r7 296ba: b0 0d add r27, r0 296bc: e1 1d adc r30, r1 296be: fa 1f adc r31, r26 296c0: e6 9c mul r14, r6 296c2: b0 0d add r27, r0 296c4: e1 1d adc r30, r1 296c6: fa 1f adc r31, r26 296c8: d6 9c mul r13, r6 296ca: b1 0d add r27, r1 296cc: ea 1f adc r30, r26 296ce: fa 1f adc r31, r26 296d0: bb 0f add r27, r27 296d2: ea 1f adc r30, r26 296d4: fa 1f adc r31, r26 296d6: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 296d8: 20 91 9a 05 lds r18, 0x059A ; 0x80059a 296dc: 30 91 9b 05 lds r19, 0x059B ; 0x80059b 296e0: 8e ad ldd r24, Y+62 ; 0x3e 296e2: 9f ad ldd r25, Y+63 ; 0x3f 296e4: 2e 17 cp r18, r30 296e6: 3f 07 cpc r19, r31 296e8: 30 f0 brcs .+12 ; 0x296f6 <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 296ea: 2e 1b sub r18, r30 296ec: 3f 0b sbc r19, r31 296ee: 82 17 cp r24, r18 296f0: 93 07 cpc r25, r19 296f2: 08 f4 brcc .+2 ; 0x296f6 <__vector_17+0xe30> 296f4: 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; 296f6: 81 34 cpi r24, 0x41 ; 65 296f8: 2c e9 ldi r18, 0x9C ; 156 296fa: 92 07 cpc r25, r18 296fc: 08 f0 brcs .+2 ; 0x29700 <__vector_17+0xe3a> 296fe: 75 c0 rjmp .+234 ; 0x297ea <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 29700: 81 32 cpi r24, 0x21 ; 33 29702: ee e4 ldi r30, 0x4E ; 78 29704: 9e 07 cpc r25, r30 29706: 08 f4 brcc .+2 ; 0x2970a <__vector_17+0xe44> 29708: 73 c0 rjmp .+230 ; 0x297f0 <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 2970a: 96 95 lsr r25 2970c: 87 95 ror r24 2970e: 96 95 lsr r25 29710: 87 95 ror r24 step_loops = 4; 29712: 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; 29714: 20 93 99 05 sts 0x0599, r18 ; 0x800599 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 29718: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2971a: 81 15 cp r24, r1 2971c: 28 e0 ldi r18, 0x08 ; 8 2971e: 92 07 cpc r25, r18 29720: 08 f4 brcc .+2 ; 0x29724 <__vector_17+0xe5e> 29722: 78 c0 rjmp .+240 ; 0x29814 <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 29724: e9 2f mov r30, r25 29726: ff 27 eor r31, r31 29728: ee 0f add r30, r30 2972a: ff 1f adc r31, r31 2972c: ee 0f add r30, r30 2972e: ff 1f adc r31, r31 29730: 9f 01 movw r18, r30 29732: 27 59 subi r18, 0x97 ; 151 29734: 3a 46 sbci r19, 0x6A ; 106 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 29736: f9 01 movw r30, r18 29738: 32 96 adiw r30, 0x02 ; 2 2973a: a5 91 lpm r26, Z+ 2973c: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2973e: f9 01 movw r30, r18 29740: 25 91 lpm r18, Z+ 29742: 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. ); 29744: b8 9f mul r27, r24 29746: f0 01 movw r30, r0 29748: a8 9f mul r26, r24 2974a: 00 0c add r0, r0 2974c: e1 1d adc r30, r1 2974e: 11 24 eor r1, r1 29750: 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); 29752: 2e 1b sub r18, r30 29754: 3f 0b sbc r19, r31 29756: c9 01 movw r24, r18 29758: 24 36 cpi r18, 0x64 ; 100 2975a: 31 05 cpc r19, r1 2975c: 10 f4 brcc .+4 ; 0x29762 <__vector_17+0xe9c> 2975e: 84 e6 ldi r24, 0x64 ; 100 29760: 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); 29762: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 29766: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> 2976a: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.480+0x1> 2976e: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.480> deceleration_time += timer; 29772: c8 0e add r12, r24 29774: d9 1e adc r13, r25 29776: e1 1c adc r14, r1 29778: f1 1c adc r15, r1 2977a: c0 92 9d 05 sts 0x059D, r12 ; 0x80059d 2977e: d0 92 9e 05 sts 0x059E, r13 ; 0x80059e 29782: e0 92 9f 05 sts 0x059F, r14 ; 0x80059f 29786: f0 92 a0 05 sts 0x05A0, r15 ; 0x8005a0 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2978a: fe 01 movw r30, r28 2978c: e4 5b subi r30, 0xB4 ; 180 2978e: ff 4f sbci r31, 0xFF ; 255 29790: 80 81 ld r24, Z 29792: 88 23 and r24, r24 29794: 09 f4 brne .+2 ; 0x29798 <__vector_17+0xed2> 29796: bf ce rjmp .-642 ; 0x29516 <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 29798: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 2979c: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 297a0: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 297a4: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 297a8: 20 91 99 05 lds r18, 0x0599 ; 0x800599 297ac: 42 0f add r20, r18 297ae: 51 1d adc r21, r1 297b0: 61 1d adc r22, r1 297b2: 71 1d adc r23, r1 297b4: 48 17 cp r20, r24 297b6: 59 07 cpc r21, r25 297b8: 6a 07 cpc r22, r26 297ba: 7b 07 cpc r23, r27 297bc: 08 f4 brcc .+2 ; 0x297c0 <__vector_17+0xefa> 297be: ab ce rjmp .-682 ; 0x29516 <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 297c0: 35 96 adiw r30, 0x05 ; 5 297c2: 20 81 ld r18, Z 297c4: 31 81 ldd r19, Z+1 ; 0x01 297c6: 30 93 94 05 sts 0x0594, r19 ; 0x800594 297ca: 20 93 93 05 sts 0x0593, r18 ; 0x800593 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 297ce: 80 91 80 05 lds r24, 0x0580 ; 0x800580 297d2: 88 23 and r24, r24 297d4: 09 f4 brne .+2 ; 0x297d8 <__vector_17+0xf12> 297d6: 33 cf rjmp .-410 ; 0x2963e <__vector_17+0xd78> 297d8: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 297dc: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 297e0: 82 17 cp r24, r18 297e2: 93 07 cpc r25, r19 297e4: 08 f0 brcs .+2 ; 0x297e8 <__vector_17+0xf22> 297e6: 2b cf rjmp .-426 ; 0x2963e <__vector_17+0xd78> 297e8: 37 cf rjmp .-402 ; 0x29658 <__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; 297ea: 80 e4 ldi r24, 0x40 ; 64 297ec: 9c e9 ldi r25, 0x9C ; 156 297ee: 8d cf rjmp .-230 ; 0x2970a <__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 297f0: 81 31 cpi r24, 0x11 ; 17 297f2: f7 e2 ldi r31, 0x27 ; 39 297f4: 9f 07 cpc r25, r31 297f6: 20 f0 brcs .+8 ; 0x29800 <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 297f8: 96 95 lsr r25 297fa: 87 95 ror r24 step_loops = 2; 297fc: 22 e0 ldi r18, 0x02 ; 2 297fe: 8a cf rjmp .-236 ; 0x29714 <__vector_17+0xe4e> } else { step_loops = 1; 29800: 21 e0 ldi r18, 0x01 ; 1 29802: 20 93 99 05 sts 0x0599, r18 ; 0x800599 29806: 80 32 cpi r24, 0x20 ; 32 29808: 91 05 cpc r25, r1 2980a: 08 f0 brcs .+2 ; 0x2980e <__vector_17+0xf48> 2980c: 85 cf rjmp .-246 ; 0x29718 <__vector_17+0xe52> 2980e: 80 e2 ldi r24, 0x20 ; 32 29810: 90 e0 ldi r25, 0x00 ; 0 29812: 82 cf rjmp .-252 ; 0x29718 <__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; 29814: dc 01 movw r26, r24 29816: b6 95 lsr r27 29818: a7 95 ror r26 2981a: ac 7f andi r26, 0xFC ; 252 2981c: a7 59 subi r26, 0x97 ; 151 2981e: be 46 sbci r27, 0x6E ; 110 timer = (unsigned short)pgm_read_word_near(table_address); 29820: fd 01 movw r30, r26 29822: 25 91 lpm r18, Z+ 29824: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 29826: fd 01 movw r30, r26 29828: 32 96 adiw r30, 0x02 ; 2 2982a: a5 91 lpm r26, Z+ 2982c: b4 91 lpm r27, Z 2982e: 87 70 andi r24, 0x07 ; 7 29830: 99 27 eor r25, r25 29832: 8a 9f mul r24, r26 29834: f0 01 movw r30, r0 29836: 8b 9f mul r24, r27 29838: f0 0d add r31, r0 2983a: 9a 9f mul r25, r26 2983c: f0 0d add r31, r0 2983e: 11 24 eor r1, r1 29840: a3 e0 ldi r26, 0x03 ; 3 29842: f6 95 lsr r31 29844: e7 95 ror r30 29846: aa 95 dec r26 29848: e1 f7 brne .-8 ; 0x29842 <__vector_17+0xf7c> 2984a: 83 cf rjmp .-250 ; 0x29752 <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 2984c: 80 91 9c 05 lds r24, 0x059C ; 0x80059c 29850: 88 23 and r24, r24 29852: 71 f0 breq .+28 ; 0x29870 <__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; 29854: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 29856: 20 91 76 05 lds r18, 0x0576 ; 0x800576 2985a: 30 91 77 05 lds r19, 0x0577 ; 0x800577 2985e: 30 93 e6 04 sts 0x04E6, r19 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 29862: 20 93 e5 04 sts 0x04E5, r18 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> 29866: 30 93 e2 04 sts 0x04E2, r19 ; 0x8004e2 <_ZL9main_Rate.lto_priv.480+0x1> 2986a: 20 93 e1 04 sts 0x04E1, r18 ; 0x8004e1 <_ZL9main_Rate.lto_priv.480> 2986e: 54 ce rjmp .-856 ; 0x29518 <__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); 29870: 8e a9 ldd r24, Y+54 ; 0x36 29872: 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; 29874: 81 34 cpi r24, 0x41 ; 65 29876: 4c e9 ldi r20, 0x9C ; 156 29878: 94 07 cpc r25, r20 2987a: 08 f0 brcs .+2 ; 0x2987e <__vector_17+0xfb8> 2987c: 4e c0 rjmp .+156 ; 0x2991a <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2987e: 81 32 cpi r24, 0x21 ; 33 29880: 5e e4 ldi r21, 0x4E ; 78 29882: 95 07 cpc r25, r21 29884: 08 f4 brcc .+2 ; 0x29888 <__vector_17+0xfc2> 29886: 4c c0 rjmp .+152 ; 0x29920 <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 29888: 96 95 lsr r25 2988a: 87 95 ror r24 2988c: 96 95 lsr r25 2988e: 87 95 ror r24 step_loops = 4; 29890: 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; 29892: 20 93 99 05 sts 0x0599, r18 ; 0x800599 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 29896: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 29898: 81 15 cp r24, r1 2989a: f8 e0 ldi r31, 0x08 ; 8 2989c: 9f 07 cpc r25, r31 2989e: 08 f4 brcc .+2 ; 0x298a2 <__vector_17+0xfdc> 298a0: 51 c0 rjmp .+162 ; 0x29944 <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 298a2: e9 2f mov r30, r25 298a4: ff 27 eor r31, r31 298a6: ee 0f add r30, r30 298a8: ff 1f adc r31, r31 298aa: ee 0f add r30, r30 298ac: ff 1f adc r31, r31 298ae: 9f 01 movw r18, r30 298b0: 27 59 subi r18, 0x97 ; 151 298b2: 3a 46 sbci r19, 0x6A ; 106 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 298b4: f9 01 movw r30, r18 298b6: 32 96 adiw r30, 0x02 ; 2 298b8: 65 91 lpm r22, Z+ 298ba: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 298bc: f9 01 movw r30, r18 298be: 25 91 lpm r18, Z+ 298c0: 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. ); 298c2: 78 9f mul r23, r24 298c4: a0 01 movw r20, r0 298c6: 68 9f mul r22, r24 298c8: 00 0c add r0, r0 298ca: 41 1d adc r20, r1 298cc: 11 24 eor r1, r1 298ce: 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); 298d0: c9 01 movw r24, r18 298d2: 84 1b sub r24, r20 298d4: 95 0b sbc r25, r21 298d6: 84 36 cpi r24, 0x64 ; 100 298d8: 91 05 cpc r25, r1 298da: 10 f4 brcc .+4 ; 0x298e0 <__vector_17+0x101a> 298dc: 84 e6 ldi r24, 0x64 ; 100 298de: 90 e0 ldi r25, 0x00 ; 0 298e0: 90 93 77 05 sts 0x0577, r25 ; 0x800577 298e4: 80 93 76 05 sts 0x0576, r24 ; 0x800576 step_loops_nominal = step_loops; 298e8: 80 91 99 05 lds r24, 0x0599 ; 0x800599 298ec: 80 93 9c 05 sts 0x059C, r24 ; 0x80059c #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 298f0: fe 01 movw r30, r28 298f2: e4 5b subi r30, 0xB4 ; 180 298f4: ff 4f sbci r31, 0xFF ; 255 298f6: 80 81 ld r24, Z 298f8: 88 23 and r24, r24 298fa: 09 f4 brne .+2 ; 0x298fe <__vector_17+0x1038> 298fc: ab cf rjmp .-170 ; 0x29854 <__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) 298fe: 80 91 80 05 lds r24, 0x0580 ; 0x800580 29902: 88 23 and r24, r24 29904: 41 f0 breq .+16 ; 0x29916 <__vector_17+0x1050> target_adv_steps = current_adv_steps; 29906: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 2990a: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 2990e: 90 93 94 05 sts 0x0594, r25 ; 0x800594 29912: 80 93 93 05 sts 0x0593, r24 ; 0x800593 #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; 29916: 81 e0 ldi r24, 0x01 ; 1 29918: 9e cf rjmp .-196 ; 0x29856 <__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; 2991a: 80 e4 ldi r24, 0x40 ; 64 2991c: 9c e9 ldi r25, 0x9C ; 156 2991e: b4 cf rjmp .-152 ; 0x29888 <__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 29920: 81 31 cpi r24, 0x11 ; 17 29922: e7 e2 ldi r30, 0x27 ; 39 29924: 9e 07 cpc r25, r30 29926: 20 f0 brcs .+8 ; 0x29930 <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 29928: 96 95 lsr r25 2992a: 87 95 ror r24 step_loops = 2; 2992c: 22 e0 ldi r18, 0x02 ; 2 2992e: b1 cf rjmp .-158 ; 0x29892 <__vector_17+0xfcc> } else { step_loops = 1; 29930: 21 e0 ldi r18, 0x01 ; 1 29932: 20 93 99 05 sts 0x0599, r18 ; 0x800599 29936: 80 32 cpi r24, 0x20 ; 32 29938: 91 05 cpc r25, r1 2993a: 08 f0 brcs .+2 ; 0x2993e <__vector_17+0x1078> 2993c: ac cf rjmp .-168 ; 0x29896 <__vector_17+0xfd0> 2993e: 80 e2 ldi r24, 0x20 ; 32 29940: 90 e0 ldi r25, 0x00 ; 0 29942: a9 cf rjmp .-174 ; 0x29896 <__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; 29944: 9c 01 movw r18, r24 29946: 36 95 lsr r19 29948: 27 95 ror r18 2994a: 2c 7f andi r18, 0xFC ; 252 2994c: 27 59 subi r18, 0x97 ; 151 2994e: 3e 46 sbci r19, 0x6E ; 110 timer = (unsigned short)pgm_read_word_near(table_address); 29950: f9 01 movw r30, r18 29952: 45 91 lpm r20, Z+ 29954: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 29956: f9 01 movw r30, r18 29958: 32 96 adiw r30, 0x02 ; 2 2995a: 65 91 lpm r22, Z+ 2995c: 74 91 lpm r23, Z 2995e: 87 70 andi r24, 0x07 ; 7 29960: 99 27 eor r25, r25 29962: 86 9f mul r24, r22 29964: 90 01 movw r18, r0 29966: 87 9f mul r24, r23 29968: 30 0d add r19, r0 2996a: 96 9f mul r25, r22 2996c: 30 0d add r19, r0 2996e: 11 24 eor r1, r1 29970: a3 e0 ldi r26, 0x03 ; 3 29972: 36 95 lsr r19 29974: 27 95 ror r18 29976: aa 95 dec r26 29978: e1 f7 brne .-8 ; 0x29972 <__vector_17+0x10ac> 2997a: ca 01 movw r24, r20 2997c: 82 1b sub r24, r18 2997e: 93 0b sbc r25, r19 29980: aa cf rjmp .-172 ; 0x298d6 <__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; 29982: de 01 movw r26, r28 29984: a3 5b subi r26, 0xB3 ; 179 29986: bf 4f sbci r27, 0xFF ; 255 29988: 4d 91 ld r20, X+ 2998a: 5c 91 ld r21, X 2998c: 11 97 sbiw r26, 0x01 ; 1 2998e: 70 e0 ldi r23, 0x00 ; 0 29990: 60 e0 ldi r22, 0x00 ; 0 29992: 40 93 72 05 sts 0x0572, r20 ; 0x800572 29996: 50 93 73 05 sts 0x0573, r21 ; 0x800573 2999a: 60 93 74 05 sts 0x0574, r22 ; 0x800574 2999e: 70 93 75 05 sts 0x0575, r23 ; 0x800575 e_step_loops = current_block->advance_step_loops; 299a2: 16 96 adiw r26, 0x06 ; 6 299a4: 9c 91 ld r25, X 299a6: 90 93 71 05 sts 0x0571, r25 ; 0x800571 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 299aa: 98 2f mov r25, r24 299ac: 92 70 andi r25, 0x02 ; 2 299ae: 09 f4 brne .+2 ; 0x299b2 <__vector_17+0x10ec> 299b0: cb cd rjmp .-1130 ; 0x29548 <__vector_17+0xc82> 299b2: 90 91 80 05 lds r25, 0x0580 ; 0x800580 299b6: 99 23 and r25, r25 299b8: 09 f4 brne .+2 ; 0x299bc <__vector_17+0x10f6> 299ba: c6 cd rjmp .-1140 ; 0x29548 <__vector_17+0xc82> 299bc: 2e 17 cp r18, r30 299be: 3f 07 cpc r19, r31 299c0: 08 f0 brcs .+2 ; 0x299c4 <__vector_17+0x10fe> 299c2: c2 cd rjmp .-1148 ; 0x29548 <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 299c4: 44 0f add r20, r20 299c6: 55 1f adc r21, r21 299c8: 66 1f adc r22, r22 299ca: 77 1f adc r23, r23 299cc: 40 93 72 05 sts 0x0572, r20 ; 0x800572 299d0: 50 93 73 05 sts 0x0573, r21 ; 0x800573 299d4: 60 93 74 05 sts 0x0574, r22 ; 0x800574 299d8: 70 93 75 05 sts 0x0575, r23 ; 0x800575 LA_phase = 0; 299dc: 10 92 91 05 sts 0x0591, r1 ; 0x800591 299e0: b3 cd rjmp .-1178 ; 0x29548 <__vector_17+0xc82> 299e2: 80 93 72 05 sts 0x0572, r24 ; 0x800572 299e6: 90 93 73 05 sts 0x0573, r25 ; 0x800573 299ea: a0 93 74 05 sts 0x0574, r26 ; 0x800574 299ee: b0 93 75 05 sts 0x0575, r27 ; 0x800575 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 299f2: 61 11 cpse r22, r1 299f4: 1b c0 rjmp .+54 ; 0x29a2c <__vector_17+0x1166> { eISR_Rate = timer; 299f6: f0 93 70 05 sts 0x0570, r31 ; 0x800570 299fa: e0 93 6f 05 sts 0x056F, r30 ; 0x80056f nextAdvanceISR = timer; 299fe: f0 93 e4 04 sts 0x04E4, r31 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 29a02: e0 93 e3 04 sts 0x04E3, r30 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 29a06: 80 91 91 05 lds r24, 0x0591 ; 0x800591 29a0a: 87 fd sbrc r24, 7 29a0c: 58 c0 rjmp .+176 ; 0x29abe <__vector_17+0x11f8> if (step_loops == e_step_loops) 29a0e: 80 91 99 05 lds r24, 0x0599 ; 0x800599 29a12: 10 91 71 05 lds r17, 0x0571 ; 0x800571 29a16: 28 81 ld r18, Y 29a18: 39 81 ldd r19, Y+1 ; 0x01 29a1a: 81 13 cpse r24, r17 29a1c: 35 c0 rjmp .+106 ; 0x29a88 <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 29a1e: 81 e0 ldi r24, 0x01 ; 1 29a20: 2e 17 cp r18, r30 29a22: 3f 07 cpc r19, r31 29a24: 08 f4 brcc .+2 ; 0x29a28 <__vector_17+0x1162> 29a26: 49 c0 rjmp .+146 ; 0x29aba <__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); 29a28: 80 e0 ldi r24, 0x00 ; 0 29a2a: 47 c0 rjmp .+142 ; 0x29aba <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 29a2c: 64 30 cpi r22, 0x04 ; 4 29a2e: 28 f5 brcc .+74 ; 0x29a7a <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 29a30: 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); 29a32: 63 30 cpi r22, 0x03 ; 3 29a34: a9 f0 breq .+42 ; 0x29a60 <__vector_17+0x119a> 29a36: 66 95 lsr r22 29a38: af 01 movw r20, r30 29a3a: 02 c0 rjmp .+4 ; 0x29a40 <__vector_17+0x117a> 29a3c: 56 95 lsr r21 29a3e: 47 95 ror r20 29a40: 6a 95 dec r22 29a42: e2 f7 brpl .-8 ; 0x29a3c <__vector_17+0x1176> 29a44: 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); 29a46: 70 93 70 05 sts 0x0570, r23 ; 0x800570 29a4a: 60 93 6f 05 sts 0x056F, r22 ; 0x80056f } nextAdvanceISR = eISR_Rate; 29a4e: 80 91 6f 05 lds r24, 0x056F ; 0x80056f 29a52: 90 91 70 05 lds r25, 0x0570 ; 0x800570 29a56: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 29a5a: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> 29a5e: d3 cf rjmp .-90 ; 0x29a06 <__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; 29a60: 9f 01 movw r18, r30 29a62: ab ea ldi r26, 0xAB ; 171 29a64: ba ea ldi r27, 0xAA ; 170 29a66: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> 29a6a: 41 e1 ldi r20, 0x11 ; 17 29a6c: 96 95 lsr r25 29a6e: 87 95 ror r24 29a70: 77 95 ror r23 29a72: 67 95 ror r22 29a74: 4a 95 dec r20 29a76: d1 f7 brne .-12 ; 0x29a6c <__vector_17+0x11a6> 29a78: e6 cf rjmp .-52 ; 0x29a46 <__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); 29a7a: 70 e0 ldi r23, 0x00 ; 0 29a7c: 6f 5f subi r22, 0xFF ; 255 29a7e: 7f 4f sbci r23, 0xFF ; 255 29a80: cf 01 movw r24, r30 29a82: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 29a86: df cf rjmp .-66 ; 0x29a46 <__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); 29a88: 83 30 cpi r24, 0x03 ; 3 29a8a: 09 f4 brne .+2 ; 0x29a8e <__vector_17+0x11c8> 29a8c: cf c0 rjmp .+414 ; 0x29c2c <__vector_17+0x1366> 29a8e: 86 95 lsr r24 29a90: a9 01 movw r20, r18 29a92: 02 c0 rjmp .+4 ; 0x29a98 <__vector_17+0x11d2> 29a94: 56 95 lsr r21 29a96: 47 95 ror r20 29a98: 8a 95 dec r24 29a9a: e2 f7 brpl .-8 ; 0x29a94 <__vector_17+0x11ce> 29a9c: 13 30 cpi r17, 0x03 ; 3 29a9e: 09 f4 brne .+2 ; 0x29aa2 <__vector_17+0x11dc> 29aa0: d3 c0 rjmp .+422 ; 0x29c48 <__vector_17+0x1382> 29aa2: 16 95 lsr r17 29aa4: bf 01 movw r22, r30 29aa6: 02 c0 rjmp .+4 ; 0x29aac <__vector_17+0x11e6> 29aa8: 76 95 lsr r23 29aaa: 67 95 ror r22 29aac: 1a 95 dec r17 29aae: e2 f7 brpl .-8 ; 0x29aa8 <__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); 29ab0: 81 e0 ldi r24, 0x01 ; 1 29ab2: 46 17 cp r20, r22 29ab4: 57 07 cpc r21, r23 29ab6: 08 f0 brcs .+2 ; 0x29aba <__vector_17+0x11f4> 29ab8: b7 cf rjmp .-146 ; 0x29a28 <__vector_17+0x1162> 29aba: 80 93 91 05 sts 0x0591, r24 ; 0x800591 } } // 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(); 29abe: 0f 94 1a 15 call 0x22a34 ; 0x22a34 #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 29ac2: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 29ac6: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 29aca: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 29ace: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 29ad2: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 29ad6: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 29ada: 80 89 ldd r24, Z+16 ; 0x10 29adc: 91 89 ldd r25, Z+17 ; 0x11 29ade: a2 89 ldd r26, Z+18 ; 0x12 29ae0: b3 89 ldd r27, Z+19 ; 0x13 29ae2: 48 17 cp r20, r24 29ae4: 59 07 cpc r21, r25 29ae6: 6a 07 cpc r22, r26 29ae8: 7b 07 cpc r23, r27 29aea: 80 f0 brcs .+32 ; 0x29b0c <__vector_17+0x1246> current_block = NULL; 29aec: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 29af0: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 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) { 29af4: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 29af8: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 29afc: 98 17 cp r25, r24 29afe: 31 f0 breq .+12 ; 0x29b0c <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 29b00: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 29b04: 8f 5f subi r24, 0xFF ; 255 29b06: 8f 70 andi r24, 0x0F ; 15 29b08: 80 93 a6 0d sts 0x0DA6, r24 ; 0x800da6 return mask; } void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) 29b0c: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 29b10: 81 30 cpi r24, 0x01 ; 1 29b12: 49 f1 breq .+82 ; 0x29b66 <__vector_17+0x12a0> 29b14: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 29b18: 88 23 and r24, r24 29b1a: 29 f1 breq .+74 ; 0x29b66 <__vector_17+0x12a0> 29b1c: 80 91 43 06 lds r24, 0x0643 ; 0x800643 29b20: 81 11 cpse r24, r1 29b22: 21 c0 rjmp .+66 ; 0x29b66 <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 29b24: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 29b28: 81 e0 ldi r24, 0x01 ; 1 29b2a: 29 2f mov r18, r25 29b2c: 24 70 andi r18, 0x04 ; 4 29b2e: 92 fd sbrc r25, 2 29b30: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 29b32: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 29b36: 82 60 ori r24, 0x02 ; 2 29b38: 97 ff sbrs r25, 7 29b3a: 03 c0 rjmp .+6 ; 0x29b42 <__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) { 29b3c: 21 11 cpse r18, r1 29b3e: 13 c0 rjmp .+38 ; 0x29b66 <__vector_17+0x12a0> 29b40: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 29b42: 80 93 0d 05 sts 0x050D, r24 ; 0x80050d tmc2130_sg_stop_on_crash = false; 29b46: 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 29b4a: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.483+0x8> 29b4e: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.483+0x9> 29b52: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.483+0xa> 29b56: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.483+0xb> 29b5a: 20 e0 ldi r18, 0x00 ; 0 29b5c: 30 e0 ldi r19, 0x00 ; 0 29b5e: 40 e8 ldi r20, 0x80 ; 128 29b60: 5f eb ldi r21, 0xBF ; 191 29b62: 0e 94 bf 88 call 0x1117e ; 0x1117e WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 29b66: 60 91 e3 04 lds r22, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> 29b6a: 70 91 e4 04 lds r23, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> if (eisr) 29b6e: 61 15 cp r22, r1 29b70: 71 05 cpc r23, r1 29b72: 09 f0 breq .+2 ; 0x29b76 <__vector_17+0x12b0> 29b74: 46 c0 rjmp .+140 ; 0x29c02 <__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) { 29b76: 40 91 df 04 lds r20, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 29b7a: 50 91 e0 04 lds r21, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 29b7e: 20 91 93 05 lds r18, 0x0593 ; 0x800593 29b82: 30 91 94 05 lds r19, 0x0594 ; 0x800594 29b86: 80 91 92 05 lds r24, 0x0592 ; 0x800592 29b8a: 24 17 cp r18, r20 29b8c: 35 07 cpc r19, r21 29b8e: 08 f0 brcs .+2 ; 0x29b92 <__vector_17+0x12cc> 29b90: 6c c0 rjmp .+216 ; 0x29c6a <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 29b92: 90 91 71 05 lds r25, 0x0571 ; 0x800571 29b96: 91 30 cpi r25, 0x01 ; 1 29b98: 41 f0 breq .+16 ; 0x29baa <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 29b9a: 42 1b sub r20, r18 29b9c: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 29b9e: 94 17 cp r25, r20 29ba0: 15 06 cpc r1, r21 29ba2: 19 f0 breq .+6 ; 0x29baa <__vector_17+0x12e4> 29ba4: 10 f0 brcs .+4 ; 0x29baa <__vector_17+0x12e4> e_step_loops = d_steps; 29ba6: 40 93 71 05 sts 0x0571, r20 ; 0x800571 } e_steps -= e_step_loops; 29baa: 90 91 71 05 lds r25, 0x0571 ; 0x800571 29bae: 89 1b sub r24, r25 29bb0: 80 93 92 05 sts 0x0592, r24 ; 0x800592 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 29bb4: 88 23 and r24, r24 29bb6: 39 f0 breq .+14 ; 0x29bc6 <__vector_17+0x1300> 29bb8: 87 fd sbrc r24, 7 29bba: 53 c0 rjmp .+166 ; 0x29c62 <__vector_17+0x139c> 29bbc: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29bc0: 80 64 ori r24, 0x40 ; 64 29bc2: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 29bc6: 20 91 71 05 lds r18, 0x0571 ; 0x800571 29bca: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 29bce: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 29bd2: 82 1b sub r24, r18 29bd4: 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; 29bd6: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 29bda: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> } if (current_adv_steps == target_adv_steps) { 29bde: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 29be2: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 29be6: 80 91 93 05 lds r24, 0x0593 ; 0x800593 29bea: 90 91 94 05 lds r25, 0x0594 ; 0x800594 29bee: 28 17 cp r18, r24 29bf0: 39 07 cpc r19, r25 29bf2: 09 f0 breq .+2 ; 0x29bf6 <__vector_17+0x1330> 29bf4: 66 c0 rjmp .+204 ; 0x29cc2 <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 29bf6: 8f ef ldi r24, 0xFF ; 255 29bf8: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 29bfa: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 29bfe: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 29c02: 40 91 92 05 lds r20, 0x0592 ; 0x800592 29c06: 41 11 cpse r20, r1 29c08: 61 c0 rjmp .+194 ; 0x29ccc <__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) 29c0a: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> 29c0e: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 29c12: 20 91 e5 04 lds r18, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.478> 29c16: 30 91 e6 04 lds r19, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.478+0x1> 29c1a: 8f 3f cpi r24, 0xFF ; 255 29c1c: 98 07 cpc r25, r24 29c1e: 09 f0 breq .+2 ; 0x29c22 <__vector_17+0x135c> 29c20: 98 c0 rjmp .+304 ; 0x29d52 <__vector_17+0x148c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 29c22: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29c26: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 29c2a: 9e c0 rjmp .+316 ; 0x29d68 <__vector_17+0x14a2> // @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; 29c2c: ab ea ldi r26, 0xAB ; 171 29c2e: ba ea ldi r27, 0xAA ; 170 29c30: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> 29c34: ab 01 movw r20, r22 29c36: bc 01 movw r22, r24 29c38: 31 e1 ldi r19, 0x11 ; 17 29c3a: 76 95 lsr r23 29c3c: 67 95 ror r22 29c3e: 57 95 ror r21 29c40: 47 95 ror r20 29c42: 3a 95 dec r19 29c44: d1 f7 brne .-12 ; 0x29c3a <__vector_17+0x1374> 29c46: 2a cf rjmp .-428 ; 0x29a9c <__vector_17+0x11d6> 29c48: 9f 01 movw r18, r30 29c4a: ab ea ldi r26, 0xAB ; 171 29c4c: ba ea ldi r27, 0xAA ; 170 29c4e: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> 29c52: 21 e1 ldi r18, 0x11 ; 17 29c54: 96 95 lsr r25 29c56: 87 95 ror r24 29c58: 77 95 ror r23 29c5a: 67 95 ror r22 29c5c: 2a 95 dec r18 29c5e: d1 f7 brne .-12 ; 0x29c54 <__vector_17+0x138e> 29c60: 27 cf rjmp .-434 ; 0x29ab0 <__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); 29c62: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29c66: 8f 7b andi r24, 0xBF ; 191 29c68: ac cf rjmp .-168 ; 0x29bc2 <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 29c6a: 42 17 cp r20, r18 29c6c: 53 07 cpc r21, r19 29c6e: 08 f0 brcs .+2 ; 0x29c72 <__vector_17+0x13ac> 29c70: b6 cf rjmp .-148 ; 0x29bde <__vector_17+0x1318> // compression if (e_step_loops != 1) { 29c72: 90 91 71 05 lds r25, 0x0571 ; 0x800571 29c76: 91 30 cpi r25, 0x01 ; 1 29c78: 41 f0 breq .+16 ; 0x29c8a <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 29c7a: 24 1b sub r18, r20 29c7c: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 29c7e: 92 17 cp r25, r18 29c80: 13 06 cpc r1, r19 29c82: 19 f0 breq .+6 ; 0x29c8a <__vector_17+0x13c4> 29c84: 10 f0 brcs .+4 ; 0x29c8a <__vector_17+0x13c4> e_step_loops = d_steps; 29c86: 20 93 71 05 sts 0x0571, r18 ; 0x800571 } e_steps += e_step_loops; 29c8a: 90 91 71 05 lds r25, 0x0571 ; 0x800571 29c8e: 89 0f add r24, r25 29c90: 80 93 92 05 sts 0x0592, r24 ; 0x800592 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 29c94: 88 23 and r24, r24 29c96: 39 f0 breq .+14 ; 0x29ca6 <__vector_17+0x13e0> 29c98: 87 fd sbrc r24, 7 29c9a: 0f c0 rjmp .+30 ; 0x29cba <__vector_17+0x13f4> 29c9c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29ca0: 80 64 ori r24, 0x40 ; 64 29ca2: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 29ca6: 80 91 71 05 lds r24, 0x0571 ; 0x800571 29caa: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> 29cae: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 29cb2: 82 0f add r24, r18 29cb4: 93 2f mov r25, r19 29cb6: 91 1d adc r25, r1 29cb8: 8e cf rjmp .-228 ; 0x29bd6 <__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); 29cba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29cbe: 8f 7b andi r24, 0xBF ; 191 29cc0: f0 cf rjmp .-32 ; 0x29ca2 <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 29cc2: 80 91 6f 05 lds r24, 0x056F ; 0x80056f 29cc6: 90 91 70 05 lds r25, 0x0570 ; 0x800570 29cca: 97 cf rjmp .-210 ; 0x29bfa <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 29ccc: 80 91 91 05 lds r24, 0x0591 ; 0x800591 29cd0: 87 fd sbrc r24, 7 29cd2: 0e c0 rjmp .+28 ; 0x29cf0 <__vector_17+0x142a> 29cd4: 08 2e mov r0, r24 29cd6: 00 0c add r0, r0 29cd8: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 29cda: 21 e0 ldi r18, 0x01 ; 1 29cdc: 30 e0 ldi r19, 0x00 ; 0 29cde: 61 15 cp r22, r1 29ce0: 71 05 cpc r23, r1 29ce2: 11 f0 breq .+4 ; 0x29ce8 <__vector_17+0x1422> 29ce4: 30 e0 ldi r19, 0x00 ; 0 29ce6: 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)) { 29ce8: 82 17 cp r24, r18 29cea: 93 07 cpc r25, r19 29cec: 09 f0 breq .+2 ; 0x29cf0 <__vector_17+0x142a> 29cee: 8d cf rjmp .-230 ; 0x29c0a <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 29cf0: 20 91 71 05 lds r18, 0x0571 ; 0x800571 29cf4: 67 2b or r22, r23 29cf6: 11 f0 breq .+4 ; 0x29cfc <__vector_17+0x1436> 29cf8: 20 91 99 05 lds r18, 0x0599 ; 0x800599 max_ticks = min(abs(e_steps), max_ticks); 29cfc: 84 2f mov r24, r20 29cfe: 04 2e mov r0, r20 29d00: 00 0c add r0, r0 29d02: 99 0b sbc r25, r25 29d04: 97 ff sbrs r25, 7 29d06: 03 c0 rjmp .+6 ; 0x29d0e <__vector_17+0x1448> 29d08: 91 95 neg r25 29d0a: 81 95 neg r24 29d0c: 91 09 sbc r25, r1 29d0e: 30 e0 ldi r19, 0x00 ; 0 29d10: 28 17 cp r18, r24 29d12: 39 07 cpc r19, r25 29d14: 0c f4 brge .+2 ; 0x29d18 <__vector_17+0x1452> 29d16: c9 01 movw r24, r18 29d18: 47 ff sbrs r20, 7 29d1a: 17 c0 rjmp .+46 ; 0x29d4a <__vector_17+0x1484> 29d1c: 61 e0 ldi r22, 0x01 ; 1 29d1e: 4f ef ldi r20, 0xFF ; 255 29d20: 5f ef ldi r21, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 29d22: 78 e0 ldi r23, 0x08 ; 8 29d24: 76 b9 out 0x06, r23 ; 6 e_steps += (rev? 1: -1); 29d26: 90 91 92 05 lds r25, 0x0592 ; 0x800592 29d2a: 96 0f add r25, r22 29d2c: 90 93 92 05 sts 0x0592, r25 ; 0x800592 void setJamDetectionEnabled(bool state, bool updateEEPROM = false); bool getJamDetectionEnabled() const { return jamDetection; } void stStep(bool rev) { //from stepper isr stepCount += rev ? -1 : 1; 29d30: 20 91 bb 17 lds r18, 0x17BB ; 0x8017bb 29d34: 30 91 bc 17 lds r19, 0x17BC ; 0x8017bc 29d38: 24 0f add r18, r20 29d3a: 35 1f adc r19, r21 29d3c: 30 93 bc 17 sts 0x17BC, r19 ; 0x8017bc 29d40: 20 93 bb 17 sts 0x17BB, r18 ; 0x8017bb 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); 29d44: 81 50 subi r24, 0x01 ; 1 29d46: 71 f7 brne .-36 ; 0x29d24 <__vector_17+0x145e> 29d48: 60 cf rjmp .-320 ; 0x29c0a <__vector_17+0x1344> 29d4a: 6f ef ldi r22, 0xFF ; 255 29d4c: 41 e0 ldi r20, 0x01 ; 1 29d4e: 50 e0 ldi r21, 0x00 ; 0 29d50: e8 cf rjmp .-48 ; 0x29d22 <__vector_17+0x145c> } // 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) 29d52: ac 01 movw r20, r24 29d54: 48 5d subi r20, 0xD8 ; 216 29d56: 5f 4f sbci r21, 0xFF ; 255 29d58: 42 17 cp r20, r18 29d5a: 53 07 cpc r21, r19 29d5c: 08 f0 brcs .+2 ; 0x29d60 <__vector_17+0x149a> 29d5e: 61 cf rjmp .-318 ; 0x29c22 <__vector_17+0x135c> OCR1A = nextAdvanceISR; 29d60: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29d64: 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) { 29d68: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 29d6c: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29d70: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 29d74: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 29d78: 40 96 adiw r24, 0x10 ; 16 29d7a: 28 17 cp r18, r24 29d7c: 39 07 cpc r19, r25 29d7e: 48 f4 brcc .+18 ; 0x29d92 <__vector_17+0x14cc> // 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; 29d80: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 29d84: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 29d88: 40 96 adiw r24, 0x10 ; 16 29d8a: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29d8e: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 29d92: ff 91 pop r31 29d94: ef 91 pop r30 29d96: df 91 pop r29 29d98: cf 91 pop r28 29d9a: bf 91 pop r27 29d9c: af 91 pop r26 29d9e: 9f 91 pop r25 29da0: 8f 91 pop r24 29da2: 7f 91 pop r23 29da4: 6f 91 pop r22 29da6: 5f 91 pop r21 29da8: 4f 91 pop r20 29daa: 3f 91 pop r19 29dac: 2f 91 pop r18 29dae: 1f 91 pop r17 29db0: 0f 91 pop r16 29db2: ff 90 pop r15 29db4: ef 90 pop r14 29db6: df 90 pop r13 29db8: cf 90 pop r12 29dba: 8f 90 pop r8 29dbc: 7f 90 pop r7 29dbe: 6f 90 pop r6 29dc0: 0f 90 pop r0 29dc2: 0b be out 0x3b, r0 ; 59 29dc4: 0f 90 pop r0 29dc6: 0f be out 0x3f, r0 ; 63 29dc8: 0f 90 pop r0 29dca: 1f 90 pop r1 29dcc: 18 95 reti 00029dce : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 29dce: 90 91 78 05 lds r25, 0x0578 ; 0x800578 check_z_endstop = check; 29dd2: 80 93 78 05 sts 0x0578, r24 ; 0x800578 CRITICAL_SECTION_START; 29dd6: 2f b7 in r18, 0x3f ; 63 29dd8: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 29dda: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.482> 29dde: 8b 7f andi r24, 0xFB ; 251 29de0: 80 93 0b 05 sts 0x050B, r24 ; 0x80050b <_ZL11endstop_hit.lto_priv.482> CRITICAL_SECTION_END; 29de4: 2f bf out 0x3f, r18 ; 63 return old; } 29de6: 89 2f mov r24, r25 29de8: 08 95 ret 00029dea : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 29dea: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.482> CRITICAL_SECTION_START; 29dee: 2f b7 in r18, 0x3f ; 63 29df0: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 29df2: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.482> 29df6: 9b 7f andi r25, 0xFB ; 251 29df8: 90 93 0b 05 sts 0x050B, r25 ; 0x80050b <_ZL11endstop_hit.lto_priv.482> CRITICAL_SECTION_END; 29dfc: 2f bf out 0x3f, r18 ; 63 return hit; } 29dfe: 82 fb bst r24, 2 29e00: 88 27 eor r24, r24 29e02: 80 f9 bld r24, 0 29e04: 08 95 ret 00029e06 : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 29e06: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.482> endstop_hit = 0; 29e0a: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.482> return old; 29e0e: 81 e0 ldi r24, 0x01 ; 1 29e10: 91 11 cpse r25, r1 29e12: 01 c0 rjmp .+2 ; 0x29e16 29e14: 80 e0 ldi r24, 0x00 ; 0 } 29e16: 08 95 ret 00029e18 : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 29e18: 90 91 de 04 lds r25, 0x04DE ; 0x8004de 29e1c: 91 30 cpi r25, 0x01 ; 1 29e1e: a1 f0 breq .+40 ; 0x29e48 29e20: 28 f0 brcs .+10 ; 0x29e2c 29e22: 92 30 cpi r25, 0x02 ; 2 29e24: a9 f0 breq .+42 ; 0x29e50 29e26: 93 30 cpi r25, 0x03 ; 3 29e28: c1 f0 breq .+48 ; 0x29e5a 29e2a: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 29e2c: 81 11 cpse r24, r1 29e2e: 02 c0 rjmp .+4 ; 0x29e34 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(); 29e30: 0d 94 82 15 jmp 0x22b04 ; 0x22b04 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29e34: 82 30 cpi r24, 0x02 ; 2 29e36: 11 f4 brne .+4 ; 0x29e3c break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 29e38: 0d 94 74 20 jmp 0x240e8 ; 0x240e8 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) 29e3c: 85 30 cpi r24, 0x05 ; 5 29e3e: 09 f0 breq .+2 ; 0x29e42 29e40: 50 c0 rjmp .+160 ; 0x29ee2 Sound_DoSound_Alert(false); 29e42: 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); 29e44: 0d 94 60 15 jmp 0x22ac0 ; 0x22ac0 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) 29e48: 88 23 and r24, r24 29e4a: 91 f3 breq .-28 ; 0x29e30 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29e4c: 82 30 cpi r24, 0x02 ; 2 29e4e: a1 f3 breq .-24 ; 0x29e38 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 29e50: 85 30 cpi r24, 0x05 ; 5 29e52: 09 f0 breq .+2 ; 0x29e56 29e54: 46 c0 rjmp .+140 ; 0x29ee2 Sound_DoSound_Alert(true); 29e56: 81 e0 ldi r24, 0x01 ; 1 29e58: f5 cf rjmp .-22 ; 0x29e44 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) 29e5a: 88 23 and r24, r24 29e5c: 49 f3 breq .-46 ; 0x29e30 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29e5e: 82 30 cpi r24, 0x02 ; 2 29e60: 59 f3 breq .-42 ; 0x29e38 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 29e62: 85 30 cpi r24, 0x05 ; 5 29e64: 71 f3 breq .-36 ; 0x29e42 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 29e66: 86 30 cpi r24, 0x06 ; 6 29e68: e1 f4 brne .+56 ; 0x29ea2 29e6a: 85 e0 ldi r24, 0x05 ; 5 29e6c: 27 e2 ldi r18, 0x27 ; 39 29e6e: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 29e70: 4f b7 in r20, 0x3f ; 63 29e72: f8 94 cli 29e74: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e78: 94 60 ori r25, 0x04 ; 4 29e7a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e7e: 4f bf out 0x3f, r20 ; 63 29e80: f9 01 movw r30, r18 29e82: 31 97 sbiw r30, 0x01 ; 1 29e84: f1 f7 brne .-4 ; 0x29e82 delayMicroseconds(75); WRITE(BEEPER,LOW); 29e86: 4f b7 in r20, 0x3f ; 63 29e88: f8 94 cli 29e8a: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e8e: 9b 7f andi r25, 0xFB ; 251 29e90: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e94: 4f bf out 0x3f, r20 ; 63 29e96: f9 01 movw r30, r18 29e98: 31 97 sbiw r30, 0x01 ; 1 29e9a: f1 f7 brne .-4 ; 0x29e98 29e9c: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 29e9e: 41 f7 brne .-48 ; 0x29e70 29ea0: 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) 29ea2: 87 30 cpi r24, 0x07 ; 7 29ea4: f1 f4 brne .+60 ; 0x29ee2 } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 29ea6: 81 e0 ldi r24, 0x01 ; 1 29ea8: 0e 94 f5 89 call 0x113ea ; 0x113ea 29eac: 84 e1 ldi r24, 0x14 ; 20 29eae: 23 e7 ldi r18, 0x73 ; 115 29eb0: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 29eb2: 4f b7 in r20, 0x3f ; 63 29eb4: f8 94 cli 29eb6: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29eba: 94 60 ori r25, 0x04 ; 4 29ebc: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29ec0: 4f bf out 0x3f, r20 ; 63 29ec2: f9 01 movw r30, r18 29ec4: 31 97 sbiw r30, 0x01 ; 1 29ec6: f1 f7 brne .-4 ; 0x29ec4 delayMicroseconds(94); WRITE(BEEPER,LOW); 29ec8: 4f b7 in r20, 0x3f ; 63 29eca: f8 94 cli 29ecc: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29ed0: 9b 7f andi r25, 0xFB ; 251 29ed2: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29ed6: 4f bf out 0x3f, r20 ; 63 29ed8: f9 01 movw r30, r18 29eda: 31 97 sbiw r30, 0x01 ; 1 29edc: f1 f7 brne .-4 ; 0x29eda 29ede: 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++) 29ee0: 41 f7 brne .-48 ; 0x29eb2 Sound_DoSound_Blind_Alert(); break; default: break; } } 29ee2: 08 95 ret 00029ee4 : //! @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 ) { 29ee4: 2f 92 push r2 29ee6: 3f 92 push r3 29ee8: 4f 92 push r4 29eea: 5f 92 push r5 29eec: 6f 92 push r6 29eee: 7f 92 push r7 29ef0: 8f 92 push r8 29ef2: 9f 92 push r9 29ef4: af 92 push r10 29ef6: bf 92 push r11 29ef8: cf 92 push r12 29efa: df 92 push r13 29efc: ef 92 push r14 29efe: ff 92 push r15 29f00: 0f 93 push r16 29f02: 1f 93 push r17 29f04: cf 93 push r28 29f06: df 93 push r29 29f08: 00 d0 rcall .+0 ; 0x29f0a 29f0a: 00 d0 rcall .+0 ; 0x29f0c 29f0c: cd b7 in r28, 0x3d ; 61 29f0e: de b7 in r29, 0x3e ; 62 29f10: 5c 01 movw r10, r24 29f12: 6c 83 std Y+4, r22 ; 0x04 29f14: 34 2e mov r3, r20 29f16: 3b 83 std Y+3, r19 ; 0x03 29f18: 2a 83 std Y+2, r18 ; 0x02 29f1a: 48 01 movw r8, r16 29f1c: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 29f1e: 00 97 sbiw r24, 0x00 ; 0 29f20: 09 f0 breq .+2 ; 0x29f24 29f22: 51 c0 rjmp .+162 ; 0x29fc6 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); 29f24: 87 01 movw r16, r14 29f26: 22 2d mov r18, r2 29f28: a4 01 movw r20, r8 29f2a: 6a 81 ldd r22, Y+2 ; 0x02 29f2c: 7b 81 ldd r23, Y+3 ; 0x03 29f2e: 83 2d mov r24, r3 29f30: 0f 94 98 20 call 0x24130 ; 0x24130 29f34: d1 2c mov r13, r1 29f36: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 29f38: 0f 94 51 2a call 0x254a2 ; 0x254a2 29f3c: 2b 01 movw r4, r22 29f3e: 3c 01 movw r6, r24 lcd_consume_click(); 29f40: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 KEEPALIVE_STATE(PAUSED_FOR_USER); 29f44: 84 e0 ldi r24, 0x04 ; 4 29f46: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 29f4a: de 82 std Y+6, r13 ; 0x06 29f4c: cd 82 std Y+5, r12 ; 0x05 29f4e: 24 e6 ldi r18, 0x64 ; 100 29f50: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 29f52: 82 e3 ldi r24, 0x32 ; 50 29f54: 90 e0 ldi r25, 0x00 ; 0 29f56: 0e 94 6c 8c call 0x118d8 ; 0x118d8 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 29f5a: 3c 81 ldd r19, Y+4 ; 0x04 29f5c: 31 11 cpse r19, r1 29f5e: 3a c0 rjmp .+116 ; 0x29fd4 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 29f60: 80 91 70 06 lds r24, 0x0670 ; 0x800670 29f64: 90 91 71 06 lds r25, 0x0671 ; 0x800671 29f68: 00 97 sbiw r24, 0x00 ; 0 29f6a: 09 f0 breq .+2 ; 0x29f6e 29f6c: 42 c0 rjmp .+132 ; 0x29ff2 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 29f6e: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 29f72: 88 23 and r24, r24 29f74: 09 f4 brne .+2 ; 0x29f78 29f76: 67 c0 rjmp .+206 ; 0x2a046 if (msg_next == NULL) { 29f78: 8d 81 ldd r24, Y+5 ; 0x05 29f7a: 9e 81 ldd r25, Y+6 ; 0x06 29f7c: 89 2b or r24, r25 29f7e: 09 f0 breq .+2 ; 0x29f82 29f80: 5e c0 rjmp .+188 ; 0x2a03e if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 29f82: 82 e0 ldi r24, 0x02 ; 2 29f84: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // 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; 29f88: 91 e0 ldi r25, 0x01 ; 1 29f8a: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 29f8e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 29f92: 83 2d mov r24, r3 29f94: 26 96 adiw r28, 0x06 ; 6 29f96: 0f b6 in r0, 0x3f ; 63 29f98: f8 94 cli 29f9a: de bf out 0x3e, r29 ; 62 29f9c: 0f be out 0x3f, r0 ; 63 29f9e: cd bf out 0x3d, r28 ; 61 29fa0: df 91 pop r29 29fa2: cf 91 pop r28 29fa4: 1f 91 pop r17 29fa6: 0f 91 pop r16 29fa8: ff 90 pop r15 29faa: ef 90 pop r14 29fac: df 90 pop r13 29fae: cf 90 pop r12 29fb0: bf 90 pop r11 29fb2: af 90 pop r10 29fb4: 9f 90 pop r9 29fb6: 8f 90 pop r8 29fb8: 7f 90 pop r7 29fba: 6f 90 pop r6 29fbc: 5f 90 pop r5 29fbe: 4f 90 pop r4 29fc0: 3f 90 pop r3 29fc2: 2f 90 pop r2 29fc4: 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; 29fc6: 0f 94 e9 20 call 0x241d2 ; 0x241d2 29fca: 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) { 29fcc: 89 2b or r24, r25 29fce: 09 f0 breq .+2 ; 0x29fd2 29fd0: b3 cf rjmp .-154 ; 0x29f38 29fd2: a8 cf rjmp .-176 ; 0x29f24 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) { 29fd4: 0f 94 51 2a call 0x254a2 ; 0x254a2 29fd8: 64 19 sub r22, r4 29fda: 75 09 sbc r23, r5 29fdc: 86 09 sbc r24, r6 29fde: 97 09 sbc r25, r7 29fe0: 61 33 cpi r22, 0x31 ; 49 29fe2: 75 47 sbci r23, 0x75 ; 117 29fe4: 81 05 cpc r24, r1 29fe6: 91 05 cpc r25, r1 29fe8: 08 f4 brcc .+2 ; 0x29fec 29fea: ba cf rjmp .-140 ; 0x29f60 current_selection = LCD_BUTTON_TIMEOUT; 29fec: 33 24 eor r3, r3 29fee: 3a 94 dec r3 29ff0: c8 cf rjmp .-112 ; 0x29f82 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 29ff2: 2d 81 ldd r18, Y+5 ; 0x05 29ff4: 3e 81 ldd r19, Y+6 ; 0x06 29ff6: 23 2b or r18, r19 29ff8: f9 f4 brne .+62 ; 0x2a038 if (third_choice) { // third_choice is not nullptr, safe to dereference 29ffa: e1 14 cp r14, r1 29ffc: f1 04 cpc r15, r1 29ffe: b1 f0 breq .+44 ; 0x2a02c if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2a000: 97 ff sbrs r25, 7 2a002: 0f c0 rjmp .+30 ; 0x2a022 2a004: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 2a006: 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); 2a008: 87 01 movw r16, r14 2a00a: 22 2d mov r18, r2 2a00c: a4 01 movw r20, r8 2a00e: 6a 81 ldd r22, Y+2 ; 0x02 2a010: 7b 81 ldd r23, Y+3 ; 0x03 2a012: 83 2d mov r24, r3 2a014: 0f 94 98 20 call 0x24130 ; 0x24130 lcd_encoder = 0; 2a018: 10 92 71 06 sts 0x0671, r1 ; 0x800671 2a01c: 10 92 70 06 sts 0x0670, r1 ; 0x800670 2a020: a6 cf rjmp .-180 ; 0x29f6e 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) { 2a022: 32 e0 ldi r19, 0x02 ; 2 2a024: 33 16 cp r3, r19 2a026: 81 f3 breq .-32 ; 0x2a008 // Rotating knob clockwise current_selection++; 2a028: 33 94 inc r3 2a02a: ee cf rjmp .-36 ; 0x2a008 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2a02c: 39 2e mov r3, r25 2a02e: 30 94 com r3 2a030: 33 1c adc r3, r3 2a032: 33 24 eor r3, r3 2a034: 33 1c adc r3, r3 2a036: e8 cf rjmp .-48 ; 0x2a008 } } 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); 2a038: 87 e0 ldi r24, 0x07 ; 7 2a03a: 0f 94 0c 4f call 0x29e18 ; 0x29e18 goto exit; } else break; } } if (multi_screen) { 2a03e: c1 14 cp r12, r1 2a040: d1 04 cpc r13, r1 2a042: 79 f4 brne .+30 ; 0x2a062 2a044: 84 cf rjmp .-248 ; 0x29f4e 2a046: 99 81 ldd r25, Y+1 ; 0x01 2a048: 91 50 subi r25, 0x01 ; 1 2a04a: 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) { 2a04c: 91 11 cpse r25, r1 2a04e: 81 cf rjmp .-254 ; 0x29f52 goto exit; } else break; } } if (multi_screen) { 2a050: c1 14 cp r12, r1 2a052: d1 04 cpc r13, r1 2a054: 61 f0 breq .+24 ; 0x2a06e if (msg_next == NULL) { 2a056: 2d 81 ldd r18, Y+5 ; 0x05 2a058: 3e 81 ldd r19, Y+6 ; 0x06 2a05a: 23 2b or r18, r19 2a05c: 11 f4 brne .+4 ; 0x2a062 2a05e: be 82 std Y+6, r11 ; 0x06 2a060: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 2a062: 8d 81 ldd r24, Y+5 ; 0x05 2a064: 9e 81 ldd r25, Y+6 ; 0x06 2a066: 0f 94 e9 20 call 0x241d2 ; 0x241d2 2a06a: 9e 83 std Y+6, r25 ; 0x06 2a06c: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 2a06e: 8d 81 ldd r24, Y+5 ; 0x05 2a070: 9e 81 ldd r25, Y+6 ; 0x06 2a072: 89 2b or r24, r25 2a074: 09 f0 breq .+2 ; 0x2a078 2a076: 6b cf rjmp .-298 ; 0x29f4e lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 2a078: 87 01 movw r16, r14 2a07a: 22 2d mov r18, r2 2a07c: a4 01 movw r20, r8 2a07e: 6a 81 ldd r22, Y+2 ; 0x02 2a080: 7b 81 ldd r23, Y+3 ; 0x03 2a082: 83 2d mov r24, r3 2a084: 0f 94 98 20 call 0x24130 ; 0x24130 2a088: 62 cf rjmp .-316 ; 0x29f4e 0002a08a : //! @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) { 2a08a: bf 92 push r11 2a08c: cf 92 push r12 2a08e: df 92 push r13 2a090: ef 92 push r14 2a092: ff 92 push r15 2a094: 0f 93 push r16 2a096: 1f 93 push r17 2a098: cf 93 push r28 2a09a: df 93 push r29 2a09c: ec 01 movw r28, r24 2a09e: d6 2e mov r13, r22 2a0a0: 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); 2a0a2: 8f e6 ldi r24, 0x6F ; 111 2a0a4: 9b e3 ldi r25, 0x3B ; 59 2a0a6: 0e 94 2c 72 call 0xe458 ; 0xe458 2a0aa: 8c 01 movw r16, r24 2a0ac: 80 e3 ldi r24, 0x30 ; 48 2a0ae: 93 e4 ldi r25, 0x43 ; 67 2a0b0: 0e 94 2c 72 call 0xe458 ; 0xe458 2a0b4: 2a e0 ldi r18, 0x0A ; 10 2a0b6: c2 2e mov r12, r18 2a0b8: f1 2c mov r15, r1 2a0ba: e1 2c mov r14, r1 2a0bc: 9c 01 movw r18, r24 2a0be: 4b 2d mov r20, r11 2a0c0: 6d 2d mov r22, r13 2a0c2: ce 01 movw r24, r28 2a0c4: 0f 94 72 4f call 0x29ee4 ; 0x29ee4 } 2a0c8: df 91 pop r29 2a0ca: cf 91 pop r28 2a0cc: 1f 91 pop r17 2a0ce: 0f 91 pop r16 2a0d0: ff 90 pop r15 2a0d2: ef 90 pop r14 2a0d4: df 90 pop r13 2a0d6: cf 90 pop r12 2a0d8: bf 90 pop r11 2a0da: 08 95 ret 0002a0dc : //! @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) { 2a0dc: bf 92 push r11 2a0de: cf 92 push r12 2a0e0: df 92 push r13 2a0e2: ef 92 push r14 2a0e4: ff 92 push r15 2a0e6: 0f 93 push r16 2a0e8: 1f 93 push r17 2a0ea: cf 93 push r28 2a0ec: df 93 push r29 2a0ee: ec 01 movw r28, r24 2a0f0: d6 2e mov r13, r22 2a0f2: 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); 2a0f4: 8b ef ldi r24, 0xFB ; 251 2a0f6: 97 e4 ldi r25, 0x47 ; 71 2a0f8: 0e 94 2c 72 call 0xe458 ; 0xe458 2a0fc: 8c 01 movw r16, r24 2a0fe: 85 ef ldi r24, 0xF5 ; 245 2a100: 97 e4 ldi r25, 0x47 ; 71 2a102: 0e 94 2c 72 call 0xe458 ; 0xe458 2a106: 2a e0 ldi r18, 0x0A ; 10 2a108: c2 2e mov r12, r18 2a10a: f1 2c mov r15, r1 2a10c: e1 2c mov r14, r1 2a10e: 9c 01 movw r18, r24 2a110: 4b 2d mov r20, r11 2a112: 6d 2d mov r22, r13 2a114: ce 01 movw r24, r28 2a116: 0f 94 72 4f call 0x29ee4 ; 0x29ee4 } 2a11a: df 91 pop r29 2a11c: cf 91 pop r28 2a11e: 1f 91 pop r17 2a120: 0f 91 pop r16 2a122: ff 90 pop r15 2a124: ef 90 pop r14 2a126: df 90 pop r13 2a128: cf 90 pop r12 2a12a: bf 90 pop r11 2a12c: 08 95 ret 0002a12e : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 2a12e: cf 92 push r12 2a130: ef 92 push r14 2a132: ff 92 push r15 2a134: 0f 93 push r16 2a136: 1f 93 push r17 2a138: cf 93 push r28 2a13a: 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); 2a13c: 85 ef ldi r24, 0xF5 ; 245 2a13e: 97 e4 ldi r25, 0x47 ; 71 2a140: 0e 94 2c 72 call 0xe458 ; 0xe458 2a144: 0f 94 12 da call 0x3b424 ; 0x3b424 <__strlen_P> 2a148: c8 2e mov r12, r24 2a14a: 88 e7 ldi r24, 0x78 ; 120 2a14c: 9f e4 ldi r25, 0x4F ; 79 2a14e: 0e 94 2c 72 call 0xe458 ; 0xe458 2a152: 7c 01 movw r14, r24 2a154: 8b ef ldi r24, 0xFB ; 251 2a156: 97 e4 ldi r25, 0x47 ; 71 2a158: 0e 94 2c 72 call 0xe458 ; 0xe458 2a15c: 8c 01 movw r16, r24 2a15e: 85 ef ldi r24, 0xF5 ; 245 2a160: 97 e4 ldi r25, 0x47 ; 71 2a162: 0e 94 2c 72 call 0xe458 ; 0xe458 2a166: ec 01 movw r28, r24 2a168: 8d e4 ldi r24, 0x4D ; 77 2a16a: 9f e4 ldi r25, 0x4F ; 79 2a16c: 0e 94 2c 72 call 0xe458 ; 0xe458 2a170: c3 94 inc r12 2a172: c3 94 inc r12 2a174: 9e 01 movw r18, r28 2a176: 40 e0 ldi r20, 0x00 ; 0 2a178: 60 e0 ldi r22, 0x00 ; 0 2a17a: 0f 94 72 4f call 0x29ee4 ; 0x29ee4 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 2a17e: 81 30 cpi r24, 0x01 ; 1 2a180: 29 f4 brne .+10 ; 0x2a18c load_filament_final_feed(); 2a182: 0e 94 13 64 call 0xc826 ; 0xc826 st_synchronize(); 2a186: 0f 94 ed 43 call 0x287da ; 0x287da 2a18a: d8 cf rjmp .-80 ; 0x2a13c 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) { 2a18c: 82 30 cpi r24, 0x02 ; 2 2a18e: 61 f4 brne .+24 ; 0x2a1a8 unload_filament(FILAMENTCHANGE_FINALRETRACT); 2a190: 60 e0 ldi r22, 0x00 ; 0 2a192: 70 e0 ldi r23, 0x00 ; 0 2a194: cb 01 movw r24, r22 } } 2a196: df 91 pop r29 2a198: cf 91 pop r28 2a19a: 1f 91 pop r17 2a19c: 0f 91 pop r16 2a19e: ff 90 pop r15 2a1a0: ef 90 pop r14 2a1a2: 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); 2a1a4: 0c 94 2d f9 jmp 0x1f25a ; 0x1f25a } } 2a1a8: df 91 pop r29 2a1aa: cf 91 pop r28 2a1ac: 1f 91 pop r17 2a1ae: 0f 91 pop r16 2a1b0: ff 90 pop r15 2a1b2: ef 90 pop r14 2a1b4: cf 90 pop r12 2a1b6: 08 95 ret 0002a1b8 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 2a1b8: 0f 93 push r16 2a1ba: 1f 93 push r17 2a1bc: cf 93 push r28 2a1be: df 93 push r29 2a1c0: 8c 01 movw r16, r24 2a1c2: eb 01 movw r28, r22 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2a1c4: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 2a1c8: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 2a1cc: 0f 94 39 17 call 0x22e72 ; 0x22e72 2a1d0: 81 11 cpse r24, r1 2a1d2: 04 c0 rjmp .+8 ; 0x2a1dc resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2a1d4: d0 93 73 06 sts 0x0673, r29 ; 0x800673 2a1d8: c0 93 72 06 sts 0x0672, r28 ; 0x800672 { const FilamentAction action = eFilamentAction; 2a1dc: c0 91 a7 03 lds r28, 0x03A7 ; 0x8003a7 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 2a1e0: 87 ef ldi r24, 0xF7 ; 247 2a1e2: 8c 0f add r24, r28 2a1e4: 82 30 cpi r24, 0x02 ; 2 2a1e6: f8 f4 brcc .+62 ; 0x2a226 { lcd_return_to_status(); 2a1e8: 0f 94 ab 1f call 0x23f56 ; 0x23f56 if (action == FilamentAction::Lay1Cal) 2a1ec: ca 30 cpi r28, 0x0A ; 10 2a1ee: 41 f4 brne .+16 ; 0x2a200 { lcd_commands_type = LcdCommands::Layer1Cal; 2a1f0: 84 e0 ldi r24, 0x04 ; 4 2a1f2: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 } menu_back(); clearFilamentAction(); } } } 2a1f6: df 91 pop r29 2a1f8: cf 91 pop r28 2a1fa: 1f 91 pop r17 2a1fc: 0f 91 pop r16 2a1fe: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 2a200: 60 e0 ldi r22, 0x00 ; 0 2a202: 70 e0 ldi r23, 0x00 ; 0 2a204: 80 e2 ldi r24, 0x20 ; 32 2a206: 91 e4 ldi r25, 0x41 ; 65 2a208: 0e 94 e0 6d call 0xdbc0 ; 0xdbc0 if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2a20c: 8f e5 ldi r24, 0x5F ; 95 2a20e: 9f e0 ldi r25, 0x0F ; 15 2a210: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2a214: 88 23 and r24, r24 2a216: 79 f3 breq .-34 ; 0x2a1f6 lcd_wizard(WizState::LoadFilHot); 2a218: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 2a21a: df 91 pop r29 2a21c: cf 91 pop r28 2a21e: 1f 91 pop r17 2a220: 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); 2a222: 0c 94 d9 f9 jmp 0x1f3b2 ; 0x1f3b2 2a226: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc 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) 2a22a: 80 91 64 06 lds r24, 0x0664 ; 0x800664 2a22e: 81 11 cpse r24, r1 2a230: 12 c0 rjmp .+36 ; 0x2a256 2a232: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 2a236: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 2a23a: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 2a23e: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 2a242: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2a246: 60 1b sub r22, r16 2a248: 71 0b sbc r23, r17 2a24a: 6c 5f subi r22, 0xFC ; 252 2a24c: 7f 4f sbci r23, 0xFF ; 255 2a24e: 69 30 cpi r22, 0x09 ; 9 2a250: 71 05 cpc r23, r1 2a252: 08 f0 brcs .+2 ; 0x2a256 2a254: 60 c0 rjmp .+192 ; 0x2a316 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 2a256: c1 50 subi r28, 0x01 ; 1 2a258: c8 30 cpi r28, 0x08 ; 8 2a25a: 88 f5 brcc .+98 ; 0x2a2be 2a25c: ec 2f mov r30, r28 2a25e: f0 e0 ldi r31, 0x00 ; 0 2a260: 88 27 eor r24, r24 2a262: ea 5c subi r30, 0xCA ; 202 2a264: fe 4a sbci r31, 0xAE ; 174 2a266: 8e 4f sbci r24, 0xFE ; 254 2a268: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 2a26c: 9e 39 cpi r25, 0x9E ; 158 2a26e: 9e 39 cpi r25, 0x9E ; 158 2a270: 9e 39 cpi r25, 0x9E ; 158 2a272: f2 38 cpi r31, 0x82 ; 130 2a274: 9a 3a cpi r25, 0xAA ; 170 2a276: fc 39 cpi r31, 0x9C ; 156 2a278: 66 3a cpi r22, 0xA6 ; 166 2a27a: b2 3a cpi r27, 0xA2 ; 162 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2a27c: cf e3 ldi r28, 0x3F ; 63 2a27e: d2 ee ldi r29, 0xE2 ; 226 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2a280: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a284: 88 23 and r24, r24 2a286: 29 f0 breq .+10 ; 0x2a292 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2a288: 82 e0 ldi r24, 0x02 ; 2 2a28a: 0f 94 0c 4f call 0x29e18 ; 0x29e18 bFilamentWaitingFlag = false; 2a28e: 10 92 62 06 sts 0x0662, r1 ; 0x800662 } if (filamentActionMenu) { 2a292: 20 97 sbiw r28, 0x00 ; 0 2a294: 09 f4 brne .+2 ; 0x2a298 2a296: af cf rjmp .-162 ; 0x2a1f6 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2a298: 0f 94 c6 1d call 0x23b8c ; 0x23b8c // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2a29c: 61 e0 ldi r22, 0x01 ; 1 2a29e: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2a2a0: df 91 pop r29 2a2a2: cf 91 pop r28 2a2a4: 1f 91 pop r17 2a2a6: 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); 2a2a8: 0d 94 3b d3 jmp 0x3a676 ; 0x3a676 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2a2ac: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a2b0: 88 23 and r24, r24 2a2b2: 41 f0 breq .+16 ; 0x2a2c4 2a2b4: 61 e0 ldi r22, 0x01 ; 1 2a2b6: 86 ec ldi r24, 0xC6 ; 198 2a2b8: 98 e3 ldi r25, 0x38 ; 56 2a2ba: 0f 94 3b d3 call 0x3a676 ; 0x3a676 // 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; 2a2be: d0 e0 ldi r29, 0x00 ; 0 2a2c0: c0 e0 ldi r28, 0x00 ; 0 2a2c2: de cf rjmp .-68 ; 0x2a280 case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2a2c4: 0f 94 c6 1d call 0x23b8c ; 0x23b8c if (eFilamentAction == FilamentAction::AutoLoad) { 2a2c8: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2a2cc: 82 30 cpi r24, 0x02 ; 2 2a2ce: 19 f4 brne .+6 ; 0x2a2d6 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2a2d0: 81 e0 ldi r24, 0x01 ; 1 2a2d2: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } if (eFilamentAction == FilamentAction::Load) 2a2d6: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2a2da: 81 30 cpi r24, 0x01 ; 1 2a2dc: 31 f4 brne .+12 ; 0x2a2ea enquecommand_P(MSG_M701); // load filament 2a2de: 61 e0 ldi r22, 0x01 ; 1 2a2e0: 8f ea ldi r24, 0xAF ; 175 2a2e2: 9e e6 ldi r25, 0x6E ; 110 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2a2e4: 0e 94 a0 87 call 0x10f40 ; 0x10f40 2a2e8: ea cf rjmp .-44 ; 0x2a2be eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 2a2ea: 83 30 cpi r24, 0x03 ; 3 2a2ec: 41 f7 brne .-48 ; 0x2a2be enquecommand_P(MSG_M702); // unload filament 2a2ee: 61 e0 ldi r22, 0x01 ; 1 2a2f0: 87 e3 ldi r24, 0x37 ; 55 2a2f2: 9b e6 ldi r25, 0x6B ; 107 2a2f4: f7 cf rjmp .-18 ; 0x2a2e4 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2a2f6: c9 eb ldi r28, 0xB9 ; 185 2a2f8: d1 ee ldi r29, 0xE1 ; 225 2a2fa: c2 cf rjmp .-124 ; 0x2a280 break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2a2fc: 0f 94 c6 1d call 0x23b8c ; 0x23b8c MMU2::mmu2.unload(); 2a300: 0f 94 75 ad call 0x35aea ; 0x35aea // 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(); 2a304: 0f 94 98 21 call 0x24330 ; 0x24330 2a308: da cf rjmp .-76 ; 0x2a2be break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2a30a: c7 e3 ldi r28, 0x37 ; 55 2a30c: d2 ee ldi r29, 0xE2 ; 226 2a30e: b8 cf rjmp .-144 ; 0x2a280 break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2a310: cf e2 ldi r28, 0x2F ; 47 2a312: d2 ee ldi r29, 0xE2 ; 226 2a314: b5 cf rjmp .-150 ; 0x2a280 menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2a316: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a31a: 88 23 and r24, r24 2a31c: 21 f0 breq .+8 ; 0x2a326 2a31e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2a322: 88 23 and r24, r24 2a324: a1 f1 breq .+104 ; 0x2a38e // 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; 2a326: 81 e0 ldi r24, 0x01 ; 1 2a328: 80 93 62 06 sts 0x0662, r24 ; 0x800662 // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 2a32c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2a330: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0,3, PSTR(">")); 2a334: 48 e1 ldi r20, 0x18 ; 24 2a336: 51 ea ldi r21, 0xA1 ; 161 2a338: 63 e0 ldi r22, 0x03 ; 3 2a33a: 80 e0 ldi r24, 0x00 ; 0 2a33c: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(1, 3, _T(MSG_CANCEL)); 2a340: 8f e6 ldi r24, 0x6F ; 111 2a342: 9b e3 ldi r25, 0x3B ; 59 2a344: 0e 94 2c 72 call 0xe458 ; 0xe458 2a348: ac 01 movw r20, r24 2a34a: 63 e0 ldi r22, 0x03 ; 3 2a34c: 81 e0 ldi r24, 0x01 ; 1 2a34e: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(0, 1); 2a352: 61 e0 ldi r22, 0x01 ; 1 2a354: 80 e0 ldi r24, 0x00 ; 0 2a356: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 switch (eFilamentAction) 2a35a: e0 91 a7 03 lds r30, 0x03A7 ; 0x8003a7 2a35e: e1 50 subi r30, 0x01 ; 1 2a360: e8 30 cpi r30, 0x08 ; 8 2a362: a8 f4 brcc .+42 ; 0x2a38e 2a364: f0 e0 ldi r31, 0x00 ; 0 2a366: 88 27 eor r24, r24 2a368: e7 54 subi r30, 0x47 ; 71 2a36a: fe 4a sbci r31, 0xAE ; 174 2a36c: 8e 4f sbci r24, 0xFE ; 254 2a36e: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 2a372: 62 39 cpi r22, 0x92 ; 146 2a374: 62 39 cpi r22, 0x92 ; 146 2a376: 7a 39 cpi r23, 0x9A ; 154 2a378: 62 39 cpi r22, 0x92 ; 146 2a37a: 7a 39 cpi r23, 0x9A ; 154 2a37c: 68 3a cpi r22, 0xA8 ; 168 2a37e: 12 3a cpi r17, 0xA2 ; 162 2a380: 62 39 cpi r22, 0x92 ; 146 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2a382: 8d e2 ldi r24, 0x2D ; 45 2a384: 9f e4 ldi r25, 0x4F ; 79 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2a386: 0e 94 2c 72 call 0xe458 ; 0xe458 2a38a: 0e 94 4b 6e call 0xdc96 ; 0xdc96 // handled earlier break; } } if (bFilamentWaitingFlag) { 2a38e: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a392: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2a394: 0f 94 9c 22 call 0x24538 ; 0x24538 } if (lcd_clicked()) 2a398: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 2a39c: 88 23 and r24, r24 2a39e: 09 f4 brne .+2 ; 0x2a3a2 2a3a0: 2a cf rjmp .-428 ; 0x2a1f6 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2a3a2: 10 92 62 06 sts 0x0662, r1 ; 0x800662 if (!bFilamentPreheatState) 2a3a6: 80 91 63 06 lds r24, 0x0663 ; 0x800663 2a3aa: 81 11 cpse r24, r1 2a3ac: 0e c0 rjmp .+28 ; 0x2a3ca return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2a3ae: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 2a3b2: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2a3b6: 0e 94 05 67 call 0xce0a ; 0xce0a 2a3ba: 81 11 cpse r24, r1 2a3bc: 04 c0 rjmp .+8 ; 0x2a3c6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2a3be: 10 92 73 06 sts 0x0673, r1 ; 0x800673 2a3c2: 10 92 72 06 sts 0x0672, r1 ; 0x800672 menu_back(); 2a3c6: 0f 94 96 d4 call 0x3a92c ; 0x3a92c } menu_back(); 2a3ca: 0f 94 96 d4 call 0x3a92c ; 0x3a92c clearFilamentAction(); } } } 2a3ce: df 91 pop r29 2a3d0: cf 91 pop r28 2a3d2: 1f 91 pop r17 2a3d4: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2a3d6: 0d 94 98 21 jmp 0x24330 ; 0x24330 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)); 2a3da: 86 e1 ldi r24, 0x16 ; 22 2a3dc: 9f e4 ldi r25, 0x4F ; 79 2a3de: d3 cf rjmp .-90 ; 0x2a386 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2a3e0: 80 e0 ldi r24, 0x00 ; 0 2a3e2: 9f e4 ldi r25, 0x4F ; 79 2a3e4: d0 cf rjmp .-96 ; 0x2a386 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2a3e6: 8c ee ldi r24, 0xEC ; 236 2a3e8: 9e e4 ldi r25, 0x4E ; 78 2a3ea: cd cf rjmp .-102 ; 0x2a386 0002a3ec : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2a3ec: 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) ); 2a3f0: 40 91 ba 13 lds r20, 0x13BA ; 0x8013ba 2a3f4: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 2a3f8: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 2a3fc: 41 30 cpi r20, 0x01 ; 1 2a3fe: 59 f0 breq .+22 ; 0x2a416 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() 2a400: 10 92 64 06 sts 0x0664, r1 ; 0x800664 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2a404: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2a408: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2a40c: 28 17 cp r18, r24 2a40e: 39 07 cpc r19, r25 2a410: 5c f4 brge .+22 ; 0x2a428 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2a412: 0d 94 9b 21 jmp 0x24336 ; 0x24336 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() 2a416: 90 91 90 13 lds r25, 0x1390 ; 0x801390 2a41a: 91 11 cpse r25, r1 2a41c: f1 cf rjmp .-30 ; 0x2a400 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2a41e: 86 50 subi r24, 0x06 ; 6 2a420: 82 30 cpi r24, 0x02 ; 2 2a422: 70 f7 brcc .-36 ; 0x2a400 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() 2a424: 40 93 64 06 sts 0x0664, r20 ; 0x800664 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2a428: 81 e0 ldi r24, 0x01 ; 1 2a42a: 80 93 63 06 sts 0x0663, r24 ; 0x800663 mFilamentItem(target_temperature[0], target_temperature_bed); 2a42e: 60 91 72 06 lds r22, 0x0672 ; 0x800672 2a432: 70 91 73 06 lds r23, 0x0673 ; 0x800673 2a436: c9 01 movw r24, r18 2a438: 0f 94 dc 50 call 0x2a1b8 ; 0x2a1b8 bFilamentSkipPreheat = false; // Reset flag 2a43c: 10 92 64 06 sts 0x0664, r1 ; 0x800664 } else { lcd_generic_preheat_menu(); } } 2a440: 08 95 ret 0002a442 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2a442: 82 e0 ldi r24, 0x02 ; 2 2a444: 0d 94 f6 51 jmp 0x2a3ec ; 0x2a3ec 0002a448 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2a448: 81 e0 ldi r24, 0x01 ; 1 2a44a: 0d 94 f6 51 jmp 0x2a3ec ; 0x2a3ec 0002a44e : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2a44e: 83 e0 ldi r24, 0x03 ; 3 2a450: 0d 94 f6 51 jmp 0x2a3ec ; 0x2a3ec 0002a454 : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2a454: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2a458: 6c e3 ldi r22, 0x3C ; 60 2a45a: 70 e0 ldi r23, 0x00 ; 0 2a45c: 87 ed ldi r24, 0xD7 ; 215 2a45e: 90 e0 ldi r25, 0x00 ; 0 2a460: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a464 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2a464: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2a468: 65 e5 ldi r22, 0x55 ; 85 2a46a: 70 e0 ldi r23, 0x00 ; 0 2a46c: 86 ee ldi r24, 0xE6 ; 230 2a46e: 90 e0 ldi r25, 0x00 ; 0 2a470: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a474 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2a474: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2a478: 69 e6 ldi r22, 0x69 ; 105 2a47a: 70 e0 ldi r23, 0x00 ; 0 2a47c: 84 e0 ldi r24, 0x04 ; 4 2a47e: 91 e0 ldi r25, 0x01 ; 1 2a480: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a484 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2a484: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2a488: 6e e6 ldi r22, 0x6E ; 110 2a48a: 70 e0 ldi r23, 0x00 ; 0 2a48c: 83 e1 ldi r24, 0x13 ; 19 2a48e: 91 e0 ldi r25, 0x01 ; 1 2a490: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a494 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2a494: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2a498: 6b e4 ldi r22, 0x4B ; 75 2a49a: 70 e0 ldi r23, 0x00 ; 0 2a49c: 87 ed ldi r24, 0xD7 ; 215 2a49e: 90 e0 ldi r25, 0x00 ; 0 2a4a0: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a4a4 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2a4a4: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2a4a8: 6a e5 ldi r22, 0x5A ; 90 2a4aa: 70 e0 ldi r23, 0x00 ; 0 2a4ac: 83 e1 ldi r24, 0x13 ; 19 2a4ae: 91 e0 ldi r25, 0x01 ; 1 2a4b0: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a4b4 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2a4b4: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2a4b8: 64 e6 ldi r22, 0x64 ; 100 2a4ba: 70 e0 ldi r23, 0x00 ; 0 2a4bc: 8f ef ldi r24, 0xFF ; 255 2a4be: 90 e0 ldi r25, 0x00 ; 0 2a4c0: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a4c4 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2a4c4: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2a4c8: 64 e6 ldi r22, 0x64 ; 100 2a4ca: 70 e0 ldi r23, 0x00 ; 0 2a4cc: 8c ed ldi r24, 0xDC ; 220 2a4ce: 90 e0 ldi r25, 0x00 ; 0 2a4d0: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a4d4 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2a4d4: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2a4d8: 64 e6 ldi r22, 0x64 ; 100 2a4da: 70 e0 ldi r23, 0x00 ; 0 2a4dc: 8e ef ldi r24, 0xFE ; 254 2a4de: 90 e0 ldi r25, 0x00 ; 0 2a4e0: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a4e4 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2a4e4: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2a4e8: 62 e3 ldi r22, 0x32 ; 50 2a4ea: 70 e0 ldi r23, 0x00 ; 0 2a4ec: 80 ef ldi r24, 0xF0 ; 240 2a4ee: 90 e0 ldi r25, 0x00 ; 0 2a4f0: 0d 94 dc 50 jmp 0x2a1b8 ; 0x2a1b8 0002a4f4 : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2a4f4: 80 e0 ldi r24, 0x00 ; 0 2a4f6: 0f 94 0c 4f call 0x29e18 ; 0x29e18 #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2a4fa: 0e 94 c8 ee call 0x1dd90 ; 0x1dd90 lcd_return_to_status(); 2a4fe: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 0002a502 : } 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){ 2a502: cf 92 push r12 2a504: df 92 push r13 2a506: ef 92 push r14 2a508: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2a50a: 41 11 cpse r20, r1 2a50c: 04 c0 rjmp .+8 ; 0x2a516 2a50e: 20 91 de 04 lds r18, 0x04DE ; 0x8004de 2a512: 22 30 cpi r18, 0x02 ; 2 2a514: d1 f0 breq .+52 ; 0x2a54a 2a516: 9b 01 movw r18, r22 2a518: 6c 01 movw r12, r24 2a51a: f1 2c mov r15, r1 2a51c: e1 2c mov r14, r1 if(!tone_) { 2a51e: 67 2b or r22, r23 2a520: c9 f4 brne .+50 ; 0x2a554 WRITE(BEEPER, HIGH); 2a522: 9f b7 in r25, 0x3f ; 63 2a524: f8 94 cli 2a526: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a52a: 84 60 ori r24, 0x04 ; 4 2a52c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a530: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2a532: c7 01 movw r24, r14 2a534: b6 01 movw r22, r12 2a536: 0f 94 58 28 call 0x250b0 ; 0x250b0 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); 2a53a: 9f b7 in r25, 0x3f ; 63 2a53c: f8 94 cli 2a53e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a542: 8b 7f andi r24, 0xFB ; 251 2a544: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a548: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2a54a: ff 90 pop r15 2a54c: ef 90 pop r14 2a54e: df 90 pop r13 2a550: cf 90 pop r12 2a552: 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); 2a554: 22 0f add r18, r18 2a556: 33 1f adc r19, r19 2a558: 50 e0 ldi r21, 0x00 ; 0 2a55a: 40 e0 ldi r20, 0x00 ; 0 2a55c: 60 e0 ldi r22, 0x00 ; 0 2a55e: 74 e2 ldi r23, 0x24 ; 36 2a560: 84 ef ldi r24, 0xF4 ; 244 2a562: 90 e0 ldi r25, 0x00 ; 0 2a564: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a <__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; 2a568: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2a56a: 21 15 cp r18, r1 2a56c: 31 05 cpc r19, r1 2a56e: 81 e0 ldi r24, 0x01 ; 1 2a570: 48 07 cpc r20, r24 2a572: 51 05 cpc r21, r1 2a574: 44 f0 brlt .+16 ; 0x2a586 pwm_freq /= 64; // Increase prescaler to 64 2a576: 86 e0 ldi r24, 0x06 ; 6 2a578: 56 95 lsr r21 2a57a: 47 95 ror r20 2a57c: 37 95 ror r19 2a57e: 27 95 ror r18 2a580: 8a 95 dec r24 2a582: d1 f7 brne .-12 ; 0x2a578 prescalarbits = 0b011; 2a584: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2a586: 21 50 subi r18, 0x01 ; 1 2a588: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2a58a: 4f b7 in r20, 0x3f ; 63 2a58c: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2a58e: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2a592: 88 7f andi r24, 0xF8 ; 248 2a594: 89 2b or r24, r25 2a596: 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); 2a59a: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2a59e: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a5a2: 26 9f mul r18, r22 2a5a4: c0 01 movw r24, r0 2a5a6: 27 9f mul r18, r23 2a5a8: 90 0d add r25, r0 2a5aa: 36 9f mul r19, r22 2a5ac: 90 0d add r25, r0 2a5ae: 11 24 eor r1, r1 2a5b0: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a5b4: 6f ef ldi r22, 0xFF ; 255 2a5b6: 70 e0 ldi r23, 0x00 ; 0 2a5b8: 51 ff sbrs r21, 1 2a5ba: 04 c0 rjmp .+8 ; 0x2a5c4 2a5bc: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2a5c0: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a5c4: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 2a5c8: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a5cc: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2a5d0: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a5d4: 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); 2a5d8: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a5dc: 83 60 ori r24, 0x03 ; 3 2a5de: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2a5e2: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2a5e4: c7 01 movw r24, r14 2a5e6: b6 01 movw r22, r12 2a5e8: 0f 94 58 28 call 0x250b0 ; 0x250b0 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2a5ec: 2f b7 in r18, 0x3f ; 63 2a5ee: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2a5f0: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2a5f4: 88 7f andi r24, 0xF8 ; 248 2a5f6: 85 60 ori r24, 0x05 ; 5 2a5f8: 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); 2a5fc: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2a600: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a604: 3f ef ldi r19, 0xFF ; 255 2a606: 34 9f mul r19, r20 2a608: c0 01 movw r24, r0 2a60a: 35 9f mul r19, r21 2a60c: 90 0d add r25, r0 2a60e: 11 24 eor r1, r1 2a610: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a614: 6f ef ldi r22, 0xFF ; 255 2a616: 70 e0 ldi r23, 0x00 ; 0 2a618: 31 ff sbrs r19, 1 2a61a: 04 c0 rjmp .+8 ; 0x2a624 2a61c: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2a620: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a624: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 2a628: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a62c: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2a630: 8f ef ldi r24, 0xFF ; 255 2a632: 90 e0 ldi r25, 0x00 ; 0 2a634: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a638: 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)); 2a63c: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a640: 8c 7f andi r24, 0xFC ; 252 2a642: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2a646: 2f bf out 0x3f, r18 ; 63 2a648: 78 cf rjmp .-272 ; 0x2a53a 0002a64a : /// 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() { 2a64a: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2a64c: c0 91 de 04 lds r28, 0x04DE ; 0x8004de 2a650: c2 30 cpi r28, 0x02 ; 2 2a652: 59 f1 breq .+86 ; 0x2a6aa // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2a654: c1 30 cpi r28, 0x01 ; 1 2a656: 69 f4 brne .+26 ; 0x2a672 if (bFirst) return; 2a658: 80 91 6e 05 lds r24, 0x056E ; 0x80056e <_ZL6bFirst.lto_priv.497> 2a65c: 81 11 cpse r24, r1 2a65e: 25 c0 rjmp .+74 ; 0x2a6aa Sound_MakeCustom(80, 0, false); 2a660: 40 e0 ldi r20, 0x00 ; 0 2a662: 70 e0 ldi r23, 0x00 ; 0 2a664: 60 e0 ldi r22, 0x00 ; 0 2a666: 80 e5 ldi r24, 0x50 ; 80 2a668: 90 e0 ldi r25, 0x00 ; 0 2a66a: 0f 94 81 52 call 0x2a502 ; 0x2a502 bFirst = true; 2a66e: c0 93 6e 05 sts 0x056E, r28 ; 0x80056e <_ZL6bFirst.lto_priv.497> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 2a672: 60 ed ldi r22, 0xD0 ; 208 2a674: 77 e0 ldi r23, 0x07 ; 7 2a676: 8b e6 ldi r24, 0x6B ; 107 2a678: 95 e0 ldi r25, 0x05 ; 5 2a67a: 0f 94 ab 2a call 0x25556 ; 0x25556 ::expired_cont(unsigned short)> 2a67e: 88 23 and r24, r24 2a680: a1 f0 breq .+40 ; 0x2a6aa beep_timer.start(); 2a682: 8b e6 ldi r24, 0x6B ; 107 2a684: 95 e0 ldi r25, 0x05 ; 5 2a686: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2a68a: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 2a68e: 81 11 cpse r24, r1 2a690: 08 c0 rjmp .+16 ; 0x2a6a2 Sound_MakeCustom(80, 0, false); 2a692: 40 e0 ldi r20, 0x00 ; 0 2a694: 70 e0 ldi r23, 0x00 ; 0 2a696: 60 e0 ldi r22, 0x00 ; 0 2a698: 80 e5 ldi r24, 0x50 ; 80 2a69a: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2a69c: 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); 2a69e: 0d 94 81 52 jmp 0x2a502 ; 0x2a502 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2a6a2: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2a6a4: 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); 2a6a6: 0d 94 0c 4f jmp 0x29e18 ; 0x29e18 } } #endif // BEEPER > 0 } 2a6aa: cf 91 pop r28 2a6ac: 08 95 ret 0002a6ae : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2a6ae: 82 30 cpi r24, 0x02 ; 2 2a6b0: b9 f0 breq .+46 ; 0x2a6e0 2a6b2: 83 30 cpi r24, 0x03 ; 3 2a6b4: e9 f0 breq .+58 ; 0x2a6f0 2a6b6: 81 30 cpi r24, 0x01 ; 1 2a6b8: 59 f0 breq .+22 ; 0x2a6d0 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; 2a6ba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a6be: 61 30 cpi r22, 0x01 ; 1 2a6c0: 29 f4 brne .+10 ; 0x2a6cc 2a6c2: 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; 2a6c4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2a6c8: 00 00 nop } 2a6ca: 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; 2a6cc: 8e 7f andi r24, 0xFE ; 254 2a6ce: fa cf rjmp .-12 ; 0x2a6c4 case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2a6d0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a6d4: 61 11 cpse r22, r1 2a6d6: 02 c0 rjmp .+4 ; 0x2a6dc 2a6d8: 82 60 ori r24, 0x02 ; 2 2a6da: f4 cf rjmp .-24 ; 0x2a6c4 2a6dc: 8d 7f andi r24, 0xFD ; 253 2a6de: f2 cf rjmp .-28 ; 0x2a6c4 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2a6e0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a6e4: 61 30 cpi r22, 0x01 ; 1 2a6e6: 11 f4 brne .+4 ; 0x2a6ec 2a6e8: 84 60 ori r24, 0x04 ; 4 2a6ea: ec cf rjmp .-40 ; 0x2a6c4 2a6ec: 8b 7f andi r24, 0xFB ; 251 2a6ee: ea cf rjmp .-44 ; 0x2a6c4 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2a6f0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a6f4: 61 11 cpse r22, r1 2a6f6: 02 c0 rjmp .+4 ; 0x2a6fc 2a6f8: 80 64 ori r24, 0x40 ; 64 2a6fa: e4 cf rjmp .-56 ; 0x2a6c4 2a6fc: 8f 7b andi r24, 0xBF ; 191 2a6fe: e2 cf rjmp .-60 ; 0x2a6c4 0002a700 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 2a700: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a702: 0d b4 in r0, 0x2d ; 45 2a704: 07 fe sbrs r0, 7 2a706: fd cf rjmp .-6 ; 0x2a702 } 2a708: 08 95 ret 0002a70a : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 2a70a: 8f ef ldi r24, 0xFF ; 255 2a70c: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a70e: 0d b4 in r0, 0x2d ; 45 2a710: 07 fe sbrs r0, 7 2a712: fd cf rjmp .-6 ; 0x2a70e return SPDR; 2a714: 8e b5 in r24, 0x2e ; 46 } 2a716: 08 95 ret 0002a718 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 2a718: 8f 92 push r8 2a71a: 9f 92 push r9 2a71c: af 92 push r10 2a71e: bf 92 push r11 2a720: ef 92 push r14 2a722: ff 92 push r15 2a724: 0f 93 push r16 2a726: 1f 93 push r17 2a728: cf 93 push r28 2a72a: 7c 01 movw r14, r24 2a72c: c6 2f mov r28, r22 2a72e: 49 01 movw r8, r18 2a730: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 2a732: fc 01 movw r30, r24 2a734: 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); 2a736: 89 2f mov r24, r25 2a738: 80 6a ori r24, 0xA0 ; 160 2a73a: 86 95 lsr r24 2a73c: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2a73e: 90 fd sbrc r25, 0 2a740: 03 c0 rjmp .+6 ; 0x2a748 2a742: 81 e0 ldi r24, 0x01 ; 1 2a744: 96 30 cpi r25, 0x06 ; 6 2a746: 09 f4 brne .+2 ; 0x2a74a 2a748: 80 e0 ldi r24, 0x00 ; 0 2a74a: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 2a74c: 9f b7 in r25, 0x3f ; 63 2a74e: f8 94 cli 2a750: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 2a754: 8f 7b andi r24, 0xBF ; 191 2a756: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 2a75a: 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); 2a75c: 8c e2 ldi r24, 0x2C ; 44 2a75e: 91 e0 ldi r25, 0x01 ; 1 2a760: 0f 94 03 76 call 0x2ec06 ; 0x2ec06 // send command spiSend(cmd | 0x40); 2a764: 8c 2f mov r24, r28 2a766: 80 64 ori r24, 0x40 ; 64 2a768: 0f 94 80 53 call 0x2a700 ; 0x2a700 2a76c: 08 e1 ldi r16, 0x18 ; 24 2a76e: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 2a770: d5 01 movw r26, r10 2a772: c4 01 movw r24, r8 2a774: 00 2e mov r0, r16 2a776: 04 c0 rjmp .+8 ; 0x2a780 2a778: b6 95 lsr r27 2a77a: a7 95 ror r26 2a77c: 97 95 ror r25 2a77e: 87 95 ror r24 2a780: 0a 94 dec r0 2a782: d2 f7 brpl .-12 ; 0x2a778 2a784: 0f 94 80 53 call 0x2a700 ; 0x2a700 2a788: 08 50 subi r16, 0x08 ; 8 2a78a: 11 09 sbc r17, r1 2a78c: 08 3f cpi r16, 0xF8 ; 248 2a78e: ff ef ldi r31, 0xFF ; 255 2a790: 1f 07 cpc r17, r31 2a792: 71 f7 brne .-36 ; 0x2a770 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 2a794: 85 e9 ldi r24, 0x95 ; 149 2a796: cc 23 and r28, r28 2a798: 21 f0 breq .+8 ; 0x2a7a2 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 2a79a: 87 e8 ldi r24, 0x87 ; 135 2a79c: c8 30 cpi r28, 0x08 ; 8 2a79e: 09 f0 breq .+2 ; 0x2a7a2 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2a7a0: 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); 2a7a2: 0f 94 80 53 call 0x2a700 ; 0x2a700 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 2a7a6: cc 30 cpi r28, 0x0C ; 12 2a7a8: 11 f4 brne .+4 ; 0x2a7ae 2a7aa: 0f 94 85 53 call 0x2a70a ; 0x2a70a // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2a7ae: 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 */ } 2a7b0: 0f 94 85 53 call 0x2a70a ; 0x2a70a 2a7b4: f7 01 movw r30, r14 2a7b6: 82 83 std Z+2, r24 ; 0x02 2a7b8: 87 ff sbrs r24, 7 2a7ba: 04 c0 rjmp .+8 ; 0x2a7c4 2a7bc: cf 3f cpi r28, 0xFF ; 255 2a7be: 11 f0 breq .+4 ; 0x2a7c4 2a7c0: cf 5f subi r28, 0xFF ; 255 2a7c2: f6 cf rjmp .-20 ; 0x2a7b0 return status_; } 2a7c4: cf 91 pop r28 2a7c6: 1f 91 pop r17 2a7c8: 0f 91 pop r16 2a7ca: ff 90 pop r15 2a7cc: ef 90 pop r14 2a7ce: bf 90 pop r11 2a7d0: af 90 pop r10 2a7d2: 9f 90 pop r9 2a7d4: 8f 90 pop r8 2a7d6: 08 95 ret 0002a7d8 : * \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) { 2a7d8: 0f 93 push r16 2a7da: 1f 93 push r17 2a7dc: cf 93 push r28 2a7de: df 93 push r29 2a7e0: ec 01 movw r28, r24 2a7e2: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2a7e4: 8b 81 ldd r24, Y+3 ; 0x03 2a7e6: 83 30 cpi r24, 0x03 ; 3 2a7e8: 39 f0 breq .+14 ; 0x2a7f8 2a7ea: 89 e0 ldi r24, 0x09 ; 9 2a7ec: 44 0f add r20, r20 2a7ee: 55 1f adc r21, r21 2a7f0: 66 1f adc r22, r22 2a7f2: 77 1f adc r23, r23 2a7f4: 8a 95 dec r24 2a7f6: d1 f7 brne .-12 ; 0x2a7ec if (cardCommand(CMD24, blockNumber)) { 2a7f8: 9a 01 movw r18, r20 2a7fa: ab 01 movw r20, r22 2a7fc: 68 e1 ldi r22, 0x18 ; 24 2a7fe: ce 01 movw r24, r28 2a800: 0f 94 8c 53 call 0x2a718 ; 0x2a718 2a804: 88 23 and r24, r24 2a806: 19 f0 breq .+6 ; 0x2a80e bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2a808: 86 e0 ldi r24, 0x06 ; 6 2a80a: 88 83 st Y, r24 2a80c: 39 c0 rjmp .+114 ; 0x2a880 } //------------------------------------------------------------------------------ /** 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; 2a80e: 8e ef ldi r24, 0xFE ; 254 2a810: 8e bd out 0x2e, r24 ; 46 2a812: f8 01 movw r30, r16 2a814: c8 01 movw r24, r16 2a816: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a818: 0d b4 in r0, 0x2d ; 45 2a81a: 07 fe sbrs r0, 7 2a81c: fd cf rjmp .-6 ; 0x2a818 SPDR = buf[i]; 2a81e: 20 81 ld r18, Z 2a820: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a822: 0d b4 in r0, 0x2d ; 45 2a824: 07 fe sbrs r0, 7 2a826: fd cf rjmp .-6 ; 0x2a822 SPDR = buf[i + 1]; 2a828: 21 81 ldd r18, Z+1 ; 0x01 2a82a: 2e bd out 0x2e, r18 ; 46 2a82c: 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) { 2a82e: e8 17 cp r30, r24 2a830: f9 07 cpc r31, r25 2a832: 91 f7 brne .-28 ; 0x2a818 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 */ } 2a834: 0d b4 in r0, 0x2d ; 45 2a836: 07 fe sbrs r0, 7 2a838: fd cf rjmp .-6 ; 0x2a834 //------------------------------------------------------------------------------ // 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 2a83a: 8f ef ldi r24, 0xFF ; 255 2a83c: 0f 94 80 53 call 0x2a700 ; 0x2a700 spiSend(0xff); // dummy crc 2a840: 8f ef ldi r24, 0xFF ; 255 2a842: 0f 94 80 53 call 0x2a700 ; 0x2a700 status_ = spiRec(); 2a846: 0f 94 85 53 call 0x2a70a ; 0x2a70a 2a84a: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 2a84c: 8f 71 andi r24, 0x1F ; 31 2a84e: 85 30 cpi r24, 0x05 ; 5 2a850: 99 f4 brne .+38 ; 0x2a878 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 2a852: 88 e5 ldi r24, 0x58 ; 88 2a854: 92 e0 ldi r25, 0x02 ; 2 2a856: 0f 94 03 76 call 0x2ec06 ; 0x2ec06 2a85a: 18 2f mov r17, r24 2a85c: 87 e1 ldi r24, 0x17 ; 23 2a85e: 11 23 and r17, r17 2a860: a1 f2 breq .-88 ; 0x2a80a error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2a862: 20 e0 ldi r18, 0x00 ; 0 2a864: 30 e0 ldi r19, 0x00 ; 0 2a866: a9 01 movw r20, r18 2a868: 6d e0 ldi r22, 0x0D ; 13 2a86a: ce 01 movw r24, r28 2a86c: 0f 94 8c 53 call 0x2a718 ; 0x2a718 2a870: 88 23 and r24, r24 2a872: 51 f0 breq .+20 ; 0x2a888 2a874: 86 e1 ldi r24, 0x16 ; 22 2a876: c9 cf rjmp .-110 ; 0x2a80a 2a878: 83 e1 ldi r24, 0x13 ; 19 2a87a: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 2a87c: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 } chipSelectHigh(); return true; fail: chipSelectHigh(); 2a880: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 return false; 2a884: 10 e0 ldi r17, 0x00 ; 0 2a886: 06 c0 rjmp .+12 ; 0x2a894 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()) { 2a888: 0f 94 85 53 call 0x2a70a ; 0x2a70a 2a88c: 81 11 cpse r24, r1 2a88e: f2 cf rjmp .-28 ; 0x2a874 error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 2a890: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 return true; fail: chipSelectHigh(); return false; } 2a894: 81 2f mov r24, r17 2a896: df 91 pop r29 2a898: cf 91 pop r28 2a89a: 1f 91 pop r17 2a89c: 0f 91 pop r16 2a89e: 08 95 ret 0002a8a0 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2a8a0: cf 93 push r28 if (cacheDirty_) { 2a8a2: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2a8a6: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2a8a8: 88 23 and r24, r24 2a8aa: a1 f0 breq .+40 ; 0x2a8d4 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2a8ac: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2a8b0: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2a8b4: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2a8b8: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2a8bc: 2d e9 ldi r18, 0x9D ; 157 2a8be: 3e e0 ldi r19, 0x0E ; 14 2a8c0: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2a8c4: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2a8c8: 0f 94 ec 53 call 0x2a7d8 ; 0x2a7d8 2a8cc: c8 2f mov r28, r24 2a8ce: 81 11 cpse r24, r1 2a8d0: 04 c0 rjmp .+8 ; 0x2a8da cacheDirty_ = 0; } return true; fail: return false; 2a8d2: c0 e0 ldi r28, 0x00 ; 0 } 2a8d4: 8c 2f mov r24, r28 2a8d6: cf 91 pop r28 2a8d8: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2a8da: 40 91 95 0e lds r20, 0x0E95 ; 0x800e95 2a8de: 50 91 96 0e lds r21, 0x0E96 ; 0x800e96 2a8e2: 60 91 97 0e lds r22, 0x0E97 ; 0x800e97 2a8e6: 70 91 98 0e lds r23, 0x0E98 ; 0x800e98 2a8ea: 41 15 cp r20, r1 2a8ec: 51 05 cpc r21, r1 2a8ee: 61 05 cpc r22, r1 2a8f0: 71 05 cpc r23, r1 2a8f2: 91 f0 breq .+36 ; 0x2a918 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2a8f4: 2d e9 ldi r18, 0x9D ; 157 2a8f6: 3e e0 ldi r19, 0x0E ; 14 2a8f8: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2a8fc: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2a900: 0f 94 ec 53 call 0x2a7d8 ; 0x2a7d8 2a904: 88 23 and r24, r24 2a906: 29 f3 breq .-54 ; 0x2a8d2 goto fail; } cacheMirrorBlock_ = 0; 2a908: 10 92 95 0e sts 0x0E95, r1 ; 0x800e95 2a90c: 10 92 96 0e sts 0x0E96, r1 ; 0x800e96 2a910: 10 92 97 0e sts 0x0E97, r1 ; 0x800e97 2a914: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 } cacheDirty_ = 0; 2a918: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 2a91c: db cf rjmp .-74 ; 0x2a8d4 0002a91e : * \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) { 2a91e: 2f 92 push r2 2a920: 3f 92 push r3 2a922: 4f 92 push r4 2a924: 5f 92 push r5 2a926: 6f 92 push r6 2a928: 7f 92 push r7 2a92a: 8f 92 push r8 2a92c: 9f 92 push r9 2a92e: af 92 push r10 2a930: bf 92 push r11 2a932: cf 92 push r12 2a934: df 92 push r13 2a936: ef 92 push r14 2a938: ff 92 push r15 2a93a: 0f 93 push r16 2a93c: 1f 93 push r17 2a93e: cf 93 push r28 2a940: df 93 push r29 2a942: ec 01 movw r28, r24 2a944: 2a 01 movw r4, r20 2a946: 3b 01 movw r6, r22 2a948: 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; 2a94a: 8b 81 ldd r24, Y+3 ; 0x03 2a94c: 83 30 cpi r24, 0x03 ; 3 2a94e: 39 f0 breq .+14 ; 0x2a95e 2a950: 69 e0 ldi r22, 0x09 ; 9 2a952: 44 0c add r4, r4 2a954: 55 1c adc r5, r5 2a956: 66 1c adc r6, r6 2a958: 77 1c adc r7, r7 2a95a: 6a 95 dec r22 2a95c: d1 f7 brne .-12 ; 0x2a952 retry2: 2a95e: 43 e0 ldi r20, 0x03 ; 3 2a960: 94 2e mov r9, r20 2a962: 56 01 movw r10, r12 2a964: 81 e0 ldi r24, 0x01 ; 1 2a966: a8 1a sub r10, r24 2a968: 8e ef ldi r24, 0xFE ; 254 2a96a: b8 0a sbc r11, r24 2a96c: 16 01 movw r2, r12 2a96e: ee ef ldi r30, 0xFE ; 254 2a970: 3e 1a sub r3, r30 2a972: 54 e0 ldi r21, 0x04 ; 4 2a974: 85 2e mov r8, r21 retryCnt --; 2a976: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 2a978: a3 01 movw r20, r6 2a97a: 92 01 movw r18, r4 2a97c: 61 e1 ldi r22, 0x11 ; 17 2a97e: ce 01 movw r24, r28 2a980: 0f 94 8c 53 call 0x2a718 ; 0x2a718 2a984: 88 23 and r24, r24 2a986: 79 f0 breq .+30 ; 0x2a9a6 2a988: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 2a98a: 99 20 and r9, r9 2a98c: 09 f4 brne .+2 ; 0x2a990 2a98e: 7a c0 rjmp .+244 ; 0x2aa84 if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 2a990: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 2a994: 20 e0 ldi r18, 0x00 ; 0 2a996: 30 e0 ldi r19, 0x00 ; 0 2a998: a9 01 movw r20, r18 2a99a: 6c e0 ldi r22, 0x0C ; 12 2a99c: ce 01 movw r24, r28 2a99e: 0f 94 8c 53 call 0x2a718 ; 0x2a718 errorCode_ = 0; 2a9a2: 18 82 st Y, r1 2a9a4: e8 cf rjmp .-48 ; 0x2a976 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 2a9a6: 0f 94 51 2a call 0x254a2 ; 0x254a2 2a9aa: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2a9ac: 0f 94 85 53 call 0x2a70a ; 0x2a70a 2a9b0: 8a 83 std Y+2, r24 ; 0x02 2a9b2: 8f 3f cpi r24, 0xFF ; 255 2a9b4: 91 f4 brne .+36 ; 0x2a9da if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2a9b6: 0f 94 51 2a call 0x254a2 ; 0x254a2 2a9ba: 60 1b sub r22, r16 2a9bc: 71 0b sbc r23, r17 2a9be: 6d 32 cpi r22, 0x2D ; 45 2a9c0: 71 40 sbci r23, 0x01 ; 1 2a9c2: a0 f3 brcs .-24 ; 0x2a9ac 2a9c4: 81 e1 ldi r24, 0x11 ; 17 2a9c6: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 2a9c8: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2a9cc: 8c 81 ldd r24, Y+4 ; 0x04 2a9ce: 88 23 and r24, r24 2a9d0: e1 f2 breq .-72 ; 0x2a98a spiSend(0XFF); 2a9d2: 8f ef ldi r24, 0xFF ; 255 2a9d4: 0f 94 80 53 call 0x2a700 ; 0x2a700 2a9d8: d8 cf rjmp .-80 ; 0x2a98a if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2a9da: 8e 3f cpi r24, 0xFE ; 254 2a9dc: 11 f0 breq .+4 ; 0x2a9e2 2a9de: 8f e0 ldi r24, 0x0F ; 15 2a9e0: f2 cf rjmp .-28 ; 0x2a9c6 //------------------------------------------------------------------------------ /** 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; 2a9e2: 8f ef ldi r24, 0xFF ; 255 2a9e4: 8e bd out 0x2e, r24 ; 46 2a9e6: d6 01 movw r26, r12 2a9e8: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a9ea: 0d b4 in r0, 0x2d ; 45 2a9ec: 07 fe sbrs r0, 7 2a9ee: fd cf rjmp .-6 ; 0x2a9ea buf[i] = SPDR; 2a9f0: 9e b5 in r25, 0x2e ; 46 2a9f2: 91 93 st Z+, r25 SPDR = 0XFF; 2a9f4: 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++) { 2a9f6: ea 15 cp r30, r10 2a9f8: fb 05 cpc r31, r11 2a9fa: b9 f7 brne .-18 ; 0x2a9ea while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a9fc: 0d b4 in r0, 0x2d ; 45 2a9fe: 07 fe sbrs r0, 7 2aa00: fd cf rjmp .-6 ; 0x2a9fc buf[nbyte] = SPDR; 2aa02: 8e b5 in r24, 0x2e ; 46 2aa04: f5 01 movw r30, r10 2aa06: 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; 2aa08: f1 2c mov r15, r1 2aa0a: 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); 2aa0c: 8d 91 ld r24, X+ 2aa0e: ef 2d mov r30, r15 2aa10: ff 27 eor r31, r31 2aa12: e8 27 eor r30, r24 2aa14: ee 0f add r30, r30 2aa16: ff 1f adc r31, r31 2aa18: e0 5a subi r30, 0xA0 ; 160 2aa1a: f0 47 sbci r31, 0x70 ; 112 2aa1c: 85 91 lpm r24, Z+ 2aa1e: 94 91 lpm r25, Z 2aa20: fe 2c mov r15, r14 2aa22: ee 24 eor r14, r14 2aa24: e8 26 eor r14, r24 2aa26: 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++) { 2aa28: 2a 16 cp r2, r26 2aa2a: 3b 06 cpc r3, r27 2aa2c: 79 f7 brne .-34 ; 0x2aa0c spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 2aa2e: 0f 94 85 53 call 0x2a70a ; 0x2a70a 2aa32: 08 2f mov r16, r24 2aa34: 10 e0 ldi r17, 0x00 ; 0 2aa36: 10 2f mov r17, r16 2aa38: 00 27 eor r16, r16 recvCrc |= spiRec(); 2aa3a: 0f 94 85 53 call 0x2a70a ; 0x2a70a 2aa3e: 08 2b or r16, r24 if (calcCrc != recvCrc) 2aa40: 0e 15 cp r16, r14 2aa42: 1f 05 cpc r17, r15 2aa44: 19 f0 breq .+6 ; 0x2aa4c 2aa46: f0 e2 ldi r31, 0x20 ; 32 2aa48: f8 83 st Y, r31 2aa4a: be cf rjmp .-132 ; 0x2a9c8 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 2aa4c: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2aa50: cc 81 ldd r28, Y+4 ; 0x04 2aa52: cc 23 and r28, r28 2aa54: d9 f0 breq .+54 ; 0x2aa8c spiSend(0XFF); 2aa56: 8f ef ldi r24, 0xFF ; 255 2aa58: 0f 94 80 53 call 0x2a700 ; 0x2a700 #endif fail: chipSelectHigh(); return false; } 2aa5c: 8c 2f mov r24, r28 2aa5e: df 91 pop r29 2aa60: cf 91 pop r28 2aa62: 1f 91 pop r17 2aa64: 0f 91 pop r16 2aa66: ff 90 pop r15 2aa68: ef 90 pop r14 2aa6a: df 90 pop r13 2aa6c: cf 90 pop r12 2aa6e: bf 90 pop r11 2aa70: af 90 pop r10 2aa72: 9f 90 pop r9 2aa74: 8f 90 pop r8 2aa76: 7f 90 pop r7 2aa78: 6f 90 pop r6 2aa7a: 5f 90 pop r5 2aa7c: 4f 90 pop r4 2aa7e: 3f 90 pop r3 2aa80: 2f 90 pop r2 2aa82: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 2aa84: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 return false; 2aa88: c0 e0 ldi r28, 0x00 ; 0 2aa8a: e8 cf rjmp .-48 ; 0x2aa5c if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2aa8c: c1 e0 ldi r28, 0x01 ; 1 2aa8e: e6 cf rjmp .-52 ; 0x2aa5c 0002aa90 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2aa90: cf 92 push r12 2aa92: df 92 push r13 2aa94: ef 92 push r14 2aa96: ff 92 push r15 2aa98: cf 93 push r28 2aa9a: 6b 01 movw r12, r22 2aa9c: 7c 01 movw r14, r24 2aa9e: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2aaa0: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 2aaa4: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 2aaa8: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 2aaac: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 2aab0: 8c 15 cp r24, r12 2aab2: 9d 05 cpc r25, r13 2aab4: ae 05 cpc r26, r14 2aab6: bf 05 cpc r27, r15 2aab8: 01 f1 breq .+64 ; 0x2aafa if (!cacheFlush()) goto fail; 2aaba: 0f 94 50 54 call 0x2a8a0 ; 0x2a8a0 2aabe: 81 11 cpse r24, r1 2aac0: 08 c0 rjmp .+16 ; 0x2aad2 } if (dirty) cacheDirty_ = true; return true; fail: return false; 2aac2: c0 e0 ldi r28, 0x00 ; 0 } 2aac4: 8c 2f mov r24, r28 2aac6: cf 91 pop r28 2aac8: ff 90 pop r15 2aaca: ef 90 pop r14 2aacc: df 90 pop r13 2aace: cf 90 pop r12 2aad0: 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; 2aad2: 2d e9 ldi r18, 0x9D ; 157 2aad4: 3e e0 ldi r19, 0x0E ; 14 2aad6: b7 01 movw r22, r14 2aad8: a6 01 movw r20, r12 2aada: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2aade: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2aae2: 0f 94 8f 54 call 0x2a91e ; 0x2a91e 2aae6: 88 23 and r24, r24 2aae8: 61 f3 breq .-40 ; 0x2aac2 cacheBlockNumber_ = blockNumber; 2aaea: c0 92 91 0e sts 0x0E91, r12 ; 0x800e91 2aaee: d0 92 92 0e sts 0x0E92, r13 ; 0x800e92 2aaf2: e0 92 93 0e sts 0x0E93, r14 ; 0x800e93 2aaf6: f0 92 94 0e sts 0x0E94, r15 ; 0x800e94 } if (dirty) cacheDirty_ = true; 2aafa: cc 23 and r28, r28 2aafc: 21 f0 breq .+8 ; 0x2ab06 2aafe: 81 e0 ldi r24, 0x01 ; 1 2ab00: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 2ab04: df cf rjmp .-66 ; 0x2aac4 return true; 2ab06: c1 e0 ldi r28, 0x01 ; 1 2ab08: dd cf rjmp .-70 ; 0x2aac4 0002ab0a : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2ab0a: 4f 92 push r4 2ab0c: 5f 92 push r5 2ab0e: 6f 92 push r6 2ab10: 7f 92 push r7 2ab12: 8f 92 push r8 2ab14: 9f 92 push r9 2ab16: af 92 push r10 2ab18: bf 92 push r11 2ab1a: cf 92 push r12 2ab1c: df 92 push r13 2ab1e: ef 92 push r14 2ab20: ff 92 push r15 2ab22: 0f 93 push r16 2ab24: 1f 93 push r17 2ab26: cf 93 push r28 2ab28: df 93 push r29 2ab2a: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2ab2c: 42 30 cpi r20, 0x02 ; 2 2ab2e: 51 05 cpc r21, r1 2ab30: 61 05 cpc r22, r1 2ab32: 71 05 cpc r23, r1 2ab34: 90 f4 brcc .+36 ; 0x2ab5a // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2ab36: 80 e0 ldi r24, 0x00 ; 0 } 2ab38: df 91 pop r29 2ab3a: cf 91 pop r28 2ab3c: 1f 91 pop r17 2ab3e: 0f 91 pop r16 2ab40: ff 90 pop r15 2ab42: ef 90 pop r14 2ab44: df 90 pop r13 2ab46: cf 90 pop r12 2ab48: bf 90 pop r11 2ab4a: af 90 pop r10 2ab4c: 9f 90 pop r9 2ab4e: 8f 90 pop r8 2ab50: 7f 90 pop r7 2ab52: 6f 90 pop r6 2ab54: 5f 90 pop r5 2ab56: 4f 90 pop r4 2ab58: 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; 2ab5a: 89 85 ldd r24, Y+9 ; 0x09 2ab5c: 9a 85 ldd r25, Y+10 ; 0x0a 2ab5e: ab 85 ldd r26, Y+11 ; 0x0b 2ab60: bc 85 ldd r27, Y+12 ; 0x0c 2ab62: 01 96 adiw r24, 0x01 ; 1 2ab64: a1 1d adc r26, r1 2ab66: b1 1d adc r27, r1 2ab68: 84 17 cp r24, r20 2ab6a: 95 07 cpc r25, r21 2ab6c: a6 07 cpc r26, r22 2ab6e: b7 07 cpc r27, r23 2ab70: 10 f3 brcs .-60 ; 0x2ab36 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2ab72: 8f 89 ldd r24, Y+23 ; 0x17 2ab74: 80 31 cpi r24, 0x10 ; 16 2ab76: c9 f5 brne .+114 ; 0x2abea lba = fatStartBlock_ + (cluster >> 8); 2ab78: 85 2e mov r8, r21 2ab7a: 96 2e mov r9, r22 2ab7c: a7 2e mov r10, r23 2ab7e: bb 24 eor r11, r11 2ab80: 8b 89 ldd r24, Y+19 ; 0x13 2ab82: 9c 89 ldd r25, Y+20 ; 0x14 2ab84: ad 89 ldd r26, Y+21 ; 0x15 2ab86: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2ab88: 88 0e add r8, r24 2ab8a: 99 1e adc r9, r25 2ab8c: aa 1e adc r10, r26 2ab8e: bb 1e adc r11, r27 2ab90: 28 01 movw r4, r16 2ab92: 39 01 movw r6, r18 2ab94: 6a 01 movw r12, r20 2ab96: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2ab98: 41 e0 ldi r20, 0x01 ; 1 2ab9a: c5 01 movw r24, r10 2ab9c: b4 01 movw r22, r8 2ab9e: 0f 94 48 55 call 0x2aa90 ; 0x2aa90 2aba2: 88 23 and r24, r24 2aba4: 41 f2 breq .-112 ; 0x2ab36 // store entry if (fatType_ == 16) { 2aba6: 9f 89 ldd r25, Y+23 ; 0x17 2aba8: 90 31 cpi r25, 0x10 ; 16 2abaa: 81 f5 brne .+96 ; 0x2ac0c cacheBuffer_.fat16[cluster & 0XFF] = value; 2abac: dd 24 eor r13, r13 2abae: ee 24 eor r14, r14 2abb0: ff 24 eor r15, r15 2abb2: f6 01 movw r30, r12 2abb4: ee 0f add r30, r30 2abb6: ff 1f adc r31, r31 2abb8: e3 56 subi r30, 0x63 ; 99 2abba: f1 4f sbci r31, 0xF1 ; 241 2abbc: 11 83 std Z+1, r17 ; 0x01 2abbe: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2abc0: 9a 89 ldd r25, Y+18 ; 0x12 2abc2: 92 30 cpi r25, 0x02 ; 2 2abc4: 08 f4 brcc .+2 ; 0x2abc8 2abc6: b8 cf rjmp .-144 ; 0x2ab38 2abc8: 4d 81 ldd r20, Y+5 ; 0x05 2abca: 5e 81 ldd r21, Y+6 ; 0x06 2abcc: 6f 81 ldd r22, Y+7 ; 0x07 2abce: 78 85 ldd r23, Y+8 ; 0x08 2abd0: 84 0e add r8, r20 2abd2: 95 1e adc r9, r21 2abd4: a6 1e adc r10, r22 2abd6: b7 1e adc r11, r23 2abd8: 80 92 95 0e sts 0x0E95, r8 ; 0x800e95 2abdc: 90 92 96 0e sts 0x0E96, r9 ; 0x800e96 2abe0: a0 92 97 0e sts 0x0E97, r10 ; 0x800e97 2abe4: b0 92 98 0e sts 0x0E98, r11 ; 0x800e98 2abe8: a7 cf rjmp .-178 ; 0x2ab38 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2abea: 80 32 cpi r24, 0x20 ; 32 2abec: 09 f0 breq .+2 ; 0x2abf0 2abee: a3 cf rjmp .-186 ; 0x2ab36 lba = fatStartBlock_ + (cluster >> 7); 2abf0: 8b 89 ldd r24, Y+19 ; 0x13 2abf2: 9c 89 ldd r25, Y+20 ; 0x14 2abf4: ad 89 ldd r26, Y+21 ; 0x15 2abf6: be 89 ldd r27, Y+22 ; 0x16 2abf8: 4a 01 movw r8, r20 2abfa: 5b 01 movw r10, r22 2abfc: e7 e0 ldi r30, 0x07 ; 7 2abfe: b6 94 lsr r11 2ac00: a7 94 ror r10 2ac02: 97 94 ror r9 2ac04: 87 94 ror r8 2ac06: ea 95 dec r30 2ac08: d1 f7 brne .-12 ; 0x2abfe 2ac0a: be cf rjmp .-132 ; 0x2ab88 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2ac0c: e8 94 clt 2ac0e: c7 f8 bld r12, 7 2ac10: dd 24 eor r13, r13 2ac12: ee 24 eor r14, r14 2ac14: ff 24 eor r15, r15 2ac16: f6 01 movw r30, r12 2ac18: ee 0f add r30, r30 2ac1a: ff 1f adc r31, r31 2ac1c: ee 0f add r30, r30 2ac1e: ff 1f adc r31, r31 2ac20: e3 56 subi r30, 0x63 ; 99 2ac22: f1 4f sbci r31, 0xF1 ; 241 2ac24: 40 82 st Z, r4 2ac26: 51 82 std Z+1, r5 ; 0x01 2ac28: 62 82 std Z+2, r6 ; 0x02 2ac2a: 73 82 std Z+3, r7 ; 0x03 2ac2c: c9 cf rjmp .-110 ; 0x2abc0 0002ac2e : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2ac2e: cf 92 push r12 2ac30: df 92 push r13 2ac32: ef 92 push r14 2ac34: ff 92 push r15 2ac36: 0f 93 push r16 2ac38: 1f 93 push r17 2ac3a: cf 93 push r28 2ac3c: df 93 push r29 2ac3e: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2ac40: 81 85 ldd r24, Z+9 ; 0x09 2ac42: 92 85 ldd r25, Z+10 ; 0x0a 2ac44: a3 85 ldd r26, Z+11 ; 0x0b 2ac46: b4 85 ldd r27, Z+12 ; 0x0c 2ac48: 01 96 adiw r24, 0x01 ; 1 2ac4a: a1 1d adc r26, r1 2ac4c: b1 1d adc r27, r1 2ac4e: 84 17 cp r24, r20 2ac50: 95 07 cpc r25, r21 2ac52: a6 07 cpc r26, r22 2ac54: b7 07 cpc r27, r23 2ac56: 50 f4 brcc .+20 ; 0x2ac6c *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2ac58: 80 e0 ldi r24, 0x00 ; 0 } 2ac5a: df 91 pop r29 2ac5c: cf 91 pop r28 2ac5e: 1f 91 pop r17 2ac60: 0f 91 pop r16 2ac62: ff 90 pop r15 2ac64: ef 90 pop r14 2ac66: df 90 pop r13 2ac68: cf 90 pop r12 2ac6a: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2ac6c: 87 89 ldd r24, Z+23 ; 0x17 2ac6e: 80 31 cpi r24, 0x10 ; 16 2ac70: a9 f5 brne .+106 ; 0x2acdc lba = fatStartBlock_ + (cluster >> 8); 2ac72: bb 27 eor r27, r27 2ac74: a7 2f mov r26, r23 2ac76: 96 2f mov r25, r22 2ac78: 85 2f mov r24, r21 2ac7a: c3 88 ldd r12, Z+19 ; 0x13 2ac7c: d4 88 ldd r13, Z+20 ; 0x14 2ac7e: e5 88 ldd r14, Z+21 ; 0x15 2ac80: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2ac82: 8c 0d add r24, r12 2ac84: 9d 1d adc r25, r13 2ac86: ae 1d adc r26, r14 2ac88: bf 1d adc r27, r15 2ac8a: e9 01 movw r28, r18 2ac8c: 6a 01 movw r12, r20 2ac8e: 7b 01 movw r14, r22 2ac90: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2ac92: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2ac96: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2ac9a: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2ac9e: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2aca2: 84 17 cp r24, r20 2aca4: 95 07 cpc r25, r21 2aca6: a6 07 cpc r26, r22 2aca8: b7 07 cpc r27, r23 2acaa: 49 f5 brne .+82 ; 0x2acfe if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2acac: f8 01 movw r30, r16 2acae: 87 89 ldd r24, Z+23 ; 0x17 2acb0: 80 31 cpi r24, 0x10 ; 16 2acb2: 69 f5 brne .+90 ; 0x2ad0e *value = cacheBuffer_.fat16[cluster & 0XFF]; 2acb4: b7 01 movw r22, r14 2acb6: a6 01 movw r20, r12 2acb8: 55 27 eor r21, r21 2acba: 66 27 eor r22, r22 2acbc: 77 27 eor r23, r23 2acbe: 44 0f add r20, r20 2acc0: 55 1f adc r21, r21 2acc2: 43 56 subi r20, 0x63 ; 99 2acc4: 51 4f sbci r21, 0xF1 ; 241 2acc6: fa 01 movw r30, r20 2acc8: 80 81 ld r24, Z 2acca: 91 81 ldd r25, Z+1 ; 0x01 2accc: b0 e0 ldi r27, 0x00 ; 0 2acce: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2acd0: 88 83 st Y, r24 2acd2: 99 83 std Y+1, r25 ; 0x01 2acd4: aa 83 std Y+2, r26 ; 0x02 2acd6: bb 83 std Y+3, r27 ; 0x03 2acd8: 81 e0 ldi r24, 0x01 ; 1 2acda: bf cf rjmp .-130 ; 0x2ac5a *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2acdc: 80 32 cpi r24, 0x20 ; 32 2acde: 09 f0 breq .+2 ; 0x2ace2 2ace0: bb cf rjmp .-138 ; 0x2ac58 lba = fatStartBlock_ + (cluster >> 7); 2ace2: c3 88 ldd r12, Z+19 ; 0x13 2ace4: d4 88 ldd r13, Z+20 ; 0x14 2ace6: e5 88 ldd r14, Z+21 ; 0x15 2ace8: f6 88 ldd r15, Z+22 ; 0x16 2acea: db 01 movw r26, r22 2acec: ca 01 movw r24, r20 2acee: c7 e0 ldi r28, 0x07 ; 7 2acf0: b6 95 lsr r27 2acf2: a7 95 ror r26 2acf4: 97 95 ror r25 2acf6: 87 95 ror r24 2acf8: ca 95 dec r28 2acfa: d1 f7 brne .-12 ; 0x2acf0 2acfc: c2 cf rjmp .-124 ; 0x2ac82 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2acfe: 40 e0 ldi r20, 0x00 ; 0 2ad00: bc 01 movw r22, r24 2ad02: cd 01 movw r24, r26 2ad04: 0f 94 48 55 call 0x2aa90 ; 0x2aa90 2ad08: 81 11 cpse r24, r1 2ad0a: d0 cf rjmp .-96 ; 0x2acac 2ad0c: a5 cf rjmp .-182 ; 0x2ac58 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2ad0e: b7 01 movw r22, r14 2ad10: a6 01 movw r20, r12 2ad12: 4f 77 andi r20, 0x7F ; 127 2ad14: 55 27 eor r21, r21 2ad16: 66 27 eor r22, r22 2ad18: 77 27 eor r23, r23 2ad1a: 44 0f add r20, r20 2ad1c: 55 1f adc r21, r21 2ad1e: 44 0f add r20, r20 2ad20: 55 1f adc r21, r21 2ad22: 43 56 subi r20, 0x63 ; 99 2ad24: 51 4f sbci r21, 0xF1 ; 241 2ad26: fa 01 movw r30, r20 2ad28: 80 81 ld r24, Z 2ad2a: 91 81 ldd r25, Z+1 ; 0x01 2ad2c: a2 81 ldd r26, Z+2 ; 0x02 2ad2e: b3 81 ldd r27, Z+3 ; 0x03 2ad30: bf 70 andi r27, 0x0F ; 15 2ad32: ce cf rjmp .-100 ; 0x2acd0 0002ad34 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2ad34: 4f 92 push r4 2ad36: 5f 92 push r5 2ad38: 6f 92 push r6 2ad3a: 7f 92 push r7 2ad3c: af 92 push r10 2ad3e: bf 92 push r11 2ad40: cf 92 push r12 2ad42: df 92 push r13 2ad44: ef 92 push r14 2ad46: ff 92 push r15 2ad48: 0f 93 push r16 2ad4a: 1f 93 push r17 2ad4c: cf 93 push r28 2ad4e: df 93 push r29 2ad50: 00 d0 rcall .+0 ; 0x2ad52 2ad52: 1f 92 push r1 2ad54: cd b7 in r28, 0x3d ; 61 2ad56: de b7 in r29, 0x3e ; 62 2ad58: 8c 01 movw r16, r24 2ad5a: 49 83 std Y+1, r20 ; 0x01 2ad5c: 5a 83 std Y+2, r21 ; 0x02 2ad5e: 6b 83 std Y+3, r22 ; 0x03 2ad60: 7c 83 std Y+4, r23 ; 0x04 2ad62: 59 01 movw r10, r18 uint32_t s = 0; 2ad64: c1 2c mov r12, r1 2ad66: d1 2c mov r13, r1 2ad68: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2ad6a: 41 2c mov r4, r1 2ad6c: 82 e0 ldi r24, 0x02 ; 2 2ad6e: 58 2e mov r5, r24 2ad70: 61 2c mov r6, r1 2ad72: 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; 2ad74: 49 81 ldd r20, Y+1 ; 0x01 2ad76: 5a 81 ldd r21, Y+2 ; 0x02 2ad78: 6b 81 ldd r22, Y+3 ; 0x03 2ad7a: 7c 81 ldd r23, Y+4 ; 0x04 2ad7c: 9e 01 movw r18, r28 2ad7e: 2f 5f subi r18, 0xFF ; 255 2ad80: 3f 4f sbci r19, 0xFF ; 255 2ad82: c8 01 movw r24, r16 2ad84: 0f 94 17 56 call 0x2ac2e ; 0x2ac2e 2ad88: 88 23 and r24, r24 2ad8a: 19 f1 breq .+70 ; 0x2add2 s += 512UL << clusterSizeShift_; 2ad8c: f8 01 movw r30, r16 2ad8e: 85 85 ldd r24, Z+13 ; 0x0d 2ad90: a3 01 movw r20, r6 2ad92: 92 01 movw r18, r4 2ad94: 04 c0 rjmp .+8 ; 0x2ad9e 2ad96: 22 0f add r18, r18 2ad98: 33 1f adc r19, r19 2ad9a: 44 1f adc r20, r20 2ad9c: 55 1f adc r21, r21 2ad9e: 8a 95 dec r24 2ada0: d2 f7 brpl .-12 ; 0x2ad96 2ada2: da 01 movw r26, r20 2ada4: c9 01 movw r24, r18 2ada6: c8 0e add r12, r24 2ada8: d9 1e adc r13, r25 2adaa: ea 1e adc r14, r26 2adac: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2adae: 49 81 ldd r20, Y+1 ; 0x01 2adb0: 5a 81 ldd r21, Y+2 ; 0x02 2adb2: 6b 81 ldd r22, Y+3 ; 0x03 2adb4: 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; 2adb6: 87 89 ldd r24, Z+23 ; 0x17 2adb8: 80 31 cpi r24, 0x10 ; 16 2adba: f1 f4 brne .+60 ; 0x2adf8 2adbc: 81 e0 ldi r24, 0x01 ; 1 2adbe: 48 3f cpi r20, 0xF8 ; 248 2adc0: 5f 4f sbci r21, 0xFF ; 255 2adc2: 61 05 cpc r22, r1 2adc4: 71 05 cpc r23, r1 2adc6: b0 f2 brcs .-84 ; 0x2ad74 *size = s; 2adc8: f5 01 movw r30, r10 2adca: c0 82 st Z, r12 2adcc: d1 82 std Z+1, r13 ; 0x01 2adce: e2 82 std Z+2, r14 ; 0x02 2add0: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2add2: 0f 90 pop r0 2add4: 0f 90 pop r0 2add6: 0f 90 pop r0 2add8: 0f 90 pop r0 2adda: df 91 pop r29 2addc: cf 91 pop r28 2adde: 1f 91 pop r17 2ade0: 0f 91 pop r16 2ade2: ff 90 pop r15 2ade4: ef 90 pop r14 2ade6: df 90 pop r13 2ade8: cf 90 pop r12 2adea: bf 90 pop r11 2adec: af 90 pop r10 2adee: 7f 90 pop r7 2adf0: 6f 90 pop r6 2adf2: 5f 90 pop r5 2adf4: 4f 90 pop r4 2adf6: 08 95 ret return cluster >= FAT32EOC_MIN; 2adf8: 81 e0 ldi r24, 0x01 ; 1 2adfa: 48 3f cpi r20, 0xF8 ; 248 2adfc: 5f 4f sbci r21, 0xFF ; 255 2adfe: 6f 4f sbci r22, 0xFF ; 255 2ae00: 7f 40 sbci r23, 0x0F ; 15 2ae02: 08 f4 brcc .+2 ; 0x2ae06 2ae04: b7 cf rjmp .-146 ; 0x2ad74 2ae06: e0 cf rjmp .-64 ; 0x2adc8 0002ae08 : * \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) { 2ae08: 0f 93 push r16 2ae0a: 1f 93 push r17 2ae0c: cf 93 push r28 2ae0e: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2ae10: fc 01 movw r30, r24 2ae12: 23 81 ldd r18, Z+3 ; 0x03 2ae14: 22 23 and r18, r18 2ae16: 31 f0 breq .+12 ; 0x2ae24 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 2ae18: 80 e0 ldi r24, 0x00 ; 0 } 2ae1a: df 91 pop r29 2ae1c: cf 91 pop r28 2ae1e: 1f 91 pop r17 2ae20: 0f 91 pop r16 2ae22: 08 95 ret 2ae24: 8b 01 movw r16, r22 2ae26: ec 01 movw r28, r24 2ae28: fb 01 movw r30, r22 2ae2a: 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)) { 2ae2c: 80 31 cpi r24, 0x10 ; 16 2ae2e: 39 f5 brne .+78 ; 0x2ae7e type_ = FAT_FILE_TYPE_ROOT_FIXED; 2ae30: 82 e0 ldi r24, 0x02 ; 2 2ae32: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 2ae34: 1d 8a std Y+21, r1 ; 0x15 2ae36: 1e 8a std Y+22, r1 ; 0x16 2ae38: 1f 8a std Y+23, r1 ; 0x17 2ae3a: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 2ae3c: 80 8d ldd r24, Z+24 ; 0x18 2ae3e: 91 8d ldd r25, Z+25 ; 0x19 2ae40: b0 e0 ldi r27, 0x00 ; 0 2ae42: a0 e0 ldi r26, 0x00 ; 0 2ae44: 25 e0 ldi r18, 0x05 ; 5 2ae46: 88 0f add r24, r24 2ae48: 99 1f adc r25, r25 2ae4a: aa 1f adc r26, r26 2ae4c: bb 1f adc r27, r27 2ae4e: 2a 95 dec r18 2ae50: d1 f7 brne .-12 ; 0x2ae46 2ae52: 89 8b std Y+17, r24 ; 0x11 2ae54: 9a 8b std Y+18, r25 ; 0x12 2ae56: ab 8b std Y+19, r26 ; 0x13 2ae58: 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; 2ae5a: 1a 8f std Y+26, r17 ; 0x1a 2ae5c: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 2ae5e: 81 e0 ldi r24, 0x01 ; 1 2ae60: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2ae62: 1c 82 std Y+4, r1 ; 0x04 2ae64: 1d 82 std Y+5, r1 ; 0x05 2ae66: 1e 82 std Y+6, r1 ; 0x06 2ae68: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2ae6a: 18 86 std Y+8, r1 ; 0x08 2ae6c: 19 86 std Y+9, r1 ; 0x09 2ae6e: 1a 86 std Y+10, r1 ; 0x0a 2ae70: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2ae72: 1c 86 std Y+12, r1 ; 0x0c 2ae74: 1d 86 std Y+13, r1 ; 0x0d 2ae76: 1e 86 std Y+14, r1 ; 0x0e 2ae78: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2ae7a: 18 8a std Y+16, r1 ; 0x10 2ae7c: ce cf rjmp .-100 ; 0x2ae1a 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) { 2ae7e: 80 32 cpi r24, 0x20 ; 32 2ae80: 59 f6 brne .-106 ; 0x2ae18 type_ = FAT_FILE_TYPE_ROOT32; 2ae82: 83 e0 ldi r24, 0x03 ; 3 2ae84: 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_;} 2ae86: 42 8d ldd r20, Z+26 ; 0x1a 2ae88: 53 8d ldd r21, Z+27 ; 0x1b 2ae8a: 64 8d ldd r22, Z+28 ; 0x1c 2ae8c: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2ae8e: 4d 8b std Y+21, r20 ; 0x15 2ae90: 5e 8b std Y+22, r21 ; 0x16 2ae92: 6f 8b std Y+23, r22 ; 0x17 2ae94: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2ae96: 9e 01 movw r18, r28 2ae98: 2f 5e subi r18, 0xEF ; 239 2ae9a: 3f 4f sbci r19, 0xFF ; 255 2ae9c: c8 01 movw r24, r16 2ae9e: 0f 94 9a 56 call 0x2ad34 ; 0x2ad34 2aea2: 81 11 cpse r24, r1 2aea4: da cf rjmp .-76 ; 0x2ae5a 2aea6: b8 cf rjmp .-144 ; 0x2ae18 0002aea8 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2aea8: cf 92 push r12 2aeaa: df 92 push r13 2aeac: ef 92 push r14 2aeae: ff 92 push r15 2aeb0: 1f 93 push r17 2aeb2: cf 93 push r28 2aeb4: df 93 push r29 2aeb6: ec 01 movw r28, r24 2aeb8: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2aeba: e1 11 cpse r30, r1 2aebc: 09 c0 rjmp .+18 ; 0x2aed0 2aebe: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2aec0: df 91 pop r29 2aec2: cf 91 pop r28 2aec4: 1f 91 pop r17 2aec6: ff 90 pop r15 2aec8: ef 90 pop r14 2aeca: df 90 pop r13 2aecc: cf 90 pop r12 2aece: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2aed0: 89 81 ldd r24, Y+1 ; 0x01 2aed2: 80 ff sbrs r24, 0 2aed4: f4 cf rjmp .-24 ; 0x2aebe gfOffset = curPosition_ & 0X1FF; // offset in block 2aed6: 48 85 ldd r20, Y+8 ; 0x08 2aed8: 59 85 ldd r21, Y+9 ; 0x09 2aeda: 6a 85 ldd r22, Y+10 ; 0x0a 2aedc: 7b 85 ldd r23, Y+11 ; 0x0b 2aede: 9a 01 movw r18, r20 2aee0: 31 70 andi r19, 0x01 ; 1 2aee2: 3a a3 std Y+34, r19 ; 0x22 2aee4: 29 a3 std Y+33, r18 ; 0x21 2aee6: 89 8d ldd r24, Y+25 ; 0x19 2aee8: 9a 8d ldd r25, Y+26 ; 0x1a 2aeea: 6a 01 movw r12, r20 2aeec: 7b 01 movw r14, r22 2aeee: f9 e0 ldi r31, 0x09 ; 9 2aef0: f6 94 lsr r15 2aef2: e7 94 ror r14 2aef4: d7 94 ror r13 2aef6: c7 94 ror r12 2aef8: fa 95 dec r31 2aefa: d1 f7 brne .-12 ; 0x2aef0 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2aefc: e2 30 cpi r30, 0x02 ; 2 2aefe: 79 f4 brne .+30 ; 0x2af1e // 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); 2af00: fc 01 movw r30, r24 2af02: 82 8d ldd r24, Z+26 ; 0x1a 2af04: 93 8d ldd r25, Z+27 ; 0x1b 2af06: a4 8d ldd r26, Z+28 ; 0x1c 2af08: b5 8d ldd r27, Z+29 ; 0x1d 2af0a: 8c 0d add r24, r12 2af0c: 9d 1d adc r25, r13 2af0e: ae 1d adc r26, r14 2af10: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2af12: 8d 8f std Y+29, r24 ; 0x1d 2af14: 9e 8f std Y+30, r25 ; 0x1e 2af16: af 8f std Y+31, r26 ; 0x1f 2af18: b8 a3 std Y+32, r27 ; 0x20 } return true; 2af1a: 81 e0 ldi r24, 0x01 ; 1 2af1c: d1 cf rjmp .-94 ; 0x2aec0 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);} 2af1e: fc 01 movw r30, r24 2af20: 14 81 ldd r17, Z+4 ; 0x04 2af22: 11 50 subi r17, 0x01 ; 1 2af24: 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) { 2af26: 23 2b or r18, r19 2af28: 71 f4 brne .+28 ; 0x2af46 2af2a: 11 11 cpse r17, r1 2af2c: 0c c0 rjmp .+24 ; 0x2af46 // start of new cluster if (curPosition_ == 0) { 2af2e: 45 2b or r20, r21 2af30: 46 2b or r20, r22 2af32: 47 2b or r20, r23 2af34: 31 f5 brne .+76 ; 0x2af82 // use first cluster in file curCluster_ = firstCluster_; 2af36: 8d 89 ldd r24, Y+21 ; 0x15 2af38: 9e 89 ldd r25, Y+22 ; 0x16 2af3a: af 89 ldd r26, Y+23 ; 0x17 2af3c: b8 8d ldd r27, Y+24 ; 0x18 2af3e: 8c 83 std Y+4, r24 ; 0x04 2af40: 9d 83 std Y+5, r25 ; 0x05 2af42: ae 83 std Y+6, r26 ; 0x06 2af44: 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; 2af46: e9 8d ldd r30, Y+25 ; 0x19 2af48: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2af4a: 8c 81 ldd r24, Y+4 ; 0x04 2af4c: 9d 81 ldd r25, Y+5 ; 0x05 2af4e: ae 81 ldd r26, Y+6 ; 0x06 2af50: bf 81 ldd r27, Y+7 ; 0x07 2af52: 02 97 sbiw r24, 0x02 ; 2 2af54: a1 09 sbc r26, r1 2af56: b1 09 sbc r27, r1 2af58: 25 85 ldd r18, Z+13 ; 0x0d 2af5a: 04 c0 rjmp .+8 ; 0x2af64 2af5c: 88 0f add r24, r24 2af5e: 99 1f adc r25, r25 2af60: aa 1f adc r26, r26 2af62: bb 1f adc r27, r27 2af64: 2a 95 dec r18 2af66: d2 f7 brpl .-12 ; 0x2af5c 2af68: 46 85 ldd r20, Z+14 ; 0x0e 2af6a: 57 85 ldd r21, Z+15 ; 0x0f 2af6c: 60 89 ldd r22, Z+16 ; 0x10 2af6e: 71 89 ldd r23, Z+17 ; 0x11 2af70: 84 0f add r24, r20 2af72: 95 1f adc r25, r21 2af74: a6 1f adc r26, r22 2af76: b7 1f adc r27, r23 2af78: 81 0f add r24, r17 2af7a: 91 1d adc r25, r1 2af7c: a1 1d adc r26, r1 2af7e: b1 1d adc r27, r1 2af80: c8 cf rjmp .-112 ; 0x2af12 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2af82: 4c 81 ldd r20, Y+4 ; 0x04 2af84: 5d 81 ldd r21, Y+5 ; 0x05 2af86: 6e 81 ldd r22, Y+6 ; 0x06 2af88: 7f 81 ldd r23, Y+7 ; 0x07 2af8a: 9e 01 movw r18, r28 2af8c: 2c 5f subi r18, 0xFC ; 252 2af8e: 3f 4f sbci r19, 0xFF ; 255 2af90: 0f 94 17 56 call 0x2ac2e ; 0x2ac2e 2af94: 81 11 cpse r24, r1 2af96: d7 cf rjmp .-82 ; 0x2af46 2af98: 92 cf rjmp .-220 ; 0x2aebe 0002af9a : * \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) { 2af9a: 8f 92 push r8 2af9c: 9f 92 push r9 2af9e: af 92 push r10 2afa0: bf 92 push r11 2afa2: cf 92 push r12 2afa4: df 92 push r13 2afa6: ef 92 push r14 2afa8: ff 92 push r15 2afaa: 0f 93 push r16 2afac: 1f 93 push r17 2afae: cf 93 push r28 2afb0: df 93 push r29 2afb2: ec 01 movw r28, r24 2afb4: 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; 2afb6: 81 11 cpse r24, r1 2afb8: 0e c0 rjmp .+28 ; 0x2afd6 done: return true; fail: return false; 2afba: 80 e0 ldi r24, 0x00 ; 0 } 2afbc: df 91 pop r29 2afbe: cf 91 pop r28 2afc0: 1f 91 pop r17 2afc2: 0f 91 pop r16 2afc4: ff 90 pop r15 2afc6: ef 90 pop r14 2afc8: df 90 pop r13 2afca: cf 90 pop r12 2afcc: bf 90 pop r11 2afce: af 90 pop r10 2afd0: 9f 90 pop r9 2afd2: 8f 90 pop r8 2afd4: 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; 2afd6: 09 89 ldd r16, Y+17 ; 0x11 2afd8: 1a 89 ldd r17, Y+18 ; 0x12 2afda: 2b 89 ldd r18, Y+19 ; 0x13 2afdc: 3c 89 ldd r19, Y+20 ; 0x14 2afde: 04 17 cp r16, r20 2afe0: 15 07 cpc r17, r21 2afe2: 26 07 cpc r18, r22 2afe4: 37 07 cpc r19, r23 2afe6: 48 f3 brcs .-46 ; 0x2afba 2afe8: 4a 01 movw r8, r20 2afea: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2afec: 82 30 cpi r24, 0x02 ; 2 2afee: 31 f4 brne .+12 ; 0x2affc curPosition_ = pos; 2aff0: 88 86 std Y+8, r8 ; 0x08 2aff2: 99 86 std Y+9, r9 ; 0x09 2aff4: aa 86 std Y+10, r10 ; 0x0a 2aff6: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2aff8: 81 e0 ldi r24, 0x01 ; 1 2affa: e0 cf rjmp .-64 ; 0x2afbc if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2affc: 81 14 cp r8, r1 2affe: 91 04 cpc r9, r1 2b000: a1 04 cpc r10, r1 2b002: b1 04 cpc r11, r1 2b004: 49 f4 brne .+18 ; 0x2b018 // set position to start of file curCluster_ = 0; 2b006: 1c 82 std Y+4, r1 ; 0x04 2b008: 1d 82 std Y+5, r1 ; 0x05 2b00a: 1e 82 std Y+6, r1 ; 0x06 2b00c: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2b00e: 18 86 std Y+8, r1 ; 0x08 2b010: 19 86 std Y+9, r1 ; 0x09 2b012: 1a 86 std Y+10, r1 ; 0x0a 2b014: 1b 86 std Y+11, r1 ; 0x0b 2b016: f0 cf rjmp .-32 ; 0x2aff8 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2b018: 08 85 ldd r16, Y+8 ; 0x08 2b01a: 19 85 ldd r17, Y+9 ; 0x09 2b01c: 2a 85 ldd r18, Y+10 ; 0x0a 2b01e: 3b 85 ldd r19, Y+11 ; 0x0b 2b020: e9 8d ldd r30, Y+25 ; 0x19 2b022: fa 8d ldd r31, Y+26 ; 0x1a 2b024: 85 85 ldd r24, Z+13 ; 0x0d 2b026: 90 e0 ldi r25, 0x00 ; 0 2b028: 09 96 adiw r24, 0x09 ; 9 2b02a: b9 01 movw r22, r18 2b02c: a8 01 movw r20, r16 2b02e: 41 50 subi r20, 0x01 ; 1 2b030: 51 09 sbc r21, r1 2b032: 61 09 sbc r22, r1 2b034: 71 09 sbc r23, r1 2b036: 08 2e mov r0, r24 2b038: 04 c0 rjmp .+8 ; 0x2b042 2b03a: 76 95 lsr r23 2b03c: 67 95 ror r22 2b03e: 57 95 ror r21 2b040: 47 95 ror r20 2b042: 0a 94 dec r0 2b044: d2 f7 brpl .-12 ; 0x2b03a nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2b046: 75 01 movw r14, r10 2b048: 64 01 movw r12, r8 2b04a: e1 e0 ldi r30, 0x01 ; 1 2b04c: ce 1a sub r12, r30 2b04e: d1 08 sbc r13, r1 2b050: e1 08 sbc r14, r1 2b052: f1 08 sbc r15, r1 2b054: 04 c0 rjmp .+8 ; 0x2b05e 2b056: f6 94 lsr r15 2b058: e7 94 ror r14 2b05a: d7 94 ror r13 2b05c: c7 94 ror r12 2b05e: 8a 95 dec r24 2b060: d2 f7 brpl .-12 ; 0x2b056 if (nNew < nCur || curPosition_ == 0) { 2b062: c4 16 cp r12, r20 2b064: d5 06 cpc r13, r21 2b066: e6 06 cpc r14, r22 2b068: f7 06 cpc r15, r23 2b06a: 20 f0 brcs .+8 ; 0x2b074 2b06c: 01 2b or r16, r17 2b06e: 02 2b or r16, r18 2b070: 03 2b or r16, r19 2b072: 11 f5 brne .+68 ; 0x2b0b8 // must follow chain from first cluster curCluster_ = firstCluster_; 2b074: 8d 89 ldd r24, Y+21 ; 0x15 2b076: 9e 89 ldd r25, Y+22 ; 0x16 2b078: af 89 ldd r26, Y+23 ; 0x17 2b07a: b8 8d ldd r27, Y+24 ; 0x18 2b07c: 8c 83 std Y+4, r24 ; 0x04 2b07e: 9d 83 std Y+5, r25 ; 0x05 2b080: ae 83 std Y+6, r26 ; 0x06 2b082: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2b084: 8e 01 movw r16, r28 2b086: 0c 5f subi r16, 0xFC ; 252 2b088: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2b08a: c1 14 cp r12, r1 2b08c: d1 04 cpc r13, r1 2b08e: e1 04 cpc r14, r1 2b090: f1 04 cpc r15, r1 2b092: 09 f4 brne .+2 ; 0x2b096 2b094: ad cf rjmp .-166 ; 0x2aff0 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2b096: 4c 81 ldd r20, Y+4 ; 0x04 2b098: 5d 81 ldd r21, Y+5 ; 0x05 2b09a: 6e 81 ldd r22, Y+6 ; 0x06 2b09c: 7f 81 ldd r23, Y+7 ; 0x07 2b09e: 98 01 movw r18, r16 2b0a0: 89 8d ldd r24, Y+25 ; 0x19 2b0a2: 9a 8d ldd r25, Y+26 ; 0x1a 2b0a4: 0f 94 17 56 call 0x2ac2e ; 0x2ac2e 2b0a8: 91 e0 ldi r25, 0x01 ; 1 2b0aa: c9 1a sub r12, r25 2b0ac: d1 08 sbc r13, r1 2b0ae: e1 08 sbc r14, r1 2b0b0: f1 08 sbc r15, r1 2b0b2: 81 11 cpse r24, r1 2b0b4: ea cf rjmp .-44 ; 0x2b08a 2b0b6: 81 cf rjmp .-254 ; 0x2afba if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2b0b8: c4 1a sub r12, r20 2b0ba: d5 0a sbc r13, r21 2b0bc: e6 0a sbc r14, r22 2b0be: f7 0a sbc r15, r23 2b0c0: e1 cf rjmp .-62 ; 0x2b084 0002b0c2 : 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() { 2b0c2: 3f 92 push r3 2b0c4: 4f 92 push r4 2b0c6: 5f 92 push r5 2b0c8: 6f 92 push r6 2b0ca: 7f 92 push r7 2b0cc: 8f 92 push r8 2b0ce: 9f 92 push r9 2b0d0: af 92 push r10 2b0d2: bf 92 push r11 2b0d4: cf 92 push r12 2b0d6: df 92 push r13 2b0d8: ef 92 push r14 2b0da: ff 92 push r15 2b0dc: 0f 93 push r16 2b0de: 1f 93 push r17 2b0e0: cf 93 push r28 2b0e2: df 93 push r29 2b0e4: cd b7 in r28, 0x3d ; 61 2b0e6: de b7 in r29, 0x3e ; 62 2b0e8: 2c 97 sbiw r28, 0x0c ; 12 2b0ea: 0f b6 in r0, 0x3f ; 63 2b0ec: f8 94 cli 2b0ee: de bf out 0x3e, r29 ; 62 2b0f0: 0f be out 0x3f, r0 ; 63 2b0f2: cd bf out 0x3d, r28 ; 61 2b0f4: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2b0f6: dc 01 movw r26, r24 2b0f8: 59 96 adiw r26, 0x19 ; 25 2b0fa: 8d 90 ld r8, X+ 2b0fc: 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; 2b0fe: f4 01 movw r30, r8 2b100: 81 85 ldd r24, Z+9 ; 0x09 2b102: 92 85 ldd r25, Z+10 ; 0x0a 2b104: a3 85 ldd r26, Z+11 ; 0x0b 2b106: b4 85 ldd r27, Z+12 ; 0x0c 2b108: 9c 01 movw r18, r24 2b10a: ad 01 movw r20, r26 2b10c: 2f 5f subi r18, 0xFF ; 255 2b10e: 3f 4f sbci r19, 0xFF ; 255 2b110: 4f 4f sbci r20, 0xFF ; 255 2b112: 5f 4f sbci r21, 0xFF ; 255 2b114: 29 87 std Y+9, r18 ; 0x09 2b116: 3a 87 std Y+10, r19 ; 0x0a 2b118: 4b 87 std Y+11, r20 ; 0x0b 2b11a: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 2b11c: d5 01 movw r26, r10 2b11e: 14 96 adiw r26, 0x04 ; 4 2b120: 4d 90 ld r4, X+ 2b122: 5d 90 ld r5, X+ 2b124: 6d 90 ld r6, X+ 2b126: 7c 90 ld r7, X 2b128: 17 97 sbiw r26, 0x07 ; 7 2b12a: 41 14 cp r4, r1 2b12c: 51 04 cpc r5, r1 2b12e: 61 04 cpc r6, r1 2b130: 71 04 cpc r7, r1 2b132: 09 f4 brne .+2 ; 0x2b136 2b134: 59 c0 rjmp .+178 ; 0x2b1e8 // try to make file contiguous bgnCluster = *curCluster + 1; 2b136: bf ef ldi r27, 0xFF ; 255 2b138: 4b 1a sub r4, r27 2b13a: 5b 0a sbc r5, r27 2b13c: 6b 0a sbc r6, r27 2b13e: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2b140: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2b142: 73 01 movw r14, r6 2b144: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2b146: 1d 82 std Y+5, r1 ; 0x05 2b148: 1e 82 std Y+6, r1 ; 0x06 2b14a: 1f 82 std Y+7, r1 ; 0x07 2b14c: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 2b14e: f4 01 movw r30, r8 2b150: 81 85 ldd r24, Z+9 ; 0x09 2b152: 92 85 ldd r25, Z+10 ; 0x0a 2b154: a3 85 ldd r26, Z+11 ; 0x0b 2b156: b4 85 ldd r27, Z+12 ; 0x0c 2b158: 2d 81 ldd r18, Y+5 ; 0x05 2b15a: 3e 81 ldd r19, Y+6 ; 0x06 2b15c: 4f 81 ldd r20, Y+7 ; 0x07 2b15e: 58 85 ldd r21, Y+8 ; 0x08 2b160: 28 17 cp r18, r24 2b162: 39 07 cpc r19, r25 2b164: 4a 07 cpc r20, r26 2b166: 5b 07 cpc r21, r27 2b168: 08 f0 brcs .+2 ; 0x2b16c 2b16a: 56 c0 rjmp .+172 ; 0x2b218 // past end - start from beginning of FAT if (endCluster > fatEnd) { 2b16c: 89 85 ldd r24, Y+9 ; 0x09 2b16e: 9a 85 ldd r25, Y+10 ; 0x0a 2b170: ab 85 ldd r26, Y+11 ; 0x0b 2b172: bc 85 ldd r27, Y+12 ; 0x0c 2b174: 8c 15 cp r24, r12 2b176: 9d 05 cpc r25, r13 2b178: ae 05 cpc r26, r14 2b17a: bf 05 cpc r27, r15 2b17c: 50 f4 brcc .+20 ; 0x2b192 bgnCluster = endCluster = 2; 2b17e: 82 e0 ldi r24, 0x02 ; 2 2b180: c8 2e mov r12, r24 2b182: d1 2c mov r13, r1 2b184: e1 2c mov r14, r1 2b186: f1 2c mov r15, r1 2b188: 92 e0 ldi r25, 0x02 ; 2 2b18a: 49 2e mov r4, r25 2b18c: 51 2c mov r5, r1 2b18e: 61 2c mov r6, r1 2b190: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2b192: 9e 01 movw r18, r28 2b194: 2f 5f subi r18, 0xFF ; 255 2b196: 3f 4f sbci r19, 0xFF ; 255 2b198: b7 01 movw r22, r14 2b19a: a6 01 movw r20, r12 2b19c: c4 01 movw r24, r8 2b19e: 0f 94 17 56 call 0x2ac2e ; 0x2ac2e 2b1a2: 88 23 and r24, r24 2b1a4: c9 f1 breq .+114 ; 0x2b218 if (f != 0) { 2b1a6: 89 81 ldd r24, Y+1 ; 0x01 2b1a8: 9a 81 ldd r25, Y+2 ; 0x02 2b1aa: ab 81 ldd r26, Y+3 ; 0x03 2b1ac: bc 81 ldd r27, Y+4 ; 0x04 2b1ae: 89 2b or r24, r25 2b1b0: 8a 2b or r24, r26 2b1b2: 8b 2b or r24, r27 2b1b4: 01 f1 breq .+64 ; 0x2b1f6 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2b1b6: 26 01 movw r4, r12 2b1b8: 37 01 movw r6, r14 2b1ba: 9f ef ldi r25, 0xFF ; 255 2b1bc: 49 1a sub r4, r25 2b1be: 59 0a sbc r5, r25 2b1c0: 69 0a sbc r6, r25 2b1c2: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2b1c4: 2d 81 ldd r18, Y+5 ; 0x05 2b1c6: 3e 81 ldd r19, Y+6 ; 0x06 2b1c8: 4f 81 ldd r20, Y+7 ; 0x07 2b1ca: 58 85 ldd r21, Y+8 ; 0x08 2b1cc: 2f 5f subi r18, 0xFF ; 255 2b1ce: 3f 4f sbci r19, 0xFF ; 255 2b1d0: 4f 4f sbci r20, 0xFF ; 255 2b1d2: 5f 4f sbci r21, 0xFF ; 255 2b1d4: 2d 83 std Y+5, r18 ; 0x05 2b1d6: 3e 83 std Y+6, r19 ; 0x06 2b1d8: 4f 83 std Y+7, r20 ; 0x07 2b1da: 58 87 std Y+8, r21 ; 0x08 2b1dc: 3f ef ldi r19, 0xFF ; 255 2b1de: c3 1a sub r12, r19 2b1e0: d3 0a sbc r13, r19 2b1e2: e3 0a sbc r14, r19 2b1e4: f3 0a sbc r15, r19 2b1e6: b3 cf rjmp .-154 ; 0x2b14e // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2b1e8: 40 80 ld r4, Z 2b1ea: 51 80 ldd r5, Z+1 ; 0x01 2b1ec: 62 80 ldd r6, Z+2 ; 0x02 2b1ee: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2b1f0: 33 24 eor r3, r3 2b1f2: 33 94 inc r3 2b1f4: a6 cf rjmp .-180 ; 0x2b142 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) { 2b1f6: c4 14 cp r12, r4 2b1f8: d5 04 cpc r13, r5 2b1fa: e6 04 cpc r14, r6 2b1fc: f7 04 cpc r15, r7 2b1fe: 11 f7 brne .-60 ; 0x2b1c4 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); 2b200: 0f ef ldi r16, 0xFF ; 255 2b202: 1f ef ldi r17, 0xFF ; 255 2b204: 2f ef ldi r18, 0xFF ; 255 2b206: 3f e0 ldi r19, 0x0F ; 15 2b208: b7 01 movw r22, r14 2b20a: a6 01 movw r20, r12 2b20c: c4 01 movw r24, r8 2b20e: 0f 94 85 55 call 0x2ab0a ; 0x2ab0a 2b212: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 2b214: 81 11 cpse r24, r1 2b216: 1a c0 rjmp .+52 ; 0x2b24c flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 2b218: 71 2c mov r7, r1 } 2b21a: 87 2d mov r24, r7 2b21c: 2c 96 adiw r28, 0x0c ; 12 2b21e: 0f b6 in r0, 0x3f ; 63 2b220: f8 94 cli 2b222: de bf out 0x3e, r29 ; 62 2b224: 0f be out 0x3f, r0 ; 63 2b226: cd bf out 0x3d, r28 ; 61 2b228: df 91 pop r29 2b22a: cf 91 pop r28 2b22c: 1f 91 pop r17 2b22e: 0f 91 pop r16 2b230: ff 90 pop r15 2b232: ef 90 pop r14 2b234: df 90 pop r13 2b236: cf 90 pop r12 2b238: bf 90 pop r11 2b23a: af 90 pop r10 2b23c: 9f 90 pop r9 2b23e: 8f 90 pop r8 2b240: 7f 90 pop r7 2b242: 6f 90 pop r6 2b244: 5f 90 pop r5 2b246: 4f 90 pop r4 2b248: 3f 90 pop r3 2b24a: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 2b24c: f5 01 movw r30, r10 2b24e: 44 81 ldd r20, Z+4 ; 0x04 2b250: 55 81 ldd r21, Z+5 ; 0x05 2b252: 66 81 ldd r22, Z+6 ; 0x06 2b254: 77 81 ldd r23, Z+7 ; 0x07 2b256: 41 15 cp r20, r1 2b258: 51 05 cpc r21, r1 2b25a: 61 05 cpc r22, r1 2b25c: 71 05 cpc r23, r1 2b25e: 39 f0 breq .+14 ; 0x2b26e // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2b260: 97 01 movw r18, r14 2b262: 86 01 movw r16, r12 2b264: c4 01 movw r24, r8 2b266: 0f 94 85 55 call 0x2ab0a ; 0x2ab0a 2b26a: 88 23 and r24, r24 2b26c: a9 f2 breq .-86 ; 0x2b218 } // return first cluster number to caller *curCluster = bgnCluster; 2b26e: d5 01 movw r26, r10 2b270: 14 96 adiw r26, 0x04 ; 4 2b272: cd 92 st X+, r12 2b274: dd 92 st X+, r13 2b276: ed 92 st X+, r14 2b278: fc 92 st X, r15 2b27a: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2b27c: 33 20 and r3, r3 2b27e: 51 f0 breq .+20 ; 0x2b294 2b280: d7 01 movw r26, r14 2b282: c6 01 movw r24, r12 2b284: 01 96 adiw r24, 0x01 ; 1 2b286: a1 1d adc r26, r1 2b288: b1 1d adc r27, r1 2b28a: f4 01 movw r30, r8 2b28c: 80 83 st Z, r24 2b28e: 91 83 std Z+1, r25 ; 0x01 2b290: a2 83 std Z+2, r26 ; 0x02 2b292: 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) { 2b294: f5 01 movw r30, r10 2b296: 85 89 ldd r24, Z+21 ; 0x15 2b298: 96 89 ldd r25, Z+22 ; 0x16 2b29a: a7 89 ldd r26, Z+23 ; 0x17 2b29c: b0 8d ldd r27, Z+24 ; 0x18 2b29e: 89 2b or r24, r25 2b2a0: 8a 2b or r24, r26 2b2a2: 8b 2b or r24, r27 2b2a4: 09 f0 breq .+2 ; 0x2b2a8 2b2a6: b9 cf rjmp .-142 ; 0x2b21a firstCluster_ = curCluster_; 2b2a8: c5 8a std Z+21, r12 ; 0x15 2b2aa: d6 8a std Z+22, r13 ; 0x16 2b2ac: e7 8a std Z+23, r14 ; 0x17 2b2ae: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2b2b0: 81 81 ldd r24, Z+1 ; 0x01 2b2b2: 80 68 ori r24, 0x80 ; 128 2b2b4: 81 83 std Z+1, r24 ; 0x01 2b2b6: b1 cf rjmp .-158 ; 0x2b21a 0002b2b8 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2b2b8: cf 93 push r28 2b2ba: df 93 push r29 2b2bc: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2b2be: 46 2f mov r20, r22 2b2c0: 41 70 andi r20, 0x01 ; 1 2b2c2: 6c 85 ldd r22, Y+12 ; 0x0c 2b2c4: 7d 85 ldd r23, Y+13 ; 0x0d 2b2c6: 8e 85 ldd r24, Y+14 ; 0x0e 2b2c8: 9f 85 ldd r25, Y+15 ; 0x0f 2b2ca: 0f 94 48 55 call 0x2aa90 ; 0x2aa90 2b2ce: 88 23 and r24, r24 2b2d0: 51 f0 breq .+20 ; 0x2b2e6 return vol_->cache()->dir + dirIndex_; 2b2d2: 88 89 ldd r24, Y+16 ; 0x10 2b2d4: 20 e2 ldi r18, 0x20 ; 32 2b2d6: 82 9f mul r24, r18 2b2d8: c0 01 movw r24, r0 2b2da: 11 24 eor r1, r1 2b2dc: 83 56 subi r24, 0x63 ; 99 2b2de: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 2b2e0: df 91 pop r29 2b2e2: cf 91 pop r28 2b2e4: 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; 2b2e6: 90 e0 ldi r25, 0x00 ; 0 2b2e8: 80 e0 ldi r24, 0x00 ; 0 2b2ea: fa cf rjmp .-12 ; 0x2b2e0 0002b2ec : * \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() { 2b2ec: cf 93 push r28 2b2ee: df 93 push r29 2b2f0: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2b2f2: 8b 81 ldd r24, Y+3 ; 0x03 2b2f4: 88 23 and r24, r24 2b2f6: 49 f1 breq .+82 ; 0x2b34a if (flags_ & F_FILE_DIR_DIRTY) { 2b2f8: 89 81 ldd r24, Y+1 ; 0x01 2b2fa: 87 ff sbrs r24, 7 2b2fc: 22 c0 rjmp .+68 ; 0x2b342 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2b2fe: 61 e0 ldi r22, 0x01 ; 1 2b300: ce 01 movw r24, r28 2b302: 0f 94 5c 59 call 0x2b2b8 ; 0x2b2b8 2b306: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2b308: 89 2b or r24, r25 2b30a: f9 f0 breq .+62 ; 0x2b34a 2b30c: 80 81 ld r24, Z 2b30e: 85 3e cpi r24, 0xE5 ; 229 2b310: e1 f0 breq .+56 ; 0x2b34a // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2b312: 8b 81 ldd r24, Y+3 ; 0x03 2b314: 82 30 cpi r24, 0x02 ; 2 2b316: 40 f4 brcc .+16 ; 0x2b328 2b318: 89 89 ldd r24, Y+17 ; 0x11 2b31a: 9a 89 ldd r25, Y+18 ; 0x12 2b31c: ab 89 ldd r26, Y+19 ; 0x13 2b31e: bc 89 ldd r27, Y+20 ; 0x14 2b320: 84 8f std Z+28, r24 ; 0x1c 2b322: 95 8f std Z+29, r25 ; 0x1d 2b324: a6 8f std Z+30, r26 ; 0x1e 2b326: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2b328: 8d 89 ldd r24, Y+21 ; 0x15 2b32a: 9e 89 ldd r25, Y+22 ; 0x16 2b32c: 93 8f std Z+27, r25 ; 0x1b 2b32e: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2b330: 8d 89 ldd r24, Y+21 ; 0x15 2b332: 9e 89 ldd r25, Y+22 ; 0x16 2b334: af 89 ldd r26, Y+23 ; 0x17 2b336: b8 8d ldd r27, Y+24 ; 0x18 2b338: b5 8b std Z+21, r27 ; 0x15 2b33a: 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; 2b33c: 89 81 ldd r24, Y+1 ; 0x01 2b33e: 8f 77 andi r24, 0x7F ; 127 2b340: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2b342: df 91 pop r29 2b344: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2b346: 0d 94 50 54 jmp 0x2a8a0 ; 0x2a8a0 fail: writeError = true; 2b34a: 81 e0 ldi r24, 0x01 ; 1 2b34c: 88 83 st Y, r24 return false; } 2b34e: 80 e0 ldi r24, 0x00 ; 0 2b350: df 91 pop r29 2b352: cf 91 pop r28 2b354: 08 95 ret 0002b356 : * * \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() { 2b356: cf 93 push r28 2b358: df 93 push r29 2b35a: ec 01 movw r28, r24 bool rtn = sync(); 2b35c: 0f 94 76 59 call 0x2b2ec ; 0x2b2ec type_ = FAT_FILE_TYPE_CLOSED; 2b360: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2b362: df 91 pop r29 2b364: cf 91 pop r28 2b366: 08 95 ret 0002b368 : * \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) { 2b368: cf 93 push r28 2b36a: df 93 push r29 2b36c: eb 01 movw r28, r22 2b36e: fc 01 movw r30, r24 2b370: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2b372: 21 11 cpse r18, r1 2b374: 04 c0 rjmp .+8 ; 0x2b37e 2b376: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2b378: df 91 pop r29 2b37a: cf 91 pop r28 2b37c: 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; 2b37e: 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()) { 2b380: 22 30 cpi r18, 0x02 ; 2 2b382: 28 f4 brcc .+10 ; 0x2b38e name[0] = '/'; 2b384: 8f e2 ldi r24, 0x2F ; 47 2b386: 88 83 st Y, r24 name[1] = '\0'; 2b388: 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; 2b38a: 81 e0 ldi r24, 0x01 ; 1 2b38c: f5 cf rjmp .-22 ; 0x2b378 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2b38e: 60 e0 ldi r22, 0x00 ; 0 2b390: 0f 94 5c 59 call 0x2b2b8 ; 0x2b2b8 if (!p) return false; 2b394: 00 97 sbiw r24, 0x00 ; 0 2b396: 79 f3 breq .-34 ; 0x2b376 2b398: 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; 2b39a: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2b39c: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2b39e: 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; 2b3a0: 2d 91 ld r18, X+ 2b3a2: 20 32 cpi r18, 0x20 ; 32 2b3a4: 99 f0 breq .+38 ; 0x2b3cc if (i == 8) name[j++] = '.'; 2b3a6: 88 30 cpi r24, 0x08 ; 8 2b3a8: 31 f4 brne .+12 ; 0x2b3b6 2b3aa: 9e 01 movw r18, r28 2b3ac: 26 0f add r18, r22 2b3ae: 31 1d adc r19, r1 2b3b0: f9 01 movw r30, r18 2b3b2: 90 83 st Z, r25 2b3b4: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2b3b6: 9e 01 movw r18, r28 2b3b8: 26 0f add r18, r22 2b3ba: 31 1d adc r19, r1 2b3bc: ad 01 movw r20, r26 2b3be: 41 50 subi r20, 0x01 ; 1 2b3c0: 51 09 sbc r21, r1 2b3c2: fa 01 movw r30, r20 2b3c4: 40 81 ld r20, Z 2b3c6: f9 01 movw r30, r18 2b3c8: 40 83 st Z, r20 2b3ca: 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++) { 2b3cc: 8f 5f subi r24, 0xFF ; 255 2b3ce: 8b 30 cpi r24, 0x0B ; 11 2b3d0: 39 f7 brne .-50 ; 0x2b3a0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2b3d2: fe 01 movw r30, r28 2b3d4: e6 0f add r30, r22 2b3d6: f1 1d adc r31, r1 2b3d8: 10 82 st Z, r1 2b3da: d7 cf rjmp .-82 ; 0x2b38a 0002b3dc : * 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) { 2b3dc: 2f 92 push r2 2b3de: 3f 92 push r3 2b3e0: 4f 92 push r4 2b3e2: 5f 92 push r5 2b3e4: 6f 92 push r6 2b3e6: 7f 92 push r7 2b3e8: 8f 92 push r8 2b3ea: 9f 92 push r9 2b3ec: af 92 push r10 2b3ee: bf 92 push r11 2b3f0: cf 92 push r12 2b3f2: df 92 push r13 2b3f4: ef 92 push r14 2b3f6: ff 92 push r15 2b3f8: 0f 93 push r16 2b3fa: 1f 93 push r17 2b3fc: cf 93 push r28 2b3fe: df 93 push r29 2b400: 00 d0 rcall .+0 ; 0x2b402 2b402: 1f 92 push r1 2b404: cd b7 in r28, 0x3d ; 61 2b406: de b7 in r29, 0x3e ; 62 2b408: 9c 83 std Y+4, r25 ; 0x04 2b40a: 8b 83 std Y+3, r24 ; 0x03 2b40c: 4b 01 movw r8, r22 2b40e: 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; 2b410: dc 01 movw r26, r24 2b412: 13 96 adiw r26, 0x03 ; 3 2b414: 8c 91 ld r24, X 2b416: 81 11 cpse r24, r1 2b418: 19 c0 rjmp .+50 ; 0x2b44c toRead -= n; } return nbyte; fail: return -1; 2b41a: 8f ef ldi r24, 0xFF ; 255 2b41c: 9f ef ldi r25, 0xFF ; 255 } 2b41e: 0f 90 pop r0 2b420: 0f 90 pop r0 2b422: 0f 90 pop r0 2b424: 0f 90 pop r0 2b426: df 91 pop r29 2b428: cf 91 pop r28 2b42a: 1f 91 pop r17 2b42c: 0f 91 pop r16 2b42e: ff 90 pop r15 2b430: ef 90 pop r14 2b432: df 90 pop r13 2b434: cf 90 pop r12 2b436: bf 90 pop r11 2b438: af 90 pop r10 2b43a: 9f 90 pop r9 2b43c: 8f 90 pop r8 2b43e: 7f 90 pop r7 2b440: 6f 90 pop r6 2b442: 5f 90 pop r5 2b444: 4f 90 pop r4 2b446: 3f 90 pop r3 2b448: 2f 90 pop r2 2b44a: 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; 2b44c: eb 81 ldd r30, Y+3 ; 0x03 2b44e: fc 81 ldd r31, Y+4 ; 0x04 2b450: 81 81 ldd r24, Z+1 ; 0x01 2b452: 80 ff sbrs r24, 0 2b454: e2 cf rjmp .-60 ; 0x2b41a // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 2b456: 01 89 ldd r16, Z+17 ; 0x11 2b458: 12 89 ldd r17, Z+18 ; 0x12 2b45a: 23 89 ldd r18, Z+19 ; 0x13 2b45c: 34 89 ldd r19, Z+20 ; 0x14 2b45e: 40 85 ldd r20, Z+8 ; 0x08 2b460: 51 85 ldd r21, Z+9 ; 0x09 2b462: 62 85 ldd r22, Z+10 ; 0x0a 2b464: 73 85 ldd r23, Z+11 ; 0x0b 2b466: c7 01 movw r24, r14 2b468: b0 e0 ldi r27, 0x00 ; 0 2b46a: a0 e0 ldi r26, 0x00 ; 0 2b46c: 28 01 movw r4, r16 2b46e: 39 01 movw r6, r18 2b470: 44 1a sub r4, r20 2b472: 55 0a sbc r5, r21 2b474: 66 0a sbc r6, r22 2b476: 77 0a sbc r7, r23 2b478: 84 15 cp r24, r4 2b47a: 95 05 cpc r25, r5 2b47c: a6 05 cpc r26, r6 2b47e: b7 05 cpc r27, r7 2b480: 18 f0 brcs .+6 ; 0x2b488 nbyte = fileSize_ - curPosition_; 2b482: 78 01 movw r14, r16 2b484: e4 1a sub r14, r20 2b486: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 2b488: 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; 2b48a: 8b 81 ldd r24, Y+3 ; 0x03 2b48c: 9c 81 ldd r25, Y+4 ; 0x04 2b48e: 04 96 adiw r24, 0x04 ; 4 2b490: 9a 83 std Y+2, r25 ; 0x02 2b492: 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; 2b494: 61 2c mov r6, r1 2b496: 32 e0 ldi r19, 0x02 ; 2 2b498: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 2b49a: c1 14 cp r12, r1 2b49c: d1 04 cpc r13, r1 2b49e: 09 f4 brne .+2 ; 0x2b4a2 2b4a0: b7 c0 rjmp .+366 ; 0x2b610 offset = curPosition_ & 0X1FF; // offset in block 2b4a2: ab 81 ldd r26, Y+3 ; 0x03 2b4a4: bc 81 ldd r27, Y+4 ; 0x04 2b4a6: 18 96 adiw r26, 0x08 ; 8 2b4a8: 4d 91 ld r20, X+ 2b4aa: 5d 91 ld r21, X+ 2b4ac: 6d 91 ld r22, X+ 2b4ae: 7c 91 ld r23, X 2b4b0: 1b 97 sbiw r26, 0x0b ; 11 2b4b2: 5a 01 movw r10, r20 2b4b4: b1 e0 ldi r27, 0x01 ; 1 2b4b6: bb 22 and r11, r27 2b4b8: eb 81 ldd r30, Y+3 ; 0x03 2b4ba: fc 81 ldd r31, Y+4 ; 0x04 2b4bc: 81 8d ldd r24, Z+25 ; 0x19 2b4be: 92 8d ldd r25, Z+26 ; 0x1a 2b4c0: 1a 01 movw r2, r20 2b4c2: 2b 01 movw r4, r22 2b4c4: 29 e0 ldi r18, 0x09 ; 9 2b4c6: 56 94 lsr r5 2b4c8: 47 94 ror r4 2b4ca: 37 94 ror r3 2b4cc: 27 94 ror r2 2b4ce: 2a 95 dec r18 2b4d0: d1 f7 brne .-12 ; 0x2b4c6 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2b4d2: 23 81 ldd r18, Z+3 ; 0x03 2b4d4: 22 30 cpi r18, 0x02 ; 2 2b4d6: 91 f5 brne .+100 ; 0x2b53c block = vol_->rootDirStart() + (curPosition_ >> 9); 2b4d8: dc 01 movw r26, r24 2b4da: 5a 96 adiw r26, 0x1a ; 26 2b4dc: 6d 91 ld r22, X+ 2b4de: 7d 91 ld r23, X+ 2b4e0: 8d 91 ld r24, X+ 2b4e2: 9c 91 ld r25, X 2b4e4: 5d 97 sbiw r26, 0x1d ; 29 2b4e6: 62 0d add r22, r2 2b4e8: 73 1d adc r23, r3 2b4ea: 84 1d adc r24, r4 2b4ec: 95 1d adc r25, r5 2b4ee: 83 01 movw r16, r6 2b4f0: 0a 19 sub r16, r10 2b4f2: 1b 09 sbc r17, r11 2b4f4: c0 16 cp r12, r16 2b4f6: d1 06 cpc r13, r17 2b4f8: 08 f4 brcc .+2 ; 0x2b4fc 2b4fa: 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()) { 2b4fc: 01 15 cp r16, r1 2b4fe: b2 e0 ldi r27, 0x02 ; 2 2b500: 1b 07 cpc r17, r27 2b502: 71 f4 brne .+28 ; 0x2b520 2b504: 20 91 91 0e lds r18, 0x0E91 ; 0x800e91 2b508: 30 91 92 0e lds r19, 0x0E92 ; 0x800e92 2b50c: 40 91 93 0e lds r20, 0x0E93 ; 0x800e93 2b510: 50 91 94 0e lds r21, 0x0E94 ; 0x800e94 2b514: 62 17 cp r22, r18 2b516: 73 07 cpc r23, r19 2b518: 84 07 cpc r24, r20 2b51a: 95 07 cpc r25, r21 2b51c: 09 f0 breq .+2 ; 0x2b520 2b51e: 59 c0 rjmp .+178 ; 0x2b5d2 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; 2b520: 40 e0 ldi r20, 0x00 ; 0 2b522: 0f 94 48 55 call 0x2aa90 ; 0x2aa90 2b526: 88 23 and r24, r24 2b528: 09 f4 brne .+2 ; 0x2b52c 2b52a: 77 cf rjmp .-274 ; 0x2b41a uint8_t* src = vol_->cache()->data + offset; 2b52c: b5 01 movw r22, r10 2b52e: 63 56 subi r22, 0x63 ; 99 2b530: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 2b532: a8 01 movw r20, r16 2b534: c4 01 movw r24, r8 2b536: 0f 94 7d e2 call 0x3c4fa ; 0x3c4fa 2b53a: 57 c0 rjmp .+174 ; 0x2b5ea 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);} 2b53c: fc 01 movw r30, r24 2b53e: 14 81 ldd r17, Z+4 ; 0x04 2b540: 11 50 subi r17, 0x01 ; 1 2b542: 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) { 2b544: a1 14 cp r10, r1 2b546: b1 04 cpc r11, r1 2b548: 81 f4 brne .+32 ; 0x2b56a 2b54a: 11 11 cpse r17, r1 2b54c: 0e c0 rjmp .+28 ; 0x2b56a // start of new cluster if (curPosition_ == 0) { 2b54e: 45 2b or r20, r21 2b550: 46 2b or r20, r22 2b552: 47 2b or r20, r23 2b554: 79 f5 brne .+94 ; 0x2b5b4 // use first cluster in file curCluster_ = firstCluster_; 2b556: eb 81 ldd r30, Y+3 ; 0x03 2b558: fc 81 ldd r31, Y+4 ; 0x04 2b55a: 85 89 ldd r24, Z+21 ; 0x15 2b55c: 96 89 ldd r25, Z+22 ; 0x16 2b55e: a7 89 ldd r26, Z+23 ; 0x17 2b560: b0 8d ldd r27, Z+24 ; 0x18 2b562: 84 83 std Z+4, r24 ; 0x04 2b564: 95 83 std Z+5, r25 ; 0x05 2b566: a6 83 std Z+6, r26 ; 0x06 2b568: 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; 2b56a: ab 81 ldd r26, Y+3 ; 0x03 2b56c: bc 81 ldd r27, Y+4 ; 0x04 2b56e: 59 96 adiw r26, 0x19 ; 25 2b570: ed 91 ld r30, X+ 2b572: fc 91 ld r31, X 2b574: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2b576: 14 96 adiw r26, 0x04 ; 4 2b578: 6d 91 ld r22, X+ 2b57a: 7d 91 ld r23, X+ 2b57c: 8d 91 ld r24, X+ 2b57e: 9c 91 ld r25, X 2b580: 17 97 sbiw r26, 0x07 ; 7 2b582: 62 50 subi r22, 0x02 ; 2 2b584: 71 09 sbc r23, r1 2b586: 81 09 sbc r24, r1 2b588: 91 09 sbc r25, r1 2b58a: 25 85 ldd r18, Z+13 ; 0x0d 2b58c: 04 c0 rjmp .+8 ; 0x2b596 2b58e: 66 0f add r22, r22 2b590: 77 1f adc r23, r23 2b592: 88 1f adc r24, r24 2b594: 99 1f adc r25, r25 2b596: 2a 95 dec r18 2b598: d2 f7 brpl .-12 ; 0x2b58e 2b59a: 26 85 ldd r18, Z+14 ; 0x0e 2b59c: 37 85 ldd r19, Z+15 ; 0x0f 2b59e: 40 89 ldd r20, Z+16 ; 0x10 2b5a0: 51 89 ldd r21, Z+17 ; 0x11 2b5a2: 62 0f add r22, r18 2b5a4: 73 1f adc r23, r19 2b5a6: 84 1f adc r24, r20 2b5a8: 95 1f adc r25, r21 2b5aa: 61 0f add r22, r17 2b5ac: 71 1d adc r23, r1 2b5ae: 81 1d adc r24, r1 2b5b0: 91 1d adc r25, r1 2b5b2: 9d cf rjmp .-198 ; 0x2b4ee if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2b5b4: ab 81 ldd r26, Y+3 ; 0x03 2b5b6: bc 81 ldd r27, Y+4 ; 0x04 2b5b8: 14 96 adiw r26, 0x04 ; 4 2b5ba: 4d 91 ld r20, X+ 2b5bc: 5d 91 ld r21, X+ 2b5be: 6d 91 ld r22, X+ 2b5c0: 7c 91 ld r23, X 2b5c2: 17 97 sbiw r26, 0x07 ; 7 2b5c4: 29 81 ldd r18, Y+1 ; 0x01 2b5c6: 3a 81 ldd r19, Y+2 ; 0x02 2b5c8: 0f 94 17 56 call 0x2ac2e ; 0x2ac2e 2b5cc: 81 11 cpse r24, r1 2b5ce: cd cf rjmp .-102 ; 0x2b56a 2b5d0: 24 cf rjmp .-440 ; 0x2b41a 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);} 2b5d2: 94 01 movw r18, r8 2b5d4: ab 01 movw r20, r22 2b5d6: bc 01 movw r22, r24 2b5d8: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2b5dc: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2b5e0: 0f 94 8f 54 call 0x2a91e ; 0x2a91e // 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; 2b5e4: 88 23 and r24, r24 2b5e6: 09 f4 brne .+2 ; 0x2b5ea 2b5e8: 18 cf rjmp .-464 ; 0x2b41a // 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; 2b5ea: 80 0e add r8, r16 2b5ec: 91 1e adc r9, r17 curPosition_ += n; 2b5ee: eb 81 ldd r30, Y+3 ; 0x03 2b5f0: fc 81 ldd r31, Y+4 ; 0x04 2b5f2: 80 85 ldd r24, Z+8 ; 0x08 2b5f4: 91 85 ldd r25, Z+9 ; 0x09 2b5f6: a2 85 ldd r26, Z+10 ; 0x0a 2b5f8: b3 85 ldd r27, Z+11 ; 0x0b 2b5fa: 80 0f add r24, r16 2b5fc: 91 1f adc r25, r17 2b5fe: a1 1d adc r26, r1 2b600: b1 1d adc r27, r1 2b602: 80 87 std Z+8, r24 ; 0x08 2b604: 91 87 std Z+9, r25 ; 0x09 2b606: a2 87 std Z+10, r26 ; 0x0a 2b608: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 2b60a: c0 1a sub r12, r16 2b60c: d1 0a sbc r13, r17 2b60e: 45 cf rjmp .-374 ; 0x2b49a } return nbyte; 2b610: c7 01 movw r24, r14 2b612: 05 cf rjmp .-502 ; 0x2b41e 0002b614 : * 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) { 2b614: df 92 push r13 2b616: ef 92 push r14 2b618: ff 92 push r15 2b61a: 0f 93 push r16 2b61c: 1f 93 push r17 2b61e: cf 93 push r28 2b620: df 93 push r29 2b622: 8c 01 movw r16, r24 2b624: eb 01 movw r28, r22 2b626: 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; 2b628: 8d e0 ldi r24, 0x0D ; 13 2b62a: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2b62c: 40 e2 ldi r20, 0x20 ; 32 2b62e: 50 e0 ldi r21, 0x00 ; 0 2b630: be 01 movw r22, r28 2b632: c8 01 movw r24, r16 2b634: 0f 94 ee 59 call 0x2b3dc ; 0x2b3dc if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2b638: 80 32 cpi r24, 0x20 ; 32 2b63a: 91 05 cpc r25, r1 2b63c: 71 f0 breq .+28 ; 0x2b65a 2b63e: 21 e0 ldi r18, 0x01 ; 1 2b640: 89 2b or r24, r25 2b642: 09 f4 brne .+2 ; 0x2b646 2b644: 20 e0 ldi r18, 0x00 ; 0 2b646: 82 2f mov r24, r18 2b648: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2b64a: df 91 pop r29 2b64c: cf 91 pop r28 2b64e: 1f 91 pop r17 2b650: 0f 91 pop r16 2b652: ff 90 pop r15 2b654: ef 90 pop r14 2b656: df 90 pop r13 2b658: 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; 2b65a: 28 81 ld r18, Y 2b65c: 22 23 and r18, r18 2b65e: 09 f4 brne .+2 ; 0x2b662 2b660: 3f c0 rjmp .+126 ; 0x2b6e0 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2b662: 25 3e cpi r18, 0xE5 ; 229 2b664: 19 f3 breq .-58 ; 0x2b62c 2b666: 2e 32 cpi r18, 0x2E ; 46 2b668: 09 f3 breq .-62 ; 0x2b62c //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) 2b66a: 3b 85 ldd r19, Y+11 ; 0x0b 2b66c: 3f 73 andi r19, 0x3F ; 63 2b66e: 3f 30 cpi r19, 0x0F ; 15 2b670: 99 f5 brne .+102 ; 0x2b6d8 2b672: e1 14 cp r14, r1 2b674: f1 04 cpc r15, r1 2b676: 81 f1 breq .+96 ; 0x2b6d8 { 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) 2b678: 4a 8d ldd r20, Y+26 ; 0x1a 2b67a: 5b 8d ldd r21, Y+27 ; 0x1b 2b67c: 45 2b or r20, r21 2b67e: 61 f5 brne .+88 ; 0x2b6d8 2b680: 2f 71 andi r18, 0x1F ; 31 2b682: 3f ef ldi r19, 0xFF ; 255 2b684: 32 0f add r19, r18 2b686: 34 30 cpi r19, 0x04 ; 4 2b688: 38 f5 brcc .+78 ; 0x2b6d8 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2b68a: 21 50 subi r18, 0x01 ; 1 2b68c: 33 0b sbc r19, r19 2b68e: d2 9e mul r13, r18 2b690: c0 01 movw r24, r0 2b692: d3 9e mul r13, r19 2b694: 90 0d add r25, r0 2b696: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2b698: f7 01 movw r30, r14 2b69a: e8 0f add r30, r24 2b69c: f9 1f adc r31, r25 2b69e: 29 81 ldd r18, Y+1 ; 0x01 2b6a0: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2b6a2: 2b 81 ldd r18, Y+3 ; 0x03 2b6a4: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2b6a6: 2d 81 ldd r18, Y+5 ; 0x05 2b6a8: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2b6aa: 2f 81 ldd r18, Y+7 ; 0x07 2b6ac: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2b6ae: 29 85 ldd r18, Y+9 ; 0x09 2b6b0: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2b6b2: 2e 85 ldd r18, Y+14 ; 0x0e 2b6b4: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2b6b6: 28 89 ldd r18, Y+16 ; 0x10 2b6b8: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2b6ba: 2a 89 ldd r18, Y+18 ; 0x12 2b6bc: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2b6be: 2c 89 ldd r18, Y+20 ; 0x14 2b6c0: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2b6c2: 2e 89 ldd r18, Y+22 ; 0x16 2b6c4: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2b6c6: 28 8d ldd r18, Y+24 ; 0x18 2b6c8: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2b6ca: 2c 8d ldd r18, Y+28 ; 0x1c 2b6cc: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2b6ce: 2e 8d ldd r18, Y+30 ; 0x1e 2b6d0: 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) 2b6d2: 28 81 ld r18, Y 2b6d4: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2b6d6: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2b6d8: 2b 85 ldd r18, Y+11 ; 0x0b 2b6da: 23 fd sbrc r18, 3 2b6dc: a7 cf rjmp .-178 ; 0x2b62c 2b6de: b5 cf rjmp .-150 ; 0x2b64a 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; 2b6e0: 80 e0 ldi r24, 0x00 ; 0 2b6e2: b3 cf rjmp .-154 ; 0x2b64a 0002b6e4 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2b6e4: 4f 92 push r4 2b6e6: 5f 92 push r5 2b6e8: 6f 92 push r6 2b6ea: 7f 92 push r7 2b6ec: af 92 push r10 2b6ee: bf 92 push r11 2b6f0: cf 92 push r12 2b6f2: df 92 push r13 2b6f4: ef 92 push r14 2b6f6: ff 92 push r15 2b6f8: 0f 93 push r16 2b6fa: 1f 93 push r17 2b6fc: cf 93 push r28 2b6fe: df 93 push r29 2b700: 1f 92 push r1 2b702: cd b7 in r28, 0x3d ; 61 2b704: de b7 in r29, 0x3e ; 62 2b706: 8c 01 movw r16, r24 2b708: 7b 01 movw r14, r22 2b70a: 5a 01 movw r10, r20 2b70c: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 2b70e: db 01 movw r26, r22 2b710: 59 96 adiw r26, 0x19 ; 25 2b712: 8d 91 ld r24, X+ 2b714: 9c 91 ld r25, X 2b716: f8 01 movw r30, r16 2b718: 92 8f std Z+26, r25 ; 0x1a 2b71a: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 2b71c: cb 01 movw r24, r22 2b71e: 0e 94 ac 76 call 0xed58 ; 0xed58 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 2b722: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 2b724: f7 01 movw r30, r14 2b726: 80 85 ldd r24, Z+8 ; 0x08 2b728: 91 85 ldd r25, Z+9 ; 0x09 2b72a: a2 85 ldd r26, Z+10 ; 0x0a 2b72c: b3 85 ldd r27, Z+11 ; 0x0b 2b72e: 41 89 ldd r20, Z+17 ; 0x11 2b730: 52 89 ldd r21, Z+18 ; 0x12 2b732: 63 89 ldd r22, Z+19 ; 0x13 2b734: 74 89 ldd r23, Z+20 ; 0x14 2b736: 84 17 cp r24, r20 2b738: 95 07 cpc r25, r21 2b73a: a6 07 cpc r26, r22 2b73c: b7 07 cpc r27, r23 2b73e: 08 f0 brcs .+2 ; 0x2b742 2b740: 52 c0 rjmp .+164 ; 0x2b7e6 index = 0XF & (dirFile->curPosition_ >> 5); 2b742: 55 e0 ldi r21, 0x05 ; 5 2b744: b6 95 lsr r27 2b746: a7 95 ror r26 2b748: 97 95 ror r25 2b74a: 87 95 ror r24 2b74c: 5a 95 dec r21 2b74e: d1 f7 brne .-12 ; 0x2b744 2b750: f8 2f mov r31, r24 2b752: ff 70 andi r31, 0x0F ; 15 2b754: 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; 2b756: d7 01 movw r26, r14 2b758: 13 96 adiw r26, 0x03 ; 3 2b75a: 8c 91 ld r24, X 2b75c: 82 30 cpi r24, 0x02 ; 2 2b75e: 10 f4 brcc .+4 ; 0x2b764 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 2b760: 80 e0 ldi r24, 0x00 ; 0 2b762: db c0 rjmp .+438 ; 0x2b91a * \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; 2b764: 41 e0 ldi r20, 0x01 ; 1 2b766: 50 e0 ldi r21, 0x00 ; 0 2b768: be 01 movw r22, r28 2b76a: 6f 5f subi r22, 0xFF ; 255 2b76c: 7f 4f sbci r23, 0xFF ; 255 2b76e: c7 01 movw r24, r14 2b770: 0f 94 ee 59 call 0x2b3dc ; 0x2b3dc 2b774: 01 97 sbiw r24, 0x01 ; 1 2b776: a1 f7 brne .-24 ; 0x2b760 // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 2b778: f7 01 movw r30, r14 2b77a: 80 85 ldd r24, Z+8 ; 0x08 2b77c: 91 85 ldd r25, Z+9 ; 0x09 2b77e: a2 85 ldd r26, Z+10 ; 0x0a 2b780: b3 85 ldd r27, Z+11 ; 0x0b 2b782: 4f 96 adiw r24, 0x1f ; 31 2b784: a1 1d adc r26, r1 2b786: b1 1d adc r27, r1 2b788: 80 87 std Z+8, r24 ; 0x08 2b78a: 91 87 std Z+9, r25 ; 0x09 2b78c: a2 87 std Z+10, r26 ; 0x0a 2b78e: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 2b790: f0 e2 ldi r31, 0x20 ; 32 2b792: df 9e mul r13, r31 2b794: b0 01 movw r22, r0 2b796: 11 24 eor r1, r1 2b798: 63 56 subi r22, 0x63 ; 99 2b79a: 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; 2b79c: 61 15 cp r22, r1 2b79e: 71 05 cpc r23, r1 2b7a0: f9 f2 breq .-66 ; 0x2b760 if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 2b7a2: db 01 movw r26, r22 2b7a4: 8c 91 ld r24, X 2b7a6: 88 23 and r24, r24 2b7a8: 41 f0 breq .+16 ; 0x2b7ba 2b7aa: 85 3e cpi r24, 0xE5 ; 229 2b7ac: 09 f0 breq .+2 ; 0x2b7b0 2b7ae: 4c c0 rjmp .+152 ; 0x2b848 // remember first empty slot if (!emptyFound) { 2b7b0: 77 20 and r7, r7 2b7b2: 29 f0 breq .+10 ; 0x2b7be return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2b7b4: 77 24 eor r7, r7 2b7b6: 73 94 inc r7 2b7b8: b5 cf rjmp .-150 ; 0x2b724 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) { 2b7ba: 71 10 cpse r7, r1 2b7bc: 0e c0 rjmp .+28 ; 0x2b7da dirBlock_ = dirFile->vol_->cacheBlockNumber(); 2b7be: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 2b7c2: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 2b7c6: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 2b7ca: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 2b7ce: f8 01 movw r30, r16 2b7d0: 84 87 std Z+12, r24 ; 0x0c 2b7d2: 95 87 std Z+13, r25 ; 0x0d 2b7d4: a6 87 std Z+14, r26 ; 0x0e 2b7d6: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 2b7d8: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 2b7da: db 01 movw r26, r22 2b7dc: 8c 91 ld r24, X 2b7de: 81 11 cpse r24, r1 2b7e0: e9 cf rjmp .-46 ; 0x2b7b4 2b7e2: 77 24 eor r7, r7 2b7e4: 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; 2b7e6: 8c 2d mov r24, r12 2b7e8: 82 74 andi r24, 0x42 ; 66 2b7ea: 82 34 cpi r24, 0x42 ; 66 2b7ec: 09 f0 breq .+2 ; 0x2b7f0 2b7ee: b8 cf rjmp .-144 ; 0x2b760 if (emptyFound) { 2b7f0: 77 20 and r7, r7 2b7f2: 09 f4 brne .+2 ; 0x2b7f6 2b7f4: a2 c0 rjmp .+324 ; 0x2b93a index = dirIndex_; 2b7f6: f8 01 movw r30, r16 2b7f8: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2b7fa: 61 e0 ldi r22, 0x01 ; 1 2b7fc: c8 01 movw r24, r16 2b7fe: 0f 94 5c 59 call 0x2b2b8 ; 0x2b2b8 if (!p) goto fail; 2b802: 00 97 sbiw r24, 0x00 ; 0 2b804: 09 f4 brne .+2 ; 0x2b808 2b806: ac cf rjmp .-168 ; 0x2b760 // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 2b808: 20 e2 ldi r18, 0x20 ; 32 2b80a: dc 01 movw r26, r24 2b80c: 1d 92 st X+, r1 2b80e: 2a 95 dec r18 2b810: e9 f7 brne .-6 ; 0x2b80c memcpy(p->name, dname, 11); 2b812: 2b e0 ldi r18, 0x0B ; 11 2b814: f5 01 movw r30, r10 2b816: dc 01 movw r26, r24 2b818: 01 90 ld r0, Z+ 2b81a: 0d 92 st X+, r0 2b81c: 2a 95 dec r18 2b81e: e1 f7 brne .-8 ; 0x2b818 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 2b820: 21 e2 ldi r18, 0x21 ; 33 2b822: 38 e2 ldi r19, 0x28 ; 40 2b824: fc 01 movw r30, r24 2b826: 31 8b std Z+17, r19 ; 0x11 2b828: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 2b82a: 40 e0 ldi r20, 0x00 ; 0 2b82c: 58 e0 ldi r21, 0x08 ; 8 2b82e: 57 87 std Z+15, r21 ; 0x0f 2b830: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 2b832: 33 8b std Z+19, r19 ; 0x13 2b834: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 2b836: 31 8f std Z+25, r19 ; 0x19 2b838: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 2b83a: 57 8b std Z+23, r21 ; 0x17 2b83c: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 2b83e: 0f 94 50 54 call 0x2a8a0 ; 0x2a8a0 2b842: 81 11 cpse r24, r1 2b844: 09 c0 rjmp .+18 ; 0x2b858 2b846: 8c cf rjmp .-232 ; 0x2b760 dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 2b848: 4b e0 ldi r20, 0x0B ; 11 2b84a: 50 e0 ldi r21, 0x00 ; 0 2b84c: c5 01 movw r24, r10 2b84e: 0f 94 70 e2 call 0x3c4e0 ; 0x3c4e0 2b852: 89 2b or r24, r25 2b854: 09 f0 breq .+2 ; 0x2b858 2b856: 66 cf rjmp .-308 ; 0x2b724 } //------------------------------------------------------------------------------ // 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]; 2b858: f0 e2 ldi r31, 0x20 ; 32 2b85a: df 9e mul r13, r31 2b85c: d0 01 movw r26, r0 2b85e: 11 24 eor r1, r1 2b860: 9d 01 movw r18, r26 2b862: 23 56 subi r18, 0x63 ; 99 2b864: 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)) { 2b866: f9 01 movw r30, r18 2b868: 83 85 ldd r24, Z+11 ; 0x0b 2b86a: 81 71 andi r24, 0x11 ; 17 2b86c: 21 f0 breq .+8 ; 0x2b876 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 2b86e: 8c 2d mov r24, r12 2b870: 82 71 andi r24, 0x12 ; 18 2b872: 09 f0 breq .+2 ; 0x2b876 2b874: fc c0 rjmp .+504 ; 0x2ba6e } //------------------------------------------------------------------------------ // 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]; 2b876: f8 01 movw r30, r16 2b878: 81 8d ldd r24, Z+25 ; 0x19 2b87a: 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(); 2b87c: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2b880: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2b884: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2b888: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2b88c: 44 87 std Z+12, r20 ; 0x0c 2b88e: 55 87 std Z+13, r21 ; 0x0d 2b890: 66 87 std Z+14, r22 ; 0x0e 2b892: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 2b894: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 2b896: fd 01 movw r30, r26 2b898: e3 56 subi r30, 0x63 ; 99 2b89a: f1 4f sbci r31, 0xF1 ; 241 2b89c: 44 88 ldd r4, Z+20 ; 0x14 2b89e: 55 88 ldd r5, Z+21 ; 0x15 2b8a0: 71 2c mov r7, r1 2b8a2: 61 2c mov r6, r1 2b8a4: 32 01 movw r6, r4 2b8a6: 55 24 eor r5, r5 2b8a8: 44 24 eor r4, r4 2b8aa: d8 01 movw r26, r16 2b8ac: 55 96 adiw r26, 0x15 ; 21 2b8ae: 4d 92 st X+, r4 2b8b0: 5d 92 st X+, r5 2b8b2: 6d 92 st X+, r6 2b8b4: 7c 92 st X, r7 2b8b6: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 2b8b8: 42 8d ldd r20, Z+26 ; 0x1a 2b8ba: 53 8d ldd r21, Z+27 ; 0x1b 2b8bc: 70 e0 ldi r23, 0x00 ; 0 2b8be: 60 e0 ldi r22, 0x00 ; 0 2b8c0: 44 29 or r20, r4 2b8c2: 55 29 or r21, r5 2b8c4: 66 29 or r22, r6 2b8c6: 77 29 or r23, r7 2b8c8: 55 96 adiw r26, 0x15 ; 21 2b8ca: 4d 93 st X+, r20 2b8cc: 5d 93 st X+, r21 2b8ce: 6d 93 st X+, r22 2b8d0: 7c 93 st X, r23 2b8d2: 58 97 sbiw r26, 0x18 ; 24 2b8d4: d9 01 movw r26, r18 2b8d6: 1b 96 adiw r26, 0x0b ; 11 2b8d8: 2c 91 ld r18, X 2b8da: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 2b8dc: 09 f0 breq .+2 ; 0x2b8e0 2b8de: b9 c0 rjmp .+370 ; 0x2ba52 fileSize_ = p->fileSize; 2b8e0: 84 8d ldd r24, Z+28 ; 0x1c 2b8e2: 95 8d ldd r25, Z+29 ; 0x1d 2b8e4: a6 8d ldd r26, Z+30 ; 0x1e 2b8e6: b7 8d ldd r27, Z+31 ; 0x1f 2b8e8: f8 01 movw r30, r16 2b8ea: 81 8b std Z+17, r24 ; 0x11 2b8ec: 92 8b std Z+18, r25 ; 0x12 2b8ee: a3 8b std Z+19, r26 ; 0x13 2b8f0: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 2b8f2: 81 e0 ldi r24, 0x01 ; 1 2b8f4: 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; 2b8f6: 8c 2d mov r24, r12 2b8f8: 8f 70 andi r24, 0x0F ; 15 2b8fa: f8 01 movw r30, r16 2b8fc: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2b8fe: 14 82 std Z+4, r1 ; 0x04 2b900: 15 82 std Z+5, r1 ; 0x05 2b902: 16 82 std Z+6, r1 ; 0x06 2b904: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 2b906: 10 86 std Z+8, r1 ; 0x08 2b908: 11 86 std Z+9, r1 ; 0x09 2b90a: 12 86 std Z+10, r1 ; 0x0a 2b90c: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 2b90e: 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; 2b910: c4 fe sbrs r12, 4 2b912: 03 c0 rjmp .+6 ; 0x2b91a 2b914: c8 01 movw r24, r16 2b916: 0f 94 b8 77 call 0x2ef70 ; 0x2ef70 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 2b91a: 0f 90 pop r0 2b91c: df 91 pop r29 2b91e: cf 91 pop r28 2b920: 1f 91 pop r17 2b922: 0f 91 pop r16 2b924: ff 90 pop r15 2b926: ef 90 pop r14 2b928: df 90 pop r13 2b92a: cf 90 pop r12 2b92c: bf 90 pop r11 2b92e: af 90 pop r10 2b930: 7f 90 pop r7 2b932: 6f 90 pop r6 2b934: 5f 90 pop r5 2b936: 4f 90 pop r4 2b938: 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; 2b93a: d7 01 movw r26, r14 2b93c: 13 96 adiw r26, 0x03 ; 3 2b93e: 8c 91 ld r24, X 2b940: 13 97 sbiw r26, 0x03 ; 3 2b942: 82 30 cpi r24, 0x02 ; 2 2b944: 09 f4 brne .+2 ; 0x2b948 2b946: 0c cf rjmp .-488 ; 0x2b760 // 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; 2b948: 51 96 adiw r26, 0x11 ; 17 2b94a: 8d 91 ld r24, X+ 2b94c: 9d 91 ld r25, X+ 2b94e: 0d 90 ld r0, X+ 2b950: bc 91 ld r27, X 2b952: a0 2d mov r26, r0 2b954: 80 3e cpi r24, 0xE0 ; 224 2b956: 9f 4f sbci r25, 0xFF ; 255 2b958: af 41 sbci r26, 0x1F ; 31 2b95a: b1 05 cpc r27, r1 2b95c: 08 f0 brcs .+2 ; 0x2b960 2b95e: 00 cf rjmp .-512 ; 0x2b760 if (!addCluster()) goto fail; 2b960: c7 01 movw r24, r14 2b962: 0f 94 61 58 call 0x2b0c2 ; 0x2b0c2 2b966: 88 23 and r24, r24 2b968: 09 f4 brne .+2 ; 0x2b96c 2b96a: fa ce rjmp .-524 ; 0x2b760 if (!vol_->cacheFlush()) goto fail; 2b96c: 0f 94 50 54 call 0x2a8a0 ; 0x2a8a0 2b970: 88 23 and r24, r24 2b972: 09 f4 brne .+2 ; 0x2b976 2b974: f5 ce rjmp .-534 ; 0x2b760 block = vol_->clusterStartBlock(curCluster_); 2b976: d7 01 movw r26, r14 2b978: 59 96 adiw r26, 0x19 ; 25 2b97a: ed 91 ld r30, X+ 2b97c: fc 91 ld r31, X 2b97e: 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_);} 2b980: 14 96 adiw r26, 0x04 ; 4 2b982: 4d 90 ld r4, X+ 2b984: 5d 90 ld r5, X+ 2b986: 6d 90 ld r6, X+ 2b988: 7c 90 ld r7, X 2b98a: 17 97 sbiw r26, 0x07 ; 7 2b98c: b2 e0 ldi r27, 0x02 ; 2 2b98e: 4b 1a sub r4, r27 2b990: 51 08 sbc r5, r1 2b992: 61 08 sbc r6, r1 2b994: 71 08 sbc r7, r1 2b996: 85 85 ldd r24, Z+13 ; 0x0d 2b998: 04 c0 rjmp .+8 ; 0x2b9a2 2b99a: 44 0c add r4, r4 2b99c: 55 1c adc r5, r5 2b99e: 66 1c adc r6, r6 2b9a0: 77 1c adc r7, r7 2b9a2: 8a 95 dec r24 2b9a4: d2 f7 brpl .-12 ; 0x2b99a 2b9a6: 86 85 ldd r24, Z+14 ; 0x0e 2b9a8: 97 85 ldd r25, Z+15 ; 0x0f 2b9aa: a0 89 ldd r26, Z+16 ; 0x10 2b9ac: b1 89 ldd r27, Z+17 ; 0x11 2b9ae: 48 0e add r4, r24 2b9b0: 59 1e adc r5, r25 2b9b2: 6a 1e adc r6, r26 2b9b4: 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; 2b9b6: 81 e0 ldi r24, 0x01 ; 1 2b9b8: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 cacheBlockNumber_ = blockNumber; 2b9bc: 40 92 91 0e sts 0x0E91, r4 ; 0x800e91 2b9c0: 50 92 92 0e sts 0x0E92, r5 ; 0x800e92 2b9c4: 60 92 93 0e sts 0x0E93, r6 ; 0x800e93 2b9c8: 70 92 94 0e sts 0x0E94, r7 ; 0x800e94 // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 2b9cc: ed e9 ldi r30, 0x9D ; 157 2b9ce: fe e0 ldi r31, 0x0E ; 14 2b9d0: 80 e0 ldi r24, 0x00 ; 0 2b9d2: 92 e0 ldi r25, 0x02 ; 2 2b9d4: df 01 movw r26, r30 2b9d6: 9c 01 movw r18, r24 2b9d8: 1d 92 st X+, r1 2b9da: 21 50 subi r18, 0x01 ; 1 2b9dc: 30 40 sbci r19, 0x00 ; 0 2b9de: e1 f7 brne .-8 ; 0x2b9d8 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2b9e0: dd 24 eor r13, r13 2b9e2: d3 94 inc r13 2b9e4: d7 01 movw r26, r14 2b9e6: 59 96 adiw r26, 0x19 ; 25 2b9e8: ed 91 ld r30, X+ 2b9ea: fc 91 ld r31, X 2b9ec: 84 81 ldd r24, Z+4 ; 0x04 2b9ee: d8 16 cp r13, r24 2b9f0: 98 f4 brcc .+38 ; 0x2ba18 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); 2b9f2: 2d e9 ldi r18, 0x9D ; 157 2b9f4: 3e e0 ldi r19, 0x0E ; 14 2b9f6: b3 01 movw r22, r6 2b9f8: a2 01 movw r20, r4 2b9fa: 4d 0d add r20, r13 2b9fc: 51 1d adc r21, r1 2b9fe: 61 1d adc r22, r1 2ba00: 71 1d adc r23, r1 2ba02: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2ba06: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2ba0a: 0f 94 ec 53 call 0x2a7d8 ; 0x2a7d8 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 2ba0e: 88 23 and r24, r24 2ba10: 09 f4 brne .+2 ; 0x2ba14 2ba12: a6 ce rjmp .-692 ; 0x2b760 // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2ba14: d3 94 inc r13 2ba16: e6 cf rjmp .-52 ; 0x2b9e4 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 2ba18: 25 85 ldd r18, Z+13 ; 0x0d 2ba1a: 80 e0 ldi r24, 0x00 ; 0 2ba1c: 92 e0 ldi r25, 0x02 ; 2 2ba1e: a0 e0 ldi r26, 0x00 ; 0 2ba20: b0 e0 ldi r27, 0x00 ; 0 2ba22: 04 c0 rjmp .+8 ; 0x2ba2c 2ba24: 88 0f add r24, r24 2ba26: 99 1f adc r25, r25 2ba28: aa 1f adc r26, r26 2ba2a: bb 1f adc r27, r27 2ba2c: 2a 95 dec r18 2ba2e: d2 f7 brpl .-12 ; 0x2ba24 2ba30: f7 01 movw r30, r14 2ba32: 41 89 ldd r20, Z+17 ; 0x11 2ba34: 52 89 ldd r21, Z+18 ; 0x12 2ba36: 63 89 ldd r22, Z+19 ; 0x13 2ba38: 74 89 ldd r23, Z+20 ; 0x14 2ba3a: 84 0f add r24, r20 2ba3c: 95 1f adc r25, r21 2ba3e: a6 1f adc r26, r22 2ba40: b7 1f adc r27, r23 2ba42: 81 8b std Z+17, r24 ; 0x11 2ba44: 92 8b std Z+18, r25 ; 0x12 2ba46: a3 8b std Z+19, r26 ; 0x13 2ba48: 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; 2ba4a: 8d e9 ldi r24, 0x9D ; 157 2ba4c: 9e e0 ldi r25, 0x0E ; 14 index = 0; 2ba4e: d1 2c mov r13, r1 2ba50: db ce rjmp .-586 ; 0x2b808 // 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)) { 2ba52: 20 31 cpi r18, 0x10 ; 16 2ba54: 61 f4 brne .+24 ; 0x2ba6e if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 2ba56: 98 01 movw r18, r16 2ba58: 2f 5e subi r18, 0xEF ; 239 2ba5a: 3f 4f sbci r19, 0xFF ; 255 2ba5c: 0f 94 9a 56 call 0x2ad34 ; 0x2ad34 2ba60: 88 23 and r24, r24 2ba62: 29 f0 breq .+10 ; 0x2ba6e type_ = FAT_FILE_TYPE_SUBDIR; 2ba64: 84 e0 ldi r24, 0x04 ; 4 2ba66: d8 01 movw r26, r16 2ba68: 13 96 adiw r26, 0x03 ; 3 2ba6a: 8c 93 st X, r24 2ba6c: 44 cf rjmp .-376 ; 0x2b8f6 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 2ba6e: d8 01 movw r26, r16 2ba70: 13 96 adiw r26, 0x03 ; 3 2ba72: 1c 92 st X, r1 2ba74: 75 ce rjmp .-790 ; 0x2b760 0002ba76 : // version of uvlo_() which doesn't overwrite the print state already waiting in EEPROM uvlo_tiny(); } } void recover_print(uint8_t automatic) { 2ba76: 4f 92 push r4 2ba78: 5f 92 push r5 2ba7a: 6f 92 push r6 2ba7c: 7f 92 push r7 2ba7e: 8f 92 push r8 2ba80: 9f 92 push r9 2ba82: af 92 push r10 2ba84: bf 92 push r11 2ba86: cf 92 push r12 2ba88: df 92 push r13 2ba8a: ef 92 push r14 2ba8c: ff 92 push r15 2ba8e: 0f 93 push r16 2ba90: 1f 93 push r17 2ba92: cf 93 push r28 2ba94: df 93 push r29 2ba96: 1f 92 push r1 2ba98: 1f 92 push r1 2ba9a: cd b7 in r28, 0x3d ; 61 2ba9c: de b7 in r29, 0x3e ; 62 2ba9e: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 2baa0: 89 ed ldi r24, 0xD9 ; 217 2baa2: 9c e4 ldi r25, 0x4C ; 76 2baa4: 0e 94 2c 72 call 0xe458 ; 0xe458 2baa8: 0e 94 3b f2 call 0x1e476 ; 0x1e476 gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 2baac: 10 92 92 06 sts 0x0692, r1 ; 0x800692 2bab0: 10 92 93 06 sts 0x0693, r1 ; 0x800693 2bab4: 10 92 94 06 sts 0x0694, r1 ; 0x800694 2bab8: 10 92 95 06 sts 0x0695, r1 ; 0x800695 current_position[Y_AXIS] = 0; 2babc: 10 92 96 06 sts 0x0696, r1 ; 0x800696 2bac0: 10 92 97 06 sts 0x0697, r1 ; 0x800697 2bac4: 10 92 98 06 sts 0x0698, r1 ; 0x800698 2bac8: 10 92 99 06 sts 0x0699, r1 ; 0x800699 2bacc: 9e ea ldi r25, 0xAE ; 174 2bace: e9 2e mov r14, r25 2bad0: 9d e0 ldi r25, 0x0D ; 13 2bad2: 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; 2bad4: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 2bad6: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 2bad8: 27 e0 ldi r18, 0x07 ; 7 2bada: b2 2e mov r11, r18 2badc: 8c 2d mov r24, r12 2bade: 6b 2d mov r22, r11 2bae0: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e <__divmodqi4> 2bae4: 08 2f mov r16, r24 2bae6: 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); 2bae8: 42 e0 ldi r20, 0x02 ; 2 2baea: 50 e0 ldi r21, 0x00 ; 0 2baec: b7 01 movw r22, r14 2baee: ce 01 movw r24, r28 2baf0: 01 96 adiw r24, 0x01 ; 1 2baf2: 0f 94 44 dc call 0x3b888 ; 0x3b888 if (v != 0) 2baf6: 69 81 ldd r22, Y+1 ; 0x01 2baf8: 7a 81 ldd r23, Y+2 ; 0x02 2bafa: 61 15 cp r22, r1 2bafc: 71 05 cpc r23, r1 2bafe: 11 f0 breq .+4 ; 0x2bb04 mbl_was_active = true; 2bb00: dd 24 eor r13, r13 2bb02: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 2bb04: 2b 2d mov r18, r11 2bb06: 02 03 mulsu r16, r18 2bb08: 80 01 movw r16, r0 2bb0a: 11 24 eor r1, r1 2bb0c: 09 0d add r16, r9 2bb0e: 11 1d adc r17, r1 2bb10: 97 fc sbrc r9, 7 2bb12: 1a 95 dec r17 2bb14: 00 0f add r16, r16 2bb16: 11 1f adc r17, r17 2bb18: 00 0f add r16, r16 2bb1a: 11 1f adc r17, r17 2bb1c: 0e 53 subi r16, 0x3E ; 62 2bb1e: 1c 4e sbci r17, 0xEC ; 236 2bb20: 07 2e mov r0, r23 2bb22: 00 0c add r0, r0 2bb24: 88 0b sbc r24, r24 2bb26: 99 0b sbc r25, r25 2bb28: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2bb2c: 2f e6 ldi r18, 0x6F ; 111 2bb2e: 32 e1 ldi r19, 0x12 ; 18 2bb30: 43 e8 ldi r20, 0x83 ; 131 2bb32: 5a e3 ldi r21, 0x3A ; 58 2bb34: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2bb38: f8 01 movw r30, r16 2bb3a: 61 83 std Z+1, r22 ; 0x01 2bb3c: 72 83 std Z+2, r23 ; 0x02 2bb3e: 83 83 std Z+3, r24 ; 0x03 2bb40: 94 83 std Z+4, r25 ; 0x04 2bb42: f2 e0 ldi r31, 0x02 ; 2 2bb44: ef 0e add r14, r31 2bb46: f1 1c adc r15, r1 2bb48: 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) { 2bb4a: 21 e3 ldi r18, 0x31 ; 49 2bb4c: c2 12 cpse r12, r18 2bb4e: c6 cf rjmp .-116 ; 0x2badc 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)); 2bb50: 8a ed ldi r24, 0xDA ; 218 2bb52: 9e e0 ldi r25, 0x0E ; 14 2bb54: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bb58: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2bb5c: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2bb60: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2bb64: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d // Recover last E axis position current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 2bb68: 8e e6 ldi r24, 0x6E ; 110 2bb6a: 9f e0 ldi r25, 0x0F ; 15 2bb6c: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bb70: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 2bb74: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 2bb78: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 2bb7c: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 2bb80: 0f 94 d3 ce call 0x39da6 ; 0x39da6 // 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(); 2bb84: 0f 94 bd c9 call 0x3937a ; 0x3937a // 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); 2bb88: 82 e9 ldi r24, 0x92 ; 146 2bb8a: 96 e0 ldi r25, 0x06 ; 6 2bb8c: 0e 94 49 6b call 0xd692 ; 0xd692 set_destination_to_current(); 2bb90: 0e 94 ba 67 call 0xcf74 ; 0xcf74 plan_set_position_curposXYZE(); 2bb94: 0f 94 41 bf call 0x37e82 ; 0x37e82 SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 2bb98: 8d e4 ldi r24, 0x4D ; 77 2bb9a: 9e e8 ldi r25, 0x8E ; 142 2bb9c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 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]); 2bba0: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 2bba4: 8f 93 push r24 2bba6: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2bbaa: 8f 93 push r24 2bbac: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 2bbb0: 8f 93 push r24 2bbb2: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 2bbb6: 8f 93 push r24 2bbb8: 80 91 99 06 lds r24, 0x0699 ; 0x800699 2bbbc: 8f 93 push r24 2bbbe: 80 91 98 06 lds r24, 0x0698 ; 0x800698 2bbc2: 8f 93 push r24 2bbc4: 80 91 97 06 lds r24, 0x0697 ; 0x800697 2bbc8: 8f 93 push r24 2bbca: 80 91 96 06 lds r24, 0x0696 ; 0x800696 2bbce: 8f 93 push r24 2bbd0: 80 91 95 06 lds r24, 0x0695 ; 0x800695 2bbd4: 8f 93 push r24 2bbd6: 80 91 94 06 lds r24, 0x0694 ; 0x800694 2bbda: 8f 93 push r24 2bbdc: 80 91 93 06 lds r24, 0x0693 ; 0x800693 2bbe0: 8f 93 push r24 2bbe2: 80 91 92 06 lds r24, 0x0692 ; 0x800692 2bbe6: 8f 93 push r24 2bbe8: 8b e5 ldi r24, 0x5B ; 91 2bbea: 9d e6 ldi r25, 0x6D ; 109 2bbec: 9f 93 push r25 2bbee: 8f 93 push r24 2bbf0: 0f 94 16 db call 0x3b62c ; 0x3b62c print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 2bbf4: 81 e0 ldi r24, 0x01 ; 1 2bbf6: 80 93 91 06 sts 0x0691, r24 ; 0x800691 enable_z(); 2bbfa: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 2bbfc: 88 ed ldi r24, 0xD8 ; 216 2bbfe: 9e e0 ldi r25, 0x0E ; 14 2bc00: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 2bc04: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 2bc08: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 2bc0c: 8b e8 ldi r24, 0x8B ; 139 2bc0e: 9f e0 ldi r25, 0x0F ; 15 2bc10: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2bc14: 90 e0 ldi r25, 0x00 ; 0 2bc16: 90 93 73 06 sts 0x0673, r25 ; 0x800673 2bc1a: 80 93 72 06 sts 0x0672, r24 ; 0x800672 // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 2bc1e: 88 ee ldi r24, 0xE8 ; 232 2bc20: 9e e0 ldi r25, 0x0E ; 14 2bc22: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bc26: 60 93 93 02 sts 0x0293, r22 ; 0x800293 2bc2a: 70 93 94 02 sts 0x0294, r23 ; 0x800294 2bc2e: 80 93 95 02 sts 0x0295, r24 ; 0x800295 2bc32: 90 93 96 02 sts 0x0296, r25 ; 0x800296 extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 2bc36: 8e ed ldi r24, 0xDE ; 222 2bc38: 9e e0 ldi r25, 0x0E ; 14 2bc3a: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 2bc3e: 90 93 bd 02 sts 0x02BD, r25 ; 0x8002bd 2bc42: 80 93 bc 02 sts 0x02BC, r24 ; 0x8002bc // 9) Recover the saved target eeprom_read_block(saved_start_position, (float *)EEPROM_UVLO_SAVED_START_POSITION, sizeof(saved_start_position)); 2bc46: 40 e1 ldi r20, 0x10 ; 16 2bc48: 50 e0 ldi r21, 0x00 ; 0 2bc4a: 67 e3 ldi r22, 0x37 ; 55 2bc4c: 7d e0 ldi r23, 0x0D ; 13 2bc4e: 83 e8 ldi r24, 0x83 ; 131 2bc50: 92 e0 ldi r25, 0x02 ; 2 2bc52: 0f 94 44 dc call 0x3b888 ; 0x3b888 saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 2bc56: 8c e6 ldi r24, 0x6C ; 108 2bc58: 9f e0 ldi r25, 0x0F ; 15 2bc5a: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 2bc5e: 90 93 6a 05 sts 0x056A, r25 ; 0x80056a 2bc62: 80 93 69 05 sts 0x0569, r24 ; 0x800569 #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 2bc66: 8c e2 ldi r24, 0x2C ; 44 2bc68: 9d e0 ldi r25, 0x0D ; 13 2bc6a: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bc6e: 60 93 65 05 sts 0x0565, r22 ; 0x800565 2bc72: 70 93 66 05 sts 0x0566, r23 ; 0x800566 2bc76: 80 93 67 05 sts 0x0567, r24 ; 0x800567 2bc7a: 90 93 68 05 sts 0x0568, r25 ; 0x800568 #endif #ifdef PREVENT_DANGEROUS_EXTRUDE extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP); 2bc7e: 8d e7 ldi r24, 0x7D ; 125 2bc80: 9c e0 ldi r25, 0x0C ; 12 2bc82: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 2bc86: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 2bc8a: 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)); 2bc8e: 40 e1 ldi r20, 0x10 ; 16 2bc90: 50 e0 ldi r21, 0x00 ; 0 2bc92: 6d e6 ldi r22, 0x6D ; 109 2bc94: 7c e0 ldi r23, 0x0C ; 12 2bc96: 82 ee ldi r24, 0xE2 ; 226 2bc98: 9d e0 ldi r25, 0x0D ; 13 2bc9a: 0f 94 44 dc call 0x3b888 ; 0x3b888 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)); 2bc9e: 40 e1 ldi r20, 0x10 ; 16 2bca0: 50 e0 ldi r21, 0x00 ; 0 2bca2: 6d e5 ldi r22, 0x5D ; 93 2bca4: 7c e0 ldi r23, 0x0C ; 12 2bca6: 8a e6 ldi r24, 0x6A ; 106 2bca8: 9e e0 ldi r25, 0x0E ; 14 2bcaa: 0f 94 44 dc call 0x3b888 ; 0x3b888 eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 2bcae: 40 e1 ldi r20, 0x10 ; 16 2bcb0: 50 e0 ldi r21, 0x00 ; 0 2bcb2: 6d e4 ldi r22, 0x4D ; 77 2bcb4: 7c e0 ldi r23, 0x0C ; 12 2bcb6: 82 ed ldi r24, 0xD2 ; 210 2bcb8: 9d e0 ldi r25, 0x0D ; 13 2bcba: 0f 94 44 dc call 0x3b888 ; 0x3b888 eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 2bcbe: 40 e1 ldi r20, 0x10 ; 16 2bcc0: 50 e0 ldi r21, 0x00 ; 0 2bcc2: 6d e3 ldi r22, 0x3D ; 61 2bcc4: 7c e0 ldi r23, 0x0C ; 12 2bcc6: 8a e5 ldi r24, 0x5A ; 90 2bcc8: 9e e0 ldi r25, 0x0E ; 14 2bcca: 0f 94 44 dc call 0x3b888 ; 0x3b888 cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 2bcce: 89 e3 ldi r24, 0x39 ; 57 2bcd0: 9c e0 ldi r25, 0x0C ; 12 2bcd2: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bcd6: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 2bcda: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 2bcde: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 2bce2: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 2bce6: 85 e3 ldi r24, 0x35 ; 53 2bce8: 9c e0 ldi r25, 0x0C ; 12 2bcea: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bcee: 60 93 fe 0d sts 0x0DFE, r22 ; 0x800dfe 2bcf2: 70 93 ff 0d sts 0x0DFF, r23 ; 0x800dff 2bcf6: 80 93 00 0e sts 0x0E00, r24 ; 0x800e00 2bcfa: 90 93 01 0e sts 0x0E01, r25 ; 0x800e01 cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 2bcfe: 81 e3 ldi r24, 0x31 ; 49 2bd00: 9c e0 ldi r25, 0x0C ; 12 2bd02: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bd06: 60 93 02 0e sts 0x0E02, r22 ; 0x800e02 2bd0a: 70 93 03 0e sts 0x0E03, r23 ; 0x800e03 2bd0e: 80 93 04 0e sts 0x0E04, r24 ; 0x800e04 2bd12: 90 93 05 0e sts 0x0E05, r25 ; 0x800e05 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 2bd16: 40 e1 ldi r20, 0x10 ; 16 2bd18: 50 e0 ldi r21, 0x00 ; 0 2bd1a: 61 e2 ldi r22, 0x21 ; 33 2bd1c: 7c e0 ldi r23, 0x0C ; 12 2bd1e: 86 e0 ldi r24, 0x06 ; 6 2bd20: 9e e0 ldi r25, 0x0E ; 14 2bd22: 0f 94 44 dc call 0x3b888 ; 0x3b888 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 ) { 2bd26: 8f e7 ldi r24, 0x7F ; 127 2bd28: 9c e0 ldi r25, 0x0C ; 12 2bd2a: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2bd2e: 0f b6 in r0, 0x3f ; 63 2bd30: f8 94 cli 2bd32: de bf out 0x3e, r29 ; 62 2bd34: 0f be out 0x3f, r0 ; 63 2bd36: cd bf out 0x3d, r28 ; 61 2bd38: 81 30 cpi r24, 0x01 ; 1 2bd3a: b1 f4 brne .+44 ; 0x2bd68 current_position[Z_AXIS] += Z_PAUSE_LIFT; 2bd3c: 20 e0 ldi r18, 0x00 ; 0 2bd3e: 30 e0 ldi r19, 0x00 ; 0 2bd40: 40 ea ldi r20, 0xA0 ; 160 2bd42: 51 e4 ldi r21, 0x41 ; 65 2bd44: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 2bd48: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 2bd4c: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2bd50: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 2bd54: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2bd58: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2bd5c: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2bd60: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2bd64: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } // 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) { 2bd68: 8f e7 ldi r24, 0x7F ; 127 2bd6a: 9c e0 ldi r25, 0x0C ; 12 2bd6c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2bd70: 81 11 cpse r24, r1 2bd72: 23 c0 rjmp .+70 ; 0x2bdba enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 2bd74: 20 e0 ldi r18, 0x00 ; 0 2bd76: 30 e0 ldi r19, 0x00 ; 0 2bd78: 40 ea ldi r20, 0xA0 ; 160 2bd7a: 51 e4 ldi r21, 0x41 ; 65 2bd7c: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 2bd80: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 2bd84: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2bd88: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 2bd8c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2bd90: 9f 93 push r25 2bd92: 8f 93 push r24 2bd94: 7f 93 push r23 2bd96: 6f 93 push r22 2bd98: 82 e5 ldi r24, 0x52 ; 82 2bd9a: 9f e8 ldi r25, 0x8F ; 143 2bd9c: 9f 93 push r25 2bd9e: 8f 93 push r24 2bda0: 0e 94 3e 88 call 0x1107c ; 0x1107c 2bda4: 61 e0 ldi r22, 0x01 ; 1 2bda6: 8f e7 ldi r24, 0x7F ; 127 2bda8: 9c e0 ldi r25, 0x0C ; 12 2bdaa: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 2bdae: 0f 90 pop r0 2bdb0: 0f 90 pop r0 2bdb2: 0f 90 pop r0 2bdb4: 0f 90 pop r0 2bdb6: 0f 90 pop r0 2bdb8: 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")); 2bdba: 61 e0 ldi r22, 0x01 ; 1 2bdbc: 8a e4 ldi r24, 0x4A ; 74 2bdbe: 9f e8 ldi r25, 0x8F ; 143 2bdc0: 0e 94 a0 87 call 0x10f40 ; 0x10f40 // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 2bdc4: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 2bdc8: 8f 93 push r24 2bdca: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bdce: 8f 93 push r24 2bdd0: 81 e4 ldi r24, 0x41 ; 65 2bdd2: 9f e8 ldi r25, 0x8F ; 143 2bdd4: 9f 93 push r25 2bdd6: 8f 93 push r24 2bdd8: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 2bddc: 80 91 73 06 lds r24, 0x0673 ; 0x800673 2bde0: 8f 93 push r24 2bde2: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2bde6: 8f 93 push r24 2bde8: 88 e3 ldi r24, 0x38 ; 56 2bdea: 9f e8 ldi r25, 0x8F ; 143 2bdec: 9f 93 push r25 2bdee: 8f 93 push r24 2bdf0: 0e 94 3e 88 call 0x1107c ; 0x1107c //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) { 2bdf4: 8c e8 ldi r24, 0x8C ; 140 2bdf6: 9f e0 ldi r25, 0x0F ; 15 2bdf8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2bdfc: 0f b6 in r0, 0x3f ; 63 2bdfe: f8 94 cli 2be00: de bf out 0x3e, r29 ; 62 2be02: 0f be out 0x3f, r0 ; 63 2be04: cd bf out 0x3d, r28 ; 61 2be06: 81 11 cpse r24, r1 2be08: 10 c0 rjmp .+32 ; 0x2be2a enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 2be0a: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 2be0e: 8f 93 push r24 2be10: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2be14: 8f 93 push r24 2be16: 8f e2 ldi r24, 0x2F ; 47 2be18: 9f e8 ldi r25, 0x8F ; 143 2be1a: 9f 93 push r25 2be1c: 8f 93 push r24 2be1e: 0e 94 3e 88 call 0x1107c ; 0x1107c 2be22: 0f 90 pop r0 2be24: 0f 90 pop r0 2be26: 0f 90 pop r0 2be28: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 2be2a: 61 e0 ldi r22, 0x01 ; 1 2be2c: 8c e3 ldi r24, 0x3C ; 60 2be2e: 9b e6 ldi r25, 0x6B ; 107 2be30: 0e 94 a0 87 call 0x10f40 ; 0x10f40 // If not automatically recoreverd (long power loss) if(automatic == 0){ 2be34: a1 10 cpse r10, r1 2be36: 17 c0 rjmp .+46 ; 0x2be66 //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 2be38: 61 e0 ldi r22, 0x01 ; 1 2be3a: 84 e2 ldi r24, 0x24 ; 36 2be3c: 9f e8 ldi r25, 0x8F ; 143 2be3e: 0e 94 a0 87 call 0x10f40 ; 0x10f40 // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 2be42: 8f e3 ldi r24, 0x3F ; 63 2be44: 8f 93 push r24 2be46: 80 e8 ldi r24, 0x80 ; 128 2be48: 8f 93 push r24 2be4a: 1f 92 push r1 2be4c: 1f 92 push r1 2be4e: 86 eb ldi r24, 0xB6 ; 182 2be50: 9d e6 ldi r25, 0x6D ; 109 2be52: 9f 93 push r25 2be54: 8f 93 push r24 2be56: 0e 94 3e 88 call 0x1107c ; 0x1107c 2be5a: 0f 90 pop r0 2be5c: 0f 90 pop r0 2be5e: 0f 90 pop r0 2be60: 0f 90 pop r0 2be62: 0f 90 pop r0 2be64: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 2be66: 80 ea ldi r24, 0xA0 ; 160 2be68: 9d e6 ldi r25, 0x6D ; 109 2be6a: 0f 94 3d db call 0x3b67a ; 0x3b67a gcode_M114(); 2be6e: 0e 94 c7 77 call 0xef8e ; 0xef8e 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); 2be72: 88 e8 ldi r24, 0x88 ; 136 2be74: 9f e0 ldi r25, 0x0F ; 15 2be76: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2be7a: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 2be7c: 89 e8 ldi r24, 0x89 ; 137 2be7e: 9f e0 ldi r25, 0x0F ; 15 2be80: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 2be84: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 2be86: 85 e3 ldi r24, 0x35 ; 53 2be88: 9d e0 ldi r25, 0x0D ; 13 2be8a: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 2be8e: f8 2e mov r15, r24 2be90: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 2be92: 8a e1 ldi r24, 0x1A ; 26 2be94: 9f e8 ldi r25, 0x8F ; 143 2be96: 0e 94 d0 76 call 0xeda0 ; 0xeda0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2be9a: b8 01 movw r22, r16 2be9c: 01 2e mov r0, r17 2be9e: 00 0c add r0, r0 2bea0: 88 0b sbc r24, r24 2bea2: 99 0b sbc r25, r25 2bea4: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 2bea8: 8a e0 ldi r24, 0x0A ; 10 2beaa: 9f e8 ldi r25, 0x8F ; 143 2beac: 0e 94 d0 76 call 0xeda0 ; 0xeda0 MYSERIAL.println(feedmultiply_rec); 2beb0: 8f 2d mov r24, r15 2beb2: 9e 2d mov r25, r14 2beb4: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 2beb8: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2bebc: 81 11 cpse r24, r1 2bebe: 02 c0 rjmp .+4 ; 0x2bec4 { // M23 restore_file_from_sd(); 2bec0: 0e 94 63 88 call 0x110c6 ; 0x110c6 } // 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)); 2bec4: 8d e9 ldi r24, 0x9D ; 157 2bec6: 9f e0 ldi r25, 0x0F ; 15 2bec8: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2becc: c6 2e mov r12, r22 2bece: b7 2e mov r11, r23 2bed0: a8 2e mov r10, r24 2bed2: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 2bed4: 81 ea ldi r24, 0xA1 ; 161 2bed6: 9f e0 ldi r25, 0x0F ; 15 2bed8: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bedc: 76 2e mov r7, r22 2bede: 67 2e mov r6, r23 2bee0: 58 2e mov r5, r24 2bee2: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 2bee4: 20 e0 ldi r18, 0x00 ; 0 2bee6: 30 e0 ldi r19, 0x00 ; 0 2bee8: 40 e8 ldi r20, 0x80 ; 128 2beea: 5f eb ldi r21, 0xBF ; 191 2beec: 6c 2d mov r22, r12 2beee: 7b 2d mov r23, r11 2bef0: 8a 2d mov r24, r10 2bef2: 99 2d mov r25, r9 2bef4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2bef8: 88 23 and r24, r24 2befa: 99 f0 breq .+38 ; 0x2bf22 enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 2befc: 4f 92 push r4 2befe: 5f 92 push r5 2bf00: 6f 92 push r6 2bf02: 7f 92 push r7 2bf04: 9f 92 push r9 2bf06: af 92 push r10 2bf08: bf 92 push r11 2bf0a: cf 92 push r12 2bf0c: 83 ef ldi r24, 0xF3 ; 243 2bf0e: 9e e8 ldi r25, 0x8E ; 142 2bf10: 9f 93 push r25 2bf12: 8f 93 push r24 2bf14: 0e 94 3e 88 call 0x1107c ; 0x1107c 2bf18: 0f b6 in r0, 0x3f ; 63 2bf1a: f8 94 cli 2bf1c: de bf out 0x3e, r29 ; 62 2bf1e: 0f be out 0x3f, r0 ; 63 2bf20: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 2bf22: dd 20 and r13, r13 2bf24: 29 f0 breq .+10 ; 0x2bf30 enquecommand_P(PSTR("PRUSA MBL V1")); 2bf26: 61 e0 ldi r22, 0x01 ; 1 2bf28: 86 ee ldi r24, 0xE6 ; 230 2bf2a: 9e e8 ldi r25, 0x8E ; 142 2bf2c: 0e 94 a0 87 call 0x10f40 ; 0x10f40 // 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))); 2bf30: 8d e8 ldi r24, 0x8D ; 141 2bf32: 9f e0 ldi r25, 0x0F ; 15 2bf34: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bf38: 9f 93 push r25 2bf3a: 8f 93 push r24 2bf3c: 7f 93 push r23 2bf3e: 6f 93 push r22 2bf40: 8c ed ldi r24, 0xDC ; 220 2bf42: 9e e8 ldi r25, 0x8E ; 142 2bf44: 9f 93 push r25 2bf46: 8f 93 push r24 2bf48: 0e 94 3e 88 call 0x1107c ; 0x1107c // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 2bf4c: 81 e1 ldi r24, 0x11 ; 17 2bf4e: 9d e0 ldi r25, 0x0D ; 13 2bf50: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bf54: d6 2e mov r13, r22 2bf56: c7 2e mov r12, r23 2bf58: b8 2e mov r11, r24 2bf5a: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 2bf5c: 8d e0 ldi r24, 0x0D ; 13 2bf5e: 9d e0 ldi r25, 0x0D ; 13 2bf60: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2bf64: 96 2e mov r9, r22 2bf66: 77 2e mov r7, r23 2bf68: 68 2e mov r6, r24 2bf6a: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 2bf6c: 89 e0 ldi r24, 0x09 ; 9 2bf6e: 9d e0 ldi r25, 0x0D ; 13 2bf70: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 // 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); 2bf74: 9f 93 push r25 2bf76: 8f 93 push r24 2bf78: 7f 93 push r23 2bf7a: 6f 93 push r22 2bf7c: 5f 92 push r5 2bf7e: 6f 92 push r6 2bf80: 7f 92 push r7 2bf82: 9f 92 push r9 2bf84: af 92 push r10 2bf86: bf 92 push r11 2bf88: cf 92 push r12 2bf8a: df 92 push r13 2bf8c: 82 ec ldi r24, 0xC2 ; 194 2bf8e: 9e e8 ldi r25, 0x8E ; 142 2bf90: 9f 93 push r25 2bf92: 8f 93 push r24 2bf94: 0e 94 3e 88 call 0x1107c ; 0x1107c // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 2bf98: 8f e3 ldi r24, 0x3F ; 63 2bf9a: 8f 93 push r24 2bf9c: 80 e8 ldi r24, 0x80 ; 128 2bf9e: 8f 93 push r24 2bfa0: 1f 92 push r1 2bfa2: 1f 92 push r1 2bfa4: 86 eb ldi r24, 0xB6 ; 182 2bfa6: 9d e6 ldi r25, 0x6D ; 109 2bfa8: 9f 93 push r25 2bfaa: 8f 93 push r24 2bfac: 0e 94 3e 88 call 0x1107c ; 0x1107c // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 2bfb0: 8e e6 ldi r24, 0x6E ; 110 2bfb2: 9f e0 ldi r25, 0x0F ; 15 2bfb4: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 2bfb8: 9f 93 push r25 2bfba: 8f 93 push r24 2bfbc: 7f 93 push r23 2bfbe: 6f 93 push r22 2bfc0: 87 eb ldi r24, 0xB7 ; 183 2bfc2: 9e e8 ldi r25, 0x8E ; 142 2bfc4: 9f 93 push r25 2bfc6: 8f 93 push r24 2bfc8: 0e 94 3e 88 call 0x1107c ; 0x1107c if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 2bfcc: 0f b6 in r0, 0x3f ; 63 2bfce: f8 94 cli 2bfd0: de bf out 0x3e, r29 ; 62 2bfd2: 0f be out 0x3f, r0 ; 63 2bfd4: cd bf out 0x3d, r28 ; 61 2bfd6: 82 e7 ldi r24, 0x72 ; 114 2bfd8: 9f e0 ldi r25, 0x0F ; 15 2bfda: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2bfde: 88 23 and r24, r24 2bfe0: 29 f0 breq .+10 ; 0x2bfec enquecommand_P(PSTR("M82")); //E axis abslute mode 2bfe2: 61 e0 ldi r22, 0x01 ; 1 2bfe4: 83 eb ldi r24, 0xB3 ; 179 2bfe6: 9e e8 ldi r25, 0x8E ; 142 2bfe8: 0e 94 a0 87 call 0x10f40 ; 0x10f40 // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 2bfec: 1f 93 push r17 2bfee: 0f 93 push r16 2bff0: 8c ea ldi r24, 0xAC ; 172 2bff2: 9e e8 ldi r25, 0x8E ; 142 2bff4: 9f 93 push r25 2bff6: 8f 93 push r24 2bff8: 0e 94 3e 88 call 0x1107c ; 0x1107c enquecommandf_P(MSG_M220, feedmultiply_rec); 2bffc: ef 92 push r14 2bffe: ff 92 push r15 2c000: 82 e8 ldi r24, 0x82 ; 130 2c002: 9d e6 ldi r25, 0x6D ; 109 2c004: 9f 93 push r25 2c006: 8f 93 push r24 2c008: 0e 94 3e 88 call 0x1107c ; 0x1107c // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 2c00c: 1f 92 push r1 2c00e: 8f 92 push r8 2c010: 83 ea ldi r24, 0xA3 ; 163 2c012: 9e e8 ldi r25, 0x8E ; 142 2c014: 9f 93 push r25 2c016: 8f 93 push r24 2c018: 0e 94 3e 88 call 0x1107c ; 0x1107c // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 2c01c: 81 e9 ldi r24, 0x91 ; 145 2c01e: 9f e0 ldi r25, 0x0F ; 15 2c020: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 2c024: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 2c028: 0f b6 in r0, 0x3f ; 63 2c02a: f8 94 cli 2c02c: de bf out 0x3e, r29 ; 62 2c02e: 0f be out 0x3f, r0 ; 63 2c030: cd bf out 0x3d, r28 ; 61 2c032: 21 11 cpse r18, r1 2c034: 33 c0 rjmp .+102 ; 0x2c09c { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 2c036: 9f 93 push r25 2c038: 8f 93 push r24 2c03a: 7f 93 push r23 2c03c: 6f 93 push r22 2c03e: 8a e9 ldi r24, 0x9A ; 154 2c040: 9e e8 ldi r25, 0x8E ; 142 } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 2c042: 9f 93 push r25 2c044: 8f 93 push r24 2c046: 0e 94 3e 88 call 0x1107c ; 0x1107c 2c04a: 0f 90 pop r0 2c04c: 0f 90 pop r0 2c04e: 0f 90 pop r0 2c050: 0f 90 pop r0 2c052: 0f 90 pop r0 2c054: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 2c056: 61 e0 ldi r22, 0x01 ; 1 2c058: 8a e8 ldi r24, 0x8A ; 138 2c05a: 9e e8 ldi r25, 0x8E ; 142 2c05c: 0e 94 a0 87 call 0x10f40 ; 0x10f40 enquecommand_P(PSTR("PRUSA uvlo")); 2c060: 61 e0 ldi r22, 0x01 ; 1 2c062: 8f e7 ldi r24, 0x7F ; 127 2c064: 9e e8 ldi r25, 0x8E ; 142 2c066: 0e 94 a0 87 call 0x10f40 ; 0x10f40 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")); 2c06a: 8b e8 ldi r24, 0x8B ; 139 2c06c: 9d e6 ldi r25, 0x6D ; 109 2c06e: 0f 94 3d db call 0x3b67a ; 0x3b67a gcode_M114(); 2c072: 0e 94 c7 77 call 0xef8e ; 0xef8e } 2c076: 0f 90 pop r0 2c078: 0f 90 pop r0 2c07a: df 91 pop r29 2c07c: cf 91 pop r28 2c07e: 1f 91 pop r17 2c080: 0f 91 pop r16 2c082: ff 90 pop r15 2c084: ef 90 pop r14 2c086: df 90 pop r13 2c088: cf 90 pop r12 2c08a: bf 90 pop r11 2c08c: af 90 pop r10 2c08e: 9f 90 pop r9 2c090: 8f 90 pop r8 2c092: 7f 90 pop r7 2c094: 6f 90 pop r6 2c096: 5f 90 pop r5 2c098: 4f 90 pop r4 2c09a: 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) 2c09c: 21 30 cpi r18, 0x01 ; 1 2c09e: d9 f6 brne .-74 ; 0x2c056 { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 2c0a0: 9f 93 push r25 2c0a2: 8f 93 push r24 2c0a4: 7f 93 push r23 2c0a6: 6f 93 push r22 2c0a8: 80 e9 ldi r24, 0x90 ; 144 2c0aa: 9e e8 ldi r25, 0x8E ; 142 2c0ac: ca cf rjmp .-108 ; 0x2c042 0002c0ae : 2c0ae: 88 e1 ldi r24, 0x18 ; 24 2c0b0: 9e e0 ldi r25, 0x0E ; 14 2c0b2: 0f b6 in r0, 0x3f ; 63 2c0b4: f8 94 cli 2c0b6: a8 95 wdr 2c0b8: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c0bc: 0f be out 0x3f, r0 ; 63 2c0be: 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); 2c0c2: 9f b7 in r25, 0x3f ; 63 2c0c4: f8 94 cli 2c0c6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c0ca: 84 60 ori r24, 0x04 ; 4 2c0cc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c0d0: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 2c0d2: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 2c0d6: 43 e2 ldi r20, 0x23 ; 35 2c0d8: 5d e6 ldi r21, 0x6D ; 109 2c0da: 61 e0 ldi r22, 0x01 ; 1 2c0dc: 80 e0 ldi r24, 0x00 ; 0 2c0de: 0e 94 74 6e call 0xdce8 ; 0xdce8 2c0e2: ff cf rjmp .-2 ; 0x2c0e2 0002c0e4 <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 2c0e4: 1f 92 push r1 2c0e6: 0f 92 push r0 2c0e8: 0f b6 in r0, 0x3f ; 63 2c0ea: 0f 92 push r0 2c0ec: 11 24 eor r1, r1 2c0ee: 0b b6 in r0, 0x3b ; 59 2c0f0: 0f 92 push r0 2c0f2: 8f 92 push r8 2c0f4: 9f 92 push r9 2c0f6: af 92 push r10 2c0f8: bf 92 push r11 2c0fa: cf 92 push r12 2c0fc: df 92 push r13 2c0fe: ef 92 push r14 2c100: ff 92 push r15 2c102: 0f 93 push r16 2c104: 1f 93 push r17 2c106: 2f 93 push r18 2c108: 3f 93 push r19 2c10a: 4f 93 push r20 2c10c: 5f 93 push r21 2c10e: 6f 93 push r22 2c110: 7f 93 push r23 2c112: 8f 93 push r24 2c114: 9f 93 push r25 2c116: af 93 push r26 2c118: bf 93 push r27 2c11a: cf 93 push r28 2c11c: df 93 push r29 2c11e: ef 93 push r30 2c120: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 2c122: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 2c124: 85 e2 ldi r24, 0x25 ; 37 2c126: 9d e8 ldi r25, 0x8D ; 141 2c128: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 2c12c: 85 ea ldi r24, 0xA5 ; 165 2c12e: 9f e0 ldi r25, 0x0F ; 15 2c130: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2c134: 18 2f mov r17, r24 2c136: 81 11 cpse r24, r1 2c138: de c2 rjmp .+1468 ; 0x2c6f6 <__vector_5+0x612> { if(printer_active()) { 2c13a: 0e 94 61 67 call 0xcec2 ; 0xcec2 2c13e: 88 23 and r24, r24 2c140: 09 f4 brne .+2 ; 0x2c144 <__vector_5+0x60> 2c142: a9 c3 rjmp .+1874 ; 0x2c896 <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 2c144: 0f 94 51 2a call 0x254a2 ; 0x254a2 2c148: 6b 01 movw r12, r22 2c14a: 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); 2c14c: c0 91 a9 0d lds r28, 0x0DA9 ; 0x800da9 2c150: cc 23 and r28, r28 2c152: 31 f0 breq .+12 ; 0x2c160 <__vector_5+0x7c> 2c154: c1 e0 ldi r28, 0x01 ; 1 2c156: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2c15a: 82 30 cpi r24, 0x02 ; 2 2c15c: 09 f4 brne .+2 ; 0x2c160 <__vector_5+0x7c> 2c15e: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 2c160: d0 91 a8 0d lds r29, 0x0DA8 ; 0x800da8 2c164: d1 11 cpse r29, r1 2c166: 02 c0 rjmp .+4 ; 0x2c16c <__vector_5+0x88> 2c168: d0 91 a7 0d lds r29, 0x0DA7 ; 0x800da7 // Conserve as much power as soon as possible // Turn off the LCD backlight #ifdef LCD_BL_PIN backlightMode = BACKLIGHT_MODE_DIM; 2c16c: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 2c170: 10 92 00 04 sts 0x0400, r1 ; 0x800400 backlight_update(); 2c174: 0e 94 8e 89 call 0x1131c ; 0x1131c #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 2c178: 17 9a sbi 0x02, 7 ; 2 2c17a: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 2c17e: 16 9a sbi 0x02, 6 ; 2 2c180: 10 92 90 06 sts 0x0690, r1 ; 0x800690 // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 2c184: 64 e1 ldi r22, 0x14 ; 20 2c186: 83 e6 ldi r24, 0x63 ; 99 2c188: 92 e0 ldi r25, 0x02 ; 2 2c18a: 0e 94 7e 67 call 0xcefc ; 0xcefc currents[Z_AXIS].setiRun(20); 2c18e: 64 e1 ldi r22, 0x14 ; 20 2c190: 83 e6 ldi r24, 0x63 ; 99 2c192: 92 e0 ldi r25, 0x02 ; 2 2c194: 0e 94 86 67 call 0xcf0c ; 0xcf0c tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 2c198: 50 e0 ldi r21, 0x00 ; 0 2c19a: 40 e0 ldi r20, 0x00 ; 0 2c19c: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 2c1a0: 82 e0 ldi r24, 0x02 ; 2 2c1a2: 0f 94 94 25 call 0x24b28 ; 0x24b28 currents[E_AXIS].setiHold(20); 2c1a6: 64 e1 ldi r22, 0x14 ; 20 2c1a8: 86 e6 ldi r24, 0x66 ; 102 2c1aa: 92 e0 ldi r25, 0x02 ; 2 2c1ac: 0e 94 7e 67 call 0xcefc ; 0xcefc currents[E_AXIS].setiRun(20); 2c1b0: 64 e1 ldi r22, 0x14 ; 20 2c1b2: 86 e6 ldi r24, 0x66 ; 102 2c1b4: 92 e0 ldi r25, 0x02 ; 2 2c1b6: 0e 94 86 67 call 0xcf0c ; 0xcf0c tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 2c1ba: 50 e0 ldi r21, 0x00 ; 0 2c1bc: 40 e0 ldi r20, 0x00 ; 0 2c1be: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 2c1c2: 83 e0 ldi r24, 0x03 ; 3 2c1c4: 0f 94 94 25 call 0x24b28 ; 0x24b28 #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 2c1c8: c1 11 cpse r28, r1 2c1ca: 1b c0 rjmp .+54 ; 0x2c202 <__vector_5+0x11e> 2c1cc: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 2c1d0: 81 11 cpse r24, r1 2c1d2: 17 c0 rjmp .+46 ; 0x2c202 <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 2c1d4: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2c1d8: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_temperature = target_temperature[active_extruder]; 2c1dc: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2c1e0: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 2c1e4: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 2c1e8: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 2c1ec: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 2c1f0: 83 fb bst r24, 3 2c1f2: 88 27 eor r24, r24 2c1f4: 80 f9 bld r24, 0 2c1f6: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; 2c1fa: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 2c1fe: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab } // Stop all heaters before continuing disable_heater(); 2c202: 0f 94 1d 30 call 0x2603a ; 0x2603a // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 2c206: c1 11 cpse r28, r1 2c208: 04 c0 rjmp .+8 ; 0x2c212 <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 2c20a: 0e 94 ba 64 call 0xc974 ; 0xc974 // save the global state at planning time save_planner_global_state(); 2c20e: 0e 94 70 64 call 0xc8e0 ; 0xc8e0 } // 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; 2c212: 00 91 c2 13 lds r16, 0x13C2 ; 0x8013c2 mbl.active = false; 2c216: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 // 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(); 2c21a: 0f 94 fb c1 call 0x383f6 ; 0x383f6 // 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) 2c21e: c1 11 cpse r28, r1 2c220: 1b c0 rjmp .+54 ; 0x2c258 <__vector_5+0x174> 2c222: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 2c226: 81 11 cpse r24, r1 2c228: 17 c0 rjmp .+46 ; 0x2c258 <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 2c22a: 80 e1 ldi r24, 0x10 ; 16 2c22c: e2 e9 ldi r30, 0x92 ; 146 2c22e: f6 e0 ldi r31, 0x06 ; 6 2c230: a3 e7 ldi r26, 0x73 ; 115 2c232: b2 e0 ldi r27, 0x02 ; 2 2c234: 01 90 ld r0, Z+ 2c236: 0d 92 st X+, r0 2c238: 8a 95 dec r24 2c23a: e1 f7 brne .-8 ; 0x2c234 <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 2c23c: dd 23 and r29, r29 2c23e: 61 f0 breq .+24 ; 0x2c258 <__vector_5+0x174> 2c240: 80 e0 ldi r24, 0x00 ; 0 2c242: 90 e0 ldi r25, 0x00 ; 0 2c244: a0 e8 ldi r26, 0x80 ; 128 2c246: bf eb ldi r27, 0xBF ; 191 2c248: 80 93 73 02 sts 0x0273, r24 ; 0x800273 2c24c: 90 93 74 02 sts 0x0274, r25 ; 0x800274 2c250: a0 93 75 02 sts 0x0275, r26 ; 0x800275 2c254: b0 93 76 02 sts 0x0276, r27 ; 0x800276 } // 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]; 2c258: 80 90 7b 02 lds r8, 0x027B ; 0x80027b 2c25c: 90 90 7c 02 lds r9, 0x027C ; 0x80027c 2c260: a0 90 7d 02 lds r10, 0x027D ; 0x80027d 2c264: b0 90 7e 02 lds r11, 0x027E ; 0x80027e if(mbl_was_active) { 2c268: 00 23 and r16, r16 2c26a: d1 f0 breq .+52 ; 0x2c2a0 <__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]); 2c26c: 20 91 77 02 lds r18, 0x0277 ; 0x800277 2c270: 30 91 78 02 lds r19, 0x0278 ; 0x800278 2c274: 40 91 79 02 lds r20, 0x0279 ; 0x800279 2c278: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 2c27c: 60 91 73 02 lds r22, 0x0273 ; 0x800273 2c280: 70 91 74 02 lds r23, 0x0274 ; 0x800274 2c284: 80 91 75 02 lds r24, 0x0275 ; 0x800275 2c288: 90 91 76 02 lds r25, 0x0276 ; 0x800276 2c28c: 0f 94 e9 a1 call 0x343d2 ; 0x343d2 2c290: 9b 01 movw r18, r22 2c292: ac 01 movw r20, r24 2c294: c5 01 movw r24, r10 2c296: b4 01 movw r22, r8 2c298: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2c29c: 4b 01 movw r8, r22 2c29e: 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); 2c2a0: b5 01 movw r22, r10 2c2a2: a4 01 movw r20, r8 2c2a4: 8d e8 ldi r24, 0x8D ; 141 2c2a6: 9f e0 ldi r25, 0x0F ; 15 2c2a8: 0f 94 8a dc call 0x3b914 ; 0x3b914 2c2ac: 40 91 7f 02 lds r20, 0x027F ; 0x80027f 2c2b0: 50 91 80 02 lds r21, 0x0280 ; 0x800280 2c2b4: 60 91 81 02 lds r22, 0x0281 ; 0x800281 2c2b8: 70 91 82 02 lds r23, 0x0282 ; 0x800282 2c2bc: 8e e6 ldi r24, 0x6E ; 110 2c2be: 9f e0 ldi r25, 0x0F ; 15 2c2c0: 0f 94 8a dc call 0x3b914 ; 0x3b914 } 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); 2c2c4: 60 91 64 05 lds r22, 0x0564 ; 0x800564 2c2c8: c1 e0 ldi r28, 0x01 ; 1 2c2ca: 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); 2c2cc: 82 e7 ldi r24, 0x72 ; 114 2c2ce: 9f e0 ldi r25, 0x0F ; 15 2c2d0: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 2c2d4: 0e 94 c4 7e call 0xfd88 ; 0xfd88 card.sdprinting = false; 2c2d8: 10 92 90 14 sts 0x1490, r1 ; 0x801490 saved_printing = true; 2c2dc: c0 93 a9 0d sts 0x0DA9, r28 ; 0x800da9 // 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; 2c2e0: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac sei(); 2c2e4: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 2c2e6: 20 e0 ldi r18, 0x00 ; 0 2c2e8: 30 e0 ldi r19, 0x00 ; 0 2c2ea: 40 e8 ldi r20, 0x80 ; 128 2c2ec: 5f e3 ldi r21, 0x3F ; 63 2c2ee: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 2c2f2: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 2c2f6: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 2c2fa: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 2c2fe: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2c302: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 2c306: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 2c30a: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 2c30e: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(95); 2c312: 60 e0 ldi r22, 0x00 ; 0 2c314: 70 e0 ldi r23, 0x00 ; 0 2c316: 8e eb ldi r24, 0xBE ; 190 2c318: 92 e4 ldi r25, 0x42 ; 66 2c31a: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 2c31e: 0f 94 ed 43 call 0x287da ; 0x287da disable_e0(); 2c322: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 2c324: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 2c328: c0 e0 ldi r28, 0x00 ; 0 2c32a: d1 e0 ldi r29, 0x01 ; 1 2c32c: 02 c0 rjmp .+4 ; 0x2c332 <__vector_5+0x24e> 2c32e: d6 95 lsr r29 2c330: c7 95 ror r28 2c332: 8a 95 dec r24 2c334: e2 f7 brpl .-8 ; 0x2c32e <__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); 2c336: 82 e0 ldi r24, 0x02 ; 2 2c338: 0f 94 7a 25 call 0x24af4 ; 0x24af4 current_position[Z_AXIS] += float(1024 - z_microsteps) 2c33c: 60 e0 ldi r22, 0x00 ; 0 2c33e: 74 e0 ldi r23, 0x04 ; 4 2c340: 68 1b sub r22, r24 2c342: 79 0b sbc r23, r25 2c344: 90 e0 ldi r25, 0x00 ; 0 2c346: 80 e0 ldi r24, 0x00 ; 0 2c348: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 2c34c: 4b 01 movw r8, r22 2c34e: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 2c350: be 01 movw r22, r28 2c352: 90 e0 ldi r25, 0x00 ; 0 2c354: 80 e0 ldi r24, 0x00 ; 0 2c356: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 2c35a: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c35e: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c362: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c366: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c36a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2c36e: 9b 01 movw r18, r22 2c370: ac 01 movw r20, r24 2c372: c5 01 movw r24, r10 2c374: b4 01 movw r22, r8 2c376: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> + UVLO_Z_AXIS_SHIFT; 2c37a: 2a e0 ldi r18, 0x0A ; 10 2c37c: 37 ed ldi r19, 0xD7 ; 215 2c37e: 43 e2 ldi r20, 0x23 ; 35 2c380: 5f e3 ldi r21, 0x3F ; 63 2c382: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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) 2c386: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 2c38a: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 2c38e: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 2c392: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 2c396: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2c39a: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2c39e: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2c3a2: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2c3a6: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 2c3aa: 65 e5 ldi r22, 0x55 ; 85 2c3ac: 75 e5 ldi r23, 0x55 ; 85 2c3ae: 85 e5 ldi r24, 0x55 ; 85 2c3b0: 91 e4 ldi r25, 0x41 ; 65 2c3b2: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 2c3b6: 0f 94 ed 43 call 0x287da ; 0x287da if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 2c3ba: 40 91 60 05 lds r20, 0x0560 ; 0x800560 2c3be: 50 91 61 05 lds r21, 0x0561 ; 0x800561 2c3c2: 60 91 62 05 lds r22, 0x0562 ; 0x800562 2c3c6: 70 91 63 05 lds r23, 0x0563 ; 0x800563 2c3ca: 81 e9 ldi r24, 0x91 ; 145 2c3cc: 9f e0 ldi r25, 0x0F ; 15 2c3ce: 0f 94 8a dc call 0x3b914 ; 0x3b914 2c3d2: ce ea ldi r28, 0xAE ; 174 2c3d4: 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; 2c3d6: 97 e0 ldi r25, 0x07 ; 7 2c3d8: 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; 2c3da: 70 e0 ldi r23, 0x00 ; 0 2c3dc: 60 e0 ldi r22, 0x00 ; 0 2c3de: 00 23 and r16, r16 2c3e0: 19 f1 breq .+70 ; 0x2c428 <__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; 2c3e2: 81 2f mov r24, r17 2c3e4: 6b 2d mov r22, r11 2c3e6: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__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; 2c3ea: b8 9e mul r11, r24 2c3ec: f0 01 movw r30, r0 2c3ee: 11 24 eor r1, r1 2c3f0: e9 0f add r30, r25 2c3f2: f1 1d adc r31, r1 2c3f4: ee 0f add r30, r30 2c3f6: ff 1f adc r31, r31 2c3f8: ee 0f add r30, r30 2c3fa: ff 1f adc r31, r31 2c3fc: ee 53 subi r30, 0x3E ; 62 2c3fe: fc 4e sbci r31, 0xEC ; 236 2c400: 20 e0 ldi r18, 0x00 ; 0 2c402: 30 e0 ldi r19, 0x00 ; 0 2c404: 4a e7 ldi r20, 0x7A ; 122 2c406: 54 e4 ldi r21, 0x44 ; 68 2c408: 61 81 ldd r22, Z+1 ; 0x01 2c40a: 72 81 ldd r23, Z+2 ; 0x02 2c40c: 83 81 ldd r24, Z+3 ; 0x03 2c40e: 94 81 ldd r25, Z+4 ; 0x04 2c410: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2c414: 20 e0 ldi r18, 0x00 ; 0 2c416: 30 e0 ldi r19, 0x00 ; 0 2c418: 40 e0 ldi r20, 0x00 ; 0 2c41a: 5f e3 ldi r21, 0x3F ; 63 2c41c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2c420: 0f 94 23 df call 0x3be46 ; 0x3be46 2c424: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c428: ce 01 movw r24, r28 2c42a: 0f 94 96 dc call 0x3b92c ; 0x3b92c // 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) 2c42e: 1f 5f subi r17, 0xFF ; 255 2c430: 22 96 adiw r28, 0x02 ; 2 2c432: 11 33 cpi r17, 0x31 ; 49 2c434: 91 f6 brne .-92 ; 0x2c3da <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c436: 40 91 9a 06 lds r20, 0x069A ; 0x80069a 2c43a: 50 91 9b 06 lds r21, 0x069B ; 0x80069b 2c43e: 60 91 9c 06 lds r22, 0x069C ; 0x80069c 2c442: 70 91 9d 06 lds r23, 0x069D ; 0x80069d 2c446: 8a ed ldi r24, 0xDA ; 218 2c448: 9e e0 ldi r25, 0x0E ; 14 2c44a: 0f 94 8a dc call 0x3b914 ; 0x3b914 2c44e: 40 91 73 02 lds r20, 0x0273 ; 0x800273 2c452: 50 91 74 02 lds r21, 0x0274 ; 0x800274 2c456: 60 91 75 02 lds r22, 0x0275 ; 0x800275 2c45a: 70 91 76 02 lds r23, 0x0276 ; 0x800276 2c45e: 8d e9 ldi r24, 0x9D ; 157 2c460: 9f e0 ldi r25, 0x0F ; 15 2c462: 0f 94 8a dc call 0x3b914 ; 0x3b914 2c466: 40 91 77 02 lds r20, 0x0277 ; 0x800277 2c46a: 50 91 78 02 lds r21, 0x0278 ; 0x800278 2c46e: 60 91 79 02 lds r22, 0x0279 ; 0x800279 2c472: 70 91 7a 02 lds r23, 0x027A ; 0x80027a 2c476: 81 ea ldi r24, 0xA1 ; 161 2c478: 9f e0 ldi r25, 0x0F ; 15 2c47a: 0f 94 8a dc call 0x3b914 ; 0x3b914 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c47e: 60 91 5e 05 lds r22, 0x055E ; 0x80055e 2c482: 70 91 5f 05 lds r23, 0x055F ; 0x80055f 2c486: 89 e8 ldi r24, 0x89 ; 137 2c488: 9f e0 ldi r25, 0x0F ; 15 2c48a: 0f 94 96 dc call 0x3b92c ; 0x3b92c 2c48e: 60 91 39 02 lds r22, 0x0239 ; 0x800239 2c492: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 2c496: 85 e3 ldi r24, 0x35 ; 53 2c498: 9d e0 ldi r25, 0x0D ; 13 2c49a: 0f 94 96 dc call 0x3b92c ; 0x3b92c 2c49e: 60 91 ac 05 lds r22, 0x05AC ; 0x8005ac 2c4a2: 70 91 ad 05 lds r23, 0x05AD ; 0x8005ad 2c4a6: 88 ed ldi r24, 0xD8 ; 216 2c4a8: 9e e0 ldi r25, 0x0E ; 14 2c4aa: 0f 94 96 dc call 0x3b92c ; 0x3b92c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c4ae: 60 91 ae 05 lds r22, 0x05AE ; 0x8005ae 2c4b2: 8b e8 ldi r24, 0x8B ; 139 2c4b4: 9f e0 ldi r25, 0x0F ; 15 2c4b6: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 2c4ba: 60 91 ab 05 lds r22, 0x05AB ; 0x8005ab 2c4be: 88 e8 ldi r24, 0x88 ; 136 2c4c0: 9f e0 ldi r25, 0x0F ; 15 2c4c2: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c4c6: 40 91 93 02 lds r20, 0x0293 ; 0x800293 2c4ca: 50 91 94 02 lds r21, 0x0294 ; 0x800294 2c4ce: 60 91 95 02 lds r22, 0x0295 ; 0x800295 2c4d2: 70 91 96 02 lds r23, 0x0296 ; 0x800296 2c4d6: 88 ee ldi r24, 0xE8 ; 232 2c4d8: 9e e0 ldi r25, 0x0E ; 14 2c4da: 0f 94 8a dc call 0x3b914 ; 0x3b914 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c4de: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 2c4e2: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 2c4e6: 8e ed ldi r24, 0xDE ; 222 2c4e8: 9e e0 ldi r25, 0x0E ; 14 2c4ea: 0f 94 96 dc call 0x3b92c ; 0x3b92c if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c4ee: 40 91 f2 0d lds r20, 0x0DF2 ; 0x800df2 2c4f2: 50 91 f3 0d lds r21, 0x0DF3 ; 0x800df3 2c4f6: 60 91 f4 0d lds r22, 0x0DF4 ; 0x800df4 2c4fa: 70 91 f5 0d lds r23, 0x0DF5 ; 0x800df5 2c4fe: 81 e1 ldi r24, 0x11 ; 17 2c500: 9d e0 ldi r25, 0x0D ; 13 2c502: 0f 94 8a dc call 0x3b914 ; 0x3b914 2c506: 40 91 f6 0d lds r20, 0x0DF6 ; 0x800df6 2c50a: 50 91 f7 0d lds r21, 0x0DF7 ; 0x800df7 2c50e: 60 91 f8 0d lds r22, 0x0DF8 ; 0x800df8 2c512: 70 91 f9 0d lds r23, 0x0DF9 ; 0x800df9 2c516: 8d e0 ldi r24, 0x0D ; 13 2c518: 9d e0 ldi r25, 0x0D ; 13 2c51a: 0f 94 8a dc call 0x3b914 ; 0x3b914 2c51e: 40 91 7e 0e lds r20, 0x0E7E ; 0x800e7e 2c522: 50 91 7f 0e lds r21, 0x0E7F ; 0x800e7f 2c526: 60 91 80 0e lds r22, 0x0E80 ; 0x800e80 2c52a: 70 91 81 0e lds r23, 0x0E81 ; 0x800e81 2c52e: 89 e0 ldi r24, 0x09 ; 9 2c530: 9d e0 ldi r25, 0x0D ; 13 2c532: 0f 94 8a dc call 0x3b914 ; 0x3b914 #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); 2c536: 40 e1 ldi r20, 0x10 ; 16 2c538: 50 e0 ldi r21, 0x00 ; 0 2c53a: 67 e3 ldi r22, 0x37 ; 55 2c53c: 7d e0 ldi r23, 0x0D ; 13 2c53e: 83 e8 ldi r24, 0x83 ; 131 2c540: 92 e0 ldi r25, 0x02 ; 2 2c542: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c546: 60 91 69 05 lds r22, 0x0569 ; 0x800569 2c54a: 70 91 6a 05 lds r23, 0x056A ; 0x80056a 2c54e: 8c e6 ldi r24, 0x6C ; 108 2c550: 9f e0 ldi r25, 0x0F ; 15 2c552: 0f 94 96 dc call 0x3b92c ; 0x3b92c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c556: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 2c55a: 8c e8 ldi r24, 0x8C ; 140 2c55c: 9f e0 ldi r25, 0x0F ; 15 2c55e: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c562: 40 91 65 05 lds r20, 0x0565 ; 0x800565 2c566: 50 91 66 05 lds r21, 0x0566 ; 0x800566 2c56a: 60 91 67 05 lds r22, 0x0567 ; 0x800567 2c56e: 70 91 68 05 lds r23, 0x0568 ; 0x800568 2c572: 8c e2 ldi r24, 0x2C ; 44 2c574: 9d e0 ldi r25, 0x0D ; 13 2c576: 0f 94 8a dc call 0x3b914 ; 0x3b914 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c57a: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 2c57e: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 2c582: 8d e7 ldi r24, 0x7D ; 125 2c584: 9c e0 ldi r25, 0x0C ; 12 2c586: 0f 94 96 dc call 0x3b92c ; 0x3b92c #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); 2c58a: 40 e1 ldi r20, 0x10 ; 16 2c58c: 50 e0 ldi r21, 0x00 ; 0 2c58e: 6d e6 ldi r22, 0x6D ; 109 2c590: 7c e0 ldi r23, 0x0C ; 12 2c592: 82 ee ldi r24, 0xE2 ; 226 2c594: 9d e0 ldi r25, 0x0D ; 13 2c596: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 2c59a: 40 e1 ldi r20, 0x10 ; 16 2c59c: 50 e0 ldi r21, 0x00 ; 0 2c59e: 6d e5 ldi r22, 0x5D ; 93 2c5a0: 7c e0 ldi r23, 0x0C ; 12 2c5a2: 8a e6 ldi r24, 0x6A ; 106 2c5a4: 9e e0 ldi r25, 0x0E ; 14 2c5a6: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 2c5aa: 40 e1 ldi r20, 0x10 ; 16 2c5ac: 50 e0 ldi r21, 0x00 ; 0 2c5ae: 6d e4 ldi r22, 0x4D ; 77 2c5b0: 7c e0 ldi r23, 0x0C ; 12 2c5b2: 82 ed ldi r24, 0xD2 ; 210 2c5b4: 9d e0 ldi r25, 0x0D ; 13 2c5b6: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 2c5ba: 40 e1 ldi r20, 0x10 ; 16 2c5bc: 50 e0 ldi r21, 0x00 ; 0 2c5be: 6d e3 ldi r22, 0x3D ; 61 2c5c0: 7c e0 ldi r23, 0x0C ; 12 2c5c2: 8a e5 ldi r24, 0x5A ; 90 2c5c4: 9e e0 ldi r25, 0x0E ; 14 2c5c6: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c5ca: 40 91 fa 0d lds r20, 0x0DFA ; 0x800dfa 2c5ce: 50 91 fb 0d lds r21, 0x0DFB ; 0x800dfb 2c5d2: 60 91 fc 0d lds r22, 0x0DFC ; 0x800dfc 2c5d6: 70 91 fd 0d lds r23, 0x0DFD ; 0x800dfd 2c5da: 89 e3 ldi r24, 0x39 ; 57 2c5dc: 9c e0 ldi r25, 0x0C ; 12 2c5de: 0f 94 8a dc call 0x3b914 ; 0x3b914 2c5e2: 40 91 fe 0d lds r20, 0x0DFE ; 0x800dfe 2c5e6: 50 91 ff 0d lds r21, 0x0DFF ; 0x800dff 2c5ea: 60 91 00 0e lds r22, 0x0E00 ; 0x800e00 2c5ee: 70 91 01 0e lds r23, 0x0E01 ; 0x800e01 2c5f2: 85 e3 ldi r24, 0x35 ; 53 2c5f4: 9c e0 ldi r25, 0x0C ; 12 2c5f6: 0f 94 8a dc call 0x3b914 ; 0x3b914 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 2c5fa: 40 91 02 0e lds r20, 0x0E02 ; 0x800e02 2c5fe: 50 91 03 0e lds r21, 0x0E03 ; 0x800e03 2c602: 60 91 04 0e lds r22, 0x0E04 ; 0x800e04 2c606: 70 91 05 0e lds r23, 0x0E05 ; 0x800e05 2c60a: 81 e3 ldi r24, 0x31 ; 49 2c60c: 9c e0 ldi r25, 0x0C ; 12 2c60e: 0f 94 8a dc call 0x3b914 ; 0x3b914 #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); 2c612: 40 e1 ldi r20, 0x10 ; 16 2c614: 50 e0 ldi r21, 0x00 ; 0 2c616: 61 e2 ldi r22, 0x21 ; 33 2c618: 7c e0 ldi r23, 0x0C ; 12 2c61a: 86 e0 ldi r24, 0x06 ; 6 2c61c: 9e e0 ldi r25, 0x0E ; 14 2c61e: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 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) { 2c622: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 2c626: 88 23 and r24, r24 2c628: 29 f0 breq .+10 ; 0x2c634 <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c62a: 61 e0 ldi r22, 0x01 ; 1 2c62c: 8f e7 ldi r24, 0x7F ; 127 2c62e: 9c e0 ldi r25, 0x0C ; 12 2c630: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 2c634: 61 e0 ldi r22, 0x01 ; 1 2c636: 85 ea ldi r24, 0xA5 ; 165 2c638: 9f e0 ldi r25, 0x0F ; 15 2c63a: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 2c63e: 84 e6 ldi r24, 0x64 ; 100 2c640: 9f e0 ldi r25, 0x0F ; 15 2c642: 0e 94 a8 75 call 0xeb50 ; 0xeb50 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 2c646: 8f ef ldi r24, 0xFF ; 255 2c648: 9e e0 ldi r25, 0x0E ; 14 2c64a: 0e 94 9b 75 call 0xeb36 ; 0xeb36 printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 2c64e: 0f 94 51 2a call 0x254a2 ; 0x254a2 2c652: dc 01 movw r26, r24 2c654: cb 01 movw r24, r22 2c656: 8c 19 sub r24, r12 2c658: 9d 09 sbc r25, r13 2c65a: ae 09 sbc r26, r14 2c65c: bf 09 sbc r27, r15 2c65e: bf 93 push r27 2c660: af 93 push r26 2c662: 9f 93 push r25 2c664: 8f 93 push r24 2c666: 88 e3 ldi r24, 0x38 ; 56 2c668: 9d e6 ldi r25, 0x6D ; 109 2c66a: 9f 93 push r25 2c66c: 8f 93 push r24 2c66e: 0f 94 16 db call 0x3b62c ; 0x3b62c WRITE(BEEPER,HIGH); 2c672: 9f b7 in r25, 0x3f ; 63 2c674: f8 94 cli 2c676: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c67a: 84 60 ori r24, 0x04 ; 4 2c67c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c680: 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(); 2c682: 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; 2c684: 0f 90 pop r0 2c686: 0f 90 pop r0 2c688: 0f 90 pop r0 2c68a: 0f 90 pop r0 2c68c: 0f 90 pop r0 2c68e: 0f 90 pop r0 2c690: 20 e0 ldi r18, 0x00 ; 0 2c692: 30 e0 ldi r19, 0x00 ; 0 2c694: 4f ef ldi r20, 0xFF ; 255 2c696: 52 e4 ldi r21, 0x42 ; 66 2c698: 60 91 92 06 lds r22, 0x0692 ; 0x800692 2c69c: 70 91 93 06 lds r23, 0x0693 ; 0x800693 2c6a0: 80 91 94 06 lds r24, 0x0694 ; 0x800694 2c6a4: 90 91 95 06 lds r25, 0x0695 ; 0x800695 2c6a8: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2c6ac: 87 fd sbrc r24, 7 2c6ae: 1f c0 rjmp .+62 ; 0x2c6ee <__vector_5+0x60a> 2c6b0: 80 e0 ldi r24, 0x00 ; 0 2c6b2: 90 e0 ldi r25, 0x00 ; 0 2c6b4: af e7 ldi r26, 0x7F ; 127 2c6b6: b3 e4 ldi r27, 0x43 ; 67 2c6b8: 80 93 92 06 sts 0x0692, r24 ; 0x800692 2c6bc: 90 93 93 06 sts 0x0693, r25 ; 0x800693 2c6c0: a0 93 94 06 sts 0x0694, r26 ; 0x800694 2c6c4: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(500); 2c6c8: 60 e0 ldi r22, 0x00 ; 0 2c6ca: 70 e0 ldi r23, 0x00 ; 0 2c6cc: 8a ef ldi r24, 0xFA ; 250 2c6ce: 93 e4 ldi r25, 0x43 ; 67 2c6d0: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 2c6d4: 0f 94 ed 43 call 0x287da ; 0x287da 2c6d8: 88 e1 ldi r24, 0x18 ; 24 2c6da: 9e e0 ldi r25, 0x0E ; 14 2c6dc: 0f b6 in r0, 0x3f ; 63 2c6de: f8 94 cli 2c6e0: a8 95 wdr 2c6e2: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c6e6: 0f be out 0x3f, r0 ; 63 2c6e8: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c6ec: ff cf rjmp .-2 ; 0x2c6ec <__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; 2c6ee: 80 e0 ldi r24, 0x00 ; 0 2c6f0: 90 e0 ldi r25, 0x00 ; 0 2c6f2: dc 01 movw r26, r24 2c6f4: e1 cf rjmp .-62 ; 0x2c6b8 <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 2c6f6: 0f 94 51 2a call 0x254a2 ; 0x254a2 2c6fa: 6b 01 movw r12, r22 2c6fc: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 2c6fe: 17 9a sbi 0x02, 7 ; 2 2c700: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 2c704: 16 9a sbi 0x02, 6 ; 2 2c706: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_e0(); 2c70a: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 2c70c: 64 e1 ldi r22, 0x14 ; 20 2c70e: 83 e6 ldi r24, 0x63 ; 99 2c710: 92 e0 ldi r25, 0x02 ; 2 2c712: 0e 94 7e 67 call 0xcefc ; 0xcefc currents[Z_AXIS].setiRun(20); 2c716: 64 e1 ldi r22, 0x14 ; 20 2c718: 83 e6 ldi r24, 0x63 ; 99 2c71a: 92 e0 ldi r25, 0x02 ; 2 2c71c: 0e 94 86 67 call 0xcf0c ; 0xcf0c tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 2c720: 50 e0 ldi r21, 0x00 ; 0 2c722: 40 e0 ldi r20, 0x00 ; 0 2c724: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 2c728: 82 e0 ldi r24, 0x02 ; 2 2c72a: 0f 94 94 25 call 0x24b28 ; 0x24b28 #endif //TMC2130 // Stop all heaters disable_heater(); 2c72e: 0f 94 1d 30 call 0x2603a ; 0x2603a // 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; 2c732: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 planner_abort_hard(); 2c736: 0f 94 fb c1 call 0x383f6 ; 0x383f6 // 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]) 2c73a: 80 90 9a 06 lds r8, 0x069A ; 0x80069a 2c73e: 90 90 9b 06 lds r9, 0x069B ; 0x80069b 2c742: a0 90 9c 06 lds r10, 0x069C ; 0x80069c 2c746: b0 90 9d 06 lds r11, 0x069D ; 0x80069d 2c74a: 8a ed ldi r24, 0xDA ; 218 2c74c: 9e e0 ldi r25, 0x0E ; 14 2c74e: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2c752: 9b 01 movw r18, r22 2c754: ac 01 movw r20, r24 2c756: c5 01 movw r24, r10 2c758: b4 01 movw r22, r8 2c75a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2c75e: 4b 01 movw r8, r22 2c760: 5c 01 movw r10, r24 2c762: e8 94 clt 2c764: b7 f8 bld r11, 7 2c766: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c76a: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c76e: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c772: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c776: 60 e0 ldi r22, 0x00 ; 0 2c778: 70 e0 ldi r23, 0x00 ; 0 2c77a: 80 e8 ldi r24, 0x80 ; 128 2c77c: 9f e3 ldi r25, 0x3F ; 63 2c77e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 2c782: 9b 01 movw r18, r22 2c784: ac 01 movw r20, r24 2c786: c5 01 movw r24, r10 2c788: b4 01 movw r22, r8 2c78a: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2c78e: 87 fd sbrc r24, 7 2c790: 61 c0 rjmp .+194 ; 0x2c854 <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 2c792: 0e 94 c4 7e call 0xfd88 ; 0xfd88 card.sdprinting = false; 2c796: 10 92 90 14 sts 0x1490, r1 ; 0x801490 saved_printing = true; 2c79a: 81 e0 ldi r24, 0x01 ; 1 2c79c: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 // 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; 2c7a0: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac sei(); 2c7a4: 78 94 sei 2c7a6: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 2c7aa: c0 e0 ldi r28, 0x00 ; 0 2c7ac: d1 e0 ldi r29, 0x01 ; 1 2c7ae: 02 c0 rjmp .+4 ; 0x2c7b4 <__vector_5+0x6d0> 2c7b0: d6 95 lsr r29 2c7b2: c7 95 ror r28 2c7b4: 8a 95 dec r24 2c7b6: e2 f7 brpl .-8 ; 0x2c7b0 <__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); 2c7b8: 82 e0 ldi r24, 0x02 ; 2 2c7ba: 0f 94 7a 25 call 0x24af4 ; 0x24af4 current_position[Z_AXIS] += float(1024 - z_microsteps) 2c7be: 60 e0 ldi r22, 0x00 ; 0 2c7c0: 74 e0 ldi r23, 0x04 ; 4 2c7c2: 68 1b sub r22, r24 2c7c4: 79 0b sbc r23, r25 2c7c6: 90 e0 ldi r25, 0x00 ; 0 2c7c8: 80 e0 ldi r24, 0x00 ; 0 2c7ca: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 2c7ce: 4b 01 movw r8, r22 2c7d0: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 2c7d2: be 01 movw r22, r28 2c7d4: 90 e0 ldi r25, 0x00 ; 0 2c7d6: 80 e0 ldi r24, 0x00 ; 0 2c7d8: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 2c7dc: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c7e0: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c7e4: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c7e8: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c7ec: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2c7f0: 9b 01 movw r18, r22 2c7f2: ac 01 movw r20, r24 2c7f4: c5 01 movw r24, r10 2c7f6: b4 01 movw r22, r8 2c7f8: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 2c7fc: 2a e0 ldi r18, 0x0A ; 10 2c7fe: 37 ed ldi r19, 0xD7 ; 215 2c800: 43 e2 ldi r20, 0x23 ; 35 2c802: 5e e3 ldi r21, 0x3E ; 62 2c804: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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) 2c808: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 2c80c: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 2c810: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 2c814: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 2c818: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2c81c: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2c820: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2c824: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2c828: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_TINY_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 2c82c: 65 e5 ldi r22, 0x55 ; 85 2c82e: 75 e5 ldi r23, 0x55 ; 85 2c830: 85 e5 ldi r24, 0x55 ; 85 2c832: 91 e4 ldi r25, 0x41 ; 65 2c834: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 2c838: 0f 94 ed 43 call 0x287da ; 0x287da if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c83c: 40 91 9a 06 lds r20, 0x069A ; 0x80069a 2c840: 50 91 9b 06 lds r21, 0x069B ; 0x80069b 2c844: 60 91 9c 06 lds r22, 0x069C ; 0x80069c 2c848: 70 91 9d 06 lds r23, 0x069D ; 0x80069d 2c84c: 8a ed ldi r24, 0xDA ; 218 2c84e: 9e e0 ldi r25, 0x0E ; 14 2c850: 0f 94 8a dc call 0x3b914 ; 0x3b914 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c854: 62 e0 ldi r22, 0x02 ; 2 2c856: 85 ea ldi r24, 0xA5 ; 165 2c858: 9f e0 ldi r25, 0x0F ; 15 2c85a: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 // 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); 2c85e: 84 e6 ldi r24, 0x64 ; 100 2c860: 9f e0 ldi r25, 0x0F ; 15 2c862: 0e 94 a8 75 call 0xeb50 ; 0xeb50 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 2c866: 8f ef ldi r24, 0xFF ; 255 2c868: 9e e0 ldi r25, 0x0E ; 14 2c86a: 0e 94 9b 75 call 0xeb36 ; 0xeb36 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 2c86e: 0f 94 51 2a call 0x254a2 ; 0x254a2 2c872: dc 01 movw r26, r24 2c874: cb 01 movw r24, r22 2c876: 8c 19 sub r24, r12 2c878: 9d 09 sbc r25, r13 2c87a: ae 09 sbc r26, r14 2c87c: bf 09 sbc r27, r15 2c87e: bf 93 push r27 2c880: af 93 push r26 2c882: 9f 93 push r25 2c884: 8f 93 push r24 2c886: 87 e4 ldi r24, 0x47 ; 71 2c888: 9d e6 ldi r25, 0x6D ; 109 2c88a: 9f 93 push r25 2c88c: 8f 93 push r24 2c88e: 0f 94 16 db call 0x3b62c ; 0x3b62c uvlo_drain_reset(); 2c892: 0f 94 57 60 call 0x2c0ae ; 0x2c0ae // 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(); } } 2c896: ff 91 pop r31 2c898: ef 91 pop r30 2c89a: df 91 pop r29 2c89c: cf 91 pop r28 2c89e: bf 91 pop r27 2c8a0: af 91 pop r26 2c8a2: 9f 91 pop r25 2c8a4: 8f 91 pop r24 2c8a6: 7f 91 pop r23 2c8a8: 6f 91 pop r22 2c8aa: 5f 91 pop r21 2c8ac: 4f 91 pop r20 2c8ae: 3f 91 pop r19 2c8b0: 2f 91 pop r18 2c8b2: 1f 91 pop r17 2c8b4: 0f 91 pop r16 2c8b6: ff 90 pop r15 2c8b8: ef 90 pop r14 2c8ba: df 90 pop r13 2c8bc: cf 90 pop r12 2c8be: bf 90 pop r11 2c8c0: af 90 pop r10 2c8c2: 9f 90 pop r9 2c8c4: 8f 90 pop r8 2c8c6: 0f 90 pop r0 2c8c8: 0b be out 0x3b, r0 ; 59 2c8ca: 0f 90 pop r0 2c8cc: 0f be out 0x3f, r0 ; 63 2c8ce: 0f 90 pop r0 2c8d0: 1f 90 pop r1 2c8d2: 18 95 reti 0002c8d4 : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2c8d4: 60 91 a5 0d lds r22, 0x0DA5 ; 0x800da5 uint8_t _block_buffer_tail = block_buffer_tail; 2c8d8: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 uint16_t sdlen = 0; 2c8dc: 30 e0 ldi r19, 0x00 ; 0 2c8de: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2c8e0: 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) 2c8e2: 96 17 cp r25, r22 2c8e4: 61 f0 breq .+24 ; 0x2c8fe { sdlen += block_buffer[_block_buffer_tail].sdlen; 2c8e6: 89 9f mul r24, r25 2c8e8: f0 01 movw r30, r0 2c8ea: 11 24 eor r1, r1 2c8ec: ef 5c subi r30, 0xCF ; 207 2c8ee: f8 4f sbci r31, 0xF8 ; 248 2c8f0: 40 81 ld r20, Z 2c8f2: 51 81 ldd r21, Z+1 ; 0x01 2c8f4: 24 0f add r18, r20 2c8f6: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c8f8: 9f 5f subi r25, 0xFF ; 255 2c8fa: 9f 70 andi r25, 0x0F ; 15 2c8fc: f2 cf rjmp .-28 ; 0x2c8e2 } return sdlen; } 2c8fe: c9 01 movw r24, r18 2c900: 08 95 ret 0002c902 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2c902: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 2c906: 20 91 a6 0d lds r18, 0x0DA6 ; 0x800da6 2c90a: 32 17 cp r19, r18 2c90c: 91 f0 breq .+36 ; 0x2c932 // 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; 2c90e: e0 91 a5 0d lds r30, 0x0DA5 ; 0x800da5 } // 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) 2c912: e1 11 cpse r30, r1 2c914: 01 c0 rjmp .+2 ; 0x2c918 block_index = BLOCK_BUFFER_SIZE; 2c916: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2c918: 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; 2c91a: 2e e6 ldi r18, 0x6E ; 110 2c91c: e2 9f mul r30, r18 2c91e: f0 01 movw r30, r0 2c920: 11 24 eor r1, r1 2c922: ef 5c subi r30, 0xCF ; 207 2c924: f8 4f sbci r31, 0xF8 ; 248 2c926: 20 81 ld r18, Z 2c928: 31 81 ldd r19, Z+1 ; 0x01 2c92a: 82 0f add r24, r18 2c92c: 93 1f adc r25, r19 2c92e: 91 83 std Z+1, r25 ; 0x01 2c930: 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. } } 2c932: 08 95 ret 0002c934 : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2c934: 8f 92 push r8 2c936: 9f 92 push r9 2c938: af 92 push r10 2c93a: bf 92 push r11 2c93c: cf 92 push r12 2c93e: df 92 push r13 2c940: ef 92 push r14 2c942: ff 92 push r15 2c944: 0f 93 push r16 2c946: 1f 93 push r17 2c948: cf 93 push r28 2c94a: df 93 push r29 2c94c: c0 91 6f 02 lds r28, 0x026F ; 0x80026f 2c950: d0 91 70 02 lds r29, 0x0270 ; 0x800270 2c954: 82 ec ldi r24, 0xC2 ; 194 2c956: e8 2e mov r14, r24 2c958: 8d e0 ldi r24, 0x0D ; 13 2c95a: f8 2e mov r15, r24 2c95c: 0e e4 ldi r16, 0x4E ; 78 2c95e: 15 e0 ldi r17, 0x05 ; 5 2c960: 6e 01 movw r12, r28 2c962: 80 e1 ldi r24, 0x10 ; 16 2c964: c8 0e add r12, r24 2c966: 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]; 2c968: 69 91 ld r22, Y+ 2c96a: 79 91 ld r23, Y+ 2c96c: 89 91 ld r24, Y+ 2c96e: 99 91 ld r25, Y+ 2c970: f7 01 movw r30, r14 2c972: 81 90 ld r8, Z+ 2c974: 91 90 ld r9, Z+ 2c976: a1 90 ld r10, Z+ 2c978: b1 90 ld r11, Z+ 2c97a: 7f 01 movw r14, r30 2c97c: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 2c980: a5 01 movw r20, r10 2c982: 94 01 movw r18, r8 2c984: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2c988: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 2c98c: f8 01 movw r30, r16 2c98e: 61 93 st Z+, r22 2c990: 71 93 st Z+, r23 2c992: 81 93 st Z+, r24 2c994: 91 93 st Z+, r25 2c996: 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++) 2c998: cc 15 cp r28, r12 2c99a: dd 05 cpc r29, r13 2c99c: 29 f7 brne .-54 ; 0x2c968 max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 2c99e: df 91 pop r29 2c9a0: cf 91 pop r28 2c9a2: 1f 91 pop r17 2c9a4: 0f 91 pop r16 2c9a6: ff 90 pop r15 2c9a8: ef 90 pop r14 2c9aa: df 90 pop r13 2c9ac: cf 90 pop r12 2c9ae: bf 90 pop r11 2c9b0: af 90 pop r10 2c9b2: 9f 90 pop r9 2c9b4: 8f 90 pop r8 2c9b6: 08 95 ret 0002c9b8 : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 2c9b8: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 2c9bc: 81 11 cpse r24, r1 2c9be: 0e c0 rjmp .+28 ; 0x2c9dc { max_feedrate = cs.max_feedrate_normal; 2c9c0: 82 ed ldi r24, 0xD2 ; 210 2c9c2: 9d e0 ldi r25, 0x0D ; 13 2c9c4: 90 93 72 02 sts 0x0272, r25 ; 0x800272 2c9c8: 80 93 71 02 sts 0x0271, r24 ; 0x800271 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 2c9cc: 82 ee ldi r24, 0xE2 ; 226 2c9ce: 9d e0 ldi r25, 0x0D ; 13 } 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; 2c9d0: 90 93 70 02 sts 0x0270, r25 ; 0x800270 2c9d4: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } reset_acceleration_rates(); 2c9d8: 0d 94 9a 64 jmp 0x2c934 ; 0x2c934 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) 2c9dc: 81 30 cpi r24, 0x01 ; 1 2c9de: e1 f7 brne .-8 ; 0x2c9d8 { max_feedrate = cs.max_feedrate_silent; 2c9e0: 8a e5 ldi r24, 0x5A ; 90 2c9e2: 9e e0 ldi r25, 0x0E ; 14 2c9e4: 90 93 72 02 sts 0x0272, r25 ; 0x800272 2c9e8: 80 93 71 02 sts 0x0271, r24 ; 0x800271 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 2c9ec: 8a e6 ldi r24, 0x6A ; 106 2c9ee: 9e e0 ldi r25, 0x0E ; 14 2c9f0: ef cf rjmp .-34 ; 0x2c9d0 0002c9f2 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2c9f2: fc 01 movw r30, r24 2c9f4: 40 81 ld r20, Z 2c9f6: 51 81 ldd r21, Z+1 ; 0x01 2c9f8: 62 81 ldd r22, Z+2 ; 0x02 2c9fa: 73 81 ldd r23, Z+3 ; 0x03 2c9fc: 40 93 d9 04 sts 0x04D9, r20 ; 0x8004d9 2ca00: 50 93 da 04 sts 0x04DA, r21 ; 0x8004da 2ca04: 60 93 db 04 sts 0x04DB, r22 ; 0x8004db 2ca08: 70 93 dc 04 sts 0x04DC, r23 ; 0x8004dc #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2ca0c: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 2ca10: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 2ca14: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 2ca18: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 2ca1c: 60 81 ld r22, Z 2ca1e: 71 81 ldd r23, Z+1 ; 0x01 2ca20: 82 81 ldd r24, Z+2 ; 0x02 2ca22: 93 81 ldd r25, Z+3 ; 0x03 2ca24: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2ca28: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 2ca2c: e3 ea ldi r30, 0xA3 ; 163 2ca2e: f6 e0 ldi r31, 0x06 ; 6 2ca30: 64 87 std Z+12, r22 ; 0x0c 2ca32: 75 87 std Z+13, r23 ; 0x0d 2ca34: 86 87 std Z+14, r24 ; 0x0e 2ca36: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2ca38: 8f b7 in r24, 0x3f ; 63 2ca3a: f8 94 cli count_position[E_AXIS] = e; 2ca3c: 44 85 ldd r20, Z+12 ; 0x0c 2ca3e: 55 85 ldd r21, Z+13 ; 0x0d 2ca40: 66 85 ldd r22, Z+14 ; 0x0e 2ca42: 77 85 ldd r23, Z+15 ; 0x0f 2ca44: 40 93 bf 06 sts 0x06BF, r20 ; 0x8006bf 2ca48: 50 93 c0 06 sts 0x06C0, r21 ; 0x8006c0 2ca4c: 60 93 c1 06 sts 0x06C1, r22 ; 0x8006c1 2ca50: 70 93 c2 06 sts 0x06C2, r23 ; 0x8006c2 CRITICAL_SECTION_END; 2ca54: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2ca56: 08 95 ret 0002ca58 : // 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; 2ca58: fc 01 movw r30, r24 2ca5a: 40 81 ld r20, Z 2ca5c: 51 81 ldd r21, Z+1 ; 0x01 2ca5e: 62 81 ldd r22, Z+2 ; 0x02 2ca60: 73 81 ldd r23, Z+3 ; 0x03 2ca62: 40 93 d5 04 sts 0x04D5, r20 ; 0x8004d5 2ca66: 50 93 d6 04 sts 0x04D6, r21 ; 0x8004d6 2ca6a: 60 93 d7 04 sts 0x04D7, r22 ; 0x8004d7 2ca6e: 70 93 d8 04 sts 0x04D8, r23 ; 0x8004d8 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2ca72: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2ca76: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2ca7a: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2ca7e: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2ca82: 60 81 ld r22, Z 2ca84: 71 81 ldd r23, Z+1 ; 0x01 2ca86: 82 81 ldd r24, Z+2 ; 0x02 2ca88: 93 81 ldd r25, Z+3 ; 0x03 2ca8a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2ca8e: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 2ca92: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 2ca96: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 2ca9a: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 2ca9e: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae st_set_position(position); 2caa2: 0d 94 23 88 jmp 0x31046 ; 0x31046 0002caa6 : * 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) { 2caa6: 2f 92 push r2 2caa8: 3f 92 push r3 2caaa: 4f 92 push r4 2caac: 5f 92 push r5 2caae: 6f 92 push r6 2cab0: 7f 92 push r7 2cab2: 8f 92 push r8 2cab4: 9f 92 push r9 2cab6: af 92 push r10 2cab8: bf 92 push r11 2caba: cf 92 push r12 2cabc: df 92 push r13 2cabe: ef 92 push r14 2cac0: ff 92 push r15 2cac2: 0f 93 push r16 2cac4: 1f 93 push r17 2cac6: cf 93 push r28 2cac8: df 93 push r29 2caca: cd b7 in r28, 0x3d ; 61 2cacc: de b7 in r29, 0x3e ; 62 2cace: c2 54 subi r28, 0x42 ; 66 2cad0: d1 09 sbc r29, r1 2cad2: 0f b6 in r0, 0x3f ; 63 2cad4: f8 94 cli 2cad6: de bf out 0x3e, r29 ; 62 2cad8: 0f be out 0x3f, r0 ; 63 2cada: cd bf out 0x3d, r28 ; 61 2cadc: 4c 01 movw r8, r24 2cade: 5b 01 movw r10, r22 2cae0: 6a 01 movw r12, r20 2cae2: 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) {} 2cae4: 19 82 std Y+1, r1 ; 0x01 2cae6: 1c 82 std Y+4, r1 ; 0x04 2cae8: 1c 8e std Y+28, r1 ; 0x1c 2caea: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 2caec: 67 2b or r22, r23 2caee: 21 f5 brne .+72 ; 0x2cb38 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 2caf0: 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; 2caf2: ce 01 movw r24, r28 2caf4: 4c 96 adiw r24, 0x1c ; 28 2caf6: 0e 94 b1 76 call 0xed62 ; 0xed62 2cafa: ce 01 movw r24, r28 2cafc: 01 96 adiw r24, 0x01 ; 1 2cafe: 0e 94 b1 76 call 0xed62 ; 0xed62 } return open(parent, dname, oflag); fail: return false; } 2cb02: 81 2f mov r24, r17 2cb04: ce 5b subi r28, 0xBE ; 190 2cb06: df 4f sbci r29, 0xFF ; 255 2cb08: 0f b6 in r0, 0x3f ; 63 2cb0a: f8 94 cli 2cb0c: de bf out 0x3e, r29 ; 62 2cb0e: 0f be out 0x3f, r0 ; 63 2cb10: cd bf out 0x3d, r28 ; 61 2cb12: df 91 pop r29 2cb14: cf 91 pop r28 2cb16: 1f 91 pop r17 2cb18: 0f 91 pop r16 2cb1a: ff 90 pop r15 2cb1c: ef 90 pop r14 2cb1e: df 90 pop r13 2cb20: cf 90 pop r12 2cb22: bf 90 pop r11 2cb24: af 90 pop r10 2cb26: 9f 90 pop r9 2cb28: 8f 90 pop r8 2cb2a: 7f 90 pop r7 2cb2c: 6f 90 pop r6 2cb2e: 5f 90 pop r5 2cb30: 4f 90 pop r4 2cb32: 3f 90 pop r3 2cb34: 2f 90 pop r2 2cb36: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 2cb38: fc 01 movw r30, r24 2cb3a: 83 81 ldd r24, Z+3 ; 0x03 2cb3c: 81 11 cpse r24, r1 2cb3e: d8 cf rjmp .-80 ; 0x2caf0 if (*path == '/') { 2cb40: fa 01 movw r30, r20 2cb42: 80 81 ld r24, Z 2cb44: 8f 32 cpi r24, 0x2F ; 47 2cb46: c1 f4 brne .+48 ; 0x2cb78 2cb48: ca 01 movw r24, r20 2cb4a: 6c 01 movw r12, r24 2cb4c: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 2cb4e: f6 01 movw r30, r12 2cb50: 20 81 ld r18, Z 2cb52: 2f 32 cpi r18, 0x2F ; 47 2cb54: d1 f3 breq .-12 ; 0x2cb4a 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; 2cb56: f5 01 movw r30, r10 2cb58: 83 81 ldd r24, Z+3 ; 0x03 2cb5a: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 2cb5c: 82 30 cpi r24, 0x02 ; 2 2cb5e: 60 f0 brcs .+24 ; 0x2cb78 if (!dir2.openRoot(dirFile->vol_)) goto fail; 2cb60: 61 8d ldd r22, Z+25 ; 0x19 2cb62: 72 8d ldd r23, Z+26 ; 0x1a 2cb64: ce 01 movw r24, r28 2cb66: 4c 96 adiw r24, 0x1c ; 28 2cb68: 0f 94 04 57 call 0x2ae08 ; 0x2ae08 parent = &dir2; 2cb6c: 8e 01 movw r16, r28 2cb6e: 04 5e subi r16, 0xE4 ; 228 2cb70: 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; 2cb72: 81 11 cpse r24, r1 2cb74: 02 c0 rjmp .+4 ; 0x2cb7a 2cb76: bc cf rjmp .-136 ; 0x2caf0 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 2cb78: 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; 2cb7a: ce 01 movw r24, r28 2cb7c: 01 96 adiw r24, 0x01 ; 1 2cb7e: 7c 01 movw r14, r24 2cb80: 3c 01 movw r6, r24 2cb82: 2e 01 movw r4, r28 2cb84: 9c e1 ldi r25, 0x1C ; 28 2cb86: 49 0e add r4, r25 2cb88: 51 1c adc r5, r1 2cb8a: 23 96 adiw r28, 0x03 ; 3 2cb8c: ef ae std Y+63, r14 ; 0x3f 2cb8e: 23 97 sbiw r28, 0x03 ; 3 2cb90: 2f 2c mov r2, r15 2cb92: fe 01 movw r30, r28 2cb94: f7 96 adiw r30, 0x37 ; 55 2cb96: cf 01 movw r24, r30 2cb98: 0b 96 adiw r24, 0x0b ; 11 2cb9a: 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++] = ' '; 2cb9c: 20 e2 ldi r18, 0x20 ; 32 2cb9e: 21 93 st Z+, r18 2cba0: e8 17 cp r30, r24 2cba2: f9 07 cpc r31, r25 2cba4: d9 f7 brne .-10 ; 0x2cb9c 2cba6: 96 01 movw r18, r12 i = 0; 2cba8: 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 2cbaa: 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 != '/') { 2cbac: d9 01 movw r26, r18 2cbae: 8d 91 ld r24, X+ 2cbb0: 88 23 and r24, r24 2cbb2: 49 f1 breq .+82 ; 0x2cc06 2cbb4: 8f 32 cpi r24, 0x2F ; 47 2cbb6: 39 f1 breq .+78 ; 0x2cc06 c = *str++; 2cbb8: 28 2f mov r18, r24 if (c == '.') { 2cbba: 8e 32 cpi r24, 0x2E ; 46 2cbbc: 39 f4 brne .+14 ; 0x2cbcc if (n == 10) goto fail; // only one dot allowed 2cbbe: 6a 30 cpi r22, 0x0A ; 10 2cbc0: 09 f4 brne .+2 ; 0x2cbc4 2cbc2: 96 cf rjmp .-212 ; 0x2caf0 n = 10; // max index for full 8.3 name i = 8; // place for extension 2cbc4: 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 2cbc6: 6a e0 ldi r22, 0x0A ; 10 2cbc8: 9d 01 movw r18, r26 2cbca: f0 cf rjmp .-32 ; 0x2cbac 2cbcc: e0 e6 ldi r30, 0x60 ; 96 2cbce: f1 e9 ldi r31, 0x91 ; 145 //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; 2cbd0: 34 91 lpm r19, Z 2cbd2: 33 23 and r19, r19 2cbd4: 21 f0 breq .+8 ; 0x2cbde 2cbd6: 31 96 adiw r30, 0x01 ; 1 2cbd8: 83 13 cpse r24, r19 2cbda: fa cf rjmp .-12 ; 0x2cbd0 2cbdc: 89 cf rjmp .-238 ; 0x2caf0 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 2cbde: 69 17 cp r22, r25 2cbe0: 08 f4 brcc .+2 ; 0x2cbe4 2cbe2: 86 cf rjmp .-244 ; 0x2caf0 2cbe4: 3f ed ldi r19, 0xDF ; 223 2cbe6: 38 0f add r19, r24 2cbe8: 3e 35 cpi r19, 0x5E ; 94 2cbea: 08 f0 brcs .+2 ; 0x2cbee 2cbec: 81 cf rjmp .-254 ; 0x2caf0 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 2cbee: 3f e9 ldi r19, 0x9F ; 159 2cbf0: 38 0f add r19, r24 2cbf2: 3a 31 cpi r19, 0x1A ; 26 2cbf4: 10 f4 brcc .+4 ; 0x2cbfa 2cbf6: 20 ee ldi r18, 0xE0 ; 224 2cbf8: 28 0f add r18, r24 2cbfa: fa 01 movw r30, r20 2cbfc: e9 0f add r30, r25 2cbfe: f1 1d adc r31, r1 2cc00: 20 83 st Z, r18 2cc02: 9f 5f subi r25, 0xFF ; 255 2cc04: e1 cf rjmp .-62 ; 0x2cbc8 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 2cc06: 8f a9 ldd r24, Y+55 ; 0x37 2cc08: 80 32 cpi r24, 0x20 ; 32 2cc0a: 09 f4 brne .+2 ; 0x2cc0e 2cc0c: 71 cf rjmp .-286 ; 0x2caf0 2cc0e: 69 01 movw r12, r18 while (*path == '/') path++; 2cc10: f9 01 movw r30, r18 2cc12: 80 81 ld r24, Z 2cc14: 2f 5f subi r18, 0xFF ; 255 2cc16: 3f 4f sbci r19, 0xFF ; 255 2cc18: 8f 32 cpi r24, 0x2F ; 47 2cc1a: c9 f3 breq .-14 ; 0x2cc0e if (!*path) break; 2cc1c: 88 23 and r24, r24 2cc1e: d9 f0 breq .+54 ; 0x2cc56 if (!sub->open(parent, dname, O_READ)) goto fail; 2cc20: 21 e0 ldi r18, 0x01 ; 1 2cc22: b8 01 movw r22, r16 2cc24: c7 01 movw r24, r14 2cc26: 0f 94 72 5b call 0x2b6e4 ; 0x2b6e4 2cc2a: 88 23 and r24, r24 2cc2c: 09 f4 brne .+2 ; 0x2cc30 2cc2e: 60 cf rjmp .-320 ; 0x2caf0 if (parent != dirFile) parent->close(); 2cc30: 0a 15 cp r16, r10 2cc32: 1b 05 cpc r17, r11 2cc34: 19 f0 breq .+6 ; 0x2cc3c 2cc36: c8 01 movw r24, r16 2cc38: 0f 94 ab 59 call 0x2b356 ; 0x2b356 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 2cc3c: 94 2d mov r25, r4 2cc3e: 85 2d mov r24, r5 2cc40: 6e 14 cp r6, r14 2cc42: 7f 04 cpc r7, r15 2cc44: 21 f0 breq .+8 ; 0x2cc4e 2cc46: 23 96 adiw r28, 0x03 ; 3 2cc48: 9f ad ldd r25, Y+63 ; 0x3f 2cc4a: 23 97 sbiw r28, 0x03 ; 3 2cc4c: 82 2d mov r24, r2 2cc4e: 87 01 movw r16, r14 2cc50: e9 2e mov r14, r25 2cc52: f8 2e mov r15, r24 2cc54: 9e cf rjmp .-196 ; 0x2cb92 } return open(parent, dname, oflag); 2cc56: 23 2d mov r18, r3 2cc58: b8 01 movw r22, r16 2cc5a: c4 01 movw r24, r8 2cc5c: 0f 94 72 5b call 0x2b6e4 ; 0x2b6e4 2cc60: 18 2f mov r17, r24 2cc62: 47 cf rjmp .-370 ; 0x2caf2 0002cc64 : 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){ 2cc64: 2f 92 push r2 2cc66: 3f 92 push r3 2cc68: 4f 92 push r4 2cc6a: 5f 92 push r5 2cc6c: 6f 92 push r6 2cc6e: 7f 92 push r7 2cc70: 8f 92 push r8 2cc72: 9f 92 push r9 2cc74: af 92 push r10 2cc76: bf 92 push r11 2cc78: cf 92 push r12 2cc7a: df 92 push r13 2cc7c: ef 92 push r14 2cc7e: ff 92 push r15 2cc80: 0f 93 push r16 2cc82: 1f 93 push r17 2cc84: cf 93 push r28 2cc86: df 93 push r29 2cc88: 00 d0 rcall .+0 ; 0x2cc8a 2cc8a: 1f 92 push r1 2cc8c: 1f 92 push r1 2cc8e: cd b7 in r28, 0x3d ; 61 2cc90: de b7 in r29, 0x3e ; 62 2cc92: 1c 01 movw r2, r24 2cc94: 2a 01 movw r4, r20 2cc96: 3b 01 movw r6, r22 2cc98: 00 e2 ldi r16, 0x20 ; 32 2cc9a: 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){ 2cc9c: 19 82 std Y+1, r1 ; 0x01 2cc9e: 99 81 ldd r25, Y+1 ; 0x01 2cca0: 89 2f mov r24, r25 2cca2: 90 e0 ldi r25, 0x00 ; 0 2cca4: 9b 83 std Y+3, r25 ; 0x03 2cca6: 8a 83 std Y+2, r24 ; 0x02 2cca8: 80 17 cp r24, r16 2ccaa: 91 07 cpc r25, r17 2ccac: 9c f5 brge .+102 ; 0x2cd14 if (points[j] > points[j + 1]) 2ccae: 88 0f add r24, r24 2ccb0: 99 1f adc r25, r25 2ccb2: 88 0f add r24, r24 2ccb4: 99 1f adc r25, r25 2ccb6: 9d 83 std Y+5, r25 ; 0x05 2ccb8: 8c 83 std Y+4, r24 ; 0x04 2ccba: 82 0d add r24, r2 2ccbc: 93 1d adc r25, r3 2ccbe: 9b 83 std Y+3, r25 ; 0x03 2ccc0: 8a 83 std Y+2, r24 ; 0x02 2ccc2: fc 01 movw r30, r24 2ccc4: c0 80 ld r12, Z 2ccc6: d1 80 ldd r13, Z+1 ; 0x01 2ccc8: e2 80 ldd r14, Z+2 ; 0x02 2ccca: f3 80 ldd r15, Z+3 ; 0x03 2cccc: 8c 81 ldd r24, Y+4 ; 0x04 2ccce: 9d 81 ldd r25, Y+5 ; 0x05 2ccd0: 04 96 adiw r24, 0x04 ; 4 2ccd2: 82 0d add r24, r2 2ccd4: 93 1d adc r25, r3 2ccd6: 9d 83 std Y+5, r25 ; 0x05 2ccd8: 8c 83 std Y+4, r24 ; 0x04 2ccda: fc 01 movw r30, r24 2ccdc: 80 80 ld r8, Z 2ccde: 91 80 ldd r9, Z+1 ; 0x01 2cce0: a2 80 ldd r10, Z+2 ; 0x02 2cce2: b3 80 ldd r11, Z+3 ; 0x03 2cce4: a5 01 movw r20, r10 2cce6: 94 01 movw r18, r8 2cce8: c7 01 movw r24, r14 2ccea: b6 01 movw r22, r12 2ccec: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2ccf0: 18 16 cp r1, r24 2ccf2: 64 f4 brge .+24 ; 0x2cd0c SWAP(points[j], points[j + 1]); 2ccf4: ea 81 ldd r30, Y+2 ; 0x02 2ccf6: fb 81 ldd r31, Y+3 ; 0x03 2ccf8: 80 82 st Z, r8 2ccfa: 91 82 std Z+1, r9 ; 0x01 2ccfc: a2 82 std Z+2, r10 ; 0x02 2ccfe: b3 82 std Z+3, r11 ; 0x03 2cd00: ec 81 ldd r30, Y+4 ; 0x04 2cd02: fd 81 ldd r31, Y+5 ; 0x05 2cd04: c0 82 st Z, r12 2cd06: d1 82 std Z+1, r13 ; 0x01 2cd08: e2 82 std Z+2, r14 ; 0x02 2cd0a: 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){ 2cd0c: f9 81 ldd r31, Y+1 ; 0x01 2cd0e: ff 5f subi r31, 0xFF ; 255 2cd10: f9 83 std Y+1, r31 ; 0x01 2cd12: c5 cf rjmp .-118 ; 0x2cc9e 2cd14: 01 50 subi r16, 0x01 ; 1 2cd16: 11 09 sbc r17, r1 2cd18: 08 f6 brcc .-126 ; 0x2cc9c /// 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]; 2cd1a: f1 01 movw r30, r2 2cd1c: e0 5c subi r30, 0xC0 ; 192 2cd1e: 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); 2cd20: 20 81 ld r18, Z 2cd22: 31 81 ldd r19, Z+1 ; 0x01 2cd24: 42 81 ldd r20, Z+2 ; 0x02 2cd26: 53 81 ldd r21, Z+3 ; 0x03 2cd28: c3 01 movw r24, r6 2cd2a: b2 01 movw r22, r4 2cd2c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2cd30: 6b 01 movw r12, r22 2cd32: 7c 01 movw r14, r24 2cd34: 20 e0 ldi r18, 0x00 ; 0 2cd36: 30 e0 ldi r19, 0x00 ; 0 2cd38: 40 e0 ldi r20, 0x00 ; 0 2cd3a: 5f eb ldi r21, 0xBF ; 191 2cd3c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2cd40: 87 fd sbrc r24, 7 2cd42: 10 c0 rjmp .+32 ; 0x2cd64 2cd44: 20 e0 ldi r18, 0x00 ; 0 2cd46: 30 e0 ldi r19, 0x00 ; 0 2cd48: 40 e0 ldi r20, 0x00 ; 0 2cd4a: 5f e3 ldi r21, 0x3F ; 63 2cd4c: c7 01 movw r24, r14 2cd4e: b6 01 movw r22, r12 2cd50: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2cd54: 18 16 cp r1, r24 2cd56: 5c f4 brge .+22 ; 0x2cd6e 2cd58: c1 2c mov r12, r1 2cd5a: d1 2c mov r13, r1 2cd5c: e1 2c mov r14, r1 2cd5e: 8f e3 ldi r24, 0x3F ; 63 2cd60: f8 2e mov r15, r24 2cd62: 05 c0 rjmp .+10 ; 0x2cd6e 2cd64: c1 2c mov r12, r1 2cd66: d1 2c mov r13, r1 2cd68: e1 2c mov r14, r1 2cd6a: 9f eb ldi r25, 0xBF ; 191 2cd6c: f9 2e mov r15, r25 } 2cd6e: c7 01 movw r24, r14 2cd70: b6 01 movw r22, r12 2cd72: 0f 90 pop r0 2cd74: 0f 90 pop r0 2cd76: 0f 90 pop r0 2cd78: 0f 90 pop r0 2cd7a: 0f 90 pop r0 2cd7c: df 91 pop r29 2cd7e: cf 91 pop r28 2cd80: 1f 91 pop r17 2cd82: 0f 91 pop r16 2cd84: ff 90 pop r15 2cd86: ef 90 pop r14 2cd88: df 90 pop r13 2cd8a: cf 90 pop r12 2cd8c: bf 90 pop r11 2cd8e: af 90 pop r10 2cd90: 9f 90 pop r9 2cd92: 8f 90 pop r8 2cd94: 7f 90 pop r7 2cd96: 6f 90 pop r6 2cd98: 5f 90 pop r5 2cd9a: 4f 90 pop r4 2cd9c: 3f 90 pop r3 2cd9e: 2f 90 pop r2 2cda0: 08 95 ret 0002cda2 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2cda2: 0f 94 51 2a call 0x254a2 ; 0x254a2 2cda6: 60 93 5a 13 sts 0x135A, r22 ; 0x80135a 2cdaa: 70 93 5b 13 sts 0x135B, r23 ; 0x80135b 2cdae: 80 93 5c 13 sts 0x135C, r24 ; 0x80135c 2cdb2: 90 93 5d 13 sts 0x135D, r25 ; 0x80135d } 2cdb6: 08 95 ret 0002cdb8 : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2cdb8: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 2cdbc: 88 23 and r24, r24 2cdbe: 69 f0 breq .+26 ; 0x2cdda 2cdc0: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 2cdc4: 88 23 and r24, r24 2cdc6: 49 f0 breq .+18 ; 0x2cdda SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2cdc8: 89 e4 ldi r24, 0x49 ; 73 2cdca: 9a ea ldi r25, 0xAA ; 170 2cdcc: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 retryAttempts--; 2cdd0: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 2cdd4: 81 50 subi r24, 0x01 ; 1 2cdd6: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f } } 2cdda: 08 95 ret 0002cddc : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2cddc: 9f 92 push r9 2cdde: af 92 push r10 2cde0: bf 92 push r11 2cde2: cf 92 push r12 2cde4: df 92 push r13 2cde6: ef 92 push r14 2cde8: ff 92 push r15 2cdea: 0f 93 push r16 2cdec: 1f 93 push r17 2cdee: cf 93 push r28 2cdf0: df 93 push r29 2cdf2: cd b7 in r28, 0x3d ; 61 2cdf4: de b7 in r29, 0x3e ; 62 2cdf6: e0 97 sbiw r28, 0x30 ; 48 2cdf8: 0f b6 in r0, 0x3f ; 63 2cdfa: f8 94 cli 2cdfc: de bf out 0x3e, r29 ; 62 2cdfe: 0f be out 0x3f, r0 ; 63 2ce00: cd bf out 0x3d, r28 ; 61 2ce02: 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()]; 2ce04: e0 90 88 13 lds r14, 0x1388 ; 0x801388 2ce08: fe 01 movw r30, r28 2ce0a: 31 96 adiw r30, 0x01 ; 1 2ce0c: 21 e0 ldi r18, 0x01 ; 1 2ce0e: 30 e0 ldi r19, 0x00 ; 0 2ce10: 5f 01 movw r10, r30 2ce12: f1 2c mov r15, r1 2ce14: 40 e1 ldi r20, 0x10 ; 16 2ce16: c4 2e mov r12, r20 2ce18: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2ce1a: 50 e2 ldi r21, 0x20 ; 32 2ce1c: 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()]; 2ce1e: c7 01 movw r24, r14 2ce20: 82 1b sub r24, r18 2ce22: 93 0b sbc r25, r19 2ce24: b6 01 movw r22, r12 2ce26: 0f 94 31 dd call 0x3ba62 ; 0x3ba62 <__divmodhi4> 2ce2a: dc 01 movw r26, r24 2ce2c: bb 27 eor r27, r27 2ce2e: a5 5b subi r26, 0xB5 ; 181 2ce30: bc 4e sbci r27, 0xEC ; 236 2ce32: 9d 96 adiw r26, 0x2d ; 45 2ce34: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2ce36: 48 2f mov r20, r24 2ce38: 50 e0 ldi r21, 0x00 ; 0 2ce3a: 94 e0 ldi r25, 0x04 ; 4 2ce3c: 55 95 asr r21 2ce3e: 47 95 ror r20 2ce40: 9a 95 dec r25 2ce42: e1 f7 brne .-8 ; 0x2ce3c lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2ce44: 96 ef ldi r25, 0xF6 ; 246 2ce46: 94 0f add r25, r20 2ce48: 96 30 cpi r25, 0x06 ; 6 2ce4a: a8 f1 brcs .+106 ; 0x2ceb6 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2ce4c: 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); 2ce4e: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2ce50: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2ce52: 96 ef ldi r25, 0xF6 ; 246 2ce54: 98 0f add r25, r24 2ce56: 96 30 cpi r25, 0x06 ; 6 2ce58: 80 f1 brcs .+96 ; 0x2ceba case 5: case 6: case 7: case 8: case 9: return c + '0'; 2ce5a: 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); 2ce5c: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2ce5e: 92 82 std Z+2, r9 ; 0x02 2ce60: 2f 5f subi r18, 0xFF ; 255 2ce62: 3f 4f sbci r19, 0xFF ; 255 2ce64: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2ce66: 21 31 cpi r18, 0x11 ; 17 2ce68: 31 05 cpc r19, r1 2ce6a: c9 f6 brne .-78 ; 0x2ce1e 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 2ce6c: 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); 2ce6e: 82 ec ldi r24, 0xC2 ; 194 2ce70: 9a ea ldi r25, 0xAA ; 170 2ce72: 0e 94 d0 76 call 0xeda0 ; 0xeda0 2ce76: 8c eb ldi r24, 0xBC ; 188 2ce78: 9a ea ldi r25, 0xAA ; 170 2ce7a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 2ce7e: c8 01 movw r24, r16 2ce80: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOPGM(", last bytes: "); 2ce84: 84 e7 ldi r24, 0x74 ; 116 2ce86: 9a ea ldi r25, 0xAA ; 170 2ce88: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(lrb); 2ce8c: c5 01 movw r24, r10 2ce8e: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 } 2ce92: e0 96 adiw r28, 0x30 ; 48 2ce94: 0f b6 in r0, 0x3f ; 63 2ce96: f8 94 cli 2ce98: de bf out 0x3e, r29 ; 62 2ce9a: 0f be out 0x3f, r0 ; 63 2ce9c: cd bf out 0x3d, r28 ; 61 2ce9e: df 91 pop r29 2cea0: cf 91 pop r28 2cea2: 1f 91 pop r17 2cea4: 0f 91 pop r16 2cea6: ff 90 pop r15 2cea8: ef 90 pop r14 2ceaa: df 90 pop r13 2ceac: cf 90 pop r12 2ceae: bf 90 pop r11 2ceb0: af 90 pop r10 2ceb2: 9f 90 pop r9 2ceb4: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2ceb6: 49 5a subi r20, 0xA9 ; 169 2ceb8: ca cf rjmp .-108 ; 0x2ce4e 2ceba: 89 5a subi r24, 0xA9 ; 169 2cebc: cf cf rjmp .-98 ; 0x2ce5c 0002cebe : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2cebe: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2cec0: 90 91 5f 13 lds r25, 0x135F ; 0x80135f 2cec4: 9a 30 cpi r25, 0x0A ; 10 2cec6: 11 f4 brne .+4 ; 0x2cecc cause = ss; 2cec8: 60 93 5e 13 sts 0x135E, r22 ; 0x80135e } --occurrences; 2cecc: 91 50 subi r25, 0x01 ; 1 2cece: 90 93 5f 13 sts 0x135F, r25 ; 0x80135f FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2ced2: 91 11 cpse r25, r1 2ced4: 0d c0 rjmp .+26 ; 0x2cef0 2ced6: c9 01 movw r24, r18 LogError(msg_P); 2ced8: 0f 94 ee 66 call 0x2cddc ; 0x2cddc SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2cedc: 85 e6 ldi r24, 0x65 ; 101 2cede: 9a ea ldi r25, 0xAA ; 170 2cee0: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 /// @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; } 2cee4: 8a e0 ldi r24, 0x0A ; 10 2cee6: 80 93 5f 13 sts 0x135F, r24 ; 0x80135f 2ceea: 80 91 5e 13 lds r24, 0x135E ; 0x80135e 2ceee: 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 2cef0: 80 e0 ldi r24, 0x00 ; 0 } } 2cef2: 08 95 ret 0002cef4 : } *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) { 2cef4: cf 93 push r28 2cef6: df 93 push r29 2cef8: cd b7 in r28, 0x3d ; 61 2cefa: de b7 in r29, 0x3e ; 62 2cefc: 2e 97 sbiw r28, 0x0e ; 14 2cefe: 0f b6 in r0, 0x3f ; 63 2cf00: f8 94 cli 2cf02: de bf out 0x3e, r29 ; 62 2cf04: 0f be out 0x3f, r0 ; 63 2cf06: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2cf08: 2e e3 ldi r18, 0x3E ; 62 2cf0a: 30 e0 ldi r19, 0x00 ; 0 2cf0c: 3a 83 std Y+2, r19 ; 0x02 2cf0e: 29 83 std Y+1, r18 ; 0x01 2cf10: fe 01 movw r30, r28 2cf12: 33 96 adiw r30, 0x03 ; 3 2cf14: 2c e0 ldi r18, 0x0C ; 12 2cf16: df 01 movw r26, r30 2cf18: 1d 92 st X+, r1 2cf1a: 2a 95 dec r18 2cf1c: e9 f7 brne .-6 ; 0x2cf18 2cf1e: de 01 movw r26, r28 2cf20: 12 96 adiw r26, 0x02 ; 2 2cf22: 48 2f mov r20, r24 2cf24: fc 01 movw r30, r24 2cf26: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2cf28: 8e 2f mov r24, r30 2cf2a: 84 1b sub r24, r20 2cf2c: 86 17 cp r24, r22 2cf2e: 40 f4 brcc .+16 ; 0x2cf40 uint8_t b = txbuff[i]; 2cf30: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2cf32: 90 ee ldi r25, 0xE0 ; 224 2cf34: 98 0f add r25, r24 2cf36: 90 36 cpi r25, 0x60 ; 96 2cf38: 08 f0 brcs .+2 ; 0x2cf3c b = '.'; 2cf3a: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2cf3c: 8d 93 st X+, r24 2cf3e: f4 cf rjmp .-24 ; 0x2cf28 } tmp[size + 1] = 0; 2cf40: f9 01 movw r30, r18 2cf42: e6 0f add r30, r22 2cf44: f1 1d adc r31, r1 2cf46: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2cf48: 4e e0 ldi r20, 0x0E ; 14 2cf4a: 50 e0 ldi r21, 0x00 ; 0 2cf4c: 68 ec ldi r22, 0xC8 ; 200 2cf4e: 7a ea ldi r23, 0xAA ; 170 2cf50: ce 01 movw r24, r28 2cf52: 01 96 adiw r24, 0x01 ; 1 2cf54: 0f 94 33 da call 0x3b466 ; 0x3b466 2cf58: 89 2b or r24, r25 2cf5a: 59 f4 brne .+22 ; 0x2cf72 2cf5c: 4e e0 ldi r20, 0x0E ; 14 2cf5e: 50 e0 ldi r21, 0x00 ; 0 2cf60: be 01 movw r22, r28 2cf62: 6f 5f subi r22, 0xFF ; 255 2cf64: 7f 4f sbci r23, 0xFF ; 255 2cf66: 82 ea ldi r24, 0xA2 ; 162 2cf68: 92 e1 ldi r25, 0x12 ; 18 2cf6a: 0f 94 c6 e2 call 0x3c58c ; 0x3c58c 2cf6e: 89 2b or r24, r25 2cf70: 61 f0 breq .+24 ; 0x2cf8a // 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); 2cf72: 82 ec ldi r24, 0xC2 ; 194 2cf74: 9a ea ldi r25, 0xAA ; 170 2cf76: 0e 94 d0 76 call 0xeda0 ; 0xeda0 2cf7a: 8c eb ldi r24, 0xBC ; 188 2cf7c: 9a ea ldi r25, 0xAA ; 170 2cf7e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 2cf82: ce 01 movw r24, r28 2cf84: 01 96 adiw r24, 0x01 ; 1 2cf86: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 } strncpy(lastMsg, tmp, rqs); 2cf8a: 4e e0 ldi r20, 0x0E ; 14 2cf8c: 50 e0 ldi r21, 0x00 ; 0 2cf8e: be 01 movw r22, r28 2cf90: 6f 5f subi r22, 0xFF ; 255 2cf92: 7f 4f sbci r23, 0xFF ; 255 2cf94: 82 ea ldi r24, 0xA2 ; 162 2cf96: 92 e1 ldi r25, 0x12 ; 18 2cf98: 0f 94 d4 e2 call 0x3c5a8 ; 0x3c5a8 } 2cf9c: 2e 96 adiw r28, 0x0e ; 14 2cf9e: 0f b6 in r0, 0x3f ; 63 2cfa0: f8 94 cli 2cfa2: de bf out 0x3e, r29 ; 62 2cfa4: 0f be out 0x3f, r0 ; 63 2cfa6: cd bf out 0x3d, r28 ; 61 2cfa8: df 91 pop r29 2cfaa: cf 91 pop r28 2cfac: 08 95 ret 0002cfae : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2cfae: cf 92 push r12 2cfb0: df 92 push r13 2cfb2: ef 92 push r14 2cfb4: ff 92 push r15 2cfb6: 1f 93 push r17 2cfb8: cf 93 push r28 2cfba: df 93 push r29 2cfbc: cd b7 in r28, 0x3d ; 61 2cfbe: de b7 in r29, 0x3e ; 62 2cfc0: 62 97 sbiw r28, 0x12 ; 18 2cfc2: 0f b6 in r0, 0x3f ; 63 2cfc4: f8 94 cli 2cfc6: de bf out 0x3e, r29 ; 62 2cfc8: 0f be out 0x3f, r0 ; 63 2cfca: cd bf out 0x3d, r28 ; 61 2cfcc: 4e 87 std Y+14, r20 ; 0x0e 2cfce: 5f 87 std Y+15, r21 ; 0x0f 2cfd0: 68 8b std Y+16, r22 ; 0x10 2cfd2: 79 8b std Y+17, r23 ; 0x11 2cfd4: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2cfd6: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2cfd8: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2cfda: 51 11 cpse r21, r1 2cfdc: 31 c0 rjmp .+98 ; 0x2d040 *dst = '0'; 2cfde: 80 e3 ldi r24, 0x30 ; 48 2cfe0: 8a 83 std Y+2, r24 ; 0x02 return 1; 2cfe2: 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); 2cfe4: e1 e0 ldi r30, 0x01 ; 1 2cfe6: e1 0f add r30, r17 2cfe8: 81 e0 ldi r24, 0x01 ; 1 2cfea: 90 e0 ldi r25, 0x00 ; 0 2cfec: 8c 0f add r24, r28 2cfee: 9d 1f adc r25, r29 2cff0: 8e 0f add r24, r30 2cff2: 91 1d adc r25, r1 2cff4: fc 01 movw r30, r24 2cff6: 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 2cff8: 9a e2 ldi r25, 0x2A ; 42 2cffa: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2cffc: 81 11 cpse r24, r1 2cffe: 27 c0 rjmp .+78 ; 0x2d04e *dst = '0'; 2d000: 80 e3 ldi r24, 0x30 ; 48 2d002: 81 83 std Z+1, r24 ; 0x01 return 1; 2d004: 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); 2d006: 1e 5f subi r17, 0xFE ; 254 2d008: 18 0f add r17, r24 txbuff[i] = '\n'; 2d00a: e1 e0 ldi r30, 0x01 ; 1 2d00c: f0 e0 ldi r31, 0x00 ; 0 2d00e: ec 0f add r30, r28 2d010: fd 1f adc r31, r29 2d012: e1 0f add r30, r17 2d014: f1 1d adc r31, r1 2d016: 8a e0 ldi r24, 0x0A ; 10 2d018: 80 83 st Z, r24 ++i; 2d01a: 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); 2d01c: fe 01 movw r30, r28 2d01e: 31 96 adiw r30, 0x01 ; 1 2d020: 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--){ 2d022: 6f 01 movw r12, r30 2d024: c1 0e add r12, r17 2d026: d1 1c adc r13, r1 2d028: ec 14 cp r14, r12 2d02a: fd 04 cpc r15, r13 2d02c: b1 f0 breq .+44 ; 0x2d05a fputc(*buffer, uart2io); 2d02e: f7 01 movw r30, r14 2d030: 81 91 ld r24, Z+ 2d032: 7f 01 movw r14, r30 2d034: 64 e9 ldi r22, 0x94 ; 148 2d036: 72 e1 ldi r23, 0x12 ; 18 2d038: 90 e0 ldi r25, 0x00 ; 0 2d03a: 0f 94 bc da call 0x3b578 ; 0x3b578 2d03e: f4 cf rjmp .-24 ; 0x2d028 2d040: be 01 movw r22, r28 2d042: 6e 5f subi r22, 0xFE ; 254 2d044: 7f 4f sbci r23, 0xFF ; 255 2d046: 0f 94 75 c5 call 0x38aea ; 0x38aea 2d04a: 18 2f mov r17, r24 2d04c: cb cf rjmp .-106 ; 0x2cfe4 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); 2d04e: bf 01 movw r22, r30 2d050: 6f 5f subi r22, 0xFF ; 255 2d052: 7f 4f sbci r23, 0xFF ; 255 2d054: 0f 94 75 c5 call 0x38aea ; 0x38aea 2d058: d6 cf rjmp .-84 ; 0x2d006 LogRequestMsg(txbuff, len); 2d05a: 61 2f mov r22, r17 2d05c: ce 01 movw r24, r28 2d05e: 01 96 adiw r24, 0x01 ; 1 2d060: 0f 94 7a 67 call 0x2cef4 ; 0x2cef4 RecordUARTActivity(); 2d064: 0f 94 d1 66 call 0x2cda2 ; 0x2cda2 } 2d068: 62 96 adiw r28, 0x12 ; 18 2d06a: 0f b6 in r0, 0x3f ; 63 2d06c: f8 94 cli 2d06e: de bf out 0x3e, r29 ; 62 2d070: 0f be out 0x3f, r0 ; 63 2d072: cd bf out 0x3d, r28 ; 61 2d074: df 91 pop r29 2d076: cf 91 pop r28 2d078: 1f 91 pop r17 2d07a: ff 90 pop r15 2d07c: ef 90 pop r14 2d07e: df 90 pop r13 2d080: cf 90 pop r12 2d082: 08 95 ret 0002d084 : 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) { 2d084: 8f 92 push r8 2d086: 9f 92 push r9 2d088: af 92 push r10 2d08a: bf 92 push r11 2d08c: df 92 push r13 2d08e: ef 92 push r14 2d090: ff 92 push r15 2d092: 0f 93 push r16 2d094: 1f 93 push r17 2d096: cf 93 push r28 2d098: df 93 push r29 2d09a: cd b7 in r28, 0x3d ; 61 2d09c: de b7 in r29, 0x3e ; 62 2d09e: 67 97 sbiw r28, 0x17 ; 23 2d0a0: 0f b6 in r0, 0x3f ; 63 2d0a2: f8 94 cli 2d0a4: de bf out 0x3e, r29 ; 62 2d0a6: 0f be out 0x3f, r0 ; 63 2d0a8: cd bf out 0x3d, r28 ; 61 2d0aa: 18 2f mov r17, r24 2d0ac: 7b 01 movw r14, r22 2d0ae: d4 2e mov r13, r20 2d0b0: 07 e5 ldi r16, 0x57 ; 87 2d0b2: 0b 8b std Y+19, r16 ; 0x13 2d0b4: 8c 8b std Y+20, r24 ; 0x14 2d0b6: 7e 8b std Y+22, r23 ; 0x16 2d0b8: 6d 8b std Y+21, r22 ; 0x15 2d0ba: ce 01 movw r24, r28 2d0bc: 43 96 adiw r24, 0x13 ; 19 2d0be: 0f 94 a1 c5 call 0x38b42 ; 0x38b42 2d0c2: 8f 8b std Y+23, r24 ; 0x17 2d0c4: 0e 87 std Y+14, r16 ; 0x0e 2d0c6: 1f 87 std Y+15, r17 ; 0x0f 2d0c8: f9 8a std Y+17, r15 ; 0x11 2d0ca: e8 8a std Y+16, r14 ; 0x10 2d0cc: ce 01 movw r24, r28 2d0ce: 0e 96 adiw r24, 0x0e ; 14 2d0d0: 0f 94 a1 c5 call 0x38b42 ; 0x38b42 2d0d4: 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; 2d0d6: 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) { 2d0d8: 11 11 cpse r17, r1 2d0da: 27 c0 rjmp .+78 ; 0x2d12a *dst = '0'; 2d0dc: 80 e3 ldi r24, 0x30 ; 48 2d0de: 8a 83 std Y+2, r24 ; 0x02 return 1; 2d0e0: 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); 2d0e2: e1 e0 ldi r30, 0x01 ; 1 2d0e4: e8 0f add r30, r24 dst[i] = ' '; 2d0e6: 21 e0 ldi r18, 0x01 ; 1 2d0e8: 30 e0 ldi r19, 0x00 ; 0 2d0ea: 2c 0f add r18, r28 2d0ec: 3d 1f adc r19, r29 2d0ee: 2e 0f add r18, r30 2d0f0: 31 1d adc r19, r1 2d0f2: f9 01 movw r30, r18 2d0f4: 90 e2 ldi r25, 0x20 ; 32 2d0f6: 90 83 st Z, r25 return i + 1; 2d0f8: 02 e0 ldi r16, 0x02 ; 2 2d0fa: 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); 2d0fc: aa 24 eor r10, r10 2d0fe: a3 94 inc r10 2d100: b1 2c mov r11, r1 2d102: ac 0e add r10, r28 2d104: bd 1e adc r11, r29 2d106: a0 0e add r10, r16 2d108: 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) { 2d10a: e1 14 cp r14, r1 2d10c: f1 04 cpc r15, r1 2d10e: 39 f1 breq .+78 ; 0x2d15e *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2d110: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2d112: c7 01 movw r24, r14 2d114: 88 27 eor r24, r24 2d116: 90 7f andi r25, 0xF0 ; 240 2d118: 89 2b or r24, r25 2d11a: 71 f4 brne .+28 ; 0x2d138 value <<= 4U; 2d11c: 24 e0 ldi r18, 0x04 ; 4 2d11e: ee 0c add r14, r14 2d120: ff 1c adc r15, r15 2d122: 2a 95 dec r18 2d124: e1 f7 brne .-8 ; 0x2d11e --charsOut; 2d126: 11 50 subi r17, 0x01 ; 1 2d128: f4 cf rjmp .-24 ; 0x2d112 2d12a: be 01 movw r22, r28 2d12c: 6e 5f subi r22, 0xFE ; 254 2d12e: 7f 4f sbci r23, 0xFF ; 255 2d130: 81 2f mov r24, r17 2d132: 0f 94 75 c5 call 0x38aea ; 0x38aea 2d136: d5 cf rjmp .-86 ; 0x2d0e2 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2d138: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2d13a: 88 2d mov r24, r8 2d13c: 8a 19 sub r24, r10 2d13e: 81 17 cp r24, r17 2d140: 90 f4 brcc .+36 ; 0x2d166 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2d142: 8f 2d mov r24, r15 2d144: 82 95 swap r24 2d146: 8f 70 andi r24, 0x0F ; 15 2d148: 94 e0 ldi r25, 0x04 ; 4 2d14a: ee 0c add r14, r14 2d14c: ff 1c adc r15, r15 2d14e: 9a 95 dec r25 2d150: e1 f7 brne .-8 ; 0x2d14a 2d152: 0f 94 6b c5 call 0x38ad6 ; 0x38ad6 2d156: f4 01 movw r30, r8 2d158: 81 93 st Z+, r24 2d15a: 4f 01 movw r8, r30 2d15c: ee cf rjmp .-36 ; 0x2d13a } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2d15e: 80 e3 ldi r24, 0x30 ; 48 2d160: f5 01 movw r30, r10 2d162: 80 83 st Z, r24 return 1; 2d164: 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); 2d166: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2d168: e1 e0 ldi r30, 0x01 ; 1 2d16a: f0 e0 ldi r31, 0x00 ; 0 2d16c: ec 0f add r30, r28 2d16e: fd 1f adc r31, r29 2d170: e1 0f add r30, r17 2d172: f1 1d adc r31, r1 2d174: 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 2d176: 9a e2 ldi r25, 0x2A ; 42 2d178: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2d17a: 81 11 cpse r24, r1 2d17c: 21 c0 rjmp .+66 ; 0x2d1c0 *dst = '0'; 2d17e: 80 e3 ldi r24, 0x30 ; 48 2d180: 81 83 std Z+1, r24 ; 0x01 return 1; 2d182: 81 e0 ldi r24, 0x01 ; 1 2d184: 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); 2d186: 18 0f add r17, r24 txbuff[i] = '\n'; 2d188: e1 e0 ldi r30, 0x01 ; 1 2d18a: f0 e0 ldi r31, 0x00 ; 0 2d18c: ec 0f add r30, r28 2d18e: fd 1f adc r31, r29 2d190: e1 0f add r30, r17 2d192: f1 1d adc r31, r1 2d194: 8a e0 ldi r24, 0x0A ; 10 2d196: 80 83 st Z, r24 ++i; 2d198: 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); 2d19a: 9e 01 movw r18, r28 2d19c: 2f 5f subi r18, 0xFF ; 255 2d19e: 3f 4f sbci r19, 0xFF ; 255 2d1a0: 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--){ 2d1a2: 59 01 movw r10, r18 2d1a4: a1 0e add r10, r17 2d1a6: b1 1c adc r11, r1 2d1a8: ea 14 cp r14, r10 2d1aa: fb 04 cpc r15, r11 2d1ac: 79 f0 breq .+30 ; 0x2d1cc fputc(*buffer, uart2io); 2d1ae: f7 01 movw r30, r14 2d1b0: 81 91 ld r24, Z+ 2d1b2: 7f 01 movw r14, r30 2d1b4: 64 e9 ldi r22, 0x94 ; 148 2d1b6: 72 e1 ldi r23, 0x12 ; 18 2d1b8: 90 e0 ldi r25, 0x00 ; 0 2d1ba: 0f 94 bc da call 0x3b578 ; 0x3b578 2d1be: f4 cf rjmp .-24 ; 0x2d1a8 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); 2d1c0: bf 01 movw r22, r30 2d1c2: 6f 5f subi r22, 0xFF ; 255 2d1c4: 7f 4f sbci r23, 0xFF ; 255 2d1c6: 0f 94 75 c5 call 0x38aea ; 0x38aea 2d1ca: dc cf rjmp .-72 ; 0x2d184 LogRequestMsg(txbuff, len); 2d1cc: 61 2f mov r22, r17 2d1ce: ce 01 movw r24, r28 2d1d0: 01 96 adiw r24, 0x01 ; 1 2d1d2: 0f 94 7a 67 call 0x2cef4 ; 0x2cef4 RecordUARTActivity(); 2d1d6: 0f 94 d1 66 call 0x2cda2 ; 0x2cda2 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2d1da: d0 92 4e 13 sts 0x134E, r13 ; 0x80134e } 2d1de: 67 96 adiw r28, 0x17 ; 23 2d1e0: 0f b6 in r0, 0x3f ; 63 2d1e2: f8 94 cli 2d1e4: de bf out 0x3e, r29 ; 62 2d1e6: 0f be out 0x3f, r0 ; 63 2d1e8: cd bf out 0x3d, r28 ; 61 2d1ea: df 91 pop r29 2d1ec: cf 91 pop r28 2d1ee: 1f 91 pop r17 2d1f0: 0f 91 pop r16 2d1f2: ff 90 pop r15 2d1f4: ef 90 pop r14 2d1f6: df 90 pop r13 2d1f8: bf 90 pop r11 2d1fa: af 90 pop r10 2d1fc: 9f 90 pop r9 2d1fe: 8f 90 pop r8 2d200: 08 95 ret 0002d202 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2d202: 20 91 99 13 lds r18, 0x1399 ; 0x801399 2d206: 2f 5f subi r18, 0xFF ; 255 2d208: 20 93 99 13 sts 0x1399, r18 ; 0x801399 if (regIndex >= initRegs8Count) { 2d20c: 22 30 cpi r18, 0x02 ; 2 2d20e: 78 f4 brcc .+30 ; 0x2d22e return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2d210: 30 e0 ldi r19, 0x00 ; 0 2d212: f9 01 movw r30, r18 2d214: ed 59 subi r30, 0x9D ; 157 2d216: f5 45 sbci r31, 0x55 ; 85 2d218: 84 91 lpm r24, Z 2d21a: 29 56 subi r18, 0x69 ; 105 2d21c: 3c 4e sbci r19, 0xEC ; 236 2d21e: f9 01 movw r30, r18 2d220: 60 81 ld r22, Z 2d222: 70 e0 ldi r23, 0x00 ; 0 2d224: 49 e0 ldi r20, 0x09 ; 9 2d226: 0f 94 42 68 call 0x2d084 ; 0x2d084 } return false; 2d22a: 80 e0 ldi r24, 0x00 ; 0 2d22c: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2d22e: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2d230: 08 95 ret 0002d232 : } /// 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){ 2d232: 2f 92 push r2 2d234: 3f 92 push r3 2d236: 4f 92 push r4 2d238: 5f 92 push r5 2d23a: 6f 92 push r6 2d23c: 7f 92 push r7 2d23e: 8f 92 push r8 2d240: 9f 92 push r9 2d242: af 92 push r10 2d244: bf 92 push r11 2d246: cf 92 push r12 2d248: df 92 push r13 2d24a: ef 92 push r14 2d24c: ff 92 push r15 2d24e: 0f 93 push r16 2d250: 1f 93 push r17 2d252: cf 93 push r28 2d254: df 93 push r29 2d256: 00 d0 rcall .+0 ; 0x2d258 2d258: 1f 92 push r1 2d25a: 1f 92 push r1 2d25c: cd b7 in r28, 0x3d ; 61 2d25e: de b7 in r29, 0x3e ; 62 2d260: 2b 01 movw r4, r22 2d262: 1a 01 movw r2, r20 2d264: f1 2c mov r15, r1 2d266: 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; 2d268: 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; 2d26a: 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; 2d26c: 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){ 2d26e: 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); 2d270: 66 24 eor r6, r6 2d272: 63 94 inc r6 2d274: 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){ 2d276: 70 e0 ldi r23, 0x00 ; 0 2d278: 60 e0 ldi r22, 0x00 ; 0 2d27a: 97 01 movw r18, r14 2d27c: 2b 53 subi r18, 0x3B ; 59 2d27e: 39 4f sbci r19, 0xF9 ; 249 2d280: 3a 83 std Y+2, r19 ; 0x02 2d282: 29 83 std Y+1, r18 ; 0x01 2d284: 86 2e mov r8, r22 2d286: c9 80 ldd r12, Y+1 ; 0x01 2d288: da 80 ldd r13, Y+2 ; 0x02 2d28a: c6 0e add r12, r22 2d28c: d7 1e adc r13, r23 2d28e: 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; 2d290: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2d292: 40 e0 ldi r20, 0x00 ; 0 2d294: 30 e0 ldi r19, 0x00 ; 0 2d296: 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; 2d298: ae ef ldi r26, 0xFE ; 254 2d29a: a4 0f add r26, r20 2d29c: 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; 2d29e: 44 23 and r20, r20 2d2a0: 19 f0 breq .+6 ; 0x2d2a8 2d2a2: 4b 30 cpi r20, 0x0B ; 11 2d2a4: 09 f0 breq .+2 ; 0x2d2a8 2d2a6: 7d c0 rjmp .+250 ; 0x2d3a2 2d2a8: ae ef ldi r26, 0xFE ; 254 2d2aa: a2 0f add r26, r18 2d2ac: a8 30 cpi r26, 0x08 ; 8 2d2ae: 08 f4 brcc .+2 ; 0x2d2b2 2d2b0: 7a c0 rjmp .+244 ; 0x2d3a6 2d2b2: 2f 5f subi r18, 0xFF ; 255 2d2b4: 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){ 2d2b6: 2c 30 cpi r18, 0x0C ; 12 2d2b8: 31 05 cpc r19, r1 2d2ba: 89 f7 brne .-30 ; 0x2d29e /// 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){ 2d2bc: 4f 5f subi r20, 0xFF ; 255 2d2be: 20 e2 ldi r18, 0x20 ; 32 2d2c0: c2 0e add r12, r18 2d2c2: d1 1c adc r13, r1 2d2c4: 32 96 adiw r30, 0x02 ; 2 2d2c6: 4c 30 cpi r20, 0x0C ; 12 2d2c8: 29 f7 brne .-54 ; 0x2d294 // 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){ 2d2ca: 3c 81 ldd r19, Y+4 ; 0x04 2d2cc: 30 17 cp r19, r16 2d2ce: 18 f4 brcc .+6 ; 0x2d2d6 2d2d0: 0c 83 std Y+4, r16 ; 0x04 2d2d2: 5d 83 std Y+5, r21 ; 0x05 2d2d4: 18 2d mov r17, r8 2d2d6: 6f 5f subi r22, 0xFF ; 255 2d2d8: 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){ 2d2da: 64 31 cpi r22, 0x14 ; 20 2d2dc: 71 05 cpc r23, r1 2d2de: 91 f6 brne .-92 ; 0x2d284 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){ 2d2e0: 5f 5f subi r21, 0xFF ; 255 2d2e2: a0 e2 ldi r26, 0x20 ; 32 2d2e4: ea 0e add r14, r26 2d2e6: f1 1c adc r15, r1 2d2e8: 54 31 cpi r21, 0x14 ; 20 2d2ea: 29 f6 brne .-118 ; 0x2d276 // 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); 2d2ec: ec 81 ldd r30, Y+4 ; 0x04 2d2ee: 6e 2f mov r22, r30 2d2f0: 70 e0 ldi r23, 0x00 ; 0 2d2f2: 90 e0 ldi r25, 0x00 ; 0 2d2f4: 80 e0 ldi r24, 0x00 ; 0 2d2f6: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2d2fa: 23 ec ldi r18, 0xC3 ; 195 2d2fc: 35 ef ldi r19, 0xF5 ; 245 2d2fe: 48 ea ldi r20, 0xA8 ; 168 2d300: 5f e3 ldi r21, 0x3F ; 63 2d302: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 2d306: 9f 93 push r25 2d308: 8f 93 push r24 2d30a: 7f 93 push r23 2d30c: 6f 93 push r22 2d30e: fd 81 ldd r31, Y+5 ; 0x05 2d310: 6f 2f mov r22, r31 2d312: 70 e0 ldi r23, 0x00 ; 0 2d314: 90 e0 ldi r25, 0x00 ; 0 2d316: 80 e0 ldi r24, 0x00 ; 0 2d318: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2d31c: 20 e0 ldi r18, 0x00 ; 0 2d31e: 30 e0 ldi r19, 0x00 ; 0 2d320: 40 eb ldi r20, 0xB0 ; 176 2d322: 50 e4 ldi r21, 0x40 ; 64 2d324: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2d328: 9f 93 push r25 2d32a: 8f 93 push r24 2d32c: 7f 93 push r23 2d32e: 6f 93 push r22 2d330: 61 2f mov r22, r17 2d332: 70 e0 ldi r23, 0x00 ; 0 2d334: 90 e0 ldi r25, 0x00 ; 0 2d336: 80 e0 ldi r24, 0x00 ; 0 2d338: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2d33c: 20 e0 ldi r18, 0x00 ; 0 2d33e: 30 e0 ldi r19, 0x00 ; 0 2d340: 40 eb ldi r20, 0xB0 ; 176 2d342: 50 e4 ldi r21, 0x40 ; 64 2d344: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2d348: 9f 93 push r25 2d34a: 8f 93 push r24 2d34c: 7f 93 push r23 2d34e: 6f 93 push r22 2d350: 80 eb ldi r24, 0xB0 ; 176 2d352: 95 ea ldi r25, 0xA5 ; 165 2d354: 9f 93 push r25 2d356: 8f 93 push r24 2d358: 0f 94 16 db call 0x3b62c ; 0x3b62c *pc = max_c; 2d35c: f2 01 movw r30, r4 2d35e: 10 83 st Z, r17 *pr = max_r; 2d360: 2d 81 ldd r18, Y+5 ; 0x05 2d362: f1 01 movw r30, r2 2d364: 20 83 st Z, r18 2d366: 0f b6 in r0, 0x3f ; 63 2d368: f8 94 cli 2d36a: de bf out 0x3e, r29 ; 62 2d36c: 0f be out 0x3f, r0 ; 63 2d36e: cd bf out 0x3d, r28 ; 61 return max_match; } 2d370: 8c 81 ldd r24, Y+4 ; 0x04 2d372: 0f 90 pop r0 2d374: 0f 90 pop r0 2d376: 0f 90 pop r0 2d378: 0f 90 pop r0 2d37a: 0f 90 pop r0 2d37c: df 91 pop r29 2d37e: cf 91 pop r28 2d380: 1f 91 pop r17 2d382: 0f 91 pop r16 2d384: ff 90 pop r15 2d386: ef 90 pop r14 2d388: df 90 pop r13 2d38a: cf 90 pop r12 2d38c: bf 90 pop r11 2d38e: af 90 pop r10 2d390: 9f 90 pop r9 2d392: 8f 90 pop r8 2d394: 7f 90 pop r7 2d396: 6f 90 pop r6 2d398: 5f 90 pop r5 2d39a: 4f 90 pop r4 2d39c: 3f 90 pop r3 2d39e: 2f 90 pop r2 2d3a0: 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; 2d3a2: 22 23 and r18, r18 2d3a4: 11 f0 breq .+4 ; 0x2d3aa 2d3a6: 2b 30 cpi r18, 0x0B ; 11 2d3a8: 21 f4 brne .+8 ; 0x2d3b2 2d3aa: ab 81 ldd r26, Y+3 ; 0x03 2d3ac: a8 30 cpi r26, 0x08 ; 8 2d3ae: 08 f0 brcs .+2 ; 0x2d3b2 2d3b0: 80 cf rjmp .-256 ; 0x2d2b2 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2d3b2: 99 24 eor r9, r9 2d3b4: 93 94 inc r9 2d3b6: d6 01 movw r26, r12 2d3b8: a2 0f add r26, r18 2d3ba: b3 1f adc r27, r19 2d3bc: ac 91 ld r26, X 2d3be: a1 31 cpi r26, 0x11 ; 17 2d3c0: 08 f4 brcc .+2 ; 0x2d3c4 2d3c2: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2d3c4: a0 80 ld r10, Z 2d3c6: b1 80 ldd r11, Z+1 ; 0x01 2d3c8: d3 01 movw r26, r6 2d3ca: 02 2e mov r0, r18 2d3cc: 02 c0 rjmp .+4 ; 0x2d3d2 2d3ce: aa 0f add r26, r26 2d3d0: bb 1f adc r27, r27 2d3d2: 0a 94 dec r0 2d3d4: e2 f7 brpl .-8 ; 0x2d3ce 2d3d6: aa 21 and r26, r10 2d3d8: bb 21 and r27, r11 2d3da: bb 24 eor r11, r11 2d3dc: b3 94 inc r11 2d3de: ab 2b or r26, r27 2d3e0: 09 f4 brne .+2 ; 0x2d3e4 2d3e2: b1 2c mov r11, r1 if (high_pix == high_pat) 2d3e4: 9b 10 cpse r9, r11 2d3e6: 65 cf rjmp .-310 ; 0x2d2b2 match++; 2d3e8: 0f 5f subi r16, 0xFF ; 255 2d3ea: 63 cf rjmp .-314 ; 0x2d2b2 0002d3ec : * \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) { 2d3ec: 8f 92 push r8 2d3ee: 9f 92 push r9 2d3f0: af 92 push r10 2d3f2: bf 92 push r11 2d3f4: cf 92 push r12 2d3f6: df 92 push r13 2d3f8: ef 92 push r14 2d3fa: ff 92 push r15 2d3fc: cf 93 push r28 2d3fe: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2d400: 2d ef ldi r18, 0xFD ; 253 2d402: 36 e1 ldi r19, 0x16 ; 22 2d404: 30 93 9b 0e sts 0x0E9B, r19 ; 0x800e9b 2d408: 20 93 9a 0e sts 0x0E9A, r18 ; 0x800e9a fatType_ = 0; 2d40c: 10 92 19 17 sts 0x1719, r1 ; 0x801719 allocSearchStart_ = 2; 2d410: 42 e0 ldi r20, 0x02 ; 2 2d412: 50 e0 ldi r21, 0x00 ; 0 2d414: 60 e0 ldi r22, 0x00 ; 0 2d416: 70 e0 ldi r23, 0x00 ; 0 2d418: 40 93 02 17 sts 0x1702, r20 ; 0x801702 2d41c: 50 93 03 17 sts 0x1703, r21 ; 0x801703 2d420: 60 93 04 17 sts 0x1704, r22 ; 0x801704 2d424: 70 93 05 17 sts 0x1705, r23 ; 0x801705 cacheDirty_ = 0; // cacheFlush() will write block if true 2d428: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 cacheMirrorBlock_ = 0; 2d42c: 10 92 95 0e sts 0x0E95, r1 ; 0x800e95 2d430: 10 92 96 0e sts 0x0E96, r1 ; 0x800e96 2d434: 10 92 97 0e sts 0x0E97, r1 ; 0x800e97 2d438: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 cacheBlockNumber_ = 0XFFFFFFFF; 2d43c: 4f ef ldi r20, 0xFF ; 255 2d43e: 5f ef ldi r21, 0xFF ; 255 2d440: ba 01 movw r22, r20 2d442: 40 93 91 0e sts 0x0E91, r20 ; 0x800e91 2d446: 50 93 92 0e sts 0x0E92, r21 ; 0x800e92 2d44a: 60 93 93 0e sts 0x0E93, r22 ; 0x800e93 2d44e: 70 93 94 0e sts 0x0E94, r23 ; 0x800e94 // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2d452: 88 23 and r24, r24 2d454: 09 f4 brne .+2 ; 0x2d458 2d456: 70 c0 rjmp .+224 ; 0x2d538 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2d458: 40 e0 ldi r20, 0x00 ; 0 2d45a: 60 e0 ldi r22, 0x00 ; 0 2d45c: 70 e0 ldi r23, 0x00 ; 0 2d45e: cb 01 movw r24, r22 2d460: 0f 94 48 55 call 0x2aa90 ; 0x2aa90 2d464: 81 11 cpse r24, r1 2d466: 0d c0 rjmp .+26 ; 0x2d482 fatType_ = 32; } return true; fail: return false; 2d468: c0 e0 ldi r28, 0x00 ; 0 } 2d46a: 8c 2f mov r24, r28 2d46c: df 91 pop r29 2d46e: cf 91 pop r28 2d470: ff 90 pop r15 2d472: ef 90 pop r14 2d474: df 90 pop r13 2d476: cf 90 pop r12 2d478: bf 90 pop r11 2d47a: af 90 pop r10 2d47c: 9f 90 pop r9 2d47e: 8f 90 pop r8 2d480: 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 || 2d482: 80 91 5b 10 lds r24, 0x105B ; 0x80105b 2d486: 8f 77 andi r24, 0x7F ; 127 2d488: 79 f7 brne .-34 ; 0x2d468 2d48a: 80 91 67 10 lds r24, 0x1067 ; 0x801067 2d48e: 90 91 68 10 lds r25, 0x1068 ; 0x801068 2d492: a0 91 69 10 lds r26, 0x1069 ; 0x801069 2d496: b0 91 6a 10 lds r27, 0x106A ; 0x80106a 2d49a: 84 36 cpi r24, 0x64 ; 100 2d49c: 91 05 cpc r25, r1 2d49e: a1 05 cpc r26, r1 2d4a0: b1 05 cpc r27, r1 2d4a2: 10 f3 brcs .-60 ; 0x2d468 p->totalSectors < 100 || p->firstSector == 0) { 2d4a4: c0 90 63 10 lds r12, 0x1063 ; 0x801063 2d4a8: d0 90 64 10 lds r13, 0x1064 ; 0x801064 2d4ac: e0 90 65 10 lds r14, 0x1065 ; 0x801065 2d4b0: f0 90 66 10 lds r15, 0x1066 ; 0x801066 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 || 2d4b4: c1 14 cp r12, r1 2d4b6: d1 04 cpc r13, r1 2d4b8: e1 04 cpc r14, r1 2d4ba: f1 04 cpc r15, r1 2d4bc: a9 f2 breq .-86 ; 0x2d468 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2d4be: 40 e0 ldi r20, 0x00 ; 0 2d4c0: c7 01 movw r24, r14 2d4c2: b6 01 movw r22, r12 2d4c4: 0f 94 48 55 call 0x2aa90 ; 0x2aa90 2d4c8: c8 2f mov r28, r24 2d4ca: 88 23 and r24, r24 2d4cc: 69 f2 breq .-102 ; 0x2d468 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2d4ce: 80 91 a8 0e lds r24, 0x0EA8 ; 0x800ea8 2d4d2: 90 91 a9 0e lds r25, 0x0EA9 ; 0x800ea9 2d4d6: 81 15 cp r24, r1 2d4d8: 92 40 sbci r25, 0x02 ; 2 2d4da: 31 f6 brne .-116 ; 0x2d468 fbs->fatCount == 0 || 2d4dc: a0 91 ad 0e lds r26, 0x0EAD ; 0x800ead } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2d4e0: aa 23 and r26, r26 2d4e2: 11 f2 breq .-124 ; 0x2d468 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2d4e4: 60 91 ab 0e lds r22, 0x0EAB ; 0x800eab 2d4e8: 70 91 ac 0e lds r23, 0x0EAC ; 0x800eac volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2d4ec: 61 15 cp r22, r1 2d4ee: 71 05 cpc r23, r1 2d4f0: 09 f4 brne .+2 ; 0x2d4f4 2d4f2: ba cf rjmp .-140 ; 0x2d468 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2d4f4: 20 91 aa 0e lds r18, 0x0EAA ; 0x800eaa } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2d4f8: 22 23 and r18, r18 2d4fa: 09 f4 brne .+2 ; 0x2d4fe 2d4fc: b5 cf rjmp .-150 ; 0x2d468 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2d4fe: a0 93 14 17 sts 0x1714, r26 ; 0x801714 blocksPerCluster_ = fbs->sectorsPerCluster; 2d502: 20 93 06 17 sts 0x1706, r18 ; 0x801706 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2d506: 90 e0 ldi r25, 0x00 ; 0 2d508: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2d50a: 30 e0 ldi r19, 0x00 ; 0 2d50c: e1 e0 ldi r30, 0x01 ; 1 2d50e: f0 e0 ldi r31, 0x00 ; 0 2d510: d8 2f mov r29, r24 2d512: af 01 movw r20, r30 2d514: 08 2e mov r0, r24 2d516: 02 c0 rjmp .+4 ; 0x2d51c 2d518: 44 0f add r20, r20 2d51a: 55 1f adc r21, r21 2d51c: 0a 94 dec r0 2d51e: e2 f7 brpl .-8 ; 0x2d518 2d520: 24 17 cp r18, r20 2d522: 35 07 cpc r19, r21 2d524: 69 f0 breq .+26 ; 0x2d540 2d526: 41 e0 ldi r20, 0x01 ; 1 2d528: 48 0f add r20, r24 2d52a: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2d52c: 89 30 cpi r24, 0x09 ; 9 2d52e: 91 05 cpc r25, r1 2d530: 79 f7 brne .-34 ; 0x2d510 2d532: 40 93 0f 17 sts 0x170F, r20 ; 0x80170f 2d536: 98 cf rjmp .-208 ; 0x2d468 * 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; 2d538: c1 2c mov r12, r1 2d53a: d1 2c mov r13, r1 2d53c: 76 01 movw r14, r12 2d53e: bf cf rjmp .-130 ; 0x2d4be 2d540: 80 93 0f 17 sts 0x170F, r24 ; 0x80170f clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2d544: 20 91 b3 0e lds r18, 0x0EB3 ; 0x800eb3 2d548: 30 91 b4 0e lds r19, 0x0EB4 ; 0x800eb4 2d54c: 50 e0 ldi r21, 0x00 ; 0 2d54e: 40 e0 ldi r20, 0x00 ; 0 2d550: 21 15 cp r18, r1 2d552: 31 05 cpc r19, r1 2d554: 41 f4 brne .+16 ; 0x2d566 2d556: 20 91 c1 0e lds r18, 0x0EC1 ; 0x800ec1 2d55a: 30 91 c2 0e lds r19, 0x0EC2 ; 0x800ec2 2d55e: 40 91 c3 0e lds r20, 0x0EC3 ; 0x800ec3 2d562: 50 91 c4 0e lds r21, 0x0EC4 ; 0x800ec4 2d566: 20 93 07 17 sts 0x1707, r18 ; 0x801707 2d56a: 30 93 08 17 sts 0x1708, r19 ; 0x801708 2d56e: 40 93 09 17 sts 0x1709, r20 ; 0x801709 2d572: 50 93 0a 17 sts 0x170A, r21 ; 0x80170a fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2d576: 46 01 movw r8, r12 2d578: 57 01 movw r10, r14 2d57a: 86 0e add r8, r22 2d57c: 97 1e adc r9, r23 2d57e: a1 1c adc r10, r1 2d580: b1 1c adc r11, r1 2d582: 80 92 15 17 sts 0x1715, r8 ; 0x801715 2d586: 90 92 16 17 sts 0x1716, r9 ; 0x801716 2d58a: a0 92 17 17 sts 0x1717, r10 ; 0x801717 2d58e: b0 92 18 17 sts 0x1718, r11 ; 0x801718 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2d592: e0 91 ae 0e lds r30, 0x0EAE ; 0x800eae 2d596: f0 91 af 0e lds r31, 0x0EAF ; 0x800eaf 2d59a: f0 93 1b 17 sts 0x171B, r31 ; 0x80171b 2d59e: e0 93 1a 17 sts 0x171A, r30 ; 0x80171a // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2d5a2: b0 e0 ldi r27, 0x00 ; 0 2d5a4: 0f 94 e9 dc call 0x3b9d2 ; 0x3b9d2 <__muluhisi3> 2d5a8: dc 01 movw r26, r24 2d5aa: cb 01 movw r24, r22 2d5ac: 88 0d add r24, r8 2d5ae: 99 1d adc r25, r9 2d5b0: aa 1d adc r26, r10 2d5b2: bb 1d adc r27, r11 2d5b4: 80 93 1c 17 sts 0x171C, r24 ; 0x80171c 2d5b8: 90 93 1d 17 sts 0x171D, r25 ; 0x80171d 2d5bc: a0 93 1e 17 sts 0x171E, r26 ; 0x80171e 2d5c0: b0 93 1f 17 sts 0x171F, r27 ; 0x80171f // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2d5c4: 25 e0 ldi r18, 0x05 ; 5 2d5c6: ee 0f add r30, r30 2d5c8: ff 1f adc r31, r31 2d5ca: 2a 95 dec r18 2d5cc: e1 f7 brne .-8 ; 0x2d5c6 2d5ce: e1 50 subi r30, 0x01 ; 1 2d5d0: fe 4f sbci r31, 0xFE ; 254 2d5d2: ef 2f mov r30, r31 2d5d4: ff 27 eor r31, r31 2d5d6: e6 95 lsr r30 2d5d8: 8e 0f add r24, r30 2d5da: 9f 1f adc r25, r31 2d5dc: a1 1d adc r26, r1 2d5de: b1 1d adc r27, r1 2d5e0: 80 93 10 17 sts 0x1710, r24 ; 0x801710 2d5e4: 90 93 11 17 sts 0x1711, r25 ; 0x801711 2d5e8: a0 93 12 17 sts 0x1712, r26 ; 0x801712 2d5ec: b0 93 13 17 sts 0x1713, r27 ; 0x801713 // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2d5f0: 80 90 b0 0e lds r8, 0x0EB0 ; 0x800eb0 2d5f4: 90 90 b1 0e lds r9, 0x0EB1 ; 0x800eb1 2d5f8: b1 2c mov r11, r1 2d5fa: a1 2c mov r10, r1 2d5fc: 81 14 cp r8, r1 2d5fe: 91 04 cpc r9, r1 2d600: 41 f4 brne .+16 ; 0x2d612 2d602: 80 90 bd 0e lds r8, 0x0EBD ; 0x800ebd 2d606: 90 90 be 0e lds r9, 0x0EBE ; 0x800ebe 2d60a: a0 90 bf 0e lds r10, 0x0EBF ; 0x800ebf 2d60e: b0 90 c0 0e lds r11, 0x0EC0 ; 0x800ec0 fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2d612: c8 1a sub r12, r24 2d614: d9 0a sbc r13, r25 2d616: ea 0a sbc r14, r26 2d618: fb 0a sbc r15, r27 2d61a: c8 0c add r12, r8 2d61c: d9 1c adc r13, r9 2d61e: ea 1c adc r14, r10 2d620: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2d622: 04 c0 rjmp .+8 ; 0x2d62c 2d624: f6 94 lsr r15 2d626: e7 94 ror r14 2d628: d7 94 ror r13 2d62a: c7 94 ror r12 2d62c: da 95 dec r29 2d62e: d2 f7 brpl .-12 ; 0x2d624 2d630: c0 92 0b 17 sts 0x170B, r12 ; 0x80170b 2d634: d0 92 0c 17 sts 0x170C, r13 ; 0x80170c 2d638: e0 92 0d 17 sts 0x170D, r14 ; 0x80170d 2d63c: f0 92 0e 17 sts 0x170E, r15 ; 0x80170e // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2d640: 85 ef ldi r24, 0xF5 ; 245 2d642: c8 16 cp r12, r24 2d644: 8f e0 ldi r24, 0x0F ; 15 2d646: d8 06 cpc r13, r24 2d648: e1 04 cpc r14, r1 2d64a: f1 04 cpc r15, r1 2d64c: 20 f4 brcc .+8 ; 0x2d656 fatType_ = 12; 2d64e: 8c e0 ldi r24, 0x0C ; 12 2d650: 80 93 19 17 sts 0x1719, r24 ; 0x801719 2d654: 09 cf rjmp .-494 ; 0x2d468 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2d656: 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) { 2d658: 25 ef ldi r18, 0xF5 ; 245 2d65a: c2 16 cp r12, r18 2d65c: 2f ef ldi r18, 0xFF ; 255 2d65e: d2 06 cpc r13, r18 2d660: e1 04 cpc r14, r1 2d662: f1 04 cpc r15, r1 2d664: 88 f0 brcs .+34 ; 0x2d688 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2d666: 80 91 c9 0e lds r24, 0x0EC9 ; 0x800ec9 2d66a: 90 91 ca 0e lds r25, 0x0ECA ; 0x800eca 2d66e: a0 91 cb 0e lds r26, 0x0ECB ; 0x800ecb 2d672: b0 91 cc 0e lds r27, 0x0ECC ; 0x800ecc 2d676: 80 93 1c 17 sts 0x171C, r24 ; 0x80171c 2d67a: 90 93 1d 17 sts 0x171D, r25 ; 0x80171d 2d67e: a0 93 1e 17 sts 0x171E, r26 ; 0x80171e 2d682: b0 93 1f 17 sts 0x171F, r27 ; 0x80171f fatType_ = 32; 2d686: 80 e2 ldi r24, 0x20 ; 32 2d688: 80 93 19 17 sts 0x1719, r24 ; 0x801719 2d68c: ee ce rjmp .-548 ; 0x2d46a 0002d68e : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2d68e: 20 e0 ldi r18, 0x00 ; 0 2d690: 30 e0 ldi r19, 0x00 ; 0 2d692: 40 ea ldi r20, 0xA0 ; 160 2d694: 52 e4 ldi r21, 0x42 ; 66 2d696: 60 e0 ldi r22, 0x00 ; 0 2d698: 70 e0 ldi r23, 0x00 ; 0 2d69a: 80 ea ldi r24, 0xA0 ; 160 2d69c: 92 ec ldi r25, 0xC2 ; 194 2d69e: 0d 94 e9 c5 jmp 0x38bd2 ; 0x38bd2 0002d6a2 : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2d6a2: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 2d6a6: 91 fd sbrc r25, 1 2d6a8: 17 c0 rjmp .+46 ; 0x2d6d8 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2d6aa: 88 23 and r24, r24 2d6ac: a9 f0 breq .+42 ; 0x2d6d8 2d6ae: 92 fd sbrc r25, 2 2d6b0: 13 c0 rjmp .+38 ; 0x2d6d8 Disable_E0(); 2d6b2: 0f 94 e7 c5 call 0x38bce ; 0x38bce resume_hotend_temp = thermal_degTargetHotend(); 2d6b6: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2d6ba: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 2d6be: 90 93 b0 13 sts 0x13B0, r25 ; 0x8013b0 2d6c2: 80 93 af 13 sts 0x13AF, r24 ; 0x8013af mmu_print_saved |= SavedState::CooldownPending; 2d6c6: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d6ca: 84 60 ori r24, 0x04 ; 4 2d6cc: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb LogEchoEvent_P(PSTR("Heater cooldown pending")); 2d6d0: 84 e0 ldi r24, 0x04 ; 4 2d6d2: 97 ea ldi r25, 0xA7 ; 167 2d6d4: 0d 94 0d c6 jmp 0x38c1a ; 0x38c1a } } 2d6d8: 08 95 ret 0002d6da : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2d6da: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d6de: 80 ff sbrs r24, 0 2d6e0: 47 c0 rjmp .+142 ; 0x2d770 LogEchoEvent_P(PSTR("Resuming XYZ")); 2d6e2: 8c e1 ldi r24, 0x1C ; 28 2d6e4: 97 ea ldi r25, 0xA7 ; 167 2d6e6: 0f 94 0d c6 call 0x38c1a ; 0x38c1a // 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)); 2d6ea: 80 91 a7 13 lds r24, 0x13A7 ; 0x8013a7 2d6ee: 90 91 a8 13 lds r25, 0x13A8 ; 0x8013a8 2d6f2: a0 91 a9 13 lds r26, 0x13A9 ; 0x8013a9 2d6f6: b0 91 aa 13 lds r27, 0x13AA ; 0x8013aa 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; 2d6fa: 40 91 a3 13 lds r20, 0x13A3 ; 0x8013a3 2d6fe: 50 91 a4 13 lds r21, 0x13A4 ; 0x8013a4 2d702: 60 91 a5 13 lds r22, 0x13A5 ; 0x8013a5 2d706: 70 91 a6 13 lds r23, 0x13A6 ; 0x8013a6 2d70a: 40 93 92 06 sts 0x0692, r20 ; 0x800692 2d70e: 50 93 93 06 sts 0x0693, r21 ; 0x800693 2d712: 60 93 94 06 sts 0x0694, r22 ; 0x800694 2d716: 70 93 95 06 sts 0x0695, r23 ; 0x800695 current_position[Y_AXIS] = ry; 2d71a: 80 93 96 06 sts 0x0696, r24 ; 0x800696 2d71e: 90 93 97 06 sts 0x0697, r25 ; 0x800697 2d722: a0 93 98 06 sts 0x0698, r26 ; 0x800698 2d726: b0 93 99 06 sts 0x0699, r27 ; 0x800699 planner_line_to_current_position_sync(feedRate_mm_s); 2d72a: 60 e0 ldi r22, 0x00 ; 0 2d72c: 70 e0 ldi r23, 0x00 ; 0 2d72e: 88 e4 ldi r24, 0x48 ; 72 2d730: 92 e4 ldi r25, 0x42 ; 66 2d732: 0f 94 09 c6 call 0x38c12 ; 0x38c12 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2d736: 80 91 ab 13 lds r24, 0x13AB ; 0x8013ab 2d73a: 90 91 ac 13 lds r25, 0x13AC ; 0x8013ac 2d73e: a0 91 ad 13 lds r26, 0x13AD ; 0x8013ad 2d742: b0 91 ae 13 lds r27, 0x13AE ; 0x8013ae 2d746: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 2d74a: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 2d74e: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 2d752: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d planner_line_to_current_position_sync(feedRate_mm_s); 2d756: 60 e0 ldi r22, 0x00 ; 0 2d758: 70 e0 ldi r23, 0x00 ; 0 2d75a: 80 e7 ldi r24, 0x70 ; 112 2d75c: 91 e4 ldi r25, 0x41 ; 65 2d75e: 0f 94 09 c6 call 0x38c12 ; 0x38c12 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2d762: 10 92 a2 06 sts 0x06A2, r1 ; 0x8006a2 // 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); 2d766: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d76a: 8e 7f andi r24, 0xFE ; 254 2d76c: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb } } 2d770: 08 95 ret 0002d772 : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2d772: 0f 93 push r16 2d774: 1f 93 push r17 2d776: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2d778: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 2d77c: 91 11 cpse r25, r1 2d77e: 72 c0 rjmp .+228 ; 0x2d864 2d780: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2d782: 81 ef ldi r24, 0xF1 ; 241 2d784: 96 ea ldi r25, 0xA6 ; 166 2d786: 0f 94 0d c6 call 0x38c1a ; 0x38c1a Disable_E0(); 2d78a: 0f 94 e7 c5 call 0x38bce ; 0x38bce bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2d78e: 0f 94 ed 43 call 0x287da ; 0x287da /// 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; 2d792: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2d796: 81 11 cpse r24, r1 2d798: 02 c0 rjmp .+4 ; 0x2d79e 2d79a: 0e 94 c9 63 call 0xc792 ; 0xc792 // 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) { 2d79e: cc 23 and r28, r28 2d7a0: 09 f4 brne .+2 ; 0x2d7a4 2d7a2: 60 c0 rjmp .+192 ; 0x2d864 mmu_print_saved |= SavedState::ParkExtruder; 2d7a4: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d7a8: 81 60 ori r24, 0x01 ; 1 2d7aa: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb 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]); 2d7ae: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 2d7b2: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 2d7b6: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 2d7ba: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 2d7be: 40 91 96 06 lds r20, 0x0696 ; 0x800696 2d7c2: 50 91 97 06 lds r21, 0x0697 ; 0x800697 2d7c6: 60 91 98 06 lds r22, 0x0698 ; 0x800698 2d7ca: 70 91 99 06 lds r23, 0x0699 ; 0x800699 resume_position = planner_current_position(); // save current pos 2d7ce: 00 91 92 06 lds r16, 0x0692 ; 0x800692 2d7d2: 10 91 93 06 lds r17, 0x0693 ; 0x800693 2d7d6: 20 91 94 06 lds r18, 0x0694 ; 0x800694 2d7da: 30 91 95 06 lds r19, 0x0695 ; 0x800695 2d7de: 00 93 a3 13 sts 0x13A3, r16 ; 0x8013a3 2d7e2: 10 93 a4 13 sts 0x13A4, r17 ; 0x8013a4 2d7e6: 20 93 a5 13 sts 0x13A5, r18 ; 0x8013a5 2d7ea: 30 93 a6 13 sts 0x13A6, r19 ; 0x8013a6 2d7ee: 40 93 a7 13 sts 0x13A7, r20 ; 0x8013a7 2d7f2: 50 93 a8 13 sts 0x13A8, r21 ; 0x8013a8 2d7f6: 60 93 a9 13 sts 0x13A9, r22 ; 0x8013a9 2d7fa: 70 93 aa 13 sts 0x13AA, r23 ; 0x8013aa 2d7fe: 80 93 ab 13 sts 0x13AB, r24 ; 0x8013ab 2d802: 90 93 ac 13 sts 0x13AC, r25 ; 0x8013ac 2d806: a0 93 ad 13 sts 0x13AD, r26 ; 0x8013ad 2d80a: b0 93 ae 13 sts 0x13AE, r27 ; 0x8013ae current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2d80e: 60 e0 ldi r22, 0x00 ; 0 2d810: 70 e0 ldi r23, 0x00 ; 0 2d812: 80 ea ldi r24, 0xA0 ; 160 2d814: 91 e4 ldi r25, 0x41 ; 65 2d816: 0e 94 61 6d call 0xdac2 ; 0xdac2 void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2d81a: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 2d81e: 88 23 and r24, r24 2d820: 09 f1 breq .+66 ; 0x2d864 2d822: 80 91 90 06 lds r24, 0x0690 ; 0x800690 2d826: 88 23 and r24, r24 2d828: e9 f0 breq .+58 ; 0x2d864 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; 2d82a: 80 e0 ldi r24, 0x00 ; 0 2d82c: 90 e0 ldi r25, 0x00 ; 0 2d82e: aa ef ldi r26, 0xFA ; 250 2d830: b2 e4 ldi r27, 0x42 ; 66 2d832: 80 93 92 06 sts 0x0692, r24 ; 0x800692 2d836: 90 93 93 06 sts 0x0693, r25 ; 0x800693 2d83a: a0 93 94 06 sts 0x0694, r26 ; 0x800694 2d83e: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2d842: 10 92 96 06 sts 0x0696, r1 ; 0x800696 2d846: 10 92 97 06 sts 0x0697, r1 ; 0x800697 2d84a: 10 92 98 06 sts 0x0698, r1 ; 0x800698 2d84e: 10 92 99 06 sts 0x0699, r1 ; 0x800699 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2d852: 60 e0 ldi r22, 0x00 ; 0 2d854: 70 e0 ldi r23, 0x00 ; 0 2d856: 88 e4 ldi r24, 0x48 ; 72 2d858: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2d85a: cf 91 pop r28 2d85c: 1f 91 pop r17 2d85e: 0f 91 pop r16 2d860: 0d 94 09 c6 jmp 0x38c12 ; 0x38c12 2d864: cf 91 pop r28 2d866: 1f 91 pop r17 2d868: 0f 91 pop r16 2d86a: 08 95 ret 0002d86c : /// 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){ 2d86c: 2f 92 push r2 2d86e: 3f 92 push r3 2d870: 4f 92 push r4 2d872: 5f 92 push r5 2d874: 6f 92 push r6 2d876: 7f 92 push r7 2d878: 8f 92 push r8 2d87a: 9f 92 push r9 2d87c: af 92 push r10 2d87e: bf 92 push r11 2d880: cf 92 push r12 2d882: df 92 push r13 2d884: ef 92 push r14 2d886: ff 92 push r15 2d888: 0f 93 push r16 2d88a: 1f 93 push r17 2d88c: cf 93 push r28 2d88e: df 93 push r29 2d890: cd b7 in r28, 0x3d ; 61 2d892: de b7 in r29, 0x3e ; 62 2d894: cd 5b subi r28, 0xBD ; 189 2d896: d1 40 sbci r29, 0x01 ; 1 2d898: 0f b6 in r0, 0x3f ; 63 2d89a: f8 94 cli 2d89c: de bf out 0x3e, r29 ; 62 2d89e: 0f be out 0x3f, r0 ; 63 2d8a0: cd bf out 0x3d, r28 ; 61 2d8a2: c3 57 subi r28, 0x73 ; 115 2d8a4: de 4f sbci r29, 0xFE ; 254 2d8a6: 99 83 std Y+1, r25 ; 0x01 2d8a8: 88 83 st Y, r24 2d8aa: cd 58 subi r28, 0x8D ; 141 2d8ac: d1 40 sbci r29, 0x01 ; 1 2d8ae: c1 57 subi r28, 0x71 ; 113 2d8b0: de 4f sbci r29, 0xFE ; 254 2d8b2: 79 83 std Y+1, r23 ; 0x01 2d8b4: 68 83 st Y, r22 2d8b6: cf 58 subi r28, 0x8F ; 143 2d8b8: d1 40 sbci r29, 0x01 ; 1 2d8ba: ce 56 subi r28, 0x6E ; 110 2d8bc: de 4f sbci r29, 0xFE ; 254 2d8be: 59 83 std Y+1, r21 ; 0x01 2d8c0: 48 83 st Y, r20 2d8c2: c2 59 subi r28, 0x92 ; 146 2d8c4: d1 40 sbci r29, 0x01 ; 1 2d8c6: 84 e1 ldi r24, 0x14 ; 20 2d8c8: cf 56 subi r28, 0x6F ; 111 2d8ca: de 4f sbci r29, 0xFE ; 254 2d8cc: 88 83 st Y, r24 2d8ce: c1 59 subi r28, 0x91 ; 145 2d8d0: 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; 2d8d2: ce 56 subi r28, 0x6E ; 110 2d8d4: de 4f sbci r29, 0xFE ; 254 2d8d6: a8 81 ld r26, Y 2d8d8: b9 81 ldd r27, Y+1 ; 0x01 2d8da: c2 59 subi r28, 0x92 ; 146 2d8dc: d1 40 sbci r29, 0x01 ; 1 2d8de: 8d 91 ld r24, X+ 2d8e0: 9d 91 ld r25, X+ 2d8e2: 0d 90 ld r0, X+ 2d8e4: bc 91 ld r27, X 2d8e6: a0 2d mov r26, r0 2d8e8: c6 56 subi r28, 0x66 ; 102 2d8ea: de 4f sbci r29, 0xFE ; 254 2d8ec: 88 83 st Y, r24 2d8ee: 99 83 std Y+1, r25 ; 0x01 2d8f0: aa 83 std Y+2, r26 ; 0x02 2d8f2: bb 83 std Y+3, r27 ; 0x03 2d8f4: ca 59 subi r28, 0x9A ; 154 2d8f6: d1 40 sbci r29, 0x01 ; 1 2d8f8: c1 57 subi r28, 0x71 ; 113 2d8fa: de 4f sbci r29, 0xFE ; 254 2d8fc: a8 81 ld r26, Y 2d8fe: b9 81 ldd r27, Y+1 ; 0x01 2d900: cf 58 subi r28, 0x8F ; 143 2d902: d1 40 sbci r29, 0x01 ; 1 2d904: 8d 91 ld r24, X+ 2d906: 9d 91 ld r25, X+ 2d908: 0d 90 ld r0, X+ 2d90a: bc 91 ld r27, X 2d90c: a0 2d mov r26, r0 2d90e: ca 54 subi r28, 0x4A ; 74 2d910: de 4f sbci r29, 0xFE ; 254 2d912: 88 83 st Y, r24 2d914: 99 83 std Y+1, r25 ; 0x01 2d916: aa 83 std Y+2, r26 ; 0x02 2d918: bb 83 std Y+3, r27 ; 0x03 2d91a: c6 5b subi r28, 0xB6 ; 182 2d91c: d1 40 sbci r29, 0x01 ; 1 2d91e: c3 57 subi r28, 0x73 ; 115 2d920: de 4f sbci r29, 0xFE ; 254 2d922: a8 81 ld r26, Y 2d924: b9 81 ldd r27, Y+1 ; 0x01 2d926: cd 58 subi r28, 0x8D ; 141 2d928: d1 40 sbci r29, 0x01 ; 1 2d92a: 8d 91 ld r24, X+ 2d92c: 9d 91 ld r25, X+ 2d92e: 0d 90 ld r0, X+ 2d930: bc 91 ld r27, X 2d932: a0 2d mov r26, r0 2d934: c6 54 subi r28, 0x46 ; 70 2d936: de 4f sbci r29, 0xFE ; 254 2d938: 88 83 st Y, r24 2d93a: 99 83 std Y+1, r25 ; 0x01 2d93c: aa 83 std Y+2, r26 ; 0x02 2d93e: bb 83 std Y+3, r27 ; 0x03 2d940: ca 5b subi r28, 0xBA ; 186 2d942: d1 40 sbci r29, 0x01 ; 1 2d944: fe 01 movw r30, r28 2d946: e7 5f subi r30, 0xF7 ; 247 2d948: fe 4f sbci r31, 0xFE ; 254 2d94a: c8 55 subi r28, 0x58 ; 88 2d94c: de 4f sbci r29, 0xFE ; 254 2d94e: f9 83 std Y+1, r31 ; 0x01 2d950: e8 83 st Y, r30 2d952: c8 5a subi r28, 0xA8 ; 168 2d954: d1 40 sbci r29, 0x01 ; 1 2d956: ce 01 movw r24, r28 2d958: 8b 57 subi r24, 0x7B ; 123 2d95a: 9f 4f sbci r25, 0xFF ; 255 2d95c: ca 55 subi r28, 0x5A ; 90 2d95e: de 4f sbci r29, 0xFE ; 254 2d960: 99 83 std Y+1, r25 ; 0x01 2d962: 88 83 st Y, r24 2d964: c6 5a subi r28, 0xA6 ; 166 2d966: d1 40 sbci r29, 0x01 ; 1 2d968: de 01 movw r26, r28 2d96a: 11 96 adiw r26, 0x01 ; 1 2d96c: c8 56 subi r28, 0x68 ; 104 2d96e: de 4f sbci r29, 0xFE ; 254 2d970: b9 83 std Y+1, r27 ; 0x01 2d972: a8 83 st Y, r26 2d974: c8 59 subi r28, 0x98 ; 152 2d976: d1 40 sbci r29, 0x01 ; 1 2d978: 31 2c mov r3, r1 2d97a: 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; 2d97c: b1 01 movw r22, r2 2d97e: 03 2c mov r0, r3 2d980: 00 0c add r0, r0 2d982: 88 0b sbc r24, r24 2d984: 99 0b sbc r25, r25 2d986: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2d98a: 2a e1 ldi r18, 0x1A ; 26 2d98c: 38 ef ldi r19, 0xF8 ; 248 2d98e: 42 e4 ldi r20, 0x42 ; 66 2d990: 5e e3 ldi r21, 0x3E ; 62 2d992: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2d996: 6b 01 movw r12, r22 2d998: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2d99a: 0f 94 3c e1 call 0x3c278 ; 0x3c278 2d99e: c2 56 subi r28, 0x62 ; 98 2d9a0: de 4f sbci r29, 0xFE ; 254 2d9a2: 68 83 st Y, r22 2d9a4: 79 83 std Y+1, r23 ; 0x01 2d9a6: 8a 83 std Y+2, r24 ; 0x02 2d9a8: 9b 83 std Y+3, r25 ; 0x03 2d9aa: ce 59 subi r28, 0x9E ; 158 2d9ac: d1 40 sbci r29, 0x01 ; 1 2d9ae: c7 01 movw r24, r14 2d9b0: b6 01 movw r22, r12 2d9b2: 0f 94 76 de call 0x3bcec ; 0x3bcec 2d9b6: ce 55 subi r28, 0x5E ; 94 2d9b8: de 4f sbci r29, 0xFE ; 254 2d9ba: 68 83 st Y, r22 2d9bc: 79 83 std Y+1, r23 ; 0x01 2d9be: 8a 83 std Y+2, r24 ; 0x02 2d9c0: 9b 83 std Y+3, r25 ; 0x03 2d9c2: c2 5a subi r28, 0xA2 ; 162 2d9c4: d1 40 sbci r29, 0x01 ; 1 2d9c6: 9b 01 movw r18, r22 2d9c8: ac 01 movw r20, r24 2d9ca: c6 56 subi r28, 0x66 ; 102 2d9cc: de 4f sbci r29, 0xFE ; 254 2d9ce: 68 81 ld r22, Y 2d9d0: 79 81 ldd r23, Y+1 ; 0x01 2d9d2: 8a 81 ldd r24, Y+2 ; 0x02 2d9d4: 9b 81 ldd r25, Y+3 ; 0x03 2d9d6: ca 59 subi r28, 0x9A ; 154 2d9d8: d1 40 sbci r29, 0x01 ; 1 2d9da: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2d9de: c6 54 subi r28, 0x46 ; 70 2d9e0: de 4f sbci r29, 0xFE ; 254 2d9e2: 28 81 ld r18, Y 2d9e4: 39 81 ldd r19, Y+1 ; 0x01 2d9e6: 4a 81 ldd r20, Y+2 ; 0x02 2d9e8: 5b 81 ldd r21, Y+3 ; 0x03 2d9ea: ca 5b subi r28, 0xBA ; 186 2d9ec: d1 40 sbci r29, 0x01 ; 1 2d9ee: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2d9f2: 6b 01 movw r12, r22 2d9f4: 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) 2d9f6: 20 e0 ldi r18, 0x00 ; 0 2d9f8: 30 e0 ldi r19, 0x00 ; 0 2d9fa: a9 01 movw r20, r18 2d9fc: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2da00: 18 16 cp r1, r24 2da02: 0c f0 brlt .+2 ; 0x2da06 2da04: 7a c2 rjmp .+1268 ; 0x2defa // 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; 2da06: c2 56 subi r28, 0x62 ; 98 2da08: de 4f sbci r29, 0xFE ; 254 2da0a: 28 81 ld r18, Y 2da0c: 39 81 ldd r19, Y+1 ; 0x01 2da0e: 4a 81 ldd r20, Y+2 ; 0x02 2da10: 5b 81 ldd r21, Y+3 ; 0x03 2da12: ce 59 subi r28, 0x9E ; 158 2da14: d1 40 sbci r29, 0x01 ; 1 2da16: c6 56 subi r28, 0x66 ; 102 2da18: de 4f sbci r29, 0xFE ; 254 2da1a: 68 81 ld r22, Y 2da1c: 79 81 ldd r23, Y+1 ; 0x01 2da1e: 8a 81 ldd r24, Y+2 ; 0x02 2da20: 9b 81 ldd r25, Y+3 ; 0x03 2da22: ca 59 subi r28, 0x9A ; 154 2da24: d1 40 sbci r29, 0x01 ; 1 2da26: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2da2a: ca 54 subi r28, 0x4A ; 74 2da2c: de 4f sbci r29, 0xFE ; 254 2da2e: 28 81 ld r18, Y 2da30: 39 81 ldd r19, Y+1 ; 0x01 2da32: 4a 81 ldd r20, Y+2 ; 0x02 2da34: 5b 81 ldd r21, Y+3 ; 0x03 2da36: c6 5b subi r28, 0xB6 ; 182 2da38: d1 40 sbci r29, 0x01 ; 1 2da3a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2da3e: 4b 01 movw r8, r22 2da40: 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) 2da42: 20 e0 ldi r18, 0x00 ; 0 2da44: 30 e0 ldi r19, 0x00 ; 0 2da46: a9 01 movw r20, r18 2da48: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2da4c: 18 16 cp r1, r24 2da4e: 0c f0 brlt .+2 ; 0x2da52 2da50: 54 c2 rjmp .+1192 ; 0x2defa 2da52: 20 e0 ldi r18, 0x00 ; 0 2da54: 30 e0 ldi r19, 0x00 ; 0 2da56: 48 ef ldi r20, 0xF8 ; 248 2da58: 51 e4 ldi r21, 0x41 ; 65 2da5a: c7 01 movw r24, r14 2da5c: b6 01 movw r22, r12 2da5e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2da62: 87 ff sbrs r24, 7 2da64: 4a c2 rjmp .+1172 ; 0x2defa 2da66: 20 e0 ldi r18, 0x00 ; 0 2da68: 30 e0 ldi r19, 0x00 ; 0 2da6a: 48 ef ldi r20, 0xF8 ; 248 2da6c: 51 e4 ldi r21, 0x41 ; 65 2da6e: c5 01 movw r24, r10 2da70: b4 01 movw r22, r8 2da72: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 2da76: 87 ff sbrs r24, 7 2da78: 40 c2 rjmp .+1152 ; 0x2defa return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2da7a: c7 01 movw r24, r14 2da7c: b6 01 movw r22, r12 2da7e: 0f 94 23 df call 0x3be46 ; 0x3be46 2da82: 9b 01 movw r18, r22 2da84: ac 01 movw r20, r24 2da86: c7 01 movw r24, r14 2da88: b6 01 movw r22, r12 2da8a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2da8e: 2b 01 movw r4, r22 2da90: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2da92: c5 01 movw r24, r10 2da94: b4 01 movw r22, r8 2da96: 0f 94 23 df call 0x3be46 ; 0x3be46 2da9a: 9b 01 movw r18, r22 2da9c: ac 01 movw r20, r24 2da9e: c5 01 movw r24, r10 2daa0: b4 01 movw r22, r8 2daa2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2daa6: cc 56 subi r28, 0x6C ; 108 2daa8: de 4f sbci r29, 0xFE ; 254 2daaa: 68 83 st Y, r22 2daac: 79 83 std Y+1, r23 ; 0x01 2daae: 8a 83 std Y+2, r24 ; 0x02 2dab0: 9b 83 std Y+3, r25 ; 0x03 2dab2: c4 59 subi r28, 0x94 ; 148 2dab4: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2dab6: a3 01 movw r20, r6 2dab8: 92 01 movw r18, r4 2daba: 60 e0 ldi r22, 0x00 ; 0 2dabc: 70 e0 ldi r23, 0x00 ; 0 2dabe: 80 e8 ldi r24, 0x80 ; 128 2dac0: 9f e3 ldi r25, 0x3F ; 63 2dac2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2dac6: c2 55 subi r28, 0x52 ; 82 2dac8: de 4f sbci r29, 0xFE ; 254 2daca: 68 83 st Y, r22 2dacc: 79 83 std Y+1, r23 ; 0x01 2dace: 8a 83 std Y+2, r24 ; 0x02 2dad0: 9b 83 std Y+3, r25 ; 0x03 2dad2: ce 5a subi r28, 0xAE ; 174 2dad4: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2dad6: cc 56 subi r28, 0x6C ; 108 2dad8: de 4f sbci r29, 0xFE ; 254 2dada: 28 81 ld r18, Y 2dadc: 39 81 ldd r19, Y+1 ; 0x01 2dade: 4a 81 ldd r20, Y+2 ; 0x02 2dae0: 5b 81 ldd r21, Y+3 ; 0x03 2dae2: c4 59 subi r28, 0x94 ; 148 2dae4: d1 40 sbci r29, 0x01 ; 1 2dae6: 60 e0 ldi r22, 0x00 ; 0 2dae8: 70 e0 ldi r23, 0x00 ; 0 2daea: 80 e8 ldi r24, 0x80 ; 128 2daec: 9f e3 ldi r25, 0x3F ; 63 2daee: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2daf2: ce 54 subi r28, 0x4E ; 78 2daf4: de 4f sbci r29, 0xFE ; 254 2daf6: 68 83 st Y, r22 2daf8: 79 83 std Y+1, r23 ; 0x01 2dafa: 8a 83 std Y+2, r24 ; 0x02 2dafc: 9b 83 std Y+3, r25 ; 0x03 2dafe: c2 5b subi r28, 0xB2 ; 178 2db00: 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; 2db02: c7 01 movw r24, r14 2db04: b6 01 movw r22, r12 2db06: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 2db0a: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2db0c: fb 01 movw r30, r22 2db0e: 31 96 adiw r30, 0x01 ; 1 2db10: c6 55 subi r28, 0x56 ; 86 2db12: de 4f sbci r29, 0xFE ; 254 2db14: f9 83 std Y+1, r31 ; 0x01 2db16: e8 83 st Y, r30 2db18: ca 5a subi r28, 0xAA ; 170 2db1a: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2db1c: c5 01 movw r24, r10 2db1e: b4 01 movw r22, r8 2db20: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2db24: 8b 01 movw r16, r22 2db26: 95 e0 ldi r25, 0x05 ; 5 2db28: 00 0f add r16, r16 2db2a: 11 1f adc r17, r17 2db2c: 9a 95 dec r25 2db2e: e1 f7 brne .-8 ; 0x2db28 const uint16_t idx01 = c0 + 32 * r1; 2db30: c8 01 movw r24, r16 2db32: 80 96 adiw r24, 0x20 ; 32 2db34: c4 55 subi r28, 0x54 ; 84 2db36: de 4f sbci r29, 0xFE ; 254 2db38: 99 83 std Y+1, r25 ; 0x01 2db3a: 88 83 st Y, r24 2db3c: cc 5a subi r28, 0xAC ; 172 2db3e: 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]; 2db40: f8 01 movw r30, r16 2db42: ec 0d add r30, r12 2db44: fd 1d adc r31, r13 2db46: eb 53 subi r30, 0x3B ; 59 2db48: f9 4f sbci r31, 0xF9 ; 249 2db4a: 60 81 ld r22, Z 2db4c: 70 e0 ldi r23, 0x00 ; 0 2db4e: 90 e0 ldi r25, 0x00 ; 0 2db50: 80 e0 ldi r24, 0x00 ; 0 2db52: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2db56: 4b 01 movw r8, r22 2db58: 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; 2db5a: ce 54 subi r28, 0x4E ; 78 2db5c: de 4f sbci r29, 0xFE ; 254 2db5e: 28 81 ld r18, Y 2db60: 39 81 ldd r19, Y+1 ; 0x01 2db62: 4a 81 ldd r20, Y+2 ; 0x02 2db64: 5b 81 ldd r21, Y+3 ; 0x03 2db66: c2 5b subi r28, 0xB2 ; 178 2db68: d1 40 sbci r29, 0x01 ; 1 2db6a: c2 55 subi r28, 0x52 ; 82 2db6c: de 4f sbci r29, 0xFE ; 254 2db6e: 68 81 ld r22, Y 2db70: 79 81 ldd r23, Y+1 ; 0x01 2db72: 8a 81 ldd r24, Y+2 ; 0x02 2db74: 9b 81 ldd r25, Y+3 ; 0x03 2db76: ce 5a subi r28, 0xAE ; 174 2db78: d1 40 sbci r29, 0x01 ; 1 2db7a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2db7e: 9b 01 movw r18, r22 2db80: 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]; 2db82: c5 01 movw r24, r10 2db84: b4 01 movw r22, r8 2db86: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2db8a: 4b 01 movw r8, r22 2db8c: 5c 01 movw r10, r24 2db8e: c4 55 subi r28, 0x54 ; 84 2db90: de 4f sbci r29, 0xFE ; 254 2db92: e8 81 ld r30, Y 2db94: f9 81 ldd r31, Y+1 ; 0x01 2db96: cc 5a subi r28, 0xAC ; 172 2db98: d1 40 sbci r29, 0x01 ; 1 2db9a: ec 0d add r30, r12 2db9c: fd 1d adc r31, r13 2db9e: eb 53 subi r30, 0x3B ; 59 2dba0: f9 4f sbci r31, 0xF9 ; 249 2dba2: 60 81 ld r22, Z 2dba4: 70 e0 ldi r23, 0x00 ; 0 2dba6: 90 e0 ldi r25, 0x00 ; 0 2dba8: 80 e0 ldi r24, 0x00 ; 0 2dbaa: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2dbae: 6b 01 movw r12, r22 2dbb0: 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; 2dbb2: c2 55 subi r28, 0x52 ; 82 2dbb4: de 4f sbci r29, 0xFE ; 254 2dbb6: 28 81 ld r18, Y 2dbb8: 39 81 ldd r19, Y+1 ; 0x01 2dbba: 4a 81 ldd r20, Y+2 ; 0x02 2dbbc: 5b 81 ldd r21, Y+3 ; 0x03 2dbbe: ce 5a subi r28, 0xAE ; 174 2dbc0: d1 40 sbci r29, 0x01 ; 1 2dbc2: cc 56 subi r28, 0x6C ; 108 2dbc4: de 4f sbci r29, 0xFE ; 254 2dbc6: 68 81 ld r22, Y 2dbc8: 79 81 ldd r23, Y+1 ; 0x01 2dbca: 8a 81 ldd r24, Y+2 ; 0x02 2dbcc: 9b 81 ldd r25, Y+3 ; 0x03 2dbce: c4 59 subi r28, 0x94 ; 148 2dbd0: d1 40 sbci r29, 0x01 ; 1 2dbd2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2dbd6: 9b 01 movw r18, r22 2dbd8: 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]; 2dbda: c7 01 movw r24, r14 2dbdc: b6 01 movw r22, r12 2dbde: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2dbe2: 9b 01 movw r18, r22 2dbe4: ac 01 movw r20, r24 2dbe6: c5 01 movw r24, r10 2dbe8: b4 01 movw r22, r8 2dbea: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2dbee: 6b 01 movw r12, r22 2dbf0: 7c 01 movw r14, r24 2dbf2: c6 55 subi r28, 0x56 ; 86 2dbf4: de 4f sbci r29, 0xFE ; 254 2dbf6: a8 81 ld r26, Y 2dbf8: b9 81 ldd r27, Y+1 ; 0x01 2dbfa: ca 5a subi r28, 0xAA ; 170 2dbfc: d1 40 sbci r29, 0x01 ; 1 2dbfe: 0a 0f add r16, r26 2dc00: 1b 1f adc r17, r27 2dc02: f8 01 movw r30, r16 2dc04: eb 53 subi r30, 0x3B ; 59 2dc06: f9 4f sbci r31, 0xF9 ; 249 2dc08: 60 81 ld r22, Z 2dc0a: 70 e0 ldi r23, 0x00 ; 0 2dc0c: 90 e0 ldi r25, 0x00 ; 0 2dc0e: 80 e0 ldi r24, 0x00 ; 0 2dc10: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2dc14: 4b 01 movw r8, r22 2dc16: 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; 2dc18: ce 54 subi r28, 0x4E ; 78 2dc1a: de 4f sbci r29, 0xFE ; 254 2dc1c: 28 81 ld r18, Y 2dc1e: 39 81 ldd r19, Y+1 ; 0x01 2dc20: 4a 81 ldd r20, Y+2 ; 0x02 2dc22: 5b 81 ldd r21, Y+3 ; 0x03 2dc24: c2 5b subi r28, 0xB2 ; 178 2dc26: d1 40 sbci r29, 0x01 ; 1 2dc28: c3 01 movw r24, r6 2dc2a: b2 01 movw r22, r4 2dc2c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2dc30: 9b 01 movw r18, r22 2dc32: 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]; 2dc34: c5 01 movw r24, r10 2dc36: b4 01 movw r22, r8 2dc38: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2dc3c: 9b 01 movw r18, r22 2dc3e: ac 01 movw r20, r24 2dc40: c7 01 movw r24, r14 2dc42: b6 01 movw r22, r12 2dc44: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2dc48: 6b 01 movw r12, r22 2dc4a: 7c 01 movw r14, r24 2dc4c: c6 55 subi r28, 0x56 ; 86 2dc4e: de 4f sbci r29, 0xFE ; 254 2dc50: e8 81 ld r30, Y 2dc52: f9 81 ldd r31, Y+1 ; 0x01 2dc54: ca 5a subi r28, 0xAA ; 170 2dc56: d1 40 sbci r29, 0x01 ; 1 2dc58: c4 55 subi r28, 0x54 ; 84 2dc5a: de 4f sbci r29, 0xFE ; 254 2dc5c: 88 81 ld r24, Y 2dc5e: 99 81 ldd r25, Y+1 ; 0x01 2dc60: cc 5a subi r28, 0xAC ; 172 2dc62: d1 40 sbci r29, 0x01 ; 1 2dc64: e8 0f add r30, r24 2dc66: f9 1f adc r31, r25 2dc68: eb 53 subi r30, 0x3B ; 59 2dc6a: f9 4f sbci r31, 0xF9 ; 249 2dc6c: 60 81 ld r22, Z 2dc6e: 70 e0 ldi r23, 0x00 ; 0 2dc70: 90 e0 ldi r25, 0x00 ; 0 2dc72: 80 e0 ldi r24, 0x00 ; 0 2dc74: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2dc78: 4b 01 movw r8, r22 2dc7a: 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; 2dc7c: cc 56 subi r28, 0x6C ; 108 2dc7e: de 4f sbci r29, 0xFE ; 254 2dc80: 28 81 ld r18, Y 2dc82: 39 81 ldd r19, Y+1 ; 0x01 2dc84: 4a 81 ldd r20, Y+2 ; 0x02 2dc86: 5b 81 ldd r21, Y+3 ; 0x03 2dc88: c4 59 subi r28, 0x94 ; 148 2dc8a: d1 40 sbci r29, 0x01 ; 1 2dc8c: c3 01 movw r24, r6 2dc8e: b2 01 movw r22, r4 2dc90: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2dc94: 9b 01 movw r18, r22 2dc96: 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]; 2dc98: c5 01 movw r24, r10 2dc9a: b4 01 movw r22, r8 2dc9c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2dca0: 9b 01 movw r18, r22 2dca2: ac 01 movw r20, r24 2dca4: c7 01 movw r24, r14 2dca6: b6 01 movw r22, r12 2dca8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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; 2dcac: 20 e0 ldi r18, 0x00 ; 0 2dcae: 30 e0 ldi r19, 0x00 ; 0 2dcb0: 40 e0 ldi r20, 0x00 ; 0 2dcb2: 52 e4 ldi r21, 0x42 ; 66 2dcb4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2dcb8: 6b 01 movw r12, r22 2dcba: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2dcbc: ac 01 movw r20, r24 2dcbe: 9b 01 movw r18, r22 2dcc0: ce 55 subi r28, 0x5E ; 94 2dcc2: de 4f sbci r29, 0xFE ; 254 2dcc4: 68 81 ld r22, Y 2dcc6: 79 81 ldd r23, Y+1 ; 0x01 2dcc8: 8a 81 ldd r24, Y+2 ; 0x02 2dcca: 9b 81 ldd r25, Y+3 ; 0x03 2dccc: c2 5a subi r28, 0xA2 ; 162 2dcce: d1 40 sbci r29, 0x01 ; 1 2dcd0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2dcd4: c8 55 subi r28, 0x58 ; 88 2dcd6: de 4f sbci r29, 0xFE ; 254 2dcd8: a8 81 ld r26, Y 2dcda: b9 81 ldd r27, Y+1 ; 0x01 2dcdc: c8 5a subi r28, 0xA8 ; 168 2dcde: d1 40 sbci r29, 0x01 ; 1 2dce0: 6d 93 st X+, r22 2dce2: 7d 93 st X+, r23 2dce4: 8d 93 st X+, r24 2dce6: 9d 93 st X+, r25 2dce8: c8 55 subi r28, 0x58 ; 88 2dcea: de 4f sbci r29, 0xFE ; 254 2dcec: b9 83 std Y+1, r27 ; 0x01 2dcee: a8 83 st Y, r26 2dcf0: c8 5a subi r28, 0xA8 ; 168 2dcf2: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2dcf4: a7 01 movw r20, r14 2dcf6: 96 01 movw r18, r12 2dcf8: c2 56 subi r28, 0x62 ; 98 2dcfa: de 4f sbci r29, 0xFE ; 254 2dcfc: 68 81 ld r22, Y 2dcfe: 79 81 ldd r23, Y+1 ; 0x01 2dd00: 8a 81 ldd r24, Y+2 ; 0x02 2dd02: 9b 81 ldd r25, Y+3 ; 0x03 2dd04: ce 59 subi r28, 0x9E ; 158 2dd06: d1 40 sbci r29, 0x01 ; 1 2dd08: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2dd0c: ca 55 subi r28, 0x5A ; 90 2dd0e: de 4f sbci r29, 0xFE ; 254 2dd10: e8 81 ld r30, Y 2dd12: f9 81 ldd r31, Y+1 ; 0x01 2dd14: c6 5a subi r28, 0xA6 ; 166 2dd16: d1 40 sbci r29, 0x01 ; 1 2dd18: 61 93 st Z+, r22 2dd1a: 71 93 st Z+, r23 2dd1c: 81 93 st Z+, r24 2dd1e: 91 93 st Z+, r25 2dd20: ca 55 subi r28, 0x5A ; 90 2dd22: de 4f sbci r29, 0xFE ; 254 2dd24: f9 83 std Y+1, r31 ; 0x01 2dd26: e8 83 st Y, r30 2dd28: c6 5a subi r28, 0xA6 ; 166 2dd2a: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2dd2c: c8 56 subi r28, 0x68 ; 104 2dd2e: de 4f sbci r29, 0xFE ; 254 2dd30: a8 81 ld r26, Y 2dd32: b9 81 ldd r27, Y+1 ; 0x01 2dd34: c8 59 subi r28, 0x98 ; 152 2dd36: d1 40 sbci r29, 0x01 ; 1 2dd38: cd 92 st X+, r12 2dd3a: dd 92 st X+, r13 2dd3c: ed 92 st X+, r14 2dd3e: fd 92 st X+, r15 2dd40: c8 56 subi r28, 0x68 ; 104 2dd42: de 4f sbci r29, 0xFE ; 254 2dd44: b9 83 std Y+1, r27 ; 0x01 2dd46: a8 83 st Y, r26 2dd48: c8 59 subi r28, 0x98 ; 152 2dd4a: d1 40 sbci r29, 0x01 ; 1 2dd4c: bf ef ldi r27, 0xFF ; 255 2dd4e: 2b 1a sub r2, r27 2dd50: 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){ 2dd52: e1 e2 ldi r30, 0x21 ; 33 2dd54: 2e 16 cp r2, r30 2dd56: 31 04 cpc r3, r1 2dd58: 09 f0 breq .+2 ; 0x2dd5c 2dd5a: 10 ce rjmp .-992 ; 0x2d97c 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); 2dd5c: 40 e0 ldi r20, 0x00 ; 0 2dd5e: 50 e0 ldi r21, 0x00 ; 0 2dd60: 60 e0 ldi r22, 0x00 ; 0 2dd62: 7d e3 ldi r23, 0x3D ; 61 2dd64: ce 01 movw r24, r28 2dd66: 87 5f subi r24, 0xF7 ; 247 2dd68: 9e 4f sbci r25, 0xFE ; 254 2dd6a: 0f 94 32 66 call 0x2cc64 ; 0x2cc64 2dd6e: 9b 01 movw r18, r22 2dd70: ac 01 movw r20, r24 2dd72: c3 57 subi r28, 0x73 ; 115 2dd74: de 4f sbci r29, 0xFE ; 254 2dd76: a8 81 ld r26, Y 2dd78: b9 81 ldd r27, Y+1 ; 0x01 2dd7a: cd 58 subi r28, 0x8D ; 141 2dd7c: d1 40 sbci r29, 0x01 ; 1 2dd7e: 6d 91 ld r22, X+ 2dd80: 7d 91 ld r23, X+ 2dd82: 8d 91 ld r24, X+ 2dd84: 9c 91 ld r25, X 2dd86: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2dd8a: c3 57 subi r28, 0x73 ; 115 2dd8c: de 4f sbci r29, 0xFE ; 254 2dd8e: e8 81 ld r30, Y 2dd90: f9 81 ldd r31, Y+1 ; 0x01 2dd92: cd 58 subi r28, 0x8D ; 141 2dd94: d1 40 sbci r29, 0x01 ; 1 2dd96: 60 83 st Z, r22 2dd98: 71 83 std Z+1, r23 ; 0x01 2dd9a: 82 83 std Z+2, r24 ; 0x02 2dd9c: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2dd9e: 40 e0 ldi r20, 0x00 ; 0 2dda0: 50 e0 ldi r21, 0x00 ; 0 2dda2: 60 e0 ldi r22, 0x00 ; 0 2dda4: 7d e3 ldi r23, 0x3D ; 61 2dda6: ce 01 movw r24, r28 2dda8: 8b 57 subi r24, 0x7B ; 123 2ddaa: 9f 4f sbci r25, 0xFF ; 255 2ddac: 0f 94 32 66 call 0x2cc64 ; 0x2cc64 2ddb0: 9b 01 movw r18, r22 2ddb2: ac 01 movw r20, r24 2ddb4: c1 57 subi r28, 0x71 ; 113 2ddb6: de 4f sbci r29, 0xFE ; 254 2ddb8: a8 81 ld r26, Y 2ddba: b9 81 ldd r27, Y+1 ; 0x01 2ddbc: cf 58 subi r28, 0x8F ; 143 2ddbe: d1 40 sbci r29, 0x01 ; 1 2ddc0: 6d 91 ld r22, X+ 2ddc2: 7d 91 ld r23, X+ 2ddc4: 8d 91 ld r24, X+ 2ddc6: 9c 91 ld r25, X 2ddc8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2ddcc: c1 57 subi r28, 0x71 ; 113 2ddce: de 4f sbci r29, 0xFE ; 254 2ddd0: e8 81 ld r30, Y 2ddd2: f9 81 ldd r31, Y+1 ; 0x01 2ddd4: cf 58 subi r28, 0x8F ; 143 2ddd6: d1 40 sbci r29, 0x01 ; 1 2ddd8: 60 83 st Z, r22 2ddda: 71 83 std Z+1, r23 ; 0x01 2dddc: 82 83 std Z+2, r24 ; 0x02 2ddde: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2dde0: 40 e0 ldi r20, 0x00 ; 0 2dde2: 50 e0 ldi r21, 0x00 ; 0 2dde4: 60 e8 ldi r22, 0x80 ; 128 2dde6: 7c e3 ldi r23, 0x3C ; 60 2dde8: ce 01 movw r24, r28 2ddea: 01 96 adiw r24, 0x01 ; 1 2ddec: 0f 94 32 66 call 0x2cc64 ; 0x2cc64 2ddf0: ce 56 subi r28, 0x6E ; 110 2ddf2: de 4f sbci r29, 0xFE ; 254 2ddf4: a8 81 ld r26, Y 2ddf6: b9 81 ldd r27, Y+1 ; 0x01 2ddf8: c2 59 subi r28, 0x92 ; 146 2ddfa: d1 40 sbci r29, 0x01 ; 1 2ddfc: 2d 91 ld r18, X+ 2ddfe: 3d 91 ld r19, X+ 2de00: 4d 91 ld r20, X+ 2de02: 5c 91 ld r21, X 2de04: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2de08: 16 2f mov r17, r22 2de0a: 07 2f mov r16, r23 2de0c: f8 2e mov r15, r24 2de0e: e9 2e mov r14, r25 r = MAX(2, r); 2de10: 20 e0 ldi r18, 0x00 ; 0 2de12: 30 e0 ldi r19, 0x00 ; 0 2de14: 40 e0 ldi r20, 0x00 ; 0 2de16: 50 e4 ldi r21, 0x40 ; 64 2de18: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 2de1c: 18 16 cp r1, r24 2de1e: 2c f0 brlt .+10 ; 0x2de2a 2de20: 10 e0 ldi r17, 0x00 ; 0 2de22: 00 e0 ldi r16, 0x00 ; 0 2de24: f1 2c mov r15, r1 2de26: 80 e4 ldi r24, 0x40 ; 64 2de28: e8 2e mov r14, r24 2de2a: a8 01 movw r20, r16 2de2c: 97 01 movw r18, r14 2de2e: 85 2f mov r24, r21 2de30: 90 2f mov r25, r16 2de32: a3 2f mov r26, r19 2de34: be 2d mov r27, r14 2de36: ce 56 subi r28, 0x6E ; 110 2de38: de 4f sbci r29, 0xFE ; 254 2de3a: e8 81 ld r30, Y 2de3c: f9 81 ldd r31, Y+1 ; 0x01 2de3e: c2 59 subi r28, 0x92 ; 146 2de40: d1 40 sbci r29, 0x01 ; 1 2de42: 80 83 st Z, r24 2de44: 91 83 std Z+1, r25 ; 0x01 2de46: a2 83 std Z+2, r26 ; 0x02 2de48: b3 83 std Z+3, r27 ; 0x03 2de4a: cf 56 subi r28, 0x6F ; 111 2de4c: de 4f sbci r29, 0xFE ; 254 2de4e: f8 81 ld r31, Y 2de50: c1 59 subi r28, 0x91 ; 145 2de52: d1 40 sbci r29, 0x01 ; 1 2de54: f1 50 subi r31, 0x01 ; 1 2de56: cf 56 subi r28, 0x6F ; 111 2de58: de 4f sbci r29, 0xFE ; 254 2de5a: f8 83 st Y, r31 2de5c: c1 59 subi r28, 0x91 ; 145 2de5e: 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){ 2de60: f1 11 cpse r31, r1 2de62: 37 cd rjmp .-1426 ; 0x2d8d2 r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2de64: ef 92 push r14 2de66: ff 92 push r15 2de68: 0f 93 push r16 2de6a: 1f 93 push r17 2de6c: c1 57 subi r28, 0x71 ; 113 2de6e: de 4f sbci r29, 0xFE ; 254 2de70: a8 81 ld r26, Y 2de72: b9 81 ldd r27, Y+1 ; 0x01 2de74: cf 58 subi r28, 0x8F ; 143 2de76: d1 40 sbci r29, 0x01 ; 1 2de78: 13 96 adiw r26, 0x03 ; 3 2de7a: 8c 91 ld r24, X 2de7c: 13 97 sbiw r26, 0x03 ; 3 2de7e: 8f 93 push r24 2de80: 12 96 adiw r26, 0x02 ; 2 2de82: 8c 91 ld r24, X 2de84: 12 97 sbiw r26, 0x02 ; 2 2de86: 8f 93 push r24 2de88: 11 96 adiw r26, 0x01 ; 1 2de8a: 8c 91 ld r24, X 2de8c: 11 97 sbiw r26, 0x01 ; 1 2de8e: 8f 93 push r24 2de90: 8c 91 ld r24, X 2de92: 8f 93 push r24 2de94: c3 57 subi r28, 0x73 ; 115 2de96: de 4f sbci r29, 0xFE ; 254 2de98: e8 81 ld r30, Y 2de9a: f9 81 ldd r31, Y+1 ; 0x01 2de9c: cd 58 subi r28, 0x8D ; 141 2de9e: d1 40 sbci r29, 0x01 ; 1 2dea0: 83 81 ldd r24, Z+3 ; 0x03 2dea2: 8f 93 push r24 2dea4: 82 81 ldd r24, Z+2 ; 0x02 2dea6: 8f 93 push r24 2dea8: 81 81 ldd r24, Z+1 ; 0x01 2deaa: 8f 93 push r24 2deac: 80 81 ld r24, Z 2deae: 8f 93 push r24 2deb0: 84 ed ldi r24, 0xD4 ; 212 2deb2: 95 ea ldi r25, 0xA5 ; 165 2deb4: 9f 93 push r25 2deb6: 8f 93 push r24 2deb8: 0f 94 16 db call 0x3b62c ; 0x3b62c 2debc: 0f b6 in r0, 0x3f ; 63 2debe: f8 94 cli 2dec0: de bf out 0x3e, r29 ; 62 2dec2: 0f be out 0x3f, r0 ; 63 2dec4: cd bf out 0x3d, r28 ; 61 } 2dec6: c3 54 subi r28, 0x43 ; 67 2dec8: de 4f sbci r29, 0xFE ; 254 2deca: 0f b6 in r0, 0x3f ; 63 2decc: f8 94 cli 2dece: de bf out 0x3e, r29 ; 62 2ded0: 0f be out 0x3f, r0 ; 63 2ded2: cd bf out 0x3d, r28 ; 61 2ded4: df 91 pop r29 2ded6: cf 91 pop r28 2ded8: 1f 91 pop r17 2deda: 0f 91 pop r16 2dedc: ff 90 pop r15 2dede: ef 90 pop r14 2dee0: df 90 pop r13 2dee2: cf 90 pop r12 2dee4: bf 90 pop r11 2dee6: af 90 pop r10 2dee8: 9f 90 pop r9 2deea: 8f 90 pop r8 2deec: 7f 90 pop r7 2deee: 6f 90 pop r6 2def0: 5f 90 pop r5 2def2: 4f 90 pop r4 2def4: 3f 90 pop r3 2def6: 2f 90 pop r2 2def8: 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; 2defa: 60 e0 ldi r22, 0x00 ; 0 2defc: 70 e0 ldi r23, 0x00 ; 0 2defe: cb 01 movw r24, r22 2df00: d5 ce rjmp .-598 ; 0x2dcac 0002df02 : 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){ 2df02: ef 92 push r14 2df04: ff 92 push r15 2df06: 0f 93 push r16 2df08: 1f 93 push r17 2df0a: cf 93 push r28 2df0c: df 93 push r29 2df0e: 1f 92 push r1 2df10: 1f 92 push r1 2df12: cd b7 in r28, 0x3d ; 61 2df14: de b7 in r29, 0x3e ; 62 2df16: f8 2e mov r15, r24 2df18: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2df1a: 80 e1 ldi r24, 0x10 ; 16 2df1c: 97 e2 ldi r25, 0x27 ; 39 2df1e: 9a 83 std Y+2, r25 ; 0x02 2df20: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2df22: 8a 01 movw r16, r20 2df24: 16 95 lsr r17 2df26: 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); 2df28: 8f 2d mov r24, r15 2df2a: 0e 94 fa eb call 0x1d7f4 ; 0x1d7f4 while (steps--){ 2df2e: 01 50 subi r16, 0x01 ; 1 2df30: 11 09 sbc r17, r1 2df32: 78 f0 brcs .+30 ; 0x2df52 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2df34: 28 ec ldi r18, 0xC8 ; 200 2df36: 30 e0 ldi r19, 0x00 ; 0 2df38: ae 01 movw r20, r28 2df3a: 4f 5f subi r20, 0xFF ; 255 2df3c: 5f 4f sbci r21, 0xFF ; 255 2df3e: 68 ee ldi r22, 0xE8 ; 232 2df40: 73 e0 ldi r23, 0x03 ; 3 2df42: 8f 2d mov r24, r15 2df44: 0e 94 cb ea call 0x1d596 ; 0x1d596 update_position_1_step(axes, dir); 2df48: 6e 2d mov r22, r14 2df4a: 8f 2d mov r24, r15 2df4c: 0e 94 13 ec call 0x1d826 ; 0x1d826 2df50: ee cf rjmp .-36 ; 0x2df2e } /// \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); 2df52: 6e 2d mov r22, r14 2df54: 8f 2d mov r24, r15 2df56: 0e 94 fa eb call 0x1d7f4 ; 0x1d7f4 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); } 2df5a: 0f 90 pop r0 2df5c: 0f 90 pop r0 2df5e: df 91 pop r29 2df60: cf 91 pop r28 2df62: 1f 91 pop r17 2df64: 0f 91 pop r16 2df66: ff 90 pop r15 2df68: ef 90 pop r14 2df6a: 08 95 ret 0002df6c : /// 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) 2df6c: 2f 92 push r2 2df6e: 3f 92 push r3 2df70: 4f 92 push r4 2df72: 5f 92 push r5 2df74: 6f 92 push r6 2df76: 7f 92 push r7 2df78: 8f 92 push r8 2df7a: 9f 92 push r9 2df7c: af 92 push r10 2df7e: bf 92 push r11 2df80: cf 92 push r12 2df82: df 92 push r13 2df84: ef 92 push r14 2df86: ff 92 push r15 2df88: 0f 93 push r16 2df8a: 1f 93 push r17 2df8c: cf 93 push r28 2df8e: df 93 push r29 2df90: cd b7 in r28, 0x3d ; 61 2df92: de b7 in r29, 0x3e ; 62 2df94: 6c 97 sbiw r28, 0x1c ; 28 2df96: 0f b6 in r0, 0x3f ; 63 2df98: f8 94 cli 2df9a: de bf out 0x3e, r29 ; 62 2df9c: 0f be out 0x3f, r0 ; 63 2df9e: cd bf out 0x3d, r28 ; 61 2dfa0: 6c 01 movw r12, r24 2dfa2: 5b 01 movw r10, r22 2dfa4: 4a 01 movw r8, r20 2dfa6: 19 01 movw r2, r18 2dfa8: 18 87 std Y+8, r17 ; 0x08 2dfaa: 0f 83 std Y+7, r16 ; 0x07 2dfac: fa 82 std Y+2, r15 ; 0x02 2dfae: 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; 2dfb0: d7 01 movw r26, r14 2dfb2: 8d 91 ld r24, X+ 2dfb4: 9c 91 ld r25, X 2dfb6: 60 ed ldi r22, 0xD0 ; 208 2dfb8: 72 e0 ldi r23, 0x02 ; 2 2dfba: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 2dfbe: 9c 8f std Y+28, r25 ; 0x1c 2dfc0: 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); 2dfc2: 9f 93 push r25 2dfc4: 8f 93 push r24 2dfc6: 3f 92 push r3 2dfc8: 2f 93 push r18 2dfca: 1f 92 push r1 2dfcc: 84 e6 ldi r24, 0x64 ; 100 2dfce: 8f 93 push r24 2dfd0: 9f 92 push r9 2dfd2: 8f 92 push r8 2dfd4: bf 92 push r11 2dfd6: af 92 push r10 2dfd8: df 92 push r13 2dfda: cf 92 push r12 2dfdc: 82 e5 ldi r24, 0x52 ; 82 2dfde: 95 ea ldi r25, 0xA5 ; 165 2dfe0: 9f 93 push r25 2dfe2: 8f 93 push r24 2dfe4: 0f 94 16 db call 0x3b62c ; 0x3b62c 2dfe8: 0f b6 in r0, 0x3f ; 63 2dfea: f8 94 cli 2dfec: de bf out 0x3e, r29 ; 62 2dfee: 0f be out 0x3f, r0 ; 63 2dff0: 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; 2dff2: 22 27 eor r18, r18 2dff4: 33 27 eor r19, r19 2dff6: 22 19 sub r18, r2 2dff8: 33 09 sbc r19, r3 2dffa: 3a 8f std Y+26, r19 ; 0x1a 2dffc: 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)); 2dffe: c4 01 movw r24, r8 2e000: 99 0c add r9, r9 2e002: aa 0b sbc r26, r26 2e004: bb 0b sbc r27, r27 2e006: 89 87 std Y+9, r24 ; 0x09 2e008: 9a 87 std Y+10, r25 ; 0x0a 2e00a: ab 87 std Y+11, r26 ; 0x0b 2e00c: 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)); 2e00e: 95 01 movw r18, r10 2e010: bb 0c add r11, r11 2e012: 44 0b sbc r20, r20 2e014: 55 0b sbc r21, r21 2e016: 29 8b std Y+17, r18 ; 0x11 2e018: 3a 8b std Y+18, r19 ; 0x12 2e01a: 4b 8b std Y+19, r20 ; 0x13 2e01c: 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)); 2e01e: c6 01 movw r24, r12 2e020: dd 0c add r13, r13 2e022: aa 0b sbc r26, r26 2e024: bb 0b sbc r27, r27 2e026: 8d 8b std Y+21, r24 ; 0x15 2e028: 9e 8b std Y+22, r25 ; 0x16 2e02a: af 8b std Y+23, r26 ; 0x17 2e02c: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2e02e: 12 14 cp r1, r2 2e030: 13 04 cpc r1, r3 2e032: 0c f0 brlt .+2 ; 0x2e036 2e034: ba c0 rjmp .+372 ; 0x2e1aa { dad = dad_max - (ad / k); 2e036: 8b 8d ldd r24, Y+27 ; 0x1b 2e038: 9c 8d ldd r25, Y+28 ; 0x1c 2e03a: 6c e3 ldi r22, 0x3C ; 60 2e03c: 70 e0 ldi r23, 0x00 ; 0 2e03e: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 2e042: 10 e1 ldi r17, 0x10 ; 16 2e044: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2e046: 2b 8d ldd r18, Y+27 ; 0x1b 2e048: 3c 8d ldd r19, Y+28 ; 0x1c 2e04a: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2e04c: 0f 94 74 dd call 0x3bae8 ; 0x3bae8 <__usmulhisi3> 2e050: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 2e054: 20 e0 ldi r18, 0x00 ; 0 2e056: 30 e0 ldi r19, 0x00 ; 0 2e058: 44 e3 ldi r20, 0x34 ; 52 2e05a: 54 e4 ldi r21, 0x44 ; 68 2e05c: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 2e060: 6b 01 movw r12, r22 2e062: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2e064: 6f 81 ldd r22, Y+7 ; 0x07 2e066: 78 85 ldd r23, Y+8 ; 0x08 2e068: eb 8d ldd r30, Y+27 ; 0x1b 2e06a: fc 8d ldd r31, Y+28 ; 0x1c 2e06c: 6e 0f add r22, r30 2e06e: 7f 1f adc r23, r31 2e070: 90 e0 ldi r25, 0x00 ; 0 2e072: 80 e0 ldi r24, 0x00 ; 0 2e074: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 2e078: 25 e3 ldi r18, 0x35 ; 53 2e07a: 3a ef ldi r19, 0xFA ; 250 2e07c: 4e e8 ldi r20, 0x8E ; 142 2e07e: 5c e3 ldi r21, 0x3C ; 60 2e080: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2e084: 4b 01 movw r8, r22 2e086: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2e088: 0f 94 76 de call 0x3bcec ; 0x3bcec 2e08c: 6b 83 std Y+3, r22 ; 0x03 2e08e: 7c 83 std Y+4, r23 ; 0x04 2e090: 8d 83 std Y+5, r24 ; 0x05 2e092: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2e094: c5 01 movw r24, r10 2e096: b4 01 movw r22, r8 2e098: 0f 94 3c e1 call 0x3c278 ; 0x3c278 2e09c: 2b 01 movw r4, r22 2e09e: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2e0a0: 69 85 ldd r22, Y+9 ; 0x09 2e0a2: 7a 85 ldd r23, Y+10 ; 0x0a 2e0a4: 8b 85 ldd r24, Y+11 ; 0x0b 2e0a6: 9c 85 ldd r25, Y+12 ; 0x0c 2e0a8: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2e0ac: 4b 01 movw r8, r22 2e0ae: 5c 01 movw r10, r24 2e0b0: 2b 8d ldd r18, Y+27 ; 0x1b 2e0b2: 3c 8d ldd r19, Y+28 ; 0x1c 2e0b4: a4 e6 ldi r26, 0x64 ; 100 2e0b6: b0 e0 ldi r27, 0x00 ; 0 2e0b8: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> 2e0bc: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2e0c0: 20 e0 ldi r18, 0x00 ; 0 2e0c2: 30 e0 ldi r19, 0x00 ; 0 2e0c4: 44 e3 ldi r20, 0x34 ; 52 2e0c6: 54 e4 ldi r21, 0x44 ; 68 2e0c8: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 2e0cc: 9b 01 movw r18, r22 2e0ce: ac 01 movw r20, r24 2e0d0: c5 01 movw r24, r10 2e0d2: b4 01 movw r22, r8 2e0d4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 2e0d8: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2e0dc: 6d 87 std Y+13, r22 ; 0x0d 2e0de: 7e 87 std Y+14, r23 ; 0x0e 2e0e0: 8f 87 std Y+15, r24 ; 0x0f 2e0e2: 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)); 2e0e4: 69 89 ldd r22, Y+17 ; 0x11 2e0e6: 7a 89 ldd r23, Y+18 ; 0x12 2e0e8: 8b 89 ldd r24, Y+19 ; 0x13 2e0ea: 9c 89 ldd r25, Y+20 ; 0x14 2e0ec: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2e0f0: 4b 01 movw r8, r22 2e0f2: 5c 01 movw r10, r24 2e0f4: a3 01 movw r20, r6 2e0f6: 92 01 movw r18, r4 2e0f8: c7 01 movw r24, r14 2e0fa: b6 01 movw r22, r12 2e0fc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2e100: 9b 01 movw r18, r22 2e102: ac 01 movw r20, r24 2e104: c5 01 movw r24, r10 2e106: b4 01 movw r22, r8 2e108: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2e10c: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2e110: 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)); 2e112: 6d 89 ldd r22, Y+21 ; 0x15 2e114: 7e 89 ldd r23, Y+22 ; 0x16 2e116: 8f 89 ldd r24, Y+23 ; 0x17 2e118: 98 8d ldd r25, Y+24 ; 0x18 2e11a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 2e11e: 2b 01 movw r4, r22 2e120: 3c 01 movw r6, r24 2e122: a7 01 movw r20, r14 2e124: 96 01 movw r18, r12 2e126: 6b 81 ldd r22, Y+3 ; 0x03 2e128: 7c 81 ldd r23, Y+4 ; 0x04 2e12a: 8d 81 ldd r24, Y+5 ; 0x05 2e12c: 9e 81 ldd r25, Y+6 ; 0x06 2e12e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2e132: 9b 01 movw r18, r22 2e134: ac 01 movw r20, r24 2e136: c3 01 movw r24, r6 2e138: b2 01 movw r22, r4 2e13a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 2e13e: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2e142: 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)) 2e144: 01 e0 ldi r16, 0x01 ; 1 2e146: 20 e4 ldi r18, 0x40 ; 64 2e148: 31 e0 ldi r19, 0x01 ; 1 2e14a: 4d 85 ldd r20, Y+13 ; 0x0d 2e14c: 5e 85 ldd r21, Y+14 ; 0x0e 2e14e: b4 01 movw r22, r8 2e150: 0e 94 53 ec call 0x1d8a6 ; 0x1d8a6 2e154: 21 2f mov r18, r17 2e156: 30 e0 ldi r19, 0x00 ; 0 2e158: 88 23 and r24, r24 2e15a: b9 f1 breq .+110 ; 0x2e1ca 2e15c: 4b 8d ldd r20, Y+27 ; 0x1b 2e15e: 5c 8d ldd r21, Y+28 ; 0x1c 2e160: 42 0f add r20, r18 2e162: 53 1f adc r21, r19 { ad += dad + 1; 2e164: 4f 5f subi r20, 0xFF ; 255 2e166: 5f 4f sbci r21, 0xFF ; 255 2e168: 5c 8f std Y+28, r21 ; 0x1c 2e16a: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2e16c: eb 8d ldd r30, Y+27 ; 0x1b 2e16e: fc 8d ldd r31, Y+28 ; 0x1c 2e170: a9 81 ldd r26, Y+1 ; 0x01 2e172: ba 81 ldd r27, Y+2 ; 0x02 2e174: ed 93 st X+, r30 2e176: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2e178: 6c 96 adiw r28, 0x1c ; 28 2e17a: 0f b6 in r0, 0x3f ; 63 2e17c: f8 94 cli 2e17e: de bf out 0x3e, r29 ; 62 2e180: 0f be out 0x3f, r0 ; 63 2e182: cd bf out 0x3d, r28 ; 61 2e184: df 91 pop r29 2e186: cf 91 pop r28 2e188: 1f 91 pop r17 2e18a: 0f 91 pop r16 2e18c: ff 90 pop r15 2e18e: ef 90 pop r14 2e190: df 90 pop r13 2e192: cf 90 pop r12 2e194: bf 90 pop r11 2e196: af 90 pop r10 2e198: 9f 90 pop r9 2e19a: 8f 90 pop r8 2e19c: 7f 90 pop r7 2e19e: 6f 90 pop r6 2e1a0: 5f 90 pop r5 2e1a2: 4f 90 pop r4 2e1a4: 3f 90 pop r3 2e1a6: 2f 90 pop r2 2e1a8: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2e1aa: 2f ec ldi r18, 0xCF ; 207 2e1ac: 32 e0 ldi r19, 0x02 ; 2 2e1ae: ab 8d ldd r26, Y+27 ; 0x1b 2e1b0: bc 8d ldd r27, Y+28 ; 0x1c 2e1b2: 2a 1b sub r18, r26 2e1b4: 3b 0b sbc r19, r27 2e1b6: c9 01 movw r24, r18 2e1b8: 6c e3 ldi r22, 0x3C ; 60 2e1ba: 70 e0 ldi r23, 0x00 ; 0 2e1bc: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 2e1c0: 10 e1 ldi r17, 0x10 ; 16 2e1c2: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2e1c4: a9 8d ldd r26, Y+25 ; 0x19 2e1c6: ba 8d ldd r27, Y+26 ; 0x1a 2e1c8: 41 cf rjmp .-382 ; 0x2e04c // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2e1ca: 2f 5f subi r18, 0xFF ; 255 2e1cc: 3f 4f sbci r19, 0xFF ; 255 2e1ce: ab 8d ldd r26, Y+27 ; 0x1b 2e1d0: bc 8d ldd r27, Y+28 ; 0x1c 2e1d2: a2 0f add r26, r18 2e1d4: b3 1f adc r27, r19 2e1d6: bc 8f std Y+28, r27 ; 0x1c 2e1d8: ab 8f std Y+27, r26 ; 0x1b 2e1da: a0 3d cpi r26, 0xD0 ; 208 2e1dc: b2 40 sbci r27, 0x02 ; 2 2e1de: 08 f4 brcc .+2 ; 0x2e1e2 2e1e0: 26 cf rjmp .-436 ; 0x2e02e 2e1e2: c4 cf rjmp .-120 ; 0x2e16c 0002e1e4 : 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){ 2e1e4: 2f 92 push r2 2e1e6: 3f 92 push r3 2e1e8: 4f 92 push r4 2e1ea: 5f 92 push r5 2e1ec: 6f 92 push r6 2e1ee: 7f 92 push r7 2e1f0: 8f 92 push r8 2e1f2: 9f 92 push r9 2e1f4: af 92 push r10 2e1f6: bf 92 push r11 2e1f8: cf 92 push r12 2e1fa: df 92 push r13 2e1fc: ef 92 push r14 2e1fe: ff 92 push r15 2e200: 0f 93 push r16 2e202: 1f 93 push r17 2e204: cf 93 push r28 2e206: df 93 push r29 2e208: cd b7 in r28, 0x3d ; 61 2e20a: de b7 in r29, 0x3e ; 62 2e20c: ca 55 subi r28, 0x5A ; 90 2e20e: d1 09 sbc r29, r1 2e210: 0f b6 in r0, 0x3f ; 63 2e212: f8 94 cli 2e214: de bf out 0x3e, r29 ; 62 2e216: 0f be out 0x3f, r0 ; 63 2e218: cd bf out 0x3d, r28 ; 61 2e21a: 63 96 adiw r28, 0x13 ; 19 2e21c: 9f af std Y+63, r25 ; 0x3f 2e21e: 8e af std Y+62, r24 ; 0x3e 2e220: 63 97 sbiw r28, 0x13 ; 19 2e222: 8b 01 movw r16, r22 2e224: 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 2e226: 7e 01 movw r14, r28 2e228: 25 e4 ldi r18, 0x45 ; 69 2e22a: e2 0e add r14, r18 2e22c: f1 1c adc r15, r1 2e22e: 80 e1 ldi r24, 0x10 ; 16 2e230: 97 e2 ldi r25, 0x27 ; 39 2e232: f7 01 movw r30, r14 2e234: 91 83 std Z+1, r25 ; 0x01 2e236: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2e238: 8f e9 ldi r24, 0x9F ; 159 2e23a: 95 ea ldi r25, 0xA5 ; 165 2e23c: 9f 93 push r25 2e23e: 8f 93 push r24 2e240: 0f 94 16 db call 0x3b62c ; 0x3b62c 2e244: 25 ec ldi r18, 0xC5 ; 197 2e246: 36 e0 ldi r19, 0x06 ; 6 2e248: 61 96 adiw r28, 0x11 ; 17 2e24a: 3f af std Y+63, r19 ; 0x3f 2e24c: 2e af std Y+62, r18 ; 0x3e 2e24e: 61 97 sbiw r28, 0x11 ; 17 2e250: c8 01 movw r24, r16 2e252: 80 5e subi r24, 0xE0 ; 224 2e254: 93 40 sbci r25, 0x03 ; 3 2e256: 2b 96 adiw r28, 0x0b ; 11 2e258: 9f af std Y+63, r25 ; 0x3f 2e25a: 8e af std Y+62, r24 ; 0x3e 2e25c: 2b 97 sbiw r28, 0x0b ; 11 2e25e: 0f 90 pop r0 2e260: 0f 90 pop r0 2e262: e0 e4 ldi r30, 0x40 ; 64 2e264: f0 e0 ldi r31, 0x00 ; 0 2e266: 29 96 adiw r28, 0x09 ; 9 2e268: ff af std Y+63, r31 ; 0x3f 2e26a: ee af std Y+62, r30 ; 0x3e 2e26c: 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); 2e26e: 63 96 adiw r28, 0x13 ; 19 2e270: 2e ad ldd r18, Y+62 ; 0x3e 2e272: 3f ad ldd r19, Y+63 ; 0x3f 2e274: 63 97 sbiw r28, 0x13 ; 19 2e276: 20 5e subi r18, 0xE0 ; 224 2e278: 33 40 sbci r19, 0x03 ; 3 2e27a: 69 96 adiw r28, 0x19 ; 25 2e27c: 3f af std Y+63, r19 ; 0x3f 2e27e: 2e af std Y+62, r18 ; 0x3e 2e280: 69 97 sbiw r28, 0x19 ; 25 2e282: 29 96 adiw r28, 0x09 ; 9 2e284: 4e ac ldd r4, Y+62 ; 0x3e 2e286: 5f ac ldd r5, Y+63 ; 0x3f 2e288: 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){ 2e28a: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2e28c: 63 96 adiw r28, 0x13 ; 19 2e28e: 8e ad ldd r24, Y+62 ; 0x3e 2e290: 9f ad ldd r25, Y+63 ; 0x3f 2e292: 63 97 sbiw r28, 0x13 ; 19 2e294: 80 52 subi r24, 0x20 ; 32 2e296: 9c 4f sbci r25, 0xFC ; 252 2e298: 6b 96 adiw r28, 0x1b ; 27 2e29a: 9f af std Y+63, r25 ; 0x3f 2e29c: 8e af std Y+62, r24 ; 0x3e 2e29e: 6b 97 sbiw r28, 0x1b ; 27 2e2a0: 60 90 bb 06 lds r6, 0x06BB ; 0x8006bb 2e2a4: 70 90 bc 06 lds r7, 0x06BC ; 0x8006bc 2e2a8: 80 90 bd 06 lds r8, 0x06BD ; 0x8006bd 2e2ac: 90 90 be 06 lds r9, 0x06BE ; 0x8006be 2e2b0: 6b 96 adiw r28, 0x1b ; 27 2e2b2: ae ac ldd r10, Y+62 ; 0x3e 2e2b4: bf ac ldd r11, Y+63 ; 0x3f 2e2b6: 6b 97 sbiw r28, 0x1b ; 27 2e2b8: 31 10 cpse r3, r1 2e2ba: 04 c0 rjmp .+8 ; 0x2e2c4 2e2bc: 69 96 adiw r28, 0x19 ; 25 2e2be: ae ac ldd r10, Y+62 ; 0x3e 2e2c0: bf ac ldd r11, Y+63 ; 0x3f 2e2c2: 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; 2e2c4: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 2e2c8: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 2e2cc: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 2e2d0: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 2e2d4: f5 01 movw r30, r10 2e2d6: e8 1b sub r30, r24 2e2d8: f9 0b sbc r31, r25 2e2da: 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) 2e2dc: 71 f0 breq .+28 ; 0x2e2fa 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)); 2e2de: af 01 movw r20, r30 2e2e0: f7 ff sbrs r31, 7 2e2e2: 04 c0 rjmp .+8 ; 0x2e2ec 2e2e4: 44 27 eor r20, r20 2e2e6: 55 27 eor r21, r21 2e2e8: 4e 1b sub r20, r30 2e2ea: 5f 0b sbc r21, r31 2e2ec: 69 2f mov r22, r25 2e2ee: 66 1f adc r22, r22 2e2f0: 66 27 eor r22, r22 2e2f2: 66 1f adc r22, r22 2e2f4: 81 e0 ldi r24, 0x01 ; 1 2e2f6: 0f 94 81 6f call 0x2df02 ; 0x2df02 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2e2fa: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 2e2fe: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 2e302: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 2e306: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 2e30a: 2b 96 adiw r28, 0x0b ; 11 2e30c: 4e ad ldd r20, Y+62 ; 0x3e 2e30e: 5f ad ldd r21, Y+63 ; 0x3f 2e310: 2b 97 sbiw r28, 0x0b ; 11 2e312: 48 1b sub r20, r24 2e314: 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)); 2e316: 57 fd sbrc r21, 7 2e318: b2 c0 rjmp .+356 ; 0x2e47e 2e31a: 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) 2e31c: 41 15 cp r20, r1 2e31e: 51 05 cpc r21, r1 2e320: 09 f0 breq .+2 ; 0x2e324 2e322: ae c0 rjmp .+348 ; 0x2e480 // 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; 2e324: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e328: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e32c: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e330: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e334: 68 1a sub r6, r24 2e336: 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)); 2e338: 77 fc sbrc r7, 7 2e33a: ab c0 rjmp .+342 ; 0x2e492 2e33c: 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) 2e33e: 61 14 cp r6, r1 2e340: 71 04 cpc r7, r1 2e342: 09 f0 breq .+2 ; 0x2e346 2e344: a7 c0 rjmp .+334 ; 0x2e494 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); 2e346: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 2e34a: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 2e34e: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 2e352: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 2e356: 00 e0 ldi r16, 0x00 ; 0 2e358: 28 ec ldi r18, 0xC8 ; 200 2e35a: 30 e0 ldi r19, 0x00 ; 0 2e35c: 2b 96 adiw r28, 0x0b ; 11 2e35e: 6e ad ldd r22, Y+62 ; 0x3e 2e360: 7f ad ldd r23, Y+63 ; 0x3f 2e362: 2b 97 sbiw r28, 0x0b ; 11 2e364: c5 01 movw r24, r10 2e366: 0e 94 53 ec call 0x1d8a6 ; 0x1d8a6 sm4_set_dir(X_AXIS, d); 2e36a: 63 2d mov r22, r3 2e36c: 80 e0 ldi r24, 0x00 ; 0 2e36e: 0f 94 57 53 call 0x2a6ae ; 0x2a6ae //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2e372: 5f 92 push r5 2e374: 4f 92 push r4 2e376: 8b e9 ldi r24, 0x9B ; 155 2e378: 95 ea ldi r25, 0xA5 ; 165 2e37a: 9f 93 push r25 2e37c: 8f 93 push r24 2e37e: 0f 94 16 db call 0x3b62c ; 0x3b62c lcd_set_cursor(4,3); 2e382: 63 e0 ldi r22, 0x03 ; 3 2e384: 84 e0 ldi r24, 0x04 ; 4 2e386: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2e38a: 5f 92 push r5 2e38c: 4f 92 push r4 2e38e: 8c e8 ldi r24, 0x8C ; 140 2e390: 95 ea ldi r25, 0xA5 ; 165 2e392: 9f 93 push r25 2e394: 8f 93 push r24 2e396: 0e 94 39 6e call 0xdc72 ; 0xdc72 2e39a: 0f b6 in r0, 0x3f ; 63 2e39c: f8 94 cli 2e39e: de bf out 0x3e, r29 ; 62 2e3a0: 0f be out 0x3f, r0 ; 63 2e3a2: cd bf out 0x3d, r28 ; 61 2e3a4: 21 e0 ldi r18, 0x01 ; 1 2e3a6: 30 e0 ldi r19, 0x00 ; 0 2e3a8: 31 10 cpse r3, r1 2e3aa: 02 c0 rjmp .+4 ; 0x2e3b0 2e3ac: 2f ef ldi r18, 0xFF ; 255 2e3ae: 3f ef ldi r19, 0xFF ; 255 2e3b0: 40 ec ldi r20, 0xC0 ; 192 2e3b2: 42 03 mulsu r20, r18 2e3b4: c0 01 movw r24, r0 2e3b6: 43 9f mul r20, r19 2e3b8: 90 0d add r25, r0 2e3ba: 11 24 eor r1, r1 2e3bc: 67 96 adiw r28, 0x17 ; 23 2e3be: 9f af std Y+63, r25 ; 0x3f 2e3c0: 8e af std Y+62, r24 ; 0x3e 2e3c2: 67 97 sbiw r28, 0x17 ; 23 2e3c4: 40 ee ldi r20, 0xE0 ; 224 2e3c6: 53 e0 ldi r21, 0x03 ; 3 2e3c8: 24 9f mul r18, r20 2e3ca: 40 01 movw r8, r0 2e3cc: 25 9f mul r18, r21 2e3ce: 90 0c add r9, r0 2e3d0: 34 9f mul r19, r20 2e3d2: 90 0c add r9, r0 2e3d4: 11 24 eor r1, r1 2e3d6: 63 96 adiw r28, 0x13 ; 19 2e3d8: ee ad ldd r30, Y+62 ; 0x3e 2e3da: ff ad ldd r31, Y+63 ; 0x3f 2e3dc: 63 97 sbiw r28, 0x13 ; 19 2e3de: 8e 0e add r8, r30 2e3e0: 9f 1e adc r9, r31 2e3e2: 9e 01 movw r18, r28 2e3e4: 2f 5f subi r18, 0xFF ; 255 2e3e6: 3f 4f sbci r19, 0xFF ; 255 2e3e8: 2d 96 adiw r28, 0x0d ; 13 2e3ea: 3f af std Y+63, r19 ; 0x3f 2e3ec: 2e af std Y+62, r18 ; 0x3e 2e3ee: 2d 97 sbiw r28, 0x0d ; 13 2e3f0: 61 96 adiw r28, 0x11 ; 17 2e3f2: 8e ad ldd r24, Y+62 ; 0x3e 2e3f4: 9f ad ldd r25, Y+63 ; 0x3f 2e3f6: 61 97 sbiw r28, 0x11 ; 17 2e3f8: 2f 96 adiw r28, 0x0f ; 15 2e3fa: 9f af std Y+63, r25 ; 0x3f 2e3fc: 8e af std Y+62, r24 ; 0x3e 2e3fe: 2f 97 sbiw r28, 0x0f ; 15 2e400: 71 2c mov r7, r1 2e402: 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; 2e404: e0 e1 ldi r30, 0x10 ; 16 2e406: f7 e2 ldi r31, 0x27 ; 39 2e408: 27 96 adiw r28, 0x07 ; 7 2e40a: ff af std Y+63, r31 ; 0x3f 2e40c: ee af std Y+62, r30 ; 0x3e 2e40e: 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); 2e410: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 2e414: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 2e418: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 2e41c: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 2e420: 84 01 movw r16, r8 2e422: 08 1b sub r16, r24 2e424: 19 0b sbc r17, r25 2e426: 17 ff sbrs r17, 7 2e428: 03 c0 rjmp .+6 ; 0x2e430 2e42a: 11 95 neg r17 2e42c: 01 95 neg r16 2e42e: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2e430: 98 01 movw r18, r16 2e432: 35 95 asr r19 2e434: 27 95 ror r18 2e436: 65 96 adiw r28, 0x15 ; 21 2e438: 3f af std Y+63, r19 ; 0x3f 2e43a: 2e af std Y+62, r18 ; 0x3e 2e43c: 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; 2e43e: 1c 9b sbis 0x03, 4 ; 3 2e440: 33 c0 rjmp .+102 ; 0x2e4a8 2e442: 45 e0 ldi r20, 0x05 ; 5 2e444: 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); 2e446: 65 96 adiw r28, 0x15 ; 21 2e448: ae ac ldd r10, Y+62 ; 0x3e 2e44a: bf ac ldd r11, Y+63 ; 0x3f 2e44c: 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); 2e44e: 63 2d mov r22, r3 2e450: 82 2d mov r24, r2 2e452: 0e 94 fa eb call 0x1d7f4 ; 0x1d7f4 while (steps--){ 2e456: 31 e0 ldi r19, 0x01 ; 1 2e458: a3 1a sub r10, r19 2e45a: b1 08 sbc r11, r1 2e45c: 40 f1 brcs .+80 ; 0x2e4ae accelerate_1_step(axes, acc, delay_us, min_delay_us); 2e45e: 28 ec ldi r18, 0xC8 ; 200 2e460: 30 e0 ldi r19, 0x00 ; 0 2e462: a7 01 movw r20, r14 2e464: 68 ee ldi r22, 0xE8 ; 232 2e466: 73 e0 ldi r23, 0x03 ; 3 2e468: 82 2d mov r24, r2 2e46a: 0e 94 cb ea call 0x1d596 ; 0x1d596 update_position_1_step(axes, dir); 2e46e: 63 2d mov r22, r3 2e470: 82 2d mov r24, r2 2e472: 0e 94 13 ec call 0x1d826 ; 0x1d826 2e476: ef cf rjmp .-34 ; 0x2e456 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){ 2e478: 33 24 eor r3, r3 2e47a: 33 94 inc r3 2e47c: 11 cf rjmp .-478 ; 0x2e2a0 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)); 2e47e: 62 e0 ldi r22, 0x02 ; 2 2e480: 57 ff sbrs r21, 7 2e482: 03 c0 rjmp .+6 ; 0x2e48a 2e484: 51 95 neg r21 2e486: 41 95 neg r20 2e488: 51 09 sbc r21, r1 2e48a: 82 e0 ldi r24, 0x02 ; 2 2e48c: 0f 94 81 6f call 0x2df02 ; 0x2df02 2e490: 49 cf rjmp .-366 ; 0x2e324 // 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)); 2e492: 64 e0 ldi r22, 0x04 ; 4 2e494: a3 01 movw r20, r6 2e496: 77 fe sbrs r7, 7 2e498: 03 c0 rjmp .+6 ; 0x2e4a0 2e49a: 51 95 neg r21 2e49c: 41 95 neg r20 2e49e: 51 09 sbc r21, r1 2e4a0: 84 e0 ldi r24, 0x04 ; 4 2e4a2: 0f 94 81 6f call 0x2df02 ; 0x2df02 2e4a6: 4f cf rjmp .-354 ; 0x2e346 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; 2e4a8: 22 24 eor r2, r2 2e4aa: 23 94 inc r2 2e4ac: cc cf rjmp .-104 ; 0x2e446 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); 2e4ae: 65 96 adiw r28, 0x15 ; 21 2e4b0: ee ad ldd r30, Y+62 ; 0x3e 2e4b2: ff ad ldd r31, Y+63 ; 0x3f 2e4b4: 65 97 sbiw r28, 0x15 ; 21 2e4b6: 0e 1b sub r16, r30 2e4b8: 1f 0b sbc r17, r31 2e4ba: 23 96 adiw r28, 0x03 ; 3 2e4bc: 1f af std Y+63, r17 ; 0x3f 2e4be: 0e af std Y+62, r16 ; 0x3e 2e4c0: 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); 2e4c2: 63 2d mov r22, r3 2e4c4: 82 2d mov r24, r2 2e4c6: 0e 94 fa eb call 0x1d7f4 ; 0x1d7f4 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2e4ca: 9e 01 movw r18, r28 2e4cc: 2f 5b subi r18, 0xBF ; 191 2e4ce: 3f 4f sbci r19, 0xFF ; 255 2e4d0: a7 01 movw r20, r14 2e4d2: 68 ee ldi r22, 0xE8 ; 232 2e4d4: 73 e0 ldi r23, 0x03 ; 3 2e4d6: 82 2d mov r24, r2 2e4d8: 0e 94 71 eb call 0x1d6e2 ; 0x1d6e2 2e4dc: 88 23 and r24, r24 2e4de: 29 f0 breq .+10 ; 0x2e4ea update_position_1_step(axes, dir); 2e4e0: 63 2d mov r22, r3 2e4e2: 82 2d mov r24, r2 2e4e4: 0e 94 13 ec call 0x1d826 ; 0x1d826 2e4e8: f0 cf rjmp .-32 ; 0x2e4ca z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2e4ea: 60 e0 ldi r22, 0x00 ; 0 2e4ec: 82 e0 ldi r24, 0x02 ; 2 2e4ee: 0f 94 57 53 call 0x2a6ae ; 0x2a6ae /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2e4f2: 20 e1 ldi r18, 0x10 ; 16 2e4f4: 37 e2 ldi r19, 0x27 ; 39 2e4f6: 27 96 adiw r28, 0x07 ; 7 2e4f8: 3f af std Y+63, r19 ; 0x3f 2e4fa: 2e af std Y+62, r18 ; 0x3e 2e4fc: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2e4fe: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e502: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e506: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e50a: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 2e50e: 00 5a subi r16, 0xA0 ; 160 2e510: 16 4f sbci r17, 0xF6 ; 246 2e512: 17 ff sbrs r17, 7 2e514: 02 c0 rjmp .+4 ; 0x2e51a 2e516: 0f 5f subi r16, 0xFF ; 255 2e518: 1f 4f sbci r17, 0xFF ; 255 2e51a: 15 95 asr r17 2e51c: 07 95 ror r16 2e51e: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e522: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e526: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e52a: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e52e: 80 17 cp r24, r16 2e530: 91 07 cpc r25, r17 2e532: f4 f4 brge .+60 ; 0x2e570 if (!_PINDA){ 2e534: 1c 9b sbis 0x03, 4 ; 3 2e536: 1c c0 rjmp .+56 ; 0x2e570 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2e538: 28 ec ldi r18, 0xC8 ; 200 2e53a: 30 e0 ldi r19, 0x00 ; 0 2e53c: a7 01 movw r20, r14 2e53e: 68 ee ldi r22, 0xE8 ; 232 2e540: 73 e0 ldi r23, 0x03 ; 3 2e542: 84 e0 ldi r24, 0x04 ; 4 2e544: 0e 94 cb ea call 0x1d596 ; 0x1d596 /// 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_){ 2e548: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e54c: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e550: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e554: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e558: 01 96 adiw r24, 0x01 ; 1 2e55a: a1 1d adc r26, r1 2e55c: b1 1d adc r27, r1 2e55e: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e562: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e566: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e56a: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e56e: d7 cf rjmp .-82 ; 0x2e51e break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2e570: 1c 9b sbis 0x03, 4 ; 3 2e572: 3f c0 rjmp .+126 ; 0x2e5f2 steps_to_go = MAX(0, max_z - _Z); 2e574: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e578: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e57c: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e580: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e584: e0 e6 ldi r30, 0x60 ; 96 2e586: f9 e0 ldi r31, 0x09 ; 9 2e588: e8 1b sub r30, r24 2e58a: f9 0b sbc r31, r25 2e58c: cf 01 movw r24, r30 2e58e: f7 ff sbrs r31, 7 2e590: 02 c0 rjmp .+4 ; 0x2e596 2e592: 90 e0 ldi r25, 0x00 ; 0 2e594: 80 e0 ldi r24, 0x00 ; 0 2e596: 25 96 adiw r28, 0x05 ; 5 2e598: 9f af std Y+63, r25 ; 0x3f 2e59a: 8e af std Y+62, r24 ; 0x3e 2e59c: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2e59e: 1c 9b sbis 0x03, 4 ; 3 2e5a0: 28 c0 rjmp .+80 ; 0x2e5f2 2e5a2: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e5a6: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e5aa: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e5ae: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e5b2: 80 36 cpi r24, 0x60 ; 96 2e5b4: 99 40 sbci r25, 0x09 ; 9 2e5b6: ec f4 brge .+58 ; 0x2e5f2 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2e5b8: 9e 01 movw r18, r28 2e5ba: 2d 5b subi r18, 0xBD ; 189 2e5bc: 3f 4f sbci r19, 0xFF ; 255 2e5be: a7 01 movw r20, r14 2e5c0: 68 ee ldi r22, 0xE8 ; 232 2e5c2: 73 e0 ldi r23, 0x03 ; 3 2e5c4: 84 e0 ldi r24, 0x04 ; 4 2e5c6: 0e 94 71 eb call 0x1d6e2 ; 0x1d6e2 ++_Z_; 2e5ca: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e5ce: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e5d2: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e5d6: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e5da: 01 96 adiw r24, 0x01 ; 1 2e5dc: a1 1d adc r26, r1 2e5de: b1 1d adc r27, r1 2e5e0: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e5e4: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e5e8: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e5ec: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e5f0: d6 cf rjmp .-84 ; 0x2e59e /// \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); 2e5f2: 60 e0 ldi r22, 0x00 ; 0 2e5f4: 84 e0 ldi r24, 0x04 ; 4 2e5f6: 0e 94 fa eb call 0x1d7f4 ; 0x1d7f4 while (delay_us < MAX_DELAY){ 2e5fa: f7 01 movw r30, r14 2e5fc: 20 81 ld r18, Z 2e5fe: 31 81 ldd r19, Z+1 ; 0x01 2e600: 20 31 cpi r18, 0x10 ; 16 2e602: f7 e2 ldi r31, 0x27 ; 39 2e604: 3f 07 cpc r19, r31 2e606: 58 f4 brcc .+22 ; 0x2e61e accelerate_1_step(axes, -dec, delay_us, delay_us); 2e608: a7 01 movw r20, r14 2e60a: 68 e1 ldi r22, 0x18 ; 24 2e60c: 7c ef ldi r23, 0xFC ; 252 2e60e: 84 e0 ldi r24, 0x04 ; 4 2e610: 0e 94 cb ea call 0x1d596 ; 0x1d596 update_position_1_step(axes, dir); 2e614: 60 e0 ldi r22, 0x00 ; 0 2e616: 84 e0 ldi r24, 0x04 ; 4 2e618: 0e 94 13 ec call 0x1d826 ; 0x1d826 2e61c: ee cf rjmp .-36 ; 0x2e5fa } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2e61e: 61 e0 ldi r22, 0x01 ; 1 2e620: 82 e0 ldi r24, 0x02 ; 2 2e622: 0f 94 57 53 call 0x2a6ae ; 0x2a6ae /// speed up current_delay_us = MAX_DELAY; 2e626: 20 e1 ldi r18, 0x10 ; 16 2e628: 37 e2 ldi r19, 0x27 ; 39 2e62a: f7 01 movw r30, r14 2e62c: 31 83 std Z+1, r19 ; 0x01 2e62e: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2e630: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e634: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e638: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e63c: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 2e640: 0c 0d add r16, r12 2e642: 1d 1d adc r17, r13 2e644: 17 ff sbrs r17, 7 2e646: 02 c0 rjmp .+4 ; 0x2e64c 2e648: 0f 5f subi r16, 0xFF ; 255 2e64a: 1f 4f sbci r17, 0xFF ; 255 2e64c: 15 95 asr r17 2e64e: 07 95 ror r16 2e650: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e654: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e658: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e65c: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e660: 08 17 cp r16, r24 2e662: 19 07 cpc r17, r25 2e664: 0c f0 brlt .+2 ; 0x2e668 2e666: d9 c0 rjmp .+434 ; 0x2e81a if (_PINDA){ 2e668: 1c 9b sbis 0x03, 4 ; 3 2e66a: bb c0 rjmp .+374 ; 0x2e7e2 z_trig = _Z; 2e66c: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e670: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e674: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e678: 30 91 be 06 lds r19, 0x06BE ; 0x8006be break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 2e67c: 1c 99 sbic 0x03, 4 ; 3 2e67e: 28 c0 rjmp .+80 ; 0x2e6d0 steps_to_go = MAX(0, _Z - min_z); 2e680: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e684: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e688: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e68c: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e690: 8c 19 sub r24, r12 2e692: 9d 09 sbc r25, r13 2e694: 97 ff sbrs r25, 7 2e696: 02 c0 rjmp .+4 ; 0x2e69c 2e698: 90 e0 ldi r25, 0x00 ; 0 2e69a: 80 e0 ldi r24, 0x00 ; 0 2e69c: 25 96 adiw r28, 0x05 ; 5 2e69e: 9f af std Y+63, r25 ; 0x3f 2e6a0: 8e af std Y+62, r24 ; 0x3e 2e6a2: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2e6a4: 1c 99 sbic 0x03, 4 ; 3 2e6a6: 0c c0 rjmp .+24 ; 0x2e6c0 2e6a8: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e6ac: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e6b0: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e6b4: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e6b8: c8 16 cp r12, r24 2e6ba: d9 06 cpc r13, r25 2e6bc: 0c f4 brge .+2 ; 0x2e6c0 2e6be: af c0 rjmp .+350 ; 0x2e81e go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2e6c0: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e6c4: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e6c8: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e6cc: 30 91 be 06 lds r19, 0x06BE ; 0x8006be } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 2e6d0: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e6d4: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e6d8: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e6dc: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e6e0: c8 16 cp r12, r24 2e6e2: d9 06 cpc r13, r25 2e6e4: 3c f4 brge .+14 ; 0x2e6f4 2e6e6: f7 01 movw r30, r14 2e6e8: 80 81 ld r24, Z 2e6ea: 91 81 ldd r25, Z+1 ; 0x01 2e6ec: 80 31 cpi r24, 0x10 ; 16 2e6ee: 97 42 sbci r25, 0x27 ; 39 2e6f0: 08 f4 brcc .+2 ; 0x2e6f4 2e6f2: b2 c0 rjmp .+356 ; 0x2e858 2e6f4: 0c 19 sub r16, r12 2e6f6: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2e6f8: 31 10 cpse r3, r1 2e6fa: ca c0 rjmp .+404 ; 0x2e890 line_buffer[c] = (uint16_t)(z_trig - min_z); 2e6fc: f3 01 movw r30, r6 2e6fe: ee 0f add r30, r30 2e700: ff 1f adc r31, r31 2e702: 21 e0 ldi r18, 0x01 ; 1 2e704: 30 e0 ldi r19, 0x00 ; 0 2e706: 2c 0f add r18, r28 2e708: 3d 1f adc r19, r29 2e70a: e2 0f add r30, r18 2e70c: f3 1f adc r31, r19 2e70e: 11 83 std Z+1, r17 ; 0x01 2e710: 00 83 st Z, r16 2e712: ff ef ldi r31, 0xFF ; 255 2e714: 6f 1a sub r6, r31 2e716: 7f 0a sbc r7, r31 2e718: 67 96 adiw r28, 0x17 ; 23 2e71a: 2e ad ldd r18, Y+62 ; 0x3e 2e71c: 3f ad ldd r19, Y+63 ; 0x3f 2e71e: 67 97 sbiw r28, 0x17 ; 23 2e720: 82 0e add r8, r18 2e722: 93 1e adc r9, r19 2e724: 2d 96 adiw r28, 0x0d ; 13 2e726: 8e ad ldd r24, Y+62 ; 0x3e 2e728: 9f ad ldd r25, Y+63 ; 0x3f 2e72a: 2d 97 sbiw r28, 0x0d ; 13 2e72c: 02 97 sbiw r24, 0x02 ; 2 2e72e: 2d 96 adiw r28, 0x0d ; 13 2e730: 9f af std Y+63, r25 ; 0x3f 2e732: 8e af std Y+62, r24 ; 0x3e 2e734: 2d 97 sbiw r28, 0x0d ; 13 2e736: 2f 96 adiw r28, 0x0f ; 15 2e738: ee ad ldd r30, Y+62 ; 0x3e 2e73a: ff ad ldd r31, Y+63 ; 0x3f 2e73c: 2f 97 sbiw r28, 0x0f ; 15 2e73e: 31 97 sbiw r30, 0x01 ; 1 2e740: 2f 96 adiw r28, 0x0f ; 15 2e742: ff af std Y+63, r31 ; 0x3f 2e744: ee af std Y+62, r30 ; 0x3e 2e746: 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 2e748: f0 e2 ldi r31, 0x20 ; 32 2e74a: 6f 16 cp r6, r31 2e74c: 71 04 cpc r7, r1 2e74e: 09 f0 breq .+2 ; 0x2e752 2e750: 59 ce rjmp .-846 ; 0x2e404 2e752: 21 e0 ldi r18, 0x01 ; 1 2e754: 42 1a sub r4, r18 2e756: 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){ 2e758: 31 e0 ldi r19, 0x01 ; 1 2e75a: 33 12 cpse r3, r19 2e75c: 8d ce rjmp .-742 ; 0x2e478 2e75e: 61 96 adiw r28, 0x11 ; 17 2e760: 8e ad ldd r24, Y+62 ; 0x3e 2e762: 9f ad ldd r25, Y+63 ; 0x3f 2e764: 61 97 sbiw r28, 0x11 ; 17 2e766: 80 96 adiw r24, 0x20 ; 32 2e768: 61 96 adiw r28, 0x11 ; 17 2e76a: 9f af std Y+63, r25 ; 0x3f 2e76c: 8e af std Y+62, r24 ; 0x3e 2e76e: 61 97 sbiw r28, 0x11 ; 17 2e770: 2b 96 adiw r28, 0x0b ; 11 2e772: ee ad ldd r30, Y+62 ; 0x3e 2e774: ff ad ldd r31, Y+63 ; 0x3f 2e776: 2b 97 sbiw r28, 0x0b ; 11 2e778: e0 5c subi r30, 0xC0 ; 192 2e77a: ff 4f sbci r31, 0xFF ; 255 2e77c: 2b 96 adiw r28, 0x0b ; 11 2e77e: ff af std Y+63, r31 ; 0x3f 2e780: ee af std Y+62, r30 ; 0x3e 2e782: 2b 97 sbiw r28, 0x0b ; 11 2e784: 29 96 adiw r28, 0x09 ; 9 2e786: 2e ad ldd r18, Y+62 ; 0x3e 2e788: 3f ad ldd r19, Y+63 ; 0x3f 2e78a: 29 97 sbiw r28, 0x09 ; 9 2e78c: 22 50 subi r18, 0x02 ; 2 2e78e: 31 09 sbc r19, r1 2e790: 29 96 adiw r28, 0x09 ; 9 2e792: 3f af std Y+63, r19 ; 0x3f 2e794: 2e af std Y+62, r18 ; 0x3e 2e796: 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 2e798: 23 2b or r18, r19 2e79a: 09 f0 breq .+2 ; 0x2e79e 2e79c: 72 cd rjmp .-1308 ; 0x2e282 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); 2e79e: 8a e8 ldi r24, 0x8A ; 138 2e7a0: 95 ea ldi r25, 0xA5 ; 165 2e7a2: 9f 93 push r25 2e7a4: 8f 93 push r24 2e7a6: 0f 94 16 db call 0x3b62c ; 0x3b62c 2e7aa: 0f 90 pop r0 2e7ac: 0f 90 pop r0 } 2e7ae: c6 5a subi r28, 0xA6 ; 166 2e7b0: df 4f sbci r29, 0xFF ; 255 2e7b2: 0f b6 in r0, 0x3f ; 63 2e7b4: f8 94 cli 2e7b6: de bf out 0x3e, r29 ; 62 2e7b8: 0f be out 0x3f, r0 ; 63 2e7ba: cd bf out 0x3d, r28 ; 61 2e7bc: df 91 pop r29 2e7be: cf 91 pop r28 2e7c0: 1f 91 pop r17 2e7c2: 0f 91 pop r16 2e7c4: ff 90 pop r15 2e7c6: ef 90 pop r14 2e7c8: df 90 pop r13 2e7ca: cf 90 pop r12 2e7cc: bf 90 pop r11 2e7ce: af 90 pop r10 2e7d0: 9f 90 pop r9 2e7d2: 8f 90 pop r8 2e7d4: 7f 90 pop r7 2e7d6: 6f 90 pop r6 2e7d8: 5f 90 pop r5 2e7da: 4f 90 pop r4 2e7dc: 3f 90 pop r3 2e7de: 2f 90 pop r2 2e7e0: 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); 2e7e2: 28 ec ldi r18, 0xC8 ; 200 2e7e4: 30 e0 ldi r19, 0x00 ; 0 2e7e6: a7 01 movw r20, r14 2e7e8: 68 ee ldi r22, 0xE8 ; 232 2e7ea: 73 e0 ldi r23, 0x03 ; 3 2e7ec: 84 e0 ldi r24, 0x04 ; 4 2e7ee: 0e 94 cb ea call 0x1d596 ; 0x1d596 /// 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_){ 2e7f2: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e7f6: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e7fa: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e7fe: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e802: 01 97 sbiw r24, 0x01 ; 1 2e804: a1 09 sbc r26, r1 2e806: b1 09 sbc r27, r1 2e808: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e80c: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e810: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e814: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e818: 1b cf rjmp .-458 ; 0x2e650 2e81a: 86 01 movw r16, r12 2e81c: 2f cf rjmp .-418 ; 0x2e67c } /// 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); 2e81e: 9e 01 movw r18, r28 2e820: 2d 5b subi r18, 0xBD ; 189 2e822: 3f 4f sbci r19, 0xFF ; 255 2e824: a7 01 movw r20, r14 2e826: 68 ee ldi r22, 0xE8 ; 232 2e828: 73 e0 ldi r23, 0x03 ; 3 2e82a: 84 e0 ldi r24, 0x04 ; 4 2e82c: 0e 94 71 eb call 0x1d6e2 ; 0x1d6e2 --_Z_; 2e830: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e834: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e838: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e83c: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e840: 01 97 sbiw r24, 0x01 ; 1 2e842: a1 09 sbc r26, r1 2e844: b1 09 sbc r27, r1 2e846: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e84a: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e84e: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e852: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e856: 26 cf rjmp .-436 ; 0x2e6a4 } 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); 2e858: 28 ec ldi r18, 0xC8 ; 200 2e85a: 30 e0 ldi r19, 0x00 ; 0 2e85c: a7 01 movw r20, r14 2e85e: 68 e1 ldi r22, 0x18 ; 24 2e860: 7c ef ldi r23, 0xFC ; 252 2e862: 84 e0 ldi r24, 0x04 ; 4 2e864: 0e 94 cb ea call 0x1d596 ; 0x1d596 --_Z_; 2e868: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e86c: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e870: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e874: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e878: 01 97 sbiw r24, 0x01 ; 1 2e87a: a1 09 sbc r26, r1 2e87c: b1 09 sbc r27, r1 2e87e: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e882: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e886: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e88a: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e88e: 20 cf rjmp .-448 ; 0x2e6d0 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); 2e890: 2d 96 adiw r28, 0x0d ; 13 2e892: ee ad ldd r30, Y+62 ; 0x3e 2e894: ff ad ldd r31, Y+63 ; 0x3f 2e896: 2d 97 sbiw r28, 0x0d ; 13 2e898: 86 ad ldd r24, Z+62 ; 0x3e 2e89a: 97 ad ldd r25, Z+63 ; 0x3f 2e89c: 01 2e mov r0, r17 2e89e: 00 0c add r0, r0 2e8a0: 22 0b sbc r18, r18 2e8a2: 33 0b sbc r19, r19 2e8a4: 08 0f add r16, r24 2e8a6: 19 1f adc r17, r25 2e8a8: 21 1d adc r18, r1 2e8aa: 31 1d adc r19, r1 2e8ac: 36 95 lsr r19 2e8ae: 27 95 ror r18 2e8b0: 17 95 ror r17 2e8b2: 07 95 ror r16 2e8b4: 0f 3f cpi r16, 0xFF ; 255 2e8b6: 11 05 cpc r17, r1 2e8b8: 21 05 cpc r18, r1 2e8ba: 31 05 cpc r19, r1 2e8bc: 29 f0 breq .+10 ; 0x2e8c8 2e8be: 20 f0 brcs .+8 ; 0x2e8c8 2e8c0: 0f ef ldi r16, 0xFF ; 255 2e8c2: 10 e0 ldi r17, 0x00 ; 0 2e8c4: 20 e0 ldi r18, 0x00 ; 0 2e8c6: 30 e0 ldi r19, 0x00 ; 0 2e8c8: 2f 96 adiw r28, 0x0f ; 15 2e8ca: ee ad ldd r30, Y+62 ; 0x3e 2e8cc: ff ad ldd r31, Y+63 ; 0x3f 2e8ce: 2f 97 sbiw r28, 0x0f ; 15 2e8d0: 07 8f std Z+31, r16 ; 0x1f 2e8d2: 1f cf rjmp .-450 ; 0x2e712 0002e8d4 : 2e8d4: ef 92 push r14 2e8d6: ff 92 push r15 2e8d8: 0f 93 push r16 2e8da: 1f 93 push r17 2e8dc: cf 93 push r28 2e8de: df 93 push r29 2e8e0: cd b7 in r28, 0x3d ; 61 2e8e2: de b7 in r29, 0x3e ; 62 2e8e4: 2f 97 sbiw r28, 0x0f ; 15 2e8e6: 0f b6 in r0, 0x3f ; 63 2e8e8: f8 94 cli 2e8ea: de bf out 0x3e, r29 ; 62 2e8ec: 0f be out 0x3f, r0 ; 63 2e8ee: cd bf out 0x3d, r28 ; 61 2e8f0: e0 eb ldi r30, 0xB0 ; 176 2e8f2: f2 e1 ldi r31, 0x12 ; 18 2e8f4: 10 a2 std Z+32, r1 ; 0x20 2e8f6: 11 a2 std Z+33, r1 ; 0x21 2e8f8: 12 a2 std Z+34, r1 ; 0x22 2e8fa: 13 a2 std Z+35, r1 ; 0x23 2e8fc: 14 a2 std Z+36, r1 ; 0x24 2e8fe: 15 a2 std Z+37, r1 ; 0x25 2e900: 16 a2 std Z+38, r1 ; 0x26 2e902: 17 a2 std Z+39, r1 ; 0x27 2e904: 10 a6 std Z+40, r1 ; 0x28 2e906: 11 a6 std Z+41, r1 ; 0x29 2e908: 10 92 49 13 sts 0x1349, r1 ; 0x801349 2e90c: 0b e4 ldi r16, 0x4B ; 75 2e90e: 13 e1 ldi r17, 0x13 ; 19 2e910: ee 24 eor r14, r14 2e912: e3 94 inc r14 2e914: f1 2c mov r15, r1 2e916: d8 01 movw r26, r16 2e918: 11 96 adiw r26, 0x01 ; 1 2e91a: fc 92 st X, r15 2e91c: ee 92 st -X, r14 2e91e: 12 96 adiw r26, 0x02 ; 2 2e920: 1c 92 st X, r1 2e922: 12 97 sbiw r26, 0x02 ; 2 2e924: 82 e8 ldi r24, 0x82 ; 130 2e926: 13 96 adiw r26, 0x03 ; 3 2e928: 8c 93 st X, r24 2e92a: 40 e0 ldi r20, 0x00 ; 0 2e92c: 60 e0 ldi r22, 0x00 ; 0 2e92e: 80 e5 ldi r24, 0x50 ; 80 2e930: 93 e1 ldi r25, 0x13 ; 19 2e932: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 2e936: 40 e0 ldi r20, 0x00 ; 0 2e938: 60 e0 ldi r22, 0x00 ; 0 2e93a: 85 e5 ldi r24, 0x55 ; 85 2e93c: 93 e1 ldi r25, 0x13 ; 19 2e93e: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 2e942: f8 01 movw r30, r16 2e944: 17 86 std Z+15, r1 ; 0x0f 2e946: 10 8a std Z+16, r1 ; 0x10 2e948: 11 8a std Z+17, r1 ; 0x11 2e94a: 12 8a std Z+18, r1 ; 0x12 2e94c: 13 8a std Z+19, r1 ; 0x13 2e94e: 8a e0 ldi r24, 0x0A ; 10 2e950: 84 8b std Z+20, r24 ; 0x14 2e952: 40 e0 ldi r20, 0x00 ; 0 2e954: 60 e0 ldi r22, 0x00 ; 0 2e956: ce 01 movw r24, r28 2e958: 01 96 adiw r24, 0x01 ; 1 2e95a: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 2e95e: 85 e0 ldi r24, 0x05 ; 5 2e960: fe 01 movw r30, r28 2e962: 31 96 adiw r30, 0x01 ; 1 2e964: de 01 movw r26, r28 2e966: 16 96 adiw r26, 0x06 ; 6 2e968: 01 90 ld r0, Z+ 2e96a: 0d 92 st X+, r0 2e96c: 8a 95 dec r24 2e96e: e1 f7 brne .-8 ; 0x2e968 2e970: 85 e0 ldi r24, 0x05 ; 5 2e972: fe 01 movw r30, r28 2e974: 36 96 adiw r30, 0x06 ; 6 2e976: a0 e6 ldi r26, 0x60 ; 96 2e978: b3 e1 ldi r27, 0x13 ; 19 2e97a: 01 90 ld r0, Z+ 2e97c: 0d 92 st X+, r0 2e97e: 8a 95 dec r24 2e980: e1 f7 brne .-8 ; 0x2e97a 2e982: d8 01 movw r26, r16 2e984: 5a 96 adiw r26, 0x1a ; 26 2e986: 1c 92 st X, r1 2e988: 5a 97 sbiw r26, 0x1a ; 26 2e98a: 5c 96 adiw r26, 0x1c ; 28 2e98c: 1c 92 st X, r1 2e98e: 1e 92 st -X, r1 2e990: 5b 97 sbiw r26, 0x1b ; 27 2e992: 80 e6 ldi r24, 0x60 ; 96 2e994: 93 e1 ldi r25, 0x13 ; 19 2e996: 0f 94 b4 c5 call 0x38b68 ; 0x38b68 2e99a: f8 01 movw r30, r16 2e99c: 81 8f std Z+25, r24 ; 0x19 2e99e: 15 8e std Z+29, r1 ; 0x1d 2e9a0: 16 8e std Z+30, r1 ; 0x1e 2e9a2: 40 e0 ldi r20, 0x00 ; 0 2e9a4: 60 e0 ldi r22, 0x00 ; 0 2e9a6: 8a e6 ldi r24, 0x6A ; 106 2e9a8: 93 e1 ldi r25, 0x13 ; 19 2e9aa: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 2e9ae: d8 01 movw r26, r16 2e9b0: 94 96 adiw r26, 0x24 ; 36 2e9b2: 1c 92 st X, r1 2e9b4: 40 e0 ldi r20, 0x00 ; 0 2e9b6: 60 e0 ldi r22, 0x00 ; 0 2e9b8: ce 01 movw r24, r28 2e9ba: 0b 96 adiw r24, 0x0b ; 11 2e9bc: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 2e9c0: 85 e0 ldi r24, 0x05 ; 5 2e9c2: fe 01 movw r30, r28 2e9c4: 3b 96 adiw r30, 0x0b ; 11 2e9c6: de 01 movw r26, r28 2e9c8: 11 96 adiw r26, 0x01 ; 1 2e9ca: 01 90 ld r0, Z+ 2e9cc: 0d 92 st X+, r0 2e9ce: 8a 95 dec r24 2e9d0: e1 f7 brne .-8 ; 0x2e9ca 2e9d2: 85 e0 ldi r24, 0x05 ; 5 2e9d4: fe 01 movw r30, r28 2e9d6: 31 96 adiw r30, 0x01 ; 1 2e9d8: a0 e7 ldi r26, 0x70 ; 112 2e9da: b3 e1 ldi r27, 0x13 ; 19 2e9dc: 01 90 ld r0, Z+ 2e9de: 0d 92 st X+, r0 2e9e0: 8a 95 dec r24 2e9e2: e1 f7 brne .-8 ; 0x2e9dc 2e9e4: f8 01 movw r30, r16 2e9e6: 12 a6 std Z+42, r1 ; 0x2a 2e9e8: 14 a6 std Z+44, r1 ; 0x2c 2e9ea: 13 a6 std Z+43, r1 ; 0x2b 2e9ec: 80 e7 ldi r24, 0x70 ; 112 2e9ee: 93 e1 ldi r25, 0x13 ; 19 2e9f0: 0f 94 b4 c5 call 0x38b68 ; 0x38b68 2e9f4: d8 01 movw r26, r16 2e9f6: 99 96 adiw r26, 0x29 ; 41 2e9f8: 8c 93 st X, r24 2e9fa: 99 97 sbiw r26, 0x29 ; 41 2e9fc: dd 96 adiw r26, 0x3d ; 61 2e9fe: 1c 92 st X, r1 2ea00: dd 97 sbiw r26, 0x3d ; 61 2ea02: 8a e4 ldi r24, 0x4A ; 74 2ea04: 93 e1 ldi r25, 0x13 ; 19 2ea06: df 96 adiw r26, 0x3f ; 63 2ea08: 9c 93 st X, r25 2ea0a: 8e 93 st -X, r24 2ea0c: de 97 sbiw r26, 0x3e ; 62 2ea0e: f0 92 8c 13 sts 0x138C, r15 ; 0x80138c 2ea12: e0 92 8b 13 sts 0x138B, r14 ; 0x80138b 2ea16: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d 2ea1a: 1f ef ldi r17, 0xFF ; 255 2ea1c: 10 93 8e 13 sts 0x138E, r17 ; 0x80138e 2ea20: 0f 94 1d c6 call 0x38c3a ; 0x38c3a 2ea24: 80 93 8f 13 sts 0x138F, r24 ; 0x80138f 2ea28: 10 92 90 13 sts 0x1390, r1 ; 0x801390 2ea2c: 10 92 91 13 sts 0x1391, r1 ; 0x801391 2ea30: 10 92 92 13 sts 0x1392, r1 ; 0x801392 2ea34: 10 92 94 13 sts 0x1394, r1 ; 0x801394 2ea38: 10 92 93 13 sts 0x1393, r1 ; 0x801393 2ea3c: 10 92 96 13 sts 0x1396, r1 ; 0x801396 2ea40: 10 92 95 13 sts 0x1395, r1 ; 0x801395 2ea44: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2ea48: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2ea4c: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2ea50: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c 2ea54: 83 e0 ldi r24, 0x03 ; 3 2ea56: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f 2ea5a: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 2ea5e: 85 e1 ldi r24, 0x15 ; 21 2ea60: 80 93 97 13 sts 0x1397, r24 ; 0x801397 2ea64: 84 e1 ldi r24, 0x14 ; 20 2ea66: 80 93 98 13 sts 0x1398, r24 ; 0x801398 2ea6a: 83 e6 ldi r24, 0x63 ; 99 2ea6c: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 2ea70: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 2ea74: 10 92 a3 13 sts 0x13A3, r1 ; 0x8013a3 2ea78: 10 92 a4 13 sts 0x13A4, r1 ; 0x8013a4 2ea7c: 10 92 a5 13 sts 0x13A5, r1 ; 0x8013a5 2ea80: 10 92 a6 13 sts 0x13A6, r1 ; 0x8013a6 2ea84: 10 92 a7 13 sts 0x13A7, r1 ; 0x8013a7 2ea88: 10 92 a8 13 sts 0x13A8, r1 ; 0x8013a8 2ea8c: 10 92 a9 13 sts 0x13A9, r1 ; 0x8013a9 2ea90: 10 92 aa 13 sts 0x13AA, r1 ; 0x8013aa 2ea94: 10 92 ab 13 sts 0x13AB, r1 ; 0x8013ab 2ea98: 10 92 ac 13 sts 0x13AC, r1 ; 0x8013ac 2ea9c: 10 92 ad 13 sts 0x13AD, r1 ; 0x8013ad 2eaa0: 10 92 ae 13 sts 0x13AE, r1 ; 0x8013ae 2eaa4: 10 92 b0 13 sts 0x13B0, r1 ; 0x8013b0 2eaa8: 10 92 af 13 sts 0x13AF, r1 ; 0x8013af 2eaac: 10 92 b1 13 sts 0x13B1, r1 ; 0x8013b1 2eab0: 8e e2 ldi r24, 0x2E ; 46 2eab2: 90 e8 ldi r25, 0x80 ; 128 2eab4: 90 93 b3 13 sts 0x13B3, r25 ; 0x8013b3 2eab8: 80 93 b2 13 sts 0x13B2, r24 ; 0x8013b2 2eabc: 10 93 b4 13 sts 0x13B4, r17 ; 0x8013b4 2eac0: 10 93 b5 13 sts 0x13B5, r17 ; 0x8013b5 2eac4: 10 92 b7 13 sts 0x13B7, r1 ; 0x8013b7 2eac8: 10 92 b6 13 sts 0x13B6, r1 ; 0x8013b6 2eacc: 10 93 b8 13 sts 0x13B8, r17 ; 0x8013b8 2ead0: 82 e0 ldi r24, 0x02 ; 2 2ead2: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 2ead6: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba 2eada: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb 2eade: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc 2eae2: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd 2eae6: 10 92 bf 13 sts 0x13BF, r1 ; 0x8013bf 2eaea: 10 92 be 13 sts 0x13BE, r1 ; 0x8013be 2eaee: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 2eaf2: 10 92 c0 13 sts 0x13C0, r1 ; 0x8013c0 2eaf6: 0f 94 85 8c call 0x3190a ; 0x3190a 2eafa: ee e8 ldi r30, 0x8E ; 142 2eafc: f4 e1 ldi r31, 0x14 ; 20 2eafe: 10 92 16 15 sts 0x1516, r1 ; 0x801516 2eb02: 10 92 19 15 sts 0x1519, r1 ; 0x801519 2eb06: 10 92 3b 15 sts 0x153B, r1 ; 0x80153b 2eb0a: 10 92 3e 15 sts 0x153E, r1 ; 0x80153e 2eb0e: 89 e1 ldi r24, 0x19 ; 25 2eb10: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd 2eb14: 10 92 00 17 sts 0x1700, r1 ; 0x801700 2eb18: 10 92 01 17 sts 0x1701, r1 ; 0x801701 2eb1c: 10 92 19 17 sts 0x1719, r1 ; 0x801719 2eb20: 10 92 20 17 sts 0x1720, r1 ; 0x801720 2eb24: 10 92 23 17 sts 0x1723, r1 ; 0x801723 2eb28: 10 92 a1 17 sts 0x17A1, r1 ; 0x8017a1 2eb2c: 10 92 a3 17 sts 0x17A3, r1 ; 0x8017a3 2eb30: 10 92 a2 17 sts 0x17A2, r1 ; 0x8017a2 2eb34: 10 92 32 16 sts 0x1632, r1 ; 0x801632 2eb38: 10 92 31 16 sts 0x1631, r1 ; 0x801631 2eb3c: 10 92 9d 17 sts 0x179D, r1 ; 0x80179d 2eb40: 10 92 9e 17 sts 0x179E, r1 ; 0x80179e 2eb44: 10 92 9f 17 sts 0x179F, r1 ; 0x80179f 2eb48: 10 92 a0 17 sts 0x17A0, r1 ; 0x8017a0 2eb4c: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 2eb50: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 2eb54: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 2eb58: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 2eb5c: 12 82 std Z+2, r1 ; 0x02 2eb5e: 13 82 std Z+3, r1 ; 0x03 2eb60: 10 82 st Z, r1 2eb62: 11 82 std Z+1, r1 ; 0x01 2eb64: 10 92 30 16 sts 0x1630, r1 ; 0x801630 2eb68: 10 92 43 17 sts 0x1743, r1 ; 0x801743 2eb6c: ee e5 ldi r30, 0x5E ; 94 2eb6e: f5 e1 ldi r31, 0x15 ; 21 2eb70: 82 ed ldi r24, 0xD2 ; 210 2eb72: df 01 movw r26, r30 2eb74: 1d 92 st X+, r1 2eb76: 8a 95 dec r24 2eb78: e9 f7 brne .-6 ; 0x2eb74 2eb7a: 10 92 df 14 sts 0x14DF, r1 ; 0x8014df 2eb7e: 10 92 de 14 sts 0x14DE, r1 ; 0x8014de 2eb82: 10 92 dd 14 sts 0x14DD, r1 ; 0x8014dd 2eb86: 81 ea ldi r24, 0xA1 ; 161 2eb88: 97 e1 ldi r25, 0x17 ; 23 2eb8a: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> 2eb8e: e7 e8 ldi r30, 0x87 ; 135 2eb90: f4 e1 ldi r31, 0x14 ; 20 2eb92: 11 82 std Z+1, r1 ; 0x01 2eb94: 12 82 std Z+2, r1 ; 0x02 2eb96: 13 82 std Z+3, r1 ; 0x03 2eb98: 14 82 std Z+4, r1 ; 0x04 2eb9a: 15 82 std Z+5, r1 ; 0x05 2eb9c: 16 82 std Z+6, r1 ; 0x06 2eb9e: 10 83 st Z, r17 2eba0: ea ea ldi r30, 0xAA ; 170 2eba2: f7 e1 ldi r31, 0x17 ; 23 2eba4: 15 82 std Z+5, r1 ; 0x05 2eba6: 17 82 std Z+7, r1 ; 0x07 2eba8: 16 82 std Z+6, r1 ; 0x06 2ebaa: 11 86 std Z+9, r1 ; 0x09 2ebac: 13 86 std Z+11, r1 ; 0x0b 2ebae: 12 86 std Z+10, r1 ; 0x0a 2ebb0: 0f 94 51 2a call 0x254a2 ; 0x254a2 2ebb4: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 2ebb8: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 2ebbc: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 2ebc0: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 2ebc4: 2f 96 adiw r28, 0x0f ; 15 2ebc6: 0f b6 in r0, 0x3f ; 63 2ebc8: f8 94 cli 2ebca: de bf out 0x3e, r29 ; 62 2ebcc: 0f be out 0x3f, r0 ; 63 2ebce: cd bf out 0x3d, r28 ; 61 2ebd0: df 91 pop r29 2ebd2: cf 91 pop r28 2ebd4: 1f 91 pop r17 2ebd6: 0f 91 pop r16 2ebd8: ff 90 pop r15 2ebda: ef 90 pop r14 2ebdc: 08 95 ret 0002ebde : else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2ebde: 42 e0 ldi r20, 0x02 ; 2 2ebe0: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2ebe4: 0d 94 35 d6 jmp 0x3ac6a ; 0x3ac6a 0002ebe8 : 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; 2ebe8: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 2ebec: 83 36 cpi r24, 0x63 ; 99 2ebee: 09 f4 brne .+2 ; 0x2ebf2 2ebf0: 8f ef ldi r24, 0xFF ; 255 } 2ebf2: 08 95 ret 0002ebf4 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2ebf4: 9f b7 in r25, 0x3f ; 63 2ebf6: f8 94 cli 2ebf8: e5 e0 ldi r30, 0x05 ; 5 2ebfa: f1 e0 ldi r31, 0x01 ; 1 2ebfc: 80 81 ld r24, Z 2ebfe: 80 64 ori r24, 0x40 ; 64 2ec00: 80 83 st Z, r24 2ec02: 9f bf out 0x3f, r25 ; 63 } 2ec04: 08 95 ret 0002ec06 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2ec06: 0f 93 push r16 2ec08: 1f 93 push r17 2ec0a: cf 93 push r28 2ec0c: df 93 push r29 2ec0e: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2ec10: 0f 94 51 2a call 0x254a2 ; 0x254a2 2ec14: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2ec16: 0f 94 85 53 call 0x2a70a ; 0x2a70a 2ec1a: 8f 3f cpi r24, 0xFF ; 255 2ec1c: 69 f0 breq .+26 ; 0x2ec38 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2ec1e: 0f 94 51 2a call 0x254a2 ; 0x254a2 2ec22: 60 1b sub r22, r16 2ec24: 71 0b sbc r23, r17 2ec26: 6c 17 cp r22, r28 2ec28: 7d 07 cpc r23, r29 2ec2a: a8 f3 brcs .-22 ; 0x2ec16 } return true; fail: return false; 2ec2c: 80 e0 ldi r24, 0x00 ; 0 } 2ec2e: df 91 pop r29 2ec30: cf 91 pop r28 2ec32: 1f 91 pop r17 2ec34: 0f 91 pop r16 2ec36: 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; 2ec38: 81 e0 ldi r24, 0x01 ; 1 2ec3a: f9 cf rjmp .-14 ; 0x2ec2e 0002ec3c : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2ec3c: 80 ed ldi r24, 0xD0 ; 208 2ec3e: 9a ea ldi r25, 0xAA ; 170 2ec40: 0e 94 d0 76 call 0xeda0 ; 0xeda0 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2ec44: 60 e0 ldi r22, 0x00 ; 0 2ec46: 8c ea ldi r24, 0xAC ; 172 2ec48: 9c e0 ldi r25, 0x0C ; 12 2ec4a: 0e 94 89 75 call 0xeb12 ; 0xeb12 if (status == 1) { 2ec4e: 81 30 cpi r24, 0x01 ; 1 2ec50: 21 f4 brne .+8 ; 0x2ec5a SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2ec52: 89 e1 ldi r24, 0x19 ; 25 2ec54: 9c e5 ldi r25, 0x5C ; 92 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2ec56: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 2ec5a: 83 e1 ldi r24, 0x13 ; 19 2ec5c: 9c e5 ldi r25, 0x5C ; 92 2ec5e: fb cf rjmp .-10 ; 0x2ec56 0002ec60 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2ec60: bc 01 movw r22, r24 2ec62: 99 0f add r25, r25 2ec64: 88 0b sbc r24, r24 2ec66: 99 0b sbc r25, r25 2ec68: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2ec6c: 0d 94 35 d6 jmp 0x3ac6a ; 0x3ac6a 0002ec70 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2ec70: 0f 93 push r16 2ec72: 1f 93 push r17 2ec74: cf 93 push r28 2ec76: df 93 push r29 2ec78: ec 01 movw r28, r24 2ec7a: 0f 94 12 da call 0x3b424 ; 0x3b424 <__strlen_P> 2ec7e: 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) 2ec80: 80 36 cpi r24, 0x60 ; 96 2ec82: 91 05 cpc r25, r1 2ec84: 08 f0 brcs .+2 ; 0x2ec88 2ec86: 85 c0 rjmp .+266 ; 0x2ed92 return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2ec88: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 2ec8c: 81 11 cpse r24, r1 2ec8e: 05 c0 rjmp .+10 ; 0x2ec9a cmdqueue_pop_front(); 2ec90: 0e 94 3c 76 call 0xec78 ; 0xec78 cmdbuffer_front_already_processed = true; 2ec94: 81 e0 ldi r24, 0x01 ; 1 2ec96: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 } if (bufindr == bufindw && buflen > 0) 2ec9a: 40 91 92 12 lds r20, 0x1292 ; 0x801292 2ec9e: 50 91 93 12 lds r21, 0x1293 ; 0x801293 2eca2: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.552> 2eca6: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.552+0x1> 2ecaa: 48 17 cp r20, r24 2ecac: 59 07 cpc r21, r25 2ecae: 41 f4 brne .+16 ; 0x2ecc0 2ecb0: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 2ecb4: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 2ecb8: 12 16 cp r1, r18 2ecba: 13 06 cpc r1, r19 2ecbc: 0c f4 brge .+2 ; 0x2ecc0 2ecbe: 69 c0 rjmp .+210 ; 0x2ed92 // 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; 2ecc0: 20 91 9e 10 lds r18, 0x109E ; 0x80109e 2ecc4: 30 91 9f 10 lds r19, 0x109F ; 0x80109f 2ecc8: 12 16 cp r1, r18 2ecca: 13 06 cpc r1, r19 2eccc: 0c f0 brlt .+2 ; 0x2ecd0 2ecce: 41 c0 rjmp .+130 ; 0x2ed52 2ecd0: 9c 01 movw r18, r24 2ecd2: 2f 59 subi r18, 0x9F ; 159 2ecd4: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2ecd6: 84 17 cp r24, r20 2ecd8: 95 07 cpc r25, r21 2ecda: e8 f5 brcc .+122 ; 0x2ed56 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2ecdc: 44 50 subi r20, 0x04 ; 4 2ecde: 51 09 sbc r21, r1 2ece0: 40 1b sub r20, r16 2ece2: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2ece4: 42 17 cp r20, r18 2ece6: 53 07 cpc r21, r19 2ece8: 0c f4 brge .+2 ; 0x2ecec 2ecea: 53 c0 rjmp .+166 ; 0x2ed92 } } 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); 2ecec: 50 93 93 12 sts 0x1293, r21 ; 0x801293 2ecf0: 40 93 92 12 sts 0x1292, r20 ; 0x801292 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; 2ecf4: 80 91 92 12 lds r24, 0x1292 ; 0x801292 2ecf8: 90 91 93 12 lds r25, 0x1293 ; 0x801293 2ecfc: fc 01 movw r30, r24 2ecfe: eb 55 subi r30, 0x5B ; 91 2ed00: ff 4e sbci r31, 0xEF ; 239 2ed02: 23 e0 ldi r18, 0x03 ; 3 2ed04: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2ed06: be 01 movw r22, r28 2ed08: 88 55 subi r24, 0x58 ; 88 2ed0a: 9f 4e sbci r25, 0xEF ; 239 2ed0c: 0f 94 0b da call 0x3b416 ; 0x3b416 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2ed10: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 2ed14: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 2ed18: 01 96 adiw r24, 0x01 ; 1 2ed1a: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 2ed1e: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 SERIAL_ECHO_START; 2ed22: 82 ec ldi r24, 0xC2 ; 194 2ed24: 9a ea ldi r25, 0xAA ; 170 2ed26: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(enqueingFront); 2ed2a: 83 ea ldi r24, 0xA3 ; 163 2ed2c: 9a ea ldi r25, 0xAA ; 170 2ed2e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2ed32: 80 91 92 12 lds r24, 0x1292 ; 0x801292 2ed36: 90 91 93 12 lds r25, 0x1293 ; 0x801293 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2ed3a: 88 55 subi r24, 0x58 ; 88 2ed3c: 9f 4e sbci r25, 0xEF ; 239 2ed3e: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_ECHOLNPGM("\""); 2ed42: 81 ea ldi r24, 0xA1 ; 161 2ed44: 9a ea ldi r25, 0xAA ; 170 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2ed46: df 91 pop r29 2ed48: cf 91 pop r28 2ed4a: 1f 91 pop r17 2ed4c: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ed4e: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 // 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) 2ed52: 9c 01 movw r18, r24 2ed54: c0 cf rjmp .-128 ; 0x2ecd6 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2ed56: c8 01 movw r24, r16 2ed58: 04 96 adiw r24, 0x04 ; 4 2ed5a: 48 17 cp r20, r24 2ed5c: 59 07 cpc r21, r25 2ed5e: 28 f0 brcs .+10 ; 0x2ed6a // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2ed60: 44 50 subi r20, 0x04 ; 4 2ed62: 51 09 sbc r21, r1 2ed64: 40 1b sub r20, r16 2ed66: 51 0b sbc r21, r17 2ed68: c1 cf rjmp .-126 ; 0x2ecec return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2ed6a: 89 ee ldi r24, 0xE9 ; 233 2ed6c: 91 e0 ldi r25, 0x01 ; 1 2ed6e: bc 01 movw r22, r24 2ed70: 60 1b sub r22, r16 2ed72: 71 0b sbc r23, r17 2ed74: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2ed76: 62 17 cp r22, r18 2ed78: 73 07 cpc r23, r19 2ed7a: 5c f0 brlt .+22 ; 0x2ed92 memset(cmdbuffer, 0, bufindr); 2ed7c: 70 e0 ldi r23, 0x00 ; 0 2ed7e: 60 e0 ldi r22, 0x00 ; 0 2ed80: 85 ea ldi r24, 0xA5 ; 165 2ed82: 90 e1 ldi r25, 0x10 ; 16 2ed84: 0f 94 86 e2 call 0x3c50c ; 0x3c50c bufindr = bufindr_new; 2ed88: 10 93 93 12 sts 0x1293, r17 ; 0x801293 2ed8c: 00 93 92 12 sts 0x1292, r16 ; 0x801292 2ed90: b1 cf rjmp .-158 ; 0x2ecf4 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2ed92: 8a e9 ldi r24, 0x9A ; 154 2ed94: 9a ea ldi r25, 0xAA ; 170 2ed96: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(enqueingFront); 2ed9a: 83 ea ldi r24, 0xA3 ; 163 2ed9c: 9a ea ldi r25, 0xAA ; 170 2ed9e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2eda2: ce 01 movw r24, r28 2eda4: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2eda8: 83 e8 ldi r24, 0x83 ; 131 2edaa: 9a ea ldi r25, 0xAA ; 170 2edac: cc cf rjmp .-104 ; 0x2ed46 0002edae : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2edae: ab 01 movw r20, r22 2edb0: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2edb2: 80 e2 ldi r24, 0x20 ; 32 2edb4: 97 e1 ldi r25, 0x17 ; 23 2edb6: 0f 94 cd 57 call 0x2af9a ; 0x2af9a 2edba: 81 11 cpse r24, r1 2edbc: 02 c0 rjmp .+4 ; 0x2edc2 2edbe: 80 e0 ldi r24, 0x00 ; 0 2edc0: 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() ) 2edc2: 80 e2 ldi r24, 0x20 ; 32 2edc4: 97 e1 ldi r25, 0x17 ; 23 2edc6: 0f 94 54 57 call 0x2aea8 ; 0x2aea8 2edca: 88 23 and r24, r24 2edcc: c1 f3 breq .-16 ; 0x2edbe 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; 2edce: 20 91 41 17 lds r18, 0x1741 ; 0x801741 2edd2: 30 91 42 17 lds r19, 0x1742 ; 0x801742 2edd6: 23 56 subi r18, 0x63 ; 99 2edd8: 31 4f sbci r19, 0xF1 ; 241 2edda: 30 93 3c 17 sts 0x173C, r19 ; 0x80173c 2edde: 20 93 3b 17 sts 0x173B, r18 ; 0x80173b bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2ede2: 08 95 ret 0002ede4 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2ede4: 8f 92 push r8 2ede6: 9f 92 push r9 2ede8: af 92 push r10 2edea: bf 92 push r11 2edec: cf 92 push r12 2edee: df 92 push r13 2edf0: ef 92 push r14 2edf2: ff 92 push r15 2edf4: 0f 93 push r16 2edf6: 1f 93 push r17 2edf8: cf 93 push r28 2edfa: df 93 push r29 2edfc: cd b7 in r28, 0x3d ; 61 2edfe: de b7 in r29, 0x3e ; 62 2ee00: ee 97 sbiw r28, 0x3e ; 62 2ee02: 0f b6 in r0, 0x3f ; 63 2ee04: f8 94 cli 2ee06: de bf out 0x3e, r29 ; 62 2ee08: 0f be out 0x3f, r0 ; 63 2ee0a: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2ee0c: 80 91 de 14 lds r24, 0x14DE ; 0x8014de 2ee10: 8f 93 push r24 2ee12: 80 91 dd 14 lds r24, 0x14DD ; 0x8014dd 2ee16: 8f 93 push r24 2ee18: 8e e3 ldi r24, 0x3E ; 62 2ee1a: 9a ea ldi r25, 0xAA ; 170 2ee1c: 9f 93 push r25 2ee1e: 8f 93 push r24 2ee20: 8e 01 movw r16, r28 2ee22: 0f 5d subi r16, 0xDF ; 223 2ee24: 1f 4f sbci r17, 0xFF ; 255 2ee26: 1f 93 push r17 2ee28: 0f 93 push r16 2ee2a: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 2ee2e: 0f 90 pop r0 2ee30: 0f 90 pop r0 2ee32: 0f 90 pop r0 2ee34: 0f 90 pop r0 2ee36: 0f 90 pop r0 2ee38: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2ee3a: f1 2c mov r15, r1 2ee3c: f8 01 movw r30, r16 2ee3e: 01 90 ld r0, Z+ 2ee40: 00 20 and r0, r0 2ee42: e9 f7 brne .-6 ; 0x2ee3e 2ee44: 31 97 sbiw r30, 0x01 ; 1 2ee46: e0 1b sub r30, r16 2ee48: f1 0b sbc r31, r17 2ee4a: fe 16 cp r15, r30 2ee4c: 84 f4 brge .+32 ; 0x2ee6e autoname[i]=tolower(autoname[i]); 2ee4e: 68 01 movw r12, r16 2ee50: cf 0c add r12, r15 2ee52: d1 1c adc r13, r1 2ee54: f7 fc sbrc r15, 7 2ee56: da 94 dec r13 2ee58: f6 01 movw r30, r12 2ee5a: 80 81 ld r24, Z 2ee5c: 08 2e mov r0, r24 2ee5e: 00 0c add r0, r0 2ee60: 99 0b sbc r25, r25 2ee62: 0f 94 68 e2 call 0x3c4d0 ; 0x3c4d0 2ee66: f6 01 movw r30, r12 2ee68: 80 83 st Z, r24 2ee6a: f3 94 inc r15 2ee6c: e7 cf rjmp .-50 ; 0x2ee3c dir_t p; root.rewind(); 2ee6e: 86 e1 ldi r24, 0x16 ; 22 2ee70: 95 e1 ldi r25, 0x15 ; 21 2ee72: 0e 94 ac 76 call 0xed58 ; 0xed58 bool found=false; 2ee76: a1 2c mov r10, r1 2ee78: ce 01 movw r24, r28 2ee7a: 01 96 adiw r24, 0x01 ; 1 2ee7c: 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); 2ee7e: 80 e5 ldi r24, 0x50 ; 80 2ee80: c8 2e mov r12, r24 2ee82: 80 e7 ldi r24, 0x70 ; 112 2ee84: 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; 2ee86: 80 91 19 15 lds r24, 0x1519 ; 0x801519 2ee8a: 82 30 cpi r24, 0x02 ; 2 2ee8c: 08 f4 brcc .+2 ; 0x2ee90 2ee8e: 50 c0 rjmp .+160 ; 0x2ef30 2ee90: 80 91 1e 15 lds r24, 0x151E ; 0x80151e 2ee94: 90 91 1f 15 lds r25, 0x151F ; 0x80151f 2ee98: a0 91 20 15 lds r26, 0x1520 ; 0x801520 2ee9c: b0 91 21 15 lds r27, 0x1521 ; 0x801521 2eea0: 8f 71 andi r24, 0x1F ; 31 2eea2: 99 27 eor r25, r25 2eea4: aa 27 eor r26, r26 2eea6: bb 27 eor r27, r27 2eea8: 89 2b or r24, r25 2eeaa: 8a 2b or r24, r26 2eeac: 8b 2b or r24, r27 2eeae: 09 f0 breq .+2 ; 0x2eeb2 2eeb0: 3f c0 rjmp .+126 ; 0x2ef30 2eeb2: 50 e0 ldi r21, 0x00 ; 0 2eeb4: 40 e0 ldi r20, 0x00 ; 0 2eeb6: b7 01 movw r22, r14 2eeb8: 86 e1 ldi r24, 0x16 ; 22 2eeba: 95 e1 ldi r25, 0x15 ; 21 2eebc: 0f 94 0a 5b call 0x2b614 ; 0x2b614 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2eec0: 18 16 cp r1, r24 2eec2: b4 f5 brge .+108 ; 0x2ef30 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2eec4: b1 2c mov r11, r1 2eec6: f7 01 movw r30, r14 2eec8: 01 90 ld r0, Z+ 2eeca: 00 20 and r0, r0 2eecc: e9 f7 brne .-6 ; 0x2eec8 2eece: 31 97 sbiw r30, 0x01 ; 1 2eed0: ee 19 sub r30, r14 2eed2: ff 09 sbc r31, r15 2eed4: be 16 cp r11, r30 2eed6: 74 f4 brge .+28 ; 0x2eef4 p.name[i]=tolower(p.name[i]); 2eed8: 47 01 movw r8, r14 2eeda: 8b 0c add r8, r11 2eedc: 91 1c adc r9, r1 2eede: b7 fc sbrc r11, 7 2eee0: 9a 94 dec r9 2eee2: f4 01 movw r30, r8 2eee4: 80 81 ld r24, Z 2eee6: 90 e0 ldi r25, 0x00 ; 0 2eee8: 0f 94 68 e2 call 0x3c4d0 ; 0x3c4d0 2eeec: f4 01 movw r30, r8 2eeee: 80 83 st Z, r24 2eef0: b3 94 inc r11 2eef2: e9 cf rjmp .-46 ; 0x2eec6 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2eef4: 8a 85 ldd r24, Y+10 ; 0x0a 2eef6: 8e 37 cpi r24, 0x7E ; 126 2eef8: 31 f2 breq .-116 ; 0x2ee86 if(strncmp((char*)p.name,autoname,5)==0) 2eefa: 45 e0 ldi r20, 0x05 ; 5 2eefc: 50 e0 ldi r21, 0x00 ; 0 2eefe: b8 01 movw r22, r16 2ef00: c7 01 movw r24, r14 2ef02: 0f 94 c6 e2 call 0x3c58c ; 0x3c58c 2ef06: 89 2b or r24, r25 2ef08: 09 f0 breq .+2 ; 0x2ef0c 2ef0a: bd cf rjmp .-134 ; 0x2ee86 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2ef0c: 1f 93 push r17 2ef0e: 0f 93 push r16 2ef10: df 92 push r13 2ef12: cf 92 push r12 2ef14: 0e 94 3e 88 call 0x1107c ; 0x1107c // M24: Start/resume SD print enquecommand_P(MSG_M24); 2ef18: 61 e0 ldi r22, 0x01 ; 1 2ef1a: 8c e4 ldi r24, 0x4C ; 76 2ef1c: 90 e7 ldi r25, 0x70 ; 112 2ef1e: 0e 94 a0 87 call 0x10f40 ; 0x10f40 2ef22: 0f 90 pop r0 2ef24: 0f 90 pop r0 2ef26: 0f 90 pop r0 2ef28: 0f 90 pop r0 found=true; 2ef2a: aa 24 eor r10, r10 2ef2c: a3 94 inc r10 2ef2e: ab cf rjmp .-170 ; 0x2ee86 } } if(!found) lastnr=-1; 2ef30: 8f ef ldi r24, 0xFF ; 255 2ef32: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2ef34: aa 20 and r10, r10 2ef36: 29 f0 breq .+10 ; 0x2ef42 lastnr=-1; else lastnr++; 2ef38: 80 91 dd 14 lds r24, 0x14DD ; 0x8014dd 2ef3c: 90 91 de 14 lds r25, 0x14DE ; 0x8014de 2ef40: 01 96 adiw r24, 0x01 ; 1 2ef42: 90 93 de 14 sts 0x14DE, r25 ; 0x8014de 2ef46: 80 93 dd 14 sts 0x14DD, r24 ; 0x8014dd } 2ef4a: ee 96 adiw r28, 0x3e ; 62 2ef4c: 0f b6 in r0, 0x3f ; 63 2ef4e: f8 94 cli 2ef50: de bf out 0x3e, r29 ; 62 2ef52: 0f be out 0x3f, r0 ; 63 2ef54: cd bf out 0x3d, r28 ; 61 2ef56: df 91 pop r29 2ef58: cf 91 pop r28 2ef5a: 1f 91 pop r17 2ef5c: 0f 91 pop r16 2ef5e: ff 90 pop r15 2ef60: ef 90 pop r14 2ef62: df 90 pop r13 2ef64: cf 90 pop r12 2ef66: bf 90 pop r11 2ef68: af 90 pop r10 2ef6a: 9f 90 pop r9 2ef6c: 8f 90 pop r8 2ef6e: 08 95 ret 0002ef70 : * \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) { 2ef70: 8f 92 push r8 2ef72: 9f 92 push r9 2ef74: af 92 push r10 2ef76: bf 92 push r11 2ef78: cf 92 push r12 2ef7a: df 92 push r13 2ef7c: ef 92 push r14 2ef7e: ff 92 push r15 2ef80: 0f 93 push r16 2ef82: 1f 93 push r17 2ef84: cf 93 push r28 2ef86: df 93 push r29 2ef88: 00 d0 rcall .+0 ; 0x2ef8a 2ef8a: 1f 92 push r1 2ef8c: cd b7 in r28, 0x3d ; 61 2ef8e: de b7 in r29, 0x3e ; 62 2ef90: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2ef92: 83 81 ldd r24, Z+3 ; 0x03 2ef94: 81 30 cpi r24, 0x01 ; 1 2ef96: 11 f0 breq .+4 ; 0x2ef9c // set file to correct position return seekSet(newPos); fail: return false; 2ef98: 80 e0 ldi r24, 0x00 ; 0 2ef9a: 60 c0 rjmp .+192 ; 0x2f05c * \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; 2ef9c: 81 81 ldd r24, Z+1 ; 0x01 2ef9e: 81 ff sbrs r24, 1 2efa0: fb cf rjmp .-10 ; 0x2ef98 // 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; 2efa2: 81 89 ldd r24, Z+17 ; 0x11 2efa4: 92 89 ldd r25, Z+18 ; 0x12 2efa6: a3 89 ldd r26, Z+19 ; 0x13 2efa8: b4 89 ldd r27, Z+20 ; 0x14 2efaa: 89 2b or r24, r25 2efac: 8a 2b or r24, r26 2efae: 8b 2b or r24, r27 2efb0: 09 f4 brne .+2 ; 0x2efb4 2efb2: 6e c0 rjmp .+220 ; 0x2f090 2efb4: 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; 2efb6: 40 e0 ldi r20, 0x00 ; 0 2efb8: 50 e0 ldi r21, 0x00 ; 0 2efba: ba 01 movw r22, r20 2efbc: cf 01 movw r24, r30 2efbe: 0f 94 cd 57 call 0x2af9a ; 0x2af9a 2efc2: 88 23 and r24, r24 2efc4: 49 f3 breq .-46 ; 0x2ef98 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2efc6: f7 01 movw r30, r14 2efc8: c1 8c ldd r12, Z+25 ; 0x19 2efca: d2 8c ldd r13, Z+26 ; 0x1a 2efcc: 85 88 ldd r8, Z+21 ; 0x15 2efce: 96 88 ldd r9, Z+22 ; 0x16 2efd0: a7 88 ldd r10, Z+23 ; 0x17 2efd2: 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; 2efd4: 82 e0 ldi r24, 0x02 ; 2 2efd6: 90 e0 ldi r25, 0x00 ; 0 2efd8: a0 e0 ldi r26, 0x00 ; 0 2efda: b0 e0 ldi r27, 0x00 ; 0 2efdc: f6 01 movw r30, r12 2efde: 80 83 st Z, r24 2efe0: 91 83 std Z+1, r25 ; 0x01 2efe2: a2 83 std Z+2, r26 ; 0x02 2efe4: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2efe6: 9e 01 movw r18, r28 2efe8: 2f 5f subi r18, 0xFF ; 255 2efea: 3f 4f sbci r19, 0xFF ; 255 2efec: b5 01 movw r22, r10 2efee: a4 01 movw r20, r8 2eff0: c6 01 movw r24, r12 2eff2: 0f 94 17 56 call 0x2ac2e ; 0x2ac2e 2eff6: 88 23 and r24, r24 2eff8: 79 f2 breq .-98 ; 0x2ef98 // free cluster if (!fatPut(cluster, 0)) goto fail; 2effa: 00 e0 ldi r16, 0x00 ; 0 2effc: 10 e0 ldi r17, 0x00 ; 0 2effe: 98 01 movw r18, r16 2f000: b5 01 movw r22, r10 2f002: a4 01 movw r20, r8 2f004: c6 01 movw r24, r12 2f006: 0f 94 85 55 call 0x2ab0a ; 0x2ab0a 2f00a: 88 23 and r24, r24 2f00c: 29 f2 breq .-118 ; 0x2ef98 cluster = next; 2f00e: 89 80 ldd r8, Y+1 ; 0x01 2f010: 9a 80 ldd r9, Y+2 ; 0x02 2f012: ab 80 ldd r10, Y+3 ; 0x03 2f014: 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; 2f016: f6 01 movw r30, r12 2f018: 87 89 ldd r24, Z+23 ; 0x17 2f01a: 80 31 cpi r24, 0x10 ; 16 2f01c: 81 f5 brne .+96 ; 0x2f07e 2f01e: f8 ef ldi r31, 0xF8 ; 248 2f020: 8f 16 cp r8, r31 2f022: ff ef ldi r31, 0xFF ; 255 2f024: 9f 06 cpc r9, r31 2f026: a1 04 cpc r10, r1 2f028: b1 04 cpc r11, r1 2f02a: e8 f2 brcs .-70 ; 0x2efe6 firstCluster_ = 0; 2f02c: f7 01 movw r30, r14 2f02e: 15 8a std Z+21, r1 ; 0x15 2f030: 16 8a std Z+22, r1 ; 0x16 2f032: 17 8a std Z+23, r1 ; 0x17 2f034: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2f036: 11 8a std Z+17, r1 ; 0x11 2f038: 12 8a std Z+18, r1 ; 0x12 2f03a: 13 8a std Z+19, r1 ; 0x13 2f03c: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2f03e: 81 81 ldd r24, Z+1 ; 0x01 2f040: 80 68 ori r24, 0x80 ; 128 2f042: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2f044: c7 01 movw r24, r14 2f046: 0f 94 76 59 call 0x2b2ec ; 0x2b2ec 2f04a: 88 23 and r24, r24 2f04c: 09 f4 brne .+2 ; 0x2f050 2f04e: a4 cf rjmp .-184 ; 0x2ef98 // set file to correct position return seekSet(newPos); 2f050: 40 e0 ldi r20, 0x00 ; 0 2f052: 50 e0 ldi r21, 0x00 ; 0 2f054: ba 01 movw r22, r20 2f056: c7 01 movw r24, r14 2f058: 0f 94 cd 57 call 0x2af9a ; 0x2af9a fail: return false; } 2f05c: 0f 90 pop r0 2f05e: 0f 90 pop r0 2f060: 0f 90 pop r0 2f062: 0f 90 pop r0 2f064: df 91 pop r29 2f066: cf 91 pop r28 2f068: 1f 91 pop r17 2f06a: 0f 91 pop r16 2f06c: ff 90 pop r15 2f06e: ef 90 pop r14 2f070: df 90 pop r13 2f072: cf 90 pop r12 2f074: bf 90 pop r11 2f076: af 90 pop r10 2f078: 9f 90 pop r9 2f07a: 8f 90 pop r8 2f07c: 08 95 ret return cluster >= FAT32EOC_MIN; 2f07e: 88 ef ldi r24, 0xF8 ; 248 2f080: 88 16 cp r8, r24 2f082: 8f ef ldi r24, 0xFF ; 255 2f084: 98 06 cpc r9, r24 2f086: a8 06 cpc r10, r24 2f088: 8f e0 ldi r24, 0x0F ; 15 2f08a: b8 06 cpc r11, r24 2f08c: 78 f6 brcc .-98 ; 0x2f02c 2f08e: ab cf rjmp .-170 ; 0x2efe6 // 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; 2f090: 81 e0 ldi r24, 0x01 ; 1 2f092: e4 cf rjmp .-56 ; 0x2f05c 0002f094 : +* 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) { 2f094: 2f 92 push r2 2f096: 3f 92 push r3 2f098: 4f 92 push r4 2f09a: 5f 92 push r5 2f09c: 6f 92 push r6 2f09e: 7f 92 push r7 2f0a0: 8f 92 push r8 2f0a2: 9f 92 push r9 2f0a4: af 92 push r10 2f0a6: bf 92 push r11 2f0a8: cf 92 push r12 2f0aa: df 92 push r13 2f0ac: ef 92 push r14 2f0ae: ff 92 push r15 2f0b0: 0f 93 push r16 2f0b2: 1f 93 push r17 2f0b4: cf 93 push r28 2f0b6: df 93 push r29 2f0b8: cd b7 in r28, 0x3d ; 61 2f0ba: de b7 in r29, 0x3e ; 62 2f0bc: c6 57 subi r28, 0x76 ; 118 2f0be: d1 09 sbc r29, r1 2f0c0: 0f b6 in r0, 0x3f ; 63 2f0c2: f8 94 cli 2f0c4: de bf out 0x3e, r29 ; 62 2f0c6: 0f be out 0x3f, r0 ; 63 2f0c8: cd bf out 0x3d, r28 ; 61 2f0ca: 4c 01 movw r8, r24 2f0cc: 6b 01 movw r12, r22 2f0ce: 3a 01 movw r6, r20 2f0d0: e5 96 adiw r28, 0x35 ; 53 2f0d2: 2f af std Y+63, r18 ; 0x3f 2f0d4: e5 97 sbiw r28, 0x35 ; 53 2f0d6: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2f0d8: 2d b6 in r2, 0x3d ; 61 2f0da: 3e b6 in r3, 0x3e ; 62 2f0dc: 10 2f mov r17, r16 2f0de: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2f0e0: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2f0e4: 8f 5f subi r24, 0xFF ; 255 2f0e6: 80 93 9c 0e sts 0x0E9C, r24 ; 0x800e9c } 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()) { 2f0ea: fb 01 movw r30, r22 2f0ec: 80 85 ldd r24, Z+8 ; 0x08 2f0ee: 91 85 ldd r25, Z+9 ; 0x09 2f0f0: a2 85 ldd r26, Z+10 ; 0x0a 2f0f2: b3 85 ldd r27, Z+11 ; 0x0b 2f0f4: 80 93 a3 14 sts 0x14A3, r24 ; 0x8014a3 2f0f8: 90 93 a4 14 sts 0x14A4, r25 ; 0x8014a4 2f0fc: a0 93 a5 14 sts 0x14A5, r26 ; 0x8014a5 2f100: b0 93 a6 14 sts 0x14A6, r27 ; 0x8014a6 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2f104: 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); 2f106: 5e 01 movw r10, r28 2f108: f7 e6 ldi r31, 0x67 ; 103 2f10a: af 0e add r10, r31 2f10c: 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; 2f10e: f6 01 movw r30, r12 2f110: 83 81 ldd r24, Z+3 ; 0x03 2f112: 82 30 cpi r24, 0x02 ; 2 2f114: 08 f4 brcc .+2 ; 0x2f118 2f116: c0 c1 rjmp .+896 ; 0x2f498 2f118: 80 85 ldd r24, Z+8 ; 0x08 2f11a: 91 85 ldd r25, Z+9 ; 0x09 2f11c: a2 85 ldd r26, Z+10 ; 0x0a 2f11e: b3 85 ldd r27, Z+11 ; 0x0b 2f120: 8f 71 andi r24, 0x1F ; 31 2f122: 99 27 eor r25, r25 2f124: aa 27 eor r26, r26 2f126: bb 27 eor r27, r27 2f128: 89 2b or r24, r25 2f12a: 8a 2b or r24, r26 2f12c: 8b 2b or r24, r27 2f12e: 09 f0 breq .+2 ; 0x2f132 2f130: b3 c1 rjmp .+870 ; 0x2f498 //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'; 2f132: 10 92 a7 14 sts 0x14A7, r1 ; 0x8014a7 2f136: 47 ea ldi r20, 0xA7 ; 167 2f138: 54 e1 ldi r21, 0x14 ; 20 2f13a: be 01 movw r22, r28 2f13c: 69 5b subi r22, 0xB9 ; 185 2f13e: 7f 4f sbci r23, 0xFF ; 255 2f140: c6 01 movw r24, r12 2f142: 0f 94 0a 5b call 0x2b614 ; 0x2b614 } 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()) { 2f146: 18 16 cp r1, r24 2f148: 0c f0 brlt .+2 ; 0x2f14c 2f14a: a6 c1 rjmp .+844 ; 0x2f498 if (recursionCnt > MAX_DIR_DEPTH) 2f14c: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2f150: 87 30 cpi r24, 0x07 ; 7 2f152: 08 f0 brcs .+2 ; 0x2f156 2f154: a1 c1 rjmp .+834 ; 0x2f498 return; uint8_t pn0 = p.name[0]; 2f156: 28 96 adiw r28, 0x08 ; 8 2f158: 8f ad ldd r24, Y+63 ; 0x3f 2f15a: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2f15c: 88 23 and r24, r24 2f15e: 09 f4 brne .+2 ; 0x2f162 2f160: 9b c1 rjmp .+822 ; 0x2f498 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2f162: 85 3e cpi r24, 0xE5 ; 229 2f164: 09 f4 brne .+2 ; 0x2f168 2f166: 39 c1 rjmp .+626 ; 0x2f3da 2f168: 8e 32 cpi r24, 0x2E ; 46 2f16a: 09 f4 brne .+2 ; 0x2f16e 2f16c: 36 c1 rjmp .+620 ; 0x2f3da if (longFilename[0] == '.') continue; 2f16e: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f172: 8e 32 cpi r24, 0x2E ; 46 2f174: 09 f4 brne .+2 ; 0x2f178 2f176: 31 c1 rjmp .+610 ; 0x2f3da 2f178: 63 96 adiw r28, 0x13 ; 19 2f17a: 8f ad ldd r24, Y+63 ; 0x3f 2f17c: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2f17e: 98 2f mov r25, r24 2f180: 9a 70 andi r25, 0x0A ; 10 2f182: 09 f0 breq .+2 ; 0x2f186 2f184: 2a c1 rjmp .+596 ; 0x2f3da 2f186: 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; 2f188: 91 e0 ldi r25, 0x01 ; 1 2f18a: 80 31 cpi r24, 0x10 ; 16 2f18c: 19 f0 breq .+6 ; 0x2f194 2f18e: 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 2f190: 80 31 cpi r24, 0x10 ; 16 2f192: 31 f4 brne .+12 ; 0x2f1a0 2f194: e5 96 adiw r28, 0x35 ; 53 2f196: ff ad ldd r31, Y+63 ; 0x3f 2f198: e5 97 sbiw r28, 0x35 ; 53 2f19a: ff 23 and r31, r31 2f19c: 09 f4 brne .+2 ; 0x2f1a0 2f19e: 94 c0 rjmp .+296 ; 0x2f2c8 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2f1a0: 90 93 dc 14 sts 0x14DC, r25 ; 0x8014dc if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2f1a4: 80 31 cpi r24, 0x10 ; 16 2f1a6: 61 f0 breq .+24 ; 0x2f1c0 2f1a8: 60 96 adiw r28, 0x10 ; 16 2f1aa: 8f ad ldd r24, Y+63 ; 0x3f 2f1ac: 60 97 sbiw r28, 0x10 ; 16 2f1ae: 87 34 cpi r24, 0x47 ; 71 2f1b0: 09 f0 breq .+2 ; 0x2f1b4 2f1b2: 13 c1 rjmp .+550 ; 0x2f3da 2f1b4: 61 96 adiw r28, 0x11 ; 17 2f1b6: 8f ad ldd r24, Y+63 ; 0x3f 2f1b8: 61 97 sbiw r28, 0x11 ; 17 2f1ba: 8e 37 cpi r24, 0x7E ; 126 2f1bc: 09 f4 brne .+2 ; 0x2f1c0 2f1be: 0d c1 rjmp .+538 ; 0x2f3da switch (lsAction) { 2f1c0: e5 96 adiw r28, 0x35 ; 53 2f1c2: ff ad ldd r31, Y+63 ; 0x3f 2f1c4: e5 97 sbiw r28, 0x35 ; 53 2f1c6: f1 30 cpi r31, 0x01 ; 1 2f1c8: 09 f4 brne .+2 ; 0x2f1cc 2f1ca: 1b c1 rjmp .+566 ; 0x2f402 2f1cc: f2 30 cpi r31, 0x02 ; 2 2f1ce: 09 f4 brne .+2 ; 0x2f1d2 2f1d0: 25 c1 rjmp .+586 ; 0x2f41c case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2f1d2: be 01 movw r22, r28 2f1d4: 69 5b subi r22, 0xB9 ; 185 2f1d6: 7f 4f sbci r23, 0xFF ; 255 2f1d8: 82 e9 ldi r24, 0x92 ; 146 2f1da: 94 e1 ldi r25, 0x14 ; 20 2f1dc: 0e 94 96 76 call 0xed2c ; 0xed2c 2f1e0: c4 01 movw r24, r8 2f1e2: 0e 94 94 87 call 0x10f28 ; 0x10f28 2f1e6: 82 e9 ldi r24, 0x92 ; 146 2f1e8: 94 e1 ldi r25, 0x14 ; 20 2f1ea: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2f1ee: 80 e2 ldi r24, 0x20 ; 32 2f1f0: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2f1f4: a7 96 adiw r28, 0x27 ; 39 2f1f6: 6c ad ldd r22, Y+60 ; 0x3c 2f1f8: 7d ad ldd r23, Y+61 ; 0x3d 2f1fa: 8e ad ldd r24, Y+62 ; 0x3e 2f1fc: 9f ad ldd r25, Y+63 ; 0x3f 2f1fe: a7 97 sbiw r28, 0x27 ; 39 2f200: 4a e0 ldi r20, 0x0A ; 10 2f202: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2f206: 51 fe sbrs r5, 1 2f208: 45 c0 rjmp .+138 ; 0x2f294 { crmodDate = p.lastWriteDate; 2f20a: a1 96 adiw r28, 0x21 ; 33 2f20c: 2e ad ldd r18, Y+62 ; 0x3e 2f20e: 3f ad ldd r19, Y+63 ; 0x3f 2f210: a1 97 sbiw r28, 0x21 ; 33 2f212: 30 93 a2 14 sts 0x14A2, r19 ; 0x8014a2 2f216: 20 93 a1 14 sts 0x14A1, r18 ; 0x8014a1 crmodTime = p.lastWriteTime; 2f21a: 6f 96 adiw r28, 0x1f ; 31 2f21c: 4e ad ldd r20, Y+62 ; 0x3e 2f21e: 5f ad ldd r21, Y+63 ; 0x3f 2f220: 6f 97 sbiw r28, 0x1f ; 31 2f222: 50 93 a0 14 sts 0x14A0, r21 ; 0x8014a0 2f226: 40 93 9f 14 sts 0x149F, r20 ; 0x80149f if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2f22a: 69 96 adiw r28, 0x19 ; 25 2f22c: 8e ad ldd r24, Y+62 ; 0x3e 2f22e: 9f ad ldd r25, Y+63 ; 0x3f 2f230: 69 97 sbiw r28, 0x19 ; 25 2f232: 28 17 cp r18, r24 2f234: 39 07 cpc r19, r25 2f236: 50 f0 brcs .+20 ; 0x2f24c 2f238: 28 17 cp r18, r24 2f23a: 39 07 cpc r19, r25 2f23c: 99 f4 brne .+38 ; 0x2f264 2f23e: 67 96 adiw r28, 0x17 ; 23 2f240: 2e ad ldd r18, Y+62 ; 0x3e 2f242: 3f ad ldd r19, Y+63 ; 0x3f 2f244: 67 97 sbiw r28, 0x17 ; 23 2f246: 42 17 cp r20, r18 2f248: 53 07 cpc r21, r19 2f24a: 60 f4 brcc .+24 ; 0x2f264 crmodDate = p.creationDate; 2f24c: 90 93 a2 14 sts 0x14A2, r25 ; 0x8014a2 2f250: 80 93 a1 14 sts 0x14A1, r24 ; 0x8014a1 crmodTime = p.creationTime; 2f254: 67 96 adiw r28, 0x17 ; 23 2f256: 8e ad ldd r24, Y+62 ; 0x3e 2f258: 9f ad ldd r25, Y+63 ; 0x3f 2f25a: 67 97 sbiw r28, 0x17 ; 23 2f25c: 90 93 a0 14 sts 0x14A0, r25 ; 0x8014a0 2f260: 80 93 9f 14 sts 0x149F, r24 ; 0x80149f } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2f264: 80 91 a2 14 lds r24, 0x14A2 ; 0x8014a2 2f268: 8f 93 push r24 2f26a: 80 91 a1 14 lds r24, 0x14A1 ; 0x8014a1 2f26e: 8f 93 push r24 2f270: 80 91 a0 14 lds r24, 0x14A0 ; 0x8014a0 2f274: 8f 93 push r24 2f276: 80 91 9f 14 lds r24, 0x149F ; 0x80149f 2f27a: 8f 93 push r24 2f27c: 2b e1 ldi r18, 0x1B ; 27 2f27e: 3a ea ldi r19, 0xAA ; 170 2f280: 3f 93 push r19 2f282: 2f 93 push r18 2f284: 0f 94 16 db call 0x3b62c ; 0x3b62c 2f288: 0f 90 pop r0 2f28a: 0f 90 pop r0 2f28c: 0f 90 pop r0 2f28e: 0f 90 pop r0 2f290: 0f 90 pop r0 2f292: 0f 90 pop r0 } if (lsParams.LFN) 2f294: 11 23 and r17, r17 2f296: 99 f0 breq .+38 ; 0x2f2be printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f298: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f29c: 88 23 and r24, r24 2f29e: 09 f4 brne .+2 ; 0x2f2a2 2f2a0: ba c0 rjmp .+372 ; 0x2f416 2f2a2: 87 ea ldi r24, 0xA7 ; 167 2f2a4: 94 e1 ldi r25, 0x14 ; 20 2f2a6: 9f 93 push r25 2f2a8: 8f 93 push r24 2f2aa: e5 e1 ldi r30, 0x15 ; 21 2f2ac: fa ea ldi r31, 0xAA ; 170 2f2ae: ff 93 push r31 2f2b0: ef 93 push r30 2f2b2: 0f 94 16 db call 0x3b62c ; 0x3b62c 2f2b6: 0f 90 pop r0 2f2b8: 0f 90 pop r0 2f2ba: 0f 90 pop r0 2f2bc: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2f2be: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a manage_heater(); 2f2c2: 0f 94 61 39 call 0x272c2 ; 0x272c2 2f2c6: 89 c0 rjmp .+274 ; 0x2f3da } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2f2c8: 2d b7 in r18, 0x3d ; 61 2f2ca: 3e b7 in r19, 0x3e ; 62 2f2cc: e7 96 adiw r28, 0x37 ; 55 2f2ce: 3f af std Y+63, r19 ; 0x3f 2f2d0: 2e af std Y+62, r18 ; 0x3e 2f2d2: 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); 2f2d4: be 01 movw r22, r28 2f2d6: 69 5b subi r22, 0xB9 ; 185 2f2d8: 7f 4f sbci r23, 0xFF ; 255 2f2da: c5 01 movw r24, r10 2f2dc: 0e 94 96 76 call 0xed2c ; 0xed2c // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2f2e0: f4 01 movw r30, r8 2f2e2: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2f2e4: 88 23 and r24, r24 2f2e6: 09 f4 brne .+2 ; 0x2f2ea 2f2e8: 86 c0 rjmp .+268 ; 0x2f3f6 2f2ea: 01 90 ld r0, Z+ 2f2ec: 00 20 and r0, r0 2f2ee: e9 f7 brne .-6 ; 0x2f2ea 2f2f0: 31 97 sbiw r30, 0x01 ; 1 2f2f2: e8 19 sub r30, r8 2f2f4: f9 09 sbc r31, r9 2f2f6: d5 01 movw r26, r10 2f2f8: 0d 90 ld r0, X+ 2f2fa: 00 20 and r0, r0 2f2fc: e9 f7 brne .-6 ; 0x2f2f8 2f2fe: ea 19 sub r30, r10 2f300: fb 09 sbc r31, r11 char path[len]; 2f302: ea 0f add r30, r26 2f304: fb 1f adc r31, r27 2f306: 31 96 adiw r30, 0x01 ; 1 2f308: 2d b7 in r18, 0x3d ; 61 2f30a: 3e b7 in r19, 0x3e ; 62 2f30c: 2e 1b sub r18, r30 2f30e: 3f 0b sbc r19, r31 2f310: 0f b6 in r0, 0x3f ; 63 2f312: f8 94 cli 2f314: 3e bf out 0x3e, r19 ; 62 2f316: 0f be out 0x3f, r0 ; 63 2f318: 2d bf out 0x3d, r18 ; 61 2f31a: ed b7 in r30, 0x3d ; 61 2f31c: fe b7 in r31, 0x3e ; 62 2f31e: 31 96 adiw r30, 0x01 ; 1 2f320: 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 2f322: 6d e1 ldi r22, 0x1D ; 29 2f324: 73 e0 ldi r23, 0x03 ; 3 2f326: 81 11 cpse r24, r1 2f328: b4 01 movw r22, r8 2f32a: c7 01 movw r24, r14 2f32c: 0f 94 bf e2 call 0x3c57e ; 0x3c57e strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f330: b5 01 movw r22, r10 2f332: c7 01 movw r24, r14 2f334: 0f 94 a0 e2 call 0x3c540 ; 0x3c540 strcat(path, "/"); // 1 character 2f338: 6d e1 ldi r22, 0x1D ; 29 2f33a: 73 e0 ldi r23, 0x03 ; 3 2f33c: c7 01 movw r24, r14 2f33e: 0f 94 a0 e2 call 0x3c540 ; 0x3c540 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f342: 11 23 and r17, r17 2f344: a9 f0 breq .+42 ; 0x2f370 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f346: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f34a: 81 11 cpse r24, r1 2f34c: 57 c0 rjmp .+174 ; 0x2f3fc 2f34e: c5 01 movw r24, r10 2f350: 9f 93 push r25 2f352: 8f 93 push r24 2f354: ff 92 push r15 2f356: ef 92 push r14 2f358: 2a e2 ldi r18, 0x2A ; 42 2f35a: 3a ea ldi r19, 0xAA ; 170 2f35c: 3f 93 push r19 2f35e: 2f 93 push r18 2f360: 0f 94 16 db call 0x3b62c ; 0x3b62c 2f364: 0f 90 pop r0 2f366: 0f 90 pop r0 2f368: 0f 90 pop r0 2f36a: 0f 90 pop r0 2f36c: 0f 90 pop r0 2f36e: 0f 90 pop r0 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 2f370: 1c a2 std Y+36, r1 ; 0x24 2f372: 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); 2f374: 21 e0 ldi r18, 0x01 ; 1 2f376: a5 01 movw r20, r10 2f378: b6 01 movw r22, r12 2f37a: ce 01 movw r24, r28 2f37c: 84 96 adiw r24, 0x24 ; 36 2f37e: 0f 94 53 65 call 0x2caa6 ; 0x2caa6 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); 2f382: 83 e2 ldi r24, 0x23 ; 35 2f384: fe 01 movw r30, r28 2f386: b4 96 adiw r30, 0x24 ; 36 2f388: de 01 movw r26, r28 2f38a: 11 96 adiw r26, 0x01 ; 1 2f38c: 01 90 ld r0, Z+ 2f38e: 0d 92 st X+, r0 2f390: 8a 95 dec r24 2f392: e1 f7 brne .-8 ; 0x2f38c 2f394: 10 fb bst r17, 0 2f396: 50 f8 bld r5, 0 2f398: 05 2d mov r16, r5 2f39a: 20 e0 ldi r18, 0x00 ; 0 2f39c: 50 e0 ldi r21, 0x00 ; 0 2f39e: 40 e0 ldi r20, 0x00 ; 0 2f3a0: be 01 movw r22, r28 2f3a2: 6f 5f subi r22, 0xFF ; 255 2f3a4: 7f 4f sbci r23, 0xFF ; 255 2f3a6: c7 01 movw r24, r14 2f3a8: 0f 94 4a 78 call 0x2f094 ; 0x2f094 2f3ac: ce 01 movw r24, r28 2f3ae: 01 96 adiw r24, 0x01 ; 1 2f3b0: 0e 94 b1 76 call 0xed62 ; 0xed62 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f3b4: 11 23 and r17, r17 2f3b6: 21 f0 breq .+8 ; 0x2f3c0 puts_P(PSTR("DIR_EXIT")); 2f3b8: 81 e2 ldi r24, 0x21 ; 33 2f3ba: 9a ea ldi r25, 0xAA ; 170 2f3bc: 0f 94 3d db call 0x3b67a ; 0x3b67a 2f3c0: ce 01 movw r24, r28 2f3c2: 84 96 adiw r24, 0x24 ; 36 2f3c4: 0e 94 b1 76 call 0xed62 ; 0xed62 2f3c8: e7 96 adiw r28, 0x37 ; 55 2f3ca: ee ad ldd r30, Y+62 ; 0x3e 2f3cc: ff ad ldd r31, Y+63 ; 0x3f 2f3ce: e7 97 sbiw r28, 0x37 ; 55 2f3d0: 0f b6 in r0, 0x3f ; 63 2f3d2: f8 94 cli 2f3d4: fe bf out 0x3e, r31 ; 62 2f3d6: 0f be out 0x3f, r0 ; 63 2f3d8: 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()) { 2f3da: f6 01 movw r30, r12 2f3dc: 80 85 ldd r24, Z+8 ; 0x08 2f3de: 91 85 ldd r25, Z+9 ; 0x09 2f3e0: a2 85 ldd r26, Z+10 ; 0x0a 2f3e2: b3 85 ldd r27, Z+11 ; 0x0b 2f3e4: 80 93 a3 14 sts 0x14A3, r24 ; 0x8014a3 2f3e8: 90 93 a4 14 sts 0x14A4, r25 ; 0x8014a4 2f3ec: a0 93 a5 14 sts 0x14A5, r26 ; 0x8014a5 2f3f0: b0 93 a6 14 sts 0x14A6, r27 ; 0x8014a6 2f3f4: 8c ce rjmp .-744 ; 0x2f10e // 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; 2f3f6: e1 e0 ldi r30, 0x01 ; 1 2f3f8: f0 e0 ldi r31, 0x00 ; 0 2f3fa: 7d cf rjmp .-262 ; 0x2f2f6 // 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); 2f3fc: 87 ea ldi r24, 0xA7 ; 167 2f3fe: 94 e1 ldi r25, 0x14 ; 20 2f400: a7 cf rjmp .-178 ; 0x2f350 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f402: 80 91 a8 17 lds r24, 0x17A8 ; 0x8017a8 2f406: 90 91 a9 17 lds r25, 0x17A9 ; 0x8017a9 2f40a: 01 96 adiw r24, 0x01 ; 1 2f40c: 90 93 a9 17 sts 0x17A9, r25 ; 0x8017a9 2f410: 80 93 a8 17 sts 0x17A8, r24 ; 0x8017a8 2f414: e2 cf rjmp .-60 ; 0x2f3da } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f416: 82 e9 ldi r24, 0x92 ; 146 2f418: 94 e1 ldi r25, 0x14 ; 20 2f41a: 45 cf rjmp .-374 ; 0x2f2a6 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f41c: be 01 movw r22, r28 2f41e: 69 5b subi r22, 0xB9 ; 185 2f420: 7f 4f sbci r23, 0xFF ; 255 2f422: 82 e9 ldi r24, 0x92 ; 146 2f424: 94 e1 ldi r25, 0x14 ; 20 2f426: 0e 94 96 76 call 0xed2c ; 0xed2c SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f42a: a1 96 adiw r28, 0x21 ; 33 2f42c: 2e ad ldd r18, Y+62 ; 0x3e 2f42e: 3f ad ldd r19, Y+63 ; 0x3f 2f430: a1 97 sbiw r28, 0x21 ; 33 2f432: 30 93 a2 14 sts 0x14A2, r19 ; 0x8014a2 2f436: 20 93 a1 14 sts 0x14A1, r18 ; 0x8014a1 crmodTime = p.lastWriteTime; 2f43a: 6f 96 adiw r28, 0x1f ; 31 2f43c: 4e ad ldd r20, Y+62 ; 0x3e 2f43e: 5f ad ldd r21, Y+63 ; 0x3f 2f440: 6f 97 sbiw r28, 0x1f ; 31 2f442: 50 93 a0 14 sts 0x14A0, r21 ; 0x8014a0 2f446: 40 93 9f 14 sts 0x149F, r20 ; 0x80149f // 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 ) ){ 2f44a: 69 96 adiw r28, 0x19 ; 25 2f44c: 8e ad ldd r24, Y+62 ; 0x3e 2f44e: 9f ad ldd r25, Y+63 ; 0x3f 2f450: 69 97 sbiw r28, 0x19 ; 25 2f452: 28 17 cp r18, r24 2f454: 39 07 cpc r19, r25 2f456: 50 f0 brcs .+20 ; 0x2f46c 2f458: 28 17 cp r18, r24 2f45a: 39 07 cpc r19, r25 2f45c: 99 f4 brne .+38 ; 0x2f484 2f45e: 67 96 adiw r28, 0x17 ; 23 2f460: 2e ad ldd r18, Y+62 ; 0x3e 2f462: 3f ad ldd r19, Y+63 ; 0x3f 2f464: 67 97 sbiw r28, 0x17 ; 23 2f466: 42 17 cp r20, r18 2f468: 53 07 cpc r21, r19 2f46a: 60 f4 brcc .+24 ; 0x2f484 crmodDate = p.creationDate; 2f46c: 90 93 a2 14 sts 0x14A2, r25 ; 0x8014a2 2f470: 80 93 a1 14 sts 0x14A1, r24 ; 0x8014a1 crmodTime = p.creationTime; 2f474: 67 96 adiw r28, 0x17 ; 23 2f476: 8e ad ldd r24, Y+62 ; 0x3e 2f478: 9f ad ldd r25, Y+63 ; 0x3f 2f47a: 67 97 sbiw r28, 0x17 ; 23 2f47c: 90 93 a0 14 sts 0x14A0, r25 ; 0x8014a0 2f480: 80 93 9f 14 sts 0x149F, r24 ; 0x80149f } //writeDate = p.lastAccessDate; if (match != NULL) { 2f484: 61 14 cp r6, r1 2f486: 71 04 cpc r7, r1 2f488: 59 f1 breq .+86 ; 0x2f4e0 if (strcasecmp(match, filename) == 0) return; 2f48a: 62 e9 ldi r22, 0x92 ; 146 2f48c: 74 e1 ldi r23, 0x14 ; 20 2f48e: c3 01 movw r24, r6 2f490: 0f 94 8d e2 call 0x3c51a ; 0x3c51a 2f494: 89 2b or r24, r25 2f496: 59 f5 brne .+86 ; 0x2f4ee // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f498: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2f49c: 81 50 subi r24, 0x01 ; 1 2f49e: 80 93 9c 0e sts 0x0E9C, r24 ; 0x800e9c cnt++; break; } } } // while readDir } 2f4a2: 0f b6 in r0, 0x3f ; 63 2f4a4: f8 94 cli 2f4a6: 3e be out 0x3e, r3 ; 62 2f4a8: 0f be out 0x3f, r0 ; 63 2f4aa: 2d be out 0x3d, r2 ; 61 2f4ac: ca 58 subi r28, 0x8A ; 138 2f4ae: df 4f sbci r29, 0xFF ; 255 2f4b0: 0f b6 in r0, 0x3f ; 63 2f4b2: f8 94 cli 2f4b4: de bf out 0x3e, r29 ; 62 2f4b6: 0f be out 0x3f, r0 ; 63 2f4b8: cd bf out 0x3d, r28 ; 61 2f4ba: df 91 pop r29 2f4bc: cf 91 pop r28 2f4be: 1f 91 pop r17 2f4c0: 0f 91 pop r16 2f4c2: ff 90 pop r15 2f4c4: ef 90 pop r14 2f4c6: df 90 pop r13 2f4c8: cf 90 pop r12 2f4ca: bf 90 pop r11 2f4cc: af 90 pop r10 2f4ce: 9f 90 pop r9 2f4d0: 8f 90 pop r8 2f4d2: 7f 90 pop r7 2f4d4: 6f 90 pop r6 2f4d6: 5f 90 pop r5 2f4d8: 4f 90 pop r4 2f4da: 3f 90 pop r3 2f4dc: 2f 90 pop r2 2f4de: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f4e0: 80 91 a8 17 lds r24, 0x17A8 ; 0x8017a8 2f4e4: 90 91 a9 17 lds r25, 0x17A9 ; 0x8017a9 2f4e8: 48 16 cp r4, r24 2f4ea: 19 06 cpc r1, r25 2f4ec: a9 f2 breq .-86 ; 0x2f498 cnt++; 2f4ee: 43 94 inc r4 2f4f0: 74 cf rjmp .-280 ; 0x2f3da 0002f4f2 : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f4f2: cf 92 push r12 2f4f4: df 92 push r13 2f4f6: ef 92 push r14 2f4f8: ff 92 push r15 2f4fa: 0f 93 push r16 2f4fc: cf 93 push r28 2f4fe: df 93 push r29 2f500: cd b7 in r28, 0x3d ; 61 2f502: de b7 in r29, 0x3e ; 62 2f504: a3 97 sbiw r28, 0x23 ; 35 2f506: 0f b6 in r0, 0x3f ; 63 2f508: f8 94 cli 2f50a: de bf out 0x3e, r29 ; 62 2f50c: 0f be out 0x3f, r0 ; 63 2f50e: cd bf out 0x3d, r28 ; 61 2f510: 6c 01 movw r12, r24 { curDir=&workDir; 2f512: 89 e3 ldi r24, 0x39 ; 57 2f514: e8 2e mov r14, r24 2f516: 85 e1 ldi r24, 0x15 ; 21 2f518: f8 2e mov r15, r24 2f51a: 8b e3 ldi r24, 0x3B ; 59 2f51c: 95 e1 ldi r25, 0x15 ; 21 2f51e: d7 01 movw r26, r14 2f520: 8d 93 st X+, r24 2f522: 9c 93 st X, r25 nrFiles=nr; 2f524: 10 92 a9 17 sts 0x17A9, r1 ; 0x8017a9 2f528: 10 92 a8 17 sts 0x17A8, r1 ; 0x8017a8 curDir->rewind(); 2f52c: 0e 94 ac 76 call 0xed58 ; 0xed58 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f530: 00 e0 ldi r16, 0x00 ; 0 2f532: 0e 7f andi r16, 0xFE ; 254 2f534: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f536: d7 01 movw r26, r14 2f538: ed 91 ld r30, X+ 2f53a: fc 91 ld r31, X 2f53c: 83 e2 ldi r24, 0x23 ; 35 2f53e: de 01 movw r26, r28 2f540: 11 96 adiw r26, 0x01 ; 1 2f542: 01 90 ld r0, Z+ 2f544: 0d 92 st X+, r0 2f546: 8a 95 dec r24 2f548: e1 f7 brne .-8 ; 0x2f542 2f54a: 22 e0 ldi r18, 0x02 ; 2 2f54c: a6 01 movw r20, r12 2f54e: be 01 movw r22, r28 2f550: 6f 5f subi r22, 0xFF ; 255 2f552: 7f 4f sbci r23, 0xFF ; 255 2f554: 88 ef ldi r24, 0xF8 ; 248 2f556: 92 e0 ldi r25, 0x02 ; 2 2f558: 0f 94 4a 78 call 0x2f094 ; 0x2f094 2f55c: ce 01 movw r24, r28 2f55e: 01 96 adiw r24, 0x01 ; 1 2f560: 0e 94 b1 76 call 0xed62 ; 0xed62 } 2f564: a3 96 adiw r28, 0x23 ; 35 2f566: 0f b6 in r0, 0x3f ; 63 2f568: f8 94 cli 2f56a: de bf out 0x3e, r29 ; 62 2f56c: 0f be out 0x3f, r0 ; 63 2f56e: cd bf out 0x3d, r28 ; 61 2f570: df 91 pop r29 2f572: cf 91 pop r28 2f574: 0f 91 pop r16 2f576: ff 90 pop r15 2f578: ef 90 pop r14 2f57a: df 90 pop r13 2f57c: cf 90 pop r12 2f57e: 08 95 ret 0002f580 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f580: ef 92 push r14 2f582: ff 92 push r15 2f584: 0f 93 push r16 2f586: cf 93 push r28 2f588: df 93 push r29 2f58a: cd b7 in r28, 0x3d ; 61 2f58c: de b7 in r29, 0x3e ; 62 2f58e: a3 97 sbiw r28, 0x23 ; 35 2f590: 0f b6 in r0, 0x3f ; 63 2f592: f8 94 cli 2f594: de bf out 0x3e, r29 ; 62 2f596: 0f be out 0x3f, r0 ; 63 2f598: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f59a: 29 e3 ldi r18, 0x39 ; 57 2f59c: e2 2e mov r14, r18 2f59e: 25 e1 ldi r18, 0x15 ; 21 2f5a0: f2 2e mov r15, r18 2f5a2: 2b e3 ldi r18, 0x3B ; 59 2f5a4: 35 e1 ldi r19, 0x15 ; 21 2f5a6: d7 01 movw r26, r14 2f5a8: 2d 93 st X+, r18 2f5aa: 3c 93 st X, r19 nrFiles = 0; 2f5ac: 10 92 a9 17 sts 0x17A9, r1 ; 0x8017a9 2f5b0: 10 92 a8 17 sts 0x17A8, r1 ; 0x8017a8 curDir->seekSet((uint32_t)entry << 5); 2f5b4: b0 e0 ldi r27, 0x00 ; 0 2f5b6: a0 e0 ldi r26, 0x00 ; 0 2f5b8: ac 01 movw r20, r24 2f5ba: bd 01 movw r22, r26 2f5bc: e5 e0 ldi r30, 0x05 ; 5 2f5be: 44 0f add r20, r20 2f5c0: 55 1f adc r21, r21 2f5c2: 66 1f adc r22, r22 2f5c4: 77 1f adc r23, r23 2f5c6: ea 95 dec r30 2f5c8: d1 f7 brne .-12 ; 0x2f5be 2f5ca: c9 01 movw r24, r18 2f5cc: 0f 94 cd 57 call 0x2af9a ; 0x2af9a 2f5d0: 00 e0 ldi r16, 0x00 ; 0 2f5d2: 0e 7f andi r16, 0xFE ; 254 2f5d4: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f5d6: d7 01 movw r26, r14 2f5d8: ed 91 ld r30, X+ 2f5da: fc 91 ld r31, X 2f5dc: 83 e2 ldi r24, 0x23 ; 35 2f5de: de 01 movw r26, r28 2f5e0: 11 96 adiw r26, 0x01 ; 1 2f5e2: 01 90 ld r0, Z+ 2f5e4: 0d 92 st X+, r0 2f5e6: 8a 95 dec r24 2f5e8: e1 f7 brne .-8 ; 0x2f5e2 2f5ea: 22 e0 ldi r18, 0x02 ; 2 2f5ec: 50 e0 ldi r21, 0x00 ; 0 2f5ee: 40 e0 ldi r20, 0x00 ; 0 2f5f0: be 01 movw r22, r28 2f5f2: 6f 5f subi r22, 0xFF ; 255 2f5f4: 7f 4f sbci r23, 0xFF ; 255 2f5f6: 88 ef ldi r24, 0xF8 ; 248 2f5f8: 92 e0 ldi r25, 0x02 ; 2 2f5fa: 0f 94 4a 78 call 0x2f094 ; 0x2f094 2f5fe: ce 01 movw r24, r28 2f600: 01 96 adiw r24, 0x01 ; 1 2f602: 0e 94 b1 76 call 0xed62 ; 0xed62 } 2f606: a3 96 adiw r28, 0x23 ; 35 2f608: 0f b6 in r0, 0x3f ; 63 2f60a: f8 94 cli 2f60c: de bf out 0x3e, r29 ; 62 2f60e: 0f be out 0x3f, r0 ; 63 2f610: cd bf out 0x3d, r28 ; 61 2f612: df 91 pop r29 2f614: cf 91 pop r28 2f616: 0f 91 pop r16 2f618: ff 90 pop r15 2f61a: ef 90 pop r14 2f61c: 08 95 ret 0002f61e : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f61e: cf 92 push r12 2f620: df 92 push r13 2f622: ef 92 push r14 2f624: ff 92 push r15 2f626: 0f 93 push r16 2f628: cf 93 push r28 2f62a: df 93 push r29 2f62c: cd b7 in r28, 0x3d ; 61 2f62e: de b7 in r29, 0x3e ; 62 2f630: a3 97 sbiw r28, 0x23 ; 35 2f632: 0f b6 in r0, 0x3f ; 63 2f634: f8 94 cli 2f636: de bf out 0x3e, r29 ; 62 2f638: 0f be out 0x3f, r0 ; 63 2f63a: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f63c: 89 e3 ldi r24, 0x39 ; 57 2f63e: c8 2e mov r12, r24 2f640: 85 e1 ldi r24, 0x15 ; 21 2f642: d8 2e mov r13, r24 2f644: 8b e3 ldi r24, 0x3B ; 59 2f646: 95 e1 ldi r25, 0x15 ; 21 2f648: d6 01 movw r26, r12 2f64a: 8d 93 st X+, r24 2f64c: 9c 93 st X, r25 nrFiles=0; 2f64e: 28 ea ldi r18, 0xA8 ; 168 2f650: e2 2e mov r14, r18 2f652: 27 e1 ldi r18, 0x17 ; 23 2f654: f2 2e mov r15, r18 2f656: f7 01 movw r30, r14 2f658: 11 82 std Z+1, r1 ; 0x01 2f65a: 10 82 st Z, r1 curDir->rewind(); 2f65c: 0e 94 ac 76 call 0xed58 ; 0xed58 2f660: 00 e0 ldi r16, 0x00 ; 0 2f662: 0e 7f andi r16, 0xFE ; 254 2f664: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f666: d6 01 movw r26, r12 2f668: ed 91 ld r30, X+ 2f66a: fc 91 ld r31, X 2f66c: 83 e2 ldi r24, 0x23 ; 35 2f66e: de 01 movw r26, r28 2f670: 11 96 adiw r26, 0x01 ; 1 2f672: 01 90 ld r0, Z+ 2f674: 0d 92 st X+, r0 2f676: 8a 95 dec r24 2f678: e1 f7 brne .-8 ; 0x2f672 2f67a: 21 e0 ldi r18, 0x01 ; 1 2f67c: 50 e0 ldi r21, 0x00 ; 0 2f67e: 40 e0 ldi r20, 0x00 ; 0 2f680: be 01 movw r22, r28 2f682: 6f 5f subi r22, 0xFF ; 255 2f684: 7f 4f sbci r23, 0xFF ; 255 2f686: 88 ef ldi r24, 0xF8 ; 248 2f688: 92 e0 ldi r25, 0x02 ; 2 2f68a: 0f 94 4a 78 call 0x2f094 ; 0x2f094 2f68e: ce 01 movw r24, r28 2f690: 01 96 adiw r24, 0x01 ; 1 2f692: 0e 94 b1 76 call 0xed62 ; 0xed62 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f696: f7 01 movw r30, r14 2f698: 80 81 ld r24, Z 2f69a: 91 81 ldd r25, Z+1 ; 0x01 2f69c: a3 96 adiw r28, 0x23 ; 35 2f69e: 0f b6 in r0, 0x3f ; 63 2f6a0: f8 94 cli 2f6a2: de bf out 0x3e, r29 ; 62 2f6a4: 0f be out 0x3f, r0 ; 63 2f6a6: cd bf out 0x3d, r28 ; 61 2f6a8: df 91 pop r29 2f6aa: cf 91 pop r28 2f6ac: 0f 91 pop r16 2f6ae: ff 90 pop r15 2f6b0: ef 90 pop r14 2f6b2: df 90 pop r13 2f6b4: cf 90 pop r12 2f6b6: 08 95 ret 0002f6b8 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f6b8: cf 93 push r28 2f6ba: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f6bc: 8f e2 ldi r24, 0x2F ; 47 2f6be: 0e 94 b7 76 call 0xed6e ; 0xed6e { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f6c2: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f6c4: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f6c6: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2f6ca: c8 17 cp r28, r24 2f6cc: 60 f4 brcc .+24 ; 0x2f6e6 { SERIAL_PROTOCOL(dir_names[i]); 2f6ce: cd 9f mul r28, r29 2f6d0: c0 01 movw r24, r0 2f6d2: 11 24 eor r1, r1 2f6d4: 80 52 subi r24, 0x20 ; 32 2f6d6: 9b 4e sbci r25, 0xEB ; 235 2f6d8: 0e 94 94 87 call 0x10f28 ; 0x10f28 2f6dc: 8f e2 ldi r24, 0x2F ; 47 2f6de: 0e 94 b7 76 call 0xed6e ; 0xed6e } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f6e2: cf 5f subi r28, 0xFF ; 255 2f6e4: f0 cf rjmp .-32 ; 0x2f6c6 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f6e6: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f6ea: 81 11 cpse r24, r1 2f6ec: 06 c0 rjmp .+12 ; 0x2f6fa 2f6ee: 82 e9 ldi r24, 0x92 ; 146 2f6f0: 94 e1 ldi r25, 0x14 ; 20 } 2f6f2: df 91 pop r29 2f6f4: cf 91 pop r28 2f6f6: 0c 94 94 87 jmp 0x10f28 ; 0x10f28 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f6fa: 87 ea ldi r24, 0xA7 ; 167 2f6fc: 94 e1 ldi r25, 0x14 ; 20 2f6fe: f9 cf rjmp .-14 ; 0x2f6f2 0002f700 : 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) { 2f700: cf 92 push r12 2f702: df 92 push r13 2f704: ef 92 push r14 2f706: ff 92 push r15 2f708: 6b 01 movw r12, r22 2f70a: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f70c: 88 ea ldi r24, 0xA8 ; 168 2f70e: 9c e0 ldi r25, 0x0C ; 12 2f710: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 2f714: ab 01 movw r20, r22 2f716: bc 01 movw r22, r24 2f718: 4c 0d add r20, r12 2f71a: 5d 1d adc r21, r13 2f71c: 6e 1d adc r22, r14 2f71e: 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); 2f720: 88 ea ldi r24, 0xA8 ; 168 2f722: 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); } 2f724: ff 90 pop r15 2f726: ef 90 pop r14 2f728: df 90 pop r13 2f72a: 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); 2f72c: 0d 94 aa dc jmp 0x3b954 ; 0x3b954 0002f730 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f730: cf 93 push r28 2f732: df 93 push r29 2f734: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f736: 0f 94 5c dc call 0x3b8b8 ; 0x3b8b8 if (val == EEPROM_EMPTY_VALUE32) { 2f73a: 6f 3f cpi r22, 0xFF ; 255 2f73c: 2f ef ldi r18, 0xFF ; 255 2f73e: 72 07 cpc r23, r18 2f740: 82 07 cpc r24, r18 2f742: 92 07 cpc r25, r18 2f744: 49 f4 brne .+18 ; 0x2f758 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); 2f746: 40 e0 ldi r20, 0x00 ; 0 2f748: 50 e0 ldi r21, 0x00 ; 0 2f74a: ba 01 movw r22, r20 2f74c: ce 01 movw r24, r28 2f74e: 0f 94 aa dc call 0x3b954 ; 0x3b954 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; 2f752: 60 e0 ldi r22, 0x00 ; 0 2f754: 70 e0 ldi r23, 0x00 ; 0 2f756: cb 01 movw r24, r22 } return val; } 2f758: df 91 pop r29 2f75a: cf 91 pop r28 2f75c: 08 95 ret 0002f75e : } // 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; 2f75e: e8 e2 ldi r30, 0x28 ; 40 2f760: f7 e1 ldi r31, 0x17 ; 23 2f762: 40 81 ld r20, Z 2f764: 51 81 ldd r21, Z+1 ; 0x01 2f766: 62 81 ldd r22, Z+2 ; 0x02 2f768: 73 81 ldd r23, Z+3 ; 0x03 2f76a: 48 0f add r20, r24 2f76c: 59 1f adc r21, r25 2f76e: 61 1d adc r22, r1 2f770: 71 1d adc r23, r1 2f772: 40 83 st Z, r20 2f774: 51 83 std Z+1, r21 ; 0x01 2f776: 62 83 std Z+2, r22 ; 0x02 2f778: 73 83 std Z+3, r23 ; 0x03 } 2f77a: 08 95 ret 0002f77c : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f77c: 0f 93 push r16 2f77e: 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_ ){ 2f780: 60 91 3d 17 lds r22, 0x173D ; 0x80173d 2f784: 70 91 3e 17 lds r23, 0x173E ; 0x80173e 2f788: 80 91 3f 17 lds r24, 0x173F ; 0x80173f 2f78c: 90 91 40 17 lds r25, 0x1740 ; 0x801740 2f790: 00 91 91 0e lds r16, 0x0E91 ; 0x800e91 2f794: 10 91 92 0e lds r17, 0x0E92 ; 0x800e92 2f798: 20 91 93 0e lds r18, 0x0E93 ; 0x800e93 2f79c: 30 91 94 0e lds r19, 0x0E94 ; 0x800e94 2f7a0: 60 17 cp r22, r16 2f7a2: 71 07 cpc r23, r17 2f7a4: 82 07 cpc r24, r18 2f7a6: 93 07 cpc r25, r19 2f7a8: 39 f1 breq .+78 ; 0x2f7f8 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f7aa: 40 e0 ldi r20, 0x00 ; 0 2f7ac: 0f 94 48 55 call 0x2aa90 ; 0x2aa90 2f7b0: 88 23 and r24, r24 2f7b2: f9 f0 breq .+62 ; 0x2f7f2 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f7b4: 20 91 41 17 lds r18, 0x1741 ; 0x801741 2f7b8: 30 91 42 17 lds r19, 0x1742 ; 0x801742 2f7bc: 40 91 31 17 lds r20, 0x1731 ; 0x801731 2f7c0: 50 91 32 17 lds r21, 0x1732 ; 0x801732 2f7c4: 60 91 33 17 lds r22, 0x1733 ; 0x801733 2f7c8: 70 91 34 17 lds r23, 0x1734 ; 0x801734 2f7cc: 42 1b sub r20, r18 2f7ce: 53 0b sbc r21, r19 2f7d0: 61 09 sbc r22, r1 2f7d2: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f7d4: 41 30 cpi r20, 0x01 ; 1 2f7d6: 92 e0 ldi r25, 0x02 ; 2 2f7d8: 59 07 cpc r21, r25 2f7da: 61 05 cpc r22, r1 2f7dc: 71 05 cpc r23, r1 2f7de: 20 f0 brcs .+8 ; 0x2f7e8 2f7e0: 40 e0 ldi r20, 0x00 ; 0 2f7e2: 52 e0 ldi r21, 0x02 ; 2 2f7e4: 60 e0 ldi r22, 0x00 ; 0 2f7e6: 70 e0 ldi r23, 0x00 ; 0 2f7e8: 43 56 subi r20, 0x63 ; 99 2f7ea: 51 4f sbci r21, 0xF1 ; 241 2f7ec: 9a e0 ldi r25, 0x0A ; 10 2f7ee: fa 01 movw r30, r20 2f7f0: 90 83 st Z, r25 } return true; } 2f7f2: 1f 91 pop r17 2f7f4: 0f 91 pop r16 2f7f6: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f7f8: 81 e0 ldi r24, 0x01 ; 1 2f7fa: fb cf rjmp .-10 ; 0x2f7f2 0002f7fc : } static uint8_t twi_start(uint8_t address, uint8_t reg) 2f7fc: cf 93 push r28 2f7fe: df 93 push r29 2f800: d8 2f mov r29, r24 { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 2f802: 84 ea ldi r24, 0xA4 ; 164 2f804: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2f808: 88 e0 ldi r24, 0x08 ; 8 2f80a: 0f 94 be 2a call 0x2557c ; 0x2557c 2f80e: 81 11 cpse r24, r1 2f810: 16 c0 rjmp .+44 ; 0x2f83e return 1; // send address TWDR = TW_WRITE | (address << 1); 2f812: 8a ee ldi r24, 0xEA ; 234 2f814: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f818: c4 e8 ldi r28, 0x84 ; 132 2f81a: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2f81e: 88 e1 ldi r24, 0x18 ; 24 2f820: 0f 94 be 2a call 0x2557c ; 0x2557c 2f824: 81 11 cpse r24, r1 2f826: 0f c0 rjmp .+30 ; 0x2f846 return 2; // send register TWDR = reg; 2f828: d0 93 bb 00 sts 0x00BB, r29 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f82c: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 2f830: 88 e2 ldi r24, 0x28 ; 40 2f832: 0f 94 be 2a call 0x2557c ; 0x2557c 2f836: 88 23 and r24, r24 2f838: 19 f0 breq .+6 ; 0x2f840 return 3; 2f83a: 83 e0 ldi r24, 0x03 ; 3 2f83c: 01 c0 rjmp .+2 ; 0x2f840 static uint8_t twi_start(uint8_t address, uint8_t reg) { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); if(twi_wait(TW_START)) return 1; 2f83e: 81 e0 ldi r24, 0x01 ; 1 TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_DATA_ACK)) return 3; return 0; } 2f840: df 91 pop r29 2f842: cf 91 pop r28 2f844: 08 95 ret // send address TWDR = TW_WRITE | (address << 1); TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_SLA_ACK)) return 2; 2f846: 82 e0 ldi r24, 0x02 ; 2 2f848: fb cf rjmp .-10 ; 0x2f840 0002f84a : ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } return ret; } void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } 2f84a: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f84c: f8 94 cli 2f84e: 10 92 bc 17 sts 0x17BC, r1 ; 0x8017bc 2f852: 10 92 bb 17 sts 0x17BB, r1 ; 0x8017bb (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f856: 8f bf out 0x3f, r24 ; 63 } 2f858: 08 95 ret 0002f85a : eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); 2f85a: 87 e6 ldi r24, 0x67 ; 103 2f85c: 9f e0 ldi r25, 0x0F ; 15 2f85e: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2f862: 91 e0 ldi r25, 0x01 ; 1 2f864: 81 11 cpse r24, r1 2f866: 01 c0 rjmp .+2 ; 0x2f86a 2f868: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { 2f86a: 81 e0 ldi r24, 0x01 ; 1 2f86c: 20 91 aa 17 lds r18, 0x17AA ; 0x8017aa 2f870: 21 11 cpse r18, r1 2f872: 01 c0 rjmp .+2 ; 0x2f876 2f874: 80 e0 ldi r24, 0x00 ; 0 2f876: 98 13 cpse r25, r24 state = enabled ? State::initializing : State::disabled; 2f878: 90 93 aa 17 sts 0x17AA, r25 ; 0x8017aa } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); 2f87c: 87 e0 ldi r24, 0x07 ; 7 2f87e: 9f e0 ldi r25, 0x0F ; 15 2f880: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2f884: 91 e0 ldi r25, 0x01 ; 1 2f886: 81 11 cpse r24, r1 2f888: 01 c0 rjmp .+2 ; 0x2f88c 2f88a: 90 e0 ldi r25, 0x00 ; 0 2f88c: 90 93 ab 17 sts 0x17AB, r25 ; 0x8017ab runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); 2f890: 85 ed ldi r24, 0xD5 ; 213 2f892: 9e e0 ldi r25, 0x0E ; 14 2f894: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2f898: 91 e0 ldi r25, 0x01 ; 1 2f89a: 81 11 cpse r24, r1 2f89c: 01 c0 rjmp .+2 ; 0x2f8a0 2f89e: 90 e0 ldi r25, 0x00 ; 0 2f8a0: 90 93 ac 17 sts 0x17AC, r25 ; 0x8017ac sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); 2f8a4: 87 e4 ldi r24, 0x47 ; 71 2f8a6: 9d e0 ldi r25, 0x0D ; 13 2f8a8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 if (sensorActionOnError == SensorActionOnError::_Undef) { 2f8ac: 8f 3f cpi r24, 0xFF ; 255 2f8ae: c9 f0 breq .+50 ; 0x2f8e2 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); 2f8b0: 80 93 b2 17 sts 0x17B2, r24 ; 0x8017b2 } void PAT9125_sensor::settings_init() { // puts_P(PSTR("settings_init")); Filament_sensor::settings_init_common(); setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); 2f8b4: 8d ea ldi r24, 0xAD ; 173 2f8b6: 9c e0 ldi r25, 0x0C ; 12 2f8b8: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2f8bc: 91 e0 ldi r25, 0x01 ; 1 2f8be: 81 11 cpse r24, r1 2f8c0: 01 c0 rjmp .+2 ; 0x2f8c4 2f8c2: 90 e0 ldi r25, 0x00 ; 0 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2f8c4: 90 93 b8 17 sts 0x17B8, r25 ; 0x8017b8 oldPos = pat9125_y; 2f8c8: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 2f8cc: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 2f8d0: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 2f8d4: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 resetStepCount(); 2f8d8: 0f 94 25 7c call 0x2f84a ; 0x2f84a jamErrCnt = 0; 2f8dc: 10 92 bf 17 sts 0x17BF, r1 ; 0x8017bf void PAT9125_sensor::settings_init() { // puts_P(PSTR("settings_init")); Filament_sensor::settings_init_common(); setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } 2f8e0: 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; 2f8e2: 10 92 b2 17 sts 0x17B2, r1 ; 0x8017b2 2f8e6: e6 cf rjmp .-52 ; 0x2f8b4 0002f8e8 : #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) #if (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) void PAT9125_sensor::init() { if (state == State::error) { 2f8e8: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 2f8ec: 83 30 cpi r24, 0x03 ; 3 2f8ee: 21 f4 brne .+8 ; 0x2f8f8 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; 2f8f0: 10 92 aa 17 sts 0x17AA, r1 ; 0x8017aa filter = 0; 2f8f4: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 if (state == State::error) { deinit(); // deinit first if there was an error. } // puts_P(PSTR("fsensor::init()")); settings_init(); // also sets the state to State::initializing 2f8f8: 0f 94 2d 7c call 0x2f85a ; 0x2f85a int16_t stepCount; int16_t chunkSteps; uint8_t jamErrCnt; constexpr void calcChunkSteps(float u) { chunkSteps = (int16_t)(1.25 * u); //[mm] 2f8fc: 20 e0 ldi r18, 0x00 ; 0 2f8fe: 30 e0 ldi r19, 0x00 ; 0 2f900: 40 ea ldi r20, 0xA0 ; 160 2f902: 5f e3 ldi r21, 0x3F ; 63 2f904: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 2f908: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 2f90c: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 2f910: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 2f914: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 2f918: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 2f91c: 70 93 be 17 sts 0x17BE, r23 ; 0x8017be 2f920: 60 93 bd 17 sts 0x17BD, r22 ; 0x8017bd void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 2f924: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 2f926: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 2f928: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 2f92a: 50 9a sbi 0x0a, 0 ; 10 2f92c: 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); 2f92e: 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); 2f930: 95 e0 ldi r25, 0x05 ; 5 2f932: 9a 95 dec r25 2f934: f1 f7 brne .-4 ; 0x2f932 2f936: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 2f938: 58 98 cbi 0x0b, 0 ; 11 2f93a: 95 e0 ldi r25, 0x05 ; 5 2f93c: 9a 95 dec r25 2f93e: f1 f7 brne .-4 ; 0x2f93c 2f940: 00 00 nop 2f942: 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++) { 2f944: a1 f7 brne .-24 ; 0x2f92e WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 2f946: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 2f948: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 2f94a: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2f94e: 8c 7f andi r24, 0xFC ; 252 2f950: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 2f954: 8c e0 ldi r24, 0x0C ; 12 2f956: 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); 2f95a: 84 ea ldi r24, 0xA4 ; 164 2f95c: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2f960: 88 e0 ldi r24, 0x08 ; 8 2f962: 0f 94 be 2a call 0x2557c ; 0x2557c 2f966: 81 11 cpse r24, r1 2f968: 68 c0 rjmp .+208 ; 0x2fa3a return 1; // send address TWDR = TW_WRITE | (address << 1); 2f96a: 8a ee ldi r24, 0xEA ; 234 2f96c: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f970: 84 e8 ldi r24, 0x84 ; 132 2f972: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2f976: 88 e1 ldi r24, 0x18 ; 24 2f978: 0f 94 be 2a call 0x2557c ; 0x2557c 2f97c: 81 11 cpse r24, r1 2f97e: 5d c0 rjmp .+186 ; 0x2fa3a } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 2f980: 84 e9 ldi r24, 0x94 ; 148 2f982: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> { if (!pat9125_probe()) return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0); 2f986: 60 e0 ldi r22, 0x00 ; 0 2f988: 8f e7 ldi r24, 0x7F ; 127 2f98a: 0f 94 46 c2 call 0x3848c ; 0x3848c // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f98e: 80 e0 ldi r24, 0x00 ; 0 2f990: 0f 94 61 c2 call 0x384c2 ; 0x384c2 2f994: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f998: 81 e0 ldi r24, 0x01 ; 1 2f99a: 0f 94 61 c2 call 0x384c2 ; 0x384c2 2f99e: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2f9a2: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 2f9a6: 91 33 cpi r25, 0x31 ; 49 2f9a8: b9 f5 brne .+110 ; 0x2fa18 2f9aa: 81 39 cpi r24, 0x91 ; 145 2f9ac: a9 f5 brne .+106 ; 0x2fa18 } #if PAT9125_NEW_INIT // Software reset (i.e. set bit7 to 1). It will reset to 0 automatically. // pat9125_wr_reg_verify is not allowed because the register contents will change as soon as they are written. No point in verifying those. pat9125_wr_reg(PAT9125_CONFIG, 0x97); 2f9ae: 67 e9 ldi r22, 0x97 ; 151 2f9b0: 86 e0 ldi r24, 0x06 ; 6 2f9b2: 0f 94 46 c2 call 0x3848c ; 0x3848c #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2f9b6: 8f e9 ldi r24, 0x9F ; 159 2f9b8: 9f e0 ldi r25, 0x0F ; 15 2f9ba: 01 97 sbiw r24, 0x01 ; 1 2f9bc: f1 f7 brne .-4 ; 0x2f9ba 2f9be: 00 c0 rjmp .+0 ; 0x2f9c0 2f9c0: 00 00 nop // Wait until the sensor reboots. _delay_ms(1); //Write init sequence in bank0. MUST ALREADY BE IN bank0. if (!pat9125_wr_seq(pat9125_init_bank0)) 2f9c2: 84 e0 ldi r24, 0x04 ; 4 2f9c4: 9a ea ldi r25, 0xAA ; 170 2f9c6: 0f 94 8e c2 call 0x3851c ; 0x3851c 2f9ca: 88 23 and r24, r24 2f9cc: b1 f1 breq .+108 ; 0x2fa3a 2f9ce: 8f e3 ldi r24, 0x3F ; 63 2f9d0: 9c e9 ldi r25, 0x9C ; 156 2f9d2: 01 97 sbiw r24, 0x01 ; 1 2f9d4: f1 f7 brne .-4 ; 0x2f9d2 2f9d6: 00 c0 rjmp .+0 ; 0x2f9d8 2f9d8: 00 00 nop return 0; _delay_ms(10); // not sure why this is here. But I'll allow it. // Switch to bank1, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x01); 2f9da: 61 e0 ldi r22, 0x01 ; 1 2f9dc: 8f e7 ldi r24, 0x7F ; 127 2f9de: 0f 94 46 c2 call 0x3848c ; 0x3848c //Write init sequence in bank1. MUST ALREADY BE IN bank1. if (!pat9125_wr_seq(pat9125_init_bank1)) 2f9e2: 81 ed ldi r24, 0xD1 ; 209 2f9e4: 99 ea ldi r25, 0xA9 ; 169 2f9e6: 0f 94 8e c2 call 0x3851c ; 0x3851c 2f9ea: 88 23 and r24, r24 2f9ec: 31 f1 breq .+76 ; 0x2fa3a return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x00); 2f9ee: 60 e0 ldi r22, 0x00 ; 0 2f9f0: 8f e7 ldi r24, 0x7F ; 127 2f9f2: 0f 94 46 c2 call 0x3848c ; 0x3848c // Enable write protect. pat9125_wr_reg(PAT9125_WP, 0x00); //prevents writing to registers over 0x09 2f9f6: 60 e0 ldi r22, 0x00 ; 0 2f9f8: 89 e0 ldi r24, 0x09 ; 9 2f9fa: 0f 94 46 c2 call 0x3848c ; 0x3848c pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f9fe: 80 e0 ldi r24, 0x00 ; 0 2fa00: 0f 94 61 c2 call 0x384c2 ; 0x384c2 2fa04: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2fa08: 81 e0 ldi r24, 0x01 ; 1 2fa0a: 0f 94 61 c2 call 0x384c2 ; 0x384c2 2fa0e: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc deinit(); triggerError(); ; // } #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { 2fa12: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2fa16: 08 95 ret // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) { pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2fa18: 80 e0 ldi r24, 0x00 ; 0 2fa1a: 0f 94 61 c2 call 0x384c2 ; 0x384c2 2fa1e: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2fa22: 81 e0 ldi r24, 0x01 ; 1 2fa24: 0f 94 61 c2 call 0x384c2 ; 0x384c2 2fa28: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2fa2c: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 2fa30: 91 33 cpi r25, 0x31 ; 49 2fa32: 19 f4 brne .+6 ; 0x2fa3a 2fa34: 81 39 cpi r24, 0x91 ; 145 2fa36: 09 f4 brne .+2 ; 0x2fa3a 2fa38: ba cf rjmp .-140 ; 0x2f9ae void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; filter = 0; 2fa3a: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 2fa3e: 83 e0 ldi r24, 0x03 ; 3 2fa40: 80 93 aa 17 sts 0x17AA, r24 ; 0x8017aa #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { ; // MK3 fw on MK3S printer } #endif // IR_SENSOR_PIN } 2fa44: 08 95 ret 0002fa46 : eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } bool PAT9125_sensor::updatePAT9125() { 2fa46: cf 93 push r28 2fa48: df 93 push r29 if (jamDetection) { 2fa4a: 80 91 b8 17 lds r24, 0x17B8 ; 0x8017b8 2fa4e: 88 23 and r24, r24 2fa50: 09 f4 brne .+2 ; 0x2fa54 2fa52: 62 c0 rjmp .+196 ; 0x2fb18 setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } int16_t PAT9125_sensor::getStepCount() { int16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } 2fa54: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2fa56: f8 94 cli 2fa58: c0 91 bb 17 lds r28, 0x17BB ; 0x8017bb 2fa5c: d0 91 bc 17 lds r29, 0x17BC ; 0x8017bc (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2fa60: 8f bf out 0x3f, r24 ; 63 } bool PAT9125_sensor::updatePAT9125() { if (jamDetection) { int16_t _stepCount = getStepCount(); if (abs(_stepCount) >= chunkSteps) { // end of chunk. Check distance 2fa62: ce 01 movw r24, r28 2fa64: d7 ff sbrs r29, 7 2fa66: 04 c0 rjmp .+8 ; 0x2fa70 2fa68: 88 27 eor r24, r24 2fa6a: 99 27 eor r25, r25 2fa6c: 8c 1b sub r24, r28 2fa6e: 9d 0b sbc r25, r29 2fa70: 20 91 bd 17 lds r18, 0x17BD ; 0x8017bd 2fa74: 30 91 be 17 lds r19, 0x17BE ; 0x8017be 2fa78: 82 17 cp r24, r18 2fa7a: 93 07 cpc r25, r19 2fa7c: 4c f1 brlt .+82 ; 0x2fad0 resetStepCount(); 2fa7e: 0f 94 25 7c call 0x2f84a ; 0x2f84a if (!pat9125_update()) { // get up to date data. reinit on error. 2fa82: 0f 94 ac c2 call 0x38558 ; 0x38558 2fa86: 81 11 cpse r24, r1 2fa88: 02 c0 rjmp .+4 ; 0x2fa8e init(); // try to reinit. 2fa8a: 0f 94 74 7c call 0x2f8e8 ; 0x2f8e8 } bool fsDir = (pat9125_y - oldPos) > 0; 2fa8e: 20 91 8f 0e lds r18, 0x0E8F ; 0x800e8f 2fa92: 30 91 90 0e lds r19, 0x0E90 ; 0x800e90 2fa96: 80 91 bf 17 lds r24, 0x17BF ; 0x8017bf 2fa9a: 40 91 b9 17 lds r20, 0x17B9 ; 0x8017b9 2fa9e: 50 91 ba 17 lds r21, 0x17BA ; 0x8017ba 2faa2: b9 01 movw r22, r18 2faa4: 64 1b sub r22, r20 2faa6: 75 0b sbc r23, r21 2faa8: 41 e0 ldi r20, 0x01 ; 1 2faaa: 16 16 cp r1, r22 2faac: 17 06 cpc r1, r23 2faae: 0c f0 brlt .+2 ; 0x2fab2 2fab0: 40 e0 ldi r20, 0x00 ; 0 bool stDir = _stepCount > 0; 2fab2: 91 e0 ldi r25, 0x01 ; 1 2fab4: 1c 16 cp r1, r28 2fab6: 1d 06 cpc r1, r29 2fab8: 0c f0 brlt .+2 ; 0x2fabc 2faba: 90 e0 ldi r25, 0x00 ; 0 if (fsDir != stDir) { 2fabc: 49 17 cp r20, r25 2fabe: 09 f4 brne .+2 ; 0x2fac2 2fac0: 63 c0 rjmp .+198 ; 0x2fb88 jamErrCnt++; 2fac2: 8f 5f subi r24, 0xFF ; 255 } else if (jamErrCnt) { jamErrCnt--; 2fac4: 80 93 bf 17 sts 0x17BF, r24 ; 0x8017bf } oldPos = pat9125_y; 2fac8: 30 93 ba 17 sts 0x17BA, r19 ; 0x8017ba 2facc: 20 93 b9 17 sts 0x17B9, r18 ; 0x8017b9 } if (jamErrCnt > 10) { 2fad0: 80 91 bf 17 lds r24, 0x17BF ; 0x8017bf 2fad4: 8b 30 cpi r24, 0x0B ; 11 2fad6: 00 f1 brcs .+64 ; 0x2fb18 jamErrCnt = 0; 2fad8: 10 92 bf 17 sts 0x17BF, r1 ; 0x8017bf void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } } void PAT9125_sensor::filJam() { runoutEnabled = false; 2fadc: 10 92 ac 17 sts 0x17AC, r1 ; 0x8017ac autoLoadEnabled = false; 2fae0: 10 92 ab 17 sts 0x17AB, r1 ; 0x8017ab jamDetection = false; 2fae4: 10 92 b8 17 sts 0x17B8, r1 ; 0x8017b8 stop_and_save_print_to_ram(0, 0); 2fae8: 20 e0 ldi r18, 0x00 ; 0 2faea: 30 e0 ldi r19, 0x00 ; 0 2faec: a9 01 movw r20, r18 2faee: ca 01 movw r24, r20 2faf0: b9 01 movw r22, r18 2faf2: 0e 94 bf 88 call 0x1117e ; 0x1117e restore_print_from_ram_and_continue(0); 2faf6: 60 e0 ldi r22, 0x00 ; 0 2faf8: 70 e0 ldi r23, 0x00 ; 0 2fafa: cb 01 movw r24, r22 2fafc: 0e 94 c4 67 call 0xcf88 ; 0xcf88 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 2fb00: 85 e6 ldi r24, 0x65 ; 101 2fb02: 9f e0 ldi r25, 0x0F ; 15 2fb04: 0e 94 a8 75 call 0xeb50 ; 0xeb50 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 2fb08: 81 e0 ldi r24, 0x01 ; 1 2fb0a: 9f e0 ldi r25, 0x0F ; 15 2fb0c: 0e 94 9b 75 call 0xeb36 ; 0xeb36 enquecommand_front_P(MSG_M600); 2fb10: 87 e4 ldi r24, 0x47 ; 71 2fb12: 90 e7 ldi r25, 0x70 ; 112 2fb14: 0f 94 38 76 call 0x2ec70 ; 0x2ec70 jamErrCnt = 0; filJam(); } } if (pollingTimer.expired_cont(pollingPeriod)) { 2fb18: 6a e0 ldi r22, 0x0A ; 10 2fb1a: 70 e0 ldi r23, 0x00 ; 0 2fb1c: 83 eb ldi r24, 0xB3 ; 179 2fb1e: 97 e1 ldi r25, 0x17 ; 23 2fb20: 0f 94 ab 2a call 0x25556 ; 0x25556 ::expired_cont(unsigned short)> 2fb24: c8 2f mov r28, r24 2fb26: 88 23 and r24, r24 2fb28: 39 f1 breq .+78 ; 0x2fb78 pollingTimer.start(); 2fb2a: 83 eb ldi r24, 0xB3 ; 179 2fb2c: 97 e1 ldi r25, 0x17 ; 23 2fb2e: 0f 94 b2 2a call 0x25564 ; 0x25564 ::start()> if (!pat9125_update()) { 2fb32: 0f 94 ac c2 call 0x38558 ; 0x38558 2fb36: 81 11 cpse r24, r1 2fb38: 02 c0 rjmp .+4 ; 0x2fb3e init(); // try to reinit. 2fb3a: 0f 94 74 7c call 0x2f8e8 ; 0x2f8e8 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); 2fb3e: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 2fb42: 81 31 cpi r24, 0x11 ; 17 2fb44: 30 f0 brcs .+12 ; 0x2fb52 2fb46: c1 e0 ldi r28, 0x01 ; 1 2fb48: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 2fb4c: 82 33 cpi r24, 0x32 ; 50 2fb4e: 08 f4 brcc .+2 ; 0x2fb52 2fb50: c0 e0 ldi r28, 0x00 ; 0 2fb52: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 if (present != filterFilPresent) { 2fb56: 20 91 b7 17 lds r18, 0x17B7 ; 0x8017b7 2fb5a: 30 e0 ldi r19, 0x00 ; 0 2fb5c: c2 17 cp r28, r18 2fb5e: 13 06 cpc r1, r19 2fb60: c1 f0 breq .+48 ; 0x2fb92 filter++; 2fb62: 8f 5f subi r24, 0xFF ; 255 } else if (filter) { filter--; 2fb64: 80 93 b6 17 sts 0x17B6, r24 ; 0x8017b6 } if (filter >= filterCnt) { 2fb68: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 2fb6c: 85 30 cpi r24, 0x05 ; 5 2fb6e: 20 f0 brcs .+8 ; 0x2fb78 filter = 0; 2fb70: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 filterFilPresent = present; 2fb74: c0 93 b7 17 sts 0x17B7, r28 ; 0x8017b7 } } return (filter == 0); // return stability 2fb78: 81 e0 ldi r24, 0x01 ; 1 2fb7a: 90 91 b6 17 lds r25, 0x17B6 ; 0x8017b6 2fb7e: 91 11 cpse r25, r1 2fb80: 80 e0 ldi r24, 0x00 ; 0 } 2fb82: df 91 pop r29 2fb84: cf 91 pop r28 2fb86: 08 95 ret } bool fsDir = (pat9125_y - oldPos) > 0; bool stDir = _stepCount > 0; if (fsDir != stDir) { jamErrCnt++; } else if (jamErrCnt) { 2fb88: 88 23 and r24, r24 2fb8a: 09 f4 brne .+2 ; 0x2fb8e 2fb8c: 9d cf rjmp .-198 ; 0x2fac8 jamErrCnt--; 2fb8e: 81 50 subi r24, 0x01 ; 1 2fb90: 99 cf rjmp .-206 ; 0x2fac4 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); if (present != filterFilPresent) { filter++; } else if (filter) { 2fb92: 88 23 and r24, r24 2fb94: 49 f3 breq .-46 ; 0x2fb68 filter--; 2fb96: 81 50 subi r24, 0x01 ; 1 2fb98: e5 cf rjmp .-54 ; 0x2fb64 0002fb9a : * 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() { 2fb9a: 2f 92 push r2 2fb9c: 3f 92 push r3 2fb9e: 4f 92 push r4 2fba0: 5f 92 push r5 2fba2: 6f 92 push r6 2fba4: 7f 92 push r7 2fba6: 8f 92 push r8 2fba8: 9f 92 push r9 2fbaa: af 92 push r10 2fbac: bf 92 push r11 2fbae: cf 92 push r12 2fbb0: df 92 push r13 2fbb2: ef 92 push r14 2fbb4: ff 92 push r15 2fbb6: 0f 93 push r16 2fbb8: 1f 93 push r17 2fbba: cf 93 push r28 2fbbc: df 93 push r29 2fbbe: cd b7 in r28, 0x3d ; 61 2fbc0: de b7 in r29, 0x3e ; 62 2fbc2: ed 97 sbiw r28, 0x3d ; 61 2fbc4: 0f b6 in r0, 0x3f ; 63 2fbc6: f8 94 cli 2fbc8: de bf out 0x3e, r29 ; 62 2fbca: 0f be out 0x3f, r0 ; 63 2fbcc: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2fbce: 10 92 32 16 sts 0x1632, r1 ; 0x801632 2fbd2: 10 92 31 16 sts 0x1631, r1 ; 0x801631 lastSortedFilePosition = 0; 2fbd6: 10 92 fc 16 sts 0x16FC, r1 ; 0x8016fc 2fbda: 10 92 fb 16 sts 0x16FB, r1 ; 0x8016fb */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2fbde: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fbe2: 80 fd sbrc r24, 0 2fbe4: ef c0 rjmp .+478 ; 0x2fdc4 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2fbe6: 89 e0 ldi r24, 0x09 ; 9 2fbe8: 9f e0 ldi r25, 0x0F ; 15 2fbea: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 2fbee: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2fbf0: 82 e0 ldi r24, 0x02 ; 2 2fbf2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2fbf6: 0f 94 0f 7b call 0x2f61e ; 0x2f61e 2fbfa: 6c 01 movw r12, r24 if (fileCnt > 0) { 2fbfc: 00 97 sbiw r24, 0x00 ; 0 2fbfe: 09 f4 brne .+2 ; 0x2fc02 2fc00: de c0 rjmp .+444 ; 0x2fdbe // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2fc02: 85 36 cpi r24, 0x65 ; 101 2fc04: 91 05 cpc r25, r1 2fc06: 60 f0 brcs .+24 ; 0x2fc20 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2fc08: 32 e0 ldi r19, 0x02 ; 2 2fc0a: 33 16 cp r3, r19 2fc0c: 31 f0 breq .+12 ; 0x2fc1a lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2fc0e: 8e eb ldi r24, 0xBE ; 190 2fc10: 9b e5 ldi r25, 0x5B ; 91 2fc12: 0e 94 2c 72 call 0xe458 ; 0xe458 2fc16: 0f 94 f6 20 call 0x241ec ; 0x241ec } fileCnt = SDSORT_LIMIT; 2fc1a: f4 e6 ldi r31, 0x64 ; 100 2fc1c: cf 2e mov r12, r31 2fc1e: d1 2c mov r13, r1 } sort_count = fileCnt; 2fc20: d0 92 32 16 sts 0x1632, r13 ; 0x801632 2fc24: c0 92 31 16 sts 0x1631, r12 ; 0x801631 2fc28: 63 e3 ldi r22, 0x33 ; 51 2fc2a: 66 2e mov r6, r22 2fc2c: 66 e1 ldi r22, 0x16 ; 22 2fc2e: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fc30: f1 2c mov r15, r1 2fc32: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fc34: 7b e3 ldi r23, 0x3B ; 59 2fc36: a7 2e mov r10, r23 2fc38: 75 e1 ldi r23, 0x15 ; 21 2fc3a: b7 2e mov r11, r23 nrFiles = 1; 2fc3c: 88 24 eor r8, r8 2fc3e: 83 94 inc r8 2fc40: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2fc42: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fc46: 80 fd sbrc r24, 0 2fc48: bd c0 rjmp .+378 ; 0x2fdc4 manage_heater(); 2fc4a: 0f 94 61 39 call 0x272c2 ; 0x272c2 if (i == 0) 2fc4e: e1 14 cp r14, r1 2fc50: f1 04 cpc r15, r1 2fc52: 09 f0 breq .+2 ; 0x2fc56 2fc54: d0 c0 rjmp .+416 ; 0x2fdf6 getfilename(0); 2fc56: 90 e0 ldi r25, 0x00 ; 0 2fc58: 80 e0 ldi r24, 0x00 ; 0 2fc5a: 0f 94 79 7a call 0x2f4f2 ; 0x2f4f2 else getfilename_next(position); sort_entries[i] = position >> 5; 2fc5e: 80 91 a3 14 lds r24, 0x14A3 ; 0x8014a3 2fc62: 90 91 a4 14 lds r25, 0x14A4 ; 0x8014a4 2fc66: a0 91 a5 14 lds r26, 0x14A5 ; 0x8014a5 2fc6a: b0 91 a6 14 lds r27, 0x14A6 ; 0x8014a6 2fc6e: 55 e0 ldi r21, 0x05 ; 5 2fc70: b6 95 lsr r27 2fc72: a7 95 ror r26 2fc74: 97 95 ror r25 2fc76: 87 95 ror r24 2fc78: 5a 95 dec r21 2fc7a: d1 f7 brne .-12 ; 0x2fc70 2fc7c: f3 01 movw r30, r6 2fc7e: 81 93 st Z+, r24 2fc80: 91 93 st Z+, r25 2fc82: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fc84: ff ef ldi r31, 0xFF ; 255 2fc86: ef 1a sub r14, r31 2fc88: ff 0a sbc r15, r31 2fc8a: ce 14 cp r12, r14 2fc8c: df 04 cpc r13, r15 2fc8e: c9 f6 brne .-78 ; 0x2fc42 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2fc90: 21 e0 ldi r18, 0x01 ; 1 2fc92: e2 16 cp r14, r18 2fc94: f1 04 cpc r15, r1 2fc96: 09 f4 brne .+2 ; 0x2fc9a 2fc98: 92 c0 rjmp .+292 ; 0x2fdbe 2fc9a: 32 e0 ldi r19, 0x02 ; 2 2fc9c: 33 16 cp r3, r19 2fc9e: 09 f4 brne .+2 ; 0x2fca2 2fca0: 8e c0 rjmp .+284 ; 0x2fdbe #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2fca2: 90 93 fc 16 sts 0x16FC, r25 ; 0x8016fc 2fca6: 80 93 fb 16 sts 0x16FB, r24 ; 0x8016fb #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)); 2fcaa: 8e ea ldi r24, 0xAE ; 174 2fcac: 9b e5 ldi r25, 0x5B ; 91 2fcae: 0e 94 2c 72 call 0xe458 ; 0xe458 2fcb2: ee 9c mul r14, r14 2fcb4: 90 01 movw r18, r0 2fcb6: ef 9c mul r14, r15 2fcb8: 30 0d add r19, r0 2fcba: 30 0d add r19, r0 2fcbc: 11 24 eor r1, r1 2fcbe: bc 01 movw r22, r24 2fcc0: c9 01 movw r24, r18 2fcc2: 96 95 lsr r25 2fcc4: 87 95 ror r24 2fcc6: 0f 94 30 d0 call 0x3a060 ; 0x3a060 2fcca: 35 e3 ldi r19, 0x35 ; 53 2fccc: a3 2e mov r10, r19 2fcce: 36 e1 ldi r19, 0x16 ; 22 2fcd0: 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; 2fcd2: 91 2c mov r9, r1 2fcd4: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2fcd6: cc 24 eor r12, r12 2fcd8: c3 94 inc r12 2fcda: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2fcdc: c4 01 movw r24, r8 2fcde: 0f 94 01 d0 call 0x3a002 ; 0x3a002 counter += i; 2fce2: 8c 0c add r8, r12 2fce4: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2fce6: f5 01 movw r30, r10 2fce8: 01 90 ld r0, Z+ 2fcea: f0 81 ld r31, Z 2fcec: e0 2d mov r30, r0 2fcee: f9 af std Y+57, r31 ; 0x39 2fcf0: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2fcf2: cf 01 movw r24, r30 2fcf4: 0f 94 c0 7a call 0x2f580 ; 0x2f580 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2fcf8: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2fcfc: 62 e9 ldi r22, 0x92 ; 146 2fcfe: 74 e1 ldi r23, 0x14 ; 20 2fd00: 88 23 and r24, r24 2fd02: 11 f0 breq .+4 ; 0x2fd08 2fd04: 67 ea ldi r22, 0xA7 ; 167 2fd06: 74 e1 ldi r23, 0x14 ; 20 2fd08: ce 01 movw r24, r28 2fd0a: 01 96 adiw r24, 0x01 ; 1 2fd0c: 0f 94 bf e2 call 0x3c57e ; 0x3c57e crmod_date_bckp = crmodDate; 2fd10: 60 90 a1 14 lds r6, 0x14A1 ; 0x8014a1 2fd14: 70 90 a2 14 lds r7, 0x14A2 ; 0x8014a2 crmod_time_bckp = crmodTime; 2fd18: 20 91 9f 14 lds r18, 0x149F ; 0x80149f 2fd1c: 30 91 a0 14 lds r19, 0x14A0 ; 0x8014a0 2fd20: 3b af std Y+59, r19 ; 0x3b 2fd22: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2fd24: 20 90 dc 14 lds r2, 0x14DC ; 0x8014dc 2fd28: bf aa std Y+55, r11 ; 0x37 2fd2a: ae aa std Y+54, r10 ; 0x36 2fd2c: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2fd2e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fd32: 80 fd sbrc r24, 0 2fd34: 47 c0 rjmp .+142 ; 0x2fdc4 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2fd36: 0f 94 61 39 call 0x272c2 ; 0x272c2 const uint16_t o2 = sort_entries[j - 1]; 2fd3a: c8 01 movw r24, r16 2fd3c: 01 97 sbiw r24, 0x01 ; 1 2fd3e: 9d af std Y+61, r25 ; 0x3d 2fd40: 8c af std Y+60, r24 ; 0x3c 2fd42: ee a9 ldd r30, Y+54 ; 0x36 2fd44: ff a9 ldd r31, Y+55 ; 0x37 2fd46: 52 90 ld r5, -Z 2fd48: 42 90 ld r4, -Z 2fd4a: ff ab std Y+55, r31 ; 0x37 2fd4c: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2fd4e: c2 01 movw r24, r4 2fd50: 0f 94 c0 7a call 0x2f580 ; 0x2f580 char *name2 = LONGEST_FILENAME; // use the string in-place 2fd54: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2fd58: 62 e9 ldi r22, 0x92 ; 146 2fd5a: 74 e1 ldi r23, 0x14 ; 20 2fd5c: 88 23 and r24, r24 2fd5e: 11 f0 breq .+4 ; 0x2fd64 2fd60: 67 ea ldi r22, 0xA7 ; 167 2fd62: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2fd64: 31 10 cpse r3, r1 2fd66: 8a c0 rjmp .+276 ; 0x2fe7c 2fd68: 80 91 dc 14 lds r24, 0x14DC ; 0x8014dc 2fd6c: 28 12 cpse r2, r24 2fd6e: 83 c0 rjmp .+262 ; 0x2fe76 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fd70: 80 91 a1 14 lds r24, 0x14A1 ; 0x8014a1 2fd74: 90 91 a2 14 lds r25, 0x14A2 ; 0x8014a2 2fd78: 68 16 cp r6, r24 2fd7a: 79 06 cpc r7, r25 2fd7c: 09 f0 breq .+2 ; 0x2fd80 2fd7e: 6c c0 rjmp .+216 ; 0x2fe58 2fd80: 80 91 9f 14 lds r24, 0x149F ; 0x80149f 2fd84: 90 91 a0 14 lds r25, 0x14A0 ; 0x8014a0 2fd88: 2a ad ldd r18, Y+58 ; 0x3a 2fd8a: 3b ad ldd r19, Y+59 ; 0x3b 2fd8c: 82 17 cp r24, r18 2fd8e: 93 07 cpc r25, r19 2fd90: 08 f0 brcs .+2 ; 0x2fd94 2fd92: 66 c0 rjmp .+204 ; 0x2fe60 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2fd94: 00 0f add r16, r16 2fd96: 11 1f adc r17, r17 2fd98: f8 01 movw r30, r16 2fd9a: ed 5c subi r30, 0xCD ; 205 2fd9c: f9 4e sbci r31, 0xE9 ; 233 2fd9e: 28 ad ldd r18, Y+56 ; 0x38 2fda0: 39 ad ldd r19, Y+57 ; 0x39 2fda2: 31 83 std Z+1, r19 ; 0x01 2fda4: 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){ 2fda6: 3f ef ldi r19, 0xFF ; 255 2fda8: c3 1a sub r12, r19 2fdaa: d3 0a sbc r13, r19 2fdac: 82 e0 ldi r24, 0x02 ; 2 2fdae: a8 0e add r10, r24 2fdb0: b1 1c adc r11, r1 2fdb2: ec 14 cp r14, r12 2fdb4: fd 04 cpc r15, r13 2fdb6: 09 f0 breq .+2 ; 0x2fdba 2fdb8: 91 cf rjmp .-222 ; 0x2fcdc for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2fdba: 0f 94 22 d0 call 0x3a044 ; 0x3a044 } } KEEPALIVE_STATE(NOT_BUSY); 2fdbe: 81 e0 ldi r24, 0x01 ; 1 2fdc0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } 2fdc4: ed 96 adiw r28, 0x3d ; 61 2fdc6: 0f b6 in r0, 0x3f ; 63 2fdc8: f8 94 cli 2fdca: de bf out 0x3e, r29 ; 62 2fdcc: 0f be out 0x3f, r0 ; 63 2fdce: cd bf out 0x3d, r28 ; 61 2fdd0: df 91 pop r29 2fdd2: cf 91 pop r28 2fdd4: 1f 91 pop r17 2fdd6: 0f 91 pop r16 2fdd8: ff 90 pop r15 2fdda: ef 90 pop r14 2fddc: df 90 pop r13 2fdde: cf 90 pop r12 2fde0: bf 90 pop r11 2fde2: af 90 pop r10 2fde4: 9f 90 pop r9 2fde6: 8f 90 pop r8 2fde8: 7f 90 pop r7 2fdea: 6f 90 pop r6 2fdec: 5f 90 pop r5 2fdee: 4f 90 pop r4 2fdf0: 3f 90 pop r3 2fdf2: 2f 90 pop r2 2fdf4: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2fdf6: 40 91 a3 14 lds r20, 0x14A3 ; 0x8014a3 2fdfa: 50 91 a4 14 lds r21, 0x14A4 ; 0x8014a4 2fdfe: 60 91 a5 14 lds r22, 0x14A5 ; 0x8014a5 2fe02: 70 91 a6 14 lds r23, 0x14A6 ; 0x8014a6 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fe06: b0 92 3a 15 sts 0x153A, r11 ; 0x80153a 2fe0a: a0 92 39 15 sts 0x1539, r10 ; 0x801539 nrFiles = 1; 2fe0e: 90 92 a9 17 sts 0x17A9, r9 ; 0x8017a9 2fe12: 80 92 a8 17 sts 0x17A8, r8 ; 0x8017a8 curDir->seekSet(position); 2fe16: 8b e3 ldi r24, 0x3B ; 59 2fe18: 95 e1 ldi r25, 0x15 ; 21 2fe1a: 0f 94 cd 57 call 0x2af9a ; 0x2af9a 2fe1e: 1e 7f andi r17, 0xFE ; 254 2fe20: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2fe22: e0 91 39 15 lds r30, 0x1539 ; 0x801539 2fe26: f0 91 3a 15 lds r31, 0x153A ; 0x80153a 2fe2a: 83 e2 ldi r24, 0x23 ; 35 2fe2c: de 01 movw r26, r28 2fe2e: 11 96 adiw r26, 0x01 ; 1 2fe30: 01 90 ld r0, Z+ 2fe32: 0d 92 st X+, r0 2fe34: 8a 95 dec r24 2fe36: e1 f7 brne .-8 ; 0x2fe30 2fe38: 01 2f mov r16, r17 2fe3a: 22 e0 ldi r18, 0x02 ; 2 2fe3c: 50 e0 ldi r21, 0x00 ; 0 2fe3e: 40 e0 ldi r20, 0x00 ; 0 2fe40: be 01 movw r22, r28 2fe42: 6f 5f subi r22, 0xFF ; 255 2fe44: 7f 4f sbci r23, 0xFF ; 255 2fe46: 88 ef ldi r24, 0xF8 ; 248 2fe48: 92 e0 ldi r25, 0x02 ; 2 2fe4a: 0f 94 4a 78 call 0x2f094 ; 0x2f094 2fe4e: ce 01 movw r24, r28 2fe50: 01 96 adiw r24, 0x01 ; 1 2fe52: 0e 94 b1 76 call 0xed62 ; 0xed62 2fe56: 03 cf rjmp .-506 ; 0x2fc5e 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)) 2fe58: 86 15 cp r24, r6 2fe5a: 97 05 cpc r25, r7 2fe5c: 08 f4 brcc .+2 ; 0x2fe60 2fe5e: 9a cf rjmp .-204 ; 0x2fd94 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fe60: ee a9 ldd r30, Y+54 ; 0x36 2fe62: ff a9 ldd r31, Y+55 ; 0x37 2fe64: 53 82 std Z+3, r5 ; 0x03 2fe66: 42 82 std Z+2, r4 ; 0x02 2fe68: 0c ad ldd r16, Y+60 ; 0x3c 2fe6a: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2fe6c: 01 15 cp r16, r1 2fe6e: 11 05 cpc r17, r1 2fe70: 09 f0 breq .+2 ; 0x2fe74 2fe72: 5d cf rjmp .-326 ; 0x2fd2e 2fe74: 8f cf rjmp .-226 ; 0x2fd94 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)) 2fe76: 22 20 and r2, r2 2fe78: 99 f3 breq .-26 ; 0x2fe60 2fe7a: 8c cf rjmp .-232 ; 0x2fd94 2fe7c: 31 e0 ldi r19, 0x01 ; 1 2fe7e: 33 12 cpse r3, r19 2fe80: ef cf rjmp .-34 ; 0x2fe60 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fe82: 80 91 dc 14 lds r24, 0x14DC ; 0x8014dc 2fe86: 28 12 cpse r2, r24 2fe88: 07 c0 rjmp .+14 ; 0x2fe98 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fe8a: ce 01 movw r24, r28 2fe8c: 01 96 adiw r24, 0x01 ; 1 2fe8e: 0f 94 8d e2 call 0x3c51a ; 0x3c51a 2fe92: 97 fd sbrc r25, 7 2fe94: e5 cf rjmp .-54 ; 0x2fe60 2fe96: 7e cf rjmp .-260 ; 0x2fd94 2fe98: 21 10 cpse r2, r1 2fe9a: e2 cf rjmp .-60 ; 0x2fe60 2fe9c: 7b cf rjmp .-266 ; 0x2fd94 0002fe9e : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fe9e: cf 92 push r12 2fea0: df 92 push r13 2fea2: ef 92 push r14 2fea4: ff 92 push r15 2fea6: 0f 93 push r16 2fea8: 1f 93 push r17 2feaa: cf 93 push r28 2feac: df 93 push r29 2feae: cd b7 in r28, 0x3d ; 61 2feb0: de b7 in r29, 0x3e ; 62 2feb2: a3 97 sbiw r28, 0x23 ; 35 2feb4: 0f b6 in r0, 0x3f ; 63 2feb6: f8 94 cli 2feb8: de bf out 0x3e, r29 ; 62 2feba: 0f be out 0x3f, r0 ; 63 2febc: cd bf out 0x3d, r28 ; 61 2febe: 7c 01 movw r14, r24 2fec0: 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) {} 2fec2: 19 82 std Y+1, r1 ; 0x01 2fec4: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fec6: 80 91 3e 15 lds r24, 0x153E ; 0x80153e parent=&workDir; 2feca: 9b e3 ldi r25, 0x3B ; 59 2fecc: c9 2e mov r12, r25 2fece: 95 e1 ldi r25, 0x15 ; 21 2fed0: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fed2: 81 11 cpse r24, r1 2fed4: 04 c0 rjmp .+8 ; 0x2fede } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fed6: 86 e1 ldi r24, 0x16 ; 22 2fed8: c8 2e mov r12, r24 2feda: 85 e1 ldi r24, 0x15 ; 21 2fedc: 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); 2fede: 21 e0 ldi r18, 0x01 ; 1 2fee0: a7 01 movw r20, r14 2fee2: b6 01 movw r22, r12 2fee4: ce 01 movw r24, r28 2fee6: 01 96 adiw r24, 0x01 ; 1 2fee8: 0f 94 53 65 call 0x2caa6 ; 0x2caa6 2feec: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2feee: 88 23 and r24, r24 2fef0: 21 f1 breq .+72 ; 0x2ff3a 2fef2: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2fef6: 85 30 cpi r24, 0x05 ; 5 2fef8: 00 f5 brcc .+64 ; 0x2ff3a SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fefa: 29 e0 ldi r18, 0x09 ; 9 2fefc: 82 9f mul r24, r18 2fefe: c0 01 movw r24, r0 2ff00: 11 24 eor r1, r1 2ff02: b7 01 movw r22, r14 2ff04: 80 52 subi r24, 0x20 ; 32 2ff06: 9b 4e sbci r25, 0xEB ; 235 2ff08: 0f 94 bf e2 call 0x3c57e ; 0x3c57e puts(relpath); 2ff0c: c7 01 movw r24, r14 2ff0e: 0f 94 e3 e2 call 0x3c5c6 ; 0x3c5c6 if (workDirDepth < MAX_DIR_DEPTH) { 2ff12: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2ff16: 86 30 cpi r24, 0x06 ; 6 2ff18: 80 f1 brcs .+96 ; 0x2ff7a for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2ff1a: 83 e2 ldi r24, 0x23 ; 35 2ff1c: fe 01 movw r30, r28 2ff1e: 31 96 adiw r30, 0x01 ; 1 2ff20: ab e3 ldi r26, 0x3B ; 59 2ff22: b5 e1 ldi r27, 0x15 ; 21 2ff24: 01 90 ld r0, Z+ 2ff26: 0d 92 st X+, r0 2ff28: 8a 95 dec r24 2ff2a: e1 f7 brne .-8 ; 0x2ff24 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2ff2c: 00 23 and r16, r16 2ff2e: 09 f4 brne .+2 ; 0x2ff32 2ff30: 4c c0 rjmp .+152 ; 0x2ffca presort(); 2ff32: 0f 94 cd 7d call 0x2fb9a ; 0x2fb9a else presort_flag = true; #endif return 1; 2ff36: 10 2f mov r17, r16 2ff38: 0c c0 rjmp .+24 ; 0x2ff52 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2ff3a: 82 ec ldi r24, 0xC2 ; 194 2ff3c: 9a ea ldi r25, 0xAA ; 170 2ff3e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2ff42: 81 e3 ldi r24, 0x31 ; 49 2ff44: 90 e7 ldi r25, 0x70 ; 112 2ff46: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(relpath); 2ff4a: c7 01 movw r24, r14 2ff4c: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 return 0; 2ff50: 10 e0 ldi r17, 0x00 ; 0 2ff52: ce 01 movw r24, r28 2ff54: 01 96 adiw r24, 0x01 ; 1 2ff56: 0e 94 b1 76 call 0xed62 ; 0xed62 else presort_flag = true; #endif return 1; } } 2ff5a: 81 2f mov r24, r17 2ff5c: a3 96 adiw r28, 0x23 ; 35 2ff5e: 0f b6 in r0, 0x3f ; 63 2ff60: f8 94 cli 2ff62: de bf out 0x3e, r29 ; 62 2ff64: 0f be out 0x3f, r0 ; 63 2ff66: cd bf out 0x3d, r28 ; 61 2ff68: df 91 pop r29 2ff6a: cf 91 pop r28 2ff6c: 1f 91 pop r17 2ff6e: 0f 91 pop r16 2ff70: ff 90 pop r15 2ff72: ef 90 pop r14 2ff74: df 90 pop r13 2ff76: cf 90 pop r12 2ff78: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2ff7a: 8f 5f subi r24, 0xFF ; 255 2ff7c: 80 93 30 16 sts 0x1630, r24 ; 0x801630 workDirParents[d+1] = workDirParents[d]; 2ff80: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2ff82: 81 50 subi r24, 0x01 ; 1 2ff84: c8 f0 brcs .+50 ; 0x2ffb8 workDirParents[d+1] = workDirParents[d]; 2ff86: 28 2f mov r18, r24 2ff88: 30 e0 ldi r19, 0x00 ; 0 2ff8a: a9 01 movw r20, r18 2ff8c: 4f 5f subi r20, 0xFF ; 255 2ff8e: 5f 4f sbci r21, 0xFF ; 255 2ff90: 94 9f mul r25, r20 2ff92: d0 01 movw r26, r0 2ff94: 95 9f mul r25, r21 2ff96: b0 0d add r27, r0 2ff98: 11 24 eor r1, r1 2ff9a: a2 5a subi r26, 0xA2 ; 162 2ff9c: ba 4e sbci r27, 0xEA ; 234 2ff9e: 92 9f mul r25, r18 2ffa0: f0 01 movw r30, r0 2ffa2: 93 9f mul r25, r19 2ffa4: f0 0d add r31, r0 2ffa6: 11 24 eor r1, r1 2ffa8: e2 5a subi r30, 0xA2 ; 162 2ffaa: fa 4e sbci r31, 0xEA ; 234 2ffac: 29 2f mov r18, r25 2ffae: 01 90 ld r0, Z+ 2ffb0: 0d 92 st X+, r0 2ffb2: 2a 95 dec r18 2ffb4: e1 f7 brne .-8 ; 0x2ffae 2ffb6: e5 cf rjmp .-54 ; 0x2ff82 workDirParents[0]=*parent; 2ffb8: 83 e2 ldi r24, 0x23 ; 35 2ffba: f6 01 movw r30, r12 2ffbc: ae e5 ldi r26, 0x5E ; 94 2ffbe: b5 e1 ldi r27, 0x15 ; 21 2ffc0: 01 90 ld r0, Z+ 2ffc2: 0d 92 st X+, r0 2ffc4: 8a 95 dec r24 2ffc6: e1 f7 brne .-8 ; 0x2ffc0 2ffc8: a8 cf rjmp .-176 ; 0x2ff1a #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2ffca: 81 e0 ldi r24, 0x01 ; 1 2ffcc: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df 2ffd0: c0 cf rjmp .-128 ; 0x2ff52 0002ffd2 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2ffd2: 93 e2 ldi r25, 0x23 ; 35 2ffd4: e6 e1 ldi r30, 0x16 ; 22 2ffd6: f5 e1 ldi r31, 0x15 ; 21 2ffd8: ab e3 ldi r26, 0x3B ; 59 2ffda: b5 e1 ldi r27, 0x15 ; 21 2ffdc: 01 90 ld r0, Z+ 2ffde: 0d 92 st X+, r0 2ffe0: 9a 95 dec r25 2ffe2: e1 f7 brne .-8 ; 0x2ffdc workDirDepth = 0; 2ffe4: 10 92 30 16 sts 0x1630, r1 ; 0x801630 curDir=&workDir; 2ffe8: 2b e3 ldi r18, 0x3B ; 59 2ffea: 35 e1 ldi r19, 0x15 ; 21 2ffec: 30 93 3a 15 sts 0x153A, r19 ; 0x80153a 2fff0: 20 93 39 15 sts 0x1539, r18 ; 0x801539 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fff4: 81 11 cpse r24, r1 presort(); 2fff6: 0d 94 cd 7d jmp 0x2fb9a ; 0x2fb9a else presort_flag = true; 2fffa: 81 e0 ldi r24, 0x01 ; 1 2fffc: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df #endif } 30000: 08 95 ret 00030002 : * * @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) 30002: 8f 92 push r8 30004: 9f 92 push r9 30006: af 92 push r10 30008: bf 92 push r11 3000a: cf 92 push r12 3000c: df 92 push r13 3000e: ef 92 push r14 30010: ff 92 push r15 30012: 0f 93 push r16 30014: 1f 93 push r17 30016: cf 93 push r28 30018: df 93 push r29 3001a: cd b7 in r28, 0x3d ; 61 3001c: de b7 in r29, 0x3e ; 62 3001e: 2d 97 sbiw r28, 0x0d ; 13 30020: 0f b6 in r0, 0x3f ; 63 30022: f8 94 cli 30024: de bf out 0x3e, r29 ; 62 30026: 0f be out 0x3f, r0 ; 63 30028: cd bf out 0x3d, r28 ; 61 { curDir=&root; 3002a: 26 e1 ldi r18, 0x16 ; 22 3002c: 35 e1 ldi r19, 0x15 ; 21 3002e: 30 93 3a 15 sts 0x153A, r19 ; 0x80153a 30032: 20 93 39 15 sts 0x1539, r18 ; 0x801539 if (!fileName) 30036: dc 01 movw r26, r24 30038: ed 91 ld r30, X+ 3003a: fc 91 ld r31, X 3003c: 30 97 sbiw r30, 0x00 ; 0 3003e: a1 f4 brne .+40 ; 0x30068 } else //relative path { curDir = &workDir; } return 1; 30040: 81 e0 ldi r24, 0x01 ; 1 } 30042: 2d 96 adiw r28, 0x0d ; 13 30044: 0f b6 in r0, 0x3f ; 63 30046: f8 94 cli 30048: de bf out 0x3e, r29 ; 62 3004a: 0f be out 0x3f, r0 ; 63 3004c: cd bf out 0x3d, r28 ; 61 3004e: df 91 pop r29 30050: cf 91 pop r28 30052: 1f 91 pop r17 30054: 0f 91 pop r16 30056: ff 90 pop r15 30058: ef 90 pop r14 3005a: df 90 pop r13 3005c: cf 90 pop r12 3005e: bf 90 pop r11 30060: af 90 pop r10 30062: 9f 90 pop r9 30064: 8f 90 pop r8 30066: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 30068: 20 81 ld r18, Z 3006a: 2f 32 cpi r18, 0x2F ; 47 3006c: 09 f0 breq .+2 ; 0x30070 3006e: 47 c0 rjmp .+142 ; 0x300fe 30070: 6c 01 movw r12, r24 { cdroot(false); 30072: 80 e0 ldi r24, 0x00 ; 0 30074: 0f 94 e9 7f call 0x2ffd2 ; 0x2ffd2 dirname_start = fileName + 1; 30078: f6 01 movw r30, r12 3007a: 00 81 ld r16, Z 3007c: 11 81 ldd r17, Z+1 ; 0x01 3007e: 0f 5f subi r16, 0xFF ; 255 30080: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 30082: 9b e3 ldi r25, 0x3B ; 59 30084: 89 2e mov r8, r25 30086: 95 e1 ldi r25, 0x15 ; 21 30088: 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) 3008a: d8 01 movw r26, r16 3008c: 8c 91 ld r24, X 3008e: 88 23 and r24, r24 30090: b9 f2 breq .-82 ; 0x30040 { dirname_end = strchr(dirname_start, '/'); 30092: 6f e2 ldi r22, 0x2F ; 47 30094: 70 e0 ldi r23, 0x00 ; 0 30096: c8 01 movw r24, r16 30098: 0f 94 ab e2 call 0x3c556 ; 0x3c556 3009c: 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) 3009e: 00 97 sbiw r24, 0x00 ; 0 300a0: 51 f1 breq .+84 ; 0x300f6 300a2: 08 17 cp r16, r24 300a4: 19 07 cpc r17, r25 300a6: 38 f5 brcc .+78 ; 0x300f6 { 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); 300a8: 7c 01 movw r14, r24 300aa: e0 1a sub r14, r16 300ac: f1 0a sbc r15, r17 300ae: bd e0 ldi r27, 0x0D ; 13 300b0: eb 16 cp r14, r27 300b2: f1 04 cpc r15, r1 300b4: 18 f0 brcs .+6 ; 0x300bc 300b6: 8c e0 ldi r24, 0x0C ; 12 300b8: e8 2e mov r14, r24 300ba: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 300bc: a7 01 movw r20, r14 300be: b8 01 movw r22, r16 300c0: ce 01 movw r24, r28 300c2: 01 96 adiw r24, 0x01 ; 1 300c4: 0f 94 d4 e2 call 0x3c5a8 ; 0x3c5a8 subdirname[len] = 0; 300c8: e1 e0 ldi r30, 0x01 ; 1 300ca: f0 e0 ldi r31, 0x00 ; 0 300cc: ec 0f add r30, r28 300ce: fd 1f adc r31, r29 300d0: ee 0d add r30, r14 300d2: ff 1d adc r31, r15 300d4: 10 82 st Z, r1 if (!chdir(subdirname, false)) 300d6: 60 e0 ldi r22, 0x00 ; 0 300d8: ce 01 movw r24, r28 300da: 01 96 adiw r24, 0x01 ; 1 300dc: 0f 94 4f 7f call 0x2fe9e ; 0x2fe9e 300e0: 88 23 and r24, r24 300e2: 09 f4 brne .+2 ; 0x300e6 300e4: ae cf rjmp .-164 ; 0x30042 return 0; curDir = &workDir; 300e6: 90 92 3a 15 sts 0x153A, r9 ; 0x80153a 300ea: 80 92 39 15 sts 0x1539, r8 ; 0x801539 dirname_start = dirname_end + 1; 300ee: 85 01 movw r16, r10 300f0: 0f 5f subi r16, 0xFF ; 255 300f2: 1f 4f sbci r17, 0xFF ; 255 300f4: ca cf rjmp .-108 ; 0x3008a } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 300f6: f6 01 movw r30, r12 300f8: 11 83 std Z+1, r17 ; 0x01 300fa: 00 83 st Z, r16 300fc: a1 cf rjmp .-190 ; 0x30040 } } else //relative path { curDir = &workDir; 300fe: 8b e3 ldi r24, 0x3B ; 59 30100: 95 e1 ldi r25, 0x15 ; 21 30102: 90 93 3a 15 sts 0x153A, r25 ; 0x80153a 30106: 80 93 39 15 sts 0x1539, r24 ; 0x801539 3010a: 9a cf rjmp .-204 ; 0x30040 0003010c : 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*/){ 3010c: bf 92 push r11 3010e: cf 92 push r12 30110: df 92 push r13 30112: ef 92 push r14 30114: ff 92 push r15 30116: 0f 93 push r16 30118: 1f 93 push r17 3011a: cf 93 push r28 3011c: df 93 push r29 3011e: 1f 92 push r1 30120: 1f 92 push r1 30122: cd b7 in r28, 0x3d ; 61 30124: de b7 in r29, 0x3e ; 62 if(!mounted) 30126: 20 91 91 14 lds r18, 0x1491 ; 0x801491 3012a: 22 23 and r18, r18 3012c: 09 f4 brne .+2 ; 0x30130 3012e: ef c0 rjmp .+478 ; 0x3030e 30130: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30132: 80 91 23 17 lds r24, 0x1723 ; 0x801723 30136: 88 23 and r24, r24 30138: 09 f4 brne .+2 ; 0x3013c 3013a: 04 c1 rjmp .+520 ; 0x30344 if(!replace_current){ 3013c: 61 11 cpse r22, r1 3013e: f6 c0 rjmp .+492 ; 0x3032c if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 30140: d0 90 43 17 lds r13, 0x1743 ; 0x801743 30144: dd 20 and r13, r13 30146: 21 f0 breq .+8 ; 0x30150 // 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); 30148: 8c e9 ldi r24, 0x9C ; 156 3014a: 99 ea ldi r25, 0xA9 ; 169 3014c: 0e 94 8a 79 call 0xf314 ; 0xf314 return; } SERIAL_ECHO_START; 30150: 82 ec ldi r24, 0xC2 ; 194 30152: 9a ea ldi r25, 0xAA ; 170 30154: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(ofSubroutineCallTgt); 30158: 83 e8 ldi r24, 0x83 ; 131 3015a: 99 ea ldi r25, 0xA9 ; 169 3015c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 30160: c7 01 movw r24, r14 30162: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 30166: 88 e7 ldi r24, 0x78 ; 120 30168: 99 ea ldi r25, 0xA9 ; 169 3016a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 3016e: 00 91 43 17 lds r16, 0x1743 ; 0x801743 30172: 25 e5 ldi r18, 0x55 ; 85 30174: 02 9f mul r16, r18 30176: 80 01 movw r16, r0 30178: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 3017a: 08 5b subi r16, 0xB8 ; 184 3017c: 18 4e sbci r17, 0xE8 ; 232 3017e: 8f e2 ldi r24, 0x2F ; 47 30180: f8 01 movw r30, r16 30182: 81 93 st Z+, r24 30184: 8f 01 movw r16, r30 30186: cc 24 eor r12, r12 30188: c3 94 inc r12 for(uint8_t i=0;i 30192: d8 16 cp r13, r24 30194: b0 f4 brcc .+44 ; 0x301c2 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 30196: db 9c mul r13, r11 30198: c0 01 movw r24, r0 3019a: 11 24 eor r1, r1 3019c: b8 01 movw r22, r16 3019e: 82 5a subi r24, 0xA2 ; 162 301a0: 9a 4e sbci r25, 0xEA ; 234 301a2: 0f 94 b4 59 call 0x2b368 ; 0x2b368 301a6: c8 01 movw r24, r16 301a8: 8c 01 movw r16, r24 301aa: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 301ac: f8 01 movw r30, r16 301ae: 20 81 ld r18, Z 301b0: 22 23 and r18, r18 301b2: 29 f0 breq .+10 ; 0x301be 301b4: f4 e5 ldi r31, 0x54 ; 84 301b6: fc 15 cp r31, r12 301b8: 10 f0 brcs .+4 ; 0x301be {t++;cnt++;} //crawl counter forward. 301ba: c3 94 inc r12 301bc: f5 cf rjmp .-22 ; 0x301a8 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) 301c2: 27 e4 ldi r18, 0x47 ; 71 301c4: 2c 15 cp r18, r12 301c6: 08 f4 brcc .+2 ; 0x301ca 301c8: ae c0 rjmp .+348 ; 0x30326 file.getFilename(t); 301ca: b8 01 movw r22, r16 301cc: 80 e2 ldi r24, 0x20 ; 32 301ce: 97 e1 ldi r25, 0x17 ; 23 301d0: 0f 94 b4 59 call 0x2b368 ; 0x2b368 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 301d4: 80 91 43 17 lds r24, 0x1743 ; 0x801743 301d8: f5 e5 ldi r31, 0x55 ; 85 301da: 8f 9f mul r24, r31 301dc: c0 01 movw r24, r0 301de: 11 24 eor r1, r1 301e0: 88 5b subi r24, 0xB8 ; 184 301e2: 98 4e sbci r25, 0xE8 ; 232 301e4: 0e 94 94 87 call 0x10f28 ; 0x10f28 SERIAL_ECHORPGM(ofPos); 301e8: 82 e7 ldi r24, 0x72 ; 114 301ea: 99 ea ldi r25, 0xA9 ; 169 301ec: 0e 94 d0 76 call 0xeda0 ; 0xeda0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 301f0: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 301f4: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 301f8: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 301fc: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 30200: 4a e0 ldi r20, 0x0A ; 10 30202: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 30206: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 3020a: 80 91 43 17 lds r24, 0x1743 ; 0x801743 3020e: 24 e0 ldi r18, 0x04 ; 4 30210: 82 9f mul r24, r18 30212: f0 01 movw r30, r0 30214: 11 24 eor r1, r1 30216: ec 5b subi r30, 0xBC ; 188 30218: f8 4e sbci r31, 0xE8 ; 232 3021a: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 3021e: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 30222: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 30226: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 3022a: 40 83 st Z, r20 3022c: 51 83 std Z+1, r21 ; 0x01 3022e: 62 83 std Z+2, r22 ; 0x02 30230: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 30232: 8f 5f subi r24, 0xFF ; 255 30234: 80 93 43 17 sts 0x1743, r24 ; 0x801743 } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 30238: 80 e2 ldi r24, 0x20 ; 32 3023a: 97 e1 ldi r25, 0x17 ; 23 3023c: 0f 94 ab 59 call 0x2b356 ; 0x2b356 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; 30240: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 30244: fa 82 std Y+2, r15 ; 0x02 30246: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 30248: ce 01 movw r24, r28 3024a: 01 96 adiw r24, 0x01 ; 1 3024c: 0f 94 01 80 call 0x30002 ; 0x30002 30250: 88 23 and r24, r24 30252: 09 f4 brne .+2 ; 0x30256 30254: 5c c0 rjmp .+184 ; 0x3030e */ 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) ){ 30256: 49 81 ldd r20, Y+1 ; 0x01 30258: 5a 81 ldd r21, Y+2 ; 0x02 3025a: 60 91 39 15 lds r22, 0x1539 ; 0x801539 3025e: 70 91 3a 15 lds r23, 0x153A ; 0x80153a 30262: 21 e0 ldi r18, 0x01 ; 1 30264: 80 e2 ldi r24, 0x20 ; 32 30266: 97 e1 ldi r25, 0x17 ; 23 30268: 0f 94 53 65 call 0x2caa6 ; 0x2caa6 3026c: 88 23 and r24, r24 3026e: 09 f4 brne .+2 ; 0x30272 30270: 77 c0 rjmp .+238 ; 0x30360 // compute the block to start with if( ! gfComputeNextFileBlock() ) 30272: 80 e2 ldi r24, 0x20 ; 32 30274: 97 e1 ldi r25, 0x17 ; 23 30276: 0f 94 54 57 call 0x2aea8 ; 0x2aea8 3027a: 88 23 and r24, r24 3027c: 09 f4 brne .+2 ; 0x30280 3027e: 70 c0 rjmp .+224 ; 0x30360 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; 30280: 80 91 41 17 lds r24, 0x1741 ; 0x801741 30284: 90 91 42 17 lds r25, 0x1742 ; 0x801742 30288: 83 56 subi r24, 0x63 ; 99 3028a: 91 4f sbci r25, 0xF1 ; 241 3028c: 90 93 3c 17 sts 0x173C, r25 ; 0x80173c 30290: 80 93 3b 17 sts 0x173B, r24 ; 0x80173b return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 30294: 89 81 ldd r24, Y+1 ; 0x01 30296: 9a 81 ldd r25, Y+2 ; 0x02 30298: 0f 94 79 7a call 0x2f4f2 ; 0x2f4f2 filesize = file.fileSize(); 3029c: 80 91 31 17 lds r24, 0x1731 ; 0x801731 302a0: 90 91 32 17 lds r25, 0x1732 ; 0x801732 302a4: a0 91 33 17 lds r26, 0x1733 ; 0x801733 302a8: b0 91 34 17 lds r27, 0x1734 ; 0x801734 302ac: 80 93 9d 17 sts 0x179D, r24 ; 0x80179d 302b0: 90 93 9e 17 sts 0x179E, r25 ; 0x80179e 302b4: a0 93 9f 17 sts 0x179F, r26 ; 0x80179f 302b8: b0 93 a0 17 sts 0x17A0, r27 ; 0x8017a0 SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 302bc: 82 e4 ldi r24, 0x42 ; 66 302be: 99 ea ldi r25, 0xA9 ; 169 302c0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 printAbsFilenameFast(); 302c4: 0f 94 5c 7b call 0x2f6b8 ; 0x2f6b8 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 302c8: 8a e3 ldi r24, 0x3A ; 58 302ca: 99 ea ldi r25, 0xA9 ; 169 302cc: 0e 94 d0 76 call 0xeda0 ; 0xeda0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 302d0: 60 91 9d 17 lds r22, 0x179D ; 0x80179d 302d4: 70 91 9e 17 lds r23, 0x179E ; 0x80179e 302d8: 80 91 9f 17 lds r24, 0x179F ; 0x80179f 302dc: 90 91 a0 17 lds r25, 0x17A0 ; 0x8017a0 302e0: 4a e0 ldi r20, 0x0A ; 10 302e2: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 302e6: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a SERIAL_PROTOCOLLN(filesize); sdpos = 0; 302ea: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 302ee: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 302f2: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 302f6: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 302fa: 8c e2 ldi r24, 0x2C ; 44 302fc: 99 ea ldi r25, 0xA9 ; 169 302fe: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 lcd_setstatuspgm(ofFileSelected); 30302: 8c e2 ldi r24, 0x2C ; 44 30304: 99 ea ldi r25, 0xA9 ; 169 30306: 0e 94 3b f2 call 0x1e476 ; 0x1e476 scrollstuff = 0; 3030a: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 3030e: 0f 90 pop r0 30310: 0f 90 pop r0 30312: df 91 pop r29 30314: cf 91 pop r28 30316: 1f 91 pop r17 30318: 0f 91 pop r16 3031a: ff 90 pop r15 3031c: ef 90 pop r14 3031e: df 90 pop r13 30320: cf 90 pop r12 30322: bf 90 pop r11 30324: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 30326: f8 01 movw r30, r16 30328: 10 82 st Z, r1 3032a: 54 cf rjmp .-344 ; 0x301d4 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 3032c: 82 ec ldi r24, 0xC2 ; 194 3032e: 9a ea ldi r25, 0xAA ; 170 30330: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(ofNowDoingFile); 30334: 81 e6 ldi r24, 0x61 ; 97 30336: 99 ea ldi r25, 0xA9 ; 169 30338: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(name); 3033c: c7 01 movw r24, r14 3033e: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 30342: 7a cf rjmp .-268 ; 0x30238 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 30344: 10 92 43 17 sts 0x1743, r1 ; 0x801743 SERIAL_ECHO_START; 30348: 82 ec ldi r24, 0xC2 ; 194 3034a: 9a ea ldi r25, 0xAA ; 170 3034c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(ofNowFreshFile); 30350: 80 e5 ldi r24, 0x50 ; 80 30352: 99 ea ldi r25, 0xA9 ; 169 30354: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(name); 30358: c7 01 movw r24, r14 3035a: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 3035e: 70 cf rjmp .-288 ; 0x30240 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30360: 8d e1 ldi r24, 0x1D ; 29 30362: 90 e7 ldi r25, 0x70 ; 112 30364: 0e 94 d0 76 call 0xeda0 ; 0xeda0 30368: 89 81 ldd r24, Y+1 ; 0x01 3036a: 9a 81 ldd r25, Y+2 ; 0x02 3036c: 0e 94 94 87 call 0x10f28 ; 0x10f28 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 30370: 8e e2 ldi r24, 0x2E ; 46 30372: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30376: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a 3037a: c9 cf rjmp .-110 ; 0x3030e 0003037c : void CardReader::printingHasFinished() { st_synchronize(); 3037c: 0f 94 ed 43 call 0x287da ; 0x287da file.close(); 30380: 80 e2 ldi r24, 0x20 ; 32 30382: 97 e1 ldi r25, 0x17 ; 23 30384: 0f 94 ab 59 call 0x2b356 ; 0x2b356 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 30388: 80 91 43 17 lds r24, 0x1743 ; 0x801743 3038c: 88 23 and r24, r24 3038e: 69 f1 breq .+90 ; 0x303ea { file_subcall_ctr--; 30390: 81 50 subi r24, 0x01 ; 1 30392: 80 93 43 17 sts 0x1743, r24 ; 0x801743 openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 30396: 25 e5 ldi r18, 0x55 ; 85 30398: 82 9f mul r24, r18 3039a: c0 01 movw r24, r0 3039c: 11 24 eor r1, r1 3039e: 61 e0 ldi r22, 0x01 ; 1 303a0: 88 5b subi r24, 0xB8 ; 184 303a2: 98 4e sbci r25, 0xE8 ; 232 303a4: 0f 94 86 80 call 0x3010c ; 0x3010c setIndex(filespos[file_subcall_ctr]); 303a8: e0 91 43 17 lds r30, 0x1743 ; 0x801743 303ac: 84 e0 ldi r24, 0x04 ; 4 303ae: e8 9f mul r30, r24 303b0: f0 01 movw r30, r0 303b2: 11 24 eor r1, r1 303b4: ec 5b subi r30, 0xBC ; 188 303b6: f8 4e sbci r31, 0xE8 ; 232 303b8: 60 81 ld r22, Z 303ba: 71 81 ldd r23, Z+1 ; 0x01 303bc: 82 81 ldd r24, Z+2 ; 0x02 303be: 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);}; 303c0: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 303c4: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 303c8: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 303cc: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 303d0: 0f 94 d7 76 call 0x2edae ; 0x2edae SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 303d4: 80 91 91 14 lds r24, 0x1491 ; 0x801491 303d8: 88 23 and r24, r24 303da: 71 f0 breq .+28 ; 0x303f8 { sdprinting = true; 303dc: 81 e0 ldi r24, 0x01 ; 1 303de: 80 93 90 14 sts 0x1490, r24 ; 0x801490 303e2: 85 e0 ldi r24, 0x05 ; 5 303e4: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> 303e8: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 303ea: 10 92 90 14 sts 0x1490, r1 ; 0x801490 303ee: 83 e0 ldi r24, 0x03 ; 3 303f0: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.403> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 303f4: 0c 94 e8 81 jmp 0x103d0 ; 0x103d0 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 303f8: 08 95 ret 000303fa : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 303fa: cf 92 push r12 303fc: df 92 push r13 303fe: ef 92 push r14 30400: ff 92 push r15 30402: 0f 93 push r16 30404: 1f 93 push r17 30406: cf 93 push r28 30408: df 93 push r29 3040a: 08 2f mov r16, r24 { mounted = false; 3040c: 10 92 91 14 sts 0x1491, r1 ; 0x801491 if(root.isOpen()) 30410: 80 91 19 15 lds r24, 0x1519 ; 0x801519 30414: 88 23 and r24, r24 30416: 21 f0 breq .+8 ; 0x30420 root.close(); 30418: 86 e1 ldi r24, 0x16 ; 22 3041a: 95 e1 ldi r25, 0x15 ; 21 3041c: 0f 94 ab 59 call 0x2b356 ; 0x2b356 * \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; 30420: 10 92 00 17 sts 0x1700, r1 ; 0x801700 30424: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 30428: 0f 94 51 2a call 0x254a2 ; 0x254a2 3042c: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 3042e: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 SET_OUTPUT(SDSS); 30432: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 30436: 80 64 ori r24, 0x40 ; 64 30438: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 3043c: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 3043e: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 30440: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 30442: 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); 30444: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 30446: 85 e0 ldi r24, 0x05 ; 5 30448: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe * 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); 3044c: 82 e5 ldi r24, 0x52 ; 82 3044e: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 30450: 1d bc out 0x2d, r1 ; 45 30452: 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); 30454: 8f ef ldi r24, 0xFF ; 255 30456: 0f 94 80 53 call 0x2a700 ; 0x2a700 3045a: 11 50 subi r17, 0x01 ; 1 3045c: d9 f7 brne .-10 ; 0x30454 WRITE(MISO, 1); // temporarily enable the MISO line pullup 3045e: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 30460: 20 e0 ldi r18, 0x00 ; 0 30462: 30 e0 ldi r19, 0x00 ; 0 30464: a9 01 movw r20, r18 30466: 60 e0 ldi r22, 0x00 ; 0 30468: 8d ef ldi r24, 0xFD ; 253 3046a: 96 e1 ldi r25, 0x16 ; 22 3046c: 0f 94 8c 53 call 0x2a718 ; 0x2a718 30470: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 30474: 81 30 cpi r24, 0x01 ; 1 30476: 61 f0 breq .+24 ; 0x30490 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30478: 0f 94 51 2a call 0x254a2 ; 0x254a2 3047c: 6c 1b sub r22, r28 3047e: 7d 0b sbc r23, r29 30480: 61 3d cpi r22, 0xD1 ; 209 30482: 77 40 sbci r23, 0x07 ; 7 30484: 68 f3 brcs .-38 ; 0x30460 WRITE(MISO, 0); // disable the MISO line pullup 30486: 2b 98 cbi 0x05, 3 ; 5 30488: 81 e0 ldi r24, 0x01 ; 1 3048a: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd 3048e: 22 c0 rjmp .+68 ; 0x304d4 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 30490: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 30492: 0f 94 51 2a call 0x254a2 ; 0x254a2 30496: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 30498: 8f e1 ldi r24, 0x1F ; 31 3049a: 99 ea ldi r25, 0xA9 ; 169 3049c: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 spiSend(0XFF); 304a0: 8f ef ldi r24, 0xFF ; 255 304a2: 0f 94 80 53 call 0x2a700 ; 0x2a700 while ((status_ = spiRec()) != 0xFF) 304a6: 0f 94 85 53 call 0x2a70a ; 0x2a70a 304aa: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 304ae: 8f 3f cpi r24, 0xFF ; 255 304b0: 59 f1 breq .+86 ; 0x30508 { spiSend(0XFF); 304b2: 8f ef ldi r24, 0xFF ; 255 304b4: 0f 94 80 53 call 0x2a700 ; 0x2a700 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 304b8: 0f 94 51 2a call 0x254a2 ; 0x254a2 304bc: 6c 1b sub r22, r28 304be: 7d 0b sbc r23, r29 304c0: 62 32 cpi r22, 0x22 ; 34 304c2: 71 05 cpc r23, r1 304c4: 80 f3 brcs .-32 ; 0x304a6 304c6: 82 e0 ldi r24, 0x02 ; 2 304c8: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 304cc: 8e e0 ldi r24, 0x0E ; 14 304ce: 99 ea ldi r25, 0xA9 ; 169 304d0: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 304d4: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 304d8: 82 ec ldi r24, 0xC2 ; 194 304da: 9a ea ldi r25, 0xAA ; 170 304dc: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 304e0: 80 e1 ldi r24, 0x10 ; 16 304e2: 90 e7 ldi r25, 0x70 ; 112 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 304e4: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 } if (mounted) 304e8: 80 91 91 14 lds r24, 0x1491 ; 0x801491 304ec: 88 23 and r24, r24 304ee: 09 f4 brne .+2 ; 0x304f2 304f0: 9a c0 rjmp .+308 ; 0x30626 { cdroot(doPresort); 304f2: 80 2f mov r24, r16 } } 304f4: df 91 pop r29 304f6: cf 91 pop r28 304f8: 1f 91 pop r17 304fa: 0f 91 pop r16 304fc: ff 90 pop r15 304fe: ef 90 pop r14 30500: df 90 pop r13 30502: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 30504: 0d 94 e9 7f jmp 0x2ffd2 ; 0x2ffd2 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 30508: 2a ea ldi r18, 0xAA ; 170 3050a: 31 e0 ldi r19, 0x01 ; 1 3050c: 40 e0 ldi r20, 0x00 ; 0 3050e: 50 e0 ldi r21, 0x00 ; 0 30510: 68 e0 ldi r22, 0x08 ; 8 30512: 8d ef ldi r24, 0xFD ; 253 30514: 96 e1 ldi r25, 0x16 ; 22 30516: 0f 94 8c 53 call 0x2a718 ; 0x2a718 3051a: 82 ff sbrs r24, 2 3051c: 2b c0 rjmp .+86 ; 0x30574 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;} 3051e: 81 e0 ldi r24, 0x01 ; 1 30520: 80 93 00 17 sts 0x1700, r24 ; 0x801700 goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 30524: 80 91 00 17 lds r24, 0x1700 ; 0x801700 30528: c1 2c mov r12, r1 3052a: d1 2c mov r13, r1 3052c: 76 01 movw r14, r12 3052e: 82 30 cpi r24, 0x02 ; 2 30530: 29 f4 brne .+10 ; 0x3053c 30532: c1 2c mov r12, r1 30534: d1 2c mov r13, r1 30536: e1 2c mov r14, r1 30538: 80 e4 ldi r24, 0x40 ; 64 3053a: 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); 3053c: 20 e0 ldi r18, 0x00 ; 0 3053e: 30 e0 ldi r19, 0x00 ; 0 30540: a9 01 movw r20, r18 30542: 67 e3 ldi r22, 0x37 ; 55 30544: 8d ef ldi r24, 0xFD ; 253 30546: 96 e1 ldi r25, 0x16 ; 22 30548: 0f 94 8c 53 call 0x2a718 ; 0x2a718 return cardCommand(cmd, arg); 3054c: a7 01 movw r20, r14 3054e: 96 01 movw r18, r12 30550: 69 e2 ldi r22, 0x29 ; 41 30552: 8d ef ldi r24, 0xFD ; 253 30554: 96 e1 ldi r25, 0x16 ; 22 30556: 0f 94 8c 53 call 0x2a718 ; 0x2a718 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 3055a: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 3055e: 88 23 and r24, r24 30560: b1 f0 breq .+44 ; 0x3058e // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30562: 0f 94 51 2a call 0x254a2 ; 0x254a2 30566: 6c 1b sub r22, r28 30568: 7d 0b sbc r23, r29 3056a: 61 3d cpi r22, 0xD1 ; 209 3056c: 77 40 sbci r23, 0x07 ; 7 3056e: 30 f3 brcs .-52 ; 0x3053c bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30570: 8a e0 ldi r24, 0x0A ; 10 30572: 8b cf rjmp .-234 ; 0x3048a goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 30574: 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(); 30576: 0f 94 85 53 call 0x2a70a ; 0x2a70a 3057a: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 3057e: 11 50 subi r17, 0x01 ; 1 30580: d1 f7 brne .-12 ; 0x30576 if (status_ != 0XAA) { 30582: 8a 3a cpi r24, 0xAA ; 170 30584: 11 f0 breq .+4 ; 0x3058a 30586: 82 e0 ldi r24, 0x02 ; 2 30588: 80 cf rjmp .-256 ; 0x3048a 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;} 3058a: 82 e0 ldi r24, 0x02 ; 2 3058c: c9 cf rjmp .-110 ; 0x30520 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 3058e: 80 91 00 17 lds r24, 0x1700 ; 0x801700 30592: 82 30 cpi r24, 0x02 ; 2 30594: d1 f4 brne .+52 ; 0x305ca if (cardCommand(CMD58, 0)) { 30596: 20 e0 ldi r18, 0x00 ; 0 30598: 30 e0 ldi r19, 0x00 ; 0 3059a: a9 01 movw r20, r18 3059c: 6a e3 ldi r22, 0x3A ; 58 3059e: 8d ef ldi r24, 0xFD ; 253 305a0: 96 e1 ldi r25, 0x16 ; 22 305a2: 0f 94 8c 53 call 0x2a718 ; 0x2a718 305a6: 88 23 and r24, r24 305a8: 11 f0 breq .+4 ; 0x305ae bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 305aa: 88 e0 ldi r24, 0x08 ; 8 305ac: 6e cf rjmp .-292 ; 0x3048a error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 305ae: 0f 94 85 53 call 0x2a70a ; 0x2a70a 305b2: 80 7c andi r24, 0xC0 ; 192 305b4: 80 3c cpi r24, 0xC0 ; 192 305b6: 19 f4 brne .+6 ; 0x305be 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;} 305b8: 83 e0 ldi r24, 0x03 ; 3 305ba: 80 93 00 17 sts 0x1700, r24 ; 0x801700 // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 305be: 0f 94 85 53 call 0x2a70a ; 0x2a70a 305c2: 0f 94 85 53 call 0x2a70a ; 0x2a70a 305c6: 0f 94 85 53 call 0x2a70a ; 0x2a70a } chipSelectHigh(); 305ca: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 305ce: 10 92 fe 16 sts 0x16FE, r1 ; 0x8016fe * \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);} 305d2: 81 e0 ldi r24, 0x01 ; 1 305d4: 0f 94 f6 69 call 0x2d3ec ; 0x2d3ec 305d8: 81 11 cpse r24, r1 305da: 0c c0 rjmp .+24 ; 0x305f4 305dc: 80 e0 ldi r24, 0x00 ; 0 305de: 0f 94 f6 69 call 0x2d3ec ; 0x2d3ec #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 305e2: 81 11 cpse r24, r1 305e4: 07 c0 rjmp .+14 ; 0x305f4 { SERIAL_ERROR_START; 305e6: 8a e9 ldi r24, 0x9A ; 154 305e8: 9a ea ldi r25, 0xAA ; 170 305ea: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 305ee: 8d ef ldi r24, 0xFD ; 253 305f0: 9f e6 ldi r25, 0x6F ; 111 305f2: 78 cf rjmp .-272 ; 0x304e4 } else if (!root.openRoot(&volume)) 305f4: 62 e0 ldi r22, 0x02 ; 2 305f6: 77 e1 ldi r23, 0x17 ; 23 305f8: 86 e1 ldi r24, 0x16 ; 22 305fa: 95 e1 ldi r25, 0x15 ; 21 305fc: 0f 94 04 57 call 0x2ae08 ; 0x2ae08 30600: 81 11 cpse r24, r1 30602: 07 c0 rjmp .+14 ; 0x30612 { SERIAL_ERROR_START; 30604: 8a e9 ldi r24, 0x9A ; 154 30606: 9a ea ldi r25, 0xAA ; 170 30608: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 3060c: 8d ee ldi r24, 0xED ; 237 3060e: 9f e6 ldi r25, 0x6F ; 111 30610: 69 cf rjmp .-302 ; 0x304e4 } else { mounted = true; 30612: 81 e0 ldi r24, 0x01 ; 1 30614: 80 93 91 14 sts 0x1491, r24 ; 0x801491 SERIAL_ECHO_START; 30618: 82 ec ldi r24, 0xC2 ; 194 3061a: 9a ea ldi r25, 0xAA ; 170 3061c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 30620: 82 ee ldi r24, 0xE2 ; 226 30622: 9f e6 ldi r25, 0x6F ; 111 30624: 5f cf rjmp .-322 ; 0x304e4 if (mounted) { cdroot(doPresort); } } 30626: df 91 pop r29 30628: cf 91 pop r28 3062a: 1f 91 pop r17 3062c: 0f 91 pop r16 3062e: ff 90 pop r15 30630: ef 90 pop r14 30632: df 90 pop r13 30634: cf 90 pop r12 30636: 08 95 ret 00030638 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 30638: 4f 92 push r4 3063a: 5f 92 push r5 3063c: 6f 92 push r6 3063e: 7f 92 push r7 30640: 8f 92 push r8 30642: 9f 92 push r9 30644: af 92 push r10 30646: bf 92 push r11 30648: cf 92 push r12 3064a: df 92 push r13 3064c: ef 92 push r14 3064e: ff 92 push r15 30650: 4b 01 movw r8, r22 30652: 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]; 30654: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 30658: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 3065c: 07 2e mov r0, r23 3065e: 00 0c add r0, r0 30660: 88 0b sbc r24, r24 30662: 99 0b sbc r25, r25 30664: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> if (!degTargetHotend(extruder)) 30668: 20 e0 ldi r18, 0x00 ; 0 3066a: 30 e0 ldi r19, 0x00 ; 0 3066c: a9 01 movw r20, r18 3066e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 30672: 88 23 and r24, r24 30674: d1 f0 breq .+52 ; 0x306aa #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; 30676: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.410> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 3067a: cc 24 eor r12, r12 3067c: ca 94 dec r12 3067e: dc 2c mov r13, r12 30680: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 30682: 98 ee ldi r25, 0xE8 ; 232 30684: 49 2e mov r4, r25 30686: 93 e0 ldi r25, 0x03 ; 3 30688: 59 2e mov r5, r25 3068a: 61 2c mov r6, r1 3068c: 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) || 3068e: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.410> 30692: 81 11 cpse r24, r1 30694: 0a c0 rjmp .+20 ; 0x306aa 30696: 2f ef ldi r18, 0xFF ; 255 30698: c2 16 cp r12, r18 3069a: d2 06 cpc r13, r18 3069c: e2 06 cpc r14, r18 3069e: f2 06 cpc r15, r18 306a0: 89 f4 brne .+34 ; 0x306c4 (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) { 306a2: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 306a6: 82 30 cpi r24, 0x02 ; 2 306a8: b9 f4 brne .+46 ; 0x306d8 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 306aa: ff 90 pop r15 306ac: ef 90 pop r14 306ae: df 90 pop r13 306b0: cf 90 pop r12 306b2: bf 90 pop r11 306b4: af 90 pop r10 306b6: 9f 90 pop r9 306b8: 8f 90 pop r8 306ba: 7f 90 pop r7 306bc: 6f 90 pop r6 306be: 5f 90 pop r5 306c0: 4f 90 pop r4 306c2: 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) || 306c4: f7 fc sbrc r15, 7 306c6: f1 cf rjmp .-30 ; 0x306aa (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 306c8: 0f 94 51 2a call 0x254a2 ; 0x254a2 306cc: 6c 19 sub r22, r12 306ce: 7d 09 sbc r23, r13 306d0: 68 3b cpi r22, 0xB8 ; 184 306d2: 7b 40 sbci r23, 0x0B ; 11 306d4: 30 f3 brcs .-52 ; 0x306a2 306d6: e9 cf rjmp .-46 ; 0x306aa 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) 306d8: 0f 94 51 2a call 0x254a2 ; 0x254a2 306dc: 68 19 sub r22, r8 306de: 79 09 sbc r23, r9 306e0: 8a 09 sbc r24, r10 306e2: 9b 09 sbc r25, r11 306e4: 69 3e cpi r22, 0xE9 ; 233 306e6: 73 40 sbci r23, 0x03 ; 3 306e8: 81 05 cpc r24, r1 306ea: 91 05 cpc r25, r1 306ec: f0 f1 brcs .+124 ; 0x3076a { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 306ee: 8b e0 ldi r24, 0x0B ; 11 306f0: 99 ea ldi r25, 0xA9 ; 169 306f2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 306f6: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 306fa: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 306fe: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 30702: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 30706: 41 e0 ldi r20, 0x01 ; 1 30708: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 3070c: 87 e0 ldi r24, 0x07 ; 7 3070e: 99 ea ldi r25, 0xA9 ; 169 30710: 0e 94 d0 76 call 0xeda0 ; 0xeda0 30714: 60 e0 ldi r22, 0x00 ; 0 30716: 70 e0 ldi r23, 0x00 ; 0 30718: cb 01 movw r24, r22 3071a: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 3071e: 83 e0 ldi r24, 0x03 ; 3 30720: 99 ea ldi r25, 0xA9 ; 169 30722: 0e 94 d0 76 call 0xeda0 ; 0xeda0 if (residencyStart > -1) 30726: f7 fc sbrc r15, 7 30728: 52 c0 rjmp .+164 ; 0x307ce { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 3072a: 0f 94 51 2a call 0x254a2 ; 0x254a2 3072e: 46 01 movw r8, r12 30730: 57 01 movw r10, r14 30732: 58 eb ldi r21, 0xB8 ; 184 30734: 85 0e add r8, r21 30736: 5b e0 ldi r21, 0x0B ; 11 30738: 95 1e adc r9, r21 3073a: a1 1c adc r10, r1 3073c: b1 1c adc r11, r1 3073e: a5 01 movw r20, r10 30740: 94 01 movw r18, r8 30742: 26 1b sub r18, r22 30744: 37 0b sbc r19, r23 30746: 48 0b sbc r20, r24 30748: 59 0b sbc r21, r25 3074a: ca 01 movw r24, r20 3074c: b9 01 movw r22, r18 3074e: a3 01 movw r20, r6 30750: 92 01 movw r18, r4 30752: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 30756: ca 01 movw r24, r20 30758: b9 01 movw r22, r18 3075a: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 3075e: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 30762: 0f 94 51 2a call 0x254a2 ; 0x254a2 30766: 4b 01 movw r8, r22 30768: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 3076a: 90 e0 ldi r25, 0x00 ; 0 3076c: 80 e0 ldi r24, 0x00 ; 0 3076e: 0e 94 6c 8c call 0x118d8 ; 0x118d8 #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))) || 30772: 3f ef ldi r19, 0xFF ; 255 30774: c3 16 cp r12, r19 30776: d3 06 cpc r13, r19 30778: e3 06 cpc r14, r19 3077a: f3 06 cpc r15, r19 3077c: 09 f0 breq .+2 ; 0x30780 3077e: 46 c0 rjmp .+140 ; 0x3080c } 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))) || 30780: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf <_ZL16target_direction.lto_priv.534> 30784: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 30788: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 3078c: 88 23 and r24, r24 3078e: 19 f1 breq .+70 ; 0x307d6 30790: 07 2e mov r0, r23 30792: 00 0c add r0, r0 30794: 88 0b sbc r24, r24 30796: 99 0b sbc r25, r25 30798: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 3079c: 20 e0 ldi r18, 0x00 ; 0 3079e: 30 e0 ldi r19, 0x00 ; 0 307a0: 40 e8 ldi r20, 0x80 ; 128 307a2: 5f e3 ldi r21, 0x3F ; 63 307a4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 307a8: 9b 01 movw r18, r22 307aa: ac 01 movw r20, r24 307ac: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 307b0: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 307b4: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 307b8: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 307bc: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 307c0: 87 fd sbrc r24, 7 307c2: 65 cf rjmp .-310 ; 0x3068e (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 307c4: 0f 94 51 2a call 0x254a2 ; 0x254a2 307c8: 6b 01 movw r12, r22 307ca: 7c 01 movw r14, r24 307cc: 60 cf rjmp .-320 ; 0x3068e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 307ce: 8f e3 ldi r24, 0x3F ; 63 307d0: 0e 94 b7 76 call 0xed6e ; 0xed6e 307d4: c4 cf rjmp .-120 ; 0x3075e 307d6: 07 2e mov r0, r23 307d8: 00 0c add r0, r0 307da: 88 0b sbc r24, r24 307dc: 99 0b sbc r25, r25 307de: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__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))) || 307e2: 20 e0 ldi r18, 0x00 ; 0 307e4: 30 e0 ldi r19, 0x00 ; 0 307e6: 40 e8 ldi r20, 0x80 ; 128 307e8: 5f e3 ldi r21, 0x3F ; 63 307ea: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 307ee: 9b 01 movw r18, r22 307f0: ac 01 movw r20, r24 307f2: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 307f6: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 307fa: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 307fe: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 30802: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 30806: 18 16 cp r1, r24 30808: ec f6 brge .-70 ; 0x307c4 3080a: 41 cf rjmp .-382 ; 0x3068e 3080c: f7 fc sbrc r15, 7 3080e: 3f cf rjmp .-386 ; 0x3068e 30810: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 30814: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 30818: 07 2e mov r0, r23 3081a: 00 0c add r0, r0 3081c: 88 0b sbc r24, r24 3081e: 99 0b sbc r25, r25 30820: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 30824: 9b 01 movw r18, r22 30826: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 30828: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 3082c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 30830: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 30834: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 30838: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3083c: 9f 77 andi r25, 0x7F ; 127 3083e: 20 e0 ldi r18, 0x00 ; 0 30840: 30 e0 ldi r19, 0x00 ; 0 30842: 40 ea ldi r20, 0xA0 ; 160 30844: 50 e4 ldi r21, 0x40 ; 64 30846: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 3084a: 18 16 cp r1, r24 3084c: 0c f0 brlt .+2 ; 0x30850 3084e: 1f cf rjmp .-450 ; 0x3068e 30850: b9 cf rjmp .-142 ; 0x307c4 00030852 : // 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) { 30852: 1f 93 push r17 30854: cf 93 push r28 30856: df 93 push r29 30858: ec 01 movw r28, r24 3085a: 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()) { 3085c: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 30860: 83 30 cpi r24, 0x03 ; 3 30862: 09 f4 brne .+2 ; 0x30866 30864: 4e c0 rjmp .+156 ; 0x30902 30866: 8c 31 cpi r24, 0x1C ; 28 30868: 09 f4 brne .+2 ; 0x3086c 3086a: 52 c0 rjmp .+164 ; 0x30910 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 3086c: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 30870: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 30874: 8c 17 cp r24, r28 30876: 9d 07 cpc r25, r29 30878: 79 f1 breq .+94 ; 0x308d8 lastErrorCode = ec; 3087a: d0 93 b3 13 sts 0x13B3, r29 ; 0x8013b3 3087e: c0 93 b2 13 sts 0x13B2, r28 ; 0x8013b2 lastErrorSource = res; 30882: 10 93 b4 13 sts 0x13B4, r17 ; 0x8013b4 LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 30886: ce 01 movw r24, r28 30888: 0f 94 24 c6 call 0x38c48 ; 0x38c48 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); 3088c: e8 2f mov r30, r24 3088e: f0 e0 ldi r31, 0x00 ; 0 30890: ee 0f add r30, r30 30892: ff 1f adc r31, r31 30894: e9 5c subi r30, 0xC9 ; 201 30896: f7 45 sbci r31, 0x57 ; 87 30898: 85 91 lpm r24, Z+ 3089a: 94 91 lpm r25, Z 3089c: 02 96 adiw r24, 0x02 ; 2 3089e: 0f 94 0d c6 call 0x38c1a ; 0x38c1a if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 308a2: c1 30 cpi r28, 0x01 ; 1 308a4: d1 05 cpc r29, r1 308a6: c1 f0 breq .+48 ; 0x308d8 308a8: cc 30 cpi r28, 0x0C ; 12 308aa: 80 e8 ldi r24, 0x80 ; 128 308ac: d8 07 cpc r29, r24 308ae: a1 f0 breq .+40 ; 0x308d8 308b0: c9 32 cpi r28, 0x29 ; 41 308b2: 80 e8 ldi r24, 0x80 ; 128 308b4: d8 07 cpc r29, r24 308b6: 81 f0 breq .+32 ; 0x308d8 IncrementMMUFails(); 308b8: 0f 94 26 c5 call 0x38a4c ; 0x38a4c | (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 308bc: ce 01 movw r24, r28 308be: 88 27 eor r24, r24 308c0: 9e 77 andi r25, 0x7E ; 126 308c2: 89 2b or r24, r25 308c4: 49 f0 breq .+18 ; 0x308d8 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 308c6: 80 91 c0 13 lds r24, 0x13C0 ; 0x8013c0 308ca: 90 91 c1 13 lds r25, 0x13C1 ; 0x8013c1 308ce: 01 96 adiw r24, 0x01 ; 1 308d0: 90 93 c1 13 sts 0x13C1, r25 ; 0x8013c1 308d4: 80 93 c0 13 sts 0x13C0, r24 ; 0x8013c0 return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 308d8: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 308dc: 88 23 and r24, r24 308de: d9 f0 breq .+54 ; 0x30916 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 308e0: 11 e0 ldi r17, 0x01 ; 1 308e2: 10 93 ae 0d sts 0x0DAE, r17 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 308e6: ce 01 movw r24, r28 308e8: 0f 94 af c8 call 0x3915e ; 0x3915e 308ec: 8f 3f cpi r24, 0xFF ; 255 308ee: 99 f0 breq .+38 ; 0x30916 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 308f0: 10 93 a0 13 sts 0x13A0, r17 ; 0x8013a0 logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 308f4: 84 e2 ldi r24, 0x24 ; 36 308f6: 98 ea ldi r25, 0xA8 ; 168 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 308f8: df 91 pop r29 308fa: cf 91 pop r28 308fc: 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"); 308fe: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 // 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; 30902: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 30906: 0f 94 fb c1 call 0x383f6 ; 0x383f6 // 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; 3090a: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac 3090e: ae cf rjmp .-164 ; 0x3086c 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; 30910: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc 30914: f8 cf rjmp .-16 ; 0x30906 30916: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 3091a: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.498> 3091e: 81 11 cpse r24, r1 30920: 06 c0 rjmp .+12 ; 0x3092e 30922: 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"); } 30924: df 91 pop r29 30926: cf 91 pop r28 30928: 1f 91 pop r17 3092a: 0d 94 75 c7 jmp 0x38eea ; 0x38eea 3092e: df 91 pop r29 30930: cf 91 pop r28 30932: 1f 91 pop r17 30934: 08 95 ret 00030936 : * \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) { 30936: 2f 92 push r2 30938: 3f 92 push r3 3093a: 4f 92 push r4 3093c: 5f 92 push r5 3093e: 6f 92 push r6 30940: 7f 92 push r7 30942: 8f 92 push r8 30944: 9f 92 push r9 30946: af 92 push r10 30948: bf 92 push r11 3094a: cf 92 push r12 3094c: df 92 push r13 3094e: ef 92 push r14 30950: ff 92 push r15 30952: 0f 93 push r16 30954: 1f 93 push r17 30956: cf 93 push r28 30958: df 93 push r29 3095a: 00 d0 rcall .+0 ; 0x3095c 3095c: 1f 92 push r1 3095e: cd b7 in r28, 0x3d ; 61 30960: de b7 in r29, 0x3e ; 62 30962: 5c 01 movw r10, r24 30964: 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; 30966: 80 91 23 17 lds r24, 0x1723 ; 0x801723 3096a: 81 30 cpi r24, 0x01 ; 1 3096c: 09 f0 breq .+2 ; 0x30970 3096e: de c0 rjmp .+444 ; 0x30b2c 30970: 80 91 21 17 lds r24, 0x1721 ; 0x801721 30974: 81 ff sbrs r24, 1 30976: da c0 rjmp .+436 ; 0x30b2c // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 30978: 82 fd sbrc r24, 2 3097a: bc c0 rjmp .+376 ; 0x30af4 * \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) { 3097c: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 3097e: 21 2c mov r2, r1 30980: 32 e0 ldi r19, 0x02 ; 2 30982: 33 2e mov r3, r19 30984: 00 91 28 17 lds r16, 0x1728 ; 0x801728 30988: 10 91 29 17 lds r17, 0x1729 ; 0x801729 3098c: 20 91 2a 17 lds r18, 0x172A ; 0x80172a 30990: 30 91 2b 17 lds r19, 0x172B ; 0x80172b // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 30994: e1 14 cp r14, r1 30996: f1 04 cpc r15, r1 30998: 09 f4 brne .+2 ; 0x3099c 3099a: 30 c1 rjmp .+608 ; 0x30bfc uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 3099c: 80 91 39 17 lds r24, 0x1739 ; 0x801739 309a0: 90 91 3a 17 lds r25, 0x173A ; 0x80173a 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);} 309a4: dc 01 movw r26, r24 309a6: 14 96 adiw r26, 0x04 ; 4 309a8: 7c 90 ld r7, X 309aa: 7a 94 dec r7 309ac: b9 01 movw r22, r18 309ae: a8 01 movw r20, r16 309b0: 29 e0 ldi r18, 0x09 ; 9 309b2: 76 95 lsr r23 309b4: 67 95 ror r22 309b6: 57 95 ror r21 309b8: 47 95 ror r20 309ba: 2a 95 dec r18 309bc: d1 f7 brne .-12 ; 0x309b2 309be: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 309c0: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 309c2: 71 10 cpse r7, r1 309c4: 25 c0 rjmp .+74 ; 0x30a10 309c6: 01 15 cp r16, r1 309c8: 11 05 cpc r17, r1 309ca: 11 f5 brne .+68 ; 0x30a10 309cc: 40 91 24 17 lds r20, 0x1724 ; 0x801724 309d0: 50 91 25 17 lds r21, 0x1725 ; 0x801725 309d4: 60 91 26 17 lds r22, 0x1726 ; 0x801726 309d8: 70 91 27 17 lds r23, 0x1727 ; 0x801727 // start of new cluster if (curCluster_ == 0) { 309dc: 41 15 cp r20, r1 309de: 51 05 cpc r21, r1 309e0: 61 05 cpc r22, r1 309e2: 71 05 cpc r23, r1 309e4: 09 f0 breq .+2 ; 0x309e8 309e6: a8 c0 rjmp .+336 ; 0x30b38 if (firstCluster_ == 0) { 309e8: 80 91 35 17 lds r24, 0x1735 ; 0x801735 309ec: 90 91 36 17 lds r25, 0x1736 ; 0x801736 309f0: a0 91 37 17 lds r26, 0x1737 ; 0x801737 309f4: b0 91 38 17 lds r27, 0x1738 ; 0x801738 309f8: 00 97 sbiw r24, 0x00 ; 0 309fa: a1 05 cpc r26, r1 309fc: b1 05 cpc r27, r1 309fe: 09 f0 breq .+2 ; 0x30a02 30a00: b4 c0 rjmp .+360 ; 0x30b6a } 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; 30a02: 80 e2 ldi r24, 0x20 ; 32 30a04: 97 e1 ldi r25, 0x17 ; 23 30a06: 0f 94 61 58 call 0x2b0c2 ; 0x2b0c2 30a0a: 88 23 and r24, r24 30a0c: 09 f4 brne .+2 ; 0x30a10 30a0e: 8e c0 rjmp .+284 ; 0x30b2c curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30a10: c1 01 movw r24, r2 30a12: 80 1b sub r24, r16 30a14: 91 0b sbc r25, r17 30a16: 67 01 movw r12, r14 30a18: 8e 15 cp r24, r14 30a1a: 9f 05 cpc r25, r15 30a1c: 08 f4 brcc .+2 ; 0x30a20 30a1e: 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; 30a20: e0 91 39 17 lds r30, 0x1739 ; 0x801739 30a24: f0 91 3a 17 lds r31, 0x173A ; 0x80173a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 30a28: 80 91 24 17 lds r24, 0x1724 ; 0x801724 30a2c: 90 91 25 17 lds r25, 0x1725 ; 0x801725 30a30: a0 91 26 17 lds r26, 0x1726 ; 0x801726 30a34: b0 91 27 17 lds r27, 0x1727 ; 0x801727 30a38: 02 97 sbiw r24, 0x02 ; 2 30a3a: a1 09 sbc r26, r1 30a3c: b1 09 sbc r27, r1 30a3e: 25 85 ldd r18, Z+13 ; 0x0d 30a40: 04 c0 rjmp .+8 ; 0x30a4a 30a42: 88 0f add r24, r24 30a44: 99 1f adc r25, r25 30a46: aa 1f adc r26, r26 30a48: bb 1f adc r27, r27 30a4a: 2a 95 dec r18 30a4c: d2 f7 brpl .-12 ; 0x30a42 30a4e: 46 85 ldd r20, Z+14 ; 0x0e 30a50: 57 85 ldd r21, Z+15 ; 0x0f 30a52: 60 89 ldd r22, Z+16 ; 0x10 30a54: 71 89 ldd r23, Z+17 ; 0x11 30a56: 84 0f add r24, r20 30a58: 95 1f adc r25, r21 30a5a: a6 1f adc r26, r22 30a5c: b7 1f adc r27, r23 30a5e: 9c 01 movw r18, r24 30a60: ad 01 movw r20, r26 30a62: 27 0d add r18, r7 30a64: 31 1d adc r19, r1 30a66: 41 1d adc r20, r1 30a68: 51 1d adc r21, r1 30a6a: 29 01 movw r4, r18 30a6c: 3a 01 movw r6, r20 if (n == 512) { 30a6e: c1 14 cp r12, r1 30a70: 32 e0 ldi r19, 0x02 ; 2 30a72: d3 06 cpc r13, r19 30a74: 09 f0 breq .+2 ; 0x30a78 30a76: 8a c0 rjmp .+276 ; 0x30b8c // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 30a78: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 30a7c: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 30a80: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 30a84: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 30a88: 48 16 cp r4, r24 30a8a: 59 06 cpc r5, r25 30a8c: 6a 06 cpc r6, r26 30a8e: 7b 06 cpc r7, r27 30a90: 69 f4 brne .+26 ; 0x30aac 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; 30a92: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 cacheBlockNumber_ = blockNumber; 30a96: 8f ef ldi r24, 0xFF ; 255 30a98: 9f ef ldi r25, 0xFF ; 255 30a9a: dc 01 movw r26, r24 30a9c: 80 93 91 0e sts 0x0E91, r24 ; 0x800e91 30aa0: 90 93 92 0e sts 0x0E92, r25 ; 0x800e92 30aa4: a0 93 93 0e sts 0x0E93, r26 ; 0x800e93 30aa8: b0 93 94 0e sts 0x0E94, r27 ; 0x800e94 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); 30aac: 95 01 movw r18, r10 30aae: b3 01 movw r22, r6 30ab0: a2 01 movw r20, r4 30ab2: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 30ab6: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 30aba: 0f 94 ec 53 call 0x2a7d8 ; 0x2a7d8 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 30abe: 88 23 and r24, r24 30ac0: a9 f1 breq .+106 ; 0x30b2c if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 30ac2: 80 91 28 17 lds r24, 0x1728 ; 0x801728 30ac6: 90 91 29 17 lds r25, 0x1729 ; 0x801729 30aca: a0 91 2a 17 lds r26, 0x172A ; 0x80172a 30ace: b0 91 2b 17 lds r27, 0x172B ; 0x80172b 30ad2: 8c 0d add r24, r12 30ad4: 9d 1d adc r25, r13 30ad6: a1 1d adc r26, r1 30ad8: b1 1d adc r27, r1 30ada: 80 93 28 17 sts 0x1728, r24 ; 0x801728 30ade: 90 93 29 17 sts 0x1729, r25 ; 0x801729 30ae2: a0 93 2a 17 sts 0x172A, r26 ; 0x80172a 30ae6: b0 93 2b 17 sts 0x172B, r27 ; 0x80172b src += n; 30aea: ac 0c add r10, r12 30aec: bd 1c adc r11, r13 nToWrite -= n; 30aee: ec 18 sub r14, r12 30af0: fd 08 sbc r15, r13 30af2: 48 cf rjmp .-368 ; 0x30984 // 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_) { 30af4: 40 91 31 17 lds r20, 0x1731 ; 0x801731 30af8: 50 91 32 17 lds r21, 0x1732 ; 0x801732 30afc: 60 91 33 17 lds r22, 0x1733 ; 0x801733 30b00: 70 91 34 17 lds r23, 0x1734 ; 0x801734 30b04: 80 91 28 17 lds r24, 0x1728 ; 0x801728 30b08: 90 91 29 17 lds r25, 0x1729 ; 0x801729 30b0c: a0 91 2a 17 lds r26, 0x172A ; 0x80172a 30b10: b0 91 2b 17 lds r27, 0x172B ; 0x80172b 30b14: 48 17 cp r20, r24 30b16: 59 07 cpc r21, r25 30b18: 6a 07 cpc r22, r26 30b1a: 7b 07 cpc r23, r27 30b1c: 09 f4 brne .+2 ; 0x30b20 30b1e: 2e cf rjmp .-420 ; 0x3097c } /** 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);} 30b20: 80 e2 ldi r24, 0x20 ; 32 30b22: 97 e1 ldi r25, 0x17 ; 23 30b24: 0f 94 cd 57 call 0x2af9a ; 0x2af9a if (!seekEnd()) goto fail; 30b28: 81 11 cpse r24, r1 30b2a: 28 cf rjmp .-432 ; 0x3097c } return nbyte; fail: // return for write error writeError = true; 30b2c: 81 e0 ldi r24, 0x01 ; 1 30b2e: 80 93 20 17 sts 0x1720, r24 ; 0x801720 return -1; 30b32: 8f ef ldi r24, 0xFF ; 255 30b34: 9f ef ldi r25, 0xFF ; 255 30b36: 81 c0 rjmp .+258 ; 0x30c3a } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 30b38: 9e 01 movw r18, r28 30b3a: 2f 5f subi r18, 0xFF ; 255 30b3c: 3f 4f sbci r19, 0xFF ; 255 30b3e: 0f 94 17 56 call 0x2ac2e ; 0x2ac2e 30b42: 88 23 and r24, r24 30b44: 99 f3 breq .-26 ; 0x30b2c if (vol_->isEOC(next)) { 30b46: 89 81 ldd r24, Y+1 ; 0x01 30b48: 9a 81 ldd r25, Y+2 ; 0x02 30b4a: ab 81 ldd r26, Y+3 ; 0x03 30b4c: 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; 30b4e: e0 91 39 17 lds r30, 0x1739 ; 0x801739 30b52: f0 91 3a 17 lds r31, 0x173A ; 0x80173a 30b56: 27 89 ldd r18, Z+23 ; 0x17 30b58: 20 31 cpi r18, 0x10 ; 16 30b5a: 81 f4 brne .+32 ; 0x30b7c 30b5c: 88 3f cpi r24, 0xF8 ; 248 30b5e: ef ef ldi r30, 0xFF ; 255 30b60: 9e 07 cpc r25, r30 30b62: a1 05 cpc r26, r1 30b64: b1 05 cpc r27, r1 30b66: 08 f0 brcs .+2 ; 0x30b6a 30b68: 4c cf rjmp .-360 ; 0x30a02 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 30b6a: 80 93 24 17 sts 0x1724, r24 ; 0x801724 30b6e: 90 93 25 17 sts 0x1725, r25 ; 0x801725 30b72: a0 93 26 17 sts 0x1726, r26 ; 0x801726 30b76: b0 93 27 17 sts 0x1727, r27 ; 0x801727 30b7a: 4a cf rjmp .-364 ; 0x30a10 return cluster >= FAT32EOC_MIN; 30b7c: 88 3f cpi r24, 0xF8 ; 248 30b7e: ff ef ldi r31, 0xFF ; 255 30b80: 9f 07 cpc r25, r31 30b82: af 07 cpc r26, r31 30b84: ff e0 ldi r31, 0x0F ; 15 30b86: bf 07 cpc r27, r31 30b88: 80 f3 brcs .-32 ; 0x30b6a 30b8a: 3b cf rjmp .-394 ; 0x30a02 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 30b8c: 01 15 cp r16, r1 30b8e: 11 05 cpc r17, r1 30b90: 69 f5 brne .+90 ; 0x30bec 30b92: 40 91 28 17 lds r20, 0x1728 ; 0x801728 30b96: 50 91 29 17 lds r21, 0x1729 ; 0x801729 30b9a: 60 91 2a 17 lds r22, 0x172A ; 0x80172a 30b9e: 70 91 2b 17 lds r23, 0x172B ; 0x80172b 30ba2: 80 91 31 17 lds r24, 0x1731 ; 0x801731 30ba6: 90 91 32 17 lds r25, 0x1732 ; 0x801732 30baa: a0 91 33 17 lds r26, 0x1733 ; 0x801733 30bae: b0 91 34 17 lds r27, 0x1734 ; 0x801734 30bb2: 48 17 cp r20, r24 30bb4: 59 07 cpc r21, r25 30bb6: 6a 07 cpc r22, r26 30bb8: 7b 07 cpc r23, r27 30bba: c0 f0 brcs .+48 ; 0x30bec // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 30bbc: 0f 94 50 54 call 0x2a8a0 ; 0x2a8a0 30bc0: 88 23 and r24, r24 30bc2: 09 f4 brne .+2 ; 0x30bc6 30bc4: b3 cf rjmp .-154 ; 0x30b2c 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; 30bc6: 81 e0 ldi r24, 0x01 ; 1 30bc8: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 cacheBlockNumber_ = blockNumber; 30bcc: 40 92 91 0e sts 0x0E91, r4 ; 0x800e91 30bd0: 50 92 92 0e sts 0x0E92, r5 ; 0x800e92 30bd4: 60 92 93 0e sts 0x0E93, r6 ; 0x800e93 30bd8: 70 92 94 0e sts 0x0E94, r7 ; 0x800e94 } 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); 30bdc: a6 01 movw r20, r12 30bde: b5 01 movw r22, r10 30be0: c8 01 movw r24, r16 30be2: 83 56 subi r24, 0x63 ; 99 30be4: 91 4f sbci r25, 0xF1 ; 241 30be6: 0f 94 7d e2 call 0x3c4fa ; 0x3c4fa 30bea: 6b cf rjmp .-298 ; 0x30ac2 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; 30bec: 41 e0 ldi r20, 0x01 ; 1 30bee: c3 01 movw r24, r6 30bf0: b2 01 movw r22, r4 30bf2: 0f 94 48 55 call 0x2aa90 ; 0x2aa90 30bf6: 81 11 cpse r24, r1 30bf8: f1 cf rjmp .-30 ; 0x30bdc 30bfa: 98 cf rjmp .-208 ; 0x30b2c } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 30bfc: 80 91 31 17 lds r24, 0x1731 ; 0x801731 30c00: 90 91 32 17 lds r25, 0x1732 ; 0x801732 30c04: a0 91 33 17 lds r26, 0x1733 ; 0x801733 30c08: b0 91 34 17 lds r27, 0x1734 ; 0x801734 30c0c: 80 17 cp r24, r16 30c0e: 91 07 cpc r25, r17 30c10: a2 07 cpc r26, r18 30c12: b3 07 cpc r27, r19 30c14: 68 f4 brcc .+26 ; 0x30c30 30c16: 80 91 21 17 lds r24, 0x1721 ; 0x801721 // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 30c1a: 00 93 31 17 sts 0x1731, r16 ; 0x801731 30c1e: 10 93 32 17 sts 0x1732, r17 ; 0x801732 30c22: 20 93 33 17 sts 0x1733, r18 ; 0x801733 30c26: 30 93 34 17 sts 0x1734, r19 ; 0x801734 flags_ |= F_FILE_DIR_DIRTY; 30c2a: 80 68 ori r24, 0x80 ; 128 30c2c: 80 93 21 17 sts 0x1721, r24 ; 0x801721 } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 30c30: 80 91 21 17 lds r24, 0x1721 ; 0x801721 30c34: 83 fd sbrc r24, 3 30c36: 18 c0 rjmp .+48 ; 0x30c68 if (!sync()) goto fail; } return nbyte; 30c38: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 30c3a: 0f 90 pop r0 30c3c: 0f 90 pop r0 30c3e: 0f 90 pop r0 30c40: 0f 90 pop r0 30c42: df 91 pop r29 30c44: cf 91 pop r28 30c46: 1f 91 pop r17 30c48: 0f 91 pop r16 30c4a: ff 90 pop r15 30c4c: ef 90 pop r14 30c4e: df 90 pop r13 30c50: cf 90 pop r12 30c52: bf 90 pop r11 30c54: af 90 pop r10 30c56: 9f 90 pop r9 30c58: 8f 90 pop r8 30c5a: 7f 90 pop r7 30c5c: 6f 90 pop r6 30c5e: 5f 90 pop r5 30c60: 4f 90 pop r4 30c62: 3f 90 pop r3 30c64: 2f 90 pop r2 30c66: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 30c68: 80 e2 ldi r24, 0x20 ; 32 30c6a: 97 e1 ldi r25, 0x17 ; 23 30c6c: 0f 94 76 59 call 0x2b2ec ; 0x2b2ec 30c70: 81 11 cpse r24, r1 30c72: e2 cf rjmp .-60 ; 0x30c38 30c74: 5b cf rjmp .-330 ; 0x30b2c 00030c76 : #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) { 30c76: 0f 93 push r16 30c78: cf 93 push r28 30c7a: df 93 push r29 30c7c: cd b7 in r28, 0x3d ; 61 30c7e: de b7 in r29, 0x3e ; 62 30c80: a3 97 sbiw r28, 0x23 ; 35 30c82: 0f b6 in r0, 0x3f ; 63 30c84: f8 94 cli 30c86: de bf out 0x3e, r29 ; 62 30c88: 0f be out 0x3f, r0 ; 63 30c8a: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 30c8c: 20 91 31 16 lds r18, 0x1631 ; 0x801631 30c90: 30 91 32 16 lds r19, 0x1632 ; 0x801632 30c94: 82 17 cp r24, r18 30c96: 93 07 cpc r25, r19 30c98: d8 f4 brcc .+54 ; 0x30cd0 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 30c9a: 61 30 cpi r22, 0x01 ; 1 30c9c: 31 f4 brne .+12 ; 0x30caa 30c9e: 21 50 subi r18, 0x01 ; 1 30ca0: 31 09 sbc r19, r1 30ca2: a9 01 movw r20, r18 30ca4: 48 1b sub r20, r24 30ca6: 59 0b sbc r21, r25 30ca8: ca 01 movw r24, r20 30caa: 88 0f add r24, r24 30cac: 99 1f adc r25, r25 30cae: fc 01 movw r30, r24 30cb0: ed 5c subi r30, 0xCD ; 205 30cb2: f9 4e sbci r31, 0xE9 ; 233 30cb4: 80 81 ld r24, Z 30cb6: 91 81 ldd r25, Z+1 ; 0x01 30cb8: 0f 94 c0 7a call 0x2f580 ; 0x2f580 else getfilename_afterMaxSorting(nr); } 30cbc: a3 96 adiw r28, 0x23 ; 35 30cbe: 0f b6 in r0, 0x3f ; 63 30cc0: f8 94 cli 30cc2: de bf out 0x3e, r29 ; 62 30cc4: 0f be out 0x3f, r0 ; 63 30cc6: cd bf out 0x3d, r28 ; 61 30cc8: df 91 pop r29 30cca: cf 91 pop r28 30ccc: 0f 91 pop r16 30cce: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 30cd0: 4b e3 ldi r20, 0x3B ; 59 30cd2: 55 e1 ldi r21, 0x15 ; 21 30cd4: 50 93 3a 15 sts 0x153A, r21 ; 0x80153a 30cd8: 40 93 39 15 sts 0x1539, r20 ; 0x801539 nrFiles = entry - sort_count + 1; 30cdc: 82 1b sub r24, r18 30cde: 93 0b sbc r25, r19 30ce0: 01 96 adiw r24, 0x01 ; 1 30ce2: 90 93 a9 17 sts 0x17A9, r25 ; 0x8017a9 30ce6: 80 93 a8 17 sts 0x17A8, r24 ; 0x8017a8 curDir->seekSet(lastSortedFilePosition << 5); 30cea: 40 91 fb 16 lds r20, 0x16FB ; 0x8016fb 30cee: 50 91 fc 16 lds r21, 0x16FC ; 0x8016fc 30cf2: 85 e0 ldi r24, 0x05 ; 5 30cf4: 44 0f add r20, r20 30cf6: 55 1f adc r21, r21 30cf8: 8a 95 dec r24 30cfa: e1 f7 brne .-8 ; 0x30cf4 30cfc: 70 e0 ldi r23, 0x00 ; 0 30cfe: 60 e0 ldi r22, 0x00 ; 0 30d00: 8b e3 ldi r24, 0x3B ; 59 30d02: 95 e1 ldi r25, 0x15 ; 21 30d04: 0f 94 cd 57 call 0x2af9a ; 0x2af9a }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 30d08: 00 e0 ldi r16, 0x00 ; 0 30d0a: 0e 7f andi r16, 0xFE ; 254 30d0c: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 30d0e: e0 91 39 15 lds r30, 0x1539 ; 0x801539 30d12: f0 91 3a 15 lds r31, 0x153A ; 0x80153a 30d16: 83 e2 ldi r24, 0x23 ; 35 30d18: de 01 movw r26, r28 30d1a: 11 96 adiw r26, 0x01 ; 1 30d1c: 01 90 ld r0, Z+ 30d1e: 0d 92 st X+, r0 30d20: 8a 95 dec r24 30d22: e1 f7 brne .-8 ; 0x30d1c 30d24: 22 e0 ldi r18, 0x02 ; 2 30d26: 50 e0 ldi r21, 0x00 ; 0 30d28: 40 e0 ldi r20, 0x00 ; 0 30d2a: be 01 movw r22, r28 30d2c: 6f 5f subi r22, 0xFF ; 255 30d2e: 7f 4f sbci r23, 0xFF ; 255 30d30: 88 ef ldi r24, 0xF8 ; 248 30d32: 92 e0 ldi r25, 0x02 ; 2 30d34: 0f 94 4a 78 call 0x2f094 ; 0x2f094 30d38: ce 01 movw r24, r28 30d3a: 01 96 adiw r24, 0x01 ; 1 30d3c: 0e 94 b1 76 call 0xed62 ; 0xed62 30d40: bd cf rjmp .-134 ; 0x30cbc 00030d42 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 30d42: 0f 93 push r16 30d44: 1f 93 push r17 30d46: cf 93 push r28 30d48: df 93 push r29 30d4a: 1f 92 push r1 30d4c: 1f 92 push r1 30d4e: cd b7 in r28, 0x3d ; 61 30d50: de b7 in r29, 0x3e ; 62 { if(!mounted) 30d52: 20 91 91 14 lds r18, 0x1491 ; 0x801491 30d56: 22 23 and r18, r18 30d58: 69 f1 breq .+90 ; 0x30db4 30d5a: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30d5c: 80 91 23 17 lds r24, 0x1723 ; 0x801723 30d60: 88 23 and r24, r24 30d62: 79 f1 breq .+94 ; 0x30dc2 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 30d64: 8b e4 ldi r24, 0x4B ; 75 30d66: 97 ea ldi r25, 0xA7 ; 167 30d68: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 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; 30d6c: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 30d70: 1a 83 std Y+2, r17 ; 0x02 30d72: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 30d74: ce 01 movw r24, r28 30d76: 01 96 adiw r24, 0x01 ; 1 30d78: 0f 94 01 80 call 0x30002 ; 0x30002 30d7c: 88 23 and r24, r24 30d7e: d1 f0 breq .+52 ; 0x30db4 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 30d80: 49 81 ldd r20, Y+1 ; 0x01 30d82: 5a 81 ldd r21, Y+2 ; 0x02 30d84: 60 91 39 15 lds r22, 0x1539 ; 0x801539 30d88: 70 91 3a 15 lds r23, 0x153A ; 0x80153a 30d8c: 26 e5 ldi r18, 0x56 ; 86 30d8e: 80 e2 ldi r24, 0x20 ; 32 30d90: 97 e1 ldi r25, 0x17 ; 23 30d92: 0f 94 53 65 call 0x2caa6 ; 0x2caa6 30d96: 81 11 cpse r24, r1 30d98: 22 c0 rjmp .+68 ; 0x30dde SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30d9a: 8d e1 ldi r24, 0x1D ; 29 30d9c: 90 e7 ldi r25, 0x70 ; 112 30d9e: 0e 94 d0 76 call 0xeda0 ; 0xeda0 30da2: 89 81 ldd r24, Y+1 ; 0x01 30da4: 9a 81 ldd r25, Y+2 ; 0x02 30da6: 0e 94 94 87 call 0x10f28 ; 0x10f28 30daa: 8e e2 ldi r24, 0x2E ; 46 30dac: 0e 94 b7 76 call 0xed6e ; 0xed6e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30db0: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 30db4: 0f 90 pop r0 30db6: 0f 90 pop r0 30db8: df 91 pop r29 30dba: cf 91 pop r28 30dbc: 1f 91 pop r17 30dbe: 0f 91 pop r16 30dc0: 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 30dc2: 10 92 43 17 sts 0x1743, r1 ; 0x801743 SERIAL_ECHO_START; 30dc6: 82 ec ldi r24, 0xC2 ; 194 30dc8: 9a ea ldi r25, 0xAA ; 170 30dca: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHORPGM(ofNowFreshFile); 30dce: 80 e5 ldi r24, 0x50 ; 80 30dd0: 99 ea ldi r25, 0xA9 ; 169 30dd2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN(name); 30dd6: c8 01 movw r24, r16 30dd8: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 30ddc: c7 cf rjmp .-114 ; 0x30d6c 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; 30dde: 81 e0 ldi r24, 0x01 ; 1 30de0: 80 93 8e 14 sts 0x148E, r24 ; 0x80148e getfilename(0, fname); 30de4: 89 81 ldd r24, Y+1 ; 0x01 30de6: 9a 81 ldd r25, Y+2 ; 0x02 30de8: 0f 94 79 7a call 0x2f4f2 ; 0x2f4f2 SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 30dec: 89 e3 ldi r24, 0x39 ; 57 30dee: 97 ea ldi r25, 0xA7 ; 167 30df0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 printAbsFilenameFast(); 30df4: 0f 94 5c 7b call 0x2f6b8 ; 0x2f6b8 SERIAL_PROTOCOLLN(); 30df8: 0f 94 35 d6 call 0x3ac6a ; 0x3ac6a SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30dfc: 8c e2 ldi r24, 0x2C ; 44 30dfe: 99 ea ldi r25, 0xA9 ; 169 30e00: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 lcd_setstatuspgm(ofFileSelected); 30e04: 8c e2 ldi r24, 0x2C ; 44 30e06: 99 ea ldi r25, 0xA9 ; 169 30e08: 0e 94 3b f2 call 0x1e476 ; 0x1e476 scrollstuff = 0; 30e0c: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 30e10: d1 cf rjmp .-94 ; 0x30db4 00030e12 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 30e12: 0f 93 push r16 30e14: 1f 93 push r17 30e16: cf 93 push r28 30e18: df 93 push r29 30e1a: ec 01 movw r28, r24 { memset(ip, 0, 4); 30e1c: 84 e0 ldi r24, 0x04 ; 4 30e1e: fe 01 movw r30, r28 30e20: 11 92 st Z+, r1 30e22: 8a 95 dec r24 30e24: e9 f7 brne .-6 ; 0x30e20 /** 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 30e26: 23 e0 ldi r18, 0x03 ; 3 30e28: 30 ea ldi r19, 0xA0 ; 160 30e2a: 4a e0 ldi r20, 0x0A ; 10 30e2c: 50 e9 ldi r21, 0x90 ; 144 30e2e: 60 e3 ldi r22, 0x30 ; 48 30e30: 8d ef ldi r24, 0xFD ; 253 30e32: 96 e1 ldi r25, 0x16 ; 22 30e34: 0f 94 8c 53 call 0x2a718 ; 0x2a718 30e38: 88 23 and r24, r24 30e3a: 91 f0 breq .+36 ; 0x30e60 30e3c: 23 e0 ldi r18, 0x03 ; 3 30e3e: 30 ea ldi r19, 0xA0 ; 160 30e40: 4a e0 ldi r20, 0x0A ; 10 30e42: 50 e9 ldi r21, 0x90 ; 144 30e44: 61 e1 ldi r22, 0x11 ; 17 30e46: 8d ef ldi r24, 0xFD ; 253 30e48: 96 e1 ldi r25, 0x16 ; 22 30e4a: 0f 94 8c 53 call 0x2a718 ; 0x2a718 30e4e: 88 23 and r24, r24 30e50: 39 f0 breq .+14 ; 0x30e60 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30e52: 80 e8 ldi r24, 0x80 ; 128 30e54: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30e58: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 return false; 30e5c: 80 e0 ldi r24, 0x00 ; 0 30e5e: 2f c0 rjmp .+94 ; 0x30ebe //------------------------------------------------------------------------------ /** 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(); 30e60: 0f 94 51 2a call 0x254a2 ; 0x254a2 30e64: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30e66: 0f 94 85 53 call 0x2a70a ; 0x2a70a 30e6a: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 30e6e: 8f 3f cpi r24, 0xFF ; 255 30e70: 69 f4 brne .+26 ; 0x30e8c if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30e72: 0f 94 51 2a call 0x254a2 ; 0x254a2 30e76: 60 1b sub r22, r16 30e78: 71 0b sbc r23, r17 30e7a: 6d 32 cpi r22, 0x2D ; 45 30e7c: 71 40 sbci r23, 0x01 ; 1 30e7e: 98 f3 brcs .-26 ; 0x30e66 30e80: 81 e1 ldi r24, 0x11 ; 17 30e82: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd goto fail; } return true; fail: chipSelectHigh(); 30e86: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 30e8a: e6 cf rjmp .-52 ; 0x30e58 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30e8c: 8e 3f cpi r24, 0xFE ; 254 30e8e: 11 f0 breq .+4 ; 0x30e94 30e90: 8f e0 ldi r24, 0x0F ; 15 30e92: f7 cf rjmp .-18 ; 0x30e82 30e94: 8e 01 movw r16, r28 30e96: 0c 5f subi r16, 0xFC ; 252 30e98: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30e9a: 0f 94 85 53 call 0x2a70a ; 0x2a70a 30e9e: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30ea0: c0 17 cp r28, r16 30ea2: d1 07 cpc r29, r17 30ea4: d1 f7 brne .-12 ; 0x30e9a 30ea6: ce ef ldi r28, 0xFE ; 254 30ea8: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30eaa: 0f 94 85 53 call 0x2a70a ; 0x2a70a 30eae: 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) { 30eb0: e1 f7 brne .-8 ; 0x30eaa spiRec(); } chipSelectHigh(); 30eb2: 0f 94 fa 75 call 0x2ebf4 ; 0x2ebf4 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30eb6: 8f ef ldi r24, 0xFF ; 255 30eb8: 0f 94 80 53 call 0x2a700 ; 0x2a700 30ebc: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30ebe: df 91 pop r29 30ec0: cf 91 pop r28 30ec2: 1f 91 pop r17 30ec4: 0f 91 pop r16 30ec6: 08 95 ret 00030ec8 : } 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) 30ec8: 8f 92 push r8 30eca: 9f 92 push r9 30ecc: af 92 push r10 30ece: bf 92 push r11 30ed0: cf 92 push r12 30ed2: df 92 push r13 30ed4: ef 92 push r14 30ed6: ff 92 push r15 30ed8: 0f 93 push r16 30eda: 1f 93 push r17 30edc: cf 93 push r28 30ede: df 93 push r29 30ee0: 1f 92 push r1 30ee2: cd b7 in r28, 0x3d ; 61 30ee4: de b7 in r29, 0x3e ; 62 30ee6: 6b 01 movw r12, r22 30ee8: 7c 01 movw r14, r24 30eea: 49 01 movw r8, r18 30eec: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30eee: 03 30 cpi r16, 0x03 ; 3 30ef0: 19 f4 brne .+6 ; 0x30ef8 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30ef2: 8c e5 ldi r24, 0x5C ; 92 30ef4: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30ef6: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30ef8: 81 14 cp r8, r1 30efa: 91 04 cpc r9, r1 30efc: a1 04 cpc r10, r1 30efe: b1 04 cpc r11, r1 30f00: 09 f4 brne .+2 ; 0x30f04 30f02: 59 c0 rjmp .+178 ; 0x30fb6 #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30f04: 8e 2d mov r24, r14 30f06: 0e 94 31 76 call 0xec62 ; 0xec62 #endif print_hex_byte((val >> 8) & 0xFF); 30f0a: 8d 2d mov r24, r13 30f0c: 0e 94 31 76 call 0xec62 ; 0xec62 print_hex_byte(val & 0xFF); 30f10: 8c 2d mov r24, r12 30f12: 0e 94 31 76 call 0xec62 ; 0xec62 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30f16: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30f1a: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30f1e: 80 e2 ldi r24, 0x20 ; 32 30f20: 90 e0 ldi r25, 0x00 ; 0 30f22: 0f 94 bc da call 0x3b578 ; 0x3b578 uint8_t count_line = countperline; 30f26: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30f28: 19 82 std Y+1, r1 ; 0x01 switch (type) 30f2a: 01 30 cpi r16, 0x01 ; 1 30f2c: b1 f1 breq .+108 ; 0x30f9a 30f2e: 88 f1 brcs .+98 ; 0x30f92 30f30: 03 30 cpi r16, 0x03 ; 3 30f32: b9 f1 breq .+110 ; 0x30fa2 case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30f34: 8f ef ldi r24, 0xFF ; 255 30f36: c8 1a sub r12, r24 30f38: d8 0a sbc r13, r24 30f3a: e8 0a sbc r14, r24 30f3c: f8 0a sbc r15, r24 putchar(' '); 30f3e: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30f42: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30f46: 80 e2 ldi r24, 0x20 ; 32 30f48: 90 e0 ldi r25, 0x00 ; 0 30f4a: 0f 94 bc da call 0x3b578 ; 0x3b578 print_hex_byte(data); 30f4e: 89 81 ldd r24, Y+1 ; 0x01 30f50: 0e 94 31 76 call 0xec62 ; 0xec62 count_line--; 30f54: 11 50 subi r17, 0x01 ; 1 count--; 30f56: 81 e0 ldi r24, 0x01 ; 1 30f58: 88 1a sub r8, r24 30f5a: 91 08 sbc r9, r1 30f5c: a1 08 sbc r10, r1 30f5e: 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)) 30f60: 0f b6 in r0, 0x3f ; 63 30f62: 07 fe sbrs r0, 7 30f64: 06 c0 rjmp .+12 ; 0x30f72 30f66: c4 01 movw r24, r8 30f68: 9f 71 andi r25, 0x1F ; 31 30f6a: 89 2b or r24, r25 30f6c: 11 f4 brne .+4 ; 0x30f72 manage_heater(); 30f6e: 0f 94 61 39 call 0x272c2 ; 0x272c2 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30f72: 81 14 cp r8, r1 30f74: 91 04 cpc r9, r1 30f76: a1 04 cpc r10, r1 30f78: b1 04 cpc r11, r1 30f7a: 11 f0 breq .+4 ; 0x30f80 30f7c: 11 11 cpse r17, r1 30f7e: d4 cf rjmp .-88 ; 0x30f28 // 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'); 30f80: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30f84: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30f88: 8a e0 ldi r24, 0x0A ; 10 30f8a: 90 e0 ldi r25, 0x00 ; 0 30f8c: 0f 94 bc da call 0x3b578 ; 0x3b578 30f90: b3 cf rjmp .-154 ; 0x30ef8 while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30f92: f6 01 movw r30, r12 30f94: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30f96: 89 83 std Y+1, r24 ; 0x01 30f98: cd cf rjmp .-102 ; 0x30f34 30f9a: c6 01 movw r24, r12 30f9c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 30fa0: fa cf rjmp .-12 ; 0x30f96 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; 30fa2: 21 e0 ldi r18, 0x01 ; 1 30fa4: 30 e0 ldi r19, 0x00 ; 0 30fa6: ae 01 movw r20, r28 30fa8: 4f 5f subi r20, 0xFF ; 255 30faa: 5f 4f sbci r21, 0xFF ; 255 30fac: c7 01 movw r24, r14 30fae: b6 01 movw r22, r12 30fb0: 0e 94 c5 ed call 0x1db8a ; 0x1db8a 30fb4: bf cf rjmp .-130 ; 0x30f34 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30fb6: 0f 90 pop r0 30fb8: df 91 pop r29 30fba: cf 91 pop r28 30fbc: 1f 91 pop r17 30fbe: 0f 91 pop r16 30fc0: ff 90 pop r15 30fc2: ef 90 pop r14 30fc4: df 90 pop r13 30fc6: cf 90 pop r12 30fc8: bf 90 pop r11 30fca: af 90 pop r10 30fcc: 9f 90 pop r9 30fce: 8f 90 pop r8 30fd0: 08 95 ret 00030fd2 : #include "planner.h" #include "temperature.h" #include "ultralcd.h" #ifdef FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { 30fd2: cf 93 push r28 30fd4: df 93 push r29 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 30fd6: ca ea ldi r28, 0xAA ; 170 30fd8: d7 e1 ldi r29, 0x17 ; 23 30fda: 1a 82 std Y+2, r1 ; 0x02 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 30fdc: 19 82 std Y+1, r1 ; 0x01 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 30fde: 1e 86 std Y+14, r1 ; 0x0e oldPos = pat9125_y; 30fe0: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 30fe4: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 30fe8: 98 8b std Y+16, r25 ; 0x10 30fea: 8f 87 std Y+15, r24 ; 0x0f resetStepCount(); 30fec: 0f 94 25 7c call 0x2f84a ; 0x2f84a jamErrCnt = 0; 30ff0: 1d 8a std Y+21, r1 ; 0x15 fsensor.setAutoLoadEnabled(false); //suppress filament autoloads while loading filament. #if (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.setJamDetectionEnabled(false); //suppress filament jam detection while loading filament. #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } 30ff2: df 91 pop r29 30ff4: cf 91 pop r28 30ff6: 08 95 ret 00030ff8 : //! //! @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) 30ff8: cf 92 push r12 30ffa: df 92 push r13 30ffc: ef 92 push r14 30ffe: ff 92 push r15 31000: 69 01 movw r12, r18 31002: 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); 31004: 2d ec ldi r18, 0xCD ; 205 31006: 3c ec ldi r19, 0xCC ; 204 31008: 4c e4 ldi r20, 0x4C ; 76 3100a: 5e e3 ldi r21, 0x3E ; 62 3100c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 31010: 2d ec ldi r18, 0xCD ; 205 31012: 3c ec ldi r19, 0xCC ; 204 31014: 4c e4 ldi r20, 0x4C ; 76 31016: 5e e3 ldi r21, 0x3E ; 62 31018: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3101c: 2d ef ldi r18, 0xFD ; 253 3101e: 3d ea ldi r19, 0xAD ; 173 31020: 40 e0 ldi r20, 0x00 ; 0 31022: 5d e3 ldi r21, 0x3D ; 61 31024: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 31028: a7 01 movw r20, r14 3102a: 96 01 movw r18, r12 3102c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 31030: 24 e2 ldi r18, 0x24 ; 36 31032: 30 ef ldi r19, 0xF0 ; 240 31034: 49 e1 ldi r20, 0x19 ; 25 31036: 50 e4 ldi r21, 0x40 ; 64 31038: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> } 3103c: ff 90 pop r15 3103e: ef 90 pop r14 31040: df 90 pop r13 31042: cf 90 pop r12 31044: 08 95 ret 00031046 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 31046: 9f b7 in r25, 0x3f ; 63 31048: 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)); 3104a: 80 e1 ldi r24, 0x10 ; 16 3104c: e3 ea ldi r30, 0xA3 ; 163 3104e: f6 e0 ldi r31, 0x06 ; 6 31050: a3 eb ldi r26, 0xB3 ; 179 31052: b6 e0 ldi r27, 0x06 ; 6 31054: 01 90 ld r0, Z+ 31056: 0d 92 st X+, r0 31058: 8a 95 dec r24 3105a: e1 f7 brne .-8 ; 0x31054 CRITICAL_SECTION_END; 3105c: 9f bf out 0x3f, r25 ; 63 } 3105e: 08 95 ret 00031060 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 31060: 89 e0 ldi r24, 0x09 ; 9 31062: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 }; 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])) 31066: e1 e6 ldi r30, 0x61 ; 97 31068: f7 ea ldi r31, 0xA7 ; 167 3106a: 85 91 lpm r24, Z+ 3106c: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 3106e: 0e 94 2c 72 call 0xe458 ; 0xe458 31072: 0c 94 3b f2 jmp 0x1e476 ; 0x1e476 00031076 : 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){ 31076: cf 93 push r28 31078: c8 2f mov r28, r24 extruder = ex; 3107a: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 3107e: 82 ec ldi r24, 0xC2 ; 194 31080: 9a ea ldi r25, 0xAA ; 170 31082: 0e 94 d0 76 call 0xeda0 ; 0xeda0 31086: 83 e3 ldi r24, 0x33 ; 51 31088: 97 ea ldi r25, 0xA7 ; 167 3108a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 3108e: 89 e2 ldi r24, 0x29 ; 41 31090: 97 ea ldi r25, 0xA7 ; 167 31092: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN((int)ex); 31096: 8c 2f mov r24, r28 31098: 90 e0 ldi r25, 0x00 ; 0 } 3109a: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 3109c: 0d 94 30 76 jmp 0x2ec60 ; 0x2ec60 000310a0 : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 310a0: 0f 93 push r16 310a2: 1f 93 push r17 310a4: cf 93 push r28 310a6: df 93 push r29 310a8: 00 d0 rcall .+0 ; 0x310aa 310aa: 00 d0 rcall .+0 ; 0x310ac 310ac: 1f 92 push r1 310ae: 1f 92 push r1 310b0: cd b7 in r28, 0x3d ; 61 310b2: de b7 in r29, 0x3e ; 62 310b4: 08 ee ldi r16, 0xE8 ; 232 310b6: 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; 310b8: 1d 82 std Y+5, r1 ; 0x05 310ba: 1e 82 std Y+6, r1 ; 0x06 310bc: 1f 82 std Y+7, r1 ; 0x07 310be: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 310c0: 19 82 std Y+1, r1 ; 0x01 310c2: 1a 82 std Y+2, r1 ; 0x02 310c4: 1b 82 std Y+3, r1 ; 0x03 310c6: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 310c8: ae 01 movw r20, r28 310ca: 4b 5f subi r20, 0xFB ; 251 310cc: 5f 4f sbci r21, 0xFF ; 255 310ce: 6f e6 ldi r22, 0x6F ; 111 310d0: 80 e0 ldi r24, 0x00 ; 0 310d2: 0f 94 f6 24 call 0x249ec ; 0x249ec tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 310d6: ae 01 movw r20, r28 310d8: 4f 5f subi r20, 0xFF ; 255 310da: 5f 4f sbci r21, 0xFF ; 255 310dc: 6f e6 ldi r22, 0x6F ; 111 310de: 81 e0 ldi r24, 0x01 ; 1 310e0: 0f 94 f6 24 call 0x249ec ; 0x249ec // 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); 310e4: 8d 81 ldd r24, Y+5 ; 0x05 310e6: 9e 81 ldd r25, Y+6 ; 0x06 310e8: af 81 ldd r26, Y+7 ; 0x07 310ea: b8 85 ldd r27, Y+8 ; 0x08 310ec: b7 fd sbrc r27, 7 310ee: 07 c0 rjmp .+14 ; 0x310fe tmc2130_check_overtemp(); 310f0: 0f 94 ec 2a call 0x255d8 ; 0x255d8 310f4: 01 50 subi r16, 0x01 ; 1 310f6: 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)) 310f8: f9 f6 brne .-66 ; 0x310b8 310fa: 80 e0 ldi r24, 0x00 ; 0 310fc: 09 c0 rjmp .+18 ; 0x31110 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); 310fe: 89 81 ldd r24, Y+1 ; 0x01 31100: 9a 81 ldd r25, Y+2 ; 0x02 31102: ab 81 ldd r26, Y+3 ; 0x03 31104: bc 81 ldd r27, Y+4 ; 0x04 31106: b7 ff sbrs r27, 7 31108: f3 cf rjmp .-26 ; 0x310f0 tmc2130_check_overtemp(); 3110a: 0f 94 ec 2a call 0x255d8 ; 0x255d8 3110e: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 31110: 28 96 adiw r28, 0x08 ; 8 31112: 0f b6 in r0, 0x3f ; 63 31114: f8 94 cli 31116: de bf out 0x3e, r29 ; 62 31118: 0f be out 0x3f, r0 ; 63 3111a: cd bf out 0x3d, r28 ; 61 3111c: df 91 pop r29 3111e: cf 91 pop r28 31120: 1f 91 pop r17 31122: 0f 91 pop r16 31124: 08 95 ret 00031126 : 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) { 31126: 1f 93 push r17 31128: cf 93 push r28 3112a: df 93 push r29 3112c: ec 01 movw r28, r24 3112e: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 31130: 0f 94 ed 43 call 0x287da ; 0x287da 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))); 31134: fe 01 movw r30, r28 31136: 34 96 adiw r30, 0x04 ; 4 31138: 25 91 lpm r18, Z+ 3113a: 35 91 lpm r19, Z+ 3113c: 45 91 lpm r20, Z+ 3113e: 54 91 lpm r21, Z 31140: fe 01 movw r30, r28 31142: 65 91 lpm r22, Z+ 31144: 75 91 lpm r23, Z+ 31146: 85 91 lpm r24, Z+ 31148: 94 91 lpm r25, Z 3114a: 0f 94 e9 c5 call 0x38bd2 ; 0x38bd2 step++; 3114e: 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) { 31150: 11 50 subi r17, 0x01 ; 1 31152: 81 f7 brne .-32 ; 0x31134 31154: 0f 94 ed 43 call 0x287da ; 0x287da // 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(); } 31158: df 91 pop r29 3115a: cf 91 pop r28 3115c: 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(); 3115e: 0d 94 e7 c5 jmp 0x38bce ; 0x38bce 00031162 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 31162: 0e 94 10 67 call 0xce20 ; 0xce20 31166: 81 11 cpse r24, r1 31168: 04 c0 rjmp .+8 ; 0x31172 lcd_setstatuspgm(MSG_WELCOME); 3116a: 8f ec ldi r24, 0xCF ; 207 3116c: 9f e6 ldi r25, 0x6F ; 111 3116e: 0e 94 3b f2 call 0x1e476 ; 0x1e476 } custom_message_type = CustomMsg::Status; 31172: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } 31176: 08 95 ret 00031178 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 31178: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 3117c: 88 23 and r24, r24 3117e: 11 f0 breq .+4 ; 0x31184 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; 31180: 81 e0 ldi r24, 0x01 ; 1 31182: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 31184: 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; } } 31186: 08 95 ret 00031188 : } 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) 31188: 2f 92 push r2 3118a: 3f 92 push r3 3118c: 4f 92 push r4 3118e: 5f 92 push r5 31190: 6f 92 push r6 31192: 7f 92 push r7 31194: 8f 92 push r8 31196: 9f 92 push r9 31198: af 92 push r10 3119a: bf 92 push r11 3119c: cf 92 push r12 3119e: df 92 push r13 311a0: ef 92 push r14 311a2: ff 92 push r15 311a4: 0f 93 push r16 311a6: 1f 93 push r17 311a8: cf 93 push r28 311aa: df 93 push r29 311ac: cd b7 in r28, 0x3d ; 61 311ae: de b7 in r29, 0x3e ; 62 311b0: 2d 97 sbiw r28, 0x0d ; 13 311b2: 0f b6 in r0, 0x3f ; 63 311b4: f8 94 cli 311b6: de bf out 0x3e, r29 ; 62 311b8: 0f be out 0x3f, r0 ; 63 311ba: cd bf out 0x3d, r28 ; 61 311bc: 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; 311be: 41 2c mov r4, r1 311c0: 51 2c mov r5, r1 311c2: 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; 311c4: 6e 31 cpi r22, 0x1E ; 30 311c6: 90 f0 brcs .+36 ; 0x311ec 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 311c8: 69 3c cpi r22, 0xC9 ; 201 311ca: 08 f0 brcs .+2 ; 0x311ce 311cc: 68 ec ldi r22, 0xC8 ; 200 311ce: 70 e0 ldi r23, 0x00 ; 0 311d0: 68 51 subi r22, 0x18 ; 24 311d2: 7c 4f sbci r23, 0xFC ; 252 311d4: 90 e0 ldi r25, 0x00 ; 0 311d6: 80 e0 ldi r24, 0x00 ; 0 311d8: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 311dc: 20 e0 ldi r18, 0x00 ; 0 311de: 30 e0 ldi r19, 0x00 ; 0 311e0: 4a e7 ldi r20, 0x7A ; 122 311e2: 54 e4 ldi r21, 0x44 ; 68 311e4: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 311e8: 2b 01 movw r4, r22 311ea: 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) 311ec: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 311f0: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 311f4: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 311f8: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 311fc: 89 83 std Y+1, r24 ; 0x01 311fe: 9a 83 std Y+2, r25 ; 0x02 31200: ab 83 std Y+3, r26 ; 0x03 31202: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 31204: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 31208: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 3120c: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 31210: 8d 83 std Y+5, r24 ; 0x05 31212: 9e 83 std Y+6, r25 ; 0x06 31214: 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); 31216: 20 e0 ldi r18, 0x00 ; 0 31218: 30 e0 ldi r19, 0x00 ; 0 3121a: 47 ef ldi r20, 0xF7 ; 247 3121c: 50 e0 ldi r21, 0x00 ; 0 3121e: 69 ee ldi r22, 0xE9 ; 233 31220: 8e 2d mov r24, r14 31222: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 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 31226: 81 2c mov r8, r1 31228: 91 2c mov r9, r1 3122a: 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 3122c: 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 3122e: 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 31230: 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 31232: 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 31234: 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) 31236: 2f 2c mov r2, r15 31238: 31 2c mov r3, r1 3123a: 8f 2d mov r24, r15 3123c: 8f 71 andi r24, 0x1F ; 31 3123e: 88 87 std Y+8, r24 ; 0x08 31240: 81 11 cpse r24, r1 31242: 03 c0 rjmp .+6 ; 0x3124a reg = 0; 31244: 81 2c mov r8, r1 31246: 91 2c mov r9, r1 31248: 54 01 movw r10, r8 3124a: b1 01 movw r22, r2 3124c: 03 2c mov r0, r3 3124e: 00 0c add r0, r0 31250: 88 0b sbc r24, r24 31252: 99 0b sbc r25, r25 31254: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 31258: 2b ed ldi r18, 0xDB ; 219 3125a: 3f e0 ldi r19, 0x0F ; 15 3125c: 49 ec ldi r20, 0xC9 ; 201 3125e: 50 e4 ldi r21, 0x40 ; 64 31260: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 31264: 6a 87 std Y+10, r22 ; 0x0a 31266: 7b 87 std Y+11, r23 ; 0x0b 31268: 8c 87 std Y+12, r24 ; 0x0c 3126a: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 3126c: 20 e0 ldi r18, 0x00 ; 0 3126e: 30 e0 ldi r19, 0x00 ; 0 31270: a9 01 movw r20, r18 31272: c3 01 movw r24, r6 31274: b2 01 movw r22, r4 31276: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 3127a: 81 11 cpse r24, r1 3127c: 4d c0 rjmp .+154 ; 0x31318 vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 3127e: 2b ed ldi r18, 0xDB ; 219 31280: 3f e0 ldi r19, 0x0F ; 15 31282: 49 e4 ldi r20, 0x49 ; 73 31284: 50 e4 ldi r21, 0x40 ; 64 31286: 6a 85 ldd r22, Y+10 ; 0x0a 31288: 7b 85 ldd r23, Y+11 ; 0x0b 3128a: 8c 85 ldd r24, Y+12 ; 0x0c 3128c: 9d 85 ldd r25, Y+13 ; 0x0d 3128e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 31292: 20 e0 ldi r18, 0x00 ; 0 31294: 30 e0 ldi r19, 0x00 ; 0 31296: 40 e8 ldi r20, 0x80 ; 128 31298: 5a e3 ldi r21, 0x3A ; 58 3129a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3129e: 0f 94 3c e1 call 0x3c278 ; 0x3c278 312a2: 20 e0 ldi r18, 0x00 ; 0 312a4: 30 e0 ldi r19, 0x00 ; 0 312a6: 48 e7 ldi r20, 0x78 ; 120 312a8: 53 e4 ldi r21, 0x43 ; 67 312aa: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 312ae: 20 e0 ldi r18, 0x00 ; 0 312b0: 30 e0 ldi r19, 0x00 ; 0 312b2: 40 e0 ldi r20, 0x00 ; 0 312b4: 5f e3 ldi r21, 0x3F ; 63 312b6: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 312ba: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 312be: cc 24 eor r12, r12 312c0: ca 94 dec r12 312c2: 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 312c4: 8c 2d mov r24, r12 312c6: 99 85 ldd r25, Y+9 ; 0x09 312c8: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 312ca: 8d 15 cp r24, r13 312cc: f9 f0 breq .+62 ; 0x3130c else if (dA == d1) b = 1; //delta == delta1 => bit=1 312ce: 80 17 cp r24, r16 312d0: 09 f4 brne .+2 ; 0x312d4 312d2: 71 c0 rjmp .+226 ; 0x313b6 else { if (dA < d0) // delta < delta0 => switch wbit down 312d4: 8d 15 cp r24, r13 312d6: 0c f0 brlt .+2 ; 0x312da 312d8: 53 c0 rjmp .+166 ; 0x31380 { //printf("dn\n"); b = 0; switch (dA) 312da: 88 23 and r24, r24 312dc: e9 f1 breq .+122 ; 0x31358 312de: 81 30 cpi r24, 0x01 ; 1 312e0: 09 f4 brne .+2 ; 0x312e4 312e2: 44 c0 rjmp .+136 ; 0x3136c 312e4: 8f 3f cpi r24, 0xFF ; 255 312e6: 09 f0 breq .+2 ; 0x312ea 312e8: 81 c0 rjmp .+258 ; 0x313ec { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 312ea: e2 e0 ldi r30, 0x02 ; 2 312ec: f0 e0 ldi r31, 0x00 ; 0 312ee: ec 0f add r30, r28 312f0: fd 1f adc r31, r29 312f2: e1 0f add r30, r17 312f4: f1 1d adc r31, r1 312f6: 10 82 st Z, r1 312f8: 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++; } 312fa: e5 e0 ldi r30, 0x05 ; 5 312fc: f0 e0 ldi r31, 0x00 ; 0 312fe: ec 0f add r30, r28 31300: fd 1f adc r31, r29 31302: e1 0f add r30, r17 31304: f1 1d adc r31, r1 31306: f0 82 st Z, r15 31308: 1f 5f subi r17, 0xFF ; 255 3130a: 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) 3130c: 14 30 cpi r17, 0x04 ; 4 3130e: 08 f4 brcc .+2 ; 0x31312 31310: 56 c0 rjmp .+172 ; 0x313be 31312: 6c c0 rjmp .+216 ; 0x313ec 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: f8 2e mov r15, r24 31316: 8f cf rjmp .-226 ; 0x31236 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); 31318: 20 e0 ldi r18, 0x00 ; 0 3131a: 30 e0 ldi r19, 0x00 ; 0 3131c: 40 e8 ldi r20, 0x80 ; 128 3131e: 5a e3 ldi r21, 0x3A ; 58 31320: 6a 85 ldd r22, Y+10 ; 0x0a 31322: 7b 85 ldd r23, Y+11 ; 0x0b 31324: 8c 85 ldd r24, Y+12 ; 0x0c 31326: 9d 85 ldd r25, Y+13 ; 0x0d 31328: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3132c: 0f 94 3c e1 call 0x3c278 ; 0x3c278 31330: a3 01 movw r20, r6 31332: 92 01 movw r18, r4 31334: 0f 94 ec e0 call 0x3c1d8 ; 0x3c1d8 31338: 20 e0 ldi r18, 0x00 ; 0 3133a: 30 e0 ldi r19, 0x00 ; 0 3133c: 47 e7 ldi r20, 0x77 ; 119 3133e: 53 e4 ldi r21, 0x43 ; 67 31340: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 31344: 20 e0 ldi r18, 0x00 ; 0 31346: 30 e0 ldi r19, 0x00 ; 0 31348: 40 e0 ldi r20, 0x00 ; 0 3134a: 5f e3 ldi r21, 0x3F ; 63 3134c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 31350: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 31354: c6 2e mov r12, r22 31356: b6 cf rjmp .-148 ; 0x312c4 //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; 31358: e2 e0 ldi r30, 0x02 ; 2 3135a: f0 e0 ldi r31, 0x00 ; 0 3135c: ec 0f add r30, r28 3135e: fd 1f adc r31, r29 31360: e1 0f add r30, r17 31362: f1 1d adc r31, r1 31364: 91 e0 ldi r25, 0x01 ; 1 31366: 90 83 st Z, r25 31368: 01 e0 ldi r16, 0x01 ; 1 3136a: c7 cf rjmp .-114 ; 0x312fa case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 3136c: e2 e0 ldi r30, 0x02 ; 2 3136e: f0 e0 ldi r31, 0x00 ; 0 31370: ec 0f add r30, r28 31372: fd 1f adc r31, r29 31374: e1 0f add r30, r17 31376: f1 1d adc r31, r1 31378: 92 e0 ldi r25, 0x02 ; 2 3137a: 90 83 st Z, r25 3137c: 02 e0 ldi r16, 0x02 ; 2 3137e: bd cf rjmp .-134 ; 0x312fa default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 31380: 08 17 cp r16, r24 31382: a4 f5 brge .+104 ; 0x313ec { //printf("up\n"); b = 1; switch (dA) 31384: 82 30 cpi r24, 0x02 ; 2 31386: 09 f4 brne .+2 ; 0x3138a 31388: 80 c0 rjmp .+256 ; 0x3148a 3138a: 83 30 cpi r24, 0x03 ; 3 3138c: 09 f4 brne .+2 ; 0x31390 3138e: 88 c0 rjmp .+272 ; 0x314a0 31390: 81 30 cpi r24, 0x01 ; 1 31392: 61 f5 brne .+88 ; 0x313ec { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 31394: e2 e0 ldi r30, 0x02 ; 2 31396: f0 e0 ldi r31, 0x00 ; 0 31398: ec 0f add r30, r28 3139a: fd 1f adc r31, r29 3139c: e1 0f add r30, r17 3139e: f1 1d adc r31, r1 313a0: 80 83 st Z, r24 313a2: 01 e0 ldi r16, 0x01 ; 1 313a4: 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++; } 313a6: e5 e0 ldi r30, 0x05 ; 5 313a8: f0 e0 ldi r31, 0x00 ; 0 313aa: ec 0f add r30, r28 313ac: fd 1f adc r31, r29 313ae: e1 0f add r30, r17 313b0: f1 1d adc r31, r1 313b2: f0 82 st Z, r15 313b4: 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) 313b6: 14 30 cpi r17, 0x04 ; 4 313b8: c8 f4 brcc .+50 ; 0x313ec //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 313ba: 68 94 set 313bc: b7 f8 bld r11, 7 if ((i & 31) == 31) 313be: 88 85 ldd r24, Y+8 ; 0x08 313c0: 8f 31 cpi r24, 0x1F ; 31 313c2: 09 f0 breq .+2 ; 0x313c6 313c4: 78 c0 rjmp .+240 ; 0x314b6 tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 313c6: b1 01 movw r22, r2 313c8: e5 e0 ldi r30, 0x05 ; 5 313ca: 75 95 asr r23 313cc: 67 95 ror r22 313ce: ea 95 dec r30 313d0: e1 f7 brne .-8 ; 0x313ca //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); 313d2: 60 5a subi r22, 0xA0 ; 160 313d4: 60 68 ori r22, 0x80 ; 128 313d6: a5 01 movw r20, r10 313d8: 94 01 movw r18, r8 313da: 8e 2d mov r24, r14 313dc: 0f 94 50 25 call 0x24aa0 ; 0x24aa0 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); 313e0: 81 e0 ldi r24, 0x01 ; 1 313e2: 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; 313e4: 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); 313e6: 9f ef ldi r25, 0xFF ; 255 313e8: f9 12 cpse r15, r25 313ea: 94 cf rjmp .-216 ; 0x31314 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; 313ec: 2a 81 ldd r18, Y+2 ; 0x02 313ee: 30 e0 ldi r19, 0x00 ; 0 313f0: 50 e0 ldi r21, 0x00 ; 0 313f2: 40 e0 ldi r20, 0x00 ; 0 313f4: 82 e0 ldi r24, 0x02 ; 2 313f6: 22 0f add r18, r18 313f8: 33 1f adc r19, r19 313fa: 44 1f adc r20, r20 313fc: 55 1f adc r21, r21 313fe: 8a 95 dec r24 31400: d1 f7 brne .-12 ; 0x313f6 val |= ((uint32_t)w2) << 4; 31402: 8b 80 ldd r8, Y+3 ; 0x03 31404: 91 2c mov r9, r1 31406: b1 2c mov r11, r1 31408: a1 2c mov r10, r1 3140a: 94 e0 ldi r25, 0x04 ; 4 3140c: 88 0c add r8, r8 3140e: 99 1c adc r9, r9 31410: aa 1c adc r10, r10 31412: bb 1c adc r11, r11 31414: 9a 95 dec r25 31416: d1 f7 brne .-12 ; 0x3140c 31418: 82 2a or r8, r18 3141a: 93 2a or r9, r19 3141c: a4 2a or r10, r20 3141e: 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); 31420: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 31422: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 31424: 8c 81 ldd r24, Y+4 ; 0x04 31426: 90 e0 ldi r25, 0x00 ; 0 31428: b0 e0 ldi r27, 0x00 ; 0 3142a: a0 e0 ldi r26, 0x00 ; 0 3142c: 9c 01 movw r18, r24 3142e: ad 01 movw r20, r26 31430: 66 e0 ldi r22, 0x06 ; 6 31432: 22 0f add r18, r18 31434: 33 1f adc r19, r19 31436: 44 1f adc r20, r20 31438: 55 1f adc r21, r21 3143a: 6a 95 dec r22 3143c: d1 f7 brne .-12 ; 0x31432 3143e: 28 29 or r18, r8 31440: 39 29 or r19, r9 31442: 4a 29 or r20, r10 31444: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 31446: 8d 81 ldd r24, Y+5 ; 0x05 31448: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 3144a: 8e 81 ldd r24, Y+6 ; 0x06 3144c: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 3144e: 8f 81 ldd r24, Y+7 ; 0x07 31450: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 31452: 68 ee ldi r22, 0xE8 ; 232 31454: 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]); } 31456: 2d 96 adiw r28, 0x0d ; 13 31458: 0f b6 in r0, 0x3f ; 63 3145a: f8 94 cli 3145c: de bf out 0x3e, r29 ; 62 3145e: 0f be out 0x3f, r0 ; 63 31460: cd bf out 0x3d, r28 ; 61 31462: df 91 pop r29 31464: cf 91 pop r28 31466: 1f 91 pop r17 31468: 0f 91 pop r16 3146a: ff 90 pop r15 3146c: ef 90 pop r14 3146e: df 90 pop r13 31470: cf 90 pop r12 31472: bf 90 pop r11 31474: af 90 pop r10 31476: 9f 90 pop r9 31478: 8f 90 pop r8 3147a: 7f 90 pop r7 3147c: 6f 90 pop r6 3147e: 5f 90 pop r5 31480: 4f 90 pop r4 31482: 3f 90 pop r3 31484: 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); 31486: 0d 94 50 25 jmp 0x24aa0 ; 0x24aa0 //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; 3148a: e2 e0 ldi r30, 0x02 ; 2 3148c: f0 e0 ldi r31, 0x00 ; 0 3148e: ec 0f add r30, r28 31490: fd 1f adc r31, r29 31492: e1 0f add r30, r17 31494: f1 1d adc r31, r1 31496: 80 83 st Z, r24 31498: 02 e0 ldi r16, 0x02 ; 2 3149a: dd 24 eor r13, r13 3149c: d3 94 inc r13 3149e: 83 cf rjmp .-250 ; 0x313a6 case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 314a0: e2 e0 ldi r30, 0x02 ; 2 314a2: f0 e0 ldi r31, 0x00 ; 0 314a4: ec 0f add r30, r28 314a6: fd 1f adc r31, r29 314a8: e1 0f add r30, r17 314aa: f1 1d adc r31, r1 314ac: 80 83 st Z, r24 314ae: 03 e0 ldi r16, 0x03 ; 3 314b0: f2 e0 ldi r31, 0x02 ; 2 314b2: df 2e mov r13, r31 314b4: 78 cf rjmp .-272 ; 0x313a6 //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; 314b6: b6 94 lsr r11 314b8: a7 94 ror r10 314ba: 97 94 ror r9 314bc: 87 94 ror r8 314be: 90 cf rjmp .-224 ; 0x313e0 000314c0 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 314c0: 8f 92 push r8 314c2: 9f 92 push r9 314c4: af 92 push r10 314c6: bf 92 push r11 314c8: cf 92 push r12 314ca: df 92 push r13 314cc: ef 92 push r14 314ce: ff 92 push r15 314d0: 90 91 8e 06 lds r25, 0x068E ; 0x80068e // 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]) { 314d4: 88 23 and r24, r24 314d6: 09 f4 brne .+2 ; 0x314da 314d8: 9d c0 rjmp .+314 ; 0x31614 314da: 91 11 cpse r25, r1 314dc: 92 c0 rjmp .+292 ; 0x31602 st_synchronize(); 314de: 0f 94 ed 43 call 0x287da ; 0x287da set_destination_to_current(); 314e2: 0e 94 ba 67 call 0xcf74 ; 0xcf74 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 314e6: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 314ea: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 314ee: 07 2e mov r0, r23 314f0: 00 0c add r0, r0 314f2: 88 0b sbc r24, r24 314f4: 99 0b sbc r25, r25 314f6: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 314fa: 20 91 41 0e lds r18, 0x0E41 ; 0x800e41 314fe: 30 91 42 0e lds r19, 0x0E42 ; 0x800e42 31502: 40 91 43 0e lds r20, 0x0E43 ; 0x800e43 31506: 50 91 44 0e lds r21, 0x0E44 ; 0x800e44 3150a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3150e: 2a e0 ldi r18, 0x0A ; 10 31510: 37 ed ldi r19, 0xD7 ; 215 31512: 43 e2 ldi r20, 0x23 ; 35 31514: 5c e3 ldi r21, 0x3C ; 60 31516: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3151a: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 3151e: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 31522: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 31526: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 3152a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 3152e: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 31532: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 31536: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 3153a: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); 3153e: 8e e9 ldi r24, 0x9E ; 158 31540: 96 e0 ldi r25, 0x06 ; 6 31542: 0f 94 f9 64 call 0x2c9f2 ; 0x2c9f2 float oldFeedrate = feedrate; 31546: c0 90 b8 02 lds r12, 0x02B8 ; 0x8002b8 3154a: d0 90 b9 02 lds r13, 0x02B9 ; 0x8002b9 3154e: e0 90 ba 02 lds r14, 0x02BA ; 0x8002ba 31552: f0 90 bb 02 lds r15, 0x02BB ; 0x8002bb feedrate=cs.retract_feedrate*60; 31556: 20 e0 ldi r18, 0x00 ; 0 31558: 30 e0 ldi r19, 0x00 ; 0 3155a: 40 e7 ldi r20, 0x70 ; 112 3155c: 52 e4 ldi r21, 0x42 ; 66 3155e: 60 91 45 0e lds r22, 0x0E45 ; 0x800e45 31562: 70 91 46 0e lds r23, 0x0E46 ; 0x800e46 31566: 80 91 47 0e lds r24, 0x0E47 ; 0x800e47 3156a: 90 91 48 0e lds r25, 0x0E48 ; 0x800e48 3156e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 31572: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 31576: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 3157a: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba 3157e: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb retracted[active_extruder]=true; 31582: 81 e0 ldi r24, 0x01 ; 1 31584: 80 93 8e 06 sts 0x068E, r24 ; 0x80068e prepare_move(); 31588: 90 e0 ldi r25, 0x00 ; 0 3158a: 80 e0 ldi r24, 0x00 ; 0 3158c: 0e 94 88 6b call 0xd710 ; 0xd710 if(cs.retract_zlift) { 31590: 20 e0 ldi r18, 0x00 ; 0 31592: 30 e0 ldi r19, 0x00 ; 0 31594: a9 01 movw r20, r18 31596: 60 91 49 0e lds r22, 0x0E49 ; 0x800e49 3159a: 70 91 4a 0e lds r23, 0x0E4A ; 0x800e4a 3159e: 80 91 4b 0e lds r24, 0x0E4B ; 0x800e4b 315a2: 90 91 4c 0e lds r25, 0x0E4C ; 0x800e4c 315a6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 315aa: 88 23 and r24, r24 315ac: 11 f1 breq .+68 ; 0x315f2 st_synchronize(); 315ae: 0f 94 ed 43 call 0x287da ; 0x287da current_position[Z_AXIS]-=cs.retract_zlift; 315b2: 20 91 49 0e lds r18, 0x0E49 ; 0x800e49 315b6: 30 91 4a 0e lds r19, 0x0E4A ; 0x800e4a 315ba: 40 91 4b 0e lds r20, 0x0E4B ; 0x800e4b 315be: 50 91 4c 0e lds r21, 0x0E4C ; 0x800e4c 315c2: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 315c6: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 315ca: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 315ce: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 315d2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 315d6: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 315da: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 315de: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 315e2: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_position_curposXYZE(); 315e6: 0f 94 41 bf call 0x37e82 ; 0x37e82 prepare_move(); 315ea: 90 e0 ldi r25, 0x00 ; 0 315ec: 80 e0 ldi r24, 0x00 ; 0 315ee: 0e 94 88 6b call 0xd710 ; 0xd710 } feedrate = oldFeedrate; 315f2: c0 92 b8 02 sts 0x02B8, r12 ; 0x8002b8 315f6: d0 92 b9 02 sts 0x02B9, r13 ; 0x8002b9 315fa: e0 92 ba 02 sts 0x02BA, r14 ; 0x8002ba 315fe: f0 92 bb 02 sts 0x02BB, r15 ; 0x8002bb plan_set_e_position(current_position[E_AXIS]); retracted[active_extruder]=false; prepare_move(); feedrate = oldFeedrate; } } //retract 31602: ff 90 pop r15 31604: ef 90 pop r14 31606: df 90 pop r13 31608: cf 90 pop r12 3160a: bf 90 pop r11 3160c: af 90 pop r10 3160e: 9f 90 pop r9 31610: 8f 90 pop r8 31612: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 31614: 99 23 and r25, r25 31616: a9 f3 breq .-22 ; 0x31602 st_synchronize(); 31618: 0f 94 ed 43 call 0x287da ; 0x287da set_destination_to_current(); 3161c: 0e 94 ba 67 call 0xcf74 ; 0xcf74 float oldFeedrate = feedrate; 31620: 80 90 b8 02 lds r8, 0x02B8 ; 0x8002b8 31624: 90 90 b9 02 lds r9, 0x02B9 ; 0x8002b9 31628: a0 90 ba 02 lds r10, 0x02BA ; 0x8002ba 3162c: b0 90 bb 02 lds r11, 0x02BB ; 0x8002bb feedrate=cs.retract_recover_feedrate*60; 31630: 20 e0 ldi r18, 0x00 ; 0 31632: 30 e0 ldi r19, 0x00 ; 0 31634: 40 e7 ldi r20, 0x70 ; 112 31636: 52 e4 ldi r21, 0x42 ; 66 31638: 60 91 51 0e lds r22, 0x0E51 ; 0x800e51 3163c: 70 91 52 0e lds r23, 0x0E52 ; 0x800e52 31640: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 31644: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 31648: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3164c: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 31650: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 31654: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba 31658: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb if(cs.retract_zlift) { 3165c: c0 90 49 0e lds r12, 0x0E49 ; 0x800e49 31660: d0 90 4a 0e lds r13, 0x0E4A ; 0x800e4a 31664: e0 90 4b 0e lds r14, 0x0E4B ; 0x800e4b 31668: f0 90 4c 0e lds r15, 0x0E4C ; 0x800e4c 3166c: 20 e0 ldi r18, 0x00 ; 0 3166e: 30 e0 ldi r19, 0x00 ; 0 31670: a9 01 movw r20, r18 31672: c7 01 movw r24, r14 31674: b6 01 movw r22, r12 31676: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 3167a: 88 23 and r24, r24 3167c: e1 f0 breq .+56 ; 0x316b6 current_position[Z_AXIS]+=cs.retract_zlift; 3167e: a7 01 movw r20, r14 31680: 96 01 movw r18, r12 31682: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 31686: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 3168a: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3168e: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 31692: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 31696: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 3169a: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3169e: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 316a2: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_position_curposXYZE(); 316a6: 0f 94 41 bf call 0x37e82 ; 0x37e82 prepare_move(); 316aa: 90 e0 ldi r25, 0x00 ; 0 316ac: 80 e0 ldi r24, 0x00 ; 0 316ae: 0e 94 88 6b call 0xd710 ; 0xd710 st_synchronize(); 316b2: 0f 94 ed 43 call 0x287da ; 0x287da } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 316b6: 20 91 4d 0e lds r18, 0x0E4D ; 0x800e4d 316ba: 30 91 4e 0e lds r19, 0x0E4E ; 0x800e4e 316be: 40 91 4f 0e lds r20, 0x0E4F ; 0x800e4f 316c2: 50 91 50 0e lds r21, 0x0E50 ; 0x800e50 316c6: 60 91 41 0e lds r22, 0x0E41 ; 0x800e41 316ca: 70 91 42 0e lds r23, 0x0E42 ; 0x800e42 316ce: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 316d2: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 316d6: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 316da: 6b 01 movw r12, r22 316dc: 7c 01 movw r14, r24 316de: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 316e2: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 316e6: 07 2e mov r0, r23 316e8: 00 0c add r0, r0 316ea: 88 0b sbc r24, r24 316ec: 99 0b sbc r25, r25 316ee: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 316f2: 9b 01 movw r18, r22 316f4: ac 01 movw r20, r24 316f6: c7 01 movw r24, r14 316f8: b6 01 movw r22, r12 316fa: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 316fe: 2a e0 ldi r18, 0x0A ; 10 31700: 37 ed ldi r19, 0xD7 ; 215 31702: 43 e2 ldi r20, 0x23 ; 35 31704: 5c e3 ldi r21, 0x3C ; 60 31706: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3170a: 9b 01 movw r18, r22 3170c: ac 01 movw r20, r24 3170e: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 31712: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 31716: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 3171a: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 3171e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 31722: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 31726: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 3172a: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 3172e: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); 31732: 8e e9 ldi r24, 0x9E ; 158 31734: 96 e0 ldi r25, 0x06 ; 6 31736: 0f 94 f9 64 call 0x2c9f2 ; 0x2c9f2 retracted[active_extruder]=false; 3173a: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e prepare_move(); 3173e: 90 e0 ldi r25, 0x00 ; 0 31740: 80 e0 ldi r24, 0x00 ; 0 31742: 0e 94 88 6b call 0xd710 ; 0xd710 feedrate = oldFeedrate; 31746: 80 92 b8 02 sts 0x02B8, r8 ; 0x8002b8 3174a: 90 92 b9 02 sts 0x02B9, r9 ; 0x8002b9 3174e: a0 92 ba 02 sts 0x02BA, r10 ; 0x8002ba 31752: b0 92 bb 02 sts 0x02BB, r11 ; 0x8002bb 31756: 55 cf rjmp .-342 ; 0x31602 00031758 : 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) 31758: ef 92 push r14 3175a: ff 92 push r15 3175c: 0f 93 push r16 3175e: 1f 93 push r17 31760: cf 93 push r28 31762: c8 2f mov r28, r24 31764: 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; 31766: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 3176a: c1 30 cpi r28, 0x01 ; 1 3176c: b9 f0 breq .+46 ; 0x3179c 3176e: c2 30 cpi r28, 0x02 ; 2 31770: c1 f0 breq .+48 ; 0x317a2 { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 31772: 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) 31774: 48 17 cp r20, r24 31776: 21 f0 breq .+8 ; 0x31780 tmc2130_set_dir(axis, dir); 31778: 64 2f mov r22, r20 3177a: 8c 2f mov r24, r28 3177c: 0f 94 b3 24 call 0x24966 ; 0x24966 31780: 8b e9 ldi r24, 0x9B ; 155 31782: e8 2e mov r14, r24 31784: 8f e0 ldi r24, 0x0F ; 15 31786: f8 2e mov r15, r24 while (steps--) 31788: 01 50 subi r16, 0x01 ; 1 3178a: 11 09 sbc r17, r1 3178c: 70 f0 brcs .+28 ; 0x317aa { tmc2130_do_step(axis); 3178e: 8c 2f mov r24, r28 31790: 0f 94 a2 24 call 0x24944 ; 0x24944 31794: c7 01 movw r24, r14 31796: 01 97 sbiw r24, 0x01 ; 1 31798: f1 f7 brne .-4 ; 0x31796 3179a: f6 cf rjmp .-20 ; 0x31788 uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 3179c: 86 95 lsr r24 3179e: 8c 27 eor r24, r28 317a0: e8 cf rjmp .-48 ; 0x31772 case Z_AXIS: return _GET_DIR_Z; 317a2: 82 fb bst r24, 2 317a4: 88 27 eor r24, r24 317a6: 80 f9 bld r24, 0 317a8: e5 cf rjmp .-54 ; 0x31774 while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 317aa: cf 91 pop r28 317ac: 1f 91 pop r17 317ae: 0f 91 pop r16 317b0: ff 90 pop r15 317b2: ef 90 pop r14 317b4: 08 95 ret 000317b6 : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 317b6: 8f 92 push r8 317b8: 9f 92 push r9 317ba: af 92 push r10 317bc: bf 92 push r11 317be: cf 92 push r12 317c0: df 92 push r13 317c2: ef 92 push r14 317c4: ff 92 push r15 317c6: 0f 93 push r16 317c8: 1f 93 push r17 317ca: cf 93 push r28 317cc: c8 2f mov r28, r24 317ce: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 317d0: c6 2e mov r12, r22 317d2: d1 2c mov r13, r1 317d4: 1f 93 push r17 317d6: 4f 93 push r20 317d8: 83 e0 ldi r24, 0x03 ; 3 317da: 8f 93 push r24 317dc: 88 ee ldi r24, 0xE8 ; 232 317de: 8f 93 push r24 317e0: 1f 92 push r1 317e2: 82 e0 ldi r24, 0x02 ; 2 317e4: 8f 93 push r24 317e6: 1f 92 push r1 317e8: 6f 93 push r22 317ea: 1f 92 push r1 317ec: cf 93 push r28 317ee: 80 ef ldi r24, 0xF0 ; 240 317f0: 95 ea ldi r25, 0xA5 ; 165 317f2: 9f 93 push r25 317f4: 8f 93 push r24 317f6: 0f 94 16 db call 0x3b62c ; 0x3b62c 317fa: 8d b7 in r24, 0x3d ; 61 317fc: 9e b7 in r25, 0x3e ; 62 317fe: 0c 96 adiw r24, 0x0c ; 12 31800: 0f b6 in r0, 0x3f ; 63 31802: f8 94 cli 31804: 9e bf out 0x3e, r25 ; 62 31806: 0f be out 0x3f, r0 ; 63 31808: 8d bf out 0x3d, r24 ; 61 3180a: 90 e0 ldi r25, 0x00 ; 0 3180c: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 3180e: 40 e0 ldi r20, 0x00 ; 0 31810: 51 e0 ldi r21, 0x01 ; 1 31812: 28 2f mov r18, r24 31814: ba 01 movw r22, r20 31816: 08 2e mov r0, r24 31818: 02 c0 rjmp .+4 ; 0x3181e 3181a: 76 95 lsr r23 3181c: 67 95 ror r22 3181e: 0a 94 dec r0 31820: e2 f7 brpl .-8 ; 0x3181a 31822: 06 17 cp r16, r22 31824: 17 07 cpc r17, r23 31826: 29 f0 breq .+10 ; 0x31832 31828: 01 96 adiw r24, 0x01 ; 1 3182a: 88 30 cpi r24, 0x08 ; 8 3182c: 91 05 cpc r25, r1 3182e: 89 f7 brne .-30 ; 0x31812 31830: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 31832: e2 2e mov r14, r18 31834: f1 2c mov r15, r1 31836: 88 e0 ldi r24, 0x08 ; 8 31838: 90 e0 ldi r25, 0x00 ; 0 3183a: 8e 19 sub r24, r14 3183c: 9f 09 sbc r25, r15 3183e: 24 e0 ldi r18, 0x04 ; 4 31840: 30 e0 ldi r19, 0x00 ; 0 31842: 59 01 movw r10, r18 31844: 02 c0 rjmp .+4 ; 0x3184a 31846: aa 0c add r10, r10 31848: bb 1c adc r11, r11 3184a: 8a 95 dec r24 3184c: e2 f7 brpl .-8 ; 0x31846 uint16_t mscnt = tmc2130_rd_MSCNT(axis); 3184e: 8c 2f mov r24, r28 31850: 0f 94 7a 25 call 0x24af4 ; 0x24af4 31854: 9c 01 movw r18, r24 31856: 90 e0 ldi r25, 0x00 ; 0 31858: c4 30 cpi r28, 0x04 ; 4 3185a: 28 f4 brcc .+10 ; 0x31866 3185c: ec 2f mov r30, r28 3185e: f0 e0 ldi r31, 0x00 ; 0 31860: e1 5e subi r30, 0xE1 ; 225 31862: fc 4f sbci r31, 0xFC ; 252 31864: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 31866: 0e 2c mov r0, r14 31868: 02 c0 rjmp .+4 ; 0x3186e 3186a: 36 95 lsr r19 3186c: 27 95 ror r18 3186e: 0a 94 dec r0 31870: e2 f7 brpl .-8 ; 0x3186a 31872: 86 01 movw r16, r12 31874: 02 1b sub r16, r18 31876: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 31878: 95 01 movw r18, r10 3187a: 36 95 lsr r19 3187c: 27 95 ror r18 { dir ^= 1; 3187e: 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)) 31880: 20 17 cp r18, r16 31882: 31 07 cpc r19, r17 31884: 74 f1 brlt .+92 ; 0x318e2 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; 31886: 91 11 cpse r25, r1 31888: 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) 3188a: 17 ff sbrs r17, 7 3188c: 05 c0 rjmp .+10 ; 0x31898 { dir ^= 1; 3188e: 81 e0 ldi r24, 0x01 ; 1 31890: 68 27 eor r22, r24 steps = -steps; 31892: 11 95 neg r17 31894: 01 95 neg r16 31896: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 31898: 8c 2f mov r24, r28 3189a: 0f 94 b3 24 call 0x24966 ; 0x24966 mscnt = tmc2130_rd_MSCNT(axis); 3189e: 8c 2f mov r24, r28 318a0: 0f 94 7a 25 call 0x24af4 ; 0x24af4 318a4: b1 2c mov r11, r1 318a6: a1 2c mov r10, r1 318a8: 2b e9 ldi r18, 0x9B ; 155 318aa: 82 2e mov r8, r18 318ac: 2f e0 ldi r18, 0x0F ; 15 318ae: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 318b0: 0a 15 cp r16, r10 318b2: 1b 05 cpc r17, r11 318b4: f1 f0 breq .+60 ; 0x318f2 318b6: 2f ef ldi r18, 0xFF ; 255 318b8: a2 1a sub r10, r18 318ba: b2 0a sbc r11, r18 318bc: 0e 2c mov r0, r14 318be: 02 c0 rjmp .+4 ; 0x318c4 318c0: 96 95 lsr r25 318c2: 87 95 ror r24 318c4: 0a 94 dec r0 318c6: e2 f7 brpl .-8 ; 0x318c0 318c8: 8c 15 cp r24, r12 318ca: 9d 05 cpc r25, r13 318cc: 91 f0 breq .+36 ; 0x318f2 { tmc2130_do_step(axis); 318ce: 8c 2f mov r24, r28 318d0: 0f 94 a2 24 call 0x24944 ; 0x24944 318d4: c4 01 movw r24, r8 318d6: 01 97 sbiw r24, 0x01 ; 1 318d8: f1 f7 brne .-4 ; 0x318d6 delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 318da: 8c 2f mov r24, r28 318dc: 0f 94 7a 25 call 0x24af4 ; 0x24af4 318e0: e7 cf rjmp .-50 ; 0x318b0 { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 318e2: 91 11 cpse r25, r1 318e4: 01 c0 rjmp .+2 ; 0x318e8 318e6: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 318e8: c5 01 movw r24, r10 318ea: 80 1b sub r24, r16 318ec: 91 0b sbc r25, r17 318ee: 8c 01 movw r16, r24 318f0: cc cf rjmp .-104 ; 0x3188a { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 318f2: cf 91 pop r28 318f4: 1f 91 pop r17 318f6: 0f 91 pop r16 318f8: ff 90 pop r15 318fa: ef 90 pop r14 318fc: df 90 pop r13 318fe: cf 90 pop r12 31900: bf 90 pop r11 31902: af 90 pop r10 31904: 9f 90 pop r9 31906: 8f 90 pop r8 31908: 08 95 ret 0003190a : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 3190a: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 memset(z_values, 0, sizeof(z_values)); 3190e: e3 ec ldi r30, 0xC3 ; 195 31910: f3 e1 ldi r31, 0x13 ; 19 31912: 84 ec ldi r24, 0xC4 ; 196 31914: df 01 movw r26, r30 31916: 1d 92 st X+, r1 31918: 8a 95 dec r24 3191a: e9 f7 brne .-6 ; 0x31916 } 3191c: 08 95 ret 0003191e : 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 3191e: 2f 92 push r2 31920: 3f 92 push r3 31922: 4f 92 push r4 31924: 5f 92 push r5 31926: 6f 92 push r6 31928: 7f 92 push r7 3192a: 8f 92 push r8 3192c: 9f 92 push r9 3192e: af 92 push r10 31930: bf 92 push r11 31932: cf 92 push r12 31934: df 92 push r13 31936: ef 92 push r14 31938: ff 92 push r15 3193a: 0f 93 push r16 3193c: 1f 93 push r17 3193e: cf 93 push r28 31940: df 93 push r29 31942: 00 d0 rcall .+0 ; 0x31944 31944: 1f 92 push r1 31946: cd b7 in r28, 0x3d ; 61 31948: de b7 in r29, 0x3e ; 62 3194a: 4b 01 movw r8, r22 3194c: 5c 01 movw r10, r24 3194e: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 31950: 81 e0 ldi r24, 0x01 ; 1 31952: 80 93 8d 06 sts 0x068D, r24 ; 0x80068d #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 31956: 80 91 8c 06 lds r24, 0x068C ; 0x80068c ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 3195a: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 3195c: 81 30 cpi r24, 0x01 ; 1 3195e: 19 f4 brne .+6 ; 0x31966 { FORCE_HIGH_POWER_START; 31960: 0e 94 30 66 call 0xcc60 ; 0xcc60 bHighPowerForced = true; 31964: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 31966: 20 91 b7 02 lds r18, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> 3196a: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 3196c: 81 e0 ldi r24, 0x01 ; 1 3196e: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> //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); 31972: 80 e0 ldi r24, 0x00 ; 0 31974: 0f 94 e7 4e call 0x29dce ; 0x29dce 31978: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 3197a: 0f 94 f5 4e call 0x29dea ; 0x29dea // move down until you find the bed current_position[Z_AXIS] = minimum_z; 3197e: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 31982: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 31986: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 3198a: b0 92 9d 06 sts 0x069D, r11 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 3198e: 65 e5 ldi r22, 0x55 ; 85 31990: 75 e5 ldi r23, 0x55 ; 85 31992: 85 e5 ldi r24, 0x55 ; 85 31994: 91 e4 ldi r25, 0x41 ; 65 31996: 0f 94 09 c6 call 0x38c12 ; 0x38c12 // 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(); 3199a: 0f 94 62 cc call 0x398c4 ; 0x398c4 if (! endstop_z_hit_on_purpose()) 3199e: 0f 94 f5 4e call 0x29dea ; 0x29dea 319a2: 8c 83 std Y+4, r24 ; 0x04 319a4: 88 23 and r24, r24 319a6: 09 f4 brne .+2 ; 0x319aa 319a8: f9 c0 rjmp .+498 ; 0x31b9c { //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)) 319aa: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 319ae: 86 ff sbrs r24, 6 319b0: f5 c0 rjmp .+490 ; 0x31b9c { //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) 319b2: 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; 319b4: c1 2c mov r12, r1 319b6: d1 2c mov r13, r1 319b8: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 319ba: 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) 319bc: 8b 81 ldd r24, Y+3 ; 0x03 319be: 80 17 cp r24, r16 319c0: 08 f0 brcs .+2 ; 0x319c4 319c2: a8 c0 rjmp .+336 ; 0x31b14 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 319c4: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 319c8: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 319cc: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 319d0: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 319d4: 20 e0 ldi r18, 0x00 ; 0 319d6: 30 e0 ldi r19, 0x00 ; 0 319d8: 40 e0 ldi r20, 0x00 ; 0 319da: 5f e3 ldi r21, 0x3F ; 63 319dc: 31 10 cpse r3, r1 319de: 04 c0 rjmp .+8 ; 0x319e8 319e0: 2d ec ldi r18, 0xCD ; 205 319e2: 3c ec ldi r19, 0xCC ; 204 319e4: 4c e4 ldi r20, 0x4C ; 76 319e6: 5e e3 ldi r21, 0x3E ; 62 319e8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 319ec: 2b 01 movw r4, r22 319ee: 3c 01 movw r6, r24 319f0: 40 92 9a 06 sts 0x069A, r4 ; 0x80069a 319f4: 50 92 9b 06 sts 0x069B, r5 ; 0x80069b 319f8: 60 92 9c 06 sts 0x069C, r6 ; 0x80069c 319fc: 70 92 9d 06 sts 0x069D, r7 ; 0x80069d float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 31a00: 65 e5 ldi r22, 0x55 ; 85 31a02: 75 e5 ldi r23, 0x55 ; 85 31a04: 85 e5 ldi r24, 0x55 ; 85 31a06: 91 e4 ldi r25, 0x41 ; 65 31a08: 0f 94 09 c6 call 0x38c12 ; 0x38c12 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 31a0c: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 31a10: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 31a14: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 31a18: b0 92 9d 06 sts 0x069D, r11 ; 0x80069d //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)); 31a1c: 65 e5 ldi r22, 0x55 ; 85 31a1e: 75 e5 ldi r23, 0x55 ; 85 31a20: 85 e5 ldi r24, 0x55 ; 85 31a22: 90 e4 ldi r25, 0x40 ; 64 31a24: 0f 94 09 c6 call 0x38c12 ; 0x38c12 // 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(); 31a28: 0f 94 62 cc call 0x398c4 ; 0x398c4 //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) { 31a2c: a3 01 movw r20, r6 31a2e: 92 01 movw r18, r4 31a30: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 31a34: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 31a38: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 31a3c: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 31a40: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 31a44: 9f 77 andi r25, 0x7F ; 127 31a46: 2d ec ldi r18, 0xCD ; 205 31a48: 3c ec ldi r19, 0xCC ; 204 31a4a: 4c ec ldi r20, 0xCC ; 204 31a4c: 5c e3 ldi r21, 0x3C ; 60 31a4e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 31a52: 87 ff sbrs r24, 7 31a54: 16 c0 rjmp .+44 ; 0x31a82 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 31a56: 60 e0 ldi r22, 0x00 ; 0 31a58: 70 e0 ldi r23, 0x00 ; 0 31a5a: 80 e0 ldi r24, 0x00 ; 0 31a5c: 9f e3 ldi r25, 0x3F ; 63 31a5e: 0e 94 61 6d call 0xdac2 ; 0xdac2 current_position[Z_AXIS] = minimum_z; 31a62: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 31a66: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 31a6a: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 31a6e: b0 92 9d 06 sts 0x069D, r11 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 31a72: 65 e5 ldi r22, 0x55 ; 85 31a74: 75 e5 ldi r23, 0x55 ; 85 31a76: 85 e5 ldi r24, 0x55 ; 85 31a78: 90 e4 ldi r25, 0x40 ; 64 31a7a: 0f 94 09 c6 call 0x38c12 ; 0x38c12 // 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(); 31a7e: 0f 94 62 cc call 0x398c4 ; 0x398c4 } if (!endstop_z_hit_on_purpose()) 31a82: 0f 94 f5 4e call 0x29dea ; 0x29dea 31a86: 28 2e mov r2, r24 31a88: 88 23 and r24, r24 31a8a: 09 f4 brne .+2 ; 0x31a8e 31a8c: 87 c0 rjmp .+270 ; 0x31b9c { //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)) { 31a8e: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 31a92: 86 ff sbrs r24, 6 31a94: 83 c0 rjmp .+262 ; 0x31b9c 31a96: 40 90 9a 06 lds r4, 0x069A ; 0x80069a 31a9a: 50 90 9b 06 lds r5, 0x069B ; 0x80069b 31a9e: 60 90 9c 06 lds r6, 0x069C ; 0x80069c 31aa2: 70 90 9d 06 lds r7, 0x069D ; 0x80069d } #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; 31aa6: 2b 81 ldd r18, Y+3 ; 0x03 31aa8: 22 23 and r18, r18 31aaa: d9 f0 breq .+54 ; 0x31ae2 31aac: 62 2f mov r22, r18 31aae: 70 e0 ldi r23, 0x00 ; 0 31ab0: 90 e0 ldi r25, 0x00 ; 0 31ab2: 80 e0 ldi r24, 0x00 ; 0 31ab4: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 31ab8: 9b 01 movw r18, r22 31aba: ac 01 movw r20, r24 31abc: c7 01 movw r24, r14 31abe: b6 01 movw r22, r12 31ac0: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 31ac4: 9b 01 movw r18, r22 31ac6: ac 01 movw r20, r24 31ac8: c3 01 movw r24, r6 31aca: b2 01 movw r22, r4 31acc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 31ad0: 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 31ad2: 2d ec ldi r18, 0xCD ; 205 31ad4: 3c ec ldi r19, 0xCC ; 204 31ad6: 4c e4 ldi r20, 0x4C ; 76 31ad8: 5d e3 ldi r21, 0x3D ; 61 31ada: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 31ade: 18 16 cp r1, r24 31ae0: 64 f0 brlt .+24 ; 0x31afa #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]; 31ae2: a3 01 movw r20, r6 31ae4: 92 01 movw r18, r4 31ae6: c7 01 movw r24, r14 31ae8: b6 01 movw r22, r12 31aea: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 31aee: 6b 01 movw r12, r22 31af0: 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) 31af2: 2b 81 ldd r18, Y+3 ; 0x03 31af4: 2f 5f subi r18, 0xFF ; 255 31af6: 2b 83 std Y+3, r18 ; 0x03 31af8: 61 cf rjmp .-318 ; 0x319bc 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 31afa: 31 10 cpse r3, r1 31afc: 4f c0 rjmp .+158 ; 0x31b9c //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 31afe: 84 ef ldi r24, 0xF4 ; 244 31b00: 91 e0 ldi r25, 0x01 ; 1 31b02: 0e 94 6c 8c call 0x118d8 ; 0x118d8 //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; 31b06: 32 2c mov r3, r2 i = -1; 31b08: 8f ef ldi r24, 0xFF ; 255 31b0a: 8b 83 std Y+3, r24 ; 0x03 z = 0; 31b0c: c1 2c mov r12, r1 31b0e: d1 2c mov r13, r1 31b10: 76 01 movw r14, r12 31b12: ef cf rjmp .-34 ; 0x31af2 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 31b14: 02 30 cpi r16, 0x02 ; 2 31b16: 68 f5 brcc .+90 ; 0x31b72 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 31b18: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31b1c: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31b20: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31b24: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31b28: 8a 81 ldd r24, Y+2 ; 0x02 31b2a: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 31b2e: 89 81 ldd r24, Y+1 ; 0x01 31b30: 0f 94 e7 4e call 0x29dce ; 0x29dce // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31b34: 11 23 and r17, r17 31b36: 19 f0 breq .+6 ; 0x31b3e 31b38: 80 e0 ldi r24, 0x00 ; 0 31b3a: 0e 94 30 66 call 0xcc60 ; 0xcc60 #endif bedPWMDisabled = 0; 31b3e: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 31b42: 8c 81 ldd r24, Y+4 ; 0x04 31b44: 0f 90 pop r0 31b46: 0f 90 pop r0 31b48: 0f 90 pop r0 31b4a: 0f 90 pop r0 31b4c: df 91 pop r29 31b4e: cf 91 pop r28 31b50: 1f 91 pop r17 31b52: 0f 91 pop r16 31b54: ff 90 pop r15 31b56: ef 90 pop r14 31b58: df 90 pop r13 31b5a: cf 90 pop r12 31b5c: bf 90 pop r11 31b5e: af 90 pop r10 31b60: 9f 90 pop r9 31b62: 8f 90 pop r8 31b64: 7f 90 pop r7 31b66: 6f 90 pop r6 31b68: 5f 90 pop r5 31b6a: 4f 90 pop r4 31b6c: 3f 90 pop r3 31b6e: 2f 90 pop r2 31b70: 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); 31b72: 60 2f mov r22, r16 31b74: 70 e0 ldi r23, 0x00 ; 0 31b76: 90 e0 ldi r25, 0x00 ; 0 31b78: 80 e0 ldi r24, 0x00 ; 0 31b7a: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 31b7e: 9b 01 movw r18, r22 31b80: ac 01 movw r20, r24 31b82: c7 01 movw r24, r14 31b84: b6 01 movw r22, r12 31b86: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 31b8a: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 31b8e: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 31b92: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 31b96: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d 31b9a: c6 cf rjmp .-116 ; 0x31b28 31b9c: 2a 81 ldd r18, Y+2 ; 0x02 31b9e: 20 93 b7 02 sts 0x02B7, r18 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> return true; error: // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 4"); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 31ba2: 89 81 ldd r24, Y+1 ; 0x01 31ba4: 0f 94 e7 4e call 0x29dce ; 0x29dce #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31ba8: 11 23 and r17, r17 31baa: 19 f0 breq .+6 ; 0x31bb2 31bac: 80 e0 ldi r24, 0x00 ; 0 31bae: 0e 94 30 66 call 0xcc60 ; 0xcc60 #endif bedPWMDisabled = 0; 31bb2: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d return false; 31bb6: 1c 82 std Y+4, r1 ; 0x04 31bb8: c4 cf rjmp .-120 ; 0x31b42 00031bba : //! @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) 31bba: 2f 92 push r2 31bbc: 3f 92 push r3 31bbe: 4f 92 push r4 31bc0: 5f 92 push r5 31bc2: 6f 92 push r6 31bc4: 7f 92 push r7 31bc6: 8f 92 push r8 31bc8: 9f 92 push r9 31bca: af 92 push r10 31bcc: bf 92 push r11 31bce: cf 92 push r12 31bd0: df 92 push r13 31bd2: ef 92 push r14 31bd4: ff 92 push r15 31bd6: 0f 93 push r16 31bd8: 1f 93 push r17 31bda: cf 93 push r28 31bdc: df 93 push r29 31bde: cd b7 in r28, 0x3d ; 61 31be0: de b7 in r29, 0x3e ; 62 31be2: ce 5c subi r28, 0xCE ; 206 31be4: d1 09 sbc r29, r1 31be6: 0f b6 in r0, 0x3f ; 63 31be8: f8 94 cli 31bea: de bf out 0x3e, r29 ; 62 31bec: 0f be out 0x3f, r0 ; 63 31bee: cd bf out 0x3d, r28 ; 61 31bf0: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 31bf2: 81 e0 ldi r24, 0x01 ; 1 31bf4: 0e 94 30 66 call 0xcc60 ; 0xcc60 #endif // TMC2130 FORCE_BL_ON_START; 31bf8: 81 e0 ldi r24, 0x01 ; 1 31bfa: 0e 94 d1 89 call 0x113a2 ; 0x113a2 // Only Z calibration? if (!onlyZ) 31bfe: 11 11 cpse r17, r1 31c00: 04 c0 rjmp .+8 ; 0x31c0a { disable_heater(); 31c02: 0f 94 1d 30 call 0x2603a ; 0x2603a eeprom_adjust_bed_reset(); //reset bed level correction 31c06: 0e 94 18 76 call 0xec30 ; 0xec30 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 31c0a: 80 e0 ldi r24, 0x00 ; 0 31c0c: 0e 94 a5 6e call 0xdd4a ; 0xdd4a // Let the planner use the uncorrected coordinates. mbl.reset(); 31c10: 0f 94 85 8c call 0x3190a ; 0x3190a // 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(); 31c14: 0f 94 6e ce call 0x39cdc ; 0x39cdc babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 31c18: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.499+0x1> 31c1c: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.499> // 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)); 31c20: ef e8 ldi r30, 0x8F ; 143 31c22: f6 e0 ldi r31, 0x06 ; 6 31c24: 83 e0 ldi r24, 0x03 ; 3 31c26: df 01 movw r26, r30 31c28: 1d 92 st X+, r1 31c2a: 8a 95 dec r24 31c2c: e9 f7 brne .-6 ; 0x31c28 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 31c2e: 81 e0 ldi r24, 0x01 ; 1 31c30: 0e 94 68 66 call 0xccd0 ; 0xccd0 31c34: c7 55 subi r28, 0x57 ; 87 31c36: df 4f sbci r29, 0xFF ; 255 31c38: 99 83 std Y+1, r25 ; 0x01 31c3a: 88 83 st Y, r24 31c3c: c9 5a subi r28, 0xA9 ; 169 31c3e: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 31c40: 89 e4 ldi r24, 0x49 ; 73 31c42: 9b e5 ldi r25, 0x5B ; 91 31c44: 0e 94 2c 72 call 0xe458 ; 0xe458 31c48: 0f 94 e9 20 call 0x241d2 ; 0x241d2 raise_z_above(MESH_HOME_Z_SEARCH); 31c4c: 60 e0 ldi r22, 0x00 ; 0 31c4e: 70 e0 ldi r23, 0x00 ; 0 31c50: 80 ea ldi r24, 0xA0 ; 160 31c52: 90 e4 ldi r25, 0x40 ; 64 31c54: 0e 94 e0 6d call 0xdbc0 ; 0xdbc0 } /**/ void home_xy() { set_destination_to_current(); 31c58: 0e 94 ba 67 call 0xcf74 ; 0xcf74 homeaxis(X_AXIS); 31c5c: 50 e0 ldi r21, 0x00 ; 0 31c5e: 40 e0 ldi r20, 0x00 ; 0 31c60: 61 e0 ldi r22, 0x01 ; 1 31c62: 80 e0 ldi r24, 0x00 ; 0 31c64: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 homeaxis(Y_AXIS); 31c68: 50 e0 ldi r21, 0x00 ; 0 31c6a: 40 e0 ldi r20, 0x00 ; 0 31c6c: 61 e0 ldi r22, 0x01 ; 1 31c6e: 81 e0 ldi r24, 0x01 ; 1 31c70: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 plan_set_position_curposXYZE(); 31c74: 0f 94 41 bf call 0x37e82 ; 0x37e82 endstops_hit_on_purpose(); 31c78: 0f 94 03 4f call 0x29e06 ; 0x29e06 31c7c: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> 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; 31c80: 20 e0 ldi r18, 0x00 ; 0 31c82: 30 e0 ldi r19, 0x00 ; 0 31c84: 40 ea ldi r20, 0xA0 ; 160 31c86: 50 e4 ldi r21, 0x40 ; 64 31c88: 60 91 92 06 lds r22, 0x0692 ; 0x800692 31c8c: 70 91 93 06 lds r23, 0x0693 ; 0x800693 31c90: 80 91 94 06 lds r24, 0x0694 ; 0x800694 31c94: 90 91 95 06 lds r25, 0x0695 ; 0x800695 31c98: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 31c9c: 60 93 92 06 sts 0x0692, r22 ; 0x800692 31ca0: 70 93 93 06 sts 0x0693, r23 ; 0x800693 31ca4: 80 93 94 06 sts 0x0694, r24 ; 0x800694 31ca8: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] += 5; 31cac: 20 e0 ldi r18, 0x00 ; 0 31cae: 30 e0 ldi r19, 0x00 ; 0 31cb0: 40 ea ldi r20, 0xA0 ; 160 31cb2: 50 e4 ldi r21, 0x40 ; 64 31cb4: 60 91 96 06 lds r22, 0x0696 ; 0x800696 31cb8: 70 91 97 06 lds r23, 0x0697 ; 0x800697 31cbc: 80 91 98 06 lds r24, 0x0698 ; 0x800698 31cc0: 90 91 99 06 lds r25, 0x0699 ; 0x800699 31cc4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 31cc8: 60 93 96 06 sts 0x0696, r22 ; 0x800696 31ccc: 70 93 97 06 sts 0x0697, r23 ; 0x800697 31cd0: 80 93 98 06 sts 0x0698, r24 ; 0x800698 31cd4: 90 93 99 06 sts 0x0699, r25 ; 0x800699 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31cd8: 60 e0 ldi r22, 0x00 ; 0 31cda: 70 e0 ldi r23, 0x00 ; 0 31cdc: 80 ea ldi r24, 0xA0 ; 160 31cde: 91 e4 ldi r25, 0x41 ; 65 31ce0: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 31ce4: 0f 94 ed 43 call 0x287da ; 0x287da // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 31ce8: 0e 94 be 72 call 0xe57c ; 0xe57c 31cec: e5 96 adiw r28, 0x35 ; 53 31cee: 8f af std Y+63, r24 ; 0x3f 31cf0: e5 97 sbiw r28, 0x35 ; 53 31cf2: 81 11 cpse r24, r1 31cf4: 04 c0 rjmp .+8 ; 0x31cfe //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 31cf6: e5 96 adiw r28, 0x35 ; 53 31cf8: 1f ae std Y+63, r1 ; 0x3f 31cfa: e5 97 sbiw r28, 0x35 ; 53 31cfc: 74 c4 rjmp .+2280 ; 0x325e6 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 31cfe: 8d e0 ldi r24, 0x0D ; 13 31d00: 9b e5 ldi r25, 0x5B ; 91 31d02: 0e 94 2c 72 call 0xe458 ; 0xe458 31d06: 0f 94 f6 20 call 0x241ec ; 0x241ec if(onlyZ){ 31d0a: 11 23 and r17, r17 31d0c: 09 f4 brne .+2 ; 0x31d10 31d0e: 46 c4 rjmp .+2188 ; 0x3259c prompt_steel_sheet_on_bed(true); 31d10: 81 e0 ldi r24, 0x01 ; 1 31d12: 0f 94 9e 0d call 0x21b3c ; 0x21b3c lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 31d16: 8b ed ldi r24, 0xDB ; 219 31d18: 9a e5 ldi r25, 0x5A ; 90 31d1a: 0e 94 2c 72 call 0xe458 ; 0xe458 31d1e: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_puts_at_P(0,3,_n("1/9")); 31d22: 4b ec ldi r20, 0xCB ; 203 31d24: 5f e6 ldi r21, 0x6F ; 111 }else{ //lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); lcd_puts_at_P(0,3,_n("1/4")); 31d26: 63 e0 ldi r22, 0x03 ; 3 31d28: 80 e0 ldi r24, 0x00 ; 0 31d2a: 0e 94 74 6e call 0xdce8 ; 0xdce8 } refresh_cmd_timeout(); 31d2e: 0e 94 43 66 call 0xcc86 ; 0xcc86 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 31d32: 11 11 cpse r17, r1 31d34: 1b c0 rjmp .+54 ; 0x31d6c { KEEPALIVE_STATE(PAUSED_FOR_USER); 31d36: 84 e0 ldi r24, 0x04 ; 4 31d38: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be prompt_steel_sheet_on_bed(false); 31d3c: 80 e0 ldi r24, 0x00 ; 0 31d3e: 0f 94 9e 0d call 0x21b3c ; 0x21b3c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 31d42: 81 e2 ldi r24, 0x21 ; 33 31d44: 9a e5 ldi r25, 0x5A ; 90 31d46: 0e 94 2c 72 call 0xe458 ; 0xe458 31d4a: 0f 94 f6 20 call 0x241ec ; 0x241ec KEEPALIVE_STATE(IN_HANDLER); 31d4e: 82 e0 ldi r24, 0x02 ; 2 31d50: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 31d54: 89 eb ldi r24, 0xB9 ; 185 31d56: 9a e5 ldi r25, 0x5A ; 90 31d58: 0e 94 2c 72 call 0xe458 ; 0xe458 31d5c: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_puts_at_P(0,3,_n("1/4")); 31d60: 43 ec ldi r20, 0xC3 ; 195 31d62: 5f e6 ldi r21, 0x6F ; 111 31d64: 63 e0 ldi r22, 0x03 ; 3 31d66: 80 e0 ldi r24, 0x00 ; 0 31d68: 0e 94 74 6e call 0xdce8 ; 0xdce8 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 31d6c: 00 91 b7 02 lds r16, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> check_endstops = check; 31d70: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 31d74: 60 e0 ldi r22, 0x00 ; 0 31d76: 70 e0 ldi r23, 0x00 ; 0 31d78: 80 e8 ldi r24, 0x80 ; 128 31d7a: 9f eb ldi r25, 0xBF ; 191 31d7c: 0e 94 61 6d call 0xdac2 ; 0xdac2 // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31d80: c1 2c mov r12, r1 31d82: d1 2c mov r13, r1 31d84: b0 ea ldi r27, 0xA0 ; 160 31d86: eb 2e mov r14, r27 31d88: b0 e4 ldi r27, 0x40 ; 64 31d8a: fb 2e mov r15, r27 31d8c: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31d90: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31d94: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31d98: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31d9c: 81 e0 ldi r24, 0x01 ; 1 31d9e: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 31da2: 84 e0 ldi r24, 0x04 ; 4 31da4: 0f 94 dd 26 call 0x24dba ; 0x24dba #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31da8: 60 e0 ldi r22, 0x00 ; 0 31daa: 70 e0 ldi r23, 0x00 ; 0 31dac: 80 ea ldi r24, 0xA0 ; 160 31dae: 91 e4 ldi r25, 0x41 ; 65 31db0: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 31db4: 0f 94 ed 43 call 0x287da ; 0x287da #ifdef TMC2130 tmc2130_home_exit(); 31db8: 0f 94 ae 26 call 0x24d5c ; 0x24d5c 31dbc: 00 93 b7 02 sts 0x02B7, r16 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> #endif //TMC2130 enable_endstops(endstops_enabled); if ((st_get_position_mm(Z_AXIS) <= (MESH_HOME_Z_SEARCH + HOME_Z_SEARCH_THRESHOLD)) && 31dc0: 82 e0 ldi r24, 0x02 ; 2 31dc2: 0f 94 d9 43 call 0x287b2 ; 0x287b2 31dc6: 2d ec ldi r18, 0xCD ; 205 31dc8: 3c ec ldi r19, 0xCC ; 204 31dca: 44 ea ldi r20, 0xA4 ; 164 31dcc: 50 e4 ldi r21, 0x40 ; 64 31dce: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 31dd2: 18 16 cp r1, r24 31dd4: 0c f4 brge .+2 ; 0x31dd8 31dd6: eb c3 rjmp .+2006 ; 0x325ae (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 31dd8: 82 e0 ldi r24, 0x02 ; 2 31dda: 0f 94 d9 43 call 0x287b2 ; 0x287b2 #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)) && 31dde: 23 e3 ldi r18, 0x33 ; 51 31de0: 33 e3 ldi r19, 0x33 ; 51 31de2: 4b e9 ldi r20, 0x9B ; 155 31de4: 50 e4 ldi r21, 0x40 ; 64 31de6: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 31dea: 87 fd sbrc r24, 7 31dec: e0 c3 rjmp .+1984 ; 0x325ae (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 31dee: 11 11 cpse r17, r1 31df0: e3 c3 rjmp .+1990 ; 0x325b8 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 31df2: 80 e1 ldi r24, 0x10 ; 16 31df4: 0e 94 1b ef call 0x1de36 ; 0x1de36 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 31df8: 81 ea ldi r24, 0xA1 ; 161 31dfa: 9d e0 ldi r25, 0x0D ; 13 31dfc: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 31e00: bb e0 ldi r27, 0x0B ; 11 31e02: 8b 9f mul r24, r27 31e04: c0 01 movw r24, r0 31e06: 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); 31e08: 70 e0 ldi r23, 0x00 ; 0 31e0a: 60 e0 ldi r22, 0x00 ; 0 31e0c: 80 5b subi r24, 0xB0 ; 176 31e0e: 92 4f sbci r25, 0xF2 ; 242 31e10: 0f 94 96 dc call 0x3b92c ; 0x3b92c } 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(); 31e14: 0e 94 43 66 call 0xcc86 ; 0xcc86 // 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); 31e18: e3 ec ldi r30, 0xC3 ; 195 31e1a: f3 e1 ldi r31, 0x13 ; 19 31e1c: 84 ec ldi r24, 0xC4 ; 196 31e1e: df 01 movw r26, r30 31e20: 1d 92 st X+, r1 31e22: 8a 95 dec r24 31e24: e9 f7 brne .-6 ; 0x31e20 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 31e26: 84 e1 ldi r24, 0x14 ; 20 31e28: 95 ea ldi r25, 0xA5 ; 165 31e2a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 MYSERIAL.println(int(iteration + 1)); 31e2e: 81 e0 ldi r24, 0x01 ; 1 31e30: 90 e0 ldi r25, 0x00 ; 0 31e32: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 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)); 31e36: 89 eb ldi r24, 0xB9 ; 185 31e38: 9a e5 ldi r25, 0x5A ; 90 31e3a: 0e 94 2c 72 call 0xe458 ; 0xe458 31e3e: 0f 94 e9 20 call 0x241d2 ; 0x241d2 #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; 31e42: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31e46: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31e4a: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31e4e: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31e52: b2 e0 ldi r27, 0x02 ; 2 31e54: e1 96 adiw r28, 0x31 ; 49 31e56: bf af std Y+63, r27 ; 0x3f 31e58: e1 97 sbiw r28, 0x31 ; 49 31e5a: 2f ee ldi r18, 0xEF ; 239 31e5c: 34 ea ldi r19, 0xA4 ; 164 31e5e: cd 56 subi r28, 0x6D ; 109 31e60: df 4f sbci r29, 0xFF ; 255 31e62: 39 83 std Y+1, r19 ; 0x01 31e64: 28 83 st Y, r18 31e66: c3 59 subi r28, 0x93 ; 147 31e68: d0 40 sbci r29, 0x00 ; 0 31e6a: 42 ec ldi r20, 0xC2 ; 194 31e6c: 53 e1 ldi r21, 0x13 ; 19 31e6e: cf 56 subi r28, 0x6F ; 111 31e70: df 4f sbci r29, 0xFF ; 255 31e72: 59 83 std Y+1, r21 ; 0x01 31e74: 48 83 st Y, r20 31e76: c1 59 subi r28, 0x91 ; 145 31e78: d0 40 sbci r29, 0x00 ; 0 31e7a: a0 96 adiw r28, 0x20 ; 32 31e7c: 5f af std Y+63, r21 ; 0x3f 31e7e: 4e af std Y+62, r20 ; 0x3e 31e80: a0 97 sbiw r28, 0x20 ; 32 31e82: e0 96 adiw r28, 0x30 ; 48 31e84: 3f af std Y+63, r19 ; 0x3f 31e86: 2e af std Y+62, r18 ; 0x3e 31e88: 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; 31e8a: a7 96 adiw r28, 0x27 ; 39 31e8c: 1f ae std Y+63, r1 ; 0x3f 31e8e: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 31e90: 31 2c mov r3, r1 31e92: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31e94: 0e 94 43 66 call 0xcc86 ; 0xcc86 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 31e98: 63 e0 ldi r22, 0x03 ; 3 31e9a: 80 e0 ldi r24, 0x00 ; 0 31e9c: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%d/4"),(k+1)); 31ea0: bf ef ldi r27, 0xFF ; 255 31ea2: 2b 1a sub r2, r27 31ea4: 3b 0a sbc r3, r27 31ea6: 3f 92 push r3 31ea8: 2f 92 push r2 31eaa: ef e0 ldi r30, 0x0F ; 15 31eac: f5 ea ldi r31, 0xA5 ; 165 31eae: ff 93 push r31 31eb0: ef 93 push r30 31eb2: 0e 94 39 6e call 0xdc72 ; 0xdc72 } #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); 31eb6: 65 e5 ldi r22, 0x55 ; 85 31eb8: 75 e5 ldi r23, 0x55 ; 85 31eba: 85 e5 ldi r24, 0x55 ; 85 31ebc: 91 e4 ldi r25, 0x41 ; 65 31ebe: 0f 94 09 c6 call 0x38c12 ; 0x38c12 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); 31ec2: e0 96 adiw r28, 0x30 ; 48 31ec4: ee ad ldd r30, Y+62 ; 0x3e 31ec6: ff ad ldd r31, Y+63 ; 0x3f 31ec8: e0 97 sbiw r28, 0x30 ; 48 31eca: 85 91 lpm r24, Z+ 31ecc: 95 91 lpm r25, Z+ 31ece: a5 91 lpm r26, Z+ 31ed0: b4 91 lpm r27, Z 31ed2: 80 93 92 06 sts 0x0692, r24 ; 0x800692 31ed6: 90 93 93 06 sts 0x0693, r25 ; 0x800693 31eda: a0 93 94 06 sts 0x0694, r26 ; 0x800694 31ede: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 31ee2: e0 96 adiw r28, 0x30 ; 48 31ee4: ee ad ldd r30, Y+62 ; 0x3e 31ee6: ff ad ldd r31, Y+63 ; 0x3f 31ee8: e0 97 sbiw r28, 0x30 ; 48 31eea: 34 96 adiw r30, 0x04 ; 4 31eec: 85 91 lpm r24, Z+ 31eee: 95 91 lpm r25, Z+ 31ef0: a5 91 lpm r26, Z+ 31ef2: b4 91 lpm r27, Z 31ef4: 80 93 96 06 sts 0x0696, r24 ; 0x800696 31ef8: 90 93 97 06 sts 0x0697, r25 ; 0x800697 31efc: a0 93 98 06 sts 0x0698, r26 ; 0x800698 31f00: b0 93 99 06 sts 0x0699, r27 ; 0x800699 MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 31f04: 60 e0 ldi r22, 0x00 ; 0 31f06: 70 e0 ldi r23, 0x00 ; 0 31f08: 88 e4 ldi r24, 0x48 ; 72 31f0a: 92 e4 ldi r25, 0x42 ; 66 31f0c: 0f 94 09 c6 call 0x38c12 ; 0x38c12 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 31f10: 44 e7 ldi r20, 0x74 ; 116 31f12: 53 ea ldi r21, 0xA3 ; 163 31f14: 5f 93 push r21 31f16: 4f 93 push r20 31f18: 0f 94 16 db call 0x3b62c ; 0x3b62c lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 31f1c: 43 e6 ldi r20, 0x63 ; 99 31f1e: 53 ea ldi r21, 0xA3 ; 163 31f20: 63 e0 ldi r22, 0x03 ; 3 31f22: 84 e0 ldi r24, 0x04 ; 4 31f24: 0e 94 74 6e call 0xdce8 ; 0xdce8 // disable heaters and stop motion before we initialize sm4 disable_heater(); 31f28: 0f 94 1d 30 call 0x2603a ; 0x2603a st_synchronize(); 31f2c: 0f 94 ed 43 call 0x287da ; 0x287da // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 31f30: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 31f34: 8d 7f andi r24, 0xFD ; 253 31f36: 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" ); 31f3a: 0f b6 in r0, 0x3f ; 63 31f3c: f8 94 cli 31f3e: a8 95 wdr 31f40: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31f44: 88 61 ori r24, 0x18 ; 24 31f46: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31f4a: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31f4e: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 31f50: 10 92 89 06 sts 0x0689, r1 ; 0x800689 31f54: 10 92 88 06 sts 0x0688, r1 ; 0x800688 sm4_update_pos_cb = xyzcal_update_pos; 31f58: 85 e0 ldi r24, 0x05 ; 5 31f5a: 9e ec ldi r25, 0xCE ; 206 31f5c: 90 93 87 06 sts 0x0687, r25 ; 0x800687 31f60: 80 93 86 06 sts 0x0686, r24 ; 0x800686 sm4_calc_delay_cb = xyzcal_calc_delay; 31f64: a0 e0 ldi r26, 0x00 ; 0 31f66: be ec ldi r27, 0xCE ; 206 31f68: b0 93 85 06 sts 0x0685, r27 ; 0x800685 31f6c: a0 93 84 06 sts 0x0684, r26 ; 0x800684 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]); 31f70: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 31f74: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 31f78: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 31f7c: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 31f80: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 31f84: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 31f88: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 31f8c: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 31f90: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 31f94: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 31f98: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 31f9c: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 31fa0: 3f 93 push r19 31fa2: 2f 93 push r18 31fa4: 1f 93 push r17 31fa6: 0f 93 push r16 31fa8: 7f 93 push r23 31faa: 6f 93 push r22 31fac: 5f 93 push r21 31fae: 4f 93 push r20 31fb0: bf 93 push r27 31fb2: af 93 push r26 31fb4: 9f 93 push r25 31fb6: 8f 93 push r24 31fb8: e3 e1 ldi r30, 0x13 ; 19 31fba: f4 ea ldi r31, 0xA4 ; 164 31fbc: ff 93 push r31 31fbe: ef 93 push r30 31fc0: 0f 94 16 db call 0x3b62c ; 0x3b62c int16_t x0 = _X; 31fc4: 40 90 b3 06 lds r4, 0x06B3 ; 0x8006b3 31fc8: 50 90 b4 06 lds r5, 0x06B4 ; 0x8006b4 31fcc: 60 90 b5 06 lds r6, 0x06B5 ; 0x8006b5 31fd0: 70 90 b6 06 lds r7, 0x06B6 ; 0x8006b6 31fd4: b4 2c mov r11, r4 31fd6: a5 2c mov r10, r5 int16_t y0 = _Y; 31fd8: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 31fdc: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 31fe0: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 31fe4: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 31fe8: a6 96 adiw r28, 0x26 ; 38 31fea: 8c af std Y+60, r24 ; 0x3c 31fec: 9d af std Y+61, r25 ; 0x3d 31fee: ae af std Y+62, r26 ; 0x3e 31ff0: bf af std Y+63, r27 ; 0x3f 31ff2: a6 97 sbiw r28, 0x26 ; 38 31ff4: a3 96 adiw r28, 0x23 ; 35 31ff6: 9f ac ldd r9, Y+63 ; 0x3f 31ff8: a3 97 sbiw r28, 0x23 ; 35 31ffa: a4 96 adiw r28, 0x24 ; 36 31ffc: 8f ac ldd r8, Y+63 ; 0x3f 31ffe: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 32000: c0 90 bb 06 lds r12, 0x06BB ; 0x8006bb 32004: d0 90 bc 06 lds r13, 0x06BC ; 0x8006bc 32008: e0 90 bd 06 lds r14, 0x06BD ; 0x8006bd 3200c: f0 90 be 06 lds r15, 0x06BE ; 0x8006be 32010: 0f b6 in r0, 0x3f ; 63 32012: f8 94 cli 32014: de bf out 0x3e, r29 ; 62 32016: 0f be out 0x3f, r0 ; 63 32018: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 3201a: b5 e0 ldi r27, 0x05 ; 5 3201c: cb 16 cp r12, r27 3201e: b7 ef ldi r27, 0xF7 ; 247 32020: db 06 cpc r13, r27 32022: 0c f4 brge .+2 ; 0x32026 32024: 40 c3 rjmp .+1664 ; 0x326a6 } 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; 32026: 1a 82 std Y+2, r1 ; 0x02 32028: 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); 3202a: 1f 92 push r1 3202c: 1f 92 push r1 3202e: e3 e0 ldi r30, 0x03 ; 3 32030: ef 93 push r30 32032: f4 e8 ldi r31, 0x84 ; 132 32034: ff 93 push r31 32036: 1f 92 push r1 32038: 24 e6 ldi r18, 0x64 ; 100 3203a: 2f 93 push r18 3203c: df 92 push r13 3203e: cf 92 push r12 32040: 8f 92 push r8 32042: 9f 92 push r9 32044: af 92 push r10 32046: bf 92 push r11 32048: 4a e8 ldi r20, 0x8A ; 138 3204a: 53 ea ldi r21, 0xA3 ; 163 3204c: 5f 93 push r21 3204e: 4f 93 push r20 32050: 0f 94 16 db call 0x3b62c ; 0x3b62c if (!ret && (ad < 720)) 32054: 0f b6 in r0, 0x3f ; 63 32056: f8 94 cli 32058: de bf out 0x3e, r29 ; 62 3205a: 0f be out 0x3f, r0 ; 63 3205c: cd bf out 0x3d, r28 ; 61 3205e: 89 81 ldd r24, Y+1 ; 0x01 32060: 9a 81 ldd r25, Y+2 ; 0x02 32062: 80 3d cpi r24, 0xD0 ; 208 32064: 92 40 sbci r25, 0x02 ; 2 32066: 08 f4 brcc .+2 ; 0x3206a 32068: e9 c2 rjmp .+1490 ; 0x3263c if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 3206a: 89 81 ldd r24, Y+1 ; 0x01 3206c: 9a 81 ldd r25, Y+2 ; 0x02 3206e: 80 3a cpi r24, 0xA0 ; 160 32070: 95 40 sbci r25, 0x05 ; 5 32072: 10 f0 brcs .+4 ; 0x32078 32074: 0d 94 28 9f jmp 0x33e50 ; 0x33e50 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 32078: 9e 01 movw r18, r28 3207a: 2f 5f subi r18, 0xFF ; 255 3207c: 3f 4f sbci r19, 0xFF ; 255 3207e: 79 01 movw r14, r18 32080: 10 e0 ldi r17, 0x00 ; 0 32082: 00 e0 ldi r16, 0x00 ; 0 32084: 2c e7 ldi r18, 0x7C ; 124 32086: 3c ef ldi r19, 0xFC ; 252 32088: a6 01 movw r20, r12 3208a: 44 56 subi r20, 0x64 ; 100 3208c: 51 09 sbc r21, r1 3208e: 69 2d mov r22, r9 32090: 78 2d mov r23, r8 32092: 8b 2d mov r24, r11 32094: 9a 2d mov r25, r10 32096: 0f 94 b6 6f call 0x2df6c ; 0x2df6c 3209a: 88 23 and r24, r24 3209c: 11 f4 brne .+4 ; 0x320a2 3209e: 0d 94 28 9f jmp 0x33e50 ; 0x33e50 ad += 720; 320a2: 89 81 ldd r24, Y+1 ; 0x01 320a4: 9a 81 ldd r25, Y+2 ; 0x02 320a6: 80 53 subi r24, 0x30 ; 48 320a8: 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); 320aa: c0 90 bb 06 lds r12, 0x06BB ; 0x8006bb 320ae: d0 90 bc 06 lds r13, 0x06BC ; 0x8006bc 320b2: e0 90 bd 06 lds r14, 0x06BD ; 0x8006bd 320b6: f0 90 be 06 lds r15, 0x06BE ; 0x8006be 320ba: 00 91 b7 06 lds r16, 0x06B7 ; 0x8006b7 320be: 10 91 b8 06 lds r17, 0x06B8 ; 0x8006b8 320c2: 20 91 b9 06 lds r18, 0x06B9 ; 0x8006b9 320c6: 30 91 ba 06 lds r19, 0x06BA ; 0x8006ba 320ca: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 320ce: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 320d2: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 320d6: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 320da: 9f 93 push r25 320dc: 8f 93 push r24 320de: df 92 push r13 320e0: cf 92 push r12 320e2: 1f 93 push r17 320e4: 0f 93 push r16 320e6: 5f 93 push r21 320e8: 4f 93 push r20 320ea: 8f ee ldi r24, 0xEF ; 239 320ec: 93 ea ldi r25, 0xA3 ; 163 320ee: 9f 93 push r25 320f0: 8f 93 push r24 320f2: 0f 94 16 db call 0x3b62c ; 0x3b62c /// 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); 320f6: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 320fa: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 320fe: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 32102: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 32106: 48 54 subi r20, 0x48 ; 72 32108: 51 09 sbc r21, r1 3210a: 00 e0 ldi r16, 0x00 ; 0 3210c: 28 ec ldi r18, 0xC8 ; 200 3210e: 30 e0 ldi r19, 0x00 ; 0 32110: a3 96 adiw r28, 0x23 ; 35 32112: 6f ad ldd r22, Y+63 ; 0x3f 32114: a3 97 sbiw r28, 0x23 ; 35 32116: a4 96 adiw r28, 0x24 ; 36 32118: 7f ad ldd r23, Y+63 ; 0x3f 3211a: a4 97 sbiw r28, 0x24 ; 36 3211c: c2 01 movw r24, r4 3211e: 0e 94 53 ec call 0x1d8a6 ; 0x1d8a6 /// 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; 32122: 20 91 b3 06 lds r18, 0x06B3 ; 0x8006b3 32126: 30 91 b4 06 lds r19, 0x06B4 ; 0x8006b4 3212a: 40 91 b5 06 lds r20, 0x06B5 ; 0x8006b5 3212e: 50 91 b6 06 lds r21, 0x06B6 ; 0x8006b6 32132: 6e 96 adiw r28, 0x1e ; 30 32134: 2c af std Y+60, r18 ; 0x3c 32136: 3d af std Y+61, r19 ; 0x3d 32138: 4e af std Y+62, r20 ; 0x3e 3213a: 5f af std Y+63, r21 ; 0x3f 3213c: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 3213e: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 32142: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 32146: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 3214a: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 3214e: ae 96 adiw r28, 0x2e ; 46 32150: 8c af std Y+60, r24 ; 0x3c 32152: 9d af std Y+61, r25 ; 0x3d 32154: ae af std Y+62, r26 ; 0x3e 32156: bf af std Y+63, r27 ; 0x3f 32158: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 3215a: 20 91 bb 06 lds r18, 0x06BB ; 0x8006bb 3215e: 30 91 bc 06 lds r19, 0x06BC ; 0x8006bc 32162: 40 91 bd 06 lds r20, 0x06BD ; 0x8006bd 32166: 50 91 be 06 lds r21, 0x06BE ; 0x8006be 3216a: e9 96 adiw r28, 0x39 ; 57 3216c: 2c af std Y+60, r18 ; 0x3c 3216e: 3d af std Y+61, r19 ; 0x3d 32170: 4e af std Y+62, r20 ; 0x3e 32172: 5f af std Y+63, r21 ; 0x3f 32174: e9 97 sbiw r28, 0x39 ; 57 32176: a5 ec ldi r26, 0xC5 ; 197 32178: ba e0 ldi r27, 0x0A ; 10 3217a: 0f b6 in r0, 0x3f ; 63 3217c: f8 94 cli 3217e: de bf out 0x3e, r29 ; 62 32180: 0f be out 0x3f, r0 ; 63 32182: cd bf out 0x3d, r28 ; 61 32184: 90 e0 ldi r25, 0x00 ; 0 32186: 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)); 32188: fc 01 movw r30, r24 3218a: e6 57 subi r30, 0x76 ; 118 3218c: fb 45 sbci r31, 0x5B ; 91 3218e: 25 91 lpm r18, Z+ 32190: 34 91 lpm r19, Z 32192: 2d 93 st X+, r18 32194: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 32196: fc 01 movw r30, r24 32198: ee 58 subi r30, 0x8E ; 142 3219a: fb 45 sbci r31, 0x5B ; 91 3219c: 25 91 lpm r18, Z+ 3219e: 34 91 lpm r19, Z 321a0: 57 96 adiw r26, 0x17 ; 23 321a2: 3c 93 st X, r19 321a4: 2e 93 st -X, r18 321a6: 56 97 sbiw r26, 0x16 ; 22 321a8: 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++){ 321aa: 88 31 cpi r24, 0x18 ; 24 321ac: 91 05 cpc r25, r1 321ae: 61 f7 brne .-40 ; 0x32188 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); 321b0: e7 96 adiw r28, 0x37 ; 55 321b2: 4e ad ldd r20, Y+62 ; 0x3e 321b4: 5f ad ldd r21, Y+63 ; 0x3f 321b6: e7 97 sbiw r28, 0x37 ; 55 321b8: ac 96 adiw r28, 0x2c ; 44 321ba: 6e ad ldd r22, Y+62 ; 0x3e 321bc: 7f ad ldd r23, Y+63 ; 0x3f 321be: ac 97 sbiw r28, 0x2c ; 44 321c0: 6c 96 adiw r28, 0x1c ; 28 321c2: 8e ad ldd r24, Y+62 ; 0x3e 321c4: 9f ad ldd r25, Y+63 ; 0x3f 321c6: 6c 97 sbiw r28, 0x1c ; 28 321c8: 0f 94 f2 70 call 0x2e1e4 ; 0x2e1e4 321cc: 25 ec ldi r18, 0xC5 ; 197 321ce: 36 e0 ldi r19, 0x06 ; 6 321d0: a4 96 adiw r28, 0x24 ; 36 321d2: 3f af std Y+63, r19 ; 0x3f 321d4: 2e af std Y+62, r18 ; 0x3e 321d6: a4 97 sbiw r28, 0x24 ; 36 321d8: 79 01 movw r14, r18 321da: f0 e2 ldi r31, 0x20 ; 32 321dc: 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]); 321de: a5 e3 ldi r26, 0x35 ; 53 321e0: ca 2e mov r12, r26 321e2: a4 ea ldi r26, 0xA4 ; 164 321e4: da 2e mov r13, r26 } DBG(endl); 321e6: 0a e8 ldi r16, 0x8A ; 138 321e8: 15 ea ldi r17, 0xA5 ; 165 for (uint8_t i = 0; i < 12; i++){ pattern08[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_08 + i)); pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); } xyzcal_scan_pixels_32x32_Zhop(x, y, z, 2400, 200, matrix32); 321ea: 57 01 movw r10, r14 321ec: e0 e2 ldi r30, 0x20 ; 32 321ee: 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]); 321f0: d5 01 movw r26, r10 321f2: 8d 91 ld r24, X+ 321f4: 5d 01 movw r10, r26 321f6: 1f 92 push r1 321f8: 8f 93 push r24 321fa: df 92 push r13 321fc: cf 92 push r12 321fe: 0f 94 16 db call 0x3b62c ; 0x3b62c 32202: 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){ 32204: 0f 90 pop r0 32206: 0f 90 pop r0 32208: 0f 90 pop r0 3220a: 0f 90 pop r0 3220c: 81 10 cpse r8, r1 3220e: f0 cf rjmp .-32 ; 0x321f0 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 32210: 1f 93 push r17 32212: 0f 93 push r16 32214: 0f 94 16 db call 0x3b62c ; 0x3b62c 32218: 9a 94 dec r9 3221a: b0 e2 ldi r27, 0x20 ; 32 3221c: eb 0e add r14, r27 3221e: 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){ 32220: 0f 90 pop r0 32222: 0f 90 pop r0 32224: 91 10 cpse r9, r1 32226: e1 cf rjmp .-62 ; 0x321ea for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 32228: 1f 93 push r17 3222a: 0f 93 push r16 3222c: 0f 94 16 db call 0x3b62c ; 0x3b62c 32230: 65 ec ldi r22, 0xC5 ; 197 32232: 7a e0 ldi r23, 0x0A ; 10 32234: 0f 90 pop r0 32236: 0f 90 pop r0 32238: e5 ec ldi r30, 0xC5 ; 197 3223a: f6 e0 ldi r31, 0x06 ; 6 /// magic constants that define normality const int16_t threshold_total = 900; const int threshold_extreme = 50; int16_t mins = 0; int16_t maxs = 0; 3223c: 90 e0 ldi r25, 0x00 ; 0 3223e: 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; 32240: 50 e0 ldi r21, 0x00 ; 0 32242: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 32244: 21 91 ld r18, Z+ 32246: 21 11 cpse r18, r1 32248: 6d c4 rjmp .+2266 ; 0x32b24 ++mins; 3224a: 4f 5f subi r20, 0xFF ; 255 3224c: 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){ 3224e: 6e 17 cp r22, r30 32250: 7f 07 cpc r23, r31 32252: c1 f7 brne .-16 ; 0x32244 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 32254: 9a 01 movw r18, r20 32256: 28 0f add r18, r24 32258: 39 1f adc r19, r25 3225a: 25 38 cpi r18, 0x85 ; 133 3225c: 33 40 sbci r19, 0x03 ; 3 3225e: a4 f0 brlt .+40 ; 0x32288 && mins > threshold_extreme 32260: 43 33 cpi r20, 0x33 ; 51 32262: 51 05 cpc r21, r1 32264: 8c f0 brlt .+34 ; 0x32288 && maxs > threshold_extreme 32266: 83 33 cpi r24, 0x33 ; 51 32268: 91 05 cpc r25, r1 3226a: 74 f0 brlt .+28 ; 0x32288 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 3226c: 20 e0 ldi r18, 0x00 ; 0 3226e: 34 e0 ldi r19, 0x04 ; 4 32270: 24 1b sub r18, r20 32272: 35 0b sbc r19, r21 32274: 28 1b sub r18, r24 32276: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 32278: 24 17 cp r18, r20 3227a: 35 07 cpc r19, r21 3227c: 2c f4 brge .+10 ; 0x32288 } 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; 3227e: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 32280: 28 17 cp r18, r24 32282: 39 07 cpc r19, r25 32284: 0c f4 brge .+2 ; 0x32288 32286: 3f c2 rjmp .+1150 ; 0x32706 } /// 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; 32288: 66 96 adiw r28, 0x16 ; 22 3228a: 1f ae std Y+63, r1 ; 0x3f 3228c: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 3228e: 62 96 adiw r28, 0x12 ; 18 32290: 1f ae std Y+63, r1 ; 0x3f 32292: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 32294: 22 96 adiw r28, 0x02 ; 2 32296: 1f ae std Y+63, r1 ; 0x3f 32298: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 3229a: 19 82 std Y+1, r1 ; 0x01 3229c: ae 01 movw r20, r28 3229e: 4f 5a subi r20, 0xAF ; 175 322a0: 5f 4f sbci r21, 0xFF ; 255 322a2: be 01 movw r22, r28 322a4: 6b 5a subi r22, 0xAB ; 171 322a6: 7f 4f sbci r23, 0xFF ; 255 322a8: 85 ec ldi r24, 0xC5 ; 197 322aa: 9a e0 ldi r25, 0x0A ; 10 322ac: 0f 94 19 69 call 0x2d232 ; 0x2d232 322b0: 08 2f mov r16, r24 322b2: ae 01 movw r20, r28 322b4: 4f 5f subi r20, 0xFF ; 255 322b6: 5f 4f sbci r21, 0xFF ; 255 322b8: be 01 movw r22, r28 322ba: 6f 5b subi r22, 0xBF ; 191 322bc: 7f 4f sbci r23, 0xFF ; 255 322be: 8d ed ldi r24, 0xDD ; 221 322c0: 9a e0 ldi r25, 0x0A ; 10 322c2: 0f 94 19 69 call 0x2d232 ; 0x2d232 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; 322c6: 66 96 adiw r28, 0x16 ; 22 322c8: 6f ad ldd r22, Y+63 ; 0x3f 322ca: 66 97 sbiw r28, 0x16 ; 22 row = r08; 322cc: 62 96 adiw r28, 0x12 ; 18 322ce: 1f ad ldd r17, Y+63 ; 0x3f 322d0: 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){ 322d2: 80 17 cp r24, r16 322d4: 28 f0 brcs .+10 ; 0x322e0 col = c08; row = r08; return match08; } col = c10; 322d6: 22 96 adiw r28, 0x02 ; 2 322d8: 6f ad ldd r22, Y+63 ; 0x3f 322da: 22 97 sbiw r28, 0x02 ; 2 row = r10; 322dc: 19 81 ldd r17, Y+1 ; 0x01 322de: 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){ 322e0: 08 35 cpi r16, 0x58 ; 88 322e2: 08 f4 brcc .+2 ; 0x322e6 322e4: 24 c4 rjmp .+2120 ; 0x32b2e /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 322e6: 70 e0 ldi r23, 0x00 ; 0 322e8: 90 e0 ldi r25, 0x00 ; 0 322ea: 80 e0 ldi r24, 0x00 ; 0 322ec: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 322f0: 20 e0 ldi r18, 0x00 ; 0 322f2: 30 e0 ldi r19, 0x00 ; 0 322f4: 40 eb ldi r20, 0xB0 ; 176 322f6: 50 e4 ldi r21, 0x40 ; 64 322f8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 322fc: 2b 01 movw r4, r22 322fe: 3c 01 movw r6, r24 32300: 65 96 adiw r28, 0x15 ; 21 32302: 4c ae std Y+60, r4 ; 0x3c 32304: 5d ae std Y+61, r5 ; 0x3d 32306: 6e ae std Y+62, r6 ; 0x3e 32308: 7f ae std Y+63, r7 ; 0x3f 3230a: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 3230c: 61 2f mov r22, r17 3230e: 70 e0 ldi r23, 0x00 ; 0 32310: 90 e0 ldi r25, 0x00 ; 0 32312: 80 e0 ldi r24, 0x00 ; 0 32314: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 32318: 20 e0 ldi r18, 0x00 ; 0 3231a: 30 e0 ldi r19, 0x00 ; 0 3231c: 40 eb ldi r20, 0xB0 ; 176 3231e: 50 e4 ldi r21, 0x40 ; 64 32320: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32324: 4b 01 movw r8, r22 32326: 5c 01 movw r10, r24 32328: 25 96 adiw r28, 0x05 ; 5 3232a: 8c ae std Y+60, r8 ; 0x3c 3232c: 9d ae std Y+61, r9 ; 0x3d 3232e: ae ae std Y+62, r10 ; 0x3e 32330: bf ae std Y+63, r11 ; 0x3f 32332: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 32334: 20 e0 ldi r18, 0x00 ; 0 32336: 30 e0 ldi r19, 0x00 ; 0 32338: 40 e9 ldi r20, 0x90 ; 144 3233a: 50 e4 ldi r21, 0x40 ; 64 3233c: 29 83 std Y+1, r18 ; 0x01 3233e: 3a 83 std Y+2, r19 ; 0x02 32340: 4b 83 std Y+3, r20 ; 0x03 32342: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 32344: ae 01 movw r20, r28 32346: 4f 5f subi r20, 0xFF ; 255 32348: 5f 4f sbci r21, 0xFF ; 255 3234a: be 01 movw r22, r28 3234c: 6f 5b subi r22, 0xBF ; 191 3234e: 7f 4f sbci r23, 0xFF ; 255 32350: ce 01 movw r24, r28 32352: 8f 5a subi r24, 0xAF ; 175 32354: 9f 4f sbci r25, 0xFF ; 255 32356: 0f 94 36 6c call 0x2d86c ; 0x2d86c if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 3235a: a3 01 movw r20, r6 3235c: 92 01 movw r18, r4 3235e: 65 96 adiw r28, 0x15 ; 21 32360: 6c ad ldd r22, Y+60 ; 0x3c 32362: 7d ad ldd r23, Y+61 ; 0x3d 32364: 8e ad ldd r24, Y+62 ; 0x3e 32366: 9f ad ldd r25, Y+63 ; 0x3f 32368: 65 97 sbiw r28, 0x15 ; 21 3236a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3236e: 6b 01 movw r12, r22 32370: 7c 01 movw r14, r24 32372: 9f 77 andi r25, 0x7F ; 127 32374: 20 e0 ldi r18, 0x00 ; 0 32376: 30 e0 ldi r19, 0x00 ; 0 32378: 40 e4 ldi r20, 0x40 ; 64 3237a: 50 e4 ldi r21, 0x40 ; 64 3237c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 32380: 18 16 cp r1, r24 32382: 34 f1 brlt .+76 ; 0x323d0 32384: a5 01 movw r20, r10 32386: 94 01 movw r18, r8 32388: 25 96 adiw r28, 0x05 ; 5 3238a: 6c ad ldd r22, Y+60 ; 0x3c 3238c: 7d ad ldd r23, Y+61 ; 0x3d 3238e: 8e ad ldd r24, Y+62 ; 0x3e 32390: 9f ad ldd r25, Y+63 ; 0x3f 32392: 25 97 sbiw r28, 0x05 ; 5 32394: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 32398: 9f 77 andi r25, 0x7F ; 127 3239a: 20 e0 ldi r18, 0x00 ; 0 3239c: 30 e0 ldi r19, 0x00 ; 0 3239e: 40 e4 ldi r20, 0x40 ; 64 323a0: 50 e4 ldi r21, 0x40 ; 64 323a2: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 323a6: 18 16 cp r1, r24 323a8: 9c f0 brlt .+38 ; 0x323d0 323aa: 20 e0 ldi r18, 0x00 ; 0 323ac: 30 e0 ldi r19, 0x00 ; 0 323ae: 40 ea ldi r20, 0xA0 ; 160 323b0: 50 e4 ldi r21, 0x40 ; 64 323b2: 69 81 ldd r22, Y+1 ; 0x01 323b4: 7a 81 ldd r23, Y+2 ; 0x02 323b6: 8b 81 ldd r24, Y+3 ; 0x03 323b8: 9c 81 ldd r25, Y+4 ; 0x04 323ba: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 323be: 9f 77 andi r25, 0x7F ; 127 323c0: 20 e0 ldi r18, 0x00 ; 0 323c2: 30 e0 ldi r19, 0x00 ; 0 323c4: 40 e4 ldi r20, 0x40 ; 64 323c6: 50 e4 ldi r21, 0x40 ; 64 323c8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 323cc: 18 16 cp r1, r24 323ce: bc f5 brge .+110 ; 0x3243e //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 323d0: 20 e0 ldi r18, 0x00 ; 0 323d2: 30 e0 ldi r19, 0x00 ; 0 323d4: 40 ea ldi r20, 0xA0 ; 160 323d6: 50 e4 ldi r21, 0x40 ; 64 323d8: 69 81 ldd r22, Y+1 ; 0x01 323da: 7a 81 ldd r23, Y+2 ; 0x02 323dc: 8b 81 ldd r24, Y+3 ; 0x03 323de: 9c 81 ldd r25, Y+4 ; 0x04 323e0: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 323e4: 9f 93 push r25 323e6: 8f 93 push r24 323e8: 7f 93 push r23 323ea: 6f 93 push r22 323ec: a5 01 movw r20, r10 323ee: 94 01 movw r18, r8 323f0: 25 96 adiw r28, 0x05 ; 5 323f2: 6c ad ldd r22, Y+60 ; 0x3c 323f4: 7d ad ldd r23, Y+61 ; 0x3d 323f6: 8e ad ldd r24, Y+62 ; 0x3e 323f8: 9f ad ldd r25, Y+63 ; 0x3f 323fa: 25 97 sbiw r28, 0x05 ; 5 323fc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 32400: 9f 93 push r25 32402: 8f 93 push r24 32404: 7f 93 push r23 32406: 6f 93 push r22 32408: ff 92 push r15 3240a: ef 92 push r14 3240c: df 92 push r13 3240e: cf 92 push r12 32410: 86 e5 ldi r24, 0x56 ; 86 32412: 94 ea ldi r25, 0xA4 ; 164 32414: 9f 93 push r25 32416: 8f 93 push r24 32418: 0f 94 16 db call 0x3b62c ; 0x3b62c /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 3241c: 65 96 adiw r28, 0x15 ; 21 3241e: 4c ae std Y+60, r4 ; 0x3c 32420: 5d ae std Y+61, r5 ; 0x3d 32422: 6e ae std Y+62, r6 ; 0x3e 32424: 7f ae std Y+63, r7 ; 0x3f 32426: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 32428: 25 96 adiw r28, 0x05 ; 5 3242a: 8c ae std Y+60, r8 ; 0x3c 3242c: 9d ae std Y+61, r9 ; 0x3d 3242e: ae ae std Y+62, r10 ; 0x3e 32430: bf ae std Y+63, r11 ; 0x3f 32432: 25 97 sbiw r28, 0x05 ; 5 32434: 0f b6 in r0, 0x3f ; 63 32436: f8 94 cli 32438: de bf out 0x3e, r29 ; 62 3243a: 0f be out 0x3f, r0 ; 63 3243c: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 3243e: 20 e0 ldi r18, 0x00 ; 0 32440: 30 e0 ldi r19, 0x00 ; 0 32442: 48 e7 ldi r20, 0x78 ; 120 32444: 51 e4 ldi r21, 0x41 ; 65 32446: 65 96 adiw r28, 0x15 ; 21 32448: 6c ad ldd r22, Y+60 ; 0x3c 3244a: 7d ad ldd r23, Y+61 ; 0x3d 3244c: 8e ad ldd r24, Y+62 ; 0x3e 3244e: 9f ad ldd r25, Y+63 ; 0x3f 32450: 65 97 sbiw r28, 0x15 ; 21 32452: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 32456: 20 e0 ldi r18, 0x00 ; 0 32458: 30 e0 ldi r19, 0x00 ; 0 3245a: 40 e8 ldi r20, 0x80 ; 128 3245c: 52 e4 ldi r21, 0x42 ; 66 3245e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32462: 6b 01 movw r12, r22 32464: 7c 01 movw r14, r24 32466: 6c 96 adiw r28, 0x1c ; 28 32468: ae ad ldd r26, Y+62 ; 0x3e 3246a: bf ad ldd r27, Y+63 ; 0x3f 3246c: 6c 97 sbiw r28, 0x1c ; 28 3246e: bd 01 movw r22, r26 32470: bb 0f add r27, r27 32472: 88 0b sbc r24, r24 32474: 99 0b sbc r25, r25 32476: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 3247a: 9b 01 movw r18, r22 3247c: ac 01 movw r20, r24 3247e: c7 01 movw r24, r14 32480: b6 01 movw r22, r12 32482: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32486: 6b 01 movw r12, r22 32488: 7c 01 movw r14, r24 3248a: 65 96 adiw r28, 0x15 ; 21 3248c: cc ae std Y+60, r12 ; 0x3c 3248e: dd ae std Y+61, r13 ; 0x3d 32490: ee ae std Y+62, r14 ; 0x3e 32492: ff ae std Y+63, r15 ; 0x3f 32494: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 32496: 20 e0 ldi r18, 0x00 ; 0 32498: 30 e0 ldi r19, 0x00 ; 0 3249a: 48 e7 ldi r20, 0x78 ; 120 3249c: 51 e4 ldi r21, 0x41 ; 65 3249e: 25 96 adiw r28, 0x05 ; 5 324a0: 6c ad ldd r22, Y+60 ; 0x3c 324a2: 7d ad ldd r23, Y+61 ; 0x3d 324a4: 8e ad ldd r24, Y+62 ; 0x3e 324a6: 9f ad ldd r25, Y+63 ; 0x3f 324a8: 25 97 sbiw r28, 0x05 ; 5 324aa: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 324ae: 20 e0 ldi r18, 0x00 ; 0 324b0: 30 e0 ldi r19, 0x00 ; 0 324b2: 40 e8 ldi r20, 0x80 ; 128 324b4: 52 e4 ldi r21, 0x42 ; 66 324b6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 324ba: 4b 01 movw r8, r22 324bc: 5c 01 movw r10, r24 324be: ac 96 adiw r28, 0x2c ; 44 324c0: ee ad ldd r30, Y+62 ; 0x3e 324c2: ff ad ldd r31, Y+63 ; 0x3f 324c4: ac 97 sbiw r28, 0x2c ; 44 324c6: bf 01 movw r22, r30 324c8: ff 0f add r31, r31 324ca: 88 0b sbc r24, r24 324cc: 99 0b sbc r25, r25 324ce: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 324d2: 9b 01 movw r18, r22 324d4: ac 01 movw r20, r24 324d6: c5 01 movw r24, r10 324d8: b4 01 movw r22, r8 324da: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 324de: 25 96 adiw r28, 0x05 ; 5 324e0: 6c af std Y+60, r22 ; 0x3c 324e2: 7d af std Y+61, r23 ; 0x3d 324e4: 8e af std Y+62, r24 ; 0x3e 324e6: 9f af std Y+63, r25 ; 0x3f 324e8: 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; 324ea: 2a e0 ldi r18, 0x0A ; 10 324ec: 37 ed ldi r19, 0xD7 ; 215 324ee: 43 e2 ldi r20, 0x23 ; 35 324f0: 5c e3 ldi r21, 0x3C ; 60 324f2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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)); 324f6: 9f 93 push r25 324f8: 8f 93 push r24 324fa: 7f 93 push r23 324fc: 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; 324fe: 2a e0 ldi r18, 0x0A ; 10 32500: 37 ed ldi r19, 0xD7 ; 215 32502: 43 e2 ldi r20, 0x23 ; 35 32504: 5c e3 ldi r21, 0x3C ; 60 32506: c7 01 movw r24, r14 32508: b6 01 movw r22, r12 3250a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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)); 3250e: 9f 93 push r25 32510: 8f 93 push r24 32512: 7f 93 push r23 32514: 6f 93 push r22 32516: 8a e3 ldi r24, 0x3A ; 58 32518: 94 ea ldi r25, 0xA4 ; 164 3251a: 9f 93 push r25 3251c: 8f 93 push r24 3251e: 0f 94 16 db call 0x3b62c ; 0x3b62c uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 32522: 20 e0 ldi r18, 0x00 ; 0 32524: 30 e0 ldi r19, 0x00 ; 0 32526: 40 e0 ldi r20, 0x00 ; 0 32528: 5f e3 ldi r21, 0x3F ; 63 3252a: 25 96 adiw r28, 0x05 ; 5 3252c: 6c ad ldd r22, Y+60 ; 0x3c 3252e: 7d ad ldd r23, Y+61 ; 0x3d 32530: 8e ad ldd r24, Y+62 ; 0x3e 32532: 9f ad ldd r25, Y+63 ; 0x3f 32534: 25 97 sbiw r28, 0x05 ; 5 32536: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 3253a: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 3253e: 6b 01 movw r12, r22 32540: 20 e0 ldi r18, 0x00 ; 0 32542: 30 e0 ldi r19, 0x00 ; 0 32544: 40 e0 ldi r20, 0x00 ; 0 32546: 5f e3 ldi r21, 0x3F ; 63 32548: 65 96 adiw r28, 0x15 ; 21 3254a: 6c ad ldd r22, Y+60 ; 0x3c 3254c: 7d ad ldd r23, Y+61 ; 0x3d 3254e: 8e ad ldd r24, Y+62 ; 0x3e 32550: 9f ad ldd r25, Y+63 ; 0x3f 32552: 65 97 sbiw r28, 0x15 ; 21 32554: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32558: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 3255c: 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); 3255e: 00 e0 ldi r16, 0x00 ; 0 32560: 28 ec ldi r18, 0xC8 ; 200 32562: 30 e0 ldi r19, 0x00 ; 0 32564: e7 96 adiw r28, 0x37 ; 55 32566: 4e ad ldd r20, Y+62 ; 0x3e 32568: 5f ad ldd r21, Y+63 ; 0x3f 3256a: e7 97 sbiw r28, 0x37 ; 55 3256c: b6 01 movw r22, r12 3256e: 0e 94 53 ec call 0x1d8a6 ; 0x1d8a6 32572: 0f b6 in r0, 0x3f ; 63 32574: f8 94 cli 32576: de bf out 0x3e, r29 ; 62 32578: 0f be out 0x3f, r0 ; 63 3257a: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 3257c: 10 e0 ldi r17, 0x00 ; 0 3257e: 85 ea ldi r24, 0xA5 ; 165 32580: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 32582: a4 96 adiw r28, 0x24 ; 36 32584: ae ad ldd r26, Y+62 ; 0x3e 32586: bf ad ldd r27, Y+63 ; 0x3f 32588: a4 97 sbiw r28, 0x24 ; 36 3258a: 1d 92 st X+, r1 3258c: a4 96 adiw r28, 0x24 ; 36 3258e: bf af std Y+63, r27 ; 0x3f 32590: ae af std Y+62, r26 ; 0x3e 32592: 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++) 32594: 8a 17 cp r24, r26 32596: 9b 07 cpc r25, r27 32598: a1 f7 brne .-24 ; 0x32582 3259a: b5 c0 rjmp .+362 ; 0x32706 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)); 3259c: 89 eb ldi r24, 0xB9 ; 185 3259e: 9a e5 ldi r25, 0x5A ; 90 325a0: 0e 94 2c 72 call 0xe458 ; 0xe458 325a4: 0f 94 e9 20 call 0x241d2 ; 0x241d2 lcd_puts_at_P(0,3,_n("1/4")); 325a8: 47 ec ldi r20, 0xC7 ; 199 325aa: 5f e6 ldi r21, 0x6F ; 111 325ac: bc cb rjmp .-2184 ; 0x31d26 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 325ae: 80 e2 ldi r24, 0x20 ; 32 325b0: 95 ea ldi r25, 0xA5 ; 165 // 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); 325b2: 0f 94 f6 20 call 0x241ec ; 0x241ec 325b6: 9f cb rjmp .-2242 ; 0x31cf6 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); 325b8: c7 55 subi r28, 0x57 ; 87 325ba: df 4f sbci r29, 0xFF ; 255 325bc: 88 81 ld r24, Y 325be: 99 81 ldd r25, Y+1 ; 0x01 325c0: c9 5a subi r28, 0xA9 ; 169 325c2: d0 40 sbci r29, 0x00 ; 0 325c4: 0e 94 4e 66 call 0xcc9c ; 0xcc9c // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 325c8: 0f 94 d3 ce call 0x39da6 ; 0x39da6 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 325cc: 0f 94 71 cc call 0x398e2 ; 0x398e2 //FIXME bool result = sample_mesh_and_store_reference(); 325d0: 0f 94 80 ca call 0x39500 ; 0x39500 325d4: e5 96 adiw r28, 0x35 ; 53 325d6: 8f af std Y+63, r24 ; 0x3f 325d8: e5 97 sbiw r28, 0x35 ; 53 if (result) 325da: 88 23 and r24, r24 325dc: 09 f4 brne .+2 ; 0x325e0 325de: 8b cb rjmp .-2282 ; 0x31cf6 { calibration_status_set(CALIBRATION_STATUS_Z); 325e0: 84 e0 ldi r24, 0x04 ; 4 325e2: 0e 94 70 ef call 0x1dee0 ; 0x1dee0 } else { // Timeouted. } lcd_update_enable(true); 325e6: 81 e0 ldi r24, 0x01 ; 1 325e8: 0e 94 a5 6e call 0xdd4a ; 0xdd4a #ifdef TMC2130 FORCE_HIGH_POWER_END; 325ec: 80 e0 ldi r24, 0x00 ; 0 325ee: 0e 94 30 66 call 0xcc60 ; 0xcc60 #endif // TMC2130 FORCE_BL_ON_END; 325f2: 80 e0 ldi r24, 0x00 ; 0 325f4: 0e 94 d1 89 call 0x113a2 ; 0x113a2 return final_result; } 325f8: e5 96 adiw r28, 0x35 ; 53 325fa: 8f ad ldd r24, Y+63 ; 0x3f 325fc: e5 97 sbiw r28, 0x35 ; 53 325fe: c2 53 subi r28, 0x32 ; 50 32600: df 4f sbci r29, 0xFF ; 255 32602: 0f b6 in r0, 0x3f ; 63 32604: f8 94 cli 32606: de bf out 0x3e, r29 ; 62 32608: 0f be out 0x3f, r0 ; 63 3260a: cd bf out 0x3d, r28 ; 61 3260c: df 91 pop r29 3260e: cf 91 pop r28 32610: 1f 91 pop r17 32612: 0f 91 pop r16 32614: ff 90 pop r15 32616: ef 90 pop r14 32618: df 90 pop r13 3261a: cf 90 pop r12 3261c: bf 90 pop r11 3261e: af 90 pop r10 32620: 9f 90 pop r9 32622: 8f 90 pop r8 32624: 7f 90 pop r7 32626: 6f 90 pop r6 32628: 5f 90 pop r5 3262a: 4f 90 pop r4 3262c: 3f 90 pop r3 3262e: 2f 90 pop r2 32630: 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) { 32632: e1 e0 ldi r30, 0x01 ; 1 32634: e1 96 adiw r28, 0x31 ; 49 32636: ef af std Y+63, r30 ; 0x3f 32638: e1 97 sbiw r28, 0x31 ; 49 3263a: 0f cc rjmp .-2018 ; 0x31e5a 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) 3263c: fe 01 movw r30, r28 3263e: 31 96 adiw r30, 0x01 ; 1 32640: 7f 01 movw r14, r30 32642: 10 e0 ldi r17, 0x00 ; 0 32644: 00 e0 ldi r16, 0x00 ; 0 32646: 24 e8 ldi r18, 0x84 ; 132 32648: 33 e0 ldi r19, 0x03 ; 3 3264a: a6 01 movw r20, r12 3264c: 69 2d mov r22, r9 3264e: 78 2d mov r23, r8 32650: 8b 2d mov r24, r11 32652: 9a 2d mov r25, r10 32654: 0f 94 b6 6f call 0x2df6c ; 0x2df6c ad += 0; if (!ret && (ad < 1440)) 32658: 88 23 and r24, r24 3265a: 09 f4 brne .+2 ; 0x3265e 3265c: 06 cd rjmp .-1524 ; 0x3206a 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; 3265e: 89 81 ldd r24, Y+1 ; 0x01 32660: 9a 81 ldd r25, Y+2 ; 0x02 32662: 23 cd rjmp .-1466 ; 0x320aa 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)) 32664: 89 81 ldd r24, Y+1 ; 0x01 32666: 9a 81 ldd r25, Y+2 ; 0x02 32668: 80 34 cpi r24, 0x40 ; 64 3266a: 9b 40 sbci r25, 0x0B ; 11 3266c: b8 f4 brcc .+46 ; 0x3269c if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 3266e: ce 01 movw r24, r28 32670: 01 96 adiw r24, 0x01 ; 1 32672: 7c 01 movw r14, r24 32674: 04 eb ldi r16, 0xB4 ; 180 32676: 10 e0 ldi r17, 0x00 ; 0 32678: 2c e7 ldi r18, 0x7C ; 124 3267a: 3c ef ldi r19, 0xFC ; 252 3267c: a6 01 movw r20, r12 3267e: 4c 52 subi r20, 0x2C ; 44 32680: 51 40 sbci r21, 0x01 ; 1 32682: 69 2d mov r22, r9 32684: 78 2d mov r23, r8 32686: 8b 2d mov r24, r11 32688: 9a 2d mov r25, r10 3268a: 0f 94 b6 6f call 0x2df6c ; 0x2df6c 3268e: 88 23 and r24, r24 32690: 29 f0 breq .+10 ; 0x3269c ad += 2160; 32692: 89 81 ldd r24, Y+1 ; 0x01 32694: 9a 81 ldd r25, Y+2 ; 0x02 32696: 80 59 subi r24, 0x90 ; 144 32698: 97 4f sbci r25, 0xF7 ; 247 3269a: 07 cd rjmp .-1522 ; 0x320aa /// 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; 3269c: 90 e9 ldi r25, 0x90 ; 144 3269e: c9 1a sub r12, r25 326a0: 91 e0 ldi r25, 0x01 ; 1 326a2: d9 0a sbc r13, r25 326a4: ba cc rjmp .-1676 ; 0x3201a } //@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]); 326a6: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 326aa: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 326ae: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 326b2: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 326b6: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 326ba: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 326be: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 326c2: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 326c6: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 326ca: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 326ce: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 326d2: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 326d6: 3f 93 push r19 326d8: 2f 93 push r18 326da: 1f 93 push r17 326dc: 0f 93 push r16 326de: 7f 93 push r23 326e0: 6f 93 push r22 326e2: 5f 93 push r21 326e4: 4f 93 push r20 326e6: bf 93 push r27 326e8: af 93 push r26 326ea: 9f 93 push r25 326ec: 8f 93 push r24 326ee: 82 ec ldi r24, 0xC2 ; 194 326f0: 93 ea ldi r25, 0xA3 ; 163 326f2: 9f 93 push r25 326f4: 8f 93 push r24 326f6: 0f 94 16 db call 0x3b62c ; 0x3b62c 326fa: 0f b6 in r0, 0x3f ; 63 326fc: f8 94 cli 326fe: de bf out 0x3e, r29 ; 62 32700: 0f be out 0x3f, r0 ; 63 32702: 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; 32704: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 32706: 82 ea ldi r24, 0xA2 ; 162 32708: 94 ea ldi r25, 0xA4 ; 164 3270a: 9f 93 push r25 3270c: 8f 93 push r24 3270e: 0f 94 16 db call 0x3b62c ; 0x3b62c lcd_set_cursor(4,3); 32712: 63 e0 ldi r22, 0x03 ; 3 32714: 84 e0 ldi r24, 0x04 ; 4 32716: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_space(16); 3271a: 80 e1 ldi r24, 0x10 ; 16 3271c: 0e 94 56 6e call 0xdcac ; 0xdcac // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 32720: 0f 94 b4 c0 call 0x38168 ; 0x38168 : "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" ); 32724: 88 e1 ldi r24, 0x18 ; 24 32726: 98 e2 ldi r25, 0x28 ; 40 32728: 0f b6 in r0, 0x3f ; 63 3272a: f8 94 cli 3272c: a8 95 wdr 3272e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 32732: 0f be out 0x3f, r0 ; 63 32734: 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); 32738: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3273c: 80 64 ori r24, 0x40 ; 64 3273e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 32742: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 32746: 82 60 ori r24, 0x02 ; 2 32748: 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){ 3274c: 0f 90 pop r0 3274e: 0f 90 pop r0 32750: 1d 3f cpi r17, 0xFD ; 253 32752: 09 f4 brne .+2 ; 0x32756 32754: ee c1 rjmp .+988 ; 0x32b32 32756: 1f 3f cpi r17, 0xFF ; 255 32758: 11 f4 brne .+4 ; 0x3275e 3275a: 0d 94 e4 9e jmp 0x33dc8 ; 0x33dc8 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); 3275e: 20 e0 ldi r18, 0x00 ; 0 32760: 30 e0 ldi r19, 0x00 ; 0 32762: a9 01 movw r20, r18 32764: a0 96 adiw r28, 0x20 ; 32 32766: ee ad ldd r30, Y+62 ; 0x3e 32768: ff ad ldd r31, Y+63 ; 0x3f 3276a: a0 97 sbiw r28, 0x20 ; 32 3276c: 61 81 ldd r22, Z+1 ; 0x01 3276e: 72 81 ldd r23, Z+2 ; 0x02 32770: 83 81 ldd r24, Z+3 ; 0x03 32772: 94 81 ldd r25, Z+4 ; 0x04 32774: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 32778: 20 91 92 06 lds r18, 0x0692 ; 0x800692 3277c: 30 91 93 06 lds r19, 0x0693 ; 0x800693 32780: 40 91 94 06 lds r20, 0x0694 ; 0x800694 32784: 50 91 95 06 lds r21, 0x0695 ; 0x800695 32788: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 3278c: a0 96 adiw r28, 0x20 ; 32 3278e: ae ad ldd r26, Y+62 ; 0x3e 32790: bf ad ldd r27, Y+63 ; 0x3f 32792: a0 97 sbiw r28, 0x20 ; 32 32794: 11 96 adiw r26, 0x01 ; 1 32796: 6d 93 st X+, r22 32798: 7d 93 st X+, r23 3279a: 8d 93 st X+, r24 3279c: 9c 93 st X, r25 3279e: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 327a0: c0 90 96 06 lds r12, 0x0696 ; 0x800696 327a4: d0 90 97 06 lds r13, 0x0697 ; 0x800697 327a8: e0 90 98 06 lds r14, 0x0698 ; 0x800698 327ac: f0 90 99 06 lds r15, 0x0699 ; 0x800699 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); 327b0: 20 e0 ldi r18, 0x00 ; 0 327b2: 30 e0 ldi r19, 0x00 ; 0 327b4: a9 01 movw r20, r18 327b6: 15 96 adiw r26, 0x05 ; 5 327b8: 6d 91 ld r22, X+ 327ba: 7d 91 ld r23, X+ 327bc: 8d 91 ld r24, X+ 327be: 9c 91 ld r25, X 327c0: 18 97 sbiw r26, 0x08 ; 8 327c2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 327c6: a7 01 movw r20, r14 327c8: 96 01 movw r18, r12 327ca: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 327ce: a0 96 adiw r28, 0x20 ; 32 327d0: ee ad ldd r30, Y+62 ; 0x3e 327d2: ff ad ldd r31, Y+63 ; 0x3f 327d4: a0 97 sbiw r28, 0x20 ; 32 327d6: 65 83 std Z+5, r22 ; 0x05 327d8: 76 83 std Z+6, r23 ; 0x06 327da: 87 83 std Z+7, r24 ; 0x07 327dc: 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) 327de: 20 e0 ldi r18, 0x00 ; 0 327e0: 30 e0 ldi r19, 0x00 ; 0 327e2: 40 e8 ldi r20, 0x80 ; 128 327e4: 50 ec ldi r21, 0xC0 ; 192 327e6: c7 01 movw r24, r14 327e8: b6 01 movw r22, r12 327ea: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 327ee: 87 ff sbrs r24, 7 327f0: 0c c0 rjmp .+24 ; 0x3280a current_position[Y_AXIS] = Y_MIN_POS; 327f2: 80 e0 ldi r24, 0x00 ; 0 327f4: 90 e0 ldi r25, 0x00 ; 0 327f6: a0 e8 ldi r26, 0x80 ; 128 327f8: b0 ec ldi r27, 0xC0 ; 192 327fa: 80 93 96 06 sts 0x0696, r24 ; 0x800696 327fe: 90 93 97 06 sts 0x0697, r25 ; 0x800697 32802: a0 93 98 06 sts 0x0698, r26 ; 0x800698 32806: b0 93 99 06 sts 0x0699, r27 ; 0x800699 // 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; 3280a: 20 e0 ldi r18, 0x00 ; 0 3280c: 30 e0 ldi r19, 0x00 ; 0 3280e: 40 e4 ldi r20, 0x40 ; 64 32810: 50 e4 ldi r21, 0x40 ; 64 32812: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 32816: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 3281a: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3281e: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 32822: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32826: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 3282a: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3282e: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 32832: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d 32836: e0 96 adiw r28, 0x30 ; 48 32838: 2e ad ldd r18, Y+62 ; 0x3e 3283a: 3f ad ldd r19, Y+63 ; 0x3f 3283c: e0 97 sbiw r28, 0x30 ; 48 3283e: 28 5f subi r18, 0xF8 ; 248 32840: 3f 4f sbci r19, 0xFF ; 255 32842: e0 96 adiw r28, 0x30 ; 48 32844: 3f af std Y+63, r19 ; 0x3f 32846: 2e af std Y+62, r18 ; 0x3e 32848: e0 97 sbiw r28, 0x30 ; 48 3284a: a0 96 adiw r28, 0x20 ; 32 3284c: 4e ad ldd r20, Y+62 ; 0x3e 3284e: 5f ad ldd r21, Y+63 ; 0x3f 32850: a0 97 sbiw r28, 0x20 ; 32 32852: 48 5f subi r20, 0xF8 ; 248 32854: 5f 4f sbci r21, 0xFF ; 255 32856: a0 96 adiw r28, 0x20 ; 32 32858: 5f af std Y+63, r21 ; 0x3f 3285a: 4e af std Y+62, r20 ; 0x3e 3285c: 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) { 3285e: 54 e0 ldi r21, 0x04 ; 4 32860: 25 16 cp r2, r21 32862: 31 04 cpc r3, r1 32864: 09 f0 breq .+2 ; 0x32868 32866: 16 cb rjmp .-2516 ; 0x31e94 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 32868: a7 96 adiw r28, 0x27 ; 39 3286a: 6f ad ldd r22, Y+63 ; 0x3f 3286c: a7 97 sbiw r28, 0x27 ; 39 3286e: 66 23 and r22, r22 32870: 31 f0 breq .+12 ; 0x3287e 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) { 32872: e1 96 adiw r28, 0x31 ; 49 32874: 8f ad ldd r24, Y+63 ; 0x3f 32876: e1 97 sbiw r28, 0x31 ; 49 32878: 81 30 cpi r24, 0x01 ; 1 3287a: 09 f0 breq .+2 ; 0x3287e 3287c: da ce rjmp .-588 ; 0x32632 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 3287e: 82 ea ldi r24, 0xA2 ; 162 32880: 9f e6 ldi r25, 0x6F ; 111 32882: 9f 93 push r25 32884: 8f 93 push r24 32886: 0f 94 16 db call 0x3b62c ; 0x3b62c delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 3288a: 90 e0 ldi r25, 0x00 ; 0 3288c: 80 e0 ldi r24, 0x00 ; 0 3288e: 0e 94 6c 8c call 0x118d8 ; 0x118d8 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) { 32892: 0f 90 pop r0 32894: 0f 90 pop r0 32896: 20 e0 ldi r18, 0x00 ; 0 32898: 30 e0 ldi r19, 0x00 ; 0 3289a: 40 e9 ldi r20, 0x90 ; 144 3289c: 50 ec ldi r21, 0xC0 ; 192 3289e: 60 91 c7 13 lds r22, 0x13C7 ; 0x8013c7 328a2: 70 91 c8 13 lds r23, 0x13C8 ; 0x8013c8 328a6: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 328aa: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 328ae: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 328b2: 87 ff sbrs r24, 7 328b4: 45 c1 rjmp .+650 ; 0x32b40 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 328b6: 8e ee ldi r24, 0xEE ; 238 328b8: 94 ea ldi r25, 0xA4 ; 164 328ba: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 328be: 8c eb ldi r24, 0xBC ; 188 328c0: 94 ea ldi r25, 0xA4 ; 164 328c2: 0e 94 d0 76 call 0xeda0 ; 0xeda0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 328c6: 60 91 c7 13 lds r22, 0x13C7 ; 0x8013c7 328ca: 70 91 c8 13 lds r23, 0x13C8 ; 0x8013c8 328ce: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 328d2: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 328d6: 42 e0 ldi r20, 0x02 ; 2 328d8: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 328dc: 88 eb ldi r24, 0xB8 ; 184 328de: 94 ea ldi r25, 0xA4 ; 164 328e0: 0e 94 d0 76 call 0xeda0 ; 0xeda0 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 328e4: 60 e0 ldi r22, 0x00 ; 0 328e6: 70 e0 ldi r23, 0x00 ; 0 328e8: 80 e9 ldi r24, 0x90 ; 144 328ea: 90 ec ldi r25, 0xC0 ; 192 328ec: 0f 94 ef 75 call 0x2ebde ; 0x2ebde 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 328f0: 92 e0 ldi r25, 0x02 ; 2 328f2: af 96 adiw r28, 0x2f ; 47 328f4: 9f af std Y+63, r25 ; 0x3f 328f6: 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; 328f8: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 328fc: 10 92 f4 13 sts 0x13F4, r1 ; 0x8013f4 32900: 10 92 f5 13 sts 0x13F5, r1 ; 0x8013f5 32904: 10 92 f6 13 sts 0x13F6, r1 ; 0x8013f6 cntr[1] = 0.f; 32908: 10 92 f7 13 sts 0x13F7, r1 ; 0x8013f7 3290c: 10 92 f8 13 sts 0x13F8, r1 ; 0x8013f8 32910: 10 92 f9 13 sts 0x13F9, r1 ; 0x8013f9 32914: 10 92 fa 13 sts 0x13FA, r1 ; 0x8013fa 32918: a4 e6 ldi r26, 0x64 ; 100 3291a: e6 96 adiw r28, 0x36 ; 54 3291c: af af std Y+63, r26 ; 0x3f 3291e: 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; 32920: a2 96 adiw r28, 0x22 ; 34 32922: 1c ae std Y+60, r1 ; 0x3c 32924: 1d ae std Y+61, r1 ; 0x3d 32926: 1e ae std Y+62, r1 ; 0x3e 32928: 1f ae std Y+63, r1 ; 0x3f 3292a: 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; 3292c: a6 96 adiw r28, 0x26 ; 38 3292e: 1c ae std Y+60, r1 ; 0x3c 32930: 1d ae std Y+61, r1 ; 0x3d 32932: 1e ae std Y+62, r1 ; 0x3e 32934: 1f ae std Y+63, r1 ; 0x3f 32936: 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 }; 32938: fe 01 movw r30, r28 3293a: 31 96 adiw r30, 0x01 ; 1 3293c: 68 96 adiw r28, 0x18 ; 24 3293e: ff af std Y+63, r31 ; 0x3f 32940: ee af std Y+62, r30 ; 0x3e 32942: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 32944: 9e 01 movw r18, r28 32946: 2f 5b subi r18, 0xBF ; 191 32948: 3f 4f sbci r19, 0xFF ; 255 3294a: 6a 96 adiw r28, 0x1a ; 26 3294c: 3f af std Y+63, r19 ; 0x3f 3294e: 2e af std Y+62, r18 ; 0x3e 32950: 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; 32952: a6 96 adiw r28, 0x26 ; 38 32954: 6c ad ldd r22, Y+60 ; 0x3c 32956: 7d ad ldd r23, Y+61 ; 0x3d 32958: 8e ad ldd r24, Y+62 ; 0x3e 3295a: 9f ad ldd r25, Y+63 ; 0x3f 3295c: a6 97 sbiw r28, 0x26 ; 38 3295e: 0f 94 76 de call 0x3bcec ; 0x3bcec 32962: 6e 96 adiw r28, 0x1e ; 30 32964: 6c af std Y+60, r22 ; 0x3c 32966: 7d af std Y+61, r23 ; 0x3d 32968: 8e af std Y+62, r24 ; 0x3e 3296a: 9f af std Y+63, r25 ; 0x3f 3296c: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 3296e: a6 96 adiw r28, 0x26 ; 38 32970: 6c ad ldd r22, Y+60 ; 0x3c 32972: 7d ad ldd r23, Y+61 ; 0x3d 32974: 8e ad ldd r24, Y+62 ; 0x3e 32976: 9f ad ldd r25, Y+63 ; 0x3f 32978: a6 97 sbiw r28, 0x26 ; 38 3297a: 0f 94 3c e1 call 0x3c278 ; 0x3c278 3297e: cb 57 subi r28, 0x7B ; 123 32980: df 4f sbci r29, 0xFF ; 255 32982: 68 83 st Y, r22 32984: 79 83 std Y+1, r23 ; 0x01 32986: 8a 83 std Y+2, r24 ; 0x02 32988: 9b 83 std Y+3, r25 ; 0x03 3298a: c5 58 subi r28, 0x85 ; 133 3298c: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 3298e: a2 96 adiw r28, 0x22 ; 34 32990: 6c ad ldd r22, Y+60 ; 0x3c 32992: 7d ad ldd r23, Y+61 ; 0x3d 32994: 8e ad ldd r24, Y+62 ; 0x3e 32996: 9f ad ldd r25, Y+63 ; 0x3f 32998: a2 97 sbiw r28, 0x22 ; 34 3299a: 0f 94 76 de call 0x3bcec ; 0x3bcec 3299e: c7 57 subi r28, 0x77 ; 119 329a0: df 4f sbci r29, 0xFF ; 255 329a2: 68 83 st Y, r22 329a4: 79 83 std Y+1, r23 ; 0x01 329a6: 8a 83 std Y+2, r24 ; 0x02 329a8: 9b 83 std Y+3, r25 ; 0x03 329aa: c9 58 subi r28, 0x89 ; 137 329ac: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 329ae: a2 96 adiw r28, 0x22 ; 34 329b0: 6c ad ldd r22, Y+60 ; 0x3c 329b2: 7d ad ldd r23, Y+61 ; 0x3d 329b4: 8e ad ldd r24, Y+62 ; 0x3e 329b6: 9f ad ldd r25, Y+63 ; 0x3f 329b8: a2 97 sbiw r28, 0x22 ; 34 329ba: 0f 94 3c e1 call 0x3c278 ; 0x3c278 329be: cb 56 subi r28, 0x6B ; 107 329c0: df 4f sbci r29, 0xFF ; 255 329c2: 68 83 st Y, r22 329c4: 79 83 std Y+1, r23 ; 0x01 329c6: 8a 83 std Y+2, r24 ; 0x02 329c8: 9b 83 std Y+3, r25 ; 0x03 329ca: c5 59 subi r28, 0x95 ; 149 329cc: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 329ce: 68 96 adiw r28, 0x18 ; 24 329d0: ae ad ldd r26, Y+62 ; 0x3e 329d2: bf ad ldd r27, Y+63 ; 0x3f 329d4: 68 97 sbiw r28, 0x18 ; 24 329d6: e0 e4 ldi r30, 0x40 ; 64 329d8: 1d 92 st X+, r1 329da: ea 95 dec r30 329dc: e9 f7 brne .-6 ; 0x329d8 float b[4] = { 0.f }; 329de: 80 e1 ldi r24, 0x10 ; 16 329e0: 6a 96 adiw r28, 0x1a ; 26 329e2: ae ad ldd r26, Y+62 ; 0x3e 329e4: bf ad ldd r27, Y+63 ; 0x3f 329e6: 6a 97 sbiw r28, 0x1a ; 26 329e8: 1d 92 st X+, r1 329ea: 8a 95 dec r24 329ec: e9 f7 brne .-6 ; 0x329e8 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 329ee: 90 e0 ldi r25, 0x00 ; 0 329f0: 80 e0 ldi r24, 0x00 ; 0 329f2: 0e 94 6c 8c call 0x118d8 ; 0x118d8 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); 329f6: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 329fa: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 329fe: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 32a02: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 32a06: c5 55 subi r28, 0x55 ; 85 32a08: df 4f sbci r29, 0xFF ; 255 32a0a: 28 83 st Y, r18 32a0c: 39 83 std Y+1, r19 ; 0x01 32a0e: 4a 83 std Y+2, r20 ; 0x02 32a10: 5b 83 std Y+3, r21 ; 0x03 32a12: cb 5a subi r28, 0xAB ; 171 32a14: 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); 32a16: 80 91 f7 13 lds r24, 0x13F7 ; 0x8013f7 32a1a: 90 91 f8 13 lds r25, 0x13F8 ; 0x8013f8 32a1e: a0 91 f9 13 lds r26, 0x13F9 ; 0x8013f9 32a22: b0 91 fa 13 lds r27, 0x13FA ; 0x8013fa 32a26: c1 55 subi r28, 0x51 ; 81 32a28: df 4f sbci r29, 0xFF ; 255 32a2a: 88 83 st Y, r24 32a2c: 99 83 std Y+1, r25 ; 0x01 32a2e: aa 83 std Y+2, r26 ; 0x02 32a30: bb 83 std Y+3, r27 ; 0x03 32a32: cf 5a subi r28, 0xAF ; 175 32a34: d0 40 sbci r29, 0x00 ; 0 32a36: de 01 movw r26, r28 32a38: af 5b subi r26, 0xBF ; 191 32a3a: bf 4f sbci r27, 0xFF ; 255 32a3c: c7 56 subi r28, 0x67 ; 103 32a3e: df 4f sbci r29, 0xFF ; 255 32a40: b9 83 std Y+1, r27 ; 0x01 32a42: a8 83 st Y, r26 32a44: c9 59 subi r28, 0x99 ; 153 32a46: d0 40 sbci r29, 0x00 ; 0 32a48: fe 01 movw r30, r28 32a4a: 31 96 adiw r30, 0x01 ; 1 32a4c: ac 96 adiw r28, 0x2c ; 44 32a4e: ff af std Y+63, r31 ; 0x3f 32a50: ee af std Y+62, r30 ; 0x3e 32a52: 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) { 32a54: 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])); 32a56: cb 56 subi r28, 0x6B ; 107 32a58: df 4f sbci r29, 0xFF ; 255 32a5a: 28 81 ld r18, Y 32a5c: 39 81 ldd r19, Y+1 ; 0x01 32a5e: 4a 81 ldd r20, Y+2 ; 0x02 32a60: 5b 81 ldd r21, Y+3 ; 0x03 32a62: c5 59 subi r28, 0x95 ; 149 32a64: d0 40 sbci r29, 0x00 ; 0 32a66: 50 58 subi r21, 0x80 ; 128 32a68: ed 96 adiw r28, 0x3d ; 61 32a6a: 2c af std Y+60, r18 ; 0x3c 32a6c: 3d af std Y+61, r19 ; 0x3d 32a6e: 4e af std Y+62, r20 ; 0x3e 32a70: 5f af std Y+63, r21 ; 0x3f 32a72: 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])); 32a74: c7 57 subi r28, 0x77 ; 119 32a76: df 4f sbci r29, 0xFF ; 255 32a78: 88 81 ld r24, Y 32a7a: 99 81 ldd r25, Y+1 ; 0x01 32a7c: aa 81 ldd r26, Y+2 ; 0x02 32a7e: bb 81 ldd r27, Y+3 ; 0x03 32a80: c9 58 subi r28, 0x89 ; 137 32a82: d0 40 sbci r29, 0x00 ; 0 32a84: b0 58 subi r27, 0x80 ; 128 32a86: c3 58 subi r28, 0x83 ; 131 32a88: df 4f sbci r29, 0xFF ; 255 32a8a: 88 83 st Y, r24 32a8c: 99 83 std Y+1, r25 ; 0x01 32a8e: aa 83 std Y+2, r26 ; 0x02 32a90: bb 83 std Y+3, r27 ; 0x03 32a92: cd 57 subi r28, 0x7D ; 125 32a94: 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]) : 32a96: cb 57 subi r28, 0x7B ; 123 32a98: df 4f sbci r29, 0xFF ; 255 32a9a: 28 81 ld r18, Y 32a9c: 39 81 ldd r19, Y+1 ; 0x01 32a9e: 4a 81 ldd r20, Y+2 ; 0x02 32aa0: 5b 81 ldd r21, Y+3 ; 0x03 32aa2: c5 58 subi r28, 0x85 ; 133 32aa4: d0 40 sbci r29, 0x00 ; 0 32aa6: 50 58 subi r21, 0x80 ; 128 32aa8: cf 57 subi r28, 0x7F ; 127 32aaa: df 4f sbci r29, 0xFF ; 255 32aac: 28 83 st Y, r18 32aae: 39 83 std Y+1, r19 ; 0x01 32ab0: 4a 83 std Y+2, r20 ; 0x02 32ab2: 5b 83 std Y+3, r21 ; 0x03 32ab4: c1 58 subi r28, 0x81 ; 129 32ab6: 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) { 32ab8: ac 96 adiw r28, 0x2c ; 44 32aba: 2e ac ldd r2, Y+62 ; 0x3e 32abc: 3f ac ldd r3, Y+63 ; 0x3f 32abe: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 32ac0: 10 e0 ldi r17, 0x00 ; 0 32ac2: 62 ec ldi r22, 0xC2 ; 194 32ac4: 46 2e mov r4, r22 32ac6: 63 e1 ldi r22, 0x13 ; 19 32ac8: 56 2e mov r5, r22 32aca: 74 e0 ldi r23, 0x04 ; 4 32acc: 77 2e mov r7, r23 acc = 0; 32ace: c1 2c mov r12, r1 32ad0: d1 2c mov r13, r1 32ad2: 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) { 32ad4: 01 30 cpi r16, 0x01 ; 1 32ad6: 11 f4 brne .+4 ; 0x32adc 32ad8: 0d 94 98 9f jmp 0x33f30 ; 0x33f30 32adc: 11 30 cpi r17, 0x01 ; 1 32ade: 11 f4 brne .+4 ; 0x32ae4 32ae0: 0d 94 4a 9f jmp 0x33e94 ; 0x33e94 float a = (r == 0) ? 1.f : 32ae4: 00 23 and r16, r16 32ae6: 11 f4 brne .+4 ; 0x32aec 32ae8: 0d 94 8a 9f jmp 0x33f14 ; 0x33f14 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 32aec: 02 30 cpi r16, 0x02 ; 2 32aee: 61 f5 brne .+88 ; 0x32b48 32af0: d2 01 movw r26, r4 32af2: 11 96 adiw r26, 0x01 ; 1 32af4: 2d 91 ld r18, X+ 32af6: 3d 91 ld r19, X+ 32af8: 4d 91 ld r20, X+ 32afa: 5c 91 ld r21, X 32afc: 14 97 sbiw r26, 0x04 ; 4 32afe: cf 57 subi r28, 0x7F ; 127 32b00: df 4f sbci r29, 0xFF ; 255 32b02: 68 81 ld r22, Y 32b04: 79 81 ldd r23, Y+1 ; 0x01 32b06: 8a 81 ldd r24, Y+2 ; 0x02 32b08: 9b 81 ldd r25, Y+3 ; 0x03 32b0a: c1 58 subi r28, 0x81 ; 129 32b0c: d0 40 sbci r29, 0x00 ; 0 32b0e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32b12: 4b 01 movw r8, r22 32b14: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 32b16: 11 11 cpse r17, r1 32b18: 25 c0 rjmp .+74 ; 0x32b64 32b1a: 60 e0 ldi r22, 0x00 ; 0 32b1c: 70 e0 ldi r23, 0x00 ; 0 32b1e: 80 e8 ldi r24, 0x80 ; 128 32b20: 9f e3 ldi r25, 0x3F ; 63 32b22: 35 c0 rjmp .+106 ; 0x32b8e int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 32b24: 2f 3f cpi r18, 0xFF ; 255 32b26: 09 f0 breq .+2 ; 0x32b2a 32b28: 92 cb rjmp .-2268 ; 0x3224e ++maxs; 32b2a: 01 96 adiw r24, 0x01 ; 1 32b2c: 90 cb rjmp .-2272 ; 0x3224e /// 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; 32b2e: 1f ef ldi r17, 0xFF ; 255 32b30: 26 cd rjmp .-1460 ; 0x3257e 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; 32b32: e5 96 adiw r28, 0x35 ; 53 32b34: bf ad ldd r27, Y+63 ; 0x3f 32b36: e5 97 sbiw r28, 0x35 ; 53 32b38: a7 96 adiw r28, 0x27 ; 39 32b3a: bf af std Y+63, r27 ; 0x3f 32b3c: a7 97 sbiw r28, 0x27 ; 39 32b3e: 0f ce rjmp .-994 ; 0x3275e // 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; 32b40: af 96 adiw r28, 0x2f ; 47 32b42: 1f ae std Y+63, r1 ; 0x3f 32b44: af 97 sbiw r28, 0x2f ; 47 32b46: d8 ce rjmp .-592 ; 0x328f8 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]) : 32b48: f2 01 movw r30, r4 32b4a: 25 81 ldd r18, Z+5 ; 0x05 32b4c: 36 81 ldd r19, Z+6 ; 0x06 32b4e: 47 81 ldd r20, Z+7 ; 0x07 32b50: 50 85 ldd r21, Z+8 ; 0x08 32b52: c3 58 subi r28, 0x83 ; 131 32b54: df 4f sbci r29, 0xFF ; 255 32b56: 68 81 ld r22, Y 32b58: 79 81 ldd r23, Y+1 ; 0x01 32b5a: 8a 81 ldd r24, Y+2 ; 0x02 32b5c: 9b 81 ldd r25, Y+3 ; 0x03 32b5e: cd 57 subi r28, 0x7D ; 125 32b60: d0 40 sbci r29, 0x00 ; 0 32b62: d5 cf rjmp .-86 ; 0x32b0e (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 32b64: 12 30 cpi r17, 0x02 ; 2 32b66: 11 f0 breq .+4 ; 0x32b6c 32b68: 0d 94 8b 9e jmp 0x33d16 ; 0x33d16 32b6c: d2 01 movw r26, r4 32b6e: 11 96 adiw r26, 0x01 ; 1 32b70: 2d 91 ld r18, X+ 32b72: 3d 91 ld r19, X+ 32b74: 4d 91 ld r20, X+ 32b76: 5c 91 ld r21, X 32b78: 14 97 sbiw r26, 0x04 ; 4 32b7a: cf 57 subi r28, 0x7F ; 127 32b7c: df 4f sbci r29, 0xFF ; 255 32b7e: 68 81 ld r22, Y 32b80: 79 81 ldd r23, Y+1 ; 0x01 32b82: 8a 81 ldd r24, Y+2 ; 0x02 32b84: 9b 81 ldd r25, Y+3 ; 0x03 32b86: c1 58 subi r28, 0x81 ; 129 32b88: d0 40 sbci r29, 0x00 ; 0 32b8a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 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 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32b9a: 9b 01 movw r18, r22 32b9c: ac 01 movw r20, r24 32b9e: c7 01 movw r24, r14 32ba0: b6 01 movw r22, r12 32ba2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32ba6: 6b 01 movw r12, r22 32ba8: 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) { 32baa: 01 11 cpse r16, r1 32bac: 0d 94 a2 9f jmp 0x33f44 ; 0x33f44 32bb0: 7a 94 dec r7 32bb2: f8 e0 ldi r31, 0x08 ; 8 32bb4: 4f 0e add r4, r31 32bb6: 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) { 32bb8: 71 10 cpse r7, r1 32bba: 8c cf rjmp .-232 ; 0x32ad4 (-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; 32bbc: d1 01 movw r26, r2 32bbe: cd 92 st X+, r12 32bc0: dd 92 st X+, r13 32bc2: ed 92 st X+, r14 32bc4: fd 92 st X+, r15 32bc6: 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) { 32bc8: 1f 5f subi r17, 0xFF ; 255 32bca: 14 30 cpi r17, 0x04 ; 4 32bcc: 09 f0 breq .+2 ; 0x32bd0 32bce: 79 cf rjmp .-270 ; 0x32ac2 32bd0: 3f ee ldi r19, 0xEF ; 239 32bd2: 23 2e mov r2, r19 32bd4: 34 ea ldi r19, 0xA4 ; 164 32bd6: 33 2e mov r3, r19 32bd8: e2 ec ldi r30, 0xC2 ; 194 32bda: f3 e1 ldi r31, 0x13 ; 19 32bdc: a8 96 adiw r28, 0x28 ; 40 32bde: ff af std Y+63, r31 ; 0x3f 32be0: ee af std Y+62, r30 ; 0x3e 32be2: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 32be4: c3 57 subi r28, 0x73 ; 115 32be6: df 4f sbci r29, 0xFF ; 255 32be8: 18 82 st Y, r1 32bea: cd 58 subi r28, 0x8D ; 141 32bec: d0 40 sbci r29, 0x00 ; 0 32bee: c3 56 subi r28, 0x63 ; 99 32bf0: df 4f sbci r29, 0xFF ; 255 32bf2: 18 82 st Y, r1 32bf4: cd 59 subi r28, 0x9D ; 157 32bf6: d0 40 sbci r29, 0x00 ; 0 32bf8: cf 55 subi r28, 0x5F ; 95 32bfa: df 4f sbci r29, 0xFF ; 255 32bfc: 18 82 st Y, r1 32bfe: c1 5a subi r28, 0xA1 ; 161 32c00: d0 40 sbci r29, 0x00 ; 0 32c02: 10 e0 ldi r17, 0x00 ; 0 32c04: a8 96 adiw r28, 0x28 ; 40 32c06: ae ad ldd r26, Y+62 ; 0x3e 32c08: bf ad ldd r27, Y+63 ; 0x3f 32c0a: a8 97 sbiw r28, 0x28 ; 40 32c0c: 11 96 adiw r26, 0x01 ; 1 32c0e: 2d 91 ld r18, X+ 32c10: 3d 91 ld r19, X+ 32c12: 4d 91 ld r20, X+ 32c14: 5c 91 ld r21, X 32c16: 14 97 sbiw r26, 0x04 ; 4 32c18: e4 96 adiw r28, 0x34 ; 52 32c1a: 2c af std Y+60, r18 ; 0x3c 32c1c: 3d af std Y+61, r19 ; 0x3d 32c1e: 4e af std Y+62, r20 ; 0x3e 32c20: 5f af std Y+63, r21 ; 0x3f 32c22: e4 97 sbiw r28, 0x34 ; 52 32c24: 15 96 adiw r26, 0x05 ; 5 32c26: 4d 90 ld r4, X+ 32c28: 5d 90 ld r5, X+ 32c2a: 6d 90 ld r6, X+ 32c2c: 7c 90 ld r7, X 32c2e: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 32c30: 00 23 and r16, r16 32c32: 11 f4 brne .+4 ; 0x32c38 32c34: 0d 94 be 9e jmp 0x33d7c ; 0x33d7c ((r == 1) ? 0.f : 32c38: 81 2c mov r8, r1 32c3a: 91 2c mov r9, r1 32c3c: 54 01 movw r10, r8 32c3e: 01 30 cpi r16, 0x01 ; 1 32c40: 81 f0 breq .+32 ; 0x32c62 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 32c42: 02 30 cpi r16, 0x02 ; 2 32c44: 11 f0 breq .+4 ; 0x32c4a 32c46: 0d 94 b2 9e jmp 0x33d64 ; 0x33d64 32c4a: cf 57 subi r28, 0x7F ; 127 32c4c: df 4f sbci r29, 0xFF ; 255 32c4e: 68 81 ld r22, Y 32c50: 79 81 ldd r23, Y+1 ; 0x01 32c52: 8a 81 ldd r24, Y+2 ; 0x02 32c54: 9b 81 ldd r25, Y+3 ; 0x03 32c56: c1 58 subi r28, 0x81 ; 129 32c58: d0 40 sbci r29, 0x00 ; 0 32c5a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32c5e: 4b 01 movw r8, r22 32c60: 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); 32c62: e4 96 adiw r28, 0x34 ; 52 32c64: 2c ad ldd r18, Y+60 ; 0x3c 32c66: 3d ad ldd r19, Y+61 ; 0x3d 32c68: 4e ad ldd r20, Y+62 ; 0x3e 32c6a: 5f ad ldd r21, Y+63 ; 0x3f 32c6c: e4 97 sbiw r28, 0x34 ; 52 32c6e: 6e 96 adiw r28, 0x1e ; 30 32c70: 6c ad ldd r22, Y+60 ; 0x3c 32c72: 7d ad ldd r23, Y+61 ; 0x3d 32c74: 8e ad ldd r24, Y+62 ; 0x3e 32c76: 9f ad ldd r25, Y+63 ; 0x3f 32c78: 6e 97 sbiw r28, 0x1e ; 30 32c7a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32c7e: 6b 01 movw r12, r22 32c80: 7c 01 movw r14, r24 32c82: f1 01 movw r30, r2 32c84: 25 91 lpm r18, Z+ 32c86: 35 91 lpm r19, Z+ 32c88: 45 91 lpm r20, Z+ 32c8a: 54 91 lpm r21, Z 32c8c: cb 55 subi r28, 0x5B ; 91 32c8e: df 4f sbci r29, 0xFF ; 255 32c90: 28 83 st Y, r18 32c92: 39 83 std Y+1, r19 ; 0x01 32c94: 4a 83 std Y+2, r20 ; 0x02 32c96: 5b 83 std Y+3, r21 ; 0x03 32c98: c5 5a subi r28, 0xA5 ; 165 32c9a: d0 40 sbci r29, 0x00 ; 0 32c9c: a3 01 movw r20, r6 32c9e: 92 01 movw r18, r4 32ca0: cb 56 subi r28, 0x6B ; 107 32ca2: df 4f sbci r29, 0xFF ; 255 32ca4: 68 81 ld r22, Y 32ca6: 79 81 ldd r23, Y+1 ; 0x01 32ca8: 8a 81 ldd r24, Y+2 ; 0x02 32caa: 9b 81 ldd r25, Y+3 ; 0x03 32cac: c5 59 subi r28, 0x95 ; 149 32cae: d0 40 sbci r29, 0x00 ; 0 32cb0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32cb4: 9b 01 movw r18, r22 32cb6: ac 01 movw r20, r24 32cb8: c7 01 movw r24, r14 32cba: b6 01 movw r22, r12 32cbc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 32cc0: c5 55 subi r28, 0x55 ; 85 32cc2: df 4f sbci r29, 0xFF ; 255 32cc4: 28 81 ld r18, Y 32cc6: 39 81 ldd r19, Y+1 ; 0x01 32cc8: 4a 81 ldd r20, Y+2 ; 0x02 32cca: 5b 81 ldd r21, Y+3 ; 0x03 32ccc: cb 5a subi r28, 0xAB ; 171 32cce: d0 40 sbci r29, 0x00 ; 0 32cd0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32cd4: cb 55 subi r28, 0x5B ; 91 32cd6: df 4f sbci r29, 0xFF ; 255 32cd8: 28 81 ld r18, Y 32cda: 39 81 ldd r19, Y+1 ; 0x01 32cdc: 4a 81 ldd r20, Y+2 ; 0x02 32cde: 5b 81 ldd r21, Y+3 ; 0x03 32ce0: c5 5a subi r28, 0xA5 ; 165 32ce2: d0 40 sbci r29, 0x00 ; 0 32ce4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 32ce8: a5 01 movw r20, r10 32cea: 94 01 movw r18, r8 32cec: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32cf0: c3 57 subi r28, 0x73 ; 115 32cf2: df 4f sbci r29, 0xFF ; 255 32cf4: 28 81 ld r18, Y 32cf6: cd 58 subi r28, 0x8D ; 141 32cf8: d0 40 sbci r29, 0x00 ; 0 32cfa: c3 56 subi r28, 0x63 ; 99 32cfc: df 4f sbci r29, 0xFF ; 255 32cfe: 38 81 ld r19, Y 32d00: cd 59 subi r28, 0x9D ; 157 32d02: d0 40 sbci r29, 0x00 ; 0 32d04: cf 55 subi r28, 0x5F ; 95 32d06: df 4f sbci r29, 0xFF ; 255 32d08: 48 81 ld r20, Y 32d0a: c1 5a subi r28, 0xA1 ; 161 32d0c: d0 40 sbci r29, 0x00 ; 0 32d0e: 51 2f mov r21, r17 32d10: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32d14: c3 57 subi r28, 0x73 ; 115 32d16: df 4f sbci r29, 0xFF ; 255 32d18: 68 83 st Y, r22 32d1a: 79 83 std Y+1, r23 ; 0x01 32d1c: 8a 83 std Y+2, r24 ; 0x02 32d1e: 9b 83 std Y+3, r25 ; 0x03 32d20: cd 58 subi r28, 0x8D ; 141 32d22: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 32d24: 00 23 and r16, r16 32d26: 11 f4 brne .+4 ; 0x32d2c 32d28: 0d 94 c6 9e jmp 0x33d8c ; 0x33d8c ((r == 1) ? 1.f : 32d2c: 01 30 cpi r16, 0x01 ; 1 32d2e: 11 f4 brne .+4 ; 0x32d34 32d30: 0d 94 cb 9e jmp 0x33d96 ; 0x33d96 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 32d34: 02 30 cpi r16, 0x02 ; 2 32d36: 61 f0 breq .+24 ; 0x32d50 32d38: a3 01 movw r20, r6 32d3a: 92 01 movw r18, r4 32d3c: ed 96 adiw r28, 0x3d ; 61 32d3e: 6c ad ldd r22, Y+60 ; 0x3c 32d40: 7d ad ldd r23, Y+61 ; 0x3d 32d42: 8e ad ldd r24, Y+62 ; 0x3e 32d44: 9f ad ldd r25, Y+63 ; 0x3f 32d46: ed 97 sbiw r28, 0x3d ; 61 32d48: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32d4c: 6b 01 movw r12, r22 32d4e: 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); 32d50: f1 01 movw r30, r2 32d52: 34 96 adiw r30, 0x04 ; 4 32d54: 85 90 lpm r8, Z+ 32d56: 95 90 lpm r9, Z+ 32d58: a5 90 lpm r10, Z+ 32d5a: b4 90 lpm r11, Z 32d5c: e4 96 adiw r28, 0x34 ; 52 32d5e: 2c ad ldd r18, Y+60 ; 0x3c 32d60: 3d ad ldd r19, Y+61 ; 0x3d 32d62: 4e ad ldd r20, Y+62 ; 0x3e 32d64: 5f ad ldd r21, Y+63 ; 0x3f 32d66: e4 97 sbiw r28, 0x34 ; 52 32d68: cb 57 subi r28, 0x7B ; 123 32d6a: df 4f sbci r29, 0xFF ; 255 32d6c: 68 81 ld r22, Y 32d6e: 79 81 ldd r23, Y+1 ; 0x01 32d70: 8a 81 ldd r24, Y+2 ; 0x02 32d72: 9b 81 ldd r25, Y+3 ; 0x03 32d74: c5 58 subi r28, 0x85 ; 133 32d76: d0 40 sbci r29, 0x00 ; 0 32d78: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32d7c: e4 96 adiw r28, 0x34 ; 52 32d7e: 6c af std Y+60, r22 ; 0x3c 32d80: 7d af std Y+61, r23 ; 0x3d 32d82: 8e af std Y+62, r24 ; 0x3e 32d84: 9f af std Y+63, r25 ; 0x3f 32d86: e4 97 sbiw r28, 0x34 ; 52 32d88: a3 01 movw r20, r6 32d8a: 92 01 movw r18, r4 32d8c: c7 57 subi r28, 0x77 ; 119 32d8e: df 4f sbci r29, 0xFF ; 255 32d90: 68 81 ld r22, Y 32d92: 79 81 ldd r23, Y+1 ; 0x01 32d94: 8a 81 ldd r24, Y+2 ; 0x02 32d96: 9b 81 ldd r25, Y+3 ; 0x03 32d98: c9 58 subi r28, 0x89 ; 137 32d9a: d0 40 sbci r29, 0x00 ; 0 32d9c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32da0: 9b 01 movw r18, r22 32da2: ac 01 movw r20, r24 32da4: e4 96 adiw r28, 0x34 ; 52 32da6: 6c ad ldd r22, Y+60 ; 0x3c 32da8: 7d ad ldd r23, Y+61 ; 0x3d 32daa: 8e ad ldd r24, Y+62 ; 0x3e 32dac: 9f ad ldd r25, Y+63 ; 0x3f 32dae: e4 97 sbiw r28, 0x34 ; 52 32db0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32db4: c1 55 subi r28, 0x51 ; 81 32db6: df 4f sbci r29, 0xFF ; 255 32db8: 28 81 ld r18, Y 32dba: 39 81 ldd r19, Y+1 ; 0x01 32dbc: 4a 81 ldd r20, Y+2 ; 0x02 32dbe: 5b 81 ldd r21, Y+3 ; 0x03 32dc0: cf 5a subi r28, 0xAF ; 175 32dc2: d0 40 sbci r29, 0x00 ; 0 32dc4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32dc8: a5 01 movw r20, r10 32dca: 94 01 movw r18, r8 32dcc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 32dd0: a7 01 movw r20, r14 32dd2: 96 01 movw r18, r12 32dd4: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 32dd8: c3 57 subi r28, 0x73 ; 115 32dda: df 4f sbci r29, 0xFF ; 255 32ddc: 28 81 ld r18, Y 32dde: 39 81 ldd r19, Y+1 ; 0x01 32de0: 4a 81 ldd r20, Y+2 ; 0x02 32de2: 5b 81 ldd r21, Y+3 ; 0x03 32de4: cd 58 subi r28, 0x8D ; 141 32de6: d0 40 sbci r29, 0x00 ; 0 32de8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 32dec: c3 57 subi r28, 0x73 ; 115 32dee: df 4f sbci r29, 0xFF ; 255 32df0: 68 83 st Y, r22 32df2: cd 58 subi r28, 0x8D ; 141 32df4: d0 40 sbci r29, 0x00 ; 0 32df6: c3 56 subi r28, 0x63 ; 99 32df8: df 4f sbci r29, 0xFF ; 255 32dfa: 78 83 st Y, r23 32dfc: cd 59 subi r28, 0x9D ; 157 32dfe: d0 40 sbci r29, 0x00 ; 0 32e00: cf 55 subi r28, 0x5F ; 95 32e02: df 4f sbci r29, 0xFF ; 255 32e04: 88 83 st Y, r24 32e06: c1 5a subi r28, 0xA1 ; 161 32e08: d0 40 sbci r29, 0x00 ; 0 32e0a: 19 2f mov r17, r25 32e0c: a8 96 adiw r28, 0x28 ; 40 32e0e: 4e ad ldd r20, Y+62 ; 0x3e 32e10: 5f ad ldd r21, Y+63 ; 0x3f 32e12: a8 97 sbiw r28, 0x28 ; 40 32e14: 48 5f subi r20, 0xF8 ; 248 32e16: 5f 4f sbci r21, 0xFF ; 255 32e18: a8 96 adiw r28, 0x28 ; 40 32e1a: 5f af std Y+63, r21 ; 0x3f 32e1c: 4e af std Y+62, r20 ; 0x3e 32e1e: a8 97 sbiw r28, 0x28 ; 40 32e20: 58 e0 ldi r21, 0x08 ; 8 32e22: 25 0e add r2, r21 32e24: 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) { 32e26: a2 ee ldi r26, 0xE2 ; 226 32e28: b3 e1 ldi r27, 0x13 ; 19 32e2a: a8 96 adiw r28, 0x28 ; 40 32e2c: ee ad ldd r30, Y+62 ; 0x3e 32e2e: ff ad ldd r31, Y+63 ; 0x3f 32e30: a8 97 sbiw r28, 0x28 ; 40 32e32: ae 17 cp r26, r30 32e34: bf 07 cpc r27, r31 32e36: 09 f0 breq .+2 ; 0x32e3a 32e38: e5 ce rjmp .-566 ; 0x32c04 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; 32e3a: 90 58 subi r25, 0x80 ; 128 32e3c: c7 56 subi r28, 0x67 ; 103 32e3e: df 4f sbci r29, 0xFF ; 255 32e40: a8 81 ld r26, Y 32e42: b9 81 ldd r27, Y+1 ; 0x01 32e44: c9 59 subi r28, 0x99 ; 153 32e46: d0 40 sbci r29, 0x00 ; 0 32e48: 6d 93 st X+, r22 32e4a: 7d 93 st X+, r23 32e4c: 8d 93 st X+, r24 32e4e: 9d 93 st X+, r25 32e50: c7 56 subi r28, 0x67 ; 103 32e52: df 4f sbci r29, 0xFF ; 255 32e54: b9 83 std Y+1, r27 ; 0x01 32e56: a8 83 st Y, r26 32e58: c9 59 subi r28, 0x99 ; 153 32e5a: 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) { 32e5c: 0f 5f subi r16, 0xFF ; 255 32e5e: ac 96 adiw r28, 0x2c ; 44 32e60: ee ad ldd r30, Y+62 ; 0x3e 32e62: ff ad ldd r31, Y+63 ; 0x3f 32e64: ac 97 sbiw r28, 0x2c ; 44 32e66: 70 96 adiw r30, 0x10 ; 16 32e68: ac 96 adiw r28, 0x2c ; 44 32e6a: ff af std Y+63, r31 ; 0x3f 32e6c: ee af std Y+62, r30 ; 0x3e 32e6e: ac 97 sbiw r28, 0x2c ; 44 32e70: 04 30 cpi r16, 0x04 ; 4 32e72: 09 f0 breq .+2 ; 0x32e76 32e74: 21 ce rjmp .-958 ; 0x32ab8 } // 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]; 32e76: 25 96 adiw r28, 0x05 ; 5 32e78: 2c ad ldd r18, Y+60 ; 0x3c 32e7a: 3d ad ldd r19, Y+61 ; 0x3d 32e7c: 4e ad ldd r20, Y+62 ; 0x3e 32e7e: 5f ad ldd r21, Y+63 ; 0x3f 32e80: 25 97 sbiw r28, 0x05 ; 5 32e82: ae 96 adiw r28, 0x2e ; 46 32e84: 2c af std Y+60, r18 ; 0x3c 32e86: 3d af std Y+61, r19 ; 0x3d 32e88: 4e af std Y+62, r20 ; 0x3e 32e8a: 5f af std Y+63, r21 ; 0x3f 32e8c: ae 97 sbiw r28, 0x2e ; 46 32e8e: 8d 81 ldd r24, Y+5 ; 0x05 32e90: 9e 81 ldd r25, Y+6 ; 0x06 32e92: af 81 ldd r26, Y+7 ; 0x07 32e94: b8 85 ldd r27, Y+8 ; 0x08 32e96: e4 96 adiw r28, 0x34 ; 52 32e98: 8c af std Y+60, r24 ; 0x3c 32e9a: 9d af std Y+61, r25 ; 0x3d 32e9c: ae af std Y+62, r26 ; 0x3e 32e9e: bf af std Y+63, r27 ; 0x3f 32ea0: e4 97 sbiw r28, 0x34 ; 52 32ea2: 29 85 ldd r18, Y+9 ; 0x09 32ea4: 3a 85 ldd r19, Y+10 ; 0x0a 32ea6: 4b 85 ldd r20, Y+11 ; 0x0b 32ea8: 5c 85 ldd r21, Y+12 ; 0x0c 32eaa: ed 96 adiw r28, 0x3d ; 61 32eac: 2c af std Y+60, r18 ; 0x3c 32eae: 3d af std Y+61, r19 ; 0x3d 32eb0: 4e af std Y+62, r20 ; 0x3e 32eb2: 5f af std Y+63, r21 ; 0x3f 32eb4: ed 97 sbiw r28, 0x3d ; 61 32eb6: 8d 85 ldd r24, Y+13 ; 0x0d 32eb8: 9e 85 ldd r25, Y+14 ; 0x0e 32eba: af 85 ldd r26, Y+15 ; 0x0f 32ebc: b8 89 ldd r27, Y+16 ; 0x10 32ebe: c3 58 subi r28, 0x83 ; 131 32ec0: df 4f sbci r29, 0xFF ; 255 32ec2: 88 83 st Y, r24 32ec4: 99 83 std Y+1, r25 ; 0x01 32ec6: aa 83 std Y+2, r26 ; 0x02 32ec8: bb 83 std Y+3, r27 ; 0x03 32eca: cd 57 subi r28, 0x7D ; 125 32ecc: d0 40 sbci r29, 0x00 ; 0 32ece: 29 81 ldd r18, Y+1 ; 0x01 32ed0: 3a 81 ldd r19, Y+2 ; 0x02 32ed2: 4b 81 ldd r20, Y+3 ; 0x03 32ed4: 5c 81 ldd r21, Y+4 ; 0x04 32ed6: cf 57 subi r28, 0x7F ; 127 32ed8: df 4f sbci r29, 0xFF ; 255 32eda: 28 83 st Y, r18 32edc: 39 83 std Y+1, r19 ; 0x01 32ede: 4a 83 std Y+2, r20 ; 0x02 32ee0: 5b 83 std Y+3, r21 ; 0x03 32ee2: c1 58 subi r28, 0x81 ; 129 32ee4: 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]; 32ee6: 29 96 adiw r28, 0x09 ; 9 32ee8: 8c ad ldd r24, Y+60 ; 0x3c 32eea: 9d ad ldd r25, Y+61 ; 0x3d 32eec: ae ad ldd r26, Y+62 ; 0x3e 32eee: bf ad ldd r27, Y+63 ; 0x3f 32ef0: 29 97 sbiw r28, 0x09 ; 9 32ef2: cb 57 subi r28, 0x7B ; 123 32ef4: df 4f sbci r29, 0xFF ; 255 32ef6: 88 83 st Y, r24 32ef8: 99 83 std Y+1, r25 ; 0x01 32efa: aa 83 std Y+2, r26 ; 0x02 32efc: bb 83 std Y+3, r27 ; 0x03 32efe: c5 58 subi r28, 0x85 ; 133 32f00: d0 40 sbci r29, 0x00 ; 0 32f02: 29 89 ldd r18, Y+17 ; 0x11 32f04: 3a 89 ldd r19, Y+18 ; 0x12 32f06: 4b 89 ldd r20, Y+19 ; 0x13 32f08: 5c 89 ldd r21, Y+20 ; 0x14 32f0a: c7 57 subi r28, 0x77 ; 119 32f0c: df 4f sbci r29, 0xFF ; 255 32f0e: 28 83 st Y, r18 32f10: 39 83 std Y+1, r19 ; 0x01 32f12: 4a 83 std Y+2, r20 ; 0x02 32f14: 5b 83 std Y+3, r21 ; 0x03 32f16: c9 58 subi r28, 0x89 ; 137 32f18: d0 40 sbci r29, 0x00 ; 0 32f1a: 89 8d ldd r24, Y+25 ; 0x19 32f1c: 9a 8d ldd r25, Y+26 ; 0x1a 32f1e: ab 8d ldd r26, Y+27 ; 0x1b 32f20: bc 8d ldd r27, Y+28 ; 0x1c 32f22: cb 56 subi r28, 0x6B ; 107 32f24: df 4f sbci r29, 0xFF ; 255 32f26: 88 83 st Y, r24 32f28: 99 83 std Y+1, r25 ; 0x01 32f2a: aa 83 std Y+2, r26 ; 0x02 32f2c: bb 83 std Y+3, r27 ; 0x03 32f2e: c5 59 subi r28, 0x95 ; 149 32f30: d0 40 sbci r29, 0x00 ; 0 32f32: 2d 8d ldd r18, Y+29 ; 0x1d 32f34: 3e 8d ldd r19, Y+30 ; 0x1e 32f36: 4f 8d ldd r20, Y+31 ; 0x1f 32f38: 58 a1 ldd r21, Y+32 ; 0x20 32f3a: c7 56 subi r28, 0x67 ; 103 32f3c: df 4f sbci r29, 0xFF ; 255 32f3e: 28 83 st Y, r18 32f40: 39 83 std Y+1, r19 ; 0x01 32f42: 4a 83 std Y+2, r20 ; 0x02 32f44: 5b 83 std Y+3, r21 ; 0x03 32f46: c9 59 subi r28, 0x99 ; 153 32f48: d0 40 sbci r29, 0x00 ; 0 32f4a: 8d 89 ldd r24, Y+21 ; 0x15 32f4c: 9e 89 ldd r25, Y+22 ; 0x16 32f4e: af 89 ldd r26, Y+23 ; 0x17 32f50: b8 8d ldd r27, Y+24 ; 0x18 32f52: c3 57 subi r28, 0x73 ; 115 32f54: df 4f sbci r29, 0xFF ; 255 32f56: 88 83 st Y, r24 32f58: 99 83 std Y+1, r25 ; 0x01 32f5a: aa 83 std Y+2, r26 ; 0x02 32f5c: bb 83 std Y+3, r27 ; 0x03 32f5e: cd 58 subi r28, 0x8D ; 141 32f60: 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]; 32f62: 2d 96 adiw r28, 0x0d ; 13 32f64: 2c ad ldd r18, Y+60 ; 0x3c 32f66: 3d ad ldd r19, Y+61 ; 0x3d 32f68: 4e ad ldd r20, Y+62 ; 0x3e 32f6a: 5f ad ldd r21, Y+63 ; 0x3f 32f6c: 2d 97 sbiw r28, 0x0d ; 13 32f6e: c3 56 subi r28, 0x63 ; 99 32f70: df 4f sbci r29, 0xFF ; 255 32f72: 28 83 st Y, r18 32f74: 39 83 std Y+1, r19 ; 0x01 32f76: 4a 83 std Y+2, r20 ; 0x02 32f78: 5b 83 std Y+3, r21 ; 0x03 32f7a: cd 59 subi r28, 0x9D ; 157 32f7c: d0 40 sbci r29, 0x00 ; 0 32f7e: 89 a1 ldd r24, Y+33 ; 0x21 32f80: 9a a1 ldd r25, Y+34 ; 0x22 32f82: ab a1 ldd r26, Y+35 ; 0x23 32f84: bc a1 ldd r27, Y+36 ; 0x24 32f86: cf 55 subi r28, 0x5F ; 95 32f88: df 4f sbci r29, 0xFF ; 255 32f8a: 88 83 st Y, r24 32f8c: 99 83 std Y+1, r25 ; 0x01 32f8e: aa 83 std Y+2, r26 ; 0x02 32f90: bb 83 std Y+3, r27 ; 0x03 32f92: c1 5a subi r28, 0xA1 ; 161 32f94: d0 40 sbci r29, 0x00 ; 0 32f96: 2d a1 ldd r18, Y+37 ; 0x25 32f98: 3e a1 ldd r19, Y+38 ; 0x26 32f9a: 4f a1 ldd r20, Y+39 ; 0x27 32f9c: 58 a5 ldd r21, Y+40 ; 0x28 32f9e: cb 55 subi r28, 0x5B ; 91 32fa0: df 4f sbci r29, 0xFF ; 255 32fa2: 28 83 st Y, r18 32fa4: 39 83 std Y+1, r19 ; 0x01 32fa6: 4a 83 std Y+2, r20 ; 0x02 32fa8: 5b 83 std Y+3, r21 ; 0x03 32faa: c5 5a subi r28, 0xA5 ; 165 32fac: d0 40 sbci r29, 0x00 ; 0 32fae: 8d a5 ldd r24, Y+45 ; 0x2d 32fb0: 9e a5 ldd r25, Y+46 ; 0x2e 32fb2: af a5 ldd r26, Y+47 ; 0x2f 32fb4: b8 a9 ldd r27, Y+48 ; 0x30 32fb6: cd 54 subi r28, 0x4D ; 77 32fb8: df 4f sbci r29, 0xFF ; 255 32fba: 88 83 st Y, r24 32fbc: 99 83 std Y+1, r25 ; 0x01 32fbe: aa 83 std Y+2, r26 ; 0x02 32fc0: bb 83 std Y+3, r27 ; 0x03 32fc2: c3 5b subi r28, 0xB3 ; 179 32fc4: d0 40 sbci r29, 0x00 ; 0 32fc6: 29 a5 ldd r18, Y+41 ; 0x29 32fc8: 3a a5 ldd r19, Y+42 ; 0x2a 32fca: 4b a5 ldd r20, Y+43 ; 0x2b 32fcc: 5c a5 ldd r21, Y+44 ; 0x2c 32fce: c9 54 subi r28, 0x49 ; 73 32fd0: df 4f sbci r29, 0xFF ; 255 32fd2: 28 83 st Y, r18 32fd4: 39 83 std Y+1, r19 ; 0x01 32fd6: 4a 83 std Y+2, r20 ; 0x02 32fd8: 5b 83 std Y+3, r21 ; 0x03 32fda: c7 5b subi r28, 0xB7 ; 183 32fdc: 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]; 32fde: 61 96 adiw r28, 0x11 ; 17 32fe0: 8c ad ldd r24, Y+60 ; 0x3c 32fe2: 9d ad ldd r25, Y+61 ; 0x3d 32fe4: ae ad ldd r26, Y+62 ; 0x3e 32fe6: bf ad ldd r27, Y+63 ; 0x3f 32fe8: 61 97 sbiw r28, 0x11 ; 17 32fea: c5 54 subi r28, 0x45 ; 69 32fec: df 4f sbci r29, 0xFF ; 255 32fee: 88 83 st Y, r24 32ff0: 99 83 std Y+1, r25 ; 0x01 32ff2: aa 83 std Y+2, r26 ; 0x02 32ff4: bb 83 std Y+3, r27 ; 0x03 32ff6: cb 5b subi r28, 0xBB ; 187 32ff8: d0 40 sbci r29, 0x00 ; 0 32ffa: 29 a9 ldd r18, Y+49 ; 0x31 32ffc: 3a a9 ldd r19, Y+50 ; 0x32 32ffe: 4b a9 ldd r20, Y+51 ; 0x33 33000: 5c a9 ldd r21, Y+52 ; 0x34 33002: c1 54 subi r28, 0x41 ; 65 33004: df 4f sbci r29, 0xFF ; 255 33006: 28 83 st Y, r18 33008: 39 83 std Y+1, r19 ; 0x01 3300a: 4a 83 std Y+2, r20 ; 0x02 3300c: 5b 83 std Y+3, r21 ; 0x03 3300e: cf 5b subi r28, 0xBF ; 191 33010: d0 40 sbci r29, 0x00 ; 0 33012: 8d a9 ldd r24, Y+53 ; 0x35 33014: 9e a9 ldd r25, Y+54 ; 0x36 33016: af a9 ldd r26, Y+55 ; 0x37 33018: b8 ad ldd r27, Y+56 ; 0x38 3301a: cd 53 subi r28, 0x3D ; 61 3301c: df 4f sbci r29, 0xFF ; 255 3301e: 88 83 st Y, r24 33020: 99 83 std Y+1, r25 ; 0x01 33022: aa 83 std Y+2, r26 ; 0x02 33024: bb 83 std Y+3, r27 ; 0x03 33026: c3 5c subi r28, 0xC3 ; 195 33028: d0 40 sbci r29, 0x00 ; 0 3302a: 29 ad ldd r18, Y+57 ; 0x39 3302c: 3a ad ldd r19, Y+58 ; 0x3a 3302e: 4b ad ldd r20, Y+59 ; 0x3b 33030: 5c ad ldd r21, Y+60 ; 0x3c 33032: c9 53 subi r28, 0x39 ; 57 33034: df 4f sbci r29, 0xFF ; 255 33036: 28 83 st Y, r18 33038: 39 83 std Y+1, r19 ; 0x01 3303a: 4a 83 std Y+2, r20 ; 0x02 3303c: 5b 83 std Y+3, r21 ; 0x03 3303e: c7 5c subi r28, 0xC7 ; 199 33040: d0 40 sbci r29, 0x00 ; 0 33042: 21 96 adiw r28, 0x01 ; 1 33044: 8c ad ldd r24, Y+60 ; 0x3c 33046: 9d ad ldd r25, Y+61 ; 0x3d 33048: ae ad ldd r26, Y+62 ; 0x3e 3304a: bf ad ldd r27, Y+63 ; 0x3f 3304c: 21 97 sbiw r28, 0x01 ; 1 3304e: c5 53 subi r28, 0x35 ; 53 33050: df 4f sbci r29, 0xFF ; 255 33052: 88 83 st Y, r24 33054: 99 83 std Y+1, r25 ; 0x01 33056: aa 83 std Y+2, r26 ; 0x02 33058: bb 83 std Y+3, r27 ; 0x03 3305a: cb 5c subi r28, 0xCB ; 203 3305c: d0 40 sbci r29, 0x00 ; 0 3305e: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 33060: c1 2c mov r12, r1 33062: d1 2c mov r13, r1 33064: 76 01 movw r14, r12 33066: 46 01 movw r8, r12 33068: 57 01 movw r10, r14 3306a: 26 01 movw r4, r12 3306c: 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]; 3306e: a3 01 movw r20, r6 33070: 92 01 movw r18, r4 33072: e4 96 adiw r28, 0x34 ; 52 33074: 6c ad ldd r22, Y+60 ; 0x3c 33076: 7d ad ldd r23, Y+61 ; 0x3d 33078: 8e ad ldd r24, Y+62 ; 0x3e 3307a: 9f ad ldd r25, Y+63 ; 0x3f 3307c: e4 97 sbiw r28, 0x34 ; 52 3307e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33082: 9b 01 movw r18, r22 33084: ac 01 movw r20, r24 33086: ae 96 adiw r28, 0x2e ; 46 33088: 6c ad ldd r22, Y+60 ; 0x3c 3308a: 7d ad ldd r23, Y+61 ; 0x3d 3308c: 8e ad ldd r24, Y+62 ; 0x3e 3308e: 9f ad ldd r25, Y+63 ; 0x3f 33090: ae 97 sbiw r28, 0x2e ; 46 33092: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 33096: 2b 01 movw r4, r22 33098: 3c 01 movw r6, r24 3309a: a5 01 movw r20, r10 3309c: 94 01 movw r18, r8 3309e: ed 96 adiw r28, 0x3d ; 61 330a0: 6c ad ldd r22, Y+60 ; 0x3c 330a2: 7d ad ldd r23, Y+61 ; 0x3d 330a4: 8e ad ldd r24, Y+62 ; 0x3e 330a6: 9f ad ldd r25, Y+63 ; 0x3f 330a8: ed 97 sbiw r28, 0x3d ; 61 330aa: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 330ae: 9b 01 movw r18, r22 330b0: ac 01 movw r20, r24 330b2: c3 01 movw r24, r6 330b4: b2 01 movw r22, r4 330b6: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 330ba: 2b 01 movw r4, r22 330bc: 3c 01 movw r6, r24 330be: a7 01 movw r20, r14 330c0: 96 01 movw r18, r12 330c2: c3 58 subi r28, 0x83 ; 131 330c4: df 4f sbci r29, 0xFF ; 255 330c6: 68 81 ld r22, Y 330c8: 79 81 ldd r23, Y+1 ; 0x01 330ca: 8a 81 ldd r24, Y+2 ; 0x02 330cc: 9b 81 ldd r25, Y+3 ; 0x03 330ce: cd 57 subi r28, 0x7D ; 125 330d0: d0 40 sbci r29, 0x00 ; 0 330d2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 330d6: 9b 01 movw r18, r22 330d8: ac 01 movw r20, r24 330da: c3 01 movw r24, r6 330dc: b2 01 movw r22, r4 330de: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 330e2: cf 57 subi r28, 0x7F ; 127 330e4: df 4f sbci r29, 0xFF ; 255 330e6: 28 81 ld r18, Y 330e8: 39 81 ldd r19, Y+1 ; 0x01 330ea: 4a 81 ldd r20, Y+2 ; 0x02 330ec: 5b 81 ldd r21, Y+3 ; 0x03 330ee: c1 58 subi r28, 0x81 ; 129 330f0: d0 40 sbci r29, 0x00 ; 0 330f2: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 330f6: 6e 96 adiw r28, 0x1e ; 30 330f8: 6c af std Y+60, r22 ; 0x3c 330fa: 7d af std Y+61, r23 ; 0x3d 330fc: 8e af std Y+62, r24 ; 0x3e 330fe: 9f af std Y+63, r25 ; 0x3f 33100: 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]; 33102: c7 57 subi r28, 0x77 ; 119 33104: df 4f sbci r29, 0xFF ; 255 33106: 28 81 ld r18, Y 33108: 39 81 ldd r19, Y+1 ; 0x01 3310a: 4a 81 ldd r20, Y+2 ; 0x02 3310c: 5b 81 ldd r21, Y+3 ; 0x03 3310e: c9 58 subi r28, 0x89 ; 137 33110: d0 40 sbci r29, 0x00 ; 0 33112: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33116: 9b 01 movw r18, r22 33118: ac 01 movw r20, r24 3311a: cb 57 subi r28, 0x7B ; 123 3311c: df 4f sbci r29, 0xFF ; 255 3311e: 68 81 ld r22, Y 33120: 79 81 ldd r23, Y+1 ; 0x01 33122: 8a 81 ldd r24, Y+2 ; 0x02 33124: 9b 81 ldd r25, Y+3 ; 0x03 33126: c5 58 subi r28, 0x85 ; 133 33128: d0 40 sbci r29, 0x00 ; 0 3312a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3312e: 2b 01 movw r4, r22 33130: 3c 01 movw r6, r24 33132: a5 01 movw r20, r10 33134: 94 01 movw r18, r8 33136: cb 56 subi r28, 0x6B ; 107 33138: df 4f sbci r29, 0xFF ; 255 3313a: 68 81 ld r22, Y 3313c: 79 81 ldd r23, Y+1 ; 0x01 3313e: 8a 81 ldd r24, Y+2 ; 0x02 33140: 9b 81 ldd r25, Y+3 ; 0x03 33142: c5 59 subi r28, 0x95 ; 149 33144: d0 40 sbci r29, 0x00 ; 0 33146: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3314a: 9b 01 movw r18, r22 3314c: ac 01 movw r20, r24 3314e: c3 01 movw r24, r6 33150: b2 01 movw r22, r4 33152: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 33156: 4b 01 movw r8, r22 33158: 5c 01 movw r10, r24 3315a: a7 01 movw r20, r14 3315c: 96 01 movw r18, r12 3315e: c7 56 subi r28, 0x67 ; 103 33160: df 4f sbci r29, 0xFF ; 255 33162: 68 81 ld r22, Y 33164: 79 81 ldd r23, Y+1 ; 0x01 33166: 8a 81 ldd r24, Y+2 ; 0x02 33168: 9b 81 ldd r25, Y+3 ; 0x03 3316a: c9 59 subi r28, 0x99 ; 153 3316c: d0 40 sbci r29, 0x00 ; 0 3316e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33172: 9b 01 movw r18, r22 33174: ac 01 movw r20, r24 33176: c5 01 movw r24, r10 33178: b4 01 movw r22, r8 3317a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3317e: c3 57 subi r28, 0x73 ; 115 33180: df 4f sbci r29, 0xFF ; 255 33182: 28 81 ld r18, Y 33184: 39 81 ldd r19, Y+1 ; 0x01 33186: 4a 81 ldd r20, Y+2 ; 0x02 33188: 5b 81 ldd r21, Y+3 ; 0x03 3318a: cd 58 subi r28, 0x8D ; 141 3318c: d0 40 sbci r29, 0x00 ; 0 3318e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 33192: 2b 01 movw r4, r22 33194: 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]; 33196: cf 55 subi r28, 0x5F ; 95 33198: df 4f sbci r29, 0xFF ; 255 3319a: 28 81 ld r18, Y 3319c: 39 81 ldd r19, Y+1 ; 0x01 3319e: 4a 81 ldd r20, Y+2 ; 0x02 331a0: 5b 81 ldd r21, Y+3 ; 0x03 331a2: c1 5a subi r28, 0xA1 ; 161 331a4: d0 40 sbci r29, 0x00 ; 0 331a6: 6e 96 adiw r28, 0x1e ; 30 331a8: 6c ad ldd r22, Y+60 ; 0x3c 331aa: 7d ad ldd r23, Y+61 ; 0x3d 331ac: 8e ad ldd r24, Y+62 ; 0x3e 331ae: 9f ad ldd r25, Y+63 ; 0x3f 331b0: 6e 97 sbiw r28, 0x1e ; 30 331b2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 331b6: 9b 01 movw r18, r22 331b8: ac 01 movw r20, r24 331ba: c3 56 subi r28, 0x63 ; 99 331bc: df 4f sbci r29, 0xFF ; 255 331be: 68 81 ld r22, Y 331c0: 79 81 ldd r23, Y+1 ; 0x01 331c2: 8a 81 ldd r24, Y+2 ; 0x02 331c4: 9b 81 ldd r25, Y+3 ; 0x03 331c6: cd 59 subi r28, 0x9D ; 157 331c8: d0 40 sbci r29, 0x00 ; 0 331ca: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 331ce: 4b 01 movw r8, r22 331d0: 5c 01 movw r10, r24 331d2: cb 55 subi r28, 0x5B ; 91 331d4: df 4f sbci r29, 0xFF ; 255 331d6: 28 81 ld r18, Y 331d8: 39 81 ldd r19, Y+1 ; 0x01 331da: 4a 81 ldd r20, Y+2 ; 0x02 331dc: 5b 81 ldd r21, Y+3 ; 0x03 331de: c5 5a subi r28, 0xA5 ; 165 331e0: d0 40 sbci r29, 0x00 ; 0 331e2: c3 01 movw r24, r6 331e4: b2 01 movw r22, r4 331e6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 331ea: 9b 01 movw r18, r22 331ec: ac 01 movw r20, r24 331ee: c5 01 movw r24, r10 331f0: b4 01 movw r22, r8 331f2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 331f6: 4b 01 movw r8, r22 331f8: 5c 01 movw r10, r24 331fa: a7 01 movw r20, r14 331fc: 96 01 movw r18, r12 331fe: cd 54 subi r28, 0x4D ; 77 33200: df 4f sbci r29, 0xFF ; 255 33202: 68 81 ld r22, Y 33204: 79 81 ldd r23, Y+1 ; 0x01 33206: 8a 81 ldd r24, Y+2 ; 0x02 33208: 9b 81 ldd r25, Y+3 ; 0x03 3320a: c3 5b subi r28, 0xB3 ; 179 3320c: d0 40 sbci r29, 0x00 ; 0 3320e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33212: 9b 01 movw r18, r22 33214: ac 01 movw r20, r24 33216: c5 01 movw r24, r10 33218: b4 01 movw r22, r8 3321a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3321e: c9 54 subi r28, 0x49 ; 73 33220: df 4f sbci r29, 0xFF ; 255 33222: 28 81 ld r18, Y 33224: 39 81 ldd r19, Y+1 ; 0x01 33226: 4a 81 ldd r20, Y+2 ; 0x02 33228: 5b 81 ldd r21, Y+3 ; 0x03 3322a: c7 5b subi r28, 0xB7 ; 183 3322c: d0 40 sbci r29, 0x00 ; 0 3322e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 33232: 4b 01 movw r8, r22 33234: 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]; 33236: c1 54 subi r28, 0x41 ; 65 33238: df 4f sbci r29, 0xFF ; 255 3323a: 28 81 ld r18, Y 3323c: 39 81 ldd r19, Y+1 ; 0x01 3323e: 4a 81 ldd r20, Y+2 ; 0x02 33240: 5b 81 ldd r21, Y+3 ; 0x03 33242: cf 5b subi r28, 0xBF ; 191 33244: d0 40 sbci r29, 0x00 ; 0 33246: 6e 96 adiw r28, 0x1e ; 30 33248: 6c ad ldd r22, Y+60 ; 0x3c 3324a: 7d ad ldd r23, Y+61 ; 0x3d 3324c: 8e ad ldd r24, Y+62 ; 0x3e 3324e: 9f ad ldd r25, Y+63 ; 0x3f 33250: 6e 97 sbiw r28, 0x1e ; 30 33252: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33256: 9b 01 movw r18, r22 33258: ac 01 movw r20, r24 3325a: c5 54 subi r28, 0x45 ; 69 3325c: df 4f sbci r29, 0xFF ; 255 3325e: 68 81 ld r22, Y 33260: 79 81 ldd r23, Y+1 ; 0x01 33262: 8a 81 ldd r24, Y+2 ; 0x02 33264: 9b 81 ldd r25, Y+3 ; 0x03 33266: cb 5b subi r28, 0xBB ; 187 33268: d0 40 sbci r29, 0x00 ; 0 3326a: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3326e: 6b 01 movw r12, r22 33270: 7c 01 movw r14, r24 33272: cd 53 subi r28, 0x3D ; 61 33274: df 4f sbci r29, 0xFF ; 255 33276: 28 81 ld r18, Y 33278: 39 81 ldd r19, Y+1 ; 0x01 3327a: 4a 81 ldd r20, Y+2 ; 0x02 3327c: 5b 81 ldd r21, Y+3 ; 0x03 3327e: c3 5c subi r28, 0xC3 ; 195 33280: d0 40 sbci r29, 0x00 ; 0 33282: c3 01 movw r24, r6 33284: b2 01 movw r22, r4 33286: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3328a: 9b 01 movw r18, r22 3328c: ac 01 movw r20, r24 3328e: c7 01 movw r24, r14 33290: b6 01 movw r22, r12 33292: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 33296: 6b 01 movw r12, r22 33298: 7c 01 movw r14, r24 3329a: c9 53 subi r28, 0x39 ; 57 3329c: df 4f sbci r29, 0xFF ; 255 3329e: 28 81 ld r18, Y 332a0: 39 81 ldd r19, Y+1 ; 0x01 332a2: 4a 81 ldd r20, Y+2 ; 0x02 332a4: 5b 81 ldd r21, Y+3 ; 0x03 332a6: c7 5c subi r28, 0xC7 ; 199 332a8: d0 40 sbci r29, 0x00 ; 0 332aa: c5 01 movw r24, r10 332ac: b4 01 movw r22, r8 332ae: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 332b2: 9b 01 movw r18, r22 332b4: ac 01 movw r20, r24 332b6: c7 01 movw r24, r14 332b8: b6 01 movw r22, r12 332ba: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 332be: c5 53 subi r28, 0x35 ; 53 332c0: df 4f sbci r29, 0xFF ; 255 332c2: 28 81 ld r18, Y 332c4: 39 81 ldd r19, Y+1 ; 0x01 332c6: 4a 81 ldd r20, Y+2 ; 0x02 332c8: 5b 81 ldd r21, Y+3 ; 0x03 332ca: cb 5c subi r28, 0xCB ; 203 332cc: d0 40 sbci r29, 0x00 ; 0 332ce: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 332d2: 6b 01 movw r12, r22 332d4: 7c 01 movw r14, r24 332d6: 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) { 332d8: 09 f0 breq .+2 ; 0x332dc 332da: c9 ce rjmp .-622 ; 0x3306e // 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]; 332dc: 6e 96 adiw r28, 0x1e ; 30 332de: 2c ad ldd r18, Y+60 ; 0x3c 332e0: 3d ad ldd r19, Y+61 ; 0x3d 332e2: 4e ad ldd r20, Y+62 ; 0x3e 332e4: 5f ad ldd r21, Y+63 ; 0x3f 332e6: 6e 97 sbiw r28, 0x1e ; 30 332e8: c5 55 subi r28, 0x55 ; 85 332ea: df 4f sbci r29, 0xFF ; 255 332ec: 68 81 ld r22, Y 332ee: 79 81 ldd r23, Y+1 ; 0x01 332f0: 8a 81 ldd r24, Y+2 ; 0x02 332f2: 9b 81 ldd r25, Y+3 ; 0x03 332f4: cb 5a subi r28, 0xAB ; 171 332f6: d0 40 sbci r29, 0x00 ; 0 332f8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 332fc: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 33300: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 33304: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 33308: 90 93 f6 13 sts 0x13F6, r25 ; 0x8013f6 cntr[1] += h[1]; 3330c: a3 01 movw r20, r6 3330e: 92 01 movw r18, r4 33310: c1 55 subi r28, 0x51 ; 81 33312: df 4f sbci r29, 0xFF ; 255 33314: 68 81 ld r22, Y 33316: 79 81 ldd r23, Y+1 ; 0x01 33318: 8a 81 ldd r24, Y+2 ; 0x02 3331a: 9b 81 ldd r25, Y+3 ; 0x03 3331c: cf 5a subi r28, 0xAF ; 175 3331e: d0 40 sbci r29, 0x00 ; 0 33320: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 33324: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 33328: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 3332c: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 33330: 90 93 fa 13 sts 0x13FA, r25 ; 0x8013fa a1 += h[2]; 33334: a5 01 movw r20, r10 33336: 94 01 movw r18, r8 33338: a6 96 adiw r28, 0x26 ; 38 3333a: 6c ad ldd r22, Y+60 ; 0x3c 3333c: 7d ad ldd r23, Y+61 ; 0x3d 3333e: 8e ad ldd r24, Y+62 ; 0x3e 33340: 9f ad ldd r25, Y+63 ; 0x3f 33342: a6 97 sbiw r28, 0x26 ; 38 33344: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 33348: a6 96 adiw r28, 0x26 ; 38 3334a: 6c af std Y+60, r22 ; 0x3c 3334c: 7d af std Y+61, r23 ; 0x3d 3334e: 8e af std Y+62, r24 ; 0x3e 33350: 9f af std Y+63, r25 ; 0x3f 33352: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 33354: a7 01 movw r20, r14 33356: 96 01 movw r18, r12 33358: a2 96 adiw r28, 0x22 ; 34 3335a: 6c ad ldd r22, Y+60 ; 0x3c 3335c: 7d ad ldd r23, Y+61 ; 0x3d 3335e: 8e ad ldd r24, Y+62 ; 0x3e 33360: 9f ad ldd r25, Y+63 ; 0x3f 33362: a2 97 sbiw r28, 0x22 ; 34 33364: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 33368: a2 96 adiw r28, 0x22 ; 34 3336a: 6c af std Y+60, r22 ; 0x3c 3336c: 7d af std Y+61, r23 ; 0x3d 3336e: 8e af std Y+62, r24 ; 0x3e 33370: 9f af std Y+63, r25 ; 0x3f 33372: a2 97 sbiw r28, 0x22 ; 34 33374: e6 96 adiw r28, 0x36 ; 54 33376: 9f ad ldd r25, Y+63 ; 0x3f 33378: e6 97 sbiw r28, 0x36 ; 54 3337a: 91 50 subi r25, 0x01 ; 1 3337c: e6 96 adiw r28, 0x36 ; 54 3337e: 9f af std Y+63, r25 ; 0x3f 33380: 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) { 33382: 91 11 cpse r25, r1 33384: e6 ca rjmp .-2612 ; 0x32952 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 33386: a6 96 adiw r28, 0x26 ; 38 33388: 6c ad ldd r22, Y+60 ; 0x3c 3338a: 7d ad ldd r23, Y+61 ; 0x3d 3338c: 8e ad ldd r24, Y+62 ; 0x3e 3338e: 9f ad ldd r25, Y+63 ; 0x3f 33390: a6 97 sbiw r28, 0x26 ; 38 33392: 0f 94 76 de call 0x3bcec ; 0x3bcec 33396: 60 93 e3 13 sts 0x13E3, r22 ; 0x8013e3 3339a: 70 93 e4 13 sts 0x13E4, r23 ; 0x8013e4 3339e: 80 93 e5 13 sts 0x13E5, r24 ; 0x8013e5 333a2: 90 93 e6 13 sts 0x13E6, r25 ; 0x8013e6 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 333a6: a6 96 adiw r28, 0x26 ; 38 333a8: 6c ad ldd r22, Y+60 ; 0x3c 333aa: 7d ad ldd r23, Y+61 ; 0x3d 333ac: 8e ad ldd r24, Y+62 ; 0x3e 333ae: 9f ad ldd r25, Y+63 ; 0x3f 333b0: a6 97 sbiw r28, 0x26 ; 38 333b2: 0f 94 3c e1 call 0x3c278 ; 0x3c278 333b6: 60 93 e7 13 sts 0x13E7, r22 ; 0x8013e7 333ba: 70 93 e8 13 sts 0x13E8, r23 ; 0x8013e8 333be: 80 93 e9 13 sts 0x13E9, r24 ; 0x8013e9 333c2: 90 93 ea 13 sts 0x13EA, r25 ; 0x8013ea vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 333c6: a2 96 adiw r28, 0x22 ; 34 333c8: 6c ad ldd r22, Y+60 ; 0x3c 333ca: 7d ad ldd r23, Y+61 ; 0x3d 333cc: 8e ad ldd r24, Y+62 ; 0x3e 333ce: 9f ad ldd r25, Y+63 ; 0x3f 333d0: a2 97 sbiw r28, 0x22 ; 34 333d2: 0f 94 3c e1 call 0x3c278 ; 0x3c278 333d6: 90 58 subi r25, 0x80 ; 128 333d8: 60 93 eb 13 sts 0x13EB, r22 ; 0x8013eb 333dc: 70 93 ec 13 sts 0x13EC, r23 ; 0x8013ec 333e0: 80 93 ed 13 sts 0x13ED, r24 ; 0x8013ed 333e4: 90 93 ee 13 sts 0x13EE, r25 ; 0x8013ee vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 333e8: a2 96 adiw r28, 0x22 ; 34 333ea: 6c ad ldd r22, Y+60 ; 0x3c 333ec: 7d ad ldd r23, Y+61 ; 0x3d 333ee: 8e ad ldd r24, Y+62 ; 0x3e 333f0: 9f ad ldd r25, Y+63 ; 0x3f 333f2: a2 97 sbiw r28, 0x22 ; 34 333f4: 0f 94 76 de call 0x3bcec ; 0x3bcec 333f8: 60 93 ef 13 sts 0x13EF, r22 ; 0x8013ef 333fc: 70 93 f0 13 sts 0x13F0, r23 ; 0x8013f0 33400: 80 93 f1 13 sts 0x13F1, r24 ; 0x8013f1 33404: 90 93 f2 13 sts 0x13F2, r25 ; 0x8013f2 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 33408: a6 96 adiw r28, 0x26 ; 38 3340a: 2c ad ldd r18, Y+60 ; 0x3c 3340c: 3d ad ldd r19, Y+61 ; 0x3d 3340e: 4e ad ldd r20, Y+62 ; 0x3e 33410: 5f ad ldd r21, Y+63 ; 0x3f 33412: a6 97 sbiw r28, 0x26 ; 38 33414: a2 96 adiw r28, 0x22 ; 34 33416: 6c ad ldd r22, Y+60 ; 0x3c 33418: 7d ad ldd r23, Y+61 ; 0x3d 3341a: 8e ad ldd r24, Y+62 ; 0x3e 3341c: 9f ad ldd r25, Y+63 ; 0x3f 3341e: a2 97 sbiw r28, 0x22 ; 34 33420: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 33424: 4b 01 movw r8, r22 33426: 5c 01 movw r10, r24 33428: 7c 01 movw r14, r24 3342a: 6b 01 movw r12, r22 3342c: e8 94 clt 3342e: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 33430: 21 ee ldi r18, 0xE1 ; 225 33432: 3e e2 ldi r19, 0x2E ; 46 33434: 45 e6 ldi r20, 0x65 ; 101 33436: 52 e4 ldi r21, 0x42 ; 66 33438: a2 96 adiw r28, 0x22 ; 34 3343a: 6c ad ldd r22, Y+60 ; 0x3c 3343c: 7d ad ldd r23, Y+61 ; 0x3d 3343e: 8e ad ldd r24, Y+62 ; 0x3e 33440: 9f ad ldd r25, Y+63 ; 0x3f 33442: a2 97 sbiw r28, 0x22 ; 34 33444: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33448: 9f 93 push r25 3344a: 8f 93 push r24 3344c: 7f 93 push r23 3344e: 6f 93 push r22 33450: 21 ee ldi r18, 0xE1 ; 225 33452: 3e e2 ldi r19, 0x2E ; 46 33454: 45 e6 ldi r20, 0x65 ; 101 33456: 52 e4 ldi r21, 0x42 ; 66 33458: c5 01 movw r24, r10 3345a: b4 01 movw r22, r8 3345c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33460: 9f 93 push r25 33462: 8f 93 push r24 33464: 7f 93 push r23 33466: 6f 93 push r22 33468: 8e e4 ldi r24, 0x4E ; 78 3346a: 9f e6 ldi r25, 0x6F ; 111 3346c: 9f 93 push r25 3346e: 8f 93 push r24 33470: 0f 94 16 db call 0x3b62c ; 0x3b62c if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 33474: b7 01 movw r22, r14 33476: a6 01 movw r20, r12 33478: 80 e6 ldi r24, 0x60 ; 96 3347a: 9f e0 ldi r25, 0x0F ; 15 3347c: 0f 94 8a dc call 0x3b914 ; 0x3b914 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) 33480: 0f b6 in r0, 0x3f ; 63 33482: f8 94 cli 33484: de bf out 0x3e, r29 ; 62 33486: 0f be out 0x3f, r0 ; 63 33488: cd bf out 0x3d, r28 ; 61 3348a: 2f e1 ldi r18, 0x1F ; 31 3348c: 32 e4 ldi r19, 0x42 ; 66 3348e: 49 e0 ldi r20, 0x09 ; 9 33490: 5b e3 ldi r21, 0x3B ; 59 33492: c7 01 movw r24, r14 33494: b6 01 movw r22, r12 33496: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__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; 3349a: 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) 3349c: 18 16 cp r1, r24 3349e: 64 f4 brge .+24 ; 0x334b8 result = (angleDiff > bed_skew_angle_extreme) ? 334a0: 25 e3 ldi r18, 0x35 ; 53 334a2: 3a ef ldi r19, 0xFA ; 250 334a4: 4e e8 ldi r20, 0x8E ; 142 334a6: 5b e3 ldi r21, 0x3B ; 59 334a8: c7 01 movw r24, r14 334aa: b6 01 movw r22, r12 334ac: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 334b0: 12 e0 ldi r17, 0x02 ; 2 334b2: 18 16 cp r1, r24 334b4: 0c f0 brlt .+2 ; 0x334b8 334b6: 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 || 334b8: 25 e3 ldi r18, 0x35 ; 53 334ba: 3a ef ldi r19, 0xFA ; 250 334bc: 4e e8 ldi r20, 0x8E ; 142 334be: 5b e3 ldi r21, 0x3B ; 59 334c0: a6 96 adiw r28, 0x26 ; 38 334c2: 6c ad ldd r22, Y+60 ; 0x3c 334c4: 7d ad ldd r23, Y+61 ; 0x3d 334c6: 8e ad ldd r24, Y+62 ; 0x3e 334c8: 9f ad ldd r25, Y+63 ; 0x3f 334ca: a6 97 sbiw r28, 0x26 ; 38 334cc: 9f 77 andi r25, 0x7F ; 127 334ce: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 334d2: 18 16 cp r1, r24 334d4: 0c f4 brge .+2 ; 0x334d8 334d6: 67 c4 rjmp .+2254 ; 0x33da6 334d8: 25 e3 ldi r18, 0x35 ; 53 334da: 3a ef ldi r19, 0xFA ; 250 334dc: 4e e8 ldi r20, 0x8E ; 142 334de: 5b e3 ldi r21, 0x3B ; 59 334e0: a2 96 adiw r28, 0x22 ; 34 334e2: 6c ad ldd r22, Y+60 ; 0x3c 334e4: 7d ad ldd r23, Y+61 ; 0x3d 334e6: 8e ad ldd r24, Y+62 ; 0x3e 334e8: 9f ad ldd r25, Y+63 ; 0x3f 334ea: a2 97 sbiw r28, 0x22 ; 34 334ec: 9f 77 andi r25, 0x7F ; 127 334ee: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 334f2: 18 16 cp r1, r24 334f4: 0c f4 brge .+2 ; 0x334f8 334f6: 57 c4 rjmp .+2222 ; 0x33da6 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]; 334f8: 20 91 e3 13 lds r18, 0x13E3 ; 0x8013e3 334fc: 30 91 e4 13 lds r19, 0x13E4 ; 0x8013e4 33500: 40 91 e5 13 lds r20, 0x13E5 ; 0x8013e5 33504: 50 91 e6 13 lds r21, 0x13E6 ; 0x8013e6 33508: ae 96 adiw r28, 0x2e ; 46 3350a: 2c af std Y+60, r18 ; 0x3c 3350c: 3d af std Y+61, r19 ; 0x3d 3350e: 4e af std Y+62, r20 ; 0x3e 33510: 5f af std Y+63, r21 ; 0x3f 33512: ae 97 sbiw r28, 0x2e ; 46 33514: 80 91 eb 13 lds r24, 0x13EB ; 0x8013eb 33518: 90 91 ec 13 lds r25, 0x13EC ; 0x8013ec 3351c: a0 91 ed 13 lds r26, 0x13ED ; 0x8013ed 33520: b0 91 ee 13 lds r27, 0x13EE ; 0x8013ee 33524: e9 96 adiw r28, 0x39 ; 57 33526: 8c af std Y+60, r24 ; 0x3c 33528: 9d af std Y+61, r25 ; 0x3d 3352a: ae af std Y+62, r26 ; 0x3e 3352c: bf af std Y+63, r27 ; 0x3f 3352e: e9 97 sbiw r28, 0x39 ; 57 33530: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 33534: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 33538: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 3353c: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 33540: e4 96 adiw r28, 0x34 ; 52 33542: 2c af std Y+60, r18 ; 0x3c 33544: 3d af std Y+61, r19 ; 0x3d 33546: 4e af std Y+62, r20 ; 0x3e 33548: 5f af std Y+63, r21 ; 0x3f 3354a: 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]; 3354c: 80 91 e7 13 lds r24, 0x13E7 ; 0x8013e7 33550: 90 91 e8 13 lds r25, 0x13E8 ; 0x8013e8 33554: a0 91 e9 13 lds r26, 0x13E9 ; 0x8013e9 33558: b0 91 ea 13 lds r27, 0x13EA ; 0x8013ea 3355c: ed 96 adiw r28, 0x3d ; 61 3355e: 8c af std Y+60, r24 ; 0x3c 33560: 9d af std Y+61, r25 ; 0x3d 33562: ae af std Y+62, r26 ; 0x3e 33564: bf af std Y+63, r27 ; 0x3f 33566: ed 97 sbiw r28, 0x3d ; 61 33568: 20 91 ef 13 lds r18, 0x13EF ; 0x8013ef 3356c: 30 91 f0 13 lds r19, 0x13F0 ; 0x8013f0 33570: 40 91 f1 13 lds r20, 0x13F1 ; 0x8013f1 33574: 50 91 f2 13 lds r21, 0x13F2 ; 0x8013f2 33578: c3 58 subi r28, 0x83 ; 131 3357a: df 4f sbci r29, 0xFF ; 255 3357c: 28 83 st Y, r18 3357e: 39 83 std Y+1, r19 ; 0x01 33580: 4a 83 std Y+2, r20 ; 0x02 33582: 5b 83 std Y+3, r21 ; 0x03 33584: cd 57 subi r28, 0x7D ; 125 33586: d0 40 sbci r29, 0x00 ; 0 33588: 80 91 f7 13 lds r24, 0x13F7 ; 0x8013f7 3358c: 90 91 f8 13 lds r25, 0x13F8 ; 0x8013f8 33590: a0 91 f9 13 lds r26, 0x13F9 ; 0x8013f9 33594: b0 91 fa 13 lds r27, 0x13FA ; 0x8013fa 33598: cf 57 subi r28, 0x7F ; 127 3359a: df 4f sbci r29, 0xFF ; 255 3359c: 88 83 st Y, r24 3359e: 99 83 std Y+1, r25 ; 0x01 335a0: aa 83 std Y+2, r26 ; 0x02 335a2: bb 83 std Y+3, r27 ; 0x03 335a4: c1 58 subi r28, 0x81 ; 129 335a6: d0 40 sbci r29, 0x00 ; 0 335a8: af ee ldi r26, 0xEF ; 239 335aa: b4 ea ldi r27, 0xA4 ; 164 335ac: 6c 96 adiw r28, 0x1c ; 28 335ae: bf af std Y+63, r27 ; 0x3f 335b0: ae af std Y+62, r26 ; 0x3e 335b2: 6c 97 sbiw r28, 0x1c ; 28 335b4: 82 ec ldi r24, 0xC2 ; 194 335b6: 28 2e mov r2, r24 335b8: 83 e1 ldi r24, 0x13 ; 19 335ba: 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]; 335bc: f1 01 movw r30, r2 335be: c1 80 ldd r12, Z+1 ; 0x01 335c0: d2 80 ldd r13, Z+2 ; 0x02 335c2: e3 80 ldd r14, Z+3 ; 0x03 335c4: f4 80 ldd r15, Z+4 ; 0x04 335c6: 45 80 ldd r4, Z+5 ; 0x05 335c8: 56 80 ldd r5, Z+6 ; 0x06 335ca: 67 80 ldd r6, Z+7 ; 0x07 335cc: 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; 335ce: 6c 96 adiw r28, 0x1c ; 28 335d0: ee ad ldd r30, Y+62 ; 0x3e 335d2: ff ad ldd r31, Y+63 ; 0x3f 335d4: 6c 97 sbiw r28, 0x1c ; 28 335d6: 25 91 lpm r18, Z+ 335d8: 35 91 lpm r19, Z+ 335da: 45 91 lpm r20, Z+ 335dc: 54 91 lpm r21, Z 335de: cb 57 subi r28, 0x7B ; 123 335e0: df 4f sbci r29, 0xFF ; 255 335e2: 28 83 st Y, r18 335e4: 39 83 std Y+1, r19 ; 0x01 335e6: 4a 83 std Y+2, r20 ; 0x02 335e8: 5b 83 std Y+3, r21 ; 0x03 335ea: c5 58 subi r28, 0x85 ; 133 335ec: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 335ee: 6c 96 adiw r28, 0x1c ; 28 335f0: ee ad ldd r30, Y+62 ; 0x3e 335f2: ff ad ldd r31, Y+63 ; 0x3f 335f4: 6c 97 sbiw r28, 0x1c ; 28 335f6: 34 96 adiw r30, 0x04 ; 4 335f8: 85 90 lpm r8, Z+ 335fa: 95 90 lpm r9, Z+ 335fc: a5 90 lpm r10, Z+ 335fe: 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]; 33600: ed 96 adiw r28, 0x3d ; 61 33602: 2c ad ldd r18, Y+60 ; 0x3c 33604: 3d ad ldd r19, Y+61 ; 0x3d 33606: 4e ad ldd r20, Y+62 ; 0x3e 33608: 5f ad ldd r21, Y+63 ; 0x3f 3360a: ed 97 sbiw r28, 0x3d ; 61 3360c: c7 01 movw r24, r14 3360e: b6 01 movw r22, r12 33610: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33614: c7 57 subi r28, 0x77 ; 119 33616: df 4f sbci r29, 0xFF ; 255 33618: 68 83 st Y, r22 3361a: 79 83 std Y+1, r23 ; 0x01 3361c: 8a 83 std Y+2, r24 ; 0x02 3361e: 9b 83 std Y+3, r25 ; 0x03 33620: c9 58 subi r28, 0x89 ; 137 33622: d0 40 sbci r29, 0x00 ; 0 33624: c3 58 subi r28, 0x83 ; 131 33626: df 4f sbci r29, 0xFF ; 255 33628: 28 81 ld r18, Y 3362a: 39 81 ldd r19, Y+1 ; 0x01 3362c: 4a 81 ldd r20, Y+2 ; 0x02 3362e: 5b 81 ldd r21, Y+3 ; 0x03 33630: cd 57 subi r28, 0x7D ; 125 33632: d0 40 sbci r29, 0x00 ; 0 33634: c3 01 movw r24, r6 33636: b2 01 movw r22, r4 33638: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3363c: 9b 01 movw r18, r22 3363e: ac 01 movw r20, r24 33640: c7 57 subi r28, 0x77 ; 119 33642: df 4f sbci r29, 0xFF ; 255 33644: 68 81 ld r22, Y 33646: 79 81 ldd r23, Y+1 ; 0x01 33648: 8a 81 ldd r24, Y+2 ; 0x02 3364a: 9b 81 ldd r25, Y+3 ; 0x03 3364c: c9 58 subi r28, 0x89 ; 137 3364e: d0 40 sbci r29, 0x00 ; 0 33650: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 33654: cf 57 subi r28, 0x7F ; 127 33656: df 4f sbci r29, 0xFF ; 255 33658: 28 81 ld r18, Y 3365a: 39 81 ldd r19, Y+1 ; 0x01 3365c: 4a 81 ldd r20, Y+2 ; 0x02 3365e: 5b 81 ldd r21, Y+3 ; 0x03 33660: c1 58 subi r28, 0x81 ; 129 33662: d0 40 sbci r29, 0x00 ; 0 33664: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 33668: 9b 01 movw r18, r22 3366a: 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; 3366c: c5 01 movw r24, r10 3366e: b4 01 movw r22, r8 33670: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 33674: 4b 01 movw r8, r22 33676: 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]; 33678: a7 01 movw r20, r14 3367a: 96 01 movw r18, r12 3367c: ae 96 adiw r28, 0x2e ; 46 3367e: 6c ad ldd r22, Y+60 ; 0x3c 33680: 7d ad ldd r23, Y+61 ; 0x3d 33682: 8e ad ldd r24, Y+62 ; 0x3e 33684: 9f ad ldd r25, Y+63 ; 0x3f 33686: ae 97 sbiw r28, 0x2e ; 46 33688: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3368c: 6b 01 movw r12, r22 3368e: 7c 01 movw r14, r24 33690: a3 01 movw r20, r6 33692: 92 01 movw r18, r4 33694: e9 96 adiw r28, 0x39 ; 57 33696: 6c ad ldd r22, Y+60 ; 0x3c 33698: 7d ad ldd r23, Y+61 ; 0x3d 3369a: 8e ad ldd r24, Y+62 ; 0x3e 3369c: 9f ad ldd r25, Y+63 ; 0x3f 3369e: e9 97 sbiw r28, 0x39 ; 57 336a0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 336a4: 9b 01 movw r18, r22 336a6: ac 01 movw r20, r24 336a8: c7 01 movw r24, r14 336aa: b6 01 movw r22, r12 336ac: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 336b0: e4 96 adiw r28, 0x34 ; 52 336b2: 2c ad ldd r18, Y+60 ; 0x3c 336b4: 3d ad ldd r19, Y+61 ; 0x3d 336b6: 4e ad ldd r20, Y+62 ; 0x3e 336b8: 5f ad ldd r21, Y+63 ; 0x3f 336ba: e4 97 sbiw r28, 0x34 ; 52 336bc: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 336c0: 9b 01 movw r18, r22 336c2: 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; 336c4: cb 57 subi r28, 0x7B ; 123 336c6: df 4f sbci r29, 0xFF ; 255 336c8: 68 81 ld r22, Y 336ca: 79 81 ldd r23, Y+1 ; 0x01 336cc: 8a 81 ldd r24, Y+2 ; 0x02 336ce: 9b 81 ldd r25, Y+3 ; 0x03 336d0: c5 58 subi r28, 0x85 ; 133 336d2: d0 40 sbci r29, 0x00 ; 0 336d4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 336d8: a5 01 movw r20, r10 336da: 94 01 movw r18, r8 336dc: 0f 94 18 e0 call 0x3c030 ; 0x3c030 } 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) { 336e0: 2d ec ldi r18, 0xCD ; 205 336e2: 3c ec ldi r19, 0xCC ; 204 336e4: 4c e4 ldi r20, 0x4C ; 76 336e6: 5f e3 ldi r21, 0x3F ; 63 336e8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 336ec: 18 16 cp r1, r24 336ee: 0c f4 brge .+2 ; 0x336f2 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 336f0: 1e ef ldi r17, 0xFE ; 254 336f2: 38 e0 ldi r19, 0x08 ; 8 336f4: 23 0e add r2, r19 336f6: 31 1c adc r3, r1 336f8: 6c 96 adiw r28, 0x1c ; 28 336fa: 4e ad ldd r20, Y+62 ; 0x3e 336fc: 5f ad ldd r21, Y+63 ; 0x3f 336fe: 6c 97 sbiw r28, 0x1c ; 28 33700: 48 5f subi r20, 0xF8 ; 248 33702: 5f 4f sbci r21, 0xFF ; 255 33704: 6c 96 adiw r28, 0x1c ; 28 33706: 5f af std Y+63, r21 ; 0x3f 33708: 4e af std Y+62, r20 ; 0x3e 3370a: 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) { 3370c: a8 96 adiw r28, 0x28 ; 40 3370e: 8e ad ldd r24, Y+62 ; 0x3e 33710: 9f ad ldd r25, Y+63 ; 0x3f 33712: a8 97 sbiw r28, 0x28 ; 40 33714: 82 15 cp r24, r2 33716: 93 05 cpc r25, r3 33718: 09 f0 breq .+2 ; 0x3371c 3371a: 50 cf rjmp .-352 ; 0x335bc MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 3371c: 11 11 cpse r17, r1 3371e: 62 c1 rjmp .+708 ; 0x339e4 #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); 33720: a2 96 adiw r28, 0x22 ; 34 33722: 2c ad ldd r18, Y+60 ; 0x3c 33724: 3d ad ldd r19, Y+61 ; 0x3d 33726: 4e ad ldd r20, Y+62 ; 0x3e 33728: 5f ad ldd r21, Y+63 ; 0x3f 3372a: a2 97 sbiw r28, 0x22 ; 34 3372c: a6 96 adiw r28, 0x26 ; 38 3372e: 6c ad ldd r22, Y+60 ; 0x3c 33730: 7d ad ldd r23, Y+61 ; 0x3d 33732: 8e ad ldd r24, Y+62 ; 0x3e 33734: 9f ad ldd r25, Y+63 ; 0x3f 33736: a6 97 sbiw r28, 0x26 ; 38 33738: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 3373c: 20 e0 ldi r18, 0x00 ; 0 3373e: 30 e0 ldi r19, 0x00 ; 0 33740: 40 e0 ldi r20, 0x00 ; 0 33742: 5f e3 ldi r21, 0x3F ; 63 33744: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33748: 6b 01 movw r12, r22 3374a: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 3374c: 0f 94 76 de call 0x3bcec ; 0x3bcec 33750: a2 96 adiw r28, 0x22 ; 34 33752: 6c af std Y+60, r22 ; 0x3c 33754: 7d af std Y+61, r23 ; 0x3d 33756: 8e af std Y+62, r24 ; 0x3e 33758: 9f af std Y+63, r25 ; 0x3f 3375a: a2 97 sbiw r28, 0x22 ; 34 3375c: 60 93 e3 13 sts 0x13E3, r22 ; 0x8013e3 33760: 70 93 e4 13 sts 0x13E4, r23 ; 0x8013e4 33764: 80 93 e5 13 sts 0x13E5, r24 ; 0x8013e5 33768: 90 93 e6 13 sts 0x13E6, r25 ; 0x8013e6 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 3376c: c7 01 movw r24, r14 3376e: b6 01 movw r22, r12 33770: 0f 94 3c e1 call 0x3c278 ; 0x3c278 33774: a6 96 adiw r28, 0x26 ; 38 33776: 6c af std Y+60, r22 ; 0x3c 33778: 7d af std Y+61, r23 ; 0x3d 3377a: 8e af std Y+62, r24 ; 0x3e 3377c: 9f af std Y+63, r25 ; 0x3f 3377e: a6 97 sbiw r28, 0x26 ; 38 33780: 60 93 e7 13 sts 0x13E7, r22 ; 0x8013e7 33784: 70 93 e8 13 sts 0x13E8, r23 ; 0x8013e8 33788: 80 93 e9 13 sts 0x13E9, r24 ; 0x8013e9 3378c: 90 93 ea 13 sts 0x13EA, r25 ; 0x8013ea vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 33790: 9b 01 movw r18, r22 33792: ac 01 movw r20, r24 33794: 50 58 subi r21, 0x80 ; 128 33796: aa 96 adiw r28, 0x2a ; 42 33798: 2c af std Y+60, r18 ; 0x3c 3379a: 3d af std Y+61, r19 ; 0x3d 3379c: 4e af std Y+62, r20 ; 0x3e 3379e: 5f af std Y+63, r21 ; 0x3f 337a0: aa 97 sbiw r28, 0x2a ; 42 337a2: 20 93 eb 13 sts 0x13EB, r18 ; 0x8013eb 337a6: 30 93 ec 13 sts 0x13EC, r19 ; 0x8013ec 337aa: 40 93 ed 13 sts 0x13ED, r20 ; 0x8013ed 337ae: 50 93 ee 13 sts 0x13EE, r21 ; 0x8013ee vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 337b2: a2 96 adiw r28, 0x22 ; 34 337b4: 8c ad ldd r24, Y+60 ; 0x3c 337b6: 9d ad ldd r25, Y+61 ; 0x3d 337b8: ae ad ldd r26, Y+62 ; 0x3e 337ba: bf ad ldd r27, Y+63 ; 0x3f 337bc: a2 97 sbiw r28, 0x22 ; 34 337be: 80 93 ef 13 sts 0x13EF, r24 ; 0x8013ef 337c2: 90 93 f0 13 sts 0x13F0, r25 ; 0x8013f0 337c6: a0 93 f1 13 sts 0x13F1, r26 ; 0x8013f1 337ca: b0 93 f2 13 sts 0x13F2, r27 ; 0x8013f2 // Refresh the offset. cntr[0] = 0.f; 337ce: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 337d2: 10 92 f4 13 sts 0x13F4, r1 ; 0x8013f4 337d6: 10 92 f5 13 sts 0x13F5, r1 ; 0x8013f5 337da: 10 92 f6 13 sts 0x13F6, r1 ; 0x8013f6 cntr[1] = 0.f; 337de: 10 92 f7 13 sts 0x13F7, r1 ; 0x8013f7 337e2: 10 92 f8 13 sts 0x13F8, r1 ; 0x8013f8 337e6: 10 92 f9 13 sts 0x13F9, r1 ; 0x8013f9 337ea: 10 92 fa 13 sts 0x13FA, r1 ; 0x8013fa float wx = 0.f; 337ee: 41 2c mov r4, r1 337f0: 51 2c mov r5, r1 337f2: 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]; 337f4: cf 56 subi r28, 0x6F ; 111 337f6: df 4f sbci r29, 0xFF ; 255 337f8: a8 81 ld r26, Y 337fa: b9 81 ldd r27, Y+1 ; 0x01 337fc: c1 59 subi r28, 0x91 ; 145 337fe: d0 40 sbci r29, 0x00 ; 0 33800: 11 96 adiw r26, 0x01 ; 1 33802: 8d 90 ld r8, X+ 33804: 9d 90 ld r9, X+ 33806: ad 90 ld r10, X+ 33808: bc 90 ld r11, X 3380a: 14 97 sbiw r26, 0x04 ; 4 3380c: 15 96 adiw r26, 0x05 ; 5 3380e: 2d 91 ld r18, X+ 33810: 3d 91 ld r19, X+ 33812: 4d 91 ld r20, X+ 33814: 5c 91 ld r21, X 33816: 18 97 sbiw r26, 0x08 ; 8 33818: 6e 96 adiw r28, 0x1e ; 30 3381a: 2c af std Y+60, r18 ; 0x3c 3381c: 3d af std Y+61, r19 ; 0x3d 3381e: 4e af std Y+62, r20 ; 0x3e 33820: 5f af std Y+63, r21 ; 0x3f 33822: 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); 33824: cd 56 subi r28, 0x6D ; 109 33826: df 4f sbci r29, 0xFF ; 255 33828: e8 81 ld r30, Y 3382a: f9 81 ldd r31, Y+1 ; 0x01 3382c: c3 59 subi r28, 0x93 ; 147 3382e: d0 40 sbci r29, 0x00 ; 0 33830: c5 90 lpm r12, Z+ 33832: d5 90 lpm r13, Z+ 33834: e5 90 lpm r14, Z+ 33836: 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]; 33838: a5 01 movw r20, r10 3383a: 94 01 movw r18, r8 3383c: a2 96 adiw r28, 0x22 ; 34 3383e: 6c ad ldd r22, Y+60 ; 0x3c 33840: 7d ad ldd r23, Y+61 ; 0x3d 33842: 8e ad ldd r24, Y+62 ; 0x3e 33844: 9f ad ldd r25, Y+63 ; 0x3f 33846: a2 97 sbiw r28, 0x22 ; 34 33848: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3384c: ae 96 adiw r28, 0x2e ; 46 3384e: 6c af std Y+60, r22 ; 0x3c 33850: 7d af std Y+61, r23 ; 0x3d 33852: 8e af std Y+62, r24 ; 0x3e 33854: 9f af std Y+63, r25 ; 0x3f 33856: ae 97 sbiw r28, 0x2e ; 46 33858: 6e 96 adiw r28, 0x1e ; 30 3385a: 2c ad ldd r18, Y+60 ; 0x3c 3385c: 3d ad ldd r19, Y+61 ; 0x3d 3385e: 4e ad ldd r20, Y+62 ; 0x3e 33860: 5f ad ldd r21, Y+63 ; 0x3f 33862: 6e 97 sbiw r28, 0x1e ; 30 33864: aa 96 adiw r28, 0x2a ; 42 33866: 6c ad ldd r22, Y+60 ; 0x3c 33868: 7d ad ldd r23, Y+61 ; 0x3d 3386a: 8e ad ldd r24, Y+62 ; 0x3e 3386c: 9f ad ldd r25, Y+63 ; 0x3f 3386e: aa 97 sbiw r28, 0x2a ; 42 33870: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33874: 9b 01 movw r18, r22 33876: ac 01 movw r20, r24 33878: ae 96 adiw r28, 0x2e ; 46 3387a: 6c ad ldd r22, Y+60 ; 0x3c 3387c: 7d ad ldd r23, Y+61 ; 0x3d 3387e: 8e ad ldd r24, Y+62 ; 0x3e 33880: 9f ad ldd r25, Y+63 ; 0x3f 33882: ae 97 sbiw r28, 0x2e ; 46 33884: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 33888: 9b 01 movw r18, r22 3388a: 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); 3388c: c7 01 movw r24, r14 3388e: b6 01 movw r22, r12 33890: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 33894: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 33898: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 3389c: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 338a0: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 338a4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 338a8: 6b 01 movw r12, r22 338aa: 7c 01 movw r14, r24 338ac: c0 92 f3 13 sts 0x13F3, r12 ; 0x8013f3 338b0: d0 92 f4 13 sts 0x13F4, r13 ; 0x8013f4 338b4: e0 92 f5 13 sts 0x13F5, r14 ; 0x8013f5 338b8: f0 92 f6 13 sts 0x13F6, r15 ; 0x8013f6 wx += w; 338bc: 20 e0 ldi r18, 0x00 ; 0 338be: 30 e0 ldi r19, 0x00 ; 0 338c0: 40 e8 ldi r20, 0x80 ; 128 338c2: 5f e3 ldi r21, 0x3F ; 63 338c4: c3 01 movw r24, r6 338c6: b2 01 movw r22, r4 338c8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 338cc: 2b 01 movw r4, r22 338ce: 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); 338d0: cd 56 subi r28, 0x6D ; 109 338d2: df 4f sbci r29, 0xFF ; 255 338d4: e8 81 ld r30, Y 338d6: f9 81 ldd r31, Y+1 ; 0x01 338d8: c3 59 subi r28, 0x93 ; 147 338da: d0 40 sbci r29, 0x00 ; 0 338dc: 34 96 adiw r30, 0x04 ; 4 338de: 25 91 lpm r18, Z+ 338e0: 35 91 lpm r19, Z+ 338e2: 45 91 lpm r20, Z+ 338e4: 54 91 lpm r21, Z 338e6: ae 96 adiw r28, 0x2e ; 46 338e8: 2c af std Y+60, r18 ; 0x3c 338ea: 3d af std Y+61, r19 ; 0x3d 338ec: 4e af std Y+62, r20 ; 0x3e 338ee: 5f af std Y+63, r21 ; 0x3f 338f0: 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]; 338f2: a5 01 movw r20, r10 338f4: 94 01 movw r18, r8 338f6: a6 96 adiw r28, 0x26 ; 38 338f8: 6c ad ldd r22, Y+60 ; 0x3c 338fa: 7d ad ldd r23, Y+61 ; 0x3d 338fc: 8e ad ldd r24, Y+62 ; 0x3e 338fe: 9f ad ldd r25, Y+63 ; 0x3f 33900: a6 97 sbiw r28, 0x26 ; 38 33902: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33906: 4b 01 movw r8, r22 33908: 5c 01 movw r10, r24 3390a: 6e 96 adiw r28, 0x1e ; 30 3390c: 2c ad ldd r18, Y+60 ; 0x3c 3390e: 3d ad ldd r19, Y+61 ; 0x3d 33910: 4e ad ldd r20, Y+62 ; 0x3e 33912: 5f ad ldd r21, Y+63 ; 0x3f 33914: 6e 97 sbiw r28, 0x1e ; 30 33916: a2 96 adiw r28, 0x22 ; 34 33918: 6c ad ldd r22, Y+60 ; 0x3c 3391a: 7d ad ldd r23, Y+61 ; 0x3d 3391c: 8e ad ldd r24, Y+62 ; 0x3e 3391e: 9f ad ldd r25, Y+63 ; 0x3f 33920: a2 97 sbiw r28, 0x22 ; 34 33922: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33926: 9b 01 movw r18, r22 33928: ac 01 movw r20, r24 3392a: c5 01 movw r24, r10 3392c: b4 01 movw r22, r8 3392e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 33932: 9b 01 movw r18, r22 33934: 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); 33936: ae 96 adiw r28, 0x2e ; 46 33938: 6c ad ldd r22, Y+60 ; 0x3c 3393a: 7d ad ldd r23, Y+61 ; 0x3d 3393c: 8e ad ldd r24, Y+62 ; 0x3e 3393e: 9f ad ldd r25, Y+63 ; 0x3f 33940: ae 97 sbiw r28, 0x2e ; 46 33942: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 33946: 20 91 f7 13 lds r18, 0x13F7 ; 0x8013f7 3394a: 30 91 f8 13 lds r19, 0x13F8 ; 0x8013f8 3394e: 40 91 f9 13 lds r20, 0x13F9 ; 0x8013f9 33952: 50 91 fa 13 lds r21, 0x13FA ; 0x8013fa 33956: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 3395a: 4b 01 movw r8, r22 3395c: 5c 01 movw r10, r24 3395e: 80 92 f7 13 sts 0x13F7, r8 ; 0x8013f7 33962: 90 92 f8 13 sts 0x13F8, r9 ; 0x8013f8 33966: a0 92 f9 13 sts 0x13F9, r10 ; 0x8013f9 3396a: b0 92 fa 13 sts 0x13FA, r11 ; 0x8013fa 3396e: cf 56 subi r28, 0x6F ; 111 33970: df 4f sbci r29, 0xFF ; 255 33972: 48 81 ld r20, Y 33974: 59 81 ldd r21, Y+1 ; 0x01 33976: c1 59 subi r28, 0x91 ; 145 33978: d0 40 sbci r29, 0x00 ; 0 3397a: 48 5f subi r20, 0xF8 ; 248 3397c: 5f 4f sbci r21, 0xFF ; 255 3397e: cf 56 subi r28, 0x6F ; 111 33980: df 4f sbci r29, 0xFF ; 255 33982: 59 83 std Y+1, r21 ; 0x01 33984: 48 83 st Y, r20 33986: c1 59 subi r28, 0x91 ; 145 33988: d0 40 sbci r29, 0x00 ; 0 3398a: cd 56 subi r28, 0x6D ; 109 3398c: df 4f sbci r29, 0xFF ; 255 3398e: 88 81 ld r24, Y 33990: 99 81 ldd r25, Y+1 ; 0x01 33992: c3 59 subi r28, 0x93 ; 147 33994: d0 40 sbci r29, 0x00 ; 0 33996: 08 96 adiw r24, 0x08 ; 8 33998: cd 56 subi r28, 0x6D ; 109 3399a: df 4f sbci r29, 0xFF ; 255 3399c: 99 83 std Y+1, r25 ; 0x01 3399e: 88 83 st Y, r24 339a0: c3 59 subi r28, 0x93 ; 147 339a2: 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) { 339a4: 24 16 cp r2, r20 339a6: 35 06 cpc r3, r21 339a8: 09 f0 breq .+2 ; 0x339ac 339aa: 24 cf rjmp .-440 ; 0x337f4 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 339ac: a3 01 movw r20, r6 339ae: 92 01 movw r18, r4 339b0: c7 01 movw r24, r14 339b2: b6 01 movw r22, r12 339b4: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 339b8: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 339bc: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 339c0: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 339c4: 90 93 f6 13 sts 0x13F6, r25 ; 0x8013f6 cntr[1] /= wy; 339c8: a3 01 movw r20, r6 339ca: 92 01 movw r18, r4 339cc: c5 01 movw r24, r10 339ce: b4 01 movw r22, r8 339d0: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 339d4: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 339d8: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 339dc: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 339e0: 90 93 fa 13 sts 0x13FA, r25 ; 0x8013fa #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]; 339e4: 40 90 e3 13 lds r4, 0x13E3 ; 0x8013e3 339e8: 50 90 e4 13 lds r5, 0x13E4 ; 0x8013e4 339ec: 60 90 e5 13 lds r6, 0x13E5 ; 0x8013e5 339f0: 70 90 e6 13 lds r7, 0x13E6 ; 0x8013e6 339f4: c0 90 ef 13 lds r12, 0x13EF ; 0x8013ef 339f8: d0 90 f0 13 lds r13, 0x13F0 ; 0x8013f0 339fc: e0 90 f1 13 lds r14, 0x13F1 ; 0x8013f1 33a00: f0 90 f2 13 lds r15, 0x13F2 ; 0x8013f2 33a04: 20 91 e7 13 lds r18, 0x13E7 ; 0x8013e7 33a08: 30 91 e8 13 lds r19, 0x13E8 ; 0x8013e8 33a0c: 40 91 e9 13 lds r20, 0x13E9 ; 0x8013e9 33a10: 50 91 ea 13 lds r21, 0x13EA ; 0x8013ea 33a14: a2 96 adiw r28, 0x22 ; 34 33a16: 2c af std Y+60, r18 ; 0x3c 33a18: 3d af std Y+61, r19 ; 0x3d 33a1a: 4e af std Y+62, r20 ; 0x3e 33a1c: 5f af std Y+63, r21 ; 0x3f 33a1e: a2 97 sbiw r28, 0x22 ; 34 33a20: 80 91 eb 13 lds r24, 0x13EB ; 0x8013eb 33a24: 90 91 ec 13 lds r25, 0x13EC ; 0x8013ec 33a28: a0 91 ed 13 lds r26, 0x13ED ; 0x8013ed 33a2c: b0 91 ee 13 lds r27, 0x13EE ; 0x8013ee 33a30: a6 96 adiw r28, 0x26 ; 38 33a32: 8c af std Y+60, r24 ; 0x3c 33a34: 9d af std Y+61, r25 ; 0x3d 33a36: ae af std Y+62, r26 ; 0x3e 33a38: bf af std Y+63, r27 ; 0x3f 33a3a: a6 97 sbiw r28, 0x26 ; 38 33a3c: a7 01 movw r20, r14 33a3e: 96 01 movw r18, r12 33a40: c3 01 movw r24, r6 33a42: b2 01 movw r22, r4 33a44: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33a48: 4b 01 movw r8, r22 33a4a: 5c 01 movw r10, r24 33a4c: a6 96 adiw r28, 0x26 ; 38 33a4e: 2c ad ldd r18, Y+60 ; 0x3c 33a50: 3d ad ldd r19, Y+61 ; 0x3d 33a52: 4e ad ldd r20, Y+62 ; 0x3e 33a54: 5f ad ldd r21, Y+63 ; 0x3f 33a56: a6 97 sbiw r28, 0x26 ; 38 33a58: a2 96 adiw r28, 0x22 ; 34 33a5a: 6c ad ldd r22, Y+60 ; 0x3c 33a5c: 7d ad ldd r23, Y+61 ; 0x3d 33a5e: 8e ad ldd r24, Y+62 ; 0x3e 33a60: 9f ad ldd r25, Y+63 ; 0x3f 33a62: a2 97 sbiw r28, 0x22 ; 34 33a64: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33a68: 9b 01 movw r18, r22 33a6a: ac 01 movw r20, r24 33a6c: c5 01 movw r24, r10 33a6e: b4 01 movw r22, r8 33a70: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 33a74: 4b 01 movw r8, r22 33a76: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 33a78: ac 01 movw r20, r24 33a7a: 9b 01 movw r18, r22 33a7c: c7 01 movw r24, r14 33a7e: b6 01 movw r22, r12 33a80: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 33a84: 6b 01 movw r12, r22 33a86: 7c 01 movw r14, r24 33a88: a6 96 adiw r28, 0x26 ; 38 33a8a: 6c ad ldd r22, Y+60 ; 0x3c 33a8c: 7d ad ldd r23, Y+61 ; 0x3d 33a8e: 8e ad ldd r24, Y+62 ; 0x3e 33a90: 9f ad ldd r25, Y+63 ; 0x3f 33a92: a6 97 sbiw r28, 0x26 ; 38 33a94: 90 58 subi r25, 0x80 ; 128 33a96: a5 01 movw r20, r10 33a98: 94 01 movw r18, r8 33a9a: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 33a9e: a6 96 adiw r28, 0x26 ; 38 33aa0: 6c af std Y+60, r22 ; 0x3c 33aa2: 7d af std Y+61, r23 ; 0x3d 33aa4: 8e af std Y+62, r24 ; 0x3e 33aa6: 9f af std Y+63, r25 ; 0x3f 33aa8: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 33aaa: a2 96 adiw r28, 0x22 ; 34 33aac: 6c ad ldd r22, Y+60 ; 0x3c 33aae: 7d ad ldd r23, Y+61 ; 0x3d 33ab0: 8e ad ldd r24, Y+62 ; 0x3e 33ab2: 9f ad ldd r25, Y+63 ; 0x3f 33ab4: a2 97 sbiw r28, 0x22 ; 34 33ab6: 90 58 subi r25, 0x80 ; 128 33ab8: a5 01 movw r20, r10 33aba: 94 01 movw r18, r8 33abc: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 33ac0: aa 96 adiw r28, 0x2a ; 42 33ac2: 6c af std Y+60, r22 ; 0x3c 33ac4: 7d af std Y+61, r23 ; 0x3d 33ac6: 8e af std Y+62, r24 ; 0x3e 33ac8: 9f af std Y+63, r25 ; 0x3f 33aca: aa 97 sbiw r28, 0x2a ; 42 33acc: a5 01 movw r20, r10 33ace: 94 01 movw r18, r8 33ad0: c3 01 movw r24, r6 33ad2: b2 01 movw r22, r4 33ad4: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 33ad8: 4b 01 movw r8, r22 33ada: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 33adc: 40 90 f3 13 lds r4, 0x13F3 ; 0x8013f3 33ae0: 50 90 f4 13 lds r5, 0x13F4 ; 0x8013f4 33ae4: 60 90 f5 13 lds r6, 0x13F5 ; 0x8013f5 33ae8: 70 90 f6 13 lds r7, 0x13F6 ; 0x8013f6 33aec: 20 91 f7 13 lds r18, 0x13F7 ; 0x8013f7 33af0: 30 91 f8 13 lds r19, 0x13F8 ; 0x8013f8 33af4: 40 91 f9 13 lds r20, 0x13F9 ; 0x8013f9 33af8: 50 91 fa 13 lds r21, 0x13FA ; 0x8013fa 33afc: a2 96 adiw r28, 0x22 ; 34 33afe: 2c af std Y+60, r18 ; 0x3c 33b00: 3d af std Y+61, r19 ; 0x3d 33b02: 4e af std Y+62, r20 ; 0x3e 33b04: 5f af std Y+63, r21 ; 0x3f 33b06: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 33b08: c0 92 e3 13 sts 0x13E3, r12 ; 0x8013e3 33b0c: d0 92 e4 13 sts 0x13E4, r13 ; 0x8013e4 33b10: e0 92 e5 13 sts 0x13E5, r14 ; 0x8013e5 33b14: f0 92 e6 13 sts 0x13E6, r15 ; 0x8013e6 vec_x[1] = Ainv[1][0]; 33b18: aa 96 adiw r28, 0x2a ; 42 33b1a: 8c ad ldd r24, Y+60 ; 0x3c 33b1c: 9d ad ldd r25, Y+61 ; 0x3d 33b1e: ae ad ldd r26, Y+62 ; 0x3e 33b20: bf ad ldd r27, Y+63 ; 0x3f 33b22: aa 97 sbiw r28, 0x2a ; 42 33b24: 80 93 e7 13 sts 0x13E7, r24 ; 0x8013e7 33b28: 90 93 e8 13 sts 0x13E8, r25 ; 0x8013e8 33b2c: a0 93 e9 13 sts 0x13E9, r26 ; 0x8013e9 33b30: b0 93 ea 13 sts 0x13EA, r27 ; 0x8013ea vec_y[0] = Ainv[0][1]; 33b34: a6 96 adiw r28, 0x26 ; 38 33b36: 2c ad ldd r18, Y+60 ; 0x3c 33b38: 3d ad ldd r19, Y+61 ; 0x3d 33b3a: 4e ad ldd r20, Y+62 ; 0x3e 33b3c: 5f ad ldd r21, Y+63 ; 0x3f 33b3e: a6 97 sbiw r28, 0x26 ; 38 33b40: 20 93 eb 13 sts 0x13EB, r18 ; 0x8013eb 33b44: 30 93 ec 13 sts 0x13EC, r19 ; 0x8013ec 33b48: 40 93 ed 13 sts 0x13ED, r20 ; 0x8013ed 33b4c: 50 93 ee 13 sts 0x13EE, r21 ; 0x8013ee vec_y[1] = Ainv[1][1]; 33b50: 80 92 ef 13 sts 0x13EF, r8 ; 0x8013ef 33b54: 90 92 f0 13 sts 0x13F0, r9 ; 0x8013f0 33b58: a0 92 f1 13 sts 0x13F1, r10 ; 0x8013f1 33b5c: b0 92 f2 13 sts 0x13F2, r11 ; 0x8013f2 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], 33b60: c7 01 movw r24, r14 33b62: b6 01 movw r22, r12 33b64: 90 58 subi r25, 0x80 ; 128 33b66: a3 01 movw r20, r6 33b68: 92 01 movw r18, r4 33b6a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33b6e: 6b 01 movw r12, r22 33b70: 7c 01 movw r14, r24 33b72: a2 96 adiw r28, 0x22 ; 34 33b74: 2c ad ldd r18, Y+60 ; 0x3c 33b76: 3d ad ldd r19, Y+61 ; 0x3d 33b78: 4e ad ldd r20, Y+62 ; 0x3e 33b7a: 5f ad ldd r21, Y+63 ; 0x3f 33b7c: a2 97 sbiw r28, 0x22 ; 34 33b7e: a6 96 adiw r28, 0x26 ; 38 33b80: 6c ad ldd r22, Y+60 ; 0x3c 33b82: 7d ad ldd r23, Y+61 ; 0x3d 33b84: 8e ad ldd r24, Y+62 ; 0x3e 33b86: 9f ad ldd r25, Y+63 ; 0x3f 33b88: a6 97 sbiw r28, 0x26 ; 38 33b8a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33b8e: 9b 01 movw r18, r22 33b90: ac 01 movw r20, r24 33b92: c7 01 movw r24, r14 33b94: b6 01 movw r22, r12 33b96: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__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]; 33b9a: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 33b9e: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 33ba2: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 33ba6: 90 93 f6 13 sts 0x13F6, r25 ; 0x8013f6 { 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] 33baa: aa 96 adiw r28, 0x2a ; 42 33bac: 6c ad ldd r22, Y+60 ; 0x3c 33bae: 7d ad ldd r23, Y+61 ; 0x3d 33bb0: 8e ad ldd r24, Y+62 ; 0x3e 33bb2: 9f ad ldd r25, Y+63 ; 0x3f 33bb4: aa 97 sbiw r28, 0x2a ; 42 33bb6: 90 58 subi r25, 0x80 ; 128 33bb8: a3 01 movw r20, r6 33bba: 92 01 movw r18, r4 33bbc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33bc0: 6b 01 movw r12, r22 33bc2: 7c 01 movw r14, r24 33bc4: a2 96 adiw r28, 0x22 ; 34 33bc6: 2c ad ldd r18, Y+60 ; 0x3c 33bc8: 3d ad ldd r19, Y+61 ; 0x3d 33bca: 4e ad ldd r20, Y+62 ; 0x3e 33bcc: 5f ad ldd r21, Y+63 ; 0x3f 33bce: a2 97 sbiw r28, 0x22 ; 34 33bd0: c5 01 movw r24, r10 33bd2: b4 01 movw r22, r8 33bd4: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33bd8: 9b 01 movw r18, r22 33bda: ac 01 movw r20, r24 33bdc: c7 01 movw r24, r14 33bde: b6 01 movw r22, r12 33be0: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__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]; 33be4: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 33be8: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 33bec: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 33bf0: 90 93 fa 13 sts 0x13FA, r25 ; 0x8013fa 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 33bf4: 90 e0 ldi r25, 0x00 ; 0 33bf6: 80 e0 ldi r24, 0x00 ; 0 33bf8: 0e 94 6c 8c call 0x118d8 ; 0x118d8 if (result >= 0) { 33bfc: 17 fd sbrc r17, 7 33bfe: d5 c0 rjmp .+426 ; 0x33daa DBG(_n("Calibration success.\n")); 33c00: 8c e8 ldi r24, 0x8C ; 140 33c02: 9f e6 ldi r25, 0x6F ; 111 33c04: 9f 93 push r25 33c06: 8f 93 push r24 33c08: 0f 94 16 db call 0x3b62c ; 0x3b62c world2machine_update(vec_x, vec_y, cntr); 33c0c: 43 ef ldi r20, 0xF3 ; 243 33c0e: 53 e1 ldi r21, 0x13 ; 19 33c10: 6b ee ldi r22, 0xEB ; 235 33c12: 73 e1 ldi r23, 0x13 ; 19 33c14: 83 ee ldi r24, 0xE3 ; 227 33c16: 93 e1 ldi r25, 0x13 ; 19 33c18: 0f 94 ec cc call 0x399d8 ; 0x399d8 #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); 33c1c: 48 e0 ldi r20, 0x08 ; 8 33c1e: 50 e0 ldi r21, 0x00 ; 0 33c20: 65 ee ldi r22, 0xE5 ; 229 33c22: 7f e0 ldi r23, 0x0F ; 15 33c24: 83 ef ldi r24, 0xF3 ; 243 33c26: 93 e1 ldi r25, 0x13 ; 19 33c28: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 33c2c: 48 e0 ldi r20, 0x08 ; 8 33c2e: 50 e0 ldi r21, 0x00 ; 0 33c30: 6d ed ldi r22, 0xDD ; 221 33c32: 7f e0 ldi r23, 0x0F ; 15 33c34: 83 ee ldi r24, 0xE3 ; 227 33c36: 93 e1 ldi r25, 0x13 ; 19 33c38: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 33c3c: 48 e0 ldi r20, 0x08 ; 8 33c3e: 50 e0 ldi r21, 0x00 ; 0 33c40: 65 ed ldi r22, 0xD5 ; 213 33c42: 7f e0 ldi r23, 0x0F ; 15 33c44: 8b ee ldi r24, 0xEB ; 235 33c46: 93 e1 ldi r25, 0x13 ; 19 33c48: 0f 94 68 dc call 0x3b8d0 ; 0x3b8d0 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(); 33c4c: 0f 94 71 cc call 0x398e2 ; 0x398e2 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 33c50: 0f 90 pop r0 33c52: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 33c54: c7 55 subi r28, 0x57 ; 87 33c56: df 4f sbci r29, 0xFF ; 255 33c58: 88 81 ld r24, Y 33c5a: 99 81 ldd r25, Y+1 ; 0x01 33c5c: c9 5a subi r28, 0xA9 ; 169 33c5e: d0 40 sbci r29, 0x00 ; 0 33c60: 0e 94 4e 66 call 0xcc9c ; 0xcc9c // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 33c64: 80 e0 ldi r24, 0x00 ; 0 33c66: 90 e0 ldi r25, 0x00 ; 0 33c68: a0 ea ldi r26, 0xA0 ; 160 33c6a: b0 e4 ldi r27, 0x40 ; 64 33c6c: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 33c70: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 33c74: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 33c78: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 33c7c: 60 e0 ldi r22, 0x00 ; 0 33c7e: 70 e0 ldi r23, 0x00 ; 0 33c80: 80 ea ldi r24, 0xA0 ; 160 33c82: 91 e4 ldi r25, 0x41 ; 65 33c84: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 33c88: 0f 94 ed 43 call 0x287da ; 0x287da //#ifndef NEW_XYZCAL if (result >= 0) 33c8c: 17 fd sbrc r17, 7 33c8e: 22 c0 rjmp .+68 ; 0x33cd4 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; 33c90: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a 33c94: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b 33c98: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c 33c9c: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d destination[Z_AXIS] = 150.F; 33ca0: 80 e0 ldi r24, 0x00 ; 0 33ca2: 90 e0 ldi r25, 0x00 ; 0 33ca4: a6 e1 ldi r26, 0x16 ; 22 33ca6: b3 e4 ldi r27, 0x43 ; 67 33ca8: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c 33cac: 90 93 7d 06 sts 0x067D, r25 ; 0x80067d 33cb0: a0 93 7e 06 sts 0x067E, r26 ; 0x80067e 33cb4: b0 93 7f 06 sts 0x067F, r27 ; 0x80067f plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 33cb8: 65 e5 ldi r22, 0x55 ; 85 33cba: 75 e5 ldi r23, 0x55 ; 85 33cbc: 85 e5 ldi r24, 0x55 ; 85 33cbe: 91 e4 ldi r25, 0x41 ; 65 33cc0: 0f 94 4e c0 call 0x3809c ; 0x3809c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 33cc4: 8b e5 ldi r24, 0x5B ; 91 33cc6: 99 e5 ldi r25, 0x59 ; 89 33cc8: 0e 94 2c 72 call 0xe458 ; 0xe458 33ccc: 0f 94 f6 20 call 0x241ec ; 0x241ec // 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()) 33cd0: 0f 94 80 ca call 0x39500 ; 0x39500 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 33cd4: 81 e0 ldi r24, 0x01 ; 1 33cd6: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_update(2); 33cda: 82 e0 ldi r24, 0x02 ; 2 33cdc: 0e 94 27 6e call 0xdc4e ; 0xdc4e 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)); 33ce0: 8c e1 ldi r24, 0x1C ; 28 33ce2: 99 e5 ldi r25, 0x59 ; 89 } 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) { 33ce4: 1f 3f cpi r17, 0xFF ; 255 33ce6: 99 f0 breq .+38 ; 0x33d0e 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) { 33ce8: 1e 3f cpi r17, 0xFE ; 254 33cea: 09 f0 breq .+2 ; 0x33cee 33cec: 73 c0 rjmp .+230 ; 0x33dd4 if (point_too_far_mask == 0) 33cee: af 96 adiw r28, 0x2f ; 47 33cf0: 4f ad ldd r20, Y+63 ; 0x3f 33cf2: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 33cf4: 87 ee ldi r24, 0xE7 ; 231 33cf6: 98 e5 ldi r25, 0x58 ; 88 { 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) 33cf8: 44 23 and r20, r20 33cfa: 49 f0 breq .+18 ; 0x33d0e msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 33cfc: af 96 adiw r28, 0x2f ; 47 33cfe: 5f ad ldd r21, Y+63 ; 0x3f 33d00: 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); 33d02: 85 ea ldi r24, 0xA5 ; 165 33d04: 98 e5 ldi r25, 0x58 ; 88 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) 33d06: 52 30 cpi r21, 0x02 ; 2 33d08: 11 f0 breq .+4 ; 0x33d0e // 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); 33d0a: 8e e5 ldi r24, 0x5E ; 94 33d0c: 98 e5 ldi r25, 0x58 ; 88 33d0e: 0e 94 2c 72 call 0xe458 ; 0xe458 33d12: 0d 94 d9 92 jmp 0x325b2 ; 0x325b2 (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]) : 33d16: f2 01 movw r30, r4 33d18: 25 81 ldd r18, Z+5 ; 0x05 33d1a: 36 81 ldd r19, Z+6 ; 0x06 33d1c: 47 81 ldd r20, Z+7 ; 0x07 33d1e: 50 85 ldd r21, Z+8 ; 0x08 33d20: c3 58 subi r28, 0x83 ; 131 33d22: df 4f sbci r29, 0xFF ; 255 33d24: 68 81 ld r22, Y 33d26: 79 81 ldd r23, Y+1 ; 0x01 33d28: 8a 81 ldd r24, Y+2 ; 0x02 33d2a: 9b 81 ldd r25, Y+3 ; 0x03 33d2c: cd 57 subi r28, 0x7D ; 125 33d2e: d0 40 sbci r29, 0x00 ; 0 33d30: 0d 94 c5 95 jmp 0x32b8a ; 0x32b8a // 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]) : 33d34: f2 01 movw r30, r4 33d36: 25 81 ldd r18, Z+5 ; 0x05 33d38: 36 81 ldd r19, Z+6 ; 0x06 33d3a: 47 81 ldd r20, Z+7 ; 0x07 33d3c: 50 85 ldd r21, Z+8 ; 0x08 33d3e: ed 96 adiw r28, 0x3d ; 61 33d40: 6c ad ldd r22, Y+60 ; 0x3c 33d42: 7d ad ldd r23, Y+61 ; 0x3d 33d44: 8e ad ldd r24, Y+62 ; 0x3e 33d46: 9f ad ldd r25, Y+63 ; 0x3f 33d48: ed 97 sbiw r28, 0x3d ; 61 33d4a: b8 c0 rjmp .+368 ; 0x33ebc (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 33d4c: f2 01 movw r30, r4 33d4e: 25 81 ldd r18, Z+5 ; 0x05 33d50: 36 81 ldd r19, Z+6 ; 0x06 33d52: 47 81 ldd r20, Z+7 ; 0x07 33d54: 50 85 ldd r21, Z+8 ; 0x08 33d56: ed 96 adiw r28, 0x3d ; 61 33d58: 6c ad ldd r22, Y+60 ; 0x3c 33d5a: 7d ad ldd r23, Y+61 ; 0x3d 33d5c: 8e ad ldd r24, Y+62 ; 0x3e 33d5e: 9f ad ldd r25, Y+63 ; 0x3f 33d60: ed 97 sbiw r28, 0x3d ; 61 33d62: c6 c0 rjmp .+396 ; 0x33ef0 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]) : 33d64: a3 01 movw r20, r6 33d66: 92 01 movw r18, r4 33d68: c3 58 subi r28, 0x83 ; 131 33d6a: df 4f sbci r29, 0xFF ; 255 33d6c: 68 81 ld r22, Y 33d6e: 79 81 ldd r23, Y+1 ; 0x01 33d70: 8a 81 ldd r24, Y+2 ; 0x02 33d72: 9b 81 ldd r25, Y+3 ; 0x03 33d74: cd 57 subi r28, 0x7D ; 125 33d76: d0 40 sbci r29, 0x00 ; 0 33d78: 0d 94 2d 96 jmp 0x32c5a ; 0x32c5a // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 33d7c: 81 2c mov r8, r1 33d7e: 91 2c mov r9, r1 33d80: 20 e8 ldi r18, 0x80 ; 128 33d82: a2 2e mov r10, r18 33d84: 2f e3 ldi r18, 0x3F ; 63 33d86: b2 2e mov r11, r18 33d88: 0d 94 31 96 jmp 0x32c62 ; 0x32c62 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 33d8c: c1 2c mov r12, r1 33d8e: d1 2c mov r13, r1 33d90: 76 01 movw r14, r12 33d92: 0d 94 a8 96 jmp 0x32d50 ; 0x32d50 ((r == 1) ? 1.f : 33d96: c1 2c mov r12, r1 33d98: d1 2c mov r13, r1 33d9a: 90 e8 ldi r25, 0x80 ; 128 33d9c: e9 2e mov r14, r25 33d9e: 9f e3 ldi r25, 0x3F ; 63 33da0: f9 2e mov r15, r25 33da2: 0d 94 a8 96 jmp 0x32d50 ; 0x32d50 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; 33da6: 12 e0 ldi r17, 0x02 ; 2 33da8: a7 cb rjmp .-2226 ; 0x334f8 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 33daa: 1e 3f cpi r17, 0xFE ; 254 33dac: 89 f4 brne .+34 ; 0x33dd0 33dae: af 96 adiw r28, 0x2f ; 47 33db0: 3f ad ldd r19, Y+63 ; 0x3f 33db2: af 97 sbiw r28, 0x2f ; 47 33db4: 32 30 cpi r19, 0x02 ; 2 33db6: 09 f0 breq .+2 ; 0x33dba 33db8: 4d cf rjmp .-358 ; 0x33c54 DBG(_n("Fitting failed => calibration failed.\n")); 33dba: 85 e6 ldi r24, 0x65 ; 101 33dbc: 9f e6 ldi r25, 0x6F ; 111 33dbe: 9f 93 push r25 33dc0: 8f 93 push r24 33dc2: 0f 94 16 db call 0x3b62c ; 0x3b62c 33dc6: 44 cf rjmp .-376 ; 0x33c50 // 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; 33dc8: af 96 adiw r28, 0x2f ; 47 33dca: 1f ae std Y+63, r1 ; 0x3f 33dcc: af 97 sbiw r28, 0x2f ; 47 33dce: 42 cf rjmp .-380 ; 0x33c54 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 33dd0: 1f ef ldi r17, 0xFF ; 255 33dd2: 40 cf rjmp .-384 ; 0x33c54 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) { 33dd4: af 96 adiw r28, 0x2f ; 47 33dd6: 6f ad ldd r22, Y+63 ; 0x3f 33dd8: af 97 sbiw r28, 0x2f ; 47 33dda: 61 11 cpse r22, r1 33ddc: 13 c0 rjmp .+38 ; 0x33e04 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); 33dde: 83 e4 ldi r24, 0x43 ; 67 33de0: 97 e5 ldi r25, 0x57 ; 87 // 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) { 33de2: 11 30 cpi r17, 0x01 ; 1 33de4: 51 f0 breq .+20 ; 0x33dfa 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); 33de6: 80 e0 ldi r24, 0x00 ; 0 33de8: 97 e5 ldi r25, 0x57 ; 87 // 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) { 33dea: 12 30 cpi r17, 0x02 ; 2 33dec: 31 f0 breq .+12 ; 0x33dfa default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 33dee: 87 ee ldi r24, 0xE7 ; 231 33df0: 98 e5 ldi r25, 0x58 ; 88 // 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) { 33df2: 11 11 cpse r17, r1 33df4: 02 c0 rjmp .+4 ; 0x33dfa 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); 33df6: 88 e8 ldi r24, 0x88 ; 136 33df8: 97 e5 ldi r25, 0x57 ; 87 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); 33dfa: 0e 94 2c 72 call 0xe458 ; 0xe458 break; } lcd_show_fullscreen_message_and_wait_P(msg); 33dfe: 0f 94 f6 20 call 0x241ec ; 0x241ec 33e02: 0d c0 rjmp .+26 ; 0x33e1e // 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) 33e04: af 96 adiw r28, 0x2f ; 47 33e06: 8f ad ldd r24, Y+63 ; 0x3f 33e08: af 97 sbiw r28, 0x2f ; 47 33e0a: 82 30 cpi r24, 0x02 ; 2 33e0c: f1 f4 brne .+60 ; 0x33e4a // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 33e0e: 87 e1 ldi r24, 0x17 ; 23 33e10: 98 e5 ldi r25, 0x58 ; 88 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); 33e12: 0e 94 2c 72 call 0xe458 ; 0xe458 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); 33e16: 0f 94 f6 20 call 0x241ec ; 0x241ec } if (point_too_far_mask == 0 || result > 0) { 33e1a: 11 16 cp r1, r17 33e1c: 04 f3 brlt .-64 ; 0x33dde //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 33e1e: 1f 3f cpi r17, 0xFF ; 255 33e20: 11 f4 brne .+4 ; 0x33e26 33e22: 0d 94 7b 8e jmp 0x31cf6 ; 0x31cf6 { // 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); 33e26: 86 e0 ldi r24, 0x06 ; 6 33e28: 0e 94 70 ef call 0x1dee0 ; 0x1dee0 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 33e2c: 8f e5 ldi r24, 0x5F ; 95 33e2e: 9f e0 ldi r25, 0x0F ; 15 33e30: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 33e34: 81 11 cpse r24, r1 33e36: 0d 94 f3 92 jmp 0x325e6 ; 0x325e6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 33e3a: 82 e8 ldi r24, 0x82 ; 130 33e3c: 99 e5 ldi r25, 0x59 ; 89 33e3e: 0e 94 2c 72 call 0xe458 ; 0xe458 33e42: 0f 94 f6 20 call 0x241ec ; 0x241ec 33e46: 0d 94 f3 92 jmp 0x325e6 ; 0x325e6 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); 33e4a: 8b ec ldi r24, 0xCB ; 203 33e4c: 97 e5 ldi r25, 0x57 ; 87 33e4e: e1 cf rjmp .-62 ; 0x33e12 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)) 33e50: 89 81 ldd r24, Y+1 ; 0x01 33e52: 9a 81 ldd r25, Y+2 ; 0x02 33e54: 80 37 cpi r24, 0x70 ; 112 33e56: 98 40 sbci r25, 0x08 ; 8 33e58: 10 f0 brcs .+4 ; 0x33e5e 33e5a: 0d 94 32 93 jmp 0x32664 ; 0x32664 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 33e5e: ae 01 movw r20, r28 33e60: 4f 5f subi r20, 0xFF ; 255 33e62: 5f 4f sbci r21, 0xFF ; 255 33e64: 7a 01 movw r14, r20 33e66: 04 eb ldi r16, 0xB4 ; 180 33e68: 10 e0 ldi r17, 0x00 ; 0 33e6a: 24 e8 ldi r18, 0x84 ; 132 33e6c: 33 e0 ldi r19, 0x03 ; 3 33e6e: a6 01 movw r20, r12 33e70: 48 5c subi r20, 0xC8 ; 200 33e72: 51 09 sbc r21, r1 33e74: 69 2d mov r22, r9 33e76: 78 2d mov r23, r8 33e78: 8b 2d mov r24, r11 33e7a: 9a 2d mov r25, r10 33e7c: 0f 94 b6 6f call 0x2df6c ; 0x2df6c 33e80: 88 23 and r24, r24 33e82: 11 f4 brne .+4 ; 0x33e88 33e84: 0d 94 32 93 jmp 0x32664 ; 0x32664 ad += 1440; 33e88: 89 81 ldd r24, Y+1 ; 0x01 33e8a: 9a 81 ldd r25, Y+2 ; 0x02 33e8c: 80 56 subi r24, 0x60 ; 96 33e8e: 9a 4f sbci r25, 0xFA ; 250 33e90: 0d 94 55 90 jmp 0x320aa ; 0x320aa 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) { 33e94: 00 23 and r16, r16 33e96: 11 f4 brne .+4 ; 0x33e9c 33e98: 0d 94 d8 95 jmp 0x32bb0 ; 0x32bb0 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 33e9c: 02 30 cpi r16, 0x02 ; 2 33e9e: 09 f0 breq .+2 ; 0x33ea2 33ea0: 49 cf rjmp .-366 ; 0x33d34 33ea2: d2 01 movw r26, r4 33ea4: 11 96 adiw r26, 0x01 ; 1 33ea6: 2d 91 ld r18, X+ 33ea8: 3d 91 ld r19, X+ 33eaa: 4d 91 ld r20, X+ 33eac: 5c 91 ld r21, X 33eae: 14 97 sbiw r26, 0x04 ; 4 33eb0: 6e 96 adiw r28, 0x1e ; 30 33eb2: 6c ad ldd r22, Y+60 ; 0x3c 33eb4: 7d ad ldd r23, Y+61 ; 0x3d 33eb6: 8e ad ldd r24, Y+62 ; 0x3e 33eb8: 9f ad ldd r25, Y+63 ; 0x3f 33eba: 6e 97 sbiw r28, 0x1e ; 30 33ebc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33ec0: 4b 01 movw r8, r22 33ec2: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 33ec4: 60 e0 ldi r22, 0x00 ; 0 33ec6: 70 e0 ldi r23, 0x00 ; 0 33ec8: 80 e8 ldi r24, 0x80 ; 128 33eca: 9f e3 ldi r25, 0x3F ; 63 33ecc: 11 30 cpi r17, 0x01 ; 1 33ece: 91 f0 breq .+36 ; 0x33ef4 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 33ed0: 12 30 cpi r17, 0x02 ; 2 33ed2: 09 f0 breq .+2 ; 0x33ed6 33ed4: 3b cf rjmp .-394 ; 0x33d4c 33ed6: d2 01 movw r26, r4 33ed8: 11 96 adiw r26, 0x01 ; 1 33eda: 2d 91 ld r18, X+ 33edc: 3d 91 ld r19, X+ 33ede: 4d 91 ld r20, X+ 33ee0: 5c 91 ld r21, X 33ee2: 14 97 sbiw r26, 0x04 ; 4 33ee4: 6e 96 adiw r28, 0x1e ; 30 33ee6: 6c ad ldd r22, Y+60 ; 0x3c 33ee8: 7d ad ldd r23, Y+61 ; 0x3d 33eea: 8e ad ldd r24, Y+62 ; 0x3e 33eec: 9f ad ldd r25, Y+63 ; 0x3f 33eee: 6e 97 sbiw r28, 0x1e ; 30 33ef0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 33ef4: 9b 01 movw r18, r22 33ef6: ac 01 movw r20, r24 33ef8: c5 01 movw r24, r10 33efa: b4 01 movw r22, r8 33efc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 33f00: 9b 01 movw r18, r22 33f02: ac 01 movw r20, r24 33f04: c7 01 movw r24, r14 33f06: b6 01 movw r22, r12 33f08: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 33f0c: 6b 01 movw r12, r22 33f0e: 7c 01 movw r14, r24 33f10: 0d 94 d8 95 jmp 0x32bb0 ; 0x32bb0 // 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 : 33f14: 81 2c mov r8, r1 33f16: 91 2c mov r9, r1 33f18: 50 e8 ldi r21, 0x80 ; 128 33f1a: a5 2e mov r10, r21 33f1c: 5f e3 ldi r21, 0x3F ; 63 33f1e: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 33f20: 11 11 cpse r17, r1 33f22: 0d 94 b2 95 jmp 0x32b64 ; 0x32b64 ((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; 33f26: 20 e0 ldi r18, 0x00 ; 0 33f28: 30 e0 ldi r19, 0x00 ; 0 33f2a: 40 e8 ldi r20, 0x80 ; 128 33f2c: 5f e3 ldi r21, 0x3F ; 63 33f2e: ea cf rjmp .-44 ; 0x33f04 // 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) { float a = (r == 1) ? 1.f : 33f30: 81 2c mov r8, r1 33f32: 91 2c mov r9, r1 33f34: 40 e8 ldi r20, 0x80 ; 128 33f36: a4 2e mov r10, r20 33f38: 4f e3 ldi r20, 0x3F ; 63 33f3a: 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) { 33f3c: 11 11 cpse r17, r1 33f3e: c2 cf rjmp .-124 ; 0x33ec4 33f40: 0d 94 d8 95 jmp 0x32bb0 ; 0x32bb0 33f44: 11 11 cpse r17, r1 33f46: aa cf rjmp .-172 ; 0x33e9c 33f48: 0d 94 d8 95 jmp 0x32bb0 ; 0x32bb0 00033f4c : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 33f4c: 1f 93 push r17 33f4e: cf 93 push r28 33f50: df 93 push r29 33f52: 18 2f mov r17, r24 33f54: eb 01 movw r28, r22 33f56: 80 e0 ldi r24, 0x00 ; 0 33f58: 0f 94 0c 4f call 0x29e18 ; 0x29e18 { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 33f5c: 80 e0 ldi r24, 0x00 ; 0 33f5e: 0e 94 d1 89 call 0x113a2 ; 0x113a2 target_temperature[0] = 0; 33f62: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 33f66: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 target_temperature_bed = 0; 33f6a: 10 92 73 06 sts 0x0673, r1 ; 0x800673 33f6e: 10 92 72 06 sts 0x0672, r1 ; 0x800672 manage_heater(); 33f72: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(); 33f76: 80 e0 ldi r24, 0x00 ; 0 33f78: 0e 94 37 8a call 0x1146e ; 0x1146e lcd_clear(); 33f7c: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 33f80: 8e ee ldi r24, 0xEE ; 238 33f82: 96 e5 ldi r25, 0x56 ; 86 33f84: 0e 94 2c 72 call 0xe458 ; 0xe458 33f88: ac 01 movw r20, r24 33f8a: 60 e0 ldi r22, 0x00 ; 0 33f8c: 80 e0 ldi r24, 0x00 ; 0 33f8e: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 33f92: 8e ed ldi r24, 0xDE ; 222 33f94: 96 e5 ldi r25, 0x56 ; 86 33f96: 0e 94 2c 72 call 0xe458 ; 0xe458 33f9a: ac 01 movw r20, r24 33f9c: 61 e0 ldi r22, 0x01 ; 1 33f9e: 80 e0 ldi r24, 0x00 ; 0 33fa0: 0e 94 74 6e call 0xdce8 ; 0xdce8 switch (testError) 33fa4: 11 50 subi r17, 0x01 ; 1 33fa6: 1a 30 cpi r17, 0x0A ; 10 33fa8: 90 f4 brcc .+36 ; 0x33fce 33faa: e1 2f mov r30, r17 33fac: f0 e0 ldi r31, 0x00 ; 0 33fae: 88 27 eor r24, r24 33fb0: e3 52 subi r30, 0x23 ; 35 33fb2: f0 46 sbci r31, 0x60 ; 96 33fb4: 8e 4f sbci r24, 0xFE ; 254 33fb6: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 33fba: 56 3a cpi r21, 0xA6 ; 166 33fbc: 56 39 cpi r21, 0x96 ; 150 33fbe: 3c 3a cpi r19, 0xAC ; 172 33fc0: 5e 3a cpi r21, 0xAE ; 174 33fc2: 00 39 cpi r16, 0x90 ; 144 33fc4: 1a 39 cpi r17, 0x9A ; 154 33fc6: 92 39 cpi r25, 0x92 ; 146 33fc8: 94 3a cpi r25, 0xA4 ; 164 33fca: 5c 3a cpi r21, 0xAC ; 172 33fcc: 02 3a cpi r16, 0xA2 ; 162 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 33fce: 8a ec ldi r24, 0xCA ; 202 33fd0: 96 e5 ldi r25, 0x56 ; 86 33fd2: 0e 94 2c 72 call 0xe458 ; 0xe458 33fd6: ac 01 movw r20, r24 33fd8: 62 e0 ldi r22, 0x02 ; 2 33fda: 80 e0 ldi r24, 0x00 ; 0 33fdc: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 33fe0: 8a eb ldi r24, 0xBA ; 186 33fe2: 96 e5 ldi r25, 0x56 ; 86 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 33fe4: 0e 94 2c 72 call 0xe458 ; 0xe458 33fe8: ac 01 movw r20, r24 33fea: 63 e0 ldi r22, 0x03 ; 3 33fec: 80 e0 ldi r24, 0x00 ; 0 33fee: 0e 94 74 6e call 0xdce8 ; 0xdce8 33ff2: 45 c0 rjmp .+138 ; 0x3407e 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)); 33ff4: 8d ea ldi r24, 0xAD ; 173 33ff6: 96 e5 ldi r25, 0x56 ; 86 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)); 33ff8: 0e 94 2c 72 call 0xe458 ; 0xe458 33ffc: ac 01 movw r20, r24 33ffe: 62 e0 ldi r22, 0x02 ; 2 34000: 80 e0 ldi r24, 0x00 ; 0 34002: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 34006: 8e e9 ldi r24, 0x9E ; 158 34008: 96 e5 ldi r25, 0x56 ; 86 3400a: ec cf rjmp .-40 ; 0x33fe4 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)); 3400c: 83 e9 ldi r24, 0x93 ; 147 3400e: 96 e5 ldi r25, 0x56 ; 86 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)); 34010: 0e 94 2c 72 call 0xe458 ; 0xe458 34014: ac 01 movw r20, r24 34016: 62 e0 ldi r22, 0x02 ; 2 34018: 80 e0 ldi r24, 0x00 ; 0 3401a: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 3401e: 8e e9 ldi r24, 0x9E ; 158 34020: 96 e5 ldi r25, 0x56 ; 86 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)); 34022: 0e 94 2c 72 call 0xe458 ; 0xe458 34026: ac 01 movw r20, r24 34028: 63 e0 ldi r22, 0x03 ; 3 3402a: 80 e0 ldi r24, 0x00 ; 0 3402c: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(18, 3); 34030: 63 e0 ldi r22, 0x03 ; 3 34032: 82 e1 ldi r24, 0x12 ; 18 34034: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print(_error_1); 34038: ce 01 movw r24, r28 3403a: 1f c0 rjmp .+62 ; 0x3407a 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)); 3403c: 8b e8 ldi r24, 0x8B ; 139 3403e: 96 e5 ldi r25, 0x56 ; 86 34040: 0e 94 2c 72 call 0xe458 ; 0xe458 34044: ac 01 movw r20, r24 34046: 62 e0 ldi r22, 0x02 ; 2 34048: 80 e0 ldi r24, 0x00 ; 0 3404a: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(18, 2); 3404e: 62 e0 ldi r22, 0x02 ; 2 34050: 82 e1 ldi r24, 0x12 ; 18 34052: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print(_error_1); 34056: ce 01 movw r24, r28 34058: 0e 94 67 70 call 0xe0ce ; 0xe0ce lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 3405c: 81 e8 ldi r24, 0x81 ; 129 3405e: 96 e5 ldi r25, 0x56 ; 86 34060: 0e 94 2c 72 call 0xe458 ; 0xe458 34064: ac 01 movw r20, r24 34066: 63 e0 ldi r22, 0x03 ; 3 34068: 80 e0 ldi r24, 0x00 ; 0 3406a: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_set_cursor(18, 3); 3406e: 63 e0 ldi r22, 0x03 ; 3 34070: 82 e1 ldi r24, 0x12 ; 18 34072: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print(_error_2); 34076: 88 ef ldi r24, 0xF8 ; 248 34078: 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); 3407a: 0e 94 67 70 call 0xe0ce ; 0xe0ce lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 3407e: 68 ee ldi r22, 0xE8 ; 232 34080: 73 e0 ldi r23, 0x03 ; 3 34082: 80 e0 ldi r24, 0x00 ; 0 34084: 90 e0 ldi r25, 0x00 ; 0 34086: 0f 94 58 28 call 0x250b0 ; 0x250b0 3408a: 80 e0 ldi r24, 0x00 ; 0 3408c: 0f 94 0c 4f call 0x29e18 ; 0x29e18 lcd_beeper_quick_feedback(); do { _delay(100); 34090: 64 e6 ldi r22, 0x64 ; 100 34092: 70 e0 ldi r23, 0x00 ; 0 34094: 80 e0 ldi r24, 0x00 ; 0 34096: 90 e0 ldi r25, 0x00 ; 0 34098: 0f 94 58 28 call 0x250b0 ; 0x250b0 manage_heater(); 3409c: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(); 340a0: 80 e0 ldi r24, 0x00 ; 0 340a2: 0e 94 37 8a call 0x1146e ; 0x1146e } while (!lcd_clicked()); 340a6: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 340aa: 88 23 and r24, r24 340ac: 89 f3 breq .-30 ; 0x34090 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 340ae: 85 ee ldi r24, 0xE5 ; 229 340b0: 95 e5 ldi r25, 0x55 ; 85 340b2: 0e 94 2c 72 call 0xe458 ; 0xe458 340b6: 62 e0 ldi r22, 0x02 ; 2 340b8: 0e 94 fb f1 call 0x1e3f6 ; 0x1e3f6 lcd_return_to_status(); } 340bc: df 91 pop r29 340be: cf 91 pop r28 340c0: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 340c2: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 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)); 340c6: 8f e6 ldi r24, 0x6F ; 111 340c8: 96 e5 ldi r25, 0x56 ; 86 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)); 340ca: 0e 94 2c 72 call 0xe458 ; 0xe458 340ce: ac 01 movw r20, r24 340d0: 62 e0 ldi r22, 0x02 ; 2 340d2: 80 e0 ldi r24, 0x00 ; 0 340d4: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 340d8: 8b e8 ldi r24, 0x8B ; 139 340da: 96 e5 ldi r25, 0x56 ; 86 340dc: a2 cf rjmp .-188 ; 0x34022 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)); 340de: 8c e5 ldi r24, 0x5C ; 92 340e0: 96 e5 ldi r25, 0x56 ; 86 340e2: 96 cf rjmp .-212 ; 0x34010 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)); 340e4: 89 e4 ldi r24, 0x49 ; 73 340e6: 96 e5 ldi r25, 0x56 ; 86 340e8: 93 cf rjmp .-218 ; 0x34010 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)); 340ea: 8a e3 ldi r24, 0x3A ; 58 340ec: 96 e5 ldi r25, 0x56 ; 86 340ee: ed cf rjmp .-38 ; 0x340ca 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)); 340f0: 8c e2 ldi r24, 0x2C ; 44 340f2: 96 e5 ldi r25, 0x56 ; 86 340f4: 0e 94 2c 72 call 0xe458 ; 0xe458 340f8: ac 01 movw r20, r24 340fa: 62 e0 ldi r22, 0x02 ; 2 340fc: 80 e0 ldi r24, 0x00 ; 0 340fe: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 34102: 85 e2 ldi r24, 0x25 ; 37 34104: 96 e5 ldi r25, 0x56 ; 86 34106: 8d cf rjmp .-230 ; 0x34022 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 34108: 83 e1 ldi r24, 0x13 ; 19 3410a: 96 e5 ldi r25, 0x56 ; 86 3410c: 0e 94 2c 72 call 0xe458 ; 0xe458 34110: ac 01 movw r20, r24 34112: 62 e0 ldi r22, 0x02 ; 2 34114: 80 e0 ldi r24, 0x00 ; 0 34116: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 3411a: 89 e0 ldi r24, 0x09 ; 9 3411c: 96 e5 ldi r25, 0x56 ; 86 3411e: 81 cf rjmp .-254 ; 0x34022 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 34120: 87 ef ldi r24, 0xF7 ; 247 34122: 95 e5 ldi r25, 0x55 ; 85 34124: 69 cf rjmp .-302 ; 0x33ff8 00034126 : 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, 34126: 1f 93 push r17 34128: cf 93 push r28 3412a: df 93 push r29 3412c: c8 2f mov r28, r24 3412e: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 34130: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 34134: 8a ed ldi r24, 0xDA ; 218 34136: 95 e5 ldi r25, 0x55 ; 85 34138: 0e 94 2c 72 call 0xe458 ; 0xe458 3413c: ac 01 movw r20, r24 3413e: 60 e0 ldi r22, 0x00 ; 0 34140: 80 e0 ldi r24, 0x00 ; 0 34142: 0e 94 74 6e call 0xdce8 ; 0xdce8 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)); 34146: 89 e4 ldi r24, 0x49 ; 73 34148: 96 e5 ldi r25, 0x56 ; 86 3414a: c1 11 cpse r28, r1 3414c: 02 c0 rjmp .+4 ; 0x34152 3414e: 8c e5 ldi r24, 0x5C ; 92 34150: 96 e5 ldi r25, 0x56 ; 86 34152: 0e 94 2c 72 call 0xe458 ; 0xe458 34156: ac 01 movw r20, r24 34158: 61 e0 ldi r22, 0x01 ; 1 3415a: 80 e0 ldi r24, 0x00 ; 0 3415c: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_selftest_setfan(255); 34160: 8f ef ldi r24, 0xFF ; 255 34162: 0e 94 38 f6 call 0x1ec70 ; 0x1ec70 break; } _delay(500); 34166: 64 ef ldi r22, 0xF4 ; 244 34168: 71 e0 ldi r23, 0x01 ; 1 3416a: 80 e0 ldi r24, 0x00 ; 0 3416c: 90 e0 ldi r25, 0x00 ; 0 3416e: 0f 94 58 28 call 0x250b0 ; 0x250b0 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 34172: 8f ec ldi r24, 0xCF ; 207 34174: 95 e5 ldi r25, 0x55 ; 85 34176: 0e 94 2c 72 call 0xe458 ; 0xe458 3417a: ac 01 movw r20, r24 3417c: 62 e0 ldi r22, 0x02 ; 2 3417e: 81 e0 ldi r24, 0x01 ; 1 34180: 0e 94 74 6e call 0xdce8 ; 0xdce8 lcd_putc_at(0, 3, '>'); 34184: 4e e3 ldi r20, 0x3E ; 62 34186: 63 e0 ldi r22, 0x03 ; 3 34188: 80 e0 ldi r24, 0x00 ; 0 3418a: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 3418e: 80 ec ldi r24, 0xC0 ; 192 34190: 95 e5 ldi r25, 0x55 ; 85 34192: 0e 94 2c 72 call 0xe458 ; 0xe458 34196: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_encoder = _default; 3419a: 6d 2f mov r22, r29 3419c: 70 e0 ldi r23, 0x00 ; 0 3419e: 70 93 71 06 sts 0x0671, r23 ; 0x800671 341a2: 60 93 70 06 sts 0x0670, r22 ; 0x800670 KEEPALIVE_STATE(PAUSED_FOR_USER); 341a6: 84 e0 ldi r24, 0x04 ; 4 341a8: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_consume_click(); 341ac: 0e 94 78 70 call 0xe0f0 ; 0xe0f0 341b0: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 341b2: 11 e0 ldi r17, 0x01 ; 1 341b4: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 341b6: 80 91 70 06 lds r24, 0x0670 ; 0x800670 341ba: 90 91 71 06 lds r25, 0x0671 ; 0x800671 341be: 00 97 sbiw r24, 0x00 ; 0 341c0: 19 f1 breq .+70 ; 0x34208 if (lcd_encoder < 0) { 341c2: 97 ff sbrs r25, 7 341c4: 0b c0 rjmp .+22 ; 0x341dc _result = !check_opposite; 341c6: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 341c8: 4e e3 ldi r20, 0x3E ; 62 341ca: 62 e0 ldi r22, 0x02 ; 2 341cc: 80 e0 ldi r24, 0x00 ; 0 341ce: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_putc_at(0, 3, ' '); 341d2: 40 e2 ldi r20, 0x20 ; 32 341d4: 63 e0 ldi r22, 0x03 ; 3 341d6: 80 e0 ldi r24, 0x00 ; 0 341d8: 0e 94 80 6e call 0xdd00 ; 0xdd00 } if (lcd_encoder > 0) { 341dc: 80 91 70 06 lds r24, 0x0670 ; 0x800670 341e0: 90 91 71 06 lds r25, 0x0671 ; 0x800671 341e4: 18 16 cp r1, r24 341e6: 19 06 cpc r1, r25 341e8: 5c f4 brge .+22 ; 0x34200 _result = check_opposite; lcd_putc_at(0, 2, ' '); 341ea: 40 e2 ldi r20, 0x20 ; 32 341ec: 62 e0 ldi r22, 0x02 ; 2 341ee: 80 e0 ldi r24, 0x00 ; 0 341f0: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_putc_at(0, 3, '>'); 341f4: 4e e3 ldi r20, 0x3E ; 62 341f6: 63 e0 ldi r22, 0x03 ; 3 341f8: 80 e0 ldi r24, 0x00 ; 0 341fa: 0e 94 80 6e call 0xdd00 ; 0xdd00 341fe: dc 2f mov r29, r28 } lcd_encoder = 0; 34200: 10 92 71 06 sts 0x0671, r1 ; 0x800671 34204: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } manage_heater(); 34208: 0f 94 61 39 call 0x272c2 ; 0x272c2 manage_inactivity(true); 3420c: 81 e0 ldi r24, 0x01 ; 1 3420e: 0e 94 37 8a call 0x1146e ; 0x1146e _delay(100); 34212: 64 e6 ldi r22, 0x64 ; 100 34214: 70 e0 ldi r23, 0x00 ; 0 34216: 80 e0 ldi r24, 0x00 ; 0 34218: 90 e0 ldi r25, 0x00 ; 0 3421a: 0f 94 58 28 call 0x250b0 ; 0x250b0 } while (!lcd_clicked()); 3421e: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 34222: 88 23 and r24, r24 34224: 41 f2 breq .-112 ; 0x341b6 KEEPALIVE_STATE(IN_HANDLER); 34226: 82 e0 ldi r24, 0x02 ; 2 34228: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be setExtruderAutoFanState(0); // Turn off hotend fan 3422c: 80 e0 ldi r24, 0x00 ; 0 3422e: 0e 94 db 74 call 0xe9b6 ; 0xe9b6 lcd_selftest_setfan(0); // Turn off print fan 34232: 80 e0 ldi r24, 0x00 ; 0 34234: 0e 94 38 f6 call 0x1ec70 ; 0x1ec70 return _result; } 34238: 8d 2f mov r24, r29 3423a: df 91 pop r29 3423c: cf 91 pop r28 3423e: 1f 91 pop r17 34240: 08 95 ret 00034242 : #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) { 34242: cf 93 push r28 34244: df 93 push r29 34246: c8 2f mov r28, r24 34248: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 3424a: c1 50 subi r28, 0x01 ; 1 3424c: 98 f0 brcs .+38 ; 0x34274 for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 3424e: 4d e2 ldi r20, 0x2D ; 45 34250: 6d 2f mov r22, r29 34252: 82 e1 ldi r24, 0x12 ; 18 34254: 0e 94 80 6e call 0xdd00 ; 0xdd00 delay_keep_alive(1000 / sizeof(symbols)); 34258: 84 ef ldi r24, 0xF4 ; 244 3425a: 91 e0 ldi r25, 0x01 ; 1 3425c: 0e 94 6c 8c call 0x118d8 ; 0x118d8 // 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]); 34260: 4c e7 ldi r20, 0x7C ; 124 34262: 6d 2f mov r22, r29 34264: 82 e1 ldi r24, 0x12 ; 18 34266: 0e 94 80 6e call 0xdd00 ; 0xdd00 delay_keep_alive(1000 / sizeof(symbols)); 3426a: 84 ef ldi r24, 0xF4 ; 244 3426c: 91 e0 ldi r25, 0x01 ; 1 3426e: 0e 94 6c 8c call 0x118d8 ; 0x118d8 34272: eb cf rjmp .-42 ; 0x3424a } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 34274: 0f 94 51 2a call 0x254a2 ; 0x254a2 34278: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 3427c: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 34280: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 34284: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 #endif fan_measuring = true; 34288: 81 e0 ldi r24, 0x01 ; 1 3428a: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f while(fan_measuring) { 3428e: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 34292: 88 23 and r24, r24 34294: 29 f0 breq .+10 ; 0x342a0 delay_keep_alive(100); 34296: 84 e6 ldi r24, 0x64 ; 100 34298: 90 e0 ldi r25, 0x00 ; 0 3429a: 0e 94 6c 8c call 0x118d8 ; 0x118d8 3429e: f7 cf rjmp .-18 ; 0x3428e } gcode_M123(); } 342a0: df 91 pop r29 342a2: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 342a4: 0c 94 04 66 jmp 0xcc08 ; 0xcc08 000342a8 : } #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) { 342a8: 4f 92 push r4 342aa: 5f 92 push r5 342ac: 6f 92 push r6 342ae: 7f 92 push r7 342b0: af 92 push r10 342b2: bf 92 push r11 342b4: cf 92 push r12 342b6: df 92 push r13 342b8: ef 92 push r14 342ba: ff 92 push r15 342bc: 0f 93 push r16 342be: 1f 93 push r17 342c0: cf 93 push r28 342c2: df 93 push r29 342c4: 24 e0 ldi r18, 0x04 ; 4 342c6: 30 e0 ldi r19, 0x00 ; 0 342c8: 41 e0 ldi r20, 0x01 ; 1 342ca: 50 e0 ldi r21, 0x00 ; 0 342cc: d9 01 movw r26, r18 342ce: ad 51 subi r26, 0x1D ; 29 342d0: bd 45 sbci r27, 0x5D ; 93 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 342d2: fd 01 movw r30, r26 342d4: 65 91 lpm r22, Z+ 342d6: 74 91 lpm r23, Z 342d8: 86 17 cp r24, r22 342da: 97 07 cpc r25, r23 342dc: 0c f0 brlt .+2 ; 0x342e0 342de: 66 c0 rjmp .+204 ; 0x343ac { celsius = PGM_RD_W((*tt)[i-1][1]) + 342e0: 41 50 subi r20, 0x01 ; 1 342e2: 51 09 sbc r21, r1 342e4: 44 0f add r20, r20 342e6: 55 1f adc r21, r21 342e8: 44 0f add r20, r20 342ea: 55 1f adc r21, r21 342ec: ea 01 movw r28, r20 342ee: cb 51 subi r28, 0x1B ; 27 342f0: dd 45 sbci r29, 0x5D ; 93 342f2: fe 01 movw r30, r28 342f4: 05 91 lpm r16, Z+ 342f6: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 342f8: 4d 51 subi r20, 0x1D ; 29 342fa: 5d 45 sbci r21, 0x5D ; 93 342fc: fa 01 movw r30, r20 342fe: 65 91 lpm r22, Z+ 34300: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 34302: f9 01 movw r30, r18 34304: eb 51 subi r30, 0x1B ; 27 34306: fd 45 sbci r31, 0x5D ; 93 34308: e5 90 lpm r14, Z+ 3430a: f4 90 lpm r15, Z 3430c: fe 01 movw r30, r28 3430e: c5 90 lpm r12, Z+ 34310: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 34312: fd 01 movw r30, r26 34314: c5 91 lpm r28, Z+ 34316: d4 91 lpm r29, Z 34318: fa 01 movw r30, r20 3431a: a5 90 lpm r10, Z+ 3431c: 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])) * 3431e: 86 1b sub r24, r22 34320: 97 0b sbc r25, r23 34322: bc 01 movw r22, r24 34324: 99 0f add r25, r25 34326: 88 0b sbc r24, r24 34328: 99 0b sbc r25, r25 3432a: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 3432e: 2b 01 movw r4, r22 34330: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 34332: b7 01 movw r22, r14 34334: 6c 19 sub r22, r12 34336: 7d 09 sbc r23, r13 34338: 07 2e mov r0, r23 3433a: 00 0c add r0, r0 3433c: 88 0b sbc r24, r24 3433e: 99 0b sbc r25, r25 34340: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 34344: 9b 01 movw r18, r22 34346: 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])) * 34348: c3 01 movw r24, r6 3434a: b2 01 movw r22, r4 3434c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34350: 6b 01 movw r12, r22 34352: 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])); 34354: be 01 movw r22, r28 34356: 6a 19 sub r22, r10 34358: 7b 09 sbc r23, r11 3435a: 07 2e mov r0, r23 3435c: 00 0c add r0, r0 3435e: 88 0b sbc r24, r24 34360: 99 0b sbc r25, r25 34362: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 34366: 9b 01 movw r18, r22 34368: 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])) / 3436a: c7 01 movw r24, r14 3436c: b6 01 movw r22, r12 3436e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 34372: 6b 01 movw r12, r22 34374: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 34376: b8 01 movw r22, r16 34378: 11 0f add r17, r17 3437a: 88 0b sbc r24, r24 3437c: 99 0b sbc r25, r25 3437e: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 34382: 9b 01 movw r18, r22 34384: ac 01 movw r20, r24 34386: c7 01 movw r24, r14 34388: b6 01 movw r22, r12 3438a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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; } 3438e: df 91 pop r29 34390: cf 91 pop r28 34392: 1f 91 pop r17 34394: 0f 91 pop r16 34396: ff 90 pop r15 34398: ef 90 pop r14 3439a: df 90 pop r13 3439c: cf 90 pop r12 3439e: bf 90 pop r11 343a0: af 90 pop r10 343a2: 7f 90 pop r7 343a4: 6f 90 pop r6 343a6: 5f 90 pop r5 343a8: 4f 90 pop r4 343aa: 08 95 ret 343ac: 4f 5f subi r20, 0xFF ; 255 343ae: 5f 4f sbci r21, 0xFF ; 255 343b0: 2c 5f subi r18, 0xFC ; 252 343b2: 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 343ba: 88 cf rjmp .-240 ; 0x342cc break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 343bc: e1 e6 ldi r30, 0x61 ; 97 343be: f3 ea ldi r31, 0xA3 ; 163 343c0: 65 91 lpm r22, Z+ 343c2: 74 91 lpm r23, Z 343c4: 07 2e mov r0, r23 343c6: 00 0c add r0, r0 343c8: 88 0b sbc r24, r24 343ca: 99 0b sbc r25, r25 343cc: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 343d0: de cf rjmp .-68 ; 0x3438e 000343d2 : float mesh_bed_leveling::get_z(float x, float y) { 343d2: 2f 92 push r2 343d4: 3f 92 push r3 343d6: 4f 92 push r4 343d8: 5f 92 push r5 343da: 6f 92 push r6 343dc: 7f 92 push r7 343de: 8f 92 push r8 343e0: 9f 92 push r9 343e2: af 92 push r10 343e4: bf 92 push r11 343e6: cf 92 push r12 343e8: df 92 push r13 343ea: ef 92 push r14 343ec: ff 92 push r15 343ee: 0f 93 push r16 343f0: 1f 93 push r17 343f2: cf 93 push r28 343f4: df 93 push r29 343f6: 00 d0 rcall .+0 ; 0x343f8 343f8: 00 d0 rcall .+0 ; 0x343fa 343fa: 00 d0 rcall .+0 ; 0x343fc 343fc: 1f 92 push r1 343fe: cd b7 in r28, 0x3d ; 61 34400: de b7 in r29, 0x3e ; 62 34402: 2b 01 movw r4, r22 34404: 3c 01 movw r6, r24 34406: 49 01 movw r8, r18 34408: 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)); 3440a: 20 e0 ldi r18, 0x00 ; 0 3440c: 30 e0 ldi r19, 0x00 ; 0 3440e: 40 ec ldi r20, 0xC0 ; 192 34410: 51 e4 ldi r21, 0x41 ; 65 34412: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 34416: 20 e0 ldi r18, 0x00 ; 0 34418: 30 e0 ldi r19, 0x00 ; 0 3441a: 48 e0 ldi r20, 0x08 ; 8 3441c: 52 e4 ldi r21, 0x42 ; 66 3441e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 34422: 6b 01 movw r12, r22 34424: 7c 01 movw r14, r24 34426: 0f 94 23 df call 0x3be46 ; 0x3be46 3442a: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> if (i < 0) { i = 0; 3442e: 31 2c mov r3, r1 34430: 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) { 34432: 77 fd sbrc r23, 7 34434: 1e c0 rjmp .+60 ; 0x34472 34436: 1b 01 movw r2, r22 34438: 66 30 cpi r22, 0x06 ; 6 3443a: 71 05 cpc r23, r1 3443c: 1c f0 brlt .+6 ; 0x34444 3443e: 45 e0 ldi r20, 0x05 ; 5 34440: 24 2e mov r2, r20 34442: 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; } 34444: 82 2d mov r24, r2 34446: 0f 94 6d ca call 0x394da ; 0x394da 3444a: 20 e0 ldi r18, 0x00 ; 0 3444c: 30 e0 ldi r19, 0x00 ; 0 3444e: 48 eb ldi r20, 0xB8 ; 184 34450: 51 e4 ldi r21, 0x41 ; 65 34452: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 34456: 9b 01 movw r18, r22 34458: 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; 3445a: c3 01 movw r24, r6 3445c: b2 01 movw r22, r4 3445e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 34462: 20 e0 ldi r18, 0x00 ; 0 34464: 30 e0 ldi r19, 0x00 ; 0 34466: 48 e0 ldi r20, 0x08 ; 8 34468: 52 e4 ldi r21, 0x42 ; 66 3446a: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 3446e: 6b 01 movw r12, r22 34470: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 34472: 20 e0 ldi r18, 0x00 ; 0 34474: 30 e0 ldi r19, 0x00 ; 0 34476: 40 ec ldi r20, 0xC0 ; 192 34478: 50 e4 ldi r21, 0x40 ; 64 3447a: c5 01 movw r24, r10 3447c: b4 01 movw r22, r8 3447e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 34482: 20 e0 ldi r18, 0x00 ; 0 34484: 30 e0 ldi r19, 0x00 ; 0 34486: 48 e0 ldi r20, 0x08 ; 8 34488: 52 e4 ldi r21, 0x42 ; 66 3448a: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 3448e: 69 83 std Y+1, r22 ; 0x01 34490: 7a 83 std Y+2, r23 ; 0x02 34492: 8b 83 std Y+3, r24 ; 0x03 34494: 9c 83 std Y+4, r25 ; 0x04 34496: 0f 94 23 df call 0x3be46 ; 0x3be46 3449a: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> if (j < 0) { 3449e: 77 fd sbrc r23, 7 344a0: da c0 rjmp .+436 ; 0x34656 344a2: 7a 87 std Y+10, r23 ; 0x0a 344a4: 69 87 std Y+9, r22 ; 0x09 344a6: 66 30 cpi r22, 0x06 ; 6 344a8: 71 05 cpc r23, r1 344aa: 24 f0 brlt .+8 ; 0x344b4 344ac: e5 e0 ldi r30, 0x05 ; 5 344ae: f0 e0 ldi r31, 0x00 ; 0 344b0: fa 87 std Y+10, r31 ; 0x0a 344b2: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 344b4: 89 85 ldd r24, Y+9 ; 0x09 344b6: 0f 94 6d ca call 0x394da ; 0x394da 344ba: 20 e0 ldi r18, 0x00 ; 0 344bc: 30 e0 ldi r19, 0x00 ; 0 344be: 40 ea ldi r20, 0xA0 ; 160 344c0: 50 e4 ldi r21, 0x40 ; 64 344c2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 344c6: 9b 01 movw r18, r22 344c8: 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; 344ca: c5 01 movw r24, r10 344cc: b4 01 movw r22, r8 344ce: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 344d2: 20 e0 ldi r18, 0x00 ; 0 344d4: 30 e0 ldi r19, 0x00 ; 0 344d6: 48 e0 ldi r20, 0x08 ; 8 344d8: 52 e4 ldi r21, 0x42 ; 66 344da: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 344de: 69 83 std Y+1, r22 ; 0x01 344e0: 7a 83 std Y+2, r23 ; 0x02 344e2: 8b 83 std Y+3, r24 ; 0x03 344e4: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 344e6: a7 01 movw r20, r14 344e8: 96 01 movw r18, r12 344ea: 60 e0 ldi r22, 0x00 ; 0 344ec: 70 e0 ldi r23, 0x00 ; 0 344ee: 80 e8 ldi r24, 0x80 ; 128 344f0: 9f e3 ldi r25, 0x3F ; 63 344f2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 344f6: 2b 01 movw r4, r22 344f8: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 344fa: 91 01 movw r18, r2 344fc: 2f 5f subi r18, 0xFF ; 255 344fe: 3f 4f sbci r19, 0xFF ; 255 34500: 3e 83 std Y+6, r19 ; 0x06 34502: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 34504: 89 85 ldd r24, Y+9 ; 0x09 34506: 9a 85 ldd r25, Y+10 ; 0x0a 34508: 01 96 adiw r24, 0x01 ; 1 3450a: 98 87 std Y+8, r25 ; 0x08 3450c: 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]; 3450e: 27 e0 ldi r18, 0x07 ; 7 34510: e9 85 ldd r30, Y+9 ; 0x09 34512: fa 85 ldd r31, Y+10 ; 0x0a 34514: 2e 9f mul r18, r30 34516: 80 01 movw r16, r0 34518: 2f 9f mul r18, r31 3451a: 10 0d add r17, r0 3451c: 11 24 eor r1, r1 3451e: f8 01 movw r30, r16 34520: e2 0d add r30, r2 34522: f3 1d adc r31, r3 34524: ee 0f add r30, r30 34526: ff 1f adc r31, r31 34528: ee 0f add r30, r30 3452a: ff 1f adc r31, r31 3452c: ee 53 subi r30, 0x3E ; 62 3452e: fc 4e sbci r31, 0xEC ; 236 34530: 21 81 ldd r18, Z+1 ; 0x01 34532: 32 81 ldd r19, Z+2 ; 0x02 34534: 43 81 ldd r20, Z+3 ; 0x03 34536: 54 81 ldd r21, Z+4 ; 0x04 34538: c3 01 movw r24, r6 3453a: b2 01 movw r22, r4 3453c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34540: 4b 01 movw r8, r22 34542: 5c 01 movw r10, r24 34544: ed 81 ldd r30, Y+5 ; 0x05 34546: fe 81 ldd r31, Y+6 ; 0x06 34548: e0 0f add r30, r16 3454a: f1 1f adc r31, r17 3454c: ee 0f add r30, r30 3454e: ff 1f adc r31, r31 34550: ee 0f add r30, r30 34552: ff 1f adc r31, r31 34554: ee 53 subi r30, 0x3E ; 62 34556: fc 4e sbci r31, 0xEC ; 236 34558: 21 81 ldd r18, Z+1 ; 0x01 3455a: 32 81 ldd r19, Z+2 ; 0x02 3455c: 43 81 ldd r20, Z+3 ; 0x03 3455e: 54 81 ldd r21, Z+4 ; 0x04 34560: c7 01 movw r24, r14 34562: b6 01 movw r22, r12 34564: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34568: 9b 01 movw r18, r22 3456a: ac 01 movw r20, r24 3456c: c5 01 movw r24, r10 3456e: b4 01 movw r22, r8 34570: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 34574: 4b 01 movw r8, r22 34576: 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; 34578: 29 81 ldd r18, Y+1 ; 0x01 3457a: 3a 81 ldd r19, Y+2 ; 0x02 3457c: 4b 81 ldd r20, Y+3 ; 0x03 3457e: 5c 81 ldd r21, Y+4 ; 0x04 34580: 60 e0 ldi r22, 0x00 ; 0 34582: 70 e0 ldi r23, 0x00 ; 0 34584: 80 e8 ldi r24, 0x80 ; 128 34586: 9f e3 ldi r25, 0x3F ; 63 34588: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3458c: 9b 01 movw r18, r22 3458e: ac 01 movw r20, r24 34590: c5 01 movw r24, r10 34592: b4 01 movw r22, r8 34594: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34598: 4b 01 movw r8, r22 3459a: 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]; 3459c: 27 e0 ldi r18, 0x07 ; 7 3459e: ef 81 ldd r30, Y+7 ; 0x07 345a0: f8 85 ldd r31, Y+8 ; 0x08 345a2: 2e 9f mul r18, r30 345a4: c0 01 movw r24, r0 345a6: 2f 9f mul r18, r31 345a8: 90 0d add r25, r0 345aa: 11 24 eor r1, r1 345ac: 9a 87 std Y+10, r25 ; 0x0a 345ae: 89 87 std Y+9, r24 ; 0x09 345b0: fc 01 movw r30, r24 345b2: e2 0d add r30, r2 345b4: f3 1d adc r31, r3 345b6: ee 0f add r30, r30 345b8: ff 1f adc r31, r31 345ba: ee 0f add r30, r30 345bc: ff 1f adc r31, r31 345be: ee 53 subi r30, 0x3E ; 62 345c0: fc 4e sbci r31, 0xEC ; 236 345c2: 21 81 ldd r18, Z+1 ; 0x01 345c4: 32 81 ldd r19, Z+2 ; 0x02 345c6: 43 81 ldd r20, Z+3 ; 0x03 345c8: 54 81 ldd r21, Z+4 ; 0x04 345ca: c3 01 movw r24, r6 345cc: b2 01 movw r22, r4 345ce: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 345d2: 2b 01 movw r4, r22 345d4: 3c 01 movw r6, r24 345d6: 89 85 ldd r24, Y+9 ; 0x09 345d8: 9a 85 ldd r25, Y+10 ; 0x0a 345da: ed 81 ldd r30, Y+5 ; 0x05 345dc: fe 81 ldd r31, Y+6 ; 0x06 345de: 8e 0f add r24, r30 345e0: 9f 1f adc r25, r31 345e2: 88 0f add r24, r24 345e4: 99 1f adc r25, r25 345e6: 88 0f add r24, r24 345e8: 99 1f adc r25, r25 345ea: 8e 53 subi r24, 0x3E ; 62 345ec: 9c 4e sbci r25, 0xEC ; 236 345ee: fc 01 movw r30, r24 345f0: 21 81 ldd r18, Z+1 ; 0x01 345f2: 32 81 ldd r19, Z+2 ; 0x02 345f4: 43 81 ldd r20, Z+3 ; 0x03 345f6: 54 81 ldd r21, Z+4 ; 0x04 345f8: c7 01 movw r24, r14 345fa: b6 01 movw r22, r12 345fc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34600: 9b 01 movw r18, r22 34602: ac 01 movw r20, r24 34604: c3 01 movw r24, r6 34606: b2 01 movw r22, r4 34608: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> return (1.f-t) * z0 + t * z1; 3460c: 29 81 ldd r18, Y+1 ; 0x01 3460e: 3a 81 ldd r19, Y+2 ; 0x02 34610: 4b 81 ldd r20, Y+3 ; 0x03 34612: 5c 81 ldd r21, Y+4 ; 0x04 34614: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34618: 9b 01 movw r18, r22 3461a: ac 01 movw r20, r24 3461c: c5 01 movw r24, r10 3461e: b4 01 movw r22, r8 34620: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> } 34624: 2a 96 adiw r28, 0x0a ; 10 34626: 0f b6 in r0, 0x3f ; 63 34628: f8 94 cli 3462a: de bf out 0x3e, r29 ; 62 3462c: 0f be out 0x3f, r0 ; 63 3462e: cd bf out 0x3d, r28 ; 61 34630: df 91 pop r29 34632: cf 91 pop r28 34634: 1f 91 pop r17 34636: 0f 91 pop r16 34638: ff 90 pop r15 3463a: ef 90 pop r14 3463c: df 90 pop r13 3463e: cf 90 pop r12 34640: bf 90 pop r11 34642: af 90 pop r10 34644: 9f 90 pop r9 34646: 8f 90 pop r8 34648: 7f 90 pop r7 3464a: 6f 90 pop r6 3464c: 5f 90 pop r5 3464e: 4f 90 pop r4 34650: 3f 90 pop r3 34652: 2f 90 pop r2 34654: 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; 34656: 1a 86 std Y+10, r1 ; 0x0a 34658: 19 86 std Y+9, r1 ; 0x09 3465a: 45 cf rjmp .-374 ; 0x344e6 0003465c : 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() 3465c: 2f 92 push r2 3465e: 3f 92 push r3 34660: 4f 92 push r4 34662: 5f 92 push r5 34664: 6f 92 push r6 34666: 7f 92 push r7 34668: 8f 92 push r8 3466a: 9f 92 push r9 3466c: af 92 push r10 3466e: bf 92 push r11 34670: cf 92 push r12 34672: df 92 push r13 34674: ef 92 push r14 34676: ff 92 push r15 34678: 0f 93 push r16 3467a: 1f 93 push r17 3467c: cf 93 push r28 3467e: df 93 push r29 34680: 00 d0 rcall .+0 ; 0x34682 34682: 00 d0 rcall .+0 ; 0x34684 34684: 00 d0 rcall .+0 ; 0x34686 34686: cd b7 in r28, 0x3d ; 61 34688: de b7 in r29, 0x3e ; 62 3468a: 02 ec ldi r16, 0xC2 ; 194 3468c: 13 e1 ldi r17, 0x13 ; 19 3468e: 1f 83 std Y+7, r17 ; 0x07 34690: 0e 83 std Y+6, r16 ; 0x06 34692: 2e 80 ldd r2, Y+6 ; 0x06 34694: 3f 80 ldd r3, Y+7 ; 0x07 34696: 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])) 34698: f1 01 movw r30, r2 3469a: 61 81 ldd r22, Z+1 ; 0x01 3469c: 72 81 ldd r23, Z+2 ; 0x02 3469e: 83 81 ldd r24, Z+3 ; 0x03 346a0: 94 81 ldd r25, Z+4 ; 0x04 346a2: 9b 01 movw r18, r22 346a4: ac 01 movw r20, r24 346a6: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 346aa: 88 23 and r24, r24 346ac: 09 f4 brne .+2 ; 0x346b0 346ae: 7c c0 rjmp .+248 ; 0x347a8 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 346b0: 89 81 ldd r24, Y+1 ; 0x01 346b2: 0f 94 6d ca call 0x394da ; 0x394da 346b6: 20 e0 ldi r18, 0x00 ; 0 346b8: 30 e0 ldi r19, 0x00 ; 0 346ba: 48 eb ldi r20, 0xB8 ; 184 346bc: 51 e4 ldi r21, 0x41 ; 65 346be: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 346c2: 6b 01 movw r12, r22 346c4: 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)) + 346c6: 20 e0 ldi r18, 0x00 ; 0 346c8: 30 e0 ldi r19, 0x00 ; 0 346ca: 4c ef ldi r20, 0xFC ; 252 346cc: 52 e4 ldi r21, 0x42 ; 66 346ce: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 346d2: 2b 01 movw r4, r22 346d4: 3c 01 movw r6, r24 346d6: 20 e0 ldi r18, 0x00 ; 0 346d8: 30 e0 ldi r19, 0x00 ; 0 346da: 44 e6 ldi r20, 0x64 ; 100 346dc: 53 e4 ldi r21, 0x43 ; 67 346de: c7 01 movw r24, r14 346e0: b6 01 movw r22, r12 346e2: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 346e6: 4b 01 movw r8, r22 346e8: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 346ea: 20 e0 ldi r18, 0x00 ; 0 346ec: 30 e0 ldi r19, 0x00 ; 0 346ee: 40 ec ldi r20, 0xC0 ; 192 346f0: 51 e4 ldi r21, 0x41 ; 65 346f2: c7 01 movw r24, r14 346f4: b6 01 movw r22, r12 346f6: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 346fa: 6b 01 movw r12, r22 346fc: 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)) + 346fe: ee 81 ldd r30, Y+6 ; 0x06 34700: ff 81 ldd r31, Y+7 ; 0x07 34702: 21 81 ldd r18, Z+1 ; 0x01 34704: 32 81 ldd r19, Z+2 ; 0x02 34706: 43 81 ldd r20, Z+3 ; 0x03 34708: 54 81 ldd r21, Z+4 ; 0x04 3470a: c3 01 movw r24, r6 3470c: b2 01 movw r22, r4 3470e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34712: a5 01 movw r20, r10 34714: 94 01 movw r18, r8 34716: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3471a: 20 e0 ldi r18, 0x00 ; 0 3471c: 30 e9 ldi r19, 0x90 ; 144 3471e: 42 ea ldi r20, 0xA2 ; 162 34720: 56 e4 ldi r21, 0x46 ; 70 34722: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 34726: 6a 83 std Y+2, r22 ; 0x02 34728: 7b 83 std Y+3, r23 ; 0x03 3472a: 8c 83 std Y+4, r24 ; 0x04 3472c: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 3472e: ee 81 ldd r30, Y+6 ; 0x06 34730: ff 81 ldd r31, Y+7 ; 0x07 34732: 25 85 ldd r18, Z+13 ; 0x0d 34734: 36 85 ldd r19, Z+14 ; 0x0e 34736: 47 85 ldd r20, Z+15 ; 0x0f 34738: 50 89 ldd r21, Z+16 ; 0x10 3473a: c7 01 movw r24, r14 3473c: b6 01 movw r22, r12 3473e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34742: a5 01 movw r20, r10 34744: 94 01 movw r18, r8 34746: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3474a: 20 e0 ldi r18, 0x00 ; 0 3474c: 30 e9 ldi r19, 0x90 ; 144 3474e: 42 e2 ldi r20, 0x22 ; 34 34750: 56 ec ldi r21, 0xC6 ; 198 34752: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 34756: 9b 01 movw r18, r22 34758: 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)) + 3475a: 6a 81 ldd r22, Y+2 ; 0x02 3475c: 7b 81 ldd r23, Y+3 ; 0x03 3475e: 8c 81 ldd r24, Y+4 ; 0x04 34760: 9d 81 ldd r25, Y+5 ; 0x05 34762: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 34766: 4b 01 movw r8, r22 34768: 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)); 3476a: ee 81 ldd r30, Y+6 ; 0x06 3476c: ff 81 ldd r31, Y+7 ; 0x07 3476e: 21 8d ldd r18, Z+25 ; 0x19 34770: 32 8d ldd r19, Z+26 ; 0x1a 34772: 43 8d ldd r20, Z+27 ; 0x1b 34774: 54 8d ldd r21, Z+28 ; 0x1c 34776: c7 01 movw r24, r14 34778: b6 01 movw r22, r12 3477a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3477e: a3 01 movw r20, r6 34780: 92 01 movw r18, r4 34782: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34786: 20 e0 ldi r18, 0x00 ; 0 34788: 30 e9 ldi r19, 0x90 ; 144 3478a: 42 ea ldi r20, 0xA2 ; 162 3478c: 56 e4 ldi r21, 0x46 ; 70 3478e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 34792: 9b 01 movw r18, r22 34794: 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)) + 34796: c5 01 movw r24, r10 34798: b4 01 movw r22, r8 3479a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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] = 3479e: f1 01 movw r30, r2 347a0: 61 83 std Z+1, r22 ; 0x01 347a2: 72 83 std Z+2, r23 ; 0x02 347a4: 83 83 std Z+3, r24 ; 0x03 347a6: 94 83 std Z+4, r25 ; 0x04 347a8: f4 e0 ldi r31, 0x04 ; 4 347aa: 2f 0e add r2, r31 347ac: 31 1c adc r3, r1 347ae: 29 81 ldd r18, Y+1 ; 0x01 347b0: 2f 5f subi r18, 0xFF ; 255 347b2: 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) { 347b4: 27 30 cpi r18, 0x07 ; 7 347b6: 09 f0 breq .+2 ; 0x347ba 347b8: 6f cf rjmp .-290 ; 0x34698 347ba: 8e 81 ldd r24, Y+6 ; 0x06 347bc: 9f 81 ldd r25, Y+7 ; 0x07 347be: 4c 96 adiw r24, 0x1c ; 28 347c0: 9f 83 std Y+7, r25 ; 0x07 347c2: 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) { 347c4: 86 58 subi r24, 0x86 ; 134 347c6: 94 41 sbci r25, 0x14 ; 20 347c8: 09 f0 breq .+2 ; 0x347cc 347ca: 63 cf rjmp .-314 ; 0x34692 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() 347cc: 19 87 std Y+9, r17 ; 0x09 347ce: 08 87 std Y+8, r16 ; 0x08 347d0: f1 e0 ldi r31, 0x01 ; 1 347d2: 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)) + 347d4: c8 01 movw r24, r16 347d6: 8b 5a subi r24, 0xAB ; 171 347d8: 9f 4f sbci r25, 0xFF ; 255 347da: 9f 83 std Y+7, r25 ; 0x07 347dc: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 347de: 18 01 movw r2, r16 347e0: 99 ea ldi r25, 0xA9 ; 169 347e2: 29 0e add r2, r25 347e4: 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])) 347e6: e8 85 ldd r30, Y+8 ; 0x08 347e8: f9 85 ldd r31, Y+9 ; 0x09 347ea: 65 8d ldd r22, Z+29 ; 0x1d 347ec: 76 8d ldd r23, Z+30 ; 0x1e 347ee: 87 8d ldd r24, Z+31 ; 0x1f 347f0: 90 a1 ldd r25, Z+32 ; 0x20 347f2: 9b 01 movw r18, r22 347f4: ac 01 movw r20, r24 347f6: 0f 94 8a e1 call 0x3c314 ; 0x3c314 <__unordsf2> 347fa: 88 23 and r24, r24 347fc: 09 f4 brne .+2 ; 0x34800 347fe: 79 c0 rjmp .+242 ; 0x348f2 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 34800: 89 81 ldd r24, Y+1 ; 0x01 34802: 0f 94 6d ca call 0x394da ; 0x394da 34806: 20 e0 ldi r18, 0x00 ; 0 34808: 30 e0 ldi r19, 0x00 ; 0 3480a: 40 ea ldi r20, 0xA0 ; 160 3480c: 50 e4 ldi r21, 0x40 ; 64 3480e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 34812: 6b 01 movw r12, r22 34814: 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)) + 34816: 20 e0 ldi r18, 0x00 ; 0 34818: 30 e0 ldi r19, 0x00 ; 0 3481a: 48 ed ldi r20, 0xD8 ; 216 3481c: 52 e4 ldi r21, 0x42 ; 66 3481e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 34822: 2b 01 movw r4, r22 34824: 3c 01 movw r6, r24 34826: 20 e0 ldi r18, 0x00 ; 0 34828: 30 e0 ldi r19, 0x00 ; 0 3482a: 42 e5 ldi r20, 0x52 ; 82 3482c: 53 e4 ldi r21, 0x43 ; 67 3482e: c7 01 movw r24, r14 34830: b6 01 movw r22, r12 34832: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 34836: 4b 01 movw r8, r22 34838: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 3483a: 20 e0 ldi r18, 0x00 ; 0 3483c: 30 e0 ldi r19, 0x00 ; 0 3483e: 40 ec ldi r20, 0xC0 ; 192 34840: 50 e4 ldi r21, 0x40 ; 64 34842: c7 01 movw r24, r14 34844: b6 01 movw r22, r12 34846: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3484a: 6b 01 movw r12, r22 3484c: 7c 01 movw r14, r24 3484e: ee 81 ldd r30, Y+6 ; 0x06 34850: ff 81 ldd r31, Y+7 ; 0x07 34852: 20 81 ld r18, Z 34854: 31 81 ldd r19, Z+1 ; 0x01 34856: 42 81 ldd r20, Z+2 ; 0x02 34858: 53 81 ldd r21, Z+3 ; 0x03 3485a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3485e: a5 01 movw r20, r10 34860: 94 01 movw r18, r8 34862: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34866: 20 e0 ldi r18, 0x00 ; 0 34868: 30 e9 ldi r19, 0x90 ; 144 3486a: 42 e2 ldi r20, 0x22 ; 34 3486c: 56 ec ldi r21, 0xC6 ; 198 3486e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 34872: 6a 83 std Y+2, r22 ; 0x02 34874: 7b 83 std Y+3, r23 ; 0x03 34876: 8c 83 std Y+4, r24 ; 0x04 34878: 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)) + 3487a: f8 01 movw r30, r16 3487c: 21 81 ldd r18, Z+1 ; 0x01 3487e: 32 81 ldd r19, Z+2 ; 0x02 34880: 43 81 ldd r20, Z+3 ; 0x03 34882: 54 81 ldd r21, Z+4 ; 0x04 34884: c3 01 movw r24, r6 34886: b2 01 movw r22, r4 34888: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3488c: a5 01 movw r20, r10 3488e: 94 01 movw r18, r8 34890: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 34894: 20 e0 ldi r18, 0x00 ; 0 34896: 30 e9 ldi r19, 0x90 ; 144 34898: 42 ea ldi r20, 0xA2 ; 162 3489a: 56 e4 ldi r21, 0x46 ; 70 3489c: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 348a0: 9b 01 movw r18, r22 348a2: ac 01 movw r20, r24 348a4: 6a 81 ldd r22, Y+2 ; 0x02 348a6: 7b 81 ldd r23, Y+3 ; 0x03 348a8: 8c 81 ldd r24, Y+4 ; 0x04 348aa: 9d 81 ldd r25, Y+5 ; 0x05 348ac: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 348b0: 4b 01 movw r8, r22 348b2: 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)); 348b4: f1 01 movw r30, r2 348b6: 20 81 ld r18, Z 348b8: 31 81 ldd r19, Z+1 ; 0x01 348ba: 42 81 ldd r20, Z+2 ; 0x02 348bc: 53 81 ldd r21, Z+3 ; 0x03 348be: c7 01 movw r24, r14 348c0: b6 01 movw r22, r12 348c2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 348c6: a3 01 movw r20, r6 348c8: 92 01 movw r18, r4 348ca: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 348ce: 20 e0 ldi r18, 0x00 ; 0 348d0: 30 e9 ldi r19, 0x90 ; 144 348d2: 42 ea ldi r20, 0xA2 ; 162 348d4: 56 e4 ldi r21, 0x46 ; 70 348d6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 348da: 9b 01 movw r18, r22 348dc: 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)) + 348de: c5 01 movw r24, r10 348e0: b4 01 movw r22, r8 348e2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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] = 348e6: e8 85 ldd r30, Y+8 ; 0x08 348e8: f9 85 ldd r31, Y+9 ; 0x09 348ea: 65 8f std Z+29, r22 ; 0x1d 348ec: 76 8f std Z+30, r23 ; 0x1e 348ee: 87 8f std Z+31, r24 ; 0x1f 348f0: 90 a3 std Z+32, r25 ; 0x20 348f2: 88 85 ldd r24, Y+8 ; 0x08 348f4: 99 85 ldd r25, Y+9 ; 0x09 348f6: 4c 96 adiw r24, 0x1c ; 28 348f8: 99 87 std Y+9, r25 ; 0x09 348fa: 88 87 std Y+8, r24 ; 0x08 348fc: 99 81 ldd r25, Y+1 ; 0x01 348fe: 9f 5f subi r25, 0xFF ; 255 34900: 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) { 34902: 96 30 cpi r25, 0x06 ; 6 34904: 09 f0 breq .+2 ; 0x34908 34906: 6f cf rjmp .-290 ; 0x347e6 34908: 0c 5f subi r16, 0xFC ; 252 3490a: 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) { 3490c: e3 e1 ldi r30, 0x13 ; 19 3490e: 0e 3d cpi r16, 0xDE ; 222 34910: 1e 07 cpc r17, r30 34912: 09 f0 breq .+2 ; 0x34916 34914: 5b cf rjmp .-330 ; 0x347cc z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 34916: 29 96 adiw r28, 0x09 ; 9 34918: 0f b6 in r0, 0x3f ; 63 3491a: f8 94 cli 3491c: de bf out 0x3e, r29 ; 62 3491e: 0f be out 0x3f, r0 ; 63 34920: cd bf out 0x3d, r28 ; 61 34922: df 91 pop r29 34924: cf 91 pop r28 34926: 1f 91 pop r17 34928: 0f 91 pop r16 3492a: ff 90 pop r15 3492c: ef 90 pop r14 3492e: df 90 pop r13 34930: cf 90 pop r12 34932: bf 90 pop r11 34934: af 90 pop r10 34936: 9f 90 pop r9 34938: 8f 90 pop r8 3493a: 7f 90 pop r7 3493c: 6f 90 pop r6 3493e: 5f 90 pop r5 34940: 4f 90 pop r4 34942: 3f 90 pop r3 34944: 2f 90 pop r2 34946: 08 95 ret 00034948 : 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) { 34948: 1f 93 push r17 3494a: cf 93 push r28 3494c: df 93 push r29 3494e: 00 d0 rcall .+0 ; 0x34950 34950: 1f 92 push r1 34952: 1f 92 push r1 34954: cd b7 in r28, 0x3d ; 61 34956: de b7 in r29, 0x3e ; 62 34958: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 3495a: 48 2f mov r20, r24 3495c: 62 e5 ldi r22, 0x52 ; 82 3495e: ce 01 movw r24, r28 34960: 01 96 adiw r24, 0x01 ; 1 34962: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34966: 49 81 ldd r20, Y+1 ; 0x01 34968: 5a 81 ldd r21, Y+2 ; 0x02 3496a: 6b 81 ldd r22, Y+3 ; 0x03 3496c: 7c 81 ldd r23, Y+4 ; 0x04 3496e: 8d 81 ldd r24, Y+5 ; 0x05 34970: 0f 94 d7 67 call 0x2cfae ; 0x2cfae scopeState = nextState; 34974: 10 93 4e 13 sts 0x134E, r17 ; 0x80134e } 34978: 0f 90 pop r0 3497a: 0f 90 pop r0 3497c: 0f 90 pop r0 3497e: 0f 90 pop r0 34980: 0f 90 pop r0 34982: df 91 pop r29 34984: cf 91 pop r28 34986: 1f 91 pop r17 34988: 08 95 ret 0003498a : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 3498a: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 3498e: e0 e6 ldi r30, 0x60 ; 96 34990: fa ea ldi r31, 0xAA ; 170 34992: 84 91 lpm r24, Z 34994: 67 e0 ldi r22, 0x07 ; 7 34996: 0d 94 a4 a4 jmp 0x34948 ; 0x34948 0003499a : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 3499a: e0 91 99 13 lds r30, 0x1399 ; 0x801399 3499e: ae 2f mov r26, r30 349a0: b0 e0 ldi r27, 0x00 ; 0 349a2: aa 0f add r26, r26 349a4: bb 1f adc r27, r27 349a6: ad 56 subi r26, 0x6D ; 109 349a8: bc 4e sbci r27, 0xEC ; 236 349aa: 20 91 66 13 lds r18, 0x1366 ; 0x801366 349ae: 30 91 67 13 lds r19, 0x1367 ; 0x801367 349b2: 2d 93 st X+, r18 349b4: 3c 93 st X, r19 ++regIndex; 349b6: ef 5f subi r30, 0xFF ; 255 349b8: e0 93 99 13 sts 0x1399, r30 ; 0x801399 if (regIndex >= regs16Count) { 349bc: e2 30 cpi r30, 0x02 ; 2 349be: 40 f4 brcc .+16 ; 0x349d0 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 349c0: f0 e0 ldi r31, 0x00 ; 0 349c2: e9 5b subi r30, 0xB9 ; 185 349c4: f5 45 sbci r31, 0x55 ; 85 349c6: 84 91 lpm r24, Z 349c8: 68 e0 ldi r22, 0x08 ; 8 349ca: 0f 94 a4 a4 call 0x34948 ; 0x34948 } return ScopeState::Reading16bitRegisters; 349ce: 88 e0 ldi r24, 0x08 ; 8 } 349d0: 08 95 ret 000349d2 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 349d2: e0 91 99 13 lds r30, 0x1399 ; 0x801399 349d6: ae 2f mov r26, r30 349d8: b0 e0 ldi r27, 0x00 ; 0 349da: a0 57 subi r26, 0x70 ; 112 349dc: bc 4e sbci r27, 0xEC ; 236 349de: 80 91 66 13 lds r24, 0x1366 ; 0x801366 349e2: 8c 93 st X, r24 ++regIndex; 349e4: ef 5f subi r30, 0xFF ; 255 349e6: e0 93 99 13 sts 0x1399, r30 ; 0x801399 if (regIndex >= regs8Count) { 349ea: e3 30 cpi r30, 0x03 ; 3 349ec: 40 f0 brcs .+16 ; 0x349fe SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 349ee: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 349f2: e7 e4 ldi r30, 0x47 ; 71 349f4: fa ea ldi r31, 0xAA ; 170 349f6: 84 91 lpm r24, Z 349f8: 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); 349fa: 0d 94 a4 a4 jmp 0x34948 ; 0x34948 349fe: f0 e0 ldi r31, 0x00 ; 0 34a00: e0 5a subi r30, 0xA0 ; 160 34a02: f5 45 sbci r31, 0x55 ; 85 34a04: 84 91 lpm r24, Z 34a06: 67 e0 ldi r22, 0x07 ; 7 34a08: f8 cf rjmp .-16 ; 0x349fa 00034a0a : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 34a0a: cf 93 push r28 34a0c: df 93 push r29 34a0e: 00 d0 rcall .+0 ; 0x34a10 34a10: 00 d0 rcall .+0 ; 0x34a12 34a12: 00 d0 rcall .+0 ; 0x34a14 34a14: 1f 92 push r1 34a16: cd b7 in r28, 0x3d ; 61 34a18: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 34a1a: 80 91 55 13 lds r24, 0x1355 ; 0x801355 34a1e: 82 34 cpi r24, 0x42 ; 66 34a20: 09 f4 brne .+2 ; 0x34a24 34a22: 46 c0 rjmp .+140 ; 0x34ab0 34a24: b8 f5 brcc .+110 ; 0x34a94 34a26: 88 23 and r24, r24 34a28: 09 f4 brne .+2 ; 0x34a2c 34a2a: 72 c0 rjmp .+228 ; 0x34b10 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 34a2c: 84 e0 ldi r24, 0x04 ; 4 34a2e: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 34a32: 85 e0 ldi r24, 0x05 ; 5 34a34: e5 e5 ldi r30, 0x55 ; 85 34a36: f3 e1 ldi r31, 0x13 ; 19 34a38: de 01 movw r26, r28 34a3a: 16 96 adiw r26, 0x06 ; 6 34a3c: 01 90 ld r0, Z+ 34a3e: 0d 92 st X+, r0 34a40: 8a 95 dec r24 34a42: e1 f7 brne .-8 ; 0x34a3c StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 34a44: 85 e0 ldi r24, 0x05 ; 5 34a46: fe 01 movw r30, r28 34a48: 36 96 adiw r30, 0x06 ; 6 34a4a: a0 e5 ldi r26, 0x50 ; 80 34a4c: b3 e1 ldi r27, 0x13 ; 19 34a4e: 01 90 ld r0, Z+ 34a50: 0d 92 st X+, r0 34a52: 8a 95 dec r24 34a54: e1 f7 brne .-8 ; 0x34a4e SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 34a56: 40 e0 ldi r20, 0x00 ; 0 34a58: 60 e0 ldi r22, 0x00 ; 0 34a5a: ce 01 movw r24, r28 34a5c: 01 96 adiw r24, 0x01 ; 1 34a5e: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34a62: 85 e0 ldi r24, 0x05 ; 5 34a64: fe 01 movw r30, r28 34a66: 31 96 adiw r30, 0x01 ; 1 34a68: a5 e5 ldi r26, 0x55 ; 85 34a6a: b3 e1 ldi r27, 0x13 ; 19 34a6c: 01 90 ld r0, Z+ 34a6e: 0d 92 st X+, r0 34a70: 8a 95 dec r24 34a72: e1 f7 brne .-8 ; 0x34a6c void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 34a74: 85 e0 ldi r24, 0x05 ; 5 34a76: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e SendMsg(rq); 34a7a: 40 91 50 13 lds r20, 0x1350 ; 0x801350 34a7e: 50 91 51 13 lds r21, 0x1351 ; 0x801351 34a82: 60 91 52 13 lds r22, 0x1352 ; 0x801352 34a86: 70 91 53 13 lds r23, 0x1353 ; 0x801353 34a8a: 80 91 54 13 lds r24, 0x1354 ; 0x801354 34a8e: 0f 94 d7 67 call 0x2cfae ; 0x2cfae 34a92: 2e c0 rjmp .+92 ; 0x34af0 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 34a94: 82 35 cpi r24, 0x52 ; 82 34a96: b1 f1 breq .+108 ; 0x34b04 34a98: 87 35 cpi r24, 0x57 ; 87 34a9a: 41 f6 brne .-112 ; 0x34a2c 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); 34a9c: 60 91 57 13 lds r22, 0x1357 ; 0x801357 34aa0: 70 91 58 13 lds r23, 0x1358 ; 0x801358 34aa4: 4c e0 ldi r20, 0x0C ; 12 34aa6: 80 91 56 13 lds r24, 0x1356 ; 0x801356 34aaa: 0f 94 42 68 call 0x2d084 ; 0x2d084 34aae: 11 c0 rjmp .+34 ; 0x34ad2 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 34ab0: 40 91 56 13 lds r20, 0x1356 ; 0x801356 34ab4: 62 e4 ldi r22, 0x42 ; 66 34ab6: ce 01 movw r24, r28 34ab8: 01 96 adiw r24, 0x01 ; 1 34aba: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34abe: 49 81 ldd r20, Y+1 ; 0x01 34ac0: 5a 81 ldd r21, Y+2 ; 0x02 34ac2: 6b 81 ldd r22, Y+3 ; 0x03 34ac4: 7c 81 ldd r23, Y+4 ; 0x04 34ac6: 8d 81 ldd r24, Y+5 ; 0x05 34ac8: 0f 94 d7 67 call 0x2cfae ; 0x2cfae scopeState = ScopeState::ButtonSent; 34acc: 8a e0 ldi r24, 0x0A ; 10 34ace: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 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); 34ad2: 40 e0 ldi r20, 0x00 ; 0 34ad4: 60 e0 ldi r22, 0x00 ; 0 34ad6: ce 01 movw r24, r28 34ad8: 01 96 adiw r24, 0x01 ; 1 34ada: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34ade: 85 e0 ldi r24, 0x05 ; 5 34ae0: fe 01 movw r30, r28 34ae2: 31 96 adiw r30, 0x01 ; 1 34ae4: a5 e5 ldi r26, 0x55 ; 85 34ae6: b3 e1 ldi r27, 0x13 ; 19 34ae8: 01 90 ld r0, Z+ 34aea: 0d 92 st X+, r0 34aec: 8a 95 dec r24 34aee: e1 f7 brne .-8 ; 0x34ae8 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 34af0: 81 e0 ldi r24, 0x01 ; 1 } } 34af2: 2a 96 adiw r28, 0x0a ; 10 34af4: 0f b6 in r0, 0x3f ; 63 34af6: f8 94 cli 34af8: de bf out 0x3e, r29 ; 62 34afa: 0f be out 0x3f, r0 ; 63 34afc: cd bf out 0x3d, r28 ; 61 34afe: df 91 pop r29 34b00: cf 91 pop r28 34b02: 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); 34b04: 6b e0 ldi r22, 0x0B ; 11 34b06: 80 91 56 13 lds r24, 0x1356 ; 0x801356 34b0a: 0f 94 a4 a4 call 0x34948 ; 0x34948 34b0e: e1 cf rjmp .-62 ; 0x34ad2 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 34b10: 80 e0 ldi r24, 0x00 ; 0 34b12: ef cf rjmp .-34 ; 0x34af2 00034b14 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 34b14: cf 93 push r28 34b16: df 93 push r29 34b18: 00 d0 rcall .+0 ; 0x34b1a 34b1a: 1f 92 push r1 34b1c: 1f 92 push r1 34b1e: cd b7 in r28, 0x3d ; 61 34b20: de b7 in r29, 0x3e ; 62 34b22: 49 83 std Y+1, r20 ; 0x01 34b24: 5a 83 std Y+2, r21 ; 0x02 34b26: 6b 83 std Y+3, r22 ; 0x03 34b28: 7c 83 std Y+4, r23 ; 0x04 34b2a: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 34b2c: 85 e0 ldi r24, 0x05 ; 5 34b2e: fe 01 movw r30, r28 34b30: 31 96 adiw r30, 0x01 ; 1 34b32: a5 e5 ldi r26, 0x55 ; 85 34b34: b3 e1 ldi r27, 0x13 ; 19 34b36: 01 90 ld r0, Z+ 34b38: 0d 92 st X+, r0 34b3a: 8a 95 dec r24 34b3c: e1 f7 brne .-8 ; 0x34b36 if (!ExpectsResponse()) { 34b3e: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 34b42: 87 ff sbrs r24, 7 34b44: 09 c0 rjmp .+18 ; 0x34b58 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 34b46: 0f 90 pop r0 34b48: 0f 90 pop r0 34b4a: 0f 90 pop r0 34b4c: 0f 90 pop r0 34b4e: 0f 90 pop r0 34b50: df 91 pop r29 34b52: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 34b54: 0d 94 05 a5 jmp 0x34a0a ; 0x34a0a } // otherwise wait for an empty window to activate the request } 34b58: 0f 90 pop r0 34b5a: 0f 90 pop r0 34b5c: 0f 90 pop r0 34b5e: 0f 90 pop r0 34b60: 0f 90 pop r0 34b62: df 91 pop r29 34b64: cf 91 pop r28 34b66: 08 95 ret 00034b68 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 34b68: 1f 93 push r17 34b6a: cf 93 push r28 34b6c: df 93 push r29 34b6e: 00 d0 rcall .+0 ; 0x34b70 34b70: 1f 92 push r1 34b72: 1f 92 push r1 34b74: cd b7 in r28, 0x3d ; 61 34b76: de b7 in r29, 0x3e ; 62 34b78: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 34b7a: 48 2f mov r20, r24 34b7c: 63 e5 ldi r22, 0x53 ; 83 34b7e: ce 01 movw r24, r28 34b80: 01 96 adiw r24, 0x01 ; 1 34b82: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34b86: 49 81 ldd r20, Y+1 ; 0x01 34b88: 5a 81 ldd r21, Y+2 ; 0x02 34b8a: 6b 81 ldd r22, Y+3 ; 0x03 34b8c: 7c 81 ldd r23, Y+4 ; 0x04 34b8e: 8d 81 ldd r24, Y+5 ; 0x05 34b90: 0f 94 d7 67 call 0x2cfae ; 0x2cfae scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 34b94: 10 93 4e 13 sts 0x134E, r17 ; 0x80134e } 34b98: 0f 90 pop r0 34b9a: 0f 90 pop r0 34b9c: 0f 90 pop r0 34b9e: 0f 90 pop r0 34ba0: 0f 90 pop r0 34ba2: df 91 pop r29 34ba4: cf 91 pop r28 34ba6: 1f 91 pop r17 34ba8: 08 95 ret 00034baa : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 34baa: cf 93 push r28 34bac: df 93 push r29 34bae: 00 d0 rcall .+0 ; 0x34bb0 34bb0: 1f 92 push r1 34bb2: 1f 92 push r1 34bb4: cd b7 in r28, 0x3d ; 61 34bb6: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 34bb8: 40 e0 ldi r20, 0x00 ; 0 34bba: 61 e5 ldi r22, 0x51 ; 81 34bbc: ce 01 movw r24, r28 34bbe: 01 96 adiw r24, 0x01 ; 1 34bc0: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34bc4: 49 81 ldd r20, Y+1 ; 0x01 34bc6: 5a 81 ldd r21, Y+2 ; 0x02 34bc8: 6b 81 ldd r22, Y+3 ; 0x03 34bca: 7c 81 ldd r23, Y+4 ; 0x04 34bcc: 8d 81 ldd r24, Y+5 ; 0x05 34bce: 0f 94 d7 67 call 0x2cfae ; 0x2cfae scopeState = ScopeState::QuerySent; 34bd2: 84 e0 ldi r24, 0x04 ; 4 34bd4: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e } 34bd8: 0f 90 pop r0 34bda: 0f 90 pop r0 34bdc: 0f 90 pop r0 34bde: 0f 90 pop r0 34be0: 0f 90 pop r0 34be2: df 91 pop r29 34be4: cf 91 pop r28 34be6: 08 95 ret 00034be8 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 34be8: cf 93 push r28 34bea: df 93 push r29 34bec: 00 d0 rcall .+0 ; 0x34bee 34bee: 1f 92 push r1 34bf0: 1f 92 push r1 34bf2: cd b7 in r28, 0x3d ; 61 34bf4: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 34bf6: 0f 94 1d c6 call 0x38c3a ; 0x38c3a 34bfa: 80 93 8f 13 sts 0x138F, r24 ; 0x80138f 34bfe: 48 2f mov r20, r24 34c00: 66 e6 ldi r22, 0x66 ; 102 34c02: ce 01 movw r24, r28 34c04: 01 96 adiw r24, 0x01 ; 1 34c06: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34c0a: 49 81 ldd r20, Y+1 ; 0x01 34c0c: 5a 81 ldd r21, Y+2 ; 0x02 34c0e: 6b 81 ldd r22, Y+3 ; 0x03 34c10: 7c 81 ldd r23, Y+4 ; 0x04 34c12: 8d 81 ldd r24, Y+5 ; 0x05 34c14: 0f 94 d7 67 call 0x2cfae ; 0x2cfae scopeState = ScopeState::FilamentSensorStateSent; 34c18: 86 e0 ldi r24, 0x06 ; 6 34c1a: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e } 34c1e: 0f 90 pop r0 34c20: 0f 90 pop r0 34c22: 0f 90 pop r0 34c24: 0f 90 pop r0 34c26: 0f 90 pop r0 34c28: df 91 pop r29 34c2a: cf 91 pop r28 34c2c: 08 95 ret 00034c2e : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 34c2e: cf 93 push r28 34c30: df 93 push r29 34c32: 00 d0 rcall .+0 ; 0x34c34 34c34: 1f 92 push r1 34c36: 1f 92 push r1 34c38: cd b7 in r28, 0x3d ; 61 34c3a: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 34c3c: 80 91 65 13 lds r24, 0x1365 ; 0x801365 34c40: 85 34 cpi r24, 0x45 ; 69 34c42: f1 f0 breq .+60 ; 0x34c80 34c44: 20 f4 brcc .+8 ; 0x34c4e 34c46: 82 34 cpi r24, 0x42 ; 66 34c48: 51 f1 breq .+84 ; 0x34c9e } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 34c4a: 85 e0 ldi r24, 0x05 ; 5 34c4c: 11 c0 rjmp .+34 ; 0x34c70 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 34c4e: 86 34 cpi r24, 0x46 ; 70 34c50: 71 f1 breq .+92 ; 0x34cae 34c52: 80 35 cpi r24, 0x50 ; 80 34c54: d1 f7 brne .-12 ; 0x34c4a case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 34c56: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34c5a: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = ErrorCode::OK; 34c5e: 81 e0 ldi r24, 0x01 ; 1 34c60: 90 e0 ldi r25, 0x00 ; 0 34c62: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34c66: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 34c6a: 0f 94 f4 a5 call 0x34be8 ; 0x34be8 return Processing; 34c6e: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 34c70: 0f 90 pop r0 34c72: 0f 90 pop r0 34c74: 0f 90 pop r0 34c76: 0f 90 pop r0 34c78: 0f 90 pop r0 34c7a: df 91 pop r29 34c7c: cf 91 pop r28 34c7e: 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; 34c80: 8c e0 ldi r24, 0x0C ; 12 34c82: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = static_cast(rsp.paramValue); 34c86: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34c8a: 90 91 67 13 lds r25, 0x1367 ; 0x801367 34c8e: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34c92: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b // 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(); 34c96: 0f 94 f4 a5 call 0x34be8 ; 0x34be8 return CommandError; 34c9a: 87 e0 ldi r24, 0x07 ; 7 34c9c: e9 cf rjmp .-46 ; 0x34c70 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); 34c9e: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34ca2: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e SendAndUpdateFilamentSensor(); 34ca6: 0f 94 f4 a5 call 0x34be8 ; 0x34be8 return ButtonPushed; 34caa: 8b e0 ldi r24, 0x0B ; 11 34cac: e1 cf rjmp .-62 ; 0x34c70 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) { 34cae: 90 91 50 13 lds r25, 0x1350 ; 0x801350 34cb2: 80 91 60 13 lds r24, 0x1360 ; 0x801360 34cb6: 98 13 cpse r25, r24 34cb8: 22 c0 rjmp .+68 ; 0x34cfe 34cba: 90 91 51 13 lds r25, 0x1351 ; 0x801351 34cbe: 80 91 61 13 lds r24, 0x1361 ; 0x801361 34cc2: 98 13 cpse r25, r24 34cc4: 1c c0 rjmp .+56 ; 0x34cfe progressCode = ProgressCode::OK; 34cc6: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::OK; 34cca: 81 e0 ldi r24, 0x01 ; 1 34ccc: 90 e0 ldi r25, 0x00 ; 0 34cce: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34cd2: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b scopeState = ScopeState::Ready; 34cd6: 82 e8 ldi r24, 0x82 ; 130 34cd8: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 34cdc: 40 e0 ldi r20, 0x00 ; 0 34cde: 60 e0 ldi r22, 0x00 ; 0 34ce0: ce 01 movw r24, r28 34ce2: 01 96 adiw r24, 0x01 ; 1 34ce4: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34ce8: 85 e0 ldi r24, 0x05 ; 5 34cea: fe 01 movw r30, r28 34cec: 31 96 adiw r30, 0x01 ; 1 34cee: a0 e5 ldi r26, 0x50 ; 80 34cf0: b3 e1 ldi r27, 0x13 ; 19 34cf2: 01 90 ld r0, Z+ 34cf4: 0d 92 st X+, r0 34cf6: 8a 95 dec r24 34cf8: e1 f7 brne .-8 ; 0x34cf2 34cfa: 82 e0 ldi r24, 0x02 ; 2 34cfc: b9 cf rjmp .-142 ; 0x34c70 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 34cfe: 83 e0 ldi r24, 0x03 ; 3 34d00: b7 cf rjmp .-146 ; 0x34c70 00034d02 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 34d02: 1f 93 push r17 34d04: cf 93 push r28 34d06: df 93 push r29 34d08: 00 d0 rcall .+0 ; 0x34d0a 34d0a: 1f 92 push r1 34d0c: 1f 92 push r1 34d0e: cd b7 in r28, 0x3d ; 61 34d10: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 34d12: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 34d16: 81 11 cpse r24, r1 34d18: 2a c0 rjmp .+84 ; 0x34d6e auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 34d1a: 10 91 b5 13 lds r17, 0x13B5 ; 0x8013b5 34d1e: 1f 3f cpi r17, 0xFF ; 255 34d20: 91 f5 brne .+100 ; 0x34d86 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 34d22: 80 91 b4 13 lds r24, 0x13B4 ; 0x8013b4 34d26: 81 11 cpse r24, r1 34d28: 60 c0 rjmp .+192 ; 0x34dea 34d2a: 1f 3f cpi r17, 0xFF ; 255 34d2c: b9 f0 breq .+46 ; 0x34d5c inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 34d2e: 81 e0 ldi r24, 0x01 ; 1 34d30: 90 e0 ldi r25, 0x00 ; 0 34d32: 90 93 4c 13 sts 0x134C, r25 ; 0x80134c 34d36: 80 93 4b 13 sts 0x134B, r24 ; 0x80134b } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 34d3a: 90 93 b3 13 sts 0x13B3, r25 ; 0x8013b3 34d3e: 80 93 b2 13 sts 0x13B2, r24 ; 0x8013b2 lastErrorSource = ErrorSource::ErrorSourceNone; 34d42: 8f ef ldi r24, 0xFF ; 255 34d44: 80 93 b4 13 sts 0x13B4, r24 ; 0x8013b4 // 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) { 34d48: 13 30 cpi r17, 0x03 ; 3 34d4a: 09 f4 brne .+2 ; 0x34d4e 34d4c: 82 c0 rjmp .+260 ; 0x34e52 34d4e: f8 f0 brcs .+62 ; 0x34d8e 34d50: 16 30 cpi r17, 0x06 ; 6 34d52: 08 f4 brcc .+2 ; 0x34d56 34d54: 7b c0 rjmp .+246 ; 0x34e4c 34d56: 17 30 cpi r17, 0x07 ; 7 34d58: 09 f4 brne .+2 ; 0x34d5c 34d5a: 7e c0 rjmp .+252 ; 0x34e58 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 34d5c: 0f 90 pop r0 34d5e: 0f 90 pop r0 34d60: 0f 90 pop r0 34d62: 0f 90 pop r0 34d64: 0f 90 pop r0 34d66: df 91 pop r29 34d68: cf 91 pop r28 34d6a: 1f 91 pop r17 34d6c: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 34d6e: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34d72: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34d76: 0f 94 af c8 call 0x3915e ; 0x3915e 34d7a: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 34d7c: 10 92 ae 0d sts 0x0DAE, r1 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 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) { 34d80: 8f 3f cpi r24, 0xFF ; 255 34d82: 79 f6 brne .-98 ; 0x34d22 34d84: ca cf rjmp .-108 ; 0x34d1a btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 34d86: 8f ef ldi r24, 0xFF ; 255 34d88: 80 93 b5 13 sts 0x13B5, r24 ; 0x8013b5 34d8c: ca cf rjmp .-108 ; 0x34d22 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 34d8e: 88 e9 ldi r24, 0x98 ; 152 34d90: 98 ea ldi r25, 0xA8 ; 168 34d92: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 34d96: 81 2f mov r24, r17 34d98: 90 e0 ldi r25, 0x00 ; 0 34d9a: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 34d9e: 0f 94 4c ac call 0x35898 ; 0x35898 if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 34da2: 80 91 b4 13 lds r24, 0x13B4 ; 0x8013b4 34da6: 81 30 cpi r24, 0x01 ; 1 34da8: 89 f4 brne .+34 ; 0x34dcc ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 34daa: 81 e9 ldi r24, 0x91 ; 145 34dac: 98 ea ldi r25, 0xA8 ; 168 34dae: 0f 94 0d c6 call 0x38c1a ; 0x38c1a void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 34db2: 41 2f mov r20, r17 34db4: 62 e4 ldi r22, 0x42 ; 66 34db6: ce 01 movw r24, r28 34db8: 01 96 adiw r24, 0x01 ; 1 34dba: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 34dbe: 49 81 ldd r20, Y+1 ; 0x01 34dc0: 5a 81 ldd r21, Y+2 ; 0x02 34dc2: 6b 81 ldd r22, Y+3 ; 0x03 34dc4: 7c 81 ldd r23, Y+4 ; 0x04 34dc6: 8d 81 ldd r24, Y+5 ; 0x05 34dc8: 0f 94 8a a5 call 0x34b14 ; 0x34b14 } // 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) { 34dcc: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34dd0: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34dd4: 84 30 cpi r24, 0x04 ; 4 34dd6: 20 e8 ldi r18, 0x80 ; 128 34dd8: 92 07 cpc r25, r18 34dda: 21 f0 breq .+8 ; 0x34de4 34ddc: 89 30 cpi r24, 0x09 ; 9 34dde: 90 48 sbci r25, 0x80 ; 128 34de0: 09 f0 breq .+2 ; 0x34de4 34de2: bc cf rjmp .-136 ; 0x34d5c case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 34de4: 0f 94 47 6b call 0x2d68e ; 0x2d68e 34de8: b9 cf rjmp .-142 ; 0x34d5c // 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) { 34dea: 19 30 cpi r17, 0x09 ; 9 34dec: 08 f0 brcs .+2 ; 0x34df0 34dee: b6 cf rjmp .-148 ; 0x34d5c 34df0: e1 2f mov r30, r17 34df2: f0 e0 ldi r31, 0x00 ; 0 34df4: 88 27 eor r24, r24 34df6: e0 50 subi r30, 0x00 ; 0 34df8: f9 45 sbci r31, 0x59 ; 89 34dfa: 8e 4f sbci r24, 0xFE ; 254 34dfc: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 34e00: ca 39 cpi r28, 0x9A ; 154 34e02: ca 39 cpi r28, 0x9A ; 154 34e04: ca 39 cpi r28, 0x9A ; 154 34e06: 36 39 cpi r19, 0x96 ; 150 34e08: d6 38 cpi r29, 0x86 ; 134 34e0a: d6 38 cpi r29, 0x86 ; 134 34e0c: 20 3a cpi r18, 0xA0 ; 160 34e0e: 7c 39 cpi r23, 0x9C ; 156 34e10: 54 3a cpi r21, 0xA4 ; 164 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 34e12: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34e16: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34e1a: 87 38 cpi r24, 0x87 ; 135 34e1c: 20 e8 ldi r18, 0x80 ; 128 34e1e: 92 07 cpc r25, r18 34e20: 21 f0 breq .+8 ; 0x34e2a 34e22: 87 30 cpi r24, 0x07 ; 7 34e24: 91 48 sbci r25, 0x81 ; 129 34e26: 09 f0 breq .+2 ; 0x34e2a 34e28: 99 cf rjmp .-206 ; 0x34d5c // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 34e2a: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 34e2e: 84 30 cpi r24, 0x04 ; 4 34e30: 21 f4 brne .+8 ; 0x34e3a ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 34e32: 80 91 50 13 lds r24, 0x1350 ; 0x801350 34e36: 81 11 cpse r24, r1 34e38: 91 cf rjmp .-222 ; 0x34d5c // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 34e3a: 81 e0 ldi r24, 0x01 ; 1 34e3c: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.498> menu_submenu(tuneIdlerStallguardThresholdMenu); 34e40: 60 e0 ldi r22, 0x00 ; 0 34e42: 8c ed ldi r24, 0xDC ; 220 34e44: 99 e3 ldi r25, 0x39 ; 57 34e46: 0f 94 3b d3 call 0x3a676 ; 0x3a676 34e4a: 88 cf rjmp .-240 ; 0x34d5c } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 34e4c: 10 93 b8 13 sts 0x13B8, r17 ; 0x8013b8 34e50: 85 cf rjmp .-246 ; 0x34d5c void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 34e52: 0f 94 d2 c5 call 0x38ba4 ; 0x38ba4 34e56: 82 cf rjmp .-252 ; 0x34d5c StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 34e58: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 34e5c: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 34e60: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 34e64: 60 e0 ldi r22, 0x00 ; 0 34e66: 8c ea ldi r24, 0xAC ; 172 34e68: 9c e0 ldi r25, 0x0C ; 12 34e6a: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 34e6e: 0f 94 1e 76 call 0x2ec3c ; 0x2ec3c 34e72: 74 cf rjmp .-280 ; 0x34d5c 00034e74 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 34e74: 4f 92 push r4 34e76: 5f 92 push r5 34e78: 6f 92 push r6 34e7a: 7f 92 push r7 34e7c: 8f 92 push r8 34e7e: 9f 92 push r9 34e80: af 92 push r10 34e82: bf 92 push r11 34e84: cf 92 push r12 34e86: df 92 push r13 34e88: ef 92 push r14 34e8a: ff 92 push r15 34e8c: 0f 93 push r16 34e8e: 1f 93 push r17 34e90: cf 93 push r28 34e92: df 93 push r29 34e94: cd b7 in r28, 0x3d ; 61 34e96: de b7 in r29, 0x3e ; 62 34e98: a0 97 sbiw r28, 0x20 ; 32 34e9a: 0f b6 in r0, 0x3f ; 63 34e9c: f8 94 cli 34e9e: de bf out 0x3e, r29 ; 62 34ea0: 0f be out 0x3f, r0 ; 63 34ea2: cd bf out 0x3d, r28 ; 61 34ea4: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 34ea6: 0f 94 81 a6 call 0x34d02 ; 0x34d02 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 34eaa: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 34eae: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 34eb0: 0f 94 05 a5 call 0x34a0a ; 0x34a0a 34eb4: 90 91 4e 13 lds r25, 0x134E ; 0x80134e } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 34eb8: 97 ff sbrs r25, 7 34eba: 7d c0 rjmp .+250 ; 0x34fb6 // we are waiting for something switch (currentScope) { 34ebc: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 34ec0: 82 30 cpi r24, 0x02 ; 2 34ec2: b1 f0 breq .+44 ; 0x34ef0 34ec4: 08 f4 brcc .+2 ; 0x34ec8 34ec6: 75 c0 rjmp .+234 ; 0x34fb2 34ec8: 83 30 cpi r24, 0x03 ; 3 34eca: e1 f1 breq .+120 ; 0x34f44 34ecc: 84 30 cpi r24, 0x04 ; 4 34ece: 09 f4 brne .+2 ; 0x34ed2 34ed0: 54 c0 rjmp .+168 ; 0x34f7a 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 34ed2: 0f 94 05 a5 call 0x34a0a ; 0x34a0a 34ed6: 81 11 cpse r24, r1 34ed8: 6b c3 rjmp .+1750 ; 0x355b0 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 34eda: 82 e0 ldi r24, 0x02 ; 2 34edc: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::Idle; 34ee0: 83 e0 ldi r24, 0x03 ; 3 34ee2: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 34ee6: 82 e8 ldi r24, 0x82 ; 130 34ee8: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e // 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()) { 34eec: 12 e0 ldi r17, 0x02 ; 2 34eee: db c2 rjmp .+1462 ; 0x354a6 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34ef0: 0f 94 51 2a call 0x254a2 ; 0x254a2 34ef4: ab 01 movw r20, r22 34ef6: bc 01 movw r22, r24 34ef8: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34efc: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34f00: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34f04: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 34f08: 88 51 subi r24, 0x18 ; 24 34f0a: 9c 4f sbci r25, 0xFC ; 252 34f0c: af 4f sbci r26, 0xFF ; 255 34f0e: 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 34f10: 48 17 cp r20, r24 34f12: 59 07 cpc r21, r25 34f14: 6a 07 cpc r22, r26 34f16: 7b 07 cpc r23, r27 34f18: 08 f4 brcc .+2 ; 0x34f1c 34f1a: 4b c0 rjmp .+150 ; 0x34fb2 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 34f1c: 84 e9 ldi r24, 0x94 ; 148 34f1e: 92 e1 ldi r25, 0x12 ; 18 34f20: 0f 94 80 da call 0x3b500 ; 0x3b500 while (uart->read() != -1) 34f24: 01 96 adiw r24, 0x01 ; 1 34f26: d1 f7 brne .-12 ; 0x34f1c initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 34f28: 81 e0 ldi r24, 0x01 ; 1 34f2a: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::StartSeq; 34f2e: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 34f32: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 34f36: 86 e0 ldi r24, 0x06 ; 6 34f38: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f SendVersion(0); 34f3c: 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); 34f3e: 0f 94 b4 a5 call 0x34b68 ; 0x34b68 34f42: 37 c0 rjmp .+110 ; 0x34fb2 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 34f44: 92 38 cpi r25, 0x82 ; 130 34f46: 29 f6 brne .-118 ; 0x34ed2 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34f48: 0f 94 51 2a call 0x254a2 ; 0x254a2 34f4c: ab 01 movw r20, r22 34f4e: bc 01 movw r22, r24 34f50: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34f54: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34f58: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34f5c: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 34f60: 88 51 subi r24, 0x18 ; 24 34f62: 9c 4f sbci r25, 0xFC ; 252 34f64: af 4f sbci r26, 0xFF ; 255 34f66: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 34f68: 48 17 cp r20, r24 34f6a: 59 07 cpc r21, r25 34f6c: 6a 07 cpc r22, r26 34f6e: 7b 07 cpc r23, r27 34f70: 08 f4 brcc .+2 ; 0x34f74 34f72: af cf rjmp .-162 ; 0x34ed2 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 34f74: 0f 94 d5 a5 call 0x34baa ; 0x34baa 34f78: 1c c0 rjmp .+56 ; 0x34fb2 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34f7a: 0f 94 51 2a call 0x254a2 ; 0x254a2 34f7e: ab 01 movw r20, r22 34f80: bc 01 movw r22, r24 34f82: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34f86: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34f8a: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34f8e: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 34f92: 88 51 subi r24, 0x18 ; 24 34f94: 9c 4f sbci r25, 0xFC ; 252 34f96: af 4f sbci r26, 0xFF ; 255 34f98: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 34f9a: 48 17 cp r20, r24 34f9c: 59 07 cpc r21, r25 34f9e: 6a 07 cpc r22, r26 34fa0: 7b 07 cpc r23, r27 34fa2: 40 f7 brcc .-48 ; 0x34f74 }; 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(); 34fa4: 0f 94 1d c6 call 0x38c3a ; 0x38c3a if (fs != lastFSensor) { 34fa8: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 34fac: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 34fae: 0f 94 f4 a5 call 0x34be8 ; 0x34be8 // 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; 34fb2: 10 e0 ldi r17, 0x00 ; 0 34fb4: 78 c2 rjmp .+1264 ; 0x354a6 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 34fb6: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 34fb8: d1 2c mov r13, r1 34fba: 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; 34fbc: 99 24 eor r9, r9 34fbe: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 34fc0: 55 e0 ldi r21, 0x05 ; 5 34fc2: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 34fc4: 63 e0 ldi r22, 0x03 ; 3 34fc6: 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; 34fc8: 74 e0 ldi r23, 0x04 ; 4 34fca: 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; 34fcc: e2 e0 ldi r30, 0x02 ; 2 34fce: 6e 2e mov r6, r30 34fd0: 66 c0 rjmp .+204 ; 0x3509e ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 34fd2: 23 30 cpi r18, 0x03 ; 3 34fd4: 09 f4 brne .+2 ; 0x34fd8 34fd6: e0 c0 rjmp .+448 ; 0x35198 34fd8: 24 30 cpi r18, 0x04 ; 4 34fda: 09 f0 breq .+2 ; 0x34fde 34fdc: 83 c0 rjmp .+262 ; 0x350e4 } 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'); 34fde: 20 ed ldi r18, 0xD0 ; 208 34fe0: 28 0f add r18, r24 34fe2: 2a 30 cpi r18, 0x0A ; 10 34fe4: 08 f4 brcc .+2 ; 0x34fe8 34fe6: f8 c0 rjmp .+496 ; 0x351d8 34fe8: 2f e9 ldi r18, 0x9F ; 159 34fea: 28 0f add r18, r24 34fec: 26 30 cpi r18, 0x06 ; 6 34fee: 08 f4 brcc .+2 ; 0x34ff2 34ff0: f3 c0 rjmp .+486 ; 0x351d8 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 34ff2: 8a 30 cpi r24, 0x0A ; 10 34ff4: 09 f0 breq .+2 ; 0x34ff8 34ff6: fa c0 rjmp .+500 ; 0x351ec 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()) { 34ff8: 40 90 74 13 lds r4, 0x1374 ; 0x801374 34ffc: 80 e7 ldi r24, 0x70 ; 112 34ffe: 93 e1 ldi r25, 0x13 ; 19 35000: 0f 94 b4 c5 call 0x38b68 ; 0x38b68 35004: 48 12 cpse r4, r24 35006: b8 c0 rjmp .+368 ; 0x35178 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 35008: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f /// @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; } 3500c: 88 e0 ldi r24, 0x08 ; 8 3500e: e0 e7 ldi r30, 0x70 ; 112 35010: f3 e1 ldi r31, 0x13 ; 19 35012: de 01 movw r26, r28 35014: 51 96 adiw r26, 0x11 ; 17 35016: 01 90 ld r0, Z+ 35018: 0d 92 st X+, r0 3501a: 8a 95 dec r24 3501c: e1 f7 brne .-8 ; 0x35016 3501e: 88 e0 ldi r24, 0x08 ; 8 35020: fe 01 movw r30, r28 35022: 71 96 adiw r30, 0x11 ; 17 35024: de 01 movw r26, r28 35026: 59 96 adiw r26, 0x19 ; 25 35028: 01 90 ld r0, Z+ 3502a: 0d 92 st X+, r0 3502c: 8a 95 dec r24 3502e: e1 f7 brne .-8 ; 0x35028 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 35030: 88 e0 ldi r24, 0x08 ; 8 35032: fe 01 movw r30, r28 35034: 79 96 adiw r30, 0x19 ; 25 35036: a0 e6 ldi r26, 0x60 ; 96 35038: b3 e1 ldi r27, 0x13 ; 19 3503a: 01 90 ld r0, Z+ 3503c: 0d 92 st X+, r0 3503e: 8a 95 dec r24 35040: e1 f7 brne .-8 ; 0x3503a } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 35042: 8c e3 ldi r24, 0x3C ; 60 35044: 89 83 std Y+1, r24 ; 0x01 35046: fe 01 movw r30, r28 35048: 32 96 adiw r30, 0x02 ; 2 3504a: a8 e7 ldi r26, 0x78 ; 120 3504c: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 3504e: 20 e0 ldi r18, 0x00 ; 0 35050: cf 01 movw r24, r30 35052: 52 16 cp r5, r18 35054: 09 f4 brne .+2 ; 0x35058 35056: cd c0 rjmp .+410 ; 0x351f2 uint8_t b = lastReceivedBytes[i]; 35058: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 3505a: 40 ee ldi r20, 0xE0 ; 224 3505c: 43 0f add r20, r19 3505e: 40 36 cpi r20, 0x60 ; 96 35060: 08 f0 brcs .+2 ; 0x35064 b = '.'; 35062: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 35064: 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) { 35066: 2f 5f subi r18, 0xFF ; 255 35068: f4 cf rjmp .-24 ; 0x35052 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 3506a: 8e 34 cpi r24, 0x4E ; 78 3506c: 08 f0 brcs .+2 ; 0x35070 3506e: 56 c0 rjmp .+172 ; 0x3511c 35070: 8b 34 cpi r24, 0x4B ; 75 35072: 08 f0 brcs .+2 ; 0x35076 35074: 46 c0 rjmp .+140 ; 0x35102 35076: 82 34 cpi r24, 0x42 ; 66 35078: 09 f4 brne .+2 ; 0x3507c 3507a: 43 c0 rjmp .+134 ; 0x35102 3507c: e0 f5 brcc .+120 ; 0x350f6 3507e: 8a 30 cpi r24, 0x0A ; 10 35080: 59 f0 breq .+22 ; 0x35098 35082: 8d 30 cpi r24, 0x0D ; 13 35084: 49 f0 breq .+18 ; 0x35098 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 35086: b0 92 6f 13 sts 0x136F, r11 ; 0x80136f 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') { 3508a: a1 10 cpse r10, r1 3508c: 05 c1 rjmp .+522 ; 0x35298 3508e: 1f 36 cpi r17, 0x6F ; 111 35090: 09 f0 breq .+2 ; 0x35094 35092: fc c3 rjmp .+2040 ; 0x3588c ++ok; 35094: aa 24 eor r10, r10 35096: 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; 35098: 4f ef ldi r20, 0xFF ; 255 3509a: c4 1a sub r12, r20 3509c: d4 0a sbc r13, r20 3509e: 84 e9 ldi r24, 0x94 ; 148 350a0: 92 e1 ldi r25, 0x12 ; 18 350a2: 0f 94 80 da call 0x3b500 ; 0x3b500 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) { 350a6: 97 fd sbrc r25, 7 350a8: 00 c1 rjmp .+512 ; 0x352aa ++bytesConsumed; RecordReceivedByte(c); 350aa: 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]; 350ac: 20 91 88 13 lds r18, 0x1388 ; 0x801388 350b0: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 350b2: f9 01 movw r30, r18 350b4: e5 5b subi r30, 0xB5 ; 181 350b6: fc 4e sbci r31, 0xEC ; 236 350b8: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 350ba: 79 01 movw r14, r18 350bc: ef ef ldi r30, 0xFF ; 255 350be: ee 1a sub r14, r30 350c0: fe 0a sbc r15, r30 350c2: ff e0 ldi r31, 0x0F ; 15 350c4: ef 22 and r14, r31 350c6: ff 24 eor r15, r15 350c8: 5e 2c mov r5, r14 350ca: e0 92 88 13 sts 0x1388, r14 ; 0x801388 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 350ce: 20 91 6f 13 lds r18, 0x136F ; 0x80136f 350d2: 22 30 cpi r18, 0x02 ; 2 350d4: 09 f4 brne .+2 ; 0x350d8 350d6: 48 c0 rjmp .+144 ; 0x35168 350d8: 08 f0 brcs .+2 ; 0x350dc 350da: 7b cf rjmp .-266 ; 0x34fd2 350dc: 22 23 and r18, r18 350de: 29 f2 breq .-118 ; 0x3506a 350e0: 21 30 cpi r18, 0x01 ; 1 350e2: 51 f1 breq .+84 ; 0x35138 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 350e4: 1a 30 cpi r17, 0x0A ; 10 350e6: 09 f4 brne .+2 ; 0x350ea 350e8: 8f cf rjmp .-226 ; 0x35008 350ea: 1d 30 cpi r17, 0x0D ; 13 350ec: 09 f4 brne .+2 ; 0x350f0 350ee: 8c cf rjmp .-232 ; 0x35008 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 350f0: 10 92 75 13 sts 0x1375, r1 ; 0x801375 350f4: ca cf rjmp .-108 ; 0x3508a } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 350f6: 85 34 cpi r24, 0x45 ; 69 350f8: 30 f2 brcs .-116 ; 0x35086 350fa: 87 34 cpi r24, 0x47 ; 71 350fc: 10 f0 brcs .+4 ; 0x35102 350fe: 88 34 cpi r24, 0x48 ; 72 35100: 11 f6 brne .-124 ; 0x35086 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 35102: 80 93 70 13 sts 0x1370, r24 ; 0x801370 responseMsg.request.value = 0; 35106: 10 92 71 13 sts 0x1371, r1 ; 0x801371 responseMsg.request.value2 = 0; 3510a: 10 92 73 13 sts 0x1373, r1 ; 0x801373 3510e: 10 92 72 13 sts 0x1372, r1 ; 0x801372 responseMsg.request.crc8 = 0; 35112: 10 92 74 13 sts 0x1374, r1 ; 0x801374 rspState = ResponseStates::RequestValue; 35116: 90 92 6f 13 sts 0x136F, r9 ; 0x80136f 3511a: be cf rjmp .-132 ; 0x35098 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 3511c: 89 35 cpi r24, 0x59 ; 89 3511e: 40 f4 brcc .+16 ; 0x35130 35120: 87 35 cpi r24, 0x57 ; 87 35122: 78 f7 brcc .-34 ; 0x35102 35124: 20 eb ldi r18, 0xB0 ; 176 35126: 28 0f add r18, r24 35128: 26 30 cpi r18, 0x06 ; 6 3512a: 08 f0 brcs .+2 ; 0x3512e 3512c: ac cf rjmp .-168 ; 0x35086 3512e: e9 cf rjmp .-46 ; 0x35102 35130: 86 36 cpi r24, 0x66 ; 102 35132: 09 f0 breq .+2 ; 0x35136 35134: a8 cf rjmp .-176 ; 0x35086 35136: e5 cf rjmp .-54 ; 0x35102 } 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'); 35138: 20 ed ldi r18, 0xD0 ; 208 3513a: 28 0f add r18, r24 3513c: 2a 30 cpi r18, 0x0A ; 10 3513e: 50 f0 brcs .+20 ; 0x35154 35140: 2f e9 ldi r18, 0x9F ; 159 35142: 28 0f add r18, r24 35144: 26 30 cpi r18, 0x06 ; 6 35146: 30 f0 brcs .+12 ; 0x35154 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 35148: 80 32 cpi r24, 0x20 ; 32 3514a: 09 f0 breq .+2 ; 0x3514e 3514c: 9c cf rjmp .-200 ; 0x35086 rspState = ResponseStates::ParamCode; 3514e: 60 92 6f 13 sts 0x136F, r6 ; 0x80136f 35152: a2 cf rjmp .-188 ; 0x35098 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 35154: 0f 94 93 c5 call 0x38b26 ; 0x38b26 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 35158: 90 91 71 13 lds r25, 0x1371 ; 0x801371 3515c: 92 95 swap r25 3515e: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 35160: 89 0f add r24, r25 35162: 80 93 71 13 sts 0x1371, r24 ; 0x801371 35166: 98 cf rjmp .-208 ; 0x35098 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 35168: 87 34 cpi r24, 0x47 ; 71 3516a: 48 f4 brcc .+18 ; 0x3517e 3516c: 85 34 cpi r24, 0x45 ; 69 3516e: 58 f4 brcc .+22 ; 0x35186 35170: 2f eb ldi r18, 0xBF ; 191 35172: 28 0f add r18, r24 35174: 22 30 cpi r18, 0x02 ; 2 35176: 38 f0 brcs .+14 ; 0x35186 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 35178: 10 92 75 13 sts 0x1375, r1 ; 0x801375 3517c: 84 cf rjmp .-248 ; 0x35086 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 3517e: 80 35 cpi r24, 0x50 ; 80 35180: 11 f0 breq .+4 ; 0x35186 35182: 82 35 cpi r24, 0x52 ; 82 35184: c9 f7 brne .-14 ; 0x35178 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 35186: 80 92 6f 13 sts 0x136F, r8 ; 0x80136f responseMsg.paramCode = (ResponseMsgParamCodes)c; 3518a: 80 93 75 13 sts 0x1375, r24 ; 0x801375 responseMsg.paramValue = 0; 3518e: 10 92 77 13 sts 0x1377, r1 ; 0x801377 35192: 10 92 76 13 sts 0x1376, r1 ; 0x801376 35196: 80 cf rjmp .-256 ; 0x35098 35198: 20 ed ldi r18, 0xD0 ; 208 3519a: 28 0f add r18, r24 3519c: 2a 30 cpi r18, 0x0A ; 10 3519e: 48 f0 brcs .+18 ; 0x351b2 351a0: 2f e9 ldi r18, 0x9F ; 159 351a2: 28 0f add r18, r24 351a4: 26 30 cpi r18, 0x06 ; 6 351a6: 28 f0 brcs .+10 ; 0x351b2 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 351a8: 8a 32 cpi r24, 0x2A ; 42 351aa: 31 f7 brne .-52 ; 0x35178 rspState = ResponseStates::CRC; 351ac: 70 92 6f 13 sts 0x136F, r7 ; 0x80136f 351b0: 73 cf rjmp .-282 ; 0x35098 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 351b2: 0f 94 93 c5 call 0x38b26 ; 0x38b26 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 351b6: 20 91 76 13 lds r18, 0x1376 ; 0x801376 351ba: 30 91 77 13 lds r19, 0x1377 ; 0x801377 351be: 44 e0 ldi r20, 0x04 ; 4 351c0: 22 0f add r18, r18 351c2: 33 1f adc r19, r19 351c4: 4a 95 dec r20 351c6: e1 f7 brne .-8 ; 0x351c0 responseMsg.paramValue += Char2Nibble(c); 351c8: 82 0f add r24, r18 351ca: 93 2f mov r25, r19 351cc: 91 1d adc r25, r1 351ce: 90 93 77 13 sts 0x1377, r25 ; 0x801377 351d2: 80 93 76 13 sts 0x1376, r24 ; 0x801376 351d6: 60 cf rjmp .-320 ; 0x35098 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 351d8: 0f 94 93 c5 call 0x38b26 ; 0x38b26 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 351dc: 90 91 74 13 lds r25, 0x1374 ; 0x801374 351e0: 92 95 swap r25 351e2: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 351e4: 89 0f add r24, r25 351e6: 80 93 74 13 sts 0x1374, r24 ; 0x801374 351ea: 56 cf rjmp .-340 ; 0x35098 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 351ec: 8d 30 cpi r24, 0x0D ; 13 351ee: 21 f6 brne .-120 ; 0x35178 351f0: 03 cf rjmp .-506 ; 0x34ff8 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 351f2: e8 0e add r14, r24 351f4: f9 1e adc r15, r25 351f6: f7 01 movw r30, r14 351f8: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 351fa: 10 92 88 13 sts 0x1388, r1 ; 0x801388 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 351fe: 82 ec ldi r24, 0xC2 ; 194 35200: 9a ea ldi r25, 0xAA ; 170 35202: 0e 94 d0 76 call 0xeda0 ; 0xeda0 35206: 8c eb ldi r24, 0xBC ; 188 35208: 9a ea ldi r25, 0xAA ; 170 3520a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 3520e: ce 01 movw r24, r28 35210: 01 96 adiw r24, 0x01 ; 1 35212: 0f 94 38 d6 call 0x3ac70 ; 0x3ac70 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 35216: 0f 94 d1 66 call 0x2cda2 ; 0x2cda2 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 3521a: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 3521e: 81 30 cpi r24, 0x01 ; 1 35220: 09 f4 brne .+2 ; 0x35224 35222: 74 c0 rjmp .+232 ; 0x3530c 35224: 08 f4 brcc .+2 ; 0x35228 35226: c5 ce rjmp .-630 ; 0x34fb2 35228: 83 30 cpi r24, 0x03 ; 3 3522a: 09 f4 brne .+2 ; 0x3522e 3522c: d1 c0 rjmp .+418 ; 0x353d0 3522e: 84 30 cpi r24, 0x04 ; 4 35230: 09 f0 breq .+2 ; 0x35234 35232: 4f ce rjmp .-866 ; 0x34ed2 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 35234: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 35238: 86 30 cpi r24, 0x06 ; 6 3523a: 09 f4 brne .+2 ; 0x3523e 3523c: 6c c1 rjmp .+728 ; 0x35516 3523e: 08 f0 brcs .+2 ; 0x35242 35240: 93 c1 rjmp .+806 ; 0x35568 35242: 84 30 cpi r24, 0x04 ; 4 35244: 09 f4 brne .+2 ; 0x35248 35246: 09 c1 rjmp .+530 ; 0x3545a 35248: 85 30 cpi r24, 0x05 ; 5 3524a: 09 f0 breq .+2 ; 0x3524e 3524c: cc c0 rjmp .+408 ; 0x353e6 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 3524e: 80 91 65 13 lds r24, 0x1365 ; 0x801365 35252: 81 34 cpi r24, 0x41 ; 65 35254: 09 f4 brne .+2 ; 0x35258 35256: 96 c1 rjmp .+812 ; 0x35584 35258: 82 35 cpi r24, 0x52 ; 82 3525a: 09 f0 breq .+2 ; 0x3525e 3525c: c4 c0 rjmp .+392 ; 0x353e6 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 3525e: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::PROTOCOL_ERROR; 35262: 8d e2 ldi r24, 0x2D ; 45 35264: 90 e8 ldi r25, 0x80 ; 128 35266: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 3526a: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b } 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")); 3526e: 81 e0 ldi r24, 0x01 ; 1 35270: 98 ea ldi r25, 0xA8 ; 168 35272: 0f 94 ee 66 call 0x2cddc ; 0x2cddc void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 35276: 85 e0 ldi r24, 0x05 ; 5 35278: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e SendMsg(rq); 3527c: 40 91 50 13 lds r20, 0x1350 ; 0x801350 35280: 50 91 51 13 lds r21, 0x1351 ; 0x801351 35284: 60 91 52 13 lds r22, 0x1352 ; 0x801352 35288: 70 91 53 13 lds r23, 0x1353 ; 0x801353 3528c: 80 91 54 13 lds r24, 0x1354 ; 0x801354 35290: 0f 94 d7 67 call 0x2cfae ; 0x2cfae 35294: 16 e0 ldi r17, 0x06 ; 6 35296: 07 c1 rjmp .+526 ; 0x354a6 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') { 35298: 1b 36 cpi r17, 0x6B ; 107 3529a: 09 f0 breq .+2 ; 0x3529e 3529c: f7 c2 rjmp .+1518 ; 0x3588c 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")); 3529e: 82 ee ldi r24, 0xE2 ; 226 352a0: 97 ea ldi r25, 0xA7 ; 167 352a2: 0f 94 ee 66 call 0x2cddc ; 0x2cddc 352a6: 18 e0 ldi r17, 0x08 ; 8 352a8: fe c0 rjmp .+508 ; 0x354a6 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 352aa: cd 28 or r12, r13 352ac: 19 f0 breq .+6 ; 0x352b4 RecordUARTActivity(); // something has happened on the UART, update the timeout record 352ae: 0f 94 d1 66 call 0x2cda2 ; 0x2cda2 352b2: 7f ce rjmp .-770 ; 0x34fb2 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 352b4: 0f 94 51 2a call 0x254a2 ; 0x254a2 352b8: ab 01 movw r20, r22 352ba: bc 01 movw r22, r24 352bc: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 352c0: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 352c4: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 352c8: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 352cc: 80 53 subi r24, 0x30 ; 48 352ce: 98 4f sbci r25, 0xF8 ; 248 352d0: af 4f sbci r26, 0xFF ; 255 352d2: 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) { 352d4: 48 17 cp r20, r24 352d6: 59 07 cpc r21, r25 352d8: 6a 07 cpc r22, r26 352da: 7b 07 cpc r23, r27 352dc: 08 f4 brcc .+2 ; 0x352e0 352de: 69 ce rjmp .-814 ; 0x34fb2 352e0: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 352e4: 88 23 and r24, r24 352e6: 09 f4 brne .+2 ; 0x352ea 352e8: 64 ce rjmp .-824 ; 0x34fb2 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 352ea: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 352ee: 81 e0 ldi r24, 0x01 ; 1 352f0: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::StartSeq; 352f4: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 352f8: 86 e0 ldi r24, 0x06 ; 6 352fa: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f SendVersion(0); 352fe: 80 e0 ldi r24, 0x00 ; 0 35300: 0f 94 b4 a5 call 0x34b68 ; 0x34b68 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 35304: 64 e0 ldi r22, 0x04 ; 4 35306: 8a eb ldi r24, 0xBA ; 186 35308: 97 ea ldi r25, 0xA7 ; 167 3530a: 79 c0 rjmp .+242 ; 0x353fe return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 3530c: 10 91 4e 13 lds r17, 0x134E ; 0x80134e 35310: 13 30 cpi r17, 0x03 ; 3 35312: b1 f1 breq .+108 ; 0x35380 35314: 60 f0 brcs .+24 ; 0x3532e 35316: 16 30 cpi r17, 0x06 ; 6 35318: 09 f4 brne .+2 ; 0x3531c 3531a: 50 c0 rjmp .+160 ; 0x353bc 3531c: 19 30 cpi r17, 0x09 ; 9 3531e: 09 f0 breq .+2 ; 0x35322 35320: be cf rjmp .-132 ; 0x3529e // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 35322: 0f 94 01 69 call 0x2d202 ; 0x2d202 35326: 88 23 and r24, r24 35328: 09 f4 brne .+2 ; 0x3532c 3532a: 43 ce rjmp .-890 ; 0x34fb2 3532c: 40 ce rjmp .-896 ; 0x34fae void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 3532e: 80 91 60 13 lds r24, 0x1360 ; 0x801360 35332: 83 35 cpi r24, 0x53 ; 83 35334: 21 f4 brne .+8 ; 0x3533e 35336: 80 91 61 13 lds r24, 0x1361 ; 0x801361 3533a: 18 17 cp r17, r24 3533c: 11 f0 breq .+4 ; 0x35342 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 3533e: 81 2f mov r24, r17 35340: fe cd rjmp .-1028 ; 0x34f3e 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; 35342: 80 91 66 13 lds r24, 0x1366 ; 0x801366 35346: e1 2f mov r30, r17 35348: f0 e0 ldi r31, 0x00 ; 0 3534a: df 01 movw r26, r30 3534c: a6 56 subi r26, 0x66 ; 102 3534e: bc 4e sbci r27, 0xEC ; 236 35350: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 35352: e1 52 subi r30, 0x21 ; 33 35354: f8 45 sbci r31, 0x58 ; 88 35356: e4 91 lpm r30, Z 35358: 8e 17 cp r24, r30 3535a: 41 f0 breq .+16 ; 0x3536c if (--retries == 0) { 3535c: 80 91 4f 13 lds r24, 0x134F ; 0x80134f 35360: 81 50 subi r24, 0x01 ; 1 35362: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f 35366: 81 11 cpse r24, r1 35368: ea cf rjmp .-44 ; 0x3533e 3536a: 99 cf rjmp .-206 ; 0x3529e SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 3536c: 85 e6 ldi r24, 0x65 ; 101 3536e: 9a ea ldi r25, 0xAA ; 170 35370: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 /// @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; } 35374: 8a e0 ldi r24, 0x0A ; 10 35376: 80 93 5f 13 sts 0x135F, r24 ; 0x80135f } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 3537a: 81 e0 ldi r24, 0x01 ; 1 3537c: 81 0f add r24, r17 3537e: df cd rjmp .-1090 ; 0x34f3e 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) { 35380: 80 91 60 13 lds r24, 0x1360 ; 0x801360 35384: 83 35 cpi r24, 0x53 ; 83 35386: 21 f4 brne .+8 ; 0x35390 35388: 80 91 61 13 lds r24, 0x1361 ; 0x801361 3538c: 83 30 cpi r24, 0x03 ; 3 3538e: 11 f0 breq .+4 ; 0x35394 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 35390: 83 e0 ldi r24, 0x03 ; 3 35392: d5 cd rjmp .-1110 ; 0x34f3e } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 35394: 80 91 66 13 lds r24, 0x1366 ; 0x801366 35398: 90 91 67 13 lds r25, 0x1367 ; 0x801367 3539c: 90 93 9e 13 sts 0x139E, r25 ; 0x80139e 353a0: 80 93 9d 13 sts 0x139D, r24 ; 0x80139d } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 353a4: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 353a8: e3 e6 ldi r30, 0x63 ; 99 353aa: fa ea ldi r31, 0xAA ; 170 353ac: 84 91 lpm r24, Z 353ae: 60 91 97 13 lds r22, 0x1397 ; 0x801397 353b2: 70 e0 ldi r23, 0x00 ; 0 353b4: 49 e0 ldi r20, 0x09 ; 9 353b6: 0f 94 42 68 call 0x2d084 ; 0x2d084 353ba: fb cd rjmp .-1034 ; 0x34fb2 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 353bc: 82 e0 ldi r24, 0x02 ; 2 353be: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::Idle; 353c2: 83 e0 ldi r24, 0x03 ; 3 353c4: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 353c8: 82 e8 ldi r24, 0x82 ; 130 353ca: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 353ce: d2 cd rjmp .-1116 ; 0x34f74 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 353d0: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 353d4: 88 30 cpi r24, 0x08 ; 8 353d6: 09 f4 brne .+2 ; 0x353da 353d8: b7 c0 rjmp .+366 ; 0x35548 353da: a8 f4 brcc .+42 ; 0x35406 353dc: 84 30 cpi r24, 0x04 ; 4 353de: d9 f0 breq .+54 ; 0x35416 353e0: 87 30 cpi r24, 0x07 ; 7 353e2: 09 f4 brne .+2 ; 0x353e6 353e4: ae c0 rjmp .+348 ; 0x35542 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 353e6: 81 e0 ldi r24, 0x01 ; 1 353e8: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::DelayedRestart; 353ec: 82 e0 ldi r24, 0x02 ; 2 353ee: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 353f2: 83 e8 ldi r24, 0x83 ; 131 353f4: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 353f8: 65 e0 ldi r22, 0x05 ; 5 353fa: 80 ed ldi r24, 0xD0 ; 208 353fc: 97 ea ldi r25, 0xA7 ; 167 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 353fe: 0f 94 5f 67 call 0x2cebe ; 0x2cebe 35402: 18 2f mov r17, r24 35404: 50 c0 rjmp .+160 ; 0x354a6 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 35406: 8a 30 cpi r24, 0x0A ; 10 35408: 09 f4 brne .+2 ; 0x3540c 3540a: a7 c0 rjmp .+334 ; 0x3555a 3540c: 60 f3 brcs .-40 ; 0x353e6 3540e: 8d 30 cpi r24, 0x0D ; 13 35410: 08 f4 brcc .+2 ; 0x35414 35412: 5f cd rjmp .-1346 ; 0x34ed2 35414: e8 cf rjmp .-48 ; 0x353e6 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) { 35416: 80 91 60 13 lds r24, 0x1360 ; 0x801360 3541a: 8e 34 cpi r24, 0x4E ; 78 3541c: 60 f5 brcc .+88 ; 0x35476 3541e: 8b 34 cpi r24, 0x4B ; 75 35420: 10 f4 brcc .+4 ; 0x35426 35422: 85 34 cpi r24, 0x45 ; 69 35424: 01 f7 brne .-64 ; 0x353e6 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 35426: 80 91 65 13 lds r24, 0x1365 ; 0x801365 3542a: 86 34 cpi r24, 0x46 ; 70 3542c: 09 f4 brne .+2 ; 0x35430 3542e: 73 c0 rjmp .+230 ; 0x35516 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 35430: 84 e0 ldi r24, 0x04 ; 4 35432: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 35436: 85 e0 ldi r24, 0x05 ; 5 35438: e0 e6 ldi r30, 0x60 ; 96 3543a: f3 e1 ldi r31, 0x13 ; 19 3543c: de 01 movw r26, r28 3543e: 11 96 adiw r26, 0x01 ; 1 35440: 01 90 ld r0, Z+ 35442: 0d 92 st X+, r0 35444: 8a 95 dec r24 35446: e1 f7 brne .-8 ; 0x35440 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 35448: 85 e0 ldi r24, 0x05 ; 5 3544a: fe 01 movw r30, r28 3544c: 31 96 adiw r30, 0x01 ; 1 3544e: a0 e5 ldi r26, 0x50 ; 80 35450: b3 e1 ldi r27, 0x13 ; 19 35452: 01 90 ld r0, Z+ 35454: 0d 92 st X+, r0 35456: 8a 95 dec r24 35458: e1 f7 brne .-8 ; 0x35452 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 3545a: 0f 94 17 a6 call 0x34c2e ; 0x34c2e 3545e: 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) { 35460: 85 30 cpi r24, 0x05 ; 5 35462: 09 f2 breq .-126 ; 0x353e6 35464: 08 f0 brcs .+2 ; 0x35468 35466: 9c c0 rjmp .+312 ; 0x355a0 35468: 82 30 cpi r24, 0x02 ; 2 3546a: 09 f4 brne .+2 ; 0x3546e 3546c: 32 cd rjmp .-1436 ; 0x34ed2 3546e: 84 30 cpi r24, 0x04 ; 4 35470: 09 f4 brne .+2 ; 0x35474 35472: 3b cf rjmp .-394 ; 0x352ea 35474: 18 c0 rjmp .+48 ; 0x354a6 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) { 35476: 84 35 cpi r24, 0x54 ; 84 35478: 08 f4 brcc .+2 ; 0x3547c 3547a: b5 cf rjmp .-150 ; 0x353e6 3547c: 86 35 cpi r24, 0x56 ; 86 3547e: 98 f2 brcs .-90 ; 0x35426 35480: 88 35 cpi r24, 0x58 ; 88 35482: 09 f0 breq .+2 ; 0x35486 35484: b0 cf rjmp .-160 ; 0x353e6 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) { 35486: 80 91 65 13 lds r24, 0x1365 ; 0x801365 3548a: 86 34 cpi r24, 0x46 ; 70 3548c: 89 f1 breq .+98 ; 0x354f0 3548e: 80 35 cpi r24, 0x50 ; 80 35490: c1 f1 breq .+112 ; 0x35502 35492: 82 34 cpi r24, 0x42 ; 66 35494: 09 f0 breq .+2 ; 0x35498 35496: 42 c0 rjmp .+132 ; 0x3551c 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); 35498: 80 91 66 13 lds r24, 0x1366 ; 0x801366 3549c: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e StartReading8bitRegisters(); 354a0: 0f 94 c5 a4 call 0x3498a ; 0x3498a return ButtonPushed; 354a4: 1b e0 ldi r17, 0x0B ; 11 354a6: 80 91 4b 13 lds r24, 0x134B ; 0x80134b 354aa: 90 91 4c 13 lds r25, 0x134C ; 0x80134c break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 354ae: 81 30 cpi r24, 0x01 ; 1 354b0: 91 05 cpc r25, r1 354b2: 09 f0 breq .+2 ; 0x354b6 354b4: ee c1 rjmp .+988 ; 0x35892 const StepStatus ss = logic.Step(); switch (ss) { 354b6: 12 30 cpi r17, 0x02 ; 2 354b8: 09 f4 brne .+2 ; 0x354bc 354ba: 90 c0 rjmp .+288 ; 0x355dc 354bc: 08 f0 brcs .+2 ; 0x354c0 354be: 7d c0 rjmp .+250 ; 0x355ba 354c0: 11 23 and r17, r17 354c2: 09 f4 brne .+2 ; 0x354c6 354c4: 18 c1 rjmp .+560 ; 0x356f6 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 354c6: 00 23 and r16, r16 354c8: 09 f4 brne .+2 ; 0x354cc 354ca: e4 c0 rjmp .+456 ; 0x35694 switch (ss) { 354cc: 17 30 cpi r17, 0x07 ; 7 354ce: 09 f4 brne .+2 ; 0x354d2 354d0: c4 c1 rjmp .+904 ; 0x3585a 354d2: 08 f0 brcs .+2 ; 0x354d6 354d4: b8 c1 rjmp .+880 ; 0x35846 354d6: 14 30 cpi r17, 0x04 ; 4 354d8: 09 f4 brne .+2 ; 0x354dc 354da: c7 c1 rjmp .+910 ; 0x3586a 354dc: 15 30 cpi r17, 0x05 ; 5 354de: 09 f0 breq .+2 ; 0x354e2 354e0: d9 c0 rjmp .+434 ; 0x35694 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 354e2: 82 e0 ldi r24, 0x02 ; 2 354e4: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 354e8: 60 e0 ldi r22, 0x00 ; 0 354ea: 8d e2 ldi r24, 0x2D ; 45 354ec: 90 e8 ldi r25, 0x80 ; 128 354ee: ba c1 rjmp .+884 ; 0x35864 // 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) { 354f0: 80 91 50 13 lds r24, 0x1350 ; 0x801350 354f4: 88 23 and r24, r24 354f6: 29 f0 breq .+10 ; 0x35502 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 354f8: 82 e8 ldi r24, 0x82 ; 130 354fa: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 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; 354fe: 13 e0 ldi r17, 0x03 ; 3 35500: d2 cf rjmp .-92 ; 0x354a6 } [[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); 35502: 80 91 66 13 lds r24, 0x1366 ; 0x801366 35506: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = ErrorCode::OK; 3550a: 81 e0 ldi r24, 0x01 ; 1 3550c: 90 e0 ldi r25, 0x00 ; 0 3550e: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 35512: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 35516: 0f 94 c5 a4 call 0x3498a ; 0x3498a 3551a: 4b cd rjmp .-1386 ; 0x34fb2 // 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; 3551c: 8c e0 ldi r24, 0x0C ; 12 3551e: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = static_cast(rsp.paramValue); 35522: 80 91 66 13 lds r24, 0x1366 ; 0x801366 35526: 90 91 67 13 lds r25, 0x1367 ; 0x801367 3552a: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 3552e: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b StartReading8bitRegisters(); // continue Idle state without restarting the communication 35532: 0f 94 c5 a4 call 0x3498a ; 0x3498a // @@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")); 35536: 83 ef ldi r24, 0xF3 ; 243 35538: 97 ea ldi r25, 0xA7 ; 167 3553a: 0f 94 ee 66 call 0x2cddc ; 0x2cddc 3553e: 17 e0 ldi r17, 0x07 ; 7 35540: b2 cf rjmp .-156 ; 0x354a6 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 35542: 0f 94 e9 a4 call 0x349d2 ; 0x349d2 35546: 35 cd rjmp .-1430 ; 0x34fb2 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 35548: 82 e8 ldi r24, 0x82 ; 130 3554a: 0f 94 cd a4 call 0x3499a ; 0x3499a 3554e: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e return scopeState == ScopeState::Ready ? Finished : Processing; 35552: 82 38 cpi r24, 0x82 ; 130 35554: 09 f0 breq .+2 ; 0x35558 35556: 2d cd rjmp .-1446 ; 0x34fb2 35558: bc cc rjmp .-1672 ; 0x34ed2 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 3555a: 80 91 65 13 lds r24, 0x1365 ; 0x801365 3555e: 81 34 cpi r24, 0x41 ; 65 35560: d1 f6 brne .-76 ; 0x35516 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 35562: 0f 94 dc 66 call 0x2cdb8 ; 0x2cdb8 35566: d7 cf rjmp .-82 ; 0x35516 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 35568: 88 30 cpi r24, 0x08 ; 8 3556a: b1 f0 breq .+44 ; 0x35598 3556c: 50 f3 brcs .-44 ; 0x35542 3556e: 8a 30 cpi r24, 0x0A ; 10 35570: 09 f0 breq .+2 ; 0x35574 35572: 39 cf rjmp .-398 ; 0x353e6 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 35574: 80 91 65 13 lds r24, 0x1365 ; 0x801365 35578: 81 34 cpi r24, 0x41 ; 65 3557a: 09 f0 breq .+2 ; 0x3557e 3557c: 18 cd rjmp .-1488 ; 0x34fae // Button was accepted, decrement the retry. DecrementRetryAttempts(); 3557e: 0f 94 dc 66 call 0x2cdb8 ; 0x2cdb8 35582: 15 cd rjmp .-1494 ; 0x34fae 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; 35584: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::RUNNING; 35588: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 3558c: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b scopeState = ScopeState::Wait; 35590: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 35592: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 35596: 0d cd rjmp .-1510 ; 0x34fb2 35598: 81 e8 ldi r24, 0x81 ; 129 3559a: 0f 94 cd a4 call 0x3499a ; 0x3499a 3559e: f9 cf rjmp .-14 ; 0x35592 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 355a0: 87 30 cpi r24, 0x07 ; 7 355a2: 49 f2 breq .-110 ; 0x35536 355a4: 08 f4 brcc .+2 ; 0x355a8 355a6: 63 ce rjmp .-826 ; 0x3526e 355a8: 88 30 cpi r24, 0x08 ; 8 355aa: 09 f4 brne .+2 ; 0x355ae 355ac: 78 ce rjmp .-784 ; 0x3529e 355ae: 7b cf rjmp .-266 ; 0x354a6 // 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()) { 355b0: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 355b4: 87 fd sbrc r24, 7 355b6: 9a cc rjmp .-1740 ; 0x34eec 355b8: fc cc rjmp .-1544 ; 0x34fb2 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 355ba: 13 30 cpi r17, 0x03 ; 3 355bc: 09 f4 brne .+2 ; 0x355c0 355be: 6a c0 rjmp .+212 ; 0x35694 355c0: 1b 30 cpi r17, 0x0B ; 11 355c2: 09 f0 breq .+2 ; 0x355c6 355c4: 80 cf rjmp .-256 ; 0x354c6 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 355c6: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 355ca: 80 93 b5 13 sts 0x13B5, r24 ; 0x8013b5 LogEchoEvent_P(PSTR("MMU Button pushed")); 355ce: 82 e1 ldi r24, 0x12 ; 18 355d0: 98 ea ldi r25, 0xA8 ; 168 355d2: 0f 94 0d c6 call 0x38c1a ; 0x38c1a CheckUserInput(); // Process the button immediately 355d6: 0f 94 81 a6 call 0x34d02 ; 0x34d02 355da: 5c c0 rjmp .+184 ; 0x35694 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 355dc: 80 91 90 13 lds r24, 0x1390 ; 0x801390 355e0: 81 11 cpse r24, r1 355e2: 58 c0 rjmp .+176 ; 0x35694 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() 355e4: 0e 94 10 67 call 0xce20 ; 0xce20 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 355e8: 88 23 and r24, r24 355ea: 09 f4 brne .+2 ; 0x355ee 355ec: 53 c0 rjmp .+166 ; 0x35694 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 355ee: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.532> 355f2: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.532+0x1> 355f6: 88 35 cpi r24, 0x58 ; 88 355f8: 92 40 sbci r25, 0x02 ; 2 355fa: 09 f4 brne .+2 ; 0x355fe 355fc: 4b c0 rjmp .+150 ; 0x35694 && !saved_printing 355fe: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 35602: 81 11 cpse r24, r1 35604: 47 c0 rjmp .+142 ; 0x35694 && !mesh_bed_leveling_flag 35606: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 3560a: 81 11 cpse r24, r1 3560c: 43 c0 rjmp .+134 ; 0x35694 && !homing_flag 3560e: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 35612: 81 11 cpse r24, r1 35614: 3f c0 rjmp .+126 ; 0x35694 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 35616: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 3561a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 3561e: 98 17 cp r25, r24 35620: c9 f1 breq .+114 ; 0x35694 { uint8_t block_index = block_buffer_tail; 35622: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 } #endif bool e_active() { unsigned char e_active = 0; 35626: 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++; 35628: 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) 3562a: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 3562e: 38 17 cp r19, r24 35630: 89 f0 breq .+34 ; 0x35654 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 35632: 28 9f mul r18, r24 35634: f0 01 movw r30, r0 35636: 11 24 eor r1, r1 35638: eb 53 subi r30, 0x3B ; 59 3563a: f9 4f sbci r31, 0xF9 ; 249 3563c: 44 85 ldd r20, Z+12 ; 0x0c 3563e: 55 85 ldd r21, Z+13 ; 0x0d 35640: 66 85 ldd r22, Z+14 ; 0x0e 35642: 77 85 ldd r23, Z+15 ; 0x0f 35644: 45 2b or r20, r21 35646: 46 2b or r20, r22 35648: 47 2b or r20, r23 3564a: 09 f0 breq .+2 ; 0x3564e 3564c: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 3564e: 8f 5f subi r24, 0xFF ; 255 35650: 8f 70 andi r24, 0x0F ; 15 35652: eb cf rjmp .-42 ; 0x3562a && e_active(); 35654: 99 23 and r25, r25 35656: f1 f0 breq .+60 ; 0x35694 SERIAL_ECHOLNPGM("FINDA filament runout!"); 35658: 83 ea ldi r24, 0xA3 ; 163 3565a: 97 ea ldi r25, 0xA7 ; 167 3565c: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 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); 35660: 20 e0 ldi r18, 0x00 ; 0 35662: 30 e0 ldi r19, 0x00 ; 0 35664: a9 01 movw r20, r18 35666: ca 01 movw r24, r20 35668: b9 01 movw r22, r18 3566a: 0e 94 bf 88 call 0x1117e ; 0x1117e marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 3566e: 60 e0 ldi r22, 0x00 ; 0 35670: 70 e0 ldi r23, 0x00 ; 0 35672: cb 01 movw r24, r22 35674: 0e 94 c4 67 call 0xcf88 ; 0xcf88 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 35678: 86 ed ldi r24, 0xD6 ; 214 3567a: 9e e0 ldi r25, 0x0E ; 14 3567c: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 35680: 81 30 cpi r24, 0x01 ; 1 35682: 21 f4 brne .+8 ; 0x3568c if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 35684: 0f 94 f4 75 call 0x2ebe8 ; 0x2ebe8 35688: 8f 3f cpi r24, 0xFF ; 255 3568a: 91 f5 brne .+100 ; 0x356f0 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 3568c: 87 e4 ldi r24, 0x47 ; 71 3568e: 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 35690: 0f 94 38 76 call 0x2ec70 ; 0x2ec70 break; } } } if (logic.Running()) { 35694: 80 91 68 13 lds r24, 0x1368 ; 0x801368 35698: 82 30 cpi r24, 0x02 ; 2 3569a: 19 f4 brne .+6 ; 0x356a2 state = xState::Active; 3569c: 81 e0 ldi r24, 0x01 ; 1 3569e: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba 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 356a2: 10 93 b9 13 sts 0x13B9, r17 ; 0x8013b9 // 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) { 356a6: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.492> 356aa: 88 23 and r24, r24 356ac: 51 f0 breq .+20 ; 0x356c2 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 356ae: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.498> 356b2: 81 11 cpse r24, r1 356b4: 06 c0 rjmp .+12 ; 0x356c2 356b6: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 356ba: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 356be: 0f 94 75 c7 call 0x38eea ; 0x38eea CheckErrorScreenUserInput(); } 356c2: a0 96 adiw r28, 0x20 ; 32 356c4: 0f b6 in r0, 0x3f ; 63 356c6: f8 94 cli 356c8: de bf out 0x3e, r29 ; 62 356ca: 0f be out 0x3f, r0 ; 63 356cc: cd bf out 0x3d, r28 ; 61 356ce: df 91 pop r29 356d0: cf 91 pop r28 356d2: 1f 91 pop r17 356d4: 0f 91 pop r16 356d6: ff 90 pop r15 356d8: ef 90 pop r14 356da: df 90 pop r13 356dc: cf 90 pop r12 356de: bf 90 pop r11 356e0: af 90 pop r10 356e2: 9f 90 pop r9 356e4: 8f 90 pop r8 356e6: 7f 90 pop r7 356e8: 6f 90 pop r6 356ea: 5f 90 pop r5 356ec: 4f 90 pop r4 356ee: 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 356f0: 89 e9 ldi r24, 0x99 ; 153 356f2: 97 ea ldi r25, 0xA7 ; 167 356f4: cd cf rjmp .-102 ; 0x35690 356f6: 00 91 8d 13 lds r16, 0x138D ; 0x80138d ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 356fa: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 356fe: 08 17 cp r16, r24 35700: 09 f4 brne .+2 ; 0x35704 35702: 49 c0 rjmp .+146 ; 0x35796 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 35704: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 35708: 84 30 cpi r24, 0x04 ; 4 3570a: b9 f4 brne .+46 ; 0x3573a break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 3570c: 80 91 50 13 lds r24, 0x1350 ; 0x801350 35710: 88 23 and r24, r24 35712: 99 f0 breq .+38 ; 0x3573a custom_message_type = CustomMsg::MMUProgress; 35714: 89 e0 ldi r24, 0x09 ; 9 35716: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 : static_cast(pgm_read_ptr(&progressTexts[0])); 3571a: ef e5 ldi r30, 0x5F ; 95 3571c: f7 ea ldi r31, 0xA7 ; 167 }; const char *ProgressCodeToText(ProgressCode pc) { // @@TODO ?? a better fallback option? return ((uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0]))) ? static_cast(pgm_read_ptr(&progressTexts[(uint16_t)pc])) 3571e: 0e 31 cpi r16, 0x1E ; 30 35720: 30 f4 brcc .+12 ; 0x3572e 35722: e0 2f mov r30, r16 35724: f0 e0 ldi r31, 0x00 ; 0 35726: ee 0f add r30, r30 35728: ff 1f adc r31, r31 3572a: e1 5a subi r30, 0xA1 ; 161 3572c: f8 45 sbci r31, 0x58 ; 88 : static_cast(pgm_read_ptr(&progressTexts[0])); 3572e: 85 91 lpm r24, Z+ 35730: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 35732: 0e 94 2c 72 call 0xe458 ; 0xe458 35736: 0e 94 3b f2 call 0x1e476 ; 0x1e476 3573a: ef e5 ldi r30, 0x5F ; 95 3573c: f7 ea ldi r31, 0xA7 ; 167 }; const char *ProgressCodeToText(ProgressCode pc) { // @@TODO ?? a better fallback option? return ((uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0]))) ? static_cast(pgm_read_ptr(&progressTexts[(uint16_t)pc])) 3573e: 0e 31 cpi r16, 0x1E ; 30 35740: 30 f4 brcc .+12 ; 0x3574e 35742: e0 2f mov r30, r16 35744: f0 e0 ldi r31, 0x00 ; 0 35746: ee 0f add r30, r30 35748: ff 1f adc r31, r31 3574a: e1 5a subi r30, 0xA1 ; 161 3574c: f8 45 sbci r31, 0x58 ; 88 : static_cast(pgm_read_ptr(&progressTexts[0])); 3574e: 85 91 lpm r24, Z+ 35750: 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))); 35752: 02 96 adiw r24, 0x02 ; 2 35754: 0f 94 0d c6 call 0x38c1a ; 0x38c1a } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 35758: 00 93 b1 13 sts 0x13B1, r16 ; 0x8013b1 switch (pc) { 3575c: 03 30 cpi r16, 0x03 ; 3 3575e: 49 f0 breq .+18 ; 0x35772 35760: 0c 31 cpi r16, 0x1C ; 28 35762: 09 f0 breq .+2 ; 0x35766 35764: 97 cf rjmp .-210 ; 0x35694 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 35766: 0f 94 ed 43 call 0x287da ; 0x287da } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 3576a: 81 e0 ldi r24, 0x01 ; 1 3576c: 80 93 bc 13 sts 0x13BC, r24 ; 0x8013bc 35770: 91 cf rjmp .-222 ; 0x35694 35772: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 35776: 84 30 cpi r24, 0x04 ; 4 35778: 31 f4 brne .+12 ; 0x35786 ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 3577a: 80 91 50 13 lds r24, 0x1350 ; 0x801350 3577e: 84 55 subi r24, 0x54 ; 84 35780: 82 30 cpi r24, 0x02 ; 2 35782: 08 f4 brcc .+2 ; 0x35786 35784: 87 cf rjmp .-242 ; 0x35694 35786: 0f 94 ed 43 call 0x287da ; 0x287da // 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; 3578a: 81 e0 ldi r24, 0x01 ; 1 3578c: 80 93 bd 13 sts 0x13BD, r24 ; 0x8013bd 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(); 35790: 0f 94 47 6b call 0x2d68e ; 0x2d68e 35794: 7f cf rjmp .-258 ; 0x35694 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) { 35796: 03 30 cpi r16, 0x03 ; 3 35798: 71 f1 breq .+92 ; 0x357f6 3579a: 0c 31 cpi r16, 0x1C ; 28 3579c: 09 f0 breq .+2 ; 0x357a0 3579e: 7a cf rjmp .-268 ; 0x35694 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 357a0: 80 91 bc 13 lds r24, 0x13BC ; 0x8013bc 357a4: 88 23 and r24, r24 357a6: 09 f4 brne .+2 ; 0x357aa 357a8: 75 cf rjmp .-278 ; 0x35694 switch (WhereIsFilament()) { 357aa: 0f 94 1d c6 call 0x38c3a ; 0x38c3a 357ae: 88 23 and r24, r24 357b0: b1 f1 breq .+108 ; 0x3581e 357b2: 81 30 cpi r24, 0x01 ; 1 357b4: 09 f0 breq .+2 ; 0x357b8 357b6: 6e cf rjmp .-292 ; 0x35694 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 357b8: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 357bc: 0f 94 fb c1 call 0x383f6 ; 0x383f6 // 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; 357c0: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 357c4: 60 91 98 13 lds r22, 0x1398 ; 0x801398 357c8: 70 e0 ldi r23, 0x00 ; 0 357ca: 90 e0 ldi r25, 0x00 ; 0 357cc: 80 e0 ldi r24, 0x00 ; 0 357ce: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 357d2: 6b 01 movw r12, r22 357d4: 7c 01 movw r14, r24 357d6: 60 91 97 13 lds r22, 0x1397 ; 0x801397 357da: 70 e0 ldi r23, 0x00 ; 0 357dc: 6e 5f subi r22, 0xFE ; 254 357de: 7f 4f sbci r23, 0xFF ; 255 357e0: 07 2e mov r0, r23 357e2: 00 0c add r0, r0 357e4: 88 0b sbc r24, r24 357e6: 99 0b sbc r25, r25 357e8: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 357ec: a7 01 movw r20, r14 357ee: 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()); 357f0: 0f 94 e9 c5 call 0x38bd2 ; 0x38bd2 357f4: 4f cf rjmp .-354 ; 0x35694 } 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 357f6: 80 91 bd 13 lds r24, 0x13BD ; 0x8013bd 357fa: 88 23 and r24, r24 357fc: 09 f4 brne .+2 ; 0x35800 357fe: 4a cf rjmp .-364 ; 0x35694 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); 35800: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 35804: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 35808: 98 13 cpse r25, r24 3580a: 44 cf rjmp .-376 ; 0x35694 switch (WhereIsFilament()) { 3580c: 0f 94 1d c6 call 0x38c3a ; 0x38c3a 35810: 81 50 subi r24, 0x01 ; 1 35812: 83 30 cpi r24, 0x03 ; 3 35814: 08 f4 brcc .+2 ; 0x35818 35816: bc cf rjmp .-136 ; 0x35790 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; 35818: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd 3581c: 3b cf rjmp .-394 ; 0x35694 3581e: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 35822: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 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 35826: 98 13 cpse r25, r24 35828: 35 cf rjmp .-406 ; 0x35694 // 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()); 3582a: 60 91 98 13 lds r22, 0x1398 ; 0x801398 3582e: 70 e0 ldi r23, 0x00 ; 0 35830: 90 e0 ldi r25, 0x00 ; 0 35832: 80 e0 ldi r24, 0x00 ; 0 35834: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 35838: 9b 01 movw r18, r22 3583a: ac 01 movw r20, r24 3583c: 60 e0 ldi r22, 0x00 ; 0 3583e: 70 e0 ldi r23, 0x00 ; 0 35840: 8f ea ldi r24, 0xAF ; 175 35842: 93 e4 ldi r25, 0x43 ; 67 35844: d5 cf rjmp .-86 ; 0x357f0 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 35846: 18 30 cpi r17, 0x08 ; 8 35848: b9 f0 breq .+46 ; 0x35878 3584a: 19 30 cpi r17, 0x09 ; 9 3584c: 09 f0 breq .+2 ; 0x35850 3584e: 22 cf rjmp .-444 ; 0x35694 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 35850: 60 e0 ldi r22, 0x00 ; 0 35852: 0f 94 29 84 call 0x30852 ; 0x30852 35856: 19 e0 ldi r17, 0x09 ; 9 35858: 1d cf rjmp .-454 ; 0x35694 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 3585a: 61 e0 ldi r22, 0x01 ; 1 3585c: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 35860: 90 91 8c 13 lds r25, 0x138C ; 0x80138c ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 35864: 0f 94 29 84 call 0x30852 ; 0x30852 35868: 15 cf rjmp .-470 ; 0x35694 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 3586a: 82 e0 ldi r24, 0x02 ; 2 3586c: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 35870: 60 e0 ldi r22, 0x00 ; 0 35872: 8e e2 ldi r24, 0x2E ; 46 35874: 90 e8 ldi r25, 0x80 ; 128 35876: f6 cf rjmp .-20 ; 0x35864 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 35878: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 3587c: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 35880: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 35884: 60 e0 ldi r22, 0x00 ; 0 35886: 8c e2 ldi r24, 0x2C ; 44 35888: 90 e8 ldi r25, 0x80 ; 128 3588a: ec cf rjmp .-40 ; 0x35864 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 3588c: 0f 94 d1 66 call 0x2cda2 ; 0x2cda2 35890: aa cd rjmp .-1196 ; 0x353e6 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 35892: 00 23 and r16, r16 35894: 01 f3 breq .-64 ; 0x35856 35896: dc cf rjmp .-72 ; 0x35850 00035898 : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 35898: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 3589c: 82 ff sbrs r24, 2 3589e: 07 c0 rjmp .+14 ; 0x358ae // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 358a0: 8b 7f andi r24, 0xFB ; 251 358a2: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb LogEchoEvent_P(PSTR("Cooldown flag cleared")); 358a6: 8d ee ldi r24, 0xED ; 237 358a8: 98 ea ldi r25, 0xA8 ; 168 358aa: 0f 94 0d c6 call 0x38c1a ; 0x38c1a } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 358ae: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 358b2: 81 ff sbrs r24, 1 358b4: 52 c0 rjmp .+164 ; 0x3595a 358b6: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 358ba: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 358be: 89 2b or r24, r25 358c0: 09 f4 brne .+2 ; 0x358c4 358c2: 4b c0 rjmp .+150 ; 0x3595a LogEchoEvent_P(PSTR("Resuming Temp")); 358c4: 8f ed ldi r24, 0xDF ; 223 358c6: 98 ea ldi r25, 0xA8 ; 168 358c8: 0f 94 0d c6 call 0x38c1a ; 0x38c1a // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 358cc: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 358d0: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 358d4: 0f 94 30 76 call 0x2ec60 ; 0x2ec60 mmu_print_saved &= ~(SavedState::Cooldown); 358d8: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 358dc: 8d 7f andi r24, 0xFD ; 253 358de: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 358e2: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 358e6: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 358ea: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 358ee: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 358f2: 88 e8 ldi r24, 0x88 ; 136 358f4: 9b e5 ldi r25, 0x5B ; 91 358f6: 0e 94 2c 72 call 0xe458 ; 0xe458 358fa: 0f 94 e9 20 call 0x241d2 ; 0x241d2 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)); 358fe: 4f ea ldi r20, 0xAF ; 175 35900: 58 ea ldi r21, 0xA8 ; 168 35902: 62 e0 ldi r22, 0x02 ; 2 35904: 80 e0 ldi r24, 0x00 ; 0 35906: 0e 94 74 6e call 0xdce8 ; 0xdce8 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 3590a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 3590e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 35912: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 35916: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 3591a: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 3591e: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 35922: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 35926: c9 01 movw r24, r18 35928: 86 1b sub r24, r22 3592a: 97 0b sbc r25, r23 3592c: 06 97 sbiw r24, 0x06 ; 6 3592e: 6c f0 brlt .+26 ; 0x3594a void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 35930: 81 e0 ldi r24, 0x01 ; 1 35932: 0e 94 37 8a call 0x1146e ; 0x1146e 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); 35936: 80 e0 ldi r24, 0x00 ; 0 35938: 0f 94 3a a7 call 0x34e74 ; 0x34e74 ReportErrorHookDynamicRender(); 3593c: 0f 94 2e c5 call 0x38a5c ; 0x38a5c void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 35940: 84 e6 ldi r24, 0x64 ; 100 35942: 90 e0 ldi r25, 0x00 ; 0 35944: 0e 94 6c 8c call 0x118d8 ; 0x118d8 35948: e0 cf rjmp .-64 ; 0x3590a }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 3594a: 0f 94 04 c5 call 0x38a08 ; 0x38a08 LogEchoEvent_P(PSTR("Hotend temperature reached")); 3594e: 84 ec ldi r24, 0xC4 ; 196 35950: 98 ea ldi r25, 0xA8 ; 168 35952: 0f 94 0d c6 call 0x38c1a ; 0x38c1a void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 35956: 0c 94 93 6e jmp 0xdd26 ; 0xdd26 ScreenClear(); } } 3595a: 08 95 ret 0003595c : /// 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) { 3595c: 0f 93 push r16 3595e: 1f 93 push r17 35960: cf 93 push r28 35962: df 93 push r29 35964: 00 d0 rcall .+0 ; 0x35966 35966: 1f 92 push r1 35968: 1f 92 push r1 3596a: cd b7 in r28, 0x3d ; 61 3596c: de b7 in r29, 0x3e ; 62 3596e: 18 2f mov r17, r24 35970: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 35972: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb MARLIN_KEEPALIVE_STATE_IN_PROCESS; 35976: 83 e0 ldi r24, 0x03 ; 3 35978: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be LongTimer nozzleTimeout; 3597c: 19 82 std Y+1, r1 ; 0x01 3597e: 1a 82 std Y+2, r1 ; 0x02 35980: 1b 82 std Y+3, r1 ; 0x03 35982: 1c 82 std Y+4, r1 ; 0x04 35984: 1d 82 std Y+5, r1 ; 0x05 35986: 90 e0 ldi r25, 0x00 ; 0 35988: 80 e0 ldi r24, 0x00 ; 0 3598a: 0e 94 6c 8c call 0x118d8 ; 0x118d8 // - 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) { 3598e: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 35992: 89 81 ldd r24, Y+1 ; 0x01 35994: 92 ff sbrs r25, 2 35996: 37 c0 rjmp .+110 ; 0x35a06 if (!nozzleTimeout.running()) { 35998: 81 11 cpse r24, r1 3599a: 1e c0 rjmp .+60 ; 0x359d8 nozzleTimeout.start(); 3599c: ce 01 movw r24, r28 3599e: 01 96 adiw r24, 0x01 ; 1 359a0: 0f 94 f4 2c call 0x259e8 ; 0x259e8 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 359a4: 89 ed ldi r24, 0xD9 ; 217 359a6: 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")); 359a8: 0f 94 0d c6 call 0x38c1a ; 0x38c1a } switch (logicStepLastStatus) { 359ac: e0 91 b9 13 lds r30, 0x13B9 ; 0x8013b9 359b0: e2 50 subi r30, 0x02 ; 2 359b2: ea 30 cpi r30, 0x0A ; 10 359b4: 40 f7 brcc .-48 ; 0x35986 359b6: f0 e0 ldi r31, 0x00 ; 0 359b8: 88 27 eor r24, r24 359ba: ee 51 subi r30, 0x1E ; 30 359bc: f3 45 sbci r31, 0x53 ; 83 359be: 8e 4f sbci r24, 0xFE ; 254 359c0: 0d 94 64 dd jmp 0x3bac8 ; 0x3bac8 <__tablejump2__> 359c4: 8c 39 cpi r24, 0x9C ; 156 359c6: f6 38 cpi r31, 0x86 ; 134 359c8: a6 39 cpi r26, 0x96 ; 150 359ca: a6 39 cpi r26, 0x96 ; 150 359cc: 34 3a cpi r19, 0xA4 ; 164 359ce: a6 39 cpi r26, 0x96 ; 150 359d0: ea 39 cpi r30, 0x9A ; 154 359d2: 6a 3a cpi r22, 0xAA ; 170 359d4: 32 3a cpi r19, 0xA2 ; 162 359d6: a6 39 cpi r26, 0x96 ; 150 if (mmu_print_saved & SavedState::CooldownPending) { if (!nozzleTimeout.running()) { nozzleTimeout.start(); LogEchoEvent_P(PSTR("Cooling Timeout started")); } else if (nozzleTimeout.expired(DEFAULT_SAFETYTIMER_TIME_MINS * 60 * 1000ul)) { // mins->msec. 359d8: 40 e4 ldi r20, 0x40 ; 64 359da: 57 e7 ldi r21, 0x77 ; 119 359dc: 6b e1 ldi r22, 0x1B ; 27 359de: 70 e0 ldi r23, 0x00 ; 0 359e0: ce 01 movw r24, r28 359e2: 01 96 adiw r24, 0x01 ; 1 359e4: 0f 94 35 2b call 0x2566a ; 0x2566a ::expired(unsigned long)> 359e8: 88 23 and r24, r24 359ea: 01 f3 breq .-64 ; 0x359ac mmu_print_saved &= ~(SavedState::CooldownPending); 359ec: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 359f0: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 359f2: 82 60 ori r24, 0x02 ; 2 359f4: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb 359f8: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 359fc: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 35a00: 89 ec ldi r24, 0xC9 ; 201 35a02: 96 ea ldi r25, 0xA6 ; 166 35a04: d1 cf rjmp .-94 ; 0x359a8 } } else if (nozzleTimeout.running()) { 35a06: 88 23 and r24, r24 35a08: 89 f2 breq .-94 ; 0x359ac 35a0a: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 35a0c: 83 eb ldi r24, 0xB3 ; 179 35a0e: 96 ea ldi r25, 0xA6 ; 166 35a10: cb cf rjmp .-106 ; 0x359a8 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(); 35a12: 0f 94 4c ac call 0x35898 ; 0x35898 ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 35a16: 0f 94 6d 6b call 0x2d6da ; 0x2d6da if (!TuneMenuEntered()) { 35a1a: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.498> 35a1e: 81 11 cpse r24, r1 35a20: 07 c0 rjmp .+14 ; 0x35a30 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 35a22: 80 ea ldi r24, 0xA0 ; 160 35a24: 96 ea ldi r25, 0xA6 ; 166 35a26: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 retryAttempts = MAX_RETRIES; 35a2a: 83 e0 ldi r24, 0x03 ; 3 35a2c: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 35a30: 0f 94 ed 43 call 0x287da ; 0x287da 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; 35a34: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 35a36: 0f 90 pop r0 35a38: 0f 90 pop r0 35a3a: 0f 90 pop r0 35a3c: 0f 90 pop r0 35a3e: 0f 90 pop r0 35a40: df 91 pop r29 35a42: cf 91 pop r28 35a44: 1f 91 pop r17 35a46: 0f 91 pop r16 35a48: 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(); 35a4a: 0f 94 81 a6 call 0x34d02 ; 0x34d02 35a4e: f2 cf rjmp .-28 ; 0x35a34 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 35a50: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 35a54: 81 11 cpse r24, r1 35a56: 97 cf rjmp .-210 ; 0x35986 // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 35a58: 81 2f mov r24, r17 35a5a: 0f 94 b9 6b call 0x2d772 ; 0x2d772 SaveHotendTemp(turn_off_nozzle); 35a5e: 80 2f mov r24, r16 35a60: 0f 94 51 6b call 0x2d6a2 ; 0x2d6a2 CheckUserInput(); 35a64: 0f 94 81 a6 call 0x34d02 ; 0x34d02 35a68: 8e cf rjmp .-228 ; 0x35986 } 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(); 35a6a: 0f 94 4c ac call 0x35898 ; 0x35898 ResumeUnpark(); 35a6e: 0f 94 6d 6b call 0x2d6da ; 0x2d6da 35a72: 89 cf rjmp .-238 ; 0x35986 } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 35a74: 80 e0 ldi r24, 0x00 ; 0 35a76: df cf rjmp .-66 ; 0x35a36 00035a78 : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 35a78: cf 93 push r28 35a7a: df 93 push r29 35a7c: 00 d0 rcall .+0 ; 0x35a7e 35a7e: 1f 92 push r1 35a80: 1f 92 push r1 35a82: cd b7 in r28, 0x3d ; 61 35a84: de b7 in r29, 0x3e ; 62 FSensorBlockRunout blockRunout; 35a86: 0f 94 e9 87 call 0x30fd2 ; 0x30fd2 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 35a8a: 62 e1 ldi r22, 0x12 ; 18 35a8c: 80 e1 ldi r24, 0x10 ; 16 35a8e: 96 ea ldi r25, 0xA6 ; 166 35a90: 0f 94 93 88 call 0x31126 ; 0x31126 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(); 35a94: 0f 94 e7 c5 call 0x38bce ; 0x38bce void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 35a98: 40 e0 ldi r20, 0x00 ; 0 35a9a: 65 e5 ldi r22, 0x55 ; 85 35a9c: ce 01 movw r24, r28 35a9e: 01 96 adiw r24, 0x01 ; 1 35aa0: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 35aa4: 49 81 ldd r20, Y+1 ; 0x01 35aa6: 5a 81 ldd r21, Y+2 ; 0x02 35aa8: 6b 81 ldd r22, Y+3 ; 0x03 35aaa: 7c 81 ldd r23, Y+4 ; 0x04 35aac: 8d 81 ldd r24, Y+5 ; 0x05 35aae: 0f 94 8a a5 call 0x34b14 ; 0x34b14 logic.UnloadFilament(); if (manage_response(false, true)) { 35ab2: 61 e0 ldi r22, 0x01 ; 1 35ab4: 80 e0 ldi r24, 0x00 ; 0 35ab6: 0f 94 ae ac call 0x3595c ; 0x3595c 35aba: 81 11 cpse r24, r1 35abc: 03 c0 rjmp .+6 ; 0x35ac4 break; } IncrementMMUFails(); 35abe: 0f 94 26 c5 call 0x38a4c ; 0x38a4c 35ac2: e8 cf rjmp .-48 ; 0x35a94 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); 35ac4: 83 e0 ldi r24, 0x03 ; 3 35ac6: 0f 94 0c 4f call 0x29e18 ; 0x29e18 } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 35aca: 83 e6 ldi r24, 0x63 ; 99 35acc: 0f 94 3b 88 call 0x31076 ; 0x31076 tool_change_extruder = MMU2_NO_TOOL; 35ad0: 83 e6 ldi r24, 0x63 ; 99 35ad2: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 35ad6: 0f 94 2d 7c call 0x2f85a ; 0x2f85a } 35ada: 0f 90 pop r0 35adc: 0f 90 pop r0 35ade: 0f 90 pop r0 35ae0: 0f 90 pop r0 35ae2: 0f 90 pop r0 35ae4: df 91 pop r29 35ae6: cf 91 pop r28 35ae8: 08 95 ret 00035aea : bool MMU2::unload() { 35aea: cf 93 push r28 if (!WaitForMMUReady()) { 35aec: 0f 94 bc 88 call 0x31178 ; 0x31178 35af0: c8 2f mov r28, r24 35af2: 88 23 and r24, r24 35af4: 79 f0 breq .+30 ; 0x35b14 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 35af6: 88 ec ldi r24, 0xC8 ; 200 35af8: 90 e0 ldi r25, 0x00 ; 0 35afa: 0f 94 6b c9 call 0x392d6 ; 0x392d6 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> 35afe: 82 e0 ldi r24, 0x02 ; 2 35b00: 0f 94 0c 4f call 0x29e18 ; 0x29e18 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35b04: 0f 94 30 88 call 0x31060 ; 0x31060 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 35b08: 0f 94 3c ad call 0x35a78 ; 0x35a78 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35b0c: 0f 94 b1 88 call 0x31162 ; 0x31162 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 35b10: 0f 94 04 c5 call 0x38a08 ; 0x38a08 return true; } 35b14: 8c 2f mov r24, r28 35b16: cf 91 pop r28 35b18: 08 95 ret 00035b1a : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 35b1a: 0f 93 push r16 35b1c: 1f 93 push r17 35b1e: cf 93 push r28 35b20: df 93 push r29 35b22: 00 d0 rcall .+0 ; 0x35b24 35b24: 1f 92 push r1 35b26: 1f 92 push r1 35b28: cd b7 in r28, 0x3d ; 61 35b2a: de b7 in r29, 0x3e ; 62 35b2c: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 35b2e: 0f 94 bc 88 call 0x31178 ; 0x31178 35b32: 18 2f mov r17, r24 35b34: 88 23 and r24, r24 35b36: 49 f1 breq .+82 ; 0x35b8a void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 35b38: 85 e7 ldi r24, 0x75 ; 117 35b3a: 9b e5 ldi r25, 0x5B ; 91 35b3c: 0e 94 2c 72 call 0xe458 ; 0xe458 35b40: 60 2f mov r22, r16 35b42: 0f 94 07 c5 call 0x38a0e ; 0x38a0e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35b46: 0f 94 30 88 call 0x31060 ; 0x31060 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 35b4a: 0f 94 e7 c5 call 0x38bce ; 0x38bce } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 35b4e: 40 2f mov r20, r16 35b50: 6c e4 ldi r22, 0x4C ; 76 35b52: ce 01 movw r24, r28 35b54: 01 96 adiw r24, 0x01 ; 1 35b56: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 35b5a: 49 81 ldd r20, Y+1 ; 0x01 35b5c: 5a 81 ldd r21, Y+2 ; 0x02 35b5e: 6b 81 ldd r22, Y+3 ; 0x03 35b60: 7c 81 ldd r23, Y+4 ; 0x04 35b62: 8d 81 ldd r24, Y+5 ; 0x05 35b64: 0f 94 8a a5 call 0x34b14 ; 0x34b14 logic.LoadFilament(slot); if (manage_response(false, false)) { 35b68: 60 e0 ldi r22, 0x00 ; 0 35b6a: 80 e0 ldi r24, 0x00 ; 0 35b6c: 0f 94 ae ac call 0x3595c ; 0x3595c 35b70: 18 2f mov r17, r24 35b72: 81 11 cpse r24, r1 35b74: 03 c0 rjmp .+6 ; 0x35b7c break; } IncrementMMUFails(); 35b76: 0f 94 26 c5 call 0x38a4c ; 0x38a4c 35b7a: e7 cf rjmp .-50 ; 0x35b4a 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); 35b7c: 83 e0 ldi r24, 0x03 ; 3 35b7e: 0f 94 0c 4f call 0x29e18 ; 0x29e18 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35b82: 0f 94 b1 88 call 0x31162 ; 0x31162 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 35b86: 0f 94 04 c5 call 0x38a08 ; 0x38a08 return true; } 35b8a: 81 2f mov r24, r17 35b8c: 0f 90 pop r0 35b8e: 0f 90 pop r0 35b90: 0f 90 pop r0 35b92: 0f 90 pop r0 35b94: 0f 90 pop r0 35b96: df 91 pop r29 35b98: cf 91 pop r28 35b9a: 1f 91 pop r17 35b9c: 0f 91 pop r16 35b9e: 08 95 ret 00035ba0 : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 35ba0: ff 92 push r15 35ba2: 0f 93 push r16 35ba4: 1f 93 push r17 35ba6: cf 93 push r28 35ba8: df 93 push r29 35baa: 00 d0 rcall .+0 ; 0x35bac 35bac: 1f 92 push r1 35bae: 1f 92 push r1 35bb0: cd b7 in r28, 0x3d ; 61 35bb2: de b7 in r29, 0x3e ; 62 35bb4: 08 2f mov r16, r24 35bb6: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 35bb8: 0f 94 bc 88 call 0x31178 ; 0x31178 35bbc: 18 2f mov r17, r24 35bbe: 88 23 and r24, r24 35bc0: b1 f1 breq .+108 ; 0x35c2e return false; } if (enableFullScreenMsg) { 35bc2: ff 20 and r15, r15 35bc4: 39 f0 breq .+14 ; 0x35bd4 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 35bc6: 84 e6 ldi r24, 0x64 ; 100 35bc8: 9b e5 ldi r25, 0x5B ; 91 35bca: 0e 94 2c 72 call 0xe458 ; 0xe458 35bce: 60 2f mov r22, r16 35bd0: 0f 94 07 c5 call 0x38a0e ; 0x38a0e FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 35bd4: 80 91 90 13 lds r24, 0x1390 ; 0x801390 35bd8: 81 11 cpse r24, r1 unload(); 35bda: 0f 94 75 ad call 0x35aea ; 0x35aea struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35bde: 0f 94 30 88 call 0x31060 ; 0x31060 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 35be2: 0f 94 e7 c5 call 0x38bce ; 0x38bce } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 35be6: 40 2f mov r20, r16 35be8: 65 e4 ldi r22, 0x45 ; 69 35bea: ce 01 movw r24, r28 35bec: 01 96 adiw r24, 0x01 ; 1 35bee: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 35bf2: 49 81 ldd r20, Y+1 ; 0x01 35bf4: 5a 81 ldd r21, Y+2 ; 0x02 35bf6: 6b 81 ldd r22, Y+3 ; 0x03 35bf8: 7c 81 ldd r23, Y+4 ; 0x04 35bfa: 8d 81 ldd r24, Y+5 ; 0x05 35bfc: 0f 94 8a a5 call 0x34b14 ; 0x34b14 logic.EjectFilament(slot); if (manage_response(false, true)) { 35c00: 61 e0 ldi r22, 0x01 ; 1 35c02: 80 e0 ldi r24, 0x00 ; 0 35c04: 0f 94 ae ac call 0x3595c ; 0x3595c 35c08: 18 2f mov r17, r24 35c0a: 81 11 cpse r24, r1 35c0c: 03 c0 rjmp .+6 ; 0x35c14 break; } IncrementMMUFails(); 35c0e: 0f 94 26 c5 call 0x38a4c ; 0x38a4c 35c12: e7 cf rjmp .-50 ; 0x35be2 } SetCurrentTool(MMU2_NO_TOOL); 35c14: 83 e6 ldi r24, 0x63 ; 99 35c16: 0f 94 3b 88 call 0x31076 ; 0x31076 tool_change_extruder = MMU2_NO_TOOL; 35c1a: 83 e6 ldi r24, 0x63 ; 99 35c1c: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 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); 35c20: 83 e0 ldi r24, 0x03 ; 3 35c22: 0f 94 0c 4f call 0x29e18 ; 0x29e18 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35c26: 0f 94 b1 88 call 0x31162 ; 0x31162 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 35c2a: 0f 94 04 c5 call 0x38a08 ; 0x38a08 return true; } 35c2e: 81 2f mov r24, r17 35c30: 0f 90 pop r0 35c32: 0f 90 pop r0 35c34: 0f 90 pop r0 35c36: 0f 90 pop r0 35c38: 0f 90 pop r0 35c3a: df 91 pop r29 35c3c: cf 91 pop r28 35c3e: 1f 91 pop r17 35c40: 0f 91 pop r16 35c42: ff 90 pop r15 35c44: 08 95 ret 00035c46 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 35c46: 1f 93 push r17 35c48: cf 93 push r28 35c4a: df 93 push r29 35c4c: 00 d0 rcall .+0 ; 0x35c4e 35c4e: 1f 92 push r1 35c50: 1f 92 push r1 35c52: cd b7 in r28, 0x3d ; 61 35c54: de b7 in r29, 0x3e ; 62 35c56: 18 2f mov r17, r24 for (;;) { Disable_E0(); 35c58: 0f 94 e7 c5 call 0x38bce ; 0x38bce } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 35c5c: 41 2f mov r20, r17 35c5e: 6b e4 ldi r22, 0x4B ; 75 35c60: ce 01 movw r24, r28 35c62: 01 96 adiw r24, 0x01 ; 1 35c64: 0f 94 c5 c5 call 0x38b8a ; 0x38b8a 35c68: 49 81 ldd r20, Y+1 ; 0x01 35c6a: 5a 81 ldd r21, Y+2 ; 0x02 35c6c: 6b 81 ldd r22, Y+3 ; 0x03 35c6e: 7c 81 ldd r23, Y+4 ; 0x04 35c70: 8d 81 ldd r24, Y+5 ; 0x05 35c72: 0f 94 8a a5 call 0x34b14 ; 0x34b14 logic.CutFilament(slot); if (manage_response(false, true)) { 35c76: 61 e0 ldi r22, 0x01 ; 1 35c78: 80 e0 ldi r24, 0x00 ; 0 35c7a: 0f 94 ae ac call 0x3595c ; 0x3595c 35c7e: 81 11 cpse r24, r1 35c80: 03 c0 rjmp .+6 ; 0x35c88 break; } IncrementMMUFails(); 35c82: 0f 94 26 c5 call 0x38a4c ; 0x38a4c 35c86: e8 cf rjmp .-48 ; 0x35c58 } } 35c88: 0f 90 pop r0 35c8a: 0f 90 pop r0 35c8c: 0f 90 pop r0 35c8e: 0f 90 pop r0 35c90: 0f 90 pop r0 35c92: df 91 pop r29 35c94: cf 91 pop r28 35c96: 1f 91 pop r17 35c98: 08 95 ret 00035c9a : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 35c9a: cf 93 push r28 35c9c: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 35c9e: 85 e5 ldi r24, 0x55 ; 85 35ca0: 9b e5 ldi r25, 0x5B ; 91 35ca2: 0e 94 2c 72 call 0xe458 ; 0xe458 35ca6: 6c 2f mov r22, r28 35ca8: 0f 94 07 c5 call 0x38a0e ; 0x38a0e if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 35cac: 80 91 90 13 lds r24, 0x1390 ; 0x801390 35cb0: 81 11 cpse r24, r1 unload(); 35cb2: 0f 94 75 ad call 0x35aea ; 0x35aea struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35cb6: 0f 94 30 88 call 0x31060 ; 0x31060 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 35cba: 8c 2f mov r24, r28 35cbc: 0f 94 23 ae call 0x35c46 ; 0x35c46 SetCurrentTool(MMU2_NO_TOOL); 35cc0: 83 e6 ldi r24, 0x63 ; 99 35cc2: 0f 94 3b 88 call 0x31076 ; 0x31076 tool_change_extruder = MMU2_NO_TOOL; 35cc6: 83 e6 ldi r24, 0x63 ; 99 35cc8: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 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); 35ccc: 83 e0 ldi r24, 0x03 ; 3 35cce: 0f 94 0c 4f call 0x29e18 ; 0x29e18 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35cd2: 0f 94 b1 88 call 0x31162 ; 0x31162 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 35cd6: 0f 94 04 c5 call 0x38a08 ; 0x38a08 return true; } 35cda: 81 e0 ldi r24, 0x01 ; 1 35cdc: cf 91 pop r28 35cde: 08 95 ret 00035ce0 : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 35ce0: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35ce4: 95 ff sbrs r25, 5 35ce6: fc cf rjmp .-8 ; 0x35ce0 UDR0 = ch; 35ce8: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 35cec: 08 95 ret 00035cee : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 35cee: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35cf2: 87 ff sbrs r24, 7 35cf4: fc cf rjmp .-8 ; 0x35cee if (!(UCSR0A & _BV(FE0))) { 35cf6: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35cfa: 84 fd sbrc r24, 4 35cfc: 01 c0 rjmp .+2 ; 0x35d00 * 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(); 35cfe: a8 95 wdr } ch = UDR0; 35d00: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 35d04: 08 95 ret 00035d06 : /// 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; 35d06: 86 27 eor r24, r22 35d08: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 35d0a: 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) { 35d0c: 38 2f mov r19, r24 35d0e: 88 0f add r24, r24 35d10: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 35d12: 82 27 eor r24, r18 35d14: 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++) { 35d16: d1 f7 brne .-12 ; 0x35d0c } else { data <<= 1U; } } return data; } 35d18: 08 95 ret 00035d1a : // 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) { 35d1a: 2f 92 push r2 35d1c: 3f 92 push r3 35d1e: 4f 92 push r4 35d20: 5f 92 push r5 35d22: 6f 92 push r6 35d24: 7f 92 push r7 35d26: 8f 92 push r8 35d28: 9f 92 push r9 35d2a: af 92 push r10 35d2c: bf 92 push r11 35d2e: cf 92 push r12 35d30: df 92 push r13 35d32: ef 92 push r14 35d34: ff 92 push r15 35d36: 0f 93 push r16 35d38: 1f 93 push r17 35d3a: cf 93 push r28 35d3c: df 93 push r29 35d3e: cd b7 in r28, 0x3d ; 61 35d40: de b7 in r29, 0x3e ; 62 35d42: a1 97 sbiw r28, 0x21 ; 33 35d44: 0f b6 in r0, 0x3f ; 63 35d46: f8 94 cli 35d48: de bf out 0x3e, r29 ; 62 35d4a: 0f be out 0x3f, r0 ; 63 35d4c: cd bf out 0x3d, r28 ; 61 35d4e: 1c 01 movw r2, r24 35d50: 48 01 movw r8, r16 35d52: 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) 35d54: fc 01 movw r30, r24 35d56: e8 5b subi r30, 0xB8 ; 184 35d58: ff 4f sbci r31, 0xFF ; 255 35d5a: c0 80 ld r12, Z 35d5c: d1 80 ldd r13, Z+1 ; 0x01 35d5e: e2 80 ldd r14, Z+2 ; 0x02 35d60: f3 80 ldd r15, Z+3 ; 0x03 35d62: 9a 01 movw r18, r20 35d64: ab 01 movw r20, r22 35d66: c7 01 movw r24, r14 35d68: b6 01 movw r22, r12 35d6a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 35d6e: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 35d72: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 35d76: 8b 01 movw r16, r22 35d78: 8d 83 std Y+5, r24 ; 0x05 35d7a: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 35d7c: a5 01 movw r20, r10 35d7e: 94 01 movw r18, r8 35d80: c7 01 movw r24, r14 35d82: b6 01 movw r22, r12 35d84: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 35d88: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 35d8c: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 35d90: 36 2f mov r19, r22 35d92: 27 2f mov r18, r23 35d94: a8 01 movw r20, r16 35d96: 6d 81 ldd r22, Y+5 ; 0x05 35d98: 79 81 ldd r23, Y+1 ; 0x01 35d9a: 48 37 cpi r20, 0x78 ; 120 35d9c: 51 05 cpc r21, r1 35d9e: 61 05 cpc r22, r1 35da0: 71 05 cpc r23, r1 35da2: 20 f4 brcc .+8 ; 0x35dac 35da4: 48 e7 ldi r20, 0x78 ; 120 35da6: 50 e0 ldi r21, 0x00 ; 0 35da8: 60 e0 ldi r22, 0x00 ; 0 35daa: 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) 35dac: d1 01 movw r26, r2 35dae: d6 96 adiw r26, 0x36 ; 54 35db0: 8d 90 ld r8, X+ 35db2: 9d 90 ld r9, X+ 35db4: ad 90 ld r10, X+ 35db6: bc 90 ld r11, X 35db8: d9 97 sbiw r26, 0x39 ; 57 35dba: 8f 8a std Y+23, r8 ; 0x17 35dbc: 98 8e std Y+24, r9 ; 0x18 35dbe: a9 8e std Y+25, r10 ; 0x19 35dc0: ba 8e std Y+26, r11 ; 0x1a 35dc2: 48 15 cp r20, r8 35dc4: 59 05 cpc r21, r9 35dc6: 6a 05 cpc r22, r10 35dc8: 7b 05 cpc r23, r11 35dca: 20 f4 brcc .+8 ; 0x35dd4 35dcc: 4f 8b std Y+23, r20 ; 0x17 35dce: 58 8f std Y+24, r21 ; 0x18 35dd0: 69 8f std Y+25, r22 ; 0x19 35dd2: 7a 8f std Y+26, r23 ; 0x1a 35dd4: 43 2f mov r20, r19 35dd6: 52 2f mov r21, r18 35dd8: bc 01 movw r22, r24 35dda: 48 37 cpi r20, 0x78 ; 120 35ddc: 51 05 cpc r21, r1 35dde: 61 05 cpc r22, r1 35de0: 71 05 cpc r23, r1 35de2: 20 f4 brcc .+8 ; 0x35dec 35de4: 48 e7 ldi r20, 0x78 ; 120 35de6: 50 e0 ldi r21, 0x00 ; 0 35de8: 60 e0 ldi r22, 0x00 ; 0 35dea: 70 e0 ldi r23, 0x00 ; 0 35dec: 18 2d mov r17, r8 35dee: 09 2d mov r16, r9 35df0: a9 a2 std Y+33, r10 ; 0x21 35df2: b8 a2 std Y+32, r11 ; 0x20 35df4: 48 15 cp r20, r8 35df6: 59 05 cpc r21, r9 35df8: 6a 05 cpc r22, r10 35dfa: 7b 05 cpc r23, r11 35dfc: 20 f4 brcc .+8 ; 0x35e06 35dfe: 14 2f mov r17, r20 35e00: 05 2f mov r16, r21 35e02: 69 a3 std Y+33, r22 ; 0x21 35e04: 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; 35e06: f1 01 movw r30, r2 35e08: ee 5b subi r30, 0xBE ; 190 35e0a: ff 4f sbci r31, 0xFF ; 255 35e0c: c0 80 ld r12, Z 35e0e: d1 80 ldd r13, Z+1 ; 0x01 35e10: e2 80 ldd r14, Z+2 ; 0x02 35e12: f3 80 ldd r15, Z+3 ; 0x03 35e14: cd 82 std Y+5, r12 ; 0x05 35e16: de 82 std Y+6, r13 ; 0x06 35e18: ef 82 std Y+7, r14 ; 0x07 35e1a: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 35e1c: cd 28 or r12, r13 35e1e: ce 28 or r12, r14 35e20: cf 28 or r12, r15 35e22: 41 f4 brne .+16 ; 0x35e34 // Don't allow zero acceleration. acceleration = 1; 35e24: c1 2c mov r12, r1 35e26: d1 2c mov r13, r1 35e28: 76 01 movw r14, r12 35e2a: c3 94 inc r12 35e2c: cd 82 std Y+5, r12 ; 0x05 35e2e: de 82 std Y+6, r13 ; 0x06 35e30: ef 82 std Y+7, r14 ; 0x07 35e32: 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; 35e34: 2f 89 ldd r18, Y+23 ; 0x17 35e36: 38 8d ldd r19, Y+24 ; 0x18 35e38: 49 8d ldd r20, Y+25 ; 0x19 35e3a: 5a 8d ldd r21, Y+26 ; 0x1a 35e3c: b9 01 movw r22, r18 35e3e: ca 01 movw r24, r20 35e40: 0f 94 b7 dc call 0x3b96e ; 0x3b96e <__mulsi3> 35e44: 6d 87 std Y+13, r22 ; 0x0d 35e46: 7e 87 std Y+14, r23 ; 0x0e 35e48: 8f 87 std Y+15, r24 ; 0x0f 35e4a: 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; 35e4c: a5 01 movw r20, r10 35e4e: 94 01 movw r18, r8 35e50: c5 01 movw r24, r10 35e52: b4 01 movw r22, r8 35e54: 0f 94 b7 dc call 0x3b96e ; 0x3b96e <__mulsi3> 35e58: 2b 01 movw r4, r22 35e5a: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 35e5c: 21 2f mov r18, r17 35e5e: 30 2f mov r19, r16 35e60: 49 a1 ldd r20, Y+33 ; 0x21 35e62: 58 a1 ldd r21, Y+32 ; 0x20 35e64: 61 2f mov r22, r17 35e66: 70 2f mov r23, r16 35e68: ca 01 movw r24, r20 35e6a: 0f 94 b7 dc call 0x3b96e ; 0x3b96e <__mulsi3> 35e6e: 69 8b std Y+17, r22 ; 0x11 35e70: 7a 8b std Y+18, r23 ; 0x12 35e72: 8b 8b std Y+19, r24 ; 0x13 35e74: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 35e76: cd 80 ldd r12, Y+5 ; 0x05 35e78: de 80 ldd r13, Y+6 ; 0x06 35e7a: ef 80 ldd r14, Y+7 ; 0x07 35e7c: f8 84 ldd r15, Y+8 ; 0x08 35e7e: cc 0c add r12, r12 35e80: dd 1c adc r13, r13 35e82: ee 1c adc r14, r14 35e84: ff 1c adc r15, r15 35e86: c9 86 std Y+9, r12 ; 0x09 35e88: da 86 std Y+10, r13 ; 0x0a 35e8a: eb 86 std Y+11, r14 ; 0x0b 35e8c: 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; 35e8e: c3 01 movw r24, r6 35e90: b2 01 movw r22, r4 35e92: 61 50 subi r22, 0x01 ; 1 35e94: 71 09 sbc r23, r1 35e96: 81 09 sbc r24, r1 35e98: 91 09 sbc r25, r1 35e9a: cd 84 ldd r12, Y+13 ; 0x0d 35e9c: de 84 ldd r13, Y+14 ; 0x0e 35e9e: ef 84 ldd r14, Y+15 ; 0x0f 35ea0: f8 88 ldd r15, Y+16 ; 0x10 35ea2: 6c 19 sub r22, r12 35ea4: 7d 09 sbc r23, r13 35ea6: 8e 09 sbc r24, r14 35ea8: 9f 09 sbc r25, r15 35eaa: c9 84 ldd r12, Y+9 ; 0x09 35eac: da 84 ldd r13, Y+10 ; 0x0a 35eae: eb 84 ldd r14, Y+11 ; 0x0b 35eb0: fc 84 ldd r15, Y+12 ; 0x0c 35eb2: 6c 0d add r22, r12 35eb4: 7d 1d adc r23, r13 35eb6: 8e 1d adc r24, r14 35eb8: 9f 1d adc r25, r15 35eba: a7 01 movw r20, r14 35ebc: 96 01 movw r18, r12 35ebe: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 35ec2: 69 01 movw r12, r18 35ec4: 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; 35ec6: c3 01 movw r24, r6 35ec8: b2 01 movw r22, r4 35eca: 29 89 ldd r18, Y+17 ; 0x11 35ecc: 3a 89 ldd r19, Y+18 ; 0x12 35ece: 4b 89 ldd r20, Y+19 ; 0x13 35ed0: 5c 89 ldd r21, Y+20 ; 0x14 35ed2: 62 1b sub r22, r18 35ed4: 73 0b sbc r23, r19 35ed6: 84 0b sbc r24, r20 35ed8: 95 0b sbc r25, r21 35eda: 29 85 ldd r18, Y+9 ; 0x09 35edc: 3a 85 ldd r19, Y+10 ; 0x0a 35ede: 4b 85 ldd r20, Y+11 ; 0x0b 35ee0: 5c 85 ldd r21, Y+12 ; 0x0c 35ee2: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 35ee6: 29 01 movw r4, r18 35ee8: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 35eea: d7 01 movw r26, r14 35eec: c6 01 movw r24, r12 35eee: 84 0d add r24, r4 35ef0: 95 1d adc r25, r5 35ef2: a6 1d adc r26, r6 35ef4: b7 1d adc r27, r7 35ef6: 8c 8f std Y+28, r24 ; 0x1c 35ef8: 9d 8f std Y+29, r25 ; 0x1d 35efa: ae 8f std Y+30, r26 ; 0x1e 35efc: 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) { 35efe: f1 01 movw r30, r2 35f00: e4 5b subi r30, 0xB4 ; 180 35f02: ff 4f sbci r31, 0xFF ; 255 35f04: 90 81 ld r25, Z 35f06: 9b 8f std Y+27, r25 ; 0x1b 35f08: 99 23 and r25, r25 35f0a: 09 f4 brne .+2 ; 0x35f0e 35f0c: 8d c0 rjmp .+282 ; 0x36028 final_adv_steps = final_rate * block->adv_comp; 35f0e: 61 2f mov r22, r17 35f10: 70 2f mov r23, r16 35f12: 89 a1 ldd r24, Y+33 ; 0x21 35f14: 98 a1 ldd r25, Y+32 ; 0x20 35f16: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 35f1a: f1 01 movw r30, r2 35f1c: ec 5a subi r30, 0xAC ; 172 35f1e: ff 4f sbci r31, 0xFF ; 255 35f20: 20 81 ld r18, Z 35f22: 31 81 ldd r19, Z+1 ; 0x01 35f24: 42 81 ldd r20, Z+2 ; 0x02 35f26: 53 81 ldd r21, Z+3 ; 0x03 35f28: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 35f2c: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 35f30: 6d 8b std Y+21, r22 ; 0x15 35f32: 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) { 35f34: d1 01 movw r26, r2 35f36: 50 96 adiw r26, 0x10 ; 16 35f38: 2d 91 ld r18, X+ 35f3a: 3d 91 ld r19, X+ 35f3c: 4d 91 ld r20, X+ 35f3e: 5c 91 ld r21, X 35f40: 53 97 sbiw r26, 0x13 ; 19 35f42: 29 83 std Y+1, r18 ; 0x01 35f44: 3a 83 std Y+2, r19 ; 0x02 35f46: 4b 83 std Y+3, r20 ; 0x03 35f48: 5c 83 std Y+4, r21 ; 0x04 35f4a: 8c 8d ldd r24, Y+28 ; 0x1c 35f4c: 9d 8d ldd r25, Y+29 ; 0x1d 35f4e: ae 8d ldd r26, Y+30 ; 0x1e 35f50: bf 8d ldd r27, Y+31 ; 0x1f 35f52: 82 17 cp r24, r18 35f54: 93 07 cpc r25, r19 35f56: a4 07 cpc r26, r20 35f58: b5 07 cpc r27, r21 35f5a: 08 f0 brcs .+2 ; 0x35f5e 35f5c: 68 c0 rjmp .+208 ; 0x3602e plateau_steps = block->step_event_count.wide - accel_decel_steps; 35f5e: 29 01 movw r4, r18 35f60: 3a 01 movw r6, r20 35f62: 48 1a sub r4, r24 35f64: 59 0a sbc r5, r25 35f66: 6a 0a sbc r6, r26 35f68: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 35f6a: 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; 35f6c: 40 e0 ldi r20, 0x00 ; 0 35f6e: 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) 35f70: 99 23 and r25, r25 35f72: 89 f0 breq .+34 ; 0x35f96 max_adv_steps = block->nominal_rate * block->adv_comp; 35f74: c5 01 movw r24, r10 35f76: b4 01 movw r22, r8 35f78: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 35f7c: f1 01 movw r30, r2 35f7e: ec 5a subi r30, 0xAC ; 172 35f80: ff 4f sbci r31, 0xFF ; 255 35f82: 20 81 ld r18, Z 35f84: 31 81 ldd r19, Z+1 ; 0x01 35f86: 42 81 ldd r20, Z+2 ; 0x02 35f88: 53 81 ldd r21, Z+3 ; 0x03 35f8a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 35f8e: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 35f92: 46 2f mov r20, r22 35f94: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 35f96: 3f b7 in r19, 0x3f ; 63 35f98: 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. 35f9a: f1 01 movw r30, r2 35f9c: e9 5b subi r30, 0xB9 ; 185 35f9e: ff 4f sbci r31, 0xFF ; 255 35fa0: 20 81 ld r18, Z 35fa2: 21 11 cpse r18, r1 35fa4: 27 c0 rjmp .+78 ; 0x35ff4 block->accelerate_until = accelerate_steps; 35fa6: d1 01 movw r26, r2 35fa8: 59 96 adiw r26, 0x19 ; 25 35faa: cd 92 st X+, r12 35fac: dd 92 st X+, r13 35fae: ed 92 st X+, r14 35fb0: fc 92 st X, r15 35fb2: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 35fb4: c4 0c add r12, r4 35fb6: d5 1c adc r13, r5 35fb8: e6 1c adc r14, r6 35fba: f7 1c adc r15, r7 35fbc: f1 01 movw r30, r2 35fbe: c5 8e std Z+29, r12 ; 0x1d 35fc0: d6 8e std Z+30, r13 ; 0x1e 35fc2: e7 8e std Z+31, r14 ; 0x1f 35fc4: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 35fc6: cf 88 ldd r12, Y+23 ; 0x17 35fc8: c2 ae std Z+58, r12 ; 0x3a 35fca: d8 8c ldd r13, Y+24 ; 0x18 35fcc: d3 ae std Z+59, r13 ; 0x3b 35fce: e9 8c ldd r14, Y+25 ; 0x19 35fd0: e4 ae std Z+60, r14 ; 0x3c 35fd2: fa 8c ldd r15, Y+26 ; 0x1a 35fd4: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 35fd6: fe 96 adiw r30, 0x3e ; 62 35fd8: 10 83 st Z, r17 35fda: 01 83 std Z+1, r16 ; 0x01 35fdc: c9 a0 ldd r12, Y+33 ; 0x21 35fde: c2 82 std Z+2, r12 ; 0x02 35fe0: d8 a0 ldd r13, Y+32 ; 0x20 35fe2: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 35fe4: 73 96 adiw r30, 0x13 ; 19 35fe6: ed 88 ldd r14, Y+21 ; 0x15 35fe8: e0 82 st Z, r14 35fea: fe 88 ldd r15, Y+22 ; 0x16 35fec: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 35fee: 32 97 sbiw r30, 0x02 ; 2 35ff0: 40 83 st Z, r20 35ff2: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 35ff4: 3f bf out 0x3f, r19 ; 63 } 35ff6: a1 96 adiw r28, 0x21 ; 33 35ff8: 0f b6 in r0, 0x3f ; 63 35ffa: f8 94 cli 35ffc: de bf out 0x3e, r29 ; 62 35ffe: 0f be out 0x3f, r0 ; 63 36000: cd bf out 0x3d, r28 ; 61 36002: df 91 pop r29 36004: cf 91 pop r28 36006: 1f 91 pop r17 36008: 0f 91 pop r16 3600a: ff 90 pop r15 3600c: ef 90 pop r14 3600e: df 90 pop r13 36010: cf 90 pop r12 36012: bf 90 pop r11 36014: af 90 pop r10 36016: 9f 90 pop r9 36018: 8f 90 pop r8 3601a: 7f 90 pop r7 3601c: 6f 90 pop r6 3601e: 5f 90 pop r5 36020: 4f 90 pop r4 36022: 3f 90 pop r3 36024: 2f 90 pop r2 36026: 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; 36028: 1d 8a std Y+21, r1 ; 0x15 3602a: 1e 8a std Y+22, r1 ; 0x16 3602c: 83 cf rjmp .-250 ; 0x35f34 #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; 3602e: 2d 81 ldd r18, Y+5 ; 0x05 36030: 3e 81 ldd r19, Y+6 ; 0x06 36032: 4f 81 ldd r20, Y+7 ; 0x07 36034: 58 85 ldd r21, Y+8 ; 0x08 36036: 82 e0 ldi r24, 0x02 ; 2 36038: 22 0f add r18, r18 3603a: 33 1f adc r19, r19 3603c: 44 1f adc r20, r20 3603e: 55 1f adc r21, r21 36040: 8a 95 dec r24 36042: d1 f7 brne .-12 ; 0x36038 36044: 89 81 ldd r24, Y+1 ; 0x01 36046: 9a 81 ldd r25, Y+2 ; 0x02 36048: ab 81 ldd r26, Y+3 ; 0x03 3604a: bc 81 ldd r27, Y+4 ; 0x04 3604c: 81 70 andi r24, 0x01 ; 1 3604e: 99 27 eor r25, r25 36050: aa 27 eor r26, r26 36052: bb 27 eor r27, r27 36054: 8d 83 std Y+5, r24 ; 0x05 36056: 9e 83 std Y+6, r25 ; 0x06 36058: af 83 std Y+7, r26 ; 0x07 3605a: b8 87 std Y+8, r27 ; 0x08 3605c: 89 80 ldd r8, Y+1 ; 0x01 3605e: 9a 80 ldd r9, Y+2 ; 0x02 36060: ab 80 ldd r10, Y+3 ; 0x03 36062: bc 80 ldd r11, Y+4 ; 0x04 36064: b6 94 lsr r11 36066: a7 94 ror r10 36068: 97 94 ror r9 3606a: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 3606c: cd 84 ldd r12, Y+13 ; 0x0d 3606e: de 84 ldd r13, Y+14 ; 0x0e 36070: ef 84 ldd r14, Y+15 ; 0x0f 36072: f8 88 ldd r15, Y+16 ; 0x10 36074: 89 89 ldd r24, Y+17 ; 0x11 36076: 9a 89 ldd r25, Y+18 ; 0x12 36078: ab 89 ldd r26, Y+19 ; 0x13 3607a: bc 89 ldd r27, Y+20 ; 0x14 3607c: 8c 15 cp r24, r12 3607e: 9d 05 cpc r25, r13 36080: ae 05 cpc r26, r14 36082: bf 05 cpc r27, r15 36084: 08 f4 brcc .+2 ; 0x36088 36086: 6f c0 rjmp .+222 ; 0x36166 // 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; 36088: 6c 01 movw r12, r24 3608a: 7d 01 movw r14, r26 3608c: 91 e0 ldi r25, 0x01 ; 1 3608e: c9 1a sub r12, r25 36090: d1 08 sbc r13, r1 36092: e1 08 sbc r14, r1 36094: f1 08 sbc r15, r1 36096: 8d 85 ldd r24, Y+13 ; 0x0d 36098: 9e 85 ldd r25, Y+14 ; 0x0e 3609a: af 85 ldd r26, Y+15 ; 0x0f 3609c: b8 89 ldd r27, Y+16 ; 0x10 3609e: c8 1a sub r12, r24 360a0: d9 0a sbc r13, r25 360a2: ea 0a sbc r14, r26 360a4: fb 0a sbc r15, r27 360a6: c7 01 movw r24, r14 360a8: b6 01 movw r22, r12 360aa: 62 0f add r22, r18 360ac: 73 1f adc r23, r19 360ae: 84 1f adc r24, r20 360b0: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 360b2: cd 80 ldd r12, Y+5 ; 0x05 360b4: de 80 ldd r13, Y+6 ; 0x06 360b6: ef 80 ldd r14, Y+7 ; 0x07 360b8: f8 84 ldd r15, Y+8 ; 0x08 360ba: cd 28 or r12, r13 360bc: ce 28 or r12, r14 360be: cf 28 or r12, r15 360c0: 41 f0 breq .+16 ; 0x360d2 accelerate_steps += acceleration_x2; 360c2: c9 84 ldd r12, Y+9 ; 0x09 360c4: da 84 ldd r13, Y+10 ; 0x0a 360c6: eb 84 ldd r14, Y+11 ; 0x0b 360c8: fc 84 ldd r15, Y+12 ; 0x0c 360ca: 6c 0d add r22, r12 360cc: 7d 1d adc r23, r13 360ce: 8e 1d adc r24, r14 360d0: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 360d2: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 360d6: 75 01 movw r14, r10 360d8: 64 01 movw r12, r8 360da: c2 0e add r12, r18 360dc: d3 1e adc r13, r19 360de: e4 1e adc r14, r20 360e0: f5 1e adc r15, r21 360e2: 29 81 ldd r18, Y+1 ; 0x01 360e4: 3a 81 ldd r19, Y+2 ; 0x02 360e6: 4b 81 ldd r20, Y+3 ; 0x03 360e8: 5c 81 ldd r21, Y+4 ; 0x04 360ea: 2c 15 cp r18, r12 360ec: 3d 05 cpc r19, r13 360ee: 4e 05 cpc r20, r14 360f0: 5f 05 cpc r21, r15 360f2: 10 f4 brcc .+4 ; 0x360f8 360f4: 69 01 movw r12, r18 360f6: 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) { 360f8: 2b 8d ldd r18, Y+27 ; 0x1b 360fa: 22 23 and r18, r18 360fc: 09 f4 brne .+2 ; 0x36100 360fe: 69 c0 rjmp .+210 ; 0x361d2 if(!accelerate_steps || !decelerate_steps) { 36100: c1 14 cp r12, r1 36102: d1 04 cpc r13, r1 36104: e1 04 cpc r14, r1 36106: f1 04 cpc r15, r1 36108: 09 f4 brne .+2 ; 0x3610c 3610a: 66 c0 rjmp .+204 ; 0x361d8 // 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; 3610c: 4d 89 ldd r20, Y+21 ; 0x15 3610e: 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) { 36110: 41 14 cp r4, r1 36112: 51 04 cpc r5, r1 36114: 61 04 cpc r6, r1 36116: 71 04 cpc r7, r1 36118: 09 f4 brne .+2 ; 0x3611c 3611a: 3d cf rjmp .-390 ; 0x35f96 // 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); 3611c: a7 01 movw r20, r14 3611e: 96 01 movw r18, r12 36120: 69 85 ldd r22, Y+9 ; 0x09 36122: 7a 85 ldd r23, Y+10 ; 0x0a 36124: 8b 85 ldd r24, Y+11 ; 0x0b 36126: 9c 85 ldd r25, Y+12 ; 0x0c 36128: 0f 94 b7 dc call 0x3b96e ; 0x3b96e <__mulsi3> 3612c: 2d 85 ldd r18, Y+13 ; 0x0d 3612e: 3e 85 ldd r19, Y+14 ; 0x0e 36130: 4f 85 ldd r20, Y+15 ; 0x0f 36132: 58 89 ldd r21, Y+16 ; 0x10 36134: 62 0f add r22, r18 36136: 73 1f adc r23, r19 36138: 84 1f adc r24, r20 3613a: 95 1f adc r25, r21 3613c: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 36140: 0f 94 4a e1 call 0x3c294 ; 0x3c294 max_adv_steps = max_rate * block->adv_comp; 36144: f1 01 movw r30, r2 36146: ec 5a subi r30, 0xAC ; 172 36148: ff 4f sbci r31, 0xFF ; 255 3614a: 20 81 ld r18, Z 3614c: 31 81 ldd r19, Z+1 ; 0x01 3614e: 42 81 ldd r20, Z+2 ; 0x02 36150: 53 81 ldd r21, Z+3 ; 0x03 36152: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36156: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 3615a: 46 2f mov r20, r22 3615c: 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; 3615e: 41 2c mov r4, r1 36160: 51 2c mov r5, r1 36162: 32 01 movw r6, r4 36164: 18 cf rjmp .-464 ; 0x35f96 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; 36166: 6d 85 ldd r22, Y+13 ; 0x0d 36168: 7e 85 ldd r23, Y+14 ; 0x0e 3616a: 8f 85 ldd r24, Y+15 ; 0x0f 3616c: 98 89 ldd r25, Y+16 ; 0x10 3616e: c9 88 ldd r12, Y+17 ; 0x11 36170: da 88 ldd r13, Y+18 ; 0x12 36172: eb 88 ldd r14, Y+19 ; 0x13 36174: fc 88 ldd r15, Y+20 ; 0x14 36176: 6c 19 sub r22, r12 36178: 7d 09 sbc r23, r13 3617a: 8e 09 sbc r24, r14 3617c: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 3617e: cd 80 ldd r12, Y+5 ; 0x05 36180: de 80 ldd r13, Y+6 ; 0x06 36182: ef 80 ldd r14, Y+7 ; 0x07 36184: f8 84 ldd r15, Y+8 ; 0x08 36186: cd 28 or r12, r13 36188: ce 28 or r12, r14 3618a: cf 28 or r12, r15 3618c: 41 f0 breq .+16 ; 0x3619e decelerate_steps += acceleration_x2; 3618e: c9 84 ldd r12, Y+9 ; 0x09 36190: da 84 ldd r13, Y+10 ; 0x0a 36192: eb 84 ldd r14, Y+11 ; 0x0b 36194: fc 84 ldd r15, Y+12 ; 0x0c 36196: 6c 0d add r22, r12 36198: 7d 1d adc r23, r13 3619a: 8e 1d adc r24, r14 3619c: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 3619e: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 361a2: 82 0e add r8, r18 361a4: 93 1e adc r9, r19 361a6: a4 1e adc r10, r20 361a8: b5 1e adc r11, r21 361aa: 49 80 ldd r4, Y+1 ; 0x01 361ac: 5a 80 ldd r5, Y+2 ; 0x02 361ae: 6b 80 ldd r6, Y+3 ; 0x03 361b0: 7c 80 ldd r7, Y+4 ; 0x04 361b2: 84 14 cp r8, r4 361b4: 95 04 cpc r9, r5 361b6: a6 04 cpc r10, r6 361b8: b7 04 cpc r11, r7 361ba: 10 f4 brcc .+4 ; 0x361c0 361bc: 24 01 movw r4, r8 361be: 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; 361c0: c9 80 ldd r12, Y+1 ; 0x01 361c2: da 80 ldd r13, Y+2 ; 0x02 361c4: eb 80 ldd r14, Y+3 ; 0x03 361c6: fc 80 ldd r15, Y+4 ; 0x04 361c8: c4 18 sub r12, r4 361ca: d5 08 sbc r13, r5 361cc: e6 08 sbc r14, r6 361ce: f7 08 sbc r15, r7 361d0: 93 cf rjmp .-218 ; 0x360f8 // 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; 361d2: 40 e0 ldi r20, 0x00 ; 0 361d4: 80 e0 ldi r24, 0x00 ; 0 361d6: c3 cf rjmp .-122 ; 0x3615e #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; 361d8: 4d 89 ldd r20, Y+21 ; 0x15 361da: 8e 89 ldd r24, Y+22 ; 0x16 361dc: c0 cf rjmp .-128 ; 0x3615e 000361de : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 361de: 0f 94 77 ae call 0x35cee ; 0x35cee 361e2: 80 32 cpi r24, 0x20 ; 32 361e4: 29 f0 breq .+10 ; 0x361f0 putch(STK_FAILED); 361e6: 81 e1 ldi r24, 0x11 ; 17 361e8: 0f 94 70 ae call 0x35ce0 ; 0x35ce0 softReset(); 361ec: 0e 94 cc 66 call 0xcd98 ; 0xcd98 } putch(STK_INSYNC); 361f0: 84 e1 ldi r24, 0x14 ; 20 361f2: 0d 94 70 ae jmp 0x35ce0 ; 0x35ce0 000361f6 : } static void getNch(uint8_t count) { 361f6: cf 93 push r28 361f8: c8 2f mov r28, r24 do getch(); while (--count); 361fa: 0f 94 77 ae call 0x35cee ; 0x35cee 361fe: c1 50 subi r28, 0x01 ; 1 36200: e1 f7 brne .-8 ; 0x361fa verifySpace(); } 36202: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 36204: 0d 94 ef b0 jmp 0x361de ; 0x361de 00036208 : /// @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) { 36208: 0f 93 push r16 3620a: 1f 93 push r17 3620c: cf 93 push r28 3620e: df 93 push r29 36210: eb 01 movw r28, r22 36212: 14 2f mov r17, r20 36214: 05 2f mov r16, r21 lcd_putc(chr); 36216: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_puts_P(str); 3621a: ce 01 movw r24, r28 3621c: 0e 94 4b 6e call 0xdc96 ; 0xdc96 lcd_putc(':'); 36220: 8a e3 ldi r24, 0x3A ; 58 36222: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 36226: ce 01 movw r24, r28 36228: 0f 94 12 da call 0x3b424 ; 0x3b424 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 3622c: 9e e0 ldi r25, 0x0E ; 14 3622e: 98 1b sub r25, r24 36230: 89 2f mov r24, r25 36232: 0e 94 56 6e call 0xdcac ; 0xdcac // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 36236: 0f 93 push r16 36238: 1f 93 push r17 3623a: 8f ed ldi r24, 0xDF ; 223 3623c: 9a ea ldi r25, 0xAA ; 170 3623e: 9f 93 push r25 36240: 8f 93 push r24 36242: 0e 94 39 6e call 0xdc72 ; 0xdc72 36246: 0f 90 pop r0 36248: 0f 90 pop r0 3624a: 0f 90 pop r0 3624c: 0f 90 pop r0 } 3624e: df 91 pop r29 36250: cf 91 pop r28 36252: 1f 91 pop r17 36254: 0f 91 pop r16 36256: 08 95 ret 00036258 : // 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) { 36258: 2f 92 push r2 3625a: 3f 92 push r3 3625c: 4f 92 push r4 3625e: 5f 92 push r5 36260: 6f 92 push r6 36262: 7f 92 push r7 36264: 8f 92 push r8 36266: 9f 92 push r9 36268: af 92 push r10 3626a: bf 92 push r11 3626c: cf 92 push r12 3626e: df 92 push r13 36270: ef 92 push r14 36272: ff 92 push r15 36274: 0f 93 push r16 36276: 1f 93 push r17 36278: cf 93 push r28 3627a: df 93 push r29 3627c: cd b7 in r28, 0x3d ; 61 3627e: de b7 in r29, 0x3e ; 62 36280: c5 58 subi r28, 0x85 ; 133 36282: d1 09 sbc r29, r1 36284: 0f b6 in r0, 0x3f ; 63 36286: f8 94 cli 36288: de bf out 0x3e, r29 ; 62 3628a: 0f be out 0x3f, r0 ; 63 3628c: cd bf out 0x3d, r28 ; 61 3628e: 69 a3 std Y+33, r22 ; 0x21 36290: 7a a3 std Y+34, r23 ; 0x22 36292: 8b a3 std Y+35, r24 ; 0x23 36294: 9c a3 std Y+36, r25 ; 0x24 36296: 2d a3 std Y+37, r18 ; 0x25 36298: 3e a3 std Y+38, r19 ; 0x26 3629a: 4f a3 std Y+39, r20 ; 0x27 3629c: 58 a7 std Y+40, r21 ; 0x28 3629e: a8 96 adiw r28, 0x28 ; 40 362a0: ec ae std Y+60, r14 ; 0x3c 362a2: fd ae std Y+61, r15 ; 0x3d 362a4: 0e af std Y+62, r16 ; 0x3e 362a6: 1f af std Y+63, r17 ; 0x3f 362a8: a8 97 sbiw r28, 0x28 ; 40 362aa: aa 96 adiw r28, 0x2a ; 42 362ac: df ae std Y+63, r13 ; 0x3f 362ae: ce ae std Y+62, r12 ; 0x3e 362b0: aa 97 sbiw r28, 0x2a ; 42 362b2: 89 aa std Y+49, r8 ; 0x31 362b4: 99 ae std Y+57, r9 ; 0x39 362b6: ad ae std Y+61, r10 ; 0x3d 362b8: bd aa std Y+53, r11 ; 0x35 362ba: c5 56 subi r28, 0x65 ; 101 362bc: df 4f sbci r29, 0xFF ; 255 362be: 08 81 ld r16, Y 362c0: 19 81 ldd r17, Y+1 ; 0x01 362c2: cb 59 subi r28, 0x9B ; 155 362c4: 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); 362c6: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 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) 362ca: 8f 5f subi r24, 0xFF ; 255 362cc: a1 96 adiw r28, 0x21 ; 33 362ce: 8f af std Y+63, r24 ; 0x3f 362d0: a1 97 sbiw r28, 0x21 ; 33 362d2: 80 31 cpi r24, 0x10 ; 16 362d4: 19 f4 brne .+6 ; 0x362dc block_index = 0; 362d6: a1 96 adiw r28, 0x21 ; 33 362d8: 1f ae std Y+63, r1 ; 0x3f 362da: 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) { 362dc: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 362e0: a1 96 adiw r28, 0x21 ; 33 362e2: 2f ad ldd r18, Y+63 ; 0x3f 362e4: a1 97 sbiw r28, 0x21 ; 33 362e6: 82 13 cpse r24, r18 362e8: 0f c0 rjmp .+30 ; 0x36308 do { manage_heater(); 362ea: 0f 94 61 39 call 0x272c2 ; 0x272c2 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 362ee: 80 e0 ldi r24, 0x00 ; 0 362f0: 0e 94 37 8a call 0x1146e ; 0x1146e lcd_update(0); 362f4: 80 e0 ldi r24, 0x00 ; 0 362f6: 0e 94 27 6e call 0xdc4e ; 0xdc4e } while (block_buffer_tail == next_buffer_head); 362fa: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 362fe: a1 96 adiw r28, 0x21 ; 33 36300: 3f ad ldd r19, Y+63 ; 0x3f 36302: a1 97 sbiw r28, 0x21 ; 33 36304: 83 17 cp r24, r19 36306: 89 f3 breq .-30 ; 0x362ea } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 36308: 40 91 ac 0d lds r20, 0x0DAC ; 0x800dac 3630c: a2 96 adiw r28, 0x22 ; 34 3630e: 4f af std Y+63, r20 ; 0x3f 36310: a2 97 sbiw r28, 0x22 ; 34 36312: 44 23 and r20, r20 36314: 11 f1 breq .+68 ; 0x3635a // avoid planning the block early if aborted SERIAL_ECHO_START; 36316: 82 ec ldi r24, 0xC2 ; 194 36318: 9a ea ldi r25, 0xAA ; 170 3631a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(_n("Move aborted")); 3631e: 85 e9 ldi r24, 0x95 ; 149 36320: 90 e7 ldi r25, 0x70 ; 112 36322: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 // 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(); } 36326: cb 57 subi r28, 0x7B ; 123 36328: df 4f sbci r29, 0xFF ; 255 3632a: 0f b6 in r0, 0x3f ; 63 3632c: f8 94 cli 3632e: de bf out 0x3e, r29 ; 62 36330: 0f be out 0x3f, r0 ; 63 36332: cd bf out 0x3d, r28 ; 61 36334: df 91 pop r29 36336: cf 91 pop r28 36338: 1f 91 pop r17 3633a: 0f 91 pop r16 3633c: ff 90 pop r15 3633e: ef 90 pop r14 36340: df 90 pop r13 36342: cf 90 pop r12 36344: bf 90 pop r11 36346: af 90 pop r10 36348: 9f 90 pop r9 3634a: 8f 90 pop r8 3634c: 7f 90 pop r7 3634e: 6f 90 pop r6 36350: 5f 90 pop r5 36352: 4f 90 pop r4 36354: 3f 90 pop r3 36356: 2f 90 pop r2 36358: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 3635a: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 3635e: 29 2e mov r2, r25 36360: 31 2c mov r3, r1 36362: 8e e6 ldi r24, 0x6E ; 110 36364: 98 9f mul r25, r24 36366: d0 01 movw r26, r0 36368: 11 24 eor r1, r1 3636a: a4 96 adiw r28, 0x24 ; 36 3636c: bf af std Y+63, r27 ; 0x3f 3636e: ae af std Y+62, r26 ; 0x3e 36370: 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; 36372: cd 01 movw r24, r26 36374: 8b 53 subi r24, 0x3B ; 59 36376: 99 4f sbci r25, 0xF9 ; 249 36378: fc 01 movw r30, r24 3637a: e9 5b subi r30, 0xB9 ; 185 3637c: ff 4f sbci r31, 0xFF ; 255 3637e: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 36380: 84 59 subi r24, 0x94 ; 148 36382: 9f 4f sbci r25, 0xFF ; 255 36384: fc 01 movw r30, r24 36386: 11 82 std Z+1, r1 ; 0x01 36388: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 3638a: 01 15 cp r16, r1 3638c: 11 05 cpc r17, r1 3638e: 11 f4 brne .+4 ; 0x36394 36390: 0d 94 20 bc jmp 0x37840 ; 0x37840 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 36394: 80 e1 ldi r24, 0x10 ; 16 36396: f8 01 movw r30, r16 36398: a3 5e subi r26, 0xE3 ; 227 3639a: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 3639c: 01 90 ld r0, Z+ 3639e: 0d 92 st X+, r0 363a0: 8a 95 dec r24 363a2: e1 f7 brne .-8 ; 0x3639c // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 363a4: 8e e6 ldi r24, 0x6E ; 110 363a6: 82 9d mul r24, r2 363a8: 80 01 movw r16, r0 363aa: 83 9d mul r24, r3 363ac: 10 0d add r17, r0 363ae: 11 24 eor r1, r1 363b0: 0b 53 subi r16, 0x3B ; 59 363b2: 19 4f sbci r17, 0xF9 ; 249 363b4: f8 01 movw r30, r16 363b6: e8 59 subi r30, 0x98 ; 152 363b8: ff 4f sbci r31, 0xFF ; 255 363ba: c3 56 subi r28, 0x63 ; 99 363bc: df 4f sbci r29, 0xFF ; 255 363be: 88 81 ld r24, Y 363c0: 99 81 ldd r25, Y+1 ; 0x01 363c2: cd 59 subi r28, 0x9D ; 157 363c4: d0 40 sbci r29, 0x00 ; 0 363c6: 91 83 std Z+1, r25 ; 0x01 363c8: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 363ca: 06 59 subi r16, 0x96 ; 150 363cc: 1f 4f sbci r17, 0xFF ; 255 363ce: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 363d2: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 363d6: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba 363da: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb 363de: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 363e2: d8 01 movw r26, r16 363e4: 6d 93 st X+, r22 363e6: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 363e8: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.488> 363ec: 88 23 and r24, r24 363ee: a9 f0 breq .+42 ; 0x3641a { position[E_AXIS] = 0; 363f0: 10 92 af 06 sts 0x06AF, r1 ; 0x8006af 363f4: 10 92 b0 06 sts 0x06B0, r1 ; 0x8006b0 363f8: 10 92 b1 06 sts 0x06B1, r1 ; 0x8006b1 363fc: 10 92 b2 06 sts 0x06B2, r1 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 36400: 10 92 d9 04 sts 0x04D9, r1 ; 0x8004d9 36404: 10 92 da 04 sts 0x04DA, r1 ; 0x8004da 36408: 10 92 db 04 sts 0x04DB, r1 ; 0x8004db 3640c: 10 92 dc 04 sts 0x04DC, r1 ; 0x8004dc #endif // the block might still be discarded later, but we need to ensure the lower-level // count_position is also reset correctly for consistent results! plan_reset_next_e_queue = false; 36410: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.488> plan_reset_next_e_sched = true; 36414: 81 e0 ldi r24, 0x01 ; 1 36416: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.489> } // Apply the machine correction matrix. world2machine(x, y); 3641a: be 01 movw r22, r28 3641c: 6b 5d subi r22, 0xDB ; 219 3641e: 7f 4f sbci r23, 0xFF ; 255 36420: ce 01 movw r24, r28 36422: 81 96 adiw r24, 0x21 ; 33 36424: 0e 94 82 69 call 0xd304 ; 0xd304 // 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]); 36428: c9 a0 ldd r12, Y+33 ; 0x21 3642a: da a0 ldd r13, Y+34 ; 0x22 3642c: eb a0 ldd r14, Y+35 ; 0x23 3642e: fc a0 ldd r15, Y+36 ; 0x24 36430: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 36434: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 36438: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 3643c: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 36440: c7 01 movw r24, r14 36442: b6 01 movw r22, r12 36444: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36448: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 3644c: c2 58 subi r28, 0x82 ; 130 3644e: df 4f sbci r29, 0xFF ; 255 36450: 68 83 st Y, r22 36452: 79 83 std Y+1, r23 ; 0x01 36454: 8a 83 std Y+2, r24 ; 0x02 36456: 9b 83 std Y+3, r25 ; 0x03 36458: ce 57 subi r28, 0x7E ; 126 3645a: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 3645c: 8d a0 ldd r8, Y+37 ; 0x25 3645e: 9e a0 ldd r9, Y+38 ; 0x26 36460: af a0 ldd r10, Y+39 ; 0x27 36462: b8 a4 ldd r11, Y+40 ; 0x28 36464: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 36468: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 3646c: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 36470: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 36474: c5 01 movw r24, r10 36476: b4 01 movw r22, r8 36478: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3647c: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 36480: ce 57 subi r28, 0x7E ; 126 36482: df 4f sbci r29, 0xFF ; 255 36484: 68 83 st Y, r22 36486: 79 83 std Y+1, r23 ; 0x01 36488: 8a 83 std Y+2, r24 ; 0x02 3648a: 9b 83 std Y+3, r25 ; 0x03 3648c: c2 58 subi r28, 0x82 ; 130 3648e: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 36490: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 36494: 88 23 and r24, r24 36496: 11 f4 brne .+4 ; 0x3649c 36498: 0d 94 27 bc jmp 0x3784e ; 0x3784e target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 3649c: a5 01 movw r20, r10 3649e: 94 01 movw r18, r8 364a0: c7 01 movw r24, r14 364a2: b6 01 movw r22, r12 364a4: 0f 94 e9 a1 call 0x343d2 ; 0x343d2 364a8: a8 96 adiw r28, 0x28 ; 40 364aa: 2c ad ldd r18, Y+60 ; 0x3c 364ac: 3d ad ldd r19, Y+61 ; 0x3d 364ae: 4e ad ldd r20, Y+62 ; 0x3e 364b0: 5f ad ldd r21, Y+63 ; 0x3f 364b2: a8 97 sbiw r28, 0x28 ; 40 364b4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 364b8: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 364bc: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 364c0: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 364c4: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 364c8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 364cc: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 364d0: e6 96 adiw r28, 0x36 ; 54 364d2: 6c af std Y+60, r22 ; 0x3c 364d4: 7d af std Y+61, r23 ; 0x3d 364d6: 8e af std Y+62, r24 ; 0x3e 364d8: 9f af std Y+63, r25 ; 0x3f 364da: 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]); 364dc: aa 96 adiw r28, 0x2a ; 42 364de: ee ad ldd r30, Y+62 ; 0x3e 364e0: ff ad ldd r31, Y+63 ; 0x3f 364e2: aa 97 sbiw r28, 0x2a ; 42 364e4: 80 80 ld r8, Z 364e6: 91 80 ldd r9, Z+1 ; 0x01 364e8: a2 80 ldd r10, Z+2 ; 0x02 364ea: b3 80 ldd r11, Z+3 ; 0x03 364ec: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 364f0: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 364f4: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 364f8: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 364fc: c5 01 movw r24, r10 364fe: b4 01 movw r22, r8 36500: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36504: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 36508: ae 96 adiw r28, 0x2e ; 46 3650a: 6c af std Y+60, r22 ; 0x3c 3650c: 7d af std Y+61, r23 ; 0x3d 3650e: 8e af std Y+62, r24 ; 0x3e 36510: 9f af std Y+63, r25 ; 0x3f 36512: 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]; 36514: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 36518: 90 91 b0 06 lds r25, 0x06B0 ; 0x8006b0 3651c: a0 91 b1 06 lds r26, 0x06B1 ; 0x8006b1 36520: b0 91 b2 06 lds r27, 0x06B2 ; 0x8006b2 36524: ae 96 adiw r28, 0x2e ; 46 36526: 4c ac ldd r4, Y+60 ; 0x3c 36528: 5d ac ldd r5, Y+61 ; 0x3d 3652a: 6e ac ldd r6, Y+62 ; 0x3e 3652c: 7f ac ldd r7, Y+63 ; 0x3f 3652e: ae 97 sbiw r28, 0x2e ; 46 36530: 48 1a sub r4, r24 36532: 59 0a sbc r5, r25 36534: 6a 0a sbc r6, r26 36536: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 36538: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 3653c: 90 91 a4 06 lds r25, 0x06A4 ; 0x8006a4 36540: a0 91 a5 06 lds r26, 0x06A5 ; 0x8006a5 36544: b0 91 a6 06 lds r27, 0x06A6 ; 0x8006a6 36548: c2 58 subi r28, 0x82 ; 130 3654a: df 4f sbci r29, 0xFF ; 255 3654c: c8 80 ld r12, Y 3654e: d9 80 ldd r13, Y+1 ; 0x01 36550: ea 80 ldd r14, Y+2 ; 0x02 36552: fb 80 ldd r15, Y+3 ; 0x03 36554: ce 57 subi r28, 0x7E ; 126 36556: d0 40 sbci r29, 0x00 ; 0 36558: c8 1a sub r12, r24 3655a: d9 0a sbc r13, r25 3655c: ea 0a sbc r14, r26 3655e: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 36560: 80 91 a7 06 lds r24, 0x06A7 ; 0x8006a7 36564: 90 91 a8 06 lds r25, 0x06A8 ; 0x8006a8 36568: a0 91 a9 06 lds r26, 0x06A9 ; 0x8006a9 3656c: b0 91 aa 06 lds r27, 0x06AA ; 0x8006aa 36570: ce 57 subi r28, 0x7E ; 126 36572: df 4f sbci r29, 0xFF ; 255 36574: 28 81 ld r18, Y 36576: 39 81 ldd r19, Y+1 ; 0x01 36578: 4a 81 ldd r20, Y+2 ; 0x02 3657a: 5b 81 ldd r21, Y+3 ; 0x03 3657c: c2 58 subi r28, 0x82 ; 130 3657e: d0 40 sbci r29, 0x00 ; 0 36580: 28 1b sub r18, r24 36582: 39 0b sbc r19, r25 36584: 4a 0b sbc r20, r26 36586: 5b 0b sbc r21, r27 36588: 29 a7 std Y+41, r18 ; 0x29 3658a: 3a a7 std Y+42, r19 ; 0x2a 3658c: 4b a7 std Y+43, r20 ; 0x2b 3658e: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 36590: 80 91 ab 06 lds r24, 0x06AB ; 0x8006ab 36594: 90 91 ac 06 lds r25, 0x06AC ; 0x8006ac 36598: a0 91 ad 06 lds r26, 0x06AD ; 0x8006ad 3659c: b0 91 ae 06 lds r27, 0x06AE ; 0x8006ae 365a0: e6 96 adiw r28, 0x36 ; 54 365a2: 2c ad ldd r18, Y+60 ; 0x3c 365a4: 3d ad ldd r19, Y+61 ; 0x3d 365a6: 4e ad ldd r20, Y+62 ; 0x3e 365a8: 5f ad ldd r21, Y+63 ; 0x3f 365aa: e6 97 sbiw r28, 0x36 ; 54 365ac: 28 1b sub r18, r24 365ae: 39 0b sbc r19, r25 365b0: 4a 0b sbc r20, r26 365b2: 5b 0b sbc r21, r27 365b4: 2d a7 std Y+45, r18 ; 0x2d 365b6: 3e a7 std Y+46, r19 ; 0x2e 365b8: 4f a7 std Y+47, r20 ; 0x2f 365ba: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 365bc: 41 14 cp r4, r1 365be: 51 04 cpc r5, r1 365c0: 61 04 cpc r6, r1 365c2: 71 04 cpc r7, r1 365c4: 09 f4 brne .+2 ; 0x365c8 365c6: 80 c0 rjmp .+256 ; 0x366c8 { if((int)degHotend(active_extruder) 365cc: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 365d0: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 365d4: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 365d8: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 365dc: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 365e0: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 365e4: 62 17 cp r22, r18 365e6: 73 07 cpc r23, r19 365e8: 0c f5 brge .+66 ; 0x3662c { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 365ea: ae 96 adiw r28, 0x2e ; 46 365ec: 8c ad ldd r24, Y+60 ; 0x3c 365ee: 9d ad ldd r25, Y+61 ; 0x3d 365f0: ae ad ldd r26, Y+62 ; 0x3e 365f2: bf ad ldd r27, Y+63 ; 0x3f 365f4: ae 97 sbiw r28, 0x2e ; 46 365f6: 80 93 af 06 sts 0x06AF, r24 ; 0x8006af 365fa: 90 93 b0 06 sts 0x06B0, r25 ; 0x8006b0 365fe: a0 93 b1 06 sts 0x06B1, r26 ; 0x8006b1 36602: b0 93 b2 06 sts 0x06B2, r27 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 36606: 80 92 d9 04 sts 0x04D9, r8 ; 0x8004d9 3660a: 90 92 da 04 sts 0x04DA, r9 ; 0x8004da 3660e: a0 92 db 04 sts 0x04DB, r10 ; 0x8004db 36612: b0 92 dc 04 sts 0x04DC, r11 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 36616: 82 ec ldi r24, 0xC2 ; 194 36618: 9a ea ldi r25, 0xAA ; 170 3661a: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 3661e: 8b e7 ldi r24, 0x7B ; 123 36620: 90 e7 ldi r25, 0x70 ; 112 36622: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 { 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 36626: 41 2c mov r4, r1 36628: 51 2c mov r5, r1 3662a: 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) 3662c: c3 01 movw r24, r6 3662e: b2 01 movw r22, r4 36630: 77 fe sbrs r7, 7 36632: 07 c0 rjmp .+14 ; 0x36642 36634: 66 27 eor r22, r22 36636: 77 27 eor r23, r23 36638: cb 01 movw r24, r22 3663a: 64 19 sub r22, r4 3663c: 75 09 sbc r23, r5 3663e: 86 09 sbc r24, r6 36640: 97 09 sbc r25, r7 36642: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 36646: 4b 01 movw r8, r22 36648: 5c 01 movw r10, r24 3664a: 20 e0 ldi r18, 0x00 ; 0 3664c: 30 ec ldi r19, 0xC0 ; 192 3664e: 4b ee ldi r20, 0xEB ; 235 36650: 53 e4 ldi r21, 0x43 ; 67 36652: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 36656: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 3665a: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 3665e: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 36662: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36666: 9b 01 movw r18, r22 36668: ac 01 movw r20, r24 3666a: c5 01 movw r24, r10 3666c: b4 01 movw r22, r8 3666e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 36672: 18 16 cp r1, r24 36674: 4c f5 brge .+82 ; 0x366c8 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 36676: ae 96 adiw r28, 0x2e ; 46 36678: 2c ad ldd r18, Y+60 ; 0x3c 3667a: 3d ad ldd r19, Y+61 ; 0x3d 3667c: 4e ad ldd r20, Y+62 ; 0x3e 3667e: 5f ad ldd r21, Y+63 ; 0x3f 36680: ae 97 sbiw r28, 0x2e ; 46 36682: 20 93 af 06 sts 0x06AF, r18 ; 0x8006af 36686: 30 93 b0 06 sts 0x06B0, r19 ; 0x8006b0 3668a: 40 93 b1 06 sts 0x06B1, r20 ; 0x8006b1 3668e: 50 93 b2 06 sts 0x06B2, r21 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 36692: aa 96 adiw r28, 0x2a ; 42 36694: ee ad ldd r30, Y+62 ; 0x3e 36696: ff ad ldd r31, Y+63 ; 0x3f 36698: aa 97 sbiw r28, 0x2a ; 42 3669a: 80 81 ld r24, Z 3669c: 91 81 ldd r25, Z+1 ; 0x01 3669e: a2 81 ldd r26, Z+2 ; 0x02 366a0: b3 81 ldd r27, Z+3 ; 0x03 366a2: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 366a6: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 366aa: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 366ae: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 366b2: 82 ec ldi r24, 0xC2 ; 194 366b4: 9a ea ldi r25, 0xAA ; 170 366b6: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 366ba: 8d e5 ldi r24, 0x5D ; 93 366bc: 90 e7 ldi r25, 0x70 ; 112 366be: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 { 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 366c2: 41 2c mov r4, r1 366c4: 51 2c mov r5, r1 366c6: 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); 366c8: 8e e6 ldi r24, 0x6E ; 110 366ca: 82 9d mul r24, r2 366cc: f0 01 movw r30, r0 366ce: 83 9d mul r24, r3 366d0: f0 0d add r31, r0 366d2: 11 24 eor r1, r1 366d4: eb 53 subi r30, 0x3B ; 59 366d6: f9 4f sbci r31, 0xF9 ; 249 366d8: d7 01 movw r26, r14 366da: c6 01 movw r24, r12 366dc: f7 fe sbrs r15, 7 366de: 07 c0 rjmp .+14 ; 0x366ee 366e0: 88 27 eor r24, r24 366e2: 99 27 eor r25, r25 366e4: dc 01 movw r26, r24 366e6: 8c 19 sub r24, r12 366e8: 9d 09 sbc r25, r13 366ea: ae 09 sbc r26, r14 366ec: bf 09 sbc r27, r15 366ee: 80 83 st Z, r24 366f0: 91 83 std Z+1, r25 ; 0x01 366f2: a2 83 std Z+2, r26 ; 0x02 366f4: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 366f6: 8e e6 ldi r24, 0x6E ; 110 366f8: 82 9d mul r24, r2 366fa: f0 01 movw r30, r0 366fc: 83 9d mul r24, r3 366fe: f0 0d add r31, r0 36700: 11 24 eor r1, r1 36702: eb 53 subi r30, 0x3B ; 59 36704: f9 4f sbci r31, 0xF9 ; 249 36706: 89 a5 ldd r24, Y+41 ; 0x29 36708: 9a a5 ldd r25, Y+42 ; 0x2a 3670a: ab a5 ldd r26, Y+43 ; 0x2b 3670c: bc a5 ldd r27, Y+44 ; 0x2c 3670e: b7 ff sbrs r27, 7 36710: 07 c0 rjmp .+14 ; 0x36720 36712: b0 95 com r27 36714: a0 95 com r26 36716: 90 95 com r25 36718: 81 95 neg r24 3671a: 9f 4f sbci r25, 0xFF ; 255 3671c: af 4f sbci r26, 0xFF ; 255 3671e: bf 4f sbci r27, 0xFF ; 255 36720: 84 83 std Z+4, r24 ; 0x04 36722: 95 83 std Z+5, r25 ; 0x05 36724: a6 83 std Z+6, r26 ; 0x06 36726: 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); 36728: 8e e6 ldi r24, 0x6E ; 110 3672a: 82 9d mul r24, r2 3672c: f0 01 movw r30, r0 3672e: 83 9d mul r24, r3 36730: f0 0d add r31, r0 36732: 11 24 eor r1, r1 36734: eb 53 subi r30, 0x3B ; 59 36736: f9 4f sbci r31, 0xF9 ; 249 36738: 8d a5 ldd r24, Y+45 ; 0x2d 3673a: 9e a5 ldd r25, Y+46 ; 0x2e 3673c: af a5 ldd r26, Y+47 ; 0x2f 3673e: b8 a9 ldd r27, Y+48 ; 0x30 36740: b7 ff sbrs r27, 7 36742: 07 c0 rjmp .+14 ; 0x36752 36744: b0 95 com r27 36746: a0 95 com r26 36748: 90 95 com r25 3674a: 81 95 neg r24 3674c: 9f 4f sbci r25, 0xFF ; 255 3674e: af 4f sbci r26, 0xFF ; 255 36750: bf 4f sbci r27, 0xFF ; 255 36752: 80 87 std Z+8, r24 ; 0x08 36754: 91 87 std Z+9, r25 ; 0x09 36756: a2 87 std Z+10, r26 ; 0x0a 36758: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 3675a: b3 01 movw r22, r6 3675c: a2 01 movw r20, r4 3675e: 77 fe sbrs r7, 7 36760: 07 c0 rjmp .+14 ; 0x36770 36762: 44 27 eor r20, r20 36764: 55 27 eor r21, r21 36766: ba 01 movw r22, r20 36768: 44 19 sub r20, r4 3676a: 55 09 sbc r21, r5 3676c: 66 09 sbc r22, r6 3676e: 77 09 sbc r23, r7 36770: 8e e6 ldi r24, 0x6E ; 110 36772: 82 9d mul r24, r2 36774: f0 01 movw r30, r0 36776: 83 9d mul r24, r3 36778: f0 0d add r31, r0 3677a: 11 24 eor r1, r1 3677c: eb 53 subi r30, 0x3B ; 59 3677e: f9 4f sbci r31, 0xF9 ; 249 36780: 44 87 std Z+12, r20 ; 0x0c 36782: 55 87 std Z+13, r21 ; 0x0d 36784: 66 87 std Z+14, r22 ; 0x0e 36786: 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))); 36788: 00 81 ld r16, Z 3678a: 11 81 ldd r17, Z+1 ; 0x01 3678c: 22 81 ldd r18, Z+2 ; 0x02 3678e: 33 81 ldd r19, Z+3 ; 0x03 36790: 84 81 ldd r24, Z+4 ; 0x04 36792: 95 81 ldd r25, Z+5 ; 0x05 36794: a6 81 ldd r26, Z+6 ; 0x06 36796: b7 81 ldd r27, Z+7 ; 0x07 36798: 80 17 cp r24, r16 3679a: 91 07 cpc r25, r17 3679c: a2 07 cpc r26, r18 3679e: b3 07 cpc r27, r19 367a0: 14 f4 brge .+4 ; 0x367a6 367a2: d9 01 movw r26, r18 367a4: c8 01 movw r24, r16 367a6: ee e6 ldi r30, 0x6E ; 110 367a8: be 2e mov r11, r30 367aa: b2 9c mul r11, r2 367ac: f0 01 movw r30, r0 367ae: b3 9c mul r11, r3 367b0: f0 0d add r31, r0 367b2: 11 24 eor r1, r1 367b4: eb 53 subi r30, 0x3B ; 59 367b6: f9 4f sbci r31, 0xF9 ; 249 367b8: 80 84 ldd r8, Z+8 ; 0x08 367ba: 91 84 ldd r9, Z+9 ; 0x09 367bc: a2 84 ldd r10, Z+10 ; 0x0a 367be: b3 84 ldd r11, Z+11 ; 0x0b 367c0: 88 15 cp r24, r8 367c2: 99 05 cpc r25, r9 367c4: aa 05 cpc r26, r10 367c6: bb 05 cpc r27, r11 367c8: 14 f4 brge .+4 ; 0x367ce 367ca: d5 01 movw r26, r10 367cc: c4 01 movw r24, r8 367ce: 84 17 cp r24, r20 367d0: 95 07 cpc r25, r21 367d2: a6 07 cpc r26, r22 367d4: b7 07 cpc r27, r23 367d6: 14 f4 brge .+4 ; 0x367dc 367d8: db 01 movw r26, r22 367da: ca 01 movw r24, r20 367dc: 4e e6 ldi r20, 0x6E ; 110 367de: 42 9d mul r20, r2 367e0: f0 01 movw r30, r0 367e2: 43 9d mul r20, r3 367e4: f0 0d add r31, r0 367e6: 11 24 eor r1, r1 367e8: eb 53 subi r30, 0x3B ; 59 367ea: f9 4f sbci r31, 0xF9 ; 249 367ec: 80 8b std Z+16, r24 ; 0x10 367ee: 91 8b std Z+17, r25 ; 0x11 367f0: a2 8b std Z+18, r26 ; 0x12 367f2: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 367f4: 06 97 sbiw r24, 0x06 ; 6 367f6: a1 05 cpc r26, r1 367f8: b1 05 cpc r27, r1 367fa: 0c f4 brge .+2 ; 0x367fe 367fc: 94 cd rjmp .-1240 ; 0x36326 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 367fe: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 36802: df 01 movw r26, r30 36804: aa 5b subi r26, 0xBA ; 186 36806: bf 4f sbci r27, 0xFF ; 255 36808: 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); 3680a: f7 fe sbrs r15, 7 3680c: 02 c0 rjmp .+4 ; 0x36812 3680e: 0d 94 37 bc jmp 0x3786e ; 0x3786e } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 36812: 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); 36814: 89 a5 ldd r24, Y+41 ; 0x29 36816: 9a a5 ldd r25, Y+42 ; 0x2a 36818: ab a5 ldd r26, Y+43 ; 0x2b 3681a: bc a5 ldd r27, Y+44 ; 0x2c 3681c: b7 ff sbrs r27, 7 3681e: 0b c0 rjmp .+22 ; 0x36836 36820: 8e e6 ldi r24, 0x6E ; 110 36822: 82 9d mul r24, r2 36824: f0 01 movw r30, r0 36826: 83 9d mul r24, r3 36828: f0 0d add r31, r0 3682a: 11 24 eor r1, r1 3682c: eb 53 subi r30, 0x3B ; 59 3682e: f9 4f sbci r31, 0xF9 ; 249 36830: 80 8d ldd r24, Z+24 ; 0x18 36832: 82 60 ori r24, 0x02 ; 2 36834: 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); 36836: 8d a5 ldd r24, Y+45 ; 0x2d 36838: 9e a5 ldd r25, Y+46 ; 0x2e 3683a: af a5 ldd r26, Y+47 ; 0x2f 3683c: b8 a9 ldd r27, Y+48 ; 0x30 3683e: b7 ff sbrs r27, 7 36840: 0b c0 rjmp .+22 ; 0x36858 36842: 8e e6 ldi r24, 0x6E ; 110 36844: 82 9d mul r24, r2 36846: f0 01 movw r30, r0 36848: 83 9d mul r24, r3 3684a: f0 0d add r31, r0 3684c: 11 24 eor r1, r1 3684e: eb 53 subi r30, 0x3B ; 59 36850: f9 4f sbci r31, 0xF9 ; 249 36852: 80 8d ldd r24, Z+24 ; 0x18 36854: 84 60 ori r24, 0x04 ; 4 36856: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 36858: 77 fe sbrs r7, 7 3685a: 0b c0 rjmp .+22 ; 0x36872 3685c: 8e e6 ldi r24, 0x6E ; 110 3685e: 82 9d mul r24, r2 36860: f0 01 movw r30, r0 36862: 83 9d mul r24, r3 36864: f0 0d add r31, r0 36866: 11 24 eor r1, r1 36868: eb 53 subi r30, 0x3B ; 59 3686a: f9 4f sbci r31, 0xF9 ; 249 3686c: 80 8d ldd r24, Z+24 ; 0x18 3686e: 88 60 ori r24, 0x08 ; 8 36870: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 36872: 01 2b or r16, r17 36874: 02 2b or r16, r18 36876: 03 2b or r16, r19 36878: 09 f0 breq .+2 ; 0x3687c 3687a: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 3687c: 8e e6 ldi r24, 0x6E ; 110 3687e: 82 9d mul r24, r2 36880: f0 01 movw r30, r0 36882: 83 9d mul r24, r3 36884: f0 0d add r31, r0 36886: 11 24 eor r1, r1 36888: eb 53 subi r30, 0x3B ; 59 3688a: f9 4f sbci r31, 0xF9 ; 249 3688c: 84 81 ldd r24, Z+4 ; 0x04 3688e: 95 81 ldd r25, Z+5 ; 0x05 36890: a6 81 ldd r26, Z+6 ; 0x06 36892: b7 81 ldd r27, Z+7 ; 0x07 36894: 89 2b or r24, r25 36896: 8a 2b or r24, r26 36898: 8b 2b or r24, r27 3689a: 09 f0 breq .+2 ; 0x3689e 3689c: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 3689e: 8e e6 ldi r24, 0x6E ; 110 368a0: 82 9d mul r24, r2 368a2: f0 01 movw r30, r0 368a4: 83 9d mul r24, r3 368a6: f0 0d add r31, r0 368a8: 11 24 eor r1, r1 368aa: eb 53 subi r30, 0x3B ; 59 368ac: f9 4f sbci r31, 0xF9 ; 249 368ae: 80 85 ldd r24, Z+8 ; 0x08 368b0: 91 85 ldd r25, Z+9 ; 0x09 368b2: a2 85 ldd r26, Z+10 ; 0x0a 368b4: b3 85 ldd r27, Z+11 ; 0x0b 368b6: 89 2b or r24, r25 368b8: 8a 2b or r24, r26 368ba: 8b 2b or r24, r27 368bc: 09 f0 breq .+2 ; 0x368c0 368be: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 368c0: 8e e6 ldi r24, 0x6E ; 110 368c2: 82 9d mul r24, r2 368c4: f0 01 movw r30, r0 368c6: 83 9d mul r24, r3 368c8: f0 0d add r31, r0 368ca: 11 24 eor r1, r1 368cc: eb 53 subi r30, 0x3B ; 59 368ce: f9 4f sbci r31, 0xF9 ; 249 368d0: 84 85 ldd r24, Z+12 ; 0x0c 368d2: 95 85 ldd r25, Z+13 ; 0x0d 368d4: a6 85 ldd r26, Z+14 ; 0x0e 368d6: b7 85 ldd r27, Z+15 ; 0x0f 368d8: 89 2b or r24, r25 368da: 8a 2b or r24, r26 368dc: 8b 2b or r24, r27 368de: 09 f0 breq .+2 ; 0x368e2 368e0: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 368e2: 8e e6 ldi r24, 0x6E ; 110 368e4: 82 9d mul r24, r2 368e6: f0 01 movw r30, r0 368e8: 83 9d mul r24, r3 368ea: f0 0d add r31, r0 368ec: 11 24 eor r1, r1 368ee: eb 53 subi r30, 0x3B ; 59 368f0: f9 4f sbci r31, 0xF9 ; 249 368f2: 24 85 ldd r18, Z+12 ; 0x0c 368f4: 35 85 ldd r19, Z+13 ; 0x0d 368f6: 46 85 ldd r20, Z+14 ; 0x0e 368f8: 57 85 ldd r21, Z+15 ; 0x0f 368fa: 2a 96 adiw r28, 0x0a ; 10 368fc: 2c af std Y+60, r18 ; 0x3c 368fe: 3d af std Y+61, r19 ; 0x3d 36900: 4e af std Y+62, r20 ; 0x3e 36902: 5f af std Y+63, r21 ; 0x3f 36904: 2a 97 sbiw r28, 0x0a ; 10 36906: 23 2b or r18, r19 36908: 24 2b or r18, r20 3690a: 25 2b or r18, r21 3690c: 09 f0 breq .+2 ; 0x36910 3690e: b3 c7 rjmp .+3942 ; 0x37876 { if(feed_rate 36914: b0 90 ff 0d lds r11, 0x0DFF ; 0x800dff 36918: 00 91 00 0e lds r16, 0x0E00 ; 0x800e00 3691c: 10 91 01 0e lds r17, 0x0E01 ; 0x800e01 } else { if(feed_rate 36930: 18 16 cp r1, r24 36932: 24 f4 brge .+8 ; 0x3693c 36934: a9 aa std Y+49, r10 ; 0x31 36936: b9 ae std Y+57, r11 ; 0x39 36938: 0d af std Y+61, r16 ; 0x3d 3693a: 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]; 3693c: c7 01 movw r24, r14 3693e: b6 01 movw r22, r12 36940: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 36944: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 36948: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 3694c: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 36950: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 36954: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 36958: 4b 01 movw r8, r22 3695a: 5c 01 movw r10, r24 3695c: 89 82 std Y+1, r8 ; 0x01 3695e: 9a 82 std Y+2, r9 ; 0x02 36960: ab 82 std Y+3, r10 ; 0x03 36962: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 36964: 69 a5 ldd r22, Y+41 ; 0x29 36966: 7a a5 ldd r23, Y+42 ; 0x2a 36968: 8b a5 ldd r24, Y+43 ; 0x2b 3696a: 9c a5 ldd r25, Y+44 ; 0x2c 3696c: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 36970: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 36974: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 36978: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 3697c: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 36980: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 36984: 6b 01 movw r12, r22 36986: 7c 01 movw r14, r24 36988: cd 82 std Y+5, r12 ; 0x05 3698a: de 82 std Y+6, r13 ; 0x06 3698c: ef 82 std Y+7, r14 ; 0x07 3698e: 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]; 36990: 6d a5 ldd r22, Y+45 ; 0x2d 36992: 7e a5 ldd r23, Y+46 ; 0x2e 36994: 8f a5 ldd r24, Y+47 ; 0x2f 36996: 98 a9 ldd r25, Y+48 ; 0x30 36998: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 3699c: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 369a0: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 369a4: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 369a8: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 369ac: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 369b0: 22 96 adiw r28, 0x02 ; 2 369b2: 6c af std Y+60, r22 ; 0x3c 369b4: 7d af std Y+61, r23 ; 0x3d 369b6: 8e af std Y+62, r24 ; 0x3e 369b8: 9f af std Y+63, r25 ; 0x3f 369ba: 22 97 sbiw r28, 0x02 ; 2 369bc: 69 87 std Y+9, r22 ; 0x09 369be: 7a 87 std Y+10, r23 ; 0x0a 369c0: 8b 87 std Y+11, r24 ; 0x0b 369c2: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 369c4: c3 01 movw r24, r6 369c6: b2 01 movw r22, r4 369c8: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 369cc: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 369d0: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 369d4: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 369d8: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 369dc: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 369e0: 26 96 adiw r28, 0x06 ; 6 369e2: 6c af std Y+60, r22 ; 0x3c 369e4: 7d af std Y+61, r23 ; 0x3d 369e6: 8e af std Y+62, r24 ; 0x3e 369e8: 9f af std Y+63, r25 ; 0x3f 369ea: 26 97 sbiw r28, 0x06 ; 6 369ec: 6d 87 std Y+13, r22 ; 0x0d 369ee: 7e 87 std Y+14, r23 ; 0x0e 369f0: 8f 87 std Y+15, r24 ; 0x0f 369f2: 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 ) 369f4: 8e e6 ldi r24, 0x6E ; 110 369f6: 82 9d mul r24, r2 369f8: f0 01 movw r30, r0 369fa: 83 9d mul r24, r3 369fc: f0 0d add r31, r0 369fe: 11 24 eor r1, r1 36a00: eb 53 subi r30, 0x3B ; 59 36a02: f9 4f sbci r31, 0xF9 ; 249 36a04: 80 81 ld r24, Z 36a06: 91 81 ldd r25, Z+1 ; 0x01 36a08: a2 81 ldd r26, Z+2 ; 0x02 36a0a: b3 81 ldd r27, Z+3 ; 0x03 36a0c: 2e 96 adiw r28, 0x0e ; 14 36a0e: 8c af std Y+60, r24 ; 0x3c 36a10: 9d af std Y+61, r25 ; 0x3d 36a12: ae af std Y+62, r26 ; 0x3e 36a14: bf af std Y+63, r27 ; 0x3f 36a16: 2e 97 sbiw r28, 0x0e ; 14 36a18: 06 97 sbiw r24, 0x06 ; 6 36a1a: a1 05 cpc r26, r1 36a1c: b1 05 cpc r27, r1 36a1e: 0c f0 brlt .+2 ; 0x36a22 36a20: 33 c7 rjmp .+3686 ; 0x37888 36a22: 84 81 ldd r24, Z+4 ; 0x04 36a24: 95 81 ldd r25, Z+5 ; 0x05 36a26: a6 81 ldd r26, Z+6 ; 0x06 36a28: b7 81 ldd r27, Z+7 ; 0x07 36a2a: 06 97 sbiw r24, 0x06 ; 6 36a2c: a1 05 cpc r26, r1 36a2e: b1 05 cpc r27, r1 36a30: 0c f0 brlt .+2 ; 0x36a34 36a32: 2a c7 rjmp .+3668 ; 0x37888 36a34: 80 85 ldd r24, Z+8 ; 0x08 36a36: 91 85 ldd r25, Z+9 ; 0x09 36a38: a2 85 ldd r26, Z+10 ; 0x0a 36a3a: b3 85 ldd r27, Z+11 ; 0x0b 36a3c: 06 97 sbiw r24, 0x06 ; 6 36a3e: a1 05 cpc r26, r1 36a40: b1 05 cpc r27, r1 36a42: 0c f0 brlt .+2 ; 0x36a46 36a44: 21 c7 rjmp .+3650 ; 0x37888 { block->millimeters = fabs(delta_mm[E_AXIS]); 36a46: 26 96 adiw r28, 0x06 ; 6 36a48: 8c ad ldd r24, Y+60 ; 0x3c 36a4a: 9d ad ldd r25, Y+61 ; 0x3d 36a4c: ae ad ldd r26, Y+62 ; 0x3e 36a4e: bf ad ldd r27, Y+63 ; 0x3f 36a50: 26 97 sbiw r28, 0x06 ; 6 36a52: bf 77 andi r27, 0x7F ; 127 36a54: 85 a7 std Z+45, r24 ; 0x2d 36a56: 96 a7 std Z+46, r25 ; 0x2e 36a58: a7 a7 std Z+47, r26 ; 0x2f 36a5a: 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 36a5c: 8e e6 ldi r24, 0x6E ; 110 36a5e: 82 9d mul r24, r2 36a60: f0 01 movw r30, r0 36a62: 83 9d mul r24, r3 36a64: f0 0d add r31, r0 36a66: 11 24 eor r1, r1 36a68: eb 53 subi r30, 0x3B ; 59 36a6a: f9 4f sbci r31, 0xF9 ; 249 36a6c: 45 a4 ldd r4, Z+45 ; 0x2d 36a6e: 56 a4 ldd r5, Z+46 ; 0x2e 36a70: 67 a4 ldd r6, Z+47 ; 0x2f 36a72: 70 a8 ldd r7, Z+48 ; 0x30 36a74: a3 01 movw r20, r6 36a76: 92 01 movw r18, r4 36a78: 60 e0 ldi r22, 0x00 ; 0 36a7a: 70 e0 ldi r23, 0x00 ; 0 36a7c: 80 e8 ldi r24, 0x80 ; 128 36a7e: 9f e3 ldi r25, 0x3F ; 63 36a80: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 36a84: 29 a9 ldd r18, Y+49 ; 0x31 36a86: 39 ad ldd r19, Y+57 ; 0x39 36a88: 4d ad ldd r20, Y+61 ; 0x3d 36a8a: 5d a9 ldd r21, Y+53 ; 0x35 36a8c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36a90: 6b 01 movw r12, r22 36a92: 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); 36a94: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 36a98: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 36a9c: 89 1b sub r24, r25 36a9e: 8f 70 andi r24, 0x0F ; 15 36aa0: 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)) { 36aa2: 82 50 subi r24, 0x02 ; 2 36aa4: 86 30 cpi r24, 0x06 ; 6 36aa6: 08 f0 brcs .+2 ; 0x36aaa 36aa8: 40 c0 rjmp .+128 ; 0x36b2a // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 36aaa: a7 01 movw r20, r14 36aac: 96 01 movw r18, r12 36aae: 60 e0 ldi r22, 0x00 ; 0 36ab0: 74 e2 ldi r23, 0x24 ; 36 36ab2: 84 e7 ldi r24, 0x74 ; 116 36ab4: 99 e4 ldi r25, 0x49 ; 73 36ab6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 36aba: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 36abe: 4b 01 movw r8, r22 36ac0: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 36ac2: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 36ac6: 90 91 03 0e lds r25, 0x0E03 ; 0x800e03 36aca: a0 91 04 0e lds r26, 0x0E04 ; 0x800e04 36ace: b0 91 05 0e lds r27, 0x0E05 ; 0x800e05 36ad2: 88 16 cp r8, r24 36ad4: 99 06 cpc r9, r25 36ad6: aa 06 cpc r10, r26 36ad8: bb 06 cpc r11, r27 36ada: 38 f5 brcc .+78 ; 0x36b2a // 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)); 36adc: bc 01 movw r22, r24 36ade: cd 01 movw r24, r26 36ae0: 68 19 sub r22, r8 36ae2: 79 09 sbc r23, r9 36ae4: 8a 09 sbc r24, r10 36ae6: 9b 09 sbc r25, r11 36ae8: 66 0f add r22, r22 36aea: 77 1f adc r23, r23 36aec: 88 1f adc r24, r24 36aee: 99 1f adc r25, r25 36af0: ad ad ldd r26, Y+61 ; 0x3d 36af2: 2a 2f mov r18, r26 36af4: 30 e0 ldi r19, 0x00 ; 0 36af6: 50 e0 ldi r21, 0x00 ; 0 36af8: 40 e0 ldi r20, 0x00 ; 0 36afa: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 36afe: ca 01 movw r24, r20 36b00: b9 01 movw r22, r18 36b02: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 36b06: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 36b0a: 68 0d add r22, r8 36b0c: 79 1d adc r23, r9 36b0e: 8a 1d adc r24, r10 36b10: 9b 1d adc r25, r11 36b12: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 36b16: 9b 01 movw r18, r22 36b18: ac 01 movw r20, r24 36b1a: 60 e0 ldi r22, 0x00 ; 0 36b1c: 74 e2 ldi r23, 0x24 ; 36 36b1e: 84 e7 ldi r24, 0x74 ; 116 36b20: 99 e4 ldi r25, 0x49 ; 73 36b22: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 36b26: 6b 01 movw r12, r22 36b28: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 36b2a: a3 01 movw r20, r6 36b2c: 92 01 movw r18, r4 36b2e: c7 01 movw r24, r14 36b30: b6 01 movw r22, r12 36b32: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36b36: 6d ab std Y+53, r22 ; 0x35 36b38: 7e ab std Y+54, r23 ; 0x36 36b3a: 8f ab std Y+55, r24 ; 0x37 36b3c: 98 af std Y+56, r25 ; 0x38 36b3e: 8e e6 ldi r24, 0x6E ; 110 36b40: 82 9d mul r24, r2 36b42: 80 01 movw r16, r0 36b44: 83 9d mul r24, r3 36b46: 10 0d add r17, r0 36b48: 11 24 eor r1, r1 36b4a: 0b 53 subi r16, 0x3B ; 59 36b4c: 19 4f sbci r17, 0xF9 ; 249 36b4e: 2d a9 ldd r18, Y+53 ; 0x35 36b50: 3e a9 ldd r19, Y+54 ; 0x36 36b52: 4f a9 ldd r20, Y+55 ; 0x37 36b54: 58 ad ldd r21, Y+56 ; 0x38 36b56: d8 01 movw r26, r16 36b58: 91 96 adiw r26, 0x21 ; 33 36b5a: 2d 93 st X+, r18 36b5c: 3d 93 st X+, r19 36b5e: 4d 93 st X+, r20 36b60: 5c 93 st X, r21 36b62: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 36b64: 50 96 adiw r26, 0x10 ; 16 36b66: 6d 91 ld r22, X+ 36b68: 7d 91 ld r23, X+ 36b6a: 8d 91 ld r24, X+ 36b6c: 9c 91 ld r25, X 36b6e: 53 97 sbiw r26, 0x13 ; 19 36b70: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 36b74: 69 af std Y+57, r22 ; 0x39 36b76: 7a af std Y+58, r23 ; 0x3a 36b78: 8b af std Y+59, r24 ; 0x3b 36b7a: 9c af std Y+60, r25 ; 0x3c 36b7c: 9b 01 movw r18, r22 36b7e: ac 01 movw r20, r24 36b80: c7 01 movw r24, r14 36b82: b6 01 movw r22, r12 36b84: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36b88: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 36b8c: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 36b90: 62 96 adiw r28, 0x12 ; 18 36b92: 6c af std Y+60, r22 ; 0x3c 36b94: 7d af std Y+61, r23 ; 0x3d 36b96: 8e af std Y+62, r24 ; 0x3e 36b98: 9f af std Y+63, r25 ; 0x3f 36b9a: 62 97 sbiw r28, 0x12 ; 18 36b9c: f8 01 movw r30, r16 36b9e: 66 ab std Z+54, r22 ; 0x36 36ba0: 77 ab std Z+55, r23 ; 0x37 36ba2: 80 af std Z+56, r24 ; 0x38 36ba4: 91 af std Z+57, r25 ; 0x39 36ba6: 9e 01 movw r18, r28 36ba8: 2f 5f subi r18, 0xFF ; 255 36baa: 3f 4f sbci r19, 0xFF ; 255 36bac: 6c 96 adiw r28, 0x1c ; 28 36bae: 3f af std Y+63, r19 ; 0x3f 36bb0: 2e af std Y+62, r18 ; 0x3e 36bb2: 6c 97 sbiw r28, 0x1c ; 28 36bb4: ae 01 movw r20, r28 36bb6: 4f 5e subi r20, 0xEF ; 239 36bb8: 5f 4f sbci r21, 0xFF ; 255 36bba: a0 96 adiw r28, 0x20 ; 32 36bbc: 5f af std Y+63, r21 ; 0x3f 36bbe: 4e af std Y+62, r20 ; 0x3e 36bc0: a0 97 sbiw r28, 0x20 ; 32 36bc2: 80 91 71 02 lds r24, 0x0271 ; 0x800271 36bc6: 90 91 72 02 lds r25, 0x0272 ; 0x800272 36bca: 9a ab std Y+50, r25 ; 0x32 36bcc: 89 ab std Y+49, r24 ; 0x31 36bce: 40 96 adiw r24, 0x10 ; 16 36bd0: 6e 96 adiw r28, 0x1e ; 30 36bd2: 9f af std Y+63, r25 ; 0x3f 36bd4: 8e af std Y+62, r24 ; 0x3e 36bd6: 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]) 36bd8: 68 96 adiw r28, 0x18 ; 24 36bda: 5f af std Y+63, r21 ; 0x3f 36bdc: 4e af std Y+62, r20 ; 0x3e 36bde: 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 36be0: 19 a6 std Y+41, r1 ; 0x29 36be2: 1d a6 std Y+45, r1 ; 0x2d 36be4: 00 e8 ldi r16, 0x80 ; 128 36be6: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 36be8: 6c 96 adiw r28, 0x1c ; 28 36bea: ae ad ldd r26, Y+62 ; 0x3e 36bec: bf ad ldd r27, Y+63 ; 0x3f 36bee: 6c 97 sbiw r28, 0x1c ; 28 36bf0: 2d 91 ld r18, X+ 36bf2: 3d 91 ld r19, X+ 36bf4: 4d 91 ld r20, X+ 36bf6: 5d 91 ld r21, X+ 36bf8: 6c 96 adiw r28, 0x1c ; 28 36bfa: bf af std Y+63, r27 ; 0x3f 36bfc: ae af std Y+62, r26 ; 0x3e 36bfe: 6c 97 sbiw r28, 0x1c ; 28 36c00: c7 01 movw r24, r14 36c02: b6 01 movw r22, r12 36c04: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36c08: 68 96 adiw r28, 0x18 ; 24 36c0a: ee ad ldd r30, Y+62 ; 0x3e 36c0c: ff ad ldd r31, Y+63 ; 0x3f 36c0e: 68 97 sbiw r28, 0x18 ; 24 36c10: 61 93 st Z+, r22 36c12: 71 93 st Z+, r23 36c14: 81 93 st Z+, r24 36c16: 91 93 st Z+, r25 36c18: 68 96 adiw r28, 0x18 ; 24 36c1a: ff af std Y+63, r31 ; 0x3f 36c1c: ee af std Y+62, r30 ; 0x3e 36c1e: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 36c20: 4b 01 movw r8, r22 36c22: 5c 01 movw r10, r24 36c24: e8 94 clt 36c26: b7 f8 bld r11, 7 36c28: a9 a9 ldd r26, Y+49 ; 0x31 36c2a: ba a9 ldd r27, Y+50 ; 0x32 36c2c: 2d 91 ld r18, X+ 36c2e: 3d 91 ld r19, X+ 36c30: 4d 91 ld r20, X+ 36c32: 5d 91 ld r21, X+ 36c34: ba ab std Y+50, r27 ; 0x32 36c36: a9 ab std Y+49, r26 ; 0x31 36c38: 66 96 adiw r28, 0x16 ; 22 36c3a: 2c af std Y+60, r18 ; 0x3c 36c3c: 3d af std Y+61, r19 ; 0x3d 36c3e: 4e af std Y+62, r20 ; 0x3e 36c40: 5f af std Y+63, r21 ; 0x3f 36c42: 66 97 sbiw r28, 0x16 ; 22 36c44: c5 01 movw r24, r10 36c46: b4 01 movw r22, r8 36c48: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 36c4c: 18 16 cp r1, r24 36c4e: b4 f4 brge .+44 ; 0x36c7c { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 36c50: a5 01 movw r20, r10 36c52: 94 01 movw r18, r8 36c54: 66 96 adiw r28, 0x16 ; 22 36c56: 6c ad ldd r22, Y+60 ; 0x3c 36c58: 7d ad ldd r23, Y+61 ; 0x3d 36c5a: 8e ad ldd r24, Y+62 ; 0x3e 36c5c: 9f ad ldd r25, Y+63 ; 0x3f 36c5e: 66 97 sbiw r28, 0x16 ; 22 36c60: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 36c64: 4b 01 movw r8, r22 36c66: 5c 01 movw r10, r24 36c68: 29 a5 ldd r18, Y+41 ; 0x29 36c6a: 3d a5 ldd r19, Y+45 ; 0x2d 36c6c: a8 01 movw r20, r16 36c6e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 36c72: 18 16 cp r1, r24 36c74: 1c f0 brlt .+6 ; 0x36c7c 36c76: 89 a6 std Y+41, r8 ; 0x29 36c78: 9d a6 std Y+45, r9 ; 0x2d 36c7a: 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++) 36c7c: 6e 96 adiw r28, 0x1e ; 30 36c7e: ee ad ldd r30, Y+62 ; 0x3e 36c80: ff ad ldd r31, Y+63 ; 0x3f 36c82: 6e 97 sbiw r28, 0x1e ; 30 36c84: 29 a9 ldd r18, Y+49 ; 0x31 36c86: 3a a9 ldd r19, Y+50 ; 0x32 36c88: e2 17 cp r30, r18 36c8a: f3 07 cpc r31, r19 36c8c: 09 f0 breq .+2 ; 0x36c90 36c8e: ac cf rjmp .-168 ; 0x36be8 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 36c90: 20 e0 ldi r18, 0x00 ; 0 36c92: 30 e0 ldi r19, 0x00 ; 0 36c94: 40 e8 ldi r20, 0x80 ; 128 36c96: 5f e3 ldi r21, 0x3F ; 63 36c98: 69 a5 ldd r22, Y+41 ; 0x29 36c9a: 7d a5 ldd r23, Y+45 ; 0x2d 36c9c: c8 01 movw r24, r16 36c9e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 36ca2: 87 ff sbrs r24, 7 36ca4: 50 c0 rjmp .+160 ; 0x36d46 36ca6: a0 96 adiw r28, 0x20 ; 32 36ca8: ae ac ldd r10, Y+62 ; 0x3e 36caa: bf ac ldd r11, Y+63 ; 0x3f 36cac: a0 97 sbiw r28, 0x20 ; 32 36cae: 30 e1 ldi r19, 0x10 ; 16 36cb0: a3 0e add r10, r19 36cb2: b1 1c adc r11, r1 36cb4: a0 96 adiw r28, 0x20 ; 32 36cb6: ce ac ldd r12, Y+62 ; 0x3e 36cb8: df ac ldd r13, Y+63 ; 0x3f 36cba: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 36cbc: d6 01 movw r26, r12 36cbe: 6d 91 ld r22, X+ 36cc0: 7d 91 ld r23, X+ 36cc2: 8d 91 ld r24, X+ 36cc4: 9d 91 ld r25, X+ 36cc6: 6d 01 movw r12, r26 36cc8: 7d 01 movw r14, r26 36cca: b4 e0 ldi r27, 0x04 ; 4 36ccc: eb 1a sub r14, r27 36cce: f1 08 sbc r15, r1 36cd0: 29 a5 ldd r18, Y+41 ; 0x29 36cd2: 3d a5 ldd r19, Y+45 ; 0x2d 36cd4: a8 01 movw r20, r16 36cd6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36cda: f7 01 movw r30, r14 36cdc: 60 83 st Z, r22 36cde: 71 83 std Z+1, r23 ; 0x01 36ce0: 82 83 std Z+2, r24 ; 0x02 36ce2: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 36ce4: ac 14 cp r10, r12 36ce6: bd 04 cpc r11, r13 36ce8: 49 f7 brne .-46 ; 0x36cbc { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 36cea: 2e e6 ldi r18, 0x6E ; 110 36cec: 22 9d mul r18, r2 36cee: c0 01 movw r24, r0 36cf0: 23 9d mul r18, r3 36cf2: 90 0d add r25, r0 36cf4: 11 24 eor r1, r1 36cf6: 9c 01 movw r18, r24 36cf8: 2b 53 subi r18, 0x3B ; 59 36cfa: 39 4f sbci r19, 0xF9 ; 249 36cfc: 79 01 movw r14, r18 36cfe: 29 a5 ldd r18, Y+41 ; 0x29 36d00: 3d a5 ldd r19, Y+45 ; 0x2d 36d02: a8 01 movw r20, r16 36d04: 6d a9 ldd r22, Y+53 ; 0x35 36d06: 7e a9 ldd r23, Y+54 ; 0x36 36d08: 8f a9 ldd r24, Y+55 ; 0x37 36d0a: 98 ad ldd r25, Y+56 ; 0x38 36d0c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36d10: d7 01 movw r26, r14 36d12: 91 96 adiw r26, 0x21 ; 33 36d14: 6d 93 st X+, r22 36d16: 7d 93 st X+, r23 36d18: 8d 93 st X+, r24 36d1a: 9c 93 st X, r25 36d1c: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 36d1e: 62 96 adiw r28, 0x12 ; 18 36d20: 6c ad ldd r22, Y+60 ; 0x3c 36d22: 7d ad ldd r23, Y+61 ; 0x3d 36d24: 8e ad ldd r24, Y+62 ; 0x3e 36d26: 9f ad ldd r25, Y+63 ; 0x3f 36d28: 62 97 sbiw r28, 0x12 ; 18 36d2a: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 36d2e: 29 a5 ldd r18, Y+41 ; 0x29 36d30: 3d a5 ldd r19, Y+45 ; 0x2d 36d32: a8 01 movw r20, r16 36d34: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36d38: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 36d3c: f7 01 movw r30, r14 36d3e: 66 ab std Z+54, r22 ; 0x36 36d40: 77 ab std Z+55, r23 ; 0x37 36d42: 80 af std Z+56, r24 ; 0x38 36d44: 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; 36d46: a3 01 movw r20, r6 36d48: 92 01 movw r18, r4 36d4a: 69 ad ldd r22, Y+57 ; 0x39 36d4c: 7a ad ldd r23, Y+58 ; 0x3a 36d4e: 8b ad ldd r24, Y+59 ; 0x3b 36d50: 9c ad ldd r25, Y+60 ; 0x3c 36d52: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 36d56: 69 a7 std Y+41, r22 ; 0x29 36d58: 7a a7 std Y+42, r23 ; 0x2a 36d5a: 8b a7 std Y+43, r24 ; 0x2b 36d5c: 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) 36d5e: 2e 96 adiw r28, 0x0e ; 14 36d60: 2c ad ldd r18, Y+60 ; 0x3c 36d62: 3d ad ldd r19, Y+61 ; 0x3d 36d64: 4e ad ldd r20, Y+62 ; 0x3e 36d66: 5f ad ldd r21, Y+63 ; 0x3f 36d68: 2e 97 sbiw r28, 0x0e ; 14 36d6a: 23 2b or r18, r19 36d6c: 24 2b or r18, r20 36d6e: 25 2b or r18, r21 36d70: 09 f0 breq .+2 ; 0x36d74 36d72: b9 c5 rjmp .+2930 ; 0x378e6 36d74: 8e e6 ldi r24, 0x6E ; 110 36d76: 82 9d mul r24, r2 36d78: 80 01 movw r16, r0 36d7a: 83 9d mul r24, r3 36d7c: 10 0d add r17, r0 36d7e: 11 24 eor r1, r1 36d80: 0b 53 subi r16, 0x3B ; 59 36d82: 19 4f sbci r17, 0xF9 ; 249 36d84: f8 01 movw r30, r16 36d86: 84 81 ldd r24, Z+4 ; 0x04 36d88: 95 81 ldd r25, Z+5 ; 0x05 36d8a: a6 81 ldd r26, Z+6 ; 0x06 36d8c: b7 81 ldd r27, Z+7 ; 0x07 36d8e: 89 2b or r24, r25 36d90: 8a 2b or r24, r26 36d92: 8b 2b or r24, r27 36d94: 09 f0 breq .+2 ; 0x36d98 36d96: a7 c5 rjmp .+2894 ; 0x378e6 36d98: 80 85 ldd r24, Z+8 ; 0x08 36d9a: 91 85 ldd r25, Z+9 ; 0x09 36d9c: a2 85 ldd r26, Z+10 ; 0x0a 36d9e: b3 85 ldd r27, Z+11 ; 0x0b 36da0: 89 2b or r24, r25 36da2: 8a 2b or r24, r26 36da4: 8b 2b or r24, r27 36da6: 09 f0 breq .+2 ; 0x36daa 36da8: 9e c5 rjmp .+2876 ; 0x378e6 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 36daa: 20 91 f6 0d lds r18, 0x0DF6 ; 0x800df6 36dae: 30 91 f7 0d lds r19, 0x0DF7 ; 0x800df7 36db2: 40 91 f8 0d lds r20, 0x0DF8 ; 0x800df8 36db6: 50 91 f9 0d lds r21, 0x0DF9 ; 0x800df9 36dba: 69 a5 ldd r22, Y+41 ; 0x29 36dbc: 7a a5 ldd r23, Y+42 ; 0x2a 36dbe: 8b a5 ldd r24, Y+43 ; 0x2b 36dc0: 9c a5 ldd r25, Y+44 ; 0x2c 36dc2: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36dc6: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 36dca: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 36dce: 2b 01 movw r4, r22 36dd0: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 36dd2: f8 01 movw r30, r16 36dd4: e4 5b subi r30, 0xB4 ; 180 36dd6: ff 4f sbci r31, 0xFF ; 255 36dd8: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36dda: 6a 96 adiw r28, 0x1a ; 26 36ddc: 1c ae std Y+60, r1 ; 0x3c 36dde: 1d ae std Y+61, r1 ; 0x3d 36de0: 1e ae std Y+62, r1 ; 0x3e 36de2: 1f ae std Y+63, r1 ; 0x3f 36de4: 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; 36de6: 8e e6 ldi r24, 0x6E ; 110 36de8: 82 9d mul r24, r2 36dea: 80 01 movw r16, r0 36dec: 83 9d mul r24, r3 36dee: 10 0d add r17, r0 36df0: 11 24 eor r1, r1 36df2: 0b 53 subi r16, 0x3B ; 59 36df4: 19 4f sbci r17, 0xF9 ; 249 36df6: f8 01 movw r30, r16 36df8: ee 5b subi r30, 0xBE ; 190 36dfa: ff 4f sbci r31, 0xFF ; 255 36dfc: 40 82 st Z, r4 36dfe: 51 82 std Z+1, r5 ; 0x01 36e00: 62 82 std Z+2, r6 ; 0x02 36e02: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 36e04: c3 01 movw r24, r6 36e06: b2 01 movw r22, r4 36e08: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 36e0c: 6b 01 movw r12, r22 36e0e: 7c 01 movw r14, r24 36e10: 29 a5 ldd r18, Y+41 ; 0x29 36e12: 3a a5 ldd r19, Y+42 ; 0x2a 36e14: 4b a5 ldd r20, Y+43 ; 0x2b 36e16: 5c a5 ldd r21, Y+44 ; 0x2c 36e18: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 36e1c: e2 96 adiw r28, 0x32 ; 50 36e1e: 6c af std Y+60, r22 ; 0x3c 36e20: 7d af std Y+61, r23 ; 0x3d 36e22: 8e af std Y+62, r24 ; 0x3e 36e24: 9f af std Y+63, r25 ; 0x3f 36e26: e2 97 sbiw r28, 0x32 ; 50 36e28: f8 01 movw r30, r16 36e2a: 61 ab std Z+49, r22 ; 0x31 36e2c: 72 ab std Z+50, r23 ; 0x32 36e2e: 83 ab std Z+51, r24 ; 0x33 36e30: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 36e32: 2d eb ldi r18, 0xBD ; 189 36e34: 37 e3 ldi r19, 0x37 ; 55 36e36: 46 e0 ldi r20, 0x06 ; 6 36e38: 51 e4 ldi r21, 0x41 ; 65 36e3a: c7 01 movw r24, r14 36e3c: b6 01 movw r22, r12 36e3e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36e42: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 36e46: d8 01 movw r26, r16 36e48: 54 96 adiw r26, 0x14 ; 20 36e4a: 6d 93 st X+, r22 36e4c: 7d 93 st X+, r23 36e4e: 8d 93 st X+, r24 36e50: 9c 93 st X, r25 36e52: 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; 36e54: 91 96 adiw r26, 0x21 ; 33 36e56: bc 91 ld r27, X 36e58: 27 96 adiw r28, 0x07 ; 7 36e5a: bf af std Y+63, r27 ; 0x3f 36e5c: 27 97 sbiw r28, 0x07 ; 7 36e5e: f8 01 movw r30, r16 36e60: f2 a1 ldd r31, Z+34 ; 0x22 36e62: 2b 96 adiw r28, 0x0b ; 11 36e64: ff af std Y+63, r31 ; 0x3f 36e66: 2b 97 sbiw r28, 0x0b ; 11 36e68: d8 01 movw r26, r16 36e6a: 93 96 adiw r26, 0x23 ; 35 36e6c: bc 91 ld r27, X 36e6e: 2f 96 adiw r28, 0x0f ; 15 36e70: bf af std Y+63, r27 ; 0x3f 36e72: 2f 97 sbiw r28, 0x0f ; 15 36e74: f8 01 movw r30, r16 36e76: f4 a1 ldd r31, Z+36 ; 0x24 36e78: 63 96 adiw r28, 0x13 ; 19 36e7a: ff af std Y+63, r31 ; 0x3f 36e7c: 63 97 sbiw r28, 0x13 ; 19 36e7e: 26 e0 ldi r18, 0x06 ; 6 36e80: 3e e0 ldi r19, 0x0E ; 14 36e82: ee 96 adiw r28, 0x3e ; 62 36e84: 3f af std Y+63, r19 ; 0x3f 36e86: 2e af std Y+62, r18 ; 0x3e 36e88: ee 97 sbiw r28, 0x3e ; 62 36e8a: a0 96 adiw r28, 0x20 ; 32 36e8c: 4e ac ldd r4, Y+62 ; 0x3e 36e8e: 5f ac ldd r5, Y+63 ; 0x3f 36e90: a0 97 sbiw r28, 0x20 ; 32 36e92: 30 e1 ldi r19, 0x10 ; 16 36e94: 43 0e add r4, r19 36e96: 51 1c adc r5, r1 36e98: 06 e0 ldi r16, 0x06 ; 6 36e9a: 1e e0 ldi r17, 0x0E ; 14 36e9c: a0 96 adiw r28, 0x20 ; 32 36e9e: 6e ac ldd r6, Y+62 ; 0x3e 36ea0: 7f ac ldd r7, Y+63 ; 0x3f 36ea2: a0 97 sbiw r28, 0x20 ; 32 36ea4: 27 96 adiw r28, 0x07 ; 7 36ea6: 4f ad ldd r20, Y+63 ; 0x3f 36ea8: 27 97 sbiw r28, 0x07 ; 7 36eaa: 49 a7 std Y+41, r20 ; 0x29 36eac: 2b 96 adiw r28, 0x0b ; 11 36eae: 5f ad ldd r21, Y+63 ; 0x3f 36eb0: 2b 97 sbiw r28, 0x0b ; 11 36eb2: 5d a7 std Y+45, r21 ; 0x2d 36eb4: b9 ab std Y+49, r27 ; 0x31 36eb6: f9 af std Y+57, r31 ; 0x39 bool limited = false; 36eb8: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 36eba: d3 01 movw r26, r6 36ebc: 8d 90 ld r8, X+ 36ebe: 9d 90 ld r9, X+ 36ec0: ad 90 ld r10, X+ 36ec2: bd 90 ld r11, X+ 36ec4: 3d 01 movw r6, r26 36ec6: e8 94 clt 36ec8: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 36eca: f8 01 movw r30, r16 36ecc: c1 90 ld r12, Z+ 36ece: d1 90 ld r13, Z+ 36ed0: e1 90 ld r14, Z+ 36ed2: f1 90 ld r15, Z+ 36ed4: 8f 01 movw r16, r30 36ed6: a5 01 movw r20, r10 36ed8: 94 01 movw r18, r8 36eda: c7 01 movw r24, r14 36edc: b6 01 movw r22, r12 36ede: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 36ee2: 87 ff sbrs r24, 7 36ee4: 3a c0 rjmp .+116 ; 0x36f5a // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 36ee6: fd a9 ldd r31, Y+53 ; 0x35 36ee8: ff 23 and r31, r31 36eea: 09 f4 brne .+2 ; 0x36eee 36eec: 7e c6 rjmp .+3324 ; 0x37bea // 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; 36eee: 29 a5 ldd r18, Y+41 ; 0x29 36ef0: 3d a5 ldd r19, Y+45 ; 0x2d 36ef2: 49 a9 ldd r20, Y+49 ; 0x31 36ef4: 59 ad ldd r21, Y+57 ; 0x39 36ef6: c5 01 movw r24, r10 36ef8: b4 01 movw r22, r8 36efa: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36efe: 4b 01 movw r8, r22 36f00: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 36f02: a7 01 movw r20, r14 36f04: 96 01 movw r18, r12 36f06: 27 96 adiw r28, 0x07 ; 7 36f08: 6f ad ldd r22, Y+63 ; 0x3f 36f0a: 27 97 sbiw r28, 0x07 ; 7 36f0c: 2b 96 adiw r28, 0x0b ; 11 36f0e: 7f ad ldd r23, Y+63 ; 0x3f 36f10: 2b 97 sbiw r28, 0x0b ; 11 36f12: 2f 96 adiw r28, 0x0f ; 15 36f14: 8f ad ldd r24, Y+63 ; 0x3f 36f16: 2f 97 sbiw r28, 0x0f ; 15 36f18: 63 96 adiw r28, 0x13 ; 19 36f1a: 9f ad ldd r25, Y+63 ; 0x3f 36f1c: 63 97 sbiw r28, 0x13 ; 19 36f1e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36f22: 6b 01 movw r12, r22 36f24: 7c 01 movw r14, r24 if (jerk > mjerk) { 36f26: ac 01 movw r20, r24 36f28: 9b 01 movw r18, r22 36f2a: c5 01 movw r24, r10 36f2c: b4 01 movw r22, r8 36f2e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 36f32: 18 16 cp r1, r24 36f34: 94 f4 brge .+36 ; 0x36f5a safe_speed *= mjerk / jerk; 36f36: a5 01 movw r20, r10 36f38: 94 01 movw r18, r8 36f3a: c7 01 movw r24, r14 36f3c: b6 01 movw r22, r12 36f3e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 36f42: 9b 01 movw r18, r22 36f44: ac 01 movw r20, r24 36f46: 69 a5 ldd r22, Y+41 ; 0x29 36f48: 7d a5 ldd r23, Y+45 ; 0x2d 36f4a: 89 a9 ldd r24, Y+49 ; 0x31 36f4c: 99 ad ldd r25, Y+57 ; 0x39 36f4e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 36f52: 69 a7 std Y+41, r22 ; 0x29 36f54: 7d a7 std Y+45, r23 ; 0x2d 36f56: 89 ab std Y+49, r24 ; 0x31 36f58: 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) { 36f5a: 46 14 cp r4, r6 36f5c: 57 04 cpc r5, r7 36f5e: 09 f0 breq .+2 ; 0x36f62 36f60: ac cf rjmp .-168 ; 0x36eba } } } // Reset the block flag. block->flag = 0; 36f62: 8e e6 ldi r24, 0x6E ; 110 36f64: 82 9d mul r24, r2 36f66: f0 01 movw r30, r0 36f68: 83 9d mul r24, r3 36f6a: f0 0d add r31, r0 36f6c: 11 24 eor r1, r1 36f6e: eb 53 subi r30, 0x3B ; 59 36f70: f9 4f sbci r31, 0xF9 ; 249 36f72: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 36f74: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.489> 36f78: 88 23 and r24, r24 36f7a: 21 f0 breq .+8 ; 0x36f84 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 36f7c: 80 e1 ldi r24, 0x10 ; 16 36f7e: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 36f80: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.489> 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) { 36f84: 3d ad ldd r19, Y+61 ; 0x3d 36f86: 32 30 cpi r19, 0x02 ; 2 36f88: 08 f4 brcc .+2 ; 0x36f8c 36f8a: 8f c6 rjmp .+3358 ; 0x37caa 36f8c: 40 91 b9 04 lds r20, 0x04B9 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.490> 36f90: 6b 96 adiw r28, 0x1b ; 27 36f92: 4f af std Y+63, r20 ; 0x3f 36f94: 6b 97 sbiw r28, 0x1b ; 27 36f96: 50 91 ba 04 lds r21, 0x04BA ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.490+0x1> 36f9a: 6d 96 adiw r28, 0x1d ; 29 36f9c: 5f af std Y+63, r21 ; 0x3f 36f9e: 6d 97 sbiw r28, 0x1d ; 29 36fa0: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.490+0x2> 36fa4: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.490+0x3> 36fa8: 27 e1 ldi r18, 0x17 ; 23 36faa: 37 eb ldi r19, 0xB7 ; 183 36fac: 41 ed ldi r20, 0xD1 ; 209 36fae: 58 e3 ldi r21, 0x38 ; 56 36fb0: 6b 96 adiw r28, 0x1b ; 27 36fb2: 6f ad ldd r22, Y+63 ; 0x3f 36fb4: 6b 97 sbiw r28, 0x1b ; 27 36fb6: 6d 96 adiw r28, 0x1d ; 29 36fb8: 7f ad ldd r23, Y+63 ; 0x3f 36fba: 6d 97 sbiw r28, 0x1d ; 29 36fbc: c8 01 movw r24, r16 36fbe: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 36fc2: 18 16 cp r1, r24 36fc4: 0c f0 brlt .+2 ; 0x36fc8 36fc6: 71 c6 rjmp .+3298 ; 0x37caa // 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); 36fc8: 6b 96 adiw r28, 0x1b ; 27 36fca: 2f ad ldd r18, Y+63 ; 0x3f 36fcc: 6b 97 sbiw r28, 0x1b ; 27 36fce: 6d 96 adiw r28, 0x1d ; 29 36fd0: 3f ad ldd r19, Y+63 ; 0x3f 36fd2: 6d 97 sbiw r28, 0x1d ; 29 36fd4: a8 01 movw r20, r16 36fd6: 27 96 adiw r28, 0x07 ; 7 36fd8: 6f ad ldd r22, Y+63 ; 0x3f 36fda: 27 97 sbiw r28, 0x07 ; 7 36fdc: 2b 96 adiw r28, 0x0b ; 11 36fde: 7f ad ldd r23, Y+63 ; 0x3f 36fe0: 2b 97 sbiw r28, 0x0b ; 11 36fe2: 2f 96 adiw r28, 0x0f ; 15 36fe4: 8f ad ldd r24, Y+63 ; 0x3f 36fe6: 2f 97 sbiw r28, 0x0f ; 15 36fe8: 63 96 adiw r28, 0x13 ; 19 36fea: 9f ad ldd r25, Y+63 ; 0x3f 36fec: 63 97 sbiw r28, 0x13 ; 19 36fee: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 36ff2: 87 ff sbrs r24, 7 36ff4: 01 c6 rjmp .+3074 ; 0x37bf8 36ff6: 6b 96 adiw r28, 0x1b ; 27 36ff8: 2f ad ldd r18, Y+63 ; 0x3f 36ffa: 6b 97 sbiw r28, 0x1b ; 27 36ffc: 6d 96 adiw r28, 0x1d ; 29 36ffe: 3f ad ldd r19, Y+63 ; 0x3f 37000: 6d 97 sbiw r28, 0x1d ; 29 37002: a8 01 movw r20, r16 37004: 27 96 adiw r28, 0x07 ; 7 37006: 6f ad ldd r22, Y+63 ; 0x3f 37008: 27 97 sbiw r28, 0x07 ; 7 3700a: 2b 96 adiw r28, 0x0b ; 11 3700c: 7f ad ldd r23, Y+63 ; 0x3f 3700e: 2b 97 sbiw r28, 0x0b ; 11 37010: 2f 96 adiw r28, 0x0f ; 15 37012: 8f ad ldd r24, Y+63 ; 0x3f 37014: 2f 97 sbiw r28, 0x0f ; 15 37016: 63 96 adiw r28, 0x13 ; 19 37018: 9f ad ldd r25, Y+63 ; 0x3f 3701a: 63 97 sbiw r28, 0x13 ; 19 3701c: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 37020: ec 96 adiw r28, 0x3c ; 60 37022: 6c af std Y+60, r22 ; 0x3c 37024: 7d af std Y+61, r23 ; 0x3d 37026: 8e af std Y+62, r24 ; 0x3e 37028: 9f af std Y+63, r25 ; 0x3f 3702a: 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; 3702c: 27 96 adiw r28, 0x07 ; 7 3702e: 8f ad ldd r24, Y+63 ; 0x3f 37030: 27 97 sbiw r28, 0x07 ; 7 37032: 8d af std Y+61, r24 ; 0x3d 37034: 2b 96 adiw r28, 0x0b ; 11 37036: 9f ad ldd r25, Y+63 ; 0x3f 37038: 2b 97 sbiw r28, 0x0b ; 11 3703a: 9d ab std Y+53, r25 ; 0x35 3703c: 2f 96 adiw r28, 0x0f ; 15 3703e: af ad ldd r26, Y+63 ; 0x3f 37040: 2f 97 sbiw r28, 0x0f ; 15 37042: ae af std Y+62, r26 ; 0x3e 37044: 63 96 adiw r28, 0x13 ; 19 37046: bf ad ldd r27, Y+63 ; 0x3f 37048: 63 97 sbiw r28, 0x13 ; 19 3704a: 23 96 adiw r28, 0x03 ; 3 3704c: bf af std Y+63, r27 ; 0x3f 3704e: 23 97 sbiw r28, 0x03 ; 3 37050: 2d eb ldi r18, 0xBD ; 189 37052: 34 e0 ldi r19, 0x04 ; 4 37054: e8 96 adiw r28, 0x38 ; 56 37056: 3f af std Y+63, r19 ; 0x3f 37058: 2e af std Y+62, r18 ; 0x3e 3705a: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 3705c: 41 2c mov r4, r1 3705e: 51 2c mov r5, r1 37060: 30 e8 ldi r19, 0x80 ; 128 37062: 63 2e mov r6, r19 37064: 3f e3 ldi r19, 0x3F ; 63 37066: 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]; 37068: e8 96 adiw r28, 0x38 ; 56 3706a: ae ad ldd r26, Y+62 ; 0x3e 3706c: bf ad ldd r27, Y+63 ; 0x3f 3706e: e8 97 sbiw r28, 0x38 ; 56 37070: 8d 90 ld r8, X+ 37072: 9d 90 ld r9, X+ 37074: ad 90 ld r10, X+ 37076: bd 90 ld r11, X+ 37078: e8 96 adiw r28, 0x38 ; 56 3707a: bf af std Y+63, r27 ; 0x3f 3707c: ae af std Y+62, r26 ; 0x3e 3707e: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 37080: a0 96 adiw r28, 0x20 ; 32 37082: ee ad ldd r30, Y+62 ; 0x3e 37084: ff ad ldd r31, Y+63 ; 0x3f 37086: a0 97 sbiw r28, 0x20 ; 32 37088: c1 90 ld r12, Z+ 3708a: d1 90 ld r13, Z+ 3708c: e1 90 ld r14, Z+ 3708e: f1 90 ld r15, Z+ 37090: a0 96 adiw r28, 0x20 ; 32 37092: ff af std Y+63, r31 ; 0x3f 37094: ee af std Y+62, r30 ; 0x3e 37096: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 37098: 6b 96 adiw r28, 0x1b ; 27 3709a: 2f ad ldd r18, Y+63 ; 0x3f 3709c: 6b 97 sbiw r28, 0x1b ; 27 3709e: 6d 96 adiw r28, 0x1d ; 29 370a0: 3f ad ldd r19, Y+63 ; 0x3f 370a2: 6d 97 sbiw r28, 0x1d ; 29 370a4: a8 01 movw r20, r16 370a6: 27 96 adiw r28, 0x07 ; 7 370a8: 6f ad ldd r22, Y+63 ; 0x3f 370aa: 27 97 sbiw r28, 0x07 ; 7 370ac: 2b 96 adiw r28, 0x0b ; 11 370ae: 7f ad ldd r23, Y+63 ; 0x3f 370b0: 2b 97 sbiw r28, 0x0b ; 11 370b2: 2f 96 adiw r28, 0x0f ; 15 370b4: 8f ad ldd r24, Y+63 ; 0x3f 370b6: 2f 97 sbiw r28, 0x0f ; 15 370b8: 63 96 adiw r28, 0x13 ; 19 370ba: 9f ad ldd r25, Y+63 ; 0x3f 370bc: 63 97 sbiw r28, 0x13 ; 19 370be: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 370c2: 87 ff sbrs r24, 7 370c4: 0c c0 rjmp .+24 ; 0x370de v_exit *= smaller_speed_factor; 370c6: ec 96 adiw r28, 0x3c ; 60 370c8: 2c ad ldd r18, Y+60 ; 0x3c 370ca: 3d ad ldd r19, Y+61 ; 0x3d 370cc: 4e ad ldd r20, Y+62 ; 0x3e 370ce: 5f ad ldd r21, Y+63 ; 0x3f 370d0: ec 97 sbiw r28, 0x3c ; 60 370d2: c5 01 movw r24, r10 370d4: b4 01 movw r22, r8 370d6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 370da: 4b 01 movw r8, r22 370dc: 5c 01 movw r10, r24 if (limited) { 370de: a2 96 adiw r28, 0x22 ; 34 370e0: ff ad ldd r31, Y+63 ; 0x3f 370e2: a2 97 sbiw r28, 0x22 ; 34 370e4: ff 23 and r31, r31 370e6: 81 f0 breq .+32 ; 0x37108 v_exit *= v_factor; 370e8: a3 01 movw r20, r6 370ea: 92 01 movw r18, r4 370ec: c5 01 movw r24, r10 370ee: b4 01 movw r22, r8 370f0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 370f4: 4b 01 movw r8, r22 370f6: 5c 01 movw r10, r24 v_entry *= v_factor; 370f8: a3 01 movw r20, r6 370fa: 92 01 movw r18, r4 370fc: c7 01 movw r24, r14 370fe: b6 01 movw r22, r12 37100: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37104: 6b 01 movw r12, r22 37106: 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) ? 37108: a7 01 movw r20, r14 3710a: 96 01 movw r18, r12 3710c: c5 01 movw r24, r10 3710e: b4 01 movw r22, r8 37110: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 37114: 20 e0 ldi r18, 0x00 ; 0 37116: 30 e0 ldi r19, 0x00 ; 0 37118: 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) ? 3711a: 18 16 cp r1, r24 3711c: 0c f0 brlt .+2 ; 0x37120 3711e: a3 c5 rjmp .+2886 ; 0x37c66 ((v_entry > 0.f || v_exit < 0.f) ? 37120: c7 01 movw r24, r14 37122: b6 01 movw r22, r12 37124: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37128: 18 16 cp r1, r24 3712a: 4c f0 brlt .+18 ; 0x3713e 3712c: 20 e0 ldi r18, 0x00 ; 0 3712e: 30 e0 ldi r19, 0x00 ; 0 37130: a9 01 movw r20, r18 37132: c5 01 movw r24, r10 37134: b4 01 movw r22, r8 37136: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 3713a: 87 ff sbrs r24, 7 3713c: 85 c5 rjmp .+2826 ; 0x37c48 3713e: a7 01 movw r20, r14 37140: 96 01 movw r18, r12 37142: c5 01 movw r24, r10 37144: 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) ? 37146: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3714a: 6b 01 movw r12, r22 3714c: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 3714e: ee 96 adiw r28, 0x3e ; 62 37150: ae ad ldd r26, Y+62 ; 0x3e 37152: bf ad ldd r27, Y+63 ; 0x3f 37154: ee 97 sbiw r28, 0x3e ; 62 37156: 8d 90 ld r8, X+ 37158: 9d 90 ld r9, X+ 3715a: ad 90 ld r10, X+ 3715c: bd 90 ld r11, X+ 3715e: ee 96 adiw r28, 0x3e ; 62 37160: bf af std Y+63, r27 ; 0x3f 37162: ae af std Y+62, r26 ; 0x3e 37164: ee 97 sbiw r28, 0x3e ; 62 37166: a5 01 movw r20, r10 37168: 94 01 movw r18, r8 3716a: c7 01 movw r24, r14 3716c: b6 01 movw r22, r12 3716e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37172: 18 16 cp r1, r24 37174: 94 f4 brge .+36 ; 0x3719a v_factor *= cs.max_jerk[axis] / jerk; 37176: a7 01 movw r20, r14 37178: 96 01 movw r18, r12 3717a: c5 01 movw r24, r10 3717c: b4 01 movw r22, r8 3717e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 37182: 9b 01 movw r18, r22 37184: ac 01 movw r20, r24 37186: c3 01 movw r24, r6 37188: b2 01 movw r22, r4 3718a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3718e: 2b 01 movw r4, r22 37190: 3c 01 movw r6, r24 limited = true; 37192: b1 e0 ldi r27, 0x01 ; 1 37194: a2 96 adiw r28, 0x22 ; 34 37196: bf af std Y+63, r27 ; 0x3f 37198: 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) { 3719a: ed ec ldi r30, 0xCD ; 205 3719c: f4 e0 ldi r31, 0x04 ; 4 3719e: e8 96 adiw r28, 0x38 ; 56 371a0: 2e ad ldd r18, Y+62 ; 0x3e 371a2: 3f ad ldd r19, Y+63 ; 0x3f 371a4: e8 97 sbiw r28, 0x38 ; 56 371a6: e2 17 cp r30, r18 371a8: f3 07 cpc r31, r19 371aa: 09 f0 breq .+2 ; 0x371ae 371ac: 5d cf rjmp .-326 ; 0x37068 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 371ae: a2 96 adiw r28, 0x22 ; 34 371b0: 3f ad ldd r19, Y+63 ; 0x3f 371b2: a2 97 sbiw r28, 0x22 ; 34 371b4: 33 23 and r19, r19 371b6: 81 f0 breq .+32 ; 0x371d8 vmax_junction *= v_factor; 371b8: a3 01 movw r20, r6 371ba: 92 01 movw r18, r4 371bc: 6d ad ldd r22, Y+61 ; 0x3d 371be: 7d a9 ldd r23, Y+53 ; 0x35 371c0: 8e ad ldd r24, Y+62 ; 0x3e 371c2: 23 96 adiw r28, 0x03 ; 3 371c4: 9f ad ldd r25, Y+63 ; 0x3f 371c6: 23 97 sbiw r28, 0x03 ; 3 371c8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 371cc: 6d af std Y+61, r22 ; 0x3d 371ce: 7d ab std Y+53, r23 ; 0x35 371d0: 8e af std Y+62, r24 ; 0x3e 371d2: 23 96 adiw r28, 0x03 ; 3 371d4: 9f af std Y+63, r25 ; 0x3f 371d6: 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; 371d8: 24 ea ldi r18, 0xA4 ; 164 371da: 30 e7 ldi r19, 0x70 ; 112 371dc: 4d e7 ldi r20, 0x7D ; 125 371de: 5f e3 ldi r21, 0x3F ; 63 371e0: 6d ad ldd r22, Y+61 ; 0x3d 371e2: 7d a9 ldd r23, Y+53 ; 0x35 371e4: 8e ad ldd r24, Y+62 ; 0x3e 371e6: 23 96 adiw r28, 0x03 ; 3 371e8: 9f ad ldd r25, Y+63 ; 0x3f 371ea: 23 97 sbiw r28, 0x03 ; 3 371ec: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 371f0: 6b 01 movw r12, r22 371f2: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 371f4: ac 01 movw r20, r24 371f6: 9b 01 movw r18, r22 371f8: 60 91 10 18 lds r22, 0x1810 ; 0x801810 371fc: 70 91 11 18 lds r23, 0x1811 ; 0x801811 37200: 80 91 12 18 lds r24, 0x1812 ; 0x801812 37204: 90 91 13 18 lds r25, 0x1813 ; 0x801813 37208: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 3720c: 18 16 cp r1, r24 3720e: fc f4 brge .+62 ; 0x3724e 37210: 29 a5 ldd r18, Y+41 ; 0x29 37212: 3d a5 ldd r19, Y+45 ; 0x2d 37214: 49 a9 ldd r20, Y+49 ; 0x31 37216: 59 ad ldd r21, Y+57 ; 0x39 37218: c7 01 movw r24, r14 3721a: b6 01 movw r22, r12 3721c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37220: 87 ff sbrs r24, 7 37222: 15 c0 rjmp .+42 ; 0x3724e // 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; 37224: 8e e6 ldi r24, 0x6E ; 110 37226: 82 9d mul r24, r2 37228: f0 01 movw r30, r0 3722a: 83 9d mul r24, r3 3722c: f0 0d add r31, r0 3722e: 11 24 eor r1, r1 37230: eb 53 subi r30, 0x3B ; 59 37232: f9 4f sbci r31, 0xF9 ; 249 37234: 85 a9 ldd r24, Z+53 ; 0x35 37236: 84 60 ori r24, 0x04 ; 4 37238: 85 ab std Z+53, r24 ; 0x35 3723a: 49 a5 ldd r20, Y+41 ; 0x29 3723c: 4d af std Y+61, r20 ; 0x3d 3723e: 5d a5 ldd r21, Y+45 ; 0x2d 37240: 5d ab std Y+53, r21 ; 0x35 37242: 89 a9 ldd r24, Y+49 ; 0x31 37244: 8e af std Y+62, r24 ; 0x3e 37246: 99 ad ldd r25, Y+57 ; 0x39 37248: 23 96 adiw r28, 0x03 ; 3 3724a: 9f af std Y+63, r25 ; 0x3f 3724c: 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; 3724e: 8e e6 ldi r24, 0x6E ; 110 37250: 82 9d mul r24, r2 37252: 80 01 movw r16, r0 37254: 83 9d mul r24, r3 37256: 10 0d add r17, r0 37258: 11 24 eor r1, r1 3725a: 0b 53 subi r16, 0x3B ; 59 3725c: 19 4f sbci r17, 0xF9 ; 249 3725e: 8d ad ldd r24, Y+61 ; 0x3d 37260: 9d a9 ldd r25, Y+53 ; 0x35 37262: ae ad ldd r26, Y+62 ; 0x3e 37264: 23 96 adiw r28, 0x03 ; 3 37266: bf ad ldd r27, Y+63 ; 0x3f 37268: 23 97 sbiw r28, 0x03 ; 3 3726a: f8 01 movw r30, r16 3726c: 81 a7 std Z+41, r24 ; 0x29 3726e: 92 a7 std Z+42, r25 ; 0x2a 37270: a3 a7 std Z+43, r26 ; 0x2b 37272: 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); 37274: 29 a5 ldd r18, Y+41 ; 0x29 37276: 3d a5 ldd r19, Y+45 ; 0x2d 37278: 49 a9 ldd r20, Y+49 ; 0x31 3727a: 59 ad ldd r21, Y+57 ; 0x39 3727c: 69 a5 ldd r22, Y+41 ; 0x29 3727e: 7d a5 ldd r23, Y+45 ; 0x2d 37280: 89 a9 ldd r24, Y+49 ; 0x31 37282: 99 ad ldd r25, Y+57 ; 0x39 37284: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37288: 6b 01 movw r12, r22 3728a: 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); 3728c: e2 96 adiw r28, 0x32 ; 50 3728e: 6c ad ldd r22, Y+60 ; 0x3c 37290: 7d ad ldd r23, Y+61 ; 0x3d 37292: 8e ad ldd r24, Y+62 ; 0x3e 37294: 9f ad ldd r25, Y+63 ; 0x3f 37296: e2 97 sbiw r28, 0x32 ; 50 37298: 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); 3729a: 9b 01 movw r18, r22 3729c: ac 01 movw r20, r24 3729e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 372a2: d8 01 movw r26, r16 372a4: 9d 96 adiw r26, 0x2d ; 45 372a6: 2d 91 ld r18, X+ 372a8: 3d 91 ld r19, X+ 372aa: 4d 91 ld r20, X+ 372ac: 5c 91 ld r21, X 372ae: d0 97 sbiw r26, 0x30 ; 48 372b0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 372b4: 9b 01 movw r18, r22 372b6: ac 01 movw r20, r24 372b8: c7 01 movw r24, r14 372ba: b6 01 movw r22, r12 372bc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 372c0: 0f 94 4a e1 call 0x3c294 ; 0x3c294 372c4: d6 2e mov r13, r22 372c6: e7 2e mov r14, r23 372c8: 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); 372ca: 2d ad ldd r18, Y+61 ; 0x3d 372cc: 3d a9 ldd r19, Y+53 ; 0x35 372ce: 4e ad ldd r20, Y+62 ; 0x3e 372d0: 23 96 adiw r28, 0x03 ; 3 372d2: 5f ad ldd r21, Y+63 ; 0x3f 372d4: 23 97 sbiw r28, 0x03 ; 3 372d6: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 372da: 18 16 cp r1, r24 372dc: 34 f0 brlt .+12 ; 0x372ea 372de: dd ae std Y+61, r13 ; 0x3d 372e0: ed aa std Y+53, r14 ; 0x35 372e2: 0e af std Y+62, r16 ; 0x3e 372e4: 23 96 adiw r28, 0x03 ; 3 372e6: 1f af std Y+63, r17 ; 0x3f 372e8: 23 97 sbiw r28, 0x03 ; 3 372ea: 8e e6 ldi r24, 0x6E ; 110 372ec: 82 9d mul r24, r2 372ee: f0 01 movw r30, r0 372f0: 83 9d mul r24, r3 372f2: f0 0d add r31, r0 372f4: 11 24 eor r1, r1 372f6: eb 53 subi r30, 0x3B ; 59 372f8: f9 4f sbci r31, 0xF9 ; 249 372fa: 8d ad ldd r24, Y+61 ; 0x3d 372fc: 9d a9 ldd r25, Y+53 ; 0x35 372fe: ae ad ldd r26, Y+62 ; 0x3e 37300: 23 96 adiw r28, 0x03 ; 3 37302: bf ad ldd r27, Y+63 ; 0x3f 37304: 23 97 sbiw r28, 0x03 ; 3 37306: 85 a3 std Z+37, r24 ; 0x25 37308: 96 a3 std Z+38, r25 ; 0x26 3730a: a7 a3 std Z+39, r26 ; 0x27 3730c: 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; 3730e: f5 a8 ldd r15, Z+53 ; 0x35 37310: 2d 2d mov r18, r13 37312: 3e 2d mov r19, r14 37314: a8 01 movw r20, r16 37316: 27 96 adiw r28, 0x07 ; 7 37318: 6f ad ldd r22, Y+63 ; 0x3f 3731a: 27 97 sbiw r28, 0x07 ; 7 3731c: 2b 96 adiw r28, 0x0b ; 11 3731e: 7f ad ldd r23, Y+63 ; 0x3f 37320: 2b 97 sbiw r28, 0x0b ; 11 37322: 2f 96 adiw r28, 0x0f ; 15 37324: 8f ad ldd r24, Y+63 ; 0x3f 37326: 2f 97 sbiw r28, 0x0f ; 15 37328: 63 96 adiw r28, 0x13 ; 19 3732a: 9f ad ldd r25, Y+63 ; 0x3f 3732c: 63 97 sbiw r28, 0x13 ; 19 3732e: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37332: 18 16 cp r1, r24 37334: 0c f4 brge .+2 ; 0x37338 37336: cf c4 rjmp .+2462 ; 0x37cd6 37338: 83 e0 ldi r24, 0x03 ; 3 3733a: 9e e6 ldi r25, 0x6E ; 110 3733c: 92 9d mul r25, r2 3733e: 80 01 movw r16, r0 37340: 93 9d mul r25, r3 37342: 10 0d add r17, r0 37344: 11 24 eor r1, r1 37346: 0b 53 subi r16, 0x3B ; 59 37348: 19 4f sbci r17, 0xF9 ; 249 3734a: f8 2a or r15, r24 3734c: f8 01 movw r30, r16 3734e: 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[] 37350: 80 e1 ldi r24, 0x10 ; 16 37352: fe 01 movw r30, r28 37354: 71 96 adiw r30, 0x11 ; 17 37356: ad eb ldi r26, 0xBD ; 189 37358: b4 e0 ldi r27, 0x04 ; 4 3735a: 01 90 ld r0, Z+ 3735c: 0d 92 st X+, r0 3735e: 8a 95 dec r24 37360: e1 f7 brne .-8 ; 0x3735a previous_nominal_speed = block->nominal_speed; 37362: 27 96 adiw r28, 0x07 ; 7 37364: 8f ad ldd r24, Y+63 ; 0x3f 37366: 27 97 sbiw r28, 0x07 ; 7 37368: 2b 96 adiw r28, 0x0b ; 11 3736a: 9f ad ldd r25, Y+63 ; 0x3f 3736c: 2b 97 sbiw r28, 0x0b ; 11 3736e: 2f 96 adiw r28, 0x0f ; 15 37370: af ad ldd r26, Y+63 ; 0x3f 37372: 2f 97 sbiw r28, 0x0f ; 15 37374: 63 96 adiw r28, 0x13 ; 19 37376: bf ad ldd r27, Y+63 ; 0x3f 37378: 63 97 sbiw r28, 0x13 ; 19 3737a: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.490> 3737e: 90 93 ba 04 sts 0x04BA, r25 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.490+0x1> 37382: a0 93 bb 04 sts 0x04BB, r26 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.490+0x2> 37386: b0 93 bc 04 sts 0x04BC, r27 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.490+0x3> previous_safe_speed = safe_speed; 3738a: 89 a5 ldd r24, Y+41 ; 0x29 3738c: 9d a5 ldd r25, Y+45 ; 0x2d 3738e: a9 a9 ldd r26, Y+49 ; 0x31 37390: b9 ad ldd r27, Y+57 ; 0x39 37392: 80 93 10 18 sts 0x1810, r24 ; 0x801810 37396: 90 93 11 18 sts 0x1811, r25 ; 0x801811 3739a: a0 93 12 18 sts 0x1812, r26 ; 0x801812 3739e: b0 93 13 18 sts 0x1813, r27 ; 0x801813 // 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; 373a2: d8 01 movw r26, r16 373a4: d6 96 adiw r26, 0x36 ; 54 373a6: 6d 91 ld r22, X+ 373a8: 7d 91 ld r23, X+ 373aa: 8d 91 ld r24, X+ 373ac: 9c 91 ld r25, X 373ae: d9 97 sbiw r26, 0x39 ; 57 373b0: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 373b4: 27 96 adiw r28, 0x07 ; 7 373b6: 2f ad ldd r18, Y+63 ; 0x3f 373b8: 27 97 sbiw r28, 0x07 ; 7 373ba: 2b 96 adiw r28, 0x0b ; 11 373bc: 3f ad ldd r19, Y+63 ; 0x3f 373be: 2b 97 sbiw r28, 0x0b ; 11 373c0: 2f 96 adiw r28, 0x0f ; 15 373c2: 4f ad ldd r20, Y+63 ; 0x3f 373c4: 2f 97 sbiw r28, 0x0f ; 15 373c6: 63 96 adiw r28, 0x13 ; 19 373c8: 5f ad ldd r21, Y+63 ; 0x3f 373ca: 63 97 sbiw r28, 0x13 ; 19 373cc: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 373d0: 2b 01 movw r4, r22 373d2: 3c 01 movw r6, r24 373d4: f8 01 movw r30, r16 373d6: e8 5b subi r30, 0xB8 ; 184 373d8: ff 4f sbci r31, 0xFF ; 255 373da: 40 82 st Z, r4 373dc: 51 82 std Z+1, r5 ; 0x01 373de: 62 82 std Z+2, r6 ; 0x02 373e0: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 373e2: 34 96 adiw r30, 0x04 ; 4 373e4: 80 81 ld r24, Z 373e6: 88 23 and r24, r24 373e8: 09 f4 brne .+2 ; 0x373ec 373ea: 89 c0 rjmp .+274 ; 0x374fe // 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)) 373ec: 20 91 65 05 lds r18, 0x0565 ; 0x800565 373f0: 30 91 66 05 lds r19, 0x0566 ; 0x800566 373f4: 40 91 67 05 lds r20, 0x0567 ; 0x800567 373f8: 50 91 68 05 lds r21, 0x0568 ; 0x800568 373fc: 6a 96 adiw r28, 0x1a ; 26 373fe: 6c ad ldd r22, Y+60 ; 0x3c 37400: 7d ad ldd r23, Y+61 ; 0x3d 37402: 8e ad ldd r24, Y+62 ; 0x3e 37404: 9f ad ldd r25, Y+63 ; 0x3f 37406: 6a 97 sbiw r28, 0x1a ; 26 37408: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3740c: 4b 01 movw r8, r22 3740e: 5c 01 movw r10, r24 37410: c0 90 ce 0d lds r12, 0x0DCE ; 0x800dce 37414: d0 90 cf 0d lds r13, 0x0DCF ; 0x800dcf 37418: e0 90 d0 0d lds r14, 0x0DD0 ; 0x800dd0 3741c: f0 90 d1 0d lds r15, 0x0DD1 ; 0x800dd1 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 37420: 0c 5a subi r16, 0xAC ; 172 37422: 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)) 37424: a7 01 movw r20, r14 37426: 96 01 movw r18, r12 37428: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 3742c: a3 01 movw r20, r6 3742e: 92 01 movw r18, r4 37430: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 37434: f8 01 movw r30, r16 37436: 60 83 st Z, r22 37438: 71 83 std Z+1, r23 ; 0x01 3743a: 82 83 std Z+2, r24 ; 0x02 3743c: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 3743e: 20 e0 ldi r18, 0x00 ; 0 37440: 30 e0 ldi r19, 0x00 ; 0 37442: a9 01 movw r20, r18 37444: 6a 96 adiw r28, 0x1a ; 26 37446: 6c ad ldd r22, Y+60 ; 0x3c 37448: 7d ad ldd r23, Y+61 ; 0x3d 3744a: 8e ad ldd r24, Y+62 ; 0x3e 3744c: 9f ad ldd r25, Y+63 ; 0x3f 3744e: 6a 97 sbiw r28, 0x1a ; 26 37450: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37454: 18 16 cp r1, r24 37456: 0c f0 brlt .+2 ; 0x3745a 37458: 40 c4 rjmp .+2176 ; 0x37cda advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 3745a: a5 01 movw r20, r10 3745c: 94 01 movw r18, r8 3745e: e2 96 adiw r28, 0x32 ; 50 37460: 6c ad ldd r22, Y+60 ; 0x3c 37462: 7d ad ldd r23, Y+61 ; 0x3d 37464: 8e ad ldd r24, Y+62 ; 0x3e 37466: 9f ad ldd r25, Y+63 ; 0x3f 37468: e2 97 sbiw r28, 0x32 ; 50 3746a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3746e: a7 01 movw r20, r14 37470: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 37472: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37476: 6b 01 movw r12, r22 37478: 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; 3747a: 20 e0 ldi r18, 0x00 ; 0 3747c: 30 e4 ldi r19, 0x40 ; 64 3747e: 4c e1 ldi r20, 0x1C ; 28 37480: 57 e4 ldi r21, 0x47 ; 71 37482: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37486: 18 16 cp r1, r24 37488: 3c f4 brge .+14 ; 0x37498 3748a: c1 2c mov r12, r1 3748c: 20 e4 ldi r18, 0x40 ; 64 3748e: d2 2e mov r13, r18 37490: 2c e1 ldi r18, 0x1C ; 28 37492: e2 2e mov r14, r18 37494: 27 e4 ldi r18, 0x47 ; 71 37496: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 37498: a7 01 movw r20, r14 3749a: 96 01 movw r18, r12 3749c: 60 e0 ldi r22, 0x00 ; 0 3749e: 74 e2 ldi r23, 0x24 ; 36 374a0: 84 ef ldi r24, 0xF4 ; 244 374a2: 99 e4 ldi r25, 0x49 ; 73 374a4: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 374a8: 4b 01 movw r8, r22 374aa: 5c 01 movw r10, r24 if (advance_speed > 20000) { 374ac: 20 e0 ldi r18, 0x00 ; 0 374ae: 30 e4 ldi r19, 0x40 ; 64 374b0: 4c e9 ldi r20, 0x9C ; 156 374b2: 56 e4 ldi r21, 0x46 ; 70 374b4: c7 01 movw r24, r14 374b6: b6 01 movw r22, r12 374b8: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 374bc: 18 16 cp r1, r24 374be: 0c f0 brlt .+2 ; 0x374c2 374c0: 17 c4 rjmp .+2094 ; 0x37cf0 block->advance_rate = advance_rate * 4; 374c2: 8e e6 ldi r24, 0x6E ; 110 374c4: 82 9d mul r24, r2 374c6: 80 01 movw r16, r0 374c8: 83 9d mul r24, r3 374ca: 10 0d add r17, r0 374cc: 11 24 eor r1, r1 374ce: 0b 53 subi r16, 0x3B ; 59 374d0: 19 4f sbci r17, 0xF9 ; 249 374d2: 78 01 movw r14, r16 374d4: fd e4 ldi r31, 0x4D ; 77 374d6: ef 0e add r14, r31 374d8: f1 1c adc r15, r1 374da: 20 e0 ldi r18, 0x00 ; 0 374dc: 30 e0 ldi r19, 0x00 ; 0 374de: 40 e8 ldi r20, 0x80 ; 128 374e0: 50 e4 ldi r21, 0x40 ; 64 374e2: c5 01 movw r24, r10 374e4: b4 01 movw r22, r8 374e6: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 374ea: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 374ee: d7 01 movw r26, r14 374f0: 6d 93 st X+, r22 374f2: 7c 93 st X, r23 block->advance_step_loops = 4; 374f4: f8 01 movw r30, r16 374f6: ed 5a subi r30, 0xAD ; 173 374f8: ff 4f sbci r31, 0xFF ; 255 374fa: 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; 374fc: 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); 374fe: 09 a5 ldd r16, Y+41 ; 0x29 37500: 1d a5 ldd r17, Y+45 ; 0x2d 37502: 29 a9 ldd r18, Y+49 ; 0x31 37504: 39 ad ldd r19, Y+57 ; 0x39 37506: 4d ad ldd r20, Y+61 ; 0x3d 37508: 5d a9 ldd r21, Y+53 ; 0x35 3750a: 6e ad ldd r22, Y+62 ; 0x3e 3750c: 23 96 adiw r28, 0x03 ; 3 3750e: 7f ad ldd r23, Y+63 ; 0x3f 37510: 23 97 sbiw r28, 0x03 ; 3 37512: a4 96 adiw r28, 0x24 ; 36 37514: 8e ad ldd r24, Y+62 ; 0x3e 37516: 9f ad ldd r25, Y+63 ; 0x3f 37518: a4 97 sbiw r28, 0x24 ; 36 3751a: 8b 53 subi r24, 0x3B ; 59 3751c: 99 4f sbci r25, 0xF9 ; 249 3751e: 0f 94 8d ae call 0x35d1a ; 0x35d1a if (block->step_event_count.wide <= 32767) 37522: 8e e6 ldi r24, 0x6E ; 110 37524: 82 9d mul r24, r2 37526: f0 01 movw r30, r0 37528: 83 9d mul r24, r3 3752a: f0 0d add r31, r0 3752c: 11 24 eor r1, r1 3752e: eb 53 subi r30, 0x3B ; 59 37530: f9 4f sbci r31, 0xF9 ; 249 37532: 80 89 ldd r24, Z+16 ; 0x10 37534: 91 89 ldd r25, Z+17 ; 0x11 37536: a2 89 ldd r26, Z+18 ; 0x12 37538: b3 89 ldd r27, Z+19 ; 0x13 3753a: 81 15 cp r24, r1 3753c: 90 48 sbci r25, 0x80 ; 128 3753e: a1 05 cpc r26, r1 37540: b1 05 cpc r27, r1 37542: 18 f4 brcc .+6 ; 0x3754a block->flag |= BLOCK_FLAG_DDA_LOWRES; 37544: 85 a9 ldd r24, Z+53 ; 0x35 37546: 88 60 ori r24, 0x08 ; 8 37548: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 3754a: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 3754c: 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; 3754e: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 37552: 91 11 cpse r25, r1 37554: 93 c4 rjmp .+2342 ; 0x37e7c block_buffer_head = next_buffer_head; 37556: a1 96 adiw r28, 0x21 ; 33 37558: 3f ad ldd r19, Y+63 ; 0x3f 3755a: a1 97 sbiw r28, 0x21 ; 33 3755c: 30 93 a5 0d sts 0x0DA5, r19 ; 0x800da5 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 37560: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 37562: c2 58 subi r28, 0x82 ; 130 37564: df 4f sbci r29, 0xFF ; 255 37566: 88 81 ld r24, Y 37568: 99 81 ldd r25, Y+1 ; 0x01 3756a: aa 81 ldd r26, Y+2 ; 0x02 3756c: bb 81 ldd r27, Y+3 ; 0x03 3756e: ce 57 subi r28, 0x7E ; 126 37570: d0 40 sbci r29, 0x00 ; 0 37572: 80 93 a3 06 sts 0x06A3, r24 ; 0x8006a3 37576: 90 93 a4 06 sts 0x06A4, r25 ; 0x8006a4 3757a: a0 93 a5 06 sts 0x06A5, r26 ; 0x8006a5 3757e: b0 93 a6 06 sts 0x06A6, r27 ; 0x8006a6 37582: ce 57 subi r28, 0x7E ; 126 37584: df 4f sbci r29, 0xFF ; 255 37586: 28 81 ld r18, Y 37588: 39 81 ldd r19, Y+1 ; 0x01 3758a: 4a 81 ldd r20, Y+2 ; 0x02 3758c: 5b 81 ldd r21, Y+3 ; 0x03 3758e: c2 58 subi r28, 0x82 ; 130 37590: d0 40 sbci r29, 0x00 ; 0 37592: 20 93 a7 06 sts 0x06A7, r18 ; 0x8006a7 37596: 30 93 a8 06 sts 0x06A8, r19 ; 0x8006a8 3759a: 40 93 a9 06 sts 0x06A9, r20 ; 0x8006a9 3759e: 50 93 aa 06 sts 0x06AA, r21 ; 0x8006aa 375a2: e6 96 adiw r28, 0x36 ; 54 375a4: 8c ad ldd r24, Y+60 ; 0x3c 375a6: 9d ad ldd r25, Y+61 ; 0x3d 375a8: ae ad ldd r26, Y+62 ; 0x3e 375aa: bf ad ldd r27, Y+63 ; 0x3f 375ac: e6 97 sbiw r28, 0x36 ; 54 375ae: 80 93 ab 06 sts 0x06AB, r24 ; 0x8006ab 375b2: 90 93 ac 06 sts 0x06AC, r25 ; 0x8006ac 375b6: a0 93 ad 06 sts 0x06AD, r26 ; 0x8006ad 375ba: b0 93 ae 06 sts 0x06AE, r27 ; 0x8006ae 375be: ae 96 adiw r28, 0x2e ; 46 375c0: 2c ad ldd r18, Y+60 ; 0x3c 375c2: 3d ad ldd r19, Y+61 ; 0x3d 375c4: 4e ad ldd r20, Y+62 ; 0x3e 375c6: 5f ad ldd r21, Y+63 ; 0x3f 375c8: ae 97 sbiw r28, 0x2e ; 46 375ca: 20 93 af 06 sts 0x06AF, r18 ; 0x8006af 375ce: 30 93 b0 06 sts 0x06B0, r19 ; 0x8006b0 375d2: 40 93 b1 06 sts 0x06B1, r20 ; 0x8006b1 375d6: 50 93 b2 06 sts 0x06B2, r21 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 375da: 89 a1 ldd r24, Y+33 ; 0x21 375dc: 9a a1 ldd r25, Y+34 ; 0x22 375de: ab a1 ldd r26, Y+35 ; 0x23 375e0: bc a1 ldd r27, Y+36 ; 0x24 375e2: 80 93 cd 04 sts 0x04CD, r24 ; 0x8004cd 375e6: 90 93 ce 04 sts 0x04CE, r25 ; 0x8004ce 375ea: a0 93 cf 04 sts 0x04CF, r26 ; 0x8004cf 375ee: b0 93 d0 04 sts 0x04D0, r27 ; 0x8004d0 position_float[Y_AXIS] = y; 375f2: 8d a1 ldd r24, Y+37 ; 0x25 375f4: 9e a1 ldd r25, Y+38 ; 0x26 375f6: af a1 ldd r26, Y+39 ; 0x27 375f8: b8 a5 ldd r27, Y+40 ; 0x28 375fa: 80 93 d1 04 sts 0x04D1, r24 ; 0x8004d1 375fe: 90 93 d2 04 sts 0x04D2, r25 ; 0x8004d2 37602: a0 93 d3 04 sts 0x04D3, r26 ; 0x8004d3 37606: b0 93 d4 04 sts 0x04D4, r27 ; 0x8004d4 position_float[Z_AXIS] = z; 3760a: a8 96 adiw r28, 0x28 ; 40 3760c: 8c ad ldd r24, Y+60 ; 0x3c 3760e: 9d ad ldd r25, Y+61 ; 0x3d 37610: ae ad ldd r26, Y+62 ; 0x3e 37612: bf ad ldd r27, Y+63 ; 0x3f 37614: a8 97 sbiw r28, 0x28 ; 40 37616: 80 93 d5 04 sts 0x04D5, r24 ; 0x8004d5 3761a: 90 93 d6 04 sts 0x04D6, r25 ; 0x8004d6 3761e: a0 93 d7 04 sts 0x04D7, r26 ; 0x8004d7 37622: b0 93 d8 04 sts 0x04D8, r27 ; 0x8004d8 position_float[E_AXIS] = e; 37626: aa 96 adiw r28, 0x2a ; 42 37628: ee ad ldd r30, Y+62 ; 0x3e 3762a: ff ad ldd r31, Y+63 ; 0x3f 3762c: aa 97 sbiw r28, 0x2a ; 42 3762e: 80 81 ld r24, Z 37630: 91 81 ldd r25, Z+1 ; 0x01 37632: a2 81 ldd r26, Z+2 ; 0x02 37634: b3 81 ldd r27, Z+3 ; 0x03 37636: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 3763a: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 3763e: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 37642: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc void planner_recalculate(const float &safe_final_speed) { // Reverse pass // Make a local copy of block_buffer_tail, because the interrupt can alter it // by consuming the blocks, therefore shortening the queue. uint8_t tail = block_buffer_tail; 37646: f0 90 a6 0d lds r15, 0x0DA6 ; 0x800da6 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); 3764a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 3764e: 8f 19 sub r24, r15 37650: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 37652: 83 30 cpi r24, 0x03 ; 3 37654: 40 f1 brcs .+80 ; 0x376a6 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 37656: 10 91 a5 0d lds r17, 0x0DA5 ; 0x800da5 } // 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) 3765a: 11 11 cpse r17, r1 3765c: 01 c0 rjmp .+2 ; 0x37660 block_index = BLOCK_BUFFER_SIZE; 3765e: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37660: 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; 37662: fe e6 ldi r31, 0x6E ; 110 37664: 1f 9f mul r17, r31 37666: c0 01 movw r24, r0 37668: 11 24 eor r1, r1 3766a: 9c 01 movw r18, r24 3766c: 2b 53 subi r18, 0x3B ; 59 3766e: 39 4f sbci r19, 0xF9 ; 249 37670: 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) 37672: 11 11 cpse r17, r1 37674: 01 c0 rjmp .+2 ; 0x37678 block_index = BLOCK_BUFFER_SIZE; 37676: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37678: 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)); 3767a: 3e e6 ldi r19, 0x6E ; 110 3767c: 13 9f mul r17, r19 3767e: c0 01 movw r24, r0 37680: 11 24 eor r1, r1 37682: ac 01 movw r20, r24 37684: 4b 53 subi r20, 0x3B ; 59 37686: 59 4f sbci r21, 0xF9 ; 249 37688: 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)); 3768a: 9e e6 ldi r25, 0x6E ; 110 3768c: 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) { 3768e: f1 16 cp r15, r17 37690: 69 f0 breq .+26 ; 0x376ac if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 37692: d6 01 movw r26, r12 37694: d5 96 adiw r26, 0x35 ; 53 37696: 0c 91 ld r16, X 37698: 02 ff sbrs r16, 2 3769a: 7e c3 rjmp .+1788 ; 0x37d98 // 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); 3769c: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 376a0: 81 1b sub r24, r17 376a2: 8f 70 andi r24, 0x0F ; 15 376a4: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 376a6: 82 30 cpi r24, 0x02 ; 2 376a8: 08 f4 brcc .+2 ; 0x376ac 376aa: a3 c0 rjmp .+326 ; 0x377f2 // 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; 376ac: 3e e6 ldi r19, 0x6E ; 110 376ae: f3 9e mul r15, r19 376b0: c0 01 movw r24, r0 376b2: 11 24 eor r1, r1 376b4: ac 01 movw r20, r24 376b6: 4b 53 subi r20, 0x3B ; 59 376b8: 59 4f sbci r21, 0xF9 ; 249 376ba: 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) 376bc: f3 94 inc r15 376be: 50 e1 ldi r21, 0x10 ; 16 376c0: f5 12 cpse r15, r21 376c2: 01 c0 rjmp .+2 ; 0x376c6 block_index = 0; 376c4: 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)); 376c6: ae e6 ldi r26, 0x6E ; 110 376c8: fa 9e mul r15, r26 376ca: c0 01 movw r24, r0 376cc: 11 24 eor r1, r1 376ce: fc 01 movw r30, r24 376d0: eb 53 subi r30, 0x3B ; 59 376d2: f9 4f sbci r31, 0xF9 ; 249 376d4: 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)); 376d6: 8e e6 ldi r24, 0x6E ; 110 376d8: 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) { 376da: d5 01 movw r26, r10 376dc: d5 96 adiw r26, 0x35 ; 53 376de: 8c 91 ld r24, X 376e0: d5 97 sbiw r26, 0x35 ; 53 376e2: 81 fd sbrc r24, 1 376e4: 5a c0 rjmp .+180 ; 0x3779a 376e6: 95 96 adiw r26, 0x25 ; 37 376e8: 4d 90 ld r4, X+ 376ea: 5d 90 ld r5, X+ 376ec: 6d 90 ld r6, X+ 376ee: 7c 90 ld r7, X 376f0: 98 97 sbiw r26, 0x28 ; 40 376f2: f6 01 movw r30, r12 376f4: 95 a0 ldd r9, Z+37 ; 0x25 376f6: e6 a0 ldd r14, Z+38 ; 0x26 376f8: 07 a1 ldd r16, Z+39 ; 0x27 376fa: 10 a5 ldd r17, Z+40 ; 0x28 376fc: 29 2d mov r18, r9 376fe: 3e 2d mov r19, r14 37700: a8 01 movw r20, r16 37702: c3 01 movw r24, r6 37704: b2 01 movw r22, r4 37706: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 3770a: 87 ff sbrs r24, 7 3770c: 46 c0 rjmp .+140 ; 0x3779a // 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); 3770e: a3 01 movw r20, r6 37710: 92 01 movw r18, r4 37712: c3 01 movw r24, r6 37714: b2 01 movw r22, r4 37716: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3771a: 2b 01 movw r4, r22 3771c: 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)); 3771e: d5 01 movw r26, r10 37720: d1 96 adiw r26, 0x31 ; 49 37722: 6d 91 ld r22, X+ 37724: 7d 91 ld r23, X+ 37726: 8d 91 ld r24, X+ 37728: 9c 91 ld r25, X 3772a: d4 97 sbiw r26, 0x34 ; 52 3772c: 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); 3772e: 9b 01 movw r18, r22 37730: ac 01 movw r20, r24 37732: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 37736: f5 01 movw r30, r10 37738: 25 a5 ldd r18, Z+45 ; 0x2d 3773a: 36 a5 ldd r19, Z+46 ; 0x2e 3773c: 47 a5 ldd r20, Z+47 ; 0x2f 3773e: 50 a9 ldd r21, Z+48 ; 0x30 37740: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37744: 9b 01 movw r18, r22 37746: ac 01 movw r20, r24 37748: c3 01 movw r24, r6 3774a: b2 01 movw r22, r4 3774c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 37750: 0f 94 4a e1 call 0x3c294 ; 0x3c294 37754: 2b 01 movw r4, r22 37756: 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)); 37758: 9b 01 movw r18, r22 3775a: ac 01 movw r20, r24 3775c: 69 2d mov r22, r9 3775e: 7e 2d mov r23, r14 37760: c8 01 movw r24, r16 37762: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37766: 87 ff sbrs r24, 7 37768: 03 c0 rjmp .+6 ; 0x37770 3776a: 49 2c mov r4, r9 3776c: 5e 2c mov r5, r14 3776e: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 37770: 92 01 movw r18, r4 37772: a3 01 movw r20, r6 37774: 69 2d mov r22, r9 37776: 7e 2d mov r23, r14 37778: c8 01 movw r24, r16 3777a: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 3777e: 88 23 and r24, r24 37780: 61 f0 breq .+24 ; 0x3779a 37782: d6 01 movw r26, r12 37784: d5 96 adiw r26, 0x35 ; 53 37786: 2c 91 ld r18, X current->entry_speed = entry_speed; 37788: c2 01 movw r24, r4 3778a: d3 01 movw r26, r6 3778c: f6 01 movw r30, r12 3778e: 85 a3 std Z+37, r24 ; 0x25 37790: 96 a3 std Z+38, r25 ; 0x26 37792: a7 a3 std Z+39, r26 ; 0x27 37794: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 37796: 21 60 ori r18, 0x01 ; 1 37798: 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) { 3779a: d5 01 movw r26, r10 3779c: d5 96 adiw r26, 0x35 ; 53 3779e: 8c 91 ld r24, X 377a0: d5 97 sbiw r26, 0x35 ; 53 377a2: f6 01 movw r30, r12 377a4: 95 a9 ldd r25, Z+53 ; 0x35 377a6: 89 2b or r24, r25 377a8: 80 ff sbrs r24, 0 377aa: 14 c0 rjmp .+40 ; 0x377d4 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 377ac: 05 a1 ldd r16, Z+37 ; 0x25 377ae: 16 a1 ldd r17, Z+38 ; 0x26 377b0: 27 a1 ldd r18, Z+39 ; 0x27 377b2: 30 a5 ldd r19, Z+40 ; 0x28 377b4: 95 96 adiw r26, 0x25 ; 37 377b6: 4d 91 ld r20, X+ 377b8: 5d 91 ld r21, X+ 377ba: 6d 91 ld r22, X+ 377bc: 7c 91 ld r23, X 377be: 98 97 sbiw r26, 0x28 ; 40 377c0: c5 01 movw r24, r10 377c2: 0f 94 8d ae call 0x35d1a ; 0x35d1a // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 377c6: d5 01 movw r26, r10 377c8: d5 96 adiw r26, 0x35 ; 53 377ca: 8c 91 ld r24, X 377cc: d5 97 sbiw r26, 0x35 ; 53 377ce: 8e 7f andi r24, 0xFE ; 254 377d0: d5 96 adiw r26, 0x35 ; 53 377d2: 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) 377d4: f3 94 inc r15 377d6: b0 e1 ldi r27, 0x10 ; 16 377d8: fb 12 cpse r15, r27 377da: 01 c0 rjmp .+2 ; 0x377de block_index = 0; 377dc: 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)); 377de: f8 9c mul r15, r8 377e0: c0 01 movw r24, r0 377e2: 11 24 eor r1, r1 377e4: 8b 53 subi r24, 0x3B ; 59 377e6: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 377e8: 20 91 a5 0d lds r18, 0x0DA5 ; 0x800da5 // 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; 377ec: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 377ee: f2 12 cpse r15, r18 377f0: 43 c3 rjmp .+1670 ; 0x37e78 } // 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); 377f2: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 } // 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) 377f6: 81 11 cpse r24, r1 377f8: 01 c0 rjmp .+2 ; 0x377fc block_index = BLOCK_BUFFER_SIZE; 377fa: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 377fc: 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); 377fe: ee e6 ldi r30, 0x6E ; 110 37800: 8e 9f mul r24, r30 37802: c0 01 movw r24, r0 37804: 11 24 eor r1, r1 37806: 9c 01 movw r18, r24 37808: 2b 53 subi r18, 0x3B ; 59 3780a: 39 4f sbci r19, 0xF9 ; 249 3780c: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 3780e: d9 01 movw r26, r18 37810: 95 96 adiw r26, 0x25 ; 37 37812: 4d 91 ld r20, X+ 37814: 5d 91 ld r21, X+ 37816: 6d 91 ld r22, X+ 37818: 7c 91 ld r23, X 3781a: 98 97 sbiw r26, 0x28 ; 40 3781c: 09 a5 ldd r16, Y+41 ; 0x29 3781e: 1d a5 ldd r17, Y+45 ; 0x2d 37820: 29 a9 ldd r18, Y+49 ; 0x31 37822: 39 ad ldd r19, Y+57 ; 0x39 37824: c7 01 movw r24, r14 37826: 0f 94 8d ae call 0x35d1a ; 0x35d1a current->flag &= ~BLOCK_FLAG_RECALCULATE; 3782a: f7 01 movw r30, r14 3782c: 85 a9 ldd r24, Z+53 ; 0x35 3782e: 8e 7f andi r24, 0xFE ; 254 37830: 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(); 37832: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 37836: 82 60 ori r24, 0x02 ; 2 37838: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3783c: 0d 94 93 b1 jmp 0x36326 ; 0x36326 // 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)); 37840: a3 5e subi r26, 0xE3 ; 227 37842: b8 4f sbci r27, 0xF8 ; 248 37844: 80 e1 ldi r24, 0x10 ; 16 37846: e2 e9 ldi r30, 0x92 ; 146 37848: f6 e0 ldi r31, 0x06 ; 6 3784a: 0d 94 ce b1 jmp 0x3639c ; 0x3639c 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]); 3784e: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 37852: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 37856: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 3785a: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 3785e: a8 96 adiw r28, 0x28 ; 40 37860: 6c ad ldd r22, Y+60 ; 0x3c 37862: 7d ad ldd r23, Y+61 ; 0x3d 37864: 8e ad ldd r24, Y+62 ; 0x3e 37866: 9f ad ldd r25, Y+63 ; 0x3f 37868: a8 97 sbiw r28, 0x28 ; 40 3786a: 0d 94 64 b2 jmp 0x364c8 ; 0x364c8 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); 3786e: 81 e0 ldi r24, 0x01 ; 1 37870: 80 8f std Z+24, r24 ; 0x18 37872: 0d 94 0a b4 jmp 0x36814 ; 0x36814 { if(feed_rate 3787a: b0 90 fb 0d lds r11, 0x0DFB ; 0x800dfb 3787e: 00 91 fc 0d lds r16, 0x0DFC ; 0x800dfc 37882: 10 91 fd 0d lds r17, 0x0DFD ; 0x800dfd 37886: 4c c8 rjmp .-3944 ; 0x36920 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])); 37888: c5 01 movw r24, r10 3788a: b4 01 movw r22, r8 3788c: 0f 94 1d d7 call 0x3ae3a ; 0x3ae3a 37890: 4b 01 movw r8, r22 37892: 5c 01 movw r10, r24 37894: c7 01 movw r24, r14 37896: b6 01 movw r22, r12 37898: 0f 94 1d d7 call 0x3ae3a ; 0x3ae3a 3789c: 9b 01 movw r18, r22 3789e: ac 01 movw r20, r24 378a0: c5 01 movw r24, r10 378a2: b4 01 movw r22, r8 378a4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 378a8: 6b 01 movw r12, r22 378aa: 7c 01 movw r14, r24 378ac: 22 96 adiw r28, 0x02 ; 2 378ae: 6c ad ldd r22, Y+60 ; 0x3c 378b0: 7d ad ldd r23, Y+61 ; 0x3d 378b2: 8e ad ldd r24, Y+62 ; 0x3e 378b4: 9f ad ldd r25, Y+63 ; 0x3f 378b6: 22 97 sbiw r28, 0x02 ; 2 378b8: 0f 94 1d d7 call 0x3ae3a ; 0x3ae3a 378bc: 9b 01 movw r18, r22 378be: ac 01 movw r20, r24 378c0: c7 01 movw r24, r14 378c2: b6 01 movw r22, r12 378c4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 378c8: 0f 94 4a e1 call 0x3c294 ; 0x3c294 378cc: 2e e6 ldi r18, 0x6E ; 110 378ce: 22 9d mul r18, r2 378d0: f0 01 movw r30, r0 378d2: 23 9d mul r18, r3 378d4: f0 0d add r31, r0 378d6: 11 24 eor r1, r1 378d8: eb 53 subi r30, 0x3B ; 59 378da: f9 4f sbci r31, 0xF9 ; 249 378dc: 65 a7 std Z+45, r22 ; 0x2d 378de: 76 a7 std Z+46, r23 ; 0x2e 378e0: 87 a7 std Z+47, r24 ; 0x2f 378e2: 90 ab std Z+48, r25 ; 0x30 378e4: bb c8 rjmp .-3722 ; 0x36a5c 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 378e6: 2a 96 adiw r28, 0x0a ; 10 378e8: 2c ad ldd r18, Y+60 ; 0x3c 378ea: 3d ad ldd r19, Y+61 ; 0x3d 378ec: 4e ad ldd r20, Y+62 ; 0x3e 378ee: 5f ad ldd r21, Y+63 ; 0x3f 378f0: 2a 97 sbiw r28, 0x0a ; 10 378f2: 23 2b or r18, r19 378f4: 24 2b or r18, r20 378f6: 25 2b or r18, r21 378f8: 09 f4 brne .+2 ; 0x378fc 378fa: 0e c1 rjmp .+540 ; 0x37b18 378fc: 60 91 f2 0d lds r22, 0x0DF2 ; 0x800df2 37900: 70 91 f3 0d lds r23, 0x0DF3 ; 0x800df3 37904: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 37908: 90 91 f5 0d lds r25, 0x0DF5 ; 0x800df5 3790c: 29 a5 ldd r18, Y+41 ; 0x29 3790e: 3a a5 ldd r19, Y+42 ; 0x2a 37910: 4b a5 ldd r20, Y+43 ; 0x2b 37912: 5c a5 ldd r21, Y+44 ; 0x2c 37914: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37918: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 3791c: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 37920: 2b 01 movw r4, r22 37922: 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 37924: 80 91 65 05 lds r24, 0x0565 ; 0x800565 37928: 90 91 66 05 lds r25, 0x0566 ; 0x800566 3792c: a0 91 67 05 lds r26, 0x0567 ; 0x800567 37930: b0 91 68 05 lds r27, 0x0568 ; 0x800568 37934: 8d a7 std Y+45, r24 ; 0x2d 37936: 9e a7 std Y+46, r25 ; 0x2e 37938: af a7 std Y+47, r26 ; 0x2f 3793a: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 3793c: 20 e0 ldi r18, 0x00 ; 0 3793e: 30 e0 ldi r19, 0x00 ; 0 37940: a9 01 movw r20, r18 37942: bc 01 movw r22, r24 37944: cd 01 movw r24, r26 37946: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 3794a: 18 16 cp r1, r24 3794c: 0c f0 brlt .+2 ; 0x37950 3794e: ed c0 rjmp .+474 ; 0x37b2a * 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 37950: 20 e0 ldi r18, 0x00 ; 0 37952: 30 e0 ldi r19, 0x00 ; 0 37954: a9 01 movw r20, r18 37956: 26 96 adiw r28, 0x06 ; 6 37958: 6c ad ldd r22, Y+60 ; 0x3c 3795a: 7d ad ldd r23, Y+61 ; 0x3d 3795c: 8e ad ldd r24, Y+62 ; 0x3e 3795e: 9f ad ldd r25, Y+63 ; 0x3f 37960: 26 97 sbiw r28, 0x06 ; 6 37962: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37966: 87 fd sbrc r24, 7 37968: e0 c0 rjmp .+448 ; 0x37b2a && fabs(delta_mm[Z_AXIS]) < 0.5; 3796a: 22 96 adiw r28, 0x02 ; 2 3796c: 6c ad ldd r22, Y+60 ; 0x3c 3796e: 7d ad ldd r23, Y+61 ; 0x3d 37970: 8e ad ldd r24, Y+62 ; 0x3e 37972: 9f ad ldd r25, Y+63 ; 0x3f 37974: 22 97 sbiw r28, 0x02 ; 2 37976: 9f 77 andi r25, 0x7F ; 127 37978: 20 e0 ldi r18, 0x00 ; 0 3797a: 30 e0 ldi r19, 0x00 ; 0 3797c: 40 e0 ldi r20, 0x00 ; 0 3797e: 5f e3 ldi r21, 0x3F ; 63 37980: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37984: 87 ff sbrs r24, 7 37986: d1 c0 rjmp .+418 ; 0x37b2a * * 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 37988: 8e e6 ldi r24, 0x6E ; 110 3798a: 82 9d mul r24, r2 3798c: 80 01 movw r16, r0 3798e: 83 9d mul r24, r3 37990: 10 0d add r17, r0 37992: 11 24 eor r1, r1 37994: 0f 5e subi r16, 0xEF ; 239 37996: 18 4f sbci r17, 0xF8 ; 248 37998: 81 e0 ldi r24, 0x01 ; 1 3799a: d8 01 movw r26, r16 3799c: 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]) 3799e: 20 91 cd 04 lds r18, 0x04CD ; 0x8004cd 379a2: 30 91 ce 04 lds r19, 0x04CE ; 0x8004ce 379a6: 40 91 cf 04 lds r20, 0x04CF ; 0x8004cf 379aa: 50 91 d0 04 lds r21, 0x04D0 ; 0x8004d0 379ae: 69 a1 ldd r22, Y+33 ; 0x21 379b0: 7a a1 ldd r23, Y+34 ; 0x22 379b2: 8b a1 ldd r24, Y+35 ; 0x23 379b4: 9c a1 ldd r25, Y+36 ; 0x24 379b6: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 379ba: 69 ab std Y+49, r22 ; 0x31 379bc: 7a ab std Y+50, r23 ; 0x32 379be: 8b ab std Y+51, r24 ; 0x33 379c0: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 379c2: 20 91 d1 04 lds r18, 0x04D1 ; 0x8004d1 379c6: 30 91 d2 04 lds r19, 0x04D2 ; 0x8004d2 379ca: 40 91 d3 04 lds r20, 0x04D3 ; 0x8004d3 379ce: 50 91 d4 04 lds r21, 0x04D4 ; 0x8004d4 379d2: 6d a1 ldd r22, Y+37 ; 0x25 379d4: 7e a1 ldd r23, Y+38 ; 0x26 379d6: 8f a1 ldd r24, Y+39 ; 0x27 379d8: 98 a5 ldd r25, Y+40 ; 0x28 379da: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 379de: 4b 01 movw r8, r22 379e0: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 379e2: 20 91 d5 04 lds r18, 0x04D5 ; 0x8004d5 379e6: 30 91 d6 04 lds r19, 0x04D6 ; 0x8004d6 379ea: 40 91 d7 04 lds r20, 0x04D7 ; 0x8004d7 379ee: 50 91 d8 04 lds r21, 0x04D8 ; 0x8004d8 379f2: a8 96 adiw r28, 0x28 ; 40 379f4: 6c ad ldd r22, Y+60 ; 0x3c 379f6: 7d ad ldd r23, Y+61 ; 0x3d 379f8: 8e ad ldd r24, Y+62 ; 0x3e 379fa: 9f ad ldd r25, Y+63 ; 0x3f 379fc: a8 97 sbiw r28, 0x28 ; 40 379fe: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 37a02: 6b 01 movw r12, r22 37a04: 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]) 37a06: 29 a9 ldd r18, Y+49 ; 0x31 37a08: 3a a9 ldd r19, Y+50 ; 0x32 37a0a: 4b a9 ldd r20, Y+51 ; 0x33 37a0c: 5c a9 ldd r21, Y+52 ; 0x34 37a0e: ca 01 movw r24, r20 37a10: b9 01 movw r22, r18 37a12: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37a16: 69 ab std Y+49, r22 ; 0x31 37a18: 7a ab std Y+50, r23 ; 0x32 37a1a: 8b ab std Y+51, r24 ; 0x33 37a1c: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 37a1e: a5 01 movw r20, r10 37a20: 94 01 movw r18, r8 37a22: c5 01 movw r24, r10 37a24: b4 01 movw r22, r8 37a26: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37a2a: 9b 01 movw r18, r22 37a2c: ac 01 movw r20, r24 37a2e: 69 a9 ldd r22, Y+49 ; 0x31 37a30: 7a a9 ldd r23, Y+50 ; 0x32 37a32: 8b a9 ldd r24, Y+51 ; 0x33 37a34: 9c a9 ldd r25, Y+52 ; 0x34 37a36: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 37a3a: 4b 01 movw r8, r22 37a3c: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 37a3e: a7 01 movw r20, r14 37a40: 96 01 movw r18, r12 37a42: c7 01 movw r24, r14 37a44: b6 01 movw r22, r12 37a46: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37a4a: 9b 01 movw r18, r22 37a4c: ac 01 movw r20, r24 37a4e: c5 01 movw r24, r10 37a50: b4 01 movw r22, r8 37a52: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__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]) 37a56: 0f 94 4a e1 call 0x3c294 ; 0x3c294 37a5a: 6b 01 movw r12, r22 37a5c: 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]); 37a5e: 20 91 d9 04 lds r18, 0x04D9 ; 0x8004d9 37a62: 30 91 da 04 lds r19, 0x04DA ; 0x8004da 37a66: 40 91 db 04 lds r20, 0x04DB ; 0x8004db 37a6a: 50 91 dc 04 lds r21, 0x04DC ; 0x8004dc 37a6e: aa 96 adiw r28, 0x2a ; 42 37a70: ee ad ldd r30, Y+62 ; 0x3e 37a72: ff ad ldd r31, Y+63 ; 0x3f 37a74: aa 97 sbiw r28, 0x2a ; 42 37a76: 60 81 ld r22, Z 37a78: 71 81 ldd r23, Z+1 ; 0x01 37a7a: 82 81 ldd r24, Z+2 ; 0x02 37a7c: 93 81 ldd r25, Z+3 ; 0x03 37a7e: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__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; 37a82: a7 01 movw r20, r14 37a84: 96 01 movw r18, r12 37a86: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 37a8a: 6a 96 adiw r28, 0x1a ; 26 37a8c: 6c af std Y+60, r22 ; 0x3c 37a8e: 7d af std Y+61, r23 ; 0x3d 37a90: 8e af std Y+62, r24 ; 0x3e 37a92: 9f af std Y+63, r25 ; 0x3f 37a94: 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) 37a96: 20 e0 ldi r18, 0x00 ; 0 37a98: 30 e0 ldi r19, 0x00 ; 0 37a9a: 40 e4 ldi r20, 0x40 ; 64 37a9c: 50 e4 ldi r21, 0x40 ; 64 37a9e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37aa2: 18 16 cp r1, r24 37aa4: 0c f4 brge .+2 ; 0x37aa8 37aa6: 9e c0 rjmp .+316 ; 0x37be4 block->use_advance_lead = false; else if (e_D_ratio > 0) { 37aa8: 20 e0 ldi r18, 0x00 ; 0 37aaa: 30 e0 ldi r19, 0x00 ; 0 37aac: a9 01 movw r20, r18 37aae: 6a 96 adiw r28, 0x1a ; 26 37ab0: 6c ad ldd r22, Y+60 ; 0x3c 37ab2: 7d ad ldd r23, Y+61 ; 0x3d 37ab4: 8e ad ldd r24, Y+62 ; 0x3e 37ab6: 9f ad ldd r25, Y+63 ; 0x3f 37ab8: 6a 97 sbiw r28, 0x1a ; 26 37aba: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37abe: 18 16 cp r1, r24 37ac0: 0c f0 brlt .+2 ; 0x37ac4 37ac2: 42 c0 rjmp .+132 ; 0x37b48 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 37ac4: 6a 96 adiw r28, 0x1a ; 26 37ac6: 2c ad ldd r18, Y+60 ; 0x3c 37ac8: 3d ad ldd r19, Y+61 ; 0x3d 37aca: 4e ad ldd r20, Y+62 ; 0x3e 37acc: 5f ad ldd r21, Y+63 ; 0x3f 37ace: 6a 97 sbiw r28, 0x1a ; 26 37ad0: 6d a5 ldd r22, Y+45 ; 0x2d 37ad2: 7e a5 ldd r23, Y+46 ; 0x2e 37ad4: 8f a5 ldd r24, Y+47 ; 0x2f 37ad6: 98 a9 ldd r25, Y+48 ; 0x30 37ad8: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37adc: 9b 01 movw r18, r22 37ade: ac 01 movw r20, r24 37ae0: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 37ae4: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 37ae8: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 37aec: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 37af0: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 37af4: 29 a5 ldd r18, Y+41 ; 0x29 37af6: 3a a5 ldd r19, Y+42 ; 0x2a 37af8: 4b a5 ldd r20, Y+43 ; 0x2b 37afa: 5c a5 ldd r21, Y+44 ; 0x2c 37afc: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37b00: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 37b04: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 37b08: 64 15 cp r22, r4 37b0a: 75 05 cpc r23, r5 37b0c: 86 05 cpc r24, r6 37b0e: 97 05 cpc r25, r7 37b10: d8 f4 brcc .+54 ; 0x37b48 37b12: 2b 01 movw r4, r22 37b14: 3c 01 movw r6, r24 37b16: 18 c0 rjmp .+48 ; 0x37b48 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 37b18: 60 91 7e 0e lds r22, 0x0E7E ; 0x800e7e 37b1c: 70 91 7f 0e lds r23, 0x0E7F ; 0x800e7f 37b20: 80 91 80 0e lds r24, 0x0E80 ; 0x800e80 37b24: 90 91 81 0e lds r25, 0x0E81 ; 0x800e81 37b28: f1 ce rjmp .-542 ; 0x3790c * * 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 37b2a: 8e e6 ldi r24, 0x6E ; 110 37b2c: 82 9d mul r24, r2 37b2e: f0 01 movw r30, r0 37b30: 83 9d mul r24, r3 37b32: f0 0d add r31, r0 37b34: 11 24 eor r1, r1 37b36: ef 5e subi r30, 0xEF ; 239 37b38: f8 4f sbci r31, 0xF8 ; 248 37b3a: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 37b3c: 6a 96 adiw r28, 0x1a ; 26 37b3e: 1c ae std Y+60, r1 ; 0x3c 37b40: 1d ae std Y+61, r1 ; 0x3d 37b42: 1e ae std Y+62, r1 ; 0x3e 37b44: 1f ae std Y+63, r1 ; 0x3f 37b46: 6a 97 sbiw r28, 0x1a ; 26 37b48: 10 e0 ldi r17, 0x00 ; 0 37b4a: 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) 37b4c: a4 96 adiw r28, 0x24 ; 36 37b4e: ee ad ldd r30, Y+62 ; 0x3e 37b50: ff ad ldd r31, Y+63 ; 0x3f 37b52: a4 97 sbiw r28, 0x24 ; 36 37b54: e0 0f add r30, r16 37b56: f1 1f adc r31, r17 37b58: eb 53 subi r30, 0x3B ; 59 37b5a: f9 4f sbci r31, 0xF9 ; 249 37b5c: c0 80 ld r12, Z 37b5e: d1 80 ldd r13, Z+1 ; 0x01 37b60: e2 80 ldd r14, Z+2 ; 0x02 37b62: f3 80 ldd r15, Z+3 ; 0x03 37b64: c1 14 cp r12, r1 37b66: d1 04 cpc r13, r1 37b68: e1 04 cpc r14, r1 37b6a: f1 04 cpc r15, r1 37b6c: a1 f1 breq .+104 ; 0x37bd6 37b6e: f8 01 movw r30, r16 37b70: e2 5b subi r30, 0xB2 ; 178 37b72: fa 4f sbci r31, 0xFA ; 250 37b74: 60 81 ld r22, Z 37b76: 71 81 ldd r23, Z+1 ; 0x01 37b78: 82 81 ldd r24, Z+2 ; 0x02 37b7a: 93 81 ldd r25, Z+3 ; 0x03 37b7c: 64 15 cp r22, r4 37b7e: 75 05 cpc r23, r5 37b80: 86 05 cpc r24, r6 37b82: 97 05 cpc r25, r7 37b84: 40 f5 brcc .+80 ; 0x37bd6 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 37b86: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 37b8a: 29 ad ldd r18, Y+57 ; 0x39 37b8c: 3a ad ldd r19, Y+58 ; 0x3a 37b8e: 4b ad ldd r20, Y+59 ; 0x3b 37b90: 5c ad ldd r21, Y+60 ; 0x3c 37b92: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37b96: 4b 01 movw r8, r22 37b98: 5c 01 movw r10, r24 37b9a: c7 01 movw r24, r14 37b9c: b6 01 movw r22, r12 37b9e: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 37ba2: 9b 01 movw r18, r22 37ba4: ac 01 movw r20, r24 37ba6: c5 01 movw r24, r10 37ba8: b4 01 movw r22, r8 37baa: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 37bae: 6b 01 movw r12, r22 37bb0: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 37bb2: c3 01 movw r24, r6 37bb4: b2 01 movw r22, r4 37bb6: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 37bba: 9b 01 movw r18, r22 37bbc: ac 01 movw r20, r24 37bbe: c7 01 movw r24, r14 37bc0: b6 01 movw r22, r12 37bc2: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37bc6: 87 ff sbrs r24, 7 37bc8: 06 c0 rjmp .+12 ; 0x37bd6 37bca: c7 01 movw r24, r14 37bcc: b6 01 movw r22, r12 37bce: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 37bd2: 2b 01 movw r4, r22 37bd4: 3c 01 movw r6, r24 37bd6: 0c 5f subi r16, 0xFC ; 252 37bd8: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 37bda: 00 31 cpi r16, 0x10 ; 16 37bdc: 11 05 cpc r17, r1 37bde: 09 f0 breq .+2 ; 0x37be2 37be0: b5 cf rjmp .-150 ; 0x37b4c 37be2: 01 c9 rjmp .-3582 ; 0x36de6 // 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; 37be4: d8 01 movw r26, r16 37be6: 1c 92 st X, r1 37be8: af cf rjmp .-162 ; 0x37b48 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 37bea: c9 a6 std Y+41, r12 ; 0x29 37bec: dd a6 std Y+45, r13 ; 0x2d 37bee: e9 aa std Y+49, r14 ; 0x31 37bf0: f9 ae std Y+57, r15 ; 0x39 limited = true; 37bf2: 21 e0 ldi r18, 0x01 ; 1 37bf4: 2d ab std Y+53, r18 ; 0x35 37bf6: b1 c9 rjmp .-3230 ; 0x36f5a // 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); 37bf8: 27 96 adiw r28, 0x07 ; 7 37bfa: 2f ad ldd r18, Y+63 ; 0x3f 37bfc: 27 97 sbiw r28, 0x07 ; 7 37bfe: 2b 96 adiw r28, 0x0b ; 11 37c00: 3f ad ldd r19, Y+63 ; 0x3f 37c02: 2b 97 sbiw r28, 0x0b ; 11 37c04: 2f 96 adiw r28, 0x0f ; 15 37c06: 4f ad ldd r20, Y+63 ; 0x3f 37c08: 2f 97 sbiw r28, 0x0f ; 15 37c0a: 63 96 adiw r28, 0x13 ; 19 37c0c: 5f ad ldd r21, Y+63 ; 0x3f 37c0e: 63 97 sbiw r28, 0x13 ; 19 37c10: 6b 96 adiw r28, 0x1b ; 27 37c12: 6f ad ldd r22, Y+63 ; 0x3f 37c14: 6b 97 sbiw r28, 0x1b ; 27 37c16: 6d 96 adiw r28, 0x1d ; 29 37c18: 7f ad ldd r23, Y+63 ; 0x3f 37c1a: 6d 97 sbiw r28, 0x1d ; 29 37c1c: c8 01 movw r24, r16 37c1e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 37c22: ec 96 adiw r28, 0x3c ; 60 37c24: 6c af std Y+60, r22 ; 0x3c 37c26: 7d af std Y+61, r23 ; 0x3d 37c28: 8e af std Y+62, r24 ; 0x3e 37c2a: 9f af std Y+63, r25 ; 0x3f 37c2c: 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; 37c2e: 6b 96 adiw r28, 0x1b ; 27 37c30: ef ad ldd r30, Y+63 ; 0x3f 37c32: 6b 97 sbiw r28, 0x1b ; 27 37c34: ed af std Y+61, r30 ; 0x3d 37c36: 6d 96 adiw r28, 0x1d ; 29 37c38: ff ad ldd r31, Y+63 ; 0x3f 37c3a: 6d 97 sbiw r28, 0x1d ; 29 37c3c: fd ab std Y+53, r31 ; 0x35 37c3e: 0e af std Y+62, r16 ; 0x3e 37c40: 23 96 adiw r28, 0x03 ; 3 37c42: 1f af std Y+63, r17 ; 0x3f 37c44: 23 97 sbiw r28, 0x03 ; 3 37c46: 04 ca rjmp .-3064 ; 0x37050 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 37c48: f7 fa bst r15, 7 37c4a: f0 94 com r15 37c4c: f7 f8 bld r15, 7 37c4e: f0 94 com r15 37c50: a5 01 movw r20, r10 37c52: 94 01 movw r18, r8 37c54: c7 01 movw r24, r14 37c56: b6 01 movw r22, r12 37c58: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37c5c: 87 ff sbrs r24, 7 37c5e: 77 ca rjmp .-2834 ; 0x3714e // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37c60: 75 01 movw r14, r10 37c62: 64 01 movw r12, r8 37c64: 74 ca rjmp .-2840 ; 0x3714e // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 37c66: c7 01 movw r24, r14 37c68: b6 01 movw r22, r12 37c6a: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37c6e: 87 fd sbrc r24, 7 37c70: 09 c0 rjmp .+18 ; 0x37c84 37c72: 20 e0 ldi r18, 0x00 ; 0 37c74: 30 e0 ldi r19, 0x00 ; 0 37c76: a9 01 movw r20, r18 37c78: c5 01 movw r24, r10 37c7a: b4 01 movw r22, r8 37c7c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37c80: 18 16 cp r1, r24 37c82: 2c f4 brge .+10 ; 0x37c8e 37c84: a5 01 movw r20, r10 37c86: 94 01 movw r18, r8 37c88: c7 01 movw r24, r14 37c8a: b6 01 movw r22, r12 37c8c: 5c ca rjmp .-2888 ; 0x37146 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37c8e: b7 fa bst r11, 7 37c90: b0 94 com r11 37c92: b7 f8 bld r11, 7 37c94: b0 94 com r11 37c96: a7 01 movw r20, r14 37c98: 96 01 movw r18, r12 37c9a: c5 01 movw r24, r10 37c9c: b4 01 movw r22, r8 37c9e: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37ca2: 18 16 cp r1, r24 37ca4: 0c f0 brlt .+2 ; 0x37ca8 37ca6: 53 ca rjmp .-2906 ; 0x3714e 37ca8: db cf rjmp .-74 ; 0x37c60 // 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; 37caa: 8e e6 ldi r24, 0x6E ; 110 37cac: 82 9d mul r24, r2 37cae: f0 01 movw r30, r0 37cb0: 83 9d mul r24, r3 37cb2: f0 0d add r31, r0 37cb4: 11 24 eor r1, r1 37cb6: eb 53 subi r30, 0x3B ; 59 37cb8: f9 4f sbci r31, 0xF9 ; 249 37cba: 85 a9 ldd r24, Z+53 ; 0x35 37cbc: 84 60 ori r24, 0x04 ; 4 37cbe: 85 ab std Z+53, r24 ; 0x35 37cc0: a9 a5 ldd r26, Y+41 ; 0x29 37cc2: ad af std Y+61, r26 ; 0x3d 37cc4: bd a5 ldd r27, Y+45 ; 0x2d 37cc6: bd ab std Y+53, r27 ; 0x35 37cc8: e9 a9 ldd r30, Y+49 ; 0x31 37cca: ee af std Y+62, r30 ; 0x3e 37ccc: f9 ad ldd r31, Y+57 ; 0x39 37cce: 23 96 adiw r28, 0x03 ; 3 37cd0: ff af std Y+63, r31 ; 0x3f 37cd2: 23 97 sbiw r28, 0x03 ; 3 37cd4: bc ca rjmp .-2696 ; 0x3724e // 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; 37cd6: 81 e0 ldi r24, 0x01 ; 1 37cd8: 30 cb rjmp .-2464 ; 0x3733a 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]; 37cda: 20 91 12 0e lds r18, 0x0E12 ; 0x800e12 37cde: 30 91 13 0e lds r19, 0x0E13 ; 0x800e13 37ce2: 40 91 14 0e lds r20, 0x0E14 ; 0x800e14 37ce6: 50 91 15 0e lds r21, 0x0E15 ; 0x800e15 37cea: c7 01 movw r24, r14 37cec: b6 01 movw r22, r12 37cee: c1 cb rjmp .-2174 ; 0x37472 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) { 37cf0: 20 e0 ldi r18, 0x00 ; 0 37cf2: 30 e4 ldi r19, 0x40 ; 64 37cf4: 4c e1 ldi r20, 0x1C ; 28 37cf6: 56 e4 ldi r21, 0x46 ; 70 37cf8: c7 01 movw r24, r14 37cfa: b6 01 movw r22, r12 37cfc: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 37d00: 18 16 cp r1, r24 37d02: d4 f4 brge .+52 ; 0x37d38 block->advance_rate = advance_rate * 2; 37d04: 8e e6 ldi r24, 0x6E ; 110 37d06: 82 9d mul r24, r2 37d08: 80 01 movw r16, r0 37d0a: 83 9d mul r24, r3 37d0c: 10 0d add r17, r0 37d0e: 11 24 eor r1, r1 37d10: 0b 53 subi r16, 0x3B ; 59 37d12: 19 4f sbci r17, 0xF9 ; 249 37d14: 78 01 movw r14, r16 37d16: bd e4 ldi r27, 0x4D ; 77 37d18: eb 0e add r14, r27 37d1a: f1 1c adc r15, r1 37d1c: a5 01 movw r20, r10 37d1e: 94 01 movw r18, r8 37d20: c5 01 movw r24, r10 37d22: b4 01 movw r22, r8 37d24: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 37d28: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 37d2c: f7 01 movw r30, r14 37d2e: 71 83 std Z+1, r23 ; 0x01 37d30: 60 83 st Z, r22 block->advance_step_loops = 2; 37d32: 36 96 adiw r30, 0x06 ; 6 37d34: 82 e0 ldi r24, 0x02 ; 2 37d36: e2 cb rjmp .-2108 ; 0x374fc } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 37d38: 20 e0 ldi r18, 0x00 ; 0 37d3a: 3f ef ldi r19, 0xFF ; 255 37d3c: 4f e7 ldi r20, 0x7F ; 127 37d3e: 57 e4 ldi r21, 0x47 ; 71 37d40: c5 01 movw r24, r10 37d42: b4 01 movw r22, r8 37d44: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37d48: 87 ff sbrs r24, 7 37d4a: 19 c0 rjmp .+50 ; 0x37d7e block->advance_rate = advance_rate; 37d4c: 8e e6 ldi r24, 0x6E ; 110 37d4e: 82 9d mul r24, r2 37d50: 80 01 movw r16, r0 37d52: 83 9d mul r24, r3 37d54: 10 0d add r17, r0 37d56: 11 24 eor r1, r1 37d58: 0e 5e subi r16, 0xEE ; 238 37d5a: 18 4f sbci r17, 0xF8 ; 248 37d5c: c5 01 movw r24, r10 37d5e: b4 01 movw r22, r8 37d60: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 37d64: d8 01 movw r26, r16 37d66: 6d 93 st X+, r22 37d68: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 37d6a: 8e e6 ldi r24, 0x6E ; 110 37d6c: 82 9d mul r24, r2 37d6e: f0 01 movw r30, r0 37d70: 83 9d mul r24, r3 37d72: f0 0d add r31, r0 37d74: 11 24 eor r1, r1 37d76: e8 5e subi r30, 0xE8 ; 232 37d78: f8 4f sbci r31, 0xF8 ; 248 37d7a: 81 e0 ldi r24, 0x01 ; 1 37d7c: bf cb rjmp .-2178 ; 0x374fc { // 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; 37d7e: 8e e6 ldi r24, 0x6E ; 110 37d80: 82 9d mul r24, r2 37d82: f0 01 movw r30, r0 37d84: 83 9d mul r24, r3 37d86: f0 0d add r31, r0 37d88: 11 24 eor r1, r1 37d8a: ee 5e subi r30, 0xEE ; 238 37d8c: f8 4f sbci r31, 0xF8 ; 248 37d8e: 8f ef ldi r24, 0xFF ; 255 37d90: 9f ef ldi r25, 0xFF ; 255 37d92: 91 83 std Z+1, r25 ; 0x01 37d94: 80 83 st Z, r24 37d96: e9 cf rjmp .-46 ; 0x37d6a 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) { 37d98: f6 01 movw r30, r12 37d9a: 71 a4 ldd r7, Z+41 ; 0x29 37d9c: 82 a4 ldd r8, Z+42 ; 0x2a 37d9e: 93 a4 ldd r9, Z+43 ; 0x2b 37da0: e4 a4 ldd r14, Z+44 ; 0x2c 37da2: 27 2d mov r18, r7 37da4: 38 2d mov r19, r8 37da6: 49 2d mov r20, r9 37da8: 5e 2d mov r21, r14 37daa: 65 a1 ldd r22, Z+37 ; 0x25 37dac: 76 a1 ldd r23, Z+38 ; 0x26 37dae: 87 a1 ldd r24, Z+39 ; 0x27 37db0: 90 a5 ldd r25, Z+40 ; 0x28 37db2: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37db6: 88 23 and r24, r24 37db8: 09 f4 brne .+2 ; 0x37dbc 37dba: 51 c0 rjmp .+162 ; 0x37e5e // 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) ? 37dbc: 01 fd sbrc r16, 1 37dbe: 44 c0 rjmp .+136 ; 0x37e48 37dc0: d5 01 movw r26, r10 37dc2: 95 96 adiw r26, 0x25 ; 37 37dc4: 2d 90 ld r2, X+ 37dc6: 3d 90 ld r3, X+ 37dc8: 4d 90 ld r4, X+ 37dca: 5c 90 ld r5, X 37dcc: 98 97 sbiw r26, 0x28 ; 40 37dce: a2 01 movw r20, r4 37dd0: 91 01 movw r18, r2 37dd2: 67 2d mov r22, r7 37dd4: 78 2d mov r23, r8 37dd6: 89 2d mov r24, r9 37dd8: 9e 2d mov r25, r14 37dda: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37dde: 18 16 cp r1, r24 37de0: 9c f5 brge .+102 ; 0x37e48 // 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); 37de2: a2 01 movw r20, r4 37de4: 91 01 movw r18, r2 37de6: c2 01 movw r24, r4 37de8: b1 01 movw r22, r2 37dea: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37dee: 1b 01 movw r2, r22 37df0: 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)); 37df2: f6 01 movw r30, r12 37df4: 61 a9 ldd r22, Z+49 ; 0x31 37df6: 72 a9 ldd r23, Z+50 ; 0x32 37df8: 83 a9 ldd r24, Z+51 ; 0x33 37dfa: 94 a9 ldd r25, Z+52 ; 0x34 37dfc: 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); 37dfe: 9b 01 movw r18, r22 37e00: ac 01 movw r20, r24 37e02: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 37e06: d6 01 movw r26, r12 37e08: 9d 96 adiw r26, 0x2d ; 45 37e0a: 2d 91 ld r18, X+ 37e0c: 3d 91 ld r19, X+ 37e0e: 4d 91 ld r20, X+ 37e10: 5c 91 ld r21, X 37e12: d0 97 sbiw r26, 0x30 ; 48 37e14: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37e18: 9b 01 movw r18, r22 37e1a: ac 01 movw r20, r24 37e1c: c2 01 movw r24, r4 37e1e: b1 01 movw r22, r2 37e20: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 37e24: 0f 94 4a e1 call 0x3c294 ; 0x3c294 37e28: 2b 01 movw r4, r22 37e2a: 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)); 37e2c: 9b 01 movw r18, r22 37e2e: ac 01 movw r20, r24 37e30: 67 2d mov r22, r7 37e32: 78 2d mov r23, r8 37e34: 89 2d mov r24, r9 37e36: 9e 2d mov r25, r14 37e38: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 37e3c: 87 fd sbrc r24, 7 37e3e: 04 c0 rjmp .+8 ; 0x37e48 37e40: 74 2c mov r7, r4 37e42: 85 2c mov r8, r5 37e44: 9a 2c mov r9, r10 37e46: 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) ? 37e48: 87 2d mov r24, r7 37e4a: 98 2d mov r25, r8 37e4c: a9 2d mov r26, r9 37e4e: be 2d mov r27, r14 37e50: f6 01 movw r30, r12 37e52: 85 a3 std Z+37, r24 ; 0x25 37e54: 96 a3 std Z+38, r25 ; 0x26 37e56: a7 a3 std Z+39, r26 ; 0x27 37e58: 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; 37e5a: 01 60 ori r16, 0x01 ; 1 37e5c: 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) 37e5e: 11 11 cpse r17, r1 37e60: 01 c0 rjmp .+2 ; 0x37e64 block_index = BLOCK_BUFFER_SIZE; 37e62: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37e64: 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)); 37e66: 16 9d mul r17, r6 37e68: c0 01 movw r24, r0 37e6a: 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; 37e6c: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 37e6e: 9c 01 movw r18, r24 37e70: 2b 53 subi r18, 0x3B ; 59 37e72: 39 4f sbci r19, 0xF9 ; 249 37e74: 69 01 movw r12, r18 37e76: 0b cc rjmp .-2026 ; 0x3768e 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)); 37e78: 6c 01 movw r12, r24 37e7a: 2f cc rjmp .-1954 ; 0x376da 37e7c: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 37e7e: 0d 94 93 b1 jmp 0x36326 ; 0x36326 00037e82 : 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(){ 37e82: 4f 92 push r4 37e84: 5f 92 push r5 37e86: 6f 92 push r6 37e88: 7f 92 push r7 37e8a: 8f 92 push r8 37e8c: 9f 92 push r9 37e8e: af 92 push r10 37e90: bf 92 push r11 37e92: cf 92 push r12 37e94: df 92 push r13 37e96: ef 92 push r14 37e98: ff 92 push r15 37e9a: cf 93 push r28 37e9c: df 93 push r29 37e9e: cd b7 in r28, 0x3d ; 61 37ea0: de b7 in r29, 0x3e ; 62 37ea2: 2c 97 sbiw r28, 0x0c ; 12 37ea4: 0f b6 in r0, 0x3f ; 63 37ea6: f8 94 cli 37ea8: de bf out 0x3e, r29 ; 62 37eaa: 0f be out 0x3f, r0 ; 63 37eac: 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]); 37eae: c0 90 9a 06 lds r12, 0x069A ; 0x80069a 37eb2: d0 90 9b 06 lds r13, 0x069B ; 0x80069b 37eb6: e0 90 9c 06 lds r14, 0x069C ; 0x80069c 37eba: f0 90 9d 06 lds r15, 0x069D ; 0x80069d 37ebe: 80 91 96 06 lds r24, 0x0696 ; 0x800696 37ec2: 90 91 97 06 lds r25, 0x0697 ; 0x800697 37ec6: a0 91 98 06 lds r26, 0x0698 ; 0x800698 37eca: b0 91 99 06 lds r27, 0x0699 ; 0x800699 37ece: 40 91 92 06 lds r20, 0x0692 ; 0x800692 37ed2: 50 91 93 06 lds r21, 0x0693 ; 0x800693 37ed6: 60 91 94 06 lds r22, 0x0694 ; 0x800694 37eda: 70 91 95 06 lds r23, 0x0695 ; 0x800695 37ede: 4d 83 std Y+5, r20 ; 0x05 37ee0: 5e 83 std Y+6, r21 ; 0x06 37ee2: 6f 83 std Y+7, r22 ; 0x07 37ee4: 78 87 std Y+8, r23 ; 0x08 37ee6: 89 83 std Y+1, r24 ; 0x01 37ee8: 9a 83 std Y+2, r25 ; 0x02 37eea: ab 83 std Y+3, r26 ; 0x03 37eec: 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); 37eee: be 01 movw r22, r28 37ef0: 6f 5f subi r22, 0xFF ; 255 37ef2: 7f 4f sbci r23, 0xFF ; 255 37ef4: ce 01 movw r24, r28 37ef6: 05 96 adiw r24, 0x05 ; 5 37ef8: 0e 94 82 69 call 0xd304 ; 0xd304 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 37efc: 4d 80 ldd r4, Y+5 ; 0x05 37efe: 5e 80 ldd r5, Y+6 ; 0x06 37f00: 6f 80 ldd r6, Y+7 ; 0x07 37f02: 78 84 ldd r7, Y+8 ; 0x08 37f04: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 37f08: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 37f0c: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 37f10: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 37f14: c3 01 movw r24, r6 37f16: b2 01 movw r22, r4 37f18: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37f1c: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 37f20: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 37f24: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 37f28: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 37f2c: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 37f30: 89 80 ldd r8, Y+1 ; 0x01 37f32: 9a 80 ldd r9, Y+2 ; 0x02 37f34: ab 80 ldd r10, Y+3 ; 0x03 37f36: bc 80 ldd r11, Y+4 ; 0x04 37f38: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 37f3c: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 37f40: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 37f44: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 37f48: c5 01 movw r24, r10 37f4a: b4 01 movw r22, r8 37f4c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37f50: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 37f54: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 37f58: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 37f5c: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 37f60: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 37f64: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 37f68: 88 23 and r24, r24 37f6a: 09 f4 brne .+2 ; 0x37f6e 37f6c: 8c c0 rjmp .+280 ; 0x38086 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 37f6e: a5 01 movw r20, r10 37f70: 94 01 movw r18, r8 37f72: c3 01 movw r24, r6 37f74: b2 01 movw r22, r4 37f76: 0f 94 e9 a1 call 0x343d2 ; 0x343d2 37f7a: 9b 01 movw r18, r22 37f7c: ac 01 movw r20, r24 37f7e: c7 01 movw r24, r14 37f80: b6 01 movw r22, r12 37f82: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 37f86: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 37f8a: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 37f8e: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 37f92: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd lround(z*cs.axis_steps_per_mm[Z_AXIS]); 37f96: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__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 ? 37f9a: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 37f9e: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 37fa2: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 37fa6: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 37faa: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae 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]); 37fae: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 37fb2: 90 91 9f 06 lds r25, 0x069F ; 0x80069f 37fb6: a0 91 a0 06 lds r26, 0x06A0 ; 0x8006a0 37fba: b0 91 a1 06 lds r27, 0x06A1 ; 0x8006a1 37fbe: 89 87 std Y+9, r24 ; 0x09 37fc0: 9a 87 std Y+10, r25 ; 0x0a 37fc2: ab 87 std Y+11, r26 ; 0x0b 37fc4: bc 87 std Y+12, r27 ; 0x0c 37fc6: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 37fca: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 37fce: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 37fd2: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 37fd6: bc 01 movw r22, r24 37fd8: cd 01 movw r24, r26 37fda: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 37fde: 0f 94 b9 e0 call 0x3c172 ; 0x3c172 37fe2: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 37fe6: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 37fea: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 37fee: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37ff2: 40 92 cd 04 sts 0x04CD, r4 ; 0x8004cd 37ff6: 50 92 ce 04 sts 0x04CE, r5 ; 0x8004ce 37ffa: 60 92 cf 04 sts 0x04CF, r6 ; 0x8004cf 37ffe: 70 92 d0 04 sts 0x04D0, r7 ; 0x8004d0 position_float[Y_AXIS] = y; 38002: 80 92 d1 04 sts 0x04D1, r8 ; 0x8004d1 38006: 90 92 d2 04 sts 0x04D2, r9 ; 0x8004d2 3800a: a0 92 d3 04 sts 0x04D3, r10 ; 0x8004d3 3800e: b0 92 d4 04 sts 0x04D4, r11 ; 0x8004d4 position_float[Z_AXIS] = z; 38012: c0 92 d5 04 sts 0x04D5, r12 ; 0x8004d5 38016: d0 92 d6 04 sts 0x04D6, r13 ; 0x8004d6 3801a: e0 92 d7 04 sts 0x04D7, r14 ; 0x8004d7 3801e: f0 92 d8 04 sts 0x04D8, r15 ; 0x8004d8 position_float[E_AXIS] = e; 38022: 89 85 ldd r24, Y+9 ; 0x09 38024: 9a 85 ldd r25, Y+10 ; 0x0a 38026: ab 85 ldd r26, Y+11 ; 0x0b 38028: bc 85 ldd r27, Y+12 ; 0x0c 3802a: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 3802e: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 38032: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 38036: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif st_set_position(position); 3803a: 0f 94 23 88 call 0x31046 ; 0x31046 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 3803e: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.490> 38042: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.490+0x1> 38046: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.490+0x2> 3804a: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.490+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 3804e: ed eb ldi r30, 0xBD ; 189 38050: f4 e0 ldi r31, 0x04 ; 4 38052: 80 e1 ldi r24, 0x10 ; 16 38054: df 01 movw r26, r30 38056: 1d 92 st X+, r1 38058: 8a 95 dec r24 3805a: e9 f7 brne .-6 ; 0x38056 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]); } 3805c: 2c 96 adiw r28, 0x0c ; 12 3805e: 0f b6 in r0, 0x3f ; 63 38060: f8 94 cli 38062: de bf out 0x3e, r29 ; 62 38064: 0f be out 0x3f, r0 ; 63 38066: cd bf out 0x3d, r28 ; 61 38068: df 91 pop r29 3806a: cf 91 pop r28 3806c: ff 90 pop r15 3806e: ef 90 pop r14 38070: df 90 pop r13 38072: cf 90 pop r12 38074: bf 90 pop r11 38076: af 90 pop r10 38078: 9f 90 pop r9 3807a: 8f 90 pop r8 3807c: 7f 90 pop r7 3807e: 6f 90 pop r6 38080: 5f 90 pop r5 38082: 4f 90 pop r4 38084: 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]); 38086: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 3808a: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 3808e: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 38092: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 38096: c7 01 movw r24, r14 38098: b6 01 movw r22, r12 3809a: 7d cf rjmp .-262 ; 0x37f96 0003809c : 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) { 3809c: 8f 92 push r8 3809e: 9f 92 push r9 380a0: af 92 push r10 380a2: bf 92 push r11 380a4: cf 92 push r12 380a6: df 92 push r13 380a8: ef 92 push r14 380aa: ff 92 push r15 380ac: 0f 93 push r16 380ae: 1f 93 push r17 380b0: 4b 01 movw r8, r22 380b2: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 380b4: e4 e7 ldi r30, 0x74 ; 116 380b6: f6 e0 ldi r31, 0x06 ; 6 380b8: e0 84 ldd r14, Z+8 ; 0x08 380ba: f1 84 ldd r15, Z+9 ; 0x09 380bc: 02 85 ldd r16, Z+10 ; 0x0a 380be: 13 85 ldd r17, Z+11 ; 0x0b 380c0: 24 81 ldd r18, Z+4 ; 0x04 380c2: 35 81 ldd r19, Z+5 ; 0x05 380c4: 46 81 ldd r20, Z+6 ; 0x06 380c6: 57 81 ldd r21, Z+7 ; 0x07 380c8: 60 81 ld r22, Z 380ca: 71 81 ldd r23, Z+1 ; 0x01 380cc: 82 81 ldd r24, Z+2 ; 0x02 380ce: 93 81 ldd r25, Z+3 ; 0x03 380d0: 1f 92 push r1 380d2: 1f 92 push r1 380d4: 1f 92 push r1 380d6: 1f 92 push r1 380d8: e0 e8 ldi r30, 0x80 ; 128 380da: ce 2e mov r12, r30 380dc: e6 e0 ldi r30, 0x06 ; 6 380de: de 2e mov r13, r30 380e0: 0f 94 2c b1 call 0x36258 ; 0x36258 380e4: 0f 90 pop r0 380e6: 0f 90 pop r0 380e8: 0f 90 pop r0 380ea: 0f 90 pop r0 } 380ec: 1f 91 pop r17 380ee: 0f 91 pop r16 380f0: ff 90 pop r15 380f2: ef 90 pop r14 380f4: df 90 pop r13 380f6: cf 90 pop r12 380f8: bf 90 pop r11 380fa: af 90 pop r10 380fc: 9f 90 pop r9 380fe: 8f 90 pop r8 38100: 08 95 ret 00038102 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 38102: 8f 92 push r8 38104: 9f 92 push r9 38106: af 92 push r10 38108: bf 92 push r11 3810a: cf 92 push r12 3810c: df 92 push r13 3810e: ef 92 push r14 38110: ff 92 push r15 38112: 0f 93 push r16 38114: 1f 93 push r17 38116: 4b 01 movw r8, r22 38118: 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); 3811a: e2 e9 ldi r30, 0x92 ; 146 3811c: f6 e0 ldi r31, 0x06 ; 6 3811e: e0 84 ldd r14, Z+8 ; 0x08 38120: f1 84 ldd r15, Z+9 ; 0x09 38122: 02 85 ldd r16, Z+10 ; 0x0a 38124: 13 85 ldd r17, Z+11 ; 0x0b 38126: 24 81 ldd r18, Z+4 ; 0x04 38128: 35 81 ldd r19, Z+5 ; 0x05 3812a: 46 81 ldd r20, Z+6 ; 0x06 3812c: 57 81 ldd r21, Z+7 ; 0x07 3812e: 60 81 ld r22, Z 38130: 71 81 ldd r23, Z+1 ; 0x01 38132: 82 81 ldd r24, Z+2 ; 0x02 38134: 93 81 ldd r25, Z+3 ; 0x03 38136: 1f 92 push r1 38138: 1f 92 push r1 3813a: 1f 92 push r1 3813c: 1f 92 push r1 3813e: ee e9 ldi r30, 0x9E ; 158 38140: ce 2e mov r12, r30 38142: e6 e0 ldi r30, 0x06 ; 6 38144: de 2e mov r13, r30 38146: 0f 94 2c b1 call 0x36258 ; 0x36258 3814a: 0f 90 pop r0 3814c: 0f 90 pop r0 3814e: 0f 90 pop r0 38150: 0f 90 pop r0 } 38152: 1f 91 pop r17 38154: 0f 91 pop r16 38156: ff 90 pop r15 38158: ef 90 pop r14 3815a: df 90 pop r13 3815c: cf 90 pop r12 3815e: bf 90 pop r11 38160: af 90 pop r10 38162: 9f 90 pop r9 38164: 8f 90 pop r8 38166: 08 95 ret 00038168 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 38168: 4f 92 push r4 3816a: 5f 92 push r5 3816c: 6f 92 push r6 3816e: 7f 92 push r7 38170: 8f 92 push r8 38172: 9f 92 push r9 38174: af 92 push r10 38176: bf 92 push r11 38178: cf 92 push r12 3817a: df 92 push r13 3817c: ef 92 push r14 3817e: ff 92 push r15 38180: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 38182: 80 e0 ldi r24, 0x00 ; 0 38184: 0f 94 cb 43 call 0x28796 ; 0x28796 38188: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 3818c: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 38190: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 38194: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 position[Y_AXIS] = st_get_position(Y_AXIS); 38198: 81 e0 ldi r24, 0x01 ; 1 3819a: 0f 94 cb 43 call 0x28796 ; 0x28796 3819e: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 381a2: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 381a6: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 381aa: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa position[Z_AXIS] = st_get_position(Z_AXIS); 381ae: 82 e0 ldi r24, 0x02 ; 2 381b0: 0f 94 cb 43 call 0x28796 ; 0x28796 381b4: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 381b8: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 381bc: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 381c0: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae position[E_AXIS] = st_get_position(E_AXIS); 381c4: 83 e0 ldi r24, 0x03 ; 3 381c6: 0f 94 cb 43 call 0x28796 ; 0x28796 381ca: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 381ce: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 381d2: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 381d6: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 381da: 80 e0 ldi r24, 0x00 ; 0 381dc: 0f 94 d9 43 call 0x287b2 ; 0x287b2 381e0: 60 93 92 06 sts 0x0692, r22 ; 0x800692 381e4: 70 93 93 06 sts 0x0693, r23 ; 0x800693 381e8: 80 93 94 06 sts 0x0694, r24 ; 0x800694 381ec: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 381f0: 81 e0 ldi r24, 0x01 ; 1 381f2: 0f 94 d9 43 call 0x287b2 ; 0x287b2 381f6: 60 93 96 06 sts 0x0696, r22 ; 0x800696 381fa: 70 93 97 06 sts 0x0697, r23 ; 0x800697 381fe: 80 93 98 06 sts 0x0698, r24 ; 0x800698 38202: 90 93 99 06 sts 0x0699, r25 ; 0x800699 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 38206: 82 e0 ldi r24, 0x02 ; 2 38208: 0f 94 d9 43 call 0x287b2 ; 0x287b2 3820c: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 38210: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 38214: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 38218: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d current_position[E_AXIS] = st_get_position_mm(E_AXIS); 3821c: 83 e0 ldi r24, 0x03 ; 3 3821e: 0f 94 d9 43 call 0x287b2 ; 0x287b2 38222: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 38226: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 3822a: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 3822e: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 38232: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 38236: 88 23 and r24, r24 38238: 31 f1 breq .+76 ; 0x38286 #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]); 3823a: 20 91 96 06 lds r18, 0x0696 ; 0x800696 3823e: 30 91 97 06 lds r19, 0x0697 ; 0x800697 38242: 40 91 98 06 lds r20, 0x0698 ; 0x800698 38246: 50 91 99 06 lds r21, 0x0699 ; 0x800699 3824a: 60 91 92 06 lds r22, 0x0692 ; 0x800692 3824e: 70 91 93 06 lds r23, 0x0693 ; 0x800693 38252: 80 91 94 06 lds r24, 0x0694 ; 0x800694 38256: 90 91 95 06 lds r25, 0x0695 ; 0x800695 3825a: 0f 94 e9 a1 call 0x343d2 ; 0x343d2 3825e: 9b 01 movw r18, r22 38260: ac 01 movw r20, r24 38262: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 38266: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 3826a: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3826e: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 38272: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 38276: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 3827a: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3827e: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 38282: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 38286: c0 91 0f 18 lds r28, 0x180F ; 0x80180f 3828a: cc 23 and r28, r28 3828c: 09 f4 brne .+2 ; 0x38290 3828e: 9a c0 rjmp .+308 ; 0x383c4 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 38290: c0 ff sbrs r28, 0 38292: 34 c0 rjmp .+104 ; 0x382fc // Then add the offset. x -= world2machine_shift[0]; 38294: 20 91 07 18 lds r18, 0x1807 ; 0x801807 38298: 30 91 08 18 lds r19, 0x1808 ; 0x801808 3829c: 40 91 09 18 lds r20, 0x1809 ; 0x801809 382a0: 50 91 0a 18 lds r21, 0x180A ; 0x80180a 382a4: 60 91 92 06 lds r22, 0x0692 ; 0x800692 382a8: 70 91 93 06 lds r23, 0x0693 ; 0x800693 382ac: 80 91 94 06 lds r24, 0x0694 ; 0x800694 382b0: 90 91 95 06 lds r25, 0x0695 ; 0x800695 382b4: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 382b8: 60 93 92 06 sts 0x0692, r22 ; 0x800692 382bc: 70 93 93 06 sts 0x0693, r23 ; 0x800693 382c0: 80 93 94 06 sts 0x0694, r24 ; 0x800694 382c4: 90 93 95 06 sts 0x0695, r25 ; 0x800695 y -= world2machine_shift[1]; 382c8: 20 91 0b 18 lds r18, 0x180B ; 0x80180b 382cc: 30 91 0c 18 lds r19, 0x180C ; 0x80180c 382d0: 40 91 0d 18 lds r20, 0x180D ; 0x80180d 382d4: 50 91 0e 18 lds r21, 0x180E ; 0x80180e 382d8: 60 91 96 06 lds r22, 0x0696 ; 0x800696 382dc: 70 91 97 06 lds r23, 0x0697 ; 0x800697 382e0: 80 91 98 06 lds r24, 0x0698 ; 0x800698 382e4: 90 91 99 06 lds r25, 0x0699 ; 0x800699 382e8: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 382ec: 60 93 96 06 sts 0x0696, r22 ; 0x800696 382f0: 70 93 97 06 sts 0x0697, r23 ; 0x800697 382f4: 80 93 98 06 sts 0x0698, r24 ; 0x800698 382f8: 90 93 99 06 sts 0x0699, r25 ; 0x800699 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 382fc: c1 ff sbrs r28, 1 382fe: 62 c0 rjmp .+196 ; 0x383c4 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 38300: 80 90 92 06 lds r8, 0x0692 ; 0x800692 38304: 90 90 93 06 lds r9, 0x0693 ; 0x800693 38308: a0 90 94 06 lds r10, 0x0694 ; 0x800694 3830c: b0 90 95 06 lds r11, 0x0695 ; 0x800695 38310: c0 90 96 06 lds r12, 0x0696 ; 0x800696 38314: d0 90 97 06 lds r13, 0x0697 ; 0x800697 38318: e0 90 98 06 lds r14, 0x0698 ; 0x800698 3831c: f0 90 99 06 lds r15, 0x0699 ; 0x800699 float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 38320: 20 91 ff 17 lds r18, 0x17FF ; 0x8017ff 38324: 30 91 00 18 lds r19, 0x1800 ; 0x801800 38328: 40 91 01 18 lds r20, 0x1801 ; 0x801801 3832c: 50 91 02 18 lds r21, 0x1802 ; 0x801802 38330: c5 01 movw r24, r10 38332: b4 01 movw r22, r8 38334: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 38338: 2b 01 movw r4, r22 3833a: 3c 01 movw r6, r24 3833c: 20 91 03 18 lds r18, 0x1803 ; 0x801803 38340: 30 91 04 18 lds r19, 0x1804 ; 0x801804 38344: 40 91 05 18 lds r20, 0x1805 ; 0x801805 38348: 50 91 06 18 lds r21, 0x1806 ; 0x801806 3834c: c7 01 movw r24, r14 3834e: b6 01 movw r22, r12 38350: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 38354: 9b 01 movw r18, r22 38356: ac 01 movw r20, r24 38358: c3 01 movw r24, r6 3835a: b2 01 movw r22, r4 3835c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 38360: 2b 01 movw r4, r22 38362: 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; 38364: 20 91 f7 17 lds r18, 0x17F7 ; 0x8017f7 38368: 30 91 f8 17 lds r19, 0x17F8 ; 0x8017f8 3836c: 40 91 f9 17 lds r20, 0x17F9 ; 0x8017f9 38370: 50 91 fa 17 lds r21, 0x17FA ; 0x8017fa 38374: c5 01 movw r24, r10 38376: b4 01 movw r22, r8 38378: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3837c: 4b 01 movw r8, r22 3837e: 5c 01 movw r10, r24 38380: 20 91 fb 17 lds r18, 0x17FB ; 0x8017fb 38384: 30 91 fc 17 lds r19, 0x17FC ; 0x8017fc 38388: 40 91 fd 17 lds r20, 0x17FD ; 0x8017fd 3838c: 50 91 fe 17 lds r21, 0x17FE ; 0x8017fe 38390: c7 01 movw r24, r14 38392: b6 01 movw r22, r12 38394: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 38398: 9b 01 movw r18, r22 3839a: ac 01 movw r20, r24 3839c: c5 01 movw r24, r10 3839e: b4 01 movw r22, r8 383a0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 383a4: 60 93 92 06 sts 0x0692, r22 ; 0x800692 383a8: 70 93 93 06 sts 0x0693, r23 ; 0x800693 383ac: 80 93 94 06 sts 0x0694, r24 ; 0x800694 383b0: 90 93 95 06 sts 0x0695, r25 ; 0x800695 y = out_y; 383b4: 40 92 96 06 sts 0x0696, r4 ; 0x800696 383b8: 50 92 97 06 sts 0x0697, r5 ; 0x800697 383bc: 60 92 98 06 sts 0x0698, r6 ; 0x800698 383c0: 70 92 99 06 sts 0x0699, r7 ; 0x800699 } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 383c4: 0e 94 ba 67 call 0xcf74 ; 0xcf74 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 383c8: 80 e1 ldi r24, 0x10 ; 16 383ca: e2 e9 ldi r30, 0x92 ; 146 383cc: f6 e0 ldi r31, 0x06 ; 6 383ce: ad ec ldi r26, 0xCD ; 205 383d0: b4 e0 ldi r27, 0x04 ; 4 383d2: 01 90 ld r0, Z+ 383d4: 0d 92 st X+, r0 383d6: 8a 95 dec r24 383d8: e1 f7 brne .-8 ; 0x383d2 #endif } 383da: cf 91 pop r28 383dc: ff 90 pop r15 383de: ef 90 pop r14 383e0: df 90 pop r13 383e2: cf 90 pop r12 383e4: bf 90 pop r11 383e6: af 90 pop r10 383e8: 9f 90 pop r9 383ea: 8f 90 pop r8 383ec: 7f 90 pop r7 383ee: 6f 90 pop r6 383f0: 5f 90 pop r5 383f2: 4f 90 pop r4 383f4: 08 95 ret 000383f6 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 383f6: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 383fa: 8d 7f andi r24, 0xFD ; 253 383fc: 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(); 38400: 0f 94 b4 c0 call 0x38168 ; 0x38168 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 38404: 81 e0 ldi r24, 0x01 ; 1 38406: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 3840a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3840e: 8d 7f andi r24, 0xFD ; 253 38410: 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); 38414: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 38418: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while (blocks_queued()) plan_discard_current_block(); 3841c: 98 17 cp r25, r24 3841e: 69 f0 breq .+26 ; 0x3843a 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) { 38420: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 38424: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 38428: 98 17 cp r25, r24 3842a: a1 f3 breq .-24 ; 0x38414 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 3842c: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 38430: 8f 5f subi r24, 0xFF ; 255 38432: 8f 70 andi r24, 0x0F ; 15 38434: 80 93 a6 0d sts 0x0DA6, r24 ; 0x800da6 38438: ed cf rjmp .-38 ; 0x38414 current_block = NULL; 3843a: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 3843e: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 38442: 8f ef ldi r24, 0xFF ; 255 38444: 9f ef ldi r25, 0xFF ; 255 38446: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.479+0x1> 3844a: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.479> current_adv_steps = 0; 3844e: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.481+0x1> 38452: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.481> #endif st_reset_timer(); 38456: 0f 94 47 44 call 0x2888e ; 0x2888e ENABLE_STEPPER_DRIVER_INTERRUPT(); 3845a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3845e: 82 60 ori r24, 0x02 ; 2 38460: 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; 38464: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.490> 38468: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.490+0x1> 3846c: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.490+0x2> 38470: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.490+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 38474: ed eb ldi r30, 0xBD ; 189 38476: f4 e0 ldi r31, 0x04 ; 4 38478: 80 e1 ldi r24, 0x10 ; 16 3847a: df 01 movw r26, r30 3847c: 1d 92 st X+, r1 3847e: 8a 95 dec r24 38480: e9 f7 brne .-6 ; 0x3847c // Reset position sync requests plan_reset_next_e_queue = false; 38482: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.488> plan_reset_next_e_sched = false; 38486: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.489> } 3848a: 08 95 ret 0003848c : pat9125_PID2 = 0xff; return 0; } static void pat9125_wr_reg(uint8_t addr, uint8_t data) { 3848c: cf 93 push r28 3848e: c6 2f mov r28, r22 } uint8_t twi_w8(uint8_t address, uint8_t reg, uint8_t data) { if(twi_start(address, reg)) 38490: 0f 94 fe 7b call 0x2f7fc ; 0x2f7fc 38494: 81 11 cpse r24, r1 38496: 0f c0 rjmp .+30 ; 0x384b6 return 1; // send data TWDR = data; 38498: c0 93 bb 00 sts 0x00BB, r28 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 3849c: 84 e8 ldi r24, 0x84 ; 132 3849e: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 384a2: 88 e2 ldi r24, 0x28 ; 40 384a4: 0f 94 be 2a call 0x2557c ; 0x2557c 384a8: 81 11 cpse r24, r1 384aa: 05 c0 rjmp .+10 ; 0x384b6 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 384ac: 84 e9 ldi r24, 0x94 ; 148 384ae: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return; } 384b2: cf 91 pop r28 384b4: 08 95 ret goto error; #endif return; error: pat9125_PID1 = 0xff; 384b6: 8f ef ldi r24, 0xFF ; 255 384b8: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = 0xff; 384bc: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc 384c0: f8 cf rjmp .-16 ; 0x384b2 000384c2 : } return 0; } static uint8_t pat9125_rd_reg(uint8_t addr) { 384c2: cf 93 push r28 } uint8_t twi_r8(uint8_t address, uint8_t reg, uint8_t* data) { if(twi_start(address, reg)) 384c4: 0f 94 fe 7b call 0x2f7fc ; 0x2f7fc 384c8: 81 11 cpse r24, r1 384ca: 21 c0 rjmp .+66 ; 0x3850e return 1; // repeat start TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 384cc: 84 ea ldi r24, 0xA4 ; 164 384ce: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_REP_START)) 384d2: 80 e1 ldi r24, 0x10 ; 16 384d4: 0f 94 be 2a call 0x2557c ; 0x2557c 384d8: 81 11 cpse r24, r1 384da: 19 c0 rjmp .+50 ; 0x3850e return 2; // start receiving TWDR = TW_READ | (address << 1); 384dc: 8b ee ldi r24, 0xEB ; 235 384de: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 384e2: c4 e8 ldi r28, 0x84 ; 132 384e4: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_SLA_ACK)) 384e8: 80 e4 ldi r24, 0x40 ; 64 384ea: 0f 94 be 2a call 0x2557c ; 0x2557c 384ee: 81 11 cpse r24, r1 384f0: 0e c0 rjmp .+28 ; 0x3850e return 3; // receive data TWCR = _BV(TWEN) | _BV(TWINT); 384f2: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_DATA_NACK)) 384f6: 88 e5 ldi r24, 0x58 ; 88 384f8: 0f 94 be 2a call 0x2557c ; 0x2557c 384fc: 81 11 cpse r24, r1 384fe: 07 c0 rjmp .+14 ; 0x3850e return 4; *data = TWDR; 38500: 80 91 bb 00 lds r24, 0x00BB ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 38504: 94 e9 ldi r25, 0x94 ; 148 38506: 90 93 bc 00 sts 0x00BC, r25 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return 0; } 3850a: cf 91 pop r28 3850c: 08 95 ret goto error; #endif return data; error: pat9125_PID1 = 0xff; 3850e: 8f ef ldi r24, 0xFF ; 255 38510: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = 0xff; 38514: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc return 0; 38518: 80 e0 ldi r24, 0x00 ; 0 3851a: f7 cf rjmp .-18 ; 0x3850a 0003851c : pat9125_wr_reg(addr, data); return pat9125_rd_reg(addr) == data; } static uint8_t pat9125_wr_seq(const uint8_t* seq) { 3851c: 0f 93 push r16 3851e: 1f 93 push r17 38520: cf 93 push r28 38522: df 93 push r29 38524: 8c 01 movw r16, r24 for (;;) { const uint8_t addr = pgm_read_byte(seq++); 38526: f8 01 movw r30, r16 38528: d4 91 lpm r29, Z if (addr == 0xff) 3852a: df 3f cpi r29, 0xFF ; 255 3852c: 99 f0 breq .+38 ; 0x38554 break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 3852e: 31 96 adiw r30, 0x01 ; 1 38530: c4 91 lpm r28, Z return; } static uint8_t pat9125_wr_reg_verify(uint8_t addr, uint8_t data) { pat9125_wr_reg(addr, data); 38532: 6c 2f mov r22, r28 38534: 8d 2f mov r24, r29 38536: 0f 94 46 c2 call 0x3848c ; 0x3848c return pat9125_rd_reg(addr) == data; 3853a: 8d 2f mov r24, r29 3853c: 0f 94 61 c2 call 0x384c2 ; 0x384c2 { for (;;) { const uint8_t addr = pgm_read_byte(seq++); if (addr == 0xff) break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 38540: 0e 5f subi r16, 0xFE ; 254 38542: 1f 4f sbci r17, 0xFF ; 255 38544: c8 17 cp r28, r24 38546: 79 f3 breq .-34 ; 0x38526 // Verification of the register write failed. return 0; 38548: 80 e0 ldi r24, 0x00 ; 0 } return 1; } 3854a: df 91 pop r29 3854c: cf 91 pop r28 3854e: 1f 91 pop r17 38550: 0f 91 pop r16 38552: 08 95 ret break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) // Verification of the register write failed. return 0; } return 1; 38554: 81 e0 ldi r24, 0x01 ; 1 38556: f9 cf rjmp .-14 ; 0x3854a 00038558 : return 1; } uint8_t pat9125_update(void) { 38558: cf 93 push r28 3855a: df 93 push r29 if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 3855c: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 38560: 81 33 cpi r24, 0x31 ; 49 38562: 21 f0 breq .+8 ; 0x3856c pat9125_x += iDX; pat9125_y += iDY; } return 1; } return 0; 38564: 80 e0 ldi r24, 0x00 ; 0 } 38566: df 91 pop r29 38568: cf 91 pop r28 3856a: 08 95 ret return 1; } uint8_t pat9125_update(void) { if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 3856c: 80 91 bc 0d lds r24, 0x0DBC ; 0x800dbc 38570: 81 39 cpi r24, 0x91 ; 145 38572: c1 f7 brne .-16 ; 0x38564 { uint8_t ucMotion = pat9125_rd_reg(PAT9125_MOTION); 38574: 82 e0 ldi r24, 0x02 ; 2 38576: 0f 94 61 c2 call 0x384c2 ; 0x384c2 3857a: c8 2f mov r28, r24 pat9125_b = pat9125_rd_reg(PAT9125_FRAME); 3857c: 87 e1 ldi r24, 0x17 ; 23 3857e: 0f 94 61 c2 call 0x384c2 ; 0x384c2 38582: 80 93 ba 0d sts 0x0DBA, r24 ; 0x800dba pat9125_s = pat9125_rd_reg(PAT9125_SHUTTER); 38586: 84 e1 ldi r24, 0x14 ; 20 38588: 0f 94 61 c2 call 0x384c2 ; 0x384c2 3858c: 80 93 bb 0d sts 0x0DBB, r24 ; 0x800dbb if (pat9125_PID1 == 0xff) return 0; 38590: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 38594: 8f 3f cpi r24, 0xFF ; 255 38596: 31 f3 breq .-52 ; 0x38564 if (ucMotion & 0x80) 38598: c7 ff sbrs r28, 7 3859a: 36 c0 rjmp .+108 ; 0x38608 { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); 3859c: 83 e0 ldi r24, 0x03 ; 3 3859e: 0f 94 61 c2 call 0x384c2 ; 0x384c2 385a2: d8 2f mov r29, r24 uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); 385a4: 84 e0 ldi r24, 0x04 ; 4 385a6: 0f 94 61 c2 call 0x384c2 ; 0x384c2 385aa: c8 2f mov r28, r24 uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 385ac: 82 e1 ldi r24, 0x12 ; 18 385ae: 0f 94 61 c2 call 0x384c2 ; 0x384c2 if (pat9125_PID1 == 0xff) return 0; 385b2: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 385b6: 9f 3f cpi r25, 0xFF ; 255 385b8: a9 f2 breq .-86 ; 0x38564 if (pat9125_PID1 == 0xff) return 0; if (ucMotion & 0x80) { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 385ba: 90 e0 ldi r25, 0x00 ; 0 if (pat9125_PID1 == 0xff) return 0; int16_t iDX = ucXL | ((ucXYH << 4) & 0xf00); 385bc: 9c 01 movw r18, r24 385be: 44 e0 ldi r20, 0x04 ; 4 385c0: 22 0f add r18, r18 385c2: 33 1f adc r19, r19 385c4: 4a 95 dec r20 385c6: e1 f7 brne .-8 ; 0x385c0 385c8: 22 27 eor r18, r18 385ca: 3f 70 andi r19, 0x0F ; 15 385cc: 2d 2b or r18, r29 int16_t iDY = ucYL | ((ucXYH << 8) & 0xf00); 385ce: 98 2f mov r25, r24 385d0: 88 27 eor r24, r24 385d2: 88 27 eor r24, r24 385d4: 9f 70 andi r25, 0x0F ; 15 385d6: 8c 2b or r24, r28 if (iDX & 0x800) iDX -= 4096; 385d8: 33 fd sbrc r19, 3 385da: 30 51 subi r19, 0x10 ; 16 if (iDY & 0x800) iDY -= 4096; 385dc: 93 fd sbrc r25, 3 385de: 90 51 subi r25, 0x10 ; 16 pat9125_x += iDX; 385e0: 40 91 97 03 lds r20, 0x0397 ; 0x800397 385e4: 50 91 98 03 lds r21, 0x0398 ; 0x800398 385e8: 24 0f add r18, r20 385ea: 35 1f adc r19, r21 385ec: 30 93 98 03 sts 0x0398, r19 ; 0x800398 385f0: 20 93 97 03 sts 0x0397, r18 ; 0x800397 pat9125_y += iDY; 385f4: 20 91 8f 0e lds r18, 0x0E8F ; 0x800e8f 385f8: 30 91 90 0e lds r19, 0x0E90 ; 0x800e90 385fc: 82 0f add r24, r18 385fe: 93 1f adc r25, r19 38600: 90 93 90 0e sts 0x0E90, r25 ; 0x800e90 38604: 80 93 8f 0e sts 0x0E8F, r24 ; 0x800e8f } return 1; 38608: 81 e0 ldi r24, 0x01 ; 1 3860a: ad cf rjmp .-166 ; 0x38566 0003860c : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 3860c: 84 b1 in r24, 0x04 ; 4 3860e: 81 7f andi r24, 0xF1 ; 241 38610: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 38612: 84 b1 in r24, 0x04 ; 4 38614: 87 60 ori r24, 0x07 ; 7 38616: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 38618: 85 b1 in r24, 0x05 ; 5 3861a: 81 7f andi r24, 0xF1 ; 241 3861c: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 3861e: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 38620: 80 e5 ldi r24, 0x50 ; 80 38622: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 38624: 1d bc out 0x2d, r1 ; 45 } 38626: 08 95 ret 00038628 : //! @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() { 38628: 2f 92 push r2 3862a: 3f 92 push r3 3862c: 4f 92 push r4 3862e: 5f 92 push r5 38630: 6f 92 push r6 38632: 7f 92 push r7 38634: 8f 92 push r8 38636: 9f 92 push r9 38638: af 92 push r10 3863a: bf 92 push r11 3863c: cf 92 push r12 3863e: df 92 push r13 38640: ef 92 push r14 38642: ff 92 push r15 38644: 0f 93 push r16 38646: 1f 93 push r17 38648: cf 93 push r28 3864a: df 93 push r29 3864c: cd b7 in r28, 0x3d ; 61 3864e: de b7 in r29, 0x3e ; 62 38650: c6 50 subi r28, 0x06 ; 6 38652: d1 40 sbci r29, 0x01 ; 1 38654: 0f b6 in r0, 0x3f ; 63 38656: f8 94 cli 38658: de bf out 0x3e, r29 ; 62 3865a: 0f be out 0x3f, r0 ; 63 3865c: 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; 3865e: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7dc> 38662: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7dd> 38666: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7de> 3866a: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7df> 3866e: 8a 3a cpi r24, 0xAA ; 170 38670: 95 45 sbci r25, 0x55 ; 85 38672: aa 4a sbci r26, 0xAA ; 170 38674: b5 45 sbci r27, 0x55 ; 85 38676: 21 f4 brne .+8 ; 0x38680 38678: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 3867c: 87 fd sbrc r24, 7 3867e: c2 c1 rjmp .+900 ; 0x38a04 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(); 38680: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 38682: d0 90 39 05 lds r13, 0x0539 ; 0x800539 // Flush the serial line. while (RECV_READY) { 38686: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 3868a: 87 ff sbrs r24, 7 3868c: 04 c0 rjmp .+8 ; 0x38696 wdt_reset(); 3868e: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 38690: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 38694: f8 cf rjmp .-16 ; 0x38686 } selectedSerialPort = 0; //switch to Serial0 38696: 10 92 39 05 sts 0x0539, r1 ; 0x800539 // 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; 3869a: 00 91 9b 04 lds r16, 0x049B ; 0x80049b 3869e: 10 91 9c 04 lds r17, 0x049C ; 0x80049c 386a2: 10 93 9a 04 sts 0x049A, r17 ; 0x80049a 386a6: 00 93 99 04 sts 0x0499, r16 ; 0x800499 386aa: 51 e6 ldi r21, 0x61 ; 97 386ac: e5 2e mov r14, r21 386ae: 5c ea ldi r21, 0xAC ; 172 386b0: f5 2e mov r15, r21 386b2: 67 e6 ldi r22, 0x67 ; 103 386b4: a6 2e mov r10, r22 386b6: 6c ea ldi r22, 0xAC ; 172 386b8: 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 ++)); 386ba: f7 01 movw r30, r14 386bc: 84 91 lpm r24, Z 386be: 0f 94 70 ae call 0x35ce0 ; 0x35ce0 386c2: ff ef ldi r31, 0xFF ; 255 386c4: ef 1a sub r14, r31 386c6: 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) 386c8: ae 14 cp r10, r14 386ca: bf 04 cpc r11, r15 386cc: b1 f7 brne .-20 ; 0x386ba putch(pgm_read_byte(ptr ++)); wdt_reset(); 386ce: a8 95 wdr 386d0: 8f e0 ldi r24, 0x0F ; 15 386d2: 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) 386d4: 20 e6 ldi r18, 0x60 ; 96 386d6: 3c ea ldi r19, 0xAC ; 172 MYSERIAL.flush(); //clear RX buffer int SerialHead = rx_buffer.head; // Send the initial magic string. while (ptr != end) putch(pgm_read_byte(ptr ++)); wdt_reset(); 386d8: 40 e8 ldi r20, 0x80 ; 128 386da: 54 e8 ldi r21, 0x84 ; 132 386dc: 6e e1 ldi r22, 0x1E ; 30 386de: 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) { 386e0: e0 91 99 04 lds r30, 0x0499 ; 0x800499 386e4: f0 91 9a 04 lds r31, 0x049A ; 0x80049a 386e8: e0 17 cp r30, r16 386ea: f1 07 cpc r31, r17 386ec: 19 f5 brne .+70 ; 0x38734 wdt_reset(); 386ee: a8 95 wdr 386f0: 41 50 subi r20, 0x01 ; 1 386f2: 51 09 sbc r21, r1 386f4: 61 09 sbc r22, r1 386f6: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 386f8: 99 f7 brne .-26 ; 0x386e0 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 386fa: d0 92 39 05 sts 0x0539, r13 ; 0x800539 return 0; 386fe: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 38700: ca 5f subi r28, 0xFA ; 250 38702: de 4f sbci r29, 0xFE ; 254 38704: 0f b6 in r0, 0x3f ; 63 38706: f8 94 cli 38708: de bf out 0x3e, r29 ; 62 3870a: 0f be out 0x3f, r0 ; 63 3870c: cd bf out 0x3d, r28 ; 61 3870e: df 91 pop r29 38710: cf 91 pop r28 38712: 1f 91 pop r17 38714: 0f 91 pop r16 38716: ff 90 pop r15 38718: ef 90 pop r14 3871a: df 90 pop r13 3871c: cf 90 pop r12 3871e: bf 90 pop r11 38720: af 90 pop r10 38722: 9f 90 pop r9 38724: 8f 90 pop r8 38726: 7f 90 pop r7 38728: 6f 90 pop r6 3872a: 5f 90 pop r5 3872c: 4f 90 pop r4 3872e: 3f 90 pop r3 38730: 2f 90 pop r2 38732: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 38734: f8 01 movw r30, r16 38736: e7 5e subi r30, 0xE7 ; 231 38738: fb 4f sbci r31, 0xFB ; 251 3873a: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 3873c: 0f 5f subi r16, 0xFF ; 255 3873e: 1f 4f sbci r17, 0xFF ; 255 38740: 0f 77 andi r16, 0x7F ; 127 38742: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 38744: f9 01 movw r30, r18 38746: e8 1b sub r30, r24 38748: f9 0b sbc r31, r25 3874a: e4 91 lpm r30, Z 3874c: 4e 13 cpse r20, r30 3874e: d5 cf rjmp .-86 ; 0x386fa { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 38750: a8 95 wdr 38752: 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) { 38754: 09 f0 breq .+2 ; 0x38758 38756: c0 cf rjmp .-128 ; 0x386d8 selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 38758: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 3875c: 8f 77 andi r24, 0x7F ; 127 3875e: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 38762: 03 e4 ldi r16, 0x43 ; 67 38764: 1c ea ldi r17, 0xAC ; 172 // Send the cfm magic string. ptr = entry_magic_cfm; end = strlen_P(entry_magic_cfm) + ptr; while (ptr != end) putch(pgm_read_byte(ptr ++)); 38766: f8 01 movw r30, r16 38768: 84 91 lpm r24, Z 3876a: 0f 94 70 ae call 0x35ce0 ; 0x35ce0 3876e: 0f 5f subi r16, 0xFF ; 255 38770: 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) 38772: fc ea ldi r31, 0xAC ; 172 38774: 00 35 cpi r16, 0x50 ; 80 38776: 1f 07 cpc r17, r31 38778: b1 f7 brne .-20 ; 0x38766 putch(pgm_read_byte(ptr ++)); } spi_init(); 3877a: 0f 94 06 c3 call 0x3860c ; 0x3860c xflash_init(); 3877e: 0e 94 f5 ee call 0x1ddea ; 0x1ddea "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" ); 38782: 0f b6 in r0, 0x3f ; 63 38784: f8 94 cli 38786: a8 95 wdr 38788: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3878c: 88 61 ori r24, 0x18 ; 24 3878e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38792: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38796: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 38798: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 3879c: 4d e1 ldi r20, 0x1D ; 29 3879e: 5c ea ldi r21, 0xAC ; 172 387a0: 61 e0 ldi r22, 0x01 ; 1 387a2: 80 e0 ldi r24, 0x00 ; 0 387a4: 0e 94 74 6e call 0xdce8 ; 0xdce8 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 387a8: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 387ac: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 387b0: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 387b4: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7df> 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; 387b8: cb 5f subi r28, 0xFB ; 251 387ba: de 4f sbci r29, 0xFE ; 254 387bc: 18 82 st Y, r1 387be: c5 50 subi r28, 0x05 ; 5 387c0: 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; 387c2: 10 e0 ldi r17, 0x00 ; 0 387c4: 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; 387c6: 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); 387c8: ae 01 movw r20, r28 387ca: 4f 5f subi r20, 0xFF ; 255 387cc: 5f 4f sbci r21, 0xFF ; 255 387ce: 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(); 387d0: 0f 94 77 ae call 0x35cee ; 0x35cee if(ch == STK_GET_PARAMETER) { 387d4: 81 34 cpi r24, 0x41 ; 65 387d6: a9 f4 brne .+42 ; 0x38802 unsigned char which = getch(); 387d8: 0f 94 77 ae call 0x35cee ; 0x35cee 387dc: e8 2e mov r14, r24 verifySpace(); 387de: 0f 94 ef b0 call 0x361de ; 0x361de /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 387e2: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 387e4: 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) { 387e6: e5 16 cp r14, r21 387e8: 21 f0 breq .+8 ; 0x387f2 putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 387ea: 81 e8 ldi r24, 0x81 ; 129 387ec: e8 12 cpse r14, r24 387ee: 07 c0 rjmp .+14 ; 0x387fe putch(optiboot_version >> 8); 387f0: 86 e0 ldi r24, 0x06 ; 6 387f2: 0f 94 70 ae call 0x35ce0 ; 0x35ce0 } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 387f6: 80 e1 ldi r24, 0x10 ; 16 387f8: 0f 94 70 ae call 0x35ce0 ; 0x35ce0 387fc: e9 cf rjmp .-46 ; 0x387d0 } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 387fe: 83 e0 ldi r24, 0x03 ; 3 38800: f8 cf rjmp .-16 ; 0x387f2 } } else if(ch == STK_SET_DEVICE) { 38802: 82 34 cpi r24, 0x42 ; 66 38804: 21 f4 brne .+8 ; 0x3880e // SET DEVICE is ignored getNch(20); 38806: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 38808: 0f 94 fb b0 call 0x361f6 ; 0x361f6 3880c: f4 cf rjmp .-24 ; 0x387f6 } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 3880e: 85 34 cpi r24, 0x45 ; 69 38810: 11 f4 brne .+4 ; 0x38816 // SET DEVICE EXT is ignored getNch(5); 38812: 85 e0 ldi r24, 0x05 ; 5 38814: f9 cf rjmp .-14 ; 0x38808 } else if(ch == STK_LOAD_ADDRESS) { 38816: 85 35 cpi r24, 0x55 ; 85 38818: c9 f4 brne .+50 ; 0x3884c // 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(); 3881a: 0f 94 77 ae call 0x35cee ; 0x35cee 3881e: 08 2f mov r16, r24 newAddress |= getch(); 38820: 0f 94 77 ae call 0x35cee ; 0x35cee 38824: 08 2b or r16, r24 38826: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 38828: 0f 94 77 ae call 0x35cee ; 0x35cee 3882c: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 3882e: 0f 94 77 ae call 0x35cee ; 0x35cee 38832: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 38834: 17 ff sbrs r17, 7 38836: 07 c0 rjmp .+14 ; 0x38846 rampz |= 0x01; 38838: 68 94 set 3883a: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 3883c: 00 0f add r16, r16 3883e: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 38840: 0f 94 ef b0 call 0x361de ; 0x361de 38844: d8 cf rjmp .-80 ; 0x387f6 newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 38846: e8 94 clt 38848: f0 f8 bld r15, 0 3884a: f8 cf rjmp .-16 ; 0x3883c newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 3884c: 86 35 cpi r24, 0x56 ; 86 3884e: a1 f4 brne .+40 ; 0x38878 // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 38850: 0f 94 77 ae call 0x35cee ; 0x35cee 38854: 8d 34 cpi r24, 0x4D ; 77 38856: 71 f4 brne .+28 ; 0x38874 // get address getch(); // get '0' 38858: 0f 94 77 ae call 0x35cee ; 0x35cee rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 3885c: 0f 94 77 ae call 0x35cee ; 0x35cee 38860: 9f 2d mov r25, r15 38862: 91 70 andi r25, 0x01 ; 1 38864: f9 2e mov r15, r25 38866: 88 0f add r24, r24 38868: f8 2a or r15, r24 getNch(1); // get last '0' 3886a: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 3886c: 0f 94 fb b0 call 0x361f6 ; 0x361f6 putch(0x00); 38870: 80 e0 ldi r24, 0x00 ; 0 38872: bf cf rjmp .-130 ; 0x387f2 // response putch(0x00); } else { // everything else is ignored getNch(3); 38874: 83 e0 ldi r24, 0x03 ; 3 38876: fa cf rjmp .-12 ; 0x3886c putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 38878: 84 36 cpi r24, 0x64 ; 100 3887a: 09 f0 breq .+2 ; 0x3887e 3887c: 77 c0 rjmp .+238 ; 0x3896c 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; 3887e: 0f 94 77 ae call 0x35cee ; 0x35cee 38882: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 38884: 0f 94 77 ae call 0x35cee ; 0x35cee 38888: c8 2e mov r12, r24 length |= getch(); 3888a: 0f 94 77 ae call 0x35cee ; 0x35cee 3888e: e8 2e mov r14, r24 length |= getch(); 38890: 0f 94 77 ae call 0x35cee ; 0x35cee 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; 38894: d1 2c mov r13, r1 38896: dc 2c mov r13, r12 38898: cc 24 eor r12, r12 3889a: db 28 or r13, r11 length |= getch(); length |= getch(); 3889c: 8e 29 or r24, r14 3889e: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 388a0: 0f 94 77 ae call 0x35cee ; 0x35cee 388a4: 58 2e mov r5, r24 388a6: fe 01 movw r30, r28 388a8: 31 96 adiw r30, 0x01 ; 1 388aa: 5f 01 movw r10, r30 388ac: 46 01 movw r8, r12 388ae: 8e 0e add r8, r30 388b0: 9f 1e adc r9, r31 388b2: ee 2e mov r14, r30 388b4: ca 5f subi r28, 0xFA ; 250 388b6: de 4f sbci r29, 0xFE ; 254 388b8: b8 82 st Y, r11 388ba: c6 50 subi r28, 0x06 ; 6 388bc: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 388be: 0f 94 77 ae call 0x35cee ; 0x35cee 388c2: f5 01 movw r30, r10 388c4: 81 93 st Z+, r24 388c6: 5f 01 movw r10, r30 while (--length); 388c8: 8e 16 cp r8, r30 388ca: 9f 06 cpc r9, r31 388cc: c1 f7 brne .-16 ; 0x388be // Read command terminator, start reply verifySpace(); 388ce: 0f 94 ef b0 call 0x361de ; 0x361de if (desttype == 'E') { 388d2: f5 e4 ldi r31, 0x45 ; 69 388d4: 5f 12 cpse r5, r31 388d6: 01 c0 rjmp .+2 ; 0x388da 388d8: ff cf rjmp .-2 ; 0x388d8 while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 388da: 18 01 movw r2, r16 388dc: 51 2c mov r5, r1 388de: 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) { 388e0: 01 15 cp r16, r1 388e2: 11 05 cpc r17, r1 388e4: 61 f5 brne .+88 ; 0x3893e 388e6: 42 01 movw r8, r4 388e8: aa 24 eor r10, r10 388ea: bb 24 eor r11, r11 388ec: cb 5f subi r28, 0xFB ; 251 388ee: de 4f sbci r29, 0xFE ; 254 388f0: 28 81 ld r18, Y 388f2: c5 50 subi r28, 0x05 ; 5 388f4: d1 40 sbci r29, 0x01 ; 1 388f6: 82 2f mov r24, r18 388f8: 90 e0 ldi r25, 0x00 ; 0 388fa: 08 2c mov r0, r8 388fc: 02 c0 rjmp .+4 ; 0x38902 388fe: 95 95 asr r25 38900: 87 95 ror r24 38902: 0a 94 dec r0 38904: e2 f7 brpl .-8 ; 0x388fe 38906: 80 fd sbrc r24, 0 38908: 1a c0 rjmp .+52 ; 0x3893e xflash_wait_busy(); 3890a: 0e 94 82 ed call 0x1db04 ; 0x1db04 xflash_enable_wr(); 3890e: 0e 94 1e ee call 0x1dc3c ; 0x1dc3c return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 38912: b2 01 movw r22, r4 38914: a8 01 movw r20, r16 38916: 88 ed ldi r24, 0xD8 ; 216 38918: 0e 94 a0 ed call 0x1db40 ; 0x1db40 xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 3891c: 81 e0 ldi r24, 0x01 ; 1 3891e: 90 e0 ldi r25, 0x00 ; 0 38920: 01 c0 rjmp .+2 ; 0x38924 38922: 88 0f add r24, r24 38924: 8a 94 dec r8 38926: ea f7 brpl .-6 ; 0x38922 38928: cb 5f subi r28, 0xFB ; 251 3892a: de 4f sbci r29, 0xFE ; 254 3892c: 48 81 ld r20, Y 3892e: c5 50 subi r28, 0x05 ; 5 38930: d1 40 sbci r29, 0x01 ; 1 38932: 48 2b or r20, r24 38934: cb 5f subi r28, 0xFB ; 251 38936: de 4f sbci r29, 0xFE ; 254 38938: 48 83 st Y, r20 3893a: c5 50 subi r28, 0x05 ; 5 3893c: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 3893e: 0e 94 82 ed call 0x1db04 ; 0x1db04 xflash_enable_wr(); 38942: 0e 94 1e ee call 0x1dc3c ; 0x1dc3c xflash_page_program(addr, buff, savelength); 38946: 96 01 movw r18, r12 38948: 4e 2d mov r20, r14 3894a: ca 5f subi r28, 0xFA ; 250 3894c: de 4f sbci r29, 0xFE ; 254 3894e: 58 81 ld r21, Y 38950: c6 50 subi r28, 0x06 ; 6 38952: d1 40 sbci r29, 0x01 ; 1 38954: c2 01 movw r24, r4 38956: b1 01 movw r22, r2 38958: 0e 94 a5 ed call 0x1db4a ; 0x1db4a xflash_wait_busy(); 3895c: 0e 94 82 ed call 0x1db04 ; 0x1db04 _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 38960: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 38962: 84 e0 ldi r24, 0x04 ; 4 38964: 0e 94 7c ed call 0x1daf8 ; 0x1daf8 _CS_HIGH(); 38968: 45 9a sbi 0x08, 5 ; 8 3896a: 45 cf rjmp .-374 ; 0x387f6 xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 3896c: 84 37 cpi r24, 0x74 ; 116 3896e: 81 f5 brne .+96 ; 0x389d0 uint32_t addr = (((uint32_t)rampz) << 16) | address; 38970: b1 2c mov r11, r1 38972: 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; 38974: 0f 94 77 ae call 0x35cee ; 0x35cee 38978: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 3897a: 0f 94 77 ae call 0x35cee ; 0x35cee 3897e: c8 2e mov r12, r24 length |= getch(); 38980: 0f 94 77 ae call 0x35cee ; 0x35cee 38984: e8 2e mov r14, r24 length |= getch(); 38986: 0f 94 77 ae call 0x35cee ; 0x35cee 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; 3898a: 2c 2d mov r18, r12 3898c: 30 e0 ldi r19, 0x00 ; 0 3898e: 32 2f mov r19, r18 38990: 22 27 eor r18, r18 38992: f9 01 movw r30, r18 38994: fd 29 or r31, r13 38996: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 38998: 8e 29 or r24, r14 3899a: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 3899c: 0f 94 77 ae call 0x35cee ; 0x35cee verifySpace(); 389a0: 0f 94 ef b0 call 0x361de ; 0x361de xflash_wait_busy(); 389a4: 0e 94 82 ed call 0x1db04 ; 0x1db04 xflash_rd_data(addr, buff, length); 389a8: 96 01 movw r18, r12 389aa: a3 01 movw r20, r6 389ac: c5 01 movw r24, r10 389ae: b8 01 movw r22, r16 389b0: 0e 94 c5 ed call 0x1db8a ; 0x1db8a 389b4: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 389b6: c5 01 movw r24, r10 389b8: 86 19 sub r24, r6 389ba: 97 09 sbc r25, r7 389bc: 8c 15 cp r24, r12 389be: 9d 05 cpc r25, r13 389c0: 08 f0 brcs .+2 ; 0x389c4 389c2: 19 cf rjmp .-462 ; 0x387f6 putch(buff[i]); 389c4: f5 01 movw r30, r10 389c6: 81 91 ld r24, Z+ 389c8: 5f 01 movw r10, r30 389ca: 0f 94 70 ae call 0x35ce0 ; 0x35ce0 389ce: f3 cf rjmp .-26 ; 0x389b6 } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 389d0: 85 37 cpi r24, 0x75 ; 117 389d2: 51 f4 brne .+20 ; 0x389e8 // READ SIGN - return what Avrdude wants to hear verifySpace(); 389d4: 0f 94 ef b0 call 0x361de ; 0x361de putch(XFLASH_SIGNATURE_0); 389d8: 8e e1 ldi r24, 0x1E ; 30 389da: 0f 94 70 ae call 0x35ce0 ; 0x35ce0 putch(XFLASH_SIGNATURE_1); 389de: 88 e9 ldi r24, 0x98 ; 152 389e0: 0f 94 70 ae call 0x35ce0 ; 0x35ce0 putch(XFLASH_SIGNATURE_2); 389e4: 81 e0 ldi r24, 0x01 ; 1 389e6: 05 cf rjmp .-502 ; 0x387f2 } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 389e8: 81 35 cpi r24, 0x51 ; 81 389ea: 09 f0 breq .+2 ; 0x389ee 389ec: 29 cf rjmp .-430 ; 0x38840 : "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" ); 389ee: f8 e1 ldi r31, 0x18 ; 24 389f0: 28 e0 ldi r18, 0x08 ; 8 389f2: 0f b6 in r0, 0x3f ; 63 389f4: f8 94 cli 389f6: a8 95 wdr 389f8: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 389fc: 0f be out 0x3f, r0 ; 63 389fe: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38a02: 1e cf rjmp .-452 ; 0x38840 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; 38a04: 81 e0 ldi r24, 0x01 ; 1 38a06: 7c ce rjmp .-776 ; 0x38700 00038a08 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 38a08: 81 e0 ldi r24, 0x01 ; 1 38a0a: 0c 94 a5 6e jmp 0xdd4a ; 0xdd4a 00038a0e : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 38a0e: 0f 93 push r16 38a10: 1f 93 push r17 38a12: cf 93 push r28 38a14: 8c 01 movw r16, r24 38a16: c6 2f mov r28, r22 lcd_update_enable(false); 38a18: 80 e0 ldi r24, 0x00 ; 0 38a1a: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_clear(); 38a1e: 0e 94 93 6e call 0xdd26 ; 0xdd26 lcd_puts_at_P(0, 1, pgmS); 38a22: a8 01 movw r20, r16 38a24: 61 e0 ldi r22, 0x01 ; 1 38a26: 80 e0 ldi r24, 0x00 ; 0 38a28: 0e 94 74 6e call 0xdce8 ; 0xdce8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 38a2c: 80 e2 ldi r24, 0x20 ; 32 38a2e: 0e 94 0f 6f call 0xde1e ; 0xde1e lcd_print(' '); lcd_print(slot + 1); 38a32: 6c 2f mov r22, r28 38a34: 70 e0 ldi r23, 0x00 ; 0 38a36: 6f 5f subi r22, 0xFF ; 255 38a38: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 38a3a: 07 2e mov r0, r23 38a3c: 00 0c add r0, r0 38a3e: 88 0b sbc r24, r24 38a40: 99 0b sbc r25, r25 } 38a42: cf 91 pop r28 38a44: 1f 91 pop r17 38a46: 0f 91 pop r16 38a48: 0c 94 19 70 jmp 0xe032 ; 0xe032 00038a4c : 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); 38a4c: 82 ed ldi r24, 0xD2 ; 210 38a4e: 9e e0 ldi r25, 0x0E ; 14 38a50: 0e 94 a8 75 call 0xeb50 ; 0xeb50 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 38a54: 83 ed ldi r24, 0xD3 ; 211 38a56: 9e e0 ldi r25, 0x0E ; 14 38a58: 0c 94 9b 75 jmp 0xeb36 ; 0xeb36 00038a5c : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 38a5c: 41 e0 ldi r20, 0x01 ; 1 38a5e: 80 91 90 13 lds r24, 0x1390 ; 0x801390 38a62: 81 11 cpse r24, r1 38a64: 01 c0 rjmp .+2 ; 0x38a68 38a66: 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'); 38a68: 40 5d subi r20, 0xD0 ; 208 38a6a: 62 e0 ldi r22, 0x02 ; 2 38a6c: 83 e0 ldi r24, 0x03 ; 3 38a6e: 0e 94 80 6e call 0xdd00 ; 0xdd00 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 38a72: 41 e0 ldi r20, 0x01 ; 1 38a74: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 38a78: 81 11 cpse r24, r1 38a7a: 01 c0 rjmp .+2 ; 0x38a7e 38a7c: 40 e0 ldi r20, 0x00 ; 0 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 38a7e: 40 5d subi r20, 0xD0 ; 208 38a80: 62 e0 ldi r22, 0x02 ; 2 38a82: 88 e0 ldi r24, 0x08 ; 8 38a84: 0e 94 80 6e call 0xdd00 ; 0xdd00 // print active/changing filament slot lcd_set_cursor(10, 2); 38a88: 62 e0 ldi r22, 0x02 ; 2 38a8a: 8a e0 ldi r24, 0x0A ; 10 38a8c: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcdui_print_extruder(); 38a90: 0f 94 4d 22 call 0x2449a ; 0x2449a // Print active extruder temperature lcd_set_cursor(16, 2); 38a94: 62 e0 ldi r22, 0x02 ; 2 38a96: 80 e1 ldi r24, 0x10 ; 16 38a98: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 38a9c: 20 e0 ldi r18, 0x00 ; 0 38a9e: 30 e0 ldi r19, 0x00 ; 0 38aa0: 40 e0 ldi r20, 0x00 ; 0 38aa2: 5f e3 ldi r21, 0x3F ; 63 38aa4: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 38aa8: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 38aac: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 38ab0: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 38ab4: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 38ab8: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> 38abc: 7f 93 push r23 38abe: 6f 93 push r22 38ac0: 8b e0 ldi r24, 0x0B ; 11 38ac2: 9b ea ldi r25, 0xAB ; 171 38ac4: 9f 93 push r25 38ac6: 8f 93 push r24 38ac8: 0e 94 39 6e call 0xdc72 ; 0xdc72 38acc: 0f 90 pop r0 38ace: 0f 90 pop r0 38ad0: 0f 90 pop r0 38ad2: 0f 90 pop r0 } 38ad4: 08 95 ret 00038ad6 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 38ad6: 8a 30 cpi r24, 0x0A ; 10 38ad8: 20 f0 brcs .+8 ; 0x38ae2 38ada: 80 31 cpi r24, 0x10 ; 16 38adc: 20 f4 brcc .+8 ; 0x38ae6 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 38ade: 89 5a subi r24, 0xA9 ; 169 38ae0: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 38ae2: 80 5d subi r24, 0xD0 ; 208 38ae4: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 38ae6: 80 e0 ldi r24, 0x00 ; 0 } } 38ae8: 08 95 ret 00038aea : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 38aea: 0f 93 push r16 38aec: 1f 93 push r17 38aee: cf 93 push r28 38af0: df 93 push r29 38af2: 08 2f mov r16, r24 38af4: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 38af6: 90 e0 ldi r25, 0x00 ; 0 38af8: 24 e0 ldi r18, 0x04 ; 4 38afa: 95 95 asr r25 38afc: 87 95 ror r24 38afe: 2a 95 dec r18 38b00: e1 f7 brne .-8 ; 0x38afa uint8_t charsOut = 1; 38b02: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 38b04: 00 97 sbiw r24, 0x00 ; 0 38b06: 21 f0 breq .+8 ; 0x38b10 *dst = Nibble2Char(v); 38b08: 0f 94 6b c5 call 0x38ad6 ; 0x38ad6 38b0c: 89 93 st Y+, r24 ++dst; charsOut = 2; 38b0e: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 38b10: 80 2f mov r24, r16 38b12: 8f 70 andi r24, 0x0F ; 15 38b14: 0f 94 6b c5 call 0x38ad6 ; 0x38ad6 38b18: 88 83 st Y, r24 return charsOut; } 38b1a: 81 2f mov r24, r17 38b1c: df 91 pop r29 38b1e: cf 91 pop r28 38b20: 1f 91 pop r17 38b22: 0f 91 pop r16 38b24: 08 95 ret 00038b26 : } 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) { 38b26: 80 33 cpi r24, 0x30 ; 48 38b28: 30 f0 brcs .+12 ; 0x38b36 38b2a: 8a 33 cpi r24, 0x3A ; 58 38b2c: 30 f0 brcs .+12 ; 0x38b3a 38b2e: 9f e9 ldi r25, 0x9F ; 159 38b30: 98 0f add r25, r24 38b32: 96 30 cpi r25, 0x06 ; 6 38b34: 20 f0 brcs .+8 ; 0x38b3e case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 38b36: 80 e0 ldi r24, 0x00 ; 0 } } 38b38: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 38b3a: 80 53 subi r24, 0x30 ; 48 38b3c: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 38b3e: 87 55 subi r24, 0x57 ; 87 38b40: 08 95 ret 00038b42 : /// 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 { 38b42: cf 93 push r28 38b44: df 93 push r29 38b46: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 38b48: 68 81 ld r22, Y 38b4a: 80 e0 ldi r24, 0x00 ; 0 38b4c: 0f 94 83 ae call 0x35d06 ; 0x35d06 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 38b50: 69 81 ldd r22, Y+1 ; 0x01 38b52: 0f 94 83 ae call 0x35d06 ; 0x35d06 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 38b56: 6a 81 ldd r22, Y+2 ; 0x02 38b58: 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]); 38b5a: 0f 94 83 ae call 0x35d06 ; 0x35d06 38b5e: 6c 2f mov r22, r28 return crc; } 38b60: df 91 pop r29 38b62: cf 91 pop r28 38b64: 0d 94 83 ae jmp 0x35d06 ; 0x35d06 00038b68 : 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 { 38b68: cf 93 push r28 38b6a: df 93 push r29 38b6c: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 38b6e: 0f 94 a1 c5 call 0x38b42 ; 0x38b42 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 38b72: 6d 81 ldd r22, Y+5 ; 0x05 38b74: 0f 94 83 ae call 0x35d06 ; 0x35d06 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 38b78: 6e 81 ldd r22, Y+6 ; 0x06 38b7a: cf 81 ldd r28, Y+7 ; 0x07 38b7c: 0f 94 83 ae call 0x35d06 ; 0x35d06 38b80: 6c 2f mov r22, r28 return crc; } 38b82: df 91 pop r29 38b84: cf 91 pop r28 38b86: 0d 94 83 ae jmp 0x35d06 ; 0x35d06 00038b8a : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 38b8a: cf 93 push r28 38b8c: df 93 push r29 38b8e: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 38b90: 68 83 st Y, r22 38b92: 49 83 std Y+1, r20 ; 0x01 38b94: 1b 82 std Y+3, r1 ; 0x03 38b96: 1a 82 std Y+2, r1 ; 0x02 38b98: 0f 94 a1 c5 call 0x38b42 ; 0x38b42 38b9c: 8c 83 std Y+4, r24 ; 0x04 } 38b9e: df 91 pop r29 38ba0: cf 91 pop r28 38ba2: 08 95 ret 00038ba4 : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 38ba4: 9f b7 in r25, 0x3f ; 63 38ba6: f8 94 cli 38ba8: e5 e0 ldi r30, 0x05 ; 5 38baa: f1 e0 ldi r31, 0x01 ; 1 38bac: 80 81 ld r24, Z 38bae: 8f 7d andi r24, 0xDF ; 223 38bb0: 80 83 st Z, r24 38bb2: 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); 38bb4: 8f e8 ldi r24, 0x8F ; 143 38bb6: 91 e0 ldi r25, 0x01 ; 1 38bb8: 01 97 sbiw r24, 0x01 ; 1 38bba: f1 f7 brne .-4 ; 0x38bb8 38bbc: 00 c0 rjmp .+0 ; 0x38bbe 38bbe: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 38bc0: 9f b7 in r25, 0x3f ; 63 38bc2: f8 94 cli 38bc4: 80 81 ld r24, Z 38bc6: 80 62 ori r24, 0x20 ; 32 38bc8: 80 83 st Z, r24 38bca: 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 } 38bcc: 08 95 ret 00038bce : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 38bce: 14 9a sbi 0x02, 4 ; 2 } 38bd0: 08 95 ret 00038bd2 : 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) { 38bd2: cf 92 push r12 38bd4: df 92 push r13 38bd6: ef 92 push r14 38bd8: ff 92 push r15 38bda: cf 93 push r28 38bdc: df 93 push r29 38bde: 69 01 movw r12, r18 38be0: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 38be2: c2 e9 ldi r28, 0x92 ; 146 38be4: d6 e0 ldi r29, 0x06 ; 6 38be6: 9b 01 movw r18, r22 38be8: ac 01 movw r20, r24 38bea: 6c 85 ldd r22, Y+12 ; 0x0c 38bec: 7d 85 ldd r23, Y+13 ; 0x0d 38bee: 8e 85 ldd r24, Y+14 ; 0x0e 38bf0: 9f 85 ldd r25, Y+15 ; 0x0f 38bf2: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 38bf6: 6c 87 std Y+12, r22 ; 0x0c 38bf8: 7d 87 std Y+13, r23 ; 0x0d 38bfa: 8e 87 std Y+14, r24 ; 0x0e 38bfc: 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); 38bfe: c7 01 movw r24, r14 38c00: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 38c02: df 91 pop r29 38c04: cf 91 pop r28 38c06: ff 90 pop r15 38c08: ef 90 pop r14 38c0a: df 90 pop r13 38c0c: 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); 38c0e: 0d 94 81 c0 jmp 0x38102 ; 0x38102 00038c12 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 38c12: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 38c16: 0d 94 ed 43 jmp 0x287da ; 0x287da 00038c1a : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 38c1a: cf 93 push r28 38c1c: df 93 push r29 38c1e: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 38c20: 82 ec ldi r24, 0xC2 ; 194 38c22: 9a ea ldi r25, 0xAA ; 170 38c24: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_MMU2(); 38c28: 85 e0 ldi r24, 0x05 ; 5 38c2a: 9b ea ldi r25, 0xAB ; 171 38c2c: 0e 94 d0 76 call 0xeda0 ; 0xeda0 SERIAL_ECHOLNRPGM(msg); 38c30: ce 01 movw r24, r28 } 38c32: df 91 pop r29 38c34: 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); 38c36: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 00038c3a : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 38c3a: 81 e0 ldi r24, 0x01 ; 1 38c3c: 90 91 b7 17 lds r25, 0x17B7 ; 0x8017b7 38c40: 91 11 cpse r25, r1 38c42: 01 c0 rjmp .+2 ; 0x38c46 38c44: 80 e0 ldi r24, 0x00 ; 0 } 38c46: 08 95 ret 00038c48 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c48: 89 32 cpi r24, 0x29 ; 41 38c4a: 20 e8 ldi r18, 0x80 ; 128 38c4c: 92 07 cpc r25, r18 38c4e: 09 f4 brne .+2 ; 0x38c52 38c50: 97 c0 rjmp .+302 ; 0x38d80 38c52: 08 f0 brcs .+2 ; 0x38c56 38c54: 48 c0 rjmp .+144 ; 0x38ce6 38c56: 86 30 cpi r24, 0x06 ; 6 38c58: 60 e8 ldi r22, 0x80 ; 128 38c5a: 96 07 cpc r25, r22 38c5c: 09 f4 brne .+2 ; 0x38c60 38c5e: 9a c0 rjmp .+308 ; 0x38d94 38c60: 30 f5 brcc .+76 ; 0x38cae 38c62: 83 30 cpi r24, 0x03 ; 3 38c64: 40 e8 ldi r20, 0x80 ; 128 38c66: 94 07 cpc r25, r20 38c68: 09 f4 brne .+2 ; 0x38c6c 38c6a: 80 c0 rjmp .+256 ; 0x38d6c 38c6c: a8 f4 brcc .+42 ; 0x38c98 38c6e: 81 30 cpi r24, 0x01 ; 1 38c70: 20 e8 ldi r18, 0x80 ; 128 38c72: 92 07 cpc r25, r18 38c74: 09 f4 brne .+2 ; 0x38c78 38c76: 17 c1 rjmp .+558 ; 0x38ea6 38c78: 82 30 cpi r24, 0x02 ; 2 38c7a: 40 e8 ldi r20, 0x80 ; 128 38c7c: 94 07 cpc r25, r20 38c7e: 09 f4 brne .+2 ; 0x38c82 38c80: 73 c0 rjmp .+230 ; 0x38d68 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); 38c82: 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)) { 38c84: 86 ff sbrs r24, 6 38c86: 8e c0 rjmp .+284 ; 0x38da4 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); 38c88: 22 27 eor r18, r18 38c8a: 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) { 38c8c: 21 15 cp r18, r1 38c8e: 32 4c sbci r19, 0xC2 ; 194 38c90: 09 f0 breq .+2 ; 0x38c94 38c92: 9e c0 rjmp .+316 ; 0x38dd0 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 38c94: 8e e1 ldi r24, 0x1E ; 30 38c96: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c98: 84 30 cpi r24, 0x04 ; 4 38c9a: 60 e8 ldi r22, 0x80 ; 128 38c9c: 96 07 cpc r25, r22 38c9e: 09 f4 brne .+2 ; 0x38ca2 38ca0: 67 c0 rjmp .+206 ; 0x38d70 38ca2: 85 30 cpi r24, 0x05 ; 5 38ca4: 20 e8 ldi r18, 0x80 ; 128 38ca6: 92 07 cpc r25, r18 38ca8: 61 f7 brne .-40 ; 0x38c82 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); 38caa: 84 e2 ldi r24, 0x24 ; 36 38cac: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38cae: 8a 30 cpi r24, 0x0A ; 10 38cb0: 40 e8 ldi r20, 0x80 ; 128 38cb2: 94 07 cpc r25, r20 38cb4: 09 f4 brne .+2 ; 0x38cb8 38cb6: 5e c0 rjmp .+188 ; 0x38d74 38cb8: 58 f4 brcc .+22 ; 0x38cd0 38cba: 88 30 cpi r24, 0x08 ; 8 38cbc: 20 e8 ldi r18, 0x80 ; 128 38cbe: 92 07 cpc r25, r18 38cc0: 09 f4 brne .+2 ; 0x38cc4 38cc2: 6e c0 rjmp .+220 ; 0x38da0 38cc4: 89 30 cpi r24, 0x09 ; 9 38cc6: 40 e8 ldi r20, 0x80 ; 128 38cc8: 94 07 cpc r25, r20 38cca: d9 f6 brne .-74 ; 0x38c82 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); 38ccc: 85 e0 ldi r24, 0x05 ; 5 38cce: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38cd0: 8c 30 cpi r24, 0x0C ; 12 38cd2: 60 e8 ldi r22, 0x80 ; 128 38cd4: 96 07 cpc r25, r22 38cd6: 09 f4 brne .+2 ; 0x38cda 38cd8: 51 c0 rjmp .+162 ; 0x38d7c 38cda: 8d 30 cpi r24, 0x0D ; 13 38cdc: 20 e8 ldi r18, 0x80 ; 128 38cde: 92 07 cpc r25, r18 38ce0: 81 f6 brne .-96 ; 0x38c82 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); 38ce2: 81 e2 ldi r24, 0x21 ; 33 38ce4: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38ce6: 8f 32 cpi r24, 0x2F ; 47 38ce8: 40 e8 ldi r20, 0x80 ; 128 38cea: 94 07 cpc r25, r20 38cec: 09 f4 brne .+2 ; 0x38cf0 38cee: 56 c0 rjmp .+172 ; 0x38d9c 38cf0: e0 f4 brcc .+56 ; 0x38d2a 38cf2: 8c 32 cpi r24, 0x2C ; 44 38cf4: 20 e8 ldi r18, 0x80 ; 128 38cf6: 92 07 cpc r25, r18 38cf8: 09 f4 brne .+2 ; 0x38cfc 38cfa: 4e c0 rjmp .+156 ; 0x38d98 38cfc: 58 f4 brcc .+22 ; 0x38d14 38cfe: 8a 32 cpi r24, 0x2A ; 42 38d00: 60 e8 ldi r22, 0x80 ; 128 38d02: 96 07 cpc r25, r22 38d04: c9 f1 breq .+114 ; 0x38d78 38d06: 8b 32 cpi r24, 0x2B ; 43 38d08: 20 e8 ldi r18, 0x80 ; 128 38d0a: 92 07 cpc r25, r18 38d0c: 09 f0 breq .+2 ; 0x38d10 38d0e: b9 cf rjmp .-142 ; 0x38c82 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); 38d10: 86 e2 ldi r24, 0x26 ; 38 38d12: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38d14: 8d 32 cpi r24, 0x2D ; 45 38d16: 40 e8 ldi r20, 0x80 ; 128 38d18: 94 07 cpc r25, r20 38d1a: d1 f1 breq .+116 ; 0x38d90 38d1c: 8e 32 cpi r24, 0x2E ; 46 38d1e: 60 e8 ldi r22, 0x80 ; 128 38d20: 96 07 cpc r25, r22 38d22: 09 f0 breq .+2 ; 0x38d26 38d24: ae cf rjmp .-164 ; 0x38c82 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); 38d26: 82 e2 ldi r24, 0x22 ; 34 38d28: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38d2a: 87 38 cpi r24, 0x87 ; 135 38d2c: 20 e8 ldi r18, 0x80 ; 128 38d2e: 92 07 cpc r25, r18 38d30: 49 f1 breq .+82 ; 0x38d84 38d32: 58 f4 brcc .+22 ; 0x38d4a 38d34: 87 34 cpi r24, 0x47 ; 71 38d36: 60 e8 ldi r22, 0x80 ; 128 38d38: 96 07 cpc r25, r22 38d3a: 29 f0 breq .+10 ; 0x38d46 38d3c: 8b 34 cpi r24, 0x4B ; 75 38d3e: 20 e8 ldi r18, 0x80 ; 128 38d40: 92 07 cpc r25, r18 38d42: 09 f0 breq .+2 ; 0x38d46 38d44: 9e cf rjmp .-196 ; 0x38c82 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); 38d46: 84 e0 ldi r24, 0x04 ; 4 38d48: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38d4a: 87 30 cpi r24, 0x07 ; 7 38d4c: 41 e8 ldi r20, 0x81 ; 129 38d4e: 94 07 cpc r25, r20 38d50: d9 f0 breq .+54 ; 0x38d88 38d52: 8b 30 cpi r24, 0x0B ; 11 38d54: 61 e8 ldi r22, 0x81 ; 129 38d56: 96 07 cpc r25, r22 38d58: c9 f0 breq .+50 ; 0x38d8c 38d5a: 8b 38 cpi r24, 0x8B ; 139 38d5c: 20 e8 ldi r18, 0x80 ; 128 38d5e: 92 07 cpc r25, r18 38d60: 09 f0 breq .+2 ; 0x38d64 38d62: 8f cf rjmp .-226 ; 0x38c82 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); 38d64: 89 e0 ldi r24, 0x09 ; 9 38d66: 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); 38d68: 81 e0 ldi r24, 0x01 ; 1 38d6a: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 38d6c: 82 e0 ldi r24, 0x02 ; 2 38d6e: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 38d70: 83 e0 ldi r24, 0x03 ; 3 38d72: 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); 38d74: 86 e0 ldi r24, 0x06 ; 6 38d76: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 38d78: 87 e0 ldi r24, 0x07 ; 7 38d7a: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 38d7c: 8a e2 ldi r24, 0x2A ; 42 38d7e: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 38d80: 8b e2 ldi r24, 0x2B ; 43 38d82: 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); 38d84: 88 e0 ldi r24, 0x08 ; 8 38d86: 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); 38d88: 8a e0 ldi r24, 0x0A ; 10 38d8a: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 38d8c: 8b e0 ldi r24, 0x0B ; 11 38d8e: 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); 38d90: 83 e2 ldi r24, 0x23 ; 35 38d92: 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); 38d94: 85 e2 ldi r24, 0x25 ; 37 38d96: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 38d98: 87 e2 ldi r24, 0x27 ; 39 38d9a: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 38d9c: 88 e2 ldi r24, 0x28 ; 40 38d9e: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 38da0: 89 e2 ldi r24, 0x29 ; 41 38da2: 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)) { 38da4: 87 ff sbrs r24, 7 38da6: 07 c0 rjmp .+14 ; 0x38db6 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); 38da8: 22 27 eor r18, r18 38daa: 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) { 38dac: 21 15 cp r18, r1 38dae: 32 4c sbci r19, 0xC2 ; 194 38db0: a1 f5 brne .+104 ; 0x38e1a return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 38db2: 8f e1 ldi r24, 0x1F ; 31 38db4: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38db6: 22 27 eor r18, r18 38db8: 31 70 andi r19, 0x01 ; 1 38dba: 90 ff sbrs r25, 0 38dbc: 52 c0 rjmp .+164 ; 0x38e62 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); 38dbe: ac 01 movw r20, r24 38dc0: 44 27 eor r20, r20 38dc2: 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) { 38dc4: 41 15 cp r20, r1 38dc6: 52 4c sbci r21, 0xC2 ; 194 38dc8: 09 f0 breq .+2 ; 0x38dcc 38dca: 4b c0 rjmp .+150 ; 0x38e62 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 38dcc: 80 e2 ldi r24, 0x20 ; 32 38dce: 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; 38dd0: 9c 01 movw r18, r24 38dd2: 22 27 eor r18, r18 38dd4: 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)) { 38dd6: 23 2b or r18, r19 38dd8: 09 f0 breq .+2 ; 0x38ddc 38dda: 67 c0 rjmp .+206 ; 0x38eaa 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; 38ddc: 9c 01 movw r18, r24 38dde: 22 27 eor r18, r18 38de0: 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)) { 38de2: 23 2b or r18, r19 38de4: 09 f0 breq .+2 ; 0x38de8 38de6: 63 c0 rjmp .+198 ; 0x38eae 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; 38de8: 9c 01 movw r18, r24 38dea: 22 27 eor r18, r18 38dec: 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)) { 38dee: 23 2b or r18, r19 38df0: 09 f0 breq .+2 ; 0x38df4 38df2: 5f c0 rjmp .+190 ; 0x38eb2 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; 38df4: 9c 01 movw r18, r24 38df6: 22 27 eor r18, r18 38df8: 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)) { 38dfa: 23 2b or r18, r19 38dfc: 09 f0 breq .+2 ; 0x38e00 38dfe: 5b c0 rjmp .+182 ; 0x38eb6 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; 38e00: 9c 01 movw r18, r24 38e02: 22 27 eor r18, r18 38e04: 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)) { 38e06: 23 2b or r18, r19 38e08: 09 f0 breq .+2 ; 0x38e0c 38e0a: 57 c0 rjmp .+174 ; 0x38eba 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; 38e0c: 88 27 eor r24, r24 38e0e: 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)) { 38e10: 89 2b or r24, r25 38e12: 09 f4 brne .+2 ; 0x38e16 38e14: 68 c0 rjmp .+208 ; 0x38ee6 return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 38e16: 8f e0 ldi r24, 0x0F ; 15 38e18: 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; 38e1a: 9c 01 movw r18, r24 38e1c: 22 27 eor r18, r18 38e1e: 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)) { 38e20: 23 2b or r18, r19 38e22: 09 f0 breq .+2 ; 0x38e26 38e24: 4c c0 rjmp .+152 ; 0x38ebe 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; 38e26: 9c 01 movw r18, r24 38e28: 22 27 eor r18, r18 38e2a: 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)) { 38e2c: 23 2b or r18, r19 38e2e: 09 f0 breq .+2 ; 0x38e32 38e30: 48 c0 rjmp .+144 ; 0x38ec2 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; 38e32: 9c 01 movw r18, r24 38e34: 22 27 eor r18, r18 38e36: 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)) { 38e38: 23 2b or r18, r19 38e3a: 09 f0 breq .+2 ; 0x38e3e 38e3c: 44 c0 rjmp .+136 ; 0x38ec6 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; 38e3e: 9c 01 movw r18, r24 38e40: 22 27 eor r18, r18 38e42: 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)) { 38e44: 23 2b or r18, r19 38e46: 09 f0 breq .+2 ; 0x38e4a 38e48: 40 c0 rjmp .+128 ; 0x38eca 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; 38e4a: 9c 01 movw r18, r24 38e4c: 22 27 eor r18, r18 38e4e: 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)) { 38e50: 23 2b or r18, r19 38e52: e9 f5 brne .+122 ; 0x38ece 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; 38e54: 88 27 eor r24, r24 38e56: 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)) { 38e58: 89 2b or r24, r25 38e5a: 09 f4 brne .+2 ; 0x38e5e 38e5c: 44 c0 rjmp .+136 ; 0x38ee6 return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 38e5e: 80 e1 ldi r24, 0x10 ; 16 38e60: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38e62: 23 2b or r18, r19 38e64: 09 f4 brne .+2 ; 0x38e68 38e66: 3f c0 rjmp .+126 ; 0x38ee6 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; 38e68: 9c 01 movw r18, r24 38e6a: 22 27 eor r18, r18 38e6c: 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)) { 38e6e: 23 2b or r18, r19 38e70: 81 f5 brne .+96 ; 0x38ed2 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; 38e72: 9c 01 movw r18, r24 38e74: 22 27 eor r18, r18 38e76: 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)) { 38e78: 23 2b or r18, r19 38e7a: 69 f5 brne .+90 ; 0x38ed6 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; 38e7c: 9c 01 movw r18, r24 38e7e: 22 27 eor r18, r18 38e80: 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)) { 38e82: 23 2b or r18, r19 38e84: 51 f5 brne .+84 ; 0x38eda 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; 38e86: 9c 01 movw r18, r24 38e88: 22 27 eor r18, r18 38e8a: 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)) { 38e8c: 23 2b or r18, r19 38e8e: 39 f5 brne .+78 ; 0x38ede 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; 38e90: 9c 01 movw r18, r24 38e92: 22 27 eor r18, r18 38e94: 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)) { 38e96: 23 2b or r18, r19 38e98: 21 f5 brne .+72 ; 0x38ee2 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; 38e9a: 88 27 eor r24, r24 38e9c: 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)) { 38e9e: 89 2b or r24, r25 38ea0: 11 f1 breq .+68 ; 0x38ee6 return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 38ea2: 81 e1 ldi r24, 0x11 ; 17 38ea4: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 38ea6: 80 e0 ldi r24, 0x00 ; 0 38ea8: 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); 38eaa: 82 e1 ldi r24, 0x12 ; 18 38eac: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 38eae: 85 e1 ldi r24, 0x15 ; 21 38eb0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 38eb2: 88 e1 ldi r24, 0x18 ; 24 38eb4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 38eb6: 8b e1 ldi r24, 0x1B ; 27 38eb8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 38eba: 8c e0 ldi r24, 0x0C ; 12 38ebc: 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); 38ebe: 83 e1 ldi r24, 0x13 ; 19 38ec0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 38ec2: 86 e1 ldi r24, 0x16 ; 22 38ec4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 38ec6: 89 e1 ldi r24, 0x19 ; 25 38ec8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 38eca: 8c e1 ldi r24, 0x1C ; 28 38ecc: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 38ece: 8d e0 ldi r24, 0x0D ; 13 38ed0: 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); 38ed2: 84 e1 ldi r24, 0x14 ; 20 38ed4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 38ed6: 87 e1 ldi r24, 0x17 ; 23 38ed8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 38eda: 8a e1 ldi r24, 0x1A ; 26 38edc: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 38ede: 8d e1 ldi r24, 0x1D ; 29 38ee0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 38ee2: 8e e0 ldi r24, 0x0E ; 14 38ee4: 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); 38ee6: 8c e2 ldi r24, 0x2C ; 44 } 38ee8: 08 95 ret 00038eea : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 38eea: cf 92 push r12 38eec: df 92 push r13 38eee: ef 92 push r14 38ef0: ff 92 push r15 38ef2: 0f 93 push r16 38ef4: 1f 93 push r17 38ef6: cf 93 push r28 38ef8: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 38efa: 20 91 8b 13 lds r18, 0x138B ; 0x80138b 38efe: 30 91 8c 13 lds r19, 0x138C ; 0x80138c 38f02: 21 30 cpi r18, 0x01 ; 1 38f04: 31 05 cpc r19, r1 38f06: 39 f4 brne .+14 ; 0x38f16 38f08: 20 91 b4 13 lds r18, 0x13B4 ; 0x8013b4 38f0c: 21 30 cpi r18, 0x01 ; 1 38f0e: 19 f4 brne .+6 ; 0x38f16 // 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; 38f10: 22 e0 ldi r18, 0x02 ; 2 38f12: 20 93 f6 17 sts 0x17F6, r18 ; 0x8017f6 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 38f16: 0f 94 24 c6 call 0x38c48 ; 0x38c48 38f1a: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 38f1c: 80 91 f6 17 lds r24, 0x17F6 ; 0x8017f6 38f20: 81 30 cpi r24, 0x01 ; 1 38f22: 09 f4 brne .+2 ; 0x38f26 38f24: 64 c0 rjmp .+200 ; 0x38fee 38f26: 60 f0 brcs .+24 ; 0x38f40 38f28: 82 30 cpi r24, 0x02 ; 2 38f2a: 09 f4 brne .+2 ; 0x38f2e 38f2c: f4 c0 rjmp .+488 ; 0x39116 ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 38f2e: df 91 pop r29 38f30: cf 91 pop r28 38f32: 1f 91 pop r17 38f34: 0f 91 pop r16 38f36: ff 90 pop r15 38f38: ef 90 pop r14 38f3a: df 90 pop r13 38f3c: cf 90 pop r12 38f3e: 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); 38f40: 84 e0 ldi r24, 0x04 ; 4 38f42: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 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); 38f46: 0d 2f mov r16, r29 38f48: 10 e0 ldi r17, 0x00 ; 0 38f4a: f8 01 movw r30, r16 38f4c: e1 59 subi r30, 0x91 ; 145 38f4e: f4 45 sbci r31, 0x54 ; 84 38f50: 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); 38f52: fc 2e mov r15, r28 38f54: f2 94 swap r15 38f56: 6f e0 ldi r22, 0x0F ; 15 38f58: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 38f5a: 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); 38f5c: 80 e0 ldi r24, 0x00 ; 0 38f5e: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_clear(); 38f62: 0e 94 93 6e call 0xdd26 ; 0xdd26 // 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); 38f66: 00 0f add r16, r16 38f68: 11 1f adc r17, r17 38f6a: f8 01 movw r30, r16 38f6c: e4 56 subi r30, 0x64 ; 100 38f6e: f4 45 sbci r31, 0x54 ; 84 38f70: c5 90 lpm r12, Z+ 38f72: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 38f74: 09 5c subi r16, 0xC9 ; 201 38f76: 17 45 sbci r17, 0x57 ; 87 38f78: f8 01 movw r30, r16 38f7a: 85 91 lpm r24, Z+ 38f7c: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 38f7e: 0e 94 2c 72 call 0xe458 ; 0xe458 38f82: df 92 push r13 38f84: cf 92 push r12 38f86: 9f 93 push r25 38f88: 8f 93 push r24 38f8a: 88 e0 ldi r24, 0x08 ; 8 38f8c: 9c ea ldi r25, 0xAC ; 172 38f8e: 9f 93 push r25 38f90: 8f 93 push r24 38f92: 0e 94 39 6e call 0xdc72 ; 0xdc72 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)); 38f96: 4f ea ldi r20, 0xAF ; 175 38f98: 58 ea ldi r21, 0xA8 ; 168 38f9a: 62 e0 ldi r22, 0x02 ; 2 38f9c: 80 e0 ldi r24, 0x00 ; 0 38f9e: 0e 94 74 6e call 0xdce8 ; 0xdce8 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()); 38fa2: 0f 90 pop r0 38fa4: 0f 90 pop r0 38fa6: 0f 90 pop r0 38fa8: 0f 90 pop r0 38faa: 0f 90 pop r0 38fac: 0f 90 pop r0 38fae: f1 10 cpse r15, r1 38fb0: c6 c0 rjmp .+396 ; 0x3913e 38fb2: 10 e0 ldi r17, 0x00 ; 0 38fb4: 00 e0 ldi r16, 0x00 ; 0 38fb6: 42 e1 ldi r20, 0x12 ; 18 38fb8: e4 2e mov r14, r20 38fba: 5b e5 ldi r21, 0x5B ; 91 38fbc: c5 2e mov r12, r21 38fbe: 50 e7 ldi r21, 0x70 ; 112 38fc0: 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); 38fc2: ec 2f mov r30, r28 38fc4: f0 e0 ldi r31, 0x00 ; 0 38fc6: ee 0f add r30, r30 38fc8: ff 1f adc r31, r31 38fca: ec 50 subi r30, 0x0C ; 12 38fcc: f4 45 sbci r31, 0x54 ; 84 38fce: 85 91 lpm r24, Z+ 38fd0: 94 91 lpm r25, Z 38fd2: 0e 94 2c 72 call 0xe458 ; 0xe458 38fd6: bc 01 movw r22, r24 38fd8: 81 e0 ldi r24, 0x01 ; 1 38fda: f1 10 cpse r15, r1 38fdc: 01 c0 rjmp .+2 ; 0x38fe0 38fde: 80 e0 ldi r24, 0x00 ; 0 38fe0: 2e 2d mov r18, r14 38fe2: a6 01 movw r20, r12 38fe4: 0f 94 98 20 call 0x24130 ; 0x24130 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 38fe8: 81 e0 ldi r24, 0x01 ; 1 38fea: 80 93 f6 17 sts 0x17F6, r24 ; 0x8017f6 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 38fee: 81 e0 ldi r24, 0x01 ; 1 38ff0: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.492> ReportErrorHookDynamicRender(); // Render dynamic characters 38ff4: 0f 94 2e c5 call 0x38a5c ; 0x38a5c sound_wait_for_user(); 38ff8: 0f 94 25 53 call 0x2a64a ; 0x2a64a 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); 38ffc: 0d 2f mov r16, r29 38ffe: 10 e0 ldi r17, 0x00 ; 0 39000: f8 01 movw r30, r16 39002: e1 59 subi r30, 0x91 ; 145 39004: f4 45 sbci r31, 0x54 ; 84 39006: 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); 39008: dc 2f mov r29, r28 3900a: d2 95 swap r29 3900c: 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; 3900e: 80 91 ee 17 lds r24, 0x17EE ; 0x8017ee 39012: 81 11 cpse r24, r1 39014: 09 c0 rjmp .+18 ; 0x39028 39016: 81 e0 ldi r24, 0x01 ; 1 39018: d1 11 cpse r29, r1 3901a: 01 c0 rjmp .+2 ; 0x3901e 3901c: 80 e0 ldi r24, 0x00 ; 0 3901e: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed 39022: 81 e0 ldi r24, 0x01 ; 1 39024: 80 93 ee 17 sts 0x17EE, r24 ; 0x8017ee static int8_t choice_selected = -1; if (reset_button_selection) { 39028: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec 3902c: 88 23 and r24, r24 3902e: 41 f0 breq .+16 ; 0x39040 // 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; 39030: 81 e0 ldi r24, 0x01 ; 1 39032: d1 11 cpse r29, r1 39034: 01 c0 rjmp .+2 ; 0x39038 39036: 80 e0 ldi r24, 0x00 ; 0 39038: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed choice_selected = -1; reset_button_selection = 0; 3903c: 10 92 ec 17 sts 0x17EC, r1 ; 0x8017ec } // Check if knob was rotated if (lcd_encoder) { 39040: 20 91 70 06 lds r18, 0x0670 ; 0x800670 39044: 30 91 71 06 lds r19, 0x0671 ; 0x800671 39048: 21 15 cp r18, r1 3904a: 31 05 cpc r19, r1 3904c: b9 f1 breq .+110 ; 0x390bc 3904e: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed if (two_choices == false) { // third_choice is not nullptr, safe to dereference 39052: dd 23 and r29, r29 39054: 61 f0 breq .+24 ; 0x3906e if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 39056: 37 ff sbrs r19, 7 39058: 06 c0 rjmp .+12 ; 0x39066 3905a: 88 23 and r24, r24 3905c: 69 f0 breq .+26 ; 0x39078 // Rotating knob counter clockwise current_selection--; 3905e: 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; 39060: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed 39064: 09 c0 rjmp .+18 ; 0x39078 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) { 39066: 82 30 cpi r24, 0x02 ; 2 39068: 39 f0 breq .+14 ; 0x39078 // Rotating knob clockwise current_selection++; 3906a: 8f 5f subi r24, 0xFF ; 255 3906c: f9 cf rjmp .-14 ; 0x39060 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 3906e: 37 ff sbrs r19, 7 39070: 41 c0 rjmp .+130 ; 0x390f4 39072: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 39074: 10 92 ed 17 sts 0x17ED, r1 ; 0x8017ed //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 39078: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed 3907c: 4e e3 ldi r20, 0x3E ; 62 3907e: 81 11 cpse r24, r1 39080: 40 e2 ldi r20, 0x20 ; 32 39082: 63 e0 ldi r22, 0x03 ; 3 39084: 80 e0 ldi r24, 0x00 ; 0 39086: 0e 94 80 6e call 0xdd00 ; 0xdd00 3908a: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed if (two_choices == false) 3908e: dd 23 and r29, r29 39090: b1 f1 breq .+108 ; 0x390fe { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 39092: 4e e3 ldi r20, 0x3E ; 62 39094: 81 30 cpi r24, 0x01 ; 1 39096: 09 f0 breq .+2 ; 0x3909a 39098: 40 e2 ldi r20, 0x20 ; 32 3909a: 63 e0 ldi r22, 0x03 ; 3 3909c: 89 e0 ldi r24, 0x09 ; 9 3909e: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 390a2: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed 390a6: 82 30 cpi r24, 0x02 ; 2 390a8: 61 f5 brne .+88 ; 0x39102 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 390aa: 4e e3 ldi r20, 0x3E ; 62 390ac: 63 e0 ldi r22, 0x03 ; 3 390ae: 82 e1 ldi r24, 0x12 ; 18 390b0: 0e 94 80 6e call 0xdd00 ; 0xdd00 } // Consume rotation event lcd_encoder = 0; 390b4: 10 92 71 06 sts 0x0671, r1 ; 0x800671 390b8: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 390bc: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 390c0: 88 23 and r24, r24 390c2: 09 f4 brne .+2 ; 0x390c6 390c4: 34 cf rjmp .-408 ; 0x38f2e choice_selected = current_selection; 390c6: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 390ca: d1 11 cpse r29, r1 390cc: 1c c0 rjmp .+56 ; 0x39106 390ce: 81 30 cpi r24, 0x01 ; 1 390d0: 89 f5 brne .+98 ; 0x39134 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); 390d2: f8 01 movw r30, r16 390d4: ee 0f add r30, r30 390d6: ff 1f adc r31, r31 390d8: eb 5e subi r30, 0xEB ; 235 390da: f4 45 sbci r31, 0x54 ; 84 390dc: 85 91 lpm r24, Z+ 390de: 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))); 390e0: 0e 94 2c 72 call 0xe458 ; 0xe458 390e4: 0f 94 f6 20 call 0x241ec ; 0x241ec SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 390e8: 81 e0 ldi r24, 0x01 ; 1 390ea: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec 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; 390ee: 10 92 f6 17 sts 0x17F6, r1 ; 0x8017f6 390f2: 1d cf rjmp .-454 ; 0x38f2e } } 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) { 390f4: 81 30 cpi r24, 0x01 ; 1 390f6: 09 f4 brne .+2 ; 0x390fa 390f8: bf cf rjmp .-130 ; 0x39078 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 390fa: 81 e0 ldi r24, 0x01 ; 1 390fc: b1 cf rjmp .-158 ; 0x39060 { 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 ? '>': ' '); 390fe: 81 30 cpi r24, 0x01 ; 1 39100: a1 f2 breq .-88 ; 0x390aa 39102: 40 e2 ldi r20, 0x20 ; 32 39104: d3 cf rjmp .-90 ; 0x390ac // 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 39106: 82 30 cpi r24, 0x02 ; 2 39108: 21 f3 breq .-56 ; 0x390d2 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 3910a: 81 30 cpi r24, 0x01 ; 1 3910c: 99 f4 brne .+38 ; 0x39134 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 3910e: d0 93 ae 0d sts 0x0DAE, r29 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 39112: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 39116: 81 e0 ldi r24, 0x01 ; 1 39118: 0e 94 a5 6e call 0xdd4a ; 0xdd4a lcd_return_to_status(); 3911c: 0f 94 ab 1f call 0x23f56 ; 0x23f56 39120: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_ZL10beep_timer.lto_priv.496> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 39124: 10 92 6e 05 sts 0x056E, r1 ; 0x80056e <_ZL6bFirst.lto_priv.497> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 39128: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.492> KEEPALIVE_STATE(IN_HANDLER); 3912c: 82 e0 ldi r24, 0x02 ; 2 3912e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 39132: dd cf rjmp .-70 ; 0x390ee 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); 39134: cf 70 andi r28, 0x0F ; 15 39136: c0 93 ae 0d sts 0x0DAE, r28 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 3913a: 81 e0 ldi r24, 0x01 ; 1 3913c: ea cf rjmp .-44 ; 0x39112 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); 3913e: ef 2d mov r30, r15 39140: f0 e0 ldi r31, 0x00 ; 0 39142: ee 0f add r30, r30 39144: ff 1f adc r31, r31 39146: ec 50 subi r30, 0x0C ; 12 39148: f4 45 sbci r31, 0x54 ; 84 3914a: 85 91 lpm r24, Z+ 3914c: 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()); 3914e: 0e 94 2c 72 call 0xe458 ; 0xe458 39152: 6c 01 movw r12, r24 39154: 0b e5 ldi r16, 0x5B ; 91 39156: 10 e7 ldi r17, 0x70 ; 112 39158: 99 e0 ldi r25, 0x09 ; 9 3915a: e9 2e mov r14, r25 3915c: 32 cf rjmp .-412 ; 0x38fc2 0003915e : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 3915e: 0f 94 24 c6 call 0x38c48 ; 0x38c48 // 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); 39162: e8 2f mov r30, r24 39164: f0 e0 ldi r31, 0x00 ; 0 39166: ee 0f add r30, r30 39168: ff 1f adc r31, r31 3916a: e4 56 subi r30, 0x64 ; 100 3916c: f4 45 sbci r31, 0x54 ; 84 3916e: 25 91 lpm r18, Z+ 39170: 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) ) { 39172: 23 33 cpi r18, 0x33 ; 51 39174: 81 e0 ldi r24, 0x01 ; 1 39176: 38 07 cpc r19, r24 39178: 08 f0 brcs .+2 ; 0x3917c 3917a: 41 c0 rjmp .+130 ; 0x391fe 3917c: 2d 32 cpi r18, 0x2D ; 45 3917e: 81 e0 ldi r24, 0x01 ; 1 39180: 38 07 cpc r19, r24 39182: 78 f5 brcc .+94 ; 0x391e2 39184: 2e 37 cpi r18, 0x7E ; 126 39186: 31 05 cpc r19, r1 39188: 09 f4 brne .+2 ; 0x3918c 3918a: 83 c0 rjmp .+262 ; 0x39292 3918c: f0 f4 brcc .+60 ; 0x391ca 3918e: 2c 36 cpi r18, 0x6C ; 108 39190: 31 05 cpc r19, r1 39192: 09 f4 brne .+2 ; 0x39196 39194: 85 c0 rjmp .+266 ; 0x392a0 39196: 30 f4 brcc .+12 ; 0x391a4 39198: 25 36 cpi r18, 0x65 ; 101 3919a: 31 05 cpc r19, r1 3919c: 08 f0 brcs .+2 ; 0x391a0 3919e: 79 c0 rjmp .+242 ; 0x39292 default: break; } return Buttons::NoButton; 391a0: 8f ef ldi r24, 0xFF ; 255 391a2: 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) ) { 391a4: 24 37 cpi r18, 0x74 ; 116 391a6: 31 05 cpc r19, r1 391a8: 09 f4 brne .+2 ; 0x391ac 391aa: 73 c0 rjmp .+230 ; 0x39292 391ac: 2d 37 cpi r18, 0x7D ; 125 391ae: 31 05 cpc r19, r1 391b0: 19 f0 breq .+6 ; 0x391b8 391b2: 23 37 cpi r18, 0x73 ; 115 391b4: 31 05 cpc r19, r1 391b6: a1 f7 brne .-24 ; 0x391a0 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 391b8: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 391bc: 81 30 cpi r24, 0x01 ; 1 391be: 09 f4 brne .+2 ; 0x391c2 391c0: 6d c0 rjmp .+218 ; 0x3929c 391c2: 87 30 cpi r24, 0x07 ; 7 391c4: 69 f7 brne .-38 ; 0x391a0 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 391c6: 88 e0 ldi r24, 0x08 ; 8 391c8: 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) ) { 391ca: 23 3d cpi r18, 0xD3 ; 211 391cc: 31 05 cpc r19, r1 391ce: 09 f4 brne .+2 ; 0x391d2 391d0: 6e c0 rjmp .+220 ; 0x392ae 391d2: 50 f4 brcc .+20 ; 0x391e8 391d4: 29 3c cpi r18, 0xC9 ; 201 391d6: 31 05 cpc r19, r1 391d8: 09 f4 brne .+2 ; 0x391dc 391da: 69 c0 rjmp .+210 ; 0x392ae 391dc: 2a 3c cpi r18, 0xCA ; 202 391de: 31 05 cpc r19, r1 391e0: f9 f6 brne .-66 ; 0x391a0 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) { 391e2: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 391e6: 67 c0 rjmp .+206 ; 0x392b6 // 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) ) { 391e8: 2d 3d cpi r18, 0xDD ; 221 391ea: 31 05 cpc r19, r1 391ec: 09 f4 brne .+2 ; 0x391f0 391ee: 5f c0 rjmp .+190 ; 0x392ae 391f0: 2e 3d cpi r18, 0xDE ; 222 391f2: 31 05 cpc r19, r1 391f4: b1 f3 breq .-20 ; 0x391e2 391f6: 24 3d cpi r18, 0xD4 ; 212 391f8: 31 05 cpc r19, r1 391fa: 91 f6 brne .-92 ; 0x391a0 391fc: f2 cf rjmp .-28 ; 0x391e2 391fe: 25 3f cpi r18, 0xF5 ; 245 39200: 81 e0 ldi r24, 0x01 ; 1 39202: 38 07 cpc r19, r24 39204: 09 f4 brne .+2 ; 0x39208 39206: 5c c0 rjmp .+184 ; 0x392c0 39208: f8 f4 brcc .+62 ; 0x39248 3920a: 26 34 cpi r18, 0x46 ; 70 3920c: 81 e0 ldi r24, 0x01 ; 1 3920e: 38 07 cpc r19, r24 39210: 58 f4 brcc .+22 ; 0x39228 39212: 21 34 cpi r18, 0x41 ; 65 39214: 81 e0 ldi r24, 0x01 ; 1 39216: 38 07 cpc r19, r24 39218: 20 f7 brcc .-56 ; 0x391e2 3921a: 27 53 subi r18, 0x37 ; 55 3921c: 31 40 sbci r19, 0x01 ; 1 3921e: 25 30 cpi r18, 0x05 ; 5 39220: 31 05 cpc r19, r1 39222: 08 f0 brcs .+2 ; 0x39226 39224: bd cf rjmp .-134 ; 0x391a0 39226: dd cf rjmp .-70 ; 0x391e2 39228: 21 59 subi r18, 0x91 ; 145 3922a: 31 40 sbci r19, 0x01 ; 1 3922c: 22 30 cpi r18, 0x02 ; 2 3922e: 31 05 cpc r19, r1 39230: 08 f0 brcs .+2 ; 0x39234 39232: b6 cf rjmp .-148 ; 0x391a0 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 39234: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 39238: 83 30 cpi r24, 0x03 ; 3 3923a: 09 f4 brne .+2 ; 0x3923e 3923c: 3f c0 rjmp .+126 ; 0x392bc 3923e: 89 30 cpi r24, 0x09 ; 9 39240: 09 f0 breq .+2 ; 0x39244 39242: ae cf rjmp .-164 ; 0x391a0 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 39244: 87 e0 ldi r24, 0x07 ; 7 39246: 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) ) { 39248: 29 3f cpi r18, 0xF9 ; 249 3924a: 81 e0 ldi r24, 0x01 ; 1 3924c: 38 07 cpc r19, r24 3924e: 49 f2 breq .-110 ; 0x391e2 39250: 70 f4 brcc .+28 ; 0x3926e 39252: 27 3f cpi r18, 0xF7 ; 247 39254: 81 e0 ldi r24, 0x01 ; 1 39256: 38 07 cpc r19, r24 39258: 21 f2 breq .-120 ; 0x391e2 3925a: 60 f7 brcc .-40 ; 0x39234 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 3925c: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 39260: 83 30 cpi r24, 0x03 ; 3 39262: 61 f1 breq .+88 ; 0x392bc 39264: 88 30 cpi r24, 0x08 ; 8 39266: 09 f0 breq .+2 ; 0x3926a 39268: 9b cf rjmp .-202 ; 0x391a0 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 3926a: 86 e0 ldi r24, 0x06 ; 6 3926c: 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) ) { 3926e: 2b 3f cpi r18, 0xFB ; 251 39270: 81 e0 ldi r24, 0x01 ; 1 39272: 38 07 cpc r19, r24 39274: a9 f0 breq .+42 ; 0x392a0 39276: 68 f0 brcs .+26 ; 0x39292 39278: 2c 3f cpi r18, 0xFC ; 252 3927a: 31 40 sbci r19, 0x01 ; 1 3927c: 09 f0 breq .+2 ; 0x39280 3927e: 90 cf rjmp .-224 ; 0x391a0 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 39280: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 39284: 85 30 cpi r24, 0x05 ; 5 39286: 89 f0 breq .+34 ; 0x392aa 39288: 86 30 cpi r24, 0x06 ; 6 3928a: 09 f0 breq .+2 ; 0x3928e 3928c: 89 cf rjmp .-238 ; 0x391a0 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 3928e: 85 e0 ldi r24, 0x05 ; 5 39290: 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) { 39292: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 39296: 81 30 cpi r24, 0x01 ; 1 39298: 09 f0 breq .+2 ; 0x3929c 3929a: 82 cf rjmp .-252 ; 0x391a0 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; 3929c: 81 e0 ldi r24, 0x01 ; 1 3929e: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 392a0: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 392a4: 82 30 cpi r24, 0x02 ; 2 392a6: d1 f3 breq .-12 ; 0x3929c 392a8: 7b cf rjmp .-266 ; 0x391a0 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 392aa: 84 e0 ldi r24, 0x04 ; 4 392ac: 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) { 392ae: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 392b2: 82 30 cpi r24, 0x02 ; 2 392b4: 61 f0 breq .+24 ; 0x392ce 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) { 392b6: 83 30 cpi r24, 0x03 ; 3 392b8: 09 f0 breq .+2 ; 0x392bc 392ba: 72 cf rjmp .-284 ; 0x391a0 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; 392bc: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 392be: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 392c0: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.495> 392c4: 82 30 cpi r24, 0x02 ; 2 392c6: 29 f0 breq .+10 ; 0x392d2 392c8: 84 30 cpi r24, 0x04 ; 4 392ca: 09 f0 breq .+2 ; 0x392ce 392cc: 69 cf rjmp .-302 ; 0x391a0 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; 392ce: 82 e0 ldi r24, 0x02 ; 2 392d0: 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; 392d2: 80 e0 ldi r24, 0x00 ; 0 392d4: 08 95 ret 000392d6 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 392d6: cf 93 push r28 392d8: df 93 push r29 392da: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 392dc: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 392e0: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 392e4: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 392e8: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 392ec: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 392f0: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 392f4: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 392f8: c9 01 movw r24, r18 392fa: 86 1b sub r24, r22 392fc: 97 0b sbc r25, r23 392fe: 06 97 sbiw r24, 0x06 ; 6 39300: 24 f0 brlt .+8 ; 0x3930a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]+0x34> void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 39302: ce 01 movw r24, r28 39304: 0e 94 6c 8c call 0x118d8 ; 0x118d8 39308: e9 cf rjmp .-46 ; 0x392dc (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]+0x6> f(); safe_delay_keep_alive(delay); } } 3930a: df 91 pop r29 3930c: cf 91 pop r28 3930e: 08 95 ret 00039310 : } //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) { 39310: cf 93 push r28 39312: df 93 push r29 39314: 00 d0 rcall .+0 ; 0x39316 39316: 00 d0 rcall .+0 ; 0x39318 39318: 1f 92 push r1 3931a: cd b7 in r28, 0x3d ; 61 3931c: 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)) 3931e: 87 30 cpi r24, 0x07 ; 7 39320: 50 f5 brcc .+84 ; 0x39376 39322: 67 30 cpi r22, 0x07 ; 7 39324: 40 f5 brcc .+80 ; 0x39376 return false; uint8_t valid_points_mask[7] = { 39326: 97 e0 ldi r25, 0x07 ; 7 39328: e6 ec ldi r30, 0xC6 ; 198 3932a: f2 e0 ldi r31, 0x02 ; 2 3932c: de 01 movw r26, r28 3932e: 11 96 adiw r26, 0x01 ; 1 39330: 01 90 ld r0, Z+ 39332: 0d 92 st X+, r0 39334: 9a 95 dec r25 39336: e1 f7 brne .-8 ; 0x39330 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 39338: 46 e0 ldi r20, 0x06 ; 6 3933a: 50 e0 ldi r21, 0x00 ; 0 3933c: fa 01 movw r30, r20 3933e: e6 1b sub r30, r22 39340: f1 09 sbc r31, r1 39342: 21 e0 ldi r18, 0x01 ; 1 39344: 30 e0 ldi r19, 0x00 ; 0 39346: 2c 0f add r18, r28 39348: 3d 1f adc r19, r29 3934a: e2 0f add r30, r18 3934c: f3 1f adc r31, r19 3934e: 20 81 ld r18, Z 39350: 30 e0 ldi r19, 0x00 ; 0 39352: 48 1b sub r20, r24 39354: 51 09 sbc r21, r1 39356: c9 01 movw r24, r18 39358: 02 c0 rjmp .+4 ; 0x3935e 3935a: 95 95 asr r25 3935c: 87 95 ror r24 3935e: 4a 95 dec r20 39360: e2 f7 brpl .-8 ; 0x3935a 39362: 81 70 andi r24, 0x01 ; 1 } 39364: 27 96 adiw r28, 0x07 ; 7 39366: 0f b6 in r0, 0x3f ; 63 39368: f8 94 cli 3936a: de bf out 0x3e, r29 ; 62 3936c: 0f be out 0x3f, r0 ; 63 3936e: cd bf out 0x3d, r28 ; 61 39370: df 91 pop r29 39372: cf 91 pop r28 39374: 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; 39376: 80 e0 ldi r24, 0x00 ; 0 39378: f5 cf rjmp .-22 ; 0x39364 0003937a : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 3937a: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.499+0x1> 3937e: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.499> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 39382: 80 e1 ldi r24, 0x10 ; 16 39384: 0e 94 7d ef call 0x1defa ; 0x1defa 39388: 88 23 and r24, r24 3938a: 91 f0 breq .+36 ; 0x393b0 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 3938c: 0e 94 ff 78 call 0xf1fe ; 0xf1fe // 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))); 39390: 81 ea ldi r24, 0xA1 ; 161 39392: 9d e0 ldi r25, 0x0D ; 13 39394: 0f 94 54 dc call 0x3b8a8 ; 0x3b8a8 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-> 39398: 2b e0 ldi r18, 0x0B ; 11 3939a: 82 9f mul r24, r18 3939c: c0 01 movw r24, r0 3939e: 11 24 eor r1, r1 393a0: 80 5b subi r24, 0xB0 ; 176 393a2: 92 4f sbci r25, 0xF2 ; 242 393a4: 0f 94 62 dc call 0x3b8c4 ; 0x3b8c4 393a8: 90 93 8b 06 sts 0x068B, r25 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.499+0x1> 393ac: 80 93 8a 06 sts 0x068A, r24 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.499> SERIAL_ECHO("correction: "); SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_mm[Z_AXIS])); SERIAL_ECHOLN(""); #endif } } 393b0: 08 95 ret 000393b2 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 393b2: 0f 93 push r16 393b4: 1f 93 push r17 393b6: cf 93 push r28 393b8: df 93 push r29 393ba: 00 d0 rcall .+0 ; 0x393bc 393bc: 1f 92 push r1 393be: cd b7 in r28, 0x3d ; 61 393c0: de b7 in r29, 0x3e ; 62 393c2: 9b 01 movw r18, r22 393c4: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 393c6: 02 e9 ldi r16, 0x92 ; 146 393c8: 16 e0 ldi r17, 0x06 ; 6 393ca: f8 01 movw r30, r16 393cc: 60 85 ldd r22, Z+8 ; 0x08 393ce: 71 85 ldd r23, Z+9 ; 0x09 393d0: 82 85 ldd r24, Z+10 ; 0x0a 393d2: 93 85 ldd r25, Z+11 ; 0x0b 393d4: 69 83 std Y+1, r22 ; 0x01 393d6: 7a 83 std Y+2, r23 ; 0x02 393d8: 8b 83 std Y+3, r24 ; 0x03 393da: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 393dc: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 393e0: f8 01 movw r30, r16 393e2: 60 87 std Z+8, r22 ; 0x08 393e4: 71 87 std Z+9, r23 ; 0x09 393e6: 82 87 std Z+10, r24 ; 0x0a 393e8: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 393ea: 65 e5 ldi r22, 0x55 ; 85 393ec: 75 e5 ldi r23, 0x55 ; 85 393ee: 85 e5 ldi r24, 0x55 ; 85 393f0: 91 e4 ldi r25, 0x41 ; 65 393f2: 0f 94 81 c0 call 0x38102 ; 0x38102 st_synchronize(); 393f6: 0f 94 ed 43 call 0x287da ; 0x287da current_position[Z_AXIS] = curpos_z; 393fa: 89 81 ldd r24, Y+1 ; 0x01 393fc: 9a 81 ldd r25, Y+2 ; 0x02 393fe: ab 81 ldd r26, Y+3 ; 0x03 39400: bc 81 ldd r27, Y+4 ; 0x04 39402: f8 01 movw r30, r16 39404: 80 87 std Z+8, r24 ; 0x08 39406: 91 87 std Z+9, r25 ; 0x09 39408: a2 87 std Z+10, r26 ; 0x0a 3940a: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 3940c: ce 01 movw r24, r28 3940e: 01 96 adiw r24, 0x01 ; 1 39410: 0f 94 2c 65 call 0x2ca58 ; 0x2ca58 } 39414: 0f 90 pop r0 39416: 0f 90 pop r0 39418: 0f 90 pop r0 3941a: 0f 90 pop r0 3941c: df 91 pop r29 3941e: cf 91 pop r28 39420: 1f 91 pop r17 39422: 0f 91 pop r16 39424: 08 95 ret 00039426 : 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])); 39426: 60 91 8a 06 lds r22, 0x068A ; 0x80068a <_ZL13babystepLoadZ.lto_priv.499> 3942a: 70 91 8b 06 lds r23, 0x068B ; 0x80068b <_ZL13babystepLoadZ.lto_priv.499+0x1> 3942e: 07 2e mov r0, r23 39430: 00 0c add r0, r0 39432: 88 0b sbc r24, r24 39434: 99 0b sbc r25, r25 39436: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 3943a: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 3943e: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 39442: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 39446: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 3944a: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 3944e: 0f 94 d9 c9 call 0x393b2 ; 0x393b2 babystepLoadZ = 0; 39452: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.499+0x1> 39456: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.499> } 3945a: 08 95 ret 0003945c : return sampled; } void go_home_with_z_lift() { 3945c: cf 93 push r28 3945e: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 39460: 0e 94 43 66 call 0xcc86 ; 0xcc86 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 39464: c2 e9 ldi r28, 0x92 ; 146 39466: d6 e0 ldi r29, 0x06 ; 6 39468: 80 e0 ldi r24, 0x00 ; 0 3946a: 90 e0 ldi r25, 0x00 ; 0 3946c: a0 ea ldi r26, 0xA0 ; 160 3946e: b0 e4 ldi r27, 0x40 ; 64 39470: 88 87 std Y+8, r24 ; 0x08 39472: 99 87 std Y+9, r25 ; 0x09 39474: aa 87 std Y+10, r26 ; 0x0a 39476: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 39478: 65 e5 ldi r22, 0x55 ; 85 3947a: 75 e5 ldi r23, 0x55 ; 85 3947c: 85 e5 ldi r24, 0x55 ; 85 3947e: 91 e4 ldi r25, 0x41 ; 65 39480: 0f 94 09 c6 call 0x38c12 ; 0x38c12 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 39484: 8d ec ldi r24, 0xCD ; 205 39486: 9c ec ldi r25, 0xCC ; 204 39488: ac e4 ldi r26, 0x4C ; 76 3948a: be e3 ldi r27, 0x3E ; 62 3948c: 88 83 st Y, r24 3948e: 99 83 std Y+1, r25 ; 0x01 39490: aa 83 std Y+2, r26 ; 0x02 39492: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 39494: 83 e3 ldi r24, 0x33 ; 51 39496: 93 e3 ldi r25, 0x33 ; 51 39498: a3 e7 ldi r26, 0x73 ; 115 3949a: b0 ec ldi r27, 0xC0 ; 192 3949c: 8c 83 std Y+4, r24 ; 0x04 3949e: 9d 83 std Y+5, r25 ; 0x05 394a0: ae 83 std Y+6, r26 ; 0x06 394a2: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 394a4: 66 e9 ldi r22, 0x96 ; 150 394a6: 76 e0 ldi r23, 0x06 ; 6 394a8: ce 01 movw r24, r28 394aa: 0e 94 2a 6a call 0xd454 ; 0xd454 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 394ae: 60 e0 ldi r22, 0x00 ; 0 394b0: 70 e0 ldi r23, 0x00 ; 0 394b2: 86 e1 ldi r24, 0x16 ; 22 394b4: 93 e4 ldi r25, 0x43 ; 67 394b6: 0f 94 09 c6 call 0x38c12 ; 0x38c12 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 394ba: 8a e9 ldi r24, 0x9A ; 154 394bc: 99 e9 ldi r25, 0x99 ; 153 394be: a9 e1 ldi r26, 0x19 ; 25 394c0: be e3 ldi r27, 0x3E ; 62 394c2: 88 87 std Y+8, r24 ; 0x08 394c4: 99 87 std Y+9, r25 ; 0x09 394c6: aa 87 std Y+10, r26 ; 0x0a 394c8: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 394ca: 65 e5 ldi r22, 0x55 ; 85 394cc: 75 e5 ldi r23, 0x55 ; 85 394ce: 85 e5 ldi r24, 0x55 ; 85 394d0: 91 e4 ldi r25, 0x41 ; 65 } 394d2: df 91 pop r29 394d4: 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); 394d6: 0d 94 09 c6 jmp 0x38c12 ; 0x38c12 000394da : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 394da: 68 2f mov r22, r24 394dc: 70 e0 ldi r23, 0x00 ; 0 394de: 90 e0 ldi r25, 0x00 ; 0 394e0: 80 e0 ldi r24, 0x00 ; 0 394e2: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 394e6: 20 e0 ldi r18, 0x00 ; 0 394e8: 30 e0 ldi r19, 0x00 ; 0 394ea: 48 e0 ldi r20, 0x08 ; 8 394ec: 52 e4 ldi r21, 0x42 ; 66 394ee: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 394f2: 20 e0 ldi r18, 0x00 ; 0 394f4: 30 e0 ldi r19, 0x00 ; 0 394f6: 40 e8 ldi r20, 0x80 ; 128 394f8: 5f e3 ldi r21, 0x3F ; 63 394fa: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> } 394fe: 08 95 ret 00039500 : // 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() { 39500: 2f 92 push r2 39502: 3f 92 push r3 39504: 4f 92 push r4 39506: 5f 92 push r5 39508: 6f 92 push r6 3950a: 7f 92 push r7 3950c: 8f 92 push r8 3950e: 9f 92 push r9 39510: af 92 push r10 39512: bf 92 push r11 39514: cf 92 push r12 39516: df 92 push r13 39518: ef 92 push r14 3951a: ff 92 push r15 3951c: 0f 93 push r16 3951e: 1f 93 push r17 39520: cf 93 push r28 39522: df 93 push r29 39524: 00 d0 rcall .+0 ; 0x39526 39526: 00 d0 rcall .+0 ; 0x39528 39528: cd b7 in r28, 0x3d ; 61 3952a: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 3952c: 84 e0 ldi r24, 0x04 ; 4 3952e: 0f 94 dd 26 call 0x24dba ; 0x24dba return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 39532: 80 91 b7 02 lds r24, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> 39536: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 39538: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> #endif bool endstops_enabled = enable_endstops(false); bool endstop_z_enabled = enable_z_endstop(false); 3953c: 80 e0 ldi r24, 0x00 ; 0 3953e: 0f 94 e7 4e call 0x29dce ; 0x29dce 39542: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 39544: 0e 94 43 66 call 0xcc86 ; 0xcc86 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 39548: 8b ed ldi r24, 0xDB ; 219 3954a: 9a e5 ldi r25, 0x5A ; 90 3954c: 0e 94 2c 72 call 0xe458 ; 0xe458 39550: 0f 94 e9 20 call 0x241d2 ; 0x241d2 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 39554: 47 e5 ldi r20, 0x57 ; 87 39556: 50 e7 ldi r21, 0x70 ; 112 39558: 63 e0 ldi r22, 0x03 ; 3 3955a: 80 e0 ldi r24, 0x00 ; 0 3955c: 0e 94 74 6e call 0xdce8 ; 0xdce8 39560: 81 e0 ldi r24, 0x01 ; 1 39562: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> // 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; 39566: 80 e0 ldi r24, 0x00 ; 0 39568: 90 e0 ldi r25, 0x00 ; 0 3956a: a0 ea ldi r26, 0xA0 ; 160 3956c: b0 e4 ldi r27, 0x40 ; 64 3956e: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 39572: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 39576: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 3957a: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 3957e: 65 e5 ldi r22, 0x55 ; 85 39580: 75 e5 ldi r23, 0x55 ; 85 39582: 85 e5 ldi r24, 0x55 ; 85 39584: 91 e4 ldi r25, 0x41 ; 65 39586: 0f 94 09 c6 call 0x38c12 ; 0x38c12 #ifdef TMC2130 check_Z_crash(); 3958a: 0e 94 b1 79 call 0xf362 ; 0xf362 3958e: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> #endif enable_endstops(false); // Move XY to first point current_position[X_AXIS] = BED_X0; 39592: 80 e0 ldi r24, 0x00 ; 0 39594: 90 e0 ldi r25, 0x00 ; 0 39596: a0 e8 ldi r26, 0x80 ; 128 39598: bf e3 ldi r27, 0x3F ; 63 3959a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 3959e: 90 93 93 06 sts 0x0693, r25 ; 0x800693 395a2: a0 93 94 06 sts 0x0694, r26 ; 0x800694 395a6: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = BED_Y0; 395aa: 80 93 96 06 sts 0x0696, r24 ; 0x800696 395ae: 90 93 97 06 sts 0x0697, r25 ; 0x800697 395b2: a0 93 98 06 sts 0x0698, r26 ; 0x800698 395b6: b0 93 99 06 sts 0x0699, r27 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 395ba: 66 e9 ldi r22, 0x96 ; 150 395bc: 76 e0 ldi r23, 0x06 ; 6 395be: 82 e9 ldi r24, 0x92 ; 146 395c0: 96 e0 ldi r25, 0x06 ; 6 395c2: 0e 94 2a 6a call 0xd454 ; 0xd454 go_to_current(homing_feedrate[X_AXIS]/60); 395c6: 60 e0 ldi r22, 0x00 ; 0 395c8: 70 e0 ldi r23, 0x00 ; 0 395ca: 88 e4 ldi r24, 0x48 ; 72 395cc: 92 e4 ldi r25, 0x42 ; 66 395ce: 0f 94 09 c6 call 0x38c12 ; 0x38c12 set_destination_to_current(); 395d2: 0e 94 ba 67 call 0xcf74 ; 0xcf74 homeaxis(Z_AXIS); 395d6: 50 e0 ldi r21, 0x00 ; 0 395d8: 40 e0 ldi r20, 0x00 ; 0 395da: 61 e0 ldi r22, 0x01 ; 1 395dc: 82 e0 ldi r24, 0x02 ; 2 395de: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 395e2: 43 e0 ldi r20, 0x03 ; 3 395e4: 60 e0 ldi r22, 0x00 ; 0 395e6: 70 e0 ldi r23, 0x00 ; 0 395e8: 80 e2 ldi r24, 0x20 ; 32 395ea: 91 ec ldi r25, 0xC1 ; 193 395ec: 0f 94 8f 8c call 0x3191e ; 0x3191e 395f0: 81 11 cpse r24, r1 395f2: 06 c0 rjmp .+12 ; 0x39600 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)); 395f4: 8f e8 ldi r24, 0x8F ; 143 395f6: 93 e6 ldi r25, 0x63 ; 99 395f8: 0e 94 2c 72 call 0xe458 ; 0xe458 395fc: 0e 94 8a 79 call 0xf314 ; 0xf314 float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 39600: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 39604: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 39608: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 3960c: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 39610: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 39614: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 39618: a0 93 c5 13 sts 0x13C5, r26 ; 0x8013c5 3961c: b0 93 c6 13 sts 0x13C6, r27 ; 0x8013c6 39620: e2 e0 ldi r30, 0x02 ; 2 39622: f0 e0 ldi r31, 0x00 ; 0 39624: fa 83 std Y+2, r31 ; 0x02 39626: 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; 39628: c1 2c mov r12, r1 3962a: d1 2c mov r13, r1 3962c: 30 ea ldi r19, 0xA0 ; 160 3962e: e3 2e mov r14, r19 39630: 30 e4 ldi r19, 0x40 ; 64 39632: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 39634: 43 e0 ldi r20, 0x03 ; 3 39636: 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 39638: 52 e0 ldi r21, 0x02 ; 2 3963a: 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); 3963c: 00 e0 ldi r16, 0x00 ; 0 3963e: 1b ea ldi r17, 0xAB ; 171 39640: 67 e0 ldi r22, 0x07 ; 7 39642: 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(); 39644: 0e 94 43 66 call 0xcc86 ; 0xcc86 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 39648: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 3964c: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 39650: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 39654: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 39658: 65 e5 ldi r22, 0x55 ; 85 3965a: 75 e5 ldi r23, 0x55 ; 85 3965c: 85 e5 ldi r24, 0x55 ; 85 3965e: 91 e4 ldi r25, 0x41 ; 65 39660: 0f 94 09 c6 call 0x38c12 ; 0x38c12 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 39664: 29 81 ldd r18, Y+1 ; 0x01 39666: 21 50 subi r18, 0x01 ; 1 39668: 82 2f mov r24, r18 3966a: 6b 2d mov r22, r11 3966c: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__udivmodqi4> 39670: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 39672: 82 2f mov r24, r18 39674: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e <__divmodqi4> 39678: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 3967a: 80 ff sbrs r24, 0 3967c: 03 c0 rjmp .+6 ; 0x39684 3967e: f9 2d mov r31, r9 39680: f8 19 sub r31, r8 39682: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 39684: 88 2d mov r24, r8 39686: 88 0f add r24, r24 39688: 88 0d add r24, r8 3968a: 0f 94 6d ca call 0x394da ; 0x394da 3968e: 60 93 92 06 sts 0x0692, r22 ; 0x800692 39692: 70 93 93 06 sts 0x0693, r23 ; 0x800693 39696: 80 93 94 06 sts 0x0694, r24 ; 0x800694 3969a: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = BED_Y(iy * 3); 3969e: 87 2d mov r24, r7 396a0: 88 0f add r24, r24 396a2: 87 0d add r24, r7 396a4: 0f 94 6d ca call 0x394da ; 0x394da 396a8: 60 93 96 06 sts 0x0696, r22 ; 0x800696 396ac: 70 93 97 06 sts 0x0697, r23 ; 0x800697 396b0: 80 93 98 06 sts 0x0698, r24 ; 0x800698 396b4: 90 93 99 06 sts 0x0699, r25 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 396b8: 66 e9 ldi r22, 0x96 ; 150 396ba: 76 e0 ldi r23, 0x06 ; 6 396bc: 82 e9 ldi r24, 0x92 ; 146 396be: 96 e0 ldi r25, 0x06 ; 6 396c0: 0e 94 2a 6a call 0xd454 ; 0xd454 go_to_current(homing_feedrate[X_AXIS]/60); 396c4: 60 e0 ldi r22, 0x00 ; 0 396c6: 70 e0 ldi r23, 0x00 ; 0 396c8: 88 e4 ldi r24, 0x48 ; 72 396ca: 92 e4 ldi r25, 0x42 ; 66 396cc: 0f 94 09 c6 call 0x38c12 ; 0x38c12 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 396d0: 63 e0 ldi r22, 0x03 ; 3 396d2: 80 e0 ldi r24, 0x00 ; 0 396d4: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_printf_P(PSTR("%d/9"),mesh_point+1); 396d8: 8a 81 ldd r24, Y+2 ; 0x02 396da: 8f 93 push r24 396dc: 99 81 ldd r25, Y+1 ; 0x01 396de: 9f 93 push r25 396e0: 1f 93 push r17 396e2: 0f 93 push r16 396e4: 0e 94 39 6e call 0xdc72 ; 0xdc72 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 396e8: 43 e0 ldi r20, 0x03 ; 3 396ea: 60 e0 ldi r22, 0x00 ; 0 396ec: 70 e0 ldi r23, 0x00 ; 0 396ee: 80 e2 ldi r24, 0x20 ; 32 396f0: 91 ec ldi r25, 0xC1 ; 193 396f2: 0f 94 8f 8c call 0x3191e ; 0x3191e 396f6: 58 2e mov r5, r24 396f8: 0f 90 pop r0 396fa: 0f 90 pop r0 396fc: 0f 90 pop r0 396fe: 0f 90 pop r0 39700: 88 23 and r24, r24 39702: 09 f4 brne .+2 ; 0x39706 39704: 77 cf rjmp .-274 ; 0x395f4 39706: a7 9c mul r10, r7 39708: f0 01 movw r30, r0 3970a: 11 24 eor r1, r1 3970c: e8 0d add r30, r8 3970e: f1 1d adc r31, r1 39710: ee 0f add r30, r30 39712: ff 1f adc r31, r31 39714: ee 0f add r30, r30 39716: ff 1f adc r31, r31 39718: ee 53 subi r30, 0x3E ; 62 3971a: fc 4e sbci r31, 0xEC ; 236 3971c: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 39720: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 39724: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 39728: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 3972c: 81 83 std Z+1, r24 ; 0x01 3972e: 92 83 std Z+2, r25 ; 0x02 39730: a3 83 std Z+3, r26 ; 0x03 39732: b4 83 std Z+4, r27 ; 0x04 39734: e9 81 ldd r30, Y+1 ; 0x01 39736: fa 81 ldd r31, Y+2 ; 0x02 39738: 31 96 adiw r30, 0x01 ; 1 3973a: fa 83 std Y+2, r31 ; 0x02 3973c: 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) { 3973e: 3a 97 sbiw r30, 0x0a ; 10 39740: 09 f0 breq .+2 ; 0x39744 39742: 80 cf rjmp .-256 ; 0x39644 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 39744: 60 90 c3 13 lds r6, 0x13C3 ; 0x8013c3 39748: 70 90 c4 13 lds r7, 0x13C4 ; 0x8013c4 3974c: 80 90 c5 13 lds r8, 0x13C5 ; 0x8013c5 39750: 90 90 c6 13 lds r9, 0x13C6 ; 0x8013c6 float zmax = zmin; 39754: 46 2c mov r4, r6 39756: a7 2c mov r10, r7 39758: b8 2c mov r11, r8 3975a: 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]; 3975c: 1e 82 std Y+6, r1 ; 0x06 3975e: 1d 82 std Y+5, r1 ; 0x05 39760: 02 ec ldi r16, 0xC2 ; 194 39762: 13 e1 ldi r17, 0x13 ; 19 39764: 8d 81 ldd r24, Y+5 ; 0x05 39766: 9e 81 ldd r25, Y+6 ; 0x06 39768: 8d 53 subi r24, 0x3D ; 61 3976a: 9c 4e sbci r25, 0xEC ; 236 3976c: 9a 83 std Y+2, r25 ; 0x02 3976e: 89 83 std Y+1, r24 ; 0x01 39770: 93 e0 ldi r25, 0x03 ; 3 39772: 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]); 39774: e9 81 ldd r30, Y+1 ; 0x01 39776: fa 81 ldd r31, Y+2 ; 0x02 39778: c1 90 ld r12, Z+ 3977a: d1 90 ld r13, Z+ 3977c: e1 90 ld r14, Z+ 3977e: f1 90 ld r15, Z+ 39780: fa 83 std Y+2, r31 ; 0x02 39782: e9 83 std Y+1, r30 ; 0x01 39784: 93 01 movw r18, r6 39786: a4 01 movw r20, r8 39788: c7 01 movw r24, r14 3978a: b6 01 movw r22, r12 3978c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 39790: 18 16 cp r1, r24 39792: 14 f0 brlt .+4 ; 0x39798 39794: 36 01 movw r6, r12 39796: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 39798: 24 2d mov r18, r4 3979a: 3a 2d mov r19, r10 3979c: 4b 2d mov r20, r11 3979e: 52 2d mov r21, r2 397a0: c7 01 movw r24, r14 397a2: b6 01 movw r22, r12 397a4: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 397a8: 87 fd sbrc r24, 7 397aa: 04 c0 rjmp .+8 ; 0x397b4 397ac: 4c 2c mov r4, r12 397ae: ad 2c mov r10, r13 397b0: be 2c mov r11, r14 397b2: 2f 2c mov r2, r15 397b4: 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) { 397b6: 31 10 cpse r3, r1 397b8: dd cf rjmp .-70 ; 0x39774 397ba: 8d 81 ldd r24, Y+5 ; 0x05 397bc: 9e 81 ldd r25, Y+6 ; 0x06 397be: 4c 96 adiw r24, 0x1c ; 28 397c0: 9e 83 std Y+6, r25 ; 0x06 397c2: 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) 397c4: 84 35 cpi r24, 0x54 ; 84 397c6: 91 05 cpc r25, r1 397c8: 59 f6 brne .-106 ; 0x39760 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) { 397ca: 93 01 movw r18, r6 397cc: a4 01 movw r20, r8 397ce: 64 2d mov r22, r4 397d0: 7a 2d mov r23, r10 397d2: 8b 2d mov r24, r11 397d4: 92 2d mov r25, r2 397d6: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 397da: 20 e0 ldi r18, 0x00 ; 0 397dc: 30 e0 ldi r19, 0x00 ; 0 397de: 40 e4 ldi r20, 0x40 ; 64 397e0: 50 e4 ldi r21, 0x40 ; 64 397e2: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 397e6: 18 16 cp r1, r24 397e8: 3c f5 brge .+78 ; 0x39838 // 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!"); 397ea: 83 ee ldi r24, 0xE3 ; 227 397ec: 9a ea ldi r25, 0xAA ; 170 397ee: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 // 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; 397f2: 51 2c mov r5, r1 397f4: fc 81 ldd r31, Y+4 ; 0x04 397f6: f0 93 b7 02 sts 0x02B7, r31 ; 0x8002b7 <_ZL14check_endstops.lto_priv.404> go_home_with_z_lift(); result = true; end: enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 397fa: 8b 81 ldd r24, Y+3 ; 0x03 397fc: 0f 94 e7 4e call 0x29dce ; 0x29dce #ifdef TMC2130 tmc2130_home_exit(); 39800: 0f 94 ae 26 call 0x24d5c ; 0x24d5c #endif return result; } 39804: 85 2d mov r24, r5 39806: 26 96 adiw r28, 0x06 ; 6 39808: 0f b6 in r0, 0x3f ; 63 3980a: f8 94 cli 3980c: de bf out 0x3e, r29 ; 62 3980e: 0f be out 0x3f, r0 ; 63 39810: cd bf out 0x3d, r28 ; 61 39812: df 91 pop r29 39814: cf 91 pop r28 39816: 1f 91 pop r17 39818: 0f 91 pop r16 3981a: ff 90 pop r15 3981c: ef 90 pop r14 3981e: df 90 pop r13 39820: cf 90 pop r12 39822: bf 90 pop r11 39824: af 90 pop r10 39826: 9f 90 pop r9 39828: 8f 90 pop r8 3982a: 7f 90 pop r7 3982c: 6f 90 pop r6 3982e: 5f 90 pop r5 39830: 4f 90 pop r4 39832: 3f 90 pop r3 39834: 2f 90 pop r2 39836: 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) 39838: 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; 3983a: 85 ec ldi r24, 0xC5 ; 197 3983c: e8 2e mov r14, r24 3983e: 8f e0 ldi r24, 0x0F ; 15 39840: f8 2e mov r15, r24 39842: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 39844: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 39846: 9d 81 ldd r25, Y+5 ; 0x05 39848: 91 11 cpse r25, r1 3984a: 03 c0 rjmp .+6 ; 0x39852 3984c: e9 81 ldd r30, Y+1 ; 0x01 3984e: ee 23 and r30, r30 39850: 29 f1 breq .+74 ; 0x3989c continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 39852: 20 91 c3 13 lds r18, 0x13C3 ; 0x8013c3 39856: 30 91 c4 13 lds r19, 0x13C4 ; 0x8013c4 3985a: 40 91 c5 13 lds r20, 0x13C5 ; 0x8013c5 3985e: 50 91 c6 13 lds r21, 0x13C6 ; 0x8013c6 39862: f6 01 movw r30, r12 39864: 61 81 ldd r22, Z+1 ; 0x01 39866: 72 81 ldd r23, Z+2 ; 0x02 39868: 83 81 ldd r24, Z+3 ; 0x03 3986a: 94 81 ldd r25, Z+4 ; 0x04 3986c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 39870: 20 e0 ldi r18, 0x00 ; 0 39872: 30 e0 ldi r19, 0x00 ; 0 39874: 48 ec ldi r20, 0xC8 ; 200 39876: 52 e4 ldi r21, 0x42 ; 66 39878: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3987c: 20 e0 ldi r18, 0x00 ; 0 3987e: 30 e0 ldi r19, 0x00 ; 0 39880: 40 e0 ldi r20, 0x00 ; 0 39882: 5f e3 ldi r21, 0x3F ; 63 39884: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 39888: 0f 94 23 df call 0x3be46 ; 0x3be46 3988c: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 39890: c7 01 movw r24, r14 39892: 0f 94 96 dc call 0x3b92c ; 0x3b92c SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 39896: f2 e0 ldi r31, 0x02 ; 2 39898: ef 0e add r14, r31 3989a: f1 1c adc r15, r1 3989c: 84 e0 ldi r24, 0x04 ; 4 3989e: c8 0e add r12, r24 398a0: d1 1c adc r13, r1 398a2: 9d 81 ldd r25, Y+5 ; 0x05 398a4: 9f 5f subi r25, 0xFF ; 255 398a6: 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) { 398a8: 93 30 cpi r25, 0x03 ; 3 398aa: 69 f6 brne .-102 ; 0x39846 398ac: 04 5e subi r16, 0xE4 ; 228 398ae: 1f 4f sbci r17, 0xFF ; 255 398b0: e9 81 ldd r30, Y+1 ; 0x01 398b2: ef 5f subi r30, 0xFF ; 255 398b4: 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) 398b6: e3 30 cpi r30, 0x03 ; 3 398b8: 21 f6 brne .-120 ; 0x39842 #endif addr += 2; } } mbl.reset(); 398ba: 0f 94 85 8c call 0x3190a ; 0x3190a go_home_with_z_lift(); 398be: 0f 94 2e ca call 0x3945c ; 0x3945c 398c2: 98 cf rjmp .-208 ; 0x397f4 000398c4 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 398c4: 82 e0 ldi r24, 0x02 ; 2 398c6: 0f 94 d9 43 call 0x287b2 ; 0x287b2 398ca: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 398ce: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 398d2: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 398d6: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_z_position(current_position[Z_AXIS]); 398da: 8a e9 ldi r24, 0x9A ; 154 398dc: 96 e0 ldi r25, 0x06 ; 6 398de: 0d 94 2c 65 jmp 0x2ca58 ; 0x2ca58 000398e2 : * 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() { 398e2: 4f 92 push r4 398e4: 5f 92 push r5 398e6: 6f 92 push r6 398e8: 7f 92 push r7 398ea: 8f 92 push r8 398ec: 9f 92 push r9 398ee: af 92 push r10 398f0: bf 92 push r11 398f2: cf 92 push r12 398f4: df 92 push r13 398f6: ef 92 push r14 398f8: ff 92 push r15 398fa: 0f 93 push r16 398fc: 1f 93 push r17 398fe: cf 93 push r28 39900: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 39902: 02 e9 ldi r16, 0x92 ; 146 39904: 16 e0 ldi r17, 0x06 ; 6 39906: c7 e0 ldi r28, 0x07 ; 7 39908: d8 e1 ldi r29, 0x18 ; 24 3990a: 28 81 ld r18, Y 3990c: 39 81 ldd r19, Y+1 ; 0x01 3990e: 4a 81 ldd r20, Y+2 ; 0x02 39910: 5b 81 ldd r21, Y+3 ; 0x03 39912: f8 01 movw r30, r16 39914: 60 81 ld r22, Z 39916: 71 81 ldd r23, Z+1 ; 0x01 39918: 82 81 ldd r24, Z+2 ; 0x02 3991a: 93 81 ldd r25, Z+3 ; 0x03 3991c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 39920: 4b 01 movw r8, r22 39922: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 39924: 2c 81 ldd r18, Y+4 ; 0x04 39926: 3d 81 ldd r19, Y+5 ; 0x05 39928: 4e 81 ldd r20, Y+6 ; 0x06 3992a: 5f 81 ldd r21, Y+7 ; 0x07 3992c: f8 01 movw r30, r16 3992e: 64 81 ldd r22, Z+4 ; 0x04 39930: 75 81 ldd r23, Z+5 ; 0x05 39932: 86 81 ldd r24, Z+6 ; 0x06 39934: 97 81 ldd r25, Z+7 ; 0x07 39936: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3993a: 6b 01 movw r12, r22 3993c: 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; 3993e: c7 ef ldi r28, 0xF7 ; 247 39940: d7 e1 ldi r29, 0x17 ; 23 39942: 28 81 ld r18, Y 39944: 39 81 ldd r19, Y+1 ; 0x01 39946: 4a 81 ldd r20, Y+2 ; 0x02 39948: 5b 81 ldd r21, Y+3 ; 0x03 3994a: c5 01 movw r24, r10 3994c: b4 01 movw r22, r8 3994e: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 39952: 2b 01 movw r4, r22 39954: 3c 01 movw r6, r24 39956: 2c 81 ldd r18, Y+4 ; 0x04 39958: 3d 81 ldd r19, Y+5 ; 0x05 3995a: 4e 81 ldd r20, Y+6 ; 0x06 3995c: 5f 81 ldd r21, Y+7 ; 0x07 3995e: c7 01 movw r24, r14 39960: b6 01 movw r22, r12 39962: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 39966: 9b 01 movw r18, r22 39968: ac 01 movw r20, r24 3996a: c3 01 movw r24, r6 3996c: b2 01 movw r22, r4 3996e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 39972: f8 01 movw r30, r16 39974: 60 83 st Z, r22 39976: 71 83 std Z+1, r23 ; 0x01 39978: 82 83 std Z+2, r24 ; 0x02 3997a: 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; 3997c: 28 85 ldd r18, Y+8 ; 0x08 3997e: 39 85 ldd r19, Y+9 ; 0x09 39980: 4a 85 ldd r20, Y+10 ; 0x0a 39982: 5b 85 ldd r21, Y+11 ; 0x0b 39984: c5 01 movw r24, r10 39986: b4 01 movw r22, r8 39988: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3998c: 4b 01 movw r8, r22 3998e: 5c 01 movw r10, r24 39990: 2c 85 ldd r18, Y+12 ; 0x0c 39992: 3d 85 ldd r19, Y+13 ; 0x0d 39994: 4e 85 ldd r20, Y+14 ; 0x0e 39996: 5f 85 ldd r21, Y+15 ; 0x0f 39998: c7 01 movw r24, r14 3999a: b6 01 movw r22, r12 3999c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 399a0: 9b 01 movw r18, r22 399a2: ac 01 movw r20, r24 399a4: c5 01 movw r24, r10 399a6: b4 01 movw r22, r8 399a8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 399ac: f8 01 movw r30, r16 399ae: 64 83 std Z+4, r22 ; 0x04 399b0: 75 83 std Z+5, r23 ; 0x05 399b2: 86 83 std Z+6, r24 ; 0x06 399b4: 97 83 std Z+7, r25 ; 0x07 } 399b6: df 91 pop r29 399b8: cf 91 pop r28 399ba: 1f 91 pop r17 399bc: 0f 91 pop r16 399be: ff 90 pop r15 399c0: ef 90 pop r14 399c2: df 90 pop r13 399c4: cf 90 pop r12 399c6: bf 90 pop r11 399c8: af 90 pop r10 399ca: 9f 90 pop r9 399cc: 8f 90 pop r8 399ce: 7f 90 pop r7 399d0: 6f 90 pop r6 399d2: 5f 90 pop r5 399d4: 4f 90 pop r4 399d6: 08 95 ret 000399d8 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 399d8: 4f 92 push r4 399da: 5f 92 push r5 399dc: 6f 92 push r6 399de: 7f 92 push r7 399e0: 8f 92 push r8 399e2: 9f 92 push r9 399e4: af 92 push r10 399e6: bf 92 push r11 399e8: cf 92 push r12 399ea: df 92 push r13 399ec: ef 92 push r14 399ee: ff 92 push r15 399f0: 0f 93 push r16 399f2: 1f 93 push r17 399f4: cf 93 push r28 399f6: df 93 push r29 399f8: 00 d0 rcall .+0 ; 0x399fa 399fa: 00 d0 rcall .+0 ; 0x399fc 399fc: 1f 92 push r1 399fe: 1f 92 push r1 39a00: cd b7 in r28, 0x3d ; 61 39a02: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 39a04: dc 01 movw r26, r24 39a06: cd 90 ld r12, X+ 39a08: dd 90 ld r13, X+ 39a0a: ed 90 ld r14, X+ 39a0c: fc 90 ld r15, X 39a0e: 13 97 sbiw r26, 0x03 ; 3 39a10: c0 92 dc 17 sts 0x17DC, r12 ; 0x8017dc 39a14: d0 92 dd 17 sts 0x17DD, r13 ; 0x8017dd 39a18: e0 92 de 17 sts 0x17DE, r14 ; 0x8017de 39a1c: f0 92 df 17 sts 0x17DF, r15 ; 0x8017df world2machine_rotation_and_skew[1][0] = vec_x[1]; 39a20: 14 96 adiw r26, 0x04 ; 4 39a22: 0d 91 ld r16, X+ 39a24: 1d 91 ld r17, X+ 39a26: 2d 91 ld r18, X+ 39a28: 3c 91 ld r19, X 39a2a: 17 97 sbiw r26, 0x07 ; 7 39a2c: 09 83 std Y+1, r16 ; 0x01 39a2e: 1a 83 std Y+2, r17 ; 0x02 39a30: 2b 83 std Y+3, r18 ; 0x03 39a32: 3c 83 std Y+4, r19 ; 0x04 39a34: 00 93 e4 17 sts 0x17E4, r16 ; 0x8017e4 39a38: 10 93 e5 17 sts 0x17E5, r17 ; 0x8017e5 39a3c: 20 93 e6 17 sts 0x17E6, r18 ; 0x8017e6 39a40: 30 93 e7 17 sts 0x17E7, r19 ; 0x8017e7 world2machine_rotation_and_skew[0][1] = vec_y[0]; 39a44: db 01 movw r26, r22 39a46: 0d 91 ld r16, X+ 39a48: 1d 91 ld r17, X+ 39a4a: 2d 91 ld r18, X+ 39a4c: 3c 91 ld r19, X 39a4e: 13 97 sbiw r26, 0x03 ; 3 39a50: 0d 83 std Y+5, r16 ; 0x05 39a52: 1e 83 std Y+6, r17 ; 0x06 39a54: 2f 83 std Y+7, r18 ; 0x07 39a56: 38 87 std Y+8, r19 ; 0x08 39a58: 00 93 e0 17 sts 0x17E0, r16 ; 0x8017e0 39a5c: 10 93 e1 17 sts 0x17E1, r17 ; 0x8017e1 39a60: 20 93 e2 17 sts 0x17E2, r18 ; 0x8017e2 39a64: 30 93 e3 17 sts 0x17E3, r19 ; 0x8017e3 world2machine_rotation_and_skew[1][1] = vec_y[1]; 39a68: 14 96 adiw r26, 0x04 ; 4 39a6a: 4d 90 ld r4, X+ 39a6c: 5d 90 ld r5, X+ 39a6e: 6d 90 ld r6, X+ 39a70: 7c 90 ld r7, X 39a72: 17 97 sbiw r26, 0x07 ; 7 39a74: 40 92 e8 17 sts 0x17E8, r4 ; 0x8017e8 39a78: 50 92 e9 17 sts 0x17E9, r5 ; 0x8017e9 39a7c: 60 92 ea 17 sts 0x17EA, r6 ; 0x8017ea 39a80: 70 92 eb 17 sts 0x17EB, r7 ; 0x8017eb world2machine_shift[0] = cntr[0]; 39a84: fa 01 movw r30, r20 39a86: 60 81 ld r22, Z 39a88: 71 81 ldd r23, Z+1 ; 0x01 39a8a: 82 81 ldd r24, Z+2 ; 0x02 39a8c: 93 81 ldd r25, Z+3 ; 0x03 39a8e: 60 93 07 18 sts 0x1807, r22 ; 0x801807 39a92: 70 93 08 18 sts 0x1808, r23 ; 0x801808 39a96: 80 93 09 18 sts 0x1809, r24 ; 0x801809 39a9a: 90 93 0a 18 sts 0x180A, r25 ; 0x80180a world2machine_shift[1] = cntr[1]; 39a9e: 84 80 ldd r8, Z+4 ; 0x04 39aa0: 95 80 ldd r9, Z+5 ; 0x05 39aa2: a6 80 ldd r10, Z+6 ; 0x06 39aa4: b7 80 ldd r11, Z+7 ; 0x07 39aa6: 80 92 0b 18 sts 0x180B, r8 ; 0x80180b 39aaa: 90 92 0c 18 sts 0x180C, r9 ; 0x80180c 39aae: a0 92 0d 18 sts 0x180D, r10 ; 0x80180d 39ab2: b0 92 0e 18 sts 0x180E, r11 ; 0x80180e // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 39ab6: 20 e0 ldi r18, 0x00 ; 0 39ab8: 30 e0 ldi r19, 0x00 ; 0 39aba: a9 01 movw r20, r18 39abc: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 39ac0: 81 11 cpse r24, r1 39ac2: aa c0 rjmp .+340 ; 0x39c18 39ac4: 20 e0 ldi r18, 0x00 ; 0 39ac6: 30 e0 ldi r19, 0x00 ; 0 39ac8: a9 01 movw r20, r18 39aca: c5 01 movw r24, r10 39acc: b4 01 movw r22, r8 39ace: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 39ad2: 81 11 cpse r24, r1 39ad4: a1 c0 rjmp .+322 ; 0x39c18 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; 39ad6: 10 92 0f 18 sts 0x180F, r1 ; 0x80180f 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 || 39ada: 20 e0 ldi r18, 0x00 ; 0 39adc: 30 e0 ldi r19, 0x00 ; 0 39ade: 40 e8 ldi r20, 0x80 ; 128 39ae0: 5f e3 ldi r21, 0x3F ; 63 39ae2: c7 01 movw r24, r14 39ae4: b6 01 movw r22, r12 39ae6: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 39aea: 81 11 cpse r24, r1 39aec: 21 c0 rjmp .+66 ; 0x39b30 39aee: 20 e0 ldi r18, 0x00 ; 0 39af0: 30 e0 ldi r19, 0x00 ; 0 39af2: a9 01 movw r20, r18 39af4: 6d 81 ldd r22, Y+5 ; 0x05 39af6: 7e 81 ldd r23, Y+6 ; 0x06 39af8: 8f 81 ldd r24, Y+7 ; 0x07 39afa: 98 85 ldd r25, Y+8 ; 0x08 39afc: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 39b00: 81 11 cpse r24, r1 39b02: 16 c0 rjmp .+44 ; 0x39b30 39b04: 20 e0 ldi r18, 0x00 ; 0 39b06: 30 e0 ldi r19, 0x00 ; 0 39b08: a9 01 movw r20, r18 39b0a: 69 81 ldd r22, Y+1 ; 0x01 39b0c: 7a 81 ldd r23, Y+2 ; 0x02 39b0e: 8b 81 ldd r24, Y+3 ; 0x03 39b10: 9c 81 ldd r25, Y+4 ; 0x04 39b12: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 39b16: 81 11 cpse r24, r1 39b18: 0b c0 rjmp .+22 ; 0x39b30 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 39b1a: 20 e0 ldi r18, 0x00 ; 0 39b1c: 30 e0 ldi r19, 0x00 ; 0 39b1e: 40 e8 ldi r20, 0x80 ; 128 39b20: 5f e3 ldi r21, 0x3F ; 63 39b22: c3 01 movw r24, r6 39b24: b2 01 movw r22, r4 39b26: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 39b2a: 88 23 and r24, r24 39b2c: 09 f4 brne .+2 ; 0x39b30 39b2e: 78 c0 rjmp .+240 ; 0x39c20 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 39b30: 80 91 0f 18 lds r24, 0x180F ; 0x80180f 39b34: 82 60 ori r24, 0x02 ; 2 39b36: 80 93 0f 18 sts 0x180F, r24 ; 0x80180f // 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]; 39b3a: a3 01 movw r20, r6 39b3c: 92 01 movw r18, r4 39b3e: c7 01 movw r24, r14 39b40: b6 01 movw r22, r12 39b42: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 39b46: 4b 01 movw r8, r22 39b48: 5c 01 movw r10, r24 39b4a: 2d 81 ldd r18, Y+5 ; 0x05 39b4c: 3e 81 ldd r19, Y+6 ; 0x06 39b4e: 4f 81 ldd r20, Y+7 ; 0x07 39b50: 58 85 ldd r21, Y+8 ; 0x08 39b52: 69 81 ldd r22, Y+1 ; 0x01 39b54: 7a 81 ldd r23, Y+2 ; 0x02 39b56: 8b 81 ldd r24, Y+3 ; 0x03 39b58: 9c 81 ldd r25, Y+4 ; 0x04 39b5a: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 39b5e: 9b 01 movw r18, r22 39b60: ac 01 movw r20, r24 39b62: c5 01 movw r24, r10 39b64: b4 01 movw r22, r8 39b66: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 39b6a: 4b 01 movw r8, r22 39b6c: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 39b6e: ac 01 movw r20, r24 39b70: 9b 01 movw r18, r22 39b72: c3 01 movw r24, r6 39b74: b2 01 movw r22, r4 39b76: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 39b7a: 60 93 f7 17 sts 0x17F7, r22 ; 0x8017f7 39b7e: 70 93 f8 17 sts 0x17F8, r23 ; 0x8017f8 39b82: 80 93 f9 17 sts 0x17F9, r24 ; 0x8017f9 39b86: 90 93 fa 17 sts 0x17FA, r25 ; 0x8017fa world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 39b8a: 6d 81 ldd r22, Y+5 ; 0x05 39b8c: 7e 81 ldd r23, Y+6 ; 0x06 39b8e: 8f 81 ldd r24, Y+7 ; 0x07 39b90: 98 85 ldd r25, Y+8 ; 0x08 39b92: 90 58 subi r25, 0x80 ; 128 39b94: a5 01 movw r20, r10 39b96: 94 01 movw r18, r8 39b98: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 39b9c: 60 93 fb 17 sts 0x17FB, r22 ; 0x8017fb 39ba0: 70 93 fc 17 sts 0x17FC, r23 ; 0x8017fc 39ba4: 80 93 fd 17 sts 0x17FD, r24 ; 0x8017fd 39ba8: 90 93 fe 17 sts 0x17FE, r25 ; 0x8017fe world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 39bac: 69 81 ldd r22, Y+1 ; 0x01 39bae: 7a 81 ldd r23, Y+2 ; 0x02 39bb0: 8b 81 ldd r24, Y+3 ; 0x03 39bb2: 9c 81 ldd r25, Y+4 ; 0x04 39bb4: 90 58 subi r25, 0x80 ; 128 39bb6: a5 01 movw r20, r10 39bb8: 94 01 movw r18, r8 39bba: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 39bbe: 60 93 ff 17 sts 0x17FF, r22 ; 0x8017ff 39bc2: 70 93 00 18 sts 0x1800, r23 ; 0x801800 39bc6: 80 93 01 18 sts 0x1801, r24 ; 0x801801 39bca: 90 93 02 18 sts 0x1802, r25 ; 0x801802 world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 39bce: a5 01 movw r20, r10 39bd0: 94 01 movw r18, r8 39bd2: c7 01 movw r24, r14 39bd4: b6 01 movw r22, r12 39bd6: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__divsf3> 39bda: 60 93 03 18 sts 0x1803, r22 ; 0x801803 39bde: 70 93 04 18 sts 0x1804, r23 ; 0x801804 39be2: 80 93 05 18 sts 0x1805, r24 ; 0x801805 39be6: 90 93 06 18 sts 0x1806, r25 ; 0x801806 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; } } 39bea: 28 96 adiw r28, 0x08 ; 8 39bec: 0f b6 in r0, 0x3f ; 63 39bee: f8 94 cli 39bf0: de bf out 0x3e, r29 ; 62 39bf2: 0f be out 0x3f, r0 ; 63 39bf4: cd bf out 0x3d, r28 ; 61 39bf6: df 91 pop r29 39bf8: cf 91 pop r28 39bfa: 1f 91 pop r17 39bfc: 0f 91 pop r16 39bfe: ff 90 pop r15 39c00: ef 90 pop r14 39c02: df 90 pop r13 39c04: cf 90 pop r12 39c06: bf 90 pop r11 39c08: af 90 pop r10 39c0a: 9f 90 pop r9 39c0c: 8f 90 pop r8 39c0e: 7f 90 pop r7 39c10: 6f 90 pop r6 39c12: 5f 90 pop r5 39c14: 4f 90 pop r4 39c16: 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; 39c18: 81 e0 ldi r24, 0x01 ; 1 39c1a: 80 93 0f 18 sts 0x180F, r24 ; 0x80180f 39c1e: 5d cf rjmp .-326 ; 0x39ada 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; 39c20: 80 e0 ldi r24, 0x00 ; 0 39c22: 90 e0 ldi r25, 0x00 ; 0 39c24: a0 e8 ldi r26, 0x80 ; 128 39c26: bf e3 ldi r27, 0x3F ; 63 39c28: 80 93 f7 17 sts 0x17F7, r24 ; 0x8017f7 39c2c: 90 93 f8 17 sts 0x17F8, r25 ; 0x8017f8 39c30: a0 93 f9 17 sts 0x17F9, r26 ; 0x8017f9 39c34: b0 93 fa 17 sts 0x17FA, r27 ; 0x8017fa world2machine_rotation_and_skew_inv[0][1] = 0.f; 39c38: 10 92 fb 17 sts 0x17FB, r1 ; 0x8017fb 39c3c: 10 92 fc 17 sts 0x17FC, r1 ; 0x8017fc 39c40: 10 92 fd 17 sts 0x17FD, r1 ; 0x8017fd 39c44: 10 92 fe 17 sts 0x17FE, r1 ; 0x8017fe world2machine_rotation_and_skew_inv[1][0] = 0.f; 39c48: 10 92 ff 17 sts 0x17FF, r1 ; 0x8017ff 39c4c: 10 92 00 18 sts 0x1800, r1 ; 0x801800 39c50: 10 92 01 18 sts 0x1801, r1 ; 0x801801 39c54: 10 92 02 18 sts 0x1802, r1 ; 0x801802 world2machine_rotation_and_skew_inv[1][1] = 1.f; 39c58: 80 93 03 18 sts 0x1803, r24 ; 0x801803 39c5c: 90 93 04 18 sts 0x1804, r25 ; 0x801804 39c60: a0 93 05 18 sts 0x1805, r26 ; 0x801805 39c64: b0 93 06 18 sts 0x1806, r27 ; 0x801806 39c68: c0 cf rjmp .-128 ; 0x39bea 00039c6a : * * 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() { 39c6a: cf 93 push r28 39c6c: df 93 push r29 39c6e: cd b7 in r28, 0x3d ; 61 39c70: de b7 in r29, 0x3e ; 62 39c72: 68 97 sbiw r28, 0x18 ; 24 39c74: 0f b6 in r0, 0x3f ; 63 39c76: f8 94 cli 39c78: de bf out 0x3e, r29 ; 62 39c7a: 0f be out 0x3f, r0 ; 63 39c7c: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 39c7e: 80 e0 ldi r24, 0x00 ; 0 39c80: 90 e0 ldi r25, 0x00 ; 0 39c82: a0 e8 ldi r26, 0x80 ; 128 39c84: bf e3 ldi r27, 0x3F ; 63 39c86: 89 83 std Y+1, r24 ; 0x01 39c88: 9a 83 std Y+2, r25 ; 0x02 39c8a: ab 83 std Y+3, r26 ; 0x03 39c8c: bc 83 std Y+4, r27 ; 0x04 39c8e: 1d 82 std Y+5, r1 ; 0x05 39c90: 1e 82 std Y+6, r1 ; 0x06 39c92: 1f 82 std Y+7, r1 ; 0x07 39c94: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 39c96: 19 86 std Y+9, r1 ; 0x09 39c98: 1a 86 std Y+10, r1 ; 0x0a 39c9a: 1b 86 std Y+11, r1 ; 0x0b 39c9c: 1c 86 std Y+12, r1 ; 0x0c 39c9e: 8d 87 std Y+13, r24 ; 0x0d 39ca0: 9e 87 std Y+14, r25 ; 0x0e 39ca2: af 87 std Y+15, r26 ; 0x0f 39ca4: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 39ca6: 19 8a std Y+17, r1 ; 0x11 39ca8: 1a 8a std Y+18, r1 ; 0x12 39caa: 1b 8a std Y+19, r1 ; 0x13 39cac: 1c 8a std Y+20, r1 ; 0x14 39cae: 1d 8a std Y+21, r1 ; 0x15 39cb0: 1e 8a std Y+22, r1 ; 0x16 39cb2: 1f 8a std Y+23, r1 ; 0x17 39cb4: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 39cb6: ae 01 movw r20, r28 39cb8: 4f 5e subi r20, 0xEF ; 239 39cba: 5f 4f sbci r21, 0xFF ; 255 39cbc: be 01 movw r22, r28 39cbe: 67 5f subi r22, 0xF7 ; 247 39cc0: 7f 4f sbci r23, 0xFF ; 255 39cc2: ce 01 movw r24, r28 39cc4: 01 96 adiw r24, 0x01 ; 1 39cc6: 0f 94 ec cc call 0x399d8 ; 0x399d8 } 39cca: 68 96 adiw r28, 0x18 ; 24 39ccc: 0f b6 in r0, 0x3f ; 63 39cce: f8 94 cli 39cd0: de bf out 0x3e, r29 ; 62 39cd2: 0f be out 0x3f, r0 ; 63 39cd4: cd bf out 0x3d, r28 ; 61 39cd6: df 91 pop r29 39cd8: cf 91 pop r28 39cda: 08 95 ret 00039cdc : * * 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) { 39cdc: 80 91 0f 18 lds r24, 0x180F ; 0x80180f 39ce0: 88 23 and r24, r24 39ce2: d1 f0 breq .+52 ; 0x39d18 world2machine_reset(); 39ce4: 0f 94 35 ce call 0x39c6a ; 0x39c6a st_synchronize(); 39ce8: 0f 94 ed 43 call 0x287da ; 0x287da current_position[X_AXIS] = st_get_position_mm(X_AXIS); 39cec: 80 e0 ldi r24, 0x00 ; 0 39cee: 0f 94 d9 43 call 0x287b2 ; 0x287b2 39cf2: 60 93 92 06 sts 0x0692, r22 ; 0x800692 39cf6: 70 93 93 06 sts 0x0693, r23 ; 0x800693 39cfa: 80 93 94 06 sts 0x0694, r24 ; 0x800694 39cfe: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 39d02: 81 e0 ldi r24, 0x01 ; 1 39d04: 0f 94 d9 43 call 0x287b2 ; 0x287b2 39d08: 60 93 96 06 sts 0x0696, r22 ; 0x800696 39d0c: 70 93 97 06 sts 0x0697, r23 ; 0x800697 39d10: 80 93 98 06 sts 0x0698, r24 ; 0x800698 39d14: 90 93 99 06 sts 0x0699, r25 ; 0x800699 } } 39d18: 08 95 ret 00039d1a : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 39d1a: 4f ef ldi r20, 0xFF ; 255 39d1c: 5f ef ldi r21, 0xFF ; 255 39d1e: ba 01 movw r22, r20 39d20: 85 ee ldi r24, 0xE5 ; 229 39d22: 9f e0 ldi r25, 0x0F ; 15 39d24: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d28: 4f ef ldi r20, 0xFF ; 255 39d2a: 5f ef ldi r21, 0xFF ; 255 39d2c: ba 01 movw r22, r20 39d2e: 89 ee ldi r24, 0xE9 ; 233 39d30: 9f e0 ldi r25, 0x0F ; 15 39d32: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d36: 4f ef ldi r20, 0xFF ; 255 39d38: 5f ef ldi r21, 0xFF ; 255 39d3a: ba 01 movw r22, r20 39d3c: 8d ed ldi r24, 0xDD ; 221 39d3e: 9f e0 ldi r25, 0x0F ; 15 39d40: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d44: 4f ef ldi r20, 0xFF ; 255 39d46: 5f ef ldi r21, 0xFF ; 255 39d48: ba 01 movw r22, r20 39d4a: 81 ee ldi r24, 0xE1 ; 225 39d4c: 9f e0 ldi r25, 0x0F ; 15 39d4e: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d52: 4f ef ldi r20, 0xFF ; 255 39d54: 5f ef ldi r21, 0xFF ; 255 39d56: ba 01 movw r22, r20 39d58: 85 ed ldi r24, 0xD5 ; 213 39d5a: 9f e0 ldi r25, 0x0F ; 15 39d5c: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d60: 4f ef ldi r20, 0xFF ; 255 39d62: 5f ef ldi r21, 0xFF ; 255 39d64: ba 01 movw r22, r20 39d66: 89 ed ldi r24, 0xD9 ; 217 39d68: 9f e0 ldi r25, 0x0F ; 15 39d6a: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d6e: 4f ef ldi r20, 0xFF ; 255 39d70: 5f ef ldi r21, 0xFF ; 255 39d72: ba 01 movw r22, r20 39d74: 85 ec ldi r24, 0xC5 ; 197 39d76: 9f e0 ldi r25, 0x0F ; 15 39d78: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d7c: 4f ef ldi r20, 0xFF ; 255 39d7e: 5f ef ldi r21, 0xFF ; 255 39d80: ba 01 movw r22, r20 39d82: 89 ec ldi r24, 0xC9 ; 201 39d84: 9f e0 ldi r25, 0x0F ; 15 39d86: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d8a: 4f ef ldi r20, 0xFF ; 255 39d8c: 5f ef ldi r21, 0xFF ; 255 39d8e: ba 01 movw r22, r20 39d90: 8d ec ldi r24, 0xCD ; 205 39d92: 9f e0 ldi r25, 0x0F ; 15 39d94: 0f 94 8a dc call 0x3b914 ; 0x3b914 39d98: 4f ef ldi r20, 0xFF ; 255 39d9a: 5f ef ldi r21, 0xFF ; 255 39d9c: ba 01 movw r22, r20 39d9e: 81 ed ldi r24, 0xD1 ; 209 39da0: 9f e0 ldi r25, 0x0F ; 15 39da2: 0d 94 8a dc jmp 0x3b914 ; 0x3b914 00039da6 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 39da6: 4f 92 push r4 39da8: 5f 92 push r5 39daa: 6f 92 push r6 39dac: 7f 92 push r7 39dae: 8f 92 push r8 39db0: 9f 92 push r9 39db2: af 92 push r10 39db4: bf 92 push r11 39db6: cf 92 push r12 39db8: df 92 push r13 39dba: ef 92 push r14 39dbc: ff 92 push r15 39dbe: 1f 93 push r17 39dc0: cf 93 push r28 39dc2: df 93 push r29 39dc4: cd b7 in r28, 0x3d ; 61 39dc6: de b7 in r29, 0x3e ; 62 39dc8: a8 97 sbiw r28, 0x28 ; 40 39dca: 0f b6 in r0, 0x3f ; 63 39dcc: f8 94 cli 39dce: de bf out 0x3e, r29 ; 62 39dd0: 0f be out 0x3f, r0 ; 63 39dd2: 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); 39dd4: 48 e0 ldi r20, 0x08 ; 8 39dd6: 50 e0 ldi r21, 0x00 ; 0 39dd8: 6d ed ldi r22, 0xDD ; 221 39dda: 7f e0 ldi r23, 0x0F ; 15 39ddc: ce 01 movw r24, r28 39dde: 01 96 adiw r24, 0x01 ; 1 39de0: 0f 94 44 dc call 0x3b888 ; 0x3b888 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 39de4: 48 e0 ldi r20, 0x08 ; 8 39de6: 50 e0 ldi r21, 0x00 ; 0 39de8: 65 ed ldi r22, 0xD5 ; 213 39dea: 7f e0 ldi r23, 0x0F ; 15 39dec: ce 01 movw r24, r28 39dee: 09 96 adiw r24, 0x09 ; 9 39df0: 0f 94 44 dc call 0x3b888 ; 0x3b888 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 39df4: 48 e0 ldi r20, 0x08 ; 8 39df6: 50 e0 ldi r21, 0x00 ; 0 39df8: 65 ee ldi r22, 0xE5 ; 229 39dfa: 7f e0 ldi r23, 0x0F ; 15 39dfc: ce 01 movw r24, r28 39dfe: 41 96 adiw r24, 0x11 ; 17 39e00: 0f 94 44 dc call 0x3b888 ; 0x3b888 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 39e04: 89 89 ldd r24, Y+17 ; 0x11 39e06: 9a 89 ldd r25, Y+18 ; 0x12 39e08: ab 89 ldd r26, Y+19 ; 0x13 39e0a: bc 89 ldd r27, Y+20 ; 0x14 39e0c: 89 a3 std Y+33, r24 ; 0x21 39e0e: 9a a3 std Y+34, r25 ; 0x22 39e10: ab a3 std Y+35, r26 ; 0x23 39e12: bc a3 std Y+36, r27 ; 0x24 39e14: 8f 3f cpi r24, 0xFF ; 255 39e16: 9f 4f sbci r25, 0xFF ; 255 39e18: af 4f sbci r26, 0xFF ; 255 39e1a: bf 4f sbci r27, 0xFF ; 255 39e1c: 09 f4 brne .+2 ; 0x39e20 39e1e: b1 c0 rjmp .+354 ; 0x39f82 39e20: 8d 89 ldd r24, Y+21 ; 0x15 39e22: 9e 89 ldd r25, Y+22 ; 0x16 39e24: af 89 ldd r26, Y+23 ; 0x17 39e26: b8 8d ldd r27, Y+24 ; 0x18 39e28: 8d a3 std Y+37, r24 ; 0x25 39e2a: 9e a3 std Y+38, r25 ; 0x26 39e2c: af a3 std Y+39, r26 ; 0x27 39e2e: b8 a7 std Y+40, r27 ; 0x28 39e30: 8f 3f cpi r24, 0xFF ; 255 39e32: 9f 4f sbci r25, 0xFF ; 255 39e34: af 4f sbci r26, 0xFF ; 255 39e36: bf 4f sbci r27, 0xFF ; 255 39e38: 09 f4 brne .+2 ; 0x39e3c 39e3a: a3 c0 rjmp .+326 ; 0x39f82 39e3c: 89 80 ldd r8, Y+1 ; 0x01 39e3e: 9a 80 ldd r9, Y+2 ; 0x02 39e40: ab 80 ldd r10, Y+3 ; 0x03 39e42: bc 80 ldd r11, Y+4 ; 0x04 39e44: 8f ef ldi r24, 0xFF ; 255 39e46: 88 16 cp r8, r24 39e48: 98 06 cpc r9, r24 39e4a: a8 06 cpc r10, r24 39e4c: b8 06 cpc r11, r24 39e4e: 09 f4 brne .+2 ; 0x39e52 39e50: 98 c0 rjmp .+304 ; 0x39f82 39e52: 8d 81 ldd r24, Y+5 ; 0x05 39e54: 9e 81 ldd r25, Y+6 ; 0x06 39e56: af 81 ldd r26, Y+7 ; 0x07 39e58: b8 85 ldd r27, Y+8 ; 0x08 39e5a: 89 8f std Y+25, r24 ; 0x19 39e5c: 9a 8f std Y+26, r25 ; 0x1a 39e5e: ab 8f std Y+27, r26 ; 0x1b 39e60: bc 8f std Y+28, r27 ; 0x1c 39e62: 8f 3f cpi r24, 0xFF ; 255 39e64: 9f 4f sbci r25, 0xFF ; 255 39e66: af 4f sbci r26, 0xFF ; 255 39e68: bf 4f sbci r27, 0xFF ; 255 39e6a: 09 f4 brne .+2 ; 0x39e6e 39e6c: 8a c0 rjmp .+276 ; 0x39f82 39e6e: c9 84 ldd r12, Y+9 ; 0x09 39e70: da 84 ldd r13, Y+10 ; 0x0a 39e72: eb 84 ldd r14, Y+11 ; 0x0b 39e74: fc 84 ldd r15, Y+12 ; 0x0c 39e76: 8f ef ldi r24, 0xFF ; 255 39e78: c8 16 cp r12, r24 39e7a: d8 06 cpc r13, r24 39e7c: e8 06 cpc r14, r24 39e7e: f8 06 cpc r15, r24 39e80: 09 f4 brne .+2 ; 0x39e84 39e82: 7f c0 rjmp .+254 ; 0x39f82 39e84: 8d 85 ldd r24, Y+13 ; 0x0d 39e86: 9e 85 ldd r25, Y+14 ; 0x0e 39e88: af 85 ldd r26, Y+15 ; 0x0f 39e8a: b8 89 ldd r27, Y+16 ; 0x10 39e8c: 8d 8f std Y+29, r24 ; 0x1d 39e8e: 9e 8f std Y+30, r25 ; 0x1e 39e90: af 8f std Y+31, r26 ; 0x1f 39e92: b8 a3 std Y+32, r27 ; 0x20 39e94: 8f 3f cpi r24, 0xFF ; 255 39e96: 9f 4f sbci r25, 0xFF ; 255 39e98: af 4f sbci r26, 0xFF ; 255 39e9a: bf 4f sbci r27, 0xFF ; 255 39e9c: 09 f4 brne .+2 ; 0x39ea0 39e9e: 71 c0 rjmp .+226 ; 0x39f82 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 39ea0: 29 8d ldd r18, Y+25 ; 0x19 39ea2: 3a 8d ldd r19, Y+26 ; 0x1a 39ea4: 4b 8d ldd r20, Y+27 ; 0x1b 39ea6: 5c 8d ldd r21, Y+28 ; 0x1c 39ea8: c5 01 movw r24, r10 39eaa: b4 01 movw r22, r8 39eac: 0f 94 18 e0 call 0x3c030 ; 0x3c030 39eb0: 2b 01 movw r4, r22 39eb2: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39eb4: 26 e6 ldi r18, 0x66 ; 102 39eb6: 36 e6 ldi r19, 0x66 ; 102 39eb8: 46 e6 ldi r20, 0x66 ; 102 39eba: 5f e3 ldi r21, 0x3F ; 63 39ebc: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__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; 39ec0: 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) 39ec2: 87 fd sbrc r24, 7 39ec4: 0b c0 rjmp .+22 ; 0x39edc 39ec6: 2d ec ldi r18, 0xCD ; 205 39ec8: 3c ec ldi r19, 0xCC ; 204 39eca: 4c e8 ldi r20, 0x8C ; 140 39ecc: 5f e3 ldi r21, 0x3F ; 63 39ece: c3 01 movw r24, r6 39ed0: b2 01 movw r22, r4 39ed2: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 39ed6: 18 16 cp r1, r24 39ed8: 0c f0 brlt .+2 ; 0x39edc 39eda: 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]); 39edc: 2d 8d ldd r18, Y+29 ; 0x1d 39ede: 3e 8d ldd r19, Y+30 ; 0x1e 39ee0: 4f 8d ldd r20, Y+31 ; 0x1f 39ee2: 58 a1 ldd r21, Y+32 ; 0x20 39ee4: c7 01 movw r24, r14 39ee6: b6 01 movw r22, r12 39ee8: 0f 94 18 e0 call 0x3c030 ; 0x3c030 39eec: 2b 01 movw r4, r22 39eee: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39ef0: 26 e6 ldi r18, 0x66 ; 102 39ef2: 36 e6 ldi r19, 0x66 ; 102 39ef4: 46 e6 ldi r20, 0x66 ; 102 39ef6: 5f e3 ldi r21, 0x3F ; 63 39ef8: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 39efc: 87 fd sbrc r24, 7 39efe: 7f c0 rjmp .+254 ; 0x39ffe 39f00: 2d ec ldi r18, 0xCD ; 205 39f02: 3c ec ldi r19, 0xCC ; 204 39f04: 4c e8 ldi r20, 0x8C ; 140 39f06: 5f e3 ldi r21, 0x3F ; 63 39f08: c3 01 movw r24, r6 39f0a: b2 01 movw r22, r4 39f0c: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 39f10: 18 16 cp r1, r24 39f12: 0c f4 brge .+2 ; 0x39f16 39f14: 74 c0 rjmp .+232 ; 0x39ffe 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]); 39f16: 2d a1 ldd r18, Y+37 ; 0x25 39f18: 3e a1 ldd r19, Y+38 ; 0x26 39f1a: 4f a1 ldd r20, Y+39 ; 0x27 39f1c: 58 a5 ldd r21, Y+40 ; 0x28 39f1e: 69 a1 ldd r22, Y+33 ; 0x21 39f20: 7a a1 ldd r23, Y+34 ; 0x22 39f22: 8b a1 ldd r24, Y+35 ; 0x23 39f24: 9c a1 ldd r25, Y+36 ; 0x24 39f26: 0f 94 18 e0 call 0x3c030 ; 0x3c030 if (l > 15.f) 39f2a: 20 e0 ldi r18, 0x00 ; 0 39f2c: 30 e0 ldi r19, 0x00 ; 0 39f2e: 40 e7 ldi r20, 0x70 ; 112 39f30: 51 e4 ldi r21, 0x41 ; 65 39f32: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 39f36: 18 16 cp r1, r24 39f38: 0c f4 brge .+2 ; 0x39f3c #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 39f3a: 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]; 39f3c: a5 01 movw r20, r10 39f3e: 94 01 movw r18, r8 39f40: c7 01 movw r24, r14 39f42: b6 01 movw r22, r12 39f44: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 39f48: 6b 01 movw r12, r22 39f4a: 7c 01 movw r14, r24 39f4c: 2d 8d ldd r18, Y+29 ; 0x1d 39f4e: 3e 8d ldd r19, Y+30 ; 0x1e 39f50: 4f 8d ldd r20, Y+31 ; 0x1f 39f52: 58 a1 ldd r21, Y+32 ; 0x20 39f54: 69 8d ldd r22, Y+25 ; 0x19 39f56: 7a 8d ldd r23, Y+26 ; 0x1a 39f58: 8b 8d ldd r24, Y+27 ; 0x1b 39f5a: 9c 8d ldd r25, Y+28 ; 0x1c 39f5c: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 39f60: 9b 01 movw r18, r22 39f62: ac 01 movw r20, r24 39f64: c7 01 movw r24, r14 39f66: b6 01 movw r22, r12 39f68: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> if (fabs(l) > 0.1f) 39f6c: 9f 77 andi r25, 0x7F ; 127 39f6e: 2d ec ldi r18, 0xCD ; 205 39f70: 3c ec ldi r19, 0xCC ; 204 39f72: 4c ec ldi r20, 0xCC ; 204 39f74: 5d e3 ldi r21, 0x3D ; 61 39f76: 0f 94 05 e0 call 0x3c00a ; 0x3c00a <__gesf2> 39f7a: 18 16 cp r1, r24 39f7c: 14 f0 brlt .+4 ; 0x39f82 #endif reset = true; } } if (reset) 39f7e: 11 23 and r17, r17 39f80: f1 f0 breq .+60 ; 0x39fbe { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 39f82: 0f 94 8d ce call 0x39d1a ; 0x39d1a * @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; 39f86: 80 e0 ldi r24, 0x00 ; 0 39f88: 90 e0 ldi r25, 0x00 ; 0 39f8a: a0 e8 ldi r26, 0x80 ; 128 39f8c: bf e3 ldi r27, 0x3F ; 63 39f8e: 89 83 std Y+1, r24 ; 0x01 39f90: 9a 83 std Y+2, r25 ; 0x02 39f92: ab 83 std Y+3, r26 ; 0x03 39f94: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 39f96: 1d 82 std Y+5, r1 ; 0x05 39f98: 1e 82 std Y+6, r1 ; 0x06 39f9a: 1f 82 std Y+7, r1 ; 0x07 39f9c: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 39f9e: 19 86 std Y+9, r1 ; 0x09 39fa0: 1a 86 std Y+10, r1 ; 0x0a 39fa2: 1b 86 std Y+11, r1 ; 0x0b 39fa4: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 39fa6: 8d 87 std Y+13, r24 ; 0x0d 39fa8: 9e 87 std Y+14, r25 ; 0x0e 39faa: af 87 std Y+15, r26 ; 0x0f 39fac: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 39fae: 19 8a std Y+17, r1 ; 0x11 39fb0: 1a 8a std Y+18, r1 ; 0x12 39fb2: 1b 8a std Y+19, r1 ; 0x13 39fb4: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 39fb6: 1d 8a std Y+21, r1 ; 0x15 39fb8: 1e 8a std Y+22, r1 ; 0x16 39fba: 1f 8a std Y+23, r1 ; 0x17 39fbc: 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); 39fbe: ae 01 movw r20, r28 39fc0: 4f 5e subi r20, 0xEF ; 239 39fc2: 5f 4f sbci r21, 0xFF ; 255 39fc4: be 01 movw r22, r28 39fc6: 67 5f subi r22, 0xF7 ; 247 39fc8: 7f 4f sbci r23, 0xFF ; 255 39fca: ce 01 movw r24, r28 39fcc: 01 96 adiw r24, 0x01 ; 1 39fce: 0f 94 ec cc call 0x399d8 ; 0x399d8 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 39fd2: a8 96 adiw r28, 0x28 ; 40 39fd4: 0f b6 in r0, 0x3f ; 63 39fd6: f8 94 cli 39fd8: de bf out 0x3e, r29 ; 62 39fda: 0f be out 0x3f, r0 ; 63 39fdc: cd bf out 0x3d, r28 ; 61 39fde: df 91 pop r29 39fe0: cf 91 pop r28 39fe2: 1f 91 pop r17 39fe4: ff 90 pop r15 39fe6: ef 90 pop r14 39fe8: df 90 pop r13 39fea: cf 90 pop r12 39fec: bf 90 pop r11 39fee: af 90 pop r10 39ff0: 9f 90 pop r9 39ff2: 8f 90 pop r8 39ff4: 7f 90 pop r7 39ff6: 6f 90 pop r6 39ff8: 5f 90 pop r5 39ffa: 4f 90 pop r4 39ffc: 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; 39ffe: 11 e0 ldi r17, 0x01 ; 1 3a000: 8a cf rjmp .-236 ; 0x39f16 0003a002 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 3a002: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 3a004: 24 e1 ldi r18, 0x14 ; 20 3a006: ac 01 movw r20, r24 3a008: 24 9f mul r18, r20 3a00a: c0 01 movw r24, r0 3a00c: 25 9f mul r18, r21 3a00e: 90 0d add r25, r0 3a010: 11 24 eor r1, r1 3a012: 60 91 da 17 lds r22, 0x17DA ; 0x8017da 3a016: 70 91 db 17 lds r23, 0x17DB ; 0x8017db 3a01a: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 3a01e: c6 2f mov r28, r22 3a020: 65 31 cpi r22, 0x15 ; 21 3a022: 08 f0 brcs .+2 ; 0x3a026 3a024: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 3a026: 80 91 d9 17 lds r24, 0x17D9 ; 0x8017d9 3a02a: 8c 17 cp r24, r28 3a02c: 48 f4 brcc .+18 ; 0x3a040 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 3a02e: 8f ef ldi r24, 0xFF ; 255 3a030: 0e 94 0f 6f call 0xde1e ; 0xde1e { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 3a034: 80 91 d9 17 lds r24, 0x17D9 ; 0x8017d9 3a038: 8f 5f subi r24, 0xFF ; 255 3a03a: 80 93 d9 17 sts 0x17D9, r24 ; 0x8017d9 3a03e: f3 cf rjmp .-26 ; 0x3a026 } } 3a040: cf 91 pop r28 3a042: 08 95 ret 0003a044 : void menu_progressbar_finish(void) { progressbar_total = 1; 3a044: 81 e0 ldi r24, 0x01 ; 1 3a046: 90 e0 ldi r25, 0x00 ; 0 3a048: 90 93 db 17 sts 0x17DB, r25 ; 0x8017db 3a04c: 80 93 da 17 sts 0x17DA, r24 ; 0x8017da menu_progressbar_update(1); 3a050: 0f 94 01 d0 call 0x3a002 ; 0x3a002 _delay(300); 3a054: 6c e2 ldi r22, 0x2C ; 44 3a056: 71 e0 ldi r23, 0x01 ; 1 3a058: 80 e0 ldi r24, 0x00 ; 0 3a05a: 90 e0 ldi r25, 0x00 ; 0 3a05c: 0d 94 58 28 jmp 0x250b0 ; 0x250b0 0003a060 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 3a060: 0f 93 push r16 3a062: 1f 93 push r17 3a064: cf 93 push r28 3a066: df 93 push r29 3a068: 8c 01 movw r16, r24 3a06a: eb 01 movw r28, r22 lcd_clear(); 3a06c: 0e 94 93 6e call 0xdd26 ; 0xdd26 progressbar_block_count = 0; 3a070: 10 92 d9 17 sts 0x17D9, r1 ; 0x8017d9 progressbar_total = total; 3a074: 10 93 db 17 sts 0x17DB, r17 ; 0x8017db 3a078: 00 93 da 17 sts 0x17DA, r16 ; 0x8017da lcd_set_cursor(0, 1); 3a07c: 61 e0 ldi r22, 0x01 ; 1 3a07e: 80 e0 ldi r24, 0x00 ; 0 3a080: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 lcd_print_pad_P(title, LCD_WIDTH); 3a084: 64 e1 ldi r22, 0x14 ; 20 3a086: ce 01 movw r24, r28 3a088: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_set_cursor(0, 2); 3a08c: 62 e0 ldi r22, 0x02 ; 2 3a08e: 80 e0 ldi r24, 0x00 ; 0 } 3a090: df 91 pop r29 3a092: cf 91 pop r28 3a094: 1f 91 pop r17 3a096: 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); 3a098: 0c 94 60 6e jmp 0xdcc0 ; 0xdcc0 0003a09c : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 3a09c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a0a0: 90 91 14 05 lds r25, 0x0514 ; 0x800514 3a0a4: 89 13 cpse r24, r25 3a0a6: 0b c0 rjmp .+22 ; 0x3a0be 3a0a8: 90 91 13 05 lds r25, 0x0513 ; 0x800513 3a0ac: 99 23 and r25, r25 3a0ae: 39 f0 breq .+14 ; 0x3a0be 3a0b0: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a0b4: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a0b8: 82 17 cp r24, r18 3a0ba: 13 06 cpc r1, r19 3a0bc: 39 f0 breq .+14 ; 0x3a0cc 3a0be: 81 e0 ldi r24, 0x01 ; 1 3a0c0: 90 91 d7 03 lds r25, 0x03D7 ; 0x8003d7 3a0c4: 91 11 cpse r25, r1 3a0c6: 03 c0 rjmp .+6 ; 0x3a0ce 3a0c8: 80 e0 ldi r24, 0x00 ; 0 3a0ca: 08 95 ret 3a0cc: 81 e0 ldi r24, 0x01 ; 1 } 3a0ce: 08 95 ret 0003a0d0 : //! @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) { 3a0d0: 0f 93 push r16 3a0d2: 1f 93 push r17 3a0d4: cf 93 push r28 3a0d6: df 93 push r29 3a0d8: 8c 01 movw r16, r24 3a0da: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 3a0dc: 81 ed ldi r24, 0xD1 ; 209 3a0de: 9c e4 ldi r25, 0x4C ; 76 3a0e0: 0e 94 2c 72 call 0xe458 ; 0xe458 3a0e4: 9f 93 push r25 3a0e6: 8f 93 push r24 3a0e8: 88 ed ldi r24, 0xD8 ; 216 3a0ea: 9a ea ldi r25, 0xAA ; 170 3a0ec: 9f 93 push r25 3a0ee: 8f 93 push r24 3a0f0: df 93 push r29 3a0f2: cf 93 push r28 3a0f4: 0f 94 6b db call 0x3b6d6 ; 0x3b6d6 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 3a0f8: c8 0f add r28, r24 3a0fa: d1 1d adc r29, r1 3a0fc: 47 e0 ldi r20, 0x07 ; 7 3a0fe: 50 e0 ldi r21, 0x00 ; 0 3a100: b8 01 movw r22, r16 3a102: ce 01 movw r24, r28 3a104: 0f 94 44 dc call 0x3b888 ; 0x3b888 //index += 7; buffer.c[index + 7] = '\0'; 3a108: 1f 82 std Y+7, r1 ; 0x07 3a10a: 0f 90 pop r0 3a10c: 0f 90 pop r0 3a10e: 0f 90 pop r0 3a110: 0f 90 pop r0 3a112: 0f 90 pop r0 3a114: 0f 90 pop r0 } 3a116: df 91 pop r29 3a118: cf 91 pop r28 3a11a: 1f 91 pop r17 3a11c: 0f 91 pop r16 3a11e: 08 95 ret 0003a120 : 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)?'>':' '; 3a120: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a124: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a128: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a12c: 28 17 cp r18, r24 3a12e: 19 06 cpc r1, r25 3a130: 11 f0 breq .+4 ; 0x3a136 3a132: 80 e2 ldi r24, 0x20 ; 32 3a134: 08 95 ret 3a136: 8e e3 ldi r24, 0x3E ; 62 } 3a138: 08 95 ret 0003a13a : static void menu_draw_item_puts_P(char type_char, const char* str) { 3a13a: 0f 93 push r16 3a13c: 1f 93 push r17 3a13e: cf 93 push r28 3a140: c8 2f mov r28, r24 3a142: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a144: 0f 94 90 d0 call 0x3a120 ; 0x3a120 3a148: 48 2f mov r20, r24 3a14a: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a14e: 80 e0 ldi r24, 0x00 ; 0 3a150: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_print_pad_P(str, LCD_WIDTH - 2); 3a154: 62 e1 ldi r22, 0x12 ; 18 3a156: c8 01 movw r24, r16 3a158: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc(type_char); 3a15c: 8c 2f mov r24, r28 } 3a15e: cf 91 pop r28 3a160: 1f 91 pop r17 3a162: 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); 3a164: 0c 94 4f 6e jmp 0xdc9e ; 0xdc9e 0003a168 : } } void menu_item_ret(void) { lcd_draw_update = 2; 3a168: 82 e0 ldi r24, 0x02 ; 2 3a16a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 3a16e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a172: 8f 5f subi r24, 0xFF ; 255 3a174: 80 93 15 05 sts 0x0515, r24 ; 0x800515 //prevent the rest of the menu items from rendering or getting clicked menu_row = LCD_HEIGHT; // early exit from the MENU_BEGIN() for loop at the end of the current cycle 3a178: 84 e0 ldi r24, 0x04 ; 4 3a17a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 3a17e: 10 92 14 05 sts 0x0514, r1 ; 0x800514 menu_clicked = 0; // prevent subsequent items from being able to be clicked in case the current menu or position was changed by the clicked menu item 3a182: 10 92 13 05 sts 0x0513, r1 ; 0x800513 } 3a186: 08 95 ret 0003a188 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 3a188: cf 93 push r28 3a18a: df 93 push r29 if (menu_item == menu_line) 3a18c: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a190: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a194: 32 13 cpse r19, r18 3a196: 20 c0 rjmp .+64 ; 0x3a1d8 3a198: eb 01 movw r28, r22 3a19a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a19c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a1a0: 88 23 and r24, r24 3a1a2: 19 f0 breq .+6 ; 0x3a1aa 3a1a4: 80 e2 ldi r24, 0x20 ; 32 3a1a6: 0f 94 9d d0 call 0x3a13a ; 0x3a13a if (menu_clicked && (lcd_encoder == menu_item)) 3a1aa: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a1ae: 88 23 and r24, r24 3a1b0: 99 f0 breq .+38 ; 0x3a1d8 3a1b2: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a1b6: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a1ba: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a1be: 28 17 cp r18, r24 3a1c0: 19 06 cpc r1, r25 3a1c2: 51 f4 brne .+20 ; 0x3a1d8 { if (str_gcode) enquecommand_P(str_gcode); 3a1c4: 20 97 sbiw r28, 0x00 ; 0 3a1c6: 21 f0 breq .+8 ; 0x3a1d0 3a1c8: 61 e0 ldi r22, 0x01 ; 1 3a1ca: ce 01 movw r24, r28 3a1cc: 0e 94 a0 87 call 0x10f40 ; 0x10f40 menu_item_ret(); return; } } menu_item++; } 3a1d0: df 91 pop r29 3a1d2: 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(); 3a1d4: 0d 94 b4 d0 jmp 0x3a168 ; 0x3a168 return; } } menu_item++; 3a1d8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a1dc: 8f 5f subi r24, 0xFF ; 255 3a1de: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a1e2: df 91 pop r29 3a1e4: cf 91 pop r28 3a1e6: 08 95 ret 0003a1e8 : //! @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) { 3a1e8: ef 92 push r14 3a1ea: ff 92 push r15 3a1ec: 0f 93 push r16 3a1ee: 1f 93 push r17 3a1f0: cf 93 push r28 3a1f2: df 93 push r29 if (menu_item == menu_line) 3a1f4: 70 91 15 05 lds r23, 0x0515 ; 0x800515 3a1f8: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a1fc: 73 13 cpse r23, r19 3a1fe: 3f c0 rjmp .+126 ; 0x3a27e 3a200: 12 2f mov r17, r18 3a202: ea 01 movw r28, r20 3a204: 06 2f mov r16, r22 3a206: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 3a208: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a20c: 88 23 and r24, r24 3a20e: d1 f0 breq .+52 ; 0x3a244 } 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()); 3a210: 0f 94 90 d0 call 0x3a120 ; 0x3a120 3a214: 48 2f mov r20, r24 3a216: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a21a: 80 e0 ldi r24, 0x00 ; 0 3a21c: 0e 94 80 6e call 0xdd00 ; 0xdd00 uint8_t len = lcd_print_pad_P(str, max_strlen); 3a220: 61 e1 ldi r22, 0x11 ; 17 3a222: c7 01 movw r24, r14 3a224: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc_at((max_strlen - len) + 2, menu_row, num); 3a228: 40 2f mov r20, r16 3a22a: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a22e: 93 e1 ldi r25, 0x13 ; 19 3a230: 98 1b sub r25, r24 3a232: 89 2f mov r24, r25 3a234: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 3a238: 40 e2 ldi r20, 0x20 ; 32 3a23a: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a23e: 83 e1 ldi r24, 0x13 ; 19 3a240: 0e 94 80 6e call 0xdd00 ; 0xdd00 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)) 3a244: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a248: 88 23 and r24, r24 3a24a: c9 f0 breq .+50 ; 0x3a27e 3a24c: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a250: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a254: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a258: 28 17 cp r18, r24 3a25a: 19 06 cpc r1, r25 3a25c: 81 f4 brne .+32 ; 0x3a27e { lcd_update_enabled = 0; 3a25e: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 3a262: 81 2f mov r24, r17 3a264: fe 01 movw r30, r28 3a266: 19 95 eicall lcd_update_enabled = 1; 3a268: 81 e0 ldi r24, 0x01 ; 1 3a26a: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 3a26e: df 91 pop r29 3a270: cf 91 pop r28 3a272: 1f 91 pop r17 3a274: 0f 91 pop r16 3a276: ff 90 pop r15 3a278: 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(); 3a27a: 0d 94 b4 d0 jmp 0x3a168 ; 0x3a168 return; } } menu_item++; 3a27e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a282: 8f 5f subi r24, 0xFF ; 255 3a284: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a288: df 91 pop r29 3a28a: cf 91 pop r28 3a28c: 1f 91 pop r17 3a28e: 0f 91 pop r16 3a290: ff 90 pop r15 3a292: ef 90 pop r14 3a294: 08 95 ret 0003a296 : 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) { 3a296: cf 93 push r28 3a298: df 93 push r29 if (menu_item == menu_line) 3a29a: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a29e: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a2a2: 32 13 cpse r19, r18 3a2a4: 21 c0 rjmp .+66 ; 0x3a2e8 3a2a6: eb 01 movw r28, r22 3a2a8: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a2aa: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a2ae: 88 23 and r24, r24 3a2b0: 19 f0 breq .+6 ; 0x3a2b8 3a2b2: 80 e2 ldi r24, 0x20 ; 32 3a2b4: 0f 94 9d d0 call 0x3a13a ; 0x3a13a if (menu_clicked && (lcd_encoder == menu_item)) 3a2b8: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a2bc: 88 23 and r24, r24 3a2be: a1 f0 breq .+40 ; 0x3a2e8 3a2c0: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a2c4: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a2c8: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a2cc: 28 17 cp r18, r24 3a2ce: 19 06 cpc r1, r25 3a2d0: 59 f4 brne .+22 ; 0x3a2e8 { lcd_update_enabled = 0; 3a2d2: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a2d6: fe 01 movw r30, r28 3a2d8: 19 95 eicall lcd_update_enabled = 1; 3a2da: 81 e0 ldi r24, 0x01 ; 1 3a2dc: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 3a2e0: df 91 pop r29 3a2e2: 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(); 3a2e4: 0d 94 b4 d0 jmp 0x3a168 ; 0x3a168 return; } } menu_item++; 3a2e8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a2ec: 8f 5f subi r24, 0xFF ; 255 3a2ee: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a2f2: df 91 pop r29 3a2f4: cf 91 pop r28 3a2f6: 08 95 ret 0003a2f8 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 3a2f8: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a2fc: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a300: 32 13 cpse r19, r18 3a302: 19 c0 rjmp .+50 ; 0x3a336 3a304: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a306: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a30a: 88 23 and r24, r24 3a30c: 19 f0 breq .+6 ; 0x3a314 3a30e: 80 e2 ldi r24, 0x20 ; 32 3a310: 0f 94 9d d0 call 0x3a13a ; 0x3a13a if (menu_clicked && (lcd_encoder == menu_item)) 3a314: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a318: 88 23 and r24, r24 3a31a: 69 f0 breq .+26 ; 0x3a336 3a31c: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a320: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a324: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a328: 28 17 cp r18, r24 3a32a: 19 06 cpc r1, r25 3a32c: 21 f4 brne .+8 ; 0x3a336 { menu_item_ret(); 3a32e: 0f 94 b4 d0 call 0x3a168 ; 0x3a168 return 1; 3a332: 81 e0 ldi r24, 0x01 ; 1 3a334: 08 95 ret } } menu_item++; 3a336: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a33a: 8f 5f subi r24, 0xFF ; 255 3a33c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 return 0; 3a340: 80 e0 ldi r24, 0x00 ; 0 } 3a342: 08 95 ret 0003a344 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 3a344: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a348: 84 30 cpi r24, 0x04 ; 4 3a34a: 38 f5 brcc .+78 ; 0x3a39a { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 3a34c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a350: 90 e0 ldi r25, 0x00 ; 0 3a352: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a356: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a35a: 28 17 cp r18, r24 3a35c: 39 07 cpc r19, r25 3a35e: 44 f0 brlt .+16 ; 0x3a370 { lcd_encoder = menu_item - 1; 3a360: 01 97 sbiw r24, 0x01 ; 1 3a362: 90 93 71 06 sts 0x0671, r25 ; 0x800671 3a366: 80 93 70 06 sts 0x0670, r24 ; 0x800670 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3a36a: 87 e0 ldi r24, 0x07 ; 7 3a36c: 0f 94 0c 4f call 0x29e18 ; 0x29e18 } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 3a370: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a374: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 3a378: 30 e0 ldi r19, 0x00 ; 0 3a37a: 2d 5f subi r18, 0xFD ; 253 3a37c: 3f 4f sbci r19, 0xFF ; 255 3a37e: 82 17 cp r24, r18 3a380: 13 06 cpc r1, r19 3a382: 59 f0 breq .+22 ; 0x3a39a 3a384: 54 f0 brlt .+20 ; 0x3a39a { menu_top = lcd_encoder - LCD_HEIGHT + 1; 3a386: 9d ef ldi r25, 0xFD ; 253 3a388: 98 0f add r25, r24 3a38a: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 menu_line = menu_top - 1; 3a38e: 84 50 subi r24, 0x04 ; 4 3a390: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_row = -1; 3a394: 8f ef ldi r24, 0xFF ; 255 3a396: 80 93 12 05 sts 0x0512, r24 ; 0x800512 } } 3a39a: 08 95 ret 0003a39c : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 3a39c: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a3a0: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a3a4: 97 ff sbrs r25, 7 3a3a6: 07 c0 rjmp .+14 ; 0x3a3b6 { lcd_encoder = 0; 3a3a8: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a3ac: 10 92 70 06 sts 0x0670, r1 ; 0x800670 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3a3b0: 87 e0 ldi r24, 0x07 ; 7 3a3b2: 0f 94 0c 4f call 0x29e18 ; 0x29e18 } if (lcd_encoder < menu_top) 3a3b6: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a3ba: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a3be: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 3a3c2: 28 17 cp r18, r24 3a3c4: 19 06 cpc r1, r25 3a3c6: 19 f0 breq .+6 ; 0x3a3ce 3a3c8: 14 f0 brlt .+4 ; 0x3a3ce menu_top = lcd_encoder; 3a3ca: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 menu_line = menu_top; 3a3ce: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 3a3d2: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_clicked = lcd_clicked(); // Consume click event 3a3d6: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 3a3da: 80 93 13 05 sts 0x0513, r24 ; 0x800513 } 3a3de: 08 95 ret 0003a3e0 : 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)); 3a3e0: e9 ea ldi r30, 0xA9 ; 169 3a3e2: f3 e0 ldi r31, 0x03 ; 3 3a3e4: 80 e2 ldi r24, 0x20 ; 32 3a3e6: df 01 movw r26, r30 3a3e8: 1d 92 st X+, r1 3a3ea: 8a 95 dec r24 3a3ec: e9 f7 brne .-6 ; 0x3a3e8 } 3a3ee: 08 95 ret 0003a3f0 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 3a3f0: cf 93 push r28 CRITICAL_SECTION_START; 3a3f2: 3f b7 in r19, 0x3f ; 63 3a3f4: f8 94 cli if (menu_menu != menu) 3a3f6: e0 91 13 04 lds r30, 0x0413 ; 0x800413 3a3fa: f0 91 14 04 lds r31, 0x0414 ; 0x800414 3a3fe: e8 17 cp r30, r24 3a400: f9 07 cpc r31, r25 3a402: c9 f0 breq .+50 ; 0x3a436 3a404: c4 2f mov r28, r20 { menu_menu = menu; 3a406: 90 93 14 04 sts 0x0414, r25 ; 0x800414 3a40a: 80 93 13 04 sts 0x0413, r24 ; 0x800413 lcd_encoder = encoder; 3a40e: 70 93 71 06 sts 0x0671, r23 ; 0x800671 3a412: 60 93 70 06 sts 0x0670, r22 ; 0x800670 menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 3a416: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_draw_update = 2; // Full LCD re-draw 3a41a: 82 e0 ldi r24, 0x02 ; 2 3a41c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 3a420: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 3a422: 22 23 and r18, r18 3a424: 19 f0 breq .+6 ; 0x3a42c } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 3a426: 80 e0 ldi r24, 0x00 ; 0 3a428: 0f 94 0c 4f call 0x29e18 ; 0x29e18 if (reset_menu_state) menu_data_reset(); 3a42c: cc 23 and r28, r28 3a42e: 21 f0 breq .+8 ; 0x3a438 } else CRITICAL_SECTION_END; } 3a430: 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(); 3a432: 0d 94 f0 d1 jmp 0x3a3e0 ; 0x3a3e0 } else CRITICAL_SECTION_END; 3a436: 3f bf out 0x3f, r19 ; 63 } 3a438: cf 91 pop r28 3a43a: 08 95 ret 0003a43c : 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) { 3a43c: 7f 92 push r7 3a43e: 8f 92 push r8 3a440: 9f 92 push r9 3a442: af 92 push r10 3a444: bf 92 push r11 3a446: cf 92 push r12 3a448: df 92 push r13 3a44a: ef 92 push r14 3a44c: ff 92 push r15 3a44e: 0f 93 push r16 3a450: 1f 93 push r17 3a452: cf 93 push r28 3a454: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 3a456: e0 91 15 05 lds r30, 0x0515 ; 0x800515 3a45a: 50 91 14 05 lds r21, 0x0514 ; 0x800514 3a45e: e5 13 cpse r30, r21 3a460: 73 c0 rjmp .+230 ; 0x3a548 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 3a462: fb 01 movw r30, r22 3a464: 48 30 cpi r20, 0x08 ; 8 3a466: 09 f0 breq .+2 ; 0x3a46a 3a468: 6c c0 rjmp .+216 ; 0x3a542 3a46a: c0 81 ld r28, Z 3a46c: d0 e0 ldi r29, 0x00 ; 0 3a46e: 49 01 movw r8, r18 3a470: 74 2e mov r7, r20 3a472: 6b 01 movw r12, r22 3a474: 5c 01 movw r10, r24 if (lcd_draw_update) 3a476: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a47a: 88 23 and r24, r24 3a47c: 59 f0 breq .+22 ; 0x3a494 { lcd_set_cursor(0, menu_row); 3a47e: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a482: 80 e0 ldi r24, 0x00 ; 0 3a484: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 menu_draw_P(menu_selection_mark(), str, cur_val); 3a488: 0f 94 90 d0 call 0x3a120 ; 0x3a120 3a48c: ae 01 movw r20, r28 3a48e: b5 01 movw r22, r10 3a490: 0f 94 04 b1 call 0x36208 ; 0x36208 } if (menu_clicked && (lcd_encoder == menu_item)) 3a494: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a498: 88 23 and r24, r24 3a49a: 09 f4 brne .+2 ; 0x3a49e 3a49c: 55 c0 rjmp .+170 ; 0x3a548 3a49e: 90 91 15 05 lds r25, 0x0515 ; 0x800515 3a4a2: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a4a6: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a4aa: 92 17 cp r25, r18 3a4ac: 13 06 cpc r1, r19 3a4ae: 09 f0 breq .+2 ; 0x3a4b2 3a4b0: 4b c0 rjmp .+150 ; 0x3a548 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 3a4b2: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a4b6: 87 30 cpi r24, 0x07 ; 7 3a4b8: d8 f4 brcc .+54 ; 0x3a4f0 { menu_stack[menu_depth].menu = menu_menu; 3a4ba: 28 2f mov r18, r24 3a4bc: 30 e0 ldi r19, 0x00 ; 0 3a4be: f9 01 movw r30, r18 3a4c0: ee 0f add r30, r30 3a4c2: ff 1f adc r31, r31 3a4c4: e2 0f add r30, r18 3a4c6: f3 1f adc r31, r19 3a4c8: ec 53 subi r30, 0x3C ; 60 3a4ca: f8 4e sbci r31, 0xE8 ; 232 3a4cc: 20 91 13 04 lds r18, 0x0413 ; 0x800413 3a4d0: 30 91 14 04 lds r19, 0x0414 ; 0x800414 3a4d4: 31 83 std Z+1, r19 ; 0x01 3a4d6: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 3a4d8: 8f 5f subi r24, 0xFF ; 255 3a4da: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 3a4de: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 3a4e0: 20 e0 ldi r18, 0x00 ; 0 3a4e2: 40 e0 ldi r20, 0x00 ; 0 3a4e4: 70 e0 ldi r23, 0x00 ; 0 3a4e6: 60 e0 ldi r22, 0x00 ; 0 3a4e8: 88 e7 ldi r24, 0x78 ; 120 3a4ea: 9a e3 ldi r25, 0x3A ; 58 3a4ec: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 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; 3a4f0: b0 92 aa 03 sts 0x03AA, r11 ; 0x8003aa 3a4f4: a0 92 a9 03 sts 0x03A9, r10 ; 0x8003a9 _md->editValuePtr = pval; 3a4f8: d0 92 ad 03 sts 0x03AD, r13 ; 0x8003ad 3a4fc: c0 92 ac 03 sts 0x03AC, r12 ; 0x8003ac _md->editValueBits = pbits; 3a500: 70 92 ab 03 sts 0x03AB, r7 ; 0x8003ab _md->currentValue = cur_val; 3a504: d0 93 af 03 sts 0x03AF, r29 ; 0x8003af 3a508: c0 93 ae 03 sts 0x03AE, r28 ; 0x8003ae _md->minEditValue = min_val; 3a50c: 90 92 b1 03 sts 0x03B1, r9 ; 0x8003b1 3a510: 80 92 b0 03 sts 0x03B0, r8 ; 0x8003b0 _md->maxEditValue = max_val; 3a514: 10 93 b3 03 sts 0x03B3, r17 ; 0x8003b3 3a518: 00 93 b2 03 sts 0x03B2, r16 ; 0x8003b2 _md->minJumpValue = jmp_val; 3a51c: f0 92 b5 03 sts 0x03B5, r15 ; 0x8003b5 3a520: e0 92 b4 03 sts 0x03B4, r14 ; 0x8003b4 menu_item_ret(); return; } } menu_item++; } 3a524: df 91 pop r29 3a526: cf 91 pop r28 3a528: 1f 91 pop r17 3a52a: 0f 91 pop r16 3a52c: ff 90 pop r15 3a52e: ef 90 pop r14 3a530: df 90 pop r13 3a532: cf 90 pop r12 3a534: bf 90 pop r11 3a536: af 90 pop r10 3a538: 9f 90 pop r9 3a53a: 8f 90 pop r8 3a53c: 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(); 3a53e: 0d 94 b4 d0 jmp 0x3a168 ; 0x3a168 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)); 3a542: c0 81 ld r28, Z 3a544: d1 81 ldd r29, Z+1 ; 0x01 3a546: 93 cf rjmp .-218 ; 0x3a46e _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 3a548: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a54c: 8f 5f subi r24, 0xFF ; 255 3a54e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a552: df 91 pop r29 3a554: cf 91 pop r28 3a556: 1f 91 pop r17 3a558: 0f 91 pop r16 3a55a: ff 90 pop r15 3a55c: ef 90 pop r14 3a55e: df 90 pop r13 3a560: cf 90 pop r12 3a562: bf 90 pop r11 3a564: af 90 pop r10 3a566: 9f 90 pop r9 3a568: 8f 90 pop r8 3a56a: 7f 90 pop r7 3a56c: 08 95 ret 0003a56e <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 3a56e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a572: 88 23 and r24, r24 3a574: 09 f4 brne .+2 ; 0x3a578 <_menu_edit_P()+0xa> 3a576: 52 c0 rjmp .+164 ; 0x3a61c <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 3a578: 20 91 b4 03 lds r18, 0x03B4 ; 0x8003b4 3a57c: 30 91 b5 03 lds r19, 0x03B5 ; 0x8003b5 3a580: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 3a584: 90 91 b1 03 lds r25, 0x03B1 ; 0x8003b1 3a588: 21 15 cp r18, r1 3a58a: 31 05 cpc r19, r1 3a58c: d9 f0 breq .+54 ; 0x3a5c4 <_menu_edit_P()+0x56> 3a58e: 40 91 70 06 lds r20, 0x0670 ; 0x800670 3a592: 50 91 71 06 lds r21, 0x0671 ; 0x800671 3a596: 41 15 cp r20, r1 3a598: 51 05 cpc r21, r1 3a59a: a1 f0 breq .+40 ; 0x3a5c4 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 3a59c: 7c f0 brlt .+30 ; 0x3a5bc <_menu_edit_P()+0x4e> 3a59e: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a5a2: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a5a6: 48 17 cp r20, r24 3a5a8: 59 07 cpc r21, r25 3a5aa: 41 f4 brne .+16 ; 0x3a5bc <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 3a5ac: 30 93 af 03 sts 0x03AF, r19 ; 0x8003af 3a5b0: 20 93 ae 03 sts 0x03AE, r18 ; 0x8003ae lcd_encoder = 0; 3a5b4: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a5b8: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 3a5bc: 10 92 b5 03 sts 0x03B5, r1 ; 0x8003b5 3a5c0: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 } _md->currentValue += lcd_encoder; 3a5c4: 20 91 ae 03 lds r18, 0x03AE ; 0x8003ae 3a5c8: 30 91 af 03 lds r19, 0x03AF ; 0x8003af 3a5cc: 40 91 70 06 lds r20, 0x0670 ; 0x800670 3a5d0: 50 91 71 06 lds r21, 0x0671 ; 0x800671 3a5d4: 24 0f add r18, r20 3a5d6: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 3a5d8: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a5dc: 10 92 70 06 sts 0x0670, r1 ; 0x800670 // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 3a5e0: 28 17 cp r18, r24 3a5e2: 39 07 cpc r19, r25 3a5e4: 44 f0 brlt .+16 ; 0x3a5f6 <_menu_edit_P()+0x88> 3a5e6: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 3a5ea: 90 91 b3 03 lds r25, 0x03B3 ; 0x8003b3 3a5ee: 28 17 cp r18, r24 3a5f0: 39 07 cpc r19, r25 3a5f2: 0c f4 brge .+2 ; 0x3a5f6 <_menu_edit_P()+0x88> 3a5f4: c9 01 movw r24, r18 3a5f6: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af 3a5fa: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae lcd_set_cursor(0, 1); 3a5fe: 61 e0 ldi r22, 0x01 ; 1 3a600: 80 e0 ldi r24, 0x00 ; 0 3a602: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 menu_draw_P(' ', _md->editLabel, _md->currentValue); 3a606: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a60a: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a60e: 60 91 a9 03 lds r22, 0x03A9 ; 0x8003a9 3a612: 70 91 aa 03 lds r23, 0x03AA ; 0x8003aa 3a616: 80 e2 ldi r24, 0x20 ; 32 3a618: 0f 94 04 b1 call 0x36208 ; 0x36208 } if (lcd_clicked()) 3a61c: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 3a620: 88 23 and r24, r24 3a622: 41 f1 breq .+80 ; 0x3a674 <_menu_edit_P()+0x106> 3a624: e0 91 ac 03 lds r30, 0x03AC ; 0x8003ac 3a628: f0 91 ad 03 lds r31, 0x03AD ; 0x8003ad 3a62c: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 3a630: 90 91 af 03 lds r25, 0x03AF ; 0x8003af { if (_md->editValueBits == 8) 3a634: 20 91 ab 03 lds r18, 0x03AB ; 0x8003ab *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 3a638: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 3a63a: 28 30 cpi r18, 0x08 ; 8 3a63c: c9 f4 brne .+50 ; 0x3a670 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3a63e: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a642: 88 23 and r24, r24 3a644: b9 f0 breq .+46 ; 0x3a674 <_menu_edit_P()+0x106> { menu_depth--; 3a646: 81 50 subi r24, 0x01 ; 1 3a648: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3a64c: 90 e0 ldi r25, 0x00 ; 0 3a64e: fc 01 movw r30, r24 3a650: ee 0f add r30, r30 3a652: ff 1f adc r31, r31 3a654: e8 0f add r30, r24 3a656: f9 1f adc r31, r25 3a658: ec 53 subi r30, 0x3C ; 60 3a65a: f8 4e sbci r31, 0xE8 ; 232 3a65c: 62 81 ldd r22, Z+2 ; 0x02 3a65e: 06 2e mov r0, r22 3a660: 00 0c add r0, r0 3a662: 77 0b sbc r23, r23 3a664: 20 e0 ldi r18, 0x00 ; 0 3a666: 40 e0 ldi r20, 0x00 ; 0 3a668: 80 81 ld r24, Z 3a66a: 91 81 ldd r25, Z+1 ; 0x01 3a66c: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3a670: 91 83 std Z+1, r25 ; 0x01 3a672: e5 cf rjmp .-54 ; 0x3a63e <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 3a674: 08 95 ret 0003a676 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 3a676: dc 01 movw r26, r24 3a678: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 3a67a: 90 91 f8 03 lds r25, 0x03F8 ; 0x8003f8 3a67e: 97 30 cpi r25, 0x07 ; 7 3a680: d8 f4 brcc .+54 ; 0x3a6b8 { menu_stack[menu_depth].menu = menu_menu; 3a682: 49 2f mov r20, r25 3a684: 50 e0 ldi r21, 0x00 ; 0 3a686: fa 01 movw r30, r20 3a688: ee 0f add r30, r30 3a68a: ff 1f adc r31, r31 3a68c: e4 0f add r30, r20 3a68e: f5 1f adc r31, r21 3a690: ec 53 subi r30, 0x3C ; 60 3a692: f8 4e sbci r31, 0xE8 ; 232 3a694: 40 91 13 04 lds r20, 0x0413 ; 0x800413 3a698: 50 91 14 04 lds r21, 0x0414 ; 0x800414 3a69c: 51 83 std Z+1, r21 ; 0x01 3a69e: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a6a0: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a6a4: 9f 5f subi r25, 0xFF ; 255 3a6a6: 90 93 f8 03 sts 0x03F8, r25 ; 0x8003f8 3a6aa: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a6ac: 41 e0 ldi r20, 0x01 ; 1 3a6ae: 70 e0 ldi r23, 0x00 ; 0 3a6b0: 60 e0 ldi r22, 0x00 ; 0 3a6b2: cd 01 movw r24, r26 3a6b4: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 } } 3a6b8: 08 95 ret 0003a6ba : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a6ba: 8f 92 push r8 3a6bc: 9f 92 push r9 3a6be: af 92 push r10 3a6c0: bf 92 push r11 3a6c2: cf 92 push r12 3a6c4: df 92 push r13 3a6c6: ef 92 push r14 3a6c8: ff 92 push r15 3a6ca: 0f 93 push r16 3a6cc: 1f 93 push r17 3a6ce: cf 93 push r28 3a6d0: df 93 push r29 if (menu_item == menu_line) 3a6d2: e0 91 15 05 lds r30, 0x0515 ; 0x800515 3a6d6: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a6da: e3 13 cpse r30, r19 3a6dc: 73 c0 rjmp .+230 ; 0x3a7c4 3a6de: c2 2f mov r28, r18 3a6e0: 6a 01 movw r12, r20 3a6e2: 7b 01 movw r14, r22 3a6e4: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a6e6: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a6ea: 88 23 and r24, r24 3a6ec: a1 f1 breq .+104 ; 0x3a756 3a6ee: 0f 94 90 d0 call 0x3a120 ; 0x3a120 3a6f2: 01 e0 ldi r16, 0x01 ; 1 3a6f4: 8e 33 cpi r24, 0x3E ; 62 3a6f6: 09 f0 breq .+2 ; 0x3a6fa 3a6f8: 00 e0 ldi r16, 0x00 ; 0 3a6fa: 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; 3a6fc: 80 2f mov r24, r16 3a6fe: 82 70 andi r24, 0x02 ; 2 3a700: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a702: e1 14 cp r14, r1 3a704: f1 04 cpc r15, r1 3a706: 09 f4 brne .+2 ; 0x3a70a 3a708: 6f c0 rjmp .+222 ; 0x3a7e8 3a70a: e7 01 movw r28, r14 3a70c: 90 e2 ldi r25, 0x20 ; 32 3a70e: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a710: 88 20 and r8, r8 3a712: 09 f4 brne .+2 ; 0x3a716 3a714: 41 c0 rjmp .+130 ; 0x3a798 3a716: ce 01 movw r24, r28 3a718: 0f 94 12 da call 0x3b424 ; 0x3b424 <__strlen_P> 3a71c: 14 e0 ldi r17, 0x04 ; 4 3a71e: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a720: 4e e3 ldi r20, 0x3E ; 62 3a722: 00 ff sbrs r16, 0 3a724: 40 e2 ldi r20, 0x20 ; 32 3a726: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a72a: 80 e0 ldi r24, 0x00 ; 0 3a72c: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_print_pad_P(str, LCD_WIDTH - len); 3a730: 64 e1 ldi r22, 0x14 ; 20 3a732: 61 1b sub r22, r17 3a734: c5 01 movw r24, r10 3a736: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc('['); 3a73a: 8b e5 ldi r24, 0x5B ; 91 3a73c: 0e 94 4f 6e call 0xdc9e ; 0xdc9e if (is_progmem) { lcd_puts_P(toggle); 3a740: 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) 3a742: 88 20 and r8, r8 3a744: 89 f1 breq .+98 ; 0x3a7a8 { lcd_puts_P(toggle); 3a746: 0e 94 4b 6e call 0xdc96 ; 0xdc96 } else { lcd_print(toggle); } lcd_putc(']'); 3a74a: 8d e5 ldi r24, 0x5D ; 93 3a74c: 0e 94 4f 6e call 0xdc9e ; 0xdc9e lcd_putc(eol); 3a750: 89 2d mov r24, r9 3a752: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 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)) 3a756: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a75a: 88 23 and r24, r24 3a75c: 99 f1 breq .+102 ; 0x3a7c4 3a75e: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a762: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a766: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a76a: 28 17 cp r18, r24 3a76c: 19 06 cpc r1, r25 3a76e: 51 f5 brne .+84 ; 0x3a7c4 { if (toggle == NULL) // print N/A warning message 3a770: ef 28 or r14, r15 3a772: e9 f4 brne .+58 ; 0x3a7ae { menu_submenu(func); 3a774: 60 e0 ldi r22, 0x00 ; 0 3a776: c6 01 movw r24, r12 3a778: 0f 94 3b d3 call 0x3a676 ; 0x3a676 menu_item_ret(); return; } } menu_item++; } 3a77c: df 91 pop r29 3a77e: cf 91 pop r28 3a780: 1f 91 pop r17 3a782: 0f 91 pop r16 3a784: ff 90 pop r15 3a786: ef 90 pop r14 3a788: df 90 pop r13 3a78a: cf 90 pop r12 3a78c: bf 90 pop r11 3a78e: af 90 pop r10 3a790: 9f 90 pop r9 3a792: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a794: 0d 94 b4 d0 jmp 0x3a168 ; 0x3a168 //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)); 3a798: fe 01 movw r30, r28 3a79a: 01 90 ld r0, Z+ 3a79c: 00 20 and r0, r0 3a79e: e9 f7 brne .-6 ; 0x3a79a 3a7a0: ec 1b sub r30, r28 3a7a2: 13 e0 ldi r17, 0x03 ; 3 3a7a4: 1e 0f add r17, r30 3a7a6: bc cf rjmp .-136 ; 0x3a720 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a7a8: 0e 94 67 70 call 0xe0ce ; 0xe0ce 3a7ac: ce cf rjmp .-100 ; 0x3a74a { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a7ae: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a7b2: c1 14 cp r12, r1 3a7b4: d1 04 cpc r13, r1 3a7b6: 11 f0 breq .+4 ; 0x3a7bc 3a7b8: f6 01 movw r30, r12 3a7ba: 19 95 eicall lcd_update_enabled = 1; 3a7bc: 81 e0 ldi r24, 0x01 ; 1 3a7be: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a7c2: dc cf rjmp .-72 ; 0x3a77c } menu_item_ret(); return; } } menu_item++; 3a7c4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a7c8: 8f 5f subi r24, 0xFF ; 255 3a7ca: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a7ce: df 91 pop r29 3a7d0: cf 91 pop r28 3a7d2: 1f 91 pop r17 3a7d4: 0f 91 pop r16 3a7d6: ff 90 pop r15 3a7d8: ef 90 pop r14 3a7da: df 90 pop r13 3a7dc: cf 90 pop r12 3a7de: bf 90 pop r11 3a7e0: af 90 pop r10 3a7e2: 9f 90 pop r9 3a7e4: 8f 90 pop r8 3a7e6: 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); 3a7e8: 8a e8 ldi r24, 0x8A ; 138 3a7ea: 97 e4 ldi r25, 0x47 ; 71 3a7ec: 0e 94 2c 72 call 0xe458 ; 0xe458 3a7f0: 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] : ' '; 3a7f2: 8e e7 ldi r24, 0x7E ; 126 3a7f4: 98 2e mov r9, r24 3a7f6: 8c cf rjmp .-232 ; 0x3a710 0003a7f8 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a7f8: 0f 93 push r16 3a7fa: 1f 93 push r17 3a7fc: cf 93 push r28 3a7fe: df 93 push r29 3a800: cd b7 in r28, 0x3d ; 61 3a802: de b7 in r29, 0x3e ; 62 3a804: 63 97 sbiw r28, 0x13 ; 19 3a806: 0f b6 in r0, 0x3f ; 63 3a808: f8 94 cli 3a80a: de bf out 0x3e, r29 ; 62 3a80c: 0f be out 0x3f, r0 ; 63 3a80e: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a810: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a814: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a818: 32 13 cpse r19, r18 3a81a: 38 c0 rjmp .+112 ; 0x3a88c 3a81c: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a81e: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a822: 22 23 and r18, r18 3a824: a9 f0 breq .+42 ; 0x3a850 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a826: be 01 movw r22, r28 3a828: 6f 5f subi r22, 0xFF ; 255 3a82a: 7f 4f sbci r23, 0xFF ; 255 3a82c: 0f 94 68 d0 call 0x3a0d0 ; 0x3a0d0 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a830: 0f 94 90 d0 call 0x3a120 ; 0x3a120 3a834: 48 2f mov r20, r24 3a836: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a83a: 80 e0 ldi r24, 0x00 ; 0 3a83c: 0e 94 80 6e call 0xdd00 ; 0xdd00 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a840: 62 e1 ldi r22, 0x12 ; 18 3a842: ce 01 movw r24, r28 3a844: 01 96 adiw r24, 0x01 ; 1 3a846: 0e 94 4f 70 call 0xe09e ; 0xe09e lcd_putc(type_char); 3a84a: 8e e7 ldi r24, 0x7E ; 126 3a84c: 0e 94 4f 6e call 0xdc9e ; 0xdc9e 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)) 3a850: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a854: 88 23 and r24, r24 3a856: d1 f0 breq .+52 ; 0x3a88c 3a858: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a85c: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a860: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a864: 28 17 cp r18, r24 3a866: 19 06 cpc r1, r25 3a868: 89 f4 brne .+34 ; 0x3a88c 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); 3a86a: 60 e0 ldi r22, 0x00 ; 0 3a86c: c8 01 movw r24, r16 3a86e: 0f 94 3b d3 call 0x3a676 ; 0x3a676 menu_item_ret(); 3a872: 0f 94 b4 d0 call 0x3a168 ; 0x3a168 menu_item_ret(); return; } } menu_item++; } 3a876: 63 96 adiw r28, 0x13 ; 19 3a878: 0f b6 in r0, 0x3f ; 63 3a87a: f8 94 cli 3a87c: de bf out 0x3e, r29 ; 62 3a87e: 0f be out 0x3f, r0 ; 63 3a880: cd bf out 0x3d, r28 ; 61 3a882: df 91 pop r29 3a884: cf 91 pop r28 3a886: 1f 91 pop r17 3a888: 0f 91 pop r16 3a88a: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a88c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a890: 8f 5f subi r24, 0xFF ; 255 3a892: 80 93 15 05 sts 0x0515, r24 ; 0x800515 3a896: ef cf rjmp .-34 ; 0x3a876 0003a898 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a898: cf 93 push r28 3a89a: df 93 push r29 if (menu_item == menu_line) 3a89c: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a8a0: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a8a4: 32 13 cpse r19, r18 3a8a6: 1e c0 rjmp .+60 ; 0x3a8e4 3a8a8: eb 01 movw r28, r22 3a8aa: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a8ac: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a8b0: 88 23 and r24, r24 3a8b2: 19 f0 breq .+6 ; 0x3a8ba 3a8b4: 8e e7 ldi r24, 0x7E ; 126 3a8b6: 0f 94 9d d0 call 0x3a13a ; 0x3a13a if (menu_clicked && (lcd_encoder == menu_item)) 3a8ba: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a8be: 88 23 and r24, r24 3a8c0: 89 f0 breq .+34 ; 0x3a8e4 3a8c2: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a8c6: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a8ca: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a8ce: 28 17 cp r18, r24 3a8d0: 19 06 cpc r1, r25 3a8d2: 41 f4 brne .+16 ; 0x3a8e4 { menu_submenu(submenu); 3a8d4: 60 e0 ldi r22, 0x00 ; 0 3a8d6: ce 01 movw r24, r28 3a8d8: 0f 94 3b d3 call 0x3a676 ; 0x3a676 menu_item_ret(); return; } } menu_item++; } 3a8dc: df 91 pop r29 3a8de: 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(); 3a8e0: 0d 94 b4 d0 jmp 0x3a168 ; 0x3a168 return; } } menu_item++; 3a8e4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a8e8: 8f 5f subi r24, 0xFF ; 255 3a8ea: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a8ee: df 91 pop r29 3a8f0: cf 91 pop r28 3a8f2: 08 95 ret 0003a8f4 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a8f4: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a8f6: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a8fa: 98 17 cp r25, r24 3a8fc: a8 f4 brcc .+42 ; 0x3a928 3a8fe: 89 1b sub r24, r25 3a900: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a904: 90 e0 ldi r25, 0x00 ; 0 3a906: fc 01 movw r30, r24 3a908: ee 0f add r30, r30 3a90a: ff 1f adc r31, r31 3a90c: e8 0f add r30, r24 3a90e: f9 1f adc r31, r25 3a910: ec 53 subi r30, 0x3C ; 60 3a912: f8 4e sbci r31, 0xE8 ; 232 3a914: 62 81 ldd r22, Z+2 ; 0x02 3a916: 06 2e mov r0, r22 3a918: 00 0c add r0, r0 3a91a: 77 0b sbc r23, r23 3a91c: 20 e0 ldi r18, 0x00 ; 0 3a91e: 41 e0 ldi r20, 0x01 ; 1 3a920: 80 81 ld r24, Z 3a922: 91 81 ldd r25, Z+1 ; 0x01 3a924: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a928: 80 e0 ldi r24, 0x00 ; 0 3a92a: ea cf rjmp .-44 ; 0x3a900 0003a92c : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a92c: 81 e0 ldi r24, 0x01 ; 1 3a92e: 0d 94 7a d4 jmp 0x3a8f4 ; 0x3a8f4 0003a932 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a932: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a936: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a93a: 32 13 cpse r19, r18 3a93c: 19 c0 rjmp .+50 ; 0x3a970 3a93e: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a940: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a944: 88 23 and r24, r24 3a946: 19 f0 breq .+6 ; 0x3a94e 3a948: 83 e8 ldi r24, 0x83 ; 131 3a94a: 0f 94 9d d0 call 0x3a13a ; 0x3a13a if (menu_clicked && (lcd_encoder == menu_item)) 3a94e: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a952: 88 23 and r24, r24 3a954: 69 f0 breq .+26 ; 0x3a970 3a956: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a95a: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a95e: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a962: 28 17 cp r18, r24 3a964: 19 06 cpc r1, r25 3a966: 21 f4 brne .+8 ; 0x3a970 { menu_back(); 3a968: 0f 94 96 d4 call 0x3a92c ; 0x3a92c menu_item_ret(); 3a96c: 0d 94 b4 d0 jmp 0x3a168 ; 0x3a168 return; } } menu_item++; 3a970: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a974: 8f 5f subi r24, 0xFF ; 255 3a976: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a97a: 08 95 ret 0003a97c : }; 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() { 3a97c: ef 92 push r14 3a97e: ff 92 push r15 3a980: 0f 93 push r16 3a982: 1f 93 push r17 3a984: cf 93 push r28 3a986: df 93 push r29 3a988: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc 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) 3a98c: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a990: 81 11 cpse r24, r1 3a992: 23 c0 rjmp .+70 ; 0x3a9da { _md->status = 1; // Menu entered for the first time 3a994: 81 e0 ldi r24, 0x01 ; 1 3a996: 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; 3a99a: 81 e0 ldi r24, 0x01 ; 1 3a99c: 90 e0 ldi r25, 0x00 ; 0 3a99e: 20 91 8b 13 lds r18, 0x138B ; 0x80138b 3a9a2: 30 91 8c 13 lds r19, 0x138C ; 0x80138c 3a9a6: 27 30 cpi r18, 0x07 ; 7 3a9a8: 31 48 sbci r19, 0x81 ; 129 3a9aa: 11 f0 breq .+4 ; 0x3a9b0 3a9ac: 90 e0 ldi r25, 0x00 ; 0 3a9ae: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a9b0: bc 01 movw r22, r24 3a9b2: 66 0f add r22, r22 3a9b4: 77 1f adc r23, r23 3a9b6: 68 0f add r22, r24 3a9b8: 79 1f adc r23, r25 3a9ba: 61 5f subi r22, 0xF1 ; 241 3a9bc: 74 45 sbci r23, 0x54 ; 84 3a9be: 43 e0 ldi r20, 0x03 ; 3 3a9c0: 50 e0 ldi r21, 0x00 ; 0 3a9c2: 88 eb ldi r24, 0xB8 ; 184 3a9c4: 93 e0 ldi r25, 0x03 ; 3 3a9c6: 0f 94 ee d9 call 0x3b3dc ; 0x3b3dc // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a9ca: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a9ce: 0f 94 a0 10 call 0x22140 ; 0x22140 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a9d2: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 3a9d6: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 } MENU_BEGIN(); 3a9da: 0f 94 ce d1 call 0x3a39c ; 0x3a39c 3a9de: 10 92 12 05 sts 0x0512, r1 ; 0x800512 3a9e2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a9e6: 84 30 cpi r24, 0x04 ; 4 3a9e8: e0 f5 brcc .+120 ; 0x3aa62 3a9ea: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 3a9ee: 0f 94 4e d0 call 0x3a09c ; 0x3a09c 3a9f2: 88 23 and r24, r24 3a9f4: 89 f0 breq .+34 ; 0x3aa18 3a9f6: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 3a9fa: 70 e0 ldi r23, 0x00 ; 0 3a9fc: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3aa00: 0e 94 22 e9 call 0x1d244 ; 0x1d244 3aa04: 10 92 ad 0d sts 0x0DAD, r1 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.498> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3aa08: df 91 pop r29 3aa0a: cf 91 pop r28 3aa0c: 1f 91 pop r17 3aa0e: 0f 91 pop r16 3aa10: ff 90 pop r15 3aa12: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3aa14: 0d 94 ab 1f jmp 0x23f56 ; 0x23f56 mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3aa18: 80 ef ldi r24, 0xF0 ; 240 3aa1a: 93 e6 ldi r25, 0x63 ; 99 3aa1c: 0e 94 2c 72 call 0xe458 ; 0xe458 3aa20: 0f 94 99 d4 call 0x3a932 ; 0x3a932 MENU_ITEM_EDIT_int3_P( 3aa24: 00 91 ba 03 lds r16, 0x03BA ; 0x8003ba 3aa28: 10 e0 ldi r17, 0x00 ; 0 3aa2a: c0 91 b9 03 lds r28, 0x03B9 ; 0x8003b9 3aa2e: d0 e0 ldi r29, 0x00 ; 0 3aa30: 82 ee ldi r24, 0xE2 ; 226 3aa32: 93 e6 ldi r25, 0x63 ; 99 3aa34: 0e 94 2c 72 call 0xe458 ; 0xe458 3aa38: f1 2c mov r15, r1 3aa3a: e1 2c mov r14, r1 3aa3c: 9e 01 movw r18, r28 3aa3e: 48 e0 ldi r20, 0x08 ; 8 3aa40: 67 eb ldi r22, 0xB7 ; 183 3aa42: 73 e0 ldi r23, 0x03 ; 3 3aa44: 0f 94 1e d2 call 0x3a43c ; 0x3a43c _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3aa48: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3aa4c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3aa50: 8f 5f subi r24, 0xFF ; 255 3aa52: 80 93 12 05 sts 0x0512, r24 ; 0x800512 3aa56: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3aa5a: 8f 5f subi r24, 0xFF ; 255 3aa5c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 3aa60: c0 cf rjmp .-128 ; 0x3a9e2 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3aa62: df 91 pop r29 3aa64: cf 91 pop r28 3aa66: 1f 91 pop r17 3aa68: 0f 91 pop r16 3aa6a: ff 90 pop r15 3aa6c: ef 90 pop r14 3aa6e: 08 95 ret 0003aa70 : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3aa70: 0e 94 7d 70 call 0xe0fa ; 0xe0fa 3aa74: 81 11 cpse r24, r1 menu_back(); 3aa76: 0d 94 96 d4 jmp 0x3a92c ; 0x3a92c } 3aa7a: 08 95 ret 0003aa7c : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3aa7c: 8f 92 push r8 3aa7e: 9f 92 push r9 3aa80: af 92 push r10 3aa82: bf 92 push r11 3aa84: ef 92 push r14 3aa86: ff 92 push r15 3aa88: 0f 93 push r16 3aa8a: 1f 93 push r17 3aa8c: cf 93 push r28 3aa8e: df 93 push r29 3aa90: cd b7 in r28, 0x3d ; 61 3aa92: de b7 in r29, 0x3e ; 62 3aa94: a0 97 sbiw r28, 0x20 ; 32 3aa96: 0f b6 in r0, 0x3f ; 63 3aa98: f8 94 cli 3aa9a: de bf out 0x3e, r29 ; 62 3aa9c: 0f be out 0x3f, r0 ; 63 3aa9e: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3aaa0: 61 15 cp r22, r1 3aaa2: 71 05 cpc r23, r1 3aaa4: 81 05 cpc r24, r1 3aaa6: 91 05 cpc r25, r1 3aaa8: 99 f4 brne .+38 ; 0x3aad0 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aaaa: 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)); } 3aaac: a0 96 adiw r28, 0x20 ; 32 3aaae: 0f b6 in r0, 0x3f ; 63 3aab0: f8 94 cli 3aab2: de bf out 0x3e, r29 ; 62 3aab4: 0f be out 0x3f, r0 ; 63 3aab6: cd bf out 0x3d, r28 ; 61 3aab8: df 91 pop r29 3aaba: cf 91 pop r28 3aabc: 1f 91 pop r17 3aabe: 0f 91 pop r16 3aac0: ff 90 pop r15 3aac2: ef 90 pop r14 3aac4: bf 90 pop r11 3aac6: af 90 pop r10 3aac8: 9f 90 pop r9 3aaca: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aacc: 0c 94 b7 76 jmp 0xed6e ; 0xed6e // 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; 3aad0: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3aad2: 84 2e mov r8, r20 3aad4: 91 2c mov r9, r1 3aad6: b1 2c mov r11, r1 3aad8: a1 2c mov r10, r1 3aada: 9e 01 movw r18, r28 3aadc: 2f 5f subi r18, 0xFF ; 255 3aade: 3f 4f sbci r19, 0xFF ; 255 3aae0: 79 01 movw r14, r18 3aae2: a5 01 movw r20, r10 3aae4: 94 01 movw r18, r8 3aae6: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 3aaea: f7 01 movw r30, r14 3aaec: e0 0f add r30, r16 3aaee: f1 1d adc r31, r1 3aaf0: 60 83 st Z, r22 n /= base; 3aaf2: b9 01 movw r22, r18 3aaf4: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3aaf6: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3aaf8: 61 15 cp r22, r1 3aafa: 71 05 cpc r23, r1 3aafc: 81 05 cpc r24, r1 3aafe: 91 05 cpc r25, r1 3ab00: 81 f7 brne .-32 ; 0x3aae2 3ab02: 0e 0d add r16, r14 3ab04: 1f 2d mov r17, r15 3ab06: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3ab08: e0 16 cp r14, r16 3ab0a: f1 06 cpc r15, r17 3ab0c: 59 f0 breq .+22 ; 0x3ab24 print((char) (buf[i - 1] < 10 ? 3ab0e: f8 01 movw r30, r16 3ab10: 82 91 ld r24, -Z 3ab12: 8f 01 movw r16, r30 3ab14: 8a 30 cpi r24, 0x0A ; 10 3ab16: 20 f4 brcc .+8 ; 0x3ab20 '0' + buf[i - 1] : 3ab18: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ab1a: 0e 94 b7 76 call 0xed6e ; 0xed6e 3ab1e: f4 cf rjmp .-24 ; 0x3ab08 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3ab20: 89 5c subi r24, 0xC9 ; 201 3ab22: fb cf rjmp .-10 ; 0x3ab1a } 3ab24: a0 96 adiw r28, 0x20 ; 32 3ab26: 0f b6 in r0, 0x3f ; 63 3ab28: f8 94 cli 3ab2a: de bf out 0x3e, r29 ; 62 3ab2c: 0f be out 0x3f, r0 ; 63 3ab2e: cd bf out 0x3d, r28 ; 61 3ab30: df 91 pop r29 3ab32: cf 91 pop r28 3ab34: 1f 91 pop r17 3ab36: 0f 91 pop r16 3ab38: ff 90 pop r15 3ab3a: ef 90 pop r14 3ab3c: bf 90 pop r11 3ab3e: af 90 pop r10 3ab40: 9f 90 pop r9 3ab42: 8f 90 pop r8 3ab44: 08 95 ret 0003ab46 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3ab46: cf 92 push r12 3ab48: df 92 push r13 3ab4a: ef 92 push r14 3ab4c: ff 92 push r15 3ab4e: 6b 01 movw r12, r22 3ab50: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3ab52: f7 fe sbrs r15, 7 3ab54: 0b c0 rjmp .+22 ; 0x3ab6c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ab56: 8d e2 ldi r24, 0x2D ; 45 3ab58: 0e 94 b7 76 call 0xed6e ; 0xed6e } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3ab5c: f0 94 com r15 3ab5e: e0 94 com r14 3ab60: d0 94 com r13 3ab62: c0 94 com r12 3ab64: c1 1c adc r12, r1 3ab66: d1 1c adc r13, r1 3ab68: e1 1c adc r14, r1 3ab6a: f1 1c adc r15, r1 } printNumber(n, 10); 3ab6c: 4a e0 ldi r20, 0x0A ; 10 3ab6e: c7 01 movw r24, r14 3ab70: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3ab72: ff 90 pop r15 3ab74: ef 90 pop r14 3ab76: df 90 pop r13 3ab78: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3ab7a: 0d 94 3e d5 jmp 0x3aa7c ; 0x3aa7c 0003ab7e : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3ab7e: 8f 92 push r8 3ab80: 9f 92 push r9 3ab82: af 92 push r10 3ab84: bf 92 push r11 3ab86: cf 92 push r12 3ab88: df 92 push r13 3ab8a: ef 92 push r14 3ab8c: ff 92 push r15 3ab8e: cf 93 push r28 3ab90: 6b 01 movw r12, r22 3ab92: 7c 01 movw r14, r24 3ab94: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3ab96: 20 e0 ldi r18, 0x00 ; 0 3ab98: 30 e0 ldi r19, 0x00 ; 0 3ab9a: a9 01 movw r20, r18 3ab9c: 0f 94 71 de call 0x3bce2 ; 0x3bce2 <__cmpsf2> 3aba0: 87 ff sbrs r24, 7 3aba2: 07 c0 rjmp .+14 ; 0x3abb2 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aba4: 8d e2 ldi r24, 0x2D ; 45 3aba6: 0e 94 b7 76 call 0xed6e ; 0xed6e { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3abaa: f7 fa bst r15, 7 3abac: f0 94 com r15 3abae: f7 f8 bld r15, 7 3abb0: 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; 3abc0: 20 e0 ldi r18, 0x00 ; 0 3abc2: 30 e0 ldi r19, 0x00 ; 0 3abc4: 40 e2 ldi r20, 0x20 ; 32 3abc6: 51 e4 ldi r21, 0x41 ; 65 3abc8: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__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; 3abd0: 9b 01 movw r18, r22 3abd2: ac 01 movw r20, r24 3abd4: c7 01 movw r24, r14 3abd6: b6 01 movw r22, r12 3abd8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 3abdc: 6b 01 movw r12, r22 3abde: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3abe0: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 3abe4: 4b 01 movw r8, r22 3abe6: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3abe8: 4a e0 ldi r20, 0x0A ; 10 3abea: 0f 94 3e d5 call 0x3aa7c ; 0x3aa7c 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) 3abee: cc 23 and r28, r28 3abf0: 91 f1 breq .+100 ; 0x3ac56 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; 3abf2: c5 01 movw r24, r10 3abf4: b4 01 movw r22, r8 3abf6: 0f 94 e0 d6 call 0x3adc0 ; 0x3adc0 <__floatunsisf> 3abfa: 9b 01 movw r18, r22 3abfc: ac 01 movw r20, r24 3abfe: c7 01 movw r24, r14 3ac00: b6 01 movw r22, r12 3ac02: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3ac06: 6b 01 movw r12, r22 3ac08: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac0a: 8e e2 ldi r24, 0x2E ; 46 3ac0c: 0e 94 b7 76 call 0xed6e ; 0xed6e // 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) 3ac10: c1 50 subi r28, 0x01 ; 1 3ac12: 08 f1 brcs .+66 ; 0x3ac56 { remainder *= 10.0; 3ac14: 20 e0 ldi r18, 0x00 ; 0 3ac16: 30 e0 ldi r19, 0x00 ; 0 3ac18: 40 e2 ldi r20, 0x20 ; 32 3ac1a: 51 e4 ldi r21, 0x41 ; 65 3ac1c: c7 01 movw r24, r14 3ac1e: b6 01 movw r22, r12 3ac20: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3ac24: 4b 01 movw r8, r22 3ac26: 5c 01 movw r10, r24 int toPrint = int(remainder); 3ac28: 0f 94 ed de call 0x3bdda ; 0x3bdda <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3ac2c: 6b 01 movw r12, r22 3ac2e: 77 0f add r23, r23 3ac30: ee 08 sbc r14, r14 3ac32: ff 08 sbc r15, r15 3ac34: c7 01 movw r24, r14 3ac36: b6 01 movw r22, r12 3ac38: 0f 94 a3 d5 call 0x3ab46 ; 0x3ab46 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3ac3c: c7 01 movw r24, r14 3ac3e: b6 01 movw r22, r12 3ac40: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 3ac44: 9b 01 movw r18, r22 3ac46: ac 01 movw r20, r24 3ac48: c5 01 movw r24, r10 3ac4a: b4 01 movw r22, r8 3ac4c: 0f 94 7b dd call 0x3baf6 ; 0x3baf6 <__subsf3> 3ac50: 6b 01 movw r12, r22 3ac52: 7c 01 movw r14, r24 3ac54: dd cf rjmp .-70 ; 0x3ac10 } } 3ac56: cf 91 pop r28 3ac58: ff 90 pop r15 3ac5a: ef 90 pop r14 3ac5c: df 90 pop r13 3ac5e: cf 90 pop r12 3ac60: bf 90 pop r11 3ac62: af 90 pop r10 3ac64: 9f 90 pop r9 3ac66: 8f 90 pop r8 3ac68: 08 95 ret 0003ac6a : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac6a: 8a e0 ldi r24, 0x0A ; 10 3ac6c: 0c 94 b7 76 jmp 0xed6e ; 0xed6e 0003ac70 : 3ac70: 0e 94 94 87 call 0x10f28 ; 0x10f28 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3ac74: 0d 94 35 d6 jmp 0x3ac6a ; 0x3ac6a 0003ac78 : } 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) { 3ac78: 20 91 9b 04 lds r18, 0x049B ; 0x80049b 3ac7c: 30 91 9c 04 lds r19, 0x049C ; 0x80049c 3ac80: 80 91 99 04 lds r24, 0x0499 ; 0x800499 3ac84: 90 91 9a 04 lds r25, 0x049A ; 0x80049a 3ac88: 82 17 cp r24, r18 3ac8a: 93 07 cpc r25, r19 3ac8c: 71 f0 breq .+28 ; 0x3acaa return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3ac8e: f9 01 movw r30, r18 3ac90: e7 5e subi r30, 0xE7 ; 231 3ac92: fb 4f sbci r31, 0xFB ; 251 3ac94: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3ac96: 2f 5f subi r18, 0xFF ; 255 3ac98: 3f 4f sbci r19, 0xFF ; 255 3ac9a: 2f 77 andi r18, 0x7F ; 127 3ac9c: 33 27 eor r19, r19 3ac9e: 30 93 9c 04 sts 0x049C, r19 ; 0x80049c 3aca2: 20 93 9b 04 sts 0x049B, r18 ; 0x80049b return c; 3aca6: 90 e0 ldi r25, 0x00 ; 0 3aca8: 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; 3acaa: 8f ef ldi r24, 0xFF ; 255 3acac: 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; } } 3acae: 08 95 ret 0003acb0 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3acb0: 1f 92 push r1 3acb2: 0f 92 push r0 3acb4: 0f b6 in r0, 0x3f ; 63 3acb6: 0f 92 push r0 3acb8: 11 24 eor r1, r1 3acba: 0b b6 in r0, 0x3b ; 59 3acbc: 0f 92 push r0 3acbe: 2f 93 push r18 3acc0: 3f 93 push r19 3acc2: 4f 93 push r20 3acc4: 6f 93 push r22 3acc6: 7f 93 push r23 3acc8: 8f 93 push r24 3acca: 9f 93 push r25 3accc: ef 93 push r30 3acce: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3acd4: 84 ff sbrs r24, 4 3acd6: 12 c0 rjmp .+36 ; 0x3acfc <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3acd8: 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 } } 3acdc: ff 91 pop r31 3acde: ef 91 pop r30 3ace0: 9f 91 pop r25 3ace2: 8f 91 pop r24 3ace4: 7f 91 pop r23 3ace6: 6f 91 pop r22 3ace8: 4f 91 pop r20 3acea: 3f 91 pop r19 3acec: 2f 91 pop r18 3acee: 0f 90 pop r0 3acf0: 0b be out 0x3b, r0 ; 59 3acf2: 0f 90 pop r0 3acf4: 0f be out 0x3f, r0 ; 63 3acf6: 0f 90 pop r0 3acf8: 1f 90 pop r1 3acfa: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3acfc: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3ad00: 80 91 39 05 lds r24, 0x0539 ; 0x800539 3ad04: 81 30 cpi r24, 0x01 ; 1 3ad06: 51 f7 brne .-44 ; 0x3acdc <__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; 3ad08: 20 91 99 04 lds r18, 0x0499 ; 0x800499 3ad0c: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 3ad10: c9 01 movw r24, r18 3ad12: 01 96 adiw r24, 0x01 ; 1 3ad14: 8f 77 andi r24, 0x7F ; 127 3ad16: 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) { 3ad18: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 3ad1c: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 3ad20: 86 17 cp r24, r22 3ad22: 97 07 cpc r25, r23 3ad24: d9 f2 breq .-74 ; 0x3acdc <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ad26: 27 5e subi r18, 0xE7 ; 231 3ad28: 3b 4f sbci r19, 0xFB ; 251 3ad2a: f9 01 movw r30, r18 3ad2c: 40 83 st Z, r20 rx_buffer.head = i; 3ad2e: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 3ad32: 80 93 99 04 sts 0x0499, r24 ; 0x800499 3ad36: d2 cf rjmp .-92 ; 0x3acdc <__vector_36+0x2c> 0003ad38 <__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) { 3ad38: 1f 92 push r1 3ad3a: 0f 92 push r0 3ad3c: 0f b6 in r0, 0x3f ; 63 3ad3e: 0f 92 push r0 3ad40: 11 24 eor r1, r1 3ad42: 0b b6 in r0, 0x3b ; 59 3ad44: 0f 92 push r0 3ad46: 2f 93 push r18 3ad48: 3f 93 push r19 3ad4a: 4f 93 push r20 3ad4c: 6f 93 push r22 3ad4e: 7f 93 push r23 3ad50: 8f 93 push r24 3ad52: 9f 93 push r25 3ad54: ef 93 push r30 3ad56: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3ad5c: 84 ff sbrs r24, 4 3ad5e: 12 c0 rjmp .+36 ; 0x3ad84 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3ad60: 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 } } 3ad64: ff 91 pop r31 3ad66: ef 91 pop r30 3ad68: 9f 91 pop r25 3ad6a: 8f 91 pop r24 3ad6c: 7f 91 pop r23 3ad6e: 6f 91 pop r22 3ad70: 4f 91 pop r20 3ad72: 3f 91 pop r19 3ad74: 2f 91 pop r18 3ad76: 0f 90 pop r0 3ad78: 0b be out 0x3b, r0 ; 59 3ad7a: 0f 90 pop r0 3ad7c: 0f be out 0x3f, r0 ; 63 3ad7e: 0f 90 pop r0 3ad80: 1f 90 pop r1 3ad82: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3ad84: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3ad88: 80 91 39 05 lds r24, 0x0539 ; 0x800539 3ad8c: 81 11 cpse r24, r1 3ad8e: ea cf rjmp .-44 ; 0x3ad64 <__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; 3ad90: 20 91 99 04 lds r18, 0x0499 ; 0x800499 3ad94: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 3ad98: c9 01 movw r24, r18 3ad9a: 01 96 adiw r24, 0x01 ; 1 3ad9c: 8f 77 andi r24, 0x7F ; 127 3ad9e: 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) { 3ada0: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 3ada4: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 3ada8: 86 17 cp r24, r22 3adaa: 97 07 cpc r25, r23 3adac: d9 f2 breq .-74 ; 0x3ad64 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3adae: 27 5e subi r18, 0xE7 ; 231 3adb0: 3b 4f sbci r19, 0xFB ; 251 3adb2: f9 01 movw r30, r18 3adb4: 40 83 st Z, r20 rx_buffer.head = i; 3adb6: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 3adba: 80 93 99 04 sts 0x0499, r24 ; 0x800499 3adbe: d2 cf rjmp .-92 ; 0x3ad64 <__vector_25+0x2c> 0003adc0 <__floatunsisf>: 3adc0: e8 94 clt 3adc2: 09 c0 rjmp .+18 ; 0x3add6 <__floatsisf+0x12> 0003adc4 <__floatsisf>: 3adc4: 97 fb bst r25, 7 3adc6: 3e f4 brtc .+14 ; 0x3add6 <__floatsisf+0x12> 3adc8: 90 95 com r25 3adca: 80 95 com r24 3adcc: 70 95 com r23 3adce: 61 95 neg r22 3add0: 7f 4f sbci r23, 0xFF ; 255 3add2: 8f 4f sbci r24, 0xFF ; 255 3add4: 9f 4f sbci r25, 0xFF ; 255 3add6: 99 23 and r25, r25 3add8: a9 f0 breq .+42 ; 0x3ae04 <__floatsisf+0x40> 3adda: f9 2f mov r31, r25 3addc: 96 e9 ldi r25, 0x96 ; 150 3adde: bb 27 eor r27, r27 3ade0: 93 95 inc r25 3ade2: f6 95 lsr r31 3ade4: 87 95 ror r24 3ade6: 77 95 ror r23 3ade8: 67 95 ror r22 3adea: b7 95 ror r27 3adec: f1 11 cpse r31, r1 3adee: f8 cf rjmp .-16 ; 0x3ade0 <__floatsisf+0x1c> 3adf0: fa f4 brpl .+62 ; 0x3ae30 <__floatsisf+0x6c> 3adf2: bb 0f add r27, r27 3adf4: 11 f4 brne .+4 ; 0x3adfa <__floatsisf+0x36> 3adf6: 60 ff sbrs r22, 0 3adf8: 1b c0 rjmp .+54 ; 0x3ae30 <__floatsisf+0x6c> 3adfa: 6f 5f subi r22, 0xFF ; 255 3adfc: 7f 4f sbci r23, 0xFF ; 255 3adfe: 8f 4f sbci r24, 0xFF ; 255 3ae00: 9f 4f sbci r25, 0xFF ; 255 3ae02: 16 c0 rjmp .+44 ; 0x3ae30 <__floatsisf+0x6c> 3ae04: 88 23 and r24, r24 3ae06: 11 f0 breq .+4 ; 0x3ae0c <__floatsisf+0x48> 3ae08: 96 e9 ldi r25, 0x96 ; 150 3ae0a: 11 c0 rjmp .+34 ; 0x3ae2e <__floatsisf+0x6a> 3ae0c: 77 23 and r23, r23 3ae0e: 21 f0 breq .+8 ; 0x3ae18 <__floatsisf+0x54> 3ae10: 9e e8 ldi r25, 0x8E ; 142 3ae12: 87 2f mov r24, r23 3ae14: 76 2f mov r23, r22 3ae16: 05 c0 rjmp .+10 ; 0x3ae22 <__floatsisf+0x5e> 3ae18: 66 23 and r22, r22 3ae1a: 71 f0 breq .+28 ; 0x3ae38 <__floatsisf+0x74> 3ae1c: 96 e8 ldi r25, 0x86 ; 134 3ae1e: 86 2f mov r24, r22 3ae20: 70 e0 ldi r23, 0x00 ; 0 3ae22: 60 e0 ldi r22, 0x00 ; 0 3ae24: 2a f0 brmi .+10 ; 0x3ae30 <__floatsisf+0x6c> 3ae26: 9a 95 dec r25 3ae28: 66 0f add r22, r22 3ae2a: 77 1f adc r23, r23 3ae2c: 88 1f adc r24, r24 3ae2e: da f7 brpl .-10 ; 0x3ae26 <__floatsisf+0x62> 3ae30: 88 0f add r24, r24 3ae32: 96 95 lsr r25 3ae34: 87 95 ror r24 3ae36: 97 f9 bld r25, 7 3ae38: 08 95 ret 0003ae3a : 3ae3a: 9b 01 movw r18, r22 3ae3c: ac 01 movw r20, r24 3ae3e: 0d 94 21 d7 jmp 0x3ae42 ; 0x3ae42 <__mulsf3> 0003ae42 <__mulsf3>: 3ae42: 0f 94 34 d7 call 0x3ae68 ; 0x3ae68 <__mulsf3x> 3ae46: 0d 94 a5 d7 jmp 0x3af4a ; 0x3af4a <__fp_round> 3ae4a: 0f 94 97 d7 call 0x3af2e ; 0x3af2e <__fp_pscA> 3ae4e: 38 f0 brcs .+14 ; 0x3ae5e <__mulsf3+0x1c> 3ae50: 0f 94 9e d7 call 0x3af3c ; 0x3af3c <__fp_pscB> 3ae54: 20 f0 brcs .+8 ; 0x3ae5e <__mulsf3+0x1c> 3ae56: 95 23 and r25, r21 3ae58: 11 f0 breq .+4 ; 0x3ae5e <__mulsf3+0x1c> 3ae5a: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 3ae5e: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 3ae62: 11 24 eor r1, r1 3ae64: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 0003ae68 <__mulsf3x>: 3ae68: 0f 94 b6 d7 call 0x3af6c ; 0x3af6c <__fp_split3> 3ae6c: 70 f3 brcs .-36 ; 0x3ae4a <__mulsf3+0x8> 0003ae6e <__mulsf3_pse>: 3ae6e: 95 9f mul r25, r21 3ae70: c1 f3 breq .-16 ; 0x3ae62 <__mulsf3+0x20> 3ae72: 95 0f add r25, r21 3ae74: 50 e0 ldi r21, 0x00 ; 0 3ae76: 55 1f adc r21, r21 3ae78: 62 9f mul r22, r18 3ae7a: f0 01 movw r30, r0 3ae7c: 72 9f mul r23, r18 3ae7e: bb 27 eor r27, r27 3ae80: f0 0d add r31, r0 3ae82: b1 1d adc r27, r1 3ae84: 63 9f mul r22, r19 3ae86: aa 27 eor r26, r26 3ae88: f0 0d add r31, r0 3ae8a: b1 1d adc r27, r1 3ae8c: aa 1f adc r26, r26 3ae8e: 64 9f mul r22, r20 3ae90: 66 27 eor r22, r22 3ae92: b0 0d add r27, r0 3ae94: a1 1d adc r26, r1 3ae96: 66 1f adc r22, r22 3ae98: 82 9f mul r24, r18 3ae9a: 22 27 eor r18, r18 3ae9c: b0 0d add r27, r0 3ae9e: a1 1d adc r26, r1 3aea0: 62 1f adc r22, r18 3aea2: 73 9f mul r23, r19 3aea4: b0 0d add r27, r0 3aea6: a1 1d adc r26, r1 3aea8: 62 1f adc r22, r18 3aeaa: 83 9f mul r24, r19 3aeac: a0 0d add r26, r0 3aeae: 61 1d adc r22, r1 3aeb0: 22 1f adc r18, r18 3aeb2: 74 9f mul r23, r20 3aeb4: 33 27 eor r19, r19 3aeb6: a0 0d add r26, r0 3aeb8: 61 1d adc r22, r1 3aeba: 23 1f adc r18, r19 3aebc: 84 9f mul r24, r20 3aebe: 60 0d add r22, r0 3aec0: 21 1d adc r18, r1 3aec2: 82 2f mov r24, r18 3aec4: 76 2f mov r23, r22 3aec6: 6a 2f mov r22, r26 3aec8: 11 24 eor r1, r1 3aeca: 9f 57 subi r25, 0x7F ; 127 3aecc: 50 40 sbci r21, 0x00 ; 0 3aece: 9a f0 brmi .+38 ; 0x3aef6 <__mulsf3_pse+0x88> 3aed0: f1 f0 breq .+60 ; 0x3af0e <__mulsf3_pse+0xa0> 3aed2: 88 23 and r24, r24 3aed4: 4a f0 brmi .+18 ; 0x3aee8 <__mulsf3_pse+0x7a> 3aed6: ee 0f add r30, r30 3aed8: ff 1f adc r31, r31 3aeda: bb 1f adc r27, r27 3aedc: 66 1f adc r22, r22 3aede: 77 1f adc r23, r23 3aee0: 88 1f adc r24, r24 3aee2: 91 50 subi r25, 0x01 ; 1 3aee4: 50 40 sbci r21, 0x00 ; 0 3aee6: a9 f7 brne .-22 ; 0x3aed2 <__mulsf3_pse+0x64> 3aee8: 9e 3f cpi r25, 0xFE ; 254 3aeea: 51 05 cpc r21, r1 3aeec: 80 f0 brcs .+32 ; 0x3af0e <__mulsf3_pse+0xa0> 3aeee: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 3aef2: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 3aef6: 5f 3f cpi r21, 0xFF ; 255 3aef8: e4 f3 brlt .-8 ; 0x3aef2 <__mulsf3_pse+0x84> 3aefa: 98 3e cpi r25, 0xE8 ; 232 3aefc: d4 f3 brlt .-12 ; 0x3aef2 <__mulsf3_pse+0x84> 3aefe: 86 95 lsr r24 3af00: 77 95 ror r23 3af02: 67 95 ror r22 3af04: b7 95 ror r27 3af06: f7 95 ror r31 3af08: e7 95 ror r30 3af0a: 9f 5f subi r25, 0xFF ; 255 3af0c: c1 f7 brne .-16 ; 0x3aefe <__mulsf3_pse+0x90> 3af0e: fe 2b or r31, r30 3af10: 88 0f add r24, r24 3af12: 91 1d adc r25, r1 3af14: 96 95 lsr r25 3af16: 87 95 ror r24 3af18: 97 f9 bld r25, 7 3af1a: 08 95 ret 0003af1c <__fp_inf>: 3af1c: 97 f9 bld r25, 7 3af1e: 9f 67 ori r25, 0x7F ; 127 3af20: 80 e8 ldi r24, 0x80 ; 128 3af22: 70 e0 ldi r23, 0x00 ; 0 3af24: 60 e0 ldi r22, 0x00 ; 0 3af26: 08 95 ret 0003af28 <__fp_nan>: 3af28: 9f ef ldi r25, 0xFF ; 255 3af2a: 80 ec ldi r24, 0xC0 ; 192 3af2c: 08 95 ret 0003af2e <__fp_pscA>: 3af2e: 00 24 eor r0, r0 3af30: 0a 94 dec r0 3af32: 16 16 cp r1, r22 3af34: 17 06 cpc r1, r23 3af36: 18 06 cpc r1, r24 3af38: 09 06 cpc r0, r25 3af3a: 08 95 ret 0003af3c <__fp_pscB>: 3af3c: 00 24 eor r0, r0 3af3e: 0a 94 dec r0 3af40: 12 16 cp r1, r18 3af42: 13 06 cpc r1, r19 3af44: 14 06 cpc r1, r20 3af46: 05 06 cpc r0, r21 3af48: 08 95 ret 0003af4a <__fp_round>: 3af4a: 09 2e mov r0, r25 3af4c: 03 94 inc r0 3af4e: 00 0c add r0, r0 3af50: 11 f4 brne .+4 ; 0x3af56 <__fp_round+0xc> 3af52: 88 23 and r24, r24 3af54: 52 f0 brmi .+20 ; 0x3af6a <__fp_round+0x20> 3af56: bb 0f add r27, r27 3af58: 40 f4 brcc .+16 ; 0x3af6a <__fp_round+0x20> 3af5a: bf 2b or r27, r31 3af5c: 11 f4 brne .+4 ; 0x3af62 <__fp_round+0x18> 3af5e: 60 ff sbrs r22, 0 3af60: 04 c0 rjmp .+8 ; 0x3af6a <__fp_round+0x20> 3af62: 6f 5f subi r22, 0xFF ; 255 3af64: 7f 4f sbci r23, 0xFF ; 255 3af66: 8f 4f sbci r24, 0xFF ; 255 3af68: 9f 4f sbci r25, 0xFF ; 255 3af6a: 08 95 ret 0003af6c <__fp_split3>: 3af6c: 57 fd sbrc r21, 7 3af6e: 90 58 subi r25, 0x80 ; 128 3af70: 44 0f add r20, r20 3af72: 55 1f adc r21, r21 3af74: 59 f0 breq .+22 ; 0x3af8c <__fp_splitA+0x10> 3af76: 5f 3f cpi r21, 0xFF ; 255 3af78: 71 f0 breq .+28 ; 0x3af96 <__fp_splitA+0x1a> 3af7a: 47 95 ror r20 0003af7c <__fp_splitA>: 3af7c: 88 0f add r24, r24 3af7e: 97 fb bst r25, 7 3af80: 99 1f adc r25, r25 3af82: 61 f0 breq .+24 ; 0x3af9c <__fp_splitA+0x20> 3af84: 9f 3f cpi r25, 0xFF ; 255 3af86: 79 f0 breq .+30 ; 0x3afa6 <__fp_splitA+0x2a> 3af88: 87 95 ror r24 3af8a: 08 95 ret 3af8c: 12 16 cp r1, r18 3af8e: 13 06 cpc r1, r19 3af90: 14 06 cpc r1, r20 3af92: 55 1f adc r21, r21 3af94: f2 cf rjmp .-28 ; 0x3af7a <__fp_split3+0xe> 3af96: 46 95 lsr r20 3af98: f1 df rcall .-30 ; 0x3af7c <__fp_splitA> 3af9a: 08 c0 rjmp .+16 ; 0x3afac <__fp_splitA+0x30> 3af9c: 16 16 cp r1, r22 3af9e: 17 06 cpc r1, r23 3afa0: 18 06 cpc r1, r24 3afa2: 99 1f adc r25, r25 3afa4: f1 cf rjmp .-30 ; 0x3af88 <__fp_splitA+0xc> 3afa6: 86 95 lsr r24 3afa8: 71 05 cpc r23, r1 3afaa: 61 05 cpc r22, r1 3afac: 08 94 sec 3afae: 08 95 ret 0003afb0 <__fp_zero>: 3afb0: e8 94 clt 0003afb2 <__fp_szero>: 3afb2: bb 27 eor r27, r27 3afb4: 66 27 eor r22, r22 3afb6: 77 27 eor r23, r23 3afb8: cb 01 movw r24, r22 3afba: 97 f9 bld r25, 7 3afbc: 08 95 ret 0003afbe : 3afbe: 3f 92 push r3 3afc0: 4f 92 push r4 3afc2: 5f 92 push r5 3afc4: 6f 92 push r6 3afc6: 7f 92 push r7 3afc8: 8f 92 push r8 3afca: 9f 92 push r9 3afcc: af 92 push r10 3afce: bf 92 push r11 3afd0: cf 92 push r12 3afd2: df 92 push r13 3afd4: ef 92 push r14 3afd6: ff 92 push r15 3afd8: 0f 93 push r16 3afda: 1f 93 push r17 3afdc: cf 93 push r28 3afde: df 93 push r29 3afe0: 5c 01 movw r10, r24 3afe2: 6b 01 movw r12, r22 3afe4: 7a 01 movw r14, r20 3afe6: 61 15 cp r22, r1 3afe8: 71 05 cpc r23, r1 3afea: 19 f0 breq .+6 ; 0x3aff2 3afec: fb 01 movw r30, r22 3afee: 91 83 std Z+1, r25 ; 0x01 3aff0: 80 83 st Z, r24 3aff2: e1 14 cp r14, r1 3aff4: f1 04 cpc r15, r1 3aff6: 51 f0 breq .+20 ; 0x3b00c 3aff8: c7 01 movw r24, r14 3affa: 02 97 sbiw r24, 0x02 ; 2 3affc: 83 97 sbiw r24, 0x23 ; 35 3affe: 30 f0 brcs .+12 ; 0x3b00c 3b000: 40 e0 ldi r20, 0x00 ; 0 3b002: 30 e0 ldi r19, 0x00 ; 0 3b004: 20 e0 ldi r18, 0x00 ; 0 3b006: 90 e0 ldi r25, 0x00 ; 0 3b008: 6b c0 rjmp .+214 ; 0x3b0e0 3b00a: 5e 01 movw r10, r28 3b00c: e5 01 movw r28, r10 3b00e: 21 96 adiw r28, 0x01 ; 1 3b010: f5 01 movw r30, r10 3b012: 10 81 ld r17, Z 3b014: 81 2f mov r24, r17 3b016: 90 e0 ldi r25, 0x00 ; 0 3b018: 0f 94 e5 d9 call 0x3b3ca ; 0x3b3ca 3b01c: 89 2b or r24, r25 3b01e: a9 f7 brne .-22 ; 0x3b00a 3b020: 1d 32 cpi r17, 0x2D ; 45 3b022: 01 f5 brne .+64 ; 0x3b064 3b024: 21 96 adiw r28, 0x01 ; 1 3b026: f5 01 movw r30, r10 3b028: 11 81 ldd r17, Z+1 ; 0x01 3b02a: 01 e0 ldi r16, 0x01 ; 1 3b02c: e1 14 cp r14, r1 3b02e: f1 04 cpc r15, r1 3b030: 09 f4 brne .+2 ; 0x3b034 3b032: e6 c0 rjmp .+460 ; 0x3b200 3b034: f0 e1 ldi r31, 0x10 ; 16 3b036: ef 16 cp r14, r31 3b038: f1 04 cpc r15, r1 3b03a: 09 f0 breq .+2 ; 0x3b03e 3b03c: 88 c0 rjmp .+272 ; 0x3b14e 3b03e: 10 33 cpi r17, 0x30 ; 48 3b040: 59 f4 brne .+22 ; 0x3b058 3b042: 88 81 ld r24, Y 3b044: 8f 7d andi r24, 0xDF ; 223 3b046: 88 35 cpi r24, 0x58 ; 88 3b048: 09 f0 breq .+2 ; 0x3b04c 3b04a: 7c c0 rjmp .+248 ; 0x3b144 3b04c: 19 81 ldd r17, Y+1 ; 0x01 3b04e: 22 96 adiw r28, 0x02 ; 2 3b050: 02 60 ori r16, 0x02 ; 2 3b052: f0 e1 ldi r31, 0x10 ; 16 3b054: ef 2e mov r14, r31 3b056: f1 2c mov r15, r1 3b058: 81 2c mov r8, r1 3b05a: 91 2c mov r9, r1 3b05c: a1 2c mov r10, r1 3b05e: 88 e0 ldi r24, 0x08 ; 8 3b060: b8 2e mov r11, r24 3b062: 92 c0 rjmp .+292 ; 0x3b188 3b064: 1b 32 cpi r17, 0x2B ; 43 3b066: 21 f4 brne .+8 ; 0x3b070 3b068: e5 01 movw r28, r10 3b06a: 22 96 adiw r28, 0x02 ; 2 3b06c: f5 01 movw r30, r10 3b06e: 11 81 ldd r17, Z+1 ; 0x01 3b070: 00 e0 ldi r16, 0x00 ; 0 3b072: dc cf rjmp .-72 ; 0x3b02c 3b074: ea e0 ldi r30, 0x0A ; 10 3b076: ee 16 cp r14, r30 3b078: f1 04 cpc r15, r1 3b07a: 09 f4 brne .+2 ; 0x3b07e 3b07c: c7 c0 rjmp .+398 ; 0x3b20c 3b07e: f0 e1 ldi r31, 0x10 ; 16 3b080: ef 16 cp r14, r31 3b082: f1 04 cpc r15, r1 3b084: 09 f0 breq .+2 ; 0x3b088 3b086: 73 c0 rjmp .+230 ; 0x3b16e 3b088: e7 cf rjmp .-50 ; 0x3b058 3b08a: 78 e0 ldi r23, 0x08 ; 8 3b08c: e7 2e mov r14, r23 3b08e: f1 2c mov r15, r1 3b090: 81 2c mov r8, r1 3b092: 91 2c mov r9, r1 3b094: a1 2c mov r10, r1 3b096: 60 e1 ldi r22, 0x10 ; 16 3b098: b6 2e mov r11, r22 3b09a: 76 c0 rjmp .+236 ; 0x3b188 3b09c: 21 e0 ldi r18, 0x01 ; 1 3b09e: ad c0 rjmp .+346 ; 0x3b1fa 3b0a0: 30 2f mov r19, r16 3b0a2: 31 70 andi r19, 0x01 ; 1 3b0a4: c1 14 cp r12, r1 3b0a6: d1 04 cpc r13, r1 3b0a8: 31 f0 breq .+12 ; 0x3b0b6 3b0aa: 22 23 and r18, r18 3b0ac: 71 f1 breq .+92 ; 0x3b10a 3b0ae: 21 97 sbiw r28, 0x01 ; 1 3b0b0: f6 01 movw r30, r12 3b0b2: d1 83 std Z+1, r29 ; 0x01 3b0b4: c0 83 st Z, r28 3b0b6: 27 ff sbrs r18, 7 3b0b8: 2e c0 rjmp .+92 ; 0x3b116 3b0ba: 60 e0 ldi r22, 0x00 ; 0 3b0bc: 70 e0 ldi r23, 0x00 ; 0 3b0be: 80 e0 ldi r24, 0x00 ; 0 3b0c0: 90 e8 ldi r25, 0x80 ; 128 3b0c2: 31 11 cpse r19, r1 3b0c4: 04 c0 rjmp .+8 ; 0x3b0ce 3b0c6: 6f ef ldi r22, 0xFF ; 255 3b0c8: 7f ef ldi r23, 0xFF ; 255 3b0ca: 8f ef ldi r24, 0xFF ; 255 3b0cc: 9f e7 ldi r25, 0x7F ; 127 3b0ce: 22 e2 ldi r18, 0x22 ; 34 3b0d0: 30 e0 ldi r19, 0x00 ; 0 3b0d2: 30 93 15 18 sts 0x1815, r19 ; 0x801815 3b0d6: 20 93 14 18 sts 0x1814, r18 ; 0x801814 3b0da: 46 2f mov r20, r22 3b0dc: 37 2f mov r19, r23 3b0de: 28 2f mov r18, r24 3b0e0: 64 2f mov r22, r20 3b0e2: 73 2f mov r23, r19 3b0e4: 82 2f mov r24, r18 3b0e6: df 91 pop r29 3b0e8: cf 91 pop r28 3b0ea: 1f 91 pop r17 3b0ec: 0f 91 pop r16 3b0ee: ff 90 pop r15 3b0f0: ef 90 pop r14 3b0f2: df 90 pop r13 3b0f4: cf 90 pop r12 3b0f6: bf 90 pop r11 3b0f8: af 90 pop r10 3b0fa: 9f 90 pop r9 3b0fc: 8f 90 pop r8 3b0fe: 7f 90 pop r7 3b100: 6f 90 pop r6 3b102: 5f 90 pop r5 3b104: 4f 90 pop r4 3b106: 3f 90 pop r3 3b108: 08 95 ret 3b10a: 01 ff sbrs r16, 1 3b10c: 04 c0 rjmp .+8 ; 0x3b116 3b10e: 22 97 sbiw r28, 0x02 ; 2 3b110: f6 01 movw r30, r12 3b112: d1 83 std Z+1, r29 ; 0x01 3b114: c0 83 st Z, r28 3b116: 33 23 and r19, r19 3b118: 41 f0 breq .+16 ; 0x3b12a 3b11a: 90 95 com r25 3b11c: 80 95 com r24 3b11e: 70 95 com r23 3b120: 61 95 neg r22 3b122: 7f 4f sbci r23, 0xFF ; 255 3b124: 8f 4f sbci r24, 0xFF ; 255 3b126: 9f 4f sbci r25, 0xFF ; 255 3b128: d8 cf rjmp .-80 ; 0x3b0da 3b12a: 97 ff sbrs r25, 7 3b12c: d6 cf rjmp .-84 ; 0x3b0da 3b12e: 82 e2 ldi r24, 0x22 ; 34 3b130: 90 e0 ldi r25, 0x00 ; 0 3b132: 90 93 15 18 sts 0x1815, r25 ; 0x801815 3b136: 80 93 14 18 sts 0x1814, r24 ; 0x801814 3b13a: 6f ef ldi r22, 0xFF ; 255 3b13c: 7f ef ldi r23, 0xFF ; 255 3b13e: 8f ef ldi r24, 0xFF ; 255 3b140: 9f e7 ldi r25, 0x7F ; 127 3b142: cb cf rjmp .-106 ; 0x3b0da 3b144: 10 e3 ldi r17, 0x30 ; 48 3b146: e1 14 cp r14, r1 3b148: f1 04 cpc r15, r1 3b14a: 09 f4 brne .+2 ; 0x3b14e 3b14c: 9e cf rjmp .-196 ; 0x3b08a 3b14e: 28 e0 ldi r18, 0x08 ; 8 3b150: e2 16 cp r14, r18 3b152: f1 04 cpc r15, r1 3b154: 09 f4 brne .+2 ; 0x3b158 3b156: 9c cf rjmp .-200 ; 0x3b090 3b158: 0c f0 brlt .+2 ; 0x3b15c 3b15a: 8c cf rjmp .-232 ; 0x3b074 3b15c: 81 2c mov r8, r1 3b15e: 91 2c mov r9, r1 3b160: a1 2c mov r10, r1 3b162: e0 e4 ldi r30, 0x40 ; 64 3b164: be 2e mov r11, r30 3b166: 82 e0 ldi r24, 0x02 ; 2 3b168: e8 16 cp r14, r24 3b16a: f1 04 cpc r15, r1 3b16c: 69 f0 breq .+26 ; 0x3b188 3b16e: 60 e0 ldi r22, 0x00 ; 0 3b170: 70 e0 ldi r23, 0x00 ; 0 3b172: 80 e0 ldi r24, 0x00 ; 0 3b174: 90 e8 ldi r25, 0x80 ; 128 3b176: 97 01 movw r18, r14 3b178: 0f 2c mov r0, r15 3b17a: 00 0c add r0, r0 3b17c: 44 0b sbc r20, r20 3b17e: 55 0b sbc r21, r21 3b180: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 3b184: 49 01 movw r8, r18 3b186: 5a 01 movw r10, r20 3b188: 20 e0 ldi r18, 0x00 ; 0 3b18a: 60 e0 ldi r22, 0x00 ; 0 3b18c: 70 e0 ldi r23, 0x00 ; 0 3b18e: cb 01 movw r24, r22 3b190: 27 01 movw r4, r14 3b192: 0f 2c mov r0, r15 3b194: 00 0c add r0, r0 3b196: 66 08 sbc r6, r6 3b198: 77 08 sbc r7, r7 3b19a: fe 01 movw r30, r28 3b19c: 50 ed ldi r21, 0xD0 ; 208 3b19e: 35 2e mov r3, r21 3b1a0: 31 0e add r3, r17 3b1a2: 39 e0 ldi r19, 0x09 ; 9 3b1a4: 33 15 cp r19, r3 3b1a6: 70 f4 brcc .+28 ; 0x3b1c4 3b1a8: 3f eb ldi r19, 0xBF ; 191 3b1aa: 31 0f add r19, r17 3b1ac: 49 ec ldi r20, 0xC9 ; 201 3b1ae: 34 2e mov r3, r20 3b1b0: 3a 31 cpi r19, 0x1A ; 26 3b1b2: 38 f0 brcs .+14 ; 0x3b1c2 3b1b4: 3f e9 ldi r19, 0x9F ; 159 3b1b6: 31 0f add r19, r17 3b1b8: 3a 31 cpi r19, 0x1A ; 26 3b1ba: 08 f0 brcs .+2 ; 0x3b1be 3b1bc: 71 cf rjmp .-286 ; 0x3b0a0 3b1be: 39 ea ldi r19, 0xA9 ; 169 3b1c0: 33 2e mov r3, r19 3b1c2: 31 0e add r3, r17 3b1c4: 3e 14 cp r3, r14 3b1c6: 1f 04 cpc r1, r15 3b1c8: 0c f0 brlt .+2 ; 0x3b1cc 3b1ca: 6a cf rjmp .-300 ; 0x3b0a0 3b1cc: 27 fd sbrc r18, 7 3b1ce: 15 c0 rjmp .+42 ; 0x3b1fa 3b1d0: 86 16 cp r8, r22 3b1d2: 97 06 cpc r9, r23 3b1d4: a8 06 cpc r10, r24 3b1d6: b9 06 cpc r11, r25 3b1d8: 78 f0 brcs .+30 ; 0x3b1f8 3b1da: a3 01 movw r20, r6 3b1dc: 92 01 movw r18, r4 3b1de: 0f 94 b7 dc call 0x3b96e ; 0x3b96e <__mulsi3> 3b1e2: 63 0d add r22, r3 3b1e4: 71 1d adc r23, r1 3b1e6: 81 1d adc r24, r1 3b1e8: 91 1d adc r25, r1 3b1ea: 61 30 cpi r22, 0x01 ; 1 3b1ec: 71 05 cpc r23, r1 3b1ee: 81 05 cpc r24, r1 3b1f0: 20 e8 ldi r18, 0x80 ; 128 3b1f2: 92 07 cpc r25, r18 3b1f4: 08 f4 brcc .+2 ; 0x3b1f8 3b1f6: 52 cf rjmp .-348 ; 0x3b09c 3b1f8: 2f ef ldi r18, 0xFF ; 255 3b1fa: 21 96 adiw r28, 0x01 ; 1 3b1fc: 10 81 ld r17, Z 3b1fe: cd cf rjmp .-102 ; 0x3b19a 3b200: 10 33 cpi r17, 0x30 ; 48 3b202: 09 f4 brne .+2 ; 0x3b206 3b204: 1e cf rjmp .-452 ; 0x3b042 3b206: 2a e0 ldi r18, 0x0A ; 10 3b208: e2 2e mov r14, r18 3b20a: f1 2c mov r15, r1 3b20c: 9c ec ldi r25, 0xCC ; 204 3b20e: 89 2e mov r8, r25 3b210: 98 2c mov r9, r8 3b212: a8 2c mov r10, r8 3b214: 9c e0 ldi r25, 0x0C ; 12 3b216: b9 2e mov r11, r25 3b218: b7 cf rjmp .-146 ; 0x3b188 0003b21a <__ftoa_engine>: 3b21a: 28 30 cpi r18, 0x08 ; 8 3b21c: 08 f0 brcs .+2 ; 0x3b220 <__ftoa_engine+0x6> 3b21e: 27 e0 ldi r18, 0x07 ; 7 3b220: 33 27 eor r19, r19 3b222: da 01 movw r26, r20 3b224: 99 0f add r25, r25 3b226: 31 1d adc r19, r1 3b228: 87 fd sbrc r24, 7 3b22a: 91 60 ori r25, 0x01 ; 1 3b22c: 00 96 adiw r24, 0x00 ; 0 3b22e: 61 05 cpc r22, r1 3b230: 71 05 cpc r23, r1 3b232: 39 f4 brne .+14 ; 0x3b242 <__ftoa_engine+0x28> 3b234: 32 60 ori r19, 0x02 ; 2 3b236: 2e 5f subi r18, 0xFE ; 254 3b238: 3d 93 st X+, r19 3b23a: 30 e3 ldi r19, 0x30 ; 48 3b23c: 2a 95 dec r18 3b23e: e1 f7 brne .-8 ; 0x3b238 <__ftoa_engine+0x1e> 3b240: 08 95 ret 3b242: 9f 3f cpi r25, 0xFF ; 255 3b244: 30 f0 brcs .+12 ; 0x3b252 <__ftoa_engine+0x38> 3b246: 80 38 cpi r24, 0x80 ; 128 3b248: 71 05 cpc r23, r1 3b24a: 61 05 cpc r22, r1 3b24c: 09 f0 breq .+2 ; 0x3b250 <__ftoa_engine+0x36> 3b24e: 3c 5f subi r19, 0xFC ; 252 3b250: 3c 5f subi r19, 0xFC ; 252 3b252: 3d 93 st X+, r19 3b254: 91 30 cpi r25, 0x01 ; 1 3b256: 08 f0 brcs .+2 ; 0x3b25a <__ftoa_engine+0x40> 3b258: 80 68 ori r24, 0x80 ; 128 3b25a: 91 1d adc r25, r1 3b25c: df 93 push r29 3b25e: cf 93 push r28 3b260: 1f 93 push r17 3b262: 0f 93 push r16 3b264: ff 92 push r15 3b266: ef 92 push r14 3b268: 19 2f mov r17, r25 3b26a: 98 7f andi r25, 0xF8 ; 248 3b26c: 96 95 lsr r25 3b26e: e9 2f mov r30, r25 3b270: 96 95 lsr r25 3b272: 96 95 lsr r25 3b274: e9 0f add r30, r25 3b276: ff 27 eor r31, r31 3b278: e2 50 subi r30, 0x02 ; 2 3b27a: fa 48 sbci r31, 0x8A ; 138 3b27c: 99 27 eor r25, r25 3b27e: 33 27 eor r19, r19 3b280: ee 24 eor r14, r14 3b282: ff 24 eor r15, r15 3b284: a7 01 movw r20, r14 3b286: e7 01 movw r28, r14 3b288: 05 90 lpm r0, Z+ 3b28a: 08 94 sec 3b28c: 07 94 ror r0 3b28e: 28 f4 brcc .+10 ; 0x3b29a <__ftoa_engine+0x80> 3b290: 36 0f add r19, r22 3b292: e7 1e adc r14, r23 3b294: f8 1e adc r15, r24 3b296: 49 1f adc r20, r25 3b298: 51 1d adc r21, r1 3b29a: 66 0f add r22, r22 3b29c: 77 1f adc r23, r23 3b29e: 88 1f adc r24, r24 3b2a0: 99 1f adc r25, r25 3b2a2: 06 94 lsr r0 3b2a4: a1 f7 brne .-24 ; 0x3b28e <__ftoa_engine+0x74> 3b2a6: 05 90 lpm r0, Z+ 3b2a8: 07 94 ror r0 3b2aa: 28 f4 brcc .+10 ; 0x3b2b6 <__ftoa_engine+0x9c> 3b2ac: e7 0e add r14, r23 3b2ae: f8 1e adc r15, r24 3b2b0: 49 1f adc r20, r25 3b2b2: 56 1f adc r21, r22 3b2b4: c1 1d adc r28, r1 3b2b6: 77 0f add r23, r23 3b2b8: 88 1f adc r24, r24 3b2ba: 99 1f adc r25, r25 3b2bc: 66 1f adc r22, r22 3b2be: 06 94 lsr r0 3b2c0: a1 f7 brne .-24 ; 0x3b2aa <__ftoa_engine+0x90> 3b2c2: 05 90 lpm r0, Z+ 3b2c4: 07 94 ror r0 3b2c6: 28 f4 brcc .+10 ; 0x3b2d2 <__ftoa_engine+0xb8> 3b2c8: f8 0e add r15, r24 3b2ca: 49 1f adc r20, r25 3b2cc: 56 1f adc r21, r22 3b2ce: c7 1f adc r28, r23 3b2d0: d1 1d adc r29, r1 3b2d2: 88 0f add r24, r24 3b2d4: 99 1f adc r25, r25 3b2d6: 66 1f adc r22, r22 3b2d8: 77 1f adc r23, r23 3b2da: 06 94 lsr r0 3b2dc: a1 f7 brne .-24 ; 0x3b2c6 <__ftoa_engine+0xac> 3b2de: 05 90 lpm r0, Z+ 3b2e0: 07 94 ror r0 3b2e2: 20 f4 brcc .+8 ; 0x3b2ec <__ftoa_engine+0xd2> 3b2e4: 49 0f add r20, r25 3b2e6: 56 1f adc r21, r22 3b2e8: c7 1f adc r28, r23 3b2ea: d8 1f adc r29, r24 3b2ec: 99 0f add r25, r25 3b2ee: 66 1f adc r22, r22 3b2f0: 77 1f adc r23, r23 3b2f2: 88 1f adc r24, r24 3b2f4: 06 94 lsr r0 3b2f6: a9 f7 brne .-22 ; 0x3b2e2 <__ftoa_engine+0xc8> 3b2f8: 84 91 lpm r24, Z 3b2fa: 10 95 com r17 3b2fc: 17 70 andi r17, 0x07 ; 7 3b2fe: 41 f0 breq .+16 ; 0x3b310 <__ftoa_engine+0xf6> 3b300: d6 95 lsr r29 3b302: c7 95 ror r28 3b304: 57 95 ror r21 3b306: 47 95 ror r20 3b308: f7 94 ror r15 3b30a: e7 94 ror r14 3b30c: 1a 95 dec r17 3b30e: c1 f7 brne .-16 ; 0x3b300 <__ftoa_engine+0xe6> 3b310: e4 ea ldi r30, 0xA4 ; 164 3b312: f5 e7 ldi r31, 0x75 ; 117 3b314: 68 94 set 3b316: 15 90 lpm r1, Z+ 3b318: 15 91 lpm r17, Z+ 3b31a: 35 91 lpm r19, Z+ 3b31c: 65 91 lpm r22, Z+ 3b31e: 95 91 lpm r25, Z+ 3b320: 05 90 lpm r0, Z+ 3b322: 7f e2 ldi r23, 0x2F ; 47 3b324: 73 95 inc r23 3b326: e1 18 sub r14, r1 3b328: f1 0a sbc r15, r17 3b32a: 43 0b sbc r20, r19 3b32c: 56 0b sbc r21, r22 3b32e: c9 0b sbc r28, r25 3b330: d0 09 sbc r29, r0 3b332: c0 f7 brcc .-16 ; 0x3b324 <__ftoa_engine+0x10a> 3b334: e1 0c add r14, r1 3b336: f1 1e adc r15, r17 3b338: 43 1f adc r20, r19 3b33a: 56 1f adc r21, r22 3b33c: c9 1f adc r28, r25 3b33e: d0 1d adc r29, r0 3b340: 7e f4 brtc .+30 ; 0x3b360 <__ftoa_engine+0x146> 3b342: 70 33 cpi r23, 0x30 ; 48 3b344: 11 f4 brne .+4 ; 0x3b34a <__ftoa_engine+0x130> 3b346: 8a 95 dec r24 3b348: e6 cf rjmp .-52 ; 0x3b316 <__ftoa_engine+0xfc> 3b34a: e8 94 clt 3b34c: 01 50 subi r16, 0x01 ; 1 3b34e: 30 f0 brcs .+12 ; 0x3b35c <__ftoa_engine+0x142> 3b350: 08 0f add r16, r24 3b352: 0a f4 brpl .+2 ; 0x3b356 <__ftoa_engine+0x13c> 3b354: 00 27 eor r16, r16 3b356: 02 17 cp r16, r18 3b358: 08 f4 brcc .+2 ; 0x3b35c <__ftoa_engine+0x142> 3b35a: 20 2f mov r18, r16 3b35c: 23 95 inc r18 3b35e: 02 2f mov r16, r18 3b360: 7a 33 cpi r23, 0x3A ; 58 3b362: 28 f0 brcs .+10 ; 0x3b36e <__ftoa_engine+0x154> 3b364: 79 e3 ldi r23, 0x39 ; 57 3b366: 7d 93 st X+, r23 3b368: 2a 95 dec r18 3b36a: e9 f7 brne .-6 ; 0x3b366 <__ftoa_engine+0x14c> 3b36c: 10 c0 rjmp .+32 ; 0x3b38e <__ftoa_engine+0x174> 3b36e: 7d 93 st X+, r23 3b370: 2a 95 dec r18 3b372: 89 f6 brne .-94 ; 0x3b316 <__ftoa_engine+0xfc> 3b374: 06 94 lsr r0 3b376: 97 95 ror r25 3b378: 67 95 ror r22 3b37a: 37 95 ror r19 3b37c: 17 95 ror r17 3b37e: 17 94 ror r1 3b380: e1 18 sub r14, r1 3b382: f1 0a sbc r15, r17 3b384: 43 0b sbc r20, r19 3b386: 56 0b sbc r21, r22 3b388: c9 0b sbc r28, r25 3b38a: d0 09 sbc r29, r0 3b38c: 98 f0 brcs .+38 ; 0x3b3b4 <__ftoa_engine+0x19a> 3b38e: 23 95 inc r18 3b390: 7e 91 ld r23, -X 3b392: 73 95 inc r23 3b394: 7a 33 cpi r23, 0x3A ; 58 3b396: 08 f0 brcs .+2 ; 0x3b39a <__ftoa_engine+0x180> 3b398: 70 e3 ldi r23, 0x30 ; 48 3b39a: 7c 93 st X, r23 3b39c: 20 13 cpse r18, r16 3b39e: b8 f7 brcc .-18 ; 0x3b38e <__ftoa_engine+0x174> 3b3a0: 7e 91 ld r23, -X 3b3a2: 70 61 ori r23, 0x10 ; 16 3b3a4: 7d 93 st X+, r23 3b3a6: 30 f0 brcs .+12 ; 0x3b3b4 <__ftoa_engine+0x19a> 3b3a8: 83 95 inc r24 3b3aa: 71 e3 ldi r23, 0x31 ; 49 3b3ac: 7d 93 st X+, r23 3b3ae: 70 e3 ldi r23, 0x30 ; 48 3b3b0: 2a 95 dec r18 3b3b2: e1 f7 brne .-8 ; 0x3b3ac <__ftoa_engine+0x192> 3b3b4: 11 24 eor r1, r1 3b3b6: ef 90 pop r14 3b3b8: ff 90 pop r15 3b3ba: 0f 91 pop r16 3b3bc: 1f 91 pop r17 3b3be: cf 91 pop r28 3b3c0: df 91 pop r29 3b3c2: 99 27 eor r25, r25 3b3c4: 87 fd sbrc r24, 7 3b3c6: 90 95 com r25 3b3c8: 08 95 ret 0003b3ca : 3b3ca: 91 11 cpse r25, r1 3b3cc: 0d 94 41 dc jmp 0x3b882 ; 0x3b882 <__ctype_isfalse> 3b3d0: 80 32 cpi r24, 0x20 ; 32 3b3d2: 19 f0 breq .+6 ; 0x3b3da 3b3d4: 89 50 subi r24, 0x09 ; 9 3b3d6: 85 50 subi r24, 0x05 ; 5 3b3d8: c8 f7 brcc .-14 ; 0x3b3cc 3b3da: 08 95 ret 0003b3dc : 3b3dc: fb 01 movw r30, r22 3b3de: dc 01 movw r26, r24 3b3e0: 02 c0 rjmp .+4 ; 0x3b3e6 3b3e2: 05 90 lpm r0, Z+ 3b3e4: 0d 92 st X+, r0 3b3e6: 41 50 subi r20, 0x01 ; 1 3b3e8: 50 40 sbci r21, 0x00 ; 0 3b3ea: d8 f7 brcc .-10 ; 0x3b3e2 3b3ec: 08 95 ret 0003b3ee : 3b3ee: fb 01 movw r30, r22 3b3f0: dc 01 movw r26, r24 3b3f2: 0d 90 ld r0, X+ 3b3f4: 00 20 and r0, r0 3b3f6: e9 f7 brne .-6 ; 0x3b3f2 3b3f8: 11 97 sbiw r26, 0x01 ; 1 3b3fa: 05 90 lpm r0, Z+ 3b3fc: 0d 92 st X+, r0 3b3fe: 00 20 and r0, r0 3b400: e1 f7 brne .-8 ; 0x3b3fa 3b402: 08 95 ret 0003b404 : 3b404: fb 01 movw r30, r22 3b406: dc 01 movw r26, r24 3b408: 8d 91 ld r24, X+ 3b40a: 05 90 lpm r0, Z+ 3b40c: 80 19 sub r24, r0 3b40e: 01 10 cpse r0, r1 3b410: d9 f3 breq .-10 ; 0x3b408 3b412: 99 0b sbc r25, r25 3b414: 08 95 ret 0003b416 : 3b416: fb 01 movw r30, r22 3b418: dc 01 movw r26, r24 3b41a: 05 90 lpm r0, Z+ 3b41c: 0d 92 st X+, r0 3b41e: 00 20 and r0, r0 3b420: e1 f7 brne .-8 ; 0x3b41a 3b422: 08 95 ret 0003b424 <__strlen_P>: 3b424: fc 01 movw r30, r24 3b426: 05 90 lpm r0, Z+ 3b428: 00 20 and r0, r0 3b42a: e9 f7 brne .-6 ; 0x3b426 <__strlen_P+0x2> 3b42c: 80 95 com r24 3b42e: 90 95 com r25 3b430: 8e 0f add r24, r30 3b432: 9f 1f adc r25, r31 3b434: 08 95 ret 0003b436 : 3b436: fb 01 movw r30, r22 3b438: dc 01 movw r26, r24 3b43a: 41 50 subi r20, 0x01 ; 1 3b43c: 50 40 sbci r21, 0x00 ; 0 3b43e: 88 f0 brcs .+34 ; 0x3b462 3b440: 8d 91 ld r24, X+ 3b442: 81 34 cpi r24, 0x41 ; 65 3b444: 1c f0 brlt .+6 ; 0x3b44c 3b446: 8b 35 cpi r24, 0x5B ; 91 3b448: 0c f4 brge .+2 ; 0x3b44c 3b44a: 80 5e subi r24, 0xE0 ; 224 3b44c: 65 91 lpm r22, Z+ 3b44e: 61 34 cpi r22, 0x41 ; 65 3b450: 1c f0 brlt .+6 ; 0x3b458 3b452: 6b 35 cpi r22, 0x5B ; 91 3b454: 0c f4 brge .+2 ; 0x3b458 3b456: 60 5e subi r22, 0xE0 ; 224 3b458: 86 1b sub r24, r22 3b45a: 61 11 cpse r22, r1 3b45c: 71 f3 breq .-36 ; 0x3b43a 3b45e: 99 0b sbc r25, r25 3b460: 08 95 ret 3b462: 88 1b sub r24, r24 3b464: fc cf rjmp .-8 ; 0x3b45e 0003b466 : 3b466: fb 01 movw r30, r22 3b468: dc 01 movw r26, r24 3b46a: 41 50 subi r20, 0x01 ; 1 3b46c: 50 40 sbci r21, 0x00 ; 0 3b46e: 30 f0 brcs .+12 ; 0x3b47c 3b470: 8d 91 ld r24, X+ 3b472: 05 90 lpm r0, Z+ 3b474: 80 19 sub r24, r0 3b476: 19 f4 brne .+6 ; 0x3b47e 3b478: 00 20 and r0, r0 3b47a: b9 f7 brne .-18 ; 0x3b46a 3b47c: 88 1b sub r24, r24 3b47e: 99 0b sbc r25, r25 3b480: 08 95 ret 0003b482 : 3b482: fb 01 movw r30, r22 3b484: dc 01 movw r26, r24 3b486: 41 50 subi r20, 0x01 ; 1 3b488: 50 40 sbci r21, 0x00 ; 0 3b48a: 48 f0 brcs .+18 ; 0x3b49e 3b48c: 05 90 lpm r0, Z+ 3b48e: 0d 92 st X+, r0 3b490: 00 20 and r0, r0 3b492: c9 f7 brne .-14 ; 0x3b486 3b494: 01 c0 rjmp .+2 ; 0x3b498 3b496: 1d 92 st X+, r1 3b498: 41 50 subi r20, 0x01 ; 1 3b49a: 50 40 sbci r21, 0x00 ; 0 3b49c: e0 f7 brcc .-8 ; 0x3b496 3b49e: 08 95 ret 0003b4a0 : 3b4a0: fc 01 movw r30, r24 3b4a2: 05 90 lpm r0, Z+ 3b4a4: 61 50 subi r22, 0x01 ; 1 3b4a6: 70 40 sbci r23, 0x00 ; 0 3b4a8: 01 10 cpse r0, r1 3b4aa: d8 f7 brcc .-10 ; 0x3b4a2 3b4ac: 80 95 com r24 3b4ae: 90 95 com r25 3b4b0: 8e 0f add r24, r30 3b4b2: 9f 1f adc r25, r31 3b4b4: 08 95 ret 0003b4b6 : 3b4b6: fb 01 movw r30, r22 3b4b8: 55 91 lpm r21, Z+ 3b4ba: 55 23 and r21, r21 3b4bc: a9 f0 breq .+42 ; 0x3b4e8 3b4be: bf 01 movw r22, r30 3b4c0: dc 01 movw r26, r24 3b4c2: 4d 91 ld r20, X+ 3b4c4: 45 17 cp r20, r21 3b4c6: 41 11 cpse r20, r1 3b4c8: e1 f7 brne .-8 ; 0x3b4c2 3b4ca: 59 f4 brne .+22 ; 0x3b4e2 3b4cc: cd 01 movw r24, r26 3b4ce: 05 90 lpm r0, Z+ 3b4d0: 00 20 and r0, r0 3b4d2: 49 f0 breq .+18 ; 0x3b4e6 3b4d4: 4d 91 ld r20, X+ 3b4d6: 40 15 cp r20, r0 3b4d8: 41 11 cpse r20, r1 3b4da: c9 f3 breq .-14 ; 0x3b4ce 3b4dc: fb 01 movw r30, r22 3b4de: 41 11 cpse r20, r1 3b4e0: ef cf rjmp .-34 ; 0x3b4c0 3b4e2: 81 e0 ldi r24, 0x01 ; 1 3b4e4: 90 e0 ldi r25, 0x00 ; 0 3b4e6: 01 97 sbiw r24, 0x01 ; 1 3b4e8: 08 95 ret 0003b4ea : 3b4ea: fc 01 movw r30, r24 3b4ec: 61 50 subi r22, 0x01 ; 1 3b4ee: 70 40 sbci r23, 0x00 ; 0 3b4f0: 01 90 ld r0, Z+ 3b4f2: 01 10 cpse r0, r1 3b4f4: d8 f7 brcc .-10 ; 0x3b4ec 3b4f6: 80 95 com r24 3b4f8: 90 95 com r25 3b4fa: 8e 0f add r24, r30 3b4fc: 9f 1f adc r25, r31 3b4fe: 08 95 ret 0003b500 : 3b500: cf 93 push r28 3b502: df 93 push r29 3b504: ec 01 movw r28, r24 3b506: 2b 81 ldd r18, Y+3 ; 0x03 3b508: 20 ff sbrs r18, 0 3b50a: 1a c0 rjmp .+52 ; 0x3b540 3b50c: 26 ff sbrs r18, 6 3b50e: 0c c0 rjmp .+24 ; 0x3b528 3b510: 2f 7b andi r18, 0xBF ; 191 3b512: 2b 83 std Y+3, r18 ; 0x03 3b514: 8e 81 ldd r24, Y+6 ; 0x06 3b516: 9f 81 ldd r25, Y+7 ; 0x07 3b518: 01 96 adiw r24, 0x01 ; 1 3b51a: 9f 83 std Y+7, r25 ; 0x07 3b51c: 8e 83 std Y+6, r24 ; 0x06 3b51e: 8a 81 ldd r24, Y+2 ; 0x02 3b520: 90 e0 ldi r25, 0x00 ; 0 3b522: df 91 pop r29 3b524: cf 91 pop r28 3b526: 08 95 ret 3b528: 22 ff sbrs r18, 2 3b52a: 18 c0 rjmp .+48 ; 0x3b55c 3b52c: e8 81 ld r30, Y 3b52e: f9 81 ldd r31, Y+1 ; 0x01 3b530: 80 81 ld r24, Z 3b532: 08 2e mov r0, r24 3b534: 00 0c add r0, r0 3b536: 99 0b sbc r25, r25 3b538: 00 97 sbiw r24, 0x00 ; 0 3b53a: 29 f4 brne .+10 ; 0x3b546 3b53c: 20 62 ori r18, 0x20 ; 32 3b53e: 2b 83 std Y+3, r18 ; 0x03 3b540: 8f ef ldi r24, 0xFF ; 255 3b542: 9f ef ldi r25, 0xFF ; 255 3b544: ee cf rjmp .-36 ; 0x3b522 3b546: 31 96 adiw r30, 0x01 ; 1 3b548: f9 83 std Y+1, r31 ; 0x01 3b54a: e8 83 st Y, r30 3b54c: 2e 81 ldd r18, Y+6 ; 0x06 3b54e: 3f 81 ldd r19, Y+7 ; 0x07 3b550: 2f 5f subi r18, 0xFF ; 255 3b552: 3f 4f sbci r19, 0xFF ; 255 3b554: 3f 83 std Y+7, r19 ; 0x07 3b556: 2e 83 std Y+6, r18 ; 0x06 3b558: 99 27 eor r25, r25 3b55a: e3 cf rjmp .-58 ; 0x3b522 3b55c: ea 85 ldd r30, Y+10 ; 0x0a 3b55e: fb 85 ldd r31, Y+11 ; 0x0b 3b560: 19 95 eicall 3b562: 97 ff sbrs r25, 7 3b564: f3 cf rjmp .-26 ; 0x3b54c 3b566: 2b 81 ldd r18, Y+3 ; 0x03 3b568: 01 96 adiw r24, 0x01 ; 1 3b56a: 21 f0 breq .+8 ; 0x3b574 3b56c: 80 e2 ldi r24, 0x20 ; 32 3b56e: 82 2b or r24, r18 3b570: 8b 83 std Y+3, r24 ; 0x03 3b572: e6 cf rjmp .-52 ; 0x3b540 3b574: 80 e1 ldi r24, 0x10 ; 16 3b576: fb cf rjmp .-10 ; 0x3b56e 0003b578 : 3b578: 0f 93 push r16 3b57a: 1f 93 push r17 3b57c: cf 93 push r28 3b57e: df 93 push r29 3b580: 18 2f mov r17, r24 3b582: 09 2f mov r16, r25 3b584: eb 01 movw r28, r22 3b586: 8b 81 ldd r24, Y+3 ; 0x03 3b588: 81 fd sbrc r24, 1 3b58a: 09 c0 rjmp .+18 ; 0x3b59e 3b58c: 1f ef ldi r17, 0xFF ; 255 3b58e: 0f ef ldi r16, 0xFF ; 255 3b590: 81 2f mov r24, r17 3b592: 90 2f mov r25, r16 3b594: df 91 pop r29 3b596: cf 91 pop r28 3b598: 1f 91 pop r17 3b59a: 0f 91 pop r16 3b59c: 08 95 ret 3b59e: 82 ff sbrs r24, 2 3b5a0: 14 c0 rjmp .+40 ; 0x3b5ca 3b5a2: 2e 81 ldd r18, Y+6 ; 0x06 3b5a4: 3f 81 ldd r19, Y+7 ; 0x07 3b5a6: 8c 81 ldd r24, Y+4 ; 0x04 3b5a8: 9d 81 ldd r25, Y+5 ; 0x05 3b5aa: 28 17 cp r18, r24 3b5ac: 39 07 cpc r19, r25 3b5ae: 3c f4 brge .+14 ; 0x3b5be 3b5b0: e8 81 ld r30, Y 3b5b2: f9 81 ldd r31, Y+1 ; 0x01 3b5b4: cf 01 movw r24, r30 3b5b6: 01 96 adiw r24, 0x01 ; 1 3b5b8: 99 83 std Y+1, r25 ; 0x01 3b5ba: 88 83 st Y, r24 3b5bc: 10 83 st Z, r17 3b5be: 8e 81 ldd r24, Y+6 ; 0x06 3b5c0: 9f 81 ldd r25, Y+7 ; 0x07 3b5c2: 01 96 adiw r24, 0x01 ; 1 3b5c4: 9f 83 std Y+7, r25 ; 0x07 3b5c6: 8e 83 std Y+6, r24 ; 0x06 3b5c8: e3 cf rjmp .-58 ; 0x3b590 3b5ca: e8 85 ldd r30, Y+8 ; 0x08 3b5cc: f9 85 ldd r31, Y+9 ; 0x09 3b5ce: 81 2f mov r24, r17 3b5d0: 19 95 eicall 3b5d2: 89 2b or r24, r25 3b5d4: a1 f3 breq .-24 ; 0x3b5be 3b5d6: da cf rjmp .-76 ; 0x3b58c 0003b5d8 : 3b5d8: ef 92 push r14 3b5da: ff 92 push r15 3b5dc: 0f 93 push r16 3b5de: 1f 93 push r17 3b5e0: cf 93 push r28 3b5e2: df 93 push r29 3b5e4: 8c 01 movw r16, r24 3b5e6: 7b 01 movw r14, r22 3b5e8: db 01 movw r26, r22 3b5ea: 13 96 adiw r26, 0x03 ; 3 3b5ec: 8c 91 ld r24, X 3b5ee: d0 e0 ldi r29, 0x00 ; 0 3b5f0: c0 e0 ldi r28, 0x00 ; 0 3b5f2: 81 fd sbrc r24, 1 3b5f4: 0f c0 rjmp .+30 ; 0x3b614 3b5f6: cf ef ldi r28, 0xFF ; 255 3b5f8: df ef ldi r29, 0xFF ; 255 3b5fa: 10 c0 rjmp .+32 ; 0x3b61c 3b5fc: d7 01 movw r26, r14 3b5fe: 18 96 adiw r26, 0x08 ; 8 3b600: ed 91 ld r30, X+ 3b602: fc 91 ld r31, X 3b604: b7 01 movw r22, r14 3b606: 19 95 eicall 3b608: 89 2b or r24, r25 3b60a: 11 f0 breq .+4 ; 0x3b610 3b60c: cf ef ldi r28, 0xFF ; 255 3b60e: df ef ldi r29, 0xFF ; 255 3b610: 0f 5f subi r16, 0xFF ; 255 3b612: 1f 4f sbci r17, 0xFF ; 255 3b614: f8 01 movw r30, r16 3b616: 84 91 lpm r24, Z 3b618: 81 11 cpse r24, r1 3b61a: f0 cf rjmp .-32 ; 0x3b5fc 3b61c: ce 01 movw r24, r28 3b61e: df 91 pop r29 3b620: cf 91 pop r28 3b622: 1f 91 pop r17 3b624: 0f 91 pop r16 3b626: ff 90 pop r15 3b628: ef 90 pop r14 3b62a: 08 95 ret 0003b62c : 3b62c: 0f 93 push r16 3b62e: 1f 93 push r17 3b630: cf 93 push r28 3b632: df 93 push r29 3b634: cd b7 in r28, 0x3d ; 61 3b636: de b7 in r29, 0x3e ; 62 3b638: ae 01 movw r20, r28 3b63a: 48 5f subi r20, 0xF8 ; 248 3b63c: 5f 4f sbci r21, 0xFF ; 255 3b63e: da 01 movw r26, r20 3b640: 6d 91 ld r22, X+ 3b642: 7d 91 ld r23, X+ 3b644: ad 01 movw r20, r26 3b646: 0a e1 ldi r16, 0x1A ; 26 3b648: 18 e1 ldi r17, 0x18 ; 24 3b64a: f8 01 movw r30, r16 3b64c: 82 81 ldd r24, Z+2 ; 0x02 3b64e: 93 81 ldd r25, Z+3 ; 0x03 3b650: dc 01 movw r26, r24 3b652: 13 96 adiw r26, 0x03 ; 3 3b654: 2c 91 ld r18, X 3b656: 13 97 sbiw r26, 0x03 ; 3 3b658: 28 60 ori r18, 0x08 ; 8 3b65a: 13 96 adiw r26, 0x03 ; 3 3b65c: 2c 93 st X, r18 3b65e: 0e 94 69 56 call 0xacd2 ; 0xacd2 3b662: d8 01 movw r26, r16 3b664: 12 96 adiw r26, 0x02 ; 2 3b666: ed 91 ld r30, X+ 3b668: fc 91 ld r31, X 3b66a: 23 81 ldd r18, Z+3 ; 0x03 3b66c: 27 7f andi r18, 0xF7 ; 247 3b66e: 23 83 std Z+3, r18 ; 0x03 3b670: df 91 pop r29 3b672: cf 91 pop r28 3b674: 1f 91 pop r17 3b676: 0f 91 pop r16 3b678: 08 95 ret 0003b67a : 3b67a: 0f 93 push r16 3b67c: 1f 93 push r17 3b67e: cf 93 push r28 3b680: df 93 push r29 3b682: 8c 01 movw r16, r24 3b684: e0 91 1c 18 lds r30, 0x181C ; 0x80181c <__iob+0x2> 3b688: f0 91 1d 18 lds r31, 0x181D ; 0x80181d <__iob+0x3> 3b68c: 83 81 ldd r24, Z+3 ; 0x03 3b68e: d0 e0 ldi r29, 0x00 ; 0 3b690: c0 e0 ldi r28, 0x00 ; 0 3b692: 81 fd sbrc r24, 1 3b694: 0a c0 rjmp .+20 ; 0x3b6aa 3b696: cf ef ldi r28, 0xFF ; 255 3b698: df ef ldi r29, 0xFF ; 255 3b69a: 17 c0 rjmp .+46 ; 0x3b6ca 3b69c: 19 95 eicall 3b69e: 89 2b or r24, r25 3b6a0: 11 f0 breq .+4 ; 0x3b6a6 3b6a2: cf ef ldi r28, 0xFF ; 255 3b6a4: df ef ldi r29, 0xFF ; 255 3b6a6: 0f 5f subi r16, 0xFF ; 255 3b6a8: 1f 4f sbci r17, 0xFF ; 255 3b6aa: f8 01 movw r30, r16 3b6ac: 84 91 lpm r24, Z 3b6ae: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 3b6b2: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 3b6b6: db 01 movw r26, r22 3b6b8: 18 96 adiw r26, 0x08 ; 8 3b6ba: ed 91 ld r30, X+ 3b6bc: fc 91 ld r31, X 3b6be: 81 11 cpse r24, r1 3b6c0: ed cf rjmp .-38 ; 0x3b69c 3b6c2: 8a e0 ldi r24, 0x0A ; 10 3b6c4: 19 95 eicall 3b6c6: 89 2b or r24, r25 3b6c8: 31 f7 brne .-52 ; 0x3b696 3b6ca: ce 01 movw r24, r28 3b6cc: df 91 pop r29 3b6ce: cf 91 pop r28 3b6d0: 1f 91 pop r17 3b6d2: 0f 91 pop r16 3b6d4: 08 95 ret 0003b6d6 : 3b6d6: 0f 93 push r16 3b6d8: 1f 93 push r17 3b6da: cf 93 push r28 3b6dc: df 93 push r29 3b6de: cd b7 in r28, 0x3d ; 61 3b6e0: de b7 in r29, 0x3e ; 62 3b6e2: 2e 97 sbiw r28, 0x0e ; 14 3b6e4: 0f b6 in r0, 0x3f ; 63 3b6e6: f8 94 cli 3b6e8: de bf out 0x3e, r29 ; 62 3b6ea: 0f be out 0x3f, r0 ; 63 3b6ec: cd bf out 0x3d, r28 ; 61 3b6ee: 0e 89 ldd r16, Y+22 ; 0x16 3b6f0: 1f 89 ldd r17, Y+23 ; 0x17 3b6f2: 8e e0 ldi r24, 0x0E ; 14 3b6f4: 8c 83 std Y+4, r24 ; 0x04 3b6f6: 1a 83 std Y+2, r17 ; 0x02 3b6f8: 09 83 std Y+1, r16 ; 0x01 3b6fa: 8f ef ldi r24, 0xFF ; 255 3b6fc: 9f e7 ldi r25, 0x7F ; 127 3b6fe: 9e 83 std Y+6, r25 ; 0x06 3b700: 8d 83 std Y+5, r24 ; 0x05 3b702: ae 01 movw r20, r28 3b704: 46 5e subi r20, 0xE6 ; 230 3b706: 5f 4f sbci r21, 0xFF ; 255 3b708: 68 8d ldd r22, Y+24 ; 0x18 3b70a: 79 8d ldd r23, Y+25 ; 0x19 3b70c: ce 01 movw r24, r28 3b70e: 01 96 adiw r24, 0x01 ; 1 3b710: 0e 94 69 56 call 0xacd2 ; 0xacd2 3b714: 2f 81 ldd r18, Y+7 ; 0x07 3b716: 38 85 ldd r19, Y+8 ; 0x08 3b718: 02 0f add r16, r18 3b71a: 13 1f adc r17, r19 3b71c: f8 01 movw r30, r16 3b71e: 10 82 st Z, r1 3b720: 2e 96 adiw r28, 0x0e ; 14 3b722: 0f b6 in r0, 0x3f ; 63 3b724: f8 94 cli 3b726: de bf out 0x3e, r29 ; 62 3b728: 0f be out 0x3f, r0 ; 63 3b72a: cd bf out 0x3d, r28 ; 61 3b72c: df 91 pop r29 3b72e: cf 91 pop r28 3b730: 1f 91 pop r17 3b732: 0f 91 pop r16 3b734: 08 95 ret 0003b736 : 3b736: cf 93 push r28 3b738: df 93 push r29 3b73a: ec 01 movw r28, r24 3b73c: 8b 81 ldd r24, Y+3 ; 0x03 3b73e: 88 60 ori r24, 0x08 ; 8 3b740: 8b 83 std Y+3, r24 ; 0x03 3b742: ce 01 movw r24, r28 3b744: 0e 94 69 56 call 0xacd2 ; 0xacd2 3b748: 2b 81 ldd r18, Y+3 ; 0x03 3b74a: 27 7f andi r18, 0xF7 ; 247 3b74c: 2b 83 std Y+3, r18 ; 0x03 3b74e: df 91 pop r29 3b750: cf 91 pop r28 3b752: 08 95 ret 0003b754 : 3b754: 0f 93 push r16 3b756: 1f 93 push r17 3b758: cf 93 push r28 3b75a: df 93 push r29 3b75c: cd b7 in r28, 0x3d ; 61 3b75e: de b7 in r29, 0x3e ; 62 3b760: 2e 97 sbiw r28, 0x0e ; 14 3b762: 0f b6 in r0, 0x3f ; 63 3b764: f8 94 cli 3b766: de bf out 0x3e, r29 ; 62 3b768: 0f be out 0x3f, r0 ; 63 3b76a: cd bf out 0x3d, r28 ; 61 3b76c: 8c 01 movw r16, r24 3b76e: fa 01 movw r30, r20 3b770: 8e e0 ldi r24, 0x0E ; 14 3b772: 8c 83 std Y+4, r24 ; 0x04 3b774: 1a 83 std Y+2, r17 ; 0x02 3b776: 09 83 std Y+1, r16 ; 0x01 3b778: 77 ff sbrs r23, 7 3b77a: 02 c0 rjmp .+4 ; 0x3b780 3b77c: 60 e0 ldi r22, 0x00 ; 0 3b77e: 70 e8 ldi r23, 0x80 ; 128 3b780: 61 50 subi r22, 0x01 ; 1 3b782: 71 09 sbc r23, r1 3b784: 7e 83 std Y+6, r23 ; 0x06 3b786: 6d 83 std Y+5, r22 ; 0x05 3b788: a9 01 movw r20, r18 3b78a: bf 01 movw r22, r30 3b78c: ce 01 movw r24, r28 3b78e: 01 96 adiw r24, 0x01 ; 1 3b790: 0e 94 69 56 call 0xacd2 ; 0xacd2 3b794: 4d 81 ldd r20, Y+5 ; 0x05 3b796: 5e 81 ldd r21, Y+6 ; 0x06 3b798: 57 fd sbrc r21, 7 3b79a: 0a c0 rjmp .+20 ; 0x3b7b0 3b79c: 2f 81 ldd r18, Y+7 ; 0x07 3b79e: 38 85 ldd r19, Y+8 ; 0x08 3b7a0: 42 17 cp r20, r18 3b7a2: 53 07 cpc r21, r19 3b7a4: 0c f4 brge .+2 ; 0x3b7a8 3b7a6: 9a 01 movw r18, r20 3b7a8: 02 0f add r16, r18 3b7aa: 13 1f adc r17, r19 3b7ac: f8 01 movw r30, r16 3b7ae: 10 82 st Z, r1 3b7b0: 2e 96 adiw r28, 0x0e ; 14 3b7b2: 0f b6 in r0, 0x3f ; 63 3b7b4: f8 94 cli 3b7b6: de bf out 0x3e, r29 ; 62 3b7b8: 0f be out 0x3f, r0 ; 63 3b7ba: cd bf out 0x3d, r28 ; 61 3b7bc: df 91 pop r29 3b7be: cf 91 pop r28 3b7c0: 1f 91 pop r17 3b7c2: 0f 91 pop r16 3b7c4: 08 95 ret 0003b7c6 <__ultoa_invert>: 3b7c6: fa 01 movw r30, r20 3b7c8: aa 27 eor r26, r26 3b7ca: 28 30 cpi r18, 0x08 ; 8 3b7cc: 51 f1 breq .+84 ; 0x3b822 <__ultoa_invert+0x5c> 3b7ce: 20 31 cpi r18, 0x10 ; 16 3b7d0: 81 f1 breq .+96 ; 0x3b832 <__ultoa_invert+0x6c> 3b7d2: e8 94 clt 3b7d4: 6f 93 push r22 3b7d6: 6e 7f andi r22, 0xFE ; 254 3b7d8: 6e 5f subi r22, 0xFE ; 254 3b7da: 7f 4f sbci r23, 0xFF ; 255 3b7dc: 8f 4f sbci r24, 0xFF ; 255 3b7de: 9f 4f sbci r25, 0xFF ; 255 3b7e0: af 4f sbci r26, 0xFF ; 255 3b7e2: b1 e0 ldi r27, 0x01 ; 1 3b7e4: 3e d0 rcall .+124 ; 0x3b862 <__ultoa_invert+0x9c> 3b7e6: b4 e0 ldi r27, 0x04 ; 4 3b7e8: 3c d0 rcall .+120 ; 0x3b862 <__ultoa_invert+0x9c> 3b7ea: 67 0f add r22, r23 3b7ec: 78 1f adc r23, r24 3b7ee: 89 1f adc r24, r25 3b7f0: 9a 1f adc r25, r26 3b7f2: a1 1d adc r26, r1 3b7f4: 68 0f add r22, r24 3b7f6: 79 1f adc r23, r25 3b7f8: 8a 1f adc r24, r26 3b7fa: 91 1d adc r25, r1 3b7fc: a1 1d adc r26, r1 3b7fe: 6a 0f add r22, r26 3b800: 71 1d adc r23, r1 3b802: 81 1d adc r24, r1 3b804: 91 1d adc r25, r1 3b806: a1 1d adc r26, r1 3b808: 20 d0 rcall .+64 ; 0x3b84a <__ultoa_invert+0x84> 3b80a: 09 f4 brne .+2 ; 0x3b80e <__ultoa_invert+0x48> 3b80c: 68 94 set 3b80e: 3f 91 pop r19 3b810: 2a e0 ldi r18, 0x0A ; 10 3b812: 26 9f mul r18, r22 3b814: 11 24 eor r1, r1 3b816: 30 19 sub r19, r0 3b818: 30 5d subi r19, 0xD0 ; 208 3b81a: 31 93 st Z+, r19 3b81c: de f6 brtc .-74 ; 0x3b7d4 <__ultoa_invert+0xe> 3b81e: cf 01 movw r24, r30 3b820: 08 95 ret 3b822: 46 2f mov r20, r22 3b824: 47 70 andi r20, 0x07 ; 7 3b826: 40 5d subi r20, 0xD0 ; 208 3b828: 41 93 st Z+, r20 3b82a: b3 e0 ldi r27, 0x03 ; 3 3b82c: 0f d0 rcall .+30 ; 0x3b84c <__ultoa_invert+0x86> 3b82e: c9 f7 brne .-14 ; 0x3b822 <__ultoa_invert+0x5c> 3b830: f6 cf rjmp .-20 ; 0x3b81e <__ultoa_invert+0x58> 3b832: 46 2f mov r20, r22 3b834: 4f 70 andi r20, 0x0F ; 15 3b836: 40 5d subi r20, 0xD0 ; 208 3b838: 4a 33 cpi r20, 0x3A ; 58 3b83a: 18 f0 brcs .+6 ; 0x3b842 <__ultoa_invert+0x7c> 3b83c: 49 5d subi r20, 0xD9 ; 217 3b83e: 31 fd sbrc r19, 1 3b840: 40 52 subi r20, 0x20 ; 32 3b842: 41 93 st Z+, r20 3b844: 02 d0 rcall .+4 ; 0x3b84a <__ultoa_invert+0x84> 3b846: a9 f7 brne .-22 ; 0x3b832 <__ultoa_invert+0x6c> 3b848: ea cf rjmp .-44 ; 0x3b81e <__ultoa_invert+0x58> 3b84a: b4 e0 ldi r27, 0x04 ; 4 3b84c: a6 95 lsr r26 3b84e: 97 95 ror r25 3b850: 87 95 ror r24 3b852: 77 95 ror r23 3b854: 67 95 ror r22 3b856: ba 95 dec r27 3b858: c9 f7 brne .-14 ; 0x3b84c <__ultoa_invert+0x86> 3b85a: 00 97 sbiw r24, 0x00 ; 0 3b85c: 61 05 cpc r22, r1 3b85e: 71 05 cpc r23, r1 3b860: 08 95 ret 3b862: 9b 01 movw r18, r22 3b864: ac 01 movw r20, r24 3b866: 0a 2e mov r0, r26 3b868: 06 94 lsr r0 3b86a: 57 95 ror r21 3b86c: 47 95 ror r20 3b86e: 37 95 ror r19 3b870: 27 95 ror r18 3b872: ba 95 dec r27 3b874: c9 f7 brne .-14 ; 0x3b868 <__ultoa_invert+0xa2> 3b876: 62 0f add r22, r18 3b878: 73 1f adc r23, r19 3b87a: 84 1f adc r24, r20 3b87c: 95 1f adc r25, r21 3b87e: a0 1d adc r26, r0 3b880: 08 95 ret 0003b882 <__ctype_isfalse>: 3b882: 99 27 eor r25, r25 3b884: 88 27 eor r24, r24 0003b886 <__ctype_istrue>: 3b886: 08 95 ret 0003b888 : 3b888: dc 01 movw r26, r24 3b88a: cb 01 movw r24, r22 0003b88c : 3b88c: fc 01 movw r30, r24 3b88e: f9 99 sbic 0x1f, 1 ; 31 3b890: fe cf rjmp .-4 ; 0x3b88e 3b892: 06 c0 rjmp .+12 ; 0x3b8a0 3b894: f2 bd out 0x22, r31 ; 34 3b896: e1 bd out 0x21, r30 ; 33 3b898: f8 9a sbi 0x1f, 0 ; 31 3b89a: 31 96 adiw r30, 0x01 ; 1 3b89c: 00 b4 in r0, 0x20 ; 32 3b89e: 0d 92 st X+, r0 3b8a0: 41 50 subi r20, 0x01 ; 1 3b8a2: 50 40 sbci r21, 0x00 ; 0 3b8a4: b8 f7 brcc .-18 ; 0x3b894 3b8a6: 08 95 ret 0003b8a8 : 3b8a8: f9 99 sbic 0x1f, 1 ; 31 3b8aa: fe cf rjmp .-4 ; 0x3b8a8 3b8ac: 92 bd out 0x22, r25 ; 34 3b8ae: 81 bd out 0x21, r24 ; 33 3b8b0: f8 9a sbi 0x1f, 0 ; 31 3b8b2: 99 27 eor r25, r25 3b8b4: 80 b5 in r24, 0x20 ; 32 3b8b6: 08 95 ret 0003b8b8 : 3b8b8: a6 e1 ldi r26, 0x16 ; 22 3b8ba: b0 e0 ldi r27, 0x00 ; 0 3b8bc: 44 e0 ldi r20, 0x04 ; 4 3b8be: 50 e0 ldi r21, 0x00 ; 0 3b8c0: 0d 94 46 dc jmp 0x3b88c ; 0x3b88c 0003b8c4 : 3b8c4: a8 e1 ldi r26, 0x18 ; 24 3b8c6: b0 e0 ldi r27, 0x00 ; 0 3b8c8: 42 e0 ldi r20, 0x02 ; 2 3b8ca: 50 e0 ldi r21, 0x00 ; 0 3b8cc: 0d 94 46 dc jmp 0x3b88c ; 0x3b88c 0003b8d0 : 3b8d0: dc 01 movw r26, r24 3b8d2: a4 0f add r26, r20 3b8d4: b5 1f adc r27, r21 3b8d6: 41 50 subi r20, 0x01 ; 1 3b8d8: 50 40 sbci r21, 0x00 ; 0 3b8da: 48 f0 brcs .+18 ; 0x3b8ee 3b8dc: cb 01 movw r24, r22 3b8de: 84 0f add r24, r20 3b8e0: 95 1f adc r25, r21 3b8e2: 2e 91 ld r18, -X 3b8e4: 0f 94 79 dc call 0x3b8f2 ; 0x3b8f2 3b8e8: 41 50 subi r20, 0x01 ; 1 3b8ea: 50 40 sbci r21, 0x00 ; 0 3b8ec: d0 f7 brcc .-12 ; 0x3b8e2 3b8ee: 08 95 ret 0003b8f0 : 3b8f0: 26 2f mov r18, r22 0003b8f2 : 3b8f2: f9 99 sbic 0x1f, 1 ; 31 3b8f4: fe cf rjmp .-4 ; 0x3b8f2 3b8f6: 92 bd out 0x22, r25 ; 34 3b8f8: 81 bd out 0x21, r24 ; 33 3b8fa: f8 9a sbi 0x1f, 0 ; 31 3b8fc: 01 97 sbiw r24, 0x01 ; 1 3b8fe: 00 b4 in r0, 0x20 ; 32 3b900: 02 16 cp r0, r18 3b902: 39 f0 breq .+14 ; 0x3b912 3b904: 1f ba out 0x1f, r1 ; 31 3b906: 20 bd out 0x20, r18 ; 32 3b908: 0f b6 in r0, 0x3f ; 63 3b90a: f8 94 cli 3b90c: fa 9a sbi 0x1f, 2 ; 31 3b90e: f9 9a sbi 0x1f, 1 ; 31 3b910: 0f be out 0x3f, r0 ; 63 3b912: 08 95 ret 0003b914 : 3b914: 03 96 adiw r24, 0x03 ; 3 3b916: 27 2f mov r18, r23 3b918: 0f 94 79 dc call 0x3b8f2 ; 0x3b8f2 3b91c: 0f 94 78 dc call 0x3b8f0 ; 0x3b8f0 3b920: 25 2f mov r18, r21 3b922: 0f 94 79 dc call 0x3b8f2 ; 0x3b8f2 3b926: 24 2f mov r18, r20 3b928: 0d 94 79 dc jmp 0x3b8f2 ; 0x3b8f2 0003b92c : 3b92c: 01 96 adiw r24, 0x01 ; 1 3b92e: 27 2f mov r18, r23 3b930: 0f 94 79 dc call 0x3b8f2 ; 0x3b8f2 3b934: 0d 94 78 dc jmp 0x3b8f0 ; 0x3b8f0 0003b938 : 3b938: 26 2f mov r18, r22 0003b93a : 3b93a: f9 99 sbic 0x1f, 1 ; 31 3b93c: fe cf rjmp .-4 ; 0x3b93a 3b93e: 1f ba out 0x1f, r1 ; 31 3b940: 92 bd out 0x22, r25 ; 34 3b942: 81 bd out 0x21, r24 ; 33 3b944: 20 bd out 0x20, r18 ; 32 3b946: 0f b6 in r0, 0x3f ; 63 3b948: f8 94 cli 3b94a: fa 9a sbi 0x1f, 2 ; 31 3b94c: f9 9a sbi 0x1f, 1 ; 31 3b94e: 0f be out 0x3f, r0 ; 63 3b950: 01 96 adiw r24, 0x01 ; 1 3b952: 08 95 ret 0003b954 : 3b954: 24 2f mov r18, r20 3b956: 0f 94 9d dc call 0x3b93a ; 0x3b93a 3b95a: 25 2f mov r18, r21 3b95c: 0f 94 9d dc call 0x3b93a ; 0x3b93a 3b960: 0d 94 b2 dc jmp 0x3b964 ; 0x3b964 0003b964 : 3b964: 0f 94 9c dc call 0x3b938 ; 0x3b938 3b968: 27 2f mov r18, r23 3b96a: 0d 94 9d dc jmp 0x3b93a ; 0x3b93a 0003b96e <__mulsi3>: 3b96e: db 01 movw r26, r22 3b970: 8f 93 push r24 3b972: 9f 93 push r25 3b974: 0f 94 e9 dc call 0x3b9d2 ; 0x3b9d2 <__muluhisi3> 3b978: bf 91 pop r27 3b97a: af 91 pop r26 3b97c: a2 9f mul r26, r18 3b97e: 80 0d add r24, r0 3b980: 91 1d adc r25, r1 3b982: a3 9f mul r26, r19 3b984: 90 0d add r25, r0 3b986: b2 9f mul r27, r18 3b988: 90 0d add r25, r0 3b98a: 11 24 eor r1, r1 3b98c: 08 95 ret 0003b98e <__udivmodsi4>: 3b98e: a1 e2 ldi r26, 0x21 ; 33 3b990: 1a 2e mov r1, r26 3b992: aa 1b sub r26, r26 3b994: bb 1b sub r27, r27 3b996: fd 01 movw r30, r26 3b998: 0d c0 rjmp .+26 ; 0x3b9b4 <__udivmodsi4_ep> 0003b99a <__udivmodsi4_loop>: 3b99a: aa 1f adc r26, r26 3b99c: bb 1f adc r27, r27 3b99e: ee 1f adc r30, r30 3b9a0: ff 1f adc r31, r31 3b9a2: a2 17 cp r26, r18 3b9a4: b3 07 cpc r27, r19 3b9a6: e4 07 cpc r30, r20 3b9a8: f5 07 cpc r31, r21 3b9aa: 20 f0 brcs .+8 ; 0x3b9b4 <__udivmodsi4_ep> 3b9ac: a2 1b sub r26, r18 3b9ae: b3 0b sbc r27, r19 3b9b0: e4 0b sbc r30, r20 3b9b2: f5 0b sbc r31, r21 0003b9b4 <__udivmodsi4_ep>: 3b9b4: 66 1f adc r22, r22 3b9b6: 77 1f adc r23, r23 3b9b8: 88 1f adc r24, r24 3b9ba: 99 1f adc r25, r25 3b9bc: 1a 94 dec r1 3b9be: 69 f7 brne .-38 ; 0x3b99a <__udivmodsi4_loop> 3b9c0: 60 95 com r22 3b9c2: 70 95 com r23 3b9c4: 80 95 com r24 3b9c6: 90 95 com r25 3b9c8: 9b 01 movw r18, r22 3b9ca: ac 01 movw r20, r24 3b9cc: bd 01 movw r22, r26 3b9ce: cf 01 movw r24, r30 3b9d0: 08 95 ret 0003b9d2 <__muluhisi3>: 3b9d2: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> 3b9d6: a5 9f mul r26, r21 3b9d8: 90 0d add r25, r0 3b9da: b4 9f mul r27, r20 3b9dc: 90 0d add r25, r0 3b9de: a4 9f mul r26, r20 3b9e0: 80 0d add r24, r0 3b9e2: 91 1d adc r25, r1 3b9e4: 11 24 eor r1, r1 3b9e6: 08 95 ret 0003b9e8 <__umulhisi3>: 3b9e8: a2 9f mul r26, r18 3b9ea: b0 01 movw r22, r0 3b9ec: b3 9f mul r27, r19 3b9ee: c0 01 movw r24, r0 3b9f0: a3 9f mul r26, r19 3b9f2: 70 0d add r23, r0 3b9f4: 81 1d adc r24, r1 3b9f6: 11 24 eor r1, r1 3b9f8: 91 1d adc r25, r1 3b9fa: b2 9f mul r27, r18 3b9fc: 70 0d add r23, r0 3b9fe: 81 1d adc r24, r1 3ba00: 11 24 eor r1, r1 3ba02: 91 1d adc r25, r1 3ba04: 08 95 ret 0003ba06 <__udivmodqi4>: 3ba06: 99 1b sub r25, r25 3ba08: 79 e0 ldi r23, 0x09 ; 9 3ba0a: 04 c0 rjmp .+8 ; 0x3ba14 <__udivmodqi4_ep> 0003ba0c <__udivmodqi4_loop>: 3ba0c: 99 1f adc r25, r25 3ba0e: 96 17 cp r25, r22 3ba10: 08 f0 brcs .+2 ; 0x3ba14 <__udivmodqi4_ep> 3ba12: 96 1b sub r25, r22 0003ba14 <__udivmodqi4_ep>: 3ba14: 88 1f adc r24, r24 3ba16: 7a 95 dec r23 3ba18: c9 f7 brne .-14 ; 0x3ba0c <__udivmodqi4_loop> 3ba1a: 80 95 com r24 3ba1c: 08 95 ret 0003ba1e <__divmodqi4>: 3ba1e: 87 fb bst r24, 7 3ba20: 08 2e mov r0, r24 3ba22: 06 26 eor r0, r22 3ba24: 87 fd sbrc r24, 7 3ba26: 81 95 neg r24 3ba28: 67 fd sbrc r22, 7 3ba2a: 61 95 neg r22 3ba2c: 0f 94 03 dd call 0x3ba06 ; 0x3ba06 <__udivmodqi4> 3ba30: 0e f4 brtc .+2 ; 0x3ba34 <__divmodqi4_1> 3ba32: 91 95 neg r25 0003ba34 <__divmodqi4_1>: 3ba34: 07 fc sbrc r0, 7 3ba36: 81 95 neg r24 0003ba38 <__divmodqi4_exit>: 3ba38: 08 95 ret 0003ba3a <__udivmodhi4>: 3ba3a: aa 1b sub r26, r26 3ba3c: bb 1b sub r27, r27 3ba3e: 51 e1 ldi r21, 0x11 ; 17 3ba40: 07 c0 rjmp .+14 ; 0x3ba50 <__udivmodhi4_ep> 0003ba42 <__udivmodhi4_loop>: 3ba42: aa 1f adc r26, r26 3ba44: bb 1f adc r27, r27 3ba46: a6 17 cp r26, r22 3ba48: b7 07 cpc r27, r23 3ba4a: 10 f0 brcs .+4 ; 0x3ba50 <__udivmodhi4_ep> 3ba4c: a6 1b sub r26, r22 3ba4e: b7 0b sbc r27, r23 0003ba50 <__udivmodhi4_ep>: 3ba50: 88 1f adc r24, r24 3ba52: 99 1f adc r25, r25 3ba54: 5a 95 dec r21 3ba56: a9 f7 brne .-22 ; 0x3ba42 <__udivmodhi4_loop> 3ba58: 80 95 com r24 3ba5a: 90 95 com r25 3ba5c: bc 01 movw r22, r24 3ba5e: cd 01 movw r24, r26 3ba60: 08 95 ret 0003ba62 <__divmodhi4>: 3ba62: 97 fb bst r25, 7 3ba64: 07 2e mov r0, r23 3ba66: 16 f4 brtc .+4 ; 0x3ba6c <__divmodhi4+0xa> 3ba68: 00 94 com r0 3ba6a: 07 d0 rcall .+14 ; 0x3ba7a <__divmodhi4_neg1> 3ba6c: 77 fd sbrc r23, 7 3ba6e: 09 d0 rcall .+18 ; 0x3ba82 <__divmodhi4_neg2> 3ba70: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a <__udivmodhi4> 3ba74: 07 fc sbrc r0, 7 3ba76: 05 d0 rcall .+10 ; 0x3ba82 <__divmodhi4_neg2> 3ba78: 3e f4 brtc .+14 ; 0x3ba88 <__divmodhi4_exit> 0003ba7a <__divmodhi4_neg1>: 3ba7a: 90 95 com r25 3ba7c: 81 95 neg r24 3ba7e: 9f 4f sbci r25, 0xFF ; 255 3ba80: 08 95 ret 0003ba82 <__divmodhi4_neg2>: 3ba82: 70 95 com r23 3ba84: 61 95 neg r22 3ba86: 7f 4f sbci r23, 0xFF ; 255 0003ba88 <__divmodhi4_exit>: 3ba88: 08 95 ret 0003ba8a <__divmodsi4>: 3ba8a: 05 2e mov r0, r21 3ba8c: 97 fb bst r25, 7 3ba8e: 1e f4 brtc .+6 ; 0x3ba96 <__divmodsi4+0xc> 3ba90: 00 94 com r0 3ba92: 0f 94 5c dd call 0x3bab8 ; 0x3bab8 <__negsi2> 3ba96: 57 fd sbrc r21, 7 3ba98: 07 d0 rcall .+14 ; 0x3baa8 <__divmodsi4_neg2> 3ba9a: 0f 94 c7 dc call 0x3b98e ; 0x3b98e <__udivmodsi4> 3ba9e: 07 fc sbrc r0, 7 3baa0: 03 d0 rcall .+6 ; 0x3baa8 <__divmodsi4_neg2> 3baa2: 4e f4 brtc .+18 ; 0x3bab6 <__divmodsi4_exit> 3baa4: 0d 94 5c dd jmp 0x3bab8 ; 0x3bab8 <__negsi2> 0003baa8 <__divmodsi4_neg2>: 3baa8: 50 95 com r21 3baaa: 40 95 com r20 3baac: 30 95 com r19 3baae: 21 95 neg r18 3bab0: 3f 4f sbci r19, 0xFF ; 255 3bab2: 4f 4f sbci r20, 0xFF ; 255 3bab4: 5f 4f sbci r21, 0xFF ; 255 0003bab6 <__divmodsi4_exit>: 3bab6: 08 95 ret 0003bab8 <__negsi2>: 3bab8: 90 95 com r25 3baba: 80 95 com r24 3babc: 70 95 com r23 3babe: 61 95 neg r22 3bac0: 7f 4f sbci r23, 0xFF ; 255 3bac2: 8f 4f sbci r24, 0xFF ; 255 3bac4: 9f 4f sbci r25, 0xFF ; 255 3bac6: 08 95 ret 0003bac8 <__tablejump2__>: 3bac8: ee 0f add r30, r30 3baca: ff 1f adc r31, r31 3bacc: 88 1f adc r24, r24 3bace: 8b bf out 0x3b, r24 ; 59 3bad0: 07 90 elpm r0, Z+ 3bad2: f6 91 elpm r31, Z 3bad4: e0 2d mov r30, r0 3bad6: 19 94 eijmp 0003bad8 <__mulhisi3>: 3bad8: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> 3badc: 33 23 and r19, r19 3bade: 12 f4 brpl .+4 ; 0x3bae4 <__mulhisi3+0xc> 3bae0: 8a 1b sub r24, r26 3bae2: 9b 0b sbc r25, r27 3bae4: 0d 94 76 dd jmp 0x3baec ; 0x3baec <__usmulhisi3_tail> 0003bae8 <__usmulhisi3>: 3bae8: 0f 94 f4 dc call 0x3b9e8 ; 0x3b9e8 <__umulhisi3> 0003baec <__usmulhisi3_tail>: 3baec: b7 ff sbrs r27, 7 3baee: 08 95 ret 3baf0: 82 1b sub r24, r18 3baf2: 93 0b sbc r25, r19 3baf4: 08 95 ret 0003baf6 <__subsf3>: 3baf6: 50 58 subi r21, 0x80 ; 128 0003baf8 <__addsf3>: 3baf8: bb 27 eor r27, r27 3bafa: aa 27 eor r26, r26 3bafc: 0f 94 93 dd call 0x3bb26 ; 0x3bb26 <__addsf3x> 3bb00: 0d 94 a5 d7 jmp 0x3af4a ; 0x3af4a <__fp_round> 3bb04: 0f 94 97 d7 call 0x3af2e ; 0x3af2e <__fp_pscA> 3bb08: 38 f0 brcs .+14 ; 0x3bb18 <__addsf3+0x20> 3bb0a: 0f 94 9e d7 call 0x3af3c ; 0x3af3c <__fp_pscB> 3bb0e: 20 f0 brcs .+8 ; 0x3bb18 <__addsf3+0x20> 3bb10: 39 f4 brne .+14 ; 0x3bb20 <__addsf3+0x28> 3bb12: 9f 3f cpi r25, 0xFF ; 255 3bb14: 19 f4 brne .+6 ; 0x3bb1c <__addsf3+0x24> 3bb16: 26 f4 brtc .+8 ; 0x3bb20 <__addsf3+0x28> 3bb18: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 3bb1c: 0e f4 brtc .+2 ; 0x3bb20 <__addsf3+0x28> 3bb1e: e0 95 com r30 3bb20: e7 fb bst r30, 7 3bb22: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 0003bb26 <__addsf3x>: 3bb26: e9 2f mov r30, r25 3bb28: 0f 94 b6 d7 call 0x3af6c ; 0x3af6c <__fp_split3> 3bb2c: 58 f3 brcs .-42 ; 0x3bb04 <__addsf3+0xc> 3bb2e: ba 17 cp r27, r26 3bb30: 62 07 cpc r22, r18 3bb32: 73 07 cpc r23, r19 3bb34: 84 07 cpc r24, r20 3bb36: 95 07 cpc r25, r21 3bb38: 20 f0 brcs .+8 ; 0x3bb42 <__addsf3x+0x1c> 3bb3a: 79 f4 brne .+30 ; 0x3bb5a <__addsf3x+0x34> 3bb3c: a6 f5 brtc .+104 ; 0x3bba6 <__addsf3x+0x80> 3bb3e: 0d 94 d8 d7 jmp 0x3afb0 ; 0x3afb0 <__fp_zero> 3bb42: 0e f4 brtc .+2 ; 0x3bb46 <__addsf3x+0x20> 3bb44: e0 95 com r30 3bb46: 0b 2e mov r0, r27 3bb48: ba 2f mov r27, r26 3bb4a: a0 2d mov r26, r0 3bb4c: 0b 01 movw r0, r22 3bb4e: b9 01 movw r22, r18 3bb50: 90 01 movw r18, r0 3bb52: 0c 01 movw r0, r24 3bb54: ca 01 movw r24, r20 3bb56: a0 01 movw r20, r0 3bb58: 11 24 eor r1, r1 3bb5a: ff 27 eor r31, r31 3bb5c: 59 1b sub r21, r25 3bb5e: 99 f0 breq .+38 ; 0x3bb86 <__addsf3x+0x60> 3bb60: 59 3f cpi r21, 0xF9 ; 249 3bb62: 50 f4 brcc .+20 ; 0x3bb78 <__addsf3x+0x52> 3bb64: 50 3e cpi r21, 0xE0 ; 224 3bb66: 68 f1 brcs .+90 ; 0x3bbc2 <__addsf3x+0x9c> 3bb68: 1a 16 cp r1, r26 3bb6a: f0 40 sbci r31, 0x00 ; 0 3bb6c: a2 2f mov r26, r18 3bb6e: 23 2f mov r18, r19 3bb70: 34 2f mov r19, r20 3bb72: 44 27 eor r20, r20 3bb74: 58 5f subi r21, 0xF8 ; 248 3bb76: f3 cf rjmp .-26 ; 0x3bb5e <__addsf3x+0x38> 3bb78: 46 95 lsr r20 3bb7a: 37 95 ror r19 3bb7c: 27 95 ror r18 3bb7e: a7 95 ror r26 3bb80: f0 40 sbci r31, 0x00 ; 0 3bb82: 53 95 inc r21 3bb84: c9 f7 brne .-14 ; 0x3bb78 <__addsf3x+0x52> 3bb86: 7e f4 brtc .+30 ; 0x3bba6 <__addsf3x+0x80> 3bb88: 1f 16 cp r1, r31 3bb8a: ba 0b sbc r27, r26 3bb8c: 62 0b sbc r22, r18 3bb8e: 73 0b sbc r23, r19 3bb90: 84 0b sbc r24, r20 3bb92: ba f0 brmi .+46 ; 0x3bbc2 <__addsf3x+0x9c> 3bb94: 91 50 subi r25, 0x01 ; 1 3bb96: a1 f0 breq .+40 ; 0x3bbc0 <__addsf3x+0x9a> 3bb98: ff 0f add r31, r31 3bb9a: bb 1f adc r27, r27 3bb9c: 66 1f adc r22, r22 3bb9e: 77 1f adc r23, r23 3bba0: 88 1f adc r24, r24 3bba2: c2 f7 brpl .-16 ; 0x3bb94 <__addsf3x+0x6e> 3bba4: 0e c0 rjmp .+28 ; 0x3bbc2 <__addsf3x+0x9c> 3bba6: ba 0f add r27, r26 3bba8: 62 1f adc r22, r18 3bbaa: 73 1f adc r23, r19 3bbac: 84 1f adc r24, r20 3bbae: 48 f4 brcc .+18 ; 0x3bbc2 <__addsf3x+0x9c> 3bbb0: 87 95 ror r24 3bbb2: 77 95 ror r23 3bbb4: 67 95 ror r22 3bbb6: b7 95 ror r27 3bbb8: f7 95 ror r31 3bbba: 9e 3f cpi r25, 0xFE ; 254 3bbbc: 08 f0 brcs .+2 ; 0x3bbc0 <__addsf3x+0x9a> 3bbbe: b0 cf rjmp .-160 ; 0x3bb20 <__addsf3+0x28> 3bbc0: 93 95 inc r25 3bbc2: 88 0f add r24, r24 3bbc4: 08 f0 brcs .+2 ; 0x3bbc8 <__addsf3x+0xa2> 3bbc6: 99 27 eor r25, r25 3bbc8: ee 0f add r30, r30 3bbca: 97 95 ror r25 3bbcc: 87 95 ror r24 3bbce: 08 95 ret 3bbd0: 0f 94 97 d7 call 0x3af2e ; 0x3af2e <__fp_pscA> 3bbd4: 60 f0 brcs .+24 ; 0x3bbee <__addsf3x+0xc8> 3bbd6: 80 e8 ldi r24, 0x80 ; 128 3bbd8: 91 e0 ldi r25, 0x01 ; 1 3bbda: 09 f4 brne .+2 ; 0x3bbde <__addsf3x+0xb8> 3bbdc: 9e ef ldi r25, 0xFE ; 254 3bbde: 0f 94 9e d7 call 0x3af3c ; 0x3af3c <__fp_pscB> 3bbe2: 28 f0 brcs .+10 ; 0x3bbee <__addsf3x+0xc8> 3bbe4: 40 e8 ldi r20, 0x80 ; 128 3bbe6: 51 e0 ldi r21, 0x01 ; 1 3bbe8: 71 f4 brne .+28 ; 0x3bc06 3bbea: 5e ef ldi r21, 0xFE ; 254 3bbec: 0c c0 rjmp .+24 ; 0x3bc06 3bbee: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 3bbf2: 0d 94 d8 d7 jmp 0x3afb0 ; 0x3afb0 <__fp_zero> 0003bbf6 : 3bbf6: e9 2f mov r30, r25 3bbf8: e0 78 andi r30, 0x80 ; 128 3bbfa: 0f 94 b6 d7 call 0x3af6c ; 0x3af6c <__fp_split3> 3bbfe: 40 f3 brcs .-48 ; 0x3bbd0 <__addsf3x+0xaa> 3bc00: 09 2e mov r0, r25 3bc02: 05 2a or r0, r21 3bc04: b1 f3 breq .-20 ; 0x3bbf2 <__addsf3x+0xcc> 3bc06: 26 17 cp r18, r22 3bc08: 37 07 cpc r19, r23 3bc0a: 48 07 cpc r20, r24 3bc0c: 59 07 cpc r21, r25 3bc0e: 38 f0 brcs .+14 ; 0x3bc1e 3bc10: 0e 2e mov r0, r30 3bc12: 07 f8 bld r0, 7 3bc14: e0 25 eor r30, r0 3bc16: 69 f0 breq .+26 ; 0x3bc32 3bc18: e0 25 eor r30, r0 3bc1a: e0 64 ori r30, 0x40 ; 64 3bc1c: 0a c0 rjmp .+20 ; 0x3bc32 3bc1e: ef 63 ori r30, 0x3F ; 63 3bc20: 07 f8 bld r0, 7 3bc22: 00 94 com r0 3bc24: 07 fa bst r0, 7 3bc26: db 01 movw r26, r22 3bc28: b9 01 movw r22, r18 3bc2a: 9d 01 movw r18, r26 3bc2c: dc 01 movw r26, r24 3bc2e: ca 01 movw r24, r20 3bc30: ad 01 movw r20, r26 3bc32: ef 93 push r30 3bc34: 0f 94 92 de call 0x3bd24 ; 0x3bd24 <__divsf3_pse> 3bc38: 0f 94 a5 d7 call 0x3af4a ; 0x3af4a <__fp_round> 3bc3c: 0f 94 2b de call 0x3bc56 ; 0x3bc56 3bc40: 5f 91 pop r21 3bc42: 55 23 and r21, r21 3bc44: 39 f0 breq .+14 ; 0x3bc54 3bc46: 2b ed ldi r18, 0xDB ; 219 3bc48: 3f e0 ldi r19, 0x0F ; 15 3bc4a: 49 e4 ldi r20, 0x49 ; 73 3bc4c: 50 fd sbrc r21, 0 3bc4e: 49 ec ldi r20, 0xC9 ; 201 3bc50: 0d 94 7c dd jmp 0x3baf8 ; 0x3baf8 <__addsf3> 3bc54: 08 95 ret 0003bc56 : 3bc56: df 93 push r29 3bc58: dd 27 eor r29, r29 3bc5a: b9 2f mov r27, r25 3bc5c: bf 77 andi r27, 0x7F ; 127 3bc5e: 40 e8 ldi r20, 0x80 ; 128 3bc60: 5f e3 ldi r21, 0x3F ; 63 3bc62: 16 16 cp r1, r22 3bc64: 17 06 cpc r1, r23 3bc66: 48 07 cpc r20, r24 3bc68: 5b 07 cpc r21, r27 3bc6a: 18 f4 brcc .+6 ; 0x3bc72 3bc6c: d9 2f mov r29, r25 3bc6e: 0f 94 77 e0 call 0x3c0ee ; 0x3c0ee 3bc72: 9f 93 push r25 3bc74: 8f 93 push r24 3bc76: 7f 93 push r23 3bc78: 6f 93 push r22 3bc7a: 0f 94 1d d7 call 0x3ae3a ; 0x3ae3a 3bc7e: e2 ea ldi r30, 0xA2 ; 162 3bc80: f0 e7 ldi r31, 0x70 ; 112 3bc82: 0f 94 87 df call 0x3bf0e ; 0x3bf0e <__fp_powser> 3bc86: 0f 94 a5 d7 call 0x3af4a ; 0x3af4a <__fp_round> 3bc8a: 2f 91 pop r18 3bc8c: 3f 91 pop r19 3bc8e: 4f 91 pop r20 3bc90: 5f 91 pop r21 3bc92: 0f 94 34 d7 call 0x3ae68 ; 0x3ae68 <__mulsf3x> 3bc96: dd 23 and r29, r29 3bc98: 51 f0 breq .+20 ; 0x3bcae 3bc9a: 90 58 subi r25, 0x80 ; 128 3bc9c: a2 ea ldi r26, 0xA2 ; 162 3bc9e: 2a ed ldi r18, 0xDA ; 218 3bca0: 3f e0 ldi r19, 0x0F ; 15 3bca2: 49 ec ldi r20, 0xC9 ; 201 3bca4: 5f e3 ldi r21, 0x3F ; 63 3bca6: d0 78 andi r29, 0x80 ; 128 3bca8: 5d 27 eor r21, r29 3bcaa: 0f 94 93 dd call 0x3bb26 ; 0x3bb26 <__addsf3x> 3bcae: df 91 pop r29 3bcb0: 0d 94 a5 d7 jmp 0x3af4a ; 0x3af4a <__fp_round> 0003bcb4 : 3bcb4: 0f 94 ed df call 0x3bfda ; 0x3bfda <__fp_trunc> 3bcb8: 90 f0 brcs .+36 ; 0x3bcde 3bcba: 9f 37 cpi r25, 0x7F ; 127 3bcbc: 48 f4 brcc .+18 ; 0x3bcd0 3bcbe: 91 11 cpse r25, r1 3bcc0: 16 f4 brtc .+4 ; 0x3bcc6 3bcc2: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 3bcc6: 60 e0 ldi r22, 0x00 ; 0 3bcc8: 70 e0 ldi r23, 0x00 ; 0 3bcca: 80 e8 ldi r24, 0x80 ; 128 3bccc: 9f e3 ldi r25, 0x3F ; 63 3bcce: 08 95 ret 3bcd0: 26 f0 brts .+8 ; 0x3bcda 3bcd2: 1b 16 cp r1, r27 3bcd4: 61 1d adc r22, r1 3bcd6: 71 1d adc r23, r1 3bcd8: 81 1d adc r24, r1 3bcda: 0d 94 5e df jmp 0x3bebc ; 0x3bebc <__fp_mintl> 3bcde: 0d 94 79 df jmp 0x3bef2 ; 0x3bef2 <__fp_mpack> 0003bce2 <__cmpsf2>: 3bce2: 0f 94 3a df call 0x3be74 ; 0x3be74 <__fp_cmp> 3bce6: 08 f4 brcc .+2 ; 0x3bcea <__cmpsf2+0x8> 3bce8: 81 e0 ldi r24, 0x01 ; 1 3bcea: 08 95 ret 0003bcec : 3bcec: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__fp_rempio2> 3bcf0: e3 95 inc r30 3bcf2: 0d 94 d9 df jmp 0x3bfb2 ; 0x3bfb2 <__fp_sinus> 0003bcf6 <__divsf3>: 3bcf6: 0f 94 8f de call 0x3bd1e ; 0x3bd1e <__divsf3x> 3bcfa: 0d 94 a5 d7 jmp 0x3af4a ; 0x3af4a <__fp_round> 3bcfe: 0f 94 9e d7 call 0x3af3c ; 0x3af3c <__fp_pscB> 3bd02: 58 f0 brcs .+22 ; 0x3bd1a <__divsf3+0x24> 3bd04: 0f 94 97 d7 call 0x3af2e ; 0x3af2e <__fp_pscA> 3bd08: 40 f0 brcs .+16 ; 0x3bd1a <__divsf3+0x24> 3bd0a: 29 f4 brne .+10 ; 0x3bd16 <__divsf3+0x20> 3bd0c: 5f 3f cpi r21, 0xFF ; 255 3bd0e: 29 f0 breq .+10 ; 0x3bd1a <__divsf3+0x24> 3bd10: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 3bd14: 51 11 cpse r21, r1 3bd16: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 3bd1a: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 0003bd1e <__divsf3x>: 3bd1e: 0f 94 b6 d7 call 0x3af6c ; 0x3af6c <__fp_split3> 3bd22: 68 f3 brcs .-38 ; 0x3bcfe <__divsf3+0x8> 0003bd24 <__divsf3_pse>: 3bd24: 99 23 and r25, r25 3bd26: b1 f3 breq .-20 ; 0x3bd14 <__divsf3+0x1e> 3bd28: 55 23 and r21, r21 3bd2a: 91 f3 breq .-28 ; 0x3bd10 <__divsf3+0x1a> 3bd2c: 95 1b sub r25, r21 3bd2e: 55 0b sbc r21, r21 3bd30: bb 27 eor r27, r27 3bd32: aa 27 eor r26, r26 3bd34: 62 17 cp r22, r18 3bd36: 73 07 cpc r23, r19 3bd38: 84 07 cpc r24, r20 3bd3a: 38 f0 brcs .+14 ; 0x3bd4a <__divsf3_pse+0x26> 3bd3c: 9f 5f subi r25, 0xFF ; 255 3bd3e: 5f 4f sbci r21, 0xFF ; 255 3bd40: 22 0f add r18, r18 3bd42: 33 1f adc r19, r19 3bd44: 44 1f adc r20, r20 3bd46: aa 1f adc r26, r26 3bd48: a9 f3 breq .-22 ; 0x3bd34 <__divsf3_pse+0x10> 3bd4a: 35 d0 rcall .+106 ; 0x3bdb6 <__divsf3_pse+0x92> 3bd4c: 0e 2e mov r0, r30 3bd4e: 3a f0 brmi .+14 ; 0x3bd5e <__divsf3_pse+0x3a> 3bd50: e0 e8 ldi r30, 0x80 ; 128 3bd52: 32 d0 rcall .+100 ; 0x3bdb8 <__divsf3_pse+0x94> 3bd54: 91 50 subi r25, 0x01 ; 1 3bd56: 50 40 sbci r21, 0x00 ; 0 3bd58: e6 95 lsr r30 3bd5a: 00 1c adc r0, r0 3bd5c: ca f7 brpl .-14 ; 0x3bd50 <__divsf3_pse+0x2c> 3bd5e: 2b d0 rcall .+86 ; 0x3bdb6 <__divsf3_pse+0x92> 3bd60: fe 2f mov r31, r30 3bd62: 29 d0 rcall .+82 ; 0x3bdb6 <__divsf3_pse+0x92> 3bd64: 66 0f add r22, r22 3bd66: 77 1f adc r23, r23 3bd68: 88 1f adc r24, r24 3bd6a: bb 1f adc r27, r27 3bd6c: 26 17 cp r18, r22 3bd6e: 37 07 cpc r19, r23 3bd70: 48 07 cpc r20, r24 3bd72: ab 07 cpc r26, r27 3bd74: b0 e8 ldi r27, 0x80 ; 128 3bd76: 09 f0 breq .+2 ; 0x3bd7a <__divsf3_pse+0x56> 3bd78: bb 0b sbc r27, r27 3bd7a: 80 2d mov r24, r0 3bd7c: bf 01 movw r22, r30 3bd7e: ff 27 eor r31, r31 3bd80: 93 58 subi r25, 0x83 ; 131 3bd82: 5f 4f sbci r21, 0xFF ; 255 3bd84: 3a f0 brmi .+14 ; 0x3bd94 <__divsf3_pse+0x70> 3bd86: 9e 3f cpi r25, 0xFE ; 254 3bd88: 51 05 cpc r21, r1 3bd8a: 78 f0 brcs .+30 ; 0x3bdaa <__divsf3_pse+0x86> 3bd8c: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 3bd90: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 3bd94: 5f 3f cpi r21, 0xFF ; 255 3bd96: e4 f3 brlt .-8 ; 0x3bd90 <__divsf3_pse+0x6c> 3bd98: 98 3e cpi r25, 0xE8 ; 232 3bd9a: d4 f3 brlt .-12 ; 0x3bd90 <__divsf3_pse+0x6c> 3bd9c: 86 95 lsr r24 3bd9e: 77 95 ror r23 3bda0: 67 95 ror r22 3bda2: b7 95 ror r27 3bda4: f7 95 ror r31 3bda6: 9f 5f subi r25, 0xFF ; 255 3bda8: c9 f7 brne .-14 ; 0x3bd9c <__divsf3_pse+0x78> 3bdaa: 88 0f add r24, r24 3bdac: 91 1d adc r25, r1 3bdae: 96 95 lsr r25 3bdb0: 87 95 ror r24 3bdb2: 97 f9 bld r25, 7 3bdb4: 08 95 ret 3bdb6: e1 e0 ldi r30, 0x01 ; 1 3bdb8: 66 0f add r22, r22 3bdba: 77 1f adc r23, r23 3bdbc: 88 1f adc r24, r24 3bdbe: bb 1f adc r27, r27 3bdc0: 62 17 cp r22, r18 3bdc2: 73 07 cpc r23, r19 3bdc4: 84 07 cpc r24, r20 3bdc6: ba 07 cpc r27, r26 3bdc8: 20 f0 brcs .+8 ; 0x3bdd2 <__divsf3_pse+0xae> 3bdca: 62 1b sub r22, r18 3bdcc: 73 0b sbc r23, r19 3bdce: 84 0b sbc r24, r20 3bdd0: ba 0b sbc r27, r26 3bdd2: ee 1f adc r30, r30 3bdd4: 88 f7 brcc .-30 ; 0x3bdb8 <__divsf3_pse+0x94> 3bdd6: e0 95 com r30 3bdd8: 08 95 ret 0003bdda <__fixsfsi>: 3bdda: 0f 94 f4 de call 0x3bde8 ; 0x3bde8 <__fixunssfsi> 3bdde: 68 94 set 3bde0: b1 11 cpse r27, r1 3bde2: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 3bde6: 08 95 ret 0003bde8 <__fixunssfsi>: 3bde8: 0f 94 be d7 call 0x3af7c ; 0x3af7c <__fp_splitA> 3bdec: 88 f0 brcs .+34 ; 0x3be10 <__fixunssfsi+0x28> 3bdee: 9f 57 subi r25, 0x7F ; 127 3bdf0: 98 f0 brcs .+38 ; 0x3be18 <__fixunssfsi+0x30> 3bdf2: b9 2f mov r27, r25 3bdf4: 99 27 eor r25, r25 3bdf6: b7 51 subi r27, 0x17 ; 23 3bdf8: b0 f0 brcs .+44 ; 0x3be26 <__fixunssfsi+0x3e> 3bdfa: e1 f0 breq .+56 ; 0x3be34 <__fixunssfsi+0x4c> 3bdfc: 66 0f add r22, r22 3bdfe: 77 1f adc r23, r23 3be00: 88 1f adc r24, r24 3be02: 99 1f adc r25, r25 3be04: 1a f0 brmi .+6 ; 0x3be0c <__fixunssfsi+0x24> 3be06: ba 95 dec r27 3be08: c9 f7 brne .-14 ; 0x3bdfc <__fixunssfsi+0x14> 3be0a: 14 c0 rjmp .+40 ; 0x3be34 <__fixunssfsi+0x4c> 3be0c: b1 30 cpi r27, 0x01 ; 1 3be0e: 91 f0 breq .+36 ; 0x3be34 <__fixunssfsi+0x4c> 3be10: 0f 94 d8 d7 call 0x3afb0 ; 0x3afb0 <__fp_zero> 3be14: b1 e0 ldi r27, 0x01 ; 1 3be16: 08 95 ret 3be18: 0d 94 d8 d7 jmp 0x3afb0 ; 0x3afb0 <__fp_zero> 3be1c: 67 2f mov r22, r23 3be1e: 78 2f mov r23, r24 3be20: 88 27 eor r24, r24 3be22: b8 5f subi r27, 0xF8 ; 248 3be24: 39 f0 breq .+14 ; 0x3be34 <__fixunssfsi+0x4c> 3be26: b9 3f cpi r27, 0xF9 ; 249 3be28: cc f3 brlt .-14 ; 0x3be1c <__fixunssfsi+0x34> 3be2a: 86 95 lsr r24 3be2c: 77 95 ror r23 3be2e: 67 95 ror r22 3be30: b3 95 inc r27 3be32: d9 f7 brne .-10 ; 0x3be2a <__fixunssfsi+0x42> 3be34: 3e f4 brtc .+14 ; 0x3be44 <__fixunssfsi+0x5c> 3be36: 90 95 com r25 3be38: 80 95 com r24 3be3a: 70 95 com r23 3be3c: 61 95 neg r22 3be3e: 7f 4f sbci r23, 0xFF ; 255 3be40: 8f 4f sbci r24, 0xFF ; 255 3be42: 9f 4f sbci r25, 0xFF ; 255 3be44: 08 95 ret 0003be46 : 3be46: 0f 94 ed df call 0x3bfda ; 0x3bfda <__fp_trunc> 3be4a: 90 f0 brcs .+36 ; 0x3be70 3be4c: 9f 37 cpi r25, 0x7F ; 127 3be4e: 48 f4 brcc .+18 ; 0x3be62 3be50: 91 11 cpse r25, r1 3be52: 16 f0 brts .+4 ; 0x3be58 3be54: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 3be58: 60 e0 ldi r22, 0x00 ; 0 3be5a: 70 e0 ldi r23, 0x00 ; 0 3be5c: 80 e8 ldi r24, 0x80 ; 128 3be5e: 9f eb ldi r25, 0xBF ; 191 3be60: 08 95 ret 3be62: 26 f4 brtc .+8 ; 0x3be6c 3be64: 1b 16 cp r1, r27 3be66: 61 1d adc r22, r1 3be68: 71 1d adc r23, r1 3be6a: 81 1d adc r24, r1 3be6c: 0d 94 5e df jmp 0x3bebc ; 0x3bebc <__fp_mintl> 3be70: 0d 94 79 df jmp 0x3bef2 ; 0x3bef2 <__fp_mpack> 0003be74 <__fp_cmp>: 3be74: 99 0f add r25, r25 3be76: 00 08 sbc r0, r0 3be78: 55 0f add r21, r21 3be7a: aa 0b sbc r26, r26 3be7c: e0 e8 ldi r30, 0x80 ; 128 3be7e: fe ef ldi r31, 0xFE ; 254 3be80: 16 16 cp r1, r22 3be82: 17 06 cpc r1, r23 3be84: e8 07 cpc r30, r24 3be86: f9 07 cpc r31, r25 3be88: c0 f0 brcs .+48 ; 0x3beba <__fp_cmp+0x46> 3be8a: 12 16 cp r1, r18 3be8c: 13 06 cpc r1, r19 3be8e: e4 07 cpc r30, r20 3be90: f5 07 cpc r31, r21 3be92: 98 f0 brcs .+38 ; 0x3beba <__fp_cmp+0x46> 3be94: 62 1b sub r22, r18 3be96: 73 0b sbc r23, r19 3be98: 84 0b sbc r24, r20 3be9a: 95 0b sbc r25, r21 3be9c: 39 f4 brne .+14 ; 0x3beac <__fp_cmp+0x38> 3be9e: 0a 26 eor r0, r26 3bea0: 61 f0 breq .+24 ; 0x3beba <__fp_cmp+0x46> 3bea2: 23 2b or r18, r19 3bea4: 24 2b or r18, r20 3bea6: 25 2b or r18, r21 3bea8: 21 f4 brne .+8 ; 0x3beb2 <__fp_cmp+0x3e> 3beaa: 08 95 ret 3beac: 0a 26 eor r0, r26 3beae: 09 f4 brne .+2 ; 0x3beb2 <__fp_cmp+0x3e> 3beb0: a1 40 sbci r26, 0x01 ; 1 3beb2: a6 95 lsr r26 3beb4: 8f ef ldi r24, 0xFF ; 255 3beb6: 81 1d adc r24, r1 3beb8: 81 1d adc r24, r1 3beba: 08 95 ret 0003bebc <__fp_mintl>: 3bebc: 88 23 and r24, r24 3bebe: 71 f4 brne .+28 ; 0x3bedc <__fp_mintl+0x20> 3bec0: 77 23 and r23, r23 3bec2: 21 f0 breq .+8 ; 0x3becc <__fp_mintl+0x10> 3bec4: 98 50 subi r25, 0x08 ; 8 3bec6: 87 2b or r24, r23 3bec8: 76 2f mov r23, r22 3beca: 07 c0 rjmp .+14 ; 0x3beda <__fp_mintl+0x1e> 3becc: 66 23 and r22, r22 3bece: 11 f4 brne .+4 ; 0x3bed4 <__fp_mintl+0x18> 3bed0: 99 27 eor r25, r25 3bed2: 0d c0 rjmp .+26 ; 0x3beee <__fp_mintl+0x32> 3bed4: 90 51 subi r25, 0x10 ; 16 3bed6: 86 2b or r24, r22 3bed8: 70 e0 ldi r23, 0x00 ; 0 3beda: 60 e0 ldi r22, 0x00 ; 0 3bedc: 2a f0 brmi .+10 ; 0x3bee8 <__fp_mintl+0x2c> 3bede: 9a 95 dec r25 3bee0: 66 0f add r22, r22 3bee2: 77 1f adc r23, r23 3bee4: 88 1f adc r24, r24 3bee6: da f7 brpl .-10 ; 0x3bede <__fp_mintl+0x22> 3bee8: 88 0f add r24, r24 3beea: 96 95 lsr r25 3beec: 87 95 ror r24 3beee: 97 f9 bld r25, 7 3bef0: 08 95 ret 0003bef2 <__fp_mpack>: 3bef2: 9f 3f cpi r25, 0xFF ; 255 3bef4: 31 f0 breq .+12 ; 0x3bf02 <__fp_mpack_finite+0xc> 0003bef6 <__fp_mpack_finite>: 3bef6: 91 50 subi r25, 0x01 ; 1 3bef8: 20 f4 brcc .+8 ; 0x3bf02 <__fp_mpack_finite+0xc> 3befa: 87 95 ror r24 3befc: 77 95 ror r23 3befe: 67 95 ror r22 3bf00: b7 95 ror r27 3bf02: 88 0f add r24, r24 3bf04: 91 1d adc r25, r1 3bf06: 96 95 lsr r25 3bf08: 87 95 ror r24 3bf0a: 97 f9 bld r25, 7 3bf0c: 08 95 ret 0003bf0e <__fp_powser>: 3bf0e: df 93 push r29 3bf10: cf 93 push r28 3bf12: 1f 93 push r17 3bf14: 0f 93 push r16 3bf16: ff 92 push r15 3bf18: ef 92 push r14 3bf1a: df 92 push r13 3bf1c: 7b 01 movw r14, r22 3bf1e: 8c 01 movw r16, r24 3bf20: 68 94 set 3bf22: 06 c0 rjmp .+12 ; 0x3bf30 <__fp_powser+0x22> 3bf24: da 2e mov r13, r26 3bf26: ef 01 movw r28, r30 3bf28: 0f 94 34 d7 call 0x3ae68 ; 0x3ae68 <__mulsf3x> 3bf2c: fe 01 movw r30, r28 3bf2e: e8 94 clt 3bf30: a5 91 lpm r26, Z+ 3bf32: 25 91 lpm r18, Z+ 3bf34: 35 91 lpm r19, Z+ 3bf36: 45 91 lpm r20, Z+ 3bf38: 55 91 lpm r21, Z+ 3bf3a: a6 f3 brts .-24 ; 0x3bf24 <__fp_powser+0x16> 3bf3c: ef 01 movw r28, r30 3bf3e: 0f 94 93 dd call 0x3bb26 ; 0x3bb26 <__addsf3x> 3bf42: fe 01 movw r30, r28 3bf44: 97 01 movw r18, r14 3bf46: a8 01 movw r20, r16 3bf48: da 94 dec r13 3bf4a: 69 f7 brne .-38 ; 0x3bf26 <__fp_powser+0x18> 3bf4c: df 90 pop r13 3bf4e: ef 90 pop r14 3bf50: ff 90 pop r15 3bf52: 0f 91 pop r16 3bf54: 1f 91 pop r17 3bf56: cf 91 pop r28 3bf58: df 91 pop r29 3bf5a: 08 95 ret 3bf5c: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 0003bf60 <__fp_rempio2>: 3bf60: 0f 94 be d7 call 0x3af7c ; 0x3af7c <__fp_splitA> 3bf64: d8 f3 brcs .-10 ; 0x3bf5c <__fp_powser+0x4e> 3bf66: e8 94 clt 3bf68: e0 e0 ldi r30, 0x00 ; 0 3bf6a: bb 27 eor r27, r27 3bf6c: 9f 57 subi r25, 0x7F ; 127 3bf6e: f0 f0 brcs .+60 ; 0x3bfac <__fp_rempio2+0x4c> 3bf70: 2a ed ldi r18, 0xDA ; 218 3bf72: 3f e0 ldi r19, 0x0F ; 15 3bf74: 49 ec ldi r20, 0xC9 ; 201 3bf76: 06 c0 rjmp .+12 ; 0x3bf84 <__fp_rempio2+0x24> 3bf78: ee 0f add r30, r30 3bf7a: bb 0f add r27, r27 3bf7c: 66 1f adc r22, r22 3bf7e: 77 1f adc r23, r23 3bf80: 88 1f adc r24, r24 3bf82: 28 f0 brcs .+10 ; 0x3bf8e <__fp_rempio2+0x2e> 3bf84: b2 3a cpi r27, 0xA2 ; 162 3bf86: 62 07 cpc r22, r18 3bf88: 73 07 cpc r23, r19 3bf8a: 84 07 cpc r24, r20 3bf8c: 28 f0 brcs .+10 ; 0x3bf98 <__fp_rempio2+0x38> 3bf8e: b2 5a subi r27, 0xA2 ; 162 3bf90: 62 0b sbc r22, r18 3bf92: 73 0b sbc r23, r19 3bf94: 84 0b sbc r24, r20 3bf96: e3 95 inc r30 3bf98: 9a 95 dec r25 3bf9a: 72 f7 brpl .-36 ; 0x3bf78 <__fp_rempio2+0x18> 3bf9c: 80 38 cpi r24, 0x80 ; 128 3bf9e: 30 f4 brcc .+12 ; 0x3bfac <__fp_rempio2+0x4c> 3bfa0: 9a 95 dec r25 3bfa2: bb 0f add r27, r27 3bfa4: 66 1f adc r22, r22 3bfa6: 77 1f adc r23, r23 3bfa8: 88 1f adc r24, r24 3bfaa: d2 f7 brpl .-12 ; 0x3bfa0 <__fp_rempio2+0x40> 3bfac: 90 48 sbci r25, 0x80 ; 128 3bfae: 0d 94 7b df jmp 0x3bef6 ; 0x3bef6 <__fp_mpack_finite> 0003bfb2 <__fp_sinus>: 3bfb2: ef 93 push r30 3bfb4: e0 ff sbrs r30, 0 3bfb6: 07 c0 rjmp .+14 ; 0x3bfc6 <__fp_sinus+0x14> 3bfb8: a2 ea ldi r26, 0xA2 ; 162 3bfba: 2a ed ldi r18, 0xDA ; 218 3bfbc: 3f e0 ldi r19, 0x0F ; 15 3bfbe: 49 ec ldi r20, 0xC9 ; 201 3bfc0: 5f eb ldi r21, 0xBF ; 191 3bfc2: 0f 94 93 dd call 0x3bb26 ; 0x3bb26 <__addsf3x> 3bfc6: 0f 94 a5 d7 call 0x3af4a ; 0x3af4a <__fp_round> 3bfca: 0f 90 pop r0 3bfcc: 03 94 inc r0 3bfce: 01 fc sbrc r0, 1 3bfd0: 90 58 subi r25, 0x80 ; 128 3bfd2: ef ec ldi r30, 0xCF ; 207 3bfd4: f0 e7 ldi r31, 0x70 ; 112 3bfd6: 0d 94 d0 e1 jmp 0x3c3a0 ; 0x3c3a0 <__fp_powsodd> 0003bfda <__fp_trunc>: 3bfda: 0f 94 be d7 call 0x3af7c ; 0x3af7c <__fp_splitA> 3bfde: a0 f0 brcs .+40 ; 0x3c008 <__fp_trunc+0x2e> 3bfe0: be e7 ldi r27, 0x7E ; 126 3bfe2: b9 17 cp r27, r25 3bfe4: 88 f4 brcc .+34 ; 0x3c008 <__fp_trunc+0x2e> 3bfe6: bb 27 eor r27, r27 3bfe8: 9f 38 cpi r25, 0x8F ; 143 3bfea: 60 f4 brcc .+24 ; 0x3c004 <__fp_trunc+0x2a> 3bfec: 16 16 cp r1, r22 3bfee: b1 1d adc r27, r1 3bff0: 67 2f mov r22, r23 3bff2: 78 2f mov r23, r24 3bff4: 88 27 eor r24, r24 3bff6: 98 5f subi r25, 0xF8 ; 248 3bff8: f7 cf rjmp .-18 ; 0x3bfe8 <__fp_trunc+0xe> 3bffa: 86 95 lsr r24 3bffc: 77 95 ror r23 3bffe: 67 95 ror r22 3c000: b1 1d adc r27, r1 3c002: 93 95 inc r25 3c004: 96 39 cpi r25, 0x96 ; 150 3c006: c8 f3 brcs .-14 ; 0x3bffa <__fp_trunc+0x20> 3c008: 08 95 ret 0003c00a <__gesf2>: 3c00a: 0f 94 3a df call 0x3be74 ; 0x3be74 <__fp_cmp> 3c00e: 08 f4 brcc .+2 ; 0x3c012 <__gesf2+0x8> 3c010: 8f ef ldi r24, 0xFF ; 255 3c012: 08 95 ret 3c014: 0f 94 97 d7 call 0x3af2e ; 0x3af2e <__fp_pscA> 3c018: 29 f0 breq .+10 ; 0x3c024 <__gesf2+0x1a> 3c01a: 0f 94 9e d7 call 0x3af3c ; 0x3af3c <__fp_pscB> 3c01e: 11 f0 breq .+4 ; 0x3c024 <__gesf2+0x1a> 3c020: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 3c024: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 3c028: b9 01 movw r22, r18 3c02a: ca 01 movw r24, r20 3c02c: 0d 94 79 df jmp 0x3bef2 ; 0x3bef2 <__fp_mpack> 0003c030 : 3c030: 9f 77 andi r25, 0x7F ; 127 3c032: 5f 77 andi r21, 0x7F ; 127 3c034: 0f 94 b6 d7 call 0x3af6c ; 0x3af6c <__fp_split3> 3c038: 68 f3 brcs .-38 ; 0x3c014 <__gesf2+0xa> 3c03a: 99 23 and r25, r25 3c03c: a9 f3 breq .-22 ; 0x3c028 <__gesf2+0x1e> 3c03e: 55 23 and r21, r21 3c040: a9 f3 breq .-22 ; 0x3c02c <__gesf2+0x22> 3c042: ff 27 eor r31, r31 3c044: 95 17 cp r25, r21 3c046: 58 f4 brcc .+22 ; 0x3c05e 3c048: e5 2f mov r30, r21 3c04a: e9 1b sub r30, r25 3c04c: ed 30 cpi r30, 0x0D ; 13 3c04e: 60 f7 brcc .-40 ; 0x3c028 <__gesf2+0x1e> 3c050: 5e 3b cpi r21, 0xBE ; 190 3c052: 10 f0 brcs .+4 ; 0x3c058 3c054: f1 e4 ldi r31, 0x41 ; 65 3c056: 1c c0 rjmp .+56 ; 0x3c090 3c058: 90 34 cpi r25, 0x40 ; 64 3c05a: e0 f4 brcc .+56 ; 0x3c094 3c05c: 0a c0 rjmp .+20 ; 0x3c072 3c05e: e9 2f mov r30, r25 3c060: e5 1b sub r30, r21 3c062: ed 30 cpi r30, 0x0D ; 13 3c064: 18 f7 brcc .-58 ; 0x3c02c <__gesf2+0x22> 3c066: 9e 3b cpi r25, 0xBE ; 190 3c068: 10 f0 brcs .+4 ; 0x3c06e 3c06a: f1 e4 ldi r31, 0x41 ; 65 3c06c: 11 c0 rjmp .+34 ; 0x3c090 3c06e: 50 34 cpi r21, 0x40 ; 64 3c070: 88 f4 brcc .+34 ; 0x3c094 3c072: f9 ea ldi r31, 0xA9 ; 169 3c074: 88 23 and r24, r24 3c076: 2a f0 brmi .+10 ; 0x3c082 3c078: 9a 95 dec r25 3c07a: 66 0f add r22, r22 3c07c: 77 1f adc r23, r23 3c07e: 88 1f adc r24, r24 3c080: da f7 brpl .-10 ; 0x3c078 3c082: 44 23 and r20, r20 3c084: 2a f0 brmi .+10 ; 0x3c090 3c086: 5a 95 dec r21 3c088: 22 0f add r18, r18 3c08a: 33 1f adc r19, r19 3c08c: 44 1f adc r20, r20 3c08e: da f7 brpl .-10 ; 0x3c086 3c090: 9f 1b sub r25, r31 3c092: 5f 1b sub r21, r31 3c094: ff 93 push r31 3c096: 1f 93 push r17 3c098: 0f 93 push r16 3c09a: ff 92 push r15 3c09c: ef 92 push r14 3c09e: 79 01 movw r14, r18 3c0a0: 8a 01 movw r16, r20 3c0a2: bb 27 eor r27, r27 3c0a4: ab 2f mov r26, r27 3c0a6: 9b 01 movw r18, r22 3c0a8: ac 01 movw r20, r24 3c0aa: 0f 94 37 d7 call 0x3ae6e ; 0x3ae6e <__mulsf3_pse> 3c0ae: 97 01 movw r18, r14 3c0b0: a8 01 movw r20, r16 3c0b2: bf 93 push r27 3c0b4: 7b 01 movw r14, r22 3c0b6: 8c 01 movw r16, r24 3c0b8: aa 27 eor r26, r26 3c0ba: ba 2f mov r27, r26 3c0bc: b9 01 movw r22, r18 3c0be: ca 01 movw r24, r20 3c0c0: 0f 94 37 d7 call 0x3ae6e ; 0x3ae6e <__mulsf3_pse> 3c0c4: af 91 pop r26 3c0c6: 97 01 movw r18, r14 3c0c8: a8 01 movw r20, r16 3c0ca: ef 90 pop r14 3c0cc: ff 90 pop r15 3c0ce: 0f 91 pop r16 3c0d0: 1f 91 pop r17 3c0d2: 0f 94 93 dd call 0x3bb26 ; 0x3bb26 <__addsf3x> 3c0d6: 0f 94 a5 d7 call 0x3af4a ; 0x3af4a <__fp_round> 3c0da: 0f 94 4a e1 call 0x3c294 ; 0x3c294 3c0de: 4f 91 pop r20 3c0e0: 40 ff sbrs r20, 0 3c0e2: 08 95 ret 3c0e4: 55 27 eor r21, r21 3c0e6: 47 fd sbrc r20, 7 3c0e8: 50 95 com r21 3c0ea: 0d 94 83 e0 jmp 0x3c106 ; 0x3c106 0003c0ee : 3c0ee: 9b 01 movw r18, r22 3c0f0: ac 01 movw r20, r24 3c0f2: 60 e0 ldi r22, 0x00 ; 0 3c0f4: 70 e0 ldi r23, 0x00 ; 0 3c0f6: 80 e8 ldi r24, 0x80 ; 128 3c0f8: 9f e3 ldi r25, 0x3F ; 63 3c0fa: 0d 94 7b de jmp 0x3bcf6 ; 0x3bcf6 <__divsf3> 3c0fe: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 3c102: 0d 94 79 df jmp 0x3bef2 ; 0x3bef2 <__fp_mpack> 0003c106 : 3c106: 0f 94 be d7 call 0x3af7c ; 0x3af7c <__fp_splitA> 3c10a: d8 f3 brcs .-10 ; 0x3c102 3c10c: 99 23 and r25, r25 3c10e: c9 f3 breq .-14 ; 0x3c102 3c110: 94 0f add r25, r20 3c112: 51 1d adc r21, r1 3c114: a3 f3 brvs .-24 ; 0x3c0fe 3c116: 91 50 subi r25, 0x01 ; 1 3c118: 50 40 sbci r21, 0x00 ; 0 3c11a: 94 f0 brlt .+36 ; 0x3c140 3c11c: 59 f0 breq .+22 ; 0x3c134 3c11e: 88 23 and r24, r24 3c120: 32 f0 brmi .+12 ; 0x3c12e 3c122: 66 0f add r22, r22 3c124: 77 1f adc r23, r23 3c126: 88 1f adc r24, r24 3c128: 91 50 subi r25, 0x01 ; 1 3c12a: 50 40 sbci r21, 0x00 ; 0 3c12c: c1 f7 brne .-16 ; 0x3c11e 3c12e: 9e 3f cpi r25, 0xFE ; 254 3c130: 51 05 cpc r21, r1 3c132: 2c f7 brge .-54 ; 0x3c0fe 3c134: 88 0f add r24, r24 3c136: 91 1d adc r25, r1 3c138: 96 95 lsr r25 3c13a: 87 95 ror r24 3c13c: 97 f9 bld r25, 7 3c13e: 08 95 ret 3c140: 5f 3f cpi r21, 0xFF ; 255 3c142: ac f0 brlt .+42 ; 0x3c16e 3c144: 98 3e cpi r25, 0xE8 ; 232 3c146: 9c f0 brlt .+38 ; 0x3c16e 3c148: bb 27 eor r27, r27 3c14a: 86 95 lsr r24 3c14c: 77 95 ror r23 3c14e: 67 95 ror r22 3c150: b7 95 ror r27 3c152: 08 f4 brcc .+2 ; 0x3c156 3c154: b1 60 ori r27, 0x01 ; 1 3c156: 93 95 inc r25 3c158: c1 f7 brne .-16 ; 0x3c14a 3c15a: bb 0f add r27, r27 3c15c: 58 f7 brcc .-42 ; 0x3c134 3c15e: 11 f4 brne .+4 ; 0x3c164 3c160: 60 ff sbrs r22, 0 3c162: e8 cf rjmp .-48 ; 0x3c134 3c164: 6f 5f subi r22, 0xFF ; 255 3c166: 7f 4f sbci r23, 0xFF ; 255 3c168: 8f 4f sbci r24, 0xFF ; 255 3c16a: 9f 4f sbci r25, 0xFF ; 255 3c16c: e3 cf rjmp .-58 ; 0x3c134 3c16e: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 0003c172 : 3c172: 0f 94 be d7 call 0x3af7c ; 0x3af7c <__fp_splitA> 3c176: 58 f1 brcs .+86 ; 0x3c1ce 3c178: 9e 57 subi r25, 0x7E ; 126 3c17a: 60 f1 brcs .+88 ; 0x3c1d4 3c17c: 98 51 subi r25, 0x18 ; 24 3c17e: a0 f0 brcs .+40 ; 0x3c1a8 3c180: e9 f0 breq .+58 ; 0x3c1bc 3c182: 98 30 cpi r25, 0x08 ; 8 3c184: 20 f5 brcc .+72 ; 0x3c1ce 3c186: 09 2e mov r0, r25 3c188: 99 27 eor r25, r25 3c18a: 66 0f add r22, r22 3c18c: 77 1f adc r23, r23 3c18e: 88 1f adc r24, r24 3c190: 99 1f adc r25, r25 3c192: 0a 94 dec r0 3c194: d1 f7 brne .-12 ; 0x3c18a 3c196: 12 c0 rjmp .+36 ; 0x3c1bc 3c198: 06 2e mov r0, r22 3c19a: 67 2f mov r22, r23 3c19c: 78 2f mov r23, r24 3c19e: 88 27 eor r24, r24 3c1a0: 98 5f subi r25, 0xF8 ; 248 3c1a2: 11 f4 brne .+4 ; 0x3c1a8 3c1a4: 00 0c add r0, r0 3c1a6: 07 c0 rjmp .+14 ; 0x3c1b6 3c1a8: 99 3f cpi r25, 0xF9 ; 249 3c1aa: b4 f3 brlt .-20 ; 0x3c198 3c1ac: 86 95 lsr r24 3c1ae: 77 95 ror r23 3c1b0: 67 95 ror r22 3c1b2: 93 95 inc r25 3c1b4: d9 f7 brne .-10 ; 0x3c1ac 3c1b6: 61 1d adc r22, r1 3c1b8: 71 1d adc r23, r1 3c1ba: 81 1d adc r24, r1 3c1bc: 3e f4 brtc .+14 ; 0x3c1cc 3c1be: 90 95 com r25 3c1c0: 80 95 com r24 3c1c2: 70 95 com r23 3c1c4: 61 95 neg r22 3c1c6: 7f 4f sbci r23, 0xFF ; 255 3c1c8: 8f 4f sbci r24, 0xFF ; 255 3c1ca: 9f 4f sbci r25, 0xFF ; 255 3c1cc: 08 95 ret 3c1ce: 68 94 set 3c1d0: 0d 94 d9 d7 jmp 0x3afb2 ; 0x3afb2 <__fp_szero> 3c1d4: 0d 94 d8 d7 jmp 0x3afb0 ; 0x3afb0 <__fp_zero> 0003c1d8 : 3c1d8: fa 01 movw r30, r20 3c1da: ee 0f add r30, r30 3c1dc: ff 1f adc r31, r31 3c1de: 30 96 adiw r30, 0x00 ; 0 3c1e0: 21 05 cpc r18, r1 3c1e2: 31 05 cpc r19, r1 3c1e4: a1 f1 breq .+104 ; 0x3c24e 3c1e6: 61 15 cp r22, r1 3c1e8: 71 05 cpc r23, r1 3c1ea: 61 f4 brne .+24 ; 0x3c204 3c1ec: 80 38 cpi r24, 0x80 ; 128 3c1ee: bf e3 ldi r27, 0x3F ; 63 3c1f0: 9b 07 cpc r25, r27 3c1f2: 49 f1 breq .+82 ; 0x3c246 3c1f4: 68 94 set 3c1f6: 90 38 cpi r25, 0x80 ; 128 3c1f8: 81 05 cpc r24, r1 3c1fa: 61 f0 breq .+24 ; 0x3c214 3c1fc: 80 38 cpi r24, 0x80 ; 128 3c1fe: bf ef ldi r27, 0xFF ; 255 3c200: 9b 07 cpc r25, r27 3c202: 41 f0 breq .+16 ; 0x3c214 3c204: 99 23 and r25, r25 3c206: 4a f5 brpl .+82 ; 0x3c25a 3c208: ff 3f cpi r31, 0xFF ; 255 3c20a: e1 05 cpc r30, r1 3c20c: 31 05 cpc r19, r1 3c20e: 21 05 cpc r18, r1 3c210: 19 f1 breq .+70 ; 0x3c258 3c212: e8 94 clt 3c214: 08 94 sec 3c216: e7 95 ror r30 3c218: d9 01 movw r26, r18 3c21a: aa 23 and r26, r26 3c21c: 29 f4 brne .+10 ; 0x3c228 3c21e: ab 2f mov r26, r27 3c220: be 2f mov r27, r30 3c222: f8 5f subi r31, 0xF8 ; 248 3c224: d0 f3 brcs .-12 ; 0x3c21a 3c226: 10 c0 rjmp .+32 ; 0x3c248 3c228: ff 5f subi r31, 0xFF ; 255 3c22a: 70 f4 brcc .+28 ; 0x3c248 3c22c: a6 95 lsr r26 3c22e: e0 f7 brcc .-8 ; 0x3c228 3c230: f7 39 cpi r31, 0x97 ; 151 3c232: 50 f0 brcs .+20 ; 0x3c248 3c234: 19 f0 breq .+6 ; 0x3c23c 3c236: ff 3a cpi r31, 0xAF ; 175 3c238: 38 f4 brcc .+14 ; 0x3c248 3c23a: 9f 77 andi r25, 0x7F ; 127 3c23c: 9f 93 push r25 3c23e: 0d d0 rcall .+26 ; 0x3c25a 3c240: 0f 90 pop r0 3c242: 07 fc sbrc r0, 7 3c244: 90 58 subi r25, 0x80 ; 128 3c246: 08 95 ret 3c248: 46 f0 brts .+16 ; 0x3c25a 3c24a: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 3c24e: 60 e0 ldi r22, 0x00 ; 0 3c250: 70 e0 ldi r23, 0x00 ; 0 3c252: 80 e8 ldi r24, 0x80 ; 128 3c254: 9f e3 ldi r25, 0x3F ; 63 3c256: 08 95 ret 3c258: 4f e7 ldi r20, 0x7F ; 127 3c25a: 9f 77 andi r25, 0x7F ; 127 3c25c: 5f 93 push r21 3c25e: 4f 93 push r20 3c260: 3f 93 push r19 3c262: 2f 93 push r18 3c264: 0f 94 ec e1 call 0x3c3d8 ; 0x3c3d8 3c268: 2f 91 pop r18 3c26a: 3f 91 pop r19 3c26c: 4f 91 pop r20 3c26e: 5f 91 pop r21 3c270: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3c274: 0d 94 97 e1 jmp 0x3c32e ; 0x3c32e 0003c278 : 3c278: 9f 93 push r25 3c27a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__fp_rempio2> 3c27e: 0f 90 pop r0 3c280: 07 fc sbrc r0, 7 3c282: ee 5f subi r30, 0xFE ; 254 3c284: 0d 94 d9 df jmp 0x3bfb2 ; 0x3bfb2 <__fp_sinus> 3c288: 19 f4 brne .+6 ; 0x3c290 3c28a: 16 f4 brtc .+4 ; 0x3c290 3c28c: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 3c290: 0d 94 79 df jmp 0x3bef2 ; 0x3bef2 <__fp_mpack> 0003c294 : 3c294: 0f 94 be d7 call 0x3af7c ; 0x3af7c <__fp_splitA> 3c298: b8 f3 brcs .-18 ; 0x3c288 3c29a: 99 23 and r25, r25 3c29c: c9 f3 breq .-14 ; 0x3c290 3c29e: b6 f3 brts .-20 ; 0x3c28c 3c2a0: 9f 57 subi r25, 0x7F ; 127 3c2a2: 55 0b sbc r21, r21 3c2a4: 87 ff sbrs r24, 7 3c2a6: 0f 94 c9 e1 call 0x3c392 ; 0x3c392 <__fp_norm2> 3c2aa: 00 24 eor r0, r0 3c2ac: a0 e6 ldi r26, 0x60 ; 96 3c2ae: 40 ea ldi r20, 0xA0 ; 160 3c2b0: 90 01 movw r18, r0 3c2b2: 80 58 subi r24, 0x80 ; 128 3c2b4: 56 95 lsr r21 3c2b6: 97 95 ror r25 3c2b8: 28 f4 brcc .+10 ; 0x3c2c4 3c2ba: 80 5c subi r24, 0xC0 ; 192 3c2bc: 66 0f add r22, r22 3c2be: 77 1f adc r23, r23 3c2c0: 88 1f adc r24, r24 3c2c2: 20 f0 brcs .+8 ; 0x3c2cc 3c2c4: 26 17 cp r18, r22 3c2c6: 37 07 cpc r19, r23 3c2c8: 48 07 cpc r20, r24 3c2ca: 30 f4 brcc .+12 ; 0x3c2d8 3c2cc: 62 1b sub r22, r18 3c2ce: 73 0b sbc r23, r19 3c2d0: 84 0b sbc r24, r20 3c2d2: 20 29 or r18, r0 3c2d4: 31 29 or r19, r1 3c2d6: 4a 2b or r20, r26 3c2d8: a6 95 lsr r26 3c2da: 17 94 ror r1 3c2dc: 07 94 ror r0 3c2de: 20 25 eor r18, r0 3c2e0: 31 25 eor r19, r1 3c2e2: 4a 27 eor r20, r26 3c2e4: 58 f7 brcc .-42 ; 0x3c2bc 3c2e6: 66 0f add r22, r22 3c2e8: 77 1f adc r23, r23 3c2ea: 88 1f adc r24, r24 3c2ec: 20 f0 brcs .+8 ; 0x3c2f6 3c2ee: 26 17 cp r18, r22 3c2f0: 37 07 cpc r19, r23 3c2f2: 48 07 cpc r20, r24 3c2f4: 30 f4 brcc .+12 ; 0x3c302 3c2f6: 62 0b sbc r22, r18 3c2f8: 73 0b sbc r23, r19 3c2fa: 84 0b sbc r24, r20 3c2fc: 20 0d add r18, r0 3c2fe: 31 1d adc r19, r1 3c300: 41 1d adc r20, r1 3c302: a0 95 com r26 3c304: 81 f7 brne .-32 ; 0x3c2e6 3c306: b9 01 movw r22, r18 3c308: 84 2f mov r24, r20 3c30a: 91 58 subi r25, 0x81 ; 129 3c30c: 88 0f add r24, r24 3c30e: 96 95 lsr r25 3c310: 87 95 ror r24 3c312: 08 95 ret 0003c314 <__unordsf2>: 3c314: 0f 94 3a df call 0x3be74 ; 0x3be74 <__fp_cmp> 3c318: 88 0b sbc r24, r24 3c31a: 99 0b sbc r25, r25 3c31c: 08 95 ret 3c31e: 29 f4 brne .+10 ; 0x3c32a <__unordsf2+0x16> 3c320: 16 f0 brts .+4 ; 0x3c326 <__unordsf2+0x12> 3c322: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 3c326: 0d 94 d8 d7 jmp 0x3afb0 ; 0x3afb0 <__fp_zero> 3c32a: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 0003c32e : 3c32e: 0f 94 be d7 call 0x3af7c ; 0x3af7c <__fp_splitA> 3c332: a8 f3 brcs .-22 ; 0x3c31e <__unordsf2+0xa> 3c334: 96 38 cpi r25, 0x86 ; 134 3c336: a0 f7 brcc .-24 ; 0x3c320 <__unordsf2+0xc> 3c338: 07 f8 bld r0, 7 3c33a: 0f 92 push r0 3c33c: e8 94 clt 3c33e: 2b e3 ldi r18, 0x3B ; 59 3c340: 3a ea ldi r19, 0xAA ; 170 3c342: 48 eb ldi r20, 0xB8 ; 184 3c344: 5f e7 ldi r21, 0x7F ; 127 3c346: 0f 94 37 d7 call 0x3ae6e ; 0x3ae6e <__mulsf3_pse> 3c34a: 0f 92 push r0 3c34c: 0f 92 push r0 3c34e: 0f 92 push r0 3c350: 4d b7 in r20, 0x3d ; 61 3c352: 5e b7 in r21, 0x3e ; 62 3c354: 0f 92 push r0 3c356: 0f 94 34 e2 call 0x3c468 ; 0x3c468 3c35a: ed ee ldi r30, 0xED ; 237 3c35c: f0 e7 ldi r31, 0x70 ; 112 3c35e: 0f 94 87 df call 0x3bf0e ; 0x3bf0e <__fp_powser> 3c362: 4f 91 pop r20 3c364: 5f 91 pop r21 3c366: ef 91 pop r30 3c368: ff 91 pop r31 3c36a: e5 95 asr r30 3c36c: ee 1f adc r30, r30 3c36e: ff 1f adc r31, r31 3c370: 49 f0 breq .+18 ; 0x3c384 3c372: fe 57 subi r31, 0x7E ; 126 3c374: e0 68 ori r30, 0x80 ; 128 3c376: 44 27 eor r20, r20 3c378: ee 0f add r30, r30 3c37a: 44 1f adc r20, r20 3c37c: fa 95 dec r31 3c37e: e1 f7 brne .-8 ; 0x3c378 3c380: 41 95 neg r20 3c382: 55 0b sbc r21, r21 3c384: 0f 94 83 e0 call 0x3c106 ; 0x3c106 3c388: 0f 90 pop r0 3c38a: 07 fe sbrs r0, 7 3c38c: 0d 94 77 e0 jmp 0x3c0ee ; 0x3c0ee 3c390: 08 95 ret 0003c392 <__fp_norm2>: 3c392: 91 50 subi r25, 0x01 ; 1 3c394: 50 40 sbci r21, 0x00 ; 0 3c396: 66 0f add r22, r22 3c398: 77 1f adc r23, r23 3c39a: 88 1f adc r24, r24 3c39c: d2 f7 brpl .-12 ; 0x3c392 <__fp_norm2> 3c39e: 08 95 ret 0003c3a0 <__fp_powsodd>: 3c3a0: 9f 93 push r25 3c3a2: 8f 93 push r24 3c3a4: 7f 93 push r23 3c3a6: 6f 93 push r22 3c3a8: ff 93 push r31 3c3aa: ef 93 push r30 3c3ac: 9b 01 movw r18, r22 3c3ae: ac 01 movw r20, r24 3c3b0: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__mulsf3> 3c3b4: ef 91 pop r30 3c3b6: ff 91 pop r31 3c3b8: 0f 94 87 df call 0x3bf0e ; 0x3bf0e <__fp_powser> 3c3bc: 2f 91 pop r18 3c3be: 3f 91 pop r19 3c3c0: 4f 91 pop r20 3c3c2: 5f 91 pop r21 3c3c4: 0d 94 21 d7 jmp 0x3ae42 ; 0x3ae42 <__mulsf3> 3c3c8: 16 f0 brts .+4 ; 0x3c3ce <__fp_powsodd+0x2e> 3c3ca: 0d 94 79 df jmp 0x3bef2 ; 0x3bef2 <__fp_mpack> 3c3ce: 0d 94 94 d7 jmp 0x3af28 ; 0x3af28 <__fp_nan> 3c3d2: 68 94 set 3c3d4: 0d 94 8e d7 jmp 0x3af1c ; 0x3af1c <__fp_inf> 0003c3d8 : 3c3d8: 0f 94 be d7 call 0x3af7c ; 0x3af7c <__fp_splitA> 3c3dc: a8 f3 brcs .-22 ; 0x3c3c8 <__fp_powsodd+0x28> 3c3de: 99 23 and r25, r25 3c3e0: c1 f3 breq .-16 ; 0x3c3d2 <__fp_powsodd+0x32> 3c3e2: ae f3 brts .-22 ; 0x3c3ce <__fp_powsodd+0x2e> 3c3e4: df 93 push r29 3c3e6: cf 93 push r28 3c3e8: 1f 93 push r17 3c3ea: 0f 93 push r16 3c3ec: ff 92 push r15 3c3ee: c9 2f mov r28, r25 3c3f0: dd 27 eor r29, r29 3c3f2: 88 23 and r24, r24 3c3f4: 2a f0 brmi .+10 ; 0x3c400 3c3f6: 21 97 sbiw r28, 0x01 ; 1 3c3f8: 66 0f add r22, r22 3c3fa: 77 1f adc r23, r23 3c3fc: 88 1f adc r24, r24 3c3fe: da f7 brpl .-10 ; 0x3c3f6 3c400: 20 e0 ldi r18, 0x00 ; 0 3c402: 30 e0 ldi r19, 0x00 ; 0 3c404: 40 e8 ldi r20, 0x80 ; 128 3c406: 5f eb ldi r21, 0xBF ; 191 3c408: 9f e3 ldi r25, 0x3F ; 63 3c40a: 88 39 cpi r24, 0x98 ; 152 3c40c: 20 f0 brcs .+8 ; 0x3c416 3c40e: 80 3e cpi r24, 0xE0 ; 224 3c410: 38 f0 brcs .+14 ; 0x3c420 3c412: 21 96 adiw r28, 0x01 ; 1 3c414: 8f 77 andi r24, 0x7F ; 127 3c416: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 3c41a: e5 e1 ldi r30, 0x15 ; 21 3c41c: f1 e7 ldi r31, 0x71 ; 113 3c41e: 04 c0 rjmp .+8 ; 0x3c428 3c420: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 <__addsf3> 3c424: e2 e4 ldi r30, 0x42 ; 66 3c426: f1 e7 ldi r31, 0x71 ; 113 3c428: 0f 94 87 df call 0x3bf0e ; 0x3bf0e <__fp_powser> 3c42c: 8b 01 movw r16, r22 3c42e: be 01 movw r22, r28 3c430: ec 01 movw r28, r24 3c432: fb 2e mov r15, r27 3c434: 6f 57 subi r22, 0x7F ; 127 3c436: 71 09 sbc r23, r1 3c438: 75 95 asr r23 3c43a: 77 1f adc r23, r23 3c43c: 88 0b sbc r24, r24 3c43e: 99 0b sbc r25, r25 3c440: 0f 94 e2 d6 call 0x3adc4 ; 0x3adc4 <__floatsisf> 3c444: 28 e1 ldi r18, 0x18 ; 24 3c446: 32 e7 ldi r19, 0x72 ; 114 3c448: 41 e3 ldi r20, 0x31 ; 49 3c44a: 5f e3 ldi r21, 0x3F ; 63 3c44c: 0f 94 34 d7 call 0x3ae68 ; 0x3ae68 <__mulsf3x> 3c450: af 2d mov r26, r15 3c452: 98 01 movw r18, r16 3c454: ae 01 movw r20, r28 3c456: ff 90 pop r15 3c458: 0f 91 pop r16 3c45a: 1f 91 pop r17 3c45c: cf 91 pop r28 3c45e: df 91 pop r29 3c460: 0f 94 93 dd call 0x3bb26 ; 0x3bb26 <__addsf3x> 3c464: 0d 94 a5 d7 jmp 0x3af4a ; 0x3af4a <__fp_round> 0003c468 : 3c468: fa 01 movw r30, r20 3c46a: dc 01 movw r26, r24 3c46c: aa 0f add r26, r26 3c46e: bb 1f adc r27, r27 3c470: 9b 01 movw r18, r22 3c472: ac 01 movw r20, r24 3c474: bf 57 subi r27, 0x7F ; 127 3c476: 28 f4 brcc .+10 ; 0x3c482 3c478: 22 27 eor r18, r18 3c47a: 33 27 eor r19, r19 3c47c: 44 27 eor r20, r20 3c47e: 50 78 andi r21, 0x80 ; 128 3c480: 20 c0 rjmp .+64 ; 0x3c4c2 3c482: b7 51 subi r27, 0x17 ; 23 3c484: 90 f4 brcc .+36 ; 0x3c4aa 3c486: ab 2f mov r26, r27 3c488: 00 24 eor r0, r0 3c48a: 46 95 lsr r20 3c48c: 37 95 ror r19 3c48e: 27 95 ror r18 3c490: 01 1c adc r0, r1 3c492: a3 95 inc r26 3c494: d2 f3 brmi .-12 ; 0x3c48a 3c496: 00 20 and r0, r0 3c498: 71 f0 breq .+28 ; 0x3c4b6 3c49a: 22 0f add r18, r18 3c49c: 33 1f adc r19, r19 3c49e: 44 1f adc r20, r20 3c4a0: b3 95 inc r27 3c4a2: da f3 brmi .-10 ; 0x3c49a 3c4a4: 0e d0 rcall .+28 ; 0x3c4c2 3c4a6: 0d 94 7b dd jmp 0x3baf6 ; 0x3baf6 <__subsf3> 3c4aa: 61 30 cpi r22, 0x01 ; 1 3c4ac: 71 05 cpc r23, r1 3c4ae: a0 e8 ldi r26, 0x80 ; 128 3c4b0: 8a 07 cpc r24, r26 3c4b2: b9 46 sbci r27, 0x69 ; 105 3c4b4: 30 f4 brcc .+12 ; 0x3c4c2 3c4b6: 9b 01 movw r18, r22 3c4b8: ac 01 movw r20, r24 3c4ba: 66 27 eor r22, r22 3c4bc: 77 27 eor r23, r23 3c4be: 88 27 eor r24, r24 3c4c0: 90 78 andi r25, 0x80 ; 128 3c4c2: 30 96 adiw r30, 0x00 ; 0 3c4c4: 21 f0 breq .+8 ; 0x3c4ce 3c4c6: 20 83 st Z, r18 3c4c8: 31 83 std Z+1, r19 ; 0x01 3c4ca: 42 83 std Z+2, r20 ; 0x02 3c4cc: 53 83 std Z+3, r21 ; 0x03 3c4ce: 08 95 ret 0003c4d0 : 3c4d0: 91 11 cpse r25, r1 3c4d2: 08 95 ret 3c4d4: 81 54 subi r24, 0x41 ; 65 3c4d6: 8a 51 subi r24, 0x1A ; 26 3c4d8: 08 f4 brcc .+2 ; 0x3c4dc 3c4da: 80 5e subi r24, 0xE0 ; 224 3c4dc: 85 5a subi r24, 0xA5 ; 165 3c4de: 08 95 ret 0003c4e0 : 3c4e0: fb 01 movw r30, r22 3c4e2: dc 01 movw r26, r24 3c4e4: 04 c0 rjmp .+8 ; 0x3c4ee 3c4e6: 8d 91 ld r24, X+ 3c4e8: 01 90 ld r0, Z+ 3c4ea: 80 19 sub r24, r0 3c4ec: 21 f4 brne .+8 ; 0x3c4f6 3c4ee: 41 50 subi r20, 0x01 ; 1 3c4f0: 50 40 sbci r21, 0x00 ; 0 3c4f2: c8 f7 brcc .-14 ; 0x3c4e6 3c4f4: 88 1b sub r24, r24 3c4f6: 99 0b sbc r25, r25 3c4f8: 08 95 ret 0003c4fa : 3c4fa: fb 01 movw r30, r22 3c4fc: dc 01 movw r26, r24 3c4fe: 02 c0 rjmp .+4 ; 0x3c504 3c500: 01 90 ld r0, Z+ 3c502: 0d 92 st X+, r0 3c504: 41 50 subi r20, 0x01 ; 1 3c506: 50 40 sbci r21, 0x00 ; 0 3c508: d8 f7 brcc .-10 ; 0x3c500 3c50a: 08 95 ret 0003c50c : 3c50c: dc 01 movw r26, r24 3c50e: 01 c0 rjmp .+2 ; 0x3c512 3c510: 6d 93 st X+, r22 3c512: 41 50 subi r20, 0x01 ; 1 3c514: 50 40 sbci r21, 0x00 ; 0 3c516: e0 f7 brcc .-8 ; 0x3c510 3c518: 08 95 ret 0003c51a : 3c51a: fb 01 movw r30, r22 3c51c: dc 01 movw r26, r24 3c51e: 8d 91 ld r24, X+ 3c520: 81 34 cpi r24, 0x41 ; 65 3c522: 1c f0 brlt .+6 ; 0x3c52a 3c524: 8b 35 cpi r24, 0x5B ; 91 3c526: 0c f4 brge .+2 ; 0x3c52a 3c528: 80 5e subi r24, 0xE0 ; 224 3c52a: 61 91 ld r22, Z+ 3c52c: 61 34 cpi r22, 0x41 ; 65 3c52e: 1c f0 brlt .+6 ; 0x3c536 3c530: 6b 35 cpi r22, 0x5B ; 91 3c532: 0c f4 brge .+2 ; 0x3c536 3c534: 60 5e subi r22, 0xE0 ; 224 3c536: 86 1b sub r24, r22 3c538: 61 11 cpse r22, r1 3c53a: 89 f3 breq .-30 ; 0x3c51e 3c53c: 99 0b sbc r25, r25 3c53e: 08 95 ret 0003c540 : 3c540: fb 01 movw r30, r22 3c542: dc 01 movw r26, r24 3c544: 0d 90 ld r0, X+ 3c546: 00 20 and r0, r0 3c548: e9 f7 brne .-6 ; 0x3c544 3c54a: 11 97 sbiw r26, 0x01 ; 1 3c54c: 01 90 ld r0, Z+ 3c54e: 0d 92 st X+, r0 3c550: 00 20 and r0, r0 3c552: e1 f7 brne .-8 ; 0x3c54c 3c554: 08 95 ret 0003c556 : 3c556: fc 01 movw r30, r24 3c558: 81 91 ld r24, Z+ 3c55a: 86 17 cp r24, r22 3c55c: 21 f0 breq .+8 ; 0x3c566 3c55e: 88 23 and r24, r24 3c560: d9 f7 brne .-10 ; 0x3c558 3c562: 99 27 eor r25, r25 3c564: 08 95 ret 3c566: 31 97 sbiw r30, 0x01 ; 1 3c568: cf 01 movw r24, r30 3c56a: 08 95 ret 0003c56c : 3c56c: fb 01 movw r30, r22 3c56e: dc 01 movw r26, r24 3c570: 8d 91 ld r24, X+ 3c572: 01 90 ld r0, Z+ 3c574: 80 19 sub r24, r0 3c576: 01 10 cpse r0, r1 3c578: d9 f3 breq .-10 ; 0x3c570 3c57a: 99 0b sbc r25, r25 3c57c: 08 95 ret 0003c57e : 3c57e: fb 01 movw r30, r22 3c580: dc 01 movw r26, r24 3c582: 01 90 ld r0, Z+ 3c584: 0d 92 st X+, r0 3c586: 00 20 and r0, r0 3c588: e1 f7 brne .-8 ; 0x3c582 3c58a: 08 95 ret 0003c58c : 3c58c: fb 01 movw r30, r22 3c58e: dc 01 movw r26, r24 3c590: 41 50 subi r20, 0x01 ; 1 3c592: 50 40 sbci r21, 0x00 ; 0 3c594: 30 f0 brcs .+12 ; 0x3c5a2 3c596: 8d 91 ld r24, X+ 3c598: 01 90 ld r0, Z+ 3c59a: 80 19 sub r24, r0 3c59c: 19 f4 brne .+6 ; 0x3c5a4 3c59e: 00 20 and r0, r0 3c5a0: b9 f7 brne .-18 ; 0x3c590 3c5a2: 88 1b sub r24, r24 3c5a4: 99 0b sbc r25, r25 3c5a6: 08 95 ret 0003c5a8 : 3c5a8: fb 01 movw r30, r22 3c5aa: dc 01 movw r26, r24 3c5ac: 41 50 subi r20, 0x01 ; 1 3c5ae: 50 40 sbci r21, 0x00 ; 0 3c5b0: 48 f0 brcs .+18 ; 0x3c5c4 3c5b2: 01 90 ld r0, Z+ 3c5b4: 0d 92 st X+, r0 3c5b6: 00 20 and r0, r0 3c5b8: c9 f7 brne .-14 ; 0x3c5ac 3c5ba: 01 c0 rjmp .+2 ; 0x3c5be 3c5bc: 1d 92 st X+, r1 3c5be: 41 50 subi r20, 0x01 ; 1 3c5c0: 50 40 sbci r21, 0x00 ; 0 3c5c2: e0 f7 brcc .-8 ; 0x3c5bc 3c5c4: 08 95 ret 0003c5c6 : 3c5c6: 0f 93 push r16 3c5c8: 1f 93 push r17 3c5ca: cf 93 push r28 3c5cc: df 93 push r29 3c5ce: e0 91 1c 18 lds r30, 0x181C ; 0x80181c <__iob+0x2> 3c5d2: f0 91 1d 18 lds r31, 0x181D ; 0x80181d <__iob+0x3> 3c5d6: 23 81 ldd r18, Z+3 ; 0x03 3c5d8: ec 01 movw r28, r24 3c5da: 10 e0 ldi r17, 0x00 ; 0 3c5dc: 00 e0 ldi r16, 0x00 ; 0 3c5de: 21 fd sbrc r18, 1 3c5e0: 08 c0 rjmp .+16 ; 0x3c5f2 3c5e2: 0f ef ldi r16, 0xFF ; 255 3c5e4: 1f ef ldi r17, 0xFF ; 255 3c5e6: 14 c0 rjmp .+40 ; 0x3c610 3c5e8: 19 95 eicall 3c5ea: 89 2b or r24, r25 3c5ec: 11 f0 breq .+4 ; 0x3c5f2 3c5ee: 0f ef ldi r16, 0xFF ; 255 3c5f0: 1f ef ldi r17, 0xFF ; 255 3c5f2: 89 91 ld r24, Y+ 3c5f4: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 3c5f8: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 3c5fc: db 01 movw r26, r22 3c5fe: 18 96 adiw r26, 0x08 ; 8 3c600: ed 91 ld r30, X+ 3c602: fc 91 ld r31, X 3c604: 81 11 cpse r24, r1 3c606: f0 cf rjmp .-32 ; 0x3c5e8 3c608: 8a e0 ldi r24, 0x0A ; 10 3c60a: 19 95 eicall 3c60c: 89 2b or r24, r25 3c60e: 49 f7 brne .-46 ; 0x3c5e2 3c610: c8 01 movw r24, r16 3c612: df 91 pop r29 3c614: cf 91 pop r28 3c616: 1f 91 pop r17 3c618: 0f 91 pop r16 3c61a: 08 95 ret 0003c61c <__do_global_dtors>: 3c61c: 16 e5 ldi r17, 0x56 ; 86 3c61e: c5 e3 ldi r28, 0x35 ; 53 3c620: d6 e5 ldi r29, 0x56 ; 86 3c622: 00 e0 ldi r16, 0x00 ; 0 3c624: 06 c0 rjmp .+12 ; 0x3c632 <__do_global_dtors+0x16> 3c626: 80 2f mov r24, r16 3c628: fe 01 movw r30, r28 3c62a: 0f 94 64 dd call 0x3bac8 ; 0x3bac8 <__tablejump2__> 3c62e: 21 96 adiw r28, 0x01 ; 1 3c630: 01 1d adc r16, r1 3c632: c6 33 cpi r28, 0x36 ; 54 3c634: d1 07 cpc r29, r17 3c636: 80 e0 ldi r24, 0x00 ; 0 3c638: 08 07 cpc r16, r24 3c63a: a9 f7 brne .-22 ; 0x3c626 <__do_global_dtors+0xa> 3c63c: f8 94 cli 0003c63e <__stop_program>: 3c63e: ff cf rjmp .-2 ; 0x3c63e <__stop_program>