MK25-RAMBo10a_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 f4 50 jmp 0xa1e8 ; 0xa1e8 <__dtors_end> 4: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 8: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> c: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 10: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 14: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 18: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 1c: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 20: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 24: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 28: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 2c: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 30: 0c 94 d7 84 jmp 0x109ae ; 0x109ae <__vector_12> 34: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 38: 0d 94 af 10 jmp 0x2215e ; 0x2215e <__vector_14> 3c: 0d 94 f3 0d jmp 0x21be6 ; 0x21be6 <__vector_15> 40: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 44: 0d 94 1d 19 jmp 0x2323a ; 0x2323a <__vector_17> 48: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 4c: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 50: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 54: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 58: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 5c: 0c 94 b3 76 jmp 0xed66 ; 0xed66 <__vector_23> 60: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 64: 0c 94 32 63 jmp 0xc664 ; 0xc664 <__vector_25> 68: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 6c: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 70: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 74: 0c 94 42 ba jmp 0x17484 ; 0x17484 <__vector_29> 78: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 7c: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 80: 0d 94 f9 12 jmp 0x225f2 ; 0x225f2 <__vector_32> 84: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 88: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 8c: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 90: 0c 94 ee 62 jmp 0xc5dc ; 0xc5dc <__vector_36> 94: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 98: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> 9c: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> a0: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> a4: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> a8: 0d 94 18 0b jmp 0x21630 ; 0x21630 <__vector_42> ac: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> b0: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> b4: 0d 94 0d 0b jmp 0x2161a ; 0x2161a <__vector_45> b8: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> bc: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> c0: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> c4: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> c8: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> cc: 0d 94 cd 0a jmp 0x2159a ; 0x2159a <__vector_51> d0: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> d4: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> d8: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> dc: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__bad_interrupt> e0: 0c 94 25 51 jmp 0xa24a ; 0xa24a <__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: 53 6f ori r21, 0xF3 ; 243 3604: 6d 65 ori r22, 0x5D ; 93 3606: 20 70 andi r18, 0x00 ; 0 3608: 72 6f ori r23, 0xF2 ; 242 360a: 62 6c ori r22, 0xC2 ; 194 360c: 65 6d ori r22, 0xD5 ; 213 360e: 20 65 ori r18, 0x50 ; 80 3610: 6e 63 ori r22, 0x3E ; 62 3612: 6f 75 andi r22, 0x5F ; 95 3614: 6e 74 andi r22, 0x4E ; 78 3616: 65 72 andi r22, 0x25 ; 37 3618: 65 64 ori r22, 0x45 ; 69 361a: 2c 20 and r2, r12 361c: 5a 2d mov r21, r10 361e: 6c 65 ori r22, 0x5C ; 92 3620: 76 65 ori r23, 0x56 ; 86 3622: 6c 69 ori r22, 0x9C ; 156 3624: 6e 67 ori r22, 0x7E ; 126 3626: 20 65 ori r18, 0x50 ; 80 3628: 6e 66 ori r22, 0x6E ; 110 362a: 6f 72 andi r22, 0x2F ; 47 362c: 63 65 ori r22, 0x53 ; 83 362e: 64 20 and r6, r4 3630: 2e 2e mov r2, r30 3632: 2e 00 .word 0x002e ; ???? 00003634 : 3634: ff ff 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c ..Mesh bed level 3644: 69 6e 67 20 66 61 69 6c 65 64 2e 20 50 72 69 6e ing failed. Prin 3654: 74 20 63 61 6e 63 65 6c 65 64 2e 00 t canceled.. 00003660 : 3660: ff ff 48 65 61 74 69 6e 67 20 64 69 73 61 62 6c ..Heating disabl 3670: 65 64 20 62 79 20 73 61 66 65 74 79 20 74 69 6d ed by safety tim 3680: 65 72 2e 00 er.. 00003684 : 3684: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3694: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36a4: 6c 65 76 65 6c 2e 00 level.. 000036ab : 36ab: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36bb: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36cb: 6c 65 76 65 6c 2e 20 50 6c 65 61 73 65 20 72 65 level. Please re 36db: 2d 73 6c 69 63 65 20 74 68 65 20 6d 6f 64 65 6c -slice the model 36eb: 20 61 67 61 69 6e 2e 00 again.. 000036f3 : 36f3: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3703: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 3713: 77 61 72 65 2e 00 ware.. 00003719 : 3719: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3729: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 3739: 77 61 72 65 2e 20 50 6c 65 61 73 65 20 75 70 64 ware. Please upd 3749: 61 74 65 20 74 68 65 20 66 69 72 6d 77 61 72 65 ate the firmware 3759: 2e 00 .. 0000375b : 375b: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 376b: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 377b: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 00 printer type.. 00003789 : 3789: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3799: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37a9: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 50 6c printer type. Pl 37b9: 65 61 73 65 20 72 65 2d 73 6c 69 63 65 20 74 68 ease re-slice th 37c9: 65 20 6d 6f 64 65 6c 20 61 67 61 69 6e 2e 00 e model again.. 000037d8 : 37d8: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob 37e8: 20 74 6f 20 70 72 65 68 65 61 74 20 6e 6f 7a 7a to preheat nozz 37f8: 6c 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 2e le and continue. ... 00003809 : 3809: ff ff 50 6c 65 61 73 65 20 70 72 65 73 73 20 74 ..Please press t 3819: 68 65 20 6b 6e 6f 62 20 74 6f 20 75 6e 6c 6f 61 he knob to unloa 3829: 64 20 66 69 6c 61 6d 65 6e 74 00 d filament. 00003834 : 3834: ff ff 61 6e 64 20 70 72 65 73 73 20 74 68 65 20 ..and press the 3844: 6b 6e 6f 62 00 knob. 00003849 : 3849: ff ff 49 6e 73 65 72 74 20 66 69 6c 61 6d 65 6e ..Insert filamen 3859: 74 00 t. 0000385b : 385b: ff ff 43 6f 6c 6f 72 20 6e 6f 74 20 63 6f 72 72 ..Color not corr 386b: 65 63 74 00 ect. 0000386f : 386f: ff ff 46 69 6c 61 6d 65 6e 74 20 6e 6f 74 20 6c ..Filament not l 387f: 6f 61 64 65 64 00 oaded. 00003885 : 3885: ff ff 43 68 61 6e 67 65 64 20 63 6f 72 72 65 63 ..Changed correc 3895: 74 6c 79 00 tly. 00003899 : 3899: ff ff 4c 6f 61 64 69 6e 67 20 63 6f 6c 6f 72 00 ..Loading color. 000038a9 : 38a9: ff ff 43 68 61 6e 67 65 20 73 75 63 63 65 73 73 ..Change success 38b9: 21 00 !. 000038bb : 38bb: ff ff 50 6c 65 61 73 65 20 6f 70 65 6e 20 69 64 ..Please open id 38cb: 6c 65 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 66 ler and remove f 38db: 69 6c 61 6d 65 6e 74 20 6d 61 6e 75 61 6c 6c 79 ilament manually 38eb: 2e 00 .. 000038ed : 38ed: ff ff 57 61 73 20 66 69 6c 61 6d 65 6e 74 20 75 ..Was filament u 38fd: 6e 6c 6f 61 64 20 73 75 63 63 65 73 73 66 75 6c nload successful 390d: 3f 00 ?. 0000390f : 390f: ff ff 50 6c 65 61 73 65 20 75 70 67 72 61 64 65 ..Please upgrade 391f: 2e 00 .. 00003921 : 3921: ff ff 4e 65 77 20 66 69 72 6d 77 61 72 65 20 76 ..New firmware v 3931: 65 72 73 69 6f 6e 20 61 76 61 69 6c 61 62 6c 65 ersion available 3941: 3a 00 :. 00003943 : 3943: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 50 49 ..Waiting for PI 3953: 4e 44 41 20 70 72 6f 62 65 20 63 6f 6f 6c 69 6e NDA probe coolin 3963: 67 00 g. 00003965 : 3965: ff ff 50 6c 65 61 73 65 20 77 61 69 74 00 ..Please wait. 00003973 : 3973: ff ff 4e 6f 20 6d 6f 76 65 2e 00 ..No move.. 0000397e : 397e: ff ff 57 61 69 74 20 66 6f 72 20 75 73 65 72 2e ..Wait for user. 398e: 2e 2e 00 ... 00003991 : 3991: ff ff 53 74 61 62 6c 65 20 61 6d 62 69 65 6e 74 ..Stable ambient 39a1: 20 74 65 6d 70 65 72 61 74 75 72 65 20 32 31 2d temperature 21- 39b1: 32 36 43 20 69 73 20 6e 65 65 64 65 64 20 61 20 26C is needed a 39c1: 72 69 67 69 64 20 73 74 61 6e 64 20 69 73 20 72 rigid stand is r 39d1: 65 71 75 69 72 65 64 2e 00 equired.. 000039da : 39da: ff ff 50 6c 65 61 73 65 20 72 75 6e 20 58 59 5a ..Please run XYZ 39ea: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 69 72 calibration fir 39fa: 73 74 2e 00 st.. 000039fe : 39fe: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 3a0e: 7a 7a 6c 65 21 00 zzle!. 00003a14 : 3a14: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00003a1d : 3a1d: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 3a2d: 6d 20 6d 69 6e 00 m min. 00003a33 : 3a33: ff ff 4c 65 66 74 00 ..Left. 00003a3a : 3a3a: ff ff 52 69 67 68 74 00 ..Right. 00003a42 : 3a42: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00003a52 : 3a52: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00003a60 : 3a60: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00003a6e : 3a6e: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 3a7e: 66 73 65 74 00 fset. 00003a83 : 3a83: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00003a91 : 3a91: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00003aa2 : 3aa2: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00003ab3 : 3ab3: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00003ac4 : 3ac4: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00003ad5 : 3ad5: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 3ae5: 65 3a 00 e:. 00003ae8 : 3ae8: ff ff 41 72 65 20 6c 65 66 74 20 61 6e 64 20 72 ..Are left and r 3af8: 69 67 68 74 20 5a 2d 63 61 72 72 69 61 67 65 73 ight Z-carriages 3b08: 20 61 6c 6c 20 75 70 3f 00 all up?. 00003b11 : 3b11: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 58 59 ..Calibrating XY 3b21: 5a 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e Z. Rotate the kn 3b31: 6f 62 20 74 6f 20 6d 6f 76 65 20 74 68 65 20 5a ob to move the Z 3b41: 20 63 61 72 72 69 61 67 65 20 75 70 20 74 6f 20 carriage up to 3b51: 74 68 65 20 65 6e 64 20 73 74 6f 70 70 65 72 73 the end stoppers 3b61: 2e 20 43 6c 69 63 6b 20 77 68 65 6e 20 64 6f 6e . Click when don 3b71: 65 2e 00 e.. 00003b74 : 3b74: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 2e ..Calibrating Z. 3b84: 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f 62 Rotate the knob 3b94: 20 74 6f 20 6d 6f 76 65 20 74 68 65 20 5a 20 63 to move the Z c 3ba4: 61 72 72 69 61 67 65 20 75 70 20 74 6f 20 74 68 arriage up to th 3bb4: 65 20 65 6e 64 20 73 74 6f 70 70 65 72 73 2e 20 e end stoppers. 3bc4: 43 6c 69 63 6b 20 77 68 65 6e 20 64 6f 6e 65 2e Click when done. ... 00003bd5 : 3bd5: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 3be5: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00003bf0 : 3bf0: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 3c00: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 3c10: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 3c20: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 3c30: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 3c40: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00003c4c : 3c4c: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00003c57 : 3c57: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00003c60 : 3c60: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00003c69 : 3c69: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00003c72 : 3c72: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 3c82: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 3c92: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 3ca2: 65 74 00 et. 00003ca5 : 3ca5: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 3cb5: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00003cc3 : 3cc3: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3cd3: 74 3a 00 t:. 00003cd6 : 3cd6: ff ff 43 61 6e 63 65 6c 00 ..Cancel. 00003cdf : 3cdf: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 3cef: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 3cff: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 3d0f: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 3d1f: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 3d2f: 6e 6e 69 6e 67 2e 00 nning.. 00003d36 : 3d36: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 3d46: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 3d56: 2e 00 .. 00003d58 : 3d58: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 3d68: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 3d78: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 3d88: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 3d98: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00003da4 : 3da4: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 3db4: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 3dc4: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 3dd4: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 3de4: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 3df4: 6c 6f 61 64 20 69 74 2e 00 load it.. 00003dfd : 3dfd: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 3e0d: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 3e1d: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 3e2d: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 3e3d: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 3e4d: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 3e5d: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 3e6d: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 3e7d: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 3e8d: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 00003e9d : 3e9d: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 3ead: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 3ebd: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 3ecd: 2e 00 .. 00003ecf : 3ecf: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 3edf: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 3eef: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 3eff: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 3f0f: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 3f1f: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 00003f28 : 3f28: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 3f38: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 3f48: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 3f58: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 3f68: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 00003f77 : 3f77: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 3f87: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 3f97: 20 69 74 20 6e 6f 77 3f 00 it now?. 00003fa0 : 3fa0: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 3fb0: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 3fc0: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 00003fca : 3fca: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 3fda: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 00003fe7 : 3fe7: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 3ff7: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 4007: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 4017: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 4027: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 4037: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 4047: 2e 00 .. 00004049 : 4049: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 4059: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 00004068 : 4068: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 4078: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 4088: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 4098: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 000040a7 : 40a7: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 40b7: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 40c7: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 40d7: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 40e7: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 40f7: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 4107: 65 65 74 73 2e 00 eets.. 0000410d : 410d: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 411d: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 412d: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 0000413d : 413d: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 414d: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 415d: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 416d: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 417d: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 418d: 64 3f 00 d?. 00004190 : 4190: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 41a0: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 41b0: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 41c0: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 000041d1 : 41d1: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 41e1: 61 64 65 64 3f 00 aded?. 000041e7 : 41e7: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 41f7: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 4207: 50 4c 41 2e 00 PLA.. 0000420c : 420c: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 421c: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 0000422c : 422c: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 423c: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 424c: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 0000425a : 425a: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 426a: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 427a: 20 66 69 72 73 74 2e 00 first.. 00004282 : 4282: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 4292: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 42a2: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 42b2: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 000042c0 : 42c0: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 42d0: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 42e0: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 42f0: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 4300: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 00004309 : 4309: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 4319: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 4329: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 4339: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 4349: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 4359: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 4369: 65 73 73 3f 00 ess?. 0000436e : 436e: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 437e: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 438e: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 439e: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 43ae: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 43be: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 43ce: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 43de: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 43ee: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 43fe: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 440e: 69 6e 74 2e 00 int.. 00004413 : 4413: ff ff 50 61 75 73 65 00 ..Pause. 0000441b : 441b: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 00004427 : 4427: ff ff 43 6f 6e 74 2e 00 ..Cont.. 0000442f : 442f: ff ff 46 2e 20 6a 61 6d 20 64 65 74 65 63 74 00 ..F. jam detect. 0000443f : 443f: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 0000444d : 444d: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 00004459 : 4459: ff ff 43 75 74 74 65 72 00 ..Cutter. 00004462 : 4462: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 0000446e : 446e: ff ff 42 65 64 00 ..Bed. 00004474 : 4474: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 00004481 : 4481: ff ff 4d 6f 64 65 6c 00 ..Model. 00004489 : 4489: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 00004492 : 4492: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 44a2: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 44b2: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 44c2: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 000044cf : 44cf: ff ff 43 68 65 63 6b 73 00 ..Checks. 000044d8 : 44d8: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 000044e4 : 44e4: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 000044ef : 44ef: ff ff 53 6f 72 74 00 ..Sort. 000044f6 : 44f6: ff ff 54 69 6d 65 00 ..Time. 000044fd : 44fd: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00004506 : 4506: ff ff 53 44 20 63 61 72 64 00 ..SD card. 00004510 : 4510: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 4520: 65 00 e. 00004522 : 4522: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00004532 : 4532: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 0000453d : 453d: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 0000454c : 454c: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 455c: 72 73 00 rs. 0000455f : 455f: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 0000456b : 456b: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 00004579 : 4579: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 00004586 : 4586: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 4596: 62 72 2e 00 br.. 0000459a : 459a: ff ff 53 68 6f 77 20 65 6e 64 20 73 74 6f 70 73 ..Show end stops ... 000045ab : 45ab: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 45bb: 6e 00 n. 000045bd : 45bd: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 45cd: 65 63 74 00 ect. 000045d1 : 45d1: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 45e1: 69 6e 67 00 ing. 000045e5 : 45e5: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 000045f3 : 45f3: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 00004603 : 4603: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 0000460e : 460e: ff ff 57 69 7a 61 72 64 00 ..Wizard. 00004617 : 4617: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 4627: 6e 74 00 nt. 0000462a : 462a: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 00004635 : 4635: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 4645: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 4655: 69 61 74 65 6c 79 00 iately. 0000465c : 465c: ff ff 52 65 73 65 74 00 ..Reset. 00004664 : 4664: ff ff 52 65 6e 61 6d 65 00 ..Rename. 0000466d : 466d: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 467d: 6c 2e 00 l.. 00004680 : 4680: ff ff 53 65 6c 65 63 74 00 ..Select. 00004689 : 4689: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 00004698 : 4698: ff ff 53 75 70 70 6f 72 74 00 ..Support. 000046a2 : 46a2: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 000046b3 : 46b3: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 000046c0 : 46c0: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 000046cd : 46cd: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 000046db : 46db: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 46eb: 65 6e 74 00 ent. 000046ef : 46ef: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 000046ff : 46ff: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 470f: 74 00 t. 00004711 : 4711: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 00004722 : 4722: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 00004733 : 4733: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 00004740 : 4740: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00004750 : 4750: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 0000475f : 475f: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 0000476d : 476d: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00004779 : 4779: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00004789 : 4789: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00004793 : 4793: ff ff 54 75 6e 65 00 ..Tune. 0000479a : 479a: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 000047aa : 47aa: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 000047b4 : 47b4: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 000047c2 : 47c2: ff ff 41 73 73 69 73 74 00 ..Assist. 000047cb : 47cb: ff ff 4f 6e 63 65 00 ..Once. 000047d2 : 47d2: ff ff 53 6f 75 6e 64 00 ..Sound. 000047da : 47da: ff ff 4c 6f 75 64 00 ..Loud. 000047e1 : 47e1: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 000047ef : 47ef: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 47ff: 74 00 t. 00004801 : 4801: ff ff 46 6c 6f 77 00 ..Flow. 00004808 : 4808: ff ff 53 70 65 65 64 00 ..Speed. 00004810 : 4810: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 00004820 : 4820: ff ff 4e 2f 41 00 ..N/A. 00004826 : 4826: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00004834 : 4834: ff ff 4d 65 73 68 00 ..Mesh. 0000483b : 483b: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00004846 : 4846: ff ff 59 65 73 00 ..Yes. 0000484c : 484c: ff ff 4e 6f 00 ..No. 00004851 : 4851: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 0000485e : 485e: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 0000486e : 486e: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 487e: 65 2e 00 e.. 00004881 : 4881: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 0000488c : 488c: ff ff 4d 61 69 6e 00 ..Main. 00004893 : 4893: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 48a3: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 48b3: 6c 69 6e 67 00 ling. 000048b8 : 48b8: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 000048c6 : 48c6: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 000048d7 : 48d7: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 000048e1 : 48e1: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 48f1: 73 00 s. 000048f3 : 48f3: ff ff 41 78 69 73 00 ..Axis. 000048fa : 48fa: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00004908 : 4908: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00004917 : 4917: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 4927: 74 00 t. 00004929 : 4929: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 00004933 : 4933: ff ff 4d 6f 74 6f 72 00 ..Motor. 0000493b : 493b: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 00004946 : 4946: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 00004955 : 4955: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 00004962 : 4962: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 00004972 : 4972: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 4982: 74 6f 72 00 tor. 00004986 : 4986: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 00004996 : 4996: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 49a6: 21 00 !. 000049a8 : 49a8: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 49b8: 72 00 r. 000049ba : 49ba: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 000049c7 : 49c7: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 000049d5 : 49d5: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 49e5: 6d 65 00 me. 000049e8 : 49e8: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 49f8: 64 00 d. 000049fa : 49fa: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00004a08 : 4a08: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 4a18: 72 73 00 rs. 00004a1b : 4a1b: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 4a2b: 64 00 d. 00004a2d : 4a2d: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00004a3c : 4a3c: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 4a4c: 73 00 s. 00004a4e : 4a4e: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 4a5e: 73 00 s. 00004a60 : 4a60: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 4a70: 73 00 s. 00004a72 : 4a72: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 4a82: 6f 70 73 00 ops. 00004a86 : 4a86: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 00004a95 : 4a95: ff ff 42 61 63 6b 00 ..Back. 00004a9c : 4a9c: ff ff 41 75 74 6f 20 70 6f 77 65 72 00 ..Auto power. 00004aa9 : 4aa9: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00004ab2 : 4ab2: ff ff 4d 6f 64 65 00 ..Mode. 00004ab9 : 4ab9: ff ff 48 69 67 68 20 70 6f 77 65 72 00 ..High power. 00004ac6 : 4ac6: ff ff 53 74 72 69 63 74 00 ..Strict. 00004acf : 4acf: ff ff 57 61 72 6e 00 ..Warn. 00004ad6 : 4ad6: ff ff 4e 6f 6e 65 00 ..None. 00004add : 4add: ff ff 48 6f 74 65 6e 64 20 61 74 20 32 38 30 43 ..Hotend at 280C 4aed: 21 20 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ! Nozzle changed 4afd: 20 61 6e 64 20 74 69 67 68 74 65 6e 65 64 20 74 and tightened t 4b0d: 6f 20 73 70 65 63 73 3f 00 o specs?. 00004b16 : 4b16: ff ff 46 6f 72 20 61 20 4e 6f 7a 7a 6c 65 20 63 ..For a Nozzle c 4b26: 68 61 6e 67 65 20 70 6c 65 61 73 65 20 72 65 61 hange please rea 4b36: 64 0a 70 72 75 73 61 2e 69 6f 2f 6e 6f 7a 7a 6c d.prusa.io/nozzl 4b46: 65 2d 6d 6b 33 73 00 e-mk3s. 00004b4d : 4b4d: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 4b5d: 68 65 64 00 hed. 00004b61 : 4b61: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 00004b6c : 4b6c: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 00004b7b : 4b7b: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 00004b8b : 4b8b: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 4b9b: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004ba5 : 4ba5: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4bb5: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4bc5: 68 65 20 47 2d 63 6f 64 65 2e 00 he G-code.. 00004bd0 : 4bd0: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4be0: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4bf0: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4c00: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4c10: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 00 e in settings.. 00004c1f : 4c1f: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4c2f: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 00 lament loaded.. 00004c3e : 4c3e: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 4c4e: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 4c5e: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 4c6e: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 4c7e: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 4c8e: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 4c9e: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4cae: 6e 20 66 6c 6f 77 2e 00 n flow.. 00004cb6 : 4cb6: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 4cc6: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 4cd6: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 4ce6: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 4cf6: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 4d06: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 4d16: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 00004d26 : 4d26: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 4d36: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 4d46: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 4d56: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 4d66: 2e 00 .. 00004d68 : 4d68: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 4d78: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 4d88: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 4d98: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 00004da4 : 4da4: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 4db4: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 4dc4: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 4dd4: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004ddf : 4ddf: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4def: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 00004e00 : 4e00: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 4e10: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 4e20: 67 65 64 2e 00 ged.. 00004e25 : 4e25: ff ff 53 68 65 65 74 00 ..Sheet. 00004e2d : 4e2d: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 4e3d: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00004e4a : 4e4a: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 4e5a: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 4e6a: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 4e7a: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 4e8a: 2e 00 .. 00004e8c : 4e8c: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 4e9c: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 4eac: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 4ebc: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00004ec5 : 4ec5: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 4ed5: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 4ee5: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 4ef5: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 4f05: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 4f15: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00004f23 : 4f23: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 4f33: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 4f43: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 4f53: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 4f63: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00004f6d : 4f6d: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 4f7d: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 4f8d: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 4f9d: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 4fad: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00004fb7 : 4fb7: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 4fc7: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 4fd7: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 4fe7: 4d 4d 55 2e 00 MMU.. 00004fec : 4fec: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 4ffc: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 500c: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 501c: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 502c: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 503c: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 504c: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 505c: 29 2e 00 ).. 0000505f : 505f: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 506f: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 507f: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 508f: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 509f: 69 74 20 66 69 72 73 74 2e 00 it first.. 000050a9 : 50a9: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 50b9: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 50c9: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 50d9: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 000050ea : 50ea: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 50fa: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 510a: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 511a: 63 74 6f 72 73 2e 00 ctors.. 00005121 : 5121: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 5131: 6e 6c 69 6e 65 2e 00 nline.. 00005138 : 5138: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 5148: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 5158: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 5168: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 5178: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 00005184 : 5184: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 5194: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 000051a4 : 51a4: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 51b4: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 51c4: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 51d4: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 51e4: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 000051f3 : 51f3: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 5203: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 5213: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 5223: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 5233: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 5243: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 5253: 6e 65 65 64 65 64 2e 00 needed.. 0000525b : 525b: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 526b: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 527b: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 528b: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 529b: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 52ab: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 52bb: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 52cb: 6f 70 65 72 6c 79 2e 00 operly.. 000052d3 : 52d3: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 52e3: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 52f3: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 5303: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 5313: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 5323: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 5333: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 5343: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 5353: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 5363: 2e 00 .. 00005365 : 5365: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 5375: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 5385: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 5395: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 53a5: 20 77 69 72 69 6e 67 2e 00 wiring.. 000053ae : 53ae: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 53be: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 53ce: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 53de: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 53ee: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 53fe: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 540e: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 0000541b : 541b: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 542b: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 543b: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 544b: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 545b: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 546b: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 547b: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 548b: 61 63 68 65 64 20 69 74 2e 00 ached it.. 00005495 : 5495: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 54a5: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 54b5: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 54c5: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 54d5: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 54e5: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 54f5: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 5505: 6f 72 6b 73 2e 00 orks.. 0000550b : 550b: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 551b: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 552b: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 553b: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 554b: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 555b: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 0000556c : 556c: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00005576 : 5576: ff ff 53 74 6f 70 00 ..Stop. 0000557d : 557d: ff ff 4c 6f 61 64 00 ..Load. 00005584 : 5584: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 0000558d : 558d: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 00005598 : 5598: ff ff 52 65 74 72 79 00 ..Retry. 000055a0 : 55a0: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 55b0: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 55c0: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 55d0: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 55e0: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 55f0: 74 2e 00 t.. 000055f3 : 55f3: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 00005601 : 5601: ff ff 44 6f 6e 65 00 ..Done. 00005608 : 5608: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00005619 : 5619: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00005629 : 5629: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 5639: 6e 65 00 ne. 0000563c : 563c: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 0000564c : 564c: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 00005657 : 5657: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 00005665 : 5665: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00005675 : 5675: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 0000567f : 567f: ff ff 54 6f 74 61 6c 00 ..Total. 00005687 : 5687: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00005694 : 5694: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 000056a0 : 56a0: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 000056b1 : 56b1: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 56c1: 73 00 s. 000056c3 : 56c3: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 56d3: 65 73 00 es. 000056d6 : 56d6: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 56e6: 6c 75 72 65 73 00 lures. 000056ec : 56ec: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 000056fd : 56fd: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 0000570c : 570c: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 0000571b : 571b: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00005729 : 5729: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00005739 : 5739: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 5749: 6c 73 00 ls. 0000574c : 574c: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 575c: 72 3a 00 r:. 0000575f : 575f: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00005769 : 5769: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00005779 : 5779: ff ff 44 61 74 65 3a 00 ..Date:. 00005781 : 5781: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 5791: 6d 65 6e 74 00 ment. 00005796 : 5796: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 57a6: 6e 74 00 nt. 000057a9 : 57a9: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 000057ba : 57ba: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 57ca: 63 75 74 00 cut. 000057ce : 57ce: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 57de: 65 6a 65 63 74 00 eject. 000057e4 : 57e4: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 57f4: 75 6e 6c 6f 61 64 00 unload. 000057fb : 57fb: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 580b: 6c 6f 61 64 00 load. 00005810 : 5810: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 0000581b : 581b: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 582b: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 583b: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00005846 : 5846: ff ff 45 6a 65 63 74 00 ..Eject. 0000584e : 584e: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 585e: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 586e: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 587e: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 588e: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 0000589b : 589b: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 000058ac : 58ac: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 58bc: 6d 65 00 me. 000058bf : 58bf: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 000058cf : 58cf: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 000058dc : 58dc: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 58ec: 6e 73 6f 72 00 nsor. 000058f1 : 58f1: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 5901: 72 00 r. 00005903 : 5903: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 0000590c : 590c: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 591c: 49 4e 44 41 00 INDA. 00005921 : 5921: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 5931: 65 6e 74 00 ent. 00005935 : 5935: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 5945: 6f 72 00 or. 00005948 : 5948: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 5958: 63 74 6f 72 00 ctor. 0000595d : 595d: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 0000596e : 596e: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 597e: 6e 74 00 nt. 00005981 : 5981: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 5991: 65 00 e. 00005993 : 5993: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 59a3: 20 73 6c 6f 74 00 slot. 000059a9 : 59a9: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 59b9: 6d 65 6e 74 00 ment. 000059be : 59be: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 000059cf : 59cf: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 59df: 65 6e 74 00 ent. 000059e3 : 59e3: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 000059f2 : 59f2: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 5a02: 73 65 72 00 ser. 00005a06 : 5a06: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 5a16: 6d 65 6e 74 73 00 ments. 00005a1c : 5a1c: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 00005a2d : 5a2d: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 5a3d: 7a 6c 65 00 zle. 00005a41 : 5a41: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 5a51: 72 75 64 65 72 00 ruder. 00005a57 : 5a57: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 5a67: 44 41 00 DA. 00005a6a : 5a6a: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 5a7a: 75 6c 6c 65 79 00 ulley. 00005a80 : 5a80: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 5a90: 49 4e 44 41 00 INDA. 00005a95 : 5a95: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 5aa5: 6c 65 72 00 ler. 00005aa9 : 5aa9: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 00005aba : 5aba: ff ff 4f 4b 00 ..OK. 00005abf <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.484>: 5abf: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005acf <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.483>: 5acf: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5adf: 45 00 E. 00005ae1 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.482>: 5ae1: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5af1: 45 44 00 ED. 00005af4 <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.481>: 5af4: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5b04: 59 00 Y. 00005b06 <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.480>: 5b06: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 5b16: 4f 52 00 OR. 00005b19 <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.479>: 5b19: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 5b29: 4e 45 45 44 45 44 00 NEEDED. 00005b30 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.478>: 5b30: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005b3d <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.477>: 5b3d: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 00005b4c <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.476>: 5b4c: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 5b5c: 4f 41 44 45 44 00 OADED. 00005b62 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.475>: 5b62: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5b72: 45 52 52 4f 52 00 ERROR. 00005b78 <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.474>: 5b78: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 5b88: 44 49 4e 47 00 DING. 00005b8d <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.473>: 5b8d: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005b9d <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.472>: 5b9d: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5bad: 41 49 4c 45 44 00 AILED. 00005bb3 <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.471>: 5bb3: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5bc3: 52 54 45 44 00 RTED. 00005bc8 <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.470>: 5bc8: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 5bd8: 47 45 20 45 52 52 00 GE ERR. 00005bdf <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.469>: 5bdf: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5bef: 45 54 00 ET. 00005bf2 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.468>: 5bf2: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5c02: 4f 52 00 OR. 00005c05 <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.467>: 5c05: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 5c15: 52 52 4f 52 00 RROR. 00005c1a <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.466>: 5c1a: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 5c2a: 4f 20 48 4f 54 00 O HOT. 00005c30 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.465>: 5c30: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 5c40: 4f 56 45 00 OVE. 00005c44 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.464>: 5c44: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 5c54: 4f 4d 45 00 OME. 00005c58 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.463>: 5c58: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5c68: 54 20 4d 4f 56 45 00 T MOVE. 00005c6f <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.462>: 5c6f: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5c7f: 54 20 48 4f 4d 45 00 T HOME. 00005c86 <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.461>: 5c86: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5c96: 46 41 49 4c 45 44 00 FAILED. 00005c9d <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.460>: 5c9d: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005cad <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.459>: 5cad: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5cbd: 52 4c 59 00 RLY. 00005cc1 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.458>: 5cc1: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5cd1: 4d 4f 56 45 00 MOVE. 00005cd6 <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.457>: 5cd6: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5ce6: 54 55 43 4b 00 TUCK. 00005ceb <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.456>: 5ceb: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5cfb: 54 52 49 47 47 2e 00 TRIGG.. 00005d02 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.455>: 5d02: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5d12: 54 55 43 4b 00 TUCK. 00005d17 <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.454>: 5d17: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 5d27: 49 47 47 45 52 00 IGGER. 00005d2d : 5d2d: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 00005d3c : 5d3c: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 00005d47 : 5d47: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 5d57: 6e 3f 00 n?. 00005d5a : 5d5a: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 5d6a: 6e 3f 00 n?. 00005d6d : 5d6d: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 00005d78 : 5d78: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5d88: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 5d98: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 5da8: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 5db8: 79 2e 00 y.. 00005dbb : 5dbb: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5dcb: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 5ddb: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 5deb: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 5dfb: 6a 6f 62 21 00 job!. 00005e00 : 5e00: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5e10: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 5e20: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 5e30: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 5e40: 73 21 00 s!. 00005e43 : 5e43: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5e53: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 5e63: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 5e73: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 5e83: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 00005e8f : 5e8f: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5e9f: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 5eaf: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 5ebf: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 5ecf: 68 61 62 6c 65 2e 00 hable.. 00005ed6 : 5ed6: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5ee6: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 5ef6: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 5f06: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 5f16: 68 61 62 6c 65 2e 00 hable.. 00005f1d : 5f1d: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5f2d: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 5f3d: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 5f4d: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 5f5d: 2e 00 .. 00005f5f : 5f5f: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5f6f: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 5f7f: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 5f8f: 75 61 6c 2e 00 ual.. 00005f94 : 5f94: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5fa4: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 5fb4: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 5fc4: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00005fd3 : 5fd3: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 5fe3: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 5ff3: 61 74 62 65 64 2e 00 atbed.. 00005ffa : 5ffa: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 600a: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 601a: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 602a: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 603a: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 604a: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 605a: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 606a: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 607a: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 608a: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 00006099 : 6099: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 60a9: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 60b9: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 60c9: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 60d9: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 60e9: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 60f9: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 6109: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 6119: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 6129: 69 61 74 65 6c 79 2e 00 iately.. 00006131 : 6131: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 6141: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 6151: 74 00 t. 00006153 : 6153: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 6163: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 6173: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 6183: 74 00 t. 00006185 : 6185: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 6195: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 61a5: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 61b5: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 000061c1 : 61c1: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 000061cd : 61cd: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 000061dc : 61dc: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 000061ed : 61ed: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 61fd: 6e 74 00 nt. 00006200 : 6200: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 6210: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 6220: 72 65 2e 2e 2e 00 re.... 00006226 : 6226: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00006236 : 6236: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 6246: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 6256: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 6266: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 6276: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 6286: 30 2e 00 0.. 00006289 : 6289: ff ff 53 54 4f 50 50 45 44 2e 00 ..STOPPED.. 00006294 : 6294: ff ff 4f 66 66 00 ..Off. 0000629a : 629a: ff ff 4f 6e 00 ..On. 0000629f <__loc_pri_end>: 629f: 65 6e ori r22, 0xE5 ; 229 62a1: 71 75 andi r23, 0x51 ; 81 62a3: 65 69 ori r22, 0x95 ; 149 62a5: 6e 67 ori r22, 0x7E ; 126 62a7: 20 22 and r2, r16 ... 000062aa : 62aa: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 62ba: 6c 65 00 le. 000062bd : 62bd: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 62cd: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 62dd: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000062e7 : 62e7: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 62f7: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 6307: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006311 : 6311: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 6321: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 00006330 : 6330: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 6340: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 6350: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 6360: 3a 20 00 : . 00006363 : 6363: 25 75 20 62 79 74 65 73 20 77 72 69 74 74 65 6e %u bytes written 6373: 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 73 to %S at addres 6383: 73 20 30 78 25 30 38 78 0a 00 s 0x%08x.. 0000638d : 638d: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 639d: 20 25 53 0a 00 %S.. 000063a2 <__c.2310>: 63a2: 3f 3f 00 ??. 000063a5 <__c.2308>: 63a5: 52 6f 6d 61 6e 61 00 Romana. 000063ac <__c.2305>: 63ac: 48 72 76 61 74 73 6b 69 00 Hrvatski. 000063b5 <__c.2302>: 63b5: 4d 61 67 79 61 72 00 Magyar. 000063bc <__c.2299>: 63bc: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 000063c7 <__c.2296>: 63c7: 4e 6f 72 73 6b 00 Norsk. 000063cd <__c.2293>: 63cd: 53 76 65 6e 73 6b 61 00 Svenska. 000063d5 <__c.2290>: 63d5: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 000063e0 <__c.2287>: 63e0: 50 6f 6c 73 6b 69 00 Polski. 000063e7 <__c.2284>: 63e7: 49 74 61 6c 69 61 6e 6f 00 Italiano. 000063f0 <__c.2281>: 63f0: 46 72 61 6e 63 61 69 73 00 Francais. 000063f9 <__c.2278>: 63f9: 45 73 70 61 6e 6f 6c 00 Espanol. 00006401 <__c.2275>: 6401: 44 65 75 74 73 63 68 00 Deutsch. 00006409 <__c.2272>: 6409: 43 65 73 74 69 6e 61 00 Cestina. 00006411 <__c.2269>: 6411: 45 6e 67 6c 69 73 68 00 English. 00006419 : 6419: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 00006424 : 6424: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 6434: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 6444: 31 40 3a 25 75 0a 00 1@:%u.. 0000644b : 644b: 52 65 73 65 6e 64 00 Resend. 00006452 : 6452: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 0000645e : 645e: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 646e: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 00006478 : 6478: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 6488: 64 65 74 65 63 74 65 64 21 00 detected!. 00006492 : 6492: 64 69 73 61 62 6c 65 64 00 disabled. 0000649b : 649b: 65 6e 61 62 6c 65 64 00 enabled. 000064a3 : 64a3: 45 45 50 52 4f 4d 00 EEPROM. 000064aa : 64aa: 53 52 41 4d 00 SRAM. 000064af : 64af: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 64bf: 6f 70 0a 00 op.. 000064c3 : 64c3: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 64d3: 20 30 00 0. 000064d6 : 64d6: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 000064e7 : 64e7: 4d 32 32 30 20 53 25 64 00 M220 S%d. 000064f0 : 64f0: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 6500: 20 00 . 00006502 : 6502: 25 75 00 %u. 00006505 : 6505: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 6515: 20 22 00 ". 00006518 <_ZZ16process_commandsvE3__c__55_>: 6518: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 6528: 72 75 64 65 72 20 00 ruder . 0000652f : 652f: 7a 5f 6d 61 78 3a 20 00 z_max: . 00006537 : 6537: 7a 5f 6d 69 6e 3a 20 00 z_min: . 0000653f <_ZZ16process_commandsvE3__c__54_>: 653f: 79 5f 6d 69 6e 3a 20 00 y_min: . 00006547 : 6547: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 00006551 : 6551: 6f 70 65 6e 00 open. 00006556 <_ZZ16process_commandsvE3__c__53_>: 6556: 78 5f 6d 69 6e 3a 20 00 x_min: . 0000655e <_ZZ16process_commandsvE3__c__52_>: 655e: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 656e: 70 20 73 74 61 74 75 73 00 p status. 00006577 : 6577: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 6587: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 00006594 : 6594: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 65a4: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 000065b1 <_ZZ16process_commandsvE3__c__38_>: 65b1: 25 53 3a 25 6c 75 20 63 6d 0a 25 53 3a 25 6c 75 %S:%lu cm.%S:%lu 65c1: 20 6d 69 6e 0a 00 min.. 000065c7 <_ZZ16process_commandsvE3__c__37_>: 65c7: 53 49 4c 45 4e 54 00 SILENT. 000065ce <_ZZ16process_commandsvE3__c__36_>: 65ce: 4e 4f 52 4d 41 4c 00 NORMAL. 000065d5 <_ZZ16process_commandsvE3__c__35_>: 65d5: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 65e5: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 65f5: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 6605: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 6615: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 6625: 64 0a 00 d.. 00006628 <_ZZ16process_commandsvE3__c__34_>: 6628: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 6638: 0a 00 .. 0000663a <_ZZ16process_commandsvE3__c__30_>: 663a: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 00006648 <_ZZ16process_commandsvE3__c__29_>: 6648: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 00006658 : 6658: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 6668: 20 25 73 0a 00 %s.. 0000666d <_ZZ16process_commandsvE3__c__27_>: 666d: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 667d: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 668d: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006699 <_ZZ16process_commandsvE3__c__26_>: 6699: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 000066a6 <_ZZ16process_commandsvE3__c__25_>: 66a6: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 66b6: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 66c6: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 66d6: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 000066e2 <_ZZ16process_commandsvE3__c__24_>: 66e2: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 000066ef <_ZZ16process_commandsvE3__c__23_>: 66ef: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 66ff: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006708 <_ZZ16process_commandsvE3__c__20_>: 6708: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006711 <_ZZ16process_commandsvE3__c__19_>: 6711: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6721: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 0000672d <_ZZ16process_commandsvE3__c__18_>: 672d: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006736 : 6736: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6746: 64 20 52 50 4d 0a 00 d RPM.. 0000674d : 674d: 47 39 30 00 G90. 00006751 : 6751: 4d 31 30 37 00 M107. 00006756 : 6756: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 0000675e : 675e: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 0000676c : 676c: 25 33 2e 32 66 81 00 %3.2f.. 00006773 : 6773: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 6783: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 6793: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 000067a0 : 67a0: 20 20 30 00 0. 000067a4 : 67a4: 20 20 31 00 1. 000067a8 : 67a8: 42 3a 20 25 33 64 20 20 20 20 20 58 64 3a 25 36 B: %3d Xd:%6 67b8: 64 0a 53 3a 20 25 33 64 20 20 20 20 20 59 64 3a d.S: %3d Yd: 67c8: 25 36 64 00 %6d. 000067cc : 67cc: 46 49 4e 44 41 00 FINDA. 000067d2 : 67d2: 50 49 4e 44 41 00 PINDA. 000067d8 : 67d8: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 67e8: 3a 20 25 64 0a 00 : %d.. 000067ee : 67ee: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 000067f8 : 67f8: 46 69 72 6d 77 61 72 65 00 Firmware. 00006801 : 6801: 53 75 70 65 72 50 49 4e 44 41 00 SuperPINDA. 0000680c : 680c: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00006819 : 6819: 46 6c 61 73 68 41 69 72 00 FlashAir. 00006822 : 6822: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6832: 52 52 4f 52 00 RROR. 00006837 : 6837: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006848 : 6848: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006858 : 6858: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006867 : 6867: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6877: 64 79 00 dy. 0000687a : 687a: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 0000688a : 688a: 4d 38 34 00 M84. 0000688e : 688e: 4f 4b 00 OK. 00006891 : 6891: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 68a1: 65 64 00 ed. 000068a4 <_ZZN10CardReader7releaseEvE3__c.lto_priv.495>: 68a4: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 000068b5 : 68b5: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 000068c4 : 68c4: 47 39 31 00 G91. 000068c8 : 68c8: 4d 37 30 32 00 M702. 000068cd : 68cd: 47 32 38 20 57 00 G28 W. 000068d3 : 68d3: 4d 35 30 30 00 M500. 000068d8 : 68d8: 42 61 64 20 69 6e 74 65 72 72 75 70 74 00 Bad interrupt. 000068e6 : 68e6: 57 61 74 63 68 64 6f 67 20 74 69 6d 65 6f 75 74 Watchdog timeout ... 000068f7 : 68f7: 53 74 61 74 69 63 20 6d 65 6d 6f 72 79 20 68 61 Static memory ha 6907: 73 0a 62 65 65 6e 20 6f 76 65 72 77 72 69 74 74 s.been overwritt 6917: 65 6e 00 en. 0000691a : 691a: 46 49 52 4d 57 41 52 45 20 43 52 41 53 48 21 0a FIRMWARE CRASH!. 692a: 43 72 61 73 68 20 72 65 61 73 6f 6e 3a 0a 00 Crash reason:.. 00006939 : 6939: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6949: 79 74 65 73 3a 20 00 ytes: . 00006950 : 6950: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 0000695f : 695f: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 0000696b : 696b: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 0000697b : 697b: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 0000698b : 698b: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 0000699b : 699b: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 000069ac : 69ac: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 000069bc : 69bc: 50 6f 77 65 72 55 70 00 PowerUp. 000069c4 : 69c4: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 69d4: 20 66 69 6c 65 00 file. 000069da : 69da: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 69ea: 2e 00 .. 000069ec : 69ec: 6f 6b 00 ok. 000069ef : 69ef: 46 69 6c 61 6d 65 6e 74 00 Filament. 000069f8 : 69f8: 31 2f 39 00 1/9. 000069fc : 69fc: 88 00 .. 000069fe : 69fe: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 6a0e: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00006a1c : 6a1c: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 6a2c: 70 72 65 76 65 6e 74 65 64 00 prevented. 00006a36 : 6a36: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 00006a43 : 6a43: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6a53: 52 4f 52 00 ROR. 00006a57 : 6a57: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006a61 : 6a61: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006a6a : 6a6a: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006a73 : 6a73: 86 25 33 64 25 25 00 .%3d%%. 00006a7a : 6a7a: 2d 2d 2d 25 25 00 ---%%. 00006a80 : 6a80: 25 33 64 25 25 00 %3d%%. 00006a86 : 6a86: 20 53 44 00 SD. 00006a8a : 6a8a: 20 20 20 00 . 00006a8e : 6a8e: 20 48 4f 00 HO. 00006a92 : 6a92: 20 46 52 4d 20 00 FRM . 00006a98 : 6a98: 87 2d 2d 3a 2d 2d 20 20 00 .--:-- . 00006aa1 : 6aa1: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006aac : 6aac: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006abb : 6abb: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006acb : 6acb: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006ada <_ZZL16lcd_support_menuvE3__c__16_>: 6ada: 44 75 6d 70 20 74 6f 20 73 65 72 69 61 6c 00 Dump to serial. 00006ae9 : 6ae9: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006afa : 6afa: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6b0a: 6d 00 m. 00006b0c : 6b0c: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006b18 : 6b18: 4d 37 30 31 00 M701. 00006b1d : 6b1d: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6b2d: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6b3d: 32 64 6d 00 2dm. 00006b41 : 6b41: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6b51: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6b61: 32 64 73 00 2ds. 00006b65 : 6b65: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 6b75: 25 66 20 25 66 0a 00 %f %f.. 00006b7c : 6b7c: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6b8c: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6b9c: 69 6c 65 64 2e 0a 00 iled... 00006ba3 : 6ba3: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6bb3: 65 73 73 2e 0a 00 ess... 00006bb9 : 6bb9: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6bc9: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006bda : 6bda: 31 2f 34 00 1/4. 00006bde : 6bde: 31 2f 34 00 1/4. 00006be2 : 6be2: 31 2f 39 00 1/9. 00006be6 : 6be6: 50 72 75 73 61 20 69 33 20 4d 4b 32 2e 35 20 4f Prusa i3 MK2.5 O 6bf6: 4b 2e 00 K.. 00006bf9 : 6bf9: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00006c04 : 6c04: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 00006c14 : 6c14: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 6c24: 65 64 00 ed. 00006c27 : 6c27: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 00006c34 : 6c34: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 6c44: 65 3a 20 00 e: . 00006c48 : 6c48: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 6c58: 64 69 72 3a 20 00 dir: . 00006c5e : 6c5e: 4d 36 30 30 00 M600. 00006c63 : 6c63: 4d 32 34 00 M24. 00006c67 : 6c67: 4d 32 33 20 25 73 00 M23 %s. 00006c6e : 6c6e: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 6c7e: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 6c8e: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 6c9e: 72 65 64 2e 00 red.. 00006ca3 : 6ca3: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00006cb3 : 6cb3: 4d 38 33 00 M83. 00006cb7 <__noloc_end>: 6cb7: 08 4a sbci r16, 0xA8 ; 168 6cb9: d7 3b cpi r29, 0xB7 ; 183 6cbb: 3b ce rjmp .-906 ; 0x6933 6cbd: 01 6e ori r16, 0xE1 ; 225 6cbf: 84 bc out 0x24, r8 ; 36 6cc1: bf fd .word 0xfdbf ; ???? 6cc3: c1 2f mov r28, r17 6cc5: 3d 6c ori r19, 0xCD ; 205 6cc7: 74 31 cpi r23, 0x14 ; 20 6cc9: 9a bd out 0x2a, r25 ; 42 6ccb: 56 83 std Z+6, r21 ; 0x06 6ccd: 3d da rcall .-2950 ; 0x6149 6ccf: 3d 00 .word 0x003d ; ???? 6cd1: c7 7f andi r28, 0xF7 ; 247 6cd3: 11 be out 0x31, r1 ; 49 6cd5: d9 e4 ldi r29, 0x49 ; 73 6cd7: bb 4c sbci r27, 0xCB ; 203 6cd9: 3e 91 ld r19, -X 6cdb: 6b aa std Y+51, r6 ; 0x33 6cdd: aa be out 0x3a, r10 ; 58 6cdf: 00 00 nop 6ce1: 00 80 ld r0, Z 6ce3: 3f 05 cpc r19, r15 6ce5: a8 4c sbci r26, 0xC8 ; 200 6ce7: cd b2 in r12, 0x1d ; 29 6ce9: d4 4e sbci r29, 0xE4 ; 228 6ceb: b9 38 cpi r27, 0x89 ; 137 6ced: 36 a9 ldd r19, Z+54 ; 0x36 6cef: 02 0c add r0, r2 6cf1: 50 b9 out 0x00, r21 ; 0 6cf3: 91 86 std Z+9, r9 ; 0x09 6cf5: 88 08 sbc r8, r8 6cf7: 3c a6 std Y+44, r3 ; 0x2c 6cf9: aa aa std Y+50, r10 ; 0x32 6cfb: 2a be out 0x3a, r2 ; 58 6cfd: 00 00 nop 6cff: 00 80 ld r0, Z 6d01: 3f 07 cpc r19, r31 6d03: 63 42 sbci r22, 0x23 ; 35 6d05: 36 b7 in r19, 0x36 ; 54 6d07: 9b d8 rcall .-3786 ; 0x5e3f 6d09: a7 1a sub r10, r23 6d0b: 39 68 ori r19, 0x89 ; 137 6d0d: 56 18 sub r5, r6 6d0f: ae ba out 0x1e, r10 ; 30 6d11: ab 55 subi r26, 0x5B ; 91 6d13: 8c 1d adc r24, r12 6d15: 3c b7 in r19, 0x3c ; 60 6d17: cc 57 subi r28, 0x7C ; 124 6d19: 63 bd out 0x23, r22 ; 35 6d1b: 6d ed ldi r22, 0xDD ; 221 6d1d: fd 75 andi r31, 0x5D ; 93 6d1f: 3e f6 brtc .-114 ; 0x6caf 6d21: 17 72 andi r17, 0x27 ; 39 6d23: 31 bf out 0x31, r19 ; 49 6d25: 00 00 nop 6d27: 00 80 ld r0, Z 6d29: 3f 08 sbc r3, r15 6d2b: 00 00 nop 6d2d: 00 be out 0x30, r0 ; 48 6d2f: 92 24 eor r9, r2 6d31: 49 12 cpse r4, r25 6d33: 3e ab std Y+54, r19 ; 0x36 6d35: aa aa std Y+50, r10 ; 0x32 6d37: 2a be out 0x3a, r2 ; 58 6d39: cd cc rjmp .-1638 ; 0x66d5 <_ZZ16process_commandsvE3__c__25_+0x2f> 6d3b: cc 4c sbci r28, 0xCC ; 204 6d3d: 3e 00 .word 0x003e ; ???? 6d3f: 00 00 nop 6d41: 80 be out 0x30, r8 ; 48 6d43: ab aa std Y+51, r10 ; 0x33 6d45: aa aa std Y+50, r10 ; 0x32 6d47: 3e 00 .word 0x003e ; ???? 6d49: 00 00 nop 6d4b: 00 bf out 0x30, r16 ; 48 6d4d: 00 00 nop 6d4f: 00 80 ld r0, Z 6d51: 3f 00 .word 0x003f ; ???? 6d53: 00 00 nop 6d55: 00 00 nop 6d57: 08 41 sbci r16, 0x18 ; 24 6d59: 78 d3 rcall .+1776 ; 0x744b 6d5b: bb 43 sbci r27, 0x3B ; 59 6d5d: 87 d1 rcall .+782 ; 0x706d <__trampolines_start+0x2e9> 6d5f: 13 3d cpi r17, 0xD3 ; 211 6d61: 19 0e add r1, r25 6d63: 3c c3 rjmp .+1656 ; 0x73dd 6d65: bd 42 sbci r27, 0x2D ; 45 6d67: 82 ad ldd r24, Z+58 ; 0x3a 6d69: 2b 3e cpi r18, 0xEB ; 235 6d6b: 68 ec ldi r22, 0xC8 ; 200 6d6d: 82 76 andi r24, 0x62 ; 98 6d6f: be d9 rcall .-3204 ; 0x60ed 6d71: 8f e1 ldi r24, 0x1F ; 31 6d73: a9 3e cpi r26, 0xE9 ; 233 6d75: 4c 80 ldd r4, Y+4 ; 0x04 6d77: ef ff .word 0xffef ; ???? 6d79: be 01 movw r22, r28 6d7b: c4 ff sbrs r28, 4 6d7d: 7f 3f cpi r23, 0xFF ; 255 6d7f: 00 00 nop 6d81: 00 00 nop ... 00006d84 <__trampolines_start>: 6d84: 0c 94 cb ea jmp 0x1d596 ; 0x1d596 6d88: 0c 94 5f c9 jmp 0x192be ; 0x192be 6d8c: 0c 94 c4 d8 jmp 0x1b188 ; 0x1b188 6d90: 0c 94 2b d9 jmp 0x1b256 ; 0x1b256 6d94: 0c 94 75 f9 jmp 0x1f2ea ; 0x1f2ea 6d98: 0d 94 53 24 jmp 0x248a6 ; 0x248a6 6d9c: 0c 94 53 c0 jmp 0x180a6 ; 0x180a6 6da0: 0c 94 b1 ea jmp 0x1d562 ; 0x1d562 6da4: 0c 94 10 bb jmp 0x17620 ; 0x17620 6da8: 0c 94 3a c2 jmp 0x18474 ; 0x18474 6dac: 0c 94 ae bc jmp 0x1795c ; 0x1795c 6db0: 0c 94 74 f8 jmp 0x1f0e8 ; 0x1f0e8 6db4: 0c 94 05 bb jmp 0x1760a ; 0x1760a 6db8: 0d 94 46 24 jmp 0x2488c ; 0x2488c 6dbc: 0c 94 51 f7 jmp 0x1eea2 ; 0x1eea2 6dc0: 0d 94 1c 0d jmp 0x21a38 ; 0x21a38 6dc4: 0d 94 cd 01 jmp 0x2039a ; 0x2039a 6dc8: 0d 94 4f 0d jmp 0x21a9e ; 0x21a9e 6dcc: 0c 94 1d bd jmp 0x17a3a ; 0x17a3a 6dd0: 0d 94 de 9c jmp 0x339bc ; 0x339bc 6dd4: 0c 94 6c ce jmp 0x19cd8 ; 0x19cd8 6dd8: 0c 94 0f f5 jmp 0x1ea1e ; 0x1ea1e 6ddc: 0c 94 83 cd jmp 0x19b06 ; 0x19b06 6de0: 0c 94 46 bd jmp 0x17a8c ; 0x17a8c 6de4: 0d 94 bb 24 jmp 0x24976 ; 0x24976 6de8: 0c 94 31 d2 jmp 0x1a462 ; 0x1a462 6dec: 0c 94 ac d8 jmp 0x1b158 ; 0x1b158 6df0: 0c 94 1c d9 jmp 0x1b238 ; 0x1b238 6df4: 0d 94 3d 25 jmp 0x24a7a ; 0x24a7a 6df8: 0c 94 e6 d1 jmp 0x1a3cc ; 0x1a3cc 6dfc: 0c 94 11 bd jmp 0x17a22 ; 0x17a22 6e00: 0d 94 be 02 jmp 0x2057c ; 0x2057c 6e04: 0d 94 d3 0c jmp 0x219a6 ; 0x219a6 6e08: 0c 94 b9 cc jmp 0x19972 ; 0x19972 6e0c: 0c 94 f7 76 jmp 0xedee ; 0xedee <__vector_23+0x88> 6e10: 0c 94 3f be jmp 0x17c7e ; 0x17c7e 6e14: 0c 94 71 e7 jmp 0x1cee2 ; 0x1cee2 6e18: 0c 94 bd cd jmp 0x19b7a ; 0x19b7a 6e1c: 0c 94 8f 7a jmp 0xf51e ; 0xf51e 6e20: 0c 94 12 f8 jmp 0x1f024 ; 0x1f024 6e24: 0c 94 16 c0 jmp 0x1802c ; 0x1802c 6e28: 0c 94 7a 78 jmp 0xf0f4 ; 0xf0f4 6e2c: 0c 94 ae d1 jmp 0x1a35c ; 0x1a35c 6e30: 0c 94 87 e7 jmp 0x1cf0e ; 0x1cf0e 6e34: 0c 94 c0 cd jmp 0x19b80 ; 0x19b80 6e38: 0c 94 58 ce jmp 0x19cb0 ; 0x19cb0 6e3c: 0c 94 6b c2 jmp 0x184d6 ; 0x184d6 6e40: 0d 94 7a 0a jmp 0x214f4 ; 0x214f4 6e44: 0c 94 f4 e7 jmp 0x1cfe8 ; 0x1cfe8 6e48: 0c 94 c6 cd jmp 0x19b8c ; 0x19b8c 6e4c: 0d 94 05 25 jmp 0x24a0a ; 0x24a0a 6e50: 0c 94 d2 d1 jmp 0x1a3a4 ; 0x1a3a4 6e54: 0d 94 52 0e jmp 0x21ca4 ; 0x21ca4 6e58: 0c 94 48 ce jmp 0x19c90 ; 0x19c90 6e5c: 0c 94 72 c2 jmp 0x184e4 ; 0x184e4 6e60: 0c 94 3c bd jmp 0x17a78 ; 0x17a78 6e64: 0c 94 da ce jmp 0x19db4 ; 0x19db4 6e68: 0c 94 50 ce jmp 0x19ca0 ; 0x19ca0 6e6c: 0c 94 44 bb jmp 0x17688 ; 0x17688 6e70: 0d 94 e3 96 jmp 0x32dc6 ; 0x32dc6 6e74: 0c 94 eb c6 jmp 0x18dd6 ; 0x18dd6 6e78: 0c 94 32 bb jmp 0x17664 ; 0x17664 6e7c: 0d 94 e5 9c jmp 0x339ca ; 0x339ca 6e80: 0d 94 54 15 jmp 0x22aa8 ; 0x22aa8 6e84: 0d 94 7c 0d jmp 0x21af8 ; 0x21af8 6e88: 0c 94 9c bd jmp 0x17b38 ; 0x17b38 6e8c: 0c 94 9f 63 jmp 0xc73e ; 0xc73e <_GLOBAL__sub_D_card> 6e90: 0c 94 23 be jmp 0x17c46 ; 0x17c46 6e94: 0c 94 aa dc jmp 0x1b954 ; 0x1b954 6e98: 0d 94 4a 05 jmp 0x20a94 ; 0x20a94 6e9c: 0c 94 c0 f6 jmp 0x1ed80 ; 0x1ed80 6ea0: 0c 94 fd ea jmp 0x1d5fa ; 0x1d5fa 6ea4: 0c 94 ca d1 jmp 0x1a394 ; 0x1a394 6ea8: 0c 94 71 c1 jmp 0x182e2 ; 0x182e2 ()> 6eac: 0c 94 20 bb jmp 0x17640 ; 0x17640 6eb0: 0c 94 f8 bf jmp 0x17ff0 ; 0x17ff0 6eb4: 0d 94 db 02 jmp 0x205b6 ; 0x205b6 6eb8: 0c 94 fb ba jmp 0x175f6 ; 0x175f6 6ebc: 0c 94 76 c1 jmp 0x182ec ; 0x182ec ()> 6ec0: 0c 94 f8 d4 jmp 0x1a9f0 ; 0x1a9f0 6ec4: 0c 94 88 ce jmp 0x19d10 ; 0x19d10 6ec8: 0d 94 ec 24 jmp 0x249d8 ; 0x249d8 6ecc: 0c 94 4a c6 jmp 0x18c94 ; 0x18c94 6ed0: 0c 94 86 ce jmp 0x19d0c ; 0x19d0c 6ed4: 0c 94 59 d5 jmp 0x1aab2 ; 0x1aab2 6ed8: 0c 94 60 ce jmp 0x19cc0 ; 0x19cc0 6edc: 0c 94 7a bd jmp 0x17af4 ; 0x17af4 6ee0: 0c 94 64 c2 jmp 0x184c8 ; 0x184c8 6ee4: 0c 94 a4 d1 jmp 0x1a348 ; 0x1a348 6ee8: 0c 94 d6 ca jmp 0x195ac ; 0x195ac 6eec: 0c 94 15 f5 jmp 0x1ea2a ; 0x1ea2a 6ef0: 0c 94 36 bb jmp 0x1766c ; 0x1766c 6ef4: 0d 94 b2 02 jmp 0x20564 ; 0x20564 6ef8: 0c 94 3c bb jmp 0x17678 ; 0x17678 6efc: 0c 94 01 bb jmp 0x17602 ; 0x17602 6f00: 0c 94 32 cc jmp 0x19864 ; 0x19864 6f04: 0c 94 bf bc jmp 0x1797e ; 0x1797e 6f08: 0c 94 6d ea jmp 0x1d4da ; 0x1d4da 6f0c: 0c 94 80 c1 jmp 0x18300 ; 0x18300 ()> 6f10: 0c 94 8a d6 jmp 0x1ad14 ; 0x1ad14 6f14: 0d 94 60 0d jmp 0x21ac0 ; 0x21ac0 6f18: 0c 94 1f d9 jmp 0x1b23e ; 0x1b23e 6f1c: 0c 94 70 bd jmp 0x17ae0 ; 0x17ae0 6f20: 0d 94 09 24 jmp 0x24812 ; 0x24812 6f24: 0c 94 9f fc jmp 0x1f93e ; 0x1f93e 6f28: 0d 94 68 96 jmp 0x32cd0 ; 0x32cd0 6f2c: 0c 94 3d e9 jmp 0x1d27a ; 0x1d27a 6f30: 0d 94 c2 9c jmp 0x33984 ; 0x33984 6f34: 0d 94 0d 25 jmp 0x24a1a ; 0x24a1a 6f38: 0c 94 dc d1 jmp 0x1a3b8 ; 0x1a3b8 6f3c: 0c 94 77 ce jmp 0x19cee ; 0x19cee 6f40: 0c 94 85 c1 jmp 0x1830a ; 0x1830a ()> 6f44: 0c 94 47 d7 jmp 0x1ae8e ; 0x1ae8e 6f48: 0c 94 4f f6 jmp 0x1ec9e ; 0x1ec9e 6f4c: 0c 94 9f d1 jmp 0x1a33e ; 0x1a33e 6f50: 0c 94 5c be jmp 0x17cb8 ; 0x17cb8 6f54: 0c 94 05 77 jmp 0xee0a ; 0xee0a <__vector_23+0xa4> 6f58: 0d 94 f2 24 jmp 0x249e4 ; 0x249e4 6f5c: 0c 94 33 dd jmp 0x1ba66 ; 0x1ba66 6f60: 0c 94 c9 cd jmp 0x19b92 ; 0x19b92 6f64: 0c 94 e6 ea jmp 0x1d5cc ; 0x1d5cc 6f68: 0c 94 7b c1 jmp 0x182f6 ; 0x182f6 ()> 6f6c: 0d 94 87 01 jmp 0x2030e ; 0x2030e 6f70: 0c 94 47 77 jmp 0xee8e ; 0xee8e <__vector_23+0x128> 6f74: 0c 94 5e dd jmp 0x1babc ; 0x1babc 6f78: 0c 94 28 c6 jmp 0x18c50 ; 0x18c50 6f7c: 0d 94 25 25 jmp 0x24a4a ; 0x24a4a 6f80: 0c 94 18 ca jmp 0x19430 ; 0x19430 6f84: 0c 94 85 bd jmp 0x17b0a ; 0x17b0a 6f88: 0c 94 e2 ea jmp 0x1d5c4 ; 0x1d5c4 6f8c: 0c 94 d2 cd jmp 0x19ba4 ; 0x19ba4 6f90: 0c 94 c2 d1 jmp 0x1a384 ; 0x1a384 6f94: 0c 94 bc f6 jmp 0x1ed78 ; 0x1ed78 6f98: 0c 94 67 c1 jmp 0x182ce ; 0x182ce ()> 6f9c: 0d 94 35 25 jmp 0x24a6a ; 0x24a6a 6fa0: 0c 94 f6 bc jmp 0x179ec ; 0x179ec 6fa4: 0d 94 e0 96 jmp 0x32dc0 ; 0x32dc0 6fa8: 0c 94 df ce jmp 0x19dbe ; 0x19dbe 6fac: 0d 94 00 31 jmp 0x26200 ; 0x26200 6fb0: 0d 94 15 25 jmp 0x24a2a ; 0x24a2a 6fb4: 0c 94 b8 d1 jmp 0x1a370 ; 0x1a370 6fb8: 0c 94 53 c6 jmp 0x18ca6 ; 0x18ca6 6fbc: 0d 94 49 24 jmp 0x24892 ; 0x24892 6fc0: 0c 94 52 73 jmp 0xe6a4 ; 0xe6a4 <_menu_edit_P()> 6fc4: 0c 94 48 bb jmp 0x17690 ; 0x17690 6fc8: 0c 94 3b bb jmp 0x17676 ; 0x17676 6fcc: 0c 94 ef fc jmp 0x1f9de ; 0x1f9de 6fd0: 0d 94 ee 9c jmp 0x339dc ; 0x339dc 6fd4: 0d 94 8f 04 jmp 0x2091e ; 0x2091e 6fd8: 0d 94 e7 96 jmp 0x32dce ; 0x32dce 6fdc: 0d 94 b8 24 jmp 0x24970 ; 0x24970 6fe0: 0d 94 24 02 jmp 0x20448 ; 0x20448 6fe4: 0d 94 01 64 jmp 0x2c802 ; 0x2c802 6fe8: 0c 94 77 ea jmp 0x1d4ee ; 0x1d4ee 6fec: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 6ff0: 0c 94 61 ea jmp 0x1d4c2 ; 0x1d4c2 6ff4: 0c 94 80 c2 jmp 0x18500 ; 0x18500 6ff8: 0c 94 78 be jmp 0x17cf0 ; 0x17cf0 6ffc: 0d 94 2d 25 jmp 0x24a5a ; 0x24a5a 7000: 0c 94 5c bd jmp 0x17ab8 ; 0x17ab8 7004: 0c 94 16 d9 jmp 0x1b22c ; 0x1b22c 7008: 0c 94 1d d2 jmp 0x1a43a ; 0x1a43a 700c: 0c 94 4d bb jmp 0x1769a ; 0x1769a 7010: 0d 94 f5 24 jmp 0x249ea ; 0x249ea 7014: 0c 94 28 bb jmp 0x17650 ; 0x17650 7018: 0c 94 13 d2 jmp 0x1a426 ; 0x1a426 701c: 0d 94 22 0a jmp 0x21444 ; 0x21444 7020: 0c 94 97 d1 jmp 0x1a32e ; 0x1a32e 7024: 0c 94 55 be jmp 0x17caa ; 0x17caa 7028: 0d 94 8c 24 jmp 0x24918 ; 0x24918 702c: 0c 94 11 eb jmp 0x1d622 ; 0x1d622 7030: 0c 94 96 dc jmp 0x1b92c ; 0x1b92c 7034: 0c 94 ec 76 jmp 0xedd8 ; 0xedd8 <__vector_23+0x72> 7038: 0c 94 5c c6 jmp 0x18cb8 ; 0x18cb8 703c: 0c 94 3f c9 jmp 0x1927e ; 0x1927e 7040: 0c 94 8e c1 jmp 0x1831c ; 0x1831c 7044: 0d 94 c0 0c jmp 0x21980 ; 0x21980 7048: 0d 94 cf 02 jmp 0x2059e ; 0x2059e 704c: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 7050: 0d 94 81 96 jmp 0x32d02 ; 0x32d02 7054: 0d 94 50 24 jmp 0x248a0 ; 0x248a0 7058: 0c 94 0a d9 jmp 0x1b214 ; 0x1b214 705c: 0c 94 dc ea jmp 0x1d5b8 ; 0x1d5b8 7060: 0c 94 83 c4 jmp 0x18906 ; 0x18906 7064: 0c 94 20 fc jmp 0x1f840 ; 0x1f840 7068: 0c 94 24 77 jmp 0xee48 ; 0xee48 <__vector_23+0xe2> 706c: 0c 94 02 bd jmp 0x17a04 ; 0x17a04 7070: 0c 94 4c bf jmp 0x17e98 ; 0x17e98 7074: 0c 94 a8 f7 jmp 0x1ef50 ; 0x1ef50 7078: 0c 94 c3 cd jmp 0x19b86 ; 0x19b86 707c: 0c 94 24 cf jmp 0x19e48 ; 0x19e48 7080: 0c 94 41 c6 jmp 0x18c82 ; 0x18c82 7084: 0c 94 8a fc jmp 0x1f914 ; 0x1f914 7088: 0c 94 fd c3 jmp 0x187fa ; 0x187fa 708c: 0c 94 19 d9 jmp 0x1b232 ; 0x1b232 7090: 0c 94 07 fd jmp 0x1fa0e ; 0x1fa0e 7094: 0c 94 2e bb jmp 0x1765c ; 0x1765c 7098: 0c 94 7c dc jmp 0x1b8f8 ; 0x1b8f8 709c: 0d 94 62 0b jmp 0x216c4 ; 0x216c4 70a0: 0c 94 f0 d1 jmp 0x1a3e0 ; 0x1a3e0 70a4: 0c 94 6c c1 jmp 0x182d8 ; 0x182d8 ()> 70a8: 0c 94 27 d2 jmp 0x1a44e ; 0x1a44e 70ac: 0c 94 91 e3 jmp 0x1c722 ; 0x1c722 70b0: 0c 94 58 cd jmp 0x19ab0 ; 0x19ab0 70b4: 0d 94 69 05 jmp 0x20ad2 ; 0x20ad2 70b8: 0d 94 de 02 jmp 0x205bc ; 0x205bc 70bc: 0c 94 b4 bc jmp 0x17968 ; 0x17968 70c0: 0c 94 6d e1 jmp 0x1c2da ; 0x1c2da 70c4: 0c 94 3b 73 jmp 0xe676 ; 0xe676 70c8: 0c 94 c5 c5 jmp 0x18b8a ; 0x18b8a 70cc: 0c 94 24 bb jmp 0x17648 ; 0x17648 70d0: 0c 94 41 ea jmp 0x1d482 ; 0x1d482 70d4: 0c 94 af bd jmp 0x17b5e ; 0x17b5e 70d8: 0d 94 21 24 jmp 0x24842 ; 0x24842 70dc: 0c 94 09 bb jmp 0x17612 ; 0x17612 70e0: 0c 94 ff d1 jmp 0x1a3fe ; 0x1a3fe 70e4: 0c 94 cc c1 jmp 0x18398 ; 0x18398 70e8: 0d 94 e3 04 jmp 0x209c6 ; 0x209c6 70ec: 0d 94 ef 24 jmp 0x249de ; 0x249de 70f0: 0c 94 40 bb jmp 0x17680 ; 0x17680 70f4: 0c 94 16 bb jmp 0x1762c ; 0x1762c 70f8: 0c 94 8b ce jmp 0x19d16 ; 0x19d16 70fc: 0c 94 50 bd jmp 0x17aa0 ; 0x17aa0 7100: 0c 94 16 f8 jmp 0x1f02c ; 0x1f02c 7104: 0d 94 be 24 jmp 0x2497c ; 0x2497c 7108: 0c 94 8a c1 jmp 0x18314 ; 0x18314 ()> 710c: 0d 94 c4 08 jmp 0x21188 ; 0x21188 7110: 0d 94 fd 24 jmp 0x249fa ; 0x249fa 7114: 0d 94 f3 9c jmp 0x339e6 ; 0x339e6 7118: 0d 94 1d 25 jmp 0x24a3a ; 0x24a3a 711c: 0c 94 32 bd jmp 0x17a64 ; 0x17a64 7120: 0c 94 d2 76 jmp 0xeda4 ; 0xeda4 <__vector_23+0x3e> 7124: 0c 94 37 d9 jmp 0x1b26e ; 0x1b26e 7128: 0c 94 ba cd jmp 0x19b74 ; 0x19b74 712c: 0c 94 07 e7 jmp 0x1ce0e ; 0x1ce0e 7130: 0c 94 79 c2 jmp 0x184f2 ; 0x184f2 7134: 0c 94 1a bb jmp 0x17634 ; 0x17634 7138: 0c 94 1b 77 jmp 0xee36 ; 0xee36 <__vector_23+0xd0> 713c: 0c 94 59 77 jmp 0xeeb2 ; 0xeeb2 <__vector_23+0x14c> 7140: 0d 94 45 25 jmp 0x24a8a ; 0x24a8a 7144: 0c 94 4e cd jmp 0x19a9c ; 0x19a9c 7148: 0d 94 65 09 jmp 0x212ca ; 0x212ca 714c: 0c 94 0d bb jmp 0x1761a ; 0x1761a 7150: 0c 94 a0 d8 jmp 0x1b140 ; 0x1b140 7154: 0d 94 4d 25 jmp 0x24a9a ; 0x24a9a 7158: 0d 94 73 02 jmp 0x204e6 ; 0x204e6 715c: 0d 94 e1 9c jmp 0x339c2 ; 0x339c2 7160: 0d 94 0d 02 jmp 0x2041a ; 0x2041a 7164: 0c 94 f4 ea jmp 0x1d5e8 ; 0x1d5e8 7168: 0d 94 c3 96 jmp 0x32d86 ; 0x32d86 716c: 0c 94 09 d2 jmp 0x1a412 ; 0x1a412 7170: 0c 94 28 bd jmp 0x17a50 ; 0x17a50 7174: 0c 94 66 bd jmp 0x17acc ; 0x17acc 00007178 <__trampolines_end>: 7178: 6e 61 ori r22, 0x1E ; 30 717a: 6e 00 .word 0x006e ; ???? 0000717c <__c.2228>: 717c: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 718c: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 719c: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 71ac: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 71bc: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 71cc: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 71dc: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 71ec: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 71fc: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 720c: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 721c: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 722c: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 723c: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 724c: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 725c: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 726c: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 0000727a : 727a: 22 00 ". 0000727c : ... 0000727d : 727d: 20 45 53 50 00 ESP. 00007282 : 7282: 20 4e 53 50 00 NSP. 00007287 : 7287: 20 4f 46 46 00 OFF. 0000728c : 728c: 20 4f 4e 00 ON. 00007290 : 7290: 50 56 30 31 00 PV01. 00007295 : 7295: 20 5b 4d 50 5d 20 00 [MP] . 0000729c : 729c: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 72ac: 74 65 73 00 tes. 000072b0 : 72b0: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 000072bb : 72bb: 4d 33 31 30 00 M310. 000072c0 : 72c0: 4d 31 31 32 00 M112. 000072c5 : 72c5: 4d 31 31 30 00 M110. 000072ca : 72ca: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 000072d9 : 72d9: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 000072e9 : 72e9: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 72f9: 72 65 74 72 69 65 76 65 64 00 retrieved. 00007303 : 7303: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 7313: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 7323: 64 00 d. 00007325 : 7325: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 7335: 00 00 05 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 7345: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 7355: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 7365: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 7375: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 7385: 00 00 00 00 cd cc cc 3e 3d 0a 81 41 ff 08 43 3e .......>=..A..C> 7395: b0 99 ab 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ...C.B.B.Z4?Lb.E 73a5: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 73b5: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 2c 43 ......A....?..,C 73c5: 00 00 2c 43 00 00 40 41 00 00 f0 42 c0 03 00 00 ..,C..@A...B.... 73d5: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 10 ................ 73e5: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 000073f6 : 73f6: 20 30 78 00 0x. 000073fa : 73fa: 20 30 78 00 0x. 000073fe : 73fe: 65 72 72 6f 72 3a 20 00 error: . 00007406 : 7406: 44 32 33 20 2d 20 65 6d 65 72 67 65 6e 63 79 20 D23 - emergency 7416: 73 65 72 69 61 6c 20 64 75 6d 70 00 serial dump. 00007422 : 7422: 43 75 73 74 6f 6d 00 Custom. 00007429 : 7429: 4e 79 6c 6f 6e 50 41 00 NylonPA. 00007431 : 7431: 53 61 74 69 6e 20 20 00 Satin . 00007439 : 7439: 54 65 78 74 75 72 00 Textur. 00007440 : 7440: 53 6d 6f 6f 74 68 00 Smooth. 00007447 : 7447: 31 2e 30 00 1.0. 0000744b : 744b: 31 2e 35 00 1.5. 0000744f : 744f: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 00007457 : 7457: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 7467: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 00007474 : 7474: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 7484: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 0000748d <_PRI_LANG_SIGNATURE>: 748d: ff ff ff ff .... 00007491 : 7491: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 74a1: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 74b1: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 74c1: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 74d1: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 74e1: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 74f1: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7501: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7511: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7521: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 7531: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7541: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7551: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7561: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7571: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7581: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7591: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 75a1: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 75b1: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 75c1: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 75d1: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 75e1: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 75f1: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7601: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7611: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 764d: 00 40 14 54 .@.T 00007651 : 7651: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7661: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007669 : 7669: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7679: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007681 : 7681: 4e 41 4e NAN 00007684 : 7684: 49 4e 46 INF 00007687 : 7687: 00 00 7a 43 00 00 52 43 00 00 52 43 ..zC..RC..RC 00007693 : 7693: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 0000769f : 769f: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 000076ab : 76ab: 20 50 3a 00 P:. 000076af : 76af: 20 42 40 3a 00 B@:. 000076b4 : 76b4: 20 40 3a 00 @:. 000076b8 : 76b8: 20 2f 00 /. 000076bb : 76bb: 20 54 30 3a 00 T0:. 000076c0 : 76c0: 20 2f 00 /. 000076c3 : 76c3: 20 42 3a 00 B:. 000076c7 : 76c7: 20 2f 00 /. 000076ca : 76ca: 54 3a 00 T:. 000076cd : 76cd: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 76dd: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 76ed: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 000076fe : 76fe: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 770e: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 771e: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 772e: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007737 : 7737: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7747: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7757: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007766 : 7766: 20 20 00 . 00007769 : 7769: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 0000777a : 777a: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 778a: 20 35 2e 30 66 00 5.0f. 00007790 : 7790: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 0000779d : 779d: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 77ad: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 000077bb : 77bb: 20 45 3a 00 E:. 000077bf : 77bf: 20 5a 3a 00 Z:. 000077c3 : 77c3: 20 59 3a 00 Y:. 000077c7 : 77c7: 20 45 3a 00 E:. 000077cb : 77cb: 20 5a 3a 00 Z:. 000077cf : 77cf: 20 59 3a 00 Y:. 000077d3 : 77d3: 58 3a 00 X:. 000077d6 : 77d6: 20 2d 3e 20 00 -> . 000077db : 77db: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 000077e7 : 77e7: 2c 20 00 , . 000077ea : 77ea: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 77fa: 6f 77 6e 00 own. 000077fe : 77fe: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007806 : 7806: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7816: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007825 : 7825: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7835: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7845: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7855: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007862 : 7862: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7872: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7882: 69 6e 67 20 74 6f 20 30 00 ing to 0. 0000788b : 788b: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007893 : 7893: 54 3a 00 T:. 00007896 : 7896: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 78a6: 20 69 6e 70 75 74 00 input. 000078ad : 78ad: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 78bd: 20 75 73 65 72 00 user. 000078c3 : 78c3: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 000078d4 : 78d4: 73 65 72 69 61 6c 20 64 75 6d 70 20 00 serial dump . 000078e1 : 78e1: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 000078f1 : 78f1: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 7901: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 0000790b : 790b: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00007916 : 7916: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 7926: 20 72 61 6e 67 65 21 00 range!. 0000792e <_sPrinterName>: 792e: 4d 4b 32 2e 35 00 MK2.5. 00007934 <_sPrinterMmuName>: 7934: 4d 4b 32 2e 35 4d 4d 55 32 00 MK2.5MMU2. 0000793e <_nPrinterMmuType>: 793e: 1a 4f .O 00007940 <_nPrinterType>: 7940: fa 00 .. 00007942 : 7942: 25 33 64 2f 25 33 64 00 %3d/%3d. 0000794a : 794a: 25 33 64 00 %3d. 0000794e : 794e: 20 0a 20 0a 20 0a 20 00 . . . . 00007956 : 7956: 25 53 53 74 61 74 69 73 74 69 63 73 3a 0a 25 53 %SStatistics:.%S 7966: 20 20 4d 37 38 20 53 25 6c 75 20 54 25 6c 75 0a M78 S%lu T%lu. ... 00007977 : 7977: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 7987: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 7997: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 79a7: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 79b7: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 79c7: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 79d7: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 79e7: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 79f7: 0a 00 .. 000079f9 : 79f9: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7a09: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 00007a18 : 7a18: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7a28: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 7a38: 25 2e 32 66 0a 00 %.2f.. 00007a3e : 7a3e: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 7a4e: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 7a5e: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 7a6e: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 7a7e: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 7a8e: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 7a9e: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 7aae: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 7abe: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 7ace: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 7ade: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 7aee: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 7afe: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 7b0e: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 7b1e: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 7b2e: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00007b3f : 7b3f: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 7b4f: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 7b5f: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 7b6f: 2e 32 66 0a 00 .2f.. 00007b74 : 7b74: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 7b84: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 7b94: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 00007ba1 : 7ba1: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 7bb1: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 7bc1: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 7bd1: 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 f.%SMaximum feed 7be1: 72 61 74 65 73 20 28 6d 6d 2f 73 29 3a 0a 25 53 rates (mm/s):.%S 7bf1: 20 20 4d 32 30 33 20 58 25 2e 32 66 20 59 25 2e M203 X%.2f Y%. 7c01: 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 2f Z%.2f E%.2f.% 7c11: 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 SMaximum acceler 7c21: 61 74 69 6f 6e 20 28 6d 6d 2f 73 32 29 3a 0a 25 ation (mm/s2):.% 7c31: 53 20 20 4d 32 30 31 20 58 25 6c 75 20 59 25 6c S M201 X%lu Y%l 7c41: 75 20 5a 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 u Z%lu E%lu.%SAc 7c51: 63 65 6c 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 celeration: P=pr 7c61: 69 6e 74 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 int, R=retract, 7c71: 54 3d 74 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 T=travel.%S M20 7c81: 34 20 50 25 2e 32 66 20 52 25 2e 32 66 20 54 25 4 P%.2f R%.2f T% 7c91: 2e 32 66 0a 25 53 41 64 76 61 6e 63 65 64 20 76 .2f.%SAdvanced v 7ca1: 61 72 69 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 ariables: S=Min 7cb1: 66 65 65 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c feedrate (mm/s), 7cc1: 20 54 3d 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 T=Min travel fe 7cd1: 65 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 edrate (mm/s), B 7ce1: 3d 6d 69 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 =minimum segment 7cf1: 20 74 69 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 time (us), X=ma 7d01: 78 69 6d 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d ximum XY jerk (m 7d11: 6d 2f 73 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d m/s), Z=maximum 7d21: 20 5a 20 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 Z jerk (mm/s), 7d31: 20 45 3d 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 E=maximum E jer 7d41: 6b 20 28 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 k (mm/s).%S M20 7d51: 35 20 53 25 2e 32 66 20 54 25 2e 32 66 20 42 25 5 S%.2f T%.2f B% 7d61: 6c 75 20 58 25 2e 32 66 20 59 25 2e 32 66 20 5a lu X%.2f Y%.2f Z 7d71: 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d %.2f E%.2f.%SHom 7d81: 65 20 6f 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 e offset (mm):.% 7d91: 53 20 20 4d 32 30 36 20 58 25 2e 32 66 20 59 25 S M206 X%.2f Y% 7da1: 2e 32 66 20 5a 25 2e 32 66 0a 00 .2f Z%.2f.. 00007dac : 7dac: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00007db7 : 7db7: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00007dc2 : 7dc2: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 00007dcf : 7dcf: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 7ddf: 49 4f 4e 00 ION. 00007de3 : 7de3: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 00007df3 : 7df3: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 00007e03 : ... 00007e04 : 7e04: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 7e14: 20 46 69 6c 65 3a 20 00 File: . 00007e1c : 7e1c: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 00007e2a : 7e2a: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 00007e3a : 7e3a: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 00007e46 : 7e46: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 00007e56 : 7e56: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007e5e : 7e5e: 66 76 00 fv. 00007e61 : 7e61: 74 68 78 00 thx. 00007e65 : 7e65: 50 52 4e 00 PRN. 00007e69 <_ZZ16process_commandsvE3__c__84_>: 7e69: 22 28 32 29 00 "(2). 00007e6e <_ZZ16process_commandsvE3__c__83_>: 7e6e: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 00007e7f <_ZZ16process_commandsvE3__c__82_>: 7e7f: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 00007e89 <_ZZ16process_commandsvE3__c__81_>: 7e89: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 00007e9a <_ZZ16process_commandsvE3__c__79_>: 7e9a: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 7eaa: 65 70 2c 20 75 6d 00 ep, um. 00007eb1 <_ZZ16process_commandsvE3__c__80_>: 7eb1: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 7ec1: 3a 20 00 : . 00007ec4 <_ZZ16process_commandsvE3__c__78_>: 7ec4: 50 3a 00 P:. 00007ec7 <_ZZ16process_commandsvE3__c__77_>: 7ec7: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 7ed7: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 7ee7: 65 3a 00 e:. 00007eea <_ZZ16process_commandsvE3__c__76_>: 7eea: 20 41 00 A. 00007eed <_ZZ16process_commandsvE3__c__75_>: 7eed: 20 50 00 P. 00007ef0 <_ZZ16process_commandsvE3__c__74_>: 7ef0: 20 42 00 B. 00007ef3 <_ZZ16process_commandsvE3__c__73_>: 7ef3: 20 4c 00 L. 00007ef6 <_ZZ16process_commandsvE3__c__72_>: 7ef6: 20 52 00 R. 00007ef9 <_ZZ16process_commandsvE3__c__71_>: 7ef9: 20 5a 00 Z. 00007efc <_ZZ16process_commandsvE3__c__70_>: 7efc: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 00007f0d <_ZZ16process_commandsvE3__c__69_>: 7f0d: 53 68 65 65 74 20 00 Sheet . 00007f14 <_ZZ16process_commandsvE3__c__68_>: 7f14: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 7f24: 52 41 4e 47 45 00 RANGE. 00007f2a <_ZZ16process_commandsvE3__c__67_>: 7f2a: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 7f3a: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 00007f49 <_ZZ16process_commandsvE3__c__66_>: 7f49: 41 55 54 4f 00 AUTO. 00007f4e <_ZZ16process_commandsvE3__c__65_>: 7f4e: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 00007f5e <_ZZ16process_commandsvE3__c__64_>: 7f5e: 20 64 3a 00 d:. 00007f62 <_ZZ16process_commandsvE3__c__63_>: 7f62: 20 69 3a 00 i:. 00007f66 <_ZZ16process_commandsvE3__c__62_>: 7f66: 20 70 3a 00 p:. 00007f6a <_ZZ16process_commandsvE3__c__61_>: 7f6a: 20 64 3a 00 d:. 00007f6e <_ZZ16process_commandsvE3__c__60_>: 7f6e: 20 69 3a 00 i:. 00007f72 <_ZZ16process_commandsvE3__c__59_>: 7f72: 20 70 3a 00 p:. 00007f76 <_ZZ16process_commandsvE3__c__58_>: 7f76: 25 69 25 25 0a 00 %i%%.. 00007f7c <_ZZ16process_commandsvE3__c__57_>: 7f7c: 25 69 25 25 0a 00 %i%%.. 00007f82 <_ZZ16process_commandsvE3__c__56_>: 7f82: 22 28 31 29 00 "(1). 00007f87 <_ZZ16process_commandsvE3__c__51_>: 7f87: 2f 2f 00 //. 00007f8a <_ZZ16process_commandsvE3__c__50_>: ... 00007f8b <_ZZ16process_commandsvE3__c__49_>: 7f8b: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 7f9b: 31 00 1. 00007f9d <_ZZ16process_commandsvE3__c__48_>: 7f9d: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 00007fac <_ZZ16process_commandsvE3__c__47_>: 7fac: 31 2e 30 00 1.0. 00007fb0 <_ZZ16process_commandsvE3__c__46_>: 7fb0: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 7fc0: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 7fd0: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 7fe0: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 7ff0: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 8000: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 0000800a <_ZZ16process_commandsvE3__c__45_>: 800a: 37 37 33 31 30 32 34 65 64 00 7731024ed. 00008014 <_ZZ16process_commandsvE3__c__44_>: 8014: 5f 00 _. 00008016 <_ZZ16process_commandsvE3__c__43_>: 8016: 38 32 37 39 00 8279. 0000801b <_ZZ16process_commandsvE3__c__42_>: 801b: 2b 00 +. 0000801d <_ZZ16process_commandsvE3__c__41_>: 801d: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 802d: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 0000803b <_ZZ16process_commandsvE3__c__40_>: 803b: 4d 31 31 33 20 53 00 M113 S. 00008042 <_ZZ16process_commandsvE3__c__39_>: 8042: 6f 6b 20 00 ok . 00008046 <_ZZ16process_commandsvE3__c__33_>: 8046: 6e 2f 61 00 n/a. 0000804a <_ZZ16process_commandsvE3__c__32_>: 804a: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 805a: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 0000806a : 806a: 00 01 25 30 1d 0c ff 24 31 1c 0b ff 23 2f 1b 0a ..%0...$1...#/.. 807a: 17 ff 04 06 22 2b 1a 03 36 35 35 38 ...."+..6558 00008086 <_ZZ16process_commandsvE3__c__31_>: 8086: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 00008095 <_ZZ16process_commandsvE3__c__28_>: 8095: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 80a5: 25 73 0a 00 %s.. 000080a9 <_ZZ16process_commandsvE3__c__22_>: 80a9: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 80b9: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 000080c7 <_ZZ16process_commandsvE3__c__21_>: 80c7: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 80d7: 74 6f 72 00 tor. 000080db <_ZZ16process_commandsvE3__c__17_>: 80db: 73 65 74 00 set. 000080df <_ZZ16process_commandsvE3__c__16_>: 80df: 6e 6f 7a 7a 6c 65 00 nozzle. 000080e6 <_ZZ16process_commandsvE3__c__15_>: 80e6: 4d 42 4c 00 MBL. 000080ea <_ZZ16process_commandsvE3__c__14_>: 80ea: 46 52 00 FR. 000080ed <_ZZ16process_commandsvE3__c__13_>: 80ed: 4c 7a 00 Lz. 000080f0 <_ZZ16process_commandsvE3__c__12_>: 80f0: 4c 61 6e 67 00 Lang. 000080f5 <_ZZ16process_commandsvE3__c__11_>: 80f5: 31 5f 37 35 6d 6d 5f 4d 4b 32 35 2d 52 41 4d 42 1_75mm_MK25-RAMB 8105: 6f 31 30 61 2d 45 33 44 76 36 66 75 6c 6c 00 o10a-E3Dv6full. 00008114 <_ZZ16process_commandsvE3__c__10_>: 8114: 52 65 76 00 Rev. 00008118 : 8118: 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 00008124 : 8124: 46 69 72 00 Fir. 00008128 : 8128: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 00008133 : 8133: 53 4e 00 SN. 00008136 : 8136: 52 45 53 45 54 00 RESET. 0000813c : 813c: 4d 4d 55 52 45 53 00 MMURES. 00008143 : 8143: 75 76 6c 6f 00 uvlo. 00008148 : 8148: 46 41 4e 00 FAN. 0000814c : 814c: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 00008156 : 8156: 50 52 55 53 41 00 PRUSA. 0000815c : 815c: 25 2e 31 30 53 20 00 %.10S . 00008163 : 8163: 25 34 64 00 %4d. 00008167 : 8167: 4d 31 30 34 53 30 00 M104S0. 0000816e : 816e: 47 31 58 31 30 59 31 38 30 46 34 30 30 30 00 G1X10Y180F4000. 0000817d : 817d: 47 31 5a 31 30 46 31 33 30 30 00 G1Z10F1300. 00008188 : 8188: 4d 31 34 30 53 30 00 M140S0. 0000818f : 818f: 47 31 45 2d 30 2e 30 37 35 46 32 31 30 30 00 G1E-0.075F2100. 0000819e : 819e: 4d 32 30 34 53 31 30 30 30 00 M204S1000. 000081a8 : 81a8: 47 31 5a 35 46 37 32 30 30 00 G1Z5F7200. 000081b2 : 81b2: 47 31 45 2d 31 2e 35 46 32 31 30 30 00 G1E-1.5F2100. 000081bf : 81bf: 47 31 5a 30 2e 32 00 G1Z0.2. 000081c6 : 81c6: 47 31 58 32 30 32 2e 35 45 38 46 31 34 30 30 00 G1X202.5E8F1400. 000081d6 : 81d6: 47 31 59 2d 32 46 31 30 30 30 00 G1Y-2F1000. 000081e1 : 81e1: 47 31 58 32 34 30 45 32 35 46 32 32 30 30 00 G1X240E25F2200. 000081f0 : 81f0: 47 31 5a 30 2e 33 46 31 30 30 30 00 G1Z0.3F1000. 000081fc : 81fc: 47 31 58 35 35 45 38 46 32 30 30 30 00 G1X55E8F2000. 00008209 : 8209: 47 31 58 35 45 32 39 46 31 38 30 30 00 G1X5E29F1800. 00008216 : 8216: 47 31 58 35 35 45 32 39 46 31 30 37 33 00 G1X55E29F1073. 00008224 : 8224: 47 39 32 45 30 00 G92E0. 0000822a : 822a: 47 32 38 00 G28. 0000822e : 822e: 4d 31 30 39 00 M109. 00008233 : 8233: 4d 31 39 30 00 M190. 00008238 : 8238: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 00008247 : 8247: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 00008251 : 8251: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000825c : 825c: 58 3a 00 X:. 0000825f : 825f: 59 3a 00 Y:. 00008262 : 8262: 5a 3a 00 Z:. 00008265 : 8265: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 00008276 : 8276: 25 33 75 00 %3u. 0000827a : 827a: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio 828a: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin 829a: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing 82aa: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 000082b5 : 82b5: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio 82c5: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue 82d5: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t 82e5: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 000082ee : 82ee: 5a 30 00 Z0. 000082f1 : 82f1: 5a 31 00 Z1. 000082f4 : 82f4: 59 30 00 Y0. 000082f7 : 82f7: 59 31 00 Y1. 000082fa : 82fa: 58 30 00 X0. 000082fd : 82fd: 58 31 00 X1. 00008300 : 8300: 45 6e 64 20 73 74 6f 70 73 20 64 69 61 67 00 End stops diag. 0000830f : 830f: 47 38 30 00 G80. 00008313 : 8313: 4d 34 35 00 M45. 00008317 : 8317: 4d 34 35 20 5a 00 M45 Z. 0000831d : 831d: 47 37 36 00 G76. 00008321 : 8321: 4d 37 30 31 20 50 30 00 M701 P0. 00008329 : 8329: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d 8339: 0a 00 .. 0000833b : 833b: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 00008348 : 8348: 30 2e 38 30 00 0.80. 0000834d : 834d: 30 2e 36 30 00 0.60. 00008352 : 8352: 30 2e 34 30 00 0.40. 00008357 : 8357: 30 2e 32 35 00 0.25. 0000835c : 835c: 44 69 73 61 62 6c 65 20 66 61 72 6d 20 6d 6f 64 Disable farm mod 836c: 65 00 e. 0000836e : 836e: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 00008378 : 8378: 4d 4d 55 00 MMU. 0000837c : 837c: 4d 34 34 00 M44. 00008380 : 8380: 47 39 39 00 G99. 00008384 : 8384: 44 69 73 61 62 6c 65 20 66 61 72 6d 20 6d 6f 64 Disable farm mod 8394: 65 3f 00 e?. 00008397 : 8397: 47 32 38 20 58 59 00 G28 XY. 0000839e : 839e: 4d 20 38 34 00 M 84. 000083a3 : 83a3: 85 2e 2e 00 .... 000083a7 : 83a7: 25 33 64 2f 30 00 %3d/0. 000083ad : 83ad: 25 33 64 2f 30 00 %3d/0. 000083b3 : 83b3: 6c 63 64 5f 73 65 6c 66 63 68 65 63 6b 5f 61 78 lcd_selfcheck_ax 83c3: 69 73 20 25 64 2c 20 25 64 0a 00 is %d, %d.. 000083ce : 83ce: 48 6f 74 65 6e 64 00 Hotend. 000083d5 : 83d5: 42 65 64 00 Bed. 000083d9 : 83d9: 5a 00 Z. 000083db : 83db: 59 00 Y. 000083dd : 83dd: 58 00 X. 000083df <_ZL13STR_SEPARATOR.lto_priv.418>: 83df: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 83ef: 2d 2d 2d 2d 00 ----. 000083f4 : 83f4: 53 75 70 65 72 50 49 4e 44 41 3a 00 SuperPINDA:. 00008400 : 8400: 4d 67 51 67 8f 81 88 81 7d 81 6e 81 c8 68 67 81 MgQg....}.n..hg. 8410: 8a 68 .h 00008412 : 8412: 47 31 59 25 2e 34 66 45 25 2e 34 66 00 G1Y%.4fE%.4f. 0000841f : 841f: 47 31 5a 25 2e 32 66 00 G1Z%.2f. 00008427 : 8427: 47 31 58 35 30 59 31 35 35 00 G1X50Y155. 00008431 : 8431: 24 82 4d 67 b3 6c b2 81 a8 81 9e 81 $.Mg.l...... 0000843d : 843d: 47 31 58 25 2e 34 66 45 25 2e 34 66 00 G1X%.4fE%.4f. 0000844a : 844a: 47 31 46 31 30 38 30 00 G1F1080. 00008452 : 8452: 16 82 09 82 fc 81 f0 81 24 82 e1 81 d6 81 c6 81 ........$....... 8462: bf 81 .. 00008464 : 8464: 54 25 64 00 T%d. 00008468 : 8468: 47 31 5a 30 2e 34 00 G1Z0.4. 0000846f : 846f: 47 31 59 2d 33 46 31 30 30 30 00 G1Y-3F1000. 0000847a : 847a: 51 67 33 82 2e 82 2a 82 24 82 Qg3...*.$. 00008484 : 8484: 4d 38 34 20 58 59 00 M84 XY. 0000848b : 848b: 4d 31 30 39 20 53 32 38 30 00 M109 S280. 00008495 : 8495: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 84a5: 30 30 00 00. 000084a8 : 84a8: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 84b8: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 84c8: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 000084d8 : 84d8: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 84e8: 20 44 25 2e 32 66 00 D%.2f. 000084ef : 84ef: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 000084fc : 84fc: 52 43 00 RC. 000084ff : 84ff: 44 45 56 00 DEV. 00008503 : 8503: 42 45 54 41 00 BETA. 00008508 : 8508: 41 4c 50 48 41 00 ALPHA. 0000850e : 850e: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 851e: 01 01 00 00 04 01 07 01 0a 01 .......... 00008528 : 8528: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8538: 02 01 00 00 05 01 08 01 0b 01 .......... 00008542 : 8542: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8552: 00 01 00 00 03 01 06 01 09 01 .......... 0000855c : 855c: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 856c: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 857c: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 858c: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 859c: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 85ac: 05 04 04 04 08 08 ...... 000085b2 : 85b2: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 85c2: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 85d2: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 85e2: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 85f2: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8602: 80 10 20 40 04 80 .. @.. 00008608 : 8608: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8634: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 0000865e : 865e: 33 2e 31 34 2e 31 00 3.14.1. 00008665 : 8665: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8675: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8685: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008693 : 8693: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 000086a1 : 86a1: 61 64 63 5f 69 6e 69 74 00 adc_init. 000086aa : 86aa: 20 0a 20 0a 20 0a 20 00 . . . . 000086b2 : 86b2: 41 6c 6c 20 44 61 74 61 00 All Data. 000086bb : 86bb: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 000086c8 : 86c8: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 000086d6 : 86d6: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 000086e1 : 86e1: 4c 61 6e 67 75 61 67 65 00 Language. 000086ea <_ZZL13factory_resetcE3__c.lto_priv.494>: 86ea: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 000086fb : 86fb: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008709 : 8709: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008713 : 8713: 03 00 0e 00 01 00 40 00 ......@. 0000871b : 871b: 03 00 02 00 00 00 04 00 ........ 00008723 : 8723: 70 72 75 73 61 33 64 00 prusa3d. 0000872b : 872b: 32 30 32 35 2d 30 34 2d 32 32 20 32 32 3a 30 33 2025-04-22 22:03 873b: 3a 35 33 00 :53. 0000873f : 873f: 20 33 2e 31 34 2e 31 2d 38 32 37 39 5f 37 37 33 3.14.1-8279_773 874f: 31 30 32 34 65 64 00 1024ed. 00008756 : 8756: 73 74 61 72 74 00 start. 0000875c : 875c: 4d 32 39 00 M29. 00008760 : 8760: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 00008768 : 8768: 20 0a 20 0a 20 00 . . . 0000876e : 876e: 00 00 48 42 00 00 58 41 9a 99 8d 41 33 33 53 40 ..HB..XA...A33S@ 0000877e : 877e: 4d 4d 55 32 3a 00 MMU2:. 00008784 : 8784: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 8794: 64 00 d. 00008796 : 8796: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 87a6: 69 78 65 64 00 ixed. 000087ab : 87ab: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t 87bb: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 000087c8 : 87c8: 25 64 2f 39 00 %d/9. 000087cd : 87cd: 4d 4d 55 32 3a 00 MMU2:. 000087d3 : 87d3: 25 33 64 00 %3d. 000087d7 : 87d7: 18 01 04 19 02 0a ...... 000087dd : 87dd: 0b 55 95 54 1b 54 ae 53 65 53 d3 52 5b 52 f3 51 .U.T.T.SeS.R[R.Q 87ed: a4 51 84 51 38 51 84 51 21 51 21 51 21 51 21 51 .Q.Q8Q.Q!Q!Q!Q!Q 87fd: 21 51 21 51 21 51 21 51 21 51 21 51 21 51 21 51 !Q!Q!Q!Q!Q!Q!Q!Q 880d: 21 51 21 51 21 51 21 51 21 51 21 51 21 51 21 51 !Q!Q!Q!Q!Q!Q!Q!Q 881d: 21 51 21 51 ea 50 a9 50 5f 50 ec 4f b7 4f 6d 4f !Q!Q.P.P_P.O.OmO 882d: 23 4f c5 4e 8c 4e 4a 4e 2d 4e #O.N.NJN-N 00008837 : 8837: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. 8847: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ 8857: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 00008864 : 8864: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. 8874: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... 8884: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. 8894: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. 88a4: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. 88b4: f9 01 fa 01 fb 01 fc 01 84 03 .......... 000088be : 88be: 98 55 01 56 8d 55 84 55 7d 55 46 58 93 47 76 55 .U.V.U.U}UFX.GvU 88ce: 6c 55 lU 000088d0 : 88d0: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 88e0: 34 25 68 75 00 4%hu. 000088e5 : 88e5: 7b 5b 45 52 52 3a 00 {[ERR:. 000088ec <_ZL14FW_VERSION_STR.lto_priv.497>: 88ec: 33 2e 31 34 2e 31 00 3.14.1. 000088f3 : 88f3: 5d 5b 46 57 52 3a 00 ][FWR:. 000088fa : 88fa: 5d 5b 54 49 4d 3a 00 ][TIM:. 00008901 : 8901: 5d 5b 46 4e 4d 3a 00 ][FNM:. 00008908 : 8908: 5d 5b 46 45 4d 3a 00 ][FEM:. 0000890f : 890f: 5d 5b 50 43 44 3a 00 ][PCD:. 00008916 : 8916: 5b 54 46 55 3a 00 [TFU:. 0000891c : 891c: 5b 50 52 4e 3a 00 [PRN:. 00008922 : 8922: 5b 50 46 4e 3a 30 5d 00 [PFN:0]. 0000892a : 892a: 5b 44 49 41 3a 00 [DIA:. 00008930 : 8930: 5d 5b 41 54 42 3a 00 ][ATB:. 00008937 : 8937: 5d 5b 41 54 30 3a 00 ][AT0:. 0000893e : 893e: 5d 5b 53 54 42 3a 00 ][STB:. 00008945 : 8945: 5b 53 54 30 3a 00 [ST0:. 0000894b : 894b: 7b 5b 50 52 4e 3a 35 5d 00 {[PRN:5]. 00008954 : 8954: 7b 5b 50 52 4e 3a 30 5d 00 {[PRN:0]. 0000895d : 895d: 7b 5b 50 52 4e 3a 39 5d 00 {[PRN:9]. 00008966 : 8966: 7b 5b 50 52 4e 3a 38 5d 00 {[PRN:8]. 0000896f : 896f: 7b 5b 52 45 53 3a 30 5d 5b 46 49 4c 3a 00 {[RES:0][FIL:. 0000897d : 897d: 7b 5b 52 45 53 3a 31 5d 5b 46 49 4c 3a 00 {[RES:1][FIL:. 0000898b : 898b: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p 899b: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... 89ab: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b 89bb: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... 89cb: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T 89db: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... 89eb: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F 89fb: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... 8a0b: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 8a1b: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. 8a2b: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* 8a3b: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... 8a4b: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. 8a5b: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. 8a6b: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. 8a7b: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. 8a8b: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. 8a9b: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` 8aab: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. 8abb: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr 8acb: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... 8adb: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D 8aeb: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. 8afb: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V 8b0b: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... 8b1b: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( 8b2b: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... 8b3b: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: 8b4b: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... 8b5b: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... 8b6b: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... 8b7b: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 00008b8b : 8b8b: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 00008b94 : 8b94: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 8ba4: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 8bb4: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 8bc4: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 8bd4: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 8be4: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 8bf4: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 8c04: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 8c14: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 8c24: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 8c34: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 8c44: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 8c54: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 8c64: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 8c74: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 8c84: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 8c94: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 8ca4: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 8cb4: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 8cc4: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 8cd4: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 8ce4: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 8cf4: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 8d04: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 8d14: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 8d24: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 8d34: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 8d44: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 8d54: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 8d64: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 8d74: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 8d84: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 8d94: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 8da4: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 8db4: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 8dc4: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 8dd4: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 8de4: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 8df4: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 8e04: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 8e14: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 8e24: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 8e34: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 8e44: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 8e54: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 8e64: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 8e74: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 8e84: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 8e94: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 8ea4: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 8eb4: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 8ec4: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 8ed4: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 8ee4: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 8ef4: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 8f04: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 8f14: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 8f24: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 8f34: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 8f44: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 8f54: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 8f64: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 8f74: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 8f84: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 00008f94 : 8f94: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 8fa4: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 8fb4: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 8fc4: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 8fd4: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 8fe4: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 8ff4: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 9004: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 9014: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 9024: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 9034: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 9044: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 9054: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 9064: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 9074: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 9084: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 9094: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 90a4: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 90b4: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 90c4: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 90d4: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 90e4: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 90f4: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 9104: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 9114: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 9124: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 9134: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 9144: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 9154: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 9164: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 9174: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 9184: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 9194: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 91a4: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 91b4: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 91c4: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 91d4: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 91e4: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 91f4: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 9204: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 9214: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 9224: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 9234: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9244: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9254: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 9264: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 9274: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 9284: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 9294: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 92a4: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 92b4: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 92c4: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 92d4: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 92e4: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 92f4: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9304: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9314: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9324: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9334: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9344: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9354: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9364: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9374: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9384: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009394 : 9394: 45 30 3a 20 00 E0: . 00009399 : 9399: 5a 3a 20 00 Z: . 0000939d : 939d: 59 3a 20 00 Y: . 000093a1 : 93a1: 58 3a 20 00 X: . 000093a5 : 93a5: 4d 53 31 2c 4d 53 32 20 50 69 6e 73 00 MS1,MS2 Pins. 000093b2 <_ZZ12PID_autotunefiiE3__c__16_>: 93b2: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 93c2: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 93d2: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 93e2: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 93f2: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9402: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 0000940e <_ZZ12PID_autotunefiiE3__c__15_>: 940e: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 941e: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 0000942b <_ZZ12PID_autotunefiiE3__c__14_>: 942b: 20 40 3a 00 @:. 0000942f <_ZZ12PID_autotunefiiE3__c__13_>: 942f: 54 3a 00 T:. 00009432 <_ZZ12PID_autotunefiiE3__c__12_>: 9432: 42 3a 00 B:. 00009435 <_ZZ12PID_autotunefiiE3__c__11_>: 9435: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9445: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9455: 20 74 6f 6f 20 68 69 67 68 00 too high. 0000945f <_ZZ12PID_autotunefiiE3__c__10_>: 945f: 20 4b 64 3a 20 00 Kd: . 00009465 : 9465: 20 4b 69 3a 20 00 Ki: . 0000946b : 946b: 20 4b 70 3a 20 00 Kp: . 00009471 : 9471: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 0000947f : 947f: 20 54 75 3a 20 00 Tu: . 00009485 : 9485: 20 4b 75 3a 20 00 Ku: . 0000948b : 948b: 20 6d 61 78 3a 20 00 max: . 00009492 : 9492: 20 6d 69 6e 3a 20 00 min: . 00009499 : 9499: 20 64 3a 20 00 d: . 0000949e : 949e: 20 62 69 61 73 3a 20 00 bias: . 000094a6 : 94a6: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 94b6: 72 74 00 rt. 000094b9 : 94b9: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 94c9: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 94d9: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 000094e3 : 94e3: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 94f3: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 9503: 78 70 65 63 74 65 64 00 xpected. 0000950b : 950b: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 951b: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 952b: 70 65 63 74 65 64 00 pected. 00009532 : 9532: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 0000953e : 953e: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009546 : 9546: 4d 41 58 54 45 4d 50 00 MAXTEMP. 0000954e : 954e: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 0000955a : 955a: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 956a: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 957a: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 958a: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 959a: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 95aa: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 95ba: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 95ca: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 95da: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 95ea: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 95fa: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 960a: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 961a: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 962a: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 963a: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 964a: 00 3f 00 00 .?.. 0000964e : 964e: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 965e: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009666 : 9666: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9676: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 0000967f : 967f: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 0000968f : 968f: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 969f: 57 41 59 00 WAY. 000096a3 : 96a3: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 96b3: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 96c3: 29 00 ). 000096c5 : 96c5: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 96d5: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 96e5: 44 29 00 D). 000096e8 : 96e8: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 000096f6 : 96f6: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9706: 52 00 R. 00009708 : 9708: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009714 : 9714: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9724: 20 6f 66 66 2e 20 00 off. . 0000972b : 972b: 3a 20 00 : . 0000972e : 972e: 45 72 72 3a 20 00 Err: . 00009734 : 9734: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009744 : 9744: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009753 <__vector_51::__c>: 9753: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! 9763: 21 00 !. 00009765 : 9765: 3a 20 00 : . 00009768 : 9768: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 00009776 : 9776: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000977f : 977f: 20 3a 20 00 : . 00009783 : 9783: 25 33 53 00 %3S. 00009787 : 9787: 25 2d 37 73 00 %-7s. 0000978c : 978c: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 979c: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 000097a7 : 97a7: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 97b7: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 000097c6 : 97c6: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 97d6: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. 97e6: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 000097f3 : 97f3: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 9803: 0a 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 .%S. %-16.16S%-3 9813: 64 0a 00 d.. 00009816 : 9816: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 00009820 : 9820: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000982c <_ZZL16lcd_support_menuvE3__c__15_>: 982c: 20 00 . 0000982e <_ZZL16lcd_support_menuvE3__c__14_>: 982e: 20 00 . 00009830 <_ZZL16lcd_support_menuvE3__c__13_>: 9830: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr 9840: 3a 00 :. 00009842 <_ZZL16lcd_support_menuvE3__c__12_>: 9842: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 00009851 <_ZZL16lcd_support_menuvE3__c__11_>: 9851: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000985a <_ZZL16lcd_support_menuvE3__c__10_>: 985a: 20 46 57 3a 00 FW:. 0000985f : 985f: 32 30 32 35 2d 30 34 2d 32 32 00 2025-04-22. 0000986a : 986a: 45 33 44 76 36 66 75 6c 6c 00 E3Dv6full. 00009874 : 9874: 52 41 4d 42 6f 31 30 61 00 RAMBo10a. 0000987d : 987d: 31 5f 37 35 6d 6d 5f 4d 4b 32 35 00 1_75mm_MK25. 00009889 : 9889: 20 48 61 73 68 3a 37 37 33 31 30 32 34 65 64 00 Hash:7731024ed. 00009899 : 9899: 20 52 65 70 6f 3a 70 72 75 73 61 33 64 00 Repo:prusa3d. 000098a7 : 98a7: 20 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 000098b4 : 98b4: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 000098be : 98be: 3e 00 >. 000098c0 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: 98c0: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 000098cf <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: 98cf: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 000098db <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: 98db: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 000098eb <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: 98eb: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 000098f7 <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: 98f7: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 00009907 <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: 9907: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 00009913 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: 9913: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 00009923 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: 9923: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000992f <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: 992f: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000993e <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: 993e: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000994a <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: 994a: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 00009959 : 9959: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 00009965 : 9965: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 30 35 00 PC - 275/105. 00009975 : 9975: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 00009981 : 9981: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 00009991 : 9991: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000999d : 999d: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 000099ac : 99ac: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 000099b8 : 99b8: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 000099c7 : 99c7: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 000099d3 : 99d3: 6e 6f 7a 7a 6c 65 20 2d 20 20 32 35 30 2f 30 00 nozzle - 250/0. 000099e3 : 99e3: 66 61 72 6d 20 20 20 2d 20 20 32 35 30 2f 38 30 farm - 250/80 ... 000099f4 : 99f4: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 9a04: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 9a14: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 9a24: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 9a34: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 9a44: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 9a54: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 9a64: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 00009a74 : 9a74: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 00009a85 : 9a85: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 9a95: 6e 74 65 72 0a 00 nter.. 00009a9b : 9a9b: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 9aab: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 9abb: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 9acb: 20 61 64 3d 25 64 0a 00 ad=%d.. 00009ad3 : 9ad3: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 9ae3: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 9af3: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 00009b00 : 9b00: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 9b10: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 9b20: 25 64 0a 00 %d.. 00009b24 : 9b24: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 9b34: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 9b44: 0a 00 .. 00009b46 : 9b46: 25 30 32 78 00 %02x. 00009b4b : 9b4b: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 9b5b: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 00009b67 : 9b67: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 9b77: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 00009b83 : 9b83: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 9b93: fc 03 f8 01 f0 00 00 00 ........ 00009b9b : 9b9b: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 9bab: f8 01 f0 00 00 00 00 00 ........ 00009bb3 : 9bb3: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 9bc3: 65 61 76 65 0a 00 eave.. 00009bc9 : 9bc9: 20 3c 20 00 < . 00009bcd : 9bcd: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 9bdd: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 9bed: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 9bfd: 3a 00 :. 00009bff : ... 00009c00 : 9c00: 00 00 40 41 00 00 80 40 00 00 5c 43 00 00 80 40 ..@A...@..\C...@ 9c10: 00 00 5c 43 00 00 44 43 00 00 40 41 00 00 44 43 ..\C..DC..@A..DC 00009c20 : 9c20: 25 64 2f 34 00 %d/4. 00009c25 : 9c25: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 00009c31 : 9c31: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 9c41: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 9c51: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 9c61: 2e 00 .. 00009c63 : 9c63: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c 9c73: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 9c83: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 9c93: 20 61 64 3d 25 64 0a 00 ad=%d.. 00009c9b : 9c9b: 0a 00 .. 00009c9d : 9c9d: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 00009cac : 9cac: 25 64 0a 00 %d.. 00009cb0 : 9cb0: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 00009cc1 : 9cc1: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ 9cd1: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f 9ce1: 25 25 0a 00 %%.. 00009ce5 : 9ce5: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi 9cf5: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 00009d01 : 9d01: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00009d0d : 9d0d: 00 00 7a 43 00 00 56 43 9a d9 51 43 ..zC..VC..QC 00009d19 : 9d19: ff ff ff ... 00009d1c <_ZL16ramming_sequence.lto_priv.386>: 9d1c: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A 9d2c: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A 9d3c: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B 9d4c: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB 9d5c: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B 9d6c: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B 9d7c: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A 9d8c: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ 9d9c: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 00009dac : 9dac: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st 9dbc: 6f 70 70 65 64 00 opped. 00009dc2 : 9dc2: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 00009dd2 : 9dd2: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout 9de2: 73 74 61 72 74 65 64 00 started. 00009dea : 9dea: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki 9dfa: 6e 67 00 ng. 00009dfd : 9dfd: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown 9e0d: 70 65 6e 64 69 6e 67 00 pending. 00009e15 : 9e15: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 00009e22 : 9e22: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: 9e32: 20 00 . 00009e34 : 9e34: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope 9e44: 6e 65 64 00 ned. 00009e48 : 9e48: ba 5a a9 5a 95 5a 80 5a 6a 5a 57 5a 41 5a 2d 5a .Z.Z.Z.ZjZWZAZ-Z 9e58: 1c 5a 06 5a 95 5a a9 5a f2 59 e3 59 cf 59 be 59 .Z.Z.Z.Z.Y.Y.Y.Y 9e68: a9 59 ed 61 93 59 81 59 6e 59 5d 59 48 59 35 59 .Y.a.Y.YnY]YHY5Y 9e78: 21 59 0c 59 03 59 f1 58 dc 58 !Y.Y.Y.X.X 00009e82 : 9e82: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 00009e8c : 9e8c: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r 9e9c: 75 6e 6f 75 74 21 00 unout!. 00009ea3 : 9ea3: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti 9eb3: 6d 65 6f 75 74 00 meout. 00009eb9 : 9eb9: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 00009ec8 : 9ec8: 03 00 03 ... 00009ecb : 9ecb: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 00009edc : 9edc: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 00009eea : 9eea: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 00009efb : 9efb: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe 9f0b: 64 00 d. 00009f0d : 9f0d: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress 9f1d: 65 64 00 ed. 00009f20 <_ZN4MMU2L11errorTitlesE.lto_priv.450>: 9f20: 17 5d 02 5d eb 5c d6 5c c1 5c ad 5c 9d 5c 86 5c .].].\.\.\.\.\.\ 9f30: 6f 5c 58 5c 44 5c 30 5c 1a 5c 1a 5c 1a 5c 05 5c o\X\D\0\.\.\.\.\ 9f40: 05 5c 05 5c f2 5b f2 5b f2 5b df 5b df 5b df 5b .\.\.[.[.[.[.[.[ 9f50: c8 5b c8 5b c8 5b b3 5b b3 5b b3 5b 9d 5b 9d 5b .[.[.[.[.[.[.[.[ 9f60: 9d 5b 8d 5b 78 5b 62 5b 4c 5b 3d 5b 30 5b 19 5b .[.[x[b[L[=[0[.[ 9f70: 06 5b f4 5a e1 5a cf 5a bf 5a .[.Z.Z.Z.Z 00009f7a : 9f7a: 42 75 74 74 6f 6e 00 Button. 00009f81 : 9f81: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b 9f91: 74 6e 4c 4d 52 20 00 tnLMR . 00009f98 : 9f98: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp 9fa8: 74 73 00 ts. 00009fab <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.449>: 9fab: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . 9fbb: 20 20 20 81 00 .. 00009fc0 : 9fc0: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu 9fd0: 72 65 20 72 65 61 63 68 65 64 00 re reached. 00009fdb : 9fdb: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 00009fe9 : 9fe9: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl 9ff9: 65 61 72 65 64 00 eared. 00009fff : 9fff: 20 57 3a 00 W:. 0000a003 : a003: 20 45 3a 00 E:. 0000a007 : a007: 54 3a 00 T:. 0000a00a : a00a: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000a01b : a01b: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000a028 : a028: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000a036 : a036: 20 53 69 7a 65 3a 20 00 Size: . 0000a03e : a03e: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000a04c : a04c: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000a05d : a05d: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000a06e : a06e: 22 20 70 6f 73 00 " pos. 0000a074 : a074: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000a07f : a07f: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL a08f: 74 61 72 67 65 74 3a 22 00 target:". 0000a098 : a098: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s a0a8: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w a0b8: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev a0c8: 65 6c 73 2e 00 els.. 0000a0cd : a0cd: 06 28 33 d0 36 c2 3e 01 3f 15 41 32 42 3b 43 f2 .(3.6.>.?.A2B;C. a0dd: 44 3b 45 f2 46 22 47 3b 48 f2 49 3b 4a f0 58 98 D;E.F"G;H.I;J.X. a0ed: 59 0c 5a 08 5b 0c 5c 08 61 10 67 9b 6e 22 71 07 Y.Z.[.\.a.g.n"q. a0fd: 72 08 ff r.. 0000a100 : a100: 09 5a 0d 00 0e f0 19 14 5e 08 20 64 2b 6d 32 2f .Z......^. d+m2/ a110: ff . 0000a111 : a111: 20 22 25 73 22 00 "%s". 0000a117 : a117: 20 25 23 6c 78 00 %#lx. 0000a11d : a11d: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000a126 : a126: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% a136: 73 22 0a 00 s".. 0000a13a : a13a: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000a143 : a143: 04 1a .. 0000a145 : a145: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt a155: 74 65 6d 70 74 73 00 tempts. 0000a15c : a15c: 08 1b 1c ... 0000a15f : a15f: 0b 14 .. 0000a161 : a161: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000a170 : a170: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000a17f <_ZL10bufferFull.lto_priv.516>: a17f: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer a18f: 20 66 75 6c 6c 21 00 full!. 0000a196 : a196: 22 00 ". 0000a198 : a198: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the a1a8: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000a1b1 : a1b1: 45 72 72 6f 72 3a 00 Error:. 0000a1b8 : a1b8: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a1c2 <_ZL9mmu2Magic.lto_priv.360>: a1c2: 4d 4d 55 32 3a 00 MMU2:. 0000a1c8 <_ZL9mmu2Magic.lto_priv.361>: a1c8: 4d 4d 55 32 3a 00 MMU2:. 0000a1ce : a1ce: 65 63 68 6f 3a 00 echo:. 0000a1d4 : a1d4: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000a1dc : a1dc: 4d 4d 55 20 69 73 20 00 MMU is . 0000a1e4 <__ctors_start>: a1e4: f2 37 cpi r31, 0x72 ; 114 0000a1e6 <__ctors_end>: a1e6: 9f 63 ori r25, 0x3F ; 63 0000a1e8 <__dtors_end>: a1e8: 11 24 eor r1, r1 a1ea: 1f be out 0x3f, r1 ; 63 a1ec: cf ef ldi r28, 0xFF ; 255 a1ee: d1 e2 ldi r29, 0x21 ; 33 a1f0: de bf out 0x3e, r29 ; 62 a1f2: cd bf out 0x3d, r28 ; 61 a1f4: 00 e0 ldi r16, 0x00 ; 0 a1f6: 0c bf out 0x3c, r16 ; 60 0000a1f8 <__do_copy_data>: a1f8: 13 e0 ldi r17, 0x03 ; 3 a1fa: a0 e0 ldi r26, 0x00 ; 0 a1fc: b2 e0 ldi r27, 0x02 ; 2 a1fe: e2 ed ldi r30, 0xD2 ; 210 a200: f4 e5 ldi r31, 0x54 ; 84 a202: 03 e0 ldi r16, 0x03 ; 3 a204: 0b bf out 0x3b, r16 ; 59 a206: 02 c0 rjmp .+4 ; 0xa20c <__do_copy_data+0x14> a208: 07 90 elpm r0, Z+ a20a: 0d 92 st X+, r0 a20c: a2 30 cpi r26, 0x02 ; 2 a20e: b1 07 cpc r27, r17 a210: d9 f7 brne .-10 ; 0xa208 <__do_copy_data+0x10> 0000a212 <__do_clear_bss>: a212: 27 e1 ldi r18, 0x17 ; 23 a214: a2 e0 ldi r26, 0x02 ; 2 a216: b3 e0 ldi r27, 0x03 ; 3 a218: 01 c0 rjmp .+2 ; 0xa21c <.do_clear_bss_start> 0000a21a <.do_clear_bss_loop>: a21a: 1d 92 st X+, r1 0000a21c <.do_clear_bss_start>: a21c: a7 31 cpi r26, 0x17 ; 23 a21e: b2 07 cpc r27, r18 a220: e1 f7 brne .-8 ; 0xa21a <.do_clear_bss_loop> 0000a222 <__do_global_ctors>: a222: 10 e5 ldi r17, 0x50 ; 80 a224: c3 ef ldi r28, 0xF3 ; 243 a226: d0 e5 ldi r29, 0x50 ; 80 a228: 00 e0 ldi r16, 0x00 ; 0 a22a: 06 c0 rjmp .+12 ; 0xa238 <__do_global_ctors+0x16> a22c: 21 97 sbiw r28, 0x01 ; 1 a22e: 01 09 sbc r16, r1 a230: 80 2f mov r24, r16 a232: fe 01 movw r30, r28 a234: 0f 94 ad a4 call 0x3495a ; 0x3495a <__tablejump2__> a238: c2 3f cpi r28, 0xF2 ; 242 a23a: d1 07 cpc r29, r17 a23c: 80 e0 ldi r24, 0x00 ; 0 a23e: 08 07 cpc r16, r24 a240: a9 f7 brne .-22 ; 0xa22c <__do_global_ctors+0xa> a242: 0e 94 32 eb call 0x1d664 ; 0x1d664
a246: 0d 94 57 aa jmp 0x354ae ; 0x354ae <__do_global_dtors> 0000a24a <__bad_interrupt>: a24a: 0c 94 cf 84 jmp 0x1099e ; 0x1099e <__vector_default> 0000a24e : a24e: 2f 92 push r2 a250: 3f 92 push r3 a252: 4f 92 push r4 a254: 5f 92 push r5 a256: 6f 92 push r6 a258: 7f 92 push r7 a25a: 8f 92 push r8 a25c: 9f 92 push r9 a25e: af 92 push r10 a260: bf 92 push r11 a262: cf 92 push r12 a264: df 92 push r13 a266: ef 92 push r14 a268: ff 92 push r15 a26a: 0f 93 push r16 a26c: 1f 93 push r17 a26e: cf 93 push r28 a270: df 93 push r29 a272: cd b7 in r28, 0x3d ; 61 a274: de b7 in r29, 0x3e ; 62 a276: 2f 97 sbiw r28, 0x0f ; 15 a278: 0f b6 in r0, 0x3f ; 63 a27a: f8 94 cli a27c: de bf out 0x3e, r29 ; 62 a27e: 0f be out 0x3f, r0 ; 63 a280: cd bf out 0x3d, r28 ; 61 a282: 6c 01 movw r12, r24 a284: 1b 01 movw r2, r22 a286: 5a 01 movw r10, r20 a288: fc 01 movw r30, r24 a28a: 17 82 std Z+7, r1 ; 0x07 a28c: 16 82 std Z+6, r1 ; 0x06 a28e: 83 81 ldd r24, Z+3 ; 0x03 a290: 9e 01 movw r18, r28 a292: 2f 5f subi r18, 0xFF ; 255 a294: 3f 4f sbci r19, 0xFF ; 255 a296: 49 01 movw r8, r18 a298: 81 fd sbrc r24, 1 a29a: d2 c0 rjmp .+420 ; 0xa440 a29c: 8f ef ldi r24, 0xFF ; 255 a29e: 9f ef ldi r25, 0xFF ; 255 a2a0: ee c2 rjmp .+1500 ; 0xa87e a2a2: f1 2c mov r15, r1 a2a4: 51 2c mov r5, r1 a2a6: 00 e0 ldi r16, 0x00 ; 0 a2a8: 00 32 cpi r16, 0x20 ; 32 a2aa: 38 f4 brcc .+14 ; 0xa2ba a2ac: 8b 32 cpi r24, 0x2B ; 43 a2ae: 09 f1 breq .+66 ; 0xa2f2 a2b0: 90 f4 brcc .+36 ; 0xa2d6 a2b2: 80 32 cpi r24, 0x20 ; 32 a2b4: f9 f0 breq .+62 ; 0xa2f4 a2b6: 83 32 cpi r24, 0x23 ; 35 a2b8: 09 f1 breq .+66 ; 0xa2fc a2ba: 07 fd sbrc r16, 7 a2bc: 34 c0 rjmp .+104 ; 0xa326 a2be: 20 ed ldi r18, 0xD0 ; 208 a2c0: 28 0f add r18, r24 a2c2: 2a 30 cpi r18, 0x0A ; 10 a2c4: 20 f5 brcc .+72 ; 0xa30e a2c6: 06 ff sbrs r16, 6 a2c8: 1b c0 rjmp .+54 ; 0xa300 a2ca: fa e0 ldi r31, 0x0A ; 10 a2cc: ff 9e mul r15, r31 a2ce: 20 0d add r18, r0 a2d0: 11 24 eor r1, r1 a2d2: f2 2e mov r15, r18 a2d4: 05 c0 rjmp .+10 ; 0xa2e0 a2d6: 8d 32 cpi r24, 0x2D ; 45 a2d8: 79 f0 breq .+30 ; 0xa2f8 a2da: 80 33 cpi r24, 0x30 ; 48 a2dc: 71 f7 brne .-36 ; 0xa2ba a2de: 01 60 ori r16, 0x01 ; 1 a2e0: f1 01 movw r30, r2 a2e2: 93 fd sbrc r25, 3 a2e4: 85 91 lpm r24, Z+ a2e6: 93 ff sbrs r25, 3 a2e8: 81 91 ld r24, Z+ a2ea: 1f 01 movw r2, r30 a2ec: 81 11 cpse r24, r1 a2ee: dc cf rjmp .-72 ; 0xa2a8 a2f0: 1a c0 rjmp .+52 ; 0xa326 a2f2: 02 60 ori r16, 0x02 ; 2 a2f4: 04 60 ori r16, 0x04 ; 4 a2f6: f4 cf rjmp .-24 ; 0xa2e0 a2f8: 08 60 ori r16, 0x08 ; 8 a2fa: f2 cf rjmp .-28 ; 0xa2e0 a2fc: 00 61 ori r16, 0x10 ; 16 a2fe: f0 cf rjmp .-32 ; 0xa2e0 a300: 3a e0 ldi r19, 0x0A ; 10 a302: 53 9e mul r5, r19 a304: 20 0d add r18, r0 a306: 11 24 eor r1, r1 a308: 52 2e mov r5, r18 a30a: 00 62 ori r16, 0x20 ; 32 a30c: e9 cf rjmp .-46 ; 0xa2e0 a30e: 8e 32 cpi r24, 0x2E ; 46 a310: 21 f4 brne .+8 ; 0xa31a a312: 06 fd sbrc r16, 6 a314: b1 c2 rjmp .+1378 ; 0xa878 a316: 00 64 ori r16, 0x40 ; 64 a318: e3 cf rjmp .-58 ; 0xa2e0 a31a: 8c 36 cpi r24, 0x6C ; 108 a31c: 11 f4 brne .+4 ; 0xa322 a31e: 00 68 ori r16, 0x80 ; 128 a320: df cf rjmp .-66 ; 0xa2e0 a322: 88 36 cpi r24, 0x68 ; 104 a324: e9 f2 breq .-70 ; 0xa2e0 a326: 9b eb ldi r25, 0xBB ; 187 a328: 98 0f add r25, r24 a32a: 93 30 cpi r25, 0x03 ; 3 a32c: 08 f0 brcs .+2 ; 0xa330 a32e: 5f c0 rjmp .+190 ; 0xa3ee a330: 00 61 ori r16, 0x10 ; 16 a332: 80 5e subi r24, 0xE0 ; 224 a334: 06 fd sbrc r16, 6 a336: 02 c0 rjmp .+4 ; 0xa33c a338: 46 e0 ldi r20, 0x06 ; 6 a33a: f4 2e mov r15, r20 a33c: 10 2f mov r17, r16 a33e: 1f 73 andi r17, 0x3F ; 63 a340: 85 36 cpi r24, 0x65 ; 101 a342: 09 f0 breq .+2 ; 0xa346 a344: 5b c0 rjmp .+182 ; 0xa3fc a346: 10 64 ori r17, 0x40 ; 64 a348: 17 ff sbrs r17, 7 a34a: 61 c0 rjmp .+194 ; 0xa40e a34c: 8f 2d mov r24, r15 a34e: 9b e3 ldi r25, 0x3B ; 59 a350: 9f 15 cp r25, r15 a352: 08 f4 brcc .+2 ; 0xa356 a354: 8b e3 ldi r24, 0x3B ; 59 a356: 44 24 eor r4, r4 a358: 43 94 inc r4 a35a: 48 0e add r4, r24 a35c: 27 e0 ldi r18, 0x07 ; 7 a35e: 35 01 movw r6, r10 a360: f4 e0 ldi r31, 0x04 ; 4 a362: 6f 0e add r6, r31 a364: 71 1c adc r7, r1 a366: f5 01 movw r30, r10 a368: 60 81 ld r22, Z a36a: 71 81 ldd r23, Z+1 ; 0x01 a36c: 82 81 ldd r24, Z+2 ; 0x02 a36e: 93 81 ldd r25, Z+3 ; 0x03 a370: 04 2d mov r16, r4 a372: a4 01 movw r20, r8 a374: 0f 94 56 a0 call 0x340ac ; 0x340ac <__ftoa_engine> a378: 5c 01 movw r10, r24 a37a: f9 81 ldd r31, Y+1 ; 0x01 a37c: fc 87 std Y+12, r31 ; 0x0c a37e: f0 ff sbrs r31, 0 a380: 03 c0 rjmp .+6 ; 0xa388 a382: 0d e2 ldi r16, 0x2D ; 45 a384: f3 ff sbrs r31, 3 a386: 07 c0 rjmp .+14 ; 0xa396 a388: 0b e2 ldi r16, 0x2B ; 43 a38a: 11 fd sbrc r17, 1 a38c: 04 c0 rjmp .+8 ; 0xa396 a38e: 01 2f mov r16, r17 a390: 04 70 andi r16, 0x04 ; 4 a392: 12 fd sbrc r17, 2 a394: 00 e2 ldi r16, 0x20 ; 32 a396: 2c 85 ldd r18, Y+12 ; 0x0c a398: 2c 70 andi r18, 0x0C ; 12 a39a: e2 2e mov r14, r18 a39c: 09 f4 brne .+2 ; 0xa3a0 a39e: 6b c0 rjmp .+214 ; 0xa476 a3a0: 01 11 cpse r16, r1 a3a2: d8 c2 rjmp .+1456 ; 0xa954 a3a4: f3 e0 ldi r31, 0x03 ; 3 a3a6: e1 2c mov r14, r1 a3a8: f5 15 cp r31, r5 a3aa: a0 f4 brcc .+40 ; 0xa3d4 a3ac: 83 e0 ldi r24, 0x03 ; 3 a3ae: e5 2c mov r14, r5 a3b0: e8 1a sub r14, r24 a3b2: 13 fd sbrc r17, 3 a3b4: 08 c0 rjmp .+16 ; 0xa3c6 a3b6: b6 01 movw r22, r12 a3b8: 80 e2 ldi r24, 0x20 ; 32 a3ba: 90 e0 ldi r25, 0x00 ; 0 a3bc: 0f 94 05 a2 call 0x3440a ; 0x3440a a3c0: ea 94 dec r14 a3c2: e1 10 cpse r14, r1 a3c4: f8 cf rjmp .-16 ; 0xa3b6 a3c6: 00 23 and r16, r16 a3c8: 29 f0 breq .+10 ; 0xa3d4 a3ca: b6 01 movw r22, r12 a3cc: 80 2f mov r24, r16 a3ce: 90 e0 ldi r25, 0x00 ; 0 a3d0: 0f 94 05 a2 call 0x3440a ; 0x3440a a3d4: 3c 85 ldd r19, Y+12 ; 0x0c a3d6: 28 e7 ldi r18, 0x78 ; 120 a3d8: a2 2e mov r10, r18 a3da: 21 e7 ldi r18, 0x71 ; 113 a3dc: b2 2e mov r11, r18 a3de: 33 fd sbrc r19, 3 a3e0: 04 c0 rjmp .+8 ; 0xa3ea a3e2: 9c e7 ldi r25, 0x7C ; 124 a3e4: a9 2e mov r10, r25 a3e6: 91 e7 ldi r25, 0x71 ; 113 a3e8: b9 2e mov r11, r25 a3ea: 10 71 andi r17, 0x10 ; 16 a3ec: 22 c0 rjmp .+68 ; 0xa432 a3ee: 9b e9 ldi r25, 0x9B ; 155 a3f0: 98 0f add r25, r24 a3f2: 93 30 cpi r25, 0x03 ; 3 a3f4: 08 f0 brcs .+2 ; 0xa3f8 a3f6: 47 c1 rjmp .+654 ; 0xa686 a3f8: 0f 7e andi r16, 0xEF ; 239 a3fa: 9c cf rjmp .-200 ; 0xa334 a3fc: 86 36 cpi r24, 0x66 ; 102 a3fe: 11 f4 brne .+4 ; 0xa404 a400: 10 68 ori r17, 0x80 ; 128 a402: a2 cf rjmp .-188 ; 0xa348 a404: ff 20 and r15, r15 a406: 09 f4 brne .+2 ; 0xa40a a408: 9f cf rjmp .-194 ; 0xa348 a40a: fa 94 dec r15 a40c: 9d cf rjmp .-198 ; 0xa348 a40e: e7 e0 ldi r30, 0x07 ; 7 a410: 2f 2d mov r18, r15 a412: ef 15 cp r30, r15 a414: 18 f4 brcc .+6 ; 0xa41c a416: 27 e0 ldi r18, 0x07 ; 7 a418: 37 e0 ldi r19, 0x07 ; 7 a41a: f3 2e mov r15, r19 a41c: 41 2c mov r4, r1 a41e: 9f cf rjmp .-194 ; 0xa35e a420: 11 11 cpse r17, r1 a422: 80 52 subi r24, 0x20 ; 32 a424: b6 01 movw r22, r12 a426: 90 e0 ldi r25, 0x00 ; 0 a428: 0f 94 05 a2 call 0x3440a ; 0x3440a a42c: 8f ef ldi r24, 0xFF ; 255 a42e: a8 1a sub r10, r24 a430: b8 0a sbc r11, r24 a432: f5 01 movw r30, r10 a434: 84 91 lpm r24, Z a436: 81 11 cpse r24, r1 a438: f3 cf rjmp .-26 ; 0xa420 a43a: e1 10 cpse r14, r1 a43c: 84 c2 rjmp .+1288 ; 0xa946 a43e: 53 01 movw r10, r6 a440: f6 01 movw r30, r12 a442: 93 81 ldd r25, Z+3 ; 0x03 a444: f1 01 movw r30, r2 a446: 93 fd sbrc r25, 3 a448: 85 91 lpm r24, Z+ a44a: 93 ff sbrs r25, 3 a44c: 81 91 ld r24, Z+ a44e: 1f 01 movw r2, r30 a450: 88 23 and r24, r24 a452: 09 f4 brne .+2 ; 0xa456 a454: 11 c2 rjmp .+1058 ; 0xa878 a456: 85 32 cpi r24, 0x25 ; 37 a458: 41 f4 brne .+16 ; 0xa46a a45a: 93 fd sbrc r25, 3 a45c: 85 91 lpm r24, Z+ a45e: 93 ff sbrs r25, 3 a460: 81 91 ld r24, Z+ a462: 1f 01 movw r2, r30 a464: 85 32 cpi r24, 0x25 ; 37 a466: 09 f0 breq .+2 ; 0xa46a a468: 1c cf rjmp .-456 ; 0xa2a2 a46a: b6 01 movw r22, r12 a46c: 90 e0 ldi r25, 0x00 ; 0 a46e: 0f 94 05 a2 call 0x3440a ; 0x3440a a472: 35 01 movw r6, r10 a474: e4 cf rjmp .-56 ; 0xa43e a476: 17 ff sbrs r17, 7 a478: 6f c0 rjmp .+222 ; 0xa558 a47a: 4a 0c add r4, r10 a47c: fc 85 ldd r31, Y+12 ; 0x0c a47e: f4 ff sbrs r31, 4 a480: 04 c0 rjmp .+8 ; 0xa48a a482: 8a 81 ldd r24, Y+2 ; 0x02 a484: 81 33 cpi r24, 0x31 ; 49 a486: 09 f4 brne .+2 ; 0xa48a a488: 4a 94 dec r4 a48a: 14 14 cp r1, r4 a48c: 0c f0 brlt .+2 ; 0xa490 a48e: 86 c0 rjmp .+268 ; 0xa59c a490: 28 e0 ldi r18, 0x08 ; 8 a492: 24 15 cp r18, r4 a494: 10 f4 brcc .+4 ; 0xa49a a496: 88 e0 ldi r24, 0x08 ; 8 a498: 48 2e mov r4, r24 a49a: 85 e0 ldi r24, 0x05 ; 5 a49c: 90 e0 ldi r25, 0x00 ; 0 a49e: 17 ff sbrs r17, 7 a4a0: 06 c0 rjmp .+12 ; 0xa4ae a4a2: c5 01 movw r24, r10 a4a4: b7 fe sbrs r11, 7 a4a6: 02 c0 rjmp .+4 ; 0xa4ac a4a8: 90 e0 ldi r25, 0x00 ; 0 a4aa: 80 e0 ldi r24, 0x00 ; 0 a4ac: 01 96 adiw r24, 0x01 ; 1 a4ae: 01 11 cpse r16, r1 a4b0: 01 96 adiw r24, 0x01 ; 1 a4b2: ff 20 and r15, r15 a4b4: 31 f0 breq .+12 ; 0xa4c2 a4b6: 2f 2d mov r18, r15 a4b8: 30 e0 ldi r19, 0x00 ; 0 a4ba: 2f 5f subi r18, 0xFF ; 255 a4bc: 3f 4f sbci r19, 0xFF ; 255 a4be: 82 0f add r24, r18 a4c0: 93 1f adc r25, r19 a4c2: 58 16 cp r5, r24 a4c4: 19 06 cpc r1, r25 a4c6: 19 f0 breq .+6 ; 0xa4ce a4c8: 14 f0 brlt .+4 ; 0xa4ce a4ca: e5 2c mov r14, r5 a4cc: e8 1a sub r14, r24 a4ce: 81 2f mov r24, r17 a4d0: 89 70 andi r24, 0x09 ; 9 a4d2: 11 f4 brne .+4 ; 0xa4d8 a4d4: e1 10 cpse r14, r1 a4d6: 67 c0 rjmp .+206 ; 0xa5a6 a4d8: 00 23 and r16, r16 a4da: 29 f0 breq .+10 ; 0xa4e6 a4dc: b6 01 movw r22, r12 a4de: 80 2f mov r24, r16 a4e0: 90 e0 ldi r25, 0x00 ; 0 a4e2: 0f 94 05 a2 call 0x3440a ; 0x3440a a4e6: 13 fd sbrc r17, 3 a4e8: 02 c0 rjmp .+4 ; 0xa4ee a4ea: e1 10 cpse r14, r1 a4ec: 63 c0 rjmp .+198 ; 0xa5b4 a4ee: 17 ff sbrs r17, 7 a4f0: 7c c0 rjmp .+248 ; 0xa5ea a4f2: 85 01 movw r16, r10 a4f4: b7 fe sbrs r11, 7 a4f6: 02 c0 rjmp .+4 ; 0xa4fc a4f8: 10 e0 ldi r17, 0x00 ; 0 a4fa: 00 e0 ldi r16, 0x00 ; 0 a4fc: c5 01 movw r24, r10 a4fe: 84 19 sub r24, r4 a500: 91 09 sbc r25, r1 a502: 2c 01 movw r4, r24 a504: 6f 2d mov r22, r15 a506: 70 e0 ldi r23, 0x00 ; 0 a508: ee 27 eor r30, r30 a50a: ff 27 eor r31, r31 a50c: e6 1b sub r30, r22 a50e: f7 0b sbc r31, r23 a510: ff 87 std Y+15, r31 ; 0x0f a512: ee 87 std Y+14, r30 ; 0x0e a514: 0f 3f cpi r16, 0xFF ; 255 a516: 10 07 cpc r17, r16 a518: 29 f4 brne .+10 ; 0xa524 a51a: b6 01 movw r22, r12 a51c: 8e e2 ldi r24, 0x2E ; 46 a51e: 90 e0 ldi r25, 0x00 ; 0 a520: 0f 94 05 a2 call 0x3440a ; 0x3440a a524: a0 16 cp r10, r16 a526: b1 06 cpc r11, r17 a528: 0c f4 brge .+2 ; 0xa52c a52a: 4b c0 rjmp .+150 ; 0xa5c2 a52c: 40 16 cp r4, r16 a52e: 51 06 cpc r5, r17 a530: 0c f0 brlt .+2 ; 0xa534 a532: 47 c0 rjmp .+142 ; 0xa5c2 a534: f5 01 movw r30, r10 a536: e0 1b sub r30, r16 a538: f1 0b sbc r31, r17 a53a: e8 0d add r30, r8 a53c: f9 1d adc r31, r9 a53e: 81 81 ldd r24, Z+1 ; 0x01 a540: 01 50 subi r16, 0x01 ; 1 a542: 11 09 sbc r17, r1 a544: 2e 85 ldd r18, Y+14 ; 0x0e a546: 3f 85 ldd r19, Y+15 ; 0x0f a548: 02 17 cp r16, r18 a54a: 13 07 cpc r17, r19 a54c: e4 f1 brlt .+120 ; 0xa5c6 a54e: b6 01 movw r22, r12 a550: 90 e0 ldi r25, 0x00 ; 0 a552: 0f 94 05 a2 call 0x3440a ; 0x3440a a556: de cf rjmp .-68 ; 0xa514 a558: 16 fd sbrc r17, 6 a55a: 9f cf rjmp .-194 ; 0xa49a a55c: ef 2d mov r30, r15 a55e: f0 e0 ldi r31, 0x00 ; 0 a560: ea 15 cp r30, r10 a562: fb 05 cpc r31, r11 a564: 34 f0 brlt .+12 ; 0xa572 a566: 3c ef ldi r19, 0xFC ; 252 a568: a3 16 cp r10, r19 a56a: 3f ef ldi r19, 0xFF ; 255 a56c: b3 06 cpc r11, r19 a56e: 0c f0 brlt .+2 ; 0xa572 a570: 10 68 ori r17, 0x80 ; 128 a572: 32 96 adiw r30, 0x02 ; 2 a574: e8 0d add r30, r8 a576: f9 1d adc r31, r9 a578: 01 c0 rjmp .+2 ; 0xa57c a57a: fa 94 dec r15 a57c: ff 20 and r15, r15 a57e: 19 f0 breq .+6 ; 0xa586 a580: 82 91 ld r24, -Z a582: 80 33 cpi r24, 0x30 ; 48 a584: d1 f3 breq .-12 ; 0xa57a a586: 17 ff sbrs r17, 7 a588: 88 cf rjmp .-240 ; 0xa49a a58a: 44 24 eor r4, r4 a58c: 43 94 inc r4 a58e: 4f 0c add r4, r15 a590: fa 14 cp r15, r10 a592: 1b 04 cpc r1, r11 a594: 31 f0 breq .+12 ; 0xa5a2 a596: 2c f0 brlt .+10 ; 0xa5a2 a598: fa 18 sub r15, r10 a59a: 7f cf rjmp .-258 ; 0xa49a a59c: 44 24 eor r4, r4 a59e: 43 94 inc r4 a5a0: 7c cf rjmp .-264 ; 0xa49a a5a2: f1 2c mov r15, r1 a5a4: 7a cf rjmp .-268 ; 0xa49a a5a6: b6 01 movw r22, r12 a5a8: 80 e2 ldi r24, 0x20 ; 32 a5aa: 90 e0 ldi r25, 0x00 ; 0 a5ac: 0f 94 05 a2 call 0x3440a ; 0x3440a a5b0: ea 94 dec r14 a5b2: 90 cf rjmp .-224 ; 0xa4d4 a5b4: b6 01 movw r22, r12 a5b6: 80 e3 ldi r24, 0x30 ; 48 a5b8: 90 e0 ldi r25, 0x00 ; 0 a5ba: 0f 94 05 a2 call 0x3440a ; 0x3440a a5be: ea 94 dec r14 a5c0: 94 cf rjmp .-216 ; 0xa4ea a5c2: 80 e3 ldi r24, 0x30 ; 48 a5c4: bd cf rjmp .-134 ; 0xa540 a5c6: a0 16 cp r10, r16 a5c8: b1 06 cpc r11, r17 a5ca: 41 f4 brne .+16 ; 0xa5dc a5cc: 9a 81 ldd r25, Y+2 ; 0x02 a5ce: 96 33 cpi r25, 0x36 ; 54 a5d0: 50 f4 brcc .+20 ; 0xa5e6 a5d2: 95 33 cpi r25, 0x35 ; 53 a5d4: 19 f4 brne .+6 ; 0xa5dc a5d6: 3c 85 ldd r19, Y+12 ; 0x0c a5d8: 34 ff sbrs r19, 4 a5da: 05 c0 rjmp .+10 ; 0xa5e6 a5dc: b6 01 movw r22, r12 a5de: 90 e0 ldi r25, 0x00 ; 0 a5e0: 0f 94 05 a2 call 0x3440a ; 0x3440a a5e4: 2a cf rjmp .-428 ; 0xa43a a5e6: 81 e3 ldi r24, 0x31 ; 49 a5e8: f9 cf rjmp .-14 ; 0xa5dc a5ea: 8a 81 ldd r24, Y+2 ; 0x02 a5ec: 81 33 cpi r24, 0x31 ; 49 a5ee: 19 f0 breq .+6 ; 0xa5f6 a5f0: 9c 85 ldd r25, Y+12 ; 0x0c a5f2: 9f 7e andi r25, 0xEF ; 239 a5f4: 9c 87 std Y+12, r25 ; 0x0c a5f6: b6 01 movw r22, r12 a5f8: 90 e0 ldi r25, 0x00 ; 0 a5fa: 0f 94 05 a2 call 0x3440a ; 0x3440a a5fe: ff 20 and r15, r15 a600: a9 f0 breq .+42 ; 0xa62c a602: b6 01 movw r22, r12 a604: 8e e2 ldi r24, 0x2E ; 46 a606: 90 e0 ldi r25, 0x00 ; 0 a608: 0f 94 05 a2 call 0x3440a ; 0x3440a a60c: f3 94 inc r15 a60e: f3 94 inc r15 a610: e2 e0 ldi r30, 0x02 ; 2 a612: 01 e0 ldi r16, 0x01 ; 1 a614: 0e 0f add r16, r30 a616: e8 0d add r30, r8 a618: f9 2d mov r31, r9 a61a: f1 1d adc r31, r1 a61c: 80 81 ld r24, Z a61e: b6 01 movw r22, r12 a620: 90 e0 ldi r25, 0x00 ; 0 a622: 0f 94 05 a2 call 0x3440a ; 0x3440a a626: e0 2f mov r30, r16 a628: 0f 11 cpse r16, r15 a62a: f3 cf rjmp .-26 ; 0xa612 a62c: 85 e6 ldi r24, 0x65 ; 101 a62e: 90 e0 ldi r25, 0x00 ; 0 a630: 14 ff sbrs r17, 4 a632: 02 c0 rjmp .+4 ; 0xa638 a634: 85 e4 ldi r24, 0x45 ; 69 a636: 90 e0 ldi r25, 0x00 ; 0 a638: b6 01 movw r22, r12 a63a: 0f 94 05 a2 call 0x3440a ; 0x3440a a63e: b7 fc sbrc r11, 7 a640: 06 c0 rjmp .+12 ; 0xa64e a642: a1 14 cp r10, r1 a644: b1 04 cpc r11, r1 a646: c1 f4 brne .+48 ; 0xa678 a648: ec 85 ldd r30, Y+12 ; 0x0c a64a: e4 ff sbrs r30, 4 a64c: 15 c0 rjmp .+42 ; 0xa678 a64e: b1 94 neg r11 a650: a1 94 neg r10 a652: b1 08 sbc r11, r1 a654: 8d e2 ldi r24, 0x2D ; 45 a656: b6 01 movw r22, r12 a658: 90 e0 ldi r25, 0x00 ; 0 a65a: 0f 94 05 a2 call 0x3440a ; 0x3440a a65e: 80 e3 ldi r24, 0x30 ; 48 a660: 2a e0 ldi r18, 0x0A ; 10 a662: a2 16 cp r10, r18 a664: b1 04 cpc r11, r1 a666: 54 f4 brge .+20 ; 0xa67c a668: b6 01 movw r22, r12 a66a: 90 e0 ldi r25, 0x00 ; 0 a66c: 0f 94 05 a2 call 0x3440a ; 0x3440a a670: b6 01 movw r22, r12 a672: c5 01 movw r24, r10 a674: c0 96 adiw r24, 0x30 ; 48 a676: b4 cf rjmp .-152 ; 0xa5e0 a678: 8b e2 ldi r24, 0x2B ; 43 a67a: ed cf rjmp .-38 ; 0xa656 a67c: 8f 5f subi r24, 0xFF ; 255 a67e: fa e0 ldi r31, 0x0A ; 10 a680: af 1a sub r10, r31 a682: b1 08 sbc r11, r1 a684: ed cf rjmp .-38 ; 0xa660 a686: 83 36 cpi r24, 0x63 ; 99 a688: c9 f0 breq .+50 ; 0xa6bc a68a: 83 37 cpi r24, 0x73 ; 115 a68c: 71 f1 breq .+92 ; 0xa6ea a68e: 83 35 cpi r24, 0x53 ; 83 a690: 09 f0 breq .+2 ; 0xa694 a692: 5b c0 rjmp .+182 ; 0xa74a a694: 35 01 movw r6, r10 a696: f2 e0 ldi r31, 0x02 ; 2 a698: 6f 0e add r6, r31 a69a: 71 1c adc r7, r1 a69c: f5 01 movw r30, r10 a69e: a0 80 ld r10, Z a6a0: b1 80 ldd r11, Z+1 ; 0x01 a6a2: 6f 2d mov r22, r15 a6a4: 70 e0 ldi r23, 0x00 ; 0 a6a6: 06 fd sbrc r16, 6 a6a8: 02 c0 rjmp .+4 ; 0xa6ae a6aa: 6f ef ldi r22, 0xFF ; 255 a6ac: 7f ef ldi r23, 0xFF ; 255 a6ae: c5 01 movw r24, r10 a6b0: 0f 94 99 a1 call 0x34332 ; 0x34332 a6b4: 9d 87 std Y+13, r25 ; 0x0d a6b6: 8c 87 std Y+12, r24 ; 0x0c a6b8: 00 68 ori r16, 0x80 ; 128 a6ba: 0d c0 rjmp .+26 ; 0xa6d6 a6bc: 35 01 movw r6, r10 a6be: 32 e0 ldi r19, 0x02 ; 2 a6c0: 63 0e add r6, r19 a6c2: 71 1c adc r7, r1 a6c4: f5 01 movw r30, r10 a6c6: 80 81 ld r24, Z a6c8: 89 83 std Y+1, r24 ; 0x01 a6ca: 21 e0 ldi r18, 0x01 ; 1 a6cc: 30 e0 ldi r19, 0x00 ; 0 a6ce: 3d 87 std Y+13, r19 ; 0x0d a6d0: 2c 87 std Y+12, r18 ; 0x0c a6d2: 54 01 movw r10, r8 a6d4: 0f 77 andi r16, 0x7F ; 127 a6d6: 03 fd sbrc r16, 3 a6d8: 06 c0 rjmp .+12 ; 0xa6e6 a6da: 2c 85 ldd r18, Y+12 ; 0x0c a6dc: 3d 85 ldd r19, Y+13 ; 0x0d a6de: 52 16 cp r5, r18 a6e0: 13 06 cpc r1, r19 a6e2: 09 f0 breq .+2 ; 0xa6e6 a6e4: a8 f4 brcc .+42 ; 0xa710 a6e6: e5 2c mov r14, r5 a6e8: 2b c0 rjmp .+86 ; 0xa740 a6ea: 35 01 movw r6, r10 a6ec: 32 e0 ldi r19, 0x02 ; 2 a6ee: 63 0e add r6, r19 a6f0: 71 1c adc r7, r1 a6f2: f5 01 movw r30, r10 a6f4: a0 80 ld r10, Z a6f6: b1 80 ldd r11, Z+1 ; 0x01 a6f8: 6f 2d mov r22, r15 a6fa: 70 e0 ldi r23, 0x00 ; 0 a6fc: 06 fd sbrc r16, 6 a6fe: 02 c0 rjmp .+4 ; 0xa704 a700: 6f ef ldi r22, 0xFF ; 255 a702: 7f ef ldi r23, 0xFF ; 255 a704: c5 01 movw r24, r10 a706: 0f 94 be a1 call 0x3437c ; 0x3437c a70a: 9d 87 std Y+13, r25 ; 0x0d a70c: 8c 87 std Y+12, r24 ; 0x0c a70e: e2 cf rjmp .-60 ; 0xa6d4 a710: b6 01 movw r22, r12 a712: 80 e2 ldi r24, 0x20 ; 32 a714: 90 e0 ldi r25, 0x00 ; 0 a716: 0f 94 05 a2 call 0x3440a ; 0x3440a a71a: 5a 94 dec r5 a71c: de cf rjmp .-68 ; 0xa6da a71e: f5 01 movw r30, r10 a720: 07 fd sbrc r16, 7 a722: 85 91 lpm r24, Z+ a724: 07 ff sbrs r16, 7 a726: 81 91 ld r24, Z+ a728: 5f 01 movw r10, r30 a72a: b6 01 movw r22, r12 a72c: 90 e0 ldi r25, 0x00 ; 0 a72e: 0f 94 05 a2 call 0x3440a ; 0x3440a a732: e1 10 cpse r14, r1 a734: ea 94 dec r14 a736: 8c 85 ldd r24, Y+12 ; 0x0c a738: 9d 85 ldd r25, Y+13 ; 0x0d a73a: 01 97 sbiw r24, 0x01 ; 1 a73c: 9d 87 std Y+13, r25 ; 0x0d a73e: 8c 87 std Y+12, r24 ; 0x0c a740: ec 85 ldd r30, Y+12 ; 0x0c a742: fd 85 ldd r31, Y+13 ; 0x0d a744: ef 2b or r30, r31 a746: 59 f7 brne .-42 ; 0xa71e a748: 78 ce rjmp .-784 ; 0xa43a a74a: 84 36 cpi r24, 0x64 ; 100 a74c: 19 f0 breq .+6 ; 0xa754 a74e: 89 36 cpi r24, 0x69 ; 105 a750: 09 f0 breq .+2 ; 0xa754 a752: 74 c0 rjmp .+232 ; 0xa83c a754: 35 01 movw r6, r10 a756: 07 ff sbrs r16, 7 a758: 66 c0 rjmp .+204 ; 0xa826 a75a: f4 e0 ldi r31, 0x04 ; 4 a75c: 6f 0e add r6, r31 a75e: 71 1c adc r7, r1 a760: f5 01 movw r30, r10 a762: 60 81 ld r22, Z a764: 71 81 ldd r23, Z+1 ; 0x01 a766: 82 81 ldd r24, Z+2 ; 0x02 a768: 93 81 ldd r25, Z+3 ; 0x03 a76a: 10 2f mov r17, r16 a76c: 1f 76 andi r17, 0x6F ; 111 a76e: 97 ff sbrs r25, 7 a770: 08 c0 rjmp .+16 ; 0xa782 a772: 90 95 com r25 a774: 80 95 com r24 a776: 70 95 com r23 a778: 61 95 neg r22 a77a: 7f 4f sbci r23, 0xFF ; 255 a77c: 8f 4f sbci r24, 0xFF ; 255 a77e: 9f 4f sbci r25, 0xFF ; 255 a780: 10 68 ori r17, 0x80 ; 128 a782: 2a e0 ldi r18, 0x0A ; 10 a784: 30 e0 ldi r19, 0x00 ; 0 a786: a4 01 movw r20, r8 a788: 0f 94 2c a3 call 0x34658 ; 0x34658 <__ultoa_invert> a78c: a8 2e mov r10, r24 a78e: a8 18 sub r10, r8 a790: ba 2c mov r11, r10 a792: 01 2f mov r16, r17 a794: 16 ff sbrs r17, 6 a796: 0a c0 rjmp .+20 ; 0xa7ac a798: 0e 7f andi r16, 0xFE ; 254 a79a: af 14 cp r10, r15 a79c: 38 f4 brcc .+14 ; 0xa7ac a79e: 14 ff sbrs r17, 4 a7a0: 04 c0 rjmp .+8 ; 0xa7aa a7a2: 12 fd sbrc r17, 2 a7a4: 02 c0 rjmp .+4 ; 0xa7aa a7a6: 01 2f mov r16, r17 a7a8: 0e 7e andi r16, 0xEE ; 238 a7aa: bf 2c mov r11, r15 a7ac: 04 ff sbrs r16, 4 a7ae: a3 c0 rjmp .+326 ; 0xa8f6 a7b0: fe 01 movw r30, r28 a7b2: ea 0d add r30, r10 a7b4: f1 1d adc r31, r1 a7b6: 80 81 ld r24, Z a7b8: 80 33 cpi r24, 0x30 ; 48 a7ba: 09 f0 breq .+2 ; 0xa7be a7bc: 95 c0 rjmp .+298 ; 0xa8e8 a7be: 09 7e andi r16, 0xE9 ; 233 a7c0: f0 2f mov r31, r16 a7c2: f8 70 andi r31, 0x08 ; 8 a7c4: ef 2e mov r14, r31 a7c6: 03 fd sbrc r16, 3 a7c8: a5 c0 rjmp .+330 ; 0xa914 a7ca: 00 ff sbrs r16, 0 a7cc: 9f c0 rjmp .+318 ; 0xa90c a7ce: fa 2c mov r15, r10 a7d0: b5 14 cp r11, r5 a7d2: 10 f4 brcc .+4 ; 0xa7d8 a7d4: f5 0c add r15, r5 a7d6: fb 18 sub r15, r11 a7d8: 04 ff sbrs r16, 4 a7da: a2 c0 rjmp .+324 ; 0xa920 a7dc: b6 01 movw r22, r12 a7de: 80 e3 ldi r24, 0x30 ; 48 a7e0: 90 e0 ldi r25, 0x00 ; 0 a7e2: 0f 94 05 a2 call 0x3440a ; 0x3440a a7e6: 02 ff sbrs r16, 2 a7e8: 09 c0 rjmp .+18 ; 0xa7fc a7ea: 88 e7 ldi r24, 0x78 ; 120 a7ec: 90 e0 ldi r25, 0x00 ; 0 a7ee: 01 ff sbrs r16, 1 a7f0: 02 c0 rjmp .+4 ; 0xa7f6 a7f2: 88 e5 ldi r24, 0x58 ; 88 a7f4: 90 e0 ldi r25, 0x00 ; 0 a7f6: b6 01 movw r22, r12 a7f8: 0f 94 05 a2 call 0x3440a ; 0x3440a a7fc: af 14 cp r10, r15 a7fe: 08 f4 brcc .+2 ; 0xa802 a800: 9b c0 rjmp .+310 ; 0xa938 a802: aa 94 dec r10 a804: 0a 2d mov r16, r10 a806: 10 e0 ldi r17, 0x00 ; 0 a808: 0f 5f subi r16, 0xFF ; 255 a80a: 1f 4f sbci r17, 0xFF ; 255 a80c: 08 0d add r16, r8 a80e: 19 1d adc r17, r9 a810: f8 01 movw r30, r16 a812: 82 91 ld r24, -Z a814: 8f 01 movw r16, r30 a816: b6 01 movw r22, r12 a818: 90 e0 ldi r25, 0x00 ; 0 a81a: 0f 94 05 a2 call 0x3440a ; 0x3440a a81e: 80 16 cp r8, r16 a820: 91 06 cpc r9, r17 a822: b1 f7 brne .-20 ; 0xa810 a824: 0a ce rjmp .-1004 ; 0xa43a a826: f2 e0 ldi r31, 0x02 ; 2 a828: 6f 0e add r6, r31 a82a: 71 1c adc r7, r1 a82c: f5 01 movw r30, r10 a82e: 60 81 ld r22, Z a830: 71 81 ldd r23, Z+1 ; 0x01 a832: 07 2e mov r0, r23 a834: 00 0c add r0, r0 a836: 88 0b sbc r24, r24 a838: 99 0b sbc r25, r25 a83a: 97 cf rjmp .-210 ; 0xa76a a83c: 10 2f mov r17, r16 a83e: 85 37 cpi r24, 0x75 ; 117 a840: a9 f4 brne .+42 ; 0xa86c a842: 1f 7e andi r17, 0xEF ; 239 a844: 2a e0 ldi r18, 0x0A ; 10 a846: 30 e0 ldi r19, 0x00 ; 0 a848: 35 01 movw r6, r10 a84a: 17 ff sbrs r17, 7 a84c: 44 c0 rjmp .+136 ; 0xa8d6 a84e: f4 e0 ldi r31, 0x04 ; 4 a850: 6f 0e add r6, r31 a852: 71 1c adc r7, r1 a854: f5 01 movw r30, r10 a856: 60 81 ld r22, Z a858: 71 81 ldd r23, Z+1 ; 0x01 a85a: 82 81 ldd r24, Z+2 ; 0x02 a85c: 93 81 ldd r25, Z+3 ; 0x03 a85e: a4 01 movw r20, r8 a860: 0f 94 2c a3 call 0x34658 ; 0x34658 <__ultoa_invert> a864: a8 2e mov r10, r24 a866: a8 18 sub r10, r8 a868: 1f 77 andi r17, 0x7F ; 127 a86a: 92 cf rjmp .-220 ; 0xa790 a86c: 19 7f andi r17, 0xF9 ; 249 a86e: 8f 36 cpi r24, 0x6F ; 111 a870: 79 f1 breq .+94 ; 0xa8d0 a872: f0 f4 brcc .+60 ; 0xa8b0 a874: 88 35 cpi r24, 0x58 ; 88 a876: 39 f1 breq .+78 ; 0xa8c6 a878: f6 01 movw r30, r12 a87a: 86 81 ldd r24, Z+6 ; 0x06 a87c: 97 81 ldd r25, Z+7 ; 0x07 a87e: 2f 96 adiw r28, 0x0f ; 15 a880: 0f b6 in r0, 0x3f ; 63 a882: f8 94 cli a884: de bf out 0x3e, r29 ; 62 a886: 0f be out 0x3f, r0 ; 63 a888: cd bf out 0x3d, r28 ; 61 a88a: df 91 pop r29 a88c: cf 91 pop r28 a88e: 1f 91 pop r17 a890: 0f 91 pop r16 a892: ff 90 pop r15 a894: ef 90 pop r14 a896: df 90 pop r13 a898: cf 90 pop r12 a89a: bf 90 pop r11 a89c: af 90 pop r10 a89e: 9f 90 pop r9 a8a0: 8f 90 pop r8 a8a2: 7f 90 pop r7 a8a4: 6f 90 pop r6 a8a6: 5f 90 pop r5 a8a8: 4f 90 pop r4 a8aa: 3f 90 pop r3 a8ac: 2f 90 pop r2 a8ae: 08 95 ret a8b0: 80 37 cpi r24, 0x70 ; 112 a8b2: 39 f0 breq .+14 ; 0xa8c2 a8b4: 88 37 cpi r24, 0x78 ; 120 a8b6: 01 f7 brne .-64 ; 0xa878 a8b8: 14 fd sbrc r17, 4 a8ba: 14 60 ori r17, 0x04 ; 4 a8bc: 20 e1 ldi r18, 0x10 ; 16 a8be: 30 e0 ldi r19, 0x00 ; 0 a8c0: c3 cf rjmp .-122 ; 0xa848 a8c2: 10 61 ori r17, 0x10 ; 16 a8c4: f9 cf rjmp .-14 ; 0xa8b8 a8c6: 04 fd sbrc r16, 4 a8c8: 16 60 ori r17, 0x06 ; 6 a8ca: 20 e1 ldi r18, 0x10 ; 16 a8cc: 32 e0 ldi r19, 0x02 ; 2 a8ce: bc cf rjmp .-136 ; 0xa848 a8d0: 28 e0 ldi r18, 0x08 ; 8 a8d2: 30 e0 ldi r19, 0x00 ; 0 a8d4: b9 cf rjmp .-142 ; 0xa848 a8d6: f2 e0 ldi r31, 0x02 ; 2 a8d8: 6f 0e add r6, r31 a8da: 71 1c adc r7, r1 a8dc: f5 01 movw r30, r10 a8de: 60 81 ld r22, Z a8e0: 71 81 ldd r23, Z+1 ; 0x01 a8e2: 90 e0 ldi r25, 0x00 ; 0 a8e4: 80 e0 ldi r24, 0x00 ; 0 a8e6: bb cf rjmp .-138 ; 0xa85e a8e8: 02 fd sbrc r16, 2 a8ea: 02 c0 rjmp .+4 ; 0xa8f0 a8ec: b3 94 inc r11 a8ee: 68 cf rjmp .-304 ; 0xa7c0 a8f0: b3 94 inc r11 a8f2: b3 94 inc r11 a8f4: 65 cf rjmp .-310 ; 0xa7c0 a8f6: 80 2f mov r24, r16 a8f8: 86 78 andi r24, 0x86 ; 134 a8fa: 09 f4 brne .+2 ; 0xa8fe a8fc: 61 cf rjmp .-318 ; 0xa7c0 a8fe: f6 cf rjmp .-20 ; 0xa8ec a900: b6 01 movw r22, r12 a902: 80 e2 ldi r24, 0x20 ; 32 a904: 90 e0 ldi r25, 0x00 ; 0 a906: 0f 94 05 a2 call 0x3440a ; 0x3440a a90a: b3 94 inc r11 a90c: b5 14 cp r11, r5 a90e: c0 f3 brcs .-16 ; 0xa900 a910: e1 2c mov r14, r1 a912: 62 cf rjmp .-316 ; 0xa7d8 a914: e5 2c mov r14, r5 a916: eb 18 sub r14, r11 a918: b5 14 cp r11, r5 a91a: 08 f4 brcc .+2 ; 0xa91e a91c: 5d cf rjmp .-326 ; 0xa7d8 a91e: f8 cf rjmp .-16 ; 0xa910 a920: 80 2f mov r24, r16 a922: 86 78 andi r24, 0x86 ; 134 a924: 09 f4 brne .+2 ; 0xa928 a926: 6a cf rjmp .-300 ; 0xa7fc a928: 8b e2 ldi r24, 0x2B ; 43 a92a: 01 ff sbrs r16, 1 a92c: 80 e2 ldi r24, 0x20 ; 32 a92e: 07 fd sbrc r16, 7 a930: 8d e2 ldi r24, 0x2D ; 45 a932: b6 01 movw r22, r12 a934: 90 e0 ldi r25, 0x00 ; 0 a936: 60 cf rjmp .-320 ; 0xa7f8 a938: b6 01 movw r22, r12 a93a: 80 e3 ldi r24, 0x30 ; 48 a93c: 90 e0 ldi r25, 0x00 ; 0 a93e: 0f 94 05 a2 call 0x3440a ; 0x3440a a942: fa 94 dec r15 a944: 5b cf rjmp .-330 ; 0xa7fc a946: b6 01 movw r22, r12 a948: 80 e2 ldi r24, 0x20 ; 32 a94a: 90 e0 ldi r25, 0x00 ; 0 a94c: 0f 94 05 a2 call 0x3440a ; 0x3440a a950: ea 94 dec r14 a952: 73 cd rjmp .-1306 ; 0xa43a a954: 24 e0 ldi r18, 0x04 ; 4 a956: e1 2c mov r14, r1 a958: 25 15 cp r18, r5 a95a: 08 f0 brcs .+2 ; 0xa95e a95c: 36 cd rjmp .-1428 ; 0xa3ca a95e: 84 e0 ldi r24, 0x04 ; 4 a960: 26 cd rjmp .-1460 ; 0xa3ae 0000a962 : 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 ( a962: 20 e0 ldi r18, 0x00 ; 0 a964: 30 e0 ldi r19, 0x00 ; 0 a966: 40 e8 ldi r20, 0x80 ; 128 a968: 5f eb ldi r21, 0xBF ; 191 a96a: 60 91 7e 02 lds r22, 0x027E ; 0x80027e a96e: 70 91 7f 02 lds r23, 0x027F ; 0x80027f a972: 80 91 80 02 lds r24, 0x0280 ; 0x800280 a976: 90 91 81 02 lds r25, 0x0281 ; 0x800281 a97a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> a97e: 88 23 and r24, r24 a980: 21 f1 breq .+72 ; 0xa9ca (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || a982: e0 91 38 12 lds r30, 0x1238 ; 0x801238 a986: f0 91 39 12 lds r31, 0x1239 ; 0x801239 a98a: e5 5b subi r30, 0xB5 ; 181 a98c: 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) && ( a98e: 80 81 ld r24, Z a990: 8b 7f andi r24, 0xFB ; 251 a992: 82 30 cpi r24, 0x02 ; 2 a994: d1 f4 brne .+52 ; 0xa9ca (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)); a996: 80 e1 ldi r24, 0x10 ; 16 a998: ee e7 ldi r30, 0x7E ; 126 a99a: f2 e0 ldi r31, 0x02 ; 2 a99c: a1 e6 ldi r26, 0x61 ; 97 a99e: b2 e1 ldi r27, 0x12 ; 18 a9a0: 01 90 ld r0, Z+ a9a2: 0d 92 st X+, r0 a9a4: 8a 95 dec r24 a9a6: e1 f7 brne .-8 ; 0xa9a0 saved_start_position[0] = SAVED_START_POSITION_UNSET; a9a8: 80 e0 ldi r24, 0x00 ; 0 a9aa: 90 e0 ldi r25, 0x00 ; 0 a9ac: a0 e8 ldi r26, 0x80 ; 128 a9ae: bf eb ldi r27, 0xBF ; 191 a9b0: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e a9b4: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f a9b8: a0 93 80 02 sts 0x0280, r26 ; 0x800280 a9bc: b0 93 81 02 sts 0x0281, r27 ; 0x800281 return saved_segment_idx; a9c0: 80 91 4d 12 lds r24, 0x124D ; 0x80124d a9c4: 90 91 4e 12 lds r25, 0x124E ; 0x80124e a9c8: 08 95 ret } else return 1; //begin with the first segment a9ca: 81 e0 ldi r24, 0x01 ; 1 a9cc: 90 e0 ldi r25, 0x00 ; 0 } a9ce: 08 95 ret 0000a9d0 : 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)); } a9d0: 80 e1 ldi r24, 0x10 ; 16 a9d2: e9 e2 ldi r30, 0x29 ; 41 a9d4: f6 e0 ldi r31, 0x06 ; 6 a9d6: a1 e6 ldi r26, 0x61 ; 97 a9d8: b2 e1 ldi r27, 0x12 ; 18 a9da: 01 90 ld r0, Z+ a9dc: 0d 92 st X+, r0 a9de: 8a 95 dec r24 a9e0: e1 f7 brne .-8 ; 0xa9da a9e2: 08 95 ret 0000a9e4 : /// @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)); a9e4: e0 e5 ldi r30, 0x50 ; 80 a9e6: f6 e7 ldi r31, 0x76 ; 118 a9e8: 83 30 cpi r24, 0x03 ; 3 a9ea: 21 f0 breq .+8 ; 0xa9f4 a9ec: e8 2f mov r30, r24 a9ee: f0 e0 ldi r31, 0x00 ; 0 a9f0: e3 5b subi r30, 0xB3 ; 179 a9f2: f9 48 sbci r31, 0x89 ; 137 a9f4: 84 91 lpm r24, Z } a9f6: 08 95 ret 0000a9f8 : 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; a9f8: 80 91 42 05 lds r24, 0x0542 ; 0x800542 a9fc: 90 91 43 05 lds r25, 0x0543 ; 0x800543 aa00: 20 91 44 05 lds r18, 0x0544 ; 0x800544 aa04: 30 91 45 05 lds r19, 0x0545 ; 0x800545 aa08: 82 1b sub r24, r18 aa0a: 93 0b sbc r25, r19 } aa0c: 8f 77 andi r24, 0x7F ; 127 aa0e: 99 27 eor r25, r25 aa10: 08 95 ret 0000aa12 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; aa12: 98 2f mov r25, r24 aa14: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); aa16: 83 ff sbrs r24, 3 aa18: 0d c0 rjmp .+26 ; 0xaa34 aa1a: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> aa1e: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); aa20: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); aa24: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> aa28: 88 7f andi r24, 0xF8 ; 248 aa2a: 97 70 andi r25, 0x07 ; 7 aa2c: 89 2b or r24, r25 aa2e: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } aa32: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); aa34: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> aa38: 87 7f andi r24, 0xF7 ; 247 aa3a: f2 cf rjmp .-28 ; 0xaa20 0000aa3c : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); aa3c: 4f ef ldi r20, 0xFF ; 255 aa3e: 5f ef ldi r21, 0xFF ; 255 aa40: ba 01 movw r22, r20 aa42: 85 ee ldi r24, 0xE5 ; 229 aa44: 9f e0 ldi r25, 0x0F ; 15 aa46: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aa4a: 4f ef ldi r20, 0xFF ; 255 aa4c: 5f ef ldi r21, 0xFF ; 255 aa4e: ba 01 movw r22, r20 aa50: 89 ee ldi r24, 0xE9 ; 233 aa52: 9f e0 ldi r25, 0x0F ; 15 aa54: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aa58: 4f ef ldi r20, 0xFF ; 255 aa5a: 5f ef ldi r21, 0xFF ; 255 aa5c: ba 01 movw r22, r20 aa5e: 8d ed ldi r24, 0xDD ; 221 aa60: 9f e0 ldi r25, 0x0F ; 15 aa62: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aa66: 4f ef ldi r20, 0xFF ; 255 aa68: 5f ef ldi r21, 0xFF ; 255 aa6a: ba 01 movw r22, r20 aa6c: 81 ee ldi r24, 0xE1 ; 225 aa6e: 9f e0 ldi r25, 0x0F ; 15 aa70: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aa74: 4f ef ldi r20, 0xFF ; 255 aa76: 5f ef ldi r21, 0xFF ; 255 aa78: ba 01 movw r22, r20 aa7a: 85 ed ldi r24, 0xD5 ; 213 aa7c: 9f e0 ldi r25, 0x0F ; 15 aa7e: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aa82: 4f ef ldi r20, 0xFF ; 255 aa84: 5f ef ldi r21, 0xFF ; 255 aa86: ba 01 movw r22, r20 aa88: 89 ed ldi r24, 0xD9 ; 217 aa8a: 9f e0 ldi r25, 0x0F ; 15 aa8c: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aa90: 4f ef ldi r20, 0xFF ; 255 aa92: 5f ef ldi r21, 0xFF ; 255 aa94: ba 01 movw r22, r20 aa96: 85 ec ldi r24, 0xC5 ; 197 aa98: 9f e0 ldi r25, 0x0F ; 15 aa9a: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aa9e: 4f ef ldi r20, 0xFF ; 255 aaa0: 5f ef ldi r21, 0xFF ; 255 aaa2: ba 01 movw r22, r20 aaa4: 89 ec ldi r24, 0xC9 ; 201 aaa6: 9f e0 ldi r25, 0x0F ; 15 aaa8: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aaac: 4f ef ldi r20, 0xFF ; 255 aaae: 5f ef ldi r21, 0xFF ; 255 aab0: ba 01 movw r22, r20 aab2: 8d ec ldi r24, 0xCD ; 205 aab4: 9f e0 ldi r25, 0x0F ; 15 aab6: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 aaba: 4f ef ldi r20, 0xFF ; 255 aabc: 5f ef ldi r21, 0xFF ; 255 aabe: ba 01 movw r22, r20 aac0: 81 ed ldi r24, 0xD1 ; 209 aac2: 9f e0 ldi r25, 0x0F ; 15 aac4: 0d 94 d3 a3 jmp 0x347a6 ; 0x347a6 0000aac8 : // 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) aac8: 80 36 cpi r24, 0x60 ; 96 aaca: 91 05 cpc r25, r1 aacc: f8 f4 brcc .+62 ; 0xab0c return false; if (bufindr == bufindw && buflen > 0) aace: 40 91 38 12 lds r20, 0x1238 ; 0x801238 aad2: 50 91 39 12 lds r21, 0x1239 ; 0x801239 aad6: 20 91 49 10 lds r18, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> aada: 30 91 4a 10 lds r19, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> aade: 42 17 cp r20, r18 aae0: 53 07 cpc r21, r19 aae2: 39 f4 brne .+14 ; 0xaaf2 aae4: 60 91 3c 12 lds r22, 0x123C ; 0x80123c aae8: 70 91 3d 12 lds r23, 0x123D ; 0x80123d aaec: 16 16 cp r1, r22 aaee: 17 06 cpc r1, r23 aaf0: 6c f0 brlt .+26 ; 0xab0c // 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); aaf2: b9 01 movw r22, r18 aaf4: 68 0f add r22, r24 aaf6: 79 1f adc r23, r25 aaf8: fb 01 movw r30, r22 aafa: e3 59 subi r30, 0x93 ; 147 aafc: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) aafe: 24 17 cp r18, r20 ab00: 35 07 cpc r19, r21 ab02: 30 f4 brcc .+12 ; 0xab10 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; ab04: 81 e0 ldi r24, 0x01 ; 1 ab06: 4e 17 cp r20, r30 ab08: 5f 07 cpc r21, r31 ab0a: 08 f4 brcc .+2 ; 0xab0e // 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; ab0c: 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; } ab0e: 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? ab10: ee 3e cpi r30, 0xEE ; 238 ab12: f1 40 sbci r31, 0x01 ; 1 ab14: f8 f0 brcs .+62 ; 0xab54 // 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); ab16: 6c 5f subi r22, 0xFC ; 252 ab18: 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) || ab1a: 6e 3e cpi r22, 0xEE ; 238 ab1c: 71 40 sbci r23, 0x01 ; 1 ab1e: 18 f4 brcc .+6 ; 0xab26 // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) ab20: 49 36 cpi r20, 0x69 ; 105 ab22: 51 05 cpc r21, r1 ab24: b8 f4 brcc .+46 ; 0xab54 return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { ab26: 83 59 subi r24, 0x93 ; 147 ab28: 9f 4f sbci r25, 0xFF ; 255 ab2a: 48 17 cp r20, r24 ab2c: 59 07 cpc r21, r25 ab2e: 70 f3 brcs .-36 ; 0xab0c // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); ab30: 4d ee ldi r20, 0xED ; 237 ab32: 51 e0 ldi r21, 0x01 ; 1 ab34: 42 1b sub r20, r18 ab36: 53 0b sbc r21, r19 ab38: 70 e0 ldi r23, 0x00 ; 0 ab3a: 60 e0 ldi r22, 0x00 ; 0 ab3c: c9 01 movw r24, r18 ab3e: 85 5b subi r24, 0xB5 ; 181 ab40: 9f 4e sbci r25, 0xEF ; 239 ab42: 0f 94 cf a9 call 0x3539e ; 0x3539e // 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; } ab46: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); ab48: f8 94 cli ab4a: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> ab4e: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.514> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; ab52: 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; ab54: 81 e0 ldi r24, 0x01 ; 1 ab56: 08 95 ret 0000ab58 : // 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; ab58: 80 91 44 05 lds r24, 0x0544 ; 0x800544 ab5c: 90 91 45 05 lds r25, 0x0545 ; 0x800545 ab60: 90 93 43 05 sts 0x0543, r25 ; 0x800543 ab64: 80 93 42 05 sts 0x0542, r24 ; 0x800542 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); ab68: 8c ee ldi r24, 0xEC ; 236 ab6a: 99 e6 ldi r25, 0x69 ; 105 ab6c: 9f 93 push r25 ab6e: 8f 93 push r24 ab70: 80 91 3e 12 lds r24, 0x123E ; 0x80123e ab74: 90 91 3f 12 lds r25, 0x123F ; 0x80123f ab78: a0 91 40 12 lds r26, 0x1240 ; 0x801240 ab7c: b0 91 41 12 lds r27, 0x1241 ; 0x801241 ab80: 01 96 adiw r24, 0x01 ; 1 ab82: a1 1d adc r26, r1 ab84: b1 1d adc r27, r1 ab86: bf 93 push r27 ab88: af 93 push r26 ab8a: 9f 93 push r25 ab8c: 8f 93 push r24 ab8e: 8b e4 ldi r24, 0x4B ; 75 ab90: 94 e6 ldi r25, 0x64 ; 100 ab92: 9f 93 push r25 ab94: 8f 93 push r24 ab96: 82 e5 ldi r24, 0x52 ; 82 ab98: 94 e6 ldi r25, 0x64 ; 100 ab9a: 9f 93 push r25 ab9c: 8f 93 push r24 ab9e: 0f 94 5f a2 call 0x344be ; 0x344be aba2: 8d b7 in r24, 0x3d ; 61 aba4: 9e b7 in r25, 0x3e ; 62 aba6: 0a 96 adiw r24, 0x0a ; 10 aba8: 0f b6 in r0, 0x3f ; 63 abaa: f8 94 cli abac: 9e bf out 0x3e, r25 ; 62 abae: 0f be out 0x3f, r0 ; 63 abb0: 8d bf out 0x3d, r24 ; 61 } abb2: 08 95 ret 0000abb4 : 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) { abb4: 0f 93 push r16 abb6: 1f 93 push r17 abb8: cf 93 push r28 abba: df 93 push r29 abbc: ec 01 movw r28, r24 abbe: c6 0f add r28, r22 abc0: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { abc2: 8c 17 cp r24, r28 abc4: 9d 07 cpc r25, r29 abc6: 79 f0 breq .+30 ; 0xabe6 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) abc8: 8c 01 movw r16, r24 abca: 0f 5f subi r16, 0xFF ; 255 abcc: 1f 4f sbci r17, 0xFF ; 255 abce: 0f 94 9d a3 call 0x3473a ; 0x3473a abd2: 8f 3f cpi r24, 0xFF ; 255 abd4: 31 f0 breq .+12 ; 0xabe2 return true; abd6: 81 e0 ldi r24, 0x01 ; 1 } return false; } abd8: df 91 pop r29 abda: cf 91 pop r28 abdc: 1f 91 pop r17 abde: 0f 91 pop r16 abe0: 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) abe2: c8 01 movw r24, r16 abe4: ee cf rjmp .-36 ; 0xabc2 return true; } return false; abe6: 80 e0 ldi r24, 0x00 ; 0 abe8: f7 cf rjmp .-18 ; 0xabd8 0000abea : #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; } abea: 68 2f mov r22, r24 abec: 88 0f add r24, r24 abee: 77 0b sbc r23, r23 abf0: 80 91 38 12 lds r24, 0x1238 ; 0x801238 abf4: 90 91 39 12 lds r25, 0x1239 ; 0x801239 abf8: 82 5b subi r24, 0xB2 ; 178 abfa: 9f 4e sbci r25, 0xEF ; 239 abfc: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 ac00: 9c 01 movw r18, r24 ac02: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc ac06: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb ac0a: 81 e0 ldi r24, 0x01 ; 1 ac0c: 23 2b or r18, r19 ac0e: 09 f4 brne .+2 ; 0xac12 ac10: 80 e0 ldi r24, 0x00 ; 0 ac12: 08 95 ret 0000ac14 : 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)); }; ac14: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb ac18: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc ac1c: 4a e0 ldi r20, 0x0A ; 10 ac1e: 50 e0 ldi r21, 0x00 ; 0 ac20: 70 e0 ldi r23, 0x00 ; 0 ac22: 60 e0 ldi r22, 0x00 ; 0 ac24: 01 96 adiw r24, 0x01 ; 1 ac26: 0f 94 28 9f call 0x33e50 ; 0x33e50 ac2a: 86 2f mov r24, r22 ac2c: 08 95 ret 0000ac2e : // 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)); }; ac2e: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb ac32: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc ac36: 4a e0 ldi r20, 0x0A ; 10 ac38: 50 e0 ldi r21, 0x00 ; 0 ac3a: 70 e0 ldi r23, 0x00 ; 0 ac3c: 60 e0 ldi r22, 0x00 ; 0 ac3e: 01 96 adiw r24, 0x01 ; 1 ac40: 0f 94 28 9f call 0x33e50 ; 0x33e50 ac44: cb 01 movw r24, r22 ac46: 08 95 ret 0000ac48 : #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 { ac48: 0f 93 push r16 ac4a: 1f 93 push r17 ac4c: cf 93 push r28 ac4e: df 93 push r29 ac50: 8c 01 movw r16, r24 ac52: 86 2f mov r24, r22 ac54: ea 01 movw r28, r20 if (code_seen(code)) { ac56: 0e 94 f5 55 call 0xabea ; 0xabea ac5a: 88 23 and r24, r24 ac5c: 19 f1 breq .+70 ; 0xaca4 // Verify value is within allowed range int16_t temp = code_value_short(); ac5e: 0e 94 17 56 call 0xac2e ; 0xac2e if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { ac62: 9c 01 movw r18, r24 ac64: 97 ff sbrs r25, 7 ac66: 03 c0 rjmp .+6 ; 0xac6e ac68: 31 95 neg r19 ac6a: 21 95 neg r18 ac6c: 31 09 sbc r19, r1 ac6e: 25 36 cpi r18, 0x65 ; 101 ac70: 31 05 cpc r19, r1 ac72: 9c f0 brlt .+38 ; 0xac9a printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); ac74: 9f 93 push r25 ac76: 8f 93 push r24 ac78: 81 eb ldi r24, 0xB1 ; 177 ac7a: 91 ea ldi r25, 0xA1 ; 161 ac7c: 9f 93 push r25 ac7e: 8f 93 push r24 ac80: 8d ec ldi r24, 0xCD ; 205 ac82: 96 e7 ldi r25, 0x76 ; 118 ac84: 9f 93 push r25 ac86: 8f 93 push r24 ac88: 0f 94 5f a2 call 0x344be ; 0x344be ac8c: 0f 90 pop r0 ac8e: 0f 90 pop r0 ac90: 0f 90 pop r0 ac92: 0f 90 pop r0 ac94: 0f 90 pop r0 ac96: 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; ac98: 80 e0 ldi r24, 0x00 ; 0 }; ac9a: df 91 pop r29 ac9c: cf 91 pop r28 ac9e: 1f 91 pop r17 aca0: 0f 91 pop r16 aca2: 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) { aca4: f8 01 movw r30, r16 aca6: 80 81 ld r24, Z aca8: 88 23 and r24, r24 acaa: b1 f3 breq .-20 ; 0xac98 return (int8_t)eeprom_read_byte(eep_address); acac: ce 01 movw r24, r28 } return 0; }; acae: df 91 pop r29 acb0: cf 91 pop r28 acb2: 1f 91 pop r17 acb4: 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); acb6: 0d 94 9d a3 jmp 0x3473a ; 0x3473a 0000acba : // 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); } acba: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb acbe: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc acc2: 4a e0 ldi r20, 0x0A ; 10 acc4: 50 e0 ldi r21, 0x00 ; 0 acc6: 70 e0 ldi r23, 0x00 ; 0 acc8: 60 e0 ldi r22, 0x00 ; 0 acca: 01 96 adiw r24, 0x01 ; 1 accc: 0d 94 28 9f jmp 0x33e50 ; 0x33e50 0000acd0 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); acd0: 60 e0 ldi r22, 0x00 ; 0 acd2: 86 e6 ldi r24, 0x66 ; 102 acd4: 9f e0 ldi r25, 0x0F ; 15 acd6: 0f 94 c1 a3 call 0x34782 ; 0x34782 acda: 60 e0 ldi r22, 0x00 ; 0 acdc: 88 e6 ldi r24, 0x68 ; 104 acde: 9f e0 ldi r25, 0x0F ; 15 ace0: 0f 94 c1 a3 call 0x34782 ; 0x34782 ace4: 60 e0 ldi r22, 0x00 ; 0 ace6: 85 e6 ldi r24, 0x65 ; 101 ace8: 9f e0 ldi r25, 0x0F ; 15 acea: 0f 94 c1 a3 call 0x34782 ; 0x34782 acee: 60 e0 ldi r22, 0x00 ; 0 acf0: 84 e6 ldi r24, 0x64 ; 100 acf2: 9f e0 ldi r25, 0x0F ; 15 acf4: 0f 94 c1 a3 call 0x34782 ; 0x34782 acf8: 60 e0 ldi r22, 0x00 ; 0 acfa: 82 ed ldi r24, 0xD2 ; 210 acfc: 9e e0 ldi r25, 0x0E ; 14 acfe: 0f 94 c1 a3 call 0x34782 ; 0x34782 ad02: 60 e0 ldi r22, 0x00 ; 0 ad04: 8f ec ldi r24, 0xCF ; 207 ad06: 9e e0 ldi r25, 0x0E ; 14 ad08: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 0000ad0c : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { ad0c: 2f 92 push r2 ad0e: 3f 92 push r3 ad10: 4f 92 push r4 ad12: 5f 92 push r5 ad14: 6f 92 push r6 ad16: 7f 92 push r7 ad18: 8f 92 push r8 ad1a: 9f 92 push r9 ad1c: af 92 push r10 ad1e: bf 92 push r11 ad20: cf 92 push r12 ad22: df 92 push r13 ad24: ef 92 push r14 ad26: ff 92 push r15 ad28: 0f 93 push r16 ad2a: 1f 93 push r17 ad2c: cf 93 push r28 ad2e: df 93 push r29 ad30: cd b7 in r28, 0x3d ; 61 ad32: de b7 in r29, 0x3e ; 62 ad34: cc 58 subi r28, 0x8C ; 140 ad36: d2 40 sbci r29, 0x02 ; 2 ad38: 0f b6 in r0, 0x3f ; 63 ad3a: f8 94 cli ad3c: de bf out 0x3e, r29 ; 62 ad3e: 0f be out 0x3f, r0 ; 63 ad40: cd bf out 0x3d, r28 ; 61 ad42: cb 58 subi r28, 0x8B ; 139 ad44: dd 4f sbci r29, 0xFD ; 253 ad46: 68 83 st Y, r22 ad48: 79 83 std Y+1, r23 ; 0x01 ad4a: 8a 83 std Y+2, r24 ; 0x02 ad4c: 9b 83 std Y+3, r25 ; 0x03 ad4e: c5 57 subi r28, 0x75 ; 117 ad50: 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; ad52: fe 01 movw r30, r28 ad54: e7 54 subi r30, 0x47 ; 71 ad56: fe 4f sbci r31, 0xFE ; 254 ad58: 88 e2 ldi r24, 0x28 ; 40 ad5a: df 01 movw r26, r30 ad5c: 1d 92 st X+, r1 ad5e: 8a 95 dec r24 ad60: e9 f7 brne .-6 ; 0xad5c ad62: e8 5b subi r30, 0xB8 ; 184 ad64: f1 40 sbci r31, 0x01 ; 1 ad66: 1f 01 movw r2, r30 ad68: 80 e9 ldi r24, 0x90 ; 144 ad6a: 91 e0 ldi r25, 0x01 ; 1 ad6c: df 01 movw r26, r30 ad6e: fc 01 movw r30, r24 ad70: 1d 92 st X+, r1 ad72: 31 97 sbiw r30, 0x01 ; 1 ad74: e9 f7 brne .-6 ; 0xad70 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; ad76: c7 5a subi r28, 0xA7 ; 167 ad78: dd 4f sbci r29, 0xFD ; 253 ad7a: 19 82 std Y+1, r1 ; 0x01 ad7c: 18 82 st Y, r1 ad7e: c9 55 subi r28, 0x59 ; 89 ad80: d2 40 sbci r29, 0x02 ; 2 ad82: 9e 01 movw r18, r28 ad84: 2f 51 subi r18, 0x1F ; 31 ad86: 3e 4f sbci r19, 0xFE ; 254 ad88: c1 59 subi r28, 0x91 ; 145 ad8a: dd 4f sbci r29, 0xFD ; 253 ad8c: 39 83 std Y+1, r19 ; 0x01 ad8e: 28 83 st Y, r18 ad90: cf 56 subi r28, 0x6F ; 111 ad92: d2 40 sbci r29, 0x02 ; 2 ad94: 8e 01 movw r16, r28 ad96: 07 5a subi r16, 0xA7 ; 167 ad98: 1d 4f sbci r17, 0xFD ; 253 ad9a: ce 01 movw r24, r28 ad9c: 8f 5c subi r24, 0xCF ; 207 ad9e: 9d 4f sbci r25, 0xFD ; 253 ada0: c3 59 subi r28, 0x93 ; 147 ada2: dd 4f sbci r29, 0xFD ; 253 ada4: 99 83 std Y+1, r25 ; 0x01 ada6: 88 83 st Y, r24 ada8: cd 56 subi r28, 0x6D ; 109 adaa: d2 40 sbci r29, 0x02 ; 2 adac: 3c 01 movw r6, r24 adae: 49 01 movw r8, r18 adb0: 40 eb ldi r20, 0xB0 ; 176 adb2: a4 2e mov r10, r20 adb4: 4f e0 ldi r20, 0x0F ; 15 adb6: b4 2e mov r11, r20 adb8: 53 e2 ldi r21, 0x23 ; 35 adba: c5 2e mov r12, r21 adbc: d1 2c mov r13, r1 for (i = 0; i < n; i++) { adbe: f1 2c mov r15, r1 adc0: 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]; adc2: b6 01 movw r22, r12 adc4: 0d 2c mov r0, r13 adc6: 00 0c add r0, r0 adc8: 88 0b sbc r24, r24 adca: 99 0b sbc r25, r25 adcc: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> add0: d4 01 movw r26, r8 add2: 6d 93 st X+, r22 add4: 7d 93 st X+, r23 add6: 8d 93 st X+, r24 add8: 9d 93 st X+, r25 adda: 4d 01 movw r8, r26 f[i] = (float)shift[i]; addc: f8 01 movw r30, r16 adde: 61 91 ld r22, Z+ ade0: 71 91 ld r23, Z+ ade2: 8f 01 movw r16, r30 ade4: 07 2e mov r0, r23 ade6: 00 0c add r0, r0 ade8: 88 0b sbc r24, r24 adea: 99 0b sbc r25, r25 adec: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> adf0: d3 01 movw r26, r6 adf2: 6d 93 st X+, r22 adf4: 7d 93 st X+, r23 adf6: 8d 93 st X+, r24 adf8: 9d 93 st X+, r25 adfa: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { adfc: bf ef ldi r27, 0xFF ; 255 adfe: eb 1a sub r14, r27 ae00: fb 0a sbc r15, r27 ae02: e6 e0 ldi r30, 0x06 ; 6 ae04: ee 16 cp r14, r30 ae06: f1 04 cpc r15, r1 ae08: 09 f0 breq .+2 ; 0xae0c ae0a: 38 c3 rjmp .+1648 ; 0xb47c 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; ae0c: cb 58 subi r28, 0x8B ; 139 ae0e: dd 4f sbci r29, 0xFD ; 253 ae10: 28 81 ld r18, Y ae12: 39 81 ldd r19, Y+1 ; 0x01 ae14: 4a 81 ldd r20, Y+2 ; 0x02 ae16: 5b 81 ldd r21, Y+3 ; 0x03 ae18: c5 57 subi r28, 0x75 ; 117 ae1a: d2 40 sbci r29, 0x02 ; 2 ae1c: c1 59 subi r28, 0x91 ; 145 ae1e: dd 4f sbci r29, 0xFD ; 253 ae20: a8 81 ld r26, Y ae22: b9 81 ldd r27, Y+1 ; 0x01 ae24: cf 56 subi r28, 0x6F ; 111 ae26: d2 40 sbci r29, 0x02 ; 2 ae28: 6d 91 ld r22, X+ ae2a: 7d 91 ld r23, X+ ae2c: 8d 91 ld r24, X+ ae2e: 9c 91 ld r25, X ae30: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> ae34: 41 2c mov r4, r1 ae36: 51 2c mov r5, r1 ae38: 32 01 movw r6, r4 ae3a: 18 16 cp r1, r24 ae3c: 0c f4 brge .+2 ; 0xae40 ae3e: 02 c3 rjmp .+1540 ; 0xb444 ae40: c3 59 subi r28, 0x93 ; 147 ae42: dd 4f sbci r29, 0xFD ; 253 ae44: 08 81 ld r16, Y ae46: 19 81 ldd r17, Y+1 ; 0x01 ae48: cd 56 subi r28, 0x6D ; 109 ae4a: d2 40 sbci r29, 0x02 ; 2 ae4c: 0c 5e subi r16, 0xEC ; 236 ae4e: 1f 4f sbci r17, 0xFF ; 255 ae50: c1 59 subi r28, 0x91 ; 145 ae52: dd 4f sbci r29, 0xFD ; 253 ae54: e8 80 ld r14, Y ae56: f9 80 ldd r15, Y+1 ; 0x01 ae58: cf 56 subi r28, 0x6F ; 111 ae5a: d2 40 sbci r29, 0x02 ; 2 ae5c: b4 e1 ldi r27, 0x14 ; 20 ae5e: eb 0e add r14, r27 ae60: f1 1c adc r15, r1 ae62: 6e 01 movw r12, r28 ae64: ef ed ldi r30, 0xDF ; 223 ae66: ce 1a sub r12, r30 ae68: ed ef ldi r30, 0xFD ; 253 ae6a: de 0a sbc r13, r30 ae6c: 9e 01 movw r18, r28 ae6e: 2b 55 subi r18, 0x5B ; 91 ae70: 3e 4f sbci r19, 0xFE ; 254 ae72: cf 58 subi r28, 0x8F ; 143 ae74: dd 4f sbci r29, 0xFD ; 253 ae76: 39 83 std Y+1, r19 ; 0x01 ae78: 28 83 st Y, r18 ae7a: c1 57 subi r28, 0x71 ; 113 ae7c: 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]); ae7e: d8 01 movw r26, r16 ae80: 4d 90 ld r4, X+ ae82: 5d 90 ld r5, X+ ae84: 6d 90 ld r6, X+ ae86: 7c 90 ld r7, X ae88: f7 01 movw r30, r14 ae8a: 60 81 ld r22, Z ae8c: 71 81 ldd r23, Z+1 ; 0x01 ae8e: 82 81 ldd r24, Z+2 ; 0x02 ae90: 93 81 ldd r25, Z+3 ; 0x03 ae92: d7 01 movw r26, r14 ae94: 5e 91 ld r21, -X ae96: 4e 91 ld r20, -X ae98: 3e 91 ld r19, -X ae9a: 2e 91 ld r18, -X ae9c: 7d 01 movw r14, r26 ae9e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> aea2: 4b 01 movw r8, r22 aea4: 5c 01 movw r10, r24 aea6: f8 01 movw r30, r16 aea8: 52 91 ld r21, -Z aeaa: 42 91 ld r20, -Z aeac: 32 91 ld r19, -Z aeae: 22 91 ld r18, -Z aeb0: 8f 01 movw r16, r30 aeb2: c3 01 movw r24, r6 aeb4: b2 01 movw r22, r4 aeb6: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> aeba: a5 01 movw r20, r10 aebc: 94 01 movw r18, r8 aebe: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> aec2: d6 01 movw r26, r12 aec4: 9e 93 st -X, r25 aec6: 8e 93 st -X, r24 aec8: 7e 93 st -X, r23 aeca: 6e 93 st -X, r22 aecc: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; aece: cf 58 subi r28, 0x8F ; 143 aed0: dd 4f sbci r29, 0xFD ; 253 aed2: e8 81 ld r30, Y aed4: f9 81 ldd r31, Y+1 ; 0x01 aed6: c1 57 subi r28, 0x71 ; 113 aed8: d2 40 sbci r29, 0x02 ; 2 aeda: b2 92 st -Z, r11 aedc: a2 92 st -Z, r10 aede: 92 92 st -Z, r9 aee0: 82 92 st -Z, r8 aee2: cf 58 subi r28, 0x8F ; 143 aee4: dd 4f sbci r29, 0xFD ; 253 aee6: f9 83 std Y+1, r31 ; 0x01 aee8: e8 83 st Y, r30 aeea: c1 57 subi r28, 0x71 ; 113 aeec: 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--) { aeee: c3 59 subi r28, 0x93 ; 147 aef0: dd 4f sbci r29, 0xFD ; 253 aef2: 28 81 ld r18, Y aef4: 39 81 ldd r19, Y+1 ; 0x01 aef6: cd 56 subi r28, 0x6D ; 109 aef8: d2 40 sbci r29, 0x02 ; 2 aefa: 02 17 cp r16, r18 aefc: 13 07 cpc r17, r19 aefe: 09 f0 breq .+2 ; 0xaf02 af00: be cf rjmp .-132 ; 0xae7e af02: 4e 01 movw r8, r28 af04: 3f e6 ldi r19, 0x6F ; 111 af06: 83 1a sub r8, r19 af08: 3e ef ldi r19, 0xFE ; 254 af0a: 93 0a sbc r9, r19 af0c: 5e 01 movw r10, r28 af0e: 83 ef ldi r24, 0xF3 ; 243 af10: a8 1a sub r10, r24 af12: 8d ef ldi r24, 0xFD ; 253 af14: b8 0a sbc r11, r24 af16: 61 01 movw r12, r2 af18: 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 af3c: 9b 01 movw r18, r22 af3e: ac 01 movw r20, r24 af40: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> af44: f8 01 movw r30, r16 af46: 64 a7 std Z+44, r22 ; 0x2c af48: 75 a7 std Z+45, r23 ; 0x2d af4a: 86 a7 std Z+46, r24 ; 0x2e af4c: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { af4e: f1 e0 ldi r31, 0x01 ; 1 af50: ef 16 cp r14, r31 af52: f1 04 cpc r15, r1 af54: 61 f0 breq .+24 ; 0xaf6e m[i][i - 1] = h[i - 1]; af56: d8 01 movw r26, r16 af58: 98 96 adiw r26, 0x28 ; 40 af5a: 4d 92 st X+, r4 af5c: 5d 92 st X+, r5 af5e: 6d 92 st X+, r6 af60: 7c 92 st X, r7 af62: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; af64: f8 01 movw r30, r16 af66: 44 82 std Z+4, r4 ; 0x04 af68: 55 82 std Z+5, r5 ; 0x05 af6a: 66 82 std Z+6, r6 ; 0x06 af6c: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); af6e: ff ef ldi r31, 0xFF ; 255 af70: ef 1a sub r14, r31 af72: ff 0a sbc r15, r31 af74: f5 01 movw r30, r10 af76: 20 81 ld r18, Z af78: 31 81 ldd r19, Z+1 ; 0x01 af7a: 42 81 ldd r20, Z+2 ; 0x02 af7c: 53 81 ldd r21, Z+3 ; 0x03 af7e: 84 e0 ldi r24, 0x04 ; 4 af80: a8 0e add r10, r24 af82: b1 1c adc r11, r1 af84: 64 81 ldd r22, Z+4 ; 0x04 af86: 75 81 ldd r23, Z+5 ; 0x05 af88: 86 81 ldd r24, Z+6 ; 0x06 af8a: 97 81 ldd r25, Z+7 ; 0x07 af8c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> af90: 20 e0 ldi r18, 0x00 ; 0 af92: 30 e0 ldi r19, 0x00 ; 0 af94: 40 ec ldi r20, 0xC0 ; 192 af96: 50 e4 ldi r21, 0x40 ; 64 af98: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> af9c: d6 01 movw r26, r12 af9e: dc 96 adiw r26, 0x3c ; 60 afa0: 6d 93 st X+, r22 afa2: 7d 93 st X+, r23 afa4: 8d 93 st X+, r24 afa6: 9c 93 st X, r25 afa8: df 97 sbiw r26, 0x3f ; 63 afaa: 04 5d subi r16, 0xD4 ; 212 afac: 1f 4f sbci r17, 0xFF ; 255 afae: b8 e2 ldi r27, 0x28 ; 40 afb0: cb 0e add r12, r27 afb2: 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 afbc: b1 cf rjmp .-158 ; 0xaf20 afbe: 7e 01 movw r14, r28 afc0: fd e2 ldi r31, 0x2D ; 45 afc2: ef 0e add r14, r31 afc4: f1 1c adc r15, r1 afc6: 28 e2 ldi r18, 0x28 ; 40 afc8: a2 2e mov r10, r18 afca: b1 2c mov r11, r1 afcc: 00 eb ldi r16, 0xB0 ; 176 afce: 1f ef ldi r17, 0xFF ; 255 afd0: 24 e0 ldi r18, 0x04 ; 4 afd2: 22 0e add r2, r18 afd4: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i aff2: 2b 01 movw r4, r22 aff4: 3c 01 movw r6, r24 aff6: 61 01 movw r12, r2 aff8: c0 1a sub r12, r16 affa: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) affc: 88 24 eor r8, r8 affe: 83 94 inc r8 b000: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; b002: f6 01 movw r30, r12 b004: e0 0f add r30, r16 b006: f1 1f adc r31, r17 b008: ea 0d add r30, r10 b00a: fb 1d adc r31, r11 b00c: 20 81 ld r18, Z b00e: 31 81 ldd r19, Z+1 ; 0x01 b010: 42 81 ldd r20, Z+2 ; 0x02 b012: 53 81 ldd r21, Z+3 ; 0x03 b014: c3 01 movw r24, r6 b016: b2 01 movw r22, r4 b018: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b01c: 9b 01 movw r18, r22 b01e: ac 01 movw r20, r24 b020: f6 01 movw r30, r12 b022: 60 81 ld r22, Z b024: 71 81 ldd r23, Z+1 ; 0x01 b026: 82 81 ldd r24, Z+2 ; 0x02 b028: 93 81 ldd r25, Z+3 ; 0x03 b02a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> b02e: d6 01 movw r26, r12 b030: 6d 93 st X+, r22 b032: 7d 93 st X+, r23 b034: 8d 93 st X+, r24 b036: 9d 93 st X+, r25 b038: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i b048: 3c e2 ldi r19, 0x2C ; 44 b04a: e3 0e add r14, r19 b04c: f1 1c adc r15, r1 b04e: 08 52 subi r16, 0x28 ; 40 b050: 11 09 sbc r17, r1 b052: 88 e2 ldi r24, 0x28 ; 40 b054: a8 0e add r10, r24 b056: 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 b060: ba cf rjmp .-140 ; 0xafd6 b062: 1e 01 movw r2, r28 b064: f5 eb ldi r31, 0xB5 ; 181 b066: 2f 0e add r2, r31 b068: 31 1c adc r3, r1 b06a: 6e 01 movw r12, r28 b06c: 21 eb ldi r18, 0xB1 ; 177 b06e: c2 0e add r12, r18 b070: d1 1c adc r13, r1 b072: 7e 01 movw r14, r28 b074: 37 e3 ldi r19, 0x37 ; 55 b076: e3 1a sub r14, r19 b078: 3e ef ldi r19, 0xFE ; 254 b07a: 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--) { b07c: 04 e0 ldi r16, 0x04 ; 4 b07e: 10 e0 ldi r17, 0x00 ; 0 b080: 48 01 movw r8, r16 b082: b1 2c mov r11, r1 b084: a1 2c mov r10, r1 sum = 0; b086: 41 2c mov r4, r1 b088: 51 2c mov r5, r1 b08a: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; b08c: f6 01 movw r30, r12 b08e: ea 0d add r30, r10 b090: fb 1d adc r31, r11 b092: d7 01 movw r26, r14 b094: aa 0d add r26, r10 b096: bb 1d adc r27, r11 b098: 2d 91 ld r18, X+ b09a: 3d 91 ld r19, X+ b09c: 4d 91 ld r20, X+ b09e: 5c 91 ld r21, X b0a0: 60 81 ld r22, Z b0a2: 71 81 ldd r23, Z+1 ; 0x01 b0a4: 82 81 ldd r24, Z+2 ; 0x02 b0a6: 93 81 ldd r25, Z+3 ; 0x03 b0a8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b0ac: 9b 01 movw r18, r22 b0ae: ac 01 movw r20, r24 b0b0: c3 01 movw r24, r6 b0b2: b2 01 movw r22, r4 b0b4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> b0b8: 2b 01 movw r4, r22 b0ba: 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++) b0bc: 8f ef ldi r24, 0xFF ; 255 b0be: 88 1a sub r8, r24 b0c0: 98 0a sbc r9, r24 b0c2: 94 e0 ldi r25, 0x04 ; 4 b0c4: a9 0e add r10, r25 b0c6: b1 1c adc r11, r1 b0c8: a5 e0 ldi r26, 0x05 ; 5 b0ca: 8a 16 cp r8, r26 b0cc: 91 04 cpc r9, r1 b0ce: f1 f6 brne .-68 ; 0xb08c sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; b0d0: a3 01 movw r20, r6 b0d2: 92 01 movw r18, r4 b0d4: f1 01 movw r30, r2 b0d6: 60 81 ld r22, Z b0d8: 71 81 ldd r23, Z+1 ; 0x01 b0da: 82 81 ldd r24, Z+2 ; 0x02 b0dc: 93 81 ldd r25, Z+3 ; 0x03 b0de: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> b0e2: d6 01 movw r26, r12 b0e4: 2d 91 ld r18, X+ b0e6: 3d 91 ld r19, X+ b0e8: 4d 91 ld r20, X+ b0ea: 5c 91 ld r21, X b0ec: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> b0f0: f7 01 movw r30, r14 b0f2: 60 83 st Z, r22 b0f4: 71 83 std Z+1, r23 ; 0x01 b0f6: 82 83 std Z+2, r24 ; 0x02 b0f8: 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--) { b0fa: 01 50 subi r16, 0x01 ; 1 b0fc: 11 09 sbc r17, r1 b0fe: f8 e2 ldi r31, 0x28 ; 40 b100: 2f 1a sub r2, r31 b102: 31 08 sbc r3, r1 b104: 2c e2 ldi r18, 0x2C ; 44 b106: c2 1a sub r12, r18 b108: d1 08 sbc r13, r1 b10a: 34 e0 ldi r19, 0x04 ; 4 b10c: e3 1a sub r14, r19 b10e: f1 08 sbc r15, r1 b110: 01 15 cp r16, r1 b112: 11 05 cpc r17, r1 b114: 09 f0 breq .+2 ; 0xb118 b116: b4 cf rjmp .-152 ; 0xb080 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { b118: cb 50 subi r28, 0x0B ; 11 b11a: de 4f sbci r29, 0xFE ; 254 b11c: 88 81 ld r24, Y b11e: 99 81 ldd r25, Y+1 ; 0x01 b120: aa 81 ldd r26, Y+2 ; 0x02 b122: bb 81 ldd r27, Y+3 ; 0x03 b124: c5 5f subi r28, 0xF5 ; 245 b126: d1 40 sbci r29, 0x01 ; 1 b128: cf 57 subi r28, 0x7F ; 127 b12a: dd 4f sbci r29, 0xFD ; 253 b12c: 88 83 st Y, r24 b12e: 99 83 std Y+1, r25 ; 0x01 b130: aa 83 std Y+2, r26 ; 0x02 b132: bb 83 std Y+3, r27 ; 0x03 b134: c1 58 subi r28, 0x81 ; 129 b136: d2 40 sbci r29, 0x02 ; 2 b138: 1e 01 movw r2, r28 b13a: 97 e4 ldi r25, 0x47 ; 71 b13c: 29 1a sub r2, r25 b13e: 9e ef ldi r25, 0xFE ; 254 b140: 39 0a sbc r3, r25 b142: 10 e0 ldi r17, 0x00 ; 0 b144: 00 e0 ldi r16, 0x00 ; 0 b146: c1 59 subi r28, 0x91 ; 145 b148: dd 4f sbci r29, 0xFD ; 253 b14a: a8 81 ld r26, Y b14c: b9 81 ldd r27, Y+1 ; 0x01 b14e: cf 56 subi r28, 0x6F ; 111 b150: d2 40 sbci r29, 0x02 ; 2 b152: cd 90 ld r12, X+ b154: dd 90 ld r13, X+ b156: ed 90 ld r14, X+ b158: fd 90 ld r15, X+ b15a: c1 59 subi r28, 0x91 ; 145 b15c: dd 4f sbci r29, 0xFD ; 253 b15e: b9 83 std Y+1, r27 ; 0x01 b160: a8 83 st Y, r26 b162: cf 56 subi r28, 0x6F ; 111 b164: d2 40 sbci r29, 0x02 ; 2 b166: cb 58 subi r28, 0x8B ; 139 b168: dd 4f sbci r29, 0xFD ; 253 b16a: 28 81 ld r18, Y b16c: 39 81 ldd r19, Y+1 ; 0x01 b16e: 4a 81 ldd r20, Y+2 ; 0x02 b170: 5b 81 ldd r21, Y+3 ; 0x03 b172: c5 57 subi r28, 0x75 ; 117 b174: d2 40 sbci r29, 0x02 ; 2 b176: c7 01 movw r24, r14 b178: b6 01 movw r22, r12 b17a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> b17e: 18 16 cp r1, r24 b180: b4 f0 brlt .+44 ; 0xb1ae b182: cb 58 subi r28, 0x8B ; 139 b184: dd 4f sbci r29, 0xFD ; 253 b186: 28 81 ld r18, Y b188: 39 81 ldd r19, Y+1 ; 0x01 b18a: 4a 81 ldd r20, Y+2 ; 0x02 b18c: 5b 81 ldd r21, Y+3 ; 0x03 b18e: c5 57 subi r28, 0x75 ; 117 b190: d2 40 sbci r29, 0x02 ; 2 b192: c1 59 subi r28, 0x91 ; 145 b194: dd 4f sbci r29, 0xFD ; 253 b196: e8 81 ld r30, Y b198: f9 81 ldd r31, Y+1 ; 0x01 b19a: cf 56 subi r28, 0x6F ; 111 b19c: d2 40 sbci r29, 0x02 ; 2 b19e: 60 81 ld r22, Z b1a0: 71 81 ldd r23, Z+1 ; 0x01 b1a2: 82 81 ldd r24, Z+2 ; 0x02 b1a4: 93 81 ldd r25, Z+3 ; 0x03 b1a6: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> b1aa: 87 ff sbrs r24, 7 b1ac: 18 c0 rjmp .+48 ; 0xb1de b1ae: 04 30 cpi r16, 0x04 ; 4 b1b0: 11 05 cpc r17, r1 b1b2: 09 f0 breq .+2 ; 0xb1b6 b1b4: 30 c1 rjmp .+608 ; 0xb416 b1b6: cb 58 subi r28, 0x8B ; 139 b1b8: dd 4f sbci r29, 0xFD ; 253 b1ba: 28 81 ld r18, Y b1bc: 39 81 ldd r19, Y+1 ; 0x01 b1be: 4a 81 ldd r20, Y+2 ; 0x02 b1c0: 5b 81 ldd r21, Y+3 ; 0x03 b1c2: c5 57 subi r28, 0x75 ; 117 b1c4: d2 40 sbci r29, 0x02 ; 2 b1c6: cf 57 subi r28, 0x7F ; 127 b1c8: dd 4f sbci r29, 0xFD ; 253 b1ca: 68 81 ld r22, Y b1cc: 79 81 ldd r23, Y+1 ; 0x01 b1ce: 8a 81 ldd r24, Y+2 ; 0x02 b1d0: 9b 81 ldd r25, Y+3 ; 0x03 b1d2: c1 58 subi r28, 0x81 ; 129 b1d4: d2 40 sbci r29, 0x02 ; 2 b1d6: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> b1da: 87 ff sbrs r24, 7 b1dc: 1c c1 rjmp .+568 ; 0xb416 a = (s[i + 1] - s[i]) / (6 * h[i]); b1de: d1 01 movw r26, r2 b1e0: 14 96 adiw r26, 0x04 ; 4 b1e2: 8d 90 ld r8, X+ b1e4: 9d 90 ld r9, X+ b1e6: ad 90 ld r10, X+ b1e8: bc 90 ld r11, X b1ea: 17 97 sbiw r26, 0x07 ; 7 b1ec: 8d 91 ld r24, X+ b1ee: 9d 91 ld r25, X+ b1f0: 0d 90 ld r0, X+ b1f2: bc 91 ld r27, X b1f4: a0 2d mov r26, r0 b1f6: cf 58 subi r28, 0x8F ; 143 b1f8: dd 4f sbci r29, 0xFD ; 253 b1fa: 88 83 st Y, r24 b1fc: 99 83 std Y+1, r25 ; 0x01 b1fe: aa 83 std Y+2, r26 ; 0x02 b200: bb 83 std Y+3, r27 ; 0x03 b202: c1 57 subi r28, 0x71 ; 113 b204: d2 40 sbci r29, 0x02 ; 2 b206: f8 01 movw r30, r16 b208: ee 0f add r30, r30 b20a: ff 1f adc r31, r31 b20c: ee 0f add r30, r30 b20e: ff 1f adc r31, r31 b210: 21 e9 ldi r18, 0x91 ; 145 b212: 31 e0 ldi r19, 0x01 ; 1 b214: 2c 0f add r18, r28 b216: 3d 1f adc r19, r29 b218: e2 0f add r30, r18 b21a: f3 1f adc r31, r19 b21c: 40 80 ld r4, Z b21e: 51 80 ldd r5, Z+1 ; 0x01 b220: 62 80 ldd r6, Z+2 ; 0x02 b222: 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; b224: c3 59 subi r28, 0x93 ; 147 b226: dd 4f sbci r29, 0xFD ; 253 b228: a8 81 ld r26, Y b22a: b9 81 ldd r27, Y+1 ; 0x01 b22c: cd 56 subi r28, 0x6D ; 109 b22e: d2 40 sbci r29, 0x02 ; 2 b230: 8d 91 ld r24, X+ b232: 9d 91 ld r25, X+ b234: 0d 90 ld r0, X+ b236: bc 91 ld r27, X b238: a0 2d mov r26, r0 b23a: c3 58 subi r28, 0x83 ; 131 b23c: dd 4f sbci r29, 0xFD ; 253 b23e: 88 83 st Y, r24 b240: 99 83 std Y+1, r25 ; 0x01 b242: aa 83 std Y+2, r26 ; 0x02 b244: bb 83 std Y+3, r27 ; 0x03 b246: cd 57 subi r28, 0x7D ; 125 b248: 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; b24a: a7 01 movw r20, r14 b24c: 96 01 movw r18, r12 b24e: cb 58 subi r28, 0x8B ; 139 b250: dd 4f sbci r29, 0xFD ; 253 b252: 68 81 ld r22, Y b254: 79 81 ldd r23, Y+1 ; 0x01 b256: 8a 81 ldd r24, Y+2 ; 0x02 b258: 9b 81 ldd r25, Y+3 ; 0x03 b25a: c5 57 subi r28, 0x75 ; 117 b25c: d2 40 sbci r29, 0x02 ; 2 b25e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> b262: 6b 01 movw r12, r22 b264: 7c 01 movw r14, r24 b266: 20 e0 ldi r18, 0x00 ; 0 b268: 30 e0 ldi r19, 0x00 ; 0 b26a: 40 e4 ldi r20, 0x40 ; 64 b26c: 50 e4 ldi r21, 0x40 ; 64 b26e: 0f 94 35 a8 call 0x3506a ; 0x3506a b272: cb 57 subi r28, 0x7B ; 123 b274: dd 4f sbci r29, 0xFD ; 253 b276: 68 83 st Y, r22 b278: 79 83 std Y+1, r23 ; 0x01 b27a: 8a 83 std Y+2, r24 ; 0x02 b27c: 9b 83 std Y+3, r25 ; 0x03 b27e: c5 58 subi r28, 0x85 ; 133 b280: 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; b282: c3 58 subi r28, 0x83 ; 131 b284: dd 4f sbci r29, 0xFD ; 253 b286: 28 81 ld r18, Y b288: 39 81 ldd r19, Y+1 ; 0x01 b28a: 4a 81 ldd r20, Y+2 ; 0x02 b28c: 5b 81 ldd r21, Y+3 ; 0x03 b28e: cd 57 subi r28, 0x7D ; 125 b290: d2 40 sbci r29, 0x02 ; 2 b292: c3 59 subi r28, 0x93 ; 147 b294: dd 4f sbci r29, 0xFD ; 253 b296: e8 81 ld r30, Y b298: f9 81 ldd r31, Y+1 ; 0x01 b29a: cd 56 subi r28, 0x6D ; 109 b29c: d2 40 sbci r29, 0x02 ; 2 b29e: 64 81 ldd r22, Z+4 ; 0x04 b2a0: 75 81 ldd r23, Z+5 ; 0x05 b2a2: 86 81 ldd r24, Z+6 ; 0x06 b2a4: 97 81 ldd r25, Z+7 ; 0x07 b2a6: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> b2aa: a3 01 movw r20, r6 b2ac: 92 01 movw r18, r4 b2ae: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> b2b2: c7 58 subi r28, 0x87 ; 135 b2b4: dd 4f sbci r29, 0xFD ; 253 b2b6: 68 83 st Y, r22 b2b8: 79 83 std Y+1, r23 ; 0x01 b2ba: 8a 83 std Y+2, r24 ; 0x02 b2bc: 9b 83 std Y+3, r25 ; 0x03 b2be: c9 57 subi r28, 0x79 ; 121 b2c0: d2 40 sbci r29, 0x02 ; 2 b2c2: a3 01 movw r20, r6 b2c4: 92 01 movw r18, r4 b2c6: c3 01 movw r24, r6 b2c8: b2 01 movw r22, r4 b2ca: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> b2ce: cf 58 subi r28, 0x8F ; 143 b2d0: dd 4f sbci r29, 0xFD ; 253 b2d2: 28 81 ld r18, Y b2d4: 39 81 ldd r19, Y+1 ; 0x01 b2d6: 4a 81 ldd r20, Y+2 ; 0x02 b2d8: 5b 81 ldd r21, Y+3 ; 0x03 b2da: c1 57 subi r28, 0x71 ; 113 b2dc: d2 40 sbci r29, 0x02 ; 2 b2de: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b2e2: c7 57 subi r28, 0x77 ; 119 b2e4: dd 4f sbci r29, 0xFD ; 253 b2e6: 68 83 st Y, r22 b2e8: 79 83 std Y+1, r23 ; 0x01 b2ea: 8a 83 std Y+2, r24 ; 0x02 b2ec: 9b 83 std Y+3, r25 ; 0x03 b2ee: c9 58 subi r28, 0x89 ; 137 b2f0: d2 40 sbci r29, 0x02 ; 2 b2f2: a3 01 movw r20, r6 b2f4: 92 01 movw r18, r4 b2f6: c5 01 movw r24, r10 b2f8: b4 01 movw r22, r8 b2fa: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b2fe: 9b 01 movw r18, r22 b300: ac 01 movw r20, r24 b302: c7 57 subi r28, 0x77 ; 119 b304: dd 4f sbci r29, 0xFD ; 253 b306: 68 81 ld r22, Y b308: 79 81 ldd r23, Y+1 ; 0x01 b30a: 8a 81 ldd r24, Y+2 ; 0x02 b30c: 9b 81 ldd r25, Y+3 ; 0x03 b30e: c9 58 subi r28, 0x89 ; 137 b310: d2 40 sbci r29, 0x02 ; 2 b312: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> b316: 20 e0 ldi r18, 0x00 ; 0 b318: 30 e0 ldi r19, 0x00 ; 0 b31a: 40 ec ldi r20, 0xC0 ; 192 b31c: 50 e4 ldi r21, 0x40 ; 64 b31e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> b322: 9b 01 movw r18, r22 b324: ac 01 movw r20, r24 b326: c7 58 subi r28, 0x87 ; 135 b328: dd 4f sbci r29, 0xFD ; 253 b32a: 68 81 ld r22, Y b32c: 79 81 ldd r23, Y+1 ; 0x01 b32e: 8a 81 ldd r24, Y+2 ; 0x02 b330: 9b 81 ldd r25, Y+3 ; 0x03 b332: c9 57 subi r28, 0x79 ; 121 b334: d2 40 sbci r29, 0x02 ; 2 b336: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__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; b33a: a7 01 movw r20, r14 b33c: 96 01 movw r18, r12 b33e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b342: c7 58 subi r28, 0x87 ; 135 b344: dd 4f sbci r29, 0xFD ; 253 b346: 68 83 st Y, r22 b348: 79 83 std Y+1, r23 ; 0x01 b34a: 8a 83 std Y+2, r24 ; 0x02 b34c: 9b 83 std Y+3, r25 ; 0x03 b34e: c9 57 subi r28, 0x79 ; 121 b350: 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]); b352: cf 58 subi r28, 0x8F ; 143 b354: dd 4f sbci r29, 0xFD ; 253 b356: 28 81 ld r18, Y b358: 39 81 ldd r19, Y+1 ; 0x01 b35a: 4a 81 ldd r20, Y+2 ; 0x02 b35c: 5b 81 ldd r21, Y+3 ; 0x03 b35e: c1 57 subi r28, 0x71 ; 113 b360: d2 40 sbci r29, 0x02 ; 2 b362: c5 01 movw r24, r10 b364: b4 01 movw r22, r8 b366: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> b36a: 4b 01 movw r8, r22 b36c: 5c 01 movw r10, r24 b36e: 20 e0 ldi r18, 0x00 ; 0 b370: 30 e0 ldi r19, 0x00 ; 0 b372: 40 ec ldi r20, 0xC0 ; 192 b374: 50 e4 ldi r21, 0x40 ; 64 b376: c3 01 movw r24, r6 b378: b2 01 movw r22, r4 b37a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b37e: 9b 01 movw r18, r22 b380: ac 01 movw r20, r24 b382: c5 01 movw r24, r10 b384: b4 01 movw r22, r8 b386: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__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; b38a: cb 57 subi r28, 0x7B ; 123 b38c: dd 4f sbci r29, 0xFD ; 253 b38e: 28 81 ld r18, Y b390: 39 81 ldd r19, Y+1 ; 0x01 b392: 4a 81 ldd r20, Y+2 ; 0x02 b394: 5b 81 ldd r21, Y+3 ; 0x03 b396: c5 58 subi r28, 0x85 ; 133 b398: d2 40 sbci r29, 0x02 ; 2 b39a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b39e: 4b 01 movw r8, r22 b3a0: 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; b3a2: 20 e0 ldi r18, 0x00 ; 0 b3a4: 30 e0 ldi r19, 0x00 ; 0 b3a6: 40 e0 ldi r20, 0x00 ; 0 b3a8: 5f e3 ldi r21, 0x3F ; 63 b3aa: cf 58 subi r28, 0x8F ; 143 b3ac: dd 4f sbci r29, 0xFD ; 253 b3ae: 68 81 ld r22, Y b3b0: 79 81 ldd r23, Y+1 ; 0x01 b3b2: 8a 81 ldd r24, Y+2 ; 0x02 b3b4: 9b 81 ldd r25, Y+3 ; 0x03 b3b6: c1 57 subi r28, 0x71 ; 113 b3b8: d2 40 sbci r29, 0x02 ; 2 b3ba: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b3be: 2b 01 movw r4, r22 b3c0: 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; b3c2: a7 01 movw r20, r14 b3c4: 96 01 movw r18, r12 b3c6: c7 01 movw r24, r14 b3c8: b6 01 movw r22, r12 b3ca: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b3ce: 9b 01 movw r18, r22 b3d0: ac 01 movw r20, r24 b3d2: c3 01 movw r24, r6 b3d4: b2 01 movw r22, r4 b3d6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b3da: 9b 01 movw r18, r22 b3dc: ac 01 movw r20, r24 b3de: c5 01 movw r24, r10 b3e0: b4 01 movw r22, r8 b3e2: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> b3e6: 9b 01 movw r18, r22 b3e8: ac 01 movw r20, r24 b3ea: c7 58 subi r28, 0x87 ; 135 b3ec: dd 4f sbci r29, 0xFD ; 253 b3ee: 68 81 ld r22, Y b3f0: 79 81 ldd r23, Y+1 ; 0x01 b3f2: 8a 81 ldd r24, Y+2 ; 0x02 b3f4: 9b 81 ldd r25, Y+3 ; 0x03 b3f6: c9 57 subi r28, 0x79 ; 121 b3f8: d2 40 sbci r29, 0x02 ; 2 b3fa: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> b3fe: c3 58 subi r28, 0x83 ; 131 b400: dd 4f sbci r29, 0xFD ; 253 b402: 28 81 ld r18, Y b404: 39 81 ldd r19, Y+1 ; 0x01 b406: 4a 81 ldd r20, Y+2 ; 0x02 b408: 5b 81 ldd r21, Y+3 ; 0x03 b40a: cd 57 subi r28, 0x7D ; 125 b40c: d2 40 sbci r29, 0x02 ; 2 b40e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> b412: 2b 01 movw r4, r22 b414: 3c 01 movw r6, r24 b416: 0f 5f subi r16, 0xFF ; 255 b418: 1f 4f sbci r17, 0xFF ; 255 b41a: f4 e0 ldi r31, 0x04 ; 4 b41c: 2f 0e add r2, r31 b41e: 31 1c adc r3, r1 b420: c3 59 subi r28, 0x93 ; 147 b422: dd 4f sbci r29, 0xFD ; 253 b424: 28 81 ld r18, Y b426: 39 81 ldd r19, Y+1 ; 0x01 b428: cd 56 subi r28, 0x6D ; 109 b42a: d2 40 sbci r29, 0x02 ; 2 b42c: 2c 5f subi r18, 0xFC ; 252 b42e: 3f 4f sbci r19, 0xFF ; 255 b430: c3 59 subi r28, 0x93 ; 147 b432: dd 4f sbci r29, 0xFD ; 253 b434: 39 83 std Y+1, r19 ; 0x01 b436: 28 83 st Y, r18 b438: cd 56 subi r28, 0x6D ; 109 b43a: 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 b442: 81 ce rjmp .-766 ; 0xb146 sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } b444: c3 01 movw r24, r6 b446: b2 01 movw r22, r4 b448: c4 57 subi r28, 0x74 ; 116 b44a: dd 4f sbci r29, 0xFD ; 253 b44c: 0f b6 in r0, 0x3f ; 63 b44e: f8 94 cli b450: de bf out 0x3e, r29 ; 62 b452: 0f be out 0x3f, r0 ; 63 b454: cd bf out 0x3d, r28 ; 61 b456: df 91 pop r29 b458: cf 91 pop r28 b45a: 1f 91 pop r17 b45c: 0f 91 pop r16 b45e: ff 90 pop r15 b460: ef 90 pop r14 b462: df 90 pop r13 b464: cf 90 pop r12 b466: bf 90 pop r11 b468: af 90 pop r10 b46a: 9f 90 pop r9 b46c: 8f 90 pop r8 b46e: 7f 90 pop r7 b470: 6f 90 pop r6 b472: 5f 90 pop r5 b474: 4f 90 pop r4 b476: 3f 90 pop r3 b478: 2f 90 pop r2 b47a: 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)); b47c: c5 01 movw r24, r10 b47e: 0f 94 ab a3 call 0x34756 ; 0x34756 b482: d8 01 movw r26, r16 b484: 8d 93 st X+, r24 b486: 9c 93 st X, r25 b488: b5 e0 ldi r27, 0x05 ; 5 b48a: cb 0e add r12, r27 b48c: d1 1c adc r13, r1 b48e: e2 e0 ldi r30, 0x02 ; 2 b490: ae 0e add r10, r30 b492: b1 1c adc r11, r1 b494: 96 cc rjmp .-1748 ; 0xadc2 0000b496 : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { b496: 0f 93 push r16 b498: 1f 93 push r17 b49a: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) b49c: 20 91 01 13 lds r18, 0x1301 ; 0x801301 b4a0: 21 30 cpi r18, 0x01 ; 1 b4a2: 79 f5 brne .+94 ; 0xb502 b4a4: 8c 01 movw r16, r24 b4a6: 80 e5 ldi r24, 0x50 ; 80 b4a8: 0e 94 f5 55 call 0xabea ; 0xabea b4ac: 88 23 and r24, r24 b4ae: 49 f1 breq .+82 ; 0xb502 { mmuSlotIndex = code_value_uint8(); b4b0: 0e 94 0a 56 call 0xac14 ; 0xac14 b4b4: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { b4b6: 85 30 cpi r24, 0x05 ; 5 b4b8: 20 f5 brcc .+72 ; 0xb502 switch (gcode) b4ba: 01 3c cpi r16, 0xC1 ; 193 b4bc: 82 e0 ldi r24, 0x02 ; 2 b4be: 18 07 cpc r17, r24 b4c0: 49 f0 breq .+18 ; 0xb4d4 b4c2: 02 3c cpi r16, 0xC2 ; 194 b4c4: 12 40 sbci r17, 0x02 ; 2 b4c6: 69 f0 breq .+26 ; 0xb4e2 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); b4c8: 8c 2f mov r24, r28 default: break; } } } } b4ca: cf 91 pop r28 b4cc: 1f 91 pop r17 b4ce: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); b4d0: 0d 94 46 9d jmp 0x33a8c ; 0x33a8c break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); b4d4: 60 e0 ldi r22, 0x00 ; 0 b4d6: 8c 2f mov r24, r28 default: break; } } } } b4d8: cf 91 pop r28 b4da: 1f 91 pop r17 b4dc: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); b4de: 0d 94 89 9d jmp 0x33b12 ; 0x33b12 break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ b4e2: 8e ec ldi r24, 0xCE ; 206 b4e4: 9e e0 ldi r25, 0x0E ; 14 b4e6: 0f 94 9d a3 call 0x3473a ; 0x3473a b4ea: 88 23 and r24, r24 b4ec: 51 f0 breq .+20 ; 0xb502 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { b4ee: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 b4f2: 88 23 and r24, r24 b4f4: 31 f0 breq .+12 ; 0xb502 b4f6: 8c 2f mov r24, r28 default: break; } } } } b4f8: cf 91 pop r28 b4fa: 1f 91 pop r17 b4fc: 0f 91 pop r16 b4fe: 0d 94 06 9e jmp 0x33c0c ; 0x33c0c b502: cf 91 pop r28 b504: 1f 91 pop r17 b506: 0f 91 pop r16 b508: 08 95 ret 0000b50a : #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; } static inline float code_value() { return strtod_noE(strchr_pointer+1, NULL);} b50a: 8f 92 push r8 b50c: 9f 92 push r9 b50e: af 92 push r10 b510: bf 92 push r11 b512: cf 92 push r12 b514: df 92 push r13 b516: ef 92 push r14 b518: ff 92 push r15 b51a: 0f 93 push r16 b51c: 1f 93 push r17 b51e: cf 93 push r28 b520: df 93 push r29 b522: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb b526: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc b52a: 0f 5f subi r16, 0xFF ; 255 b52c: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; b52e: 68 01 movw r12, r16 b530: 8f ef ldi r24, 0xFF ; 255 b532: c8 1a sub r12, r24 b534: d8 0a sbc r13, r24 b536: d8 01 movw r26, r16 b538: dc 91 ld r29, X } while (isspace(c)); b53a: 8d 2f mov r24, r29 b53c: 90 e0 ldi r25, 0x00 ; 0 b53e: 0f 94 2e a1 call 0x3425c ; 0x3425c b542: 7c 01 movw r14, r24 b544: 89 2b or r24, r25 b546: 01 f5 brne .+64 ; 0xb588 flag = 0; if (c == '-') { b548: dd 32 cpi r29, 0x2D ; 45 b54a: 01 f5 brne .+64 ; 0xb58c flag = FL_MINUS; c = *nptr++; b54c: 68 01 movw r12, r16 b54e: b2 e0 ldi r27, 0x02 ; 2 b550: cb 0e add r12, r27 b552: d1 1c adc r13, r1 b554: f8 01 movw r30, r16 b556: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; b558: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { b55a: 86 01 movw r16, r12 b55c: 01 50 subi r16, 0x01 ; 1 b55e: 11 09 sbc r17, r1 b560: 43 e0 ldi r20, 0x03 ; 3 b562: 50 e0 ldi r21, 0x00 ; 0 b564: 64 e8 ldi r22, 0x84 ; 132 b566: 76 e7 ldi r23, 0x76 ; 118 b568: c8 01 movw r24, r16 b56a: 0f 94 64 a1 call 0x342c8 ; 0x342c8 b56e: 89 2b or r24, r25 b570: c1 f4 brne .+48 ; 0xb5a2 nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; b572: 60 e0 ldi r22, 0x00 ; 0 b574: 70 e0 ldi r23, 0x00 ; 0 b576: 80 e8 ldi r24, 0x80 ; 128 b578: 9f ef ldi r25, 0xFF ; 255 b57a: c1 11 cpse r28, r1 b57c: db c0 rjmp .+438 ; 0xb734 b57e: 60 e0 ldi r22, 0x00 ; 0 b580: 70 e0 ldi r23, 0x00 ; 0 b582: 80 e8 ldi r24, 0x80 ; 128 b584: 9f e7 ldi r25, 0x7F ; 127 b586: d6 c0 rjmp .+428 ; 0xb734 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; b588: 86 01 movw r16, r12 b58a: d1 cf rjmp .-94 ; 0xb52e flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { b58c: db 32 cpi r29, 0x2B ; 43 b58e: 39 f4 brne .+14 ; 0xb59e c = *nptr++; b590: 68 01 movw r12, r16 b592: f2 e0 ldi r31, 0x02 ; 2 b594: cf 0e add r12, r31 b596: d1 1c adc r13, r1 b598: d8 01 movw r26, r16 b59a: 11 96 adiw r26, 0x01 ; 1 b59c: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; b59e: c0 e0 ldi r28, 0x00 ; 0 b5a0: dc cf rjmp .-72 ; 0xb55a 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)) { b5a2: 43 e0 ldi r20, 0x03 ; 3 b5a4: 50 e0 ldi r21, 0x00 ; 0 b5a6: 61 e8 ldi r22, 0x81 ; 129 b5a8: 76 e7 ldi r23, 0x76 ; 118 b5aa: c8 01 movw r24, r16 b5ac: 0f 94 64 a1 call 0x342c8 ; 0x342c8 b5b0: 89 2b or r24, r25 b5b2: 09 f4 brne .+2 ; 0xb5b6 b5b4: cc c0 rjmp .+408 ; 0xb74e b5b6: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; b5b8: 10 e0 ldi r17, 0x00 ; 0 b5ba: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; b5bc: 20 e0 ldi r18, 0x00 ; 0 b5be: 30 e0 ldi r19, 0x00 ; 0 b5c0: a9 01 movw r20, r18 b5c2: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; b5c4: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { b5c6: da 30 cpi r29, 0x0A ; 10 b5c8: 60 f5 brcc .+88 ; 0xb622 flag |= FL_ANY; b5ca: bc 2e mov r11, r28 b5cc: 68 94 set b5ce: b1 f8 bld r11, 1 b5d0: 8c 2f mov r24, r28 b5d2: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { b5d4: c2 ff sbrs r28, 2 b5d6: 09 c0 rjmp .+18 ; 0xb5ea if (!(flag & FL_DOT)) b5d8: 81 11 cpse r24, r1 b5da: 02 c0 rjmp .+4 ; 0xb5e0 exp += 1; b5dc: 0f 5f subi r16, 0xFF ; 255 b5de: 1f 4f sbci r17, 0xFF ; 255 b5e0: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; b5e2: d6 01 movw r26, r12 b5e4: dc 91 ld r29, X b5e6: cb 2d mov r28, r11 b5e8: ec cf rjmp .-40 ; 0xb5c2 if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) b5ea: 88 23 and r24, r24 b5ec: 11 f0 breq .+4 ; 0xb5f2 exp -= 1; b5ee: 01 50 subi r16, 0x01 ; 1 b5f0: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; b5f2: a5 e0 ldi r26, 0x05 ; 5 b5f4: b0 e0 ldi r27, 0x00 ; 0 b5f6: 0f 94 32 a4 call 0x34864 ; 0x34864 <__muluhisi3> b5fa: 9b 01 movw r18, r22 b5fc: ac 01 movw r20, r24 b5fe: 22 0f add r18, r18 b600: 33 1f adc r19, r19 b602: 44 1f adc r20, r20 b604: 55 1f adc r21, r21 b606: 2d 0f add r18, r29 b608: 31 1d adc r19, r1 b60a: 41 1d adc r20, r1 b60c: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) b60e: 28 39 cpi r18, 0x98 ; 152 b610: b9 e9 ldi r27, 0x99 ; 153 b612: 3b 07 cpc r19, r27 b614: 4b 07 cpc r20, r27 b616: b9 e1 ldi r27, 0x19 ; 25 b618: 5b 07 cpc r21, r27 b61a: 10 f3 brcs .-60 ; 0xb5e0 flag |= FL_OVFL; b61c: c6 60 ori r28, 0x06 ; 6 b61e: bc 2e mov r11, r28 b620: df cf rjmp .-66 ; 0xb5e0 } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { b622: de 3f cpi r29, 0xFE ; 254 b624: 31 f4 brne .+12 ; 0xb632 b626: c3 fd sbrc r28, 3 b628: 33 c0 rjmp .+102 ; 0xb690 flag |= FL_DOT; b62a: bc 2e mov r11, r28 b62c: 68 94 set b62e: b3 f8 bld r11, 3 b630: d7 cf rjmp .-82 ; 0xb5e0 } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) b632: d5 33 cpi r29, 0x35 ; 53 b634: 69 f5 brne .+90 ; 0xb690 { int i; c = *nptr++; b636: 80 81 ld r24, Z i = 2; if (c == '-') { b638: 8d 32 cpi r24, 0x2D ; 45 b63a: 31 f4 brne .+12 ; 0xb648 flag |= FL_MEXP; b63c: c0 61 ori r28, 0x10 ; 16 c = *nptr++; b63e: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; b640: 6e 5f subi r22, 0xFE ; 254 b642: 7f 4f sbci r23, 0xFF ; 255 b644: 81 81 ldd r24, Z+1 ; 0x01 b646: 05 c0 rjmp .+10 ; 0xb652 b648: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { b64a: 8b 32 cpi r24, 0x2B ; 43 b64c: c9 f3 breq .-14 ; 0xb640 // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; b64e: 6f 5f subi r22, 0xFF ; 255 b650: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; b652: 80 53 subi r24, 0x30 ; 48 if (c > 9) { b654: 8a 30 cpi r24, 0x0A ; 10 b656: e0 f4 brcc .+56 ; 0xb690 b658: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) b65a: b0 e8 ldi r27, 0x80 ; 128 b65c: eb 16 cp r14, r27 b65e: bc e0 ldi r27, 0x0C ; 12 b660: fb 06 cpc r15, r27 b662: 5c f4 brge .+22 ; 0xb67a i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ b664: b7 01 movw r22, r14 b666: 66 0f add r22, r22 b668: 77 1f adc r23, r23 b66a: 66 0f add r22, r22 b66c: 77 1f adc r23, r23 b66e: e6 0e add r14, r22 b670: f7 1e adc r15, r23 b672: ee 0c add r14, r14 b674: ff 1c adc r15, r15 b676: e8 0e add r14, r24 b678: f1 1c adc r15, r1 c = *nptr++ - '0'; b67a: 81 91 ld r24, Z+ b67c: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); b67e: 8a 30 cpi r24, 0x0A ; 10 b680: 60 f3 brcs .-40 ; 0xb65a if (flag & FL_MEXP) b682: c4 ff sbrs r28, 4 b684: 03 c0 rjmp .+6 ; 0xb68c i = -i; b686: f1 94 neg r15 b688: e1 94 neg r14 b68a: f1 08 sbc r15, r1 exp += i; b68c: 0e 0d add r16, r14 b68e: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ b690: ca 01 movw r24, r20 b692: b9 01 movw r22, r18 b694: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) b698: c3 70 andi r28, 0x03 ; 3 b69a: c3 30 cpi r28, 0x03 ; 3 b69c: 09 f4 brne .+2 ; 0xb6a0 x.flt = -x.flt; b69e: 90 58 subi r25, 0x80 ; 128 b6a0: 4b 01 movw r8, r22 b6a2: 5c 01 movw r10, r24 if (x.flt != 0) { b6a4: 20 e0 ldi r18, 0x00 ; 0 b6a6: 30 e0 ldi r19, 0x00 ; 0 b6a8: a9 01 movw r20, r18 b6aa: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> b6ae: 88 23 and r24, r24 b6b0: 09 f4 brne .+2 ; 0xb6b4 b6b2: 3e c0 rjmp .+124 ; 0xb730 if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); b6b4: cd e7 ldi r28, 0x7D ; 125 b6b6: d6 e7 ldi r29, 0x76 ; 118 if ((flag & FL_MINUS) && (flag & FL_ANY)) x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { b6b8: 17 ff sbrs r17, 7 b6ba: 05 c0 rjmp .+10 ; 0xb6c6 nptr = (void*)(pwr_m10 + 5); exp = -exp; b6bc: 11 95 neg r17 b6be: 01 95 neg r16 b6c0: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); b6c2: c5 e6 ldi r28, 0x65 ; 101 b6c4: d6 e7 ldi r29, 0x76 ; 118 b6c6: 6e 01 movw r12, r28 b6c8: e8 e1 ldi r30, 0x18 ; 24 b6ca: ce 1a sub r12, r30 b6cc: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); b6ce: 80 e2 ldi r24, 0x20 ; 32 b6d0: e8 2e mov r14, r24 b6d2: f1 2c mov r15, r1 b6d4: 0d c0 rjmp .+26 ; 0xb6f0 for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); b6d6: fe 01 movw r30, r28 b6d8: 25 91 lpm r18, Z+ b6da: 35 91 lpm r19, Z+ b6dc: 45 91 lpm r20, Z+ b6de: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { b6e0: 0e 19 sub r16, r14 b6e2: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; b6e4: c5 01 movw r24, r10 b6e6: b4 01 movw r22, r8 b6e8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b6ec: 4b 01 movw r8, r22 b6ee: 5c 01 movw r10, r24 b6f0: d5 01 movw r26, r10 b6f2: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { b6f4: 0e 15 cp r16, r14 b6f6: 1f 05 cpc r17, r15 b6f8: 74 f7 brge .-36 ; 0xb6d6 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); b6fa: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { b6fc: f5 94 asr r15 b6fe: e7 94 ror r14 b700: cc 16 cp r12, r28 b702: dd 06 cpc r13, r29 b704: a9 f7 brne .-22 ; 0xb6f0 not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( b706: 8a 2f mov r24, r26 b708: 88 0f add r24, r24 b70a: 8b 2f mov r24, r27 b70c: 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) b70e: 8f 3f cpi r24, 0xFF ; 255 b710: 49 f0 breq .+18 ; 0xb724 b712: 20 e0 ldi r18, 0x00 ; 0 b714: 30 e0 ldi r19, 0x00 ; 0 b716: a9 01 movw r20, r18 b718: c5 01 movw r24, r10 b71a: b4 01 movw r22, r8 b71c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> b720: 81 11 cpse r24, r1 b722: 06 c0 rjmp .+12 ; 0xb730 errno = ERANGE; b724: 82 e2 ldi r24, 0x22 ; 34 b726: 90 e0 ldi r25, 0x00 ; 0 b728: 90 93 0c 17 sts 0x170C, r25 ; 0x80170c b72c: 80 93 0b 17 sts 0x170B, r24 ; 0x80170b } return x.flt; b730: c5 01 movw r24, r10 b732: b4 01 movw r22, r8 b734: df 91 pop r29 b736: cf 91 pop r28 b738: 1f 91 pop r17 b73a: 0f 91 pop r16 b73c: ff 90 pop r15 b73e: ef 90 pop r14 b740: df 90 pop r13 b742: cf 90 pop r12 b744: bf 90 pop r11 b746: af 90 pop r10 b748: 9f 90 pop r9 b74a: 8f 90 pop r8 b74c: 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; b74e: 60 e0 ldi r22, 0x00 ; 0 b750: 70 e0 ldi r23, 0x00 ; 0 b752: 80 ec ldi r24, 0xC0 ; 192 b754: 9f e7 ldi r25, 0x7F ; 127 b756: ee cf rjmp .-36 ; 0xb734 0000b758 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { b758: 2f 92 push r2 b75a: 3f 92 push r3 b75c: 4f 92 push r4 b75e: 5f 92 push r5 b760: 6f 92 push r6 b762: 7f 92 push r7 b764: 8f 92 push r8 b766: 9f 92 push r9 b768: af 92 push r10 b76a: bf 92 push r11 b76c: cf 92 push r12 b76e: df 92 push r13 b770: ef 92 push r14 b772: ff 92 push r15 b774: 0f 93 push r16 b776: 1f 93 push r17 b778: cf 93 push r28 b77a: df 93 push r29 b77c: cd b7 in r28, 0x3d ; 61 b77e: de b7 in r29, 0x3e ; 62 b780: a1 97 sbiw r28, 0x21 ; 33 b782: 0f b6 in r0, 0x3f ; 63 b784: f8 94 cli b786: de bf out 0x3e, r29 ; 62 b788: 0f be out 0x3f, r0 ; 63 b78a: cd bf out 0x3d, r28 ; 61 b78c: 84 ec ldi r24, 0xC4 ; 196 b78e: 92 e0 ldi r25, 0x02 ; 2 b790: 9d 8f std Y+29, r25 ; 0x1d b792: 8c 8f std Y+28, r24 ; 0x1c b794: 81 e6 ldi r24, 0x61 ; 97 b796: 28 2e mov r2, r24 b798: 82 e1 ldi r24, 0x12 ; 18 b79a: 38 2e mov r3, r24 b79c: 09 e2 ldi r16, 0x29 ; 41 b79e: 16 e0 ldi r17, 0x06 ; 6 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { b7a0: 91 e0 ldi r25, 0x01 ; 1 b7a2: 9a 8f std Y+26, r25 ; 0x1a b7a4: 19 8e std Y+25, r1 ; 0x19 if(code_seen(axis_codes[i])) b7a6: ec 8d ldd r30, Y+28 ; 0x1c b7a8: fd 8d ldd r31, Y+29 ; 0x1d b7aa: 81 91 ld r24, Z+ b7ac: fd 8f std Y+29, r31 ; 0x1d b7ae: ec 8f std Y+28, r30 ; 0x1c b7b0: 0e 94 f5 55 call 0xabea ; 0xabea b7b4: e8 2e mov r14, r24 b7b6: 88 23 and r24, r24 b7b8: 09 f4 brne .+2 ; 0xb7bc b7ba: 54 c1 rjmp .+680 ; 0xba64 { bool relative = axis_relative_modes & mask; b7bc: f0 90 57 12 lds r15, 0x1257 ; 0x801257 b7c0: fa 8d ldd r31, Y+26 ; 0x1a b7c2: ff 22 and r15, r31 destination[i] = code_value(); b7c4: 0e 94 85 5a call 0xb50a ; 0xb50a b7c8: 2b 01 movw r4, r22 b7ca: 3c 01 movw r6, r24 b7cc: f8 01 movw r30, r16 b7ce: 40 82 st Z, r4 b7d0: 51 82 std Z+1, r5 ; 0x01 b7d2: 62 82 std Z+2, r6 ; 0x02 b7d4: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { b7d6: f9 8d ldd r31, Y+25 ; 0x19 b7d8: f3 30 cpi r31, 0x03 ; 3 b7da: 09 f0 breq .+2 ; 0xb7de b7dc: 45 c0 rjmp .+138 ; 0xb868 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; b7de: dd 24 eor r13, r13 b7e0: d3 94 inc r13 b7e2: f1 10 cpse r15, r1 b7e4: 01 c0 rjmp .+2 ; 0xb7e8 b7e6: d1 2c mov r13, r1 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; b7e8: 80 90 10 02 lds r8, 0x0210 ; 0x800210 b7ec: 90 90 11 02 lds r9, 0x0211 ; 0x800211 b7f0: a0 90 12 02 lds r10, 0x0212 ; 0x800212 b7f4: b0 90 13 02 lds r11, 0x0213 ; 0x800213 if (emult != 1.) { b7f8: 20 e0 ldi r18, 0x00 ; 0 b7fa: 30 e0 ldi r19, 0x00 ; 0 b7fc: 40 e8 ldi r20, 0x80 ; 128 b7fe: 5f e3 ldi r21, 0x3F ; 63 b800: c5 01 movw r24, r10 b802: b4 01 movw r22, r8 b804: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> b808: 88 23 and r24, r24 b80a: 59 f1 breq .+86 ; 0xb862 if (! relative) { b80c: f1 10 cpse r15, r1 b80e: 15 c0 rjmp .+42 ; 0xb83a destination[i] -= current_position[i]; b810: 20 91 6d 12 lds r18, 0x126D ; 0x80126d b814: 30 91 6e 12 lds r19, 0x126E ; 0x80126e b818: 40 91 6f 12 lds r20, 0x126F ; 0x80126f b81c: 50 91 70 12 lds r21, 0x1270 ; 0x801270 b820: c3 01 movw r24, r6 b822: b2 01 movw r22, r4 b824: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> b828: 60 93 35 06 sts 0x0635, r22 ; 0x800635 b82c: 70 93 36 06 sts 0x0636, r23 ; 0x800636 b830: 80 93 37 06 sts 0x0637, r24 ; 0x800637 b834: 90 93 38 06 sts 0x0638, r25 ; 0x800638 relative = true; b838: de 2c mov r13, r14 } destination[i] *= emult; b83a: a5 01 movw r20, r10 b83c: 94 01 movw r18, r8 b83e: 60 91 35 06 lds r22, 0x0635 ; 0x800635 b842: 70 91 36 06 lds r23, 0x0636 ; 0x800636 b846: 80 91 37 06 lds r24, 0x0637 ; 0x800637 b84a: 90 91 38 06 lds r25, 0x0638 ; 0x800638 b84e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> b852: 60 93 35 06 sts 0x0635, r22 ; 0x800635 b856: 70 93 36 06 sts 0x0636, r23 ; 0x800636 b85a: 80 93 37 06 sts 0x0637, r24 ; 0x800637 b85e: 90 93 38 06 sts 0x0638, r25 ; 0x800638 } } if (relative) b862: d1 10 cpse r13, r1 b864: 03 c0 rjmp .+6 ; 0xb86c b866: 5f c0 rjmp .+190 ; 0xb926 b868: ff 20 and r15, r15 b86a: 89 f0 breq .+34 ; 0xb88e destination[i] += current_position[i]; b86c: f1 01 movw r30, r2 b86e: 20 81 ld r18, Z b870: 31 81 ldd r19, Z+1 ; 0x01 b872: 42 81 ldd r20, Z+2 ; 0x02 b874: 53 81 ldd r21, Z+3 ; 0x03 b876: f8 01 movw r30, r16 b878: 60 81 ld r22, Z b87a: 71 81 ldd r23, Z+1 ; 0x01 b87c: 82 81 ldd r24, Z+2 ; 0x02 b87e: 93 81 ldd r25, Z+3 ; 0x03 b880: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> b884: f8 01 movw r30, r16 b886: 60 83 st Z, r22 b888: 71 83 std Z+1, r23 ; 0x01 b88a: 82 83 std Z+2, r24 ; 0x02 b88c: 93 83 std Z+3, r25 ; 0x03 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 if (i == Z_AXIS && SilentModeMenu == SILENT_MODE_AUTO) update_currents(); b88e: f9 8d ldd r31, Y+25 ; 0x19 b890: f2 30 cpi r31, 0x02 ; 2 b892: d9 f5 brne .+118 ; 0xb90a b894: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb b898: 82 30 cpi r24, 0x02 ; 2 b89a: 09 f0 breq .+2 ; 0xb89e b89c: ee c0 rjmp .+476 ; 0xba7a SERIAL_PROTOCOLLNRPGM(MSG_OK); } #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void update_currents() { float current_high[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; b89e: 8c e0 ldi r24, 0x0C ; 12 b8a0: e0 ea ldi r30, 0xA0 ; 160 b8a2: f2 e0 ldi r31, 0x02 ; 2 b8a4: de 01 movw r26, r28 b8a6: 1d 96 adiw r26, 0x0d ; 13 b8a8: 01 90 ld r0, Z+ b8aa: 0d 92 st X+, r0 b8ac: 8a 95 dec r24 b8ae: e1 f7 brne .-8 ; 0xb8a8 float current_low[3] = DEFAULT_PWM_MOTOR_CURRENT; b8b0: 8c e0 ldi r24, 0x0C ; 12 b8b2: ec ea ldi r30, 0xAC ; 172 b8b4: f2 e0 ldi r31, 0x02 ; 2 b8b6: de 01 movw r26, r28 b8b8: 11 96 adiw r26, 0x01 ; 1 b8ba: 01 90 ld r0, Z+ b8bc: 0d 92 st X+, r0 b8be: 8a 95 dec r24 b8c0: e1 f7 brne .-8 ; 0xb8ba float tmp_motor[3]; //SERIAL_ECHOLNPGM("Currents updated: "); if (destination[Z_AXIS] < Z_SILENT) { b8c2: c0 90 31 06 lds r12, 0x0631 ; 0x800631 b8c6: d0 90 32 06 lds r13, 0x0632 ; 0x800632 b8ca: e0 90 33 06 lds r14, 0x0633 ; 0x800633 b8ce: f0 90 34 06 lds r15, 0x0634 ; 0x800634 b8d2: 20 e0 ldi r18, 0x00 ; 0 b8d4: 30 e0 ldi r19, 0x00 ; 0 b8d6: a9 01 movw r20, r18 b8d8: c7 01 movw r24, r14 b8da: b6 01 movw r22, r12 b8dc: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> b8e0: 87 ff sbrs r24, 7 b8e2: 52 c0 rjmp .+164 ; 0xb988 b8e4: ce 01 movw r24, r28 b8e6: 01 96 adiw r24, 0x01 ; 1 b8e8: 7c 01 movw r14, r24 //SERIAL_ECHOLNPGM("LOW"); for (uint8_t i = 0; i < 3; i++) { b8ea: d1 2c mov r13, r1 st_current_set(i, current_low[i]); b8ec: f7 01 movw r30, r14 b8ee: 61 91 ld r22, Z+ b8f0: 71 91 ld r23, Z+ b8f2: 81 91 ld r24, Z+ b8f4: 91 91 ld r25, Z+ b8f6: 7f 01 movw r14, r30 b8f8: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> b8fc: 8d 2d mov r24, r13 b8fe: 0f 94 13 18 call 0x23026 ; 0x23026 //SERIAL_ECHOLNPGM("Currents updated: "); if (destination[Z_AXIS] < Z_SILENT) { //SERIAL_ECHOLNPGM("LOW"); for (uint8_t i = 0; i < 3; i++) { b902: d3 94 inc r13 b904: f3 e0 ldi r31, 0x03 ; 3 b906: df 12 cpse r13, r31 b908: f1 cf rjmp .-30 ; 0xb8ec } } #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) { b90a: f9 8d ldd r31, Y+25 ; 0x19 b90c: ff 5f subi r31, 0xFF ; 255 b90e: f9 8f std Y+25, r31 ; 0x19 b910: 8a 8d ldd r24, Y+26 ; 0x1a b912: 88 0f add r24, r24 b914: 8a 8f std Y+26, r24 ; 0x1a b916: 94 e0 ldi r25, 0x04 ; 4 b918: 29 0e add r2, r25 b91a: 31 1c adc r3, r1 b91c: 0c 5f subi r16, 0xFC ; 252 b91e: 1f 4f sbci r17, 0xFF ; 255 b920: f4 30 cpi r31, 0x04 ; 4 b922: 09 f0 breq .+2 ; 0xb926 b924: 40 cf rjmp .-384 ; 0xb7a6 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')) { b926: 86 e4 ldi r24, 0x46 ; 70 b928: 0e 94 f5 55 call 0xabea ; 0xabea b92c: 88 23 and r24, r24 b92e: 99 f0 breq .+38 ; 0xb956 const float next_feedrate = code_value(); b930: 0e 94 85 5a call 0xb50a ; 0xb50a b934: 6b 01 movw r12, r22 b936: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; b938: 20 e0 ldi r18, 0x00 ; 0 b93a: 30 e0 ldi r19, 0x00 ; 0 b93c: a9 01 movw r20, r18 b93e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> b942: 18 16 cp r1, r24 b944: 44 f4 brge .+16 ; 0xb956 b946: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a b94a: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b b94e: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c b952: f0 92 7d 02 sts 0x027D, r15 ; 0x80027d } } b956: a1 96 adiw r28, 0x21 ; 33 b958: 0f b6 in r0, 0x3f ; 63 b95a: f8 94 cli b95c: de bf out 0x3e, r29 ; 62 b95e: 0f be out 0x3f, r0 ; 63 b960: cd bf out 0x3d, r28 ; 61 b962: df 91 pop r29 b964: cf 91 pop r28 b966: 1f 91 pop r17 b968: 0f 91 pop r16 b96a: ff 90 pop r15 b96c: ef 90 pop r14 b96e: df 90 pop r13 b970: cf 90 pop r12 b972: bf 90 pop r11 b974: af 90 pop r10 b976: 9f 90 pop r9 b978: 8f 90 pop r8 b97a: 7f 90 pop r7 b97c: 6f 90 pop r6 b97e: 5f 90 pop r5 b980: 4f 90 pop r4 b982: 3f 90 pop r3 b984: 2f 90 pop r2 b986: 08 95 ret /*MYSERIAL.print(int(i)); SERIAL_ECHOPGM(": "); MYSERIAL.println(current_low[i]);*/ } } else if (destination[Z_AXIS] > Z_HIGH_POWER) { b988: 20 e0 ldi r18, 0x00 ; 0 b98a: 30 e0 ldi r19, 0x00 ; 0 b98c: 48 e4 ldi r20, 0x48 ; 72 b98e: 53 e4 ldi r21, 0x43 ; 67 b990: c7 01 movw r24, r14 b992: b6 01 movw r22, r12 b994: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> b998: 18 16 cp r1, r24 b99a: a4 f4 brge .+40 ; 0xb9c4 b99c: ce 01 movw r24, r28 b99e: 0d 96 adiw r24, 0x0d ; 13 b9a0: 7c 01 movw r14, r24 //SERIAL_ECHOLNPGM("HIGH"); for (uint8_t i = 0; i < 3; i++) { b9a2: d1 2c mov r13, r1 st_current_set(i, current_high[i]); b9a4: f7 01 movw r30, r14 b9a6: 61 91 ld r22, Z+ b9a8: 71 91 ld r23, Z+ b9aa: 81 91 ld r24, Z+ b9ac: 91 91 ld r25, Z+ b9ae: 7f 01 movw r14, r30 b9b0: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> b9b4: 8d 2d mov r24, r13 b9b6: 0f 94 13 18 call 0x23026 ; 0x23026 MYSERIAL.println(current_low[i]);*/ } } else if (destination[Z_AXIS] > Z_HIGH_POWER) { //SERIAL_ECHOLNPGM("HIGH"); for (uint8_t i = 0; i < 3; i++) { b9ba: d3 94 inc r13 b9bc: f3 e0 ldi r31, 0x03 ; 3 b9be: df 12 cpse r13, r31 b9c0: f1 cf rjmp .-30 ; 0xb9a4 b9c2: a3 cf rjmp .-186 ; 0xb90a b9c4: ce 01 movw r24, r28 b9c6: 01 96 adiw r24, 0x01 ; 1 b9c8: 99 a3 std Y+33, r25 ; 0x21 b9ca: 88 a3 std Y+32, r24 ; 0x20 b9cc: fe 01 movw r30, r28 b9ce: 3d 96 adiw r30, 0x0d ; 13 b9d0: ff 8f std Y+31, r31 ; 0x1f b9d2: ee 8f std Y+30, r30 ; 0x1e SERIAL_ECHOPGM(": "); MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { b9d4: 1b 8e std Y+27, r1 ; 0x1b float q = current_low[i] - Z_SILENT*((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT)); b9d6: e8 a1 ldd r30, Y+32 ; 0x20 b9d8: f9 a1 ldd r31, Y+33 ; 0x21 b9da: c1 90 ld r12, Z+ b9dc: d1 90 ld r13, Z+ b9de: e1 90 ld r14, Z+ b9e0: f1 90 ld r15, Z+ b9e2: f9 a3 std Y+33, r31 ; 0x21 b9e4: e8 a3 std Y+32, r30 ; 0x20 b9e6: ee 8d ldd r30, Y+30 ; 0x1e b9e8: ff 8d ldd r31, Y+31 ; 0x1f b9ea: 61 91 ld r22, Z+ b9ec: 71 91 ld r23, Z+ b9ee: 81 91 ld r24, Z+ b9f0: 91 91 ld r25, Z+ b9f2: ff 8f std Y+31, r31 ; 0x1f b9f4: ee 8f std Y+30, r30 ; 0x1e b9f6: a7 01 movw r20, r14 b9f8: 96 01 movw r18, r12 b9fa: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> b9fe: 20 e0 ldi r18, 0x00 ; 0 ba00: 30 e0 ldi r19, 0x00 ; 0 ba02: 48 e4 ldi r20, 0x48 ; 72 ba04: 53 e4 ldi r21, 0x43 ; 67 ba06: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> ba0a: 4b 01 movw r8, r22 ba0c: 5c 01 movw r10, r24 tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q; ba0e: 20 91 31 06 lds r18, 0x0631 ; 0x800631 ba12: 30 91 32 06 lds r19, 0x0632 ; 0x800632 ba16: 40 91 33 06 lds r20, 0x0633 ; 0x800633 ba1a: 50 91 34 06 lds r21, 0x0634 ; 0x800634 ba1e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> ba22: 2b 01 movw r4, r22 ba24: 3c 01 movw r6, r24 MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { float q = current_low[i] - Z_SILENT*((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT)); ba26: 20 e0 ldi r18, 0x00 ; 0 ba28: 30 e0 ldi r19, 0x00 ; 0 ba2a: a9 01 movw r20, r18 ba2c: c5 01 movw r24, r10 ba2e: b4 01 movw r22, r8 ba30: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> ba34: 9b 01 movw r18, r22 ba36: ac 01 movw r20, r24 ba38: c7 01 movw r24, r14 ba3a: b6 01 movw r22, r12 ba3c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> ba40: 9b 01 movw r18, r22 ba42: ac 01 movw r20, r24 tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q; ba44: c3 01 movw r24, r6 ba46: b2 01 movw r22, r4 ba48: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> st_current_set(i, tmp_motor[i]); ba4c: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> ba50: 8b 8d ldd r24, Y+27 ; 0x1b ba52: 0f 94 13 18 call 0x23026 ; 0x23026 SERIAL_ECHOPGM(": "); MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { ba56: fb 8d ldd r31, Y+27 ; 0x1b ba58: ff 5f subi r31, 0xFF ; 255 ba5a: fb 8f std Y+27, r31 ; 0x1b ba5c: f3 30 cpi r31, 0x03 ; 3 ba5e: 09 f0 breq .+2 ; 0xba62 ba60: ba cf rjmp .-140 ; 0xb9d6 ba62: 53 cf rjmp .-346 ; 0xb90a 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? ba64: f1 01 movw r30, r2 ba66: 80 81 ld r24, Z ba68: 91 81 ldd r25, Z+1 ; 0x01 ba6a: a2 81 ldd r26, Z+2 ; 0x02 ba6c: b3 81 ldd r27, Z+3 ; 0x03 ba6e: f8 01 movw r30, r16 ba70: 80 83 st Z, r24 ba72: 91 83 std Z+1, r25 ; 0x01 ba74: a2 83 std Z+2, r26 ; 0x02 ba76: b3 83 std Z+3, r27 ; 0x03 ba78: 48 cf rjmp .-368 ; 0xb90a } } #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) { ba7a: ea 8d ldd r30, Y+26 ; 0x1a ba7c: ee 0f add r30, r30 ba7e: ea 8f std Y+26, r30 ; 0x1a ba80: f4 e0 ldi r31, 0x04 ; 4 ba82: 2f 0e add r2, r31 ba84: 31 1c adc r3, r1 ba86: 0c 5f subi r16, 0xFC ; 252 ba88: 1f 4f sbci r17, 0xFF ; 255 ba8a: 83 e0 ldi r24, 0x03 ; 3 ba8c: 89 8f std Y+25, r24 ; 0x19 ba8e: 8b ce rjmp .-746 ; 0xb7a6 0000ba90 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); ba90: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> ba94: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> ba98: 90 e0 ldi r25, 0x00 ; 0 ba9a: 8a 30 cpi r24, 0x0A ; 10 ba9c: 20 f0 brcs .+8 ; 0xbaa6 ba9e: 89 5a subi r24, 0xA9 ; 169 baa0: 9f 4f sbci r25, 0xFF ; 255 baa2: 0d 94 05 a2 jmp 0x3440a ; 0x3440a baa6: c0 96 adiw r24, 0x30 ; 48 baa8: fc cf rjmp .-8 ; 0xbaa2 0000baaa : 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); baaa: 2f b7 in r18, 0x3f ; 63 baac: 84 ff sbrs r24, 4 baae: 1e c0 rjmp .+60 ; 0xbaec bab0: f8 94 cli bab2: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bab6: 92 60 ori r25, 0x02 ; 2 bab8: 90 93 05 01 sts 0x0105, r25 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> babc: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D5, value & 0x20); babe: 2f b7 in r18, 0x3f ; 63 bac0: 85 ff sbrs r24, 5 bac2: 19 c0 rjmp .+50 ; 0xbaf6 bac4: f8 94 cli bac6: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> baca: 91 60 ori r25, 0x01 ; 1 bacc: 90 93 05 01 sts 0x0105, r25 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bad0: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D6, value & 0x40); bad2: 86 ff sbrs r24, 6 bad4: 15 c0 rjmp .+42 ; 0xbb00 bad6: 45 9a sbi 0x08, 5 ; 8 WRITE(LCD_PINS_D7, value & 0x80); bad8: 87 ff sbrs r24, 7 bada: 14 c0 rjmp .+40 ; 0xbb04 badc: 46 9a sbi 0x08, 6 ; 8 static void lcd_print_custom(uint8_t c); static void lcd_invalidate_custom_characters(); static void lcd_pulseEnable(void) { WRITE(LCD_PINS_ENABLE,HIGH); bade: 73 9a sbi 0x0e, 3 ; 14 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); bae0: 85 e0 ldi r24, 0x05 ; 5 bae2: 8a 95 dec r24 bae4: f1 f7 brne .-4 ; 0xbae2 bae6: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); bae8: 73 98 cbi 0x0e, 3 ; 14 WRITE(LCD_PINS_D5, value & 0x20); WRITE(LCD_PINS_D6, value & 0x40); WRITE(LCD_PINS_D7, value & 0x80); lcd_pulseEnable(); } baea: 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); baec: f8 94 cli baee: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> baf2: 9d 7f andi r25, 0xFD ; 253 baf4: e1 cf rjmp .-62 ; 0xbab8 WRITE(LCD_PINS_D5, value & 0x20); baf6: f8 94 cli baf8: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bafc: 9e 7f andi r25, 0xFE ; 254 bafe: e6 cf rjmp .-52 ; 0xbacc WRITE(LCD_PINS_D6, value & 0x40); bb00: 45 98 cbi 0x08, 5 ; 8 bb02: ea cf rjmp .-44 ; 0xbad8 WRITE(LCD_PINS_D7, value & 0x80); bb04: 46 98 cbi 0x08, 6 ; 8 bb06: eb cf rjmp .-42 ; 0xbade 0000bb08 : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { bb08: 0f 93 push r16 bb0a: 1f 93 push r17 bb0c: cf 93 push r28 bb0e: df 93 push r29 bb10: c8 2f mov r28, r24 bb12: d6 2f mov r29, r22 bb14: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); bb16: 60 ff sbrs r22, 0 bb18: 15 c0 rjmp .+42 ; 0xbb44 bb1a: 5f 9a sbi 0x0b, 7 ; 11 bb1c: 8a e1 ldi r24, 0x1A ; 26 bb1e: 8a 95 dec r24 bb20: f1 f7 brne .-4 ; 0xbb1e bb22: 00 c0 rjmp .+0 ; 0xbb24 _delay_us(5); lcd_writebits(data); bb24: 8c 2f mov r24, r28 bb26: 0e 94 55 5d call 0xbaaa ; 0xbaaa #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { bb2a: d1 fd sbrc r29, 1 bb2c: 04 c0 rjmp .+8 ; 0xbb36 // _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 bb2e: 8c 2f mov r24, r28 bb30: 82 95 swap r24 bb32: 0e 94 55 5d call 0xbaaa ; 0xbaaa } #endif delayMicroseconds(duration); bb36: c8 01 movw r24, r16 } bb38: df 91 pop r29 bb3a: cf 91 pop r28 bb3c: 1f 91 pop r17 bb3e: 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); bb40: 0c 94 cc d0 jmp 0x1a198 ; 0x1a198 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); bb44: 5f 98 cbi 0x0b, 7 ; 11 bb46: ea cf rjmp .-44 ; 0xbb1c 0000bb48 : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { bb48: cf 92 push r12 bb4a: df 92 push r13 bb4c: ef 92 push r14 bb4e: ff 92 push r15 bb50: cf 93 push r28 bb52: df 93 push r29 bb54: ec 01 movw r28, r24 bb56: 6a 01 movw r12, r20 bb58: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) bb5a: 0f 94 a5 a3 call 0x3474a ; 0x3474a bb5e: 6f 3f cpi r22, 0xFF ; 255 bb60: 7f 4f sbci r23, 0xFF ; 255 bb62: 8f 4f sbci r24, 0xFF ; 255 bb64: 9f 4f sbci r25, 0xFF ; 255 bb66: 59 f4 brne .+22 ; 0xbb7e 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); bb68: b7 01 movw r22, r14 bb6a: a6 01 movw r20, r12 bb6c: 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); } bb6e: df 91 pop r29 bb70: cf 91 pop r28 bb72: ff 90 pop r15 bb74: ef 90 pop r14 bb76: df 90 pop r13 bb78: 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); bb7a: 0d 94 f3 a3 jmp 0x347e6 ; 0x347e6 } 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); } bb7e: df 91 pop r29 bb80: cf 91 pop r28 bb82: ff 90 pop r15 bb84: ef 90 pop r14 bb86: df 90 pop r13 bb88: cf 90 pop r12 bb8a: 08 95 ret 0000bb8c : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { bb8c: 7f 92 push r7 bb8e: 8f 92 push r8 bb90: 9f 92 push r9 bb92: af 92 push r10 bb94: bf 92 push r11 bb96: cf 92 push r12 bb98: df 92 push r13 bb9a: ef 92 push r14 bb9c: ff 92 push r15 bb9e: 0f 93 push r16 bba0: 1f 93 push r17 bba2: cf 93 push r28 bba4: df 93 push r29 bba6: cd b7 in r28, 0x3d ; 61 bba8: de b7 in r29, 0x3e ; 62 bbaa: 60 97 sbiw r28, 0x10 ; 16 bbac: 0f b6 in r0, 0x3f ; 63 bbae: f8 94 cli bbb0: de bf out 0x3e, r29 ; 62 bbb2: 0f be out 0x3f, r0 ; 63 bbb4: cd bf out 0x3d, r28 ; 61 bbb6: 5c 01 movw r10, r24 bbb8: 6b 01 movw r12, r22 bbba: 74 2e mov r7, r20 KEEPALIVE_STATE(NOT_BUSY); bbbc: 81 e0 ldi r24, 0x01 ; 1 bbbe: 80 93 78 02 sts 0x0278, r24 ; 0x800278 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); bbc2: 1f 93 push r17 bbc4: 0f 93 push r16 bbc6: 1f 92 push r1 bbc8: 2f 93 push r18 bbca: 8d e8 ldi r24, 0x8D ; 141 bbcc: 93 e6 ldi r25, 0x63 ; 99 bbce: 9f 93 push r25 bbd0: 8f 93 push r24 bbd2: 0f 94 5f a2 call 0x344be ; 0x344be daddr_t count = -1; // RW the entire space by default if (code_seen('A')) bbd6: 81 e4 ldi r24, 0x41 ; 65 bbd8: 0e 94 f5 55 call 0xabea ; 0xabea bbdc: 0f 90 pop r0 bbde: 0f 90 pop r0 bbe0: 0f 90 pop r0 bbe2: 0f 90 pop r0 bbe4: 0f 90 pop r0 bbe6: 0f 90 pop r0 bbe8: 88 23 and r24, r24 bbea: 89 f0 breq .+34 ; 0xbc0e addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); bbec: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb bbf0: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc bbf4: fc 01 movw r30, r24 bbf6: 21 81 ldd r18, Z+1 ; 0x01 bbf8: 28 37 cpi r18, 0x78 ; 120 bbfa: 09 f0 breq .+2 ; 0xbbfe bbfc: 56 c0 rjmp .+172 ; 0xbcaa bbfe: 40 e1 ldi r20, 0x10 ; 16 bc00: 50 e0 ldi r21, 0x00 ; 0 bc02: 70 e0 ldi r23, 0x00 ; 0 bc04: 60 e0 ldi r22, 0x00 ; 0 bc06: 02 96 adiw r24, 0x02 ; 2 bc08: 0f 94 28 9f call 0x33e50 ; 0x33e50 bc0c: 5b 01 movw r10, r22 if (code_seen('C')) bc0e: 83 e4 ldi r24, 0x43 ; 67 bc10: 0e 94 f5 55 call 0xabea ; 0xabea bc14: 88 23 and r24, r24 bc16: 09 f4 brne .+2 ; 0xbc1a bc18: 4d c0 rjmp .+154 ; 0xbcb4 count = code_value_long(); bc1a: 0e 94 5d 56 call 0xacba ; 0xacba bc1e: 4b 01 movw r8, r22 bc20: 75 01 movw r14, r10 bc22: ca 14 cp r12, r10 bc24: db 04 cpc r13, r11 bc26: 08 f4 brcc .+2 ; 0xbc2a bc28: 76 01 movw r14, r12 if (addr_start > addr_end) addr_start = addr_end; if ((addr_start + count) > addr_end || (addr_start + count) < addr_start) bc2a: c4 01 movw r24, r8 bc2c: 8e 0d add r24, r14 bc2e: 9f 1d adc r25, r15 bc30: c8 16 cp r12, r24 bc32: d9 06 cpc r13, r25 bc34: 18 f0 brcs .+6 ; 0xbc3c bc36: 8e 15 cp r24, r14 bc38: 9f 05 cpc r25, r15 bc3a: 18 f4 brcc .+6 ; 0xbc42 count = addr_end - addr_start; bc3c: 46 01 movw r8, r12 bc3e: 8e 18 sub r8, r14 bc40: 9f 08 sbc r9, r15 if (code_seen('X')) bc42: 88 e5 ldi r24, 0x58 ; 88 bc44: 0e 94 f5 55 call 0xabea ; 0xabea bc48: 88 23 and r24, r24 bc4a: 09 f4 brne .+2 ; 0xbc4e bc4c: 71 c0 rjmp .+226 ; 0xbd30 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); bc4e: 20 91 bb 04 lds r18, 0x04BB ; 0x8004bb bc52: 30 91 bc 04 lds r19, 0x04BC ; 0x8004bc bc56: 2f 5f subi r18, 0xFF ; 255 bc58: 3f 4f sbci r19, 0xFF ; 255 bc5a: ce 01 movw r24, r28 bc5c: 01 96 adiw r24, 0x01 ; 1 bc5e: 5c 01 movw r10, r24 bc60: dc 01 movw r26, r24 print_hex_byte(val & 0xFF); } int parse_hex(const char* hex, uint8_t* data, int count) { int parsed = 0; bc62: d1 2c mov r13, r1 bc64: c1 2c mov r12, r1 bc66: f9 01 movw r30, r18 while (*hex) bc68: 80 81 ld r24, Z bc6a: 2f 5f subi r18, 0xFF ; 255 bc6c: 3f 4f sbci r19, 0xFF ; 255 bc6e: 88 23 and r24, r24 bc70: b9 f1 breq .+110 ; 0xbce0 { if (count && (parsed >= count)) break; bc72: 90 e1 ldi r25, 0x10 ; 16 bc74: c9 16 cp r12, r25 bc76: d1 04 cpc r13, r1 bc78: 99 f1 breq .+102 ; 0xbce0 char c = *(hex++); if (c == ' ') continue; bc7a: 80 32 cpi r24, 0x20 ; 32 bc7c: a1 f3 breq .-24 ; 0xbc66 if (c == '\n') break; bc7e: 8a 30 cpi r24, 0x0A ; 10 bc80: 79 f1 breq .+94 ; 0xbce0 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); bc82: 90 ed ldi r25, 0xD0 ; 208 bc84: 98 0f add r25, r24 bc86: 9a 30 cpi r25, 0x0A ; 10 bc88: c8 f4 brcc .+50 ; 0xbcbc bc8a: 82 95 swap r24 bc8c: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); bc8e: 9f 01 movw r18, r30 bc90: 2e 5f subi r18, 0xFE ; 254 bc92: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); bc94: 91 81 ldd r25, Z+1 ; 0x01 bc96: 40 ed ldi r20, 0xD0 ; 208 bc98: 49 0f add r20, r25 bc9a: 4a 30 cpi r20, 0x0A ; 10 bc9c: b8 f4 brcc .+46 ; 0xbccc bc9e: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; bca0: 8d 93 st X+, r24 parsed++; bca2: ef ef ldi r30, 0xFF ; 255 bca4: ce 1a sub r12, r30 bca6: de 0a sbc r13, r30 bca8: de cf rjmp .-68 ; 0xbc66 { 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(); bcaa: 0e 94 85 5a call 0xb50a ; 0xb50a bcae: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> bcb2: ac cf rjmp .-168 ; 0xbc0c 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 bcb4: 88 24 eor r8, r8 bcb6: 8a 94 dec r8 bcb8: 98 2c mov r9, r8 bcba: b2 cf rjmp .-156 ; 0xbc20 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); bcbc: 9f e9 ldi r25, 0x9F ; 159 bcbe: 98 0f add r25, r24 bcc0: 96 30 cpi r25, 0x06 ; 6 bcc2: 58 f4 brcc .+22 ; 0xbcda bcc4: 82 95 swap r24 bcc6: 80 7f andi r24, 0xF0 ; 240 bcc8: 80 57 subi r24, 0x70 ; 112 bcca: e1 cf rjmp .-62 ; 0xbc8e else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); bccc: 4f e9 ldi r20, 0x9F ; 159 bcce: 49 0f add r20, r25 bcd0: 46 30 cpi r20, 0x06 ; 6 bcd2: 18 f4 brcc .+6 ; 0xbcda bcd4: 97 55 subi r25, 0x57 ; 87 bcd6: 89 2b or r24, r25 bcd8: e3 cf rjmp .-58 ; 0xbca0 else return -parsed; bcda: d1 94 neg r13 bcdc: c1 94 neg r12 bcde: d1 08 sbc r13, r1 } // 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++) bce0: 91 2c mov r9, r1 bce2: 81 2c mov r8, r1 bce4: c8 14 cp r12, r8 bce6: d9 04 cpc r13, r9 bce8: 91 f0 breq .+36 ; 0xbd0e bcea: f5 01 movw r30, r10 bcec: 61 91 ld r22, Z+ bcee: 5f 01 movw r10, r30 bcf0: c4 01 movw r24, r8 bcf2: 8e 0d add r24, r14 bcf4: 9f 1d adc r25, r15 { switch (type) bcf6: f1 e0 ldi r31, 0x01 ; 1 bcf8: 7f 16 cp r7, r31 bcfa: 31 f0 breq .+12 ; 0xbd08 { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; bcfc: fc 01 movw r30, r24 bcfe: 60 83 st Z, r22 } // 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++) bd00: ff ef ldi r31, 0xFF ; 255 bd02: 8f 1a sub r8, r31 bd04: 9f 0a sbc r9, r31 bd06: ee cf rjmp .-36 ; 0xbce4 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); bd08: 0f 94 e5 a3 call 0x347ca ; 0x347ca bd0c: f9 cf rjmp .-14 ; 0xbd00 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); #else DBG(_N("%u bytes written to %S at address 0x%08x\n"), count, type_desc, addr_start); bd0e: ff 92 push r15 bd10: ef 92 push r14 bd12: 1f 93 push r17 bd14: 0f 93 push r16 bd16: 9f 92 push r9 bd18: 8f 92 push r8 bd1a: 83 e6 ldi r24, 0x63 ; 99 bd1c: 93 e6 ldi r25, 0x63 ; 99 bd1e: 9f 93 push r25 bd20: 8f 93 push r24 bd22: 0f 94 5f a2 call 0x344be ; 0x344be bd26: 0f b6 in r0, 0x3f ; 63 bd28: f8 94 cli bd2a: de bf out 0x3e, r29 ; 62 bd2c: 0f be out 0x3f, r0 ; 63 bd2e: cd bf out 0x3d, r28 ; 61 #endif } print_mem(addr_start, count, type); bd30: 47 2d mov r20, r7 bd32: b4 01 movw r22, r8 bd34: c7 01 movw r24, r14 } bd36: 60 96 adiw r28, 0x10 ; 16 bd38: 0f b6 in r0, 0x3f ; 63 bd3a: f8 94 cli bd3c: de bf out 0x3e, r29 ; 62 bd3e: 0f be out 0x3f, r0 ; 63 bd40: cd bf out 0x3d, r28 ; 61 bd42: df 91 pop r29 bd44: cf 91 pop r28 bd46: 1f 91 pop r17 bd48: 0f 91 pop r16 bd4a: ff 90 pop r15 bd4c: ef 90 pop r14 bd4e: df 90 pop r13 bd50: cf 90 pop r12 bd52: bf 90 pop r11 bd54: af 90 pop r10 bd56: 9f 90 pop r9 bd58: 8f 90 pop r8 bd5a: 7f 90 pop r7 DBG(_N("%lu bytes written to %S at address 0x%04lx\n"), count, type_desc, addr_start); #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); bd5c: 0d 94 8f 78 jmp 0x2f11e ; 0x2f11e 0000bd60 : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); bd60: 68 2f mov r22, r24 bd62: 70 e0 ldi r23, 0x00 ; 0 bd64: 90 e0 ldi r25, 0x00 ; 0 bd66: 80 e0 ldi r24, 0x00 ; 0 bd68: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> bd6c: 20 e0 ldi r18, 0x00 ; 0 bd6e: 30 e0 ldi r19, 0x00 ; 0 bd70: 48 e0 ldi r20, 0x08 ; 8 bd72: 52 e4 ldi r21, 0x42 ; 66 bd74: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> bd78: 20 e0 ldi r18, 0x00 ; 0 bd7a: 30 e0 ldi r19, 0x00 ; 0 bd7c: 40 e8 ldi r20, 0x80 ; 128 bd7e: 5f e3 ldi r21, 0x3F ; 63 bd80: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> } bd84: 08 95 ret 0000bd86 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); bd86: 82 e0 ldi r24, 0x02 ; 2 bd88: 0f 94 9c 18 call 0x23138 ; 0x23138 bd8c: 60 93 69 12 sts 0x1269, r22 ; 0x801269 bd90: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a bd94: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b bd98: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_z_position(current_position[Z_AXIS]); bd9c: 89 e6 ldi r24, 0x69 ; 105 bd9e: 92 e1 ldi r25, 0x12 ; 18 bda0: 0d 94 95 3a jmp 0x2752a ; 0x2752a 0000bda4 : * 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() { bda4: 4f 92 push r4 bda6: 5f 92 push r5 bda8: 6f 92 push r6 bdaa: 7f 92 push r7 bdac: 8f 92 push r8 bdae: 9f 92 push r9 bdb0: af 92 push r10 bdb2: bf 92 push r11 bdb4: cf 92 push r12 bdb6: df 92 push r13 bdb8: ef 92 push r14 bdba: ff 92 push r15 bdbc: 0f 93 push r16 bdbe: 1f 93 push r17 bdc0: cf 93 push r28 bdc2: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; bdc4: 01 e6 ldi r16, 0x61 ; 97 bdc6: 12 e1 ldi r17, 0x12 ; 18 bdc8: ca e9 ldi r28, 0x9A ; 154 bdca: d4 e0 ldi r29, 0x04 ; 4 bdcc: 28 81 ld r18, Y bdce: 39 81 ldd r19, Y+1 ; 0x01 bdd0: 4a 81 ldd r20, Y+2 ; 0x02 bdd2: 5b 81 ldd r21, Y+3 ; 0x03 bdd4: f8 01 movw r30, r16 bdd6: 60 81 ld r22, Z bdd8: 71 81 ldd r23, Z+1 ; 0x01 bdda: 82 81 ldd r24, Z+2 ; 0x02 bddc: 93 81 ldd r25, Z+3 ; 0x03 bdde: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> bde2: 4b 01 movw r8, r22 bde4: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; bde6: 2c 81 ldd r18, Y+4 ; 0x04 bde8: 3d 81 ldd r19, Y+5 ; 0x05 bdea: 4e 81 ldd r20, Y+6 ; 0x06 bdec: 5f 81 ldd r21, Y+7 ; 0x07 bdee: f8 01 movw r30, r16 bdf0: 64 81 ldd r22, Z+4 ; 0x04 bdf2: 75 81 ldd r23, Z+5 ; 0x05 bdf4: 86 81 ldd r24, Z+6 ; 0x06 bdf6: 97 81 ldd r25, Z+7 ; 0x07 bdf8: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> bdfc: 6b 01 movw r12, r22 bdfe: 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; be00: ca e8 ldi r28, 0x8A ; 138 be02: d4 e0 ldi r29, 0x04 ; 4 be04: 28 81 ld r18, Y be06: 39 81 ldd r19, Y+1 ; 0x01 be08: 4a 81 ldd r20, Y+2 ; 0x02 be0a: 5b 81 ldd r21, Y+3 ; 0x03 be0c: c5 01 movw r24, r10 be0e: b4 01 movw r22, r8 be10: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> be14: 2b 01 movw r4, r22 be16: 3c 01 movw r6, r24 be18: 2c 81 ldd r18, Y+4 ; 0x04 be1a: 3d 81 ldd r19, Y+5 ; 0x05 be1c: 4e 81 ldd r20, Y+6 ; 0x06 be1e: 5f 81 ldd r21, Y+7 ; 0x07 be20: c7 01 movw r24, r14 be22: b6 01 movw r22, r12 be24: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> be28: 9b 01 movw r18, r22 be2a: ac 01 movw r20, r24 be2c: c3 01 movw r24, r6 be2e: b2 01 movw r22, r4 be30: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> be34: f8 01 movw r30, r16 be36: 60 83 st Z, r22 be38: 71 83 std Z+1, r23 ; 0x01 be3a: 82 83 std Z+2, r24 ; 0x02 be3c: 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; be3e: 28 85 ldd r18, Y+8 ; 0x08 be40: 39 85 ldd r19, Y+9 ; 0x09 be42: 4a 85 ldd r20, Y+10 ; 0x0a be44: 5b 85 ldd r21, Y+11 ; 0x0b be46: c5 01 movw r24, r10 be48: b4 01 movw r22, r8 be4a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> be4e: 4b 01 movw r8, r22 be50: 5c 01 movw r10, r24 be52: 2c 85 ldd r18, Y+12 ; 0x0c be54: 3d 85 ldd r19, Y+13 ; 0x0d be56: 4e 85 ldd r20, Y+14 ; 0x0e be58: 5f 85 ldd r21, Y+15 ; 0x0f be5a: c7 01 movw r24, r14 be5c: b6 01 movw r22, r12 be5e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> be62: 9b 01 movw r18, r22 be64: ac 01 movw r20, r24 be66: c5 01 movw r24, r10 be68: b4 01 movw r22, r8 be6a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> be6e: f8 01 movw r30, r16 be70: 64 83 std Z+4, r22 ; 0x04 be72: 75 83 std Z+5, r23 ; 0x05 be74: 86 83 std Z+6, r24 ; 0x06 be76: 97 83 std Z+7, r25 ; 0x07 } be78: df 91 pop r29 be7a: cf 91 pop r28 be7c: 1f 91 pop r17 be7e: 0f 91 pop r16 be80: ff 90 pop r15 be82: ef 90 pop r14 be84: df 90 pop r13 be86: cf 90 pop r12 be88: bf 90 pop r11 be8a: af 90 pop r10 be8c: 9f 90 pop r9 be8e: 8f 90 pop r8 be90: 7f 90 pop r7 be92: 6f 90 pop r6 be94: 5f 90 pop r5 be96: 4f 90 pop r4 be98: 08 95 ret 0000be9a : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { be9a: 4f 92 push r4 be9c: 5f 92 push r5 be9e: 6f 92 push r6 bea0: 7f 92 push r7 bea2: 8f 92 push r8 bea4: 9f 92 push r9 bea6: af 92 push r10 bea8: bf 92 push r11 beaa: cf 92 push r12 beac: df 92 push r13 beae: ef 92 push r14 beb0: ff 92 push r15 beb2: 0f 93 push r16 beb4: 1f 93 push r17 beb6: cf 93 push r28 beb8: df 93 push r29 beba: 00 d0 rcall .+0 ; 0xbebc bebc: 00 d0 rcall .+0 ; 0xbebe bebe: 1f 92 push r1 bec0: 1f 92 push r1 bec2: cd b7 in r28, 0x3d ; 61 bec4: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; bec6: dc 01 movw r26, r24 bec8: cd 90 ld r12, X+ beca: dd 90 ld r13, X+ becc: ed 90 ld r14, X+ bece: fc 90 ld r15, X bed0: 13 97 sbiw r26, 0x03 ; 3 bed2: c0 92 6f 03 sts 0x036F, r12 ; 0x80036f bed6: d0 92 70 03 sts 0x0370, r13 ; 0x800370 beda: e0 92 71 03 sts 0x0371, r14 ; 0x800371 bede: f0 92 72 03 sts 0x0372, r15 ; 0x800372 world2machine_rotation_and_skew[1][0] = vec_x[1]; bee2: 14 96 adiw r26, 0x04 ; 4 bee4: 0d 91 ld r16, X+ bee6: 1d 91 ld r17, X+ bee8: 2d 91 ld r18, X+ beea: 3c 91 ld r19, X beec: 17 97 sbiw r26, 0x07 ; 7 beee: 09 83 std Y+1, r16 ; 0x01 bef0: 1a 83 std Y+2, r17 ; 0x02 bef2: 2b 83 std Y+3, r18 ; 0x03 bef4: 3c 83 std Y+4, r19 ; 0x04 bef6: 00 93 77 03 sts 0x0377, r16 ; 0x800377 befa: 10 93 78 03 sts 0x0378, r17 ; 0x800378 befe: 20 93 79 03 sts 0x0379, r18 ; 0x800379 bf02: 30 93 7a 03 sts 0x037A, r19 ; 0x80037a world2machine_rotation_and_skew[0][1] = vec_y[0]; bf06: db 01 movw r26, r22 bf08: 0d 91 ld r16, X+ bf0a: 1d 91 ld r17, X+ bf0c: 2d 91 ld r18, X+ bf0e: 3c 91 ld r19, X bf10: 13 97 sbiw r26, 0x03 ; 3 bf12: 0d 83 std Y+5, r16 ; 0x05 bf14: 1e 83 std Y+6, r17 ; 0x06 bf16: 2f 83 std Y+7, r18 ; 0x07 bf18: 38 87 std Y+8, r19 ; 0x08 bf1a: 00 93 73 03 sts 0x0373, r16 ; 0x800373 bf1e: 10 93 74 03 sts 0x0374, r17 ; 0x800374 bf22: 20 93 75 03 sts 0x0375, r18 ; 0x800375 bf26: 30 93 76 03 sts 0x0376, r19 ; 0x800376 world2machine_rotation_and_skew[1][1] = vec_y[1]; bf2a: 14 96 adiw r26, 0x04 ; 4 bf2c: 4d 90 ld r4, X+ bf2e: 5d 90 ld r5, X+ bf30: 6d 90 ld r6, X+ bf32: 7c 90 ld r7, X bf34: 17 97 sbiw r26, 0x07 ; 7 bf36: 40 92 7b 03 sts 0x037B, r4 ; 0x80037b bf3a: 50 92 7c 03 sts 0x037C, r5 ; 0x80037c bf3e: 60 92 7d 03 sts 0x037D, r6 ; 0x80037d bf42: 70 92 7e 03 sts 0x037E, r7 ; 0x80037e world2machine_shift[0] = cntr[0]; bf46: fa 01 movw r30, r20 bf48: 60 81 ld r22, Z bf4a: 71 81 ldd r23, Z+1 ; 0x01 bf4c: 82 81 ldd r24, Z+2 ; 0x02 bf4e: 93 81 ldd r25, Z+3 ; 0x03 bf50: 60 93 9a 04 sts 0x049A, r22 ; 0x80049a bf54: 70 93 9b 04 sts 0x049B, r23 ; 0x80049b bf58: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c bf5c: 90 93 9d 04 sts 0x049D, r25 ; 0x80049d world2machine_shift[1] = cntr[1]; bf60: 84 80 ldd r8, Z+4 ; 0x04 bf62: 95 80 ldd r9, Z+5 ; 0x05 bf64: a6 80 ldd r10, Z+6 ; 0x06 bf66: b7 80 ldd r11, Z+7 ; 0x07 bf68: 80 92 9e 04 sts 0x049E, r8 ; 0x80049e bf6c: 90 92 9f 04 sts 0x049F, r9 ; 0x80049f bf70: a0 92 a0 04 sts 0x04A0, r10 ; 0x8004a0 bf74: b0 92 a1 04 sts 0x04A1, r11 ; 0x8004a1 // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) bf78: 20 e0 ldi r18, 0x00 ; 0 bf7a: 30 e0 ldi r19, 0x00 ; 0 bf7c: a9 01 movw r20, r18 bf7e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> bf82: 81 11 cpse r24, r1 bf84: aa c0 rjmp .+340 ; 0xc0da bf86: 20 e0 ldi r18, 0x00 ; 0 bf88: 30 e0 ldi r19, 0x00 ; 0 bf8a: a9 01 movw r20, r18 bf8c: c5 01 movw r24, r10 bf8e: b4 01 movw r22, r8 bf90: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> bf94: 81 11 cpse r24, r1 bf96: a1 c0 rjmp .+322 ; 0xc0da 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; bf98: 10 92 a2 04 sts 0x04A2, r1 ; 0x8004a2 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 || bf9c: 20 e0 ldi r18, 0x00 ; 0 bf9e: 30 e0 ldi r19, 0x00 ; 0 bfa0: 40 e8 ldi r20, 0x80 ; 128 bfa2: 5f e3 ldi r21, 0x3F ; 63 bfa4: c7 01 movw r24, r14 bfa6: b6 01 movw r22, r12 bfa8: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> bfac: 81 11 cpse r24, r1 bfae: 21 c0 rjmp .+66 ; 0xbff2 bfb0: 20 e0 ldi r18, 0x00 ; 0 bfb2: 30 e0 ldi r19, 0x00 ; 0 bfb4: a9 01 movw r20, r18 bfb6: 6d 81 ldd r22, Y+5 ; 0x05 bfb8: 7e 81 ldd r23, Y+6 ; 0x06 bfba: 8f 81 ldd r24, Y+7 ; 0x07 bfbc: 98 85 ldd r25, Y+8 ; 0x08 bfbe: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> bfc2: 81 11 cpse r24, r1 bfc4: 16 c0 rjmp .+44 ; 0xbff2 bfc6: 20 e0 ldi r18, 0x00 ; 0 bfc8: 30 e0 ldi r19, 0x00 ; 0 bfca: a9 01 movw r20, r18 bfcc: 69 81 ldd r22, Y+1 ; 0x01 bfce: 7a 81 ldd r23, Y+2 ; 0x02 bfd0: 8b 81 ldd r24, Y+3 ; 0x03 bfd2: 9c 81 ldd r25, Y+4 ; 0x04 bfd4: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> bfd8: 81 11 cpse r24, r1 bfda: 0b c0 rjmp .+22 ; 0xbff2 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { bfdc: 20 e0 ldi r18, 0x00 ; 0 bfde: 30 e0 ldi r19, 0x00 ; 0 bfe0: 40 e8 ldi r20, 0x80 ; 128 bfe2: 5f e3 ldi r21, 0x3F ; 63 bfe4: c3 01 movw r24, r6 bfe6: b2 01 movw r22, r4 bfe8: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> bfec: 88 23 and r24, r24 bfee: 09 f4 brne .+2 ; 0xbff2 bff0: 78 c0 rjmp .+240 ; 0xc0e2 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; bff2: 80 91 a2 04 lds r24, 0x04A2 ; 0x8004a2 bff6: 82 60 ori r24, 0x02 ; 2 bff8: 80 93 a2 04 sts 0x04A2, r24 ; 0x8004a2 // 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]; bffc: a3 01 movw r20, r6 bffe: 92 01 movw r18, r4 c000: c7 01 movw r24, r14 c002: b6 01 movw r22, r12 c004: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c008: 4b 01 movw r8, r22 c00a: 5c 01 movw r10, r24 c00c: 2d 81 ldd r18, Y+5 ; 0x05 c00e: 3e 81 ldd r19, Y+6 ; 0x06 c010: 4f 81 ldd r20, Y+7 ; 0x07 c012: 58 85 ldd r21, Y+8 ; 0x08 c014: 69 81 ldd r22, Y+1 ; 0x01 c016: 7a 81 ldd r23, Y+2 ; 0x02 c018: 8b 81 ldd r24, Y+3 ; 0x03 c01a: 9c 81 ldd r25, Y+4 ; 0x04 c01c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c020: 9b 01 movw r18, r22 c022: ac 01 movw r20, r24 c024: c5 01 movw r24, r10 c026: b4 01 movw r22, r8 c028: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> c02c: 4b 01 movw r8, r22 c02e: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; c030: ac 01 movw r20, r24 c032: 9b 01 movw r18, r22 c034: c3 01 movw r24, r6 c036: b2 01 movw r22, r4 c038: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> c03c: 60 93 8a 04 sts 0x048A, r22 ; 0x80048a c040: 70 93 8b 04 sts 0x048B, r23 ; 0x80048b c044: 80 93 8c 04 sts 0x048C, r24 ; 0x80048c c048: 90 93 8d 04 sts 0x048D, r25 ; 0x80048d world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; c04c: 6d 81 ldd r22, Y+5 ; 0x05 c04e: 7e 81 ldd r23, Y+6 ; 0x06 c050: 8f 81 ldd r24, Y+7 ; 0x07 c052: 98 85 ldd r25, Y+8 ; 0x08 c054: 90 58 subi r25, 0x80 ; 128 c056: a5 01 movw r20, r10 c058: 94 01 movw r18, r8 c05a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> c05e: 60 93 8e 04 sts 0x048E, r22 ; 0x80048e c062: 70 93 8f 04 sts 0x048F, r23 ; 0x80048f c066: 80 93 90 04 sts 0x0490, r24 ; 0x800490 c06a: 90 93 91 04 sts 0x0491, r25 ; 0x800491 world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; c06e: 69 81 ldd r22, Y+1 ; 0x01 c070: 7a 81 ldd r23, Y+2 ; 0x02 c072: 8b 81 ldd r24, Y+3 ; 0x03 c074: 9c 81 ldd r25, Y+4 ; 0x04 c076: 90 58 subi r25, 0x80 ; 128 c078: a5 01 movw r20, r10 c07a: 94 01 movw r18, r8 c07c: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> c080: 60 93 92 04 sts 0x0492, r22 ; 0x800492 c084: 70 93 93 04 sts 0x0493, r23 ; 0x800493 c088: 80 93 94 04 sts 0x0494, r24 ; 0x800494 c08c: 90 93 95 04 sts 0x0495, r25 ; 0x800495 world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; c090: a5 01 movw r20, r10 c092: 94 01 movw r18, r8 c094: c7 01 movw r24, r14 c096: b6 01 movw r22, r12 c098: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> c09c: 60 93 96 04 sts 0x0496, r22 ; 0x800496 c0a0: 70 93 97 04 sts 0x0497, r23 ; 0x800497 c0a4: 80 93 98 04 sts 0x0498, r24 ; 0x800498 c0a8: 90 93 99 04 sts 0x0499, r25 ; 0x800499 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; } } c0ac: 28 96 adiw r28, 0x08 ; 8 c0ae: 0f b6 in r0, 0x3f ; 63 c0b0: f8 94 cli c0b2: de bf out 0x3e, r29 ; 62 c0b4: 0f be out 0x3f, r0 ; 63 c0b6: cd bf out 0x3d, r28 ; 61 c0b8: df 91 pop r29 c0ba: cf 91 pop r28 c0bc: 1f 91 pop r17 c0be: 0f 91 pop r16 c0c0: ff 90 pop r15 c0c2: ef 90 pop r14 c0c4: df 90 pop r13 c0c6: cf 90 pop r12 c0c8: bf 90 pop r11 c0ca: af 90 pop r10 c0cc: 9f 90 pop r9 c0ce: 8f 90 pop r8 c0d0: 7f 90 pop r7 c0d2: 6f 90 pop r6 c0d4: 5f 90 pop r5 c0d6: 4f 90 pop r4 c0d8: 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; c0da: 81 e0 ldi r24, 0x01 ; 1 c0dc: 80 93 a2 04 sts 0x04A2, r24 ; 0x8004a2 c0e0: 5d cf rjmp .-326 ; 0xbf9c 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; c0e2: 80 e0 ldi r24, 0x00 ; 0 c0e4: 90 e0 ldi r25, 0x00 ; 0 c0e6: a0 e8 ldi r26, 0x80 ; 128 c0e8: bf e3 ldi r27, 0x3F ; 63 c0ea: 80 93 8a 04 sts 0x048A, r24 ; 0x80048a c0ee: 90 93 8b 04 sts 0x048B, r25 ; 0x80048b c0f2: a0 93 8c 04 sts 0x048C, r26 ; 0x80048c c0f6: b0 93 8d 04 sts 0x048D, r27 ; 0x80048d world2machine_rotation_and_skew_inv[0][1] = 0.f; c0fa: 10 92 8e 04 sts 0x048E, r1 ; 0x80048e c0fe: 10 92 8f 04 sts 0x048F, r1 ; 0x80048f c102: 10 92 90 04 sts 0x0490, r1 ; 0x800490 c106: 10 92 91 04 sts 0x0491, r1 ; 0x800491 world2machine_rotation_and_skew_inv[1][0] = 0.f; c10a: 10 92 92 04 sts 0x0492, r1 ; 0x800492 c10e: 10 92 93 04 sts 0x0493, r1 ; 0x800493 c112: 10 92 94 04 sts 0x0494, r1 ; 0x800494 c116: 10 92 95 04 sts 0x0495, r1 ; 0x800495 world2machine_rotation_and_skew_inv[1][1] = 1.f; c11a: 80 93 96 04 sts 0x0496, r24 ; 0x800496 c11e: 90 93 97 04 sts 0x0497, r25 ; 0x800497 c122: a0 93 98 04 sts 0x0498, r26 ; 0x800498 c126: b0 93 99 04 sts 0x0499, r27 ; 0x800499 c12a: c0 cf rjmp .-128 ; 0xc0ac 0000c12c : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { c12c: 4f 92 push r4 c12e: 5f 92 push r5 c130: 6f 92 push r6 c132: 7f 92 push r7 c134: 8f 92 push r8 c136: 9f 92 push r9 c138: af 92 push r10 c13a: bf 92 push r11 c13c: cf 92 push r12 c13e: df 92 push r13 c140: ef 92 push r14 c142: ff 92 push r15 c144: 1f 93 push r17 c146: cf 93 push r28 c148: df 93 push r29 c14a: cd b7 in r28, 0x3d ; 61 c14c: de b7 in r29, 0x3e ; 62 c14e: a8 97 sbiw r28, 0x28 ; 40 c150: 0f b6 in r0, 0x3f ; 63 c152: f8 94 cli c154: de bf out 0x3e, r29 ; 62 c156: 0f be out 0x3f, r0 ; 63 c158: 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); c15a: 48 e0 ldi r20, 0x08 ; 8 c15c: 50 e0 ldi r21, 0x00 ; 0 c15e: 6d ed ldi r22, 0xDD ; 221 c160: 7f e0 ldi r23, 0x0F ; 15 c162: ce 01 movw r24, r28 c164: 01 96 adiw r24, 0x01 ; 1 c166: 0f 94 8d a3 call 0x3471a ; 0x3471a eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); c16a: 48 e0 ldi r20, 0x08 ; 8 c16c: 50 e0 ldi r21, 0x00 ; 0 c16e: 65 ed ldi r22, 0xD5 ; 213 c170: 7f e0 ldi r23, 0x0F ; 15 c172: ce 01 movw r24, r28 c174: 09 96 adiw r24, 0x09 ; 9 c176: 0f 94 8d a3 call 0x3471a ; 0x3471a eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); c17a: 48 e0 ldi r20, 0x08 ; 8 c17c: 50 e0 ldi r21, 0x00 ; 0 c17e: 65 ee ldi r22, 0xE5 ; 229 c180: 7f e0 ldi r23, 0x0F ; 15 c182: ce 01 movw r24, r28 c184: 41 96 adiw r24, 0x11 ; 17 c186: 0f 94 8d a3 call 0x3471a ; 0x3471a } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; c18a: 89 89 ldd r24, Y+17 ; 0x11 c18c: 9a 89 ldd r25, Y+18 ; 0x12 c18e: ab 89 ldd r26, Y+19 ; 0x13 c190: bc 89 ldd r27, Y+20 ; 0x14 c192: 89 a3 std Y+33, r24 ; 0x21 c194: 9a a3 std Y+34, r25 ; 0x22 c196: ab a3 std Y+35, r26 ; 0x23 c198: bc a3 std Y+36, r27 ; 0x24 c19a: 8f 3f cpi r24, 0xFF ; 255 c19c: 9f 4f sbci r25, 0xFF ; 255 c19e: af 4f sbci r26, 0xFF ; 255 c1a0: bf 4f sbci r27, 0xFF ; 255 c1a2: 09 f4 brne .+2 ; 0xc1a6 c1a4: b1 c0 rjmp .+354 ; 0xc308 c1a6: 8d 89 ldd r24, Y+21 ; 0x15 c1a8: 9e 89 ldd r25, Y+22 ; 0x16 c1aa: af 89 ldd r26, Y+23 ; 0x17 c1ac: b8 8d ldd r27, Y+24 ; 0x18 c1ae: 8d a3 std Y+37, r24 ; 0x25 c1b0: 9e a3 std Y+38, r25 ; 0x26 c1b2: af a3 std Y+39, r26 ; 0x27 c1b4: b8 a7 std Y+40, r27 ; 0x28 c1b6: 8f 3f cpi r24, 0xFF ; 255 c1b8: 9f 4f sbci r25, 0xFF ; 255 c1ba: af 4f sbci r26, 0xFF ; 255 c1bc: bf 4f sbci r27, 0xFF ; 255 c1be: 09 f4 brne .+2 ; 0xc1c2 c1c0: a3 c0 rjmp .+326 ; 0xc308 c1c2: 89 80 ldd r8, Y+1 ; 0x01 c1c4: 9a 80 ldd r9, Y+2 ; 0x02 c1c6: ab 80 ldd r10, Y+3 ; 0x03 c1c8: bc 80 ldd r11, Y+4 ; 0x04 c1ca: 8f ef ldi r24, 0xFF ; 255 c1cc: 88 16 cp r8, r24 c1ce: 98 06 cpc r9, r24 c1d0: a8 06 cpc r10, r24 c1d2: b8 06 cpc r11, r24 c1d4: 09 f4 brne .+2 ; 0xc1d8 c1d6: 98 c0 rjmp .+304 ; 0xc308 c1d8: 8d 81 ldd r24, Y+5 ; 0x05 c1da: 9e 81 ldd r25, Y+6 ; 0x06 c1dc: af 81 ldd r26, Y+7 ; 0x07 c1de: b8 85 ldd r27, Y+8 ; 0x08 c1e0: 89 8f std Y+25, r24 ; 0x19 c1e2: 9a 8f std Y+26, r25 ; 0x1a c1e4: ab 8f std Y+27, r26 ; 0x1b c1e6: bc 8f std Y+28, r27 ; 0x1c c1e8: 8f 3f cpi r24, 0xFF ; 255 c1ea: 9f 4f sbci r25, 0xFF ; 255 c1ec: af 4f sbci r26, 0xFF ; 255 c1ee: bf 4f sbci r27, 0xFF ; 255 c1f0: 09 f4 brne .+2 ; 0xc1f4 c1f2: 8a c0 rjmp .+276 ; 0xc308 c1f4: c9 84 ldd r12, Y+9 ; 0x09 c1f6: da 84 ldd r13, Y+10 ; 0x0a c1f8: eb 84 ldd r14, Y+11 ; 0x0b c1fa: fc 84 ldd r15, Y+12 ; 0x0c c1fc: 8f ef ldi r24, 0xFF ; 255 c1fe: c8 16 cp r12, r24 c200: d8 06 cpc r13, r24 c202: e8 06 cpc r14, r24 c204: f8 06 cpc r15, r24 c206: 09 f4 brne .+2 ; 0xc20a c208: 7f c0 rjmp .+254 ; 0xc308 c20a: 8d 85 ldd r24, Y+13 ; 0x0d c20c: 9e 85 ldd r25, Y+14 ; 0x0e c20e: af 85 ldd r26, Y+15 ; 0x0f c210: b8 89 ldd r27, Y+16 ; 0x10 c212: 8d 8f std Y+29, r24 ; 0x1d c214: 9e 8f std Y+30, r25 ; 0x1e c216: af 8f std Y+31, r26 ; 0x1f c218: b8 a3 std Y+32, r27 ; 0x20 c21a: 8f 3f cpi r24, 0xFF ; 255 c21c: 9f 4f sbci r25, 0xFF ; 255 c21e: af 4f sbci r26, 0xFF ; 255 c220: bf 4f sbci r27, 0xFF ; 255 c222: 09 f4 brne .+2 ; 0xc226 c224: 71 c0 rjmp .+226 ; 0xc308 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); c226: 29 8d ldd r18, Y+25 ; 0x19 c228: 3a 8d ldd r19, Y+26 ; 0x1a c22a: 4b 8d ldd r20, Y+27 ; 0x1b c22c: 5c 8d ldd r21, Y+28 ; 0x1c c22e: c5 01 movw r24, r10 c230: b4 01 movw r22, r8 c232: 0f 94 61 a7 call 0x34ec2 ; 0x34ec2 c236: 2b 01 movw r4, r22 c238: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) c23a: 26 e6 ldi r18, 0x66 ; 102 c23c: 36 e6 ldi r19, 0x66 ; 102 c23e: 46 e6 ldi r20, 0x66 ; 102 c240: 5f e3 ldi r21, 0x3F ; 63 c242: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__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; c246: 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) c248: 87 fd sbrc r24, 7 c24a: 0b c0 rjmp .+22 ; 0xc262 c24c: 2d ec ldi r18, 0xCD ; 205 c24e: 3c ec ldi r19, 0xCC ; 204 c250: 4c e8 ldi r20, 0x8C ; 140 c252: 5f e3 ldi r21, 0x3F ; 63 c254: c3 01 movw r24, r6 c256: b2 01 movw r22, r4 c258: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> c25c: 18 16 cp r1, r24 c25e: 0c f0 brlt .+2 ; 0xc262 c260: 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]); c262: 2d 8d ldd r18, Y+29 ; 0x1d c264: 3e 8d ldd r19, Y+30 ; 0x1e c266: 4f 8d ldd r20, Y+31 ; 0x1f c268: 58 a1 ldd r21, Y+32 ; 0x20 c26a: c7 01 movw r24, r14 c26c: b6 01 movw r22, r12 c26e: 0f 94 61 a7 call 0x34ec2 ; 0x34ec2 c272: 2b 01 movw r4, r22 c274: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) c276: 26 e6 ldi r18, 0x66 ; 102 c278: 36 e6 ldi r19, 0x66 ; 102 c27a: 46 e6 ldi r20, 0x66 ; 102 c27c: 5f e3 ldi r21, 0x3F ; 63 c27e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> c282: 87 fd sbrc r24, 7 c284: 7f c0 rjmp .+254 ; 0xc384 c286: 2d ec ldi r18, 0xCD ; 205 c288: 3c ec ldi r19, 0xCC ; 204 c28a: 4c e8 ldi r20, 0x8C ; 140 c28c: 5f e3 ldi r21, 0x3F ; 63 c28e: c3 01 movw r24, r6 c290: b2 01 movw r22, r4 c292: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> c296: 18 16 cp r1, r24 c298: 0c f4 brge .+2 ; 0xc29c c29a: 74 c0 rjmp .+232 ; 0xc384 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]); c29c: 2d a1 ldd r18, Y+37 ; 0x25 c29e: 3e a1 ldd r19, Y+38 ; 0x26 c2a0: 4f a1 ldd r20, Y+39 ; 0x27 c2a2: 58 a5 ldd r21, Y+40 ; 0x28 c2a4: 69 a1 ldd r22, Y+33 ; 0x21 c2a6: 7a a1 ldd r23, Y+34 ; 0x22 c2a8: 8b a1 ldd r24, Y+35 ; 0x23 c2aa: 9c a1 ldd r25, Y+36 ; 0x24 c2ac: 0f 94 61 a7 call 0x34ec2 ; 0x34ec2 if (l > 15.f) c2b0: 20 e0 ldi r18, 0x00 ; 0 c2b2: 30 e0 ldi r19, 0x00 ; 0 c2b4: 40 e7 ldi r20, 0x70 ; 112 c2b6: 51 e4 ldi r21, 0x41 ; 65 c2b8: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> c2bc: 18 16 cp r1, r24 c2be: 0c f4 brge .+2 ; 0xc2c2 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; c2c0: 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]; c2c2: a5 01 movw r20, r10 c2c4: 94 01 movw r18, r8 c2c6: c7 01 movw r24, r14 c2c8: b6 01 movw r22, r12 c2ca: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c2ce: 6b 01 movw r12, r22 c2d0: 7c 01 movw r14, r24 c2d2: 2d 8d ldd r18, Y+29 ; 0x1d c2d4: 3e 8d ldd r19, Y+30 ; 0x1e c2d6: 4f 8d ldd r20, Y+31 ; 0x1f c2d8: 58 a1 ldd r21, Y+32 ; 0x20 c2da: 69 8d ldd r22, Y+25 ; 0x19 c2dc: 7a 8d ldd r23, Y+26 ; 0x1a c2de: 8b 8d ldd r24, Y+27 ; 0x1b c2e0: 9c 8d ldd r25, Y+28 ; 0x1c c2e2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c2e6: 9b 01 movw r18, r22 c2e8: ac 01 movw r20, r24 c2ea: c7 01 movw r24, r14 c2ec: b6 01 movw r22, r12 c2ee: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> if (fabs(l) > 0.1f) c2f2: 9f 77 andi r25, 0x7F ; 127 c2f4: 2d ec ldi r18, 0xCD ; 205 c2f6: 3c ec ldi r19, 0xCC ; 204 c2f8: 4c ec ldi r20, 0xCC ; 204 c2fa: 5d e3 ldi r21, 0x3D ; 61 c2fc: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> c300: 18 16 cp r1, r24 c302: 14 f0 brlt .+4 ; 0xc308 #endif reset = true; } } if (reset) c304: 11 23 and r17, r17 c306: f1 f0 breq .+60 ; 0xc344 { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); c308: 0e 94 1e 55 call 0xaa3c ; 0xaa3c * @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; c30c: 80 e0 ldi r24, 0x00 ; 0 c30e: 90 e0 ldi r25, 0x00 ; 0 c310: a0 e8 ldi r26, 0x80 ; 128 c312: bf e3 ldi r27, 0x3F ; 63 c314: 89 83 std Y+1, r24 ; 0x01 c316: 9a 83 std Y+2, r25 ; 0x02 c318: ab 83 std Y+3, r26 ; 0x03 c31a: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; c31c: 1d 82 std Y+5, r1 ; 0x05 c31e: 1e 82 std Y+6, r1 ; 0x06 c320: 1f 82 std Y+7, r1 ; 0x07 c322: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; c324: 19 86 std Y+9, r1 ; 0x09 c326: 1a 86 std Y+10, r1 ; 0x0a c328: 1b 86 std Y+11, r1 ; 0x0b c32a: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; c32c: 8d 87 std Y+13, r24 ; 0x0d c32e: 9e 87 std Y+14, r25 ; 0x0e c330: af 87 std Y+15, r26 ; 0x0f c332: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; c334: 19 8a std Y+17, r1 ; 0x11 c336: 1a 8a std Y+18, r1 ; 0x12 c338: 1b 8a std Y+19, r1 ; 0x13 c33a: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; c33c: 1d 8a std Y+21, r1 ; 0x15 c33e: 1e 8a std Y+22, r1 ; 0x16 c340: 1f 8a std Y+23, r1 ; 0x17 c342: 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); c344: ae 01 movw r20, r28 c346: 4f 5e subi r20, 0xEF ; 239 c348: 5f 4f sbci r21, 0xFF ; 255 c34a: be 01 movw r22, r28 c34c: 67 5f subi r22, 0xF7 ; 247 c34e: 7f 4f sbci r23, 0xFF ; 255 c350: ce 01 movw r24, r28 c352: 01 96 adiw r24, 0x01 ; 1 c354: 0e 94 4d 5f call 0xbe9a ; 0xbe9a MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } c358: a8 96 adiw r28, 0x28 ; 40 c35a: 0f b6 in r0, 0x3f ; 63 c35c: f8 94 cli c35e: de bf out 0x3e, r29 ; 62 c360: 0f be out 0x3f, r0 ; 63 c362: cd bf out 0x3d, r28 ; 61 c364: df 91 pop r29 c366: cf 91 pop r28 c368: 1f 91 pop r17 c36a: ff 90 pop r15 c36c: ef 90 pop r14 c36e: df 90 pop r13 c370: cf 90 pop r12 c372: bf 90 pop r11 c374: af 90 pop r10 c376: 9f 90 pop r9 c378: 8f 90 pop r8 c37a: 7f 90 pop r7 c37c: 6f 90 pop r6 c37e: 5f 90 pop r5 c380: 4f 90 pop r4 c382: 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; c384: 11 e0 ldi r17, 0x01 ; 1 c386: 8a cf rjmp .-236 ; 0xc29c 0000c388 : * * 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() { c388: cf 93 push r28 c38a: df 93 push r29 c38c: cd b7 in r28, 0x3d ; 61 c38e: de b7 in r29, 0x3e ; 62 c390: 68 97 sbiw r28, 0x18 ; 24 c392: 0f b6 in r0, 0x3f ; 63 c394: f8 94 cli c396: de bf out 0x3e, r29 ; 62 c398: 0f be out 0x3f, r0 ; 63 c39a: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; c39c: 80 e0 ldi r24, 0x00 ; 0 c39e: 90 e0 ldi r25, 0x00 ; 0 c3a0: a0 e8 ldi r26, 0x80 ; 128 c3a2: bf e3 ldi r27, 0x3F ; 63 c3a4: 89 83 std Y+1, r24 ; 0x01 c3a6: 9a 83 std Y+2, r25 ; 0x02 c3a8: ab 83 std Y+3, r26 ; 0x03 c3aa: bc 83 std Y+4, r27 ; 0x04 c3ac: 1d 82 std Y+5, r1 ; 0x05 c3ae: 1e 82 std Y+6, r1 ; 0x06 c3b0: 1f 82 std Y+7, r1 ; 0x07 c3b2: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; c3b4: 19 86 std Y+9, r1 ; 0x09 c3b6: 1a 86 std Y+10, r1 ; 0x0a c3b8: 1b 86 std Y+11, r1 ; 0x0b c3ba: 1c 86 std Y+12, r1 ; 0x0c c3bc: 8d 87 std Y+13, r24 ; 0x0d c3be: 9e 87 std Y+14, r25 ; 0x0e c3c0: af 87 std Y+15, r26 ; 0x0f c3c2: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; c3c4: 19 8a std Y+17, r1 ; 0x11 c3c6: 1a 8a std Y+18, r1 ; 0x12 c3c8: 1b 8a std Y+19, r1 ; 0x13 c3ca: 1c 8a std Y+20, r1 ; 0x14 c3cc: 1d 8a std Y+21, r1 ; 0x15 c3ce: 1e 8a std Y+22, r1 ; 0x16 c3d0: 1f 8a std Y+23, r1 ; 0x17 c3d2: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); c3d4: ae 01 movw r20, r28 c3d6: 4f 5e subi r20, 0xEF ; 239 c3d8: 5f 4f sbci r21, 0xFF ; 255 c3da: be 01 movw r22, r28 c3dc: 67 5f subi r22, 0xF7 ; 247 c3de: 7f 4f sbci r23, 0xFF ; 255 c3e0: ce 01 movw r24, r28 c3e2: 01 96 adiw r24, 0x01 ; 1 c3e4: 0e 94 4d 5f call 0xbe9a ; 0xbe9a } c3e8: 68 96 adiw r28, 0x18 ; 24 c3ea: 0f b6 in r0, 0x3f ; 63 c3ec: f8 94 cli c3ee: de bf out 0x3e, r29 ; 62 c3f0: 0f be out 0x3f, r0 ; 63 c3f2: cd bf out 0x3d, r28 ; 61 c3f4: df 91 pop r29 c3f6: cf 91 pop r28 c3f8: 08 95 ret 0000c3fa : * * 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) { c3fa: 80 91 a2 04 lds r24, 0x04A2 ; 0x8004a2 c3fe: 88 23 and r24, r24 c400: d1 f0 breq .+52 ; 0xc436 world2machine_reset(); c402: 0e 94 c4 61 call 0xc388 ; 0xc388 st_synchronize(); c406: 0f 94 b0 18 call 0x23160 ; 0x23160 current_position[X_AXIS] = st_get_position_mm(X_AXIS); c40a: 80 e0 ldi r24, 0x00 ; 0 c40c: 0f 94 9c 18 call 0x23138 ; 0x23138 c410: 60 93 61 12 sts 0x1261, r22 ; 0x801261 c414: 70 93 62 12 sts 0x1262, r23 ; 0x801262 c418: 80 93 63 12 sts 0x1263, r24 ; 0x801263 c41c: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); c420: 81 e0 ldi r24, 0x01 ; 1 c422: 0f 94 9c 18 call 0x23138 ; 0x23138 c426: 60 93 65 12 sts 0x1265, r22 ; 0x801265 c42a: 70 93 66 12 sts 0x1266, r23 ; 0x801266 c42e: 80 93 67 12 sts 0x1267, r24 ; 0x801267 c432: 90 93 68 12 sts 0x1268, r25 ; 0x801268 } } c436: 08 95 ret 0000c438 : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; c438: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c43c: 90 91 62 04 lds r25, 0x0462 ; 0x800462 c440: 89 13 cpse r24, r25 c442: 0b c0 rjmp .+22 ; 0xc45a c444: 90 91 61 04 lds r25, 0x0461 ; 0x800461 c448: 99 23 and r25, r25 c44a: 39 f0 breq .+14 ; 0xc45a c44c: 20 91 1e 06 lds r18, 0x061E ; 0x80061e c450: 30 91 1f 06 lds r19, 0x061F ; 0x80061f c454: 82 17 cp r24, r18 c456: 13 06 cpc r1, r19 c458: 39 f0 breq .+14 ; 0xc468 c45a: 81 e0 ldi r24, 0x01 ; 1 c45c: 90 91 c4 03 lds r25, 0x03C4 ; 0x8003c4 c460: 91 11 cpse r25, r1 c462: 03 c0 rjmp .+6 ; 0xc46a c464: 80 e0 ldi r24, 0x00 ; 0 c466: 08 95 ret c468: 81 e0 ldi r24, 0x01 ; 1 } c46a: 08 95 ret 0000c46c : 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)?'>':' '; c46c: 20 91 63 04 lds r18, 0x0463 ; 0x800463 c470: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c474: 90 91 1f 06 lds r25, 0x061F ; 0x80061f c478: 28 17 cp r18, r24 c47a: 19 06 cpc r1, r25 c47c: 11 f0 breq .+4 ; 0xc482 c47e: 80 e2 ldi r24, 0x20 ; 32 c480: 08 95 ret c482: 8e e3 ldi r24, 0x3E ; 62 } c484: 08 95 ret 0000c486 : } } void menu_item_ret(void) { lcd_draw_update = 2; c486: 82 e0 ldi r24, 0x02 ; 2 c488: 80 93 59 02 sts 0x0259, r24 ; 0x800259 menu_item++; c48c: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c490: 8f 5f subi r24, 0xFF ; 255 c492: 80 93 63 04 sts 0x0463, r24 ; 0x800463 //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 c496: 84 e0 ldi r24, 0x04 ; 4 c498: 80 93 60 04 sts 0x0460, r24 ; 0x800460 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle c49c: 10 92 62 04 sts 0x0462, r1 ; 0x800462 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 c4a0: 10 92 61 04 sts 0x0461, r1 ; 0x800461 } c4a4: 08 95 ret 0000c4a6 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) c4a6: 80 91 60 04 lds r24, 0x0460 ; 0x800460 c4aa: 84 30 cpi r24, 0x04 ; 4 c4ac: 38 f5 brcc .+78 ; 0xc4fc { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) c4ae: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c4b2: 90 e0 ldi r25, 0x00 ; 0 c4b4: 20 91 1e 06 lds r18, 0x061E ; 0x80061e c4b8: 30 91 1f 06 lds r19, 0x061F ; 0x80061f c4bc: 28 17 cp r18, r24 c4be: 39 07 cpc r19, r25 c4c0: 44 f0 brlt .+16 ; 0xc4d2 { lcd_encoder = menu_item - 1; c4c2: 01 97 sbiw r24, 0x01 ; 1 c4c4: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f c4c8: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e Sound_MakeSound(e_SOUND_TYPE_BlindAlert); c4cc: 87 e0 ldi r24, 0x07 ; 7 c4ce: 0f 94 62 23 call 0x246c4 ; 0x246c4 } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) c4d2: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c4d6: 20 91 92 03 lds r18, 0x0392 ; 0x800392 c4da: 30 e0 ldi r19, 0x00 ; 0 c4dc: 2d 5f subi r18, 0xFD ; 253 c4de: 3f 4f sbci r19, 0xFF ; 255 c4e0: 82 17 cp r24, r18 c4e2: 13 06 cpc r1, r19 c4e4: 59 f0 breq .+22 ; 0xc4fc c4e6: 54 f0 brlt .+20 ; 0xc4fc { menu_top = lcd_encoder - LCD_HEIGHT + 1; c4e8: 9d ef ldi r25, 0xFD ; 253 c4ea: 98 0f add r25, r24 c4ec: 90 93 92 03 sts 0x0392, r25 ; 0x800392 menu_line = menu_top - 1; c4f0: 84 50 subi r24, 0x04 ; 4 c4f2: 80 93 62 04 sts 0x0462, r24 ; 0x800462 menu_row = -1; c4f6: 8f ef ldi r24, 0xFF ; 255 c4f8: 80 93 60 04 sts 0x0460, r24 ; 0x800460 } } c4fc: 08 95 ret 0000c4fe : 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)); c4fe: e6 e9 ldi r30, 0x96 ; 150 c500: f3 e0 ldi r31, 0x03 ; 3 c502: 80 e2 ldi r24, 0x20 ; 32 c504: df 01 movw r26, r30 c506: 1d 92 st X+, r1 c508: 8a 95 dec r24 c50a: e9 f7 brne .-6 ; 0xc506 } c50c: 08 95 ret 0000c50e : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { c50e: cf 93 push r28 CRITICAL_SECTION_START; c510: 3f b7 in r19, 0x3f ; 63 c512: f8 94 cli if (menu_menu != menu) c514: e0 91 02 04 lds r30, 0x0402 ; 0x800402 c518: f0 91 03 04 lds r31, 0x0403 ; 0x800403 c51c: e8 17 cp r30, r24 c51e: f9 07 cpc r31, r25 c520: c9 f0 breq .+50 ; 0xc554 c522: c4 2f mov r28, r20 { menu_menu = menu; c524: 90 93 03 04 sts 0x0403, r25 ; 0x800403 c528: 80 93 02 04 sts 0x0402, r24 ; 0x800402 lcd_encoder = encoder; c52c: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f c530: 60 93 1e 06 sts 0x061E, r22 ; 0x80061e menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support c534: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_draw_update = 2; // Full LCD re-draw c538: 82 e0 ldi r24, 0x02 ; 2 c53a: 80 93 59 02 sts 0x0259, r24 ; 0x800259 CRITICAL_SECTION_END; c53e: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); c540: 22 23 and r18, r18 c542: 19 f0 breq .+6 ; 0xc54a } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); c544: 80 e0 ldi r24, 0x00 ; 0 c546: 0f 94 62 23 call 0x246c4 ; 0x246c4 if (reset_menu_state) menu_data_reset(); c54a: cc 23 and r28, r28 c54c: 21 f0 breq .+8 ; 0xc556 } else CRITICAL_SECTION_END; } c54e: 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(); c550: 0c 94 7f 62 jmp 0xc4fe ; 0xc4fe } else CRITICAL_SECTION_END; c554: 3f bf out 0x3f, r19 ; 63 } c556: cf 91 pop r28 c558: 08 95 ret 0000c55a : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { c55a: dc 01 movw r26, r24 c55c: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) c55e: 90 91 df 03 lds r25, 0x03DF ; 0x8003df c562: 97 30 cpi r25, 0x07 ; 7 c564: d8 f4 brcc .+54 ; 0xc59c { menu_stack[menu_depth].menu = menu_menu; c566: 49 2f mov r20, r25 c568: 50 e0 ldi r21, 0x00 ; 0 c56a: fa 01 movw r30, r20 c56c: ee 0f add r30, r30 c56e: ff 1f adc r31, r31 c570: e4 0f add r30, r20 c572: f5 1f adc r31, r21 c574: e9 5a subi r30, 0xA9 ; 169 c576: fc 4f sbci r31, 0xFC ; 252 c578: 40 91 02 04 lds r20, 0x0402 ; 0x800402 c57c: 50 91 03 04 lds r21, 0x0403 ; 0x800403 c580: 51 83 std Z+1, r21 ; 0x01 c582: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; c584: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c588: 9f 5f subi r25, 0xFF ; 255 c58a: 90 93 df 03 sts 0x03DF, r25 ; 0x8003df c58e: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); c590: 41 e0 ldi r20, 0x01 ; 1 c592: 70 e0 ldi r23, 0x00 ; 0 c594: 60 e0 ldi r22, 0x00 ; 0 c596: cd 01 movw r24, r26 c598: 0c 94 87 62 jmp 0xc50e ; 0xc50e } } c59c: 08 95 ret 0000c59e : menu_row = -1; } } void menu_back(uint8_t nLevel) { c59e: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); c5a0: 80 91 df 03 lds r24, 0x03DF ; 0x8003df c5a4: 98 17 cp r25, r24 c5a6: a8 f4 brcc .+42 ; 0xc5d2 c5a8: 89 1b sub r24, r25 c5aa: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); c5ae: 90 e0 ldi r25, 0x00 ; 0 c5b0: fc 01 movw r30, r24 c5b2: ee 0f add r30, r30 c5b4: ff 1f adc r31, r31 c5b6: e8 0f add r30, r24 c5b8: f9 1f adc r31, r25 c5ba: e9 5a subi r30, 0xA9 ; 169 c5bc: fc 4f sbci r31, 0xFC ; 252 c5be: 62 81 ldd r22, Z+2 ; 0x02 c5c0: 06 2e mov r0, r22 c5c2: 00 0c add r0, r0 c5c4: 77 0b sbc r23, r23 c5c6: 20 e0 ldi r18, 0x00 ; 0 c5c8: 41 e0 ldi r20, 0x01 ; 1 c5ca: 80 81 ld r24, Z c5cc: 91 81 ldd r25, Z+1 ; 0x01 c5ce: 0c 94 87 62 jmp 0xc50e ; 0xc50e } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); c5d2: 80 e0 ldi r24, 0x00 ; 0 c5d4: ea cf rjmp .-44 ; 0xc5aa 0000c5d6 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); c5d6: 81 e0 ldi r24, 0x01 ; 1 c5d8: 0c 94 cf 62 jmp 0xc59e ; 0xc59e 0000c5dc <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { c5dc: 1f 92 push r1 c5de: 0f 92 push r0 c5e0: 0f b6 in r0, 0x3f ; 63 c5e2: 0f 92 push r0 c5e4: 11 24 eor r1, r1 c5e6: 0b b6 in r0, 0x3b ; 59 c5e8: 0f 92 push r0 c5ea: 2f 93 push r18 c5ec: 3f 93 push r19 c5ee: 4f 93 push r20 c5f0: 6f 93 push r22 c5f2: 7f 93 push r23 c5f4: 8f 93 push r24 c5f6: 9f 93 push r25 c5f8: ef 93 push r30 c5fa: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< c600: 84 ff sbrs r24, 4 c602: 12 c0 rjmp .+36 ; 0xc628 <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); c604: 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 } } c608: ff 91 pop r31 c60a: ef 91 pop r30 c60c: 9f 91 pop r25 c60e: 8f 91 pop r24 c610: 7f 91 pop r23 c612: 6f 91 pop r22 c614: 4f 91 pop r20 c616: 3f 91 pop r19 c618: 2f 91 pop r18 c61a: 0f 90 pop r0 c61c: 0b be out 0x3b, r0 ; 59 c61e: 0f 90 pop r0 c620: 0f be out 0x3f, r0 ; 63 c622: 0f 90 pop r0 c624: 1f 90 pop r1 c626: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; c628: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) c62c: 80 91 1c 06 lds r24, 0x061C ; 0x80061c c630: 81 30 cpi r24, 0x01 ; 1 c632: 51 f7 brne .-44 ; 0xc608 <__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; c634: 20 91 42 05 lds r18, 0x0542 ; 0x800542 c638: 30 91 43 05 lds r19, 0x0543 ; 0x800543 c63c: c9 01 movw r24, r18 c63e: 01 96 adiw r24, 0x01 ; 1 c640: 8f 77 andi r24, 0x7F ; 127 c642: 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) { c644: 60 91 44 05 lds r22, 0x0544 ; 0x800544 c648: 70 91 45 05 lds r23, 0x0545 ; 0x800545 c64c: 86 17 cp r24, r22 c64e: 97 07 cpc r25, r23 c650: d9 f2 breq .-74 ; 0xc608 <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; c652: 2e 53 subi r18, 0x3E ; 62 c654: 3b 4f sbci r19, 0xFB ; 251 c656: f9 01 movw r30, r18 c658: 40 83 st Z, r20 rx_buffer.head = i; c65a: 90 93 43 05 sts 0x0543, r25 ; 0x800543 c65e: 80 93 42 05 sts 0x0542, r24 ; 0x800542 c662: d2 cf rjmp .-92 ; 0xc608 <__vector_36+0x2c> 0000c664 <__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) { c664: 1f 92 push r1 c666: 0f 92 push r0 c668: 0f b6 in r0, 0x3f ; 63 c66a: 0f 92 push r0 c66c: 11 24 eor r1, r1 c66e: 0b b6 in r0, 0x3b ; 59 c670: 0f 92 push r0 c672: 2f 93 push r18 c674: 3f 93 push r19 c676: 4f 93 push r20 c678: 6f 93 push r22 c67a: 7f 93 push r23 c67c: 8f 93 push r24 c67e: 9f 93 push r25 c680: ef 93 push r30 c682: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< c688: 84 ff sbrs r24, 4 c68a: 12 c0 rjmp .+36 ; 0xc6b0 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); c68c: 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 } } c690: ff 91 pop r31 c692: ef 91 pop r30 c694: 9f 91 pop r25 c696: 8f 91 pop r24 c698: 7f 91 pop r23 c69a: 6f 91 pop r22 c69c: 4f 91 pop r20 c69e: 3f 91 pop r19 c6a0: 2f 91 pop r18 c6a2: 0f 90 pop r0 c6a4: 0b be out 0x3b, r0 ; 59 c6a6: 0f 90 pop r0 c6a8: 0f be out 0x3f, r0 ; 63 c6aa: 0f 90 pop r0 c6ac: 1f 90 pop r1 c6ae: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; c6b0: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) c6b4: 80 91 1c 06 lds r24, 0x061C ; 0x80061c c6b8: 81 11 cpse r24, r1 c6ba: ea cf rjmp .-44 ; 0xc690 <__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; c6bc: 20 91 42 05 lds r18, 0x0542 ; 0x800542 c6c0: 30 91 43 05 lds r19, 0x0543 ; 0x800543 c6c4: c9 01 movw r24, r18 c6c6: 01 96 adiw r24, 0x01 ; 1 c6c8: 8f 77 andi r24, 0x7F ; 127 c6ca: 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) { c6cc: 60 91 44 05 lds r22, 0x0544 ; 0x800544 c6d0: 70 91 45 05 lds r23, 0x0545 ; 0x800545 c6d4: 86 17 cp r24, r22 c6d6: 97 07 cpc r25, r23 c6d8: d9 f2 breq .-74 ; 0xc690 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; c6da: 2e 53 subi r18, 0x3E ; 62 c6dc: 3b 4f sbci r19, 0xFB ; 251 c6de: f9 01 movw r30, r18 c6e0: 40 83 st Z, r20 rx_buffer.head = i; c6e2: 90 93 43 05 sts 0x0543, r25 ; 0x800543 c6e6: 80 93 42 05 sts 0x0542, r24 ; 0x800542 c6ea: d2 cf rjmp .-92 ; 0xc690 <__vector_25+0x2c> 0000c6ec : /// 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)); c6ec: 80 e1 ldi r24, 0x10 ; 16 c6ee: e1 e6 ldi r30, 0x61 ; 97 c6f0: f2 e1 ldi r31, 0x12 ; 18 c6f2: a0 e9 ldi r26, 0x90 ; 144 c6f4: b2 e0 ldi r27, 0x02 ; 2 c6f6: 01 90 ld r0, Z+ c6f8: 0d 92 st X+, r0 c6fa: 8a 95 dec r24 c6fc: e1 f7 brne .-8 ; 0xc6f6 saved_feedmultiply2 = feedmultiply; //save feedmultiply c6fe: 80 91 8e 02 lds r24, 0x028E ; 0x80028e c702: 90 91 8f 02 lds r25, 0x028F ; 0x80028f c706: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.498+0x1> c70a: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.498> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); c70e: 80 91 5d 12 lds r24, 0x125D ; 0x80125d c712: 90 91 5e 12 lds r25, 0x125E ; 0x80125e c716: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c c71a: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_bed_temperature = (uint8_t)degTargetBed(); c71e: 80 91 59 12 lds r24, 0x1259 ; 0x801259 c722: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; c726: 80 91 57 12 lds r24, 0x1257 ; 0x801257 c72a: 83 fb bst r24, 3 c72c: 88 27 eor r24, r24 c72e: 80 f9 bld r24, 0 c730: 80 93 56 12 sts 0x1256, r24 ; 0x801256 saved_fan_speed = fanSpeed; c734: 80 91 55 12 lds r24, 0x1255 ; 0x801255 c738: 80 93 54 12 sts 0x1254, r24 ; 0x801254 isPartialBackupAvailable = true; } c73c: 08 95 ret 0000c73e <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } c73e: cf 93 push r28 c740: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { c742: 87 e6 ldi r24, 0x67 ; 103 c744: 96 e1 ldi r25, 0x16 ; 22 c746: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader c74a: 85 ea ldi r24, 0xA5 ; 165 c74c: 94 e1 ldi r25, 0x14 ; 20 c74e: 89 2b or r24, r25 c750: 51 f0 breq .+20 ; 0xc766 <_GLOBAL__sub_D_card+0x28> c752: c7 e7 ldi r28, 0x77 ; 119 c754: d5 e1 ldi r29, 0x15 ; 21 c756: a3 97 sbiw r28, 0x23 ; 35 c758: ce 01 movw r24, r28 c75a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 c75e: 84 e1 ldi r24, 0x14 ; 20 c760: c5 3a cpi r28, 0xA5 ; 165 c762: d8 07 cpc r29, r24 c764: c1 f7 brne .-16 ; 0xc756 <_GLOBAL__sub_D_card+0x18> c766: 82 e8 ldi r24, 0x82 ; 130 c768: 94 e1 ldi r25, 0x14 ; 20 c76a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 c76e: 8d e5 ldi r24, 0x5D ; 93 c770: 94 e1 ldi r25, 0x14 ; 20 c772: df 91 pop r29 c774: cf 91 pop r28 c776: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 0000c77a : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { c77a: cf 93 push r28 c77c: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; c77e: c1 e6 ldi r28, 0x61 ; 97 c780: d2 e1 ldi r29, 0x12 ; 18 c782: 20 e0 ldi r18, 0x00 ; 0 c784: 30 e0 ldi r19, 0x00 ; 0 c786: 48 ec ldi r20, 0xC8 ; 200 c788: 51 e4 ldi r21, 0x41 ; 65 c78a: 6c 85 ldd r22, Y+12 ; 0x0c c78c: 7d 85 ldd r23, Y+13 ; 0x0d c78e: 8e 85 ldd r24, Y+14 ; 0x0e c790: 9f 85 ldd r25, Y+15 ; 0x0f c792: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> c796: 6c 87 std Y+12, r22 ; 0x0c c798: 7d 87 std Y+13, r23 ; 0x0d c79a: 8e 87 std Y+14, r24 ; 0x0e c79c: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c79e: 63 e3 ldi r22, 0x33 ; 51 c7a0: 73 e3 ldi r23, 0x33 ; 51 c7a2: 83 e5 ldi r24, 0x53 ; 83 c7a4: 90 e4 ldi r25, 0x40 ; 64 } c7a6: df 91 pop r29 c7a8: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c7aa: 0d 94 0a 4a jmp 0x29414 ; 0x29414 0000c7ae : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); c7ae: 60 e0 ldi r22, 0x00 ; 0 c7b0: 85 ea ldi r24, 0xA5 ; 165 c7b2: 9f e0 ldi r25, 0x0F ; 15 c7b4: 0f 94 c1 a3 call 0x34782 ; 0x34782 c7b8: 60 e0 ldi r22, 0x00 ; 0 c7ba: 8f e7 ldi r24, 0x7F ; 127 c7bc: 9c e0 ldi r25, 0x0C ; 12 c7be: 0f 94 c1 a3 call 0x34782 ; 0x34782 // 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; c7c2: 80 e0 ldi r24, 0x00 ; 0 c7c4: 90 e0 ldi r25, 0x00 ; 0 c7c6: a0 e8 ldi r26, 0x80 ; 128 c7c8: bf eb ldi r27, 0xBF ; 191 c7ca: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e c7ce: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f c7d2: a0 93 80 02 sts 0x0280, r26 ; 0x800280 c7d6: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c7da: 82 e0 ldi r24, 0x02 ; 2 c7dc: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; c7e0: 10 92 73 12 sts 0x1273, r1 ; 0x801273 } c7e4: 08 95 ret 0000c7e6 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) c7e6: 80 91 5b 12 lds r24, 0x125B ; 0x80125b c7ea: 90 91 5c 12 lds r25, 0x125C ; 0x80125c c7ee: 20 91 5d 12 lds r18, 0x125D ; 0x80125d c7f2: 30 91 5e 12 lds r19, 0x125E ; 0x80125e c7f6: 28 17 cp r18, r24 c7f8: 39 07 cpc r19, r25 c7fa: 71 f0 breq .+28 ; 0xc818 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; c7fc: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e c800: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; c804: 81 e0 ldi r24, 0x01 ; 1 c806: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb wait_for_heater(_millis(), active_extruder); c80a: 0f 94 56 0b call 0x216ac ; 0x216ac c80e: 0f 94 42 74 call 0x2e884 ; 0x2e884 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; c812: 82 e0 ldi r24, 0x02 ; 2 c814: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb } } c818: 08 95 ret 0000c81a : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { c81a: 80 91 73 12 lds r24, 0x1273 ; 0x801273 c81e: 88 23 and r24, r24 c820: 41 f0 breq .+16 ; 0xc832 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; c822: 80 91 8e 02 lds r24, 0x028E ; 0x80028e c826: 90 91 8f 02 lds r25, 0x028F ; 0x80028f c82a: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.498+0x1> c82e: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.498> } c832: 08 95 ret 0000c834 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { c834: cf 92 push r12 c836: df 92 push r13 c838: ef 92 push r14 c83a: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); c83c: c0 90 ff 0d lds r12, 0x0DFF ; 0x800dff c840: d0 90 00 0e lds r13, 0x0E00 ; 0x800e00 c844: e0 90 01 0e lds r14, 0x0E01 ; 0x800e01 c848: f0 90 02 0e lds r15, 0x0E02 ; 0x800e02 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { c84c: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe c850: 88 23 and r24, r24 c852: 09 f4 brne .+2 ; 0xc856 c854: 4e c0 rjmp .+156 ; 0xc8f2 c856: 20 e0 ldi r18, 0x00 ; 0 c858: 30 e0 ldi r19, 0x00 ; 0 c85a: a9 01 movw r20, r18 c85c: c7 01 movw r24, r14 c85e: b6 01 movw r22, r12 c860: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> c864: 18 16 cp r1, r24 c866: 0c f0 brlt .+2 ; 0xc86a c868: 44 c0 rjmp .+136 ; 0xc8f2 float area = M_PI * diameter * diameter * 0.25; c86a: 2b ed ldi r18, 0xDB ; 219 c86c: 3f e0 ldi r19, 0x0F ; 15 c86e: 49 e4 ldi r20, 0x49 ; 73 c870: 50 e4 ldi r21, 0x40 ; 64 c872: c7 01 movw r24, r14 c874: b6 01 movw r22, r12 c876: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c87a: a7 01 movw r20, r14 c87c: 96 01 movw r18, r12 c87e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c882: 20 e0 ldi r18, 0x00 ; 0 c884: 30 e0 ldi r19, 0x00 ; 0 c886: 40 e8 ldi r20, 0x80 ; 128 c888: 5e e3 ldi r21, 0x3E ; 62 c88a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c88e: 9b 01 movw r18, r22 c890: ac 01 movw r20, r24 out = 1.f / area; c892: 60 e0 ldi r22, 0x00 ; 0 c894: 70 e0 ldi r23, 0x00 ; 0 c896: 80 e8 ldi r24, 0x80 ; 128 c898: 9f e3 ldi r25, 0x3F ; 63 c89a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> c89e: 6b 01 movw r12, r22 c8a0: 7c 01 movw r14, r24 } if (extrudemultiply != 100) c8a2: 60 91 75 02 lds r22, 0x0275 ; 0x800275 c8a6: 70 91 76 02 lds r23, 0x0276 ; 0x800276 c8aa: 64 36 cpi r22, 0x64 ; 100 c8ac: 71 05 cpc r23, r1 c8ae: a1 f0 breq .+40 ; 0xc8d8 out *= float(extrudemultiply) * 0.01f; c8b0: 07 2e mov r0, r23 c8b2: 00 0c add r0, r0 c8b4: 88 0b sbc r24, r24 c8b6: 99 0b sbc r25, r25 c8b8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> c8bc: 2a e0 ldi r18, 0x0A ; 10 c8be: 37 ed ldi r19, 0xD7 ; 215 c8c0: 43 e2 ldi r20, 0x23 ; 35 c8c2: 5c e3 ldi r21, 0x3C ; 60 c8c4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c8c8: 9b 01 movw r18, r22 c8ca: ac 01 movw r20, r24 c8cc: c7 01 movw r24, r14 c8ce: b6 01 movw r22, r12 c8d0: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> c8d4: 6b 01 movw r12, r22 c8d6: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); c8d8: c0 92 10 02 sts 0x0210, r12 ; 0x800210 c8dc: d0 92 11 02 sts 0x0211, r13 ; 0x800211 c8e0: e0 92 12 02 sts 0x0212, r14 ; 0x800212 c8e4: f0 92 13 02 sts 0x0213, r15 ; 0x800213 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 } c8e8: ff 90 pop r15 c8ea: ef 90 pop r14 c8ec: df 90 pop r13 c8ee: cf 90 pop r12 c8f0: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; c8f2: c1 2c mov r12, r1 c8f4: d1 2c mov r13, r1 c8f6: 80 e8 ldi r24, 0x80 ; 128 c8f8: e8 2e mov r14, r24 c8fa: 8f e3 ldi r24, 0x3F ; 63 c8fc: f8 2e mov r15, r24 c8fe: d1 cf rjmp .-94 ; 0xc8a2 0000c900 : } } #endif //FAST_PWM_FAN void save_statistics() { c900: 8f 92 push r8 c902: 9f 92 push r9 c904: af 92 push r10 c906: bf 92 push r11 c908: cf 92 push r12 c90a: df 92 push r13 c90c: ef 92 push r14 c90e: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: centimeter c910: 81 ef ldi r24, 0xF1 ; 241 c912: 9f e0 ldi r25, 0x0F ; 15 c914: 0f 94 a9 6c call 0x2d952 ; 0x2d952 c918: 6b 01 movw r12, r22 c91a: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min c91c: 8d ee ldi r24, 0xED ; 237 c91e: 9f e0 ldi r25, 0x0F ; 15 c920: 0f 94 a9 6c call 0x2d952 ; 0x2d952 c924: 4b 01 movw r8, r22 c926: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; c928: 0f 94 22 15 call 0x22a44 ; 0x22a44 c92c: 2c e3 ldi r18, 0x3C ; 60 c92e: 30 e0 ldi r19, 0x00 ; 0 c930: 40 e0 ldi r20, 0x00 ; 0 c932: 50 e0 ldi r21, 0x00 ; 0 c934: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min c938: ba 01 movw r22, r20 c93a: a9 01 movw r20, r18 c93c: 48 0d add r20, r8 c93e: 59 1d adc r21, r9 c940: 6a 1d adc r22, r10 c942: 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); c944: 8d ee ldi r24, 0xED ; 237 c946: 9f e0 ldi r25, 0x0F ; 15 c948: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); c94c: 60 91 17 06 lds r22, 0x0617 ; 0x800617 c950: 70 91 18 06 lds r23, 0x0618 ; 0x800618 c954: 80 91 19 06 lds r24, 0x0619 ; 0x800619 c958: 90 91 1a 06 lds r25, 0x061A ; 0x80061a c95c: 28 ee ldi r18, 0xE8 ; 232 c95e: 33 e0 ldi r19, 0x03 ; 3 c960: 40 e0 ldi r20, 0x00 ; 0 c962: 50 e0 ldi r21, 0x00 ; 0 c964: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> c968: ba 01 movw r22, r20 c96a: a9 01 movw r20, r18 c96c: 4c 0d add r20, r12 c96e: 5d 1d adc r21, r13 c970: 6e 1d adc r22, r14 c972: 7f 1d adc r23, r15 c974: 81 ef ldi r24, 0xF1 ; 241 c976: 9f e0 ldi r25, 0x0F ; 15 c978: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 print_job_timer.reset(); c97c: 0f 94 bf 16 call 0x22d7e ; 0x22d7e total_filament_used = 0; c980: 10 92 17 06 sts 0x0617, r1 ; 0x800617 c984: 10 92 18 06 sts 0x0618, r1 ; 0x800618 c988: 10 92 19 06 sts 0x0619, r1 ; 0x800619 c98c: 10 92 1a 06 sts 0x061A, r1 ; 0x80061a if (MMU2::mmu2.Enabled()) { c990: 80 91 01 13 lds r24, 0x1301 ; 0x801301 c994: 81 30 cpi r24, 0x01 ; 1 c996: 81 f4 brne .+32 ; 0xc9b8 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); c998: 60 91 05 13 lds r22, 0x1305 ; 0x801305 c99c: 70 91 06 13 lds r23, 0x1306 ; 0x801306 c9a0: 90 e0 ldi r25, 0x00 ; 0 c9a2: 80 e0 ldi r24, 0x00 ; 0 c9a4: 0f 94 91 6c call 0x2d922 ; 0x2d922 /// @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; }; c9a8: 10 92 06 13 sts 0x1306, r1 ; 0x801306 c9ac: 10 92 05 13 sts 0x1305, r1 ; 0x801305 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } c9b0: 10 92 08 13 sts 0x1308, r1 ; 0x801308 c9b4: 10 92 07 13 sts 0x1307, r1 ; 0x801307 // @@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 } } c9b8: ff 90 pop r15 c9ba: ef 90 pop r14 c9bc: df 90 pop r13 c9be: cf 90 pop r12 c9c0: bf 90 pop r11 c9c2: af 90 pop r10 c9c4: 9f 90 pop r9 c9c6: 8f 90 pop r8 c9c8: 08 95 ret 0000c9ca : } #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); c9ca: 80 91 55 12 lds r24, 0x1255 ; 0x801255 c9ce: 1f 92 push r1 c9d0: 8f 93 push r24 c9d2: 80 91 3e 03 lds r24, 0x033E ; 0x80033e c9d6: 1f 92 push r1 c9d8: 8f 93 push r24 c9da: e7 eb ldi r30, 0xB7 ; 183 c9dc: f3 e0 ldi r31, 0x03 ; 3 c9de: 42 81 ldd r20, Z+2 ; 0x02 c9e0: 53 81 ldd r21, Z+3 ; 0x03 c9e2: 2c e3 ldi r18, 0x3C ; 60 c9e4: 24 9f mul r18, r20 c9e6: c0 01 movw r24, r0 c9e8: 25 9f mul r18, r21 c9ea: 90 0d add r25, r0 c9ec: 11 24 eor r1, r1 c9ee: 9f 93 push r25 c9f0: 8f 93 push r24 c9f2: 40 81 ld r20, Z c9f4: 51 81 ldd r21, Z+1 ; 0x01 c9f6: 24 9f mul r18, r20 c9f8: c0 01 movw r24, r0 c9fa: 25 9f mul r18, r21 c9fc: 90 0d add r25, r0 c9fe: 11 24 eor r1, r1 ca00: 9f 93 push r25 ca02: 8f 93 push r24 ca04: 84 e2 ldi r24, 0x24 ; 36 ca06: 94 e6 ldi r25, 0x64 ; 100 ca08: 9f 93 push r25 ca0a: 8f 93 push r24 ca0c: 0f 94 5f a2 call 0x344be ; 0x344be ca10: 8d b7 in r24, 0x3d ; 61 ca12: 9e b7 in r25, 0x3e ; 62 ca14: 0a 96 adiw r24, 0x0a ; 10 ca16: 0f b6 in r0, 0x3f ; 63 ca18: f8 94 cli ca1a: 9e bf out 0x3e, r25 ; 62 ca1c: 0f be out 0x3f, r0 ; 63 ca1e: 8d bf out 0x3d, r24 ; 61 } ca20: 08 95 ret 0000ca22 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); ca22: 88 e4 ldi r24, 0x48 ; 72 ca24: 93 e0 ldi r25, 0x03 ; 3 ca26: 0d 94 7f 0d jmp 0x21afe ; 0x21afe ::start()> 0000ca2a : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; ca2a: 20 e0 ldi r18, 0x00 ; 0 ca2c: 30 e0 ldi r19, 0x00 ; 0 ca2e: 40 e7 ldi r20, 0x70 ; 112 ca30: 52 e4 ldi r21, 0x42 ; 66 ca32: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> } ca36: 08 95 ret 0000ca38 : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; ca38: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> //! @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; ca3c: 40 91 39 03 lds r20, 0x0339 ; 0x800339 ca40: 50 91 3a 03 lds r21, 0x033A ; 0x80033a ca44: 60 91 3b 03 lds r22, 0x033B ; 0x80033b ca48: 70 91 3c 03 lds r23, 0x033C ; 0x80033c ca4c: 40 93 7a 02 sts 0x027A, r20 ; 0x80027a ca50: 50 93 7b 02 sts 0x027B, r21 ; 0x80027b ca54: 60 93 7c 02 sts 0x027C, r22 ; 0x80027c ca58: 70 93 7d 02 sts 0x027D, r23 ; 0x80027d feedmultiply = original_feedmultiply; ca5c: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f ca60: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); ca64: 88 e4 ldi r24, 0x48 ; 72 ca66: 93 e0 ldi r25, 0x03 ; 3 ca68: 0d 94 7f 0d jmp 0x21afe ; 0x21afe ::start()> 0000ca6c : 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) { ca6c: 1f 93 push r17 ca6e: cf 93 push r28 ca70: df 93 push r29 ca72: 18 2f mov r17, r24 saved_feedrate = feedrate; ca74: 80 91 7a 02 lds r24, 0x027A ; 0x80027a ca78: 90 91 7b 02 lds r25, 0x027B ; 0x80027b ca7c: a0 91 7c 02 lds r26, 0x027C ; 0x80027c ca80: b0 91 7d 02 lds r27, 0x027D ; 0x80027d ca84: 80 93 39 03 sts 0x0339, r24 ; 0x800339 ca88: 90 93 3a 03 sts 0x033A, r25 ; 0x80033a ca8c: a0 93 3b 03 sts 0x033B, r26 ; 0x80033b ca90: b0 93 3c 03 sts 0x033C, r27 ; 0x80033c int l_feedmultiply = feedmultiply; ca94: c0 91 8e 02 lds r28, 0x028E ; 0x80028e ca98: d0 91 8f 02 lds r29, 0x028F ; 0x80028f feedmultiply = 100; ca9c: 84 e6 ldi r24, 0x64 ; 100 ca9e: 90 e0 ldi r25, 0x00 ; 0 caa0: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f caa4: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); caa8: 88 e4 ldi r24, 0x48 ; 72 caaa: 93 e0 ldi r25, 0x03 ; 3 caac: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> cab0: 10 93 77 02 sts 0x0277, r17 ; 0x800277 <_ZL14check_endstops.lto_priv.388> enable_endstops(enable_endstops_now); return l_feedmultiply; } cab4: ce 01 movw r24, r28 cab6: df 91 pop r29 cab8: cf 91 pop r28 caba: 1f 91 pop r17 cabc: 08 95 ret 0000cabe : 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) { cabe: cf 92 push r12 cac0: df 92 push r13 cac2: ef 92 push r14 cac4: ff 92 push r15 cac6: 0f 93 push r16 cac8: 1f 93 push r17 caca: cf 93 push r28 cacc: 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); cace: 90 e0 ldi r25, 0x00 ; 0 cad0: ec 01 movw r28, r24 cad2: cc 0f add r28, r28 cad4: dd 1f adc r29, r29 cad6: cc 0f add r28, r28 cad8: dd 1f adc r29, r29 cada: fe 01 movw r30, r28 cadc: e1 56 subi r30, 0x61 ; 97 cade: f9 48 sbci r31, 0x89 ; 137 #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); cae0: 25 91 lpm r18, Z+ cae2: 35 91 lpm r19, Z+ cae4: 45 91 lpm r20, Z+ cae6: 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]; cae8: fe 01 movw r30, r28 caea: e1 54 subi r30, 0x41 ; 65 caec: f2 4f sbci r31, 0xF2 ; 242 caee: c0 80 ld r12, Z caf0: d1 80 ldd r13, Z+1 ; 0x01 caf2: e2 80 ldd r14, Z+2 ; 0x02 caf4: f3 80 ldd r15, Z+3 ; 0x03 caf6: 8e 01 movw r16, r28 caf8: 0f 59 subi r16, 0x9F ; 159 cafa: 1d 4e sbci r17, 0xED ; 237 cafc: c7 01 movw r24, r14 cafe: b6 01 movw r22, r12 cb00: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> cb04: f8 01 movw r30, r16 cb06: 60 83 st Z, r22 cb08: 71 83 std Z+1, r23 ; 0x01 cb0a: 82 83 std Z+2, r24 ; 0x02 cb0c: 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); cb0e: fe 01 movw r30, r28 cb10: ed 56 subi r30, 0x6D ; 109 cb12: f9 48 sbci r31, 0x89 ; 137 #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); cb14: 25 91 lpm r18, Z+ cb16: 35 91 lpm r19, Z+ cb18: 45 91 lpm r20, Z+ cb1a: 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]; cb1c: 8e 01 movw r16, r28 cb1e: 0c 5d subi r16, 0xDC ; 220 cb20: 1d 4f sbci r17, 0xFD ; 253 cb22: c7 01 movw r24, r14 cb24: b6 01 movw r22, r12 cb26: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> cb2a: f8 01 movw r30, r16 cb2c: 60 83 st Z, r22 cb2e: 71 83 std Z+1, r23 ; 0x01 cb30: 82 83 std Z+2, r24 ; 0x02 cb32: 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); cb34: fe 01 movw r30, r28 cb36: e9 57 subi r30, 0x79 ; 121 cb38: f9 48 sbci r31, 0x89 ; 137 #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); cb3a: 25 91 lpm r18, Z+ cb3c: 35 91 lpm r19, Z+ cb3e: 45 91 lpm r20, Z+ cb40: 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]; cb42: c8 5e subi r28, 0xE8 ; 232 cb44: dd 4f sbci r29, 0xFD ; 253 cb46: c7 01 movw r24, r14 cb48: b6 01 movw r22, r12 cb4a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> cb4e: 68 83 st Y, r22 cb50: 79 83 std Y+1, r23 ; 0x01 cb52: 8a 83 std Y+2, r24 ; 0x02 cb54: 9b 83 std Y+3, r25 ; 0x03 } cb56: df 91 pop r29 cb58: cf 91 pop r28 cb5a: 1f 91 pop r17 cb5c: 0f 91 pop r16 cb5e: ff 90 pop r15 cb60: ef 90 pop r14 cb62: df 90 pop r13 cb64: cf 90 pop r12 cb66: 08 95 ret 0000cb68 : cb68: 40 e0 ldi r20, 0x00 ; 0 cb6a: 50 e0 ldi r21, 0x00 ; 0 cb6c: ba 01 movw r22, r20 cb6e: 8d ee ldi r24, 0xED ; 237 cb70: 9f e0 ldi r25, 0x0F ; 15 cb72: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 cb76: 40 e0 ldi r20, 0x00 ; 0 cb78: 50 e0 ldi r21, 0x00 ; 0 cb7a: ba 01 movw r22, r20 cb7c: 81 ef ldi r24, 0xF1 ; 241 cb7e: 9f e0 ldi r25, 0x0F ; 15 cb80: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 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(); cb84: 0e 94 68 56 call 0xacd0 ; 0xacd0 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); cb88: 70 e0 ldi r23, 0x00 ; 0 cb8a: 60 e0 ldi r22, 0x00 ; 0 cb8c: 85 e0 ldi r24, 0x05 ; 5 cb8e: 9f e0 ldi r25, 0x0F ; 15 cb90: 0f 94 df a3 call 0x347be ; 0x347be cb94: 70 e0 ldi r23, 0x00 ; 0 cb96: 60 e0 ldi r22, 0x00 ; 0 cb98: 83 e0 ldi r24, 0x03 ; 3 cb9a: 9f e0 ldi r25, 0x0F ; 15 cb9c: 0f 94 df a3 call 0x347be ; 0x347be cba0: 70 e0 ldi r23, 0x00 ; 0 cba2: 60 e0 ldi r22, 0x00 ; 0 cba4: 81 e0 ldi r24, 0x01 ; 1 cba6: 9f e0 ldi r25, 0x0F ; 15 cba8: 0f 94 df a3 call 0x347be ; 0x347be cbac: 70 e0 ldi r23, 0x00 ; 0 cbae: 60 e0 ldi r22, 0x00 ; 0 cbb0: 8f ef ldi r24, 0xFF ; 255 cbb2: 9e e0 ldi r25, 0x0E ; 14 cbb4: 0f 94 df a3 call 0x347be ; 0x347be cbb8: 70 e0 ldi r23, 0x00 ; 0 cbba: 60 e0 ldi r22, 0x00 ; 0 cbbc: 83 ed ldi r24, 0xD3 ; 211 cbbe: 9e e0 ldi r25, 0x0E ; 14 cbc0: 0f 94 df a3 call 0x347be ; 0x347be cbc4: 70 e0 ldi r23, 0x00 ; 0 cbc6: 60 e0 ldi r22, 0x00 ; 0 cbc8: 80 ed ldi r24, 0xD0 ; 208 cbca: 9e e0 ldi r25, 0x0E ; 14 cbcc: 0f 94 df a3 call 0x347be ; 0x347be if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); cbd0: 40 e0 ldi r20, 0x00 ; 0 cbd2: 50 e0 ldi r21, 0x00 ; 0 cbd4: ba 01 movw r22, r20 cbd6: 88 ea ldi r24, 0xA8 ; 168 cbd8: 9c e0 ldi r25, 0x0C ; 12 cbda: 0d 94 d3 a3 jmp 0x347a6 ; 0x347a6 0000cbde : wdt_disable(); } } void softReset(void) { cli(); cbde: 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" ); cbe0: 88 e1 ldi r24, 0x18 ; 24 cbe2: 9f e0 ldi r25, 0x0F ; 15 cbe4: 0f b6 in r0, 0x3f ; 63 cbe6: f8 94 cli cbe8: a8 95 wdr cbea: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cbee: 0f be out 0x3f, r0 ; 63 cbf0: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cbf4: ff cf rjmp .-2 ; 0xcbf4 0000cbf6 : } #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); cbf6: 85 ea ldi r24, 0xA5 ; 165 cbf8: 9f e0 ldi r25, 0x0F ; 15 cbfa: 0f 94 9d a3 call 0x3473a ; 0x3473a cbfe: 91 e0 ldi r25, 0x01 ; 1 cc00: 81 11 cpse r24, r1 cc02: 01 c0 rjmp .+2 ; 0xcc06 cc04: 90 e0 ldi r25, 0x00 ; 0 } cc06: 89 2f mov r24, r25 cc08: 08 95 ret 0000cc0a : 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(); cc0a: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd cc0e: 81 11 cpse r24, r1 cc10: 06 c0 rjmp .+12 ; 0xcc1e cc12: 81 e0 ldi r24, 0x01 ; 1 cc14: 90 91 8b 03 lds r25, 0x038B ; 0x80038b cc18: 92 30 cpi r25, 0x02 ; 2 cc1a: 09 f0 breq .+2 ; 0xcc1e cc1c: 80 e0 ldi r24, 0x00 ; 0 } cc1e: 08 95 ret 0000cc20 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); cc20: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 cc24: 81 11 cpse r24, r1 cc26: 0a c0 rjmp .+20 ; 0xcc3c cc28: 80 91 42 12 lds r24, 0x1242 ; 0x801242 cc2c: 81 11 cpse r24, r1 cc2e: 06 c0 rjmp .+12 ; 0xcc3c cc30: 81 e0 ldi r24, 0x01 ; 1 cc32: 90 91 8b 03 lds r25, 0x038B ; 0x80038b cc36: 91 30 cpi r25, 0x01 ; 1 cc38: 09 f0 breq .+2 ; 0xcc3c cc3a: 80 e0 ldi r24, 0x00 ; 0 } cc3c: 08 95 ret 0000cc3e : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { cc3e: cf 93 push r28 cc40: df 93 push r29 return ( !homing_flag cc42: c0 91 71 12 lds r28, 0x1271 ; 0x801271 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cc46: c1 11 cpse r28, r1 cc48: 1f c0 rjmp .+62 ; 0xcc88 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag cc4a: 80 91 72 12 lds r24, 0x1272 ; 0x801272 cc4e: 81 11 cpse r24, r1 cc50: 1c c0 rjmp .+56 ; 0xcc8a && !printingIsPaused() cc52: 0e 94 05 66 call 0xcc0a ; 0xcc0a cc56: 81 11 cpse r24, r1 cc58: 18 c0 rjmp .+48 ; 0xcc8a && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cc5a: d0 91 5e 0d lds r29, 0x0D5E ; 0x800d5e cc5e: d4 30 cpi r29, 0x04 ; 4 cc60: 61 f4 brne .+24 ; 0xcc7a cc62: 80 91 5d 12 lds r24, 0x125D ; 0x80125d cc66: 90 91 5e 12 lds r25, 0x125E ; 0x80125e cc6a: 89 2b or r24, r25 cc6c: 91 f4 brne .+36 ; 0xcc92 cc6e: 80 91 59 12 lds r24, 0x1259 ; 0x801259 cc72: 90 91 5a 12 lds r25, 0x125A ; 0x80125a cc76: 89 2b or r24, r25 cc78: 61 f4 brne .+24 ; 0xcc92 || printJobOngoing() cc7a: 0e 94 10 66 call 0xcc20 ; 0xcc20 cc7e: c8 2f mov r28, r24 cc80: 81 11 cpse r24, r1 cc82: 03 c0 rjmp .+6 ; 0xcc8a || lcd_commands_type == LcdCommands::Idle cc84: c1 e0 ldi r28, 0x01 ; 1 cc86: 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) cc88: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } cc8a: 8c 2f mov r24, r28 cc8c: df 91 pop r29 cc8e: cf 91 pop r28 cc90: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cc92: c1 e0 ldi r28, 0x01 ; 1 cc94: fa cf rjmp .-12 ; 0xcc8a 0000cc96 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); cc96: 0e 94 1f 66 call 0xcc3e ; 0xcc3e cc9a: 88 23 and r24, r24 cc9c: 89 f0 breq .+34 ; 0xccc0 cc9e: 20 e0 ldi r18, 0x00 ; 0 cca0: 30 e0 ldi r19, 0x00 ; 0 cca2: 40 e0 ldi r20, 0x00 ; 0 cca4: 50 e4 ldi r21, 0x40 ; 64 cca6: 60 91 69 12 lds r22, 0x1269 ; 0x801269 ccaa: 70 91 6a 12 lds r23, 0x126A ; 0x80126a ccae: 80 91 6b 12 lds r24, 0x126B ; 0x80126b ccb2: 90 91 6c 12 lds r25, 0x126C ; 0x80126c ccb6: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> ccba: 88 1f adc r24, r24 ccbc: 88 27 eor r24, r24 ccbe: 88 1f adc r24, r24 } ccc0: 08 95 ret 0000ccc2 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() ccc2: 0e 94 10 66 call 0xcc20 ; 0xcc20 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; ccc6: 81 11 cpse r24, r1 ccc8: 18 c0 rjmp .+48 ; 0xccfa return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() ccca: 0e 94 05 66 call 0xcc0a ; 0xcc0a ccce: 81 11 cpse r24, r1 ccd0: 14 c0 rjmp .+40 ; 0xccfa || saved_printing ccd2: 80 91 73 12 lds r24, 0x1273 ; 0x801273 ccd6: 81 11 cpse r24, r1 ccd8: 10 c0 rjmp .+32 ; 0xccfa || (lcd_commands_type != LcdCommands::Idle) ccda: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e ccde: 81 11 cpse r24, r1 cce0: 0b c0 rjmp .+22 ; 0xccf8 || MMU2::mmu2.MMU_PRINT_SAVED() cce2: 80 91 02 13 lds r24, 0x1302 ; 0x801302 cce6: 81 11 cpse r24, r1 cce8: 07 c0 rjmp .+14 ; 0xccf8 || homing_flag ccea: 80 91 71 12 lds r24, 0x1271 ; 0x801271 ccee: 81 11 cpse r24, r1 ccf0: 04 c0 rjmp .+8 ; 0xccfa || mesh_bed_leveling_flag; ccf2: 80 91 72 12 lds r24, 0x1272 ; 0x801272 ccf6: 08 95 ret ccf8: 81 e0 ldi r24, 0x01 ; 1 } ccfa: 08 95 ret 0000ccfc : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } ccfc: 80 e1 ldi r24, 0x10 ; 16 ccfe: e1 e6 ldi r30, 0x61 ; 97 cd00: f2 e1 ldi r31, 0x12 ; 18 cd02: a9 e2 ldi r26, 0x29 ; 41 cd04: b6 e0 ldi r27, 0x06 ; 6 cd06: 01 90 ld r0, Z+ cd08: 0d 92 st X+, r0 cd0a: 8a 95 dec r24 cd0c: e1 f7 brne .-8 ; 0xcd06 cd0e: 08 95 ret 0000cd10 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { cd10: 4f 92 push r4 cd12: 5f 92 push r5 cd14: 6f 92 push r6 cd16: 7f 92 push r7 cd18: 8f 92 push r8 cd1a: 9f 92 push r9 cd1c: af 92 push r10 cd1e: bf 92 push r11 cd20: cf 92 push r12 cd22: df 92 push r13 cd24: ef 92 push r14 cd26: ff 92 push r15 cd28: 0f 93 push r16 cd2a: 1f 93 push r17 cd2c: cf 93 push r28 cd2e: df 93 push r29 cd30: 00 d0 rcall .+0 ; 0xcd32 cd32: 00 d0 rcall .+0 ; 0xcd34 cd34: 1f 92 push r1 cd36: 1f 92 push r1 cd38: cd b7 in r28, 0x3d ; 61 cd3a: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; cd3c: 20 91 73 12 lds r18, 0x1273 ; 0x801273 cd40: 22 23 and r18, r18 cd42: 09 f4 brne .+2 ; 0xcd46 cd44: 73 c1 rjmp .+742 ; 0xd02c #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; cd46: 20 91 ce 03 lds r18, 0x03CE ; 0x8003ce cd4a: 22 30 cpi r18, 0x02 ; 2 cd4c: 09 f4 brne .+2 ; 0xcd50 cd4e: 6e c1 rjmp .+732 ; 0xd02c if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb cd50: 20 91 ce 03 lds r18, 0x03CE ; 0x8003ce cd54: 21 30 cpi r18, 0x01 ; 1 cd56: 11 f4 brne .+4 ; 0xcd5c cd58: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce cd5c: 2b 01 movw r4, r22 cd5e: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; cd60: 10 92 55 12 sts 0x1255, r1 ; 0x801255 // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) cd64: 10 91 58 12 lds r17, 0x1258 ; 0x801258 cd68: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc cd6c: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd cd70: 80 91 be 03 lds r24, 0x03BE ; 0x8003be cd74: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf cd78: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> cd7c: 61 17 cp r22, r17 cd7e: 31 f0 breq .+12 ; 0xcd8c resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; cd80: 81 2f mov r24, r17 cd82: 90 e0 ldi r25, 0x00 ; 0 cd84: 90 93 5a 12 sts 0x125A, r25 ; 0x80125a cd88: 80 93 59 12 sts 0x1259, r24 ; 0x801259 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); cd8c: 0e 94 f3 63 call 0xc7e6 ; 0xc7e6 // Restore saved fan speed fanSpeed = saved_fan_speed; cd90: 80 91 54 12 lds r24, 0x1254 ; 0x801254 cd94: 80 93 55 12 sts 0x1255, r24 ; 0x801255 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; cd98: 90 91 57 12 lds r25, 0x1257 ; 0x801257 cd9c: 80 91 56 12 lds r24, 0x1256 ; 0x801256 cda0: 81 95 neg r24 cda2: 89 27 eor r24, r25 cda4: 88 70 andi r24, 0x08 ; 8 cda6: 89 27 eor r24, r25 cda8: 80 93 57 12 sts 0x1257, r24 ; 0x801257 float e = saved_pos[E_AXIS] - e_move; cdac: a3 01 movw r20, r6 cdae: 92 01 movw r18, r4 cdb0: 60 91 9c 02 lds r22, 0x029C ; 0x80029c cdb4: 70 91 9d 02 lds r23, 0x029D ; 0x80029d cdb8: 80 91 9e 02 lds r24, 0x029E ; 0x80029e cdbc: 90 91 9f 02 lds r25, 0x029F ; 0x80029f cdc0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> cdc4: 6d 83 std Y+5, r22 ; 0x05 cdc6: 7e 83 std Y+6, r23 ; 0x06 cdc8: 8f 83 std Y+7, r24 ; 0x07 cdca: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); cdcc: ce 01 movw r24, r28 cdce: 05 96 adiw r24, 0x05 ; 5 cdd0: 0f 94 62 3a call 0x274c4 ; 0x274c4 #ifdef FANCHECK fans_check_enabled = false; cdd4: 10 92 40 02 sts 0x0240, r1 ; 0x800240 #endif // do not restore XY for commands that do not require that if (saved_pos[X_AXIS] == X_COORD_INVALID) cdd8: 20 e0 ldi r18, 0x00 ; 0 cdda: 30 e0 ldi r19, 0x00 ; 0 cddc: 40 e8 ldi r20, 0x80 ; 128 cdde: 5f eb ldi r21, 0xBF ; 191 cde0: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cde4: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cde8: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cdec: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cdf0: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> cdf4: 81 11 cpse r24, r1 cdf6: 20 c0 rjmp .+64 ; 0xce38 { saved_pos[X_AXIS] = current_position[X_AXIS]; cdf8: 80 91 61 12 lds r24, 0x1261 ; 0x801261 cdfc: 90 91 62 12 lds r25, 0x1262 ; 0x801262 ce00: a0 91 63 12 lds r26, 0x1263 ; 0x801263 ce04: b0 91 64 12 lds r27, 0x1264 ; 0x801264 ce08: 80 93 90 02 sts 0x0290, r24 ; 0x800290 ce0c: 90 93 91 02 sts 0x0291, r25 ; 0x800291 ce10: a0 93 92 02 sts 0x0292, r26 ; 0x800292 ce14: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_pos[Y_AXIS] = current_position[Y_AXIS]; ce18: 80 91 65 12 lds r24, 0x1265 ; 0x801265 ce1c: 90 91 66 12 lds r25, 0x1266 ; 0x801266 ce20: a0 91 67 12 lds r26, 0x1267 ; 0x801267 ce24: b0 91 68 12 lds r27, 0x1268 ; 0x801268 ce28: 80 93 94 02 sts 0x0294, r24 ; 0x800294 ce2c: 90 93 95 02 sts 0x0295, r25 ; 0x800295 ce30: a0 93 96 02 sts 0x0296, r26 ; 0x800296 ce34: b0 93 97 02 sts 0x0297, r27 ; 0x800297 } //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); ce38: a3 01 movw r20, r6 ce3a: 92 01 movw r18, r4 ce3c: 60 91 9c 02 lds r22, 0x029C ; 0x80029c ce40: 70 91 9d 02 lds r23, 0x029D ; 0x80029d ce44: 80 91 9e 02 lds r24, 0x029E ; 0x80029e ce48: 90 91 9f 02 lds r25, 0x029F ; 0x80029f ce4c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> ce50: 69 83 std Y+1, r22 ; 0x01 ce52: 7a 83 std Y+2, r23 ; 0x02 ce54: 8b 83 std Y+3, r24 ; 0x03 ce56: 9c 83 std Y+4, r25 ; 0x04 ce58: e0 90 69 12 lds r14, 0x1269 ; 0x801269 ce5c: f0 90 6a 12 lds r15, 0x126A ; 0x80126a ce60: 00 91 6b 12 lds r16, 0x126B ; 0x80126b ce64: 10 91 6c 12 lds r17, 0x126C ; 0x80126c ce68: 20 91 94 02 lds r18, 0x0294 ; 0x800294 ce6c: 30 91 95 02 lds r19, 0x0295 ; 0x800295 ce70: 40 91 96 02 lds r20, 0x0296 ; 0x800296 ce74: 50 91 97 02 lds r21, 0x0297 ; 0x800297 ce78: 60 91 90 02 lds r22, 0x0290 ; 0x800290 ce7c: 70 91 91 02 lds r23, 0x0291 ; 0x800291 ce80: 80 91 92 02 lds r24, 0x0292 ; 0x800292 ce84: 90 91 93 02 lds r25, 0x0293 ; 0x800293 ce88: 1f 92 push r1 ce8a: 1f 92 push r1 ce8c: 1f 92 push r1 ce8e: 1f 92 push r1 ce90: e2 e6 ldi r30, 0x62 ; 98 ce92: 8e 2e mov r8, r30 ce94: e7 e2 ldi r30, 0x27 ; 39 ce96: 9e 2e mov r9, r30 ce98: e6 e7 ldi r30, 0x76 ; 118 ce9a: ae 2e mov r10, r30 ce9c: e2 e4 ldi r30, 0x42 ; 66 ce9e: be 2e mov r11, r30 cea0: fe 01 movw r30, r28 cea2: 31 96 adiw r30, 0x01 ; 1 cea4: 6f 01 movw r12, r30 cea6: 0f 94 bc 3a call 0x27578 ; 0x27578 //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); ceaa: a3 01 movw r20, r6 ceac: 92 01 movw r18, r4 ceae: 60 91 9c 02 lds r22, 0x029C ; 0x80029c ceb2: 70 91 9d 02 lds r23, 0x029D ; 0x80029d ceb6: 80 91 9e 02 lds r24, 0x029E ; 0x80029e ceba: 90 91 9f 02 lds r25, 0x029F ; 0x80029f cebe: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> cec2: 69 83 std Y+1, r22 ; 0x01 cec4: 7a 83 std Y+2, r23 ; 0x02 cec6: 8b 83 std Y+3, r24 ; 0x03 cec8: 9c 83 std Y+4, r25 ; 0x04 ceca: e0 90 98 02 lds r14, 0x0298 ; 0x800298 cece: f0 90 99 02 lds r15, 0x0299 ; 0x800299 ced2: 00 91 9a 02 lds r16, 0x029A ; 0x80029a ced6: 10 91 9b 02 lds r17, 0x029B ; 0x80029b ceda: 20 91 94 02 lds r18, 0x0294 ; 0x800294 cede: 30 91 95 02 lds r19, 0x0295 ; 0x800295 cee2: 40 91 96 02 lds r20, 0x0296 ; 0x800296 cee6: 50 91 97 02 lds r21, 0x0297 ; 0x800297 ceea: 60 91 90 02 lds r22, 0x0290 ; 0x800290 ceee: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cef2: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cef6: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cefa: 1f 92 push r1 cefc: 1f 92 push r1 cefe: 1f 92 push r1 cf00: 1f 92 push r1 cf02: 0f 94 bc 3a call 0x27578 ; 0x27578 //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); cf06: e0 90 98 02 lds r14, 0x0298 ; 0x800298 cf0a: f0 90 99 02 lds r15, 0x0299 ; 0x800299 cf0e: 00 91 9a 02 lds r16, 0x029A ; 0x80029a cf12: 10 91 9b 02 lds r17, 0x029B ; 0x80029b cf16: 20 91 94 02 lds r18, 0x0294 ; 0x800294 cf1a: 30 91 95 02 lds r19, 0x0295 ; 0x800295 cf1e: 40 91 96 02 lds r20, 0x0296 ; 0x800296 cf22: 50 91 97 02 lds r21, 0x0297 ; 0x800297 cf26: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cf2a: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cf2e: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cf32: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cf36: 1f 92 push r1 cf38: 1f 92 push r1 cf3a: 1f 92 push r1 cf3c: 1f 92 push r1 cf3e: 81 2c mov r8, r1 cf40: 91 2c mov r9, r1 cf42: f8 ee ldi r31, 0xE8 ; 232 cf44: af 2e mov r10, r31 cf46: f2 e4 ldi r31, 0x42 ; 66 cf48: bf 2e mov r11, r31 cf4a: ac e9 ldi r26, 0x9C ; 156 cf4c: ca 2e mov r12, r26 cf4e: a2 e0 ldi r26, 0x02 ; 2 cf50: da 2e mov r13, r26 cf52: 0f 94 bc 3a call 0x27578 ; 0x27578 st_synchronize(); cf56: 0f 94 b0 18 call 0x23160 ; 0x23160 #ifdef FANCHECK fans_check_enabled = true; cf5a: 11 e0 ldi r17, 0x01 ; 1 cf5c: 10 93 40 02 sts 0x0240, r17 ; 0x800240 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; cf60: 60 91 4f 12 lds r22, 0x124F ; 0x80124f cf64: 70 91 50 12 lds r23, 0x1250 ; 0x801250 cf68: 90 e0 ldi r25, 0x00 ; 0 cf6a: 80 e0 ldi r24, 0x00 ; 0 cf6c: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> cf70: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a cf74: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b cf78: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c cf7c: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedmultiply = saved_feedmultiply2; cf80: 80 91 5f 12 lds r24, 0x125F ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.498> cf84: 90 91 60 12 lds r25, 0x1260 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.498+0x1> cf88: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f cf8c: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e memcpy(current_position, saved_pos, sizeof(saved_pos)); cf90: 80 e1 ldi r24, 0x10 ; 16 cf92: e0 e9 ldi r30, 0x90 ; 144 cf94: f2 e0 ldi r31, 0x02 ; 2 cf96: a1 e6 ldi r26, 0x61 ; 97 cf98: b2 e1 ldi r27, 0x12 ; 18 cf9a: 01 90 ld r0, Z+ cf9c: 0d 92 st X+, r0 cf9e: 8a 95 dec r24 cfa0: e1 f7 brne .-8 ; 0xcf9a set_destination_to_current(); cfa2: 0e 94 7e 66 call 0xccfc ; 0xccfc //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing cfa6: 80 91 79 02 lds r24, 0x0279 ; 0x800279 cfaa: 0f b6 in r0, 0x3f ; 63 cfac: f8 94 cli cfae: de bf out 0x3e, r29 ; 62 cfb0: 0f be out 0x3f, r0 ; 63 cfb2: cd bf out 0x3d, r28 ; 61 cfb4: 81 11 cpse r24, r1 cfb6: 51 c0 rjmp .+162 ; 0xd05a card.setIndex(saved_sdpos); cfb8: 60 91 45 12 lds r22, 0x1245 ; 0x801245 cfbc: 70 91 46 12 lds r23, 0x1246 ; 0x801246 cfc0: 80 91 47 12 lds r24, 0x1247 ; 0x801247 cfc4: 90 91 48 12 lds r25, 0x1248 ; 0x801248 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; cfc8: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb cfcc: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec cfd0: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed cfd4: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee cfd8: 0f 94 e8 67 call 0x2cfd0 ; 0x2cfd0 sdpos_atomic = saved_sdpos; cfdc: 80 91 45 12 lds r24, 0x1245 ; 0x801245 cfe0: 90 91 46 12 lds r25, 0x1246 ; 0x801246 cfe4: a0 91 47 12 lds r26, 0x1247 ; 0x801247 cfe8: b0 91 48 12 lds r27, 0x1248 ; 0x801248 cfec: 80 93 49 12 sts 0x1249, r24 ; 0x801249 cff0: 90 93 4a 12 sts 0x124A, r25 ; 0x80124a cff4: a0 93 4b 12 sts 0x124B, r26 ; 0x80124b cff8: b0 93 4c 12 sts 0x124C, r27 ; 0x80124c card.sdprinting = true; cffc: 10 93 d7 13 sts 0x13D7, r17 ; 0x8013d7 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); d000: 60 e0 ldi r22, 0x00 ; 0 d002: 85 ea ldi r24, 0xA5 ; 165 d004: 9f e0 ldi r25, 0x0F ; 15 d006: 0f 94 c1 a3 call 0x34782 ; 0x34782 d00a: 60 e0 ldi r22, 0x00 ; 0 d00c: 8f e7 ldi r24, 0x7F ; 127 d00e: 9c e0 ldi r25, 0x0C ; 12 d010: 0f 94 c1 a3 call 0x34782 ; 0x34782 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); d014: 86 ee ldi r24, 0xE6 ; 230 d016: 9b e6 ldi r25, 0x6B ; 107 d018: 0e 94 85 dc call 0x1b90a ; 0x1b90a saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d01c: 82 e0 ldi r24, 0x02 ; 2 d01e: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; d022: 10 92 73 12 sts 0x1273, r1 ; 0x801273 planner_aborted = true; // unroll the stack d026: 81 e0 ldi r24, 0x01 ; 1 d028: 80 93 42 0d sts 0x0D42, r24 ; 0x800d42 } d02c: 28 96 adiw r28, 0x08 ; 8 d02e: 0f b6 in r0, 0x3f ; 63 d030: f8 94 cli d032: de bf out 0x3e, r29 ; 62 d034: 0f be out 0x3f, r0 ; 63 d036: cd bf out 0x3d, r28 ; 61 d038: df 91 pop r29 d03a: cf 91 pop r28 d03c: 1f 91 pop r17 d03e: 0f 91 pop r16 d040: ff 90 pop r15 d042: ef 90 pop r14 d044: df 90 pop r13 d046: cf 90 pop r12 d048: bf 90 pop r11 d04a: af 90 pop r10 d04c: 9f 90 pop r9 d04e: 8f 90 pop r8 d050: 7f 90 pop r7 d052: 6f 90 pop r6 d054: 5f 90 pop r5 d056: 4f 90 pop r4 d058: 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 d05a: 81 30 cpi r24, 0x01 ; 1 d05c: 89 f6 brne .-94 ; 0xd000 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d05e: 80 91 45 12 lds r24, 0x1245 ; 0x801245 d062: 90 91 46 12 lds r25, 0x1246 ; 0x801246 d066: a0 91 47 12 lds r26, 0x1247 ; 0x801247 d06a: b0 91 48 12 lds r27, 0x1248 ; 0x801248 d06e: 80 93 3e 12 sts 0x123E, r24 ; 0x80123e d072: 90 93 3f 12 sts 0x123F, r25 ; 0x80123f d076: a0 93 40 12 sts 0x1240, r26 ; 0x801240 d07a: b0 93 41 12 sts 0x1241, r27 ; 0x801241 serial_count = 0; d07e: 10 92 48 10 sts 0x1048, r1 ; 0x801048 d082: 10 92 47 10 sts 0x1047, r1 ; 0x801047 FlushSerialRequestResend(); d086: 0e 94 ac 55 call 0xab58 ; 0xab58 d08a: ba cf rjmp .-140 ; 0xd000 0000d08c : 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) { d08c: 3f 92 push r3 d08e: 4f 92 push r4 d090: 5f 92 push r5 d092: 6f 92 push r6 d094: 7f 92 push r7 d096: 8f 92 push r8 d098: 9f 92 push r9 d09a: af 92 push r10 d09c: bf 92 push r11 d09e: cf 92 push r12 d0a0: df 92 push r13 d0a2: ef 92 push r14 d0a4: ff 92 push r15 d0a6: 0f 93 push r16 d0a8: 1f 93 push r17 d0aa: cf 93 push r28 d0ac: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d0ae: 30 90 a2 04 lds r3, 0x04A2 ; 0x8004a2 d0b2: 33 20 and r3, r3 d0b4: 09 f4 brne .+2 ; 0xd0b8 d0b6: 80 c0 rjmp .+256 ; 0xd1b8 d0b8: 8b 01 movw r16, r22 d0ba: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d0bc: 31 fe sbrs r3, 1 d0be: 54 c0 rjmp .+168 ; 0xd168 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d0c0: 88 80 ld r8, Y d0c2: 99 80 ldd r9, Y+1 ; 0x01 d0c4: aa 80 ldd r10, Y+2 ; 0x02 d0c6: bb 80 ldd r11, Y+3 ; 0x03 d0c8: fb 01 movw r30, r22 d0ca: c0 80 ld r12, Z d0cc: d1 80 ldd r13, Z+1 ; 0x01 d0ce: e2 80 ldd r14, Z+2 ; 0x02 d0d0: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d0d2: 20 91 77 03 lds r18, 0x0377 ; 0x800377 d0d6: 30 91 78 03 lds r19, 0x0378 ; 0x800378 d0da: 40 91 79 03 lds r20, 0x0379 ; 0x800379 d0de: 50 91 7a 03 lds r21, 0x037A ; 0x80037a d0e2: c5 01 movw r24, r10 d0e4: b4 01 movw r22, r8 d0e6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d0ea: 2b 01 movw r4, r22 d0ec: 3c 01 movw r6, r24 d0ee: 20 91 7b 03 lds r18, 0x037B ; 0x80037b d0f2: 30 91 7c 03 lds r19, 0x037C ; 0x80037c d0f6: 40 91 7d 03 lds r20, 0x037D ; 0x80037d d0fa: 50 91 7e 03 lds r21, 0x037E ; 0x80037e d0fe: c7 01 movw r24, r14 d100: b6 01 movw r22, r12 d102: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d106: 9b 01 movw r18, r22 d108: ac 01 movw r20, r24 d10a: c3 01 movw r24, r6 d10c: b2 01 movw r22, r4 d10e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d112: 2b 01 movw r4, r22 d114: 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; d116: 20 91 6f 03 lds r18, 0x036F ; 0x80036f d11a: 30 91 70 03 lds r19, 0x0370 ; 0x800370 d11e: 40 91 71 03 lds r20, 0x0371 ; 0x800371 d122: 50 91 72 03 lds r21, 0x0372 ; 0x800372 d126: c5 01 movw r24, r10 d128: b4 01 movw r22, r8 d12a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d12e: 4b 01 movw r8, r22 d130: 5c 01 movw r10, r24 d132: 20 91 73 03 lds r18, 0x0373 ; 0x800373 d136: 30 91 74 03 lds r19, 0x0374 ; 0x800374 d13a: 40 91 75 03 lds r20, 0x0375 ; 0x800375 d13e: 50 91 76 03 lds r21, 0x0376 ; 0x800376 d142: c7 01 movw r24, r14 d144: b6 01 movw r22, r12 d146: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d14a: 9b 01 movw r18, r22 d14c: ac 01 movw r20, r24 d14e: c5 01 movw r24, r10 d150: b4 01 movw r22, r8 d152: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d156: 68 83 st Y, r22 d158: 79 83 std Y+1, r23 ; 0x01 d15a: 8a 83 std Y+2, r24 ; 0x02 d15c: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d15e: f8 01 movw r30, r16 d160: 40 82 st Z, r4 d162: 51 82 std Z+1, r5 ; 0x01 d164: 62 82 std Z+2, r6 ; 0x02 d166: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d168: 30 fe sbrs r3, 0 d16a: 26 c0 rjmp .+76 ; 0xd1b8 // Then add the offset. x += world2machine_shift[0]; d16c: 20 91 9a 04 lds r18, 0x049A ; 0x80049a d170: 30 91 9b 04 lds r19, 0x049B ; 0x80049b d174: 40 91 9c 04 lds r20, 0x049C ; 0x80049c d178: 50 91 9d 04 lds r21, 0x049D ; 0x80049d d17c: 68 81 ld r22, Y d17e: 79 81 ldd r23, Y+1 ; 0x01 d180: 8a 81 ldd r24, Y+2 ; 0x02 d182: 9b 81 ldd r25, Y+3 ; 0x03 d184: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d188: 68 83 st Y, r22 d18a: 79 83 std Y+1, r23 ; 0x01 d18c: 8a 83 std Y+2, r24 ; 0x02 d18e: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d190: 20 91 9e 04 lds r18, 0x049E ; 0x80049e d194: 30 91 9f 04 lds r19, 0x049F ; 0x80049f d198: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 d19c: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 d1a0: f8 01 movw r30, r16 d1a2: 60 81 ld r22, Z d1a4: 71 81 ldd r23, Z+1 ; 0x01 d1a6: 82 81 ldd r24, Z+2 ; 0x02 d1a8: 93 81 ldd r25, Z+3 ; 0x03 d1aa: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d1ae: f8 01 movw r30, r16 d1b0: 60 83 st Z, r22 d1b2: 71 83 std Z+1, r23 ; 0x01 d1b4: 82 83 std Z+2, r24 ; 0x02 d1b6: 93 83 std Z+3, r25 ; 0x03 } } } d1b8: df 91 pop r29 d1ba: cf 91 pop r28 d1bc: 1f 91 pop r17 d1be: 0f 91 pop r16 d1c0: ff 90 pop r15 d1c2: ef 90 pop r14 d1c4: df 90 pop r13 d1c6: cf 90 pop r12 d1c8: bf 90 pop r11 d1ca: af 90 pop r10 d1cc: 9f 90 pop r9 d1ce: 8f 90 pop r8 d1d0: 7f 90 pop r7 d1d2: 6f 90 pop r6 d1d4: 5f 90 pop r5 d1d6: 4f 90 pop r4 d1d8: 3f 90 pop r3 d1da: 08 95 ret 0000d1dc : } } } inline bool world2machine_clamp(float &x, float &y) { d1dc: 2f 92 push r2 d1de: 3f 92 push r3 d1e0: 4f 92 push r4 d1e2: 5f 92 push r5 d1e4: 6f 92 push r6 d1e6: 7f 92 push r7 d1e8: 8f 92 push r8 d1ea: 9f 92 push r9 d1ec: af 92 push r10 d1ee: bf 92 push r11 d1f0: cf 92 push r12 d1f2: df 92 push r13 d1f4: ef 92 push r14 d1f6: ff 92 push r15 d1f8: 0f 93 push r16 d1fa: 1f 93 push r17 d1fc: cf 93 push r28 d1fe: df 93 push r29 d200: 00 d0 rcall .+0 ; 0xd202 d202: 00 d0 rcall .+0 ; 0xd204 d204: 1f 92 push r1 d206: 1f 92 push r1 d208: cd b7 in r28, 0x3d ; 61 d20a: de b7 in r29, 0x3e ; 62 d20c: 8c 01 movw r16, r24 d20e: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d210: fc 01 movw r30, r24 d212: 80 81 ld r24, Z d214: 91 81 ldd r25, Z+1 ; 0x01 d216: a2 81 ldd r26, Z+2 ; 0x02 d218: b3 81 ldd r27, Z+3 ; 0x03 d21a: 89 83 std Y+1, r24 ; 0x01 d21c: 9a 83 std Y+2, r25 ; 0x02 d21e: ab 83 std Y+3, r26 ; 0x03 d220: bc 83 std Y+4, r27 ; 0x04 out_y = y; d222: fb 01 movw r30, r22 d224: 80 81 ld r24, Z d226: 91 81 ldd r25, Z+1 ; 0x01 d228: a2 81 ldd r26, Z+2 ; 0x02 d22a: b3 81 ldd r27, Z+3 ; 0x03 d22c: 8d 83 std Y+5, r24 ; 0x05 d22e: 9e 83 std Y+6, r25 ; 0x06 d230: af 83 std Y+7, r26 ; 0x07 d232: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d234: be 01 movw r22, r28 d236: 6b 5f subi r22, 0xFB ; 251 d238: 7f 4f sbci r23, 0xFF ; 255 d23a: ce 01 movw r24, r28 d23c: 01 96 adiw r24, 0x01 ; 1 d23e: 0e 94 46 68 call 0xd08c ; 0xd08c inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d242: c9 80 ldd r12, Y+1 ; 0x01 d244: da 80 ldd r13, Y+2 ; 0x02 d246: eb 80 ldd r14, Y+3 ; 0x03 d248: fc 80 ldd r15, Y+4 ; 0x04 d24a: 20 e0 ldi r18, 0x00 ; 0 d24c: 30 e0 ldi r19, 0x00 ; 0 d24e: a9 01 movw r20, r18 d250: c7 01 movw r24, r14 d252: b6 01 movw r22, r12 d254: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> d258: 87 ff sbrs r24, 7 d25a: 35 c0 rjmp .+106 ; 0xd2c6 tmpx = X_MIN_POS; d25c: 19 82 std Y+1, r1 ; 0x01 d25e: 1a 82 std Y+2, r1 ; 0x02 d260: 1b 82 std Y+3, r1 ; 0x03 d262: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d264: ff 24 eor r15, r15 d266: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d268: 8d 80 ldd r8, Y+5 ; 0x05 d26a: 9e 80 ldd r9, Y+6 ; 0x06 d26c: af 80 ldd r10, Y+7 ; 0x07 d26e: b8 84 ldd r11, Y+8 ; 0x08 d270: 20 e0 ldi r18, 0x00 ; 0 d272: 30 e0 ldi r19, 0x00 ; 0 d274: 40 e8 ldi r20, 0x80 ; 128 d276: 50 ec ldi r21, 0xC0 ; 192 d278: c5 01 movw r24, r10 d27a: b4 01 movw r22, r8 d27c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> d280: 87 ff sbrs r24, 7 d282: 35 c0 rjmp .+106 ; 0xd2ee tmpy = Y_MIN_POS; d284: 80 e0 ldi r24, 0x00 ; 0 d286: 90 e0 ldi r25, 0x00 ; 0 d288: a0 e8 ldi r26, 0x80 ; 128 d28a: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d28c: 8d 83 std Y+5, r24 ; 0x05 d28e: 9e 83 std Y+6, r25 ; 0x06 d290: af 83 std Y+7, r26 ; 0x07 d292: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d294: cd 80 ldd r12, Y+5 ; 0x05 d296: de 80 ldd r13, Y+6 ; 0x06 d298: ef 80 ldd r14, Y+7 ; 0x07 d29a: f8 84 ldd r15, Y+8 ; 0x08 d29c: 89 80 ldd r8, Y+1 ; 0x01 d29e: 9a 80 ldd r9, Y+2 ; 0x02 d2a0: ab 80 ldd r10, Y+3 ; 0x03 d2a2: 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) { d2a4: 70 90 a2 04 lds r7, 0x04A2 ; 0x8004a2 d2a8: 71 10 cpse r7, r1 d2aa: 4c c0 rjmp .+152 ; 0xd344 // No correction. out_x = x; d2ac: f8 01 movw r30, r16 d2ae: 80 82 st Z, r8 d2b0: 91 82 std Z+1, r9 ; 0x01 d2b2: a2 82 std Z+2, r10 ; 0x02 d2b4: b3 82 std Z+3, r11 ; 0x03 out_y = y; d2b6: f1 01 movw r30, r2 d2b8: c0 82 st Z, r12 d2ba: d1 82 std Z+1, r13 ; 0x01 d2bc: e2 82 std Z+2, r14 ; 0x02 d2be: 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) { d2c0: ff 24 eor r15, r15 d2c2: f3 94 inc r15 d2c4: 25 c0 rjmp .+74 ; 0xd310 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) { d2c6: 20 e0 ldi r18, 0x00 ; 0 d2c8: 30 e0 ldi r19, 0x00 ; 0 d2ca: 4a e7 ldi r20, 0x7A ; 122 d2cc: 53 e4 ldi r21, 0x43 ; 67 d2ce: c7 01 movw r24, r14 d2d0: b6 01 movw r22, r12 d2d2: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d2d6: 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) { d2d8: 18 16 cp r1, r24 d2da: 34 f6 brge .-116 ; 0xd268 tmpx = X_MAX_POS; d2dc: 80 e0 ldi r24, 0x00 ; 0 d2de: 90 e0 ldi r25, 0x00 ; 0 d2e0: aa e7 ldi r26, 0x7A ; 122 d2e2: b3 e4 ldi r27, 0x43 ; 67 d2e4: 89 83 std Y+1, r24 ; 0x01 d2e6: 9a 83 std Y+2, r25 ; 0x02 d2e8: ab 83 std Y+3, r26 ; 0x03 d2ea: bc 83 std Y+4, r27 ; 0x04 d2ec: bb cf rjmp .-138 ; 0xd264 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d2ee: 20 e0 ldi r18, 0x00 ; 0 d2f0: 30 e0 ldi r19, 0x00 ; 0 d2f2: 42 e5 ldi r20, 0x52 ; 82 d2f4: 53 e4 ldi r21, 0x43 ; 67 d2f6: c5 01 movw r24, r10 d2f8: b4 01 movw r22, r8 d2fa: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> d2fe: 18 16 cp r1, r24 d300: 2c f4 brge .+10 ; 0xd30c tmpy = Y_MAX_POS; d302: 80 e0 ldi r24, 0x00 ; 0 d304: 90 e0 ldi r25, 0x00 ; 0 d306: a2 e5 ldi r26, 0x52 ; 82 d308: b3 e4 ldi r27, 0x43 ; 67 d30a: c0 cf rjmp .-128 ; 0xd28c clamped = true; } if (clamped) d30c: f1 10 cpse r15, r1 d30e: c2 cf rjmp .-124 ; 0xd294 machine2world(tmpx, tmpy, x, y); return clamped; } d310: 8f 2d mov r24, r15 d312: 28 96 adiw r28, 0x08 ; 8 d314: 0f b6 in r0, 0x3f ; 63 d316: f8 94 cli d318: de bf out 0x3e, r29 ; 62 d31a: 0f be out 0x3f, r0 ; 63 d31c: cd bf out 0x3d, r28 ; 61 d31e: df 91 pop r29 d320: cf 91 pop r28 d322: 1f 91 pop r17 d324: 0f 91 pop r16 d326: ff 90 pop r15 d328: ef 90 pop r14 d32a: df 90 pop r13 d32c: cf 90 pop r12 d32e: bf 90 pop r11 d330: af 90 pop r10 d332: 9f 90 pop r9 d334: 8f 90 pop r8 d336: 7f 90 pop r7 d338: 6f 90 pop r6 d33a: 5f 90 pop r5 d33c: 4f 90 pop r4 d33e: 3f 90 pop r3 d340: 2f 90 pop r2 d342: 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) { d344: 70 fe sbrs r7, 0 d346: 1c c0 rjmp .+56 ; 0xd380 // Then add the offset. x -= world2machine_shift[0]; d348: 20 91 9a 04 lds r18, 0x049A ; 0x80049a d34c: 30 91 9b 04 lds r19, 0x049B ; 0x80049b d350: 40 91 9c 04 lds r20, 0x049C ; 0x80049c d354: 50 91 9d 04 lds r21, 0x049D ; 0x80049d d358: c5 01 movw r24, r10 d35a: b4 01 movw r22, r8 d35c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d360: 4b 01 movw r8, r22 d362: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d364: 20 91 9e 04 lds r18, 0x049E ; 0x80049e d368: 30 91 9f 04 lds r19, 0x049F ; 0x80049f d36c: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 d370: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 d374: c7 01 movw r24, r14 d376: b6 01 movw r22, r12 d378: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d37c: 6b 01 movw r12, r22 d37e: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d380: 71 fe sbrs r7, 1 d382: 9e cf rjmp .-196 ; 0xd2c0 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d384: 20 91 8a 04 lds r18, 0x048A ; 0x80048a d388: 30 91 8b 04 lds r19, 0x048B ; 0x80048b d38c: 40 91 8c 04 lds r20, 0x048C ; 0x80048c d390: 50 91 8d 04 lds r21, 0x048D ; 0x80048d d394: c5 01 movw r24, r10 d396: b4 01 movw r22, r8 d398: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d39c: 2b 01 movw r4, r22 d39e: 3c 01 movw r6, r24 d3a0: 20 91 8e 04 lds r18, 0x048E ; 0x80048e d3a4: 30 91 8f 04 lds r19, 0x048F ; 0x80048f d3a8: 40 91 90 04 lds r20, 0x0490 ; 0x800490 d3ac: 50 91 91 04 lds r21, 0x0491 ; 0x800491 d3b0: c7 01 movw r24, r14 d3b2: b6 01 movw r22, r12 d3b4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d3b8: 9b 01 movw r18, r22 d3ba: ac 01 movw r20, r24 d3bc: c3 01 movw r24, r6 d3be: b2 01 movw r22, r4 d3c0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d3c4: f8 01 movw r30, r16 d3c6: 60 83 st Z, r22 d3c8: 71 83 std Z+1, r23 ; 0x01 d3ca: 82 83 std Z+2, r24 ; 0x02 d3cc: 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; d3ce: 20 91 92 04 lds r18, 0x0492 ; 0x800492 d3d2: 30 91 93 04 lds r19, 0x0493 ; 0x800493 d3d6: 40 91 94 04 lds r20, 0x0494 ; 0x800494 d3da: 50 91 95 04 lds r21, 0x0495 ; 0x800495 d3de: c5 01 movw r24, r10 d3e0: b4 01 movw r22, r8 d3e2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d3e6: 4b 01 movw r8, r22 d3e8: 5c 01 movw r10, r24 d3ea: 20 91 96 04 lds r18, 0x0496 ; 0x800496 d3ee: 30 91 97 04 lds r19, 0x0497 ; 0x800497 d3f2: 40 91 98 04 lds r20, 0x0498 ; 0x800498 d3f6: 50 91 99 04 lds r21, 0x0499 ; 0x800499 d3fa: c7 01 movw r24, r14 d3fc: b6 01 movw r22, r12 d3fe: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d402: 9b 01 movw r18, r22 d404: ac 01 movw r20, r24 d406: c5 01 movw r24, r10 d408: b4 01 movw r22, r8 d40a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d40e: f1 01 movw r30, r2 d410: 60 83 st Z, r22 d412: 71 83 std Z+1, r23 ; 0x01 d414: 82 83 std Z+2, r24 ; 0x02 d416: 93 83 std Z+3, r25 ; 0x03 d418: 53 cf rjmp .-346 ; 0xd2c0 0000d41a : return sampled; } void go_home_with_z_lift() { d41a: cf 93 push r28 d41c: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); d41e: 0e 94 11 65 call 0xca22 ; 0xca22 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; d422: c1 e6 ldi r28, 0x61 ; 97 d424: d2 e1 ldi r29, 0x12 ; 18 d426: 80 e0 ldi r24, 0x00 ; 0 d428: 90 e0 ldi r25, 0x00 ; 0 d42a: a0 ea ldi r26, 0xA0 ; 160 d42c: b0 e4 ldi r27, 0x40 ; 64 d42e: 88 87 std Y+8, r24 ; 0x08 d430: 99 87 std Y+9, r25 ; 0x09 d432: aa 87 std Y+10, r26 ; 0x0a d434: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); d436: 65 e5 ldi r22, 0x55 ; 85 d438: 75 e5 ldi r23, 0x55 ; 85 d43a: 85 e5 ldi r24, 0x55 ; 85 d43c: 91 e4 ldi r25, 0x41 ; 65 d43e: 0f 94 bc 4e call 0x29d78 ; 0x29d78 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; d442: 8d ec ldi r24, 0xCD ; 205 d444: 9c ec ldi r25, 0xCC ; 204 d446: ac e4 ldi r26, 0x4C ; 76 d448: be e3 ldi r27, 0x3E ; 62 d44a: 88 83 st Y, r24 d44c: 99 83 std Y+1, r25 ; 0x01 d44e: aa 83 std Y+2, r26 ; 0x02 d450: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; d452: 83 e3 ldi r24, 0x33 ; 51 d454: 93 e3 ldi r25, 0x33 ; 51 d456: a3 e7 ldi r26, 0x73 ; 115 d458: b0 ec ldi r27, 0xC0 ; 192 d45a: 8c 83 std Y+4, r24 ; 0x04 d45c: 9d 83 std Y+5, r25 ; 0x05 d45e: ae 83 std Y+6, r26 ; 0x06 d460: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); d462: 65 e6 ldi r22, 0x65 ; 101 d464: 72 e1 ldi r23, 0x12 ; 18 d466: ce 01 movw r24, r28 d468: 0e 94 ee 68 call 0xd1dc ; 0xd1dc go_to_current((3 * homing_feedrate[X_AXIS]) / 60); d46c: 60 e0 ldi r22, 0x00 ; 0 d46e: 70 e0 ldi r23, 0x00 ; 0 d470: 86 e1 ldi r24, 0x16 ; 22 d472: 93 e4 ldi r25, 0x43 ; 67 d474: 0f 94 bc 4e call 0x29d78 ; 0x29d78 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; d478: 8a e9 ldi r24, 0x9A ; 154 d47a: 99 e9 ldi r25, 0x99 ; 153 d47c: a9 e1 ldi r26, 0x19 ; 25 d47e: be e3 ldi r27, 0x3E ; 62 d480: 88 87 std Y+8, r24 ; 0x08 d482: 99 87 std Y+9, r25 ; 0x09 d484: aa 87 std Y+10, r26 ; 0x0a d486: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); d488: 65 e5 ldi r22, 0x55 ; 85 d48a: 75 e5 ldi r23, 0x55 ; 85 d48c: 85 e5 ldi r24, 0x55 ; 85 d48e: 91 e4 ldi r25, 0x41 ; 65 } d490: df 91 pop r29 d492: 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); d494: 0d 94 bc 4e jmp 0x29d78 ; 0x29d78 0000d498 : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d498: cf 92 push r12 d49a: df 92 push r13 d49c: ef 92 push r14 d49e: ff 92 push r15 d4a0: cf 93 push r28 d4a2: df 93 push r29 d4a4: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d4a6: bc 01 movw r22, r24 d4a8: 6c 5f subi r22, 0xFC ; 252 d4aa: 7f 4f sbci r23, 0xFF ; 255 d4ac: 0e 94 ee 68 call 0xd1dc ; 0xd1dc // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d4b0: c0 90 2c 02 lds r12, 0x022C ; 0x80022c d4b4: d0 90 2d 02 lds r13, 0x022D ; 0x80022d d4b8: e0 90 2e 02 lds r14, 0x022E ; 0x80022e d4bc: f0 90 2f 02 lds r15, 0x022F ; 0x80022f d4c0: a7 01 movw r20, r14 d4c2: 96 01 movw r18, r12 d4c4: 68 85 ldd r22, Y+8 ; 0x08 d4c6: 79 85 ldd r23, Y+9 ; 0x09 d4c8: 8a 85 ldd r24, Y+10 ; 0x0a d4ca: 9b 85 ldd r25, Y+11 ; 0x0b d4cc: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> d4d0: 87 ff sbrs r24, 7 d4d2: 04 c0 rjmp .+8 ; 0xd4dc d4d4: c8 86 std Y+8, r12 ; 0x08 d4d6: d9 86 std Y+9, r13 ; 0x09 d4d8: ea 86 std Y+10, r14 ; 0x0a d4da: 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]; d4dc: c0 90 20 02 lds r12, 0x0220 ; 0x800220 d4e0: d0 90 21 02 lds r13, 0x0221 ; 0x800221 d4e4: e0 90 22 02 lds r14, 0x0222 ; 0x800222 d4e8: f0 90 23 02 lds r15, 0x0223 ; 0x800223 d4ec: a7 01 movw r20, r14 d4ee: 96 01 movw r18, r12 d4f0: 68 85 ldd r22, Y+8 ; 0x08 d4f2: 79 85 ldd r23, Y+9 ; 0x09 d4f4: 8a 85 ldd r24, Y+10 ; 0x0a d4f6: 9b 85 ldd r25, Y+11 ; 0x0b d4f8: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> d4fc: 18 16 cp r1, r24 d4fe: 24 f4 brge .+8 ; 0xd508 d500: c8 86 std Y+8, r12 ; 0x08 d502: d9 86 std Y+9, r13 ; 0x09 d504: ea 86 std Y+10, r14 ; 0x0a d506: fb 86 std Y+11, r15 ; 0x0b } } d508: df 91 pop r29 d50a: cf 91 pop r28 d50c: ff 90 pop r15 d50e: ef 90 pop r14 d510: df 90 pop r13 d512: cf 90 pop r12 d514: 08 95 ret 0000d516 : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d516: 2f 92 push r2 d518: 3f 92 push r3 d51a: 4f 92 push r4 d51c: 5f 92 push r5 d51e: 6f 92 push r6 d520: 7f 92 push r7 d522: 8f 92 push r8 d524: 9f 92 push r9 d526: af 92 push r10 d528: bf 92 push r11 d52a: cf 92 push r12 d52c: df 92 push r13 d52e: ef 92 push r14 d530: ff 92 push r15 d532: 0f 93 push r16 d534: 1f 93 push r17 d536: cf 93 push r28 d538: df 93 push r29 d53a: cd b7 in r28, 0x3d ; 61 d53c: de b7 in r29, 0x3e ; 62 d53e: a2 97 sbiw r28, 0x22 ; 34 d540: 0f b6 in r0, 0x3f ; 63 d542: f8 94 cli d544: de bf out 0x3e, r29 ; 62 d546: 0f be out 0x3f, r0 ; 63 d548: cd bf out 0x3d, r28 ; 61 d54a: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d54c: 89 e2 ldi r24, 0x29 ; 41 d54e: 96 e0 ldi r25, 0x06 ; 6 d550: 0e 94 4c 6a call 0xd498 ; 0xd498 previous_millis_cmd.start(); d554: 88 e4 ldi r24, 0x48 ; 72 d556: 93 e0 ldi r25, 0x03 ; 3 d558: 0f 94 7f 0d call 0x21afe ; 0x21afe ::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])) { d55c: 40 90 61 12 lds r4, 0x1261 ; 0x801261 d560: 50 90 62 12 lds r5, 0x1262 ; 0x801262 d564: 60 90 63 12 lds r6, 0x1263 ; 0x801263 d568: 70 90 64 12 lds r7, 0x1264 ; 0x801264 d56c: c0 90 29 06 lds r12, 0x0629 ; 0x800629 d570: d0 90 2a 06 lds r13, 0x062A ; 0x80062a d574: e0 90 2b 06 lds r14, 0x062B ; 0x80062b d578: f0 90 2c 06 lds r15, 0x062C ; 0x80062c d57c: a7 01 movw r20, r14 d57e: 96 01 movw r18, r12 d580: c3 01 movw r24, r6 d582: b2 01 movw r22, r4 d584: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> d588: 81 11 cpse r24, r1 d58a: 3f c0 rjmp .+126 ; 0xd60a d58c: 20 91 2d 06 lds r18, 0x062D ; 0x80062d d590: 30 91 2e 06 lds r19, 0x062E ; 0x80062e d594: 40 91 2f 06 lds r20, 0x062F ; 0x80062f d598: 50 91 30 06 lds r21, 0x0630 ; 0x800630 d59c: 60 91 65 12 lds r22, 0x1265 ; 0x801265 d5a0: 70 91 66 12 lds r23, 0x1266 ; 0x801266 d5a4: 80 91 67 12 lds r24, 0x1267 ; 0x801267 d5a8: 90 91 68 12 lds r25, 0x1268 ; 0x801268 d5ac: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> d5b0: 81 11 cpse r24, r1 d5b2: 2b c0 rjmp .+86 ; 0xd60a plan_buffer_line_destinationXYZE(feedrate/60); d5b4: 20 e0 ldi r18, 0x00 ; 0 d5b6: 30 e0 ldi r19, 0x00 ; 0 d5b8: 40 e7 ldi r20, 0x70 ; 112 d5ba: 52 e4 ldi r21, 0x42 ; 66 d5bc: 60 91 7a 02 lds r22, 0x027A ; 0x80027a d5c0: 70 91 7b 02 lds r23, 0x027B ; 0x80027b d5c4: 80 91 7c 02 lds r24, 0x027C ; 0x80027c d5c8: 90 91 7d 02 lds r25, 0x027D ; 0x80027d d5cc: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> d5d0: 0f 94 d7 49 call 0x293ae ; 0x293ae #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); d5d4: 0e 94 e8 54 call 0xa9d0 ; 0xa9d0 } d5d8: a2 96 adiw r28, 0x22 ; 34 d5da: 0f b6 in r0, 0x3f ; 63 d5dc: f8 94 cli d5de: de bf out 0x3e, r29 ; 62 d5e0: 0f be out 0x3f, r0 ; 63 d5e2: cd bf out 0x3d, r28 ; 61 d5e4: df 91 pop r29 d5e6: cf 91 pop r28 d5e8: 1f 91 pop r17 d5ea: 0f 91 pop r16 d5ec: ff 90 pop r15 d5ee: ef 90 pop r14 d5f0: df 90 pop r13 d5f2: cf 90 pop r12 d5f4: bf 90 pop r11 d5f6: af 90 pop r10 d5f8: 9f 90 pop r9 d5fa: 8f 90 pop r8 d5fc: 7f 90 pop r7 d5fe: 6f 90 pop r6 d600: 5f 90 pop r5 d602: 4f 90 pop r4 d604: 3f 90 pop r3 d606: 2f 90 pop r2 d608: 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); d60a: 60 91 8e 02 lds r22, 0x028E ; 0x80028e d60e: 70 91 8f 02 lds r23, 0x028F ; 0x80028f d612: 07 2e mov r0, r23 d614: 00 0c add r0, r0 d616: 88 0b sbc r24, r24 d618: 99 0b sbc r25, r25 d61a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> d61e: 20 91 7a 02 lds r18, 0x027A ; 0x80027a d622: 30 91 7b 02 lds r19, 0x027B ; 0x80027b d626: 40 91 7c 02 lds r20, 0x027C ; 0x80027c d62a: 50 91 7d 02 lds r21, 0x027D ; 0x80027d d62e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d632: 2e e3 ldi r18, 0x3E ; 62 d634: 33 ec ldi r19, 0xC3 ; 195 d636: 4e e2 ldi r20, 0x2E ; 46 d638: 59 e3 ldi r21, 0x39 ; 57 d63a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d63e: 6f 83 std Y+7, r22 ; 0x07 d640: 78 87 std Y+8, r23 ; 0x08 d642: 89 87 std Y+9, r24 ; 0x09 d644: 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) { d646: 80 91 09 13 lds r24, 0x1309 ; 0x801309 d64a: 88 23 and r24, r24 d64c: 09 f4 brne .+2 ; 0xd650 d64e: 0f c1 rjmp .+542 ; 0xd86e 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]; d650: a3 01 movw r20, r6 d652: 92 01 movw r18, r4 d654: c7 01 movw r24, r14 d656: b6 01 movw r22, r12 d658: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d65c: 2b 01 movw r4, r22 d65e: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; d660: 20 91 65 12 lds r18, 0x1265 ; 0x801265 d664: 30 91 66 12 lds r19, 0x1266 ; 0x801266 d668: 40 91 67 12 lds r20, 0x1267 ; 0x801267 d66c: 50 91 68 12 lds r21, 0x1268 ; 0x801268 d670: 60 91 2d 06 lds r22, 0x062D ; 0x80062d d674: 70 91 2e 06 lds r23, 0x062E ; 0x80062e d678: 80 91 2f 06 lds r24, 0x062F ; 0x80062f d67c: 90 91 30 06 lds r25, 0x0630 ; 0x800630 d680: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d684: 6b 87 std Y+11, r22 ; 0x0b d686: 7c 87 std Y+12, r23 ; 0x0c d688: 8d 87 std Y+13, r24 ; 0x0d d68a: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); d68c: c3 01 movw r24, r6 d68e: b2 01 movw r22, r4 d690: 9f 77 andi r25, 0x7F ; 127 d692: 2b 85 ldd r18, Y+11 ; 0x0b d694: 3c 85 ldd r19, Y+12 ; 0x0c d696: 4d 85 ldd r20, Y+13 ; 0x0d d698: 5e 85 ldd r21, Y+14 ; 0x0e d69a: 5f 77 andi r21, 0x7F ; 127 d69c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d6a0: 6b 01 movw r12, r22 d6a2: 7c 01 movw r14, r24 if (len > 0) d6a4: 20 e0 ldi r18, 0x00 ; 0 d6a6: 30 e0 ldi r19, 0x00 ; 0 d6a8: a9 01 movw r20, r18 d6aa: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> d6ae: 18 16 cp r1, r24 d6b0: 0c f0 brlt .+2 ; 0xd6b4 d6b2: dd c0 rjmp .+442 ; 0xd86e // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); d6b4: 20 e0 ldi r18, 0x00 ; 0 d6b6: 30 e0 ldi r19, 0x00 ; 0 d6b8: 40 ef ldi r20, 0xF0 ; 240 d6ba: 51 e4 ldi r21, 0x41 ; 65 d6bc: c7 01 movw r24, r14 d6be: b6 01 movw r22, r12 d6c0: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> d6c4: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 d6c8: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> d6cc: 7e 83 std Y+6, r23 ; 0x06 d6ce: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { d6d0: 62 30 cpi r22, 0x02 ; 2 d6d2: 71 05 cpc r23, r1 d6d4: 08 f4 brcc .+2 ; 0xd6d8 d6d6: cb c0 rjmp .+406 ; 0xd86e d6d8: 21 14 cp r2, r1 d6da: 31 04 cpc r3, r1 d6dc: 09 f4 brne .+2 ; 0xd6e0 d6de: c7 c0 rjmp .+398 ; 0xd86e float dz = z - current_position[Z_AXIS]; d6e0: 20 91 69 12 lds r18, 0x1269 ; 0x801269 d6e4: 30 91 6a 12 lds r19, 0x126A ; 0x80126a d6e8: 40 91 6b 12 lds r20, 0x126B ; 0x80126b d6ec: 50 91 6c 12 lds r21, 0x126C ; 0x80126c d6f0: 60 91 31 06 lds r22, 0x0631 ; 0x800631 d6f4: 70 91 32 06 lds r23, 0x0632 ; 0x800632 d6f8: 80 91 33 06 lds r24, 0x0633 ; 0x800633 d6fc: 90 91 34 06 lds r25, 0x0634 ; 0x800634 d700: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d704: 6f 87 std Y+15, r22 ; 0x0f d706: 78 8b std Y+16, r23 ; 0x10 d708: 89 8b std Y+17, r24 ; 0x11 d70a: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; d70c: 20 91 6d 12 lds r18, 0x126D ; 0x80126d d710: 30 91 6e 12 lds r19, 0x126E ; 0x80126e d714: 40 91 6f 12 lds r20, 0x126F ; 0x80126f d718: 50 91 70 12 lds r21, 0x1270 ; 0x801270 d71c: 60 91 35 06 lds r22, 0x0635 ; 0x800635 d720: 70 91 36 06 lds r23, 0x0636 ; 0x800636 d724: 80 91 37 06 lds r24, 0x0637 ; 0x800637 d728: 90 91 38 06 lds r25, 0x0638 ; 0x800638 d72c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d730: 6b 8b std Y+19, r22 ; 0x13 d732: 7c 8b std Y+20, r23 ; 0x14 d734: 8d 8b std Y+21, r24 ; 0x15 d736: 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); d738: ad 81 ldd r26, Y+5 ; 0x05 d73a: be 81 ldd r27, Y+6 ; 0x06 d73c: cd 01 movw r24, r26 d73e: b0 e0 ldi r27, 0x00 ; 0 d740: a0 e0 ldi r26, 0x00 ; 0 d742: 8f 8f std Y+31, r24 ; 0x1f d744: 98 a3 std Y+32, r25 ; 0x20 d746: a9 a3 std Y+33, r26 ; 0x21 d748: 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) { d74a: 2d 81 ldd r18, Y+5 ; 0x05 d74c: 3e 81 ldd r19, Y+6 ; 0x06 d74e: 22 16 cp r2, r18 d750: 33 06 cpc r3, r19 d752: 08 f0 brcs .+2 ; 0xd756 d754: 8c c0 rjmp .+280 ; 0xd86e float t = float(i) / float(n_segments); d756: b1 01 movw r22, r2 d758: 90 e0 ldi r25, 0x00 ; 0 d75a: 80 e0 ldi r24, 0x00 ; 0 d75c: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> d760: 6b 01 movw r12, r22 d762: 7c 01 movw r14, r24 d764: 6f 8d ldd r22, Y+31 ; 0x1f d766: 78 a1 ldd r23, Y+32 ; 0x20 d768: 89 a1 ldd r24, Y+33 ; 0x21 d76a: 9a a1 ldd r25, Y+34 ; 0x22 d76c: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> d770: 9b 01 movw r18, r22 d772: ac 01 movw r20, r24 d774: c7 01 movw r24, r14 d776: b6 01 movw r22, r12 d778: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> d77c: 6b 01 movw r12, r22 d77e: 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, d780: ac 01 movw r20, r24 d782: 9b 01 movw r18, r22 d784: 6b 89 ldd r22, Y+19 ; 0x13 d786: 7c 89 ldd r23, Y+20 ; 0x14 d788: 8d 89 ldd r24, Y+21 ; 0x15 d78a: 9e 89 ldd r25, Y+22 ; 0x16 d78c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d790: 9b 01 movw r18, r22 d792: ac 01 movw r20, r24 d794: 60 91 6d 12 lds r22, 0x126D ; 0x80126d d798: 70 91 6e 12 lds r23, 0x126E ; 0x80126e d79c: 80 91 6f 12 lds r24, 0x126F ; 0x80126f d7a0: 90 91 70 12 lds r25, 0x1270 ; 0x801270 d7a4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d7a8: 69 83 std Y+1, r22 ; 0x01 d7aa: 7a 83 std Y+2, r23 ; 0x02 d7ac: 8b 83 std Y+3, r24 ; 0x03 d7ae: 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, d7b0: a7 01 movw r20, r14 d7b2: 96 01 movw r18, r12 d7b4: 6f 85 ldd r22, Y+15 ; 0x0f d7b6: 78 89 ldd r23, Y+16 ; 0x10 d7b8: 89 89 ldd r24, Y+17 ; 0x11 d7ba: 9a 89 ldd r25, Y+18 ; 0x12 d7bc: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__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, d7c0: 20 91 69 12 lds r18, 0x1269 ; 0x801269 d7c4: 30 91 6a 12 lds r19, 0x126A ; 0x80126a d7c8: 40 91 6b 12 lds r20, 0x126B ; 0x80126b d7cc: 50 91 6c 12 lds r21, 0x126C ; 0x80126c d7d0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d7d4: 6f 8b std Y+23, r22 ; 0x17 d7d6: 78 8f std Y+24, r23 ; 0x18 d7d8: 89 8f std Y+25, r24 ; 0x19 d7da: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, d7dc: a7 01 movw r20, r14 d7de: 96 01 movw r18, r12 d7e0: 6b 85 ldd r22, Y+11 ; 0x0b d7e2: 7c 85 ldd r23, Y+12 ; 0x0c d7e4: 8d 85 ldd r24, Y+13 ; 0x0d d7e6: 9e 85 ldd r25, Y+14 ; 0x0e d7e8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__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, d7ec: 20 91 65 12 lds r18, 0x1265 ; 0x801265 d7f0: 30 91 66 12 lds r19, 0x1266 ; 0x801266 d7f4: 40 91 67 12 lds r20, 0x1267 ; 0x801267 d7f8: 50 91 68 12 lds r21, 0x1268 ; 0x801268 d7fc: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d800: 6b 8f std Y+27, r22 ; 0x1b d802: 7c 8f std Y+28, r23 ; 0x1c d804: 8d 8f std Y+29, r24 ; 0x1d d806: 9e 8f std Y+30, r25 ; 0x1e d808: a7 01 movw r20, r14 d80a: 96 01 movw r18, r12 d80c: c3 01 movw r24, r6 d80e: b2 01 movw r22, r4 d810: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> d814: 20 91 61 12 lds r18, 0x1261 ; 0x801261 d818: 30 91 62 12 lds r19, 0x1262 ; 0x801262 d81c: 40 91 63 12 lds r20, 0x1263 ; 0x801263 d820: 50 91 64 12 lds r21, 0x1264 ; 0x801264 d824: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d828: 3f 92 push r3 d82a: 2f 92 push r2 d82c: a1 e6 ldi r26, 0x61 ; 97 d82e: b2 e1 ldi r27, 0x12 ; 18 d830: bf 93 push r27 d832: af 93 push r26 d834: 8f 80 ldd r8, Y+7 ; 0x07 d836: 98 84 ldd r9, Y+8 ; 0x08 d838: a9 84 ldd r10, Y+9 ; 0x09 d83a: ba 84 ldd r11, Y+10 ; 0x0a d83c: de 01 movw r26, r28 d83e: 11 96 adiw r26, 0x01 ; 1 d840: 6d 01 movw r12, r26 d842: ef 88 ldd r14, Y+23 ; 0x17 d844: f8 8c ldd r15, Y+24 ; 0x18 d846: 09 8d ldd r16, Y+25 ; 0x19 d848: 1a 8d ldd r17, Y+26 ; 0x1a d84a: 2b 8d ldd r18, Y+27 ; 0x1b d84c: 3c 8d ldd r19, Y+28 ; 0x1c d84e: 4d 8d ldd r20, Y+29 ; 0x1d d850: 5e 8d ldd r21, Y+30 ; 0x1e d852: 0f 94 bc 3a call 0x27578 ; 0x27578 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) d856: 0f 90 pop r0 d858: 0f 90 pop r0 d85a: 0f 90 pop r0 d85c: 0f 90 pop r0 d85e: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 d862: 81 11 cpse r24, r1 d864: b7 ce rjmp .-658 ; 0xd5d4 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) { d866: bf ef ldi r27, 0xFF ; 255 d868: 2b 1a sub r2, r27 d86a: 3b 0a sbc r3, r27 d86c: 6e cf rjmp .-292 ; 0xd74a if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); d86e: e0 90 31 06 lds r14, 0x0631 ; 0x800631 d872: f0 90 32 06 lds r15, 0x0632 ; 0x800632 d876: 00 91 33 06 lds r16, 0x0633 ; 0x800633 d87a: 10 91 34 06 lds r17, 0x0634 ; 0x800634 d87e: 20 91 2d 06 lds r18, 0x062D ; 0x80062d d882: 30 91 2e 06 lds r19, 0x062E ; 0x80062e d886: 40 91 2f 06 lds r20, 0x062F ; 0x80062f d88a: 50 91 30 06 lds r21, 0x0630 ; 0x800630 d88e: 60 91 29 06 lds r22, 0x0629 ; 0x800629 d892: 70 91 2a 06 lds r23, 0x062A ; 0x80062a d896: 80 91 2b 06 lds r24, 0x062B ; 0x80062b d89a: 90 91 2c 06 lds r25, 0x062C ; 0x80062c d89e: 1f 92 push r1 d8a0: 1f 92 push r1 d8a2: e1 e6 ldi r30, 0x61 ; 97 d8a4: f2 e1 ldi r31, 0x12 ; 18 d8a6: ff 93 push r31 d8a8: ef 93 push r30 d8aa: 8f 80 ldd r8, Y+7 ; 0x07 d8ac: 98 84 ldd r9, Y+8 ; 0x08 d8ae: a9 84 ldd r10, Y+9 ; 0x09 d8b0: ba 84 ldd r11, Y+10 ; 0x0a d8b2: e5 e3 ldi r30, 0x35 ; 53 d8b4: ce 2e mov r12, r30 d8b6: e6 e0 ldi r30, 0x06 ; 6 d8b8: de 2e mov r13, r30 d8ba: 0f 94 bc 3a call 0x27578 ; 0x27578 d8be: 0f 90 pop r0 d8c0: 0f 90 pop r0 d8c2: 0f 90 pop r0 d8c4: 0f 90 pop r0 d8c6: 86 ce rjmp .-756 ; 0xd5d4 0000d8c8 : /// @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) { d8c8: cf 92 push r12 d8ca: df 92 push r13 d8cc: ef 92 push r14 d8ce: ff 92 push r15 d8d0: cf 93 push r28 float travel_z = current_position[Z_AXIS]; d8d2: c0 90 69 12 lds r12, 0x1269 ; 0x801269 d8d6: d0 90 6a 12 lds r13, 0x126A ; 0x80126a d8da: e0 90 6b 12 lds r14, 0x126B ; 0x80126b d8de: f0 90 6c 12 lds r15, 0x126C ; 0x80126c // Prepare to move Z axis current_position[Z_AXIS] += delta; d8e2: a7 01 movw r20, r14 d8e4: 96 01 movw r18, r12 d8e6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> d8ea: 60 93 69 12 sts 0x1269, r22 ; 0x801269 d8ee: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a d8f2: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b d8f6: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c #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); d8fa: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) d8fc: 90 91 3b 06 lds r25, 0x063B ; 0x80063b d900: 91 11 cpse r25, r1 d902: 02 c0 rjmp .+4 ; 0xd908 d904: 84 ff sbrs r24, 4 d906: 26 c0 rjmp .+76 ; 0xd954 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); d908: 81 e6 ldi r24, 0x61 ; 97 d90a: 92 e1 ldi r25, 0x12 ; 18 d90c: 0e 94 4c 6a call 0xd498 ; 0xd498 plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); d910: 60 91 83 0d lds r22, 0x0D83 ; 0x800d83 d914: 70 91 84 0d lds r23, 0x0D84 ; 0x800d84 d918: 80 91 85 0d lds r24, 0x0D85 ; 0x800d85 d91c: 90 91 86 0d lds r25, 0x0D86 ; 0x800d86 d920: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); d924: 0f 94 b0 18 call 0x23160 ; 0x23160 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; d928: a7 01 movw r20, r14 d92a: 96 01 movw r18, r12 d92c: 60 91 69 12 lds r22, 0x1269 ; 0x801269 d930: 70 91 6a 12 lds r23, 0x126A ; 0x80126a d934: 80 91 6b 12 lds r24, 0x126B ; 0x80126b d938: 90 91 6c 12 lds r25, 0x126C ; 0x80126c d93c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d940: 6b 01 movw r12, r22 d942: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } d944: c7 01 movw r24, r14 d946: b6 01 movw r22, r12 d948: cf 91 pop r28 d94a: ff 90 pop r15 d94c: ef 90 pop r14 d94e: df 90 pop r13 d950: cf 90 pop r12 d952: 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(); d954: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); d956: 0f 94 b0 18 call 0x23160 ; 0x23160 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); d95a: 81 e0 ldi r24, 0x01 ; 1 d95c: 0f 94 3d 23 call 0x2467a ; 0x2467a d960: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); d962: 65 e5 ldi r22, 0x55 ; 85 d964: 75 e5 ldi r23, 0x55 ; 85 d966: 85 e5 ldi r24, 0x55 ; 85 d968: 91 e4 ldi r25, 0x41 ; 65 d96a: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); d96e: 0f 94 b0 18 call 0x23160 ; 0x23160 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; d972: 82 e0 ldi r24, 0x02 ; 2 d974: 0f 94 9c 18 call 0x23138 ; 0x23138 d978: a7 01 movw r20, r14 d97a: 96 01 movw r18, r12 d97c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d980: 6b 01 movw r12, r22 d982: 7c 01 movw r14, r24 current_position[Z_AXIS] = max_pos[Z_AXIS]; plan_set_position_curposXYZE(); } tmc2130_home_exit(); #endif //TMC2130 enable_z_endstop(z_endstop_enabled); d984: 8c 2f mov r24, r28 d986: 0f 94 3d 23 call 0x2467a ; 0x2467a d98a: dc cf rjmp .-72 ; 0xd944 0000d98c : // // 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) { d98c: 8f 92 push r8 d98e: 9f 92 push r9 d990: af 92 push r10 d992: bf 92 push r11 d994: cf 92 push r12 d996: df 92 push r13 d998: ef 92 push r14 d99a: ff 92 push r15 d99c: 4b 01 movw r8, r22 d99e: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) d9a0: c0 90 69 12 lds r12, 0x1269 ; 0x801269 d9a4: d0 90 6a 12 lds r13, 0x126A ; 0x80126a d9a8: e0 90 6b 12 lds r14, 0x126B ; 0x80126b d9ac: f0 90 6c 12 lds r15, 0x126C ; 0x80126c d9b0: ac 01 movw r20, r24 d9b2: 9b 01 movw r18, r22 d9b4: c7 01 movw r24, r14 d9b6: b6 01 movw r22, r12 d9b8: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> d9bc: 87 ff sbrs r24, 7 d9be: 11 c0 rjmp .+34 ; 0xd9e2 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); d9c0: a5 01 movw r20, r10 d9c2: 94 01 movw r18, r8 d9c4: c7 01 movw r24, r14 d9c6: b6 01 movw r22, r12 d9c8: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> d9cc: 9f 77 andi r25, 0x7F ; 127 } d9ce: ff 90 pop r15 d9d0: ef 90 pop r14 d9d2: df 90 pop r13 d9d4: cf 90 pop r12 d9d6: bf 90 pop r11 d9d8: af 90 pop r10 d9da: 9f 90 pop r9 d9dc: 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)); d9de: 0c 94 64 6c jmp 0xd8c8 ; 0xd8c8 } d9e2: ff 90 pop r15 d9e4: ef 90 pop r14 d9e6: df 90 pop r13 d9e8: cf 90 pop r12 d9ea: bf 90 pop r11 d9ec: af 90 pop r10 d9ee: 9f 90 pop r9 d9f0: 8f 90 pop r8 d9f2: 08 95 ret 0000d9f4 : #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 { d9f4: 2f 92 push r2 d9f6: 3f 92 push r3 d9f8: 4f 92 push r4 d9fa: 5f 92 push r5 d9fc: 6f 92 push r6 d9fe: 7f 92 push r7 da00: 8f 92 push r8 da02: 9f 92 push r9 da04: af 92 push r10 da06: bf 92 push r11 da08: cf 92 push r12 da0a: df 92 push r13 da0c: ef 92 push r14 da0e: ff 92 push r15 da10: 0f 93 push r16 da12: 1f 93 push r17 da14: cf 93 push r28 da16: df 93 push r29 da18: 00 d0 rcall .+0 ; 0xda1a da1a: 1f 92 push r1 da1c: 1f 92 push r1 da1e: cd b7 in r28, 0x3d ; 61 da20: de b7 in r29, 0x3e ; 62 da22: d8 2e mov r13, r24 da24: 2a 01 movw r4, r20 da26: 3b 01 movw r6, r22 da28: 32 2e mov r3, r18 da2a: e9 82 std Y+1, r14 ; 0x01 da2c: fa 82 std Y+2, r15 ; 0x02 da2e: 0b 83 std Y+3, r16 ; 0x03 da30: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); da32: 0f 94 b0 18 call 0x23160 ; 0x23160 homing_flag = true; da36: 81 e0 ldi r24, 0x01 ; 1 da38: 80 93 71 12 sts 0x1271, r24 ; 0x801271 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; da3c: fc 2c mov r15, r12 da3e: e3 2c mov r14, r3 da40: d3 10 cpse r13, r3 da42: 10 c0 rjmp .+32 ; 0xda64 da44: ed 2c mov r14, r13 da46: dc 10 cpse r13, r12 da48: 0d c0 rjmp .+26 ; 0xda64 // 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); da4a: 60 e0 ldi r22, 0x00 ; 0 da4c: 70 e0 ldi r23, 0x00 ; 0 da4e: 80 ea ldi r24, 0xA0 ; 160 da50: 90 e4 ldi r25, 0x40 ; 64 da52: 0e 94 c6 6c call 0xd98c ; 0xd98c // 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; da56: ff 24 eor r15, r15 da58: f3 94 inc r15 da5a: ee 24 eor r14, r14 da5c: e3 94 inc r14 da5e: 22 24 eor r2, r2 da60: 23 94 inc r2 da62: 01 c0 rjmp .+2 ; 0xda66 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; da64: 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(); da66: 0e 94 fd 61 call 0xc3fa ; 0xc3fa // 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; da6a: 80 91 09 13 lds r24, 0x1309 ; 0x801309 da6e: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; da70: 10 92 09 13 sts 0x1309, r1 ; 0x801309 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); da74: 82 e0 ldi r24, 0x02 ; 2 da76: 0f 94 9c 18 call 0x23138 ; 0x23138 da7a: 60 93 69 12 sts 0x1269, r22 ; 0x801269 da7e: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a da82: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b da86: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) da8a: f1 10 cpse r15, r1 babystep_undo(); da8c: 0f 94 aa 52 call 0x2a554 ; 0x2a554 int l_feedmultiply = setup_for_endstop_move(); da90: 81 e0 ldi r24, 0x01 ; 1 da92: 0e 94 36 65 call 0xca6c ; 0xca6c da96: 8c 01 movw r16, r24 set_destination_to_current(); da98: 0e 94 7e 66 call 0xccfc ; 0xccfc feedrate = 0.0; da9c: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a daa0: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b daa4: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c daa8: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); } #else //TMC2130 if(home_x) homeaxis(X_AXIS); daac: 22 20 and r2, r2 daae: 19 f0 breq .+6 ; 0xdab6 dab0: 80 e0 ldi r24, 0x00 ; 0 dab2: 0f 94 6b 79 call 0x2f2d6 ; 0x2f2d6 if(home_y) homeaxis(Y_AXIS); dab6: ee 20 and r14, r14 dab8: 19 f0 breq .+6 ; 0xdac0 daba: 81 e0 ldi r24, 0x01 ; 1 dabc: 0f 94 6b 79 call 0x2f2d6 ; 0x2f2d6 #endif //TMC2130 if(home_x_axis && home_x_value != 0) dac0: dd 20 and r13, r13 dac2: e9 f0 breq .+58 ; 0xdafe dac4: 41 14 cp r4, r1 dac6: 51 04 cpc r5, r1 dac8: 61 04 cpc r6, r1 daca: 71 04 cpc r7, r1 dacc: c1 f0 breq .+48 ; 0xdafe current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; dace: c3 01 movw r24, r6 dad0: b2 01 movw r22, r4 dad2: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> dad6: 9b 01 movw r18, r22 dad8: ac 01 movw r20, r24 dada: 60 91 bf 0d lds r22, 0x0DBF ; 0x800dbf dade: 70 91 c0 0d lds r23, 0x0DC0 ; 0x800dc0 dae2: 80 91 c1 0d lds r24, 0x0DC1 ; 0x800dc1 dae6: 90 91 c2 0d lds r25, 0x0DC2 ; 0x800dc2 daea: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> daee: 60 93 61 12 sts 0x1261, r22 ; 0x801261 daf2: 70 93 62 12 sts 0x1262, r23 ; 0x801262 daf6: 80 93 63 12 sts 0x1263, r24 ; 0x801263 dafa: 90 93 64 12 sts 0x1264, r25 ; 0x801264 if(home_y_axis && home_y_value != 0) dafe: 33 20 and r3, r3 db00: 01 f1 breq .+64 ; 0xdb42 db02: 89 81 ldd r24, Y+1 ; 0x01 db04: 9a 81 ldd r25, Y+2 ; 0x02 db06: ab 81 ldd r26, Y+3 ; 0x03 db08: bc 81 ldd r27, Y+4 ; 0x04 db0a: 00 97 sbiw r24, 0x00 ; 0 db0c: a1 05 cpc r26, r1 db0e: b1 05 cpc r27, r1 db10: c1 f0 breq .+48 ; 0xdb42 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; db12: bc 01 movw r22, r24 db14: cd 01 movw r24, r26 db16: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> db1a: 9b 01 movw r18, r22 db1c: ac 01 movw r20, r24 db1e: 60 91 c3 0d lds r22, 0x0DC3 ; 0x800dc3 db22: 70 91 c4 0d lds r23, 0x0DC4 ; 0x800dc4 db26: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 db2a: 90 91 c6 0d lds r25, 0x0DC6 ; 0x800dc6 db2e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> db32: 60 93 65 12 sts 0x1265, r22 ; 0x801265 db36: 70 93 66 12 sts 0x1266, r23 ; 0x801266 db3a: 80 93 67 12 sts 0x1267, r24 ; 0x801267 db3e: 90 93 68 12 sts 0x1268, r25 ; 0x801268 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { db42: ff 20 and r15, r15 db44: 09 f4 brne .+2 ; 0xdb48 db46: 99 c0 rjmp .+306 ; 0xdc7a #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); db48: 60 e0 ldi r22, 0x00 ; 0 db4a: 70 e0 ldi r23, 0x00 ; 0 db4c: 80 ea ldi r24, 0xA0 ; 160 db4e: 90 e4 ldi r25, 0x40 ; 64 db50: 0e 94 c6 6c call 0xd98c ; 0xd98c if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); db54: 80 91 39 06 lds r24, 0x0639 ; 0x800639 db58: 81 11 cpse r24, r1 db5a: 02 c0 rjmp .+4 ; 0xdb60 db5c: 0f 94 6b 79 call 0x2f2d6 ; 0x2f2d6 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); db60: 80 91 3a 06 lds r24, 0x063A ; 0x80063a db64: 81 11 cpse r24, r1 db66: 03 c0 rjmp .+6 ; 0xdb6e db68: 81 e0 ldi r24, 0x01 ; 1 db6a: 0f 94 6b 79 call 0x2f2d6 ; 0x2f2d6 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); db6e: 0e 94 96 60 call 0xc12c ; 0xc12c world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); db72: e4 e0 ldi r30, 0x04 ; 4 db74: fc e9 ldi r31, 0x9C ; 156 db76: 85 91 lpm r24, Z+ db78: 95 91 lpm r25, Z+ db7a: a5 91 lpm r26, Z+ db7c: b4 91 lpm r27, Z db7e: e0 e0 ldi r30, 0x00 ; 0 db80: fc e9 ldi r31, 0x9C ; 156 db82: 45 91 lpm r20, Z+ db84: 55 91 lpm r21, Z+ db86: 65 91 lpm r22, Z+ db88: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; db8a: 40 93 29 06 sts 0x0629, r20 ; 0x800629 db8e: 50 93 2a 06 sts 0x062A, r21 ; 0x80062a db92: 60 93 2b 06 sts 0x062B, r22 ; 0x80062b db96: 70 93 2c 06 sts 0x062C, r23 ; 0x80062c out_y = y; db9a: 80 93 2d 06 sts 0x062D, r24 ; 0x80062d db9e: 90 93 2e 06 sts 0x062E, r25 ; 0x80062e dba2: a0 93 2f 06 sts 0x062F, r26 ; 0x80062f dba6: b0 93 30 06 sts 0x0630, r27 ; 0x800630 world2machine(out_x, out_y); dbaa: 6d e2 ldi r22, 0x2D ; 45 dbac: 76 e0 ldi r23, 0x06 ; 6 dbae: 89 e2 ldi r24, 0x29 ; 41 dbb0: 96 e0 ldi r25, 0x06 ; 6 dbb2: 0e 94 46 68 call 0xd08c ; 0xd08c world2machine_reset(); dbb6: 0e 94 c4 61 call 0xc388 ; 0xc388 if (destination[Y_AXIS] < Y_MIN_POS) dbba: 20 e0 ldi r18, 0x00 ; 0 dbbc: 30 e0 ldi r19, 0x00 ; 0 dbbe: 40 e8 ldi r20, 0x80 ; 128 dbc0: 50 ec ldi r21, 0xC0 ; 192 dbc2: 60 91 2d 06 lds r22, 0x062D ; 0x80062d dbc6: 70 91 2e 06 lds r23, 0x062E ; 0x80062e dbca: 80 91 2f 06 lds r24, 0x062F ; 0x80062f dbce: 90 91 30 06 lds r25, 0x0630 ; 0x800630 dbd2: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> dbd6: 87 ff sbrs r24, 7 dbd8: 0c c0 rjmp .+24 ; 0xdbf2 destination[Y_AXIS] = Y_MIN_POS; dbda: 80 e0 ldi r24, 0x00 ; 0 dbdc: 90 e0 ldi r25, 0x00 ; 0 dbde: a0 e8 ldi r26, 0x80 ; 128 dbe0: b0 ec ldi r27, 0xC0 ; 192 dbe2: 80 93 2d 06 sts 0x062D, r24 ; 0x80062d dbe6: 90 93 2e 06 sts 0x062E, r25 ; 0x80062e dbea: a0 93 2f 06 sts 0x062F, r26 ; 0x80062f dbee: b0 93 30 06 sts 0x0630, r27 ; 0x800630 feedrate = homing_feedrate[X_AXIS] / 20; dbf2: 80 e0 ldi r24, 0x00 ; 0 dbf4: 90 e0 ldi r25, 0x00 ; 0 dbf6: a6 e1 ldi r26, 0x16 ; 22 dbf8: b3 e4 ldi r27, 0x43 ; 67 dbfa: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a dbfe: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b dc02: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c dc06: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d dc0a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> #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(); dc0e: 0f 94 ca 48 call 0x29194 ; 0x29194 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); dc12: 60 91 7a 02 lds r22, 0x027A ; 0x80027a dc16: 70 91 7b 02 lds r23, 0x027B ; 0x80027b dc1a: 80 91 7c 02 lds r24, 0x027C ; 0x80027c dc1e: 90 91 7d 02 lds r25, 0x027D ; 0x80027d dc22: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); dc26: 0f 94 b0 18 call 0x23160 ; 0x23160 current_position[X_AXIS] = destination[X_AXIS]; dc2a: 80 91 29 06 lds r24, 0x0629 ; 0x800629 dc2e: 90 91 2a 06 lds r25, 0x062A ; 0x80062a dc32: a0 91 2b 06 lds r26, 0x062B ; 0x80062b dc36: b0 91 2c 06 lds r27, 0x062C ; 0x80062c dc3a: 80 93 61 12 sts 0x1261, r24 ; 0x801261 dc3e: 90 93 62 12 sts 0x1262, r25 ; 0x801262 dc42: a0 93 63 12 sts 0x1263, r26 ; 0x801263 dc46: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = destination[Y_AXIS]; dc4a: 80 91 2d 06 lds r24, 0x062D ; 0x80062d dc4e: 90 91 2e 06 lds r25, 0x062E ; 0x80062e dc52: a0 91 2f 06 lds r26, 0x062F ; 0x80062f dc56: b0 91 30 06 lds r27, 0x0630 ; 0x800630 dc5a: 80 93 65 12 sts 0x1265, r24 ; 0x801265 dc5e: 90 93 66 12 sts 0x1266, r25 ; 0x801266 dc62: a0 93 67 12 sts 0x1267, r26 ; 0x801267 dc66: b0 93 68 12 sts 0x1268, r27 ; 0x801268 dc6a: 81 e0 ldi r24, 0x01 ; 1 dc6c: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.388> enable_endstops(true); endstops_hit_on_purpose(); dc70: 0f 94 59 23 call 0x246b2 ; 0x246b2 homeaxis(Z_AXIS); dc74: 82 e0 ldi r24, 0x02 ; 2 dc76: 0f 94 6b 79 call 0x2f2d6 ; 0x2f2d6 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) dc7a: cc 20 and r12, r12 dc7c: e9 f0 breq .+58 ; 0xdcb8 dc7e: 81 14 cp r8, r1 dc80: 91 04 cpc r9, r1 dc82: a1 04 cpc r10, r1 dc84: b1 04 cpc r11, r1 dc86: c1 f0 breq .+48 ; 0xdcb8 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; dc88: c5 01 movw r24, r10 dc8a: b4 01 movw r22, r8 dc8c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> dc90: 9b 01 movw r18, r22 dc92: ac 01 movw r20, r24 dc94: 60 91 c7 0d lds r22, 0x0DC7 ; 0x800dc7 dc98: 70 91 c8 0d lds r23, 0x0DC8 ; 0x800dc8 dc9c: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 dca0: 90 91 ca 0d lds r25, 0x0DCA ; 0x800dca dca4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> dca8: 60 93 69 12 sts 0x1269, r22 ; 0x801269 dcac: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a dcb0: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b dcb4: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c // 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(); dcb8: 0f 94 ca 48 call 0x29194 ; 0x29194 clean_up_after_endstop_move(l_feedmultiply); dcbc: c8 01 movw r24, r16 dcbe: 0e 94 1c 65 call 0xca38 ; 0xca38 endstops_hit_on_purpose(); dcc2: 0f 94 59 23 call 0x246b2 ; 0x246b2 // Load the machine correction matrix world2machine_initialize(); dcc6: 0e 94 96 60 call 0xc12c ; 0xc12c // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); dcca: 0e 94 d2 5e call 0xbda4 ; 0xbda4 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) dcce: d1 10 cpse r13, r1 dcd0: 07 c0 rjmp .+14 ; 0xdce0 dcd2: 31 10 cpse r3, r1 dcd4: 05 c0 rjmp .+10 ; 0xdce0 dcd6: 8b 8d ldd r24, Y+27 ; 0x1b dcd8: 81 11 cpse r24, r1 dcda: 02 c0 rjmp .+4 ; 0xdce0 dcdc: cc 20 and r12, r12 dcde: 39 f1 breq .+78 ; 0xdd2e { if (! home_z && mbl_was_active) { dce0: f1 10 cpse r15, r1 dce2: 25 c0 rjmp .+74 ; 0xdd2e dce4: 9d 81 ldd r25, Y+5 ; 0x05 dce6: 99 23 and r25, r25 dce8: 11 f1 breq .+68 ; 0xdd2e // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; dcea: 81 e0 ldi r24, 0x01 ; 1 dcec: 80 93 09 13 sts 0x1309, r24 ; 0x801309 // 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)); dcf0: 0f 94 9c 18 call 0x23138 ; 0x23138 dcf4: 6b 01 movw r12, r22 dcf6: 7c 01 movw r14, r24 dcf8: 80 e0 ldi r24, 0x00 ; 0 dcfa: 0f 94 9c 18 call 0x23138 ; 0x23138 dcfe: a7 01 movw r20, r14 dd00: 96 01 movw r18, r12 dd02: 0f 94 35 91 call 0x3226a ; 0x3226a dd06: 9b 01 movw r18, r22 dd08: ac 01 movw r20, r24 dd0a: 60 91 69 12 lds r22, 0x1269 ; 0x801269 dd0e: 70 91 6a 12 lds r23, 0x126A ; 0x80126a dd12: 80 91 6b 12 lds r24, 0x126B ; 0x80126b dd16: 90 91 6c 12 lds r25, 0x126C ; 0x80126c dd1a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> dd1e: 60 93 69 12 sts 0x1269, r22 ; 0x801269 dd22: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a dd26: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b dd2a: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } } #endif prusa_statistics(20); dd2e: 84 e1 ldi r24, 0x14 ; 20 dd30: 0f 94 02 30 call 0x26004 ; 0x26004 st_synchronize(); dd34: 0f 94 b0 18 call 0x23160 ; 0x23160 homing_flag = false; dd38: 10 92 71 12 sts 0x1271, r1 ; 0x801271 #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 } dd3c: 0f 90 pop r0 dd3e: 0f 90 pop r0 dd40: 0f 90 pop r0 dd42: 0f 90 pop r0 dd44: 0f 90 pop r0 dd46: df 91 pop r29 dd48: cf 91 pop r28 dd4a: 1f 91 pop r17 dd4c: 0f 91 pop r16 dd4e: ff 90 pop r15 dd50: ef 90 pop r14 dd52: df 90 pop r13 dd54: cf 90 pop r12 dd56: bf 90 pop r11 dd58: af 90 pop r10 dd5a: 9f 90 pop r9 dd5c: 8f 90 pop r8 dd5e: 7f 90 pop r7 dd60: 6f 90 pop r6 dd62: 5f 90 pop r5 dd64: 4f 90 pop r4 dd66: 3f 90 pop r3 dd68: 2f 90 pop r2 dd6a: 08 95 ret 0000dd6c : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { dd6c: e1 e3 ldi r30, 0x31 ; 49 dd6e: 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; dd70: 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]; dd72: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty dd74: 8f 37 cpi r24, 0x7F ; 127 dd76: 31 f0 breq .+12 ; 0xdd84 dd78: df 01 movw r26, r30 dd7a: 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 dd7c: 87 ff sbrs r24, 7 dd7e: 07 c0 rjmp .+14 ; 0xdd8e lcd_custom_characters[i] = c & 0x7F; dd80: 8f 77 andi r24, 0x7F ; 127 dd82: 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++) { dd84: 83 e0 ldi r24, 0x03 ; 3 dd86: e9 33 cpi r30, 0x39 ; 57 dd88: f8 07 cpc r31, r24 dd8a: 99 f7 brne .-26 ; 0xdd72 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dd8c: 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; dd8e: 9c 93 st X, r25 dd90: f9 cf rjmp .-14 ; 0xdd84 0000dd92 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dd92: 90 91 59 02 lds r25, 0x0259 ; 0x800259 dd96: 98 17 cp r25, r24 dd98: 10 f4 brcc .+4 ; 0xdd9e lcd_draw_update = lcdDrawUpdateOverride; dd9a: 80 93 59 02 sts 0x0259, r24 ; 0x800259 if (!lcd_update_enabled) return; dd9e: 80 91 5a 02 lds r24, 0x025A ; 0x80025a dda2: 88 23 and r24, r24 dda4: 39 f0 breq .+14 ; 0xddb4 if (lcd_lcdupdate_func) dda6: e0 91 04 04 lds r30, 0x0404 ; 0x800404 ddaa: f0 91 05 04 lds r31, 0x0405 ; 0x800405 ddae: 30 97 sbiw r30, 0x00 ; 0 ddb0: 09 f0 breq .+2 ; 0xddb4 lcd_lcdupdate_func(); ddb2: 19 94 eijmp } ddb4: 08 95 ret 0000ddb6 : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { ddb6: cf 93 push r28 ddb8: df 93 push r29 ddba: cd b7 in r28, 0x3d ; 61 ddbc: de b7 in r29, 0x3e ; 62 ddbe: ae 01 movw r20, r28 ddc0: 4a 5f subi r20, 0xFA ; 250 ddc2: 5f 4f sbci r21, 0xFF ; 255 ddc4: fa 01 movw r30, r20 ddc6: 61 91 ld r22, Z+ ddc8: 71 91 ld r23, Z+ ddca: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); ddcc: 82 ef ldi r24, 0xF2 ; 242 ddce: 93 e0 ldi r25, 0x03 ; 3 ddd0: 0f 94 e4 a2 call 0x345c8 ; 0x345c8 va_end(args); return ret; } ddd4: df 91 pop r29 ddd6: cf 91 pop r28 ddd8: 08 95 ret 0000ddda : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); ddda: 62 ef ldi r22, 0xF2 ; 242 dddc: 73 e0 ldi r23, 0x03 ; 3 ddde: 0d 94 35 a2 jmp 0x3446a ; 0x3446a 0000dde2 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); dde2: 62 ef ldi r22, 0xF2 ; 242 dde4: 73 e0 ldi r23, 0x03 ; 3 dde6: 08 2e mov r0, r24 dde8: 00 0c add r0, r0 ddea: 99 0b sbc r25, r25 ddec: 0d 94 05 a2 jmp 0x3440a ; 0x3440a 0000ddf0 : va_end(args); return ret; } void lcd_space(uint8_t n) { ddf0: cf 93 push r28 ddf2: c8 2f mov r28, r24 while (n--) lcd_putc(' '); ddf4: c1 50 subi r28, 0x01 ; 1 ddf6: 20 f0 brcs .+8 ; 0xde00 ddf8: 80 e2 ldi r24, 0x20 ; 32 ddfa: 0e 94 f1 6e call 0xdde2 ; 0xdde2 ddfe: fa cf rjmp .-12 ; 0xddf4 } de00: cf 91 pop r28 de02: 08 95 ret 0000de04 : /// @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) { de04: 0f 93 push r16 de06: 1f 93 push r17 de08: cf 93 push r28 de0a: df 93 push r29 de0c: eb 01 movw r28, r22 de0e: 14 2f mov r17, r20 de10: 05 2f mov r16, r21 lcd_putc(chr); de12: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_puts_P(str); de16: ce 01 movw r24, r28 de18: 0e 94 ed 6e call 0xddda ; 0xddda lcd_putc(':'); de1c: 8a e3 ldi r24, 0x3A ; 58 de1e: 0e 94 f1 6e call 0xdde2 ; 0xdde2 #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); de22: ce 01 movw r24, r28 de24: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); de28: 9e e0 ldi r25, 0x0E ; 14 de2a: 98 1b sub r25, r24 de2c: 89 2f mov r24, r25 de2e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); de32: 0f 93 push r16 de34: 1f 93 push r17 de36: 83 e6 ldi r24, 0x63 ; 99 de38: 91 e8 ldi r25, 0x81 ; 129 de3a: 9f 93 push r25 de3c: 8f 93 push r24 de3e: 0e 94 db 6e call 0xddb6 ; 0xddb6 de42: 0f 90 pop r0 de44: 0f 90 pop r0 de46: 0f 90 pop r0 de48: 0f 90 pop r0 } de4a: df 91 pop r29 de4c: cf 91 pop r28 de4e: 1f 91 pop r17 de50: 0f 91 pop r16 de52: 08 95 ret 0000de54 : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { de54: cf 93 push r28 de56: c8 2f mov r28, r24 de58: 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); de5a: 64 30 cpi r22, 0x04 ; 4 de5c: 08 f0 brcs .+2 ; 0xde60 de5e: 83 e0 ldi r24, 0x03 ; 3 de60: 80 93 30 03 sts 0x0330, r24 ; 0x800330 } 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); de64: 0e 94 f2 54 call 0xa9e4 ; 0xa9e4 de68: 8c 0f add r24, r28 lcd_ddram_address = addr; de6a: 80 93 2f 03 sts 0x032F, r24 ; 0x80032f delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de6e: 44 e6 ldi r20, 0x64 ; 100 de70: 50 e0 ldi r21, 0x00 ; 0 de72: 60 e0 ldi r22, 0x00 ; 0 de74: 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); } de76: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de78: 0c 94 84 5d jmp 0xbb08 ; 0xbb08 0000de7c : 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) { de7c: 7f 92 push r7 de7e: 8f 92 push r8 de80: 9f 92 push r9 de82: af 92 push r10 de84: bf 92 push r11 de86: cf 92 push r12 de88: df 92 push r13 de8a: ef 92 push r14 de8c: ff 92 push r15 de8e: 0f 93 push r16 de90: 1f 93 push r17 de92: cf 93 push r28 de94: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) de96: e0 91 63 04 lds r30, 0x0463 ; 0x800463 de9a: 50 91 62 04 lds r21, 0x0462 ; 0x800462 de9e: e5 13 cpse r30, r21 dea0: 73 c0 rjmp .+230 ; 0xdf88 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); dea2: fb 01 movw r30, r22 dea4: 48 30 cpi r20, 0x08 ; 8 dea6: 09 f0 breq .+2 ; 0xdeaa dea8: 6c c0 rjmp .+216 ; 0xdf82 deaa: c0 81 ld r28, Z deac: d0 e0 ldi r29, 0x00 ; 0 deae: 49 01 movw r8, r18 deb0: 74 2e mov r7, r20 deb2: 6b 01 movw r12, r22 deb4: 5c 01 movw r10, r24 if (lcd_draw_update) deb6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 deba: 88 23 and r24, r24 debc: 59 f0 breq .+22 ; 0xded4 { lcd_set_cursor(0, menu_row); debe: 60 91 60 04 lds r22, 0x0460 ; 0x800460 dec2: 80 e0 ldi r24, 0x00 ; 0 dec4: 0e 94 2a 6f call 0xde54 ; 0xde54 menu_draw_P(menu_selection_mark(), str, cur_val); dec8: 0e 94 36 62 call 0xc46c ; 0xc46c decc: ae 01 movw r20, r28 dece: b5 01 movw r22, r10 ded0: 0e 94 02 6f call 0xde04 ; 0xde04 } if (menu_clicked && (lcd_encoder == menu_item)) ded4: 80 91 61 04 lds r24, 0x0461 ; 0x800461 ded8: 88 23 and r24, r24 deda: 09 f4 brne .+2 ; 0xdede dedc: 55 c0 rjmp .+170 ; 0xdf88 dede: 90 91 63 04 lds r25, 0x0463 ; 0x800463 dee2: 20 91 1e 06 lds r18, 0x061E ; 0x80061e dee6: 30 91 1f 06 lds r19, 0x061F ; 0x80061f deea: 92 17 cp r25, r18 deec: 13 06 cpc r1, r19 deee: 09 f0 breq .+2 ; 0xdef2 def0: 4b c0 rjmp .+150 ; 0xdf88 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) def2: 80 91 df 03 lds r24, 0x03DF ; 0x8003df def6: 87 30 cpi r24, 0x07 ; 7 def8: d8 f4 brcc .+54 ; 0xdf30 { menu_stack[menu_depth].menu = menu_menu; defa: 28 2f mov r18, r24 defc: 30 e0 ldi r19, 0x00 ; 0 defe: f9 01 movw r30, r18 df00: ee 0f add r30, r30 df02: ff 1f adc r31, r31 df04: e2 0f add r30, r18 df06: f3 1f adc r31, r19 df08: e9 5a subi r30, 0xA9 ; 169 df0a: fc 4f sbci r31, 0xFC ; 252 df0c: 20 91 02 04 lds r18, 0x0402 ; 0x800402 df10: 30 91 03 04 lds r19, 0x0403 ; 0x800403 df14: 31 83 std Z+1, r19 ; 0x01 df16: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; df18: 8f 5f subi r24, 0xFF ; 255 df1a: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df df1e: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); df20: 20 e0 ldi r18, 0x00 ; 0 df22: 40 e0 ldi r20, 0x00 ; 0 df24: 70 e0 ldi r23, 0x00 ; 0 df26: 60 e0 ldi r22, 0x00 ; 0 df28: 82 e5 ldi r24, 0x52 ; 82 df2a: 93 e7 ldi r25, 0x73 ; 115 df2c: 0e 94 87 62 call 0xc50e ; 0xc50e 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; df30: b0 92 97 03 sts 0x0397, r11 ; 0x800397 df34: a0 92 96 03 sts 0x0396, r10 ; 0x800396 _md->editValuePtr = pval; df38: d0 92 9a 03 sts 0x039A, r13 ; 0x80039a df3c: c0 92 99 03 sts 0x0399, r12 ; 0x800399 _md->editValueBits = pbits; df40: 70 92 98 03 sts 0x0398, r7 ; 0x800398 _md->currentValue = cur_val; df44: d0 93 9c 03 sts 0x039C, r29 ; 0x80039c df48: c0 93 9b 03 sts 0x039B, r28 ; 0x80039b _md->minEditValue = min_val; df4c: 90 92 9e 03 sts 0x039E, r9 ; 0x80039e df50: 80 92 9d 03 sts 0x039D, r8 ; 0x80039d _md->maxEditValue = max_val; df54: 10 93 a0 03 sts 0x03A0, r17 ; 0x8003a0 df58: 00 93 9f 03 sts 0x039F, r16 ; 0x80039f _md->minJumpValue = jmp_val; df5c: f0 92 a2 03 sts 0x03A2, r15 ; 0x8003a2 df60: e0 92 a1 03 sts 0x03A1, r14 ; 0x8003a1 menu_item_ret(); return; } } menu_item++; } df64: df 91 pop r29 df66: cf 91 pop r28 df68: 1f 91 pop r17 df6a: 0f 91 pop r16 df6c: ff 90 pop r15 df6e: ef 90 pop r14 df70: df 90 pop r13 df72: cf 90 pop r12 df74: bf 90 pop r11 df76: af 90 pop r10 df78: 9f 90 pop r9 df7a: 8f 90 pop r8 df7c: 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(); df7e: 0c 94 43 62 jmp 0xc486 ; 0xc486 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)); df82: c0 81 ld r28, Z df84: d1 81 ldd r29, Z+1 ; 0x01 df86: 93 cf rjmp .-218 ; 0xdeae _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; df88: 80 91 63 04 lds r24, 0x0463 ; 0x800463 df8c: 8f 5f subi r24, 0xFF ; 255 df8e: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } df92: df 91 pop r29 df94: cf 91 pop r28 df96: 1f 91 pop r17 df98: 0f 91 pop r16 df9a: ff 90 pop r15 df9c: ef 90 pop r14 df9e: df 90 pop r13 dfa0: cf 90 pop r12 dfa2: bf 90 pop r11 dfa4: af 90 pop r10 dfa6: 9f 90 pop r9 dfa8: 8f 90 pop r8 dfaa: 7f 90 pop r7 dfac: 08 95 ret 0000dfae : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { dfae: cf 93 push r28 dfb0: df 93 push r29 dfb2: ea 01 movw r28, r20 lcd_set_cursor(c, r); dfb4: 0e 94 2a 6f call 0xde54 ; 0xde54 return fputs_P(str, lcdout); dfb8: 62 ef ldi r22, 0xF2 ; 242 dfba: 73 e0 ldi r23, 0x03 ; 3 dfbc: ce 01 movw r24, r28 } dfbe: df 91 pop r29 dfc0: 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); dfc2: 0d 94 35 a2 jmp 0x3446a ; 0x3446a 0000dfc6 : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { dfc6: cf 93 push r28 dfc8: c4 2f mov r28, r20 lcd_set_cursor(c, r); dfca: 0e 94 2a 6f call 0xde54 ; 0xde54 return fputc(ch, lcdout); dfce: 62 ef ldi r22, 0xF2 ; 242 dfd0: 73 e0 ldi r23, 0x03 ; 3 dfd2: 8c 2f mov r24, r28 dfd4: cc 0f add r28, r28 dfd6: 99 0b sbc r25, r25 } dfd8: 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); dfda: 0d 94 05 a2 jmp 0x3440a ; 0x3440a 0000dfde : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); dfde: 60 e0 ldi r22, 0x00 ; 0 dfe0: 80 e0 ldi r24, 0x00 ; 0 dfe2: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_ddram_address = 0; dfe6: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f } dfea: 08 95 ret 0000dfec : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); dfec: 40 e4 ldi r20, 0x40 ; 64 dfee: 56 e0 ldi r21, 0x06 ; 6 dff0: 60 e0 ldi r22, 0x00 ; 0 dff2: 81 e0 ldi r24, 0x01 ; 1 dff4: 0e 94 84 5d call 0xbb08 ; 0xbb08 // 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; dff8: 10 92 30 03 sts 0x0330, r1 ; 0x800330 lcd_ddram_address = 0; dffc: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f 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)); e000: 48 e0 ldi r20, 0x08 ; 8 e002: 50 e0 ldi r21, 0x00 ; 0 e004: 6f e7 ldi r22, 0x7F ; 127 e006: 70 e0 ldi r23, 0x00 ; 0 e008: 81 e3 ldi r24, 0x31 ; 49 e00a: 93 e0 ldi r25, 0x03 ; 3 e00c: 0d 94 cf a9 jmp 0x3539e ; 0x3539e 0000e010 : } 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) e010: 90 91 5a 02 lds r25, 0x025A ; 0x80025a e014: 98 17 cp r25, r24 e016: 09 f1 breq .+66 ; 0xe05a { lcd_update_enabled = enabled; e018: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a if (enabled) e01c: 88 23 and r24, r24 e01e: e9 f0 breq .+58 ; 0xe05a { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; e020: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e024: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_encoder_diff = 0; e028: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.502> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); e02c: 83 ee ldi r24, 0xE3 ; 227 e02e: 93 e0 ldi r25, 0x03 ; 3 e030: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; e034: 0f 94 56 0b call 0x216ac ; 0x216ac e038: 61 50 subi r22, 0x01 ; 1 e03a: 71 09 sbc r23, r1 e03c: 81 09 sbc r24, r1 e03e: 91 09 sbc r25, r1 e040: 60 93 c5 03 sts 0x03C5, r22 ; 0x8003c5 e044: 70 93 c6 03 sts 0x03C6, r23 ; 0x8003c6 e048: 80 93 c7 03 sts 0x03C7, r24 ; 0x8003c7 e04c: 90 93 c8 03 sts 0x03C8, r25 ; 0x8003c8 // Full update. lcd_clear(); e050: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_update(2); e054: 82 e0 ldi r24, 0x02 ; 2 e056: 0c 94 c9 6e jmp 0xdd92 ; 0xdd92 } else { // Clear the LCD always, or let it to the caller? } } } e05a: 08 95 ret 0000e05c : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { e05c: cf 93 push r28 e05e: c8 2f mov r28, r24 lcd_currline = 0; e060: 10 92 30 03 sts 0x0330, r1 ; 0x800330 lcd_ddram_address = 0; e064: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f 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)); e068: 48 e0 ldi r20, 0x08 ; 8 e06a: 50 e0 ldi r21, 0x00 ; 0 e06c: 6f e7 ldi r22, 0x7F ; 127 e06e: 70 e0 ldi r23, 0x00 ; 0 e070: 81 e3 ldi r24, 0x31 ; 49 e072: 93 e0 ldi r25, 0x03 ; 3 e074: 0f 94 cf a9 call 0x3539e ; 0x3539e 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 e078: 44 e9 ldi r20, 0x94 ; 148 e07a: 51 e1 ldi r21, 0x11 ; 17 e07c: 62 e0 ldi r22, 0x02 ; 2 e07e: 80 e3 ldi r24, 0x30 ; 48 e080: 0e 94 84 5d call 0xbb08 ; 0xbb08 // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e084: 46 e9 ldi r20, 0x96 ; 150 e086: 50 e0 ldi r21, 0x00 ; 0 e088: 62 e0 ldi r22, 0x02 ; 2 e08a: 80 e3 ldi r24, 0x30 ; 48 e08c: 0e 94 84 5d call 0xbb08 ; 0xbb08 // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e090: 46 e9 ldi r20, 0x96 ; 150 e092: 50 e0 ldi r21, 0x00 ; 0 e094: 62 e0 ldi r22, 0x02 ; 2 e096: 80 e3 ldi r24, 0x30 ; 48 e098: 0e 94 84 5d call 0xbb08 ; 0xbb08 #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); e09c: 46 e9 ldi r20, 0x96 ; 150 e09e: 50 e0 ldi r21, 0x00 ; 0 e0a0: 62 e0 ldi r22, 0x02 ; 2 e0a2: 80 e2 ldi r24, 0x20 ; 32 e0a4: 0e 94 84 5d call 0xbb08 ; 0xbb08 #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); e0a8: 80 91 00 04 lds r24, 0x0400 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.513> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e0ac: 44 e6 ldi r20, 0x64 ; 100 e0ae: 50 e0 ldi r21, 0x00 ; 0 e0b0: 60 e0 ldi r22, 0x00 ; 0 e0b2: 80 62 ori r24, 0x20 ; 32 e0b4: 0e 94 84 5d call 0xbb08 ; 0xbb08 } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; e0b8: 84 e0 ldi r24, 0x04 ; 4 e0ba: 80 93 2e 03 sts 0x032E, r24 ; 0x80032e delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e0be: 44 e6 ldi r20, 0x64 ; 100 e0c0: 50 e0 ldi r21, 0x00 ; 0 e0c2: 60 e0 ldi r22, 0x00 ; 0 e0c4: 8c e0 ldi r24, 0x0C ; 12 e0c6: 0e 94 84 5d call 0xbb08 ; 0xbb08 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(); e0ca: c1 11 cpse r28, r1 e0cc: 0e 94 f6 6f call 0xdfec ; 0xdfec delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e0d0: 44 e6 ldi r20, 0x64 ; 100 e0d2: 50 e0 ldi r21, 0x00 ; 0 e0d4: 60 e0 ldi r22, 0x00 ; 0 e0d6: 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); } e0d8: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e0da: 0c 94 84 5d jmp 0xbb08 ; 0xbb08 0000e0de : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); e0de: 81 e0 ldi r24, 0x01 ; 1 e0e0: 0c 94 2e 70 jmp 0xe05c ; 0xe05c 0000e0e4 : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { e0e4: cf 92 push r12 e0e6: df 92 push r13 e0e8: ff 92 push r15 e0ea: 0f 93 push r16 e0ec: 1f 93 push r17 e0ee: cf 93 push r28 e0f0: df 93 push r29 e0f2: 00 d0 rcall .+0 ; 0xe0f4 e0f4: 00 d0 rcall .+0 ; 0xe0f6 e0f6: 1f 92 push r1 e0f8: 1f 92 push r1 e0fa: cd b7 in r28, 0x3d ; 61 e0fc: de b7 in r29, 0x3e ; 62 if (value == '\n') { e0fe: 8a 30 cpi r24, 0x0A ; 10 e100: d9 f4 brne .+54 ; 0xe138 if (lcd_currline > 3) lcd_currline = -1; e102: 80 91 30 03 lds r24, 0x0330 ; 0x800330 e106: 84 30 cpi r24, 0x04 ; 4 e108: 18 f0 brcs .+6 ; 0xe110 e10a: 8f ef ldi r24, 0xFF ; 255 e10c: 80 93 30 03 sts 0x0330, r24 ; 0x800330 lcd_set_cursor(0, lcd_currline + 1); // LF e110: 60 91 30 03 lds r22, 0x0330 ; 0x800330 e114: 6f 5f subi r22, 0xFF ; 255 e116: 80 e0 ldi r24, 0x00 ; 0 e118: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } e11c: 28 96 adiw r28, 0x08 ; 8 e11e: 0f b6 in r0, 0x3f ; 63 e120: f8 94 cli e122: de bf out 0x3e, r29 ; 62 e124: 0f be out 0x3f, r0 ; 63 e126: cd bf out 0x3d, r28 ; 61 e128: df 91 pop r29 e12a: cf 91 pop r28 e12c: 1f 91 pop r17 e12e: 0f 91 pop r16 e130: ff 90 pop r15 e132: df 90 pop r13 e134: cf 90 pop r12 e136: 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))) { e138: 90 e8 ldi r25, 0x80 ; 128 e13a: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); e13c: 44 e6 ldi r20, 0x64 ; 100 e13e: 50 e0 ldi r21, 0x00 ; 0 e140: 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))) { e142: 9a 34 cpi r25, 0x4A ; 74 e144: 08 f5 brcc .+66 ; 0xe188 // 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. e146: 48 2f mov r20, r24 e148: 40 58 subi r20, 0x80 ; 128 e14a: 55 0b sbc r21, r21 e14c: 9a 01 movw r18, r20 e14e: 96 e0 ldi r25, 0x06 ; 6 e150: 92 9f mul r25, r18 e152: a0 01 movw r20, r0 e154: 93 9f mul r25, r19 e156: 50 0d add r21, r0 e158: 11 24 eor r1, r1 e15a: fa 01 movw r30, r20 e15c: ea 56 subi r30, 0x6A ; 106 e15e: fb 48 sbci r31, 0x8B ; 139 e160: f4 90 lpm r15, Z e162: e1 e3 ldi r30, 0x31 ; 49 e164: f3 e0 ldi r31, 0x03 ; 3 e166: 30 e0 ldi r19, 0x00 ; 0 e168: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; e16a: 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)) { e16c: 61 91 ld r22, Z+ e16e: 78 2f mov r23, r24 e170: 76 27 eor r23, r22 e172: 7f 77 andi r23, 0x7F ; 127 e174: 89 f4 brne .+34 ; 0xe198 lcd_custom_characters[i] = c; // mark the custom character as used e176: f9 01 movw r30, r18 e178: ef 5c subi r30, 0xCF ; 207 e17a: fc 4f sbci r31, 0xFC ; 252 e17c: 80 83 st Z, r24 e17e: 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); e180: 44 e6 ldi r20, 0x64 ; 100 e182: 50 e0 ldi r21, 0x00 ; 0 e184: 61 e0 ldi r22, 0x01 ; 1 e186: 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); e188: 0e 94 84 5d call 0xbb08 ; 0xbb08 lcd_ddram_address++; // no need for preventing ddram overflow e18c: 80 91 2f 03 lds r24, 0x032F ; 0x80032f e190: 8f 5f subi r24, 0xFF ; 255 e192: 80 93 2f 03 sts 0x032F, r24 ; 0x80032f e196: c2 cf rjmp .-124 ; 0xe11c 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 e198: 6f 37 cpi r22, 0x7F ; 127 e19a: 09 f0 breq .+2 ; 0xe19e e19c: 3c c0 rjmp .+120 ; 0xe216 lcd_custom_characters[i] = c; // mark the custom character as used e19e: f9 01 movw r30, r18 e1a0: ef 5c subi r30, 0xCF ; 207 e1a2: fc 4f sbci r31, 0xFC ; 252 e1a4: 80 83 st Z, r24 slotToUse = i; e1a6: 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; e1a8: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e1aa: fa 01 movw r30, r20 e1ac: ef 56 subi r30, 0x6F ; 111 e1ae: fb 48 sbci r31, 0x8B ; 139 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e1b0: 8e 01 movw r16, r28 e1b2: 0f 5f subi r16, 0xFF ; 255 e1b4: 1f 4f sbci r17, 0xFF ; 255 e1b6: d8 01 movw r26, r16 e1b8: 95 91 lpm r25, Z+ e1ba: 88 e0 ldi r24, 0x08 ; 8 e1bc: 18 2e mov r1, r24 0000e1be : e1be: 10 fe sbrs r1, 0 e1c0: 05 90 lpm r0, Z+ e1c2: 02 94 swap r0 e1c4: 80 2d mov r24, r0 e1c6: 97 95 ror r25 e1c8: 88 1f adc r24, r24 e1ca: 8d 93 st X+, r24 e1cc: 1a 94 dec r1 e1ce: b9 f7 brne .-18 ; 0xe1be lcd_command(LCD_SETCGRAMADDR | (location << 3)); e1d0: bf 2d mov r27, r15 e1d2: e8 e0 ldi r30, 0x08 ; 8 e1d4: be 02 muls r27, r30 e1d6: c0 01 movw r24, r0 e1d8: 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); e1da: 44 e6 ldi r20, 0x64 ; 100 e1dc: 50 e0 ldi r21, 0x00 ; 0 e1de: 60 e0 ldi r22, 0x00 ; 0 e1e0: 80 64 ori r24, 0x40 ; 64 e1e2: 0e 94 84 5d call 0xbb08 ; 0xbb08 e1e6: 6e 01 movw r12, r28 e1e8: f9 e0 ldi r31, 0x09 ; 9 e1ea: cf 0e add r12, r31 e1ec: 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); e1ee: 44 e6 ldi r20, 0x64 ; 100 e1f0: 50 e0 ldi r21, 0x00 ; 0 e1f2: 61 e0 ldi r22, 0x01 ; 1 e1f4: d8 01 movw r26, r16 e1f6: 8d 91 ld r24, X+ e1f8: 8d 01 movw r16, r26 e1fa: 0e 94 84 5d call 0xbb08 ; 0xbb08 : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e1fe: c0 16 cp r12, r16 e200: d1 06 cpc r13, r17 e202: a9 f7 brne .-22 ; 0xe1ee lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e204: 80 91 2f 03 lds r24, 0x032F ; 0x80032f delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e208: 44 e6 ldi r20, 0x64 ; 100 e20a: 50 e0 ldi r21, 0x00 ; 0 e20c: 60 e0 ldi r22, 0x00 ; 0 e20e: 80 68 ori r24, 0x80 ; 128 e210: 0e 94 84 5d call 0xbb08 ; 0xbb08 e214: b5 cf rjmp .-150 ; 0xe180 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 e216: 67 ff sbrs r22, 7 slotToUse = i; e218: 92 2f mov r25, r18 e21a: 2f 5f subi r18, 0xFF ; 255 e21c: 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++) { e21e: 28 30 cpi r18, 0x08 ; 8 e220: 31 05 cpc r19, r1 e222: 09 f0 breq .+2 ; 0xe226 e224: a3 cf rjmp .-186 ; 0xe16c } // 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) { e226: 9f 3f cpi r25, 0xFF ; 255 e228: 09 f0 breq .+2 ; 0xe22c e22a: be cf rjmp .-132 ; 0xe1a8 e22c: a9 cf rjmp .-174 ; 0xe180 0000e22e : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { e22e: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; e230: 24 e1 ldi r18, 0x14 ; 20 e232: ac 01 movw r20, r24 e234: 24 9f mul r18, r20 e236: c0 01 movw r24, r0 e238: 25 9f mul r18, r21 e23a: 90 0d add r25, r0 e23c: 11 24 eor r1, r1 e23e: 60 91 6d 03 lds r22, 0x036D ; 0x80036d e242: 70 91 6e 03 lds r23, 0x036E ; 0x80036e e246: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> e24a: c6 2f mov r28, r22 e24c: 65 31 cpi r22, 0x15 ; 21 e24e: 08 f0 brcs .+2 ; 0xe252 e250: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) e252: 80 91 6c 03 lds r24, 0x036C ; 0x80036c e256: 8c 17 cp r24, r28 e258: 48 f4 brcc .+18 ; 0xe26c } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e25a: 8f ef ldi r24, 0xFF ; 255 e25c: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; e260: 80 91 6c 03 lds r24, 0x036C ; 0x80036c e264: 8f 5f subi r24, 0xFF ; 255 e266: 80 93 6c 03 sts 0x036C, r24 ; 0x80036c e26a: f3 cf rjmp .-26 ; 0xe252 } } e26c: cf 91 pop r28 e26e: 08 95 ret 0000e270 : void menu_progressbar_finish(void) { progressbar_total = 1; e270: 81 e0 ldi r24, 0x01 ; 1 e272: 90 e0 ldi r25, 0x00 ; 0 e274: 90 93 6e 03 sts 0x036E, r25 ; 0x80036e e278: 80 93 6d 03 sts 0x036D, r24 ; 0x80036d menu_progressbar_update(1); e27c: 0e 94 17 71 call 0xe22e ; 0xe22e _delay(300); e280: 6c e2 ldi r22, 0x2C ; 44 e282: 71 e0 ldi r23, 0x01 ; 1 e284: 80 e0 ldi r24, 0x00 ; 0 e286: 90 e0 ldi r25, 0x00 ; 0 e288: 0d 94 23 0b jmp 0x21646 ; 0x21646 0000e28c : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e28c: 8f 92 push r8 e28e: 9f 92 push r9 e290: af 92 push r10 e292: bf 92 push r11 e294: ef 92 push r14 e296: ff 92 push r15 e298: 0f 93 push r16 e29a: 1f 93 push r17 e29c: cf 93 push r28 e29e: df 93 push r29 e2a0: cd b7 in r28, 0x3d ; 61 e2a2: de b7 in r29, 0x3e ; 62 e2a4: a0 97 sbiw r28, 0x20 ; 32 e2a6: 0f b6 in r0, 0x3f ; 63 e2a8: f8 94 cli e2aa: de bf out 0x3e, r29 ; 62 e2ac: 0f be out 0x3f, r0 ; 63 e2ae: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e2b0: 61 15 cp r22, r1 e2b2: 71 05 cpc r23, r1 e2b4: 81 05 cpc r24, r1 e2b6: 91 05 cpc r25, r1 e2b8: 99 f4 brne .+38 ; 0xe2e0 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e2ba: 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)); } e2bc: a0 96 adiw r28, 0x20 ; 32 e2be: 0f b6 in r0, 0x3f ; 63 e2c0: f8 94 cli e2c2: de bf out 0x3e, r29 ; 62 e2c4: 0f be out 0x3f, r0 ; 63 e2c6: cd bf out 0x3d, r28 ; 61 e2c8: df 91 pop r29 e2ca: cf 91 pop r28 e2cc: 1f 91 pop r17 e2ce: 0f 91 pop r16 e2d0: ff 90 pop r15 e2d2: ef 90 pop r14 e2d4: bf 90 pop r11 e2d6: af 90 pop r10 e2d8: 9f 90 pop r9 e2da: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e2dc: 0c 94 72 70 jmp 0xe0e4 ; 0xe0e4 } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e2e0: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e2e2: 84 2e mov r8, r20 e2e4: 91 2c mov r9, r1 e2e6: b1 2c mov r11, r1 e2e8: a1 2c mov r10, r1 e2ea: 9e 01 movw r18, r28 e2ec: 2f 5f subi r18, 0xFF ; 255 e2ee: 3f 4f sbci r19, 0xFF ; 255 e2f0: 79 01 movw r14, r18 e2f2: a5 01 movw r20, r10 e2f4: 94 01 movw r18, r8 e2f6: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> e2fa: f7 01 movw r30, r14 e2fc: e0 0f add r30, r16 e2fe: f1 1d adc r31, r1 e300: 60 83 st Z, r22 n /= base; e302: b9 01 movw r22, r18 e304: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e306: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e308: 61 15 cp r22, r1 e30a: 71 05 cpc r23, r1 e30c: 81 05 cpc r24, r1 e30e: 91 05 cpc r25, r1 e310: 81 f7 brne .-32 ; 0xe2f2 e312: 0e 0d add r16, r14 e314: 1f 2d mov r17, r15 e316: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e318: e0 16 cp r14, r16 e31a: f1 06 cpc r15, r17 e31c: 59 f0 breq .+22 ; 0xe334 lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e31e: f8 01 movw r30, r16 e320: 82 91 ld r24, -Z e322: 8f 01 movw r16, r30 e324: 8a 30 cpi r24, 0x0A ; 10 e326: 20 f4 brcc .+8 ; 0xe330 e328: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e32a: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 e32e: f4 cf rjmp .-24 ; 0xe318 { 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)); e330: 89 5c subi r24, 0xC9 ; 201 e332: fb cf rjmp .-10 ; 0xe32a } e334: a0 96 adiw r28, 0x20 ; 32 e336: 0f b6 in r0, 0x3f ; 63 e338: f8 94 cli e33a: de bf out 0x3e, r29 ; 62 e33c: 0f be out 0x3f, r0 ; 63 e33e: cd bf out 0x3d, r28 ; 61 e340: df 91 pop r29 e342: cf 91 pop r28 e344: 1f 91 pop r17 e346: 0f 91 pop r16 e348: ff 90 pop r15 e34a: ef 90 pop r14 e34c: bf 90 pop r11 e34e: af 90 pop r10 e350: 9f 90 pop r9 e352: 8f 90 pop r8 e354: 08 95 ret 0000e356 : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e356: cf 92 push r12 e358: df 92 push r13 e35a: ef 92 push r14 e35c: ff 92 push r15 e35e: 6b 01 movw r12, r22 e360: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e362: f7 fe sbrs r15, 7 e364: 0b c0 rjmp .+22 ; 0xe37c } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e366: 8d e2 ldi r24, 0x2D ; 45 e368: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e36c: f0 94 com r15 e36e: e0 94 com r14 e370: d0 94 com r13 e372: c0 94 com r12 e374: c1 1c adc r12, r1 e376: d1 1c adc r13, r1 e378: e1 1c adc r14, r1 e37a: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e37c: 4a e0 ldi r20, 0x0A ; 10 e37e: c7 01 movw r24, r14 e380: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e382: ff 90 pop r15 e384: ef 90 pop r14 e386: df 90 pop r13 e388: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e38a: 0c 94 46 71 jmp 0xe28c ; 0xe28c 0000e38e : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e38e: 0f 93 push r16 e390: 1f 93 push r17 e392: cf 93 push r28 e394: 8c 01 movw r16, r24 e396: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e398: cc 23 and r28, r28 e39a: 59 f0 breq .+22 ; 0xe3b2 e39c: f8 01 movw r30, r16 e39e: 24 91 lpm r18, Z e3a0: 22 23 and r18, r18 e3a2: 39 f0 breq .+14 ; 0xe3b2 lcd_write(pgm_read_byte(s++)); e3a4: 0f 5f subi r16, 0xFF ; 255 e3a6: 1f 4f sbci r17, 0xFF ; 255 e3a8: 84 91 lpm r24, Z e3aa: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 --len; e3ae: c1 50 subi r28, 0x01 ; 1 e3b0: f3 cf rjmp .-26 ; 0xe398 } lcd_space(len); e3b2: 8c 2f mov r24, r28 e3b4: 0e 94 f8 6e call 0xddf0 ; 0xddf0 return len; } e3b8: 8c 2f mov r24, r28 e3ba: cf 91 pop r28 e3bc: 1f 91 pop r17 e3be: 0f 91 pop r16 e3c0: 08 95 ret 0000e3c2 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { e3c2: 0f 93 push r16 e3c4: 1f 93 push r17 e3c6: cf 93 push r28 e3c8: df 93 push r29 e3ca: 8c 01 movw r16, r24 e3cc: eb 01 movw r28, r22 lcd_clear(); e3ce: 0e 94 f6 6f call 0xdfec ; 0xdfec progressbar_block_count = 0; e3d2: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c progressbar_total = total; e3d6: 10 93 6e 03 sts 0x036E, r17 ; 0x80036e e3da: 00 93 6d 03 sts 0x036D, r16 ; 0x80036d lcd_set_cursor(0, 1); e3de: 61 e0 ldi r22, 0x01 ; 1 e3e0: 80 e0 ldi r24, 0x00 ; 0 e3e2: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print_pad_P(title, LCD_WIDTH); e3e6: 64 e1 ldi r22, 0x14 ; 20 e3e8: ce 01 movw r24, r28 e3ea: 0e 94 c7 71 call 0xe38e ; 0xe38e lcd_set_cursor(0, 2); e3ee: 62 e0 ldi r22, 0x02 ; 2 e3f0: 80 e0 ldi r24, 0x00 ; 0 } e3f2: df 91 pop r29 e3f4: cf 91 pop r28 e3f6: 1f 91 pop r17 e3f8: 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); e3fa: 0c 94 2a 6f jmp 0xde54 ; 0xde54 0000e3fe : //! @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) { e3fe: ef 92 push r14 e400: ff 92 push r15 e402: 0f 93 push r16 e404: 1f 93 push r17 e406: cf 93 push r28 e408: df 93 push r29 if (menu_item == menu_line) e40a: 70 91 63 04 lds r23, 0x0463 ; 0x800463 e40e: 30 91 62 04 lds r19, 0x0462 ; 0x800462 e412: 73 13 cpse r23, r19 e414: 3f c0 rjmp .+126 ; 0xe494 e416: 12 2f mov r17, r18 e418: ea 01 movw r28, r20 e41a: 06 2f mov r16, r22 e41c: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); e41e: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e422: 88 23 and r24, r24 e424: d1 f0 breq .+52 ; 0xe45a } 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()); e426: 0e 94 36 62 call 0xc46c ; 0xc46c e42a: 48 2f mov r20, r24 e42c: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e430: 80 e0 ldi r24, 0x00 ; 0 e432: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 uint8_t len = lcd_print_pad_P(str, max_strlen); e436: 61 e1 ldi r22, 0x11 ; 17 e438: c7 01 movw r24, r14 e43a: 0e 94 c7 71 call 0xe38e ; 0xe38e lcd_putc_at((max_strlen - len) + 2, menu_row, num); e43e: 40 2f mov r20, r16 e440: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e444: 93 e1 ldi r25, 0x13 ; 19 e446: 98 1b sub r25, r24 e448: 89 2f mov r24, r25 e44a: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); e44e: 40 e2 ldi r20, 0x20 ; 32 e450: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e454: 83 e1 ldi r24, 0x13 ; 19 e456: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 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)) e45a: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e45e: 88 23 and r24, r24 e460: c9 f0 breq .+50 ; 0xe494 e462: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e466: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e46a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e46e: 28 17 cp r18, r24 e470: 19 06 cpc r1, r25 e472: 81 f4 brne .+32 ; 0xe494 { lcd_update_enabled = 0; e474: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(fn_par); e478: 81 2f mov r24, r17 e47a: fe 01 movw r30, r28 e47c: 19 95 eicall lcd_update_enabled = 1; e47e: 81 e0 ldi r24, 0x01 ; 1 e480: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); return; } } menu_item++; } e484: df 91 pop r29 e486: cf 91 pop r28 e488: 1f 91 pop r17 e48a: 0f 91 pop r16 e48c: ff 90 pop r15 e48e: 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(); e490: 0c 94 43 62 jmp 0xc486 ; 0xc486 return; } } menu_item++; e494: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e498: 8f 5f subi r24, 0xFF ; 255 e49a: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e49e: df 91 pop r29 e4a0: cf 91 pop r28 e4a2: 1f 91 pop r17 e4a4: 0f 91 pop r16 e4a6: ff 90 pop r15 e4a8: ef 90 pop r14 e4aa: 08 95 ret 0000e4ac : static char menu_selection_mark(){ return (lcd_encoder == menu_item)?'>':' '; } static void menu_draw_item_puts_P(char type_char, const char* str) { e4ac: 0f 93 push r16 e4ae: 1f 93 push r17 e4b0: cf 93 push r28 e4b2: c8 2f mov r28, r24 e4b4: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); e4b6: 0e 94 36 62 call 0xc46c ; 0xc46c e4ba: 48 2f mov r20, r24 e4bc: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e4c0: 80 e0 ldi r24, 0x00 ; 0 e4c2: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_print_pad_P(str, LCD_WIDTH - 2); e4c6: 62 e1 ldi r22, 0x12 ; 18 e4c8: c8 01 movw r24, r16 e4ca: 0e 94 c7 71 call 0xe38e ; 0xe38e lcd_putc(type_char); e4ce: 8c 2f mov r24, r28 } e4d0: cf 91 pop r28 e4d2: 1f 91 pop r17 e4d4: 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); e4d6: 0c 94 f1 6e jmp 0xdde2 ; 0xdde2 0000e4da : 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) { e4da: cf 93 push r28 e4dc: df 93 push r29 if (menu_item == menu_line) e4de: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e4e2: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e4e6: 32 13 cpse r19, r18 e4e8: 21 c0 rjmp .+66 ; 0xe52c e4ea: eb 01 movw r28, r22 e4ec: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); e4ee: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e4f2: 88 23 and r24, r24 e4f4: 19 f0 breq .+6 ; 0xe4fc e4f6: 80 e2 ldi r24, 0x20 ; 32 e4f8: 0e 94 56 72 call 0xe4ac ; 0xe4ac if (menu_clicked && (lcd_encoder == menu_item)) e4fc: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e500: 88 23 and r24, r24 e502: a1 f0 breq .+40 ; 0xe52c e504: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e508: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e50c: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e510: 28 17 cp r18, r24 e512: 19 06 cpc r1, r25 e514: 59 f4 brne .+22 ; 0xe52c { lcd_update_enabled = 0; e516: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); e51a: fe 01 movw r30, r28 e51c: 19 95 eicall lcd_update_enabled = 1; e51e: 81 e0 ldi r24, 0x01 ; 1 e520: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); return; } } menu_item++; } e524: df 91 pop r29 e526: 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(); e528: 0c 94 43 62 jmp 0xc486 ; 0xc486 return; } } menu_item++; e52c: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e530: 8f 5f subi r24, 0xFF ; 255 e532: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e536: df 91 pop r29 e538: cf 91 pop r28 e53a: 08 95 ret 0000e53c : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) e53c: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e540: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e544: 32 13 cpse r19, r18 e546: 19 c0 rjmp .+50 ; 0xe57a e548: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); e54a: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e54e: 88 23 and r24, r24 e550: 19 f0 breq .+6 ; 0xe558 e552: 83 e8 ldi r24, 0x83 ; 131 e554: 0e 94 56 72 call 0xe4ac ; 0xe4ac if (menu_clicked && (lcd_encoder == menu_item)) e558: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e55c: 88 23 and r24, r24 e55e: 69 f0 breq .+26 ; 0xe57a e560: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e564: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e568: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e56c: 28 17 cp r18, r24 e56e: 19 06 cpc r1, r25 e570: 21 f4 brne .+8 ; 0xe57a { menu_back(); e572: 0e 94 eb 62 call 0xc5d6 ; 0xc5d6 menu_item_ret(); e576: 0c 94 43 62 jmp 0xc486 ; 0xc486 return; } } menu_item++; e57a: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e57e: 8f 5f subi r24, 0xFF ; 255 e580: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e584: 08 95 ret 0000e586 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { e586: cf 93 push r28 e588: df 93 push r29 if (menu_item == menu_line) e58a: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e58e: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e592: 32 13 cpse r19, r18 e594: 1e c0 rjmp .+60 ; 0xe5d2 e596: eb 01 movw r28, r22 e598: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); e59a: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e59e: 88 23 and r24, r24 e5a0: 19 f0 breq .+6 ; 0xe5a8 e5a2: 8e e7 ldi r24, 0x7E ; 126 e5a4: 0e 94 56 72 call 0xe4ac ; 0xe4ac if (menu_clicked && (lcd_encoder == menu_item)) e5a8: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e5ac: 88 23 and r24, r24 e5ae: 89 f0 breq .+34 ; 0xe5d2 e5b0: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e5b4: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e5b8: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e5bc: 28 17 cp r18, r24 e5be: 19 06 cpc r1, r25 e5c0: 41 f4 brne .+16 ; 0xe5d2 { menu_submenu(submenu); e5c2: 60 e0 ldi r22, 0x00 ; 0 e5c4: ce 01 movw r24, r28 e5c6: 0e 94 ad 62 call 0xc55a ; 0xc55a menu_item_ret(); return; } } menu_item++; } e5ca: df 91 pop r29 e5cc: 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(); e5ce: 0c 94 43 62 jmp 0xc486 ; 0xc486 return; } } menu_item++; e5d2: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e5d6: 8f 5f subi r24, 0xFF ; 255 e5d8: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e5dc: df 91 pop r29 e5de: cf 91 pop r28 e5e0: 08 95 ret 0000e5e2 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) e5e2: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e5e6: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e5ea: 32 13 cpse r19, r18 e5ec: 19 c0 rjmp .+50 ; 0xe620 e5ee: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); e5f0: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e5f4: 88 23 and r24, r24 e5f6: 19 f0 breq .+6 ; 0xe5fe e5f8: 80 e2 ldi r24, 0x20 ; 32 e5fa: 0e 94 56 72 call 0xe4ac ; 0xe4ac if (menu_clicked && (lcd_encoder == menu_item)) e5fe: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e602: 88 23 and r24, r24 e604: 69 f0 breq .+26 ; 0xe620 e606: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e60a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e60e: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e612: 28 17 cp r18, r24 e614: 19 06 cpc r1, r25 e616: 21 f4 brne .+8 ; 0xe620 { menu_item_ret(); e618: 0e 94 43 62 call 0xc486 ; 0xc486 return 1; e61c: 81 e0 ldi r24, 0x01 ; 1 e61e: 08 95 ret } } menu_item++; e620: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e624: 8f 5f subi r24, 0xFF ; 255 e626: 80 93 63 04 sts 0x0463, r24 ; 0x800463 return 0; e62a: 80 e0 ldi r24, 0x00 ; 0 } e62c: 08 95 ret 0000e62e : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e62e: 0f 93 push r16 e630: 1f 93 push r17 e632: cf 93 push r28 e634: 8c 01 movw r16, r24 e636: c6 2f mov r28, r22 while (len && *s) { e638: cc 23 and r28, r28 e63a: 49 f0 breq .+18 ; 0xe64e e63c: f8 01 movw r30, r16 e63e: 81 91 ld r24, Z+ e640: 8f 01 movw r16, r30 e642: 88 23 and r24, r24 e644: 21 f0 breq .+8 ; 0xe64e lcd_write(*(s++)); e646: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 --len; e64a: c1 50 subi r28, 0x01 ; 1 e64c: f5 cf rjmp .-22 ; 0xe638 } lcd_space(len); e64e: 8c 2f mov r24, r28 e650: 0e 94 f8 6e call 0xddf0 ; 0xddf0 return len; } e654: 8c 2f mov r24, r28 e656: cf 91 pop r28 e658: 1f 91 pop r17 e65a: 0f 91 pop r16 e65c: 08 95 ret 0000e65e : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e65e: cf 93 push r28 e660: df 93 push r29 e662: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e664: 89 91 ld r24, Y+ e666: 88 23 and r24, r24 e668: 19 f0 breq .+6 ; 0xe670 e66a: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 e66e: fa cf rjmp .-12 ; 0xe664 } e670: df 91 pop r29 e672: cf 91 pop r28 e674: 08 95 ret 0000e676 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e676: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 return 0; } e67a: 90 e0 ldi r25, 0x00 ; 0 e67c: 80 e0 ldi r24, 0x00 ; 0 e67e: 08 95 ret 0000e680 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e680: 10 92 95 03 sts 0x0395, r1 ; 0x800395 lcd_longpress_trigger = 0; e684: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 } e688: 08 95 ret 0000e68a : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e68a: cf 93 push r28 bool clicked = LCD_CLICKED; e68c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 e690: c1 e0 ldi r28, 0x01 ; 1 e692: 81 11 cpse r24, r1 e694: 04 c0 rjmp .+8 ; 0xe69e e696: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e698: 8c 2f mov r24, r28 e69a: cf 91 pop r28 e69c: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e69e: 0e 94 40 73 call 0xe680 ; 0xe680 e6a2: fa cf rjmp .-12 ; 0xe698 0000e6a4 <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) e6a4: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e6a8: 88 23 and r24, r24 e6aa: 09 f4 brne .+2 ; 0xe6ae <_menu_edit_P()+0xa> e6ac: 52 c0 rjmp .+164 ; 0xe752 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { e6ae: 20 91 a1 03 lds r18, 0x03A1 ; 0x8003a1 e6b2: 30 91 a2 03 lds r19, 0x03A2 ; 0x8003a2 e6b6: 80 91 9d 03 lds r24, 0x039D ; 0x80039d e6ba: 90 91 9e 03 lds r25, 0x039E ; 0x80039e e6be: 21 15 cp r18, r1 e6c0: 31 05 cpc r19, r1 e6c2: d9 f0 breq .+54 ; 0xe6fa <_menu_edit_P()+0x56> e6c4: 40 91 1e 06 lds r20, 0x061E ; 0x80061e e6c8: 50 91 1f 06 lds r21, 0x061F ; 0x80061f e6cc: 41 15 cp r20, r1 e6ce: 51 05 cpc r21, r1 e6d0: a1 f0 breq .+40 ; 0xe6fa <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { e6d2: 7c f0 brlt .+30 ; 0xe6f2 <_menu_edit_P()+0x4e> e6d4: 40 91 9b 03 lds r20, 0x039B ; 0x80039b e6d8: 50 91 9c 03 lds r21, 0x039C ; 0x80039c e6dc: 48 17 cp r20, r24 e6de: 59 07 cpc r21, r25 e6e0: 41 f4 brne .+16 ; 0xe6f2 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; e6e2: 30 93 9c 03 sts 0x039C, r19 ; 0x80039c e6e6: 20 93 9b 03 sts 0x039B, r18 ; 0x80039b lcd_encoder = 0; e6ea: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e6ee: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; e6f2: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 e6f6: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 } _md->currentValue += lcd_encoder; e6fa: 20 91 9b 03 lds r18, 0x039B ; 0x80039b e6fe: 30 91 9c 03 lds r19, 0x039C ; 0x80039c e702: 40 91 1e 06 lds r20, 0x061E ; 0x80061e e706: 50 91 1f 06 lds r21, 0x061F ; 0x80061f e70a: 24 0f add r18, r20 e70c: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event e70e: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e712: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); e716: 28 17 cp r18, r24 e718: 39 07 cpc r19, r25 e71a: 44 f0 brlt .+16 ; 0xe72c <_menu_edit_P()+0x88> e71c: 80 91 9f 03 lds r24, 0x039F ; 0x80039f e720: 90 91 a0 03 lds r25, 0x03A0 ; 0x8003a0 e724: 28 17 cp r18, r24 e726: 39 07 cpc r19, r25 e728: 0c f4 brge .+2 ; 0xe72c <_menu_edit_P()+0x88> e72a: c9 01 movw r24, r18 e72c: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c e730: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b lcd_set_cursor(0, 1); e734: 61 e0 ldi r22, 0x01 ; 1 e736: 80 e0 ldi r24, 0x00 ; 0 e738: 0e 94 2a 6f call 0xde54 ; 0xde54 menu_draw_P(' ', _md->editLabel, _md->currentValue); e73c: 40 91 9b 03 lds r20, 0x039B ; 0x80039b e740: 50 91 9c 03 lds r21, 0x039C ; 0x80039c e744: 60 91 96 03 lds r22, 0x0396 ; 0x800396 e748: 70 91 97 03 lds r23, 0x0397 ; 0x800397 e74c: 80 e2 ldi r24, 0x20 ; 32 e74e: 0e 94 02 6f call 0xde04 ; 0xde04 } if (lcd_clicked()) e752: 0e 94 45 73 call 0xe68a ; 0xe68a e756: 88 23 and r24, r24 e758: 41 f1 breq .+80 ; 0xe7aa <_menu_edit_P()+0x106> e75a: e0 91 99 03 lds r30, 0x0399 ; 0x800399 e75e: f0 91 9a 03 lds r31, 0x039A ; 0x80039a e762: 80 91 9b 03 lds r24, 0x039B ; 0x80039b e766: 90 91 9c 03 lds r25, 0x039C ; 0x80039c { if (_md->editValueBits == 8) e76a: 20 91 98 03 lds r18, 0x0398 ; 0x800398 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; e76e: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) e770: 28 30 cpi r18, 0x08 ; 8 e772: c9 f4 brne .+50 ; 0xe7a6 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) e774: 80 91 df 03 lds r24, 0x03DF ; 0x8003df e778: 88 23 and r24, r24 e77a: b9 f0 breq .+46 ; 0xe7aa <_menu_edit_P()+0x106> { menu_depth--; e77c: 81 50 subi r24, 0x01 ; 1 e77e: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); e782: 90 e0 ldi r25, 0x00 ; 0 e784: fc 01 movw r30, r24 e786: ee 0f add r30, r30 e788: ff 1f adc r31, r31 e78a: e8 0f add r30, r24 e78c: f9 1f adc r31, r25 e78e: e9 5a subi r30, 0xA9 ; 169 e790: fc 4f sbci r31, 0xFC ; 252 e792: 62 81 ldd r22, Z+2 ; 0x02 e794: 06 2e mov r0, r22 e796: 00 0c add r0, r0 e798: 77 0b sbc r23, r23 e79a: 20 e0 ldi r18, 0x00 ; 0 e79c: 40 e0 ldi r20, 0x00 ; 0 e79e: 80 81 ld r24, Z e7a0: 91 81 ldd r25, Z+1 ; 0x01 e7a2: 0c 94 87 62 jmp 0xc50e ; 0xc50e if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; e7a6: 91 83 std Z+1, r25 ; 0x01 e7a8: e5 cf rjmp .-54 ; 0xe774 <_menu_edit_P()+0xd0> menu_back_no_reset(); } } e7aa: 08 95 ret 0000e7ac : } } void menu_back_if_clicked(void) { if (lcd_clicked()) e7ac: 0e 94 45 73 call 0xe68a ; 0xe68a e7b0: 81 11 cpse r24, r1 menu_back(); e7b2: 0c 94 eb 62 jmp 0xc5d6 ; 0xc5d6 } e7b6: 08 95 ret 0000e7b8 : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) e7b8: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e7bc: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e7c0: 97 ff sbrs r25, 7 e7c2: 07 c0 rjmp .+14 ; 0xe7d2 { lcd_encoder = 0; e7c4: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e7c8: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e Sound_MakeSound(e_SOUND_TYPE_BlindAlert); e7cc: 87 e0 ldi r24, 0x07 ; 7 e7ce: 0f 94 62 23 call 0x246c4 ; 0x246c4 } if (lcd_encoder < menu_top) e7d2: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e7d6: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e7da: 20 91 92 03 lds r18, 0x0392 ; 0x800392 e7de: 28 17 cp r18, r24 e7e0: 19 06 cpc r1, r25 e7e2: 19 f0 breq .+6 ; 0xe7ea e7e4: 14 f0 brlt .+4 ; 0xe7ea menu_top = lcd_encoder; e7e6: 80 93 92 03 sts 0x0392, r24 ; 0x800392 menu_line = menu_top; e7ea: 80 91 92 03 lds r24, 0x0392 ; 0x800392 e7ee: 80 93 62 04 sts 0x0462, r24 ; 0x800462 menu_clicked = lcd_clicked(); // Consume click event e7f2: 0e 94 45 73 call 0xe68a ; 0xe68a e7f6: 80 93 61 04 sts 0x0461, r24 ; 0x800461 } e7fa: 08 95 ret 0000e7fc : 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); e7fc: 8e ef ldi r24, 0xFE ; 254 e7fe: 9f e0 ldi r25, 0x0F ; 15 e800: 0f 94 9d a3 call 0x3473a ; 0x3473a return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e804: 8e 3f cpi r24, 0xFE ; 254 e806: 39 f0 breq .+14 ; 0xe816 e808: 91 e0 ldi r25, 0x01 ; 1 e80a: 20 91 2d 03 lds r18, 0x032D ; 0x80032d e80e: 28 13 cpse r18, r24 e810: 90 e0 ldi r25, 0x00 ; 0 e812: 89 2f mov r24, r25 e814: 08 95 ret e816: 80 e0 ldi r24, 0x00 ; 0 } e818: 08 95 ret 0000e81a : return _n("??"); } void lang_reset(void) { lang_selected = 0; e81a: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e81e: 6e ef ldi r22, 0xFE ; 254 e820: 8e ef ldi r24, 0xFE ; 254 e822: 9f e0 ldi r25, 0x0F ; 15 e824: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 0000e828 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e828: 85 37 cpi r24, 0x75 ; 117 e82a: 28 e6 ldi r18, 0x68 ; 104 e82c: 92 07 cpc r25, r18 e82e: 09 f4 brne .+2 ; 0xe832 e830: 59 c0 rjmp .+178 ; 0xe8e4 e832: f8 f4 brcc .+62 ; 0xe872 e834: 8e 36 cpi r24, 0x6E ; 110 e836: 25 e6 ldi r18, 0x65 ; 101 e838: 92 07 cpc r25, r18 e83a: 09 f4 brne .+2 ; 0xe83e e83c: 59 c0 rjmp .+178 ; 0xe8f0 e83e: 50 f4 brcc .+20 ; 0xe854 e840: 83 37 cpi r24, 0x73 ; 115 e842: 23 e6 ldi r18, 0x63 ; 99 e844: 92 07 cpc r25, r18 e846: b1 f1 breq .+108 ; 0xe8b4 e848: 85 36 cpi r24, 0x65 ; 101 e84a: 94 46 sbci r25, 0x64 ; 100 e84c: b1 f1 breq .+108 ; 0xe8ba //#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("??"); e84e: 82 ea ldi r24, 0xA2 ; 162 e850: 93 e6 ldi r25, 0x63 ; 99 e852: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e854: 82 37 cpi r24, 0x72 ; 114 e856: 26 e6 ldi r18, 0x66 ; 102 e858: 92 07 cpc r25, r18 e85a: 91 f1 breq .+100 ; 0xe8c0 e85c: 82 37 cpi r24, 0x72 ; 114 e85e: 28 e6 ldi r18, 0x68 ; 104 e860: 92 07 cpc r25, r18 e862: 09 f4 brne .+2 ; 0xe866 e864: 42 c0 rjmp .+132 ; 0xe8ea e866: 83 37 cpi r24, 0x73 ; 115 e868: 95 46 sbci r25, 0x65 ; 101 e86a: 89 f7 brne .-30 ; 0xe84e { 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"); e86c: 89 ef ldi r24, 0xF9 ; 249 e86e: 93 e6 ldi r25, 0x63 ; 99 e870: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e872: 8c 36 cpi r24, 0x6C ; 108 e874: 20 e7 ldi r18, 0x70 ; 112 e876: 92 07 cpc r25, r18 e878: 31 f1 breq .+76 ; 0xe8c6 e87a: 70 f4 brcc .+28 ; 0xe898 e87c: 8c 36 cpi r24, 0x6C ; 108 e87e: 2e e6 ldi r18, 0x6E ; 110 e880: 92 07 cpc r25, r18 e882: 21 f1 breq .+72 ; 0xe8cc e884: 8f 36 cpi r24, 0x6F ; 111 e886: 2e e6 ldi r18, 0x6E ; 110 e888: 92 07 cpc r25, r18 e88a: 31 f1 breq .+76 ; 0xe8d8 e88c: 84 37 cpi r24, 0x74 ; 116 e88e: 99 46 sbci r25, 0x69 ; 105 e890: f1 f6 brne .-68 ; 0xe84e 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"); e892: 87 ee ldi r24, 0xE7 ; 231 e894: 93 e6 ldi r25, 0x63 ; 99 e896: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e898: 8b 36 cpi r24, 0x6B ; 107 e89a: 23 e7 ldi r18, 0x73 ; 115 e89c: 92 07 cpc r25, r18 e89e: f9 f0 breq .+62 ; 0xe8de e8a0: 86 37 cpi r24, 0x76 ; 118 e8a2: 23 e7 ldi r18, 0x73 ; 115 e8a4: 92 07 cpc r25, r18 e8a6: a9 f0 breq .+42 ; 0xe8d2 e8a8: 8f 36 cpi r24, 0x6F ; 111 e8aa: 92 47 sbci r25, 0x72 ; 114 e8ac: 81 f6 brne .-96 ; 0xe84e #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 e8ae: 85 ea ldi r24, 0xA5 ; 165 e8b0: 93 e6 ldi r25, 0x63 ; 99 e8b2: 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"); e8b4: 89 e0 ldi r24, 0x09 ; 9 e8b6: 94 e6 ldi r25, 0x64 ; 100 e8b8: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e8ba: 81 e0 ldi r24, 0x01 ; 1 e8bc: 94 e6 ldi r25, 0x64 ; 100 e8be: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e8c0: 80 ef ldi r24, 0xF0 ; 240 e8c2: 93 e6 ldi r25, 0x63 ; 99 e8c4: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e8c6: 80 ee ldi r24, 0xE0 ; 224 e8c8: 93 e6 ldi r25, 0x63 ; 99 e8ca: 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 e8cc: 85 ed ldi r24, 0xD5 ; 213 e8ce: 93 e6 ldi r25, 0x63 ; 99 e8d0: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e8d2: 8d ec ldi r24, 0xCD ; 205 e8d4: 93 e6 ldi r25, 0x63 ; 99 e8d6: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e8d8: 87 ec ldi r24, 0xC7 ; 199 e8da: 93 e6 ldi r25, 0x63 ; 99 e8dc: 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 e8de: 8c eb ldi r24, 0xBC ; 188 e8e0: 93 e6 ldi r25, 0x63 ; 99 e8e2: 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 e8e4: 85 eb ldi r24, 0xB5 ; 181 e8e6: 93 e6 ldi r25, 0x63 ; 99 e8e8: 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 e8ea: 8c ea ldi r24, 0xAC ; 172 e8ec: 93 e6 ldi r25, 0x63 ; 99 e8ee: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e8f0: 81 e1 ldi r24, 0x11 ; 17 e8f2: 94 e6 ldi r25, 0x64 ; 100 // case LANG_CODE_QR: return _n("New language"); //community contribution //#endif // COMMUNITY_LANG_GROUP1_QR #endif // COMMUNITY_LANGUAGE_SUPPORT } return _n("??"); } e8f4: 08 95 ret 0000e8f6 : return (sum == lt_sum); } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e8f6: ed e8 ldi r30, 0x8D ; 141 e8f8: f4 e7 ldi r31, 0x74 ; 116 e8fa: 85 91 lpm r24, Z+ e8fc: 95 91 lpm r25, Z+ e8fe: a5 91 lpm r26, Z+ e900: b4 91 lpm r27, Z e902: 8f 3f cpi r24, 0xFF ; 255 e904: 9f 4f sbci r25, 0xFF ; 255 e906: af 4f sbci r26, 0xFF ; 255 e908: bf 4f sbci r27, 0xFF ; 255 e90a: b1 f0 breq .+44 ; 0xe938 if (header.magic != LANG_MAGIC) break; //break if magic not valid addr += header.size; //calc address of next table count++; //inc counter } #else //XFLASH uint16_t table = _SEC_LANG_TABLE; e90c: 20 e0 ldi r18, 0x00 ; 0 e90e: 31 e0 ldi r19, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) e910: 81 e0 ldi r24, 0x01 ; 1 while (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid e912: f9 01 movw r30, r18 e914: 45 91 lpm r20, Z+ e916: 55 91 lpm r21, Z+ e918: 65 91 lpm r22, Z+ e91a: 74 91 lpm r23, Z e91c: 45 3a cpi r20, 0xA5 ; 165 e91e: 5a 45 sbci r21, 0x5A ; 90 e920: 64 4b sbci r22, 0xB4 ; 180 e922: 7b 44 sbci r23, 0x4B ; 75 e924: 09 f0 breq .+2 ; 0xe928 e926: 08 95 ret { table += pgm_read_word((uint16_t*)(table + 4)); e928: f9 01 movw r30, r18 e92a: 34 96 adiw r30, 0x04 ; 4 e92c: 45 91 lpm r20, Z+ e92e: 54 91 lpm r21, Z e930: 24 0f add r18, r20 e932: 35 1f adc r19, r21 count++; e934: 8f 5f subi r24, 0xFF ; 255 e936: ed cf rjmp .-38 ; 0xe912 } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) return 1; //signature not set - only primary language will be available e938: 81 e0 ldi r24, 0x01 ; 1 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e93a: 08 95 ret 0000e93c : 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) { e93c: 0f 93 push r16 e93e: 1f 93 push r17 if (lang == LANG_ID_PRI) //primary language e940: 81 11 cpse r24, r1 e942: 13 c0 rjmp .+38 ; 0xe96a { lang_table = 0; e944: 10 92 2c 03 sts 0x032C, r1 ; 0x80032c e948: 10 92 2b 03 sts 0x032B, r1 ; 0x80032b lang_selected = lang; e94c: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e950: 90 91 2d 03 lds r25, 0x032D ; 0x80032d e954: 98 13 cpse r25, r24 e956: 5c c0 rjmp .+184 ; 0xea10 e958: 68 2f mov r22, r24 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e95a: 8e ef ldi r24, 0xFE ; 254 e95c: 9f e0 ldi r25, 0x0F ; 15 e95e: 0f 94 c1 a3 call 0x34782 ; 0x34782 return 1; e962: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e964: 1f 91 pop r17 e966: 0f 91 pop r16 e968: 08 95 ret lang_selected = lang; // set language id } } } #else //XFLASH if (lang == LANG_ID_SEC) e96a: 81 30 cpi r24, 0x01 ; 1 e96c: 89 f7 brne .-30 ; 0xe950 { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid e96e: e0 e0 ldi r30, 0x00 ; 0 e970: f1 e0 ldi r31, 0x01 ; 1 e972: 45 91 lpm r20, Z+ e974: 55 91 lpm r21, Z+ e976: 65 91 lpm r22, Z+ e978: 74 91 lpm r23, Z e97a: 45 3a cpi r20, 0xA5 ; 165 e97c: 5a 45 sbci r21, 0x5A ; 90 e97e: 64 4b sbci r22, 0xB4 ; 180 e980: 7b 44 sbci r23, 0x4B ; 75 e982: 31 f7 brne .-52 ; 0xe950 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e984: e4 e0 ldi r30, 0x04 ; 4 e986: f1 e0 ldi r31, 0x01 ; 1 e988: a5 91 lpm r26, Z+ e98a: b4 91 lpm r27, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e98c: e8 e0 ldi r30, 0x08 ; 8 e98e: f1 e0 ldi r31, 0x01 ; 1 e990: 65 91 lpm r22, Z+ e992: 74 91 lpm r23, Z uint16_t i; for (i = 0; i < size; i++) e994: 50 e0 ldi r21, 0x00 ; 0 e996: 40 e0 ldi r20, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e998: 30 e0 ldi r19, 0x00 ; 0 e99a: 20 e0 ldi r18, 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++) e99c: a4 17 cp r26, r20 e99e: b5 07 cpc r27, r21 e9a0: 29 f5 brne .+74 ; 0xe9ec sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e9a2: 26 1b sub r18, r22 e9a4: 37 0b sbc r19, r23 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e9a6: 32 27 eor r19, r18 e9a8: 23 27 eor r18, r19 e9aa: 32 27 eor r19, r18 if (lang == LANG_ID_SEC) { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid { if (lang_check(table)) e9ac: 62 17 cp r22, r18 e9ae: 73 07 cpc r23, r19 e9b0: 09 f0 breq .+2 ; 0xe9b4 e9b2: ce cf rjmp .-100 ; 0xe950 if (pgm_read_dword(((uint32_t*)(table + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e9b4: ec e0 ldi r30, 0x0C ; 12 e9b6: f1 e0 ldi r31, 0x01 ; 1 e9b8: 05 91 lpm r16, Z+ e9ba: 15 91 lpm r17, Z+ e9bc: 25 91 lpm r18, Z+ e9be: 34 91 lpm r19, Z e9c0: ed e8 ldi r30, 0x8D ; 141 e9c2: f4 e7 ldi r31, 0x74 ; 116 e9c4: 45 91 lpm r20, Z+ e9c6: 55 91 lpm r21, Z+ e9c8: 65 91 lpm r22, Z+ e9ca: 74 91 lpm r23, Z e9cc: 04 17 cp r16, r20 e9ce: 15 07 cpc r17, r21 e9d0: 26 07 cpc r18, r22 e9d2: 37 07 cpc r19, r23 e9d4: 09 f0 breq .+2 ; 0xe9d8 e9d6: bc cf rjmp .-136 ; 0xe950 { lang_table = (lang_table_t*)table; // set table pointer e9d8: 20 e0 ldi r18, 0x00 ; 0 e9da: 31 e0 ldi r19, 0x01 ; 1 e9dc: 30 93 2c 03 sts 0x032C, r19 ; 0x80032c e9e0: 20 93 2b 03 sts 0x032B, r18 ; 0x80032b lang_selected = lang; // set language id e9e4: 91 e0 ldi r25, 0x01 ; 1 e9e6: 90 93 2d 03 sts 0x032D, r25 ; 0x80032d e9ea: b2 cf rjmp .-156 ; 0xe950 { 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); e9ec: fa 01 movw r30, r20 e9ee: e0 50 subi r30, 0x00 ; 0 e9f0: ff 4f sbci r31, 0xFF ; 255 e9f2: e4 91 lpm r30, Z e9f4: f0 e0 ldi r31, 0x00 ; 0 e9f6: 98 e0 ldi r25, 0x08 ; 8 e9f8: 40 fd sbrc r20, 0 e9fa: 90 e0 ldi r25, 0x00 ; 0 e9fc: 02 c0 rjmp .+4 ; 0xea02 e9fe: ee 0f add r30, r30 ea00: ff 1f adc r31, r31 ea02: 9a 95 dec r25 ea04: e2 f7 brpl .-8 ; 0xe9fe ea06: 2e 0f add r18, r30 ea08: 3f 1f adc r19, 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++) ea0a: 4f 5f subi r20, 0xFF ; 255 ea0c: 5f 4f sbci r21, 0xFF ; 255 ea0e: c6 cf rjmp .-116 ; 0xe99c if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; ea10: 80 e0 ldi r24, 0x00 ; 0 ea12: a8 cf rjmp .-176 ; 0xe964 0000ea14 : //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. ea14: 20 91 2d 03 lds r18, 0x032D ; 0x80032d ea18: 21 11 cpse r18, r1 ea1a: 04 c0 rjmp .+8 ; 0xea24 ea1c: fc 01 movw r30, r24 ea1e: 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 } ea20: cf 01 movw r24, r30 ea22: 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. ea24: 40 91 2b 03 lds r20, 0x032B ; 0x80032b ea28: 50 91 2c 03 lds r21, 0x032C ; 0x80032c ea2c: 41 15 cp r20, r1 ea2e: 51 05 cpc r21, r1 ea30: a9 f3 breq .-22 ; 0xea1c uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id ea32: fc 01 movw r30, r24 ea34: 25 91 lpm r18, Z+ ea36: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. ea38: 2f 3f cpi r18, 0xFF ; 255 ea3a: 32 07 cpc r19, r18 ea3c: 79 f3 breq .-34 ; 0xea1c ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset ea3e: f9 01 movw r30, r18 ea40: 38 96 adiw r30, 0x08 ; 8 ea42: ee 0f add r30, r30 ea44: ff 1f adc r31, r31 ea46: e4 0f add r30, r20 ea48: f5 1f adc r31, r21 ea4a: 25 91 lpm r18, Z+ ea4c: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character ea4e: fa 01 movw r30, r20 ea50: e2 0f add r30, r18 ea52: f3 1f adc r31, r19 ea54: 24 91 lpm r18, Z ea56: 22 23 and r18, r18 ea58: 09 f3 breq .-62 ; 0xea1c ea5a: e2 cf rjmp .-60 ; 0xea20 0000ea5c : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { ea5c: 8f 92 push r8 ea5e: 9f 92 push r9 ea60: af 92 push r10 ea62: bf 92 push r11 ea64: cf 92 push r12 ea66: df 92 push r13 ea68: ef 92 push r14 ea6a: ff 92 push r15 ea6c: 0f 93 push r16 ea6e: 1f 93 push r17 ea70: cf 93 push r28 ea72: df 93 push r29 if (menu_item == menu_line) ea74: e0 91 63 04 lds r30, 0x0463 ; 0x800463 ea78: 30 91 62 04 lds r19, 0x0462 ; 0x800462 ea7c: e3 13 cpse r30, r19 ea7e: 73 c0 rjmp .+230 ; 0xeb66 ea80: c2 2f mov r28, r18 ea82: 6a 01 movw r12, r20 ea84: 7b 01 movw r14, r22 ea86: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); ea88: 80 91 59 02 lds r24, 0x0259 ; 0x800259 ea8c: 88 23 and r24, r24 ea8e: a1 f1 breq .+104 ; 0xeaf8 ea90: 0e 94 36 62 call 0xc46c ; 0xc46c ea94: 01 e0 ldi r16, 0x01 ; 1 ea96: 8e 33 cpi r24, 0x3E ; 62 ea98: 09 f0 breq .+2 ; 0xea9c ea9a: 00 e0 ldi r16, 0x00 ; 0 ea9c: 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; ea9e: 80 2f mov r24, r16 eaa0: 82 70 andi r24, 0x02 ; 2 eaa2: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; eaa4: e1 14 cp r14, r1 eaa6: f1 04 cpc r15, r1 eaa8: 09 f4 brne .+2 ; 0xeaac eaaa: 6f c0 rjmp .+222 ; 0xeb8a eaac: e7 01 movw r28, r14 eaae: 90 e2 ldi r25, 0x20 ; 32 eab0: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); eab2: 88 20 and r8, r8 eab4: 09 f4 brne .+2 ; 0xeab8 eab6: 41 c0 rjmp .+130 ; 0xeb3a eab8: ce 01 movw r24, r28 eaba: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__strlen_P> eabe: 14 e0 ldi r17, 0x04 ; 4 eac0: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); eac2: 4e e3 ldi r20, 0x3E ; 62 eac4: 00 ff sbrs r16, 0 eac6: 40 e2 ldi r20, 0x20 ; 32 eac8: 60 91 60 04 lds r22, 0x0460 ; 0x800460 eacc: 80 e0 ldi r24, 0x00 ; 0 eace: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_print_pad_P(str, LCD_WIDTH - len); ead2: 64 e1 ldi r22, 0x14 ; 20 ead4: 61 1b sub r22, r17 ead6: c5 01 movw r24, r10 ead8: 0e 94 c7 71 call 0xe38e ; 0xe38e lcd_putc('['); eadc: 8b e5 ldi r24, 0x5B ; 91 eade: 0e 94 f1 6e call 0xdde2 ; 0xdde2 if (is_progmem) { lcd_puts_P(toggle); eae2: 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) eae4: 88 20 and r8, r8 eae6: 89 f1 breq .+98 ; 0xeb4a { lcd_puts_P(toggle); eae8: 0e 94 ed 6e call 0xddda ; 0xddda } else { lcd_print(toggle); } lcd_putc(']'); eaec: 8d e5 ldi r24, 0x5D ; 93 eaee: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_putc(eol); eaf2: 89 2d mov r24, r9 eaf4: 0e 94 f1 6e call 0xdde2 ; 0xdde2 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)) eaf8: 80 91 61 04 lds r24, 0x0461 ; 0x800461 eafc: 88 23 and r24, r24 eafe: 99 f1 breq .+102 ; 0xeb66 eb00: 20 91 63 04 lds r18, 0x0463 ; 0x800463 eb04: 80 91 1e 06 lds r24, 0x061E ; 0x80061e eb08: 90 91 1f 06 lds r25, 0x061F ; 0x80061f eb0c: 28 17 cp r18, r24 eb0e: 19 06 cpc r1, r25 eb10: 51 f5 brne .+84 ; 0xeb66 { if (toggle == NULL) // print N/A warning message eb12: ef 28 or r14, r15 eb14: e9 f4 brne .+58 ; 0xeb50 { menu_submenu(func); eb16: 60 e0 ldi r22, 0x00 ; 0 eb18: c6 01 movw r24, r12 eb1a: 0e 94 ad 62 call 0xc55a ; 0xc55a menu_item_ret(); return; } } menu_item++; } eb1e: df 91 pop r29 eb20: cf 91 pop r28 eb22: 1f 91 pop r17 eb24: 0f 91 pop r16 eb26: ff 90 pop r15 eb28: ef 90 pop r14 eb2a: df 90 pop r13 eb2c: cf 90 pop r12 eb2e: bf 90 pop r11 eb30: af 90 pop r10 eb32: 9f 90 pop r9 eb34: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); eb36: 0c 94 43 62 jmp 0xc486 ; 0xc486 //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)); eb3a: fe 01 movw r30, r28 eb3c: 01 90 ld r0, Z+ eb3e: 00 20 and r0, r0 eb40: e9 f7 brne .-6 ; 0xeb3c eb42: ec 1b sub r30, r28 eb44: 13 e0 ldi r17, 0x03 ; 3 eb46: 1e 0f add r17, r30 eb48: bc cf rjmp .-136 ; 0xeac2 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); eb4a: 0e 94 2f 73 call 0xe65e ; 0xe65e eb4e: ce cf rjmp .-100 ; 0xeaec { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; eb50: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); eb54: c1 14 cp r12, r1 eb56: d1 04 cpc r13, r1 eb58: 11 f0 breq .+4 ; 0xeb5e eb5a: f6 01 movw r30, r12 eb5c: 19 95 eicall lcd_update_enabled = 1; eb5e: 81 e0 ldi r24, 0x01 ; 1 eb60: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a eb64: dc cf rjmp .-72 ; 0xeb1e } menu_item_ret(); return; } } menu_item++; eb66: 80 91 63 04 lds r24, 0x0463 ; 0x800463 eb6a: 8f 5f subi r24, 0xFF ; 255 eb6c: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } eb70: df 91 pop r29 eb72: cf 91 pop r28 eb74: 1f 91 pop r17 eb76: 0f 91 pop r16 eb78: ff 90 pop r15 eb7a: ef 90 pop r14 eb7c: df 90 pop r13 eb7e: cf 90 pop r12 eb80: bf 90 pop r11 eb82: af 90 pop r10 eb84: 9f 90 pop r9 eb86: 8f 90 pop r8 eb88: 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); eb8a: 80 e2 ldi r24, 0x20 ; 32 eb8c: 98 e4 ldi r25, 0x48 ; 72 eb8e: 0e 94 0a 75 call 0xea14 ; 0xea14 eb92: 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] : ' '; eb94: 8e e7 ldi r24, 0x7E ; 126 eb96: 98 2e mov r9, r24 eb98: 8c cf rjmp .-232 ; 0xeab2 0000eb9a : //! @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) { eb9a: 0f 93 push r16 eb9c: 1f 93 push r17 eb9e: cf 93 push r28 eba0: df 93 push r29 eba2: 8c 01 movw r16, r24 eba4: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); eba6: 85 e2 ldi r24, 0x25 ; 37 eba8: 9e e4 ldi r25, 0x4E ; 78 ebaa: 0e 94 0a 75 call 0xea14 ; 0xea14 ebae: 9f 93 push r25 ebb0: 8f 93 push r24 ebb2: 8c e5 ldi r24, 0x5C ; 92 ebb4: 91 e8 ldi r25, 0x81 ; 129 ebb6: 9f 93 push r25 ebb8: 8f 93 push r24 ebba: df 93 push r29 ebbc: cf 93 push r28 ebbe: 0f 94 b4 a2 call 0x34568 ; 0x34568 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); ebc2: c8 0f add r28, r24 ebc4: d1 1d adc r29, r1 ebc6: 47 e0 ldi r20, 0x07 ; 7 ebc8: 50 e0 ldi r21, 0x00 ; 0 ebca: b8 01 movw r22, r16 ebcc: ce 01 movw r24, r28 ebce: 0f 94 8d a3 call 0x3471a ; 0x3471a //index += 7; buffer.c[index + 7] = '\0'; ebd2: 1f 82 std Y+7, r1 ; 0x07 ebd4: 0f 90 pop r0 ebd6: 0f 90 pop r0 ebd8: 0f 90 pop r0 ebda: 0f 90 pop r0 ebdc: 0f 90 pop r0 ebde: 0f 90 pop r0 } ebe0: df 91 pop r29 ebe2: cf 91 pop r28 ebe4: 1f 91 pop r17 ebe6: 0f 91 pop r16 ebe8: 08 95 ret 0000ebea : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { ebea: 0f 93 push r16 ebec: 1f 93 push r17 ebee: cf 93 push r28 ebf0: df 93 push r29 ebf2: cd b7 in r28, 0x3d ; 61 ebf4: de b7 in r29, 0x3e ; 62 ebf6: 63 97 sbiw r28, 0x13 ; 19 ebf8: 0f b6 in r0, 0x3f ; 63 ebfa: f8 94 cli ebfc: de bf out 0x3e, r29 ; 62 ebfe: 0f be out 0x3f, r0 ; 63 ec00: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) ec02: 30 91 63 04 lds r19, 0x0463 ; 0x800463 ec06: 20 91 62 04 lds r18, 0x0462 ; 0x800462 ec0a: 32 13 cpse r19, r18 ec0c: 38 c0 rjmp .+112 ; 0xec7e ec0e: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); ec10: 20 91 59 02 lds r18, 0x0259 ; 0x800259 ec14: 22 23 and r18, r18 ec16: a9 f0 breq .+42 ; 0xec42 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); ec18: be 01 movw r22, r28 ec1a: 6f 5f subi r22, 0xFF ; 255 ec1c: 7f 4f sbci r23, 0xFF ; 255 ec1e: 0e 94 cd 75 call 0xeb9a ; 0xeb9a lcd_putc_at(0, menu_row, menu_selection_mark()); ec22: 0e 94 36 62 call 0xc46c ; 0xc46c ec26: 48 2f mov r20, r24 ec28: 60 91 60 04 lds r22, 0x0460 ; 0x800460 ec2c: 80 e0 ldi r24, 0x00 ; 0 ec2e: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_print_pad(buffer.c, LCD_WIDTH - 2); ec32: 62 e1 ldi r22, 0x12 ; 18 ec34: ce 01 movw r24, r28 ec36: 01 96 adiw r24, 0x01 ; 1 ec38: 0e 94 17 73 call 0xe62e ; 0xe62e lcd_putc(type_char); ec3c: 8e e7 ldi r24, 0x7E ; 126 ec3e: 0e 94 f1 6e call 0xdde2 ; 0xdde2 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)) ec42: 80 91 61 04 lds r24, 0x0461 ; 0x800461 ec46: 88 23 and r24, r24 ec48: d1 f0 breq .+52 ; 0xec7e ec4a: 20 91 63 04 lds r18, 0x0463 ; 0x800463 ec4e: 80 91 1e 06 lds r24, 0x061E ; 0x80061e ec52: 90 91 1f 06 lds r25, 0x061F ; 0x80061f ec56: 28 17 cp r18, r24 ec58: 19 06 cpc r1, r25 ec5a: 89 f4 brne .+34 ; 0xec7e 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); ec5c: 60 e0 ldi r22, 0x00 ; 0 ec5e: c8 01 movw r24, r16 ec60: 0e 94 ad 62 call 0xc55a ; 0xc55a menu_item_ret(); ec64: 0e 94 43 62 call 0xc486 ; 0xc486 menu_item_ret(); return; } } menu_item++; } ec68: 63 96 adiw r28, 0x13 ; 19 ec6a: 0f b6 in r0, 0x3f ; 63 ec6c: f8 94 cli ec6e: de bf out 0x3e, r29 ; 62 ec70: 0f be out 0x3f, r0 ; 63 ec72: cd bf out 0x3d, r28 ; 61 ec74: df 91 pop r29 ec76: cf 91 pop r28 ec78: 1f 91 pop r17 ec7a: 0f 91 pop r16 ec7c: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; ec7e: 80 91 63 04 lds r24, 0x0463 ; 0x800463 ec82: 8f 5f subi r24, 0xFF ; 255 ec84: 80 93 63 04 sts 0x0463, r24 ; 0x800463 ec88: ef cf rjmp .-34 ; 0xec68 0000ec8a : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { ec8a: cf 93 push r28 ec8c: df 93 push r29 ec8e: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; ec90: 20 e0 ldi r18, 0x00 ; 0 ec92: 30 e0 ldi r19, 0x00 ; 0 ec94: 4c e8 ldi r20, 0x8C ; 140 ec96: 52 e4 ldi r21, 0x42 ; 66 ec98: 60 91 6d 12 lds r22, 0x126D ; 0x80126d ec9c: 70 91 6e 12 lds r23, 0x126E ; 0x80126e eca0: 80 91 6f 12 lds r24, 0x126F ; 0x80126f eca4: 90 91 70 12 lds r25, 0x1270 ; 0x801270 eca8: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> ecac: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d ecb0: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e ecb4: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f ecb8: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); ecbc: 60 e0 ldi r22, 0x00 ; 0 ecbe: 70 e0 ldi r23, 0x00 ; 0 ecc0: 80 ea ldi r24, 0xA0 ; 160 ecc2: 91 e4 ldi r25, 0x41 ; 65 ecc4: 0f 94 0a 4a call 0x29414 ; 0x29414 load_filament_final_feed(); ecc8: 0e 94 bd 63 call 0xc77a ; 0xc77a } void lcd_loading_filament(const char* filament_name) { lcd_clear(); eccc: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); ecd0: 8d ee ldi r24, 0xED ; 237 ecd2: 91 e6 ldi r25, 0x61 ; 97 ecd4: 0e 94 0a 75 call 0xea14 ; 0xea14 ecd8: ac 01 movw r20, r24 ecda: 60 e0 ldi r22, 0x00 ; 0 ecdc: 80 e0 ldi r24, 0x00 ; 0 ecde: 0e 94 d7 6f call 0xdfae ; 0xdfae if (filament_name[0]) { ece2: 88 81 ld r24, Y ece4: 88 23 and r24, r24 ece6: 39 f0 breq .+14 ; 0xecf6 lcd_set_cursor(0, 1); ece8: 61 e0 ldi r22, 0x01 ; 1 ecea: 80 e0 ldi r24, 0x00 ; 0 ecec: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print(filament_name); ecf0: ce 01 movw r24, r28 ecf2: 0e 94 2f 73 call 0xe65e ; 0xe65e } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); ecf6: 85 e6 ldi r24, 0x65 ; 101 ecf8: 99 e3 ldi r25, 0x39 ; 57 ecfa: 0e 94 0a 75 call 0xea14 ; 0xea14 ecfe: ac 01 movw r20, r24 ed00: 62 e0 ldi r22, 0x02 ; 2 ed02: 80 e0 ldi r24, 0x00 ; 0 ed04: 0e 94 d7 6f call 0xdfae ; 0xdfae 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 ed08: 83 e4 ldi r24, 0x43 ; 67 ed0a: 9b e2 ldi r25, 0x2B ; 43 ed0c: 0f 94 3e 09 call 0x2127c ; 0x2127c lcd_loading_filament(filament_name); st_synchronize(); } ed10: df 91 pop r29 ed12: 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(); ed14: 0d 94 b0 18 jmp 0x23160 ; 0x23160 0000ed18 : * 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; ed18: 0f 94 7f 65 call 0x2cafe ; 0x2cafe ed1c: 8f 3f cpi r24, 0xFF ; 255 ed1e: 11 f1 breq .+68 ; 0xed64 lcd_update_enable(false); ed20: 80 e0 ldi r24, 0x00 ; 0 ed22: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_clear(); ed26: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); ed2a: 89 ea ldi r24, 0xA9 ; 169 ed2c: 99 e5 ldi r25, 0x59 ; 89 ed2e: 0e 94 0a 75 call 0xea14 ; 0xea14 ed32: ac 01 movw r20, r24 ed34: 61 e0 ldi r22, 0x01 ; 1 ed36: 80 e0 ldi r24, 0x00 ; 0 ed38: 0e 94 d7 6f call 0xdfae ; 0xdfae } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); ed3c: 80 e2 ldi r24, 0x20 ; 32 ed3e: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); ed42: 0f 94 7f 65 call 0x2cafe ; 0x2cafe ed46: 68 2f mov r22, r24 ed48: 70 e0 ldi r23, 0x00 ; 0 ed4a: 6f 5f subi r22, 0xFF ; 255 ed4c: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); ed4e: 07 2e mov r0, r23 ed50: 00 0c add r0, r0 ed52: 88 0b sbc r24, r24 ed54: 99 0b sbc r25, r25 ed56: 0e 94 ab 71 call 0xe356 ; 0xe356 // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); ed5a: 0f 94 2e 9d call 0x33a5c ; 0x33a5c lcd_update_enable(true); ed5e: 81 e0 ldi r24, 0x01 ; 1 ed60: 0c 94 08 70 jmp 0xe010 ; 0xe010 } ed64: 08 95 ret 0000ed66 <__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 { ed66: 1f 92 push r1 ed68: 0f 92 push r0 ed6a: 0f b6 in r0, 0x3f ; 63 ed6c: 0f 92 push r0 ed6e: 11 24 eor r1, r1 ed70: 0b b6 in r0, 0x3b ; 59 ed72: 0f 92 push r0 ed74: 2f 93 push r18 ed76: 8f 93 push r24 ed78: 9f 93 push r25 ed7a: ef 93 push r30 ed7c: ff 93 push r31 switch(state){ ed7e: e0 91 26 03 lds r30, 0x0326 ; 0x800326 ed82: e8 30 cpi r30, 0x08 ; 8 ed84: e8 f4 brcc .+58 ; 0xedc0 <__vector_23+0x5a> ed86: f0 e0 ldi r31, 0x00 ; 0 ed88: 88 27 eor r24, r24 ed8a: e6 53 subi r30, 0x36 ; 54 ed8c: f9 48 sbci r31, 0x89 ; 137 ed8e: 8f 4f sbci r24, 0xFF ; 255 ed90: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> ed94: d2 76 andi r29, 0x62 ; 98 ed96: ec 76 andi r30, 0x6C ; 108 ed98: f7 76 andi r31, 0x67 ; 103 ed9a: 05 77 andi r16, 0x75 ; 117 ed9c: 1b 77 andi r17, 0x7B ; 123 ed9e: 24 77 andi r18, 0x74 ; 116 eda0: 47 77 andi r20, 0x77 ; 119 eda2: 59 77 andi r21, 0x79 ; 121 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin eda4: 80 91 28 06 lds r24, 0x0628 ; 0x800628 eda8: 81 11 cpse r24, r1 edaa: 0a c0 rjmp .+20 ; 0xedc0 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! edac: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee edb0: 88 0f add r24, r24 edb2: 80 93 25 03 sts 0x0325, r24 ; 0x800325 if( pwm != 0 ){ edb6: 88 23 and r24, r24 edb8: 19 f0 breq .+6 ; 0xedc0 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period edba: 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 edbc: 80 93 26 03 sts 0x0326, r24 ; 0x800326 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } edc0: ff 91 pop r31 edc2: ef 91 pop r30 edc4: 9f 91 pop r25 edc6: 8f 91 pop r24 edc8: 2f 91 pop r18 edca: 0f 90 pop r0 edcc: 0b be out 0x3b, r0 ; 59 edce: 0f 90 pop r0 edd0: 0f be out 0x3f, r0 ; 63 edd2: 0f 90 pop r0 edd4: 1f 90 pop r1 edd6: 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) edd8: 80 91 24 03 lds r24, 0x0324 ; 0x800324 eddc: 8f 5f subi r24, 0xFF ; 255 edde: 80 93 24 03 sts 0x0324, r24 ; 0x800324 if( slowCounter > pwm ){ ede2: 90 91 25 03 lds r25, 0x0325 ; 0x800325 ede6: 98 17 cp r25, r24 ede8: 58 f3 brcs .-42 ; 0xedc0 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 edea: 82 e0 ldi r24, 0x02 ; 2 edec: e7 cf rjmp .-50 ; 0xedbc <__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 edee: 83 e0 ldi r24, 0x03 ; 3 edf0: 80 93 26 03 sts 0x0326, r24 ; 0x800326 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE edf4: 8f e0 ldi r24, 0x0F ; 15 edf6: 80 93 23 03 sts 0x0323, r24 ; 0x800323 TCNT0 = 255; // force overflow on the next clock cycle edfa: 8f ef ldi r24, 0xFF ; 255 edfc: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz edfe: 81 e0 ldi r24, 0x01 ; 1 ee00: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) ee02: 84 b5 in r24, 0x24 ; 36 ee04: 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 ee06: 84 bd out 0x24, r24 ; 36 ee08: db cf rjmp .-74 ; 0xedc0 <__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; ee0a: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ee0e: 82 95 swap r24 ee10: 80 7f andi r24, 0xF0 ; 240 ee12: 81 95 neg r24 ee14: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ ee16: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ee1a: 88 23 and r24, r24 ee1c: 21 f0 breq .+8 ; 0xee26 <__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; ee1e: 81 50 subi r24, 0x01 ; 1 ee20: 80 93 23 03 sts 0x0323, r24 ; 0x800323 ee24: cd cf rjmp .-102 ; 0xedc0 <__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; ee26: 84 e0 ldi r24, 0x04 ; 4 ee28: 80 93 26 03 sts 0x0326, r24 ; 0x800326 OCR0B = 255; // full duty ee2c: 8f ef ldi r24, 0xFF ; 255 ee2e: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle ee30: 8e ef ldi r24, 0xFE ; 254 ee32: 86 bd out 0x26, r24 ; 38 ee34: c5 cf rjmp .-118 ; 0xedc0 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; ee36: 85 e0 ldi r24, 0x05 ; 5 ee38: 80 93 26 03 sts 0x0326, r24 ; 0x800326 OCR0B = 255; // full duty ee3c: 8f ef ldi r24, 0xFF ; 255 ee3e: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle ee40: 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 ee42: 82 e0 ldi r24, 0x02 ; 2 ee44: 85 bd out 0x25, r24 ; 37 ee46: bc cf rjmp .-136 ; 0xedc0 <__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; ee48: 2f ef ldi r18, 0xFF ; 255 ee4a: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin ee4c: 80 91 28 06 lds r24, 0x0628 ; 0x800628 ee50: 81 11 cpse r24, r1 ee52: b6 cf rjmp .-148 ; 0xedc0 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less ee54: 80 91 24 03 lds r24, 0x0324 ; 0x800324 ee58: 8f 5f subi r24, 0xFF ; 255 ee5a: 80 93 24 03 sts 0x0324, r24 ; 0x800324 if( slowCounter < pwm ){ ee5e: 90 91 25 03 lds r25, 0x0325 ; 0x800325 ee62: 89 17 cp r24, r25 ee64: 08 f4 brcc .+2 ; 0xee68 <__vector_23+0x102> ee66: ac cf rjmp .-168 ; 0xedc0 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain ee68: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee ee6c: 90 e0 ldi r25, 0x00 ; 0 ee6e: 8f 37 cpi r24, 0x7F ; 127 ee70: 91 05 cpc r25, r1 ee72: 0c f0 brlt .+2 ; 0xee76 <__vector_23+0x110> ee74: a5 cf rjmp .-182 ; 0xedc0 <__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; ee76: 86 e0 ldi r24, 0x06 ; 6 ee78: 80 93 26 03 sts 0x0326, r24 ; 0x800326 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ee7c: 8f e0 ldi r24, 0x0F ; 15 ee7e: 80 93 23 03 sts 0x0323, r24 ; 0x800323 TCNT0 = 255; // force overflow on the next clock cycle ee82: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ee84: 81 e0 ldi r24, 0x01 ; 1 ee86: 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 ee88: 84 b5 in r24, 0x24 ; 36 ee8a: 80 61 ori r24, 0x10 ; 16 ee8c: bc cf rjmp .-136 ; 0xee06 <__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 ee8e: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ee92: 82 95 swap r24 ee94: 80 7f andi r24, 0xF0 ; 240 ee96: 81 95 neg r24 ee98: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ ee9a: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ee9e: 81 11 cpse r24, r1 eea0: be cf rjmp .-132 ; 0xee1e <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; eea2: 87 e0 ldi r24, 0x07 ; 7 eea4: 80 93 26 03 sts 0x0326, r24 ; 0x800326 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes eea8: 80 e8 ldi r24, 0x80 ; 128 eeaa: 86 bd out 0x26, r24 ; 38 OCR0B = 255; eeac: 8f ef ldi r24, 0xFF ; 255 eeae: 88 bd out 0x28, r24 ; 40 eeb0: 87 cf rjmp .-242 ; 0xedc0 <__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 eeb2: 10 92 26 03 sts 0x0326, r1 ; 0x800326 TCNT0 = 128; eeb6: 80 e8 ldi r24, 0x80 ; 128 eeb8: 86 bd out 0x26, r24 ; 38 OCR0B = 255; eeba: 8f ef ldi r24, 0xFF ; 255 eebc: 88 bd out 0x28, r24 ; 40 eebe: c1 cf rjmp .-126 ; 0xee42 <__vector_23+0xdc> 0000eec0 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { eec0: cf 93 push r28 eec2: c8 2f mov r28, r24 eec4: 68 2f mov r22, r24 eec6: 87 e6 ldi r24, 0x67 ; 103 eec8: 9f e0 ldi r25, 0x0F ; 15 eeca: 0f 94 c1 a3 call 0x34782 ; 0x34782 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { eece: cc 23 and r28, r28 eed0: 19 f0 breq .+6 ; 0xeed8 fsensor.init(); } else { fsensor.deinit(); } } eed2: 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(); eed4: 0d 94 86 6d jmp 0x2db0c ; 0x2db0c } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; eed8: 10 92 f1 16 sts 0x16F1, r1 ; 0x8016f1 filter = 0; eedc: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } eee0: cf 91 pop r28 eee2: 08 95 ret 0000eee4 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; eee4: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 extruder_autofan_last_check = _millis(); eee8: 0f 94 56 0b call 0x216ac ; 0x216ac eeec: 60 93 07 17 sts 0x1707, r22 ; 0x801707 eef0: 70 93 08 17 sts 0x1708, r23 ; 0x801708 eef4: 80 93 09 17 sts 0x1709, r24 ; 0x801709 eef8: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a } eefc: 08 95 ret 0000eefe : 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; eefe: 80 93 22 03 sts 0x0322, r24 ; 0x800322 newFanSpeed = 0; if (fanState & 0x01) ef02: 80 fd sbrc r24, 0 ef04: 1c c0 rjmp .+56 ; 0xef3e { //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; ef06: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); ef0a: 20 91 3e 03 lds r18, 0x033E ; 0x80033e } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) ef0e: 8f ef ldi r24, 0xFF ; 255 ef10: 82 0f add r24, r18 ef12: 8e 3f cpi r24, 0xFE ; 254 ef14: e8 f0 brcs .+58 ; 0xef50 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); ef16: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ef1a: 87 7f andi r24, 0xF7 ; 247 ef1c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; ef20: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ef24: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); ef28: 9f b7 in r25, 0x3f ; 63 ef2a: 22 23 and r18, r18 ef2c: 61 f0 breq .+24 ; 0xef46 ef2e: f8 94 cli ef30: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ef34: 80 62 ori r24, 0x20 ; 32 ef36: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ef3a: 9f bf out 0x3f, r25 ; 63 ef3c: 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; ef3e: 8f ef ldi r24, 0xFF ; 255 ef40: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e ef44: e2 cf rjmp .-60 ; 0xef0a ef46: f8 94 cli ef48: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ef4c: 8f 7d andi r24, 0xDF ; 223 ef4e: f3 cf rjmp .-26 ; 0xef36 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; ef50: ef b7 in r30, 0x3f ; 63 ef52: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); ef54: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ef58: 88 60 ori r24, 0x08 ; 8 ef5a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; ef5e: 30 e0 ldi r19, 0x00 ; 0 ef60: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> ef64: 4f ef ldi r20, 0xFF ; 255 ef66: 50 e0 ldi r21, 0x00 ; 0 ef68: 81 ff sbrs r24, 1 ef6a: 04 c0 rjmp .+8 ; 0xef74 ef6c: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> ef70: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> ef74: 24 9f mul r18, r20 ef76: c0 01 movw r24, r0 ef78: 25 9f mul r18, r21 ef7a: 90 0d add r25, r0 ef7c: 34 9f mul r19, r20 ef7e: 90 0d add r25, r0 ef80: 11 24 eor r1, r1 ef82: 6f ef ldi r22, 0xFF ; 255 ef84: 70 e0 ldi r23, 0x00 ; 0 ef86: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> ef8a: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ef8e: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; ef92: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } ef94: 08 95 ret 0000ef96 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { ef96: 1f 93 push r17 ef98: cf 93 push r28 ef9a: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) ef9c: d0 91 22 03 lds r29, 0x0322 ; 0x800322 efa0: d1 fd sbrc r29, 1 efa2: 1d c0 rjmp .+58 ; 0xefde temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; efa4: 10 91 cc 03 lds r17, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; efa8: c1 e0 ldi r28, 0x01 ; 1 efaa: 20 e0 ldi r18, 0x00 ; 0 efac: 30 e0 ldi r19, 0x00 ; 0 efae: 48 e4 ldi r20, 0x48 ; 72 efb0: 52 e4 ldi r21, 0x42 ; 66 efb2: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a efb6: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b efba: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c efbe: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d efc2: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> efc6: 18 16 cp r1, r24 efc8: 0c f0 brlt .+2 ; 0xefcc efca: 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; efcc: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; efce: cd 2b or r28, r29 efd0: 81 e0 ldi r24, 0x01 ; 1 efd2: 11 11 cpse r17, r1 efd4: 01 c0 rjmp .+2 ; 0xefd8 efd6: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); efd8: c8 2b or r28, r24 efda: c0 93 22 03 sts 0x0322, r28 ; 0x800322 } setExtruderAutoFanState(fanState); efde: 80 91 22 03 lds r24, 0x0322 ; 0x800322 #endif } efe2: df 91 pop r29 efe4: cf 91 pop r28 efe6: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); efe8: 0c 94 7f 77 jmp 0xeefe ; 0xeefe 0000efec : 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) { efec: ef 92 push r14 efee: ff 92 push r15 eff0: 0f 93 push r16 eff2: 1f 93 push r17 eff4: cf 93 push r28 eff6: df 93 push r29 eff8: ec 01 movw r28, r24 effa: 8b 01 movw r16, r22 effc: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) effe: 0e 94 da 55 call 0xabb4 ; 0xabb4 f002: 81 11 cpse r24, r1 f004: 0b c0 rjmp .+22 ; 0xf01c #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); f006: a8 01 movw r20, r16 f008: be 01 movw r22, r28 f00a: 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); } f00c: df 91 pop r29 f00e: cf 91 pop r28 f010: 1f 91 pop r17 f012: 0f 91 pop r16 f014: ff 90 pop r15 f016: ef 90 pop r14 #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); f018: 0d 94 b1 a3 jmp 0x34762 ; 0x34762 } 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); } f01c: df 91 pop r29 f01e: cf 91 pop r28 f020: 1f 91 pop r17 f022: 0f 91 pop r16 f024: ff 90 pop r15 f026: ef 90 pop r14 f028: 08 95 ret 0000f02a : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { f02a: 0f 93 push r16 f02c: 1f 93 push r17 f02e: cf 93 push r28 f030: df 93 push r29 f032: 8c 01 movw r16, r24 f034: d6 2f mov r29, r22 f036: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); f038: 0f 94 ab a3 call 0x34756 ; 0x34756 if (val == EEPROM_EMPTY_VALUE16) { f03c: 8f 3f cpi r24, 0xFF ; 255 f03e: 98 07 cpc r25, r24 f040: 39 f4 brne .+14 ; 0xf050 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); f042: 6d 2f mov r22, r29 f044: 7c 2f mov r23, r28 f046: c8 01 movw r24, r16 f048: 0f 94 fb a3 call 0x347f6 ; 0x347f6 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; f04c: 8d 2f mov r24, r29 f04e: 9c 2f mov r25, r28 } return val; } f050: df 91 pop r29 f052: cf 91 pop r28 f054: 1f 91 pop r17 f056: 0f 91 pop r16 f058: 08 95 ret 0000f05a : 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) { f05a: 0f 93 push r16 f05c: 1f 93 push r17 f05e: cf 93 push r28 f060: 8c 01 movw r16, r24 f062: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); f064: 0f 94 9d a3 call 0x3473a ; 0x3473a if (val == EEPROM_EMPTY_VALUE) { f068: 8f 3f cpi r24, 0xFF ; 255 f06a: 29 f4 brne .+10 ; 0xf076 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); f06c: 6c 2f mov r22, r28 f06e: c8 01 movw r24, r16 f070: 0f 94 e5 a3 call 0x347ca ; 0x347ca 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; f074: 8c 2f mov r24, r28 } return val; } f076: cf 91 pop r28 f078: 1f 91 pop r17 f07a: 0f 91 pop r16 f07c: 08 95 ret 0000f07e : 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) { f07e: cf 93 push r28 f080: df 93 push r29 f082: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); f084: 0f 94 ab a3 call 0x34756 ; 0x34756 f088: bc 01 movw r22, r24 f08a: 6f 5f subi r22, 0xFF ; 255 f08c: 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); f08e: 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); } f090: df 91 pop r29 f092: 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); f094: 0d 94 fb a3 jmp 0x347f6 ; 0x347f6 0000f098 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { f098: cf 93 push r28 f09a: df 93 push r29 f09c: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); f09e: 0f 94 9d a3 call 0x3473a ; 0x3473a f0a2: 61 e0 ldi r22, 0x01 ; 1 f0a4: 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); f0a6: 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); } f0a8: df 91 pop r29 f0aa: 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); f0ac: 0d 94 e5 a3 jmp 0x347ca ; 0x347ca 0000f0b0 : 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); f0b0: 2b e0 ldi r18, 0x0B ; 11 f0b2: 82 9f mul r24, r18 f0b4: c0 01 movw r24, r0 f0b6: 11 24 eor r1, r1 f0b8: 80 5b subi r24, 0xB0 ; 176 f0ba: 92 4f sbci r25, 0xF2 ; 242 f0bc: 0f 94 ab a3 call 0x34756 ; 0x34756 f0c0: 21 e0 ldi r18, 0x01 ; 1 f0c2: 01 96 adiw r24, 0x01 ; 1 f0c4: 09 f4 brne .+2 ; 0xf0c8 f0c6: 20 e0 ldi r18, 0x00 ; 0 } f0c8: 82 2f mov r24, r18 f0ca: 08 95 ret 0000f0cc : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { f0cc: cf 93 push r28 f0ce: df 93 push r29 f0d0: c8 2f mov r28, r24 f0d2: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; f0d4: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; f0d6: c8 30 cpi r28, 0x08 ; 8 f0d8: 0c f0 brlt .+2 ; 0xf0dc f0da: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; f0dc: 8c 2f mov r24, r28 f0de: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 f0e2: 81 11 cpse r24, r1 f0e4: 03 c0 rjmp .+6 ; 0xf0ec f0e6: 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) f0e8: a9 f7 brne .-22 ; 0xf0d4 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; f0ea: cf ef ldi r28, 0xFF ; 255 } f0ec: 8c 2f mov r24, r28 f0ee: df 91 pop r29 f0f0: cf 91 pop r28 f0f2: 08 95 ret 0000f0f4 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); f0f4: 81 ea ldi r24, 0xA1 ; 161 f0f6: 9d e0 ldi r25, 0x0D ; 13 f0f8: 0f 94 9d a3 call 0x3473a ; 0x3473a sheet = eeprom_next_initialized_sheet(sheet); f0fc: 0e 94 66 78 call 0xf0cc ; 0xf0cc if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); f100: 87 fd sbrc r24, 7 f102: 05 c0 rjmp .+10 ; 0xf10e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f104: 68 2f mov r22, r24 f106: 81 ea ldi r24, 0xA1 ; 161 f108: 9d e0 ldi r25, 0x0D ; 13 f10a: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 { 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); } f10e: 08 95 ret 0000f110 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { f110: 0f 93 push r16 f112: 1f 93 push r17 f114: cf 93 push r28 f116: c8 2f mov r28, r24 f118: 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")); f11a: 60 e4 ldi r22, 0x40 ; 64 f11c: 74 e7 ldi r23, 0x74 ; 116 //! @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) f11e: 82 30 cpi r24, 0x02 ; 2 f120: 70 f0 brcs .+28 ; 0xf13e { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); f122: 69 e3 ldi r22, 0x39 ; 57 f124: 74 e7 ldi r23, 0x74 ; 116 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) f126: 84 30 cpi r24, 0x04 ; 4 f128: 50 f0 brcs .+20 ; 0xf13e { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); f12a: 61 e3 ldi r22, 0x31 ; 49 f12c: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) f12e: 84 30 cpi r24, 0x04 ; 4 f130: 31 f0 breq .+12 ; 0xf13e { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); f132: 69 e2 ldi r22, 0x29 ; 41 f134: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) f136: 85 30 cpi r24, 0x05 ; 5 f138: 11 f0 breq .+4 ; 0xf13e { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); f13a: 62 e2 ldi r22, 0x22 ; 34 f13c: 74 e7 ldi r23, 0x74 ; 116 f13e: c8 01 movw r24, r16 f140: 0f 94 54 a1 call 0x342a8 ; 0x342a8 } if (index <4 || index >5) f144: 8c ef ldi r24, 0xFC ; 252 f146: 8c 0f add r24, r28 f148: 82 30 cpi r24, 0x02 ; 2 f14a: 28 f0 brcs .+10 ; 0xf156 { sheetName.c[6] = '0' + ((index % 2)+1); f14c: c1 70 andi r28, 0x01 ; 1 f14e: cf 5c subi r28, 0xCF ; 207 f150: f8 01 movw r30, r16 f152: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; f154: 17 82 std Z+7, r1 ; 0x07 } } f156: cf 91 pop r28 f158: 1f 91 pop r17 f15a: 0f 91 pop r16 f15c: 08 95 ret 0000f15e : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f15e: 61 e0 ldi r22, 0x01 ; 1 f160: 80 ec ldi r24, 0xC0 ; 192 f162: 9f e0 ldi r25, 0x0F ; 15 f164: 0f 94 c1 a3 call 0x34782 ; 0x34782 f168: 60 e0 ldi r22, 0x00 ; 0 f16a: 8f eb ldi r24, 0xBF ; 191 f16c: 9f e0 ldi r25, 0x0F ; 15 f16e: 0f 94 c1 a3 call 0x34782 ; 0x34782 f172: 60 e0 ldi r22, 0x00 ; 0 f174: 8e eb ldi r24, 0xBE ; 190 f176: 9f e0 ldi r25, 0x0F ; 15 f178: 0f 94 c1 a3 call 0x34782 ; 0x34782 f17c: 60 e0 ldi r22, 0x00 ; 0 f17e: 8d eb ldi r24, 0xBD ; 189 f180: 9f e0 ldi r25, 0x0F ; 15 f182: 0f 94 c1 a3 call 0x34782 ; 0x34782 f186: 60 e0 ldi r22, 0x00 ; 0 f188: 8c eb ldi r24, 0xBC ; 188 f18a: 9f e0 ldi r25, 0x0F ; 15 f18c: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 0000f190 : { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); } void print_hex_byte(uint8_t val) { f190: cf 93 push r28 f192: c8 2f mov r28, r24 print_hex_nibble(val >> 4); f194: 82 95 swap r24 f196: 8f 70 andi r24, 0x0F ; 15 f198: 0e 94 48 5d call 0xba90 ; 0xba90 print_hex_nibble(val & 15); f19c: 8c 2f mov r24, r28 f19e: 8f 70 andi r24, 0x0F ; 15 } f1a0: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); f1a2: 0c 94 48 5d jmp 0xba90 ; 0xba90 0000f1a6 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) f1a6: 40 91 3c 12 lds r20, 0x123C ; 0x80123c f1aa: 50 91 3d 12 lds r21, 0x123D ; 0x80123d return 0; f1ae: 90 e0 ldi r25, 0x00 ; 0 f1b0: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) f1b2: 41 15 cp r20, r1 f1b4: 51 05 cpc r21, r1 f1b6: b1 f1 breq .+108 ; 0xf224 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { f1b8: 20 91 38 12 lds r18, 0x1238 ; 0x801238 f1bc: 30 91 39 12 lds r19, 0x1239 ; 0x801239 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; f1c0: 90 e0 ldi r25, 0x00 ; 0 f1c2: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { f1c4: f9 01 movw r30, r18 f1c6: e5 5b subi r30, 0xB5 ; 181 f1c8: ff 4e sbci r31, 0xEF ; 239 f1ca: a0 81 ld r26, Z f1cc: a2 30 cpi r26, 0x02 ; 2 f1ce: 21 f4 brne .+8 ; 0xf1d8 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; f1d0: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; f1d2: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; f1d4: 86 0f add r24, r22 f1d6: 97 1f adc r25, r23 } if (-- _buflen == 0) f1d8: 41 50 subi r20, 0x01 ; 1 f1da: 51 09 sbc r21, r1 f1dc: 19 f1 breq .+70 ; 0xf224 f1de: f9 01 movw r30, r18 f1e0: e2 5b subi r30, 0xB2 ; 178 f1e2: 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) ; f1e4: a1 91 ld r26, Z+ f1e6: 9f 01 movw r18, r30 f1e8: 2b 54 subi r18, 0x4B ; 75 f1ea: 30 41 sbci r19, 0x10 ; 16 f1ec: a1 11 cpse r26, r1 f1ee: fa cf rjmp .-12 ; 0xf1e4 f1f0: f9 01 movw r30, r18 f1f2: e5 5b subi r30, 0xB5 ; 181 f1f4: 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) ; f1f6: 2d 3e cpi r18, 0xED ; 237 f1f8: a1 e0 ldi r26, 0x01 ; 1 f1fa: 3a 07 cpc r19, r26 f1fc: 30 f4 brcc .+12 ; 0xf20a f1fe: a1 91 ld r26, Z+ f200: a1 11 cpse r26, r1 f202: e0 cf rjmp .-64 ; 0xf1c4 f204: 2f 5f subi r18, 0xFF ; 255 f206: 3f 4f sbci r19, 0xFF ; 255 f208: f6 cf rjmp .-20 ; 0xf1f6 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { f20a: 2d 3e cpi r18, 0xED ; 237 f20c: e1 e0 ldi r30, 0x01 ; 1 f20e: 3e 07 cpc r19, r30 f210: c9 f6 brne .-78 ; 0xf1c4 f212: eb e4 ldi r30, 0x4B ; 75 f214: f0 e1 ldi r31, 0x10 ; 16 f216: 9f 01 movw r18, r30 f218: 2b 54 subi r18, 0x4B ; 75 f21a: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; f21c: a1 91 ld r26, Z+ f21e: aa 23 and r26, r26 f220: d1 f3 breq .-12 ; 0xf216 f222: d0 cf rjmp .-96 ; 0xf1c4 } } return sdlen; } f224: 08 95 ret 0000f226 : // 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) { f226: 80 91 3c 12 lds r24, 0x123C ; 0x80123c f22a: 90 91 3d 12 lds r25, 0x123D ; 0x80123d f22e: 18 16 cp r1, r24 f230: 19 06 cpc r1, r25 f232: 0c f0 brlt .+2 ; 0xf236 f234: 43 c0 rjmp .+134 ; 0xf2bc SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { f236: 01 97 sbiw r24, 0x01 ; 1 f238: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d f23c: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c f240: 89 2b or r24, r25 f242: a1 f4 brne .+40 ; 0xf26c // Empty buffer. if (serial_count == 0) f244: 80 91 47 10 lds r24, 0x1047 ; 0x801047 f248: 90 91 48 10 lds r25, 0x1048 ; 0x801048 f24c: 89 2b or r24, r25 f24e: 21 f4 brne .+8 ; 0xf258 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; f250: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> f254: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.514> bufindr = bufindw; f258: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> f25c: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> f260: 90 93 39 12 sts 0x1239, r25 ; 0x801239 f264: 80 93 38 12 sts 0x1238, r24 ; 0x801238 SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; f268: 81 e0 ldi r24, 0x01 ; 1 f26a: 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) ; f26c: 80 91 38 12 lds r24, 0x1238 ; 0x801238 f270: 90 91 39 12 lds r25, 0x1239 ; 0x801239 f274: 03 96 adiw r24, 0x03 ; 3 f276: fc 01 movw r30, r24 f278: e5 5b subi r30, 0xB5 ; 181 f27a: ff 4e sbci r31, 0xEF ; 239 f27c: 20 81 ld r18, Z f27e: 01 96 adiw r24, 0x01 ; 1 f280: 21 11 cpse r18, r1 f282: f9 cf rjmp .-14 ; 0xf276 f284: fc 01 movw r30, r24 f286: e5 5b subi r30, 0xB5 ; 181 f288: 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) ; f28a: 8d 3e cpi r24, 0xED ; 237 f28c: 21 e0 ldi r18, 0x01 ; 1 f28e: 92 07 cpc r25, r18 f290: 40 f4 brcc .+16 ; 0xf2a2 f292: 41 91 ld r20, Z+ f294: 9c 01 movw r18, r24 f296: 2f 5f subi r18, 0xFF ; 255 f298: 3f 4f sbci r19, 0xFF ; 255 f29a: 41 11 cpse r20, r1 f29c: e1 cf rjmp .-62 ; 0xf260 f29e: c9 01 movw r24, r18 f2a0: f4 cf rjmp .-24 ; 0xf28a // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { f2a2: eb e4 ldi r30, 0x4B ; 75 f2a4: f0 e1 ldi r31, 0x10 ; 16 f2a6: 8d 3e cpi r24, 0xED ; 237 f2a8: 21 e0 ldi r18, 0x01 ; 1 f2aa: 92 07 cpc r25, r18 f2ac: c9 f6 brne .-78 ; 0xf260 f2ae: cf 01 movw r24, r30 f2b0: 8b 54 subi r24, 0x4B ; 75 f2b2: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; f2b4: 21 91 ld r18, Z+ f2b6: 22 23 and r18, r18 f2b8: d1 f3 breq .-12 ; 0xf2ae f2ba: d2 cf rjmp .-92 ; 0xf260 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; f2bc: 80 e0 ldi r24, 0x00 ; 0 } f2be: 08 95 ret 0000f2c0 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; f2c0: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) f2c2: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; f2c4: 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; f2c6: db 01 movw r26, r22 f2c8: 4d 91 ld r20, X+ f2ca: bd 01 movw r22, r26 f2cc: 40 32 cpi r20, 0x20 ; 32 f2ce: 49 f0 breq .+18 ; 0xf2e2 if (i == 8) f2d0: 28 30 cpi r18, 0x08 ; 8 f2d2: 11 f4 brne .+4 ; 0xf2d8 { *pos++='.'; f2d4: 30 83 st Z, r19 f2d6: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; f2d8: db 01 movw r26, r22 f2da: 11 97 sbiw r26, 0x01 ; 1 f2dc: 4c 91 ld r20, X f2de: 40 83 st Z, r20 f2e0: 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++) f2e2: 2f 5f subi r18, 0xFF ; 255 f2e4: 2b 30 cpi r18, 0x0B ; 11 f2e6: 79 f7 brne .-34 ; 0xf2c6 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; f2e8: 10 82 st Z, r1 return buffer; } f2ea: 08 95 ret 0000f2ec : 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);} f2ec: 40 e0 ldi r20, 0x00 ; 0 f2ee: 50 e0 ldi r21, 0x00 ; 0 f2f0: ba 01 movw r22, r20 f2f2: 0d 94 94 2a jmp 0x25528 ; 0x25528 0000f2f6 : 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();} f2f6: fc 01 movw r30, r24 f2f8: 23 81 ldd r18, Z+3 ; 0x03 f2fa: 21 11 cpse r18, r1 f2fc: 0d 94 72 2c jmp 0x258e4 ; 0x258e4 f300: 08 95 ret 0000f302 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) f302: 90 91 1c 06 lds r25, 0x061C ; 0x80061c f306: 91 11 cpse r25, r1 f308: 07 c0 rjmp .+14 ; 0xf318 { while (!((M_UCSRxA) & (1 << M_UDREx))); f30a: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> f30e: 95 ff sbrs r25, 5 f310: fc cf rjmp .-8 ; 0xf30a M_UDRx = c; f312: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> f316: 08 95 ret } else if (selectedSerialPort == 1) f318: 91 30 cpi r25, 0x01 ; 1 f31a: 31 f4 brne .+12 ; 0xf328 { while (!((UCSR1A) & (1 << UDRE1))); f31c: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> f320: 95 ff sbrs r25, 5 f322: fc cf rjmp .-8 ; 0xf31c UDR1 = c; f324: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } f328: 08 95 ret 0000f32a : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { f32a: 8f 92 push r8 f32c: 9f 92 push r9 f32e: af 92 push r10 f330: bf 92 push r11 f332: ef 92 push r14 f334: ff 92 push r15 f336: 0f 93 push r16 f338: 1f 93 push r17 f33a: cf 93 push r28 f33c: df 93 push r29 f33e: cd b7 in r28, 0x3d ; 61 f340: de b7 in r29, 0x3e ; 62 f342: a0 97 sbiw r28, 0x20 ; 32 f344: 0f b6 in r0, 0x3f ; 63 f346: f8 94 cli f348: de bf out 0x3e, r29 ; 62 f34a: 0f be out 0x3f, r0 ; 63 f34c: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { f34e: 61 15 cp r22, r1 f350: 71 05 cpc r23, r1 f352: 81 05 cpc r24, r1 f354: 91 05 cpc r25, r1 f356: 99 f4 brne .+38 ; 0xf37e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f358: 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)); } f35a: a0 96 adiw r28, 0x20 ; 32 f35c: 0f b6 in r0, 0x3f ; 63 f35e: f8 94 cli f360: de bf out 0x3e, r29 ; 62 f362: 0f be out 0x3f, r0 ; 63 f364: cd bf out 0x3d, r28 ; 61 f366: df 91 pop r29 f368: cf 91 pop r28 f36a: 1f 91 pop r17 f36c: 0f 91 pop r16 f36e: ff 90 pop r15 f370: ef 90 pop r14 f372: bf 90 pop r11 f374: af 90 pop r10 f376: 9f 90 pop r9 f378: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f37a: 0c 94 81 79 jmp 0xf302 ; 0xf302 // 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; f37e: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; f380: 84 2e mov r8, r20 f382: 91 2c mov r9, r1 f384: b1 2c mov r11, r1 f386: a1 2c mov r10, r1 f388: 9e 01 movw r18, r28 f38a: 2f 5f subi r18, 0xFF ; 255 f38c: 3f 4f sbci r19, 0xFF ; 255 f38e: 79 01 movw r14, r18 f390: a5 01 movw r20, r10 f392: 94 01 movw r18, r8 f394: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> f398: f7 01 movw r30, r14 f39a: e0 0f add r30, r16 f39c: f1 1d adc r31, r1 f39e: 60 83 st Z, r22 n /= base; f3a0: b9 01 movw r22, r18 f3a2: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; f3a4: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { f3a6: 61 15 cp r22, r1 f3a8: 71 05 cpc r23, r1 f3aa: 81 05 cpc r24, r1 f3ac: 91 05 cpc r25, r1 f3ae: 81 f7 brne .-32 ; 0xf390 f3b0: 0e 0d add r16, r14 f3b2: 1f 2d mov r17, r15 f3b4: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) f3b6: e0 16 cp r14, r16 f3b8: f1 06 cpc r15, r17 f3ba: 59 f0 breq .+22 ; 0xf3d2 print((char) (buf[i - 1] < 10 ? f3bc: f8 01 movw r30, r16 f3be: 82 91 ld r24, -Z f3c0: 8f 01 movw r16, r30 f3c2: 8a 30 cpi r24, 0x0A ; 10 f3c4: 20 f4 brcc .+8 ; 0xf3ce '0' + buf[i - 1] : f3c6: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f3c8: 0e 94 81 79 call 0xf302 ; 0xf302 f3cc: f4 cf rjmp .-24 ; 0xf3b6 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); f3ce: 89 5c subi r24, 0xC9 ; 201 f3d0: fb cf rjmp .-10 ; 0xf3c8 } f3d2: a0 96 adiw r28, 0x20 ; 32 f3d4: 0f b6 in r0, 0x3f ; 63 f3d6: f8 94 cli f3d8: de bf out 0x3e, r29 ; 62 f3da: 0f be out 0x3f, r0 ; 63 f3dc: cd bf out 0x3d, r28 ; 61 f3de: df 91 pop r29 f3e0: cf 91 pop r28 f3e2: 1f 91 pop r17 f3e4: 0f 91 pop r16 f3e6: ff 90 pop r15 f3e8: ef 90 pop r14 f3ea: bf 90 pop r11 f3ec: af 90 pop r10 f3ee: 9f 90 pop r9 f3f0: 8f 90 pop r8 f3f2: 08 95 ret 0000f3f4 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) f3f4: cf 92 push r12 f3f6: df 92 push r13 f3f8: ef 92 push r14 f3fa: ff 92 push r15 f3fc: 6b 01 movw r12, r22 f3fe: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { f400: f7 fe sbrs r15, 7 f402: 0b c0 rjmp .+22 ; 0xf41a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f404: 8d e2 ldi r24, 0x2D ; 45 f406: 0e 94 81 79 call 0xf302 ; 0xf302 } else if (base == 10) { if (n < 0) { print('-'); n = -n; f40a: f0 94 com r15 f40c: e0 94 com r14 f40e: d0 94 com r13 f410: c0 94 com r12 f412: c1 1c adc r12, r1 f414: d1 1c adc r13, r1 f416: e1 1c adc r14, r1 f418: f1 1c adc r15, r1 } printNumber(n, 10); f41a: 4a e0 ldi r20, 0x0A ; 10 f41c: c7 01 movw r24, r14 f41e: b6 01 movw r22, r12 } else { printNumber(n, base); } } f420: ff 90 pop r15 f422: ef 90 pop r14 f424: df 90 pop r13 f426: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); f428: 0c 94 95 79 jmp 0xf32a ; 0xf32a 0000f42c : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { f42c: 8f 92 push r8 f42e: 9f 92 push r9 f430: af 92 push r10 f432: bf 92 push r11 f434: cf 92 push r12 f436: df 92 push r13 f438: ef 92 push r14 f43a: ff 92 push r15 f43c: cf 93 push r28 f43e: 6b 01 movw r12, r22 f440: 7c 01 movw r14, r24 f442: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) f444: 20 e0 ldi r18, 0x00 ; 0 f446: 30 e0 ldi r19, 0x00 ; 0 f448: a9 01 movw r20, r18 f44a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> f44e: 87 ff sbrs r24, 7 f450: 07 c0 rjmp .+14 ; 0xf460 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f452: 8d e2 ldi r24, 0x2D ; 45 f454: 0e 94 81 79 call 0xf302 ; 0xf302 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; f458: f7 fa bst r15, 7 f45a: f0 94 com r15 f45c: f7 f8 bld r15, 7 f45e: 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; f46e: 20 e0 ldi r18, 0x00 ; 0 f470: 30 e0 ldi r19, 0x00 ; 0 f472: 40 e2 ldi r20, 0x20 ; 32 f474: 51 e4 ldi r21, 0x41 ; 65 f476: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__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; f47e: 9b 01 movw r18, r22 f480: ac 01 movw r20, r24 f482: c7 01 movw r24, r14 f484: b6 01 movw r22, r12 f486: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> f48a: 6b 01 movw r12, r22 f48c: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; f48e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> f492: 4b 01 movw r8, r22 f494: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); f496: 4a e0 ldi r20, 0x0A ; 10 f498: 0e 94 95 79 call 0xf32a ; 0xf32a 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) f49c: cc 23 and r28, r28 f49e: 91 f1 breq .+100 ; 0xf504 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; f4a0: c5 01 movw r24, r10 f4a2: b4 01 movw r22, r8 f4a4: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> f4a8: 9b 01 movw r18, r22 f4aa: ac 01 movw r20, r24 f4ac: c7 01 movw r24, r14 f4ae: b6 01 movw r22, r12 f4b0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> f4b4: 6b 01 movw r12, r22 f4b6: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f4b8: 8e e2 ldi r24, 0x2E ; 46 f4ba: 0e 94 81 79 call 0xf302 ; 0xf302 // 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) f4be: c1 50 subi r28, 0x01 ; 1 f4c0: 08 f1 brcs .+66 ; 0xf504 { remainder *= 10.0; f4c2: 20 e0 ldi r18, 0x00 ; 0 f4c4: 30 e0 ldi r19, 0x00 ; 0 f4c6: 40 e2 ldi r20, 0x20 ; 32 f4c8: 51 e4 ldi r21, 0x41 ; 65 f4ca: c7 01 movw r24, r14 f4cc: b6 01 movw r22, r12 f4ce: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> f4d2: 4b 01 movw r8, r22 f4d4: 5c 01 movw r10, r24 int toPrint = int(remainder); f4d6: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f4da: 6b 01 movw r12, r22 f4dc: 77 0f add r23, r23 f4de: ee 08 sbc r14, r14 f4e0: ff 08 sbc r15, r15 f4e2: c7 01 movw r24, r14 f4e4: b6 01 movw r22, r12 f4e6: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; f4ea: c7 01 movw r24, r14 f4ec: b6 01 movw r22, r12 f4ee: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f4f2: 9b 01 movw r18, r22 f4f4: ac 01 movw r20, r24 f4f6: c5 01 movw r24, r10 f4f8: b4 01 movw r22, r8 f4fa: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> f4fe: 6b 01 movw r12, r22 f500: 7c 01 movw r14, r24 f502: dd cf rjmp .-70 ; 0xf4be } } f504: cf 91 pop r28 f506: ff 90 pop r15 f508: ef 90 pop r14 f50a: df 90 pop r13 f50c: cf 90 pop r12 f50e: bf 90 pop r11 f510: af 90 pop r10 f512: 9f 90 pop r9 f514: 8f 90 pop r8 f516: 08 95 ret 0000f518 : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f518: 8a e0 ldi r24, 0x0A ; 10 f51a: 0c 94 81 79 jmp 0xf302 ; 0xf302 0000f51e : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); f51e: 0e 94 81 79 call 0xf302 ; 0xf302 return 0; } f522: 90 e0 ldi r25, 0x00 ; 0 f524: 80 e0 ldi r24, 0x00 ; 0 f526: 08 95 ret 0000f528 : 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) { f528: cf 93 push r28 f52a: df 93 push r29 f52c: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { f52e: fe 01 movw r30, r28 f530: 84 91 lpm r24, Z f532: 88 23 and r24, r24 f534: 21 f0 breq .+8 ; 0xf53e MYSERIAL.write((char)ch); f536: 0e 94 81 79 call 0xf302 ; 0xf302 ++str; f53a: 21 96 adiw r28, 0x01 ; 1 f53c: f8 cf rjmp .-16 ; 0xf52e } } f53e: df 91 pop r29 f540: cf 91 pop r28 f542: 08 95 ret 0000f544 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { f544: cf 92 push r12 f546: df 92 push r13 f548: ef 92 push r14 f54a: 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]; f54c: c0 90 5a 0d lds r12, 0x0D5A ; 0x800d5a f550: d0 90 5b 0d lds r13, 0x0D5B ; 0x800d5b f554: e0 90 5c 0d lds r14, 0x0D5C ; 0x800d5c f558: f0 90 5d 0d lds r15, 0x0D5D ; 0x800d5d float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); f55c: 83 e9 ldi r24, 0x93 ; 147 f55e: 98 e7 ldi r25, 0x78 ; 120 f560: 0e 94 94 7a call 0xf528 ; 0xf528 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f564: 42 e0 ldi r20, 0x02 ; 2 f566: c7 01 movw r24, r14 f568: b6 01 movw r22, r12 f56a: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); f56e: 8b e8 ldi r24, 0x8B ; 139 f570: 98 e7 ldi r25, 0x78 ; 120 f572: 0e 94 94 7a call 0xf528 ; 0xf528 f576: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc f57a: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd f57e: 80 91 be 03 lds r24, 0x03BE ; 0x8003be f582: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf f586: 41 e0 ldi r20, 0x01 ; 1 f588: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } f58c: ff 90 pop r15 f58e: ef 90 pop r14 f590: df 90 pop r13 f592: 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(); f594: 0c 94 8c 7a jmp 0xf518 ; 0xf518 0000f598 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { f598: 4f 92 push r4 f59a: 5f 92 push r5 f59c: 6f 92 push r6 f59e: 7f 92 push r7 f5a0: 8f 92 push r8 f5a2: 9f 92 push r9 f5a4: af 92 push r10 f5a6: bf 92 push r11 f5a8: cf 92 push r12 f5aa: df 92 push r13 f5ac: ef 92 push r14 f5ae: ff 92 push r15 f5b0: 0f 93 push r16 f5b2: 1f 93 push r17 f5b4: cf 93 push r28 f5b6: df 93 push r29 f5b8: cc 24 eor r12, r12 f5ba: ca 94 dec r12 f5bc: dc 2c mov r13, r12 f5be: 76 01 movw r14, r12 f5c0: 0e ea ldi r16, 0xAE ; 174 f5c2: 1f e0 ldi r17, 0x0F ; 15 f5c4: 93 e2 ldi r25, 0x23 ; 35 f5c6: 89 2e mov r8, r25 f5c8: 91 2c mov r9, r1 f5ca: a1 2c mov r10, r1 f5cc: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; f5ce: 41 2c mov r4, r1 f5d0: 51 2c mov r5, r1 f5d2: 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; f5d4: d0 e0 ldi r29, 0x00 ; 0 f5d6: 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) { f5d8: 8f ef ldi r24, 0xFF ; 255 f5da: c8 16 cp r12, r24 f5dc: 09 f4 brne .+2 ; 0xf5e0 f5de: 5d c0 rjmp .+186 ; 0xf69a usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); f5e0: c8 01 movw r24, r16 f5e2: 0f 94 ab a3 call 0x34756 ; 0x34756 f5e6: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; f5e8: bc 01 movw r22, r24 f5ea: 99 0f add r25, r25 f5ec: 88 0b sbc r24, r24 f5ee: 99 0b sbc r25, r25 f5f0: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f5f4: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 f5f8: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 f5fc: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 f600: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 f604: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> f608: 2b 01 movw r4, r22 f60a: 3c 01 movw r6, r24 f60c: c7 01 movw r24, r14 f60e: b6 01 movw r22, r12 f610: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); f614: 87 ee ldi r24, 0xE7 ; 231 f616: 97 e7 ldi r25, 0x77 ; 119 f618: 0e 94 94 7a call 0xf528 ; 0xf528 f61c: c5 01 movw r24, r10 f61e: b4 01 movw r22, r8 f620: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); f624: 87 ee ldi r24, 0xE7 ; 231 f626: 97 e7 ldi r25, 0x77 ; 119 f628: 0e 94 94 7a call 0xf528 ; 0xf528 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f62c: be 01 movw r22, r28 f62e: 0d 2e mov r0, r29 f630: 00 0c add r0, r0 f632: 88 0b sbc r24, r24 f634: 99 0b sbc r25, r25 f636: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); f63a: 87 ee ldi r24, 0xE7 ; 231 f63c: 97 e7 ldi r25, 0x77 ; 119 f63e: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLLN(mm * 1000); f642: 20 e0 ldi r18, 0x00 ; 0 f644: 30 e0 ldi r19, 0x00 ; 0 f646: 4a e7 ldi r20, 0x7A ; 122 f648: 54 e4 ldi r21, 0x44 ; 68 f64a: c3 01 movw r24, r6 f64c: b2 01 movw r22, r4 f64e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> f652: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 f656: 85 e0 ldi r24, 0x05 ; 5 f658: 88 0e add r8, r24 f65a: 91 1c adc r9, r1 f65c: a1 1c adc r10, r1 f65e: b1 1c adc r11, r1 f660: 0e 5f subi r16, 0xFE ; 254 f662: 1f 4f sbci r17, 0xFF ; 255 f664: 8f ef ldi r24, 0xFF ; 255 f666: c8 1a sub r12, r24 f668: d8 0a sbc r13, r24 f66a: e8 0a sbc r14, r24 f66c: 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++) { f66e: 0a 3b cpi r16, 0xBA ; 186 f670: 8f e0 ldi r24, 0x0F ; 15 f672: 18 07 cpc r17, r24 f674: 09 f0 breq .+2 ; 0xf678 f676: b0 cf rjmp .-160 ; 0xf5d8 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f678: df 91 pop r29 f67a: cf 91 pop r28 f67c: 1f 91 pop r17 f67e: 0f 91 pop r16 f680: ff 90 pop r15 f682: ef 90 pop r14 f684: df 90 pop r13 f686: cf 90 pop r12 f688: bf 90 pop r11 f68a: af 90 pop r10 f68c: 9f 90 pop r9 f68e: 8f 90 pop r8 f690: 7f 90 pop r7 f692: 6f 90 pop r6 f694: 5f 90 pop r5 f696: 4f 90 pop r4 f698: 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); f69a: 80 e2 ldi r24, 0x20 ; 32 f69c: 98 e4 ldi r25, 0x48 ; 72 f69e: 0e 94 94 7a call 0xf528 ; 0xf528 f6a2: b8 cf rjmp .-144 ; 0xf614 0000f6a4 : /// @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) { f6a4: 88 23 and r24, r24 f6a6: 71 f1 breq .+92 ; 0xf704 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f6a8: 8b ed ldi r24, 0xDB ; 219 f6aa: 97 e7 ldi r25, 0x77 ; 119 f6ac: 0e 94 94 7a call 0xf528 ; 0xf528 f6b0: 60 91 90 12 lds r22, 0x1290 ; 0x801290 f6b4: 70 e0 ldi r23, 0x00 ; 0 f6b6: 90 e0 ldi r25, 0x00 ; 0 f6b8: 80 e0 ldi r24, 0x00 ; 0 f6ba: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; f6be: 80 91 90 12 lds r24, 0x1290 ; 0x801290 f6c2: 84 30 cpi r24, 0x04 ; 4 f6c4: d8 f0 brcs .+54 ; 0xf6fc f6c6: 10 92 90 12 sts 0x1290, r1 ; 0x801290 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f6ca: 86 ed ldi r24, 0xD6 ; 214 f6cc: 97 e7 ldi r25, 0x77 ; 119 f6ce: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN((int)currentMMUSlot); f6d2: 80 91 90 12 lds r24, 0x1290 ; 0x801290 f6d6: 90 e0 ldi r25, 0x00 ; 0 f6d8: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e return currentMMUSlot; f6dc: 80 91 90 12 lds r24, 0x1290 ; 0x801290 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; f6e0: 20 91 5b 12 lds r18, 0x125B ; 0x80125b f6e4: 30 91 5c 12 lds r19, 0x125C ; 0x80125c f6e8: 30 93 5e 12 sts 0x125E, r19 ; 0x80125e f6ec: 20 93 5d 12 sts 0x125D, r18 ; 0x80125d slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); f6f0: 0e 94 eb fb call 0x1f7d6 ; 0x1f7d6 load_filament_final_feed(); // @@TODO verify f6f4: 0e 94 bd 63 call 0xc77a ; 0xc77a st_synchronize(); f6f8: 0d 94 b0 18 jmp 0x23160 ; 0x23160 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; else currentMMUSlot++; f6fc: 8f 5f subi r24, 0xFF ; 255 f6fe: 80 93 90 12 sts 0x1290, r24 ; 0x801290 f702: e3 cf rjmp .-58 ; 0xf6ca 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); f704: 83 ec ldi r24, 0xC3 ; 195 f706: 9c e3 ldi r25, 0x3C ; 60 f708: 0e 94 0a 75 call 0xea14 ; 0xea14 f70c: 70 e0 ldi r23, 0x00 ; 0 f70e: 60 e0 ldi r22, 0x00 ; 0 f710: 0e 94 b9 cf call 0x19f72 ; 0x19f72 f714: e5 cf rjmp .-54 ; 0xf6e0 0000f716 : return final_result; } void gcode_M114() { f716: cf 93 push r28 f718: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f71a: 83 ed ldi r24, 0xD3 ; 211 f71c: 97 e7 ldi r25, 0x77 ; 119 f71e: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL(current_position[X_AXIS]); f722: c1 e6 ldi r28, 0x61 ; 97 f724: d2 e1 ldi r29, 0x12 ; 18 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f726: 68 81 ld r22, Y f728: 79 81 ldd r23, Y+1 ; 0x01 f72a: 8a 81 ldd r24, Y+2 ; 0x02 f72c: 9b 81 ldd r25, Y+3 ; 0x03 f72e: 42 e0 ldi r20, 0x02 ; 2 f730: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOLPGM(" Y:"); f734: 8f ec ldi r24, 0xCF ; 207 f736: 97 e7 ldi r25, 0x77 ; 119 f738: 0e 94 94 7a call 0xf528 ; 0xf528 f73c: 6c 81 ldd r22, Y+4 ; 0x04 f73e: 7d 81 ldd r23, Y+5 ; 0x05 f740: 8e 81 ldd r24, Y+6 ; 0x06 f742: 9f 81 ldd r25, Y+7 ; 0x07 f744: 42 e0 ldi r20, 0x02 ; 2 f746: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f74a: 8b ec ldi r24, 0xCB ; 203 f74c: 97 e7 ldi r25, 0x77 ; 119 f74e: 0e 94 94 7a call 0xf528 ; 0xf528 f752: 68 85 ldd r22, Y+8 ; 0x08 f754: 79 85 ldd r23, Y+9 ; 0x09 f756: 8a 85 ldd r24, Y+10 ; 0x0a f758: 9b 85 ldd r25, Y+11 ; 0x0b f75a: 42 e0 ldi r20, 0x02 ; 2 f75c: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f760: 87 ec ldi r24, 0xC7 ; 199 f762: 97 e7 ldi r25, 0x77 ; 119 f764: 0e 94 94 7a call 0xf528 ; 0xf528 f768: 6c 85 ldd r22, Y+12 ; 0x0c f76a: 7d 85 ldd r23, Y+13 ; 0x0d f76c: 8e 85 ldd r24, Y+14 ; 0x0e f76e: 9f 85 ldd r25, Y+15 ; 0x0f f770: 42 e0 ldi r20, 0x02 ; 2 f772: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f776: 89 e1 ldi r24, 0x19 ; 25 f778: 94 e6 ldi r25, 0x64 ; 100 f77a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f77e: 80 e0 ldi r24, 0x00 ; 0 f780: 0f 94 8e 18 call 0x2311c ; 0x2311c f784: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f788: c7 e6 ldi r28, 0x67 ; 103 f78a: dd e0 ldi r29, 0x0D ; 13 f78c: 2c 81 ldd r18, Y+4 ; 0x04 f78e: 3d 81 ldd r19, Y+5 ; 0x05 f790: 4e 81 ldd r20, Y+6 ; 0x06 f792: 5f 81 ldd r21, Y+7 ; 0x07 f794: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> f798: 42 e0 ldi r20, 0x02 ; 2 f79a: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOLPGM(" Y:"); f79e: 83 ec ldi r24, 0xC3 ; 195 f7a0: 97 e7 ldi r25, 0x77 ; 119 f7a2: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f7a6: 81 e0 ldi r24, 0x01 ; 1 f7a8: 0f 94 8e 18 call 0x2311c ; 0x2311c f7ac: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f7b0: 28 85 ldd r18, Y+8 ; 0x08 f7b2: 39 85 ldd r19, Y+9 ; 0x09 f7b4: 4a 85 ldd r20, Y+10 ; 0x0a f7b6: 5b 85 ldd r21, Y+11 ; 0x0b f7b8: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> f7bc: 42 e0 ldi r20, 0x02 ; 2 f7be: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOLPGM(" Z:"); f7c2: 8f eb ldi r24, 0xBF ; 191 f7c4: 97 e7 ldi r25, 0x77 ; 119 f7c6: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f7ca: 82 e0 ldi r24, 0x02 ; 2 f7cc: 0f 94 8e 18 call 0x2311c ; 0x2311c f7d0: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f7d4: 2c 85 ldd r18, Y+12 ; 0x0c f7d6: 3d 85 ldd r19, Y+13 ; 0x0d f7d8: 4e 85 ldd r20, Y+14 ; 0x0e f7da: 5f 85 ldd r21, Y+15 ; 0x0f f7dc: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> f7e0: 42 e0 ldi r20, 0x02 ; 2 f7e2: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOLPGM(" E:"); f7e6: 8b eb ldi r24, 0xBB ; 187 f7e8: 97 e7 ldi r25, 0x77 ; 119 f7ea: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f7ee: 83 e0 ldi r24, 0x03 ; 3 f7f0: 0f 94 8e 18 call 0x2311c ; 0x2311c f7f4: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f7f8: 28 89 ldd r18, Y+16 ; 0x10 f7fa: 39 89 ldd r19, Y+17 ; 0x11 f7fc: 4a 89 ldd r20, Y+18 ; 0x12 f7fe: 5b 89 ldd r21, Y+19 ; 0x13 f800: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> } f804: df 91 pop r29 f806: 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]); f808: 0d 94 7a 65 jmp 0x2caf4 ; 0x2caf4 0000f80c : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f80c: 8a ec ldi r24, 0xCA ; 202 f80e: 96 e7 ldi r25, 0x76 ; 118 f810: 0e 94 94 7a call 0xf528 ; 0xf528 f814: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a f818: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b f81c: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c f820: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d f824: 41 e0 ldi r20, 0x01 ; 1 f826: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f82a: 87 ec ldi r24, 0xC7 ; 199 f82c: 96 e7 ldi r25, 0x76 ; 118 f82e: 0e 94 94 7a call 0xf528 ; 0xf528 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f832: 60 91 5d 12 lds r22, 0x125D ; 0x80125d f836: 70 91 5e 12 lds r23, 0x125E ; 0x80125e f83a: 07 2e mov r0, r23 f83c: 00 0c add r0, r0 f83e: 88 0b sbc r24, r24 f840: 99 0b sbc r25, r25 f842: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f846: 41 e0 ldi r20, 0x01 ; 1 f848: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f84c: 83 ec ldi r24, 0xC3 ; 195 f84e: 96 e7 ldi r25, 0x76 ; 118 f850: 0e 94 94 7a call 0xf528 ; 0xf528 f854: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc f858: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd f85c: 80 91 be 03 lds r24, 0x03BE ; 0x8003be f860: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf f864: 41 e0 ldi r20, 0x01 ; 1 f866: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f86a: 80 ec ldi r24, 0xC0 ; 192 f86c: 96 e7 ldi r25, 0x76 ; 118 f86e: 0e 94 94 7a call 0xf528 ; 0xf528 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f872: 60 91 59 12 lds r22, 0x1259 ; 0x801259 f876: 70 91 5a 12 lds r23, 0x125A ; 0x80125a f87a: 07 2e mov r0, r23 f87c: 00 0c add r0, r0 f87e: 88 0b sbc r24, r24 f880: 99 0b sbc r25, r25 f882: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f886: 41 e0 ldi r20, 0x01 ; 1 f888: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f88c: 8b eb ldi r24, 0xBB ; 187 f88e: 96 e7 ldi r25, 0x76 ; 118 f890: 0e 94 94 7a call 0xf528 ; 0xf528 f894: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a f898: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b f89c: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c f8a0: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d f8a4: 41 e0 ldi r20, 0x01 ; 1 f8a6: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f8aa: 88 eb ldi r24, 0xB8 ; 184 f8ac: 96 e7 ldi r25, 0x76 ; 118 f8ae: 0e 94 94 7a call 0xf528 ; 0xf528 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f8b2: 60 91 5d 12 lds r22, 0x125D ; 0x80125d f8b6: 70 91 5e 12 lds r23, 0x125E ; 0x80125e f8ba: 07 2e mov r0, r23 f8bc: 00 0c add r0, r0 f8be: 88 0b sbc r24, r24 f8c0: 99 0b sbc r25, r25 f8c2: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> f8c6: 41 e0 ldi r20, 0x01 ; 1 f8c8: 0e 94 16 7a call 0xf42c ; 0xf42c #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f8cc: 84 eb ldi r24, 0xB4 ; 180 f8ce: 96 e7 ldi r25, 0x76 ; 118 f8d0: 0e 94 94 7a call 0xf528 ; 0xf528 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f8d4: 60 91 f5 05 lds r22, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> f8d8: 70 e0 ldi r23, 0x00 ; 0 f8da: 90 e0 ldi r25, 0x00 ; 0 f8dc: 80 e0 ldi r24, 0x00 ; 0 f8de: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f8e2: 8f ea ldi r24, 0xAF ; 175 f8e4: 96 e7 ldi r25, 0x76 ; 118 f8e6: 0e 94 94 7a call 0xf528 ; 0xf528 f8ea: 60 91 ee 05 lds r22, 0x05EE ; 0x8005ee f8ee: 70 e0 ldi r23, 0x00 ; 0 f8f0: 90 e0 ldi r25, 0x00 ; 0 f8f2: 80 e0 ldi r24, 0x00 ; 0 f8f4: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f8f8: 8b ea ldi r24, 0xAB ; 171 f8fa: 96 e7 ldi r25, 0x76 ; 118 f8fc: 0e 94 94 7a call 0xf528 ; 0xf528 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f900: 60 91 85 03 lds r22, 0x0385 ; 0x800385 f904: 70 91 86 03 lds r23, 0x0386 ; 0x800386 f908: 80 91 87 03 lds r24, 0x0387 ; 0x800387 f90c: 90 91 88 03 lds r25, 0x0388 ; 0x800388 f910: 41 e0 ldi r20, 0x01 ; 1 f912: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f916: 0c 94 8c 7a jmp 0xf518 ; 0xf518 0000f91a : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f91a: 0e 94 94 7a call 0xf528 ; 0xf528 MYSERIAL.println(); f91e: 0c 94 8c 7a jmp 0xf518 ; 0xf518 0000f922 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { f922: 8f 92 push r8 f924: 9f 92 push r9 f926: af 92 push r10 f928: bf 92 push r11 f92a: cf 92 push r12 f92c: df 92 push r13 f92e: ef 92 push r14 f930: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); f932: 0f 94 56 0b call 0x216ac ; 0x216ac f936: 6b 01 movw r12, r22 f938: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { f93a: 20 91 32 02 lds r18, 0x0232 ; 0x800232 f93e: 22 23 and r18, r18 f940: 09 f1 breq .+66 ; 0xf984 f942: 40 91 78 02 lds r20, 0x0278 ; 0x800278 f946: 41 30 cpi r20, 0x01 ; 1 f948: e9 f0 breq .+58 ; 0xf984 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; f94a: 80 91 14 02 lds r24, 0x0214 ; 0x800214 f94e: 90 91 15 02 lds r25, 0x0215 ; 0x800215 f952: a0 91 16 02 lds r26, 0x0216 ; 0x800216 f956: b0 91 17 02 lds r27, 0x0217 ; 0x800217 f95a: 46 01 movw r8, r12 f95c: 57 01 movw r10, r14 f95e: 88 1a sub r8, r24 f960: 99 0a sbc r9, r25 f962: aa 0a sbc r10, r26 f964: bb 0a sbc r11, r27 f966: 30 e0 ldi r19, 0x00 ; 0 f968: a8 ee ldi r26, 0xE8 ; 232 f96a: b3 e0 ldi r27, 0x03 ; 3 f96c: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> f970: 86 16 cp r8, r22 f972: 97 06 cpc r9, r23 f974: a8 06 cpc r10, r24 f976: b9 06 cpc r11, r25 f978: 6c f0 brlt .+26 ; 0xf994 switch (busy_state) { f97a: 44 30 cpi r20, 0x04 ; 4 f97c: 31 f1 breq .+76 ; 0xf9ca f97e: 9c f4 brge .+38 ; 0xf9a6 f980: 42 30 cpi r20, 0x02 ; 2 f982: d4 f4 brge .+52 ; 0xf9b8 break; default: break; } } prev_busy_signal_ms = ms; f984: c0 92 14 02 sts 0x0214, r12 ; 0x800214 f988: d0 92 15 02 sts 0x0215, r13 ; 0x800215 f98c: e0 92 16 02 sts 0x0216, r14 ; 0x800216 f990: f0 92 17 02 sts 0x0217, r15 ; 0x800217 } f994: ff 90 pop r15 f996: ef 90 pop r14 f998: df 90 pop r13 f99a: cf 90 pop r12 f99c: bf 90 pop r11 f99e: af 90 pop r10 f9a0: 9f 90 pop r9 f9a2: 8f 90 pop r8 f9a4: 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) { f9a6: 45 30 cpi r20, 0x05 ; 5 f9a8: 69 f7 brne .-38 ; 0xf984 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; f9aa: 8e ec ldi r24, 0xCE ; 206 f9ac: 91 ea ldi r25, 0xA1 ; 161 f9ae: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNPGM("busy: paused for input"); f9b2: 86 e9 ldi r24, 0x96 ; 150 f9b4: 98 e7 ldi r25, 0x78 ; 120 f9b6: 06 c0 rjmp .+12 ; 0xf9c4 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; f9b8: 8e ec ldi r24, 0xCE ; 206 f9ba: 91 ea ldi r25, 0xA1 ; 161 f9bc: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNPGM("busy: processing"); f9c0: 83 ec ldi r24, 0xC3 ; 195 f9c2: 98 e7 ldi r25, 0x78 ; 120 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); f9c4: 0e 94 8d 7c call 0xf91a ; 0xf91a f9c8: dd cf rjmp .-70 ; 0xf984 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; f9ca: 8e ec ldi r24, 0xCE ; 206 f9cc: 91 ea ldi r25, 0xA1 ; 161 f9ce: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNPGM("busy: paused for user"); f9d2: 8d ea ldi r24, 0xAD ; 173 f9d4: 98 e7 ldi r25, 0x78 ; 120 f9d6: f6 cf rjmp .-20 ; 0xf9c4 0000f9d8 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f9d8: 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))); f9da: 81 ea ldi r24, 0xA1 ; 161 f9dc: 9d e0 ldi r25, 0x0D ; 13 f9de: 0f 94 9d a3 call 0x3473a ; 0x3473a } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f9e2: cb e0 ldi r28, 0x0B ; 11 f9e4: 8c 9f mul r24, r28 f9e6: c0 01 movw r24, r0 f9e8: 11 24 eor r1, r1 f9ea: 80 5b subi r24, 0xB0 ; 176 f9ec: 92 4f sbci r25, 0xF2 ; 242 f9ee: 0f 94 ab a3 call 0x34756 ; 0x34756 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f9f2: 81 56 subi r24, 0x61 ; 97 f9f4: 90 4f sbci r25, 0xF0 ; 240 f9f6: 80 3a cpi r24, 0xA0 ; 160 f9f8: 9f 40 sbci r25, 0x0F ; 15 f9fa: c8 f0 brcs .+50 ; 0xfa2e 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"); f9fc: 82 e6 ldi r24, 0x62 ; 98 f9fe: 98 e7 ldi r25, 0x78 ; 120 fa00: 0e 94 8d 7c call 0xf91a ; 0xf91a eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), fa04: 81 ea ldi r24, 0xA1 ; 161 fa06: 9d e0 ldi r25, 0x0D ; 13 fa08: 0f 94 9d a3 call 0x3473a ; 0x3473a 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-> fa0c: 8c 9f mul r24, r28 fa0e: c0 01 movw r24, r0 fa10: 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); fa12: 70 e0 ldi r23, 0x00 ; 0 fa14: 60 e0 ldi r22, 0x00 ; 0 fa16: 80 5b subi r24, 0xB0 ; 176 fa18: 92 4f sbci r25, 0xF2 ; 242 fa1a: 0f 94 fb a3 call 0x347f6 ; 0x347f6 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.")); fa1e: 85 e2 ldi r24, 0x25 ; 37 fa20: 98 e7 ldi r25, 0x78 ; 120 fa22: 0e 94 85 e8 call 0x1d10a ; 0x1d10a lcd_update_enable(true); fa26: 81 e0 ldi r24, 0x01 ; 1 } } fa28: 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); fa2a: 0c 94 08 70 jmp 0xe010 ; 0xe010 } } fa2e: cf 91 pop r28 fa30: 08 95 ret 0000fa32 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { fa32: 2f 92 push r2 fa34: 3f 92 push r3 fa36: 4f 92 push r4 fa38: 5f 92 push r5 fa3a: 6f 92 push r6 fa3c: 7f 92 push r7 fa3e: 8f 92 push r8 fa40: 9f 92 push r9 fa42: af 92 push r10 fa44: bf 92 push r11 fa46: cf 92 push r12 fa48: df 92 push r13 fa4a: ef 92 push r14 fa4c: ff 92 push r15 fa4e: 0f 93 push r16 fa50: 1f 93 push r17 fa52: cf 93 push r28 fa54: df 93 push r29 fa56: cd b7 in r28, 0x3d ; 61 fa58: de b7 in r29, 0x3e ; 62 fa5a: a4 97 sbiw r28, 0x24 ; 36 fa5c: 0f b6 in r0, 0x3f ; 63 fa5e: f8 94 cli fa60: de bf out 0x3e, r29 ; 62 fa62: 0f be out 0x3f, r0 ; 63 fa64: 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(); fa66: 0f 94 b0 18 call 0x23160 ; 0x23160 if (planner_aborted) fa6a: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 fa6e: 81 11 cpse r24, r1 fa70: 17 c0 rjmp .+46 ; 0xfaa0 return; mesh_bed_leveling_flag = true; fa72: 81 e0 ldi r24, 0x01 ; 1 fa74: 80 93 72 12 sts 0x1272, r24 ; 0x801272 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { fa78: 80 91 39 06 lds r24, 0x0639 ; 0x800639 fa7c: 88 23 and r24, r24 fa7e: 49 f0 breq .+18 ; 0xfa92 fa80: 80 91 3a 06 lds r24, 0x063A ; 0x80063a fa84: 88 23 and r24, r24 fa86: 29 f0 breq .+10 ; 0xfa92 fa88: 20 91 3b 06 lds r18, 0x063B ; 0x80063b fa8c: 2f 83 std Y+7, r18 ; 0x07 fa8e: 21 11 cpse r18, r1 fa90: 20 c0 rjmp .+64 ; 0xfad2 // 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; fa92: 81 e0 ldi r24, 0x01 ; 1 fa94: 80 93 53 12 sts 0x1253, r24 ; 0x801253 // 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); fa98: 8d ec ldi r24, 0xCD ; 205 fa9a: 98 e6 ldi r25, 0x68 ; 104 fa9c: 0f 94 49 67 call 0x2ce92 ; 0x2ce92 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } faa0: a4 96 adiw r28, 0x24 ; 36 faa2: 0f b6 in r0, 0x3f ; 63 faa4: f8 94 cli faa6: de bf out 0x3e, r29 ; 62 faa8: 0f be out 0x3f, r0 ; 63 faaa: cd bf out 0x3d, r28 ; 61 faac: df 91 pop r29 faae: cf 91 pop r28 fab0: 1f 91 pop r17 fab2: 0f 91 pop r16 fab4: ff 90 pop r15 fab6: ef 90 pop r14 fab8: df 90 pop r13 faba: cf 90 pop r12 fabc: bf 90 pop r11 fabe: af 90 pop r10 fac0: 9f 90 pop r9 fac2: 8f 90 pop r8 fac4: 7f 90 pop r7 fac6: 6f 90 pop r6 fac8: 5f 90 pop r5 faca: 4f 90 pop r4 facc: 3f 90 pop r3 face: 2f 90 pop r2 fad0: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); fad2: 8b ea ldi r24, 0xAB ; 171 fad4: 9d e0 ldi r25, 0x0D ; 13 fad6: 0f 94 9d a3 call 0x3473a ; 0x3473a fada: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) fadc: 8e e4 ldi r24, 0x4E ; 78 fade: 0e 94 f5 55 call 0xabea ; 0xabea fae2: 08 2f mov r16, r24 fae4: 0e 94 0a 56 call 0xac14 ; 0xac14 fae8: 8e 83 std Y+6, r24 ; 0x06 faea: 00 23 and r16, r16 faec: 29 f0 breq .+10 ; 0xfaf8 faee: 87 30 cpi r24, 0x07 ; 7 faf0: 09 f4 brne .+2 ; 0xfaf4 faf2: c9 c0 rjmp .+402 ; 0xfc86 faf4: 83 30 cpi r24, 0x03 ; 3 faf6: 29 f0 breq .+10 ; 0xfb02 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; faf8: 13 30 cpi r17, 0x03 ; 3 fafa: 09 f0 breq .+2 ; 0xfafe fafc: c3 c0 rjmp .+390 ; 0xfc84 fafe: 63 e0 ldi r22, 0x03 ; 3 fb00: 6e 83 std Y+6, r22 ; 0x06 fb02: 80 e0 ldi r24, 0x00 ; 0 fb04: 90 e0 ldi r25, 0x00 ; 0 fb06: a0 e8 ldi r26, 0x80 ; 128 fb08: bf e3 ldi r27, 0x3F ; 63 fb0a: 8a 83 std Y+2, r24 ; 0x02 fb0c: 9b 83 std Y+3, r25 ; 0x03 fb0e: ac 83 std Y+4, r26 ; 0x04 fb10: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); fb12: 8a ea ldi r24, 0xAA ; 170 fb14: 9d e0 ldi r25, 0x0D ; 13 fb16: 0f 94 9d a3 call 0x3473a ; 0x3473a fb1a: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) fb1c: 83 e4 ldi r24, 0x43 ; 67 fb1e: 0e 94 f5 55 call 0xabea ; 0xabea fb22: 18 2f mov r17, r24 fb24: 0e 94 0a 56 call 0xac14 ; 0xac14 fb28: 11 23 and r17, r17 fb2a: 29 f0 breq .+10 ; 0xfb36 fb2c: 88 23 and r24, r24 fb2e: 19 f0 breq .+6 ; 0xfb36 fb30: 8b 30 cpi r24, 0x0B ; 11 fb32: 08 f4 brcc .+2 ; 0xfb36 fb34: 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; fb36: 88 e5 ldi r24, 0x58 ; 88 fb38: 0e 94 f5 55 call 0xabea ; 0xabea fb3c: 88 23 and r24, r24 fb3e: 09 f4 brne .+2 ; 0xfb42 fb40: ab c0 rjmp .+342 ; 0xfc98 fb42: 0e 94 85 5a call 0xb50a ; 0xb50a fb46: 20 e0 ldi r18, 0x00 ; 0 fb48: 30 e0 ldi r19, 0x00 ; 0 fb4a: 48 e0 ldi r20, 0x08 ; 8 fb4c: 52 e4 ldi r21, 0x42 ; 66 fb4e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> fb52: 20 e0 ldi r18, 0x00 ; 0 fb54: 30 e0 ldi r19, 0x00 ; 0 fb56: 48 eb ldi r20, 0xB8 ; 184 fb58: 51 e4 ldi r21, 0x41 ; 65 fb5a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> fb5e: 6a 87 std Y+10, r22 ; 0x0a fb60: 7b 87 std Y+11, r23 ; 0x0b fb62: 8c 87 std Y+12, r24 ; 0x0c fb64: 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; fb66: 89 e5 ldi r24, 0x59 ; 89 fb68: 0e 94 f5 55 call 0xabea ; 0xabea fb6c: 88 23 and r24, r24 fb6e: 09 f4 brne .+2 ; 0xfb72 fb70: 9c c0 rjmp .+312 ; 0xfcaa fb72: 0e 94 85 5a call 0xb50a ; 0xb50a fb76: 20 e0 ldi r18, 0x00 ; 0 fb78: 30 e0 ldi r19, 0x00 ; 0 fb7a: 48 e0 ldi r20, 0x08 ; 8 fb7c: 52 e4 ldi r21, 0x42 ; 66 fb7e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> fb82: 20 e0 ldi r18, 0x00 ; 0 fb84: 30 e0 ldi r19, 0x00 ; 0 fb86: 40 ea ldi r20, 0xA0 ; 160 fb88: 50 e4 ldi r21, 0x40 ; 64 fb8a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> fb8e: 6c 8b std Y+20, r22 ; 0x14 fb90: 7d 8b std Y+21, r23 ; 0x15 fb92: 8e 8b std Y+22, r24 ; 0x16 fb94: 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; fb96: 87 e5 ldi r24, 0x57 ; 87 fb98: 0e 94 f5 55 call 0xabea ; 0xabea fb9c: 88 23 and r24, r24 fb9e: 09 f4 brne .+2 ; 0xfba2 fba0: 89 c0 rjmp .+274 ; 0xfcb4 fba2: 0e 94 85 5a call 0xb50a ; 0xb50a fba6: 2a 85 ldd r18, Y+10 ; 0x0a fba8: 3b 85 ldd r19, Y+11 ; 0x0b fbaa: 4c 85 ldd r20, Y+12 ; 0x0c fbac: 5d 85 ldd r21, Y+13 ; 0x0d fbae: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> fbb2: 20 e0 ldi r18, 0x00 ; 0 fbb4: 30 e0 ldi r19, 0x00 ; 0 fbb6: 48 e8 ldi r20, 0x88 ; 136 fbb8: 52 e4 ldi r21, 0x42 ; 66 fbba: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> fbbe: 69 8f std Y+25, r22 ; 0x19 fbc0: 7a 8f std Y+26, r23 ; 0x1a fbc2: 8b 8f std Y+27, r24 ; 0x1b fbc4: 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; fbc6: 88 e4 ldi r24, 0x48 ; 72 fbc8: 0e 94 f5 55 call 0xabea ; 0xabea fbcc: 88 23 and r24, r24 fbce: 09 f4 brne .+2 ; 0xfbd2 fbd0: 7a c0 rjmp .+244 ; 0xfcc6 fbd2: 0e 94 85 5a call 0xb50a ; 0xb50a fbd6: 2c 89 ldd r18, Y+20 ; 0x14 fbd8: 3d 89 ldd r19, Y+21 ; 0x15 fbda: 4e 89 ldd r20, Y+22 ; 0x16 fbdc: 5f 89 ldd r21, Y+23 ; 0x17 fbde: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> fbe2: 20 e0 ldi r18, 0x00 ; 0 fbe4: 30 e0 ldi r19, 0x00 ; 0 fbe6: 48 e8 ldi r20, 0x88 ; 136 fbe8: 52 e4 ldi r21, 0x42 ; 66 fbea: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> fbee: 6d 8f std Y+29, r22 ; 0x1d fbf0: 7e 8f std Y+30, r23 ; 0x1e fbf2: 8f 8f std Y+31, r24 ; 0x1f fbf4: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling fbf6: 0f 94 a0 7b call 0x2f740 ; 0x2f740 mbl.z_values[0][0] = min_pos[Z_AXIS]; fbfa: 80 91 2c 02 lds r24, 0x022C ; 0x80022c fbfe: 90 91 2d 02 lds r25, 0x022D ; 0x80022d fc02: a0 91 2e 02 lds r26, 0x022E ; 0x80022e fc06: b0 91 2f 02 lds r27, 0x022F ; 0x80022f fc0a: 80 93 0a 13 sts 0x130A, r24 ; 0x80130a fc0e: 90 93 0b 13 sts 0x130B, r25 ; 0x80130b fc12: a0 93 0c 13 sts 0x130C, r26 ; 0x80130c fc16: b0 93 0d 13 sts 0x130D, r27 ; 0x80130d // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); fc1a: 0f 94 aa 52 call 0x2a554 ; 0x2a554 fc1e: 05 ec ldi r16, 0xC5 ; 197 fc20: 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) fc22: c8 01 movw r24, r16 fc24: 0f 94 ab a3 call 0x34756 ; 0x34756 fc28: 01 96 adiw r24, 0x01 ; 1 fc2a: 09 f0 breq .+2 ; 0xfc2e fc2c: 51 c0 rjmp .+162 ; 0xfcd0 fc2e: 0e 5f subi r16, 0xFE ; 254 fc30: 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) { fc32: 05 3d cpi r16, 0xD5 ; 213 fc34: 8f e0 ldi r24, 0x0F ; 15 fc36: 18 07 cpc r17, r24 fc38: a1 f7 brne .-24 ; 0xfc22 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; fc3a: 21 2c mov r2, r1 fc3c: a9 e0 ldi r26, 0x09 ; 9 fc3e: b3 e1 ldi r27, 0x13 ; 19 fc40: ba a3 std Y+34, r27 ; 0x22 fc42: 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; fc44: b9 87 std Y+9, r27 ; 0x09 fc46: a8 87 std Y+8, r26 ; 0x08 fc48: 51 2c mov r5, r1 fc4a: 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; fc4c: 31 2c mov r3, r1 fc4e: 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)); fc50: 84 2d mov r24, r4 fc52: 63 e0 ldi r22, 0x03 ; 3 fc54: 0f 94 4c a4 call 0x34898 ; 0x34898 <__udivmodqi4> fc58: 98 8b std Y+16, r25 ; 0x10 fc5a: 68 84 ldd r6, Y+8 ; 0x08 fc5c: 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++) { fc5e: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); fc60: f8 89 ldd r31, Y+16 ; 0x10 fc62: f1 11 cpse r31, r1 fc64: 37 c0 rjmp .+110 ; 0xfcd4 fc66: 81 2f mov r24, r17 fc68: 63 e0 ldi r22, 0x03 ; 3 fc6a: 0f 94 4c a4 call 0x34898 ; 0x34898 <__udivmodqi4> fc6e: 91 11 cpse r25, r1 fc70: 31 c0 rjmp .+98 ; 0xfcd4 if (isOn3x3Mesh) { if (has_z && (row || col)) { fc72: 21 10 cpse r2, r1 fc74: 3f c1 rjmp .+638 ; 0xfef4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fc76: 7e 81 ldd r23, Y+6 ; 0x06 fc78: 73 30 cpi r23, 0x03 ; 3 fc7a: 09 f4 brne .+2 ; 0xfc7e fc7c: 70 c0 rjmp .+224 ; 0xfd5e fc7e: 8f 81 ldd r24, Y+7 ; 0x07 fc80: 8e 87 std Y+14, r24 ; 0x0e fc82: 37 c0 rjmp .+110 ; 0xfcf2 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; fc84: 1e 83 std Y+6, r17 ; 0x06 fc86: 6a e9 ldi r22, 0x9A ; 154 fc88: 79 e9 ldi r23, 0x99 ; 153 fc8a: 89 e1 ldi r24, 0x19 ; 25 fc8c: 9f e3 ldi r25, 0x3F ; 63 fc8e: 6a 83 std Y+2, r22 ; 0x02 fc90: 7b 83 std Y+3, r23 ; 0x03 fc92: 8c 83 std Y+4, r24 ; 0x04 fc94: 9d 83 std Y+5, r25 ; 0x05 fc96: 3d cf rjmp .-390 ; 0xfb12 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; fc98: 80 e0 ldi r24, 0x00 ; 0 fc9a: 90 e0 ldi r25, 0x00 ; 0 fc9c: a0 e8 ldi r26, 0x80 ; 128 fc9e: bf ef ldi r27, 0xFF ; 255 fca0: 8a 87 std Y+10, r24 ; 0x0a fca2: 9b 87 std Y+11, r25 ; 0x0b fca4: ac 87 std Y+12, r26 ; 0x0c fca6: bd 87 std Y+13, r27 ; 0x0d fca8: 5e cf rjmp .-324 ; 0xfb66 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; fcaa: 60 e0 ldi r22, 0x00 ; 0 fcac: 70 e0 ldi r23, 0x00 ; 0 fcae: 80 e8 ldi r24, 0x80 ; 128 fcb0: 9f ef ldi r25, 0xFF ; 255 fcb2: 6d cf rjmp .-294 ; 0xfb8e const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; fcb4: 80 e0 ldi r24, 0x00 ; 0 fcb6: 90 e0 ldi r25, 0x00 ; 0 fcb8: a0 e8 ldi r26, 0x80 ; 128 fcba: bf e7 ldi r27, 0x7F ; 127 fcbc: 89 8f std Y+25, r24 ; 0x19 fcbe: 9a 8f std Y+26, r25 ; 0x1a fcc0: ab 8f std Y+27, r26 ; 0x1b fcc2: bc 8f std Y+28, r27 ; 0x1c fcc4: 80 cf rjmp .-256 ; 0xfbc6 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; fcc6: 60 e0 ldi r22, 0x00 ; 0 fcc8: 70 e0 ldi r23, 0x00 ; 0 fcca: 80 e8 ldi r24, 0x80 ; 128 fccc: 9f e7 ldi r25, 0x7F ; 127 fcce: 8f cf rjmp .-226 ; 0xfbee fcd0: 2f 80 ldd r2, Y+7 ; 0x07 fcd2: b4 cf rjmp .-152 ; 0xfc3c 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; } fcd4: 60 e0 ldi r22, 0x00 ; 0 fcd6: 70 e0 ldi r23, 0x00 ; 0 fcd8: 80 ec ldi r24, 0xC0 ; 192 fcda: 9f e7 ldi r25, 0x7F ; 127 fcdc: d3 01 movw r26, r6 fcde: 11 96 adiw r26, 0x01 ; 1 fce0: 6d 93 st X+, r22 fce2: 7d 93 st X+, r23 fce4: 8d 93 st X+, r24 fce6: 9c 93 st X, r25 fce8: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fcea: be 81 ldd r27, Y+6 ; 0x06 fcec: b3 30 cpi r27, 0x03 ; 3 fcee: c1 f1 breq .+112 ; 0xfd60 fcf0: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); fcf2: 81 2f mov r24, r17 fcf4: 0e 94 b0 5e call 0xbd60 ; 0xbd60 fcf8: 4b 01 movw r8, r22 fcfa: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); fcfc: 80 2f mov r24, r16 fcfe: 0e 94 b0 5e call 0xbd60 ; 0xbd60 fd02: 6b 01 movw r12, r22 fd04: 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)) { fd06: a5 01 movw r20, r10 fd08: 94 01 movw r18, r8 fd0a: 6a 85 ldd r22, Y+10 ; 0x0a fd0c: 7b 85 ldd r23, Y+11 ; 0x0b fd0e: 8c 85 ldd r24, Y+12 ; 0x0c fd10: 9d 85 ldd r25, Y+13 ; 0x0d fd12: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> fd16: 18 16 cp r1, r24 fd18: 0c f4 brge .+2 ; 0xfd1c fd1a: 1c c1 rjmp .+568 ; 0xff54 fd1c: 29 8d ldd r18, Y+25 ; 0x19 fd1e: 3a 8d ldd r19, Y+26 ; 0x1a fd20: 4b 8d ldd r20, Y+27 ; 0x1b fd22: 5c 8d ldd r21, Y+28 ; 0x1c fd24: c5 01 movw r24, r10 fd26: b4 01 movw r22, r8 fd28: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> fd2c: 18 16 cp r1, r24 fd2e: 0c f4 brge .+2 ; 0xfd32 fd30: 11 c1 rjmp .+546 ; 0xff54 fd32: a7 01 movw r20, r14 fd34: 96 01 movw r18, r12 fd36: 6c 89 ldd r22, Y+20 ; 0x14 fd38: 7d 89 ldd r23, Y+21 ; 0x15 fd3a: 8e 89 ldd r24, Y+22 ; 0x16 fd3c: 9f 89 ldd r25, Y+23 ; 0x17 fd3e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> fd42: 18 16 cp r1, r24 fd44: 0c f4 brge .+2 ; 0xfd48 fd46: 06 c1 rjmp .+524 ; 0xff54 fd48: 2d 8d ldd r18, Y+29 ; 0x1d fd4a: 3e 8d ldd r19, Y+30 ; 0x1e fd4c: 4f 8d ldd r20, Y+31 ; 0x1f fd4e: 58 a1 ldd r21, Y+32 ; 0x20 fd50: c7 01 movw r24, r14 fd52: b6 01 movw r22, r12 fd54: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> fd58: 18 16 cp r1, r24 fd5a: 0c f4 brge .+2 ; 0xfd5e fd5c: fb c0 rjmp .+502 ; 0xff54 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; fd5e: 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++) { fd60: 1f 5f subi r17, 0xFF ; 255 fd62: 24 e0 ldi r18, 0x04 ; 4 fd64: 62 0e add r6, r18 fd66: 71 1c adc r7, r1 fd68: 17 30 cpi r17, 0x07 ; 7 fd6a: 09 f0 breq .+2 ; 0xfd6e fd6c: 79 cf rjmp .-270 ; 0xfc60 fd6e: 6f ef ldi r22, 0xFF ; 255 fd70: 46 1a sub r4, r22 fd72: 56 0a sbc r5, r22 fd74: 88 85 ldd r24, Y+8 ; 0x08 fd76: 99 85 ldd r25, Y+9 ; 0x09 fd78: 4c 96 adiw r24, 0x1c ; 28 fd7a: 99 87 std Y+9, r25 ; 0x09 fd7c: 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++) { fd7e: 97 e0 ldi r25, 0x07 ; 7 fd80: 49 16 cp r4, r25 fd82: 51 04 cpc r5, r1 fd84: 09 f0 breq .+2 ; 0xfd88 fd86: 63 cf rjmp .-314 ; 0xfc4e // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh fd88: 0f 94 7a 92 call 0x324f4 ; 0x324f4 // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; fd8c: a0 91 5d 06 lds r26, 0x065D ; 0x80065d fd90: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; fd92: b0 91 de 03 lds r27, 0x03DE ; 0x8003de fd96: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; fd98: 81 e0 ldi r24, 0x01 ; 1 fd9a: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = meshPointsToProbe + 10; fd9e: 8a e0 ldi r24, 0x0A ; 10 fda0: 83 0d add r24, r3 fda2: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_update(1); fda6: 81 e0 ldi r24, 0x01 ; 1 fda8: 0e 94 c9 6e call 0xdd92 ; 0xdd92 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; fdac: 80 e0 ldi r24, 0x00 ; 0 fdae: 90 e0 ldi r25, 0x00 ; 0 fdb0: a0 ea ldi r26, 0xA0 ; 160 fdb2: b0 e4 ldi r27, 0x40 ; 64 fdb4: 80 93 69 12 sts 0x1269, r24 ; 0x801269 fdb8: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a fdbc: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b fdc0: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); fdc4: 65 e5 ldi r22, 0x55 ; 85 fdc6: 75 e5 ldi r23, 0x55 ; 85 fdc8: 85 e5 ldi r24, 0x55 ; 85 fdca: 91 e4 ldi r25, 0x41 ; 65 fdcc: 0f 94 0a 4a call 0x29414 ; 0x29414 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 fdd0: 80 e0 ldi r24, 0x00 ; 0 fdd2: 0e 94 36 65 call 0xca6c ; 0xca6c fdd6: 9c a3 std Y+36, r25 ; 0x24 fdd8: 8b a3 std Y+35, r24 ; 0x23 fdda: 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 fddc: 83 2d mov r24, r3 fdde: 67 e0 ldi r22, 0x07 ; 7 fde0: 0f 94 4c a4 call 0x34898 ; 0x34898 <__udivmodqi4> fde4: f8 2e mov r15, r24 fde6: 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 fde8: 68 2f mov r22, r24 fdea: 70 e0 ldi r23, 0x00 ; 0 fdec: 7f 87 std Y+15, r23 ; 0x0f fdee: 6e 87 std Y+14, r22 ; 0x0e fdf0: 80 ff sbrs r24, 0 fdf2: 03 c0 rjmp .+6 ; 0xfdfa fdf4: 76 e0 ldi r23, 0x06 ; 6 fdf6: 79 1b sub r23, r25 fdf8: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); fdfa: 80 2f mov r24, r16 fdfc: 63 e0 ldi r22, 0x03 ; 3 fdfe: 0f 94 4c a4 call 0x34898 ; 0x34898 <__udivmodqi4> fe02: 91 11 cpse r25, r1 fe04: 05 c0 rjmp .+10 ; 0xfe10 fe06: 8f 2d mov r24, r15 fe08: 0f 94 4c a4 call 0x34898 ; 0x34898 <__udivmodqi4> fe0c: 11 e0 ldi r17, 0x01 ; 1 fe0e: 91 11 cpse r25, r1 fe10: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); fe12: 80 2f mov r24, r16 fe14: 0e 94 b0 5e call 0xbd60 ; 0xbd60 fe18: 68 8b std Y+16, r22 ; 0x10 fe1a: 79 8b std Y+17, r23 ; 0x11 fe1c: 8a 8b std Y+18, r24 ; 0x12 fe1e: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); fe20: 8f 2d mov r24, r15 fe22: 0e 94 b0 5e call 0xbd60 ; 0xbd60 fe26: 4b 01 movw r8, r22 fe28: 5c 01 movw r10, r24 if (nMeasPoints == 3) { fe2a: 8e 81 ldd r24, Y+6 ; 0x06 fe2c: 83 30 cpi r24, 0x03 ; 3 fe2e: 09 f0 breq .+2 ; 0xfe32 fe30: 99 c0 rjmp .+306 ; 0xff64 if (!isOn3x3Mesh) { fe32: 11 11 cpse r17, r1 fe34: c8 c0 rjmp .+400 ; 0xffc6 fe36: 27 e0 ldi r18, 0x07 ; 7 fe38: ae 85 ldd r26, Y+14 ; 0x0e fe3a: bf 85 ldd r27, Y+15 ; 0x0f fe3c: 2a 9f mul r18, r26 fe3e: f0 01 movw r30, r0 fe40: 2b 9f mul r18, r27 fe42: f0 0d add r31, r0 fe44: 11 24 eor r1, r1 fe46: e0 0f add r30, r16 fe48: f1 1d adc r31, r1 fe4a: ee 0f add r30, r30 fe4c: ff 1f adc r31, r31 fe4e: ee 0f add r30, r30 fe50: ff 1f adc r31, r31 fe52: e7 5f subi r30, 0xF7 ; 247 fe54: fc 4e sbci r31, 0xEC ; 236 fe56: 60 e0 ldi r22, 0x00 ; 0 fe58: 70 e0 ldi r23, 0x00 ; 0 fe5a: 80 ec ldi r24, 0xC0 ; 192 fe5c: 9f e7 ldi r25, 0x7F ; 127 fe5e: 61 83 std Z+1, r22 ; 0x01 fe60: 72 83 std Z+2, r23 ; 0x02 fe62: 83 83 std Z+3, r24 ; 0x03 fe64: 94 83 std Z+4, r25 ; 0x04 fe66: 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) { fe68: e1 e3 ldi r30, 0x31 ; 49 fe6a: 3e 12 cpse r3, r30 fe6c: b7 cf rjmp .-146 ; 0xfddc custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; fe6e: 80 e0 ldi r24, 0x00 ; 0 fe70: 90 e0 ldi r25, 0x00 ; 0 fe72: a0 ea ldi r26, 0xA0 ; 160 fe74: b0 e4 ldi r27, 0x40 ; 64 fe76: 80 93 69 12 sts 0x1269, r24 ; 0x801269 fe7a: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a fe7e: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b fe82: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); fe86: 65 e5 ldi r22, 0x55 ; 85 fe88: 75 e5 ldi r23, 0x55 ; 85 fe8a: 85 e5 ldi r24, 0x55 ; 85 fe8c: 91 e4 ldi r25, 0x41 ; 65 fe8e: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); fe92: 0f 94 b0 18 call 0x23160 ; 0x23160 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { fe96: b1 e3 ldi r27, 0x31 ; 49 fe98: 3b 16 cp r3, r27 fe9a: 09 f4 brne .+2 ; 0xfe9e fe9c: 3c c2 rjmp .+1144 ; 0x10316 if (g80_fail_cnt++ >= 1) { fe9e: 80 91 3d 03 lds r24, 0x033D ; 0x80033d fea2: 91 e0 ldi r25, 0x01 ; 1 fea4: 98 0f add r25, r24 fea6: 90 93 3d 03 sts 0x033D, r25 ; 0x80033d feaa: 88 23 and r24, r24 feac: 09 f4 brne .+2 ; 0xfeb0 feae: d3 c1 rjmp .+934 ; 0x10256 print_stop(); feb0: 60 e0 ldi r22, 0x00 ; 0 feb2: 80 e0 ldi r24, 0x00 ; 0 feb4: 0e 94 ea dc call 0x1b9d4 ; 0x1b9d4 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); feb8: 84 e3 ldi r24, 0x34 ; 52 feba: 96 e3 ldi r25, 0x36 ; 54 febc: 0e 94 0a 75 call 0xea14 ; 0xea14 fec0: 0e 94 85 e8 call 0x1d10a ; 0x1d10a lcd_z_calibration_prompt(false); fec4: 80 e0 ldi r24, 0x00 ; 0 fec6: 0e 94 e3 e7 call 0x1cfc6 ; 0x1cfc6 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); feca: 81 e0 ldi r24, 0x01 ; 1 fecc: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); fed0: 86 ee ldi r24, 0xE6 ; 230 fed2: 9b e6 ldi r25, 0x6B ; 107 fed4: 0e 94 85 dc call 0x1b90a ; 0x1b90a custom_message_type = custom_message_type_old; fed8: 2f 81 ldd r18, Y+7 ; 0x07 feda: 20 93 5d 06 sts 0x065D, r18 ; 0x80065d custom_message_state = custom_message_state_old; fede: 68 85 ldd r22, Y+8 ; 0x08 fee0: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de lcd_update(2); fee4: 82 e0 ldi r24, 0x02 ; 2 fee6: 0e 94 c9 6e call 0xdd92 ; 0xdd92 st_synchronize(); feea: 0f 94 b0 18 call 0x23160 ; 0x23160 mesh_bed_leveling_flag = false; feee: 10 92 72 12 sts 0x1272, r1 ; 0x801272 fef2: d6 cd rjmp .-1108 ; 0xfaa0 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)) { fef4: 01 11 cpse r16, r1 fef6: 03 c0 rjmp .+6 ; 0xfefe fef8: 11 23 and r17, r17 fefa: 09 f4 brne .+2 ; 0xfefe fefc: bc ce rjmp .-648 ; 0xfc76 // 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))); fefe: 81 2f mov r24, r17 ff00: 63 e0 ldi r22, 0x03 ; 3 ff02: 0f 94 58 a4 call 0x348b0 ; 0x348b0 <__divmodqi4> ff06: 84 0d add r24, r4 ff08: 95 2d mov r25, r5 ff0a: 91 1d adc r25, r1 ff0c: 88 0f add r24, r24 ff0e: 99 1f adc r25, r25 ff10: 8d 53 subi r24, 0x3D ; 61 ff12: 90 4f sbci r25, 0xF0 ; 240 ff14: 0f 94 ab a3 call 0x34756 ; 0x34756 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; ff18: bc 01 movw r22, r24 ff1a: 99 0f add r25, r25 ff1c: 88 0b sbc r24, r24 ff1e: 99 0b sbc r25, r25 ff20: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> ff24: 2a e0 ldi r18, 0x0A ; 10 ff26: 37 ed ldi r19, 0xD7 ; 215 ff28: 43 e2 ldi r20, 0x23 ; 35 ff2a: 5c e3 ldi r21, 0x3C ; 60 ff2c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> ff30: 9b 01 movw r18, r22 ff32: ac 01 movw r20, r24 ff34: 60 91 0a 13 lds r22, 0x130A ; 0x80130a ff38: 70 91 0b 13 lds r23, 0x130B ; 0x80130b ff3c: 80 91 0c 13 lds r24, 0x130C ; 0x80130c ff40: 90 91 0d 13 lds r25, 0x130D ; 0x80130d ff44: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> ff48: f3 01 movw r30, r6 ff4a: 61 83 std Z+1, r22 ; 0x01 ff4c: 72 83 std Z+2, r23 ; 0x02 ff4e: 83 83 std Z+3, r24 ; 0x03 ff50: 94 83 std Z+4, r25 ; 0x04 ff52: 91 ce rjmp .-734 ; 0xfc76 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)) { ff54: fe 85 ldd r31, Y+14 ; 0x0e ff56: ff 23 and r31, r31 ff58: 09 f4 brne .+2 ; 0xff5c ff5a: 02 cf rjmp .-508 ; 0xfd60 ff5c: 22 20 and r2, r2 ff5e: 09 f4 brne .+2 ; 0xff62 ff60: fe ce rjmp .-516 ; 0xfd5e ff62: fe ce rjmp .-516 ; 0xfd60 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)) { ff64: 28 89 ldd r18, Y+16 ; 0x10 ff66: 39 89 ldd r19, Y+17 ; 0x11 ff68: 4a 89 ldd r20, Y+18 ; 0x12 ff6a: 5b 89 ldd r21, Y+19 ; 0x13 ff6c: 6a 85 ldd r22, Y+10 ; 0x0a ff6e: 7b 85 ldd r23, Y+11 ; 0x0b ff70: 8c 85 ldd r24, Y+12 ; 0x0c ff72: 9d 85 ldd r25, Y+13 ; 0x0d ff74: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> ff78: 18 16 cp r1, r24 ff7a: 04 f1 brlt .+64 ; 0xffbc ff7c: 28 89 ldd r18, Y+16 ; 0x10 ff7e: 39 89 ldd r19, Y+17 ; 0x11 ff80: 4a 89 ldd r20, Y+18 ; 0x12 ff82: 5b 89 ldd r21, Y+19 ; 0x13 ff84: 69 8d ldd r22, Y+25 ; 0x19 ff86: 7a 8d ldd r23, Y+26 ; 0x1a ff88: 8b 8d ldd r24, Y+27 ; 0x1b ff8a: 9c 8d ldd r25, Y+28 ; 0x1c ff8c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> ff90: 87 fd sbrc r24, 7 ff92: 14 c0 rjmp .+40 ; 0xffbc ff94: a5 01 movw r20, r10 ff96: 94 01 movw r18, r8 ff98: 6c 89 ldd r22, Y+20 ; 0x14 ff9a: 7d 89 ldd r23, Y+21 ; 0x15 ff9c: 8e 89 ldd r24, Y+22 ; 0x16 ff9e: 9f 89 ldd r25, Y+23 ; 0x17 ffa0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> ffa4: 18 16 cp r1, r24 ffa6: 54 f0 brlt .+20 ; 0xffbc ffa8: a5 01 movw r20, r10 ffaa: 94 01 movw r18, r8 ffac: 6d 8d ldd r22, Y+29 ; 0x1d ffae: 7e 8d ldd r23, Y+30 ; 0x1e ffb0: 8f 8d ldd r24, Y+31 ; 0x1f ffb2: 98 a1 ldd r25, Y+32 ; 0x20 ffb4: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> ffb8: 87 ff sbrs r24, 7 ffba: 05 c0 rjmp .+10 ; 0xffc6 ffbc: 11 23 and r17, r17 ffbe: 09 f4 brne .+2 ; 0xffc2 ffc0: 52 cf rjmp .-348 ; 0xfe66 ffc2: 21 10 cpse r2, r1 ffc4: 50 cf rjmp .-352 ; 0xfe66 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; ffc6: 10 e0 ldi r17, 0x00 ; 0 ffc8: a7 e0 ldi r26, 0x07 ; 7 ffca: 8e 85 ldd r24, Y+14 ; 0x0e ffcc: 9f 85 ldd r25, Y+15 ; 0x0f ffce: a8 9f mul r26, r24 ffd0: f0 01 movw r30, r0 ffd2: a9 9f mul r26, r25 ffd4: f0 0d add r31, r0 ffd6: 11 24 eor r1, r1 ffd8: e0 0f add r30, r16 ffda: f1 1f adc r31, r17 ffdc: ee 0f add r30, r30 ffde: ff 1f adc r31, r31 ffe0: ee 0f add r30, r30 ffe2: ff 1f adc r31, r31 ffe4: e7 5f subi r30, 0xF7 ; 247 ffe6: fc 4e sbci r31, 0xEC ; 236 ffe8: 41 80 ldd r4, Z+1 ; 0x01 ffea: 52 80 ldd r5, Z+2 ; 0x02 ffec: 63 80 ldd r6, Z+3 ; 0x03 ffee: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; fff0: c1 2c mov r12, r1 fff2: d1 2c mov r13, r1 fff4: e0 ea ldi r30, 0xA0 ; 160 fff6: ee 2e mov r14, r30 fff8: e0 e4 ldi r30, 0x40 ; 64 fffa: fe 2e mov r15, r30 fffc: 22 20 and r2, r2 fffe: 51 f0 breq .+20 ; 0x10014 10000: 23 e3 ldi r18, 0x33 ; 51 10002: 33 e3 ldi r19, 0x33 ; 51 10004: 43 eb ldi r20, 0xB3 ; 179 10006: 5e e3 ldi r21, 0x3E ; 62 10008: c3 01 movw r24, r6 1000a: b2 01 movw r22, r4 1000c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 10010: 6b 01 movw r12, r22 10012: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 10014: a7 01 movw r20, r14 10016: 96 01 movw r18, r12 10018: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1001c: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 10020: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 10024: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 10028: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1002c: 87 ff sbrs r24, 7 1002e: 10 c0 rjmp .+32 ; 0x10050 current_position[Z_AXIS] = init_z_bckp; 10030: c0 92 69 12 sts 0x1269, r12 ; 0x801269 10034: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 10038: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 1003c: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10040: 65 e5 ldi r22, 0x55 ; 85 10042: 75 e5 ldi r23, 0x55 ; 85 10044: 85 e5 ldi r24, 0x55 ; 85 10046: 91 e4 ldi r25, 0x41 ; 65 10048: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1004c: 0f 94 b0 18 call 0x23160 ; 0x23160 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 10050: 68 89 ldd r22, Y+16 ; 0x10 10052: 79 89 ldd r23, Y+17 ; 0x11 10054: 8a 89 ldd r24, Y+18 ; 0x12 10056: 9b 89 ldd r25, Y+19 ; 0x13 10058: 60 93 61 12 sts 0x1261, r22 ; 0x801261 1005c: 70 93 62 12 sts 0x1262, r23 ; 0x801262 10060: 80 93 63 12 sts 0x1263, r24 ; 0x801263 10064: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = y_pos; 10068: 80 92 65 12 sts 0x1265, r8 ; 0x801265 1006c: 90 92 66 12 sts 0x1266, r9 ; 0x801266 10070: a0 92 67 12 sts 0x1267, r10 ; 0x801267 10074: b0 92 68 12 sts 0x1268, r11 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 10078: 65 e6 ldi r22, 0x65 ; 101 1007a: 72 e1 ldi r23, 0x12 ; 18 1007c: 81 e6 ldi r24, 0x61 ; 97 1007e: 92 e1 ldi r25, 0x12 ; 18 10080: 0e 94 ee 68 call 0xd1dc ; 0xd1dc plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 10084: 60 e0 ldi r22, 0x00 ; 0 10086: 70 e0 ldi r23, 0x00 ; 0 10088: 86 e1 ldi r24, 0x16 ; 22 1008a: 93 e4 ldi r25, 0x43 ; 67 1008c: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 10090: 0f 94 b0 18 call 0x23160 ; 0x23160 if (planner_aborted) 10094: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 10098: 88 23 and r24, r24 1009a: 39 f0 breq .+14 ; 0x100aa { custom_message_type = custom_message_type_old; 1009c: 7f 81 ldd r23, Y+7 ; 0x07 1009e: 70 93 5d 06 sts 0x065D, r23 ; 0x80065d custom_message_state = custom_message_state_old; 100a2: 88 85 ldd r24, Y+8 ; 0x08 100a4: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de 100a8: fb cc rjmp .-1546 ; 0xfaa0 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 100aa: 81 2c mov r8, r1 100ac: 91 2c mov r9, r1 100ae: 70 e2 ldi r23, 0x20 ; 32 100b0: a7 2e mov r10, r23 100b2: 71 ec ldi r23, 0xC1 ; 193 100b4: b7 2e mov r11, r23 100b6: 22 20 and r2, r2 100b8: 51 f0 breq .+20 ; 0x100ce 100ba: 2a 81 ldd r18, Y+2 ; 0x02 100bc: 3b 81 ldd r19, Y+3 ; 0x03 100be: 4c 81 ldd r20, Y+4 ; 0x04 100c0: 5d 81 ldd r21, Y+5 ; 0x05 100c2: c3 01 movw r24, r6 100c4: b2 01 movw r22, r4 100c6: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 100ca: 4b 01 movw r8, r22 100cc: 5c 01 movw r10, r24 100ce: 48 8d ldd r20, Y+24 ; 0x18 100d0: c5 01 movw r24, r10 100d2: b4 01 movw r22, r8 100d4: 0f 94 aa 7b call 0x2f754 ; 0x2f754 100d8: 81 11 cpse r24, r1 100da: 0b c0 rjmp .+22 ; 0x100f2 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)); 100dc: 80 ea ldi r24, 0xA0 ; 160 100de: 95 e5 ldi r25, 0x55 ; 85 100e0: 0e 94 0a 75 call 0xea14 ; 0xea14 100e4: 9f 93 push r25 100e6: 8f 93 push r24 100e8: 0f 94 5f a2 call 0x344be ; 0x344be 100ec: 0f 90 pop r0 100ee: 0f 90 pop r0 100f0: be ce rjmp .-644 ; 0xfe6e // 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. 100f2: 20 91 69 12 lds r18, 0x1269 ; 0x801269 100f6: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 100fa: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 100fe: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 10102: c7 01 movw r24, r14 10104: b6 01 movw r22, r12 10106: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1010a: 20 e0 ldi r18, 0x00 ; 0 1010c: 30 e0 ldi r19, 0x00 ; 0 1010e: a9 01 movw r20, r18 10110: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 10114: 87 ff sbrs r24, 7 10116: 36 c0 rjmp .+108 ; 0x10184 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10118: 60 e0 ldi r22, 0x00 ; 0 1011a: 70 e0 ldi r23, 0x00 ; 0 1011c: 80 ea ldi r24, 0xA0 ; 160 1011e: 90 e4 ldi r25, 0x40 ; 64 10120: 60 93 69 12 sts 0x1269, r22 ; 0x801269 10124: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 10128: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1012c: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10130: 65 e5 ldi r22, 0x55 ; 85 10132: 75 e5 ldi r23, 0x55 ; 85 10134: 85 e5 ldi r24, 0x55 ; 85 10136: 91 e4 ldi r25, 0x41 ; 65 10138: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1013c: 0f 94 b0 18 call 0x23160 ; 0x23160 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 10140: 48 8d ldd r20, Y+24 ; 0x18 10142: c5 01 movw r24, r10 10144: b4 01 movw r22, r8 10146: 0f 94 aa 7b call 0x2f754 ; 0x2f754 1014a: 88 23 and r24, r24 1014c: 39 f2 breq .-114 ; 0x100dc printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 1014e: 20 91 69 12 lds r18, 0x1269 ; 0x801269 10152: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 10156: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 1015a: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 1015e: 60 e0 ldi r22, 0x00 ; 0 10160: 70 e0 ldi r23, 0x00 ; 0 10162: 80 ea ldi r24, 0xA0 ; 160 10164: 90 e4 ldi r25, 0x40 ; 64 10166: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1016a: 2d ec ldi r18, 0xCD ; 205 1016c: 3c ec ldi r19, 0xCC ; 204 1016e: 4c ec ldi r20, 0xCC ; 204 10170: 5d e3 ldi r21, 0x3D ; 61 10172: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 10176: 87 ff sbrs r24, 7 10178: 05 c0 rjmp .+10 ; 0x10184 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 1017a: 87 e3 ldi r24, 0x37 ; 55 1017c: 97 e7 ldi r25, 0x77 ; 119 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")); 1017e: 0f 94 86 a2 call 0x3450c ; 0x3450c 10182: 75 ce rjmp .-790 ; 0xfe6e 10184: c0 90 69 12 lds r12, 0x1269 ; 0x801269 10188: d0 90 6a 12 lds r13, 0x126A ; 0x80126a 1018c: e0 90 6b 12 lds r14, 0x126B ; 0x80126b 10190: f0 90 6c 12 lds r15, 0x126C ; 0x80126c 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 10194: 22 20 and r2, r2 10196: a1 f0 breq .+40 ; 0x101c0 10198: a7 01 movw r20, r14 1019a: 96 01 movw r18, r12 1019c: c3 01 movw r24, r6 1019e: b2 01 movw r22, r4 101a0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 101a4: 9b 01 movw r18, r22 101a6: ac 01 movw r20, r24 101a8: 5f 77 andi r21, 0x7F ; 127 101aa: 6a 81 ldd r22, Y+2 ; 0x02 101ac: 7b 81 ldd r23, Y+3 ; 0x03 101ae: 8c 81 ldd r24, Y+4 ; 0x04 101b0: 9d 81 ldd r25, Y+5 ; 0x05 101b2: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 101b6: 87 ff sbrs r24, 7 101b8: 03 c0 rjmp .+6 ; 0x101c0 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 101ba: 8e ef ldi r24, 0xFE ; 254 101bc: 96 e7 ldi r25, 0x76 ; 118 101be: df cf rjmp .-66 ; 0x1017e } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 101c0: 8f ea ldi r24, 0xAF ; 175 101c2: 9f e0 ldi r25, 0x0F ; 15 101c4: 0f 94 9d a3 call 0x3473a ; 0x3473a 101c8: 88 23 and r24, r24 101ca: 09 f4 brne .+2 ; 0x101ce 101cc: 40 c0 rjmp .+128 ; 0x1024e 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); } 101ce: 86 ea ldi r24, 0xA6 ; 166 101d0: 9f e0 ldi r25, 0x0F ; 15 101d2: 0f 94 9d a3 call 0x3473a ; 0x3473a if (!calibration_status_pinda()) return 0; 101d6: 88 23 and r24, r24 101d8: d1 f1 breq .+116 ; 0x1024e return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 101da: 60 91 85 03 lds r22, 0x0385 ; 0x800385 101de: 70 91 86 03 lds r23, 0x0386 ; 0x800386 101e2: 80 91 87 03 lds r24, 0x0387 ; 0x800387 101e6: 90 91 88 03 lds r25, 0x0388 ; 0x800388 101ea: 0e 94 86 56 call 0xad0c ; 0xad0c 101ee: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 101f2: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 101f6: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 101fa: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 101fe: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 10202: 9b 01 movw r18, r22 10204: ac 01 movw r20, r24 10206: e7 e0 ldi r30, 0x07 ; 7 10208: ae 85 ldd r26, Y+14 ; 0x0e 1020a: bf 85 ldd r27, Y+15 ; 0x0f 1020c: ea 9f mul r30, r26 1020e: c0 01 movw r24, r0 10210: eb 9f mul r30, r27 10212: 90 0d add r25, r0 10214: 11 24 eor r1, r1 10216: 08 0f add r16, r24 10218: 19 1f adc r17, r25 1021a: 00 0f add r16, r16 1021c: 11 1f adc r17, r17 1021e: 00 0f add r16, r16 10220: 11 1f adc r17, r17 10222: 07 5f subi r16, 0xF7 ; 247 10224: 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; 10226: c7 01 movw r24, r14 10228: b6 01 movw r22, r12 1022a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1022e: d8 01 movw r26, r16 10230: 11 96 adiw r26, 0x01 ; 1 10232: 6d 93 st X+, r22 10234: 7d 93 st X+, r23 10236: 8d 93 st X+, r24 10238: 9c 93 st X, r25 1023a: 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--; 1023c: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 10240: 81 50 subi r24, 0x01 ; 1 10242: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de mesh_point++; lcd_update(1); 10246: 81 e0 ldi r24, 0x01 ; 1 10248: 0e 94 c9 6e call 0xdd92 ; 0xdd92 1024c: 0c ce rjmp .-1000 ; 0xfe66 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 1024e: 20 e0 ldi r18, 0x00 ; 0 10250: 30 e0 ldi r19, 0x00 ; 0 10252: a9 01 movw r20, r18 10254: d8 cf rjmp .-80 ; 0x10206 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); 10256: 85 e0 ldi r24, 0x05 ; 5 10258: 0f 94 62 23 call 0x246c4 ; 0x246c4 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; 1025c: c1 2c mov r12, r1 1025e: d1 2c mov r13, r1 10260: 90 ea ldi r25, 0xA0 ; 160 10262: e9 2e mov r14, r25 10264: 90 e4 ldi r25, 0x40 ; 64 10266: 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)); 10268: 80 e0 ldi r24, 0x00 ; 0 1026a: 96 e3 ldi r25, 0x36 ; 54 1026c: 0e 94 0a 75 call 0xea14 ; 0xea14 10270: 0e 94 9a de call 0x1bd34 ; 0x1bd34 #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) #else // TMC2130 lcd_wait_for_click_delay(0); // ~ no timeout 10274: 90 e0 ldi r25, 0x00 ; 0 10276: 80 e0 ldi r24, 0x00 ; 0 10278: 0e 94 b3 dd call 0x1bb66 ; 0x1bb66 lcd_calibrate_z_end_stop_manual(true); // Z-leveling (X-assembly stay up!!!) 1027c: 81 e0 ldi r24, 0x01 ; 1 1027e: 0e 94 c5 f9 call 0x1f38a ; 0x1f38a #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); 10282: 80 e0 ldi r24, 0x00 ; 0 10284: 0f 94 3d 23 call 0x2467a ; 0x2467a 10288: 18 2f mov r17, r24 raise_z(-1); 1028a: 60 e0 ldi r22, 0x00 ; 0 1028c: 70 e0 ldi r23, 0x00 ; 0 1028e: 80 e8 ldi r24, 0x80 ; 128 10290: 9f eb ldi r25, 0xBF ; 191 10292: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 enable_z_endstop(true); 10296: 81 e0 ldi r24, 0x01 ; 1 10298: 0f 94 3d 23 call 0x2467a ; 0x2467a #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1029c: c0 92 69 12 sts 0x1269, r12 ; 0x801269 102a0: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 102a4: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 102a8: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 102ac: 65 e5 ldi r22, 0x55 ; 85 102ae: 75 e5 ldi r23, 0x55 ; 85 102b0: 85 e5 ldi r24, 0x55 ; 85 102b2: 91 e4 ldi r25, 0x41 ; 65 102b4: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 102b8: 0f 94 b0 18 call 0x23160 ; 0x23160 #ifdef TMC2130 tmc2130_home_exit(); #endif // TMC2130 enable_z_endstop(bState); 102bc: 81 2f mov r24, r17 102be: 0f 94 3d 23 call 0x2467a ; 0x2467a } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 102c2: 82 e0 ldi r24, 0x02 ; 2 102c4: 0f 94 9c 18 call 0x23138 ; 0x23138 102c8: 20 e0 ldi r18, 0x00 ; 0 102ca: 30 e0 ldi r19, 0x00 ; 0 102cc: 40 ea ldi r20, 0xA0 ; 160 102ce: 50 e4 ldi r21, 0x40 ; 64 102d0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 102d4: 18 16 cp r1, r24 102d6: 44 f2 brlt .-112 ; 0x10268 custom_message_type = custom_message_type_old; 102d8: ef 81 ldd r30, Y+7 ; 0x07 102da: e0 93 5d 06 sts 0x065D, r30 ; 0x80065d custom_message_state = custom_message_state_old; 102de: f8 85 ldd r31, Y+8 ; 0x08 102e0: f0 93 de 03 sts 0x03DE, r31 ; 0x8003de lcd_update_enable(true); // display / status-line recovery 102e4: 81 e0 ldi r24, 0x01 ; 1 102e6: 0e 94 08 70 call 0xe010 ; 0xe010 static void gcode_G28(bool home_x_axis, bool home_y_axis, bool home_z_axis) { #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); 102ea: dd 24 eor r13, r13 102ec: d3 94 inc r13 102ee: df 92 push r13 102f0: 81 2c mov r8, r1 102f2: 91 2c mov r9, r1 102f4: 54 01 movw r10, r8 102f6: cc 24 eor r12, r12 102f8: c3 94 inc r12 102fa: e1 2c mov r14, r1 102fc: f1 2c mov r15, r1 102fe: 87 01 movw r16, r14 10300: 21 e0 ldi r18, 0x01 ; 1 10302: 40 e0 ldi r20, 0x00 ; 0 10304: 50 e0 ldi r21, 0x00 ; 0 10306: ba 01 movw r22, r20 10308: 81 e0 ldi r24, 0x01 ; 1 1030a: 0e 94 fa 6c call 0xd9f4 ; 0xd9f4 1030e: d0 92 53 12 sts 0x1253, r13 ; 0x801253 10312: 0f 90 pop r0 10314: c5 cb rjmp .-2166 ; 0xfaa0 lcd_update_enable(true); // display / status-line recovery gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 10316: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d clean_up_after_endstop_move(l_feedmultiply); 1031a: 8b a1 ldd r24, Y+35 ; 0x23 1031c: 9c a1 ldd r25, Y+36 ; 0x24 1031e: 0e 94 1c 65 call 0xca38 ; 0xca38 // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 10322: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.453+0x1> 10326: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.453> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1032a: 80 e1 ldi r24, 0x10 ; 16 1032c: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 10330: 88 23 and r24, r24 10332: 91 f0 breq .+36 ; 0x10358 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 10334: 0e 94 ec 7c call 0xf9d8 ; 0xf9d8 // 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))); 10338: 81 ea ldi r24, 0xA1 ; 161 1033a: 9d e0 ldi r25, 0x0D ; 13 1033c: 0f 94 9d a3 call 0x3473a ; 0x3473a 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-> 10340: 2b e0 ldi r18, 0x0B ; 11 10342: 82 9f mul r24, r18 10344: c0 01 movw r24, r0 10346: 11 24 eor r1, r1 10348: 80 5b subi r24, 0xB0 ; 176 1034a: 92 4f sbci r25, 0xF2 ; 242 1034c: 0f 94 ab a3 call 0x34756 ; 0x34756 10350: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.453+0x1> 10354: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.453> } void babystep_apply() { babystep_load(); shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 10358: 60 91 26 06 lds r22, 0x0626 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.453> 1035c: 70 91 27 06 lds r23, 0x0627 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.453+0x1> 10360: 07 2e mov r0, r23 10362: 00 0c add r0, r0 10364: 88 0b sbc r24, r24 10366: 99 0b sbc r25, r25 10368: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1036c: 90 58 subi r25, 0x80 ; 128 1036e: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 10372: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 10376: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1037a: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1037e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 10382: 0f 94 70 52 call 0x2a4e0 ; 0x2a4e0 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; 10386: 80 ec ldi r24, 0xC0 ; 192 10388: 9f e0 ldi r25, 0x0F ; 15 1038a: 0f 94 9d a3 call 0x3473a ; 0x3473a 1038e: 91 e0 ldi r25, 0x01 ; 1 10390: 81 30 cpi r24, 0x01 ; 1 10392: 09 f0 breq .+2 ; 0x10396 10394: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 10396: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 10398: 4f eb ldi r20, 0xBF ; 191 1039a: 5f e0 ldi r21, 0x0F ; 15 1039c: 6c e4 ldi r22, 0x4C ; 76 1039e: ce 01 movw r24, r28 103a0: 01 96 adiw r24, 0x01 ; 1 103a2: 0e 94 24 56 call 0xac48 ; 0xac48 103a6: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 103a8: 4e eb ldi r20, 0xBE ; 190 103aa: 5f e0 ldi r21, 0x0F ; 15 103ac: 62 e5 ldi r22, 0x52 ; 82 103ae: ce 01 movw r24, r28 103b0: 01 96 adiw r24, 0x01 ; 1 103b2: 0e 94 24 56 call 0xac48 ; 0xac48 103b6: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 103b8: 4d eb ldi r20, 0xBD ; 189 103ba: 5f e0 ldi r21, 0x0F ; 15 103bc: 66 e4 ldi r22, 0x46 ; 70 103be: ce 01 movw r24, r28 103c0: 01 96 adiw r24, 0x01 ; 1 103c2: 0e 94 24 56 call 0xac48 ; 0xac48 103c6: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 103c8: 4c eb ldi r20, 0xBC ; 188 103ca: 5f e0 ldi r21, 0x0F ; 15 103cc: 62 e4 ldi r22, 0x42 ; 66 103ce: ce 01 movw r24, r28 103d0: 01 96 adiw r24, 0x01 ; 1 103d2: 0e 94 24 56 call 0xac48 ; 0xac48 103d6: 21 2f mov r18, r17 103d8: 11 0f add r17, r17 103da: 33 0b sbc r19, r19 103dc: 08 2e mov r0, r24 103de: 00 0c add r0, r0 103e0: 99 0b sbc r25, r25 103e2: 5c 01 movw r10, r24 103e4: a2 1a sub r10, r18 103e6: b3 0a sbc r11, r19 103e8: 8f 2d mov r24, r15 103ea: ff 0c add r15, r15 103ec: 99 0b sbc r25, r25 103ee: 28 0f add r18, r24 103f0: 39 1f adc r19, r25 103f2: 46 e0 ldi r20, 0x06 ; 6 103f4: 42 9f mul r20, r18 103f6: 60 01 movw r12, r0 103f8: 43 9f mul r20, r19 103fa: d0 0c add r13, r0 103fc: 11 24 eor r1, r1 103fe: f1 2c mov r15, r1 10400: e1 2c mov r14, r1 10402: 00 2e mov r0, r16 10404: 00 0c add r0, r0 10406: 11 0b sbc r17, r17 10408: 08 1b sub r16, r24 1040a: 19 0b sbc r17, r25 1040c: b7 01 movw r22, r14 1040e: 66 5f subi r22, 0xF6 ; 246 10410: 7c 4e sbci r23, 0xEC ; 236 10412: 3b 01 movw r6, r22 10414: 46 01 movw r8, r12 10416: 77 e0 ldi r23, 0x07 ; 7 10418: 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 * ( 1041a: d3 01 movw r26, r6 1041c: 2d 90 ld r2, X+ 1041e: 3d 90 ld r3, X+ 10420: 4d 90 ld r4, X+ 10422: 5d 90 ld r5, X+ 10424: 3d 01 movw r6, r26 10426: fd 01 movw r30, r26 10428: 34 97 sbiw r30, 0x04 ; 4 1042a: fb 87 std Y+11, r31 ; 0x0b 1042c: ea 87 std Y+10, r30 ; 0x0a 1042e: b4 01 movw r22, r8 10430: 09 2c mov r0, r9 10432: 00 0c add r0, r0 10434: 88 0b sbc r24, r24 10436: 99 0b sbc r25, r25 10438: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1043c: 2f e3 ldi r18, 0x3F ; 63 1043e: 33 ec ldi r19, 0xC3 ; 195 10440: 4e e2 ldi r20, 0x2E ; 46 10442: 59 e3 ldi r21, 0x39 ; 57 10444: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 10448: a2 01 movw r20, r4 1044a: 91 01 movw r18, r2 1044c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 10450: aa 85 ldd r26, Y+10 ; 0x0a 10452: bb 85 ldd r27, Y+11 ; 0x0b 10454: 6d 93 st X+, r22 10456: 7d 93 st X+, r23 10458: 8d 93 st X+, r24 1045a: 9c 93 st X, r25 1045c: 13 97 sbiw r26, 0x03 ; 3 1045e: ba 81 ldd r27, Y+2 ; 0x02 10460: b1 50 subi r27, 0x01 ; 1 10462: ba 83 std Y+2, r27 ; 0x02 10464: 80 0e add r8, r16 10466: 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++) { 10468: b1 11 cpse r27, r1 1046a: d7 cf rjmp .-82 ; 0x1041a 1046c: ca 0c add r12, r10 1046e: db 1c adc r13, r11 10470: ec e1 ldi r30, 0x1C ; 28 10472: ee 0e add r14, r30 10474: 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++) { 10476: f4 ec ldi r31, 0xC4 ; 196 10478: ef 16 cp r14, r31 1047a: f1 04 cpc r15, r1 1047c: 39 f6 brne .-114 ; 0x1040c + 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) 1047e: 0f 94 7a 92 call 0x324f4 ; 0x324f4 { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 10482: 8d e4 ldi r24, 0x4D ; 77 10484: 0e 94 f5 55 call 0xabea ; 0xabea 10488: 88 23 and r24, r24 1048a: 09 f4 brne .+2 ; 0x1048e 1048c: 84 c0 rjmp .+264 ; 0x10596 1048e: 0e 94 0a 56 call 0xac14 ; 0xac14 if (nMeasPoints == 7 && useMagnetCompensation) { 10492: 2e 81 ldd r18, Y+6 ; 0x06 10494: 27 30 cpi r18, 0x07 ; 7 10496: 09 f0 breq .+2 ; 0x1049a 10498: 94 c0 rjmp .+296 ; 0x105c2 1049a: 88 23 and r24, r24 1049c: 09 f4 brne .+2 ; 0x104a0 1049e: 91 c0 rjmp .+290 ; 0x105c2 104a0: bb 24 eor r11, r11 104a2: b3 94 inc r11 104a4: aa 24 eor r10, r10 104a6: aa 94 dec r10 104a8: ab 0c add r10, r11 104aa: 09 a1 ldd r16, Y+33 ; 0x21 104ac: 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++) { 104ae: 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++; } 104b0: 8e ef ldi r24, 0xFE ; 254 104b2: 88 2e mov r8, r24 104b4: 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)) { 104b6: 6a 2d mov r22, r10 104b8: 86 2d mov r24, r6 104ba: 0f 94 3b 52 call 0x2a476 ; 0x2a476 104be: 99 24 eor r9, r9 104c0: 93 94 inc r9 104c2: 96 0c add r9, r6 104c4: 81 11 cpse r24, r1 104c6: 6e c0 rjmp .+220 ; 0x105a4 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++; } 104c8: 6b 2d mov r22, r11 104ca: 86 2d mov r24, r6 104cc: 0f 94 3b 52 call 0x2a476 ; 0x2a476 } 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; 104d0: c1 2c mov r12, r1 104d2: d1 2c mov r13, r1 104d4: 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; 104d6: 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++; } 104d8: 88 23 and r24, r24 104da: 81 f0 breq .+32 ; 0x104fc 104dc: 20 e0 ldi r18, 0x00 ; 0 104de: 30 e0 ldi r19, 0x00 ; 0 104e0: a9 01 movw r20, r18 104e2: d8 01 movw r26, r16 104e4: 5d 96 adiw r26, 0x1d ; 29 104e6: 6d 91 ld r22, X+ 104e8: 7d 91 ld r23, X+ 104ea: 8d 91 ld r24, X+ 104ec: 9c 91 ld r25, X 104ee: 90 97 sbiw r26, 0x20 ; 32 104f0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 104f4: 6b 01 movw r12, r22 104f6: 7c 01 movw r14, r24 104f8: 77 24 eor r7, r7 104fa: 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++; } 104fc: 68 2d mov r22, r8 104fe: 86 2d mov r24, r6 10500: 0f 94 3b 52 call 0x2a476 ; 0x2a476 10504: 88 23 and r24, r24 10506: 69 f0 breq .+26 ; 0x10522 10508: f8 01 movw r30, r16 1050a: 7b 97 sbiw r30, 0x1b ; 27 1050c: 20 81 ld r18, Z 1050e: 31 81 ldd r19, Z+1 ; 0x01 10510: 42 81 ldd r20, Z+2 ; 0x02 10512: 53 81 ldd r21, Z+3 ; 0x03 10514: c7 01 movw r24, r14 10516: b6 01 movw r22, r12 10518: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1051c: 6b 01 movw r12, r22 1051e: 7c 01 movw r14, r24 10520: 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++; } 10522: 6a 2d mov r22, r10 10524: 89 2d mov r24, r9 10526: 0f 94 3b 52 call 0x2a476 ; 0x2a476 1052a: 88 23 and r24, r24 1052c: 61 f0 breq .+24 ; 0x10546 1052e: f8 01 movw r30, r16 10530: 25 81 ldd r18, Z+5 ; 0x05 10532: 36 81 ldd r19, Z+6 ; 0x06 10534: 47 81 ldd r20, Z+7 ; 0x07 10536: 50 85 ldd r21, Z+8 ; 0x08 10538: c7 01 movw r24, r14 1053a: b6 01 movw r22, r12 1053c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 10540: 6b 01 movw r12, r22 10542: 7c 01 movw r14, r24 10544: 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++; } 10546: 6a 2d mov r22, r10 10548: 8f ef ldi r24, 0xFF ; 255 1054a: 86 0d add r24, r6 1054c: 0f 94 3b 52 call 0x2a476 ; 0x2a476 10550: 88 23 and r24, r24 10552: 31 f1 breq .+76 ; 0x105a0 10554: f8 01 movw r30, r16 10556: 33 97 sbiw r30, 0x03 ; 3 10558: 20 81 ld r18, Z 1055a: 31 81 ldd r19, Z+1 ; 0x01 1055c: 42 81 ldd r20, Z+2 ; 0x02 1055e: 53 81 ldd r21, Z+3 ; 0x03 10560: c7 01 movw r24, r14 10562: b6 01 movw r22, r12 10564: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 10568: 6b 01 movw r12, r22 1056a: 7c 01 movw r14, r24 1056c: 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 1056e: 67 2d mov r22, r7 10570: 70 e0 ldi r23, 0x00 ; 0 10572: 90 e0 ldi r25, 0x00 ; 0 10574: 80 e0 ldi r24, 0x00 ; 0 10576: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1057a: 9b 01 movw r18, r22 1057c: ac 01 movw r20, r24 1057e: c7 01 movw r24, r14 10580: b6 01 movw r22, r12 10582: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 10586: d8 01 movw r26, r16 10588: 11 96 adiw r26, 0x01 ; 1 1058a: 6d 93 st X+, r22 1058c: 7d 93 st X+, r23 1058e: 8d 93 st X+, r24 10590: 9c 93 st X, r25 10592: 14 97 sbiw r26, 0x04 ; 4 10594: 07 c0 rjmp .+14 ; 0x105a4 } 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); 10596: 8c ea ldi r24, 0xAC ; 172 10598: 9d e0 ldi r25, 0x0D ; 13 1059a: 0f 94 9d a3 call 0x3473a ; 0x3473a 1059e: 79 cf rjmp .-270 ; 0x10492 105a0: 71 10 cpse r7, r1 105a2: e5 cf rjmp .-54 ; 0x1056e //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++) { 105a4: 69 2c mov r6, r9 105a6: 0c 5f subi r16, 0xFC ; 252 105a8: 1f 4f sbci r17, 0xFF ; 255 105aa: b7 e0 ldi r27, 0x07 ; 7 105ac: 9b 12 cpse r9, r27 105ae: 83 cf rjmp .-250 ; 0x104b6 105b0: b3 94 inc r11 105b2: e9 a1 ldd r30, Y+33 ; 0x21 105b4: fa a1 ldd r31, Y+34 ; 0x22 105b6: 7c 96 adiw r30, 0x1c ; 28 105b8: fa a3 std Y+34, r31 ; 0x22 105ba: 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++) { 105bc: f8 e0 ldi r31, 0x08 ; 8 105be: bf 12 cpse r11, r31 105c0: 71 cf rjmp .-286 ; 0x104a4 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 105c2: 81 e0 ldi r24, 0x01 ; 1 105c4: 80 93 09 13 sts 0x1309, r24 ; 0x801309 if (code_seen('O') && !code_value_uint8()) { 105c8: 8f e4 ldi r24, 0x4F ; 79 105ca: 0e 94 f5 55 call 0xabea ; 0xabea 105ce: 81 11 cpse r24, r1 105d0: 03 c0 rjmp .+6 ; 0x105d8 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 105d2: 0e 94 0d 6a call 0xd41a ; 0xd41a 105d6: 79 cc rjmp .-1806 ; 0xfeca } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 105d8: 0e 94 0a 56 call 0xac14 ; 0xac14 105dc: 81 11 cpse r24, r1 105de: f9 cf rjmp .-14 ; 0x105d2 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 105e0: 0e 94 11 65 call 0xca22 ; 0xca22 105e4: 72 cc rjmp .-1820 ; 0xfeca 000105e6 : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { 105e6: ec 01 movw r28, r24 cli(); // Stop interrupts 105e8: f8 94 cli disable_heater(); 105ea: 0f 94 3d 0e call 0x21c7a ; 0x21c7a disable_x(); 105ee: 17 9a sbi 0x02, 7 ; 2 105f0: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 105f4: 16 9a sbi 0x02, 6 ; 2 105f6: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a poweroff_z(); disable_e0(); 105fa: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; 105fc: 81 eb ldi r24, 0xB1 ; 177 105fe: 91 ea ldi r25, 0xA1 ; 161 10600: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); 10604: 86 e0 ldi r24, 0x06 ; 6 10606: 98 e7 ldi r25, 0x78 ; 120 10608: 0e 94 8d 7c call 0xf91a ; 0xf91a if (full_screen_message != NULL) { 1060c: 20 97 sbiw r28, 0x00 ; 0 1060e: 79 f0 breq .+30 ; 0x1062e SERIAL_ERRORLNRPGM(full_screen_message); 10610: ce 01 movw r24, r28 10612: 0e 94 8d 7c call 0xf91a ; 0xf91a 10616: be 01 movw r22, r28 10618: 85 e9 ldi r24, 0x95 ; 149 1061a: 9c e0 ldi r25, 0x0C ; 12 1061c: 0f 94 fb a3 call 0x347f6 ; 0x347f6 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); 10620: 62 e4 ldi r22, 0x42 ; 66 10622: 84 e9 ldi r24, 0x94 ; 148 10624: 9c e0 ldi r25, 0x0C ; 12 10626: 0f 94 e5 a3 call 0x347ca ; 0x347ca // 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(); 1062a: 0e 94 ef 65 call 0xcbde ; 0xcbde SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); 1062e: ce ef ldi r28, 0xFE ; 254 10630: d7 e7 ldi r29, 0x77 ; 119 10632: f1 cf rjmp .-30 ; 0x10616 00010634 : // 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(); 10634: 88 e4 ldi r24, 0x48 ; 72 10636: 93 e0 ldi r25, 0x03 ; 3 10638: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) 1063c: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 10640: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 10644: 89 2b or r24, r25 10646: 79 f0 breq .+30 ; 0x10666 10648: e0 91 38 12 lds r30, 0x1238 ; 0x801238 1064c: f0 91 39 12 lds r31, 0x1239 ; 0x801239 10650: e5 5b subi r30, 0xB5 ; 181 10652: ff 4e sbci r31, 0xEF ; 239 10654: 80 81 ld r24, Z 10656: 81 30 cpi r24, 0x01 ; 1 10658: 11 f0 breq .+4 ; 0x1065e 1065a: 86 30 cpi r24, 0x06 ; 6 1065c: 21 f4 brne .+8 ; 0x10666 SERIAL_PROTOCOLLNRPGM(MSG_OK); 1065e: 8c ee ldi r24, 0xEC ; 236 10660: 99 e6 ldi r25, 0x69 ; 105 10662: 0c 94 8d 7c jmp 0xf91a ; 0xf91a } 10666: 08 95 ret 00010668 : return false; } void cmdqueue_reset() { while (buflen) 10668: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1066c: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 10670: 89 2b or r24, r25 10672: 29 f0 breq .+10 ; 0x1067e { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); 10674: 0e 94 1a 83 call 0x10634 ; 0x10634 cmdqueue_pop_front(); 10678: 0e 94 13 79 call 0xf226 ; 0xf226 1067c: f5 cf rjmp .-22 ; 0x10668 } bufindr = 0; 1067e: 10 92 39 12 sts 0x1239, r1 ; 0x801239 10682: 10 92 38 12 sts 0x1238, r1 ; 0x801238 bufindw = 0; 10686: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 1068a: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.514> //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; 1068e: 81 e0 ldi r24, 0x01 ; 1 10690: 80 93 53 12 sts 0x1253, r24 ; 0x801253 } 10694: 08 95 ret 00010696 : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { 10696: ef 92 push r14 10698: ff 92 push r15 1069a: 0f 93 push r16 1069c: 1f 93 push r17 1069e: cf 93 push r28 106a0: df 93 push r29 if (mbl.active) { 106a2: 80 91 09 13 lds r24, 0x1309 ; 0x801309 106a6: 88 23 and r24, r24 106a8: 89 f1 breq .+98 ; 0x1070c } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); 106aa: 80 e9 ldi r24, 0x90 ; 144 106ac: 97 e7 ldi r25, 0x77 ; 119 106ae: 0e 94 8d 7c call 0xf91a ; 0xf91a SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); 106b2: 8a e7 ldi r24, 0x7A ; 122 106b4: 97 e7 ldi r25, 0x77 ; 119 106b6: 0e 94 8d 7c call 0xf91a ; 0xf91a SERIAL_PROTOCOLLNPGM("Measured points:"); 106ba: 89 e6 ldi r24, 0x69 ; 105 106bc: 97 e7 ldi r25, 0x77 ; 119 106be: 0e 94 8d 7c call 0xf91a ; 0xf91a for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { 106c2: c7 e0 ldi r28, 0x07 ; 7 106c4: dc e1 ldi r29, 0x1C ; 28 106c6: c1 50 subi r28, 0x01 ; 1 106c8: 58 f1 brcs .+86 ; 0x10720 106ca: cd 9f mul r28, r29 106cc: 70 01 movw r14, r0 106ce: 11 24 eor r1, r1 106d0: 01 e0 ldi r16, 0x01 ; 1 106d2: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); 106d4: 86 e6 ldi r24, 0x66 ; 102 106d6: 97 e7 ldi r25, 0x77 ; 119 106d8: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL_F(z_values[y][x], 5); 106dc: f8 01 movw r30, r16 106de: ee 0f add r30, r30 106e0: ff 1f adc r31, r31 106e2: ee 0f add r30, r30 106e4: ff 1f adc r31, r31 106e6: ee 0d add r30, r14 106e8: ff 1d adc r31, r15 106ea: ea 5f subi r30, 0xFA ; 250 106ec: fc 4e sbci r31, 0xEC ; 236 106ee: 60 81 ld r22, Z 106f0: 71 81 ldd r23, Z+1 ; 0x01 106f2: 82 81 ldd r24, Z+2 ; 0x02 106f4: 93 81 ldd r25, Z+3 ; 0x03 106f6: 45 e0 ldi r20, 0x05 ; 5 106f8: 0e 94 16 7a call 0xf42c ; 0xf42c 106fc: 0f 5f subi r16, 0xFF ; 255 106fe: 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++) { 10700: 08 30 cpi r16, 0x08 ; 8 10702: 11 05 cpc r17, r1 10704: 39 f7 brne .-50 ; 0x106d4 SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); 10706: 0e 94 8c 7a call 0xf518 ; 0xf518 1070a: dd cf rjmp .-70 ; 0x106c6 mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 1070c: 8d e9 ldi r24, 0x9D ; 157 1070e: 97 e7 ldi r25, 0x77 ; 119 return; } 10710: df 91 pop r29 10712: cf 91 pop r28 10714: 1f 91 pop r17 10716: 0f 91 pop r16 10718: ff 90 pop r15 1071a: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 1071c: 0c 94 8d 7c jmp 0xf91a ; 0xf91a return; } 10720: df 91 pop r29 10722: cf 91 pop r28 10724: 1f 91 pop r17 10726: 0f 91 pop r16 10728: ff 90 pop r15 1072a: ef 90 pop r14 1072c: 08 95 ret 0001072e : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 1072e: cf 92 push r12 10730: df 92 push r13 10732: ef 92 push r14 10734: ff 92 push r15 10736: 6b 01 movw r12, r22 10738: 7c 01 movw r14, r24 la10c_orig_jerk = j; 1073a: c0 92 27 03 sts 0x0327, r12 ; 0x800327 1073e: d0 92 28 03 sts 0x0328, r13 ; 0x800328 10742: e0 92 29 03 sts 0x0329, r14 ; 0x800329 10746: f0 92 2a 03 sts 0x032A, r15 ; 0x80032a if(la10c_mode != LA10C_LA10) 1074a: 80 91 43 03 lds r24, 0x0343 ; 0x800343 1074e: 82 30 cpi r24, 0x02 ; 2 10750: b1 f4 brne .+44 ; 0x1077e 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) 10752: 20 e0 ldi r18, 0x00 ; 0 10754: 30 e0 ldi r19, 0x00 ; 0 10756: 40 e9 ldi r20, 0x90 ; 144 10758: 50 e4 ldi r21, 0x40 ; 64 1075a: c7 01 movw r24, r14 1075c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 10760: 87 ff sbrs r24, 7 10762: 14 c0 rjmp .+40 ; 0x1078c 10764: 80 91 97 0d lds r24, 0x0D97 ; 0x800d97 10768: 90 91 98 0d lds r25, 0x0D98 ; 0x800d98 1076c: a0 91 99 0d lds r26, 0x0D99 ; 0x800d99 10770: b0 91 9a 0d lds r27, 0x0D9A ; 0x800d9a 10774: 80 3d cpi r24, 0xD0 ; 208 10776: 97 40 sbci r25, 0x07 ; 7 10778: a1 05 cpc r26, r1 1077a: b1 05 cpc r27, r1 1077c: 20 f5 brcc .+72 ; 0x107c6 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 1077e: c7 01 movw r24, r14 10780: b6 01 movw r22, r12 10782: ff 90 pop r15 10784: ef 90 pop r14 10786: df 90 pop r13 10788: cf 90 pop r12 1078a: 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: 1078c: 2a e9 ldi r18, 0x9A ; 154 1078e: 39 e9 ldi r19, 0x99 ; 153 10790: 49 e9 ldi r20, 0x99 ; 153 10792: 5e e3 ldi r21, 0x3E ; 62 10794: c7 01 movw r24, r14 10796: b6 01 movw r22, r12 10798: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1079c: 87 ff sbrs r24, 7 1079e: 0a c0 rjmp .+20 ; 0x107b4 107a0: 20 e0 ldi r18, 0x00 ; 0 107a2: 30 e0 ldi r19, 0x00 ; 0 107a4: 48 e3 ldi r20, 0x38 ; 56 107a6: 51 e4 ldi r21, 0x41 ; 65 107a8: c7 01 movw r24, r14 107aa: b6 01 movw r22, r12 107ac: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 107b0: 6b 01 movw r12, r22 107b2: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 107b4: 84 e7 ldi r24, 0x74 ; 116 107b6: 94 e7 ldi r25, 0x74 ; 116 107b8: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(j); 107bc: c7 01 movw r24, r14 107be: b6 01 movw r22, r12 107c0: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 107c4: dc cf rjmp .-72 ; 0x1077e // 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: 107c6: 2a e9 ldi r18, 0x9A ; 154 107c8: 39 e9 ldi r19, 0x99 ; 153 107ca: 49 e9 ldi r20, 0x99 ; 153 107cc: 5e e3 ldi r21, 0x3E ; 62 107ce: c7 01 movw r24, r14 107d0: b6 01 movw r22, r12 107d2: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 107d6: 87 fd sbrc r24, 7 107d8: e3 cf rjmp .-58 ; 0x107a0 j < 4.5? j * 0.25 + 3.375: 107da: 20 e0 ldi r18, 0x00 ; 0 107dc: 30 e0 ldi r19, 0x00 ; 0 107de: 40 e8 ldi r20, 0x80 ; 128 107e0: 5e e3 ldi r21, 0x3E ; 62 107e2: c7 01 movw r24, r14 107e4: b6 01 movw r22, r12 107e6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__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: 107ea: 20 e0 ldi r18, 0x00 ; 0 107ec: 30 e0 ldi r19, 0x00 ; 0 107ee: 48 e5 ldi r20, 0x58 ; 88 107f0: 50 e4 ldi r21, 0x40 ; 64 107f2: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 107f6: dc cf rjmp .-72 ; 0x107b0 000107f8 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 107f8: cf 92 push r12 107fa: df 92 push r13 107fc: ef 92 push r14 107fe: ff 92 push r15 10800: cf 93 push r28 if(mode == la10c_mode) return; 10802: 90 91 43 03 lds r25, 0x0343 ; 0x800343 10806: 98 17 cp r25, r24 10808: b9 f1 breq .+110 ; 0x10878 1080a: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 1080c: c0 90 27 03 lds r12, 0x0327 ; 0x800327 10810: d0 90 28 03 lds r13, 0x0328 ; 0x800328 10814: e0 90 29 03 lds r14, 0x0329 ; 0x800329 10818: f0 90 2a 03 lds r15, 0x032A ; 0x80032a 1081c: 20 e0 ldi r18, 0x00 ; 0 1081e: 30 e0 ldi r19, 0x00 ; 0 10820: a9 01 movw r20, r18 10822: c7 01 movw r24, r14 10824: b6 01 movw r22, r12 10826: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1082a: 88 23 and r24, r24 1082c: 41 f0 breq .+16 ; 0x1083e cs.max_jerk[E_AXIS] = la10c_orig_jerk; 1082e: c0 92 bb 0d sts 0x0DBB, r12 ; 0x800dbb 10832: d0 92 bc 0d sts 0x0DBC, r13 ; 0x800dbc 10836: e0 92 bd 0d sts 0x0DBD, r14 ; 0x800dbd 1083a: f0 92 be 0d sts 0x0DBE, r15 ; 0x800dbe SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 1083e: 87 e5 ldi r24, 0x57 ; 87 10840: 94 e7 ldi r25, 0x74 ; 116 10842: 0e 94 94 7a call 0xf528 ; 0xf528 switch(mode) 10846: c1 30 cpi r28, 0x01 ; 1 10848: 11 f1 breq .+68 ; 0x1088e 1084a: e0 f0 brcs .+56 ; 0x10884 1084c: c2 30 cpi r28, 0x02 ; 2 1084e: 11 f1 breq .+68 ; 0x10894 { 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; 10850: c0 93 43 03 sts 0x0343, r28 ; 0x800343 // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 10854: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 10858: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 1085c: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 10860: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 10864: 0e 94 97 83 call 0x1072e ; 0x1072e 10868: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 1086c: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 10870: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 10874: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe } 10878: cf 91 pop r28 1087a: ff 90 pop r15 1087c: ef 90 pop r14 1087e: df 90 pop r13 10880: cf 90 pop r12 10882: 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; 10884: 8f e4 ldi r24, 0x4F ; 79 10886: 94 e7 ldi r25, 0x74 ; 116 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10888: 0e 94 8d 7c call 0xf91a ; 0xf91a 1088c: e1 cf rjmp .-62 ; 0x10850 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 1088e: 8b e4 ldi r24, 0x4B ; 75 10890: 94 e7 ldi r25, 0x74 ; 116 10892: fa cf rjmp .-12 ; 0x10888 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10894: 87 e4 ldi r24, 0x47 ; 71 10896: 94 e7 ldi r25, 0x74 ; 116 10898: f7 cf rjmp .-18 ; 0x10888 0001089a : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 1089a: 0f 94 b0 18 call 0x23160 ; 0x23160 disable_x(); 1089e: 17 9a sbi 0x02, 7 ; 2 108a0: e9 e3 ldi r30, 0x39 ; 57 108a2: f6 e0 ldi r31, 0x06 ; 6 108a4: 10 82 st Z, r1 disable_y(); 108a6: 16 9a sbi 0x02, 6 ; 2 108a8: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 108aa: 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); } 108ac: 80 e0 ldi r24, 0x00 ; 0 108ae: 0e 94 fc 83 call 0x107f8 ; 0x107f8 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 108b2: 8f ef ldi r24, 0xFF ; 255 108b4: 9f ef ldi r25, 0xFF ; 255 108b6: 90 93 73 02 sts 0x0273, r25 ; 0x800273 108ba: 80 93 72 02 sts 0x0272, r24 ; 0x800272 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 108be: 2f ef ldi r18, 0xFF ; 255 108c0: 20 93 6f 02 sts 0x026F, r18 ; 0x80026f print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 108c4: 90 93 3e 02 sts 0x023E, r25 ; 0x80023e 108c8: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 108cc: 20 93 3f 02 sts 0x023F, r18 ; 0x80023f print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 108d0: 90 93 71 02 sts 0x0271, r25 ; 0x800271 108d4: 80 93 70 02 sts 0x0270, r24 ; 0x800270 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 108d8: 90 93 3c 02 sts 0x023C, r25 ; 0x80023c 108dc: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b 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(); } 108e0: 08 95 ret 000108e2 : SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); } } void __attribute__((noinline)) serial_dump_and_reset(dump_crash_reason reason) { 108e2: 18 2f mov r17, r24 uint16_t sp; uint32_t pc; // we're being called from a live state, so shut off interrupts ... cli(); 108e4: f8 94 cli // sample SP/PC sp = SP; 108e6: cd b7 in r28, 0x3d ; 61 108e8: de b7 in r29, 0x3e ; 62 "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 108ea: 00 d0 rcall .+0 ; 0x108ec 108ec: cf 90 pop r12 108ee: df 90 pop r13 108f0: ef 90 pop r14 108f2: 88 e1 ldi r24, 0x18 ; 24 108f4: 99 e2 ldi r25, 0x29 ; 41 108f6: 0f b6 in r0, 0x3f ; 63 108f8: f8 94 cli 108fa: a8 95 wdr 108fc: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 10900: 0f be out 0x3f, r0 ; 63 10902: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> // extend WDT long enough to allow writing the entire stream wdt_enable(WDTO_8S); // ... and heaters WRITE(FAN_PIN, HIGH); 10906: 9f b7 in r25, 0x3f ; 63 10908: f8 94 cli 1090a: e2 e0 ldi r30, 0x02 ; 2 1090c: f1 e0 ldi r31, 0x01 ; 1 1090e: 80 81 ld r24, Z 10910: 88 60 ori r24, 0x08 ; 8 10912: 80 83 st Z, r24 10914: 9f bf out 0x3f, r25 ; 63 disable_heater(); 10916: 0f 94 3d 0e call 0x21c7a ; 0x21c7a // this function can also be called from within a corrupted state, so not use // printf family of functions that use the heap or grow the stack. SERIAL_ECHOLNPGM("D23 - emergency serial dump"); 1091a: 86 e0 ldi r24, 0x06 ; 6 1091c: 94 e7 ldi r25, 0x74 ; 116 1091e: 0e 94 8d 7c call 0xf91a ; 0xf91a SERIAL_ECHOPGM("error: "); 10922: 8e ef ldi r24, 0xFE ; 254 10924: 93 e7 ldi r25, 0x73 ; 115 10926: 0e 94 94 7a call 0xf528 ; 0xf528 print((long) c, base); } void MarlinSerial::print(unsigned char b, int base) { print((unsigned long) b, base); 1092a: 61 2f mov r22, r17 1092c: 70 e0 ldi r23, 0x00 ; 0 1092e: 90 e0 ldi r25, 0x00 ; 0 10930: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 10932: 4a e0 ldi r20, 0x0A ; 10 10934: 0e 94 95 79 call 0xf32a ; 0xf32a MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); 10938: 8a ef ldi r24, 0xFA ; 250 1093a: 93 e7 ldi r25, 0x73 ; 115 1093c: 0e 94 94 7a call 0xf528 ; 0xf528 // we're being called from a live state, so shut off interrupts ... cli(); // sample SP/PC sp = SP; pc = GETPC(); 10940: 8e 2d mov r24, r14 10942: b6 01 movw r22, r12 10944: 90 e0 ldi r25, 0x00 ; 0 10946: 40 e1 ldi r20, 0x10 ; 16 10948: 0e 94 95 79 call 0xf32a ; 0xf32a SERIAL_ECHOLNPGM("D23 - emergency serial dump"); SERIAL_ECHOPGM("error: "); MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); MYSERIAL.print(pc, HEX); SERIAL_ECHOPGM(" 0x"); 1094c: 86 ef ldi r24, 0xF6 ; 246 1094e: 93 e7 ldi r25, 0x73 ; 115 10950: 0e 94 94 7a call 0xf528 ; 0xf528 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 10954: be 01 movw r22, r28 10956: 90 e0 ldi r25, 0x00 ; 0 10958: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 1095a: 40 e1 ldi r20, 0x10 ; 16 1095c: 0e 94 95 79 call 0xf32a ; 0xf32a } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 10960: 0e 94 8c 7a call 0xf518 ; 0xf518 MYSERIAL.println(sp, HEX); print_mem(0, RAMEND+1, dcode_mem_t::sram); 10964: 40 e0 ldi r20, 0x00 ; 0 10966: 60 e0 ldi r22, 0x00 ; 0 10968: 72 e2 ldi r23, 0x22 ; 34 1096a: 90 e0 ldi r25, 0x00 ; 0 1096c: 80 e0 ldi r24, 0x00 ; 0 1096e: 0f 94 8f 78 call 0x2f11e ; 0x2f11e SERIAL_ECHOLNRPGM(MSG_OK); 10972: 8c ee ldi r24, 0xEC ; 236 10974: 99 e6 ldi r25, 0x69 ; 105 10976: 0e 94 8d 7c call 0xf91a ; 0xf91a // reset soon softReset(); 1097a: 0e 94 ef 65 call 0xcbde ; 0xcbde 0001097e : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { 1097e: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); 10980: 72 9a sbi 0x0e, 2 ; 14 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10982: 68 2f mov r22, r24 10984: 83 e0 ldi r24, 0x03 ; 3 10986: 9d e0 ldi r25, 0x0D ; 13 10988: 0f 94 c1 a3 call 0x34782 ; 0x34782 eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) 1098c: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 10990: 88 23 and r24, r24 10992: 19 f0 breq .+6 ; 0x1099a serial_dump_and_reset(reason); 10994: 8c 2f mov r24, r28 10996: 0e 94 71 84 call 0x108e2 ; 0x108e2 #endif softReset(); 1099a: 0e 94 ef 65 call 0xcbde ; 0xcbde 0001099e <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { 1099e: 1f 92 push r1 109a0: 0f 92 push r0 109a2: 0f b6 in r0, 0x3f ; 63 109a4: 0f 92 push r0 109a6: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); 109a8: 83 e0 ldi r24, 0x03 ; 3 109aa: 0e 94 bf 84 call 0x1097e ; 0x1097e 000109ae <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { 109ae: 1f 92 push r1 109b0: 0f 92 push r0 109b2: 0f b6 in r0, 0x3f ; 63 109b4: 0f 92 push r0 109b6: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); 109b8: 82 e0 ldi r24, 0x02 ; 2 109ba: 0e 94 bf 84 call 0x1097e ; 0x1097e 000109be : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 109be: 41 ed ldi r20, 0xD1 ; 209 109c0: 50 e0 ldi r21, 0x00 ; 0 109c2: 65 e2 ldi r22, 0x25 ; 37 109c4: 73 e7 ldi r23, 0x73 ; 115 109c6: 87 e6 ldi r24, 0x67 ; 103 109c8: 9d e0 ldi r25, 0x0D ; 13 109ca: 0f 94 37 a1 call 0x3426e ; 0x3426e // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 109ce: 0f 94 2f 3a call 0x2745e ; 0x2745e #ifdef PIDTEMP updatePID(); 109d2: 0f 94 74 14 call 0x228e8 ; 0x228e8 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); #endif calculate_extruder_multipliers(); 109d6: 0e 94 1a 64 call 0xc834 ; 0xc834 SERIAL_ECHO_START; 109da: 8e ec ldi r24, 0xCE ; 206 109dc: 91 ea ldi r25, 0xA1 ; 161 109de: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 109e2: 83 e0 ldi r24, 0x03 ; 3 109e4: 93 e7 ldi r25, 0x73 ; 115 109e6: 0c 94 8d 7c jmp 0xf91a ; 0xf91a 000109ea : //! @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() { eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 109ea: 44 e0 ldi r20, 0x04 ; 4 109ec: 50 e0 ldi r21, 0x00 ; 0 109ee: 64 e1 ldi r22, 0x14 ; 20 109f0: 70 e0 ldi r23, 0x00 ; 0 109f2: 87 e6 ldi r24, 0x67 ; 103 109f4: 9d e0 ldi r25, 0x0D ; 13 109f6: 0f 94 8d a3 call 0x3471a ; 0x3471a // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 109fa: 43 e0 ldi r20, 0x03 ; 3 109fc: 50 e0 ldi r21, 0x00 ; 0 109fe: 65 e2 ldi r22, 0x25 ; 37 10a00: 73 e7 ldi r23, 0x73 ; 115 10a02: 87 e6 ldi r24, 0x67 ; 103 10a04: 9d e0 ldi r25, 0x0D ; 13 10a06: 0f 94 7c a1 call 0x342f8 ; 0x342f8 10a0a: 89 2b or r24, r25 10a0c: 09 f0 breq .+2 ; 0x10a10 10a0e: 5d c0 rjmp .+186 ; 0x10aca { // 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)); 10a10: e9 ee ldi r30, 0xE9 ; 233 10a12: f3 e7 ldi r31, 0x73 ; 115 10a14: 45 91 lpm r20, Z+ 10a16: 55 91 lpm r21, Z+ 10a18: 65 91 lpm r22, Z+ 10a1a: 74 91 lpm r23, Z 10a1c: 88 ed ldi r24, 0xD8 ; 216 10a1e: 90 e0 ldi r25, 0x00 ; 0 10a20: 0e 94 a4 5d call 0xbb48 ; 0xbb48 eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 10a24: ed ee ldi r30, 0xED ; 237 10a26: f3 e7 ldi r31, 0x73 ; 115 10a28: 45 91 lpm r20, Z+ 10a2a: 55 91 lpm r21, Z+ 10a2c: 65 91 lpm r22, Z+ 10a2e: 74 91 lpm r23, Z 10a30: 8c ed ldi r24, 0xDC ; 220 10a32: 90 e0 ldi r25, 0x00 ; 0 10a34: 0e 94 a4 5d call 0xbb48 ; 0xbb48 eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 10a38: e1 ef ldi r30, 0xF1 ; 241 10a3a: f3 e7 ldi r31, 0x73 ; 115 10a3c: 64 91 lpm r22, Z 10a3e: 80 ee ldi r24, 0xE0 ; 224 10a40: 90 e0 ldi r25, 0x00 ; 0 10a42: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 10a46: e2 ef ldi r30, 0xF2 ; 242 10a48: f3 e7 ldi r31, 0x73 ; 115 10a4a: 65 91 lpm r22, Z+ 10a4c: 74 91 lpm r23, Z 10a4e: 81 ee ldi r24, 0xE1 ; 225 10a50: 90 e0 ldi r25, 0x00 ; 0 10a52: 0e 94 15 78 call 0xf02a ; 0xf02a eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 10a56: e4 ef ldi r30, 0xF4 ; 244 10a58: f3 e7 ldi r31, 0x73 ; 115 10a5a: 65 91 lpm r22, Z+ 10a5c: 74 91 lpm r23, Z 10a5e: 83 ee ldi r24, 0xE3 ; 227 10a60: 90 e0 ldi r25, 0x00 ; 0 10a62: 0e 94 15 78 call 0xf02a ; 0xf02a // 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)); 10a66: e5 ee ldi r30, 0xE5 ; 229 10a68: f3 e7 ldi r31, 0x73 ; 115 10a6a: 45 91 lpm r20, Z+ 10a6c: 55 91 lpm r21, Z+ 10a6e: 65 91 lpm r22, Z+ 10a70: 74 91 lpm r23, Z 10a72: 84 ed ldi r24, 0xD4 ; 212 10a74: 90 e0 ldi r25, 0x00 ; 0 10a76: 0e 94 a4 5d call 0xbb48 ; 0xbb48 // 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); 10a7a: 41 ec ldi r20, 0xC1 ; 193 10a7c: 53 e7 ldi r21, 0x73 ; 115 10a7e: 60 e1 ldi r22, 0x10 ; 16 10a80: 70 e0 ldi r23, 0x00 ; 0 10a82: 80 eb ldi r24, 0xB0 ; 176 10a84: 90 e0 ldi r25, 0x00 ; 0 10a86: 0e 94 f6 77 call 0xefec ; 0xefec 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); 10a8a: 41 ed ldi r20, 0xD1 ; 209 10a8c: 53 e7 ldi r21, 0x73 ; 115 10a8e: 60 e1 ldi r22, 0x10 ; 16 10a90: 70 e0 ldi r23, 0x00 ; 0 10a92: 80 ec ldi r24, 0xC0 ; 192 10a94: 90 e0 ldi r25, 0x00 ; 0 10a96: 0e 94 f6 77 call 0xefec ; 0xefec #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 10a9a: 41 ed ldi r20, 0xD1 ; 209 10a9c: 50 e0 ldi r21, 0x00 ; 0 10a9e: 64 e1 ldi r22, 0x14 ; 20 10aa0: 70 e0 ldi r23, 0x00 ; 0 10aa2: 87 e6 ldi r24, 0x67 ; 103 10aa4: 9d e0 ldi r25, 0x0D ; 13 10aa6: 0f 94 8d a3 call 0x3471a ; 0x3471a calculate_extruder_multipliers(); 10aaa: 0e 94 1a 64 call 0xc834 ; 0xc834 tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); #endif //TMC2130 reset_acceleration_rates(); 10aae: 0f 94 2f 3a call 0x2745e ; 0x2745e // Call updatePID (similar to when we have processed M301) updatePID(); 10ab2: 0f 94 74 14 call 0x228e8 ; 0x228e8 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 10ab6: 8e ec ldi r24, 0xCE ; 206 10ab8: 91 ea ldi r25, 0xA1 ; 161 10aba: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNPGM("Stored settings retrieved"); 10abe: 89 ee ldi r24, 0xE9 ; 233 10ac0: 92 e7 ldi r25, 0x72 ; 114 10ac2: 0e 94 8d 7c call 0xf91a ; 0xf91a 10ac6: 81 e0 ldi r24, 0x01 ; 1 10ac8: 08 95 ret } else { Config_ResetDefault(); 10aca: 0e 94 df 84 call 0x109be ; 0x109be //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))) { 10ace: 64 e0 ldi r22, 0x04 ; 4 10ad0: 70 e0 ldi r23, 0x00 ; 0 10ad2: 84 e1 ldi r24, 0x14 ; 20 10ad4: 90 e0 ldi r25, 0x00 ; 0 10ad6: 0e 94 da 55 call 0xabb4 ; 0xabb4 10ada: 91 e0 ldi r25, 0x01 ; 1 10adc: 89 27 eor r24, r25 return false; } } return true; } 10ade: 08 95 ret 00010ae0 : }; void Config_StoreSettings() { strcpy_P(cs.version, default_conf.version); 10ae0: 65 e2 ldi r22, 0x25 ; 37 10ae2: 73 e7 ldi r23, 0x73 ; 115 10ae4: 87 e6 ldi r24, 0x67 ; 103 10ae6: 9d e0 ldi r25, 0x0D ; 13 10ae8: 0f 94 54 a1 call 0x342a8 ; 0x342a8 #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); 10aec: 41 ed ldi r20, 0xD1 ; 209 10aee: 50 e0 ldi r21, 0x00 ; 0 10af0: 64 e1 ldi r22, 0x14 ; 20 10af2: 70 e0 ldi r23, 0x00 ; 0 10af4: 87 e6 ldi r24, 0x67 ; 103 10af6: 9d e0 ldi r25, 0x0D ; 13 10af8: 0f 94 b1 a3 call 0x34762 ; 0x34762 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; 10afc: 8e ec ldi r24, 0xCE ; 206 10afe: 91 ea ldi r25, 0xA1 ; 161 10b00: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNPGM("Settings Stored"); 10b04: 89 ed ldi r24, 0xD9 ; 217 10b06: 92 e7 ldi r25, 0x72 ; 114 10b08: 0c 94 8d 7c jmp 0xf91a ; 0xf91a 00010b0c : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 10b0c: cf 93 push r28 10b0e: df 93 push r29 10b10: ec 01 movw r28, r24 { while (*str) 10b12: 89 91 ld r24, Y+ 10b14: 88 23 and r24, r24 10b16: 19 f0 breq .+6 ; 0x10b1e write(*str++); 10b18: 0e 94 81 79 call 0xf302 ; 0xf302 10b1c: fa cf rjmp .-12 ; 0x10b12 } 10b1e: df 91 pop r29 10b20: cf 91 pop r28 10b22: 08 95 ret 00010b24 : } }*/ static FORCE_INLINE void print(const char *str) { write(str); 10b24: 0e 94 86 85 call 0x10b0c ; 0x10b0c }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 10b28: 0c 94 8c 7a jmp 0xf518 ; 0xf518 00010b2c : { cmdbuffer_front_already_processed = true; } void get_command() { 10b2c: 2f 92 push r2 10b2e: 3f 92 push r3 10b30: 4f 92 push r4 10b32: 5f 92 push r5 10b34: 6f 92 push r6 10b36: 7f 92 push r7 10b38: 8f 92 push r8 10b3a: 9f 92 push r9 10b3c: af 92 push r10 10b3e: bf 92 push r11 10b40: cf 92 push r12 10b42: df 92 push r13 10b44: ef 92 push r14 10b46: ff 92 push r15 10b48: 0f 93 push r16 10b4a: 1f 93 push r17 10b4c: cf 93 push r28 10b4e: df 93 push r29 10b50: cd b7 in r28, 0x3d ; 61 10b52: de b7 in r29, 0x3e ; 62 10b54: a0 97 sbiw r28, 0x20 ; 32 10b56: 0f b6 in r0, 0x3f ; 63 10b58: f8 94 cli 10b5a: de bf out 0x3e, r29 ; 62 10b5c: 0f be out 0x3f, r0 ; 63 10b5e: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 10b60: 8f e5 ldi r24, 0x5F ; 95 10b62: 90 e0 ldi r25, 0x00 ; 0 10b64: 0e 94 64 55 call 0xaac8 ; 0xaac8 10b68: 88 23 and r24, r24 10b6a: 09 f4 brne .+2 ; 0x10b6e 10b6c: a1 c0 rjmp .+322 ; 0x10cb0 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 10b6e: 0e 94 fc 54 call 0xa9f8 ; 0xa9f8 10b72: 8f 37 cpi r24, 0x7F ; 127 10b74: 91 05 cpc r25, r1 10b76: 61 f4 brne .+24 ; 0x10b90 // 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; 10b78: 80 91 44 05 lds r24, 0x0544 ; 0x800544 10b7c: 90 91 45 05 lds r25, 0x0545 ; 0x800545 10b80: 90 93 43 05 sts 0x0543, r25 ; 0x800543 10b84: 80 93 42 05 sts 0x0542, r24 ; 0x800542 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 10b88: 8a ec ldi r24, 0xCA ; 202 10b8a: 92 e7 ldi r25, 0x72 ; 114 10b8c: 0e 94 8d 7c call 0xf91a ; 0xf91a 10b90: 6e 01 movw r12, r28 10b92: 4f e1 ldi r20, 0x1F ; 31 10b94: c4 0e add r12, r20 10b96: d1 1c adc r13, 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; 10b98: 99 24 eor r9, r9 10b9a: 93 94 inc r9 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 10b9c: 0e 94 fc 54 call 0xa9f8 ; 0xa9f8 10ba0: 18 16 cp r1, r24 10ba2: 19 06 cpc r1, r25 10ba4: 0c f0 brlt .+2 ; 0x10ba8 10ba6: 78 c0 rjmp .+240 ; 0x10c98 10ba8: 80 91 73 12 lds r24, 0x1273 ; 0x801273 10bac: 88 23 and r24, r24 10bae: 29 f0 breq .+10 ; 0x10bba 10bb0: 0e 94 05 66 call 0xcc0a ; 0xcc0a 10bb4: 88 23 and r24, r24 10bb6: 09 f4 brne .+2 ; 0x10bba 10bb8: 6f c0 rjmp .+222 ; 0x10c98 10bba: 80 91 93 03 lds r24, 0x0393 ; 0x800393 10bbe: 81 11 cpse r24, r1 10bc0: 6b c0 rjmp .+214 ; 0x10c98 } 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) { 10bc2: 20 91 44 05 lds r18, 0x0544 ; 0x800544 10bc6: 30 91 45 05 lds r19, 0x0545 ; 0x800545 10bca: 80 91 42 05 lds r24, 0x0542 ; 0x800542 10bce: 90 91 43 05 lds r25, 0x0543 ; 0x800543 10bd2: 82 17 cp r24, r18 10bd4: 93 07 cpc r25, r19 10bd6: 11 f3 breq .-60 ; 0x10b9c return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 10bd8: f9 01 movw r30, r18 10bda: ee 53 subi r30, 0x3E ; 62 10bdc: fb 4f sbci r31, 0xFB ; 251 10bde: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 10be0: 2f 5f subi r18, 0xFF ; 255 10be2: 3f 4f sbci r19, 0xFF ; 255 10be4: 2f 77 andi r18, 0x7F ; 127 10be6: 33 27 eor r19, r19 10be8: 30 93 45 05 sts 0x0545, r19 ; 0x800545 10bec: 20 93 44 05 sts 0x0544, r18 ; 0x800544 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 10bf0: 8f 3f cpi r24, 0xFF ; 255 10bf2: 09 f0 breq .+2 ; 0x10bf6 10bf4: 79 c0 rjmp .+242 ; 0x10ce8 if (mp_cmd_count > 0) { 10bf6: 80 91 19 03 lds r24, 0x0319 ; 0x800319 10bfa: 88 23 and r24, r24 10bfc: 09 f4 brne .+2 ; 0x10c00 10bfe: 71 c0 rjmp .+226 ; 0x10ce2 mp_cmd_active = 1; 10c00: 90 92 18 03 sts 0x0318, r9 ; 0x800318 mp_cmd_count = 0; 10c04: 10 92 19 03 sts 0x0319, r1 ; 0x800319 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); if (rec < 0) continue; mp_handle_rx_char((uint8_t)rec); char c_res[2] = {0, 0}; 10c08: 1f 8e std Y+31, r1 ; 0x1f 10c0a: 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) { 10c0c: 80 90 1c 03 lds r8, 0x031C ; 0x80031c 10c10: 88 20 and r8, r8 10c12: 21 f2 breq .-120 ; 0x10b9c 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]; 10c14: 80 91 1a 03 lds r24, 0x031A ; 0x80031a 10c18: 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) 10c1a: f1 e0 ldi r31, 0x01 ; 1 10c1c: f8 15 cp r31, r8 10c1e: 18 f4 brcc .+6 ; 0x10c26 out[i] = (char)mp_char_out_buf[i]; 10c20: 80 91 1b 03 lds r24, 0x031B ; 0x80031b 10c24: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10c26: 10 92 1c 03 sts 0x031C, r1 ; 0x80031c 10c2a: 16 01 movw r2, r12 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]; 10c2c: 82 2d mov r24, r2 10c2e: 8c 19 sub r24, r12 10c30: 88 15 cp r24, r8 10c32: 08 f0 brcs .+2 ; 0x10c36 10c34: b3 cf rjmp .-154 ; 0x10b9c 10c36: f1 01 movw r30, r2 10c38: 11 91 ld r17, Z+ 10c3a: 1f 01 movw r2, r30 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10c3c: 8f e1 ldi r24, 0x1F ; 31 10c3e: 93 e0 ldi r25, 0x03 ; 3 10c40: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> if (serial_char < 0) 10c44: 17 fd sbrc r17, 7 10c46: f2 cf rjmp .-28 ; 0x10c2c 10c48: 80 91 47 10 lds r24, 0x1047 ; 0x801047 10c4c: 90 91 48 10 lds r25, 0x1048 ; 0x801048 // 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' || 10c50: 1a 30 cpi r17, 0x0A ; 10 10c52: 09 f4 brne .+2 ; 0x10c56 10c54: 4b c1 rjmp .+662 ; 0x10eec 10c56: 1d 30 cpi r17, 0x0D ; 13 10c58: 09 f4 brne .+2 ; 0x10c5c 10c5a: 48 c1 rjmp .+656 ; 0x10eec serial_char == '\r' || 10c5c: 8f 35 cpi r24, 0x5F ; 95 10c5e: 91 05 cpc r25, r1 10c60: 0c f0 brlt .+2 ; 0x10c64 10c62: 49 c1 rjmp .+658 ; 0x10ef6 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; 10c64: 1b 33 cpi r17, 0x3B ; 59 10c66: 11 f4 brne .+4 ; 0x10c6c 10c68: 90 92 1e 03 sts 0x031E, r9 ; 0x80031e if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10c6c: 20 91 1e 03 lds r18, 0x031E ; 0x80031e 10c70: 21 11 cpse r18, r1 10c72: dc cf rjmp .-72 ; 0x10c2c 10c74: 9c 01 movw r18, r24 10c76: 2f 5f subi r18, 0xFF ; 255 10c78: 3f 4f sbci r19, 0xFF ; 255 10c7a: 30 93 48 10 sts 0x1048, r19 ; 0x801048 10c7e: 20 93 47 10 sts 0x1047, r18 ; 0x801047 10c82: 20 91 49 10 lds r18, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 10c86: 30 91 4a 10 lds r19, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 10c8a: 25 5b subi r18, 0xB5 ; 181 10c8c: 3f 4e sbci r19, 0xEF ; 239 10c8e: 82 0f add r24, r18 10c90: 93 1f adc r25, r19 10c92: fc 01 movw r30, r24 10c94: 13 83 std Z+3, r17 ; 0x03 10c96: ca cf rjmp .-108 ; 0x10c2c #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10c98: 80 91 47 10 lds r24, 0x1047 ; 0x801047 10c9c: 90 91 48 10 lds r25, 0x1048 ; 0x801048 10ca0: 18 16 cp r1, r24 10ca2: 19 06 cpc r1, r25 10ca4: 0c f4 brge .+2 ; 0x10ca8 10ca6: 51 c2 rjmp .+1186 ; 0x1114a SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10ca8: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 10cac: 81 11 cpse r24, r1 10cae: 67 c2 rjmp .+1230 ; 0x1117e prusa_statistics(6); } } #endif //SDSUPPORT } 10cb0: a0 96 adiw r28, 0x20 ; 32 10cb2: 0f b6 in r0, 0x3f ; 63 10cb4: f8 94 cli 10cb6: de bf out 0x3e, r29 ; 62 10cb8: 0f be out 0x3f, r0 ; 63 10cba: cd bf out 0x3d, r28 ; 61 10cbc: df 91 pop r29 10cbe: cf 91 pop r28 10cc0: 1f 91 pop r17 10cc2: 0f 91 pop r16 10cc4: ff 90 pop r15 10cc6: ef 90 pop r14 10cc8: df 90 pop r13 10cca: cf 90 pop r12 10ccc: bf 90 pop r11 10cce: af 90 pop r10 10cd0: 9f 90 pop r9 10cd2: 8f 90 pop r8 10cd4: 7f 90 pop r7 10cd6: 6f 90 pop r6 10cd8: 5f 90 pop r5 10cda: 4f 90 pop r4 10cdc: 3f 90 pop r3 10cde: 2f 90 pop r2 10ce0: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10ce2: 90 92 19 03 sts 0x0319, r9 ; 0x800319 10ce6: 90 cf rjmp .-224 ; 0x10c08 return; } if (mp_cmd_active > 0) { 10ce8: 90 91 18 03 lds r25, 0x0318 ; 0x800318 10cec: 99 23 and r25, r25 10cee: 09 f4 brne .+2 ; 0x10cf2 10cf0: 58 c0 rjmp .+176 ; 0x10da2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10cf2: 89 3f cpi r24, 0xF9 ; 249 10cf4: e9 f1 breq .+122 ; 0x10d70 10cf6: 70 f5 brcc .+92 ; 0x10d54 10cf8: 86 3f cpi r24, 0xF6 ; 246 10cfa: 09 f4 brne .+2 ; 0x10cfe 10cfc: 4a c0 rjmp .+148 ; 0x10d92 10cfe: 87 3f cpi r24, 0xF7 ; 247 10d00: 09 f4 brne .+2 ; 0x10d04 10d02: 43 c0 rjmp .+134 ; 0x10d8a 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. 10d04: 85 e9 ldi r24, 0x95 ; 149 10d06: 92 e7 ldi r25, 0x72 ; 114 10d08: 0e 94 94 7a call 0xf528 ; 0xf528 // 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); 10d0c: 80 e9 ldi r24, 0x90 ; 144 10d0e: 92 e7 ldi r25, 0x72 ; 114 10d10: 0e 94 94 7a call 0xf528 ; 0xf528 // Echo current state if (mp_config & MPConfig_Active) 10d14: 10 91 17 03 lds r17, 0x0317 ; 0x800317 SERIAL_ECHOPGM(" ON"); 10d18: 8c e8 ldi r24, 0x8C ; 140 10d1a: 92 e7 ldi r25, 0x72 ; 114 // 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) 10d1c: 10 fd sbrc r17, 0 10d1e: 02 c0 rjmp .+4 ; 0x10d24 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10d20: 87 e8 ldi r24, 0x87 ; 135 10d22: 92 e7 ldi r25, 0x72 ; 114 10d24: 0e 94 94 7a call 0xf528 ; 0xf528 if (mp_config & MPConfig_NoSpaces) 10d28: 01 2f mov r16, r17 10d2a: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10d2c: 82 e8 ldi r24, 0x82 ; 130 10d2e: 92 e7 ldi r25, 0x72 ; 114 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10d30: 11 fd sbrc r17, 1 10d32: 02 c0 rjmp .+4 ; 0x10d38 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 10d34: 8d e7 ldi r24, 0x7D ; 125 10d36: 92 e7 ldi r25, 0x72 ; 114 10d38: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNPGM(""); 10d3c: 8c e7 ldi r24, 0x7C ; 124 10d3e: 92 e7 ldi r25, 0x72 ; 114 10d40: 0e 94 8d 7c call 0xf91a ; 0xf91a // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 10d44: 00 23 and r16, r16 10d46: 49 f1 breq .+82 ; 0x10d9a MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10d48: 85 e4 ldi r24, 0x45 ; 69 10d4a: 80 93 0b 02 sts 0x020B, r24 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> return; } if (mp_cmd_active > 0) { mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; 10d4e: 10 92 18 03 sts 0x0318, r1 ; 0x800318 10d52: 5a cf rjmp .-332 ; 0x10c08 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10d54: 8a 3f cpi r24, 0xFA ; 250 10d56: 41 f0 breq .+16 ; 0x10d68 10d58: 8b 3f cpi r24, 0xFB ; 251 10d5a: a1 f6 brne .-88 ; 0x10d04 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10d5c: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10d60: 81 60 ori r24, 0x01 ; 1 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10d62: 80 93 17 03 sts 0x0317, r24 ; 0x800317 10d66: ce cf rjmp .-100 ; 0x10d04 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10d68: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10d6c: 8e 7f andi r24, 0xFE ; 254 10d6e: f9 cf rjmp .-14 ; 0x10d62 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10d70: 10 92 1c 03 sts 0x031C, r1 ; 0x80031c mp_cmd_active = MPCommand_None; 10d74: 10 92 18 03 sts 0x0318, r1 ; 0x800318 mp_config = MPConfig_None; 10d78: 10 92 17 03 sts 0x0317, r1 ; 0x800317 mp_char_buf = 0; 10d7c: 10 92 16 03 sts 0x0316, r1 ; 0x800316 mp_cmd_count = 0; 10d80: 10 92 19 03 sts 0x0319, r1 ; 0x800319 mp_cmd_active = 0; mp_full_char_queue = 0; 10d84: 10 92 15 03 sts 0x0315, r1 ; 0x800315 10d88: bd cf rjmp .-134 ; 0x10d04 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10d8a: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10d8e: 82 60 ori r24, 0x02 ; 2 10d90: e8 cf rjmp .-48 ; 0x10d62 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10d92: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10d96: 8d 7f andi r24, 0xFD ; 253 10d98: e4 cf rjmp .-56 ; 0x10d62 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 10d9a: 90 e2 ldi r25, 0x20 ; 32 10d9c: 90 93 0b 02 sts 0x020B, r25 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10da0: d6 cf rjmp .-84 ; 0x10d4e mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10da2: 90 91 19 03 lds r25, 0x0319 ; 0x800319 10da6: 30 91 17 03 lds r19, 0x0317 ; 0x800317 10daa: 99 23 and r25, r25 10dac: 31 f1 breq .+76 ; 0x10dfa 10dae: e0 91 1c 03 lds r30, 0x031C ; 0x80031c //========================================================================== 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) { 10db2: 30 ff sbrs r19, 0 10db4: 49 c0 rjmp .+146 ; 0x10e48 if (mp_full_char_queue > 0) { 10db6: 20 91 15 03 lds r18, 0x0315 ; 0x800315 10dba: 22 23 and r18, r18 10dbc: 09 f4 brne .+2 ; 0x10dc0 10dbe: 40 c0 rjmp .+128 ; 0x10e40 #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; 10dc0: 91 e0 ldi r25, 0x01 ; 1 10dc2: 9e 0f add r25, r30 10dc4: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10dc8: ae 2f mov r26, r30 10dca: b0 e0 ldi r27, 0x00 ; 0 10dcc: a6 5e subi r26, 0xE6 ; 230 10dce: bc 4f sbci r27, 0xFC ; 252 10dd0: ff ef ldi r31, 0xFF ; 255 10dd2: 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) { 10dd4: 40 91 16 03 lds r20, 0x0316 ; 0x800316 10dd8: 44 23 and r20, r20 10dda: 51 f0 breq .+20 ; 0x10df0 #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; 10ddc: ee 5f subi r30, 0xFE ; 254 10dde: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10de2: e9 2f mov r30, r25 10de4: f0 e0 ldi r31, 0x00 ; 0 10de6: e6 5e subi r30, 0xE6 ; 230 10de8: fc 4f sbci r31, 0xFC ; 252 10dea: 40 83 st Z, r20 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; 10dec: 10 92 16 03 sts 0x0316, r1 ; 0x800316 } --mp_full_char_queue; 10df0: 21 50 subi r18, 0x01 ; 1 10df2: 20 93 15 03 sts 0x0315, r18 ; 0x800315 return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 10df6: 10 92 19 03 sts 0x0319, r1 ; 0x800319 10dfa: e0 91 1c 03 lds r30, 0x031C ; 0x80031c //========================================================================== 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) { 10dfe: 30 ff sbrs r19, 0 10e00: 6c c0 rjmp .+216 ; 0x10eda if (mp_full_char_queue > 0) { 10e02: 90 91 15 03 lds r25, 0x0315 ; 0x800315 10e06: 99 23 and r25, r25 10e08: 49 f1 breq .+82 ; 0x10e5c #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; 10e0a: 21 e0 ldi r18, 0x01 ; 1 10e0c: 2e 0f add r18, r30 10e0e: 20 93 1c 03 sts 0x031C, r18 ; 0x80031c 10e12: ae 2f mov r26, r30 10e14: b0 e0 ldi r27, 0x00 ; 0 10e16: a6 5e subi r26, 0xE6 ; 230 10e18: bc 4f sbci r27, 0xFC ; 252 10e1a: 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) { 10e1c: 80 91 16 03 lds r24, 0x0316 ; 0x800316 10e20: 88 23 and r24, r24 10e22: 51 f0 breq .+20 ; 0x10e38 #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; 10e24: ee 5f subi r30, 0xFE ; 254 10e26: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10e2a: e2 2f mov r30, r18 10e2c: f0 e0 ldi r31, 0x00 ; 0 10e2e: e6 5e subi r30, 0xE6 ; 230 10e30: fc 4f sbci r31, 0xFC ; 252 10e32: 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; 10e34: 10 92 16 03 sts 0x0316, r1 ; 0x800316 } --mp_full_char_queue; 10e38: 91 50 subi r25, 0x01 ; 1 10e3a: 90 93 15 03 sts 0x0315, r25 ; 0x800315 10e3e: e4 ce rjmp .-568 ; 0x10c08 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; 10e40: 42 e0 ldi r20, 0x02 ; 2 10e42: 40 93 15 03 sts 0x0315, r20 ; 0x800315 10e46: d7 cf rjmp .-82 ; 0x10df6 #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; 10e48: 91 e0 ldi r25, 0x01 ; 1 10e4a: 9e 0f add r25, r30 10e4c: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10e50: f0 e0 ldi r31, 0x00 ; 0 10e52: e6 5e subi r30, 0xE6 ; 230 10e54: fc 4f sbci r31, 0xFC ; 252 10e56: 9f ef ldi r25, 0xFF ; 255 10e58: 90 83 st Z, r25 10e5a: cd cf rjmp .-102 ; 0x10df6 10e5c: a8 2f mov r26, r24 10e5e: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10e60: 30 e0 ldi r19, 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; 10e62: 21 e0 ldi r18, 0x01 ; 1 10e64: af 30 cpi r26, 0x0F ; 15 10e66: 29 f0 breq .+10 ; 0x10e72 10e68: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 10e6a: a0 50 subi r26, 0x00 ; 0 10e6c: be 4f sbci r27, 0xFE ; 254 10e6e: 3c 91 ld r19, 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; 10e70: 20 e0 ldi r18, 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; 10e72: 48 2f mov r20, r24 10e74: 40 7f andi r20, 0xF0 ; 240 10e76: 40 3f cpi r20, 0xF0 ; 240 10e78: 59 f4 brne .+22 ; 0x10e90 10e7a: 22 60 ori r18, 0x02 ; 2 } else { uint8_t buf[2] = { 0,0 }; const uint8_t res = mp_unpack_chars(c, buf); if (res & MeatPack_NextPackedFirst) { 10e7c: 20 ff sbrs r18, 0 10e7e: 13 c0 rjmp .+38 ; 0x10ea6 ++mp_full_char_queue; 10e80: 90 92 15 03 sts 0x0315, r9 ; 0x800315 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10e84: 21 ff sbrs r18, 1 10e86: 0c c0 rjmp .+24 ; 0x10ea0 10e88: e2 e0 ldi r30, 0x02 ; 2 10e8a: e0 93 15 03 sts 0x0315, r30 ; 0x800315 10e8e: bc ce rjmp .-648 ; 0x10c08 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 10e90: 82 95 swap r24 10e92: 8f 70 andi r24, 0x0F ; 15 10e94: a8 2f mov r26, r24 10e96: b0 e0 ldi r27, 0x00 ; 0 10e98: a0 50 subi r26, 0x00 ; 0 10e9a: be 4f sbci r27, 0xFE ; 254 10e9c: 9c 91 ld r25, X 10e9e: ee cf rjmp .-36 ; 0x10e7c 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]; 10ea0: 90 93 16 03 sts 0x0316, r25 ; 0x800316 10ea4: b1 ce rjmp .-670 ; 0x10c08 #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; 10ea6: 81 e0 ldi r24, 0x01 ; 1 10ea8: 8e 0f add r24, r30 10eaa: 80 93 1c 03 sts 0x031C, r24 ; 0x80031c 10eae: ae 2f mov r26, r30 10eb0: b0 e0 ldi r27, 0x00 ; 0 10eb2: a6 5e subi r26, 0xE6 ; 230 10eb4: bc 4f sbci r27, 0xFC ; 252 10eb6: 3c 93 st X, r19 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') { 10eb8: 3a 30 cpi r19, 0x0A ; 10 10eba: 09 f4 brne .+2 ; 0x10ebe 10ebc: a5 ce rjmp .-694 ; 0x10c08 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10ebe: 21 ff sbrs r18, 1 10ec0: 03 c0 rjmp .+6 ; 0x10ec8 10ec2: 90 92 15 03 sts 0x0315, r9 ; 0x800315 10ec6: a0 ce rjmp .-704 ; 0x10c08 #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; 10ec8: ee 5f subi r30, 0xFE ; 254 10eca: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10ece: e8 2f mov r30, r24 10ed0: f0 e0 ldi r31, 0x00 ; 0 10ed2: e6 5e subi r30, 0xE6 ; 230 10ed4: fc 4f sbci r31, 0xFC ; 252 10ed6: 90 83 st Z, r25 10ed8: 97 ce rjmp .-722 ; 0x10c08 10eda: 91 e0 ldi r25, 0x01 ; 1 10edc: 9e 0f add r25, r30 10ede: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10ee2: f0 e0 ldi r31, 0x00 ; 0 10ee4: e6 5e subi r30, 0xE6 ; 230 10ee6: fc 4f sbci r31, 0xFC ; 252 10ee8: 80 83 st Z, r24 10eea: 8e ce rjmp .-740 ; 0x10c08 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 10eec: 00 97 sbiw r24, 0x00 ; 0 10eee: 19 f4 brne .+6 ; 0x10ef6 comment_mode = false; //for new command 10ef0: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e 10ef4: dd ce rjmp .-582 ; 0x10cb0 10ef6: 00 91 49 10 lds r16, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 10efa: 10 91 4a 10 lds r17, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 10efe: 02 5b subi r16, 0xB2 ; 178 10f00: 1f 4e sbci r17, 0xEF ; 239 10f02: 80 0f add r24, r16 10f04: 91 1f adc r25, r17 10f06: fc 01 movw r30, r24 10f08: 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) 10f0a: 1a 83 std Y+2, r17 ; 0x02 10f0c: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10f0e: 80 91 1e 03 lds r24, 0x031E ; 0x80031e 10f12: 81 11 cpse r24, r1 10f14: fd c0 rjmp .+506 ; 0x11110 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10f16: f8 01 movw r30, r16 10f18: 80 81 ld r24, Z 10f1a: 8e 34 cpi r24, 0x4E ; 78 10f1c: 09 f0 breq .+2 ; 0x10f20 10f1e: 84 c0 rjmp .+264 ; 0x11028 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10f20: 4a e0 ldi r20, 0x0A ; 10 10f22: 50 e0 ldi r21, 0x00 ; 0 10f24: be 01 movw r22, r28 10f26: 6f 5f subi r22, 0xFF ; 255 10f28: 7f 4f sbci r23, 0xFF ; 255 10f2a: c8 01 movw r24, r16 10f2c: 01 96 adiw r24, 0x01 ; 1 10f2e: 0f 94 28 9f call 0x33e50 ; 0x33e50 10f32: 2b 01 movw r4, r22 10f34: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10f36: e9 80 ldd r14, Y+1 ; 0x01 10f38: fa 80 ldd r15, Y+2 ; 0x02 10f3a: f7 01 movw r30, r14 10f3c: 80 81 ld r24, Z 10f3e: 80 32 cpi r24, 0x20 ; 32 10f40: 31 f4 brne .+12 ; 0x10f4e 10f42: ff ef ldi r31, 0xFF ; 255 10f44: ef 1a sub r14, r31 10f46: ff 0a sbc r15, r31 10f48: fa 82 std Y+2, r15 ; 0x02 10f4a: e9 82 std Y+1, r14 ; 0x01 10f4c: f4 cf rjmp .-24 ; 0x10f36 // 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)) { 10f4e: 80 91 3e 12 lds r24, 0x123E ; 0x80123e 10f52: 90 91 3f 12 lds r25, 0x123F ; 0x80123f 10f56: a0 91 40 12 lds r26, 0x1240 ; 0x801240 10f5a: b0 91 41 12 lds r27, 0x1241 ; 0x801241 10f5e: 01 96 adiw r24, 0x01 ; 1 10f60: a1 1d adc r26, r1 10f62: b1 1d adc r27, r1 10f64: 84 15 cp r24, r4 10f66: 95 05 cpc r25, r5 10f68: a6 05 cpc r26, r6 10f6a: b7 05 cpc r27, r7 10f6c: 49 f0 breq .+18 ; 0x10f80 10f6e: 44 e0 ldi r20, 0x04 ; 4 10f70: 50 e0 ldi r21, 0x00 ; 0 10f72: 65 ec ldi r22, 0xC5 ; 197 10f74: 72 e7 ldi r23, 0x72 ; 114 10f76: c7 01 movw r24, r14 10f78: 0f 94 7c a1 call 0x342f8 ; 0x342f8 10f7c: 89 2b or r24, r25 10f7e: a1 f4 brne .+40 ; 0x10fa8 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10f80: 6a e2 ldi r22, 0x2A ; 42 10f82: 70 e0 ldi r23, 0x00 ; 0 10f84: c7 01 movw r24, r14 10f86: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 10f8a: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 10f8e: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 10f92: 00 97 sbiw r24, 0x00 ; 0 10f94: 09 f4 brne .+2 ; 0x10f98 10f96: 41 c0 rjmp .+130 ; 0x1101a 10f98: f8 01 movw r30, r16 { byte checksum = 0; 10f9a: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10f9c: 8e 17 cp r24, r30 10f9e: 9f 07 cpc r25, r31 10fa0: f1 f0 breq .+60 ; 0x10fde checksum = checksum^(*p++); 10fa2: 21 91 ld r18, Z+ 10fa4: f2 26 eor r15, r18 10fa6: fa cf rjmp .-12 ; 0x10f9c 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; 10fa8: 81 eb ldi r24, 0xB1 ; 177 10faa: 91 ea ldi r25, 0xA1 ; 161 10fac: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10fb0: 80 e3 ldi r24, 0x30 ; 48 10fb2: 93 e6 ldi r25, 0x63 ; 99 char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10fb4: 0e 94 94 7a call 0xf528 ; 0xf528 10fb8: 60 91 3e 12 lds r22, 0x123E ; 0x80123e 10fbc: 70 91 3f 12 lds r23, 0x123F ; 0x80123f 10fc0: 80 91 40 12 lds r24, 0x1240 ; 0x801240 10fc4: 90 91 41 12 lds r25, 0x1241 ; 0x801241 10fc8: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10fcc: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10fd0: 0e 94 ac 55 call 0xab58 ; 0xab58 serial_count = 0; 10fd4: 10 92 48 10 sts 0x1048, r1 ; 0x801048 10fd8: 10 92 47 10 sts 0x1047, r1 ; 0x801047 10fdc: 69 ce rjmp .-814 ; 0x10cb0 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10fde: 0e 94 17 56 call 0xac2e ; 0xac2e 10fe2: f8 16 cp r15, r24 10fe4: 19 06 cpc r1, r25 10fe6: 39 f0 breq .+14 ; 0x10ff6 SERIAL_ERROR_START; 10fe8: 81 eb ldi r24, 0xB1 ; 177 10fea: 91 ea ldi r25, 0xA1 ; 161 10fec: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10ff0: 81 e1 ldi r24, 0x11 ; 17 10ff2: 93 e6 ldi r25, 0x63 ; 99 10ff4: df cf rjmp .-66 ; 0x10fb4 FlushSerialRequestResend(); serial_count = 0; return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10ff6: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 10ffa: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 10ffe: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 11000: e9 80 ldd r14, Y+1 ; 0x01 11002: fa 80 ldd r15, Y+2 ; 0x02 11004: 60 ec ldi r22, 0xC0 ; 192 11006: 72 e7 ldi r23, 0x72 ; 114 11008: c7 01 movw r24, r14 1100a: 0f 94 4b a1 call 0x34296 ; 0x34296 1100e: 89 2b or r24, r25 11010: 39 f5 brne .+78 ; 0x11060 kill(MSG_M112_KILL); 11012: 87 e7 ldi r24, 0x77 ; 119 11014: 95 e6 ldi r25, 0x65 ; 101 11016: 0e 94 f3 82 call 0x105e6 ; 0x105e6 // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 1101a: 81 eb ldi r24, 0xB1 ; 177 1101c: 91 ea ldi r25, 0xA1 ; 161 1101e: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 11022: 87 ee ldi r24, 0xE7 ; 231 11024: 92 e6 ldi r25, 0x62 ; 98 11026: c6 cf rjmp .-116 ; 0x10fb4 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 11028: 89 81 ldd r24, Y+1 ; 0x01 1102a: 9a 81 ldd r25, Y+2 ; 0x02 1102c: fc 01 movw r30, r24 1102e: 20 81 ld r18, Z 11030: 20 32 cpi r18, 0x20 ; 32 11032: 21 f4 brne .+8 ; 0x1103c 11034: 01 96 adiw r24, 0x01 ; 1 11036: 9a 83 std Y+2, r25 ; 0x02 11038: 89 83 std Y+1, r24 ; 0x01 1103a: f6 cf rjmp .-20 ; 0x11028 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 1103c: 6a e2 ldi r22, 0x2A ; 42 1103e: 70 e0 ldi r23, 0x00 ; 0 11040: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 11044: 89 2b or r24, r25 11046: 39 f0 breq .+14 ; 0x11056 { SERIAL_ERROR_START; 11048: 81 eb ldi r24, 0xB1 ; 177 1104a: 91 ea ldi r25, 0xA1 ; 161 1104c: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 11050: 8d eb ldi r24, 0xBD ; 189 11052: 92 e6 ldi r25, 0x62 ; 98 11054: af cf rjmp .-162 ; 0x10fb4 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 11056: 44 24 eor r4, r4 11058: 4a 94 dec r4 1105a: 54 2c mov r5, r4 1105c: 32 01 movw r6, r4 1105e: d0 cf rjmp .-96 ; 0x11000 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) 11060: 44 e0 ldi r20, 0x04 ; 4 11062: 50 e0 ldi r21, 0x00 ; 0 11064: 6b eb ldi r22, 0xBB ; 187 11066: 72 e7 ldi r23, 0x72 ; 114 11068: c7 01 movw r24, r14 1106a: 0f 94 7c a1 call 0x342f8 ; 0x342f8 1106e: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 11070: f7 01 movw r30, r14 11072: 80 81 ld r24, Z 11074: 87 34 cpi r24, 0x47 ; 71 11076: 81 f4 brne .+32 ; 0x11098 11078: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 1107c: 85 30 cpi r24, 0x05 ; 5 1107e: 61 f0 breq .+24 ; 0x11098 usb_timer.start(); 11080: 82 e4 ldi r24, 0x42 ; 66 11082: 92 e1 ldi r25, 0x12 ; 18 11084: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 11088: f6 e0 ldi r31, 0x06 ; 6 1108a: f0 93 61 0d sts 0x0D61, r31 ; 0x800d61 <_ZL13printer_state.lto_priv.387> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1108e: 60 e0 ldi r22, 0x00 ; 0 11090: 85 ea ldi r24, 0xA5 ; 165 11092: 9f e0 ldi r25, 0x0F ; 15 11094: 0f 94 c1 a3 call 0x34782 ; 0x34782 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) { 11098: ab 28 or r10, r11 1109a: 21 f0 breq .+8 ; 0x110a4 1109c: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 110a0: 81 11 cpse r24, r1 110a2: 98 cf rjmp .-208 ; 0x10fd4 } // 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; 110a4: 26 e0 ldi r18, 0x06 ; 6 110a6: 77 fc sbrc r7, 7 110a8: 21 e0 ldi r18, 0x01 ; 1 110aa: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 110ae: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 110b2: fc 01 movw r30, r24 110b4: e5 5b subi r30, 0xB5 ; 181 110b6: ff 4e sbci r31, 0xEF ; 239 110b8: 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) 110ba: 49 81 ldd r20, Y+1 ; 0x01 110bc: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 110be: 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) 110c0: da 01 movw r26, r20 110c2: 40 17 cp r20, r16 110c4: 51 07 cpc r21, r17 110c6: a1 f5 brne .+104 ; 0x11130 cmd_len = strlen(cmd_start) + 1; 110c8: 01 90 ld r0, Z+ 110ca: 00 20 and r0, r0 110cc: e9 f7 brne .-6 ; 0x110c8 110ce: 9f 01 movw r18, r30 110d0: 20 1b sub r18, r16 110d2: 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; 110d4: 03 96 adiw r24, 0x03 ; 3 110d6: 28 0f add r18, r24 110d8: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 110da: 2d 3e cpi r18, 0xED ; 237 110dc: f1 e0 ldi r31, 0x01 ; 1 110de: 3f 07 cpc r19, r31 110e0: 79 f1 breq .+94 ; 0x11140 // 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; 110e2: 30 93 4a 10 sts 0x104A, r19 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 110e6: 20 93 49 10 sts 0x1049, r18 ; 0x801049 <_ZL7bufindw.lto_priv.514> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 110ea: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 110ee: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 110f2: 01 96 adiw r24, 0x01 ; 1 110f4: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 110f8: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c // Update the processed gcode line if (gcode_N >= 0) 110fc: 77 fc sbrc r7, 7 110fe: 08 c0 rjmp .+16 ; 0x11110 gcode_LastN = gcode_N; 11100: 40 92 3e 12 sts 0x123E, r4 ; 0x80123e 11104: 50 92 3f 12 sts 0x123F, r5 ; 0x80123f 11108: 60 92 40 12 sts 0x1240, r6 ; 0x801240 1110c: 70 92 41 12 sts 0x1241, r7 ; 0x801241 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 11110: 10 92 48 10 sts 0x1048, r1 ; 0x801048 11114: 10 92 47 10 sts 0x1047, r1 ; 0x801047 // 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)) 11118: 0e 94 fc 54 call 0xa9f8 ; 0xa9f8 1111c: 89 2b or r24, r25 1111e: 09 f4 brne .+2 ; 0x11122 11120: c7 cd rjmp .-1138 ; 0x10cb0 11122: 8f e5 ldi r24, 0x5F ; 95 11124: 90 e0 ldi r25, 0x00 ; 0 11126: 0e 94 64 55 call 0xaac8 ; 0xaac8 1112a: 81 11 cpse r24, r1 1112c: 7f cd rjmp .-1282 ; 0x10c2c 1112e: c0 cd rjmp .-1152 ; 0x10cb0 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]; } 11130: 6d 91 ld r22, X+ 11132: 61 93 st Z+, r22 11134: 9d 01 movw r18, r26 11136: 24 1b sub r18, r20 11138: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 1113a: 61 11 cpse r22, r1 1113c: f9 cf rjmp .-14 ; 0x11130 1113e: ca cf rjmp .-108 ; 0x110d4 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11140: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 11144: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.514> 11148: d0 cf rjmp .-96 ; 0x110ea #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 1114a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1114e: 60 e2 ldi r22, 0x20 ; 32 11150: 73 e0 ldi r23, 0x03 ; 3 11152: 81 11 cpse r24, r1 11154: 02 c0 rjmp .+4 ; 0x1115a 11156: 60 ed ldi r22, 0xD0 ; 208 11158: 77 e0 ldi r23, 0x07 ; 7 1115a: 8f e1 ldi r24, 0x1F ; 31 1115c: 93 e0 ldi r25, 0x03 ; 3 1115e: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 11162: 88 23 and r24, r24 11164: 09 f4 brne .+2 ; 0x11168 11166: a0 cd rjmp .-1216 ; 0x10ca8 comment_mode = false; 11168: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e serial_count = 0; 1116c: 10 92 48 10 sts 0x1048, r1 ; 0x801048 11170: 10 92 47 10 sts 0x1047, r1 ; 0x801047 SERIAL_ECHOLNPGM("RX timeout"); 11174: 80 eb ldi r24, 0xB0 ; 176 11176: 92 e7 ldi r25, 0x72 ; 114 11178: 0e 94 8d 7c call 0xf91a ; 0xf91a 1117c: 99 cd rjmp .-1230 ; 0x10cb0 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 1117e: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 11182: 88 23 and r24, r24 11184: 09 f4 brne .+2 ; 0x11188 11186: 94 cd rjmp .-1240 ; 0x10cb0 11188: 80 91 47 10 lds r24, 0x1047 ; 0x801047 1118c: 90 91 48 10 lds r25, 0x1048 ; 0x801048 11190: 89 2b or r24, r25 11192: 09 f0 breq .+2 ; 0x11196 11194: 8d cd rjmp .-1254 ; 0x10cb0 //'#' 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; 11196: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1119a: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1119e: 89 2b or r24, r25 111a0: 11 f4 brne .+4 ; 0x111a6 111a2: 10 92 1d 03 sts 0x031D, r1 ; 0x80031d 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; 111a6: 12 e0 ldi r17, 0x02 ; 2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 111a8: 01 e0 ldi r16, 0x01 ; 1 } 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) { 111aa: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 111ae: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 111b2: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 111b6: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 111ba: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 111be: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 111c2: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 111c6: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 111ca: 48 17 cp r20, r24 111cc: 59 07 cpc r21, r25 111ce: 6a 07 cpc r22, r26 111d0: 7b 07 cpc r23, r27 111d2: 08 f0 brcs .+2 ; 0x111d6 111d4: c1 c0 rjmp .+386 ; 0x11358 111d6: 80 91 1d 03 lds r24, 0x031D ; 0x80031d 111da: 81 11 cpse r24, r1 111dc: bd c0 rjmp .+378 ; 0x11358 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 111de: 0f 94 c0 6c call 0x2d980 ; 0x2d980 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_;} 111e2: 40 91 6f 16 lds r20, 0x166F ; 0x80166f 111e6: 50 91 70 16 lds r21, 0x1670 ; 0x801670 111ea: 60 91 71 16 lds r22, 0x1671 ; 0x801671 111ee: 70 91 72 16 lds r23, 0x1672 ; 0x801672 sdpos = file.curPosition(); 111f2: 40 93 eb 16 sts 0x16EB, r20 ; 0x8016eb 111f6: 50 93 ec 16 sts 0x16EC, r21 ; 0x8016ec 111fa: 60 93 ed 16 sts 0x16ED, r22 ; 0x8016ed 111fe: 70 93 ee 16 sts 0x16EE, r23 ; 0x8016ee 11202: 20 91 47 10 lds r18, 0x1047 ; 0x801047 11206: 30 91 48 10 lds r19, 0x1048 ; 0x801048 int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 1120a: 8a 30 cpi r24, 0x0A ; 10 1120c: 61 f0 breq .+24 ; 0x11226 || serial_char == '\r' 1120e: 8d 30 cpi r24, 0x0D ; 13 11210: 51 f0 breq .+20 ; 0x11226 || serial_char == '#' 11212: 83 32 cpi r24, 0x23 ; 35 11214: 09 f4 brne .+2 ; 0x11218 11216: 87 c0 rjmp .+270 ; 0x11326 || serial_count >= (MAX_CMD_SIZE - 1) 11218: 2f 35 cpi r18, 0x5F ; 95 1121a: 31 05 cpc r19, r1 1121c: 24 f4 brge .+8 ; 0x11226 || n==-1 1121e: 8f 3f cpi r24, 0xFF ; 255 11220: 98 07 cpc r25, r24 11222: 09 f0 breq .+2 ; 0x11226 11224: 87 c0 rjmp .+270 ; 0x11334 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 11226: 21 15 cp r18, r1 11228: 31 05 cpc r19, r1 1122a: 09 f4 brne .+2 ; 0x1122e 1122c: 41 cd rjmp .-1406 ; 0x10cb0 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); }; 1122e: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 11232: 81 11 cpse r24, r1 11234: 03 c0 rjmp .+6 ; 0x1123c 11236: 40 e0 ldi r20, 0x00 ; 0 11238: 50 e0 ldi r21, 0x00 ; 0 1123a: 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; 1123c: 80 91 49 12 lds r24, 0x1249 ; 0x801249 11240: 90 91 4a 12 lds r25, 0x124A ; 0x80124a 11244: 48 1b sub r20, r24 11246: 59 0b sbc r21, r25 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 11248: a0 91 49 10 lds r26, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 1124c: b0 91 4a 10 lds r27, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 11250: fd 01 movw r30, r26 11252: e5 5b subi r30, 0xB5 ; 181 11254: ff 4e sbci r31, 0xEF ; 239 11256: 10 83 st Z, r17 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 11258: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 1125a: 52 83 std Z+2, r21 ; 0x02 1125c: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 1125e: 25 5b subi r18, 0xB5 ; 181 11260: 3f 4e sbci r19, 0xEF ; 239 11262: f9 01 movw r30, r18 11264: ea 0f add r30, r26 11266: fb 1f adc r31, r27 11268: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 1126a: a5 5b subi r26, 0xB5 ; 181 1126c: bf 4e sbci r27, 0xEF ; 239 1126e: fd 01 movw r30, r26 11270: 01 90 ld r0, Z+ 11272: 00 20 and r0, r0 11274: e9 f7 brne .-6 ; 0x11270 11276: 31 97 sbiw r30, 0x01 ; 1 11278: ea 1b sub r30, r26 1127a: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 1127c: 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; 1127e: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11282: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11286: 01 96 adiw r24, 0x01 ; 1 11288: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 1128c: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c 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); 11290: 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; 11292: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 11296: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 1129a: e8 0f add r30, r24 1129c: f9 2f mov r31, r25 1129e: f1 1d adc r31, r1 112a0: f0 93 4a 10 sts 0x104A, r31 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 112a4: e0 93 49 10 sts 0x1049, r30 ; 0x801049 <_ZL7bufindw.lto_priv.514> 112a8: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 112ac: 88 23 and r24, r24 112ae: 09 f4 brne .+2 ; 0x112b2 112b0: 3d c0 rjmp .+122 ; 0x1132c 112b2: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 112b6: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 112ba: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 112be: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee sdpos_atomic = card.get_sdpos(); 112c2: 80 93 49 12 sts 0x1249, r24 ; 0x801249 112c6: 90 93 4a 12 sts 0x124A, r25 ; 0x80124a 112ca: a0 93 4b 12 sts 0x124B, r26 ; 0x80124b 112ce: b0 93 4c 12 sts 0x124C, r27 ; 0x80124c if (bufindw == sizeof(cmdbuffer)) 112d2: ed 3e cpi r30, 0xED ; 237 112d4: f1 40 sbci r31, 0x01 ; 1 112d6: 21 f4 brne .+8 ; 0x112e0 bufindw = 0; 112d8: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 112dc: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.514> sei(); 112e0: 78 94 sei comment_mode = false; //for new command 112e2: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e serial_count = 0; //clear buffer 112e6: 10 92 48 10 sts 0x1048, r1 ; 0x801048 112ea: 10 92 47 10 sts 0x1047, r1 ; 0x801047 if(card.eof()) break; 112ee: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 112f2: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 112f6: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 112fa: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 112fe: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 11302: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 11306: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 1130a: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 1130e: 48 17 cp r20, r24 11310: 59 07 cpc r21, r25 11312: 6a 07 cpc r22, r26 11314: 7b 07 cpc r23, r27 11316: 00 f5 brcc .+64 ; 0x11358 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 11318: 8f e5 ldi r24, 0x5F ; 95 1131a: 90 e0 ldi r25, 0x00 ; 0 1131c: 0e 94 64 55 call 0xaac8 ; 0xaac8 11320: 81 11 cpse r24, r1 11322: 43 cf rjmp .-378 ; 0x111aa 11324: c5 cc rjmp .-1654 ; 0x10cb0 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 11326: 00 93 1d 03 sts 0x031D, r16 ; 0x80031d 1132a: 7d cf rjmp .-262 ; 0x11226 1132c: 80 e0 ldi r24, 0x00 ; 0 1132e: 90 e0 ldi r25, 0x00 ; 0 11330: dc 01 movw r26, r24 11332: c7 cf rjmp .-114 ; 0x112c2 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 11334: a9 01 movw r20, r18 11336: 4f 5f subi r20, 0xFF ; 255 11338: 5f 4f sbci r21, 0xFF ; 255 1133a: 50 93 48 10 sts 0x1048, r21 ; 0x801048 1133e: 40 93 47 10 sts 0x1047, r20 ; 0x801047 11342: 40 91 49 10 lds r20, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 11346: 50 91 4a 10 lds r21, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 1134a: 45 5b subi r20, 0xB5 ; 181 1134c: 5f 4e sbci r21, 0xEF ; 239 1134e: 24 0f add r18, r20 11350: 35 1f adc r19, r21 11352: f9 01 movw r30, r18 11354: 83 83 std Z+3, r24 ; 0x03 11356: 29 cf rjmp .-430 ; 0x111aa } } if(card.eof()) 11358: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 1135c: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 11360: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 11364: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 11368: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 1136c: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 11370: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 11374: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 11378: 48 17 cp r20, r24 1137a: 59 07 cpc r21, r25 1137c: 6a 07 cpc r22, r26 1137e: 7b 07 cpc r23, r27 11380: 08 f4 brcc .+2 ; 0x11384 11382: 96 cc rjmp .-1748 ; 0x10cb0 { // 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()) 11384: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 11388: 89 2b or r24, r25 1138a: 09 f0 breq .+2 ; 0x1138e 1138c: 91 cc rjmp .-1758 ; 0x10cb0 { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); 1138e: 0f 94 d1 65 call 0x2cba2 ; 0x2cba2 SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED 11392: 8a ea ldi r24, 0xAA ; 170 11394: 92 e6 ldi r25, 0x62 ; 98 11396: 0e 94 8d 7c call 0xf91a ; 0xf91a char time[30]; uint32_t t = print_job_timer.duration() / 60; 1139a: 0f 94 22 15 call 0x22a44 ; 0x22a44 1139e: 6b 01 movw r12, r22 113a0: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 113a2: 0e 94 80 64 call 0xc900 ; 0xc900 // 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; 113a6: 8c e3 ldi r24, 0x3C ; 60 113a8: 88 2e mov r8, r24 113aa: 91 2c mov r9, r1 113ac: a1 2c mov r10, r1 113ae: b1 2c mov r11, r1 113b0: c7 01 movw r24, r14 113b2: b6 01 movw r22, r12 113b4: a5 01 movw r20, r10 113b6: 94 01 movw r18, r8 113b8: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> int hours, minutes; minutes = t % 60; 113bc: ca 01 movw r24, r20 113be: b9 01 movw r22, r18 113c0: a5 01 movw r20, r10 113c2: 94 01 movw r18, r8 113c4: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 113c8: 7f 93 push r23 113ca: 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; 113cc: c7 01 movw r24, r14 113ce: b6 01 movw r22, r12 113d0: 20 e1 ldi r18, 0x10 ; 16 113d2: 3e e0 ldi r19, 0x0E ; 14 113d4: 40 e0 ldi r20, 0x00 ; 0 113d6: 50 e0 ldi r21, 0x00 ; 0 113d8: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 113dc: 3f 93 push r19 113de: 2f 93 push r18 113e0: 8c e9 ldi r24, 0x9C ; 156 113e2: 92 e7 ldi r25, 0x72 ; 114 113e4: 9f 93 push r25 113e6: 8f 93 push r24 113e8: 8e 01 movw r16, r28 113ea: 0f 5f subi r16, 0xFF ; 255 113ec: 1f 4f sbci r17, 0xFF ; 255 113ee: 1f 93 push r17 113f0: 0f 93 push r16 113f2: 0f 94 b4 a2 call 0x34568 ; 0x34568 SERIAL_ECHO_START; 113f6: 8e ec ldi r24, 0xCE ; 206 113f8: 91 ea ldi r25, 0xA1 ; 161 113fa: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(time); 113fe: c8 01 movw r24, r16 11400: 0e 94 92 85 call 0x10b24 ; 0x10b24 #ifndef SHOW_FILENAME_AFTER_FINISH lcd_setstatus(time); 11404: c8 01 movw r24, r16 11406: 0e 94 d9 dc call 0x1b9b2 ; 0x1b9b2 #endif //SHOW_FILENAME_AFTER_FINISH card.printingHasFinished(); 1140a: 0f 94 e8 72 call 0x2e5d0 ; 0x2e5d0 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 1140e: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> if(!mounted) 11412: 0f b6 in r0, 0x3f ; 63 11414: f8 94 cli 11416: de bf out 0x3e, r29 ; 62 11418: 0f be out 0x3f, r0 ; 63 1141a: cd bf out 0x3d, r28 ; 61 1141c: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 11420: 88 23 and r24, r24 11422: 59 f0 breq .+22 ; 0x1143a 11424: 0f 94 03 68 call 0x2d006 ; 0x2d006 card.checkautostart(true); if (farm_mode) 11428: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1142c: 88 23 and r24, r24 1142e: 09 f4 brne .+2 ; 0x11432 11430: 3f cc rjmp .-1922 ; 0x10cb0 prusa_statistics(6); 11432: 86 e0 ldi r24, 0x06 ; 6 11434: 0f 94 02 30 call 0x26004 ; 0x26004 11438: 3b cc rjmp .-1930 ; 0x10cb0 { mount(); 1143a: 81 e0 ldi r24, 0x01 ; 1 1143c: 0f 94 27 73 call 0x2e64e ; 0x2e64e if(!mounted) //fail 11440: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 11444: 81 11 cpse r24, r1 11446: ee cf rjmp .-36 ; 0x11424 11448: ef cf rjmp .-34 ; 0x11428 0001144a : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 1144a: 0f 93 push r16 1144c: 1f 93 push r17 1144e: cf 93 push r28 11450: df 93 push r29 11452: c8 2f mov r28, r24 state = State::disabled; filter = 0; } bool PAT9125_sensor::update() { switch (state) { 11454: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 11458: 81 30 cpi r24, 0x01 ; 1 1145a: 09 f4 brne .+2 ; 0x1145e 1145c: 49 c0 rjmp .+146 ; 0x114f0 1145e: 82 30 cpi r24, 0x02 ; 2 11460: 09 f4 brne .+2 ; 0x11464 11462: 5f c0 rjmp .+190 ; 0x11522 * * 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) 11464: 0e 94 61 66 call 0xccc2 ; 0xccc2 11468: 81 11 cpse r24, r1 1146a: ff c0 rjmp .+510 ; 0x1166a 1146c: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 11470: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 11474: 00 97 sbiw r24, 0x00 ; 0 11476: 39 f4 brne .+14 ; 0x11486 11478: 20 91 59 12 lds r18, 0x1259 ; 0x801259 1147c: 30 91 5a 12 lds r19, 0x125A ; 0x80125a 11480: 23 2b or r18, r19 11482: 09 f4 brne .+2 ; 0x11486 11484: f2 c0 rjmp .+484 ; 0x1166a 11486: 40 91 33 02 lds r20, 0x0233 ; 0x800233 1148a: 50 91 34 02 lds r21, 0x0234 ; 0x800234 1148e: 60 91 35 02 lds r22, 0x0235 ; 0x800235 11492: 70 91 36 02 lds r23, 0x0236 ; 0x800236 11496: 41 15 cp r20, r1 11498: 51 05 cpc r21, r1 1149a: 61 05 cpc r22, r1 1149c: 71 05 cpc r23, r1 1149e: 09 f4 brne .+2 ; 0x114a2 114a0: e4 c0 rjmp .+456 ; 0x1166a { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 114a2: 89 2b or r24, r25 114a4: 31 f4 brne .+12 ; 0x114b2 114a6: 80 91 59 12 lds r24, 0x1259 ; 0x801259 114aa: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 114ae: 89 2b or r24, r25 114b0: 29 f0 breq .+10 ; 0x114bc 114b2: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad 114b6: 88 23 and r24, r24 114b8: 09 f4 brne .+2 ; 0x114bc 114ba: 3f c1 rjmp .+638 ; 0x1173a { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 114bc: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 114c0: 88 23 and r24, r24 114c2: 21 f0 breq .+8 ; 0x114cc 114c4: 40 ee ldi r20, 0xE0 ; 224 114c6: 52 e3 ldi r21, 0x32 ; 50 114c8: 69 e2 ldi r22, 0x29 ; 41 114ca: 70 e0 ldi r23, 0x00 ; 0 114cc: 8d ea ldi r24, 0xAD ; 173 114ce: 95 e0 ldi r25, 0x05 ; 5 114d0: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> 114d4: 88 23 and r24, r24 114d6: 09 f4 brne .+2 ; 0x114da 114d8: ca c0 rjmp .+404 ; 0x1166e { disable_heater(); 114da: 0f 94 3d 0e call 0x21c7a ; 0x21c7a lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 114de: 80 e6 ldi r24, 0x60 ; 96 114e0: 96 e3 ldi r25, 0x36 ; 54 114e2: 0e 94 0a 75 call 0xea14 ; 0xea14 114e6: 0e 94 85 e8 call 0x1d10a ; 0x1d10a lcd_return_to_status(); 114ea: 0f 94 6d 05 call 0x20ada ; 0x20ada 114ee: bf c0 rjmp .+382 ; 0x1166e case State::initializing: if (!updatePAT9125()) { 114f0: 0f 94 47 6e call 0x2dc8e ; 0x2dc8e 114f4: 88 23 and r24, r24 114f6: 09 f4 brne .+2 ; 0x114fa 114f8: b5 cf rjmp .-150 ; 0x11464 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 114fa: 81 e0 ldi r24, 0x01 ; 1 114fc: 90 91 fe 16 lds r25, 0x16FE ; 0x8016fe 11500: 91 11 cpse r25, r1 11502: 01 c0 rjmp .+2 ; 0x11506 11504: 80 e0 ldi r24, 0x00 ; 0 break; // still not stable. Stay in the initialization state. } oldFilamentPresent = 11506: 80 93 f4 16 sts 0x16F4, r24 ; 0x8016f4 getFilamentPresent(); // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldPos = pat9125_y; 1150a: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 1150e: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 11512: 90 93 01 17 sts 0x1701, r25 ; 0x801701 11516: 80 93 00 17 sts 0x1700, r24 ; 0x801700 state = State::ready; 1151a: 82 e0 ldi r24, 0x02 ; 2 1151c: 80 93 f1 16 sts 0x16F1, r24 ; 0x8016f1 11520: a1 cf rjmp .-190 ; 0x11464 break; case State::ready: { updatePAT9125(); 11522: 0f 94 47 6e call 0x2dc8e ; 0x2dc8e postponedLoadEvent = false; 11526: 10 92 f5 16 sts 0x16F5, r1 ; 0x8016f5 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 1152a: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1152e: 82 30 cpi r24, 0x02 ; 2 11530: 09 f0 breq .+2 ; 0x11534 11532: 98 cf rjmp .-208 ; 0x11464 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 11534: 80 91 f6 16 lds r24, 0x16F6 ; 0x8016f6 11538: 81 11 cpse r24, r1 1153a: 40 c0 rjmp .+128 ; 0x115bc 1153c: d0 91 fe 16 lds r29, 0x16FE ; 0x8016fe 11540: 81 e0 ldi r24, 0x01 ; 1 11542: d1 11 cpse r29, r1 11544: 01 c0 rjmp .+2 ; 0x11548 11546: 80 e0 ldi r24, 0x00 ; 0 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); if (oldFilamentPresent != newFilamentPresent) { 11548: 90 91 f4 16 lds r25, 0x16F4 ; 0x8016f4 1154c: 89 17 cp r24, r25 1154e: 09 f4 brne .+2 ; 0x11552 11550: 89 cf rjmp .-238 ; 0x11464 oldFilamentPresent = newFilamentPresent; 11552: 80 93 f4 16 sts 0x16F4, r24 ; 0x8016f4 eventBlankingTimer.start(); 11556: 86 ef ldi r24, 0xF6 ; 246 11558: 96 e1 ldi r25, 0x16 ; 22 1155a: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> if (newFilamentPresent) { // filament insertion 1155e: dd 23 and r29, r29 11560: b1 f1 breq .+108 ; 0x115ce } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11562: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 11566: 88 23 and r24, r24 11568: 11 f1 breq .+68 ; 0x115ae return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1156a: 80 91 94 03 lds r24, 0x0394 ; 0x800394 1156e: 81 11 cpse r24, r1 11570: 1e c0 rjmp .+60 ; 0x115ae && !( 11572: 80 91 01 13 lds r24, 0x1301 ; 0x801301 11576: 81 30 cpi r24, 0x01 ; 1 11578: d1 f0 breq .+52 ; 0x115ae return (block_buffer_head != block_buffer_tail); } //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); 1157a: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 1157e: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 11582: 89 1b sub r24, r25 11584: 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 11586: 99 f4 brne .+38 ; 0x115ae || printJobOngoing() 11588: 0e 94 10 66 call 0xcc20 ; 0xcc20 1158c: 81 11 cpse r24, r1 1158e: 0f c0 rjmp .+30 ; 0x115ae || (lcd_commands_type == LcdCommands::Layer1Cal) 11590: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 11594: 84 30 cpi r24, 0x04 ; 4 11596: 59 f0 breq .+22 ; 0x115ae || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11598: 8f e5 ldi r24, 0x5F ; 95 1159a: 9f e0 ldi r25, 0x0F ; 15 1159c: 0f 94 9d a3 call 0x3473a ; 0x3473a } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 115a0: 81 11 cpse r24, r1 115a2: 05 c0 rjmp .+10 ; 0x115ae || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 115a4: 61 e0 ldi r22, 0x01 ; 1 115a6: 84 e6 ldi r24, 0x64 ; 100 115a8: 97 e3 ldi r25, 0x37 ; 55 115aa: 0e 94 ad 62 call 0xc55a ; 0xc55a oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 115ae: 81 e0 ldi r24, 0x01 ; 1 115b0: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 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. 115b4: 81 e0 ldi r24, 0x01 ; 1 115b6: 80 93 59 02 sts 0x0259, r24 ; 0x800259 115ba: 54 cf rjmp .-344 ; 0x11464 } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 115bc: 64 e6 ldi r22, 0x64 ; 100 115be: 70 e0 ldi r23, 0x00 ; 0 115c0: 86 ef ldi r24, 0xF6 ; 246 115c2: 96 e1 ldi r25, 0x16 ; 22 115c4: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 115c8: 81 11 cpse r24, r1 115ca: b8 cf rjmp .-144 ; 0x1153c 115cc: 4b cf rjmp .-362 ; 0x11464 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 115ce: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 115d2: 88 23 and r24, r24 115d4: 79 f3 breq .-34 ; 0x115b4 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 115d6: 80 91 94 03 lds r24, 0x0394 ; 0x800394 115da: 81 11 cpse r24, r1 115dc: eb cf rjmp .-42 ; 0x115b4 115de: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 115e2: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 115e6: 89 1b sub r24, r25 115e8: 8f 70 andi r24, 0x0F ; 15 && ( 115ea: 21 f4 brne .+8 ; 0x115f4 moves_planned() != 0 || printJobOngoing() 115ec: 0e 94 10 66 call 0xcc20 ; 0xcc20 115f0: 88 23 and r24, r24 115f2: 01 f3 breq .-64 ; 0x115b4 ) && !( 115f4: 80 91 73 12 lds r24, 0x1273 ; 0x801273 115f8: 81 11 cpse r24, r1 115fa: dc cf rjmp .-72 ; 0x115b4 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 115fc: 80 91 01 13 lds r24, 0x1301 ; 0x801301 11600: 81 30 cpi r24, 0x01 ; 1 11602: c1 f2 breq .-80 ; 0x115b4 || (lcd_commands_type == LcdCommands::Layer1Cal) 11604: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 11608: 84 30 cpi r24, 0x04 ; 4 1160a: a1 f2 breq .-88 ; 0x115b4 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 1160c: 8f e5 ldi r24, 0x5F ; 95 1160e: 9f e0 ldi r25, 0x0F ; 15 11610: 0f 94 9d a3 call 0x3473a ; 0x3473a && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11614: 81 11 cpse r24, r1 11616: ce cf rjmp .-100 ; 0x115b4 } //! @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); 11618: 88 e7 ldi r24, 0x78 ; 120 1161a: 94 e6 ldi r25, 0x64 ; 100 1161c: 9f 93 push r25 1161e: 8f 93 push r24 11620: 8e e5 ldi r24, 0x5E ; 94 11622: 94 e6 ldi r25, 0x64 ; 100 11624: 9f 93 push r25 11626: 8f 93 push r24 11628: 0f 94 5f a2 call 0x344be ; 0x344be void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 1162c: 10 92 f3 16 sts 0x16F3, r1 ; 0x8016f3 autoLoadEnabled = false; 11630: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 stop_and_save_print_to_ram(0, 0); 11634: 60 e0 ldi r22, 0x00 ; 0 11636: 70 e0 ldi r23, 0x00 ; 0 11638: cb 01 movw r24, r22 1163a: 0f 94 de 65 call 0x2cbbc ; 0x2cbbc restore_print_from_ram_and_continue(0); 1163e: 60 e0 ldi r22, 0x00 ; 0 11640: 70 e0 ldi r23, 0x00 ; 0 11642: cb 01 movw r24, r22 11644: 0e 94 88 66 call 0xcd10 ; 0xcd10 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11648: 85 e6 ldi r24, 0x65 ; 101 1164a: 9f e0 ldi r25, 0x0F ; 15 1164c: 0e 94 4c 78 call 0xf098 ; 0xf098 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11650: 81 e0 ldi r24, 0x01 ; 1 11652: 9f e0 ldi r25, 0x0F ; 15 11654: 0e 94 3f 78 call 0xf07e ; 0xf07e enquecommand_front_P(MSG_M600); 11658: 8e e5 ldi r24, 0x5E ; 94 1165a: 9c e6 ldi r25, 0x6C ; 108 1165c: 0f 94 49 67 call 0x2ce92 ; 0x2ce92 11660: 0f 90 pop r0 11662: 0f 90 pop r0 11664: 0f 90 pop r0 11666: 0f 90 pop r0 11668: a5 cf rjmp .-182 ; 0x115b4 inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 1166a: 10 92 ad 05 sts 0x05AD, r1 ; 0x8005ad #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)){ 1166e: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11672: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11676: 03 97 sbiw r24, 0x03 ; 3 11678: 14 f4 brge .+4 ; 0x1167e get_command(); 1167a: 0e 94 96 85 call 0x10b2c ; 0x10b2c 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); 1167e: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 11682: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 11686: 98 17 cp r25, r24 11688: 81 f0 breq .+32 ; 0x116aa 1168a: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 1168e: 86 30 cpi r24, 0x06 ; 6 11690: 61 f4 brne .+24 ; 0x116aa 11692: 68 e8 ldi r22, 0x88 ; 136 11694: 73 e1 ldi r23, 0x13 ; 19 11696: 82 e4 ldi r24, 0x42 ; 66 11698: 92 e1 ldi r25, 0x12 ; 18 1169a: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 1169e: 88 23 and r24, r24 116a0: 21 f0 breq .+8 ; 0x116aa { // 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(); 116a2: 82 e4 ldi r24, 0x42 ; 66 116a4: 92 e1 ldi r25, 0x12 ; 18 116a6: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 116aa: 40 91 44 03 lds r20, 0x0344 ; 0x800344 116ae: 50 91 45 03 lds r21, 0x0345 ; 0x800345 116b2: 60 91 46 03 lds r22, 0x0346 ; 0x800346 116b6: 70 91 47 03 lds r23, 0x0347 ; 0x800347 116ba: 41 15 cp r20, r1 116bc: 51 05 cpc r21, r1 116be: 61 05 cpc r22, r1 116c0: 71 05 cpc r23, r1 116c2: 09 f0 breq .+2 ; 0x116c6 116c4: 3f c0 rjmp .+126 ; 0x11744 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 116c6: 40 91 37 02 lds r20, 0x0237 ; 0x800237 116ca: 50 91 38 02 lds r21, 0x0238 ; 0x800238 116ce: 60 91 39 02 lds r22, 0x0239 ; 0x800239 116d2: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 116d6: 41 15 cp r20, r1 116d8: 51 05 cpc r21, r1 116da: 61 05 cpc r22, r1 116dc: 71 05 cpc r23, r1 116de: a9 f0 breq .+42 ; 0x1170a 116e0: 88 e4 ldi r24, 0x48 ; 72 116e2: 93 e0 ldi r25, 0x03 ; 3 116e4: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> 116e8: 88 23 and r24, r24 116ea: 79 f0 breq .+30 ; 0x1170a 116ec: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 116f0: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f if(blocks_queued() == false && ignore_stepper_queue == false) { 116f4: 98 13 cpse r25, r24 116f6: 09 c0 rjmp .+18 ; 0x1170a 116f8: c1 11 cpse r28, r1 116fa: 07 c0 rjmp .+14 ; 0x1170a disable_x(); 116fc: 17 9a sbi 0x02, 7 ; 2 116fe: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 11702: 16 9a sbi 0x02, 6 ; 2 11704: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a disable_z(); disable_e0(); 11708: 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; 1170a: c0 91 55 12 lds r28, 0x1255 ; 0x801255 block_t *block; if(block_buffer_tail != block_buffer_head) 1170e: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 11712: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 11716: 98 17 cp r25, r24 11718: 01 f1 breq .+64 ; 0x1175a { uint8_t block_index = block_buffer_tail; 1171a: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f tail_fan_speed = block_buffer[block_index].fan_speed; 1171e: 9e e6 ldi r25, 0x6E ; 110 11720: 89 9f mul r24, r25 11722: f0 01 movw r30, r0 11724: 11 24 eor r1, r1 11726: ec 55 subi r30, 0x5C ; 92 11728: f9 4f sbci r31, 0xF9 ; 249 1172a: c0 81 ld r28, Z while(block_index != block_buffer_head) 1172c: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 11730: 98 17 cp r25, r24 11732: 99 f0 breq .+38 ; 0x1175a 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); 11734: 8f 5f subi r24, 0xFF ; 255 11736: 8f 70 andi r24, 0x0F ; 15 11738: f9 cf rjmp .-14 ; 0x1172c { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 1173a: 8d ea ldi r24, 0xAD ; 173 1173c: 95 e0 ldi r25, 0x05 ; 5 1173e: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> 11742: 95 cf rjmp .-214 ; 0x1166e // 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)) 11744: 88 e4 ldi r24, 0x48 ; 72 11746: 93 e0 ldi r25, 0x03 ; 3 11748: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> 1174c: 88 23 and r24, r24 1174e: 09 f4 brne .+2 ; 0x11752 11750: ba cf rjmp .-140 ; 0x116c6 kill(PSTR("Inactivity Shutdown")); 11752: 8a ee ldi r24, 0xEA ; 234 11754: 97 e7 ldi r25, 0x77 ; 119 11756: 0e 94 f3 82 call 0x105e6 ; 0x105e6 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) { 1175a: cc 23 and r28, r28 1175c: 09 f4 brne .+2 ; 0x11760 1175e: be c0 rjmp .+380 ; 0x118dc if (fan_kick_end == 0) { 11760: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 11764: 90 91 40 03 lds r25, 0x0340 ; 0x800340 11768: a0 91 41 03 lds r26, 0x0341 ; 0x800341 1176c: b0 91 42 03 lds r27, 0x0342 ; 0x800342 11770: 89 2b or r24, r25 11772: 8a 2b or r24, r26 11774: 8b 2b or r24, r27 11776: 81 f4 brne .+32 ; 0x11798 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11778: 0f 94 56 0b call 0x216ac ; 0x216ac 1177c: 60 5e subi r22, 0xE0 ; 224 1177e: 7c 4f sbci r23, 0xFC ; 252 11780: 8f 4f sbci r24, 0xFF ; 255 11782: 9f 4f sbci r25, 0xFF ; 255 11784: 60 93 3f 03 sts 0x033F, r22 ; 0x80033f 11788: 70 93 40 03 sts 0x0340, r23 ; 0x800340 1178c: 80 93 41 03 sts 0x0341, r24 ; 0x800341 11790: 90 93 42 03 sts 0x0342, r25 ; 0x800342 tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 11794: cf ef ldi r28, 0xFF ; 255 11796: 0f c0 rjmp .+30 ; 0x117b6 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()) 11798: 0f 94 56 0b call 0x216ac ; 0x216ac 1179c: 00 91 3f 03 lds r16, 0x033F ; 0x80033f 117a0: 10 91 40 03 lds r17, 0x0340 ; 0x800340 117a4: 20 91 41 03 lds r18, 0x0341 ; 0x800341 117a8: 30 91 42 03 lds r19, 0x0342 ; 0x800342 117ac: 60 17 cp r22, r16 117ae: 71 07 cpc r23, r17 117b0: 82 07 cpc r24, r18 117b2: 93 07 cpc r25, r19 117b4: 78 f3 brcs .-34 ; 0x11794 } 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 117b6: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 117ba: 88 23 and r24, r24 117bc: 09 f4 brne .+2 ; 0x117c0 117be: 97 c0 rjmp .+302 ; 0x118ee fanSpeedBckp = tail_fan_speed; 117c0: c0 93 65 02 sts 0x0265, r28 ; 0x800265 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) { 117c4: 80 91 5f 04 lds r24, 0x045F ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> 117c8: 81 11 cpse r24, r1 117ca: 07 c0 rjmp .+14 ; 0x117da return; } avoidRecursion = true; 117cc: 81 e0 ldi r24, 0x01 ; 1 117ce: 80 93 5f 04 sts 0x045F, r24 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> mmu_loop_inner(true); 117d2: 0f 94 f5 96 call 0x32dea ; 0x32dea avoidRecursion = false; 117d6: 10 92 5f 04 sts 0x045F, r1 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 117da: 80 91 a6 05 lds r24, 0x05A6 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> 117de: 88 23 and r24, r24 117e0: c9 f1 breq .+114 ; 0x11854 lcd_backlight_wake_trigger = false; 117e2: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> backlight_wake(); bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 117e6: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 117e8: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 117ea: 80 91 a4 05 lds r24, 0x05A4 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.502> 117ee: 28 2f mov r18, r24 117f0: 08 2e mov r0, r24 117f2: 00 0c add r0, r0 117f4: 33 0b sbc r19, r19 117f6: 37 ff sbrs r19, 7 117f8: 03 c0 rjmp .+6 ; 0x11800 117fa: 31 95 neg r19 117fc: 21 95 neg r18 117fe: 31 09 sbc r19, r1 11800: 24 30 cpi r18, 0x04 ; 4 11802: 31 05 cpc r19, r1 11804: 0c f4 brge .+2 ; 0x11808 11806: 76 c0 rjmp .+236 ; 0x118f4 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11808: 98 2f mov r25, r24 1180a: 87 ff sbrs r24, 7 1180c: 02 c0 rjmp .+4 ; 0x11812 1180e: 93 e0 ldi r25, 0x03 ; 3 11810: 98 0f add r25, r24 11812: 95 95 asr r25 11814: 95 95 asr r25 11816: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1181a: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1181e: 29 0f add r18, r25 11820: 31 1d adc r19, r1 11822: 97 fd sbrc r25, 7 11824: 3a 95 dec r19 11826: 30 93 1f 06 sts 0x061F, r19 ; 0x80061f 1182a: 20 93 1e 06 sts 0x061E, r18 ; 0x80061e lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 1182e: 83 78 andi r24, 0x83 ; 131 11830: 87 ff sbrs r24, 7 11832: 03 c0 rjmp .+6 ; 0x1183a 11834: 81 50 subi r24, 0x01 ; 1 11836: 8c 6f ori r24, 0xFC ; 252 11838: 8f 5f subi r24, 0xFF ; 255 1183a: 80 93 a4 05 sts 0x05A4, r24 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.502> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1183e: 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); 11840: 86 e0 ldi r24, 0x06 ; 6 11842: 0f 94 62 23 call 0x246c4 ; 0x246c4 if (lcd_draw_update == 0) { 11846: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1184a: 81 11 cpse r24, r1 1184c: 03 c0 rjmp .+6 ; 0x11854 // Update LCD rendering at minimum lcd_draw_update = 1; 1184e: 81 e0 ldi r24, 0x01 ; 1 11850: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_knob_update(); backlight_update(); // handle longpress if(lcd_longpress_trigger) 11854: 80 91 a7 05 lds r24, 0x05A7 ; 0x8005a7 11858: 88 23 and r24, r24 1185a: 61 f0 breq .+24 ; 0x11874 { lcd_consume_click(); // Reset trigger to prevent recursion 1185c: 0e 94 40 73 call 0xe680 ; 0xe680 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11860: e0 91 06 04 lds r30, 0x0406 ; 0x800406 11864: f0 91 07 04 lds r31, 0x0407 ; 0x800407 11868: 30 97 sbiw r30, 0x00 ; 0 1186a: 21 f0 breq .+8 ; 0x11874 1186c: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 11870: 81 11 cpse r24, r1 { lcd_longpress_func(); 11872: 19 95 eicall } } 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); } 11874: 20 91 cf 13 lds r18, 0x13CF ; 0x8013cf 11878: 30 e0 ldi r19, 0x00 ; 0 1187a: a8 ee ldi r26, 0xE8 ; 232 1187c: b3 e0 ldi r27, 0x03 ; 3 1187e: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 11882: ab 01 movw r20, r22 11884: bc 01 movw r22, r24 11886: 80 ed ldi r24, 0xD0 ; 208 11888: 93 e1 ldi r25, 0x13 ; 19 1188a: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) 1188e: 88 23 and r24, r24 11890: 99 f0 breq .+38 ; 0x118b8 11892: 80 91 ce 13 lds r24, 0x13CE ; 0x8013ce { if(autoReportFeatures.Temp()){ 11896: 80 fd sbrc r24, 0 gcode_M105(); 11898: 0e 94 06 7c call 0xf80c ; 0xf80c 1189c: 80 91 ce 13 lds r24, 0x13CE ; 0x8013ce } if(autoReportFeatures.Pos()){ 118a0: 82 fd sbrc r24, 2 gcode_M114(); 118a2: 0e 94 8b 7b call 0xf716 ; 0xf716 118a6: 80 91 ce 13 lds r24, 0x13CE ; 0x8013ce } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ 118aa: 81 fd sbrc r24, 1 gcode_M123(); 118ac: 0e 94 e5 64 call 0xc9ca ; 0xc9ca } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } 118b0: 80 ed ldi r24, 0xD0 ; 208 118b2: 93 e1 ldi r25, 0x13 ; 19 118b4: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 118b8: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 118bc: 81 11 cpse r24, r1 118be: 02 c0 rjmp .+4 ; 0x118c4 118c0: 0e 94 91 7c call 0xf922 ; 0xf922 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 118c4: 40 e3 ldi r20, 0x30 ; 48 118c6: 55 e7 ldi r21, 0x75 ; 117 118c8: 60 e0 ldi r22, 0x00 ; 0 118ca: 70 e0 ldi r23, 0x00 ; 0 118cc: 8c e8 ldi r24, 0x8C ; 140 118ce: 93 e0 ldi r25, 0x03 ; 3 #if defined(AUTO_REPORT) host_autoreport(); #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } 118d0: df 91 pop r29 118d2: cf 91 pop r28 118d4: 1f 91 pop r17 118d6: 0f 91 pop r16 118d8: 0d 94 c0 0b jmp 0x21780 ; 0x21780 ::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; 118dc: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f 118e0: 10 92 40 03 sts 0x0340, r1 ; 0x800340 118e4: 10 92 41 03 sts 0x0341, r1 ; 0x800341 118e8: 10 92 42 03 sts 0x0342, r1 ; 0x800342 118ec: 64 cf rjmp .-312 ; 0x117b6 #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; 118ee: c0 93 1d 06 sts 0x061D, r28 ; 0x80061d 118f2: 68 cf rjmp .-304 ; 0x117c4 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; 118f4: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.502> 118f8: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 118fa: 80 e0 ldi r24, 0x00 ; 0 118fc: a2 cf rjmp .-188 ; 0x11842 000118fe : #endif #endif } void delay_keep_alive(unsigned int ms) { 118fe: cf 93 push r28 11900: df 93 push r29 11902: ec 01 movw r28, r24 for (;;) { manage_heater(); 11904: 0f 94 a5 37 call 0x26f4a ; 0x26f4a // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11908: 81 e0 ldi r24, 0x01 ; 1 1190a: 0e 94 25 8a call 0x1144a ; 0x1144a lcd_update(0); 1190e: 80 e0 ldi r24, 0x00 ; 0 11910: 0e 94 c9 6e call 0xdd92 ; 0xdd92 if (ms == 0) 11914: 20 97 sbiw r28, 0x00 ; 0 11916: 99 f0 breq .+38 ; 0x1193e break; else if (ms >= 50) { 11918: c2 33 cpi r28, 0x32 ; 50 1191a: d1 05 cpc r29, r1 1191c: 40 f0 brcs .+16 ; 0x1192e _delay(50); 1191e: 62 e3 ldi r22, 0x32 ; 50 11920: 70 e0 ldi r23, 0x00 ; 0 11922: 80 e0 ldi r24, 0x00 ; 0 11924: 90 e0 ldi r25, 0x00 ; 0 11926: 0f 94 23 0b call 0x21646 ; 0x21646 ms -= 50; 1192a: e2 97 sbiw r28, 0x32 ; 50 1192c: eb cf rjmp .-42 ; 0x11904 } else { _delay(ms); 1192e: be 01 movw r22, r28 11930: 90 e0 ldi r25, 0x00 ; 0 11932: 80 e0 ldi r24, 0x00 ; 0 11934: 0f 94 23 0b call 0x21646 ; 0x21646 ms = 0; 11938: d0 e0 ldi r29, 0x00 ; 0 1193a: c0 e0 ldi r28, 0x00 ; 0 1193c: e3 cf rjmp .-58 ; 0x11904 } } } 1193e: df 91 pop r29 11940: cf 91 pop r28 11942: 08 95 ret 00011944 : /// @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) { 11944: cf 93 push r28 11946: df 93 push r29 11948: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 1194a: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 1194c: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 11950: 81 e0 ldi r24, 0x01 ; 1 11952: 0e 94 25 8a call 0x1144a ; 0x1144a 11956: 80 91 ff 12 lds r24, 0x12FF ; 0x8012ff btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 1195a: 8f 3f cpi r24, 0xFF ; 255 1195c: d9 f4 brne .+54 ; 0x11994 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 1195e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 11962: 84 30 cpi r24, 0x04 ; 4 11964: 21 f4 brne .+8 ; 0x1196e }; 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 11966: 80 91 97 12 lds r24, 0x1297 ; 0x801297 1196a: 81 11 cpse r24, r1 1196c: ef cf rjmp .-34 ; 0x1194c 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 1196e: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 11972: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 11976: 01 97 sbiw r24, 0x01 ; 1 11978: 49 f7 brne .-46 ; 0x1194c && lastErrorCode != ec) // The error code is not a duplicate 1197a: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 1197e: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 11982: 89 32 cpi r24, 0x29 ; 41 11984: 90 48 sbci r25, 0x80 ; 128 11986: 11 f3 breq .-60 ; 0x1194c { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11988: 60 e0 ldi r22, 0x00 ; 0 1198a: 89 e2 ldi r24, 0x29 ; 41 1198c: 90 e8 ldi r25, 0x80 ; 128 1198e: 0f 94 54 75 call 0x2eaa8 ; 0x2eaa8 11992: dc cf rjmp .-72 ; 0x1194c inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11994: d0 93 ff 12 sts 0x12FF, r29 ; 0x8012ff { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11998: 85 30 cpi r24, 0x05 ; 5 1199a: 39 f4 brne .+14 ; 0x119aa if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 1199c: cf 3f cpi r28, 0xFF ; 255 1199e: f9 f2 breq .-66 ; 0x1195e MMU2::mmu2.eject_filament(eject_slot, true); 119a0: 61 e0 ldi r22, 0x01 ; 1 119a2: 8c 2f mov r24, r28 119a4: 0f 94 89 9d call 0x33b12 ; 0x33b12 119a8: d1 cf rjmp .-94 ; 0x1194c // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 119aa: 84 30 cpi r24, 0x04 ; 4 119ac: c1 f6 brne .-80 ; 0x1195e } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 119ae: df 91 pop r29 119b0: cf 91 pop r28 119b2: 08 95 ret 000119b4 : //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) { 119b4: ff 92 push r15 119b6: 0f 93 push r16 119b8: 1f 93 push r17 119ba: cf 93 push r28 119bc: df 93 push r29 119be: ec 01 movw r28, r24 119c0: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 119c2: 66 23 and r22, r22 119c4: 09 f4 brne .+2 ; 0x119c8 119c6: 4b c0 rjmp .+150 ; 0x11a5e 119c8: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__strlen_P> 119cc: 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)) { 119ce: c8 01 movw r24, r16 119d0: 0e 94 64 55 call 0xaac8 ; 0xaac8 119d4: 88 23 and r24, r24 119d6: 09 f4 brne .+2 ; 0x119da 119d8: 53 c0 rjmp .+166 ; 0x11a80 // 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; 119da: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 119de: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 119e2: fc 01 movw r30, r24 119e4: e5 5b subi r30, 0xB5 ; 181 119e6: ff 4e sbci r31, 0xEF ; 239 119e8: 23 e0 ldi r18, 0x03 ; 3 119ea: 20 83 st Z, r18 119ec: 82 5b subi r24, 0xB2 ; 178 119ee: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 119f0: 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) 119f2: ff 20 and r15, r15 119f4: e9 f1 breq .+122 ; 0x11a70 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 119f6: 0f 94 54 a1 call 0x342a8 ; 0x342a8 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 119fa: 8e ec ldi r24, 0xCE ; 206 119fc: 91 ea ldi r25, 0xA1 ; 161 119fe: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(MSG_Enqueing); 11a02: 8f e9 ldi r24, 0x9F ; 159 11a04: 92 e6 ldi r25, 0x62 ; 98 11a06: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 11a0a: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 11a0e: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 11a12: 82 5b subi r24, 0xB2 ; 178 11a14: 9f 4e sbci r25, 0xEF ; 239 11a16: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_ECHOLNPGM("\""); 11a1a: 8a e7 ldi r24, 0x7A ; 122 11a1c: 92 e7 ldi r25, 0x72 ; 114 11a1e: 0e 94 8d 7c call 0xf91a ; 0xf91a bufindw += len + (CMDHDRSIZE + 1); 11a22: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 11a26: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 11a2a: 04 96 adiw r24, 0x04 ; 4 11a2c: 08 0f add r16, r24 11a2e: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 11a30: 0d 3e cpi r16, 0xED ; 237 11a32: 81 e0 ldi r24, 0x01 ; 1 11a34: 18 07 cpc r17, r24 11a36: f9 f0 breq .+62 ; 0x11a76 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 11a38: 10 93 4a 10 sts 0x104A, r17 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 11a3c: 00 93 49 10 sts 0x1049, r16 ; 0x801049 <_ZL7bufindw.lto_priv.514> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11a40: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11a44: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11a48: 01 96 adiw r24, 0x01 ; 1 11a4a: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 11a4e: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11a52: df 91 pop r29 11a54: cf 91 pop r28 11a56: 1f 91 pop r17 11a58: 0f 91 pop r16 11a5a: ff 90 pop r15 11a5c: 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); 11a5e: fc 01 movw r30, r24 11a60: 01 90 ld r0, Z+ 11a62: 00 20 and r0, r0 11a64: e9 f7 brne .-6 ; 0x11a60 11a66: 31 97 sbiw r30, 0x01 ; 1 11a68: 8f 01 movw r16, r30 11a6a: 08 1b sub r16, r24 11a6c: 19 0b sbc r17, r25 11a6e: af cf rjmp .-162 ; 0x119ce // 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); 11a70: 0f 94 08 aa call 0x35410 ; 0x35410 11a74: c2 cf rjmp .-124 ; 0x119fa SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11a76: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 11a7a: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.514> 11a7e: e0 cf rjmp .-64 ; 0x11a40 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 11a80: 81 eb ldi r24, 0xB1 ; 177 11a82: 91 ea ldi r25, 0xA1 ; 161 11a84: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(MSG_Enqueing); 11a88: 8f e9 ldi r24, 0x9F ; 159 11a8a: 92 e6 ldi r25, 0x62 ; 98 11a8c: 0e 94 94 7a call 0xf528 ; 0xf528 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 11a90: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 11a92: ff 20 and r15, r15 11a94: 59 f0 breq .+22 ; 0x11aac SERIAL_PROTOCOLRPGM(cmd); 11a96: 0e 94 94 7a call 0xf528 ; 0xf528 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11a9a: 8f e7 ldi r24, 0x7F ; 127 11a9c: 91 ea ldi r25, 0xA1 ; 161 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11a9e: df 91 pop r29 11aa0: cf 91 pop r28 11aa2: 1f 91 pop r17 11aa4: 0f 91 pop r16 11aa6: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11aa8: 0c 94 8d 7c jmp 0xf91a ; 0xf91a 11aac: 0e 94 86 85 call 0x10b0c ; 0x10b0c 11ab0: f4 cf rjmp .-24 ; 0x11a9a 00011ab2 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 11ab2: cf 93 push r28 11ab4: df 93 push r29 if (menu_item == menu_line) 11ab6: 30 91 63 04 lds r19, 0x0463 ; 0x800463 11aba: 20 91 62 04 lds r18, 0x0462 ; 0x800462 11abe: 32 13 cpse r19, r18 11ac0: 20 c0 rjmp .+64 ; 0x11b02 11ac2: eb 01 movw r28, r22 11ac4: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 11ac6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 11aca: 88 23 and r24, r24 11acc: 19 f0 breq .+6 ; 0x11ad4 11ace: 80 e2 ldi r24, 0x20 ; 32 11ad0: 0e 94 56 72 call 0xe4ac ; 0xe4ac if (menu_clicked && (lcd_encoder == menu_item)) 11ad4: 80 91 61 04 lds r24, 0x0461 ; 0x800461 11ad8: 88 23 and r24, r24 11ada: 99 f0 breq .+38 ; 0x11b02 11adc: 20 91 63 04 lds r18, 0x0463 ; 0x800463 11ae0: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 11ae4: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 11ae8: 28 17 cp r18, r24 11aea: 19 06 cpc r1, r25 11aec: 51 f4 brne .+20 ; 0x11b02 { if (str_gcode) enquecommand_P(str_gcode); 11aee: 20 97 sbiw r28, 0x00 ; 0 11af0: 21 f0 breq .+8 ; 0x11afa 11af2: 61 e0 ldi r22, 0x01 ; 1 11af4: ce 01 movw r24, r28 11af6: 0e 94 da 8c call 0x119b4 ; 0x119b4 menu_item_ret(); return; } } menu_item++; } 11afa: df 91 pop r29 11afc: 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(); 11afe: 0c 94 43 62 jmp 0xc486 ; 0xc486 return; } } menu_item++; 11b02: 80 91 63 04 lds r24, 0x0463 ; 0x800463 11b06: 8f 5f subi r24, 0xFF ; 255 11b08: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } 11b0c: df 91 pop r29 11b0e: cf 91 pop r28 11b10: 08 95 ret 00011b12 : { 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) { 11b12: 0f 93 push r16 11b14: 1f 93 push r17 11b16: cf 93 push r28 11b18: df 93 push r29 11b1a: d6 2f mov r29, r22 11b1c: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 11b1e: c0 e0 ldi r28, 0x00 ; 0 { void * const pgm_ptr = pgm_read_ptr(cmd_sequence + i); 11b20: f8 01 movw r30, r16 11b22: 85 91 lpm r24, Z+ 11b24: 94 91 lpm r25, Z // M702 is currently only used with MMU enabled if (pgm_ptr == MSG_M702 && !MMU2::mmu2.Enabled()) { 11b26: 28 e6 ldi r18, 0x68 ; 104 11b28: 88 3c cpi r24, 0xC8 ; 200 11b2a: 92 07 cpc r25, r18 11b2c: 21 f4 brne .+8 ; 0x11b36 11b2e: 20 91 01 13 lds r18, 0x1301 ; 0x801301 11b32: 21 30 cpi r18, 0x01 ; 1 11b34: 19 f4 brne .+6 ; 0x11b3c continue; } enquecommand_P(static_cast(pgm_ptr)); 11b36: 61 e0 ldi r22, 0x01 ; 1 11b38: 0e 94 da 8c call 0x119b4 ; 0x119b4 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) 11b3c: cf 5f subi r28, 0xFF ; 255 11b3e: 0e 5f subi r16, 0xFE ; 254 11b40: 1f 4f sbci r17, 0xFF ; 255 11b42: dc 13 cpse r29, r28 11b44: ed cf rjmp .-38 ; 0x11b20 continue; } enquecommand_P(static_cast(pgm_ptr)); } } 11b46: df 91 pop r29 11b48: cf 91 pop r28 11b4a: 1f 91 pop r17 11b4c: 0f 91 pop r16 11b4e: 08 95 ret 00011b50 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 11b50: cf 93 push r28 11b52: df 93 push r29 11b54: cd b7 in r28, 0x3d ; 61 11b56: de b7 in r29, 0x3e ; 62 11b58: 6e 97 sbiw r28, 0x1e ; 30 11b5a: 0f b6 in r0, 0x3f ; 63 11b5c: f8 94 cli 11b5e: de bf out 0x3e, r29 ; 62 11b60: 0f be out 0x3f, r0 ; 63 11b62: cd bf out 0x3d, r28 ; 61 11b64: 9e 01 movw r18, r28 11b66: 2c 5d subi r18, 0xDC ; 220 11b68: 3f 4f sbci r19, 0xFF ; 255 11b6a: f9 01 movw r30, r18 11b6c: 41 91 ld r20, Z+ 11b6e: 51 91 ld r21, Z+ 11b70: 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); 11b72: 6e e1 ldi r22, 0x1E ; 30 11b74: 70 e0 ldi r23, 0x00 ; 0 11b76: ce 01 movw r24, r28 11b78: 01 96 adiw r24, 0x01 ; 1 11b7a: 0f 94 f3 a2 call 0x345e6 ; 0x345e6 va_end(ap); enquecommand(cmd_buffer, false); 11b7e: 60 e0 ldi r22, 0x00 ; 0 11b80: ce 01 movw r24, r28 11b82: 01 96 adiw r24, 0x01 ; 1 11b84: 0e 94 da 8c call 0x119b4 ; 0x119b4 } 11b88: 6e 96 adiw r28, 0x1e ; 30 11b8a: 0f b6 in r0, 0x3f ; 63 11b8c: f8 94 cli 11b8e: de bf out 0x3e, r29 ; 62 11b90: 0f be out 0x3f, r0 ; 63 11b92: cd bf out 0x3d, r28 ; 61 11b94: df 91 pop r29 11b96: cf 91 pop r28 11b98: 08 95 ret 00011b9a : 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() 11b9a: 2f 92 push r2 11b9c: 3f 92 push r3 11b9e: 4f 92 push r4 11ba0: 5f 92 push r5 11ba2: 6f 92 push r6 11ba4: 7f 92 push r7 11ba6: 8f 92 push r8 11ba8: 9f 92 push r9 11baa: af 92 push r10 11bac: bf 92 push r11 11bae: cf 92 push r12 11bb0: df 92 push r13 11bb2: ef 92 push r14 11bb4: ff 92 push r15 11bb6: 0f 93 push r16 11bb8: 1f 93 push r17 11bba: cf 93 push r28 11bbc: df 93 push r29 11bbe: cd b7 in r28, 0x3d ; 61 11bc0: de b7 in r29, 0x3e ; 62 11bc2: c3 56 subi r28, 0x63 ; 99 11bc4: d1 09 sbc r29, r1 11bc6: 0f b6 in r0, 0x3f ; 63 11bc8: f8 94 cli 11bca: de bf out 0x3e, r29 ; 62 11bcc: 0f be out 0x3f, r0 ; 63 11bce: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 11bd0: 82 e0 ldi r24, 0x02 ; 2 11bd2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 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) { 11bd6: 00 91 38 12 lds r16, 0x1238 ; 0x801238 11bda: 10 91 39 12 lds r17, 0x1239 ; 0x801239 11bde: 02 5b subi r16, 0xB2 ; 178 11be0: 1f 4e sbci r17, 0xEF ; 239 11be2: 45 e0 ldi r20, 0x05 ; 5 11be4: 50 e0 ldi r21, 0x00 ; 0 11be6: 66 e5 ldi r22, 0x56 ; 86 11be8: 71 e8 ldi r23, 0x81 ; 129 11bea: c8 01 movw r24, r16 11bec: 0f 94 7c a1 call 0x342f8 ; 0x342f8 11bf0: 89 2b or r24, r25 11bf2: 09 f0 breq .+2 ; 0x11bf6 11bf4: 9b c1 rjmp .+822 ; 0x11f2c eeprom_update_byte_notify((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true); } } bool farm_prusa_code_seen() { if (!farm_mode) 11bf6: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 11bfa: 88 23 and r24, r24 11bfc: 09 f4 brne .+2 ; 0x11c00 11bfe: 4d c0 rjmp .+154 ; 0x11c9a return false; if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN 11c00: 85 e6 ldi r24, 0x65 ; 101 11c02: 9e e7 ldi r25, 0x7E ; 126 11c04: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11c08: 88 23 and r24, r24 11c0a: 79 f0 breq .+30 ; 0x11c2a printf_P(_N("%u"), status_number); 11c0c: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.492> 11c10: 1f 92 push r1 11c12: 8f 93 push r24 11c14: 82 e0 ldi r24, 0x02 ; 2 11c16: 95 e6 ldi r25, 0x65 ; 101 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 11c18: 9f 93 push r25 11c1a: 8f 93 push r24 11c1c: 0f 94 5f a2 call 0x344be ; 0x344be 11c20: 0f 90 pop r0 11c22: 0f 90 pop r0 11c24: 0f 90 pop r0 11c26: 0f 90 pop r0 11c28: 08 c0 rjmp .+16 ; 0x11c3a } else if (code_seen_P(PSTR("thx"))) { // PRUSA thx 11c2a: 81 e6 ldi r24, 0x61 ; 97 11c2c: 9e e7 ldi r25, 0x7E ; 126 11c2e: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11c32: 88 23 and r24, r24 11c34: 41 f0 breq .+16 ; 0x11c46 no_response = false; 11c36: 10 92 08 04 sts 0x0408, r1 ; 0x800408 <_ZL11no_response.lto_priv.493> SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 11c3a: 81 e0 ldi r24, 0x01 ; 1 11c3c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 ClearToSend(); 11c40: 0e 94 1a 83 call 0x10634 ; 0x10634 11c44: 3a c2 rjmp .+1140 ; 0x120ba trace(); prusa_sd_card_upload = true; card.openFileWrite(strchr_pointer+4); } #endif //PRUSA_M28 else if (code_seen_P(PSTR("fv"))) { // PRUSA fv 11c46: 8e e5 ldi r24, 0x5E ; 94 11c48: 9e e7 ldi r25, 0x7E ; 126 11c4a: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11c4e: 88 23 and r24, r24 11c50: 21 f1 breq .+72 ; 0x11c9a // get file version #ifdef SDSUPPORT card.openFileReadFilteredGcode(strchr_pointer + 3, true); 11c52: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 11c56: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 11c5a: 61 e0 ldi r22, 0x01 ; 1 11c5c: 03 96 adiw r24, 0x03 ; 3 11c5e: 0f 94 b0 71 call 0x2e360 ; 0x2e360 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 11c62: 0f 94 c0 6c call 0x2d980 ; 0x2d980 11c66: 8c 01 movw r16, r24 sdpos = file.curPosition(); 11c68: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 11c6c: 90 91 70 16 lds r25, 0x1670 ; 0x801670 11c70: a0 91 71 16 lds r26, 0x1671 ; 0x801671 11c74: b0 91 72 16 lds r27, 0x1672 ; 0x801672 11c78: 80 93 eb 16 sts 0x16EB, r24 ; 0x8016eb 11c7c: 90 93 ec 16 sts 0x16EC, r25 ; 0x8016ec 11c80: a0 93 ed 16 sts 0x16ED, r26 ; 0x8016ed 11c84: b0 93 ee 16 sts 0x16EE, r27 ; 0x8016ee while (true) { uint16_t readByte = card.getFilteredGcodeChar(); MYSERIAL.write(readByte); 11c88: 80 2f mov r24, r16 11c8a: 0e 94 81 79 call 0xf302 ; 0xf302 if (readByte == '\n') { 11c8e: 0a 30 cpi r16, 0x0A ; 10 11c90: 11 05 cpc r17, r1 11c92: 39 f7 brne .-50 ; 0x11c62 break; } } card.closefile(); 11c94: 0f 94 d1 65 call 0x2cba2 ; 0x2cba2 11c98: d0 cf rjmp .-96 ; 0x11c3a - `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"))) { 11c9a: 8c e4 ldi r24, 0x4C ; 76 11c9c: 91 e8 ldi r25, 0x81 ; 129 11c9e: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11ca2: 81 11 cpse r24, r1 11ca4: ca cf rjmp .-108 ; 0x11c3a gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 11ca6: 88 e4 ldi r24, 0x48 ; 72 11ca8: 91 e8 ldi r25, 0x81 ; 129 11caa: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11cae: 88 23 and r24, r24 11cb0: 21 f1 breq .+72 ; 0x11cfa printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 11cb2: 40 91 b9 03 lds r20, 0x03B9 ; 0x8003b9 11cb6: 50 91 ba 03 lds r21, 0x03BA ; 0x8003ba 11cba: 2c e3 ldi r18, 0x3C ; 60 11cbc: 24 9f mul r18, r20 11cbe: c0 01 movw r24, r0 11cc0: 25 9f mul r18, r21 11cc2: 90 0d add r25, r0 11cc4: 11 24 eor r1, r1 11cc6: 9f 93 push r25 11cc8: 8f 93 push r24 11cca: 40 91 b7 03 lds r20, 0x03B7 ; 0x8003b7 11cce: 50 91 b8 03 lds r21, 0x03B8 ; 0x8003b8 11cd2: 24 9f mul r18, r20 11cd4: c0 01 movw r24, r0 11cd6: 25 9f mul r18, r21 11cd8: 90 0d add r25, r0 11cda: 11 24 eor r1, r1 11cdc: 9f 93 push r25 11cde: 8f 93 push r24 11ce0: 86 e3 ldi r24, 0x36 ; 54 11ce2: 97 e6 ldi r25, 0x67 ; 103 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 11ce4: 9f 93 push r25 11ce6: 8f 93 push r24 11ce8: 0f 94 5f a2 call 0x344be ; 0x344be 11cec: 0f 90 pop r0 11cee: 0f 90 pop r0 11cf0: 0f 90 pop r0 11cf2: 0f 90 pop r0 11cf4: 0f 90 pop r0 11cf6: 0f 90 pop r0 11cf8: a0 cf rjmp .-192 ; 0x11c3a 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 11cfa: 83 e4 ldi r24, 0x43 ; 67 11cfc: 91 e8 ldi r25, 0x81 ; 129 11cfe: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11d02: 88 23 and r24, r24 11d04: 11 f1 breq .+68 ; 0x11d4a if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 11d06: 8c e8 ldi r24, 0x8C ; 140 11d08: 9f e0 ldi r25, 0x0F ; 15 11d0a: 0f 94 9d a3 call 0x3473a ; 0x3473a 11d0e: 81 11 cpse r24, r1 11d10: 10 c0 rjmp .+32 ; 0x11d32 // M24 - Start SD print enquecommand_P(MSG_M24); 11d12: 61 e0 ldi r22, 0x01 ; 1 11d14: 83 e6 ldi r24, 0x63 ; 99 11d16: 9c e6 ldi r25, 0x6C ; 108 11d18: 0e 94 da 8c call 0x119b4 ; 0x119b4 11d1c: 60 e0 ldi r22, 0x00 ; 0 11d1e: 85 ea ldi r24, 0xA5 ; 165 11d20: 9f e0 ldi r25, 0x0F ; 15 11d22: 0f 94 c1 a3 call 0x34782 ; 0x34782 11d26: 60 e0 ldi r22, 0x00 ; 0 11d28: 8f e7 ldi r24, 0x7F ; 127 11d2a: 9c e0 ldi r25, 0x0C ; 12 11d2c: 0f 94 c1 a3 call 0x34782 ; 0x34782 11d30: 84 cf rjmp .-248 ; 0x11c3a // 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) { 11d32: 81 30 cpi r24, 0x01 ; 1 11d34: 09 f0 breq .+2 ; 0x11d38 11d36: 81 cf rjmp .-254 ; 0x11c3a // 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(); 11d38: 0f 94 da 16 call 0x22db4 ; 0x22db4 usb_timer.start(); 11d3c: 82 e4 ldi r24, 0x42 ; 66 11d3e: 92 e1 ldi r25, 0x12 ; 18 11d40: 0f 94 b4 0b call 0x21768 ; 0x21768 ::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(); 11d44: 0f 94 62 0b call 0x216c4 ; 0x216c4 11d48: 78 cf rjmp .-272 ; 0x11c3a } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 11d4a: 8c e3 ldi r24, 0x3C ; 60 11d4c: 91 e8 ldi r25, 0x81 ; 129 11d4e: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11d52: 88 23 and r24, r24 11d54: 21 f0 breq .+8 ; 0x11d5e break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 11d56: 80 e0 ldi r24, 0x00 ; 0 11d58: 0f 94 00 95 call 0x32a00 ; 0x32a00 11d5c: 6e cf rjmp .-292 ; 0x11c3a MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 11d5e: 86 e3 ldi r24, 0x36 ; 54 11d60: 91 e8 ldi r25, 0x81 ; 129 11d62: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11d66: 81 11 cpse r24, r1 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 11d68: 0e 94 ef 65 call 0xcbde ; 0xcbde } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 11d6c: 83 e3 ldi r24, 0x33 ; 51 11d6e: 91 e8 ldi r25, 0x81 ; 129 11d70: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11d74: 88 23 and r24, r24 11d76: a9 f0 breq .+42 ; 0x11da2 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 11d78: 44 e1 ldi r20, 0x14 ; 20 11d7a: 50 e0 ldi r21, 0x00 ; 0 11d7c: 65 e1 ldi r22, 0x15 ; 21 11d7e: 7d e0 ldi r23, 0x0D ; 13 11d80: ce 01 movw r24, r28 11d82: 01 96 adiw r24, 0x01 ; 1 11d84: 0f 94 8d a3 call 0x3471a ; 0x3471a if (SN[19]) 11d88: 8c 89 ldd r24, Y+20 ; 0x14 11d8a: 88 23 and r24, r24 11d8c: 29 f0 breq .+10 ; 0x11d98 puts_P(PSTR("SN invalid")); 11d8e: 88 e2 ldi r24, 0x28 ; 40 11d90: 91 e8 ldi r25, 0x81 ; 129 11d92: 0f 94 86 a2 call 0x3450c ; 0x3450c 11d96: 51 cf rjmp .-350 ; 0x11c3a else puts(SN); 11d98: ce 01 movw r24, r28 11d9a: 01 96 adiw r24, 0x01 ; 1 11d9c: 0f 94 2c aa call 0x35458 ; 0x35458 11da0: 4c cf rjmp .-360 ; 0x11c3a } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 11da2: 84 e2 ldi r24, 0x24 ; 36 11da4: 91 e8 ldi r25, 0x81 ; 129 11da6: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11daa: 88 23 and r24, r24 11dac: 29 f0 breq .+10 ; 0x11db8 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 11dae: 88 e1 ldi r24, 0x18 ; 24 11db0: 91 e8 ldi r25, 0x81 ; 129 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 11db2: 0e 94 8d 7c call 0xf91a ; 0xf91a 11db6: 41 cf rjmp .-382 ; 0x11c3a 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 11db8: 84 e1 ldi r24, 0x14 ; 20 11dba: 91 e8 ldi r25, 0x81 ; 129 11dbc: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11dc0: 88 23 and r24, r24 11dc2: 19 f0 breq .+6 ; 0x11dca SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 11dc4: 85 ef ldi r24, 0xF5 ; 245 11dc6: 90 e8 ldi r25, 0x80 ; 128 11dc8: f4 cf rjmp .-24 ; 0x11db2 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 11dca: 80 ef ldi r24, 0xF0 ; 240 11dcc: 90 e8 ldi r25, 0x80 ; 128 11dce: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11dd2: 88 23 and r24, r24 11dd4: 19 f0 breq .+6 ; 0x11ddc lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 11dd6: 0e 94 0d 74 call 0xe81a ; 0xe81a 11dda: 2f cf rjmp .-418 ; 0x11c3a 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 11ddc: 8d ee ldi r24, 0xED ; 237 11dde: 90 e8 ldi r25, 0x80 ; 128 11de0: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11de4: 88 23 and r24, r24 11de6: 79 f0 breq .+30 ; 0x11e06 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 11de8: 81 ea ldi r24, 0xA1 ; 161 11dea: 9d e0 ldi r25, 0x0D ; 13 11dec: 0f 94 9d a3 call 0x3473a ; 0x3473a 11df0: 2b e0 ldi r18, 0x0B ; 11 11df2: 82 9f mul r24, r18 11df4: c0 01 movw r24, r0 11df6: 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); 11df8: 70 e0 ldi r23, 0x00 ; 0 11dfa: 60 e0 ldi r22, 0x00 ; 0 11dfc: 80 5b subi r24, 0xB0 ; 176 11dfe: 92 4f sbci r25, 0xF2 ; 242 11e00: 0f 94 df a3 call 0x347be ; 0x347be 11e04: 1a cf rjmp .-460 ; 0x11c3a } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 11e06: 8a ee ldi r24, 0xEA ; 234 11e08: 90 e8 ldi r25, 0x80 ; 128 11e0a: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11e0e: 88 23 and r24, r24 11e10: 51 f0 breq .+20 ; 0x11e26 // 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(); 11e12: 0e 94 f6 6f call 0xdfec ; 0xdfec Sound_MakeCustom(100,0,false); 11e16: 40 e0 ldi r20, 0x00 ; 0 11e18: 70 e0 ldi r23, 0x00 ; 0 11e1a: 60 e0 ldi r22, 0x00 ; 0 11e1c: 84 e6 ldi r24, 0x64 ; 100 11e1e: 90 e0 ldi r25, 0x00 ; 0 11e20: 0f 94 55 25 call 0x24aaa ; 0x24aaa 11e24: d8 cf rjmp .-80 ; 0x11dd6 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 11e26: 86 ee ldi r24, 0xE6 ; 230 11e28: 90 e8 ldi r25, 0x80 ; 128 11e2a: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11e2e: 88 23 and r24, r24 11e30: e1 f0 breq .+56 ; 0x11e6a // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 11e32: 86 e5 ldi r24, 0x56 ; 86 11e34: 0e 94 f5 55 call 0xabea ; 0xabea 11e38: 88 23 and r24, r24 11e3a: 09 f4 brne .+2 ; 0x11e3e 11e3c: fe ce rjmp .-516 ; 0x11c3a bool value = code_value_short(); 11e3e: 0e 94 17 56 call 0xac2e ; 0xac2e 11e42: 11 e0 ldi r17, 0x01 ; 1 11e44: 89 2b or r24, r25 11e46: 09 f4 brne .+2 ; 0x11e4a 11e48: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 11e4a: 0f 94 b0 18 call 0x23160 ; 0x23160 if(value != mbl.active) { 11e4e: 80 91 09 13 lds r24, 0x1309 ; 0x801309 11e52: 90 e0 ldi r25, 0x00 ; 0 11e54: 18 17 cp r17, r24 11e56: 19 06 cpc r1, r25 11e58: 09 f4 brne .+2 ; 0x11e5c 11e5a: ef ce rjmp .-546 ; 0x11c3a mbl.active = value; 11e5c: 10 93 09 13 sts 0x1309, r17 ; 0x801309 // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 11e60: 89 e6 ldi r24, 0x69 ; 105 11e62: 92 e1 ldi r25, 0x12 ; 18 11e64: 0f 94 95 3a call 0x2752a ; 0x2752a 11e68: e8 ce rjmp .-560 ; 0x11c3a } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 11e6a: 8f ed ldi r24, 0xDF ; 223 11e6c: 90 e8 ldi r25, 0x80 ; 128 11e6e: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11e72: 88 23 and r24, r24 11e74: 09 f4 brne .+2 ; 0x11e78 11e76: e1 ce rjmp .-574 ; 0x11c3a uint16_t nDiameter; if(code_seen('D')) { 11e78: 84 e4 ldi r24, 0x44 ; 68 11e7a: 0e 94 f5 55 call 0xabea ; 0xabea 11e7e: 88 23 and r24, r24 11e80: a1 f0 breq .+40 ; 0x11eaa nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 11e82: 0e 94 85 5a call 0xb50a ; 0xb50a 11e86: 20 e0 ldi r18, 0x00 ; 0 11e88: 30 e0 ldi r19, 0x00 ; 0 11e8a: 4a e7 ldi r20, 0x7A ; 122 11e8c: 54 e4 ldi r21, 0x44 ; 68 11e8e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 11e92: 20 e0 ldi r18, 0x00 ; 0 11e94: 30 e0 ldi r19, 0x00 ; 0 11e96: 40 e0 ldi r20, 0x00 ; 0 11e98: 5f e3 ldi r21, 0x3F ; 63 11e9a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 11e9e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> nozzle_diameter_check(nDiameter); 11ea2: cb 01 movw r24, r22 11ea4: 0e 94 0f e9 call 0x1d21e ; 0x1d21e 11ea8: c8 ce rjmp .-624 ; 0x11c3a } else if(code_seen_P(PSTR("set")) && farm_mode) { 11eaa: 8b ed ldi r24, 0xDB ; 219 11eac: 90 e8 ldi r25, 0x80 ; 128 11eae: 0f 94 eb 39 call 0x273d6 ; 0x273d6 11eb2: 88 23 and r24, r24 11eb4: 49 f1 breq .+82 ; 0x11f08 11eb6: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 11eba: 88 23 and r24, r24 11ebc: 29 f1 breq .+74 ; 0x11f08 strchr_pointer++; // skip 1st char (~ 's') strchr_pointer++; // skip 2nd char (~ 'e') 11ebe: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 11ec2: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 11ec6: 02 96 adiw r24, 0x02 ; 2 11ec8: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 11ecc: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 11ed0: 0e 94 85 5a call 0xb50a ; 0xb50a 11ed4: 6b 01 movw r12, r22 11ed6: 7c 01 movw r14, r24 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 11ed8: 6f ef ldi r22, 0xFF ; 255 11eda: 87 ea ldi r24, 0xA7 ; 167 11edc: 9d e0 ldi r25, 0x0D ; 13 11ede: 0f 94 c1 a3 call 0x34782 ; 0x34782 11ee2: 20 e0 ldi r18, 0x00 ; 0 11ee4: 30 e0 ldi r19, 0x00 ; 0 11ee6: 4a e7 ldi r20, 0x7A ; 122 11ee8: 54 e4 ldi r21, 0x44 ; 68 11eea: c7 01 movw r24, r14 11eec: b6 01 movw r22, r12 11eee: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 11ef2: 20 e0 ldi r18, 0x00 ; 0 11ef4: 30 e0 ldi r19, 0x00 ; 0 11ef6: 40 e0 ldi r20, 0x00 ; 0 11ef8: 5f e3 ldi r21, 0x3F ; 63 11efa: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 11efe: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 11f02: 85 ea ldi r24, 0xA5 ; 165 11f04: 9d e0 ldi r25, 0x0D ; 13 11f06: 7c cf rjmp .-264 ; 0x11e00 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); 11f08: 85 ea ldi r24, 0xA5 ; 165 11f0a: 9d e0 ldi r25, 0x0D ; 13 11f0c: 0f 94 ab a3 call 0x34756 ; 0x34756 11f10: bc 01 movw r22, r24 11f12: 90 e0 ldi r25, 0x00 ; 0 11f14: 80 e0 ldi r24, 0x00 ; 0 11f16: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 11f1a: 20 e0 ldi r18, 0x00 ; 0 11f1c: 30 e0 ldi r19, 0x00 ; 0 11f1e: 4a e7 ldi r20, 0x7A ; 122 11f20: 54 e4 ldi r21, 0x44 ; 68 11f22: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 11f26: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 11f2a: 87 ce rjmp .-754 ; 0x11c3a } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 11f2c: d8 01 movw r26, r16 11f2e: 8c 91 ld r24, X 11f30: 87 34 cpi r24, 0x47 ; 71 11f32: 11 f0 breq .+4 ; 0x11f38 11f34: 0c 94 c1 9a jmp 0x13582 ; 0x13582 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 11f38: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 11f3c: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb gcode_in_progress = code_value_short(); 11f40: 0e 94 17 56 call 0xac2e ; 0xac2e 11f44: 90 93 56 03 sts 0x0356, r25 ; 0x800356 11f48: 80 93 55 03 sts 0x0355, r24 ; 0x800355 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 11f4c: 8b 34 cpi r24, 0x4B ; 75 11f4e: 91 05 cpc r25, r1 11f50: 09 f4 brne .+2 ; 0x11f54 11f52: 45 c6 rjmp .+3210 ; 0x12bde 11f54: 0c f0 brlt .+2 ; 0x11f58 11f56: 4b c1 rjmp .+662 ; 0x121ee 11f58: 84 30 cpi r24, 0x04 ; 4 11f5a: 91 05 cpc r25, r1 11f5c: 09 f4 brne .+2 ; 0x11f60 11f5e: aa c5 rjmp .+2900 ; 0x12ab4 11f60: 0c f0 brlt .+2 ; 0x11f64 11f62: c5 c0 rjmp .+394 ; 0x120ee 11f64: 97 fd sbrc r25, 7 11f66: cf c0 rjmp .+414 ; 0x12106 11f68: 02 97 sbiw r24, 0x02 ; 2 11f6a: 0c f0 brlt .+2 ; 0x11f6e 11f6c: a2 c1 rjmp .+836 ; 0x122b2 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 11f6e: 0e 94 b1 54 call 0xa962 ; 0xa962 11f72: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 11f74: 0e 94 ac 5b call 0xb758 ; 0xb758 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 11f78: 60 91 17 06 lds r22, 0x0617 ; 0x800617 11f7c: 70 91 18 06 lds r23, 0x0618 ; 0x800618 11f80: 80 91 19 06 lds r24, 0x0619 ; 0x800619 11f84: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 11f88: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 11f8c: 6b 01 movw r12, r22 11f8e: 7c 01 movw r14, r24 11f90: 40 90 6d 12 lds r4, 0x126D ; 0x80126d 11f94: 50 90 6e 12 lds r5, 0x126E ; 0x80126e 11f98: 60 90 6f 12 lds r6, 0x126F ; 0x80126f 11f9c: 70 90 70 12 lds r7, 0x1270 ; 0x801270 11fa0: 80 90 35 06 lds r8, 0x0635 ; 0x800635 11fa4: 90 90 36 06 lds r9, 0x0636 ; 0x800636 11fa8: a0 90 37 06 lds r10, 0x0637 ; 0x800637 11fac: b0 90 38 06 lds r11, 0x0638 ; 0x800638 11fb0: a5 01 movw r20, r10 11fb2: 94 01 movw r18, r8 11fb4: c3 01 movw r24, r6 11fb6: b2 01 movw r22, r4 11fb8: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 11fbc: 20 e0 ldi r18, 0x00 ; 0 11fbe: 30 e0 ldi r19, 0x00 ; 0 11fc0: 48 ec ldi r20, 0xC8 ; 200 11fc2: 52 e4 ldi r21, 0x42 ; 66 11fc4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 11fc8: 9b 01 movw r18, r22 11fca: ac 01 movw r20, r24 11fcc: c7 01 movw r24, r14 11fce: b6 01 movw r22, r12 11fd0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 11fd4: 18 16 cp r1, r24 11fd6: d4 f4 brge .+52 ; 0x1200c total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 11fd8: a3 01 movw r20, r6 11fda: 92 01 movw r18, r4 11fdc: c5 01 movw r24, r10 11fde: b4 01 movw r22, r8 11fe0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 11fe4: 20 e0 ldi r18, 0x00 ; 0 11fe6: 30 e0 ldi r19, 0x00 ; 0 11fe8: 48 ec ldi r20, 0xC8 ; 200 11fea: 52 e4 ldi r21, 0x42 ; 66 11fec: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 11ff0: a7 01 movw r20, r14 11ff2: 96 01 movw r18, r12 11ff4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 11ff8: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 11ffc: 60 93 17 06 sts 0x0617, r22 ; 0x800617 12000: 70 93 18 06 sts 0x0618, r23 ; 0x800618 12004: 80 93 19 06 sts 0x0619, r24 ; 0x800619 12008: 90 93 1a 06 sts 0x061A, r25 ; 0x80061a } #ifdef FWRETRACT if(cs.autoretract_enabled) { 1200c: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 12010: 88 23 and r24, r24 12012: 09 f4 brne .+2 ; 0x12016 12014: 46 c1 rjmp .+652 ; 0x122a2 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 12016: 88 e5 ldi r24, 0x58 ; 88 12018: 0e 94 f5 55 call 0xabea ; 0xabea 1201c: 81 11 cpse r24, r1 1201e: 41 c1 rjmp .+642 ; 0x122a2 12020: 89 e5 ldi r24, 0x59 ; 89 12022: 0e 94 f5 55 call 0xabea ; 0xabea 12026: 81 11 cpse r24, r1 12028: 3c c1 rjmp .+632 ; 0x122a2 1202a: 8a e5 ldi r24, 0x5A ; 90 1202c: 0e 94 f5 55 call 0xabea ; 0xabea 12030: 81 11 cpse r24, r1 12032: 37 c1 rjmp .+622 ; 0x122a2 12034: 85 e4 ldi r24, 0x45 ; 69 12036: 0e 94 f5 55 call 0xabea ; 0xabea 1203a: 88 23 and r24, r24 1203c: 09 f4 brne .+2 ; 0x12040 1203e: 31 c1 rjmp .+610 ; 0x122a2 float echange=destination[E_AXIS]-current_position[E_AXIS]; 12040: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 12044: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 12048: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 1204c: 50 91 70 12 lds r21, 0x1270 ; 0x801270 12050: 60 91 35 06 lds r22, 0x0635 ; 0x800635 12054: 70 91 36 06 lds r23, 0x0636 ; 0x800636 12058: 80 91 37 06 lds r24, 0x0637 ; 0x800637 1205c: 90 91 38 06 lds r25, 0x0638 ; 0x800638 12060: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 12064: 6b 01 movw r12, r22 12066: 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 12068: 2d ec ldi r18, 0xCD ; 205 1206a: 3c ec ldi r19, 0xCC ; 204 1206c: 4c ec ldi r20, 0xCC ; 204 1206e: 5d eb ldi r21, 0xBD ; 189 12070: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 12074: 87 ff sbrs r24, 7 12076: 07 c1 rjmp .+526 ; 0x12286 12078: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 1207c: 81 11 cpse r24, r1 1207e: 0c 94 fe b9 jmp 0x173fc ; 0x173fc st_synchronize(); 12082: 0f 94 b0 18 call 0x23160 ; 0x23160 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 12086: 80 91 35 06 lds r24, 0x0635 ; 0x800635 1208a: 90 91 36 06 lds r25, 0x0636 ; 0x800636 1208e: a0 91 37 06 lds r26, 0x0637 ; 0x800637 12092: b0 91 38 06 lds r27, 0x0638 ; 0x800638 12096: 80 93 6d 12 sts 0x126D, r24 ; 0x80126d 1209a: 90 93 6e 12 sts 0x126E, r25 ; 0x80126e 1209e: a0 93 6f 12 sts 0x126F, r26 ; 0x80126f 120a2: b0 93 70 12 sts 0x1270, r27 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 120a6: 8d e6 ldi r24, 0x6D ; 109 120a8: 92 e1 ldi r25, 0x12 ; 18 120aa: 0f 94 62 3a call 0x274c4 ; 0x274c4 retract(!retracted[active_extruder]); 120ae: 90 91 1b 06 lds r25, 0x061B ; 0x80061b 120b2: 81 e0 ldi r24, 0x01 ; 1 120b4: 89 27 eor r24, r25 120b6: 0f 94 e9 8f call 0x31fd2 ; 0x31fd2 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 120ba: cd 59 subi r28, 0x9D ; 157 120bc: df 4f sbci r29, 0xFF ; 255 120be: 0f b6 in r0, 0x3f ; 63 120c0: f8 94 cli 120c2: de bf out 0x3e, r29 ; 62 120c4: 0f be out 0x3f, r0 ; 63 120c6: cd bf out 0x3d, r28 ; 61 120c8: df 91 pop r29 120ca: cf 91 pop r28 120cc: 1f 91 pop r17 120ce: 0f 91 pop r16 120d0: ff 90 pop r15 120d2: ef 90 pop r14 120d4: df 90 pop r13 120d6: cf 90 pop r12 120d8: bf 90 pop r11 120da: af 90 pop r10 120dc: 9f 90 pop r9 120de: 8f 90 pop r8 120e0: 7f 90 pop r7 120e2: 6f 90 pop r6 120e4: 5f 90 pop r5 120e6: 4f 90 pop r4 120e8: 3f 90 pop r3 120ea: 2f 90 pop r2 120ec: 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) 120ee: 85 31 cpi r24, 0x15 ; 21 120f0: 91 05 cpc r25, r1 120f2: 09 f4 brne .+2 ; 0x120f6 120f4: d9 c0 rjmp .+434 ; 0x122a8 120f6: fc f4 brge .+62 ; 0x12136 120f8: 8a 30 cpi r24, 0x0A ; 10 120fa: 91 05 cpc r25, r1 120fc: 09 f4 brne .+2 ; 0x12100 120fe: 23 c5 rjmp .+2630 ; 0x12b46 12100: 0b 97 sbiw r24, 0x0b ; 11 12102: 09 f4 brne .+2 ; 0x12106 12104: 24 c5 rjmp .+2632 ; 0x12b4e case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 12106: 80 91 38 12 lds r24, 0x1238 ; 0x801238 1210a: 90 91 39 12 lds r25, 0x1239 ; 0x801239 1210e: 82 5b subi r24, 0xB2 ; 178 12110: 9f 4e sbci r25, 0xEF ; 239 12112: 9f 93 push r25 12114: 8f 93 push r24 12116: 1f 92 push r1 12118: 87 e4 ldi r24, 0x47 ; 71 1211a: 8f 93 push r24 1211c: 88 e5 ldi r24, 0x58 ; 88 1211e: 96 e6 ldi r25, 0x66 ; 102 12120: 9f 93 push r25 12122: 8f 93 push r24 12124: 0f 94 5f a2 call 0x344be ; 0x344be 12128: 0f 90 pop r0 1212a: 0f 90 pop r0 1212c: 0f 90 pop r0 1212e: 0f 90 pop r0 12130: 0f 90 pop r0 12132: 0f 90 pop r0 12134: b9 c0 rjmp .+370 ; 0x122a8 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) 12136: 8c 31 cpi r24, 0x1C ; 28 12138: 91 05 cpc r25, r1 1213a: 09 f4 brne .+2 ; 0x1213e 1213c: 0a c5 rjmp .+2580 ; 0x12b52 1213e: 4e 97 sbiw r24, 0x1e ; 30 12140: 11 f7 brne .-60 ; 0x12106 Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 12142: 0f 94 b0 18 call 0x23160 ; 0x23160 homing_flag = true; 12146: 81 e0 ldi r24, 0x01 ; 1 12148: 80 93 71 12 sts 0x1271, r24 ; 0x801271 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 1214c: 0e 94 36 65 call 0xca6c ; 0xca6c 12150: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 12152: 80 e0 ldi r24, 0x00 ; 0 12154: 90 e0 ldi r25, 0x00 ; 0 12156: a8 e4 ldi r26, 0x48 ; 72 12158: b4 e4 ldi r27, 0x44 ; 68 1215a: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 1215e: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 12162: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 12166: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d find_bed_induction_sensor_point_z(-10.f, 3); 1216a: 43 e0 ldi r20, 0x03 ; 3 1216c: 60 e0 ldi r22, 0x00 ; 0 1216e: 70 e0 ldi r23, 0x00 ; 0 12170: 80 e2 ldi r24, 0x20 ; 32 12172: 91 ec ldi r25, 0xC1 ; 193 12174: 0f 94 aa 7b call 0x2f754 ; 0x2f754 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 12178: 70 90 69 12 lds r7, 0x1269 ; 0x801269 1217c: 60 90 6a 12 lds r6, 0x126A ; 0x80126a 12180: 50 90 6b 12 lds r5, 0x126B ; 0x80126b 12184: 40 90 6c 12 lds r4, 0x126C ; 0x80126c 12188: b0 90 65 12 lds r11, 0x1265 ; 0x801265 1218c: a0 90 66 12 lds r10, 0x1266 ; 0x801266 12190: 90 90 67 12 lds r9, 0x1267 ; 0x801267 12194: 80 90 68 12 lds r8, 0x1268 ; 0x801268 12198: f0 90 61 12 lds r15, 0x1261 ; 0x801261 1219c: e0 90 62 12 lds r14, 0x1262 ; 0x801262 121a0: d0 90 63 12 lds r13, 0x1263 ; 0x801263 121a4: c0 90 64 12 lds r12, 0x1264 ; 0x801264 121a8: 8e e6 ldi r24, 0x6E ; 110 121aa: 94 e4 ldi r25, 0x44 ; 68 121ac: 0e 94 0a 75 call 0xea14 ; 0xea14 121b0: 4f 92 push r4 121b2: 5f 92 push r5 121b4: 6f 92 push r6 121b6: 7f 92 push r7 121b8: 8f 92 push r8 121ba: 9f 92 push r9 121bc: af 92 push r10 121be: bf 92 push r11 121c0: cf 92 push r12 121c2: df 92 push r13 121c4: ef 92 push r14 121c6: ff 92 push r15 121c8: 9f 93 push r25 121ca: 8f 93 push r24 121cc: 81 e1 ldi r24, 0x11 ; 17 121ce: 97 e6 ldi r25, 0x67 ; 103 121d0: 9f 93 push r25 121d2: 8f 93 push r24 121d4: 0f 94 5f a2 call 0x344be ; 0x344be clean_up_after_endstop_move(l_feedmultiply); 121d8: c8 01 movw r24, r16 121da: 0e 94 1c 65 call 0xca38 ; 0xca38 homing_flag = false; 121de: 10 92 71 12 sts 0x1271, r1 ; 0x801271 121e2: 0f b6 in r0, 0x3f ; 63 121e4: f8 94 cli 121e6: de bf out 0x3e, r29 ; 62 121e8: 0f be out 0x3f, r0 ; 63 121ea: cd bf out 0x3d, r28 ; 61 121ec: 5d c0 rjmp .+186 ; 0x122a8 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) 121ee: 88 35 cpi r24, 0x58 ; 88 121f0: 91 05 cpc r25, r1 121f2: 09 f4 brne .+2 ; 0x121f6 121f4: 59 c0 rjmp .+178 ; 0x122a8 121f6: f4 f4 brge .+60 ; 0x12234 121f8: 81 35 cpi r24, 0x51 ; 81 121fa: 91 05 cpc r25, r1 121fc: 11 f4 brne .+4 ; 0x12202 121fe: 0c 94 07 9a jmp 0x1340e ; 0x1340e 12202: 5c f4 brge .+22 ; 0x1221a 12204: 8c 34 cpi r24, 0x4C ; 76 12206: 91 05 cpc r25, r1 12208: 09 f4 brne .+2 ; 0x1220c 1220a: 0c c5 rjmp .+2584 ; 0x12c24 1220c: 80 35 cpi r24, 0x50 ; 80 1220e: 91 05 cpc r25, r1 12210: 09 f0 breq .+2 ; 0x12214 12212: 79 cf rjmp .-270 ; 0x12106 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 12214: 0e 94 19 7d call 0xfa32 ; 0xfa32 12218: 47 c0 rjmp .+142 ; 0x122a8 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) 1221a: 86 35 cpi r24, 0x56 ; 86 1221c: 91 05 cpc r25, r1 1221e: 11 f4 brne .+4 ; 0x12224 12220: 0c 94 0b 9a jmp 0x13416 ; 0x13416 12224: 87 35 cpi r24, 0x57 ; 87 12226: 91 05 cpc r25, r1 12228: 09 f0 breq .+2 ; 0x1222c 1222a: 6d cf rjmp .-294 ; 0x12106 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 1222c: 80 e1 ldi r24, 0x10 ; 16 1222e: 0e 94 3f d5 call 0x1aa7e ; 0x1aa7e 12232: 3a c0 rjmp .+116 ; 0x122a8 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) 12234: 8c 35 cpi r24, 0x5C ; 92 12236: 91 05 cpc r25, r1 12238: 11 f4 brne .+4 ; 0x1223e 1223a: 0c 94 17 9a jmp 0x1342e ; 0x1342e 1223e: 74 f4 brge .+28 ; 0x1225c 12240: 8a 35 cpi r24, 0x5A ; 90 12242: 91 05 cpc r25, r1 12244: 11 f4 brne .+4 ; 0x1224a 12246: 0c 94 10 9a jmp 0x13420 ; 0x13420 1224a: 8b 35 cpi r24, 0x5B ; 91 1224c: 91 05 cpc r25, r1 1224e: 09 f0 breq .+2 ; 0x12252 12250: 5a cf rjmp .-332 ; 0x12106 /*! ### 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; 12252: 80 91 57 12 lds r24, 0x1257 ; 0x801257 12256: 87 60 ori r24, 0x07 ; 7 12258: 0c 94 13 9a jmp 0x13426 ; 0x13426 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) 1225c: 82 36 cpi r24, 0x62 ; 98 1225e: 91 05 cpc r25, r1 12260: 11 f4 brne .+4 ; 0x12266 12262: 0c 94 ae 9a jmp 0x1355c ; 0x1355c 12266: 83 36 cpi r24, 0x63 ; 99 12268: 91 05 cpc r25, r1 1226a: 09 f0 breq .+2 ; 0x1226e 1226c: 4c cf rjmp .-360 ; 0x12106 lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1226e: 10 92 60 0d sts 0x0D60, r1 ; 0x800d60 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 12272: 60 e0 ldi r22, 0x00 ; 0 12274: 84 ec ldi r24, 0xC4 ; 196 12276: 9f e0 ldi r25, 0x0F ; 15 12278: 0f 94 c1 a3 call 0x34782 ; 0x34782 fCheckModeInit(); // alternatively invoke printer reset } void farm_gcode_g99() { farm_disable(); lcd_update(2); 1227c: 82 e0 ldi r24, 0x02 ; 2 1227e: 0e 94 c9 6e call 0xdd92 ; 0xdd92 12282: 0c 94 bd 9a jmp 0x1357a ; 0x1357a #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 12286: 2d ec ldi r18, 0xCD ; 205 12288: 3c ec ldi r19, 0xCC ; 204 1228a: 4c ec ldi r20, 0xCC ; 204 1228c: 5d e3 ldi r21, 0x3D ; 61 1228e: c7 01 movw r24, r14 12290: b6 01 movw r22, r12 12292: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 12296: 18 16 cp r1, r24 12298: 24 f4 brge .+8 ; 0x122a2 1229a: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 1229e: 81 11 cpse r24, r1 122a0: f0 ce rjmp .-544 ; 0x12082 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 122a2: c8 01 movw r24, r16 122a4: 0e 94 8b 6a call 0xd516 ; 0xd516 #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; 122a8: 10 92 56 03 sts 0x0356, r1 ; 0x800356 122ac: 10 92 55 03 sts 0x0355, r1 ; 0x800355 122b0: c4 cc rjmp .-1656 ; 0x11c3a */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 122b2: 0e 94 b1 54 call 0xa962 ; 0xa962 122b6: 2e 96 adiw r28, 0x0e ; 14 122b8: 9f af std Y+63, r25 ; 0x3f 122ba: 8e af std Y+62, r24 ; 0x3e 122bc: 2e 97 sbiw r28, 0x0e ; 14 #ifdef SF_ARC_FIX bool relative_mode_backup = relative_mode; relative_mode = true; #endif get_coordinates(); // For X Y Z E F 122be: 0e 94 ac 5b call 0xb758 ; 0xb758 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 122c2: 89 e4 ldi r24, 0x49 ; 73 122c4: 0e 94 f5 55 call 0xabea ; 0xabea 122c8: 88 23 and r24, r24 122ca: 09 f4 brne .+2 ; 0x122ce 122cc: a0 c3 rjmp .+1856 ; 0x12a0e 122ce: 0e 94 85 5a call 0xb50a ; 0xb50a 122d2: 60 93 4d 03 sts 0x034D, r22 ; 0x80034d 122d6: 70 93 4e 03 sts 0x034E, r23 ; 0x80034e 122da: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f 122de: 90 93 50 03 sts 0x0350, r25 ; 0x800350 offset[1] = code_seen('J') ? code_value() : 0.f; 122e2: 8a e4 ldi r24, 0x4A ; 74 122e4: 0e 94 f5 55 call 0xabea ; 0xabea 122e8: c1 2c mov r12, r1 122ea: d1 2c mov r13, r1 122ec: 76 01 movw r14, r12 122ee: 88 23 and r24, r24 122f0: 21 f0 breq .+8 ; 0x122fa 122f2: 0e 94 85 5a call 0xb50a ; 0xb50a 122f6: 6b 01 movw r12, r22 122f8: 7c 01 movw r14, r24 122fa: c0 92 51 03 sts 0x0351, r12 ; 0x800351 122fe: d0 92 52 03 sts 0x0352, r13 ; 0x800352 12302: e0 92 53 03 sts 0x0353, r14 ; 0x800353 12306: f0 92 54 03 sts 0x0354, r15 ; 0x800354 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 1230a: e0 91 55 03 lds r30, 0x0355 ; 0x800355 1230e: f0 91 56 03 lds r31, 0x0356 ; 0x800356 12312: a4 96 adiw r28, 0x24 ; 36 12314: ff af std Y+63, r31 ; 0x3f 12316: ee af std Y+62, r30 ; 0x3e 12318: a4 97 sbiw r28, 0x24 ; 36 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 1231a: 80 90 4d 03 lds r8, 0x034D ; 0x80034d 1231e: 90 90 4e 03 lds r9, 0x034E ; 0x80034e 12322: a0 90 4f 03 lds r10, 0x034F ; 0x80034f 12326: b0 90 50 03 lds r11, 0x0350 ; 0x800350 1232a: a7 01 movw r20, r14 1232c: 96 01 movw r18, r12 1232e: c5 01 movw r24, r10 12330: b4 01 movw r22, r8 12332: 0f 94 61 a7 call 0x34ec2 ; 0x34ec2 12336: 24 96 adiw r28, 0x04 ; 4 12338: 6c af std Y+60, r22 ; 0x3c 1233a: 7d af std Y+61, r23 ; 0x3d 1233c: 8e af std Y+62, r24 ; 0x3e 1233e: 9f af std Y+63, r25 ; 0x3f 12340: 24 97 sbiw r28, 0x04 ; 4 // Trace the arc mc_arc(current_position, destination, offset, (feedrate * feedmultiply) * (1.f / 6000.f), r, isclockwise, start_segment_idx); 12342: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 12346: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 1234a: 07 2e mov r0, r23 1234c: 00 0c add r0, r0 1234e: 88 0b sbc r24, r24 12350: 99 0b sbc r25, r25 12352: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 12356: 20 91 7a 02 lds r18, 0x027A ; 0x80027a 1235a: 30 91 7b 02 lds r19, 0x027B ; 0x80027b 1235e: 40 91 7c 02 lds r20, 0x027C ; 0x80027c 12362: 50 91 7d 02 lds r21, 0x027D ; 0x80027d 12366: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1236a: 2e e3 ldi r18, 0x3E ; 62 1236c: 33 ec ldi r19, 0xC3 ; 195 1236e: 4e e2 ldi r20, 0x2E ; 46 12370: 59 e3 ldi r21, 0x39 ; 57 12372: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12376: 68 af std Y+56, r22 ; 0x38 12378: 79 af std Y+57, r23 ; 0x39 1237a: 8a af std Y+58, r24 ; 0x3a 1237c: 9b af std Y+59, r25 ; 0x3b // 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)); 1237e: 80 e1 ldi r24, 0x10 ; 16 12380: e1 e6 ldi r30, 0x61 ; 97 12382: f2 e1 ldi r31, 0x12 ; 18 12384: de 01 movw r26, r28 12386: 11 96 adiw r26, 0x01 ; 1 12388: 01 90 ld r0, Z+ 1238a: 0d 92 st X+, r0 1238c: 8a 95 dec r24 1238e: e1 f7 brne .-8 ; 0x12388 float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 12390: a5 01 movw r20, r10 12392: 94 01 movw r18, r8 12394: 50 58 subi r21, 0x80 ; 128 12396: 28 a7 std Y+40, r18 ; 0x28 12398: 39 a7 std Y+41, r19 ; 0x29 1239a: 4a a7 std Y+42, r20 ; 0x2a 1239c: 5b a7 std Y+43, r21 ; 0x2b float r_axis_y = -offset[Y_AXIS]; 1239e: d7 01 movw r26, r14 123a0: c6 01 movw r24, r12 123a2: b0 58 subi r27, 0x80 ; 128 123a4: 8c a7 std Y+44, r24 ; 0x2c 123a6: 9d a7 std Y+45, r25 ; 0x2d 123a8: ae a7 std Y+46, r26 ; 0x2e 123aa: bf a7 std Y+47, r27 ; 0x2f float center_axis_x = start_position[X_AXIS] - r_axis_x; 123ac: 29 81 ldd r18, Y+1 ; 0x01 123ae: 3a 81 ldd r19, Y+2 ; 0x02 123b0: 4b 81 ldd r20, Y+3 ; 0x03 123b2: 5c 81 ldd r21, Y+4 ; 0x04 123b4: 28 96 adiw r28, 0x08 ; 8 123b6: 2c af std Y+60, r18 ; 0x3c 123b8: 3d af std Y+61, r19 ; 0x3d 123ba: 4e af std Y+62, r20 ; 0x3e 123bc: 5f af std Y+63, r21 ; 0x3f 123be: 28 97 sbiw r28, 0x08 ; 8 123c0: c5 01 movw r24, r10 123c2: b4 01 movw r22, r8 123c4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 123c8: 62 96 adiw r28, 0x12 ; 18 123ca: 6c af std Y+60, r22 ; 0x3c 123cc: 7d af std Y+61, r23 ; 0x3d 123ce: 8e af std Y+62, r24 ; 0x3e 123d0: 9f af std Y+63, r25 ; 0x3f 123d2: 62 97 sbiw r28, 0x12 ; 18 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 123d4: 8d 81 ldd r24, Y+5 ; 0x05 123d6: 9e 81 ldd r25, Y+6 ; 0x06 123d8: af 81 ldd r26, Y+7 ; 0x07 123da: b8 85 ldd r27, Y+8 ; 0x08 123dc: 2c 96 adiw r28, 0x0c ; 12 123de: 8c af std Y+60, r24 ; 0x3c 123e0: 9d af std Y+61, r25 ; 0x3d 123e2: ae af std Y+62, r26 ; 0x3e 123e4: bf af std Y+63, r27 ; 0x3f 123e6: 2c 97 sbiw r28, 0x0c ; 12 123e8: 9c 01 movw r18, r24 123ea: ad 01 movw r20, r26 123ec: c7 01 movw r24, r14 123ee: b6 01 movw r22, r12 123f0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 123f4: 66 96 adiw r28, 0x16 ; 22 123f6: 6c af std Y+60, r22 ; 0x3c 123f8: 7d af std Y+61, r23 ; 0x3d 123fa: 8e af std Y+62, r24 ; 0x3e 123fc: 9f af std Y+63, r25 ; 0x3f 123fe: 66 97 sbiw r28, 0x16 ; 22 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 12400: 29 85 ldd r18, Y+9 ; 0x09 12402: 3a 85 ldd r19, Y+10 ; 0x0a 12404: 4b 85 ldd r20, Y+11 ; 0x0b 12406: 5c 85 ldd r21, Y+12 ; 0x0c 12408: 60 91 31 06 lds r22, 0x0631 ; 0x800631 1240c: 70 91 32 06 lds r23, 0x0632 ; 0x800632 12410: 80 91 33 06 lds r24, 0x0633 ; 0x800633 12414: 90 91 34 06 lds r25, 0x0634 ; 0x800634 12418: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1241c: 6a 96 adiw r28, 0x1a ; 26 1241e: 6c af std Y+60, r22 ; 0x3c 12420: 7d af std Y+61, r23 ; 0x3d 12422: 8e af std Y+62, r24 ; 0x3e 12424: 9f af std Y+63, r25 ; 0x3f 12426: 6a 97 sbiw r28, 0x1a ; 26 float rt_x = target[X_AXIS] - center_axis_x; 12428: 20 91 29 06 lds r18, 0x0629 ; 0x800629 1242c: 30 91 2a 06 lds r19, 0x062A ; 0x80062a 12430: 40 91 2b 06 lds r20, 0x062B ; 0x80062b 12434: 50 91 2c 06 lds r21, 0x062C ; 0x80062c 12438: 6e 96 adiw r28, 0x1e ; 30 1243a: 2c af std Y+60, r18 ; 0x3c 1243c: 3d af std Y+61, r19 ; 0x3d 1243e: 4e af std Y+62, r20 ; 0x3e 12440: 5f af std Y+63, r21 ; 0x3f 12442: 6e 97 sbiw r28, 0x1e ; 30 12444: 62 96 adiw r28, 0x12 ; 18 12446: 2c ad ldd r18, Y+60 ; 0x3c 12448: 3d ad ldd r19, Y+61 ; 0x3d 1244a: 4e ad ldd r20, Y+62 ; 0x3e 1244c: 5f ad ldd r21, Y+63 ; 0x3f 1244e: 62 97 sbiw r28, 0x12 ; 18 12450: 6e 96 adiw r28, 0x1e ; 30 12452: 6c ad ldd r22, Y+60 ; 0x3c 12454: 7d ad ldd r23, Y+61 ; 0x3d 12456: 8e ad ldd r24, Y+62 ; 0x3e 12458: 9f ad ldd r25, Y+63 ; 0x3f 1245a: 6e 97 sbiw r28, 0x1e ; 30 1245c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 12460: 6b 01 movw r12, r22 12462: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 12464: 80 91 2d 06 lds r24, 0x062D ; 0x80062d 12468: 90 91 2e 06 lds r25, 0x062E ; 0x80062e 1246c: a0 91 2f 06 lds r26, 0x062F ; 0x80062f 12470: b0 91 30 06 lds r27, 0x0630 ; 0x800630 12474: a2 96 adiw r28, 0x22 ; 34 12476: 8c af std Y+60, r24 ; 0x3c 12478: 9d af std Y+61, r25 ; 0x3d 1247a: ae af std Y+62, r26 ; 0x3e 1247c: bf af std Y+63, r27 ; 0x3f 1247e: a2 97 sbiw r28, 0x22 ; 34 12480: 66 96 adiw r28, 0x16 ; 22 12482: 2c ad ldd r18, Y+60 ; 0x3c 12484: 3d ad ldd r19, Y+61 ; 0x3d 12486: 4e ad ldd r20, Y+62 ; 0x3e 12488: 5f ad ldd r21, Y+63 ; 0x3f 1248a: 66 97 sbiw r28, 0x16 ; 22 1248c: bc 01 movw r22, r24 1248e: cd 01 movw r24, r26 12490: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 12494: 4b 01 movw r8, r22 12496: 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; 12498: 30 90 2b 0e lds r3, 0x0E2B ; 0x800e2b 1249c: 20 90 2c 0e lds r2, 0x0E2C ; 0x800e2c 124a0: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 124a4: 9c ab std Y+52, r25 ; 0x34 124a6: a0 91 2e 0e lds r26, 0x0E2E ; 0x800e2e 124aa: ac af std Y+60, r26 ; 0x3c // 20210109 - Add a variable to hold the n_arc_correction value unsigned char n_arc_correction = cs.n_arc_correction; 124ac: b0 91 33 0e lds r27, 0x0E33 ; 0x800e33 124b0: b8 ab std Y+48, r27 ; 0x30 // 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); 124b2: a7 01 movw r20, r14 124b4: 96 01 movw r18, r12 124b6: 68 a5 ldd r22, Y+40 ; 0x28 124b8: 79 a5 ldd r23, Y+41 ; 0x29 124ba: 8a a5 ldd r24, Y+42 ; 0x2a 124bc: 9b a5 ldd r25, Y+43 ; 0x2b 124be: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 124c2: 2b 01 movw r4, r22 124c4: 3c 01 movw r6, r24 124c6: a5 01 movw r20, r10 124c8: 94 01 movw r18, r8 124ca: 6c a5 ldd r22, Y+44 ; 0x2c 124cc: 7d a5 ldd r23, Y+45 ; 0x2d 124ce: 8e a5 ldd r24, Y+46 ; 0x2e 124d0: 9f a5 ldd r25, Y+47 ; 0x2f 124d2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 124d6: 9b 01 movw r18, r22 124d8: ac 01 movw r20, r24 124da: c3 01 movw r24, r6 124dc: b2 01 movw r22, r4 124de: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 124e2: 2b 01 movw r4, r22 124e4: 3c 01 movw r6, r24 124e6: a5 01 movw r20, r10 124e8: 94 01 movw r18, r8 124ea: 68 a5 ldd r22, Y+40 ; 0x28 124ec: 79 a5 ldd r23, Y+41 ; 0x29 124ee: 8a a5 ldd r24, Y+42 ; 0x2a 124f0: 9b a5 ldd r25, Y+43 ; 0x2b 124f2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 124f6: 4b 01 movw r8, r22 124f8: 5c 01 movw r10, r24 124fa: a7 01 movw r20, r14 124fc: 96 01 movw r18, r12 124fe: 6c a5 ldd r22, Y+44 ; 0x2c 12500: 7d a5 ldd r23, Y+45 ; 0x2d 12502: 8e a5 ldd r24, Y+46 ; 0x2e 12504: 9f a5 ldd r25, Y+47 ; 0x2f 12506: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1250a: 9b 01 movw r18, r22 1250c: ac 01 movw r20, r24 1250e: c5 01 movw r24, r10 12510: b4 01 movw r22, r8 12512: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 12516: a3 01 movw r20, r6 12518: 92 01 movw r18, r4 1251a: 0f 94 44 a5 call 0x34a88 ; 0x34a88 1251e: 6b 01 movw r12, r22 12520: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 12522: 20 e0 ldi r18, 0x00 ; 0 12524: 30 e0 ldi r19, 0x00 ; 0 12526: a9 01 movw r20, r18 12528: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1252c: 87 ff sbrs r24, 7 1252e: 0a c0 rjmp .+20 ; 0x12544 12530: 2b ed ldi r18, 0xDB ; 219 12532: 3f e0 ldi r19, 0x0F ; 15 12534: 49 ec ldi r20, 0xC9 ; 201 12536: 50 e4 ldi r21, 0x40 ; 64 12538: c7 01 movw r24, r14 1253a: b6 01 movw r22, r12 1253c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 12540: 6b 01 movw r12, r22 12542: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 12544: 60 91 34 0e lds r22, 0x0E34 ; 0x800e34 12548: 70 91 35 0e lds r23, 0x0E35 ; 0x800e35 1254c: 61 15 cp r22, r1 1254e: 71 05 cpc r23, r1 12550: 09 f4 brne .+2 ; 0x12554 12552: 61 c2 rjmp .+1218 ; 0x12a16 { // 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); 12554: 90 e0 ldi r25, 0x00 ; 0 12556: 80 e0 ldi r24, 0x00 ; 0 12558: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 1255c: 9b 01 movw r18, r22 1255e: ac 01 movw r20, r24 12560: 6b ed ldi r22, 0xDB ; 219 12562: 7f e0 ldi r23, 0x0F ; 15 12564: 89 ec ldi r24, 0xC9 ; 201 12566: 90 e4 ldi r25, 0x40 ; 64 12568: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1256c: 24 96 adiw r28, 0x04 ; 4 1256e: 2c ad ldd r18, Y+60 ; 0x3c 12570: 3d ad ldd r19, Y+61 ; 0x3d 12572: 4e ad ldd r20, Y+62 ; 0x3e 12574: 5f ad ldd r21, Y+63 ; 0x3f 12576: 24 97 sbiw r28, 0x04 ; 4 12578: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1257c: 5b 01 movw r10, r22 1257e: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 12580: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 12584: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 12588: 61 15 cp r22, r1 1258a: 71 05 cpc r23, r1 1258c: e1 f0 breq .+56 ; 0x125c6 { // 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)); 1258e: 90 e0 ldi r25, 0x00 ; 0 12590: 80 e0 ldi r24, 0x00 ; 0 12592: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 12596: 20 e0 ldi r18, 0x00 ; 0 12598: 30 e0 ldi r19, 0x00 ; 0 1259a: 40 e7 ldi r20, 0x70 ; 112 1259c: 52 e4 ldi r21, 0x42 ; 66 1259e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 125a2: 9b 01 movw r18, r22 125a4: ac 01 movw r20, r24 125a6: 68 ad ldd r22, Y+56 ; 0x38 125a8: 79 ad ldd r23, Y+57 ; 0x39 125aa: 8a ad ldd r24, Y+58 ; 0x3a 125ac: 9b ad ldd r25, Y+59 ; 0x3b 125ae: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 125b2: 3b 01 movw r6, r22 125b4: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 125b6: 95 01 movw r18, r10 125b8: a8 01 movw r20, r16 125ba: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 125be: 87 ff sbrs r24, 7 125c0: 02 c0 rjmp .+4 ; 0x125c6 mm_per_arc_segment = mm_per_arc_segment_sec; 125c2: 53 01 movw r10, r6 125c4: 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) 125c6: 40 90 2f 0e lds r4, 0x0E2F ; 0x800e2f 125ca: 50 90 30 0e lds r5, 0x0E30 ; 0x800e30 125ce: 60 90 31 0e lds r6, 0x0E31 ; 0x800e31 125d2: 70 90 32 0e lds r7, 0x0E32 ; 0x800e32 125d6: 95 01 movw r18, r10 125d8: a8 01 movw r20, r16 125da: b2 01 movw r22, r4 125dc: c3 01 movw r24, r6 125de: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 125e2: 18 16 cp r1, r24 125e4: 84 f0 brlt .+32 ; 0x12606 { // 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) { 125e6: 95 01 movw r18, r10 125e8: a8 01 movw r20, r16 125ea: 63 2d mov r22, r3 125ec: 72 2d mov r23, r2 125ee: 8c a9 ldd r24, Y+52 ; 0x34 125f0: 9c ad ldd r25, Y+60 ; 0x3c 125f2: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 125f6: 25 01 movw r4, r10 125f8: 38 01 movw r6, r16 125fa: 87 ff sbrs r24, 7 125fc: 04 c0 rjmp .+8 ; 0x12606 // 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; 125fe: 43 2c mov r4, r3 12600: 52 2c mov r5, r2 12602: 6c a8 ldd r6, Y+52 ; 0x34 12604: 7c ac ldd r7, Y+60 ; 0x3c } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 12606: a4 96 adiw r28, 0x24 ; 36 12608: ee ad ldd r30, Y+62 ; 0x3e 1260a: ff ad ldd r31, Y+63 ; 0x3f 1260c: a4 97 sbiw r28, 0x24 ; 36 1260e: 32 97 sbiw r30, 0x02 ; 2 12610: 51 f4 brne .+20 ; 0x12626 12612: 2b ed ldi r18, 0xDB ; 219 12614: 3f e0 ldi r19, 0x0F ; 15 12616: 49 ec ldi r20, 0xC9 ; 201 12618: 50 e4 ldi r21, 0x40 ; 64 1261a: c7 01 movw r24, r14 1261c: b6 01 movw r22, r12 1261e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 12622: 6b 01 movw r12, r22 12624: 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) 12626: 6e 96 adiw r28, 0x1e ; 30 12628: 2c ad ldd r18, Y+60 ; 0x3c 1262a: 3d ad ldd r19, Y+61 ; 0x3d 1262c: 4e ad ldd r20, Y+62 ; 0x3e 1262e: 5f ad ldd r21, Y+63 ; 0x3f 12630: 6e 97 sbiw r28, 0x1e ; 30 12632: 28 96 adiw r28, 0x08 ; 8 12634: 6c ad ldd r22, Y+60 ; 0x3c 12636: 7d ad ldd r23, Y+61 ; 0x3d 12638: 8e ad ldd r24, Y+62 ; 0x3e 1263a: 9f ad ldd r25, Y+63 ; 0x3f 1263c: 28 97 sbiw r28, 0x08 ; 8 1263e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 12642: 81 11 cpse r24, r1 12644: 23 c0 rjmp .+70 ; 0x1268c 12646: a2 96 adiw r28, 0x22 ; 34 12648: 2c ad ldd r18, Y+60 ; 0x3c 1264a: 3d ad ldd r19, Y+61 ; 0x3d 1264c: 4e ad ldd r20, Y+62 ; 0x3e 1264e: 5f ad ldd r21, Y+63 ; 0x3f 12650: a2 97 sbiw r28, 0x22 ; 34 12652: 2c 96 adiw r28, 0x0c ; 12 12654: 6c ad ldd r22, Y+60 ; 0x3c 12656: 7d ad ldd r23, Y+61 ; 0x3d 12658: 8e ad ldd r24, Y+62 ; 0x3e 1265a: 9f ad ldd r25, Y+63 ; 0x3f 1265c: 2c 97 sbiw r28, 0x0c ; 12 1265e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 12662: 81 11 cpse r24, r1 12664: 13 c0 rjmp .+38 ; 0x1268c 12666: 20 e0 ldi r18, 0x00 ; 0 12668: 30 e0 ldi r19, 0x00 ; 0 1266a: a9 01 movw r20, r18 1266c: c7 01 movw r24, r14 1266e: b6 01 movw r22, r12 12670: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 12674: 81 11 cpse r24, r1 12676: 0a c0 rjmp .+20 ; 0x1268c { angular_travel_total += 2 * M_PI; 12678: 2b ed ldi r18, 0xDB ; 219 1267a: 3f e0 ldi r19, 0x0F ; 15 1267c: 49 ec ldi r20, 0xC9 ; 201 1267e: 50 e4 ldi r21, 0x40 ; 64 12680: c7 01 movw r24, r14 12682: b6 01 movw r22, r12 12684: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 12688: 6b 01 movw r12, r22 1268a: 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)); 1268c: a7 01 movw r20, r14 1268e: 96 01 movw r18, r12 12690: 24 96 adiw r28, 0x04 ; 4 12692: 6c ad ldd r22, Y+60 ; 0x3c 12694: 7d ad ldd r23, Y+61 ; 0x3d 12696: 8e ad ldd r24, Y+62 ; 0x3e 12698: 9f ad ldd r25, Y+63 ; 0x3f 1269a: 24 97 sbiw r28, 0x04 ; 4 1269c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 126a0: 6a 96 adiw r28, 0x1a ; 26 126a2: 2c ad ldd r18, Y+60 ; 0x3c 126a4: 3d ad ldd r19, Y+61 ; 0x3d 126a6: 4e ad ldd r20, Y+62 ; 0x3e 126a8: 5f ad ldd r21, Y+63 ; 0x3f 126aa: 6a 97 sbiw r28, 0x1a ; 26 126ac: 0f 94 61 a7 call 0x34ec2 ; 0x34ec2 126b0: 4b 01 movw r8, r22 126b2: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 126b4: 2f e6 ldi r18, 0x6F ; 111 126b6: 32 e1 ldi r19, 0x12 ; 18 126b8: 43 e8 ldi r20, 0x83 ; 131 126ba: 5a e3 ldi r21, 0x3A ; 58 126bc: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 126c0: 87 fd sbrc r24, 7 126c2: 9e c1 rjmp .+828 ; 0x12a00 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 126c4: 92 01 movw r18, r4 126c6: a3 01 movw r20, r6 126c8: c5 01 movw r24, r10 126ca: b4 01 movw r22, r8 126cc: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 126d0: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 126d4: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 126d8: 7d ab std Y+53, r23 ; 0x35 126da: 6c ab std Y+52, r22 ; 0x34 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) 126dc: 62 30 cpi r22, 0x02 ; 2 126de: 71 05 cpc r23, r1 126e0: 08 f4 brcc .+2 ; 0x126e4 126e2: 5e c1 rjmp .+700 ; 0x129a0 126e4: 2e 96 adiw r28, 0x0e ; 14 126e6: 4e ad ldd r20, Y+62 ; 0x3e 126e8: 5f ad ldd r21, Y+63 ; 0x3f 126ea: 2e 97 sbiw r28, 0x0e ; 14 126ec: 45 2b or r20, r21 126ee: 09 f4 brne .+2 ; 0x126f2 126f0: 57 c1 rjmp .+686 ; 0x129a0 { // 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, 126f2: 90 e0 ldi r25, 0x00 ; 0 126f4: 80 e0 ldi r24, 0x00 ; 0 126f6: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 126fa: 4b 01 movw r8, r22 126fc: 5c 01 movw r10, r24 126fe: ac 01 movw r20, r24 12700: 9b 01 movw r18, r22 12702: c7 01 movw r24, r14 12704: b6 01 movw r22, r12 12706: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1270a: 2b 01 movw r4, r22 1270c: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 1270e: a5 01 movw r20, r10 12710: 94 01 movw r18, r8 12712: 6a 96 adiw r28, 0x1a ; 26 12714: 6c ad ldd r22, Y+60 ; 0x3c 12716: 7d ad ldd r23, Y+61 ; 0x3d 12718: 8e ad ldd r24, Y+62 ; 0x3e 1271a: 9f ad ldd r25, Y+63 ; 0x3f 1271c: 6a 97 sbiw r28, 0x1a ; 26 1271e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 12722: 28 96 adiw r28, 0x08 ; 8 12724: 6c af std Y+60, r22 ; 0x3c 12726: 7d af std Y+61, r23 ; 0x3d 12728: 8e af std Y+62, r24 ; 0x3e 1272a: 9f af std Y+63, r25 ; 0x3f 1272c: 28 97 sbiw r28, 0x08 ; 8 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 1272e: 2d 85 ldd r18, Y+13 ; 0x0d 12730: 3e 85 ldd r19, Y+14 ; 0x0e 12732: 4f 85 ldd r20, Y+15 ; 0x0f 12734: 58 89 ldd r21, Y+16 ; 0x10 12736: 60 91 35 06 lds r22, 0x0635 ; 0x800635 1273a: 70 91 36 06 lds r23, 0x0636 ; 0x800636 1273e: 80 91 37 06 lds r24, 0x0637 ; 0x800637 12742: 90 91 38 06 lds r25, 0x0638 ; 0x800638 12746: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1274a: a5 01 movw r20, r10 1274c: 94 01 movw r18, r8 1274e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 12752: 2c 96 adiw r28, 0x0c ; 12 12754: 6c af std Y+60, r22 ; 0x3c 12756: 7d af std Y+61, r23 ; 0x3d 12758: 8e af std Y+62, r24 ; 0x3e 1275a: 9f af std Y+63, r25 ; 0x3f 1275c: 2c 97 sbiw r28, 0x0c ; 12 sq_theta_per_segment = theta_per_segment * theta_per_segment, 1275e: a3 01 movw r20, r6 12760: 92 01 movw r18, r4 12762: c3 01 movw r24, r6 12764: b2 01 movw r22, r4 12766: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1276a: 6b 01 movw r12, r22 1276c: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 1276e: ac 01 movw r20, r24 12770: 9b 01 movw r18, r22 12772: c3 01 movw r24, r6 12774: b2 01 movw r22, r4 12776: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1277a: 20 e0 ldi r18, 0x00 ; 0 1277c: 30 e0 ldi r19, 0x00 ; 0 1277e: 40 ec ldi r20, 0xC0 ; 192 12780: 50 e4 ldi r21, 0x40 ; 64 12782: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 12786: 9b 01 movw r18, r22 12788: ac 01 movw r20, r24 1278a: c3 01 movw r24, r6 1278c: b2 01 movw r22, r4 1278e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 12792: 6c af std Y+60, r22 ; 0x3c 12794: 7d af std Y+61, r23 ; 0x3d 12796: 8e af std Y+62, r24 ; 0x3e 12798: 9f af std Y+63, r25 ; 0x3f cos_T = 1 - 0.5f * sq_theta_per_segment; 1279a: 20 e0 ldi r18, 0x00 ; 0 1279c: 30 e0 ldi r19, 0x00 ; 0 1279e: 40 e0 ldi r20, 0x00 ; 0 127a0: 5f e3 ldi r21, 0x3F ; 63 127a2: c7 01 movw r24, r14 127a4: b6 01 movw r22, r12 127a6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 127aa: 9b 01 movw r18, r22 127ac: ac 01 movw r20, r24 127ae: 60 e0 ldi r22, 0x00 ; 0 127b0: 70 e0 ldi r23, 0x00 ; 0 127b2: 80 e8 ldi r24, 0x80 ; 128 127b4: 9f e3 ldi r25, 0x3F ; 63 127b6: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 127ba: 24 96 adiw r28, 0x04 ; 4 127bc: 6c af std Y+60, r22 ; 0x3c 127be: 7d af std Y+61, r23 ; 0x3d 127c0: 8e af std Y+62, r24 ; 0x3e 127c2: 9f af std Y+63, r25 ; 0x3f 127c4: 24 97 sbiw r28, 0x04 ; 4 // 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++) { 127c6: 22 24 eor r2, r2 127c8: 23 94 inc r2 127ca: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 127cc: d8 a8 ldd r13, Y+48 ; 0x30 127ce: da 94 dec r13 127d0: 58 a9 ldd r21, Y+48 ; 0x30 127d2: 51 11 cpse r21, r1 127d4: 25 c1 rjmp .+586 ; 0x12a20 // 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); 127d6: b1 01 movw r22, r2 127d8: 90 e0 ldi r25, 0x00 ; 0 127da: 80 e0 ldi r24, 0x00 ; 0 127dc: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 127e0: a3 01 movw r20, r6 127e2: 92 01 movw r18, r4 127e4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 127e8: 6b 01 movw r12, r22 127ea: 7c 01 movw r14, r24 127ec: 0f 94 bf a5 call 0x34b7e ; 0x34b7e 127f0: 6c a7 std Y+44, r22 ; 0x2c 127f2: 7d a7 std Y+45, r23 ; 0x2d 127f4: 8e a7 std Y+46, r24 ; 0x2e 127f6: 9f a7 std Y+47, r25 ; 0x2f 127f8: c7 01 movw r24, r14 127fa: b6 01 movw r22, r12 127fc: 0f 94 85 a8 call 0x3510a ; 0x3510a 12800: 4b 01 movw r8, r22 12802: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 12804: c0 90 4d 03 lds r12, 0x034D ; 0x80034d 12808: d0 90 4e 03 lds r13, 0x034E ; 0x80034e 1280c: e0 90 4f 03 lds r14, 0x034F ; 0x80034f 12810: f0 90 50 03 lds r15, 0x0350 ; 0x800350 12814: f7 fa bst r15, 7 12816: f0 94 com r15 12818: f7 f8 bld r15, 7 1281a: f0 94 com r15 1281c: 80 91 51 03 lds r24, 0x0351 ; 0x800351 12820: 90 91 52 03 lds r25, 0x0352 ; 0x800352 12824: a0 91 53 03 lds r26, 0x0353 ; 0x800353 12828: b0 91 54 03 lds r27, 0x0354 ; 0x800354 1282c: 88 ab std Y+48, r24 ; 0x30 1282e: 99 ab std Y+49, r25 ; 0x31 12830: aa ab std Y+50, r26 ; 0x32 12832: bb ab std Y+51, r27 ; 0x33 12834: a7 01 movw r20, r14 12836: 96 01 movw r18, r12 12838: 6c a5 ldd r22, Y+44 ; 0x2c 1283a: 7d a5 ldd r23, Y+45 ; 0x2d 1283c: 8e a5 ldd r24, Y+46 ; 0x2e 1283e: 9f a5 ldd r25, Y+47 ; 0x2f 12840: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12844: 68 a7 std Y+40, r22 ; 0x28 12846: 79 a7 std Y+41, r23 ; 0x29 12848: 8a a7 std Y+42, r24 ; 0x2a 1284a: 9b a7 std Y+43, r25 ; 0x2b 1284c: 28 a9 ldd r18, Y+48 ; 0x30 1284e: 39 a9 ldd r19, Y+49 ; 0x31 12850: 4a a9 ldd r20, Y+50 ; 0x32 12852: 5b a9 ldd r21, Y+51 ; 0x33 12854: c5 01 movw r24, r10 12856: b4 01 movw r22, r8 12858: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1285c: 9b 01 movw r18, r22 1285e: ac 01 movw r20, r24 12860: 68 a5 ldd r22, Y+40 ; 0x28 12862: 79 a5 ldd r23, Y+41 ; 0x29 12864: 8a a5 ldd r24, Y+42 ; 0x2a 12866: 9b a5 ldd r25, Y+43 ; 0x2b 12868: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1286c: 68 a7 std Y+40, r22 ; 0x28 1286e: 79 a7 std Y+41, r23 ; 0x29 12870: 8a a7 std Y+42, r24 ; 0x2a 12872: 9b a7 std Y+43, r25 ; 0x2b r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 12874: a7 01 movw r20, r14 12876: 96 01 movw r18, r12 12878: c5 01 movw r24, r10 1287a: b4 01 movw r22, r8 1287c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12880: 6b 01 movw r12, r22 12882: 7c 01 movw r14, r24 12884: 28 a9 ldd r18, Y+48 ; 0x30 12886: 39 a9 ldd r19, Y+49 ; 0x31 12888: 4a a9 ldd r20, Y+50 ; 0x32 1288a: 5b a9 ldd r21, Y+51 ; 0x33 1288c: 6c a5 ldd r22, Y+44 ; 0x2c 1288e: 7d a5 ldd r23, Y+45 ; 0x2d 12890: 8e a5 ldd r24, Y+46 ; 0x2e 12892: 9f a5 ldd r25, Y+47 ; 0x2f 12894: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12898: 9b 01 movw r18, r22 1289a: ac 01 movw r20, r24 1289c: c7 01 movw r24, r14 1289e: b6 01 movw r22, r12 128a0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 128a4: 6c a7 std Y+44, r22 ; 0x2c 128a6: 7d a7 std Y+45, r23 ; 0x2d 128a8: 8e a7 std Y+46, r24 ; 0x2e 128aa: 9f a7 std Y+47, r25 ; 0x2f // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 128ac: 90 91 33 0e lds r25, 0x0E33 ; 0x800e33 128b0: 98 ab std Y+48, r25 ; 0x30 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; 128b2: 28 a5 ldd r18, Y+40 ; 0x28 128b4: 39 a5 ldd r19, Y+41 ; 0x29 128b6: 4a a5 ldd r20, Y+42 ; 0x2a 128b8: 5b a5 ldd r21, Y+43 ; 0x2b 128ba: 62 96 adiw r28, 0x12 ; 18 128bc: 6c ad ldd r22, Y+60 ; 0x3c 128be: 7d ad ldd r23, Y+61 ; 0x3d 128c0: 8e ad ldd r24, Y+62 ; 0x3e 128c2: 9f ad ldd r25, Y+63 ; 0x3f 128c4: 62 97 sbiw r28, 0x12 ; 18 128c6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 128ca: 69 83 std Y+1, r22 ; 0x01 128cc: 7a 83 std Y+2, r23 ; 0x02 128ce: 8b 83 std Y+3, r24 ; 0x03 128d0: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 128d2: 2c a5 ldd r18, Y+44 ; 0x2c 128d4: 3d a5 ldd r19, Y+45 ; 0x2d 128d6: 4e a5 ldd r20, Y+46 ; 0x2e 128d8: 5f a5 ldd r21, Y+47 ; 0x2f 128da: 66 96 adiw r28, 0x16 ; 22 128dc: 6c ad ldd r22, Y+60 ; 0x3c 128de: 7d ad ldd r23, Y+61 ; 0x3d 128e0: 8e ad ldd r24, Y+62 ; 0x3e 128e2: 9f ad ldd r25, Y+63 ; 0x3f 128e4: 66 97 sbiw r28, 0x16 ; 22 128e6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 128ea: 6d 83 std Y+5, r22 ; 0x05 128ec: 7e 83 std Y+6, r23 ; 0x06 128ee: 8f 83 std Y+7, r24 ; 0x07 128f0: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 128f2: 28 96 adiw r28, 0x08 ; 8 128f4: 2c ad ldd r18, Y+60 ; 0x3c 128f6: 3d ad ldd r19, Y+61 ; 0x3d 128f8: 4e ad ldd r20, Y+62 ; 0x3e 128fa: 5f ad ldd r21, Y+63 ; 0x3f 128fc: 28 97 sbiw r28, 0x08 ; 8 128fe: 69 85 ldd r22, Y+9 ; 0x09 12900: 7a 85 ldd r23, Y+10 ; 0x0a 12902: 8b 85 ldd r24, Y+11 ; 0x0b 12904: 9c 85 ldd r25, Y+12 ; 0x0c 12906: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1290a: 69 87 std Y+9, r22 ; 0x09 1290c: 7a 87 std Y+10, r23 ; 0x0a 1290e: 8b 87 std Y+11, r24 ; 0x0b 12910: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 12912: 2c 96 adiw r28, 0x0c ; 12 12914: 2c ad ldd r18, Y+60 ; 0x3c 12916: 3d ad ldd r19, Y+61 ; 0x3d 12918: 4e ad ldd r20, Y+62 ; 0x3e 1291a: 5f ad ldd r21, Y+63 ; 0x3f 1291c: 2c 97 sbiw r28, 0x0c ; 12 1291e: 6d 85 ldd r22, Y+13 ; 0x0d 12920: 7e 85 ldd r23, Y+14 ; 0x0e 12922: 8f 85 ldd r24, Y+15 ; 0x0f 12924: 98 89 ldd r25, Y+16 ; 0x10 12926: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1292a: 6d 87 std Y+13, r22 ; 0x0d 1292c: 7e 87 std Y+14, r23 ; 0x0e 1292e: 8f 87 std Y+15, r24 ; 0x0f 12930: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 12932: ce 01 movw r24, r28 12934: 01 96 adiw r24, 0x01 ; 1 12936: 0e 94 4c 6a call 0xd498 ; 0xd498 // Insert the segment into the buffer if (i >= start_segment_idx) 1293a: 2e 96 adiw r28, 0x0e ; 14 1293c: ae ad ldd r26, Y+62 ; 0x3e 1293e: bf ad ldd r27, Y+63 ; 0x3f 12940: 2e 97 sbiw r28, 0x0e ; 14 12942: 2a 16 cp r2, r26 12944: 3b 06 cpc r3, r27 12946: f8 f0 brcs .+62 ; 0x12986 plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 12948: e9 84 ldd r14, Y+9 ; 0x09 1294a: fa 84 ldd r15, Y+10 ; 0x0a 1294c: 0b 85 ldd r16, Y+11 ; 0x0b 1294e: 1c 85 ldd r17, Y+12 ; 0x0c 12950: 2d 81 ldd r18, Y+5 ; 0x05 12952: 3e 81 ldd r19, Y+6 ; 0x06 12954: 4f 81 ldd r20, Y+7 ; 0x07 12956: 58 85 ldd r21, Y+8 ; 0x08 12958: 69 81 ldd r22, Y+1 ; 0x01 1295a: 7a 81 ldd r23, Y+2 ; 0x02 1295c: 8b 81 ldd r24, Y+3 ; 0x03 1295e: 9c 81 ldd r25, Y+4 ; 0x04 12960: 3f 92 push r3 12962: 2f 92 push r2 12964: e1 e6 ldi r30, 0x61 ; 97 12966: f2 e1 ldi r31, 0x12 ; 18 12968: ff 93 push r31 1296a: ef 93 push r30 1296c: 88 ac ldd r8, Y+56 ; 0x38 1296e: 99 ac ldd r9, Y+57 ; 0x39 12970: aa ac ldd r10, Y+58 ; 0x3a 12972: bb ac ldd r11, Y+59 ; 0x3b 12974: fe 01 movw r30, r28 12976: 3d 96 adiw r30, 0x0d ; 13 12978: 6f 01 movw r12, r30 1297a: 0f 94 bc 3a call 0x27578 ; 0x27578 1297e: 0f 90 pop r0 12980: 0f 90 pop r0 12982: 0f 90 pop r0 12984: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 12986: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1298a: 81 11 cpse r24, r1 1298c: 39 c0 rjmp .+114 ; 0x12a00 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++) { 1298e: ff ef ldi r31, 0xFF ; 255 12990: 2f 1a sub r2, r31 12992: 3f 0a sbc r3, r31 12994: 2c a9 ldd r18, Y+52 ; 0x34 12996: 3d a9 ldd r19, Y+53 ; 0x35 12998: 22 15 cp r18, r2 1299a: 33 05 cpc r19, r3 1299c: 09 f0 breq .+2 ; 0x129a0 1299e: 16 cf rjmp .-468 ; 0x127cc if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 129a0: 89 e2 ldi r24, 0x29 ; 41 129a2: 96 e0 ldi r25, 0x06 ; 6 129a4: 0e 94 4c 6a call 0xd498 ; 0xd498 // 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); 129a8: e0 90 31 06 lds r14, 0x0631 ; 0x800631 129ac: f0 90 32 06 lds r15, 0x0632 ; 0x800632 129b0: 00 91 33 06 lds r16, 0x0633 ; 0x800633 129b4: 10 91 34 06 lds r17, 0x0634 ; 0x800634 129b8: 20 91 2d 06 lds r18, 0x062D ; 0x80062d 129bc: 30 91 2e 06 lds r19, 0x062E ; 0x80062e 129c0: 40 91 2f 06 lds r20, 0x062F ; 0x80062f 129c4: 50 91 30 06 lds r21, 0x0630 ; 0x800630 129c8: 60 91 29 06 lds r22, 0x0629 ; 0x800629 129cc: 70 91 2a 06 lds r23, 0x062A ; 0x80062a 129d0: 80 91 2b 06 lds r24, 0x062B ; 0x80062b 129d4: 90 91 2c 06 lds r25, 0x062C ; 0x80062c 129d8: 1f 92 push r1 129da: 1f 92 push r1 129dc: e1 e6 ldi r30, 0x61 ; 97 129de: f2 e1 ldi r31, 0x12 ; 18 129e0: ff 93 push r31 129e2: ef 93 push r30 129e4: 88 ac ldd r8, Y+56 ; 0x38 129e6: 99 ac ldd r9, Y+57 ; 0x39 129e8: aa ac ldd r10, Y+58 ; 0x3a 129ea: bb ac ldd r11, Y+59 ; 0x3b 129ec: a5 e3 ldi r26, 0x35 ; 53 129ee: ca 2e mov r12, r26 129f0: a6 e0 ldi r26, 0x06 ; 6 129f2: da 2e mov r13, r26 129f4: 0f 94 bc 3a call 0x27578 ; 0x27578 129f8: 0f 90 pop r0 129fa: 0f 90 pop r0 129fc: 0f 90 pop r0 129fe: 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(); 12a00: 0e 94 e8 54 call 0xa9d0 ; 0xa9d0 previous_millis_cmd.start(); 12a04: 88 e4 ldi r24, 0x48 ; 72 12a06: 93 e0 ldi r25, 0x03 ; 3 12a08: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> 12a0c: 4d cc rjmp .-1894 ; 0x122a8 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; 12a0e: 60 e0 ldi r22, 0x00 ; 0 12a10: 70 e0 ldi r23, 0x00 ; 0 12a12: cb 01 movw r24, r22 12a14: 5e cc rjmp .-1860 ; 0x122d2 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; 12a16: a3 2c mov r10, r3 12a18: b2 2c mov r11, r2 12a1a: 0c a9 ldd r16, Y+52 ; 0x34 12a1c: 1c ad ldd r17, Y+60 ; 0x3c 12a1e: b0 cd rjmp .-1184 ; 0x12580 // 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; 12a20: 28 a5 ldd r18, Y+40 ; 0x28 12a22: 39 a5 ldd r19, Y+41 ; 0x29 12a24: 4a a5 ldd r20, Y+42 ; 0x2a 12a26: 5b a5 ldd r21, Y+43 ; 0x2b 12a28: 6c ad ldd r22, Y+60 ; 0x3c 12a2a: 7d ad ldd r23, Y+61 ; 0x3d 12a2c: 8e ad ldd r24, Y+62 ; 0x3e 12a2e: 9f ad ldd r25, Y+63 ; 0x3f 12a30: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12a34: 4b 01 movw r8, r22 12a36: 5c 01 movw r10, r24 12a38: 2c a5 ldd r18, Y+44 ; 0x2c 12a3a: 3d a5 ldd r19, Y+45 ; 0x2d 12a3c: 4e a5 ldd r20, Y+46 ; 0x2e 12a3e: 5f a5 ldd r21, Y+47 ; 0x2f 12a40: 24 96 adiw r28, 0x04 ; 4 12a42: 6c ad ldd r22, Y+60 ; 0x3c 12a44: 7d ad ldd r23, Y+61 ; 0x3d 12a46: 8e ad ldd r24, Y+62 ; 0x3e 12a48: 9f ad ldd r25, Y+63 ; 0x3f 12a4a: 24 97 sbiw r28, 0x04 ; 4 12a4c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12a50: 9b 01 movw r18, r22 12a52: ac 01 movw r20, r24 12a54: c5 01 movw r24, r10 12a56: b4 01 movw r22, r8 12a58: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 12a5c: 7b 01 movw r14, r22 12a5e: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 12a60: 28 a5 ldd r18, Y+40 ; 0x28 12a62: 39 a5 ldd r19, Y+41 ; 0x29 12a64: 4a a5 ldd r20, Y+42 ; 0x2a 12a66: 5b a5 ldd r21, Y+43 ; 0x2b 12a68: 24 96 adiw r28, 0x04 ; 4 12a6a: 6c ad ldd r22, Y+60 ; 0x3c 12a6c: 7d ad ldd r23, Y+61 ; 0x3d 12a6e: 8e ad ldd r24, Y+62 ; 0x3e 12a70: 9f ad ldd r25, Y+63 ; 0x3f 12a72: 24 97 sbiw r28, 0x04 ; 4 12a74: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12a78: 4b 01 movw r8, r22 12a7a: 5c 01 movw r10, r24 12a7c: 2c a5 ldd r18, Y+44 ; 0x2c 12a7e: 3d a5 ldd r19, Y+45 ; 0x2d 12a80: 4e a5 ldd r20, Y+46 ; 0x2e 12a82: 5f a5 ldd r21, Y+47 ; 0x2f 12a84: 6c ad ldd r22, Y+60 ; 0x3c 12a86: 7d ad ldd r23, Y+61 ; 0x3d 12a88: 8e ad ldd r24, Y+62 ; 0x3e 12a8a: 9f ad ldd r25, Y+63 ; 0x3f 12a8c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12a90: 9b 01 movw r18, r22 12a92: ac 01 movw r20, r24 12a94: c5 01 movw r24, r10 12a96: b4 01 movw r22, r8 12a98: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 12a9c: 68 a7 std Y+40, r22 ; 0x28 12a9e: 79 a7 std Y+41, r23 ; 0x29 12aa0: 8a a7 std Y+42, r24 ; 0x2a 12aa2: 9b a7 std Y+43, r25 ; 0x2b 12aa4: d8 aa std Y+48, r13 ; 0x30 r_axis_y = r_axisi; 12aa6: c7 01 movw r24, r14 12aa8: d8 01 movw r26, r16 12aaa: 8c a7 std Y+44, r24 ; 0x2c 12aac: 9d a7 std Y+45, r25 ; 0x2d 12aae: ae a7 std Y+46, r26 ; 0x2e 12ab0: bf a7 std Y+47, r27 ; 0x2f 12ab2: ff ce rjmp .-514 ; 0x128b2 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 12ab4: 80 e5 ldi r24, 0x50 ; 80 12ab6: 0e 94 f5 55 call 0xabea ; 0xabea - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 12aba: c1 2c mov r12, r1 12abc: d1 2c mov r13, r1 12abe: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 12ac0: 88 23 and r24, r24 12ac2: 31 f0 breq .+12 ; 0x12ad0 12ac4: 0e 94 85 5a call 0xb50a ; 0xb50a 12ac8: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 12acc: 6b 01 movw r12, r22 12ace: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 12ad0: 83 e5 ldi r24, 0x53 ; 83 12ad2: 0e 94 f5 55 call 0xabea ; 0xabea 12ad6: 88 23 and r24, r24 12ad8: 61 f0 breq .+24 ; 0x12af2 12ada: 0e 94 85 5a call 0xb50a ; 0xb50a 12ade: 20 e0 ldi r18, 0x00 ; 0 12ae0: 30 e0 ldi r19, 0x00 ; 0 12ae2: 4a e7 ldi r20, 0x7A ; 122 12ae4: 54 e4 ldi r21, 0x44 ; 68 12ae6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 12aea: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 12aee: 6b 01 movw r12, r22 12af0: 7c 01 movw r14, r24 if(codenum != 0) 12af2: c1 14 cp r12, r1 12af4: d1 04 cpc r13, r1 12af6: e1 04 cpc r14, r1 12af8: f1 04 cpc r15, r1 12afa: 41 f0 breq .+16 ; 0x12b0c { if(custom_message_type != CustomMsg::M117) 12afc: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 12b00: 87 30 cpi r24, 0x07 ; 7 12b02: 21 f0 breq .+8 ; 0x12b0c { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 12b04: 8d e2 ldi r24, 0x2D ; 45 12b06: 97 e6 ldi r25, 0x67 ; 103 12b08: 0e 94 85 dc call 0x1b90a ; 0x1b90a } } st_synchronize(); 12b0c: 0f 94 b0 18 call 0x23160 ; 0x23160 codenum += _millis(); // keep track of when we started waiting 12b10: 0f 94 56 0b call 0x216ac ; 0x216ac 12b14: c6 0e add r12, r22 12b16: d7 1e adc r13, r23 12b18: e8 1e adc r14, r24 12b1a: f9 1e adc r15, r25 previous_millis_cmd.start(); 12b1c: 88 e4 ldi r24, 0x48 ; 72 12b1e: 93 e0 ldi r25, 0x03 ; 3 12b20: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> while(_millis() < codenum) { 12b24: 0f 94 56 0b call 0x216ac ; 0x216ac 12b28: 6c 15 cp r22, r12 12b2a: 7d 05 cpc r23, r13 12b2c: 8e 05 cpc r24, r14 12b2e: 9f 05 cpc r25, r15 12b30: 08 f0 brcs .+2 ; 0x12b34 12b32: ba cb rjmp .-2188 ; 0x122a8 manage_heater(); 12b34: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(); 12b38: 80 e0 ldi r24, 0x00 ; 0 12b3a: 0e 94 25 8a call 0x1144a ; 0x1144a lcd_update(0); 12b3e: 80 e0 ldi r24, 0x00 ; 0 12b40: 0e 94 c9 6e call 0xdd92 ; 0xdd92 12b44: ef cf rjmp .-34 ; 0x12b24 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); 12b46: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 12b48: 0f 94 e9 8f call 0x31fd2 ; 0x31fd2 12b4c: ad cb rjmp .-2214 ; 0x122a8 12b4e: 80 e0 ldi r24, 0x00 ; 0 12b50: fb cf rjmp .-10 ; 0x12b48 { 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]); 12b52: 88 e5 ldi r24, 0x58 ; 88 12b54: 0e 94 f5 55 call 0xabea ; 0xabea 12b58: 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; 12b5a: 41 2c mov r4, r1 12b5c: 51 2c mov r5, r1 12b5e: 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(); 12b60: 88 23 and r24, r24 12b62: 21 f0 breq .+8 ; 0x12b6c 12b64: 0e 94 5d 56 call 0xacba ; 0xacba 12b68: 2b 01 movw r4, r22 12b6a: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 12b6c: 89 e5 ldi r24, 0x59 ; 89 12b6e: 0e 94 f5 55 call 0xabea ; 0xabea 12b72: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 12b74: 88 23 and r24, r24 12b76: 71 f1 breq .+92 ; 0x12bd4 12b78: 0e 94 5d 56 call 0xacba ; 0xacba 12b7c: 6c a7 std Y+44, r22 ; 0x2c 12b7e: 7d a7 std Y+45, r23 ; 0x2d 12b80: 8e a7 std Y+46, r24 ; 0x2e 12b82: 9f a7 std Y+47, r25 ; 0x2f bool home_z = code_seen(axis_codes[Z_AXIS]); 12b84: 8a e5 ldi r24, 0x5A ; 90 12b86: 0e 94 f5 55 call 0xabea ; 0xabea 12b8a: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 12b8c: 81 2c mov r8, r1 12b8e: 91 2c mov r9, r1 12b90: 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(); 12b92: 88 23 and r24, r24 12b94: 21 f0 breq .+8 ; 0x12b9e 12b96: 0e 94 5d 56 call 0xacba ; 0xacba 12b9a: 4b 01 movw r8, r22 12b9c: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 12b9e: 87 e5 ldi r24, 0x57 ; 87 12ba0: 0e 94 f5 55 call 0xabea ; 0xabea 12ba4: 88 a7 std Y+40, r24 ; 0x28 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); #else gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, without_mbl); 12ba6: 8f 93 push r24 12ba8: cd 2c mov r12, r13 12baa: ec a4 ldd r14, Y+44 ; 0x2c 12bac: fd a4 ldd r15, Y+45 ; 0x2d 12bae: 0e a5 ldd r16, Y+46 ; 0x2e 12bb0: 1f a5 ldd r17, Y+47 ; 0x2f 12bb2: 22 2d mov r18, r2 12bb4: b3 01 movw r22, r6 12bb6: a2 01 movw r20, r4 12bb8: 83 2d mov r24, r3 12bba: 0e 94 fa 6c call 0xd9f4 ; 0xd9f4 #endif //TMC2130 if ((home_x || home_y || without_mbl || home_z) == false) { 12bbe: 0f 90 pop r0 12bc0: 31 10 cpse r3, r1 12bc2: 72 cb rjmp .-2332 ; 0x122a8 12bc4: 21 10 cpse r2, r1 12bc6: 70 cb rjmp .-2336 ; 0x122a8 12bc8: 38 a5 ldd r19, Y+40 ; 0x28 12bca: 31 11 cpse r19, r1 12bcc: 6d cb rjmp .-2342 ; 0x122a8 12bce: d1 10 cpse r13, r1 12bd0: 6b cb rjmp .-2346 ; 0x122a8 12bd2: 20 cb rjmp .-2496 ; 0x12214 - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 12bd4: 1c a6 std Y+44, r1 ; 0x2c 12bd6: 1d a6 std Y+45, r1 ; 0x2d 12bd8: 1e a6 std Y+46, r1 ; 0x2e 12bda: 1f a6 std Y+47, r1 ; 0x2f 12bdc: d3 cf rjmp .-90 ; 0x12b84 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) 12bde: 08 e2 ldi r16, 0x28 ; 40 12be0: 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)); 12be2: f8 e0 ldi r31, 0x08 ; 8 12be4: ef 2e mov r14, r31 12be6: f7 e6 ldi r31, 0x67 ; 103 12be8: ff 2e mov r15, r31 12bea: 60 2f mov r22, r16 12bec: 70 e0 ldi r23, 0x00 ; 0 12bee: 90 e0 ldi r25, 0x00 ; 0 12bf0: 80 e0 ldi r24, 0x00 ; 0 12bf2: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 12bf6: 0e 94 86 56 call 0xad0c ; 0xad0c 12bfa: 9f 93 push r25 12bfc: 8f 93 push r24 12bfe: 7f 93 push r23 12c00: 6f 93 push r22 12c02: 1f 93 push r17 12c04: 0f 93 push r16 12c06: ff 92 push r15 12c08: ef 92 push r14 12c0a: 0f 94 5f a2 call 0x344be ; 0x344be 12c0e: 0f 5f subi r16, 0xFF ; 255 12c10: 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++) 12c12: 0f b6 in r0, 0x3f ; 63 12c14: f8 94 cli 12c16: de bf out 0x3e, r29 ; 62 12c18: 0f be out 0x3f, r0 ; 63 12c1a: cd bf out 0x3d, r28 ; 61 12c1c: 0f 36 cpi r16, 0x6F ; 111 12c1e: 11 05 cpc r17, r1 12c20: 21 f7 brne .-56 ; 0x12bea 12c22: 42 cb rjmp .-2428 ; 0x122a8 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 12c24: 0f 94 90 10 call 0x22120 ; 0x22120 12c28: 81 11 cpse r24, r1 12c2a: 05 c0 rjmp .+10 ; 0x12c36 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 12c2c: 87 ec ldi r24, 0xC7 ; 199 12c2e: 90 e8 ldi r25, 0x80 ; 128 12c30: 0e 94 8d 7c call 0xf91a ; 0xf91a 12c34: 39 cb rjmp .-2446 ; 0x122a8 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 12c36: 82 e0 ldi r24, 0x02 ; 2 12c38: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 12c3c: 81 11 cpse r24, r1 12c3e: 07 c0 rjmp .+14 ; 0x12c4e //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)); 12c40: 8a ed ldi r24, 0xDA ; 218 12c42: 99 e3 ldi r25, 0x39 ; 57 12c44: 0e 94 0a 75 call 0xea14 ; 0xea14 12c48: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 12c4c: 2d cb rjmp .-2470 ; 0x122a8 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 12c4e: 80 91 39 06 lds r24, 0x0639 ; 0x800639 12c52: 88 23 and r24, r24 12c54: 41 f0 breq .+16 ; 0x12c66 12c56: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 12c5a: 88 23 and r24, r24 12c5c: 21 f0 breq .+8 ; 0x12c66 12c5e: d0 90 3b 06 lds r13, 0x063B ; 0x80063b 12c62: d1 10 cpse r13, r1 12c64: 08 c0 rjmp .+16 ; 0x12c76 // 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; 12c66: 81 e0 ldi r24, 0x01 ; 1 12c68: 80 93 53 12 sts 0x1253, r24 ; 0x801253 { // 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); 12c6c: 8d ec ldi r24, 0xCD ; 205 12c6e: 98 e6 ldi r25, 0x68 ; 104 12c70: 0f 94 49 67 call 0x2ce92 ; 0x2ce92 12c74: 19 cb rjmp .-2510 ; 0x122a8 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 12c76: 81 e9 ldi r24, 0x91 ; 145 12c78: 99 e3 ldi r25, 0x39 ; 57 12c7a: 0e 94 0a 75 call 0xea14 ; 0xea14 12c7e: 0e 94 85 e8 call 0x1d10a ; 0x1d10a uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 12c82: 8a ec ldi r24, 0xCA ; 202 12c84: 9f e3 ldi r25, 0x3F ; 63 12c86: 0e 94 0a 75 call 0xea14 ; 0xea14 12c8a: 41 e0 ldi r20, 0x01 ; 1 12c8c: 60 e0 ldi r22, 0x00 ; 0 12c8e: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 if (result == LCD_LEFT_BUTTON_CHOICE) 12c92: 81 11 cpse r24, r1 12c94: 6e c0 rjmp .+220 ; 0x12d72 { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12c96: 80 e0 ldi r24, 0x00 ; 0 12c98: 90 e0 ldi r25, 0x00 ; 0 12c9a: a0 ea ldi r26, 0xA0 ; 160 12c9c: b0 e4 ldi r27, 0x40 ; 64 12c9e: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12ca2: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12ca6: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12caa: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 12cae: 60 e0 ldi r22, 0x00 ; 0 12cb0: 70 e0 ldi r23, 0x00 ; 0 12cb2: 88 e4 ldi r24, 0x48 ; 72 12cb4: 92 e4 ldi r25, 0x42 ; 66 12cb6: 0f 94 0a 4a call 0x29414 ; 0x29414 current_position[Z_AXIS] = 50; 12cba: 80 e0 ldi r24, 0x00 ; 0 12cbc: 90 e0 ldi r25, 0x00 ; 0 12cbe: a8 e4 ldi r26, 0x48 ; 72 12cc0: b2 e4 ldi r27, 0x42 ; 66 12cc2: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12cc6: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12cca: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12cce: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c current_position[Y_AXIS] = 180; 12cd2: 80 e0 ldi r24, 0x00 ; 0 12cd4: 90 e0 ldi r25, 0x00 ; 0 12cd6: a4 e3 ldi r26, 0x34 ; 52 12cd8: b3 e4 ldi r27, 0x43 ; 67 12cda: 80 93 65 12 sts 0x1265, r24 ; 0x801265 12cde: 90 93 66 12 sts 0x1266, r25 ; 0x801266 12ce2: a0 93 67 12 sts 0x1267, r26 ; 0x801267 12ce6: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 12cea: 60 e0 ldi r22, 0x00 ; 0 12cec: 70 e0 ldi r23, 0x00 ; 0 12cee: 88 e4 ldi r24, 0x48 ; 72 12cf0: 92 e4 ldi r25, 0x42 ; 66 12cf2: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 12cf6: 0f 94 b0 18 call 0x23160 ; 0x23160 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 12cfa: 80 ea ldi r24, 0xA0 ; 160 12cfc: 9f e3 ldi r25, 0x3F ; 63 12cfe: 0e 94 0a 75 call 0xea14 ; 0xea14 12d02: 0e 94 85 e8 call 0x1d10a ; 0x1d10a current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 12d06: e4 e0 ldi r30, 0x04 ; 4 12d08: fc e9 ldi r31, 0x9C ; 156 12d0a: 85 91 lpm r24, Z+ 12d0c: 95 91 lpm r25, Z+ 12d0e: a5 91 lpm r26, Z+ 12d10: b4 91 lpm r27, Z 12d12: 80 93 65 12 sts 0x1265, r24 ; 0x801265 12d16: 90 93 66 12 sts 0x1266, r25 ; 0x801266 12d1a: a0 93 67 12 sts 0x1267, r26 ; 0x801267 12d1e: b0 93 68 12 sts 0x1268, r27 ; 0x801268 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 12d22: e0 e0 ldi r30, 0x00 ; 0 12d24: fc e9 ldi r31, 0x9C ; 156 12d26: 85 91 lpm r24, Z+ 12d28: 95 91 lpm r25, Z+ 12d2a: a5 91 lpm r26, Z+ 12d2c: b4 91 lpm r27, Z 12d2e: 80 93 61 12 sts 0x1261, r24 ; 0x801261 12d32: 90 93 62 12 sts 0x1262, r25 ; 0x801262 12d36: a0 93 63 12 sts 0x1263, r26 ; 0x801263 12d3a: b0 93 64 12 sts 0x1264, r27 ; 0x801264 plan_buffer_line_curposXYZE(3000 / 60); 12d3e: 60 e0 ldi r22, 0x00 ; 0 12d40: 70 e0 ldi r23, 0x00 ; 0 12d42: 88 e4 ldi r24, 0x48 ; 72 12d44: 92 e4 ldi r25, 0x42 ; 66 12d46: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 12d4a: 0f 94 b0 18 call 0x23160 ; 0x23160 static void gcode_G28(bool home_x_axis, bool home_y_axis, bool home_z_axis) { #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); 12d4e: 81 e0 ldi r24, 0x01 ; 1 12d50: 8f 93 push r24 12d52: 81 2c mov r8, r1 12d54: 91 2c mov r9, r1 12d56: 54 01 movw r10, r8 12d58: cc 24 eor r12, r12 12d5a: c3 94 inc r12 12d5c: e1 2c mov r14, r1 12d5e: f1 2c mov r15, r1 12d60: 87 01 movw r16, r14 12d62: 20 e0 ldi r18, 0x00 ; 0 12d64: 40 e0 ldi r20, 0x00 ; 0 12d66: 50 e0 ldi r21, 0x00 ; 0 12d68: ba 01 movw r22, r20 12d6a: 80 e0 ldi r24, 0x00 ; 0 12d6c: 0e 94 fa 6c call 0xd9f4 ; 0xd9f4 12d70: 0f 90 pop r0 plan_buffer_line_curposXYZE(3000 / 60); st_synchronize(); gcode_G28(false, false, true); } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 12d72: 20 e0 ldi r18, 0x00 ; 0 12d74: 30 e0 ldi r19, 0x00 ; 0 12d76: 4c e0 ldi r20, 0x0C ; 12 12d78: 52 e4 ldi r21, 0x42 ; 66 12d7a: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12d7e: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12d82: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12d86: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12d8a: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 12d8e: 18 16 cp r1, r24 12d90: 0c f0 brlt .+2 ; 0x12d94 12d92: 76 c0 rjmp .+236 ; 0x12e80 12d94: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 12d98: 81 11 cpse r24, r1 12d9a: 72 c0 rjmp .+228 ; 0x12e80 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 12d9c: 80 e0 ldi r24, 0x00 ; 0 12d9e: 90 e0 ldi r25, 0x00 ; 0 12da0: a8 ec ldi r26, 0xC8 ; 200 12da2: b2 e4 ldi r27, 0x42 ; 66 12da4: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12da8: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12dac: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12db0: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 12db4: 60 e0 ldi r22, 0x00 ; 0 12db6: 70 e0 ldi r23, 0x00 ; 0 12db8: 88 e4 ldi r24, 0x48 ; 72 12dba: 92 e4 ldi r25, 0x42 ; 66 12dbc: 0f 94 0a 4a call 0x29414 ; 0x29414 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 12dc0: 0f 94 3d 0e call 0x21c7a ; 0x21c7a LongTimer pinda_timeout; 12dc4: 19 82 std Y+1, r1 ; 0x01 12dc6: 1a 82 std Y+2, r1 ; 0x02 12dc8: 1b 82 std Y+3, r1 ; 0x03 12dca: 1c 82 std Y+4, r1 ; 0x04 12dcc: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 12dce: ce 01 movw r24, r28 12dd0: 01 96 adiw r24, 0x01 ; 1 12dd2: 0f 94 7f 0d call 0x21afe ; 0x21afe ::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); 12dd6: e3 e2 ldi r30, 0x23 ; 35 12dd8: fe 2e mov r15, r30 12dda: 06 e5 ldi r16, 0x56 ; 86 12ddc: 1e e7 ldi r17, 0x7E ; 126 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 12dde: 20 e0 ldi r18, 0x00 ; 0 12de0: 30 e0 ldi r19, 0x00 ; 0 12de2: 4c e0 ldi r20, 0x0C ; 12 12de4: 52 e4 ldi r21, 0x42 ; 66 12de6: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12dea: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12dee: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12df2: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12df6: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 12dfa: 18 16 cp r1, r24 12dfc: c4 f5 brge .+112 ; 0x12e6e lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 12dfe: 83 e4 ldi r24, 0x43 ; 67 12e00: 99 e3 ldi r25, 0x39 ; 57 12e02: 0e 94 0a 75 call 0xea14 ; 0xea14 12e06: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 12e0a: 42 e8 ldi r20, 0x82 ; 130 12e0c: 64 e0 ldi r22, 0x04 ; 4 12e0e: 80 e0 ldi r24, 0x00 ; 0 12e10: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 12e14: 1f 92 push r1 12e16: ff 92 push r15 12e18: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12e1c: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12e20: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12e24: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12e28: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 12e2c: 7f 93 push r23 12e2e: 6f 93 push r22 12e30: 1f 93 push r17 12e32: 0f 93 push r16 12e34: 0e 94 db 6e call 0xddb6 ; 0xddb6 lcd_putc(LCD_STR_DEGREE[0]); 12e38: 81 e8 ldi r24, 0x81 ; 129 12e3a: 0e 94 f1 6e call 0xdde2 ; 0xdde2 delay_keep_alive(1000); 12e3e: 88 ee ldi r24, 0xE8 ; 232 12e40: 93 e0 ldi r25, 0x03 ; 3 12e42: 0e 94 7f 8c call 0x118fe ; 0x118fe serialecho_temperatures(); 12e46: 0e 94 a2 7a call 0xf544 ; 0xf544 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 12e4a: 40 e0 ldi r20, 0x00 ; 0 12e4c: 53 e5 ldi r21, 0x53 ; 83 12e4e: 67 e0 ldi r22, 0x07 ; 7 12e50: 70 e0 ldi r23, 0x00 ; 0 12e52: ce 01 movw r24, r28 12e54: 01 96 adiw r24, 0x01 ; 1 12e56: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> 12e5a: 0f 90 pop r0 12e5c: 0f 90 pop r0 12e5e: 0f 90 pop r0 12e60: 0f 90 pop r0 12e62: 0f 90 pop r0 12e64: 0f 90 pop r0 12e66: 88 23 and r24, r24 12e68: 09 f4 brne .+2 ; 0x12e6c 12e6a: b9 cf rjmp .-142 ; 0x12dde target_temp_reached = false; 12e6c: d1 2c mov r13, r1 break; } } lcd_update_enable(true); 12e6e: 81 e0 ldi r24, 0x01 ; 1 12e70: 0e 94 08 70 call 0xe010 ; 0xe010 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 12e74: d1 10 cpse r13, r1 12e76: 04 c0 rjmp .+8 ; 0x12e80 lcd_temp_cal_show_result(false); 12e78: 80 e0 ldi r24, 0x00 ; 0 12e7a: 0e 94 92 f9 call 0x1f324 ; 0x1f324 12e7e: 14 ca rjmp .-3032 ; 0x122a8 break; } } st_synchronize(); 12e80: 0f 94 b0 18 call 0x23160 ; 0x23160 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 12e84: 81 e0 ldi r24, 0x01 ; 1 12e86: 80 93 71 12 sts 0x1271, r24 ; 0x801271 lcd_update_enable(true); 12e8a: 0e 94 08 70 call 0xe010 ; 0xe010 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 12e8e: 89 ea ldi r24, 0xA9 ; 169 12e90: 90 e8 ldi r25, 0x80 ; 128 12e92: 0e 94 8d 7c call 0xf91a ; 0xf91a float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 12e96: 80 90 85 03 lds r8, 0x0385 ; 0x800385 12e9a: 90 90 86 03 lds r9, 0x0386 ; 0x800386 12e9e: a0 90 87 03 lds r10, 0x0387 ; 0x800387 12ea2: b0 90 88 03 lds r11, 0x0388 ; 0x800388 12ea6: 20 e0 ldi r18, 0x00 ; 0 12ea8: 30 e0 ldi r19, 0x00 ; 0 12eaa: 40 ea ldi r20, 0xA0 ; 160 12eac: 50 e4 ldi r21, 0x40 ; 64 12eae: c5 01 movw r24, r10 12eb0: b4 01 movw r22, r8 12eb2: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 12eb6: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 12eba: 25 e0 ldi r18, 0x05 ; 5 12ebc: 26 9f mul r18, r22 12ebe: a0 01 movw r20, r0 12ec0: 27 9f mul r18, r23 12ec2: 50 0d add r21, r0 12ec4: 11 24 eor r1, r1 12ec6: ba 01 movw r22, r20 12ec8: 55 0f add r21, r21 12eca: 88 0b sbc r24, r24 12ecc: 99 0b sbc r25, r25 12ece: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 12ed2: 1b 01 movw r2, r22 12ed4: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 12ed6: 20 e0 ldi r18, 0x00 ; 0 12ed8: 30 e0 ldi r19, 0x00 ; 0 12eda: 4c e0 ldi r20, 0x0C ; 12 12edc: 52 e4 ldi r21, 0x42 ; 66 12ede: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 12ee2: 87 ff sbrs r24, 7 12ee4: 06 c0 rjmp .+12 ; 0x12ef2 12ee6: 21 2c mov r2, r1 12ee8: 31 2c mov r3, r1 12eea: 6c e0 ldi r22, 0x0C ; 12 12eec: e6 2e mov r14, r22 12eee: 72 e4 ldi r23, 0x42 ; 66 12ef0: f7 2e mov r15, r23 if (start_temp < current_temperature_pinda) start_temp += 5; 12ef2: 22 2d mov r18, r2 12ef4: 33 2d mov r19, r3 12ef6: 4e 2d mov r20, r14 12ef8: 5f 2d mov r21, r15 12efa: c5 01 movw r24, r10 12efc: b4 01 movw r22, r8 12efe: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 12f02: 18 16 cp r1, r24 12f04: 64 f4 brge .+24 ; 0x12f1e 12f06: 20 e0 ldi r18, 0x00 ; 0 12f08: 30 e0 ldi r19, 0x00 ; 0 12f0a: 40 ea ldi r20, 0xA0 ; 160 12f0c: 50 e4 ldi r21, 0x40 ; 64 12f0e: 62 2d mov r22, r2 12f10: 73 2d mov r23, r3 12f12: 8e 2d mov r24, r14 12f14: 9f 2d mov r25, r15 12f16: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 12f1a: 1b 01 movw r2, r22 12f1c: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 12f1e: ff 92 push r15 12f20: ef 92 push r14 12f22: 3f 92 push r3 12f24: 2f 92 push r2 12f26: 8f ee ldi r24, 0xEF ; 239 12f28: 96 e6 ldi r25, 0x66 ; 102 12f2a: 9f 93 push r25 12f2c: 8f 93 push r24 12f2e: 0f 94 5f a2 call 0x344be ; 0x344be setTargetBed(70 + (start_temp - 30)); 12f32: 20 e0 ldi r18, 0x00 ; 0 12f34: 30 e0 ldi r19, 0x00 ; 0 12f36: 40 ef ldi r20, 0xF0 ; 240 12f38: 51 e4 ldi r21, 0x41 ; 65 12f3a: 62 2d mov r22, r2 12f3c: 73 2d mov r23, r3 12f3e: 8e 2d mov r24, r14 12f40: 9f 2d mov r25, r15 12f42: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 12f46: 20 e0 ldi r18, 0x00 ; 0 12f48: 30 e0 ldi r19, 0x00 ; 0 12f4a: 4c e8 ldi r20, 0x8C ; 140 12f4c: 52 e4 ldi r21, 0x42 ; 66 12f4e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 12f52: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 12f56: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 12f5a: 60 93 59 12 sts 0x1259, r22 ; 0x801259 custom_message_type = CustomMsg::TempCal; 12f5e: 84 e0 ldi r24, 0x04 ; 4 12f60: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = 1; 12f64: 81 e0 ldi r24, 0x01 ; 1 12f66: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 12f6a: 89 e7 ldi r24, 0x79 ; 121 12f6c: 95 e4 ldi r25, 0x45 ; 69 12f6e: 0e 94 0a 75 call 0xea14 ; 0xea14 12f72: 0e 94 85 dc call 0x1b90a ; 0x1b90a current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12f76: 80 e0 ldi r24, 0x00 ; 0 12f78: 90 e0 ldi r25, 0x00 ; 0 12f7a: a0 ea ldi r26, 0xA0 ; 160 12f7c: b0 e4 ldi r27, 0x40 ; 64 12f7e: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12f82: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12f86: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12f8a: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 12f8e: 60 e0 ldi r22, 0x00 ; 0 12f90: 70 e0 ldi r23, 0x00 ; 0 12f92: 88 e4 ldi r24, 0x48 ; 72 12f94: 92 e4 ldi r25, 0x42 ; 66 12f96: 0f 94 0a 4a call 0x29414 ; 0x29414 current_position[X_AXIS] = PINDA_PREHEAT_X; 12f9a: 80 e0 ldi r24, 0x00 ; 0 12f9c: 90 e0 ldi r25, 0x00 ; 0 12f9e: a0 ea ldi r26, 0xA0 ; 160 12fa0: b1 e4 ldi r27, 0x41 ; 65 12fa2: 80 93 61 12 sts 0x1261, r24 ; 0x801261 12fa6: 90 93 62 12 sts 0x1262, r25 ; 0x801262 12faa: a0 93 63 12 sts 0x1263, r26 ; 0x801263 12fae: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 12fb2: 80 e0 ldi r24, 0x00 ; 0 12fb4: 90 e0 ldi r25, 0x00 ; 0 12fb6: a0 e7 ldi r26, 0x70 ; 112 12fb8: b2 e4 ldi r27, 0x42 ; 66 12fba: 80 93 65 12 sts 0x1265, r24 ; 0x801265 12fbe: 90 93 66 12 sts 0x1266, r25 ; 0x801266 12fc2: a0 93 67 12 sts 0x1267, r26 ; 0x801267 12fc6: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 12fca: 60 e0 ldi r22, 0x00 ; 0 12fcc: 70 e0 ldi r23, 0x00 ; 0 12fce: 88 e4 ldi r24, 0x48 ; 72 12fd0: 92 e4 ldi r25, 0x42 ; 66 12fd2: 0f 94 0a 4a call 0x29414 ; 0x29414 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 12fd6: 8a e9 ldi r24, 0x9A ; 154 12fd8: 99 e9 ldi r25, 0x99 ; 153 12fda: a9 e1 ldi r26, 0x19 ; 25 12fdc: be e3 ldi r27, 0x3E ; 62 12fde: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12fe2: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12fe6: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12fea: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 12fee: 60 e0 ldi r22, 0x00 ; 0 12ff0: 70 e0 ldi r23, 0x00 ; 0 12ff2: 88 e4 ldi r24, 0x48 ; 72 12ff4: 92 e4 ldi r25, 0x42 ; 66 12ff6: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 12ffa: 0f 94 b0 18 call 0x23160 ; 0x23160 12ffe: 0f 90 pop r0 13000: 0f 90 pop r0 13002: 0f 90 pop r0 13004: 0f 90 pop r0 13006: 0f 90 pop r0 13008: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 1300a: 20 91 85 03 lds r18, 0x0385 ; 0x800385 1300e: 30 91 86 03 lds r19, 0x0386 ; 0x800386 13012: 40 91 87 03 lds r20, 0x0387 ; 0x800387 13016: 50 91 88 03 lds r21, 0x0388 ; 0x800388 1301a: 62 2d mov r22, r2 1301c: 73 2d mov r23, r3 1301e: 8e 2d mov r24, r14 13020: 9f 2d mov r25, r15 13022: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 13026: 18 16 cp r1, r24 13028: 3c f4 brge .+14 ; 0x13038 { delay_keep_alive(1000); 1302a: 88 ee ldi r24, 0xE8 ; 232 1302c: 93 e0 ldi r25, 0x03 ; 3 1302e: 0e 94 7f 8c call 0x118fe ; 0x118fe serialecho_temperatures(); 13032: 0e 94 a2 7a call 0xf544 ; 0xf544 13036: e9 cf rjmp .-46 ; 0x1300a 13038: 60 e0 ldi r22, 0x00 ; 0 1303a: 86 ea ldi r24, 0xA6 ; 166 1303c: 9f e0 ldi r25, 0x0F ; 15 1303e: 0f 94 c1 a3 call 0x34782 ; 0x34782 } 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; 13042: 80 e0 ldi r24, 0x00 ; 0 13044: 90 e0 ldi r25, 0x00 ; 0 13046: a0 ea ldi r26, 0xA0 ; 160 13048: b0 e4 ldi r27, 0x40 ; 64 1304a: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1304e: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 13052: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 13056: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 1305a: 60 e0 ldi r22, 0x00 ; 0 1305c: 70 e0 ldi r23, 0x00 ; 0 1305e: 88 e4 ldi r24, 0x48 ; 72 13060: 92 e4 ldi r25, 0x42 ; 66 13062: 0f 94 0a 4a call 0x29414 ; 0x29414 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 13066: e0 e0 ldi r30, 0x00 ; 0 13068: fc e9 ldi r31, 0x9C ; 156 1306a: 85 91 lpm r24, Z+ 1306c: 95 91 lpm r25, Z+ 1306e: a5 91 lpm r26, Z+ 13070: b4 91 lpm r27, Z 13072: 80 93 61 12 sts 0x1261, r24 ; 0x801261 13076: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1307a: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1307e: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 13082: e4 e0 ldi r30, 0x04 ; 4 13084: fc e9 ldi r31, 0x9C ; 156 13086: 85 91 lpm r24, Z+ 13088: 95 91 lpm r25, Z+ 1308a: a5 91 lpm r26, Z+ 1308c: b4 91 lpm r27, Z 1308e: 80 93 65 12 sts 0x1265, r24 ; 0x801265 13092: 90 93 66 12 sts 0x1266, r25 ; 0x801266 13096: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1309a: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 1309e: 60 e0 ldi r22, 0x00 ; 0 130a0: 70 e0 ldi r23, 0x00 ; 0 130a2: 88 e4 ldi r24, 0x48 ; 72 130a4: 92 e4 ldi r25, 0x42 ; 66 130a6: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 130aa: 0f 94 b0 18 call 0x23160 ; 0x23160 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 130ae: 43 e0 ldi r20, 0x03 ; 3 130b0: 60 e0 ldi r22, 0x00 ; 0 130b2: 70 e0 ldi r23, 0x00 ; 0 130b4: 80 e8 ldi r24, 0x80 ; 128 130b6: 9f eb ldi r25, 0xBF ; 191 130b8: 0f 94 aa 7b call 0x2f754 ; 0x2f754 if (find_z_result == false) { 130bc: 81 11 cpse r24, r1 130be: 05 c0 rjmp .+10 ; 0x130ca 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); 130c0: 0e 94 92 f9 call 0x1f324 ; 0x1f324 homing_flag = false; 130c4: 10 92 71 12 sts 0x1271, r1 ; 0x801271 130c8: ef c8 rjmp .-3618 ; 0x122a8 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 130ca: 90 91 69 12 lds r25, 0x1269 ; 0x801269 130ce: 98 a7 std Y+40, r25 ; 0x28 130d0: a0 91 6a 12 lds r26, 0x126A ; 0x80126a 130d4: ac a7 std Y+44, r26 ; 0x2c 130d6: b0 91 6b 12 lds r27, 0x126B ; 0x80126b 130da: b8 ab std Y+48, r27 ; 0x30 130dc: e0 91 6c 12 lds r30, 0x126C ; 0x80126c 130e0: e8 af std Y+56, r30 ; 0x38 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 130e2: ef 93 push r30 130e4: bf 93 push r27 130e6: af 93 push r26 130e8: 9f 93 push r25 130ea: 82 ee ldi r24, 0xE2 ; 226 130ec: 96 e6 ldi r25, 0x66 ; 102 130ee: 9f 93 push r25 130f0: 8f 93 push r24 130f2: 0f 94 5f a2 call 0x344be ; 0x344be 130f6: 0f 90 pop r0 130f8: 0f 90 pop r0 130fa: 0f 90 pop r0 130fc: 0f 90 pop r0 130fe: 0f 90 pop r0 13100: 0f 90 pop r0 13102: 4e ea ldi r20, 0xAE ; 174 13104: 84 2e mov r8, r20 13106: 4f e0 ldi r20, 0x0F ; 15 13108: 94 2e mov r9, r20 1310a: 53 e2 ldi r21, 0x23 ; 35 1310c: c5 2e mov r12, r21 1310e: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 13110: 0f ef ldi r16, 0xFF ; 255 13112: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 13114: b6 01 movw r22, r12 13116: 0d 2c mov r0, r13 13118: 00 0c add r0, r0 1311a: 88 0b sbc r24, r24 1311c: 99 0b sbc r25, r25 1311e: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 13122: 2b 01 movw r4, r22 13124: 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)); 13126: df 92 push r13 13128: cf 92 push r12 1312a: c8 01 movw r24, r16 1312c: 02 96 adiw r24, 0x02 ; 2 1312e: 9f 93 push r25 13130: 8f 93 push r24 13132: 26 ea ldi r18, 0xA6 ; 166 13134: 36 e6 ldi r19, 0x66 ; 102 13136: 3f 93 push r19 13138: 2f 93 push r18 1313a: 0f 94 5f a2 call 0x344be ; 0x344be 1313e: 58 01 movw r10, r16 13140: 5f ef ldi r21, 0xFF ; 255 13142: a5 1a sub r10, r21 13144: b5 0a sbc r11, r21 if (i >= 0) { 13146: 0f 90 pop r0 13148: 0f 90 pop r0 1314a: 0f 90 pop r0 1314c: 0f 90 pop r0 1314e: 0f 90 pop r0 13150: 0f 90 pop r0 13152: 11 f4 brne .+4 ; 0x13158 13154: 0c 94 0c ba jmp 0x17418 ; 0x17418 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 13158: 70 e0 ldi r23, 0x00 ; 0 1315a: 60 e0 ldi r22, 0x00 ; 0 1315c: c4 01 movw r24, r8 1315e: 0f 94 df a3 call 0x347be ; 0x347be eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 13162: a3 01 movw r20, r6 13164: 92 01 movw r18, r4 13166: 62 2d mov r22, r2 13168: 73 2d mov r23, r3 1316a: 8e 2d mov r24, r14 1316c: 9f 2d mov r25, r15 1316e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 13172: 18 16 cp r1, r24 13174: 44 f4 brge .+16 ; 0x13186 } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 13176: 85 e0 ldi r24, 0x05 ; 5 13178: a8 16 cp r10, r24 1317a: b1 04 cpc r11, r1 1317c: 11 f0 breq .+4 ; 0x13182 1317e: 0c 94 18 ba jmp 0x17430 ; 0x17430 13182: 05 e0 ldi r16, 0x05 ; 5 13184: 10 e0 ldi r17, 0x00 ; 0 13186: 58 01 movw r10, r16 13188: 97 e2 ldi r25, 0x27 ; 39 1318a: a9 1a sub r10, r25 1318c: 98 ef ldi r25, 0xF8 ; 248 1318e: b9 0a sbc r11, r25 13190: aa 0c add r10, r10 13192: bb 1c adc r11, r11 13194: 85 e0 ldi r24, 0x05 ; 5 13196: 80 9f mul r24, r16 13198: 10 01 movw r2, r0 1319a: 81 9f mul r24, r17 1319c: 30 0c add r3, r0 1319e: 11 24 eor r1, r1 131a0: 0d 5f subi r16, 0xFD ; 253 131a2: 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; 131a4: 2a e9 ldi r18, 0x9A ; 154 131a6: 42 2e mov r4, r18 131a8: 29 e9 ldi r18, 0x99 ; 153 131aa: 52 2e mov r5, r18 131ac: 29 e1 ldi r18, 0x19 ; 25 131ae: 62 2e mov r6, r18 131b0: 2e e3 ldi r18, 0x3E ; 62 131b2: 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); 131b4: 3d e6 ldi r19, 0x6D ; 109 131b6: 83 2e mov r8, r19 131b8: 36 e6 ldi r19, 0x66 ; 102 131ba: 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++) 131bc: c8 01 movw r24, r16 131be: 02 97 sbiw r24, 0x02 ; 2 131c0: 05 97 sbiw r24, 0x05 ; 5 131c2: 0c f0 brlt .+2 ; 0x131c6 131c4: d4 c0 rjmp .+424 ; 0x1336e { float temp = (40 + i * 5); 131c6: b1 01 movw r22, r2 131c8: 63 5d subi r22, 0xD3 ; 211 131ca: 7f 4f sbci r23, 0xFF ; 255 131cc: 07 2e mov r0, r23 131ce: 00 0c add r0, r0 131d0: 88 0b sbc r24, r24 131d2: 99 0b sbc r25, r25 131d4: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 131d8: 6b 01 movw r12, r22 131da: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 131dc: 1f 93 push r17 131de: 0f 93 push r16 131e0: a9 e9 ldi r26, 0x99 ; 153 131e2: b6 e6 ldi r27, 0x66 ; 102 131e4: bf 93 push r27 131e6: af 93 push r26 131e8: 0f 94 5f a2 call 0x344be ; 0x344be custom_message_state = i + 2; 131ec: 00 93 de 03 sts 0x03DE, r16 ; 0x8003de setTargetBed(50 + 10 * (temp - 30) / 5); 131f0: 20 e0 ldi r18, 0x00 ; 0 131f2: 30 e0 ldi r19, 0x00 ; 0 131f4: 40 ef ldi r20, 0xF0 ; 240 131f6: 51 e4 ldi r21, 0x41 ; 65 131f8: c7 01 movw r24, r14 131fa: b6 01 movw r22, r12 131fc: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 13200: 20 e0 ldi r18, 0x00 ; 0 13202: 30 e0 ldi r19, 0x00 ; 0 13204: 40 e2 ldi r20, 0x20 ; 32 13206: 51 e4 ldi r21, 0x41 ; 65 13208: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1320c: 20 e0 ldi r18, 0x00 ; 0 1320e: 30 e0 ldi r19, 0x00 ; 0 13210: 40 ea ldi r20, 0xA0 ; 160 13212: 50 e4 ldi r21, 0x40 ; 64 13214: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 13218: 20 e0 ldi r18, 0x00 ; 0 1321a: 30 e0 ldi r19, 0x00 ; 0 1321c: 48 e4 ldi r20, 0x48 ; 72 1321e: 52 e4 ldi r21, 0x42 ; 66 13220: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 13224: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 13228: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 1322c: 60 93 59 12 sts 0x1259, r22 ; 0x801259 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 13230: 80 e0 ldi r24, 0x00 ; 0 13232: 90 e0 ldi r25, 0x00 ; 0 13234: a0 ea ldi r26, 0xA0 ; 160 13236: b0 e4 ldi r27, 0x40 ; 64 13238: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1323c: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 13240: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 13244: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 13248: 60 e0 ldi r22, 0x00 ; 0 1324a: 70 e0 ldi r23, 0x00 ; 0 1324c: 88 e4 ldi r24, 0x48 ; 72 1324e: 92 e4 ldi r25, 0x42 ; 66 13250: 0f 94 0a 4a call 0x29414 ; 0x29414 current_position[X_AXIS] = PINDA_PREHEAT_X; 13254: 20 e0 ldi r18, 0x00 ; 0 13256: 30 e0 ldi r19, 0x00 ; 0 13258: 40 ea ldi r20, 0xA0 ; 160 1325a: 51 e4 ldi r21, 0x41 ; 65 1325c: 20 93 61 12 sts 0x1261, r18 ; 0x801261 13260: 30 93 62 12 sts 0x1262, r19 ; 0x801262 13264: 40 93 63 12 sts 0x1263, r20 ; 0x801263 13268: 50 93 64 12 sts 0x1264, r21 ; 0x801264 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 1326c: 80 e0 ldi r24, 0x00 ; 0 1326e: 90 e0 ldi r25, 0x00 ; 0 13270: a0 e7 ldi r26, 0x70 ; 112 13272: b2 e4 ldi r27, 0x42 ; 66 13274: 80 93 65 12 sts 0x1265, r24 ; 0x801265 13278: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1327c: a0 93 67 12 sts 0x1267, r26 ; 0x801267 13280: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 13284: 60 e0 ldi r22, 0x00 ; 0 13286: 70 e0 ldi r23, 0x00 ; 0 13288: 88 e4 ldi r24, 0x48 ; 72 1328a: 92 e4 ldi r25, 0x42 ; 66 1328c: 0f 94 0a 4a call 0x29414 ; 0x29414 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 13290: 40 92 69 12 sts 0x1269, r4 ; 0x801269 13294: 50 92 6a 12 sts 0x126A, r5 ; 0x80126a 13298: 60 92 6b 12 sts 0x126B, r6 ; 0x80126b 1329c: 70 92 6c 12 sts 0x126C, r7 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 132a0: 60 e0 ldi r22, 0x00 ; 0 132a2: 70 e0 ldi r23, 0x00 ; 0 132a4: 88 e4 ldi r24, 0x48 ; 72 132a6: 92 e4 ldi r25, 0x42 ; 66 132a8: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 132ac: 0f 94 b0 18 call 0x23160 ; 0x23160 132b0: 0f 90 pop r0 132b2: 0f 90 pop r0 132b4: 0f 90 pop r0 132b6: 0f 90 pop r0 while (current_temperature_pinda < temp) 132b8: 20 91 85 03 lds r18, 0x0385 ; 0x800385 132bc: 30 91 86 03 lds r19, 0x0386 ; 0x800386 132c0: 40 91 87 03 lds r20, 0x0387 ; 0x800387 132c4: 50 91 88 03 lds r21, 0x0388 ; 0x800388 132c8: c7 01 movw r24, r14 132ca: b6 01 movw r22, r12 132cc: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 132d0: 18 16 cp r1, r24 132d2: 3c f4 brge .+14 ; 0x132e2 { delay_keep_alive(1000); 132d4: 88 ee ldi r24, 0xE8 ; 232 132d6: 93 e0 ldi r25, 0x03 ; 3 132d8: 0e 94 7f 8c call 0x118fe ; 0x118fe serialecho_temperatures(); 132dc: 0e 94 a2 7a call 0xf544 ; 0xf544 132e0: eb cf rjmp .-42 ; 0x132b8 } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 132e2: 80 e0 ldi r24, 0x00 ; 0 132e4: 90 e0 ldi r25, 0x00 ; 0 132e6: a0 ea ldi r26, 0xA0 ; 160 132e8: b0 e4 ldi r27, 0x40 ; 64 132ea: 80 93 69 12 sts 0x1269, r24 ; 0x801269 132ee: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 132f2: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 132f6: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 132fa: 60 e0 ldi r22, 0x00 ; 0 132fc: 70 e0 ldi r23, 0x00 ; 0 132fe: 88 e4 ldi r24, 0x48 ; 72 13300: 92 e4 ldi r25, 0x42 ; 66 13302: 0f 94 0a 4a call 0x29414 ; 0x29414 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 13306: e0 e0 ldi r30, 0x00 ; 0 13308: fc e9 ldi r31, 0x9C ; 156 1330a: 85 91 lpm r24, Z+ 1330c: 95 91 lpm r25, Z+ 1330e: a5 91 lpm r26, Z+ 13310: b4 91 lpm r27, Z 13312: 80 93 61 12 sts 0x1261, r24 ; 0x801261 13316: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1331a: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1331e: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 13322: e4 e0 ldi r30, 0x04 ; 4 13324: fc e9 ldi r31, 0x9C ; 156 13326: 85 91 lpm r24, Z+ 13328: 95 91 lpm r25, Z+ 1332a: a5 91 lpm r26, Z+ 1332c: b4 91 lpm r27, Z 1332e: 80 93 65 12 sts 0x1265, r24 ; 0x801265 13332: 90 93 66 12 sts 0x1266, r25 ; 0x801266 13336: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1333a: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 1333e: 60 e0 ldi r22, 0x00 ; 0 13340: 70 e0 ldi r23, 0x00 ; 0 13342: 88 e4 ldi r24, 0x48 ; 72 13344: 92 e4 ldi r25, 0x42 ; 66 13346: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1334a: 0f 94 b0 18 call 0x23160 ; 0x23160 find_z_result = find_bed_induction_sensor_point_z(-1.f); 1334e: 43 e0 ldi r20, 0x03 ; 3 13350: 60 e0 ldi r22, 0x00 ; 0 13352: 70 e0 ldi r23, 0x00 ; 0 13354: 80 e8 ldi r24, 0x80 ; 128 13356: 9f eb ldi r25, 0xBF ; 191 13358: 0f 94 aa 7b call 0x2f754 ; 0x2f754 1335c: 95 e0 ldi r25, 0x05 ; 5 1335e: 29 0e add r2, r25 13360: 31 1c adc r3, r1 13362: 0f 5f subi r16, 0xFF ; 255 13364: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 13366: 81 11 cpse r24, r1 13368: 04 c0 rjmp .+8 ; 0x13372 lcd_temp_cal_show_result(find_z_result); 1336a: 0e 94 92 f9 call 0x1f324 ; 0x1f324 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); 1336e: 81 e0 ldi r24, 0x01 ; 1 13370: a7 ce rjmp .-690 ; 0x130c0 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]); 13372: 78 a5 ldd r23, Y+40 ; 0x28 13374: 6c a5 ldd r22, Y+44 ; 0x2c 13376: 98 a9 ldd r25, Y+48 ; 0x30 13378: 88 ad ldd r24, Y+56 ; 0x38 1337a: 27 2f mov r18, r23 1337c: 36 2f mov r19, r22 1337e: 49 2f mov r20, r25 13380: 58 2f mov r21, r24 13382: 60 91 69 12 lds r22, 0x1269 ; 0x801269 13386: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 1338a: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1338e: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 13392: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 13396: f6 2e mov r15, r22 13398: e7 2e mov r14, r23 1339a: d8 2e mov r13, r24 1339c: c9 2e mov r12, r25 1339e: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 133a2: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 133a6: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 133aa: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 133ae: d7 01 movw r26, r14 133b0: f6 01 movw r30, r12 133b2: 6b 2f mov r22, r27 133b4: 7a 2f mov r23, r26 133b6: 8f 2f mov r24, r31 133b8: 9e 2f mov r25, r30 133ba: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 133be: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 133c2: 6c ab std Y+52, r22 ; 0x34 133c4: 7d ab std Y+53, r23 ; 0x35 133c6: 8e ab std Y+54, r24 ; 0x36 133c8: 9f ab std Y+55, r25 ; 0x37 printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z); 133ca: cf 92 push r12 133cc: df 92 push r13 133ce: ef 92 push r14 133d0: ff 92 push r15 133d2: 80 91 88 03 lds r24, 0x0388 ; 0x800388 133d6: 8f 93 push r24 133d8: 80 91 87 03 lds r24, 0x0387 ; 0x800387 133dc: 8f 93 push r24 133de: 80 91 86 03 lds r24, 0x0386 ; 0x800386 133e2: 8f 93 push r24 133e4: 80 91 85 03 lds r24, 0x0385 ; 0x800385 133e8: 8f 93 push r24 133ea: 9f 92 push r9 133ec: 8f 92 push r8 133ee: 0f 94 5f a2 call 0x344be ; 0x344be 133f2: 6c a9 ldd r22, Y+52 ; 0x34 133f4: 7d a9 ldd r23, Y+53 ; 0x35 133f6: c5 01 movw r24, r10 133f8: 0f 94 df a3 call 0x347be ; 0x347be 133fc: a2 e0 ldi r26, 0x02 ; 2 133fe: aa 0e add r10, r26 13400: b1 1c adc r11, r1 13402: 0f b6 in r0, 0x3f ; 63 13404: f8 94 cli 13406: de bf out 0x3e, r29 ; 62 13408: 0f be out 0x3f, r0 ; 63 1340a: cd bf out 0x3d, r28 ; 61 1340c: d7 ce rjmp .-594 ; 0x131bc /*! ### 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(); 1340e: 0e 94 4b 83 call 0x10696 ; 0x10696 13412: 0c 94 54 91 jmp 0x122a8 ; 0x122a8 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 13416: 80 e1 ldi r24, 0x10 ; 16 13418: 0e 94 ea d4 call 0x1a9d4 ; 0x1a9d4 1341c: 0c 94 54 91 jmp 0x122a8 ; 0x122a8 /*! ### 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); 13420: 80 91 57 12 lds r24, 0x1257 ; 0x801257 13424: 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; 13426: 80 93 57 12 sts 0x1257, r24 ; 0x801257 1342a: 0c 94 54 91 jmp 0x122a8 ; 0x122a8 1342e: b4 ec ldi r27, 0xC4 ; 196 13430: cb 2e mov r12, r27 13432: b2 e0 ldi r27, 0x02 ; 2 13434: db 2e mov r13, r27 13436: 8e 01 movw r16, r28 13438: 0c 5d subi r16, 0xDC ; 220 1343a: 1f 4f sbci r17, 0xFF ; 255 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) 1343c: 58 01 movw r10, r16 1343e: ee 24 eor r14, r14 13440: e3 94 inc r14 13442: f1 2c mov r15, r1 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]); 13444: d6 01 movw r26, r12 13446: 8d 91 ld r24, X+ 13448: 6d 01 movw r12, r26 1344a: 0e 94 f5 55 call 0xabea ; 0xabea 1344e: f5 01 movw r30, r10 13450: 81 93 st Z+, r24 13452: 5f 01 movw r10, r30 if(codes[i]) 13454: 88 23 and r24, r24 13456: 91 f0 breq .+36 ; 0x1347c values[i] = code_value(); 13458: 0e 94 85 5a call 0xb50a ; 0xb50a 1345c: f7 01 movw r30, r14 1345e: ee 0f add r30, r30 13460: ff 1f adc r31, r31 13462: ee 0f add r30, r30 13464: ff 1f adc r31, r31 13466: 34 97 sbiw r30, 0x04 ; 4 13468: 21 e0 ldi r18, 0x01 ; 1 1346a: 30 e0 ldi r19, 0x00 ; 0 1346c: 2c 0f add r18, r28 1346e: 3d 1f adc r19, r29 13470: e2 0f add r30, r18 13472: f3 1f adc r31, r19 13474: 60 83 st Z, r22 13476: 71 83 std Z+1, r23 ; 0x01 13478: 82 83 std Z+2, r24 ; 0x02 1347a: 93 83 std Z+3, r25 ; 0x03 1347c: 3f ef ldi r19, 0xFF ; 255 1347e: e3 1a sub r14, r19 13480: f3 0a sbc r15, r19 { bool codes[NUM_AXIS]; float values[NUM_AXIS]; // Check which axes need to be set for(uint8_t i = 0; i < NUM_AXIS; ++i) 13482: 45 e0 ldi r20, 0x05 ; 5 13484: e4 16 cp r14, r20 13486: f1 04 cpc r15, r1 13488: e9 f6 brne .-70 ; 0x13444 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 1348a: 9f a0 ldd r9, Y+39 ; 0x27 1348c: fc a0 ldd r15, Y+36 ; 0x24 1348e: 99 20 and r9, r9 13490: 01 f1 breq .+64 ; 0x134d2 13492: 20 e0 ldi r18, 0x00 ; 0 13494: 30 e0 ldi r19, 0x00 ; 0 13496: a9 01 movw r20, r18 13498: 6d 85 ldd r22, Y+13 ; 0x0d 1349a: 7e 85 ldd r23, Y+14 ; 0x0e 1349c: 8f 85 ldd r24, Y+15 ; 0x0f 1349e: 98 89 ldd r25, Y+16 ; 0x10 134a0: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 134a4: 81 11 cpse r24, r1 134a6: 15 c0 rjmp .+42 ; 0x134d2 134a8: f1 10 cpse r15, r1 134aa: 13 c0 rjmp .+38 ; 0x134d2 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 134ac: 8d a1 ldd r24, Y+37 ; 0x25 134ae: 81 11 cpse r24, r1 134b0: 10 c0 rjmp .+32 ; 0x134d2 134b2: 8e a1 ldd r24, Y+38 ; 0x26 134b4: 81 11 cpse r24, r1 134b6: 0d c0 rjmp .+26 ; 0x134d2 { // 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; 134b8: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d 134bc: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 134c0: 10 92 6f 12 sts 0x126F, r1 ; 0x80126f 134c4: 10 92 70 12 sts 0x1270, r1 ; 0x801270 st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 134c8: 81 e0 ldi r24, 0x01 ; 1 134ca: 80 93 21 04 sts 0x0421, r24 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.444> 134ce: 0c 94 54 91 jmp 0x122a8 ; 0x122a8 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 134d2: 0f 94 b0 18 call 0x23160 ; 0x23160 134d6: ce 01 movw r24, r28 134d8: 01 96 adiw r24, 0x01 ; 1 134da: 5c 01 movw r10, r24 134dc: 5f eb ldi r21, 0xBF ; 191 134de: c5 2e mov r12, r21 134e0: 5d e0 ldi r21, 0x0D ; 13 134e2: d5 2e mov r13, r21 134e4: 61 e6 ldi r22, 0x61 ; 97 134e6: e6 2e mov r14, r22 134e8: 62 e1 ldi r22, 0x12 ; 18 134ea: f6 2e mov r15, r22 134ec: 38 01 movw r6, r16 134ee: 93 e0 ldi r25, 0x03 ; 3 134f0: 69 0e add r6, r25 134f2: 71 1c adc r7, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 134f4: d8 01 movw r26, r16 134f6: 8d 91 ld r24, X+ 134f8: 8d 01 movw r16, r26 134fa: 88 23 and r24, r24 134fc: 89 f0 breq .+34 ; 0x13520 current_position[i] = values[i] + cs.add_homing[i]; 134fe: f6 01 movw r30, r12 13500: 20 81 ld r18, Z 13502: 31 81 ldd r19, Z+1 ; 0x01 13504: 42 81 ldd r20, Z+2 ; 0x02 13506: 53 81 ldd r21, Z+3 ; 0x03 13508: d5 01 movw r26, r10 1350a: 6d 91 ld r22, X+ 1350c: 7d 91 ld r23, X+ 1350e: 8d 91 ld r24, X+ 13510: 9c 91 ld r25, X 13512: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 13516: f7 01 movw r30, r14 13518: 60 83 st Z, r22 1351a: 71 83 std Z+1, r23 ; 0x01 1351c: 82 83 std Z+2, r24 ; 0x02 1351e: 93 83 std Z+3, r25 ; 0x03 13520: f4 e0 ldi r31, 0x04 ; 4 13522: af 0e add r10, r31 13524: b1 1c adc r11, r1 13526: 24 e0 ldi r18, 0x04 ; 4 13528: c2 0e add r12, r18 1352a: d1 1c adc r13, r1 1352c: 34 e0 ldi r19, 0x04 ; 4 1352e: e3 0e add r14, r19 13530: 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) 13532: 60 16 cp r6, r16 13534: 71 06 cpc r7, r17 13536: f1 f6 brne .-68 ; 0x134f4 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 13538: 99 20 and r9, r9 1353a: 61 f0 breq .+24 ; 0x13554 current_position[E_AXIS] = values[E_AXIS]; 1353c: 8d 85 ldd r24, Y+13 ; 0x0d 1353e: 9e 85 ldd r25, Y+14 ; 0x0e 13540: af 85 ldd r26, Y+15 ; 0x0f 13542: b8 89 ldd r27, Y+16 ; 0x10 13544: 80 93 6d 12 sts 0x126D, r24 ; 0x80126d 13548: 90 93 6e 12 sts 0x126E, r25 ; 0x80126e 1354c: a0 93 6f 12 sts 0x126F, r26 ; 0x80126f 13550: b0 93 70 12 sts 0x1270, r27 ; 0x801270 // Set all at once plan_set_position_curposXYZE(); 13554: 0f 94 ca 48 call 0x29194 ; 0x29194 13558: 0c 94 54 91 jmp 0x122a8 ; 0x122a8 return true; } void farm_gcode_g98() { farm_mode = 1; 1355c: 81 e0 ldi r24, 0x01 ; 1 1355e: 80 93 60 0d sts 0x0D60, r24 ; 0x800d60 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 13562: 61 e0 ldi r22, 0x01 ; 1 13564: 84 ec ldi r24, 0xC4 ; 196 13566: 9f e0 ldi r25, 0x0F ; 15 13568: 0f 94 c1 a3 call 0x34782 ; 0x34782 eeprom_update_byte_notify((unsigned char *)EEPROM_FARM_MODE, farm_mode); SilentModeMenu = SILENT_MODE_OFF; 1356c: 10 92 bb 03 sts 0x03BB, r1 ; 0x8003bb 13570: 60 e0 ldi r22, 0x00 ; 0 13572: 8f ef ldi r24, 0xFF ; 255 13574: 9f e0 ldi r25, 0x0F ; 15 13576: 0f 94 c1 a3 call 0x34782 ; 0x34782 } void farm_gcode_g99() { farm_disable(); lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset 1357a: 0e 94 4f d7 call 0x1ae9e ; 0x1ae9e 1357e: 0c 94 54 91 jmp 0x122a8 ; 0x122a8 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 13582: 8d 34 cpi r24, 0x4D ; 77 13584: 11 f0 breq .+4 ; 0x1358a 13586: 0c 94 0e b9 jmp 0x1721c ; 0x1721c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 1358a: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 1358e: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb 13592: f8 01 movw r30, r16 13594: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 13596: 81 91 ld r24, Z+ 13598: 80 32 cpi r24, 0x20 ; 32 1359a: e9 f3 breq .-6 ; 0x13596 1359c: 89 30 cpi r24, 0x09 ; 9 1359e: d9 f3 breq .-10 ; 0x13596 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 135a0: 80 53 subi r24, 0x30 ; 48 135a2: 8a 30 cpi r24, 0x0A ; 10 135a4: 30 f0 brcs .+12 ; 0x135b2 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 135a6: 1f 93 push r17 135a8: 0f 93 push r16 135aa: 85 e9 ldi r24, 0x95 ; 149 135ac: 90 e8 ldi r25, 0x80 ; 128 135ae: 0c 94 0c 8e jmp 0x11c18 ; 0x11c18 } else { mcode_in_progress = code_value_short(); 135b2: 0e 94 17 56 call 0xac2e ; 0xac2e 135b6: 90 93 41 0d sts 0x0D41, r25 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.489+0x1> 135ba: 80 93 40 0d sts 0x0D40, r24 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.489> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 135be: 8e 3b cpi r24, 0xBE ; 190 135c0: 91 05 cpc r25, r1 135c2: 11 f4 brne .+4 ; 0x135c8 135c4: 0c 94 ff a5 jmp 0x14bfe ; 0x14bfe 135c8: 0c f0 brlt .+2 ; 0x135cc 135ca: 31 c3 rjmp .+1634 ; 0x13c2e 135cc: 8c 34 cpi r24, 0x4C ; 76 135ce: 91 05 cpc r25, r1 135d0: 11 f4 brne .+4 ; 0x135d6 135d2: 0c 94 e8 a4 jmp 0x149d0 ; 0x149d0 135d6: 0c f0 brlt .+2 ; 0x135da 135d8: df c1 rjmp .+958 ; 0x13998 135da: 8c 31 cpi r24, 0x1C ; 28 135dc: 91 05 cpc r25, r1 135de: 11 f4 brne .+4 ; 0x135e4 135e0: 0c 94 1f a3 jmp 0x1463e ; 0x1463e 135e4: 0c f0 brlt .+2 ; 0x135e8 135e6: f4 c0 rjmp .+488 ; 0x137d0 135e8: 85 31 cpi r24, 0x15 ; 21 135ea: 91 05 cpc r25, r1 135ec: 09 f4 brne .+2 ; 0x135f0 135ee: 40 c7 rjmp .+3712 ; 0x14470 135f0: 0c f0 brlt .+2 ; 0x135f4 135f2: 5a c0 rjmp .+180 ; 0x136a8 135f4: 81 31 cpi r24, 0x11 ; 17 135f6: 91 05 cpc r25, r1 135f8: 09 f4 brne .+2 ; 0x135fc 135fa: 2f c7 rjmp .+3678 ; 0x1445a 135fc: dc f4 brge .+54 ; 0x13634 135fe: 02 97 sbiw r24, 0x02 ; 2 13600: 08 f4 brcc .+2 ; 0x13604 13602: 93 c6 rjmp .+3366 ; 0x1432a /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 13604: 80 91 38 12 lds r24, 0x1238 ; 0x801238 13608: 90 91 39 12 lds r25, 0x1239 ; 0x801239 1360c: 82 5b subi r24, 0xB2 ; 178 1360e: 9f 4e sbci r25, 0xEF ; 239 13610: 9f 93 push r25 13612: 8f 93 push r24 13614: 1f 92 push r1 13616: 8d e4 ldi r24, 0x4D ; 77 13618: 8f 93 push r24 1361a: 88 e5 ldi r24, 0x58 ; 88 1361c: 96 e6 ldi r25, 0x66 ; 102 1361e: 9f 93 push r25 13620: 8f 93 push r24 13622: 0f 94 5f a2 call 0x344be ; 0x344be 13626: 0f 90 pop r0 13628: 0f 90 pop r0 1362a: 0f 90 pop r0 1362c: 0f 90 pop r0 1362e: 0f 90 pop r0 13630: 0f 90 pop r0 13632: de c6 rjmp .+3516 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13634: 82 31 cpi r24, 0x12 ; 18 13636: 91 05 cpc r25, r1 13638: 11 f4 brne .+4 ; 0x1363e 1363a: 0c 94 aa a6 jmp 0x14d54 ; 0x14d54 1363e: 44 97 sbiw r24, 0x14 ; 20 13640: 09 f7 brne .-62 ; 0x13604 #### 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() 13642: 81 e0 ldi r24, 0x01 ; 1 13644: 80 93 78 02 sts 0x0278, r24 ; 0x800278 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 13648: 88 e4 ldi r24, 0x48 ; 72 1364a: 96 e6 ldi r25, 0x66 ; 102 1364c: 0e 94 8d 7c call 0xf91a ; 0xf91a card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 13650: 84 e5 ldi r24, 0x54 ; 84 13652: 0e 94 f5 55 call 0xabea ; 0xabea 13656: 18 2f mov r17, r24 13658: 8c e4 ldi r24, 0x4C ; 76 1365a: 0e 94 f5 55 call 0xabea ; 0xabea 1365e: 00 e0 ldi r16, 0x00 ; 0 13660: 80 fb bst r24, 0 13662: 00 f9 bld r16, 0 13664: 10 fb bst r17, 0 13666: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 13668: 8d e5 ldi r24, 0x5D ; 93 1366a: 94 e1 ldi r25, 0x14 ; 20 1366c: 0e 94 76 79 call 0xf2ec ; 0xf2ec lsDive("",root, NULL, LS_SerialPrint, params); 13670: 83 e2 ldi r24, 0x23 ; 35 13672: ed e5 ldi r30, 0x5D ; 93 13674: f4 e1 ldi r31, 0x14 ; 20 13676: de 01 movw r26, r28 13678: 11 96 adiw r26, 0x01 ; 1 1367a: 01 90 ld r0, Z+ 1367c: 0d 92 st X+, r0 1367e: 8a 95 dec r24 13680: e1 f7 brne .-8 ; 0x1367a 13682: 20 e0 ldi r18, 0x00 ; 0 13684: 50 e0 ldi r21, 0x00 ; 0 13686: 40 e0 ldi r20, 0x00 ; 0 13688: be 01 movw r22, r28 1368a: 6f 5f subi r22, 0xFF ; 255 1368c: 7f 4f sbci r23, 0xFF ; 255 1368e: 8f ed ldi r24, 0xDF ; 223 13690: 92 e0 ldi r25, 0x02 ; 2 13692: 0f 94 5b 69 call 0x2d2b6 ; 0x2d2b6 13696: ce 01 movw r24, r28 13698: 01 96 adiw r24, 0x01 ; 1 1369a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 1369e: 8a e3 ldi r24, 0x3A ; 58 136a0: 96 e6 ldi r25, 0x66 ; 102 136a2: 0e 94 8d 7c call 0xf91a ; 0xf91a 136a6: a4 c6 rjmp .+3400 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 136a8: 88 31 cpi r24, 0x18 ; 24 136aa: 91 05 cpc r25, r1 136ac: 09 f4 brne .+2 ; 0x136b0 136ae: f1 c6 rjmp .+3554 ; 0x14492 136b0: 84 f4 brge .+32 ; 0x136d2 136b2: 86 31 cpi r24, 0x16 ; 22 136b4: 91 05 cpc r25, r1 136b6: 09 f4 brne .+2 ; 0x136ba 136b8: df c6 rjmp .+3518 ; 0x14478 136ba: 47 97 sbiw r24, 0x17 ; 23 136bc: 09 f0 breq .+2 ; 0x136c0 136be: a2 cf rjmp .-188 ; 0x13604 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 136c0: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 136c4: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 136c8: 61 e0 ldi r22, 0x01 ; 1 136ca: 04 96 adiw r24, 0x04 ; 4 136cc: 0f 94 b0 71 call 0x2e360 ; 0x2e360 136d0: 8f c6 rjmp .+3358 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 136d2: 8a 31 cpi r24, 0x1A ; 26 136d4: 91 05 cpc r25, r1 136d6: 09 f4 brne .+2 ; 0x136da 136d8: 22 c7 rjmp .+3652 ; 0x1451e 136da: 0c f0 brlt .+2 ; 0x136de 136dc: 42 c7 rjmp .+3716 ; 0x14562 136de: 04 ec ldi r16, 0xC4 ; 196 136e0: 12 e0 ldi r17, 0x02 ; 2 136e2: f2 e4 ldi r31, 0x42 ; 66 136e4: af 2e mov r10, r31 136e6: f2 e0 ldi r31, 0x02 ; 2 136e8: bf 2e mov r11, r31 136ea: a4 e2 ldi r26, 0x24 ; 36 136ec: ca 2e mov r12, r26 136ee: a2 e0 ldi r26, 0x02 ; 2 136f0: da 2e mov r13, r26 136f2: b8 e1 ldi r27, 0x18 ; 24 136f4: eb 2e mov r14, r27 136f6: b2 e0 ldi r27, 0x02 ; 2 136f8: fb 2e mov r15, r27 136fa: 87 ec ldi r24, 0xC7 ; 199 136fc: 88 2e mov r8, r24 136fe: 82 e0 ldi r24, 0x02 ; 2 13700: 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])) { 13702: f8 01 movw r30, r16 13704: 81 91 ld r24, Z+ 13706: 8f 01 movw r16, r30 13708: 0e 94 f5 55 call 0xabea ; 0xabea 1370c: 88 23 and r24, r24 1370e: 21 f1 breq .+72 ; 0x13758 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 13710: 0e 94 85 5a call 0xb50a ; 0xb50a 13714: d6 01 movw r26, r12 13716: 4d 90 ld r4, X+ 13718: 5d 90 ld r5, X+ 1371a: 6d 90 ld r6, X+ 1371c: 7c 90 ld r7, X 1371e: a3 01 movw r20, r6 13720: 92 01 movw r18, r4 13722: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 13726: 87 fd sbrc r24, 7 13728: 11 c0 rjmp .+34 ; 0x1374c 1372a: 0e 94 85 5a call 0xb50a ; 0xb50a 1372e: f7 01 movw r30, r14 13730: 40 80 ld r4, Z 13732: 51 80 ldd r5, Z+1 ; 0x01 13734: 62 80 ldd r6, Z+2 ; 0x02 13736: 73 80 ldd r7, Z+3 ; 0x03 13738: a3 01 movw r20, r6 1373a: 92 01 movw r18, r4 1373c: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 13740: 18 16 cp r1, r24 13742: 24 f0 brlt .+8 ; 0x1374c 13744: 0e 94 85 5a call 0xb50a ; 0xb50a 13748: 2b 01 movw r4, r22 1374a: 3c 01 movw r6, r24 1374c: d5 01 movw r26, r10 1374e: 4d 92 st X+, r4 13750: 5d 92 st X+, r5 13752: 6d 92 st X+, r6 13754: 7c 92 st X, r7 13756: 13 97 sbiw r26, 0x03 ; 3 13758: b4 e0 ldi r27, 0x04 ; 4 1375a: ab 0e add r10, r27 1375c: b1 1c adc r11, r1 1375e: e4 e0 ldi r30, 0x04 ; 4 13760: ce 0e add r12, r30 13762: d1 1c adc r13, r1 13764: f4 e0 ldi r31, 0x04 ; 4 13766: ef 0e add r14, r31 13768: 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++) { 1376a: 80 16 cp r8, r16 1376c: 91 06 cpc r9, r17 1376e: 49 f6 brne .-110 ; 0x13702 //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')) { 13770: 83 e5 ldi r24, 0x53 ; 83 13772: 0e 94 f5 55 call 0xabea ; 0xabea 13776: 88 23 and r24, r24 13778: 11 f4 brne .+4 ; 0x1377e 1377a: 0c 94 e9 b2 jmp 0x165d2 ; 0x165d2 if ( code_value_uint8() == 0 ) { 1377e: 0e 94 0a 56 call 0xac14 ; 0xac14 13782: 81 11 cpse r24, r1 13784: 35 c6 rjmp .+3178 ; 0x143f0 pause_position[X_AXIS] = X_PAUSE_POS; 13786: 80 e0 ldi r24, 0x00 ; 0 13788: 90 e0 ldi r25, 0x00 ; 0 1378a: a8 e4 ldi r26, 0x48 ; 72 1378c: b2 e4 ldi r27, 0x42 ; 66 1378e: 80 93 42 02 sts 0x0242, r24 ; 0x800242 <_ZL14pause_position.lto_priv.491> 13792: 90 93 43 02 sts 0x0243, r25 ; 0x800243 <_ZL14pause_position.lto_priv.491+0x1> 13796: a0 93 44 02 sts 0x0244, r26 ; 0x800244 <_ZL14pause_position.lto_priv.491+0x2> 1379a: b0 93 45 02 sts 0x0245, r27 ; 0x800245 <_ZL14pause_position.lto_priv.491+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 1379e: 80 e0 ldi r24, 0x00 ; 0 137a0: 90 e0 ldi r25, 0x00 ; 0 137a2: ae e3 ldi r26, 0x3E ; 62 137a4: b3 e4 ldi r27, 0x43 ; 67 137a6: 80 93 46 02 sts 0x0246, r24 ; 0x800246 <_ZL14pause_position.lto_priv.491+0x4> 137aa: 90 93 47 02 sts 0x0247, r25 ; 0x800247 <_ZL14pause_position.lto_priv.491+0x5> 137ae: a0 93 48 02 sts 0x0248, r26 ; 0x800248 <_ZL14pause_position.lto_priv.491+0x6> 137b2: b0 93 49 02 sts 0x0249, r27 ; 0x800249 <_ZL14pause_position.lto_priv.491+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 137b6: 80 e0 ldi r24, 0x00 ; 0 137b8: 90 e0 ldi r25, 0x00 ; 0 137ba: a0 ea ldi r26, 0xA0 ; 160 137bc: b1 e4 ldi r27, 0x41 ; 65 137be: 80 93 4a 02 sts 0x024A, r24 ; 0x80024a <_ZL14pause_position.lto_priv.491+0x8> 137c2: 90 93 4b 02 sts 0x024B, r25 ; 0x80024b <_ZL14pause_position.lto_priv.491+0x9> 137c6: a0 93 4c 02 sts 0x024C, r26 ; 0x80024c <_ZL14pause_position.lto_priv.491+0xa> 137ca: b0 93 4d 02 sts 0x024D, r27 ; 0x80024d <_ZL14pause_position.lto_priv.491+0xb> 137ce: 10 c6 rjmp .+3104 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 137d0: 8c 32 cpi r24, 0x2C ; 44 137d2: 91 05 cpc r25, r1 137d4: 11 f4 brne .+4 ; 0x137da 137d6: 0c 94 f0 a3 jmp 0x147e0 ; 0x147e0 137da: 0c f0 brlt .+2 ; 0x137de 137dc: 8f c0 rjmp .+286 ; 0x138fc 137de: 8f 31 cpi r24, 0x1F ; 31 137e0: 91 05 cpc r25, r1 137e2: 09 f4 brne .+2 ; 0x137e6 137e4: d3 c7 rjmp .+4006 ; 0x1478c 137e6: 0c f0 brlt .+2 ; 0x137ea 137e8: 52 c0 rjmp .+164 ; 0x1388e 137ea: 8d 31 cpi r24, 0x1D ; 29 137ec: 91 05 cpc r25, r1 137ee: 09 f4 brne .+2 ; 0x137f2 137f0: ff c5 rjmp .+3070 ; 0x143f0 137f2: 4e 97 sbiw r24, 0x1e ; 30 137f4: 09 f0 breq .+2 ; 0x137f8 137f6: 06 cf rjmp .-500 ; 0x13604 M30 [filename] */ case 30: if (card.mounted){ 137f8: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 137fc: 88 23 and r24, r24 137fe: 09 f4 brne .+2 ; 0x13802 13800: f7 c5 rjmp .+3054 ; 0x143f0 card.closefile(); 13802: 0f 94 d1 65 call 0x2cba2 ; 0x2cba2 card.removeFile(strchr_pointer + 4); 13806: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 1380a: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 1380e: 0c 5f subi r16, 0xFC ; 252 13810: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 13812: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 13816: 88 23 and r24, r24 13818: 09 f4 brne .+2 ; 0x1381c 1381a: ea c5 rjmp .+3028 ; 0x143f0 file.close(); 1381c: 87 e6 ldi r24, 0x67 ; 103 1381e: 96 e1 ldi r25, 0x16 ; 22 13820: 0f 94 72 2c call 0x258e4 ; 0x258e4 sdprinting = false; 13824: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 13828: 1d a3 std Y+37, r17 ; 0x25 1382a: 0c a3 std Y+36, r16 ; 0x24 if (!diveSubfolder(fname)) 1382c: ce 01 movw r24, r28 1382e: 84 96 adiw r24, 0x24 ; 36 13830: 0f 94 2b 71 call 0x2e256 ; 0x2e256 13834: 88 23 and r24, r24 13836: 09 f4 brne .+2 ; 0x1383a 13838: db c5 rjmp .+2998 ; 0x143f0 return; if (file.remove(curDir, fname)) 1383a: 4c a1 ldd r20, Y+36 ; 0x24 1383c: 5d a1 ldd r21, Y+37 ; 0x25 1383e: 60 91 80 14 lds r22, 0x1480 ; 0x801480 13842: 70 91 81 14 lds r23, 0x1481 ; 0x801481 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 13846: 19 82 std Y+1, r1 ; 0x01 13848: 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; 1384a: 22 e0 ldi r18, 0x02 ; 2 1384c: ce 01 movw r24, r28 1384e: 01 96 adiw r24, 0x01 ; 1 13850: 0f 94 9d 54 call 0x2a93a ; 0x2a93a 13854: 81 11 cpse r24, r1 13856: fb c6 rjmp .+3574 ; 0x1464e return file.remove(); fail: // can't set iostate - static function return false; 13858: 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; 1385a: ce 01 movw r24, r28 1385c: 01 96 adiw r24, 0x01 ; 1 1385e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 13862: 11 23 and r17, r17 13864: 09 f4 brne .+2 ; 0x13868 13866: 0a c7 rjmp .+3604 ; 0x1467c { SERIAL_PROTOCOLPGM("File deleted:"); 13868: 8c e1 ldi r24, 0x1C ; 28 1386a: 9e e7 ldi r25, 0x7E ; 126 1386c: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLLN(fname); 13870: 8c a1 ldd r24, Y+36 ; 0x24 13872: 9d a1 ldd r25, Y+37 ; 0x25 13874: 0e 94 92 85 call 0x10b24 ; 0x10b24 sdpos = 0; 13878: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 1387c: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 13880: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 13884: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee #ifdef SDCARD_SORT_ALPHA presort(); 13888: 0f 94 ef 6e call 0x2ddde ; 0x2ddde 1388c: b1 c5 rjmp .+2914 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1388e: 80 32 cpi r24, 0x20 ; 32 13890: 91 05 cpc r25, r1 13892: 09 f4 brne .+2 ; 0x13896 13894: 01 c7 rjmp .+3586 ; 0x14698 13896: 8a 97 sbiw r24, 0x2a ; 42 13898: 09 f0 breq .+2 ; 0x1389c 1389a: b4 ce rjmp .-664 ; 0x13604 #### 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')) 1389c: 83 e5 ldi r24, 0x53 ; 83 1389e: 0e 94 f5 55 call 0xabea ; 0xabea 138a2: 88 23 and r24, r24 138a4: 09 f4 brne .+2 ; 0x138a8 138a6: a4 c5 rjmp .+2888 ; 0x143f0 { uint8_t pin_status = code_value_uint8(); 138a8: 0e 94 0a 56 call 0xac14 ; 0xac14 138ac: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 138ae: 80 e5 ldi r24, 0x50 ; 80 138b0: 0e 94 f5 55 call 0xabea ; 0xabea */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 138b4: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 138b6: 88 23 and r24, r24 138b8: 19 f0 breq .+6 ; 0x138c0 pin_number = code_value_uint8(); 138ba: 0e 94 0a 56 call 0xac14 ; 0xac14 138be: 18 2f mov r17, r24 138c0: ea e6 ldi r30, 0x6A ; 106 138c2: f0 e8 ldi r31, 0x80 ; 128 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) 138c4: 84 91 lpm r24, Z 138c6: 81 17 cp r24, r17 138c8: 09 f4 brne .+2 ; 0x138cc 138ca: 92 c5 rjmp .+2852 ; 0x143f0 138cc: 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++) 138ce: 30 e8 ldi r19, 0x80 ; 128 138d0: e6 38 cpi r30, 0x86 ; 134 138d2: f3 07 cpc r31, r19 138d4: b9 f7 brne .-18 ; 0x138c4 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 138d6: 16 30 cpi r17, 0x06 ; 6 138d8: 09 f0 breq .+2 ; 0x138dc 138da: 7f c7 rjmp .+3838 ; 0x147da fanSpeed = pin_status; 138dc: 00 93 55 12 sts 0x1255, r16 ; 0x801255 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 138e0: 61 e0 ldi r22, 0x01 ; 1 138e2: 81 2f mov r24, r17 138e4: 0e 94 2e d1 call 0x1a25c ; 0x1a25c digitalWrite(pin_number, pin_status); 138e8: 60 2f mov r22, r16 138ea: 81 2f mov r24, r17 138ec: 0e 94 00 d1 call 0x1a200 ; 0x1a200 analogWrite(pin_number, pin_status); 138f0: 60 2f mov r22, r16 138f2: 70 e0 ldi r23, 0x00 ; 0 138f4: 81 2f mov r24, r17 138f6: 0e 94 5f d1 call 0x1a2be ; 0x1a2be 138fa: 7a c5 rjmp .+2804 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 138fc: 8f 32 cpi r24, 0x2F ; 47 138fe: 91 05 cpc r25, r1 13900: 09 f4 brne .+2 ; 0x13904 13902: 97 c7 rjmp .+3886 ; 0x14832 13904: 5c f5 brge .+86 ; 0x1395c 13906: 8d 32 cpi r24, 0x2D ; 45 13908: 91 05 cpc r25, r1 1390a: 09 f4 brne .+2 ; 0x1390e 1390c: 82 c7 rjmp .+3844 ; 0x14812 1390e: 8e 97 sbiw r24, 0x2e ; 46 13910: 09 f0 breq .+2 ; 0x13914 13912: 78 ce rjmp .-784 ; 0x13604 ### 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()) { 13914: 80 91 48 16 lds r24, 0x1648 ; 0x801648 13918: 88 23 and r24, r24 1391a: 09 f4 brne .+2 ; 0x1391e 1391c: 85 c7 rjmp .+3850 ; 0x14828 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 1391e: ce 01 movw r24, r28 13920: 01 96 adiw r24, 0x01 ; 1 13922: 0f 94 34 78 call 0x2f068 ; 0x2f068 13926: 88 23 and r24, r24 13928: 09 f4 brne .+2 ; 0x1392c 1392a: 79 c7 rjmp .+3826 ; 0x1481e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1392c: 89 81 ldd r24, Y+1 ; 0x01 1392e: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13932: 8e e2 ldi r24, 0x2E ; 46 13934: 0e 94 81 79 call 0xf302 ; 0xf302 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13938: 8a 81 ldd r24, Y+2 ; 0x02 1393a: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1393e: 8e e2 ldi r24, 0x2E ; 46 13940: 0e 94 81 79 call 0xf302 ; 0xf302 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13944: 8b 81 ldd r24, Y+3 ; 0x03 13946: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1394a: 8e e2 ldi r24, 0x2E ; 46 1394c: 0e 94 81 79 call 0xf302 ; 0xf302 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13950: 8c 81 ldd r24, Y+4 ; 0x04 13952: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 13956: 0e 94 8c 7a call 0xf518 ; 0xf518 1395a: 4a c5 rjmp .+2708 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1395c: 89 34 cpi r24, 0x49 ; 73 1395e: 91 05 cpc r25, r1 13960: 09 f4 brne .+2 ; 0x13964 13962: 90 c7 rjmp .+3872 ; 0x14884 13964: 8b 34 cpi r24, 0x4B ; 75 13966: 91 05 cpc r25, r1 13968: 11 f4 brne .+4 ; 0x1396e 1396a: 0c 94 e2 a4 jmp 0x149c4 ; 0x149c4 1396e: 88 34 cpi r24, 0x48 ; 72 13970: 91 05 cpc r25, r1 13972: 09 f0 breq .+2 ; 0x13976 13974: 47 ce rjmp .-882 ; 0x13604 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 13976: 83 e5 ldi r24, 0x53 ; 83 13978: 0e 94 f5 55 call 0xabea ; 0xabea 1397c: 88 23 and r24, r24 1397e: 09 f4 brne .+2 ; 0x13982 13980: 72 c7 rjmp .+3812 ; 0x14866 switch (code_value_uint8()){ 13982: 0e 94 0a 56 call 0xac14 ; 0xac14 13986: 88 23 and r24, r24 13988: 09 f4 brne .+2 ; 0x1398c 1398a: 6a c7 rjmp .+3796 ; 0x14860 1398c: 81 30 cpi r24, 0x01 ; 1 1398e: 09 f0 breq .+2 ; 0x13992 13990: 2f c5 rjmp .+2654 ; 0x143f0 13992: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 13996: 2c c5 rjmp .+2648 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13998: 8b 36 cpi r24, 0x6B ; 107 1399a: 91 05 cpc r25, r1 1399c: 11 f4 brne .+4 ; 0x139a2 1399e: 0c 94 a1 a6 jmp 0x14d42 ; 0x14d42 139a2: 0c f0 brlt .+2 ; 0x139a6 139a4: ab c0 rjmp .+342 ; 0x13afc 139a6: 84 35 cpi r24, 0x54 ; 84 139a8: 91 05 cpc r25, r1 139aa: 11 f4 brne .+4 ; 0x139b0 139ac: 0c 94 aa a6 jmp 0x14d54 ; 0x14d54 139b0: 0c f0 brlt .+2 ; 0x139b4 139b2: 5d c0 rjmp .+186 ; 0x13a6e 139b4: 8f 34 cpi r24, 0x4F ; 79 139b6: 91 05 cpc r25, r1 139b8: 11 f4 brne .+4 ; 0x139be 139ba: 0c 94 30 a5 jmp 0x14a60 ; 0x14a60 139be: 0c f0 brlt .+2 ; 0x139c2 139c0: 47 c0 rjmp .+142 ; 0x13a50 139c2: 8d 34 cpi r24, 0x4D ; 77 139c4: 91 05 cpc r25, r1 139c6: 11 f4 brne .+4 ; 0x139cc 139c8: 0c 94 fb a4 jmp 0x149f6 ; 0x149f6 139cc: 8e 34 cpi r24, 0x4E ; 78 139ce: 91 05 cpc r25, r1 139d0: 09 f0 breq .+2 ; 0x139d4 139d2: 18 ce rjmp .-976 ; 0x13604 const char *_m_fil; const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { 139d4: 0e 94 10 66 call 0xcc20 ; 0xcc20 139d8: 88 23 and r24, r24 139da: 11 f4 brne .+4 ; 0x139e0 139dc: 0c 94 00 a5 jmp 0x14a00 ; 0x14a00 _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; 139e0: 60 91 17 06 lds r22, 0x0617 ; 0x800617 139e4: 70 91 18 06 lds r23, 0x0618 ; 0x800618 139e8: 80 91 19 06 lds r24, 0x0619 ; 0x800619 139ec: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 139f0: 28 ee ldi r18, 0xE8 ; 232 139f2: 33 e0 ldi r19, 0x03 ; 3 139f4: 40 e0 ldi r20, 0x00 ; 0 139f6: 50 e0 ldi r21, 0x00 ; 0 139f8: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 139fc: 12 2f mov r17, r18 139fe: 03 2f mov r16, r19 13a00: f4 2e mov r15, r20 13a02: e5 2e mov r14, r21 _min = print_job_timer.duration() / 60; 13a04: 0f 94 22 15 call 0x22a44 ; 0x22a44 13a08: 2c e3 ldi r18, 0x3C ; 60 13a0a: 30 e0 ldi r19, 0x00 ; 0 13a0c: 40 e0 ldi r20, 0x00 ; 0 13a0e: 50 e0 ldi r21, 0x00 ; 0 13a10: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 13a14: b9 01 movw r22, r18 13a16: 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); 13a18: 41 ed ldi r20, 0xD1 ; 209 13a1a: 58 e5 ldi r21, 0x58 ; 88 const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { _m_fil = _O(MSG_FILAMENT_USED); 13a1c: 21 ec ldi r18, 0xC1 ; 193 13a1e: 38 e5 ldi r19, 0x58 ; 88 _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); 13a20: 9f 93 push r25 13a22: 8f 93 push r24 13a24: 7f 93 push r23 13a26: 6f 93 push r22 13a28: 5f 93 push r21 13a2a: 4f 93 push r20 13a2c: ef 92 push r14 13a2e: ff 92 push r15 13a30: 0f 93 push r16 13a32: 1f 93 push r17 13a34: 3f 93 push r19 13a36: 2f 93 push r18 13a38: 81 eb ldi r24, 0xB1 ; 177 13a3a: 95 e6 ldi r25, 0x65 ; 101 13a3c: 9f 93 push r25 13a3e: 8f 93 push r24 13a40: 0f 94 5f a2 call 0x344be ; 0x344be 13a44: 0f b6 in r0, 0x3f ; 63 13a46: f8 94 cli 13a48: de bf out 0x3e, r29 ; 62 13a4a: 0f be out 0x3f, r0 ; 63 13a4c: cd bf out 0x3d, r28 ; 61 13a4e: d0 c4 rjmp .+2464 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13a50: 82 35 cpi r24, 0x52 ; 82 13a52: 91 05 cpc r25, r1 13a54: 11 f4 brne .+4 ; 0x13a5a 13a56: 0c 94 a4 a6 jmp 0x14d48 ; 0x14d48 13a5a: 83 35 cpi r24, 0x53 ; 83 13a5c: 91 05 cpc r25, r1 13a5e: 09 f0 breq .+2 ; 0x13a62 13a60: d1 cd rjmp .-1118 ; 0x13604 /*! ### 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; 13a62: 80 91 57 12 lds r24, 0x1257 ; 0x801257 13a66: 88 60 ori r24, 0x08 ; 8 13a68: 80 93 57 12 sts 0x1257, r24 ; 0x801257 13a6c: c1 c4 rjmp .+2434 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13a6e: 8c 35 cpi r24, 0x5C ; 92 13a70: 91 05 cpc r25, r1 13a72: 11 f4 brne .+4 ; 0x13a78 13a74: 0c 94 13 a7 jmp 0x14e26 ; 0x14e26 13a78: 34 f5 brge .+76 ; 0x13ac6 13a7a: 85 35 cpi r24, 0x55 ; 85 13a7c: 91 05 cpc r25, r1 13a7e: 11 f4 brne .+4 ; 0x13a84 13a80: 0c 94 fa a6 jmp 0x14df4 ; 0x14df4 13a84: 86 35 cpi r24, 0x56 ; 86 13a86: 91 05 cpc r25, r1 13a88: 09 f0 breq .+2 ; 0x13a8c 13a8a: bc cd rjmp .-1160 ; 0x13604 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 13a8c: 83 e5 ldi r24, 0x53 ; 83 13a8e: 0e 94 f5 55 call 0xabea ; 0xabea 13a92: 88 23 and r24, r24 13a94: 09 f4 brne .+2 ; 0x13a98 13a96: ac c4 rjmp .+2392 ; 0x143f0 safetytimer_inactive_time = code_value() * 1000; 13a98: 0e 94 85 5a call 0xb50a ; 0xb50a 13a9c: 20 e0 ldi r18, 0x00 ; 0 13a9e: 30 e0 ldi r19, 0x00 ; 0 13aa0: 4a e7 ldi r20, 0x7A ; 122 13aa2: 54 e4 ldi r21, 0x44 ; 68 13aa4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 13aa8: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 13aac: 60 93 33 02 sts 0x0233, r22 ; 0x800233 13ab0: 70 93 34 02 sts 0x0234, r23 ; 0x800234 13ab4: 80 93 35 02 sts 0x0235, r24 ; 0x800235 13ab8: 90 93 36 02 sts 0x0236, r25 ; 0x800236 safetyTimer.start(); 13abc: 8d ea ldi r24, 0xAD ; 173 13abe: 95 e0 ldi r25, 0x05 ; 5 13ac0: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> 13ac4: 95 c4 rjmp .+2346 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13ac6: 89 36 cpi r24, 0x69 ; 105 13ac8: 91 05 cpc r25, r1 13aca: 11 f4 brne .+4 ; 0x13ad0 13acc: 0c 94 83 a5 jmp 0x14b06 ; 0x14b06 13ad0: 14 f0 brlt .+4 ; 0x13ad6 13ad2: 0c 94 93 a6 jmp 0x14d26 ; 0x14d26 13ad6: 88 36 cpi r24, 0x68 ; 104 13ad8: 91 05 cpc r25, r1 13ada: 09 f0 breq .+2 ; 0x13ade 13adc: 93 cd rjmp .-1242 ; 0x13604 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 13ade: 83 e5 ldi r24, 0x53 ; 83 13ae0: 0e 94 f5 55 call 0xabea ; 0xabea 13ae4: 88 23 and r24, r24 13ae6: 09 f4 brne .+2 ; 0x13aea 13ae8: 83 c4 rjmp .+2310 ; 0x143f0 { setTargetHotend(code_value()); 13aea: 0e 94 85 5a call 0xb50a ; 0xb50a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 13aee: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 13af2: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 13af6: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 13afa: 7a c4 rjmp .+2292 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13afc: 85 37 cpi r24, 0x75 ; 117 13afe: 91 05 cpc r25, r1 13b00: 11 f4 brne .+4 ; 0x13b06 13b02: 0c 94 93 a8 jmp 0x15126 ; 0x15126 13b06: bc f5 brge .+110 ; 0x13b76 13b08: 80 37 cpi r24, 0x70 ; 112 13b0a: 91 05 cpc r25, r1 13b0c: 09 f4 brne .+2 ; 0x13b10 13b0e: e8 c7 rjmp .+4048 ; 0x14ae0 13b10: d4 f4 brge .+52 ; 0x13b46 13b12: 8d 36 cpi r24, 0x6D ; 109 13b14: 91 05 cpc r25, r1 13b16: 11 f4 brne .+4 ; 0x13b1c 13b18: 0c 94 af a5 jmp 0x14b5e ; 0x14b5e 13b1c: 8e 36 cpi r24, 0x6E ; 110 13b1e: 91 05 cpc r25, r1 13b20: 09 f0 breq .+2 ; 0x13b24 13b22: 70 cd rjmp .-1312 ; 0x13604 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 13b24: 8e e4 ldi r24, 0x4E ; 78 13b26: 0e 94 f5 55 call 0xabea ; 0xabea 13b2a: 88 23 and r24, r24 13b2c: 09 f4 brne .+2 ; 0x13b30 13b2e: 60 c4 rjmp .+2240 ; 0x143f0 gcode_LastN = code_value_long(); 13b30: 0e 94 5d 56 call 0xacba ; 0xacba 13b34: 60 93 3e 12 sts 0x123E, r22 ; 0x80123e 13b38: 70 93 3f 12 sts 0x123F, r23 ; 0x80123f 13b3c: 80 93 40 12 sts 0x1240, r24 ; 0x801240 13b40: 90 93 41 12 sts 0x1241, r25 ; 0x801241 13b44: 55 c4 rjmp .+2218 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13b46: 82 37 cpi r24, 0x72 ; 114 13b48: 91 05 cpc r25, r1 13b4a: 11 f4 brne .+4 ; 0x13b50 13b4c: 0c 94 90 a8 jmp 0x15120 ; 0x15120 13b50: 14 f4 brge .+4 ; 0x13b56 13b52: 0c 94 9d a7 jmp 0x14f3a ; 0x14f3a 13b56: 83 37 cpi r24, 0x73 ; 115 13b58: 91 05 cpc r25, r1 13b5a: 09 f0 breq .+2 ; 0x13b5e 13b5c: 53 cd rjmp .-1370 ; 0x13604 #### 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')) { 13b5e: 86 e5 ldi r24, 0x56 ; 86 13b60: 0e 94 f5 55 call 0xabea ; 0xabea 13b64: 88 23 and r24, r24 13b66: 11 f4 brne .+4 ; 0x13b6c 13b68: 0c 94 bc a7 jmp 0x14f78 ; 0x14f78 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 13b6c: 8c ee ldi r24, 0xEC ; 236 13b6e: 98 e8 ldi r25, 0x88 ; 136 13b70: 0e 94 8d 7c call 0xf91a ; 0xf91a 13b74: 3d c4 rjmp .+2170 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13b76: 8b 37 cpi r24, 0x7B ; 123 13b78: 91 05 cpc r25, r1 13b7a: 11 f4 brne .+4 ; 0x13b80 13b7c: 0c 94 eb a8 jmp 0x151d6 ; 0x151d6 13b80: 0c f0 brlt .+2 ; 0x13b84 13b82: 48 c0 rjmp .+144 ; 0x13c14 13b84: 86 37 cpi r24, 0x76 ; 118 13b86: 91 05 cpc r25, r1 13b88: 11 f4 brne .+4 ; 0x13b8e 13b8a: 0c 94 a3 a8 jmp 0x15146 ; 0x15146 13b8e: 87 37 cpi r24, 0x77 ; 119 13b90: 91 05 cpc r25, r1 13b92: 09 f0 breq .+2 ; 0x13b96 13b94: 37 cd rjmp .-1426 ; 0x13604 /*! ### 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 13b96: 8e e5 ldi r24, 0x5E ; 94 13b98: 95 e6 ldi r25, 0x65 ; 101 13b9a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLLN(); 13b9e: 0e 94 8c 7a call 0xf518 ; 0xf518 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 13ba2: 86 e5 ldi r24, 0x56 ; 86 13ba4: 95 e6 ldi r25, 0x65 ; 101 13ba6: 0e 94 94 7a call 0xf528 ; 0xf528 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 13baa: 1e 9b sbis 0x03, 6 ; 3 13bac: 02 c0 rjmp .+4 ; 0x13bb2 13bae: 0c 94 db a8 jmp 0x151b6 ; 0x151b6 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13bb2: 81 e5 ldi r24, 0x51 ; 81 13bb4: 95 e6 ldi r25, 0x65 ; 101 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); 13bb6: 0e 94 94 7a call 0xf528 ; 0xf528 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13bba: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 13bbe: 8f e3 ldi r24, 0x3F ; 63 13bc0: 95 e6 ldi r25, 0x65 ; 101 13bc2: 0e 94 94 7a call 0xf528 ; 0xf528 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 13bc6: 1d 9b sbis 0x03, 5 ; 3 13bc8: 02 c0 rjmp .+4 ; 0x13bce 13bca: 0c 94 df a8 jmp 0x151be ; 0x151be SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13bce: 81 e5 ldi r24, 0x51 ; 81 13bd0: 95 e6 ldi r25, 0x65 ; 101 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); 13bd2: 0e 94 94 7a call 0xf528 ; 0xf528 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13bd6: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 13bda: 87 e3 ldi r24, 0x37 ; 55 13bdc: 95 e6 ldi r25, 0x65 ; 101 13bde: 0e 94 94 7a call 0xf528 ; 0xf528 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 13be2: 1c 9b sbis 0x03, 4 ; 3 13be4: 02 c0 rjmp .+4 ; 0x13bea 13be6: 0c 94 e3 a8 jmp 0x151c6 ; 0x151c6 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13bea: 81 e5 ldi r24, 0x51 ; 81 13bec: 95 e6 ldi r25, 0x65 ; 101 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); 13bee: 0e 94 94 7a call 0xf528 ; 0xf528 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13bf2: 0e 94 8c 7a call 0xf518 ; 0xf518 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 13bf6: 8f e2 ldi r24, 0x2F ; 47 13bf8: 95 e6 ldi r25, 0x65 ; 101 13bfa: 0e 94 94 7a call 0xf528 ; 0xf528 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 13bfe: 01 99 sbic 0x00, 1 ; 0 13c00: 02 c0 rjmp .+4 ; 0x13c06 13c02: 0c 94 e7 a8 jmp 0x151ce ; 0x151ce SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13c06: 81 e5 ldi r24, 0x51 ; 81 13c08: 95 e6 ldi r25, 0x65 ; 101 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); 13c0a: 0e 94 94 7a call 0xf528 ; 0xf528 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13c0e: 0e 94 8c 7a call 0xf518 ; 0xf518 13c12: ee c3 rjmp .+2012 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13c14: 8c 38 cpi r24, 0x8C ; 140 13c16: 91 05 cpc r25, r1 13c18: 09 f4 brne .+2 ; 0x13c1c 13c1a: 66 c7 rjmp .+3788 ; 0x14ae8 13c1c: 8b 39 cpi r24, 0x9B ; 155 13c1e: 91 05 cpc r25, r1 13c20: 09 f4 brne .+2 ; 0x13c24 13c22: 7d c7 rjmp .+3834 ; 0x14b1e 13c24: 8d 37 cpi r24, 0x7D ; 125 13c26: 91 05 cpc r25, r1 13c28: 09 f0 breq .+2 ; 0x13c2c 13c2a: ec cc rjmp .-1576 ; 0x13604 13c2c: 58 cd rjmp .-1360 ; 0x136de 13c2e: 84 3a cpi r24, 0xA4 ; 164 13c30: 41 e0 ldi r20, 0x01 ; 1 13c32: 94 07 cpc r25, r20 13c34: 11 f4 brne .+4 ; 0x13c3a 13c36: 0c 94 0e ac jmp 0x1581c ; 0x1581c 13c3a: 0c f0 brlt .+2 ; 0x13c3e 13c3c: 44 c2 rjmp .+1160 ; 0x140c6 13c3e: 82 3e cpi r24, 0xE2 ; 226 13c40: 91 05 cpc r25, r1 13c42: 11 f4 brne .+4 ; 0x13c48 13c44: 0c 94 98 aa jmp 0x15530 ; 0x15530 13c48: 0c f0 brlt .+2 ; 0x13c4c 13c4a: 6b c1 rjmp .+726 ; 0x13f22 13c4c: 8e 3c cpi r24, 0xCE ; 206 13c4e: 91 05 cpc r25, r1 13c50: 11 f4 brne .+4 ; 0x13c56 13c52: 0c 94 a7 a9 jmp 0x1534e ; 0x1534e 13c56: 0c f0 brlt .+2 ; 0x13c5a 13c58: b1 c0 rjmp .+354 ; 0x13dbc 13c5a: 8b 3c cpi r24, 0xCB ; 203 13c5c: 91 05 cpc r25, r1 13c5e: 11 f4 brne .+4 ; 0x13c64 13c60: 0c 94 31 a9 jmp 0x15262 ; 0x15262 13c64: 5c f5 brge .+86 ; 0x13cbc 13c66: 88 3c cpi r24, 0xC8 ; 200 13c68: 91 05 cpc r25, r1 13c6a: 11 f4 brne .+4 ; 0x13c70 13c6c: 0c 94 ee a8 jmp 0x151dc ; 0x151dc 13c70: 89 3c cpi r24, 0xC9 ; 201 13c72: 91 05 cpc r25, r1 13c74: 09 f0 breq .+2 ; 0x13c78 13c76: c6 cc rjmp .-1652 ; 0x13604 13c78: 04 ec ldi r16, 0xC4 ; 196 13c7a: 12 e0 ldi r17, 0x02 ; 2 13c7c: b7 e6 ldi r27, 0x67 ; 103 13c7e: eb 2e mov r14, r27 13c80: bd e0 ldi r27, 0x0D ; 13 13c82: fb 2e mov r15, r27 13c84: 88 ec ldi r24, 0xC8 ; 200 13c86: c8 2e mov r12, r24 13c88: 82 e0 ldi r24, 0x02 ; 2 13c8a: d8 2e mov r13, r24 - `E` - Acceleration for the active or specified extruder in units/s^2 */ case 201: for (int8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) 13c8c: d8 01 movw r26, r16 13c8e: 8d 91 ld r24, X+ 13c90: 8d 01 movw r16, r26 13c92: 0e 94 f5 55 call 0xabea ; 0xabea 13c96: 88 23 and r24, r24 13c98: 49 f0 breq .+18 ; 0x13cac { unsigned long val = code_value(); 13c9a: 0e 94 85 5a call 0xb50a ; 0xb50a 13c9e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 13ca2: f7 01 movw r30, r14 13ca4: 64 a3 std Z+36, r22 ; 0x24 13ca6: 75 a3 std Z+37, r23 ; 0x25 13ca8: 86 a3 std Z+38, r24 ; 0x26 13caa: 97 a3 std Z+39, r25 ; 0x27 13cac: f4 e0 ldi r31, 0x04 ; 4 13cae: ef 0e add r14, r31 13cb0: f1 1c adc r15, r1 - `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++) 13cb2: c0 16 cp r12, r16 13cb4: d1 06 cpc r13, r17 13cb6: 51 f7 brne .-44 ; 0x13c8c 13cb8: 0c 94 92 a7 jmp 0x14f24 ; 0x14f24 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13cbc: 8c 3c cpi r24, 0xCC ; 204 13cbe: 91 05 cpc r25, r1 13cc0: 11 f4 brne .+4 ; 0x13cc6 13cc2: 0c 94 50 a9 jmp 0x152a0 ; 0x152a0 13cc6: 8d 3c cpi r24, 0xCD ; 205 13cc8: 91 05 cpc r25, r1 13cca: 09 f0 breq .+2 ; 0x13cce 13ccc: 9b cc rjmp .-1738 ; 0x13604 - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 13cce: 83 e5 ldi r24, 0x53 ; 83 13cd0: 0e 94 f5 55 call 0xabea ; 0xabea 13cd4: 88 23 and r24, r24 13cd6: 51 f0 breq .+20 ; 0x13cec 13cd8: 0e 94 85 5a call 0xb50a ; 0xb50a 13cdc: 60 93 a3 0d sts 0x0DA3, r22 ; 0x800da3 13ce0: 70 93 a4 0d sts 0x0DA4, r23 ; 0x800da4 13ce4: 80 93 a5 0d sts 0x0DA5, r24 ; 0x800da5 13ce8: 90 93 a6 0d sts 0x0DA6, r25 ; 0x800da6 if(code_seen('T')) cs.mintravelfeedrate = code_value(); 13cec: 84 e5 ldi r24, 0x54 ; 84 13cee: 0e 94 f5 55 call 0xabea ; 0xabea 13cf2: 88 23 and r24, r24 13cf4: 51 f0 breq .+20 ; 0x13d0a 13cf6: 0e 94 85 5a call 0xb50a ; 0xb50a 13cfa: 60 93 a7 0d sts 0x0DA7, r22 ; 0x800da7 13cfe: 70 93 a8 0d sts 0x0DA8, r23 ; 0x800da8 13d02: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 13d06: 90 93 aa 0d sts 0x0DAA, r25 ; 0x800daa if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 13d0a: 82 e4 ldi r24, 0x42 ; 66 13d0c: 0e 94 f5 55 call 0xabea ; 0xabea 13d10: 88 23 and r24, r24 13d12: 61 f0 breq .+24 ; 0x13d2c 13d14: 0e 94 85 5a call 0xb50a ; 0xb50a 13d18: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 13d1c: 60 93 ab 0d sts 0x0DAB, r22 ; 0x800dab 13d20: 70 93 ac 0d sts 0x0DAC, r23 ; 0x800dac 13d24: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad 13d28: 90 93 ae 0d sts 0x0DAE, r25 ; 0x800dae if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 13d2c: 88 e5 ldi r24, 0x58 ; 88 13d2e: 0e 94 f5 55 call 0xabea ; 0xabea 13d32: 88 23 and r24, r24 13d34: 91 f0 breq .+36 ; 0x13d5a 13d36: 0e 94 85 5a call 0xb50a ; 0xb50a 13d3a: 60 93 b3 0d sts 0x0DB3, r22 ; 0x800db3 13d3e: 70 93 b4 0d sts 0x0DB4, r23 ; 0x800db4 13d42: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 13d46: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 13d4a: 60 93 af 0d sts 0x0DAF, r22 ; 0x800daf 13d4e: 70 93 b0 0d sts 0x0DB0, r23 ; 0x800db0 13d52: 80 93 b1 0d sts 0x0DB1, r24 ; 0x800db1 13d56: 90 93 b2 0d sts 0x0DB2, r25 ; 0x800db2 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 13d5a: 89 e5 ldi r24, 0x59 ; 89 13d5c: 0e 94 f5 55 call 0xabea ; 0xabea 13d60: 88 23 and r24, r24 13d62: 51 f0 breq .+20 ; 0x13d78 13d64: 0e 94 85 5a call 0xb50a ; 0xb50a 13d68: 60 93 b3 0d sts 0x0DB3, r22 ; 0x800db3 13d6c: 70 93 b4 0d sts 0x0DB4, r23 ; 0x800db4 13d70: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 13d74: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 13d78: 8a e5 ldi r24, 0x5A ; 90 13d7a: 0e 94 f5 55 call 0xabea ; 0xabea 13d7e: 88 23 and r24, r24 13d80: 51 f0 breq .+20 ; 0x13d96 13d82: 0e 94 85 5a call 0xb50a ; 0xb50a 13d86: 60 93 b7 0d sts 0x0DB7, r22 ; 0x800db7 13d8a: 70 93 b8 0d sts 0x0DB8, r23 ; 0x800db8 13d8e: 80 93 b9 0d sts 0x0DB9, r24 ; 0x800db9 13d92: 90 93 ba 0d sts 0x0DBA, r25 ; 0x800dba if(code_seen('E')) 13d96: 85 e4 ldi r24, 0x45 ; 69 13d98: 0e 94 f5 55 call 0xabea ; 0xabea 13d9c: 88 23 and r24, r24 13d9e: 09 f4 brne .+2 ; 0x13da2 13da0: 27 c3 rjmp .+1614 ; 0x143f0 { float e = code_value(); 13da2: 0e 94 85 5a call 0xb50a ; 0xb50a #ifndef LA_NOCOMPAT e = la10c_jerk(e); 13da6: 0e 94 97 83 call 0x1072e ; 0x1072e #endif cs.max_jerk[E_AXIS] = e; 13daa: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 13dae: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 13db2: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 13db6: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe 13dba: 1a c3 rjmp .+1588 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13dbc: 81 3d cpi r24, 0xD1 ; 209 13dbe: 91 05 cpc r25, r1 13dc0: 11 f4 brne .+4 ; 0x13dc6 13dc2: 0c 94 f5 a9 jmp 0x153ea ; 0x153ea 13dc6: 5c f5 brge .+86 ; 0x13e1e 13dc8: 8f 3c cpi r24, 0xCF ; 207 13dca: 91 05 cpc r25, r1 13dcc: 11 f4 brne .+4 ; 0x13dd2 13dce: 0c 94 c3 a9 jmp 0x15386 ; 0x15386 13dd2: 80 3d cpi r24, 0xD0 ; 208 13dd4: 91 05 cpc r25, r1 13dd6: 09 f0 breq .+2 ; 0x13dda 13dd8: 15 cc rjmp .-2006 ; 0x13604 - `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')) 13dda: 83 e5 ldi r24, 0x53 ; 83 13ddc: 0e 94 f5 55 call 0xabea ; 0xabea 13de0: 88 23 and r24, r24 13de2: 51 f0 breq .+20 ; 0x13df8 { cs.retract_recover_length = code_value() ; 13de4: 0e 94 85 5a call 0xb50a ; 0xb50a 13de8: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 13dec: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 13df0: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 13df4: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 } if(code_seen('F')) 13df8: 86 e4 ldi r24, 0x46 ; 70 13dfa: 0e 94 f5 55 call 0xabea ; 0xabea 13dfe: 88 23 and r24, r24 13e00: 09 f4 brne .+2 ; 0x13e04 13e02: f6 c2 rjmp .+1516 ; 0x143f0 { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 13e04: 0e 94 85 5a call 0xb50a ; 0xb50a 13e08: 0e 94 15 65 call 0xca2a ; 0xca2a 13e0c: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 13e10: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 13e14: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 13e18: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd 13e1c: e9 c2 rjmp .+1490 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13e1e: 8c 3d cpi r24, 0xDC ; 220 13e20: 91 05 cpc r25, r1 13e22: 11 f4 brne .+4 ; 0x13e28 13e24: 0c 94 38 aa jmp 0x15470 ; 0x15470 13e28: 8d 3d cpi r24, 0xDD ; 221 13e2a: 91 05 cpc r25, r1 13e2c: 11 f4 brne .+4 ; 0x13e32 13e2e: 0c 94 77 aa jmp 0x154ee ; 0x154ee 13e32: 86 3d cpi r24, 0xD6 ; 214 13e34: 91 05 cpc r25, r1 13e36: 09 f0 breq .+2 ; 0x13e3a 13e38: e5 cb rjmp .-2102 ; 0x13604 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; 13e3a: 80 e5 ldi r24, 0x50 ; 80 13e3c: 0e 94 f5 55 call 0xabea ; 0xabea 13e40: 88 23 and r24, r24 13e42: 11 f4 brne .+4 ; 0x13e48 13e44: 0c 94 24 aa jmp 0x15448 ; 0x15448 13e48: 0e 94 85 5a call 0xb50a ; 0xb50a 13e4c: 2b 01 movw r4, r22 13e4e: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 13e50: 83 e5 ldi r24, 0x53 ; 83 13e52: 0e 94 f5 55 call 0xabea ; 0xabea 13e56: 88 23 and r24, r24 13e58: 11 f4 brne .+4 ; 0x13e5e 13e5a: 0c 94 2e aa jmp 0x1545c ; 0x1545c 13e5e: 0e 94 85 5a call 0xb50a ; 0xb50a 13e62: 4b 01 movw r8, r22 13e64: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 13e66: 8e e4 ldi r24, 0x4E ; 78 13e68: 0e 94 f5 55 call 0xabea ; 0xabea 13e6c: d0 90 33 0e lds r13, 0x0E33 ; 0x800e33 13e70: 88 23 and r24, r24 13e72: 29 f0 breq .+10 ; 0x13e7e 13e74: 0e 94 85 5a call 0xb50a ; 0xb50a 13e78: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 13e7c: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 13e7e: 82 e5 ldi r24, 0x52 ; 82 13e80: 0e 94 f5 55 call 0xabea ; 0xabea 13e84: e0 90 34 0e lds r14, 0x0E34 ; 0x800e34 13e88: f0 90 35 0e lds r15, 0x0E35 ; 0x800e35 13e8c: 88 23 and r24, r24 13e8e: 29 f0 breq .+10 ; 0x13e9a 13e90: 0e 94 85 5a call 0xb50a ; 0xb50a 13e94: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 13e98: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 13e9a: 86 e4 ldi r24, 0x46 ; 70 13e9c: 0e 94 f5 55 call 0xabea ; 0xabea 13ea0: 00 91 36 0e lds r16, 0x0E36 ; 0x800e36 13ea4: 10 91 37 0e lds r17, 0x0E37 ; 0x800e37 13ea8: 88 23 and r24, r24 13eaa: 29 f0 breq .+10 ; 0x13eb6 13eac: 0e 94 85 5a call 0xb50a ; 0xb50a 13eb0: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 13eb4: 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) 13eb6: 20 e0 ldi r18, 0x00 ; 0 13eb8: 30 e0 ldi r19, 0x00 ; 0 13eba: a9 01 movw r20, r18 13ebc: c3 01 movw r24, r6 13ebe: b2 01 movw r22, r4 13ec0: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 13ec4: 18 16 cp r1, r24 13ec6: 0c f0 brlt .+2 ; 0x13eca 13ec8: 93 c2 rjmp .+1318 ; 0x143f0 13eca: 20 e0 ldi r18, 0x00 ; 0 13ecc: 30 e0 ldi r19, 0x00 ; 0 13ece: a9 01 movw r20, r18 13ed0: c5 01 movw r24, r10 13ed2: b4 01 movw r22, r8 13ed4: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 13ed8: 87 fd sbrc r24, 7 13eda: 8a c2 rjmp .+1300 ; 0x143f0 13edc: a5 01 movw r20, r10 13ede: 94 01 movw r18, r8 13ee0: c3 01 movw r24, r6 13ee2: b2 01 movw r22, r4 13ee4: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 13ee8: 87 fd sbrc r24, 7 13eea: 82 c2 rjmp .+1284 ; 0x143f0 { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 13eec: 40 92 2b 0e sts 0x0E2B, r4 ; 0x800e2b 13ef0: 50 92 2c 0e sts 0x0E2C, r5 ; 0x800e2c 13ef4: 60 92 2d 0e sts 0x0E2D, r6 ; 0x800e2d 13ef8: 70 92 2e 0e sts 0x0E2E, r7 ; 0x800e2e cs.min_mm_per_arc_segment = s; 13efc: 80 92 2f 0e sts 0x0E2F, r8 ; 0x800e2f 13f00: 90 92 30 0e sts 0x0E30, r9 ; 0x800e30 13f04: a0 92 31 0e sts 0x0E31, r10 ; 0x800e31 13f08: b0 92 32 0e sts 0x0E32, r11 ; 0x800e32 cs.n_arc_correction = n; 13f0c: d0 92 33 0e sts 0x0E33, r13 ; 0x800e33 cs.min_arc_segments = r; 13f10: f0 92 35 0e sts 0x0E35, r15 ; 0x800e35 13f14: e0 92 34 0e sts 0x0E34, r14 ; 0x800e34 cs.arc_segments_per_sec = f; 13f18: 10 93 37 0e sts 0x0E37, r17 ; 0x800e37 13f1c: 00 93 36 0e sts 0x0E36, r16 ; 0x800e36 13f20: 67 c2 rjmp .+1230 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13f22: 80 33 cpi r24, 0x30 ; 48 13f24: a1 e0 ldi r26, 0x01 ; 1 13f26: 9a 07 cpc r25, r26 13f28: 11 f4 brne .+4 ; 0x13f2e 13f2a: 0c 94 73 ab jmp 0x156e6 ; 0x156e6 13f2e: 0c f0 brlt .+2 ; 0x13f32 13f30: 78 c0 rjmp .+240 ; 0x14022 13f32: 8d 32 cpi r24, 0x2D ; 45 13f34: e1 e0 ldi r30, 0x01 ; 1 13f36: 9e 07 cpc r25, r30 13f38: 11 f4 brne .+4 ; 0x13f3e 13f3a: 0c 94 fa aa jmp 0x155f4 ; 0x155f4 13f3e: b4 f5 brge .+108 ; 0x13fac 13f40: 80 3f cpi r24, 0xF0 ; 240 13f42: 91 05 cpc r25, r1 13f44: 09 f4 brne .+2 ; 0x13f48 13f46: 54 c2 rjmp .+1192 ; 0x143f0 13f48: 8c 32 cpi r24, 0x2C ; 44 13f4a: 91 40 sbci r25, 0x01 ; 1 13f4c: 09 f0 breq .+2 ; 0x13f50 13f4e: 5a cb rjmp .-2380 ; 0x13604 - `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; 13f50: 80 e5 ldi r24, 0x50 ; 80 13f52: 0e 94 f5 55 call 0xabea ; 0xabea 13f56: 08 ee ldi r16, 0xE8 ; 232 13f58: 13 e0 ldi r17, 0x03 ; 3 13f5a: 88 23 and r24, r24 13f5c: 89 f0 breq .+34 ; 0x13f80 13f5e: 0e 94 85 5a call 0xb50a ; 0xb50a 13f62: 20 e0 ldi r18, 0x00 ; 0 13f64: 30 ec ldi r19, 0xC0 ; 192 13f66: 4a e5 ldi r20, 0x5A ; 90 13f68: 55 e4 ldi r21, 0x45 ; 69 13f6a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 13f6e: 0c ea ldi r16, 0xAC ; 172 13f70: 1d e0 ldi r17, 0x0D ; 13 13f72: 87 ff sbrs r24, 7 13f74: 05 c0 rjmp .+10 ; 0x13f80 13f76: 0e 94 85 5a call 0xb50a ; 0xb50a 13f7a: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 13f7e: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 13f80: 83 e5 ldi r24, 0x53 ; 83 13f82: 0e 94 f5 55 call 0xabea ; 0xabea 13f86: 88 23 and r24, r24 13f88: 11 f4 brne .+4 ; 0x13f8e 13f8a: 0c 94 f2 aa jmp 0x155e4 ; 0x155e4 beepS = 0; else { beepS = code_value(); 13f8e: 0e 94 85 5a call 0xb50a ; 0xb50a 13f92: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> if (!beepS) { 13f96: 61 15 cp r22, r1 13f98: 71 05 cpc r23, r1 13f9a: 11 f0 breq .+4 ; 0x13fa0 13f9c: 0c 94 f4 aa jmp 0x155e8 ; 0x155e8 // handle S0 as a pause _delay(beepP); 13fa0: b8 01 movw r22, r16 13fa2: 90 e0 ldi r25, 0x00 ; 0 13fa4: 80 e0 ldi r24, 0x00 ; 0 13fa6: 0f 94 23 0b call 0x21646 ; 0x21646 13faa: 22 c2 rjmp .+1092 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13fac: 8e 32 cpi r24, 0x2E ; 46 13fae: 31 e0 ldi r19, 0x01 ; 1 13fb0: 93 07 cpc r25, r19 13fb2: 11 f4 brne .+4 ; 0x13fb8 13fb4: 0c 94 ec ab jmp 0x157d8 ; 0x157d8 13fb8: 8f 32 cpi r24, 0x2F ; 47 13fba: 91 40 sbci r25, 0x01 ; 1 13fbc: 09 f0 breq .+2 ; 0x13fc0 13fbe: 22 cb rjmp .-2492 ; 0x13604 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 13fc0: 85 e4 ldi r24, 0x45 ; 69 13fc2: 0e 94 f5 55 call 0xabea ; 0xabea - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 13fc6: 10 e0 ldi r17, 0x00 ; 0 13fc8: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 13fca: 88 23 and r24, r24 13fcc: 59 f0 breq .+22 ; 0x13fe4 13fce: 0e 94 17 56 call 0xac2e ; 0xac2e 13fd2: 8c 01 movw r16, r24 if (e < 0) temp = 70; 13fd4: c1 2c mov r12, r1 13fd6: d1 2c mov r13, r1 13fd8: 6c e8 ldi r22, 0x8C ; 140 13fda: e6 2e mov r14, r22 13fdc: 62 e4 ldi r22, 0x42 ; 66 13fde: f6 2e mov r15, r22 { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); if (e < 0) 13fe0: 97 fd sbrc r25, 7 13fe2: 06 c0 rjmp .+12 ; 0x13ff0 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 13fe4: c1 2c mov r12, r1 13fe6: d1 2c mov r13, r1 13fe8: 76 e1 ldi r23, 0x16 ; 22 13fea: e7 2e mov r14, r23 13fec: 73 e4 ldi r23, 0x43 ; 67 13fee: f7 2e mov r15, r23 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(); 13ff0: 83 e5 ldi r24, 0x53 ; 83 13ff2: 0e 94 f5 55 call 0xabea ; 0xabea 13ff6: 88 23 and r24, r24 13ff8: 21 f0 breq .+8 ; 0x14002 13ffa: 0e 94 85 5a call 0xb50a ; 0xb50a 13ffe: 6b 01 movw r12, r22 14000: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 14002: 83 e4 ldi r24, 0x43 ; 67 14004: 0e 94 f5 55 call 0xabea ; 0xabea 14008: 88 23 and r24, r24 1400a: 11 f4 brne .+4 ; 0x14010 1400c: 0c 94 fc ab jmp 0x157f8 ; 0x157f8 14010: 0e 94 17 56 call 0xac2e ; 0xac2e PID_autotune(temp, e, c); 14014: 9c 01 movw r18, r24 14016: a8 01 movw r20, r16 14018: c7 01 movw r24, r14 1401a: b6 01 movw r22, r12 1401c: 0f 94 02 34 call 0x26804 ; 0x26804 14020: e7 c1 rjmp .+974 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14022: 80 39 cpi r24, 0x90 ; 144 14024: 51 e0 ldi r21, 0x01 ; 1 14026: 95 07 cpc r25, r21 14028: 11 f4 brne .+4 ; 0x1402e 1402a: 0c 94 00 ac jmp 0x15800 ; 0x15800 1402e: 04 f5 brge .+64 ; 0x14070 14030: 8e 35 cpi r24, 0x5E ; 94 14032: b1 e0 ldi r27, 0x01 ; 1 14034: 9b 07 cpc r25, r27 14036: 11 f4 brne .+4 ; 0x1403c 14038: 0c 94 3f b7 jmp 0x16e7e ; 0x16e7e 1403c: 8f 35 cpi r24, 0x5F ; 95 1403e: 91 40 sbci r25, 0x01 ; 1 14040: 09 f0 breq .+2 ; 0x14044 14042: e0 ca rjmp .-2624 ; 0x13604 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 14044: 83 e5 ldi r24, 0x53 ; 83 14046: 0e 94 f5 55 call 0xabea ; 0xabea 1404a: 88 23 and r24, r24 1404c: 71 f0 breq .+28 ; 0x1406a 1404e: 0e 94 85 5a call 0xb50a ; 0xb50a 14052: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 14056: 61 30 cpi r22, 0x01 ; 1 14058: 71 05 cpc r23, r1 1405a: 11 f4 brne .+4 ; 0x14060 1405c: 0c 94 75 b7 jmp 0x16eea ; 0x16eea 14060: 62 30 cpi r22, 0x02 ; 2 14062: 71 05 cpc r23, r1 14064: 11 f4 brne .+4 ; 0x1406a 14066: 0c 94 97 b7 jmp 0x16f2e ; 0x16f2e case 2: for(int i=0;i 1406e: c0 c1 rjmp .+896 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14070: 85 39 cpi r24, 0x95 ; 149 14072: f1 e0 ldi r31, 0x01 ; 1 14074: 9f 07 cpc r25, r31 14076: 11 f4 brne .+4 ; 0x1407c 14078: 0c 94 04 ac jmp 0x15808 ; 0x15808 1407c: 86 39 cpi r24, 0x96 ; 150 1407e: 21 e0 ldi r18, 0x01 ; 1 14080: 92 07 cpc r25, r18 14082: 11 f4 brne .+4 ; 0x14088 14084: 0c 94 09 ac jmp 0x15812 ; 0x15812 14088: 83 39 cpi r24, 0x93 ; 147 1408a: 91 40 sbci r25, 0x01 ; 1 1408c: 09 f0 breq .+2 ; 0x14090 1408e: ba ca rjmp .-2700 ; 0x13604 */ 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()) 14090: 80 91 01 13 lds r24, 0x1301 ; 0x801301 14094: 81 30 cpi r24, 0x01 ; 1 14096: 09 f0 breq .+2 ; 0x1409a 14098: ab c1 rjmp .+854 ; 0x143f0 { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 1409a: 85 e4 ldi r24, 0x45 ; 69 1409c: 0e 94 f5 55 call 0xabea ; 0xabea 140a0: 81 11 cpse r24, r1 140a2: 0e 94 0a 56 call 0xac14 ; 0xac14 if(code_seen('F')) filament = code_value_uint8(); 140a6: 86 e4 ldi r24, 0x46 ; 70 140a8: 0e 94 f5 55 call 0xabea ; 0xabea 140ac: 81 11 cpse r24, r1 140ae: 0e 94 0a 56 call 0xac14 ; 0xac14 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 140b2: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 140b6: 88 23 and r24, r24 140b8: 09 f4 brne .+2 ; 0x140bc 140ba: 9a c1 rjmp .+820 ; 0x143f0 // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 140bc: 60 e0 ldi r22, 0x00 ; 0 140be: 80 e0 ldi r24, 0x00 ; 0 140c0: 0f 94 67 9c call 0x338ce ; 0x338ce 140c4: 95 c1 rjmp .+810 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 140c6: 80 3c cpi r24, 0xC0 ; 192 140c8: 42 e0 ldi r20, 0x02 ; 2 140ca: 94 07 cpc r25, r20 140cc: 11 f4 brne .+4 ; 0x140d2 140ce: 0c 94 81 b8 jmp 0x17102 ; 0x17102 140d2: 0c f0 brlt .+2 ; 0x140d6 140d4: 57 c0 rjmp .+174 ; 0x14184 140d6: 88 32 cpi r24, 0x28 ; 40 140d8: a2 e0 ldi r26, 0x02 ; 2 140da: 9a 07 cpc r25, r26 140dc: 11 f4 brne .+4 ; 0x140e2 140de: 0c 94 cd ae jmp 0x15d9a ; 0x15d9a 140e2: 4c f5 brge .+82 ; 0x14136 140e4: 86 3f cpi r24, 0xF6 ; 246 140e6: e1 e0 ldi r30, 0x01 ; 1 140e8: 9e 07 cpc r25, r30 140ea: 11 f4 brne .+4 ; 0x140f0 140ec: 0c 94 16 ac jmp 0x1582c ; 0x1582c 140f0: 6c f4 brge .+26 ; 0x1410c 140f2: 84 3f cpi r24, 0xF4 ; 244 140f4: 21 e0 ldi r18, 0x01 ; 1 140f6: 92 07 cpc r25, r18 140f8: 11 f4 brne .+4 ; 0x140fe 140fa: 0c 94 12 ac jmp 0x15824 ; 0x15824 140fe: 85 3f cpi r24, 0xF5 ; 245 14100: 91 40 sbci r25, 0x01 ; 1 14102: 09 f0 breq .+2 ; 0x14106 14104: 7f ca rjmp .-2818 ; 0x13604 M501 */ case 501: { Config_RetrieveSettings(); 14106: 0e 94 f5 84 call 0x109ea ; 0x109ea 1410a: 72 c1 rjmp .+740 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1410c: 87 3f cpi r24, 0xF7 ; 247 1410e: 41 e0 ldi r20, 0x01 ; 1 14110: 94 07 cpc r25, r20 14112: 11 f4 brne .+4 ; 0x14118 14114: 0c 94 1a ac jmp 0x15834 ; 0x15834 14118: 8d 3f cpi r24, 0xFD ; 253 1411a: 91 40 sbci r25, 0x01 ; 1 1411c: 09 f0 breq .+2 ; 0x14120 1411e: 72 ca rjmp .-2844 ; 0x13604 M509 */ case 509: { lang_reset(); 14120: 0e 94 0d 74 call 0xe81a ; 0xe81a SERIAL_ECHO_START; 14124: 8e ec ldi r24, 0xCE ; 206 14126: 91 ea ldi r25, 0xA1 ; 161 14128: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 1412c: 8e e4 ldi r24, 0x4E ; 78 1412e: 9f e7 ldi r25, 0x7F ; 127 14130: 0e 94 94 7a call 0xf528 ; 0xf528 14134: 5d c1 rjmp .+698 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14136: 8a 35 cpi r24, 0x5A ; 90 14138: a2 e0 ldi r26, 0x02 ; 2 1413a: 9a 07 cpc r25, r26 1413c: 11 f4 brne .+4 ; 0x14142 1413e: 0c 94 f8 b2 jmp 0x165f0 ; 0x165f0 14142: 5c f4 brge .+22 ; 0x1415a 14144: 88 35 cpi r24, 0x58 ; 88 14146: e2 e0 ldi r30, 0x02 ; 2 14148: 9e 07 cpc r25, r30 1414a: 11 f4 brne .+4 ; 0x14150 1414c: 0c 94 02 af jmp 0x15e04 ; 0x15e04 14150: 89 35 cpi r24, 0x59 ; 89 14152: 92 40 sbci r25, 0x02 ; 2 14154: 09 f4 brne .+2 ; 0x14158 14156: c3 ca rjmp .-2682 ; 0x136de 14158: 55 ca rjmp .-2902 ; 0x13604 1415a: 8d 3b cpi r24, 0xBD ; 189 1415c: 22 e0 ldi r18, 0x02 ; 2 1415e: 92 07 cpc r25, r18 14160: 11 f4 brne .+4 ; 0x14166 14162: 0c 94 b0 b7 jmp 0x16f60 ; 0x16f60 14166: 8e 3b cpi r24, 0xBE ; 190 14168: 32 e0 ldi r19, 0x02 ; 2 1416a: 93 07 cpc r25, r19 1416c: 11 f4 brne .+4 ; 0x14172 1416e: 0c 94 4d b8 jmp 0x1709a ; 0x1709a 14172: 8b 35 cpi r24, 0x5B ; 91 14174: 92 40 sbci r25, 0x02 ; 2 14176: 09 f0 breq .+2 ; 0x1417a 14178: 45 ca rjmp .-2934 ; 0x13604 /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 1417a: 60 e0 ldi r22, 0x00 ; 0 1417c: 80 e0 ldi r24, 0x00 ; 0 1417e: 0e 94 ea dc call 0x1b9d4 ; 0x1b9d4 14182: 36 c1 rjmp .+620 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14184: 8c 35 cpi r24, 0x5C ; 92 14186: 53 e0 ldi r21, 0x03 ; 3 14188: 95 07 cpc r25, r21 1418a: 11 f4 brne .+4 ; 0x14190 1418c: 0c 94 1a b4 jmp 0x16834 ; 0x16834 14190: 0c f0 brlt .+2 ; 0x14194 14192: 42 c0 rjmp .+132 ; 0x14218 14194: 83 3c cpi r24, 0xC3 ; 195 14196: b2 e0 ldi r27, 0x02 ; 2 14198: 9b 07 cpc r25, r27 1419a: 11 f4 brne .+4 ; 0x141a0 1419c: 0c 94 8d b8 jmp 0x1711a ; 0x1711a 141a0: 7c f4 brge .+30 ; 0x141c0 141a2: 81 3c cpi r24, 0xC1 ; 193 141a4: f2 e0 ldi r31, 0x02 ; 2 141a6: 9f 07 cpc r25, r31 141a8: 11 f4 brne .+4 ; 0x141ae 141aa: 0c 94 87 b8 jmp 0x1710e ; 0x1710e 141ae: 82 3c cpi r24, 0xC2 ; 194 141b0: 92 40 sbci r25, 0x02 ; 2 141b2: 09 f0 breq .+2 ; 0x141b6 141b4: 27 ca rjmp .-2994 ; 0x13604 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 141b6: 82 ec ldi r24, 0xC2 ; 194 141b8: 92 e0 ldi r25, 0x02 ; 2 141ba: 0e 94 4b 5a call 0xb496 ; 0xb496 141be: 18 c1 rjmp .+560 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 141c0: 85 3c cpi r24, 0xC5 ; 197 141c2: 32 e0 ldi r19, 0x02 ; 2 141c4: 93 07 cpc r25, r19 141c6: 11 f4 brne .+4 ; 0x141cc 141c8: 0c 94 d6 b8 jmp 0x171ac ; 0x171ac 141cc: 14 f4 brge .+4 ; 0x141d2 141ce: 0c 94 aa b8 jmp 0x17154 ; 0x17154 141d2: 82 35 cpi r24, 0x52 ; 82 141d4: 93 40 sbci r25, 0x03 ; 3 141d6: 09 f0 breq .+2 ; 0x141da 141d8: 15 ca rjmp .-3030 ; 0x13604 float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 141da: 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')) { 141dc: 83 e5 ldi r24, 0x53 ; 83 141de: 0e 94 f5 55 call 0xabea ; 0xabea 141e2: 88 23 and r24, r24 141e4: 11 f4 brne .+4 ; 0x141ea 141e6: 0c 94 00 b3 jmp 0x16600 ; 0x16600 iSel = code_value_uint8(); 141ea: 0e 94 0a 56 call 0xac14 ; 0xac14 141ee: 18 2f mov r17, r24 if (iSel>=max_sheets) 141f0: 88 30 cpi r24, 0x08 ; 8 141f2: 10 f4 brcc .+4 ; 0x141f8 141f4: 0c 94 05 b3 jmp 0x1660a ; 0x1660a { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 141f8: 8a e2 ldi r24, 0x2A ; 42 141fa: 9f e7 ldi r25, 0x7F ; 127 141fc: 0e 94 94 7a call 0xf528 ; 0xf528 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 14200: 4a e0 ldi r20, 0x0A ; 10 14202: 67 e0 ldi r22, 0x07 ; 7 14204: 70 e0 ldi r23, 0x00 ; 0 14206: 80 e0 ldi r24, 0x00 ; 0 14208: 90 e0 ldi r25, 0x00 ; 0 1420a: 0e 94 95 79 call 0xf32a ; 0xf32a SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 1420e: 8f ed ldi r24, 0xDF ; 223 14210: 92 e0 ldi r25, 0x02 ; 2 14212: 0e 94 92 85 call 0x10b24 ; 0x10b24 14216: ec c0 rjmp .+472 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14218: 84 38 cpi r24, 0x84 ; 132 1421a: a3 e0 ldi r26, 0x03 ; 3 1421c: 9a 07 cpc r25, r26 1421e: 11 f4 brne .+4 ; 0x14224 14220: 0c 94 90 b6 jmp 0x16d20 ; 0x16d20 14224: 0c f0 brlt .+2 ; 0x14228 14226: 4d c0 rjmp .+154 ; 0x142c2 14228: 8d 35 cpi r24, 0x5D ; 93 1422a: e3 e0 ldi r30, 0x03 ; 3 1422c: 9e 07 cpc r25, r30 1422e: 11 f4 brne .+4 ; 0x14234 14230: 0c 94 a4 b4 jmp 0x16948 ; 0x16948 14234: 8e 35 cpi r24, 0x5E ; 94 14236: 93 40 sbci r25, 0x03 ; 3 14238: 09 f0 breq .+2 ; 0x1423c 1423a: e4 c9 rjmp .-3128 ; 0x13604 */ 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); 1423c: 0e 94 85 5a call 0xb50a ; 0xb50a 14240: 20 e0 ldi r18, 0x00 ; 0 14242: 30 e0 ldi r19, 0x00 ; 0 14244: 40 e2 ldi r20, 0x20 ; 32 14246: 51 e4 ldi r21, 0x41 ; 65 14248: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1424c: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 14250: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 14252: 63 30 cpi r22, 0x03 ; 3 14254: 11 f4 brne .+4 ; 0x1425a 14256: 0c 94 aa b5 jmp 0x16b54 ; 0x16b54 1425a: 10 f0 brcs .+4 ; 0x14260 1425c: 0c 94 3c b5 jmp 0x16a78 ; 0x16a78 14260: 61 30 cpi r22, 0x01 ; 1 14262: 11 f4 brne .+4 ; 0x14268 14264: 0c 94 65 b5 jmp 0x16aca ; 0x16aca 14268: 62 30 cpi r22, 0x02 ; 2 1426a: 09 f0 breq .+2 ; 0x1426e 1426c: c1 c0 rjmp .+386 ; 0x143f0 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 1426e: 80 91 01 13 lds r24, 0x1301 ; 0x801301 return pgm_read_word(&_nPrinterMmuType); 14272: ee e3 ldi r30, 0x3E ; 62 14274: f9 e7 ldi r31, 0x79 ; 121 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 14276: 81 30 cpi r24, 0x01 ; 1 14278: 11 f0 breq .+4 ; 0x1427e return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 1427a: e0 e4 ldi r30, 0x40 ; 64 1427c: f9 e7 ldi r31, 0x79 ; 121 1427e: 05 91 lpm r16, Z+ 14280: 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')) 14282: 80 e5 ldi r24, 0x50 ; 80 14284: 0e 94 f5 55 call 0xabea ; 0xabea 14288: 88 23 and r24, r24 1428a: 11 f4 brne .+4 ; 0x14290 1428c: 0c 94 99 b5 jmp 0x16b32 ; 0x16b32 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 14290: 0e 94 5d 56 call 0xacba ; 0xacba menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 14294: f0 90 ea 03 lds r15, 0x03EA ; 0x8003ea 14298: ff 20 and r15, r15 1429a: 09 f4 brne .+2 ; 0x1429e 1429c: a9 c0 rjmp .+338 ; 0x143f0 return; if (nPrinterModel == actualPrinterModel) 1429e: 60 17 cp r22, r16 142a0: 71 07 cpc r23, r17 142a2: 09 f4 brne .+2 ; 0x142a6 142a4: a5 c0 rjmp .+330 ; 0x143f0 // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 142a6: 89 e8 ldi r24, 0x89 ; 137 142a8: 97 e3 ldi r25, 0x37 ; 55 142aa: 0e 94 0a 75 call 0xea14 ; 0xea14 142ae: 8c 01 movw r16, r24 142b0: 8b e5 ldi r24, 0x5B ; 91 142b2: 97 e3 ldi r25, 0x37 ; 55 142b4: 0e 94 0a 75 call 0xea14 ; 0xea14 142b8: 4f 2d mov r20, r15 142ba: b8 01 movw r22, r16 142bc: 0e 94 d0 e8 call 0x1d1a0 ; 0x1d1a0 142c0: 97 c0 rjmp .+302 ; 0x143f0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 142c2: 8c 38 cpi r24, 0x8C ; 140 142c4: 23 e0 ldi r18, 0x03 ; 3 142c6: 92 07 cpc r25, r18 142c8: 09 f4 brne .+2 ; 0x142cc 142ca: 92 c0 rjmp .+292 ; 0x143f0 142cc: 80 3a cpi r24, 0xA0 ; 160 142ce: 33 e0 ldi r19, 0x03 ; 3 142d0: 93 07 cpc r25, r19 142d2: 09 f4 brne .+2 ; 0x142d6 142d4: 50 c2 rjmp .+1184 ; 0x14776 142d6: 8b 38 cpi r24, 0x8B ; 139 142d8: 93 40 sbci r25, 0x03 ; 3 142da: 09 f0 breq .+2 ; 0x142de 142dc: 93 c9 rjmp .-3290 ; 0x13604 for(int i=0;i 142e4: 88 23 and r24, r24 142e6: 39 f0 breq .+14 ; 0x142f6 142e8: 0e 94 85 5a call 0xb50a ; 0xb50a 142ec: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 142f0: 80 e0 ldi r24, 0x00 ; 0 142f2: 0f 94 13 18 call 0x23026 ; 0x23026 #endif #ifdef MOTOR_CURRENT_PWM_Z_PIN if(code_seen('Z')) st_current_set(1, code_value()); 142f6: 8a e5 ldi r24, 0x5A ; 90 142f8: 0e 94 f5 55 call 0xabea ; 0xabea 142fc: 88 23 and r24, r24 142fe: 39 f0 breq .+14 ; 0x1430e 14300: 0e 94 85 5a call 0xb50a ; 0xb50a 14304: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 14308: 81 e0 ldi r24, 0x01 ; 1 1430a: 0f 94 13 18 call 0x23026 ; 0x23026 #endif #ifdef MOTOR_CURRENT_PWM_E_PIN if(code_seen('E')) st_current_set(2, code_value()); 1430e: 85 e4 ldi r24, 0x45 ; 69 14310: 0e 94 f5 55 call 0xabea ; 0xabea 14314: 88 23 and r24, r24 14316: 09 f4 brne .+2 ; 0x1431a 14318: 6b c0 rjmp .+214 ; 0x143f0 1431a: 0e 94 85 5a call 0xb50a ; 0xb50a 1431e: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 14322: cb 01 movw r24, r22 14324: 0f 94 13 17 call 0x22e26 ; 0x22e26 14328: 63 c0 rjmp .+198 ; 0x143f0 - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 1432a: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 1432e: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 14332: 0e 5f subi r16, 0xFE ; 254 14334: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 14336: 80 e5 ldi r24, 0x50 ; 80 14338: 0e 94 f5 55 call 0xabea ; 0xabea */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 1433c: c1 2c mov r12, r1 1433e: d1 2c mov r13, r1 14340: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 14342: 88 23 and r24, r24 14344: 21 f0 breq .+8 ; 0x1434e 14346: 0e 94 5d 56 call 0xacba ; 0xacba 1434a: 6b 01 movw r12, r22 1434c: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 1434e: 83 e5 ldi r24, 0x53 ; 83 14350: 0e 94 f5 55 call 0xabea ; 0xabea 14354: 88 23 and r24, r24 14356: 51 f0 breq .+20 ; 0x1436c 14358: 0e 94 5d 56 call 0xacba ; 0xacba 1435c: 9b 01 movw r18, r22 1435e: ac 01 movw r20, r24 14360: a8 ee ldi r26, 0xE8 ; 232 14362: b3 e0 ldi r27, 0x03 ; 3 14364: 0f 94 32 a4 call 0x34864 ; 0x34864 <__muluhisi3> 14368: 6b 01 movw r12, r22 1436a: 7c 01 movw r14, r24 1436c: c8 01 movw r24, r16 1436e: 0f 5f subi r16, 0xFF ; 255 14370: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 14372: dc 01 movw r26, r24 14374: 4c 91 ld r20, X 14376: 40 32 cpi r20, 0x20 ; 32 14378: c9 f3 breq .-14 ; 0x1436c custom_message_type = CustomMsg::M0Wait; 1437a: 26 e0 ldi r18, 0x06 ; 6 1437c: 20 93 5d 06 sts 0x065D, r18 ; 0x80065d if (!expiration_time_set && *src != '\0') { 14380: c1 14 cp r12, r1 14382: d1 04 cpc r13, r1 14384: e1 04 cpc r14, r1 14386: f1 04 cpc r15, r1 14388: c9 f5 brne .+114 ; 0x143fc 1438a: 2c 91 ld r18, X 1438c: 22 23 and r18, r18 1438e: b1 f1 breq .+108 ; 0x143fc lcd_setstatus(src); 14390: 0e 94 d9 dc call 0x1b9b2 ; 0x1b9b2 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(); 14394: 0f 94 b0 18 call 0x23160 ; 0x23160 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 14398: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 1439c: 84 60 ori r24, 0x04 ; 4 1439e: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a previous_millis_cmd.start(); 143a2: 88 e4 ldi r24, 0x48 ; 72 143a4: 93 e0 ldi r25, 0x03 ; 3 143a6: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> if (expiration_time_set) { 143aa: c1 14 cp r12, r1 143ac: d1 04 cpc r13, r1 143ae: e1 04 cpc r14, r1 143b0: f1 04 cpc r15, r1 143b2: d9 f1 breq .+118 ; 0x1442a codenum += _millis(); // keep track of when we started waiting 143b4: 0f 94 56 0b call 0x216ac ; 0x216ac 143b8: c6 0e add r12, r22 143ba: d7 1e adc r13, r23 143bc: e8 1e adc r14, r24 143be: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 143c0: 84 e0 ldi r24, 0x04 ; 4 143c2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(_millis() < codenum && !lcd_clicked()) { 143c6: 0f 94 56 0b call 0x216ac ; 0x216ac 143ca: 6c 15 cp r22, r12 143cc: 7d 05 cpc r23, r13 143ce: 8e 05 cpc r24, r14 143d0: 9f 05 cpc r25, r15 143d2: 10 f1 brcs .+68 ; 0x14418 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 143d4: 82 e0 ldi r24, 0x02 ; 2 143d6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 143da: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 143de: 8b 7f andi r24, 0xFB ; 251 143e0: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a if (IS_SD_PRINTING) 143e4: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 143e8: 88 23 and r24, r24 143ea: 91 f1 breq .+100 ; 0x14450 custom_message_type = CustomMsg::Status; 143ec: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d */ 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; 143f0: 10 92 41 0d sts 0x0D41, r1 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.489+0x1> 143f4: 10 92 40 0d sts 0x0D40, r1 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.489> 143f8: 0c 94 1d 8e jmp 0x11c3a ; 0x11c3a lcd_setstatus(src); } 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){ 143fc: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 14400: 81 11 cpse r24, r1 14402: 07 c0 rjmp .+14 ; 0x14412 LCD_MESSAGERPGM(_T(MSG_USERWAIT)); 14404: 8e e7 ldi r24, 0x7E ; 126 14406: 99 e3 ldi r25, 0x39 ; 57 14408: 0e 94 0a 75 call 0xea14 ; 0xea14 1440c: 0e 94 85 dc call 0x1b90a ; 0x1b90a 14410: c1 cf rjmp .-126 ; 0x14394 } else { custom_message_type = CustomMsg::Status; // let the lcd display the name of the printed G-code file in farm mode 14412: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 14416: be cf rjmp .-132 ; 0x14394 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()) { 14418: 0e 94 45 73 call 0xe68a ; 0xe68a 1441c: 81 11 cpse r24, r1 1441e: da cf rjmp .-76 ; 0x143d4 delay_keep_alive(0); 14420: 90 e0 ldi r25, 0x00 ; 0 14422: 80 e0 ldi r24, 0x00 ; 0 14424: 0e 94 7f 8c call 0x118fe ; 0x118fe 14428: ce cf rjmp .-100 ; 0x143c6 //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 1442a: 10 91 78 02 lds r17, 0x0278 ; 0x800278 KEEPALIVE_STATE(PAUSED_FOR_USER); 1442e: 84 e0 ldi r24, 0x04 ; 4 14430: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 14434: 0e 94 40 73 call 0xe680 ; 0xe680 while(!lcd_clicked()) 14438: 0e 94 45 73 call 0xe68a ; 0xe68a 1443c: 81 11 cpse r24, r1 1443e: 05 c0 rjmp .+10 ; 0x1444a { delay_keep_alive(0); 14440: 90 e0 ldi r25, 0x00 ; 0 14442: 80 e0 ldi r24, 0x00 ; 0 14444: 0e 94 7f 8c call 0x118fe ; 0x118fe 14448: f7 cf rjmp .-18 ; 0x14438 } KEEPALIVE_STATE(busy_state_backup); 1444a: 10 93 78 02 sts 0x0278, r17 ; 0x800278 1444e: c5 cf rjmp .-118 ; 0x143da } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 14450: 86 ee ldi r24, 0xE6 ; 230 14452: 9b e6 ldi r25, 0x6B ; 107 14454: 0e 94 85 dc call 0x1b90a ; 0x1b90a 14458: cb cf rjmp .-106 ; 0x143f0 /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 1445a: 83 e7 ldi r24, 0x73 ; 115 1445c: 99 e3 ldi r25, 0x39 ; 57 1445e: 0e 94 0a 75 call 0xea14 ; 0xea14 14462: 0e 94 85 dc call 0x1b90a ; 0x1b90a enable_x(); 14466: 17 98 cbi 0x02, 7 ; 2 enable_y(); 14468: 16 98 cbi 0x02, 6 ; 2 enable_z(); 1446a: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1446c: 14 98 cbi 0x02, 4 ; 2 1446e: c0 cf rjmp .-128 ; 0x143f0 /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 14470: 81 e0 ldi r24, 0x01 ; 1 14472: 0f 94 27 73 call 0x2e64e ; 0x2e64e 14476: bc cf rjmp .-136 ; 0x143f0 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 14478: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 mounted = false; 1447c: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 SERIAL_ECHO_START; 14480: 8e ec ldi r24, 0xCE ; 206 14482: 91 ea ldi r25, 0xA1 ; 161 14484: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 14488: 84 ea ldi r24, 0xA4 ; 164 1448a: 98 e6 ldi r25, 0x68 ; 104 1448c: 0e 94 8d 7c call 0xf91a ; 0xf91a 14490: af cf rjmp .-162 ; 0x143f0 /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 14492: 0e 94 05 66 call 0xcc0a ; 0xcc0a 14496: 88 23 and r24, r24 14498: 19 f0 breq .+6 ; 0x144a0 lcd_resume_print(); 1449a: 0e 94 aa dc call 0x1b954 ; 0x1b954 1449e: a8 cf rjmp .-176 ; 0x143f0 else { if (!filament_presence_check()) { 144a0: 0e 94 e1 e8 call 0x1d1c2 ; 0x1d1c2 144a4: 88 23 and r24, r24 144a6: 09 f4 brne .+2 ; 0x144aa 144a8: a3 cf rjmp .-186 ; 0x143f0 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); }; 144aa: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 144ae: 88 23 and r24, r24 144b0: 61 f0 breq .+24 ; 0x144ca // Print was aborted break; } if (!card.get_sdpos()) 144b2: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 144b6: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 144ba: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 144be: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee 144c2: 89 2b or r24, r25 144c4: 8a 2b or r24, r26 144c6: 8b 2b or r24, r27 144c8: 69 f4 brne .+26 ; 0x144e4 { // A new print has started from scratch, reset stats failstats_reset_print(); 144ca: 0e 94 68 56 call 0xacd0 ; 0xacd0 sdpos_atomic = 0; 144ce: 10 92 49 12 sts 0x1249, r1 ; 0x801249 144d2: 10 92 4a 12 sts 0x124A, r1 ; 0x80124a 144d6: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b 144da: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c 144de: 80 e0 ldi r24, 0x00 ; 0 144e0: 0e 94 fc 83 call 0x107f8 ; 0x107f8 } void CardReader::startFileprint() { if(mounted) 144e4: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 144e8: 88 23 and r24, r24 144ea: 31 f0 breq .+12 ; 0x144f8 { sdprinting = true; 144ec: 81 e0 ldi r24, 0x01 ; 1 144ee: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 144f2: 85 e0 ldi r24, 0x05 ; 5 144f4: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 144f8: 0f 94 da 16 call 0x22db4 ; 0x22db4 if (MMU2::mmu2.Enabled()) 144fc: 80 91 01 13 lds r24, 0x1301 ; 0x801301 14500: 81 30 cpi r24, 0x01 ; 1 14502: 09 f0 breq .+2 ; 0x14506 14504: 75 cf rjmp .-278 ; 0x143f0 { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 14506: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 1450a: 88 23 and r24, r24 1450c: 09 f4 brne .+2 ; 0x14510 1450e: 70 cf rjmp .-288 ; 0x143f0 14510: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 14514: 81 11 cpse r24, r1 14516: 6c cf rjmp .-296 ; 0x143f0 { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 14518: 0f 94 2e 9d call 0x33a5c ; 0x33a5c 1451c: 69 cf rjmp .-302 ; 0x143f0 #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 1451e: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 14522: 88 23 and r24, r24 14524: 09 f4 brne .+2 ; 0x14528 14526: 64 cf rjmp .-312 ; 0x143f0 14528: 83 e5 ldi r24, 0x53 ; 83 1452a: 0e 94 f5 55 call 0xabea ; 0xabea 1452e: 88 23 and r24, r24 14530: 09 f4 brne .+2 ; 0x14534 14532: 5e cf rjmp .-324 ; 0x143f0 long index = code_value_long(); 14534: 0e 94 5d 56 call 0xacba ; 0xacba 14538: 6b 01 movw r12, r22 1453a: 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);}; 1453c: c0 92 eb 16 sts 0x16EB, r12 ; 0x8016eb 14540: d0 92 ec 16 sts 0x16EC, r13 ; 0x8016ec 14544: e0 92 ed 16 sts 0x16ED, r14 ; 0x8016ed 14548: f0 92 ee 16 sts 0x16EE, r15 ; 0x8016ee 1454c: 0f 94 e8 67 call 0x2cfd0 ; 0x2cfd0 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; 14550: c0 92 49 12 sts 0x1249, r12 ; 0x801249 14554: d0 92 4a 12 sts 0x124A, r13 ; 0x80124a 14558: e0 92 4b 12 sts 0x124B, r14 ; 0x80124b 1455c: f0 92 4c 12 sts 0x124C, r15 ; 0x80124c 14560: 47 cf rjmp .-370 ; 0x143f0 #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 14562: 80 e5 ldi r24, 0x50 ; 80 14564: 0e 94 f5 55 call 0xabea ; 0xabea 14568: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 1456a: 0e 94 05 66 call 0xcc0a ; 0xcc0a 1456e: 88 23 and r24, r24 14570: 91 f0 breq .+36 ; 0x14596 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 14572: 80 91 73 12 lds r24, 0x1273 ; 0x801273 14576: 88 23 and r24, r24 14578: 49 f0 breq .+18 ; 0x1458c 1457a: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1457e: 81 11 cpse r24, r1 14580: 05 c0 rjmp .+10 ; 0x1458c SERIAL_PROTOCOLLNPGM("SD print paused"); 14582: 86 e4 ldi r24, 0x46 ; 70 14584: 9e e7 ldi r25, 0x7E ; 126 14586: 0e 94 8d 7c call 0xf91a ; 0xf91a 1458a: 32 cf rjmp .-412 ; 0x143f0 else SERIAL_PROTOCOLLNPGM("Print saved"); 1458c: 8a e3 ldi r24, 0x3A ; 58 1458e: 9e e7 ldi r25, 0x7E ; 126 14590: 0e 94 8d 7c call 0xf91a ; 0xf91a 14594: 2d cf rjmp .-422 ; 0x143f0 } else if (sdprinting) 14596: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 1459a: 88 23 and r24, r24 1459c: 09 f4 brne .+2 ; 0x145a0 1459e: 4a c0 rjmp .+148 ; 0x14634 { if (arg_P) 145a0: 11 23 and r17, r17 145a2: e1 f1 breq .+120 ; 0x1461c { printAbsFilenameFast(); 145a4: 0f 94 6d 6c call 0x2d8da ; 0x2d8da SERIAL_PROTOCOLLN(); 145a8: 0e 94 8c 7a call 0xf518 ; 0xf518 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 145ac: 80 ef ldi r24, 0xF0 ; 240 145ae: 94 e6 ldi r25, 0x64 ; 100 145b0: 0e 94 94 7a call 0xf528 ; 0xf528 145b4: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 145b8: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 145bc: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 145c0: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 145c4: 4a e0 ldi r20, 0x0A ; 10 145c6: 0e 94 95 79 call 0xf32a ; 0xf32a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 145ca: 8f e2 ldi r24, 0x2F ; 47 145cc: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 145d0: 60 91 e4 16 lds r22, 0x16E4 ; 0x8016e4 145d4: 70 91 e5 16 lds r23, 0x16E5 ; 0x8016e5 145d8: 80 91 e6 16 lds r24, 0x16E6 ; 0x8016e6 145dc: 90 91 e7 16 lds r25, 0x16E7 ; 0x8016e7 145e0: 4a e0 ldi r20, 0x0A ; 10 145e2: 0e 94 95 79 call 0xf32a ; 0xf32a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 145e6: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 145ea: 0f 94 22 15 call 0x22a44 ; 0x22a44 145ee: 2c e3 ldi r18, 0x3C ; 60 145f0: 30 e0 ldi r19, 0x00 ; 0 145f2: 40 e0 ldi r20, 0x00 ; 0 145f4: 50 e0 ldi r21, 0x00 ; 0 145f6: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 145fa: c9 01 movw r24, r18 145fc: 6c e3 ldi r22, 0x3C ; 60 145fe: 70 e0 ldi r23, 0x00 ; 0 14600: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 14604: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 14606: 90 e0 ldi r25, 0x00 ; 0 14608: 80 e0 ldi r24, 0x00 ; 0 1460a: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1460e: 8a e3 ldi r24, 0x3A ; 58 14610: 0e 94 81 79 call 0xf302 ; 0xf302 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 14614: c8 01 movw r24, r16 14616: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e 1461a: ea ce rjmp .-556 ; 0x143f0 { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 1461c: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 14620: 88 23 and r24, r24 14622: 29 f0 breq .+10 ; 0x1462e 14624: 8e ee ldi r24, 0xEE ; 238 14626: 93 e1 ldi r25, 0x13 ; 19 14628: 0e 94 92 85 call 0x10b24 ; 0x10b24 1462c: bf cf rjmp .-130 ; 0x145ac 1462e: 89 ed ldi r24, 0xD9 ; 217 14630: 93 e1 ldi r25, 0x13 ; 19 14632: fa cf rjmp .-12 ; 0x14628 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 14634: 8a e2 ldi r24, 0x2A ; 42 14636: 9e e7 ldi r25, 0x7E ; 126 14638: 0e 94 8d 7c call 0xf91a ; 0xf91a 1463c: d9 ce rjmp .-590 ; 0x143f0 /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1463e: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14642: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 14646: 04 96 adiw r24, 0x04 ; 4 14648: 0f 94 cc 77 call 0x2ef98 ; 0x2ef98 1464c: d1 ce rjmp .-606 ; 0x143f0 * 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; 1464e: ce 01 movw r24, r28 14650: 01 96 adiw r24, 0x01 ; 1 14652: 0f 94 c9 68 call 0x2d192 ; 0x2d192 14656: 88 23 and r24, r24 14658: 09 f4 brne .+2 ; 0x1465c 1465a: fe c8 rjmp .-3588 ; 0x13858 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1465c: 61 e0 ldi r22, 0x01 ; 1 1465e: ce 01 movw r24, r28 14660: 01 96 adiw r24, 0x01 ; 1 14662: 0f 94 23 2c call 0x25846 ; 0x25846 if (!d) goto fail; 14666: 00 97 sbiw r24, 0x00 ; 0 14668: 09 f4 brne .+2 ; 0x1466c 1466a: f6 c8 rjmp .-3604 ; 0x13858 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 1466c: 25 ee ldi r18, 0xE5 ; 229 1466e: fc 01 movw r30, r24 14670: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 14672: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 14674: 0f 94 17 27 call 0x24e2e ; 0x24e2e 14678: 18 2f mov r17, r24 1467a: ef c8 rjmp .-3618 ; 0x1385a presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 1467c: 84 e0 ldi r24, 0x04 ; 4 1467e: 9e e7 ldi r25, 0x7E ; 126 14680: 0e 94 94 7a call 0xf528 ; 0xf528 14684: 8c a1 ldd r24, Y+36 ; 0x24 14686: 9d a1 ldd r25, Y+37 ; 0x25 14688: 0e 94 86 85 call 0x10b0c ; 0x10b0c 1468c: 8e e2 ldi r24, 0x2E ; 46 1468e: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 14692: 0e 94 8c 7a call 0xf518 ; 0xf518 14696: ac ce rjmp .-680 ; 0x143f0 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14698: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 1469c: 81 11 cpse r24, r1 st_synchronize(); 1469e: 0f 94 b0 18 call 0x23160 ; 0x23160 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 146a2: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 146a6: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 146aa: 0c 5f subi r16, 0xFC ; 252 146ac: 1f 4f sbci r17, 0xFF ; 255 146ae: 61 e2 ldi r22, 0x21 ; 33 146b0: 70 e0 ldi r23, 0x00 ; 0 146b2: c8 01 movw r24, r16 146b4: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 if(namestartpos==NULL) 146b8: 00 97 sbiw r24, 0x00 ; 0 146ba: 19 f0 breq .+6 ; 0x146c2 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 146bc: 8c 01 movw r16, r24 146be: 0f 5f subi r16, 0xFF ; 255 146c0: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 146c2: 80 e5 ldi r24, 0x50 ; 80 146c4: 0e 94 f5 55 call 0xabea ; 0xabea 146c8: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 146ca: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 146ce: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 146d2: 08 17 cp r16, r24 146d4: 19 07 cpc r17, r25 146d6: 08 f4 brcc .+2 ; 0x146da call_procedure=false; //false alert, 'P' found within filename 146d8: f1 2c mov r15, r1 if( card.mounted ) 146da: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 146de: 88 23 and r24, r24 146e0: 09 f4 brne .+2 ; 0x146e4 146e2: 86 ce rjmp .-756 ; 0x143f0 { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 146e4: 61 e0 ldi r22, 0x01 ; 1 146e6: 6f 25 eor r22, r15 146e8: c8 01 movw r24, r16 146ea: 0f 94 b0 71 call 0x2e360 ; 0x2e360 if(code_seen('S')) 146ee: 83 e5 ldi r24, 0x53 ; 83 146f0: 0e 94 f5 55 call 0xabea ; 0xabea 146f4: 88 23 and r24, r24 146f6: 99 f0 breq .+38 ; 0x1471e if(strchr_pointer 146fc: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 14700: 80 17 cp r24, r16 14702: 91 07 cpc r25, r17 14704: 60 f4 brcc .+24 ; 0x1471e card.setIndex(code_value_long()); 14706: 0e 94 5d 56 call 0xacba ; 0xacba 1470a: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb 1470e: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec 14712: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed 14716: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee 1471a: 0f 94 e8 67 call 0x2cfd0 ; 0x2cfd0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 1471e: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 14722: 88 23 and r24, r24 14724: 31 f0 breq .+12 ; 0x14732 { sdprinting = true; 14726: 81 e0 ldi r24, 0x01 ; 1 14728: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 1472c: 85 e0 ldi r24, 0x05 ; 5 1472e: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> card.startFileprint(); if(!call_procedure) 14732: f1 10 cpse r15, r1 14734: 5d ce rjmp .-838 ; 0x143f0 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); }; 14736: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 1473a: 88 23 and r24, r24 1473c: 61 f0 breq .+24 ; 0x14756 { if(!card.get_sdpos()) 1473e: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 14742: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 14746: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 1474a: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee 1474e: 89 2b or r24, r25 14750: 8a 2b or r24, r26 14752: 8b 2b or r24, r27 14754: 69 f4 brne .+26 ; 0x14770 { // A new print has started from scratch, reset stats failstats_reset_print(); 14756: 0e 94 68 56 call 0xacd0 ; 0xacd0 sdpos_atomic = 0; 1475a: 10 92 49 12 sts 0x1249, r1 ; 0x801249 1475e: 10 92 4a 12 sts 0x124A, r1 ; 0x80124a 14762: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b 14766: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c 1476a: 80 e0 ldi r24, 0x00 ; 0 1476c: 0e 94 fc 83 call 0x107f8 ; 0x107f8 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 14770: 0f 94 da 16 call 0x22db4 ; 0x22db4 14774: 3d ce rjmp .-902 ; 0x143f0 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 14776: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 1477a: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc } } void CardReader::openLogFile(const char* name) { logging = true; 1477e: 21 e0 ldi r18, 0x01 ; 1 14780: 20 93 d6 13 sts 0x13D6, r18 ; 0x8013d6 openFileWrite(name); 14784: 05 96 adiw r24, 0x05 ; 5 14786: 0f 94 cc 77 call 0x2ef98 ; 0x2ef98 1478a: 32 ce rjmp .-924 ; 0x143f0 ### 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(); 1478c: 0f 94 22 15 call 0x22a44 ; 0x22a44 int16_t sec, min; min = t / 60; sec = t % 60; 14790: 2c e3 ldi r18, 0x3C ; 60 14792: 30 e0 ldi r19, 0x00 ; 0 14794: 40 e0 ldi r20, 0x00 ; 0 14796: 50 e0 ldi r21, 0x00 ; 0 14798: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 1479c: 7f 93 push r23 1479e: 6f 93 push r22 147a0: 3f 93 push r19 147a2: 2f 93 push r18 147a4: 86 e8 ldi r24, 0x86 ; 134 147a6: 90 e8 ldi r25, 0x80 ; 128 147a8: 9f 93 push r25 147aa: 8f 93 push r24 147ac: 8e 01 movw r16, r28 147ae: 0f 5f subi r16, 0xFF ; 255 147b0: 1f 4f sbci r17, 0xFF ; 255 147b2: 1f 93 push r17 147b4: 0f 93 push r16 147b6: 0f 94 b4 a2 call 0x34568 ; 0x34568 SERIAL_ECHO_START; 147ba: 8e ec ldi r24, 0xCE ; 206 147bc: 91 ea ldi r25, 0xA1 ; 161 147be: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(time); 147c2: c8 01 movw r24, r16 147c4: 0e 94 92 85 call 0x10b24 ; 0x10b24 lcd_setstatus(time); 147c8: c8 01 movw r24, r16 147ca: 0e 94 d9 dc call 0x1b9b2 ; 0x1b9b2 autotempShutdown(); 147ce: 0f b6 in r0, 0x3f ; 63 147d0: f8 94 cli 147d2: de bf out 0x3e, r29 ; 62 147d4: 0f be out 0x3f, r0 ; 63 147d6: cd bf out 0x3d, r28 ; 61 147d8: 0b ce rjmp .-1002 ; 0x143f0 } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 147da: 17 fd sbrc r17, 7 147dc: 09 ce rjmp .-1006 ; 0x143f0 147de: 80 c8 rjmp .-3840 ; 0x138e0 ### 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); 147e0: 80 e1 ldi r24, 0x10 ; 16 147e2: 0e 94 ea d4 call 0x1a9d4 ; 0x1a9d4 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 147e6: 81 ea ldi r24, 0xA1 ; 161 147e8: 9d e0 ldi r25, 0x0D ; 13 147ea: 0f 94 9d a3 call 0x3473a ; 0x3473a 147ee: 4b e0 ldi r20, 0x0B ; 11 147f0: 84 9f mul r24, r20 147f2: c0 01 movw r24, r0 147f4: 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); 147f6: 70 e0 ldi r23, 0x00 ; 0 147f8: 60 e0 ldi r22, 0x00 ; 0 147fa: 80 5b subi r24, 0xB0 ; 176 147fc: 92 4f sbci r25, 0xF2 ; 242 147fe: 0f 94 df a3 call 0x347be ; 0x347be // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 14802: 82 e0 ldi r24, 0x02 ; 2 14804: 0e 94 ea d4 call 0x1a9d4 ; 0x1a9d4 reset_bed_offset_and_skew(); 14808: 0e 94 1e 55 call 0xaa3c ; 0xaa3c // 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(); 1480c: 0e 94 fd 61 call 0xc3fa ; 0xc3fa 14810: ef cd rjmp .-1058 ; 0x143f0 */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 14812: 8a e5 ldi r24, 0x5A ; 90 14814: 0e 94 f5 55 call 0xabea ; 0xabea // 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); 14818: 0f 94 db 7c call 0x2f9b6 ; 0x2f9b6 1481c: e9 cd rjmp .-1070 ; 0x143f0 SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 1481e: 8a e4 ldi r24, 0x4A ; 74 14820: 90 e8 ldi r25, 0x80 ; 128 14822: 0e 94 94 7a call 0xf528 ; 0xf528 14826: e4 cd rjmp .-1080 ; 0x143f0 } } else { SERIAL_PROTOCOLLNPGM("n/a"); 14828: 86 e4 ldi r24, 0x46 ; 70 1482a: 90 e8 ldi r25, 0x80 ; 128 1482c: 0e 94 8d 7c call 0xf91a ; 0xf91a 14830: df cd rjmp .-1090 ; 0x143f0 /*! ### M47 - Show end stops dialog on the display M47: Show end stops dialog on the display */ #ifndef TMC2130 case 47: KEEPALIVE_STATE(PAUSED_FOR_USER); 14832: 84 e0 ldi r24, 0x04 ; 4 14834: 80 93 78 02 sts 0x0278, r24 ; 0x800278 menu_back_if_clicked(); } void lcd_diag_show_end_stops() { lcd_clear(); 14838: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_consume_click(); 1483c: 0e 94 40 73 call 0xe680 ; 0xe680 for (;;) { manage_heater(); 14840: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 14844: 81 e0 ldi r24, 0x01 ; 1 14846: 0e 94 25 8a call 0x1144a ; 0x1144a lcd_show_end_stops(); 1484a: 0e 94 37 dd call 0x1ba6e ; 0x1ba6e if (lcd_clicked()) { 1484e: 0e 94 45 73 call 0xe68a ; 0xe68a 14852: 88 23 and r24, r24 14854: a9 f3 breq .-22 ; 0x14840 break; } } lcd_clear(); 14856: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_return_to_status(); 1485a: 0f 94 6d 05 call 0x20ada ; 0x20ada 1485e: c8 cd rjmp .-1136 ; 0x143f0 14860: 10 92 61 0d sts 0x0D61, r1 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 14864: c5 cd rjmp .-1142 ; 0x143f0 break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 14866: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 1486a: 1f 92 push r1 1486c: 8f 93 push r24 1486e: 88 e2 ldi r24, 0x28 ; 40 14870: 96 e6 ldi r25, 0x66 ; 102 14872: 9f 93 push r25 14874: 8f 93 push r24 14876: 0f 94 5f a2 call 0x344be ; 0x344be 1487a: 0f 90 pop r0 1487c: 0f 90 pop r0 1487e: 0f 90 pop r0 14880: 0f 90 pop r0 14882: b6 cd rjmp .-1172 ; 0x143f0 - `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(); 14884: 80 e5 ldi r24, 0x50 ; 80 14886: 0e 94 f5 55 call 0xabea ; 0xabea 1488a: 88 23 and r24, r24 1488c: 21 f0 breq .+8 ; 0x14896 1488e: 0e 94 0a 56 call 0xac14 ; 0xac14 14892: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f if(code_seen('R')) print_time_remaining_normal = code_value(); 14896: 82 e5 ldi r24, 0x52 ; 82 14898: 0e 94 f5 55 call 0xabea ; 0xabea 1489c: 88 23 and r24, r24 1489e: 41 f0 breq .+16 ; 0x148b0 148a0: 0e 94 85 5a call 0xb50a ; 0xb50a 148a4: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 148a8: 70 93 73 02 sts 0x0273, r23 ; 0x800273 148ac: 60 93 72 02 sts 0x0272, r22 ; 0x800272 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 148b0: 81 e5 ldi r24, 0x51 ; 81 148b2: 0e 94 f5 55 call 0xabea ; 0xabea 148b6: 88 23 and r24, r24 148b8: 21 f0 breq .+8 ; 0x148c2 148ba: 0e 94 0a 56 call 0xac14 ; 0xac14 148be: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f if(code_seen('S')) print_time_remaining_silent = code_value(); 148c2: 83 e5 ldi r24, 0x53 ; 83 148c4: 0e 94 f5 55 call 0xabea ; 0xabea 148c8: 88 23 and r24, r24 148ca: 41 f0 breq .+16 ; 0x148dc 148cc: 0e 94 85 5a call 0xb50a ; 0xb50a 148d0: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 148d4: 70 93 3e 02 sts 0x023E, r23 ; 0x80023e 148d8: 60 93 3d 02 sts 0x023D, r22 ; 0x80023d if(code_seen('C')){ 148dc: 83 e4 ldi r24, 0x43 ; 67 148de: 0e 94 f5 55 call 0xabea ; 0xabea 148e2: 88 23 and r24, r24 148e4: a9 f0 breq .+42 ; 0x14910 float print_time_to_change_normal_f = code_value(); 148e6: 0e 94 85 5a call 0xb50a ; 0xb50a 148ea: 6b 01 movw r12, r22 148ec: 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; 148ee: 20 e0 ldi r18, 0x00 ; 0 148f0: 30 e0 ldi r19, 0x00 ; 0 148f2: a9 01 movw r20, r18 148f4: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 148f8: 6f ef ldi r22, 0xFF ; 255 148fa: 7f ef ldi r23, 0xFF ; 255 148fc: 18 16 cp r1, r24 148fe: 24 f4 brge .+8 ; 0x14908 14900: c7 01 movw r24, r14 14902: b6 01 movw r22, r12 14904: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 14908: 70 93 71 02 sts 0x0271, r23 ; 0x800271 1490c: 60 93 70 02 sts 0x0270, r22 ; 0x800270 } if(code_seen('D')){ 14910: 84 e4 ldi r24, 0x44 ; 68 14912: 0e 94 f5 55 call 0xabea ; 0xabea 14916: 88 23 and r24, r24 14918: a9 f0 breq .+42 ; 0x14944 float print_time_to_change_silent_f = code_value(); 1491a: 0e 94 85 5a call 0xb50a ; 0xb50a 1491e: 6b 01 movw r12, r22 14920: 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; 14922: 20 e0 ldi r18, 0x00 ; 0 14924: 30 e0 ldi r19, 0x00 ; 0 14926: a9 01 movw r20, r18 14928: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1492c: 6f ef ldi r22, 0xFF ; 255 1492e: 7f ef ldi r23, 0xFF ; 255 14930: 18 16 cp r1, r24 14932: 24 f4 brge .+8 ; 0x1493c 14934: c7 01 movw r24, r14 14936: b6 01 movw r22, r12 14938: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 1493c: 70 93 3c 02 sts 0x023C, r23 ; 0x80023c 14940: 60 93 3b 02 sts 0x023B, r22 ; 0x80023b } { 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); 14944: 80 91 71 02 lds r24, 0x0271 ; 0x800271 14948: 8f 93 push r24 1494a: 80 91 70 02 lds r24, 0x0270 ; 0x800270 1494e: 8f 93 push r24 14950: 80 91 73 02 lds r24, 0x0273 ; 0x800273 14954: 8f 93 push r24 14956: 80 91 72 02 lds r24, 0x0272 ; 0x800272 1495a: 8f 93 push r24 1495c: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 14960: 28 2f mov r18, r24 14962: 08 2e mov r0, r24 14964: 00 0c add r0, r0 14966: 33 0b sbc r19, r19 14968: 3f 93 push r19 1496a: 8f 93 push r24 1496c: 8e ec ldi r24, 0xCE ; 206 1496e: 95 e6 ldi r25, 0x65 ; 101 14970: 9f 93 push r25 14972: 8f 93 push r24 14974: 05 ed ldi r16, 0xD5 ; 213 14976: 15 e6 ldi r17, 0x65 ; 101 14978: 1f 93 push r17 1497a: 0f 93 push r16 1497c: 0f 94 5f a2 call 0x344be ; 0x344be printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 14980: 80 91 3c 02 lds r24, 0x023C ; 0x80023c 14984: 8f 93 push r24 14986: 80 91 3b 02 lds r24, 0x023B ; 0x80023b 1498a: 8f 93 push r24 1498c: 80 91 3e 02 lds r24, 0x023E ; 0x80023e 14990: 8f 93 push r24 14992: 80 91 3d 02 lds r24, 0x023D ; 0x80023d 14996: 8f 93 push r24 14998: 80 91 3f 02 lds r24, 0x023F ; 0x80023f 1499c: 28 2f mov r18, r24 1499e: 08 2e mov r0, r24 149a0: 00 0c add r0, r0 149a2: 33 0b sbc r19, r19 149a4: 3f 93 push r19 149a6: 8f 93 push r24 149a8: 87 ec ldi r24, 0xC7 ; 199 149aa: 95 e6 ldi r25, 0x65 ; 101 149ac: 9f 93 push r25 149ae: 8f 93 push r24 149b0: 1f 93 push r17 149b2: 0f 93 push r16 149b4: 0f 94 5f a2 call 0x344be ; 0x344be 149b8: 0f b6 in r0, 0x3f ; 63 149ba: f8 94 cli 149bc: de bf out 0x3e, r29 ; 62 149be: 0f be out 0x3f, r0 ; 63 149c0: cd bf out 0x3d, r28 ; 61 149c2: 16 cd rjmp .-1492 ; 0x143f0 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 149c4: 0e 94 e1 e8 call 0x1d1c2 ; 0x1d1c2 149c8: 88 23 and r24, r24 149ca: 09 f4 brne .+2 ; 0x149ce 149cc: 11 cd rjmp .-1502 ; 0x143f0 149ce: d0 ce rjmp .-608 ; 0x14770 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 149d0: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 149d4: 81 30 cpi r24, 0x01 ; 1 149d6: 09 f0 breq .+2 ; 0x149da 149d8: 0b cd rjmp .-1514 ; 0x143f0 state = PAUSED; 149da: 82 e0 ldi r24, 0x02 ; 2 149dc: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b stopTimestamp = _millis(); 149e0: 0f 94 56 0b call 0x216ac ; 0x216ac 149e4: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 149e8: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 149ec: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 149f0: 90 93 0e 06 sts 0x060E, r25 ; 0x80060e 149f4: fd cc rjmp .-1542 ; 0x143f0 /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 149f6: 0f 94 fe 16 call 0x22dfc ; 0x22dfc save_statistics(); 149fa: 0e 94 80 64 call 0xc900 ; 0xc900 149fe: f8 cc rjmp .-1552 ; 0x143f0 _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')) { 14a00: 83 e5 ldi r24, 0x53 ; 83 14a02: 0e 94 f5 55 call 0xabea ; 0xabea 14a06: 88 23 and r24, r24 14a08: 51 f0 breq .+20 ; 0x14a1e eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); 14a0a: 0e 94 85 5a call 0xb50a ; 0xb50a 14a0e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 14a12: ab 01 movw r20, r22 14a14: 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); 14a16: 81 ef ldi r24, 0xF1 ; 241 14a18: 9f e0 ldi r25, 0x0F ; 15 14a1a: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 } if (code_seen('T')) { 14a1e: 84 e5 ldi r24, 0x54 ; 84 14a20: 0e 94 f5 55 call 0xabea ; 0xabea 14a24: 88 23 and r24, r24 14a26: 51 f0 breq .+20 ; 0x14a3c eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); 14a28: 0e 94 85 5a call 0xb50a ; 0xb50a 14a2c: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 14a30: ab 01 movw r20, r22 14a32: bc 01 movw r22, r24 14a34: 8d ee ldi r24, 0xED ; 237 14a36: 9f e0 ldi r25, 0x0F ; 15 14a38: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); 14a3c: 81 ef ldi r24, 0xF1 ; 241 14a3e: 9f e0 ldi r25, 0x0F ; 15 14a40: 0f 94 a5 a3 call 0x3474a ; 0x3474a 14a44: 16 2f mov r17, r22 14a46: 07 2f mov r16, r23 14a48: f8 2e mov r15, r24 14a4a: e9 2e mov r14, r25 _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); 14a4c: 8d ee ldi r24, 0xED ; 237 14a4e: 9f e0 ldi r25, 0x0F ; 15 14a50: 0f 94 a5 a3 call 0x3474a ; 0x3474a } 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); 14a54: 4e ea ldi r20, 0xAE ; 174 14a56: 58 e5 ldi r21, 0x58 ; 88 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); 14a58: 2d e9 ldi r18, 0x9D ; 157 14a5a: 38 e5 ldi r19, 0x58 ; 88 14a5c: 0c 94 10 9d jmp 0x13a20 ; 0x13a20 void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 14a60: 8c e8 ldi r24, 0x8C ; 140 14a62: 93 e0 ldi r25, 0x03 ; 3 14a64: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 14a68: 83 e5 ldi r24, 0x53 ; 83 14a6a: 0e 94 f5 55 call 0xabea ; 0xabea 14a6e: 88 23 and r24, r24 14a70: 09 f1 breq .+66 ; 0x14ab4 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 14a72: 62 e2 ldi r22, 0x22 ; 34 14a74: 70 e0 ldi r23, 0x00 ; 0 14a76: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14a7a: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 14a7e: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 14a82: 8c 01 movw r16, r24 if (!this->ptr) { 14a84: 89 2b or r24, r25 14a86: b1 f0 breq .+44 ; 0x14ab4 // First quote not found return; } // Skip the leading quote this->ptr++; 14a88: 0f 5f subi r16, 0xFF ; 255 14a8a: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 14a8c: 62 e2 ldi r22, 0x22 ; 34 14a8e: 70 e0 ldi r23, 0x00 ; 0 14a90: c8 01 movw r24, r16 14a92: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 if(!pStrEnd) { 14a96: 89 2b or r24, r25 14a98: 69 f0 breq .+26 ; 0x14ab4 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 14a9a: e5 e0 ldi r30, 0x05 ; 5 14a9c: f6 e0 ldi r31, 0x06 ; 6 14a9e: 83 e0 ldi r24, 0x03 ; 3 14aa0: df 01 movw r26, r30 14aa2: 1d 92 st X+, r1 14aa4: 8a 95 dec r24 14aa6: e9 f7 brne .-6 ; 0x14aa2 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 14aa8: 42 e0 ldi r20, 0x02 ; 2 14aaa: 50 e0 ldi r21, 0x00 ; 0 14aac: b8 01 movw r22, r16 14aae: cf 01 movw r24, r30 14ab0: 0f 94 1d aa call 0x3543a ; 0x3543a } #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 14ab4: 8c e8 ldi r24, 0x8C ; 140 14ab6: 9f e0 ldi r25, 0x0F ; 15 14ab8: 0f 94 9d a3 call 0x3473a ; 0x3473a && printer_recovering() && printingIsPaused()) { 14abc: 81 30 cpi r24, 0x01 ; 1 14abe: 09 f0 breq .+2 ; 0x14ac2 14ac0: 97 cc rjmp .-1746 ; 0x143f0 #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() 14ac2: 0e 94 fb 65 call 0xcbf6 ; 0xcbf6 14ac6: 88 23 and r24, r24 14ac8: 09 f4 brne .+2 ; 0x14acc 14aca: 92 cc rjmp .-1756 ; 0x143f0 && printingIsPaused()) { 14acc: 0e 94 05 66 call 0xcc0a ; 0xcc0a 14ad0: 88 23 and r24, r24 14ad2: 09 f4 brne .+2 ; 0x14ad6 14ad4: 8d cc rjmp .-1766 ; 0x143f0 // 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) { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 14ad6: 84 e9 ldi r24, 0x94 ; 148 14ad8: 95 e6 ldi r25, 0x65 ; 101 14ada: 0e 94 8d 7c call 0xf91a ; 0xf91a 14ade: 88 cc rjmp .-1776 ; 0x143f0 /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 14ae0: 87 e7 ldi r24, 0x77 ; 119 14ae2: 95 e6 ldi r25, 0x65 ; 101 14ae4: 0e 94 f3 82 call 0x105e6 ; 0x105e6 #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 14ae8: 83 e5 ldi r24, 0x53 ; 83 14aea: 0e 94 f5 55 call 0xabea ; 0xabea 14aee: 88 23 and r24, r24 14af0: 09 f4 brne .+2 ; 0x14af4 14af2: 7e cc rjmp .-1796 ; 0x143f0 14af4: 0e 94 85 5a call 0xb50a ; 0xb50a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 14af8: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 14afc: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 14b00: 60 93 59 12 sts 0x1259, r22 ; 0x801259 14b04: 75 cc rjmp .-1814 ; 0x143f0 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 "); 14b06: 82 e4 ldi r24, 0x42 ; 66 14b08: 90 e8 ldi r25, 0x80 ; 128 14b0a: 0e 94 94 7a call 0xf528 ; 0xf528 gcode_M105(); 14b0e: 0e 94 06 7c call 0xf80c ; 0xf80c cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 14b12: 0e 94 13 79 call 0xf226 ; 0xf226 cmdbuffer_front_already_processed = true; 14b16: 81 e0 ldi r24, 0x01 ; 1 14b18: 80 93 53 12 sts 0x1253, r24 ; 0x801253 14b1c: 69 cc rjmp .-1838 ; 0x143f0 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 14b1e: 83 e5 ldi r24, 0x53 ; 83 14b20: 0e 94 f5 55 call 0xabea ; 0xabea 14b24: 88 23 and r24, r24 14b26: 51 f0 breq .+20 ; 0x14b3c autoReportFeatures.SetPeriod( code_value_uint8() ); 14b28: 0e 94 0a 56 call 0xac14 ; 0xac14 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; 14b2c: 80 93 cf 13 sts 0x13CF, r24 ; 0x8013cf if (auto_report_period != 0){ 14b30: 88 23 and r24, r24 14b32: 71 f0 breq .+28 ; 0x14b50 auto_report_timer.start(); 14b34: 80 ed ldi r24, 0xD0 ; 208 14b36: 93 e1 ldi r25, 0x13 ; 19 14b38: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 14b3c: 83 e4 ldi r24, 0x43 ; 67 14b3e: 0e 94 f5 55 call 0xabea ; 0xabea 14b42: 88 23 and r24, r24 14b44: 41 f0 breq .+16 ; 0x14b56 autoReportFeatures.SetMask(code_value_uint8()); 14b46: 0e 94 0a 56 call 0xac14 ; 0xac14 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; } 14b4a: 80 93 ce 13 sts 0x13CE, r24 ; 0x8013ce 14b4e: 50 cc rjmp .-1888 ; 0x143f0 14b50: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 14b54: f3 cf rjmp .-26 ; 0x14b3c 14b56: 81 e0 ldi r24, 0x01 ; 1 14b58: 80 93 ce 13 sts 0x13CE, r24 ; 0x8013ce 14b5c: 49 cc rjmp .-1902 ; 0x143f0 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)); 14b5e: 85 e7 ldi r24, 0x75 ; 117 14b60: 96 e5 ldi r25, 0x56 ; 86 14b62: 0e 94 0a 75 call 0xea14 ; 0xea14 14b66: 0e 94 85 dc call 0x1b90a ; 0x1b90a heating_status = HeatingStatus::EXTRUDER_HEATING; 14b6a: 81 e0 ldi r24, 0x01 ; 1 14b6c: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(1); 14b70: 0f 94 02 30 call 0x26004 ; 0x26004 #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 14b74: 83 e5 ldi r24, 0x53 ; 83 14b76: 0e 94 f5 55 call 0xabea ; 0xabea 14b7a: 88 23 and r24, r24 14b7c: 49 f0 breq .+18 ; 0x14b90 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 14b7e: 0e 94 85 5a call 0xb50a ; 0xb50a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14b82: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 14b86: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 14b8a: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 14b8e: 05 c0 rjmp .+10 ; 0x14b9a #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 14b90: 82 e5 ldi r24, 0x52 ; 82 14b92: 0e 94 f5 55 call 0xabea ; 0xabea 14b96: 81 11 cpse r24, r1 14b98: f2 cf rjmp .-28 ; 0x14b7e autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 14b9a: 0f 94 56 0b call 0x216ac ; 0x216ac 14b9e: 6b 01 movw r12, r22 14ba0: 7c 01 movw r14, r24 FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 14ba2: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 14ba6: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 14baa: 07 2e mov r0, r23 14bac: 00 0c add r0, r0 14bae: 88 0b sbc r24, r24 14bb0: 99 0b sbc r25, r25 14bb2: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 14bb6: 11 e0 ldi r17, 0x01 ; 1 14bb8: 20 91 5a 0d lds r18, 0x0D5A ; 0x800d5a 14bbc: 30 91 5b 0d lds r19, 0x0D5B ; 0x800d5b 14bc0: 40 91 5c 0d lds r20, 0x0D5C ; 0x800d5c 14bc4: 50 91 5d 0d lds r21, 0x0D5D ; 0x800d5d 14bc8: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 14bcc: 18 16 cp r1, r24 14bce: 0c f0 brlt .+2 ; 0x14bd2 14bd0: 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 14bd2: 10 93 59 0d sts 0x0D59, r17 ; 0x800d59 <_ZL16target_direction.lto_priv.490> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 14bd6: c7 01 movw r24, r14 14bd8: b6 01 movw r22, r12 14bda: 0f 94 42 74 call 0x2e884 ; 0x2e884 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 14bde: 85 e6 ldi r24, 0x65 ; 101 14be0: 96 e5 ldi r25, 0x56 ; 86 14be2: 0e 94 0a 75 call 0xea14 ; 0xea14 14be6: 0e 94 85 dc call 0x1b90a ; 0x1b90a heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 14bea: 82 e0 ldi r24, 0x02 ; 2 14bec: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(2); 14bf0: 0f 94 02 30 call 0x26004 ; 0x26004 previous_millis_cmd.start(); 14bf4: 88 e4 ldi r24, 0x48 ; 72 14bf6: 93 e0 ldi r25, 0x03 ; 3 14bf8: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> 14bfc: f9 cb rjmp .-2062 ; 0x143f0 */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 14bfe: 87 e5 ldi r24, 0x57 ; 87 14c00: 96 e5 ldi r25, 0x56 ; 86 14c02: 0e 94 0a 75 call 0xea14 ; 0xea14 14c06: 0e 94 85 dc call 0x1b90a ; 0x1b90a heating_status = HeatingStatus::BED_HEATING; 14c0a: 83 e0 ldi r24, 0x03 ; 3 14c0c: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(1); 14c10: 81 e0 ldi r24, 0x01 ; 1 14c12: 0f 94 02 30 call 0x26004 ; 0x26004 if (code_seen('S')) 14c16: 83 e5 ldi r24, 0x53 ; 83 14c18: 0e 94 f5 55 call 0xabea ; 0xabea 14c1c: 18 2f mov r17, r24 14c1e: 88 23 and r24, r24 14c20: 49 f0 breq .+18 ; 0x14c34 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 14c22: 0e 94 85 5a call 0xb50a ; 0xb50a target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 14c26: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 14c2a: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 14c2e: 60 93 59 12 sts 0x1259, r22 ; 0x801259 14c32: 05 c0 rjmp .+10 ; 0x14c3e if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 14c34: 82 e5 ldi r24, 0x52 ; 82 14c36: 0e 94 f5 55 call 0xabea ; 0xabea 14c3a: 81 11 cpse r24, r1 14c3c: f2 cf rjmp .-28 ; 0x14c22 { setTargetBed(code_value()); } codenum = _millis(); 14c3e: 0f 94 56 0b call 0x216ac ; 0x216ac 14c42: 6b 01 movw r12, r22 14c44: 7c 01 movw r14, r24 cancel_heatup = false; 14c46: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.392> 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; 14c4a: 60 91 59 12 lds r22, 0x1259 ; 0x801259 14c4e: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 14c52: 07 2e mov r0, r23 14c54: 00 0c add r0, r0 14c56: 88 0b sbc r24, r24 14c58: 99 0b sbc r25, r25 14c5a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 14c5e: 01 e0 ldi r16, 0x01 ; 1 14c60: 20 91 bc 03 lds r18, 0x03BC ; 0x8003bc 14c64: 30 91 bd 03 lds r19, 0x03BD ; 0x8003bd 14c68: 40 91 be 03 lds r20, 0x03BE ; 0x8003be 14c6c: 50 91 bf 03 lds r21, 0x03BF ; 0x8003bf 14c70: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 14c74: 18 16 cp r1, r24 14c76: 0c f0 brlt .+2 ; 0x14c7a 14c78: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 14c7a: 00 93 59 0d sts 0x0D59, r16 ; 0x800d59 <_ZL16target_direction.lto_priv.490> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 14c7e: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.392> 14c82: 81 11 cpse r24, r1 14c84: 1a c0 rjmp .+52 ; 0x14cba 14c86: 60 91 59 12 lds r22, 0x1259 ; 0x801259 14c8a: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 14c8e: 07 2e mov r0, r23 14c90: 00 0c add r0, r0 14c92: 88 0b sbc r24, r24 14c94: 99 0b sbc r25, r25 14c96: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 14c9a: 20 91 bc 03 lds r18, 0x03BC ; 0x8003bc 14c9e: 30 91 bd 03 lds r19, 0x03BD ; 0x8003bd 14ca2: 40 91 be 03 lds r20, 0x03BE ; 0x8003be 14ca6: 50 91 bf 03 lds r21, 0x03BF ; 0x8003bf 14caa: e0 91 59 0d lds r30, 0x0D59 ; 0x800d59 <_ZL16target_direction.lto_priv.490> 14cae: ee 23 and r30, r30 14cb0: 91 f0 breq .+36 ; 0x14cd6 14cb2: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 14cb6: 18 16 cp r1, r24 14cb8: a4 f0 brlt .+40 ; 0x14ce2 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 14cba: 8c e4 ldi r24, 0x4C ; 76 14cbc: 96 e5 ldi r25, 0x56 ; 86 14cbe: 0e 94 0a 75 call 0xea14 ; 0xea14 14cc2: 0e 94 85 dc call 0x1b90a ; 0x1b90a heating_status = HeatingStatus::BED_HEATING_COMPLETE; 14cc6: 84 e0 ldi r24, 0x04 ; 4 14cc8: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb previous_millis_cmd.start(); 14ccc: 88 e4 ldi r24, 0x48 ; 72 14cce: 93 e0 ldi r25, 0x03 ; 3 14cd0: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> 14cd4: 8d cb rjmp .-2278 ; 0x143f0 codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 14cd6: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 14cda: 87 ff sbrs r24, 7 14cdc: ee cf rjmp .-36 ; 0x14cba 14cde: 11 11 cpse r17, r1 14ce0: ec cf rjmp .-40 ; 0x14cba { if (lcd_commands_type == LcdCommands::LongPause) { 14ce2: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 14ce6: 82 30 cpi r24, 0x02 ; 2 14ce8: 41 f3 breq .-48 ; 0x14cba // 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. 14cea: 0f 94 56 0b call 0x216ac ; 0x216ac 14cee: 6c 19 sub r22, r12 14cf0: 7d 09 sbc r23, r13 14cf2: 8e 09 sbc r24, r14 14cf4: 9f 09 sbc r25, r15 14cf6: 69 3e cpi r22, 0xE9 ; 233 14cf8: 73 40 sbci r23, 0x03 ; 3 14cfa: 81 05 cpc r24, r1 14cfc: 91 05 cpc r25, r1 14cfe: 50 f0 brcs .+20 ; 0x14d14 { if (!farm_mode) { 14d00: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 14d04: 81 11 cpse r24, r1 14d06: 02 c0 rjmp .+4 ; 0x14d0c serialecho_temperatures(); 14d08: 0e 94 a2 7a call 0xf544 ; 0xf544 } codenum = _millis(); 14d0c: 0f 94 56 0b call 0x216ac ; 0x216ac 14d10: 6b 01 movw r12, r22 14d12: 7c 01 movw r14, r24 } manage_heater(); 14d14: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(); 14d18: 80 e0 ldi r24, 0x00 ; 0 14d1a: 0e 94 25 8a call 0x1144a ; 0x1144a lcd_update(0); 14d1e: 80 e0 ldi r24, 0x00 ; 0 14d20: 0e 94 c9 6e call 0xdd92 ; 0xdd92 14d24: ac cf rjmp .-168 ; 0x14c7e #### 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')){ 14d26: 83 e5 ldi r24, 0x53 ; 83 14d28: 0e 94 f5 55 call 0xabea ; 0xabea 14d2c: 88 23 and r24, r24 14d2e: 29 f0 breq .+10 ; 0x14d3a fanSpeed = code_value_uint8(); 14d30: 0e 94 0a 56 call 0xac14 ; 0xac14 14d34: 80 93 55 12 sts 0x1255, r24 ; 0x801255 14d38: 5b cb rjmp .-2378 ; 0x143f0 } else { fanSpeed = 255; 14d3a: 8f ef ldi r24, 0xFF ; 255 14d3c: 80 93 55 12 sts 0x1255, r24 ; 0x801255 14d40: 57 cb rjmp .-2386 ; 0x143f0 /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 14d42: 10 92 55 12 sts 0x1255, r1 ; 0x801255 14d46: 54 cb rjmp .-2392 ; 0x143f0 /*! ### 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; 14d48: 80 91 57 12 lds r24, 0x1257 ; 0x801257 14d4c: 87 7f andi r24, 0xF7 ; 247 14d4e: 80 93 57 12 sts 0x1257, r24 ; 0x801257 14d52: 4e cb rjmp .-2404 ; 0x143f0 ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 14d54: 83 e5 ldi r24, 0x53 ; 83 14d56: 0e 94 f5 55 call 0xabea ; 0xabea 14d5a: 88 23 and r24, r24 14d5c: 99 f0 breq .+38 ; 0x14d84 stepper_inactive_time = code_value() * 1000; 14d5e: 0e 94 85 5a call 0xb50a ; 0xb50a 14d62: 20 e0 ldi r18, 0x00 ; 0 14d64: 30 e0 ldi r19, 0x00 ; 0 14d66: 4a e7 ldi r20, 0x7A ; 122 14d68: 54 e4 ldi r21, 0x44 ; 68 14d6a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 14d6e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 14d72: 60 93 37 02 sts 0x0237, r22 ; 0x800237 14d76: 70 93 38 02 sts 0x0238, r23 ; 0x800238 14d7a: 80 93 39 02 sts 0x0239, r24 ; 0x800239 14d7e: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 14d82: 36 cb rjmp .-2452 ; 0x143f0 } 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]))); 14d84: 88 e5 ldi r24, 0x58 ; 88 14d86: 0e 94 f5 55 call 0xabea ; 0xabea 14d8a: 88 23 and r24, r24 14d8c: d1 f0 breq .+52 ; 0x14dc2 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 14d8e: 0f 94 b0 18 call 0x23160 ; 0x23160 if (code_seen('X')) disable_x(); 14d92: 88 e5 ldi r24, 0x58 ; 88 14d94: 0e 94 f5 55 call 0xabea ; 0xabea 14d98: 81 11 cpse r24, r1 14d9a: 28 c0 rjmp .+80 ; 0x14dec if (code_seen('Y')) disable_y(); 14d9c: 89 e5 ldi r24, 0x59 ; 89 14d9e: 0e 94 f5 55 call 0xabea ; 0xabea 14da2: 88 23 and r24, r24 14da4: 19 f0 breq .+6 ; 0x14dac 14da6: 16 9a sbi 0x02, 6 ; 2 14da8: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a if (code_seen('Z')) disable_z(); 14dac: 8a e5 ldi r24, 0x5A ; 90 14dae: 0e 94 f5 55 call 0xabea ; 0xabea #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 14db2: 85 e4 ldi r24, 0x45 ; 69 14db4: 0e 94 f5 55 call 0xabea ; 0xabea 14db8: 88 23 and r24, r24 14dba: 09 f4 brne .+2 ; 0x14dbe 14dbc: 19 cb rjmp .-2510 ; 0x143f0 14dbe: 14 9a sbi 0x02, 4 ; 2 14dc0: 17 cb rjmp .-2514 ; 0x143f0 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]))); 14dc2: 89 e5 ldi r24, 0x59 ; 89 14dc4: 0e 94 f5 55 call 0xabea ; 0xabea 14dc8: 81 11 cpse r24, r1 14dca: e1 cf rjmp .-62 ; 0x14d8e 14dcc: 8a e5 ldi r24, 0x5A ; 90 14dce: 0e 94 f5 55 call 0xabea ; 0xabea 14dd2: 81 11 cpse r24, r1 14dd4: dc cf rjmp .-72 ; 0x14d8e 14dd6: 85 e4 ldi r24, 0x45 ; 69 14dd8: 0e 94 f5 55 call 0xabea ; 0xabea 14ddc: 81 11 cpse r24, r1 14dde: d7 cf rjmp .-82 ; 0x14d8e if(all_axis) { st_synchronize(); 14de0: 0f 94 b0 18 call 0x23160 ; 0x23160 disable_e0(); 14de4: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 14de6: 0e 94 4d 84 call 0x1089a ; 0x1089a 14dea: 02 cb rjmp .-2556 ; 0x143f0 } else { st_synchronize(); if (code_seen('X')) disable_x(); 14dec: 17 9a sbi 0x02, 7 ; 2 14dee: 10 92 39 06 sts 0x0639, r1 ; 0x800639 14df2: d4 cf rjmp .-88 ; 0x14d9c #### 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')) { 14df4: 83 e5 ldi r24, 0x53 ; 83 14df6: 0e 94 f5 55 call 0xabea ; 0xabea 14dfa: 88 23 and r24, r24 14dfc: 09 f4 brne .+2 ; 0x14e00 14dfe: f8 ca rjmp .-2576 ; 0x143f0 max_inactive_time = code_value() * 1000; 14e00: 0e 94 85 5a call 0xb50a ; 0xb50a 14e04: 20 e0 ldi r18, 0x00 ; 0 14e06: 30 e0 ldi r19, 0x00 ; 0 14e08: 4a e7 ldi r20, 0x7A ; 122 14e0a: 54 e4 ldi r21, 0x44 ; 68 14e0c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 14e10: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 14e14: 60 93 44 03 sts 0x0344, r22 ; 0x800344 14e18: 70 93 45 03 sts 0x0345, r23 ; 0x800345 14e1c: 80 93 46 03 sts 0x0346, r24 ; 0x800346 14e20: 90 93 47 03 sts 0x0347, r25 ; 0x800347 14e24: e5 ca rjmp .-2614 ; 0x143f0 14e26: 34 ec ldi r19, 0xC4 ; 196 14e28: 83 2e mov r8, r19 14e2a: 32 e0 ldi r19, 0x02 ; 2 14e2c: 93 2e mov r9, r19 14e2e: 47 e6 ldi r20, 0x67 ; 103 14e30: a4 2e mov r10, r20 14e32: 4d e0 ldi r20, 0x0D ; 13 14e34: b4 2e mov r11, r20 - `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++) 14e36: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 14e38: f4 01 movw r30, r8 14e3a: 81 91 ld r24, Z+ 14e3c: 4f 01 movw r8, r30 14e3e: 0e 94 f5 55 call 0xabea ; 0xabea 14e42: 88 23 and r24, r24 14e44: 09 f4 brne .+2 ; 0x14e48 14e46: 67 c0 rjmp .+206 ; 0x14f16 { float value = code_value(); 14e48: 0e 94 85 5a call 0xb50a ; 0xb50a 14e4c: 6b 01 movw r12, r22 14e4e: 7c 01 movw r14, r24 if(i == E_AXIS) { // E 14e50: 13 30 cpi r17, 0x03 ; 3 14e52: 09 f0 breq .+2 ; 0x14e56 14e54: 6a c0 rjmp .+212 ; 0x14f2a if(value < 20.0) { 14e56: 20 e0 ldi r18, 0x00 ; 0 14e58: 30 e0 ldi r19, 0x00 ; 0 14e5a: 40 ea ldi r20, 0xA0 ; 160 14e5c: 51 e4 ldi r21, 0x41 ; 65 14e5e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 14e62: 87 ff sbrs r24, 7 14e64: 4e c0 rjmp .+156 ; 0x14f02 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 14e66: a7 01 movw r20, r14 14e68: 96 01 movw r18, r12 14e6a: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 14e6e: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 14e72: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 14e76: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 14e7a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 14e7e: 2b 01 movw r4, r22 14e80: 3c 01 movw r6, r24 cs.max_jerk[E_AXIS] *= factor; 14e82: ac 01 movw r20, r24 14e84: 9b 01 movw r18, r22 14e86: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 14e8a: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 14e8e: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 14e92: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 14e96: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 14e9a: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 14e9e: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 14ea2: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 14ea6: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe max_feedrate[E_AXIS] *= factor; 14eaa: a3 01 movw r20, r6 14eac: 92 01 movw r18, r4 14eae: 60 91 87 0d lds r22, 0x0D87 ; 0x800d87 14eb2: 70 91 88 0d lds r23, 0x0D88 ; 0x800d88 14eb6: 80 91 89 0d lds r24, 0x0D89 ; 0x800d89 14eba: 90 91 8a 0d lds r25, 0x0D8A ; 0x800d8a 14ebe: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 14ec2: 60 93 87 0d sts 0x0D87, r22 ; 0x800d87 14ec6: 70 93 88 0d sts 0x0D88, r23 ; 0x800d88 14eca: 80 93 89 0d sts 0x0D89, r24 ; 0x800d89 14ece: 90 93 8a 0d sts 0x0D8A, r25 ; 0x800d8a max_acceleration_steps_per_s2[E_AXIS] *= factor; 14ed2: 60 91 b7 04 lds r22, 0x04B7 ; 0x8004b7 14ed6: 70 91 b8 04 lds r23, 0x04B8 ; 0x8004b8 14eda: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 14ede: 90 91 ba 04 lds r25, 0x04BA ; 0x8004ba 14ee2: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 14ee6: a3 01 movw r20, r6 14ee8: 92 01 movw r18, r4 14eea: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 14eee: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 14ef2: 60 93 b7 04 sts 0x04B7, r22 ; 0x8004b7 14ef6: 70 93 b8 04 sts 0x04B8, r23 ; 0x8004b8 14efa: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 14efe: 90 93 ba 04 sts 0x04BA, r25 ; 0x8004ba } cs.axis_steps_per_mm[E_AXIS] = value; 14f02: c0 92 77 0d sts 0x0D77, r12 ; 0x800d77 14f06: d0 92 78 0d sts 0x0D78, r13 ; 0x800d78 14f0a: e0 92 79 0d sts 0x0D79, r14 ; 0x800d79 14f0e: f0 92 7a 0d sts 0x0D7A, r15 ; 0x800d7a #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.init(); 14f12: 0f 94 86 6d call 0x2db0c ; 0x2db0c 14f16: b4 e0 ldi r27, 0x04 ; 4 14f18: ab 0e add r10, r27 14f1a: b1 1c adc r11, r1 14f1c: 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++) 14f1e: 14 30 cpi r17, 0x04 ; 4 14f20: 09 f0 breq .+2 ; 0x14f24 14f22: 8a cf rjmp .-236 ; 0x14e38 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 14f24: 0f 94 2f 3a call 0x2745e ; 0x2745e 14f28: 63 ca rjmp .-2874 ; 0x143f0 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; 14f2a: d5 01 movw r26, r10 14f2c: 14 96 adiw r26, 0x04 ; 4 14f2e: cd 92 st X+, r12 14f30: dd 92 st X+, r13 14f32: ed 92 st X+, r14 14f34: fc 92 st X, r15 14f36: 17 97 sbiw r26, 0x07 ; 7 14f38: ee cf rjmp .-36 ; 0x14f16 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 14f3a: 83 e5 ldi r24, 0x53 ; 83 14f3c: 0e 94 f5 55 call 0xabea ; 0xabea 14f40: 88 23 and r24, r24 14f42: 29 f0 breq .+10 ; 0x14f4e host_keepalive_interval = code_value_uint8(); 14f44: 0e 94 0a 56 call 0xac14 ; 0xac14 14f48: 80 93 32 02 sts 0x0232, r24 ; 0x800232 14f4c: 51 ca rjmp .-2910 ; 0x143f0 } else { SERIAL_ECHO_START; 14f4e: 8e ec ldi r24, 0xCE ; 206 14f50: 91 ea ldi r25, 0xA1 ; 161 14f52: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 14f56: c0 90 32 02 lds r12, 0x0232 ; 0x800232 14f5a: d1 2c mov r13, r1 14f5c: f1 2c mov r15, r1 14f5e: 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); } 14f60: 8b e3 ldi r24, 0x3B ; 59 14f62: 90 e8 ldi r25, 0x80 ; 128 14f64: 0e 94 94 7a call 0xf528 ; 0xf528 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 14f68: 4a e0 ldi r20, 0x0A ; 10 14f6a: c7 01 movw r24, r14 14f6c: b6 01 movw r22, r12 14f6e: 0e 94 95 79 call 0xf32a ; 0xf32a host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 14f72: 0e 94 8c 7a call 0xf518 ; 0xf518 14f76: 3c ca rjmp .-2952 ; 0x143f0 */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 14f78: 85 e5 ldi r24, 0x55 ; 85 14f7a: 0e 94 f5 55 call 0xabea ; 0xabea 14f7e: 88 23 and r24, r24 14f80: 09 f4 brne .+2 ; 0x14f84 14f82: 5a c0 rjmp .+180 ; 0x15038 // 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); 14f84: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 14f88: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 14f8c: 0f 5f subi r16, 0xFF ; 255 14f8e: 1f 4f sbci r17, 0xFF ; 255 14f90: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 14f94: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 14f98: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 14f9c: 88 23 and r24, r24 14f9e: 09 f4 brne .+2 ; 0x14fa2 14fa0: 27 ca rjmp .-2994 ; 0x143f0 // 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)) 14fa2: be 01 movw r22, r28 14fa4: 6f 5f subi r22, 0xFF ; 255 14fa6: 7f 4f sbci r23, 0xFF ; 255 14fa8: c8 01 movw r24, r16 14faa: 0e 94 8c d7 call 0x1af18 ; 0x1af18 14fae: 88 23 and r24, r24 14fb0: 09 f4 brne .+2 ; 0x14fb4 14fb2: 1e ca rjmp .-3012 ; 0x143f0 14fb4: 83 e1 ldi r24, 0x13 ; 19 14fb6: 97 e8 ldi r25, 0x87 ; 135 14fb8: de 01 movw r26, r28 14fba: 11 96 adiw r26, 0x01 ; 1 14fbc: be 01 movw r22, r28 14fbe: 67 5f subi r22, 0xF7 ; 247 14fc0: 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]); 14fc2: fc 01 movw r30, r24 14fc4: 45 91 lpm r20, Z+ 14fc6: 54 91 lpm r21, Z if (ver_gcode[i] > v) 14fc8: 2d 91 ld r18, X+ 14fca: 3d 91 ld r19, X+ 14fcc: 42 17 cp r20, r18 14fce: 53 07 cpc r21, r19 14fd0: 10 f4 brcc .+4 ; 0x14fd6 14fd2: 0c 94 21 ba jmp 0x17442 ; 0x17442 return 1; else if (ver_gcode[i] < v) 14fd6: 24 17 cp r18, r20 14fd8: 35 07 cpc r19, r21 14fda: 08 f4 brcc .+2 ; 0x14fde 14fdc: 09 ca rjmp .-3054 ; 0x143f0 14fde: 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) 14fe0: a6 17 cp r26, r22 14fe2: b7 07 cpc r27, r23 14fe4: 71 f7 brne .-36 ; 0x14fc2 14fe6: 04 ca rjmp .-3064 ; 0x143f0 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)); 14fe8: 8f e0 ldi r24, 0x0F ; 15 14fea: 99 e3 ldi r25, 0x39 ; 57 14fec: 0e 94 0a 75 call 0xea14 ; 0xea14 14ff0: ac 01 movw r20, r24 14ff2: 63 e0 ldi r22, 0x03 ; 3 14ff4: 80 e0 ldi r24, 0x00 ; 0 14ff6: 0e 94 d7 6f call 0xdfae ; 0xdfae Sound_MakeCustom(50,1000,false); 14ffa: 40 e0 ldi r20, 0x00 ; 0 14ffc: 68 ee ldi r22, 0xE8 ; 232 14ffe: 73 e0 ldi r23, 0x03 ; 3 15000: 82 e3 ldi r24, 0x32 ; 50 15002: 90 e0 ldi r25, 0x00 ; 0 15004: 0f 94 55 25 call 0x24aaa ; 0x24aaa delay_keep_alive(500); 15008: 84 ef ldi r24, 0xF4 ; 244 1500a: 91 e0 ldi r25, 0x01 ; 1 1500c: 0e 94 7f 8c call 0x118fe ; 0x118fe Sound_MakeCustom(50,1000,false); 15010: 40 e0 ldi r20, 0x00 ; 0 15012: 68 ee ldi r22, 0xE8 ; 232 15014: 73 e0 ldi r23, 0x03 ; 3 15016: 82 e3 ldi r24, 0x32 ; 50 15018: 90 e0 ldi r25, 0x00 ; 0 1501a: 0f 94 55 25 call 0x24aaa ; 0x24aaa lcd_wait_for_click_delay(30); 1501e: 8e e1 ldi r24, 0x1E ; 30 15020: 90 e0 ldi r25, 0x00 ; 0 15022: 0e 94 b3 dd call 0x1bb66 ; 0x1bb66 lcd_update_enable(true); 15026: 81 e0 ldi r24, 0x01 ; 1 15028: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_clear(); 1502c: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_update(0); 15030: 80 e0 ldi r24, 0x00 ; 0 15032: 0e 94 c9 6e call 0xdd92 ; 0xdd92 15036: dc c9 rjmp .-3144 ; 0x143f0 } 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); 15038: 41 e1 ldi r20, 0x11 ; 17 1503a: 50 e0 ldi r21, 0x00 ; 0 1503c: 60 e8 ldi r22, 0x80 ; 128 1503e: 7c e0 ldi r23, 0x0C ; 12 15040: ce 01 movw r24, r28 15042: 01 96 adiw r24, 0x01 ; 1 15044: 0f 94 8d a3 call 0x3471a ; 0x3471a SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 15048: 8d e1 ldi r24, 0x1D ; 29 1504a: 90 e8 ldi r25, 0x80 ; 128 1504c: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 15050: 8c ee ldi r24, 0xEC ; 236 15052: 98 e8 ldi r25, 0x88 ; 136 15054: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM("+"); 15058: 8b e1 ldi r24, 0x1B ; 27 1505a: 90 e8 ldi r25, 0x80 ; 128 1505c: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 15060: 86 e1 ldi r24, 0x16 ; 22 15062: 90 e8 ldi r25, 0x80 ; 128 15064: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM("_"); 15068: 84 e1 ldi r24, 0x14 ; 20 1506a: 90 e8 ldi r25, 0x80 ; 128 1506c: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM(FW_COMMIT_HASH); 15070: 8a e0 ldi r24, 0x0A ; 10 15072: 90 e8 ldi r25, 0x80 ; 128 15074: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 15078: 80 eb ldi r24, 0xB0 ; 176 1507a: 9f e7 ldi r25, 0x7F ; 127 1507c: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM(PROTOCOL_VERSION); 15080: 8c ea ldi r24, 0xAC ; 172 15082: 9f e7 ldi r25, 0x7F ; 127 15084: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 15088: 8d e9 ldi r24, 0x9D ; 157 1508a: 9f e7 ldi r25, 0x7F ; 127 1508c: 0e 94 94 7a call 0xf528 ; 0xf528 15090: ce 01 movw r24, r28 15092: 01 96 adiw r24, 0x01 ; 1 15094: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 15098: 8b e8 ldi r24, 0x8B ; 139 1509a: 9f e7 ldi r25, 0x7F ; 127 1509c: 0e 94 94 7a call 0xf528 ; 0xf528 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 150a0: 8a e8 ldi r24, 0x8A ; 138 150a2: 9f e7 ldi r25, 0x7F ; 127 150a4: 0e 94 8d 7c call 0xf91a ; 0xf91a } #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'); 150a8: 1f 92 push r1 150aa: 21 e3 ldi r18, 0x31 ; 49 150ac: f2 2e mov r15, r18 150ae: ff 92 push r15 150b0: 83 ef ldi r24, 0xF3 ; 243 150b2: 9d e7 ldi r25, 0x7D ; 125 150b4: 9f 93 push r25 150b6: 8f 93 push r24 150b8: 0c ea ldi r16, 0xAC ; 172 150ba: 1d e7 ldi r17, 0x7D ; 125 150bc: 1f 93 push r17 150be: 0f 93 push r16 150c0: 0f 94 5f a2 call 0x344be ; 0x344be 150c4: 1f 92 push r1 150c6: ff 92 push r15 150c8: 83 ee ldi r24, 0xE3 ; 227 150ca: 9d e7 ldi r25, 0x7D ; 125 150cc: 9f 93 push r25 150ce: 8f 93 push r24 150d0: 1f 93 push r17 150d2: 0f 93 push r16 150d4: 0f 94 5f a2 call 0x344be ; 0x344be 150d8: 1f 92 push r1 150da: ff 92 push r15 150dc: 8f ec ldi r24, 0xCF ; 207 150de: 9d e7 ldi r25, 0x7D ; 125 150e0: 9f 93 push r25 150e2: 8f 93 push r24 150e4: 1f 93 push r17 150e6: 0f 93 push r16 150e8: 0f 94 5f a2 call 0x344be ; 0x344be 150ec: 1f 92 push r1 150ee: ff 92 push r15 150f0: 82 ec ldi r24, 0xC2 ; 194 150f2: 9d e7 ldi r25, 0x7D ; 125 150f4: 9f 93 push r25 150f6: 8f 93 push r24 150f8: 1f 93 push r17 150fa: 0f 93 push r16 150fc: 0f 94 5f a2 call 0x344be ; 0x344be 15100: 1f 92 push r1 15102: ff 92 push r15 15104: 87 eb ldi r24, 0xB7 ; 183 15106: 9d e7 ldi r25, 0x7D ; 125 15108: 9f 93 push r25 1510a: 8f 93 push r24 1510c: 1f 93 push r17 1510e: 0f 93 push r16 15110: 0f 94 5f a2 call 0x344be ; 0x344be 15114: 0f b6 in r0, 0x3f ; 63 15116: f8 94 cli 15118: de bf out 0x3e, r29 ; 62 1511a: 0f be out 0x3f, r0 ; 63 1511c: cd bf out 0x3d, r28 ; 61 1511e: 68 c9 rjmp .-3376 ; 0x143f0 /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 15120: 0e 94 8b 7b call 0xf716 ; 0xf716 15124: 65 c9 rjmp .-3382 ; 0x143f0 /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 15126: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 1512a: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 1512e: cf 01 movw r24, r30 15130: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 15132: 24 81 ldd r18, Z+4 ; 0x04 15134: 20 32 cpi r18, 0x20 ; 32 15136: 09 f4 brne .+2 ; 0x1513a 15138: 01 96 adiw r24, 0x01 ; 1 1513a: 0e 94 d9 dc call 0x1b9b2 ; 0x1b9b2 custom_message_type = CustomMsg::M117; 1513e: 87 e0 ldi r24, 0x07 ; 7 15140: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d 15144: 55 c9 rjmp .-3414 ; 0x143f0 - `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; 15146: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 1514a: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 1514e: 0b 5f subi r16, 0xFB ; 251 15150: 1f 4f sbci r17, 0xFF ; 255 15152: 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; 15154: f1 2c mov r15, r1 15156: 40 e0 ldi r20, 0x00 ; 0 15158: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 1515a: e9 f0 breq .+58 ; 0x15196 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 1515c: d8 01 movw r26, r16 1515e: 9c 91 ld r25, X 15160: 29 2f mov r18, r25 15162: 2b 7f andi r18, 0xFB ; 251 15164: 21 34 cpi r18, 0x41 ; 65 15166: b9 f4 brne .+46 ; 0x15196 15168: 11 96 adiw r26, 0x01 ; 1 1516a: 2c 91 ld r18, X 1516c: 21 33 cpi r18, 0x31 ; 49 1516e: 99 f4 brne .+38 ; 0x15196 switch (p[0]) { 15170: 91 34 cpi r25, 0x41 ; 65 15172: 71 f0 breq .+28 ; 0x15190 15174: 95 34 cpi r25, 0x45 ; 69 15176: 09 f4 brne .+2 ; 0x1517a case 'A': hasA = true; break; case 'E': hasE = true; break; 15178: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 1517a: 98 01 movw r18, r16 1517c: 2e 5f subi r18, 0xFE ; 254 1517e: 3f 4f sbci r19, 0xFF ; 255 15180: 89 01 movw r16, r18 15182: 2f 5f subi r18, 0xFF ; 255 15184: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 15186: f8 01 movw r30, r16 15188: 90 81 ld r25, Z 1518a: 90 32 cpi r25, 0x20 ; 32 1518c: c9 f3 breq .-14 ; 0x15180 1518e: e4 cf rjmp .-56 ; 0x15158 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; 15190: ff 24 eor r15, r15 15192: f3 94 inc r15 15194: f2 cf rjmp .-28 ; 0x1517a } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 15196: 44 23 and r20, r20 15198: 21 f0 breq .+8 ; 0x151a2 1519a: 8e ec ldi r24, 0xCE ; 206 1519c: 91 ea ldi r25, 0xA1 ; 161 1519e: 0e 94 94 7a call 0xf528 ; 0xf528 if (hasA) SERIAL_ECHOPGM("//"); 151a2: ff 20 and r15, r15 151a4: 21 f0 breq .+8 ; 0x151ae 151a6: 87 e8 ldi r24, 0x87 ; 135 151a8: 9f e7 ldi r25, 0x7F ; 127 151aa: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(p); 151ae: c8 01 movw r24, r16 151b0: 0e 94 92 85 call 0x10b24 ; 0x10b24 151b4: 1d c9 rjmp .-3526 ; 0x143f0 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); 151b6: 87 e4 ldi r24, 0x47 ; 71 151b8: 95 e6 ldi r25, 0x65 ; 101 151ba: 0c 94 db 9d jmp 0x13bb6 ; 0x13bb6 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); 151be: 87 e4 ldi r24, 0x47 ; 71 151c0: 95 e6 ldi r25, 0x65 ; 101 151c2: 0c 94 e9 9d jmp 0x13bd2 ; 0x13bd2 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); 151c6: 87 e4 ldi r24, 0x47 ; 71 151c8: 95 e6 ldi r25, 0x65 ; 101 151ca: 0c 94 f7 9d jmp 0x13bee ; 0x13bee 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); 151ce: 87 e4 ldi r24, 0x47 ; 71 151d0: 95 e6 ldi r25, 0x65 ; 101 151d2: 0c 94 05 9e jmp 0x13c0a ; 0x13c0a E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 151d6: 0e 94 e5 64 call 0xc9ca ; 0xc9ca 151da: 0a c9 rjmp .-3564 ; 0x143f0 */ 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')) { 151dc: 84 e5 ldi r24, 0x54 ; 84 151de: 0e 94 f5 55 call 0xabea ; 0xabea 151e2: 88 23 and r24, r24 151e4: 69 f0 breq .+26 ; 0x15200 extruder = code_value_uint8(); 151e6: 0e 94 0a 56 call 0xac14 ; 0xac14 if(extruder >= EXTRUDERS) { 151ea: 88 23 and r24, r24 151ec: 49 f0 breq .+18 ; 0x15200 SERIAL_ECHO_START; 151ee: 8e ec ldi r24, 0xCE ; 206 151f0: 91 ea ldi r25, 0xA1 ; 161 151f2: 0e 94 94 7a call 0xf528 ; 0xf528 151f6: 88 e1 ldi r24, 0x18 ; 24 151f8: 95 e6 ldi r25, 0x65 ; 101 151fa: 0e 94 86 85 call 0x10b0c ; 0x10b0c 151fe: f8 c8 rjmp .-3600 ; 0x143f0 SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 15200: 84 e4 ldi r24, 0x44 ; 68 15202: 0e 94 f5 55 call 0xabea ; 0xabea 15206: 88 23 and r24, r24 15208: 09 f4 brne .+2 ; 0x1520c 1520a: f2 c8 rjmp .-3612 ; 0x143f0 float diameter = code_value(); 1520c: 0e 94 85 5a call 0xb50a ; 0xb50a if (diameter == 0.0) { 15210: 20 e0 ldi r18, 0x00 ; 0 15212: 30 e0 ldi r19, 0x00 ; 0 15214: a9 01 movw r20, r18 15216: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1521a: 81 11 cpse r24, r1 1521c: 05 c0 rjmp .+10 ; 0x15228 // 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; 1521e: 10 92 fe 0d sts 0x0DFE, r1 ; 0x800dfe } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 15222: 0e 94 1a 64 call 0xc834 ; 0xc834 15226: e4 c8 rjmp .-3640 ; 0x143f0 // 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(); 15228: 0e 94 85 5a call 0xb50a ; 0xb50a 1522c: 6b 01 movw r12, r22 1522e: 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]); 15230: 20 e0 ldi r18, 0x00 ; 0 15232: 30 e0 ldi r19, 0x00 ; 0 15234: a9 01 movw r20, r18 15236: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1523a: 81 11 cpse r24, r1 1523c: 06 c0 rjmp .+12 ; 0x1524a 1523e: c1 2c mov r12, r1 15240: d1 2c mov r13, r1 15242: 90 ee ldi r25, 0xE0 ; 224 15244: e9 2e mov r14, r25 15246: 9f e3 ldi r25, 0x3F ; 63 15248: f9 2e mov r15, r25 1524a: c0 92 ff 0d sts 0x0DFF, r12 ; 0x800dff 1524e: d0 92 00 0e sts 0x0E00, r13 ; 0x800e00 15252: e0 92 01 0e sts 0x0E01, r14 ; 0x800e01 15256: f0 92 02 0e sts 0x0E02, r15 ; 0x800e02 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; 1525a: 81 e0 ldi r24, 0x01 ; 1 1525c: 80 93 fe 0d sts 0x0DFE, r24 ; 0x800dfe 15260: e0 cf rjmp .-64 ; 0x15222 15262: 04 ec ldi r16, 0xC4 ; 196 15264: 12 e0 ldi r17, 0x02 ; 2 15266: f7 e6 ldi r31, 0x67 ; 103 15268: ef 2e mov r14, r31 1526a: fd e0 ldi r31, 0x0D ; 13 1526c: ff 2e mov r15, r31 1526e: a8 ec ldi r26, 0xC8 ; 200 15270: ca 2e mov r12, r26 15272: a2 e0 ldi r26, 0x02 ; 2 15274: da 2e mov r13, r26 - `E` - Maximum feedrate for extruder drives */ case 203: // M203 max feedrate mm/sec for (uint8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) 15276: d8 01 movw r26, r16 15278: 8d 91 ld r24, X+ 1527a: 8d 01 movw r16, r26 1527c: 0e 94 f5 55 call 0xabea ; 0xabea 15280: 88 23 and r24, r24 15282: 39 f0 breq .+14 ; 0x15292 { float val = code_value(); 15284: 0e 94 85 5a call 0xb50a ; 0xb50a val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; cs.max_feedrate_silent[i] = val_silent; #else //TMC2130 max_feedrate[i] = val; 15288: f7 01 movw r30, r14 1528a: 64 8b std Z+20, r22 ; 0x14 1528c: 75 8b std Z+21, r23 ; 0x15 1528e: 86 8b std Z+22, r24 ; 0x16 15290: 97 8b std Z+23, r25 ; 0x17 15292: f4 e0 ldi r31, 0x04 ; 4 15294: ef 0e add r14, r31 15296: f1 1c adc r15, r1 - `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++) 15298: c0 16 cp r12, r16 1529a: d1 06 cpc r13, r17 1529c: 61 f7 brne .-40 ; 0x15276 1529e: a8 c8 rjmp .-3760 ; 0x143f0 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 152a0: 83 e5 ldi r24, 0x53 ; 83 152a2: 0e 94 f5 55 call 0xabea ; 0xabea 152a6: 88 23 and r24, r24 152a8: 19 f1 breq .+70 ; 0x152f0 // 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(); 152aa: 0e 94 85 5a call 0xb50a ; 0xb50a 152ae: 60 93 27 0e sts 0x0E27, r22 ; 0x800e27 152b2: 70 93 28 0e sts 0x0E28, r23 ; 0x800e28 152b6: 80 93 29 0e sts 0x0E29, r24 ; 0x800e29 152ba: 90 93 2a 0e sts 0x0E2A, r25 ; 0x800e2a 152be: 60 93 9b 0d sts 0x0D9B, r22 ; 0x800d9b 152c2: 70 93 9c 0d sts 0x0D9C, r23 ; 0x800d9c 152c6: 80 93 9d 0d sts 0x0D9D, r24 ; 0x800d9d 152ca: 90 93 9e 0d sts 0x0D9E, r25 ; 0x800d9e // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 152ce: 84 e5 ldi r24, 0x54 ; 84 152d0: 0e 94 f5 55 call 0xabea ; 0xabea 152d4: 88 23 and r24, r24 152d6: 09 f4 brne .+2 ; 0x152da 152d8: 8b c8 rjmp .-3818 ; 0x143f0 cs.retract_acceleration = code_value(); 152da: 0e 94 85 5a call 0xb50a ; 0xb50a 152de: 60 93 9f 0d sts 0x0D9F, r22 ; 0x800d9f 152e2: 70 93 a0 0d sts 0x0DA0, r23 ; 0x800da0 152e6: 80 93 a1 0d sts 0x0DA1, r24 ; 0x800da1 152ea: 90 93 a2 0d sts 0x0DA2, r25 ; 0x800da2 152ee: 80 c8 rjmp .-3840 ; 0x143f0 } else { // New acceleration format, compatible with the upstream Marlin. if(code_seen('P')) 152f0: 80 e5 ldi r24, 0x50 ; 80 152f2: 0e 94 f5 55 call 0xabea ; 0xabea 152f6: 88 23 and r24, r24 152f8: 51 f0 breq .+20 ; 0x1530e cs.acceleration = code_value(); 152fa: 0e 94 85 5a call 0xb50a ; 0xb50a 152fe: 60 93 9b 0d sts 0x0D9B, r22 ; 0x800d9b 15302: 70 93 9c 0d sts 0x0D9C, r23 ; 0x800d9c 15306: 80 93 9d 0d sts 0x0D9D, r24 ; 0x800d9d 1530a: 90 93 9e 0d sts 0x0D9E, r25 ; 0x800d9e if(code_seen('R')) 1530e: 82 e5 ldi r24, 0x52 ; 82 15310: 0e 94 f5 55 call 0xabea ; 0xabea 15314: 88 23 and r24, r24 15316: 51 f0 breq .+20 ; 0x1532c cs.retract_acceleration = code_value(); 15318: 0e 94 85 5a call 0xb50a ; 0xb50a 1531c: 60 93 9f 0d sts 0x0D9F, r22 ; 0x800d9f 15320: 70 93 a0 0d sts 0x0DA0, r23 ; 0x800da0 15324: 80 93 a1 0d sts 0x0DA1, r24 ; 0x800da1 15328: 90 93 a2 0d sts 0x0DA2, r25 ; 0x800da2 if(code_seen('T')) 1532c: 84 e5 ldi r24, 0x54 ; 84 1532e: 0e 94 f5 55 call 0xabea ; 0xabea 15332: 88 23 and r24, r24 15334: 09 f4 brne .+2 ; 0x15338 15336: 5c c8 rjmp .-3912 ; 0x143f0 cs.travel_acceleration = code_value(); 15338: 0e 94 85 5a call 0xb50a ; 0xb50a 1533c: 60 93 27 0e sts 0x0E27, r22 ; 0x800e27 15340: 70 93 28 0e sts 0x0E28, r23 ; 0x800e28 15344: 80 93 29 0e sts 0x0E29, r24 ; 0x800e29 15348: 90 93 2a 0e sts 0x0E2A, r25 ; 0x800e2a 1534c: 51 c8 rjmp .-3934 ; 0x143f0 1534e: 04 ec ldi r16, 0xC4 ; 196 15350: 12 e0 ldi r17, 0x02 ; 2 15352: ef eb ldi r30, 0xBF ; 191 15354: ee 2e mov r14, r30 15356: ed e0 ldi r30, 0x0D ; 13 15358: fe 2e mov r15, r30 - `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(); 1535a: d8 01 movw r26, r16 1535c: 8d 91 ld r24, X+ 1535e: 8d 01 movw r16, r26 15360: 0e 94 f5 55 call 0xabea ; 0xabea 15364: 88 23 and r24, r24 15366: 39 f0 breq .+14 ; 0x15376 15368: 0e 94 85 5a call 0xb50a ; 0xb50a 1536c: f7 01 movw r30, r14 1536e: 60 83 st Z, r22 15370: 71 83 std Z+1, r23 ; 0x01 15372: 82 83 std Z+2, r24 ; 0x02 15374: 93 83 std Z+3, r25 ; 0x03 15376: f4 e0 ldi r31, 0x04 ; 4 15378: ef 0e add r14, r31 1537a: 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++) 1537c: 22 e0 ldi r18, 0x02 ; 2 1537e: 07 3c cpi r16, 0xC7 ; 199 15380: 12 07 cpc r17, r18 15382: 59 f7 brne .-42 ; 0x1535a 15384: 35 c8 rjmp .-3990 ; 0x143f0 - `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')) 15386: 83 e5 ldi r24, 0x53 ; 83 15388: 0e 94 f5 55 call 0xabea ; 0xabea 1538c: 88 23 and r24, r24 1538e: 51 f0 breq .+20 ; 0x153a4 { cs.retract_length = code_value() ; 15390: 0e 94 85 5a call 0xb50a ; 0xb50a 15394: 60 93 ea 0d sts 0x0DEA, r22 ; 0x800dea 15398: 70 93 eb 0d sts 0x0DEB, r23 ; 0x800deb 1539c: 80 93 ec 0d sts 0x0DEC, r24 ; 0x800dec 153a0: 90 93 ed 0d sts 0x0DED, r25 ; 0x800ded } if(code_seen('F')) 153a4: 86 e4 ldi r24, 0x46 ; 70 153a6: 0e 94 f5 55 call 0xabea ; 0xabea 153aa: 88 23 and r24, r24 153ac: 61 f0 breq .+24 ; 0x153c6 { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 153ae: 0e 94 85 5a call 0xb50a ; 0xb50a 153b2: 0e 94 15 65 call 0xca2a ; 0xca2a 153b6: 60 93 ee 0d sts 0x0DEE, r22 ; 0x800dee 153ba: 70 93 ef 0d sts 0x0DEF, r23 ; 0x800def 153be: 80 93 f0 0d sts 0x0DF0, r24 ; 0x800df0 153c2: 90 93 f1 0d sts 0x0DF1, r25 ; 0x800df1 } if(code_seen('Z')) 153c6: 8a e5 ldi r24, 0x5A ; 90 153c8: 0e 94 f5 55 call 0xabea ; 0xabea 153cc: 88 23 and r24, r24 153ce: 09 f4 brne .+2 ; 0x153d2 153d0: 0f c8 rjmp .-4066 ; 0x143f0 { cs.retract_zlift = code_value() ; 153d2: 0e 94 85 5a call 0xb50a ; 0xb50a 153d6: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 153da: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 153de: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 153e2: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 153e6: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 #### 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')) 153ea: 83 e5 ldi r24, 0x53 ; 83 153ec: 0e 94 f5 55 call 0xabea ; 0xabea 153f0: 88 23 and r24, r24 153f2: 11 f4 brne .+4 ; 0x153f8 153f4: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 { switch(code_value_uint8()) 153f8: 0e 94 0a 56 call 0xac14 ; 0xac14 153fc: 88 23 and r24, r24 153fe: c1 f0 breq .+48 ; 0x15430 15400: 81 30 cpi r24, 0x01 ; 1 15402: e1 f0 breq .+56 ; 0x1543c #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 15404: 8e ec ldi r24, 0xCE ; 206 15406: 91 ea ldi r25, 0xA1 ; 161 15408: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1540c: 85 e0 ldi r24, 0x05 ; 5 1540e: 95 e6 ldi r25, 0x65 ; 101 15410: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 15414: 80 91 38 12 lds r24, 0x1238 ; 0x801238 15418: 90 91 39 12 lds r25, 0x1239 ; 0x801239 1541c: 82 5b subi r24, 0xB2 ; 178 1541e: 9f 4e sbci r25, 0xEF ; 239 15420: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_ECHOLNPGM("\"(1)"); 15424: 82 e8 ldi r24, 0x82 ; 130 15426: 9f e7 ldi r25, 0x7F ; 127 15428: 0e 94 8d 7c call 0xf91a ; 0xf91a 1542c: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 15430: 10 92 e9 0d sts 0x0DE9, r1 ; 0x800de9 retracted[0]=false; 15434: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b 15438: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 1543c: 80 93 e9 0d sts 0x0DE9, r24 ; 0x800de9 retracted[0]=false; 15440: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b 15444: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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; 15448: 40 90 2b 0e lds r4, 0x0E2B ; 0x800e2b 1544c: 50 90 2c 0e lds r5, 0x0E2C ; 0x800e2c 15450: 60 90 2d 0e lds r6, 0x0E2D ; 0x800e2d 15454: 70 90 2e 0e lds r7, 0x0E2E ; 0x800e2e 15458: 0c 94 28 9f jmp 0x13e50 ; 0x13e50 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 1545c: 80 90 2f 0e lds r8, 0x0E2F ; 0x800e2f 15460: 90 90 30 0e lds r9, 0x0E30 ; 0x800e30 15464: a0 90 31 0e lds r10, 0x0E31 ; 0x800e31 15468: b0 90 32 0e lds r11, 0x0E32 ; 0x800e32 1546c: 0c 94 33 9f jmp 0x13e66 ; 0x13e66 - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 15470: 82 e4 ldi r24, 0x42 ; 66 15472: 0e 94 f5 55 call 0xabea ; 0xabea 15476: 18 2f mov r17, r24 15478: 88 23 and r24, r24 1547a: 41 f0 breq .+16 ; 0x1548c { saved_feedmultiply_mm = feedmultiply; 1547c: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 15480: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 15484: 90 93 31 02 sts 0x0231, r25 ; 0x800231 15488: 80 93 30 02 sts 0x0230, r24 ; 0x800230 codesWereSeen = true; } if (code_seen('S')) 1548c: 83 e5 ldi r24, 0x53 ; 83 1548e: 0e 94 f5 55 call 0xabea ; 0xabea 15492: 08 2f mov r16, r24 15494: 88 23 and r24, r24 15496: 39 f0 breq .+14 ; 0x154a6 { feedmultiply = code_value_short(); 15498: 0e 94 17 56 call 0xac2e ; 0xac2e 1549c: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 154a0: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e codesWereSeen = true; 154a4: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 154a6: 82 e5 ldi r24, 0x52 ; 82 154a8: 0e 94 f5 55 call 0xabea ; 0xabea 154ac: 88 23 and r24, r24 154ae: 51 f0 breq .+20 ; 0x154c4 { feedmultiply = saved_feedmultiply_mm; 154b0: 80 91 30 02 lds r24, 0x0230 ; 0x800230 154b4: 90 91 31 02 lds r25, 0x0231 ; 0x800231 154b8: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 154bc: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 154c0: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 codesWereSeen = true; } if (!codesWereSeen) 154c4: 11 11 cpse r17, r1 154c6: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 { printf_P(PSTR("%i%%\n"), feedmultiply); 154ca: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 154ce: 8f 93 push r24 154d0: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 154d4: 8f 93 push r24 154d6: 8c e7 ldi r24, 0x7C ; 124 154d8: 9f e7 ldi r25, 0x7F ; 127 154da: 9f 93 push r25 154dc: 8f 93 push r24 154de: 0f 94 5f a2 call 0x344be ; 0x344be 154e2: 0f 90 pop r0 154e4: 0f 90 pop r0 154e6: 0f 90 pop r0 154e8: 0f 90 pop r0 154ea: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 154ee: 83 e5 ldi r24, 0x53 ; 83 154f0: 0e 94 f5 55 call 0xabea ; 0xabea 154f4: 88 23 and r24, r24 154f6: 51 f0 breq .+20 ; 0x1550c { extrudemultiply = code_value_short(); 154f8: 0e 94 17 56 call 0xac2e ; 0xac2e 154fc: 90 93 76 02 sts 0x0276, r25 ; 0x800276 15500: 80 93 75 02 sts 0x0275, r24 ; 0x800275 calculate_extruder_multipliers(); 15504: 0e 94 1a 64 call 0xc834 ; 0xc834 15508: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 1550c: 80 91 76 02 lds r24, 0x0276 ; 0x800276 15510: 8f 93 push r24 15512: 80 91 75 02 lds r24, 0x0275 ; 0x800275 15516: 8f 93 push r24 15518: 86 e7 ldi r24, 0x76 ; 118 1551a: 9f e7 ldi r25, 0x7F ; 127 1551c: 9f 93 push r25 1551e: 8f 93 push r24 15520: 0f 94 5f a2 call 0x344be ; 0x344be 15524: 0f 90 pop r0 15526: 0f 90 pop r0 15528: 0f 90 pop r0 1552a: 0f 90 pop r0 1552c: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 15530: 80 e5 ldi r24, 0x50 ; 80 15532: 0e 94 f5 55 call 0xabea ; 0xabea 15536: 88 23 and r24, r24 15538: 11 f4 brne .+4 ; 0x1553e 1553a: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 int pin_number = code_value_short(); // pin number 1553e: 0e 94 17 56 call 0xac2e ; 0xac2e 15542: 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 15544: 83 e5 ldi r24, 0x53 ; 83 15546: 0e 94 f5 55 call 0xabea ; 0xabea */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 1554a: 0f ef ldi r16, 0xFF ; 255 1554c: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 1554e: 88 23 and r24, r24 15550: 19 f0 breq .+6 ; 0x15558 15552: 0e 94 17 56 call 0xac2e ; 0xac2e 15556: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 15558: c8 01 movw r24, r16 1555a: 01 96 adiw r24, 0x01 ; 1 1555c: 03 97 sbiw r24, 0x03 ; 3 1555e: 10 f0 brcs .+4 ; 0x15564 15560: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 15564: ea e6 ldi r30, 0x6A ; 106 15566: f0 e8 ldi r31, 0x80 ; 128 15568: 26 e8 ldi r18, 0x86 ; 134 1556a: 30 e8 ldi r19, 0x80 ; 128 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)) 1556c: 84 91 lpm r24, Z 1556e: 08 2e mov r0, r24 15570: 00 0c add r0, r0 15572: 99 0b sbc r25, r25 15574: e8 16 cp r14, r24 15576: f9 06 cpc r15, r25 15578: 11 f4 brne .+4 ; 0x1557e 1557a: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 1557e: 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++) 15580: 2e 17 cp r18, r30 15582: 3f 07 cpc r19, r31 15584: 99 f7 brne .-26 ; 0x1556c pin_number = -1; break; } } if (pin_number > -1) 15586: f7 fe sbrs r15, 7 15588: 02 c0 rjmp .+4 ; 0x1558e 1558a: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 { int target = LOW; st_synchronize(); 1558e: 0f 94 b0 18 call 0x23160 ; 0x23160 pinMode(pin_number, INPUT); 15592: de 2c mov r13, r14 15594: 60 e0 ldi r22, 0x00 ; 0 15596: 8e 2d mov r24, r14 15598: 0e 94 2e d1 call 0x1a25c ; 0x1a25c switch(pin_state){ 1559c: 0f 3f cpi r16, 0xFF ; 255 1559e: 10 07 cpc r17, r16 155a0: b1 f0 breq .+44 ; 0x155ce 155a2: 01 30 cpi r16, 0x01 ; 1 155a4: 11 05 cpc r17, r1 155a6: 11 f0 breq .+4 ; 0x155ac } } if (pin_number > -1) { int target = LOW; 155a8: 10 e0 ldi r17, 0x00 ; 0 155aa: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 155ac: 8d 2d mov r24, r13 155ae: 0e 94 d7 d0 call 0x1a1ae ; 0x1a1ae 155b2: 80 17 cp r24, r16 155b4: 91 07 cpc r25, r17 155b6: 11 f4 brne .+4 ; 0x155bc 155b8: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 manage_heater(); 155bc: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(); 155c0: 80 e0 ldi r24, 0x00 ; 0 155c2: 0e 94 25 8a call 0x1144a ; 0x1144a lcd_update(0); 155c6: 80 e0 ldi r24, 0x00 ; 0 155c8: 0e 94 c9 6e call 0xdd92 ; 0xdd92 155cc: ef cf rjmp .-34 ; 0x155ac case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 155ce: 8e 2d mov r24, r14 155d0: 0e 94 d7 d0 call 0x1a1ae ; 0x1a1ae 155d4: 31 e0 ldi r19, 0x01 ; 1 155d6: 20 e0 ldi r18, 0x00 ; 0 155d8: 89 2b or r24, r25 155da: 09 f0 breq .+2 ; 0x155de 155dc: 30 e0 ldi r19, 0x00 ; 0 155de: 03 2f mov r16, r19 155e0: 12 2f mov r17, r18 155e2: e4 cf rjmp .-56 ; 0x155ac case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 155e4: 70 e0 ldi r23, 0x00 ; 0 155e6: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 155e8: 40 e0 ldi r20, 0x00 ; 0 155ea: c8 01 movw r24, r16 155ec: 0f 94 55 25 call 0x24aaa ; 0x24aaa 155f0: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 155f4: 80 e5 ldi r24, 0x50 ; 80 155f6: 0e 94 f5 55 call 0xabea ; 0xabea 155fa: 88 23 and r24, r24 155fc: 51 f0 breq .+20 ; 0x15612 155fe: 0e 94 85 5a call 0xb50a ; 0xb50a 15602: 60 93 cf 0d sts 0x0DCF, r22 ; 0x800dcf 15606: 70 93 d0 0d sts 0x0DD0, r23 ; 0x800dd0 1560a: 80 93 d1 0d sts 0x0DD1, r24 ; 0x800dd1 1560e: 90 93 d2 0d sts 0x0DD2, r25 ; 0x800dd2 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 15612: 89 e4 ldi r24, 0x49 ; 73 15614: 0e 94 f5 55 call 0xabea ; 0xabea 15618: 88 23 and r24, r24 1561a: 81 f0 breq .+32 ; 0x1563c 1561c: 0e 94 85 5a call 0xb50a ; 0xb50a #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15620: 2c ea ldi r18, 0xAC ; 172 15622: 35 ec ldi r19, 0xC5 ; 197 15624: 47 e2 ldi r20, 0x27 ; 39 15626: 5e e3 ldi r21, 0x3E ; 62 15628: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1562c: 60 93 d3 0d sts 0x0DD3, r22 ; 0x800dd3 15630: 70 93 d4 0d sts 0x0DD4, r23 ; 0x800dd4 15634: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 15638: 90 93 d6 0d sts 0x0DD6, r25 ; 0x800dd6 if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 1563c: 84 e4 ldi r24, 0x44 ; 68 1563e: 0e 94 f5 55 call 0xabea ; 0xabea 15642: 88 23 and r24, r24 15644: 81 f0 breq .+32 ; 0x15666 15646: 0e 94 85 5a call 0xb50a ; 0xb50a } float unscalePID_i(float i) { return i/PID_dT; 1564a: 2c ea ldi r18, 0xAC ; 172 1564c: 35 ec ldi r19, 0xC5 ; 197 1564e: 47 e2 ldi r20, 0x27 ; 39 15650: 5e e3 ldi r21, 0x3E ; 62 15652: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 15656: 60 93 d7 0d sts 0x0DD7, r22 ; 0x800dd7 1565a: 70 93 d8 0d sts 0x0DD8, r23 ; 0x800dd8 1565e: 80 93 d9 0d sts 0x0DD9, r24 ; 0x800dd9 15662: 90 93 da 0d sts 0x0DDA, r25 ; 0x800dda updatePID(); 15666: 0f 94 74 14 call 0x228e8 ; 0x228e8 SERIAL_PROTOCOLRPGM(MSG_OK); 1566a: 8c ee ldi r24, 0xEC ; 236 1566c: 99 e6 ldi r25, 0x69 ; 105 1566e: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLPGM(" p:"); 15672: 82 e7 ldi r24, 0x72 ; 114 15674: 9f e7 ldi r25, 0x7F ; 127 15676: 0e 94 94 7a call 0xf528 ; 0xf528 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1567a: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 1567e: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 15682: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 15686: 90 91 d2 0d lds r25, 0x0DD2 ; 0x800dd2 1568a: 42 e0 ldi r20, 0x02 ; 2 1568c: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 15690: 8e e6 ldi r24, 0x6E ; 110 15692: 9f e7 ldi r25, 0x7F ; 127 15694: 0e 94 94 7a call 0xf528 ; 0xf528 15698: 2c ea ldi r18, 0xAC ; 172 1569a: 35 ec ldi r19, 0xC5 ; 197 1569c: 47 e2 ldi r20, 0x27 ; 39 1569e: 5e e3 ldi r21, 0x3E ; 62 156a0: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 156a4: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 156a8: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 156ac: 90 91 d6 0d lds r25, 0x0DD6 ; 0x800dd6 156b0: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 156b4: 42 e0 ldi r20, 0x02 ; 2 156b6: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 156ba: 8a e6 ldi r24, 0x6A ; 106 156bc: 9f e7 ldi r25, 0x7F ; 127 156be: 0e 94 94 7a call 0xf528 ; 0xf528 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 156c2: 2c ea ldi r18, 0xAC ; 172 156c4: 35 ec ldi r19, 0xC5 ; 197 156c6: 47 e2 ldi r20, 0x27 ; 39 156c8: 5e e3 ldi r21, 0x3E ; 62 156ca: 60 91 d7 0d lds r22, 0x0DD7 ; 0x800dd7 156ce: 70 91 d8 0d lds r23, 0x0DD8 ; 0x800dd8 156d2: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 156d6: 90 91 da 0d lds r25, 0x0DDA ; 0x800dda 156da: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 156de: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 156e2: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 156e6: 80 e5 ldi r24, 0x50 ; 80 156e8: 0e 94 f5 55 call 0xabea ; 0xabea 156ec: 88 23 and r24, r24 156ee: 51 f0 breq .+20 ; 0x15704 156f0: 0e 94 85 5a call 0xb50a ; 0xb50a 156f4: 60 93 db 0d sts 0x0DDB, r22 ; 0x800ddb 156f8: 70 93 dc 0d sts 0x0DDC, r23 ; 0x800ddc 156fc: 80 93 dd 0d sts 0x0DDD, r24 ; 0x800ddd 15700: 90 93 de 0d sts 0x0DDE, r25 ; 0x800dde if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 15704: 89 e4 ldi r24, 0x49 ; 73 15706: 0e 94 f5 55 call 0xabea ; 0xabea 1570a: 88 23 and r24, r24 1570c: 81 f0 breq .+32 ; 0x1572e 1570e: 0e 94 85 5a call 0xb50a ; 0xb50a 15712: 2c ea ldi r18, 0xAC ; 172 15714: 35 ec ldi r19, 0xC5 ; 197 15716: 47 e2 ldi r20, 0x27 ; 39 15718: 5e e3 ldi r21, 0x3E ; 62 1571a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1571e: 60 93 df 0d sts 0x0DDF, r22 ; 0x800ddf 15722: 70 93 e0 0d sts 0x0DE0, r23 ; 0x800de0 15726: 80 93 e1 0d sts 0x0DE1, r24 ; 0x800de1 1572a: 90 93 e2 0d sts 0x0DE2, r25 ; 0x800de2 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 1572e: 84 e4 ldi r24, 0x44 ; 68 15730: 0e 94 f5 55 call 0xabea ; 0xabea 15734: 88 23 and r24, r24 15736: 81 f0 breq .+32 ; 0x15758 15738: 0e 94 85 5a call 0xb50a ; 0xb50a } float unscalePID_i(float i) { return i/PID_dT; 1573c: 2c ea ldi r18, 0xAC ; 172 1573e: 35 ec ldi r19, 0xC5 ; 197 15740: 47 e2 ldi r20, 0x27 ; 39 15742: 5e e3 ldi r21, 0x3E ; 62 15744: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 15748: 60 93 e3 0d sts 0x0DE3, r22 ; 0x800de3 1574c: 70 93 e4 0d sts 0x0DE4, r23 ; 0x800de4 15750: 80 93 e5 0d sts 0x0DE5, r24 ; 0x800de5 15754: 90 93 e6 0d sts 0x0DE6, r25 ; 0x800de6 updatePID(); 15758: 0f 94 74 14 call 0x228e8 ; 0x228e8 SERIAL_PROTOCOLRPGM(MSG_OK); 1575c: 8c ee ldi r24, 0xEC ; 236 1575e: 99 e6 ldi r25, 0x69 ; 105 15760: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLPGM(" p:"); 15764: 86 e6 ldi r24, 0x66 ; 102 15766: 9f e7 ldi r25, 0x7F ; 127 15768: 0e 94 94 7a call 0xf528 ; 0xf528 1576c: 60 91 db 0d lds r22, 0x0DDB ; 0x800ddb 15770: 70 91 dc 0d lds r23, 0x0DDC ; 0x800ddc 15774: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 15778: 90 91 de 0d lds r25, 0x0DDE ; 0x800dde 1577c: 42 e0 ldi r20, 0x02 ; 2 1577e: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 15782: 82 e6 ldi r24, 0x62 ; 98 15784: 9f e7 ldi r25, 0x7F ; 127 15786: 0e 94 94 7a call 0xf528 ; 0xf528 1578a: 2c ea ldi r18, 0xAC ; 172 1578c: 35 ec ldi r19, 0xC5 ; 197 1578e: 47 e2 ldi r20, 0x27 ; 39 15790: 5e e3 ldi r21, 0x3E ; 62 15792: 60 91 df 0d lds r22, 0x0DDF ; 0x800ddf 15796: 70 91 e0 0d lds r23, 0x0DE0 ; 0x800de0 1579a: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 1579e: 90 91 e2 0d lds r25, 0x0DE2 ; 0x800de2 157a2: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 157a6: 42 e0 ldi r20, 0x02 ; 2 157a8: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 157ac: 8e e5 ldi r24, 0x5E ; 94 157ae: 9f e7 ldi r25, 0x7F ; 127 157b0: 0e 94 94 7a call 0xf528 ; 0xf528 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 157b4: 2c ea ldi r18, 0xAC ; 172 157b6: 35 ec ldi r19, 0xC5 ; 197 157b8: 47 e2 ldi r20, 0x27 ; 39 157ba: 5e e3 ldi r21, 0x3E ; 62 157bc: 60 91 e3 0d lds r22, 0x0DE3 ; 0x800de3 157c0: 70 91 e4 0d lds r23, 0x0DE4 ; 0x800de4 157c4: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 157c8: 90 91 e6 0d lds r25, 0x0DE6 ; 0x800de6 157cc: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 157d0: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 157d4: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 157d8: 83 e5 ldi r24, 0x53 ; 83 157da: 0e 94 f5 55 call 0xabea ; 0xabea 157de: 88 23 and r24, r24 157e0: 41 f0 breq .+16 ; 0x157f2 157e2: 0e 94 17 56 call 0xac2e ; 0xac2e } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 157e6: 90 93 58 02 sts 0x0258, r25 ; 0x800258 157ea: 80 93 57 02 sts 0x0257, r24 ; 0x800257 157ee: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 157f2: 90 e0 ldi r25, 0x00 ; 0 157f4: 80 e0 ldi r24, 0x00 ; 0 157f6: f7 cf rjmp .-18 ; 0x157e6 */ case 303: { float temp = 150.0; int e = 0; int c = 5; 157f8: 85 e0 ldi r24, 0x05 ; 5 157fa: 90 e0 ldi r25, 0x00 ; 0 157fc: 0c 94 0a a0 jmp 0x14014 ; 0x14014 M400 */ case 400: { st_synchronize(); 15800: 0f 94 b0 18 call 0x23160 ; 0x23160 15804: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 15808: 81 e0 ldi r24, 0x01 ; 1 1580a: 0e 94 60 77 call 0xeec0 ; 0xeec0 1580e: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 15812: 80 e0 ldi r24, 0x00 ; 0 15814: 0e 94 60 77 call 0xeec0 ; 0xeec0 15818: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 1581c: 0e 94 4b 83 call 0x10696 ; 0x10696 15820: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 M500 */ case 500: { Config_StoreSettings(); 15824: 0e 94 70 85 call 0x10ae0 ; 0x10ae0 15828: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 M502 */ case 502: { Config_ResetDefault(); 1582c: 0e 94 df 84 call 0x109be ; 0x109be 15830: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 echomagic, echomagic, cs.max_acceleration_mm_per_s2_silent[X_AXIS], cs.max_acceleration_mm_per_s2_silent[Y_AXIS], cs.max_acceleration_mm_per_s2_silent[Z_AXIS], cs.max_acceleration_mm_per_s2_silent[E_AXIS], echomagic, echomagic, cs.acceleration, cs.retract_acceleration, cs.travel_acceleration, 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] #else //TMC2130 printf_P(PSTR( 15834: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 15838: 8f 93 push r24 1583a: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 1583e: 8f 93 push r24 15840: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 15844: 8f 93 push r24 15846: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 1584a: 8f 93 push r24 1584c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 15850: 8f 93 push r24 15852: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 15856: 8f 93 push r24 15858: 80 91 c4 0d lds r24, 0x0DC4 ; 0x800dc4 1585c: 8f 93 push r24 1585e: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 15862: 8f 93 push r24 15864: 80 91 c2 0d lds r24, 0x0DC2 ; 0x800dc2 15868: 8f 93 push r24 1586a: 80 91 c1 0d lds r24, 0x0DC1 ; 0x800dc1 1586e: 8f 93 push r24 15870: 80 91 c0 0d lds r24, 0x0DC0 ; 0x800dc0 15874: 8f 93 push r24 15876: 80 91 bf 0d lds r24, 0x0DBF ; 0x800dbf 1587a: 8f 93 push r24 1587c: 0e ec ldi r16, 0xCE ; 206 1587e: 11 ea ldi r17, 0xA1 ; 161 15880: 1f 93 push r17 15882: 0f 93 push r16 15884: 1f 93 push r17 15886: 0f 93 push r16 15888: 80 91 be 0d lds r24, 0x0DBE ; 0x800dbe 1588c: 8f 93 push r24 1588e: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 15892: 8f 93 push r24 15894: 80 91 bc 0d lds r24, 0x0DBC ; 0x800dbc 15898: 8f 93 push r24 1589a: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 1589e: 8f 93 push r24 158a0: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 158a4: 8f 93 push r24 158a6: 80 91 b9 0d lds r24, 0x0DB9 ; 0x800db9 158aa: 8f 93 push r24 158ac: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 158b0: 8f 93 push r24 158b2: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 158b6: 8f 93 push r24 158b8: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 158bc: 8f 93 push r24 158be: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 158c2: 8f 93 push r24 158c4: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 158c8: 8f 93 push r24 158ca: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 158ce: 8f 93 push r24 158d0: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 158d4: 8f 93 push r24 158d6: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 158da: 8f 93 push r24 158dc: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 158e0: 8f 93 push r24 158e2: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf 158e6: 8f 93 push r24 158e8: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae 158ec: 8f 93 push r24 158ee: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad 158f2: 8f 93 push r24 158f4: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 158f8: 8f 93 push r24 158fa: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 158fe: 8f 93 push r24 15900: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa 15904: 8f 93 push r24 15906: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 1590a: 8f 93 push r24 1590c: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 15910: 8f 93 push r24 15912: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 15916: 8f 93 push r24 15918: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 1591c: 8f 93 push r24 1591e: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 15922: 8f 93 push r24 15924: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 15928: 8f 93 push r24 1592a: 80 91 a3 0d lds r24, 0x0DA3 ; 0x800da3 1592e: 8f 93 push r24 15930: 1f 93 push r17 15932: 0f 93 push r16 15934: 1f 93 push r17 15936: 0f 93 push r16 15938: 80 91 2a 0e lds r24, 0x0E2A ; 0x800e2a 1593c: 8f 93 push r24 1593e: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 15942: 8f 93 push r24 15944: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 15948: 8f 93 push r24 1594a: 80 91 27 0e lds r24, 0x0E27 ; 0x800e27 1594e: 8f 93 push r24 15950: 80 91 a2 0d lds r24, 0x0DA2 ; 0x800da2 15954: 8f 93 push r24 15956: 80 91 a1 0d lds r24, 0x0DA1 ; 0x800da1 1595a: 8f 93 push r24 1595c: 80 91 a0 0d lds r24, 0x0DA0 ; 0x800da0 15960: 8f 93 push r24 15962: 80 91 9f 0d lds r24, 0x0D9F ; 0x800d9f 15966: 8f 93 push r24 15968: 80 91 9e 0d lds r24, 0x0D9E ; 0x800d9e 1596c: 8f 93 push r24 1596e: 80 91 9d 0d lds r24, 0x0D9D ; 0x800d9d 15972: 8f 93 push r24 15974: 80 91 9c 0d lds r24, 0x0D9C ; 0x800d9c 15978: 8f 93 push r24 1597a: 80 91 9b 0d lds r24, 0x0D9B ; 0x800d9b 1597e: 8f 93 push r24 15980: 1f 93 push r17 15982: 0f 93 push r16 15984: 1f 93 push r17 15986: 0f 93 push r16 15988: 80 91 9a 0d lds r24, 0x0D9A ; 0x800d9a 1598c: 8f 93 push r24 1598e: 80 91 99 0d lds r24, 0x0D99 ; 0x800d99 15992: 8f 93 push r24 15994: 80 91 98 0d lds r24, 0x0D98 ; 0x800d98 15998: 8f 93 push r24 1599a: 80 91 97 0d lds r24, 0x0D97 ; 0x800d97 1599e: 8f 93 push r24 159a0: 80 91 96 0d lds r24, 0x0D96 ; 0x800d96 159a4: 8f 93 push r24 159a6: 80 91 95 0d lds r24, 0x0D95 ; 0x800d95 159aa: 8f 93 push r24 159ac: 80 91 94 0d lds r24, 0x0D94 ; 0x800d94 159b0: 8f 93 push r24 159b2: 80 91 93 0d lds r24, 0x0D93 ; 0x800d93 159b6: 8f 93 push r24 159b8: 80 91 92 0d lds r24, 0x0D92 ; 0x800d92 159bc: 8f 93 push r24 159be: 80 91 91 0d lds r24, 0x0D91 ; 0x800d91 159c2: 8f 93 push r24 159c4: 80 91 90 0d lds r24, 0x0D90 ; 0x800d90 159c8: 8f 93 push r24 159ca: 80 91 8f 0d lds r24, 0x0D8F ; 0x800d8f 159ce: 8f 93 push r24 159d0: 80 91 8e 0d lds r24, 0x0D8E ; 0x800d8e 159d4: 8f 93 push r24 159d6: 80 91 8d 0d lds r24, 0x0D8D ; 0x800d8d 159da: 8f 93 push r24 159dc: 80 91 8c 0d lds r24, 0x0D8C ; 0x800d8c 159e0: 8f 93 push r24 159e2: 80 91 8b 0d lds r24, 0x0D8B ; 0x800d8b 159e6: 8f 93 push r24 159e8: 1f 93 push r17 159ea: 0f 93 push r16 159ec: 1f 93 push r17 159ee: 0f 93 push r16 159f0: 80 91 8a 0d lds r24, 0x0D8A ; 0x800d8a 159f4: 8f 93 push r24 159f6: 80 91 89 0d lds r24, 0x0D89 ; 0x800d89 159fa: 8f 93 push r24 159fc: 80 91 88 0d lds r24, 0x0D88 ; 0x800d88 15a00: 8f 93 push r24 15a02: 80 91 87 0d lds r24, 0x0D87 ; 0x800d87 15a06: 8f 93 push r24 15a08: 80 91 86 0d lds r24, 0x0D86 ; 0x800d86 15a0c: 8f 93 push r24 15a0e: 80 91 85 0d lds r24, 0x0D85 ; 0x800d85 15a12: 8f 93 push r24 15a14: 80 91 84 0d lds r24, 0x0D84 ; 0x800d84 15a18: 8f 93 push r24 15a1a: 80 91 83 0d lds r24, 0x0D83 ; 0x800d83 15a1e: 8f 93 push r24 15a20: 80 91 82 0d lds r24, 0x0D82 ; 0x800d82 15a24: 8f 93 push r24 15a26: 80 91 81 0d lds r24, 0x0D81 ; 0x800d81 15a2a: 8f 93 push r24 15a2c: 80 91 80 0d lds r24, 0x0D80 ; 0x800d80 15a30: 8f 93 push r24 15a32: 80 91 7f 0d lds r24, 0x0D7F ; 0x800d7f 15a36: 8f 93 push r24 15a38: 80 91 7e 0d lds r24, 0x0D7E ; 0x800d7e 15a3c: 8f 93 push r24 15a3e: 80 91 7d 0d lds r24, 0x0D7D ; 0x800d7d 15a42: 8f 93 push r24 15a44: 80 91 7c 0d lds r24, 0x0D7C ; 0x800d7c 15a48: 8f 93 push r24 15a4a: 80 91 7b 0d lds r24, 0x0D7B ; 0x800d7b 15a4e: 8f 93 push r24 15a50: 1f 93 push r17 15a52: 0f 93 push r16 15a54: 1f 93 push r17 15a56: 0f 93 push r16 15a58: 80 91 7a 0d lds r24, 0x0D7A ; 0x800d7a 15a5c: 8f 93 push r24 15a5e: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 15a62: 8f 93 push r24 15a64: 80 91 78 0d lds r24, 0x0D78 ; 0x800d78 15a68: 8f 93 push r24 15a6a: 80 91 77 0d lds r24, 0x0D77 ; 0x800d77 15a6e: 8f 93 push r24 15a70: 80 91 76 0d lds r24, 0x0D76 ; 0x800d76 15a74: 8f 93 push r24 15a76: 80 91 75 0d lds r24, 0x0D75 ; 0x800d75 15a7a: 8f 93 push r24 15a7c: 80 91 74 0d lds r24, 0x0D74 ; 0x800d74 15a80: 8f 93 push r24 15a82: 80 91 73 0d lds r24, 0x0D73 ; 0x800d73 15a86: 8f 93 push r24 15a88: 80 91 72 0d lds r24, 0x0D72 ; 0x800d72 15a8c: 8f 93 push r24 15a8e: 80 91 71 0d lds r24, 0x0D71 ; 0x800d71 15a92: 8f 93 push r24 15a94: 80 91 70 0d lds r24, 0x0D70 ; 0x800d70 15a98: 8f 93 push r24 15a9a: 80 91 6f 0d lds r24, 0x0D6F ; 0x800d6f 15a9e: 8f 93 push r24 15aa0: 80 91 6e 0d lds r24, 0x0D6E ; 0x800d6e 15aa4: 8f 93 push r24 15aa6: 80 91 6d 0d lds r24, 0x0D6D ; 0x800d6d 15aaa: 8f 93 push r24 15aac: 80 91 6c 0d lds r24, 0x0D6C ; 0x800d6c 15ab0: 8f 93 push r24 15ab2: 80 91 6b 0d lds r24, 0x0D6B ; 0x800d6b 15ab6: 8f 93 push r24 15ab8: 1f 93 push r17 15aba: 0f 93 push r16 15abc: 1f 93 push r17 15abe: 0f 93 push r16 15ac0: 81 ea ldi r24, 0xA1 ; 161 15ac2: 9b e7 ldi r25, 0x7B ; 123 15ac4: 9f 93 push r25 15ac6: 8f 93 push r24 15ac8: 0f 94 5f a2 call 0x344be ; 0x344be 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"), 15acc: 0f b6 in r0, 0x3f ; 63 15ace: f8 94 cli 15ad0: de bf out 0x3e, r29 ; 62 15ad2: 0f be out 0x3f, r0 ; 63 15ad4: cd bf out 0x3d, r28 ; 61 15ad6: 2c ea ldi r18, 0xAC ; 172 15ad8: 35 ec ldi r19, 0xC5 ; 197 15ada: 47 e2 ldi r20, 0x27 ; 39 15adc: 5e e3 ldi r21, 0x3E ; 62 15ade: 60 91 d7 0d lds r22, 0x0DD7 ; 0x800dd7 15ae2: 70 91 d8 0d lds r23, 0x0DD8 ; 0x800dd8 15ae6: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 15aea: 90 91 da 0d lds r25, 0x0DDA ; 0x800dda 15aee: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 15af2: 9f 93 push r25 15af4: 8f 93 push r24 15af6: 7f 93 push r23 15af8: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15afa: 2c ea ldi r18, 0xAC ; 172 15afc: 35 ec ldi r19, 0xC5 ; 197 15afe: 47 e2 ldi r20, 0x27 ; 39 15b00: 5e e3 ldi r21, 0x3E ; 62 15b02: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 15b06: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 15b0a: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 15b0e: 90 91 d6 0d lds r25, 0x0DD6 ; 0x800dd6 15b12: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 15b16: 9f 93 push r25 15b18: 8f 93 push r24 15b1a: 7f 93 push r23 15b1c: 6f 93 push r22 15b1e: 80 91 d2 0d lds r24, 0x0DD2 ; 0x800dd2 15b22: 8f 93 push r24 15b24: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 15b28: 8f 93 push r24 15b2a: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 15b2e: 8f 93 push r24 15b30: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 15b34: 8f 93 push r24 15b36: 1f 93 push r17 15b38: 0f 93 push r16 15b3a: 1f 93 push r17 15b3c: 0f 93 push r16 15b3e: 84 e7 ldi r24, 0x74 ; 116 15b40: 9b e7 ldi r25, 0x7B ; 123 15b42: 9f 93 push r25 15b44: 8f 93 push r24 15b46: 0f 94 5f a2 call 0x344be ; 0x344be #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15b4a: 2c ea ldi r18, 0xAC ; 172 15b4c: 35 ec ldi r19, 0xC5 ; 197 15b4e: 47 e2 ldi r20, 0x27 ; 39 15b50: 5e e3 ldi r21, 0x3E ; 62 15b52: 60 91 e3 0d lds r22, 0x0DE3 ; 0x800de3 15b56: 70 91 e4 0d lds r23, 0x0DE4 ; 0x800de4 15b5a: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 15b5e: 90 91 e6 0d lds r25, 0x0DE6 ; 0x800de6 15b62: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__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"), 15b66: 9f 93 push r25 15b68: 8f 93 push r24 15b6a: 7f 93 push r23 15b6c: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15b6e: 2c ea ldi r18, 0xAC ; 172 15b70: 35 ec ldi r19, 0xC5 ; 197 15b72: 47 e2 ldi r20, 0x27 ; 39 15b74: 5e e3 ldi r21, 0x3E ; 62 15b76: 60 91 df 0d lds r22, 0x0DDF ; 0x800ddf 15b7a: 70 91 e0 0d lds r23, 0x0DE0 ; 0x800de0 15b7e: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 15b82: 90 91 e2 0d lds r25, 0x0DE2 ; 0x800de2 15b86: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 15b8a: 9f 93 push r25 15b8c: 8f 93 push r24 15b8e: 7f 93 push r23 15b90: 6f 93 push r22 15b92: 80 91 de 0d lds r24, 0x0DDE ; 0x800dde 15b96: 8f 93 push r24 15b98: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 15b9c: 8f 93 push r24 15b9e: 80 91 dc 0d lds r24, 0x0DDC ; 0x800ddc 15ba2: 8f 93 push r24 15ba4: 80 91 db 0d lds r24, 0x0DDB ; 0x800ddb 15ba8: 8f 93 push r24 15baa: 1f 93 push r17 15bac: 0f 93 push r16 15bae: 1f 93 push r17 15bb0: 0f 93 push r16 15bb2: 8f e3 ldi r24, 0x3F ; 63 15bb4: 9b e7 ldi r25, 0x7B ; 123 15bb6: 9f 93 push r25 15bb8: 8f 93 push r24 15bba: 0f 94 5f a2 call 0x344be ; 0x344be echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 15bbe: 0f b6 in r0, 0x3f ; 63 15bc0: f8 94 cli 15bc2: de bf out 0x3e, r29 ; 62 15bc4: 0f be out 0x3f, r0 ; 63 15bc6: cd bf out 0x3d, r28 ; 61 15bc8: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 15bcc: 1f 92 push r1 15bce: 8f 93 push r24 15bd0: 1f 93 push r17 15bd2: 0f 93 push r16 15bd4: 1f 93 push r17 15bd6: 0f 93 push r16 15bd8: 20 e0 ldi r18, 0x00 ; 0 15bda: 30 e0 ldi r19, 0x00 ; 0 15bdc: 40 e7 ldi r20, 0x70 ; 112 15bde: 52 e4 ldi r21, 0x42 ; 66 15be0: 60 91 fa 0d lds r22, 0x0DFA ; 0x800dfa 15be4: 70 91 fb 0d lds r23, 0x0DFB ; 0x800dfb 15be8: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 15bec: 90 91 fd 0d lds r25, 0x0DFD ; 0x800dfd 15bf0: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 15bf4: 9f 93 push r25 15bf6: 8f 93 push r24 15bf8: 7f 93 push r23 15bfa: 6f 93 push r22 15bfc: 80 91 f9 0d lds r24, 0x0DF9 ; 0x800df9 15c00: 8f 93 push r24 15c02: 80 91 f8 0d lds r24, 0x0DF8 ; 0x800df8 15c06: 8f 93 push r24 15c08: 80 91 f7 0d lds r24, 0x0DF7 ; 0x800df7 15c0c: 8f 93 push r24 15c0e: 80 91 f6 0d lds r24, 0x0DF6 ; 0x800df6 15c12: 8f 93 push r24 15c14: 1f 93 push r17 15c16: 0f 93 push r16 15c18: 1f 93 push r17 15c1a: 0f 93 push r16 15c1c: 80 91 f5 0d lds r24, 0x0DF5 ; 0x800df5 15c20: 8f 93 push r24 15c22: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 15c26: 8f 93 push r24 15c28: 80 91 f3 0d lds r24, 0x0DF3 ; 0x800df3 15c2c: 8f 93 push r24 15c2e: 80 91 f2 0d lds r24, 0x0DF2 ; 0x800df2 15c32: 8f 93 push r24 15c34: 20 e0 ldi r18, 0x00 ; 0 15c36: 30 e0 ldi r19, 0x00 ; 0 15c38: 40 e7 ldi r20, 0x70 ; 112 15c3a: 52 e4 ldi r21, 0x42 ; 66 15c3c: 60 91 ee 0d lds r22, 0x0DEE ; 0x800dee 15c40: 70 91 ef 0d lds r23, 0x0DEF ; 0x800def 15c44: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 15c48: 90 91 f1 0d lds r25, 0x0DF1 ; 0x800df1 15c4c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 15c50: 9f 93 push r25 15c52: 8f 93 push r24 15c54: 7f 93 push r23 15c56: 6f 93 push r22 15c58: 80 91 ed 0d lds r24, 0x0DED ; 0x800ded 15c5c: 8f 93 push r24 15c5e: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 15c62: 8f 93 push r24 15c64: 80 91 eb 0d lds r24, 0x0DEB ; 0x800deb 15c68: 8f 93 push r24 15c6a: 80 91 ea 0d lds r24, 0x0DEA ; 0x800dea 15c6e: 8f 93 push r24 15c70: 1f 93 push r17 15c72: 0f 93 push r16 15c74: 1f 93 push r17 15c76: 0f 93 push r16 15c78: 8e e3 ldi r24, 0x3E ; 62 15c7a: 9a e7 ldi r25, 0x7A ; 122 15c7c: 9f 93 push r25 15c7e: 8f 93 push r24 15c80: 0f 94 5f a2 call 0x344be ; 0x344be ); #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) { 15c84: 0f b6 in r0, 0x3f ; 63 15c86: f8 94 cli 15c88: de bf out 0x3e, r29 ; 62 15c8a: 0f be out 0x3f, r0 ; 63 15c8c: cd bf out 0x3d, r28 ; 61 15c8e: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe 15c92: 88 23 and r24, r24 15c94: 09 f4 brne .+2 ; 0x15c98 15c96: 74 c0 rjmp .+232 ; 0x15d80 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 15c98: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 15c9c: 8f 93 push r24 15c9e: 80 91 01 0e lds r24, 0x0E01 ; 0x800e01 15ca2: 8f 93 push r24 15ca4: 80 91 00 0e lds r24, 0x0E00 ; 0x800e00 15ca8: 8f 93 push r24 15caa: 80 91 ff 0d lds r24, 0x0DFF ; 0x800dff 15cae: 8f 93 push r24 15cb0: 1f 93 push r17 15cb2: 0f 93 push r16 15cb4: 1f 93 push r17 15cb6: 0f 93 push r16 15cb8: 88 e1 ldi r24, 0x18 ; 24 15cba: 9a e7 ldi r25, 0x7A ; 122 15cbc: 9f 93 push r25 15cbe: 8f 93 push r24 15cc0: 0f 94 5f a2 call 0x344be ; 0x344be 15cc4: 0f b6 in r0, 0x3f ; 63 15cc6: f8 94 cli 15cc8: de bf out 0x3e, r29 ; 62 15cca: 0f be out 0x3f, r0 ; 63 15ccc: 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( 15cce: 80 91 37 0e lds r24, 0x0E37 ; 0x800e37 15cd2: 8f 93 push r24 15cd4: 80 91 36 0e lds r24, 0x0E36 ; 0x800e36 15cd8: 8f 93 push r24 15cda: 80 91 35 0e lds r24, 0x0E35 ; 0x800e35 15cde: 8f 93 push r24 15ce0: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 15ce4: 8f 93 push r24 15ce6: 80 91 33 0e lds r24, 0x0E33 ; 0x800e33 15cea: 1f 92 push r1 15cec: 8f 93 push r24 15cee: 80 91 32 0e lds r24, 0x0E32 ; 0x800e32 15cf2: 8f 93 push r24 15cf4: 80 91 31 0e lds r24, 0x0E31 ; 0x800e31 15cf8: 8f 93 push r24 15cfa: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 15cfe: 8f 93 push r24 15d00: 80 91 2f 0e lds r24, 0x0E2F ; 0x800e2f 15d04: 8f 93 push r24 15d06: 80 91 2e 0e lds r24, 0x0E2E ; 0x800e2e 15d0a: 8f 93 push r24 15d0c: 80 91 2d 0e lds r24, 0x0E2D ; 0x800e2d 15d10: 8f 93 push r24 15d12: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 15d16: 8f 93 push r24 15d18: 80 91 2b 0e lds r24, 0x0E2B ; 0x800e2b 15d1c: 8f 93 push r24 15d1e: 0e ec ldi r16, 0xCE ; 206 15d20: 11 ea ldi r17, 0xA1 ; 161 15d22: 1f 93 push r17 15d24: 0f 93 push r16 15d26: 1f 93 push r17 15d28: 0f 93 push r16 15d2a: 87 e7 ldi r24, 0x77 ; 119 15d2c: 99 e7 ldi r25, 0x79 ; 121 15d2e: 9f 93 push r25 15d30: 8f 93 push r24 15d32: 0f 94 5f a2 call 0x344be ; 0x344be "%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(); #endif printf_P(PSTR( 15d36: 8d ee ldi r24, 0xED ; 237 15d38: 9f e0 ldi r25, 0x0F ; 15 15d3a: 0f 94 a5 a3 call 0x3474a ; 0x3474a 15d3e: f6 2e mov r15, r22 15d40: e7 2e mov r14, r23 15d42: d8 2e mov r13, r24 15d44: c9 2e mov r12, r25 15d46: 81 ef ldi r24, 0xF1 ; 241 15d48: 9f e0 ldi r25, 0x0F ; 15 15d4a: 0f 94 a5 a3 call 0x3474a ; 0x3474a 15d4e: cf 92 push r12 15d50: df 92 push r13 15d52: ef 92 push r14 15d54: ff 92 push r15 15d56: 9f 93 push r25 15d58: 8f 93 push r24 15d5a: 7f 93 push r23 15d5c: 6f 93 push r22 15d5e: 1f 93 push r17 15d60: 0f 93 push r16 15d62: 1f 93 push r17 15d64: 0f 93 push r16 15d66: 86 e5 ldi r24, 0x56 ; 86 15d68: 99 e7 ldi r25, 0x79 ; 121 15d6a: 9f 93 push r25 15d6c: 8f 93 push r24 15d6e: 0f 94 5f a2 call 0x344be ; 0x344be 15d72: 0f b6 in r0, 0x3f ; 63 15d74: f8 94 cli 15d76: de bf out 0x3e, r29 ; 62 15d78: 0f be out 0x3f, r0 ; 63 15d7a: cd bf out 0x3d, r28 ; 61 15d7c: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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); 15d80: 1f 93 push r17 15d82: 0f 93 push r16 15d84: 89 ef ldi r24, 0xF9 ; 249 15d86: 99 e7 ldi r25, 0x79 ; 121 15d88: 9f 93 push r25 15d8a: 8f 93 push r24 15d8c: 0f 94 5f a2 call 0x344be ; 0x344be 15d90: 0f 90 pop r0 15d92: 0f 90 pop r0 15d94: 0f 90 pop r0 15d96: 0f 90 pop r0 15d98: 9a cf rjmp .-204 ; 0x15cce #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 15d9a: 80 e5 ldi r24, 0x50 ; 80 15d9c: 0e 94 f5 55 call 0xabea ; 0xabea 15da0: 88 23 and r24, r24 15da2: 11 f4 brne .+4 ; 0x15da8 15da4: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 { uint8_t valCnt = 0; IP_address = 0; 15da8: 10 92 10 06 sts 0x0610, r1 ; 0x800610 15dac: 10 92 11 06 sts 0x0611, r1 ; 0x800611 15db0: 10 92 12 06 sts 0x0612, r1 ; 0x800612 15db4: 10 92 13 06 sts 0x0613, r1 ; 0x800613 15db8: 00 e1 ldi r16, 0x10 ; 16 15dba: 16 e0 ldi r17, 0x06 ; 6 15dbc: 44 e1 ldi r20, 0x14 ; 20 15dbe: e4 2e mov r14, r20 15dc0: 46 e0 ldi r20, 0x06 ; 6 15dc2: f4 2e mov r15, r20 do { *strchr_pointer = '*'; 15dc4: 5a e2 ldi r21, 0x2A ; 42 15dc6: d5 2e mov r13, r21 15dc8: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 15dcc: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 15dd0: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 15dd2: 0e 94 17 56 call 0xac2e ; 0xac2e 15dd6: d8 01 movw r26, r16 15dd8: 8d 93 st X+, r24 15dda: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 15ddc: ea 16 cp r14, r26 15dde: fb 06 cpc r15, r27 15de0: 11 f4 brne .+4 ; 0x15de6 15de2: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 15de6: 8e e2 ldi r24, 0x2E ; 46 15de8: 0e 94 f5 55 call 0xabea ; 0xabea 15dec: 81 11 cpse r24, r1 15dee: ec cf rjmp .-40 ; 0x15dc8 if (valCnt != 4) IP_address = 0; 15df0: 10 92 10 06 sts 0x0610, r1 ; 0x800610 15df4: 10 92 11 06 sts 0x0611, r1 ; 0x800611 15df8: 10 92 12 06 sts 0x0612, r1 ; 0x800612 15dfc: 10 92 13 06 sts 0x0613, r1 ; 0x800613 15e00: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 - `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(); 15e04: 0f 94 b0 18 call 0x23160 ; 0x23160 /// 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; 15e08: 80 91 73 12 lds r24, 0x1273 ; 0x801273 15e0c: 81 11 cpse r24, r1 15e0e: 02 c0 rjmp .+4 ; 0x15e14 15e10: 0e 94 76 63 call 0xc6ec ; 0xc6ec 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(); 15e14: 85 e4 ldi r24, 0x45 ; 69 15e16: 0e 94 f5 55 call 0xabea ; 0xabea 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; 15e1a: 81 2c mov r8, r1 15e1c: 91 2c mov r9, r1 15e1e: a1 2c mov r10, r1 15e20: 30 ec ldi r19, 0xC0 ; 192 15e22: 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(); 15e24: 88 23 and r24, r24 15e26: 21 f0 breq .+8 ; 0x15e30 15e28: 0e 94 85 5a call 0xb50a ; 0xb50a 15e2c: 4b 01 movw r8, r22 15e2e: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 15e30: 8c e4 ldi r24, 0x4C ; 76 15e32: 0e 94 f5 55 call 0xabea ; 0xabea 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; 15e36: c1 2c mov r12, r1 15e38: d1 2c mov r13, r1 15e3a: 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(); 15e3c: 88 23 and r24, r24 15e3e: 21 f0 breq .+8 ; 0x15e48 15e40: 0e 94 85 5a call 0xb50a ; 0xb50a 15e44: 6b 01 movw r12, r22 15e46: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 15e48: 8a e5 ldi r24, 0x5A ; 90 15e4a: 0e 94 f5 55 call 0xabea ; 0xabea // 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; 15e4e: 41 2c mov r4, r1 15e50: 51 2c mov r5, r1 15e52: 28 ed ldi r18, 0xD8 ; 216 15e54: 62 2e mov r6, r18 15e56: 21 e4 ldi r18, 0x41 ; 65 15e58: 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()); 15e5a: 88 23 and r24, r24 15e5c: 31 f0 breq .+12 ; 0x15e6a 15e5e: 0e 94 85 5a call 0xb50a ; 0xb50a 15e62: 2b 01 movw r4, r22 15e64: 3c 01 movw r6, r24 15e66: e8 94 clt 15e68: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 15e6a: 88 e5 ldi r24, 0x58 ; 88 15e6c: 0e 94 f5 55 call 0xabea ; 0xabea 15e70: 88 23 and r24, r24 15e72: 09 f4 brne .+2 ; 0x15e76 15e74: 40 c1 rjmp .+640 ; 0x160f6 15e76: 0e 94 85 5a call 0xb50a ; 0xb50a 15e7a: 68 a7 std Y+40, r22 ; 0x28 15e7c: 79 a7 std Y+41, r23 ; 0x29 15e7e: 8a a7 std Y+42, r24 ; 0x2a 15e80: 9b a7 std Y+43, r25 ; 0x2b if (code_seen('Y')) y_position = code_value(); 15e82: 89 e5 ldi r24, 0x59 ; 89 15e84: 0e 94 f5 55 call 0xabea ; 0xabea 15e88: 88 23 and r24, r24 15e8a: 09 f4 brne .+2 ; 0x15e8e 15e8c: 3d c1 rjmp .+634 ; 0x16108 15e8e: 0e 94 85 5a call 0xb50a ; 0xb50a 15e92: 6c a7 std Y+44, r22 ; 0x2c 15e94: 7d a7 std Y+45, r23 ; 0x2d 15e96: 8e a7 std Y+46, r24 ; 0x2e 15e98: 9f a7 std Y+47, r25 ; 0x2f // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 15e9a: 1a 82 std Y+2, r1 ; 0x02 15e9c: 19 82 std Y+1, r1 ; 0x01 15e9e: fe 01 movw r30, r28 15ea0: 33 96 adiw r30, 0x03 ; 3 15ea2: 83 e1 ldi r24, 0x13 ; 19 15ea4: df 01 movw r26, r30 15ea6: 1d 92 st X+, r1 15ea8: 8a 95 dec r24 15eaa: e9 f7 brne .-6 ; 0x15ea6 if (code_seen('C')) { 15eac: 83 e4 ldi r24, 0x43 ; 67 15eae: 0e 94 f5 55 call 0xabea ; 0xabea 15eb2: 88 23 and r24, r24 15eb4: f9 f0 breq .+62 ; 0x15ef4 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 15eb6: 62 e2 ldi r22, 0x22 ; 34 15eb8: 70 e0 ldi r23, 0x00 ; 0 15eba: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 15ebe: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 15ec2: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 15ec6: 8c 01 movw r16, r24 if (!this->ptr) { 15ec8: 89 2b or r24, r25 15eca: a1 f0 breq .+40 ; 0x15ef4 // First quote not found return; } // Skip the leading quote this->ptr++; 15ecc: 0f 5f subi r16, 0xFF ; 255 15ece: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 15ed0: 62 e2 ldi r22, 0x22 ; 34 15ed2: 70 e0 ldi r23, 0x00 ; 0 15ed4: c8 01 movw r24, r16 15ed6: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 if(!pStrEnd) { 15eda: 00 97 sbiw r24, 0x00 ; 0 15edc: 59 f0 breq .+22 ; 0x15ef4 // Second quote not found return; } this->len = pStrEnd - this->ptr; 15ede: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 15ee0: 84 31 cpi r24, 0x14 ; 20 15ee2: 08 f0 brcs .+2 ; 0x15ee6 15ee4: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 15ee6: 48 2f mov r20, r24 15ee8: 50 e0 ldi r21, 0x00 ; 0 15eea: b8 01 movw r22, r16 15eec: ce 01 movw r24, r28 15eee: 01 96 adiw r24, 0x01 ; 1 15ef0: 0f 94 c6 a9 call 0x3538c ; 0x3538c } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 15ef4: 80 91 01 13 lds r24, 0x1301 ; 0x801301 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; 15ef8: 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"))) 15efa: 81 30 cpi r24, 0x01 ; 1 15efc: 29 f4 brne .+10 ; 0x15f08 15efe: 89 e4 ldi r24, 0x49 ; 73 15f00: 9f e7 ldi r25, 0x7F ; 127 15f02: 0f 94 eb 39 call 0x273d6 ; 0x273d6 15f06: 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(); 15f08: 0f 94 b0 18 call 0x23160 ; 0x23160 // 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; prusa_statistics(22); 15f0c: 86 e1 ldi r24, 0x16 ; 22 15f0e: 0f 94 02 30 call 0x26004 ; 0x26004 // Turn off the fan fanSpeed = 0; 15f12: 10 92 55 12 sts 0x1255, r1 ; 0x801255 // Retract E if (!printingIsPaused()) 15f16: 0e 94 05 66 call 0xcc0a ; 0xcc0a 15f1a: 81 11 cpse r24, r1 15f1c: fa c0 rjmp .+500 ; 0x16112 { current_position[E_AXIS] += e_shift; 15f1e: a5 01 movw r20, r10 15f20: 94 01 movw r18, r8 15f22: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 15f26: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 15f2a: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 15f2e: 90 91 70 12 lds r25, 0x1270 ; 0x801270 15f32: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 15f36: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 15f3a: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 15f3e: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 15f42: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 15f46: 60 e0 ldi r22, 0x00 ; 0 15f48: 70 e0 ldi r23, 0x00 ; 0 15f4a: 88 ee ldi r24, 0xE8 ; 232 15f4c: 92 e4 ldi r25, 0x42 ; 66 15f4e: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 15f52: 0f 94 b0 18 call 0x23160 ; 0x23160 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 15f56: 8b eb ldi r24, 0xBB ; 187 15f58: 9a e6 ldi r25, 0x6A ; 106 15f5a: 0e 94 8d 7c call 0xf91a ; 0xf91a // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 15f5e: c3 01 movw r24, r6 15f60: b2 01 movw r22, r4 15f62: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 // Move XY to side current_position[X_AXIS] = x_position; 15f66: 28 a5 ldd r18, Y+40 ; 0x28 15f68: 39 a5 ldd r19, Y+41 ; 0x29 15f6a: 4a a5 ldd r20, Y+42 ; 0x2a 15f6c: 5b a5 ldd r21, Y+43 ; 0x2b 15f6e: 20 93 61 12 sts 0x1261, r18 ; 0x801261 15f72: 30 93 62 12 sts 0x1262, r19 ; 0x801262 15f76: 40 93 63 12 sts 0x1263, r20 ; 0x801263 15f7a: 50 93 64 12 sts 0x1264, r21 ; 0x801264 current_position[Y_AXIS] = y_position; 15f7e: 8c a5 ldd r24, Y+44 ; 0x2c 15f80: 9d a5 ldd r25, Y+45 ; 0x2d 15f82: ae a5 ldd r26, Y+46 ; 0x2e 15f84: bf a5 ldd r27, Y+47 ; 0x2f 15f86: 80 93 65 12 sts 0x1265, r24 ; 0x801265 15f8a: 90 93 66 12 sts 0x1266, r25 ; 0x801266 15f8e: a0 93 67 12 sts 0x1267, r26 ; 0x801267 15f92: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 15f96: 60 e0 ldi r22, 0x00 ; 0 15f98: 70 e0 ldi r23, 0x00 ; 0 15f9a: 88 e4 ldi r24, 0x48 ; 72 15f9c: 92 e4 ldi r25, 0x42 ; 66 15f9e: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 15fa2: 0f 94 b0 18 call 0x23160 ; 0x23160 bool repeat = false; 15fa6: 18 a6 std Y+40, r1 ; 0x28 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; 15fa8: 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)); 15faa: 02 e4 ldi r16, 0x42 ; 66 15fac: 20 2e mov r2, r16 15fae: 09 e7 ldi r16, 0x79 ; 121 15fb0: 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; 15fb2: 82 e0 ldi r24, 0x02 ; 2 15fb4: 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)); 15fb6: 9a e4 ldi r25, 0x4A ; 74 15fb8: 89 2e mov r8, r25 15fba: 99 e7 ldi r25, 0x79 ; 121 15fbc: 99 2e mov r9, r25 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 15fbe: 80 91 01 13 lds r24, 0x1301 ; 0x801301 15fc2: 81 30 cpi r24, 0x01 ; 1 15fc4: 09 f0 breq .+2 ; 0x15fc8 15fc6: a8 c0 rjmp .+336 ; 0x16118 eject_slot = MMU2::mmu2.get_current_tool(); 15fc8: 0f 94 7f 65 call 0x2cafe ; 0x2cafe 15fcc: b8 2e mov r11, r24 mmu_M600_unload_filament(); 15fce: 0e 94 8c 76 call 0xed18 ; 0xed18 } 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 15fd2: 0f 94 b0 18 call 0x23160 ; 0x23160 FSensorBlockRunout fsBlockRunout; 15fd6: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 if (!MMU2::mmu2.Enabled()) 15fda: 80 91 01 13 lds r24, 0x1301 ; 0x801301 15fde: 81 30 cpi r24, 0x01 ; 1 15fe0: 09 f4 brne .+2 ; 0x15fe4 15fe2: 64 c1 rjmp .+712 ; 0x162ac { KEEPALIVE_STATE(PAUSED_FOR_USER); 15fe4: 84 e0 ldi r24, 0x04 ; 4 15fe6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_UNLOAD_SUCCESSFUL), false, LCD_LEFT_BUTTON_CHOICE); 15fea: 8d ee ldi r24, 0xED ; 237 15fec: 98 e3 ldi r25, 0x38 ; 56 15fee: 0e 94 0a 75 call 0xea14 ; 0xea14 15ff2: 40 e0 ldi r20, 0x00 ; 0 15ff4: 60 e0 ldi r22, 0x00 ; 0 15ff6: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 15ffa: 08 2f mov r16, r24 lcd_update_enable(false); 15ffc: 80 e0 ldi r24, 0x00 ; 0 15ffe: 0e 94 08 70 call 0xe010 ; 0xe010 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 16002: 01 30 cpi r16, 0x01 ; 1 16004: 29 f5 brne .+74 ; 0x16050 lcd_clear(); 16006: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 1600a: 85 e6 ldi r24, 0x65 ; 101 1600c: 99 e3 ldi r25, 0x39 ; 57 1600e: 0e 94 0a 75 call 0xea14 ; 0xea14 16012: ac 01 movw r20, r24 16014: 62 e0 ldi r22, 0x02 ; 2 16016: 80 e0 ldi r24, 0x00 ; 0 16018: 0e 94 d7 6f call 0xdfae ; 0xdfae current_position[X_AXIS] = 100; 1601c: 80 e0 ldi r24, 0x00 ; 0 1601e: 90 e0 ldi r25, 0x00 ; 0 16020: a8 ec ldi r26, 0xC8 ; 200 16022: b2 e4 ldi r27, 0x42 ; 66 16024: 80 93 61 12 sts 0x1261, r24 ; 0x801261 16028: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1602c: a0 93 63 12 sts 0x1263, r26 ; 0x801263 16030: b0 93 64 12 sts 0x1264, r27 ; 0x801264 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 16034: 60 e0 ldi r22, 0x00 ; 0 16036: 70 e0 ldi r23, 0x00 ; 0 16038: 88 e4 ldi r24, 0x48 ; 72 1603a: 92 e4 ldi r25, 0x42 ; 66 1603c: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 16040: 0f 94 b0 18 call 0x23160 ; 0x23160 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 16044: 8b eb ldi r24, 0xBB ; 187 16046: 98 e3 ldi r25, 0x38 ; 56 16048: 0e 94 0a 75 call 0xea14 ; 0xea14 1604c: 0e 94 85 e8 call 0x1d10a ; 0x1d10a preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 16050: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 16054: 89 e4 ldi r24, 0x49 ; 73 16056: 98 e3 ldi r25, 0x38 ; 56 16058: 0e 94 0a 75 call 0xea14 ; 0xea14 1605c: ac 01 movw r20, r24 1605e: 60 e0 ldi r22, 0x00 ; 0 16060: 80 e0 ldi r24, 0x00 ; 0 16062: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(0, 1); 16066: 61 e0 ldi r22, 0x01 ; 1 16068: 80 e0 ldi r24, 0x00 ; 0 1606a: 0e 94 2a 6f call 0xde54 ; 0xde54 if (filament_name[0]) { 1606e: 89 81 ldd r24, Y+1 ; 0x01 16070: 88 23 and r24, r24 16072: 41 f0 breq .+16 ; 0x16084 lcd_print(filament_name); 16074: ce 01 movw r24, r28 16076: 01 96 adiw r24, 0x01 ; 1 16078: 0e 94 2f 73 call 0xe65e ; 0xe65e lcd_set_cursor(0, 2); 1607c: 62 e0 ldi r22, 0x02 ; 2 1607e: 80 e0 ldi r24, 0x00 ; 0 16080: 0e 94 2a 6f call 0xde54 ; 0xde54 } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 16084: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 16088: 81 11 cpse r24, r1 1608a: 06 c0 rjmp .+12 ; 0x16098 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 1608c: 84 e3 ldi r24, 0x34 ; 52 1608e: 98 e3 ldi r25, 0x38 ; 56 16090: 0e 94 0a 75 call 0xea14 ; 0xea14 16094: 0e 94 ed 6e call 0xddda ; 0xddda 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); 16098: 84 e0 ldi r24, 0x04 ; 4 1609a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(!lcd_clicked()) 1609e: 0e 94 45 73 call 0xe68a ; 0xe68a 160a2: 81 11 cpse r24, r1 160a4: 10 c0 rjmp .+32 ; 0x160c6 { manage_heater(); 160a6: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 160aa: 81 e0 ldi r24, 0x01 ; 1 160ac: 0e 94 25 8a call 0x1144a ; 0x1144a #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 160b0: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 160b4: 88 23 and r24, r24 160b6: 99 f3 breq .-26 ; 0x1609e Sound_MakeCustom(50,1000,false); 160b8: 40 e0 ldi r20, 0x00 ; 0 160ba: 68 ee ldi r22, 0xE8 ; 232 160bc: 73 e0 ldi r23, 0x03 ; 3 160be: 82 e3 ldi r24, 0x32 ; 50 160c0: 90 e0 ldi r25, 0x00 ; 0 160c2: 0f 94 55 25 call 0x24aaa ; 0x24aaa break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 160c6: a0 92 78 02 sts 0x0278, r10 ; 0x800278 M600_load_filament_movements(filament_name); 160ca: ce 01 movw r24, r28 160cc: 01 96 adiw r24, 0x01 ; 1 160ce: 0e 94 45 76 call 0xec8a ; 0xec8a Sound_MakeCustom(50,1000,false); 160d2: 40 e0 ldi r20, 0x00 ; 0 160d4: 68 ee ldi r22, 0xE8 ; 232 160d6: 73 e0 ldi r23, 0x03 ; 3 160d8: 82 e3 ldi r24, 0x32 ; 50 160da: 90 e0 ldi r25, 0x00 ; 0 160dc: 0f 94 55 25 call 0x24aaa ; 0x24aaa 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); 160e0: b4 e0 ldi r27, 0x04 ; 4 160e2: 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) 160e4: 11 23 and r17, r17 160e6: 09 f4 brne .+2 ; 0x160ea 160e8: f6 c0 rjmp .+492 ; 0x162d6 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 160ea: 0f 94 3f 6d call 0x2da7e ; 0x2da7e current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 160ee: 48 a5 ldd r20, Y+40 ; 0x28 160f0: 41 11 cpse r20, r1 160f2: 65 cf rjmp .-310 ; 0x15fbe 160f4: 99 c1 rjmp .+818 ; 0x16428 // 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; 160f6: 20 e0 ldi r18, 0x00 ; 0 160f8: 30 e0 ldi r19, 0x00 ; 0 160fa: 43 e5 ldi r20, 0x53 ; 83 160fc: 53 e4 ldi r21, 0x43 ; 67 160fe: 28 a7 std Y+40, r18 ; 0x28 16100: 39 a7 std Y+41, r19 ; 0x29 16102: 4a a7 std Y+42, r20 ; 0x2a 16104: 5b a7 std Y+43, r21 ; 0x2b 16106: bd ce rjmp .-646 ; 0x15e82 float y_position = FILAMENTCHANGE_YPOS; 16108: 1c a6 std Y+44, r1 ; 0x2c 1610a: 1d a6 std Y+45, r1 ; 0x2d 1610c: 1e a6 std Y+46, r1 ; 0x2e 1610e: 1f a6 std Y+47, r1 ; 0x2f 16110: c4 ce rjmp .-632 ; 0x15e9a 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(); 16112: 0e 94 f3 63 call 0xc7e6 ; 0xc7e6 16116: 23 cf rjmp .-442 ; 0x15f5e //! //! 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); 16118: 84 e0 ldi r24, 0x04 ; 4 1611a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 unsigned long waiting_start_time = _millis(); 1611e: 0f 94 56 0b call 0x216ac ; 0x216ac 16122: 2b 01 movw r4, r22 16124: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 16126: 89 e0 ldi r24, 0x09 ; 9 16128: 98 e3 ldi r25, 0x38 ; 56 1612a: 0e 94 0a 75 call 0xea14 ; 0xea14 1612e: 0e 94 9a de call 0x1bd34 ; 0x1bd34 while (!(wait_for_user_state == 0 && lcd_clicked())){ 16132: 0e 94 45 73 call 0xe68a ; 0xe68a 16136: 08 2f mov r16, r24 16138: 81 11 cpse r24, r1 1613a: 34 c0 rjmp .+104 ; 0x161a4 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) { 1613c: a3 01 movw r20, r6 1613e: 92 01 movw r18, r4 16140: 20 54 subi r18, 0x40 ; 64 16142: 38 4d sbci r19, 0xD8 ; 216 16144: 46 4f sbci r20, 0xF6 ; 246 16146: 5f 4f sbci r21, 0xFF ; 255 16148: 2c a7 std Y+44, r18 ; 0x2c 1614a: 3d a7 std Y+45, r19 ; 0x2d 1614c: 4e a7 std Y+46, r20 ; 0x2e 1614e: 5f a7 std Y+47, r21 ; 0x2f 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(); 16150: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 16154: 81 e0 ldi r24, 0x01 ; 1 16156: 0e 94 25 8a call 0x1144a ; 0x1144a if (wait_for_user_state != 2) sound_wait_for_user(); 1615a: 02 30 cpi r16, 0x02 ; 2 1615c: 09 f4 brne .+2 ; 0x16160 1615e: 65 c0 rjmp .+202 ; 0x1622a 16160: 0f 94 eb 25 call 0x24bd6 ; 0x24bd6 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); 16164: 84 e0 ldi r24, 0x04 ; 4 16166: 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) { 16168: 01 30 cpi r16, 0x01 ; 1 1616a: 29 f1 breq .+74 ; 0x161b6 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 1616c: 0e 94 7f 8c call 0x118fe ; 0x118fe if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 16170: 0f 94 56 0b call 0x216ac ; 0x216ac 16174: 2c a5 ldd r18, Y+44 ; 0x2c 16176: 3d a5 ldd r19, Y+45 ; 0x2d 16178: 4e a5 ldd r20, Y+46 ; 0x2e 1617a: 5f a5 ldd r21, Y+47 ; 0x2f 1617c: 26 17 cp r18, r22 1617e: 37 07 cpc r19, r23 16180: 48 07 cpc r20, r24 16182: 59 07 cpc r21, r25 16184: b0 f6 brcc .-84 ; 0x16132 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 16186: 88 ed ldi r24, 0xD8 ; 216 16188: 97 e3 ldi r25, 0x37 ; 55 1618a: 0e 94 0a 75 call 0xea14 ; 0xea14 1618e: 0e 94 9a de call 0x1bd34 ; 0x1bd34 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 16192: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 16196: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 1619a: 0f 94 b0 18 call 0x23160 ; 0x23160 disable_e0(); 1619e: 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; 161a0: 01 e0 ldi r16, 0x01 ; 1 161a2: d6 cf rjmp .-84 ; 0x16150 161a4: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL10beep_timer.lto_priv.499> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 161a8: 10 92 c1 04 sts 0x04C1, r1 ; 0x8004c1 <_ZL6bFirst.lto_priv.500> 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); 161ac: c7 01 movw r24, r14 161ae: b6 01 movw r22, r12 161b0: 0e 94 6f e1 call 0x1c2de ; 0x1c2de 161b4: 0e cf rjmp .-484 ; 0x15fd2 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); 161b6: 0e 94 7f 8c call 0x118fe ; 0x118fe if (lcd_clicked()) { 161ba: 0e 94 45 73 call 0xe68a ; 0xe68a 161be: 88 23 and r24, r24 161c0: 39 f2 breq .-114 ; 0x16150 161c2: 80 91 5b 12 lds r24, 0x125B ; 0x80125b 161c6: 90 91 5c 12 lds r25, 0x125C ; 0x80125c 161ca: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 161ce: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 161d2: 86 e3 ldi r24, 0x36 ; 54 161d4: 9d e3 ldi r25, 0x3D ; 61 161d6: 0e 94 0a 75 call 0xea14 ; 0xea14 161da: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 161de: 42 e8 ldi r20, 0x82 ; 130 161e0: 64 e0 ldi r22, 0x04 ; 4 161e2: 80 e0 ldi r24, 0x00 ; 0 161e4: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 161e8: 80 91 5e 12 lds r24, 0x125E ; 0x80125e 161ec: 8f 93 push r24 161ee: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 161f2: 8f 93 push r24 161f4: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 161f8: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 161fc: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 16200: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 16204: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 16208: 7f 93 push r23 1620a: 6f 93 push r22 1620c: 3f 92 push r3 1620e: 2f 92 push r2 16210: 0e 94 db 6e call 0xddb6 ; 0xddb6 lcd_putc(LCD_STR_DEGREE[0]); 16214: 81 e8 ldi r24, 0x81 ; 129 16216: 0e 94 f1 6e call 0xdde2 ; 0xdde2 1621a: 0f 90 pop r0 1621c: 0f 90 pop r0 1621e: 0f 90 pop r0 16220: 0f 90 pop r0 16222: 0f 90 pop r0 16224: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 16226: 02 e0 ldi r16, 0x02 ; 2 16228: 93 cf rjmp .-218 ; 0x16150 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1622a: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 1622e: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 16232: 07 2e mov r0, r23 16234: 00 0c add r0, r0 16236: 88 0b sbc r24, r24 16238: 99 0b sbc r25, r25 1623a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 1623e: 20 91 5a 0d lds r18, 0x0D5A ; 0x800d5a 16242: 30 91 5b 0d lds r19, 0x0D5B ; 0x800d5b 16246: 40 91 5c 0d lds r20, 0x0D5C ; 0x800d5c 1624a: 50 91 5d 0d lds r21, 0x0D5D ; 0x800d5d 1624e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 16252: 9f 77 andi r25, 0x7F ; 127 16254: 20 e0 ldi r18, 0x00 ; 0 16256: 30 e0 ldi r19, 0x00 ; 0 16258: 40 ea ldi r20, 0xA0 ; 160 1625a: 50 e4 ldi r21, 0x40 ; 64 1625c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 16260: 87 ff sbrs r24, 7 16262: 0b c0 rjmp .+22 ; 0x1627a lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 16264: 89 e0 ldi r24, 0x09 ; 9 16266: 98 e3 ldi r25, 0x38 ; 56 16268: 0e 94 0a 75 call 0xea14 ; 0xea14 1626c: 0e 94 9a de call 0x1bd34 ; 0x1bd34 waiting_start_time = _millis(); 16270: 0f 94 56 0b call 0x216ac ; 0x216ac 16274: 2b 01 movw r4, r22 16276: 3c 01 movw r6, r24 16278: 5c cf rjmp .-328 ; 0x16132 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 1627a: 64 e0 ldi r22, 0x04 ; 4 1627c: 81 e0 ldi r24, 0x01 ; 1 1627e: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 16282: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 16286: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1628a: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1628e: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 16292: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 16296: 7f 93 push r23 16298: 6f 93 push r22 1629a: 9f 92 push r9 1629c: 8f 92 push r8 1629e: 0e 94 db 6e call 0xddb6 ; 0xddb6 162a2: 0f 90 pop r0 162a4: 0f 90 pop r0 162a6: 0f 90 pop r0 162a8: 0f 90 pop r0 162aa: 52 cf rjmp .-348 ; 0x16150 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 162ac: 11 11 cpse r17, r1 162ae: 03 c0 rjmp .+6 ; 0x162b6 162b0: 8b 2d mov r24, r11 162b2: 0e 94 a2 8c call 0x11944 ; 0x11944 mmu_M600_load_filament(automatic); 162b6: 81 2f mov r24, r17 162b8: 0e 94 52 7b call 0xf6a4 ; 0xf6a4 162bc: 11 cf rjmp .-478 ; 0x160e0 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 162be: 03 30 cpi r16, 0x03 ; 3 162c0: 10 f4 brcc .+4 ; 0x162c6 cursor_pos++; 162c2: 0f 5f subi r16, 0xFF ; 255 162c4: 49 c0 rjmp .+146 ; 0x16358 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 162c6: 87 e0 ldi r24, 0x07 ; 7 162c8: 0f 94 62 23 call 0x246c4 ; 0x246c4 162cc: 45 c0 rjmp .+138 ; 0x16358 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); 162ce: ce 01 movw r24, r28 162d0: 01 96 adiw r24, 0x01 ; 1 162d2: 0e 94 45 76 call 0xec8a ; 0xec8a 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); 162d6: 70 92 78 02 sts 0x0278, r7 ; 0x800278 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 162da: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 162de: 85 e8 ldi r24, 0x85 ; 133 162e0: 98 e3 ldi r25, 0x38 ; 56 162e2: 0e 94 0a 75 call 0xea14 ; 0xea14 162e6: ac 01 movw r20, r24 162e8: 60 e0 ldi r22, 0x00 ; 0 162ea: 81 e0 ldi r24, 0x01 ; 1 162ec: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 162f0: 8f e6 ldi r24, 0x6F ; 111 162f2: 98 e3 ldi r25, 0x38 ; 56 162f4: 0e 94 0a 75 call 0xea14 ; 0xea14 162f8: ac 01 movw r20, r24 162fa: 61 e0 ldi r22, 0x01 ; 1 162fc: 81 e0 ldi r24, 0x01 ; 1 162fe: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 16302: 8b e5 ldi r24, 0x5B ; 91 16304: 98 e3 ldi r25, 0x38 ; 56 16306: 0e 94 0a 75 call 0xea14 ; 0xea14 1630a: ac 01 movw r20, r24 1630c: 62 e0 ldi r22, 0x02 ; 2 1630e: 81 e0 ldi r24, 0x01 ; 1 16310: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 16314: 8f ef ldi r24, 0xFF ; 255 16316: 96 e4 ldi r25, 0x46 ; 70 16318: 0e 94 0a 75 call 0xea14 ; 0xea14 1631c: ac 01 movw r20, r24 1631e: 63 e0 ldi r22, 0x03 ; 3 16320: 81 e0 ldi r24, 0x01 ; 1 16322: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_putc_at(0, cursor_pos, '>'); 16326: 4e e3 ldi r20, 0x3E ; 62 16328: 60 e0 ldi r22, 0x00 ; 0 1632a: 80 e0 ldi r24, 0x00 ; 0 1632c: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_consume_click(); 16330: 0e 94 40 73 call 0xe680 ; 0xe680 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 16334: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 16336: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1633a: 81 e0 ldi r24, 0x01 ; 1 1633c: 0e 94 25 8a call 0x1144a ; 0x1144a if (lcd_encoder) 16340: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 16344: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 16348: 00 97 sbiw r24, 0x00 ; 0 1634a: d9 f0 breq .+54 ; 0x16382 { if (lcd_encoder < 0 ) { 1634c: 97 ff sbrs r25, 7 1634e: b7 cf rjmp .-146 ; 0x162be // Rotating knob counter clockwise if (cursor_pos > 0) 16350: 00 23 and r16, r16 16352: 09 f4 brne .+2 ; 0x16356 16354: b8 cf rjmp .-144 ; 0x162c6 cursor_pos--; 16356: 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 ")); 16358: 4e e4 ldi r20, 0x4E ; 78 1635a: 59 e7 ldi r21, 0x79 ; 121 1635c: 60 e0 ldi r22, 0x00 ; 0 1635e: 80 e0 ldi r24, 0x00 ; 0 16360: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_putc_at(0, cursor_pos, '>'); 16364: 4e e3 ldi r20, 0x3E ; 62 16366: 60 2f mov r22, r16 16368: 80 e0 ldi r24, 0x00 ; 0 1636a: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 // Consume rotation event and make feedback sound lcd_encoder = 0; 1636e: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 16372: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e _delay(100); 16376: 64 e6 ldi r22, 0x64 ; 100 16378: 70 e0 ldi r23, 0x00 ; 0 1637a: 80 e0 ldi r24, 0x00 ; 0 1637c: 90 e0 ldi r25, 0x00 ; 0 1637e: 0f 94 23 0b call 0x21646 ; 0x21646 } if (lcd_clicked()) 16382: 0e 94 45 73 call 0xe68a ; 0xe68a 16386: 88 23 and r24, r24 16388: b1 f2 breq .-84 ; 0x16336 { lcd_clear(); 1638a: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_return_to_status(); 1638e: 0f 94 6d 05 call 0x20ada ; 0x20ada lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 16392: a0 92 78 02 sts 0x0278, r10 ; 0x800278 switch(lcd_change_filament_state) 16396: 02 30 cpi r16, 0x02 ; 2 16398: b1 f0 breq .+44 ; 0x163c6 1639a: 03 30 cpi r16, 0x03 ; 3 1639c: 09 f4 brne .+2 ; 0x163a0 1639e: f6 c0 rjmp .+492 ; 0x1658c 163a0: 01 30 cpi r16, 0x01 ; 1 163a2: 81 f5 brne .+96 ; 0x16404 { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 163a4: 80 91 01 13 lds r24, 0x1301 ; 0x801301 163a8: 81 30 cpi r24, 0x01 ; 1 163aa: 09 f0 breq .+2 ; 0x163ae 163ac: 90 cf rjmp .-224 ; 0x162ce uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 163ae: 0f 94 7f 65 call 0x2cafe ; 0x2cafe 163b2: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 163b4: 0e 94 8c 76 call 0xed18 ; 0xed18 // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 163b8: 80 2f mov r24, r16 163ba: 0e 94 a2 8c call 0x11944 ; 0x11944 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 163be: 80 e0 ldi r24, 0x00 ; 0 163c0: 0e 94 52 7b call 0xf6a4 ; 0xf6a4 163c4: 88 cf rjmp .-240 ; 0x162d6 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 163c6: 0f 94 b0 18 call 0x23160 ; 0x23160 load_filament_final_feed(); 163ca: 0e 94 bd 63 call 0xc77a ; 0xc77a 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(); 163ce: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 163d2: 89 e9 ldi r24, 0x99 ; 153 163d4: 98 e3 ldi r25, 0x38 ; 56 163d6: 0e 94 0a 75 call 0xea14 ; 0xea14 163da: ac 01 movw r20, r24 163dc: 60 e0 ldi r22, 0x00 ; 0 163de: 80 e0 ldi r24, 0x00 ; 0 163e0: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 163e4: 85 e6 ldi r24, 0x65 ; 101 163e6: 99 e3 ldi r25, 0x39 ; 57 163e8: 0e 94 0a 75 call 0xea14 ; 0xea14 163ec: ac 01 movw r20, r24 163ee: 62 e0 ldi r22, 0x02 ; 2 163f0: 80 e0 ldi r24, 0x00 ; 0 163f2: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 163f6: 87 e9 ldi r24, 0x97 ; 151 163f8: 9d e1 ldi r25, 0x1D ; 29 163fa: 0f 94 3e 09 call 0x2127c ; 0x2127c lcd_loading_color(); st_synchronize(); 163fe: 0f 94 b0 18 call 0x23160 ; 0x23160 16402: 69 cf rjmp .-302 ; 0x162d6 } void lcd_change_success() { lcd_clear(); 16404: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 16408: 89 ea ldi r24, 0xA9 ; 169 1640a: 98 e3 ldi r25, 0x38 ; 56 1640c: 0e 94 0a 75 call 0xea14 ; 0xea14 16410: ac 01 movw r20, r24 16412: 62 e0 ldi r22, 0x02 ; 2 16414: 80 e0 ldi r24, 0x00 ; 0 16416: 0e 94 d7 6f call 0xdfae ; 0xdfae //! @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) 1641a: 00 23 and r16, r16 1641c: 19 f0 breq .+6 ; 0x16424 1641e: 03 30 cpi r16, 0x03 ; 3 16420: 09 f0 breq .+2 ; 0x16424 16422: 59 cf rjmp .-334 ; 0x162d6 16424: 0f 94 3f 6d call 0x2da7e ; 0x2da7e if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 16428: 81 e0 ldi r24, 0x01 ; 1 1642a: 0e 94 08 70 call 0xe010 ; 0xe010 // Not let's go back to print fanSpeed = saved_fan_speed; 1642e: 80 91 54 12 lds r24, 0x1254 ; 0x801254 16432: 80 93 55 12 sts 0x1255, r24 ; 0x801255 // Feed a little of filament to stabilize pressure if (!automatic) { 16436: 11 11 cpse r17, r1 16438: 27 c0 rjmp .+78 ; 0x16488 if (printingIsPaused()) 1643a: 0e 94 05 66 call 0xcc0a ; 0xcc0a 1643e: c0 90 6d 12 lds r12, 0x126D ; 0x80126d 16442: d0 90 6e 12 lds r13, 0x126E ; 0x80126e 16446: e0 90 6f 12 lds r14, 0x126F ; 0x80126f 1644a: f0 90 70 12 lds r15, 0x1270 ; 0x801270 1644e: 88 23 and r24, r24 16450: 09 f4 brne .+2 ; 0x16454 16452: 9f c0 rjmp .+318 ; 0x16592 { // 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; 16454: 20 e0 ldi r18, 0x00 ; 0 16456: 30 e0 ldi r19, 0x00 ; 0 16458: 40 e8 ldi r20, 0x80 ; 128 1645a: 5f e3 ldi r21, 0x3F ; 63 1645c: c7 01 movw r24, r14 1645e: b6 01 movw r22, r12 16460: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 16464: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 16468: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1646c: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 16470: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 16474: 60 e0 ldi r22, 0x00 ; 0 16476: 70 e0 ldi r23, 0x00 ; 0 16478: 88 ee ldi r24, 0xE8 ; 232 1647a: 92 e4 ldi r25, 0x42 ; 66 1647c: 0f 94 0a 4a call 0x29414 ; 0x29414 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 16480: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 16484: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d 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); 16488: e0 90 69 12 lds r14, 0x1269 ; 0x801269 1648c: f0 90 6a 12 lds r15, 0x126A ; 0x80126a 16490: 00 91 6b 12 lds r16, 0x126B ; 0x80126b 16494: 10 91 6c 12 lds r17, 0x126C ; 0x80126c 16498: 20 91 94 02 lds r18, 0x0294 ; 0x800294 1649c: 30 91 95 02 lds r19, 0x0295 ; 0x800295 164a0: 40 91 96 02 lds r20, 0x0296 ; 0x800296 164a4: 50 91 97 02 lds r21, 0x0297 ; 0x800297 164a8: 60 91 90 02 lds r22, 0x0290 ; 0x800290 164ac: 70 91 91 02 lds r23, 0x0291 ; 0x800291 164b0: 80 91 92 02 lds r24, 0x0292 ; 0x800292 164b4: 90 91 93 02 lds r25, 0x0293 ; 0x800293 164b8: 1f 92 push r1 164ba: 1f 92 push r1 164bc: 1f 92 push r1 164be: 1f 92 push r1 164c0: 81 2c mov r8, r1 164c2: 91 2c mov r9, r1 164c4: e8 e4 ldi r30, 0x48 ; 72 164c6: ae 2e mov r10, r30 164c8: e2 e4 ldi r30, 0x42 ; 66 164ca: be 2e mov r11, r30 164cc: fd e6 ldi r31, 0x6D ; 109 164ce: cf 2e mov r12, r31 164d0: f2 e1 ldi r31, 0x12 ; 18 164d2: df 2e mov r13, r31 164d4: 0f 94 bc 3a call 0x27578 ; 0x27578 st_synchronize(); 164d8: 0f 94 b0 18 call 0x23160 ; 0x23160 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 164dc: e0 90 98 02 lds r14, 0x0298 ; 0x800298 164e0: f0 90 99 02 lds r15, 0x0299 ; 0x800299 164e4: 00 91 9a 02 lds r16, 0x029A ; 0x80029a 164e8: 10 91 9b 02 lds r17, 0x029B ; 0x80029b 164ec: 20 91 94 02 lds r18, 0x0294 ; 0x800294 164f0: 30 91 95 02 lds r19, 0x0295 ; 0x800295 164f4: 40 91 96 02 lds r20, 0x0296 ; 0x800296 164f8: 50 91 97 02 lds r21, 0x0297 ; 0x800297 164fc: 60 91 90 02 lds r22, 0x0290 ; 0x800290 16500: 70 91 91 02 lds r23, 0x0291 ; 0x800291 16504: 80 91 92 02 lds r24, 0x0292 ; 0x800292 16508: 90 91 93 02 lds r25, 0x0293 ; 0x800293 1650c: 1f 92 push r1 1650e: 1f 92 push r1 16510: 1f 92 push r1 16512: 1f 92 push r1 16514: 81 2c mov r8, r1 16516: 91 2c mov r9, r1 16518: a0 e7 ldi r26, 0x70 ; 112 1651a: aa 2e mov r10, r26 1651c: a1 e4 ldi r26, 0x41 ; 65 1651e: ba 2e mov r11, r26 16520: 0f 94 bc 3a call 0x27578 ; 0x27578 st_synchronize(); 16524: 0f 94 b0 18 call 0x23160 ; 0x23160 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 16528: 8c e9 ldi r24, 0x9C ; 156 1652a: 92 e0 ldi r25, 0x02 ; 2 1652c: 0f 94 62 3a call 0x274c4 ; 0x274c4 memcpy(current_position, saved_pos, sizeof(saved_pos)); 16530: 80 e1 ldi r24, 0x10 ; 16 16532: e0 e9 ldi r30, 0x90 ; 144 16534: f2 e0 ldi r31, 0x02 ; 2 16536: a1 e6 ldi r26, 0x61 ; 97 16538: b2 e1 ldi r27, 0x12 ; 18 1653a: 01 90 ld r0, Z+ 1653c: 0d 92 st X+, r0 1653e: 8a 95 dec r24 16540: e1 f7 brne .-8 ; 0x1653a set_destination_to_current(); 16542: 0e 94 7e 66 call 0xccfc ; 0xccfc // Recover feed rate feedmultiply = saved_feedmultiply2; 16546: 80 91 5f 12 lds r24, 0x125F ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.498> 1654a: 90 91 60 12 lds r25, 0x1260 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.498+0x1> 1654e: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 16552: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f enquecommandf_P(MSG_M220, saved_feedmultiply2); 16556: 9f 93 push r25 16558: 8f 93 push r24 1655a: 87 ee ldi r24, 0xE7 ; 231 1655c: 94 e6 ldi r25, 0x64 ; 100 1655e: 9f 93 push r25 16560: 8f 93 push r24 16562: 0e 94 a8 8d call 0x11b50 ; 0x11b50 if (printingIsPaused()) { 16566: 0e 94 05 66 call 0xcc0a ; 0xcc0a 1656a: 0f b6 in r0, 0x3f ; 63 1656c: f8 94 cli 1656e: de bf out 0x3e, r29 ; 62 16570: 0f be out 0x3f, r0 ; 63 16572: cd bf out 0x3d, r28 ; 61 16574: 88 23 and r24, r24 16576: 21 f1 breq .+72 ; 0x165c0 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 16578: 8c e6 ldi r24, 0x6C ; 108 1657a: 9b e4 ldi r25, 0x4B ; 75 1657c: 0e 94 0a 75 call 0xea14 ; 0xea14 16580: 0e 94 85 dc call 0x1b90a ; 0x1b90a } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 16584: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 16588: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 st_synchronize(); break; // Unload filament case 3: return true; 1658c: 31 e0 ldi r19, 0x01 ; 1 1658e: 38 a7 std Y+40, r19 ; 0x28 16590: ac cd rjmp .-1192 ; 0x160ea setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 16592: 20 e0 ldi r18, 0x00 ; 0 16594: 30 e0 ldi r19, 0x00 ; 0 16596: 40 ea ldi r20, 0xA0 ; 160 16598: 50 e4 ldi r21, 0x40 ; 64 1659a: c7 01 movw r24, r14 1659c: b6 01 movw r22, r12 1659e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 165a2: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 165a6: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 165aa: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 165ae: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 165b2: 60 e0 ldi r22, 0x00 ; 0 165b4: 70 e0 ldi r23, 0x00 ; 0 165b6: 80 e0 ldi r24, 0x00 ; 0 165b8: 90 e4 ldi r25, 0x40 ; 64 165ba: 0f 94 0a 4a call 0x29414 ; 0x29414 165be: 64 cf rjmp .-312 ; 0x16488 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 165c0: 86 ee ldi r24, 0xE6 ; 230 165c2: 9b e6 ldi r25, 0x6B ; 107 165c4: 0e 94 85 dc call 0x1b90a ; 0x1b90a SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 165c8: 87 e3 ldi r24, 0x37 ; 55 165ca: 98 e6 ldi r25, 0x68 ; 104 165cc: 0e 94 8d 7c call 0xf91a ; 0xf91a 165d0: d9 cf rjmp .-78 ; 0x16584 SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 165d2: 0e 94 05 66 call 0xcc0a ; 0xcc0a 165d6: 81 11 cpse r24, r1 165d8: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 st_synchronize(); 165dc: 0f 94 b0 18 call 0x23160 ; 0x23160 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 165e0: 0e 94 1a 83 call 0x10634 ; 0x10634 cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 165e4: 0e 94 13 79 call 0xf226 ; 0xf226 lcd_pause_print(); 165e8: 0f 94 62 0b call 0x216c4 ; 0x216c4 165ec: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 165f0: 0e 94 05 66 call 0xcc0a ; 0xcc0a 165f4: 88 23 and r24, r24 165f6: 11 f4 brne .+4 ; 0x165fc 165f8: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 165fc: 0c 94 4d a2 jmp 0x1449a ; 0x1449a SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 16600: 81 ea ldi r24, 0xA1 ; 161 16602: 9d e0 ldi r25, 0x0D ; 13 16604: 0f 94 9d a3 call 0x3473a ; 0x3473a 16608: 18 2f mov r17, r24 } if (code_seen('Z')){ 1660a: 8a e5 ldi r24, 0x5A ; 90 1660c: 0e 94 f5 55 call 0xabea ; 0xabea 16610: 88 23 and r24, r24 16612: 09 f4 brne .+2 ; 0x16616 16614: d7 c0 rjmp .+430 ; 0x167c4 z_val = code_value(); 16616: 0e 94 85 5a call 0xb50a ; 0xb50a 1661a: 2b 01 movw r4, r22 1661c: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 1661e: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 16622: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 16626: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1662a: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1662e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 16632: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 16636: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 16638: 9b 01 movw r18, r22 1663a: 21 56 subi r18, 0x61 ; 97 1663c: 30 4f sbci r19, 0xF0 ; 240 1663e: 20 3a cpi r18, 0xA0 ; 160 16640: 3f 40 sbci r19, 0x0F ; 15 16642: 30 f0 brcs .+12 ; 0x16650 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 16644: 84 e1 ldi r24, 0x14 ; 20 16646: 9f e7 ldi r25, 0x7F ; 127 16648: 0e 94 8d 7c call 0xf91a ; 0xf91a 1664c: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 16650: 5b e0 ldi r21, 0x0B ; 11 16652: 15 9f mul r17, r21 16654: 90 01 movw r18, r0 16656: 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); 16658: c9 01 movw r24, r18 1665a: 80 5b subi r24, 0xB0 ; 176 1665c: 92 4f sbci r25, 0xF2 ; 242 1665e: 0f 94 df a3 call 0x347be ; 0x347be { 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')) 16662: 8c e4 ldi r24, 0x4C ; 76 16664: 0e 94 f5 55 call 0xabea ; 0xabea 16668: bb e0 ldi r27, 0x0B ; 11 1666a: 1b 9f mul r17, r27 1666c: 70 01 movw r14, r0 1666e: 11 24 eor r1, r1 16670: 57 01 movw r10, r14 16672: e7 eb ldi r30, 0xB7 ; 183 16674: ae 1a sub r10, r30 16676: e2 ef ldi r30, 0xF2 ; 242 16678: be 0a sbc r11, r30 1667a: 88 23 and r24, r24 1667c: 09 f4 brne .+2 ; 0x16680 1667e: be c0 rjmp .+380 ; 0x167fc { char *src = strchr_pointer + 1; 16680: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 16684: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 16688: 31 96 adiw r30, 0x01 ; 1 1668a: bf 01 movw r22, r30 while (*src == ' ') ++src; 1668c: 81 91 ld r24, Z+ 1668e: 80 32 cpi r24, 0x20 ; 32 16690: e1 f3 breq .-8 ; 0x1668a if (*src != '\0') 16692: 88 23 and r24, r24 16694: 31 f0 breq .+12 ; 0x166a2 { strncpy(strLabel,src,7); 16696: 47 e0 ldi r20, 0x07 ; 7 16698: 50 e0 ldi r21, 0x00 ; 0 1669a: ce 01 movw r24, r28 1669c: 01 96 adiw r24, 0x01 ; 1 1669e: 0f 94 1d aa call 0x3543a ; 0x3543a #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); 166a2: 47 e0 ldi r20, 0x07 ; 7 166a4: 50 e0 ldi r21, 0x00 ; 0 166a6: b5 01 movw r22, r10 166a8: ce 01 movw r24, r28 166aa: 01 96 adiw r24, 0x01 ; 1 166ac: 0f 94 b1 a3 call 0x34762 ; 0x34762 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 166b0: 82 e4 ldi r24, 0x42 ; 66 166b2: 0e 94 f5 55 call 0xabea ; 0xabea 166b6: 57 01 movw r10, r14 166b8: fe ea ldi r31, 0xAE ; 174 166ba: af 1a sub r10, r31 166bc: f2 ef ldi r31, 0xF2 ; 242 166be: bf 0a sbc r11, r31 166c0: 88 23 and r24, r24 166c2: 09 f4 brne .+2 ; 0x166c6 166c4: a3 c0 rjmp .+326 ; 0x1680c { iBedC = code_value_uint8(); 166c6: 0e 94 0a 56 call 0xac14 ; 0xac14 166ca: 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); 166cc: 68 2f mov r22, r24 166ce: c5 01 movw r24, r10 166d0: 0f 94 c1 a3 call 0x34782 ; 0x34782 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 166d4: 80 e5 ldi r24, 0x50 ; 80 166d6: 0e 94 f5 55 call 0xabea ; 0xabea 166da: 2d ea ldi r18, 0xAD ; 173 166dc: e2 1a sub r14, r18 166de: 22 ef ldi r18, 0xF2 ; 242 166e0: f2 0a sbc r15, r18 166e2: 88 23 and r24, r24 166e4: 09 f4 brne .+2 ; 0x166e8 166e6: 97 c0 rjmp .+302 ; 0x16816 { iPindaC = code_value_uint8(); 166e8: 0e 94 0a 56 call 0xac14 ; 0xac14 166ec: b8 2e mov r11, r24 166ee: 68 2f mov r22, r24 166f0: c7 01 movw r24, r14 166f2: 0f 94 c1 a3 call 0x34782 ; 0x34782 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 166f6: 81 e4 ldi r24, 0x41 ; 65 166f8: 0e 94 f5 55 call 0xabea ; 0xabea 166fc: 88 23 and r24, r24 166fe: 09 f4 brne .+2 ; 0x16702 16700: 8f c0 rjmp .+286 ; 0x16820 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 16702: 0e 94 0a 56 call 0xac14 ; 0xac14 16706: 81 11 cpse r24, r1 16708: 06 c0 rjmp .+12 ; 0x16716 1670a: 81 ea ldi r24, 0xA1 ; 161 1670c: 9d e0 ldi r25, 0x0D ; 13 1670e: 0f 94 9d a3 call 0x3473a ; 0x3473a 16712: 18 13 cpse r17, r24 16714: 8d c0 rjmp .+282 ; 0x16830 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 16716: 81 2f mov r24, r17 16718: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 1671c: 08 2f mov r16, r24 1671e: 88 23 and r24, r24 16720: 29 f0 breq .+10 ; 0x1672c 16722: 61 2f mov r22, r17 16724: 81 ea ldi r24, 0xA1 ; 161 16726: 9d e0 ldi r25, 0x0D ; 13 16728: 0f 94 c1 a3 call 0x34782 ; 0x34782 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 1672c: 8d e0 ldi r24, 0x0D ; 13 1672e: 9f e7 ldi r25, 0x7F ; 127 16730: 0e 94 94 7a call 0xf528 ; 0xf528 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 16734: 61 2f mov r22, r17 16736: 70 e0 ldi r23, 0x00 ; 0 16738: 90 e0 ldi r25, 0x00 ; 0 1673a: 80 e0 ldi r24, 0x00 ; 0 1673c: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 16740: 81 2f mov r24, r17 16742: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 16746: 81 11 cpse r24, r1 16748: 04 c0 rjmp .+8 ; 0x16752 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 1674a: 8c ef ldi r24, 0xFC ; 252 1674c: 9e e7 ldi r25, 0x7E ; 126 1674e: 0e 94 8d 7c call 0xf91a ; 0xf91a SERIAL_PROTOCOLPGM(" Z"); 16752: 89 ef ldi r24, 0xF9 ; 249 16754: 9e e7 ldi r25, 0x7E ; 126 16756: 0e 94 94 7a call 0xf528 ; 0xf528 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1675a: 44 e0 ldi r20, 0x04 ; 4 1675c: c3 01 movw r24, r6 1675e: b2 01 movw r22, r4 16760: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 16764: 86 ef ldi r24, 0xF6 ; 246 16766: 9e e7 ldi r25, 0x7E ; 126 16768: 0e 94 94 7a call 0xf528 ; 0xf528 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1676c: b6 01 movw r22, r12 1676e: dd 0c add r13, r13 16770: 88 0b sbc r24, r24 16772: 99 0b sbc r25, r25 16774: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 16778: 83 ef ldi r24, 0xF3 ; 243 1677a: 9e e7 ldi r25, 0x7E ; 126 1677c: 0e 94 94 7a call 0xf528 ; 0xf528 16780: ce 01 movw r24, r28 16782: 01 96 adiw r24, 0x01 ; 1 16784: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 16788: 80 ef ldi r24, 0xF0 ; 240 1678a: 9e e7 ldi r25, 0x7E ; 126 1678c: 0e 94 94 7a call 0xf528 ; 0xf528 16790: 69 2d mov r22, r9 16792: 70 e0 ldi r23, 0x00 ; 0 16794: 90 e0 ldi r25, 0x00 ; 0 16796: 80 e0 ldi r24, 0x00 ; 0 16798: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 1679c: 8d ee ldi r24, 0xED ; 237 1679e: 9e e7 ldi r25, 0x7E ; 126 167a0: 0e 94 94 7a call 0xf528 ; 0xf528 167a4: 6b 2d mov r22, r11 167a6: 70 e0 ldi r23, 0x00 ; 0 167a8: 90 e0 ldi r25, 0x00 ; 0 167aa: 80 e0 ldi r24, 0x00 ; 0 167ac: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 167b0: 8a ee ldi r24, 0xEA ; 234 167b2: 9e e7 ldi r25, 0x7E ; 126 167b4: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLLN((int)bIsActive); 167b8: 80 2f mov r24, r16 167ba: 90 e0 ldi r25, 0x00 ; 0 167bc: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e 167c0: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } 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))); 167c4: ab e0 ldi r26, 0x0B ; 11 167c6: 1a 9f mul r17, r26 167c8: c0 01 movw r24, r0 167ca: 11 24 eor r1, r1 167cc: 80 5b subi r24, 0xB0 ; 176 167ce: 92 4f sbci r25, 0xF2 ; 242 167d0: 0f 94 ab a3 call 0x34756 ; 0x34756 167d4: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 167d6: bc 01 movw r22, r24 167d8: 99 0f add r25, r25 167da: 88 0b sbc r24, r24 167dc: 99 0b sbc r25, r25 167de: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 167e2: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 167e6: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 167ea: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 167ee: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 167f2: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 167f6: 2b 01 movw r4, r22 167f8: 3c 01 movw r6, r24 167fa: 33 cf rjmp .-410 ; 0x16662 } 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)); 167fc: 47 e0 ldi r20, 0x07 ; 7 167fe: 50 e0 ldi r21, 0x00 ; 0 16800: b5 01 movw r22, r10 16802: ce 01 movw r24, r28 16804: 01 96 adiw r24, 0x01 ; 1 16806: 0f 94 8d a3 call 0x3471a ; 0x3471a 1680a: 52 cf rjmp .-348 ; 0x166b0 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); 1680c: c5 01 movw r24, r10 1680e: 0f 94 9d a3 call 0x3473a ; 0x3473a 16812: 98 2e mov r9, r24 16814: 5f cf rjmp .-322 ; 0x166d4 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); 16816: c7 01 movw r24, r14 16818: 0f 94 9d a3 call 0x3473a ; 0x3473a 1681c: b8 2e mov r11, r24 1681e: 6b cf rjmp .-298 ; 0x166f6 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 16820: 81 ea ldi r24, 0xA1 ; 161 16822: 9d e0 ldi r25, 0x0D ; 13 16824: 0f 94 9d a3 call 0x3473a ; 0x3473a 16828: 01 e0 ldi r16, 0x01 ; 1 1682a: 18 17 cp r17, r24 1682c: 09 f4 brne .+2 ; 0x16830 1682e: 7e cf rjmp .-260 ; 0x1672c { 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; 16830: 00 e0 ldi r16, 0x00 ; 0 16832: 7c cf rjmp .-264 ; 0x1672c */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 16834: 83 e5 ldi r24, 0x53 ; 83 16836: 0e 94 f5 55 call 0xabea ; 0xabea 1683a: 88 23 and r24, r24 1683c: 11 f4 brne .+4 ; 0x16842 1683e: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 set_target_pinda = code_value_short(); 16842: 0e 94 17 56 call 0xac2e ; 0xac2e 16846: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 16848: 85 e6 ldi r24, 0x65 ; 101 1684a: 99 e3 ldi r25, 0x39 ; 57 1684c: 0e 94 0a 75 call 0xea14 ; 0xea14 16850: 0e 94 85 dc call 0x1b90a ; 0x1b90a SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 16854: 87 ec ldi r24, 0xC7 ; 199 16856: 9e e7 ldi r25, 0x7E ; 126 16858: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLLN(set_target_pinda); 1685c: c8 01 movw r24, r16 1685e: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e codenum = _millis(); 16862: 0f 94 56 0b call 0x216ac ; 0x216ac 16866: 4b 01 movw r8, r22 16868: 5c 01 movw r10, r24 cancel_heatup = false; 1686a: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.392> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 1686e: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 16872: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 16876: 89 2b or r24, r25 16878: 41 f4 brne .+16 ; 0x1688a 1687a: ff 24 eor r15, r15 1687c: f3 94 inc r15 1687e: 80 91 59 12 lds r24, 0x1259 ; 0x801259 16882: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 16886: 89 2b or r24, r25 16888: 09 f0 breq .+2 ; 0x1688c SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 1688a: 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)) ) { 1688c: 28 01 movw r4, r16 1688e: 01 2e mov r0, r17 16890: 00 0c add r0, r0 16892: 66 08 sbc r6, r6 16894: 77 08 sbc r7, r7 16896: f1 10 cpse r15, r1 16898: 1a c0 rjmp .+52 ; 0x168ce 1689a: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.392> 1689e: 81 11 cpse r24, r1 168a0: 10 c0 rjmp .+32 ; 0x168c2 168a2: c3 01 movw r24, r6 168a4: b2 01 movw r22, r4 168a6: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 168aa: 20 91 85 03 lds r18, 0x0385 ; 0x800385 168ae: 30 91 86 03 lds r19, 0x0386 ; 0x800386 168b2: 40 91 87 03 lds r20, 0x0387 ; 0x800387 168b6: 50 91 88 03 lds r21, 0x0388 ; 0x800388 168ba: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 168be: 18 16 cp r1, r24 168c0: b4 f0 brlt .+44 ; 0x168ee } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 168c2: 8c ee ldi r24, 0xEC ; 236 168c4: 99 e6 ldi r25, 0x69 ; 105 168c6: 0e 94 85 dc call 0x1b90a ; 0x1b90a 168ca: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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)) ) { 168ce: c3 01 movw r24, r6 168d0: b2 01 movw r22, r4 168d2: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 168d6: 20 91 85 03 lds r18, 0x0385 ; 0x800385 168da: 30 91 86 03 lds r19, 0x0386 ; 0x800386 168de: 40 91 87 03 lds r20, 0x0387 ; 0x800387 168e2: 50 91 88 03 lds r21, 0x0388 ; 0x800388 168e6: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 168ea: 87 ff sbrs r24, 7 168ec: ea cf rjmp .-44 ; 0x168c2 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 168ee: 0f 94 56 0b call 0x216ac ; 0x216ac 168f2: 68 19 sub r22, r8 168f4: 79 09 sbc r23, r9 168f6: 8a 09 sbc r24, r10 168f8: 9b 09 sbc r25, r11 168fa: 69 3e cpi r22, 0xE9 ; 233 168fc: 73 40 sbci r23, 0x03 ; 3 168fe: 81 05 cpc r24, r1 16900: 91 05 cpc r25, r1 16902: c8 f0 brcs .+50 ; 0x16936 { SERIAL_PROTOCOLPGM("P:"); 16904: 84 ec ldi r24, 0xC4 ; 196 16906: 9e e7 ldi r25, 0x7E ; 126 16908: 0e 94 94 7a call 0xf528 ; 0xf528 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1690c: 60 91 85 03 lds r22, 0x0385 ; 0x800385 16910: 70 91 86 03 lds r23, 0x0386 ; 0x800386 16914: 80 91 87 03 lds r24, 0x0387 ; 0x800387 16918: 90 91 88 03 lds r25, 0x0388 ; 0x800388 1691c: 41 e0 ldi r20, 0x01 ; 1 1691e: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 16922: 8f e2 ldi r24, 0x2F ; 47 16924: 0e 94 81 79 call 0xf302 ; 0xf302 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 16928: c8 01 movw r24, r16 1692a: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e codenum = _millis(); 1692e: 0f 94 56 0b call 0x216ac ; 0x216ac 16932: 4b 01 movw r8, r22 16934: 5c 01 movw r10, r24 } manage_heater(); 16936: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(); 1693a: 80 e0 ldi r24, 0x00 ; 0 1693c: 0e 94 25 8a call 0x1144a ; 0x1144a lcd_update(0); 16940: 80 e0 ldi r24, 0x00 ; 0 16942: 0e 94 c9 6e call 0xdd92 ; 0xdd92 16946: a7 cf rjmp .-178 ; 0x16896 - `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 16948: 8f e3 ldi r24, 0x3F ; 63 1694a: 0e 94 f5 55 call 0xabea ; 0xabea 1694e: 88 23 and r24, r24 16950: c9 f0 breq .+50 ; 0x16984 SERIAL_PROTOCOLPGM("PINDA cal status: "); 16952: 81 eb ldi r24, 0xB1 ; 177 16954: 9e e7 ldi r25, 0x7E ; 126 16956: 0e 94 94 7a call 0xf528 ; 0xf528 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); } 1695a: 86 ea ldi r24, 0xA6 ; 166 1695c: 9f e0 ldi r25, 0x0F ; 15 1695e: 0f 94 9d a3 call 0x3473a ; 0x3473a 16962: 21 e0 ldi r18, 0x01 ; 1 16964: 30 e0 ldi r19, 0x00 ; 0 16966: 81 11 cpse r24, r1 16968: 02 c0 rjmp .+4 ; 0x1696e 1696a: 30 e0 ldi r19, 0x00 ; 0 1696c: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 1696e: c9 01 movw r24, r18 16970: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e SERIAL_PROTOCOLLNRPGM(_header); 16974: 8a e9 ldi r24, 0x9A ; 154 16976: 9e e7 ldi r25, 0x7E ; 126 16978: 0e 94 8d 7c call 0xf91a ; 0xf91a gcode_M861_print_pinda_cal_eeprom(); 1697c: 0e 94 cc 7a call 0xf598 ; 0xf598 16980: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } else if (code_seen('!')) { // ! - Set factory default values 16984: 81 e2 ldi r24, 0x21 ; 33 16986: 0e 94 f5 55 call 0xabea ; 0xabea 1698a: 88 23 and r24, r24 1698c: 49 f1 breq .+82 ; 0x169e0 1698e: 61 e0 ldi r22, 0x01 ; 1 16990: 86 ea ldi r24, 0xA6 ; 166 16992: 9f e0 ldi r25, 0x0F ; 15 16994: 0f 94 c1 a3 call 0x34782 ; 0x34782 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 16998: 68 e0 ldi r22, 0x08 ; 8 1699a: 70 e0 ldi r23, 0x00 ; 0 1699c: 80 eb ldi r24, 0xB0 ; 176 1699e: 9f e0 ldi r25, 0x0F ; 15 169a0: 0f 94 df a3 call 0x347be ; 0x347be 169a4: 68 e1 ldi r22, 0x18 ; 24 169a6: 70 e0 ldi r23, 0x00 ; 0 169a8: 82 eb ldi r24, 0xB2 ; 178 169aa: 9f e0 ldi r25, 0x0F ; 15 169ac: 0f 94 df a3 call 0x347be ; 0x347be 169b0: 60 e3 ldi r22, 0x30 ; 48 169b2: 70 e0 ldi r23, 0x00 ; 0 169b4: 84 eb ldi r24, 0xB4 ; 180 169b6: 9f e0 ldi r25, 0x0F ; 15 169b8: 0f 94 df a3 call 0x347be ; 0x347be 169bc: 60 e5 ldi r22, 0x50 ; 80 169be: 70 e0 ldi r23, 0x00 ; 0 169c0: 86 eb ldi r24, 0xB6 ; 182 169c2: 9f e0 ldi r25, 0x0F ; 15 169c4: 0f 94 df a3 call 0x347be ; 0x347be 169c8: 68 e7 ldi r22, 0x78 ; 120 169ca: 70 e0 ldi r23, 0x00 ; 0 169cc: 88 eb ldi r24, 0xB8 ; 184 169ce: 9f e0 ldi r25, 0x0F ; 15 169d0: 0f 94 df a3 call 0x347be ; 0x347be 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"); 169d4: 89 e8 ldi r24, 0x89 ; 137 169d6: 9e e7 ldi r25, 0x7E ; 126 169d8: 0e 94 8d 7c call 0xf91a ; 0xf91a 169dc: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 169e0: 8a e5 ldi r24, 0x5A ; 90 169e2: 0e 94 f5 55 call 0xabea ; 0xabea 169e6: 88 23 and r24, r24 169e8: c1 f0 breq .+48 ; 0x16a1a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 169ea: 61 e0 ldi r22, 0x01 ; 1 169ec: 86 ea ldi r24, 0xA6 ; 166 169ee: 9f e0 ldi r25, 0x0F ; 15 169f0: 0f 94 c1 a3 call 0x34782 ; 0x34782 169f4: 00 eb ldi r16, 0xB0 ; 176 169f6: 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); 169f8: 70 e0 ldi r23, 0x00 ; 0 169fa: 60 e0 ldi r22, 0x00 ; 0 169fc: c8 01 movw r24, r16 169fe: 0f 94 df a3 call 0x347be ; 0x347be 16a02: 0e 5f subi r16, 0xFE ; 254 16a04: 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++) { 16a06: 0a 3b cpi r16, 0xBA ; 186 16a08: 4f e0 ldi r20, 0x0F ; 15 16a0a: 14 07 cpc r17, r20 16a0c: a9 f7 brne .-22 ; 0x169f8 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 16a0e: 8f e7 ldi r24, 0x7F ; 127 16a10: 9e e7 ldi r25, 0x7E ; 126 16a12: 0e 94 8d 7c call 0xf91a ; 0xf91a 16a16: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 16a1a: 83 e5 ldi r24, 0x53 ; 83 16a1c: 0e 94 f5 55 call 0xabea ; 0xabea 16a20: 88 23 and r24, r24 16a22: 21 f1 breq .+72 ; 0x16a6c int16_t usteps = code_value_short(); 16a24: 0e 94 17 56 call 0xac2e ; 0xac2e 16a28: 8c 01 movw r16, r24 if (code_seen('I')) { 16a2a: 89 e4 ldi r24, 0x49 ; 73 16a2c: 0e 94 f5 55 call 0xabea ; 0xabea 16a30: 88 23 and r24, r24 16a32: 11 f4 brne .+4 ; 0x16a38 16a34: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 uint8_t index = code_value_uint8(); 16a38: 0e 94 0a 56 call 0xac14 ; 0xac14 if (index < 5) { 16a3c: 85 30 cpi r24, 0x05 ; 5 16a3e: 10 f0 brcs .+4 ; 0x16a44 16a40: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 16a44: 90 e0 ldi r25, 0x00 ; 0 16a46: 88 52 subi r24, 0x28 ; 40 16a48: 98 4f sbci r25, 0xF8 ; 248 16a4a: b8 01 movw r22, r16 16a4c: 88 0f add r24, r24 16a4e: 99 1f adc r25, r25 16a50: 0f 94 df a3 call 0x347be ; 0x347be SERIAL_PROTOCOLLNRPGM(MSG_OK); 16a54: 8c ee ldi r24, 0xEC ; 236 16a56: 99 e6 ldi r25, 0x69 ; 105 16a58: 0e 94 8d 7c call 0xf91a ; 0xf91a SERIAL_PROTOCOLLNRPGM(_header); 16a5c: 8a e9 ldi r24, 0x9A ; 154 16a5e: 9e e7 ldi r25, 0x7E ; 126 16a60: 0e 94 8d 7c call 0xf91a ; 0xf91a gcode_M861_print_pinda_cal_eeprom(); 16a64: 0e 94 cc 7a call 0xf598 ; 0xf598 16a68: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 16a6c: 8e e6 ldi r24, 0x6E ; 110 16a6e: 9e e7 ldi r25, 0x7E ; 126 16a70: 0e 94 8d 7c call 0xf91a ; 0xf91a 16a74: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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) 16a78: 64 30 cpi r22, 0x04 ; 4 16a7a: 09 f4 brne .+2 ; 0x16a7e 16a7c: be c0 rjmp .+380 ; 0x16bfa 16a7e: 65 30 cpi r22, 0x05 ; 5 16a80: 11 f0 breq .+4 ; 0x16a86 16a82: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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')) 16a86: 80 e5 ldi r24, 0x50 ; 80 16a88: 0e 94 f5 55 call 0xabea ; 0xabea 16a8c: 88 23 and r24, r24 16a8e: 09 f4 brne .+2 ; 0x16a92 16a90: 3a c1 rjmp .+628 ; 0x16d06 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 16a92: 0e 94 5d 56 call 0xacba ; 0xacba done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 16a96: 10 91 e8 03 lds r17, 0x03E8 ; 0x8003e8 16a9a: 11 23 and r17, r17 16a9c: 11 f4 brne .+4 ; 0x16aa2 16a9e: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 16aa2: 62 30 cpi r22, 0x02 ; 2 16aa4: 71 05 cpc r23, r1 16aa6: 10 f4 brcc .+4 ; 0x16aac 16aa8: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 16aac: 8b ea ldi r24, 0xAB ; 171 16aae: 96 e3 ldi r25, 0x36 ; 54 16ab0: 0e 94 0a 75 call 0xea14 ; 0xea14 16ab4: 7c 01 movw r14, r24 16ab6: 84 e8 ldi r24, 0x84 ; 132 16ab8: 96 e3 ldi r25, 0x36 ; 54 16aba: 0e 94 0a 75 call 0xea14 ; 0xea14 16abe: 41 2f mov r20, r17 16ac0: b7 01 movw r22, r14 16ac2: 0e 94 d0 e8 call 0x1d1a0 ; 0x1d1a0 16ac6: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 16aca: 80 e5 ldi r24, 0x50 ; 80 16acc: 0e 94 f5 55 call 0xabea ; 0xabea 16ad0: 88 23 and r24, r24 16ad2: a9 f0 breq .+42 ; 0x16afe { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 16ad4: 0e 94 85 5a call 0xb50a ; 0xb50a 16ad8: 20 e0 ldi r18, 0x00 ; 0 16ada: 30 e0 ldi r19, 0x00 ; 0 16adc: 4a e7 ldi r20, 0x7A ; 122 16ade: 54 e4 ldi r21, 0x44 ; 68 16ae0: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 16ae4: 20 e0 ldi r18, 0x00 ; 0 16ae6: 30 e0 ldi r19, 0x00 ; 0 16ae8: 40 e0 ldi r20, 0x00 ; 0 16aea: 5f e3 ldi r21, 0x3F ; 63 16aec: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 16af0: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> nozzle_diameter_check(nDiameter); 16af4: cb 01 movw r24, r22 16af6: 0e 94 0f e9 call 0x1d21e ; 0x1d21e 16afa: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } else if(code_seen('Q')) 16afe: 81 e5 ldi r24, 0x51 ; 81 16b00: 0e 94 f5 55 call 0xabea ; 0xabea 16b04: 88 23 and r24, r24 16b06: 11 f4 brne .+4 ; 0x16b0c 16b08: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 16b0c: 85 ea ldi r24, 0xA5 ; 165 16b0e: 9d e0 ldi r25, 0x0D ; 13 16b10: 0f 94 ab a3 call 0x34756 ; 0x34756 16b14: bc 01 movw r22, r24 16b16: 90 e0 ldi r25, 0x00 ; 0 16b18: 80 e0 ldi r24, 0x00 ; 0 16b1a: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 16b1e: 20 e0 ldi r18, 0x00 ; 0 16b20: 30 e0 ldi r19, 0x00 ; 0 16b22: 4a e7 ldi r20, 0x7A ; 122 16b24: 54 e4 ldi r21, 0x44 ; 68 16b26: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 16b2a: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 16b2e: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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')) 16b32: 81 e5 ldi r24, 0x51 ; 81 16b34: 0e 94 f5 55 call 0xabea ; 0xabea 16b38: 88 23 and r24, r24 16b3a: 11 f4 brne .+4 ; 0x16b40 16b3c: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 16b40: b8 01 movw r22, r16 16b42: 90 e0 ldi r25, 0x00 ; 0 16b44: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 16b46: 4a e0 ldi r20, 0x0A ; 10 16b48: 0e 94 95 79 call 0xf32a ; 0xf32a } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 16b4c: 0e 94 8c 7a call 0xf518 ; 0xf518 16b50: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 16b54: 80 91 01 13 lds r24, 0x1301 ; 0x801301 return _sPrinterMmuName; 16b58: 74 e3 ldi r23, 0x34 ; 52 16b5a: e7 2e mov r14, r23 16b5c: 79 e7 ldi r23, 0x79 ; 121 16b5e: f7 2e mov r15, r23 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 16b60: 81 30 cpi r24, 0x01 ; 1 16b62: 21 f0 breq .+8 ; 0x16b6c return _sPrinterMmuName; } else { return _sPrinterName; 16b64: 6e e2 ldi r22, 0x2E ; 46 16b66: e6 2e mov r14, r22 16b68: 69 e7 ldi r22, 0x79 ; 121 16b6a: f6 2e mov r15, r22 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 16b6c: 80 e5 ldi r24, 0x50 ; 80 16b6e: 0e 94 f5 55 call 0xabea ; 0xabea 16b72: 88 23 and r24, r24 16b74: b1 f1 breq .+108 ; 0x16be2 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 16b76: 62 e2 ldi r22, 0x22 ; 34 16b78: 70 e0 ldi r23, 0x00 ; 0 16b7a: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 16b7e: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 16b82: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 16b86: 8c 01 movw r16, r24 if (!this->ptr) { 16b88: 89 2b or r24, r25 16b8a: d1 f0 breq .+52 ; 0x16bc0 // First quote not found return; } // Skip the leading quote this->ptr++; 16b8c: 0f 5f subi r16, 0xFF ; 255 16b8e: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 16b90: 62 e2 ldi r22, 0x22 ; 34 16b92: 70 e0 ldi r23, 0x00 ; 0 16b94: c8 01 movw r24, r16 16b96: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 if(!pStrEnd) { 16b9a: 00 97 sbiw r24, 0x00 ; 0 16b9c: 89 f0 breq .+34 ; 0x16bc0 // Second quote not found return; } this->len = pStrEnd - this->ptr; 16b9e: d8 2e mov r13, r24 16ba0: d0 1a sub r13, r16 16ba2: c7 01 movw r24, r14 16ba4: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 16ba8: d8 12 cpse r13, r24 16baa: 0a c0 rjmp .+20 ; 0x16bc0 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 16bac: ac 01 movw r20, r24 16bae: 55 27 eor r21, r21 16bb0: b7 01 movw r22, r14 16bb2: c8 01 movw r24, r16 16bb4: 0f 94 7c a1 call 0x342f8 ; 0x342f8 16bb8: 89 2b or r24, r25 16bba: 11 f4 brne .+4 ; 0x16bc0 16bbc: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } } render_M862_warnings( 16bc0: f0 90 ea 03 lds r15, 0x03EA ; 0x8003ea 16bc4: 89 e8 ldi r24, 0x89 ; 137 16bc6: 97 e3 ldi r25, 0x37 ; 55 16bc8: 0e 94 0a 75 call 0xea14 ; 0xea14 16bcc: 8c 01 movw r16, r24 16bce: 8b e5 ldi r24, 0x5B ; 91 16bd0: 97 e3 ldi r25, 0x37 ; 55 16bd2: 0e 94 0a 75 call 0xea14 ; 0xea14 16bd6: 4f 2d mov r20, r15 16bd8: b8 01 movw r22, r16 16bda: 0e 94 d0 e8 call 0x1d1a0 ; 0x1d1a0 16bde: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 16be2: 81 e5 ldi r24, 0x51 ; 81 16be4: 0e 94 f5 55 call 0xabea ; 0xabea 16be8: 88 23 and r24, r24 16bea: 11 f4 brne .+4 ; 0x16bf0 16bec: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 SERIAL_PROTOCOLLNRPGM(type); 16bf0: c7 01 movw r24, r14 16bf2: 0e 94 8d 7c call 0xf91a ; 0xf91a 16bf6: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 16bfa: 80 e5 ldi r24, 0x50 ; 80 16bfc: 0e 94 f5 55 call 0xabea ; 0xabea 16c00: 88 23 and r24, r24 16c02: 09 f4 brne .+2 ; 0x16c06 16c04: 77 c0 rjmp .+238 ; 0x16cf4 fw_version_check(++strchr_pointer); 16c06: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 16c0a: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 16c0e: 01 96 adiw r24, 0x01 ; 1 16c10: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 16c14: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 16c18: 20 91 e9 03 lds r18, 0x03E9 ; 0x8003e9 16c1c: 22 23 and r18, r18 16c1e: 11 f4 brne .+4 ; 0x16c24 16c20: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 16c24: be 01 movw r22, r28 16c26: 6f 5f subi r22, 0xFF ; 255 16c28: 7f 4f sbci r23, 0xFF ; 255 16c2a: 0e 94 8c d7 call 0x1af18 ; 0x1af18 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 16c2e: 8a e0 ldi r24, 0x0A ; 10 16c30: 90 e0 ldi r25, 0x00 ; 0 16c32: 0f 94 ab a3 call 0x34756 ; 0x34756 16c36: 29 81 ldd r18, Y+1 ; 0x01 16c38: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c3a: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c3c: 82 17 cp r24, r18 16c3e: 93 07 cpc r25, r19 16c40: 28 f0 brcs .+10 ; 0x16c4c return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c42: 11 e0 ldi r17, 0x01 ; 1 16c44: 28 17 cp r18, r24 16c46: 39 07 cpc r19, r25 16c48: 08 f4 brcc .+2 ; 0x16c4c 16c4a: 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; 16c4c: 12 95 swap r17 16c4e: 11 0f add r17, r17 16c50: 11 0f add r17, r17 16c52: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 16c54: 8c e0 ldi r24, 0x0C ; 12 16c56: 90 e0 ldi r25, 0x00 ; 0 16c58: 0f 94 ab a3 call 0x34756 ; 0x34756 16c5c: ac 01 movw r20, r24 16c5e: 2b 81 ldd r18, Y+3 ; 0x03 16c60: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c62: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c64: 42 17 cp r20, r18 16c66: 53 07 cpc r21, r19 16c68: 28 f0 brcs .+10 ; 0x16c74 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c6a: 81 e0 ldi r24, 0x01 ; 1 16c6c: 24 17 cp r18, r20 16c6e: 35 07 cpc r19, r21 16c70: 08 f4 brcc .+2 ; 0x16c74 16c72: 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; 16c74: 50 e1 ldi r21, 0x10 ; 16 16c76: 85 9f mul r24, r21 16c78: c0 01 movw r24, r0 16c7a: 11 24 eor r1, r1 16c7c: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 16c7e: 8e e0 ldi r24, 0x0E ; 14 16c80: 90 e0 ldi r25, 0x00 ; 0 16c82: 0f 94 ab a3 call 0x34756 ; 0x34756 16c86: ac 01 movw r20, r24 16c88: 2d 81 ldd r18, Y+5 ; 0x05 16c8a: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c8c: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c8e: 42 17 cp r20, r18 16c90: 53 07 cpc r21, r19 16c92: 28 f0 brcs .+10 ; 0x16c9e return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c94: 81 e0 ldi r24, 0x01 ; 1 16c96: 24 17 cp r18, r20 16c98: 35 07 cpc r19, r21 16c9a: 08 f4 brcc .+2 ; 0x16c9e 16c9c: 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; 16c9e: a4 e0 ldi r26, 0x04 ; 4 16ca0: 8a 9f mul r24, r26 16ca2: c0 01 movw r24, r0 16ca4: 11 24 eor r1, r1 16ca6: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 16ca8: 80 e1 ldi r24, 0x10 ; 16 16caa: 90 e0 ldi r25, 0x00 ; 0 16cac: 0f 94 ab a3 call 0x34756 ; 0x34756 16cb0: ac 01 movw r20, r24 16cb2: 2f 81 ldd r18, Y+7 ; 0x07 16cb4: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16cb6: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16cb8: 42 17 cp r20, r18 16cba: 53 07 cpc r21, r19 16cbc: 28 f0 brcs .+10 ; 0x16cc8 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16cbe: 91 e0 ldi r25, 0x01 ; 1 16cc0: 24 17 cp r18, r20 16cc2: 35 07 cpc r19, r21 16cc4: 08 f4 brcc .+2 ; 0x16cc8 16cc6: 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)); 16cc8: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 16cca: 16 35 cpi r17, 0x56 ; 86 16ccc: 10 f4 brcc .+4 ; 0x16cd2 16cce: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 16cd2: f0 90 e9 03 lds r15, 0x03E9 ; 0x8003e9 16cd6: 89 e1 ldi r24, 0x19 ; 25 16cd8: 97 e3 ldi r25, 0x37 ; 55 16cda: 0e 94 0a 75 call 0xea14 ; 0xea14 16cde: 8c 01 movw r16, r24 16ce0: 83 ef ldi r24, 0xF3 ; 243 16ce2: 96 e3 ldi r25, 0x36 ; 54 16ce4: 0e 94 0a 75 call 0xea14 ; 0xea14 16ce8: 4f 2d mov r20, r15 16cea: b8 01 movw r22, r16 16cec: 0e 94 d0 e8 call 0x1d1a0 ; 0x1d1a0 16cf0: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 else if(code_seen('Q')) 16cf4: 81 e5 ldi r24, 0x51 ; 81 16cf6: 0e 94 f5 55 call 0xabea ; 0xabea 16cfa: 88 23 and r24, r24 16cfc: 11 f4 brne .+4 ; 0x16d02 16cfe: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 16d02: 0c 94 b6 9d jmp 0x13b6c ; 0x13b6c { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 16d06: 81 e5 ldi r24, 0x51 ; 81 16d08: 0e 94 f5 55 call 0xabea ; 0xabea 16d0c: 88 23 and r24, r24 16d0e: 11 f4 brne .+4 ; 0x16d14 16d10: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 SERIAL_PROTOCOLLN(GCODE_LEVEL); 16d14: 81 e0 ldi r24, 0x01 ; 1 16d16: 90 e0 ldi r25, 0x00 ; 0 16d18: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e 16d1c: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 * 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; 16d20: 8b e4 ldi r24, 0x4B ; 75 16d22: 0e 94 f5 55 call 0xabea ; 0xabea 16d26: c1 2c mov r12, r1 16d28: d1 2c mov r13, r1 16d2a: e1 2c mov r14, r1 16d2c: 50 ec ldi r21, 0xC0 ; 192 16d2e: f5 2e mov r15, r21 16d30: 88 23 and r24, r24 16d32: 49 f1 breq .+82 ; 0x16d86 16d34: 0e 94 85 5a call 0xb50a ; 0xb50a 16d38: 6b 01 movw r12, r22 16d3a: 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) 16d3c: 20 e0 ldi r18, 0x00 ; 0 16d3e: 30 e0 ldi r19, 0x00 ; 0 16d40: a9 01 movw r20, r18 16d42: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 16d46: 81 11 cpse r24, r1 16d48: 1e c0 rjmp .+60 ; 0x16d86 { extruder_advance_K = 0; 16d4a: 10 92 a7 04 sts 0x04A7, r1 ; 0x8004a7 16d4e: 10 92 a8 04 sts 0x04A8, r1 ; 0x8004a8 16d52: 10 92 a9 04 sts 0x04A9, r1 ; 0x8004a9 16d56: 10 92 aa 04 sts 0x04AA, r1 ; 0x8004aa 16d5a: 0e 94 fc 83 call 0x107f8 ; 0x107f8 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 16d5e: 8e ec ldi r24, 0xCE ; 206 16d60: 91 ea ldi r25, 0xA1 ; 161 16d62: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM("Advance K="); 16d66: 8b e0 ldi r24, 0x0B ; 11 16d68: 99 e7 ldi r25, 0x79 ; 121 16d6a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(extruder_advance_K); 16d6e: 60 91 a7 04 lds r22, 0x04A7 ; 0x8004a7 16d72: 70 91 a8 04 lds r23, 0x04A8 ; 0x8004a8 16d76: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 16d7a: 90 91 aa 04 lds r25, 0x04AA ; 0x8004aa 16d7e: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 16d82: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 16d86: 80 91 43 03 lds r24, 0x0343 ; 0x800343 16d8a: 81 11 cpse r24, r1 16d8c: 1b c0 rjmp .+54 ; 0x16dc4 { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 16d8e: 20 e0 ldi r18, 0x00 ; 0 16d90: 30 e0 ldi r19, 0x00 ; 0 16d92: a9 01 movw r20, r18 16d94: c7 01 movw r24, r14 16d96: b6 01 movw r22, r12 16d98: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 16d9c: 87 ff sbrs r24, 7 16d9e: 05 c0 rjmp .+10 ; 0x16daa } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 16da0: 86 e1 ldi r24, 0x16 ; 22 16da2: 99 e7 ldi r25, 0x79 ; 121 16da4: 0e 94 8d 7c call 0xf91a ; 0xf91a 16da8: da cf rjmp .-76 ; 0x16d5e return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 16daa: 20 e0 ldi r18, 0x00 ; 0 16dac: 30 e0 ldi r19, 0x00 ; 0 16dae: 40 e2 ldi r20, 0x20 ; 32 16db0: 51 e4 ldi r21, 0x41 ; 65 16db2: c7 01 movw r24, r14 16db4: b6 01 movw r22, r12 16db6: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 16dba: 87 ff sbrs r24, 7 16dbc: 2c c0 rjmp .+88 ; 0x16e16 16dbe: 81 e0 ldi r24, 0x01 ; 1 16dc0: 0e 94 fc 83 call 0x107f8 ; 0x107f8 } if(la10c_mode == LA10C_LA15) 16dc4: 80 91 43 03 lds r24, 0x0343 ; 0x800343 return (k >= 0 && k < LA_K_MAX? k: -1); 16dc8: 20 e0 ldi r18, 0x00 ; 0 16dca: 30 e0 ldi r19, 0x00 ; 0 16dcc: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 16dce: 81 30 cpi r24, 0x01 ; 1 16dd0: 21 f5 brne .+72 ; 0x16e1a return (k >= 0 && k < LA_K_MAX? k: -1); 16dd2: c7 01 movw r24, r14 16dd4: b6 01 movw r22, r12 16dd6: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 16dda: 87 fd sbrc r24, 7 16ddc: e1 cf rjmp .-62 ; 0x16da0 16dde: 20 e0 ldi r18, 0x00 ; 0 16de0: 30 e0 ldi r19, 0x00 ; 0 16de2: 40 e2 ldi r20, 0x20 ; 32 16de4: 51 e4 ldi r21, 0x41 ; 65 16de6: c7 01 movw r24, r14 16de8: b6 01 movw r22, r12 16dea: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 16dee: 87 ff sbrs r24, 7 16df0: d7 cf rjmp .-82 ; 0x16da0 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 16df2: 20 e0 ldi r18, 0x00 ; 0 16df4: 30 e0 ldi r19, 0x00 ; 0 16df6: a9 01 movw r20, r18 16df8: c7 01 movw r24, r14 16dfa: b6 01 movw r22, r12 16dfc: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 16e00: 87 fd sbrc r24, 7 16e02: ce cf rjmp .-100 ; 0x16da0 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 16e04: c0 92 a7 04 sts 0x04A7, r12 ; 0x8004a7 16e08: d0 92 a8 04 sts 0x04A8, r13 ; 0x8004a8 16e0c: e0 92 a9 04 sts 0x04A9, r14 ; 0x8004a9 16e10: f0 92 aa 04 sts 0x04AA, r15 ; 0x8004aa 16e14: a4 cf rjmp .-184 ; 0x16d5e if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 16e16: 82 e0 ldi r24, 0x02 ; 2 16e18: d3 cf rjmp .-90 ; 0x16dc0 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 16e1a: c7 01 movw r24, r14 16e1c: b6 01 movw r22, r12 16e1e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 16e22: 87 fd sbrc r24, 7 16e24: bd cf rjmp .-134 ; 0x16da0 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 16e26: 2f e6 ldi r18, 0x6F ; 111 16e28: 32 e1 ldi r19, 0x12 ; 18 16e2a: 43 e0 ldi r20, 0x03 ; 3 16e2c: 5b e3 ldi r21, 0x3B ; 59 16e2e: c7 01 movw r24, r14 16e30: b6 01 movw r22, r12 16e32: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 16e36: 2a e0 ldi r18, 0x0A ; 10 16e38: 37 ed ldi r19, 0xD7 ; 215 16e3a: 43 e2 ldi r20, 0x23 ; 35 16e3c: 5c e3 ldi r21, 0x3C ; 60 16e3e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 16e42: 6b 01 movw r12, r22 16e44: 7c 01 movw r14, r24 return new_K < 0? 0: 16e46: 20 e0 ldi r18, 0x00 ; 0 16e48: 30 e0 ldi r19, 0x00 ; 0 16e4a: a9 01 movw r20, r18 16e4c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 16e50: 87 fd sbrc r24, 7 16e52: 11 c0 rjmp .+34 ; 0x16e76 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 16e54: 20 e0 ldi r18, 0x00 ; 0 16e56: 30 e0 ldi r19, 0x00 ; 0 16e58: 40 e2 ldi r20, 0x20 ; 32 16e5a: 51 e4 ldi r21, 0x41 ; 65 16e5c: c7 01 movw r24, r14 16e5e: b6 01 movw r22, r12 16e60: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 16e64: 18 16 cp r1, r24 16e66: 2c f6 brge .-118 ; 0x16df2 16e68: c1 2c mov r12, r1 16e6a: d1 2c mov r13, r1 16e6c: 40 e2 ldi r20, 0x20 ; 32 16e6e: e4 2e mov r14, r20 16e70: 41 e4 ldi r20, 0x41 ; 65 16e72: f4 2e mov r15, r20 16e74: c7 cf rjmp .-114 ; 0x16e04 // 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: 16e76: c1 2c mov r12, r1 16e78: d1 2c mov r13, r1 16e7a: 76 01 movw r14, r12 16e7c: c3 cf rjmp .-122 ; 0x16e04 } } reset_acceleration_rates(); #else //TMC2130 #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value()); 16e7e: 83 e5 ldi r24, 0x53 ; 83 16e80: 0e 94 f5 55 call 0xabea ; 0xabea 16e84: 88 23 and r24, r24 16e86: 59 f0 breq .+22 ; 0x16e9e 16e88: 10 e0 ldi r17, 0x00 ; 0 16e8a: 0e 94 85 5a call 0xb50a ; 0xb50a 16e8e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 16e92: 81 2f mov r24, r17 16e94: 0f 94 fc 17 call 0x22ff8 ; 0x22ff8 16e98: 1f 5f subi r17, 0xFF ; 255 16e9a: 15 30 cpi r17, 0x05 ; 5 16e9c: b1 f7 brne .-20 ; 0x16e8a 16e9e: 34 ec ldi r19, 0xC4 ; 196 16ea0: e3 2e mov r14, r19 16ea2: 32 e0 ldi r19, 0x02 ; 2 16ea4: f3 2e mov r15, r19 16ea6: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i 16eb2: 88 23 and r24, r24 16eb4: 39 f0 breq .+14 ; 0x16ec4 16eb6: 0e 94 85 5a call 0xb50a ; 0xb50a 16eba: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 16ebe: 81 2f mov r24, r17 16ec0: 0f 94 fc 17 call 0x22ff8 ; 0x22ff8 16ec4: 1f 5f subi r17, 0xFF ; 255 16ec6: 14 30 cpi r17, 0x04 ; 4 16ec8: 79 f7 brne .-34 ; 0x16ea8 if(code_seen('B')) microstep_mode(4,code_value()); 16eca: 82 e4 ldi r24, 0x42 ; 66 16ecc: 0e 94 f5 55 call 0xabea ; 0xabea 16ed0: 88 23 and r24, r24 16ed2: 39 f0 breq .+14 ; 0x16ee2 16ed4: 0e 94 85 5a call 0xb50a ; 0xb50a 16ed8: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 16edc: 84 e0 ldi r24, 0x04 ; 4 16ede: 0f 94 fc 17 call 0x22ff8 ; 0x22ff8 microstep_readings(); 16ee2: 0f 94 22 17 call 0x22e44 ; 0x22e44 16ee6: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 16eea: 24 ec ldi r18, 0xC4 ; 196 16eec: e2 2e mov r14, r18 16eee: 22 e0 ldi r18, 0x02 ; 2 16ef0: f2 2e mov r15, r18 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 16ef2: 10 e0 ldi r17, 0x00 ; 0 { case 1: for(int i=0;i 16efe: 88 23 and r24, r24 16f00: 41 f0 breq .+16 ; 0x16f12 16f02: 0e 94 85 5a call 0xb50a ; 0xb50a 16f06: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 16f0a: 4f ef ldi r20, 0xFF ; 255 16f0c: 81 2f mov r24, r17 16f0e: 0f 94 7d 17 call 0x22efa ; 0x22efa 16f12: 1f 5f subi r17, 0xFF ; 255 16f14: 14 30 cpi r17, 0x04 ; 4 16f16: 71 f7 brne .-36 ; 0x16ef4 if(code_seen('B')) microstep_ms(4,code_value(),-1); 16f18: 82 e4 ldi r24, 0x42 ; 66 16f1a: 0e 94 f5 55 call 0xabea ; 0xabea 16f1e: 88 23 and r24, r24 16f20: 11 f4 brne .+4 ; 0x16f26 16f22: 0c 94 35 a0 jmp 0x1406a ; 0x1406a 16f26: 0e 94 85 5a call 0xb50a ; 0xb50a 16f2a: 0c 94 35 a0 jmp 0x1406a ; 0x1406a 16f2e: 94 ec ldi r25, 0xC4 ; 196 16f30: e9 2e mov r14, r25 16f32: 92 e0 ldi r25, 0x02 ; 2 16f34: f9 2e mov r15, r25 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 16f36: 10 e0 ldi r17, 0x00 ; 0 case 1: for(int i=0;i 16f42: 88 23 and r24, r24 16f44: 49 f0 breq .+18 ; 0x16f58 16f46: 0e 94 85 5a call 0xb50a ; 0xb50a 16f4a: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 16f4e: 46 2f mov r20, r22 16f50: 6f ef ldi r22, 0xFF ; 255 16f52: 81 2f mov r24, r17 16f54: 0f 94 7d 17 call 0x22efa ; 0x22efa 16f58: 1f 5f subi r17, 0xFF ; 255 16f5a: 14 30 cpi r17, 0x04 ; 4 16f5c: 69 f7 brne .-38 ; 0x16f38 16f5e: dc cf rjmp .-72 ; 0x16f18 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 16f60: 80 91 01 13 lds r24, 0x1301 ; 0x801301 16f64: 81 30 cpi r24, 0x01 ; 1 16f66: 99 f1 breq .+102 ; 0x16fce - `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; 16f68: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16f6a: 8c e4 ldi r24, 0x4C ; 76 16f6c: 0e 94 f5 55 call 0xabea ; 0xabea 16f70: 88 23 and r24, r24 16f72: e1 f1 breq .+120 ; 0x16fec 16f74: 0e 94 85 5a call 0xb50a ; 0xb50a 16f78: 6b 01 movw r12, r22 16f7a: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 16f7c: 8a e5 ldi r24, 0x5A ; 90 16f7e: 0e 94 f5 55 call 0xabea ; 0xabea 16f82: 88 23 and r24, r24 16f84: d1 f1 breq .+116 ; 0x16ffa 16f86: 0e 94 85 5a call 0xb50a ; 0xb50a 16f8a: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 16f8c: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 16f90: 4b 01 movw r8, r22 16f92: 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 16f94: 8a e5 ldi r24, 0x5A ; 90 16f96: 0e 94 f5 55 call 0xabea ; 0xabea 16f9a: 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; 16f9c: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 prusa_statistics(22); 16fa0: 86 e1 ldi r24, 0x16 ; 22 16fa2: 0f 94 02 30 call 0x26004 ; 0x26004 if (MMU2::mmu2.Enabled()) { 16fa6: 80 91 01 13 lds r24, 0x1301 ; 0x801301 16faa: 81 30 cpi r24, 0x01 ; 1 16fac: 51 f5 brne .+84 ; 0x17002 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 16fae: 15 30 cpi r17, 0x05 ; 5 16fb0: 18 f4 brcc .+6 ; 0x16fb8 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 16fb2: 81 2f mov r24, r17 16fb4: 0e 94 eb fb call 0x1f7d6 ; 0x1f7d6 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 16fb8: 10 92 94 03 sts 0x0394, r1 ; 0x800394 16fbc: 0f 94 3f 6d call 0x2da7e ; 0x2da7e // 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); 16fc0: c5 01 movw r24, r10 16fc2: b4 01 movw r22, r8 16fc4: 90 58 subi r25, 0x80 ; 128 16fc6: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 16fca: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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') ) { 16fce: 80 e5 ldi r24, 0x50 ; 80 16fd0: 0e 94 f5 55 call 0xabea ; 0xabea 16fd4: 88 23 and r24, r24 16fd6: 21 f0 breq .+8 ; 0x16fe0 mmuSlotIndex = code_value_uint8(); 16fd8: 0e 94 0a 56 call 0xac14 ; 0xac14 16fdc: 18 2f mov r17, r24 16fde: c5 cf rjmp .-118 ; 0x16f6a 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') ) { 16fe0: 84 e5 ldi r24, 0x54 ; 84 16fe2: 0e 94 f5 55 call 0xabea ; 0xabea 16fe6: 81 11 cpse r24, r1 16fe8: f7 cf rjmp .-18 ; 0x16fd8 16fea: be cf rjmp .-132 ; 0x16f68 - `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 16fec: c1 2c mov r12, r1 16fee: d1 2c mov r13, r1 16ff0: 8c e8 ldi r24, 0x8C ; 140 16ff2: e8 2e mov r14, r24 16ff4: 82 e4 ldi r24, 0x42 ; 66 16ff6: f8 2e mov r15, r24 16ff8: c1 cf rjmp .-126 ; 0x16f7c float z_target = 0; 16ffa: 60 e0 ldi r22, 0x00 ; 0 16ffc: 70 e0 ldi r23, 0x00 ; 0 16ffe: cb 01 movw r24, r22 17000: c5 cf rjmp .-118 ; 0x16f8c 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; 17002: 82 e0 ldi r24, 0x02 ; 2 17004: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 17008: 8d ee ldi r24, 0xED ; 237 1700a: 91 e6 ldi r25, 0x61 ; 97 1700c: 0e 94 0a 75 call 0xea14 ; 0xea14 17010: 0e 94 85 dc call 0x1b90a ; 0x1b90a current_position[E_AXIS] += fastLoadLength; 17014: a7 01 movw r20, r14 17016: 96 01 movw r18, r12 17018: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1701c: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 17020: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 17024: 90 91 70 12 lds r25, 0x1270 ; 0x801270 17028: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1702c: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 17030: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 17034: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 17038: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 1703c: 60 e0 ldi r22, 0x00 ; 0 1703e: 70 e0 ldi r23, 0x00 ; 0 17040: 80 ea ldi r24, 0xA0 ; 160 17042: 91 e4 ldi r25, 0x41 ; 65 17044: 0f 94 0a 4a call 0x29414 ; 0x29414 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 17048: 01 11 cpse r16, r1 1704a: 06 c0 rjmp .+12 ; 0x17058 raise_z_above(MIN_Z_FOR_LOAD); 1704c: 60 e0 ldi r22, 0x00 ; 0 1704e: 70 e0 ldi r23, 0x00 ; 0 17050: 8c e0 ldi r24, 0x0C ; 12 17052: 92 e4 ldi r25, 0x42 ; 66 17054: 0e 94 c6 6c call 0xd98c ; 0xd98c } load_filament_final_feed(); // slow sequence 17058: 0e 94 bd 63 call 0xc77a ; 0xc77a st_synchronize(); 1705c: 0f 94 b0 18 call 0x23160 ; 0x23160 Sound_MakeCustom(50, 500, false); 17060: 40 e0 ldi r20, 0x00 ; 0 17062: 64 ef ldi r22, 0xF4 ; 244 17064: 71 e0 ldi r23, 0x01 ; 1 17066: 82 e3 ldi r24, 0x32 ; 50 17068: 90 e0 ldi r25, 0x00 ; 0 1706a: 0f 94 55 25 call 0x24aaa ; 0x24aaa if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 1706e: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 17072: 81 11 cpse r24, r1 17074: 05 c0 rjmp .+10 ; 0x17080 17076: 80 91 94 03 lds r24, 0x0394 ; 0x800394 1707a: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 1707c: 0f 94 bc 18 call 0x23178 ; 0x23178 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 17080: 81 e0 ldi r24, 0x01 ; 1 17082: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_update(2); 17086: 82 e0 ldi r24, 0x02 ; 2 17088: 0e 94 c9 6e call 0xdd92 ; 0xdd92 lcd_setstatuspgm(MSG_WELCOME); 1708c: 86 ee ldi r24, 0xE6 ; 230 1708e: 9b e6 ldi r25, 0x6B ; 107 17090: 0e 94 85 dc call 0x1b90a ; 0x1b90a custom_message_type = CustomMsg::Status; 17094: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 17098: 8f cf rjmp .-226 ; 0x16fb8 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 1709a: 85 e5 ldi r24, 0x55 ; 85 1709c: 0e 94 f5 55 call 0xabea ; 0xabea - `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; 170a0: c1 2c mov r12, r1 170a2: d1 2c mov r13, r1 170a4: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 170a6: 88 23 and r24, r24 170a8: 21 f0 breq .+8 ; 0x170b2 170aa: 0e 94 85 5a call 0xb50a ; 0xb50a 170ae: 6b 01 movw r12, r22 170b0: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 170b2: 8a e5 ldi r24, 0x5A ; 90 170b4: 0e 94 f5 55 call 0xabea ; 0xabea 170b8: 88 23 and r24, r24 170ba: a1 f0 breq .+40 ; 0x170e4 170bc: 0e 94 85 5a call 0xb50a ; 0xb50a 170c0: 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); 170c2: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 170c6: 4b 01 movw r8, r22 170c8: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 170ca: 80 91 01 13 lds r24, 0x1301 ; 0x801301 170ce: 81 30 cpi r24, 0x01 ; 1 170d0: 99 f4 brne .+38 ; 0x170f8 170d2: 0f 94 2e 9d call 0x33a5c ; 0x33a5c else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 170d6: c5 01 movw r24, r10 170d8: b4 01 movw r22, r8 170da: 90 58 subi r25, 0x80 ; 128 170dc: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 170e0: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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 170e4: 60 e0 ldi r22, 0x00 ; 0 170e6: 70 e0 ldi r23, 0x00 ; 0 170e8: 8c e0 ldi r24, 0x0C ; 12 170ea: 92 e4 ldi r25, 0x42 ; 66 170ec: 0e 94 c6 6c call 0xd98c ; 0xd98c - `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; 170f0: 60 e0 ldi r22, 0x00 ; 0 170f2: 70 e0 ldi r23, 0x00 ; 0 170f4: cb 01 movw r24, r22 170f6: e5 cf rjmp .-54 ; 0x170c2 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 170f8: c7 01 movw r24, r14 170fa: b6 01 movw r22, r12 170fc: 0e 94 6f e1 call 0x1c2de ; 0x1c2de 17100: ea cf rjmp .-44 ; 0x170d6 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 17102: 80 ec ldi r24, 0xC0 ; 192 17104: 92 e0 ldi r25, 0x02 ; 2 17106: 0e 94 4b 5a call 0xb496 ; 0xb496 1710a: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 1710e: 81 ec ldi r24, 0xC1 ; 193 17110: 92 e0 ldi r25, 0x02 ; 2 17112: 0e 94 4b 5a call 0xb496 ; 0xb496 17116: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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() ) { 1711a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1711e: 81 30 cpi r24, 0x01 ; 1 17120: 11 f0 breq .+4 ; 0x17126 17122: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 if( code_seen('A') ) { 17126: 81 e4 ldi r24, 0x41 ; 65 17128: 0e 94 f5 55 call 0xabea ; 0xabea 1712c: 88 23 and r24, r24 1712e: 11 f4 brne .+4 ; 0x17134 17130: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 17134: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17138: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 1713c: 40 e1 ldi r20, 0x10 ; 16 1713e: 50 e0 ldi r21, 0x00 ; 0 17140: 70 e0 ldi r23, 0x00 ; 0 17142: 60 e0 ldi r22, 0x00 ; 0 17144: 01 96 adiw r24, 0x01 ; 1 17146: 0f 94 28 9f call 0x33e50 ; 0x33e50 1714a: 86 2f mov r24, r22 1714c: 0e 94 b7 fc call 0x1f96e ; 0x1f96e 17150: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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() ){ 17154: 80 91 01 13 lds r24, 0x1301 ; 0x801301 17158: 81 30 cpi r24, 0x01 ; 1 1715a: 11 f0 breq .+4 ; 0x17160 1715c: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 uint8_t addr = 0; if( code_seen('A') ) { 17160: 81 e4 ldi r24, 0x41 ; 65 17162: 0e 94 f5 55 call 0xabea ; 0xabea Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 17166: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 17168: 88 23 and r24, r24 1716a: 61 f0 breq .+24 ; 0x17184 addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 1716c: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17170: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 17174: 40 e1 ldi r20, 0x10 ; 16 17176: 50 e0 ldi r21, 0x00 ; 0 17178: 70 e0 ldi r23, 0x00 ; 0 1717a: 60 e0 ldi r22, 0x00 ; 0 1717c: 01 96 adiw r24, 0x01 ; 1 1717e: 0f 94 28 9f call 0x33e50 ; 0x33e50 17182: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 17184: 88 e5 ldi r24, 0x58 ; 88 17186: 0e 94 f5 55 call 0xabea ; 0xabea 1718a: 88 23 and r24, r24 1718c: 61 f0 breq .+24 ; 0x171a6 data = code_value_short(); 1718e: 0e 94 17 56 call 0xac2e ; 0xac2e } if(addr){ 17192: 11 23 and r17, r17 17194: 11 f4 brne .+4 ; 0x1719a 17196: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 MMU2::mmu2.WriteRegister(addr, data); 1719a: bc 01 movw r22, r24 1719c: 81 2f mov r24, r17 1719e: 0e 94 8d d0 call 0x1a11a ; 0x1a11a 171a2: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 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; 171a6: 90 e0 ldi r25, 0x00 ; 0 171a8: 80 e0 ldi r24, 0x00 ; 0 171aa: f3 cf rjmp .-26 ; 0x17192 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 171ac: 83 e5 ldi r24, 0x53 ; 83 171ae: 0e 94 f5 55 call 0xabea ; 0xabea 171b2: 88 23 and r24, r24 171b4: 31 f0 breq .+12 ; 0x171c2 { switch (code_value_uint8()) 171b6: 0e 94 0a 56 call 0xac14 ; 0xac14 171ba: 88 23 and r24, r24 171bc: a9 f0 breq .+42 ; 0x171e8 171be: 81 30 cpi r24, 0x01 ; 1 171c0: f9 f0 breq .+62 ; 0x17200 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 171c2: 80 91 01 13 lds r24, 0x1301 ; 0x801301 171c6: 81 30 cpi r24, 0x01 ; 1 171c8: 59 f4 brne .+22 ; 0x171e0 171ca: 88 e5 ldi r24, 0x58 ; 88 171cc: 0e 94 f5 55 call 0xabea ; 0xabea 171d0: 88 23 and r24, r24 171d2: 31 f0 breq .+12 ; 0x171e0 { switch (code_value_uint8()) 171d4: 0e 94 0a 56 call 0xac14 ; 0xac14 171d8: 82 30 cpi r24, 0x02 ; 2 171da: d0 f0 brcs .+52 ; 0x17210 171dc: 8a 32 cpi r24, 0x2A ; 42 171de: e1 f0 breq .+56 ; 0x17218 break; default: break; } } MMU2::mmu2.Status(); 171e0: 0f 94 85 65 call 0x2cb0a ; 0x2cb0a 171e4: 0c 94 f8 a1 jmp 0x143f0 ; 0x143f0 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 171e8: 60 e0 ldi r22, 0x00 ; 0 171ea: 8c ea ldi r24, 0xAC ; 172 171ec: 9c e0 ldi r25, 0x0C ; 12 171ee: 0f 94 c1 a3 call 0x34782 ; 0x34782 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 171f2: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 171f6: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 171fa: 10 92 94 12 sts 0x1294, r1 ; 0x801294 171fe: e1 cf rjmp .-62 ; 0x171c2 17200: 61 e0 ldi r22, 0x01 ; 1 17202: 8c ea ldi r24, 0xAC ; 172 17204: 9c e0 ldi r25, 0x0C ; 12 17206: 0f 94 c1 a3 call 0x34782 ; 0x34782 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(); 1720a: 0f 94 3d 95 call 0x32a7a ; 0x32a7a 1720e: d9 cf rjmp .-78 ; 0x171c2 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 17210: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 17212: 0f 94 00 95 call 0x32a00 ; 0x32a00 17216: e4 cf rjmp .-56 ; 0x171e0 17218: 8a e2 ldi r24, 0x2A ; 42 1721a: fb cf rjmp .-10 ; 0x17212 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') { 1721c: 84 35 cpi r24, 0x54 ; 84 1721e: 09 f0 breq .+2 ; 0x17222 17220: 79 c0 rjmp .+242 ; 0x17314 strchr_pointer = CMDBUFFER_CURRENT_STRING; 17222: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 17226: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb processing_tcode = true; 1722a: 81 e0 ldi r24, 0x01 ; 1 1722c: 80 93 91 03 sts 0x0391, r24 ; 0x800391 TCodes(strchr_pointer, code_value_uint8()); 17230: 0e 94 0a 56 call 0xac14 ; 0xac14 17234: 18 2f mov r17, r24 17236: 20 91 bb 04 lds r18, 0x04BB ; 0x8004bb 1723a: 30 91 bc 04 lds r19, 0x04BC ; 0x8004bc inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 1723e: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 17240: 79 01 movw r14, r18 17242: e9 0e add r14, r25 17244: f1 1c adc r15, r1 17246: d7 01 movw r26, r14 17248: 8c 91 ld r24, X 1724a: 80 32 cpi r24, 0x20 ; 32 1724c: 11 f0 breq .+4 ; 0x17252 1724e: 89 30 cpi r24, 0x09 ; 9 17250: 11 f4 brne .+4 ; 0x17256 17252: 9f 5f subi r25, 0xFF ; 255 17254: f5 cf rjmp .-22 ; 0x17240 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 17256: 08 2e mov r0, r24 17258: 00 0c add r0, r0 1725a: 99 0b sbc r25, r25 1725c: 0f 94 b1 a9 call 0x35362 ; 0x35362 17260: f7 01 movw r30, r14 17262: 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'); 17264: 90 ed ldi r25, 0xD0 ; 208 17266: 98 0f add r25, r24 17268: 95 30 cpi r25, 0x05 ; 5 1726a: 58 f0 brcs .+22 ; 0x17282 1726c: 8f 33 cpi r24, 0x3F ; 63 1726e: 69 f0 breq .+26 ; 0x1728a 17270: 88 37 cpi r24, 0x78 ; 120 17272: 59 f0 breq .+22 ; 0x1728a 17274: 83 36 cpi r24, 0x63 ; 99 17276: 01 f1 breq .+64 ; 0x172b8 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 17278: 81 ee ldi r24, 0xE1 ; 225 1727a: 98 e7 ldi r25, 0x78 ; 120 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 1727c: 0e 94 8d 7c call 0xf91a ; 0xf91a 17280: 15 c0 rjmp .+42 ; 0x172ac 17282: 90 91 01 13 lds r25, 0x1301 ; 0x801301 strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 17286: 8f 33 cpi r24, 0x3F ; 63 17288: a9 f4 brne .+42 ; 0x172b4 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 1728a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1728e: 81 30 cpi r24, 0x01 ; 1 17290: 69 f4 brne .+26 ; 0x172ac MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 17292: 83 ec ldi r24, 0xC3 ; 195 17294: 9c e3 ldi r25, 0x3C ; 60 17296: 0e 94 0a 75 call 0xea14 ; 0xea14 1729a: 70 e0 ldi r23, 0x00 ; 0 1729c: 60 e0 ldi r22, 0x00 ; 0 1729e: 0e 94 b9 cf call 0x19f72 ; 0x19f72 172a2: 68 2f mov r22, r24 172a4: d7 01 movw r26, r14 172a6: 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()); 172a8: 0e 94 55 fc call 0x1f8aa ; 0x1f8aa processing_tcode = false; 172ac: 10 92 91 03 sts 0x0391, r1 ; 0x800391 172b0: 0c 94 1d 8e jmp 0x11c3a ; 0x11c3a } 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'){ 172b4: 83 36 cpi r24, 0x63 ; 99 172b6: 49 f4 brne .+18 ; 0x172ca // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 172b8: 80 91 01 13 lds r24, 0x1301 ; 0x801301 172bc: 81 30 cpi r24, 0x01 ; 1 172be: b1 f7 brne .-20 ; 0x172ac MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 172c0: 0f 94 7f 65 call 0x2cafe ; 0x2cafe 172c4: 68 2f mov r22, r24 172c6: 83 e6 ldi r24, 0x63 ; 99 172c8: ef cf rjmp .-34 ; 0x172a8 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 172ca: 91 30 cpi r25, 0x01 ; 1 172cc: 69 f4 brne .+26 ; 0x172e8 if (codeValue == MMU2::mmu2.get_current_tool()){ 172ce: 0f 94 7f 65 call 0x2cafe ; 0x2cafe 172d2: 18 13 cpse r17, r24 172d4: 05 c0 rjmp .+10 ; 0x172e0 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 172d6: 81 ef ldi r24, 0xF1 ; 241 172d8: 98 e7 ldi r25, 0x78 ; 120 172da: 0f 94 86 a2 call 0x3450c ; 0x3450c 172de: e6 cf rjmp .-52 ; 0x172ac #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); 172e0: 81 2f mov r24, r17 172e2: 0e 94 32 fc call 0x1f864 ; 0x1f864 172e6: e2 cf rjmp .-60 ; 0x172ac } } else { SERIAL_ECHO_START; 172e8: 8e ec ldi r24, 0xCE ; 206 172ea: 91 ea ldi r25, 0xA1 ; 161 172ec: 0e 94 94 7a call 0xf528 ; 0xf528 if (codeValue >= EXTRUDERS) { 172f0: 11 23 and r17, r17 172f2: 59 f0 breq .+22 ; 0x1730a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 172f4: 84 e5 ldi r24, 0x54 ; 84 172f6: 0e 94 81 79 call 0xf302 ; 0xf302 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 172fa: 81 2f mov r24, r17 172fc: 90 e0 ldi r25, 0x00 ; 0 172fe: c0 96 adiw r24, 0x30 ; 48 17300: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 17304: 86 ed ldi r24, 0xD6 ; 214 17306: 94 e6 ldi r25, 0x64 ; 100 17308: b9 cf rjmp .-142 ; 0x1727c // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 1730a: 83 ec ldi r24, 0xC3 ; 195 1730c: 94 e6 ldi r25, 0x64 ; 100 1730e: 0e 94 94 7a call 0xf528 ; 0xf528 17312: cc cf rjmp .-104 ; 0x172ac /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 17314: 84 34 cpi r24, 0x44 ; 68 17316: 09 f0 breq .+2 ; 0x1731a 17318: 5d c0 rjmp .+186 ; 0x173d4 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 1731a: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 1731e: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb switch(code_value_short()) 17322: 0e 94 17 56 call 0xac2e ; 0xac2e 17326: 82 30 cpi r24, 0x02 ; 2 17328: 91 05 cpc r25, r1 1732a: 41 f1 breq .+80 ; 0x1737c 1732c: 8c f4 brge .+34 ; 0x17350 1732e: 01 96 adiw r24, 0x01 ; 1 17330: e1 f0 breq .+56 ; 0x1736a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 17332: 80 91 38 12 lds r24, 0x1238 ; 0x801238 17336: 90 91 39 12 lds r25, 0x1239 ; 0x801239 1733a: 82 5b subi r24, 0xB2 ; 178 1733c: 9f 4e sbci r25, 0xEF ; 239 1733e: 9f 93 push r25 17340: 8f 93 push r24 17342: 1f 92 push r1 17344: 84 e4 ldi r24, 0x44 ; 68 17346: 8f 93 push r24 17348: 88 e5 ldi r24, 0x58 ; 88 1734a: 96 e6 ldi r25, 0x66 ; 102 1734c: 0c 94 72 8e jmp 0x11ce4 ; 0x11ce4 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 17350: 83 30 cpi r24, 0x03 ; 3 17352: 91 05 cpc r25, r1 17354: f9 f0 breq .+62 ; 0x17394 17356: 47 97 sbiw r24, 0x17 ; 23 17358: 61 f7 brne .-40 ; 0x17332 bool emergency_serial_dump = false; void dcode_23() { if(code_seen('E')) 1735a: 85 e4 ldi r24, 0x45 ; 69 1735c: 0e 94 f5 55 call 0xabea ; 0xabea 17360: 88 23 and r24, r24 17362: 09 f1 breq .+66 ; 0x173a6 serial_dump_and_reset(dump_crash_reason::manual); 17364: 80 e0 ldi r24, 0x00 ; 0 17366: 0e 94 71 84 call 0x108e2 ; 0x108e2 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 1736a: 8f ea ldi r24, 0xAF ; 175 1736c: 94 e6 ldi r25, 0x64 ; 100 1736e: 9f 93 push r25 17370: 8f 93 push r24 17372: 0f 94 5f a2 call 0x344be ; 0x344be 17376: 0f 90 pop r0 17378: 0f 90 pop r0 1737a: ff cf rjmp .-2 ; 0x1737a - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 1737c: 0a ea ldi r16, 0xAA ; 170 1737e: 14 e6 ldi r17, 0x64 ; 100 17380: 22 e0 ldi r18, 0x02 ; 2 17382: 40 e0 ldi r20, 0x00 ; 0 17384: 60 e0 ldi r22, 0x00 ; 0 17386: 72 e2 ldi r23, 0x22 ; 34 17388: 80 e0 ldi r24, 0x00 ; 0 1738a: 92 e0 ldi r25, 0x02 ; 2 - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 1738c: 0e 94 c6 5d call 0xbb8c ; 0xbb8c 17390: 0c 94 1d 8e jmp 0x11c3a ; 0x11c3a 17394: 03 ea ldi r16, 0xA3 ; 163 17396: 14 e6 ldi r17, 0x64 ; 100 17398: 23 e0 ldi r18, 0x03 ; 3 1739a: 41 e0 ldi r20, 0x01 ; 1 1739c: 60 e0 ldi r22, 0x00 ; 0 1739e: 70 e1 ldi r23, 0x10 ; 16 173a0: 90 e0 ldi r25, 0x00 ; 0 173a2: 80 e0 ldi r24, 0x00 ; 0 173a4: f3 cf rjmp .-26 ; 0x1738c { if(code_seen('E')) serial_dump_and_reset(dump_crash_reason::manual); else { emergency_serial_dump = !code_seen('R'); 173a6: 82 e5 ldi r24, 0x52 ; 82 173a8: 0e 94 f5 55 call 0xabea ; 0xabea 173ac: 91 e0 ldi r25, 0x01 ; 1 173ae: 89 27 eor r24, r25 173b0: 80 93 0f 06 sts 0x060F, r24 ; 0x80060f SERIAL_ECHOPGM("serial dump "); 173b4: 84 ed ldi r24, 0xD4 ; 212 173b6: 98 e7 ldi r25, 0x78 ; 120 173b8: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); 173bc: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 173c0: 88 23 and r24, r24 173c2: 21 f0 breq .+8 ; 0x173cc 173c4: 8b e9 ldi r24, 0x9B ; 155 173c6: 94 e6 ldi r25, 0x64 ; 100 173c8: 0c 94 d9 8e jmp 0x11db2 ; 0x11db2 173cc: 82 e9 ldi r24, 0x92 ; 146 173ce: 94 e6 ldi r25, 0x64 ; 100 173d0: 0c 94 d9 8e jmp 0x11db2 ; 0x11db2 } } else { SERIAL_ECHO_START; 173d4: 8e ec ldi r24, 0xCE ; 206 173d6: 91 ea ldi r25, 0xA1 ; 161 173d8: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 173dc: 85 e0 ldi r24, 0x05 ; 5 173de: 95 e6 ldi r25, 0x65 ; 101 173e0: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 173e4: 80 91 38 12 lds r24, 0x1238 ; 0x801238 173e8: 90 91 39 12 lds r25, 0x1239 ; 0x801239 173ec: 82 5b subi r24, 0xB2 ; 178 173ee: 9f 4e sbci r25, 0xEF ; 239 173f0: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_ECHOLNPGM("\"(2)"); 173f4: 89 e6 ldi r24, 0x69 ; 105 173f6: 9e e7 ldi r25, 0x7E ; 126 173f8: 0c 94 d9 8e jmp 0x11db2 ; 0x11db2 #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 173fc: 2d ec ldi r18, 0xCD ; 205 173fe: 3c ec ldi r19, 0xCC ; 204 17400: 4c ec ldi r20, 0xCC ; 204 17402: 5d e3 ldi r21, 0x3D ; 61 17404: c7 01 movw r24, r14 17406: b6 01 movw r22, r12 17408: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1740c: 18 16 cp r1, r24 1740e: 14 f4 brge .+4 ; 0x17414 17410: 0c 94 41 90 jmp 0x12082 ; 0x12082 17414: 0c 94 51 91 jmp 0x122a2 ; 0x122a2 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; 17418: a3 01 movw r20, r6 1741a: 92 01 movw r18, r4 1741c: 62 2d mov r22, r2 1741e: 73 2d mov r23, r3 17420: 8e 2d mov r24, r14 17422: 9f 2d mov r25, r15 17424: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 17428: 18 16 cp r1, r24 1742a: 14 f0 brlt .+4 ; 0x17430 1742c: 0c 94 c3 98 jmp 0x13186 ; 0x13186 17430: e5 e0 ldi r30, 0x05 ; 5 17432: ce 0e add r12, r30 17434: d1 1c adc r13, r1 17436: f2 e0 ldi r31, 0x02 ; 2 17438: 8f 0e add r8, r31 1743a: 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; 1743c: 85 01 movw r16, r10 1743e: 0c 94 8a 98 jmp 0x13114 ; 0x13114 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)); 17442: 81 e2 ldi r24, 0x21 ; 33 17444: 99 e3 ldi r25, 0x39 ; 57 17446: 0e 94 0a 75 call 0xea14 ; 0xea14 1744a: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_puts_at_P(0, 2, PSTR("")); 1744e: 43 e0 ldi r20, 0x03 ; 3 17450: 5e e7 ldi r21, 0x7E ; 126 17452: 62 e0 ldi r22, 0x02 ; 2 17454: 80 e0 ldi r24, 0x00 ; 0 17456: 0e 94 d7 6f call 0xdfae ; 0xdfae for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 1745a: f8 01 movw r30, r16 1745c: 81 91 ld r24, Z+ 1745e: 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'; 17460: 98 2f mov r25, r24 17462: 9f 7d andi r25, 0xDF ; 223 17464: 11 f4 brne .+4 ; 0x1746a 17466: 0c 94 f4 a7 jmp 0x14fe8 ; 0x14fe8 1746a: 97 ef ldi r25, 0xF7 ; 247 1746c: 98 0f add r25, r24 1746e: 92 30 cpi r25, 0x02 ; 2 17470: 10 f4 brcc .+4 ; 0x17476 17472: 0c 94 f4 a7 jmp 0x14fe8 ; 0x14fe8 17476: 8d 30 cpi r24, 0x0D ; 13 17478: 11 f4 brne .+4 ; 0x1747e 1747a: 0c 94 f4 a7 jmp 0x14fe8 ; 0x14fe8 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); 1747e: 0e 94 f1 6e call 0xdde2 ; 0xdde2 17482: eb cf rjmp .-42 ; 0x1745a 00017484 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 17484: 1f 92 push r1 17486: 0f 92 push r0 17488: 0f b6 in r0, 0x3f ; 63 1748a: 0f 92 push r0 1748c: 11 24 eor r1, r1 1748e: 0b b6 in r0, 0x3b ; 59 17490: 0f 92 push r0 17492: 2f 93 push r18 17494: 3f 93 push r19 17496: 4f 93 push r20 17498: 5f 93 push r21 1749a: 6f 93 push r22 1749c: 7f 93 push r23 1749e: 8f 93 push r24 174a0: 9f 93 push r25 174a2: af 93 push r26 174a4: bf 93 push r27 174a6: ef 93 push r30 174a8: ff 93 push r31 adc_values[adc_channel] += ADC; 174aa: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 174ae: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 174b2: e0 91 14 03 lds r30, 0x0314 ; 0x800314 174b6: f0 e0 ldi r31, 0x00 ; 0 174b8: ee 0f add r30, r30 174ba: ff 1f adc r31, r31 174bc: ec 5f subi r30, 0xFC ; 252 174be: fc 4f sbci r31, 0xFC ; 252 174c0: 80 81 ld r24, Z 174c2: 91 81 ldd r25, Z+1 ; 0x01 174c4: 82 0f add r24, r18 174c6: 93 1f adc r25, r19 174c8: 91 83 std Z+1, r25 ; 0x01 174ca: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 174cc: 80 91 03 03 lds r24, 0x0303 ; 0x800303 174d0: 8f 5f subi r24, 0xFF ; 255 174d2: 80 93 03 03 sts 0x0303, r24 ; 0x800303 174d6: 80 31 cpi r24, 0x10 ; 16 174d8: e9 f5 brne .+122 ; 0x17554 <__vector_29+0xd0> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 174da: 80 91 14 03 lds r24, 0x0314 ; 0x800314 174de: 8f 5f subi r24, 0xFF ; 255 174e0: 80 93 14 03 sts 0x0314, r24 ; 0x800314 174e4: 88 30 cpi r24, 0x08 ; 8 174e6: 71 f5 brne .+92 ; 0x17544 <__vector_29+0xc0> #endif // ISR callback from adc when sampling finished void adc_callback() { current_temperature_raw[0] = adc_values[ADC_PIN_IDX(TEMP_0_PIN)]; //heater 174e8: 80 91 04 03 lds r24, 0x0304 ; 0x800304 174ec: 90 91 05 03 lds r25, 0x0305 ; 0x800305 174f0: 90 93 dd 05 sts 0x05DD, r25 ; 0x8005dd 174f4: 80 93 dc 05 sts 0x05DC, r24 ; 0x8005dc current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 174f8: 80 91 08 03 lds r24, 0x0308 ; 0x800308 174fc: 90 91 09 03 lds r25, 0x0309 ; 0x800309 17500: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 17504: 80 93 de 05 sts 0x05DE, r24 ; 0x8005de #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 17508: 80 91 06 03 lds r24, 0x0306 ; 0x800306 1750c: 90 91 07 03 lds r25, 0x0307 ; 0x800307 17510: 90 93 db 05 sts 0x05DB, r25 ; 0x8005db 17514: 80 93 da 05 sts 0x05DA, r24 ; 0x8005da current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 #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; 17518: 81 e0 ldi r24, 0x01 ; 1 1751a: 80 93 f6 05 sts 0x05F6, r24 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.517> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 1751e: ff 91 pop r31 17520: ef 91 pop r30 17522: bf 91 pop r27 17524: af 91 pop r26 17526: 9f 91 pop r25 17528: 8f 91 pop r24 1752a: 7f 91 pop r23 1752c: 6f 91 pop r22 1752e: 5f 91 pop r21 17530: 4f 91 pop r20 17532: 3f 91 pop r19 17534: 2f 91 pop r18 17536: 0f 90 pop r0 17538: 0b be out 0x3b, r0 ; 59 1753a: 0f 90 pop r0 1753c: 0f be out 0x3f, r0 ; 63 1753e: 0f 90 pop r0 17540: 1f 90 pop r1 17542: 18 95 reti 17544: 80 91 02 03 lds r24, 0x0302 ; 0x800302 <__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)) { 17548: 4f e5 ldi r20, 0x5F ; 95 1754a: 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) { 1754c: 8f 5f subi r24, 0xFF ; 255 1754e: 41 f4 brne .+16 ; 0x17560 <__vector_29+0xdc> 17550: 10 92 02 03 sts 0x0302, r1 ; 0x800302 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 17554: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 17558: 80 64 ori r24, 0x40 ; 64 1755a: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1755e: df cf rjmp .-66 ; 0x1751e <__vector_29+0x9a> 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)) { 17560: 9a 01 movw r18, r20 17562: 08 2e mov r0, r24 17564: 02 c0 rjmp .+4 ; 0x1756a <__vector_29+0xe6> 17566: 35 95 asr r19 17568: 27 95 ror r18 1756a: 0a 94 dec r0 1756c: e2 f7 brpl .-8 ; 0x17566 <__vector_29+0xe2> 1756e: 20 ff sbrs r18, 0 17570: ed cf rjmp .-38 ; 0x1754c <__vector_29+0xc8> 17572: 80 93 02 03 sts 0x0302, r24 ; 0x800302 <__data_end> adc_setmux(adc_channel_idx); 17576: 0e 94 09 55 call 0xaa12 ; 0xaa12 adc_count = 0; 1757a: 10 92 03 03 sts 0x0303, r1 ; 0x800303 1757e: ea cf rjmp .-44 ; 0x17554 <__vector_29+0xd0> 00017580 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 17580: cf 93 push r28 17582: 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 17584: ca e7 ldi r28, 0x7A ; 122 17586: d0 e0 ldi r29, 0x00 ; 0 17588: 88 81 ld r24, Y 1758a: 8f 7b andi r24, 0xBF ; 191 1758c: 88 83 st Y, r24 adc_count = 0; 1758e: 10 92 03 03 sts 0x0303, r1 ; 0x800303 adc_channel = 0; 17592: 10 92 14 03 sts 0x0314, r1 ; 0x800314 adc_channel_idx = first_channel_idx; 17596: 10 92 02 03 sts 0x0302, r1 ; 0x800302 <__data_end> adc_setmux(adc_channel_idx); 1759a: 80 e0 ldi r24, 0x00 ; 0 1759c: 0e 94 09 55 call 0xaa12 ; 0xaa12 memset((void*)adc_values, 0, sizeof(adc_values)); 175a0: e4 e0 ldi r30, 0x04 ; 4 175a2: f3 e0 ldi r31, 0x03 ; 3 175a4: 80 e1 ldi r24, 0x10 ; 16 175a6: df 01 movw r26, r30 175a8: 1d 92 st X+, r1 175aa: 8a 95 dec r24 175ac: e9 f7 brne .-6 ; 0x175a8 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 175ae: 88 81 ld r24, Y 175b0: 80 64 ori r24, 0x40 ; 64 175b2: 88 83 st Y, r24 } 175b4: df 91 pop r29 175b6: cf 91 pop r28 175b8: 08 95 ret 000175ba : uint8_t check_pinda_0() { return _PINDA?0:1; } 175ba: 81 50 subi r24, 0x01 ; 1 175bc: 82 31 cpi r24, 0x12 ; 18 175be: 08 f0 brcs .+2 ; 0x175c2 175c0: 5a c0 rjmp .+180 ; 0x17676 175c2: e8 2f mov r30, r24 175c4: f0 e0 ldi r31, 0x00 ; 0 175c6: 88 27 eor r24, r24 175c8: e7 51 subi r30, 0x17 ; 23 175ca: f5 44 sbci r31, 0x45 ; 69 175cc: 8f 4f sbci r24, 0xFF ; 255 175ce: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 175d2: 09 bb out 0x19, r16 ; 25 175d4: 0d bb out 0x1d, r16 ; 29 175d6: fb ba out 0x1b, r15 ; 27 175d8: 01 bb out 0x11, r16 ; 17 175da: 05 bb out 0x15, r16 ; 21 175dc: 3b bb out 0x1b, r19 ; 27 175de: 10 bb out 0x10, r17 ; 16 175e0: 16 bb out 0x16, r17 ; 22 175e2: 1a bb out 0x1a, r17 ; 26 175e4: 20 bb out 0x10, r18 ; 16 175e6: 24 bb out 0x14, r18 ; 20 175e8: 28 bb out 0x18, r18 ; 24 175ea: 2e bb out 0x1e, r18 ; 30 175ec: 32 bb out 0x12, r19 ; 18 175ee: 3b bb out 0x1b, r19 ; 27 175f0: 36 bb out 0x16, r19 ; 22 175f2: 3c bb out 0x1c, r19 ; 28 175f4: 40 bb out 0x10, r20 ; 16 175f6: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 175fa: 8f 77 andi r24, 0x7F ; 127 175fc: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 17600: 08 95 ret 17602: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 17606: 8f 7d andi r24, 0xDF ; 223 17608: f9 cf rjmp .-14 ; 0x175fc 1760a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1760e: 87 7f andi r24, 0xF7 ; 247 17610: f5 cf rjmp .-22 ; 0x175fc 17612: 84 b5 in r24, 0x24 ; 36 17614: 8f 77 andi r24, 0x7F ; 127 17616: 84 bd out 0x24, r24 ; 36 17618: 08 95 ret 1761a: 84 b5 in r24, 0x24 ; 36 1761c: 8f 7d andi r24, 0xDF ; 223 1761e: fb cf rjmp .-10 ; 0x17616 17620: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 17624: 8f 77 andi r24, 0x7F ; 127 17626: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1762a: 08 95 ret 1762c: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 17630: 8f 7d andi r24, 0xDF ; 223 17632: f9 cf rjmp .-14 ; 0x17626 17634: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 17638: 8f 77 andi r24, 0x7F ; 127 1763a: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1763e: 08 95 ret 17640: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 17644: 8f 7d andi r24, 0xDF ; 223 17646: f9 cf rjmp .-14 ; 0x1763a 17648: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1764c: 87 7f andi r24, 0xF7 ; 247 1764e: f5 cf rjmp .-22 ; 0x1763a 17650: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 17654: 8f 77 andi r24, 0x7F ; 127 17656: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1765a: 08 95 ret 1765c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 17660: 8f 7d andi r24, 0xDF ; 223 17662: f9 cf rjmp .-14 ; 0x17656 17664: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 17668: 87 7f andi r24, 0xF7 ; 247 1766a: f5 cf rjmp .-22 ; 0x17656 1766c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 17670: 8f 77 andi r24, 0x7F ; 127 17672: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 17676: 08 95 ret 17678: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1767c: 8f 7d andi r24, 0xDF ; 223 1767e: f9 cf rjmp .-14 ; 0x17672 17680: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 17684: 87 7f andi r24, 0xF7 ; 247 17686: f5 cf rjmp .-22 ; 0x17672 00017688 : 17688: 83 b1 in r24, 0x03 ; 3 1768a: 82 95 swap r24 1768c: 81 70 andi r24, 0x01 ; 1 1768e: 08 95 ret 00017690 : } #else //SM4_ACCEL_TEST uint16_t xyzcal_calc_delay(uint16_t, uint16_t) { return xyzcal_sm4_delay; } 17690: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef 17694: 90 91 f0 03 lds r25, 0x03F0 ; 0x8003f0 17698: 08 95 ret 0001769a : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 1769a: cf 92 push r12 1769c: df 92 push r13 1769e: ef 92 push r14 176a0: 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; 176a2: 20 91 f1 03 lds r18, 0x03F1 ; 0x8003f1 176a6: b0 e0 ldi r27, 0x00 ; 0 176a8: a0 e0 ldi r26, 0x00 ; 0 176aa: c0 90 4c 06 lds r12, 0x064C ; 0x80064c 176ae: d0 90 4d 06 lds r13, 0x064D ; 0x80064d 176b2: e0 90 4e 06 lds r14, 0x064E ; 0x80064e 176b6: f0 90 4f 06 lds r15, 0x064F ; 0x80064f 176ba: 20 ff sbrs r18, 0 176bc: 42 c0 rjmp .+132 ; 0x17742 176be: c8 1a sub r12, r24 176c0: d9 0a sbc r13, r25 176c2: ea 0a sbc r14, r26 176c4: fb 0a sbc r15, r27 176c6: c0 92 4c 06 sts 0x064C, r12 ; 0x80064c 176ca: d0 92 4d 06 sts 0x064D, r13 ; 0x80064d 176ce: e0 92 4e 06 sts 0x064E, r14 ; 0x80064e 176d2: f0 92 4f 06 sts 0x064F, r15 ; 0x80064f 176d6: cb 01 movw r24, r22 176d8: b0 e0 ldi r27, 0x00 ; 0 176da: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 176dc: c0 90 50 06 lds r12, 0x0650 ; 0x800650 176e0: d0 90 51 06 lds r13, 0x0651 ; 0x800651 176e4: e0 90 52 06 lds r14, 0x0652 ; 0x800652 176e8: f0 90 53 06 lds r15, 0x0653 ; 0x800653 176ec: 21 ff sbrs r18, 1 176ee: 36 c0 rjmp .+108 ; 0x1775c 176f0: c8 1a sub r12, r24 176f2: d9 0a sbc r13, r25 176f4: ea 0a sbc r14, r26 176f6: fb 0a sbc r15, r27 176f8: c0 92 50 06 sts 0x0650, r12 ; 0x800650 176fc: d0 92 51 06 sts 0x0651, r13 ; 0x800651 17700: e0 92 52 06 sts 0x0652, r14 ; 0x800652 17704: f0 92 53 06 sts 0x0653, r15 ; 0x800653 17708: 70 e0 ldi r23, 0x00 ; 0 1770a: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1770c: 80 91 54 06 lds r24, 0x0654 ; 0x800654 17710: 90 91 55 06 lds r25, 0x0655 ; 0x800655 17714: a0 91 56 06 lds r26, 0x0656 ; 0x800656 17718: b0 91 57 06 lds r27, 0x0657 ; 0x800657 1771c: 22 ff sbrs r18, 2 1771e: 2b c0 rjmp .+86 ; 0x17776 17720: 84 1b sub r24, r20 17722: 95 0b sbc r25, r21 17724: a6 0b sbc r26, r22 17726: b7 0b sbc r27, r23 17728: 80 93 54 06 sts 0x0654, r24 ; 0x800654 1772c: 90 93 55 06 sts 0x0655, r25 ; 0x800655 17730: a0 93 56 06 sts 0x0656, r26 ; 0x800656 17734: b0 93 57 06 sts 0x0657, r27 ; 0x800657 // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 17738: ff 90 pop r15 1773a: ef 90 pop r14 1773c: df 90 pop r13 1773e: cf 90 pop r12 17740: 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; 17742: 8c 0d add r24, r12 17744: 9d 1d adc r25, r13 17746: ae 1d adc r26, r14 17748: bf 1d adc r27, r15 1774a: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 1774e: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 17752: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 17756: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f 1775a: bd cf rjmp .-134 ; 0x176d6 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1775c: 8c 0d add r24, r12 1775e: 9d 1d adc r25, r13 17760: ae 1d adc r26, r14 17762: bf 1d adc r27, r15 17764: 80 93 50 06 sts 0x0650, r24 ; 0x800650 17768: 90 93 51 06 sts 0x0651, r25 ; 0x800651 1776c: a0 93 52 06 sts 0x0652, r26 ; 0x800652 17770: b0 93 53 06 sts 0x0653, r27 ; 0x800653 17774: c9 cf rjmp .-110 ; 0x17708 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 17776: 84 0f add r24, r20 17778: 95 1f adc r25, r21 1777a: a6 1f adc r26, r22 1777c: b7 1f adc r27, r23 1777e: d4 cf rjmp .-88 ; 0x17728 00017780 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 17780: fb 01 movw r30, r22 *v = 0; 17782: 11 82 std Z+1, r1 ; 0x01 17784: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 17786: 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'; 17788: dc 01 movw r26, r24 1778a: 2c 91 ld r18, X 1778c: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 1778e: 2a 30 cpi r18, 0x0A ; 10 17790: a0 f4 brcc .+40 ; 0x177ba *v *= 10; 17792: 40 81 ld r20, Z 17794: 51 81 ldd r21, Z+1 ; 0x01 17796: 64 9f mul r22, r20 17798: 90 01 movw r18, r0 1779a: 65 9f mul r22, r21 1779c: 30 0d add r19, r0 1779e: 11 24 eor r1, r1 177a0: 31 83 std Z+1, r19 ; 0x01 177a2: 20 83 st Z, r18 *v += *str - '0'; 177a4: 4d 91 ld r20, X+ 177a6: cd 01 movw r24, r26 177a8: 20 53 subi r18, 0x30 ; 48 177aa: 31 09 sbc r19, r1 177ac: 24 0f add r18, r20 177ae: 31 1d adc r19, r1 177b0: 47 fd sbrc r20, 7 177b2: 3a 95 dec r19 177b4: 31 83 std Z+1, r19 ; 0x01 177b6: 20 83 st Z, r18 177b8: e7 cf rjmp .-50 ; 0x17788 ++str; } return str; } 177ba: 08 95 ret 000177bc : 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) { 177bc: fc 01 movw r30, r24 switch(*oCheckSetting) { 177be: 80 81 ld r24, Z 177c0: 88 23 and r24, r24 177c2: 21 f0 breq .+8 ; 0x177cc 177c4: 81 30 cpi r24, 0x01 ; 1 177c6: 29 f4 brne .+10 ; 0x177d2 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 177c8: 82 e0 ldi r24, 0x02 ; 2 177ca: 01 c0 rjmp .+2 ; 0x177ce while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 177cc: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 177ce: 80 83 st Z, r24 177d0: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 177d2: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 177d4: 08 95 ret 000177d6 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 177d6: fc 01 movw r30, r24 177d8: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 177da: 90 32 cpi r25, 0x20 ; 32 177dc: 49 f0 breq .+18 ; 0x177f0 177de: 87 ef ldi r24, 0xF7 ; 247 177e0: 89 0f add r24, r25 177e2: 82 30 cpi r24, 0x02 ; 2 177e4: 28 f0 brcs .+10 ; 0x177f0 177e6: 81 e0 ldi r24, 0x01 ; 1 177e8: 9d 30 cpi r25, 0x0D ; 13 177ea: 19 f0 breq .+6 ; 0x177f2 177ec: 80 e0 ldi r24, 0x00 ; 0 177ee: 08 95 ret 177f0: 81 e0 ldi r24, 0x01 ; 1 } 177f2: 08 95 ret 000177f4 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 177f4: cf 93 push r28 177f6: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 177f8: 0f 94 b0 18 call 0x23160 ; 0x23160 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 177fc: c1 e6 ldi r28, 0x61 ; 97 177fe: d2 e1 ldi r29, 0x12 ; 18 planner_synchronize(); // Compensate for configurable Extra Loading Distance planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU2_FILAMENT_SENSOR_POSITION)); 17800: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 17804: 70 e0 ldi r23, 0x00 ; 0 17806: 90 e0 ldi r25, 0x00 ; 0 17808: 80 e0 ldi r24, 0x00 ; 0 1780a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1780e: 20 e0 ldi r18, 0x00 ; 0 17810: 30 e0 ldi r19, 0x00 ; 0 17812: 40 e8 ldi r20, 0x80 ; 128 17814: 51 e4 ldi r21, 0x41 ; 65 17816: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1781a: 9b 01 movw r18, r22 1781c: ac 01 movw r20, r24 1781e: 6c 85 ldd r22, Y+12 ; 0x0c 17820: 7d 85 ldd r23, Y+13 ; 0x0d 17822: 8e 85 ldd r24, Y+14 ; 0x0e 17824: 9f 85 ldd r25, Y+15 ; 0x0f 17826: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1782a: 6c 87 std Y+12, r22 ; 0x0c 1782c: 7d 87 std Y+13, r23 ; 0x0d 1782e: 8e 87 std Y+14, r24 ; 0x0e 17830: 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])); 17832: 62 e0 ldi r22, 0x02 ; 2 17834: 8e e6 ldi r24, 0x6E ; 110 17836: 97 e8 ldi r25, 0x87 ; 135 } 17838: df 91 pop r29 1783a: 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])); 1783c: 0d 94 3a 79 jmp 0x2f274 ; 0x2f274 00017840 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 17840: df 92 push r13 17842: ef 92 push r14 17844: ff 92 push r15 17846: 0f 93 push r16 17848: 1f 93 push r17 1784a: cf 93 push r28 1784c: df 93 push r29 1784e: cd b7 in r28, 0x3d ; 61 17850: de b7 in r29, 0x3e ; 62 17852: 63 97 sbiw r28, 0x13 ; 19 17854: 0f b6 in r0, 0x3f ; 63 17856: f8 94 cli 17858: de bf out 0x3e, r29 ; 62 1785a: 0f be out 0x3f, r0 ; 63 1785c: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1785e: 30 91 63 04 lds r19, 0x0463 ; 0x800463 17862: 20 91 62 04 lds r18, 0x0462 ; 0x800462 17866: 32 13 cpse r19, r18 17868: 73 c0 rjmp .+230 ; 0x17950 1786a: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 1786c: 80 91 59 02 lds r24, 0x0259 ; 0x800259 17870: 88 23 and r24, r24 17872: 09 f4 brne .+2 ; 0x17876 17874: 45 c0 rjmp .+138 ; 0x17900 //! //! @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)); 17876: 85 e2 ldi r24, 0x25 ; 37 17878: 9e e4 ldi r25, 0x4E ; 78 1787a: 0e 94 0a 75 call 0xea14 ; 0xea14 1787e: 9f 93 push r25 17880: 8f 93 push r24 17882: 80 e6 ldi r24, 0x60 ; 96 17884: 97 e8 ldi r25, 0x87 ; 135 17886: 9f 93 push r25 17888: 8f 93 push r24 1788a: 8e 01 movw r16, r28 1788c: 0f 5f subi r16, 0xFF ; 255 1788e: 1f 4f sbci r17, 0xFF ; 255 17890: 1f 93 push r17 17892: 0f 93 push r16 17894: 0f 94 b4 a2 call 0x34568 ; 0x34568 17898: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 1789a: 47 e0 ldi r20, 0x07 ; 7 1789c: 50 e0 ldi r21, 0x00 ; 0 1789e: b7 01 movw r22, r14 178a0: 80 0f add r24, r16 178a2: 91 2f mov r25, r17 178a4: 91 1d adc r25, r1 178a6: 0f 94 8d a3 call 0x3471a ; 0x3471a 178aa: 0f 90 pop r0 178ac: 0f 90 pop r0 178ae: 0f 90 pop r0 178b0: 0f 90 pop r0 178b2: 0f 90 pop r0 178b4: 0f 90 pop r0 178b6: 20 e0 ldi r18, 0x00 ; 0 178b8: 82 2f mov r24, r18 178ba: 8d 0d add r24, r13 178bc: 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) 178be: 27 30 cpi r18, 0x07 ; 7 178c0: 39 f0 breq .+14 ; 0x178d0 178c2: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 178c4: f8 01 movw r30, r16 178c6: e8 0f add r30, r24 178c8: f9 1f adc r31, r25 178ca: 30 81 ld r19, Z 178cc: 31 11 cpse r19, r1 178ce: f4 cf rjmp .-24 ; 0x178b8 } buffer.c[index] = ']'; 178d0: f8 01 movw r30, r16 178d2: e8 0f add r30, r24 178d4: f9 1f adc r31, r25 178d6: 2d e5 ldi r18, 0x5D ; 93 178d8: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 178da: 8c 0f add r24, r28 178dc: 9d 1f adc r25, r29 178de: fc 01 movw r30, r24 178e0: 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()); 178e2: 0e 94 36 62 call 0xc46c ; 0xc46c 178e6: 48 2f mov r20, r24 178e8: 60 91 60 04 lds r22, 0x0460 ; 0x800460 178ec: 80 e0 ldi r24, 0x00 ; 0 178ee: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 178f2: 62 e1 ldi r22, 0x12 ; 18 178f4: c8 01 movw r24, r16 178f6: 0e 94 17 73 call 0xe62e ; 0xe62e lcd_putc(type_char); 178fa: 80 e2 ldi r24, 0x20 ; 32 178fc: 0e 94 f1 6e call 0xdde2 ; 0xdde2 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)) 17900: 80 91 61 04 lds r24, 0x0461 ; 0x800461 17904: 88 23 and r24, r24 17906: 21 f1 breq .+72 ; 0x17950 17908: 20 91 63 04 lds r18, 0x0463 ; 0x800463 1790c: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 17910: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 17914: 28 17 cp r18, r24 17916: 19 06 cpc r1, r25 17918: d9 f4 brne .+54 ; 0x17950 { lcd_update_enabled = 0; 1791a: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); 1791e: 8a e7 ldi r24, 0x7A ; 122 17920: 98 e7 ldi r25, 0x78 ; 120 17922: 89 2b or r24, r25 17924: 11 f0 breq .+4 ; 0x1792a 17926: 0e 94 7a 78 call 0xf0f4 ; 0xf0f4 lcd_update_enabled = 1; 1792a: 81 e0 ldi r24, 0x01 ; 1 1792c: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); 17930: 0e 94 43 62 call 0xc486 ; 0xc486 return; } } menu_item++; } 17934: 63 96 adiw r28, 0x13 ; 19 17936: 0f b6 in r0, 0x3f ; 63 17938: f8 94 cli 1793a: de bf out 0x3e, r29 ; 62 1793c: 0f be out 0x3f, r0 ; 63 1793e: cd bf out 0x3d, r28 ; 61 17940: df 91 pop r29 17942: cf 91 pop r28 17944: 1f 91 pop r17 17946: 0f 91 pop r16 17948: ff 90 pop r15 1794a: ef 90 pop r14 1794c: df 90 pop r13 1794e: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 17950: 80 91 63 04 lds r24, 0x0463 ; 0x800463 17954: 8f 5f subi r24, 0xFF ; 255 17956: 80 93 63 04 sts 0x0463, r24 ; 0x800463 1795a: ec cf rjmp .-40 ; 0x17934 0001795c : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 1795c: 85 eb ldi r24, 0xB5 ; 181 1795e: 98 e6 ldi r25, 0x68 ; 104 17960: 0e 94 8d 7c call 0xf91a ; 0xf91a lcd_return_to_status(); 17964: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 00017968 : //! 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) { 17968: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 1796c: 81 30 cpi r24, 0x01 ; 1 1796e: 21 f4 brne .+8 ; 0x17978 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 17970: 87 e6 ldi r24, 0x67 ; 103 17972: 98 e6 ldi r25, 0x68 ; 104 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 17974: 0c 94 8d 7c jmp 0xf91a ; 0xf91a 17978: 88 e5 ldi r24, 0x58 ; 88 1797a: 98 e6 ldi r25, 0x68 ; 104 1797c: fb cf rjmp .-10 ; 0x17974 0001797e : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 1797e: 0d 94 86 6d jmp 0x2db0c ; 0x2db0c 00017982 : 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) { 17982: 0f 93 push r16 17984: 1f 93 push r17 17986: cf 93 push r28 17988: df 93 push r29 1798a: 98 2f mov r25, r24 1798c: 86 2f mov r24, r22 1798e: 14 2f mov r17, r20 17990: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 17992: 69 2f mov r22, r25 17994: 0e 94 2a 6f call 0xde54 ; 0xde54 switch (_state) 17998: 11 30 cpi r17, 0x01 ; 1 1799a: 21 f0 breq .+8 ; 0x179a4 1799c: 12 30 cpi r17, 0x02 ; 2 1799e: 79 f0 breq .+30 ; 0x179be lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 179a0: ce 01 movw r24, r28 179a2: 15 c0 rjmp .+42 ; 0x179ce { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 179a4: ce 01 movw r24, r28 179a6: 0e 94 ed 6e call 0xddda ; 0xddda lcd_putc(':'); 179aa: 8a e3 ldi r24, 0x3A ; 58 179ac: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_putc(_indicator); 179b0: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 179b2: df 91 pop r29 179b4: cf 91 pop r28 179b6: 1f 91 pop r17 179b8: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 179ba: 0c 94 f1 6e jmp 0xdde2 ; 0xdde2 break; case 2: lcd_puts_P(_name_PROGMEM); 179be: ce 01 movw r24, r28 179c0: 0e 94 ed 6e call 0xddda ; 0xddda lcd_putc(':'); 179c4: 8a e3 ldi r24, 0x3A ; 58 179c6: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_puts_P(MSG_OK_CAPS); 179ca: 8e e8 ldi r24, 0x8E ; 142 179cc: 98 e6 ldi r25, 0x68 ; 104 break; default: lcd_puts_P(_name_PROGMEM); } } 179ce: df 91 pop r29 179d0: cf 91 pop r28 179d2: 1f 91 pop r17 179d4: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 179d6: 0c 94 ed 6e jmp 0xddda ; 0xddda 000179da : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 179da: 81 30 cpi r24, 0x01 ; 1 179dc: 21 f4 brne .+8 ; 0x179e6 case STATE_ON: lcd_puts_P(_N(" 1")); 179de: 84 ea ldi r24, 0xA4 ; 164 179e0: 97 e6 ldi r25, 0x67 ; 103 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 179e2: 0c 94 ed 6e jmp 0xddda ; 0xddda 179e6: 80 ea ldi r24, 0xA0 ; 160 179e8: 97 e6 ldi r25, 0x67 ; 103 179ea: fb cf rjmp .-10 ; 0x179e2 000179ec : } #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); 179ec: 87 ea ldi r24, 0xA7 ; 167 179ee: 9c e0 ldi r25, 0x0C ; 12 179f0: 0f 94 9d a3 call 0x3473a ; 0x3473a if (value > 1) value = 1; 179f4: 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) 179f6: 82 30 cpi r24, 0x02 ; 2 179f8: 08 f4 brcc .+2 ; 0x179fc 179fa: 68 27 eor r22, r24 179fc: 87 ea ldi r24, 0xA7 ; 167 179fe: 9c e0 ldi r25, 0x0C ; 12 17a00: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017a04 : 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); 17a04: 8a ea ldi r24, 0xAA ; 170 17a06: 9d e0 ldi r25, 0x0D ; 13 17a08: 0f 94 9d a3 call 0x3473a ; 0x3473a switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 17a0c: 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) { 17a0e: 83 30 cpi r24, 0x03 ; 3 17a10: 21 f0 breq .+8 ; 0x17a1a case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 17a12: 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) { 17a14: 85 30 cpi r24, 0x05 ; 5 17a16: 09 f0 breq .+2 ; 0x17a1a case 1: mbl_z_probe_nr = 3; break; 17a18: 63 e0 ldi r22, 0x03 ; 3 17a1a: 8a ea ldi r24, 0xAA ; 170 17a1c: 9d e0 ldi r25, 0x0D ; 13 17a1e: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017a22 : 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); 17a22: 8b ea ldi r24, 0xAB ; 171 17a24: 9d e0 ldi r25, 0x0D ; 13 17a26: 0f 94 9d a3 call 0x3473a ; 0x3473a if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 17a2a: 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; 17a2c: 83 30 cpi r24, 0x03 ; 3 17a2e: 09 f4 brne .+2 ; 0x17a32 17a30: 67 e0 ldi r22, 0x07 ; 7 17a32: 8b ea ldi r24, 0xAB ; 171 17a34: 9d e0 ldi r25, 0x0D ; 13 17a36: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017a3a : #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); 17a3a: 8c ea ldi r24, 0xAC ; 172 17a3c: 9d e0 ldi r25, 0x0D ; 13 17a3e: 0f 94 9d a3 call 0x3473a ; 0x3473a magnet_elimination = !magnet_elimination; 17a42: 61 e0 ldi r22, 0x01 ; 1 17a44: 81 11 cpse r24, r1 17a46: 60 e0 ldi r22, 0x00 ; 0 17a48: 8c ea ldi r24, 0xAC ; 172 17a4a: 9d e0 ldi r25, 0x0D ; 13 17a4c: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017a50 : 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); 17a50: 8e ee ldi r24, 0xEE ; 238 17a52: 93 e0 ldi r25, 0x03 ; 3 17a54: 0e 94 de bb call 0x177bc ; 0x177bc 17a58: 60 91 ee 03 lds r22, 0x03EE ; 0x8003ee 17a5c: 80 e2 ldi r24, 0x20 ; 32 17a5e: 9c e0 ldi r25, 0x0C ; 12 17a60: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017a64 : 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); 17a64: 89 ee ldi r24, 0xE9 ; 233 17a66: 93 e0 ldi r25, 0x03 ; 3 17a68: 0e 94 de bb call 0x177bc ; 0x177bc 17a6c: 60 91 e9 03 lds r22, 0x03E9 ; 0x8003e9 17a70: 83 ea ldi r24, 0xA3 ; 163 17a72: 9d e0 ldi r25, 0x0D ; 13 17a74: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017a78 : 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); 17a78: 8a ee ldi r24, 0xEA ; 234 17a7a: 93 e0 ldi r25, 0x03 ; 3 17a7c: 0e 94 de bb call 0x177bc ; 0x177bc 17a80: 60 91 ea 03 lds r22, 0x03EA ; 0x8003ea 17a84: 84 ea ldi r24, 0xA4 ; 164 17a86: 9d e0 ldi r25, 0x0D ; 13 17a88: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017a8c : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 17a8c: 8d ee ldi r24, 0xED ; 237 17a8e: 93 e0 ldi r25, 0x03 ; 3 17a90: 0e 94 de bb call 0x177bc ; 0x177bc 17a94: 60 91 ed 03 lds r22, 0x03ED ; 0x8003ed 17a98: 88 ea ldi r24, 0xA8 ; 168 17a9a: 9d e0 ldi r25, 0x0D ; 13 17a9c: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017aa0 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 17aa0: 80 91 f9 16 lds r24, 0x16F9 ; 0x8016f9 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 17aa4: 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) { 17aa6: 81 11 cpse r24, r1 17aa8: 01 c0 rjmp .+2 ; 0x17aac case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 17aaa: 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; 17aac: 60 93 f9 16 sts 0x16F9, r22 ; 0x8016f9 17ab0: 87 e4 ldi r24, 0x47 ; 71 17ab2: 9d e0 ldi r25, 0x0D ; 13 17ab4: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017ab8 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 17ab8: e1 ef ldi r30, 0xF1 ; 241 17aba: f6 e1 ldi r31, 0x16 ; 22 17abc: 61 81 ldd r22, Z+1 ; 0x01 17abe: 81 e0 ldi r24, 0x01 ; 1 17ac0: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 17ac2: 61 83 std Z+1, r22 ; 0x01 17ac4: 87 e0 ldi r24, 0x07 ; 7 17ac6: 9f e0 ldi r25, 0x0F ; 15 17ac8: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017acc : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 17acc: e1 ef ldi r30, 0xF1 ; 241 17ace: f6 e1 ldi r31, 0x16 ; 22 17ad0: 62 81 ldd r22, Z+2 ; 0x02 17ad2: 81 e0 ldi r24, 0x01 ; 1 17ad4: 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; 17ad6: 62 83 std Z+2, r22 ; 0x02 17ad8: 85 ed ldi r24, 0xD5 ; 213 17ada: 9e e0 ldi r25, 0x0E ; 14 17adc: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017ae0 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 17ae0: e8 e4 ldi r30, 0x48 ; 72 17ae2: f6 e1 ldi r31, 0x16 ; 22 17ae4: 60 81 ld r22, Z 17ae6: 81 e0 ldi r24, 0x01 ; 1 17ae8: 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; } 17aea: 60 83 st Z, r22 17aec: 8b eb ldi r24, 0xBB ; 187 17aee: 9f e0 ldi r25, 0x0F ; 15 17af0: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017af4 : 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); 17af4: 8f ea ldi r24, 0xAF ; 175 17af6: 9f e0 ldi r25, 0x0F ; 15 17af8: 0f 94 9d a3 call 0x3473a ; 0x3473a temp_cal_active = !temp_cal_active; 17afc: 61 e0 ldi r22, 0x01 ; 1 17afe: 81 11 cpse r24, r1 17b00: 60 e0 ldi r22, 0x00 ; 0 17b02: 8f ea ldi r24, 0xAF ; 175 17b04: 9f e0 ldi r25, 0x0F ; 15 17b06: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017b0a : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 17b0a: 80 91 47 04 lds r24, 0x0447 ; 0x800447 17b0e: 81 30 cpi r24, 0x01 ; 1 17b10: 71 f0 breq .+28 ; 0x17b2e 17b12: 20 f0 brcs .+8 ; 0x17b1c 17b14: 82 30 cpi r24, 0x02 ; 2 17b16: 69 f4 brne .+26 ; 0x17b32 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 17b18: 83 e0 ldi r24, 0x03 ; 3 17b1a: 01 c0 rjmp .+2 ; 0x17b1e void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 17b1c: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 17b1e: 80 93 47 04 sts 0x0447, r24 ; 0x800447 17b22: 60 91 47 04 lds r22, 0x0447 ; 0x800447 17b26: 87 ed ldi r24, 0xD7 ; 215 17b28: 9e e0 ldi r25, 0x0E ; 14 17b2a: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 17b2e: 82 e0 ldi r24, 0x02 ; 2 17b30: f6 cf rjmp .-20 ; 0x17b1e break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 17b32: 10 92 47 04 sts 0x0447, r1 ; 0x800447 17b36: f5 cf rjmp .-22 ; 0x17b22 00017b38 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 17b38: 89 e0 ldi r24, 0x09 ; 9 17b3a: 9f e0 ldi r25, 0x0F ; 15 17b3c: 0f 94 9d a3 call 0x3473a ; 0x3473a switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 17b40: 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) { 17b42: 88 23 and r24, r24 17b44: 21 f0 breq .+8 ; 0x17b4e case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 17b46: 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) { 17b48: 81 30 cpi r24, 0x01 ; 1 17b4a: 09 f0 breq .+2 ; 0x17b4e case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 17b4c: 60 e0 ldi r22, 0x00 ; 0 17b4e: 89 e0 ldi r24, 0x09 ; 9 17b50: 9f e0 ldi r25, 0x0F ; 15 17b52: 0f 94 c1 a3 call 0x34782 ; 0x34782 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 17b56: 81 e0 ldi r24, 0x01 ; 1 17b58: 80 93 26 14 sts 0x1426, r24 ; 0x801426 } 17b5c: 08 95 ret 00017b5e : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 17b5e: cf 93 push r28 17b60: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 17b62: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb 17b66: 8c 33 cpi r24, 0x3C ; 60 17b68: e1 f0 breq .+56 ; 0x17ba2 17b6a: 80 35 cpi r24, 0x50 ; 80 17b6c: 01 f1 breq .+64 ; 0x17bae 17b6e: 88 32 cpi r24, 0x28 ; 40 17b70: 91 f0 breq .+36 ; 0x17b96 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 17b72: 88 e2 ldi r24, 0x28 ; 40 17b74: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=400; 17b78: c0 e9 ldi r28, 0x90 ; 144 17b7a: d1 e0 ldi r29, 0x01 ; 1 17b7c: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb 17b80: 87 ea ldi r24, 0xA7 ; 167 17b82: 9d e0 ldi r25, 0x0D ; 13 17b84: 0f 94 c1 a3 call 0x34782 ; 0x34782 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 17b88: be 01 movw r22, r28 17b8a: 85 ea ldi r24, 0xA5 ; 165 17b8c: 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); } 17b8e: df 91 pop r29 17b90: cf 91 pop r28 17b92: 0d 94 df a3 jmp 0x347be ; 0x347be case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 17b96: 8c e3 ldi r24, 0x3C ; 60 17b98: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=600; 17b9c: c8 e5 ldi r28, 0x58 ; 88 17b9e: d2 e0 ldi r29, 0x02 ; 2 17ba0: ed cf rjmp .-38 ; 0x17b7c break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 17ba2: 80 e5 ldi r24, 0x50 ; 80 17ba4: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=800; 17ba8: c0 e2 ldi r28, 0x20 ; 32 17baa: d3 e0 ldi r29, 0x03 ; 3 17bac: e7 cf rjmp .-50 ; 0x17b7c break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 17bae: 89 e1 ldi r24, 0x19 ; 25 17bb0: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=250; 17bb4: ca ef ldi r28, 0xFA ; 250 17bb6: d0 e0 ldi r29, 0x00 ; 0 17bb8: e1 cf rjmp .-62 ; 0x17b7c 00017bba : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 17bba: 0f 93 push r16 17bbc: 1f 93 push r17 17bbe: cf 93 push r28 17bc0: df 93 push r29 17bc2: 00 d0 rcall .+0 ; 0x17bc4 17bc4: 00 d0 rcall .+0 ; 0x17bc6 17bc6: 1f 92 push r1 17bc8: 1f 92 push r1 17bca: cd b7 in r28, 0x3d ; 61 17bcc: de b7 in r29, 0x3e ; 62 17bce: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 17bd0: 8a e0 ldi r24, 0x0A ; 10 17bd2: 90 e0 ldi r25, 0x00 ; 0 17bd4: 0f 94 ab a3 call 0x34756 ; 0x34756 17bd8: 9a 83 std Y+2, r25 ; 0x02 17bda: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 17bdc: 8c e0 ldi r24, 0x0C ; 12 17bde: 90 e0 ldi r25, 0x00 ; 0 17be0: 0f 94 ab a3 call 0x34756 ; 0x34756 17be4: 9c 83 std Y+4, r25 ; 0x04 17be6: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 17be8: 8e e0 ldi r24, 0x0E ; 14 17bea: 90 e0 ldi r25, 0x00 ; 0 17bec: 0f 94 ab a3 call 0x34756 ; 0x34756 17bf0: 9e 83 std Y+6, r25 ; 0x06 17bf2: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 17bf4: 80 e1 ldi r24, 0x10 ; 16 17bf6: 90 e0 ldi r25, 0x00 ; 0 17bf8: 0f 94 ab a3 call 0x34756 ; 0x34756 17bfc: 98 87 std Y+8, r25 ; 0x08 17bfe: 8f 83 std Y+7, r24 ; 0x07 17c00: c8 01 movw r24, r16 17c02: de 01 movw r26, r28 17c04: 11 96 adiw r26, 0x01 ; 1 17c06: be 01 movw r22, r28 17c08: 67 5f subi r22, 0xF7 ; 247 17c0a: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 17c0c: fc 01 movw r30, r24 17c0e: 25 91 lpm r18, Z+ 17c10: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 17c12: 4d 91 ld r20, X+ 17c14: 5d 91 ld r21, X+ 17c16: 42 17 cp r20, r18 17c18: 53 07 cpc r21, r19 17c1a: 48 f0 brcs .+18 ; 0x17c2e return true; else if (v < ver_eeprom[i]) 17c1c: 24 17 cp r18, r20 17c1e: 35 07 cpc r19, r21 17c20: 20 f0 brcs .+8 ; 0x17c2a 17c22: 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) { 17c24: a6 17 cp r26, r22 17c26: b7 07 cpc r27, r23 17c28: 89 f7 brne .-30 ; 0x17c0c return true; else if (v < ver_eeprom[i]) break; } return false; 17c2a: 80 e0 ldi r24, 0x00 ; 0 17c2c: 01 c0 rjmp .+2 ; 0x17c30 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; 17c2e: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 17c30: 28 96 adiw r28, 0x08 ; 8 17c32: 0f b6 in r0, 0x3f ; 63 17c34: f8 94 cli 17c36: de bf out 0x3e, r29 ; 62 17c38: 0f be out 0x3f, r0 ; 63 17c3a: cd bf out 0x3d, r28 ; 61 17c3c: df 91 pop r29 17c3e: cf 91 pop r28 17c40: 1f 91 pop r17 17c42: 0f 91 pop r16 17c44: 08 95 ret 00017c46 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 17c46: 8c ea ldi r24, 0xAC ; 172 17c48: 9c e0 ldi r25, 0x0C ; 12 17c4a: 0f 94 9d a3 call 0x3473a ; 0x3473a if (current_state) 17c4e: 88 23 and r24, r24 17c50: 99 f0 breq .+38 ; 0x17c78 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 17c52: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 17c56: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 17c5a: 10 92 94 12 sts 0x1294, r1 ; 0x801294 eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); 17c5e: 8c ea ldi r24, 0xAC ; 172 17c60: 9c e0 ldi r25, 0x0C ; 12 17c62: 0f 94 9d a3 call 0x3473a ; 0x3473a 17c66: 61 e0 ldi r22, 0x01 ; 1 17c68: 81 11 cpse r24, r1 17c6a: 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); 17c6c: 8c ea ldi r24, 0xAC ; 172 17c6e: 9c e0 ldi r25, 0x0C ; 12 17c70: 0f 94 e5 a3 call 0x347ca ; 0x347ca { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); 17c74: 0d 94 85 65 jmp 0x2cb0a ; 0x2cb0a { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 17c78: 0f 94 3d 95 call 0x32a7a ; 0x32a7a 17c7c: f0 cf rjmp .-32 ; 0x17c5e 00017c7e : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 17c7e: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 17c82: 88 23 and r24, r24 17c84: 21 f0 breq .+8 ; 0x17c8e 17c86: 81 30 cpi r24, 0x01 ; 1 17c88: 69 f4 brne .+26 ; 0x17ca4 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break; default: SilentModeMenu = SILENT_MODE_NORMAL; break; // (probably) not needed #else case SILENT_MODE_POWER: SilentModeMenu = SILENT_MODE_SILENT; break; case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 17c8a: 82 e0 ldi r24, 0x02 ; 2 17c8c: 01 c0 rjmp .+2 ; 0x17c90 #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break; default: SilentModeMenu = SILENT_MODE_NORMAL; break; // (probably) not needed #else case SILENT_MODE_POWER: SilentModeMenu = SILENT_MODE_SILENT; break; 17c8e: 81 e0 ldi r24, 0x01 ; 1 case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 17c90: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 17c94: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 17c98: 8f ef ldi r24, 0xFF ; 255 17c9a: 9f e0 ldi r25, 0x0F ; 15 17c9c: 0f 94 c1 a3 call 0x34782 ; 0x34782 // 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(); sei(); #else st_current_init(); 17ca0: 0d 94 39 18 jmp 0x23072 ; 0x23072 case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break; default: SilentModeMenu = SILENT_MODE_NORMAL; break; // (probably) not needed #else case SILENT_MODE_POWER: SilentModeMenu = SILENT_MODE_SILENT; break; case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; case SILENT_MODE_AUTO: SilentModeMenu = SILENT_MODE_POWER; break; 17ca4: 10 92 bb 03 sts 0x03BB, r1 ; 0x8003bb 17ca8: f5 cf rjmp .-22 ; 0x17c94 00017caa : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 17caa: 81 e0 ldi r24, 0x01 ; 1 17cac: 90 91 f1 16 lds r25, 0x16F1 ; 0x8016f1 17cb0: 91 11 cpse r25, r1 17cb2: 80 e0 ldi r24, 0x00 ; 0 17cb4: 0c 94 60 77 jmp 0xeec0 ; 0xeec0 00017cb8 : static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); } #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_jam_detection_set() { 17cb8: 0f 93 push r16 17cba: 1f 93 push r17 17cbc: cf 93 push r28 fsensor.setJamDetectionEnabled(!fsensor.getJamDetectionEnabled(), true); 17cbe: 01 ef ldi r16, 0xF1 ; 241 17cc0: 16 e1 ldi r17, 0x16 ; 22 17cc2: f8 01 movw r30, r16 17cc4: c6 85 ldd r28, Z+14 ; 0x0e 17cc6: 81 e0 ldi r24, 0x01 ; 1 17cc8: c8 27 eor r28, r24 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 17cca: c6 87 std Z+14, r28 ; 0x0e oldPos = pat9125_y; 17ccc: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 17cd0: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 17cd4: 90 8b std Z+16, r25 ; 0x10 17cd6: 87 87 std Z+15, r24 ; 0x0f resetStepCount(); 17cd8: 0f 94 37 6d call 0x2da6e ; 0x2da6e jamErrCnt = 0; 17cdc: f8 01 movw r30, r16 17cde: 15 8a std Z+21, r1 ; 0x15 17ce0: 6c 2f mov r22, r28 17ce2: 8d ea ldi r24, 0xAD ; 173 17ce4: 9c e0 ldi r25, 0x0C ; 12 } 17ce6: cf 91 pop r28 17ce8: 1f 91 pop r17 17cea: 0f 91 pop r16 17cec: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 00017cf0 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 17cf0: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 17cf4: 85 ed ldi r24, 0xD5 ; 213 17cf6: 9a e3 ldi r25, 0x3A ; 58 17cf8: 0e 94 0a 75 call 0xea14 ; 0xea14 17cfc: ac 01 movw r20, r24 17cfe: 60 e0 ldi r22, 0x00 ; 0 17d00: 80 e0 ldi r24, 0x00 ; 0 17d02: 0e 94 d7 6f call 0xdfae ; 0xdfae pid_temp += lcd_encoder; 17d06: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17d0a: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 17d0e: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 17d12: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 17d16: 82 0f add r24, r18 17d18: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 17d1a: 82 33 cpi r24, 0x32 ; 50 17d1c: 21 e0 ldi r18, 0x01 ; 1 17d1e: 92 07 cpc r25, r18 17d20: 50 f1 brcs .+84 ; 0x17d76 17d22: 81 e3 ldi r24, 0x31 ; 49 17d24: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 17d26: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f 17d2a: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e lcd_encoder = 0; 17d2e: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 17d32: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_set_cursor(1, 2); 17d36: 62 e0 ldi r22, 0x02 ; 2 17d38: 81 e0 ldi r24, 0x01 ; 1 17d3a: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%3u"), pid_temp); 17d3e: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 17d42: 8f 93 push r24 17d44: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17d48: 8f 93 push r24 17d4a: 86 e7 ldi r24, 0x76 ; 118 17d4c: 92 e8 ldi r25, 0x82 ; 130 17d4e: 9f 93 push r25 17d50: 8f 93 push r24 17d52: 0e 94 db 6e call 0xddb6 ; 0xddb6 if (lcd_clicked()) { 17d56: 0e 94 45 73 call 0xe68a ; 0xe68a 17d5a: 0f 90 pop r0 17d5c: 0f 90 pop r0 17d5e: 0f 90 pop r0 17d60: 0f 90 pop r0 17d62: 88 23 and r24, r24 17d64: 71 f0 breq .+28 ; 0x17d82 lcd_commands_type = LcdCommands::PidExtruder; 17d66: 83 e0 ldi r24, 0x03 ; 3 17d68: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e lcd_return_to_status(); 17d6c: 0f 94 6d 05 call 0x20ada ; 0x20ada lcd_update(2); 17d70: 82 e0 ldi r24, 0x02 ; 2 17d72: 0c 94 c9 6e jmp 0xdd92 ; 0xdd92 { 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; 17d76: 8e 31 cpi r24, 0x1E ; 30 17d78: 91 05 cpc r25, r1 17d7a: a8 f6 brcc .-86 ; 0x17d26 17d7c: 8e e1 ldi r24, 0x1E ; 30 17d7e: 90 e0 ldi r25, 0x00 ; 0 17d80: d2 cf rjmp .-92 ; 0x17d26 lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 17d82: 08 95 ret 00017d84 : 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)) { 17d84: 0f 93 push r16 17d86: 1f 93 push r17 17d88: cf 93 push r28 17d8a: df 93 push r29 17d8c: eb 01 movw r28, r22 17d8e: 8a 01 movw r16, r20 switch(*oCheckSetting) { 17d90: 81 30 cpi r24, 0x01 ; 1 17d92: 81 f0 breq .+32 ; 0x17db4 17d94: 82 30 cpi r24, 0x02 ; 2 17d96: 89 f0 breq .+34 ; 0x17dba case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 17d98: 86 ed ldi r24, 0xD6 ; 214 17d9a: 9a e4 ldi r25, 0x4A ; 74 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); 17d9c: 0e 94 0a 75 call 0xea14 ; 0xea14 17da0: 22 e0 ldi r18, 0x02 ; 2 17da2: a8 01 movw r20, r16 17da4: bc 01 movw r22, r24 17da6: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 17da8: df 91 pop r29 17daa: cf 91 pop r28 17dac: 1f 91 pop r17 17dae: 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); 17db0: 0c 94 2e 75 jmp 0xea5c ; 0xea5c 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); 17db4: 8f ec ldi r24, 0xCF ; 207 17db6: 9a e4 ldi r25, 0x4A ; 74 17db8: f1 cf rjmp .-30 ; 0x17d9c break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 17dba: 86 ec ldi r24, 0xC6 ; 198 17dbc: 9a e4 ldi r25, 0x4A ; 74 17dbe: ee cf rjmp .-36 ; 0x17d9c 00017dc0 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() 17dc0: cf 93 push r28 17dc2: df 93 push r29 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); } #else // TMC2130 switch (eeprom_read_byte((uint8_t *)EEPROM_SILENT)) 17dc4: 8f ef ldi r24, 0xFF ; 255 17dc6: 9f e0 ldi r25, 0x0F ; 15 17dc8: 0f 94 9d a3 call 0x3473a ; 0x3473a 17dcc: 81 30 cpi r24, 0x01 ; 1 17dce: 99 f0 breq .+38 ; 0x17df6 17dd0: 82 30 cpi r24, 0x02 ; 2 17dd2: a1 f0 breq .+40 ; 0x17dfc { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); 17dd4: 89 eb ldi r24, 0xB9 ; 185 17dd6: 9a e4 ldi r25, 0x4A ; 74 break; case SILENT_MODE_SILENT: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_SILENT), lcd_silent_mode_set); break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 17dd8: 0e 94 0a 75 call 0xea14 ; 0xea14 17ddc: ec 01 movw r28, r24 17dde: 82 eb ldi r24, 0xB2 ; 178 17de0: 9a e4 ldi r25, 0x4A ; 74 17de2: 0e 94 0a 75 call 0xea14 ; 0xea14 17de6: 22 e0 ldi r18, 0x02 ; 2 17de8: 4f e3 ldi r20, 0x3F ; 63 17dea: 5e eb ldi r21, 0xBE ; 190 17dec: 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 } } 17dee: df 91 pop r29 17df0: cf 91 pop r28 break; case SILENT_MODE_SILENT: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_SILENT), lcd_silent_mode_set); break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 17df2: 0c 94 2e 75 jmp 0xea5c ; 0xea5c { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); break; case SILENT_MODE_SILENT: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_SILENT), lcd_silent_mode_set); 17df6: 89 ea ldi r24, 0xA9 ; 169 17df8: 9a e4 ldi r25, 0x4A ; 74 17dfa: ee cf rjmp .-36 ; 0x17dd8 break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 17dfc: 8c e9 ldi r24, 0x9C ; 156 17dfe: 9a e4 ldi r25, 0x4A ; 74 17e00: eb cf rjmp .-42 ; 0x17dd8 00017e02 : 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() { 17e02: cf 93 push r28 17e04: 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); 17e06: 80 91 40 02 lds r24, 0x0240 ; 0x800240 17e0a: 88 23 and r24, r24 17e0c: 89 f0 breq .+34 ; 0x17e30 17e0e: 8a e9 ldi r24, 0x9A ; 154 17e10: 92 e6 ldi r25, 0x62 ; 98 17e12: 0e 94 0a 75 call 0xea14 ; 0xea14 17e16: ec 01 movw r28, r24 17e18: 84 e7 ldi r24, 0x74 ; 116 17e1a: 94 e4 ldi r25, 0x44 ; 68 17e1c: 0e 94 0a 75 call 0xea14 ; 0xea14 17e20: 22 e0 ldi r18, 0x02 ; 2 17e22: 40 e0 ldi r20, 0x00 ; 0 17e24: 57 e3 ldi r21, 0x37 ; 55 17e26: be 01 movw r22, r28 } 17e28: df 91 pop r29 17e2a: 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); 17e2c: 0c 94 2e 75 jmp 0xea5c ; 0xea5c 17e30: 84 e9 ldi r24, 0x94 ; 148 17e32: 92 e6 ldi r25, 0x62 ; 98 17e34: ee cf rjmp .-36 ; 0x17e12 00017e36 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 17e36: cf 93 push r28 17e38: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 17e3a: 86 ed ldi r24, 0xD6 ; 214 17e3c: 9e e0 ldi r25, 0x0E ; 14 17e3e: 0f 94 9d a3 call 0x3473a ; 0x3473a 17e42: 81 30 cpi r24, 0x01 ; 1 17e44: 19 f5 brne .+70 ; 0x17e8c MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 17e46: 8a e9 ldi r24, 0x9A ; 154 17e48: 92 e6 ldi r25, 0x62 ; 98 17e4a: 0e 94 0a 75 call 0xea14 ; 0xea14 17e4e: 22 e0 ldi r18, 0x02 ; 2 17e50: 44 e2 ldi r20, 0x24 ; 36 17e52: 58 e3 ldi r21, 0x38 ; 56 17e54: bc 01 movw r22, r24 17e56: 8e ee ldi r24, 0xEE ; 238 17e58: 97 e6 ldi r25, 0x67 ; 103 17e5a: 0e 94 2e 75 call 0xea5c ; 0xea5c #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 17e5e: 8e ec ldi r24, 0xCE ; 206 17e60: 9e e0 ldi r25, 0x0E ; 14 17e62: 0f 94 9d a3 call 0x3473a ; 0x3473a 17e66: 81 30 cpi r24, 0x01 ; 1 17e68: a1 f4 brne .+40 ; 0x17e92 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 17e6a: 8a e9 ldi r24, 0x9A ; 154 17e6c: 92 e6 ldi r25, 0x62 ; 98 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); 17e6e: 0e 94 0a 75 call 0xea14 ; 0xea14 17e72: ec 01 movw r28, r24 17e74: 89 e5 ldi r24, 0x59 ; 89 17e76: 94 e4 ldi r25, 0x44 ; 68 17e78: 0e 94 0a 75 call 0xea14 ; 0xea14 17e7c: 22 e0 ldi r18, 0x02 ; 2 17e7e: 4a e7 ldi r20, 0x7A ; 122 17e80: 57 e3 ldi r21, 0x37 ; 55 17e82: be 01 movw r22, r28 #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); #endif // MMU_FORCE_STEALTH_MODE } 17e84: df 91 pop r29 17e86: cf 91 pop r28 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); 17e88: 0c 94 2e 75 jmp 0xea5c ; 0xea5c #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); 17e8c: 84 e9 ldi r24, 0x94 ; 148 17e8e: 92 e6 ldi r25, 0x62 ; 98 17e90: dc cf rjmp .-72 ; 0x17e4a 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); 17e92: 84 e9 ldi r24, 0x94 ; 148 17e94: 92 e6 ldi r25, 0x62 ; 98 17e96: eb cf rjmp .-42 ; 0x17e6e 00017e98 : 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) 17e98: 80 91 96 03 lds r24, 0x0396 ; 0x800396 17e9c: 88 23 and r24, r24 17e9e: 21 f0 breq .+8 ; 0x17ea8 17ea0: 80 91 59 02 lds r24, 0x0259 ; 0x800259 17ea4: 88 23 and r24, r24 17ea6: 51 f0 breq .+20 ; 0x17ebc { _md->status = 1; 17ea8: 81 e0 ldi r24, 0x01 ; 1 17eaa: 80 93 96 03 sts 0x0396, r24 ; 0x800396 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 17eae: 60 e0 ldi r22, 0x00 ; 0 17eb0: 8a e2 ldi r24, 0x2A ; 42 17eb2: 9d e0 ldi r25, 0x0D ; 13 17eb4: 0e 94 2d 78 call 0xf05a ; 0xf05a 17eb8: 80 93 97 03 sts 0x0397, r24 ; 0x800397 } MENU_BEGIN(); 17ebc: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 17ec0: 10 92 60 04 sts 0x0460, r1 ; 0x800460 17ec4: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17ec8: 84 30 cpi r24, 0x04 ; 4 17eca: 08 f0 brcs .+2 ; 0x17ece 17ecc: 90 c0 rjmp .+288 ; 0x17fee 17ece: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 17ed2: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec 17ed6: 81 11 cpse r24, r1 17ed8: 55 c0 rjmp .+170 ; 0x17f84 17eda: 85 e9 ldi r24, 0x95 ; 149 17edc: 9a e4 ldi r25, 0x4A ; 74 17ede: 0e 94 0a 75 call 0xea14 ; 0xea14 17ee2: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 17ee6: 89 e8 ldi r24, 0x89 ; 137 17ee8: 96 e4 ldi r25, 0x46 ; 70 17eea: 0e 94 0a 75 call 0xea14 ; 0xea14 17eee: 6b e8 ldi r22, 0x8B ; 139 17ef0: 7e ec ldi r23, 0xCE ; 206 17ef2: 0e 94 c3 72 call 0xe586 ; 0xe586 SETTINGS_NOZZLE; 17ef6: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb 17efa: 8c 33 cpi r24, 0x3C ; 60 17efc: 09 f4 brne .+2 ; 0x17f00 17efe: 60 c0 rjmp .+192 ; 0x17fc0 17f00: 08 f0 brcs .+2 ; 0x17f04 17f02: 43 c0 rjmp .+134 ; 0x17f8a 17f04: 89 31 cpi r24, 0x19 ; 25 17f06: 09 f4 brne .+2 ; 0x17f0a 17f08: 4f c0 rjmp .+158 ; 0x17fa8 17f0a: 88 32 cpi r24, 0x28 ; 40 17f0c: 09 f4 brne .+2 ; 0x17f10 17f0e: 42 c0 rjmp .+132 ; 0x17f94 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 17f10: 82 e2 ldi r24, 0x22 ; 34 17f12: 95 e4 ldi r25, 0x45 ; 69 17f14: 0e 94 0a 75 call 0xea14 ; 0xea14 17f18: 6d e3 ldi r22, 0x3D ; 61 17f1a: 79 ee ldi r23, 0xE9 ; 233 17f1c: 0e 94 6d 72 call 0xe4da ; 0xe4da MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 17f20: 8f ec ldi r24, 0xCF ; 207 17f22: 94 e4 ldi r25, 0x44 ; 68 17f24: 0e 94 0a 75 call 0xea14 ; 0xea14 17f28: 6c ec ldi r22, 0xCC ; 204 17f2a: 71 ec ldi r23, 0xC1 ; 193 17f2c: 0e 94 c3 72 call 0xe586 ; 0xe586 //! 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) 17f30: 80 91 97 03 lds r24, 0x0397 ; 0x800397 17f34: 88 23 and r24, r24 17f36: 31 f0 breq .+12 ; 0x17f44 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 17f38: 68 ef ldi r22, 0xF8 ; 248 17f3a: 7f eb ldi r23, 0xBF ; 191 17f3c: 8b e3 ldi r24, 0x3B ; 59 17f3e: 93 e8 ldi r25, 0x83 ; 131 17f40: 0e 94 c3 72 call 0xe586 ; 0xe586 //! The SuperPINDA is detected when the PINDA temp is below its defined limit. //! This works well on the EINSY board but not on the miniRAMBo board as //! as a disconnected SuperPINDA will show higher temps compared to an EINSY board. //! //! 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); 17f44: 89 e2 ldi r24, 0x29 ; 41 17f46: 9d e0 ldi r25, 0x0D ; 13 17f48: 0f 94 9d a3 call 0x3473a ; 0x3473a 17f4c: 88 23 and r24, r24 17f4e: 09 f4 brne .+2 ; 0x17f52 17f50: 4b c0 rjmp .+150 ; 0x17fe8 17f52: 86 e4 ldi r24, 0x46 ; 70 17f54: 98 e4 ldi r25, 0x48 ; 72 17f56: 0e 94 0a 75 call 0xea14 ; 0xea14 17f5a: 22 e0 ldi r18, 0x02 ; 2 17f5c: 48 e2 ldi r20, 0x28 ; 40 17f5e: 56 ec ldi r21, 0xC6 ; 198 17f60: bc 01 movw r22, r24 17f62: 81 e0 ldi r24, 0x01 ; 1 17f64: 98 e6 ldi r25, 0x68 ; 104 17f66: 0e 94 2e 75 call 0xea5c ; 0xea5c #endif //PINDA_TEMP_COMP MENU_END(); 17f6a: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 17f6e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17f72: 8f 5f subi r24, 0xFF ; 255 17f74: 80 93 60 04 sts 0x0460, r24 ; 0x800460 17f78: 80 91 62 04 lds r24, 0x0462 ; 0x800462 17f7c: 8f 5f subi r24, 0xFF ; 255 17f7e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 17f82: a0 cf rjmp .-192 ; 0x17ec4 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 17f84: 8b e3 ldi r24, 0x3B ; 59 17f86: 98 e4 ldi r25, 0x48 ; 72 17f88: aa cf rjmp .-172 ; 0x17ede MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 17f8a: 80 35 cpi r24, 0x50 ; 80 17f8c: 19 f1 breq .+70 ; 0x17fd4 17f8e: 8f 3f cpi r24, 0xFF ; 255 17f90: 09 f0 breq .+2 ; 0x17f94 17f92: be cf rjmp .-132 ; 0x17f10 17f94: 88 ed ldi r24, 0xD8 ; 216 17f96: 94 e4 ldi r25, 0x44 ; 68 17f98: 0e 94 0a 75 call 0xea14 ; 0xea14 17f9c: 22 e0 ldi r18, 0x02 ; 2 17f9e: 4f ea ldi r20, 0xAF ; 175 17fa0: 5d eb ldi r21, 0xBD ; 189 17fa2: 62 e5 ldi r22, 0x52 ; 82 17fa4: 73 e8 ldi r23, 0x83 ; 131 17fa6: 09 c0 rjmp .+18 ; 0x17fba 17fa8: 88 ed ldi r24, 0xD8 ; 216 17faa: 94 e4 ldi r25, 0x44 ; 68 17fac: 0e 94 0a 75 call 0xea14 ; 0xea14 17fb0: 22 e0 ldi r18, 0x02 ; 2 17fb2: 4f ea ldi r20, 0xAF ; 175 17fb4: 5d eb ldi r21, 0xBD ; 189 17fb6: 67 e5 ldi r22, 0x57 ; 87 17fb8: 73 e8 ldi r23, 0x83 ; 131 17fba: 0e 94 2e 75 call 0xea5c ; 0xea5c 17fbe: a8 cf rjmp .-176 ; 0x17f10 17fc0: 88 ed ldi r24, 0xD8 ; 216 17fc2: 94 e4 ldi r25, 0x44 ; 68 17fc4: 0e 94 0a 75 call 0xea14 ; 0xea14 17fc8: 22 e0 ldi r18, 0x02 ; 2 17fca: 4f ea ldi r20, 0xAF ; 175 17fcc: 5d eb ldi r21, 0xBD ; 189 17fce: 6d e4 ldi r22, 0x4D ; 77 17fd0: 73 e8 ldi r23, 0x83 ; 131 17fd2: f3 cf rjmp .-26 ; 0x17fba 17fd4: 88 ed ldi r24, 0xD8 ; 216 17fd6: 94 e4 ldi r25, 0x44 ; 68 17fd8: 0e 94 0a 75 call 0xea14 ; 0xea14 17fdc: 22 e0 ldi r18, 0x02 ; 2 17fde: 4f ea ldi r20, 0xAF ; 175 17fe0: 5d eb ldi r21, 0xBD ; 189 17fe2: 68 e4 ldi r22, 0x48 ; 72 17fe4: 73 e8 ldi r23, 0x83 ; 131 17fe6: e9 cf rjmp .-46 ; 0x17fba //! The SuperPINDA is detected when the PINDA temp is below its defined limit. //! This works well on the EINSY board but not on the miniRAMBo board as //! as a disconnected SuperPINDA will show higher temps compared to an EINSY board. //! //! 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); 17fe8: 8c e4 ldi r24, 0x4C ; 76 17fea: 98 e4 ldi r25, 0x48 ; 72 17fec: b4 cf rjmp .-152 ; 0x17f56 #endif //PINDA_TEMP_COMP MENU_END(); } 17fee: 08 95 ret 00017ff0 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 17ff0: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 17ff4: 10 92 60 04 sts 0x0460, r1 ; 0x800460 17ff8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17ffc: 84 30 cpi r24, 0x04 ; 4 17ffe: a8 f4 brcc .+42 ; 0x1802a 18000: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_BACK)); 18004: 85 e9 ldi r24, 0x95 ; 149 18006: 9a e4 ldi r25, 0x4A ; 74 18008: 0e 94 0a 75 call 0xea14 ; 0xea14 1800c: 0e 94 9e 72 call 0xe53c ; 0xe53c #endif // DEBUG_PULLUP_CRASH #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(); 18010: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 18014: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18018: 8f 5f subi r24, 0xFF ; 255 1801a: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1801e: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18022: 8f 5f subi r24, 0xFF ; 255 18024: 80 93 62 04 sts 0x0462, r24 ; 0x800462 18028: e7 cf rjmp .-50 ; 0x17ff8 #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(); } 1802a: 08 95 ret 0001802c : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1802c: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1802e: 81 e5 ldi r24, 0x51 ; 81 18030: 98 e4 ldi r25, 0x48 ; 72 18032: 0e 94 0a 75 call 0xea14 ; 0xea14 18036: ac 01 movw r20, r24 18038: 60 e0 ldi r22, 0x00 ; 0 1803a: 80 e0 ldi r24, 0x00 ; 0 1803c: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_putc_at(0, 1, '\n'); 18040: 4a e0 ldi r20, 0x0A ; 10 18042: 61 e0 ldi r22, 0x01 ; 1 18044: 80 e0 ldi r24, 0x00 ; 0 18046: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 MENU_BEGIN(); 1804a: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 1804e: 10 92 60 04 sts 0x0460, r1 ; 0x800460 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 18052: 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(); 18054: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18058: 84 30 cpi r24, 0x04 ; 4 1805a: 18 f5 brcc .+70 ; 0x180a2 1805c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 18060: 81 11 cpse r24, r1 18062: 02 c0 rjmp .+4 ; 0x18068 18064: c0 93 60 04 sts 0x0460, r28 ; 0x800460 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 18068: 8c e4 ldi r24, 0x4C ; 76 1806a: 98 e4 ldi r25, 0x48 ; 72 1806c: 0e 94 0a 75 call 0xea14 ; 0xea14 18070: 66 e2 ldi r22, 0x26 ; 38 18072: 78 e3 ldi r23, 0x38 ; 56 18074: 0e 94 6d 72 call 0xe4da ; 0xe4da MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 18078: 86 e4 ldi r24, 0x46 ; 70 1807a: 98 e4 ldi r25, 0x48 ; 72 1807c: 0e 94 0a 75 call 0xea14 ; 0xea14 18080: 63 e3 ldi r22, 0x33 ; 51 18082: 7d ed ldi r23, 0xDD ; 221 18084: 0e 94 6d 72 call 0xe4da ; 0xe4da MENU_END(); 18088: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1808c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18090: 8f 5f subi r24, 0xFF ; 255 18092: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18096: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1809a: 8f 5f subi r24, 0xFF ; 255 1809c: 80 93 62 04 sts 0x0462, r24 ; 0x800462 180a0: d9 cf rjmp .-78 ; 0x18054 // 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(); } 180a2: cf 91 pop r28 180a4: 08 95 ret 000180a6 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 180a6: cf 93 push r28 180a8: df 93 push r29 MENU_BEGIN(); 180aa: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 180ae: 10 92 60 04 sts 0x0460, r1 ; 0x800460 180b2: 80 91 60 04 lds r24, 0x0460 ; 0x800460 180b6: 84 30 cpi r24, 0x04 ; 4 180b8: 08 f0 brcs .+2 ; 0x180bc 180ba: bd c0 rjmp .+378 ; 0x18236 180bc: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_BACK)); 180c0: 85 e9 ldi r24, 0x95 ; 149 180c2: 9a e4 ldi r25, 0x4A ; 74 180c4: 0e 94 0a 75 call 0xea14 ; 0xea14 180c8: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 180cc: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 180d0: 88 23 and r24, r24 180d2: 09 f4 brne .+2 ; 0x180d6 180d4: 4e c0 rjmp .+156 ; 0x18172 180d6: 8a e9 ldi r24, 0x9A ; 154 180d8: 92 e6 ldi r25, 0x62 ; 98 180da: 0e 94 0a 75 call 0xea14 ; 0xea14 180de: ec 01 movw r28, r24 180e0: 81 ee ldi r24, 0xE1 ; 225 180e2: 97 e4 ldi r25, 0x47 ; 71 180e4: 0e 94 0a 75 call 0xea14 ; 0xea14 180e8: 22 e0 ldi r18, 0x02 ; 2 180ea: 45 e5 ldi r20, 0x55 ; 85 180ec: 5e eb ldi r21, 0xBE ; 190 180ee: be 01 movw r22, r28 180f0: 0e 94 2e 75 call 0xea5c ; 0xea5c 180f4: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 if (fsensor.isEnabled()) { 180f8: 88 23 and r24, r24 180fa: 09 f4 brne .+2 ; 0x180fe 180fc: 8c c0 rjmp .+280 ; 0x18216 if (fsensor.isError()) { 180fe: 83 30 cpi r24, 0x03 ; 3 18100: d9 f5 brne .+118 ; 0x18178 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 18102: 80 e2 ldi r24, 0x20 ; 32 18104: 98 e4 ldi r25, 0x48 ; 72 18106: 0e 94 0a 75 call 0xea14 ; 0xea14 1810a: ec 01 movw r28, r24 1810c: 8d e4 ldi r24, 0x4D ; 77 1810e: 94 e4 ldi r25, 0x44 ; 68 18110: 0e 94 0a 75 call 0xea14 ; 0xea14 18114: 22 e0 ldi r18, 0x02 ; 2 18116: 4f eb ldi r20, 0xBF ; 191 18118: 5c eb ldi r21, 0xBC ; 188 1811a: be 01 movw r22, r28 1811c: 0e 94 2e 75 call 0xea5c ; 0xea5c MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 18120: 80 e2 ldi r24, 0x20 ; 32 18122: 98 e4 ldi r25, 0x48 ; 72 18124: 0e 94 0a 75 call 0xea14 ; 0xea14 18128: ec 01 movw r28, r24 1812a: 8f e3 ldi r24, 0x3F ; 63 1812c: 94 e4 ldi r25, 0x44 ; 68 1812e: 0e 94 0a 75 call 0xea14 ; 0xea14 18132: 22 e0 ldi r18, 0x02 ; 2 18134: 4f eb ldi r20, 0xBF ; 191 18136: 5c eb ldi r21, 0xBC ; 188 18138: be 01 movw r22, r28 1813a: 0e 94 2e 75 call 0xea5c ; 0xea5c #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); 1813e: 80 e2 ldi r24, 0x20 ; 32 18140: 98 e4 ldi r25, 0x48 ; 72 18142: 0e 94 0a 75 call 0xea14 ; 0xea14 18146: ec 01 movw r28, r24 18148: 8f e2 ldi r24, 0x2F ; 47 1814a: 94 e4 ldi r25, 0x44 ; 68 1814c: 0e 94 0a 75 call 0xea14 ; 0xea14 18150: 22 e0 ldi r18, 0x02 ; 2 18152: 4f eb ldi r20, 0xBF ; 191 18154: 5c eb ldi r21, 0xBC ; 188 } 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); 18156: be 01 movw r22, r28 18158: 0e 94 2e 75 call 0xea5c ; 0xea5c #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 1815c: 80 91 f9 16 lds r24, 0x16F9 ; 0x8016f9 18160: 88 23 and r24, r24 18162: 09 f4 brne .+2 ; 0x18166 18164: 49 c0 rjmp .+146 ; 0x181f8 18166: 81 30 cpi r24, 0x01 ; 1 18168: 09 f4 brne .+2 ; 0x1816c 1816a: 62 c0 rjmp .+196 ; 0x18230 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(); 1816c: 0e 94 50 bd call 0x17aa0 ; 0x17aa0 18170: 52 c0 rjmp .+164 ; 0x18216 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); 18172: 84 e9 ldi r24, 0x94 ; 148 18174: 92 e6 ldi r25, 0x62 ; 98 18176: b1 cf rjmp .-158 ; 0x180da #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); 18178: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 1817c: 88 23 and r24, r24 1817e: 99 f1 breq .+102 ; 0x181e6 18180: 8a e9 ldi r24, 0x9A ; 154 18182: 92 e6 ldi r25, 0x62 ; 98 18184: 0e 94 0a 75 call 0xea14 ; 0xea14 18188: ec 01 movw r28, r24 1818a: 8d e4 ldi r24, 0x4D ; 77 1818c: 94 e4 ldi r25, 0x44 ; 68 1818e: 0e 94 0a 75 call 0xea14 ; 0xea14 18192: 22 e0 ldi r18, 0x02 ; 2 18194: 46 e6 ldi r20, 0x66 ; 102 18196: 5d eb ldi r21, 0xBD ; 189 18198: be 01 movw r22, r28 1819a: 0e 94 2e 75 call 0xea5c ; 0xea5c MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1819e: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 181a2: 88 23 and r24, r24 181a4: 19 f1 breq .+70 ; 0x181ec 181a6: 8a e9 ldi r24, 0x9A ; 154 181a8: 92 e6 ldi r25, 0x62 ; 98 181aa: 0e 94 0a 75 call 0xea14 ; 0xea14 181ae: ec 01 movw r28, r24 181b0: 8f e3 ldi r24, 0x3F ; 63 181b2: 94 e4 ldi r25, 0x44 ; 68 181b4: 0e 94 0a 75 call 0xea14 ; 0xea14 181b8: 22 e0 ldi r18, 0x02 ; 2 181ba: 4c e5 ldi r20, 0x5C ; 92 181bc: 5d eb ldi r21, 0xBD ; 189 181be: be 01 movw r22, r28 181c0: 0e 94 2e 75 call 0xea5c ; 0xea5c #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); 181c4: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 181c8: 88 23 and r24, r24 181ca: 99 f0 breq .+38 ; 0x181f2 181cc: 8a e9 ldi r24, 0x9A ; 154 181ce: 92 e6 ldi r25, 0x62 ; 98 181d0: 0e 94 0a 75 call 0xea14 ; 0xea14 181d4: ec 01 movw r28, r24 181d6: 8f e2 ldi r24, 0x2F ; 47 181d8: 94 e4 ldi r25, 0x44 ; 68 181da: 0e 94 0a 75 call 0xea14 ; 0xea14 181de: 22 e0 ldi r18, 0x02 ; 2 181e0: 4c e5 ldi r20, 0x5C ; 92 181e2: 5e eb ldi r21, 0xBE ; 190 181e4: b8 cf rjmp .-144 ; 0x18156 #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); 181e6: 84 e9 ldi r24, 0x94 ; 148 181e8: 92 e6 ldi r25, 0x62 ; 98 181ea: cc cf rjmp .-104 ; 0x18184 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 181ec: 84 e9 ldi r24, 0x94 ; 148 181ee: 92 e6 ldi r25, 0x62 ; 98 181f0: dc cf rjmp .-72 ; 0x181aa #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); 181f2: 84 e9 ldi r24, 0x94 ; 148 181f4: 92 e6 ldi r25, 0x62 ; 98 181f6: ec cf rjmp .-40 ; 0x181d0 #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); 181f8: 87 e2 ldi r24, 0x27 ; 39 181fa: 94 e4 ldi r25, 0x44 ; 68 break; case Filament_sensor::SensorActionOnError::_Pause: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_PAUSE), lcd_fsensor_actionNA_set); 181fc: 0e 94 0a 75 call 0xea14 ; 0xea14 18200: ec 01 movw r28, r24 18202: 8b e1 ldi r24, 0x1B ; 27 18204: 94 e4 ldi r25, 0x44 ; 68 18206: 0e 94 0a 75 call 0xea14 ; 0xea14 1820a: 22 e0 ldi r18, 0x02 ; 2 1820c: 40 e5 ldi r20, 0x50 ; 80 1820e: 5d eb ldi r21, 0xBD ; 189 18210: be 01 movw r22, r28 18212: 0e 94 2e 75 call 0xea5c ; 0xea5c default: lcd_fsensor_actionNA_set(); } } MENU_END(); 18216: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1821a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1821e: 8f 5f subi r24, 0xFF ; 255 18220: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18224: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18228: 8f 5f subi r24, 0xFF ; 255 1822a: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1822e: 41 cf rjmp .-382 ; 0x180b2 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); 18230: 83 e1 ldi r24, 0x13 ; 19 18232: 94 e4 ldi r25, 0x44 ; 68 18234: e3 cf rjmp .-58 ; 0x181fc lcd_fsensor_actionNA_set(); } } MENU_END(); } 18236: df 91 pop r29 18238: cf 91 pop r28 1823a: 08 95 ret 0001823c : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1823c: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 18240: 10 92 60 04 sts 0x0460, r1 ; 0x800460 18244: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18248: 84 30 cpi r24, 0x04 ; 4 1824a: 08 f0 brcs .+2 ; 0x1824e 1824c: 3f c0 rjmp .+126 ; 0x182cc 1824e: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 18252: 89 e8 ldi r24, 0x89 ; 137 18254: 96 e4 ldi r25, 0x46 ; 70 18256: 0e 94 0a 75 call 0xea14 ; 0xea14 1825a: 0e 94 9e 72 call 0xe53c ; 0xe53c if(eeprom_is_sheet_initialized(selected_sheet)){ 1825e: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 18262: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 18266: 88 23 and r24, r24 18268: 41 f0 breq .+16 ; 0x1827a MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1826a: 80 e8 ldi r24, 0x80 ; 128 1826c: 96 e4 ldi r25, 0x46 ; 70 1826e: 0e 94 0a 75 call 0xea14 ; 0xea14 18272: 69 ec ldi r22, 0xC9 ; 201 18274: 7d ec ldi r23, 0xCD ; 205 18276: 0e 94 c3 72 call 0xe586 ; 0xe586 } if (lcd_commands_type == LcdCommands::Idle) 1827a: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1827e: 81 11 cpse r24, r1 18280: 08 c0 rjmp .+16 ; 0x18292 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 18282: 8d e6 ldi r24, 0x6D ; 109 18284: 96 e4 ldi r25, 0x46 ; 70 18286: 0e 94 0a 75 call 0xea14 ; 0xea14 1828a: 67 e4 ldi r22, 0x47 ; 71 1828c: 77 ed ldi r23, 0xD7 ; 215 1828e: 0e 94 c3 72 call 0xe586 ; 0xe586 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 18292: 84 e6 ldi r24, 0x64 ; 100 18294: 96 e4 ldi r25, 0x46 ; 70 18296: 0e 94 0a 75 call 0xea14 ; 0xea14 1829a: 6d ef ldi r22, 0xFD ; 253 1829c: 73 ec ldi r23, 0xC3 ; 195 1829e: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 182a2: 8c e5 ldi r24, 0x5C ; 92 182a4: 96 e4 ldi r25, 0x46 ; 70 182a6: 0e 94 0a 75 call 0xea14 ; 0xea14 182aa: 68 ef ldi r22, 0xF8 ; 248 182ac: 74 ed ldi r23, 0xD4 ; 212 182ae: 0e 94 6d 72 call 0xe4da ; 0xe4da MENU_END(); 182b2: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 182b6: 80 91 60 04 lds r24, 0x0460 ; 0x800460 182ba: 8f 5f subi r24, 0xFF ; 255 182bc: 80 93 60 04 sts 0x0460, r24 ; 0x800460 182c0: 80 91 62 04 lds r24, 0x0462 ; 0x800462 182c4: 8f 5f subi r24, 0xFF ; 255 182c6: 80 93 62 04 sts 0x0462, r24 ; 0x800462 182ca: bc cf rjmp .-136 ; 0x18244 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 182cc: 08 95 ret 000182ce ()>: } template static void select_sheet_menu() { selected_sheet = number; 182ce: 87 e0 ldi r24, 0x07 ; 7 182d0: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182d4: 0c 94 1e c1 jmp 0x1823c ; 0x1823c 000182d8 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182d8: 86 e0 ldi r24, 0x06 ; 6 182da: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182de: 0c 94 1e c1 jmp 0x1823c ; 0x1823c 000182e2 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182e2: 85 e0 ldi r24, 0x05 ; 5 182e4: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182e8: 0c 94 1e c1 jmp 0x1823c ; 0x1823c 000182ec ()>: } template static void select_sheet_menu() { selected_sheet = number; 182ec: 84 e0 ldi r24, 0x04 ; 4 182ee: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182f2: 0c 94 1e c1 jmp 0x1823c ; 0x1823c 000182f6 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182f6: 83 e0 ldi r24, 0x03 ; 3 182f8: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182fc: 0c 94 1e c1 jmp 0x1823c ; 0x1823c 00018300 ()>: } template static void select_sheet_menu() { selected_sheet = number; 18300: 82 e0 ldi r24, 0x02 ; 2 18302: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 18306: 0c 94 1e c1 jmp 0x1823c ; 0x1823c 0001830a ()>: } template static void select_sheet_menu() { selected_sheet = number; 1830a: 81 e0 ldi r24, 0x01 ; 1 1830c: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 18310: 0c 94 1e c1 jmp 0x1823c ; 0x1823c 00018314 ()>: } template static void select_sheet_menu() { selected_sheet = number; 18314: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca lcd_sheet_menu(); 18318: 0c 94 1e c1 jmp 0x1823c ; 0x1823c 0001831c : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1831c: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 18320: 10 92 60 04 sts 0x0460, r1 ; 0x800460 18324: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18328: 84 30 cpi r24, 0x04 ; 4 1832a: a8 f5 brcc .+106 ; 0x18396 1832c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 18330: 8b e3 ldi r24, 0x3B ; 59 18332: 98 e4 ldi r25, 0x48 ; 72 18334: 0e 94 0a 75 call 0xea14 ; 0xea14 18338: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1833c: 89 e6 ldi r24, 0x69 ; 105 1833e: 9c e3 ldi r25, 0x3C ; 60 18340: 0e 94 0a 75 call 0xea14 ; 0xea14 18344: 6a e4 ldi r22, 0x4A ; 74 18346: 76 ec ldi r23, 0xC6 ; 198 18348: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1834c: 80 e6 ldi r24, 0x60 ; 96 1834e: 9c e3 ldi r25, 0x3C ; 60 18350: 0e 94 0a 75 call 0xea14 ; 0xea14 18354: 63 e5 ldi r22, 0x53 ; 83 18356: 76 ec ldi r23, 0xC6 ; 198 18358: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1835c: 87 e5 ldi r24, 0x57 ; 87 1835e: 9c e3 ldi r25, 0x3C ; 60 18360: 0e 94 0a 75 call 0xea14 ; 0xea14 18364: 61 e4 ldi r22, 0x41 ; 65 18366: 76 ec ldi r23, 0xC6 ; 198 18368: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1836c: 8c e4 ldi r24, 0x4C ; 76 1836e: 9c e3 ldi r25, 0x3C ; 60 18370: 0e 94 0a 75 call 0xea14 ; 0xea14 18374: 69 eb ldi r22, 0xB9 ; 185 18376: 7c ec ldi r23, 0xCC ; 204 18378: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_END(); 1837c: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 18380: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18384: 8f 5f subi r24, 0xFF ; 255 18386: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1838a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1838e: 8f 5f subi r24, 0xFF ; 255 18390: 80 93 62 04 sts 0x0462, r24 ; 0x800462 18394: c7 cf rjmp .-114 ; 0x18324 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(); } 18396: 08 95 ret 00018398 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 18398: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 1839c: 10 92 60 04 sts 0x0460, r1 ; 0x800460 183a0: 80 91 60 04 lds r24, 0x0460 ; 0x800460 183a4: 84 30 cpi r24, 0x04 ; 4 183a6: d8 f5 brcc .+118 ; 0x1841e 183a8: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 183ac: 82 e3 ldi r24, 0x32 ; 50 183ae: 95 e4 ldi r25, 0x45 ; 69 183b0: 0e 94 0a 75 call 0xea14 ; 0xea14 183b4: 0e 94 9e 72 call 0xe53c ; 0xe53c settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 183b8: 89 e8 ldi r24, 0x89 ; 137 183ba: 94 e4 ldi r25, 0x44 ; 68 183bc: 0e 94 0a 75 call 0xea14 ; 0xea14 183c0: 46 e4 ldi r20, 0x46 ; 70 183c2: 5d eb ldi r21, 0xBD ; 189 183c4: bc 01 movw r22, r24 183c6: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed 183ca: 0e 94 c2 be call 0x17d84 ; 0x17d84 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 183ce: 81 e8 ldi r24, 0x81 ; 129 183d0: 94 e4 ldi r25, 0x44 ; 68 183d2: 0e 94 0a 75 call 0xea14 ; 0xea14 183d6: 4c e3 ldi r20, 0x3C ; 60 183d8: 5d eb ldi r21, 0xBD ; 189 183da: bc 01 movw r22, r24 183dc: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea 183e0: 0e 94 c2 be call 0x17d84 ; 0x17d84 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 183e4: 42 e3 ldi r20, 0x32 ; 50 183e6: 5d eb ldi r21, 0xBD ; 189 183e8: 68 ef ldi r22, 0xF8 ; 248 183ea: 77 e6 ldi r23, 0x67 ; 103 183ec: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 183f0: 0e 94 c2 be call 0x17d84 ; 0x17d84 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 183f4: 48 e2 ldi r20, 0x28 ; 40 183f6: 5d eb ldi r21, 0xBD ; 189 183f8: 6f ee ldi r22, 0xEF ; 239 183fa: 79 e6 ldi r23, 0x69 ; 105 183fc: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee 18400: 0e 94 c2 be call 0x17d84 ; 0x17d84 MENU_END(); 18404: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 18408: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1840c: 8f 5f subi r24, 0xFF ; 255 1840e: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18412: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18416: 8f 5f subi r24, 0xFF ; 255 18418: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1841c: c1 cf rjmp .-126 ; 0x183a0 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(); } 1841e: 08 95 ret 00018420 : ++str; } return str; } bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 18420: cf 92 push r12 18422: df 92 push r13 18424: ef 92 push r14 18426: ff 92 push r15 18428: 0f 93 push r16 1842a: 1f 93 push r17 1842c: cf 93 push r28 1842e: df 93 push r29 18430: 6c 01 movw r12, r24 18432: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 18434: c4 2f mov r28, r20 18436: d0 e0 ldi r29, 0x00 ; 0 18438: ae 01 movw r20, r28 1843a: 0f 94 7c a1 call 0x342f8 ; 0x342f8 1843e: 89 2b or r24, r25 18440: b9 f4 brne .+46 ; 0x18470 Number(str + tagSize, v); 18442: b8 01 movw r22, r16 18444: c6 01 movw r24, r12 18446: 8c 0f add r24, r28 18448: 9d 1f adc r25, r29 1844a: 0e 94 c0 bb call 0x17780 ; 0x17780 *v |= tagMask; 1844e: f8 01 movw r30, r16 18450: 20 81 ld r18, Z 18452: 31 81 ldd r19, Z+1 ; 0x01 18454: 2e 29 or r18, r14 18456: 3f 29 or r19, r15 18458: 31 83 std Z+1, r19 ; 0x01 1845a: 20 83 st Z, r18 return true; 1845c: 81 e0 ldi r24, 0x01 ; 1 } return false; } 1845e: df 91 pop r29 18460: cf 91 pop r28 18462: 1f 91 pop r17 18464: 0f 91 pop r16 18466: ff 90 pop r15 18468: ef 90 pop r14 1846a: df 90 pop r13 1846c: cf 90 pop r12 1846e: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 18470: 80 e0 ldi r24, 0x00 ; 0 18472: f5 cf rjmp .-22 ; 0x1845e 00018474 : } } #if (LANG_MODE != 0) void lcd_language() { 18474: cf 93 push r28 18476: df 93 push r29 lcd_update_enable(true); 18478: 81 e0 ldi r24, 0x01 ; 1 1847a: 0e 94 08 70 call 0xe010 ; 0xe010 menu_goto(lcd_language_menu, 0, true, true); 1847e: 21 e0 ldi r18, 0x01 ; 1 18480: 41 e0 ldi r20, 0x01 ; 1 18482: 70 e0 ldi r23, 0x00 ; 0 18484: 60 e0 ldi r22, 0x00 ; 0 18486: 87 e0 ldi r24, 0x07 ; 7 18488: 97 ee ldi r25, 0xE7 ; 231 1848a: 0e 94 87 62 call 0xc50e ; 0xc50e 1848e: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 18492: c0 91 02 04 lds r28, 0x0402 ; 0x800402 18496: d0 91 03 04 lds r29, 0x0403 ; 0x800403 1849a: 0e 94 fe 73 call 0xe7fc ; 0xe7fc 1849e: c6 5d subi r28, 0xD6 ; 214 184a0: d7 43 sbci r29, 0x37 ; 55 184a2: 39 f0 breq .+14 ; 0x184b2 184a4: 81 11 cpse r24, r1 184a6: 07 c0 rjmp .+14 ; 0x184b6 { delay_keep_alive(50); 184a8: 82 e3 ldi r24, 0x32 ; 50 184aa: 90 e0 ldi r25, 0x00 ; 0 184ac: 0e 94 7f 8c call 0x118fe ; 0x118fe 184b0: f0 cf rjmp .-32 ; 0x18492 } if (lang_is_selected()) 184b2: 88 23 and r24, r24 184b4: 21 f0 breq .+8 ; 0x184be lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 184b6: df 91 pop r29 184b8: 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(); 184ba: 0d 94 6d 05 jmp 0x20ada ; 0x20ada else lang_select(LANG_ID_PRI); 184be: 80 e0 ldi r24, 0x00 ; 0 } 184c0: df 91 pop r29 184c2: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 184c4: 0c 94 9e 74 jmp 0xe93c ; 0xe93c 000184c8 : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 184c8: 61 e0 ldi r22, 0x01 ; 1 184ca: 83 e1 ldi r24, 0x13 ; 19 184cc: 93 e8 ldi r25, 0x83 ; 131 184ce: 0e 94 da 8c call 0x119b4 ; 0x119b4 lcd_return_to_status(); 184d2: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 000184d6 : } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 184d6: 61 e0 ldi r22, 0x01 ; 1 184d8: 87 e1 ldi r24, 0x17 ; 23 184da: 93 e8 ldi r25, 0x83 ; 131 184dc: 0e 94 da 8c call 0x119b4 ; 0x119b4 lcd_return_to_status(); 184e0: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 000184e4 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 184e4: 61 e0 ldi r22, 0x01 ; 1 184e6: 8f e0 ldi r24, 0x0F ; 15 184e8: 93 e8 ldi r25, 0x83 ; 131 184ea: 0e 94 da 8c call 0x119b4 ; 0x119b4 lcd_return_to_status(); 184ee: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 000184f2 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 184f2: 61 e0 ldi r22, 0x01 ; 1 184f4: 8d e1 ldi r24, 0x1D ; 29 184f6: 93 e8 ldi r25, 0x83 ; 131 184f8: 0e 94 da 8c call 0x119b4 ; 0x119b4 lcd_return_to_status(); 184fc: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 00018500 : 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()") { 18500: cf 93 push r28 18502: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 { //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); 18506: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 18508: 42 ed ldi r20, 0xD2 ; 210 1850a: 57 e6 ldi r21, 0x67 ; 103 1850c: 60 e0 ldi r22, 0x00 ; 0 1850e: 80 e0 ldi r24, 0x00 ; 0 18510: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(LCD_WIDTH - 14, 0); 18514: 60 e0 ldi r22, 0x00 ; 0 18516: 86 e0 ldi r24, 0x06 ; 6 18518: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print_state(pinda_state); 1851c: c4 fb bst r28, 4 1851e: 88 27 eor r24, r24 18520: 80 f9 bld r24, 0 18522: 0e 94 ed bc call 0x179da ; 0x179da if (MMU2::mmu2.Enabled()) { 18526: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1852a: 81 30 cpi r24, 0x01 ; 1 1852c: 99 f4 brne .+38 ; 0x18554 inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 1852e: c1 e0 ldi r28, 0x01 ; 1 18530: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 18534: 81 11 cpse r24, r1 18536: 01 c0 rjmp .+2 ; 0x1853a 18538: 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 1853a: 4c ec ldi r20, 0xCC ; 204 1853c: 57 e6 ldi r21, 0x67 ; 103 1853e: 60 e0 ldi r22, 0x00 ; 0 18540: 8a e0 ldi r24, 0x0A ; 10 18542: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(LCD_WIDTH - 3, 0); 18546: 60 e0 ldi r22, 0x00 ; 0 18548: 81 e1 ldi r24, 0x11 ; 17 1854a: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print_state(finda_state); 1854e: 8c 2f mov r24, r28 18550: 0e 94 ed bc call 0x179da ; 0x179da 18554: c1 e0 ldi r28, 0x01 ; 1 18556: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1855a: 81 11 cpse r24, r1 1855c: 01 c0 rjmp .+2 ; 0x18560 1855e: c0 e0 ldi r28, 0x00 ; 0 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 18560: 81 ee ldi r24, 0xE1 ; 225 18562: 97 e4 ldi r25, 0x47 ; 71 18564: 0e 94 0a 75 call 0xea14 ; 0xea14 18568: ac 01 movw r20, r24 1856a: 61 e0 ldi r22, 0x01 ; 1 1856c: 80 e0 ldi r24, 0x00 ; 0 1856e: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(LCD_WIDTH - 3, 1); 18572: 61 e0 ldi r22, 0x01 ; 1 18574: 81 e1 ldi r24, 0x11 ; 17 18576: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print_state(idler_state); 1857a: 8c 2f mov r24, r28 1857c: 0e 94 ed bc call 0x179da ; 0x179da // 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); 18580: 62 e0 ldi r22, 0x02 ; 2 18582: 80 e0 ldi r24, 0x00 ; 0 18584: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(_N("B: %3d Xd:%6d\n" 18588: 80 91 39 0e lds r24, 0x0E39 ; 0x800e39 1858c: 8f 93 push r24 1858e: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 18592: 8f 93 push r24 18594: 80 91 64 0d lds r24, 0x0D64 ; 0x800d64 18598: 1f 92 push r1 1859a: 8f 93 push r24 1859c: 80 91 8a 03 lds r24, 0x038A ; 0x80038a 185a0: 8f 93 push r24 185a2: 80 91 89 03 lds r24, 0x0389 ; 0x800389 185a6: 8f 93 push r24 185a8: 80 91 63 0d lds r24, 0x0D63 ; 0x800d63 185ac: 1f 92 push r1 185ae: 8f 93 push r24 185b0: 88 ea ldi r24, 0xA8 ; 168 185b2: 97 e6 ldi r25, 0x67 ; 103 185b4: 9f 93 push r25 185b6: 8f 93 push r24 185b8: 0e 94 db 6e call 0xddb6 ; 0xddb6 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(); 185bc: 8d b7 in r24, 0x3d ; 61 185be: 9e b7 in r25, 0x3e ; 62 185c0: 0a 96 adiw r24, 0x0a ; 10 185c2: 0f b6 in r0, 0x3f ; 63 185c4: f8 94 cli 185c6: 9e bf out 0x3e, r25 ; 62 185c8: 0f be out 0x3f, r0 ; 63 185ca: 8d bf out 0x3d, r24 ; 61 } 185cc: 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(); 185ce: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 000185d2 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 185d2: bf 92 push r11 185d4: cf 92 push r12 185d6: df 92 push r13 185d8: ef 92 push r14 185da: ff 92 push r15 185dc: 0f 93 push r16 185de: 1f 93 push r17 185e0: cf 93 push r28 185e2: df 93 push r29 185e4: c8 2f mov r28, r24 185e6: f6 2e mov r15, r22 185e8: e4 2e mov r14, r20 185ea: b2 2e mov r11, r18 185ec: 68 01 movw r12, r16 lcd_update_enable(false); 185ee: 80 e0 ldi r24, 0x00 ; 0 185f0: 0e 94 08 70 call 0xe010 ; 0xe010 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 185f4: dc e7 ldi r29, 0x7C ; 124 185f6: fe 14 cp r15, r14 185f8: 08 f0 brcs .+2 ; 0x185fc 185fa: dd e2 ldi r29, 0x2D ; 45 if (_clear) 185fc: bb 20 and r11, r11 185fe: 09 f1 breq .+66 ; 0x18642 lcd_clear(); 18600: 0e 94 f6 6f call 0xdfec ; 0xdfec else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 18604: c1 11 cpse r28, r1 18606: 20 c0 rjmp .+64 ; 0x18648 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 18608: 8d e6 ldi r24, 0x6D ; 109 1860a: 9d e5 ldi r25, 0x5D ; 93 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)); 1860c: 0e 94 0a 75 call 0xea14 ; 0xea14 18610: 0e 94 ed 6e call 0xddda ; 0xddda if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 18614: 88 ef ldi r24, 0xF8 ; 248 18616: 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 18618: 82 30 cpi r24, 0x02 ; 2 1861a: 78 f5 brcc .+94 ; 0x1867a || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1861c: 8b e1 ldi r24, 0x1B ; 27 1861e: 9a e4 ldi r25, 0x4A ; 74 18620: 0e 94 0a 75 call 0xea14 ; 0xea14 18624: 0e 94 ed 6e call 0xddda ; 0xddda 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)); 18628: 8a ef ldi r24, 0xFA ; 250 1862a: 99 e4 ldi r25, 0x49 ; 73 1862c: cc 30 cpi r28, 0x0C ; 12 1862e: 49 f1 breq .+82 ; 0x18682 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 18630: 88 ee ldi r24, 0xE8 ; 232 18632: 99 e4 ldi r25, 0x49 ; 73 18634: cd 30 cpi r28, 0x0D ; 13 18636: 29 f1 breq .+74 ; 0x18682 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 18638: ce 30 cpi r28, 0x0E ; 14 1863a: 39 f5 brne .+78 ; 0x1868a 1863c: 85 ed ldi r24, 0xD5 ; 213 1863e: 99 e4 ldi r25, 0x49 ; 73 18640: 20 c0 rjmp .+64 ; 0x18682 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 18642: 0e 94 ef 6f call 0xdfde ; 0xdfde 18646: de cf rjmp .-68 ; 0x18604 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 18648: c1 30 cpi r28, 0x01 ; 1 1864a: f1 f2 breq .-68 ; 0x18608 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1864c: c2 30 cpi r28, 0x02 ; 2 1864e: e1 f2 breq .-72 ; 0x18608 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 18650: 82 e7 ldi r24, 0x72 ; 114 18652: 9a e4 ldi r25, 0x4A ; 74 18654: c3 30 cpi r28, 0x03 ; 3 18656: d1 f2 breq .-76 ; 0x1860c if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 18658: 80 e6 ldi r24, 0x60 ; 96 1865a: 9a e4 ldi r25, 0x4A ; 74 1865c: c4 30 cpi r28, 0x04 ; 4 1865e: b1 f2 breq .-84 ; 0x1860c if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 18660: 8e e4 ldi r24, 0x4E ; 78 18662: 9a e4 ldi r25, 0x4A ; 74 18664: c5 30 cpi r28, 0x05 ; 5 18666: 91 f2 breq .-92 ; 0x1860c if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 18668: 8c e3 ldi r24, 0x3C ; 60 1866a: 9a e4 ldi r25, 0x4A ; 74 1866c: c6 30 cpi r28, 0x06 ; 6 1866e: 71 f2 breq .-100 ; 0x1860c if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 18670: c7 30 cpi r28, 0x07 ; 7 18672: 81 f6 brne .-96 ; 0x18614 18674: 8d e2 ldi r24, 0x2D ; 45 18676: 9a e4 ldi r25, 0x4A ; 74 18678: c9 cf rjmp .-110 ; 0x1860c 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)); 1867a: ca 30 cpi r28, 0x0A ; 10 1867c: 99 f5 brne .+102 ; 0x186e4 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1867e: 88 e0 ldi r24, 0x08 ; 8 18680: 9a e4 ldi r25, 0x4A ; 74 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)); 18682: 0e 94 0a 75 call 0xea14 ; 0xea14 18686: 0e 94 ed 6e call 0xddda ; 0xddda lcd_puts_at_P(0, 1, STR_SEPARATOR); 1868a: 4f ed ldi r20, 0xDF ; 223 1868c: 53 e8 ldi r21, 0x83 ; 131 1868e: 61 e0 ldi r22, 0x01 ; 1 18690: 80 e0 ldi r24, 0x00 ; 0 18692: 0e 94 d7 6f call 0xdfae ; 0xdfae if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 18696: c3 30 cpi r28, 0x03 ; 3 18698: 70 f5 brcc .+92 ; 0x186f6 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1869a: 87 ec ldi r24, 0xC7 ; 199 1869c: 99 e4 ldi r25, 0x49 ; 73 1869e: 0e 94 0a 75 call 0xea14 ; 0xea14 186a2: ac 01 movw r20, r24 186a4: 62 e0 ldi r22, 0x02 ; 2 186a6: 80 e0 ldi r24, 0x00 ; 0 186a8: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(18, 2); 186ac: 62 e0 ldi r22, 0x02 ; 2 186ae: 82 e1 ldi r24, 0x12 ; 18 186b0: 0e 94 2a 6f call 0xde54 ; 0xde54 (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 186b4: c1 11 cpse r28, r1 186b6: 1a c0 rjmp .+52 ; 0x186ec 186b8: 8d 2f mov r24, r29 186ba: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 186be: 8a eb ldi r24, 0xBA ; 186 186c0: 99 e4 ldi r25, 0x49 ; 73 186c2: 0e 94 0a 75 call 0xea14 ; 0xea14 186c6: ac 01 movw r20, r24 186c8: 63 e0 ldi r22, 0x03 ; 3 186ca: 80 e0 ldi r24, 0x00 ; 0 186cc: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(18, 3); 186d0: 63 e0 ldi r22, 0x03 ; 3 186d2: 82 e1 ldi r24, 0x12 ; 18 186d4: 0e 94 2a 6f call 0xde54 ; 0xde54 (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 186d8: c2 30 cpi r28, 0x02 ; 2 186da: 19 f1 breq .+70 ; 0x18722 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); 186dc: 8d 2f mov r24, r29 186de: 0e 94 f1 6e call 0xdde2 ; 0xdde2 186e2: 23 c0 rjmp .+70 ; 0x1872a 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)); 186e4: cb 30 cpi r28, 0x0B ; 11 186e6: 09 f0 breq .+2 ; 0x186ea 186e8: 9f cf rjmp .-194 ; 0x18628 186ea: c9 cf rjmp .-110 ; 0x1867e 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); 186ec: 8e e8 ldi r24, 0x8E ; 142 186ee: 98 e6 ldi r25, 0x68 ; 104 186f0: 0e 94 ed 6e call 0xddda ; 0xddda 186f4: e4 cf rjmp .-56 ; 0x186be 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) 186f6: 86 ef ldi r24, 0xF6 ; 246 186f8: 8c 0f add r24, r28 186fa: 82 30 cpi r24, 0x02 ; 2 186fc: a8 f5 brcc .+106 ; 0x18768 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 186fe: 88 ea ldi r24, 0xA8 ; 168 18700: 99 e4 ldi r25, 0x49 ; 73 18702: 0e 94 0a 75 call 0xea14 ; 0xea14 18706: ac 01 movw r20, r24 18708: 62 e0 ldi r22, 0x02 ; 2 1870a: 80 e0 ldi r24, 0x00 ; 0 1870c: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_putc(':'); 18710: 8a e3 ldi r24, 0x3A ; 58 18712: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_set_cursor(18, 2); 18716: 62 e0 ldi r22, 0x02 ; 2 18718: 82 e1 ldi r24, 0x12 ; 18 1871a: 0e 94 2a 6f call 0xde54 ; 0xde54 (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1871e: ca 30 cpi r28, 0x0A ; 10 18720: e9 f2 breq .-70 ; 0x186dc 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); 18722: 8e e8 ldi r24, 0x8E ; 142 18724: 98 e6 ldi r25, 0x68 ; 104 18726: 0e 94 ed 6e call 0xddda ; 0xddda _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); 1872a: c1 14 cp r12, r1 1872c: d1 04 cpc r13, r1 1872e: 19 f0 breq .+6 ; 0x18736 18730: c6 01 movw r24, r12 18732: 0e 94 7f 8c call 0x118fe ; 0x118fe _progress++; 18736: 81 e0 ldi r24, 0x01 ; 1 18738: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1873a: 48 2f mov r20, r24 1873c: 50 e0 ldi r21, 0x00 ; 0 1873e: 92 e0 ldi r25, 0x02 ; 2 18740: 24 e0 ldi r18, 0x04 ; 4 18742: 30 e0 ldi r19, 0x00 ; 0 18744: e9 16 cp r14, r25 18746: 11 f0 breq .+4 ; 0x1874c 18748: 26 e0 ldi r18, 0x06 ; 6 1874a: 30 e0 ldi r19, 0x00 ; 0 1874c: 42 17 cp r20, r18 1874e: 53 07 cpc r21, r19 18750: 0c f0 brlt .+2 ; 0x18754 18752: 80 e0 ldi r24, 0x00 ; 0 } 18754: df 91 pop r29 18756: cf 91 pop r28 18758: 1f 91 pop r17 1875a: 0f 91 pop r16 1875c: ff 90 pop r15 1875e: ef 90 pop r14 18760: df 90 pop r13 18762: cf 90 pop r12 18764: bf 90 pop r11 18766: 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) 18768: ca 30 cpi r28, 0x0A ; 10 1876a: f8 f6 brcc .-66 ; 0x1872a { //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); 1876c: 41 e0 ldi r20, 0x01 ; 1 1876e: c4 30 cpi r28, 0x04 ; 4 18770: 21 f0 breq .+8 ; 0x1877a 18772: 42 e0 ldi r20, 0x02 ; 2 18774: c3 30 cpi r28, 0x03 ; 3 18776: 09 f4 brne .+2 ; 0x1877a 18778: 40 e0 ldi r20, 0x00 ; 0 1877a: 0d 2f mov r16, r29 1877c: 2d ed ldi r18, 0xDD ; 221 1877e: 33 e8 ldi r19, 0x83 ; 131 18780: 62 e0 ldi r22, 0x02 ; 2 18782: 82 e0 ldi r24, 0x02 ; 2 18784: 0e 94 c1 bc call 0x17982 ; 0x17982 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 18788: 41 e0 ldi r20, 0x01 ; 1 1878a: c5 30 cpi r28, 0x05 ; 5 1878c: 21 f0 breq .+8 ; 0x18796 1878e: 42 e0 ldi r20, 0x02 ; 2 18790: c5 30 cpi r28, 0x05 ; 5 18792: 08 f4 brcc .+2 ; 0x18796 18794: 40 e0 ldi r20, 0x00 ; 0 18796: 0d 2f mov r16, r29 18798: 2b ed ldi r18, 0xDB ; 219 1879a: 33 e8 ldi r19, 0x83 ; 131 1879c: 68 e0 ldi r22, 0x08 ; 8 1879e: 82 e0 ldi r24, 0x02 ; 2 187a0: 0e 94 c1 bc call 0x17982 ; 0x17982 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 187a4: 41 e0 ldi r20, 0x01 ; 1 187a6: c6 30 cpi r28, 0x06 ; 6 187a8: 21 f0 breq .+8 ; 0x187b2 187aa: 42 e0 ldi r20, 0x02 ; 2 187ac: c6 30 cpi r28, 0x06 ; 6 187ae: 08 f4 brcc .+2 ; 0x187b2 187b0: 40 e0 ldi r20, 0x00 ; 0 187b2: 0d 2f mov r16, r29 187b4: 29 ed ldi r18, 0xD9 ; 217 187b6: 33 e8 ldi r19, 0x83 ; 131 187b8: 6e e0 ldi r22, 0x0E ; 14 187ba: 82 e0 ldi r24, 0x02 ; 2 187bc: 0e 94 c1 bc call 0x17982 ; 0x17982 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 187c0: 41 e0 ldi r20, 0x01 ; 1 187c2: c7 30 cpi r28, 0x07 ; 7 187c4: 21 f0 breq .+8 ; 0x187ce 187c6: 42 e0 ldi r20, 0x02 ; 2 187c8: c7 30 cpi r28, 0x07 ; 7 187ca: 08 f4 brcc .+2 ; 0x187ce 187cc: 40 e0 ldi r20, 0x00 ; 0 187ce: 0d 2f mov r16, r29 187d0: 25 ed ldi r18, 0xD5 ; 213 187d2: 33 e8 ldi r19, 0x83 ; 131 187d4: 60 e0 ldi r22, 0x00 ; 0 187d6: 83 e0 ldi r24, 0x03 ; 3 187d8: 0e 94 c1 bc call 0x17982 ; 0x17982 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 187dc: 41 e0 ldi r20, 0x01 ; 1 187de: c8 30 cpi r28, 0x08 ; 8 187e0: 21 f0 breq .+8 ; 0x187ea 187e2: 42 e0 ldi r20, 0x02 ; 2 187e4: c8 30 cpi r28, 0x08 ; 8 187e6: 08 f4 brcc .+2 ; 0x187ea 187e8: 40 e0 ldi r20, 0x00 ; 0 187ea: 0d 2f mov r16, r29 187ec: 2e ec ldi r18, 0xCE ; 206 187ee: 33 e8 ldi r19, 0x83 ; 131 187f0: 69 e0 ldi r22, 0x09 ; 9 187f2: 83 e0 ldi r24, 0x03 ; 3 187f4: 0e 94 c1 bc call 0x17982 ; 0x17982 187f8: 98 cf rjmp .-208 ; 0x1872a 000187fa : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 187fa: cf 93 push r28 187fc: 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) 187fe: 80 91 96 03 lds r24, 0x0396 ; 0x800396 18802: 81 11 cpse r24, r1 18804: 18 c0 rjmp .+48 ; 0x18836 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 18806: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 1880a: 8b e0 ldi r24, 0x0B ; 11 1880c: 68 9f mul r22, r24 1880e: b0 01 movw r22, r0 18810: 11 24 eor r1, r1 18812: 67 5b subi r22, 0xB7 ; 183 18814: 72 4f sbci r23, 0xF2 ; 242 18816: 47 e0 ldi r20, 0x07 ; 7 18818: 50 e0 ldi r21, 0x00 ; 0 1881a: 88 e9 ldi r24, 0x98 ; 152 1881c: 93 e0 ldi r25, 0x03 ; 3 1881e: 0f 94 8d a3 call 0x3471a ; 0x3471a lcd_encoder = menuData->name[0]; 18822: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18826: 90 e0 ldi r25, 0x00 ; 0 18828: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 1882c: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e menuData->initialized = true; 18830: 81 e0 ldi r24, 0x01 ; 1 18832: 80 93 96 03 sts 0x0396, r24 ; 0x800396 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 18836: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1883a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1883e: 80 97 sbiw r24, 0x20 ; 32 18840: 34 f4 brge .+12 ; 0x1884e 18842: 80 e2 ldi r24, 0x20 ; 32 18844: 90 e0 ldi r25, 0x00 ; 0 18846: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 1884a: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1884e: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 18852: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 18856: 8f 3f cpi r24, 0xFF ; 255 18858: 91 05 cpc r25, r1 1885a: 39 f0 breq .+14 ; 0x1886a 1885c: 34 f0 brlt .+12 ; 0x1886a 1885e: 8f ef ldi r24, 0xFF ; 255 18860: 90 e0 ldi r25, 0x00 ; 0 18862: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 18866: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e menuData->name[menuData->selected] = lcd_encoder; 1886a: e0 91 97 03 lds r30, 0x0397 ; 0x800397 1886e: f0 e0 ldi r31, 0x00 ; 0 18870: ea 56 subi r30, 0x6A ; 106 18872: fc 4f sbci r31, 0xFC ; 252 18874: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 18878: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1887a: 0e 94 ef 6f call 0xdfde ; 0xdfde 1887e: c8 e9 ldi r28, 0x98 ; 152 18880: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 18882: 89 91 ld r24, Y+ 18884: 0e 94 f1 6e call 0xdde2 ; 0xdde2 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) 18888: 83 e0 ldi r24, 0x03 ; 3 1888a: cf 39 cpi r28, 0x9F ; 159 1888c: d8 07 cpc r29, r24 1888e: c9 f7 brne .-14 ; 0x18882 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 18890: 4e e5 ldi r20, 0x5E ; 94 18892: 61 e0 ldi r22, 0x01 ; 1 18894: 80 91 97 03 lds r24, 0x0397 ; 0x800397 18898: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 if (menuData->selected > 0) 1889c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 188a0: 88 23 and r24, r24 188a2: 29 f0 breq .+10 ; 0x188ae { lcd_putc_at(menuData->selected-1, 1, ' '); 188a4: 40 e2 ldi r20, 0x20 ; 32 188a6: 61 e0 ldi r22, 0x01 ; 1 188a8: 81 50 subi r24, 0x01 ; 1 188aa: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 } if (lcd_clicked()) 188ae: 0e 94 45 73 call 0xe68a ; 0xe68a 188b2: 88 23 and r24, r24 188b4: 99 f0 breq .+38 ; 0x188dc { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 188b6: e0 91 97 03 lds r30, 0x0397 ; 0x800397 188ba: 8e 2f mov r24, r30 188bc: 90 e0 ldi r25, 0x00 ; 0 188be: 01 96 adiw r24, 0x01 ; 1 188c0: 07 97 sbiw r24, 0x07 ; 7 188c2: 78 f4 brcc .+30 ; 0x188e2 { lcd_encoder = menuData->name[++(menuData->selected)]; 188c4: ef 5f subi r30, 0xFF ; 255 188c6: e0 93 97 03 sts 0x0397, r30 ; 0x800397 188ca: f0 e0 ldi r31, 0x00 ; 0 188cc: ea 56 subi r30, 0x6A ; 106 188ce: fc 4f sbci r31, 0xFC ; 252 188d0: 82 81 ldd r24, Z+2 ; 0x02 188d2: 90 e0 ldi r25, 0x00 ; 0 188d4: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 188d8: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 188dc: df 91 pop r29 188de: cf 91 pop r28 188e0: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 188e2: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 188e6: 8b e0 ldi r24, 0x0B ; 11 188e8: 68 9f mul r22, r24 188ea: b0 01 movw r22, r0 188ec: 11 24 eor r1, r1 188ee: 67 5b subi r22, 0xB7 ; 183 188f0: 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); 188f2: 47 e0 ldi r20, 0x07 ; 7 188f4: 50 e0 ldi r21, 0x00 ; 0 188f6: 88 e9 ldi r24, 0x98 ; 152 188f8: 93 e0 ldi r25, 0x03 ; 3 188fa: 0f 94 b1 a3 call 0x34762 ; 0x34762 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 188fe: df 91 pop r29 18900: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 18902: 0c 94 eb 62 jmp 0xc5d6 ; 0xc5d6 00018906 : //! |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() { 18906: 2f 92 push r2 18908: 3f 92 push r3 1890a: 4f 92 push r4 1890c: 5f 92 push r5 1890e: 6f 92 push r6 18910: 7f 92 push r7 18912: 8f 92 push r8 18914: 9f 92 push r9 18916: af 92 push r10 18918: bf 92 push r11 1891a: cf 92 push r12 1891c: df 92 push r13 1891e: ef 92 push r14 18920: ff 92 push r15 18922: 0f 93 push r16 18924: 1f 93 push r17 18926: cf 93 push r28 18928: df 93 push r29 1892a: cd b7 in r28, 0x3d ; 61 1892c: de b7 in r29, 0x3e ; 62 1892e: a8 97 sbiw r28, 0x28 ; 40 18930: 0f b6 in r0, 0x3f ; 63 18932: f8 94 cli 18934: de bf out 0x3e, r29 ; 62 18936: 0f be out 0x3f, r0 ; 63 18938: 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); 1893a: 48 e0 ldi r20, 0x08 ; 8 1893c: 50 e0 ldi r21, 0x00 ; 0 1893e: 65 ee ldi r22, 0xE5 ; 229 18940: 7f e0 ldi r23, 0x0F ; 15 18942: ce 01 movw r24, r28 18944: 41 96 adiw r24, 0x11 ; 17 18946: 0f 94 8d a3 call 0x3471a ; 0x3471a eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 1894a: 48 e0 ldi r20, 0x08 ; 8 1894c: 50 e0 ldi r21, 0x00 ; 0 1894e: 6d ed ldi r22, 0xDD ; 221 18950: 7f e0 ldi r23, 0x0F ; 15 18952: ce 01 movw r24, r28 18954: 09 96 adiw r24, 0x09 ; 9 18956: 0f 94 8d a3 call 0x3471a ; 0x3471a eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 1895a: 48 e0 ldi r20, 0x08 ; 8 1895c: 50 e0 ldi r21, 0x00 ; 0 1895e: 65 ed ldi r22, 0xD5 ; 213 18960: 7f e0 ldi r23, 0x0F ; 15 18962: ce 01 movw r24, r28 18964: 01 96 adiw r24, 0x01 ; 1 18966: 0f 94 8d a3 call 0x3471a ; 0x3471a 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]; 1896a: 8d 84 ldd r8, Y+13 ; 0x0d 1896c: 9e 84 ldd r9, Y+14 ; 0x0e 1896e: af 84 ldd r10, Y+15 ; 0x0f 18970: b8 88 ldd r11, Y+16 ; 0x10 18972: e0 e0 ldi r30, 0x00 ; 0 18974: fc e9 ldi r31, 0x9C ; 156 18976: 25 91 lpm r18, Z+ 18978: 35 91 lpm r19, Z+ 1897a: 45 91 lpm r20, Z+ 1897c: 54 91 lpm r21, Z 1897e: cd 80 ldd r12, Y+5 ; 0x05 18980: de 80 ldd r13, Y+6 ; 0x06 18982: ef 80 ldd r14, Y+7 ; 0x07 18984: f8 84 ldd r15, Y+8 ; 0x08 18986: e4 e0 ldi r30, 0x04 ; 4 18988: fc e9 ldi r31, 0x9C ; 156 1898a: 85 91 lpm r24, Z+ 1898c: 95 91 lpm r25, Z+ 1898e: a5 91 lpm r26, Z+ 18990: b4 91 lpm r27, Z 18992: 8d a3 std Y+37, r24 ; 0x25 18994: 9e a3 std Y+38, r25 ; 0x26 18996: af a3 std Y+39, r26 ; 0x27 18998: b8 a7 std Y+40, r27 ; 0x28 1899a: 8d 89 ldd r24, Y+21 ; 0x15 1899c: 9e 89 ldd r25, Y+22 ; 0x16 1899e: af 89 ldd r26, Y+23 ; 0x17 189a0: b8 8d ldd r27, Y+24 ; 0x18 189a2: 89 a3 std Y+33, r24 ; 0x21 189a4: 9a a3 std Y+34, r25 ; 0x22 189a6: ab a3 std Y+35, r26 ; 0x23 189a8: bc a3 std Y+36, r27 ; 0x24 189aa: c5 01 movw r24, r10 189ac: b4 01 movw r22, r8 189ae: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 189b2: 2b 01 movw r4, r22 189b4: 3c 01 movw r6, r24 189b6: 2d a1 ldd r18, Y+37 ; 0x25 189b8: 3e a1 ldd r19, Y+38 ; 0x26 189ba: 4f a1 ldd r20, Y+39 ; 0x27 189bc: 58 a5 ldd r21, Y+40 ; 0x28 189be: c7 01 movw r24, r14 189c0: b6 01 movw r22, r12 189c2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 189c6: 9b 01 movw r18, r22 189c8: ac 01 movw r20, r24 189ca: c3 01 movw r24, r6 189cc: b2 01 movw r22, r4 189ce: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 189d2: 29 a1 ldd r18, Y+33 ; 0x21 189d4: 3a a1 ldd r19, Y+34 ; 0x22 189d6: 4b a1 ldd r20, Y+35 ; 0x23 189d8: 5c a1 ldd r21, Y+36 ; 0x24 189da: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 189de: 20 e0 ldi r18, 0x00 ; 0 189e0: 30 e0 ldi r19, 0x00 ; 0 189e2: 40 e9 ldi r20, 0x90 ; 144 189e4: 50 e4 ldi r21, 0x40 ; 64 189e6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 189ea: 1b 01 movw r2, r22 189ec: 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]; 189ee: e8 e0 ldi r30, 0x08 ; 8 189f0: fc e9 ldi r31, 0x9C ; 156 189f2: 25 91 lpm r18, Z+ 189f4: 35 91 lpm r19, Z+ 189f6: 45 91 lpm r20, Z+ 189f8: 54 91 lpm r21, Z 189fa: ec e0 ldi r30, 0x0C ; 12 189fc: fc e9 ldi r31, 0x9C ; 156 189fe: 45 90 lpm r4, Z+ 18a00: 55 90 lpm r5, Z+ 18a02: 65 90 lpm r6, Z+ 18a04: 74 90 lpm r7, Z 18a06: c5 01 movw r24, r10 18a08: b4 01 movw r22, r8 18a0a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 18a0e: 4b 01 movw r8, r22 18a10: 5c 01 movw r10, r24 18a12: a3 01 movw r20, r6 18a14: 92 01 movw r18, r4 18a16: c7 01 movw r24, r14 18a18: b6 01 movw r22, r12 18a1a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 18a1e: 9b 01 movw r18, r22 18a20: ac 01 movw r20, r24 18a22: c5 01 movw r24, r10 18a24: b4 01 movw r22, r8 18a26: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 18a2a: 29 a1 ldd r18, Y+33 ; 0x21 18a2c: 3a a1 ldd r19, Y+34 ; 0x22 18a2e: 4b a1 ldd r20, Y+35 ; 0x23 18a30: 5c a1 ldd r21, Y+36 ; 0x24 18a32: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 18a36: 20 e0 ldi r18, 0x00 ; 0 18a38: 30 e0 ldi r19, 0x00 ; 0 18a3a: 40 e9 ldi r20, 0x90 ; 144 18a3c: 50 e4 ldi r21, 0x40 ; 64 18a3e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 18a42: 6d 8f std Y+29, r22 ; 0x1d 18a44: 7e 8f std Y+30, r23 ; 0x1e 18a46: 8f 8f std Y+31, r24 ; 0x1f 18a48: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 18a4a: 0e 94 ef 6f call 0xdfde ; 0xdfde lcd_printf_P(_N( 18a4e: 8a e3 ldi r24, 0x3A ; 58 18a50: 9a e3 ldi r25, 0x3A ; 58 18a52: 0e 94 0a 75 call 0xea14 ; 0xea14 18a56: d8 2e mov r13, r24 18a58: c9 2e mov r12, r25 18a5a: 83 e3 ldi r24, 0x33 ; 51 18a5c: 9a e3 ldi r25, 0x3A ; 58 18a5e: 0e 94 0a 75 call 0xea14 ; 0xea14 18a62: f8 2e mov r15, r24 18a64: e9 2e mov r14, r25 18a66: 8d e1 ldi r24, 0x1D ; 29 18a68: 9a e3 ldi r25, 0x3A ; 58 18a6a: 0e 94 0a 75 call 0xea14 ; 0xea14 18a6e: cf 92 push r12 18a70: df 92 push r13 18a72: ef 92 push r14 18a74: ff 92 push r15 18a76: 2f ed ldi r18, 0xDF ; 223 18a78: 33 e8 ldi r19, 0x83 ; 131 18a7a: 3f 93 push r19 18a7c: 2f 93 push r18 18a7e: 9f 93 push r25 18a80: 8f 93 push r24 18a82: 8e e5 ldi r24, 0x5E ; 94 18a84: 97 e6 ldi r25, 0x67 ; 103 18a86: 9f 93 push r25 18a88: 8f 93 push r24 18a8a: 0e 94 db 6e call 0xddb6 ; 0xddb6 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 18a8e: 62 e0 ldi r22, 0x02 ; 2 18a90: 8b e0 ldi r24, 0x0B ; 11 18a92: 0e 94 2a 6f call 0xde54 ; 0xde54 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 18a96: 0f b6 in r0, 0x3f ; 63 18a98: f8 94 cli 18a9a: de bf out 0x3e, r29 ; 62 18a9c: 0f be out 0x3f, r0 ; 63 18a9e: cd bf out 0x3d, r28 ; 61 18aa0: 20 e0 ldi r18, 0x00 ; 0 18aa2: 30 e0 ldi r19, 0x00 ; 0 18aa4: 48 e4 ldi r20, 0x48 ; 72 18aa6: 53 e4 ldi r21, 0x43 ; 67 18aa8: 62 2d mov r22, r2 18aaa: 73 2d mov r23, r3 18aac: 80 2f mov r24, r16 18aae: 91 2f mov r25, r17 18ab0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 18ab4: 87 ff sbrs r24, 7 18ab6: 51 c0 rjmp .+162 ; 0x18b5a else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 18ab8: 1f 93 push r17 18aba: 0f 93 push r16 18abc: 3f 92 push r3 18abe: 2f 92 push r2 18ac0: 86 e5 ldi r24, 0x56 ; 86 18ac2: 97 e6 ldi r25, 0x67 ; 103 18ac4: 9f 93 push r25 18ac6: 8f 93 push r24 18ac8: 0e 94 db 6e call 0xddb6 ; 0xddb6 18acc: 0f 90 pop r0 18ace: 0f 90 pop r0 18ad0: 0f 90 pop r0 18ad2: 0f 90 pop r0 18ad4: 0f 90 pop r0 18ad6: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 18ad8: 63 e0 ldi r22, 0x03 ; 3 18ada: 8b e0 ldi r24, 0x0B ; 11 18adc: 0e 94 2a 6f call 0xde54 ; 0xde54 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 18ae0: 1d 8d ldd r17, Y+29 ; 0x1d 18ae2: 0e 8d ldd r16, Y+30 ; 0x1e 18ae4: ff 8c ldd r15, Y+31 ; 0x1f 18ae6: e8 a0 ldd r14, Y+32 ; 0x20 18ae8: 20 e0 ldi r18, 0x00 ; 0 18aea: 30 e0 ldi r19, 0x00 ; 0 18aec: 48 e4 ldi r20, 0x48 ; 72 18aee: 53 e4 ldi r21, 0x43 ; 67 18af0: d8 01 movw r26, r16 18af2: f7 01 movw r30, r14 18af4: 6b 2f mov r22, r27 18af6: 7a 2f mov r23, r26 18af8: 8f 2f mov r24, r31 18afa: 9e 2f mov r25, r30 18afc: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 18b00: 87 fd sbrc r24, 7 18b02: 32 c0 rjmp .+100 ; 0x18b68 18b04: 80 e2 ldi r24, 0x20 ; 32 18b06: 98 e4 ldi r25, 0x48 ; 72 18b08: 0e 94 0a 75 call 0xea14 ; 0xea14 18b0c: 0e 94 ed 6e call 0xddda ; 0xddda else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 18b10: 0e 94 45 73 call 0xe68a ; 0xe68a 18b14: 88 23 and r24, r24 18b16: 41 f0 breq .+16 ; 0x18b28 menu_goto(lcd_menu_xyz_skew, 0, true); 18b18: 20 e0 ldi r18, 0x00 ; 0 18b1a: 41 e0 ldi r20, 0x01 ; 1 18b1c: 70 e0 ldi r23, 0x00 ; 0 18b1e: 60 e0 ldi r22, 0x00 ; 0 18b20: 84 e2 ldi r24, 0x24 ; 36 18b22: 9f ec ldi r25, 0xCF ; 207 18b24: 0e 94 87 62 call 0xc50e ; 0xc50e } 18b28: a8 96 adiw r28, 0x28 ; 40 18b2a: 0f b6 in r0, 0x3f ; 63 18b2c: f8 94 cli 18b2e: de bf out 0x3e, r29 ; 62 18b30: 0f be out 0x3f, r0 ; 63 18b32: cd bf out 0x3d, r28 ; 61 18b34: df 91 pop r29 18b36: cf 91 pop r28 18b38: 1f 91 pop r17 18b3a: 0f 91 pop r16 18b3c: ff 90 pop r15 18b3e: ef 90 pop r14 18b40: df 90 pop r13 18b42: cf 90 pop r12 18b44: bf 90 pop r11 18b46: af 90 pop r10 18b48: 9f 90 pop r9 18b4a: 8f 90 pop r8 18b4c: 7f 90 pop r7 18b4e: 6f 90 pop r6 18b50: 5f 90 pop r5 18b52: 4f 90 pop r4 18b54: 3f 90 pop r3 18b56: 2f 90 pop r2 18b58: 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)); 18b5a: 80 e2 ldi r24, 0x20 ; 32 18b5c: 98 e4 ldi r25, 0x48 ; 72 18b5e: 0e 94 0a 75 call 0xea14 ; 0xea14 18b62: 0e 94 ed 6e call 0xddda ; 0xddda 18b66: b8 cf rjmp .-144 ; 0x18ad8 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 18b68: ef 92 push r14 18b6a: ff 92 push r15 18b6c: 0f 93 push r16 18b6e: 1f 93 push r17 18b70: 86 e5 ldi r24, 0x56 ; 86 18b72: 97 e6 ldi r25, 0x67 ; 103 18b74: 9f 93 push r25 18b76: 8f 93 push r24 18b78: 0e 94 db 6e call 0xddb6 ; 0xddb6 18b7c: 0f 90 pop r0 18b7e: 0f 90 pop r0 18b80: 0f 90 pop r0 18b82: 0f 90 pop r0 18b84: 0f 90 pop r0 18b86: 0f 90 pop r0 18b88: c3 cf rjmp .-122 ; 0x18b10 00018b8a : else value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { 18b8a: ef 92 push r14 18b8c: ff 92 push r15 18b8e: 0f 93 push r16 18b90: 1f 93 push r17 18b92: cf 93 push r28 18b94: df 93 push r29 18b96: cd b7 in r28, 0x3d ; 61 18b98: de b7 in r29, 0x3e ; 62 18b9a: 6b 97 sbiw r28, 0x1b ; 27 18b9c: 0f b6 in r0, 0x3f ; 63 18b9e: f8 94 cli 18ba0: de bf out 0x3e, r29 ; 62 18ba2: 0f be out 0x3f, r0 ; 63 18ba4: cd bf out 0x3d, r28 ; 61 void restore_file_from_sd() { char filename[FILENAME_LENGTH]; char dir_name[9]; char extension_ptr[5]; uint8_t depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH); 18ba6: 8a e5 ldi r24, 0x5A ; 90 18ba8: 9f e0 ldi r25, 0x0F ; 15 18baa: 0f 94 9d a3 call 0x3473a ; 0x3473a 18bae: e8 2e mov r14, r24 18bb0: 0a e0 ldi r16, 0x0A ; 10 18bb2: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 18bb4: 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); 18bb6: 48 e0 ldi r20, 0x08 ; 8 18bb8: 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++) { 18bba: ef 14 cp r14, r15 18bbc: 79 f0 breq .+30 ; 0x18bdc eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 18bbe: b8 01 movw r22, r16 18bc0: ce 01 movw r24, r28 18bc2: 0e 96 adiw r24, 0x0e ; 14 18bc4: 0f 94 8d a3 call 0x3471a ; 0x3471a dir_name[8] = '\0'; 18bc8: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 18bca: 60 e0 ldi r22, 0x00 ; 0 18bcc: ce 01 movw r24, r28 18bce: 0e 96 adiw r24, 0x0e ; 14 18bd0: 0f 94 79 70 call 0x2e0f2 ; 0x2e0f2 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++) { 18bd4: f3 94 inc r15 18bd6: 08 5f subi r16, 0xF8 ; 248 18bd8: 1f 4f sbci r17, 0xFF ; 255 18bda: ed cf rjmp .-38 ; 0x18bb6 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); 18bdc: 65 e9 ldi r22, 0x95 ; 149 18bde: 7f e0 ldi r23, 0x0F ; 15 18be0: 8e 01 movw r16, r28 18be2: 0f 5f subi r16, 0xFF ; 255 18be4: 1f 4f sbci r17, 0xFF ; 255 18be6: c8 01 movw r24, r16 18be8: 0f 94 8d a3 call 0x3471a ; 0x3471a // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 18bec: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 18bee: 8e e2 ldi r24, 0x2E ; 46 18bf0: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 18bf2: 43 e0 ldi r20, 0x03 ; 3 18bf4: 50 e0 ldi r21, 0x00 ; 0 18bf6: 61 e9 ldi r22, 0x91 ; 145 18bf8: 7c e0 ldi r23, 0x0C ; 12 18bfa: ce 01 movw r24, r28 18bfc: 48 96 adiw r24, 0x18 ; 24 18bfe: 0f 94 8d a3 call 0x3471a ; 0x3471a extension_ptr[4] = '\0'; 18c02: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 18c04: be 01 movw r22, r28 18c06: 69 5e subi r22, 0xE9 ; 233 18c08: 7f 4f sbci r23, 0xFF ; 255 18c0a: c8 01 movw r24, r16 18c0c: 0f 94 e9 a9 call 0x353d2 ; 0x353d2 enquecommandf_P(MSG_M23, filename); 18c10: 1f 93 push r17 18c12: 0f 93 push r16 18c14: 87 e6 ldi r24, 0x67 ; 103 18c16: 9c e6 ldi r25, 0x6C ; 108 18c18: 9f 93 push r25 18c1a: 8f 93 push r24 18c1c: 0e 94 a8 8d call 0x11b50 ; 0x11b50 restore_file_from_sd(); // M24: Start/resume SD print enquecommand_P(MSG_M24); 18c20: 61 e0 ldi r22, 0x01 ; 1 18c22: 83 e6 ldi r24, 0x63 ; 99 18c24: 9c e6 ldi r25, 0x6C ; 108 18c26: 0e 94 da 8c call 0x119b4 ; 0x119b4 lcd_return_to_status(); 18c2a: 0f 94 6d 05 call 0x20ada ; 0x20ada 18c2e: 0f 90 pop r0 18c30: 0f 90 pop r0 18c32: 0f 90 pop r0 18c34: 0f 90 pop r0 } 18c36: 6b 96 adiw r28, 0x1b ; 27 18c38: 0f b6 in r0, 0x3f ; 63 18c3a: f8 94 cli 18c3c: de bf out 0x3e, r29 ; 62 18c3e: 0f be out 0x3f, r0 ; 63 18c40: cd bf out 0x3d, r28 ; 61 18c42: df 91 pop r29 18c44: cf 91 pop r28 18c46: 1f 91 pop r17 18c48: 0f 91 pop r16 18c4a: ff 90 pop r15 18c4c: ef 90 pop r14 18c4e: 08 95 ret 00018c50 : MENU_END(); } #ifdef PINDA_TEMP_COMP void lcd_pinda_temp_compensation_toggle() { 18c50: cf 93 push r28 uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 18c52: 89 e2 ldi r24, 0x29 ; 41 18c54: 9d e0 ldi r25, 0x0D ; 13 18c56: 0f 94 9d a3 call 0x3473a ; 0x3473a if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) // On MK2.5/S the EEPROM_EMPTY_VALUE will be set to 0 during eeprom_init. pinda_temp_compensation = 1; // But for MK3/S it should be 1 so SuperPINDA is "active" else pinda_temp_compensation = !pinda_temp_compensation; 18c5a: 81 50 subi r24, 0x01 ; 1 18c5c: c1 e0 ldi r28, 0x01 ; 1 18c5e: 8e 3f cpi r24, 0xFE ; 254 18c60: 08 f4 brcc .+2 ; 0x18c64 18c62: c0 e0 ldi r28, 0x00 ; 0 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 18c64: 6c 2f mov r22, r28 18c66: 89 e2 ldi r24, 0x29 ; 41 18c68: 9d e0 ldi r25, 0x0D ; 13 18c6a: 0f 94 c1 a3 call 0x34782 ; 0x34782 eeprom_update_byte_notify((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation); SERIAL_ECHOLNPGM("SuperPINDA:"); 18c6e: 84 ef ldi r24, 0xF4 ; 244 18c70: 93 e8 ldi r25, 0x83 ; 131 18c72: 0e 94 8d 7c call 0xf91a ; 0xf91a } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 18c76: 8c 2f mov r24, r28 18c78: 0e 94 81 79 call 0xf302 ; 0xf302 SERIAL_ECHOLN(pinda_temp_compensation); } 18c7c: cf 91 pop r28 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 18c7e: 0c 94 8c 7a jmp 0xf518 ; 0xf518 00018c82 : } 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); 18c82: 22 ed ldi r18, 0xD2 ; 210 18c84: 30 e0 ldi r19, 0x00 ; 0 18c86: 50 e0 ldi r21, 0x00 ; 0 18c88: 40 e0 ldi r20, 0x00 ; 0 18c8a: 62 e0 ldi r22, 0x02 ; 2 18c8c: 82 e6 ldi r24, 0x62 ; 98 18c8e: 92 e8 ldi r25, 0x82 ; 130 18c90: 0d 94 3d 4a jmp 0x2947a ; 0x2947a <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]> 00018c94 : } // 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); 18c94: 2a ef ldi r18, 0xFA ; 250 18c96: 30 e0 ldi r19, 0x00 ; 0 18c98: 50 e0 ldi r21, 0x00 ; 0 18c9a: 40 e0 ldi r20, 0x00 ; 0 18c9c: 60 e0 ldi r22, 0x00 ; 0 18c9e: 8c e5 ldi r24, 0x5C ; 92 18ca0: 92 e8 ldi r25, 0x82 ; 130 18ca2: 0d 94 3d 4a jmp 0x2947a ; 0x2947a <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]> 00018ca6 : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 18ca6: 22 ed ldi r18, 0xD2 ; 210 18ca8: 30 e0 ldi r19, 0x00 ; 0 18caa: 4c ef ldi r20, 0xFC ; 252 18cac: 5f ef ldi r21, 0xFF ; 255 18cae: 61 e0 ldi r22, 0x01 ; 1 18cb0: 8f e5 ldi r24, 0x5F ; 95 18cb2: 92 e8 ldi r25, 0x82 ; 130 18cb4: 0d 94 3d 4a jmp 0x2947a ; 0x2947a <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]> 00018cb8 : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 18cb8: cf 93 push r28 18cba: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 18cbc: 83 ee ldi r24, 0xE3 ; 227 18cbe: 93 e0 ldi r25, 0x03 ; 3 18cc0: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 18cc4: 80 91 71 12 lds r24, 0x1271 ; 0x801271 18cc8: 81 11 cpse r24, r1 18cca: 18 c0 rjmp .+48 ; 0x18cfc 18ccc: 80 91 72 12 lds r24, 0x1272 ; 0x801272 18cd0: 81 11 cpse r24, r1 18cd2: 14 c0 rjmp .+40 ; 0x18cfc 18cd4: c0 91 02 04 lds r28, 0x0402 ; 0x800402 18cd8: d0 91 03 04 lds r29, 0x0403 ; 0x800403 18cdc: 85 ed ldi r24, 0xD5 ; 213 18cde: c9 35 cpi r28, 0x59 ; 89 18ce0: d8 07 cpc r29, r24 18ce2: 61 f0 breq .+24 ; 0x18cfc 18ce4: 86 ec ldi r24, 0xC6 ; 198 18ce6: c1 34 cpi r28, 0x41 ; 65 18ce8: d8 07 cpc r29, r24 18cea: 41 f0 breq .+16 ; 0x18cfc 18cec: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 18cf0: 81 11 cpse r24, r1 18cf2: 04 c0 rjmp .+8 ; 0x18cfc 18cf4: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 18cf8: 88 23 and r24, r24 18cfa: 31 f0 breq .+12 ; 0x18d08 { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 18cfc: 82 e0 ldi r24, 0x02 ; 2 18cfe: 80 93 59 02 sts 0x0259, r24 ; 0x800259 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d02: df 91 pop r29 18d04: cf 91 pop r28 18d06: 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) 18d08: 8f eb ldi r24, 0xBF ; 191 18d0a: cc 34 cpi r28, 0x4C ; 76 18d0c: d8 07 cpc r29, r24 18d0e: 81 f4 brne .+32 ; 0x18d30 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 18d10: 82 e0 ldi r24, 0x02 ; 2 18d12: 80 93 59 02 sts 0x0259, r24 ; 0x800259 eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); 18d16: 8a e2 ldi r24, 0x2A ; 42 18d18: 9d e0 ldi r25, 0x0D ; 13 18d1a: 0f 94 9d a3 call 0x3473a ; 0x3473a 18d1e: 61 e0 ldi r22, 0x01 ; 1 18d20: 81 11 cpse r24, r1 18d22: 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); 18d24: 8a e2 ldi r24, 0x2A ; 42 18d26: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d28: df 91 pop r29 18d2a: cf 91 pop r28 18d2c: 0d 94 e5 a3 jmp 0x347ca ; 0x347ca 18d30: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 18d34: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 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 18d38: 98 13 cpse r25, r24 18d3a: 04 c0 rjmp .+8 ; 0x18d44 18d3c: 0e 94 10 66 call 0xcc20 ; 0xcc20 18d40: 88 23 and r24, r24 18d42: 61 f0 breq .+24 ; 0x18d5c if ( babystep_allowed_strict() 18d44: 0e 94 4b 66 call 0xcc96 ; 0xcc96 && (menu_menu == lcd_status_screen // and in listed menus... 18d48: 81 11 cpse r24, r1 18d4a: 10 c0 rjmp .+32 ; 0x18d6c Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 18d4c: 82 e0 ldi r24, 0x02 ; 2 18d4e: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 18d52: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d54: df 91 pop r29 18d56: cf 91 pop r28 18d58: 0d 94 62 23 jmp 0x246c4 ; 0x246c4 menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 18d5c: 87 e3 ldi r24, 0x37 ; 55 18d5e: c6 3d cpi r28, 0xD6 ; 214 18d60: d8 07 cpc r29, r24 18d62: e1 f4 brne .+56 ; 0x18d9c #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 18d64: 60 e0 ldi r22, 0x00 ; 0 18d66: 81 e4 ldi r24, 0x41 ; 65 18d68: 96 ec ldi r25, 0xC6 ; 198 18d6a: 14 c0 rjmp .+40 ; 0x18d94 // 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... 18d6c: 87 e3 ldi r24, 0x37 ; 55 18d6e: c6 3d cpi r28, 0xD6 ; 214 18d70: d8 07 cpc r29, r24 18d72: 59 f0 breq .+22 ; 0x18d8a || menu_menu == lcd_main_menu 18d74: 86 ec ldi r24, 0xC6 ; 198 18d76: cb 3e cpi r28, 0xEB ; 235 18d78: d8 07 cpc r29, r24 18d7a: 39 f0 breq .+14 ; 0x18d8a || menu_menu == lcd_tune_menu 18d7c: 8a ec ldi r24, 0xCA ; 202 18d7e: c8 31 cpi r28, 0x18 ; 24 18d80: d8 07 cpc r29, r24 18d82: 19 f0 breq .+6 ; 0x18d8a || menu_menu == lcd_support_menu 18d84: cc 55 subi r28, 0x5C ; 92 18d86: d8 43 sbci r29, 0x38 ; 56 18d88: 09 f7 brne .-62 ; 0x18d4c ) ){ lcd_clear(); 18d8a: 0e 94 f6 6f call 0xdfec ; 0xdfec menu_submenu(lcd_babystep_z); 18d8e: 60 e0 ldi r22, 0x00 ; 0 18d90: 89 e5 ldi r24, 0x59 ; 89 18d92: 95 ed ldi r25, 0xD5 ; 213 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d94: df 91 pop r29 18d96: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 18d98: 0c 94 ad 62 jmp 0xc55a ; 0xc55a } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 18d9c: 86 ec ldi r24, 0xC6 ; 198 18d9e: cb 3e cpi r28, 0xEB ; 235 18da0: d8 07 cpc r29, r24 18da2: 01 f3 breq .-64 ; 0x18d64 || menu_menu == lcd_preheat_menu 18da4: 88 e3 ldi r24, 0x38 ; 56 18da6: ce 30 cpi r28, 0x0E ; 14 18da8: d8 07 cpc r29, r24 18daa: e1 f2 breq .-72 ; 0x18d64 || menu_menu == lcd_sdcard_menu 18dac: 83 ee ldi r24, 0xE3 ; 227 18dae: c1 39 cpi r28, 0x91 ; 145 18db0: d8 07 cpc r29, r24 18db2: c1 f2 breq .-80 ; 0x18d64 || menu_menu == lcd_settings_menu 18db4: 8a ec ldi r24, 0xCA ; 202 18db6: c6 3d cpi r28, 0xD6 ; 214 18db8: d8 07 cpc r29, r24 18dba: a1 f2 breq .-88 ; 0x18d64 || menu_menu == lcd_control_temperature_menu 18dbc: 89 ec ldi r24, 0xC9 ; 201 18dbe: cf 33 cpi r28, 0x3F ; 63 18dc0: d8 07 cpc r29, r24 18dc2: 81 f2 breq .-96 ; 0x18d64 #if (LANG_MODE != 0) || menu_menu == lcd_language 18dc4: 82 ec ldi r24, 0xC2 ; 194 18dc6: ca 33 cpi r28, 0x3A ; 58 18dc8: d8 07 cpc r29, r24 18dca: 61 f2 breq .-104 ; 0x18d64 #endif || menu_menu == lcd_support_menu 18dcc: cc 55 subi r28, 0x5C ; 92 18dce: d8 43 sbci r29, 0x38 ; 56 18dd0: 09 f0 breq .+2 ; 0x18dd4 18dd2: bc cf rjmp .-136 ; 0x18d4c 18dd4: c7 cf rjmp .-114 ; 0x18d64 00018dd6 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 18dd6: 1f 93 push r17 18dd8: cf 93 push r28 18dda: df 93 push r29 MENU_BEGIN(); 18ddc: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 18de0: 10 92 60 04 sts 0x0460, r1 ; 0x800460 #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); 18de4: 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 18de6: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18de8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18dec: 84 30 cpi r24, 0x04 ; 4 18dee: 08 f0 brcs .+2 ; 0x18df2 18df0: 09 c2 rjmp .+1042 ; 0x19204 18df2: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 18df6: 84 eb ldi r24, 0xB4 ; 180 18df8: 97 e4 ldi r25, 0x47 ; 71 18dfa: 0e 94 0a 75 call 0xea14 ; 0xea14 18dfe: 0e 94 9e 72 call 0xe53c ; 0xe53c 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)) { 18e02: 0e 94 61 66 call 0xccc2 ; 0xccc2 18e06: 81 11 cpse r24, r1 18e08: 19 c0 rjmp .+50 ; 0x18e3c 18e0a: 0e 94 fb 65 call 0xcbf6 ; 0xcbf6 18e0e: 81 11 cpse r24, r1 18e10: 15 c0 rjmp .+42 ; 0x18e3c 18e12: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 18e16: 81 11 cpse r24, r1 18e18: 11 c0 rjmp .+34 ; 0x18e3c #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 18e1a: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.387> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 18e1e: 83 30 cpi r24, 0x03 ; 3 18e20: 09 f0 breq .+2 ; 0x18e24 18e22: 5d c0 rjmp .+186 ; 0x18ede 18e24: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 18e28: 88 23 and r24, r24 18e2a: 41 f0 breq .+16 ; 0x18e3c MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 18e2c: 8a ea ldi r24, 0xAA ; 170 18e2e: 97 e4 ldi r25, 0x47 ; 71 18e30: 0e 94 0a 75 call 0xea14 ; 0xea14 18e34: 65 ec ldi r22, 0xC5 ; 197 18e36: 75 ec ldi r23, 0xC5 ; 197 } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) { MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 18e38: 0e 94 6d 72 call 0xe4da ; 0xe4da } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 18e3c: 0e 94 4b 66 call 0xcc96 ; 0xcc96 18e40: 88 23 and r24, r24 18e42: 81 f0 breq .+32 ; 0x18e64 18e44: 0e 94 10 66 call 0xcc20 ; 0xcc20 18e48: 81 11 cpse r24, r1 18e4a: 04 c0 rjmp .+8 ; 0x18e54 18e4c: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 18e50: 84 30 cpi r24, 0x04 ; 4 18e52: 41 f4 brne .+16 ; 0x18e64 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 18e54: 8a e9 ldi r24, 0x9A ; 154 18e56: 97 e4 ldi r25, 0x47 ; 71 18e58: 0e 94 0a 75 call 0xea14 ; 0xea14 18e5c: 69 e5 ldi r22, 0x59 ; 89 18e5e: 75 ed ldi r23, 0xD5 ; 213 18e60: 0e 94 c3 72 call 0xe586 ; 0xe586 if (farm_mode) 18e64: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 18e68: 88 23 and r24, r24 18e6a: 41 f0 breq .+16 ; 0x18e7c MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 18e6c: 8f ee ldi r24, 0xEF ; 239 18e6e: 97 e4 ldi r25, 0x47 ; 71 18e70: 0e 94 0a 75 call 0xea14 ; 0xea14 18e74: 66 e9 ldi r22, 0x96 ; 150 18e76: 7c ed ldi r23, 0xDC ; 220 18e78: 0e 94 6d 72 call 0xe4da ; 0xe4da if (!printer_recovering()) { 18e7c: 0e 94 fb 65 call 0xcbf6 ; 0xcbf6 18e80: 81 11 cpse r24, r1 18e82: 61 c0 rjmp .+194 ; 0x18f46 } //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); 18e84: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 18e88: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 18e8c: 89 1b sub r24, r25 18e8e: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 18e90: a9 f5 brne .+106 ; 0x18efc if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 18e92: 0e 94 61 66 call 0xccc2 ; 0xccc2 18e96: 81 11 cpse r24, r1 18e98: 31 c0 rjmp .+98 ; 0x18efc #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 18e9a: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18e9e: 82 30 cpi r24, 0x02 ; 2 18ea0: 69 f1 breq .+90 ; 0x18efc #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 18ea2: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 18ea6: 81 11 cpse r24, r1 18ea8: 31 c0 rjmp .+98 ; 0x18f0c MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 18eaa: 89 e8 ldi r24, 0x89 ; 137 18eac: 97 e4 ldi r25, 0x47 ; 71 18eae: 0e 94 0a 75 call 0xea14 ; 0xea14 18eb2: 6e e0 ldi r22, 0x0E ; 14 18eb4: 78 e3 ldi r23, 0x38 ; 56 18eb6: 0e 94 c3 72 call 0xe586 ; 0xe586 if (M79_timer_get_status()) { 18eba: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.422> 18ebe: 88 23 and r24, r24 18ec0: 29 f1 breq .+74 ; 0x18f0c #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 18ec2: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 18ec6: 81 30 cpi r24, 0x01 ; 1 18ec8: 09 f0 breq .+2 ; 0x18ecc 18eca: 45 c1 rjmp .+650 ; 0x19156 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 18ecc: 89 e7 ldi r24, 0x79 ; 121 18ece: 97 e4 ldi r25, 0x47 ; 71 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 18ed0: 0e 94 0a 75 call 0xea14 ; 0xea14 18ed4: 64 eb ldi r22, 0xB4 ; 180 18ed6: 7c eb ldi r23, 0xBC ; 188 18ed8: 0e 94 6d 72 call 0xe4da ; 0xe4da 18edc: 17 c0 rjmp .+46 ; 0x18f0c // 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()) { 18ede: 84 30 cpi r24, 0x04 ; 4 18ee0: 09 f0 breq .+2 ; 0x18ee4 18ee2: ac cf rjmp .-168 ; 0x18e3c 18ee4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.422> 18ee8: 88 23 and r24, r24 18eea: 09 f4 brne .+2 ; 0x18eee 18eec: a7 cf rjmp .-178 ; 0x18e3c MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 18eee: 8a ea ldi r24, 0xAA ; 170 18ef0: 97 e4 ldi r25, 0x47 ; 71 18ef2: 0e 94 0a 75 call 0xea14 ; 0xea14 18ef6: 6e ea ldi r22, 0xAE ; 174 18ef8: 7c eb ldi r23, 0xBC ; 188 18efa: 9e cf rjmp .-196 ; 0x18e38 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); 18efc: 83 e9 ldi r24, 0x93 ; 147 18efe: 97 e4 ldi r25, 0x47 ; 71 18f00: 0e 94 0a 75 call 0xea14 ; 0xea14 18f04: 68 e1 ldi r22, 0x18 ; 24 18f06: 7a ec ldi r23, 0xCA ; 202 18f08: 0e 94 c3 72 call 0xe586 ; 0xe586 #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) { 18f0c: c0 91 72 12 lds r28, 0x1272 ; 0x801272 18f10: 0e 94 05 66 call 0xcc0a ; 0xcc0a 18f14: c1 11 cpse r28, r1 18f16: 17 c0 rjmp .+46 ; 0x18f46 18f18: 90 91 71 12 lds r25, 0x1271 ; 0x801271 18f1c: 91 11 cpse r25, r1 18f1e: 13 c0 rjmp .+38 ; 0x18f46 18f20: 81 11 cpse r24, r1 18f22: 15 c0 rjmp .+42 ; 0x18f4e 18f24: 80 91 91 03 lds r24, 0x0391 ; 0x800391 18f28: 81 11 cpse r24, r1 18f2a: 0d c0 rjmp .+26 ; 0x18f46 if (usb_timer.running()) { 18f2c: 80 91 42 12 lds r24, 0x1242 ; 0x801242 18f30: 88 23 and r24, r24 18f32: 09 f4 brne .+2 ; 0x18f36 18f34: 13 c1 rjmp .+550 ; 0x1915c MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 18f36: 8f e5 ldi r24, 0x5F ; 95 18f38: 97 e4 ldi r25, 0x47 ; 71 18f3a: 0e 94 0a 75 call 0xea14 ; 0xea14 18f3e: 6a e5 ldi r22, 0x5A ; 90 18f40: 78 e3 ldi r23, 0x38 ; 56 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18f42: 0e 94 6d 72 call 0xe4da ; 0xe4da } } } if (printingIsPaused() 18f46: 0e 94 05 66 call 0xcc0a ; 0xcc0a && !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) { 18f4a: 88 23 and r24, r24 18f4c: f1 f0 breq .+60 ; 0x18f8a temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 18f4e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 18f52: 81 11 cpse r24, r1 18f54: 1a c0 rjmp .+52 ; 0x18f8a #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18f56: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18f5a: 82 30 cpi r24, 0x02 ; 2 18f5c: b1 f0 breq .+44 ; 0x18f8a #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 18f5e: 80 91 79 02 lds r24, 0x0279 ; 0x800279 18f62: 82 30 cpi r24, 0x02 ; 2 18f64: 21 f4 brne .+8 ; 0x18f6e 18f66: 90 91 73 12 lds r25, 0x1273 ; 0x801273 18f6a: 99 23 and r25, r25 18f6c: 71 f0 breq .+28 ; 0x18f8a && custom_message_type != CustomMsg::Resuming) { 18f6e: 90 91 5d 06 lds r25, 0x065D ; 0x80065d 18f72: 98 30 cpi r25, 0x08 ; 8 18f74: 51 f0 breq .+20 ; 0x18f8a if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 18f76: 81 11 cpse r24, r1 18f78: fd c0 rjmp .+506 ; 0x19174 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 18f7a: 80 e5 ldi r24, 0x50 ; 80 18f7c: 97 e4 ldi r25, 0x47 ; 71 18f7e: 0e 94 0a 75 call 0xea14 ; 0xea14 18f82: 6a ea ldi r22, 0xAA ; 170 18f84: 7c ed ldi r23, 0xDC ; 220 } 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); 18f86: 0e 94 c3 72 call 0xe586 ; 0xe586 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 18f8a: 0e 94 10 66 call 0xcc20 ; 0xcc20 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 18f8e: 81 11 cpse r24, r1 18f90: 08 c0 rjmp .+16 ; 0x18fa2 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())) 18f92: 0e 94 05 66 call 0xcc0a ; 0xcc0a 18f96: 81 11 cpse r24, r1 18f98: 04 c0 rjmp .+8 ; 0x18fa2 18f9a: 0e 94 fb 65 call 0xcbf6 ; 0xcbf6 18f9e: 88 23 and r24, r24 18fa0: 81 f0 breq .+32 ; 0x18fc2 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 18fa2: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 18fa6: 81 30 cpi r24, 0x01 ; 1 18fa8: 61 f0 breq .+24 ; 0x18fc2 18faa: 80 91 91 03 lds r24, 0x0391 ; 0x800391 18fae: 81 11 cpse r24, r1 18fb0: 08 c0 rjmp .+16 ; 0x18fc2 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 18fb2: 81 e5 ldi r24, 0x51 ; 81 18fb4: 98 e4 ldi r25, 0x48 ; 72 18fb6: 0e 94 0a 75 call 0xea14 ; 0xea14 18fba: 66 e1 ldi r22, 0x16 ; 22 18fbc: 70 ec ldi r23, 0xC0 ; 192 18fbe: 0e 94 c3 72 call 0xe586 ; 0xe586 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() 18fc2: 0e 94 fb 65 call 0xcbf6 ; 0xcbf6 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18fc6: 81 11 cpse r24, r1 18fc8: 95 c0 rjmp .+298 ; 0x190f4 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() 18fca: 0e 94 61 66 call 0xccc2 ; 0xccc2 18fce: 81 11 cpse r24, r1 18fd0: 91 c0 rjmp .+290 ; 0x190f4 18fd2: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 18fd6: 81 11 cpse r24, r1 18fd8: 8d c0 rjmp .+282 ; 0x190f4 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18fda: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18fde: 82 30 cpi r24, 0x02 ; 2 18fe0: 09 f4 brne .+2 ; 0x18fe4 18fe2: 88 c0 rjmp .+272 ; 0x190f4 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 18fe4: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 18fe8: 81 11 cpse r24, r1 18fea: 05 c0 rjmp .+10 ; 0x18ff6 || lcd_commands_type != LcdCommands::Idle) { 18fec: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 18ff0: 88 23 and r24, r24 18ff2: 09 f4 brne .+2 ; 0x18ff6 18ff4: ce c0 rjmp .+412 ; 0x19192 if (!card.isFileOpen()) { 18ff6: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 18ffa: 81 11 cpse r24, r1 18ffc: 12 c0 rjmp .+36 ; 0x19022 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 18ffe: 80 91 42 12 lds r24, 0x1242 ; 0x801242 19002: 81 11 cpse r24, r1 19004: 0e c0 rjmp .+28 ; 0x19022 19006: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1900a: 81 11 cpse r24, r1 1900c: 0a c0 rjmp .+20 ; 0x19022 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1900e: d0 93 c9 03 sts 0x03C9, r29 ; 0x8003c9 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 19012: 80 e4 ldi r24, 0x40 ; 64 19014: 97 e4 ldi r25, 0x47 ; 71 19016: 0e 94 0a 75 call 0xea14 ; 0xea14 1901a: 61 e9 ldi r22, 0x91 ; 145 1901c: 73 ee ldi r23, 0xE3 ; 227 1901e: 0e 94 c3 72 call 0xe586 ; 0xe586 #if SDCARDDETECT < 1 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) { 19022: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19026: 81 11 cpse r24, r1 19028: 12 c0 rjmp .+36 ; 0x1904e const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 1902a: 81 ea ldi r24, 0xA1 ; 161 1902c: 9d e0 ldi r25, 0x0D ; 13 1902e: 0f 94 9d a3 call 0x3473a ; 0x3473a 19032: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 19034: 0e 94 66 78 call 0xf0cc ; 0xf0cc if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 19038: 87 fd sbrc r24, 7 1903a: 09 c0 rjmp .+18 ; 0x1904e 1903c: c8 17 cp r28, r24 1903e: 39 f0 breq .+14 ; 0x1904e MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 19040: c1 02 muls r28, r17 19042: c0 01 movw r24, r0 19044: 11 24 eor r1, r1 19046: 87 5b subi r24, 0xB7 ; 183 19048: 92 4f sbci r25, 0xF2 ; 242 1904a: 0e 94 20 bc call 0x17840 ; 0x17840 SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1904e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 19052: 81 11 cpse r24, r1 19054: 4f c0 rjmp .+158 ; 0x190f4 19056: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 1905a: 81 11 cpse r24, r1 1905c: 4b c0 rjmp .+150 ; 0x190f4 if (MMU2::mmu2.Enabled()) { 1905e: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19062: 81 30 cpi r24, 0x01 ; 1 19064: 09 f0 breq .+2 ; 0x19068 19066: 9e c0 rjmp .+316 ; 0x191a4 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 19068: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 1906c: 81 11 cpse r24, r1 1906e: 0c c0 rjmp .+24 ; 0x19088 19070: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 19074: 81 11 cpse r24, r1 19076: 08 c0 rjmp .+16 ; 0x19088 // 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); 19078: 82 e2 ldi r24, 0x22 ; 34 1907a: 97 e4 ldi r25, 0x47 ; 71 1907c: 0e 94 0a 75 call 0xea14 ; 0xea14 19080: 63 e8 ldi r22, 0x83 ; 131 19082: 7d ec ldi r23, 0xCD ; 205 19084: 0e 94 c3 72 call 0xe586 ; 0xe586 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 19088: 81 e1 ldi r24, 0x11 ; 17 1908a: 97 e4 ldi r25, 0x47 ; 71 1908c: 0e 94 0a 75 call 0xea14 ; 0xea14 19090: 6a eb ldi r22, 0xBA ; 186 19092: 7d ec ldi r23, 0xCD ; 205 19094: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 19098: 8f ef ldi r24, 0xFF ; 255 1909a: 96 e4 ldi r25, 0x46 ; 70 1909c: 0e 94 0a 75 call 0xea14 ; 0xea14 190a0: 6d eb ldi r22, 0xBD ; 189 190a2: 7d ec ldi r23, 0xCD ; 205 190a4: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 190a8: 8c ed ldi r24, 0xDC ; 220 190aa: 91 e6 ldi r25, 0x61 ; 97 190ac: 0e 94 0a 75 call 0xea14 ; 0xea14 190b0: 60 ec ldi r22, 0xC0 ; 192 190b2: 7d ec ldi r23, 0xCD ; 205 190b4: 0e 94 c3 72 call 0xe586 ; 0xe586 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 190b8: 8e ec ldi r24, 0xCE ; 206 190ba: 9e e0 ldi r25, 0x0E ; 14 190bc: 0f 94 9d a3 call 0x3473a ; 0x3473a 190c0: 88 23 and r24, r24 190c2: 41 f0 breq .+16 ; 0x190d4 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 190c4: 8d ec ldi r24, 0xCD ; 205 190c6: 91 e6 ldi r25, 0x61 ; 97 190c8: 0e 94 0a 75 call 0xea14 ; 0xea14 190cc: 63 ec ldi r22, 0xC3 ; 195 190ce: 7d ec ldi r23, 0xCD ; 205 } #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); 190d0: 0e 94 c3 72 call 0xe586 ; 0xe586 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 190d4: 8b e3 ldi r24, 0x3B ; 59 190d6: 98 e4 ldi r25, 0x48 ; 72 190d8: 0e 94 0a 75 call 0xea14 ; 0xea14 190dc: 66 ed ldi r22, 0xD6 ; 214 190de: 7a ec ldi r23, 0xCA ; 202 190e0: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 190e4: 8d ec ldi r24, 0xCD ; 205 190e6: 96 e4 ldi r25, 0x46 ; 70 190e8: 0e 94 0a 75 call 0xea14 ; 0xea14 190ec: 62 e3 ldi r22, 0x32 ; 50 190ee: 7c ec ldi r23, 0xCC ; 204 190f0: 0e 94 c3 72 call 0xe586 ; 0xe586 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 190f4: 80 ec ldi r24, 0xC0 ; 192 190f6: 96 e4 ldi r25, 0x46 ; 70 190f8: 0e 94 0a 75 call 0xea14 ; 0xea14 190fc: 60 e4 ldi r22, 0x40 ; 64 190fe: 77 e3 ldi r23, 0x37 ; 55 19100: 0e 94 c3 72 call 0xe586 ; 0xe586 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 19104: 83 eb ldi r24, 0xB3 ; 179 19106: 96 e4 ldi r25, 0x46 ; 70 19108: 0e 94 0a 75 call 0xea14 ; 0xea14 1910c: 6a ee ldi r22, 0xEA ; 234 1910e: 77 e3 ldi r23, 0x37 ; 55 19110: 0e 94 c3 72 call 0xe586 ; 0xe586 #endif if (MMU2::mmu2.Enabled()) { 19114: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19118: 81 30 cpi r24, 0x01 ; 1 1911a: 41 f4 brne .+16 ; 0x1912c MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1911c: 82 ea ldi r24, 0xA2 ; 162 1911e: 96 e4 ldi r25, 0x46 ; 70 19120: 0e 94 0a 75 call 0xea14 ; 0xea14 19124: 6c ea ldi r22, 0xAC ; 172 19126: 78 e3 ldi r23, 0x38 ; 56 19128: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 1912c: 88 e9 ldi r24, 0x98 ; 152 1912e: 96 e4 ldi r25, 0x46 ; 70 19130: 0e 94 0a 75 call 0xea14 ; 0xea14 19134: 6c e5 ldi r22, 0x5C ; 92 19136: 78 e3 ldi r23, 0x38 ; 56 19138: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_END(); 1913c: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 19140: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19144: 8f 5f subi r24, 0xFF ; 255 19146: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1914a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1914e: 8f 5f subi r24, 0xFF ; 255 19150: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19154: 49 ce rjmp .-878 ; 0x18de8 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); 19156: 8d e6 ldi r24, 0x6D ; 109 19158: 97 e4 ldi r25, 0x47 ; 71 1915a: ba ce rjmp .-652 ; 0x18ed0 } } 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) { 1915c: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 19160: 88 23 and r24, r24 19162: 09 f4 brne .+2 ; 0x19166 19164: f0 ce rjmp .-544 ; 0x18f46 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 19166: 8f e5 ldi r24, 0x5F ; 95 19168: 97 e4 ldi r25, 0x47 ; 71 1916a: 0e 94 0a 75 call 0xea14 ; 0xea14 1916e: 6e e4 ldi r22, 0x4E ; 78 19170: 78 e3 ldi r23, 0x38 ; 56 19172: e7 ce rjmp .-562 ; 0x18f42 #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())) { 19174: 81 30 cpi r24, 0x01 ; 1 19176: 09 f0 breq .+2 ; 0x1917a 19178: 08 cf rjmp .-496 ; 0x18f8a 1917a: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.422> 1917e: 88 23 and r24, r24 19180: 09 f4 brne .+2 ; 0x19184 19182: 03 cf rjmp .-506 ; 0x18f8a MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 19184: 80 e5 ldi r24, 0x50 ; 80 19186: 97 e4 ldi r25, 0x47 ; 71 19188: 0e 94 0a 75 call 0xea14 ; 0xea14 1918c: 6c e7 ldi r22, 0x7C ; 124 1918e: 7c ed ldi r23, 0xDC ; 220 19190: fa ce rjmp .-524 ; 0x18f86 #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 19192: d0 93 c9 03 sts 0x03C9, r29 ; 0x8003c9 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 19196: 83 e3 ldi r24, 0x33 ; 51 19198: 97 e4 ldi r25, 0x47 ; 71 1919a: 0e 94 0a 75 call 0xea14 ; 0xea14 1919e: 0e 94 9e 72 call 0xe53c ; 0xe53c 191a2: 3f cf rjmp .-386 ; 0x19022 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 191a4: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 191a8: 88 23 and r24, r24 191aa: 19 f1 breq .+70 ; 0x191f2 if (!fsensor.getAutoLoadEnabled()) { 191ac: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 191b0: 81 11 cpse r24, r1 191b2: 08 c0 rjmp .+16 ; 0x191c4 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 191b4: 8f ee ldi r24, 0xEF ; 239 191b6: 96 e4 ldi r25, 0x46 ; 70 191b8: 0e 94 0a 75 call 0xea14 ; 0xea14 191bc: 66 e7 ldi r22, 0x76 ; 118 191be: 78 e3 ldi r23, 0x38 ; 56 191c0: 0e 94 c3 72 call 0xe586 ; 0xe586 } if (fsensor.getFilamentPresent()) { 191c4: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 191c8: 88 23 and r24, r24 191ca: 39 f0 breq .+14 ; 0x191da } #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); 191cc: 8f ef ldi r24, 0xFF ; 255 191ce: 96 e4 ldi r25, 0x46 ; 70 191d0: 0e 94 0a 75 call 0xea14 ; 0xea14 191d4: 6c ea ldi r22, 0xAC ; 172 191d6: 77 e3 ldi r23, 0x37 ; 55 191d8: 7b cf rjmp .-266 ; 0x190d0 if (fsensor.getFilamentPresent()) { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } #ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY else { if (fsensor.getAutoLoadEnabled()) { 191da: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 191de: 88 23 and r24, r24 191e0: 09 f4 brne .+2 ; 0x191e4 191e2: 78 cf rjmp .-272 ; 0x190d4 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 191e4: 8b ed ldi r24, 0xDB ; 219 191e6: 96 e4 ldi r25, 0x46 ; 70 191e8: 0e 94 0a 75 call 0xea14 ; 0xea14 191ec: 60 eb ldi r22, 0xB0 ; 176 191ee: 78 e3 ldi r23, 0x38 ; 56 191f0: 6f cf rjmp .-290 ; 0x190d0 } } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 191f2: 8f ee ldi r24, 0xEF ; 239 191f4: 96 e4 ldi r25, 0x46 ; 70 191f6: 0e 94 0a 75 call 0xea14 ; 0xea14 191fa: 66 e7 ldi r22, 0x76 ; 118 191fc: 78 e3 ldi r23, 0x38 ; 56 191fe: 0e 94 c3 72 call 0xe586 ; 0xe586 19202: e4 cf rjmp .-56 ; 0x191cc #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 19204: df 91 pop r29 19206: cf 91 pop r28 19208: 1f 91 pop r17 1920a: 08 95 ret 0001920c : } #endif // TMC2130 } } static void menuitems_temperature_common() { 1920c: ef 92 push r14 1920e: ff 92 push r15 19210: 0f 93 push r16 19212: 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); 19214: 89 e8 ldi r24, 0x89 ; 137 19216: 94 e4 ldi r25, 0x44 ; 68 19218: 0e 94 0a 75 call 0xea14 ; 0xea14 1921c: 28 ec ldi r18, 0xC8 ; 200 1921e: e2 2e mov r14, r18 19220: f1 2c mov r15, r1 19222: 07 e2 ldi r16, 0x27 ; 39 19224: 11 e0 ldi r17, 0x01 ; 1 19226: 30 e0 ldi r19, 0x00 ; 0 19228: 20 e0 ldi r18, 0x00 ; 0 1922a: 40 e1 ldi r20, 0x10 ; 16 1922c: 6d e5 ldi r22, 0x5D ; 93 1922e: 72 e1 ldi r23, 0x12 ; 18 19230: 0e 94 3e 6f call 0xde7c ; 0xde7c #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); 19234: 8e e6 ldi r24, 0x6E ; 110 19236: 94 e4 ldi r25, 0x44 ; 68 19238: 0e 94 0a 75 call 0xea14 ; 0xea14 1923c: 32 e3 ldi r19, 0x32 ; 50 1923e: e3 2e mov r14, r19 19240: f1 2c mov r15, r1 19242: 08 e7 ldi r16, 0x78 ; 120 19244: 10 e0 ldi r17, 0x00 ; 0 19246: 30 e0 ldi r19, 0x00 ; 0 19248: 20 e0 ldi r18, 0x00 ; 0 1924a: 40 e1 ldi r20, 0x10 ; 16 1924c: 69 e5 ldi r22, 0x59 ; 89 1924e: 72 e1 ldi r23, 0x12 ; 18 19250: 0e 94 3e 6f call 0xde7c ; 0xde7c #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 19254: 82 e6 ldi r24, 0x62 ; 98 19256: 94 e4 ldi r25, 0x44 ; 68 19258: 0e 94 0a 75 call 0xea14 ; 0xea14 1925c: 4f e7 ldi r20, 0x7F ; 127 1925e: e4 2e mov r14, r20 19260: f1 2c mov r15, r1 19262: 0f ef ldi r16, 0xFF ; 255 19264: 10 e0 ldi r17, 0x00 ; 0 19266: 30 e0 ldi r19, 0x00 ; 0 19268: 20 e0 ldi r18, 0x00 ; 0 1926a: 48 e0 ldi r20, 0x08 ; 8 1926c: 65 e5 ldi r22, 0x55 ; 85 1926e: 72 e1 ldi r23, 0x12 ; 18 19270: 0e 94 3e 6f call 0xde7c ; 0xde7c } 19274: 1f 91 pop r17 19276: 0f 91 pop r16 19278: ff 90 pop r15 1927a: ef 90 pop r14 1927c: 08 95 ret 0001927e : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1927e: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 19282: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19286: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1928a: 84 30 cpi r24, 0x04 ; 4 1928c: b8 f4 brcc .+46 ; 0x192bc 1928e: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 19292: 8b e3 ldi r24, 0x3B ; 59 19294: 98 e4 ldi r25, 0x48 ; 72 19296: 0e 94 0a 75 call 0xea14 ; 0xea14 1929a: 0e 94 9e 72 call 0xe53c ; 0xe53c menuitems_temperature_common(); 1929e: 0e 94 06 c9 call 0x1920c ; 0x1920c MENU_END(); 192a2: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 192a6: 80 91 60 04 lds r24, 0x0460 ; 0x800460 192aa: 8f 5f subi r24, 0xFF ; 255 192ac: 80 93 60 04 sts 0x0460, r24 ; 0x800460 192b0: 80 91 62 04 lds r24, 0x0462 ; 0x800462 192b4: 8f 5f subi r24, 0xFF ; 255 192b6: 80 93 62 04 sts 0x0462, r24 ; 0x800462 192ba: e5 cf rjmp .-54 ; 0x19286 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 192bc: 08 95 ret 000192be : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 192be: ef 92 push r14 192c0: ff 92 push r15 192c2: 0f 93 push r16 192c4: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 192c6: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 192ca: 81 11 cpse r24, r1 192cc: 35 c0 rjmp .+106 ; 0x19338 { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 192ce: 80 ec ldi r24, 0xC0 ; 192 192d0: 9f e0 ldi r25, 0x0F ; 15 192d2: 0f 94 9d a3 call 0x3473a ; 0x3473a 192d6: 81 30 cpi r24, 0x01 ; 1 192d8: 61 f5 brne .+88 ; 0x19332 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 192da: 8f eb ldi r24, 0xBF ; 191 192dc: 9f e0 ldi r25, 0x0F ; 15 192de: 0f 94 9d a3 call 0x3473a ; 0x3473a 192e2: 08 2e mov r0, r24 192e4: 00 0c add r0, r0 192e6: 99 0b sbc r25, r25 192e8: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 192ec: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 192f0: 8e eb ldi r24, 0xBE ; 190 192f2: 9f e0 ldi r25, 0x0F ; 15 192f4: 0f 94 9d a3 call 0x3473a ; 0x3473a 192f8: 08 2e mov r0, r24 192fa: 00 0c add r0, r0 192fc: 99 0b sbc r25, r25 192fe: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 19302: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 19306: 8d eb ldi r24, 0xBD ; 189 19308: 9f e0 ldi r25, 0x0F ; 15 1930a: 0f 94 9d a3 call 0x3473a ; 0x3473a 1930e: 08 2e mov r0, r24 19310: 00 0c add r0, r0 19312: 99 0b sbc r25, r25 19314: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 19318: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 1931c: 8c eb ldi r24, 0xBC ; 188 1931e: 9f e0 ldi r25, 0x0F ; 15 19320: 0f 94 9d a3 call 0x3473a ; 0x3473a 19324: 08 2e mov r0, r24 19326: 00 0c add r0, r0 19328: 99 0b sbc r25, r25 1932a: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 1932e: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } _md->status = 1; 19332: 81 e0 ldi r24, 0x01 ; 1 19334: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 } MENU_BEGIN(); 19338: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 1933c: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19340: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19344: 84 30 cpi r24, 0x04 ; 4 19346: 08 f0 brcs .+2 ; 0x1934a 19348: 6e c0 rjmp .+220 ; 0x19426 1934a: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 1934e: 0e 94 1c 62 call 0xc438 ; 0xc438 19352: 88 23 and r24, r24 19354: e9 f0 breq .+58 ; 0x19390 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 19356: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 1935a: 8f eb ldi r24, 0xBF ; 191 1935c: 9f e0 ldi r25, 0x0F ; 15 1935e: 0f 94 c1 a3 call 0x34782 ; 0x34782 19362: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 19366: 8d eb ldi r24, 0xBD ; 189 19368: 9f e0 ldi r25, 0x0F ; 15 1936a: 0f 94 c1 a3 call 0x34782 ; 0x34782 1936e: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 19372: 8c eb ldi r24, 0xBC ; 188 19374: 9f e0 ldi r25, 0x0F ; 15 19376: 0f 94 c1 a3 call 0x34782 ; 0x34782 1937a: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 1937e: 8e eb ldi r24, 0xBE ; 190 19380: 9f e0 ldi r25, 0x0F ; 15 19382: 0f 94 c1 a3 call 0x34782 ; 0x34782 19386: 61 e0 ldi r22, 0x01 ; 1 19388: 80 ec ldi r24, 0xC0 ; 192 1938a: 9f e0 ldi r25, 0x0F ; 15 1938c: 0f 94 c1 a3 call 0x34782 ; 0x34782 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)); 19390: 85 e9 ldi r24, 0x95 ; 149 19392: 9a e4 ldi r25, 0x4A ; 74 19394: 0e 94 0a 75 call 0xea14 ; 0xea14 19398: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1939c: 84 ec ldi r24, 0xC4 ; 196 1939e: 9a e3 ldi r25, 0x3A ; 58 193a0: 0e 94 0a 75 call 0xea14 ; 0xea14 193a4: f1 2c mov r15, r1 193a6: e1 2c mov r14, r1 193a8: 04 e6 ldi r16, 0x64 ; 100 193aa: 10 e0 ldi r17, 0x00 ; 0 193ac: 2c e9 ldi r18, 0x9C ; 156 193ae: 3f ef ldi r19, 0xFF ; 255 193b0: 40 e1 ldi r20, 0x10 ; 16 193b2: 64 ea ldi r22, 0xA4 ; 164 193b4: 73 e0 ldi r23, 0x03 ; 3 193b6: 0e 94 3e 6f call 0xde7c ; 0xde7c MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193ba: 83 eb ldi r24, 0xB3 ; 179 193bc: 9a e3 ldi r25, 0x3A ; 58 193be: 0e 94 0a 75 call 0xea14 ; 0xea14 193c2: 2c e9 ldi r18, 0x9C ; 156 193c4: 3f ef ldi r19, 0xFF ; 255 193c6: 40 e1 ldi r20, 0x10 ; 16 193c8: 66 ea ldi r22, 0xA6 ; 166 193ca: 73 e0 ldi r23, 0x03 ; 3 193cc: 0e 94 3e 6f call 0xde7c ; 0xde7c MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193d0: 82 ea ldi r24, 0xA2 ; 162 193d2: 9a e3 ldi r25, 0x3A ; 58 193d4: 0e 94 0a 75 call 0xea14 ; 0xea14 193d8: 2c e9 ldi r18, 0x9C ; 156 193da: 3f ef ldi r19, 0xFF ; 255 193dc: 40 e1 ldi r20, 0x10 ; 16 193de: 68 ea ldi r22, 0xA8 ; 168 193e0: 73 e0 ldi r23, 0x03 ; 3 193e2: 0e 94 3e 6f call 0xde7c ; 0xde7c MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193e6: 81 e9 ldi r24, 0x91 ; 145 193e8: 9a e3 ldi r25, 0x3A ; 58 193ea: 0e 94 0a 75 call 0xea14 ; 0xea14 193ee: 2c e9 ldi r18, 0x9C ; 156 193f0: 3f ef ldi r19, 0xFF ; 255 193f2: 40 e1 ldi r20, 0x10 ; 16 193f4: 6a ea ldi r22, 0xAA ; 170 193f6: 73 e0 ldi r23, 0x03 ; 3 193f8: 0e 94 3e 6f call 0xde7c ; 0xde7c MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 193fc: 8c e5 ldi r24, 0x5C ; 92 193fe: 96 e4 ldi r25, 0x46 ; 70 19400: 0e 94 0a 75 call 0xea14 ; 0xea14 19404: 6a ed ldi r22, 0xDA ; 218 19406: 7e ec ldi r23, 0xCE ; 206 19408: 0e 94 6d 72 call 0xe4da ; 0xe4da MENU_END(); 1940c: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 _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(); 19410: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19414: 8f 5f subi r24, 0xFF ; 255 19416: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1941a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1941e: 8f 5f subi r24, 0xFF ; 255 19420: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19424: 8d cf rjmp .-230 ; 0x19340 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(); } 19426: 1f 91 pop r17 19428: 0f 91 pop r16 1942a: ff 90 pop r15 1942c: ef 90 pop r14 1942e: 08 95 ret 00019430 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 19430: ef 92 push r14 19432: ff 92 push r15 19434: 0f 93 push r16 19436: 1f 93 push r17 19438: cf 93 push r28 1943a: df 93 push r29 1943c: 80 91 75 02 lds r24, 0x0275 ; 0x800275 19440: 90 91 76 02 lds r25, 0x0276 ; 0x800276 //! 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) 19444: 20 91 a3 03 lds r18, 0x03A3 ; 0x8003a3 19448: 21 11 cpse r18, r1 1944a: 91 c0 rjmp .+290 ; 0x1956e { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1944c: 21 e0 ldi r18, 0x01 ; 1 1944e: 20 93 a3 03 sts 0x03A3, r18 ; 0x8003a3 _md->extrudemultiply = extrudemultiply; 19452: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 19456: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 // 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); 1945a: 8f ef ldi r24, 0xFF ; 255 1945c: 9f e0 ldi r25, 0x0F ; 15 1945e: 0f 94 9d a3 call 0x3473a ; 0x3473a 19462: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb MENU_BEGIN(); 19466: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 1946a: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1946e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19472: 84 30 cpi r24, 0x04 ; 4 19474: 08 f0 brcs .+2 ; 0x19478 19476: 93 c0 rjmp .+294 ; 0x1959e 19478: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 1947c: 0e 94 1c 62 call 0xc438 ; 0xc438 19480: 81 11 cpse r24, r1 19482: 0e 94 0d 64 call 0xc81a ; 0xc81a refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19486: 8c e8 ldi r24, 0x8C ; 140 19488: 98 e4 ldi r25, 0x48 ; 72 1948a: 0e 94 0a 75 call 0xea14 ; 0xea14 1948e: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 19492: 88 e0 ldi r24, 0x08 ; 8 19494: 98 e4 ldi r25, 0x48 ; 72 19496: 0e 94 0a 75 call 0xea14 ; 0xea14 1949a: f1 2c mov r15, r1 1949c: e1 2c mov r14, r1 1949e: 07 ee ldi r16, 0xE7 ; 231 194a0: 13 e0 ldi r17, 0x03 ; 3 194a2: 2a e0 ldi r18, 0x0A ; 10 194a4: 30 e0 ldi r19, 0x00 ; 0 194a6: 40 e1 ldi r20, 0x10 ; 16 194a8: 6e e8 ldi r22, 0x8E ; 142 194aa: 72 e0 ldi r23, 0x02 ; 2 194ac: 0e 94 3e 6f call 0xde7c ; 0xde7c menuitems_temperature_common(); 194b0: 0e 94 06 c9 call 0x1920c ; 0x1920c MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 194b4: 81 e0 ldi r24, 0x01 ; 1 194b6: 98 e4 ldi r25, 0x48 ; 72 194b8: 0e 94 0a 75 call 0xea14 ; 0xea14 194bc: 2a e0 ldi r18, 0x0A ; 10 194be: 30 e0 ldi r19, 0x00 ; 0 194c0: 40 e1 ldi r20, 0x10 ; 16 194c2: 65 e7 ldi r22, 0x75 ; 117 194c4: 72 e0 ldi r23, 0x02 ; 2 194c6: 0e 94 3e 6f call 0xde7c ; 0xde7c #ifdef LA_LIVE_K MENU_ITEM_EDIT_advance_K(); #endif #ifdef FILAMENTCHANGEENABLE if (!farm_mode) 194ca: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 194ce: 81 11 cpse r24, r1 194d0: 08 c0 rjmp .+16 ; 0x194e2 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); 194d2: 8f ee ldi r24, 0xEF ; 239 194d4: 97 e4 ldi r25, 0x47 ; 71 194d6: 0e 94 0a 75 call 0xea14 ; 0xea14 194da: 66 e9 ldi r22, 0x96 ; 150 194dc: 7c ed ldi r23, 0xDC ; 220 194de: 0e 94 6d 72 call 0xe4da ; 0xe4da #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 194e2: 0e 94 05 66 call 0xcc0a ; 0xcc0a 194e6: 88 23 and r24, r24 194e8: 41 f0 breq .+16 ; 0x194fa MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 194ea: 81 ec ldi r24, 0xC1 ; 193 194ec: 91 e6 ldi r25, 0x61 ; 97 194ee: 0e 94 0a 75 call 0xea14 ; 0xea14 194f2: 67 e9 ldi r22, 0x97 ; 151 194f4: 73 e8 ldi r23, 0x83 ; 131 194f6: 0e 94 59 8d call 0x11ab2 ; 0x11ab2 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 194fa: 81 ee ldi r24, 0xE1 ; 225 194fc: 97 e4 ldi r25, 0x47 ; 71 194fe: 0e 94 0a 75 call 0xea14 ; 0xea14 19502: 63 e5 ldi r22, 0x53 ; 83 19504: 70 ec ldi r23, 0xC0 ; 192 19506: 0e 94 c3 72 call 0xe586 ; 0xe586 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1950a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1950e: 81 30 cpi r24, 0x01 ; 1 19510: 11 f4 brne .+4 ; 0x19516 { menuitems_MMU_settings_common(); 19512: 0e 94 1b bf call 0x17e36 ; 0x17e36 } SETTINGS_FANS_CHECK(); 19516: 0e 94 01 bf call 0x17e02 ; 0x17e02 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 1951a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1951e: 81 11 cpse r24, r1 19520: 02 c0 rjmp .+4 ; 0x19526 19522: 0e 94 e0 be call 0x17dc0 ; 0x17dc0 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 19526: 80 91 47 04 lds r24, 0x0447 ; 0x800447 1952a: 82 30 cpi r24, 0x02 ; 2 1952c: 91 f1 breq .+100 ; 0x19592 1952e: 83 30 cpi r24, 0x03 ; 3 19530: 99 f1 breq .+102 ; 0x19598 19532: 81 30 cpi r24, 0x01 ; 1 19534: 59 f1 breq .+86 ; 0x1958c 19536: 8a ed ldi r24, 0xDA ; 218 19538: 97 e4 ldi r25, 0x47 ; 71 1953a: 0e 94 0a 75 call 0xea14 ; 0xea14 1953e: ec 01 movw r28, r24 19540: 82 ed ldi r24, 0xD2 ; 210 19542: 97 e4 ldi r25, 0x47 ; 71 19544: 0e 94 0a 75 call 0xea14 ; 0xea14 19548: 22 e0 ldi r18, 0x02 ; 2 1954a: 45 e8 ldi r20, 0x85 ; 133 1954c: 5d eb ldi r21, 0xBD ; 189 1954e: be 01 movw r22, r28 19550: 0e 94 2e 75 call 0xea5c ; 0xea5c if (backlightSupport) { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); 19554: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 19558: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1955c: 8f 5f subi r24, 0xFF ; 255 1955e: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19562: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19566: 8f 5f subi r24, 0xFF ; 255 19568: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1956c: 80 cf rjmp .-256 ; 0x1946e { // 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) 1956e: 20 91 a4 03 lds r18, 0x03A4 ; 0x8003a4 19572: 30 91 a5 03 lds r19, 0x03A5 ; 0x8003a5 19576: 28 17 cp r18, r24 19578: 39 07 cpc r19, r25 1957a: 09 f4 brne .+2 ; 0x1957e 1957c: 6e cf rjmp .-292 ; 0x1945a { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1957e: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 19582: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 calculate_extruder_multipliers(); 19586: 0e 94 1a 64 call 0xc834 ; 0xc834 1958a: 67 cf rjmp .-306 ; 0x1945a menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1958c: 8b ec ldi r24, 0xCB ; 203 1958e: 97 e4 ldi r25, 0x47 ; 71 19590: d4 cf rjmp .-88 ; 0x1953a 19592: 89 ea ldi r24, 0xA9 ; 169 19594: 9a e4 ldi r25, 0x4A ; 74 19596: d1 cf rjmp .-94 ; 0x1953a 19598: 82 ec ldi r24, 0xC2 ; 194 1959a: 97 e4 ldi r25, 0x47 ; 71 1959c: ce cf rjmp .-100 ; 0x1953a { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1959e: df 91 pop r29 195a0: cf 91 pop r28 195a2: 1f 91 pop r17 195a4: 0f 91 pop r16 195a6: ff 90 pop r15 195a8: ef 90 pop r14 195aa: 08 95 ret 000195ac : MENU_END(); } static void lcd_settings_menu() { 195ac: 1f 93 push r17 195ae: cf 93 push r28 195b0: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 195b2: 8f ef ldi r24, 0xFF ; 255 195b4: 9f e0 ldi r25, 0x0F ; 15 195b6: 0f 94 9d a3 call 0x3473a ; 0x3473a 195ba: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb MENU_BEGIN(); 195be: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 195c2: 10 92 60 04 sts 0x0460, r1 ; 0x800460 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 195c6: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 195c8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 195cc: 84 30 cpi r24, 0x04 ; 4 195ce: 08 f0 brcs .+2 ; 0x195d2 195d0: 45 c1 rjmp .+650 ; 0x1985c 195d2: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 195d6: 8c e8 ldi r24, 0x8C ; 140 195d8: 98 e4 ldi r25, 0x48 ; 72 195da: 0e 94 0a 75 call 0xea14 ; 0xea14 195de: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 195e2: 8b e6 ldi r24, 0x6B ; 107 195e4: 95 e4 ldi r25, 0x45 ; 69 195e6: 0e 94 0a 75 call 0xea14 ; 0xea14 195ea: 6f e3 ldi r22, 0x3F ; 63 195ec: 79 ec ldi r23, 0xC9 ; 201 195ee: 0e 94 c3 72 call 0xe586 ; 0xe586 if (!printer_active() || printingIsPaused()) 195f2: 0e 94 61 66 call 0xccc2 ; 0xccc2 195f6: 88 23 and r24, r24 195f8: 21 f0 breq .+8 ; 0x19602 195fa: 0e 94 05 66 call 0xcc0a ; 0xcc0a 195fe: 88 23 and r24, r24 19600: 81 f0 breq .+32 ; 0x19622 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 19602: 8f e5 ldi r24, 0x5F ; 95 19604: 95 e4 ldi r25, 0x45 ; 69 19606: 0e 94 0a 75 call 0xea14 ; 0xea14 1960a: 6e e8 ldi r22, 0x8E ; 142 1960c: 71 ec ldi r23, 0xC1 ; 193 1960e: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 19612: 8c e4 ldi r24, 0x4C ; 76 19614: 95 e4 ldi r25, 0x45 ; 69 19616: 0e 94 0a 75 call 0xea14 ; 0xea14 1961a: 6a e8 ldi r22, 0x8A ; 138 1961c: 78 e6 ldi r23, 0x68 ; 104 1961e: 0e 94 59 8d call 0x11ab2 ; 0x11ab2 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 19622: 81 ee ldi r24, 0xE1 ; 225 19624: 97 e4 ldi r25, 0x47 ; 71 19626: 0e 94 0a 75 call 0xea14 ; 0xea14 1962a: 63 e5 ldi r22, 0x53 ; 83 1962c: 70 ec ldi r23, 0xC0 ; 192 1962e: 0e 94 c3 72 call 0xe586 ; 0xe586 #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); 19632: 8c ea ldi r24, 0xAC ; 172 19634: 9c e0 ldi r25, 0x0C ; 12 19636: 0f 94 9d a3 call 0x3473a ; 0x3473a 1963a: 88 23 and r24, r24 1963c: 09 f4 brne .+2 ; 0x19640 1963e: 91 c0 rjmp .+290 ; 0x19762 19640: 8a e9 ldi r24, 0x9A ; 154 19642: 92 e6 ldi r25, 0x62 ; 98 19644: 0e 94 0a 75 call 0xea14 ; 0xea14 19648: 22 e0 ldi r18, 0x02 ; 2 1964a: 43 e2 ldi r20, 0x23 ; 35 1964c: 5e eb ldi r21, 0xBE ; 190 1964e: bc 01 movw r22, r24 19650: 88 e7 ldi r24, 0x78 ; 120 19652: 93 e8 ldi r25, 0x83 ; 131 19654: 0e 94 2e 75 call 0xea5c ; 0xea5c if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 19658: 8c ea ldi r24, 0xAC ; 172 1965a: 9c e0 ldi r25, 0x0C ; 12 1965c: 0f 94 9d a3 call 0x3473a ; 0x3473a 19660: 88 23 and r24, r24 19662: 31 f0 breq .+12 ; 0x19670 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 19664: 68 e8 ldi r22, 0x88 ; 136 19666: 7e ec ldi r23, 0xCE ; 206 19668: 8e e6 ldi r24, 0x6E ; 110 1966a: 93 e8 ldi r25, 0x83 ; 131 1966c: 0e 94 6d 72 call 0xe4da ; 0xe4da } if (MMU2::mmu2.Enabled()) 19670: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19674: 81 30 cpi r24, 0x01 ; 1 19676: 51 f4 brne .+20 ; 0x1968c { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 19678: 0e 94 1b bf call 0x17e36 ; 0x17e36 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 1967c: 8d e3 ldi r24, 0x3D ; 61 1967e: 95 e4 ldi r25, 0x45 ; 69 19680: 0e 94 0a 75 call 0xea14 ; 0xea14 19684: 66 ec ldi r22, 0xC6 ; 198 19686: 7d ec ldi r23, 0xCD ; 205 19688: 0e 94 c3 72 call 0xe586 ; 0xe586 } SETTINGS_FANS_CHECK(); 1968c: 0e 94 01 bf call 0x17e02 ; 0x17e02 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 19690: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19694: 81 11 cpse r24, r1 19696: 02 c0 rjmp .+4 ; 0x1969c 19698: 0e 94 e0 be call 0x17dc0 ; 0x17dc0 } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) 1969c: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 196a0: 81 11 cpse r24, r1 196a2: 62 c0 rjmp .+196 ; 0x19768 { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 196a4: 10 93 ec 03 sts 0x03EC, r17 ; 0x8003ec MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 196a8: 82 e3 ldi r24, 0x32 ; 50 196aa: 95 e4 ldi r25, 0x45 ; 69 196ac: 0e 94 0a 75 call 0xea14 ; 0xea14 196b0: 6c e4 ldi r22, 0x4C ; 76 196b2: 7f eb ldi r23, 0xBF ; 191 196b4: 0e 94 c3 72 call 0xe586 ; 0xe586 } 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); 196b8: 81 ed ldi r24, 0xD1 ; 209 196ba: 95 e4 ldi r25, 0x45 ; 69 196bc: 0e 94 0a 75 call 0xea14 ; 0xea14 196c0: 64 ef ldi r22, 0xF4 ; 244 196c2: 77 ee ldi r23, 0xE7 ; 231 196c4: 0e 94 c3 72 call 0xe586 ; 0xe586 #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()) 196c8: 0f 94 90 10 call 0x22120 ; 0x22120 196cc: 88 23 and r24, r24 196ce: b1 f0 breq .+44 ; 0x196fc 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); 196d0: 8f ea ldi r24, 0xAF ; 175 196d2: 9f e0 ldi r25, 0x0F ; 15 196d4: 0f 94 9d a3 call 0x3473a ; 0x3473a 196d8: 88 23 and r24, r24 196da: 09 f4 brne .+2 ; 0x196de 196dc: 4e c0 rjmp .+156 ; 0x1977a 196de: 8a e9 ldi r24, 0x9A ; 154 196e0: 92 e6 ldi r25, 0x62 ; 98 196e2: 0e 94 0a 75 call 0xea14 ; 0xea14 196e6: ec 01 movw r28, r24 196e8: 89 e7 ldi r24, 0x79 ; 121 196ea: 95 e4 ldi r25, 0x45 ; 69 196ec: 0e 94 0a 75 call 0xea14 ; 0xea14 196f0: 22 e0 ldi r18, 0x02 ; 2 196f2: 4a e7 ldi r20, 0x7A ; 122 196f4: 5d eb ldi r21, 0xBD ; 189 196f6: be 01 movw r22, r28 196f8: 0e 94 2e 75 call 0xea5c ; 0xea5c #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); #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 196fc: 0e 94 05 66 call 0xcc0a ; 0xcc0a 19700: 81 11 cpse r24, r1 19702: 08 c0 rjmp .+16 ; 0x19714 19704: 8a e9 ldi r24, 0x9A ; 154 19706: 97 e4 ldi r25, 0x47 ; 71 19708: 0e 94 0a 75 call 0xea14 ; 0xea14 1970c: 69 e5 ldi r22, 0x59 ; 89 1970e: 75 ed ldi r23, 0xD5 ; 213 19710: 0e 94 c3 72 call 0xe586 ; 0xe586 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 19714: 80 e1 ldi r24, 0x10 ; 16 19716: 95 e4 ldi r25, 0x45 ; 69 19718: 0e 94 0a 75 call 0xea14 ; 0xea14 1971c: 67 e0 ldi r22, 0x07 ; 7 1971e: 77 ee ldi r23, 0xE7 ; 231 19720: 0e 94 c3 72 call 0xe586 ; 0xe586 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode 19724: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19728: 81 11 cpse r24, r1 1972a: 47 c0 rjmp .+142 ; 0x197ba if (card.ToshibaFlashAir_isEnabled()) 1972c: 80 91 48 16 lds r24, 0x1648 ; 0x801648 19730: 88 23 and r24, r24 19732: 31 f1 breq .+76 ; 0x19780 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 19734: 86 e0 ldi r24, 0x06 ; 6 19736: 95 e4 ldi r25, 0x45 ; 69 19738: 0e 94 0a 75 call 0xea14 ; 0xea14 1973c: 22 e0 ldi r18, 0x02 ; 2 1973e: 40 e7 ldi r20, 0x70 ; 112 19740: 5d eb ldi r21, 0xBD ; 189 19742: 69 e1 ldi r22, 0x19 ; 25 19744: 78 e6 ldi r23, 0x68 ; 104 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 19746: 0e 94 2e 75 call 0xea5c ; 0xea5c #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 1974a: 89 e0 ldi r24, 0x09 ; 9 1974c: 9f e0 ldi r25, 0x0F ; 15 1974e: 0f 94 9d a3 call 0x3473a ; 0x3473a 19752: 88 23 and r24, r24 19754: 19 f1 breq .+70 ; 0x1979c 19756: 81 30 cpi r24, 0x01 ; 1 19758: 09 f4 brne .+2 ; 0x1975c 1975a: 71 c0 rjmp .+226 ; 0x1983e 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); 1975c: 86 ed ldi r24, 0xD6 ; 214 1975e: 9a e4 ldi r25, 0x4A ; 74 19760: 1f c0 rjmp .+62 ; 0x197a0 #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); 19762: 84 e9 ldi r24, 0x94 ; 148 19764: 92 e6 ldi r25, 0x62 ; 98 19766: 6e cf rjmp .-292 ; 0x19644 if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); } else MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 19768: 82 e2 ldi r24, 0x22 ; 34 1976a: 95 e4 ldi r25, 0x45 ; 69 1976c: 0e 94 0a 75 call 0xea14 ; 0xea14 19770: 6d e3 ldi r22, 0x3D ; 61 19772: 79 ee ldi r23, 0xE9 ; 233 19774: 0e 94 6d 72 call 0xe4da ; 0xe4da 19778: 9f cf rjmp .-194 ; 0x196b8 #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); 1977a: 84 e9 ldi r24, 0x94 ; 148 1977c: 92 e6 ldi r25, 0x62 ; 98 1977e: b1 cf rjmp .-158 ; 0x196e2 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); 19780: 8d ef ldi r24, 0xFD ; 253 19782: 94 e4 ldi r25, 0x44 ; 68 19784: 0e 94 0a 75 call 0xea14 ; 0xea14 19788: ec 01 movw r28, r24 1978a: 86 e0 ldi r24, 0x06 ; 6 1978c: 95 e4 ldi r25, 0x45 ; 69 1978e: 0e 94 0a 75 call 0xea14 ; 0xea14 19792: 22 e0 ldi r18, 0x02 ; 2 19794: 40 e7 ldi r20, 0x70 ; 112 19796: 5d eb ldi r21, 0xBD ; 189 19798: be 01 movw r22, r28 1979a: d5 cf rjmp .-86 ; 0x19746 #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; 1979c: 86 ef ldi r24, 0xF6 ; 246 1979e: 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); 197a0: 0e 94 0a 75 call 0xea14 ; 0xea14 197a4: ec 01 movw r28, r24 197a6: 8f ee ldi r24, 0xEF ; 239 197a8: 94 e4 ldi r25, 0x44 ; 68 197aa: 0e 94 0a 75 call 0xea14 ; 0xea14 197ae: 22 e0 ldi r18, 0x02 ; 2 197b0: 4c e9 ldi r20, 0x9C ; 156 197b2: 5d eb ldi r21, 0xBD ; 189 197b4: be 01 movw r22, r28 197b6: 0e 94 2e 75 call 0xea5c ; 0xea5c } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 197ba: 80 91 47 04 lds r24, 0x0447 ; 0x800447 197be: 82 30 cpi r24, 0x02 ; 2 197c0: 09 f4 brne .+2 ; 0x197c4 197c2: 43 c0 rjmp .+134 ; 0x1984a 197c4: 83 30 cpi r24, 0x03 ; 3 197c6: 09 f4 brne .+2 ; 0x197ca 197c8: 43 c0 rjmp .+134 ; 0x19850 197ca: 81 30 cpi r24, 0x01 ; 1 197cc: d9 f1 breq .+118 ; 0x19844 197ce: 8a ed ldi r24, 0xDA ; 218 197d0: 97 e4 ldi r25, 0x47 ; 71 197d2: 0e 94 0a 75 call 0xea14 ; 0xea14 197d6: ec 01 movw r28, r24 197d8: 82 ed ldi r24, 0xD2 ; 210 197da: 97 e4 ldi r25, 0x47 ; 71 197dc: 0e 94 0a 75 call 0xea14 ; 0xea14 197e0: 22 e0 ldi r18, 0x02 ; 2 197e2: 45 e8 ldi r20, 0x85 ; 133 197e4: 5d eb ldi r21, 0xBD ; 189 197e6: be 01 movw r22, r28 197e8: 0e 94 2e 75 call 0xea5c ; 0xea5c 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 197ec: 87 ea ldi r24, 0xA7 ; 167 197ee: 9c e0 ldi r25, 0x0C ; 12 197f0: 0f 94 9d a3 call 0x3473a ; 0x3473a 197f4: 88 23 and r24, r24 197f6: 79 f1 breq .+94 ; 0x19856 197f8: 86 e4 ldi r24, 0x46 ; 70 197fa: 98 e4 ldi r25, 0x48 ; 72 197fc: 0e 94 0a 75 call 0xea14 ; 0xea14 19800: 22 e0 ldi r18, 0x02 ; 2 19802: 46 ef ldi r20, 0xF6 ; 246 19804: 5c eb ldi r21, 0xBC ; 188 19806: bc 01 movw r22, r24 19808: 8c e0 ldi r24, 0x0C ; 12 1980a: 98 e6 ldi r25, 0x68 ; 104 1980c: 0e 94 2e 75 call 0xea5c ; 0xea5c if (farm_mode) 19810: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19814: 88 23 and r24, r24 19816: 31 f0 breq .+12 ; 0x19824 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); 19818: 61 e7 ldi r22, 0x71 ; 113 1981a: 77 ee ldi r23, 0xE7 ; 231 1981c: 8c e5 ldi r24, 0x5C ; 92 1981e: 93 e8 ldi r25, 0x83 ; 131 19820: 0e 94 6d 72 call 0xe4da ; 0xe4da } MENU_END(); 19824: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 19828: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1982c: 8f 5f subi r24, 0xFF ; 255 1982e: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19832: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19836: 8f 5f subi r24, 0xFF ; 255 19838: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1983c: c5 ce rjmp .-630 ; 0x195c8 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; 1983e: 84 ee ldi r24, 0xE4 ; 228 19840: 94 e4 ldi r25, 0x44 ; 68 19842: ae cf rjmp .-164 ; 0x197a0 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 19844: 8b ec ldi r24, 0xCB ; 203 19846: 97 e4 ldi r25, 0x47 ; 71 19848: c4 cf rjmp .-120 ; 0x197d2 1984a: 89 ea ldi r24, 0xA9 ; 169 1984c: 9a e4 ldi r25, 0x4A ; 74 1984e: c1 cf rjmp .-126 ; 0x197d2 19850: 82 ec ldi r24, 0xC2 ; 194 19852: 97 e4 ldi r25, 0x47 ; 71 19854: be cf rjmp .-132 ; 0x197d2 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 19856: 8c e4 ldi r24, 0x4C ; 76 19858: 98 e4 ldi r25, 0x48 ; 72 1985a: d0 cf rjmp .-96 ; 0x197fc { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 1985c: df 91 pop r29 1985e: cf 91 pop r28 19860: 1f 91 pop r17 19862: 08 95 ret 00019864 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 19864: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 19868: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1986c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19870: 84 30 cpi r24, 0x04 ; 4 19872: 08 f0 brcs .+2 ; 0x19876 19874: 7d c0 rjmp .+250 ; 0x19970 19876: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1987a: 8c e8 ldi r24, 0x8C ; 140 1987c: 98 e4 ldi r25, 0x48 ; 72 1987e: 0e 94 0a 75 call 0xea14 ; 0xea14 19882: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 19886: 8e e0 ldi r24, 0x0E ; 14 19888: 96 e4 ldi r25, 0x46 ; 70 1988a: 0e 94 0a 75 call 0xea14 ; 0xea14 1988e: 65 e7 ldi r22, 0x75 ; 117 19890: 79 ef ldi r23, 0xF9 ; 249 19892: 0e 94 6d 72 call 0xe4da ; 0xe4da if (lcd_commands_type == LcdCommands::Idle) 19896: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1989a: 81 11 cpse r24, r1 1989c: 08 c0 rjmp .+16 ; 0x198ae { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1989e: 8d e6 ldi r24, 0x6D ; 109 198a0: 96 e4 ldi r25, 0x46 ; 70 198a2: 0e 94 0a 75 call 0xea14 ; 0xea14 198a6: 6a e8 ldi r22, 0x8A ; 138 198a8: 76 ed ldi r23, 0xD6 ; 214 198aa: 0e 94 c3 72 call 0xe586 ; 0xe586 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 198ae: 81 ec ldi r24, 0xC1 ; 193 198b0: 91 e6 ldi r25, 0x61 ; 97 198b2: 0e 94 0a 75 call 0xea14 ; 0xea14 198b6: 6d ec ldi r22, 0xCD ; 205 198b8: 78 e6 ldi r23, 0x68 ; 104 198ba: 0e 94 59 8d call 0x11ab2 ; 0x11ab2 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 198be: 83 e0 ldi r24, 0x03 ; 3 198c0: 96 e4 ldi r25, 0x46 ; 70 198c2: 0e 94 0a 75 call 0xea14 ; 0xea14 198c6: 6d e6 ldi r22, 0x6D ; 109 198c8: 71 ee ldi r23, 0xE1 ; 225 198ca: 0e 94 6d 72 call 0xe4da ; 0xe4da // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 198ce: 83 ef ldi r24, 0xF3 ; 243 198d0: 95 e4 ldi r25, 0x45 ; 69 198d2: 0e 94 0a 75 call 0xea14 ; 0xea14 198d6: 64 e6 ldi r22, 0x64 ; 100 198d8: 72 ec ldi r23, 0xC2 ; 194 198da: 0e 94 6d 72 call 0xe4da ; 0xe4da // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 198de: 85 ee ldi r24, 0xE5 ; 229 198e0: 95 e4 ldi r25, 0x45 ; 69 198e2: 0e 94 0a 75 call 0xea14 ; 0xea14 198e6: 6b e6 ldi r22, 0x6B ; 107 198e8: 72 ec ldi r23, 0xC2 ; 194 198ea: 0e 94 6d 72 call 0xe4da ; 0xe4da MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 198ee: 81 ed ldi r24, 0xD1 ; 209 198f0: 95 e4 ldi r25, 0x45 ; 69 198f2: 0e 94 0a 75 call 0xea14 ; 0xea14 198f6: 62 e7 ldi r22, 0x72 ; 114 198f8: 72 ec ldi r23, 0xC2 ; 194 198fa: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 198fe: 8d eb ldi r24, 0xBD ; 189 19900: 95 e4 ldi r25, 0x45 ; 69 19902: 0e 94 0a 75 call 0xea14 ; 0xea14 19906: 6f e5 ldi r22, 0x5F ; 95 19908: 79 ec ldi r23, 0xC9 ; 201 1990a: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1990e: 8b ea ldi r24, 0xAB ; 171 19910: 95 e4 ldi r25, 0x45 ; 69 19912: 0e 94 0a 75 call 0xea14 ; 0xea14 19916: 68 e7 ldi r22, 0x78 ; 120 19918: 7e eb ldi r23, 0xBE ; 190 1991a: 0e 94 c3 72 call 0xe586 ; 0xe586 #ifndef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_SHOW_END_STOPS), menu_show_end_stops); 1991e: 8a e9 ldi r24, 0x9A ; 154 19920: 95 e4 ldi r25, 0x45 ; 69 19922: 0e 94 0a 75 call 0xea14 ; 0xea14 19926: 6e e5 ldi r22, 0x5E ; 94 19928: 7d ed ldi r23, 0xDD ; 221 1992a: 0e 94 c3 72 call 0xe586 ; 0xe586 #endif MENU_ITEM_GCODE_P(_T(MSG_CALIBRATE_BED_RESET), PSTR("M44")); 1992e: 86 e8 ldi r24, 0x86 ; 134 19930: 95 e4 ldi r25, 0x45 ; 69 19932: 0e 94 0a 75 call 0xea14 ; 0xea14 19936: 6c e7 ldi r22, 0x7C ; 124 19938: 73 e8 ldi r23, 0x83 ; 131 1993a: 0e 94 59 8d call 0x11ab2 ; 0x11ab2 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1993e: 0f 94 90 10 call 0x22120 ; 0x22120 19942: 88 23 and r24, r24 19944: 41 f0 breq .+16 ; 0x19956 MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 19946: 89 e7 ldi r24, 0x79 ; 121 19948: 95 e4 ldi r25, 0x45 ; 69 1994a: 0e 94 0a 75 call 0xea14 ; 0xea14 1994e: 69 e7 ldi r22, 0x79 ; 121 19950: 72 ec ldi r23, 0xC2 ; 194 19952: 0e 94 6d 72 call 0xe4da ; 0xe4da #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); 19956: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1995a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1995e: 8f 5f subi r24, 0xFF ; 255 19960: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19964: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19968: 8f 5f subi r24, 0xFF ; 255 1996a: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1996e: 7e cf rjmp .-260 ; 0x1986c #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 19970: 08 95 ret 00019972 : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 19972: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 19976: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1997a: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1997e: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 19982: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 19986: 20 91 57 02 lds r18, 0x0257 ; 0x800257 1998a: 30 91 58 02 lds r19, 0x0258 ; 0x800258 1998e: 26 17 cp r18, r22 19990: 37 07 cpc r19, r23 19992: 0c f0 brlt .+2 ; 0x19996 19994: 65 c0 rjmp .+202 ; 0x19a60 { if (lcd_encoder != 0) 19996: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1999a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1999e: 89 2b or r24, r25 199a0: b9 f1 breq .+110 ; 0x19a10 { refresh_cmd_timeout(); 199a2: 0e 94 11 65 call 0xca22 ; 0xca22 } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 199a6: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 199aa: 8f 5f subi r24, 0xFF ; 255 199ac: 80 31 cpi r24, 0x10 ; 16 199ae: 09 f4 brne .+2 ; 0x199b2 next_block_index = 0; 199b0: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 199b2: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) 199b6: 98 17 cp r25, r24 199b8: 59 f1 breq .+86 ; 0x19a10 { current_position[E_AXIS] += lcd_encoder; 199ba: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 199be: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 199c2: 07 2e mov r0, r23 199c4: 00 0c add r0, r0 199c6: 88 0b sbc r24, r24 199c8: 99 0b sbc r25, r25 199ca: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 199ce: 9b 01 movw r18, r22 199d0: ac 01 movw r20, r24 199d2: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 199d6: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 199da: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 199de: 90 91 70 12 lds r25, 0x1270 ; 0x801270 199e2: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 199e6: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 199ea: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 199ee: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 199f2: 90 93 70 12 sts 0x1270, r25 ; 0x801270 lcd_encoder = 0; 199f6: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 199fa: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 199fe: 65 e5 ldi r22, 0x55 ; 85 19a00: 75 e5 ldi r23, 0x55 ; 85 19a02: 85 ed ldi r24, 0xD5 ; 213 19a04: 9f e3 ldi r25, 0x3F ; 63 19a06: 0f 94 0a 4a call 0x29414 ; 0x29414 lcd_draw_update = 1; 19a0a: 81 e0 ldi r24, 0x01 ; 1 19a0c: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } } if (lcd_draw_update) 19a10: 80 91 59 02 lds r24, 0x0259 ; 0x800259 19a14: 88 23 and r24, r24 19a16: 11 f1 breq .+68 ; 0x19a5c { lcd_set_cursor(0, 1); 19a18: 61 e0 ldi r22, 0x01 ; 1 19a1a: 80 e0 ldi r24, 0x00 ; 0 19a1c: 0e 94 2a 6f call 0xde54 ; 0xde54 //! 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); 19a20: 80 91 70 12 lds r24, 0x1270 ; 0x801270 19a24: 8f 93 push r24 19a26: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 19a2a: 8f 93 push r24 19a2c: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 19a30: 8f 93 push r24 19a32: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 19a36: 8f 93 push r24 19a38: 87 e4 ldi r24, 0x47 ; 71 19a3a: 92 e8 ldi r25, 0x82 ; 130 19a3c: 9f 93 push r25 19a3e: 8f 93 push r24 19a40: 88 e3 ldi r24, 0x38 ; 56 19a42: 92 e8 ldi r25, 0x82 ; 130 19a44: 9f 93 push r25 19a46: 8f 93 push r24 19a48: 0e 94 db 6e call 0xddb6 ; 0xddb6 19a4c: 8d b7 in r24, 0x3d ; 61 19a4e: 9e b7 in r25, 0x3e ; 62 19a50: 08 96 adiw r24, 0x08 ; 8 19a52: 0f b6 in r0, 0x3f ; 63 19a54: f8 94 cli 19a56: 9e bf out 0x3e, r25 ; 62 19a58: 0f be out 0x3f, r0 ; 63 19a5a: 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(); 19a5c: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac }; } void show_preheat_nozzle_warning() { lcd_clear(); 19a60: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 19a64: 84 e1 ldi r24, 0x14 ; 20 19a66: 9a e3 ldi r25, 0x3A ; 58 19a68: 0e 94 0a 75 call 0xea14 ; 0xea14 19a6c: ac 01 movw r20, r24 19a6e: 60 e0 ldi r22, 0x00 ; 0 19a70: 80 e0 ldi r24, 0x00 ; 0 19a72: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 19a76: 8e ef ldi r24, 0xFE ; 254 19a78: 99 e3 ldi r25, 0x39 ; 57 19a7a: 0e 94 0a 75 call 0xea14 ; 0xea14 19a7e: ac 01 movw r20, r24 19a80: 62 e0 ldi r22, 0x02 ; 2 19a82: 80 e0 ldi r24, 0x00 ; 0 19a84: 0e 94 d7 6f call 0xdfae ; 0xdfae _delay(2000); 19a88: 60 ed ldi r22, 0xD0 ; 208 19a8a: 77 e0 ldi r23, 0x07 ; 7 19a8c: 80 e0 ldi r24, 0x00 ; 0 19a8e: 90 e0 ldi r25, 0x00 ; 0 19a90: 0f 94 23 0b call 0x21646 ; 0x21646 lcd_clear(); 19a94: 0e 94 f6 6f call 0xdfec ; 0xdfec menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 19a98: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 00019a9c : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 19a9c: 0f 94 ef 6e call 0x2ddde ; 0x2ddde #endif menu_top = 0; 19aa0: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_encoder = 0; 19aa4: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19aa8: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 19aac: 0c 94 7f 62 jmp 0xc4fe ; 0xc4fe 00019ab0 : } } void CardReader::updir() { if(workDirDepth > 0) 19ab0: 80 91 77 15 lds r24, 0x1577 ; 0x801577 19ab4: 88 23 and r24, r24 19ab6: f9 f0 breq .+62 ; 0x19af6 { --workDirDepth; 19ab8: 81 50 subi r24, 0x01 ; 1 19aba: 80 93 77 15 sts 0x1577, r24 ; 0x801577 workDir = workDirParents[0]; 19abe: 93 e2 ldi r25, 0x23 ; 35 19ac0: e5 ea ldi r30, 0xA5 ; 165 19ac2: f4 e1 ldi r31, 0x14 ; 20 19ac4: a2 e8 ldi r26, 0x82 ; 130 19ac6: b4 e1 ldi r27, 0x14 ; 20 19ac8: 01 90 ld r0, Z+ 19aca: 0d 92 st X+, r0 19acc: 9a 95 dec r25 19ace: e1 f7 brne .-8 ; 0x19ac8 19ad0: 25 ea ldi r18, 0xA5 ; 165 19ad2: 34 e1 ldi r19, 0x14 ; 20 for (uint8_t d = 0; d < workDirDepth; d++) 19ad4: 90 e0 ldi r25, 0x00 ; 0 19ad6: 98 17 cp r25, r24 19ad8: 60 f4 brcc .+24 ; 0x19af2 { workDirParents[d] = workDirParents[d+1]; 19ada: 43 e2 ldi r20, 0x23 ; 35 19adc: f9 01 movw r30, r18 19ade: b3 96 adiw r30, 0x23 ; 35 19ae0: d9 01 movw r26, r18 19ae2: 01 90 ld r0, Z+ 19ae4: 0d 92 st X+, r0 19ae6: 4a 95 dec r20 19ae8: e1 f7 brne .-8 ; 0x19ae2 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 19aea: 9f 5f subi r25, 0xFF ; 255 19aec: 2d 5d subi r18, 0xDD ; 221 19aee: 3f 4f sbci r19, 0xFF ; 255 19af0: f2 cf rjmp .-28 ; 0x19ad6 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 19af2: 0f 94 ef 6e call 0x2ddde ; 0x2ddde } static void lcd_sd_updir() { card.updir(); menu_top = 0; 19af6: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_encoder = 0; 19afa: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19afe: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 19b02: 0c 94 7f 62 jmp 0xc4fe ; 0xc4fe 00019b06 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 19b06: cf 93 push r28 MENU_BEGIN(); 19b08: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 19b0c: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19b10: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19b14: 84 30 cpi r24, 0x04 ; 4 19b16: 60 f5 brcc .+88 ; 0x19b70 19b18: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19b1c: 8c e8 ldi r24, 0x8C ; 140 19b1e: 98 e4 ldi r25, 0x48 ; 72 19b20: 0e 94 0a 75 call 0xea14 ; 0xea14 19b24: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 19b28: 8a e2 ldi r24, 0x2A ; 42 19b2a: 96 e4 ldi r25, 0x46 ; 70 19b2c: 0e 94 0a 75 call 0xea14 ; 0xea14 19b30: 67 e7 ldi r22, 0x77 ; 119 19b32: 7e ec ldi r23, 0xCE ; 206 19b34: 0e 94 6d 72 call 0xe4da ; 0xe4da for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19b38: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 19b3a: 8f ee ldi r24, 0xEF ; 239 19b3c: 96 e4 ldi r25, 0x46 ; 70 19b3e: 0e 94 0a 75 call 0xea14 ; 0xea14 19b42: 61 e3 ldi r22, 0x31 ; 49 19b44: 6c 0f add r22, r28 19b46: 2c 2f mov r18, r28 19b48: 46 e8 ldi r20, 0x86 ; 134 19b4a: 5e ec ldi r21, 0xCE ; 206 19b4c: 0e 94 ff 71 call 0xe3fe ; 0xe3fe 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++) 19b50: cf 5f subi r28, 0xFF ; 255 19b52: c5 30 cpi r28, 0x05 ; 5 19b54: 91 f7 brne .-28 ; 0x19b3a MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 19b56: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 19b5a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19b5e: 8f 5f subi r24, 0xFF ; 255 19b60: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19b64: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19b68: 8f 5f subi r24, 0xFF ; 255 19b6a: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19b6e: d0 cf rjmp .-96 ; 0x19b10 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(); } 19b70: cf 91 pop r28 19b72: 08 95 ret 00019b74 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 19b74: 84 e0 ldi r24, 0x04 ; 4 19b76: 0d 94 c1 24 jmp 0x24982 ; 0x24982 00019b7a : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 19b7a: 85 e0 ldi r24, 0x05 ; 5 19b7c: 0d 94 c1 24 jmp 0x24982 ; 0x24982 00019b80 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 19b80: 86 e0 ldi r24, 0x06 ; 6 19b82: 0d 94 c1 24 jmp 0x24982 ; 0x24982 00019b86 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 19b86: 87 e0 ldi r24, 0x07 ; 7 19b88: 0d 94 c1 24 jmp 0x24982 ; 0x24982 00019b8c : 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); 19b8c: 88 e0 ldi r24, 0x08 ; 8 19b8e: 0d 94 c1 24 jmp 0x24982 ; 0x24982 00019b92 : 19b92: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 19b96: 81 ea ldi r24, 0xA1 ; 161 19b98: 9d e0 ldi r25, 0x0D ; 13 19b9a: 0f 94 c1 a3 call 0x34782 ; 0x34782 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 19b9e: 83 e0 ldi r24, 0x03 ; 3 19ba0: 0c 94 cf 62 jmp 0xc59e ; 0xc59e 00019ba4 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 19ba4: cf 93 push r28 MENU_BEGIN(); 19ba6: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 19baa: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19bae: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19bb2: 84 30 cpi r24, 0x04 ; 4 19bb4: 88 f5 brcc .+98 ; 0x19c18 19bb6: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 19bba: 0e 94 1c 62 call 0xc438 ; 0xc438 19bbe: 81 11 cpse r24, r1 19bc0: 0f 94 62 09 call 0x212c4 ; 0x212c4 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19bc4: 8c e8 ldi r24, 0x8C ; 140 19bc6: 98 e4 ldi r25, 0x48 ; 72 19bc8: 0e 94 0a 75 call 0xea14 ; 0xea14 19bcc: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 19bd0: 8a e2 ldi r24, 0x2A ; 42 19bd2: 96 e4 ldi r25, 0x46 ; 70 19bd4: 0e 94 0a 75 call 0xea14 ; 0xea14 19bd8: 6f e9 ldi r22, 0x9F ; 159 19bda: 7c ef ldi r23, 0xFC ; 252 19bdc: 0e 94 6d 72 call 0xe4da ; 0xe4da for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19be0: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 19be2: 8f ee ldi r24, 0xEF ; 239 19be4: 96 e4 ldi r25, 0x46 ; 70 19be6: 0e 94 0a 75 call 0xea14 ; 0xea14 19bea: 61 e3 ldi r22, 0x31 ; 49 19bec: 6c 0f add r22, r28 19bee: 2c 2f mov r18, r28 19bf0: 4a e8 ldi r20, 0x8A ; 138 19bf2: 5c ef ldi r21, 0xFC ; 252 19bf4: 0e 94 ff 71 call 0xe3fe ; 0xe3fe 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++) 19bf8: cf 5f subi r28, 0xFF ; 255 19bfa: c5 30 cpi r28, 0x05 ; 5 19bfc: 91 f7 brne .-28 ; 0x19be2 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 19bfe: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 19c02: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19c06: 8f 5f subi r24, 0xFF ; 255 19c08: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19c0c: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19c10: 8f 5f subi r24, 0xFF ; 255 19c12: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19c16: cb cf rjmp .-106 ; 0x19bae 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(); } 19c18: cf 91 pop r28 19c1a: 08 95 ret 00019c1c : } // 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)) { 19c1c: ef 92 push r14 19c1e: ff 92 push r15 19c20: 0f 93 push r16 19c22: 1f 93 push r17 19c24: cf 93 push r28 19c26: 8c 01 movw r16, r24 19c28: 7b 01 movw r14, r22 MENU_BEGIN(); 19c2a: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 19c2e: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19c32: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19c36: 84 30 cpi r24, 0x04 ; 4 19c38: 28 f5 brcc .+74 ; 0x19c84 19c3a: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 19c3e: 0e 94 1c 62 call 0xc438 ; 0xc438 19c42: 81 11 cpse r24, r1 19c44: 0f 94 62 09 call 0x212c4 ; 0x212c4 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19c48: 8c e8 ldi r24, 0x8C ; 140 19c4a: 98 e4 ldi r25, 0x48 ; 72 19c4c: 0e 94 0a 75 call 0xea14 ; 0xea14 19c50: 0e 94 9e 72 call 0xe53c ; 0xe53c for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19c54: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 19c56: 61 e3 ldi r22, 0x31 ; 49 19c58: 6c 0f add r22, r28 19c5a: 2c 2f mov r18, r28 19c5c: a7 01 movw r20, r14 19c5e: c8 01 movw r24, r16 19c60: 0e 94 ff 71 call 0xe3fe ; 0xe3fe MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19c64: cf 5f subi r28, 0xFF ; 255 19c66: c5 30 cpi r28, 0x05 ; 5 19c68: b1 f7 brne .-20 ; 0x19c56 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 19c6a: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 // 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(); 19c6e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19c72: 8f 5f subi r24, 0xFF ; 255 19c74: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19c78: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19c7c: 8f 5f subi r24, 0xFF ; 255 19c7e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19c82: d7 cf rjmp .-82 ; 0x19c32 ); 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(); } 19c84: cf 91 pop r28 19c86: 1f 91 pop r17 19c88: 0f 91 pop r16 19c8a: ff 90 pop r15 19c8c: ef 90 pop r14 19c8e: 08 95 ret 00019c90 : 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); 19c90: 8d ec ldi r24, 0xCD ; 205 19c92: 91 e6 ldi r25, 0x61 ; 97 19c94: 0e 94 0a 75 call 0xea14 ; 0xea14 19c98: 60 e6 ldi r22, 0x60 ; 96 19c9a: 7e ec ldi r23, 0xCE ; 206 19c9c: 0c 94 0e ce jmp 0x19c1c ; 0x19c1c 00019ca0 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 19ca0: 8c ed ldi r24, 0xDC ; 220 19ca2: 91 e6 ldi r25, 0x61 ; 97 19ca4: 0e 94 0a 75 call 0xea14 ; 0xea14 19ca8: 6c e6 ldi r22, 0x6C ; 108 19caa: 7e ec ldi r23, 0xCE ; 206 19cac: 0c 94 0e ce jmp 0x19c1c ; 0x19c1c 00019cb0 : 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); 19cb0: 8f ee ldi r24, 0xEF ; 239 19cb2: 96 e4 ldi r25, 0x46 ; 70 19cb4: 0e 94 0a 75 call 0xea14 ; 0xea14 19cb8: 60 e2 ldi r22, 0x20 ; 32 19cba: 7c ef ldi r23, 0xFC ; 252 19cbc: 0c 94 0e ce jmp 0x19c1c ; 0x19c1c 00019cc0 : 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){ 19cc0: cf 93 push r28 19cc2: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 19cc4: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 19cc8: 88 23 and r24, r24 19cca: 21 f0 breq .+8 ; 0x19cd4 19ccc: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 19cce: cf 91 pop r28 19cd0: 0d 94 06 9e jmp 0x33c0c ; 0x33c0c 19cd4: cf 91 pop r28 19cd6: 08 95 ret 00019cd8 : 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) { 19cd8: cf 93 push r28 19cda: c8 2f mov r28, r24 menu_back(); 19cdc: 0e 94 eb 62 call 0xc5d6 ; 0xc5d6 MMU2::mmu2.eject_filament(filament, true); 19ce0: 61 e0 ldi r22, 0x01 ; 1 19ce2: 8c 2f mov r24, r28 19ce4: 0f 94 89 9d call 0x33b12 ; 0x33b12 // Clear the filament action clearFilamentAction(); } 19ce8: 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(); 19cea: 0d 94 62 09 jmp 0x212c4 ; 0x212c4 00019cee : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.load_filament(i); 19cee: 80 e0 ldi r24, 0x00 ; 0 19cf0: 0f 94 46 9d call 0x33a8c ; 0x33a8c 19cf4: 81 e0 ldi r24, 0x01 ; 1 19cf6: 0f 94 46 9d call 0x33a8c ; 0x33a8c 19cfa: 82 e0 ldi r24, 0x02 ; 2 19cfc: 0f 94 46 9d call 0x33a8c ; 0x33a8c 19d00: 83 e0 ldi r24, 0x03 ; 3 19d02: 0f 94 46 9d call 0x33a8c ; 0x33a8c 19d06: 84 e0 ldi r24, 0x04 ; 4 19d08: 0d 94 46 9d jmp 0x33a8c ; 0x33a8c 00019d0c : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 19d0c: 0d 94 46 9d jmp 0x33a8c ; 0x33a8c 00019d10 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19d10: 80 e0 ldi r24, 0x00 ; 0 19d12: 0d 94 00 95 jmp 0x32a00 ; 0x32a00 00019d16 : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 19d16: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 19d1a: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19d1e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19d22: 84 30 cpi r24, 0x04 ; 4 19d24: 08 f0 brcs .+2 ; 0x19d28 19d26: 45 c0 rjmp .+138 ; 0x19db2 19d28: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 19d2c: 82 e3 ldi r24, 0x32 ; 50 19d2e: 95 e4 ldi r25, 0x45 ; 69 19d30: 0e 94 0a 75 call 0xea14 ; 0xea14 19d34: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 19d38: 6a e8 ldi r22, 0x8A ; 138 19d3a: 71 ec ldi r23, 0xC1 ; 193 19d3c: 89 e4 ldi r24, 0x49 ; 73 19d3e: 9d e0 ldi r25, 0x0D ; 13 19d40: 0e 94 f5 75 call 0xebea ; 0xebea MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 19d44: 65 e8 ldi r22, 0x85 ; 133 19d46: 71 ec ldi r23, 0xC1 ; 193 19d48: 84 e5 ldi r24, 0x54 ; 84 19d4a: 9d e0 ldi r25, 0x0D ; 13 19d4c: 0e 94 f5 75 call 0xebea ; 0xebea MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 19d50: 60 e8 ldi r22, 0x80 ; 128 19d52: 71 ec ldi r23, 0xC1 ; 193 19d54: 8f e5 ldi r24, 0x5F ; 95 19d56: 9d e0 ldi r25, 0x0D ; 13 19d58: 0e 94 f5 75 call 0xebea ; 0xebea MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 19d5c: 6b e7 ldi r22, 0x7B ; 123 19d5e: 71 ec ldi r23, 0xC1 ; 193 19d60: 8a e6 ldi r24, 0x6A ; 106 19d62: 9d e0 ldi r25, 0x0D ; 13 19d64: 0e 94 f5 75 call 0xebea ; 0xebea MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 19d68: 66 e7 ldi r22, 0x76 ; 118 19d6a: 71 ec ldi r23, 0xC1 ; 193 19d6c: 85 e7 ldi r24, 0x75 ; 117 19d6e: 9d e0 ldi r25, 0x0D ; 13 19d70: 0e 94 f5 75 call 0xebea ; 0xebea MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 19d74: 61 e7 ldi r22, 0x71 ; 113 19d76: 71 ec ldi r23, 0xC1 ; 193 19d78: 80 e8 ldi r24, 0x80 ; 128 19d7a: 9d e0 ldi r25, 0x0D ; 13 19d7c: 0e 94 f5 75 call 0xebea ; 0xebea MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 19d80: 6c e6 ldi r22, 0x6C ; 108 19d82: 71 ec ldi r23, 0xC1 ; 193 19d84: 8b e8 ldi r24, 0x8B ; 139 19d86: 9d e0 ldi r25, 0x0D ; 13 19d88: 0e 94 f5 75 call 0xebea ; 0xebea MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 19d8c: 67 e6 ldi r22, 0x67 ; 103 19d8e: 71 ec ldi r23, 0xC1 ; 193 19d90: 86 e9 ldi r24, 0x96 ; 150 19d92: 9d e0 ldi r25, 0x0D ; 13 19d94: 0e 94 f5 75 call 0xebea ; 0xebea MENU_END(); 19d98: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 19d9c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19da0: 8f 5f subi r24, 0xFF ; 255 19da2: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19da6: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19daa: 8f 5f subi r24, 0xFF ; 255 19dac: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19db0: b6 cf rjmp .-148 ; 0x19d1e 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(); } 19db2: 08 95 ret 00019db4 : } _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(); 19db4: 0e 94 af 78 call 0xf15e ; 0xf15e _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 19db8: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 } 19dbc: 08 95 ret 00019dbe : //! |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() { 19dbe: cf 93 push r28 19dc0: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 19dc2: 8e e6 ldi r24, 0x6E ; 110 19dc4: 9a e3 ldi r25, 0x3A ; 58 19dc6: 0e 94 0a 75 call 0xea14 ; 0xea14 19dca: ac 01 movw r20, r24 19dcc: 60 e0 ldi r22, 0x00 ; 0 19dce: 80 e0 ldi r24, 0x00 ; 0 19dd0: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 1, STR_SEPARATOR); 19dd4: 4f ed ldi r20, 0xDF ; 223 19dd6: 53 e8 ldi r21, 0x83 ; 131 19dd8: 61 e0 ldi r22, 0x01 ; 1 19dda: 80 e0 ldi r24, 0x00 ; 0 19ddc: 0e 94 d7 6f call 0xdfae ; 0xdfae for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 19de0: 62 e0 ldi r22, 0x02 ; 2 19de2: 80 e0 ldi r24, 0x00 ; 0 19de4: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 19de8: 85 ee ldi r24, 0xE5 ; 229 19dea: 9f e0 ldi r25, 0x0F ; 15 19dec: 0f 94 a5 a3 call 0x3474a ; 0x3474a 19df0: 9f 93 push r25 19df2: 8f 93 push r24 19df4: 7f 93 push r23 19df6: 6f 93 push r22 19df8: 1f 92 push r1 19dfa: 88 e5 ldi r24, 0x58 ; 88 19dfc: 8f 93 push r24 19dfe: c1 e5 ldi r28, 0x51 ; 81 19e00: d2 e8 ldi r29, 0x82 ; 130 19e02: df 93 push r29 19e04: cf 93 push r28 19e06: 0e 94 db 6e call 0xddb6 ; 0xddb6 { 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); 19e0a: 63 e0 ldi r22, 0x03 ; 3 19e0c: 80 e0 ldi r24, 0x00 ; 0 19e0e: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 19e12: 89 ee ldi r24, 0xE9 ; 233 19e14: 9f e0 ldi r25, 0x0F ; 15 19e16: 0f 94 a5 a3 call 0x3474a ; 0x3474a 19e1a: 9f 93 push r25 19e1c: 8f 93 push r24 19e1e: 7f 93 push r23 19e20: 6f 93 push r22 19e22: 1f 92 push r1 19e24: 89 e5 ldi r24, 0x59 ; 89 19e26: 8f 93 push r24 19e28: df 93 push r29 19e2a: cf 93 push r28 19e2c: 0e 94 db 6e call 0xddb6 ; 0xddb6 } menu_back_if_clicked(); 19e30: 8d b7 in r24, 0x3d ; 61 19e32: 9e b7 in r25, 0x3e ; 62 19e34: 40 96 adiw r24, 0x10 ; 16 19e36: 0f b6 in r0, 0x3f ; 63 19e38: f8 94 cli 19e3a: 9e bf out 0x3e, r25 ; 62 19e3c: 0f be out 0x3f, r0 ; 63 19e3e: 8d bf out 0x3d, r24 ; 61 } 19e40: df 91 pop r29 19e42: 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(); 19e44: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 00019e48 : //! ---------------------- //! 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() { 19e48: cf 92 push r12 19e4a: df 92 push r13 19e4c: ef 92 push r14 19e4e: ff 92 push r15 19e50: 0f 93 push r16 19e52: 1f 93 push r17 19e54: cf 93 push r28 19e56: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 19e58: 80 e6 ldi r24, 0x60 ; 96 19e5a: 9f e0 ldi r25, 0x0F ; 15 19e5c: 0f 94 a5 a3 call 0x3474a ; 0x3474a 19e60: 6b 01 movw r12, r22 19e62: 7c 01 movw r14, r24 lcd_home(); 19e64: 0e 94 ef 6f call 0xdfde ; 0xdfde lcd_printf_P(_N( 19e68: 80 e6 ldi r24, 0x60 ; 96 19e6a: 9a e3 ldi r25, 0x3A ; 58 19e6c: 0e 94 0a 75 call 0xea14 ; 0xea14 19e70: 18 2f mov r17, r24 19e72: 09 2f mov r16, r25 19e74: 82 e5 ldi r24, 0x52 ; 82 19e76: 9a e3 ldi r25, 0x3A ; 58 19e78: 0e 94 0a 75 call 0xea14 ; 0xea14 19e7c: ec 01 movw r28, r24 19e7e: 82 e4 ldi r24, 0x42 ; 66 19e80: 9a e3 ldi r25, 0x3A ; 58 19e82: 0e 94 0a 75 call 0xea14 ; 0xea14 19e86: 2e e3 ldi r18, 0x3E ; 62 19e88: 2f 93 push r18 19e8a: 20 e8 ldi r18, 0x80 ; 128 19e8c: 2f 93 push r18 19e8e: 1f 92 push r1 19e90: 1f 92 push r1 19e92: 0f 93 push r16 19e94: 1f 93 push r17 19e96: 2d e3 ldi r18, 0x3D ; 61 19e98: 2f 93 push r18 19e9a: 25 ef ldi r18, 0xF5 ; 245 19e9c: 2f 93 push r18 19e9e: 22 ec ldi r18, 0xC2 ; 194 19ea0: 2f 93 push r18 19ea2: 20 e9 ldi r18, 0x90 ; 144 19ea4: 2f 93 push r18 19ea6: df 93 push r29 19ea8: cf 93 push r28 19eaa: 2f ed ldi r18, 0xDF ; 223 19eac: 33 e8 ldi r19, 0x83 ; 131 19eae: 3f 93 push r19 19eb0: 2f 93 push r18 19eb2: 9f 93 push r25 19eb4: 8f 93 push r24 19eb6: 83 e7 ldi r24, 0x73 ; 115 19eb8: 97 e6 ldi r25, 0x67 ; 103 19eba: 9f 93 push r25 19ebc: 8f 93 push r24 19ebe: 0e 94 db 6e call 0xddb6 ; 0xddb6 _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); 19ec2: 60 e0 ldi r22, 0x00 ; 0 19ec4: 8f e0 ldi r24, 0x0F ; 15 19ec6: 0e 94 2a 6f call 0xde54 ; 0xde54 if (angleDiff < 100){ 19eca: 8d b7 in r24, 0x3d ; 61 19ecc: 9e b7 in r25, 0x3e ; 62 19ece: 42 96 adiw r24, 0x12 ; 18 19ed0: 0f b6 in r0, 0x3f ; 63 19ed2: f8 94 cli 19ed4: 9e bf out 0x3e, r25 ; 62 19ed6: 0f be out 0x3f, r0 ; 63 19ed8: 8d bf out 0x3d, r24 ; 61 19eda: 20 e0 ldi r18, 0x00 ; 0 19edc: 30 e0 ldi r19, 0x00 ; 0 19ede: 48 ec ldi r20, 0xC8 ; 200 19ee0: 52 e4 ldi r21, 0x42 ; 66 19ee2: c7 01 movw r24, r14 19ee4: b6 01 movw r22, r12 19ee6: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 19eea: 87 ff sbrs r24, 7 19eec: 32 c0 rjmp .+100 ; 0x19f52 } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 19eee: 20 e0 ldi r18, 0x00 ; 0 19ef0: 30 e0 ldi r19, 0x00 ; 0 19ef2: 44 e3 ldi r20, 0x34 ; 52 19ef4: 53 e4 ldi r21, 0x43 ; 67 19ef6: c7 01 movw r24, r14 19ef8: b6 01 movw r22, r12 19efa: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 19efe: 2b ed ldi r18, 0xDB ; 219 19f00: 3f e0 ldi r19, 0x0F ; 15 19f02: 49 e4 ldi r20, 0x49 ; 73 19f04: 50 e4 ldi r21, 0x40 ; 64 19f06: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__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)); 19f0a: 9f 93 push r25 19f0c: 8f 93 push r24 19f0e: 7f 93 push r23 19f10: 6f 93 push r22 19f12: 8c e6 ldi r24, 0x6C ; 108 19f14: 97 e6 ldi r25, 0x67 ; 103 19f16: 9f 93 push r25 19f18: 8f 93 push r24 19f1a: 0e 94 db 6e call 0xddb6 ; 0xddb6 19f1e: 0f 90 pop r0 19f20: 0f 90 pop r0 19f22: 0f 90 pop r0 19f24: 0f 90 pop r0 19f26: 0f 90 pop r0 19f28: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 19f2a: 0e 94 45 73 call 0xe68a ; 0xe68a 19f2e: 88 23 and r24, r24 19f30: b9 f0 breq .+46 ; 0x19f60 menu_goto(lcd_menu_xyz_offset, 0, true); 19f32: 20 e0 ldi r18, 0x00 ; 0 19f34: 41 e0 ldi r20, 0x01 ; 1 19f36: 70 e0 ldi r23, 0x00 ; 0 19f38: 60 e0 ldi r22, 0x00 ; 0 19f3a: 8f ed ldi r24, 0xDF ; 223 19f3c: 9e ec ldi r25, 0xCE ; 206 } 19f3e: df 91 pop r29 19f40: cf 91 pop r28 19f42: 1f 91 pop r17 19f44: 0f 91 pop r16 19f46: ff 90 pop r15 19f48: ef 90 pop r14 19f4a: df 90 pop r13 19f4c: 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); 19f4e: 0c 94 87 62 jmp 0xc50e ; 0xc50e ); 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)); 19f52: 80 e2 ldi r24, 0x20 ; 32 19f54: 98 e4 ldi r25, 0x48 ; 72 19f56: 0e 94 0a 75 call 0xea14 ; 0xea14 19f5a: 0e 94 ed 6e call 0xddda ; 0xddda 19f5e: e5 cf rjmp .-54 ; 0x19f2a } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 19f60: df 91 pop r29 19f62: cf 91 pop r28 19f64: 1f 91 pop r17 19f66: 0f 91 pop r16 19f68: ff 90 pop r15 19f6a: ef 90 pop r14 19f6c: df 90 pop r13 19f6e: cf 90 pop r12 19f70: 08 95 ret 00019f72 : //! //! @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) 19f72: 4f 92 push r4 19f74: 5f 92 push r5 19f76: 6f 92 push r6 19f78: 7f 92 push r7 19f7a: 8f 92 push r8 19f7c: 9f 92 push r9 19f7e: af 92 push r10 19f80: bf 92 push r11 19f82: cf 92 push r12 19f84: df 92 push r13 19f86: ef 92 push r14 19f88: ff 92 push r15 19f8a: 0f 93 push r16 19f8c: 1f 93 push r17 19f8e: cf 93 push r28 19f90: df 93 push r29 19f92: 6c 01 movw r12, r24 19f94: 7b 01 movw r14, r22 19f96: 80 91 01 13 lds r24, 0x1301 ; 0x801301 { //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); 19f9a: 67 2b or r22, r23 19f9c: 29 f0 breq .+10 ; 0x19fa8 19f9e: 06 e0 ldi r16, 0x06 ; 6 19fa0: 81 30 cpi r24, 0x01 ; 1 19fa2: 29 f0 breq .+10 ; 0x19fae 19fa4: 05 e0 ldi r16, 0x05 ; 5 19fa6: 03 c0 rjmp .+6 ; 0x19fae 19fa8: 04 e0 ldi r16, 0x04 ; 4 19faa: 81 30 cpi r24, 0x01 ; 1 19fac: d9 f3 breq .-10 ; 0x19fa4 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 19fae: 0e 94 f6 6f call 0xdfec ; 0xdfec KEEPALIVE_STATE(PAUSED_FOR_USER); 19fb2: 84 e0 ldi r24, 0x04 ; 4 19fb4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 { //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; 19fb8: 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; 19fba: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 19fbc: 03 50 subi r16, 0x03 ; 3 19fbe: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 19fc0: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 19fc4: 81 e0 ldi r24, 0x01 ; 1 19fc6: 0e 94 25 8a call 0x1144a ; 0x1144a if (lcd_encoder) 19fca: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 19fce: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 19fd2: 00 97 sbiw r24, 0x00 ; 0 19fd4: 09 f4 brne .+2 ; 0x19fd8 19fd6: 9d c0 rjmp .+314 ; 0x1a112 { if (lcd_encoder < 0) 19fd8: 97 ff sbrs r25, 7 19fda: 88 c0 rjmp .+272 ; 0x1a0ec { cursor_pos--; 19fdc: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 19fde: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19fe2: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } if (cursor_pos > 3) 19fe6: c4 30 cpi r28, 0x04 ; 4 19fe8: 0c f4 brge .+2 ; 0x19fec 19fea: 86 c0 rjmp .+268 ; 0x1a0f8 { cursor_pos = 3; if (first < items_no - 3) 19fec: 88 2d mov r24, r8 19fee: 08 2c mov r0, r8 19ff0: 00 0c add r0, r0 19ff2: 99 0b sbc r25, r25 19ff4: 80 17 cp r24, r16 19ff6: 91 07 cpc r25, r17 19ff8: 0c f0 brlt .+2 ; 0x19ffc 19ffa: 7a c0 rjmp .+244 ; 0x1a0f0 { first++; 19ffc: 83 94 inc r8 lcd_clear(); 19ffe: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1a002: 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); 1a004: c1 14 cp r12, r1 1a006: d1 04 cpc r13, r1 1a008: 29 f0 breq .+10 ; 0x1a014 1a00a: a6 01 movw r20, r12 1a00c: 60 e0 ldi r22, 0x00 ; 0 1a00e: 80 e0 ldi r24, 0x00 ; 0 1a010: 0e 94 d7 6f call 0xdfae ; 0xdfae const bool last_visible = (first == items_no - 3); 1a014: a8 2c mov r10, r8 1a016: 08 2c mov r0, r8 1a018: 00 0c add r0, r0 1a01a: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1a01c: e1 14 cp r14, r1 1a01e: f1 04 cpc r15, r1 1a020: 29 f0 breq .+10 ; 0x1a02c 1a022: 82 e0 ldi r24, 0x02 ; 2 1a024: 98 2e mov r9, r24 1a026: a0 16 cp r10, r16 1a028: b1 06 cpc r11, r17 1a02a: 11 f0 breq .+4 ; 0x1a030 1a02c: 93 e0 ldi r25, 0x03 ; 3 1a02e: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1a030: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1a032: df 5f subi r29, 0xFF ; 255 1a034: 4f ee ldi r20, 0xEF ; 239 1a036: 59 e6 ldi r21, 0x69 ; 105 1a038: 6d 2f mov r22, r29 1a03a: 81 e0 ldi r24, 0x01 ; 1 1a03c: 0e 94 d7 6f call 0xdfae ; 0xdfae 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++) 1a040: 9d 12 cpse r9, r29 1a042: f7 cf rjmp .-18 ; 0x1a032 1a044: 48 2c mov r4, r8 1a046: 08 2c mov r0, r8 1a048: 00 0c add r0, r0 1a04a: 55 08 sbc r5, r5 1a04c: 66 08 sbc r6, r6 1a04e: 77 08 sbc r7, r7 1a050: 8f ef ldi r24, 0xFF ; 255 1a052: 48 1a sub r4, r24 1a054: 58 0a sbc r5, r24 1a056: 68 0a sbc r6, r24 1a058: 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++) 1a05a: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1a05c: 93 94 inc r9 1a05e: 69 2d mov r22, r9 1a060: 8a e0 ldi r24, 0x0A ; 10 1a062: 0e 94 2a 6f call 0xde54 ; 0xde54 1a066: c3 01 movw r24, r6 1a068: b2 01 movw r22, r4 1a06a: 0e 94 ab 71 call 0xe356 ; 0xe356 1a06e: 8f ef ldi r24, 0xFF ; 255 1a070: 48 1a sub r4, r24 1a072: 58 0a sbc r5, r24 1a074: 68 0a sbc r6, r24 1a076: 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++) 1a078: d9 11 cpse r29, r9 1a07a: f0 cf rjmp .-32 ; 0x1a05c { 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); 1a07c: e1 14 cp r14, r1 1a07e: f1 04 cpc r15, r1 1a080: 41 f0 breq .+16 ; 0x1a092 1a082: a0 16 cp r10, r16 1a084: b1 06 cpc r11, r17 1a086: 29 f4 brne .+10 ; 0x1a092 1a088: a7 01 movw r20, r14 1a08a: 63 e0 ldi r22, 0x03 ; 3 1a08c: 81 e0 ldi r24, 0x01 ; 1 1a08e: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1a092: 48 e6 ldi r20, 0x68 ; 104 1a094: 57 e8 ldi r21, 0x87 ; 135 1a096: 61 e0 ldi r22, 0x01 ; 1 1a098: 80 e0 ldi r24, 0x00 ; 0 1a09a: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_putc_at(0, cursor_pos, '>'); 1a09e: 4e e3 ldi r20, 0x3E ; 62 1a0a0: 6c 2f mov r22, r28 1a0a2: 80 e0 ldi r24, 0x00 ; 0 1a0a4: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 _delay(100); 1a0a8: 64 e6 ldi r22, 0x64 ; 100 1a0aa: 70 e0 ldi r23, 0x00 ; 0 1a0ac: 80 e0 ldi r24, 0x00 ; 0 1a0ae: 90 e0 ldi r25, 0x00 ; 0 1a0b0: 0f 94 23 0b call 0x21646 ; 0x21646 if (lcd_clicked()) 1a0b4: 0e 94 45 73 call 0xe68a ; 0xe68a 1a0b8: 88 23 and r24, r24 1a0ba: 09 f4 brne .+2 ; 0x1a0be 1a0bc: 81 cf rjmp .-254 ; 0x19fc0 { KEEPALIVE_STATE(IN_HANDLER); 1a0be: 82 e0 ldi r24, 0x02 ; 2 1a0c0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(cursor_pos + first - 1); 1a0c4: 8f ef ldi r24, 0xFF ; 255 1a0c6: 8c 0f add r24, r28 1a0c8: 88 0d add r24, r8 } } } 1a0ca: df 91 pop r29 1a0cc: cf 91 pop r28 1a0ce: 1f 91 pop r17 1a0d0: 0f 91 pop r16 1a0d2: ff 90 pop r15 1a0d4: ef 90 pop r14 1a0d6: df 90 pop r13 1a0d8: cf 90 pop r12 1a0da: bf 90 pop r11 1a0dc: af 90 pop r10 1a0de: 9f 90 pop r9 1a0e0: 8f 90 pop r8 1a0e2: 7f 90 pop r7 1a0e4: 6f 90 pop r6 1a0e6: 5f 90 pop r5 1a0e8: 4f 90 pop r4 1a0ea: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1a0ec: cf 5f subi r28, 0xFF ; 255 1a0ee: 77 cf rjmp .-274 ; 0x19fde 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); 1a0f0: 87 e0 ldi r24, 0x07 ; 7 1a0f2: 0f 94 62 23 call 0x246c4 ; 0x246c4 1a0f6: 85 cf rjmp .-246 ; 0x1a002 } } if (cursor_pos < 1) 1a0f8: c1 11 cpse r28, r1 1a0fa: 84 cf rjmp .-248 ; 0x1a004 { cursor_pos = 1; if (first > 0) 1a0fc: 18 14 cp r1, r8 1a0fe: 2c f4 brge .+10 ; 0x1a10a { first--; 1a100: 8a 94 dec r8 lcd_clear(); 1a102: 0e 94 f6 6f call 0xdfec ; 0xdfec } } if (cursor_pos < 1) { cursor_pos = 1; 1a106: c1 e0 ldi r28, 0x01 ; 1 1a108: 7d cf rjmp .-262 ; 0x1a004 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1a10a: 87 e0 ldi r24, 0x07 ; 7 1a10c: 0f 94 62 23 call 0x246c4 ; 0x246c4 1a110: fa cf rjmp .-12 ; 0x1a106 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1a112: c4 30 cpi r28, 0x04 ; 4 1a114: 0c f0 brlt .+2 ; 0x1a118 1a116: 6a cf rjmp .-300 ; 0x19fec 1a118: 75 cf rjmp .-278 ; 0x1a004 0001a11a : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1a11a: ef 92 push r14 1a11c: ff 92 push r15 1a11e: 0f 93 push r16 1a120: 1f 93 push r17 1a122: cf 93 push r28 1a124: df 93 push r29 1a126: 00 d0 rcall .+0 ; 0x1a128 1a128: 1f 92 push r1 1a12a: 1f 92 push r1 1a12c: cd b7 in r28, 0x3d ; 61 1a12e: de b7 in r29, 0x3e ; 62 1a130: 08 2f mov r16, r24 1a132: 16 2f mov r17, r22 1a134: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1a136: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 1a13a: 88 23 and r24, r24 1a13c: d9 f0 breq .+54 ; 0x1a174 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) { 1a13e: 0b 30 cpi r16, 0x0B ; 11 1a140: 29 f1 breq .+74 ; 0x1a18c 1a142: 04 31 cpi r16, 0x14 ; 20 1a144: 31 f1 breq .+76 ; 0x1a192 /// @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()) { 1a146: 87 e5 ldi r24, 0x57 ; 87 1a148: e8 2e mov r14, r24 1a14a: e9 82 std Y+1, r14 ; 0x01 1a14c: 0a 83 std Y+2, r16 ; 0x02 1a14e: 1b 83 std Y+3, r17 ; 0x03 1a150: fc 82 std Y+4, r15 ; 0x04 1a152: ce 01 movw r24, r28 1a154: 01 96 adiw r24, 0x01 ; 1 1a156: 0f 94 69 4e call 0x29cd2 ; 0x29cd2 1a15a: 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)); 1a15c: 47 e5 ldi r20, 0x57 ; 87 1a15e: 50 2f mov r21, r16 1a160: 61 2f mov r22, r17 1a162: 7f 2d mov r23, r15 1a164: 0f 94 d6 94 call 0x329ac ; 0x329ac 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)); 1a168: 60 e0 ldi r22, 0x00 ; 0 1a16a: 80 e0 ldi r24, 0x00 ; 0 1a16c: 0f 94 67 9c call 0x338ce ; 0x338ce 1a170: 88 23 and r24, r24 1a172: 59 f3 breq .-42 ; 0x1a14a return true; } 1a174: 0f 90 pop r0 1a176: 0f 90 pop r0 1a178: 0f 90 pop r0 1a17a: 0f 90 pop r0 1a17c: 0f 90 pop r0 1a17e: df 91 pop r29 1a180: cf 91 pop r28 1a182: 1f 91 pop r17 1a184: 0f 91 pop r16 1a186: ff 90 pop r15 1a188: ef 90 pop r14 1a18a: 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); 1a18c: 10 93 de 12 sts 0x12DE, r17 ; 0x8012de 1a190: da cf rjmp .-76 ; 0x1a146 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1a192: 10 93 df 12 sts 0x12DF, r17 ; 0x8012df 1a196: d7 cf rjmp .-82 ; 0x1a146 0001a198 : #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) 1a198: 82 30 cpi r24, 0x02 ; 2 1a19a: 91 05 cpc r25, r1 1a19c: 38 f0 brcs .+14 ; 0x1a1ac // 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 1a19e: 88 0f add r24, r24 1a1a0: 99 1f adc r25, r25 1a1a2: 88 0f add r24, r24 1a1a4: 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, 1a1a6: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1a1a8: 01 97 sbiw r24, 0x01 ; 1 1a1aa: f1 f7 brne .-4 ; 0x1a1a8 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1a1ac: 08 95 ret 0001a1ae : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1a1ae: cf 93 push r28 1a1b0: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1a1b2: 28 2f mov r18, r24 1a1b4: 30 e0 ldi r19, 0x00 ; 0 1a1b6: f9 01 movw r30, r18 1a1b8: e8 5f subi r30, 0xF8 ; 248 1a1ba: f9 47 sbci r31, 0x79 ; 121 1a1bc: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1a1be: f9 01 movw r30, r18 1a1c0: ee 54 subi r30, 0x4E ; 78 1a1c2: fa 47 sbci r31, 0x7A ; 122 1a1c4: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1a1c6: f9 01 movw r30, r18 1a1c8: e4 5a subi r30, 0xA4 ; 164 1a1ca: fa 47 sbci r31, 0x7A ; 122 1a1cc: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1a1ce: cc 23 and r28, r28 1a1d0: a1 f0 breq .+40 ; 0x1a1fa // 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); 1a1d2: 81 11 cpse r24, r1 1a1d4: 0e 94 dd ba call 0x175ba ; 0x175ba if (*portInputRegister(port) & bit) return HIGH; 1a1d8: ec 2f mov r30, r28 1a1da: f0 e0 ldi r31, 0x00 ; 0 1a1dc: ee 0f add r30, r30 1a1de: ff 1f adc r31, r31 1a1e0: ee 5b subi r30, 0xBE ; 190 1a1e2: fa 47 sbci r31, 0x7A ; 122 1a1e4: a5 91 lpm r26, Z+ 1a1e6: b4 91 lpm r27, Z 1a1e8: ec 91 ld r30, X 1a1ea: ed 23 and r30, r29 1a1ec: 81 e0 ldi r24, 0x01 ; 1 1a1ee: 90 e0 ldi r25, 0x00 ; 0 1a1f0: 09 f4 brne .+2 ; 0x1a1f4 1a1f2: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1a1f4: df 91 pop r29 1a1f6: cf 91 pop r28 1a1f8: 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; 1a1fa: 80 e0 ldi r24, 0x00 ; 0 1a1fc: 90 e0 ldi r25, 0x00 ; 0 1a1fe: fa cf rjmp .-12 ; 0x1a1f4 0001a200 : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1a200: 1f 93 push r17 1a202: cf 93 push r28 1a204: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1a206: 28 2f mov r18, r24 1a208: 30 e0 ldi r19, 0x00 ; 0 1a20a: f9 01 movw r30, r18 1a20c: e8 5f subi r30, 0xF8 ; 248 1a20e: f9 47 sbci r31, 0x79 ; 121 1a210: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1a212: f9 01 movw r30, r18 1a214: ee 54 subi r30, 0x4E ; 78 1a216: fa 47 sbci r31, 0x7A ; 122 1a218: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1a21a: f9 01 movw r30, r18 1a21c: e4 5a subi r30, 0xA4 ; 164 1a21e: fa 47 sbci r31, 0x7A ; 122 1a220: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1a222: cc 23 and r28, r28 1a224: a9 f0 breq .+42 ; 0x1a250 1a226: 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); 1a228: 81 11 cpse r24, r1 1a22a: 0e 94 dd ba call 0x175ba ; 0x175ba out = portOutputRegister(port); 1a22e: ec 2f mov r30, r28 1a230: f0 e0 ldi r31, 0x00 ; 0 1a232: ee 0f add r30, r30 1a234: ff 1f adc r31, r31 1a236: e8 5d subi r30, 0xD8 ; 216 1a238: fa 47 sbci r31, 0x7A ; 122 1a23a: a5 91 lpm r26, Z+ 1a23c: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1a23e: 8f b7 in r24, 0x3f ; 63 cli(); 1a240: f8 94 cli if (val == LOW) { *out &= ~bit; 1a242: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1a244: 11 11 cpse r17, r1 1a246: 08 c0 rjmp .+16 ; 0x1a258 *out &= ~bit; 1a248: d0 95 com r29 1a24a: de 23 and r29, r30 } else { *out |= bit; 1a24c: dc 93 st X, r29 } SREG = oldSREG; 1a24e: 8f bf out 0x3f, r24 ; 63 } 1a250: df 91 pop r29 1a252: cf 91 pop r28 1a254: 1f 91 pop r17 1a256: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1a258: de 2b or r29, r30 1a25a: f8 cf rjmp .-16 ; 0x1a24c 0001a25c : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1a25c: cf 93 push r28 1a25e: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1a260: 90 e0 ldi r25, 0x00 ; 0 1a262: fc 01 movw r30, r24 1a264: ee 54 subi r30, 0x4E ; 78 1a266: fa 47 sbci r31, 0x7A ; 122 1a268: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1a26a: 84 5a subi r24, 0xA4 ; 164 1a26c: 9a 47 sbci r25, 0x7A ; 122 1a26e: fc 01 movw r30, r24 1a270: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1a272: 88 23 and r24, r24 1a274: d1 f0 breq .+52 ; 0x1a2aa // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1a276: 90 e0 ldi r25, 0x00 ; 0 1a278: 88 0f add r24, r24 1a27a: 99 1f adc r25, r25 1a27c: fc 01 movw r30, r24 1a27e: e2 5f subi r30, 0xF2 ; 242 1a280: fa 47 sbci r31, 0x7A ; 122 1a282: a5 91 lpm r26, Z+ 1a284: b4 91 lpm r27, Z out = portOutputRegister(port); 1a286: fc 01 movw r30, r24 1a288: e8 5d subi r30, 0xD8 ; 216 1a28a: fa 47 sbci r31, 0x7A ; 122 1a28c: c5 91 lpm r28, Z+ 1a28e: d4 91 lpm r29, Z if (mode == INPUT) { 1a290: 61 11 cpse r22, r1 1a292: 0e c0 rjmp .+28 ; 0x1a2b0 uint8_t oldSREG = SREG; 1a294: 9f b7 in r25, 0x3f ; 63 cli(); 1a296: f8 94 cli *reg &= ~bit; 1a298: 8c 91 ld r24, X 1a29a: e2 2f mov r30, r18 1a29c: e0 95 com r30 1a29e: 8e 23 and r24, r30 1a2a0: 8c 93 st X, r24 *out &= ~bit; 1a2a2: 28 81 ld r18, Y 1a2a4: e2 23 and r30, r18 1a2a6: e8 83 st Y, r30 SREG = oldSREG; 1a2a8: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1a2aa: df 91 pop r29 1a2ac: cf 91 pop r28 1a2ae: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1a2b0: 8f b7 in r24, 0x3f ; 63 cli(); 1a2b2: f8 94 cli *reg |= bit; 1a2b4: ec 91 ld r30, X 1a2b6: e2 2b or r30, r18 1a2b8: ec 93 st X, r30 SREG = oldSREG; 1a2ba: 8f bf out 0x3f, r24 ; 63 1a2bc: f6 cf rjmp .-20 ; 0x1a2aa 0001a2be : // 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) { 1a2be: 1f 93 push r17 1a2c0: cf 93 push r28 1a2c2: df 93 push r29 1a2c4: 18 2f mov r17, r24 1a2c6: 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); 1a2c8: 61 e0 ldi r22, 0x01 ; 1 1a2ca: 0e 94 2e d1 call 0x1a25c ; 0x1a25c if (val == 0) 1a2ce: 20 97 sbiw r28, 0x00 ; 0 1a2d0: 39 f4 brne .+14 ; 0x1a2e0 { digitalWrite(pin, LOW); 1a2d2: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1a2d4: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1a2d6: df 91 pop r29 1a2d8: cf 91 pop r28 1a2da: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1a2dc: 0c 94 00 d1 jmp 0x1a200 ; 0x1a200 pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1a2e0: cf 3f cpi r28, 0xFF ; 255 1a2e2: d1 05 cpc r29, r1 1a2e4: 11 f4 brne .+4 ; 0x1a2ea { digitalWrite(pin, HIGH); 1a2e6: 61 e0 ldi r22, 0x01 ; 1 1a2e8: f5 cf rjmp .-22 ; 0x1a2d4 } else { switch(digitalPinToTimer(pin)) 1a2ea: e1 2f mov r30, r17 1a2ec: f0 e0 ldi r31, 0x00 ; 0 1a2ee: e8 5f subi r30, 0xF8 ; 248 1a2f0: f9 47 sbci r31, 0x79 ; 121 1a2f2: e4 91 lpm r30, Z 1a2f4: e1 50 subi r30, 0x01 ; 1 1a2f6: e2 31 cpi r30, 0x12 ; 18 1a2f8: 08 f0 brcs .+2 ; 0x1a2fc 1a2fa: b3 c0 rjmp .+358 ; 0x1a462 1a2fc: f0 e0 ldi r31, 0x00 ; 0 1a2fe: 88 27 eor r24, r24 1a300: eb 57 subi r30, 0x7B ; 123 1a302: fe 42 sbci r31, 0x2E ; 46 1a304: 8f 4f sbci r24, 0xFF ; 255 1a306: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 1a30a: 97 d1 rcall .+814 ; 0x1a63a 1a30c: 9f d1 rcall .+830 ; 0x1a64c 1a30e: a4 d1 rcall .+840 ; 0x1a658 1a310: ae d1 rcall .+860 ; 0x1a66e 1a312: b8 d1 rcall .+880 ; 0x1a684 1a314: 31 d2 rcall .+1122 ; 0x1a778 1a316: c2 d1 rcall .+900 ; 0x1a69c 1a318: ca d1 rcall .+916 ; 0x1a6ae 1a31a: d2 d1 rcall .+932 ; 0x1a6c0 1a31c: dc d1 rcall .+952 ; 0x1a6d6 1a31e: e6 d1 rcall .+972 ; 0x1a6ec 1a320: f0 d1 rcall .+992 ; 0x1a702 1a322: ff d1 rcall .+1022 ; 0x1a722 1a324: 09 d2 rcall .+1042 ; 0x1a738 1a326: 31 d2 rcall .+1122 ; 0x1a78a 1a328: 13 d2 rcall .+1062 ; 0x1a750 1a32a: 1d d2 rcall .+1082 ; 0x1a766 1a32c: 27 d2 rcall .+1102 ; 0x1a77c #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1a32e: 84 b5 in r24, 0x24 ; 36 1a330: 80 68 ori r24, 0x80 ; 128 1a332: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1a334: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1a336: df 91 pop r29 1a338: cf 91 pop r28 1a33a: 1f 91 pop r17 1a33c: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1a33e: 84 b5 in r24, 0x24 ; 36 1a340: 80 62 ori r24, 0x20 ; 32 1a342: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1a344: c8 bd out 0x28, r28 ; 40 1a346: f7 cf rjmp .-18 ; 0x1a336 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1a348: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a34c: 80 68 ori r24, 0x80 ; 128 1a34e: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1a352: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1a356: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1a35a: ed cf rjmp .-38 ; 0x1a336 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1a35c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a360: 80 62 ori r24, 0x20 ; 32 1a362: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1a366: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1a36a: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1a36e: e3 cf rjmp .-58 ; 0x1a336 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1a370: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a374: 88 60 ori r24, 0x08 ; 8 1a376: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1a37a: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1a37e: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1a382: d9 cf rjmp .-78 ; 0x1a336 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1a384: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1a388: 80 68 ori r24, 0x80 ; 128 1a38a: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1a38e: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1a392: d1 cf rjmp .-94 ; 0x1a336 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1a394: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1a398: 80 62 ori r24, 0x20 ; 32 1a39a: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1a39e: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1a3a2: c9 cf rjmp .-110 ; 0x1a336 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1a3a4: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a3a8: 80 68 ori r24, 0x80 ; 128 1a3aa: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1a3ae: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1a3b2: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1a3b6: bf cf rjmp .-130 ; 0x1a336 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1a3b8: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a3bc: 80 62 ori r24, 0x20 ; 32 1a3be: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1a3c2: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1a3c6: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1a3ca: b5 cf rjmp .-150 ; 0x1a336 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1a3cc: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a3d0: 88 60 ori r24, 0x08 ; 8 1a3d2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1a3d6: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1a3da: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1a3de: ab cf rjmp .-170 ; 0x1a336 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1a3e0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a3e4: 80 68 ori r24, 0x80 ; 128 1a3e6: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1a3ea: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a3ee: 8f 7b andi r24, 0xBF ; 191 1a3f0: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1a3f4: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1a3f8: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1a3fc: 9c cf rjmp .-200 ; 0x1a336 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1a3fe: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a402: 80 62 ori r24, 0x20 ; 32 1a404: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1a408: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1a40c: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1a410: 92 cf rjmp .-220 ; 0x1a336 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1a412: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a416: 88 60 ori r24, 0x08 ; 8 1a418: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1a41c: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1a420: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1a424: 88 cf rjmp .-240 ; 0x1a336 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1a426: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a42a: 80 68 ori r24, 0x80 ; 128 1a42c: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1a430: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1a434: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1a438: 7e cf rjmp .-260 ; 0x1a336 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1a43a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a43e: 80 62 ori r24, 0x20 ; 32 1a440: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1a444: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1a448: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1a44c: 74 cf rjmp .-280 ; 0x1a336 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1a44e: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a452: 88 60 ori r24, 0x08 ; 8 1a454: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1a458: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1a45c: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1a460: 6a cf rjmp .-300 ; 0x1a336 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1a462: c0 38 cpi r28, 0x80 ; 128 1a464: d1 05 cpc r29, r1 1a466: 0c f0 brlt .+2 ; 0x1a46a 1a468: 3e cf rjmp .-388 ; 0x1a2e6 1a46a: 33 cf rjmp .-410 ; 0x1a2d2 0001a46c : } } /// 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){ 1a46c: 4f 92 push r4 1a46e: 5f 92 push r5 1a470: 6f 92 push r6 1a472: 7f 92 push r7 1a474: 8f 92 push r8 1a476: 9f 92 push r9 1a478: af 92 push r10 1a47a: bf 92 push r11 1a47c: cf 92 push r12 1a47e: df 92 push r13 1a480: ef 92 push r14 1a482: ff 92 push r15 1a484: 0f 93 push r16 1a486: 1f 93 push r17 1a488: cf 93 push r28 1a48a: df 93 push r29 1a48c: eb 01 movw r28, r22 1a48e: 6a 01 movw r12, r20 1a490: 79 01 movw r14, r18 sm4_do_step(axes); 1a492: 0f 94 1d 26 call 0x24c3a ; 0x24c3a 1a496: f6 01 movw r30, r12 1a498: 00 81 ld r16, Z 1a49a: 11 81 ldd r17, Z+1 ; 0x01 /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ 1a49c: 1c 16 cp r1, r28 1a49e: 1d 06 cpc r1, r29 1a4a0: b4 f4 brge .+44 ; 0x1a4ce 1a4a2: 0e 15 cp r16, r14 1a4a4: 1f 05 cpc r17, r15 1a4a6: 99 f4 brne .+38 ; 0x1a4ce delayMicroseconds(delay_us); 1a4a8: c8 01 movw r24, r16 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1a4aa: df 91 pop r29 1a4ac: cf 91 pop r28 1a4ae: 1f 91 pop r17 1a4b0: 0f 91 pop r16 1a4b2: ff 90 pop r15 1a4b4: ef 90 pop r14 1a4b6: df 90 pop r13 1a4b8: cf 90 pop r12 1a4ba: bf 90 pop r11 1a4bc: af 90 pop r10 1a4be: 9f 90 pop r9 1a4c0: 8f 90 pop r8 1a4c2: 7f 90 pop r7 1a4c4: 6f 90 pop r6 1a4c6: 5f 90 pop r5 1a4c8: 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); 1a4ca: 0c 94 cc d0 jmp 0x1a198 ; 0x1a198 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1a4ce: b8 01 movw r22, r16 1a4d0: 90 e0 ldi r25, 0x00 ; 0 1a4d2: 80 e0 ldi r24, 0x00 ; 0 1a4d4: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 1a4d8: 2d eb ldi r18, 0xBD ; 189 1a4da: 37 e3 ldi r19, 0x37 ; 55 1a4dc: 46 e8 ldi r20, 0x86 ; 134 1a4de: 55 e3 ldi r21, 0x35 ; 53 1a4e0: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1a4e4: 4b 01 movw r8, r22 1a4e6: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1a4e8: be 01 movw r22, r28 1a4ea: 0d 2e mov r0, r29 1a4ec: 00 0c add r0, r0 1a4ee: 88 0b sbc r24, r24 1a4f0: 99 0b sbc r25, r25 1a4f2: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1a4f6: a5 01 movw r20, r10 1a4f8: 94 01 movw r18, r8 1a4fa: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1a4fe: 2b 01 movw r4, r22 1a500: 3c 01 movw r6, r24 1a502: a5 01 movw r20, r10 1a504: 94 01 movw r18, r8 1a506: 6a e0 ldi r22, 0x0A ; 10 1a508: 77 ed ldi r23, 0xD7 ; 215 1a50a: 83 e2 ldi r24, 0x23 ; 35 1a50c: 9c e3 ldi r25, 0x3C ; 60 1a50e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1a512: 9b 01 movw r18, r22 1a514: ac 01 movw r20, r24 1a516: c3 01 movw r24, r6 1a518: b2 01 movw r22, r4 1a51a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1a51e: 4b 01 movw r8, r22 1a520: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1a522: 2a e0 ldi r18, 0x0A ; 10 1a524: 37 ed ldi r19, 0xD7 ; 215 1a526: 43 e2 ldi r20, 0x23 ; 35 1a528: 5e e3 ldi r21, 0x3E ; 62 1a52a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1a52e: 18 16 cp r1, r24 1a530: dc f5 brge .+118 ; 0x1a5a8 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)); 1a532: a5 01 movw r20, r10 1a534: 94 01 movw r18, r8 1a536: 6a e0 ldi r22, 0x0A ; 10 1a538: 77 ed ldi r23, 0xD7 ; 215 1a53a: 83 e2 ldi r24, 0x23 ; 35 1a53c: 9c e3 ldi r25, 0x3C ; 60 1a53e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1a542: 20 e0 ldi r18, 0x00 ; 0 1a544: 34 e2 ldi r19, 0x24 ; 36 1a546: 44 e7 ldi r20, 0x74 ; 116 1a548: 59 e4 ldi r21, 0x49 ; 73 1a54a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__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); 1a54e: 20 e0 ldi r18, 0x00 ; 0 1a550: 30 e0 ldi r19, 0x00 ; 0 1a552: 40 e0 ldi r20, 0x00 ; 0 1a554: 5f e3 ldi r21, 0x3F ; 63 1a556: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1a55a: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 1a55e: 5b 01 movw r10, r22 1a560: 6e 15 cp r22, r14 1a562: 7f 05 cpc r23, r15 1a564: 08 f4 brcc .+2 ; 0x1a568 1a566: 57 01 movw r10, r14 /// 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){ 1a568: 0a 15 cp r16, r10 1a56a: 1b 05 cpc r17, r11 1a56c: 31 f4 brne .+12 ; 0x1a57a 1a56e: 20 97 sbiw r28, 0x00 ; 0 1a570: 21 f0 breq .+8 ; 0x1a57a if (acc > 0) 1a572: fc f0 brlt .+62 ; 0x1a5b2 t1--; 1a574: f1 e0 ldi r31, 0x01 ; 1 1a576: af 1a sub r10, r31 1a578: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1a57a: c5 01 movw r24, r10 1a57c: 0e 94 cc d0 call 0x1a198 ; 0x1a198 delay_us = t1; 1a580: f6 01 movw r30, r12 1a582: b1 82 std Z+1, r11 ; 0x01 1a584: a0 82 st Z, r10 } 1a586: df 91 pop r29 1a588: cf 91 pop r28 1a58a: 1f 91 pop r17 1a58c: 0f 91 pop r16 1a58e: ff 90 pop r15 1a590: ef 90 pop r14 1a592: df 90 pop r13 1a594: cf 90 pop r12 1a596: bf 90 pop r11 1a598: af 90 pop r10 1a59a: 9f 90 pop r9 1a59c: 8f 90 pop r8 1a59e: 7f 90 pop r7 1a5a0: 6f 90 pop r6 1a5a2: 5f 90 pop r5 1a5a4: 4f 90 pop r4 1a5a6: 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 1a5a8: 80 e1 ldi r24, 0x10 ; 16 1a5aa: a8 2e mov r10, r24 1a5ac: 87 e2 ldi r24, 0x27 ; 39 1a5ae: b8 2e mov r11, r24 1a5b0: db cf rjmp .-74 ; 0x1a568 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1a5b2: 8f ef ldi r24, 0xFF ; 255 1a5b4: a8 1a sub r10, r24 1a5b6: b8 0a sbc r11, r24 1a5b8: e0 cf rjmp .-64 ; 0x1a57a 0001a5ba : /// 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){ 1a5ba: 2f 92 push r2 1a5bc: 3f 92 push r3 1a5be: 4f 92 push r4 1a5c0: 5f 92 push r5 1a5c2: 6f 92 push r6 1a5c4: 7f 92 push r7 1a5c6: 8f 92 push r8 1a5c8: 9f 92 push r9 1a5ca: af 92 push r10 1a5cc: bf 92 push r11 1a5ce: cf 92 push r12 1a5d0: df 92 push r13 1a5d2: ef 92 push r14 1a5d4: ff 92 push r15 1a5d6: 0f 93 push r16 1a5d8: 1f 93 push r17 1a5da: cf 93 push r28 1a5dc: df 93 push r29 1a5de: 00 d0 rcall .+0 ; 0x1a5e0 1a5e0: cd b7 in r28, 0x3d ; 61 1a5e2: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1a5e4: f9 01 movw r30, r18 1a5e6: e0 80 ld r14, Z 1a5e8: f1 80 ldd r15, Z+1 ; 0x01 1a5ea: e1 14 cp r14, r1 1a5ec: f1 04 cpc r15, r1 1a5ee: 09 f4 brne .+2 ; 0x1a5f2 1a5f0: 6c c0 rjmp .+216 ; 0x1a6ca 1a5f2: 16 16 cp r1, r22 1a5f4: 17 06 cpc r1, r23 1a5f6: 0c f0 brlt .+2 ; 0x1a5fa 1a5f8: 68 c0 rjmp .+208 ; 0x1a6ca 1a5fa: 19 01 movw r2, r18 1a5fc: 5b 83 std Y+3, r21 ; 0x03 1a5fe: 4a 83 std Y+2, r20 ; 0x02 1a600: 6b 01 movw r12, r22 1a602: 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)); 1a604: fa 01 movw r30, r20 1a606: 00 81 ld r16, Z 1a608: 11 81 ldd r17, Z+1 ; 0x01 1a60a: b8 01 movw r22, r16 1a60c: 90 e0 ldi r25, 0x00 ; 0 1a60e: 80 e0 ldi r24, 0x00 ; 0 1a610: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 1a614: 4b 01 movw r8, r22 1a616: 5c 01 movw r10, r24 1a618: b6 01 movw r22, r12 1a61a: 0d 2c mov r0, r13 1a61c: 00 0c add r0, r0 1a61e: 88 0b sbc r24, r24 1a620: 99 0b sbc r25, r25 1a622: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1a626: 2b 01 movw r4, r22 1a628: 3c 01 movw r6, r24 1a62a: a5 01 movw r20, r10 1a62c: 94 01 movw r18, r8 1a62e: c5 01 movw r24, r10 1a630: b4 01 movw r22, r8 1a632: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1a636: 9b 01 movw r18, r22 1a638: ac 01 movw r20, r24 1a63a: c3 01 movw r24, r6 1a63c: b2 01 movw r22, r4 1a63e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1a642: 9b 01 movw r18, r22 1a644: ac 01 movw r20, r24 1a646: 6a e0 ldi r22, 0x0A ; 10 1a648: 77 ed ldi r23, 0xD7 ; 215 1a64a: 83 ea ldi r24, 0xA3 ; 163 1a64c: 9b e3 ldi r25, 0x3B ; 59 1a64e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__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); 1a652: 20 e0 ldi r18, 0x00 ; 0 1a654: 30 e0 ldi r19, 0x00 ; 0 1a656: 40 e0 ldi r20, 0x00 ; 0 1a658: 5f e3 ldi r21, 0x3F ; 63 1a65a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1a65e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__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){ 1a662: 6e 15 cp r22, r14 1a664: 7f 05 cpc r23, r15 1a666: 30 f5 brcc .+76 ; 0x1a6b4 /// go steady sm4_do_step(axes); 1a668: 89 81 ldd r24, Y+1 ; 0x01 1a66a: 0f 94 1d 26 call 0x24c3a ; 0x24c3a delayMicroseconds(delay_us); 1a66e: ea 81 ldd r30, Y+2 ; 0x02 1a670: fb 81 ldd r31, Y+3 ; 0x03 1a672: 80 81 ld r24, Z 1a674: 91 81 ldd r25, Z+1 ; 0x01 1a676: 0e 94 cc d0 call 0x1a198 ; 0x1a198 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1a67a: f1 01 movw r30, r2 1a67c: 80 81 ld r24, Z 1a67e: 91 81 ldd r25, Z+1 ; 0x01 1a680: 01 97 sbiw r24, 0x01 ; 1 1a682: 91 83 std Z+1, r25 ; 0x01 1a684: 80 83 st Z, r24 return true; 1a686: 81 e0 ldi r24, 0x01 ; 1 } 1a688: 0f 90 pop r0 1a68a: 0f 90 pop r0 1a68c: 0f 90 pop r0 1a68e: df 91 pop r29 1a690: cf 91 pop r28 1a692: 1f 91 pop r17 1a694: 0f 91 pop r16 1a696: ff 90 pop r15 1a698: ef 90 pop r14 1a69a: df 90 pop r13 1a69c: cf 90 pop r12 1a69e: bf 90 pop r11 1a6a0: af 90 pop r10 1a6a2: 9f 90 pop r9 1a6a4: 8f 90 pop r8 1a6a6: 7f 90 pop r7 1a6a8: 6f 90 pop r6 1a6aa: 5f 90 pop r5 1a6ac: 4f 90 pop r4 1a6ae: 3f 90 pop r3 1a6b0: 2f 90 pop r2 1a6b2: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1a6b4: 66 27 eor r22, r22 1a6b6: 77 27 eor r23, r23 1a6b8: 6c 19 sub r22, r12 1a6ba: 7d 09 sbc r23, r13 1a6bc: 98 01 movw r18, r16 1a6be: 4a 81 ldd r20, Y+2 ; 0x02 1a6c0: 5b 81 ldd r21, Y+3 ; 0x03 1a6c2: 89 81 ldd r24, Y+1 ; 0x01 1a6c4: 0e 94 36 d2 call 0x1a46c ; 0x1a46c 1a6c8: d8 cf rjmp .-80 ; 0x1a67a /// 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; 1a6ca: 80 e0 ldi r24, 0x00 ; 0 1a6cc: dd cf rjmp .-70 ; 0x1a688 0001a6ce : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1a6ce: 0f 93 push r16 1a6d0: 1f 93 push r17 1a6d2: cf 93 push r28 1a6d4: df 93 push r29 1a6d6: 18 2f mov r17, r24 1a6d8: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1a6da: d1 e0 ldi r29, 0x01 ; 1 1a6dc: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1a6de: 81 2f mov r24, r17 1a6e0: 8d 23 and r24, r29 1a6e2: 29 f0 breq .+10 ; 0x1a6ee sm4_set_dir(i, dir & mask); 1a6e4: 60 2f mov r22, r16 1a6e6: 6d 23 and r22, r29 1a6e8: 8c 2f mov r24, r28 1a6ea: 0f 94 25 26 call 0x24c4a ; 0x24c4a } } } 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) { 1a6ee: cf 5f subi r28, 0xFF ; 255 1a6f0: dd 0f add r29, r29 1a6f2: c3 30 cpi r28, 0x03 ; 3 1a6f4: a1 f7 brne .-24 ; 0x1a6de if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1a6f6: df 91 pop r29 1a6f8: cf 91 pop r28 1a6fa: 1f 91 pop r17 1a6fc: 0f 91 pop r16 1a6fe: 08 95 ret 0001a700 : //@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) { 1a700: 8f 92 push r8 1a702: 9f 92 push r9 1a704: af 92 push r10 1a706: bf 92 push r11 1a708: cf 92 push r12 1a70a: df 92 push r13 1a70c: ef 92 push r14 1a70e: ff 92 push r15 1a710: 30 e0 ldi r19, 0x00 ; 0 1a712: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1a714: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1a716: 48 2f mov r20, r24 1a718: 49 23 and r20, r25 1a71a: 19 f1 breq .+70 ; 0x1a762 count_position[i] += dir & mask ? -1L : 1L; 1a71c: a9 01 movw r20, r18 1a71e: 44 0f add r20, r20 1a720: 55 1f adc r21, r21 1a722: 44 0f add r20, r20 1a724: 55 1f adc r21, r21 1a726: fa 01 movw r30, r20 1a728: e4 5b subi r30, 0xB4 ; 180 1a72a: f9 4f sbci r31, 0xF9 ; 249 1a72c: c0 80 ld r12, Z 1a72e: d1 80 ldd r13, Z+1 ; 0x01 1a730: e2 80 ldd r14, Z+2 ; 0x02 1a732: f3 80 ldd r15, Z+3 ; 0x03 1a734: 76 2f mov r23, r22 1a736: 79 23 and r23, r25 1a738: 81 2c mov r8, r1 1a73a: 91 2c mov r9, r1 1a73c: 54 01 movw r10, r8 1a73e: 83 94 inc r8 1a740: 77 23 and r23, r23 1a742: 21 f0 breq .+8 ; 0x1a74c 1a744: 88 24 eor r8, r8 1a746: 8a 94 dec r8 1a748: 98 2c mov r9, r8 1a74a: 54 01 movw r10, r8 1a74c: c8 0c add r12, r8 1a74e: d9 1c adc r13, r9 1a750: ea 1c adc r14, r10 1a752: fb 1c adc r15, r11 1a754: 44 5b subi r20, 0xB4 ; 180 1a756: 59 4f sbci r21, 0xF9 ; 249 1a758: fa 01 movw r30, r20 1a75a: c0 82 st Z, r12 1a75c: d1 82 std Z+1, r13 ; 0x01 1a75e: e2 82 std Z+2, r14 ; 0x02 1a760: 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) { 1a762: 99 0f add r25, r25 1a764: 2f 5f subi r18, 0xFF ; 255 1a766: 3f 4f sbci r19, 0xFF ; 255 1a768: 23 30 cpi r18, 0x03 ; 3 1a76a: 31 05 cpc r19, r1 1a76c: a1 f6 brne .-88 ; 0x1a716 if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1a76e: ff 90 pop r15 1a770: ef 90 pop r14 1a772: df 90 pop r13 1a774: cf 90 pop r12 1a776: bf 90 pop r11 1a778: af 90 pop r10 1a77a: 9f 90 pop r9 1a77c: 8f 90 pop r8 1a77e: 08 95 ret 0001a780 : /// 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) { 1a780: 2f 92 push r2 1a782: 3f 92 push r3 1a784: 4f 92 push r4 1a786: 5f 92 push r5 1a788: 6f 92 push r6 1a78a: 7f 92 push r7 1a78c: 8f 92 push r8 1a78e: 9f 92 push r9 1a790: af 92 push r10 1a792: bf 92 push r11 1a794: cf 92 push r12 1a796: df 92 push r13 1a798: ef 92 push r14 1a79a: ff 92 push r15 1a79c: 0f 93 push r16 1a79e: 1f 93 push r17 1a7a0: cf 93 push r28 1a7a2: df 93 push r29 1a7a4: 00 d0 rcall .+0 ; 0x1a7a6 1a7a6: 00 d0 rcall .+0 ; 0x1a7a8 1a7a8: cd b7 in r28, 0x3d ; 61 1a7aa: 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]; 1a7ac: c0 90 4c 06 lds r12, 0x064C ; 0x80064c 1a7b0: d0 90 4d 06 lds r13, 0x064D ; 0x80064d 1a7b4: e0 90 4e 06 lds r14, 0x064E ; 0x80064e 1a7b8: f0 90 4f 06 lds r15, 0x064F ; 0x80064f 1a7bc: 7c 01 movw r14, r24 1a7be: ec 18 sub r14, r12 1a7c0: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1a7c2: 80 91 50 06 lds r24, 0x0650 ; 0x800650 1a7c6: 90 91 51 06 lds r25, 0x0651 ; 0x800651 1a7ca: a0 91 52 06 lds r26, 0x0652 ; 0x800652 1a7ce: b0 91 53 06 lds r27, 0x0653 ; 0x800653 1a7d2: 68 1b sub r22, r24 1a7d4: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1a7d6: 80 91 54 06 lds r24, 0x0654 ; 0x800654 1a7da: 90 91 55 06 lds r25, 0x0655 ; 0x800655 1a7de: a0 91 56 06 lds r26, 0x0656 ; 0x800656 1a7e2: b0 91 57 06 lds r27, 0x0657 ; 0x800657 1a7e6: fa 01 movw r30, r20 1a7e8: e8 1b sub r30, r24 1a7ea: f9 0b sbc r31, r25 1a7ec: fa 83 std Y+2, r31 ; 0x02 1a7ee: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1a7f0: fb 01 movw r30, r22 1a7f2: ff 0f add r31, r31 1a7f4: ee 0b sbc r30, r30 1a7f6: ff 0f add r31, r31 1a7f8: fe 2f mov r31, r30 1a7fa: ee 1f adc r30, r30 1a7fc: e2 70 andi r30, 0x02 ; 2 1a7fe: 89 81 ldd r24, Y+1 ; 0x01 1a800: 9a 81 ldd r25, Y+2 ; 0x02 1a802: 88 e0 ldi r24, 0x08 ; 8 1a804: 98 02 muls r25, r24 1a806: 81 2d mov r24, r1 1a808: 99 0b sbc r25, r25 1a80a: 11 24 eor r1, r1 1a80c: 84 70 andi r24, 0x04 ; 4 1a80e: e8 2b or r30, r24 1a810: 8f 2d mov r24, r15 1a812: 88 1f adc r24, r24 1a814: 88 27 eor r24, r24 1a816: 88 1f adc r24, r24 1a818: e8 2b or r30, r24 1a81a: e0 93 f1 03 sts 0x03F1, r30 ; 0x8003f1 asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1a81e: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1a822: 98 7b andi r25, 0xB8 ; 184 //TODO -optimize in asm #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3)) dir_bits ^= dir_mask; 1a824: 87 e0 ldi r24, 0x07 ; 7 1a826: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 2; //set X direction bit 1a828: e0 fd sbrc r30, 0 1a82a: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 2) portL |= 1; //set Y direction bit 1a82c: e1 fd sbrc r30, 1 1a82e: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 4) portL |= 4; //set Z direction bit 1a830: e4 70 andi r30, 0x04 ; 4 1a832: 09 f0 breq .+2 ; 0x1a836 1a834: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 1) portL |= 1; //set X direction bit if (dir_bits & 2) portL |= 2; //set Y direction bit if (dir_bits & 4) portL |= 4; //set Z direction bit if (dir_bits & 8) portL |= 64; //set E direction bit #endif PORTL = portL; 1a836: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1a83a: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1a83c: 84 e4 ldi r24, 0x44 ; 68 1a83e: 9b eb ldi r25, 0xBB ; 187 1a840: 01 11 cpse r16, r1 1a842: 02 c0 rjmp .+4 ; 0x1a848 1a844: 90 e0 ldi r25, 0x00 ; 0 1a846: 80 e0 ldi r24, 0x00 ; 0 1a848: 90 93 25 06 sts 0x0625, r25 ; 0x800625 1a84c: 80 93 24 06 sts 0x0624, r24 ; 0x800624 xyzcal_sm4_delay = delay_us; 1a850: 30 93 f0 03 sts 0x03F0, r19 ; 0x8003f0 1a854: 20 93 ef 03 sts 0x03EF, r18 ; 0x8003ef // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1a858: 29 81 ldd r18, Y+1 ; 0x01 1a85a: 3a 81 ldd r19, Y+2 ; 0x02 1a85c: 3e 83 std Y+6, r19 ; 0x06 1a85e: 2d 83 std Y+5, r18 ; 0x05 1a860: 37 ff sbrs r19, 7 1a862: 05 c0 rjmp .+10 ; 0x1a86e 1a864: 31 95 neg r19 1a866: 21 95 neg r18 1a868: 31 09 sbc r19, r1 1a86a: 3e 83 std Y+6, r19 ; 0x06 1a86c: 2d 83 std Y+5, r18 ; 0x05 1a86e: 8b 01 movw r16, r22 1a870: 77 ff sbrs r23, 7 1a872: 03 c0 rjmp .+6 ; 0x1a87a 1a874: 11 95 neg r17 1a876: 01 95 neg r16 1a878: 11 09 sbc r17, r1 1a87a: f7 fe sbrs r15, 7 1a87c: 03 c0 rjmp .+6 ; 0x1a884 1a87e: f1 94 neg r15 1a880: e1 94 neg r14 1a882: 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); 1a884: 98 01 movw r18, r16 1a886: d8 01 movw r26, r16 1a888: 0f 94 b5 a4 call 0x3496a ; 0x3496a <__mulhisi3> 1a88c: 4b 01 movw r8, r22 1a88e: 5c 01 movw r10, r24 1a890: 2d 81 ldd r18, Y+5 ; 0x05 1a892: 3e 81 ldd r19, Y+6 ; 0x06 1a894: d9 01 movw r26, r18 1a896: 0f 94 b5 a4 call 0x3496a ; 0x3496a <__mulhisi3> 1a89a: 86 0e add r8, r22 1a89c: 97 1e adc r9, r23 1a89e: a8 1e adc r10, r24 1a8a0: b9 1e adc r11, r25 1a8a2: 97 01 movw r18, r14 1a8a4: d7 01 movw r26, r14 1a8a6: 0f 94 b5 a4 call 0x3496a ; 0x3496a <__mulhisi3> 1a8aa: 68 0d add r22, r8 1a8ac: 79 1d adc r23, r9 1a8ae: 8a 1d adc r24, r10 1a8b0: 9b 1d adc r25, r11 1a8b2: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 1a8b6: 0f 94 93 a8 call 0x35126 ; 0x35126 1a8ba: 20 e0 ldi r18, 0x00 ; 0 1a8bc: 30 e0 ldi r19, 0x00 ; 0 1a8be: 40 e0 ldi r20, 0x00 ; 0 1a8c0: 5f e3 ldi r21, 0x3F ; 63 1a8c2: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1a8c6: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 1a8ca: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1a8cc: 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; 1a8ce: 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; 1a8d0: 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; 1a8d2: 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; 1a8d4: 1c 82 std Y+4, r1 ; 0x04 1a8d6: 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; 1a8d8: 31 2c mov r3, r1 1a8da: 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; 1a8dc: 1a 82 std Y+2, r1 ; 0x02 1a8de: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1a8e0: 61 14 cp r6, r1 1a8e2: 71 04 cpc r7, r1 1a8e4: 09 f4 brne .+2 ; 0x1a8e8 1a8e6: 48 c0 rjmp .+144 ; 0x1a978 if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1a8e8: e0 91 24 06 lds r30, 0x0624 ; 0x800624 1a8ec: f0 91 25 06 lds r31, 0x0625 ; 0x800625 1a8f0: 30 97 sbiw r30, 0x00 ; 0 1a8f2: f1 f5 brne .+124 ; 0x1a970 uint8_t sm = 0; //step mask 1a8f4: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1a8f6: ec 14 cp r14, r12 1a8f8: fd 04 cpc r15, r13 1a8fa: 40 f0 brcs .+16 ; 0x1a90c sm |= 1; cx += dd; 1a8fc: c4 0c add r12, r4 1a8fe: d5 1c adc r13, r5 x++; 1a900: 89 81 ldd r24, Y+1 ; 0x01 1a902: 9a 81 ldd r25, Y+2 ; 0x02 1a904: 01 96 adiw r24, 0x01 ; 1 1a906: 9a 83 std Y+2, r25 ; 0x02 1a908: 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; 1a90a: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1a90c: 0a 15 cp r16, r10 1a90e: 1b 05 cpc r17, r11 1a910: 30 f0 brcs .+12 ; 0x1a91e sm |= 2; 1a912: 82 60 ori r24, 0x02 ; 2 cy += dd; 1a914: a4 0c add r10, r4 1a916: b5 1c adc r11, r5 y++; 1a918: 9f ef ldi r25, 0xFF ; 255 1a91a: 29 1a sub r2, r25 1a91c: 39 0a sbc r3, r25 } if (cz <= dz){ 1a91e: ed 81 ldd r30, Y+5 ; 0x05 1a920: fe 81 ldd r31, Y+6 ; 0x06 1a922: e8 15 cp r30, r8 1a924: f9 05 cpc r31, r9 1a926: 48 f0 brcs .+18 ; 0x1a93a sm |= 4; 1a928: 84 60 ori r24, 0x04 ; 4 cz += dd; 1a92a: 84 0c add r8, r4 1a92c: 95 1c adc r9, r5 z++; 1a92e: 2b 81 ldd r18, Y+3 ; 0x03 1a930: 3c 81 ldd r19, Y+4 ; 0x04 1a932: 2f 5f subi r18, 0xFF ; 255 1a934: 3f 4f sbci r19, 0xFF ; 255 1a936: 3c 83 std Y+4, r19 ; 0x04 1a938: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1a93a: ce 18 sub r12, r14 1a93c: df 08 sbc r13, r15 cy -= dy; 1a93e: a0 1a sub r10, r16 1a940: b1 0a sbc r11, r17 cz -= dz; 1a942: ed 81 ldd r30, Y+5 ; 0x05 1a944: fe 81 ldd r31, Y+6 ; 0x06 1a946: 8e 1a sub r8, r30 1a948: 9f 0a sbc r9, r31 sm4_do_step(sm); 1a94a: 0f 94 1d 26 call 0x24c3a ; 0x24c3a uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); 1a94e: e0 91 20 06 lds r30, 0x0620 ; 0x800620 1a952: f0 91 21 06 lds r31, 0x0621 ; 0x800621 1a956: 30 97 sbiw r30, 0x00 ; 0 1a958: d1 f1 breq .+116 ; 0x1a9ce 1a95a: b2 01 movw r22, r4 1a95c: c3 01 movw r24, r6 1a95e: 19 95 eicall if (delay) delayMicroseconds(delay); 1a960: 00 97 sbiw r24, 0x00 ; 0 1a962: 11 f0 breq .+4 ; 0x1a968 1a964: 0e 94 cc d0 call 0x1a198 ; 0x1a198 nd--; 1a968: f1 e0 ldi r31, 0x01 ; 1 1a96a: 6f 1a sub r6, r31 1a96c: 71 08 sbc r7, r1 1a96e: b8 cf rjmp .-144 ; 0x1a8e0 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; 1a970: 19 95 eicall 1a972: 88 23 and r24, r24 1a974: 09 f4 brne .+2 ; 0x1a978 1a976: be cf rjmp .-132 ; 0x1a8f4 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) 1a978: e0 91 22 06 lds r30, 0x0622 ; 0x800622 1a97c: f0 91 23 06 lds r31, 0x0623 ; 0x800623 1a980: 30 97 sbiw r30, 0x00 ; 0 1a982: 41 f0 breq .+16 ; 0x1a994 (*sm4_update_pos_cb)(x, y, z, 0); 1a984: 30 e0 ldi r19, 0x00 ; 0 1a986: 20 e0 ldi r18, 0x00 ; 0 1a988: 4b 81 ldd r20, Y+3 ; 0x03 1a98a: 5c 81 ldd r21, Y+4 ; 0x04 1a98c: b1 01 movw r22, r2 1a98e: 89 81 ldd r24, Y+1 ; 0x01 1a990: 9a 81 ldd r25, Y+2 ; 0x02 1a992: 19 95 eicall 1a994: 81 e0 ldi r24, 0x01 ; 1 1a996: 67 28 or r6, r7 1a998: 09 f4 brne .+2 ; 0x1a99c 1a99a: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1a99c: 26 96 adiw r28, 0x06 ; 6 1a99e: 0f b6 in r0, 0x3f ; 63 1a9a0: f8 94 cli 1a9a2: de bf out 0x3e, r29 ; 62 1a9a4: 0f be out 0x3f, r0 ; 63 1a9a6: cd bf out 0x3d, r28 ; 61 1a9a8: df 91 pop r29 1a9aa: cf 91 pop r28 1a9ac: 1f 91 pop r17 1a9ae: 0f 91 pop r16 1a9b0: ff 90 pop r15 1a9b2: ef 90 pop r14 1a9b4: df 90 pop r13 1a9b6: cf 90 pop r12 1a9b8: bf 90 pop r11 1a9ba: af 90 pop r10 1a9bc: 9f 90 pop r9 1a9be: 8f 90 pop r8 1a9c0: 7f 90 pop r7 1a9c2: 6f 90 pop r6 1a9c4: 5f 90 pop r5 1a9c6: 4f 90 pop r4 1a9c8: 3f 90 pop r3 1a9ca: 2f 90 pop r2 1a9cc: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1a9ce: 84 ef ldi r24, 0xF4 ; 244 1a9d0: 91 e0 ldi r25, 0x01 ; 1 1a9d2: c8 cf rjmp .-112 ; 0x1a964 0001a9d4 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1a9d4: cf 93 push r28 1a9d6: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1a9d8: 86 ea ldi r24, 0xA6 ; 166 1a9da: 9c e0 ldi r25, 0x0C ; 12 1a9dc: 0f 94 9d a3 call 0x3473a ; 0x3473a status &= ~components; 1a9e0: c0 95 com r28 1a9e2: 6c 2f mov r22, r28 1a9e4: 68 23 and r22, r24 1a9e6: 86 ea ldi r24, 0xA6 ; 166 1a9e8: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1a9ea: cf 91 pop r28 1a9ec: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 0001a9f0 : } } } static void lcd_reset_sheet() { 1a9f0: 1f 93 push r17 1a9f2: cf 93 push r28 1a9f4: df 93 push r29 1a9f6: 00 d0 rcall .+0 ; 0x1a9f8 1a9f8: 00 d0 rcall .+0 ; 0x1a9fa 1a9fa: 1f 92 push r1 1a9fc: 1f 92 push r1 1a9fe: cd b7 in r28, 0x3d ; 61 1aa00: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1aa02: be 01 movw r22, r28 1aa04: 6f 5f subi r22, 0xFF ; 255 1aa06: 7f 4f sbci r23, 0xFF ; 255 1aa08: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 1aa0c: 0e 94 88 78 call 0xf110 ; 0xf110 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1aa10: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 1aa14: 1b e0 ldi r17, 0x0B ; 11 1aa16: 81 9f mul r24, r17 1aa18: c0 01 movw r24, r0 1aa1a: 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); 1aa1c: 6f ef ldi r22, 0xFF ; 255 1aa1e: 7f ef ldi r23, 0xFF ; 255 1aa20: 80 5b subi r24, 0xB0 ; 176 1aa22: 92 4f sbci r25, 0xF2 ; 242 1aa24: 0f 94 df a3 call 0x347be ; 0x347be eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1aa28: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 1aa2c: 61 9f mul r22, r17 1aa2e: b0 01 movw r22, r0 1aa30: 11 24 eor r1, r1 1aa32: 67 5b subi r22, 0xB7 ; 183 1aa34: 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); 1aa36: 47 e0 ldi r20, 0x07 ; 7 1aa38: 50 e0 ldi r21, 0x00 ; 0 1aa3a: ce 01 movw r24, r28 1aa3c: 01 96 adiw r24, 0x01 ; 1 1aa3e: 0f 94 b1 a3 call 0x34762 ; 0x34762 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1aa42: 81 ea ldi r24, 0xA1 ; 161 1aa44: 9d e0 ldi r25, 0x0D ; 13 1aa46: 0f 94 9d a3 call 0x3473a ; 0x3473a 1aa4a: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1aa4e: 89 13 cpse r24, r25 1aa50: 0a c0 rjmp .+20 ; 0x1aa66 { eeprom_switch_to_next_sheet(); 1aa52: 0e 94 7a 78 call 0xf0f4 ; 0xf0f4 if (-1 == eeprom_next_initialized_sheet(0)) 1aa56: 80 e0 ldi r24, 0x00 ; 0 1aa58: 0e 94 66 78 call 0xf0cc ; 0xf0cc 1aa5c: 8f 3f cpi r24, 0xFF ; 255 1aa5e: 19 f4 brne .+6 ; 0x1aa66 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1aa60: 80 e1 ldi r24, 0x10 ; 16 1aa62: 0e 94 ea d4 call 0x1a9d4 ; 0x1a9d4 } menu_back(); 1aa66: 0e 94 eb 62 call 0xc5d6 ; 0xc5d6 } 1aa6a: 28 96 adiw r28, 0x08 ; 8 1aa6c: 0f b6 in r0, 0x3f ; 63 1aa6e: f8 94 cli 1aa70: de bf out 0x3e, r29 ; 62 1aa72: 0f be out 0x3f, r0 ; 63 1aa74: cd bf out 0x3d, r28 ; 61 1aa76: df 91 pop r29 1aa78: cf 91 pop r28 1aa7a: 1f 91 pop r17 1aa7c: 08 95 ret 0001aa7e : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1aa7e: cf 93 push r28 1aa80: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1aa82: 86 ea ldi r24, 0xA6 ; 166 1aa84: 9c e0 ldi r25, 0x0C ; 12 1aa86: 0f 94 9d a3 call 0x3473a ; 0x3473a status |= components; 1aa8a: 68 2f mov r22, r24 1aa8c: 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); 1aa8e: 86 ea ldi r24, 0xA6 ; 166 1aa90: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1aa92: cf 91 pop r28 1aa94: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 0001aa98 : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1aa98: cf 93 push r28 1aa9a: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1aa9c: 86 ea ldi r24, 0xA6 ; 166 1aa9e: 9c e0 ldi r25, 0x0C ; 12 1aaa0: 0f 94 9d a3 call 0x3473a ; 0x3473a return ((status & components) == components); 1aaa4: 98 2f mov r25, r24 1aaa6: 9c 23 and r25, r28 1aaa8: 81 e0 ldi r24, 0x01 ; 1 1aaaa: 9c 13 cpse r25, r28 1aaac: 80 e0 ldi r24, 0x00 ; 0 } 1aaae: cf 91 pop r28 1aab0: 08 95 ret 0001aab2 : * @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() { 1aab2: ef 92 push r14 1aab4: ff 92 push r15 1aab6: 0f 93 push r16 1aab8: 1f 93 push r17 1aaba: cf 93 push r28 1aabc: df 93 push r29 1aabe: cd b7 in r28, 0x3d ; 61 1aac0: de b7 in r29, 0x3e ; 62 1aac2: 63 97 sbiw r28, 0x13 ; 19 1aac4: 0f b6 in r0, 0x3f ; 63 1aac6: f8 94 cli 1aac8: de bf out 0x3e, r29 ; 62 1aaca: 0f be out 0x3f, r0 ; 63 1aacc: 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) 1aace: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1aad2: 81 11 cpse r24, r1 1aad4: 3a c0 rjmp .+116 ; 0x1ab4a { // Menu was entered. // Initialize its status. _md->status = 1; 1aad6: 81 e0 ldi r24, 0x01 ; 1 1aad8: 80 93 96 03 sts 0x0396, r24 ; 0x800396 check_babystep(); 1aadc: 0e 94 ec 7c call 0xf9d8 ; 0xf9d8 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 1aae0: 81 ea ldi r24, 0xA1 ; 161 1aae2: 9d e0 ldi r25, 0x0D ; 13 1aae4: 0f 94 9d a3 call 0x3473a ; 0x3473a 1aae8: 18 2f mov r17, r24 1aaea: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 1aaee: 81 11 cpse r24, r1 1aaf0: ee c0 rjmp .+476 ; 0x1acce _md->babystepMemZ = 0; 1aaf2: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1aaf6: 10 92 97 03 sts 0x0397, r1 ; 0x800397 _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)) 1aafa: 80 e1 ldi r24, 0x10 ; 16 1aafc: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 1ab00: 81 11 cpse r24, r1 1ab02: 04 c0 rjmp .+8 ; 0x1ab0c _md->babystepMemZ = 0; 1ab04: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1ab08: 10 92 97 03 sts 0x0397, r1 ; 0x800397 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 1ab0c: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1ab10: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ab14: 07 2e mov r0, r23 1ab16: 00 0c add r0, r0 1ab18: 88 0b sbc r24, r24 1ab1a: 99 0b sbc r25, r25 1ab1c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1ab20: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ab24: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ab28: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1ab2c: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1ab30: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1ab34: 60 93 99 03 sts 0x0399, r22 ; 0x800399 1ab38: 70 93 9a 03 sts 0x039A, r23 ; 0x80039a 1ab3c: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b 1ab40: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c lcd_draw_update = 1; 1ab44: 81 e0 ldi r24, 0x01 ; 1 1ab46: 80 93 59 02 sts 0x0259, r24 ; 0x800259 //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 1ab4a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1ab4e: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1ab52: 00 97 sbiw r24, 0x00 ; 0 1ab54: f1 f1 breq .+124 ; 0x1abd2 { _md->babystepMemZ += lcd_encoder; 1ab56: 20 91 97 03 lds r18, 0x0397 ; 0x800397 1ab5a: 30 91 98 03 lds r19, 0x0398 ; 0x800398 1ab5e: 28 0f add r18, r24 1ab60: 39 1f adc r19, r25 1ab62: 30 93 98 03 sts 0x0398, r19 ; 0x800398 1ab66: 20 93 97 03 sts 0x0397, r18 ; 0x800397 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 1ab6a: 21 36 cpi r18, 0x61 ; 97 1ab6c: 40 ef ldi r20, 0xF0 ; 240 1ab6e: 34 07 cpc r19, r20 1ab70: 0c f0 brlt .+2 ; 0x1ab74 1ab72: ba c0 rjmp .+372 ; 0x1ace8 1ab74: 81 e6 ldi r24, 0x61 ; 97 1ab76: 90 ef ldi r25, 0xF0 ; 240 1ab78: 90 93 98 03 sts 0x0398, r25 ; 0x800398 1ab7c: 80 93 97 03 sts 0x0397, r24 ; 0x800397 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]; 1ab80: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1ab84: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ab88: 07 2e mov r0, r23 1ab8a: 00 0c add r0, r0 1ab8c: 88 0b sbc r24, r24 1ab8e: 99 0b sbc r25, r25 1ab90: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1ab94: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ab98: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ab9c: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1aba0: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1aba4: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1aba8: 60 93 99 03 sts 0x0399, r22 ; 0x800399 1abac: 70 93 9a 03 sts 0x039A, r23 ; 0x80039a 1abb0: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b 1abb4: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c _delay(50); 1abb8: 62 e3 ldi r22, 0x32 ; 50 1abba: 70 e0 ldi r23, 0x00 ; 0 1abbc: 80 e0 ldi r24, 0x00 ; 0 1abbe: 90 e0 ldi r25, 0x00 ; 0 1abc0: 0f 94 23 0b call 0x21646 ; 0x21646 lcd_encoder = 0; 1abc4: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1abc8: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_draw_update = 1; 1abcc: 81 e0 ldi r24, 0x01 ; 1 1abce: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } if (lcd_draw_update) 1abd2: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1abd6: 88 23 and r24, r24 1abd8: c9 f1 breq .+114 ; 0x1ac4c { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 1abda: 81 ea ldi r24, 0xA1 ; 161 1abdc: 9d e0 ldi r25, 0x0D ; 13 1abde: 0f 94 9d a3 call 0x3473a ; 0x3473a 1abe2: 2b e0 ldi r18, 0x0B ; 11 1abe4: 82 9f mul r24, r18 1abe6: c0 01 movw r24, r0 1abe8: 11 24 eor r1, r1 1abea: be 01 movw r22, r28 1abec: 6f 5f subi r22, 0xFF ; 255 1abee: 7f 4f sbci r23, 0xFF ; 255 1abf0: 87 5b subi r24, 0xB7 ; 183 1abf2: 92 4f sbci r25, 0xF2 ; 242 1abf4: 0e 94 cd 75 call 0xeb9a ; 0xeb9a lcd_home(); 1abf8: 0e 94 ef 6f call 0xdfde ; 0xdfde lcd_print(buffer.c); 1abfc: ce 01 movw r24, r28 1abfe: 01 96 adiw r24, 0x01 ; 1 1ac00: 0e 94 2f 73 call 0xe65e ; 0xe65e lcd_set_cursor(0, 1); 1ac04: 61 e0 ldi r22, 0x01 ; 1 1ac06: 80 e0 ldi r24, 0x00 ; 0 1ac08: 0e 94 2a 6f call 0xde54 ; 0xde54 menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 1ac0c: 10 91 99 03 lds r17, 0x0399 ; 0x800399 1ac10: 00 91 9a 03 lds r16, 0x039A ; 0x80039a 1ac14: f0 90 9b 03 lds r15, 0x039B ; 0x80039b 1ac18: e0 90 9c 03 lds r14, 0x039C ; 0x80039c 1ac1c: 83 e8 ldi r24, 0x83 ; 131 1ac1e: 9a e3 ldi r25, 0x3A ; 58 1ac20: 0e 94 0a 75 call 0xea14 ; 0xea14 //! (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); 1ac24: ef 92 push r14 1ac26: ff 92 push r15 1ac28: 0f 93 push r16 1ac2a: 1f 93 push r17 1ac2c: 9f 93 push r25 1ac2e: 8f 93 push r24 1ac30: 1f 92 push r1 1ac32: 80 e2 ldi r24, 0x20 ; 32 1ac34: 8f 93 push r24 1ac36: 85 e6 ldi r24, 0x65 ; 101 1ac38: 92 e8 ldi r25, 0x82 ; 130 1ac3a: 9f 93 push r25 1ac3c: 8f 93 push r24 1ac3e: 0e 94 db 6e call 0xddb6 ; 0xddb6 1ac42: 0f b6 in r0, 0x3f ; 63 1ac44: f8 94 cli 1ac46: de bf out 0x3e, r29 ; 62 1ac48: 0f be out 0x3f, r0 ; 63 1ac4a: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 1ac4c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1ac50: 81 11 cpse r24, r1 1ac52: 04 c0 rjmp .+8 ; 0x1ac5c 1ac54: 80 91 c4 03 lds r24, 0x03C4 ; 0x8003c4 1ac58: 88 23 and r24, r24 1ac5a: 51 f1 breq .+84 ; 0x1acb0 { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 1ac5c: 81 ea ldi r24, 0xA1 ; 161 1ac5e: 9d e0 ldi r25, 0x0D ; 13 1ac60: 0f 94 9d a3 call 0x3473a ; 0x3473a 1ac64: 9b e0 ldi r25, 0x0B ; 11 1ac66: 89 9f mul r24, r25 1ac68: 80 01 movw r16, r0 1ac6a: 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); 1ac6c: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1ac70: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ac74: c8 01 movw r24, r16 1ac76: 80 5b subi r24, 0xB0 ; 176 1ac78: 92 4f sbci r25, 0xF2 ; 242 1ac7a: 0f 94 df a3 call 0x347be ; 0x347be if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ac7e: 60 91 59 12 lds r22, 0x1259 ; 0x801259 1ac82: c8 01 movw r24, r16 1ac84: 8e 5a subi r24, 0xAE ; 174 1ac86: 92 4f sbci r25, 0xF2 ; 242 1ac88: 0f 94 c1 a3 call 0x34782 ; 0x34782 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); 1ac8c: 60 91 85 03 lds r22, 0x0385 ; 0x800385 1ac90: 70 91 86 03 lds r23, 0x0386 ; 0x800386 1ac94: 80 91 87 03 lds r24, 0x0387 ; 0x800387 1ac98: 90 91 88 03 lds r25, 0x0388 ; 0x800388 1ac9c: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 1aca0: c8 01 movw r24, r16 1aca2: 8d 5a subi r24, 0xAD ; 173 1aca4: 92 4f sbci r25, 0xF2 ; 242 1aca6: 0f 94 c1 a3 call 0x34782 ; 0x34782 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 1acaa: 80 e1 ldi r24, 0x10 ; 16 1acac: 0e 94 3f d5 call 0x1aa7e ; 0x1aa7e } menu_back_if_clicked(); 1acb0: 0e 94 d6 73 call 0xe7ac ; 0xe7ac } 1acb4: 63 96 adiw r28, 0x13 ; 19 1acb6: 0f b6 in r0, 0x3f ; 63 1acb8: f8 94 cli 1acba: de bf out 0x3e, r29 ; 62 1acbc: 0f be out 0x3f, r0 ; 63 1acbe: cd bf out 0x3d, r28 ; 61 1acc0: df 91 pop r29 1acc2: cf 91 pop r28 1acc4: 1f 91 pop r17 1acc6: 0f 91 pop r16 1acc8: ff 90 pop r15 1acca: ef 90 pop r14 1accc: 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-> 1acce: 2b e0 ldi r18, 0x0B ; 11 1acd0: 12 9f mul r17, r18 1acd2: c0 01 movw r24, r0 1acd4: 11 24 eor r1, r1 1acd6: 80 5b subi r24, 0xB0 ; 176 1acd8: 92 4f sbci r25, 0xF2 ; 242 1acda: 0f 94 ab a3 call 0x34756 ; 0x34756 1acde: 90 93 98 03 sts 0x0398, r25 ; 0x800398 1ace2: 80 93 97 03 sts 0x0397, r24 ; 0x800397 1ace6: 09 cf rjmp .-494 ; 0x1aafa 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 1ace8: 12 16 cp r1, r18 1acea: 13 06 cpc r1, r19 1acec: 2c f4 brge .+10 ; 0x1acf8 1acee: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1acf2: 10 92 97 03 sts 0x0397, r1 ; 0x800397 1acf6: 44 cf rjmp .-376 ; 0x1ab80 extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 1acf8: 2f b7 in r18, 0x3f ; 63 1acfa: f8 94 cli babystepsTodo[Z_AXIS] += n; 1acfc: 40 91 83 03 lds r20, 0x0383 ; 0x800383 1ad00: 50 91 84 03 lds r21, 0x0384 ; 0x800384 1ad04: 84 0f add r24, r20 1ad06: 95 1f adc r25, r21 1ad08: 90 93 84 03 sts 0x0384, r25 ; 0x800384 1ad0c: 80 93 83 03 sts 0x0383, r24 ; 0x800383 CRITICAL_SECTION_END 1ad10: 2f bf out 0x3f, r18 ; 63 1ad12: 36 cf rjmp .-404 ; 0x1ab80 0001ad14 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 1ad14: af 92 push r10 1ad16: bf 92 push r11 1ad18: cf 92 push r12 1ad1a: df 92 push r13 1ad1c: ef 92 push r14 1ad1e: ff 92 push r15 1ad20: 0f 93 push r16 1ad22: 1f 93 push r17 1ad24: cf 93 push r28 1ad26: df 93 push r29 1ad28: 00 d0 rcall .+0 ; 0x1ad2a 1ad2a: 00 d0 rcall .+0 ; 0x1ad2c 1ad2c: 1f 92 push r1 1ad2e: cd b7 in r28, 0x3d ; 61 1ad30: 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)) || 1ad32: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1ad36: 81 11 cpse r24, r1 1ad38: 18 c0 rjmp .+48 ; 0x1ad6a 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))) || 1ad3a: 81 ea ldi r24, 0xA1 ; 161 1ad3c: 9d e0 ldi r25, 0x0D ; 13 1ad3e: 0f 94 9d a3 call 0x3473a ; 0x3473a 1ad42: 18 2f mov r17, r24 1ad44: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 1ad48: 88 23 and r24, r24 1ad4a: 79 f0 breq .+30 ; 0x1ad6a (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 1ad4c: 80 e1 ldi r24, 0x10 ; 16 1ad4e: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 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))) || 1ad52: 88 23 and r24, r24 1ad54: 51 f0 breq .+20 ; 0x1ad6a (!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))))) 1ad56: 2b e0 ldi r18, 0x0B ; 11 1ad58: 12 9f mul r17, r18 1ad5a: c0 01 movw r24, r0 1ad5c: 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 1ad5e: 80 5b subi r24, 0xB0 ; 176 1ad60: 92 4f sbci r25, 0xF2 ; 242 1ad62: 0f 94 ab a3 call 0x34756 ; 0x34756 } 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)) || 1ad66: 89 2b or r24, r25 1ad68: f1 f4 brne .+60 ; 0x1ada6 (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) 1ad6a: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1ad6e: 88 23 and r24, r24 1ad70: 71 f0 breq .+28 ; 0x1ad8e { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 1ad72: 81 ea ldi r24, 0xA1 ; 161 1ad74: 9d e0 ldi r25, 0x0D ; 13 1ad76: 0f 94 9d a3 call 0x3473a ; 0x3473a 1ad7a: 2b e0 ldi r18, 0x0B ; 11 1ad7c: 82 9f mul r24, r18 1ad7e: c0 01 movw r24, r0 1ad80: 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); 1ad82: 6f ef ldi r22, 0xFF ; 255 1ad84: 7f ef ldi r23, 0xFF ; 255 1ad86: 80 5b subi r24, 0xB0 ; 176 1ad88: 92 4f sbci r25, 0xF2 ; 242 1ad8a: 0f 94 df a3 call 0x347be ; 0x347be } // 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()); 1ad8e: 0e 94 45 73 call 0xe68a ; 0xe68a 1ad92: 21 e0 ldi r18, 0x01 ; 1 1ad94: 81 11 cpse r24, r1 1ad96: 20 e0 ldi r18, 0x00 ; 0 1ad98: 41 e0 ldi r20, 0x01 ; 1 1ad9a: 70 e0 ldi r23, 0x00 ; 0 1ad9c: 60 e0 ldi r22, 0x00 ; 0 1ad9e: 87 e8 ldi r24, 0x87 ; 135 1ada0: 97 ee ldi r25, 0xE7 ; 231 1ada2: 0e 94 87 62 call 0xc50e ; 0xc50e } if (lcd_encoder) { 1ada6: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1adaa: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1adae: 21 15 cp r18, r1 1adb0: 31 05 cpc r19, r1 1adb2: 59 f0 breq .+22 ; 0x1adca menuData->reset = lcd_encoder > 0; 1adb4: 81 e0 ldi r24, 0x01 ; 1 1adb6: 12 16 cp r1, r18 1adb8: 13 06 cpc r1, r19 1adba: 0c f0 brlt .+2 ; 0x1adbe 1adbc: 80 e0 ldi r24, 0x00 ; 0 1adbe: 80 93 96 03 sts 0x0396, r24 ; 0x800396 lcd_encoder = 0; // Reset 1adc2: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1adc6: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } 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)); 1adca: 81 ea ldi r24, 0xA1 ; 161 1adcc: 9d e0 ldi r25, 0x0D ; 13 1adce: 0f 94 9d a3 call 0x3473a ; 0x3473a 1add2: 1b e0 ldi r17, 0x0B ; 11 1add4: 81 9f mul r24, r17 1add6: b0 01 movw r22, r0 1add8: 11 24 eor r1, r1 1adda: 67 5b subi r22, 0xB7 ; 183 1addc: 72 4f sbci r23, 0xF2 ; 242 1adde: 47 e0 ldi r20, 0x07 ; 7 1ade0: 50 e0 ldi r21, 0x00 ; 0 1ade2: ce 01 movw r24, r28 1ade4: 01 96 adiw r24, 0x01 ; 1 1ade6: 7c 01 movw r14, r24 1ade8: 0f 94 8d a3 call 0x3471a ; 0x3471a lcd_home(); 1adec: 0e 94 ef 6f call 0xdfde ; 0xdfde 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]; 1adf0: 81 ea ldi r24, 0xA1 ; 161 1adf2: 9d e0 ldi r25, 0x0D ; 13 1adf4: 0f 94 9d a3 call 0x3473a ; 0x3473a 1adf8: 81 9f mul r24, r17 1adfa: c0 01 movw r24, r0 1adfc: 11 24 eor r1, r1 1adfe: 80 5b subi r24, 0xB0 ; 176 1ae00: 92 4f sbci r25, 0xF2 ; 242 1ae02: 0f 94 ab a3 call 0x34756 ; 0x34756 1ae06: bc 01 movw r22, r24 1ae08: 99 0f add r25, r25 1ae0a: 88 0b sbc r24, r24 1ae0c: 99 0b sbc r25, r25 1ae0e: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1ae12: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ae16: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ae1a: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1ae1e: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1ae22: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1ae26: d6 2e mov r13, r22 1ae28: c7 2e mov r12, r23 1ae2a: b8 2e mov r11, r24 1ae2c: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 1ae2e: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1ae32: 0e e3 ldi r16, 0x3E ; 62 1ae34: 10 e2 ldi r17, 0x20 ; 32 1ae36: 81 11 cpse r24, r1 1ae38: 02 c0 rjmp .+4 ; 0x1ae3e 1ae3a: 00 e2 ldi r16, 0x20 ; 32 1ae3c: 1e e3 ldi r17, 0x3E ; 62 1ae3e: 82 e7 ldi r24, 0x72 ; 114 1ae40: 9c e3 ldi r25, 0x3C ; 60 1ae42: 0e 94 0a 75 call 0xea14 ; 0xea14 1ae46: 1f 92 push r1 1ae48: 0f 93 push r16 1ae4a: 1f 92 push r1 1ae4c: 1f 93 push r17 1ae4e: af 92 push r10 1ae50: bf 92 push r11 1ae52: cf 92 push r12 1ae54: df 92 push r13 1ae56: ff 92 push r15 1ae58: ef 92 push r14 1ae5a: 9f 93 push r25 1ae5c: 8f 93 push r24 1ae5e: 0e 94 db 6e call 0xddb6 ; 0xddb6 1ae62: 0f b6 in r0, 0x3f ; 63 1ae64: f8 94 cli 1ae66: de bf out 0x3e, r29 ; 62 1ae68: 0f be out 0x3f, r0 ; 63 1ae6a: 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. } 1ae6c: 27 96 adiw r28, 0x07 ; 7 1ae6e: 0f b6 in r0, 0x3f ; 63 1ae70: f8 94 cli 1ae72: de bf out 0x3e, r29 ; 62 1ae74: 0f be out 0x3f, r0 ; 63 1ae76: cd bf out 0x3d, r28 ; 61 1ae78: df 91 pop r29 1ae7a: cf 91 pop r28 1ae7c: 1f 91 pop r17 1ae7e: 0f 91 pop r16 1ae80: ff 90 pop r15 1ae82: ef 90 pop r14 1ae84: df 90 pop r13 1ae86: cf 90 pop r12 1ae88: bf 90 pop r11 1ae8a: af 90 pop r10 1ae8c: 08 95 ret 0001ae8e : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ae8e: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 1ae92: 81 ea ldi r24, 0xA1 ; 161 1ae94: 9d e0 ldi r25, 0x0D ; 13 1ae96: 0f 94 c1 a3 call 0x34782 ; 0x34782 //! @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(); 1ae9a: 0c 94 8a d6 jmp 0x1ad14 ; 0x1ad14 0001ae9e : ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 1ae9e: 61 e0 ldi r22, 0x01 ; 1 1aea0: 88 ea ldi r24, 0xA8 ; 168 1aea2: 9d e0 ldi r25, 0x0D ; 13 1aea4: 0e 94 2d 78 call 0xf05a ; 0xf05a 1aea8: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed if (farm_mode) { 1aeac: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1aeb0: 88 23 and r24, r24 1aeb2: 41 f0 breq .+16 ; 0x1aec4 oCheckMode = ClCheckMode::_Strict; 1aeb4: 82 e0 ldi r24, 0x02 ; 2 1aeb6: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed 1aeba: 62 e0 ldi r22, 0x02 ; 2 1aebc: 88 ea ldi r24, 0xA8 ; 168 1aebe: 9d e0 ldi r25, 0x0D ; 13 1aec0: 0f 94 c1 a3 call 0x34782 ; 0x34782 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); 1aec4: 68 e2 ldi r22, 0x28 ; 40 1aec6: 87 ea ldi r24, 0xA7 ; 167 1aec8: 9d e0 ldi r25, 0x0D ; 13 1aeca: 0e 94 2d 78 call 0xf05a ; 0xf05a 1aece: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 1aed2: 60 e9 ldi r22, 0x90 ; 144 1aed4: 71 e0 ldi r23, 0x01 ; 1 1aed6: 85 ea ldi r24, 0xA5 ; 165 1aed8: 9d e0 ldi r25, 0x0D ; 13 1aeda: 0e 94 15 78 call 0xf02a ; 0xf02a oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 1aede: 61 e0 ldi r22, 0x01 ; 1 1aee0: 84 ea ldi r24, 0xA4 ; 164 1aee2: 9d e0 ldi r25, 0x0D ; 13 1aee4: 0e 94 2d 78 call 0xf05a ; 0xf05a 1aee8: 80 93 ea 03 sts 0x03EA, r24 ; 0x8003ea oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 1aeec: 61 e0 ldi r22, 0x01 ; 1 1aeee: 83 ea ldi r24, 0xA3 ; 163 1aef0: 9d e0 ldi r25, 0x0D ; 13 1aef2: 0e 94 2d 78 call 0xf05a ; 0xf05a 1aef6: 80 93 e9 03 sts 0x03E9, r24 ; 0x8003e9 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 1aefa: 61 e0 ldi r22, 0x01 ; 1 1aefc: 82 ea ldi r24, 0xA2 ; 162 1aefe: 9d e0 ldi r25, 0x0D ; 13 1af00: 0e 94 2d 78 call 0xf05a ; 0xf05a 1af04: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 1af08: 61 e0 ldi r22, 0x01 ; 1 1af0a: 80 e2 ldi r24, 0x20 ; 32 1af0c: 9c e0 ldi r25, 0x0C ; 12 1af0e: 0e 94 2d 78 call 0xf05a ; 0xf05a 1af12: 80 93 ee 03 sts 0x03EE, r24 ; 0x8003ee } 1af16: 08 95 ret 0001af18 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1af18: 0f 93 push r16 1af1a: 1f 93 push r17 1af1c: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1af1e: 0e 94 c0 bb call 0x17780 ; 0x17780 if (*str != '.') 1af22: fc 01 movw r30, r24 1af24: 20 81 ld r18, Z 1af26: 2e 32 cpi r18, 0x2E ; 46 1af28: 11 f0 breq .+4 ; 0x1af2e 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 1af2a: 80 e0 ldi r24, 0x00 ; 0 1af2c: 34 c0 rjmp .+104 ; 0x1af96 // 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); 1af2e: b8 01 movw r22, r16 1af30: 6e 5f subi r22, 0xFE ; 254 1af32: 7f 4f sbci r23, 0xFF ; 255 1af34: 01 96 adiw r24, 0x01 ; 1 1af36: 0e 94 c0 bb call 0x17780 ; 0x17780 if (*str != '.') 1af3a: fc 01 movw r30, r24 1af3c: 20 81 ld r18, Z 1af3e: 2e 32 cpi r18, 0x2E ; 46 1af40: a1 f7 brne .-24 ; 0x1af2a return false; ++str; } str = Number(str, version + 2); 1af42: b8 01 movw r22, r16 1af44: 6c 5f subi r22, 0xFC ; 252 1af46: 7f 4f sbci r23, 0xFF ; 255 1af48: 01 96 adiw r24, 0x01 ; 1 1af4a: 0e 94 c0 bb call 0x17780 ; 0x17780 version[3] = FIRMWARE_REVISION_RELEASED; 1af4e: 20 e4 ldi r18, 0x40 ; 64 1af50: 30 e0 ldi r19, 0x00 ; 0 1af52: f8 01 movw r30, r16 1af54: 37 83 std Z+7, r19 ; 0x07 1af56: 26 83 std Z+6, r18 ; 0x06 1af58: fc 01 movw r30, r24 1af5a: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1af5c: 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'; 1af5e: 89 2f mov r24, r25 1af60: 8f 7d andi r24, 0xDF ; 223 1af62: c1 f1 breq .+112 ; 0x1afd4 1af64: 87 ef ldi r24, 0xF7 ; 247 1af66: 89 0f add r24, r25 1af68: 82 30 cpi r24, 0x02 ; 2 1af6a: a0 f1 brcs .+104 ; 0x1afd4 1af6c: 9d 30 cpi r25, 0x0D ; 13 1af6e: 91 f1 breq .+100 ; 0x1afd4 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 == '-'){ 1af70: 9d 32 cpi r25, 0x2D ; 45 1af72: 99 f7 brne .-26 ; 0x1af5a // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1af74: 11 96 adiw r26, 0x01 ; 1 1af76: 9c 91 ld r25, X 1af78: 92 34 cpi r25, 0x42 ; 66 1af7a: e1 f0 breq .+56 ; 0x1afb4 1af7c: 7c f4 brge .+30 ; 0x1af9c 1af7e: 91 34 cpi r25, 0x41 ; 65 1af80: a1 f6 brne .-88 ; 0x1af2a 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); 1af82: 0a 5f subi r16, 0xFA ; 250 1af84: 1f 4f sbci r17, 0xFF ; 255 1af86: 28 e0 ldi r18, 0x08 ; 8 1af88: 30 e0 ldi r19, 0x00 ; 0 1af8a: 45 e0 ldi r20, 0x05 ; 5 1af8c: 68 e0 ldi r22, 0x08 ; 8 1af8e: 75 e8 ldi r23, 0x85 ; 133 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); 1af90: cf 01 movw r24, r30 1af92: 0e 94 10 c2 call 0x18420 ; 0x18420 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1af96: 1f 91 pop r17 1af98: 0f 91 pop r16 1af9a: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1af9c: 94 34 cpi r25, 0x44 ; 68 1af9e: 91 f0 breq .+36 ; 0x1afc4 1afa0: 92 35 cpi r25, 0x52 ; 82 1afa2: 19 f6 brne .-122 ; 0x1af2a 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); 1afa4: 0a 5f subi r16, 0xFA ; 250 1afa6: 1f 4f sbci r17, 0xFF ; 255 1afa8: 20 e2 ldi r18, 0x20 ; 32 1afaa: 30 e0 ldi r19, 0x00 ; 0 1afac: 42 e0 ldi r20, 0x02 ; 2 1afae: 6c ef ldi r22, 0xFC ; 252 1afb0: 74 e8 ldi r23, 0x84 ; 132 1afb2: ee cf rjmp .-36 ; 0x1af90 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); 1afb4: 0a 5f subi r16, 0xFA ; 250 1afb6: 1f 4f sbci r17, 0xFF ; 255 1afb8: 20 e1 ldi r18, 0x10 ; 16 1afba: 30 e0 ldi r19, 0x00 ; 0 1afbc: 44 e0 ldi r20, 0x04 ; 4 1afbe: 63 e0 ldi r22, 0x03 ; 3 1afc0: 75 e8 ldi r23, 0x85 ; 133 1afc2: e6 cf rjmp .-52 ; 0x1af90 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); 1afc4: 0a 5f subi r16, 0xFA ; 250 1afc6: 1f 4f sbci r17, 0xFF ; 255 1afc8: 30 e0 ldi r19, 0x00 ; 0 1afca: 20 e0 ldi r18, 0x00 ; 0 1afcc: 43 e0 ldi r20, 0x03 ; 3 1afce: 6f ef ldi r22, 0xFF ; 255 1afd0: 74 e8 ldi r23, 0x84 ; 132 1afd2: de cf rjmp .-68 ; 0x1af90 // 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; 1afd4: 81 e0 ldi r24, 0x01 ; 1 1afd6: df cf rjmp .-66 ; 0x1af96 0001afd8 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1afd8: 44 e1 ldi r20, 0x14 ; 20 1afda: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1afdc: 66 23 and r22, r22 1afde: 89 f0 breq .+34 ; 0x1b002 strncpy_P(lcd_status_message, message, LCD_WIDTH); 1afe0: bc 01 movw r22, r24 1afe2: 85 e6 ldi r24, 0x65 ; 101 1afe4: 94 e0 ldi r25, 0x04 ; 4 1afe6: 0f 94 8a a1 call 0x34314 ; 0x34314 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1afea: 10 92 79 04 sts 0x0479, r1 ; 0x800479 <_ZL18lcd_status_message.lto_priv.425+0x14> lcd_status_message_idx = 0; // Print message from beginning 1afee: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.420> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1aff2: 81 e9 ldi r24, 0x91 ; 145 1aff4: 98 e6 ldi r25, 0x68 ; 104 1aff6: 0e 94 8d 7c call 0xf91a ; 0xf91a // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1affa: 81 e0 ldi r24, 0x01 ; 1 1affc: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1b000: 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); 1b002: bc 01 movw r22, r24 1b004: 85 e6 ldi r24, 0x65 ; 101 1b006: 94 e0 ldi r25, 0x04 ; 4 1b008: 0f 94 1d aa call 0x3543a ; 0x3543a 1b00c: ee cf rjmp .-36 ; 0x1afea 0001b00e : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1b00e: 90 91 c0 03 lds r25, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> 1b012: 89 17 cp r24, r25 1b014: 80 f4 brcc .+32 ; 0x1b036 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1b016: 91 30 cpi r25, 0x01 ; 1 1b018: 61 f4 brne .+24 ; 0x1b032 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1b01a: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.424> 1b01e: 88 23 and r24, r24 1b020: 51 f0 breq .+20 ; 0x1b036 1b022: 40 e2 ldi r20, 0x20 ; 32 1b024: 5e e4 ldi r21, 0x4E ; 78 1b026: 60 e0 ldi r22, 0x00 ; 0 1b028: 70 e0 ldi r23, 0x00 ; 0 1b02a: 8a e7 ldi r24, 0x7A ; 122 1b02c: 94 e0 ldi r25, 0x04 ; 4 1b02e: 0d 94 c0 0b jmp 0x21780 ; 0x21780 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1b032: 80 e0 ldi r24, 0x00 ; 0 1b034: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1b036: 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; } 1b038: 08 95 ret 0001b03a : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1b03a: ef 92 push r14 1b03c: ff 92 push r15 1b03e: 1f 93 push r17 1b040: cf 93 push r28 1b042: df 93 push r29 1b044: ec 01 movw r28, r24 1b046: 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)) { 1b048: 86 2f mov r24, r22 1b04a: 0e 94 07 d8 call 0x1b00e ; 0x1b00e 1b04e: 88 23 and r24, r24 1b050: e9 f0 breq .+58 ; 0x1b08c bool same = !(progmem? strcmp_P(lcd_status_message, message): 1b052: be 01 movw r22, r28 1b054: 85 e6 ldi r24, 0x65 ; 101 1b056: 94 e0 ldi r25, 0x04 ; 4 1b058: 0f 94 4b a1 call 0x34296 ; 0x34296 1b05c: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1b05e: 8a e7 ldi r24, 0x7A ; 122 1b060: 94 e0 ldi r25, 0x04 ; 4 1b062: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> lcd_status_message_level = severity; 1b066: 10 93 c0 03 sts 0x03C0, r17 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> custom_message_type = CustomMsg::Status; 1b06a: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d custom_message_state = 0; 1b06e: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de if (!same) { 1b072: ef 28 or r14, r15 1b074: 59 f0 breq .+22 ; 0x1b08c // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1b076: 61 e0 ldi r22, 0x01 ; 1 1b078: ce 01 movw r24, r28 1b07a: 0e 94 ec d7 call 0x1afd8 ; 0x1afd8 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1b07e: df 91 pop r29 1b080: cf 91 pop r28 1b082: 1f 91 pop r17 1b084: ff 90 pop r15 1b086: 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(); 1b088: 0d 94 6d 05 jmp 0x20ada ; 0x20ada } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1b08c: df 91 pop r29 1b08e: cf 91 pop r28 1b090: 1f 91 pop r17 1b092: ff 90 pop r15 1b094: ef 90 pop r14 1b096: 08 95 ret 0001b098 : manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) { 1b098: ef 92 push r14 1b09a: ff 92 push r15 1b09c: 1f 93 push r17 1b09e: cf 93 push r28 1b0a0: df 93 push r29 1b0a2: 18 2f mov r17, r24 1b0a4: eb 01 movw r28, r22 1b0a6: 7a 01 movw r14, r20 1b0a8: 80 e0 ldi r24, 0x00 ; 0 1b0aa: 0f 94 62 23 call 0x246c4 ; 0x246c4 lcd_beeper_quick_feedback(); FORCE_BL_ON_END; target_temperature[0] = 0; 1b0ae: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1b0b2: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d target_temperature_bed = 0; 1b0b6: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1b0ba: 10 92 59 12 sts 0x1259, r1 ; 0x801259 manage_heater(); 1b0be: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(); 1b0c2: 80 e0 ldi r24, 0x00 ; 0 1b0c4: 0e 94 25 8a call 0x1144a ; 0x1144a lcd_clear(); 1b0c8: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 1b0cc: 86 e9 ldi r24, 0x96 ; 150 1b0ce: 99 e4 ldi r25, 0x49 ; 73 1b0d0: 0e 94 0a 75 call 0xea14 ; 0xea14 1b0d4: ac 01 movw r20, r24 1b0d6: 60 e0 ldi r22, 0x00 ; 0 1b0d8: 80 e0 ldi r24, 0x00 ; 0 1b0da: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 1b0de: 86 e8 ldi r24, 0x86 ; 134 1b0e0: 99 e4 ldi r25, 0x49 ; 73 1b0e2: 0e 94 0a 75 call 0xea14 ; 0xea14 1b0e6: ac 01 movw r20, r24 1b0e8: 61 e0 ldi r22, 0x01 ; 1 1b0ea: 80 e0 ldi r24, 0x00 ; 0 1b0ec: 0e 94 d7 6f call 0xdfae ; 0xdfae switch (testError) 1b0f0: 11 50 subi r17, 0x01 ; 1 1b0f2: 1a 30 cpi r17, 0x0A ; 10 1b0f4: 90 f4 brcc .+36 ; 0x1b11a 1b0f6: e1 2f mov r30, r17 1b0f8: f0 e0 ldi r31, 0x00 ; 0 1b0fa: 88 27 eor r24, r24 1b0fc: ed 57 subi r30, 0x7D ; 125 1b0fe: f7 42 sbci r31, 0x27 ; 39 1b100: 8f 4f sbci r24, 0xFF ; 255 1b102: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 1b106: a0 d8 rcall .-3776 ; 0x1a248 1b108: ac d8 rcall .-3752 ; 0x1a262 1b10a: c4 d8 rcall .-3704 ; 0x1a294 1b10c: 0a d9 rcall .-3564 ; 0x1a322 1b10e: 16 d9 rcall .-3540 ; 0x1a33c 1b110: 19 d9 rcall .-3534 ; 0x1a344 1b112: 1c d9 rcall .-3528 ; 0x1a34c 1b114: 1f d9 rcall .-3522 ; 0x1a354 1b116: 2b d9 rcall .-3498 ; 0x1a36e 1b118: 37 d9 rcall .-3474 ; 0x1a388 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 1b11a: 82 e7 ldi r24, 0x72 ; 114 1b11c: 99 e4 ldi r25, 0x49 ; 73 1b11e: 0e 94 0a 75 call 0xea14 ; 0xea14 1b122: ac 01 movw r20, r24 1b124: 62 e0 ldi r22, 0x02 ; 2 1b126: 80 e0 ldi r24, 0x00 ; 0 1b128: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 1b12c: 82 e6 ldi r24, 0x62 ; 98 1b12e: 99 e4 ldi r25, 0x49 ; 73 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)); 1b130: 0e 94 0a 75 call 0xea14 ; 0xea14 1b134: ac 01 movw r20, r24 1b136: 63 e0 ldi r22, 0x03 ; 3 1b138: 80 e0 ldi r24, 0x00 ; 0 1b13a: 0e 94 d7 6f call 0xdfae ; 0xdfae 1b13e: 44 c0 rjmp .+136 ; 0x1b1c8 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)); 1b140: 85 e5 ldi r24, 0x55 ; 85 1b142: 99 e4 ldi r25, 0x49 ; 73 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)); 1b144: 0e 94 0a 75 call 0xea14 ; 0xea14 1b148: ac 01 movw r20, r24 1b14a: 62 e0 ldi r22, 0x02 ; 2 1b14c: 80 e0 ldi r24, 0x00 ; 0 1b14e: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1b152: 86 e4 ldi r24, 0x46 ; 70 1b154: 99 e4 ldi r25, 0x49 ; 73 1b156: ec cf rjmp .-40 ; 0x1b130 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)); 1b158: 8b e3 ldi r24, 0x3B ; 59 1b15a: 99 e4 ldi r25, 0x49 ; 73 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)); 1b15c: 0e 94 0a 75 call 0xea14 ; 0xea14 1b160: ac 01 movw r20, r24 1b162: 62 e0 ldi r22, 0x02 ; 2 1b164: 80 e0 ldi r24, 0x00 ; 0 1b166: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1b16a: 86 e4 ldi r24, 0x46 ; 70 1b16c: 99 e4 ldi r25, 0x49 ; 73 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)); 1b16e: 0e 94 0a 75 call 0xea14 ; 0xea14 1b172: ac 01 movw r20, r24 1b174: 63 e0 ldi r22, 0x03 ; 3 1b176: 80 e0 ldi r24, 0x00 ; 0 1b178: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(18, 3); 1b17c: 63 e0 ldi r22, 0x03 ; 3 1b17e: 82 e1 ldi r24, 0x12 ; 18 1b180: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print(_error_1); 1b184: ce 01 movw r24, r28 1b186: 1e c0 rjmp .+60 ; 0x1b1c4 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)); 1b188: 83 e3 ldi r24, 0x33 ; 51 1b18a: 99 e4 ldi r25, 0x49 ; 73 1b18c: 0e 94 0a 75 call 0xea14 ; 0xea14 1b190: ac 01 movw r20, r24 1b192: 62 e0 ldi r22, 0x02 ; 2 1b194: 80 e0 ldi r24, 0x00 ; 0 1b196: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(18, 2); 1b19a: 62 e0 ldi r22, 0x02 ; 2 1b19c: 82 e1 ldi r24, 0x12 ; 18 1b19e: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print(_error_1); 1b1a2: ce 01 movw r24, r28 1b1a4: 0e 94 2f 73 call 0xe65e ; 0xe65e lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 1b1a8: 89 e2 ldi r24, 0x29 ; 41 1b1aa: 99 e4 ldi r25, 0x49 ; 73 1b1ac: 0e 94 0a 75 call 0xea14 ; 0xea14 1b1b0: ac 01 movw r20, r24 1b1b2: 63 e0 ldi r22, 0x03 ; 3 1b1b4: 80 e0 ldi r24, 0x00 ; 0 1b1b6: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(18, 3); 1b1ba: 63 e0 ldi r22, 0x03 ; 3 1b1bc: 82 e1 ldi r24, 0x12 ; 18 1b1be: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print(_error_2); 1b1c2: c7 01 movw r24, r14 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); 1b1c4: 0e 94 2f 73 call 0xe65e ; 0xe65e lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 1b1c8: 68 ee ldi r22, 0xE8 ; 232 1b1ca: 73 e0 ldi r23, 0x03 ; 3 1b1cc: 80 e0 ldi r24, 0x00 ; 0 1b1ce: 90 e0 ldi r25, 0x00 ; 0 1b1d0: 0f 94 23 0b call 0x21646 ; 0x21646 1b1d4: 80 e0 ldi r24, 0x00 ; 0 1b1d6: 0f 94 62 23 call 0x246c4 ; 0x246c4 lcd_beeper_quick_feedback(); do { _delay(100); 1b1da: 64 e6 ldi r22, 0x64 ; 100 1b1dc: 70 e0 ldi r23, 0x00 ; 0 1b1de: 80 e0 ldi r24, 0x00 ; 0 1b1e0: 90 e0 ldi r25, 0x00 ; 0 1b1e2: 0f 94 23 0b call 0x21646 ; 0x21646 manage_heater(); 1b1e6: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(); 1b1ea: 80 e0 ldi r24, 0x00 ; 0 1b1ec: 0e 94 25 8a call 0x1144a ; 0x1144a } while (!lcd_clicked()); 1b1f0: 0e 94 45 73 call 0xe68a ; 0xe68a 1b1f4: 88 23 and r24, r24 1b1f6: 89 f3 breq .-30 ; 0x1b1da LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1b1f8: 88 ee ldi r24, 0xE8 ; 232 1b1fa: 99 e4 ldi r25, 0x49 ; 73 1b1fc: 0e 94 0a 75 call 0xea14 ; 0xea14 1b200: 62 e0 ldi r22, 0x02 ; 2 1b202: 0e 94 1d d8 call 0x1b03a ; 0x1b03a lcd_return_to_status(); } 1b206: df 91 pop r29 1b208: cf 91 pop r28 1b20a: 1f 91 pop r17 1b20c: ff 90 pop r15 1b20e: ef 90 pop r14 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 1b210: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 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)); 1b214: 87 e1 ldi r24, 0x17 ; 23 1b216: 99 e4 ldi r25, 0x49 ; 73 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)); 1b218: 0e 94 0a 75 call 0xea14 ; 0xea14 1b21c: ac 01 movw r20, r24 1b21e: 62 e0 ldi r22, 0x02 ; 2 1b220: 80 e0 ldi r24, 0x00 ; 0 1b222: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 1b226: 83 e3 ldi r24, 0x33 ; 51 1b228: 99 e4 ldi r25, 0x49 ; 73 1b22a: a1 cf rjmp .-190 ; 0x1b16e 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)); 1b22c: 8a e5 ldi r24, 0x5A ; 90 1b22e: 9d e5 ldi r25, 0x5D ; 93 1b230: 95 cf rjmp .-214 ; 0x1b15c 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)); 1b232: 87 e4 ldi r24, 0x47 ; 71 1b234: 9d e5 ldi r25, 0x5D ; 93 1b236: 92 cf rjmp .-220 ; 0x1b15c 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)); 1b238: 88 e0 ldi r24, 0x08 ; 8 1b23a: 99 e4 ldi r25, 0x49 ; 73 1b23c: ed cf rjmp .-38 ; 0x1b218 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)); 1b23e: 8a ef ldi r24, 0xFA ; 250 1b240: 98 e4 ldi r25, 0x48 ; 72 1b242: 0e 94 0a 75 call 0xea14 ; 0xea14 1b246: ac 01 movw r20, r24 1b248: 62 e0 ldi r22, 0x02 ; 2 1b24a: 80 e0 ldi r24, 0x00 ; 0 1b24c: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 1b250: 83 ef ldi r24, 0xF3 ; 243 1b252: 98 e4 ldi r25, 0x48 ; 72 1b254: 8c cf rjmp .-232 ; 0x1b16e lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 1b256: 81 ee ldi r24, 0xE1 ; 225 1b258: 98 e4 ldi r25, 0x48 ; 72 1b25a: 0e 94 0a 75 call 0xea14 ; 0xea14 1b25e: ac 01 movw r20, r24 1b260: 62 e0 ldi r22, 0x02 ; 2 1b262: 80 e0 ldi r24, 0x00 ; 0 1b264: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 1b268: 87 ed ldi r24, 0xD7 ; 215 1b26a: 98 e4 ldi r25, 0x48 ; 72 1b26c: 80 cf rjmp .-256 ; 0x1b16e lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1b26e: 88 ea ldi r24, 0xA8 ; 168 1b270: 99 e4 ldi r25, 0x49 ; 73 1b272: 68 cf rjmp .-304 ; 0x1b144 0001b274 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1b274: 8f 92 push r8 1b276: 9f 92 push r9 1b278: af 92 push r10 1b27a: bf 92 push r11 1b27c: cf 92 push r12 1b27e: df 92 push r13 1b280: ef 92 push r14 1b282: ff 92 push r15 1b284: 0f 93 push r16 1b286: 1f 93 push r17 1b288: cf 93 push r28 1b28a: df 93 push r29 1b28c: f8 2e mov r15, r24 1b28e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b292: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b296: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b29a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b29e: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1b2a2: 4b 01 movw r8, r22 1b2a4: 6b 01 movw r12, r22 1b2a6: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b2aa: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b2ae: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b2b2: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b2b6: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1b2ba: eb 01 movw r28, r22 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 1b2bc: 9c e3 ldi r25, 0x3C ; 60 1b2be: a9 2e mov r10, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1b2c0: 88 ec ldi r24, 0xC8 ; 200 1b2c2: 90 e0 ldi r25, 0x00 ; 0 } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 1b2c4: ff 20 and r15, r15 1b2c6: 31 f0 breq .+12 ; 0x1b2d4 1b2c8: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1b2ca: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1b2cc: 24 eb ldi r18, 0xB4 ; 180 1b2ce: a2 2e mov r10, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1b2d0: 90 e0 ldi r25, 0x00 ; 0 1b2d2: 80 e0 ldi r24, 0x00 ; 0 1b2d4: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 1b2d8: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d target_temperature_bed = (_isbed) ? 100 : 0; 1b2dc: 84 e6 ldi r24, 0x64 ; 100 1b2de: 90 e0 ldi r25, 0x00 ; 0 1b2e0: f1 10 cpse r15, r1 1b2e2: 02 c0 rjmp .+4 ; 0x1b2e8 1b2e4: 90 e0 ldi r25, 0x00 ; 0 1b2e6: 80 e0 ldi r24, 0x00 ; 0 1b2e8: 90 93 5a 12 sts 0x125A, r25 ; 0x80125a 1b2ec: 80 93 59 12 sts 0x1259, r24 ; 0x801259 #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); 1b2f0: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1b2f4: 81 e0 ldi r24, 0x01 ; 1 1b2f6: 0e 94 25 8a call 0x1144a ; 0x1144a for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b2fa: e1 2c mov r14, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1b2fc: b1 2c mov r11, r1 } else { MYSERIAL.print("Hotend temp:"); MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds 1b2fe: 85 e0 ldi r24, 0x05 ; 5 1b300: 98 2e mov r9, r24 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b302: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 1b306: 81 11 cpse r24, r1 1b308: 1c c0 rjmp .+56 ; 0x1b342 { manage_heater(); 1b30a: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1b30e: 81 e0 ldi r24, 0x01 ; 1 1b310: 0e 94 25 8a call 0x1144a ; 0x1144a _progress = (_isbed? 1b314: 00 e9 ldi r16, 0x90 ; 144 1b316: 11 e0 ldi r17, 0x01 ; 1 1b318: 20 e0 ldi r18, 0x00 ; 0 1b31a: 42 e0 ldi r20, 0x02 ; 2 1b31c: 6b 2d mov r22, r11 1b31e: 87 e0 ldi r24, 0x07 ; 7 1b320: f1 10 cpse r15, r1 1b322: 01 c0 rjmp .+2 ; 0x1b326 1b324: 88 e0 ldi r24, 0x08 ; 8 1b326: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1b32a: b8 2e mov r11, r24 } else { MYSERIAL.print("Hotend temp:"); MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds 1b32c: 8e 2d mov r24, r14 1b32e: 69 2d mov r22, r9 1b330: 0f 94 4c a4 call 0x34898 ; 0x34898 <__udivmodqi4> 1b334: 91 11 cpse r25, r1 1b336: 02 c0 rjmp .+4 ; 0x1b33c 1b338: 0e 94 a2 7a call 0xf544 ; 0xf544 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b33c: e3 94 inc r14 1b33e: ea 10 cpse r14, r10 1b340: e0 cf rjmp .-64 ; 0x1b302 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1b342: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1b346: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d target_temperature_bed = 0; 1b34a: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1b34e: 10 92 59 12 sts 0x1259, r1 ; 0x801259 manage_heater(); 1b352: 0f 94 a5 37 call 0x26f4a ; 0x26f4a 1b356: b6 01 movw r22, r12 1b358: dd 0c add r13, r13 1b35a: 88 0b sbc r24, r24 1b35c: 99 0b sbc r25, r25 1b35e: 4e 01 movw r8, r28 1b360: dd 0f add r29, r29 1b362: aa 08 sbc r10, r10 1b364: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b366: ff 20 and r15, r15 1b368: 09 f4 brne .+2 ; 0x1b36c 1b36a: 4d c0 rjmp .+154 ; 0x1b406 1b36c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1b370: 9b 01 movw r18, r22 1b372: ac 01 movw r20, r24 1b374: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b378: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b37c: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b380: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b384: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1b388: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1b38c: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b38e: c5 01 movw r24, r10 1b390: b4 01 movw r22, r8 1b392: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1b396: 9b 01 movw r18, r22 1b398: ac 01 movw r20, r24 1b39a: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b39e: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b3a2: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b3a6: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b3aa: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1b3ae: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b3b2: 10 91 3b 12 lds r17, 0x123B ; 0x80123b 1b3b6: 11 11 cpse r17, r1 1b3b8: 0c c0 rjmp .+24 ; 0x1b3d2 1b3ba: f1 10 cpse r15, r1 1b3bc: 44 c0 rjmp .+136 ; 0x1b446 1b3be: 69 30 cpi r22, 0x09 ; 9 1b3c0: 71 05 cpc r23, r1 1b3c2: 0c f0 brlt .+2 ; 0x1b3c6 1b3c4: 46 c0 rjmp .+140 ; 0x1b452 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b3c6: 8e e1 ldi r24, 0x1E ; 30 1b3c8: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1b3ca: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b3cc: c8 17 cp r28, r24 1b3ce: d9 07 cpc r29, r25 1b3d0: 3c f4 brge .+14 ; 0x1b3e0 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1b3d2: 4f ed ldi r20, 0xDF ; 223 1b3d4: 52 e0 ldi r21, 0x02 ; 2 1b3d6: ba 01 movw r22, r20 1b3d8: 80 e0 ldi r24, 0x00 ; 0 1b3da: 0e 94 4c d8 call 0x1b098 ; 0x1b098 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1b3de: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); #endif //THERMAL_MODEL manage_heater(); 1b3e0: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1b3e4: 81 e0 ldi r24, 0x01 ; 1 1b3e6: 0e 94 25 8a call 0x1144a ; 0x1144a return _stepresult; } 1b3ea: 81 2f mov r24, r17 1b3ec: df 91 pop r29 1b3ee: cf 91 pop r28 1b3f0: 1f 91 pop r17 1b3f2: 0f 91 pop r16 1b3f4: ff 90 pop r15 1b3f6: ef 90 pop r14 1b3f8: df 90 pop r13 1b3fa: cf 90 pop r12 1b3fc: bf 90 pop r11 1b3fe: af 90 pop r10 1b400: 9f 90 pop r9 1b402: 8f 90 pop r8 1b404: 08 95 ret target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b406: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1b40a: 9b 01 movw r18, r22 1b40c: ac 01 movw r20, r24 1b40e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b412: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b416: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b41a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b41e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1b422: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1b426: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b428: c5 01 movw r24, r10 1b42a: b4 01 movw r22, r8 1b42c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1b430: 9b 01 movw r18, r22 1b432: ac 01 movw r20, r24 1b434: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b438: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b43c: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b440: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b444: b2 cf rjmp .-156 ; 0x1b3aa */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b446: 89 e0 ldi r24, 0x09 ; 9 1b448: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b44a: 6e 31 cpi r22, 0x1E ; 30 1b44c: 71 05 cpc r23, r1 1b44e: 0c f4 brge .+2 ; 0x1b452 1b450: bc cf rjmp .-136 ; 0x1b3ca else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1b452: 4f ed ldi r20, 0xDF ; 223 1b454: 52 e0 ldi r21, 0x02 ; 2 1b456: ba 01 movw r22, r20 1b458: 81 e0 ldi r24, 0x01 ; 1 1b45a: 0e 94 4c d8 call 0x1b098 ; 0x1b098 1b45e: c0 cf rjmp .-128 ; 0x1b3e0 0001b460 : return _stepresult; } static bool lcd_selfcheck_pulleys(int axis) { 1b460: 2f 92 push r2 1b462: 3f 92 push r3 1b464: 4f 92 push r4 1b466: 5f 92 push r5 1b468: 6f 92 push r6 1b46a: 7f 92 push r7 1b46c: 8f 92 push r8 1b46e: 9f 92 push r9 1b470: af 92 push r10 1b472: bf 92 push r11 1b474: cf 92 push r12 1b476: df 92 push r13 1b478: ef 92 push r14 1b47a: ff 92 push r15 1b47c: 0f 93 push r16 1b47e: 1f 93 push r17 1b480: cf 93 push r28 1b482: df 93 push r29 1b484: 8c 01 movw r16, r24 float current_position_init; float move; bool endstop_triggered = false; int i; unsigned long timeout_counter; refresh_cmd_timeout(); 1b486: 0e 94 11 65 call 0xca22 ; 0xca22 manage_inactivity(true); 1b48a: 81 e0 ldi r24, 0x01 ; 1 1b48c: 0e 94 25 8a call 0x1144a ; 0x1144a if (axis == 0) move = 50; //X_AXIS else move = 50; //Y_AXIS current_position_init = current_position[axis]; 1b490: 18 01 movw r2, r16 1b492: 22 0c add r2, r2 1b494: 33 1c adc r3, r3 1b496: 22 0c add r2, r2 1b498: 33 1c adc r3, r3 1b49a: e1 01 movw r28, r2 1b49c: cf 59 subi r28, 0x9F ; 159 1b49e: dd 4e sbci r29, 0xED ; 237 1b4a0: 88 80 ld r8, Y 1b4a2: 99 80 ldd r9, Y+1 ; 0x01 1b4a4: aa 80 ldd r10, Y+2 ; 0x02 1b4a6: bb 80 ldd r11, Y+3 ; 0x03 current_position[axis] += 2; 1b4a8: 20 e0 ldi r18, 0x00 ; 0 1b4aa: 30 e0 ldi r19, 0x00 ; 0 1b4ac: 40 e0 ldi r20, 0x00 ; 0 1b4ae: 50 e4 ldi r21, 0x40 ; 64 1b4b0: c5 01 movw r24, r10 1b4b2: b4 01 movw r22, r8 1b4b4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1b4b8: 68 83 st Y, r22 1b4ba: 79 83 std Y+1, r23 ; 0x01 1b4bc: 8a 83 std Y+2, r24 ; 0x02 1b4be: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b4c0: 60 e0 ldi r22, 0x00 ; 0 1b4c2: 70 e0 ldi r23, 0x00 ; 0 1b4c4: 84 e3 ldi r24, 0x34 ; 52 1b4c6: 92 e4 ldi r25, 0x42 ; 66 1b4c8: 0f 94 0a 4a call 0x29414 ; 0x29414 1b4cc: 95 e0 ldi r25, 0x05 ; 5 1b4ce: e9 2e mov r14, r25 1b4d0: f1 2c mov r15, r1 for (i = 0; i < 5; i++) { refresh_cmd_timeout(); 1b4d2: 0e 94 11 65 call 0xca22 ; 0xca22 current_position[axis] = current_position[axis] + move; 1b4d6: 20 e0 ldi r18, 0x00 ; 0 1b4d8: 30 e0 ldi r19, 0x00 ; 0 1b4da: 48 e4 ldi r20, 0x48 ; 72 1b4dc: 52 e4 ldi r21, 0x42 ; 66 1b4de: 68 81 ld r22, Y 1b4e0: 79 81 ldd r23, Y+1 ; 0x01 1b4e2: 8a 81 ldd r24, Y+2 ; 0x02 1b4e4: 9b 81 ldd r25, Y+3 ; 0x03 1b4e6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1b4ea: 68 83 st Y, r22 1b4ec: 79 83 std Y+1, r23 ; 0x01 1b4ee: 8a 83 std Y+2, r24 ; 0x02 1b4f0: 9b 83 std Y+3, r25 ; 0x03 } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 1b4f2: 6c e6 ldi r22, 0x6C ; 108 1b4f4: 70 e0 ldi r23, 0x00 ; 0 1b4f6: 8e e2 ldi r24, 0x2E ; 46 1b4f8: 0e 94 5f d1 call 0x1a2be ; 0x1a2be st_current_set(0, 850); //set motor current higher plan_buffer_line_curposXYZE(200); 1b4fc: 60 e0 ldi r22, 0x00 ; 0 1b4fe: 70 e0 ldi r23, 0x00 ; 0 1b500: 88 e4 ldi r24, 0x48 ; 72 1b502: 93 e4 ldi r25, 0x43 ; 67 1b504: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1b508: 0f 94 b0 18 call 0x23160 ; 0x23160 if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents 1b50c: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 1b510: 62 e2 ldi r22, 0x22 ; 34 1b512: 70 e0 ldi r23, 0x00 ; 0 1b514: 81 11 cpse r24, r1 1b516: 02 c0 rjmp .+4 ; 0x1b51c 1b518: 64 e4 ldi r22, 0x44 ; 68 1b51a: 70 e0 ldi r23, 0x00 ; 0 1b51c: 8e e2 ldi r24, 0x2E ; 46 1b51e: 0e 94 5f d1 call 0x1a2be ; 0x1a2be else st_current_set(0, tmp_motor_loud[0]); //set motor current back current_position[axis] = current_position[axis] - move; 1b522: 20 e0 ldi r18, 0x00 ; 0 1b524: 30 e0 ldi r19, 0x00 ; 0 1b526: 48 e4 ldi r20, 0x48 ; 72 1b528: 52 e4 ldi r21, 0x42 ; 66 1b52a: 68 81 ld r22, Y 1b52c: 79 81 ldd r23, Y+1 ; 0x01 1b52e: 8a 81 ldd r24, Y+2 ; 0x02 1b530: 9b 81 ldd r25, Y+3 ; 0x03 1b532: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1b536: 68 83 st Y, r22 1b538: 79 83 std Y+1, r23 ; 0x01 1b53a: 8a 83 std Y+2, r24 ; 0x02 1b53c: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(50); 1b53e: 60 e0 ldi r22, 0x00 ; 0 1b540: 70 e0 ldi r23, 0x00 ; 0 1b542: 88 e4 ldi r24, 0x48 ; 72 1b544: 92 e4 ldi r25, 0x42 ; 66 1b546: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1b54a: 0f 94 b0 18 call 0x23160 ; 0x23160 if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1b54e: 1e 99 sbic 0x03, 6 ; 3 1b550: 3a c0 rjmp .+116 ; 0x1b5c6 1b552: 1d 99 sbic 0x03, 5 ; 3 1b554: 38 c0 rjmp .+112 ; 0x1b5c6 1b556: 21 e0 ldi r18, 0x01 ; 1 1b558: e2 1a sub r14, r18 1b55a: f1 08 sbc r15, r1 current_position_init = current_position[axis]; current_position[axis] += 2; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); for (i = 0; i < 5; i++) { 1b55c: 09 f0 breq .+2 ; 0x1b560 1b55e: b9 cf rjmp .-142 ; 0x1b4d2 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } timeout_counter = _millis() + 2500; 1b560: 0f 94 56 0b call 0x216ac ; 0x216ac 1b564: 2b 01 movw r4, r22 1b566: 3c 01 movw r6, r24 1b568: 24 ec ldi r18, 0xC4 ; 196 1b56a: 42 0e add r4, r18 1b56c: 29 e0 ldi r18, 0x09 ; 9 1b56e: 52 1e adc r5, r18 1b570: 61 1c adc r6, r1 1b572: 71 1c adc r7, r1 endstop_triggered = false; manage_inactivity(true); 1b574: 81 e0 ldi r24, 0x01 ; 1 1b576: 0e 94 25 8a call 0x1144a ; 0x1144a 1b57a: e1 01 movw r28, r2 1b57c: cf 59 subi r28, 0x9F ; 159 1b57e: dd 4e sbci r29, 0xED ; 237 1b580: c8 80 ld r12, Y 1b582: d9 80 ldd r13, Y+1 ; 0x01 1b584: ea 80 ldd r14, Y+2 ; 0x02 1b586: fb 80 ldd r15, Y+3 ; 0x03 while (!endstop_triggered) { if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { endstop_triggered = true; if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) { 1b588: 20 e0 ldi r18, 0x00 ; 0 1b58a: 30 e0 ldi r19, 0x00 ; 0 1b58c: 40 e8 ldi r20, 0x80 ; 128 1b58e: 5f e3 ldi r21, 0x3F ; 63 } timeout_counter = _millis() + 2500; endstop_triggered = false; manage_inactivity(true); while (!endstop_triggered) { if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1b590: 1e 99 sbic 0x03, 6 ; 3 1b592: 26 c0 rjmp .+76 ; 0x1b5e0 1b594: 1d 99 sbic 0x03, 5 ; 3 1b596: 24 c0 rjmp .+72 ; 0x1b5e0 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } else { current_position[axis] -= 1; 1b598: c7 01 movw r24, r14 1b59a: b6 01 movw r22, r12 1b59c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1b5a0: 68 83 st Y, r22 1b5a2: 79 83 std Y+1, r23 ; 0x01 1b5a4: 8a 83 std Y+2, r24 ; 0x02 1b5a6: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b5a8: 60 e0 ldi r22, 0x00 ; 0 1b5aa: 70 e0 ldi r23, 0x00 ; 0 1b5ac: 84 e3 ldi r24, 0x34 ; 52 1b5ae: 92 e4 ldi r25, 0x42 ; 66 1b5b0: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1b5b4: 0f 94 b0 18 call 0x23160 ; 0x23160 if (_millis() > timeout_counter) { 1b5b8: 0f 94 56 0b call 0x216ac ; 0x216ac 1b5bc: 46 16 cp r4, r22 1b5be: 57 06 cpc r5, r23 1b5c0: 68 06 cpc r6, r24 1b5c2: 79 06 cpc r7, r25 1b5c4: e8 f6 brcc .-70 ; 0x1b580 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); 1b5c6: 68 ec ldi r22, 0xC8 ; 200 1b5c8: 72 e0 ldi r23, 0x02 ; 2 1b5ca: 01 2b or r16, r17 1b5cc: 11 f0 breq .+4 ; 0x1b5d2 1b5ce: 6a ec ldi r22, 0xCA ; 202 1b5d0: 72 e0 ldi r23, 0x02 ; 2 1b5d2: 4f ed ldi r20, 0xDF ; 223 1b5d4: 52 e0 ldi r21, 0x02 ; 2 1b5d6: 87 e0 ldi r24, 0x07 ; 7 1b5d8: 0e 94 4c d8 call 0x1b098 ; 0x1b098 return(false); 1b5dc: 80 e0 ldi r24, 0x00 ; 0 1b5de: 30 c0 rjmp .+96 ; 0x1b640 manage_inactivity(true); while (!endstop_triggered) { if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { endstop_triggered = true; if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) { 1b5e0: c5 01 movw r24, r10 1b5e2: b4 01 movw r22, r8 1b5e4: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1b5e8: a7 01 movw r20, r14 1b5ea: 96 01 movw r18, r12 1b5ec: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1b5f0: 18 16 cp r1, r24 1b5f2: 4c f3 brlt .-46 ; 0x1b5c6 1b5f4: 20 e0 ldi r18, 0x00 ; 0 1b5f6: 30 e0 ldi r19, 0x00 ; 0 1b5f8: 40 e8 ldi r20, 0x80 ; 128 1b5fa: 5f e3 ldi r21, 0x3F ; 63 1b5fc: c5 01 movw r24, r10 1b5fe: b4 01 movw r22, r8 1b600: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1b604: a7 01 movw r20, r14 1b606: 96 01 movw r18, r12 1b608: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1b60c: 87 fd sbrc r24, 7 1b60e: db cf rjmp .-74 ; 0x1b5c6 current_position[axis] += 10; 1b610: e1 01 movw r28, r2 1b612: cf 59 subi r28, 0x9F ; 159 1b614: dd 4e sbci r29, 0xED ; 237 1b616: 20 e0 ldi r18, 0x00 ; 0 1b618: 30 e0 ldi r19, 0x00 ; 0 1b61a: 40 e2 ldi r20, 0x20 ; 32 1b61c: 51 e4 ldi r21, 0x41 ; 65 1b61e: c7 01 movw r24, r14 1b620: b6 01 movw r22, r12 1b622: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1b626: 68 83 st Y, r22 1b628: 79 83 std Y+1, r23 ; 0x01 1b62a: 8a 83 std Y+2, r24 ; 0x02 1b62c: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b62e: 60 e0 ldi r22, 0x00 ; 0 1b630: 70 e0 ldi r23, 0x00 ; 0 1b632: 84 e3 ldi r24, 0x34 ; 52 1b634: 92 e4 ldi r25, 0x42 ; 66 1b636: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1b63a: 0f 94 b0 18 call 0x23160 ; 0x23160 return(true); 1b63e: 81 e0 ldi r24, 0x01 ; 1 return(false); } } } return(true); } 1b640: df 91 pop r29 1b642: cf 91 pop r28 1b644: 1f 91 pop r17 1b646: 0f 91 pop r16 1b648: ff 90 pop r15 1b64a: ef 90 pop r14 1b64c: df 90 pop r13 1b64e: cf 90 pop r12 1b650: bf 90 pop r11 1b652: af 90 pop r10 1b654: 9f 90 pop r9 1b656: 8f 90 pop r8 1b658: 7f 90 pop r7 1b65a: 6f 90 pop r6 1b65c: 5f 90 pop r5 1b65e: 4f 90 pop r4 1b660: 3f 90 pop r3 1b662: 2f 90 pop r2 1b664: 08 95 ret 0001b666 : } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1b666: 2f 92 push r2 1b668: 3f 92 push r3 1b66a: 4f 92 push r4 1b66c: 5f 92 push r5 1b66e: 6f 92 push r6 1b670: 7f 92 push r7 1b672: 8f 92 push r8 1b674: 9f 92 push r9 1b676: af 92 push r10 1b678: bf 92 push r11 1b67a: cf 92 push r12 1b67c: df 92 push r13 1b67e: ef 92 push r14 1b680: ff 92 push r15 1b682: 0f 93 push r16 1b684: 1f 93 push r17 1b686: cf 93 push r28 1b688: df 93 push r29 1b68a: 7c 01 movw r14, r24 1b68c: 3b 01 movw r6, r22 bool _stepresult = false; uint8_t _progress = 0; int _travel_done = 0; int _err_endstop = 0; int _lcd_refresh = 0; _travel = _travel + (_travel / 10); 1b68e: cb 01 movw r24, r22 1b690: 6a e0 ldi r22, 0x0A ; 10 1b692: 70 e0 ldi r23, 0x00 ; 0 1b694: 0f 94 7a a4 call 0x348f4 ; 0x348f4 <__divmodhi4> 1b698: 66 0e add r6, r22 1b69a: 77 1e adc r7, r23 if (_axis == X_AXIS) { 1b69c: e1 14 cp r14, r1 1b69e: f1 04 cpc r15, r1 1b6a0: e1 f4 brne .+56 ; 0x1b6da current_position[Z_AXIS] += 17; 1b6a2: 20 e0 ldi r18, 0x00 ; 0 1b6a4: 30 e0 ldi r19, 0x00 ; 0 1b6a6: 48 e8 ldi r20, 0x88 ; 136 1b6a8: 51 e4 ldi r21, 0x41 ; 65 1b6aa: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1b6ae: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 1b6b2: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1b6b6: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 1b6ba: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1b6be: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1b6c2: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1b6c6: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1b6ca: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b6ce: 60 e0 ldi r22, 0x00 ; 0 1b6d0: 70 e0 ldi r23, 0x00 ; 0 1b6d2: 84 e3 ldi r24, 0x34 ; 52 1b6d4: 92 e4 ldi r25, 0x42 ; 66 1b6d6: 0f 94 0a 4a call 0x29414 ; 0x29414 } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1b6da: 10 e0 ldi r17, 0x00 ; 0 1b6dc: 00 e0 ldi r16, 0x00 ; 0 1b6de: d0 e0 ldi r29, 0x00 ; 0 1b6e0: c0 e0 ldi r28, 0x00 ; 0 1b6e2: d1 2c mov r13, r1 1b6e4: c1 2c mov r12, r1 1b6e6: 31 2c mov r3, r1 1b6e8: 51 2c mov r5, r1 current_position[Z_AXIS] += 17; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); } do { current_position[_axis] = current_position[_axis] - 1; 1b6ea: 57 01 movw r10, r14 1b6ec: aa 0c add r10, r10 1b6ee: bb 1c adc r11, r11 1b6f0: aa 0c add r10, r10 1b6f2: bb 1c adc r11, r11 1b6f4: c5 01 movw r24, r10 1b6f6: 8f 59 subi r24, 0x9F ; 159 1b6f8: 9d 4e sbci r25, 0xED ; 237 1b6fa: 4c 01 movw r8, r24 { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1b6fc: 94 e0 ldi r25, 0x04 ; 4 1b6fe: 29 2e mov r2, r25 1b700: 2e 0c add r2, r14 current_position[Z_AXIS] += 17; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); } do { current_position[_axis] = current_position[_axis] - 1; 1b702: 20 e0 ldi r18, 0x00 ; 0 1b704: 30 e0 ldi r19, 0x00 ; 0 1b706: 40 e8 ldi r20, 0x80 ; 128 1b708: 5f e3 ldi r21, 0x3F ; 63 1b70a: f4 01 movw r30, r8 1b70c: 60 81 ld r22, Z 1b70e: 71 81 ldd r23, Z+1 ; 0x01 1b710: 82 81 ldd r24, Z+2 ; 0x02 1b712: 93 81 ldd r25, Z+3 ; 0x03 1b714: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1b718: f4 01 movw r30, r8 1b71a: 60 83 st Z, r22 1b71c: 71 83 std Z+1, r23 ; 0x01 1b71e: 82 83 std Z+2, r24 ; 0x02 1b720: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b722: 60 e0 ldi r22, 0x00 ; 0 1b724: 70 e0 ldi r23, 0x00 ; 0 1b726: 84 e3 ldi r24, 0x34 ; 52 1b728: 92 e4 ldi r25, 0x42 ; 66 1b72a: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1b72e: 0f 94 b0 18 call 0x23160 ; 0x23160 if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1b732: 1e 99 sbic 0x03, 6 ; 3 1b734: 04 c0 rjmp .+8 ; 0x1b73e 1b736: 1d 99 sbic 0x03, 5 ; 3 1b738: 02 c0 rjmp .+4 ; 0x1b73e 1b73a: 1c 9b sbis 0x03, 4 ; 3 1b73c: 39 c0 rjmp .+114 ; 0x1b7b0 (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b73e: 53 b0 in r5, 0x03 ; 3 st_synchronize(); if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) 1b740: e1 14 cp r14, r1 1b742: f1 04 cpc r15, r1 1b744: 51 f4 brne .+20 ; 0x1b75a { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b746: 56 fa bst r5, 6 1b748: 55 24 eor r5, r5 1b74a: 50 f8 bld r5, 0 _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1b74c: 1d 99 sbic 0x03, 5 ; 3 1b74e: 8e c0 rjmp .+284 ; 0x1b86c } if (_axis == 1) { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1b750: c2 e0 ldi r28, 0x02 ; 2 1b752: d0 e0 ldi r29, 0x00 ; 0 { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; 1b754: 44 24 eor r4, r4 1b756: 43 94 inc r4 1b758: 2c c0 rjmp .+88 ; 0x1b7b2 { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; } if (_axis == 1) 1b75a: f1 e0 ldi r31, 0x01 ; 1 1b75c: ef 16 cp r14, r31 1b75e: f1 04 cpc r15, r1 1b760: 41 f4 brne .+16 ; 0x1b772 { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b762: 55 fa bst r5, 5 1b764: 55 24 eor r5, r5 1b766: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1b768: 1e 9b sbis 0x03, 6 ; 3 1b76a: f2 cf rjmp .-28 ; 0x1b750 1b76c: d0 e0 ldi r29, 0x00 ; 0 1b76e: c0 e0 ldi r28, 0x00 ; 0 1b770: f1 cf rjmp .-30 ; 0x1b754 } if (_axis == 2) { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b772: 54 fa bst r5, 4 1b774: 55 24 eor r5, r5 1b776: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; 1b778: 83 b1 in r24, 0x03 ; 3 1b77a: 82 95 swap r24 1b77c: 86 95 lsr r24 1b77e: 86 95 lsr r24 1b780: 83 70 andi r24, 0x03 ; 3 1b782: 21 e0 ldi r18, 0x01 ; 1 1b784: 82 27 eor r24, r18 1b786: 81 70 andi r24, 0x01 ; 1 1b788: c8 2f mov r28, r24 1b78a: 80 e0 ldi r24, 0x00 ; 0 1b78c: d8 2f mov r29, r24 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); 1b78e: 8f 93 push r24 1b790: cf 93 push r28 1b792: 1f 92 push r1 1b794: 5f 92 push r5 1b796: e3 eb ldi r30, 0xB3 ; 179 1b798: f3 e8 ldi r31, 0x83 ; 131 1b79a: ff 93 push r31 1b79c: ef 93 push r30 1b79e: 0f 94 5f a2 call 0x344be ; 0x344be 1b7a2: 0f 90 pop r0 1b7a4: 0f 90 pop r0 1b7a6: 0f 90 pop r0 1b7a8: 0f 90 pop r0 1b7aa: 0f 90 pop r0 1b7ac: 0f 90 pop r0 1b7ae: d2 cf rjmp .-92 ; 0x1b754 current_position[_axis] = current_position[_axis] - 1; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1b7b0: 41 2c mov r4, r1 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; } if (_lcd_refresh < 6) 1b7b2: 06 30 cpi r16, 0x06 ; 6 1b7b4: 11 05 cpc r17, r1 1b7b6: 0c f0 brlt .+2 ; 0x1b7ba 1b7b8: 4f c0 rjmp .+158 ; 0x1b858 { _lcd_refresh++; 1b7ba: 0f 5f subi r16, 0xFF ; 255 1b7bc: 1f 4f sbci r17, 0xFF ; 255 { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); _lcd_refresh = 0; } manage_heater(); 1b7be: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1b7c2: 81 e0 ldi r24, 0x01 ; 1 1b7c4: 0e 94 25 8a call 0x1144a ; 0x1144a (_travel_done <= _travel) ? _travel_done++ : _stepdone = true; 1b7c8: 6c 14 cp r6, r12 1b7ca: 7d 04 cpc r7, r13 1b7cc: 34 f0 brlt .+12 ; 0x1b7da 1b7ce: 8f ef ldi r24, 0xFF ; 255 1b7d0: c8 1a sub r12, r24 1b7d2: d8 0a sbc r13, r24 } while (!_stepdone); 1b7d4: 44 20 and r4, r4 1b7d6: 09 f4 brne .+2 ; 0x1b7da 1b7d8: 94 cf rjmp .-216 ; 0x1b702 if (!_stepresult) 1b7da: 51 10 cpse r5, r1 1b7dc: 20 c0 rjmp .+64 ; 0x1b81e { const char *_error_1; const char *_error_2; if (_axis == X_AXIS) _error_1 = "X"; if (_axis == Y_AXIS) _error_1 = "Y"; 1b7de: 6a ec ldi r22, 0xCA ; 202 1b7e0: 72 e0 ldi r23, 0x02 ; 2 1b7e2: 91 e0 ldi r25, 0x01 ; 1 1b7e4: e9 16 cp r14, r25 1b7e6: f1 04 cpc r15, r1 1b7e8: 41 f0 breq .+16 ; 0x1b7fa if (_axis == Z_AXIS) _error_1 = "Z"; 1b7ea: 6c ec ldi r22, 0xCC ; 204 1b7ec: 72 e0 ldi r23, 0x02 ; 2 1b7ee: e2 e0 ldi r30, 0x02 ; 2 1b7f0: ee 16 cp r14, r30 1b7f2: f1 04 cpc r15, r1 1b7f4: 11 f0 breq .+4 ; 0x1b7fa 1b7f6: 68 ec ldi r22, 0xC8 ; 200 1b7f8: 72 e0 ldi r23, 0x02 ; 2 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; 1b7fa: 4a ec ldi r20, 0xCA ; 202 1b7fc: 52 e0 ldi r21, 0x02 ; 2 1b7fe: c1 30 cpi r28, 0x01 ; 1 1b800: d1 05 cpc r29, r1 1b802: 31 f0 breq .+12 ; 0x1b810 if (_err_endstop == 2) _error_2 = "Z"; 1b804: 4c ec ldi r20, 0xCC ; 204 1b806: 52 e0 ldi r21, 0x02 ; 2 1b808: 22 97 sbiw r28, 0x02 ; 2 1b80a: 11 f0 breq .+4 ; 0x1b810 1b80c: 48 ec ldi r20, 0xC8 ; 200 1b80e: 52 e0 ldi r21, 0x02 ; 2 if (_travel_done >= _travel) { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); 1b810: 84 e0 ldi r24, 0x04 ; 4 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; if (_err_endstop == 2) _error_2 = "Z"; if (_travel_done >= _travel) 1b812: c6 14 cp r12, r6 1b814: d7 04 cpc r13, r7 1b816: 0c f4 brge .+2 ; 0x1b81a { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); } else { lcd_selftest_error(TestError::Motor, _error_1, _error_2); 1b818: 83 e0 ldi r24, 0x03 ; 3 1b81a: 0e 94 4c d8 call 0x1b098 ; 0x1b098 } } current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z. 1b81e: f5 01 movw r30, r10 1b820: ef 59 subi r30, 0x9F ; 159 1b822: fd 4e sbci r31, 0xED ; 237 1b824: 10 82 st Z, r1 1b826: 11 82 std Z+1, r1 ; 0x01 1b828: 12 82 std Z+2, r1 ; 0x02 1b82a: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1b82c: 0f 94 ca 48 call 0x29194 ; 0x29194 return _stepresult; } 1b830: 85 2d mov r24, r5 1b832: df 91 pop r29 1b834: cf 91 pop r28 1b836: 1f 91 pop r17 1b838: 0f 91 pop r16 1b83a: ff 90 pop r15 1b83c: ef 90 pop r14 1b83e: df 90 pop r13 1b840: cf 90 pop r12 1b842: bf 90 pop r11 1b844: af 90 pop r10 1b846: 9f 90 pop r9 1b848: 8f 90 pop r8 1b84a: 7f 90 pop r7 1b84c: 6f 90 pop r6 1b84e: 5f 90 pop r5 1b850: 4f 90 pop r4 1b852: 3f 90 pop r3 1b854: 2f 90 pop r2 1b856: 08 95 ret { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1b858: 10 e0 ldi r17, 0x00 ; 0 1b85a: 00 e0 ldi r16, 0x00 ; 0 1b85c: 20 e0 ldi r18, 0x00 ; 0 1b85e: 43 e0 ldi r20, 0x03 ; 3 1b860: 63 2d mov r22, r3 1b862: 82 2d mov r24, r2 1b864: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1b868: 38 2e mov r3, r24 1b86a: a9 cf rjmp .-174 ; 0x1b7be (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1b86c: c1 e0 ldi r28, 0x01 ; 1 1b86e: d0 e0 ldi r29, 0x00 ; 0 1b870: 71 cf rjmp .-286 ; 0x1b754 0001b872 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1b872: 0f 94 6d 05 call 0x20ada ; 0x20ada lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1b876: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> 1b87a: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 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() 1b87e: 81 11 cpse r24, r1 1b880: 39 c0 rjmp .+114 ; 0x1b8f4 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1b882: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1b886: 81 11 cpse r24, r1 1b888: 02 c0 rjmp .+4 ; 0x1b88e #endif ) { return false; // abort if error persists } return true; 1b88a: 81 e0 ldi r24, 0x01 ; 1 1b88c: 08 95 ret } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1b88e: 8f ef ldi r24, 0xFF ; 255 1b890: 80 93 55 12 sts 0x1255, r24 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1b894: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #endif manage_heater(); 1b898: 0f 94 a5 37 call 0x26f4a ; 0x26f4a { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); setExtruderAutoFanState(3); //force enables the hotend fan 1b89c: 83 e0 ldi r24, 0x03 ; 3 1b89e: 0e 94 7f 77 call 0xeefe ; 0xeefe #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1b8a2: 0f 94 56 0b call 0x216ac ; 0x216ac 1b8a6: 60 93 07 17 sts 0x1707, r22 ; 0x801707 1b8aa: 70 93 08 17 sts 0x1708, r23 ; 0x801708 1b8ae: 80 93 09 17 sts 0x1709, r24 ; 0x801709 1b8b2: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fan_measuring = true; 1b8b6: 81 e0 ldi r24, 0x01 ; 1 1b8b8: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 1b8bc: 68 ee ldi r22, 0xE8 ; 232 1b8be: 73 e0 ldi r23, 0x03 ; 3 1b8c0: 80 e0 ldi r24, 0x00 ; 0 1b8c2: 90 e0 ldi r25, 0x00 ; 0 1b8c4: 0f 94 23 0b call 0x21646 ; 0x21646 manage_heater(); 1b8c8: 0f 94 a5 37 call 0x26f4a ; 0x26f4a setExtruderAutoFanState(1); //releases lock on the hotend fan 1b8cc: 81 e0 ldi r24, 0x01 ; 1 1b8ce: 0e 94 7f 77 call 0xeefe ; 0xeefe } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1b8d2: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1b8d6: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 1b8da: 0f 94 a5 37 call 0x26f4a ; 0x26f4a _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) manage_heater(); setExtruderAutoFanState(1); //releases lock on the hotend fan lcd_selftest_setfan(0); #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 1b8de: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 1b8e2: 90 91 b8 03 lds r25, 0x03B8 ; 0x8003b8 1b8e6: 45 97 sbiw r24, 0x15 ; 21 1b8e8: 84 f6 brge .-96 ; 0x1b88a LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1b8ea: 62 e0 ldi r22, 0x02 ; 2 1b8ec: 82 e2 ldi r24, 0x22 ; 34 1b8ee: 98 e6 ldi r25, 0x68 ; 104 1b8f0: 0e 94 1d d8 call 0x1b03a ; 0x1b03a if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1b8f4: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1b8f6: 08 95 ret 0001b8f8 : //! @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; 1b8f8: 0e 94 39 dc call 0x1b872 ; 0x1b872 1b8fc: 88 23 and r24, r24 1b8fe: 21 f0 breq .+8 ; 0x1b908 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1b900: 88 e4 ldi r24, 0x48 ; 72 1b902: 98 e6 ldi r25, 0x68 ; 104 1b904: 0c 94 8d 7c jmp 0xf91a ; 0xf91a } 1b908: 08 95 ret 0001b90a : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1b90a: cf 93 push r28 1b90c: df 93 push r29 1b90e: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1b910: 80 e0 ldi r24, 0x00 ; 0 1b912: 0e 94 07 d8 call 0x1b00e ; 0x1b00e 1b916: 88 23 and r24, r24 1b918: 31 f0 breq .+12 ; 0x1b926 lcd_updatestatus(message, true); 1b91a: 61 e0 ldi r22, 0x01 ; 1 1b91c: ce 01 movw r24, r28 } 1b91e: df 91 pop r29 1b920: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1b922: 0c 94 ec d7 jmp 0x1afd8 ; 0x1afd8 } 1b926: df 91 pop r29 1b928: cf 91 pop r28 1b92a: 08 95 ret 0001b92c : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1b92c: 61 e0 ldi r22, 0x01 ; 1 1b92e: 8e e5 ldi r24, 0x5E ; 94 1b930: 9c e6 ldi r25, 0x6C ; 108 1b932: 0e 94 da 8c call 0x119b4 ; 0x119b4 custom_message_type = CustomMsg::FilamentLoading; //just print status message 1b936: 82 e0 ldi r24, 0x02 ; 2 1b938: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1b93c: 86 e0 ldi r24, 0x06 ; 6 1b93e: 9a e5 ldi r25, 0x5A ; 90 1b940: 0e 94 0a 75 call 0xea14 ; 0xea14 1b944: 0e 94 85 dc call 0x1b90a ; 0x1b90a lcd_return_to_status(); 1b948: 0f 94 6d 05 call 0x20ada ; 0x20ada lcd_draw_update = 3; 1b94c: 83 e0 ldi r24, 0x03 ; 3 1b94e: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1b952: 08 95 ret 0001b954 : //! @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; 1b954: 0e 94 39 dc call 0x1b872 ; 0x1b872 1b958: 88 23 and r24, r24 1b95a: 51 f1 breq .+84 ; 0x1b9b0 cmdqueue_serial_disabled = false; 1b95c: 10 92 93 03 sts 0x0393, r1 ; 0x800393 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1b960: 86 e0 ldi r24, 0x06 ; 6 1b962: 9a e5 ldi r25, 0x5A ; 90 1b964: 0e 94 0a 75 call 0xea14 ; 0xea14 1b968: 0e 94 85 dc call 0x1b90a ; 0x1b90a st_synchronize(); 1b96c: 0f 94 b0 18 call 0x23160 ; 0x23160 custom_message_type = CustomMsg::Resuming; 1b970: 88 e0 ldi r24, 0x08 ; 8 1b972: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d { #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(); 1b976: 0e 94 72 77 call 0xeee4 ; 0xeee4 setExtruderAutoFanState(1); 1b97a: 81 e0 ldi r24, 0x01 ; 1 1b97c: 0e 94 7f 77 call 0xeefe ; 0xeefe // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1b980: 10 92 3b 12 sts 0x123B, r1 ; 0x80123b restore_print_from_ram_and_continue(default_retraction); 1b984: 60 e0 ldi r22, 0x00 ; 0 1b986: 70 e0 ldi r23, 0x00 ; 0 1b988: 80 e8 ldi r24, 0x80 ; 128 1b98a: 9f e3 ldi r25, 0x3F ; 63 1b98c: 0e 94 88 66 call 0xcd10 ; 0xcd10 did_pause_print = false; 1b990: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 1b994: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 1b998: 82 30 cpi r24, 0x02 ; 2 1b99a: 11 f4 brne .+4 ; 0x1b9a0 1b99c: 0f 94 da 16 call 0x22db4 ; 0x22db4 refresh_cmd_timeout(); 1b9a0: 0e 94 11 65 call 0xca22 ; 0xca22 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1b9a4: 87 e3 ldi r24, 0x37 ; 55 1b9a6: 98 e6 ldi r25, 0x68 ; 104 1b9a8: 0e 94 8d 7c call 0xf91a ; 0xf91a custom_message_type = CustomMsg::Status; 1b9ac: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } 1b9b0: 08 95 ret 0001b9b2 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1b9b2: cf 93 push r28 1b9b4: df 93 push r29 1b9b6: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1b9b8: 80 e0 ldi r24, 0x00 ; 0 1b9ba: 0e 94 07 d8 call 0x1b00e ; 0x1b00e 1b9be: 88 23 and r24, r24 1b9c0: 31 f0 breq .+12 ; 0x1b9ce lcd_updatestatus(message); 1b9c2: 60 e0 ldi r22, 0x00 ; 0 1b9c4: ce 01 movw r24, r28 } 1b9c6: df 91 pop r29 1b9c8: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1b9ca: 0c 94 ec d7 jmp 0x1afd8 ; 0x1afd8 } 1b9ce: df 91 pop r29 1b9d0: cf 91 pop r28 1b9d2: 08 95 ret 0001b9d4 : 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) { 1b9d4: cf 93 push r28 1b9d6: df 93 push r29 1b9d8: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1b9da: 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) { 1b9dc: 66 23 and r22, r22 1b9de: 89 f1 breq .+98 ; 0x1ba42 1b9e0: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1b9e2: 0f 94 3d 0e call 0x21c7a ; 0x21c7a cancel_heatup = true; 1b9e6: 81 e0 ldi r24, 0x01 ; 1 1b9e8: 80 93 5f 0d sts 0x0D5F, r24 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.392> heating_status = HeatingStatus::NO_HEATING; 1b9ec: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb // Clear any saved printing state cancel_saved_printing(); 1b9f0: 0e 94 d7 63 call 0xc7ae ; 0xc7ae // Abort the planner planner_abort_hard(); 1b9f4: 0f 94 84 4c call 0x29908 ; 0x29908 // Reset the queue cmdqueue_reset(); 1b9f8: 0e 94 34 83 call 0x10668 ; 0x10668 cmdqueue_serial_disabled = false; 1b9fc: 10 92 93 03 sts 0x0393, r1 ; 0x800393 st_reset_timer(); 1ba00: 0f 94 01 19 call 0x23202 ; 0x23202 CRITICAL_SECTION_END; 1ba04: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1ba06: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd print_job_timer.stop(); 1ba0a: 0f 94 fe 16 call 0x22dfc ; 0x22dfc } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1ba0e: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 1ba12: 88 23 and r24, r24 1ba14: 21 f0 breq .+8 ; 0x1ba1e // Reset the sd status card.sdprinting = false; 1ba16: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 card.closefile(); 1ba1a: 0f 94 d1 65 call 0x2cba2 ; 0x2cba2 } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1ba1e: 8a e7 ldi r24, 0x7A ; 122 1ba20: 98 e6 ldi r25, 0x68 ; 104 1ba22: 0e 94 8d 7c call 0xf91a ; 0xf91a #ifdef MESH_BED_LEVELING mbl.active = false; 1ba26: 10 92 09 13 sts 0x1309, r1 ; 0x801309 #endif if (interactive) { 1ba2a: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1ba2c: 10 92 3b 12 sts 0x123B, r1 ; 0x80123b } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 1ba30: 81 e0 ldi r24, 0x01 ; 1 1ba32: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1ba36: 10 92 61 0d sts 0x0D61, r1 ; 0x800d61 <_ZL13printer_state.lto_priv.387> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 1ba3a: df 91 pop r29 1ba3c: 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(); 1ba3e: 0d 94 6d 05 jmp 0x20ada ; 0x20ada } void ConditionalStop() { CRITICAL_SECTION_START; 1ba42: 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; 1ba44: 81 e0 ldi r24, 0x01 ; 1 1ba46: 80 93 5f 0d sts 0x0D5F, r24 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.392> heating_status = HeatingStatus::NO_HEATING; 1ba4a: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb // Clear any saved printing state cancel_saved_printing(); 1ba4e: 0e 94 d7 63 call 0xc7ae ; 0xc7ae // Abort the planner planner_abort_hard(); 1ba52: 0f 94 84 4c call 0x29908 ; 0x29908 // Reset the queue cmdqueue_reset(); 1ba56: 0e 94 34 83 call 0x10668 ; 0x10668 cmdqueue_serial_disabled = false; 1ba5a: 10 92 93 03 sts 0x0393, r1 ; 0x800393 st_reset_timer(); 1ba5e: 0f 94 01 19 call 0x23202 ; 0x23202 CRITICAL_SECTION_END; 1ba62: df bf out 0x3f, r29 ; 63 1ba64: d4 cf rjmp .-88 ; 0x1ba0e 0001ba66 : } void lcd_print_stop() { print_stop(true); 1ba66: 60 e0 ldi r22, 0x00 ; 0 1ba68: 81 e0 ldi r24, 0x01 ; 1 1ba6a: 0c 94 ea dc jmp 0x1b9d4 ; 0x1b9d4 0001ba6e : lcd_update(2); } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); 1ba6e: 40 e0 ldi r20, 0x00 ; 0 1ba70: 53 e8 ldi r21, 0x83 ; 131 1ba72: 60 e0 ldi r22, 0x00 ; 0 1ba74: 80 e0 ldi r24, 0x00 ; 0 1ba76: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 1ba7a: 1e 99 sbic 0x03, 6 ; 3 1ba7c: 16 c0 rjmp .+44 ; 0x1baaa 1ba7e: 4a ef ldi r20, 0xFA ; 250 1ba80: 52 e8 ldi r21, 0x82 ; 130 1ba82: 61 e0 ldi r22, 0x01 ; 1 1ba84: 80 e0 ldi r24, 0x00 ; 0 1ba86: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 1ba8a: 1d 9b sbis 0x03, 5 ; 3 1ba8c: 11 c0 rjmp .+34 ; 0x1bab0 1ba8e: 47 ef ldi r20, 0xF7 ; 247 1ba90: 52 e8 ldi r21, 0x82 ; 130 1ba92: 62 e0 ldi r22, 0x02 ; 2 1ba94: 80 e0 ldi r24, 0x00 ; 0 1ba96: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 1ba9a: 1c 9b sbis 0x03, 4 ; 3 1ba9c: 0c c0 rjmp .+24 ; 0x1bab6 1ba9e: 41 ef ldi r20, 0xF1 ; 241 1baa0: 52 e8 ldi r21, 0x82 ; 130 1baa2: 63 e0 ldi r22, 0x03 ; 3 1baa4: 80 e0 ldi r24, 0x00 ; 0 1baa6: 0c 94 d7 6f jmp 0xdfae ; 0xdfae } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 1baaa: 4d ef ldi r20, 0xFD ; 253 1baac: 52 e8 ldi r21, 0x82 ; 130 1baae: e9 cf rjmp .-46 ; 0x1ba82 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 1bab0: 44 ef ldi r20, 0xF4 ; 244 1bab2: 52 e8 ldi r21, 0x82 ; 130 1bab4: ee cf rjmp .-36 ; 0x1ba92 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 1bab6: 4e ee ldi r20, 0xEE ; 238 1bab8: 52 e8 ldi r21, 0x82 ; 130 1baba: f3 cf rjmp .-26 ; 0x1baa2 0001babc : } static void menu_show_end_stops() { lcd_show_end_stops(); 1babc: 0e 94 37 dd call 0x1ba6e ; 0x1ba6e menu_back_if_clicked(); 1bac0: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 0001bac4 : //! @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) { 1bac4: cf 92 push r12 1bac6: df 92 push r13 1bac8: ef 92 push r14 1baca: ff 92 push r15 1bacc: 0f 93 push r16 1bace: 1f 93 push r17 1bad0: cf 93 push r28 1bad2: df 93 push r29 1bad4: d8 2f mov r29, r24 1bad6: 6b 01 movw r12, r22 1bad8: 7a 01 movw r14, r20 1bada: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 1badc: 40 e2 ldi r20, 0x20 ; 32 1bade: 81 11 cpse r24, r1 1bae0: 01 c0 rjmp .+2 ; 0x1bae4 1bae2: 4e e3 ldi r20, 0x3E ; 62 1bae4: 63 e0 ldi r22, 0x03 ; 3 1bae6: 80 e0 ldi r24, 0x00 ; 0 1bae8: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_puts_P(first_choice); 1baec: c6 01 movw r24, r12 1baee: 0e 94 ed 6e call 0xddda ; 0xddda lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 1baf2: 40 e2 ldi r20, 0x20 ; 32 1baf4: d1 30 cpi r29, 0x01 ; 1 1baf6: 09 f4 brne .+2 ; 0x1bafa 1baf8: 4e e3 ldi r20, 0x3E ; 62 1bafa: 63 e0 ldi r22, 0x03 ; 3 1bafc: 8c 2f mov r24, r28 1bafe: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_puts_P(second_choice); 1bb02: c7 01 movw r24, r14 1bb04: 0e 94 ed 6e call 0xddda ; 0xddda if (third_choice) { 1bb08: 01 15 cp r16, r1 1bb0a: 11 05 cpc r17, r1 1bb0c: 19 f1 breq .+70 ; 0x1bb54 1bb0e: c8 01 movw r24, r16 1bb10: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__strlen_P> 1bb14: d8 2e mov r13, r24 1bb16: c7 01 movw r24, r14 1bb18: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__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; 1bb1c: 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;} 1bb1e: 93 e1 ldi r25, 0x13 ; 19 1bb20: 9d 19 sub r25, r13 1bb22: 8c 0f add r24, r28 1bb24: 89 17 cp r24, r25 1bb26: 08 f4 brcc .+2 ; 0x1bb2a 1bb28: 89 2f mov r24, r25 1bb2a: 83 31 cpi r24, 0x13 ; 19 1bb2c: 08 f0 brcs .+2 ; 0x1bb30 1bb2e: 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 ? '>': ' '); 1bb30: 40 e2 ldi r20, 0x20 ; 32 1bb32: d2 30 cpi r29, 0x02 ; 2 1bb34: 09 f4 brne .+2 ; 0x1bb38 1bb36: 4e e3 ldi r20, 0x3E ; 62 1bb38: 63 e0 ldi r22, 0x03 ; 3 1bb3a: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_puts_P(third_choice); 1bb3e: c8 01 movw r24, r16 } } 1bb40: df 91 pop r29 1bb42: cf 91 pop r28 1bb44: 1f 91 pop r17 1bb46: 0f 91 pop r16 1bb48: ff 90 pop r15 1bb4a: ef 90 pop r14 1bb4c: df 90 pop r13 1bb4e: 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); 1bb50: 0c 94 ed 6e jmp 0xddda ; 0xddda } } 1bb54: df 91 pop r29 1bb56: cf 91 pop r28 1bb58: 1f 91 pop r17 1bb5a: 0f 91 pop r16 1bb5c: ff 90 pop r15 1bb5e: ef 90 pop r14 1bb60: df 90 pop r13 1bb62: cf 90 pop r12 1bb64: 08 95 ret 0001bb66 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 1bb66: 4f 92 push r4 1bb68: 5f 92 push r5 1bb6a: 6f 92 push r6 1bb6c: 7f 92 push r7 1bb6e: 8f 92 push r8 1bb70: 9f 92 push r9 1bb72: af 92 push r10 1bb74: bf 92 push r11 1bb76: cf 92 push r12 1bb78: df 92 push r13 1bb7a: ef 92 push r14 1bb7c: ff 92 push r15 1bb7e: 0f 93 push r16 1bb80: 1f 93 push r17 1bb82: cf 93 push r28 1bb84: 8c 01 movw r16, r24 bool bDelayed; long nTime0 = _millis()/1000; 1bb86: 0f 94 56 0b call 0x216ac ; 0x216ac 1bb8a: 28 ee ldi r18, 0xE8 ; 232 1bb8c: 33 e0 ldi r19, 0x03 ; 3 1bb8e: 40 e0 ldi r20, 0x00 ; 0 1bb90: 50 e0 ldi r21, 0x00 ; 0 1bb92: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 1bb96: 69 01 movw r12, r18 1bb98: 7a 01 movw r14, r20 lcd_consume_click(); 1bb9a: 0e 94 40 73 call 0xe680 ; 0xe680 KEEPALIVE_STATE(PAUSED_FOR_USER); 1bb9e: 84 e0 ldi r24, 0x04 ; 4 1bba0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 1bba4: 88 ee ldi r24, 0xE8 ; 232 1bba6: 88 2e mov r8, r24 1bba8: 83 e0 ldi r24, 0x03 ; 3 1bbaa: 98 2e mov r9, r24 1bbac: a1 2c mov r10, r1 1bbae: b1 2c mov r11, r1 1bbb0: 28 01 movw r4, r16 1bbb2: 71 2c mov r7, r1 1bbb4: 61 2c mov r6, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 1bbb6: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1bbba: 81 e0 ldi r24, 0x01 ; 1 1bbbc: 0e 94 25 8a call 0x1144a ; 0x1144a bDelayed = ((_millis()/1000-nTime0) > nDelay); 1bbc0: 0f 94 56 0b call 0x216ac ; 0x216ac 1bbc4: a5 01 movw r20, r10 1bbc6: 94 01 movw r18, r8 1bbc8: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 1bbcc: 2c 19 sub r18, r12 1bbce: 3d 09 sbc r19, r13 1bbd0: 4e 09 sbc r20, r14 1bbd2: 5f 09 sbc r21, r15 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click 1bbd4: 42 16 cp r4, r18 1bbd6: 53 06 cpc r5, r19 1bbd8: 64 06 cpc r6, r20 1bbda: 75 06 cpc r7, r21 1bbdc: 20 f4 brcc .+8 ; 0x1bbe6 1bbde: c1 e0 ldi r28, 0x01 ; 1 1bbe0: 01 15 cp r16, r1 1bbe2: 11 05 cpc r17, r1 1bbe4: 09 f4 brne .+2 ; 0x1bbe8 1bbe6: c0 e0 ldi r28, 0x00 ; 0 if (lcd_clicked() || bDelayed) { 1bbe8: 0e 94 45 73 call 0xe68a ; 0xe68a 1bbec: 81 11 cpse r24, r1 1bbee: 02 c0 rjmp .+4 ; 0x1bbf4 1bbf0: cc 23 and r28, r28 1bbf2: 09 f3 breq .-62 ; 0x1bbb6 KEEPALIVE_STATE(IN_HANDLER); 1bbf4: 82 e0 ldi r24, 0x02 ; 2 1bbf6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(!bDelayed); } } } 1bbfa: 81 e0 ldi r24, 0x01 ; 1 1bbfc: 8c 27 eor r24, r28 1bbfe: cf 91 pop r28 1bc00: 1f 91 pop r17 1bc02: 0f 91 pop r16 1bc04: ff 90 pop r15 1bc06: ef 90 pop r14 1bc08: df 90 pop r13 1bc0a: cf 90 pop r12 1bc0c: bf 90 pop r11 1bc0e: af 90 pop r10 1bc10: 9f 90 pop r9 1bc12: 8f 90 pop r8 1bc14: 7f 90 pop r7 1bc16: 6f 90 pop r6 1bc18: 5f 90 pop r5 1bc1a: 4f 90 pop r4 1bc1c: 08 95 ret 0001bc1e : * 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) { 1bc1e: af 92 push r10 1bc20: bf 92 push r11 1bc22: cf 92 push r12 1bc24: df 92 push r13 1bc26: ef 92 push r14 1bc28: ff 92 push r15 1bc2a: 0f 93 push r16 1bc2c: 1f 93 push r17 1bc2e: cf 93 push r28 1bc30: df 93 push r29 1bc32: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 1bc34: 0e 94 b6 6e call 0xdd6c ; 0xdd6c * @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; 1bc38: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 1bc3a: 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; 1bc3c: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 1bc3e: 6f 2d mov r22, r15 1bc40: 80 e0 ldi r24, 0x00 ; 0 1bc42: 0e 94 2a 6f call 0xde54 ; 0xde54 // 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) 1bc46: c6 01 movw r24, r12 1bc48: 0e 94 eb bb call 0x177d6 ; 0x177d6 1bc4c: 88 23 and r24, r24 1bc4e: 29 f0 breq .+10 ; 0x1bc5a 1bc50: 8f ef ldi r24, 0xFF ; 255 1bc52: c8 1a sub r12, r24 1bc54: d8 0a sbc r13, r24 1bc56: 09 f4 brne .+2 ; 0x1bc5a 1bc58: 49 c0 rjmp .+146 ; 0x1bcec 1bc5a: c6 01 movw r24, r12 1bc5c: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 1bc60: 84 31 cpi r24, 0x14 ; 20 1bc62: 91 05 cpc r25, r1 1bc64: 10 f0 brcs .+4 ; 0x1bc6a 1bc66: 84 e1 ldi r24, 0x14 ; 20 1bc68: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 1bc6a: e6 01 movw r28, r12 1bc6c: c8 0f add r28, r24 1bc6e: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 1bc70: e3 e0 ldi r30, 0x03 ; 3 1bc72: fe 12 cpse r15, r30 1bc74: 0a c0 rjmp .+20 ; 0x1bc8a 1bc76: 84 31 cpi r24, 0x14 ; 20 1bc78: 41 f4 brne .+16 ; 0x1bc8a // 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; 1bc7a: fe 01 movw r30, r28 1bc7c: 84 91 lpm r24, Z 1bc7e: e1 2c mov r14, r1 if (multi_screen) 1bc80: 88 23 and r24, r24 1bc82: 19 f0 breq .+6 ; 0x1bc8a msgend = (msgend2 -= 2); 1bc84: 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; 1bc86: ee 24 eor r14, r14 1bc88: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 1bc8a: fe 01 movw r30, r28 1bc8c: 84 91 lpm r24, Z 1bc8e: 88 23 and r24, r24 1bc90: 09 f4 brne .+2 ; 0x1bc94 1bc92: 40 c0 rjmp .+128 ; 0x1bd14 1bc94: ce 01 movw r24, r28 1bc96: 0e 94 eb bb call 0x177d6 ; 0x177d6 1bc9a: 81 11 cpse r24, r1 1bc9c: 3b c0 rjmp .+118 ; 0x1bd14 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); 1bc9e: fe 01 movw r30, r28 1bca0: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 1bca2: 92 ed ldi r25, 0xD2 ; 210 1bca4: 98 0f add r25, r24 1bca6: 92 30 cpi r25, 0x02 ; 2 1bca8: a8 f1 brcs .+106 ; 0x1bd14 1bcaa: 8c 32 cpi r24, 0x2C ; 44 1bcac: 99 f1 breq .+102 ; 0x1bd14 1bcae: 96 ec ldi r25, 0xC6 ; 198 1bcb0: 98 0f add r25, r24 1bcb2: 92 30 cpi r25, 0x02 ; 2 1bcb4: 78 f1 brcs .+94 ; 0x1bd14 1bcb6: 8f 33 cpi r24, 0x3F ; 63 1bcb8: 69 f1 breq .+90 ; 0x1bd14 1bcba: 81 32 cpi r24, 0x21 ; 33 1bcbc: 59 f1 breq .+86 ; 0x1bd14 1bcbe: 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)) 1bcc0: c0 16 cp r12, r16 1bcc2: d1 06 cpc r13, r17 1bcc4: 58 f4 brcc .+22 ; 0x1bcdc 1bcc6: 58 01 movw r10, r16 1bcc8: f1 e0 ldi r31, 0x01 ; 1 1bcca: af 1a sub r10, r31 1bccc: b1 08 sbc r11, r1 1bcce: c5 01 movw r24, r10 1bcd0: 0e 94 eb bb call 0x177d6 ; 0x177d6 1bcd4: 81 11 cpse r24, r1 1bcd6: 1d c0 rjmp .+58 ; 0x1bd12 -- msgend; 1bcd8: 85 01 movw r16, r10 1bcda: f2 cf rjmp .-28 ; 0x1bcc0 if (msgend == msg) 1bcdc: c0 16 cp r12, r16 1bcde: d1 06 cpc r13, r17 1bce0: c9 f0 breq .+50 ; 0x1bd14 1bce2: 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) { 1bce4: f3 94 inc r15 1bce6: 84 e0 ldi r24, 0x04 ; 4 1bce8: f8 12 cpse r15, r24 1bcea: a9 cf rjmp .-174 ; 0x1bc3e } lcd_print(c); } } if (multi_screen) { 1bcec: ee 20 and r14, r14 1bcee: f9 f0 breq .+62 ; 0x1bd2e // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 1bcf0: 48 e8 ldi r20, 0x88 ; 136 1bcf2: 63 e0 ldi r22, 0x03 ; 3 1bcf4: 83 e1 ldi r24, 0x13 ; 19 1bcf6: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 } return multi_screen ? msgend : NULL; } 1bcfa: ce 01 movw r24, r28 1bcfc: df 91 pop r29 1bcfe: cf 91 pop r28 1bd00: 1f 91 pop r17 1bd02: 0f 91 pop r16 1bd04: ff 90 pop r15 1bd06: ef 90 pop r14 1bd08: df 90 pop r13 1bd0a: cf 90 pop r12 1bd0c: bf 90 pop r11 1bd0e: af 90 pop r10 1bd10: 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)) 1bd12: 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) { 1bd14: cc 16 cp r12, r28 1bd16: dd 06 cpc r13, r29 1bd18: 28 f7 brcc .-54 ; 0x1bce4 char c = char(pgm_read_byte(msg)); 1bd1a: f6 01 movw r30, r12 1bd1c: 84 91 lpm r24, Z if (c == '\n') { 1bd1e: 8a 30 cpi r24, 0x0A ; 10 1bd20: 09 f3 breq .-62 ; 0x1bce4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1bd22: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 1bd26: ff ef ldi r31, 0xFF ; 255 1bd28: cf 1a sub r12, r31 1bd2a: df 0a sbc r13, r31 1bd2c: f3 cf rjmp .-26 ; 0x1bd14 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 1bd2e: d0 e0 ldi r29, 0x00 ; 0 1bd30: c0 e0 ldi r28, 0x00 ; 0 1bd32: e3 cf rjmp .-58 ; 0x1bcfa 0001bd34 : } const char* lcd_display_message_fullscreen_P(const char *msg) { 1bd34: cf 93 push r28 1bd36: df 93 push r29 1bd38: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 1bd3a: 80 e0 ldi r24, 0x00 ; 0 1bd3c: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_clear(); 1bd40: 0e 94 f6 6f call 0xdfec ; 0xdfec return lcd_display_message_fullscreen_nonBlocking_P(msg); 1bd44: ce 01 movw r24, r28 } 1bd46: df 91 pop r29 1bd48: 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); 1bd4a: 0c 94 0f de jmp 0x1bc1e ; 0x1bc1e 0001bd4e : { (void)lcd_selftest(); } bool lcd_selftest() { 1bd4e: cf 92 push r12 1bd50: df 92 push r13 1bd52: ef 92 push r14 1bd54: ff 92 push r15 1bd56: 0f 93 push r16 1bd58: 1f 93 push r17 1bd5a: cf 93 push r28 1bd5c: df 93 push r29 1bd5e: 00 d0 rcall .+0 ; 0x1bd60 1bd60: 1f 92 push r1 1bd62: cd b7 in r28, 0x3d ; 61 1bd64: 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(); 1bd66: 0f 94 3d 0e call 0x21c7a ; 0x21c7a uint8_t fanSpeedBckp = fanSpeed; 1bd6a: d0 90 55 12 lds r13, 0x1255 ; 0x801255 fanSpeed = 255; 1bd6e: 8f ef ldi r24, 0xFF ; 255 1bd70: 80 93 55 12 sts 0x1255, r24 ; 0x801255 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)); 1bd74: 8d ea ldi r24, 0xAD ; 173 1bd76: e8 2e mov r14, r24 1bd78: 83 e8 ldi r24, 0x83 ; 131 1bd7a: 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()); 1bd7c: 07 ea ldi r16, 0xA7 ; 167 1bd7e: 13 e8 ldi r17, 0x83 ; 131 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)) { 1bd80: 20 e0 ldi r18, 0x00 ; 0 1bd82: 30 e0 ldi r19, 0x00 ; 0 1bd84: 48 e4 ldi r20, 0x48 ; 72 1bd86: 52 e4 ldi r21, 0x42 ; 66 1bd88: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1bd8c: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1bd90: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1bd94: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1bd98: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1bd9c: 18 16 cp r1, r24 1bd9e: 8c f0 brlt .+34 ; 0x1bdc2 1bda0: 20 e0 ldi r18, 0x00 ; 0 1bda2: 30 e0 ldi r19, 0x00 ; 0 1bda4: 48 e4 ldi r20, 0x48 ; 72 1bda6: 52 e4 ldi r21, 0x42 ; 66 1bda8: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1bdac: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1bdb0: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1bdb4: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1bdb8: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1bdbc: 18 16 cp r1, r24 1bdbe: 0c f0 brlt .+2 ; 0x1bdc2 1bdc0: 42 c0 rjmp .+132 ; 0x1be46 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1bdc2: 83 e9 ldi r24, 0x93 ; 147 1bdc4: 98 e4 ldi r25, 0x48 ; 72 1bdc6: 0e 94 0a 75 call 0xea14 ; 0xea14 1bdca: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1bdce: 42 e8 ldi r20, 0x82 ; 130 1bdd0: 64 e0 ldi r22, 0x04 ; 4 1bdd2: 80 e0 ldi r24, 0x00 ; 0 1bdd4: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1bdd8: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1bddc: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1bde0: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1bde4: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1bde8: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1bdec: 7f 93 push r23 1bdee: 6f 93 push r22 1bdf0: ff 92 push r15 1bdf2: ef 92 push r14 1bdf4: 0e 94 db 6e call 0xddb6 ; 0xddb6 lcd_putc(LCD_STR_DEGREE[0]); 1bdf8: 81 e8 ldi r24, 0x81 ; 129 1bdfa: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1bdfe: 40 e8 ldi r20, 0x80 ; 128 1be00: 64 e0 ldi r22, 0x04 ; 4 1be02: 89 e0 ldi r24, 0x09 ; 9 1be04: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1be08: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1be0c: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1be10: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1be14: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1be18: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1be1c: 7f 93 push r23 1be1e: 6f 93 push r22 1be20: 1f 93 push r17 1be22: 0f 93 push r16 1be24: 0e 94 db 6e call 0xddb6 ; 0xddb6 lcd_putc(LCD_STR_DEGREE[0]); 1be28: 81 e8 ldi r24, 0x81 ; 129 1be2a: 0e 94 f1 6e call 0xdde2 ; 0xdde2 delay_keep_alive(1000); 1be2e: 88 ee ldi r24, 0xE8 ; 232 1be30: 93 e0 ldi r25, 0x03 ; 3 1be32: 0e 94 7f 8c call 0x118fe ; 0x118fe serialecho_temperatures(); 1be36: 0e 94 a2 7a call 0xf544 ; 0xf544 1be3a: 0f b6 in r0, 0x3f ; 63 1be3c: f8 94 cli 1be3e: de bf out 0x3e, r29 ; 62 1be40: 0f be out 0x3f, r0 ; 63 1be42: cd bf out 0x3d, r28 ; 61 1be44: 9d cf rjmp .-198 ; 0x1bd80 } fanSpeed = fanSpeedBckp; 1be46: d0 92 55 12 sts 0x1255, r13 ; 0x801255 lcd_update_enable(true); 1be4a: 81 e0 ldi r24, 0x01 ; 1 1be4c: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1be50: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1be54: 86 ec ldi r24, 0xC6 ; 198 1be56: 98 e4 ldi r25, 0x48 ; 72 1be58: 0e 94 0a 75 call 0xea14 ; 0xea14 1be5c: ac 01 movw r20, r24 1be5e: 60 e0 ldi r22, 0x00 ; 0 1be60: 80 e0 ldi r24, 0x00 ; 0 1be62: 0e 94 d7 6f call 0xdfae ; 0xdfae #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif // TMC2130 FORCE_BL_ON_START; _delay(2000); 1be66: 60 ed ldi r22, 0xD0 ; 208 1be68: 77 e0 ldi r23, 0x07 ; 7 1be6a: 80 e0 ldi r24, 0x00 ; 0 1be6c: 90 e0 ldi r25, 0x00 ; 0 1be6e: 0f 94 23 0b call 0x21646 ; 0x21646 KEEPALIVE_STATE(IN_HANDLER); 1be72: 82 e0 ldi r24, 0x02 ; 2 1be74: 80 93 78 02 sts 0x0278, r24 ; 0x800278 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1be78: 00 ed ldi r16, 0xD0 ; 208 1be7a: 17 e0 ldi r17, 0x07 ; 7 1be7c: 21 e0 ldi r18, 0x01 ; 1 1be7e: 43 e0 ldi r20, 0x03 ; 3 1be80: 60 e0 ldi r22, 0x00 ; 0 1be82: 80 e0 ldi r24, 0x00 ; 0 1be84: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1be88: 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 1be8a: 83 e0 ldi r24, 0x03 ; 3 1be8c: 0e 94 7f 77 call 0xeefe ; 0xeefe } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1be90: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1be94: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 1be98: 0f 94 a5 37 call 0x26f4a ; 0x26f4a // 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]); 1be9c: 4d e2 ldi r20, 0x2D ; 45 1be9e: 62 e0 ldi r22, 0x02 ; 2 1bea0: 82 e1 ldi r24, 0x12 ; 18 1bea2: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 delay_keep_alive(1000 / sizeof(symbols)); 1bea6: 84 ef ldi r24, 0xF4 ; 244 1bea8: 91 e0 ldi r25, 0x01 ; 1 1beaa: 0e 94 7f 8c call 0x118fe ; 0x118fe // 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]); 1beae: 4c e7 ldi r20, 0x7C ; 124 1beb0: 62 e0 ldi r22, 0x02 ; 2 1beb2: 82 e1 ldi r24, 0x12 ; 18 1beb4: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 delay_keep_alive(1000 / sizeof(symbols)); 1beb8: 84 ef ldi r24, 0xF4 ; 244 1beba: 91 e0 ldi r25, 0x01 ; 1 1bebc: 0e 94 7f 8c call 0x118fe ; 0x118fe // 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]); 1bec0: 4d e2 ldi r20, 0x2D ; 45 1bec2: 62 e0 ldi r22, 0x02 ; 2 1bec4: 82 e1 ldi r24, 0x12 ; 18 1bec6: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 delay_keep_alive(1000 / sizeof(symbols)); 1beca: 84 ef ldi r24, 0xF4 ; 244 1becc: 91 e0 ldi r25, 0x01 ; 1 1bece: 0e 94 7f 8c call 0x118fe ; 0x118fe // 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]); 1bed2: 4c e7 ldi r20, 0x7C ; 124 1bed4: 62 e0 ldi r22, 0x02 ; 2 1bed6: 82 e1 ldi r24, 0x12 ; 18 1bed8: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 delay_keep_alive(1000 / sizeof(symbols)); 1bedc: 84 ef ldi r24, 0xF4 ; 244 1bede: 91 e0 ldi r25, 0x01 ; 1 1bee0: 0e 94 7f 8c call 0x118fe ; 0x118fe } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1bee4: 0f 94 56 0b call 0x216ac ; 0x216ac 1bee8: 60 93 07 17 sts 0x1707, r22 ; 0x801707 1beec: 70 93 08 17 sts 0x1708, r23 ; 0x801708 1bef0: 80 93 09 17 sts 0x1709, r24 ; 0x801709 1bef4: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a #endif fan_measuring = true; 1bef8: 81 e0 ldi r24, 0x01 ; 1 1befa: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 while(fan_measuring) { 1befe: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 1bf02: 88 23 and r24, r24 1bf04: 29 f0 breq .+10 ; 0x1bf10 delay_keep_alive(100); 1bf06: 84 e6 ldi r24, 0x64 ; 100 1bf08: 90 e0 ldi r25, 0x00 ; 0 1bf0a: 0e 94 7f 8c call 0x118fe ; 0x118fe 1bf0e: f7 cf rjmp .-18 ; 0x1befe } gcode_M123(); 1bf10: 0e 94 e5 64 call 0xc9ca ; 0xc9ca switch (_fan) { case 0: setExtruderAutoFanState(3); // hotend fan lcd_selftest_setfan(0); // print fan off lcd_selftest_measure_fans(2, 18, 2); setExtruderAutoFanState(0); // hotend fan off 1bf14: 80 e0 ldi r24, 0x00 ; 0 1bf16: 0e 94 7f 77 call 0xeefe ; 0xeefe if (fan_speed[0] < failThr) { 1bf1a: c0 90 b7 03 lds r12, 0x03B7 ; 0x8003b7 1bf1e: d0 90 b8 03 lds r13, 0x03B8 ; 0x8003b8 1bf22: 94 e1 ldi r25, 0x14 ; 20 1bf24: c9 16 cp r12, r25 1bf26: d1 04 cpc r13, r1 1bf28: 54 f1 brlt .+84 ; 0x1bf7e lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1bf2a: 00 ed ldi r16, 0xD0 ; 208 1bf2c: 17 e0 ldi r17, 0x07 ; 7 1bf2e: 21 e0 ldi r18, 0x01 ; 1 1bf30: 43 e0 ldi r20, 0x03 ; 3 1bf32: 6f 2d mov r22, r15 1bf34: 81 e0 ldi r24, 0x01 ; 1 1bf36: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1bf3a: f8 2e mov r15, r24 default: _result = false; break; } #else //defined(TACH_1) _result = lcd_selftest_manual_fan_check(1, false); 1bf3c: 60 e0 ldi r22, 0x00 ; 0 1bf3e: 80 e0 ldi r24, 0x00 ; 0 1bf40: 0f 94 8e 8e call 0x31d1c ; 0x31d1c #endif //defined(TACH_1) if (!_result) 1bf44: 81 11 cpse r24, r1 1bf46: 3a c0 rjmp .+116 ; 0x1bfbc { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning 1bf48: 4f ed ldi r20, 0xDF ; 223 1bf4a: 52 e0 ldi r21, 0x02 ; 2 1bf4c: ba 01 movw r22, r20 1bf4e: 85 e0 ldi r24, 0x05 ; 5 1bf50: 0e 94 4c d8 call 0x1b098 ; 0x1b098 } } if (_swapped_fan) { 1bf54: 86 e4 ldi r24, 0x46 ; 70 1bf56: c8 16 cp r12, r24 1bf58: d1 04 cpc r13, r1 1bf5a: bc f0 brlt .+46 ; 0x1bf8a //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1bf5c: 60 e0 ldi r22, 0x00 ; 0 1bf5e: 81 e0 ldi r24, 0x01 ; 1 1bf60: 0f 94 8e 8e call 0x31d1c ; 0x31d1c if (_result) { 1bf64: 88 23 and r24, r24 1bf66: d9 f0 breq .+54 ; 0x1bf9e //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false, true); 1bf68: 61 e0 ldi r22, 0x01 ; 1 1bf6a: 80 e0 ldi r24, 0x00 ; 0 1bf6c: 0f 94 8e 8e call 0x31d1c ; 0x31d1c if (!_result){ 1bf70: 81 11 cpse r24, r1 1bf72: 28 c0 rjmp .+80 ; 0x1bfc4 lcd_selftest_error(TestError::PrintFan, "", ""); 1bf74: 4f ed ldi r20, 0xDF ; 223 1bf76: 52 e0 ldi r21, 0x02 ; 2 1bf78: ba 01 movw r22, r20 1bf7a: 85 e0 ldi r24, 0x05 ; 5 1bf7c: 04 c0 rjmp .+8 ; 0x1bf86 #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1bf7e: 4f ed ldi r20, 0xDF ; 223 1bf80: 52 e0 ldi r21, 0x02 ; 2 1bf82: ba 01 movw r22, r20 1bf84: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1bf86: 0e 94 4c d8 call 0x1b098 ; 0x1b098 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1bf8a: 08 e8 ldi r16, 0x88 ; 136 1bf8c: 13 e1 ldi r17, 0x13 ; 19 1bf8e: 21 e0 ldi r18, 0x01 ; 1 1bf90: 43 e0 ldi r20, 0x03 ; 3 1bf92: 6f 2d mov r22, r15 1bf94: 8d e0 ldi r24, 0x0D ; 13 1bf96: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1bf9a: e1 2c mov r14, r1 1bf9c: 75 c1 rjmp .+746 ; 0x1c288 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1bf9e: 4f ed ldi r20, 0xDF ; 223 1bfa0: 52 e0 ldi r21, 0x02 ; 2 1bfa2: ba 01 movw r22, r20 1bfa4: 89 e0 ldi r24, 0x09 ; 9 1bfa6: ef cf rjmp .-34 ; 0x1bf86 #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1bfa8: 11 e0 ldi r17, 0x01 ; 1 1bfaa: 96 c0 rjmp .+300 ; 0x1c0d8 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1bfac: 88 ee ldi r24, 0xE8 ; 232 1bfae: 99 e4 ldi r25, 0x49 ; 73 1bfb0: 0e 94 0a 75 call 0xea14 ; 0xea14 1bfb4: 62 e0 ldi r22, 0x02 ; 2 1bfb6: 0e 94 1d d8 call 0x1b03a ; 0x1b03a 1bfba: 7e c1 rjmp .+764 ; 0x1c2b8 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1bfbc: 96 e4 ldi r25, 0x46 ; 70 1bfbe: c9 16 cp r12, r25 1bfc0: d1 04 cpc r13, r1 1bfc2: 64 f6 brge .-104 ; 0x1bf5c } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1bfc4: 00 ed ldi r16, 0xD0 ; 208 1bfc6: 17 e0 ldi r17, 0x07 ; 7 1bfc8: 21 e0 ldi r18, 0x01 ; 1 1bfca: 43 e0 ldi r20, 0x03 ; 3 1bfcc: 6f 2d mov r22, r15 1bfce: 82 e0 ldi r24, 0x02 ; 2 1bfd0: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1bfd4: f8 2e mov r15, r24 bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1bfd6: 1e 99 sbic 0x03, 6 ; 3 1bfd8: 04 c0 rjmp .+8 ; 0x1bfe2 { bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1bfda: 1d 99 sbic 0x03, 5 ; 3 1bfdc: 02 c0 rjmp .+4 ; 0x1bfe2 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1bfde: 1c 9b sbis 0x03, 4 ; 3 1bfe0: 48 c0 rjmp .+144 ; 0x1c072 #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) current_position[0] += 10; 1bfe2: 1e 9b sbis 0x03, 6 ; 3 1bfe4: 16 c0 rjmp .+44 ; 0x1c012 1bfe6: 20 e0 ldi r18, 0x00 ; 0 1bfe8: 30 e0 ldi r19, 0x00 ; 0 1bfea: 40 e2 ldi r20, 0x20 ; 32 1bfec: 51 e4 ldi r21, 0x41 ; 65 1bfee: 60 91 61 12 lds r22, 0x1261 ; 0x801261 1bff2: 70 91 62 12 lds r23, 0x1262 ; 0x801262 1bff6: 80 91 63 12 lds r24, 0x1263 ; 0x801263 1bffa: 90 91 64 12 lds r25, 0x1264 ; 0x801264 1bffe: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1c002: 60 93 61 12 sts 0x1261, r22 ; 0x801261 1c006: 70 93 62 12 sts 0x1262, r23 ; 0x801262 1c00a: 80 93 63 12 sts 0x1263, r24 ; 0x801263 1c00e: 90 93 64 12 sts 0x1264, r25 ; 0x801264 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10; 1c012: 1d 9b sbis 0x03, 5 ; 3 1c014: 16 c0 rjmp .+44 ; 0x1c042 1c016: 20 e0 ldi r18, 0x00 ; 0 1c018: 30 e0 ldi r19, 0x00 ; 0 1c01a: 40 e2 ldi r20, 0x20 ; 32 1c01c: 51 e4 ldi r21, 0x41 ; 65 1c01e: 60 91 65 12 lds r22, 0x1265 ; 0x801265 1c022: 70 91 66 12 lds r23, 0x1266 ; 0x801266 1c026: 80 91 67 12 lds r24, 0x1267 ; 0x801267 1c02a: 90 91 68 12 lds r25, 0x1268 ; 0x801268 1c02e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1c032: 60 93 65 12 sts 0x1265, r22 ; 0x801265 1c036: 70 93 66 12 sts 0x1266, r23 ; 0x801266 1c03a: 80 93 67 12 sts 0x1267, r24 ; 0x801267 1c03e: 90 93 68 12 sts 0x1268, r25 ; 0x801268 #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10; 1c042: 1c 9b sbis 0x03, 4 ; 3 1c044: 16 c0 rjmp .+44 ; 0x1c072 1c046: 20 e0 ldi r18, 0x00 ; 0 1c048: 30 e0 ldi r19, 0x00 ; 0 1c04a: 40 e2 ldi r20, 0x20 ; 32 1c04c: 51 e4 ldi r21, 0x41 ; 65 1c04e: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1c052: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 1c056: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1c05a: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 1c05e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1c062: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1c066: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1c06a: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1c06e: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c072: 60 e0 ldi r22, 0x00 ; 0 1c074: 70 e0 ldi r23, 0x00 ; 0 1c076: 84 e3 ldi r24, 0x34 ; 52 1c078: 92 e4 ldi r25, 0x42 ; 66 1c07a: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1c07e: 0f 94 b0 18 call 0x23160 ; 0x23160 if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1c082: 1e 99 sbic 0x03, 6 ; 3 1c084: 04 c0 rjmp .+8 ; 0x1c08e plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1c086: 1d 99 sbic 0x03, 5 ; 3 1c088: 02 c0 rjmp .+4 ; 0x1c08e ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1c08a: 1c 9b sbis 0x03, 4 ; 3 1c08c: 8d cf rjmp .-230 ; 0x1bfa8 #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; char _error[4] = ""; 1c08e: 1a 82 std Y+2, r1 ; 0x02 1c090: 19 82 std Y+1, r1 ; 0x01 1c092: 1c 82 std Y+4, r1 ; 0x04 1c094: 1b 82 std Y+3, r1 ; 0x03 #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X"); 1c096: 1e 9b sbis 0x03, 6 ; 3 1c098: 06 c0 rjmp .+12 ; 0x1c0a6 1c09a: 68 ec ldi r22, 0xC8 ; 200 1c09c: 72 e0 ldi r23, 0x02 ; 2 1c09e: ce 01 movw r24, r28 1c0a0: 01 96 adiw r24, 0x01 ; 1 1c0a2: 0f 94 e9 a9 call 0x353d2 ; 0x353d2 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y"); 1c0a6: 1d 9b sbis 0x03, 5 ; 3 1c0a8: 06 c0 rjmp .+12 ; 0x1c0b6 1c0aa: 6a ec ldi r22, 0xCA ; 202 1c0ac: 72 e0 ldi r23, 0x02 ; 2 1c0ae: ce 01 movw r24, r28 1c0b0: 01 96 adiw r24, 0x01 ; 1 1c0b2: 0f 94 e9 a9 call 0x353d2 ; 0x353d2 #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z"); 1c0b6: 1c 9b sbis 0x03, 4 ; 3 1c0b8: 06 c0 rjmp .+12 ; 0x1c0c6 1c0ba: 6c ec ldi r22, 0xCC ; 204 1c0bc: 72 e0 ldi r23, 0x02 ; 2 1c0be: ce 01 movw r24, r28 1c0c0: 01 96 adiw r24, 0x01 ; 1 1c0c2: 0f 94 e9 a9 call 0x353d2 ; 0x353d2 lcd_selftest_error(TestError::Endstops, _error, ""); 1c0c6: 4f ed ldi r20, 0xDF ; 223 1c0c8: 52 e0 ldi r21, 0x02 ; 2 1c0ca: be 01 movw r22, r28 1c0cc: 6f 5f subi r22, 0xFF ; 255 1c0ce: 7f 4f sbci r23, 0xFF ; 255 1c0d0: 82 e0 ldi r24, 0x02 ; 2 1c0d2: 0e 94 4c d8 call 0x1b098 ; 0x1b098 ((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; 1c0d6: 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(); 1c0d8: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1c0dc: 81 e0 ldi r24, 0x01 ; 1 1c0de: 0e 94 25 8a call 0x1144a ; 0x1144a { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1c0e2: 11 23 and r17, r17 1c0e4: 09 f4 brne .+2 ; 0x1c0e8 1c0e6: 51 cf rjmp .-350 ; 0x1bf8a { //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); 1c0e8: 00 ed ldi r16, 0xD0 ; 208 1c0ea: 17 e0 ldi r17, 0x07 ; 7 1c0ec: 21 e0 ldi r18, 0x01 ; 1 1c0ee: 43 e0 ldi r20, 0x03 ; 3 1c0f0: 6f 2d mov r22, r15 1c0f2: 84 e0 ldi r24, 0x04 ; 4 1c0f4: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1c0f8: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); #else _result = lcd_selfcheck_axis(X_AXIS, X_MAX_POS); 1c0fa: 6a ef ldi r22, 0xFA ; 250 1c0fc: 70 e0 ldi r23, 0x00 ; 0 1c0fe: 90 e0 ldi r25, 0x00 ; 0 1c100: 80 e0 ldi r24, 0x00 ; 0 1c102: 0e 94 33 db call 0x1b666 ; 0x1b666 } if (_result) 1c106: 88 23 and r24, r24 1c108: 09 f4 brne .+2 ; 0x1c10c 1c10a: 3f cf rjmp .-386 ; 0x1bf8a { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1c10c: 10 e0 ldi r17, 0x00 ; 0 1c10e: 00 e0 ldi r16, 0x00 ; 0 1c110: 21 e0 ldi r18, 0x01 ; 1 1c112: 43 e0 ldi r20, 0x03 ; 3 1c114: 6f 2d mov r22, r15 1c116: 84 e0 ldi r24, 0x04 ; 4 1c118: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1c11c: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(X_AXIS); 1c11e: 90 e0 ldi r25, 0x00 ; 0 1c120: 80 e0 ldi r24, 0x00 ; 0 1c122: 0e 94 30 da call 0x1b460 ; 0x1b460 #endif } if (_result) 1c126: 88 23 and r24, r24 1c128: 09 f4 brne .+2 ; 0x1c12c 1c12a: 2f cf rjmp .-418 ; 0x1bf8a { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1c12c: 0c ed ldi r16, 0xDC ; 220 1c12e: 15 e0 ldi r17, 0x05 ; 5 1c130: 21 e0 ldi r18, 0x01 ; 1 1c132: 43 e0 ldi r20, 0x03 ; 3 1c134: 6f 2d mov r22, r15 1c136: 85 e0 ldi r24, 0x05 ; 5 1c138: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1c13c: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); 1c13e: 62 ed ldi r22, 0xD2 ; 210 1c140: 70 e0 ldi r23, 0x00 ; 0 1c142: 81 e0 ldi r24, 0x01 ; 1 1c144: 90 e0 ldi r25, 0x00 ; 0 1c146: 0e 94 33 db call 0x1b666 ; 0x1b666 #endif // TMC2130 } if (_result) 1c14a: 88 23 and r24, r24 1c14c: 09 f4 brne .+2 ; 0x1c150 1c14e: 1d cf rjmp .-454 ; 0x1bf8a { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1c150: 10 e0 ldi r17, 0x00 ; 0 1c152: 00 e0 ldi r16, 0x00 ; 0 1c154: 21 e0 ldi r18, 0x01 ; 1 1c156: 43 e0 ldi r20, 0x03 ; 3 1c158: 6f 2d mov r22, r15 1c15a: 86 e0 ldi r24, 0x06 ; 6 1c15c: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1c160: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(Y_AXIS); 1c162: 81 e0 ldi r24, 0x01 ; 1 1c164: 90 e0 ldi r25, 0x00 ; 0 1c166: 0e 94 30 da call 0x1b460 ; 0x1b460 #endif // TMC2130 } if (_result) 1c16a: 88 23 and r24, r24 1c16c: 09 f4 brne .+2 ; 0x1c170 1c16e: 0d cf rjmp .-486 ; 0x1bf8a enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1c170: e0 e0 ldi r30, 0x00 ; 0 1c172: fc e9 ldi r31, 0x9C ; 156 1c174: 85 91 lpm r24, Z+ 1c176: 95 91 lpm r25, Z+ 1c178: a5 91 lpm r26, Z+ 1c17a: b4 91 lpm r27, Z 1c17c: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1c180: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1c184: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1c188: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1c18c: e4 e0 ldi r30, 0x04 ; 4 1c18e: fc e9 ldi r31, 0x9C ; 156 1c190: 85 91 lpm r24, Z+ 1c192: 95 91 lpm r25, Z+ 1c194: a5 91 lpm r26, Z+ 1c196: b4 91 lpm r27, Z 1c198: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1c19c: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1c1a0: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1c1a4: b0 93 68 12 sts 0x1268, r27 ; 0x801268 #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; #endif //TMC2130 raise_z(10); 1c1a8: 60 e0 ldi r22, 0x00 ; 0 1c1aa: 70 e0 ldi r23, 0x00 ; 0 1c1ac: 80 e2 ldi r24, 0x20 ; 32 1c1ae: 91 e4 ldi r25, 0x41 ; 65 1c1b0: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 set_destination_to_current(); 1c1b4: 0e 94 7e 66 call 0xccfc ; 0xccfc _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1c1b8: 0c ed ldi r16, 0xDC ; 220 1c1ba: 15 e0 ldi r17, 0x05 ; 5 1c1bc: 21 e0 ldi r18, 0x01 ; 1 1c1be: 43 e0 ldi r20, 0x03 ; 3 1c1c0: 6f 2d mov r22, r15 1c1c2: 86 e0 ldi r24, 0x06 ; 6 1c1c4: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1c1c8: f8 2e mov r15, r24 #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. #else _result = lcd_selfcheck_axis(Z_AXIS, Z_MAX_POS); 1c1ca: 62 ed ldi r22, 0xD2 ; 210 1c1cc: 70 e0 ldi r23, 0x00 ; 0 1c1ce: 82 e0 ldi r24, 0x02 ; 2 1c1d0: 90 e0 ldi r25, 0x00 ; 0 1c1d2: 0e 94 33 db call 0x1b666 ; 0x1b666 1c1d6: 18 2f mov r17, r24 #endif //TMC2130 //raise Z to not damage the bed during and hotend testing raise_z(20); 1c1d8: 60 e0 ldi r22, 0x00 ; 0 1c1da: 70 e0 ldi r23, 0x00 ; 0 1c1dc: 80 ea ldi r24, 0xA0 ; 160 1c1de: 91 e4 ldi r25, 0x41 ; 65 1c1e0: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1); _result = bres; } #endif //TMC2130 if (_result) 1c1e4: 11 23 and r17, r17 1c1e6: 09 f4 brne .+2 ; 0x1c1ea 1c1e8: d0 ce rjmp .-608 ; 0x1bf8a { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1c1ea: 00 ed ldi r16, 0xD0 ; 208 1c1ec: 17 e0 ldi r17, 0x07 ; 7 1c1ee: 21 e0 ldi r18, 0x01 ; 1 1c1f0: 43 e0 ldi r20, 0x03 ; 3 1c1f2: 6f 2d mov r22, r15 1c1f4: 87 e0 ldi r24, 0x07 ; 7 1c1f6: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1c1fa: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1c1fc: 81 e0 ldi r24, 0x01 ; 1 1c1fe: 0e 94 3a d9 call 0x1b274 ; 0x1b274 } if (_result) 1c202: 88 23 and r24, r24 1c204: 09 f4 brne .+2 ; 0x1c208 1c206: c1 ce rjmp .-638 ; 0x1bf8a { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1c208: 08 ee ldi r16, 0xE8 ; 232 1c20a: 13 e0 ldi r17, 0x03 ; 3 1c20c: 21 e0 ldi r18, 0x01 ; 1 1c20e: 43 e0 ldi r20, 0x03 ; 3 1c210: 6f 2d mov r22, r15 1c212: 88 e0 ldi r24, 0x08 ; 8 1c214: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1c218: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1c21a: 80 e0 ldi r24, 0x00 ; 0 1c21c: 0e 94 3a d9 call 0x1b274 ; 0x1b274 1c220: e8 2e mov r14, r24 } if (_result) 1c222: 88 23 and r24, r24 1c224: 09 f4 brne .+2 ; 0x1c228 1c226: b1 ce rjmp .-670 ; 0x1bf8a { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1c228: 00 ed ldi r16, 0xD0 ; 208 1c22a: 17 e0 ldi r17, 0x07 ; 7 1c22c: 21 e0 ldi r18, 0x01 ; 1 1c22e: 43 e0 ldi r20, 0x03 ; 3 1c230: 6f 2d mov r22, r15 1c232: 89 e0 ldi r24, 0x09 ; 9 1c234: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 } } 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 1c238: 21 e0 ldi r18, 0x01 ; 1 1c23a: 43 e0 ldi r20, 0x03 ; 3 1c23c: 68 2f mov r22, r24 1c23e: 8a e0 ldi r24, 0x0A ; 10 1c240: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 1c244: f8 2e mov r15, r24 #ifdef FILAMENT_SENSOR #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static bool lcd_selftest_fsensor(void) { fsensor.init(); 1c246: 0f 94 86 6d call 0x2db0c ; 0x2db0c if (fsensor.isError()) 1c24a: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1c24e: 83 30 cpi r24, 0x03 ; 3 1c250: 31 f4 brne .+12 ; 0x1c25e { lcd_selftest_error(TestError::WiringFsensor, "", ""); 1c252: 4f ed ldi r20, 0xDF ; 223 1c254: 52 e0 ldi r21, 0x02 ; 2 1c256: ba 01 movw r22, r20 1c258: 8a e0 ldi r24, 0x0A ; 10 1c25a: 0e 94 4c d8 call 0x1b098 ; 0x1b098 #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) 1c25e: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1c262: 83 30 cpi r24, 0x03 ; 3 1c264: 09 f4 brne .+2 ; 0x1c268 1c266: 91 ce rjmp .-734 ; 0x1bf8a { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 1c268: 00 ed ldi r16, 0xD0 ; 208 1c26a: 17 e0 ldi r17, 0x07 ; 7 1c26c: 21 e0 ldi r18, 0x01 ; 1 1c26e: 43 e0 ldi r20, 0x03 ; 3 1c270: 6f 2d mov r22, r15 1c272: 8b e0 ldi r24, 0x0B ; 11 1c274: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1c278: 08 e8 ldi r16, 0x88 ; 136 1c27a: 13 e1 ldi r17, 0x13 ; 19 1c27c: 21 e0 ldi r18, 0x01 ; 1 1c27e: 43 e0 ldi r20, 0x03 ; 3 1c280: 68 2f mov r22, r24 1c282: 8c e0 ldi r24, 0x0C ; 12 1c284: 0e 94 e9 c2 call 0x185d2 ; 0x185d2 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1c288: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 1c28c: 61 e0 ldi r22, 0x01 ; 1 1c28e: 8a e8 ldi r24, 0x8A ; 138 1c290: 98 e6 ldi r25, 0x68 ; 104 1c292: 0e 94 da 8c call 0x119b4 ; 0x119b4 lcd_update_enable(true); 1c296: 81 e0 ldi r24, 0x01 ; 1 1c298: 0e 94 08 70 call 0xe010 ; 0xe010 if (_result) 1c29c: ee 20 and r14, r14 1c29e: 09 f4 brne .+2 ; 0x1c2a2 1c2a0: 85 ce rjmp .-758 ; 0x1bfac { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1c2a2: 81 e0 ldi r24, 0x01 ; 1 1c2a4: 0e 94 3f d5 call 0x1aa7e ; 0x1aa7e lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1c2a8: 88 eb ldi r24, 0xB8 ; 184 1c2aa: 98 e4 ldi r25, 0x48 ; 72 1c2ac: 0e 94 0a 75 call 0xea14 ; 0xea14 1c2b0: 0e 94 85 dc call 0x1b90a ; 0x1b90a lcd_return_to_status(); 1c2b4: 0f 94 6d 05 call 0x20ada ; 0x20ada FORCE_HIGH_POWER_END; #endif // TMC2130 FORCE_BL_ON_END; KEEPALIVE_STATE(NOT_BUSY); 1c2b8: 81 e0 ldi r24, 0x01 ; 1 1c2ba: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(_result); } 1c2be: 8e 2d mov r24, r14 1c2c0: 0f 90 pop r0 1c2c2: 0f 90 pop r0 1c2c4: 0f 90 pop r0 1c2c6: 0f 90 pop r0 1c2c8: df 91 pop r29 1c2ca: cf 91 pop r28 1c2cc: 1f 91 pop r17 1c2ce: 0f 91 pop r16 1c2d0: ff 90 pop r15 1c2d2: ef 90 pop r14 1c2d4: df 90 pop r13 1c2d6: cf 90 pop r12 1c2d8: 08 95 ret 0001c2da : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1c2da: 0c 94 a7 de jmp 0x1bd4e ; 0x1bd4e 0001c2de : } /// @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) { 1c2de: cf 92 push r12 1c2e0: df 92 push r13 1c2e2: ef 92 push r14 1c2e4: ff 92 push r15 1c2e6: cf 93 push r28 1c2e8: 6b 01 movw r12, r22 1c2ea: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1c2ec: 82 e0 ldi r24, 0x02 ; 2 1c2ee: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1c2f2: 89 ea ldi r24, 0xA9 ; 169 1c2f4: 99 e5 ldi r25, 0x59 ; 89 1c2f6: 0e 94 0a 75 call 0xea14 ; 0xea14 1c2fa: 0e 94 85 dc call 0x1b90a ; 0x1b90a FSensorBlockRunout fsBlockRunout; 1c2fe: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1c302: 20 e0 ldi r18, 0x00 ; 0 1c304: 30 e0 ldi r19, 0x00 ; 0 1c306: 44 e3 ldi r20, 0x34 ; 52 1c308: 52 e4 ldi r21, 0x42 ; 66 1c30a: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c30e: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c312: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c316: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c31a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1c31e: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c322: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c326: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c32a: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1c32e: 6a e0 ldi r22, 0x0A ; 10 1c330: 77 e5 ldi r23, 0x57 ; 87 1c332: 8d ea ldi r24, 0xAD ; 173 1c334: 92 e4 ldi r25, 0x42 ; 66 1c336: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1c33a: 0f 94 b0 18 call 0x23160 ; 0x23160 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1c33e: 20 e0 ldi r18, 0x00 ; 0 1c340: 30 e0 ldi r19, 0x00 ; 0 1c342: 4c e0 ldi r20, 0x0C ; 12 1c344: 52 e4 ldi r21, 0x42 ; 66 1c346: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c34a: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c34e: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c352: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c356: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1c35a: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c35e: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c362: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c366: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1c36a: 69 e2 ldi r22, 0x29 ; 41 1c36c: 7c e5 ldi r23, 0x5C ; 92 1c36e: 85 e8 ldi r24, 0x85 ; 133 1c370: 91 e4 ldi r25, 0x41 ; 65 1c372: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1c376: 0f 94 b0 18 call 0x23160 ; 0x23160 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1c37a: 20 e0 ldi r18, 0x00 ; 0 1c37c: 30 e0 ldi r19, 0x00 ; 0 1c37e: a9 01 movw r20, r18 1c380: c7 01 movw r24, r14 1c382: b6 01 movw r22, r12 1c384: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1c388: 88 23 and r24, r24 1c38a: e1 f0 breq .+56 ; 0x1c3c4 { current_position[E_AXIS] += unloadLength; 1c38c: a7 01 movw r20, r14 1c38e: 96 01 movw r18, r12 1c390: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c394: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c398: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c39c: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c3a0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1c3a4: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c3a8: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c3ac: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c3b0: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1c3b4: 60 e0 ldi r22, 0x00 ; 0 1c3b6: 70 e0 ldi r23, 0x00 ; 0 1c3b8: 80 e2 ldi r24, 0x20 ; 32 1c3ba: 91 e4 ldi r25, 0x41 ; 65 1c3bc: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1c3c0: 0f 94 b0 18 call 0x23160 ; 0x23160 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1c3c4: 85 e3 ldi r24, 0x35 ; 53 1c3c6: 96 e4 ldi r25, 0x46 ; 70 1c3c8: 0e 94 0a 75 call 0xea14 ; 0xea14 1c3cc: 0e 94 9a de call 0x1bd34 ; 0x1bd34 //disable extruder steppers so filament can be removed disable_e0(); 1c3d0: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1c3d2: 64 e6 ldi r22, 0x64 ; 100 1c3d4: 70 e0 ldi r23, 0x00 ; 0 1c3d6: 80 e0 ldi r24, 0x00 ; 0 1c3d8: 90 e0 ldi r25, 0x00 ; 0 1c3da: 0f 94 23 0b call 0x21646 ; 0x21646 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1c3de: 82 e0 ldi r24, 0x02 ; 2 1c3e0: 0f 94 62 23 call 0x246c4 ; 0x246c4 1c3e4: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1c3e6: 0e 94 45 73 call 0xe68a ; 0xe68a 1c3ea: 81 11 cpse r24, r1 1c3ec: 07 c0 rjmp .+14 ; 0x1c3fc 1c3ee: c1 50 subi r28, 0x01 ; 1 1c3f0: 29 f0 breq .+10 ; 0x1c3fc delay_keep_alive(100); 1c3f2: 84 e6 ldi r24, 0x64 ; 100 1c3f4: 90 e0 ldi r25, 0x00 ; 0 1c3f6: 0e 94 7f 8c call 0x118fe ; 0x118fe 1c3fa: f5 cf rjmp .-22 ; 0x1c3e6 counterBeep++; } st_synchronize(); 1c3fc: 0f 94 b0 18 call 0x23160 ; 0x23160 while (lcd_clicked()) delay_keep_alive(100); 1c400: 0e 94 45 73 call 0xe68a ; 0xe68a 1c404: 88 23 and r24, r24 1c406: 29 f0 breq .+10 ; 0x1c412 1c408: 84 e6 ldi r24, 0x64 ; 100 1c40a: 90 e0 ldi r25, 0x00 ; 0 1c40c: 0e 94 7f 8c call 0x118fe ; 0x118fe 1c410: f7 cf rjmp .-18 ; 0x1c400 lcd_update_enable(true); 1c412: 81 e0 ldi r24, 0x01 ; 1 1c414: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_setstatuspgm(MSG_WELCOME); 1c418: 86 ee ldi r24, 0xE6 ; 230 1c41a: 9b e6 ldi r25, 0x6B ; 107 1c41c: 0e 94 85 dc call 0x1b90a ; 0x1b90a custom_message_type = CustomMsg::Status; 1c420: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d clearFilamentAction(); 1c424: 0f 94 62 09 call 0x212c4 ; 0x212c4 } 1c428: cf 91 pop r28 1c42a: ff 90 pop r15 1c42c: ef 90 pop r14 1c42e: df 90 pop r13 1c430: cf 90 pop r12 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1c432: 0d 94 3f 6d jmp 0x2da7e ; 0x2da7e 0001c436 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 1c436: cf 92 push r12 1c438: df 92 push r13 1c43a: ef 92 push r14 1c43c: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 1c43e: 80 e0 ldi r24, 0x00 ; 0 1c440: 90 e0 ldi r25, 0x00 ; 0 1c442: a8 ec ldi r26, 0xC8 ; 200 1c444: b2 e4 ldi r27, 0x42 ; 66 1c446: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1c44a: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 1c44e: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1c452: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 1c456: 65 e5 ldi r22, 0x55 ; 85 1c458: 75 e5 ldi r23, 0x55 ; 85 1c45a: 85 e5 ldi r24, 0x55 ; 85 1c45c: 91 e4 ldi r25, 0x41 ; 65 1c45e: 0f 94 0a 4a call 0x29414 ; 0x29414 delay_keep_alive(2000); 1c462: 80 ed ldi r24, 0xD0 ; 208 1c464: 97 e0 ldi r25, 0x07 ; 7 1c466: 0e 94 7f 8c call 0x118fe ; 0x118fe lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c46a: 86 e3 ldi r24, 0x36 ; 54 1c46c: 9d e3 ldi r25, 0x3D ; 61 1c46e: 0e 94 0a 75 call 0xea14 ; 0xea14 1c472: 0e 94 9a de call 0x1bd34 ; 0x1bd34 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1c476: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 1c47a: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 1c47e: 07 2e mov r0, r23 1c480: 00 0c add r0, r0 1c482: 88 0b sbc r24, r24 1c484: 99 0b sbc r25, r25 1c486: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1c48a: 9b 01 movw r18, r22 1c48c: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 1c48e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1c492: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1c496: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1c49a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1c49e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1c4a2: 9f 77 andi r25, 0x7F ; 127 1c4a4: 20 e0 ldi r18, 0x00 ; 0 1c4a6: 30 e0 ldi r19, 0x00 ; 0 1c4a8: 40 ea ldi r20, 0xA0 ; 160 1c4aa: 50 e4 ldi r21, 0x40 ; 64 1c4ac: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1c4b0: 18 16 cp r1, r24 1c4b2: b4 f5 brge .+108 ; 0x1c520 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c4b4: 86 e3 ldi r24, 0x36 ; 54 1c4b6: 9d e3 ldi r25, 0x3D ; 61 1c4b8: 0e 94 0a 75 call 0xea14 ; 0xea14 1c4bc: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_set_cursor(0, 4); 1c4c0: 64 e0 ldi r22, 0x04 ; 4 1c4c2: 80 e0 ldi r24, 0x00 ; 0 1c4c4: 0e 94 2a 6f call 0xde54 ; 0xde54 1c4c8: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 1c4cc: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 1c4d0: 07 2e mov r0, r23 1c4d2: 00 0c add r0, r0 1c4d4: 88 0b sbc r24, r24 1c4d6: 99 0b sbc r25, r25 1c4d8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__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)); 1c4dc: 20 e0 ldi r18, 0x00 ; 0 1c4de: 30 e0 ldi r19, 0x00 ; 0 1c4e0: 40 e0 ldi r20, 0x00 ; 0 1c4e2: 5f e3 ldi r21, 0x3F ; 63 1c4e4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1c4e8: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1c4ec: 6b 01 movw r12, r22 1c4ee: 20 e0 ldi r18, 0x00 ; 0 1c4f0: 30 e0 ldi r19, 0x00 ; 0 1c4f2: 40 e0 ldi r20, 0x00 ; 0 1c4f4: 5f e3 ldi r21, 0x3F ; 63 1c4f6: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1c4fa: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1c4fe: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1c502: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1c506: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1c50a: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1c50e: a6 01 movw r20, r12 1c510: 82 e8 ldi r24, 0x82 ; 130 1c512: 0f 94 27 0a call 0x2144e ; 0x2144e delay_keep_alive(1000); 1c516: 88 ee ldi r24, 0xE8 ; 232 1c518: 93 e0 ldi r25, 0x03 ; 3 1c51a: 0e 94 7f 8c call 0x118fe ; 0x118fe 1c51e: ab cf rjmp .-170 ; 0x1c476 } } 1c520: ff 90 pop r15 1c522: ef 90 pop r14 1c524: df 90 pop r13 1c526: cf 90 pop r12 1c528: 08 95 ret 0001c52a : //! @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 ) { 1c52a: 2f 92 push r2 1c52c: 3f 92 push r3 1c52e: 4f 92 push r4 1c530: 5f 92 push r5 1c532: 6f 92 push r6 1c534: 7f 92 push r7 1c536: 8f 92 push r8 1c538: 9f 92 push r9 1c53a: af 92 push r10 1c53c: bf 92 push r11 1c53e: cf 92 push r12 1c540: df 92 push r13 1c542: ef 92 push r14 1c544: ff 92 push r15 1c546: 0f 93 push r16 1c548: 1f 93 push r17 1c54a: cf 93 push r28 1c54c: df 93 push r29 1c54e: 00 d0 rcall .+0 ; 0x1c550 1c550: 00 d0 rcall .+0 ; 0x1c552 1c552: cd b7 in r28, 0x3d ; 61 1c554: de b7 in r29, 0x3e ; 62 1c556: 5c 01 movw r10, r24 1c558: 6c 83 std Y+4, r22 ; 0x04 1c55a: 34 2e mov r3, r20 1c55c: 3b 83 std Y+3, r19 ; 0x03 1c55e: 2a 83 std Y+2, r18 ; 0x02 1c560: 48 01 movw r8, r16 1c562: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 1c564: 00 97 sbiw r24, 0x00 ; 0 1c566: 09 f0 breq .+2 ; 0x1c56a 1c568: 51 c0 rjmp .+162 ; 0x1c60c 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); 1c56a: 87 01 movw r16, r14 1c56c: 22 2d mov r18, r2 1c56e: a4 01 movw r20, r8 1c570: 6a 81 ldd r22, Y+2 ; 0x02 1c572: 7b 81 ldd r23, Y+3 ; 0x03 1c574: 83 2d mov r24, r3 1c576: 0e 94 62 dd call 0x1bac4 ; 0x1bac4 1c57a: d1 2c mov r13, r1 1c57c: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 1c57e: 0f 94 56 0b call 0x216ac ; 0x216ac 1c582: 2b 01 movw r4, r22 1c584: 3c 01 movw r6, r24 lcd_consume_click(); 1c586: 0e 94 40 73 call 0xe680 ; 0xe680 KEEPALIVE_STATE(PAUSED_FOR_USER); 1c58a: 84 e0 ldi r24, 0x04 ; 4 1c58c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 1c590: de 82 std Y+6, r13 ; 0x06 1c592: cd 82 std Y+5, r12 ; 0x05 1c594: 24 e6 ldi r18, 0x64 ; 100 1c596: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 1c598: 82 e3 ldi r24, 0x32 ; 50 1c59a: 90 e0 ldi r25, 0x00 ; 0 1c59c: 0e 94 7f 8c call 0x118fe ; 0x118fe if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 1c5a0: 3c 81 ldd r19, Y+4 ; 0x04 1c5a2: 31 11 cpse r19, r1 1c5a4: 3a c0 rjmp .+116 ; 0x1c61a current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 1c5a6: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1c5aa: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1c5ae: 00 97 sbiw r24, 0x00 ; 0 1c5b0: 09 f0 breq .+2 ; 0x1c5b4 1c5b2: 42 c0 rjmp .+132 ; 0x1c638 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 1c5b4: 0e 94 45 73 call 0xe68a ; 0xe68a 1c5b8: 88 23 and r24, r24 1c5ba: 09 f4 brne .+2 ; 0x1c5be 1c5bc: 67 c0 rjmp .+206 ; 0x1c68c if (msg_next == NULL) { 1c5be: 8d 81 ldd r24, Y+5 ; 0x05 1c5c0: 9e 81 ldd r25, Y+6 ; 0x06 1c5c2: 89 2b or r24, r25 1c5c4: 09 f0 breq .+2 ; 0x1c5c8 1c5c6: 5e c0 rjmp .+188 ; 0x1c684 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 1c5c8: 82 e0 ldi r24, 0x02 ; 2 1c5ca: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // 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; 1c5ce: 91 e0 ldi r25, 0x01 ; 1 1c5d0: 90 93 5a 02 sts 0x025A, r25 ; 0x80025a lcd_draw_update = 2; 1c5d4: 80 93 59 02 sts 0x0259, r24 ; 0x800259 return current_selection; } 1c5d8: 83 2d mov r24, r3 1c5da: 26 96 adiw r28, 0x06 ; 6 1c5dc: 0f b6 in r0, 0x3f ; 63 1c5de: f8 94 cli 1c5e0: de bf out 0x3e, r29 ; 62 1c5e2: 0f be out 0x3f, r0 ; 63 1c5e4: cd bf out 0x3d, r28 ; 61 1c5e6: df 91 pop r29 1c5e8: cf 91 pop r28 1c5ea: 1f 91 pop r17 1c5ec: 0f 91 pop r16 1c5ee: ff 90 pop r15 1c5f0: ef 90 pop r14 1c5f2: df 90 pop r13 1c5f4: cf 90 pop r12 1c5f6: bf 90 pop r11 1c5f8: af 90 pop r10 1c5fa: 9f 90 pop r9 1c5fc: 8f 90 pop r8 1c5fe: 7f 90 pop r7 1c600: 6f 90 pop r6 1c602: 5f 90 pop r5 1c604: 4f 90 pop r4 1c606: 3f 90 pop r3 1c608: 2f 90 pop r2 1c60a: 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; 1c60c: 0e 94 9a de call 0x1bd34 ; 0x1bd34 1c610: 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) { 1c612: 89 2b or r24, r25 1c614: 09 f0 breq .+2 ; 0x1c618 1c616: b3 cf rjmp .-154 ; 0x1c57e 1c618: a8 cf rjmp .-176 ; 0x1c56a 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) { 1c61a: 0f 94 56 0b call 0x216ac ; 0x216ac 1c61e: 64 19 sub r22, r4 1c620: 75 09 sbc r23, r5 1c622: 86 09 sbc r24, r6 1c624: 97 09 sbc r25, r7 1c626: 61 33 cpi r22, 0x31 ; 49 1c628: 75 47 sbci r23, 0x75 ; 117 1c62a: 81 05 cpc r24, r1 1c62c: 91 05 cpc r25, r1 1c62e: 08 f4 brcc .+2 ; 0x1c632 1c630: ba cf rjmp .-140 ; 0x1c5a6 current_selection = LCD_BUTTON_TIMEOUT; 1c632: 33 24 eor r3, r3 1c634: 3a 94 dec r3 1c636: c8 cf rjmp .-112 ; 0x1c5c8 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 1c638: 2d 81 ldd r18, Y+5 ; 0x05 1c63a: 3e 81 ldd r19, Y+6 ; 0x06 1c63c: 23 2b or r18, r19 1c63e: f9 f4 brne .+62 ; 0x1c67e if (third_choice) { // third_choice is not nullptr, safe to dereference 1c640: e1 14 cp r14, r1 1c642: f1 04 cpc r15, r1 1c644: b1 f0 breq .+44 ; 0x1c672 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 1c646: 97 ff sbrs r25, 7 1c648: 0f c0 rjmp .+30 ; 0x1c668 1c64a: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 1c64c: 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); 1c64e: 87 01 movw r16, r14 1c650: 22 2d mov r18, r2 1c652: a4 01 movw r20, r8 1c654: 6a 81 ldd r22, Y+2 ; 0x02 1c656: 7b 81 ldd r23, Y+3 ; 0x03 1c658: 83 2d mov r24, r3 1c65a: 0e 94 62 dd call 0x1bac4 ; 0x1bac4 lcd_encoder = 0; 1c65e: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1c662: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e 1c666: a6 cf rjmp .-180 ; 0x1c5b4 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) { 1c668: 32 e0 ldi r19, 0x02 ; 2 1c66a: 33 16 cp r3, r19 1c66c: 81 f3 breq .-32 ; 0x1c64e // Rotating knob clockwise current_selection++; 1c66e: 33 94 inc r3 1c670: ee cf rjmp .-36 ; 0x1c64e } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 1c672: 39 2e mov r3, r25 1c674: 30 94 com r3 1c676: 33 1c adc r3, r3 1c678: 33 24 eor r3, r3 1c67a: 33 1c adc r3, r3 1c67c: e8 cf rjmp .-48 ; 0x1c64e } } 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); 1c67e: 87 e0 ldi r24, 0x07 ; 7 1c680: 0f 94 62 23 call 0x246c4 ; 0x246c4 goto exit; } else break; } } if (multi_screen) { 1c684: c1 14 cp r12, r1 1c686: d1 04 cpc r13, r1 1c688: 79 f4 brne .+30 ; 0x1c6a8 1c68a: 84 cf rjmp .-248 ; 0x1c594 1c68c: 99 81 ldd r25, Y+1 ; 0x01 1c68e: 91 50 subi r25, 0x01 ; 1 1c690: 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) { 1c692: 91 11 cpse r25, r1 1c694: 81 cf rjmp .-254 ; 0x1c598 goto exit; } else break; } } if (multi_screen) { 1c696: c1 14 cp r12, r1 1c698: d1 04 cpc r13, r1 1c69a: 61 f0 breq .+24 ; 0x1c6b4 if (msg_next == NULL) { 1c69c: 2d 81 ldd r18, Y+5 ; 0x05 1c69e: 3e 81 ldd r19, Y+6 ; 0x06 1c6a0: 23 2b or r18, r19 1c6a2: 11 f4 brne .+4 ; 0x1c6a8 1c6a4: be 82 std Y+6, r11 ; 0x06 1c6a6: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 1c6a8: 8d 81 ldd r24, Y+5 ; 0x05 1c6aa: 9e 81 ldd r25, Y+6 ; 0x06 1c6ac: 0e 94 9a de call 0x1bd34 ; 0x1bd34 1c6b0: 9e 83 std Y+6, r25 ; 0x06 1c6b2: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 1c6b4: 8d 81 ldd r24, Y+5 ; 0x05 1c6b6: 9e 81 ldd r25, Y+6 ; 0x06 1c6b8: 89 2b or r24, r25 1c6ba: 09 f0 breq .+2 ; 0x1c6be 1c6bc: 6b cf rjmp .-298 ; 0x1c594 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 1c6be: 87 01 movw r16, r14 1c6c0: 22 2d mov r18, r2 1c6c2: a4 01 movw r20, r8 1c6c4: 6a 81 ldd r22, Y+2 ; 0x02 1c6c6: 7b 81 ldd r23, Y+3 ; 0x03 1c6c8: 83 2d mov r24, r3 1c6ca: 0e 94 62 dd call 0x1bac4 ; 0x1bac4 1c6ce: 62 cf rjmp .-316 ; 0x1c594 0001c6d0 : //! @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) { 1c6d0: bf 92 push r11 1c6d2: cf 92 push r12 1c6d4: df 92 push r13 1c6d6: ef 92 push r14 1c6d8: ff 92 push r15 1c6da: 0f 93 push r16 1c6dc: 1f 93 push r17 1c6de: cf 93 push r28 1c6e0: df 93 push r29 1c6e2: ec 01 movw r28, r24 1c6e4: d6 2e mov r13, r22 1c6e6: 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); 1c6e8: 86 ed ldi r24, 0xD6 ; 214 1c6ea: 9c e3 ldi r25, 0x3C ; 60 1c6ec: 0e 94 0a 75 call 0xea14 ; 0xea14 1c6f0: 8c 01 movw r16, r24 1c6f2: 87 e2 ldi r24, 0x27 ; 39 1c6f4: 94 e4 ldi r25, 0x44 ; 68 1c6f6: 0e 94 0a 75 call 0xea14 ; 0xea14 1c6fa: 2a e0 ldi r18, 0x0A ; 10 1c6fc: c2 2e mov r12, r18 1c6fe: f1 2c mov r15, r1 1c700: e1 2c mov r14, r1 1c702: 9c 01 movw r18, r24 1c704: 4b 2d mov r20, r11 1c706: 6d 2d mov r22, r13 1c708: ce 01 movw r24, r28 1c70a: 0e 94 95 e2 call 0x1c52a ; 0x1c52a } 1c70e: df 91 pop r29 1c710: cf 91 pop r28 1c712: 1f 91 pop r17 1c714: 0f 91 pop r16 1c716: ff 90 pop r15 1c718: ef 90 pop r14 1c71a: df 90 pop r13 1c71c: cf 90 pop r12 1c71e: bf 90 pop r11 1c720: 08 95 ret 0001c722 : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1c722: 2f 92 push r2 1c724: 3f 92 push r3 1c726: 4f 92 push r4 1c728: 5f 92 push r5 1c72a: 6f 92 push r6 1c72c: 7f 92 push r7 1c72e: 8f 92 push r8 1c730: 9f 92 push r9 1c732: af 92 push r10 1c734: bf 92 push r11 1c736: cf 92 push r12 1c738: df 92 push r13 1c73a: ef 92 push r14 1c73c: ff 92 push r15 1c73e: 0f 93 push r16 1c740: 1f 93 push r17 1c742: cf 93 push r28 1c744: df 93 push r29 1c746: cd b7 in r28, 0x3d ; 61 1c748: de b7 in r29, 0x3e ; 62 1c74a: 2d 97 sbiw r28, 0x0d ; 13 1c74c: 0f b6 in r0, 0x3f ; 63 1c74e: f8 94 cli 1c750: de bf out 0x3e, r29 ; 62 1c752: 0f be out 0x3f, r0 ; 63 1c754: 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) 1c756: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1c75a: 81 30 cpi r24, 0x01 ; 1 1c75c: 51 f1 breq .+84 ; 0x1c7b2 1c75e: 30 f0 brcs .+12 ; 0x1c76c 1c760: 82 30 cpi r24, 0x02 ; 2 1c762: 09 f4 brne .+2 ; 0x1c766 1c764: 88 c2 rjmp .+1296 ; 0x1cc76 { _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. 1c766: 10 92 96 03 sts 0x0396, r1 ; 0x800396 1c76a: 04 c1 rjmp .+520 ; 0x1c974 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1c76c: 80 91 26 14 lds r24, 0x1426 ; 0x801426 1c770: 88 23 and r24, r24 1c772: 49 f0 breq .+18 ; 0x1c786 { card.presort_flag = false; 1c774: 10 92 26 14 sts 0x1426, r1 ; 0x801426 lcd_update_enabled = false; 1c778: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a card.presort(); 1c77c: 0f 94 ef 6e call 0x2ddde ; 0x2ddde lcd_update_enabled = true; 1c780: 81 e0 ldi r24, 0x01 ; 1 1c782: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } _md->fileCnt = card.getnrfilenames(); 1c786: 0f 94 20 6c call 0x2d840 ; 0x2d840 1c78a: 90 93 9e 03 sts 0x039E, r25 ; 0x80039e 1c78e: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1c792: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1c796: 81 11 cpse r24, r1 1c798: e7 c0 rjmp .+462 ; 0x1c968 1c79a: 89 e0 ldi r24, 0x09 ; 9 1c79c: 9f e0 ldi r25, 0x0F ; 15 1c79e: 0f 94 9d a3 call 0x3473a ; 0x3473a 1c7a2: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 _md->menuState = _standard; 1c7a6: 81 e0 ldi r24, 0x01 ; 1 1c7a8: 80 93 96 03 sts 0x0396, r24 ; 0x800396 _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. 1c7ac: 8f ef ldi r24, 0xFF ; 255 1c7ae: 80 93 9f 03 sts 0x039F, r24 ; 0x80039f } // 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. 1c7b2: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 1c7b6: 81 11 cpse r24, r1 1c7b8: 07 c0 rjmp .+14 ; 0x1c7c8 { _md->lcd_scrollTimer.start(); 1c7ba: 81 ea ldi r24, 0xA1 ; 161 1c7bc: 93 e0 ldi r25, 0x03 ; 3 1c7be: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> lcd_draw_update = 1; 1c7c2: 81 e0 ldi r24, 0x01 ; 1 1c7c4: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 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. 1c7c8: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1c7cc: 81 11 cpse r24, r1 1c7ce: 21 c0 rjmp .+66 ; 0x1c812 1c7d0: 64 ef ldi r22, 0xF4 ; 244 1c7d2: 71 e0 ldi r23, 0x01 ; 1 1c7d4: 81 ea ldi r24, 0xA1 ; 161 1c7d6: 93 e0 ldi r25, 0x03 ; 3 1c7d8: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 1c7dc: 88 23 and r24, r24 1c7de: a1 f0 breq .+40 ; 0x1c808 1c7e0: 80 91 9f 03 lds r24, 0x039F ; 0x80039f 1c7e4: 8f 3f cpi r24, 0xFF ; 255 1c7e6: 81 f0 breq .+32 ; 0x1c808 { _md->menuState = _scrolling; 1c7e8: 82 e0 ldi r24, 0x02 ; 2 1c7ea: 80 93 96 03 sts 0x0396, r24 ; 0x800396 _md->offset = 0; 1c7ee: 10 92 97 03 sts 0x0397, r1 ; 0x800397 _md->scrollPointer = NULL; 1c7f2: 10 92 9a 03 sts 0x039A, r1 ; 0x80039a 1c7f6: 10 92 99 03 sts 0x0399, r1 ; 0x800399 _md->lcd_scrollTimer.start(); 1c7fa: 81 ea ldi r24, 0xA1 ; 161 1c7fc: 93 e0 ldi r25, 0x03 ; 3 1c7fe: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1c802: 81 e0 ldi r24, 0x01 ; 1 1c804: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } if (lcd_draw_update == 0 && !lcd_clicked()) 1c808: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1c80c: 88 23 and r24, r24 1c80e: 09 f4 brne .+2 ; 0x1c812 1c810: ad c0 rjmp .+346 ; 0x1c96c 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. 1c812: 8f ef ldi r24, 0xFF ; 255 1c814: 80 93 9f 03 sts 0x039F, r24 ; 0x80039f //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(); 1c818: 81 ea ldi r24, 0xA1 ; 161 1c81a: 93 e0 ldi r25, 0x03 ; 3 1c81c: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> MENU_BEGIN(); 1c820: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 1c824: 10 92 60 04 sts 0x0460, r1 ; 0x800460 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); 1c828: ce 01 movw r24, r28 1c82a: 01 96 adiw r24, 0x01 ; 1 1c82c: 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); 1c82e: f7 e6 ldi r31, 0x67 ; 103 1c830: 2f 2e mov r2, r31 1c832: fc e6 ldi r31, 0x6C ; 108 1c834: 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(); 1c836: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1c83a: 84 30 cpi r24, 0x04 ; 4 1c83c: 08 f0 brcs .+2 ; 0x1c840 1c83e: 9a c0 rjmp .+308 ; 0x1c974 1c840: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 1c844: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1c848: 88 23 and r24, r24 1c84a: 09 f4 brne .+2 ; 0x1c84e 1c84c: ac c0 rjmp .+344 ; 0x1c9a6 1c84e: 8c e8 ldi r24, 0x8C ; 140 1c850: 98 e4 ldi r25, 0x48 ; 72 1c852: 0e 94 0a 75 call 0xea14 ; 0xea14 1c856: 0e 94 9e 72 call 0xe53c ; 0xe53c 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;}; FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;}; 1c85a: 69 ed ldi r22, 0xD9 ; 217 1c85c: 73 e1 ldi r23, 0x13 ; 19 1c85e: 82 e8 ldi r24, 0x82 ; 130 1c860: 94 e1 ldi r25, 0x14 ; 20 1c862: 0f 94 7b 2c call 0x258f6 ; 0x258f6 card.getWorkDirName(); if (card.filename[0] == '/') 1c866: 80 91 d9 13 lds r24, 0x13D9 ; 0x8013d9 1c86a: 8f 32 cpi r24, 0x2F ; 47 1c86c: 09 f0 breq .+2 ; 0x1c870 1c86e: 9e c0 rjmp .+316 ; 0x1c9ac { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1c870: 80 91 48 16 lds r24, 0x1648 ; 0x801648 1c874: 88 23 and r24, r24 1c876: 41 f0 breq .+16 ; 0x1c888 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1c878: 81 e8 ldi r24, 0x81 ; 129 1c87a: 98 e4 ldi r25, 0x48 ; 72 1c87c: 0e 94 0a 75 call 0xea14 ; 0xea14 1c880: 6e e4 ldi r22, 0x4E ; 78 1c882: 7d ec ldi r23, 0xCD ; 205 #endif } else MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); //Show the updir button if in a subdir. 1c884: 0e 94 6d 72 call 0xe4da ; 0xe4da for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1c888: c0 90 9d 03 lds r12, 0x039D ; 0x80039d 1c88c: d0 90 9e 03 lds r13, 0x039E ; 0x80039e } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1c890: 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. 1c892: 91 e0 ldi r25, 0x01 ; 1 1c894: c9 1a sub r12, r25 1c896: d1 08 sbc r13, r1 1c898: 08 f4 brcc .+2 ; 0x1c89c 1c89a: e0 c1 rjmp .+960 ; 0x1cc5c { if (menu_item == menu_line) //If the file is on the screen. 1c89c: 80 91 63 04 lds r24, 0x0463 ; 0x800463 1c8a0: 90 91 62 04 lds r25, 0x0462 ; 0x800462 1c8a4: 89 13 cpse r24, r25 1c8a6: d6 c1 rjmp .+940 ; 0x1cc54 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1c8a8: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 1c8ac: c6 01 movw r24, r12 1c8ae: 0f 94 66 77 call 0x2eecc ; 0x2eecc #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1c8b2: 80 91 63 04 lds r24, 0x0463 ; 0x800463 1c8b6: 90 e0 ldi r25, 0x00 ; 0 1c8b8: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1c8bc: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1c8c0: 10 91 23 14 lds r17, 0x1423 ; 0x801423 1c8c4: 82 17 cp r24, r18 1c8c6: 93 07 cpc r25, r19 1c8c8: 51 f4 brne .+20 ; 0x1c8de { _md->selectedFileID = i; 1c8ca: d0 92 9c 03 sts 0x039C, r13 ; 0x80039c 1c8ce: c0 92 9b 03 sts 0x039B, r12 ; 0x80039b _md->isDir = card.filenameIsDir; 1c8d2: 10 93 98 03 sts 0x0398, r17 ; 0x800398 _md->row = menu_row; 1c8d6: 40 91 60 04 lds r20, 0x0460 ; 0x800460 1c8da: 40 93 9f 03 sts 0x039F, r20 ; 0x80039f 1c8de: 40 91 59 02 lds r20, 0x0259 ; 0x800259 } if (card.filenameIsDir) 1c8e2: 11 23 and r17, r17 1c8e4: 09 f4 brne .+2 ; 0x1c8e8 1c8e6: 67 c0 rjmp .+206 ; 0x1c9b6 #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) 1c8e8: 44 23 and r20, r20 1c8ea: e9 f0 breq .+58 ; 0x1c926 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1c8ec: 40 91 ee 13 lds r20, 0x13EE ; 0x8013ee 1c8f0: e9 ed ldi r30, 0xD9 ; 217 1c8f2: ae 2e mov r10, r30 1c8f4: e3 e1 ldi r30, 0x13 ; 19 1c8f6: be 2e mov r11, r30 1c8f8: 44 23 and r20, r20 1c8fa: 21 f0 breq .+8 ; 0x1c904 1c8fc: 7e ee ldi r23, 0xEE ; 238 1c8fe: a7 2e mov r10, r23 1c900: 73 e1 ldi r23, 0x13 ; 19 1c902: b7 2e mov r11, r23 1c904: 60 91 60 04 lds r22, 0x0460 ; 0x800460 } 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)?'>':' '); 1c908: 4e e3 ldi r20, 0x3E ; 62 1c90a: 82 17 cp r24, r18 1c90c: 93 07 cpc r25, r19 1c90e: 09 f0 breq .+2 ; 0x1c912 1c910: 40 e2 ldi r20, 0x20 ; 32 1c912: 80 e0 ldi r24, 0x00 ; 0 1c914: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_putc(LCD_STR_FOLDER[0]); 1c918: 85 e8 ldi r24, 0x85 ; 133 1c91a: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_print_pad(longFilename, len); 1c91e: 62 e1 ldi r22, 0x12 ; 18 1c920: c5 01 movw r24, r10 1c922: 0e 94 17 73 call 0xe62e ; 0xe62e 1c926: 80 91 63 04 lds r24, 0x0463 ; 0x800463 { 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)) 1c92a: 90 91 61 04 lds r25, 0x0461 ; 0x800461 1c92e: 99 23 and r25, r25 1c930: 09 f4 brne .+2 ; 0x1c934 1c932: 90 c1 rjmp .+800 ; 0x1cc54 1c934: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1c938: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1c93c: 82 17 cp r24, r18 1c93e: 13 06 cpc r1, r19 1c940: 09 f0 breq .+2 ; 0x1c944 1c942: 88 c1 rjmp .+784 ; 0x1cc54 { lcd_update_enabled = false; 1c944: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1c948: 61 e0 ldi r22, 0x01 ; 1 1c94a: 89 ed ldi r24, 0xD9 ; 217 1c94c: 93 e1 ldi r25, 0x13 ; 19 1c94e: 0f 94 79 70 call 0x2e0f2 ; 0x2e0f2 lcd_encoder = 0; 1c952: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1c956: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 1c95a: 0e 94 7f 62 call 0xc4fe ; 0xc4fe } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1c95e: 00 93 5a 02 sts 0x025A, r16 ; 0x80025a menu_item_ret(); 1c962: 0e 94 43 62 call 0xc486 ; 0xc486 1c966: 95 cf rjmp .-214 ; 0x1c892 lcd_update_enabled = false; card.presort(); lcd_update_enabled = true; } _md->fileCnt = card.getnrfilenames(); _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1c968: 82 e0 ldi r24, 0x02 ; 2 1c96a: 1b cf rjmp .-458 ; 0x1c7a2 _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()) 1c96c: 0e 94 45 73 call 0xe68a ; 0xe68a 1c970: 81 11 cpse r24, r1 1c972: 4f cf rjmp .-354 ; 0x1c812 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1c974: 2d 96 adiw r28, 0x0d ; 13 1c976: 0f b6 in r0, 0x3f ; 63 1c978: f8 94 cli 1c97a: de bf out 0x3e, r29 ; 62 1c97c: 0f be out 0x3f, r0 ; 63 1c97e: cd bf out 0x3d, r28 ; 61 1c980: df 91 pop r29 1c982: cf 91 pop r28 1c984: 1f 91 pop r17 1c986: 0f 91 pop r16 1c988: ff 90 pop r15 1c98a: ef 90 pop r14 1c98c: df 90 pop r13 1c98e: cf 90 pop r12 1c990: bf 90 pop r11 1c992: af 90 pop r10 1c994: 9f 90 pop r9 1c996: 8f 90 pop r8 1c998: 7f 90 pop r7 1c99a: 6f 90 pop r6 1c99c: 5f 90 pop r5 1c99e: 4f 90 pop r4 1c9a0: 3f 90 pop r3 1c9a2: 2f 90 pop r2 1c9a4: 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 1c9a6: 85 e9 ldi r24, 0x95 ; 149 1c9a8: 9a e4 ldi r25, 0x4A ; 74 1c9aa: 53 cf rjmp .-346 ; 0x1c852 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. 1c9ac: 68 e5 ldi r22, 0x58 ; 88 1c9ae: 7d ec ldi r23, 0xCD ; 205 1c9b0: 83 ea ldi r24, 0xA3 ; 163 1c9b2: 93 e8 ldi r25, 0x83 ; 131 1c9b4: 67 cf rjmp .-306 ; 0x1c884 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1c9b6: 44 23 and r20, r20 1c9b8: d1 f0 breq .+52 ; 0x1c9ee { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1c9ba: 40 91 ee 13 lds r20, 0x13EE ; 0x8013ee 1c9be: 69 ed ldi r22, 0xD9 ; 217 1c9c0: a6 2e mov r10, r22 1c9c2: 63 e1 ldi r22, 0x13 ; 19 1c9c4: b6 2e mov r11, r22 1c9c6: 44 23 and r20, r20 1c9c8: 21 f0 breq .+8 ; 0x1c9d2 1c9ca: 5e ee ldi r21, 0xEE ; 238 1c9cc: a5 2e mov r10, r21 1c9ce: 53 e1 ldi r21, 0x13 ; 19 1c9d0: b5 2e mov r11, r21 1c9d2: 60 91 60 04 lds r22, 0x0460 ; 0x800460 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)?'>':' '); 1c9d6: 4e e3 ldi r20, 0x3E ; 62 1c9d8: 82 17 cp r24, r18 1c9da: 93 07 cpc r25, r19 1c9dc: 09 f0 breq .+2 ; 0x1c9e0 1c9de: 40 e2 ldi r20, 0x20 ; 32 1c9e0: 80 e0 ldi r24, 0x00 ; 0 1c9e2: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_print_pad(longFilename, len); 1c9e6: 63 e1 ldi r22, 0x13 ; 19 1c9e8: c5 01 movw r24, r10 1c9ea: 0e 94 17 73 call 0xe62e ; 0xe62e 1c9ee: 80 91 63 04 lds r24, 0x0463 ; 0x800463 { 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)) 1c9f2: 90 91 61 04 lds r25, 0x0461 ; 0x800461 1c9f6: 99 23 and r25, r25 1c9f8: 09 f4 brne .+2 ; 0x1c9fc 1c9fa: 2c c1 rjmp .+600 ; 0x1cc54 1c9fc: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1ca00: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1ca04: 82 17 cp r24, r18 1ca06: 13 06 cpc r1, r19 1ca08: 09 f0 breq .+2 ; 0x1ca0c 1ca0a: 24 c1 rjmp .+584 ; 0x1cc54 { lcd_update_enabled = false; 1ca0c: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1ca10: 80 91 94 03 lds r24, 0x0394 ; 0x800394 1ca14: 81 11 cpse r24, r1 1ca16: a3 cf rjmp .-186 ; 0x1c95e // 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); 1ca18: 69 ed ldi r22, 0xD9 ; 217 1ca1a: 73 e1 ldi r23, 0x13 ; 19 1ca1c: c7 01 movw r24, r14 1ca1e: 0f 94 08 aa call 0x35410 ; 0x35410 1ca22: 47 01 movw r8, r14 1ca24: 45 e9 ldi r20, 0x95 ; 149 1ca26: a4 2e mov r10, r20 1ca28: 4f e0 ldi r20, 0x0F ; 15 1ca2a: 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] == '.') { 1ca2c: f4 01 movw r30, r8 1ca2e: 61 91 ld r22, Z+ 1ca30: 4f 01 movw r8, r30 1ca32: 66 23 and r22, r22 1ca34: 19 f0 breq .+6 ; 0x1ca3c 1ca36: 6e 32 cpi r22, 0x2E ; 46 1ca38: 09 f0 breq .+2 ; 0x1ca3c 1ca3a: 4b c0 rjmp .+150 ; 0x1cad2 1ca3c: 60 e0 ldi r22, 0x00 ; 0 1ca3e: c5 01 movw r24, r10 1ca40: 0f 94 c1 a3 call 0x34782 ; 0x34782 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, '.'); 1ca44: 6e e2 ldi r22, 0x2E ; 46 1ca46: 70 e0 ldi r23, 0x00 ; 0 1ca48: c7 01 movw r24, r14 1ca4a: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 1ca4e: 3c 01 movw r6, r24 if (extension_ptr) { 1ca50: 89 2b or r24, r25 1ca52: 19 f0 breq .+6 ; 0x1ca5a extension_ptr++; // skip the '.' 1ca54: 8f ef ldi r24, 0xFF ; 255 1ca56: 68 1a sub r6, r24 1ca58: 78 0a sbc r7, r24 1ca5a: 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); 1ca5c: 31 e9 ldi r19, 0x91 ; 145 1ca5e: a3 2e mov r10, r19 1ca60: 3c e0 ldi r19, 0x0C ; 12 1ca62: 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') { 1ca64: 61 14 cp r6, r1 1ca66: 71 04 cpc r7, r1 1ca68: 21 f0 breq .+8 ; 0x1ca72 1ca6a: f4 01 movw r30, r8 1ca6c: 60 81 ld r22, Z 1ca6e: 61 11 cpse r22, r1 1ca70: 01 c0 rjmp .+2 ; 0x1ca74 1ca72: 60 e0 ldi r22, 0x00 ; 0 1ca74: c5 01 movw r24, r10 1ca76: 0f 94 c1 a3 call 0x34782 ; 0x34782 1ca7a: ff ef ldi r31, 0xFF ; 255 1ca7c: af 1a sub r10, r31 1ca7e: bf 0a sbc r11, r31 1ca80: 2f ef ldi r18, 0xFF ; 255 1ca82: 82 1a sub r8, r18 1ca84: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1ca86: 84 e9 ldi r24, 0x94 ; 148 1ca88: a8 16 cp r10, r24 1ca8a: 8c e0 ldi r24, 0x0C ; 12 1ca8c: b8 06 cpc r11, r24 1ca8e: 51 f7 brne .-44 ; 0x1ca64 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1ca90: 60 90 77 15 lds r6, 0x1577 ; 0x801577 1ca94: 66 2d mov r22, r6 1ca96: 8a e5 ldi r24, 0x5A ; 90 1ca98: 9f e0 ldi r25, 0x0F ; 15 1ca9a: 0f 94 c1 a3 call 0x34782 ; 0x34782 1ca9e: 85 ed ldi r24, 0xD5 ; 213 1caa0: 93 e1 ldi r25, 0x13 ; 19 1caa2: 2a e0 ldi r18, 0x0A ; 10 1caa4: a2 2e mov r10, r18 1caa6: 2f e0 ldi r18, 0x0F ; 15 1caa8: 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++) { 1caaa: 71 2c mov r7, r1 1caac: 4c 01 movw r8, r24 1caae: e9 e0 ldi r30, 0x09 ; 9 1cab0: 8e 0e add r8, r30 1cab2: 91 1c adc r9, r1 1cab4: 76 14 cp r7, r6 1cab6: d1 f0 breq .+52 ; 0x1caec #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); 1cab8: 48 e0 ldi r20, 0x08 ; 8 1caba: 50 e0 ldi r21, 0x00 ; 0 1cabc: b5 01 movw r22, r10 1cabe: 8e 5a subi r24, 0xAE ; 174 1cac0: 9f 4f sbci r25, 0xFF ; 255 1cac2: 0f 94 b1 a3 call 0x34762 ; 0x34762 1cac6: 73 94 inc r7 1cac8: f8 e0 ldi r31, 0x08 ; 8 1caca: af 0e add r10, r31 1cacc: b1 1c adc r11, r1 1cace: c4 01 movw r24, r8 1cad0: ed cf rjmp .-38 ; 0x1caac if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1cad2: c5 01 movw r24, r10 1cad4: 0f 94 c1 a3 call 0x34782 ; 0x34782 1cad8: ff ef ldi r31, 0xFF ; 255 1cada: af 1a sub r10, r31 1cadc: 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++) { 1cade: 2d e9 ldi r18, 0x9D ; 157 1cae0: a2 16 cp r10, r18 1cae2: 2f e0 ldi r18, 0x0F ; 15 1cae4: b2 06 cpc r11, r18 1cae6: 09 f0 breq .+2 ; 0x1caea 1cae8: a1 cf rjmp .-190 ; 0x1ca2c 1caea: ac cf rjmp .-168 ; 0x1ca44 /** End of menus **/ /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; 1caec: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1caf0: 88 23 and r24, r24 1caf2: 91 f0 breq .+36 ; 0x1cb18 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); 1caf4: ff 92 push r15 1caf6: ef 92 push r14 1caf8: 3f 92 push r3 1cafa: 2f 92 push r2 1cafc: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommand_P(MSG_M24); 1cb00: 61 e0 ldi r22, 0x01 ; 1 1cb02: 83 e6 ldi r24, 0x63 ; 99 1cb04: 9c e6 ldi r25, 0x6C ; 108 1cb06: 0e 94 da 8c call 0x119b4 ; 0x119b4 1cb0a: 0f 90 pop r0 1cb0c: 0f 90 pop r0 1cb0e: 0f 90 pop r0 1cb10: 0f 90 pop r0 } lcd_return_to_status(); 1cb12: 0f 94 6d 05 call 0x20ada ; 0x20ada 1cb16: 23 cf rjmp .-442 ; 0x1c95e /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1cb18: 61 e0 ldi r22, 0x01 ; 1 1cb1a: c7 01 movw r24, r14 1cb1c: 0f 94 b0 71 call 0x2e360 ; 0x2e360 } uint32_t CardReader::getFileSize() { return filesize; 1cb20: 40 90 e4 16 lds r4, 0x16E4 ; 0x8016e4 1cb24: 50 90 e5 16 lds r5, 0x16E5 ; 0x8016e5 1cb28: 60 90 e6 16 lds r6, 0x16E6 ; 0x8016e6 1cb2c: 70 90 e7 16 lds r7, 0x16E7 ; 0x8016e7 bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 1cb30: 94 2d mov r25, r4 1cb32: 85 2d mov r24, r5 1cb34: 21 e0 ldi r18, 0x01 ; 1 1cb36: 42 16 cp r4, r18 1cb38: 28 e7 ldi r18, 0x78 ; 120 1cb3a: 52 06 cpc r5, r18 1cb3c: 61 04 cpc r6, r1 1cb3e: 71 04 cpc r7, r1 1cb40: 10 f0 brcs .+4 ; 0x1cb46 1cb42: 90 e0 ldi r25, 0x00 ; 0 1cb44: 88 e7 ldi r24, 0x78 ; 120 1cb46: a9 2e mov r10, r25 1cb48: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1cb4a: 81 e0 ldi r24, 0x01 ; 1 1cb4c: 48 16 cp r4, r24 1cb4e: 88 e7 ldi r24, 0x78 ; 120 1cb50: 58 06 cpc r5, r24 1cb52: 61 04 cpc r6, r1 1cb54: 71 04 cpc r7, r1 1cb56: 08 f4 brcc .+2 ; 0x1cb5a 1cb58: 5d c0 rjmp .+186 ; 0x1cc14 startPos = filesize - END_FILE_SECTION; 1cb5a: 98 e7 ldi r25, 0x78 ; 120 1cb5c: 59 1a sub r5, r25 1cb5e: 61 08 sbc r6, r1 1cb60: 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);}; 1cb62: 40 92 eb 16 sts 0x16EB, r4 ; 0x8016eb 1cb66: 50 92 ec 16 sts 0x16EC, r5 ; 0x8016ec 1cb6a: 60 92 ed 16 sts 0x16ED, r6 ; 0x8016ed 1cb6e: 70 92 ee 16 sts 0x16EE, r7 ; 0x8016ee 1cb72: c3 01 movw r24, r6 1cb74: b2 01 movw r22, r4 1cb76: 0f 94 e8 67 call 0x2cfd0 ; 0x2cfd0 card.setIndex(startPos); } cmdqueue_reset(); 1cb7a: 0e 94 34 83 call 0x10668 ; 0x10668 cmdqueue_serial_disabled = true; 1cb7e: 00 93 93 03 sts 0x0393, r16 ; 0x800393 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1cb82: 8e e5 ldi r24, 0x5E ; 94 1cb84: 98 e4 ldi r25, 0x48 ; 72 1cb86: 0e 94 0a 75 call 0xea14 ; 0xea14 1cb8a: bc 01 movw r22, r24 1cb8c: c5 01 movw r24, r10 1cb8e: 0e 94 e1 71 call 0xe3c2 ; 0xe3c2 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; } 1cb92: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 1cb96: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 1cb9a: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 1cb9e: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee while (!card.eof() && !result) { 1cba2: 40 91 e4 16 lds r20, 0x16E4 ; 0x8016e4 1cba6: 50 91 e5 16 lds r21, 0x16E5 ; 0x8016e5 1cbaa: 60 91 e6 16 lds r22, 0x16E6 ; 0x8016e6 1cbae: 70 91 e7 16 lds r23, 0x16E7 ; 0x8016e7 1cbb2: 84 17 cp r24, r20 1cbb4: 95 07 cpc r25, r21 1cbb6: a6 07 cpc r26, r22 1cbb8: b7 07 cpc r27, r23 1cbba: 80 f5 brcc .+96 ; 0x1cc1c 1cbbc: 11 11 cpse r17, r1 1cbbe: 2e c0 rjmp .+92 ; 0x1cc1c 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); }; 1cbc0: 20 91 6a 16 lds r18, 0x166A ; 0x80166a 1cbc4: 21 11 cpse r18, r1 1cbc6: 03 c0 rjmp .+6 ; 0x1cbce 1cbc8: 80 e0 ldi r24, 0x00 ; 0 1cbca: 90 e0 ldi r25, 0x00 ; 0 1cbcc: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1cbce: 84 19 sub r24, r4 1cbd0: 95 09 sbc r25, r5 1cbd2: 0e 94 17 71 call 0xe22e ; 0xe22e card.sdprinting = true; 1cbd6: 00 93 d7 13 sts 0x13D7, r16 ; 0x8013d7 get_command(); 1cbda: 0e 94 96 85 call 0x10b2c ; 0x10b2c #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1cbde: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1cbe2: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1cbe6: 89 2b or r24, r25 1cbe8: a1 f2 breq .-88 ; 0x1cb92 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1cbea: 8a e8 ldi r24, 0x8A ; 138 1cbec: 98 e6 ldi r25, 0x68 ; 104 1cbee: 0f 94 eb 39 call 0x273d6 ; 0x273d6 1cbf2: 81 11 cpse r24, r1 1cbf4: 05 c0 rjmp .+10 ; 0x1cc00 1cbf6: 8e e9 ldi r24, 0x9E ; 158 1cbf8: 93 e8 ldi r25, 0x83 ; 131 1cbfa: 0f 94 eb 39 call 0x273d6 ; 0x273d6 1cbfe: 81 11 cpse r24, r1 1cc00: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1cc02: 80 91 53 12 lds r24, 0x1253 ; 0x801253 1cc06: 81 11 cpse r24, r1 1cc08: 02 c0 rjmp .+4 ; 0x1cc0e cmdqueue_pop_front(); 1cc0a: 0e 94 13 79 call 0xf226 ; 0xf226 cmdbuffer_front_already_processed = false; 1cc0e: 10 92 53 12 sts 0x1253, r1 ; 0x801253 1cc12: e5 cf rjmp .-54 ; 0x1cbde 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; 1cc14: 41 2c mov r4, r1 1cc16: 51 2c mov r5, r1 1cc18: 32 01 movw r6, r4 1cc1a: af cf rjmp .-162 ; 0x1cb7a // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1cc1c: 0e 94 38 71 call 0xe270 ; 0xe270 cmdqueue_serial_disabled = false; 1cc20: 10 92 93 03 sts 0x0393, r1 ; 0x800393 card.printingHasFinished(); 1cc24: 0f 94 e8 72 call 0x2e5d0 ; 0x2e5d0 lcd_setstatuspgm(MSG_WELCOME); 1cc28: 86 ee ldi r24, 0xE6 ; 230 1cc2a: 9b e6 ldi r25, 0x6B ; 107 1cc2c: 0e 94 85 dc call 0x1b90a ; 0x1b90a 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)) { 1cc30: 11 11 cpse r17, r1 1cc32: 60 cf rjmp .-320 ; 0x1caf4 result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 1cc34: 8e e6 ldi r24, 0x6E ; 110 1cc36: 98 e4 ldi r25, 0x48 ; 72 1cc38: 0e 94 0a 75 call 0xea14 ; 0xea14 1cc3c: 41 e0 ldi r20, 0x01 ; 1 1cc3e: 60 e0 ldi r22, 0x00 ; 0 1cc40: 0e 94 68 e3 call 0x1c6d0 ; 0x1c6d0 1cc44: 18 2f mov r17, r24 lcd_update_enable(true); 1cc46: 81 e0 ldi r24, 0x01 ; 1 1cc48: 0e 94 08 70 call 0xe010 ; 0xe010 } if (result) { 1cc4c: 11 23 and r17, r17 1cc4e: 09 f4 brne .+2 ; 0x1cc52 1cc50: 51 cf rjmp .-350 ; 0x1caf4 1cc52: 5f cf rjmp .-322 ; 0x1cb12 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1cc54: 8f 5f subi r24, 0xFF ; 255 1cc56: 80 93 63 04 sts 0x0463, r24 ; 0x800463 1cc5a: 1b ce rjmp .-970 ; 0x1c892 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1cc5c: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 _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(); 1cc60: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1cc64: 8f 5f subi r24, 0xFF ; 255 1cc66: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1cc6a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1cc6e: 8f 5f subi r24, 0xFF ; 255 1cc70: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1cc74: e0 cd rjmp .-1088 ; 0x1c836 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. 1cc76: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1cc7a: 11 e0 ldi r17, 0x01 ; 1 1cc7c: 81 11 cpse r24, r1 1cc7e: 05 c0 rjmp .+10 ; 0x1cc8a 1cc80: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1cc84: 81 11 cpse r24, r1 1cc86: 01 c0 rjmp .+2 ; 0x1cc8a 1cc88: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1cc8a: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1cc8e: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1cc92: 89 2b or r24, r25 1cc94: 91 f4 brne .+36 ; 0x1ccba { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1cc96: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 1cc9a: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1cc9e: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1cca2: 0f 94 66 77 call 0x2eecc ; 0x2eecc #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1cca6: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 1ccaa: 81 11 cpse r24, r1 1ccac: 46 c0 rjmp .+140 ; 0x1cd3a 1ccae: 89 ed ldi r24, 0xD9 ; 217 1ccb0: 93 e1 ldi r25, 0x13 ; 19 1ccb2: 90 93 9a 03 sts 0x039A, r25 ; 0x80039a 1ccb6: 80 93 99 03 sts 0x0399, r24 ; 0x800399 } if (rewindFlag) 1ccba: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1ccbc: 10 92 97 03 sts 0x0397, r1 ; 0x800397 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1ccc0: 6c e2 ldi r22, 0x2C ; 44 1ccc2: 71 e0 ldi r23, 0x01 ; 1 1ccc4: 81 ea ldi r24, 0xA1 ; 161 1ccc6: 93 e0 ldi r25, 0x03 ; 3 1ccc8: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 1cccc: 81 11 cpse r24, r1 1ccce: 03 c0 rjmp .+6 ; 0x1ccd6 1ccd0: 11 23 and r17, r17 1ccd2: 09 f4 brne .+2 ; 0x1ccd6 1ccd4: 4f ce rjmp .-866 ; 0x1c974 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1ccd6: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1ccda: 02 e1 ldi r16, 0x12 ; 18 1ccdc: 81 11 cpse r24, r1 1ccde: 01 c0 rjmp .+2 ; 0x1cce2 1cce0: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1cce2: 4e e3 ldi r20, 0x3E ; 62 1cce4: 60 91 9f 03 lds r22, 0x039F ; 0x80039f 1cce8: 80 e0 ldi r24, 0x00 ; 0 1ccea: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 if (_md->isDir) 1ccee: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1ccf2: 88 23 and r24, r24 1ccf4: 19 f0 breq .+6 ; 0x1ccfc 1ccf6: 85 e8 ldi r24, 0x85 ; 133 1ccf8: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1ccfc: 20 91 97 03 lds r18, 0x0397 ; 0x800397 1cd00: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1cd04: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1cd08: 60 2f mov r22, r16 1cd0a: 82 0f add r24, r18 1cd0c: 91 1d adc r25, r1 1cd0e: 0e 94 17 73 call 0xe62e ; 0xe62e 1cd12: 81 11 cpse r24, r1 1cd14: 15 c0 rjmp .+42 ; 0x1cd40 { _md->lcd_scrollTimer.start(); 1cd16: 81 ea ldi r24, 0xA1 ; 161 1cd18: 93 e0 ldi r25, 0x03 ; 3 1cd1a: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> _md->offset++; 1cd1e: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1cd22: 8f 5f subi r24, 0xFF ; 255 1cd24: 80 93 97 03 sts 0x0397, r24 ; 0x800397 } else { // stop at the end of the string _md->lcd_scrollTimer.stop(); } } if (rewindFlag) //go back to sd_menu. 1cd28: 11 23 and r17, r17 1cd2a: 09 f4 brne .+2 ; 0x1cd2e 1cd2c: 23 ce rjmp .-954 ; 0x1c974 1cd2e: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1cd32: 81 e0 ldi r24, 0x01 ; 1 1cd34: 80 93 96 03 sts 0x0396, r24 ; 0x800396 1cd38: 1d ce rjmp .-966 ; 0x1c974 #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; 1cd3a: 8e ee ldi r24, 0xEE ; 238 1cd3c: 93 e1 ldi r25, 0x13 ; 19 1cd3e: b9 cf rjmp .-142 ; 0x1ccb2 1cd40: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 1cd44: f1 cf rjmp .-30 ; 0x1cd28 0001cd46 : //! @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) { 1cd46: bf 92 push r11 1cd48: cf 92 push r12 1cd4a: df 92 push r13 1cd4c: ef 92 push r14 1cd4e: ff 92 push r15 1cd50: 0f 93 push r16 1cd52: 1f 93 push r17 1cd54: cf 93 push r28 1cd56: df 93 push r29 1cd58: ec 01 movw r28, r24 1cd5a: d6 2e mov r13, r22 1cd5c: 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); 1cd5e: 8c e4 ldi r24, 0x4C ; 76 1cd60: 98 e4 ldi r25, 0x48 ; 72 1cd62: 0e 94 0a 75 call 0xea14 ; 0xea14 1cd66: 8c 01 movw r16, r24 1cd68: 86 e4 ldi r24, 0x46 ; 70 1cd6a: 98 e4 ldi r25, 0x48 ; 72 1cd6c: 0e 94 0a 75 call 0xea14 ; 0xea14 1cd70: 2a e0 ldi r18, 0x0A ; 10 1cd72: c2 2e mov r12, r18 1cd74: f1 2c mov r15, r1 1cd76: e1 2c mov r14, r1 1cd78: 9c 01 movw r18, r24 1cd7a: 4b 2d mov r20, r11 1cd7c: 6d 2d mov r22, r13 1cd7e: ce 01 movw r24, r28 1cd80: 0e 94 95 e2 call 0x1c52a ; 0x1c52a } 1cd84: df 91 pop r29 1cd86: cf 91 pop r28 1cd88: 1f 91 pop r17 1cd8a: 0f 91 pop r16 1cd8c: ff 90 pop r15 1cd8e: ef 90 pop r14 1cd90: df 90 pop r13 1cd92: cf 90 pop r12 1cd94: bf 90 pop r11 1cd96: 08 95 ret 0001cd98 : crashdet_use_eeprom_setting(); } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) 1cd98: cf 93 push r28 1cd9a: c8 2f mov r28, r24 { if (!lang_select(lang)) { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 1cd9c: 8b e8 ldi r24, 0x8B ; 139 1cd9e: 9b e4 ldi r25, 0x4B ; 75 1cda0: 0e 94 0a 75 call 0xea14 ; 0xea14 1cda4: 40 e0 ldi r20, 0x00 ; 0 1cda6: 60 e0 ldi r22, 0x00 ; 0 1cda8: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 1cdac: 81 11 cpse r24, r1 1cdae: 20 c0 rjmp .+64 ; 0x1cdf0 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1cdb0: 0e 94 7b 74 call 0xe8f6 ; 0xe8f6 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1cdb4: c2 30 cpi r28, 0x02 ; 2 1cdb6: e0 f0 brcs .+56 ; 0x1cdf0 1cdb8: 8c 17 cp r24, r28 1cdba: d0 f0 brcs .+52 ; 0x1cdf0 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1cdbc: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1cdbe: 8a ea ldi r24, 0xAA ; 170 1cdc0: 95 e5 ldi r25, 0x55 ; 85 1cdc2: dc 01 movw r26, r24 1cdc4: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x8e5> 1cdc8: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x8e6> 1cdcc: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x8e7> 1cdd0: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x8e8> boot_app_flags = BOOT_APP_FLG_USER0; 1cdd4: 80 e8 ldi r24, 0x80 ; 128 1cdd6: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x8e4> boot_copy_size = 0; 1cdda: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x8e2> 1cdde: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x8e1> bootapp_reboot_user0(lang << 3); 1cde2: cc 0f add r28, r28 1cde4: cc 0f add r28, r28 1cde6: cc 0f add r28, r28 boot_reserved = reserved; 1cde8: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x8e3> // bootapp_print_vars(); softReset(); 1cdec: 0e 94 ef 65 call 0xcbde ; 0xcbde lang_boot_update_start(lang); lcd_update_enable(true); 1cdf0: 81 e0 ldi r24, 0x01 ; 1 1cdf2: 0e 94 08 70 call 0xe010 ; 0xe010 menu_goto(lcd_language_menu, 0, true, true); 1cdf6: 21 e0 ldi r18, 0x01 ; 1 1cdf8: 41 e0 ldi r20, 0x01 ; 1 1cdfa: 70 e0 ldi r23, 0x00 ; 0 1cdfc: 60 e0 ldi r22, 0x00 ; 0 1cdfe: 87 e0 ldi r24, 0x07 ; 7 1ce00: 97 ee ldi r25, 0xE7 ; 231 1ce02: 0e 94 87 62 call 0xc50e ; 0xc50e 1ce06: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout } } 1ce0a: cf 91 pop r28 1ce0c: 08 95 ret 0001ce0e : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 1ce0e: cf 93 push r28 1ce10: df 93 push r29 MENU_BEGIN(); 1ce12: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 1ce16: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1ce1a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1ce1e: 84 30 cpi r24, 0x04 ; 4 1ce20: 08 f0 brcs .+2 ; 0x1ce24 1ce22: 5c c0 rjmp .+184 ; 0x1cedc 1ce24: 10 92 63 04 sts 0x0463, r1 ; 0x800463 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 1ce28: 0e 94 fe 73 call 0xe7fc ; 0xe7fc 1ce2c: 88 23 and r24, r24 1ce2e: 31 f0 breq .+12 ; 0x1ce3c 1ce30: 8b e3 ldi r24, 0x3B ; 59 1ce32: 98 e4 ldi r25, 0x48 ; 72 1ce34: 0e 94 0a 75 call 0xea14 ; 0xea14 1ce38: 0e 94 9e 72 call 0xe53c ; 0xe53c if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 1ce3c: 8e e6 ldi r24, 0x6E ; 110 1ce3e: 95 e6 ldi r25, 0x65 ; 101 1ce40: 0e 94 14 74 call 0xe828 ; 0xe828 1ce44: 0e 94 f1 72 call 0xe5e2 ; 0xe5e2 1ce48: 88 23 and r24, r24 1ce4a: 49 f0 breq .+18 ; 0x1ce5e #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 1ce4c: 80 e0 ldi r24, 0x00 ; 0 1ce4e: 0e 94 9e 74 call 0xe93c ; 0xe93c 1ce52: 81 11 cpse r24, r1 1ce54: 43 c0 rjmp .+134 ; 0x1cedc MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1ce56: df 91 pop r29 1ce58: cf 91 pop r28 1ce5a: 0c 94 cc e6 jmp 0x1cd98 ; 0x1cd98 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(); 1ce5e: 0e 94 7b 74 call 0xe8f6 ; 0xe8f6 1ce62: d8 2f mov r29, r24 } } 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) 1ce64: c1 e0 ldi r28, 0x01 ; 1 1ce66: cd 17 cp r28, r29 1ce68: 60 f5 brcc .+88 ; 0x1cec2 if (header.magic != LANG_MAGIC) break; //break if not valid if (--lang == 0) return header.code; addr += header.size; //calc address of next table } #else //XFLASH uint16_t table = _SEC_LANG_TABLE; 1ce6a: 80 e0 ldi r24, 0x00 ; 0 1ce6c: 91 e0 ldi r25, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) 1ce6e: 21 e0 ldi r18, 0x01 ; 1 while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid 1ce70: fc 01 movw r30, r24 1ce72: 45 91 lpm r20, Z+ 1ce74: 55 91 lpm r21, Z+ 1ce76: 65 91 lpm r22, Z+ 1ce78: 74 91 lpm r23, Z 1ce7a: 45 3a cpi r20, 0xA5 ; 165 1ce7c: 5a 45 sbci r21, 0x5A ; 90 1ce7e: 64 4b sbci r22, 0xB4 ; 180 1ce80: 7b 44 sbci r23, 0x4B ; 75 1ce82: 19 f0 breq .+6 ; 0x1ce8a 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; 1ce84: 8f e3 ldi r24, 0x3F ; 63 1ce86: 9f e3 ldi r25, 0x3F ; 63 1ce88: 06 c0 rjmp .+12 ; 0x1ce96 #else //XFLASH uint16_t table = _SEC_LANG_TABLE; uint8_t count = 1; //count = 1 (primary) while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid { if (count == lang) return pgm_read_word(((uint16_t*)(table + 10))); //read language code 1ce8a: fc 01 movw r30, r24 1ce8c: c2 13 cpse r28, r18 1ce8e: 10 c0 rjmp .+32 ; 0x1ceb0 1ce90: 3a 96 adiw r30, 0x0a ; 10 1ce92: 85 91 lpm r24, Z+ 1ce94: 94 91 lpm r25, Z #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 1ce96: 0e 94 14 74 call 0xe828 ; 0xe828 1ce9a: 0e 94 f1 72 call 0xe5e2 ; 0xe5e2 1ce9e: 88 23 and r24, r24 1cea0: 71 f0 breq .+28 ; 0x1cebe #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 1cea2: 8c 2f mov r24, r28 1cea4: 0e 94 9e 74 call 0xe93c ; 0xe93c 1cea8: 81 11 cpse r24, r1 1ceaa: 18 c0 rjmp .+48 ; 0x1cedc 1ceac: 8c 2f mov r24, r28 1ceae: d3 cf rjmp .-90 ; 0x1ce56 table += pgm_read_word((uint16_t*)(table + 4)); 1ceb0: 34 96 adiw r30, 0x04 ; 4 1ceb2: 45 91 lpm r20, Z+ 1ceb4: 54 91 lpm r21, Z 1ceb6: 84 0f add r24, r20 1ceb8: 95 1f adc r25, r21 count++; 1ceba: 2f 5f subi r18, 0xFF ; 255 1cebc: d9 cf rjmp .-78 ; 0x1ce70 } } 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) 1cebe: cf 5f subi r28, 0xFF ; 255 1cec0: d2 cf rjmp .-92 ; 0x1ce66 #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 1cec2: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 1cec6: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1ceca: 8f 5f subi r24, 0xFF ; 255 1cecc: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1ced0: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1ced4: 8f 5f subi r24, 0xFF ; 255 1ced6: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1ceda: 9f cf rjmp .-194 ; 0x1ce1a MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1cedc: df 91 pop r29 1cede: cf 91 pop r28 1cee0: 08 95 ret 0001cee2 : } static void lcd_disable_farm_mode() { uint8_t disable = lcd_show_multiscreen_message_yes_no_and_wait_P(PSTR("Disable farm mode?"), true); //allow timeouting, default no 1cee2: 41 e0 ldi r20, 0x01 ; 1 1cee4: 61 e0 ldi r22, 0x01 ; 1 1cee6: 84 e8 ldi r24, 0x84 ; 132 1cee8: 93 e8 ldi r25, 0x83 ; 131 1ceea: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 if (disable == LCD_LEFT_BUTTON_CHOICE) 1ceee: 81 11 cpse r24, r1 1cef0: 07 c0 rjmp .+14 ; 0x1cf00 { enquecommand_P(PSTR("G99")); 1cef2: 61 e0 ldi r22, 0x01 ; 1 1cef4: 80 e8 ldi r24, 0x80 ; 128 1cef6: 93 e8 ldi r25, 0x83 ; 131 1cef8: 0e 94 da 8c call 0x119b4 ; 0x119b4 lcd_return_to_status(); 1cefc: 0f 94 6d 05 call 0x20ada ; 0x20ada } lcd_update_enable(true); 1cf00: 81 e0 ldi r24, 0x01 ; 1 1cf02: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_draw_update = 2; 1cf06: 82 e0 ldi r24, 0x02 ; 2 1cf08: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1cf0c: 08 95 ret 0001cf0e : 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() { 1cf0e: cf 93 push r28 1cf10: df 93 push r29 if (MMU2::mmu2.Enabled()) { 1cf12: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1cf16: 81 30 cpi r24, 0x01 ; 1 1cf18: e9 f4 brne .+58 ; 0x1cf54 const uint8_t filament = choose_menu_P( 1cf1a: 86 ed ldi r24, 0xD6 ; 214 1cf1c: 9c e3 ldi r25, 0x3C ; 60 1cf1e: 0e 94 0a 75 call 0xea14 ; 0xea14 1cf22: ec 01 movw r28, r24 1cf24: 83 ec ldi r24, 0xC3 ; 195 1cf26: 9c e3 ldi r25, 0x3C ; 60 1cf28: 0e 94 0a 75 call 0xea14 ; 0xea14 _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,_T(MSG_CANCEL)); 1cf2c: be 01 movw r22, r28 1cf2e: 0e 94 b9 cf call 0x19f72 ; 0x19f72 if (filament < MMU_FILAMENT_COUNT) { 1cf32: 85 30 cpi r24, 0x05 ; 5 1cf34: 98 f5 brcc .+102 ; 0x1cf9c lay1cal_filament = filament; 1cf36: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 1cf3a: 8a e0 ldi r24, 0x0A ; 10 1cf3c: 80 93 94 03 sts 0x0394, r24 ; 0x800394 menu_goto(lcd_generic_preheat_menu, 0, true); 1cf40: 20 e0 ldi r18, 0x00 ; 0 1cf42: 41 e0 ldi r20, 0x01 ; 1 1cf44: 70 e0 ldi r23, 0x00 ; 0 1cf46: 60 e0 ldi r22, 0x00 ; 0 1cf48: 84 ea ldi r24, 0xA4 ; 164 1cf4a: 98 e3 ldi r25, 0x38 ; 56 } 1cf4c: df 91 pop r29 1cf4e: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 1cf50: 0c 94 87 62 jmp 0xc50e ; 0xc50e menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1cf54: 8f e5 ldi r24, 0x5F ; 95 1cf56: 9f e0 ldi r25, 0x0F ; 15 1cf58: 0f 94 9d a3 call 0x3473a ; 0x3473a 1cf5c: 81 11 cpse r24, r1 1cf5e: ed cf rjmp .-38 ; 0x1cf3a { bool loaded = false; if (fsensor.isReady()) { 1cf60: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1cf64: 82 30 cpi r24, 0x02 ; 2 1cf66: f1 f4 brne .+60 ; 0x1cfa4 1cf68: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1cf6c: 81 11 cpse r24, r1 1cf6e: e5 cf rjmp .-54 ; 0x1cf3a 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)); 1cf70: 85 ea ldi r24, 0xA5 ; 165 1cf72: 9c e3 ldi r25, 0x3C ; 60 1cf74: 0e 94 0a 75 call 0xea14 ; 0xea14 1cf78: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_consume_click(); 1cf7c: 0e 94 40 73 call 0xe680 ; 0xe680 1cf80: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 1cf82: 84 e6 ldi r24, 0x64 ; 100 1cf84: 90 e0 ldi r25, 0x00 ; 0 1cf86: 0e 94 7f 8c call 0x118fe ; 0x118fe if (lcd_clicked()) { 1cf8a: 0e 94 45 73 call 0xe68a ; 0xe68a 1cf8e: 81 11 cpse r24, r1 1cf90: 02 c0 rjmp .+4 ; 0x1cf96 1cf92: 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 1cf94: b1 f7 brne .-20 ; 0x1cf82 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 1cf96: 81 e0 ldi r24, 0x01 ; 1 1cf98: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 1cf9c: df 91 pop r29 1cf9e: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 1cfa0: 0c 94 eb 62 jmp 0xc5d6 ; 0xc5d6 { 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); 1cfa4: 81 ed ldi r24, 0xD1 ; 209 1cfa6: 91 e4 ldi r25, 0x41 ; 65 1cfa8: 0e 94 0a 75 call 0xea14 ; 0xea14 1cfac: 41 e0 ldi r20, 0x01 ; 1 1cfae: 60 e0 ldi r22, 0x00 ; 0 1cfb0: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 1cfb4: 91 e0 ldi r25, 0x01 ; 1 1cfb6: 81 11 cpse r24, r1 1cfb8: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 1cfba: 81 e0 ldi r24, 0x01 ; 1 1cfbc: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } if (!loaded) { 1cfc0: 91 11 cpse r25, r1 1cfc2: bb cf rjmp .-138 ; 0x1cf3a 1cfc4: d5 cf rjmp .-86 ; 0x1cf70 0001cfc6 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 1cfc6: cf 93 push r28 1cfc8: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 1cfca: 87 e7 ldi r24, 0x77 ; 119 1cfcc: 9f e3 ldi r25, 0x3F ; 63 1cfce: 0e 94 0a 75 call 0xea14 ; 0xea14 1cfd2: 40 e0 ldi r20, 0x00 ; 0 1cfd4: 6c 2f mov r22, r28 1cfd6: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 if (result == LCD_LEFT_BUTTON_CHOICE) { 1cfda: 81 11 cpse r24, r1 1cfdc: 03 c0 rjmp .+6 ; 0x1cfe4 lcd_mesh_calibration_z(); } } 1cfde: 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(); 1cfe0: 0c 94 6b c2 jmp 0x184d6 ; 0x184d6 } } 1cfe4: cf 91 pop r28 1cfe6: 08 95 ret 0001cfe8 : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 1cfe8: bf 92 push r11 1cfea: cf 92 push r12 1cfec: df 92 push r13 1cfee: ef 92 push r14 1cff0: ff 92 push r15 1cff2: 0f 93 push r16 1cff4: 1f 93 push r17 1cff6: cf 93 push r28 1cff8: df 93 push r29 1cffa: 00 d0 rcall .+0 ; 0x1cffc 1cffc: 1f 92 push r1 1cffe: cd b7 in r28, 0x3d ; 61 1d000: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1d002: 8c ea ldi r24, 0xAC ; 172 1d004: 9d e0 ldi r25, 0x0D ; 13 1d006: 0f 94 9d a3 call 0x3473a ; 0x3473a 1d00a: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1d00c: 8b ea ldi r24, 0xAB ; 171 1d00e: 9d e0 ldi r25, 0x0D ; 13 1d010: 0f 94 9d a3 call 0x3473a ; 0x3473a 1d014: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1d016: 8a ea ldi r24, 0xAA ; 170 1d018: 9d e0 ldi r25, 0x0D ; 13 1d01a: 0f 94 9d a3 call 0x3473a ; 0x3473a 1d01e: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1d020: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 1d024: 10 92 60 04 sts 0x0460, r1 ; 0x800460 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 1d028: 80 e3 ldi r24, 0x30 ; 48 1d02a: d8 2e mov r13, r24 1d02c: df 0c add r13, r15 sToggle[1] = 'x'; 1d02e: 98 e7 ldi r25, 0x78 ; 120 1d030: 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'; 1d032: 20 e3 ldi r18, 0x30 ; 48 1d034: e2 2e mov r14, r18 1d036: 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(); 1d038: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1d03c: 84 30 cpi r24, 0x04 ; 4 1d03e: 08 f0 brcs .+2 ; 0x1d042 1d040: 56 c0 rjmp .+172 ; 0x1d0ee 1d042: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 1d046: 0e 94 1c 62 call 0xc438 ; 0xc438 1d04a: 88 23 and r24, r24 1d04c: 31 f0 breq .+12 ; 0x1d05a 1d04e: 87 e0 ldi r24, 0x07 ; 7 1d050: f8 12 cpse r15, r24 1d052: 03 c0 rjmp .+6 ; 0x1d05a 1d054: 81 e0 ldi r24, 0x01 ; 1 1d056: 0e 94 e3 e7 call 0x1cfc6 ; 0x1cfc6 // 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)); 1d05a: 8b e3 ldi r24, 0x3B ; 59 1d05c: 98 e4 ldi r25, 0x48 ; 72 1d05e: 0e 94 0a 75 call 0xea14 ; 0xea14 1d062: 0e 94 9e 72 call 0xe53c ; 0xe53c sToggle[0] = points_nr + '0'; 1d066: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1d068: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1d06a: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1d06c: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1d06e: 84 e3 ldi r24, 0x34 ; 52 1d070: 98 e4 ldi r25, 0x48 ; 72 1d072: 0e 94 0a 75 call 0xea14 ; 0xea14 1d076: 20 e0 ldi r18, 0x00 ; 0 1d078: 41 e1 ldi r20, 0x11 ; 17 1d07a: 5d eb ldi r21, 0xBD ; 189 1d07c: be 01 movw r22, r28 1d07e: 6f 5f subi r22, 0xFF ; 255 1d080: 7f 4f sbci r23, 0xFF ; 255 1d082: 0e 94 2e 75 call 0xea5c ; 0xea5c sToggle[0] = mbl_z_probe_nr + '0'; 1d086: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1d088: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1d08a: 86 e2 ldi r24, 0x26 ; 38 1d08c: 98 e4 ldi r25, 0x48 ; 72 1d08e: 0e 94 0a 75 call 0xea14 ; 0xea14 1d092: 20 e0 ldi r18, 0x00 ; 0 1d094: 42 e0 ldi r20, 0x02 ; 2 1d096: 5d eb ldi r21, 0xBD ; 189 1d098: be 01 movw r22, r28 1d09a: 6f 5f subi r22, 0xFF ; 255 1d09c: 7f 4f sbci r23, 0xFF ; 255 1d09e: 0e 94 2e 75 call 0xea5c ; 0xea5c 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); 1d0a2: 87 e0 ldi r24, 0x07 ; 7 1d0a4: f8 12 cpse r15, r24 1d0a6: 20 c0 rjmp .+64 ; 0x1d0e8 1d0a8: 8a e9 ldi r24, 0x9A ; 154 1d0aa: 92 e6 ldi r25, 0x62 ; 98 1d0ac: c1 10 cpse r12, r1 1d0ae: 02 c0 rjmp .+4 ; 0x1d0b4 1d0b0: 84 e9 ldi r24, 0x94 ; 148 1d0b2: 92 e6 ldi r25, 0x62 ; 98 1d0b4: 0e 94 0a 75 call 0xea14 ; 0xea14 1d0b8: 8c 01 movw r16, r24 1d0ba: 80 e1 ldi r24, 0x10 ; 16 1d0bc: 98 e4 ldi r25, 0x48 ; 72 1d0be: 0e 94 0a 75 call 0xea14 ; 0xea14 1d0c2: 22 e0 ldi r18, 0x02 ; 2 1d0c4: 4d e1 ldi r20, 0x1D ; 29 1d0c6: 5d eb ldi r21, 0xBD ; 189 1d0c8: b8 01 movw r22, r16 1d0ca: 0e 94 2e 75 call 0xea5c ; 0xea5c MENU_END(); 1d0ce: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 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(); 1d0d2: 90 91 60 04 lds r25, 0x0460 ; 0x800460 1d0d6: 9f 5f subi r25, 0xFF ; 255 1d0d8: 90 93 60 04 sts 0x0460, r25 ; 0x800460 1d0dc: 90 91 62 04 lds r25, 0x0462 ; 0x800462 1d0e0: 9f 5f subi r25, 0xFF ; 255 1d0e2: 90 93 62 04 sts 0x0462, r25 ; 0x800462 1d0e6: a8 cf rjmp .-176 ; 0x1d038 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); 1d0e8: 80 e2 ldi r24, 0x20 ; 32 1d0ea: 98 e4 ldi r25, 0x48 ; 72 1d0ec: e3 cf rjmp .-58 ; 0x1d0b4 MENU_END(); } 1d0ee: 0f 90 pop r0 1d0f0: 0f 90 pop r0 1d0f2: 0f 90 pop r0 1d0f4: 0f 90 pop r0 1d0f6: df 91 pop r29 1d0f8: cf 91 pop r28 1d0fa: 1f 91 pop r17 1d0fc: 0f 91 pop r16 1d0fe: ff 90 pop r15 1d100: ef 90 pop r14 1d102: df 90 pop r13 1d104: cf 90 pop r12 1d106: bf 90 pop r11 1d108: 08 95 ret 0001d10a : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 1d10a: cf 92 push r12 1d10c: df 92 push r13 1d10e: ef 92 push r14 1d110: ff 92 push r15 1d112: 0f 93 push r16 1d114: 1f 93 push r17 1d116: cf 93 push r28 1d118: df 93 push r29 1d11a: d8 2e mov r13, r24 1d11c: 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) 1d11e: 01 e0 ldi r16, 0x01 ; 1 1d120: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 1d124: 81 11 cpse r24, r1 1d126: 01 c0 rjmp .+2 ; 0x1d12a 1d128: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 1d12a: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 1d12e: 8d 2d mov r24, r13 1d130: 9c 2d mov r25, r12 1d132: 0e 94 9a de call 0x1bd34 ; 0x1bd34 1d136: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 1d138: 0e 94 40 73 call 0xe680 ; 0xe680 KEEPALIVE_STATE(PAUSED_FOR_USER); 1d13c: 84 e0 ldi r24, 0x04 ; 4 1d13e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 * @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); 1d142: 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) { 1d144: 20 97 sbiw r28, 0x00 ; 0 1d146: 29 f4 brne .+10 ; 0x1d152 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 1d148: 49 e8 ldi r20, 0x89 ; 137 1d14a: 63 e0 ldi r22, 0x03 ; 3 1d14c: 83 e1 ldi r24, 0x13 ; 19 1d14e: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 * @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); 1d152: 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); 1d154: 82 e3 ldi r24, 0x32 ; 50 1d156: 90 e0 ldi r25, 0x00 ; 0 1d158: 0e 94 7f 8c call 0x118fe ; 0x118fe if (lcd_clicked()) { 1d15c: 0e 94 45 73 call 0xe68a ; 0xe68a 1d160: 88 23 and r24, r24 1d162: 81 f0 breq .+32 ; 0x1d184 if (msg_next == NULL) { 1d164: 20 97 sbiw r28, 0x00 ; 0 1d166: 81 f4 brne .+32 ; 0x1d188 KEEPALIVE_STATE(IN_HANDLER); 1d168: 82 e0 ldi r24, 0x02 ; 2 1d16a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 1d16e: 00 93 5a 02 sts 0x025A, r16 ; 0x80025a if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 1d172: df 91 pop r29 1d174: cf 91 pop r28 1d176: 1f 91 pop r17 1d178: 0f 91 pop r16 1d17a: ff 90 pop r15 1d17c: ef 90 pop r14 1d17e: df 90 pop r13 1d180: cf 90 pop r12 1d182: 08 95 ret 1d184: 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) { 1d186: 31 f7 brne .-52 ; 0x1d154 else { break; } } } if (multi_screen) { 1d188: e1 14 cp r14, r1 1d18a: f1 04 cpc r15, r1 1d18c: d9 f2 breq .-74 ; 0x1d144 if (msg_next == NULL) 1d18e: 20 97 sbiw r28, 0x00 ; 0 1d190: 11 f4 brne .+4 ; 0x1d196 msg_next = msg; 1d192: cd 2d mov r28, r13 1d194: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 1d196: ce 01 movw r24, r28 1d198: 0e 94 9a de call 0x1bd34 ; 0x1bd34 1d19c: ec 01 movw r28, r24 1d19e: d2 cf rjmp .-92 ; 0x1d144 0001d1a0 : 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' 1d1a0: 41 30 cpi r20, 0x01 ; 1 1d1a2: 41 f4 brne .+16 ; 0x1d1b4 if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1d1a4: 40 e0 ldi r20, 0x00 ; 0 1d1a6: 61 e0 ldi r22, 0x01 ; 1 1d1a8: 0e 94 68 e3 call 0x1c6d0 ; 0x1c6d0 1d1ac: 81 30 cpi r24, 0x01 ; 1 1d1ae: 41 f4 brne .+16 ; 0x1d1c0 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1d1b0: 0c 94 33 dd jmp 0x1ba66 ; 0x1ba66 { 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 1d1b4: 42 30 cpi r20, 0x02 ; 2 1d1b6: 21 f4 brne .+8 ; 0x1d1c0 lcd_show_fullscreen_message_and_wait_P(strict); 1d1b8: cb 01 movw r24, r22 1d1ba: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 1d1be: f8 cf rjmp .-16 ; 0x1d1b0 lcd_print_stop(); } } 1d1c0: 08 95 ret 0001d1c2 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1d1c2: 0f 93 push r16 1d1c4: 1f 93 push r17 1d1c6: 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)) { 1d1c8: 8c ea ldi r24, 0xAC ; 172 1d1ca: 9c e0 ldi r25, 0x0C ; 12 1d1cc: 0f 94 9d a3 call 0x3473a ; 0x3473a 1d1d0: 81 11 cpse r24, r1 1d1d2: 23 c0 rjmp .+70 ; 0x1d21a goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 1d1d4: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1d1d8: 88 23 and r24, r24 1d1da: f9 f0 breq .+62 ; 0x1d21a 1d1dc: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1d1e0: 81 11 cpse r24, r1 1d1e2: 1b c0 rjmp .+54 ; 0x1d21a if (oCheckFilament == ClCheckMode::_None) { 1d1e4: c0 91 ee 03 lds r28, 0x03EE ; 0x8003ee 1d1e8: cc 23 and r28, r28 1d1ea: b9 f0 breq .+46 ; 0x1d21a goto done; } render_M862_warnings( 1d1ec: 8f e1 ldi r24, 0x1F ; 31 1d1ee: 9c e4 ldi r25, 0x4C ; 76 1d1f0: 0e 94 0a 75 call 0xea14 ; 0xea14 1d1f4: 8c 01 movw r16, r24 1d1f6: 8f e1 ldi r24, 0x1F ; 31 1d1f8: 9c e4 ldi r25, 0x4C ; 76 1d1fa: 0e 94 0a 75 call 0xea14 ; 0xea14 1d1fe: 4c 2f mov r20, r28 1d200: b8 01 movw r22, r16 1d202: 0e 94 d0 e8 call 0x1d1a0 ; 0x1d1a0 _T(MSG_MISSING_FILAMENT) ,_T(MSG_MISSING_FILAMENT) //Identical messages ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1d206: 81 e0 ldi r24, 0x01 ; 1 1d208: 90 91 5e 0d lds r25, 0x0D5E ; 0x800d5e 1d20c: 91 30 cpi r25, 0x01 ; 1 1d20e: 09 f4 brne .+2 ; 0x1d212 1d210: 80 e0 ldi r24, 0x00 ; 0 } } done: return true; } 1d212: cf 91 pop r28 1d214: 1f 91 pop r17 1d216: 0f 91 pop r16 1d218: 08 95 ret return false; } } done: return true; 1d21a: 81 e0 ldi r24, 0x01 ; 1 1d21c: fa cf rjmp .-12 ; 0x1d212 0001d21e : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1d21e: 1f 93 push r17 1d220: cf 93 push r28 1d222: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1d224: 10 91 ed 03 lds r17, 0x03ED ; 0x8003ed 1d228: 11 23 and r17, r17 1d22a: 19 f1 breq .+70 ; 0x1d272 1d22c: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1d22e: 85 ea ldi r24, 0xA5 ; 165 1d230: 9d e0 ldi r25, 0x0D ; 13 1d232: 0f 94 ab a3 call 0x34756 ; 0x34756 if (nDiameter == nDiameter_um) 1d236: 8c 17 cp r24, r28 1d238: 9d 07 cpc r25, r29 1d23a: d9 f0 breq .+54 ; 0x1d272 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1d23c: 80 ed ldi r24, 0xD0 ; 208 1d23e: 9b e4 ldi r25, 0x4B ; 75 1d240: 0e 94 0a 75 call 0xea14 ; 0xea14 1d244: ec 01 movw r28, r24 1d246: 85 ea ldi r24, 0xA5 ; 165 1d248: 9b e4 ldi r25, 0x4B ; 75 1d24a: 0e 94 0a 75 call 0xea14 ; 0xea14 1d24e: 41 2f mov r20, r17 1d250: be 01 movw r22, r28 1d252: 0e 94 d0 e8 call 0x1d1a0 ; 0x1d1a0 _T(MSG_NOZZLE_DIFFERS_CONTINUE) ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { 1d256: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1d25a: 81 11 cpse r24, r1 1d25c: 0a c0 rjmp .+20 ; 0x1d272 bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1d25e: 10 92 ec 03 sts 0x03EC, r1 ; 0x8003ec menu_submenu(lcd_hw_setup_menu); 1d262: 60 e0 ldi r22, 0x00 ; 0 1d264: 8c e4 ldi r24, 0x4C ; 76 1d266: 9f eb ldi r25, 0xBF ; 191 } } 1d268: df 91 pop r29 1d26a: cf 91 pop r28 1d26c: 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); 1d26e: 0c 94 ad 62 jmp 0xc55a ; 0xc55a } } 1d272: df 91 pop r29 1d274: cf 91 pop r28 1d276: 1f 91 pop r17 1d278: 08 95 ret 0001d27a : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 1d27a: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1d27e: 88 23 and r24, r24 1d280: 61 f0 breq .+24 ; 0x1d29a 1d282: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1d286: 88 23 and r24, r24 1d288: 41 f0 breq .+16 ; 0x1d29a lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 1d28a: 82 e9 ldi r24, 0x92 ; 146 1d28c: 94 e4 ldi r25, 0x44 ; 68 1d28e: 0e 94 0a 75 call 0xea14 ; 0xea14 1d292: 0e 94 85 e8 call 0x1d10a ; 0x1d10a lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 1d296: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 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; 1d29a: 85 e0 ldi r24, 0x05 ; 5 1d29c: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e 1d2a0: fa cf rjmp .-12 ; 0x1d296 0001d2a2 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 1d2a2: cf 93 push r28 1d2a4: 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); 1d2a6: 8a ec ldi r24, 0xCA ; 202 1d2a8: 9f e3 ldi r25, 0x3F ; 63 1d2aa: 0e 94 0a 75 call 0xea14 ; 0xea14 1d2ae: 41 e0 ldi r20, 0x01 ; 1 1d2b0: 4c 27 eor r20, r28 1d2b2: 60 e0 ldi r22, 0x00 ; 0 1d2b4: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 1d2b8: 91 e0 ldi r25, 0x01 ; 1 1d2ba: 81 11 cpse r24, r1 1d2bc: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 1d2be: c9 17 cp r28, r25 1d2c0: 59 f0 breq .+22 ; 0x1d2d8 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 1d2c2: 80 ea ldi r24, 0xA0 ; 160 1d2c4: 9f e3 ldi r25, 0x3F ; 63 1d2c6: cc 23 and r28, r28 1d2c8: 11 f0 breq .+4 ; 0x1d2ce 1d2ca: 83 ed ldi r24, 0xD3 ; 211 1d2cc: 9f e5 ldi r25, 0x5F ; 95 1d2ce: 0e 94 0a 75 call 0xea14 ; 0xea14 } #endif //STEEL_SHEET } 1d2d2: 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)); 1d2d4: 0c 94 85 e8 jmp 0x1d10a ; 0x1d10a } #endif //STEEL_SHEET } 1d2d8: cf 91 pop r28 1d2da: 08 95 ret 0001d2dc : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 1d2dc: cf 93 push r28 1d2de: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 1d2e0: 88 e2 ldi r24, 0x28 ; 40 1d2e2: 9f e3 ldi r25, 0x3F ; 63 1d2e4: 0e 94 0a 75 call 0xea14 ; 0xea14 1d2e8: 0e 94 85 e8 call 0x1d10a ; 0x1d10a _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 1d2ec: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d2f0: 81 30 cpi r24, 0x01 ; 1 1d2f2: 69 f4 brne .+26 ; 0x1d30e { lcd_show_fullscreen_message_and_wait_P( 1d2f4: 8f ec ldi r24, 0xCF ; 207 1d2f6: 9e e3 ldi r25, 0x3E ; 62 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 1d2f8: 0e 94 0a 75 call 0xea14 ; 0xea14 1d2fc: 0e 94 85 e8 call 0x1d10a ; 0x1d10a _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 1d300: 8d ef ldi r24, 0xFD ; 253 1d302: 9d e3 ldi r25, 0x3D ; 61 1d304: 0e 94 0a 75 call 0xea14 ; 0xea14 _T(MSG_WIZARD_V2_CAL_2)); } 1d308: 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( 1d30a: 0c 94 85 e8 jmp 0x1d10a ; 0x1d10a if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 1d30e: cc 23 and r28, r28 1d310: b9 f3 breq .-18 ; 0x1d300 { lcd_show_fullscreen_message_and_wait_P( 1d312: 8d e9 ldi r24, 0x9D ; 157 1d314: 9e e3 ldi r25, 0x3E ; 62 1d316: f0 cf rjmp .-32 ; 0x1d2f8 0001d318 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 1d318: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d31c: 81 30 cpi r24, 0x01 ; 1 1d31e: 71 f4 brne .+28 ; 0x1d33c lcd_show_fullscreen_message_and_wait_P( 1d320: 84 ea ldi r24, 0xA4 ; 164 1d322: 9d e3 ldi r25, 0x3D ; 61 1d324: 0e 94 0a 75 call 0xea14 ; 0xea14 1d328: 0e 94 85 e8 call 0x1d10a ; 0x1d10a _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; 1d32c: 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; 1d32e: 80 93 94 03 sts 0x0394, r24 ; 0x800394 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 1d332: 61 e0 ldi r22, 0x01 ; 1 1d334: 81 e2 ldi r24, 0x21 ; 33 1d336: 93 e8 ldi r25, 0x83 ; 131 1d338: 0c 94 da 8c jmp 0x119b4 ; 0x119b4 // 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( 1d33c: 88 e5 ldi r24, 0x58 ; 88 1d33e: 9d e3 ldi r25, 0x3D ; 61 1d340: 0e 94 0a 75 call 0xea14 ; 0xea14 1d344: 0e 94 85 e8 call 0x1d10a ; 0x1d10a _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 1d348: 80 e0 ldi r24, 0x00 ; 0 1d34a: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_clear(); 1d34e: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 1d352: 8d ee ldi r24, 0xED ; 237 1d354: 91 e6 ldi r25, 0x61 ; 97 1d356: 0e 94 0a 75 call 0xea14 ; 0xea14 1d35a: ac 01 movw r20, r24 1d35c: 62 e0 ldi r22, 0x02 ; 2 1d35e: 80 e0 ldi r24, 0x00 ; 0 1d360: 0e 94 d7 6f call 0xdfae ; 0xdfae eFilamentAction = FilamentAction::Load; 1d364: 81 e0 ldi r24, 0x01 ; 1 1d366: e3 cf rjmp .-58 ; 0x1d32e 0001d368 : //! ---------------------- | ---------------- //! 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) { 1d368: af 92 push r10 1d36a: bf 92 push r11 1d36c: cf 92 push r12 1d36e: df 92 push r13 1d370: ef 92 push r14 1d372: ff 92 push r15 1d374: 0f 93 push r16 1d376: 1f 93 push r17 1d378: cf 93 push r28 1d37a: 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); 1d37c: 88 23 and r24, r24 1d37e: 29 f0 breq .+10 ; 0x1d38a 1d380: 61 e0 ldi r22, 0x01 ; 1 1d382: 8f e5 ldi r24, 0x5F ; 95 1d384: 9f e0 ldi r25, 0x0F ; 15 1d386: 0f 94 c1 a3 call 0x34782 ; 0x34782 FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 1d38a: 89 e2 ldi r24, 0x29 ; 41 1d38c: e8 2e mov r14, r24 1d38e: 83 e8 ldi r24, 0x83 ; 131 1d390: 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; 1d392: 97 ed ldi r25, 0xD7 ; 215 1d394: c9 2e mov r12, r25 1d396: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1d398: 2c e3 ldi r18, 0x3C ; 60 1d39a: a2 2e mov r10, r18 1d39c: b1 2c mov r11, r1 1d39e: 0c 2f mov r16, r28 1d3a0: 10 e0 ldi r17, 0x00 ; 0 1d3a2: 1f 92 push r1 1d3a4: cf 93 push r28 1d3a6: ff 92 push r15 1d3a8: ef 92 push r14 1d3aa: 0f 94 5f a2 call 0x344be ; 0x344be switch (state) { 1d3ae: 0f 90 pop r0 1d3b0: 0f 90 pop r0 1d3b2: 0f 90 pop r0 1d3b4: 0f 90 pop r0 1d3b6: ef ef ldi r30, 0xFF ; 255 1d3b8: ec 0f add r30, r28 1d3ba: ed 30 cpi r30, 0x0D ; 13 1d3bc: a0 f4 brcc .+40 ; 0x1d3e6 1d3be: f0 e0 ldi r31, 0x00 ; 0 1d3c0: 88 27 eor r24, r24 1d3c2: ea 51 subi r30, 0x1A ; 26 1d3c4: f6 41 sbci r31, 0x16 ; 22 1d3c6: 8f 4f sbci r24, 0xFF ; 255 1d3c8: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 1d3cc: 41 ea ldi r20, 0xA1 ; 161 1d3ce: 61 ea ldi r22, 0xA1 ; 161 1d3d0: 6d ea ldi r22, 0xAD ; 173 1d3d2: 77 ea ldi r23, 0xA7 ; 167 1d3d4: b1 ea ldi r27, 0xA1 ; 161 1d3d6: cb ea ldi r28, 0xAB ; 171 1d3d8: e2 ea ldi r30, 0xA2 ; 162 1d3da: dc ea ldi r29, 0xAC ; 172 1d3dc: e6 ea ldi r30, 0xA6 ; 166 1d3de: f4 ea ldi r31, 0xA4 ; 164 1d3e0: fd ea ldi r31, 0xAD ; 173 1d3e2: 11 eb ldi r17, 0xB1 ; 177 1d3e4: 11 eb ldi r17, 0xB1 ; 177 // 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; 1d3e6: 10 92 73 12 sts 0x1273, r1 ; 0x801273 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 1d3ea: 8f e5 ldi r24, 0x5F ; 95 1d3ec: 9f e0 ldi r25, 0x0F ; 15 1d3ee: 0f 94 9d a3 call 0x3473a ; 0x3473a 1d3f2: 82 30 cpi r24, 0x02 ; 2 1d3f4: 39 f4 brne .+14 ; 0x1d404 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 1d3f6: 8e e6 ldi r24, 0x6E ; 110 1d3f8: 93 e4 ldi r25, 0x43 ; 67 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)); 1d3fa: 0e 94 0a 75 call 0xea14 ; 0xea14 1d3fe: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 1d402: 0f c0 rjmp .+30 ; 0x1d422 // 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); 1d404: 89 e0 ldi r24, 0x09 ; 9 1d406: 93 e4 ldi r25, 0x43 ; 67 1d408: 0e 94 0a 75 call 0xea14 ; 0xea14 1d40c: 40 e0 ldi r20, 0x00 ; 0 1d40e: 60 e0 ldi r22, 0x00 ; 0 1d410: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1d414: 81 11 cpse r24, r1 1d416: 07 c0 rjmp .+14 ; 0x1d426 1d418: 61 e0 ldi r22, 0x01 ; 1 1d41a: 8f e5 ldi r24, 0x5F ; 95 1d41c: 9f e0 ldi r25, 0x0F ; 15 1d41e: 0f 94 c1 a3 call 0x34782 ; 0x34782 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 1d422: c1 e0 ldi r28, 0x01 ; 1 1d424: bc cf rjmp .-136 ; 0x1d39e 1d426: 60 e0 ldi r22, 0x00 ; 0 1d428: 8f e5 ldi r24, 0x5F ; 95 1d42a: 9f e0 ldi r25, 0x0F ; 15 1d42c: 0f 94 c1 a3 call 0x34782 ; 0x34782 1d430: c0 e0 ldi r28, 0x00 ; 0 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); 1d432: 10 e0 ldi r17, 0x00 ; 0 1d434: 00 e0 ldi r16, 0x00 ; 0 } FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 1d436: 1f 93 push r17 1d438: 0f 93 push r16 1d43a: 88 ed ldi r24, 0xD8 ; 216 1d43c: 97 e6 ldi r25, 0x67 ; 103 1d43e: 9f 93 push r25 1d440: 8f 93 push r24 1d442: 0f 94 5f a2 call 0x344be ; 0x344be switch (state) { 1d446: 0f 90 pop r0 1d448: 0f 90 pop r0 1d44a: 0f 90 pop r0 1d44c: 0f 90 pop r0 1d44e: cc 30 cpi r28, 0x0C ; 12 1d450: 09 f4 brne .+2 ; 0x1d454 1d452: ed c0 rjmp .+474 ; 0x1d62e 1d454: cd 30 cpi r28, 0x0D ; 13 1d456: 09 f4 brne .+2 ; 0x1d45a 1d458: ff c0 rjmp .+510 ; 0x1d658 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 1d45a: 88 e6 ldi r24, 0x68 ; 104 1d45c: 90 e4 ldi r25, 0x40 ; 64 FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); switch (state) { 1d45e: cc 23 and r28, r28 1d460: 09 f4 brne .+2 ; 0x1d464 1d462: fc c0 rjmp .+504 ; 0x1d65c break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 1d464: 81 e0 ldi r24, 0x01 ; 1 1d466: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_update(2); 1d46a: 82 e0 ldi r24, 0x02 ; 2 } 1d46c: cf 91 pop r28 1d46e: 1f 91 pop r17 1d470: 0f 91 pop r16 1d472: ff 90 pop r15 1d474: ef 90 pop r14 1d476: df 90 pop r13 1d478: cf 90 pop r12 1d47a: bf 90 pop r11 1d47c: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 1d47e: 0c 94 c9 6e jmp 0xdd92 ; 0xdd92 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1d482: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> 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)) { 1d486: 81 e0 ldi r24, 0x01 ; 1 1d488: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 state = S::Selftest; 1d48c: 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)) { 1d48e: 88 23 and r24, r24 1d490: 09 f4 brne .+2 ; 0x1d494 1d492: 85 cf rjmp .-246 ; 0x1d39e state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1d494: 82 e0 ldi r24, 0x02 ; 2 1d496: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 1d49a: 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)) { 1d49c: 88 23 and r24, r24 1d49e: 09 f4 brne .+2 ; 0x1d4a2 1d4a0: 7e cf rjmp .-260 ; 0x1d39e // 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)) { 1d4a2: 84 e0 ldi r24, 0x04 ; 4 1d4a4: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 state = S::Z; 1d4a8: 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)) { 1d4aa: 88 23 and r24, r24 1d4ac: 09 f4 brne .+2 ; 0x1d4b0 1d4ae: 77 cf rjmp .-274 ; 0x1d39e 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)) { 1d4b0: 80 e1 ldi r24, 0x10 ; 16 1d4b2: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 state = S::IsFil; 1d4b6: c5 e0 ldi r28, 0x05 ; 5 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)) { 1d4b8: 88 23 and r24, r24 1d4ba: 09 f4 brne .+2 ; 0x1d4be 1d4bc: 70 cf rjmp .-288 ; 0x1d39e state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 1d4be: cc e0 ldi r28, 0x0C ; 12 1d4c0: 6e cf rjmp .-292 ; 0x1d39e } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 1d4c2: 80 ec ldi r24, 0xC0 ; 192 1d4c4: 92 e4 ldi r25, 0x42 ; 66 1d4c6: 0e 94 0a 75 call 0xea14 ; 0xea14 1d4ca: 0e 94 85 e8 call 0x1d10a ; 0x1d10a wizard_event = lcd_selftest(); 1d4ce: 0e 94 a7 de call 0x1bd4e ; 0x1bd4e 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); 1d4d2: 81 11 cpse r24, r1 1d4d4: a6 cf rjmp .-180 ; 0x1d422 } 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); 1d4d6: cd e0 ldi r28, 0x0D ; 13 1d4d8: 62 cf rjmp .-316 ; 0x1d39e break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 1d4da: 82 e8 ldi r24, 0x82 ; 130 1d4dc: 92 e4 ldi r25, 0x42 ; 66 1d4de: 0e 94 0a 75 call 0xea14 ; 0xea14 1d4e2: 0e 94 85 e8 call 0x1d10a ; 0x1d10a wizard_event = gcode_M45(false, 0); 1d4e6: 80 e0 ldi r24, 0x00 ; 0 1d4e8: 0f 94 db 7c call 0x2f9b6 ; 0x2f9b6 1d4ec: f2 cf rjmp .-28 ; 0x1d4d2 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 1d4ee: 8a e5 ldi r24, 0x5A ; 90 1d4f0: 92 e4 ldi r25, 0x42 ; 66 1d4f2: 0e 94 0a 75 call 0xea14 ; 0xea14 1d4f6: 0e 94 85 e8 call 0x1d10a ; 0x1d10a lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 1d4fa: 8c e2 ldi r24, 0x2C ; 44 1d4fc: 92 e4 ldi r25, 0x42 ; 66 1d4fe: 0e 94 0a 75 call 0xea14 ; 0xea14 1d502: 0e 94 85 e8 call 0x1d10a ; 0x1d10a lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 1d506: 8c e0 ldi r24, 0x0C ; 12 1d508: 92 e4 ldi r25, 0x42 ; 66 1d50a: 0e 94 0a 75 call 0xea14 ; 0xea14 1d50e: 0e 94 85 e8 call 0x1d10a ; 0x1d10a wizard_event = gcode_M45(true, 0); 1d512: 81 e0 ldi r24, 0x01 ; 1 1d514: 0f 94 db 7c call 0x2f9b6 ; 0x2f9b6 if (!wizard_event) { 1d518: 88 23 and r24, r24 1d51a: e9 f2 breq .-70 ; 0x1d4d6 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 1d51c: 60 e0 ldi r22, 0x00 ; 0 1d51e: 70 e0 ldi r23, 0x00 ; 0 1d520: 88 ed ldi r24, 0xD8 ; 216 1d522: 91 e4 ldi r25, 0x41 ; 65 1d524: 0e 94 c6 6c call 0xd98c ; 0xd98c if(!MMU2::mmu2.Enabled()) { 1d528: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d52c: 81 30 cpi r24, 0x01 ; 1 1d52e: 09 f4 brne .+2 ; 0x1d532 1d530: 78 cf rjmp .-272 ; 0x1d422 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1d532: d0 92 5e 12 sts 0x125E, r13 ; 0x80125e 1d536: c0 92 5d 12 sts 0x125D, r12 ; 0x80125d //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)); 1d53a: 87 ee ldi r24, 0xE7 ; 231 1d53c: 91 e4 ldi r25, 0x41 ; 65 1d53e: 0e 94 0a 75 call 0xea14 ; 0xea14 1d542: 0e 94 9a de call 0x1bd34 ; 0x1bd34 wait_preheat(); 1d546: 0e 94 1b e2 call 0x1c436 ; 0x1c436 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 1d54a: 60 e0 ldi r22, 0x00 ; 0 1d54c: 70 e0 ldi r23, 0x00 ; 0 1d54e: cb 01 movw r24, r22 1d550: 0e 94 6f e1 call 0x1c2de ; 0x1c2de lcd_wizard_load(); // load filament 1d554: 0e 94 8c e9 call 0x1d318 ; 0x1d318 1d558: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1d55c: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d 1d560: 60 cf rjmp .-320 ; 0x1d422 1d562: d0 92 5e 12 sts 0x125E, r13 ; 0x80125e 1d566: c0 92 5d 12 sts 0x125D, r12 ; 0x80125d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1d56a: b0 92 5a 12 sts 0x125A, r11 ; 0x80125a 1d56e: a0 92 59 12 sts 0x1259, r10 ; 0x801259 #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); 1d572: 81 ed ldi r24, 0xD1 ; 209 1d574: 91 e4 ldi r25, 0x41 ; 65 1d576: 0e 94 0a 75 call 0xea14 ; 0xea14 1d57a: 41 e0 ldi r20, 0x01 ; 1 1d57c: 60 e0 ldi r22, 0x00 ; 0 1d57e: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1d582: 88 23 and r24, r24 1d584: 09 f1 breq .+66 ; 0x1d5c8 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 1d586: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d58a: c7 e0 ldi r28, 0x07 ; 7 1d58c: 81 30 cpi r24, 0x01 ; 1 1d58e: 09 f4 brne .+2 ; 0x1d592 1d590: 06 cf rjmp .-500 ; 0x1d39e else state = S::Preheat; 1d592: c6 e0 ldi r28, 0x06 ; 6 1d594: 04 cf rjmp .-504 ; 0x1d39e } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 1d596: 20 e0 ldi r18, 0x00 ; 0 1d598: 41 e0 ldi r20, 0x01 ; 1 1d59a: 70 e0 ldi r23, 0x00 ; 0 1d59c: 60 e0 ldi r22, 0x00 ; 0 1d59e: 8e e0 ldi r24, 0x0E ; 14 1d5a0: 98 e3 ldi r25, 0x38 ; 56 1d5a2: 0e 94 87 62 call 0xc50e ; 0xc50e lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 1d5a6: 80 e9 ldi r24, 0x90 ; 144 1d5a8: 91 e4 ldi r25, 0x41 ; 65 1d5aa: 0e 94 0a 75 call 0xea14 ; 0xea14 1d5ae: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 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); 1d5b2: 06 e0 ldi r16, 0x06 ; 6 1d5b4: 10 e0 ldi r17, 0x00 ; 0 1d5b6: 3f cf rjmp .-386 ; 0x1d436 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(); 1d5b8: 0e 94 1b e2 call 0x1c436 ; 0x1c436 lcd_wizard_load(); 1d5bc: 0e 94 8c e9 call 0x1d318 ; 0x1d318 state = S::Lay1CalHot; 1d5c0: ca e0 ldi r28, 0x0A ; 10 1d5c2: ed ce rjmp .-550 ; 0x1d39e break; case S::LoadFilCold: lcd_wizard_load(); 1d5c4: 0e 94 8c e9 call 0x1d318 ; 0x1d318 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; 1d5c8: c9 e0 ldi r28, 0x09 ; 9 1d5ca: e9 ce rjmp .-558 ; 0x1d39e case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 1d5cc: 81 e0 ldi r24, 0x01 ; 1 1d5ce: 0e 94 6e e9 call 0x1d2dc ; 0x1d2dc menu_goto(lcd_v2_calibration, 0, true); 1d5d2: 20 e0 ldi r18, 0x00 ; 0 1d5d4: 41 e0 ldi r20, 0x01 ; 1 1d5d6: 70 e0 ldi r23, 0x00 ; 0 1d5d8: 60 e0 ldi r22, 0x00 ; 0 1d5da: 87 e8 ldi r24, 0x87 ; 135 1d5dc: 97 ee ldi r25, 0xE7 ; 231 1d5de: 0e 94 87 62 call 0xc50e ; 0xc50e 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); 1d5e2: 09 e0 ldi r16, 0x09 ; 9 1d5e4: 10 e0 ldi r17, 0x00 ; 0 1d5e6: 27 cf rjmp .-434 ; 0x1d436 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); 1d5e8: 80 e0 ldi r24, 0x00 ; 0 1d5ea: 0e 94 6e e9 call 0x1d2dc ; 0x1d2dc lcd_commands_type = LcdCommands::Layer1Cal; 1d5ee: 84 e0 ldi r24, 0x04 ; 4 1d5f0: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e 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); 1d5f4: 0a e0 ldi r16, 0x0A ; 10 1d5f6: 10 e0 ldi r17, 0x00 ; 0 1d5f8: 1e cf rjmp .-452 ; 0x1d436 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); 1d5fa: 8d e3 ldi r24, 0x3D ; 61 1d5fc: 91 e4 ldi r25, 0x41 ; 65 1d5fe: 0e 94 0a 75 call 0xea14 ; 0xea14 1d602: 41 e0 ldi r20, 0x01 ; 1 1d604: 60 e0 ldi r22, 0x00 ; 0 1d606: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 1d60a: 81 11 cpse r24, r1 1d60c: 07 c0 rjmp .+14 ; 0x1d61c { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 1d60e: 8d e0 ldi r24, 0x0D ; 13 1d610: 91 e4 ldi r25, 0x41 ; 65 1d612: 0e 94 0a 75 call 0xea14 ; 0xea14 1d616: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 1d61a: d6 cf rjmp .-84 ; 0x1d5c8 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 1d61c: 87 ea ldi r24, 0xA7 ; 167 1d61e: 90 e4 ldi r25, 0x40 ; 64 1d620: ec ce rjmp .-552 ; 0x1d3fa 1d622: 60 e0 ldi r22, 0x00 ; 0 1d624: 8f e5 ldi r24, 0x5F ; 95 1d626: 9f e0 ldi r25, 0x0F ; 15 1d628: 0f 94 c1 a3 call 0x34782 ; 0x34782 1d62c: 04 cf rjmp .-504 ; 0x1d436 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 1d62e: 89 e4 ldi r24, 0x49 ; 73 1d630: 90 e4 ldi r25, 0x40 ; 64 1d632: 0e 94 0a 75 call 0xea14 ; 0xea14 1d636: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1d638: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 1d63c: 86 ee ldi r24, 0xE6 ; 230 1d63e: 9b e6 ldi r25, 0x6B ; 107 1d640: 0e 94 85 dc call 0x1b90a ; 0x1b90a lcd_return_to_status(); 1d644: 0f 94 6d 05 call 0x20ada ; 0x20ada default: // exiting for later re-entry break; } if (msg) { 1d648: 01 15 cp r16, r1 1d64a: 11 05 cpc r17, r1 1d64c: 09 f4 brne .+2 ; 0x1d650 1d64e: 0a cf rjmp .-492 ; 0x1d464 lcd_show_fullscreen_message_and_wait_P(msg); 1d650: c8 01 movw r24, r16 1d652: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 1d656: 06 cf rjmp .-500 ; 0x1d464 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 1d658: 87 ee ldi r24, 0xE7 ; 231 1d65a: 9f e3 ldi r25, 0x3F ; 63 1d65c: 0e 94 0a 75 call 0xea14 ; 0xea14 1d660: 8c 01 movw r16, r24 1d662: f2 cf rjmp .-28 ; 0x1d648 0001d664
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1d664: cf 93 push r28 1d666: df 93 push r29 1d668: 00 d0 rcall .+0 ; 0x1d66a 1d66a: 00 d0 rcall .+0 ; 0x1d66c 1d66c: 00 d0 rcall .+0 ; 0x1d66e 1d66e: 1f 92 push r1 1d670: cd b7 in r28, 0x3d ; 61 1d672: de b7 in r29, 0x3e ; 62 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1d674: 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); 1d676: 84 b5 in r24, 0x24 ; 36 1d678: 82 60 ori r24, 0x02 ; 2 1d67a: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1d67c: 84 b5 in r24, 0x24 ; 36 1d67e: 81 60 ori r24, 0x01 ; 1 1d680: 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); 1d682: 85 b5 in r24, 0x25 ; 37 1d684: 82 60 ori r24, 0x02 ; 2 1d686: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1d688: 85 b5 in r24, 0x25 ; 37 1d68a: 81 60 ori r24, 0x01 ; 1 1d68c: 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); 1d68e: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1d692: 81 60 ori r24, 0x01 ; 1 1d694: 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; 1d698: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1d69c: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1d6a0: 82 60 ori r24, 0x02 ; 2 1d6a2: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1d6a6: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1d6aa: 81 60 ori r24, 0x01 ; 1 1d6ac: 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); 1d6b0: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d6b4: 81 60 ori r24, 0x01 ; 1 1d6b6: 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); 1d6ba: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1d6be: 84 60 ori r24, 0x04 ; 4 1d6c0: 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); 1d6c4: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d6c8: 81 60 ori r24, 0x01 ; 1 1d6ca: 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 1d6ce: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1d6d2: 82 60 ori r24, 0x02 ; 2 1d6d4: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1d6d8: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1d6dc: 81 60 ori r24, 0x01 ; 1 1d6de: 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 1d6e2: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d6e6: 81 60 ori r24, 0x01 ; 1 1d6e8: 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 1d6ec: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1d6f0: 82 60 ori r24, 0x02 ; 2 1d6f2: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1d6f6: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1d6fa: 81 60 ori r24, 0x01 ; 1 1d6fc: 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 1d700: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d704: 81 60 ori r24, 0x01 ; 1 1d706: 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 1d70a: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1d70e: 82 60 ori r24, 0x02 ; 2 1d710: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1d714: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1d718: 81 60 ori r24, 0x01 ; 1 1d71a: 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 1d71e: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d722: 81 60 ori r24, 0x01 ; 1 1d724: 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); 1d728: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d72c: 84 60 ori r24, 0x04 ; 4 1d72e: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1d732: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d736: 82 60 ori r24, 0x02 ; 2 1d738: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1d73c: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d740: 81 60 ori r24, 0x01 ; 1 1d742: 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); 1d746: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d74a: 80 68 ori r24, 0x80 ; 128 1d74c: 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; 1d750: 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) { 1d754: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1d756: f8 94 cli wdt_reset(); 1d758: a8 95 wdr MCUSR &= ~_BV(WDRF); 1d75a: 84 b7 in r24, 0x34 ; 52 1d75c: 87 7f andi r24, 0xF7 ; 247 1d75e: 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" ); 1d760: 0f b6 in r0, 0x3f ; 63 1d762: f8 94 cli 1d764: a8 95 wdr 1d766: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d76a: 88 61 ori r24, 0x18 ; 24 1d76c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d770: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d774: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1d776: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1d778: 9f b7 in r25, 0x3f ; 63 1d77a: 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 1d77c: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1d780: 84 e0 ldi r24, 0x04 ; 4 1d782: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1d78a: 81 60 ori r24, 0x01 ; 1 1d78c: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1d794: 8d 7f andi r24, 0xFD ; 253 1d796: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1d79e: 8b 7f andi r24, 0xFB ; 251 1d7a0: 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; 1d7a4: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1d7a8: 9f bf out 0x3f, r25 ; 63 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1d7aa: 73 98 cbi 0x0e, 3 ; 14 SET_OUTPUT(LCD_PINS_RS); 1d7ac: 57 9a sbi 0x0a, 7 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1d7ae: 6b 9a sbi 0x0d, 3 ; 13 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); 1d7b0: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d7b4: 82 60 ori r24, 0x02 ; 2 1d7b6: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_OUTPUT(LCD_PINS_D5); 1d7ba: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d7be: 81 60 ori r24, 0x01 ; 1 1d7c0: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_OUTPUT(LCD_PINS_D6); 1d7c4: 3d 9a sbi 0x07, 5 ; 7 SET_OUTPUT(LCD_PINS_D7); 1d7c6: 3e 9a sbi 0x07, 6 ; 7 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1d7c8: 80 91 00 04 lds r24, 0x0400 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.513> 1d7cc: 88 60 ori r24, 0x08 ; 8 1d7ce: 80 93 00 04 sts 0x0400, r24 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.513> 1d7d2: 2f ef ldi r18, 0xFF ; 255 1d7d4: 30 e7 ldi r19, 0x70 ; 112 1d7d6: 82 e0 ldi r24, 0x02 ; 2 1d7d8: 21 50 subi r18, 0x01 ; 1 1d7da: 30 40 sbci r19, 0x00 ; 0 1d7dc: 80 40 sbci r24, 0x00 ; 0 1d7de: e1 f7 brne .-8 ; 0x1d7d8 1d7e0: 00 c0 rjmp .+0 ; 0x1d7e2 1d7e2: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1d7e4: 81 e0 ldi r24, 0x01 ; 1 1d7e6: 0e 94 2e 70 call 0xe05c ; 0xe05c fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1d7ea: 8b e3 ldi r24, 0x3B ; 59 1d7ec: 93 e7 ldi r25, 0x73 ; 115 1d7ee: 90 93 fb 03 sts 0x03FB, r25 ; 0x8003fb <_lcdout+0x9> 1d7f2: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa <_lcdout+0x8> 1d7f6: 10 92 fd 03 sts 0x03FD, r1 ; 0x8003fd <_lcdout+0xb> 1d7fa: 10 92 fc 03 sts 0x03FC, r1 ; 0x8003fc <_lcdout+0xa> 1d7fe: 12 e0 ldi r17, 0x02 ; 2 1d800: 10 93 f5 03 sts 0x03F5, r17 ; 0x8003f5 <_lcdout+0x3> 1d804: 10 92 ff 03 sts 0x03FF, r1 ; 0x8003ff <_lcdout+0xd> 1d808: 10 92 fe 03 sts 0x03FE, r1 ; 0x8003fe <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1d80c: 0e 94 6f 70 call 0xe0de ; 0xe0de lcd_longpress_func = menu_lcd_longpress_func; 1d810: 8c e5 ldi r24, 0x5C ; 92 1d812: 96 ec ldi r25, 0xC6 ; 198 1d814: 90 93 07 04 sts 0x0407, r25 ; 0x800407 1d818: 80 93 06 04 sts 0x0406, r24 ; 0x800406 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1d81c: 84 e7 ldi r24, 0x74 ; 116 1d81e: 98 ef ldi r25, 0xF8 ; 248 1d820: 90 93 05 04 sts 0x0405, r25 ; 0x800405 1d824: 80 93 04 04 sts 0x0404, r24 ; 0x800404 menu_menu = lcd_status_screen; 1d828: 86 ed ldi r24, 0xD6 ; 214 1d82a: 97 e3 ldi r25, 0x37 ; 55 1d82c: 90 93 03 04 sts 0x0403, r25 ; 0x800403 1d830: 80 93 02 04 sts 0x0402, r24 ; 0x800402 SET_INPUT(BTN_EN1); 1d834: 6f 98 cbi 0x0d, 7 ; 13 SET_INPUT(BTN_EN2); 1d836: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d83a: 87 7f andi r24, 0xF7 ; 247 1d83c: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1d840: 77 9a sbi 0x0e, 7 ; 14 WRITE(BTN_EN2, HIGH); 1d842: 9f b7 in r25, 0x3f ; 63 1d844: f8 94 cli 1d846: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d84a: 88 60 ori r24, 0x08 ; 8 1d84c: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d850: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1d852: 50 98 cbi 0x0a, 0 ; 10 WRITE(BTN_ENC, HIGH); 1d854: 58 9a sbi 0x0b, 0 ; 11 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1d856: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d85a: 8b 7f andi r24, 0xFB ; 251 1d85c: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1d860: 9f b7 in r25, 0x3f ; 63 1d862: f8 94 cli 1d864: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d868: 84 60 ori r24, 0x04 ; 4 1d86a: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d86e: 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); 1d870: af e9 ldi r26, 0x9F ; 159 1d872: bf e0 ldi r27, 0x0F ; 15 1d874: 11 97 sbiw r26, 0x01 ; 1 1d876: f1 f7 brne .-4 ; 0x1d874 1d878: 00 c0 rjmp .+0 ; 0x1d87a 1d87a: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1d87c: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d880: 01 e0 ldi r16, 0x01 ; 1 1d882: 82 fb bst r24, 2 1d884: 88 27 eor r24, r24 1d886: 80 f9 bld r24, 0 1d888: 80 27 eor r24, r16 1d88a: 80 93 01 04 sts 0x0401, r24 ; 0x800401 #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1d88e: 44 e1 ldi r20, 0x14 ; 20 1d890: 50 e0 ldi r21, 0x00 ; 0 1d892: 66 ee ldi r22, 0xE6 ; 230 1d894: 7b e6 ldi r23, 0x6B ; 107 1d896: 85 e6 ldi r24, 0x65 ; 101 1d898: 94 e0 ldi r25, 0x04 ; 4 1d89a: 0f 94 8a a1 call 0x34314 ; 0x34314 extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1d89e: 84 b1 in r24, 0x04 ; 4 1d8a0: 81 7f andi r24, 0xF1 ; 241 1d8a2: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 1d8a4: 84 b1 in r24, 0x04 ; 4 1d8a6: 87 60 ori r24, 0x07 ; 7 1d8a8: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1d8aa: 85 b1 in r24, 0x05 ; 5 1d8ac: 81 7f andi r24, 0xF1 ; 241 1d8ae: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 1d8b0: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 1d8b2: 80 e5 ldi r24, 0x50 ; 80 1d8b4: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 1d8b6: 1d bc out 0x2d, r1 ; 45 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1d8b8: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1d8bc: 8e e5 ldi r24, 0x5E ; 94 1d8be: 96 e8 ldi r25, 0x86 ; 134 1d8c0: 9f 93 push r25 1d8c2: 8f 93 push r24 1d8c4: 85 e6 ldi r24, 0x65 ; 101 1d8c6: 96 e8 ldi r25, 0x86 ; 134 1d8c8: 9f 93 push r25 1d8ca: 8f 93 push r24 1d8cc: 0e 94 db 6e call 0xddb6 ; 0xddb6 static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1d8d0: 6a 9a sbi 0x0d, 2 ; 13 eSoundMode = static_cast(eeprom_init_default_byte((uint8_t*)EEPROM_SOUND_MODE, e_SOUND_MODE_DEFAULT)); 1d8d2: 60 e0 ldi r22, 0x00 ; 0 1d8d4: 87 ed ldi r24, 0xD7 ; 215 1d8d6: 9e e0 ldi r25, 0x0E ; 14 1d8d8: 0e 94 2d 78 call 0xf05a ; 0xf05a 1d8dc: 80 93 47 04 sts 0x0447, r24 ; 0x800447 spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1d8e0: 60 e0 ldi r22, 0x00 ; 0 1d8e2: 88 e0 ldi r24, 0x08 ; 8 1d8e4: 9f e0 ldi r25, 0x0F ; 15 1d8e6: 0e 94 2d 78 call 0xf05a ; 0xf05a 1d8ea: 80 93 1c 06 sts 0x061C, r24 ; 0x80061c MYSERIAL.begin(BAUDRATE); 1d8ee: 0f 94 b8 8f call 0x31f70 ; 0x31f70 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1d8f2: 8f e8 ldi r24, 0x8F ; 143 1d8f4: 9a e7 ldi r25, 0x7A ; 122 1d8f6: 90 93 59 04 sts 0x0459, r25 ; 0x800459 <_uartout+0x9> 1d8fa: 80 93 58 04 sts 0x0458, r24 ; 0x800458 <_uartout+0x8> 1d8fe: 10 92 5b 04 sts 0x045B, r1 ; 0x80045b <_uartout+0xb> 1d902: 10 92 5a 04 sts 0x045A, r1 ; 0x80045a <_uartout+0xa> 1d906: 10 93 53 04 sts 0x0453, r17 ; 0x800453 <_uartout+0x3> 1d90a: 10 92 5d 04 sts 0x045D, r1 ; 0x80045d <_uartout+0xd> 1d90e: 10 92 5c 04 sts 0x045C, r1 ; 0x80045c <_uartout+0xc> stdout = uartout; 1d912: 80 e5 ldi r24, 0x50 ; 80 1d914: 94 e0 ldi r25, 0x04 ; 4 1d916: 90 93 14 17 sts 0x1714, r25 ; 0x801714 <__iob+0x3> 1d91a: 80 93 13 17 sts 0x1713, r24 ; 0x801713 <__iob+0x2> void prusa_statistics_update_from_lcd_update() { lcd_send_status(); } void farm_mode_init() { farm_mode = eeprom_init_default_byte((uint8_t*)EEPROM_FARM_MODE, 0); 1d91e: 60 e0 ldi r22, 0x00 ; 0 1d920: 84 ec ldi r24, 0xC4 ; 196 1d922: 9f e0 ldi r25, 0x0F ; 15 1d924: 0e 94 2d 78 call 0xf05a ; 0xf05a 1d928: 80 93 60 0d sts 0x0D60, r24 ; 0x800d60 if (farm_mode) { 1d92c: 0f 90 pop r0 1d92e: 0f 90 pop r0 1d930: 0f 90 pop r0 1d932: 0f 90 pop r0 1d934: 88 23 and r24, r24 1d936: 71 f0 breq .+28 ; 0x1d954 no_response = true; //we need confirmation by recieving PRUSA thx 1d938: 00 93 08 04 sts 0x0408, r16 ; 0x800408 <_ZL11no_response.lto_priv.493> prusa_statistics(8); 1d93c: 88 e0 ldi r24, 0x08 ; 8 1d93e: 0f 94 02 30 call 0x26004 ; 0x26004 #ifdef HAS_SECOND_SERIAL_PORT selectedSerialPort = 1; #endif //HAS_SECOND_SERIAL_PORT MYSERIAL.begin(BAUDRATE); 1d942: 0f 94 b8 8f call 0x31f70 ; 0x31f70 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1d946: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 1d94a: 61 e0 ldi r22, 0x01 ; 1 1d94c: 87 e8 ldi r24, 0x87 ; 135 1d94e: 9f e0 ldi r25, 0x0F ; 15 1d950: 0f 94 c1 a3 call 0x34782 ; 0x34782 } #endif //PRUSA_SN_SUPPORT #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); 1d954: 86 e5 ldi r24, 0x56 ; 86 1d956: 97 e8 ldi r25, 0x87 ; 135 1d958: 0e 94 8d 7c call 0xf91a ; 0xf91a #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) SERIAL_PROTOCOLLNPGM("start"); #endif SERIAL_ECHO_START; 1d95c: 8e ec ldi r24, 0xCE ; 206 1d95e: 91 ea ldi r25, 0xA1 ; 161 1d960: 0e 94 94 7a call 0xf528 ; 0xf528 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1d964: 8f e3 ldi r24, 0x3F ; 63 1d966: 97 e8 ldi r25, 0x87 ; 135 1d968: 0f 94 86 a2 call 0x3450c ; 0x3450c // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1d96c: 60 e0 ldi r22, 0x00 ; 0 1d96e: 8c ea ldi r24, 0xAC ; 172 1d970: 9c e0 ldi r25, 0x0C ; 12 1d972: 0e 94 2d 78 call 0xf05a ; 0xf05a 1d976: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1d978: 0f 94 3d 95 call 0x32a7a ; 0x32a7a } MMU2::mmu2.Status(); 1d97c: 0f 94 85 65 call 0x2cb0a ; 0x2cb0a } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1d980: 83 e9 ldi r24, 0x93 ; 147 1d982: 96 e8 ldi r25, 0x86 ; 134 1d984: 0e 94 94 7a call 0xf528 ; 0xf528 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1d988: 62 e0 ldi r22, 0x02 ; 2 1d98a: 86 ed ldi r24, 0xD6 ; 214 1d98c: 9e e0 ldi r25, 0x0E ; 14 1d98e: 0e 94 2d 78 call 0xf05a ; 0xf05a if (status == (uint8_t)EEPROM::Enabled) 1d992: 81 30 cpi r24, 0x01 ; 1 1d994: 09 f0 breq .+2 ; 0x1d998 1d996: 74 c0 rjmp .+232 ; 0x1da80 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1d998: 8c e9 ldi r24, 0x9C ; 156 1d99a: 92 e6 ldi r25, 0x62 ; 98 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1d99c: 0e 94 8d 7c call 0xf91a ; 0xf91a #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1d9a0: 14 b7 in r17, 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); 1d9a2: 10 ff sbrs r17, 0 1d9a4: 04 c0 rjmp .+8 ; 0x1d9ae 1d9a6: 8c eb ldi r24, 0xBC ; 188 1d9a8: 99 e6 ldi r25, 0x69 ; 105 1d9aa: 0f 94 86 a2 call 0x3450c ; 0x3450c if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1d9ae: 11 ff sbrs r17, 1 1d9b0: 04 c0 rjmp .+8 ; 0x1d9ba 1d9b2: 8c ea ldi r24, 0xAC ; 172 1d9b4: 99 e6 ldi r25, 0x69 ; 105 1d9b6: 0f 94 86 a2 call 0x3450c ; 0x3450c if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1d9ba: 12 ff sbrs r17, 2 1d9bc: 04 c0 rjmp .+8 ; 0x1d9c6 1d9be: 8b e9 ldi r24, 0x9B ; 155 1d9c0: 99 e6 ldi r25, 0x69 ; 105 1d9c2: 0f 94 86 a2 call 0x3450c ; 0x3450c if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1d9c6: 13 ff sbrs r17, 3 1d9c8: 04 c0 rjmp .+8 ; 0x1d9d2 1d9ca: 8b e8 ldi r24, 0x8B ; 139 1d9cc: 99 e6 ldi r25, 0x69 ; 105 1d9ce: 0f 94 86 a2 call 0x3450c ; 0x3450c if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1d9d2: 15 ff sbrs r17, 5 1d9d4: 04 c0 rjmp .+8 ; 0x1d9de 1d9d6: 8b e7 ldi r24, 0x7B ; 123 1d9d8: 99 e6 ldi r25, 0x69 ; 105 1d9da: 0f 94 86 a2 call 0x3450c ; 0x3450c MCUSR = 0; 1d9de: 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; 1d9e0: 8e ec ldi r24, 0xCE ; 206 1d9e2: 91 ea ldi r25, 0xA1 ; 161 1d9e4: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1d9e8: 8b e6 ldi r24, 0x6B ; 107 1d9ea: 99 e6 ldi r25, 0x69 ; 105 1d9ec: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1d9f0: 8b e2 ldi r24, 0x2B ; 43 1d9f2: 97 e8 ldi r25, 0x87 ; 135 1d9f4: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1d9f8: 8f e5 ldi r24, 0x5F ; 95 1d9fa: 99 e6 ldi r25, 0x69 ; 105 1d9fc: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1da00: 83 e2 ldi r24, 0x23 ; 35 1da02: 97 e8 ldi r25, 0x87 ; 135 1da04: 0e 94 8d 7c call 0xf91a ; 0xf91a #endif #endif SERIAL_ECHO_START; 1da08: 8e ec ldi r24, 0xCE ; 206 1da0a: 91 ea ldi r25, 0xA1 ; 161 1da0c: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1da10: 80 e5 ldi r24, 0x50 ; 80 1da12: 99 e6 ldi r25, 0x69 ; 105 1da14: 0e 94 94 7a call 0xf528 ; 0xf528 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1da18: 80 91 0d 17 lds r24, 0x170D ; 0x80170d <__brkval> 1da1c: 90 91 0e 17 lds r25, 0x170E ; 0x80170e <__brkval+0x1> 1da20: fe 01 movw r30, r28 1da22: 31 96 adiw r30, 0x01 ; 1 1da24: 7f 01 movw r14, r30 1da26: bf 01 movw r22, r30 1da28: 00 97 sbiw r24, 0x00 ; 0 1da2a: 69 f1 breq .+90 ; 0x1da86 1da2c: 68 1b sub r22, r24 1da2e: 79 0b sbc r23, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1da30: 07 2e mov r0, r23 1da32: 00 0c add r0, r0 1da34: 88 0b sbc r24, r24 1da36: 99 0b sbc r25, r25 1da38: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1da3c: 89 e3 ldi r24, 0x39 ; 57 1da3e: 99 e6 ldi r25, 0x69 ; 105 1da40: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1da44: 80 ee ldi r24, 0xE0 ; 224 1da46: 96 e0 ldi r25, 0x06 ; 6 1da48: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e #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); 1da4c: 6a ef ldi r22, 0xFA ; 250 1da4e: 70 e0 ldi r23, 0x00 ; 0 1da50: 8e ee ldi r24, 0xEE ; 238 1da52: 9e e0 ldi r25, 0x0E ; 14 1da54: 0e 94 15 78 call 0xf02a ; 0xf02a 1da58: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1da5a: 68 ec ldi r22, 0xC8 ; 200 1da5c: 70 e0 ldi r23, 0x00 ; 0 1da5e: 8c ee ldi r24, 0xEC ; 236 1da60: 9e e0 ldi r25, 0x0E ; 14 1da62: 0e 94 15 78 call 0xf02a ; 0xf02a if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1da66: 0a 3f cpi r16, 0xFA ; 250 1da68: 11 05 cpc r17, r1 1da6a: 09 f0 breq .+2 ; 0x1da6e 1da6c: 09 c6 rjmp .+3090 ; 0x1e680 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1da6e: 01 e0 ldi r16, 0x01 ; 1 1da70: 88 3c cpi r24, 0xC8 ; 200 1da72: 91 05 cpc r25, r1 1da74: 09 f4 brne .+2 ; 0x1da78 1da76: 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(); 1da78: 0e 94 f5 84 call 0x109ea ; 0x109ea 1da7c: b8 2e mov r11, r24 1da7e: 08 c6 rjmp .+3088 ; 0x1e690 1da80: 86 e9 ldi r24, 0x96 ; 150 1da82: 92 e6 ldi r25, 0x62 ; 98 1da84: 8b cf rjmp .-234 ; 0x1d99c 1da86: 67 51 subi r22, 0x17 ; 23 1da88: 77 41 sbci r23, 0x17 ; 23 1da8a: d2 cf rjmp .-92 ; 0x1da30 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1da8c: 81 e3 ldi r24, 0x31 ; 49 1da8e: 91 e0 ldi r25, 0x01 ; 1 1da90: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL8maxttemp.lto_priv.437+0x1> 1da94: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL8maxttemp.lto_priv.437> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1da98: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.431> 1da9c: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.431+0x1> 1daa0: 0f 94 23 8f call 0x31e46 ; 0x31e46 1daa4: 20 e0 ldi r18, 0x00 ; 0 1daa6: 30 e8 ldi r19, 0x80 ; 128 1daa8: 48 e9 ldi r20, 0x98 ; 152 1daaa: 53 e4 ldi r21, 0x43 ; 67 1daac: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1dab0: 18 16 cp r1, r24 1dab2: 54 f4 brge .+20 ; 0x1dac8 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1dab4: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.431> 1dab8: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.431+0x1> 1dabc: 40 96 adiw r24, 0x10 ; 16 1dabe: 90 93 0c 04 sts 0x040C, r25 ; 0x80040c <_ZL12maxttemp_raw.lto_priv.431+0x1> 1dac2: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b <_ZL12maxttemp_raw.lto_priv.431> 1dac6: e8 cf rjmp .-48 ; 0x1da98 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1dac8: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.429> 1dacc: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.429+0x1> 1dad0: 0f 94 f6 11 call 0x223ec ; 0x223ec 1dad4: 20 e0 ldi r18, 0x00 ; 0 1dad6: 30 e0 ldi r19, 0x00 ; 0 1dad8: 40 ef ldi r20, 0xF0 ; 240 1dada: 51 e4 ldi r21, 0x41 ; 65 1dadc: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1dae0: 87 ff sbrs r24, 7 1dae2: 0a c0 rjmp .+20 ; 0x1daf8 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1dae4: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.429> 1dae8: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.429+0x1> 1daec: 40 97 sbiw r24, 0x10 ; 16 1daee: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.429+0x1> 1daf2: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.429> 1daf6: e8 cf rjmp .-48 ; 0x1dac8 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1daf8: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.432> 1dafc: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.432+0x1> 1db00: 0f 94 f6 11 call 0x223ec ; 0x223ec 1db04: 20 e0 ldi r18, 0x00 ; 0 1db06: 30 e0 ldi r19, 0x00 ; 0 1db08: 4a ef ldi r20, 0xFA ; 250 1db0a: 52 e4 ldi r21, 0x42 ; 66 1db0c: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1db10: 18 16 cp r1, r24 1db12: 54 f4 brge .+20 ; 0x1db28 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1db14: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.432> 1db18: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.432+0x1> 1db1c: 40 96 adiw r24, 0x10 ; 16 1db1e: 90 93 0a 04 sts 0x040A, r25 ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.432+0x1> 1db22: 80 93 09 04 sts 0x0409, r24 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.432> 1db26: e8 cf rjmp .-48 ; 0x1daf8 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1db28: 9f b7 in r25, 0x3f ; 63 1db2a: f8 94 cli TCNT0 = 0; 1db2c: 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; 1db2e: 8f ef ldi r24, 0xFF ; 255 1db30: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1db32: 83 e3 ldi r24, 0x33 ; 51 1db34: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1db36: 12 e0 ldi r17, 0x02 ; 2 1db38: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1db3a: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1db3e: 81 60 ori r24, 0x01 ; 1 1db40: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1db44: 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; 1db46: 80 e8 ldi r24, 0x80 ; 128 1db48: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1db4c: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1db50: 84 60 ori r24, 0x04 ; 4 1db52: 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; 1db56: 2f b7 in r18, 0x3f ; 63 1db58: f8 94 cli SET_OUTPUT(BEEPER); 1db5a: 6a 9a sbi 0x0d, 2 ; 13 WRITE(BEEPER, LOW); 1db5c: 72 98 cbi 0x0e, 2 ; 14 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1db5e: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1db62: 80 62 ori r24, 0x20 ; 32 1db64: 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); 1db68: 81 e0 ldi r24, 0x01 ; 1 1db6a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1db6e: 85 e1 ldi r24, 0x15 ; 21 1db70: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1db74: 8f ef ldi r24, 0xFF ; 255 1db76: 90 e0 ldi r25, 0x00 ; 0 1db78: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1db7c: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1db80: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1db84: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1db88: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1db8c: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1db90: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1db94: 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")); 1db96: 81 ea ldi r24, 0xA1 ; 161 1db98: 96 e8 ldi r25, 0x86 ; 134 1db9a: 0f 94 86 a2 call 0x3450c ; 0x3450c DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1db9e: 8f e5 ldi r24, 0x5F ; 95 1dba0: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1dba4: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1dba8: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1dbac: 80 64 ori r24, 0x40 ; 64 1dbae: 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); 1dbb2: 8f e9 ldi r24, 0x9F ; 159 1dbb4: 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(); 1dbb8: 0e 94 c0 ba call 0x17580 ; 0x17580 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1dbbc: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1dbbe: f8 94 cli // CTC TCCRxB &= ~(1< 1dbc4: 8f 7e andi r24, 0xEF ; 239 1dbc6: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB |= (1< 1dbce: 88 60 ori r24, 0x08 ; 8 1dbd0: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxA &= ~(1< 1dbd8: 8d 7f andi r24, 0xFD ; 253 1dbda: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(1< 1dbe2: 8e 7f andi r24, 0xFE ; 254 1dbe4: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1dbec: 8f 73 andi r24, 0x3F ; 63 1dbee: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(3< 1dbf6: 8f 7c andi r24, 0xCF ; 207 1dbf8: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // x/256 prescaler TCCRxB |= (1< 1dc00: 84 60 ori r24, 0x04 ; 4 1dc02: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1dc0a: 8d 7f andi r24, 0xFD ; 253 1dc0c: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1dc14: 8e 7f andi r24, 0xFE ; 254 1dc16: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> // reset counter TCNTx = 0; 1dc1a: 10 92 95 00 sts 0x0095, r1 ; 0x800095 <__TEXT_REGION_LENGTH__+0x7c2095> 1dc1e: 10 92 94 00 sts 0x0094, r1 ; 0x800094 <__TEXT_REGION_LENGTH__+0x7c2094> OCRxA = TEMP_TIM_OCRA_OVF; 1dc22: 2b ee ldi r18, 0xEB ; 235 1dc24: 31 e4 ldi r19, 0x41 ; 65 1dc26: 30 93 99 00 sts 0x0099, r19 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1dc2a: 20 93 98 00 sts 0x0098, r18 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1dc2e: c1 9a sbi 0x18, 1 ; 24 ENABLE_TEMP_MGR_INTERRUPT(); 1dc30: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1dc34: 82 60 ori r24, 0x02 ; 2 1dc36: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1dc3a: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1dc3c: 10 92 3e 0d sts 0x0D3E, r1 ; 0x800d3e block_buffer_tail = 0; 1dc40: 10 92 3f 0d sts 0x0D3F, r1 ; 0x800d3f memset(position, 0, sizeof(position)); // clear position 1dc44: 80 e1 ldi r24, 0x10 ; 16 1dc46: ec e3 ldi r30, 0x3C ; 60 1dc48: f6 e0 ldi r31, 0x06 ; 6 1dc4a: df 01 movw r26, r30 1dc4c: 28 2f mov r18, r24 1dc4e: 1d 92 st X+, r1 1dc50: 2a 95 dec r18 1dc52: e9 f7 brne .-6 ; 0x1dc4e #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1dc54: e6 e3 ldi r30, 0x36 ; 54 1dc56: f4 e0 ldi r31, 0x04 ; 4 1dc58: df 01 movw r26, r30 1dc5a: 28 2f mov r18, r24 1dc5c: 1d 92 st X+, r1 1dc5e: 2a 95 dec r18 1dc60: e9 f7 brne .-6 ; 0x1dc5c #endif memset(previous_speed, 0, sizeof(previous_speed)); 1dc62: e6 e2 ldi r30, 0x26 ; 38 1dc64: f4 e0 ldi r31, 0x04 ; 4 1dc66: df 01 movw r26, r30 1dc68: 1d 92 st X+, r1 1dc6a: 8a 95 dec r24 1dc6c: e9 f7 brne .-6 ; 0x1dc68 previous_nominal_speed = 0.0; 1dc6e: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.446> 1dc72: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.446+0x1> 1dc76: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.446+0x2> 1dc7a: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.446+0x3> plan_reset_next_e_queue = false; 1dc7e: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.444> plan_reset_next_e_sched = false; 1dc82: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.445> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1dc86: 84 e0 ldi r24, 0x04 ; 4 1dc88: 80 93 78 02 sts 0x0278, r24 ; 0x800278 if (!READ(BTN_ENC)) 1dc8c: 48 99 sbic 0x09, 0 ; 9 1dc8e: b0 c0 rjmp .+352 ; 0x1ddf0 1dc90: bf ef ldi r27, 0xFF ; 255 1dc92: e3 ed ldi r30, 0xD3 ; 211 1dc94: f0 e3 ldi r31, 0x30 ; 48 1dc96: b1 50 subi r27, 0x01 ; 1 1dc98: e0 40 sbci r30, 0x00 ; 0 1dc9a: f0 40 sbci r31, 0x00 ; 0 1dc9c: e1 f7 brne .-8 ; 0x1dc96 1dc9e: 00 c0 rjmp .+0 ; 0x1dca0 1dca0: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1dca2: 48 99 sbic 0x09, 0 ; 9 1dca4: a5 c0 rjmp .+330 ; 0x1ddf0 { lcd_clear(); 1dca6: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_P(PSTR("Factory RESET")); 1dcaa: 8b ef ldi r24, 0xFB ; 251 1dcac: 96 e8 ldi r25, 0x86 ; 134 1dcae: 0e 94 ed 6e call 0xddda ; 0xddda SET_OUTPUT(BEEPER); 1dcb2: 6a 9a sbi 0x0d, 2 ; 13 if(eSoundMode!=e_SOUND_MODE_SILENT) 1dcb4: 80 91 47 04 lds r24, 0x0447 ; 0x800447 1dcb8: 82 30 cpi r24, 0x02 ; 2 1dcba: 09 f0 breq .+2 ; 0x1dcbe WRITE(BEEPER, HIGH); 1dcbc: 72 9a sbi 0x0e, 2 ; 14 while (!READ(BTN_ENC)); 1dcbe: 48 9b sbis 0x09, 0 ; 9 1dcc0: fe cf rjmp .-4 ; 0x1dcbe WRITE(BEEPER, LOW); 1dcc2: 72 98 cbi 0x0e, 2 ; 14 1dcc4: 2f ef ldi r18, 0xFF ; 255 1dcc6: 37 ea ldi r19, 0xA7 ; 167 1dcc8: 81 e6 ldi r24, 0x61 ; 97 1dcca: 21 50 subi r18, 0x01 ; 1 1dccc: 30 40 sbci r19, 0x00 ; 0 1dcce: 80 40 sbci r24, 0x00 ; 0 1dcd0: e1 f7 brne .-8 ; 0x1dcca 1dcd2: 00 c0 rjmp .+0 ; 0x1dcd4 1dcd4: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1dcd6: 81 ee ldi r24, 0xE1 ; 225 1dcd8: 96 e8 ldi r25, 0x86 ; 134 1dcda: 9a 83 std Y+2, r25 ; 0x02 1dcdc: 89 83 std Y+1, r24 ; 0x01 1dcde: 86 ed ldi r24, 0xD6 ; 214 1dce0: 96 e8 ldi r25, 0x86 ; 134 1dce2: 9c 83 std Y+4, r25 ; 0x04 1dce4: 8b 83 std Y+3, r24 ; 0x03 1dce6: 88 ec ldi r24, 0xC8 ; 200 1dce8: 96 e8 ldi r25, 0x86 ; 134 1dcea: 9e 83 std Y+6, r25 ; 0x06 1dcec: 8d 83 std Y+5, r24 ; 0x05 1dcee: 8b eb ldi r24, 0xBB ; 187 1dcf0: 96 e8 ldi r25, 0x86 ; 134 1dcf2: 98 87 std Y+8, r25 ; 0x08 1dcf4: 8f 83 std Y+7, r24 ; 0x07 1dcf6: 82 eb ldi r24, 0xB2 ; 178 1dcf8: 96 e8 ldi r25, 0x86 ; 134 1dcfa: 9a 87 std Y+10, r25 ; 0x0a 1dcfc: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1dcfe: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_putc_at(0, 0, '>'); 1dd02: 4e e3 ldi r20, 0x3E ; 62 1dd04: 60 e0 ldi r22, 0x00 ; 0 1dd06: 80 e0 ldi r24, 0x00 ; 0 1dd08: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_consume_click(); 1dd0c: 0e 94 40 73 call 0xe680 ; 0xe680 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1dd10: 10 e0 ldi r17, 0x00 ; 0 1dd12: d1 2c mov r13, r1 1dd14: 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]); 1dd16: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1dd1a: f6 01 movw r30, r12 1dd1c: e8 0f add r30, r24 1dd1e: f1 1d adc r31, r1 1dd20: 87 fd sbrc r24, 7 1dd22: fa 95 dec r31 1dd24: ee 0f add r30, r30 1dd26: ff 1f adc r31, r31 1dd28: ee 0d add r30, r14 1dd2a: ff 1d adc r31, r15 1dd2c: 40 81 ld r20, Z 1dd2e: 51 81 ldd r21, Z+1 ; 0x01 1dd30: 6c 2d mov r22, r12 1dd32: 81 e0 ldi r24, 0x01 ; 1 1dd34: 0e 94 d7 6f call 0xdfae ; 0xdfae 1dd38: 9f ef ldi r25, 0xFF ; 255 1dd3a: c9 1a sub r12, r25 1dd3c: d9 0a sbc r13, r25 lcd_clear(); lcd_putc_at(0, 0, '>'); lcd_consume_click(); while (1) { for (uint_least8_t i = 0; i < 4; i++) { 1dd3e: a4 e0 ldi r26, 0x04 ; 4 1dd40: ca 16 cp r12, r26 1dd42: d1 04 cpc r13, r1 1dd44: 41 f7 brne .-48 ; 0x1dd16 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1dd46: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1dd4a: 81 e0 ldi r24, 0x01 ; 1 1dd4c: 0e 94 25 8a call 0x1144a ; 0x1144a if (lcd_encoder) { 1dd50: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1dd54: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1dd58: 00 97 sbiw r24, 0x00 ; 0 1dd5a: 71 f1 breq .+92 ; 0x1ddb8 if (lcd_encoder < 0) { 1dd5c: 97 ff sbrs r25, 7 1dd5e: 12 c0 rjmp .+36 ; 0x1dd84 cursor_pos--; 1dd60: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1dd62: 14 30 cpi r17, 0x04 ; 4 1dd64: 0c f4 brge .+2 ; 0x1dd68 1dd66: 3a c2 rjmp .+1140 ; 0x1e1dc cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1dd68: 87 e0 ldi r24, 0x07 ; 7 1dd6a: 0f 94 62 23 call 0x246c4 ; 0x246c4 if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1dd6e: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1dd72: 18 16 cp r1, r24 1dd74: 2c f0 brlt .+10 ; 0x1dd80 first++; 1dd76: 8f 5f subi r24, 0xFF ; 255 1dd78: 80 93 46 04 sts 0x0446, r24 ; 0x800446 lcd_clear(); 1dd7c: 0e 94 f6 6f call 0xdfec ; 0xdfec if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1dd80: 13 e0 ldi r17, 0x03 ; 3 1dd82: 03 c0 rjmp .+6 ; 0x1dd8a if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1dd84: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1dd86: 14 30 cpi r17, 0x04 ; 4 1dd88: 78 f7 brcc .-34 ; 0x1dd68 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1dd8a: 4a ea ldi r20, 0xAA ; 170 1dd8c: 56 e8 ldi r21, 0x86 ; 134 1dd8e: 60 e0 ldi r22, 0x00 ; 0 1dd90: 80 e0 ldi r24, 0x00 ; 0 1dd92: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(0, cursor_pos); 1dd96: 61 2f mov r22, r17 1dd98: 80 e0 ldi r24, 0x00 ; 0 1dd9a: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_putc('>'); 1dd9e: 8e e3 ldi r24, 0x3E ; 62 1dda0: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_encoder = 0; 1dda4: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1dda8: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e _delay(100); 1ddac: 64 e6 ldi r22, 0x64 ; 100 1ddae: 70 e0 ldi r23, 0x00 ; 0 1ddb0: 80 e0 ldi r24, 0x00 ; 0 1ddb2: 90 e0 ldi r25, 0x00 ; 0 1ddb4: 0f 94 23 0b call 0x21646 ; 0x21646 } if (lcd_clicked()) { 1ddb8: 0e 94 45 73 call 0xe68a ; 0xe68a 1ddbc: 88 23 and r24, r24 1ddbe: 09 f4 brne .+2 ; 0x1ddc2 1ddc0: a8 cf rjmp .-176 ; 0x1dd12 return(cursor_pos + first); 1ddc2: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1ddc6: 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(); 1ddc8: 0e 94 f6 6f call 0xdfec ; 0xdfec Sound_MakeCustom(100,0,false); 1ddcc: 40 e0 ldi r20, 0x00 ; 0 1ddce: 70 e0 ldi r23, 0x00 ; 0 1ddd0: 60 e0 ldi r22, 0x00 ; 0 1ddd2: 84 e6 ldi r24, 0x64 ; 100 1ddd4: 90 e0 ldi r25, 0x00 ; 0 1ddd6: 0f 94 55 25 call 0x24aaa ; 0x24aaa switch (level) { 1ddda: 12 30 cpi r17, 0x02 ; 2 1dddc: 09 f4 brne .+2 ; 0x1dde0 1ddde: 35 c2 rjmp .+1130 ; 0x1e24a 1dde0: 08 f0 brcs .+2 ; 0x1dde4 1dde2: 0d c2 rjmp .+1050 ; 0x1e1fe 1dde4: 11 23 and r17, r17 1dde6: 09 f4 brne .+2 ; 0x1ddea 1dde8: 28 c2 rjmp .+1104 ; 0x1e23a 1ddea: 11 30 cpi r17, 0x01 ; 1 1ddec: 09 f4 brne .+2 ; 0x1ddf0 1ddee: 28 c2 rjmp .+1104 ; 0x1e240 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1ddf0: 82 e0 ldi r24, 0x02 ; 2 1ddf2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 plan_init(); // Initialize planner; factory_reset(); eeprom_init_default_byte((uint8_t*)EEPROM_SILENT, SILENT_MODE_OFF); 1ddf6: 60 e0 ldi r22, 0x00 ; 0 1ddf8: 8f ef ldi r24, 0xFF ; 255 1ddfa: 9f e0 ldi r25, 0x0F ; 15 1ddfc: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1de00: 61 e0 ldi r22, 0x01 ; 1 1de02: 8f e5 ldi r24, 0x5F ; 95 1de04: 9f e0 ldi r25, 0x0F ; 15 1de06: 0e 94 2d 78 call 0xf05a ; 0xf05a void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); #else st_current_init(); //Initialize Digipot Motor Current 1de0a: 0f 94 39 18 call 0x23072 ; 0x23072 SET_OUTPUT(E1_MS1_PIN); SET_OUTPUT(E1_MS2_PIN); #endif #if defined(X_MS1_PIN) && X_MS1_PIN > -1 const uint8_t microstep_modes[] = MICROSTEP_MODES; 1de0e: 85 e0 ldi r24, 0x05 ; 5 1de10: e8 eb ldi r30, 0xB8 ; 184 1de12: f2 e0 ldi r31, 0x02 ; 2 1de14: d7 01 movw r26, r14 1de16: 01 90 ld r0, Z+ 1de18: 0d 92 st X+, r0 1de1a: 8a 95 dec r24 1de1c: e1 f7 brne .-8 ; 0x1de16 SET_OUTPUT(X_MS1_PIN); 1de1e: 99 9a sbi 0x13, 1 ; 19 SET_OUTPUT(X_MS2_PIN); 1de20: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_MS1_PIN); 1de22: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de26: 80 68 ori r24, 0x80 ; 128 1de28: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Y_MS2_PIN); 1de2c: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_MS1_PIN); 1de2e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de32: 80 64 ori r24, 0x40 ; 64 1de34: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Z_MS2_PIN); 1de38: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de3c: 80 62 ori r24, 0x20 ; 32 1de3e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS1_PIN); 1de42: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de46: 88 60 ori r24, 0x08 ; 8 1de48: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS2_PIN); 1de4c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de50: 80 61 ori r24, 0x10 ; 16 1de52: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de56: 67 01 movw r12, r14 1de58: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]); 1de5a: f6 01 movw r30, r12 1de5c: 61 91 ld r22, Z+ 1de5e: 6f 01 movw r12, r30 1de60: 81 2f mov r24, r17 1de62: 0f 94 fc 17 call 0x22ff8 ; 0x22ff8 1de66: 1f 5f subi r17, 0xFF ; 255 1de68: 15 30 cpi r17, 0x05 ; 5 1de6a: b9 f7 brne .-18 ; 0x1de5a microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1de6c: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de70: 82 60 ori r24, 0x02 ; 2 1de72: 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); 1de76: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de7a: 81 60 ori r24, 0x01 ; 1 1de7c: 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); 1de80: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de84: 84 60 ori r24, 0x04 ; 4 1de86: 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); 1de8a: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de8e: 80 64 ori r24, 0x40 ; 64 1de90: 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); 1de94: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1de96: 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); 1de98: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 1de9a: 16 9a sbi 0x02, 6 ; 2 #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 1de9c: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 1de9e: 15 9a sbi 0x02, 5 ; 2 #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 1dea0: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 1dea2: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 1dea4: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 1dea6: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 1dea8: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 1deaa: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 1deac: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 1deae: 2c 9a sbi 0x05, 4 ; 5 WRITE(Y_MAX_PIN,HIGH); #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 1deb0: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 1deb2: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 1deb4: 3f 98 cbi 0x07, 7 ; 7 #ifdef TACH0PULLUP WRITE(TACH_0, HIGH); 1deb6: 47 9a sbi 0x08, 7 ; 8 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 1deb8: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 1deba: 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(); 1debc: 17 9a sbi 0x02, 7 ; 2 1debe: 10 92 39 06 sts 0x0639, r1 ; 0x800639 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); 1dec2: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 1dec4: 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(); 1dec6: 16 9a sbi 0x02, 6 ; 2 1dec8: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 1decc: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 1dece: 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); 1ded0: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 1ded2: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 1ded4: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 1deda: 8f 7e andi r24, 0xEF ; 239 1dedc: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 1dee4: 88 60 ori r24, 0x08 ; 8 1dee6: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 1deee: 8d 7f andi r24, 0xFD ; 253 1def0: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 1def8: 8e 7f andi r24, 0xFE ; 254 1defa: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 1df02: 8f 73 andi r24, 0x3F ; 63 1df04: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 1df0c: 8f 7c andi r24, 0xCF ; 207 1df0e: 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< 1df16: 88 7f andi r24, 0xF8 ; 248 1df18: 82 60 ori r24, 0x02 ; 2 1df1a: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 1df1e: 80 e0 ldi r24, 0x00 ; 0 1df20: 90 e4 ldi r25, 0x40 ; 64 1df22: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1df26: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 1df2a: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 1df2e: 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; 1df32: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 1df36: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.439> nextAdvanceISR = ADV_NEVER; 1df3a: 8f ef ldi r24, 0xFF ; 255 1df3c: 9f ef ldi r25, 0xFF ; 255 1df3e: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 1df42: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> main_Rate = ADV_NEVER; 1df46: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.441+0x1> 1df4a: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.441> current_adv_steps = 0; 1df4e: 10 92 49 04 sts 0x0449, r1 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 1df52: 10 92 48 04 sts 0x0448, r1 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 1df56: 81 e0 ldi r24, 0x01 ; 1 1df58: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.388> current_adv_steps = 0; #endif enable_endstops(true); // Start with endstops active. After homing they can be disabled ENABLE_STEPPER_DRIVER_INTERRUPT(); 1df5c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1df60: 82 60 ori r24, 0x02 ; 2 1df62: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 1df66: 78 94 sei setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 1df68: 0e 94 c4 61 call 0xc388 ; 0xc388 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 1df6c: 81 e6 ldi r24, 0x61 ; 97 1df6e: 92 e1 ldi r25, 0x12 ; 18 1df70: 0e 94 4c 6a call 0xd498 ; 0xd498 plan_set_position_curposXYZE(); 1df74: 0f 94 ca 48 call 0x29194 ; 0x29194 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 1df78: 84 e9 ldi r24, 0x94 ; 148 1df7a: 9c e0 ldi r25, 0x0C ; 12 1df7c: 0f 94 9d a3 call 0x3473a ; 0x3473a 1df80: 82 34 cpi r24, 0x42 ; 66 1df82: 59 f4 brne .+22 ; 0x1df9a 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); 1df84: 6f ef ldi r22, 0xFF ; 255 1df86: 84 e9 ldi r24, 0x94 ; 148 1df88: 9c e0 ldi r25, 0x0C ; 12 1df8a: 0f 94 e5 a3 call 0x347ca ; 0x347ca // 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); 1df8e: 85 e9 ldi r24, 0x95 ; 149 1df90: 9c e0 ldi r25, 0x0C ; 12 1df92: 0f 94 ab a3 call 0x34756 ; 0x34756 lcd_show_fullscreen_message_and_wait_P(kill_msg); 1df96: 0e 94 85 e8 call 0x1d10a ; 0x1d10a // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 1df9a: 0f 94 86 6d call 0x2db0c ; 0x2db0c #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 1df9e: 15 98 cbi 0x02, 5 ; 2 #endif // The farm monitoring SW may accidentally expect // 2 messages of "printer started" to consider a printer working. prusa_statistics(8); 1dfa0: 88 e0 ldi r24, 0x08 ; 8 1dfa2: 0f 94 02 30 call 0x26004 ; 0x26004 // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); 1dfa6: 8b eb ldi r24, 0xBB ; 187 1dfa8: 9f e0 ldi r25, 0x0F ; 15 1dfaa: 0f 94 9d a3 call 0x3473a ; 0x3473a 1dfae: 91 e0 ldi r25, 0x01 ; 1 1dfb0: 81 30 cpi r24, 0x01 ; 1 1dfb2: 09 f0 breq .+2 ; 0x1dfb6 1dfb4: 90 e0 ldi r25, 0x00 ; 0 1dfb6: 90 93 48 16 sts 0x1648, r25 ; 0x801648 // 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(); 1dfba: 81 e0 ldi r24, 0x01 ; 1 1dfbc: 0f 94 27 73 call 0x2e64e ; 0x2e64e #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 1dfc0: 60 e0 ldi r22, 0x00 ; 0 1dfc2: 84 e6 ldi r24, 0x64 ; 100 1dfc4: 9f e0 ldi r25, 0x0F ; 15 1dfc6: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 1dfca: 60 e0 ldi r22, 0x00 ; 0 1dfcc: 86 e6 ldi r24, 0x66 ; 102 1dfce: 9f e0 ldi r25, 0x0F ; 15 1dfd0: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 1dfd4: 60 e0 ldi r22, 0x00 ; 0 1dfd6: 88 e6 ldi r24, 0x68 ; 104 1dfd8: 9f e0 ldi r25, 0x0F ; 15 1dfda: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 1dfde: 60 e0 ldi r22, 0x00 ; 0 1dfe0: 85 e6 ldi r24, 0x65 ; 101 1dfe2: 9f e0 ldi r25, 0x0F ; 15 1dfe4: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 1dfe8: 70 e0 ldi r23, 0x00 ; 0 1dfea: 60 e0 ldi r22, 0x00 ; 0 1dfec: 8f ef ldi r24, 0xFF ; 255 1dfee: 9e e0 ldi r25, 0x0E ; 14 1dff0: 0e 94 15 78 call 0xf02a ; 0xf02a eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 1dff4: 70 e0 ldi r23, 0x00 ; 0 1dff6: 60 e0 ldi r22, 0x00 ; 0 1dff8: 85 e0 ldi r24, 0x05 ; 5 1dffa: 9f e0 ldi r25, 0x0F ; 15 1dffc: 0e 94 15 78 call 0xf02a ; 0xf02a eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 1e000: 70 e0 ldi r23, 0x00 ; 0 1e002: 60 e0 ldi r22, 0x00 ; 0 1e004: 83 e0 ldi r24, 0x03 ; 3 1e006: 9f e0 ldi r25, 0x0F ; 15 1e008: 0e 94 15 78 call 0xf02a ; 0xf02a eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 1e00c: 70 e0 ldi r23, 0x00 ; 0 1e00e: 60 e0 ldi r22, 0x00 ; 0 1e010: 81 e0 ldi r24, 0x01 ; 1 1e012: 9f e0 ldi r25, 0x0F ; 15 1e014: 0e 94 15 78 call 0xf02a ; 0xf02a eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 1e018: 70 e0 ldi r23, 0x00 ; 0 1e01a: 60 e0 ldi r22, 0x00 ; 0 1e01c: 83 ed ldi r24, 0xD3 ; 211 1e01e: 9e e0 ldi r25, 0x0E ; 14 1e020: 0e 94 15 78 call 0xf02a ; 0xf02a eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 1e024: 70 e0 ldi r23, 0x00 ; 0 1e026: 60 e0 ldi r22, 0x00 ; 0 1e028: 80 ed ldi r24, 0xD0 ; 208 1e02a: 9e e0 ldi r25, 0x0E ; 14 1e02c: 0e 94 15 78 call 0xf02a ; 0xf02a eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 1e030: 60 e0 ldi r22, 0x00 ; 0 1e032: 82 ed ldi r24, 0xD2 ; 210 1e034: 9e e0 ldi r25, 0x0E ; 14 1e036: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 1e03a: 60 e0 ldi r22, 0x00 ; 0 1e03c: 8f ec ldi r24, 0xCF ; 207 1e03e: 9e e0 ldi r25, 0x0E ; 14 1e040: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 1e044: 88 ea ldi r24, 0xA8 ; 168 1e046: 9c e0 ldi r25, 0x0C ; 12 1e048: 0f 94 a9 6c call 0x2d952 ; 0x2d952 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 1e04c: 81 ea ldi r24, 0xA1 ; 161 1e04e: 9d e0 ldi r25, 0x0D ; 13 1e050: 0f 94 9d a3 call 0x3473a ; 0x3473a 1e054: 8f 3f cpi r24, 0xFF ; 255 1e056: 71 f4 brne .+28 ; 0x1e074 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e058: 60 e0 ldi r22, 0x00 ; 0 1e05a: 81 ea ldi r24, 0xA1 ; 161 1e05c: 9d e0 ldi r25, 0x0D ; 13 1e05e: 0f 94 c1 a3 call 0x34782 ; 0x34782 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); 1e062: 88 ef ldi r24, 0xF8 ; 248 1e064: 9f e0 ldi r25, 0x0F ; 15 1e066: 0f 94 ab a3 call 0x34756 ; 0x34756 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 1e06a: bc 01 movw r22, r24 1e06c: 80 e5 ldi r24, 0x50 ; 80 1e06e: 9d e0 ldi r25, 0x0D ; 13 1e070: 0f 94 df a3 call 0x347be ; 0x347be SET_OUTPUT(Y_MS1_PIN); SET_OUTPUT(Y_MS2_PIN); SET_OUTPUT(Z_MS1_PIN); SET_OUTPUT(Z_MS2_PIN); SET_OUTPUT(E0_MS1_PIN); SET_OUTPUT(E0_MS2_PIN); 1e074: 49 e4 ldi r20, 0x49 ; 73 1e076: c4 2e mov r12, r20 1e078: 4d e0 ldi r20, 0x0D ; 13 1e07a: d4 2e mov r13, r20 1e07c: 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); 1e07e: b7 01 movw r22, r14 1e080: 81 2f mov r24, r17 1e082: 0e 94 88 78 call 0xf110 ; 0xf110 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 1e086: a7 01 movw r20, r14 1e088: 67 e0 ldi r22, 0x07 ; 7 1e08a: 70 e0 ldi r23, 0x00 ; 0 1e08c: c6 01 movw r24, r12 1e08e: 0e 94 f6 77 call 0xefec ; 0xefec 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++) { 1e092: 1f 5f subi r17, 0xFF ; 255 1e094: fb e0 ldi r31, 0x0B ; 11 1e096: cf 0e add r12, r31 1e098: d1 1c adc r13, r1 1e09a: 18 30 cpi r17, 0x08 ; 8 1e09c: 81 f7 brne .-32 ; 0x1e07e 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)))) 1e09e: 81 ea ldi r24, 0xA1 ; 161 1e0a0: 9d e0 ldi r25, 0x0D ; 13 1e0a2: 0f 94 9d a3 call 0x3473a ; 0x3473a 1e0a6: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 1e0aa: 81 11 cpse r24, r1 1e0ac: 02 c0 rjmp .+4 ; 0x1e0b2 { eeprom_switch_to_next_sheet(); 1e0ae: 0e 94 7a 78 call 0xf0f4 ; 0xf0f4 } check_babystep(); 1e0b2: 0e 94 ec 7c call 0xf9d8 ; 0xf9d8 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 1e0b6: 80 e8 ldi r24, 0x80 ; 128 1e0b8: 9c e0 ldi r25, 0x0C ; 12 1e0ba: 0f 94 9d a3 call 0x3473a ; 0x3473a 1e0be: 8f 3f cpi r24, 0xFF ; 255 1e0c0: 41 f4 brne .+16 ; 0x1e0d2 #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); 1e0c2: 4f e0 ldi r20, 0x0F ; 15 1e0c4: 50 e0 ldi r21, 0x00 ; 0 1e0c6: 60 e8 ldi r22, 0x80 ; 128 1e0c8: 7c e0 ldi r23, 0x0C ; 12 1e0ca: 8e ec ldi r24, 0xCE ; 206 1e0cc: 92 e0 ldi r25, 0x02 ; 2 1e0ce: 0f 94 b1 a3 call 0x34762 ; 0x34762 //SERIAL_ECHOLN("Init Custom Mendel Name"); eeprom_update_block_notify(CUSTOM_MENDEL_NAME, (uint8_t*)EEPROM_CUSTOM_MENDEL_NAME, sizeof(CUSTOM_MENDEL_NAME)); } //else SERIAL_ECHOLN("Found Custom Mendel Name"); #ifdef PINDA_TEMP_COMP eeprom_init_default_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, 0); 1e0d2: 60 e0 ldi r22, 0x00 ; 0 1e0d4: 89 e2 ldi r24, 0x29 ; 41 1e0d6: 9d e0 ldi r25, 0x0D ; 13 1e0d8: 0e 94 2d 78 call 0xf05a ; 0xf05a #endif //PINDA_TEMP_COMP eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0); 1e0dc: 85 e0 ldi r24, 0x05 ; 5 1e0de: 9d e0 ldi r25, 0x0D ; 13 1e0e0: 0f 94 a9 6c call 0x2d952 ; 0x2d952 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 1e0e4: 8d ee ldi r24, 0xED ; 237 1e0e6: 9f e0 ldi r25, 0x0F ; 15 1e0e8: 0f 94 a9 6c call 0x2d952 ; 0x2d952 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 1e0ec: 81 ef ldi r24, 0xF1 ; 241 1e0ee: 9f e0 ldi r25, 0x0F ; 15 1e0f0: 0f 94 a9 6c call 0x2d952 ; 0x2d952 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 1e0f4: 60 e0 ldi r22, 0x00 ; 0 1e0f6: 8e ec ldi r24, 0xCE ; 206 1e0f8: 9e e0 ldi r25, 0x0E ; 14 1e0fa: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 1e0fe: 61 e0 ldi r22, 0x01 ; 1 1e100: 87 ea ldi r24, 0xA7 ; 167 1e102: 9c e0 ldi r25, 0x0C ; 12 1e104: 0e 94 2d 78 call 0xf05a ; 0xf05a putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 1e108: 8e ef ldi r24, 0xFE ; 254 1e10a: 9f e0 ldi r25, 0x0F ; 15 1e10c: 0f 94 9d a3 call 0x3473a ; 0x3473a 1e110: 0e 94 9e 74 call 0xe93c ; 0xe93c 1e114: 81 11 cpse r24, r1 1e116: 02 c0 rjmp .+4 ; 0x1e11c lcd_language(); 1e118: 0e 94 3a c2 call 0x18474 ; 0x18474 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 1e11c: 60 e0 ldi r22, 0x00 ; 0 1e11e: 8f ea ldi r24, 0xAF ; 175 1e120: 9f e0 ldi r25, 0x0F ; 15 1e122: 0e 94 2d 78 call 0xf05a ; 0xf05a if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 1e126: 86 ea ldi r24, 0xA6 ; 166 1e128: 9f e0 ldi r25, 0x0F ; 15 1e12a: 0f 94 9d a3 call 0x3473a ; 0x3473a 1e12e: 8f 3f cpi r24, 0xFF ; 255 1e130: d9 f4 brne .+54 ; 0x1e168 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e132: 61 e0 ldi r22, 0x01 ; 1 1e134: 86 ea ldi r24, 0xA6 ; 166 1e136: 9f e0 ldi r25, 0x0F ; 15 1e138: 0f 94 c1 a3 call 0x34782 ; 0x34782 1e13c: 30 eb ldi r19, 0xB0 ; 176 1e13e: e3 2e mov r14, r19 1e140: 3f e0 ldi r19, 0x0F ; 15 1e142: f3 2e mov r15, r19 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1e144: 70 e0 ldi r23, 0x00 ; 0 1e146: 60 e0 ldi r22, 0x00 ; 0 1e148: c7 01 movw r24, r14 1e14a: 0f 94 df a3 call 0x347be ; 0x347be 1e14e: 22 e0 ldi r18, 0x02 ; 2 1e150: e2 0e add r14, r18 1e152: f1 1c adc r15, 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++) { 1e154: 3a eb ldi r19, 0xBA ; 186 1e156: e3 16 cp r14, r19 1e158: 3f e0 ldi r19, 0x0F ; 15 1e15a: f3 06 cpc r15, r19 1e15c: 99 f7 brne .-26 ; 0x1e144 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e15e: 60 e0 ldi r22, 0x00 ; 0 1e160: 8f ea ldi r24, 0xAF ; 175 1e162: 9f e0 ldi r25, 0x0F ; 15 1e164: 0f 94 c1 a3 call 0x34782 ; 0x34782 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); 1e168: 60 e0 ldi r22, 0x00 ; 0 1e16a: 85 ea ldi r24, 0xA5 ; 165 1e16c: 9f e0 ldi r25, 0x0F ; 15 1e16e: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 1e172: 60 e0 ldi r22, 0x00 ; 0 1e174: 8f e7 ldi r24, 0x7F ; 127 1e176: 9c e0 ldi r25, 0x0C ; 12 1e178: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 1e17c: 60 e0 ldi r22, 0x00 ; 0 1e17e: 89 e0 ldi r24, 0x09 ; 9 1e180: 9f e0 ldi r25, 0x0F ; 15 1e182: 0e 94 2d 78 call 0xf05a ; 0xf05a } 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); 1e186: 61 e0 ldi r22, 0x01 ; 1 1e188: 8c ea ldi r24, 0xAC ; 172 1e18a: 9d e0 ldi r25, 0x0D ; 13 1e18c: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 1e190: 63 e0 ldi r22, 0x03 ; 3 1e192: 8b ea ldi r24, 0xAB ; 171 1e194: 9d e0 ldi r25, 0x0D ; 13 1e196: 0e 94 2d 78 call 0xf05a ; 0xf05a eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 1e19a: 63 e0 ldi r22, 0x03 ; 3 1e19c: 8a ea ldi r24, 0xAA ; 170 1e19e: 9d e0 ldi r25, 0x0D ; 13 1e1a0: 0e 94 2d 78 call 0xf05a ; 0xf05a //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 1e1a4: 61 e0 ldi r22, 0x01 ; 1 1e1a6: 89 ea ldi r24, 0xA9 ; 169 1e1a8: 9d e0 ldi r25, 0x0D ; 13 1e1aa: 0e 94 2d 78 call 0xf05a ; 0xf05a #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); 1e1ae: 84 e0 ldi r24, 0x04 ; 4 1e1b0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 1e1b4: 02 30 cpi r16, 0x02 ; 2 1e1b6: 09 f4 brne .+2 ; 0x1e1ba 1e1b8: 81 c0 rjmp .+258 ; 0x1e2bc 1e1ba: 03 30 cpi r16, 0x03 ; 3 1e1bc: 09 f4 brne .+2 ; 0x1e1c0 1e1be: 22 c1 rjmp .+580 ; 0x1e404 1e1c0: 01 30 cpi r16, 0x01 ; 1 1e1c2: 09 f0 breq .+2 ; 0x1e1c6 1e1c4: 87 c0 rjmp .+270 ; 0x1e2d4 //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)); 1e1c6: 80 e0 ldi r24, 0x00 ; 0 1e1c8: 9e e4 ldi r25, 0x4E ; 78 1e1ca: 0e 94 0a 75 call 0xea14 ; 0xea14 1e1ce: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 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); 1e1d2: 68 ec ldi r22, 0xC8 ; 200 1e1d4: 70 e0 ldi r23, 0x00 ; 0 1e1d6: 8c ee ldi r24, 0xEC ; 236 1e1d8: 9e e0 ldi r25, 0x0E ; 14 1e1da: 7a c0 rjmp .+244 ; 0x1e2d0 first++; lcd_clear(); } } if (cursor_pos < 0) { 1e1dc: 1f 3f cpi r17, 0xFF ; 255 1e1de: 09 f0 breq .+2 ; 0x1e1e2 1e1e0: d4 cd rjmp .-1112 ; 0x1dd8a cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1e1e2: 87 e0 ldi r24, 0x07 ; 7 1e1e4: 0f 94 62 23 call 0x246c4 ; 0x246c4 if (first > 0) { 1e1e8: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1e1ec: 18 16 cp r1, r24 1e1ee: 2c f4 brge .+10 ; 0x1e1fa first--; 1e1f0: 81 50 subi r24, 0x01 ; 1 1e1f2: 80 93 46 04 sts 0x0446, r24 ; 0x800446 lcd_clear(); 1e1f6: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1e1fa: 10 e0 ldi r17, 0x00 ; 0 1e1fc: c6 cd rjmp .-1140 ; 0x1dd8a // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1e1fe: 13 30 cpi r17, 0x03 ; 3 1e200: 31 f1 breq .+76 ; 0x1e24e 1e202: 14 30 cpi r17, 0x04 ; 4 1e204: 09 f0 breq .+2 ; 0x1e208 1e206: f4 cd rjmp .-1048 ; 0x1ddf0 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1e208: 6a ee ldi r22, 0xEA ; 234 1e20a: 76 e8 ldi r23, 0x86 ; 134 1e20c: 80 e0 ldi r24, 0x00 ; 0 1e20e: 90 e1 ldi r25, 0x10 ; 16 1e210: 0e 94 e1 71 call 0xe3c2 ; 0xe3c2 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1e214: 10 e0 ldi r17, 0x00 ; 0 1e216: 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); 1e218: 6f ef ldi r22, 0xFF ; 255 1e21a: c8 01 movw r24, r16 1e21c: 0f 94 c1 a3 call 0x34782 ; 0x34782 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1e220: c8 01 movw r24, r16 1e222: 0e 94 17 71 call 0xe22e ; 0xe22e break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1e226: 0f 5f subi r16, 0xFF ; 255 1e228: 1f 4f sbci r17, 0xFF ; 255 1e22a: 01 15 cp r16, r1 1e22c: b0 e1 ldi r27, 0x10 ; 16 1e22e: 1b 07 cpc r17, r27 1e230: 99 f7 brne .-26 ; 0x1e218 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1e232: 0e 94 38 71 call 0xe270 ; 0xe270 softReset(); 1e236: 0e 94 ef 65 call 0xcbde ; 0xcbde lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1e23a: 0e 94 0d 74 call 0xe81a ; 0xe81a 1e23e: d8 cd rjmp .-1104 ; 0x1ddf0 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1e240: 0e 94 b4 65 call 0xcb68 ; 0xcb68 lcd_menu_statistics(); 1e244: 0f 94 54 15 call 0x22aa8 ; 0x22aa8 1e248: d3 cd rjmp .-1114 ; 0x1ddf0 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1e24a: 0e 94 b4 65 call 0xcb68 ; 0xcb68 // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1e24e: 0e 94 0d 74 call 0xe81a ; 0xe81a // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1e252: 84 e0 ldi r24, 0x04 ; 4 1e254: 0e 94 ea d4 call 0x1a9d4 ; 0x1a9d4 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); 1e258: 62 e0 ldi r22, 0x02 ; 2 1e25a: 8f e5 ldi r24, 0x5F ; 95 1e25c: 9f e0 ldi r25, 0x0F ; 15 1e25e: 0f 94 e5 a3 call 0x347ca ; 0x347ca lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1e262: 10 92 60 0d sts 0x0D60, r1 ; 0x800d60 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e266: 60 e0 ldi r22, 0x00 ; 0 1e268: 84 ec ldi r24, 0xC4 ; 196 1e26a: 9f e0 ldi r25, 0x0F ; 15 1e26c: 0f 94 c1 a3 call 0x34782 ; 0x34782 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1e270: 81 e0 ldi r24, 0x01 ; 1 1e272: 0e 94 60 77 call 0xeec0 ; 0xeec0 1e276: 11 e0 ldi r17, 0x01 ; 1 1e278: 10 93 f2 16 sts 0x16F2, r17 ; 0x8016f2 1e27c: 61 e0 ldi r22, 0x01 ; 1 1e27e: 87 e0 ldi r24, 0x07 ; 7 1e280: 9f e0 ldi r25, 0x0F ; 15 1e282: 0f 94 c1 a3 call 0x34782 ; 0x34782 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1e286: 10 93 f3 16 sts 0x16F3, r17 ; 0x8016f3 1e28a: 61 e0 ldi r22, 0x01 ; 1 1e28c: 85 ed ldi r24, 0xD5 ; 213 1e28e: 9e e0 ldi r25, 0x0E ; 14 1e290: 0f 94 c1 a3 call 0x34782 ; 0x34782 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 1e294: 10 93 ff 16 sts 0x16FF, r17 ; 0x8016ff oldPos = pat9125_y; 1e298: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 1e29c: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 1e2a0: 90 93 01 17 sts 0x1701, r25 ; 0x801701 1e2a4: 80 93 00 17 sts 0x1700, r24 ; 0x801700 resetStepCount(); 1e2a8: 0f 94 37 6d call 0x2da6e ; 0x2da6e jamErrCnt = 0; 1e2ac: 10 92 06 17 sts 0x1706, r1 ; 0x801706 1e2b0: 61 e0 ldi r22, 0x01 ; 1 1e2b2: 8d ea ldi r24, 0xAD ; 173 1e2b4: 9c e0 ldi r25, 0x0C ; 12 1e2b6: 0f 94 c1 a3 call 0x34782 ; 0x34782 1e2ba: 9a cd rjmp .-1228 ; 0x1ddf0 case(0b01): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_MOTHERBOARD)); eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 1e2bc: 8f ed ldi r24, 0xDF ; 223 1e2be: 9d e4 ldi r25, 0x4D ; 77 1e2c0: 0e 94 0a 75 call 0xea14 ; 0xea14 1e2c4: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 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); 1e2c8: 6a ef ldi r22, 0xFA ; 250 1e2ca: 70 e0 ldi r23, 0x00 ; 0 1e2cc: 8e ee ldi r24, 0xEE ; 238 1e2ce: 9e e0 ldi r25, 0x0E ; 14 1e2d0: 0f 94 fb a3 call 0x347f6 ; 0x347f6 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 1e2d4: b1 10 cpse r11, r1 1e2d6: 08 c0 rjmp .+16 ; 0x1e2e8 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 1e2d8: 88 e6 ldi r24, 0x68 ; 104 1e2da: 9d e4 ldi r25, 0x4D ; 77 1e2dc: 0e 94 0a 75 call 0xea14 ; 0xea14 1e2e0: 0e 94 85 e8 call 0x1d10a ; 0x1d10a Config_StoreSettings(); 1e2e4: 0e 94 70 85 call 0x10ae0 ; 0x10ae0 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 1e2e8: 80 e8 ldi r24, 0x80 ; 128 1e2ea: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 1e2ee: 88 23 and r24, r24 1e2f0: c9 f0 breq .+50 ; 0x1e324 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1e2f2: 87 ef ldi r24, 0xF7 ; 247 1e2f4: 9f e0 ldi r25, 0x0F ; 15 1e2f6: 0f 94 9d a3 call 0x3473a ; 0x3473a } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 1e2fa: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1e2fc: 81 30 cpi r24, 0x01 ; 1 1e2fe: 71 f4 brne .+28 ; 0x1e31c // 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)) { 1e300: 8b e1 ldi r24, 0x1B ; 27 1e302: 97 e8 ldi r25, 0x87 ; 135 1e304: 0e 94 dd bd call 0x17bba ; 0x17bba 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); 1e308: 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)) { 1e30a: 88 23 and r24, r24 1e30c: 39 f0 breq .+14 ; 0x1e31c // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 1e30e: 86 e2 ldi r24, 0x26 ; 38 1e310: 9d e4 ldi r25, 0x4D ; 77 1e312: 0e 94 0a 75 call 0xea14 ; 0xea14 1e316: 0e 94 85 e8 call 0x1d10a ; 0x1d10a calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 1e31a: 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); 1e31c: 86 ea ldi r24, 0xA6 ; 166 1e31e: 9c e0 ldi r25, 0x0C ; 12 1e320: 0f 94 c1 a3 call 0x34782 ; 0x34782 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 1e324: 83 e1 ldi r24, 0x13 ; 19 1e326: 97 e8 ldi r25, 0x87 ; 135 1e328: 0e 94 dd bd call 0x17bba ; 0x17bba 1e32c: 18 2f mov r17, r24 1e32e: 88 23 and r24, r24 1e330: 29 f0 breq .+10 ; 0x1e33c if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1e332: 87 e1 ldi r24, 0x17 ; 23 1e334: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 1e338: 11 e0 ldi r17, 0x01 ; 1 1e33a: 18 27 eor r17, r24 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; 1e33c: f1 2c mov r15, r1 1e33e: e1 2c mov r14, r1 } 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)); 1e340: f7 01 movw r30, r14 1e342: e7 5f subi r30, 0xF7 ; 247 1e344: f8 47 sbci r31, 0x78 ; 120 1e346: 64 91 lpm r22, Z 1e348: c7 01 movw r24, r14 1e34a: 0f 94 c1 a3 call 0x34782 ; 0x34782 1e34e: 8f ef ldi r24, 0xFF ; 255 1e350: e8 1a sub r14, r24 1e352: f8 0a sbc r15, r24 return true; } void update_current_firmware_version_to_eeprom() { for (int8_t i = 0; i < FW_PRUSA3D_MAGIC_LEN; ++ i){ 1e354: 9a e0 ldi r25, 0x0A ; 10 1e356: e9 16 cp r14, r25 1e358: f1 04 cpc r15, r1 1e35a: 91 f7 brne .-28 ; 0x1e340 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])); 1e35c: e3 e1 ldi r30, 0x13 ; 19 1e35e: f7 e8 ldi r31, 0x87 ; 135 1e360: 65 91 lpm r22, Z+ 1e362: 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); 1e364: 8a e0 ldi r24, 0x0A ; 10 1e366: 90 e0 ldi r25, 0x00 ; 0 1e368: 0f 94 df a3 call 0x347be ; 0x347be eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 1e36c: e5 e1 ldi r30, 0x15 ; 21 1e36e: f7 e8 ldi r31, 0x87 ; 135 1e370: 65 91 lpm r22, Z+ 1e372: 74 91 lpm r23, Z 1e374: 8c e0 ldi r24, 0x0C ; 12 1e376: 90 e0 ldi r25, 0x00 ; 0 1e378: 0f 94 df a3 call 0x347be ; 0x347be eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 1e37c: e7 e1 ldi r30, 0x17 ; 23 1e37e: f7 e8 ldi r31, 0x87 ; 135 1e380: 65 91 lpm r22, Z+ 1e382: 74 91 lpm r23, Z 1e384: 8e e0 ldi r24, 0x0E ; 14 1e386: 90 e0 ldi r25, 0x00 ; 0 1e388: 0f 94 df a3 call 0x347be ; 0x347be // 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])); 1e38c: e9 e1 ldi r30, 0x19 ; 25 1e38e: f7 e8 ldi r31, 0x87 ; 135 1e390: 65 91 lpm r22, Z+ 1e392: 74 91 lpm r23, Z 1e394: 80 e1 ldi r24, 0x10 ; 16 1e396: 90 e0 ldi r25, 0x00 ; 0 1e398: 0f 94 df a3 call 0x347be ; 0x347be run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 1e39c: 8f e5 ldi r24, 0x5F ; 95 1e39e: 9f e0 ldi r25, 0x0F ; 15 1e3a0: 0f 94 9d a3 call 0x3473a ; 0x3473a 1e3a4: 88 23 and r24, r24 1e3a6: d9 f1 breq .+118 ; 0x1e41e // first time run of wizard or service prep lcd_wizard(WizState::Run); 1e3a8: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 1e3aa: 0e 94 b4 e9 call 0x1d368 ; 0x1d368 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 1e3ae: 83 e0 ldi r24, 0x03 ; 3 1e3b0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 1e3b4: 81 e0 ldi r24, 0x01 ; 1 1e3b6: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_clear(); 1e3ba: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_update(2); 1e3be: 82 e0 ldi r24, 0x02 ; 2 1e3c0: 0e 94 c9 6e call 0xdd92 ; 0xdd92 "Contact support to submit details.")); } #endif } #else //XFLASH_DUMP dump_crash_reason crash_reason = (dump_crash_reason)eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG); 1e3c4: 83 e0 ldi r24, 0x03 ; 3 1e3c6: 9d e0 ldi r25, 0x0D ; 13 1e3c8: 0f 94 9d a3 call 0x3473a ; 0x3473a 1e3cc: 18 2f mov r17, r24 if(crash_reason != dump_crash_reason::manual && (uint8_t)crash_reason != 0xFF) 1e3ce: 8f ef ldi r24, 0xFF ; 255 1e3d0: 81 0f add r24, r17 1e3d2: 8e 3f cpi r24, 0xFE ; 254 1e3d4: 08 f0 brcs .+2 ; 0x1e3d8 1e3d6: 49 c0 rjmp .+146 ; 0x1e46a } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1e3d8: 80 e0 ldi r24, 0x00 ; 0 1e3da: 0f 94 62 23 call 0x246c4 ; 0x246c4 { lcd_beeper_quick_feedback(); lcd_clear(); 1e3de: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); 1e3e2: 8a e1 ldi r24, 0x1A ; 26 1e3e4: 99 e6 ldi r25, 0x69 ; 105 1e3e6: 0e 94 ed 6e call 0xddda ; 0xddda switch(crash_reason) 1e3ea: 12 30 cpi r17, 0x02 ; 2 1e3ec: b1 f1 breq .+108 ; 0x1e45a 1e3ee: 13 30 cpi r17, 0x03 ; 3 1e3f0: 09 f4 brne .+2 ; 0x1e3f4 1e3f2: 16 c1 rjmp .+556 ; 0x1e620 { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); 1e3f4: 87 ef ldi r24, 0xF7 ; 247 1e3f6: 98 e6 ldi r25, 0x68 ; 104 { lcd_beeper_quick_feedback(); lcd_clear(); lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); switch(crash_reason) 1e3f8: 11 30 cpi r17, 0x01 ; 1 1e3fa: 89 f1 breq .+98 ; 0x1e45e } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 1e3fc: 81 2f mov r24, r17 1e3fe: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 1e402: 2f c0 rjmp .+94 ; 0x1e462 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)); 1e404: 84 ea ldi r24, 0xA4 ; 164 1e406: 9d e4 ldi r25, 0x4D ; 77 1e408: 0e 94 0a 75 call 0xea14 ; 0xea14 1e40c: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 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); 1e410: 6a ef ldi r22, 0xFA ; 250 1e412: 70 e0 ldi r23, 0x00 ; 0 1e414: 8e ee ldi r24, 0xEE ; 238 1e416: 9e e0 ldi r25, 0x0E ; 14 1e418: 0f 94 fb a3 call 0x347f6 ; 0x347f6 1e41c: da ce rjmp .-588 ; 0x1e1d2 // 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); 1e41e: 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) { 1e420: 11 11 cpse r17, r1 1e422: c3 cf rjmp .-122 ; 0x1e3aa // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 1e424: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 1e428: 81 11 cpse r24, r1 1e42a: 07 c0 rjmp .+14 ; 0x1e43a // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 1e42c: 86 eb ldi r24, 0xB6 ; 182 1e42e: 9c e4 ldi r25, 0x4C ; 76 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); } else { // 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)); 1e430: 0e 94 0a 75 call 0xea14 ; 0xea14 1e434: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 1e438: ba cf rjmp .-140 ; 0x1e3ae 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)) { 1e43a: 84 e0 ldi r24, 0x04 ; 4 1e43c: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 1e440: 81 11 cpse r24, r1 1e442: 03 c0 rjmp .+6 ; 0x1e44a // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 1e444: 8e e3 ldi r24, 0x3E ; 62 1e446: 9c e4 ldi r25, 0x4C ; 76 1e448: f3 cf rjmp .-26 ; 0x1e430 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1e44a: 80 e1 ldi r24, 0x10 ; 16 1e44c: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 1e450: 81 11 cpse r24, r1 1e452: ad cf rjmp .-166 ; 0x1e3ae lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1e454: 8a ef ldi r24, 0xFA ; 250 1e456: 9f e5 ldi r25, 0x5F ; 95 1e458: eb cf rjmp .-42 ; 0x1e430 { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); break; case dump_crash_reason::watchdog: lcd_puts_P(_n("Watchdog timeout")); 1e45a: 86 ee ldi r24, 0xE6 ; 230 1e45c: 98 e6 ldi r25, 0x68 ; 104 1e45e: 0e 94 ed 6e call 0xddda ; 0xddda } } void lcd_wait_for_click() { lcd_wait_for_click_delay(0); 1e462: 90 e0 ldi r25, 0x00 ; 0 1e464: 80 e0 ldi r24, 0x00 ; 0 1e466: 0e 94 b3 dd call 0x1bb66 ; 0x1bb66 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e46a: 6f ef ldi r22, 0xFF ; 255 1e46c: 83 e0 ldi r24, 0x03 ; 3 1e46e: 9d e0 ldi r25, 0x0D ; 13 1e470: 0f 94 c1 a3 call 0x34782 ; 0x34782 // Only arm the uvlo interrupt _after_ a recovering print has been initialized and // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); 1e474: 0e 94 4f d7 call 0x1ae9e ; 0x1ae9e KEEPALIVE_STATE(NOT_BUSY); 1e478: 81 e0 ldi r24, 0x01 ; 1 1e47a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 : "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" ); 1e47e: 88 e1 ldi r24, 0x18 ; 24 1e480: 98 e2 ldi r25, 0x28 ; 40 1e482: 0f b6 in r0, 0x3f ; 63 1e484: f8 94 cli 1e486: a8 95 wdr 1e488: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1e48c: 0f be out 0x3f, r0 ; 63 1e48e: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 1e492: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1e496: 80 64 ori r24, 0x40 ; 64 1e498: 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; 1e49c: 85 e0 ldi r24, 0x05 ; 5 1e49e: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 1e4a0: 90 e0 ldi r25, 0x00 ; 0 1e4a2: e9 2e mov r14, r25 1e4a4: 90 e0 ldi r25, 0x00 ; 0 1e4a6: f9 2e mov r15, r25 // 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); 1e4a8: cc 24 eor r12, r12 1e4aa: 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); 1e4ac: 24 e0 ldi r18, 0x04 ; 4 1e4ae: b2 2e mov r11, r18 // 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; 1e4b0: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 if(Stopped) { 1e4b4: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 1e4b8: 88 23 and r24, r24 1e4ba: 09 f4 brne .+2 ; 0x1e4be 1e4bc: b4 c0 rjmp .+360 ; 0x1e626 // 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); 1e4be: b0 92 78 02 sts 0x0278, r11 ; 0x800278 } 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. 1e4c2: 0e 94 05 66 call 0xcc0a ; 0xcc0a 1e4c6: 88 23 and r24, r24 1e4c8: 09 f4 brne .+2 ; 0x1e4cc 1e4ca: b0 c0 rjmp .+352 ; 0x1e62c 1e4cc: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1e4d0: 81 30 cpi r24, 0x01 ; 1 1e4d2: 09 f0 breq .+2 ; 0x1e4d6 1e4d4: ab c0 rjmp .+342 ; 0x1e62c usb_timer.start(); 1e4d6: 82 e4 ldi r24, 0x42 ; 66 1e4d8: 92 e1 ldi r25, 0x12 ; 18 1e4da: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> } else #endif { get_command(); 1e4de: 0e 94 96 85 call 0x10b2c ; 0x10b2c // 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) 1e4e2: 80 91 56 02 lds r24, 0x0256 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> 1e4e6: 88 23 and r24, r24 1e4e8: 89 f0 breq .+34 ; 0x1e50c return; if(autostart_atmillis.expired(5000)) 1e4ea: 68 e8 ldi r22, 0x88 ; 136 1e4ec: 73 e1 ldi r23, 0x13 ; 19 1e4ee: 88 ee ldi r24, 0xE8 ; 232 1e4f0: 96 e1 ldi r25, 0x16 ; 22 1e4f2: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 1e4f6: 81 11 cpse r24, r1 1e4f8: 09 c0 rjmp .+18 ; 0x1e50c return; } autostart_stilltocheck = false; 1e4fa: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> if(!mounted) 1e4fe: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1e502: 88 23 and r24, r24 1e504: 09 f4 brne .+2 ; 0x1e508 1e506: 9e c0 rjmp .+316 ; 0x1e644 1e508: 0f 94 03 68 call 0x2d006 ; 0x2d006 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 1e50c: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e510: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e514: 89 2b or r24, r25 1e516: 09 f4 brne .+2 ; 0x1e51a 1e518: 63 c0 rjmp .+198 ; 0x1e5e0 { cmdbuffer_front_already_processed = false; 1e51a: 10 92 53 12 sts 0x1253, r1 ; 0x801253 #ifdef SDSUPPORT if(card.saving) 1e51e: 80 91 d5 13 lds r24, 0x13D5 ; 0x8013d5 1e522: 88 23 and r24, r24 1e524: c1 f1 breq .+112 ; 0x1e596 { // 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) { 1e526: 00 91 38 12 lds r16, 0x1238 ; 0x801238 1e52a: 10 91 39 12 lds r17, 0x1239 ; 0x801239 1e52e: 02 5b subi r16, 0xB2 ; 178 1e530: 1f 4e sbci r17, 0xEF ; 239 1e532: 6c e5 ldi r22, 0x5C ; 92 1e534: 77 e8 ldi r23, 0x87 ; 135 1e536: c8 01 movw r24, r16 1e538: 0f 94 a4 a1 call 0x34348 ; 0x34348 1e53c: 89 2b or r24, r25 1e53e: 09 f0 breq .+2 ; 0x1e542 1e540: 8e c0 rjmp .+284 ; 0x1e65e else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 1e542: 10 92 67 16 sts 0x1667, r1 ; 0x801667 /** 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)); 1e546: f8 01 movw r30, r16 1e548: 01 90 ld r0, Z+ 1e54a: 00 20 and r0, r0 1e54c: e9 f7 brne .-6 ; 0x1e548 1e54e: 31 97 sbiw r30, 0x01 ; 1 1e550: bf 01 movw r22, r30 1e552: 60 1b sub r22, r16 1e554: 71 0b sbc r23, r17 1e556: c8 01 movw r24, r16 1e558: 0f 94 c6 75 call 0x2eb8c ; 0x2eb8c 1e55c: 62 e0 ldi r22, 0x02 ; 2 1e55e: 70 e0 ldi r23, 0x00 ; 0 1e560: 8d ed ldi r24, 0xDD ; 221 1e562: 92 e0 ldi r25, 0x02 ; 2 1e564: 0f 94 c6 75 call 0x2eb8c ; 0x2eb8c file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 1e568: 80 91 67 16 lds r24, 0x1667 ; 0x801667 1e56c: 88 23 and r24, r24 1e56e: 41 f0 breq .+16 ; 0x1e580 { SERIAL_ERROR_START; 1e570: 81 eb ldi r24, 0xB1 ; 177 1e572: 91 ea ldi r25, 0xA1 ; 161 1e574: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 1e578: 84 ec ldi r24, 0xC4 ; 196 1e57a: 99 e6 ldi r25, 0x69 ; 105 1e57c: 0e 94 8d 7c call 0xf91a ; 0xf91a card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 1e580: 80 91 d6 13 lds r24, 0x13D6 ; 0x8013d6 1e584: 88 23 and r24, r24 1e586: 09 f4 brne .+2 ; 0x1e58a 1e588: 65 c0 rjmp .+202 ; 0x1e654 */ void process_commands() { if (!buflen) return; //empty command 1e58a: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e58e: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e592: 89 2b or r24, r25 1e594: 11 f0 breq .+4 ; 0x1e59a 1e596: 0e 94 cd 8d call 0x11b9a ; 0x11b9a } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 1e59a: 80 91 53 12 lds r24, 0x1253 ; 0x801253 1e59e: 81 11 cpse r24, r1 1e5a0: 19 c0 rjmp .+50 ; 0x1e5d4 1e5a2: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e5a6: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e5aa: 89 2b or r24, r25 1e5ac: 99 f0 breq .+38 ; 0x1e5d4 { // 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; 1e5ae: e0 91 38 12 lds r30, 0x1238 ; 0x801238 1e5b2: f0 91 39 12 lds r31, 0x1239 ; 0x801239 1e5b6: e5 5b subi r30, 0xB5 ; 181 1e5b8: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 1e5ba: 80 81 ld r24, Z 1e5bc: 82 30 cpi r24, 0x02 ; 2 1e5be: 09 f0 breq .+2 ; 0x1e5c2 1e5c0: 53 c0 rjmp .+166 ; 0x1e668 { // 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(); 1e5c2: 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; 1e5c4: 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); 1e5c6: 81 81 ldd r24, Z+1 ; 0x01 1e5c8: 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); 1e5ca: 0f 94 16 3a call 0x2742c ; 0x2742c sei(); 1e5ce: 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(); 1e5d0: 0e 94 13 79 call 0xf226 ; 0xf226 */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 1e5d4: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1e5d8: 81 11 cpse r24, r1 1e5da: 02 c0 rjmp .+4 ; 0x1e5e0 1e5dc: 0e 94 91 7c call 0xf922 ; 0xf922 } host_keepalive(); } } //check heater every n milliseconds manage_heater(); 1e5e0: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(printingIsPaused()); 1e5e4: 0e 94 05 66 call 0xcc0a ; 0xcc0a 1e5e8: 0e 94 25 8a call 0x1144a ; 0x1144a //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 1e5ec: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.443> 1e5f0: 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; 1e5f2: 10 92 5e 04 sts 0x045E, r1 ; 0x80045e <_ZL11endstop_hit.lto_priv.443> checkHitEndstops(); lcd_update(0); 1e5f6: 80 e0 ldi r24, 0x00 ; 0 1e5f8: 0e 94 c9 6e call 0xdd92 ; 0xdd92 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) { 1e5fc: 80 91 5f 04 lds r24, 0x045F ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> 1e600: 81 11 cpse r24, r1 1e602: 07 c0 rjmp .+14 ; 0x1e612 return; } avoidRecursion = true; 1e604: c0 92 5f 04 sts 0x045F, r12 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> mmu_loop_inner(true); 1e608: 81 e0 ldi r24, 0x01 ; 1 1e60a: 0f 94 f5 96 call 0x32dea ; 0x32dea avoidRecursion = false; 1e60e: 10 92 5f 04 sts 0x045F, r1 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> 1e612: e1 14 cp r14, r1 1e614: f1 04 cpc r15, r1 1e616: 09 f4 brne .+2 ; 0x1e61a 1e618: 4b cf rjmp .-362 ; 0x1e4b0 1e61a: 0e 94 00 00 call 0 ; 0x0 <__vectors> 1e61e: 48 cf rjmp .-368 ; 0x1e4b0 break; case dump_crash_reason::watchdog: lcd_puts_P(_n("Watchdog timeout")); break; case dump_crash_reason::bad_isr: lcd_puts_P(_n("Bad interrupt")); 1e620: 88 ed ldi r24, 0xD8 ; 216 1e622: 98 e6 ldi r25, 0x68 ; 104 1e624: 1c cf rjmp .-456 ; 0x1e45e // 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); 1e626: c0 92 78 02 sts 0x0278, r12 ; 0x800278 1e62a: 4b cf rjmp .-362 ; 0x1e4c2 } 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. 1e62c: 60 e1 ldi r22, 0x10 ; 16 1e62e: 77 e2 ldi r23, 0x27 ; 39 1e630: 82 e4 ldi r24, 0x42 ; 66 1e632: 92 e1 ldi r25, 0x12 ; 18 1e634: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 1e638: 88 23 and r24, r24 1e63a: 09 f4 brne .+2 ; 0x1e63e 1e63c: 50 cf rjmp .-352 ; 0x1e4de 1e63e: b0 92 61 0d sts 0x0D61, r11 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 1e642: 4d cf rjmp .-358 ; 0x1e4de return; } autostart_stilltocheck = false; if(!mounted) { mount(); 1e644: 81 e0 ldi r24, 0x01 ; 1 1e646: 0f 94 27 73 call 0x2e64e ; 0x2e64e if(!mounted) //fail 1e64a: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1e64e: 81 11 cpse r24, r1 1e650: 5b cf rjmp .-330 ; 0x1e508 1e652: 5c cf rjmp .-328 ; 0x1e50c 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); 1e654: 8c ee ldi r24, 0xEC ; 236 1e656: 99 e6 ldi r25, 0x69 ; 105 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1e658: 0e 94 8d 7c call 0xf91a ; 0xf91a 1e65c: 9e cf rjmp .-196 ; 0x1e59a if(card.logging) process_commands(); else SERIAL_PROTOCOLLNRPGM(MSG_OK); } else { card.closefile(); 1e65e: 0f 94 d1 65 call 0x2cba2 ; 0x2cba2 SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1e662: 8a ed ldi r24, 0xDA ; 218 1e664: 99 e6 ldi r25, 0x69 ; 105 1e666: f8 cf rjmp .-16 ; 0x1e658 // 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){ 1e668: 86 30 cpi r24, 0x06 ; 6 1e66a: 09 f0 breq .+2 ; 0x1e66e 1e66c: b1 cf rjmp .-158 ; 0x1e5d0 1e66e: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 1e672: 81 11 cpse r24, r1 1e674: ad cf rjmp .-166 ; 0x1e5d0 cli(); 1e676: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1e678: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 1e67a: 81 e0 ldi r24, 0x01 ; 1 1e67c: 90 e0 ldi r25, 0x00 ; 0 1e67e: a5 cf rjmp .-182 ; 0x1e5ca { 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; 1e680: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1e682: 88 3c cpi r24, 0xC8 ; 200 1e684: 91 05 cpc r25, r1 1e686: 09 f0 breq .+2 ; 0x1e68a 1e688: 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(); 1e68a: 0e 94 df 84 call 0x109be ; 0x109be 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; 1e68e: b1 2c mov r11, 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; 1e690: 82 ea ldi r24, 0xA2 ; 162 1e692: 92 ea ldi r25, 0xA2 ; 162 1e694: a0 e0 ldi r26, 0x00 ; 0 1e696: b0 e0 ldi r27, 0x00 ; 0 1e698: 80 93 37 17 sts 0x1737, r24 ; 0x801737 <__bss_end+0x20> 1e69c: 90 93 38 17 sts 0x1738, r25 ; 0x801738 <__bss_end+0x21> 1e6a0: a0 93 39 17 sts 0x1739, r26 ; 0x801739 <__bss_end+0x22> 1e6a4: b0 93 3a 17 sts 0x173A, r27 ; 0x80173a <__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; 1e6a8: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL14iState_sum_min.lto_priv.435> 1e6ac: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL14iState_sum_min.lto_priv.435+0x1> 1e6b0: 10 92 1e 04 sts 0x041E, r1 ; 0x80041e <_ZL14iState_sum_min.lto_priv.435+0x2> 1e6b4: 10 92 1f 04 sts 0x041F, r1 ; 0x80041f <_ZL14iState_sum_min.lto_priv.435+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 1e6b8: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 1e6bc: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 1e6c0: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 1e6c4: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 1e6c8: 60 e0 ldi r22, 0x00 ; 0 1e6ca: 70 e0 ldi r23, 0x00 ; 0 1e6cc: 8f e7 ldi r24, 0x7F ; 127 1e6ce: 93 e4 ldi r25, 0x43 ; 67 1e6d0: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1e6d4: 60 93 18 04 sts 0x0418, r22 ; 0x800418 <_ZL14iState_sum_max.lto_priv.436> 1e6d8: 70 93 19 04 sts 0x0419, r23 ; 0x800419 <_ZL14iState_sum_max.lto_priv.436+0x1> 1e6dc: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14iState_sum_max.lto_priv.436+0x2> 1e6e0: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14iState_sum_max.lto_priv.436+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 1e6e4: 10 92 14 04 sts 0x0414, r1 ; 0x800414 <_ZL19temp_iState_min_bed.lto_priv.433> 1e6e8: 10 92 15 04 sts 0x0415, r1 ; 0x800415 <_ZL19temp_iState_min_bed.lto_priv.433+0x1> 1e6ec: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL19temp_iState_min_bed.lto_priv.433+0x2> 1e6f0: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL19temp_iState_min_bed.lto_priv.433+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 1e6f4: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 1e6f8: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 1e6fc: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 1e700: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 1e704: 60 e0 ldi r22, 0x00 ; 0 1e706: 70 e0 ldi r23, 0x00 ; 0 1e708: 8f e7 ldi r24, 0x7F ; 127 1e70a: 93 e4 ldi r25, 0x43 ; 67 1e70c: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1e710: 60 93 10 04 sts 0x0410, r22 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.434> 1e714: 70 93 11 04 sts 0x0411, r23 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.434+0x1> 1e718: 80 93 12 04 sts 0x0412, r24 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.434+0x2> 1e71c: 90 93 13 04 sts 0x0413, r25 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.434+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 1e720: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 1e722: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 1e724: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1e728: 88 60 ori r24, 0x08 ; 8 1e72a: 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)); 1e72e: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 1e732: 90 e0 ldi r25, 0x00 ; 0 1e734: 64 e0 ldi r22, 0x04 ; 4 1e736: 95 95 asr r25 1e738: 87 95 ror r24 1e73a: 6a 95 dec r22 1e73c: e1 f7 brne .-8 ; 0x1e736 1e73e: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.438> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 1e742: 8e e1 ldi r24, 0x1E ; 30 1e744: 90 e0 ldi r25, 0x00 ; 0 1e746: 90 93 0e 04 sts 0x040E, r25 ; 0x80040e <_ZL8minttemp.lto_priv.428+0x1> 1e74a: 80 93 0d 04 sts 0x040D, r24 ; 0x80040d <_ZL8minttemp.lto_priv.428> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 1e74e: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.430> 1e752: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.430+0x1> 1e756: 0f 94 23 8f call 0x31e46 ; 0x31e46 1e75a: 20 e0 ldi r18, 0x00 ; 0 1e75c: 30 e0 ldi r19, 0x00 ; 0 1e75e: 40 ef ldi r20, 0xF0 ; 240 1e760: 51 e4 ldi r21, 0x41 ; 65 1e762: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1e766: 87 ff sbrs r24, 7 1e768: 91 c9 rjmp .-3294 ; 0x1da8c #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 1e76a: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.430> 1e76e: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.430+0x1> 1e772: 40 97 sbiw r24, 0x10 ; 16 1e774: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL12minttemp_raw.lto_priv.430+0x1> 1e778: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL12minttemp_raw.lto_priv.430> 1e77c: e8 cf rjmp .-48 ; 0x1e74e 0001e77e : } } void lcd_print_stop_finish(); void lcd_commands() 1e77e: 2f 92 push r2 1e780: 3f 92 push r3 1e782: 4f 92 push r4 1e784: 5f 92 push r5 1e786: 6f 92 push r6 1e788: 7f 92 push r7 1e78a: 8f 92 push r8 1e78c: 9f 92 push r9 1e78e: af 92 push r10 1e790: bf 92 push r11 1e792: cf 92 push r12 1e794: df 92 push r13 1e796: ef 92 push r14 1e798: ff 92 push r15 1e79a: 0f 93 push r16 1e79c: 1f 93 push r17 1e79e: cf 93 push r28 1e7a0: 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) 1e7a2: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e7a6: 81 30 cpi r24, 0x01 ; 1 1e7a8: 09 f0 breq .+2 ; 0x1e7ac 1e7aa: 5a c0 rjmp .+180 ; 0x1e860 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); 1e7ac: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1e7b0: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && !homing_flag) 1e7b4: 98 13 cpse r25, r24 1e7b6: 54 c0 rjmp .+168 ; 0x1e860 1e7b8: 80 91 71 12 lds r24, 0x1271 ; 0x801271 1e7bc: 81 11 cpse r24, r1 1e7be: 50 c0 rjmp .+160 ; 0x1e860 { custom_message_type = CustomMsg::Status; 1e7c0: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 1e7c4: 8b e7 ldi r24, 0x7B ; 123 1e7c6: 9b e4 ldi r25, 0x4B ; 75 1e7c8: 0e 94 0a 75 call 0xea14 ; 0xea14 1e7cc: 0e 94 85 dc call 0x1b90a ; 0x1b90a lcd_commands_type = LcdCommands::Idle; 1e7d0: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1e7d4: 82 e0 ldi r24, 0x02 ; 2 1e7d6: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1e7da: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 #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(); 1e7de: 0f 94 fe 16 call 0x22dfc ; 0x22dfc save_statistics(); 1e7e2: 0e 94 80 64 call 0xc900 ; 0xc900 // lift Z raise_z(10); 1e7e6: 60 e0 ldi r22, 0x00 ; 0 1e7e8: 70 e0 ldi r23, 0x00 ; 0 1e7ea: 80 e2 ldi r24, 0x20 ; 32 1e7ec: 91 e4 ldi r25, 0x41 ; 65 1e7ee: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1e7f2: 80 91 39 06 lds r24, 0x0639 ; 0x800639 1e7f6: 88 23 and r24, r24 1e7f8: 21 f1 breq .+72 ; 0x1e842 1e7fa: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 1e7fe: 88 23 and r24, r24 1e800: 01 f1 breq .+64 ; 0x1e842 current_position[X_AXIS] = X_CANCEL_POS; 1e802: 80 e0 ldi r24, 0x00 ; 0 1e804: 90 e0 ldi r25, 0x00 ; 0 1e806: a8 e4 ldi r26, 0x48 ; 72 1e808: b2 e4 ldi r27, 0x42 ; 66 1e80a: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1e80e: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1e812: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1e816: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = Y_CANCEL_POS; 1e81a: 80 e0 ldi r24, 0x00 ; 0 1e81c: 90 e0 ldi r25, 0x00 ; 0 1e81e: ae e3 ldi r26, 0x3E ; 62 1e820: b3 e4 ldi r27, 0x43 ; 67 1e822: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1e826: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1e82a: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1e82e: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1e832: 60 e0 ldi r22, 0x00 ; 0 1e834: 70 e0 ldi r23, 0x00 ; 0 1e836: 84 e3 ldi r24, 0x34 ; 52 1e838: 92 e4 ldi r25, 0x42 ; 66 1e83a: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 1e83e: 0f 94 b0 18 call 0x23160 ; 0x23160 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1e842: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> // 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()) { 1e846: 88 23 and r24, r24 1e848: 09 f4 brne .+2 ; 0x1e84c 1e84a: ba c0 rjmp .+372 ; 0x1e9c0 // time to stop the error beep WRITE(BEEPER, LOW); 1e84c: 72 98 cbi 0x0e, 2 ; 14 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 1e84e: 0f 94 52 0e call 0x21ca4 ; 0x21ca4 finishAndDisableSteppers(); //M84 1e852: 0e 94 4d 84 call 0x1089a ; 0x1089a axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 1e856: 88 e0 ldi r24, 0x08 ; 8 1e858: 80 93 57 12 sts 0x1257, r24 ; 0x801257 did_pause_print = false; // Clear pause state in case the print was aborted while paused 1e85c: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 1e860: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e864: 82 30 cpi r24, 0x02 ; 2 1e866: 09 f0 breq .+2 ; 0x1e86a 1e868: 63 c0 rjmp .+198 ; 0x1e930 1e86a: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1e86e: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && !homing_flag) 1e872: 98 13 cpse r25, r24 1e874: 5d c0 rjmp .+186 ; 0x1e930 1e876: 80 91 71 12 lds r24, 0x1271 ; 0x801271 1e87a: 81 11 cpse r24, r1 1e87c: 59 c0 rjmp .+178 ; 0x1e930 { if (custom_message_type != CustomMsg::M117) 1e87e: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 1e882: 87 30 cpi r24, 0x07 ; 7 1e884: 41 f0 breq .+16 ; 0x1e896 { custom_message_type = CustomMsg::Status; 1e886: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1e88a: 8c e6 ldi r24, 0x6C ; 108 1e88c: 9b e4 ldi r25, 0x4B ; 75 1e88e: 0e 94 0a 75 call 0xea14 ; 0xea14 1e892: 0e 94 85 dc call 0x1b90a ; 0x1b90a } lcd_commands_type = LcdCommands::Idle; 1e896: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1e89a: 82 e0 ldi r24, 0x02 ; 2 1e89c: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1e8a0: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 1e8a4: 0f 94 b0 18 call 0x23160 ; 0x23160 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 1e8a8: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1e8ac: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1e8b0: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 1e8b4: 60 91 4a 02 lds r22, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.491+0x8> 1e8b8: 70 91 4b 02 lds r23, 0x024B ; 0x80024b <_ZL14pause_position.lto_priv.491+0x9> 1e8bc: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL14pause_position.lto_priv.491+0xa> 1e8c0: 90 91 4d 02 lds r25, 0x024D ; 0x80024d <_ZL14pause_position.lto_priv.491+0xb> 1e8c4: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1e8c8: 80 91 39 06 lds r24, 0x0639 ; 0x800639 1e8cc: 88 23 and r24, r24 1e8ce: 51 f1 breq .+84 ; 0x1e924 1e8d0: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 1e8d4: 88 23 and r24, r24 1e8d6: 31 f1 breq .+76 ; 0x1e924 current_position[X_AXIS] = pause_position[X_AXIS]; 1e8d8: 80 91 42 02 lds r24, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.491> 1e8dc: 90 91 43 02 lds r25, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.491+0x1> 1e8e0: a0 91 44 02 lds r26, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.491+0x2> 1e8e4: b0 91 45 02 lds r27, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.491+0x3> 1e8e8: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1e8ec: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1e8f0: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1e8f4: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pause_position[Y_AXIS]; 1e8f8: 80 91 46 02 lds r24, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.491+0x4> 1e8fc: 90 91 47 02 lds r25, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.491+0x5> 1e900: a0 91 48 02 lds r26, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.491+0x6> 1e904: b0 91 49 02 lds r27, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.491+0x7> 1e908: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1e90c: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1e910: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1e914: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(50); 1e918: 60 e0 ldi r22, 0x00 ; 0 1e91a: 70 e0 ldi r23, 0x00 ; 0 1e91c: 88 e4 ldi r24, 0x48 ; 72 1e91e: 92 e4 ldi r25, 0x42 ; 66 1e920: 0f 94 0a 4a call 0x29414 ; 0x29414 1e924: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> } // did we come here from a thermal error? if(get_temp_error()) { 1e928: 88 23 and r24, r24 1e92a: 09 f4 brne .+2 ; 0x1e92e 1e92c: 73 c0 rjmp .+230 ; 0x1ea14 // time to stop the error beep WRITE(BEEPER, LOW); 1e92e: 72 98 cbi 0x0e, 2 ; 14 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 1e930: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e934: 84 30 cpi r24, 0x04 ; 4 1e936: 09 f0 breq .+2 ; 0x1e93a 1e938: a7 c0 rjmp .+334 ; 0x1ea88 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 1e93a: 85 ea ldi r24, 0xA5 ; 165 1e93c: 9d e0 ldi r25, 0x0D ; 13 1e93e: 0f 94 ab a3 call 0x34756 ; 0x34756 1e942: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 1e946: 20 91 3f 0d lds r18, 0x0D3F ; 0x800d3f const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1e94a: 32 13 cpse r19, r18 1e94c: 74 c1 rjmp .+744 ; 0x1ec36 1e94e: 20 91 3c 12 lds r18, 0x123C ; 0x80123c 1e952: 30 91 3d 12 lds r19, 0x123D ; 0x80123d 1e956: 23 2b or r18, r19 1e958: 09 f0 breq .+2 ; 0x1e95c 1e95a: 6d c1 rjmp .+730 ; 0x1ec36 1e95c: c0 91 73 12 lds r28, 0x1273 ; 0x801273 1e960: c1 11 cpse r28, r1 1e962: 69 c1 rjmp .+722 ; 0x1ec36 { if (lcd_commands_step == 0) 1e964: 20 91 e2 03 lds r18, 0x03E2 ; 0x8003e2 1e968: 21 11 cpse r18, r1 1e96a: 57 c0 rjmp .+174 ; 0x1ea1a lcd_commands_step = 12; 1e96c: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 1e96e: 20 93 e2 03 sts 0x03E2, r18 ; 0x8003e2 } 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; 1e972: 44 96 adiw r24, 0x14 ; 20 1e974: bc 01 movw r22, r24 1e976: 90 e0 ldi r25, 0x00 ; 0 1e978: 80 e0 ldi r24, 0x00 ; 0 1e97a: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 1e97e: 20 e0 ldi r18, 0x00 ; 0 1e980: 30 e0 ldi r19, 0x00 ; 0 1e982: 4a e7 ldi r20, 0x7A ; 122 1e984: 54 e4 ldi r21, 0x44 ; 68 1e986: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1e98a: 4b 01 movw r8, r22 1e98c: 5c 01 movw r10, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 1e98e: e0 91 e2 03 lds r30, 0x03E2 ; 0x8003e2 1e992: e1 50 subi r30, 0x01 ; 1 1e994: ec 30 cpi r30, 0x0C ; 12 1e996: 08 f0 brcs .+2 ; 0x1e99a 1e998: 77 c0 rjmp .+238 ; 0x1ea88 1e99a: f0 e0 ldi r31, 0x00 ; 0 1e99c: 88 27 eor r24, r24 1e99e: ec 52 subi r30, 0x2C ; 44 1e9a0: fb 40 sbci r31, 0x0B ; 11 1e9a2: 8f 4f sbci r24, 0xFF ; 255 1e9a4: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 1e9a8: 16 f8 bld r1, 6 1e9aa: 12 f8 bld r1, 2 1e9ac: a8 f7 brcc .-22 ; 0x1e998 1e9ae: a8 f7 brcc .-22 ; 0x1e99a 1e9b0: a8 f7 brcc .-22 ; 0x1e99c 1e9b2: a8 f7 brcc .-22 ; 0x1e99e 1e9b4: 51 f7 brne .-44 ; 0x1e98a 1e9b6: c0 f6 brcc .-80 ; 0x1e968 1e9b8: bc f6 brge .-82 ; 0x1e968 1e9ba: 4f f6 brid .-110 ; 0x1e94e 1e9bc: 15 f5 brhc .+68 ; 0x1ea02 1e9be: 0f f5 brid .+66 ; 0x1ea02 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 1e9c0: 10 92 55 12 sts 0x1255, r1 ; 0x801255 { #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(); 1e9c4: 0e 94 72 77 call 0xeee4 ; 0xeee4 setExtruderAutoFanState(1); 1e9c8: 81 e0 ldi r24, 0x01 ; 1 1e9ca: 0e 94 7f 77 call 0xeefe ; 0xeefe // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1e9ce: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1e9d2: 81 30 cpi r24, 0x01 ; 1 1e9d4: 09 f0 breq .+2 ; 0x1e9d8 1e9d6: 3b cf rjmp .-394 ; 0x1e84e fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 1e9d8: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 1e9dc: 88 23 and r24, r24 1e9de: 09 f4 brne .+2 ; 0x1e9e2 1e9e0: 36 cf rjmp .-404 ; 0x1e84e #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1e9e2: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 1e9e6: 82 30 cpi r24, 0x02 ; 2 1e9e8: 09 f4 brne .+2 ; 0x1e9ec 1e9ea: 31 cf rjmp .-414 ; 0x1e84e #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()) 1e9ec: 0e 94 05 66 call 0xcc0a ; 0xcc0a 1e9f0: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 1e9f2: 0e 94 f3 63 call 0xc7e6 ; 0xc7e6 } // 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) { 1e9f6: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 1e9fa: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 1e9fe: 80 91 57 02 lds r24, 0x0257 ; 0x800257 1ea02: 90 91 58 02 lds r25, 0x0258 ; 0x800258 1ea06: 28 17 cp r18, r24 1ea08: 39 07 cpc r19, r25 1ea0a: 0c f4 brge .+2 ; 0x1ea0e 1ea0c: 20 cf rjmp .-448 ; 0x1e84e MMU2::mmu2.unload(); // M702 1ea0e: 0f 94 2e 9d call 0x33a5c ; 0x33a5c 1ea12: 1d cf rjmp .-454 ; 0x1e84e } else { // Turn off the print fan fanSpeed = 0; 1ea14: 10 92 55 12 sts 0x1255, r1 ; 0x801255 1ea18: 8b cf rjmp .-234 ; 0x1e930 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 1ea1a: 21 50 subi r18, 0x01 ; 1 1ea1c: a8 cf rjmp .-176 ; 0x1e96e preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 1ea1e: 65 e0 ldi r22, 0x05 ; 5 1ea20: 8a e7 ldi r24, 0x7A ; 122 1ea22: 94 e8 ldi r25, 0x84 ; 132 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]))); 1ea24: 0e 94 89 8d call 0x11b12 ; 0x11b12 1ea28: 2f c0 rjmp .+94 ; 0x1ea88 //! @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()) 1ea2a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1ea2e: 81 30 cpi r24, 0x01 ; 1 1ea30: 49 f5 brne .+82 ; 0x1ea84 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 1ea32: d0 91 e1 03 lds r29, 0x03E1 ; 0x8003e1 { enquecommand_P(MSG_M83); 1ea36: 61 e0 ldi r22, 0x01 ; 1 1ea38: 83 eb ldi r24, 0xB3 ; 179 1ea3a: 9c e6 ldi r25, 0x6C ; 108 1ea3c: 0e 94 da 8c call 0x119b4 ; 0x119b4 enquecommand_P(PSTR("G1Y-3F1000")); 1ea40: 61 e0 ldi r22, 0x01 ; 1 1ea42: 8f e6 ldi r24, 0x6F ; 111 1ea44: 94 e8 ldi r25, 0x84 ; 132 1ea46: 0e 94 da 8c call 0x119b4 ; 0x119b4 enquecommand_P(PSTR("G1Z0.4")); 1ea4a: 61 e0 ldi r22, 0x01 ; 1 1ea4c: 88 e6 ldi r24, 0x68 ; 104 1ea4e: 94 e8 ldi r25, 0x84 ; 132 1ea50: 0e 94 da 8c call 0x119b4 ; 0x119b4 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 1ea54: 0f 94 7f 65 call 0x2cafe ; 0x2cafe if(currentTool == filament ){ 1ea58: d8 17 cp r29, r24 1ea5a: a1 f0 breq .+40 ; 0x1ea84 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 1ea5c: 8f 3f cpi r24, 0xFF ; 255 1ea5e: 29 f0 breq .+10 ; 0x1ea6a // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 1ea60: 61 e0 ldi r22, 0x01 ; 1 1ea62: 88 ec ldi r24, 0xC8 ; 200 1ea64: 98 e6 ldi r25, 0x68 ; 104 1ea66: 0e 94 da 8c call 0x119b4 ; 0x119b4 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 1ea6a: 1f 92 push r1 1ea6c: df 93 push r29 1ea6e: 84 e6 ldi r24, 0x64 ; 100 1ea70: 94 e8 ldi r25, 0x84 ; 132 1ea72: 9f 93 push r25 1ea74: 8f 93 push r24 1ea76: 0e 94 a8 8d call 0x11b50 ; 0x11b50 1ea7a: 0f 90 pop r0 1ea7c: 0f 90 pop r0 1ea7e: 0f 90 pop r0 1ea80: 0f 90 pop r0 return true; 1ea82: c1 e0 ldi r28, 0x01 ; 1 1ea84: c0 93 e0 03 sts 0x03E0, r28 ; 0x8003e0 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 1ea88: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1ea8c: 83 30 cpi r24, 0x03 ; 3 1ea8e: 09 f0 breq .+2 ; 0x1ea92 1ea90: d2 c0 rjmp .+420 ; 0x1ec36 if (lcd_commands_step == 0) { 1ea92: 90 91 e2 03 lds r25, 0x03E2 ; 0x8003e2 1ea96: 91 11 cpse r25, r1 1ea98: 09 c0 rjmp .+18 ; 0x1eaac custom_message_type = CustomMsg::PidCal; 1ea9a: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = 1; 1ea9e: 91 e0 ldi r25, 0x01 ; 1 1eaa0: 90 93 de 03 sts 0x03DE, r25 ; 0x8003de lcd_draw_update = 3; 1eaa4: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_commands_step = 3; 1eaa8: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 1eaac: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1eab0: 83 30 cpi r24, 0x03 ; 3 1eab2: 19 f5 brne .+70 ; 0x1eafa 1eab4: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1eab8: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 1eabc: 98 13 cpse r25, r24 1eabe: 1d c0 rjmp .+58 ; 0x1eafa return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 1eac0: 0f 94 3d 0e call 0x21c7a ; 0x21c7a pid_tuning_finished = false; 1eac4: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.427> 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); 1eac8: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1eacc: 8f 93 push r24 1eace: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 1ead2: 8f 93 push r24 1ead4: 8f ee ldi r24, 0xEF ; 239 1ead6: 94 e8 ldi r25, 0x84 ; 132 1ead8: 9f 93 push r25 1eada: 8f 93 push r24 1eadc: 0e 94 a8 8d call 0x11b50 ; 0x11b50 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 1eae0: 81 e6 ldi r24, 0x61 ; 97 1eae2: 9b e4 ldi r25, 0x4B ; 75 1eae4: 0e 94 0a 75 call 0xea14 ; 0xea14 1eae8: 0e 94 85 dc call 0x1b90a ; 0x1b90a lcd_commands_step = 2; 1eaec: 82 e0 ldi r24, 0x02 ; 2 1eaee: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 1eaf2: 0f 90 pop r0 1eaf4: 0f 90 pop r0 1eaf6: 0f 90 pop r0 1eaf8: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 1eafa: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1eafe: 82 30 cpi r24, 0x02 ; 2 1eb00: 09 f0 breq .+2 ; 0x1eb04 1eb02: 7a c0 rjmp .+244 ; 0x1ebf8 1eb04: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.427> 1eb08: 88 23 and r24, r24 1eb0a: 09 f4 brne .+2 ; 0x1eb0e 1eb0c: 75 c0 rjmp .+234 ; 0x1ebf8 custom_message_state = 0; 1eb0e: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 1eb12: 8d e4 ldi r24, 0x4D ; 77 1eb14: 9b e4 ldi r25, 0x4B ; 75 1eb16: 0e 94 0a 75 call 0xea14 ; 0xea14 1eb1a: 0e 94 85 dc call 0x1b90a ; 0x1b90a 1eb1e: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1eb22: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 1eb26: c0 91 da 03 lds r28, 0x03DA ; 0x8003da <_Kp> 1eb2a: d0 91 db 03 lds r29, 0x03DB ; 0x8003db <_Kp+0x1> 1eb2e: 10 91 dc 03 lds r17, 0x03DC ; 0x8003dc <_Kp+0x2> 1eb32: 00 91 dd 03 lds r16, 0x03DD ; 0x8003dd <_Kp+0x3> 1eb36: 20 e0 ldi r18, 0x00 ; 0 1eb38: 30 e0 ldi r19, 0x00 ; 0 1eb3a: a9 01 movw r20, r18 1eb3c: f8 01 movw r30, r16 1eb3e: 6c 2f mov r22, r28 1eb40: 7d 2f mov r23, r29 1eb42: 8f 2f mov r24, r31 1eb44: 9e 2f mov r25, r30 1eb46: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1eb4a: 81 11 cpse r24, r1 1eb4c: 1f c0 rjmp .+62 ; 0x1eb8c 1eb4e: 20 e0 ldi r18, 0x00 ; 0 1eb50: 30 e0 ldi r19, 0x00 ; 0 1eb52: a9 01 movw r20, r18 1eb54: 60 91 d6 03 lds r22, 0x03D6 ; 0x8003d6 <_Ki> 1eb58: 70 91 d7 03 lds r23, 0x03D7 ; 0x8003d7 <_Ki+0x1> 1eb5c: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 1eb60: 90 91 d9 03 lds r25, 0x03D9 ; 0x8003d9 <_Ki+0x3> 1eb64: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1eb68: 81 11 cpse r24, r1 1eb6a: 10 c0 rjmp .+32 ; 0x1eb8c 1eb6c: 20 e0 ldi r18, 0x00 ; 0 1eb6e: 30 e0 ldi r19, 0x00 ; 0 1eb70: a9 01 movw r20, r18 1eb72: 60 91 d2 03 lds r22, 0x03D2 ; 0x8003d2 <_Kd> 1eb76: 70 91 d3 03 lds r23, 0x03D3 ; 0x8003d3 <_Kd+0x1> 1eb7a: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 1eb7e: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_Kd+0x3> 1eb82: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1eb86: 88 23 and r24, r24 1eb88: 09 f4 brne .+2 ; 0x1eb8c 1eb8a: 66 c2 rjmp .+1228 ; 0x1f058 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 1eb8c: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_Kd+0x3> 1eb90: 8f 93 push r24 1eb92: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 1eb96: 8f 93 push r24 1eb98: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_Kd+0x1> 1eb9c: 8f 93 push r24 1eb9e: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 <_Kd> 1eba2: 8f 93 push r24 1eba4: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 <_Ki+0x3> 1eba8: 8f 93 push r24 1ebaa: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 1ebae: 8f 93 push r24 1ebb0: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_Ki+0x1> 1ebb4: 8f 93 push r24 1ebb6: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 <_Ki> 1ebba: 8f 93 push r24 1ebbc: 0f 93 push r16 1ebbe: 1f 93 push r17 1ebc0: df 93 push r29 1ebc2: cf 93 push r28 1ebc4: 88 ed ldi r24, 0xD8 ; 216 1ebc6: 94 e8 ldi r25, 0x84 ; 132 1ebc8: 9f 93 push r25 1ebca: 8f 93 push r24 1ebcc: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommand_P(MSG_M500); 1ebd0: 61 e0 ldi r22, 0x01 ; 1 1ebd2: 83 ed ldi r24, 0xD3 ; 211 1ebd4: 98 e6 ldi r25, 0x68 ; 104 1ebd6: 0e 94 da 8c call 0x119b4 ; 0x119b4 1ebda: 8d b7 in r24, 0x3d ; 61 1ebdc: 9e b7 in r25, 0x3e ; 62 1ebde: 0e 96 adiw r24, 0x0e ; 14 1ebe0: 0f b6 in r0, 0x3f ; 63 1ebe2: f8 94 cli 1ebe4: 9e bf out 0x3e, r25 ; 62 1ebe6: 0f be out 0x3f, r0 ; 63 1ebe8: 8d bf out 0x3d, r24 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 1ebea: 8f ec ldi r24, 0xCF ; 207 1ebec: 93 e0 ldi r25, 0x03 ; 3 1ebee: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> lcd_commands_step = 1; 1ebf2: 81 e0 ldi r24, 0x01 ; 1 1ebf4: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 1ebf8: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1ebfc: 81 30 cpi r24, 0x01 ; 1 1ebfe: d9 f4 brne .+54 ; 0x1ec36 1ec00: 60 ed ldi r22, 0xD0 ; 208 1ec02: 77 e0 ldi r23, 0x07 ; 7 1ec04: 8f ec ldi r24, 0xCF ; 207 1ec06: 93 e0 ldi r25, 0x03 ; 3 1ec08: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 1ec0c: 88 23 and r24, r24 1ec0e: 99 f0 breq .+38 ; 0x1ec36 lcd_setstatuspgm(MSG_WELCOME); 1ec10: 86 ee ldi r24, 0xE6 ; 230 1ec12: 9b e6 ldi r25, 0x6B ; 107 1ec14: 0e 94 85 dc call 0x1b90a ; 0x1b90a custom_message_type = CustomMsg::Status; 1ec18: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d pid_temp = DEFAULT_PID_TEMP; 1ec1c: 82 ed ldi r24, 0xD2 ; 210 1ec1e: 90 e0 ldi r25, 0x00 ; 0 1ec20: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f 1ec24: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e lcd_commands_step = 0; 1ec28: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1ec2c: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1ec30: 82 e0 ldi r24, 0x02 ; 2 1ec32: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 1ec36: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1ec3a: 85 30 cpi r24, 0x05 ; 5 1ec3c: e9 f4 brne .+58 ; 0x1ec78 1ec3e: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1ec42: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1ec46: 98 13 cpse r25, r24 1ec48: 17 c0 rjmp .+46 ; 0x1ec78 1ec4a: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1ec4e: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1ec52: 89 2b or r24, r25 1ec54: 89 f4 brne .+34 ; 0x1ec78 1ec56: 80 91 73 12 lds r24, 0x1273 ; 0x801273 1ec5a: 81 11 cpse r24, r1 1ec5c: 0d c0 rjmp .+26 ; 0x1ec78 #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) 1ec5e: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1ec62: 81 30 cpi r24, 0x01 ; 1 1ec64: 09 f4 brne .+2 ; 0x1ec68 1ec66: 2d c2 rjmp .+1114 ; 0x1f0c2 1ec68: 08 f4 brcc .+2 ; 0x1ec6c 1ec6a: fb c1 rjmp .+1014 ; 0x1f062 1ec6c: 82 30 cpi r24, 0x02 ; 2 1ec6e: 09 f4 brne .+2 ; 0x1ec72 1ec70: 13 c2 rjmp .+1062 ; 0x1f098 1ec72: 83 30 cpi r24, 0x03 ; 3 1ec74: 09 f4 brne .+2 ; 0x1ec78 1ec76: f9 c1 rjmp .+1010 ; 0x1f06a menu_depth = 3; break; } } } } 1ec78: df 91 pop r29 1ec7a: cf 91 pop r28 1ec7c: 1f 91 pop r17 1ec7e: 0f 91 pop r16 1ec80: ff 90 pop r15 1ec82: ef 90 pop r14 1ec84: df 90 pop r13 1ec86: cf 90 pop r12 1ec88: bf 90 pop r11 1ec8a: af 90 pop r10 1ec8c: 9f 90 pop r9 1ec8e: 8f 90 pop r8 1ec90: 7f 90 pop r7 1ec92: 6f 90 pop r6 1ec94: 5f 90 pop r5 1ec96: 4f 90 pop r4 1ec98: 3f 90 pop r3 1ec9a: 2f 90 pop r2 1ec9c: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 1ec9e: 0e 94 f6 6f call 0xdfec ; 0xdfec menu_depth = 0; 1eca2: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df menu_submenu(lcd_babystep_z, true); 1eca6: 61 e0 ldi r22, 0x01 ; 1 1eca8: 89 e5 ldi r24, 0x59 ; 89 1ecaa: 95 ed ldi r25, 0xD5 ; 213 1ecac: 0e 94 ad 62 call 0xc55a ; 0xc55a cmd_intro_mmu_9, cmd_intro_mmu_10, cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) 1ecb0: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1ecb4: 81 30 cpi r24, 0x01 ; 1 1ecb6: b9 f4 brne .+46 ; 0x1ece6 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 1ecb8: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1ecbc: 10 e0 ldi r17, 0x00 ; 0 1ecbe: 81 11 cpse r24, r1 1ecc0: 01 c0 rjmp .+2 ; 0x1ecc4 1ecc2: 12 e0 ldi r17, 0x02 ; 2 1ecc4: c1 2f mov r28, r17 1ecc6: d0 e0 ldi r29, 0x00 ; 0 1ecc8: cc 0f add r28, r28 1ecca: dd 1f adc r29, r29 1eccc: ce 5a subi r28, 0xAE ; 174 1ecce: db 47 sbci r29, 0x7B ; 123 { enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); 1ecd0: fe 01 movw r30, r28 1ecd2: 85 91 lpm r24, Z+ 1ecd4: 94 91 lpm r25, Z 1ecd6: 61 e0 ldi r22, 0x01 ; 1 1ecd8: 0e 94 da 8c call 0x119b4 ; 0x119b4 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) 1ecdc: 1f 5f subi r17, 0xFF ; 255 1ecde: 22 96 adiw r28, 0x02 ; 2 1ece0: 19 30 cpi r17, 0x09 ; 9 1ece2: b1 f7 brne .-20 ; 0x1ecd0 1ece4: d1 ce rjmp .-606 ; 0x1ea88 enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); } } else { enquecommand_P(feedrate_F1080); //fixed velocity for the intro line 1ece6: 61 e0 ldi r22, 0x01 ; 1 1ece8: 8a e4 ldi r24, 0x4A ; 74 1ecea: 94 e8 ldi r25, 0x84 ; 132 1ecec: 0e 94 da 8c call 0x119b4 ; 0x119b4 enquecommandf_P(extrude_fmt_X, 60.f, count_e(layer_height, extrusion_width * 4.f, 60)); 1ecf0: 20 e0 ldi r18, 0x00 ; 0 1ecf2: 30 e0 ldi r19, 0x00 ; 0 1ecf4: 40 e8 ldi r20, 0x80 ; 128 1ecf6: 50 e4 ldi r21, 0x40 ; 64 1ecf8: c5 01 movw r24, r10 1ecfa: b4 01 movw r22, r8 1ecfc: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1ed00: 20 e0 ldi r18, 0x00 ; 0 1ed02: 30 e0 ldi r19, 0x00 ; 0 1ed04: 40 e7 ldi r20, 0x70 ; 112 1ed06: 52 e4 ldi r21, 0x42 ; 66 1ed08: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1ed0c: 9f 93 push r25 1ed0e: 8f 93 push r24 1ed10: 7f 93 push r23 1ed12: 6f 93 push r22 1ed14: 82 e4 ldi r24, 0x42 ; 66 1ed16: 8f 93 push r24 1ed18: 80 e7 ldi r24, 0x70 ; 112 1ed1a: 8f 93 push r24 1ed1c: 1f 92 push r1 1ed1e: 1f 92 push r1 1ed20: cd e3 ldi r28, 0x3D ; 61 1ed22: d4 e8 ldi r29, 0x84 ; 132 1ed24: df 93 push r29 1ed26: cf 93 push r28 1ed28: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommandf_P(extrude_fmt_X, 202.5f, count_e(layer_height, extrusion_width * 8.f, 142.5)); 1ed2c: 20 e0 ldi r18, 0x00 ; 0 1ed2e: 30 e0 ldi r19, 0x00 ; 0 1ed30: 40 e0 ldi r20, 0x00 ; 0 1ed32: 51 e4 ldi r21, 0x41 ; 65 1ed34: c5 01 movw r24, r10 1ed36: b4 01 movw r22, r8 1ed38: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1ed3c: 20 e0 ldi r18, 0x00 ; 0 1ed3e: 30 e8 ldi r19, 0x80 ; 128 1ed40: 4e e0 ldi r20, 0x0E ; 14 1ed42: 53 e4 ldi r21, 0x43 ; 67 1ed44: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1ed48: 9f 93 push r25 1ed4a: 8f 93 push r24 1ed4c: 7f 93 push r23 1ed4e: 6f 93 push r22 1ed50: 83 e4 ldi r24, 0x43 ; 67 1ed52: 8f 93 push r24 1ed54: 8a e4 ldi r24, 0x4A ; 74 1ed56: 8f 93 push r24 1ed58: 80 e8 ldi r24, 0x80 ; 128 1ed5a: 8f 93 push r24 1ed5c: 1f 92 push r1 1ed5e: df 93 push r29 1ed60: cf 93 push r28 1ed62: 0e 94 a8 8d call 0x11b50 ; 0x11b50 1ed66: 8d b7 in r24, 0x3d ; 61 1ed68: 9e b7 in r25, 0x3e ; 62 1ed6a: 44 96 adiw r24, 0x14 ; 20 1ed6c: 0f b6 in r0, 0x3f ; 63 1ed6e: f8 94 cli 1ed70: 9e bf out 0x3e, r25 ; 62 1ed72: 0f be out 0x3f, r0 ; 63 1ed74: 8d bf out 0x3d, r24 ; 61 1ed76: 88 ce rjmp .-752 ; 0x1ea88 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]))); 1ed78: 66 e0 ldi r22, 0x06 ; 6 1ed7a: 81 e3 ldi r24, 0x31 ; 49 1ed7c: 94 e8 ldi r25, 0x84 ; 132 1ed7e: 52 ce rjmp .-860 ; 0x1ea24 //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { #ifndef NEW_FIRST_LAYER_CAL enquecommand_P(PSTR("G1X50Y155")); 1ed80: 61 e0 ldi r22, 0x01 ; 1 1ed82: 87 e2 ldi r24, 0x27 ; 39 1ed84: 94 e8 ldi r25, 0x84 ; 132 1ed86: 0e 94 da 8c call 0x119b4 ; 0x119b4 #endif //_NEW_FIRST_LAYER_CAL static const char fmt1[] PROGMEM = "G1Z%.2f"; enquecommandf_P(fmt1, layer_height); 1ed8a: 8e e3 ldi r24, 0x3E ; 62 1ed8c: 8f 93 push r24 1ed8e: 8c e4 ldi r24, 0x4C ; 76 1ed90: 8f 93 push r24 1ed92: 8c ec ldi r24, 0xCC ; 204 1ed94: 8f 93 push r24 1ed96: 8d ec ldi r24, 0xCD ; 205 1ed98: 8f 93 push r24 1ed9a: 8f e1 ldi r24, 0x1F ; 31 1ed9c: 94 e8 ldi r25, 0x84 ; 132 1ed9e: 9f 93 push r25 1eda0: 8f 93 push r24 1eda2: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommand_P(feedrate_F1080); 1eda6: 61 e0 ldi r22, 0x01 ; 1 1eda8: 8a e4 ldi r24, 0x4A ; 74 1edaa: 94 e8 ldi r25, 0x84 ; 132 1edac: 0e 94 da 8c call 0x119b4 ; 0x119b4 enquecommand_P(MSG_G91); //enable relative XYZ 1edb0: 61 e0 ldi r22, 0x01 ; 1 1edb2: 84 ec ldi r24, 0xC4 ; 196 1edb4: 98 e6 ldi r25, 0x68 ; 104 1edb6: 0e 94 da 8c call 0x119b4 ; 0x119b4 #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)); 1edba: 20 e0 ldi r18, 0x00 ; 0 1edbc: 30 e0 ldi r19, 0x00 ; 0 1edbe: 40 e8 ldi r20, 0x80 ; 128 1edc0: 50 e4 ldi r21, 0x40 ; 64 1edc2: c5 01 movw r24, r10 1edc4: b4 01 movw r22, r8 1edc6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1edca: 20 e0 ldi r18, 0x00 ; 0 1edcc: 30 e0 ldi r19, 0x00 ; 0 1edce: 48 ec ldi r20, 0xC8 ; 200 1edd0: 51 e4 ldi r21, 0x41 ; 65 1edd2: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1edd6: 9f 93 push r25 1edd8: 8f 93 push r24 1edda: 7f 93 push r23 1eddc: 6f 93 push r22 1edde: 01 e4 ldi r16, 0x41 ; 65 1ede0: 0f 93 push r16 1ede2: 18 ec ldi r17, 0xC8 ; 200 1ede4: 1f 93 push r17 1ede6: 1f 92 push r1 1ede8: 1f 92 push r1 1edea: cd e3 ldi r28, 0x3D ; 61 1edec: d4 e8 ldi r29, 0x84 ; 132 1edee: df 93 push r29 1edf0: cf 93 push r28 1edf2: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 2.f, 25)); 1edf6: a5 01 movw r20, r10 1edf8: 94 01 movw r18, r8 1edfa: c5 01 movw r24, r10 1edfc: b4 01 movw r22, r8 1edfe: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1ee02: 20 e0 ldi r18, 0x00 ; 0 1ee04: 30 e0 ldi r19, 0x00 ; 0 1ee06: 48 ec ldi r20, 0xC8 ; 200 1ee08: 51 e4 ldi r21, 0x41 ; 65 1ee0a: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1ee0e: 9f 93 push r25 1ee10: 8f 93 push r24 1ee12: 7f 93 push r23 1ee14: 6f 93 push r22 1ee16: 0f 93 push r16 1ee18: 1f 93 push r17 1ee1a: 1f 92 push r1 1ee1c: 1f 92 push r1 1ee1e: df 93 push r29 1ee20: cf 93 push r28 1ee22: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommandf_P(extrude_fmt_X, 100.f*invert, count_e(layer_height, extrusion_width, 100)); 1ee26: 20 e0 ldi r18, 0x00 ; 0 1ee28: 30 e0 ldi r19, 0x00 ; 0 1ee2a: 48 ec ldi r20, 0xC8 ; 200 1ee2c: 52 e4 ldi r21, 0x42 ; 66 1ee2e: c5 01 movw r24, r10 1ee30: b4 01 movw r22, r8 1ee32: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1ee36: 9f 93 push r25 1ee38: 8f 93 push r24 1ee3a: 7f 93 push r23 1ee3c: 6f 93 push r22 1ee3e: 82 e4 ldi r24, 0x42 ; 66 1ee40: 8f 93 push r24 1ee42: 1f 93 push r17 1ee44: 1f 92 push r1 1ee46: 1f 92 push r1 1ee48: df 93 push r29 1ee4a: cf 93 push r28 1ee4c: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommandf_P(extrude_fmt_Y, -20.f*invert, count_e(layer_height, extrusion_width, 20)); 1ee50: 8d b7 in r24, 0x3d ; 61 1ee52: 9e b7 in r25, 0x3e ; 62 1ee54: 84 96 adiw r24, 0x24 ; 36 1ee56: 0f b6 in r0, 0x3f ; 63 1ee58: f8 94 cli 1ee5a: 9e bf out 0x3e, r25 ; 62 1ee5c: 0f be out 0x3f, r0 ; 63 1ee5e: 8d bf out 0x3d, r24 ; 61 1ee60: 20 e0 ldi r18, 0x00 ; 0 1ee62: 30 e0 ldi r19, 0x00 ; 0 1ee64: 40 ea ldi r20, 0xA0 ; 160 1ee66: 51 e4 ldi r21, 0x41 ; 65 1ee68: c5 01 movw r24, r10 1ee6a: b4 01 movw r22, r8 1ee6c: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1ee70: 9f 93 push r25 1ee72: 8f 93 push r24 1ee74: 7f 93 push r23 1ee76: 6f 93 push r22 1ee78: 81 ec ldi r24, 0xC1 ; 193 1ee7a: 8f 93 push r24 1ee7c: 80 ea ldi r24, 0xA0 ; 160 1ee7e: 8f 93 push r24 1ee80: 1f 92 push r1 1ee82: 1f 92 push r1 1ee84: 82 e1 ldi r24, 0x12 ; 18 1ee86: 94 e8 ldi r25, 0x84 ; 132 1ee88: 9f 93 push r25 1ee8a: 8f 93 push r24 1ee8c: 0e 94 a8 8d call 0x11b50 ; 0x11b50 1ee90: 8d b7 in r24, 0x3d ; 61 1ee92: 9e b7 in r25, 0x3e ; 62 1ee94: 0a 96 adiw r24, 0x0a ; 10 1ee96: 0f b6 in r0, 0x3f ; 63 1ee98: f8 94 cli 1ee9a: 9e bf out 0x3e, r25 ; 62 1ee9c: 0f be out 0x3f, r0 ; 63 1ee9e: 8d bf out 0x3d, r24 ; 61 1eea0: f3 cd rjmp .-1050 ; 0x1ea88 //! @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); 1eea2: 20 e0 ldi r18, 0x00 ; 0 1eea4: 30 e0 ldi r19, 0x00 ; 0 1eea6: 46 e1 ldi r20, 0x16 ; 22 1eea8: 53 e4 ldi r21, 0x43 ; 67 1eeaa: c5 01 movw r24, r10 1eeac: b4 01 movw r22, r8 1eeae: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1eeb2: 76 2e mov r7, r22 1eeb4: 67 2e mov r6, r23 1eeb6: 58 2e mov r5, r24 1eeb8: 49 2e mov r4, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 1eeba: 20 e0 ldi r18, 0x00 ; 0 1eebc: 30 e0 ldi r19, 0x00 ; 0 1eebe: 40 ea ldi r20, 0xA0 ; 160 1eec0: 51 e4 ldi r21, 0x41 ; 65 1eec2: c5 01 movw r24, r10 1eec4: b4 01 movw r22, r8 1eec6: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1eeca: b6 2e mov r11, r22 1eecc: a7 2e mov r10, r23 1eece: 98 2e mov r9, r24 1eed0: 89 2e mov r8, r25 1eed2: c5 e0 ldi r28, 0x05 ; 5 for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 1eed4: df ef ldi r29, 0xFF ; 255 { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 1eed6: 2d e3 ldi r18, 0x3D ; 61 1eed8: e2 2e mov r14, r18 1eeda: 24 e8 ldi r18, 0x84 ; 132 1eedc: f2 2e mov r15, r18 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 1eede: 31 ec ldi r19, 0xC1 ; 193 1eee0: c3 2e mov r12, r19 1eee2: 40 ea ldi r20, 0xA0 ; 160 1eee4: d4 2e mov r13, r20 1eee6: 02 e1 ldi r16, 0x12 ; 18 1eee8: 14 e8 ldi r17, 0x84 ; 132 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); 1eeea: 4f 92 push r4 1eeec: 5f 92 push r5 1eeee: 6f 92 push r6 1eef0: 7f 92 push r7 1eef2: 6d 2f mov r22, r29 1eef4: 0d 2e mov r0, r29 1eef6: 00 0c add r0, r0 1eef8: 77 0b sbc r23, r23 1eefa: 88 0b sbc r24, r24 1eefc: 99 0b sbc r25, r25 1eefe: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1ef02: 20 e0 ldi r18, 0x00 ; 0 1ef04: 30 e0 ldi r19, 0x00 ; 0 1ef06: 46 e1 ldi r20, 0x16 ; 22 1ef08: 53 e4 ldi r21, 0x43 ; 67 1ef0a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1ef0e: 9f 93 push r25 1ef10: 8f 93 push r24 1ef12: 7f 93 push r23 1ef14: 6f 93 push r22 1ef16: ff 92 push r15 1ef18: ef 92 push r14 1ef1a: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 1ef1e: 8f 92 push r8 1ef20: 9f 92 push r9 1ef22: af 92 push r10 1ef24: bf 92 push r11 1ef26: cf 92 push r12 1ef28: df 92 push r13 1ef2a: 1f 92 push r1 1ef2c: 1f 92 push r1 1ef2e: 1f 93 push r17 1ef30: 0f 93 push r16 1ef32: 0e 94 a8 8d call 0x11b50 ; 0x11b50 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) 1ef36: d1 95 neg r29 1ef38: c1 50 subi r28, 0x01 ; 1 1ef3a: 8d b7 in r24, 0x3d ; 61 1ef3c: 9e b7 in r25, 0x3e ; 62 1ef3e: 44 96 adiw r24, 0x14 ; 20 1ef40: 0f b6 in r0, 0x3f ; 63 1ef42: f8 94 cli 1ef44: 9e bf out 0x3e, r25 ; 62 1ef46: 0f be out 0x3f, r0 ; 63 1ef48: 8d bf out 0x3d, r24 ; 61 1ef4a: c1 11 cpse r28, r1 1ef4c: ce cf rjmp .-100 ; 0x1eeea 1ef4e: 9c cd rjmp .-1224 ; 0x1ea88 //! @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); 1ef50: 23 e4 ldi r18, 0x43 ; 67 1ef52: 3d ec ldi r19, 0xCD ; 205 1ef54: 4f e2 ldi r20, 0x2F ; 47 1ef56: 5d e3 ldi r21, 0x3D ; 61 1ef58: c5 01 movw r24, r10 1ef5a: b4 01 movw r22, r8 1ef5c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1ef60: 6b 01 movw r12, r22 1ef62: 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); 1ef64: 20 e0 ldi r18, 0x00 ; 0 1ef66: 30 e0 ldi r19, 0x00 ; 0 1ef68: 40 ea ldi r20, 0xA0 ; 160 1ef6a: 51 e4 ldi r21, 0x41 ; 65 1ef6c: c5 01 movw r24, r10 1ef6e: b4 01 movw r22, r8 1ef70: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1ef74: 66 2e mov r6, r22 1ef76: 57 2e mov r5, r23 1ef78: 48 2e mov r4, r24 1ef7a: 39 2e mov r3, r25 const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); 1ef7c: a7 01 movw r20, r14 1ef7e: 96 01 movw r18, r12 1ef80: c5 01 movw r24, r10 1ef82: b4 01 movw r22, r8 1ef84: 0f 94 fb 78 call 0x2f1f6 ; 0x2f1f6 1ef88: 26 2e mov r2, r22 1ef8a: a7 2e mov r10, r23 1ef8c: 98 2e mov r9, r24 1ef8e: 89 2e mov r8, r25 1ef90: 84 e0 ldi r24, 0x04 ; 4 1ef92: b8 2e mov r11, r24 for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 1ef94: 90 ea ldi r25, 0xA0 ; 160 1ef96: 79 2e mov r7, r25 1ef98: 0d e3 ldi r16, 0x3D ; 61 1ef9a: 14 e8 ldi r17, 0x84 ; 132 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1ef9c: f7 fa bst r15, 7 1ef9e: f0 94 com r15 1efa0: f7 f8 bld r15, 7 1efa2: f0 94 com r15 1efa4: c2 e1 ldi r28, 0x12 ; 18 1efa6: d4 e8 ldi r29, 0x84 ; 132 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); 1efa8: 3f 92 push r3 1efaa: 4f 92 push r4 1efac: 5f 92 push r5 1efae: 6f 92 push r6 1efb0: 91 e4 ldi r25, 0x41 ; 65 1efb2: 9f 93 push r25 1efb4: 7f 92 push r7 1efb6: 1f 92 push r1 1efb8: 1f 92 push r1 1efba: 1f 93 push r17 1efbc: 0f 93 push r16 1efbe: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1efc2: 8f 92 push r8 1efc4: 9f 92 push r9 1efc6: af 92 push r10 1efc8: 2f 92 push r2 1efca: ff 92 push r15 1efcc: ef 92 push r14 1efce: df 92 push r13 1efd0: cf 92 push r12 1efd2: df 93 push r29 1efd4: cf 93 push r28 1efd6: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommandf_P(extrude_fmt_X, -square_width*invert, long_extrusion); 1efda: 3f 92 push r3 1efdc: 4f 92 push r4 1efde: 5f 92 push r5 1efe0: 6f 92 push r6 1efe2: 81 ec ldi r24, 0xC1 ; 193 1efe4: 8f 93 push r24 1efe6: 7f 92 push r7 1efe8: 1f 92 push r1 1efea: 1f 92 push r1 1efec: 1f 93 push r17 1efee: 0f 93 push r16 1eff0: 0e 94 a8 8d call 0x11b50 ; 0x11b50 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1eff4: 8f 92 push r8 1eff6: 9f 92 push r9 1eff8: af 92 push r10 1effa: 2f 92 push r2 1effc: ff 92 push r15 1effe: ef 92 push r14 1f000: df 92 push r13 1f002: cf 92 push r12 1f004: df 93 push r29 1f006: cf 93 push r28 1f008: 0e 94 a8 8d call 0x11b50 ; 0x11b50 1f00c: 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++) 1f00e: 8d b7 in r24, 0x3d ; 61 1f010: 9e b7 in r25, 0x3e ; 62 1f012: 88 96 adiw r24, 0x28 ; 40 1f014: 0f b6 in r0, 0x3f ; 63 1f016: f8 94 cli 1f018: 9e bf out 0x3e, r25 ; 62 1f01a: 0f be out 0x3f, r0 ; 63 1f01c: 8d bf out 0x3d, r24 ; 61 1f01e: b1 10 cpse r11, r1 1f020: c3 cf rjmp .-122 ; 0x1efa8 1f022: 32 cd rjmp .-1436 ; 0x1ea88 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]))); 1f024: 69 e0 ldi r22, 0x09 ; 9 1f026: 80 e0 ldi r24, 0x00 ; 0 1f028: 94 e8 ldi r25, 0x84 ; 132 1f02a: fc cc rjmp .-1544 ; 0x1ea24 break; case 2: lay1cal_finish(); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 1f02c: 86 ee ldi r24, 0xE6 ; 230 1f02e: 9b e6 ldi r25, 0x6B ; 107 1f030: 0e 94 85 dc call 0x1b90a ; 0x1b90a lcd_commands_step = 0; 1f034: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1f038: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1f03c: 82 e0 ldi r24, 0x02 ; 2 1f03e: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1f042: 8f e5 ldi r24, 0x5F ; 95 1f044: 9f e0 ldi r25, 0x0F ; 15 1f046: 0f 94 9d a3 call 0x3473a ; 0x3473a 1f04a: 88 23 and r24, r24 1f04c: 09 f4 brne .+2 ; 0x1f050 1f04e: f3 cd rjmp .-1050 ; 0x1ec36 lcd_wizard(WizState::RepeatLay1Cal); 1f050: 8b e0 ldi r24, 0x0B ; 11 1f052: 0e 94 b4 e9 call 0x1d368 ; 0x1d368 1f056: 18 cd rjmp .-1488 ; 0x1ea88 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."); 1f058: 88 ea ldi r24, 0xA8 ; 168 1f05a: 94 e8 ldi r25, 0x84 ; 132 1f05c: 0e 94 94 7a call 0xf528 ; 0xf528 1f060: c4 cd rjmp .-1144 ; 0x1ebea #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 1f062: 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; 1f064: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 1f068: 07 ce rjmp .-1010 ; 0x1ec78 case 0: lcd_commands_step = 3; break; case 3: #ifndef QUICK_NOZZLE_CHANGE lcd_show_fullscreen_message_and_wait_P(_T(MSG_NOZZLE_CNG_READ_HELP)); 1f06a: 86 e1 ldi r24, 0x16 ; 22 1f06c: 9b e4 ldi r25, 0x4B ; 75 1f06e: 0e 94 0a 75 call 0xea14 ; 0xea14 1f072: 0e 94 85 e8 call 0x1d10a ; 0x1d10a enquecommand_P(G28W); 1f076: 61 e0 ldi r22, 0x01 ; 1 1f078: 8d ec ldi r24, 0xCD ; 205 1f07a: 98 e6 ldi r25, 0x68 ; 104 1f07c: 0e 94 da 8c call 0x119b4 ; 0x119b4 enquecommand_P(PSTR("G1 X125 Z200 F1000")); 1f080: 61 e0 ldi r22, 0x01 ; 1 1f082: 85 e9 ldi r24, 0x95 ; 149 1f084: 94 e8 ldi r25, 0x84 ; 132 1f086: 0e 94 da 8c call 0x119b4 ; 0x119b4 enquecommand_P(PSTR("M109 S280")); 1f08a: 61 e0 ldi r22, 0x01 ; 1 1f08c: 8b e8 ldi r24, 0x8B ; 139 1f08e: 94 e8 ldi r25, 0x84 ; 132 1f090: 0e 94 da 8c call 0x119b4 ; 0x119b4 } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 1f094: 82 e0 ldi r24, 0x02 ; 2 1f096: e6 cf rjmp .-52 ; 0x1f064 break; case 2: enquecommand_P(PSTR("M84 XY")); 1f098: 61 e0 ldi r22, 0x01 ; 1 1f09a: 84 e8 ldi r24, 0x84 ; 132 1f09c: 94 e8 ldi r25, 0x84 ; 132 1f09e: 0e 94 da 8c call 0x119b4 ; 0x119b4 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 1f0a2: 8d ed ldi r24, 0xDD ; 221 1f0a4: 9a e4 ldi r25, 0x4A ; 74 1f0a6: 0e 94 0a 75 call 0xea14 ; 0xea14 1f0aa: 41 e0 ldi r20, 0x01 ; 1 1f0ac: 60 e0 ldi r22, 0x00 ; 0 1f0ae: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 1f0b2: 81 11 cpse r24, r1 1f0b4: e1 cd rjmp .-1086 ; 0x1ec78 1f0b6: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1f0ba: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 1f0be: 81 e0 ldi r24, 0x01 ; 1 1f0c0: d1 cf rjmp .-94 ; 0x1f064 } break; case 1: lcd_commands_step = 0; 1f0c2: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1f0c6: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1f0ca: 82 e0 ldi r24, 0x02 ; 2 1f0cc: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 1f0d0: 20 e0 ldi r18, 0x00 ; 0 1f0d2: 41 e0 ldi r20, 0x01 ; 1 1f0d4: 62 e0 ldi r22, 0x02 ; 2 1f0d6: 70 e0 ldi r23, 0x00 ; 0 1f0d8: 8c e4 ldi r24, 0x4C ; 76 1f0da: 9f eb ldi r25, 0xBF ; 191 1f0dc: 0e 94 87 62 call 0xc50e ; 0xc50e menu_depth = 3; 1f0e0: 83 e0 ldi r24, 0x03 ; 3 1f0e2: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 1f0e6: c8 cd rjmp .-1136 ; 0x1ec78 0001f0e8 : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 1f0e8: 0f 93 push r16 1f0ea: 1f 93 push r17 1f0ec: cf 93 push r28 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 1f0ee: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f0f2: 82 fb bst r24, 2 1f0f4: 88 27 eor r24, r24 1f0f6: 80 f9 bld r24, 0 1f0f8: 91 e0 ldi r25, 0x01 ; 1 1f0fa: 89 27 eor r24, r25 1f0fc: 90 91 01 04 lds r25, 0x0401 ; 0x800401 1f100: 89 17 cp r24, r25 1f102: 99 f1 breq .+102 ; 0x1f16a { if(menu_menu == lcd_sdcard_menu) { 1f104: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f108: 90 91 03 04 lds r25, 0x0403 ; 0x800403 1f10c: 81 59 subi r24, 0x91 ; 145 1f10e: 93 4e sbci r25, 0xE3 ; 227 1f110: 11 f4 brne .+4 ; 0x1f116 // 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(); 1f112: 0e 94 eb 62 call 0xc5d6 ; 0xc5d6 } lcd_draw_update = 2; 1f116: 82 e0 ldi r24, 0x02 ; 2 1f118: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_oldcardstatus = IS_SD_INSERTED; 1f11c: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f120: c1 e0 ldi r28, 0x01 ; 1 1f122: 82 fb bst r24, 2 1f124: 88 27 eor r24, r24 1f126: 80 f9 bld r24, 0 1f128: 8c 27 eor r24, r28 1f12a: 80 93 01 04 sts 0x0401, r24 ; 0x800401 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 1f12e: 0e 94 6f 70 call 0xe0de ; 0xe0de backlight_wake(); if (lcd_oldcardstatus) 1f132: 80 91 01 04 lds r24, 0x0401 ; 0x800401 1f136: 88 23 and r24, r24 1f138: 09 f4 brne .+2 ; 0x1f13c 1f13a: 88 c0 rjmp .+272 ; 0x1f24c { if (!card.mounted) 1f13c: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1f140: 81 11 cpse r24, r1 1f142: 04 c0 rjmp .+8 ; 0x1f14c { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 1f144: 0f 94 27 73 call 0x2e64e ; 0x2e64e card.presort_flag = true; //force sorting of the SD menu 1f148: c0 93 26 14 sts 0x1426, r28 ; 0x801426 } LCD_MESSAGERPGM(MSG_WELCOME); 1f14c: 86 ee ldi r24, 0xE6 ; 230 1f14e: 9b e6 ldi r25, 0x6B ; 107 1f150: 0e 94 85 dc call 0x1b90a ; 0x1b90a bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 1f154: 10 92 c9 03 sts 0x03C9, r1 ; 0x8003c9 menu_submenu(lcd_sdcard_menu, true); 1f158: 61 e0 ldi r22, 0x01 ; 1 1f15a: 81 e9 ldi r24, 0x91 ; 145 1f15c: 93 ee ldi r25, 0xE3 ; 227 1f15e: 0e 94 ad 62 call 0xc55a ; 0xc55a lcd_timeoutToStatus.start(); 1f162: 83 ee ldi r24, 0xE3 ; 227 1f164: 93 e0 ldi r25, 0x03 ; 3 1f166: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 1f16a: 0f 94 56 0b call 0x216ac ; 0x216ac 1f16e: 00 91 c5 03 lds r16, 0x03C5 ; 0x8003c5 1f172: 10 91 c6 03 lds r17, 0x03C6 ; 0x8003c6 1f176: 20 91 c7 03 lds r18, 0x03C7 ; 0x8003c7 1f17a: 30 91 c8 03 lds r19, 0x03C8 ; 0x8003c8 1f17e: 06 17 cp r16, r22 1f180: 17 07 cpc r17, r23 1f182: 28 07 cpc r18, r24 1f184: 39 07 cpc r19, r25 1f186: e8 f5 brcc .+122 ; 0x1f202 { if (lcd_draw_update) { 1f188: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f18c: 88 23 and r24, r24 1f18e: 31 f0 breq .+12 ; 0x1f19c lcd_timeoutToStatus.start(); 1f190: 83 ee ldi r24, 0xE3 ; 227 1f192: 93 e0 ldi r25, 0x03 ; 3 1f194: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> lcd_frame_start(); 1f198: 0e 94 b6 6e call 0xdd6c ; 0xdd6c } (*menu_menu)(); 1f19c: e0 91 02 04 lds r30, 0x0402 ; 0x800402 1f1a0: f0 91 03 04 lds r31, 0x0403 ; 0x800403 1f1a4: 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)))); 1f1a6: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f1aa: 90 91 03 04 lds r25, 0x0403 ; 0x800403 1f1ae: 89 55 subi r24, 0x59 ; 89 1f1b0: 95 4d sbci r25, 0xD5 ; 213 1f1b2: 09 f4 brne .+2 ; 0x1f1b6 1f1b4: 5e c0 rjmp .+188 ; 0x1f272 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 1f1b6: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f1ba: 90 91 03 04 lds r25, 0x0403 ; 0x800403 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1f1be: 27 e3 ldi r18, 0x37 ; 55 1f1c0: 86 3d cpi r24, 0xD6 ; 214 1f1c2: 92 07 cpc r25, r18 1f1c4: 09 f0 breq .+2 ; 0x1f1c8 1f1c6: 76 c0 rjmp .+236 ; 0x1f2b4 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 1f1c8: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f1cc: 82 30 cpi r24, 0x02 ; 2 1f1ce: 21 f4 brne .+8 ; 0x1f1d8 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1f1d0: 0e 94 6f 70 call 0xe0de ; 0xe0de lcd_status_message_idx = 0; // Re-draw message from beginning 1f1d4: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.420> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 1f1d8: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f1dc: 88 23 and r24, r24 1f1de: 19 f0 breq .+6 ; 0x1f1e6 1f1e0: 81 50 subi r24, 0x01 ; 1 1f1e2: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 1f1e6: 0f 94 56 0b call 0x216ac ; 0x216ac 1f1ea: 6c 59 subi r22, 0x9C ; 156 1f1ec: 7f 4f sbci r23, 0xFF ; 255 1f1ee: 8f 4f sbci r24, 0xFF ; 255 1f1f0: 9f 4f sbci r25, 0xFF ; 255 1f1f2: 60 93 c5 03 sts 0x03C5, r22 ; 0x8003c5 1f1f6: 70 93 c6 03 sts 0x03C6, r23 ; 0x8003c6 1f1fa: 80 93 c7 03 sts 0x03C7, r24 ; 0x8003c7 1f1fe: 90 93 c8 03 sts 0x03C8, r25 ; 0x8003c8 SERIAL_ECHO(']'); prusa_stat_diameter(); } static void lcd_send_status() { if (farm_mode && no_response && (NcTime.expired(NC_TIME * 1000))) { 1f202: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1f206: 88 23 and r24, r24 1f208: 99 f0 breq .+38 ; 0x1f230 1f20a: 80 91 08 04 lds r24, 0x0408 ; 0x800408 <_ZL11no_response.lto_priv.493> 1f20e: 88 23 and r24, r24 1f210: 79 f0 breq .+30 ; 0x1f230 1f212: 60 e1 ldi r22, 0x10 ; 16 1f214: 77 e2 ldi r23, 0x27 ; 39 1f216: 81 ec ldi r24, 0xC1 ; 193 1f218: 93 e0 ldi r25, 0x03 ; 3 1f21a: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 1f21e: 88 23 and r24, r24 1f220: 39 f0 breq .+14 ; 0x1f230 //send important status messages periodicaly prusa_statistics(8); 1f222: 88 e0 ldi r24, 0x08 ; 8 1f224: 0f 94 02 30 call 0x26004 ; 0x26004 NcTime.start(); 1f228: 81 ec ldi r24, 0xC1 ; 193 1f22a: 93 e0 ldi r25, 0x03 ; 3 1f22c: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 1f230: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1f234: 84 30 cpi r24, 0x04 ; 4 1f236: 09 f0 breq .+2 ; 0x1f23a 1f238: 54 c0 rjmp .+168 ; 0x1f2e2 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) { 1f23a: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f23e: 81 11 cpse r24, r1 1f240: 50 c0 rjmp .+160 ; 0x1f2e2 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(); } 1f242: cf 91 pop r28 1f244: 1f 91 pop r17 1f246: 0f 91 pop r16 1f248: 0c 94 bf f3 jmp 0x1e77e ; 0x1e77e presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 1f24c: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 mounted = false; 1f250: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 SERIAL_ECHO_START; 1f254: 8e ec ldi r24, 0xCE ; 206 1f256: 91 ea ldi r25, 0xA1 ; 161 1f258: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 1f25c: 84 ea ldi r24, 0xA4 ; 164 1f25e: 98 e6 ldi r25, 0x68 ; 104 1f260: 0e 94 8d 7c call 0xf91a ; 0xf91a lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 1f264: 86 e8 ldi r24, 0x86 ; 134 1f266: 9a e4 ldi r25, 0x4A ; 74 1f268: 0e 94 0a 75 call 0xea14 ; 0xea14 1f26c: 0e 94 85 dc call 0x1b90a ; 0x1b90a 1f270: 7c cf rjmp .-264 ; 0x1f16a // 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)))); 1f272: 0e 94 1f 66 call 0xcc3e ; 0xcc3e 1f276: 81 11 cpse r24, r1 1f278: 0e c0 rjmp .+28 ; 0x1f296 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) 1f27a: e0 91 02 04 lds r30, 0x0402 ; 0x800402 1f27e: f0 91 03 04 lds r31, 0x0403 ; 0x800403 1f282: 30 97 sbiw r30, 0x00 ; 0 1f284: 39 f5 brne .+78 ; 0x1f2d4 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 1f286: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_return_to_status(); 1f28a: 0f 94 6d 05 call 0x20ada ; 0x20ada lcd_draw_update = 2; 1f28e: 82 e0 ldi r24, 0x02 ; 2 1f290: 80 93 59 02 sts 0x0259, r24 ; 0x800259 1f294: 99 cf rjmp .-206 ; 0x1f1c8 // 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)))); 1f296: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1f29a: 81 11 cpse r24, r1 1f29c: 8c cf rjmp .-232 ; 0x1f1b6 1f29e: 40 e9 ldi r20, 0x90 ; 144 1f2a0: 5f e5 ldi r21, 0x5F ; 95 1f2a2: 61 e0 ldi r22, 0x01 ; 1 1f2a4: 70 e0 ldi r23, 0x00 ; 0 1f2a6: 83 ee ldi r24, 0xE3 ; 227 1f2a8: 93 e0 ldi r25, 0x03 ; 3 1f2aa: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> 1f2ae: 81 11 cpse r24, r1 1f2b0: e4 cf rjmp .-56 ; 0x1f27a 1f2b2: 81 cf rjmp .-254 ; 0x1f1b6 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 1f2b4: 89 55 subi r24, 0x59 ; 89 1f2b6: 95 4d sbci r25, 0xD5 ; 213 1f2b8: 09 f4 brne .+2 ; 0x1f2bc 1f2ba: 86 cf rjmp .-244 ; 0x1f1c8 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1f2bc: 40 e3 ldi r20, 0x30 ; 48 1f2be: 55 e7 ldi r21, 0x75 ; 117 1f2c0: 60 e0 ldi r22, 0x00 ; 0 1f2c2: 70 e0 ldi r23, 0x00 ; 0 1f2c4: 83 ee ldi r24, 0xE3 ; 227 1f2c6: 93 e0 ldi r25, 0x03 ; 3 1f2c8: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> 1f2cc: 88 23 and r24, r24 1f2ce: 09 f4 brne .+2 ; 0x1f2d2 1f2d0: 7b cf rjmp .-266 ; 0x1f1c8 1f2d2: d3 cf rjmp .-90 ; 0x1f27a // 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; 1f2d4: 81 e0 ldi r24, 0x01 ; 1 1f2d6: 80 93 c4 03 sts 0x03C4, r24 ; 0x8003c4 (*menu_menu)(); 1f2da: 19 95 eicall menu_leaving = 0; 1f2dc: 10 92 c4 03 sts 0x03C4, r1 ; 0x8003c4 1f2e0: d2 cf rjmp .-92 ; 0x1f286 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(); } 1f2e2: cf 91 pop r28 1f2e4: 1f 91 pop r17 1f2e6: 0f 91 pop r16 1f2e8: 08 95 ret 0001f2ea : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1f2ea: 87 e1 ldi r24, 0x17 ; 23 1f2ec: 0e 94 4c d5 call 0x1aa98 ; 0x1aa98 1f2f0: 81 11 cpse r24, r1 1f2f2: 06 c0 rjmp .+12 ; 0x1f300 // 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); 1f2f4: 87 e1 ldi r24, 0x17 ; 23 1f2f6: 0e 94 ea d4 call 0x1a9d4 ; 0x1a9d4 lcd_wizard(WizState::Run); 1f2fa: 80 e0 ldi r24, 0x00 ; 0 1f2fc: 0c 94 b4 e9 jmp 0x1d368 ; 0x1d368 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); 1f300: 8f ed ldi r24, 0xDF ; 223 1f302: 9c e3 ldi r25, 0x3C ; 60 1f304: 0e 94 0a 75 call 0xea14 ; 0xea14 1f308: 41 e0 ldi r20, 0x01 ; 1 1f30a: 60 e0 ldi r22, 0x00 ; 0 1f30c: 0e 94 68 e3 call 0x1c6d0 ; 0x1c6d0 } if (result) { 1f310: 88 23 and r24, r24 1f312: 81 f3 breq .-32 ; 0x1f2f4 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 1f314: 0f 94 6d 05 call 0x20ada ; 0x20ada lcd_update_enable(true); 1f318: 81 e0 ldi r24, 0x01 ; 1 1f31a: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_update(2); 1f31e: 82 e0 ldi r24, 0x02 ; 2 1f320: 0c 94 c9 6e jmp 0xdd92 ; 0xdd92 0001f324 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 1f324: cf 93 push r28 1f326: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 1f328: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d disable_x(); 1f32c: 17 9a sbi 0x02, 7 ; 2 1f32e: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 1f332: 16 9a sbi 0x02, 6 ; 2 1f334: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a disable_z(); disable_e0(); 1f338: 14 9a sbi 0x02, 4 ; 2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f33a: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1f33e: 10 92 59 12 sts 0x1259, r1 ; 0x801259 1f342: 68 2f mov r22, r24 1f344: 86 ea ldi r24, 0xA6 ; 166 1f346: 9f e0 ldi r25, 0x0F ; 15 1f348: 0f 94 c1 a3 call 0x34782 ; 0x34782 1f34c: 6c 2f mov r22, r28 1f34e: 8f ea ldi r24, 0xAF ; 175 1f350: 9f e0 ldi r25, 0x0F ; 15 1f352: 0f 94 c1 a3 call 0x34782 ; 0x34782 // 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) { 1f356: cc 23 and r28, r28 1f358: 89 f0 breq .+34 ; 0x1f37c SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 1f35a: 85 eb ldi r24, 0xB5 ; 181 1f35c: 92 e8 ldi r25, 0x82 ; 130 1f35e: 0e 94 8d 7c call 0xf91a ; 0xf91a lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 1f362: 80 ef ldi r24, 0xF0 ; 240 1f364: 9b e3 ldi r25, 0x3B ; 59 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 1f366: 0e 94 0a 75 call 0xea14 ; 0xea14 1f36a: 0e 94 85 e8 call 0x1d10a ; 0x1d10a } lcd_update_enable(true); 1f36e: 81 e0 ldi r24, 0x01 ; 1 1f370: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_update(2); 1f374: 82 e0 ldi r24, 0x02 ; 2 } 1f376: 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); 1f378: 0c 94 c9 6e jmp 0xdd92 ; 0xdd92 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."); 1f37c: 8a e7 ldi r24, 0x7A ; 122 1f37e: 92 e8 ldi r25, 0x82 ; 130 1f380: 0e 94 8d 7c call 0xf91a ; 0xf91a lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 1f384: 85 ed ldi r24, 0xD5 ; 213 1f386: 9b e3 ldi r25, 0x3B ; 59 1f388: ee cf rjmp .-36 ; 0x1f366 0001f38a : // When done, it sets the current Z to Z_MAX_POS and returns true. // Otherwise the Z calibration is not changed and false is returned. #ifndef TMC2130 bool lcd_calibrate_z_end_stop_manual(bool only_z) { 1f38a: 9f 92 push r9 1f38c: af 92 push r10 1f38e: bf 92 push r11 1f390: cf 92 push r12 1f392: df 92 push r13 1f394: ef 92 push r14 1f396: ff 92 push r15 1f398: 0f 93 push r16 1f39a: 1f 93 push r17 1f39c: cf 93 push r28 1f39e: df 93 push r29 1f3a0: 98 2e mov r9, r24 // Don't know where we are. Let's claim we are Z=0, so the soft end stops will not be triggered when moving up. current_position[Z_AXIS] = 0; 1f3a2: 10 92 69 12 sts 0x1269, r1 ; 0x801269 1f3a6: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 1f3aa: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 1f3ae: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 1f3b2: 0f 94 ca 48 call 0x29194 ; 0x29194 // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) 1f3b6: 84 e7 ldi r24, 0x74 ; 116 1f3b8: 9b e3 ldi r25, 0x3B ; 59 1f3ba: 91 10 cpse r9, r1 1f3bc: 02 c0 rjmp .+4 ; 0x1f3c2 1f3be: 81 e1 ldi r24, 0x11 ; 17 1f3c0: 9b e3 ldi r25, 0x3B ; 59 1f3c2: 0e 94 0a 75 call 0xea14 ; 0xea14 1f3c6: b8 2e mov r11, r24 1f3c8: a9 2e mov r10, r25 : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 1f3ca: 0e 94 9a de call 0x1bd34 ; 0x1bd34 1f3ce: 8c 01 movw r16, r24 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); 1f3d0: 0f 94 56 0b call 0x216ac ; 0x216ac 1f3d4: 6b 01 movw r12, r22 1f3d6: 7c 01 movw r14, r24 // Until the user finishes the z up movement. lcd_encoder = 0; 1f3d8: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1f3dc: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 1f3e0: e8 01 movw r28, r16 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); // Until the user finishes the z up movement. lcd_encoder = 0; for (;;) { manage_heater(); 1f3e2: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 1f3e6: 81 e0 ldi r24, 0x01 ; 1 1f3e8: 0e 94 25 8a call 0x1144a ; 0x1144a if (lcd_encoder) { 1f3ec: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1f3f0: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1f3f4: 89 2b or r24, r25 1f3f6: d9 f1 breq .+118 ; 0x1f46e _delay(50); 1f3f8: 62 e3 ldi r22, 0x32 ; 50 1f3fa: 70 e0 ldi r23, 0x00 ; 0 1f3fc: 80 e0 ldi r24, 0x00 ; 0 1f3fe: 90 e0 ldi r25, 0x00 ; 0 1f400: 0f 94 23 0b call 0x21646 ; 0x21646 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; 1f404: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 1f408: 8f 5f subi r24, 0xFF ; 255 1f40a: 80 31 cpi r24, 0x10 ; 16 1f40c: 09 f4 brne .+2 ; 0x1f410 next_block_index = 0; 1f40e: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 1f410: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) { 1f414: 98 17 cp r25, r24 1f416: 59 f1 breq .+86 ; 0x1f46e // Only move up, whatever direction the user rotates the encoder. current_position[Z_AXIS] += abs(lcd_encoder); 1f418: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 1f41c: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 1f420: 77 ff sbrs r23, 7 1f422: 03 c0 rjmp .+6 ; 0x1f42a 1f424: 71 95 neg r23 1f426: 61 95 neg r22 1f428: 71 09 sbc r23, r1 1f42a: 07 2e mov r0, r23 1f42c: 00 0c add r0, r0 1f42e: 88 0b sbc r24, r24 1f430: 99 0b sbc r25, r25 1f432: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1f436: 20 91 69 12 lds r18, 0x1269 ; 0x801269 1f43a: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 1f43e: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 1f442: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 1f446: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1f44a: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1f44e: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1f452: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1f456: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c lcd_encoder = 0; 1f45a: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1f45e: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60); 1f462: 65 e5 ldi r22, 0x55 ; 85 1f464: 75 e5 ldi r23, 0x55 ; 85 1f466: 85 e8 ldi r24, 0x85 ; 133 1f468: 91 e4 ldi r25, 0x41 ; 65 1f46a: 0f 94 0a 4a call 0x29414 ; 0x29414 } } if (lcd_clicked()) { 1f46e: 0e 94 45 73 call 0xe68a ; 0xe68a 1f472: 88 23 and r24, r24 1f474: c9 f1 breq .+114 ; 0x1f4e8 // Abort a move if in progress. planner_abort_hard(); 1f476: 0f 94 84 4c call 0x29908 ; 0x29908 planner_aborted = false; 1f47a: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 while (lcd_clicked()) ; 1f47e: 0e 94 45 73 call 0xe68a ; 0xe68a 1f482: 81 11 cpse r24, r1 1f484: fc cf rjmp .-8 ; 0x1f47e _delay(10); 1f486: 6a e0 ldi r22, 0x0A ; 10 1f488: 70 e0 ldi r23, 0x00 ; 0 1f48a: 80 e0 ldi r24, 0x00 ; 0 1f48c: 90 e0 ldi r25, 0x00 ; 0 1f48e: 0f 94 23 0b call 0x21646 ; 0x21646 while (lcd_clicked()) ; 1f492: 0e 94 45 73 call 0xe68a ; 0xe68a 1f496: 81 11 cpse r24, r1 1f498: fc cf rjmp .-8 ; 0x1f492 msg_next = lcd_display_message_fullscreen_P(msg_next); previous_millis_msg = _millis(); } } // Let the user confirm, that the Z carriage is at the top end stoppers. uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_CONFIRM_CARRIAGE_AT_THE_TOP), false); 1f49a: 88 ee ldi r24, 0xE8 ; 232 1f49c: 9a e3 ldi r25, 0x3A ; 58 1f49e: 0e 94 0a 75 call 0xea14 ; 0xea14 1f4a2: 41 e0 ldi r20, 0x01 ; 1 1f4a4: 60 e0 ldi r22, 0x00 ; 0 1f4a6: 0e 94 a3 e6 call 0x1cd46 ; 0x1cd46 if (result == LCD_BUTTON_TIMEOUT) 1f4aa: 8f 3f cpi r24, 0xFF ; 255 1f4ac: d1 f1 breq .+116 ; 0x1f522 goto canceled; else if (result == LCD_LEFT_BUTTON_CHOICE) 1f4ae: 81 11 cpse r24, r1 1f4b0: 82 cf rjmp .-252 ; 0x1f3b6 calibrated: // Let the machine think the Z axis is a bit higher than it is, so it will not home into the bed // during the search for the induction points. if ((PRINTER_TYPE == PRINTER_MK25) || (PRINTER_TYPE == PRINTER_MK2) || (PRINTER_TYPE == PRINTER_MK2_SNMM)) { current_position[Z_AXIS] = Z_MAX_POS-3.f; 1f4b2: 80 e0 ldi r24, 0x00 ; 0 1f4b4: 90 e0 ldi r25, 0x00 ; 0 1f4b6: af e4 ldi r26, 0x4F ; 79 1f4b8: b3 e4 ldi r27, 0x43 ; 67 1f4ba: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1f4be: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 1f4c2: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1f4c6: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c } else { current_position[Z_AXIS] = Z_MAX_POS+4.f; } plan_set_position_curposXYZE(); 1f4ca: 0f 94 ca 48 call 0x29194 ; 0x29194 return true; 1f4ce: 81 e0 ldi r24, 0x01 ; 1 canceled: return false; } 1f4d0: df 91 pop r29 1f4d2: cf 91 pop r28 1f4d4: 1f 91 pop r17 1f4d6: 0f 91 pop r16 1f4d8: ff 90 pop r15 1f4da: ef 90 pop r14 1f4dc: df 90 pop r13 1f4de: cf 90 pop r12 1f4e0: bf 90 pop r11 1f4e2: af 90 pop r10 1f4e4: 9f 90 pop r9 1f4e6: 08 95 ret while (lcd_clicked()) ; _delay(10); while (lcd_clicked()) ; break; } if (multi_screen && _millis() - previous_millis_msg > 5000) { 1f4e8: 01 15 cp r16, r1 1f4ea: 11 05 cpc r17, r1 1f4ec: 09 f4 brne .+2 ; 0x1f4f0 1f4ee: 79 cf rjmp .-270 ; 0x1f3e2 1f4f0: 0f 94 56 0b call 0x216ac ; 0x216ac 1f4f4: 6c 19 sub r22, r12 1f4f6: 7d 09 sbc r23, r13 1f4f8: 8e 09 sbc r24, r14 1f4fa: 9f 09 sbc r25, r15 1f4fc: 69 38 cpi r22, 0x89 ; 137 1f4fe: 73 41 sbci r23, 0x13 ; 19 1f500: 81 05 cpc r24, r1 1f502: 91 05 cpc r25, r1 1f504: 08 f4 brcc .+2 ; 0x1f508 1f506: 6d cf rjmp .-294 ; 0x1f3e2 if (msg_next == NULL) 1f508: 20 97 sbiw r28, 0x00 ; 0 1f50a: 11 f4 brne .+4 ; 0x1f510 msg_next = msg; 1f50c: cb 2d mov r28, r11 1f50e: da 2d mov r29, r10 msg_next = lcd_display_message_fullscreen_P(msg_next); 1f510: ce 01 movw r24, r28 1f512: 0e 94 9a de call 0x1bd34 ; 0x1bd34 1f516: ec 01 movw r28, r24 previous_millis_msg = _millis(); 1f518: 0f 94 56 0b call 0x216ac ; 0x216ac 1f51c: 6b 01 movw r12, r22 1f51e: 7c 01 movw r14, r24 1f520: 60 cf rjmp .-320 ; 0x1f3e2 } plan_set_position_curposXYZE(); return true; canceled: return false; 1f522: 80 e0 ldi r24, 0x00 ; 0 1f524: d5 cf rjmp .-86 ; 0x1f4d0 0001f526 : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 1f526: 2f 92 push r2 1f528: 3f 92 push r3 1f52a: 4f 92 push r4 1f52c: 5f 92 push r5 1f52e: 6f 92 push r6 1f530: 7f 92 push r7 1f532: 8f 92 push r8 1f534: 9f 92 push r9 1f536: af 92 push r10 1f538: bf 92 push r11 1f53a: cf 92 push r12 1f53c: df 92 push r13 1f53e: ef 92 push r14 1f540: ff 92 push r15 1f542: 0f 93 push r16 1f544: 1f 93 push r17 1f546: cf 93 push r28 1f548: df 93 push r29 1f54a: cd b7 in r28, 0x3d ; 61 1f54c: de b7 in r29, 0x3e ; 62 1f54e: 67 97 sbiw r28, 0x17 ; 23 1f550: 0f b6 in r0, 0x3f ; 63 1f552: f8 94 cli 1f554: de bf out 0x3e, r29 ; 62 1f556: 0f be out 0x3f, r0 ; 63 1f558: cd bf out 0x3d, r28 ; 61 1f55a: 08 2f mov r16, r24 1f55c: ce 01 movw r24, r28 1f55e: 46 96 adiw r24, 0x16 ; 22 1f560: 9f 8b std Y+23, r25 ; 0x17 1f562: 8e 8b std Y+22, r24 ; 0x16 1f564: 83 e0 ldi r24, 0x03 ; 3 1f566: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 1f568: 95 e1 ldi r25, 0x15 ; 21 1f56a: 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 1f56c: 0f 94 9a 4e call 0x29d34 ; 0x29d34 tool_change_extruder = slot; 1f570: 00 93 e9 12 sts 0x12E9, r16 ; 0x8012e9 state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 1f574: 40 2f mov r20, r16 1f576: 64 e5 ldi r22, 0x54 ; 84 1f578: ce 01 movw r24, r28 1f57a: 01 96 adiw r24, 0x01 ; 1 1f57c: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 1f580: 49 81 ldd r20, Y+1 ; 0x01 1f582: 5a 81 ldd r21, Y+2 ; 0x02 1f584: 6b 81 ldd r22, Y+3 ; 0x03 1f586: 7c 81 ldd r23, Y+4 ; 0x04 1f588: 8d 81 ldd r24, Y+5 ; 0x05 1f58a: 0f 94 d6 94 call 0x329ac ; 0x329ac logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 1f58e: 61 e0 ldi r22, 0x01 ; 1 1f590: 81 e0 ldi r24, 0x01 ; 1 1f592: 0f 94 67 9c call 0x338ce ; 0x338ce 1f596: 18 2f mov r17, r24 1f598: 81 11 cpse r24, r1 1f59a: 07 c0 rjmp .+14 ; 0x1f5aa break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 1f59c: 0f 94 ee 4d call 0x29bdc ; 0x29bdc // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 1f5a0: 0f 94 05 9c call 0x3380a ; 0x3380a // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 1f5a4: 0f 94 f5 9c call 0x339ea ; 0x339ea 1f5a8: e1 cf rjmp .-62 ; 0x1f56c bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1f5aa: 0f 94 b0 18 call 0x23160 ; 0x23160 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 1f5ae: 0f 94 d0 4e call 0x29da0 ; 0x29da0 1f5b2: 81 30 cpi r24, 0x01 ; 1 1f5b4: 79 f1 breq .+94 ; 0x1f614 // 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(); 1f5b6: 0f 94 f5 9c call 0x339ea ; 0x339ea if (retries == 2 && cutter_enabled()) { 1f5ba: 92 e0 ldi r25, 0x02 ; 2 1f5bc: f9 12 cpse r15, r25 1f5be: 09 c0 rjmp .+18 ; 0x1f5d2 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; 1f5c0: 8e ec ldi r24, 0xCE ; 206 1f5c2: 9e e0 ldi r25, 0x0E ; 14 1f5c4: 0f 94 9d a3 call 0x3473a ; 0x3473a 1f5c8: 81 30 cpi r24, 0x01 ; 1 1f5ca: 19 f4 brne .+6 ; 0x1f5d2 CutFilamentInner(slot); // try cutting filament tip at the last attempt 1f5cc: 80 2f mov r24, r16 1f5ce: 0f 94 dc 9d call 0x33bb8 ; 0x33bb8 1f5d2: 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) { 1f5d4: f1 10 cpse r15, r1 1f5d6: ca cf rjmp .-108 ; 0x1f56c 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()) { 1f5d8: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f5dc: 88 23 and r24, r24 1f5de: 09 f4 brne .+2 ; 0x1f5e2 1f5e0: ef c0 rjmp .+478 ; 0x1f7c0 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 1f5e2: 67 96 adiw r28, 0x17 ; 23 1f5e4: 0f b6 in r0, 0x3f ; 63 1f5e6: f8 94 cli 1f5e8: de bf out 0x3e, r29 ; 62 1f5ea: 0f be out 0x3f, r0 ; 63 1f5ec: cd bf out 0x3d, r28 ; 61 1f5ee: df 91 pop r29 1f5f0: cf 91 pop r28 1f5f2: 1f 91 pop r17 1f5f4: 0f 91 pop r16 1f5f6: ff 90 pop r15 1f5f8: ef 90 pop r14 1f5fa: df 90 pop r13 1f5fc: cf 90 pop r12 1f5fe: bf 90 pop r11 1f600: af 90 pop r10 1f602: 9f 90 pop r9 1f604: 8f 90 pop r8 1f606: 7f 90 pop r7 1f608: 6f 90 pop r6 1f60a: 5f 90 pop r5 1f60c: 4f 90 pop r4 1f60e: 3f 90 pop r3 1f610: 2f 90 pop r2 1f612: 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(); 1f614: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 1f618: 70 e0 ldi r23, 0x00 ; 0 1f61a: 90 e0 ldi r25, 0x00 ; 0 1f61c: 80 e0 ldi r24, 0x00 ; 0 1f61e: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1f622: 9b 01 movw r18, r22 1f624: ac 01 movw r20, r24 1f626: 66 e6 ldi r22, 0x66 ; 102 1f628: 76 e6 ldi r23, 0x66 ; 102 1f62a: 8d e9 ldi r24, 0x9D ; 157 1f62c: 92 e4 ldi r25, 0x42 ; 66 1f62e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1f632: 36 2e mov r3, r22 1f634: 87 2e mov r8, r23 1f636: 98 2e mov r9, r24 1f638: 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)) 1f63a: 26 2f mov r18, r22 1f63c: 37 2f mov r19, r23 1f63e: 48 2f mov r20, r24 1f640: 59 2f mov r21, r25 1f642: 60 e0 ldi r22, 0x00 ; 0 1f644: 70 e0 ldi r23, 0x00 ; 0 1f646: 80 e2 ldi r24, 0x20 ; 32 1f648: 91 e4 ldi r25, 0x41 ; 65 1f64a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 1f64e: 2b 01 movw r4, r22 1f650: 3c 01 movw r6, r24 1f652: e5 e6 ldi r30, 0x65 ; 101 1f654: f4 e0 ldi r31, 0x04 ; 4 1f656: 82 2d mov r24, r2 1f658: 11 92 st Z+, r1 1f65a: 8a 95 dec r24 1f65c: e9 f7 brne .-6 ; 0x1f658 lcd_status_message_idx = 0; 1f65e: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.420> 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); 1f662: 83 2d mov r24, r3 1f664: 98 2d mov r25, r8 1f666: a9 2d mov r26, r9 1f668: be 2d mov r27, r14 1f66a: bc 01 movw r22, r24 1f66c: 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++) { 1f66e: 91 2c mov r9, r1 1f670: 31 2c mov r3, r1 1f672: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1f674: 5b 01 movw r10, r22 1f676: 6c 01 movw r12, r24 1f678: d7 fa bst r13, 7 1f67a: d0 94 com r13 1f67c: d7 f8 bld r13, 7 1f67e: d0 94 com r13 1f680: 20 e0 ldi r18, 0x00 ; 0 1f682: 30 e0 ldi r19, 0x00 ; 0 1f684: 48 e4 ldi r20, 0x48 ; 72 1f686: 52 e4 ldi r21, 0x42 ; 66 1f688: 0f 94 9c 4e call 0x29d38 ; 0x29d38 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); 1f68c: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1f690: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f while (planner_any_moves()) { 1f694: 98 17 cp r25, r24 1f696: 09 f4 brne .+2 ; 0x1f69a 1f698: 49 c0 rjmp .+146 ; 0x1f72c filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 1f69a: 11 23 and r17, r17 1f69c: 31 f0 breq .+12 ; 0x1f6aa 1f69e: 0f 94 d0 4e call 0x29da0 ; 0x29da0 1f6a2: 11 e0 ldi r17, 0x01 ; 1 1f6a4: 81 30 cpi r24, 0x01 ; 1 1f6a6: 09 f0 breq .+2 ; 0x1f6aa 1f6a8: 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); 1f6aa: 83 e0 ldi r24, 0x03 ; 3 1f6ac: 0f 94 9c 18 call 0x23138 ; 0x23138 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); 1f6b0: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 1f6b4: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 1f6b8: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 1f6bc: 50 91 70 12 lds r21, 0x1270 ; 0x801270 1f6c0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1f6c4: a3 01 movw r20, r6 1f6c6: 92 01 movw r18, r4 1f6c8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1f6cc: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 1f6d0: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 1f6d4: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 1f6d6: e6 16 cp r14, r22 1f6d8: c1 f0 breq .+48 ; 0x1f70a 1f6da: e3 2d mov r30, r3 1f6dc: e4 31 cpi r30, 0x14 ; 20 1f6de: 08 f0 brcs .+2 ; 0x1f6e2 1f6e0: 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); 1f6e2: 33 24 eor r3, r3 1f6e4: 33 94 inc r3 1f6e6: 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] : '-'); 1f6e8: 8f ef ldi r24, 0xFF ; 255 1f6ea: 11 11 cpse r17, r1 1f6ec: 01 c0 rjmp .+2 ; 0x1f6f0 1f6ee: 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; 1f6f0: f0 e0 ldi r31, 0x00 ; 0 1f6f2: eb 59 subi r30, 0x9B ; 155 1f6f4: fb 4f sbci r31, 0xFB ; 251 1f6f6: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 1f6f8: 91 e0 ldi r25, 0x01 ; 1 1f6fa: 90 93 59 02 sts 0x0259, r25 ; 0x800259 if (!lcd_update_enabled) lcdui_print_status_line(); 1f6fe: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 1f702: 81 11 cpse r24, r1 1f704: 02 c0 rjmp .+4 ; 0x1f70a 1f706: 0f 94 03 0c call 0x21806 ; 0x21806 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 1f70a: 90 e0 ldi r25, 0x00 ; 0 1f70c: 80 e0 ldi r24, 0x00 ; 0 1f70e: 0e 94 7f 8c call 0x118fe ; 0x118fe } 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); 1f712: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 1f714: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f718: 88 23 and r24, r24 1f71a: 09 f4 brne .+2 ; 0x1f71e 1f71c: b7 cf rjmp .-146 ; 0x1f68c return false; // power panic or a similar issue happened, bail out fast 1f71e: 10 e0 ldi r17, 0x00 ; 0 1f720: 37 c0 rjmp .+110 ; 0x1f790 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); 1f722: c6 01 movw r24, r12 1f724: b5 01 movw r22, r10 1f726: 99 24 eor r9, r9 1f728: 93 94 inc r9 1f72a: aa cf rjmp .-172 ; 0x1f680 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++) { 1f72c: 91 e0 ldi r25, 0x01 ; 1 1f72e: 99 12 cpse r9, r25 1f730: f8 cf rjmp .-16 ; 0x1f722 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 1f732: 0f 94 9a 4e call 0x29d34 ; 0x29d34 if (!filament_inserted) { 1f736: 11 11 cpse r17, r1 1f738: 08 c0 rjmp .+16 ; 0x1f74a eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 1f73a: 8f ec ldi r24, 0xCF ; 207 1f73c: 9e e0 ldi r25, 0x0E ; 14 1f73e: 0e 94 4c 78 call 0xf098 ; 0xf098 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 1f742: 80 ed ldi r24, 0xD0 ; 208 1f744: 9e e0 ldi r25, 0x0E ; 14 1f746: 0e 94 3f 78 call 0xf07e ; 0xf07e 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); 1f74a: 44 e1 ldi r20, 0x14 ; 20 1f74c: 50 e0 ldi r21, 0x00 ; 0 1f74e: 65 e6 ldi r22, 0x65 ; 101 1f750: 74 e0 ldi r23, 0x04 ; 4 1f752: ce 01 movw r24, r28 1f754: 01 96 adiw r24, 0x01 ; 1 1f756: 0f 94 1d aa call 0x3543a ; 0x3543a 1f75a: fe 01 movw r30, r28 1f75c: 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'; 1f75e: 81 91 ld r24, Z+ 1f760: 87 fd sbrc r24, 7 1f762: 2c c0 rjmp .+88 ; 0x1f7bc 1f764: 80 e3 ldi r24, 0x30 ; 48 1f766: df 01 movw r26, r30 1f768: 11 97 sbiw r26, 0x01 ; 1 1f76a: 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++) { 1f76c: 8e 89 ldd r24, Y+22 ; 0x16 1f76e: 9f 89 ldd r25, Y+23 ; 0x17 1f770: 8e 17 cp r24, r30 1f772: 9f 07 cpc r25, r31 1f774: a1 f7 brne .-24 ; 0x1f75e // 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; 1f776: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 1f778: 8e ec ldi r24, 0xCE ; 206 1f77a: 91 ea ldi r25, 0xA1 ; 161 1f77c: 0e 94 94 7a call 0xf528 ; 0xf528 1f780: 8e e7 ldi r24, 0x7E ; 126 1f782: 97 e8 ldi r25, 0x87 ; 135 1f784: 0e 94 94 7a call 0xf528 ; 0xf528 1f788: ce 01 movw r24, r28 1f78a: 01 96 adiw r24, 0x01 ; 1 1f78c: 0e 94 92 85 call 0x10b24 ; 0x10b24 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 1f790: 8a e7 ldi r24, 0x7A ; 122 1f792: 94 e0 ldi r25, 0x04 ; 4 1f794: 0f 94 7f 0d call 0x21afe ; 0x21afe ::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()) { 1f798: 11 23 and r17, r17 1f79a: 09 f4 brne .+2 ; 0x1f79e 1f79c: 0c cf rjmp .-488 ; 0x1f5b6 // 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 1f79e: 80 2f mov r24, r16 1f7a0: 0f 94 9f 65 call 0x2cb3e ; 0x2cb3e } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 1f7a4: 00 93 90 12 sts 0x1290, r16 ; 0x801290 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 1f7a8: 80 91 05 13 lds r24, 0x1305 ; 0x801305 1f7ac: 90 91 06 13 lds r25, 0x1306 ; 0x801306 1f7b0: 01 96 adiw r24, 0x01 ; 1 1f7b2: 90 93 06 13 sts 0x1306, r25 ; 0x801306 1f7b6: 80 93 05 13 sts 0x1305, r24 ; 0x801305 1f7ba: 13 cf rjmp .-474 ; 0x1f5e2 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'; 1f7bc: 81 e3 ldi r24, 0x31 ; 49 1f7be: d3 cf rjmp .-90 ; 0x1f766 void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 1f7c0: 8a e2 ldi r24, 0x2A ; 42 1f7c2: 90 e8 ldi r25, 0x80 ; 128 1f7c4: 90 93 93 12 sts 0x1293, r25 ; 0x801293 1f7c8: 80 93 92 12 sts 0x1292, r24 ; 0x801292 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 1f7cc: 61 e0 ldi r22, 0x01 ; 1 1f7ce: 81 e0 ldi r24, 0x01 ; 1 1f7d0: 0f 94 67 9c call 0x338ce ; 0x338ce 1f7d4: c7 ce rjmp .-626 ; 0x1f564 0001f7d6 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 1f7d6: cf 93 push r28 1f7d8: df 93 push r29 1f7da: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1f7dc: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 1f7e0: c8 2f mov r28, r24 1f7e2: 88 23 and r24, r24 1f7e4: 49 f1 breq .+82 ; 0x1f838 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 1f7e6: 88 ec ldi r24, 0xC8 ; 200 1f7e8: 90 e0 ldi r25, 0x00 ; 0 1f7ea: 0f 94 1e 52 call 0x2a43c ; 0x2a43c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.375]> 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); 1f7ee: 82 e0 ldi r24, 0x02 ; 2 1f7f0: 0f 94 62 23 call 0x246c4 ; 0x246c4 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 1f7f4: 8d ee ldi r24, 0xED ; 237 1f7f6: 91 e6 ldi r25, 0x61 ; 97 1f7f8: 0e 94 0a 75 call 0xea14 ; 0xea14 1f7fc: 6d 2f mov r22, r29 1f7fe: 0f 94 cf 4d call 0x29b9e ; 0x29b9e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1f802: 0f 94 2f 79 call 0x2f25e ; 0x2f25e FullScreenMsgLoad(slot); { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 1f806: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 1f80a: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 1f80e: 83 36 cpi r24, 0x63 ; 99 1f810: 29 f0 breq .+10 ; 0x1f81c return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 1f812: 62 e1 ldi r22, 0x12 ; 18 1f814: 8c e1 ldi r24, 0x1C ; 28 1f816: 9d e9 ldi r25, 0x9D ; 157 1f818: 0f 94 3a 79 call 0x2f274 ; 0x2f274 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 1f81c: 8d 2f mov r24, r29 1f81e: 0e 94 93 fa call 0x1f526 ; 0x1f526 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 1f822: 0e 94 fa bb call 0x177f4 ; 0x177f4 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); 1f826: 83 e0 ldi r24, 0x03 ; 3 1f828: 0f 94 62 23 call 0x246c4 ; 0x246c4 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1f82c: 0f 94 3f 6d call 0x2da7e ; 0x2da7e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1f830: 0f 94 58 79 call 0x2f2b0 ; 0x2f2b0 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 1f834: 0f 94 cc 4d call 0x29b98 ; 0x29b98 return true; } 1f838: 8c 2f mov r24, r28 1f83a: df 91 pop r29 1f83c: cf 91 pop r28 1f83e: 08 95 ret 0001f840 : 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); 1f840: 0e 94 eb fb call 0x1f7d6 ; 0x1f7d6 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 1f844: 0e 94 bd 63 call 0xc77a ; 0xc77a st_synchronize(); 1f848: 0f 94 b0 18 call 0x23160 ; 0x23160 // Ask user if the extruded color is correct: lcd_return_to_status(); 1f84c: 0f 94 6d 05 call 0x20ada ; 0x20ada lcd_load_filament_color_check(); 1f850: 0f 94 bc 18 call 0x23178 ; 0x23178 lcd_setstatuspgm(MSG_WELCOME); 1f854: 86 ee ldi r24, 0xE6 ; 230 1f856: 9b e6 ldi r25, 0x6B ; 107 1f858: 0e 94 85 dc call 0x1b90a ; 0x1b90a custom_message_type = CustomMsg::Status; 1f85c: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d // Clear the filament action clearFilamentAction(); 1f860: 0d 94 62 09 jmp 0x212c4 ; 0x212c4 0001f864 : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 1f864: cf 93 push r28 1f866: df 93 push r29 1f868: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1f86a: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 1f86e: c8 2f mov r28, r24 1f870: 88 23 and r24, r24 1f872: b9 f0 breq .+46 ; 0x1f8a2 return false; } if (slot != extruder) { 1f874: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 1f878: 8d 17 cp r24, r29 1f87a: 99 f0 breq .+38 ; 0x1f8a2 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(); 1f87c: 0e 94 61 66 call 0xccc2 ; 0xccc2 if (/*FindaDetectsFilament()*/ 1f880: 81 11 cpse r24, r1 1f882: 02 c0 rjmp .+4 ; 0x1f888 /*!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(); 1f884: 0f 94 2e 9d call 0x33a5c ; 0x33a5c struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1f888: 0f 94 2f 79 call 0x2f25e ; 0x2f25e // we need to unload manually as well -- but only if FINDA detects filament unload(); } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 1f88c: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1f890: 0f 94 b0 18 call 0x23160 ; 0x23160 planner_synchronize(); ToolChangeCommon(slot); 1f894: 8d 2f mov r24, r29 1f896: 0e 94 93 fa call 0x1f526 ; 0x1f526 1f89a: 0f 94 3f 6d call 0x2da7e ; 0x2da7e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1f89e: 0f 94 58 79 call 0x2f2b0 ; 0x2f2b0 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 1f8a2: 8c 2f mov r24, r28 1f8a4: df 91 pop r29 1f8a6: cf 91 pop r28 1f8a8: 08 95 ret 0001f8aa : /// 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) { 1f8aa: 1f 93 push r17 1f8ac: cf 93 push r28 1f8ae: df 93 push r29 1f8b0: c8 2f mov r28, r24 1f8b2: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 1f8b4: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 1f8b8: d8 2f mov r29, r24 1f8ba: 88 23 and r24, r24 1f8bc: 89 f0 breq .+34 ; 0x1f8e0 return false; } FSensorBlockRunout blockRunout; 1f8be: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 switch (code) { 1f8c2: c3 36 cpi r28, 0x63 ; 99 1f8c4: 01 f1 breq .+64 ; 0x1f906 1f8c6: c8 37 cpi r28, 0x78 ; 120 1f8c8: 81 f0 breq .+32 ; 0x1f8ea 1f8ca: cf 33 cpi r28, 0x3F ; 63 1f8cc: 39 f4 brne .+14 ; 0x1f8dc case '?': { waitForHotendTargetTemp(100, [] {}); 1f8ce: 84 e6 ldi r24, 0x64 ; 100 1f8d0: 90 e0 ldi r25, 0x00 ; 0 1f8d2: 0f 94 1e 52 call 0x2a43c ; 0x2a43c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.375]> load_filament_to_nozzle(slot); 1f8d6: 81 2f mov r24, r17 1f8d8: 0e 94 eb fb call 0x1f7d6 ; 0x1f7d6 1f8dc: 0f 94 3f 6d call 0x2da7e ; 0x2da7e execute_load_to_nozzle_sequence(); } break; } return true; } 1f8e0: 8d 2f mov r24, r29 1f8e2: df 91 pop r29 1f8e4: cf 91 pop r28 1f8e6: 1f 91 pop r17 1f8e8: 08 95 ret } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 1f8ea: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1f8ee: 10 92 57 02 sts 0x0257, r1 ; 0x800257 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); 1f8f2: 81 2f mov r24, r17 1f8f4: 0e 94 32 fc call 0x1f864 ; 0x1f864 1f8f8: 8f ea ldi r24, 0xAF ; 175 1f8fa: 90 e0 ldi r25, 0x00 ; 0 1f8fc: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1f900: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1f904: eb cf rjmp .-42 ; 0x1f8dc thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 1f906: 84 e6 ldi r24, 0x64 ; 100 1f908: 90 e0 ldi r25, 0x00 ; 0 1f90a: 0f 94 1e 52 call 0x2a43c ; 0x2a43c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.375]> execute_load_to_nozzle_sequence(); 1f90e: 0e 94 fa bb call 0x177f4 ; 0x177f4 1f912: e4 cf rjmp .-56 ; 0x1f8dc 0001f914 : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 1f914: cf 93 push r28 1f916: 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); 1f918: 87 e1 ldi r24, 0x17 ; 23 1f91a: 96 e4 ldi r25, 0x46 ; 70 1f91c: 0e 94 0a 75 call 0xea14 ; 0xea14 1f920: 6c 2f mov r22, r28 1f922: 0f 94 cf 4d call 0x29b9e ; 0x29b9e return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1f926: 8c 2f mov r24, r28 1f928: 0e 94 32 fc call 0x1f864 ; 0x1f864 1f92c: 0f 94 b0 18 call 0x23160 ; 0x23160 planner_synchronize(); unload(); 1f930: 0f 94 2e 9d call 0x33a5c ; 0x33a5c ScreenUpdateEnable(); 1f934: 0f 94 cc 4d call 0x29b98 ; 0x29b98 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 1f938: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 1f93a: 0d 94 62 09 jmp 0x212c4 ; 0x212c4 0001f93e : 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(){ 1f93e: cf 93 push r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ 1f940: c0 e0 ldi r28, 0x00 ; 0 1f942: 87 e1 ldi r24, 0x17 ; 23 1f944: 96 e4 ldi r25, 0x46 ; 70 1f946: 0e 94 0a 75 call 0xea14 ; 0xea14 1f94a: 6c 2f mov r22, r28 1f94c: 0f 94 cf 4d call 0x29b9e ; 0x29b9e return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1f950: 8c 2f mov r24, r28 1f952: 0e 94 32 fc call 0x1f864 ; 0x1f864 1f956: 0f 94 b0 18 call 0x23160 ; 0x23160 planner_synchronize(); unload(); 1f95a: 0f 94 2e 9d call 0x33a5c ; 0x33a5c ScreenUpdateEnable(); 1f95e: 0f 94 cc 4d call 0x29b98 ; 0x29b98 1f962: cf 5f subi r28, 0xFF ; 255 1f964: c5 30 cpi r28, 0x05 ; 5 1f966: 69 f7 brne .-38 ; 0x1f942 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 1f968: cf 91 pop r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 1f96a: 0d 94 62 09 jmp 0x212c4 ; 0x212c4 0001f96e : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 1f96e: 1f 93 push r17 1f970: cf 93 push r28 1f972: df 93 push r29 1f974: 00 d0 rcall .+0 ; 0x1f976 1f976: 1f 92 push r1 1f978: 1f 92 push r1 1f97a: cd b7 in r28, 0x3d ; 61 1f97c: de b7 in r29, 0x3e ; 62 1f97e: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 1f980: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 1f984: 88 23 and r24, r24 1f986: d9 f0 breq .+54 ; 0x1f9be void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 1f988: 41 2f mov r20, r17 1f98a: 62 e5 ldi r22, 0x52 ; 82 1f98c: ce 01 movw r24, r28 1f98e: 01 96 adiw r24, 0x01 ; 1 1f990: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 1f994: 49 81 ldd r20, Y+1 ; 0x01 1f996: 5a 81 ldd r21, Y+2 ; 0x02 1f998: 6b 81 ldd r22, Y+3 ; 0x03 1f99a: 7c 81 ldd r23, Y+4 ; 0x04 1f99c: 8d 81 ldd r24, Y+5 ; 0x05 1f99e: 0f 94 d6 94 call 0x329ac ; 0x329ac 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)); 1f9a2: 60 e0 ldi r22, 0x00 ; 0 1f9a4: 80 e0 ldi r24, 0x00 ; 0 1f9a6: 0f 94 67 9c call 0x338ce ; 0x338ce 1f9aa: 88 23 and r24, r24 1f9ac: 69 f3 breq .-38 ; 0x1f988 // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 1f9ae: 20 91 ad 12 lds r18, 0x12AD ; 0x8012ad 1f9b2: 30 91 ae 12 lds r19, 0x12AE ; 0x8012ae 1f9b6: 30 93 fe 12 sts 0x12FE, r19 ; 0x8012fe 1f9ba: 20 93 fd 12 sts 0x12FD, r18 ; 0x8012fd return true; } 1f9be: 0f 90 pop r0 1f9c0: 0f 90 pop r0 1f9c2: 0f 90 pop r0 1f9c4: 0f 90 pop r0 1f9c6: 0f 90 pop r0 1f9c8: df 91 pop r29 1f9ca: cf 91 pop r28 1f9cc: 1f 91 pop r17 1f9ce: 08 95 ret 0001f9d0 : 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; 1f9d0: 88 3e cpi r24, 0xE8 ; 232 1f9d2: 23 e0 ldi r18, 0x03 ; 3 1f9d4: 92 07 cpc r25, r18 1f9d6: 10 f0 brcs .+4 ; 0x1f9dc 1f9d8: 87 ee ldi r24, 0xE7 ; 231 1f9da: 93 e0 ldi r25, 0x03 ; 3 } 1f9dc: 08 95 ret 0001f9de : return 0; } static int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 1f9de: 90 91 47 0d lds r25, 0x0D47 ; 0x800d47 1f9e2: 80 91 46 0d lds r24, 0x0D46 ; 0x800d46 1f9e6: 2f ef ldi r18, 0xFF ; 255 1f9e8: 3f ef ldi r19, 0xFF ; 255 1f9ea: 89 17 cp r24, r25 1f9ec: 71 f0 breq .+28 ; 0x1fa0a _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 1f9ee: e9 2f mov r30, r25 1f9f0: f0 e0 ldi r31, 0x00 ; 0 1f9f2: e7 5b subi r30, 0xB7 ; 183 1f9f4: f2 4f sbci r31, 0xF2 ; 242 1f9f6: 20 81 ld r18, Z 1f9f8: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 1f9fa: 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 1f9fc: 80 91 45 0d lds r24, 0x0D45 ; 0x800d45 1fa00: 98 17 cp r25, r24 1fa02: 08 f0 brcs .+2 ; 0x1fa06 1fa04: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 1fa06: 90 93 47 0d sts 0x0D47, r25 ; 0x800d47 return rbuf_get(uart2_ibuf); } 1fa0a: c9 01 movw r24, r18 1fa0c: 08 95 ret 0001fa0e : uint8_t uart2_ibuf[20] = {0, 0}; FILE _uart2io; static int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 1fa0e: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 1fa12: 95 ff sbrs r25, 5 1fa14: fc cf rjmp .-8 ; 0x1fa0e UDR2 = c; // transmit byte 1fa16: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> return 0; } 1fa1a: 90 e0 ldi r25, 0x00 ; 0 1fa1c: 80 e0 ldi r24, 0x00 ; 0 1fa1e: 08 95 ret 0001fa20 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 1fa20: 3f b7 in r19, 0x3f ; 63 cli(); 1fa22: f8 94 cli m = timer2_overflow_count; 1fa24: 80 91 fc 05 lds r24, 0x05FC ; 0x8005fc 1fa28: 90 91 fd 05 lds r25, 0x05FD ; 0x8005fd 1fa2c: a0 91 fe 05 lds r26, 0x05FE ; 0x8005fe 1fa30: b0 91 ff 05 lds r27, 0x05FF ; 0x8005ff #if defined(TCNT2) t = TCNT2; 1fa34: 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)) 1fa38: b8 9b sbis 0x17, 0 ; 23 1fa3a: 05 c0 rjmp .+10 ; 0x1fa46 1fa3c: 2f 3f cpi r18, 0xFF ; 255 1fa3e: 19 f0 breq .+6 ; 0x1fa46 m++; 1fa40: 01 96 adiw r24, 0x01 ; 1 1fa42: a1 1d adc r26, r1 1fa44: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 1fa46: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 1fa48: ba 2f mov r27, r26 1fa4a: a9 2f mov r26, r25 1fa4c: 98 2f mov r25, r24 1fa4e: 88 27 eor r24, r24 1fa50: bc 01 movw r22, r24 1fa52: cd 01 movw r24, r26 1fa54: 62 0f add r22, r18 1fa56: 71 1d adc r23, r1 1fa58: 81 1d adc r24, r1 1fa5a: 91 1d adc r25, r1 1fa5c: 42 e0 ldi r20, 0x02 ; 2 1fa5e: 66 0f add r22, r22 1fa60: 77 1f adc r23, r23 1fa62: 88 1f adc r24, r24 1fa64: 99 1f adc r25, r25 1fa66: 4a 95 dec r20 1fa68: d1 f7 brne .-12 ; 0x1fa5e } 1fa6a: 08 95 ret 0001fa6c : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 1fa6c: 2f 92 push r2 1fa6e: 3f 92 push r3 1fa70: 4f 92 push r4 1fa72: 5f 92 push r5 1fa74: 6f 92 push r6 1fa76: 7f 92 push r7 1fa78: 8f 92 push r8 1fa7a: 9f 92 push r9 1fa7c: af 92 push r10 1fa7e: bf 92 push r11 1fa80: cf 92 push r12 1fa82: df 92 push r13 1fa84: ef 92 push r14 1fa86: ff 92 push r15 1fa88: 0f 93 push r16 1fa8a: 1f 93 push r17 1fa8c: cf 93 push r28 1fa8e: df 93 push r29 1fa90: cd b7 in r28, 0x3d ; 61 1fa92: de b7 in r29, 0x3e ; 62 1fa94: 2e 97 sbiw r28, 0x0e ; 14 1fa96: 0f b6 in r0, 0x3f ; 63 1fa98: f8 94 cli 1fa9a: de bf out 0x3e, r29 ; 62 1fa9c: 0f be out 0x3f, r0 ; 63 1fa9e: 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]); 1faa0: 20 90 ef 05 lds r2, 0x05EF ; 0x8005ef 1faa4: 30 90 f0 05 lds r3, 0x05F0 ; 0x8005f0 1faa8: 40 90 f1 05 lds r4, 0x05F1 ; 0x8005f1 1faac: 50 90 f2 05 lds r5, 0x05F2 ; 0x8005f2 1fab0: 60 90 f3 05 lds r6, 0x05F3 ; 0x8005f3 1fab4: 70 90 f4 05 lds r7, 0x05F4 ; 0x8005f4 #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 1fab8: 21 14 cp r2, r1 1faba: 31 04 cpc r3, r1 1fabc: 39 f4 brne .+14 ; 0x1facc pid_output = 0; pid_reset[e] = true; 1fabe: 81 e0 ldi r24, 0x01 ; 1 1fac0: 80 93 c8 05 sts 0x05C8, r24 ; 0x8005c8 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; 1fac4: 81 2c mov r8, r1 1fac6: 91 2c mov r9, r1 1fac8: 54 01 movw r10, r8 1faca: f9 c0 rjmp .+498 ; 0x1fcbe #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 1facc: b1 01 movw r22, r2 1face: 03 2c mov r0, r3 1fad0: 00 0c add r0, r0 1fad2: 88 0b sbc r24, r24 1fad4: 99 0b sbc r25, r25 1fad6: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1fada: a3 01 movw r20, r6 1fadc: 92 01 movw r18, r4 1fade: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1fae2: 6b 01 movw r12, r22 1fae4: 7c 01 movw r14, r24 if(pid_reset[e]) { 1fae6: 80 91 c8 05 lds r24, 0x05C8 ; 0x8005c8 1faea: 88 23 and r24, r24 1faec: 91 f0 breq .+36 ; 0x1fb12 iState_sum[e] = 0.0; 1faee: 10 92 c4 05 sts 0x05C4, r1 ; 0x8005c4 1faf2: 10 92 c5 05 sts 0x05C5, r1 ; 0x8005c5 1faf6: 10 92 c6 05 sts 0x05C6, r1 ; 0x8005c6 1fafa: 10 92 c7 05 sts 0x05C7, r1 ; 0x8005c7 dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 1fafe: 10 92 c0 05 sts 0x05C0, r1 ; 0x8005c0 1fb02: 10 92 c1 05 sts 0x05C1, r1 ; 0x8005c1 1fb06: 10 92 c2 05 sts 0x05C2, r1 ; 0x8005c2 1fb0a: 10 92 c3 05 sts 0x05C3, r1 ; 0x8005c3 pid_reset[e] = false; 1fb0e: 10 92 c8 05 sts 0x05C8, r1 ; 0x8005c8 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 1fb12: 20 91 cf 0d lds r18, 0x0DCF ; 0x800dcf 1fb16: 30 91 d0 0d lds r19, 0x0DD0 ; 0x800dd0 1fb1a: 40 91 d1 0d lds r20, 0x0DD1 ; 0x800dd1 1fb1e: 50 91 d2 0d lds r21, 0x0DD2 ; 0x800dd2 1fb22: c7 01 movw r24, r14 1fb24: b6 01 movw r22, r12 1fb26: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fb2a: 69 83 std Y+1, r22 ; 0x01 1fb2c: 7a 83 std Y+2, r23 ; 0x02 1fb2e: 8b 83 std Y+3, r24 ; 0x03 1fb30: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 1fb32: 20 91 c4 05 lds r18, 0x05C4 ; 0x8005c4 1fb36: 30 91 c5 05 lds r19, 0x05C5 ; 0x8005c5 1fb3a: 40 91 c6 05 lds r20, 0x05C6 ; 0x8005c6 1fb3e: 50 91 c7 05 lds r21, 0x05C7 ; 0x8005c7 1fb42: c7 01 movw r24, r14 1fb44: b6 01 movw r22, r12 1fb46: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1fb4a: 4b 01 movw r8, r22 1fb4c: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 1fb4e: 20 91 1c 04 lds r18, 0x041C ; 0x80041c <_ZL14iState_sum_min.lto_priv.435> 1fb52: 2d 87 std Y+13, r18 ; 0x0d 1fb54: 30 91 1d 04 lds r19, 0x041D ; 0x80041d <_ZL14iState_sum_min.lto_priv.435+0x1> 1fb58: 39 87 std Y+9, r19 ; 0x09 1fb5a: 10 91 1e 04 lds r17, 0x041E ; 0x80041e <_ZL14iState_sum_min.lto_priv.435+0x2> 1fb5e: 00 91 1f 04 lds r16, 0x041F ; 0x80041f <_ZL14iState_sum_min.lto_priv.435+0x3> 1fb62: 41 2f mov r20, r17 1fb64: 50 2f mov r21, r16 1fb66: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1fb6a: 87 fd sbrc r24, 7 1fb6c: 17 c0 rjmp .+46 ; 0x1fb9c 1fb6e: 80 91 18 04 lds r24, 0x0418 ; 0x800418 <_ZL14iState_sum_max.lto_priv.436> 1fb72: 8d 87 std Y+13, r24 ; 0x0d 1fb74: 90 91 19 04 lds r25, 0x0419 ; 0x800419 <_ZL14iState_sum_max.lto_priv.436+0x1> 1fb78: 99 87 std Y+9, r25 ; 0x09 1fb7a: 10 91 1a 04 lds r17, 0x041A ; 0x80041a <_ZL14iState_sum_max.lto_priv.436+0x2> 1fb7e: 00 91 1b 04 lds r16, 0x041B ; 0x80041b <_ZL14iState_sum_max.lto_priv.436+0x3> 1fb82: 9c 01 movw r18, r24 1fb84: 41 2f mov r20, r17 1fb86: 50 2f mov r21, r16 1fb88: b4 01 movw r22, r8 1fb8a: c5 01 movw r24, r10 1fb8c: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1fb90: 18 16 cp r1, r24 1fb92: 24 f0 brlt .+8 ; 0x1fb9c 1fb94: 8d 86 std Y+13, r8 ; 0x0d 1fb96: 99 86 std Y+9, r9 ; 0x09 1fb98: 1a 2d mov r17, r10 1fb9a: 0b 2d mov r16, r11 1fb9c: 8d 85 ldd r24, Y+13 ; 0x0d 1fb9e: 99 85 ldd r25, Y+9 ; 0x09 1fba0: a1 2f mov r26, r17 1fba2: b0 2f mov r27, r16 1fba4: 80 93 c4 05 sts 0x05C4, r24 ; 0x8005c4 1fba8: 90 93 c5 05 sts 0x05C5, r25 ; 0x8005c5 1fbac: a0 93 c6 05 sts 0x05C6, r26 ; 0x8005c6 1fbb0: b0 93 c7 05 sts 0x05C7, r27 ; 0x8005c7 iTerm[e] = cs.Ki * iState_sum[e]; 1fbb4: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 1fbb8: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 1fbbc: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 1fbc0: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 1fbc4: bc 01 movw r22, r24 1fbc6: 81 2f mov r24, r17 1fbc8: 90 2f mov r25, r16 1fbca: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fbce: 6d 83 std Y+5, r22 ; 0x05 1fbd0: 7e 83 std Y+6, r23 ; 0x06 1fbd2: 8f 83 std Y+7, r24 ; 0x07 1fbd4: 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 1fbd6: 20 91 bc 05 lds r18, 0x05BC ; 0x8005bc 1fbda: 30 91 bd 05 lds r19, 0x05BD ; 0x8005bd 1fbde: 40 91 be 05 lds r20, 0x05BE ; 0x8005be 1fbe2: 50 91 bf 05 lds r21, 0x05BF ; 0x8005bf 1fbe6: c3 01 movw r24, r6 1fbe8: b2 01 movw r22, r4 1fbea: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1fbee: 20 91 d7 0d lds r18, 0x0DD7 ; 0x800dd7 1fbf2: 30 91 d8 0d lds r19, 0x0DD8 ; 0x800dd8 1fbf6: 40 91 d9 0d lds r20, 0x0DD9 ; 0x800dd9 1fbfa: 50 91 da 0d lds r21, 0x0DDA ; 0x800dda 1fbfe: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fc02: 20 ed ldi r18, 0xD0 ; 208 1fc04: 3c ec ldi r19, 0xCC ; 204 1fc06: 4c e4 ldi r20, 0x4C ; 76 1fc08: 5d e3 ldi r21, 0x3D ; 61 1fc0a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fc0e: 4b 01 movw r8, r22 1fc10: 5c 01 movw r10, r24 1fc12: 23 e3 ldi r18, 0x33 ; 51 1fc14: 33 e3 ldi r19, 0x33 ; 51 1fc16: 43 e7 ldi r20, 0x73 ; 115 1fc18: 5f e3 ldi r21, 0x3F ; 63 1fc1a: 60 91 c0 05 lds r22, 0x05C0 ; 0x8005c0 1fc1e: 70 91 c1 05 lds r23, 0x05C1 ; 0x8005c1 1fc22: 80 91 c2 05 lds r24, 0x05C2 ; 0x8005c2 1fc26: 90 91 c3 05 lds r25, 0x05C3 ; 0x8005c3 1fc2a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fc2e: 9b 01 movw r18, r22 1fc30: ac 01 movw r20, r24 1fc32: c5 01 movw r24, r10 1fc34: b4 01 movw r22, r8 1fc36: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1fc3a: 4b 01 movw r8, r22 1fc3c: 5c 01 movw r10, r24 1fc3e: 80 92 c0 05 sts 0x05C0, r8 ; 0x8005c0 1fc42: 90 92 c1 05 sts 0x05C1, r9 ; 0x8005c1 1fc46: a0 92 c2 05 sts 0x05C2, r10 ; 0x8005c2 1fc4a: b0 92 c3 05 sts 0x05C3, r11 ; 0x8005c3 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) 1fc4e: 2d 81 ldd r18, Y+5 ; 0x05 1fc50: 3e 81 ldd r19, Y+6 ; 0x06 1fc52: 4f 81 ldd r20, Y+7 ; 0x07 1fc54: 58 85 ldd r21, Y+8 ; 0x08 1fc56: 69 81 ldd r22, Y+1 ; 0x01 1fc58: 7a 81 ldd r23, Y+2 ; 0x02 1fc5a: 8b 81 ldd r24, Y+3 ; 0x03 1fc5c: 9c 81 ldd r25, Y+4 ; 0x04 1fc5e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1fc62: a5 01 movw r20, r10 1fc64: 94 01 movw r18, r8 1fc66: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1fc6a: 4b 01 movw r8, r22 1fc6c: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 1fc6e: 20 e0 ldi r18, 0x00 ; 0 1fc70: 30 e0 ldi r19, 0x00 ; 0 1fc72: 4f e7 ldi r20, 0x7F ; 127 1fc74: 53 e4 ldi r21, 0x43 ; 67 1fc76: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1fc7a: 20 e0 ldi r18, 0x00 ; 0 1fc7c: 30 e0 ldi r19, 0x00 ; 0 1fc7e: 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) { 1fc80: 18 16 cp r1, r24 1fc82: 0c f0 brlt .+2 ; 0x1fc86 1fc84: 6d c1 rjmp .+730 ; 0x1ff60 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1fc86: c7 01 movw r24, r14 1fc88: b6 01 movw r22, r12 1fc8a: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1fc8e: 18 16 cp r1, r24 1fc90: 84 f4 brge .+32 ; 0x1fcb2 1fc92: a7 01 movw r20, r14 1fc94: 96 01 movw r18, r12 1fc96: 6d 85 ldd r22, Y+13 ; 0x0d 1fc98: 79 85 ldd r23, Y+9 ; 0x09 1fc9a: 81 2f mov r24, r17 1fc9c: 90 2f mov r25, r16 1fc9e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1fca2: 60 93 c4 05 sts 0x05C4, r22 ; 0x8005c4 1fca6: 70 93 c5 05 sts 0x05C5, r23 ; 0x8005c5 1fcaa: 80 93 c6 05 sts 0x05C6, r24 ; 0x8005c6 1fcae: 90 93 c7 05 sts 0x05C7, r25 ; 0x8005c7 pid_output=PID_MAX; 1fcb2: 81 2c mov r8, r1 1fcb4: 91 2c mov r9, r1 1fcb6: 3f e7 ldi r19, 0x7F ; 127 1fcb8: a3 2e mov r10, r19 1fcba: 33 e4 ldi r19, 0x43 ; 67 1fcbc: 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; 1fcbe: 40 92 bc 05 sts 0x05BC, r4 ; 0x8005bc 1fcc2: 50 92 bd 05 sts 0x05BD, r5 ; 0x8005bd 1fcc6: 60 92 be 05 sts 0x05BE, r6 ; 0x8005be 1fcca: 70 92 bf 05 sts 0x05BF, r7 ; 0x8005bf pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 1fcce: 60 91 54 02 lds r22, 0x0254 ; 0x800254 <_ZL8maxttemp.lto_priv.437> 1fcd2: 70 91 55 02 lds r23, 0x0255 ; 0x800255 <_ZL8maxttemp.lto_priv.437+0x1> 1fcd6: 07 2e mov r0, r23 1fcd8: 00 0c add r0, r0 1fcda: 88 0b sbc r24, r24 1fcdc: 99 0b sbc r25, r25 1fcde: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1fce2: 9b 01 movw r18, r22 1fce4: ac 01 movw r20, r24 1fce6: c3 01 movw r24, r6 1fce8: b2 01 movw r22, r4 1fcea: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1fcee: 87 ff sbrs r24, 7 1fcf0: 57 c1 rjmp .+686 ; 0x1ffa0 1fcf2: 23 28 or r2, r3 1fcf4: 09 f4 brne .+2 ; 0x1fcf8 1fcf6: 54 c1 rjmp .+680 ; 0x1ffa0 soft_pwm[e] = (int)pid_output >> 1; 1fcf8: c5 01 movw r24, r10 1fcfa: b4 01 movw r22, r8 1fcfc: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1fd00: 75 95 asr r23 1fd02: 67 95 ror r22 1fd04: 60 93 f5 05 sts 0x05F5, r22 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> 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); 1fd08: 20 91 e8 05 lds r18, 0x05E8 ; 0x8005e8 1fd0c: 30 91 e9 05 lds r19, 0x05E9 ; 0x8005e9 1fd10: 3a 83 std Y+2, r19 ; 0x02 1fd12: 29 83 std Y+1, r18 ; 0x01 1fd14: 40 90 ea 05 lds r4, 0x05EA ; 0x8005ea 1fd18: 50 90 eb 05 lds r5, 0x05EB ; 0x8005eb 1fd1c: 60 90 ec 05 lds r6, 0x05EC ; 0x8005ec 1fd20: 70 90 ed 05 lds r7, 0x05ED ; 0x8005ed #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 1fd24: b9 01 movw r22, r18 1fd26: 33 0f add r19, r19 1fd28: 88 0b sbc r24, r24 1fd2a: 99 0b sbc r25, r25 1fd2c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 1fd30: a3 01 movw r20, r6 1fd32: 92 01 movw r18, r4 1fd34: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1fd38: 6b 01 movw r12, r22 1fd3a: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 1fd3c: 20 91 db 0d lds r18, 0x0DDB ; 0x800ddb 1fd40: 30 91 dc 0d lds r19, 0x0DDC ; 0x800ddc 1fd44: 40 91 dd 0d lds r20, 0x0DDD ; 0x800ddd 1fd48: 50 91 de 0d lds r21, 0x0DDE ; 0x800dde 1fd4c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fd50: 6d 83 std Y+5, r22 ; 0x05 1fd52: 7e 83 std Y+6, r23 ; 0x06 1fd54: 8f 83 std Y+7, r24 ; 0x07 1fd56: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 1fd58: 20 91 d1 05 lds r18, 0x05D1 ; 0x8005d1 1fd5c: 30 91 d2 05 lds r19, 0x05D2 ; 0x8005d2 1fd60: 40 91 d3 05 lds r20, 0x05D3 ; 0x8005d3 1fd64: 50 91 d4 05 lds r21, 0x05D4 ; 0x8005d4 1fd68: c7 01 movw r24, r14 1fd6a: b6 01 movw r22, r12 1fd6c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1fd70: 5b 01 movw r10, r22 1fd72: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 1fd74: 30 91 14 04 lds r19, 0x0414 ; 0x800414 <_ZL19temp_iState_min_bed.lto_priv.433> 1fd78: 3e 87 std Y+14, r19 ; 0x0e 1fd7a: 80 91 15 04 lds r24, 0x0415 ; 0x800415 <_ZL19temp_iState_min_bed.lto_priv.433+0x1> 1fd7e: 8d 87 std Y+13, r24 ; 0x0d 1fd80: 30 90 16 04 lds r3, 0x0416 ; 0x800416 <_ZL19temp_iState_min_bed.lto_priv.433+0x2> 1fd84: 20 90 17 04 lds r2, 0x0417 ; 0x800417 <_ZL19temp_iState_min_bed.lto_priv.433+0x3> 1fd88: 23 2f mov r18, r19 1fd8a: 38 2f mov r19, r24 1fd8c: 43 2d mov r20, r3 1fd8e: 52 2d mov r21, r2 1fd90: b5 01 movw r22, r10 1fd92: c8 01 movw r24, r16 1fd94: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1fd98: 87 fd sbrc r24, 7 1fd9a: 18 c0 rjmp .+48 ; 0x1fdcc 1fd9c: 90 91 10 04 lds r25, 0x0410 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.434> 1fda0: 9e 87 std Y+14, r25 ; 0x0e 1fda2: 20 91 11 04 lds r18, 0x0411 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.434+0x1> 1fda6: 2d 87 std Y+13, r18 ; 0x0d 1fda8: 30 90 12 04 lds r3, 0x0412 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.434+0x2> 1fdac: 20 90 13 04 lds r2, 0x0413 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.434+0x3> 1fdb0: 29 2f mov r18, r25 1fdb2: 3d 85 ldd r19, Y+13 ; 0x0d 1fdb4: 43 2d mov r20, r3 1fdb6: 52 2d mov r21, r2 1fdb8: b5 01 movw r22, r10 1fdba: c8 01 movw r24, r16 1fdbc: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1fdc0: 18 16 cp r1, r24 1fdc2: 24 f0 brlt .+8 ; 0x1fdcc 1fdc4: ae 86 std Y+14, r10 ; 0x0e 1fdc6: bd 86 std Y+13, r11 ; 0x0d 1fdc8: 30 2e mov r3, r16 1fdca: 21 2e mov r2, r17 1fdcc: 8e 85 ldd r24, Y+14 ; 0x0e 1fdce: 9d 85 ldd r25, Y+13 ; 0x0d 1fdd0: a3 2d mov r26, r3 1fdd2: b2 2d mov r27, r2 1fdd4: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 1fdd8: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 1fddc: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 1fde0: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 iTerm_bed = cs.bedKi * temp_iState_bed; 1fde4: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 1fde8: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 1fdec: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 1fdf0: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 1fdf4: bc 01 movw r22, r24 1fdf6: 83 2d mov r24, r3 1fdf8: 92 2d mov r25, r2 1fdfa: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fdfe: 69 87 std Y+9, r22 ; 0x09 1fe00: 7a 87 std Y+10, r23 ; 0x0a 1fe02: 8b 87 std Y+11, r24 ; 0x0b 1fe04: 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); 1fe06: 20 91 cd 05 lds r18, 0x05CD ; 0x8005cd 1fe0a: 30 91 ce 05 lds r19, 0x05CE ; 0x8005ce 1fe0e: 40 91 cf 05 lds r20, 0x05CF ; 0x8005cf 1fe12: 50 91 d0 05 lds r21, 0x05D0 ; 0x8005d0 1fe16: c3 01 movw r24, r6 1fe18: b2 01 movw r22, r4 1fe1a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1fe1e: 20 91 e3 0d lds r18, 0x0DE3 ; 0x800de3 1fe22: 30 91 e4 0d lds r19, 0x0DE4 ; 0x800de4 1fe26: 40 91 e5 0d lds r20, 0x0DE5 ; 0x800de5 1fe2a: 50 91 e6 0d lds r21, 0x0DE6 ; 0x800de6 1fe2e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fe32: 20 ed ldi r18, 0xD0 ; 208 1fe34: 3c ec ldi r19, 0xCC ; 204 1fe36: 4c e4 ldi r20, 0x4C ; 76 1fe38: 5d e3 ldi r21, 0x3D ; 61 1fe3a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fe3e: 4b 01 movw r8, r22 1fe40: 5c 01 movw r10, r24 1fe42: 23 e3 ldi r18, 0x33 ; 51 1fe44: 33 e3 ldi r19, 0x33 ; 51 1fe46: 43 e7 ldi r20, 0x73 ; 115 1fe48: 5f e3 ldi r21, 0x3F ; 63 1fe4a: 60 91 c9 05 lds r22, 0x05C9 ; 0x8005c9 1fe4e: 70 91 ca 05 lds r23, 0x05CA ; 0x8005ca 1fe52: 80 91 cb 05 lds r24, 0x05CB ; 0x8005cb 1fe56: 90 91 cc 05 lds r25, 0x05CC ; 0x8005cc 1fe5a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 1fe5e: 9b 01 movw r18, r22 1fe60: ac 01 movw r20, r24 1fe62: c5 01 movw r24, r10 1fe64: b4 01 movw r22, r8 1fe66: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1fe6a: 4b 01 movw r8, r22 1fe6c: 5c 01 movw r10, r24 1fe6e: 80 92 c9 05 sts 0x05C9, r8 ; 0x8005c9 1fe72: 90 92 ca 05 sts 0x05CA, r9 ; 0x8005ca 1fe76: a0 92 cb 05 sts 0x05CB, r10 ; 0x8005cb 1fe7a: b0 92 cc 05 sts 0x05CC, r11 ; 0x8005cc temp_dState_bed = pid_input; 1fe7e: 40 92 cd 05 sts 0x05CD, r4 ; 0x8005cd 1fe82: 50 92 ce 05 sts 0x05CE, r5 ; 0x8005ce 1fe86: 60 92 cf 05 sts 0x05CF, r6 ; 0x8005cf 1fe8a: 70 92 d0 05 sts 0x05D0, r7 ; 0x8005d0 pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 1fe8e: 29 85 ldd r18, Y+9 ; 0x09 1fe90: 3a 85 ldd r19, Y+10 ; 0x0a 1fe92: 4b 85 ldd r20, Y+11 ; 0x0b 1fe94: 5c 85 ldd r21, Y+12 ; 0x0c 1fe96: 6d 81 ldd r22, Y+5 ; 0x05 1fe98: 7e 81 ldd r23, Y+6 ; 0x06 1fe9a: 8f 81 ldd r24, Y+7 ; 0x07 1fe9c: 98 85 ldd r25, Y+8 ; 0x08 1fe9e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 1fea2: a5 01 movw r20, r10 1fea4: 94 01 movw r18, r8 1fea6: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1feaa: 4b 01 movw r8, r22 1feac: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 1feae: 20 e0 ldi r18, 0x00 ; 0 1feb0: 30 e0 ldi r19, 0x00 ; 0 1feb2: 4f e7 ldi r20, 0x7F ; 127 1feb4: 53 e4 ldi r21, 0x43 ; 67 1feb6: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1feba: 20 e0 ldi r18, 0x00 ; 0 1febc: 30 e0 ldi r19, 0x00 ; 0 1febe: 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) { 1fec0: 18 16 cp r1, r24 1fec2: 0c f0 brlt .+2 ; 0x1fec6 1fec4: 70 c0 rjmp .+224 ; 0x1ffa6 if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1fec6: c7 01 movw r24, r14 1fec8: b6 01 movw r22, r12 1feca: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 1fece: 18 16 cp r1, r24 1fed0: 84 f4 brge .+32 ; 0x1fef2 1fed2: a7 01 movw r20, r14 1fed4: 96 01 movw r18, r12 1fed6: 6e 85 ldd r22, Y+14 ; 0x0e 1fed8: 7d 85 ldd r23, Y+13 ; 0x0d 1feda: 83 2d mov r24, r3 1fedc: 92 2d mov r25, r2 1fede: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1fee2: 60 93 d1 05 sts 0x05D1, r22 ; 0x8005d1 1fee6: 70 93 d2 05 sts 0x05D2, r23 ; 0x8005d2 1feea: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 1feee: 90 93 d4 05 sts 0x05D4, r25 ; 0x8005d4 pid_output=MAX_BED_POWER; 1fef2: 81 2c mov r8, r1 1fef4: 91 2c mov r9, r1 1fef6: 9f e7 ldi r25, 0x7F ; 127 1fef8: a9 2e mov r10, r25 1fefa: 93 e4 ldi r25, 0x43 ; 67 1fefc: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 1fefe: 20 e0 ldi r18, 0x00 ; 0 1ff00: 30 e0 ldi r19, 0x00 ; 0 1ff02: 4a ef ldi r20, 0xFA ; 250 1ff04: 52 e4 ldi r21, 0x42 ; 66 1ff06: c3 01 movw r24, r6 1ff08: b2 01 movw r22, r4 1ff0a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1ff0e: 87 ff sbrs r24, 7 1ff10: 6d c0 rjmp .+218 ; 0x1ffec { soft_pwm_bed = (int)pid_output >> 1; 1ff12: c5 01 movw r24, r10 1ff14: b4 01 movw r22, r8 1ff16: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 1ff1a: 75 95 asr r23 1ff1c: 67 95 ror r22 1ff1e: 60 93 ee 05 sts 0x05EE, r22 ; 0x8005ee soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 1ff22: 89 81 ldd r24, Y+1 ; 0x01 1ff24: 9a 81 ldd r25, Y+2 ; 0x02 1ff26: 89 2b or r24, r25 1ff28: 11 f4 brne .+4 ; 0x1ff2e { soft_pwm_bed = 0; 1ff2a: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 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); } 1ff2e: 2e 96 adiw r28, 0x0e ; 14 1ff30: 0f b6 in r0, 0x3f ; 63 1ff32: f8 94 cli 1ff34: de bf out 0x3e, r29 ; 62 1ff36: 0f be out 0x3f, r0 ; 63 1ff38: cd bf out 0x3d, r28 ; 61 1ff3a: df 91 pop r29 1ff3c: cf 91 pop r28 1ff3e: 1f 91 pop r17 1ff40: 0f 91 pop r16 1ff42: ff 90 pop r15 1ff44: ef 90 pop r14 1ff46: df 90 pop r13 1ff48: cf 90 pop r12 1ff4a: bf 90 pop r11 1ff4c: af 90 pop r10 1ff4e: 9f 90 pop r9 1ff50: 8f 90 pop r8 1ff52: 7f 90 pop r7 1ff54: 6f 90 pop r6 1ff56: 5f 90 pop r5 1ff58: 4f 90 pop r4 1ff5a: 3f 90 pop r3 1ff5c: 2f 90 pop r2 1ff5e: 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) { 1ff60: c5 01 movw r24, r10 1ff62: b4 01 movw r22, r8 1ff64: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1ff68: 87 ff sbrs r24, 7 1ff6a: a9 ce rjmp .-686 ; 0x1fcbe if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1ff6c: 20 e0 ldi r18, 0x00 ; 0 1ff6e: 30 e0 ldi r19, 0x00 ; 0 1ff70: a9 01 movw r20, r18 1ff72: c7 01 movw r24, r14 1ff74: b6 01 movw r22, r12 1ff76: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1ff7a: 87 ff sbrs r24, 7 1ff7c: a3 cd rjmp .-1210 ; 0x1fac4 1ff7e: a7 01 movw r20, r14 1ff80: 96 01 movw r18, r12 1ff82: 6d 85 ldd r22, Y+13 ; 0x0d 1ff84: 79 85 ldd r23, Y+9 ; 0x09 1ff86: 81 2f mov r24, r17 1ff88: 90 2f mov r25, r16 1ff8a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1ff8e: 60 93 c4 05 sts 0x05C4, r22 ; 0x8005c4 1ff92: 70 93 c5 05 sts 0x05C5, r23 ; 0x8005c5 1ff96: 80 93 c6 05 sts 0x05C6, r24 ; 0x8005c6 1ff9a: 90 93 c7 05 sts 0x05C7, r25 ; 0x8005c7 1ff9e: 92 cd rjmp .-1244 ; 0x1fac4 // 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; 1ffa0: 10 92 f5 05 sts 0x05F5, r1 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> 1ffa4: b1 ce rjmp .-670 ; 0x1fd08 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){ 1ffa6: c5 01 movw r24, r10 1ffa8: b4 01 movw r22, r8 1ffaa: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1ffae: 87 ff sbrs r24, 7 1ffb0: a6 cf rjmp .-180 ; 0x1fefe if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1ffb2: 20 e0 ldi r18, 0x00 ; 0 1ffb4: 30 e0 ldi r19, 0x00 ; 0 1ffb6: a9 01 movw r20, r18 1ffb8: c7 01 movw r24, r14 1ffba: b6 01 movw r22, r12 1ffbc: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 1ffc0: 87 ff sbrs r24, 7 1ffc2: 10 c0 rjmp .+32 ; 0x1ffe4 1ffc4: a7 01 movw r20, r14 1ffc6: 96 01 movw r18, r12 1ffc8: 6e 85 ldd r22, Y+14 ; 0x0e 1ffca: 7d 85 ldd r23, Y+13 ; 0x0d 1ffcc: 83 2d mov r24, r3 1ffce: 92 2d mov r25, r2 1ffd0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 1ffd4: 60 93 d1 05 sts 0x05D1, r22 ; 0x8005d1 1ffd8: 70 93 d2 05 sts 0x05D2, r23 ; 0x8005d2 1ffdc: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 1ffe0: 90 93 d4 05 sts 0x05D4, r25 ; 0x8005d4 pid_output=0; 1ffe4: 81 2c mov r8, r1 1ffe6: 91 2c mov r9, r1 1ffe8: 54 01 movw r10, r8 1ffea: 89 cf rjmp .-238 ; 0x1fefe { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 1ffec: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 1fff0: 98 cf rjmp .-208 ; 0x1ff22 0001fff2 : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 1fff6: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 1fffa: 90 93 f0 05 sts 0x05F0, r25 ; 0x8005f0 1fffe: 80 93 ef 05 sts 0x05EF, r24 ; 0x8005ef target_temperature_bed_isr = target_temperature_bed; 20002: 80 91 59 12 lds r24, 0x1259 ; 0x801259 20006: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 2000a: 90 93 e9 05 sts 0x05E9, r25 ; 0x8005e9 2000e: 80 93 e8 05 sts 0x05E8, r24 ; 0x8005e8 } 20012: 08 95 ret 00020014 : /* 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() { 20014: cf 93 push r28 { bool temp_mgr_state; public: TempMgrGuard() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 20016: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 20018: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 2001a: c0 91 71 00 lds r28, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 2001e: c2 70 andi r28, 0x02 ; 2 DISABLE_TEMP_MGR_INTERRUPT(); 20020: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 20024: 8d 7f andi r24, 0xFD ; 253 20026: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2002a: 9f bf out 0x3f, r25 ; 63 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 20030: 90 91 f2 05 lds r25, 0x05F2 ; 0x8005f2 20034: a0 91 f3 05 lds r26, 0x05F3 ; 0x8005f3 20038: b0 91 f4 05 lds r27, 0x05F4 ; 0x8005f4 2003c: 80 93 5a 0d sts 0x0D5A, r24 ; 0x800d5a 20040: 90 93 5b 0d sts 0x0D5B, r25 ; 0x800d5b 20044: a0 93 5c 0d sts 0x0D5C, r26 ; 0x800d5c 20048: b0 93 5d 0d sts 0x0D5D, r27 ; 0x800d5d current_temperature_bed = current_temperature_bed_isr; 2004c: 80 91 ea 05 lds r24, 0x05EA ; 0x8005ea 20050: 90 91 eb 05 lds r25, 0x05EB ; 0x8005eb 20054: a0 91 ec 05 lds r26, 0x05EC ; 0x8005ec 20058: b0 91 ed 05 lds r27, 0x05ED ; 0x8005ed 2005c: 80 93 bc 03 sts 0x03BC, r24 ; 0x8003bc 20060: 90 93 bd 03 sts 0x03BD, r25 ; 0x8003bd 20064: a0 93 be 03 sts 0x03BE, r26 ; 0x8003be 20068: b0 93 bf 03 sts 0x03BF, r27 ; 0x8003bf #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 2006c: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 20070: 90 91 d7 05 lds r25, 0x05D7 ; 0x8005d7 20074: a0 91 d8 05 lds r26, 0x05D8 ; 0x8005d8 20078: b0 91 d9 05 lds r27, 0x05D9 ; 0x8005d9 2007c: 80 93 85 03 sts 0x0385, r24 ; 0x800385 20080: 90 93 86 03 sts 0x0386, r25 ; 0x800386 20084: a0 93 87 03 sts 0x0387, r26 ; 0x800387 20088: b0 93 88 03 sts 0x0388, r27 ; 0x800388 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 2008c: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 20090: 81 11 cpse r24, r1 20092: 02 c0 rjmp .+4 ; 0x20098 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 20094: 0e 94 f9 ff call 0x1fff2 ; 0x1fff2 } temp_meas_ready = false; 20098: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2009c: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2009e: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 200a0: cc 23 and r28, r28 200a2: 29 f0 breq .+10 ; 0x200ae 200a4: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 200a8: 82 60 ori r24, 0x02 ; 2 200aa: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 200ae: 9f bf out 0x3f, r25 ; 63 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 200b0: cf 91 pop r28 200b2: 08 95 ret 000200b4 : { // 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) 200b4: 81 30 cpi r24, 0x01 ; 1 200b6: 61 f1 breq .+88 ; 0x20110 200b8: 20 f0 brcs .+8 ; 0x200c2 200ba: 82 30 cpi r24, 0x02 ; 2 200bc: 09 f4 brne .+2 ; 0x200c0 200be: 4b c0 rjmp .+150 ; 0x20156 200c0: 08 95 ret { case X_AXIS: { enable_x(); 200c2: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); 200c4: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 200c8: 81 e0 ldi r24, 0x01 ; 1 200ca: 29 2f mov r18, r25 200cc: 22 70 andi r18, 0x02 ; 2 200ce: 91 ff sbrs r25, 1 200d0: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; //setup new step if (new_x_dir_pin != old_x_dir_pin) { 200d2: 86 17 cp r24, r22 200d4: 59 f0 breq .+22 ; 0x200ec WRITE_NC(X_DIR_PIN, new_x_dir_pin); 200d6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200da: 66 23 and r22, r22 200dc: a9 f0 breq .+42 ; 0x20108 200de: 82 60 ori r24, 0x02 ; 2 200e0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 200e4: 8b e8 ldi r24, 0x8B ; 139 200e6: 91 e0 ldi r25, 0x01 ; 1 200e8: 01 97 sbiw r24, 0x01 ; 1 200ea: f1 f7 brne .-4 ; 0x200e8 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 200ec: 40 9a sbi 0x08, 0 ; 8 200ee: 83 e0 ldi r24, 0x03 ; 3 200f0: 90 e0 ldi r25, 0x00 ; 0 200f2: 01 97 sbiw r24, 0x01 ; 1 200f4: f1 f7 brne .-4 ; 0x200f2 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(X_AXIS); 200f6: 40 98 cbi 0x08, 0 ; 8 #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); 200f8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200fc: 22 23 and r18, r18 200fe: 31 f0 breq .+12 ; 0x2010c 20100: 82 60 ori r24, 0x02 ; 2 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); 20102: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 20106: 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); 20108: 8d 7f andi r24, 0xFD ; 253 2010a: ea cf rjmp .-44 ; 0x200e0 #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); 2010c: 8d 7f andi r24, 0xFD ; 253 2010e: f9 cf rjmp .-14 ; 0x20102 } break; case Y_AXIS: { enable_y(); 20110: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); 20112: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 20116: 81 70 andi r24, 0x01 ; 1 uint8_t new_y_dir_pin = (INVERT_Y_DIR)^direction; //setup new step if (new_y_dir_pin != old_y_dir_pin) { 20118: 86 17 cp r24, r22 2011a: 59 f0 breq .+22 ; 0x20132 WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 2011c: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20120: 66 23 and r22, r22 20122: 99 f0 breq .+38 ; 0x2014a 20124: 91 60 ori r25, 0x01 ; 1 20126: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2012a: eb e8 ldi r30, 0x8B ; 139 2012c: f1 e0 ldi r31, 0x01 ; 1 2012e: 31 97 sbiw r30, 0x01 ; 1 20130: f1 f7 brne .-4 ; 0x2012e delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 20132: 41 9a sbi 0x08, 1 ; 8 20134: e3 e0 ldi r30, 0x03 ; 3 20136: f0 e0 ldi r31, 0x00 ; 0 20138: 31 97 sbiw r30, 0x01 ; 1 2013a: f1 f7 brne .-4 ; 0x20138 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Y_AXIS); 2013c: 41 98 cbi 0x08, 1 ; 8 #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); 2013e: 88 23 and r24, r24 20140: 31 f0 breq .+12 ; 0x2014e 20142: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20146: 81 60 ori r24, 0x01 ; 1 20148: dc cf rjmp .-72 ; 0x20102 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); 2014a: 9e 7f andi r25, 0xFE ; 254 2014c: ec cf rjmp .-40 ; 0x20126 #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); 2014e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20152: 8e 7f andi r24, 0xFE ; 254 20154: d6 cf rjmp .-84 ; 0x20102 } break; case Z_AXIS: { enable_z(); 20156: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); 20158: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2015c: 81 e0 ldi r24, 0x01 ; 1 2015e: 29 2f mov r18, r25 20160: 24 70 andi r18, 0x04 ; 4 20162: 92 ff sbrs r25, 2 20164: 80 e0 ldi r24, 0x00 ; 0 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) { 20166: 68 17 cp r22, r24 20168: 59 f0 breq .+22 ; 0x20180 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 2016a: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2016e: 66 23 and r22, r22 20170: b1 f0 breq .+44 ; 0x2019e 20172: 94 60 ori r25, 0x04 ; 4 20174: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20178: eb e8 ldi r30, 0x8B ; 139 2017a: f1 e0 ldi r31, 0x01 ; 1 2017c: 31 97 sbiw r30, 0x01 ; 1 2017e: f1 f7 brne .-4 ; 0x2017c delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 20180: 42 9a sbi 0x08, 2 ; 8 20182: e3 e0 ldi r30, 0x03 ; 3 20184: f0 e0 ldi r31, 0x00 ; 0 20186: 31 97 sbiw r30, 0x01 ; 1 20188: f1 f7 brne .-4 ; 0x20186 STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); 2018a: 42 98 cbi 0x08, 2 ; 8 //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { 2018c: 68 17 cp r22, r24 2018e: 09 f4 brne .+2 ; 0x20192 20190: ba cf rjmp .-140 ; 0x20106 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 20192: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20196: 22 23 and r18, r18 20198: 21 f0 breq .+8 ; 0x201a2 2019a: 84 60 ori r24, 0x04 ; 4 2019c: b2 cf rjmp .-156 ; 0x20102 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); 2019e: 9b 7f andi r25, 0xFB ; 251 201a0: e9 cf rjmp .-46 ; 0x20174 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); 201a2: 8b 7f andi r24, 0xFB ; 251 201a4: ae cf rjmp .-164 ; 0x20102 000201a6 : } } static void checkRx(void) { if (selectedSerialPort == 0) { 201a6: 80 91 1c 06 lds r24, 0x061C ; 0x80061c 201aa: 81 11 cpse r24, r1 201ac: 25 c0 rjmp .+74 ; 0x201f8 if((M_UCSRxA & (1< 201b2: 87 ff sbrs r24, 7 201b4: 3d c0 rjmp .+122 ; 0x20230 // Test for a framing error. if (M_UCSRxA & (1< 201ba: 84 ff sbrs r24, 4 201bc: 03 c0 rjmp .+6 ; 0x201c4 // 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); 201be: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 201c2: 08 95 ret } else { unsigned char c = M_UDRx; 201c4: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 201c8: 20 91 42 05 lds r18, 0x0542 ; 0x800542 201cc: 30 91 43 05 lds r19, 0x0543 ; 0x800543 201d0: c9 01 movw r24, r18 201d2: 01 96 adiw r24, 0x01 ; 1 201d4: 8f 77 andi r24, 0x7F ; 127 201d6: 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) { 201d8: 60 91 44 05 lds r22, 0x0544 ; 0x800544 201dc: 70 91 45 05 lds r23, 0x0545 ; 0x800545 201e0: 86 17 cp r24, r22 201e2: 97 07 cpc r25, r23 201e4: 29 f1 breq .+74 ; 0x20230 // 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; 201e6: 2e 53 subi r18, 0x3E ; 62 201e8: 3b 4f sbci r19, 0xFB ; 251 201ea: f9 01 movw r30, r18 201ec: 40 83 st Z, r20 rx_buffer.head = i; 201ee: 90 93 43 05 sts 0x0543, r25 ; 0x800543 201f2: 80 93 42 05 sts 0x0542, r24 ; 0x800542 201f6: 1c c0 rjmp .+56 ; 0x20230 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 201fc: 87 ff sbrs r24, 7 201fe: 18 c0 rjmp .+48 ; 0x20230 // Test for a framing error. if (UCSR1A & (1< 20204: 84 ff sbrs r24, 4 20206: 03 c0 rjmp .+6 ; 0x2020e // 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); 20208: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 2020c: 08 95 ret } else { unsigned char c = UDR1; 2020e: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 20212: 20 91 42 05 lds r18, 0x0542 ; 0x800542 20216: 30 91 43 05 lds r19, 0x0543 ; 0x800543 2021a: c9 01 movw r24, r18 2021c: 01 96 adiw r24, 0x01 ; 1 2021e: 8f 77 andi r24, 0x7F ; 127 20220: 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) { 20222: 60 91 44 05 lds r22, 0x0544 ; 0x800544 20226: 70 91 45 05 lds r23, 0x0545 ; 0x800545 2022a: 68 17 cp r22, r24 2022c: 79 07 cpc r23, r25 2022e: d9 f6 brne .-74 ; 0x201e6 M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 20230: 08 95 ret 00020232 : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 20232: 93 e0 ldi r25, 0x03 ; 3 20234: 81 11 cpse r24, r1 20236: 91 e0 ldi r25, 0x01 ; 1 for(nI=0;nI delayMicroseconds(200); WRITE(BEEPER,LOW); 2024a: 72 98 cbi 0x0e, 2 ; 14 2024c: f9 01 movw r30, r18 2024e: 31 97 sbiw r30, 0x01 ; 1 20250: f1 f7 brne .-4 ; 0x2024e 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); } } 20258: 08 95 ret 0002025a : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 2025a: 8a e0 ldi r24, 0x0A ; 10 2025c: 2b e8 ldi r18, 0x8B ; 139 2025e: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 20260: 72 9a sbi 0x0e, 2 ; 14 20262: f9 01 movw r30, r18 20264: 31 97 sbiw r30, 0x01 ; 1 20266: f1 f7 brne .-4 ; 0x20264 delayMicroseconds(100); WRITE(BEEPER,LOW); 20268: 72 98 cbi 0x0e, 2 ; 14 2026a: f9 01 movw r30, r18 2026c: 31 97 sbiw r30, 0x01 ; 1 2026e: f1 f7 brne .-4 ; 0x2026c 20270: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 20272: b1 f7 brne .-20 ; 0x20260 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 20274: 08 95 ret 00020276 : /// 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; 20276: 86 27 eor r24, r22 20278: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 2027a: 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) { 2027c: 38 2f mov r19, r24 2027e: 88 0f add r24, r24 20280: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 20282: 82 27 eor r24, r18 20284: 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++) { 20286: d1 f7 brne .-12 ; 0x2027c } else { data <<= 1U; } } return data; } 20288: 08 95 ret 0002028a : #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){ 2028a: cf 93 push r28 2028c: df 93 push r29 2028e: cd b7 in r28, 0x3d ; 61 20290: de b7 in r29, 0x3e ; 62 20292: 2f 97 sbiw r28, 0x0f ; 15 20294: 0f b6 in r0, 0x3f ; 63 20296: f8 94 cli 20298: de bf out 0x3e, r29 ; 62 2029a: 0f be out 0x3f, r0 ; 63 2029c: cd bf out 0x3d, r28 ; 61 2029e: fc 01 movw r30, r24 202a0: de 01 movw r26, r28 202a2: 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; 202a4: 90 e0 ldi r25, 0x00 ; 0 202a6: 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); 202a8: 84 91 lpm r24, Z 202aa: 41 e0 ldi r20, 0x01 ; 1 202ac: 49 0f add r20, r25 if( ! b ) 202ae: 88 23 and r24, r24 202b0: 29 f0 breq .+10 ; 0x202bc break; dst[i] = b; 202b2: 8d 93 st X+, r24 202b4: 31 96 adiw r30, 0x01 ; 1 202b6: 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 202b8: 4d 30 cpi r20, 0x0D ; 13 202ba: b1 f7 brne .-20 ; 0x202a8 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 202bc: f9 01 movw r30, r18 202be: e9 0f add r30, r25 202c0: f1 1d adc r31, r1 202c2: 8a e3 ldi r24, 0x3A ; 58 202c4: 80 83 st Z, r24 ++i; 202c6: 9f 5f subi r25, 0xFF ; 255 202c8: f9 01 movw r30, r18 202ca: e9 0f add r30, r25 202cc: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 202ce: 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 202d0: 9e 30 cpi r25, 0x0E ; 14 202d2: 19 f0 breq .+6 ; 0x202da dst[i] = ' '; 202d4: 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 202d6: 9f 5f subi r25, 0xFF ; 255 202d8: fb cf rjmp .-10 ; 0x202d0 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 202da: 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 202dc: 7f 93 push r23 202de: 6f 93 push r22 202e0: 3f 93 push r19 202e2: 2f 93 push r18 202e4: 86 e1 ldi r24, 0x16 ; 22 202e6: 98 e9 ldi r25, 0x98 ; 152 202e8: 9f 93 push r25 202ea: 8f 93 push r24 202ec: 0e 94 db 6e call 0xddb6 ; 0xddb6 202f0: 0f 90 pop r0 202f2: 0f 90 pop r0 202f4: 0f 90 pop r0 202f6: 0f 90 pop r0 202f8: 0f 90 pop r0 202fa: 0f 90 pop r0 } 202fc: 2f 96 adiw r28, 0x0f ; 15 202fe: 0f b6 in r0, 0x3f ; 63 20300: f8 94 cli 20302: de bf out 0x3e, r29 ; 62 20304: 0f be out 0x3f, r0 ; 63 20306: cd bf out 0x3d, r28 ; 61 20308: df 91 pop r29 2030a: cf 91 pop r28 2030c: 08 95 ret 0002030e : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 2030e: df 92 push r13 20310: ef 92 push r14 20312: ff 92 push r15 20314: 0f 93 push r16 20316: 1f 93 push r17 20318: cf 93 push r28 2031a: df 93 push r29 2031c: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20320: 0e 94 ef 6f call 0xdfde ; 0xdfde 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] ); 20324: c7 eb ldi r28, 0xB7 ; 183 20326: d3 e0 ldi r29, 0x03 ; 3 20328: 8a 81 ldd r24, Y+2 ; 0x02 2032a: 9b 81 ldd r25, Y+3 ; 0x03 2032c: 2c e3 ldi r18, 0x3C ; 60 2032e: f2 2e mov r15, r18 20330: f8 9e mul r15, r24 20332: 80 01 movw r16, r0 20334: f9 9e mul r15, r25 20336: 10 0d add r17, r0 20338: 11 24 eor r1, r1 2033a: 8a eb ldi r24, 0xBA ; 186 2033c: 99 e4 ldi r25, 0x49 ; 73 2033e: 0e 94 0a 75 call 0xea14 ; 0xea14 20342: e8 2e mov r14, r24 20344: d9 2e mov r13, r25 20346: 88 81 ld r24, Y 20348: 99 81 ldd r25, Y+1 ; 0x01 2034a: f8 9e mul r15, r24 2034c: e0 01 movw r28, r0 2034e: f9 9e mul r15, r25 20350: d0 0d add r29, r0 20352: 11 24 eor r1, r1 20354: 87 ec ldi r24, 0xC7 ; 199 20356: 99 e4 ldi r25, 0x49 ; 73 20358: 0e 94 0a 75 call 0xea14 ; 0xea14 2035c: 1f 93 push r17 2035e: 0f 93 push r16 20360: df 92 push r13 20362: ef 92 push r14 20364: df 93 push r29 20366: cf 93 push r28 20368: 9f 93 push r25 2036a: 8f 93 push r24 2036c: 8c e8 ldi r24, 0x8C ; 140 2036e: 97 e9 ldi r25, 0x97 ; 151 20370: 9f 93 push r25 20372: 8f 93 push r24 20374: 0e 94 db 6e call 0xddb6 ; 0xddb6 menu_back_if_clicked(); 20378: 8d b7 in r24, 0x3d ; 61 2037a: 9e b7 in r25, 0x3e ; 62 2037c: 0a 96 adiw r24, 0x0a ; 10 2037e: 0f b6 in r0, 0x3f ; 63 20380: f8 94 cli 20382: 9e bf out 0x3e, r25 ; 62 20384: 0f be out 0x3f, r0 ; 63 20386: 8d bf out 0x3d, r24 ; 61 } 20388: df 91 pop r29 2038a: cf 91 pop r28 2038c: 1f 91 pop r17 2038e: 0f 91 pop r16 20390: ff 90 pop r15 20392: ef 90 pop r14 20394: 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(); 20396: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 0002039a : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 2039a: cf 92 push r12 2039c: df 92 push r13 2039e: ef 92 push r14 203a0: ff 92 push r15 203a2: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 203a6: 0e 94 ef 6f call 0xdfde ; 0xdfde lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 203aa: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 203ae: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 203b2: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 203b6: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 203ba: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 203be: 6b 01 movw r12, r22 203c0: 89 e8 ldi r24, 0x89 ; 137 203c2: 94 e4 ldi r25, 0x44 ; 68 203c4: 0e 94 0a 75 call 0xea14 ; 0xea14 203c8: b6 01 movw r22, r12 203ca: 0f 94 45 01 call 0x2028a ; 0x2028a lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 203ce: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 203d2: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 203d6: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 203da: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 203de: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 203e2: 6b 01 movw r12, r22 203e4: 8e e6 ldi r24, 0x6E ; 110 203e6: 94 e4 ldi r25, 0x44 ; 68 203e8: 0e 94 0a 75 call 0xea14 ; 0xea14 203ec: b6 01 movw r22, r12 203ee: 0f 94 45 01 call 0x2028a ; 0x2028a #ifdef AMBIENT_THERMISTOR 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 203f2: 60 91 85 03 lds r22, 0x0385 ; 0x800385 203f6: 70 91 86 03 lds r23, 0x0386 ; 0x800386 203fa: 80 91 87 03 lds r24, 0x0387 ; 0x800387 203fe: 90 91 88 03 lds r25, 0x0388 ; 0x800388 20402: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 20406: 82 ed ldi r24, 0xD2 ; 210 20408: 97 e6 ldi r25, 0x67 ; 103 2040a: 0f 94 45 01 call 0x2028a ; 0x2028a #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 2040e: ff 90 pop r15 20410: ef 90 pop r14 20412: df 90 pop r13 20414: 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(); 20416: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 0002041a : } #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)); 2041a: 8e e4 ldi r24, 0x4E ; 78 2041c: 98 e5 ldi r25, 0x58 ; 88 2041e: 0e 94 0a 75 call 0xea14 ; 0xea14 20422: 0e 94 0f de call 0x1bc1e ; 0x1bc1e menu_back_if_clicked(); 20426: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 0002042a : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 2042a: 87 ea ldi r24, 0xA7 ; 167 2042c: 9c e0 ldi r25, 0x0C ; 12 2042e: 0f 94 9d a3 call 0x3473a ; 0x3473a if (eeprom_setting != 0) 20432: 81 11 cpse r24, r1 20434: 05 c0 rjmp .+10 ; 0x20440 return false; switch(eFilamentAction) { 20436: 80 91 94 03 lds r24, 0x0394 ; 0x800394 2043a: 81 50 subi r24, 0x01 ; 1 2043c: 88 30 cpi r24, 0x08 ; 8 2043e: 10 f0 brcs .+4 ; 0x20444 #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; 20440: 80 e0 ldi r24, 0x00 ; 0 20442: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 20444: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 20446: 08 95 ret 00020448 : //! | 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() { 20448: cf 92 push r12 2044a: df 92 push r13 2044c: ef 92 push r14 2044e: ff 92 push r15 20450: 0f 93 push r16 20452: 1f 93 push r17 20454: cf 93 push r28 20456: df 93 push r29 20458: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 2045c: 0e 94 ef 6f call 0xdfde ; 0xdfde " %-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) )); 20460: 8f ec ldi r24, 0xCF ; 207 20462: 9e e0 ldi r25, 0x0E ; 14 20464: 0f 94 9d a3 call 0x3473a ; 0x3473a //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 20468: 90 e0 ldi r25, 0x00 ; 0 2046a: 0e 94 e8 fc call 0x1f9d0 ; 0x1f9d0 2046e: d8 2e mov r13, r24 20470: c9 2e mov r12, r25 20472: 80 ea ldi r24, 0xA0 ; 160 20474: 96 e5 ldi r25, 0x56 ; 86 20476: 0e 94 0a 75 call 0xea14 ; 0xea14 2047a: f8 2e mov r15, r24 2047c: 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) ), 2047e: 82 ed ldi r24, 0xD2 ; 210 20480: 9e e0 ldi r25, 0x0E ; 14 20482: 0f 94 9d a3 call 0x3473a ; 0x3473a //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 20486: 90 e0 ldi r25, 0x00 ; 0 20488: 0e 94 e8 fc call 0x1f9d0 ; 0x1f9d0 2048c: 18 2f mov r17, r24 2048e: 09 2f mov r16, r25 20490: 84 e9 ldi r24, 0x94 ; 148 20492: 96 e5 ldi r25, 0x56 ; 86 20494: 0e 94 0a 75 call 0xea14 ; 0xea14 20498: ec 01 movw r28, r24 2049a: 86 ed ldi r24, 0xD6 ; 214 2049c: 96 e5 ldi r25, 0x56 ; 86 2049e: 0e 94 0a 75 call 0xea14 ; 0xea14 204a2: cf 92 push r12 204a4: df 92 push r13 204a6: ef 92 push r14 204a8: ff 92 push r15 204aa: 0f 93 push r16 204ac: 1f 93 push r17 204ae: df 93 push r29 204b0: cf 93 push r28 204b2: 9f 93 push r25 204b4: 8f 93 push r24 204b6: 87 ea ldi r24, 0xA7 ; 167 204b8: 97 e9 ldi r25, 0x97 ; 151 204ba: 9f 93 push r25 204bc: 8f 93 push r24 204be: 0e 94 db 6e call 0xddb6 ; 0xddb6 " %-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(); 204c2: 8d b7 in r24, 0x3d ; 61 204c4: 9e b7 in r25, 0x3e ; 62 204c6: 0c 96 adiw r24, 0x0c ; 12 204c8: 0f b6 in r0, 0x3f ; 63 204ca: f8 94 cli 204cc: 9e bf out 0x3e, r25 ; 62 204ce: 0f be out 0x3f, r0 ; 63 204d0: 8d bf out 0x3d, r24 ; 61 } 204d2: df 91 pop r29 204d4: cf 91 pop r28 204d6: 1f 91 pop r17 204d8: 0f 91 pop r16 204da: ff 90 pop r15 204dc: ef 90 pop r14 204de: df 90 pop r13 204e0: 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(); 204e2: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 000204e6 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 204e6: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 204ea: 10 92 60 04 sts 0x0460, r1 ; 0x800460 204ee: 80 91 60 04 lds r24, 0x0460 ; 0x800460 204f2: 84 30 cpi r24, 0x04 ; 4 204f4: 68 f5 brcc .+90 ; 0x20550 204f6: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 204fa: 8c e8 ldi r24, 0x8C ; 140 204fc: 98 e4 ldi r25, 0x48 ; 72 204fe: 0e 94 0a 75 call 0xea14 ; 0xea14 20502: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 20506: 87 e8 ldi r24, 0x87 ; 135 20508: 96 e5 ldi r25, 0x56 ; 86 2050a: 0e 94 0a 75 call 0xea14 ; 0xea14 2050e: 60 ef ldi r22, 0xF0 ; 240 20510: 77 e3 ldi r23, 0x37 ; 55 20512: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 20516: 8f e7 ldi r24, 0x7F ; 127 20518: 96 e5 ldi r25, 0x56 ; 86 2051a: 0e 94 0a 75 call 0xea14 ; 0xea14 2051e: 64 e7 ldi r22, 0x74 ; 116 20520: 78 e3 ldi r23, 0x38 ; 56 20522: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 20526: 83 ec ldi r24, 0xC3 ; 195 20528: 96 e5 ldi r25, 0x56 ; 86 2052a: 0e 94 0a 75 call 0xea14 ; 0xea14 2052e: 6c e4 ldi r22, 0x4C ; 76 20530: 77 e3 ldi r23, 0x37 ; 55 20532: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_END(); 20536: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 2053a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 2053e: 8f 5f subi r24, 0xFF ; 255 20540: 80 93 60 04 sts 0x0460, r24 ; 0x800460 20544: 80 91 62 04 lds r24, 0x0462 ; 0x800462 20548: 8f 5f subi r24, 0xFF ; 255 2054a: 80 93 62 04 sts 0x0462, r24 ; 0x800462 2054e: cf cf rjmp .-98 ; 0x204ee 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(); } 20550: 08 95 ret 00020552 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 20552: 80 91 15 06 lds r24, 0x0615 ; 0x800615 20556: 81 11 cpse r24, r1 20558: 03 c0 rjmp .+6 ; 0x20560 2055a: 82 e0 ldi r24, 0x02 ; 2 2055c: 0c 94 cf 62 jmp 0xc59e ; 0xc59e 20560: 81 e0 ldi r24, 0x01 ; 1 20562: fc cf rjmp .-8 ; 0x2055c 00020564 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 20564: 8e ec ldi r24, 0xCE ; 206 20566: 9e e0 ldi r25, 0x0E ; 14 20568: 0f 94 9d a3 call 0x3473a ; 0x3473a 2056c: 60 e0 ldi r22, 0x00 ; 0 2056e: 81 30 cpi r24, 0x01 ; 1 20570: 09 f0 breq .+2 ; 0x20574 20572: 61 e0 ldi r22, 0x01 ; 1 20574: 8e ec ldi r24, 0xCE ; 206 20576: 9e e0 ldi r25, 0x0E ; 14 20578: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 0002057c : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 2057c: 60 91 40 02 lds r22, 0x0240 ; 0x800240 20580: 81 e0 ldi r24, 0x01 ; 1 20582: 68 27 eor r22, r24 20584: 60 93 40 02 sts 0x0240, r22 ; 0x800240 20588: 87 e8 ldi r24, 0x87 ; 135 2058a: 9f e0 ldi r25, 0x0F ; 15 2058c: 0f 94 c1 a3 call 0x34782 ; 0x34782 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. 20590: 80 91 40 02 lds r24, 0x0240 ; 0x800240 20594: 81 11 cpse r24, r1 20596: 02 c0 rjmp .+4 ; 0x2059c 20598: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce #endif //FANCHECK } 2059c: 08 95 ret 0002059e : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 2059e: 86 ed ldi r24, 0xD6 ; 214 205a0: 9e e0 ldi r25, 0x0E ; 14 205a2: 0f 94 9d a3 call 0x3473a ; 0x3473a 205a6: 61 e0 ldi r22, 0x01 ; 1 205a8: 82 30 cpi r24, 0x02 ; 2 205aa: 09 f0 breq .+2 ; 0x205ae 205ac: 62 e0 ldi r22, 0x02 ; 2 205ae: 86 ed ldi r24, 0xD6 ; 214 205b0: 9e e0 ldi r25, 0x0E ; 14 205b2: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 000205b6 : #ifdef MENU_SERIAL_DUMP #include "Dcodes.h" static void lcd_serial_dump() { serial_dump_and_reset(dump_crash_reason::manual); 205b6: 80 e0 ldi r24, 0x00 ; 0 205b8: 0c 94 71 84 jmp 0x108e2 ; 0x108e2 000205bc : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 205bc: ef 92 push r14 205be: ff 92 push r15 205c0: 0f 93 push r16 205c2: 1f 93 push r17 205c4: cf 93 push r28 205c6: 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) 205c8: 80 91 96 03 lds r24, 0x0396 ; 0x800396 205cc: 88 23 and r24, r24 205ce: 29 f0 breq .+10 ; 0x205da 205d0: 90 91 59 02 lds r25, 0x0259 ; 0x800259 205d4: 92 30 cpi r25, 0x02 ; 2 205d6: 09 f0 breq .+2 ; 0x205da 205d8: 74 c1 rjmp .+744 ; 0x208c2 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 205da: 81 e0 ldi r24, 0x01 ; 1 205dc: 80 93 96 03 sts 0x0396, r24 ; 0x800396 205e0: 80 91 48 16 lds r24, 0x1648 ; 0x801648 _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 205e4: 80 93 97 03 sts 0x0397, r24 ; 0x800397 if (_md->is_flash_air) { 205e8: 88 23 and r24, r24 205ea: 21 f0 breq .+8 ; 0x205f4 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 205ec: 88 e9 ldi r24, 0x98 ; 152 205ee: 93 e0 ldi r25, 0x03 ; 3 205f0: 0f 94 34 78 call 0x2f068 ; 0x2f068 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 205f4: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 205f8: 10 92 60 04 sts 0x0460, r1 ; 0x800460 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); 205fc: 81 e5 ldi r24, 0x51 ; 81 205fe: e8 2e mov r14, r24 20600: 88 e9 ldi r24, 0x98 ; 152 20602: 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]); 20604: c0 e2 ldi r28, 0x20 ; 32 20606: d8 e9 ldi r29, 0x98 ; 152 20608: 0c e9 ldi r16, 0x9C ; 156 2060a: 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(); 2060c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 20610: 84 30 cpi r24, 0x04 ; 4 20612: 08 f0 brcs .+2 ; 0x20616 20614: 7d c1 rjmp .+762 ; 0x20910 20616: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2061a: 8c e8 ldi r24, 0x8C ; 140 2061c: 98 e4 ldi r25, 0x48 ; 72 2061e: 0e 94 0a 75 call 0xea14 ; 0xea14 20622: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR("Firmware:")); 20626: 84 eb ldi r24, 0xB4 ; 180 20628: 98 e9 ldi r25, 0x98 ; 152 2062a: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 2062e: 87 ea ldi r24, 0xA7 ; 167 20630: 98 e9 ldi r25, 0x98 ; 152 20632: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 20636: 89 e9 ldi r24, 0x99 ; 153 20638: 98 e9 ldi r25, 0x98 ; 152 2063a: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 2063e: 89 e8 ldi r24, 0x89 ; 137 20640: 98 e9 ldi r25, 0x98 ; 152 20642: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 20646: 8c e0 ldi r24, 0x0C ; 12 20648: 9b e6 ldi r25, 0x6B ; 107 2064a: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 2064e: 8a ef ldi r24, 0xFA ; 250 20650: 9a e6 ldi r25, 0x6A ; 106 20652: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 20656: 89 ee ldi r24, 0xE9 ; 233 20658: 9a e6 ldi r25, 0x6A ; 106 2065a: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(STR_SEPARATOR); 2065e: 8f ed ldi r24, 0xDF ; 223 20660: 93 e8 ldi r25, 0x83 ; 131 20662: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 20666: 8d e7 ldi r24, 0x7D ; 125 20668: 98 e9 ldi r25, 0x98 ; 152 2066a: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 2066e: 84 e7 ldi r24, 0x74 ; 116 20670: 98 e9 ldi r25, 0x98 ; 152 20672: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 20676: 8a e6 ldi r24, 0x6A ; 106 20678: 98 e9 ldi r25, 0x98 ; 152 2067a: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(STR_SEPARATOR); 2067e: 8f ed ldi r24, 0xDF ; 223 20680: 93 e8 ldi r25, 0x83 ; 131 20682: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(_T(MSG_DATE)); 20686: 89 e7 ldi r24, 0x79 ; 121 20688: 97 e5 ldi r25, 0x57 ; 87 2068a: 0e 94 0a 75 call 0xea14 ; 0xea14 2068e: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 20692: 8f e5 ldi r24, 0x5F ; 95 20694: 98 e9 ldi r25, 0x98 ; 152 20696: 0e 94 9e 72 call 0xe53c ; 0xe53c 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); 2069a: 8f ed ldi r24, 0xDF ; 223 2069c: 93 e8 ldi r25, 0x83 ; 131 2069e: 0e 94 9e 72 call 0xe53c ; 0xe53c if (MMU2::mmu2.Enabled()) 206a2: 80 91 01 13 lds r24, 0x1301 ; 0x801301 206a6: 81 30 cpi r24, 0x01 ; 1 206a8: 09 f0 breq .+2 ; 0x206ac 206aa: 2d c1 rjmp .+602 ; 0x20906 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 206ac: 89 e6 ldi r24, 0x69 ; 105 206ae: 97 e5 ldi r25, 0x57 ; 87 206b0: 0e 94 0a 75 call 0xea14 ; 0xea14 206b4: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 206b8: 8a e5 ldi r24, 0x5A ; 90 206ba: 98 e9 ldi r25, 0x98 ; 152 206bc: 0e 94 9e 72 call 0xe53c ; 0xe53c if (((menu_item - 1) == menu_line) && lcd_draw_update) 206c0: 80 91 63 04 lds r24, 0x0463 ; 0x800463 206c4: 81 50 subi r24, 0x01 ; 1 206c6: 99 0b sbc r25, r25 206c8: 20 91 62 04 lds r18, 0x0462 ; 0x800462 206cc: 28 17 cp r18, r24 206ce: 19 06 cpc r1, r25 206d0: 49 f5 brne .+82 ; 0x20724 206d2: 80 91 59 02 lds r24, 0x0259 ; 0x800259 206d6: 88 23 and r24, r24 206d8: 29 f1 breq .+74 ; 0x20724 { lcd_set_cursor(6, menu_row); 206da: 60 91 60 04 lds r22, 0x0460 ; 0x800460 206de: 86 e0 ldi r24, 0x06 ; 6 206e0: 0e 94 2a 6f call 0xde54 ; 0xde54 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) { 206e4: 80 91 01 13 lds r24, 0x1301 ; 0x801301 206e8: 81 30 cpi r24, 0x01 ; 1 206ea: 09 f0 breq .+2 ; 0x206ee 206ec: 05 c1 rjmp .+522 ; 0x208f8 206ee: 80 91 e1 12 lds r24, 0x12E1 ; 0x8012e1 206f2: 90 91 e2 12 lds r25, 0x12E2 ; 0x8012e2 206f6: 20 91 e3 12 lds r18, 0x12E3 ; 0x8012e3 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 206fa: 88 23 and r24, r24 206fc: 09 f4 brne .+2 ; 0x20700 206fe: fc c0 rjmp .+504 ; 0x208f8 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 20700: 1f 92 push r1 20702: 2f 93 push r18 20704: 1f 92 push r1 20706: 9f 93 push r25 20708: 1f 92 push r1 2070a: 8f 93 push r24 2070c: ff 92 push r15 2070e: ef 92 push r14 20710: 0e 94 db 6e call 0xddb6 ; 0xddb6 20714: 8d b7 in r24, 0x3d ; 61 20716: 9e b7 in r25, 0x3e ; 62 20718: 08 96 adiw r24, 0x08 ; 8 2071a: 0f b6 in r0, 0x3f ; 63 2071c: f8 94 cli 2071e: 9e bf out 0x3e, r25 ; 62 20720: 0f be out 0x3f, r0 ; 63 20722: 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) { 20724: 80 91 97 03 lds r24, 0x0397 ; 0x800397 20728: 88 23 and r24, r24 2072a: 09 f4 brne .+2 ; 0x2072e 2072c: 40 c0 rjmp .+128 ; 0x207ae MENU_ITEM_BACK_P(STR_SEPARATOR); 2072e: 8f ed ldi r24, 0xDF ; 223 20730: 93 e8 ldi r25, 0x83 ; 131 20732: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 20736: 80 e3 ldi r24, 0x30 ; 48 20738: 98 e9 ldi r25, 0x98 ; 152 2073a: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(" ")); 2073e: 8e e2 ldi r24, 0x2E ; 46 20740: 98 e9 ldi r25, 0x98 ; 152 20742: 0e 94 9e 72 call 0xe53c ; 0xe53c if (((menu_item - 1) == menu_line) && lcd_draw_update) { 20746: 80 91 63 04 lds r24, 0x0463 ; 0x800463 2074a: 81 50 subi r24, 0x01 ; 1 2074c: 99 0b sbc r25, r25 2074e: 20 91 62 04 lds r18, 0x0462 ; 0x800462 20752: 28 17 cp r18, r24 20754: 19 06 cpc r1, r25 20756: 59 f5 brne .+86 ; 0x207ae 20758: 80 91 59 02 lds r24, 0x0259 ; 0x800259 2075c: 88 23 and r24, r24 2075e: 39 f1 breq .+78 ; 0x207ae lcd_set_cursor(2, menu_row); 20760: 60 91 60 04 lds r22, 0x0460 ; 0x800460 20764: 82 e0 ldi r24, 0x02 ; 2 20766: 0e 94 2a 6f call 0xde54 ; 0xde54 2076a: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 2076e: 1f 92 push r1 20770: 8f 93 push r24 20772: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 20776: 1f 92 push r1 20778: 8f 93 push r24 2077a: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2077e: 1f 92 push r1 20780: 8f 93 push r24 20782: 80 91 98 03 lds r24, 0x0398 ; 0x800398 20786: 1f 92 push r1 20788: 8f 93 push r24 2078a: df 93 push r29 2078c: cf 93 push r28 2078e: 1f 93 push r17 20790: 0f 93 push r16 20792: 0f 94 b4 a2 call 0x34568 ; 0x34568 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 20796: 8c e9 ldi r24, 0x9C ; 156 20798: 93 e0 ldi r25, 0x03 ; 3 2079a: 0e 94 2f 73 call 0xe65e ; 0xe65e 2079e: 8d b7 in r24, 0x3d ; 61 207a0: 9e b7 in r25, 0x3e ; 62 207a2: 0c 96 adiw r24, 0x0c ; 12 207a4: 0f b6 in r0, 0x3f ; 63 207a6: f8 94 cli 207a8: 9e bf out 0x3e, r25 ; 62 207aa: 0f be out 0x3f, r0 ; 63 207ac: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 207ae: 80 91 10 06 lds r24, 0x0610 ; 0x800610 207b2: 90 91 11 06 lds r25, 0x0611 ; 0x800611 207b6: a0 91 12 06 lds r26, 0x0612 ; 0x800612 207ba: b0 91 13 06 lds r27, 0x0613 ; 0x800613 207be: 89 2b or r24, r25 207c0: 8a 2b or r24, r26 207c2: 8b 2b or r24, r27 207c4: 09 f4 brne .+2 ; 0x207c8 207c6: 42 c0 rjmp .+132 ; 0x2084c MENU_ITEM_BACK_P(STR_SEPARATOR); 207c8: 8f ed ldi r24, 0xDF ; 223 207ca: 93 e8 ldi r25, 0x83 ; 131 207cc: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 207d0: 8c e4 ldi r24, 0x4C ; 76 207d2: 97 e5 ldi r25, 0x57 ; 87 207d4: 0e 94 0a 75 call 0xea14 ; 0xea14 207d8: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_BACK_P(PSTR(" ")); 207dc: 8c e2 ldi r24, 0x2C ; 44 207de: 98 e9 ldi r25, 0x98 ; 152 207e0: 0e 94 9e 72 call 0xe53c ; 0xe53c if (((menu_item - 1) == menu_line) && lcd_draw_update) { 207e4: 80 91 63 04 lds r24, 0x0463 ; 0x800463 207e8: 81 50 subi r24, 0x01 ; 1 207ea: 99 0b sbc r25, r25 207ec: 20 91 62 04 lds r18, 0x0462 ; 0x800462 207f0: 28 17 cp r18, r24 207f2: 19 06 cpc r1, r25 207f4: 59 f5 brne .+86 ; 0x2084c 207f6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 207fa: 88 23 and r24, r24 207fc: 39 f1 breq .+78 ; 0x2084c lcd_set_cursor(2, menu_row); 207fe: 60 91 60 04 lds r22, 0x0460 ; 0x800460 20802: 82 e0 ldi r24, 0x02 ; 2 20804: 0e 94 2a 6f call 0xde54 ; 0xde54 20808: 80 91 13 06 lds r24, 0x0613 ; 0x800613 2080c: 1f 92 push r1 2080e: 8f 93 push r24 20810: 80 91 12 06 lds r24, 0x0612 ; 0x800612 20814: 1f 92 push r1 20816: 8f 93 push r24 20818: 80 91 11 06 lds r24, 0x0611 ; 0x800611 2081c: 1f 92 push r1 2081e: 8f 93 push r24 20820: 80 91 10 06 lds r24, 0x0610 ; 0x800610 20824: 1f 92 push r1 20826: 8f 93 push r24 20828: df 93 push r29 2082a: cf 93 push r28 2082c: 1f 93 push r17 2082e: 0f 93 push r16 20830: 0f 94 b4 a2 call 0x34568 ; 0x34568 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 20834: 8c e9 ldi r24, 0x9C ; 156 20836: 93 e0 ldi r25, 0x03 ; 3 20838: 0e 94 2f 73 call 0xe65e ; 0xe65e 2083c: 8d b7 in r24, 0x3d ; 61 2083e: 9e b7 in r25, 0x3e ; 62 20840: 0c 96 adiw r24, 0x0c ; 12 20842: 0f b6 in r0, 0x3f ; 63 20844: f8 94 cli 20846: 9e bf out 0x3e, r25 ; 62 20848: 0f be out 0x3f, r0 ; 63 2084a: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 2084c: 8f ed ldi r24, 0xDF ; 223 2084e: 93 e8 ldi r25, 0x83 ; 131 20850: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 20854: 89 e3 ldi r24, 0x39 ; 57 20856: 97 e5 ldi r25, 0x57 ; 87 20858: 0e 94 0a 75 call 0xea14 ; 0xea14 2085c: 63 e8 ldi r22, 0x83 ; 131 2085e: 74 ec ldi r23, 0xC4 ; 196 20860: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 20864: 89 e2 ldi r24, 0x29 ; 41 20866: 97 e5 ldi r25, 0x57 ; 87 20868: 0e 94 0a 75 call 0xea14 ; 0xea14 2086c: 66 eb ldi r22, 0xB6 ; 182 2086e: 77 e3 ldi r23, 0x37 ; 55 20870: 0e 94 c3 72 call 0xe586 ; 0xe586 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 20874: 8b e1 ldi r24, 0x1B ; 27 20876: 97 e5 ldi r25, 0x57 ; 87 20878: 0e 94 0a 75 call 0xea14 ; 0xea14 2087c: 60 e8 ldi r22, 0x80 ; 128 2087e: 72 ec ldi r23, 0xC2 ; 194 20880: 0e 94 c3 72 call 0xe586 ; 0xe586 #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 20884: 8c e0 ldi r24, 0x0C ; 12 20886: 97 e5 ldi r25, 0x57 ; 87 20888: 0e 94 0a 75 call 0xea14 ; 0xea14 2088c: 62 ee ldi r22, 0xE2 ; 226 2088e: 76 e3 ldi r23, 0x36 ; 54 20890: 0e 94 c3 72 call 0xe586 ; 0xe586 #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); #endif //MENU_DUMP #ifdef MENU_SERIAL_DUMP if (emergency_serial_dump) 20894: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 20898: 88 23 and r24, r24 2089a: 31 f0 breq .+12 ; 0x208a8 MENU_ITEM_FUNCTION_P(_n("Dump to serial"), lcd_serial_dump); 2089c: 6a e5 ldi r22, 0x5A ; 90 2089e: 77 e3 ldi r23, 0x37 ; 55 208a0: 8a ed ldi r24, 0xDA ; 218 208a2: 9a e6 ldi r25, 0x6A ; 106 208a4: 0e 94 6d 72 call 0xe4da ; 0xe4da 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(); 208a8: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 208ac: 80 91 60 04 lds r24, 0x0460 ; 0x800460 208b0: 8f 5f subi r24, 0xFF ; 255 208b2: 80 93 60 04 sts 0x0460, r24 ; 0x800460 208b6: 80 91 62 04 lds r24, 0x0462 ; 0x800462 208ba: 8f 5f subi r24, 0xFF ; 255 208bc: 80 93 62 04 sts 0x0462, r24 ; 0x800462 208c0: a5 ce rjmp .-694 ; 0x2060c _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) 208c2: 90 91 97 03 lds r25, 0x0397 ; 0x800397 208c6: 99 23 and r25, r25 208c8: 09 f4 brne .+2 ; 0x208cc 208ca: 94 ce rjmp .-728 ; 0x205f4 208cc: 40 91 98 03 lds r20, 0x0398 ; 0x800398 208d0: 50 91 99 03 lds r21, 0x0399 ; 0x800399 208d4: 60 91 9a 03 lds r22, 0x039A ; 0x80039a 208d8: 70 91 9b 03 lds r23, 0x039B ; 0x80039b 208dc: 45 2b or r20, r21 208de: 46 2b or r20, r22 208e0: 47 2b or r20, r23 208e2: 09 f0 breq .+2 ; 0x208e6 208e4: 87 ce rjmp .-754 ; 0x205f4 208e6: 8f 5f subi r24, 0xFF ; 255 208e8: 80 31 cpi r24, 0x10 ; 16 208ea: 19 f0 breq .+6 ; 0x208f2 208ec: 80 93 96 03 sts 0x0396, r24 ; 0x800396 208f0: 81 ce rjmp .-766 ; 0x205f4 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 208f2: 10 92 96 03 sts 0x0396, r1 ; 0x800396 208f6: 7e ce rjmp .-772 ; 0x205f4 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)); 208f8: 8f e5 ldi r24, 0x5F ; 95 208fa: 97 e5 ldi r25, 0x57 ; 87 208fc: 0e 94 0a 75 call 0xea14 ; 0xea14 20900: 0e 94 ed 6e call 0xddda ; 0xddda 20904: 0f cf rjmp .-482 ; 0x20724 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 20906: 82 e4 ldi r24, 0x42 ; 66 20908: 98 e9 ldi r25, 0x98 ; 152 2090a: 0e 94 9e 72 call 0xe53c ; 0xe53c 2090e: 0a cf rjmp .-492 ; 0x20724 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 20910: df 91 pop r29 20912: cf 91 pop r28 20914: 1f 91 pop r17 20916: 0f 91 pop r16 20918: ff 90 pop r15 2091a: ef 90 pop r14 2091c: 08 95 ret 0002091e : //! |Total failures | MSG_TOTAL_FAILURES c=20 //! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { 2091e: bf 92 push r11 20920: cf 92 push r12 20922: df 92 push r13 20924: ef 92 push r14 20926: ff 92 push r15 20928: 0f 93 push r16 2092a: 1f 93 push r17 2092c: cf 93 push r28 2092e: df 93 push r29 20930: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 20934: 85 e6 ldi r24, 0x65 ; 101 20936: 9f e0 ldi r25, 0x0F ; 15 20938: 0f 94 9d a3 call 0x3473a ; 0x3473a 2093c: 18 2f mov r17, r24 uint16_t filamentTotal = clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ); 2093e: 81 e0 ldi r24, 0x01 ; 1 20940: 9f e0 ldi r25, 0x0F ; 15 20942: 0f 94 ab a3 call 0x34756 ; 0x34756 20946: 0e 94 e8 fc call 0x1f9d0 ; 0x1f9d0 2094a: c8 2e mov r12, r24 2094c: b9 2e mov r11, r25 lcd_home(); 2094e: 0e 94 ef 6f call 0xdfde ; 0xdfde lcd_printf_P(failStatsFmt, 20952: 8d ef ldi r24, 0xFD ; 253 20954: 96 e5 ldi r25, 0x56 ; 86 20956: 0e 94 0a 75 call 0xea14 ; 0xea14 2095a: e8 2e mov r14, r24 2095c: d9 2e mov r13, r25 2095e: 8c ee ldi r24, 0xEC ; 236 20960: 96 e5 ldi r25, 0x56 ; 86 20962: 0e 94 0a 75 call 0xea14 ; 0xea14 20966: 08 2f mov r16, r24 20968: f9 2e mov r15, r25 2096a: 8d ef ldi r24, 0xFD ; 253 2096c: 96 e5 ldi r25, 0x56 ; 86 2096e: 0e 94 0a 75 call 0xea14 ; 0xea14 20972: ec 01 movw r28, r24 20974: 86 ed ldi r24, 0xD6 ; 214 20976: 96 e5 ldi r25, 0x56 ; 86 20978: 0e 94 0a 75 call 0xea14 ; 0xea14 2097c: bf 92 push r11 2097e: cf 92 push r12 20980: df 92 push r13 20982: ef 92 push r14 20984: ff 92 push r15 20986: 0f 93 push r16 20988: 1f 92 push r1 2098a: 1f 93 push r17 2098c: df 93 push r29 2098e: cf 93 push r28 20990: 9f 93 push r25 20992: 8f 93 push r24 20994: 83 ef ldi r24, 0xF3 ; 243 20996: 97 e9 ldi r25, 0x97 ; 151 20998: 9f 93 push r25 2099a: 8f 93 push r24 2099c: 0e 94 db 6e call 0xddb6 ; 0xddb6 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 209a0: 8d b7 in r24, 0x3d ; 61 209a2: 9e b7 in r25, 0x3e ; 62 209a4: 0e 96 adiw r24, 0x0e ; 14 209a6: 0f b6 in r0, 0x3f ; 63 209a8: f8 94 cli 209aa: 9e bf out 0x3e, r25 ; 62 209ac: 0f be out 0x3f, r0 ; 63 209ae: 8d bf out 0x3d, r24 ; 61 } 209b0: df 91 pop r29 209b2: cf 91 pop r28 209b4: 1f 91 pop r17 209b6: 0f 91 pop r16 209b8: ff 90 pop r15 209ba: ef 90 pop r14 209bc: df 90 pop r13 209be: cf 90 pop r12 209c0: bf 90 pop r11 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 209c2: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 000209c6 : //! | 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() { 209c6: 8f 92 push r8 209c8: 9f 92 push r9 209ca: af 92 push r10 209cc: bf 92 push r11 209ce: cf 92 push r12 209d0: df 92 push r13 209d2: ef 92 push r14 209d4: ff 92 push r15 209d6: 0f 93 push r16 209d8: 1f 93 push r17 209da: cf 93 push r28 209dc: df 93 push r29 209de: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 209e2: 0e 94 ef 6f call 0xdfde ; 0xdfde lcd_printf_P( 209e6: 80 91 07 13 lds r24, 0x1307 ; 0x801307 209ea: 90 91 08 13 lds r25, 0x1308 ; 0x801308 209ee: 0e 94 e8 fc call 0x1f9d0 ; 0x1f9d0 209f2: 98 2e mov r9, r24 209f4: 89 2e mov r8, r25 209f6: 81 eb ldi r24, 0xB1 ; 177 209f8: 96 e5 ldi r25, 0x56 ; 86 209fa: 0e 94 0a 75 call 0xea14 ; 0xea14 209fe: b8 2e mov r11, r24 20a00: a9 2e mov r10, r25 20a02: 80 ed ldi r24, 0xD0 ; 208 20a04: 9e e0 ldi r25, 0x0E ; 14 20a06: 0f 94 ab a3 call 0x34756 ; 0x34756 20a0a: 0e 94 e8 fc call 0x1f9d0 ; 0x1f9d0 20a0e: d8 2e mov r13, r24 20a10: c9 2e mov r12, r25 20a12: 80 ea ldi r24, 0xA0 ; 160 20a14: 96 e5 ldi r25, 0x56 ; 86 20a16: 0e 94 0a 75 call 0xea14 ; 0xea14 20a1a: f8 2e mov r15, r24 20a1c: e9 2e mov r14, r25 20a1e: 83 ed ldi r24, 0xD3 ; 211 20a20: 9e e0 ldi r25, 0x0E ; 14 20a22: 0f 94 ab a3 call 0x34756 ; 0x34756 20a26: 0e 94 e8 fc call 0x1f9d0 ; 0x1f9d0 20a2a: 18 2f mov r17, r24 20a2c: 09 2f mov r16, r25 20a2e: 84 e9 ldi r24, 0x94 ; 148 20a30: 96 e5 ldi r25, 0x56 ; 86 20a32: 0e 94 0a 75 call 0xea14 ; 0xea14 20a36: ec 01 movw r28, r24 20a38: 8c ee ldi r24, 0xEC ; 236 20a3a: 96 e5 ldi r25, 0x56 ; 86 20a3c: 0e 94 0a 75 call 0xea14 ; 0xea14 20a40: 8f 92 push r8 20a42: 9f 92 push r9 20a44: af 92 push r10 20a46: bf 92 push r11 20a48: cf 92 push r12 20a4a: df 92 push r13 20a4c: ef 92 push r14 20a4e: ff 92 push r15 20a50: 0f 93 push r16 20a52: 1f 93 push r17 20a54: df 93 push r29 20a56: cf 93 push r28 20a58: 9f 93 push r25 20a5a: 8f 93 push r24 20a5c: 86 ec ldi r24, 0xC6 ; 198 20a5e: 97 e9 ldi r25, 0x97 ; 151 20a60: 9f 93 push r25 20a62: 8f 93 push r24 20a64: 0e 94 db 6e call 0xddb6 ; 0xddb6 ), _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(); 20a68: 8d b7 in r24, 0x3d ; 61 20a6a: 9e b7 in r25, 0x3e ; 62 20a6c: 40 96 adiw r24, 0x10 ; 16 20a6e: 0f b6 in r0, 0x3f ; 63 20a70: f8 94 cli 20a72: 9e bf out 0x3e, r25 ; 62 20a74: 0f be out 0x3f, r0 ; 63 20a76: 8d bf out 0x3d, r24 ; 61 } 20a78: df 91 pop r29 20a7a: cf 91 pop r28 20a7c: 1f 91 pop r17 20a7e: 0f 91 pop r16 20a80: ff 90 pop r15 20a82: ef 90 pop r14 20a84: df 90 pop r13 20a86: cf 90 pop r12 20a88: bf 90 pop r11 20a8a: af 90 pop r10 20a8c: 9f 90 pop r9 20a8e: 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(); 20a90: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 00020a94 : { 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) { 20a94: 80 91 96 03 lds r24, 0x0396 ; 0x800396 20a98: 81 11 cpse r24, r1 20a9a: 19 c0 rjmp .+50 ; 0x20ace lcd_clear(); 20a9c: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 20aa0: 83 ec ldi r24, 0xC3 ; 195 20aa2: 96 e5 ldi r25, 0x56 ; 86 20aa4: 0e 94 0a 75 call 0xea14 ; 0xea14 20aa8: 0e 94 ed 6e call 0xddda ; 0xddda lcd_putc(':'); 20aac: 8a e3 ldi r24, 0x3A ; 58 20aae: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_set_cursor(10, 1); 20ab2: 61 e0 ldi r22, 0x01 ; 1 20ab4: 8a e0 ldi r24, 0x0A ; 10 20ab6: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 20aba: 88 ea ldi r24, 0xA8 ; 168 20abc: 9c e0 ldi r25, 0x0C ; 12 20abe: 0f 94 a5 a3 call 0x3474a ; 0x3474a else lcd_printNumber(n, base); 20ac2: 4a e0 ldi r20, 0x0A ; 10 20ac4: 0e 94 46 71 call 0xe28c ; 0xe28c _md->initialized = true; 20ac8: 81 e0 ldi r24, 0x01 ; 1 20aca: 80 93 96 03 sts 0x0396, r24 ; 0x800396 } menu_back_if_clicked(); 20ace: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac 00020ad2 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 20ad2: 8b ec ldi r24, 0xCB ; 203 20ad4: 9a e6 ldi r25, 0x6A ; 106 20ad6: 0c 94 8d 7c jmp 0xf91a ; 0xf91a 00020ada : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 20ada: 0e 94 6f 70 call 0xe0de ; 0xe0de lcd_status_message_idx = 0; // Re-draw message from beginning 20ade: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.420> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 20ae2: 20 e0 ldi r18, 0x00 ; 0 20ae4: 41 e0 ldi r20, 0x01 ; 1 20ae6: 70 e0 ldi r23, 0x00 ; 0 20ae8: 60 e0 ldi r22, 0x00 ; 0 20aea: 86 ed ldi r24, 0xD6 ; 214 20aec: 97 e3 ldi r25, 0x37 ; 55 20aee: 0e 94 87 62 call 0xc50e ; 0xc50e menu_depth = 0; 20af2: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 20af6: 10 92 94 03 sts 0x0394, r1 ; 0x800394 } 20afa: 08 95 ret 00020afc : // 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); 20afc: 81 e0 ldi r24, 0x01 ; 1 20afe: 0e 94 f8 6e call 0xddf0 ; 0xddf0 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 20b02: 0f 94 7f 65 call 0x2cafe ; 0x2cafe 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; 20b06: 90 91 e9 12 lds r25, 0x12E9 ; 0x8012e9 20b0a: 93 36 cpi r25, 0x63 ; 99 20b0c: 09 f4 brne .+2 ; 0x20b10 20b0e: 9f ef ldi r25, 0xFF ; 255 20b10: 89 13 cpse r24, r25 20b12: 0e c0 rjmp .+28 ; 0x20b30 lcd_putc('F'); 20b14: 86 e4 ldi r24, 0x46 ; 70 20b16: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 20b1a: 0f 94 7f 65 call 0x2cafe ; 0x2cafe 20b1e: 8f 3f cpi r24, 0xFF ; 255 20b20: 29 f0 breq .+10 ; 0x20b2c 20b22: 8f 5c subi r24, 0xCF ; 207 20b24: 0e 94 f1 6e call 0xdde2 ; 0xdde2 20b28: 83 e0 ldi r24, 0x03 ; 3 20b2a: 08 95 ret 20b2c: 8f e3 ldi r24, 0x3F ; 63 20b2e: fa cf rjmp .-12 ; 0x20b24 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 20b30: 8f 3f cpi r24, 0xFF ; 255 20b32: 89 f0 breq .+34 ; 0x20b56 20b34: 8f 5c subi r24, 0xCF ; 207 20b36: 0e 94 f1 6e call 0xdde2 ; 0xdde2 lcd_putc('>'); 20b3a: 8e e3 ldi r24, 0x3E ; 62 20b3c: 0e 94 f1 6e call 0xdde2 ; 0xdde2 20b40: 80 91 e9 12 lds r24, 0x12E9 ; 0x8012e9 20b44: 83 36 cpi r24, 0x63 ; 99 20b46: 49 f0 breq .+18 ; 0x20b5a lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 20b48: 8f 3f cpi r24, 0xFF ; 255 20b4a: 39 f0 breq .+14 ; 0x20b5a 20b4c: 8f 5c subi r24, 0xCF ; 207 20b4e: 0e 94 f1 6e call 0xdde2 ; 0xdde2 chars += 3; 20b52: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 20b54: 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'); 20b56: 8f e3 ldi r24, 0x3F ; 63 20b58: ee cf rjmp .-36 ; 0x20b36 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 20b5a: 8f e3 ldi r24, 0x3F ; 63 20b5c: f8 cf rjmp .-16 ; 0x20b4e 00020b5e : } 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){ 20b5e: 0f 93 push r16 20b60: 1f 93 push r17 20b62: cf 93 push r28 20b64: df 93 push r29 20b66: ec 01 movw r28, r24 20b68: cb 01 movw r24, r22 20b6a: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 20b6c: 4a 81 ldd r20, Y+2 ; 0x02 20b6e: 41 30 cpi r20, 0x01 ; 1 20b70: 29 f0 breq .+10 ; 0x20b7c 20b72: 88 f0 brcs .+34 ; 0x20b96 20b74: 42 30 cpi r20, 0x02 ; 2 20b76: 09 f1 breq .+66 ; 0x20bba 20b78: 43 30 cpi r20, 0x03 ; 3 20b7a: d1 f4 brne .+52 ; 0x20bb0 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 ){ 20b7c: 8b 81 ldd r24, Y+3 ; 0x03 20b7e: 81 11 cpse r24, r1 20b80: 25 c0 rjmp .+74 ; 0x20bcc state = next_state; // advance to the next state 20b82: 82 e0 ldi r24, 0x02 ; 2 20b84: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 20b86: 63 e0 ldi r22, 0x03 ; 3 20b88: 84 e4 ldi r24, 0x44 ; 68 20b8a: 97 e9 ldi r25, 0x97 ; 151 20b8c: 0e 94 1d d8 call 0x1b03a ; 0x1b03a repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 20b90: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 20b92: 8b 83 std Y+3, r24 ; 0x03 20b94: 0d c0 rjmp .+26 ; 0x20bb0 //! @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 ){ 20b96: a9 01 movw r20, r18 20b98: 98 01 movw r18, r16 20b9a: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 20b9e: 18 16 cp r1, r24 20ba0: 3c f4 brge .+14 ; 0x20bb0 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 20ba2: 63 e0 ldi r22, 0x03 ; 3 20ba4: 88 81 ld r24, Y 20ba6: 99 81 ldd r25, Y+1 ; 0x01 20ba8: 0e 94 1d d8 call 0x1b03a ; 0x1b03a state = States::TempAboveMintemp; 20bac: 81 e0 ldi r24, 0x01 ; 1 20bae: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 20bb0: df 91 pop r29 20bb2: cf 91 pop r28 20bb4: 1f 91 pop r17 20bb6: 0f 91 pop r16 20bb8: 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 ){ 20bba: 8b 81 ldd r24, Y+3 ; 0x03 20bbc: 81 11 cpse r24, r1 20bbe: 06 c0 rjmp .+12 ; 0x20bcc 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); 20bc0: 88 81 ld r24, Y 20bc2: 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 20bc4: 23 e0 ldi r18, 0x03 ; 3 20bc6: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 20bc8: 63 e0 ldi r22, 0x03 ; 3 20bca: e0 cf rjmp .-64 ; 0x20b8c repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 20bcc: 81 50 subi r24, 0x01 ; 1 20bce: e1 cf rjmp .-62 ; 0x20b92 00020bd0 : SERIAL_ECHO(_status); SERIAL_ECHO(']'); } static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); 20bd0: 82 e2 ldi r24, 0x22 ; 34 20bd2: 99 e8 ldi r25, 0x89 ; 137 20bd4: 0c 94 94 7a jmp 0xf528 ; 0xf528 00020bd8 : static void Sound_DoSound_Prompt(void) { backlight_wake(2); WRITE(BEEPER,HIGH); 20bd8: 72 9a sbi 0x0e, 2 ; 14 20bda: 2f ef ldi r18, 0xFF ; 255 20bdc: 89 e6 ldi r24, 0x69 ; 105 20bde: 98 e1 ldi r25, 0x18 ; 24 20be0: 21 50 subi r18, 0x01 ; 1 20be2: 80 40 sbci r24, 0x00 ; 0 20be4: 90 40 sbci r25, 0x00 ; 0 20be6: e1 f7 brne .-8 ; 0x20be0 20be8: 00 c0 rjmp .+0 ; 0x20bea 20bea: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 20bec: 72 98 cbi 0x0e, 2 ; 14 } 20bee: 08 95 ret 00020bf0 : SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); SERIAL_ECHO(']'); } static void prusa_stat_temperatures() { SERIAL_ECHOPGM("[ST0:"); 20bf0: 85 e4 ldi r24, 0x45 ; 69 20bf2: 99 e8 ldi r25, 0x89 ; 137 20bf4: 0e 94 94 7a call 0xf528 ; 0xf528 20bf8: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 20bfc: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 20c00: 07 2e mov r0, r23 20c02: 00 0c add r0, r0 20c04: 88 0b sbc r24, r24 20c06: 99 0b sbc r25, r25 20c08: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_ECHO(target_temperature[0]); SERIAL_ECHOPGM("][STB:"); 20c0c: 8e e3 ldi r24, 0x3E ; 62 20c0e: 99 e8 ldi r25, 0x89 ; 137 20c10: 0e 94 94 7a call 0xf528 ; 0xf528 20c14: 60 91 59 12 lds r22, 0x1259 ; 0x801259 20c18: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 20c1c: 07 2e mov r0, r23 20c1e: 00 0c add r0, r0 20c20: 88 0b sbc r24, r24 20c22: 99 0b sbc r25, r25 20c24: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_ECHO(target_temperature_bed); SERIAL_ECHOPGM("][AT0:"); 20c28: 87 e3 ldi r24, 0x37 ; 55 20c2a: 99 e8 ldi r25, 0x89 ; 137 20c2c: 0e 94 94 7a call 0xf528 ; 0xf528 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 20c30: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 20c34: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 20c38: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 20c3c: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 20c40: 42 e0 ldi r20, 0x02 ; 2 20c42: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_ECHO(current_temperature[0]); SERIAL_ECHOPGM("][ATB:"); 20c46: 80 e3 ldi r24, 0x30 ; 48 20c48: 99 e8 ldi r25, 0x89 ; 137 20c4a: 0e 94 94 7a call 0xf528 ; 0xf528 20c4e: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 20c52: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 20c56: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 20c5a: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 20c5e: 42 e0 ldi r20, 0x02 ; 2 20c60: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20c64: 8d e5 ldi r24, 0x5D ; 93 20c66: 0c 94 81 79 jmp 0xf302 ; 0xf302 00020c6a : prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } static void prusa_stat_printerstatus(uint8_t _status) { 20c6a: cf 93 push r28 20c6c: c8 2f mov r28, r24 SERIAL_ECHOPGM("[PRN:"); 20c6e: 8c e1 ldi r24, 0x1C ; 28 20c70: 99 e8 ldi r25, 0x89 ; 137 20c72: 0e 94 94 7a call 0xf528 ; 0xf528 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 20c76: 8c 2f mov r24, r28 20c78: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20c7c: 8d e5 ldi r24, 0x5D ; 93 SERIAL_ECHO(_status); SERIAL_ECHO(']'); } 20c7e: cf 91 pop r28 20c80: 0c 94 81 79 jmp 0xf302 ; 0xf302 00020c84 : #ifdef PRUSA_M28 static void trace(); #endif static void prusa_statistics_err(char c) { 20c84: cf 93 push r28 20c86: c8 2f mov r28, r24 SERIAL_ECHOPGM("{[ERR:"); 20c88: 85 ee ldi r24, 0xE5 ; 229 20c8a: 98 e8 ldi r25, 0x88 ; 136 20c8c: 0e 94 94 7a call 0xf528 ; 0xf528 20c90: 8c 2f mov r24, r28 20c92: 0e 94 81 79 call 0xf302 ; 0xf302 20c96: 8d e5 ldi r24, 0x5D ; 93 20c98: 0e 94 81 79 call 0xf302 ; 0xf302 SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } 20c9c: cf 91 pop r28 static void prusa_statistics_err(char c) { SERIAL_ECHOPGM("{[ERR:"); SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); 20c9e: 0d 94 e8 05 jmp 0x20bd0 ; 0x20bd0 00020ca2 : static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); } static void prusa_stat_diameter() { SERIAL_ECHOPGM("[DIA:"); 20ca2: 8a e2 ldi r24, 0x2A ; 42 20ca4: 99 e8 ldi r25, 0x89 ; 137 20ca6: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); 20caa: 85 ea ldi r24, 0xA5 ; 165 20cac: 9d e0 ldi r25, 0x0D ; 13 20cae: 0f 94 ab a3 call 0x34756 ; 0x34756 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 20cb2: bc 01 movw r22, r24 20cb4: 90 e0 ldi r25, 0x00 ; 0 20cb6: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 20cb8: 4a e0 ldi r20, 0x0A ; 10 20cba: 0e 94 95 79 call 0xf32a ; 0xf32a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20cbe: 8d e5 ldi r24, 0x5D ; 93 20cc0: 0c 94 81 79 jmp 0xf302 ; 0xf302 00020cc4 : // 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) { 20cc4: 2f 92 push r2 20cc6: 3f 92 push r3 20cc8: 4f 92 push r4 20cca: 5f 92 push r5 20ccc: 6f 92 push r6 20cce: 7f 92 push r7 20cd0: 8f 92 push r8 20cd2: 9f 92 push r9 20cd4: af 92 push r10 20cd6: bf 92 push r11 20cd8: cf 92 push r12 20cda: df 92 push r13 20cdc: ef 92 push r14 20cde: ff 92 push r15 20ce0: 0f 93 push r16 20ce2: 1f 93 push r17 20ce4: cf 93 push r28 20ce6: df 93 push r29 20ce8: cd b7 in r28, 0x3d ; 61 20cea: de b7 in r29, 0x3e ; 62 20cec: a1 97 sbiw r28, 0x21 ; 33 20cee: 0f b6 in r0, 0x3f ; 63 20cf0: f8 94 cli 20cf2: de bf out 0x3e, r29 ; 62 20cf4: 0f be out 0x3f, r0 ; 63 20cf6: cd bf out 0x3d, r28 ; 61 20cf8: 1c 01 movw r2, r24 20cfa: 48 01 movw r8, r16 20cfc: 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) 20cfe: fc 01 movw r30, r24 20d00: e8 5b subi r30, 0xB8 ; 184 20d02: ff 4f sbci r31, 0xFF ; 255 20d04: c0 80 ld r12, Z 20d06: d1 80 ldd r13, Z+1 ; 0x01 20d08: e2 80 ldd r14, Z+2 ; 0x02 20d0a: f3 80 ldd r15, Z+3 ; 0x03 20d0c: 9a 01 movw r18, r20 20d0e: ab 01 movw r20, r22 20d10: c7 01 movw r24, r14 20d12: b6 01 movw r22, r12 20d14: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 20d18: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 20d1c: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 20d20: 8b 01 movw r16, r22 20d22: 8d 83 std Y+5, r24 ; 0x05 20d24: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 20d26: a5 01 movw r20, r10 20d28: 94 01 movw r18, r8 20d2a: c7 01 movw r24, r14 20d2c: b6 01 movw r22, r12 20d2e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 20d32: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 20d36: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 20d3a: 36 2f mov r19, r22 20d3c: 27 2f mov r18, r23 20d3e: a8 01 movw r20, r16 20d40: 6d 81 ldd r22, Y+5 ; 0x05 20d42: 79 81 ldd r23, Y+1 ; 0x01 20d44: 48 37 cpi r20, 0x78 ; 120 20d46: 51 05 cpc r21, r1 20d48: 61 05 cpc r22, r1 20d4a: 71 05 cpc r23, r1 20d4c: 20 f4 brcc .+8 ; 0x20d56 20d4e: 48 e7 ldi r20, 0x78 ; 120 20d50: 50 e0 ldi r21, 0x00 ; 0 20d52: 60 e0 ldi r22, 0x00 ; 0 20d54: 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) 20d56: d1 01 movw r26, r2 20d58: d6 96 adiw r26, 0x36 ; 54 20d5a: 8d 90 ld r8, X+ 20d5c: 9d 90 ld r9, X+ 20d5e: ad 90 ld r10, X+ 20d60: bc 90 ld r11, X 20d62: d9 97 sbiw r26, 0x39 ; 57 20d64: 8f 8a std Y+23, r8 ; 0x17 20d66: 98 8e std Y+24, r9 ; 0x18 20d68: a9 8e std Y+25, r10 ; 0x19 20d6a: ba 8e std Y+26, r11 ; 0x1a 20d6c: 48 15 cp r20, r8 20d6e: 59 05 cpc r21, r9 20d70: 6a 05 cpc r22, r10 20d72: 7b 05 cpc r23, r11 20d74: 20 f4 brcc .+8 ; 0x20d7e 20d76: 4f 8b std Y+23, r20 ; 0x17 20d78: 58 8f std Y+24, r21 ; 0x18 20d7a: 69 8f std Y+25, r22 ; 0x19 20d7c: 7a 8f std Y+26, r23 ; 0x1a 20d7e: 43 2f mov r20, r19 20d80: 52 2f mov r21, r18 20d82: bc 01 movw r22, r24 20d84: 48 37 cpi r20, 0x78 ; 120 20d86: 51 05 cpc r21, r1 20d88: 61 05 cpc r22, r1 20d8a: 71 05 cpc r23, r1 20d8c: 20 f4 brcc .+8 ; 0x20d96 20d8e: 48 e7 ldi r20, 0x78 ; 120 20d90: 50 e0 ldi r21, 0x00 ; 0 20d92: 60 e0 ldi r22, 0x00 ; 0 20d94: 70 e0 ldi r23, 0x00 ; 0 20d96: 18 2d mov r17, r8 20d98: 09 2d mov r16, r9 20d9a: a9 a2 std Y+33, r10 ; 0x21 20d9c: b8 a2 std Y+32, r11 ; 0x20 20d9e: 48 15 cp r20, r8 20da0: 59 05 cpc r21, r9 20da2: 6a 05 cpc r22, r10 20da4: 7b 05 cpc r23, r11 20da6: 20 f4 brcc .+8 ; 0x20db0 20da8: 14 2f mov r17, r20 20daa: 05 2f mov r16, r21 20dac: 69 a3 std Y+33, r22 ; 0x21 20dae: 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; 20db0: f1 01 movw r30, r2 20db2: ee 5b subi r30, 0xBE ; 190 20db4: ff 4f sbci r31, 0xFF ; 255 20db6: c0 80 ld r12, Z 20db8: d1 80 ldd r13, Z+1 ; 0x01 20dba: e2 80 ldd r14, Z+2 ; 0x02 20dbc: f3 80 ldd r15, Z+3 ; 0x03 20dbe: cd 82 std Y+5, r12 ; 0x05 20dc0: de 82 std Y+6, r13 ; 0x06 20dc2: ef 82 std Y+7, r14 ; 0x07 20dc4: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 20dc6: cd 28 or r12, r13 20dc8: ce 28 or r12, r14 20dca: cf 28 or r12, r15 20dcc: 41 f4 brne .+16 ; 0x20dde // Don't allow zero acceleration. acceleration = 1; 20dce: c1 2c mov r12, r1 20dd0: d1 2c mov r13, r1 20dd2: 76 01 movw r14, r12 20dd4: c3 94 inc r12 20dd6: cd 82 std Y+5, r12 ; 0x05 20dd8: de 82 std Y+6, r13 ; 0x06 20dda: ef 82 std Y+7, r14 ; 0x07 20ddc: 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; 20dde: 2f 89 ldd r18, Y+23 ; 0x17 20de0: 38 8d ldd r19, Y+24 ; 0x18 20de2: 49 8d ldd r20, Y+25 ; 0x19 20de4: 5a 8d ldd r21, Y+26 ; 0x1a 20de6: b9 01 movw r22, r18 20de8: ca 01 movw r24, r20 20dea: 0f 94 00 a4 call 0x34800 ; 0x34800 <__mulsi3> 20dee: 6d 87 std Y+13, r22 ; 0x0d 20df0: 7e 87 std Y+14, r23 ; 0x0e 20df2: 8f 87 std Y+15, r24 ; 0x0f 20df4: 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; 20df6: a5 01 movw r20, r10 20df8: 94 01 movw r18, r8 20dfa: c5 01 movw r24, r10 20dfc: b4 01 movw r22, r8 20dfe: 0f 94 00 a4 call 0x34800 ; 0x34800 <__mulsi3> 20e02: 2b 01 movw r4, r22 20e04: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 20e06: 21 2f mov r18, r17 20e08: 30 2f mov r19, r16 20e0a: 49 a1 ldd r20, Y+33 ; 0x21 20e0c: 58 a1 ldd r21, Y+32 ; 0x20 20e0e: 61 2f mov r22, r17 20e10: 70 2f mov r23, r16 20e12: ca 01 movw r24, r20 20e14: 0f 94 00 a4 call 0x34800 ; 0x34800 <__mulsi3> 20e18: 69 8b std Y+17, r22 ; 0x11 20e1a: 7a 8b std Y+18, r23 ; 0x12 20e1c: 8b 8b std Y+19, r24 ; 0x13 20e1e: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 20e20: cd 80 ldd r12, Y+5 ; 0x05 20e22: de 80 ldd r13, Y+6 ; 0x06 20e24: ef 80 ldd r14, Y+7 ; 0x07 20e26: f8 84 ldd r15, Y+8 ; 0x08 20e28: cc 0c add r12, r12 20e2a: dd 1c adc r13, r13 20e2c: ee 1c adc r14, r14 20e2e: ff 1c adc r15, r15 20e30: c9 86 std Y+9, r12 ; 0x09 20e32: da 86 std Y+10, r13 ; 0x0a 20e34: eb 86 std Y+11, r14 ; 0x0b 20e36: 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; 20e38: c3 01 movw r24, r6 20e3a: b2 01 movw r22, r4 20e3c: 61 50 subi r22, 0x01 ; 1 20e3e: 71 09 sbc r23, r1 20e40: 81 09 sbc r24, r1 20e42: 91 09 sbc r25, r1 20e44: cd 84 ldd r12, Y+13 ; 0x0d 20e46: de 84 ldd r13, Y+14 ; 0x0e 20e48: ef 84 ldd r14, Y+15 ; 0x0f 20e4a: f8 88 ldd r15, Y+16 ; 0x10 20e4c: 6c 19 sub r22, r12 20e4e: 7d 09 sbc r23, r13 20e50: 8e 09 sbc r24, r14 20e52: 9f 09 sbc r25, r15 20e54: c9 84 ldd r12, Y+9 ; 0x09 20e56: da 84 ldd r13, Y+10 ; 0x0a 20e58: eb 84 ldd r14, Y+11 ; 0x0b 20e5a: fc 84 ldd r15, Y+12 ; 0x0c 20e5c: 6c 0d add r22, r12 20e5e: 7d 1d adc r23, r13 20e60: 8e 1d adc r24, r14 20e62: 9f 1d adc r25, r15 20e64: a7 01 movw r20, r14 20e66: 96 01 movw r18, r12 20e68: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 20e6c: 69 01 movw r12, r18 20e6e: 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; 20e70: c3 01 movw r24, r6 20e72: b2 01 movw r22, r4 20e74: 29 89 ldd r18, Y+17 ; 0x11 20e76: 3a 89 ldd r19, Y+18 ; 0x12 20e78: 4b 89 ldd r20, Y+19 ; 0x13 20e7a: 5c 89 ldd r21, Y+20 ; 0x14 20e7c: 62 1b sub r22, r18 20e7e: 73 0b sbc r23, r19 20e80: 84 0b sbc r24, r20 20e82: 95 0b sbc r25, r21 20e84: 29 85 ldd r18, Y+9 ; 0x09 20e86: 3a 85 ldd r19, Y+10 ; 0x0a 20e88: 4b 85 ldd r20, Y+11 ; 0x0b 20e8a: 5c 85 ldd r21, Y+12 ; 0x0c 20e8c: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 20e90: 29 01 movw r4, r18 20e92: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 20e94: d7 01 movw r26, r14 20e96: c6 01 movw r24, r12 20e98: 84 0d add r24, r4 20e9a: 95 1d adc r25, r5 20e9c: a6 1d adc r26, r6 20e9e: b7 1d adc r27, r7 20ea0: 8c 8f std Y+28, r24 ; 0x1c 20ea2: 9d 8f std Y+29, r25 ; 0x1d 20ea4: ae 8f std Y+30, r26 ; 0x1e 20ea6: 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) { 20ea8: f1 01 movw r30, r2 20eaa: e4 5b subi r30, 0xB4 ; 180 20eac: ff 4f sbci r31, 0xFF ; 255 20eae: 90 81 ld r25, Z 20eb0: 9b 8f std Y+27, r25 ; 0x1b 20eb2: 99 23 and r25, r25 20eb4: 09 f4 brne .+2 ; 0x20eb8 20eb6: 8d c0 rjmp .+282 ; 0x20fd2 final_adv_steps = final_rate * block->adv_comp; 20eb8: 61 2f mov r22, r17 20eba: 70 2f mov r23, r16 20ebc: 89 a1 ldd r24, Y+33 ; 0x21 20ebe: 98 a1 ldd r25, Y+32 ; 0x20 20ec0: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 20ec4: f1 01 movw r30, r2 20ec6: ec 5a subi r30, 0xAC ; 172 20ec8: ff 4f sbci r31, 0xFF ; 255 20eca: 20 81 ld r18, Z 20ecc: 31 81 ldd r19, Z+1 ; 0x01 20ece: 42 81 ldd r20, Z+2 ; 0x02 20ed0: 53 81 ldd r21, Z+3 ; 0x03 20ed2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 20ed6: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 20eda: 6d 8b std Y+21, r22 ; 0x15 20edc: 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) { 20ede: d1 01 movw r26, r2 20ee0: 50 96 adiw r26, 0x10 ; 16 20ee2: 2d 91 ld r18, X+ 20ee4: 3d 91 ld r19, X+ 20ee6: 4d 91 ld r20, X+ 20ee8: 5c 91 ld r21, X 20eea: 53 97 sbiw r26, 0x13 ; 19 20eec: 29 83 std Y+1, r18 ; 0x01 20eee: 3a 83 std Y+2, r19 ; 0x02 20ef0: 4b 83 std Y+3, r20 ; 0x03 20ef2: 5c 83 std Y+4, r21 ; 0x04 20ef4: 8c 8d ldd r24, Y+28 ; 0x1c 20ef6: 9d 8d ldd r25, Y+29 ; 0x1d 20ef8: ae 8d ldd r26, Y+30 ; 0x1e 20efa: bf 8d ldd r27, Y+31 ; 0x1f 20efc: 82 17 cp r24, r18 20efe: 93 07 cpc r25, r19 20f00: a4 07 cpc r26, r20 20f02: b5 07 cpc r27, r21 20f04: 08 f0 brcs .+2 ; 0x20f08 20f06: 68 c0 rjmp .+208 ; 0x20fd8 plateau_steps = block->step_event_count.wide - accel_decel_steps; 20f08: 29 01 movw r4, r18 20f0a: 3a 01 movw r6, r20 20f0c: 48 1a sub r4, r24 20f0e: 59 0a sbc r5, r25 20f10: 6a 0a sbc r6, r26 20f12: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 20f14: 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; 20f16: 40 e0 ldi r20, 0x00 ; 0 20f18: 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) 20f1a: 99 23 and r25, r25 20f1c: 89 f0 breq .+34 ; 0x20f40 max_adv_steps = block->nominal_rate * block->adv_comp; 20f1e: c5 01 movw r24, r10 20f20: b4 01 movw r22, r8 20f22: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 20f26: f1 01 movw r30, r2 20f28: ec 5a subi r30, 0xAC ; 172 20f2a: ff 4f sbci r31, 0xFF ; 255 20f2c: 20 81 ld r18, Z 20f2e: 31 81 ldd r19, Z+1 ; 0x01 20f30: 42 81 ldd r20, Z+2 ; 0x02 20f32: 53 81 ldd r21, Z+3 ; 0x03 20f34: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 20f38: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 20f3c: 46 2f mov r20, r22 20f3e: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 20f40: 3f b7 in r19, 0x3f ; 63 20f42: 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. 20f44: f1 01 movw r30, r2 20f46: e9 5b subi r30, 0xB9 ; 185 20f48: ff 4f sbci r31, 0xFF ; 255 20f4a: 20 81 ld r18, Z 20f4c: 21 11 cpse r18, r1 20f4e: 27 c0 rjmp .+78 ; 0x20f9e block->accelerate_until = accelerate_steps; 20f50: d1 01 movw r26, r2 20f52: 59 96 adiw r26, 0x19 ; 25 20f54: cd 92 st X+, r12 20f56: dd 92 st X+, r13 20f58: ed 92 st X+, r14 20f5a: fc 92 st X, r15 20f5c: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 20f5e: c4 0c add r12, r4 20f60: d5 1c adc r13, r5 20f62: e6 1c adc r14, r6 20f64: f7 1c adc r15, r7 20f66: f1 01 movw r30, r2 20f68: c5 8e std Z+29, r12 ; 0x1d 20f6a: d6 8e std Z+30, r13 ; 0x1e 20f6c: e7 8e std Z+31, r14 ; 0x1f 20f6e: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 20f70: cf 88 ldd r12, Y+23 ; 0x17 20f72: c2 ae std Z+58, r12 ; 0x3a 20f74: d8 8c ldd r13, Y+24 ; 0x18 20f76: d3 ae std Z+59, r13 ; 0x3b 20f78: e9 8c ldd r14, Y+25 ; 0x19 20f7a: e4 ae std Z+60, r14 ; 0x3c 20f7c: fa 8c ldd r15, Y+26 ; 0x1a 20f7e: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 20f80: fe 96 adiw r30, 0x3e ; 62 20f82: 10 83 st Z, r17 20f84: 01 83 std Z+1, r16 ; 0x01 20f86: c9 a0 ldd r12, Y+33 ; 0x21 20f88: c2 82 std Z+2, r12 ; 0x02 20f8a: d8 a0 ldd r13, Y+32 ; 0x20 20f8c: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 20f8e: 73 96 adiw r30, 0x13 ; 19 20f90: ed 88 ldd r14, Y+21 ; 0x15 20f92: e0 82 st Z, r14 20f94: fe 88 ldd r15, Y+22 ; 0x16 20f96: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 20f98: 32 97 sbiw r30, 0x02 ; 2 20f9a: 40 83 st Z, r20 20f9c: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 20f9e: 3f bf out 0x3f, r19 ; 63 } 20fa0: a1 96 adiw r28, 0x21 ; 33 20fa2: 0f b6 in r0, 0x3f ; 63 20fa4: f8 94 cli 20fa6: de bf out 0x3e, r29 ; 62 20fa8: 0f be out 0x3f, r0 ; 63 20faa: cd bf out 0x3d, r28 ; 61 20fac: df 91 pop r29 20fae: cf 91 pop r28 20fb0: 1f 91 pop r17 20fb2: 0f 91 pop r16 20fb4: ff 90 pop r15 20fb6: ef 90 pop r14 20fb8: df 90 pop r13 20fba: cf 90 pop r12 20fbc: bf 90 pop r11 20fbe: af 90 pop r10 20fc0: 9f 90 pop r9 20fc2: 8f 90 pop r8 20fc4: 7f 90 pop r7 20fc6: 6f 90 pop r6 20fc8: 5f 90 pop r5 20fca: 4f 90 pop r4 20fcc: 3f 90 pop r3 20fce: 2f 90 pop r2 20fd0: 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; 20fd2: 1d 8a std Y+21, r1 ; 0x15 20fd4: 1e 8a std Y+22, r1 ; 0x16 20fd6: 83 cf rjmp .-250 ; 0x20ede #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; 20fd8: 2d 81 ldd r18, Y+5 ; 0x05 20fda: 3e 81 ldd r19, Y+6 ; 0x06 20fdc: 4f 81 ldd r20, Y+7 ; 0x07 20fde: 58 85 ldd r21, Y+8 ; 0x08 20fe0: 82 e0 ldi r24, 0x02 ; 2 20fe2: 22 0f add r18, r18 20fe4: 33 1f adc r19, r19 20fe6: 44 1f adc r20, r20 20fe8: 55 1f adc r21, r21 20fea: 8a 95 dec r24 20fec: d1 f7 brne .-12 ; 0x20fe2 20fee: 89 81 ldd r24, Y+1 ; 0x01 20ff0: 9a 81 ldd r25, Y+2 ; 0x02 20ff2: ab 81 ldd r26, Y+3 ; 0x03 20ff4: bc 81 ldd r27, Y+4 ; 0x04 20ff6: 81 70 andi r24, 0x01 ; 1 20ff8: 99 27 eor r25, r25 20ffa: aa 27 eor r26, r26 20ffc: bb 27 eor r27, r27 20ffe: 8d 83 std Y+5, r24 ; 0x05 21000: 9e 83 std Y+6, r25 ; 0x06 21002: af 83 std Y+7, r26 ; 0x07 21004: b8 87 std Y+8, r27 ; 0x08 21006: 89 80 ldd r8, Y+1 ; 0x01 21008: 9a 80 ldd r9, Y+2 ; 0x02 2100a: ab 80 ldd r10, Y+3 ; 0x03 2100c: bc 80 ldd r11, Y+4 ; 0x04 2100e: b6 94 lsr r11 21010: a7 94 ror r10 21012: 97 94 ror r9 21014: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 21016: cd 84 ldd r12, Y+13 ; 0x0d 21018: de 84 ldd r13, Y+14 ; 0x0e 2101a: ef 84 ldd r14, Y+15 ; 0x0f 2101c: f8 88 ldd r15, Y+16 ; 0x10 2101e: 89 89 ldd r24, Y+17 ; 0x11 21020: 9a 89 ldd r25, Y+18 ; 0x12 21022: ab 89 ldd r26, Y+19 ; 0x13 21024: bc 89 ldd r27, Y+20 ; 0x14 21026: 8c 15 cp r24, r12 21028: 9d 05 cpc r25, r13 2102a: ae 05 cpc r26, r14 2102c: bf 05 cpc r27, r15 2102e: 08 f4 brcc .+2 ; 0x21032 21030: 6f c0 rjmp .+222 ; 0x21110 // 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; 21032: 6c 01 movw r12, r24 21034: 7d 01 movw r14, r26 21036: 91 e0 ldi r25, 0x01 ; 1 21038: c9 1a sub r12, r25 2103a: d1 08 sbc r13, r1 2103c: e1 08 sbc r14, r1 2103e: f1 08 sbc r15, r1 21040: 8d 85 ldd r24, Y+13 ; 0x0d 21042: 9e 85 ldd r25, Y+14 ; 0x0e 21044: af 85 ldd r26, Y+15 ; 0x0f 21046: b8 89 ldd r27, Y+16 ; 0x10 21048: c8 1a sub r12, r24 2104a: d9 0a sbc r13, r25 2104c: ea 0a sbc r14, r26 2104e: fb 0a sbc r15, r27 21050: c7 01 movw r24, r14 21052: b6 01 movw r22, r12 21054: 62 0f add r22, r18 21056: 73 1f adc r23, r19 21058: 84 1f adc r24, r20 2105a: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 2105c: cd 80 ldd r12, Y+5 ; 0x05 2105e: de 80 ldd r13, Y+6 ; 0x06 21060: ef 80 ldd r14, Y+7 ; 0x07 21062: f8 84 ldd r15, Y+8 ; 0x08 21064: cd 28 or r12, r13 21066: ce 28 or r12, r14 21068: cf 28 or r12, r15 2106a: 41 f0 breq .+16 ; 0x2107c accelerate_steps += acceleration_x2; 2106c: c9 84 ldd r12, Y+9 ; 0x09 2106e: da 84 ldd r13, Y+10 ; 0x0a 21070: eb 84 ldd r14, Y+11 ; 0x0b 21072: fc 84 ldd r15, Y+12 ; 0x0c 21074: 6c 0d add r22, r12 21076: 7d 1d adc r23, r13 21078: 8e 1d adc r24, r14 2107a: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 2107c: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 21080: 75 01 movw r14, r10 21082: 64 01 movw r12, r8 21084: c2 0e add r12, r18 21086: d3 1e adc r13, r19 21088: e4 1e adc r14, r20 2108a: f5 1e adc r15, r21 2108c: 29 81 ldd r18, Y+1 ; 0x01 2108e: 3a 81 ldd r19, Y+2 ; 0x02 21090: 4b 81 ldd r20, Y+3 ; 0x03 21092: 5c 81 ldd r21, Y+4 ; 0x04 21094: 2c 15 cp r18, r12 21096: 3d 05 cpc r19, r13 21098: 4e 05 cpc r20, r14 2109a: 5f 05 cpc r21, r15 2109c: 10 f4 brcc .+4 ; 0x210a2 2109e: 69 01 movw r12, r18 210a0: 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) { 210a2: 2b 8d ldd r18, Y+27 ; 0x1b 210a4: 22 23 and r18, r18 210a6: 09 f4 brne .+2 ; 0x210aa 210a8: 69 c0 rjmp .+210 ; 0x2117c if(!accelerate_steps || !decelerate_steps) { 210aa: c1 14 cp r12, r1 210ac: d1 04 cpc r13, r1 210ae: e1 04 cpc r14, r1 210b0: f1 04 cpc r15, r1 210b2: 09 f4 brne .+2 ; 0x210b6 210b4: 66 c0 rjmp .+204 ; 0x21182 // 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; 210b6: 4d 89 ldd r20, Y+21 ; 0x15 210b8: 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) { 210ba: 41 14 cp r4, r1 210bc: 51 04 cpc r5, r1 210be: 61 04 cpc r6, r1 210c0: 71 04 cpc r7, r1 210c2: 09 f4 brne .+2 ; 0x210c6 210c4: 3d cf rjmp .-390 ; 0x20f40 // 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); 210c6: a7 01 movw r20, r14 210c8: 96 01 movw r18, r12 210ca: 69 85 ldd r22, Y+9 ; 0x09 210cc: 7a 85 ldd r23, Y+10 ; 0x0a 210ce: 8b 85 ldd r24, Y+11 ; 0x0b 210d0: 9c 85 ldd r25, Y+12 ; 0x0c 210d2: 0f 94 00 a4 call 0x34800 ; 0x34800 <__mulsi3> 210d6: 2d 85 ldd r18, Y+13 ; 0x0d 210d8: 3e 85 ldd r19, Y+14 ; 0x0e 210da: 4f 85 ldd r20, Y+15 ; 0x0f 210dc: 58 89 ldd r21, Y+16 ; 0x10 210de: 62 0f add r22, r18 210e0: 73 1f adc r23, r19 210e2: 84 1f adc r24, r20 210e4: 95 1f adc r25, r21 210e6: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 210ea: 0f 94 93 a8 call 0x35126 ; 0x35126 max_adv_steps = max_rate * block->adv_comp; 210ee: f1 01 movw r30, r2 210f0: ec 5a subi r30, 0xAC ; 172 210f2: ff 4f sbci r31, 0xFF ; 255 210f4: 20 81 ld r18, Z 210f6: 31 81 ldd r19, Z+1 ; 0x01 210f8: 42 81 ldd r20, Z+2 ; 0x02 210fa: 53 81 ldd r21, Z+3 ; 0x03 210fc: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 21100: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 21104: 46 2f mov r20, r22 21106: 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; 21108: 41 2c mov r4, r1 2110a: 51 2c mov r5, r1 2110c: 32 01 movw r6, r4 2110e: 18 cf rjmp .-464 ; 0x20f40 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; 21110: 6d 85 ldd r22, Y+13 ; 0x0d 21112: 7e 85 ldd r23, Y+14 ; 0x0e 21114: 8f 85 ldd r24, Y+15 ; 0x0f 21116: 98 89 ldd r25, Y+16 ; 0x10 21118: c9 88 ldd r12, Y+17 ; 0x11 2111a: da 88 ldd r13, Y+18 ; 0x12 2111c: eb 88 ldd r14, Y+19 ; 0x13 2111e: fc 88 ldd r15, Y+20 ; 0x14 21120: 6c 19 sub r22, r12 21122: 7d 09 sbc r23, r13 21124: 8e 09 sbc r24, r14 21126: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 21128: cd 80 ldd r12, Y+5 ; 0x05 2112a: de 80 ldd r13, Y+6 ; 0x06 2112c: ef 80 ldd r14, Y+7 ; 0x07 2112e: f8 84 ldd r15, Y+8 ; 0x08 21130: cd 28 or r12, r13 21132: ce 28 or r12, r14 21134: cf 28 or r12, r15 21136: 41 f0 breq .+16 ; 0x21148 decelerate_steps += acceleration_x2; 21138: c9 84 ldd r12, Y+9 ; 0x09 2113a: da 84 ldd r13, Y+10 ; 0x0a 2113c: eb 84 ldd r14, Y+11 ; 0x0b 2113e: fc 84 ldd r15, Y+12 ; 0x0c 21140: 6c 0d add r22, r12 21142: 7d 1d adc r23, r13 21144: 8e 1d adc r24, r14 21146: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 21148: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 2114c: 82 0e add r8, r18 2114e: 93 1e adc r9, r19 21150: a4 1e adc r10, r20 21152: b5 1e adc r11, r21 21154: 49 80 ldd r4, Y+1 ; 0x01 21156: 5a 80 ldd r5, Y+2 ; 0x02 21158: 6b 80 ldd r6, Y+3 ; 0x03 2115a: 7c 80 ldd r7, Y+4 ; 0x04 2115c: 84 14 cp r8, r4 2115e: 95 04 cpc r9, r5 21160: a6 04 cpc r10, r6 21162: b7 04 cpc r11, r7 21164: 10 f4 brcc .+4 ; 0x2116a 21166: 24 01 movw r4, r8 21168: 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; 2116a: c9 80 ldd r12, Y+1 ; 0x01 2116c: da 80 ldd r13, Y+2 ; 0x02 2116e: eb 80 ldd r14, Y+3 ; 0x03 21170: fc 80 ldd r15, Y+4 ; 0x04 21172: c4 18 sub r12, r4 21174: d5 08 sbc r13, r5 21176: e6 08 sbc r14, r6 21178: f7 08 sbc r15, r7 2117a: 93 cf rjmp .-218 ; 0x210a2 // 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; 2117c: 40 e0 ldi r20, 0x00 ; 0 2117e: 80 e0 ldi r24, 0x00 ; 0 21180: c3 cf rjmp .-122 ; 0x21108 #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; 21182: 4d 89 ldd r20, Y+21 ; 0x15 21184: 8e 89 ldd r24, Y+22 ; 0x16 21186: c0 cf rjmp .-128 ; 0x21108 00021188 : }; 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() { 21188: ef 92 push r14 2118a: ff 92 push r15 2118c: 0f 93 push r16 2118e: 1f 93 push r17 21190: cf 93 push r28 21192: df 93 push r29 21194: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 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) 21198: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 2119c: 81 11 cpse r24, r1 2119e: 23 c0 rjmp .+70 ; 0x211e6 { _md->status = 1; // Menu entered for the first time 211a0: 81 e0 ldi r24, 0x01 ; 1 211a2: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 // Fetch the TuneItem from PROGMEM const uint8_t offset = (mmu2.MMUCurrentErrorCode() == ErrorCode::HOMING_IDLER_FAILED) ? 1 : 0; 211a6: 81 e0 ldi r24, 0x01 ; 1 211a8: 90 e0 ldi r25, 0x00 ; 0 211aa: 20 91 d2 12 lds r18, 0x12D2 ; 0x8012d2 211ae: 30 91 d3 12 lds r19, 0x12D3 ; 0x8012d3 211b2: 27 30 cpi r18, 0x07 ; 7 211b4: 31 48 sbci r19, 0x81 ; 129 211b6: 11 f0 breq .+4 ; 0x211bc 211b8: 90 e0 ldi r25, 0x00 ; 0 211ba: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 211bc: bc 01 movw r22, r24 211be: 66 0f add r22, r22 211c0: 77 1f adc r23, r23 211c2: 68 0f add r22, r24 211c4: 79 1f adc r23, r25 211c6: 69 52 subi r22, 0x29 ; 41 211c8: 78 47 sbci r23, 0x78 ; 120 211ca: 43 e0 ldi r20, 0x03 ; 3 211cc: 50 e0 ldi r21, 0x00 ; 0 211ce: 85 ea ldi r24, 0xA5 ; 165 211d0: 93 e0 ldi r25, 0x03 ; 3 211d2: 0f 94 37 a1 call 0x3426e ; 0x3426e // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 211d6: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 211da: 0e 94 b7 fc call 0x1f96e ; 0x1f96e _md->currentValue = mmu2.GetLastReadRegisterValue(); 211de: 80 91 fd 12 lds r24, 0x12FD ; 0x8012fd 211e2: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 } MENU_BEGIN(); 211e6: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 211ea: 10 92 60 04 sts 0x0460, r1 ; 0x800460 211ee: 80 91 60 04 lds r24, 0x0460 ; 0x800460 211f2: 84 30 cpi r24, 0x04 ; 4 211f4: e0 f5 brcc .+120 ; 0x2126e 211f6: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 211fa: 0e 94 1c 62 call 0xc438 ; 0xc438 211fe: 88 23 and r24, r24 21200: 89 f0 breq .+34 ; 0x21224 21202: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 21206: 70 e0 ldi r23, 0x00 ; 0 21208: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 2120c: 0e 94 8d d0 call 0x1a11a ; 0x1a11a 21210: 10 92 43 0d sts 0x0D43, r1 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.452> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 21214: df 91 pop r29 21216: cf 91 pop r28 21218: 1f 91 pop r17 2121a: 0f 91 pop r16 2121c: ff 90 pop r15 2121e: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 21220: 0d 94 6d 05 jmp 0x20ada ; 0x20ada mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 21224: 81 e0 ldi r24, 0x01 ; 1 21226: 96 e5 ldi r25, 0x56 ; 86 21228: 0e 94 0a 75 call 0xea14 ; 0xea14 2122c: 0e 94 9e 72 call 0xe53c ; 0xe53c MENU_ITEM_EDIT_int3_P( 21230: 00 91 a7 03 lds r16, 0x03A7 ; 0x8003a7 21234: 10 e0 ldi r17, 0x00 ; 0 21236: c0 91 a6 03 lds r28, 0x03A6 ; 0x8003a6 2123a: d0 e0 ldi r29, 0x00 ; 0 2123c: 83 ef ldi r24, 0xF3 ; 243 2123e: 95 e5 ldi r25, 0x55 ; 85 21240: 0e 94 0a 75 call 0xea14 ; 0xea14 21244: f1 2c mov r15, r1 21246: e1 2c mov r14, r1 21248: 9e 01 movw r18, r28 2124a: 48 e0 ldi r20, 0x08 ; 8 2124c: 64 ea ldi r22, 0xA4 ; 164 2124e: 73 e0 ldi r23, 0x03 ; 3 21250: 0e 94 3e 6f call 0xde7c ; 0xde7c _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 21254: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 21258: 80 91 60 04 lds r24, 0x0460 ; 0x800460 2125c: 8f 5f subi r24, 0xFF ; 255 2125e: 80 93 60 04 sts 0x0460, r24 ; 0x800460 21262: 80 91 62 04 lds r24, 0x0462 ; 0x800462 21266: 8f 5f subi r24, 0xFF ; 255 21268: 80 93 62 04 sts 0x0462, r24 ; 0x800462 2126c: c0 cf rjmp .-128 ; 0x211ee &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 2126e: df 91 pop r29 21270: cf 91 pop r28 21272: 1f 91 pop r17 21274: 0f 91 pop r16 21276: ff 90 pop r15 21278: ef 90 pop r14 2127a: 08 95 ret 0002127c : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 2127c: 1f 93 push r17 2127e: cf 93 push r28 21280: 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); 21282: 64 e6 ldi r22, 0x64 ; 100 21284: 70 e0 ldi r23, 0x00 ; 0 21286: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 2128a: 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++) { 2128c: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 2128e: 4e e2 ldi r20, 0x2E ; 46 21290: 63 e0 ldi r22, 0x03 ; 3 21292: 81 2f mov r24, r17 21294: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 21298: ce 01 movw r24, r28 2129a: 0e 94 7f 8c call 0x118fe ; 0x118fe 2129e: ce 01 movw r24, r28 212a0: 0e 94 7f 8c call 0x118fe ; 0x118fe 212a4: ce 01 movw r24, r28 212a6: 0e 94 7f 8c call 0x118fe ; 0x118fe 212aa: ce 01 movw r24, r28 212ac: 0e 94 7f 8c call 0x118fe ; 0x118fe 212b0: ce 01 movw r24, r28 212b2: 0e 94 7f 8c call 0x118fe ; 0x118fe } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 212b6: 1f 5f subi r17, 0xFF ; 255 212b8: 14 31 cpi r17, 0x14 ; 20 212ba: 49 f7 brne .-46 ; 0x2128e //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 212bc: df 91 pop r29 212be: cf 91 pop r28 212c0: 1f 91 pop r17 212c2: 08 95 ret 000212c4 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 212c4: 10 92 94 03 sts 0x0394, r1 ; 0x800394 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 212c8: 08 95 ret 000212ca : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 212ca: cf 93 push r28 MENU_BEGIN(); 212cc: 0e 94 dc 73 call 0xe7b8 ; 0xe7b8 212d0: 10 92 60 04 sts 0x0460, r1 ; 0x800460 212d4: 80 91 60 04 lds r24, 0x0460 ; 0x800460 212d8: 84 30 cpi r24, 0x04 ; 4 212da: 08 f0 brcs .+2 ; 0x212de 212dc: b1 c0 rjmp .+354 ; 0x21440 212de: 10 92 63 04 sts 0x0463, r1 ; 0x800463 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 212e2: 8f e5 ldi r24, 0x5F ; 95 212e4: 9f e0 ldi r25, 0x0F ; 15 212e6: 0f 94 9d a3 call 0x3473a ; 0x3473a 212ea: 81 11 cpse r24, r1 212ec: 0f c0 rjmp .+30 ; 0x2130c { ON_MENU_LEAVE( 212ee: 0e 94 1c 62 call 0xc438 ; 0xc438 212f2: 81 11 cpse r24, r1 212f4: 0f 94 62 09 call 0x212c4 ; 0x212c4 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 212f8: 80 91 94 03 lds r24, 0x0394 ; 0x800394 212fc: 8a 30 cpi r24, 0x0A ; 10 212fe: a9 f1 breq .+106 ; 0x2136a 21300: 8c e8 ldi r24, 0x8C ; 140 21302: 98 e4 ldi r25, 0x48 ; 72 21304: 0e 94 0a 75 call 0xea14 ; 0xea14 21308: 0e 94 9e 72 call 0xe53c ; 0xe53c } if (farm_mode) 2130c: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 21310: 88 23 and r24, r24 21312: 71 f1 breq .+92 ; 0x21370 { MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm); 21314: 68 e0 ldi r22, 0x08 ; 8 21316: 78 e3 ldi r23, 0x38 ; 56 21318: 83 ee ldi r24, 0xE3 ; 227 2131a: 99 e9 ldi r25, 0x99 ; 153 2131c: 0e 94 6d 72 call 0xe4da ; 0xe4da MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle); 21320: 68 e8 ldi r22, 0x88 ; 136 21322: 78 e3 ldi r23, 0x38 ; 56 21324: 83 ed ldi r24, 0xD3 ; 211 21326: 99 e9 ldi r25, 0x99 ; 153 21328: 0e 94 6d 72 call 0xe4da ; 0xe4da 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); 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); 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); 2132c: 8f e5 ldi r24, 0x5F ; 95 2132e: 9f e0 ldi r25, 0x0F ; 15 21330: 0f 94 9d a3 call 0x3473a ; 0x3473a 21334: 81 11 cpse r24, r1 21336: 0c c0 rjmp .+24 ; 0x21350 21338: 80 91 94 03 lds r24, 0x0394 ; 0x800394 2133c: 89 30 cpi r24, 0x09 ; 9 2133e: 41 f4 brne .+16 ; 0x21350 21340: 80 e1 ldi r24, 0x10 ; 16 21342: 98 e5 ldi r25, 0x58 ; 88 21344: 0e 94 0a 75 call 0xea14 ; 0xea14 21348: 6a e2 ldi r22, 0x2A ; 42 2134a: 77 e3 ldi r23, 0x37 ; 55 2134c: 0e 94 6d 72 call 0xe4da ; 0xe4da MENU_END(); 21350: 0e 94 53 62 call 0xc4a6 ; 0xc4a6 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 21354: 80 91 60 04 lds r24, 0x0460 ; 0x800460 21358: 8f 5f subi r24, 0xFF ; 255 2135a: 80 93 60 04 sts 0x0460, r24 ; 0x800460 2135e: 80 91 62 04 lds r24, 0x0462 ; 0x800462 21362: 8f 5f subi r24, 0xFF ; 255 21364: 80 93 62 04 sts 0x0462, r24 ; 0x800462 21368: b5 cf rjmp .-150 ; 0x212d4 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)); 2136a: 85 e9 ldi r24, 0x95 ; 149 2136c: 9a e4 ldi r25, 0x4A ; 74 2136e: ca cf rjmp .-108 ; 0x21304 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(); 21370: 0f 94 15 02 call 0x2042a ; 0x2042a 21374: 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); 21376: 88 eb ldi r24, 0xB8 ; 184 21378: 99 e9 ldi r25, 0x99 ; 153 2137a: cc 23 and r28, r28 2137c: 11 f0 breq .+4 ; 0x21382 2137e: 87 ec ldi r24, 0xC7 ; 199 21380: 99 e9 ldi r25, 0x99 ; 153 21382: 66 e2 ldi r22, 0x26 ; 38 21384: 77 e3 ldi r23, 0x37 ; 55 21386: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 2138a: 8d e9 ldi r24, 0x9D ; 157 2138c: 99 e9 ldi r25, 0x99 ; 153 2138e: cc 23 and r28, r28 21390: 11 f0 breq .+4 ; 0x21396 21392: 8c ea ldi r24, 0xAC ; 172 21394: 99 e9 ldi r25, 0x99 ; 153 21396: 6a e9 ldi r22, 0x9A ; 154 21398: 77 e3 ldi r23, 0x37 ; 55 2139a: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 2139e: 81 e8 ldi r24, 0x81 ; 129 213a0: 99 e9 ldi r25, 0x99 ; 153 213a2: cc 23 and r28, r28 213a4: 11 f0 breq .+4 ; 0x213aa 213a6: 81 e9 ldi r24, 0x91 ; 145 213a8: 99 e9 ldi r25, 0x99 ; 153 213aa: 68 ed ldi r22, 0xD8 ; 216 213ac: 77 e3 ldi r23, 0x37 ; 55 213ae: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 213b2: 85 e6 ldi r24, 0x65 ; 101 213b4: 99 e9 ldi r25, 0x99 ; 153 213b6: cc 23 and r28, r28 213b8: 11 f0 breq .+4 ; 0x213be 213ba: 85 e7 ldi r24, 0x75 ; 117 213bc: 99 e9 ldi r25, 0x99 ; 153 213be: 6c e8 ldi r22, 0x8C ; 140 213c0: 78 e3 ldi r23, 0x38 ; 56 213c2: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 213c6: 8a e4 ldi r24, 0x4A ; 74 213c8: 99 e9 ldi r25, 0x99 ; 153 213ca: cc 23 and r28, r28 213cc: 11 f0 breq .+4 ; 0x213d2 213ce: 89 e5 ldi r24, 0x59 ; 89 213d0: 99 e9 ldi r25, 0x99 ; 153 213d2: 6e eb ldi r22, 0xBE ; 190 213d4: 77 e3 ldi r23, 0x37 ; 55 213d6: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 213da: 8f e2 ldi r24, 0x2F ; 47 213dc: 99 e9 ldi r25, 0x99 ; 153 213de: cc 23 and r28, r28 213e0: 11 f0 breq .+4 ; 0x213e6 213e2: 8e e3 ldi r24, 0x3E ; 62 213e4: 99 e9 ldi r25, 0x99 ; 153 213e6: 6e ef ldi r22, 0xFE ; 254 213e8: 77 e3 ldi r23, 0x37 ; 55 213ea: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 213ee: 83 e1 ldi r24, 0x13 ; 19 213f0: 99 e9 ldi r25, 0x99 ; 153 213f2: cc 23 and r28, r28 213f4: 11 f0 breq .+4 ; 0x213fa 213f6: 83 e2 ldi r24, 0x23 ; 35 213f8: 99 e9 ldi r25, 0x99 ; 153 213fa: 6e ec ldi r22, 0xCE ; 206 213fc: 77 e3 ldi r23, 0x37 ; 55 213fe: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 21402: 87 ef ldi r24, 0xF7 ; 247 21404: 98 e9 ldi r25, 0x98 ; 152 21406: cc 23 and r28, r28 21408: 11 f0 breq .+4 ; 0x2140e 2140a: 87 e0 ldi r24, 0x07 ; 7 2140c: 99 e9 ldi r25, 0x99 ; 153 2140e: 6a ef ldi r22, 0xFA ; 250 21410: 76 e3 ldi r23, 0x36 ; 54 21412: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 21416: 8b ed ldi r24, 0xDB ; 219 21418: 98 e9 ldi r25, 0x98 ; 152 2141a: cc 23 and r28, r28 2141c: 11 f0 breq .+4 ; 0x21422 2141e: 8b ee ldi r24, 0xEB ; 235 21420: 98 e9 ldi r25, 0x98 ; 152 21422: 60 ea ldi r22, 0xA0 ; 160 21424: 78 e3 ldi r23, 0x38 ; 56 21426: 0e 94 c3 72 call 0xe586 ; 0xe586 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); 2142a: 80 ec ldi r24, 0xC0 ; 192 2142c: 98 e9 ldi r25, 0x98 ; 152 2142e: cc 23 and r28, r28 21430: 11 f0 breq .+4 ; 0x21436 21432: 8f ec ldi r24, 0xCF ; 207 21434: 98 e9 ldi r25, 0x98 ; 152 21436: 6a ea ldi r22, 0xAA ; 170 21438: 78 e3 ldi r23, 0x38 ; 56 2143a: 0e 94 c3 72 call 0xe586 ; 0xe586 2143e: 76 cf rjmp .-276 ; 0x2132c } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); MENU_END(); } 21440: cf 91 pop r28 21442: 08 95 ret 00021444 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 21444: 89 e0 ldi r24, 0x09 ; 9 21446: 80 93 94 03 sts 0x0394, r24 ; 0x800394 lcd_generic_preheat_menu(); 2144a: 0d 94 65 09 jmp 0x212ca ; 0x212ca 0002144e : } // 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); 2144e: 5f 93 push r21 21450: 4f 93 push r20 21452: 7f 93 push r23 21454: 6f 93 push r22 21456: 28 2f mov r18, r24 21458: 08 2e mov r0, r24 2145a: 00 0c add r0, r0 2145c: 33 0b sbc r19, r19 2145e: 3f 93 push r19 21460: 8f 93 push r24 21462: 87 e5 ldi r24, 0x57 ; 87 21464: 9a e6 ldi r25, 0x6A ; 106 21466: 9f 93 push r25 21468: 8f 93 push r24 2146a: 0e 94 db 6e call 0xddb6 ; 0xddb6 lcd_space(9 - chars); 2146e: 2d b7 in r18, 0x3d ; 61 21470: 3e b7 in r19, 0x3e ; 62 21472: 28 5f subi r18, 0xF8 ; 248 21474: 3f 4f sbci r19, 0xFF ; 255 21476: 0f b6 in r0, 0x3f ; 63 21478: f8 94 cli 2147a: 3e bf out 0x3e, r19 ; 62 2147c: 0f be out 0x3f, r0 ; 63 2147e: 2d bf out 0x3d, r18 ; 61 21480: 99 e0 ldi r25, 0x09 ; 9 21482: 98 1b sub r25, r24 21484: 89 2f mov r24, r25 21486: 0c 94 f8 6e jmp 0xddf0 ; 0xddf0 0002148a : default: return false; } } void lcd_print_target_temps_first_line() { 2148a: cf 93 push r28 2148c: df 93 push r29 lcd_home(); 2148e: 0e 94 ef 6f call 0xdfde ; 0xdfde lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 21492: c0 91 5d 12 lds r28, 0x125D ; 0x80125d 21496: d0 91 5e 12 lds r29, 0x125E ; 0x80125e 2149a: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2149e: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 214a2: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 214a6: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 214aa: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 214ae: ae 01 movw r20, r28 214b0: 82 e8 ldi r24, 0x82 ; 130 214b2: 0f 94 27 0a call 0x2144e ; 0x2144e lcd_set_cursor(10, 0); 214b6: 60 e0 ldi r22, 0x00 ; 0 214b8: 8a e0 ldi r24, 0x0A ; 10 214ba: 0e 94 2a 6f call 0xde54 ; 0xde54 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 214be: c0 91 59 12 lds r28, 0x1259 ; 0x801259 214c2: d0 91 5a 12 lds r29, 0x125A ; 0x80125a int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 214c6: 20 97 sbiw r28, 0x00 ; 0 214c8: 81 f0 breq .+32 ; 0x214ea lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 214ca: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 214ce: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 214d2: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 214d6: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 214da: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 214de: ae 01 movw r20, r28 214e0: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 214e2: df 91 pop r29 214e4: 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); 214e6: 0d 94 27 0a jmp 0x2144e ; 0x2144e } else { lcd_space(10); 214ea: 8a e0 ldi r24, 0x0A ; 10 } } 214ec: df 91 pop r29 214ee: 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); 214f0: 0c 94 f8 6e jmp 0xddf0 ; 0xddf0 000214f4 : 214f4: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 214f8: 0f 94 45 0a call 0x2148a ; 0x2148a lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 214fc: 89 ea ldi r24, 0xA9 ; 169 214fe: 97 e5 ldi r25, 0x57 ; 87 21500: 0e 94 0a 75 call 0xea14 ; 0xea14 21504: ac 01 movw r20, r24 21506: 61 e0 ldi r22, 0x01 ; 1 21508: 80 e0 ldi r24, 0x00 ; 0 2150a: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(0,2); 2150e: 62 e0 ldi r22, 0x02 ; 2 21510: 80 e0 ldi r24, 0x00 ; 0 21512: 0e 94 2a 6f call 0xde54 ; 0xde54 switch(eFilamentAction) { 21516: 80 91 94 03 lds r24, 0x0394 ; 0x800394 2151a: 83 30 cpi r24, 0x03 ; 3 2151c: 81 f1 breq .+96 ; 0x2157e 2151e: 48 f4 brcc .+18 ; 0x21532 21520: 81 30 cpi r24, 0x01 ; 1 21522: 60 f0 brcs .+24 ; 0x2153c case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 21524: 86 e9 ldi r24, 0x96 ; 150 21526: 97 e5 ldi r25, 0x57 ; 87 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 21528: 0e 94 0a 75 call 0xea14 ; 0xea14 2152c: 0e 94 ed 6e call 0xddda ; 0xddda 21530: 05 c0 rjmp .+10 ; 0x2153c 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) { 21532: 85 30 cpi r24, 0x05 ; 5 21534: 21 f1 breq .+72 ; 0x2157e 21536: b0 f3 brcs .-20 ; 0x21524 21538: 88 30 cpi r24, 0x08 ; 8 2153a: a1 f3 breq .-24 ; 0x21524 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 2153c: 0e 94 45 73 call 0xe68a ; 0xe68a #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 21540: 81 11 cpse r24, r1 21542: 09 c0 rjmp .+18 ; 0x21556 21544: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21548: 81 50 subi r24, 0x01 ; 1 2154a: 82 30 cpi r24, 0x02 ; 2 2154c: 28 f5 brcc .+74 ; 0x21598 2154e: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 21552: 88 23 and r24, r24 21554: 09 f1 breq .+66 ; 0x21598 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 21556: 80 91 15 06 lds r24, 0x0615 ; 0x800615 2155a: 81 11 cpse r24, r1 2155c: 13 c0 rjmp .+38 ; 0x21584 2155e: 83 e0 ldi r24, 0x03 ; 3 21560: 0e 94 cf 62 call 0xc59e ; 0xc59e switch(eFilamentAction) { 21564: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21568: 82 30 cpi r24, 0x02 ; 2 2156a: 71 f0 breq .+28 ; 0x21588 2156c: 83 30 cpi r24, 0x03 ; 3 2156e: 81 f0 breq .+32 ; 0x21590 21570: 81 30 cpi r24, 0x01 ; 1 21572: 91 f4 brne .+36 ; 0x21598 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 21574: 61 e0 ldi r22, 0x01 ; 1 21576: 88 e1 ldi r24, 0x18 ; 24 21578: 9b e6 ldi r25, 0x6B ; 107 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 2157a: 0c 94 da 8c jmp 0x119b4 ; 0x119b4 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)); 2157e: 81 e8 ldi r24, 0x81 ; 129 21580: 97 e5 ldi r25, 0x57 ; 87 21582: d2 cf rjmp .-92 ; 0x21528 #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); 21584: 82 e0 ldi r24, 0x02 ; 2 21586: ec cf rjmp .-40 ; 0x21560 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 21588: 81 e0 ldi r24, 0x01 ; 1 2158a: 80 93 94 03 sts 0x0394, r24 ; 0x800394 2158e: f2 cf rjmp .-28 ; 0x21574 [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 21590: 61 e0 ldi r22, 0x01 ; 1 21592: 88 ec ldi r24, 0xC8 ; 200 21594: 98 e6 ldi r25, 0x68 ; 104 21596: f1 cf rjmp .-30 ; 0x2157a case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 21598: 08 95 ret 0002159a <__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) { 2159a: 1f 92 push r1 2159c: 0f 92 push r0 2159e: 0f b6 in r0, 0x3f ; 63 215a0: 0f 92 push r0 215a2: 11 24 eor r1, r1 215a4: 0b b6 in r0, 0x3b ; 59 215a6: 0f 92 push r0 215a8: 2f 93 push r18 215aa: 3f 93 push r19 215ac: 4f 93 push r20 215ae: 5f 93 push r21 215b0: 6f 93 push r22 215b2: 7f 93 push r23 215b4: 8f 93 push r24 215b6: 9f 93 push r25 215b8: af 93 push r26 215ba: bf 93 push r27 215bc: ef 93 push r30 215be: ff 93 push r31 if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 215c0: 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 215c4: 80 91 46 0d lds r24, 0x0D46 ; 0x800d46 uint8_t buf_r = ptr[2]; //get read index 215c8: 90 91 47 0d lds r25, 0x0D47 ; 0x800d47 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 215cc: e8 2f mov r30, r24 215ce: f0 e0 ldi r31, 0x00 ; 0 215d0: e7 5b subi r30, 0xB7 ; 183 215d2: f2 4f sbci r31, 0xF2 ; 242 215d4: 20 83 st Z, r18 buf_w++; //incerment write index 215d6: 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 215d8: 20 91 45 0d lds r18, 0x0D45 ; 0x800d45 215dc: 82 17 cp r24, r18 215de: 08 f0 brcs .+2 ; 0x215e2 <__vector_51+0x48> 215e0: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 215e2: 98 13 cpse r25, r24 215e4: 17 c0 rjmp .+46 ; 0x21614 <__vector_51+0x7a> { //rx buffer full puts_P(PSTR("USART2 rx Full!!!")); 215e6: 83 e5 ldi r24, 0x53 ; 83 215e8: 97 e9 ldi r25, 0x97 ; 151 215ea: 0f 94 86 a2 call 0x3450c ; 0x3450c } } 215ee: ff 91 pop r31 215f0: ef 91 pop r30 215f2: bf 91 pop r27 215f4: af 91 pop r26 215f6: 9f 91 pop r25 215f8: 8f 91 pop r24 215fa: 7f 91 pop r23 215fc: 6f 91 pop r22 215fe: 5f 91 pop r21 21600: 4f 91 pop r20 21602: 3f 91 pop r19 21604: 2f 91 pop r18 21606: 0f 90 pop r0 21608: 0b be out 0x3b, r0 ; 59 2160a: 0f 90 pop r0 2160c: 0f be out 0x3f, r0 ; 63 2160e: 0f 90 pop r0 21610: 1f 90 pop r1 21612: 18 95 reti ptr[1] = buf_w; //store write index 21614: 80 93 46 0d sts 0x0D46, r24 ; 0x800d46 21618: ea cf rjmp .-44 ; 0x215ee <__vector_51+0x54> 0002161a <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 2161a: 1f 92 push r1 2161c: 0f 92 push r0 2161e: 0f b6 in r0, 0x3f ; 63 21620: 0f 92 push r0 21622: 11 24 eor r1, r1 WRITE(BEEPER, 0); 21624: 72 98 cbi 0x0e, 2 ; 14 } 21626: 0f 90 pop r0 21628: 0f be out 0x3f, r0 ; 63 2162a: 0f 90 pop r0 2162c: 1f 90 pop r1 2162e: 18 95 reti 00021630 <__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) { 21630: 1f 92 push r1 21632: 0f 92 push r0 21634: 0f b6 in r0, 0x3f ; 63 21636: 0f 92 push r0 21638: 11 24 eor r1, r1 WRITE(BEEPER, 1); 2163a: 72 9a sbi 0x0e, 2 ; 14 } 2163c: 0f 90 pop r0 2163e: 0f be out 0x3f, r0 ; 63 21640: 0f 90 pop r0 21642: 1f 90 pop r1 21644: 18 95 reti 00021646 : void delay2(unsigned long ms) { 21646: 8f 92 push r8 21648: 9f 92 push r9 2164a: af 92 push r10 2164c: bf 92 push r11 2164e: cf 92 push r12 21650: df 92 push r13 21652: ef 92 push r14 21654: ff 92 push r15 21656: 6b 01 movw r12, r22 21658: 7c 01 movw r14, r24 uint32_t start = micros2(); 2165a: 0e 94 10 fd call 0x1fa20 ; 0x1fa20 2165e: 4b 01 movw r8, r22 21660: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 21662: c1 14 cp r12, r1 21664: d1 04 cpc r13, r1 21666: e1 04 cpc r14, r1 21668: f1 04 cpc r15, r1 2166a: b9 f0 breq .+46 ; 0x2169a 2166c: 0e 94 10 fd call 0x1fa20 ; 0x1fa20 21670: 68 19 sub r22, r8 21672: 79 09 sbc r23, r9 21674: 8a 09 sbc r24, r10 21676: 9b 09 sbc r25, r11 21678: 68 3e cpi r22, 0xE8 ; 232 2167a: 73 40 sbci r23, 0x03 ; 3 2167c: 81 05 cpc r24, r1 2167e: 91 05 cpc r25, r1 21680: 80 f3 brcs .-32 ; 0x21662 { ms--; 21682: 21 e0 ldi r18, 0x01 ; 1 21684: c2 1a sub r12, r18 21686: d1 08 sbc r13, r1 21688: e1 08 sbc r14, r1 2168a: f1 08 sbc r15, r1 start += 1000; 2168c: 88 ee ldi r24, 0xE8 ; 232 2168e: 88 0e add r8, r24 21690: 83 e0 ldi r24, 0x03 ; 3 21692: 98 1e adc r9, r24 21694: a1 1c adc r10, r1 21696: b1 1c adc r11, r1 21698: e4 cf rjmp .-56 ; 0x21662 } } } 2169a: ff 90 pop r15 2169c: ef 90 pop r14 2169e: df 90 pop r13 216a0: cf 90 pop r12 216a2: bf 90 pop r11 216a4: af 90 pop r10 216a6: 9f 90 pop r9 216a8: 8f 90 pop r8 216aa: 08 95 ret 000216ac : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 216ac: 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(); 216ae: f8 94 cli m = timer2_millis; 216b0: 60 91 f8 05 lds r22, 0x05F8 ; 0x8005f8 216b4: 70 91 f9 05 lds r23, 0x05F9 ; 0x8005f9 216b8: 80 91 fa 05 lds r24, 0x05FA ; 0x8005fa 216bc: 90 91 fb 05 lds r25, 0x05FB ; 0x8005fb SREG = oldSREG; 216c0: 2f bf out 0x3f, r18 ; 63 return m; } 216c2: 08 95 ret 000216c4 : } //! @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); 216c4: 60 e0 ldi r22, 0x00 ; 0 216c6: 70 e0 ldi r23, 0x00 ; 0 216c8: 80 e8 ldi r24, 0x80 ; 128 216ca: 9f eb ldi r25, 0xBF ; 191 216cc: 0f 94 de 65 call 0x2cbbc ; 0x2cbbc SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 216d0: 8b eb ldi r24, 0xBB ; 187 216d2: 9a e6 ldi r25, 0x6A ; 106 216d4: 0e 94 8d 7c call 0xf91a ; 0xf91a // Indicate that the printer is paused did_pause_print = true; 216d8: 81 e0 ldi r24, 0x01 ; 1 216da: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd } else return false; } bool Stopwatch::pause() { if (isRunning()) { 216de: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 216e2: 81 30 cpi r24, 0x01 ; 1 216e4: 69 f4 brne .+26 ; 0x21700 state = PAUSED; 216e6: 82 e0 ldi r24, 0x02 ; 2 216e8: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b stopTimestamp = _millis(); 216ec: 0f 94 56 0b call 0x216ac ; 0x216ac 216f0: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 216f4: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 216f8: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 216fc: 90 93 0e 06 sts 0x060E, r25 ; 0x80060e print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 21700: 82 e0 ldi r24, 0x02 ; 2 21702: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e lcd_return_to_status(); 21706: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 0002170a ::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) 2170a: ff 92 push r15 2170c: 0f 93 push r16 2170e: 1f 93 push r17 21710: cf 93 push r28 21712: df 93 push r29 { if (!m_isRunning) return false; 21714: fc 01 movw r30, r24 21716: f0 80 ld r15, Z 21718: f1 10 cpse r15, r1 2171a: 08 c0 rjmp .+16 ; 0x2172c ::expired(unsigned short)+0x22> 2171c: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 2171e: 8f 2d mov r24, r15 21720: df 91 pop r29 21722: cf 91 pop r28 21724: 1f 91 pop r17 21726: 0f 91 pop r16 21728: ff 90 pop r15 2172a: 08 95 ret 2172c: 8b 01 movw r16, r22 2172e: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 21730: 0f 94 56 0b call 0x216ac ; 0x216ac if (m_started <= m_started + msPeriod) 21734: 89 81 ldd r24, Y+1 ; 0x01 21736: 9a 81 ldd r25, Y+2 ; 0x02 21738: 08 0f add r16, r24 2173a: 19 1f adc r17, r25 2173c: 08 17 cp r16, r24 2173e: 19 07 cpc r17, r25 21740: 40 f0 brcs .+16 ; 0x21752 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 21742: 60 17 cp r22, r16 21744: 71 07 cpc r23, r17 21746: 18 f4 brcc .+6 ; 0x2174e ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21748: 68 17 cp r22, r24 2174a: 79 07 cpc r23, r25 2174c: 38 f7 brcc .-50 ; 0x2171c ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 2174e: 18 82 st Y, r1 21750: e6 cf rjmp .-52 ; 0x2171e ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21752: 60 17 cp r22, r16 21754: 71 07 cpc r23, r17 21756: c0 f7 brcc .-16 ; 0x21748 ::expired(unsigned short)+0x3e> 21758: e1 cf rjmp .-62 ; 0x2171c ::expired(unsigned short)+0x12> 0002175a ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 2175a: fc 01 movw r30, r24 2175c: 20 81 ld r18, Z 2175e: 21 11 cpse r18, r1 21760: 0d 94 85 0b jmp 0x2170a ; 0x2170a ::expired(unsigned short)> } 21764: 81 e0 ldi r24, 0x01 ; 1 21766: 08 95 ret 00021768 ::start()>: /** * @brief Start timer */ template void Timer::start() 21768: cf 93 push r28 2176a: df 93 push r29 2176c: ec 01 movw r28, r24 { m_started = _millis(); 2176e: 0f 94 56 0b call 0x216ac ; 0x216ac 21772: 7a 83 std Y+2, r23 ; 0x02 21774: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 21776: 81 e0 ldi r24, 0x01 ; 1 21778: 88 83 st Y, r24 } 2177a: df 91 pop r29 2177c: cf 91 pop r28 2177e: 08 95 ret 00021780 ::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) 21780: 8f 92 push r8 21782: 9f 92 push r9 21784: af 92 push r10 21786: bf 92 push r11 21788: cf 92 push r12 2178a: df 92 push r13 2178c: ef 92 push r14 2178e: ff 92 push r15 21790: 1f 93 push r17 21792: cf 93 push r28 21794: df 93 push r29 { if (!m_isRunning) return false; 21796: fc 01 movw r30, r24 21798: 10 81 ld r17, Z 2179a: 11 11 cpse r17, r1 2179c: 0e c0 rjmp .+28 ; 0x217ba ::expired(unsigned long)+0x3a> 2179e: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 217a0: 81 2f mov r24, r17 217a2: df 91 pop r29 217a4: cf 91 pop r28 217a6: 1f 91 pop r17 217a8: ff 90 pop r15 217aa: ef 90 pop r14 217ac: df 90 pop r13 217ae: cf 90 pop r12 217b0: bf 90 pop r11 217b2: af 90 pop r10 217b4: 9f 90 pop r9 217b6: 8f 90 pop r8 217b8: 08 95 ret 217ba: 6a 01 movw r12, r20 217bc: 7b 01 movw r14, r22 217be: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 217c0: 0f 94 56 0b call 0x216ac ; 0x216ac 217c4: 4b 01 movw r8, r22 217c6: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 217c8: 89 81 ldd r24, Y+1 ; 0x01 217ca: 9a 81 ldd r25, Y+2 ; 0x02 217cc: ab 81 ldd r26, Y+3 ; 0x03 217ce: bc 81 ldd r27, Y+4 ; 0x04 217d0: c8 0e add r12, r24 217d2: d9 1e adc r13, r25 217d4: ea 1e adc r14, r26 217d6: fb 1e adc r15, r27 217d8: c8 16 cp r12, r24 217da: d9 06 cpc r13, r25 217dc: ea 06 cpc r14, r26 217de: fb 06 cpc r15, r27 217e0: 60 f0 brcs .+24 ; 0x217fa ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 217e2: 8c 14 cp r8, r12 217e4: 9d 04 cpc r9, r13 217e6: ae 04 cpc r10, r14 217e8: bf 04 cpc r11, r15 217ea: 28 f4 brcc .+10 ; 0x217f6 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 217ec: 88 16 cp r8, r24 217ee: 99 06 cpc r9, r25 217f0: aa 06 cpc r10, r26 217f2: bb 06 cpc r11, r27 217f4: a0 f6 brcc .-88 ; 0x2179e ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 217f6: 18 82 st Y, r1 217f8: d3 cf rjmp .-90 ; 0x217a0 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 217fa: 8c 14 cp r8, r12 217fc: 9d 04 cpc r9, r13 217fe: ae 04 cpc r10, r14 21800: bf 04 cpc r11, r15 21802: a0 f7 brcc .-24 ; 0x217ec ::expired(unsigned long)+0x6c> 21804: cc cf rjmp .-104 ; 0x2179e ::expired(unsigned long)+0x1e> 00021806 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 21806: 0f 93 push r16 21808: 1f 93 push r17 2180a: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 2180c: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 21810: 88 23 and r24, r24 21812: 09 f4 brne .+2 ; 0x21816 21814: 4d c0 rjmp .+154 ; 0x218b0 heating_status_counter++; 21816: 80 91 04 06 lds r24, 0x0604 ; 0x800604 2181a: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 2181c: 8e 30 cpi r24, 0x0E ; 14 2181e: b0 f4 brcc .+44 ; 0x2184c //! @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++; 21820: 80 93 04 06 sts 0x0604, r24 ; 0x800604 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 21824: 63 e0 ldi r22, 0x03 ; 3 21826: 87 e0 ldi r24, 0x07 ; 7 21828: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_space(13); 2182c: 8d e0 ldi r24, 0x0D ; 13 2182e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 21832: c0 e0 ldi r28, 0x00 ; 0 21834: 80 91 04 06 lds r24, 0x0604 ; 0x800604 21838: c8 17 cp r28, r24 2183a: 58 f4 brcc .+22 ; 0x21852 lcd_putc_at(7 + dots, 3, '.'); 2183c: 4e e2 ldi r20, 0x2E ; 46 2183e: 63 e0 ldi r22, 0x03 ; 3 21840: 87 e0 ldi r24, 0x07 ; 7 21842: 8c 0f add r24, r28 21844: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 21848: cf 5f subi r28, 0xFF ; 255 2184a: f4 cf rjmp .-24 ; 0x21834 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; 2184c: 10 92 04 06 sts 0x0604, r1 ; 0x800604 21850: e9 cf rjmp .-46 ; 0x21824 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 21852: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 21856: 82 30 cpi r24, 0x02 ; 2 21858: d1 f0 breq .+52 ; 0x2188e 2185a: 30 f4 brcc .+12 ; 0x21868 2185c: 81 30 cpi r24, 0x01 ; 1 2185e: 59 f0 breq .+22 ; 0x21876 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 21860: cf 91 pop r28 21862: 1f 91 pop r17 21864: 0f 91 pop r16 21866: 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) { 21868: 83 30 cpi r24, 0x03 ; 3 2186a: f9 f0 breq .+62 ; 0x218aa 2186c: 84 30 cpi r24, 0x04 ; 4 2186e: c1 f7 brne .-16 ; 0x21860 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)); 21870: 8c e4 ldi r24, 0x4C ; 76 21872: 96 e5 ldi r25, 0x56 ; 86 21874: 0e c0 rjmp .+28 ; 0x21892 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)); 21876: 85 e7 ldi r24, 0x75 ; 117 21878: 96 e5 ldi r25, 0x56 ; 86 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 2187a: 0e 94 0a 75 call 0xea14 ; 0xea14 2187e: ac 01 movw r20, r24 21880: 63 e0 ldi r22, 0x03 ; 3 21882: 80 e0 ldi r24, 0x00 ; 0 break; } } } 21884: cf 91 pop r28 21886: 1f 91 pop r17 21888: 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)); 2188a: 0c 94 d7 6f jmp 0xdfae ; 0xdfae 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)); 2188e: 85 e6 ldi r24, 0x65 ; 101 21890: 96 e5 ldi r25, 0x56 ; 86 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)); 21892: 0e 94 0a 75 call 0xea14 ; 0xea14 21896: ac 01 movw r20, r24 21898: 63 e0 ldi r22, 0x03 ; 3 2189a: 80 e0 ldi r24, 0x00 ; 0 2189c: 0e 94 d7 6f call 0xdfae ; 0xdfae heating_status = HeatingStatus::NO_HEATING; 218a0: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb heating_status_counter = 0; 218a4: 10 92 04 06 sts 0x0604, r1 ; 0x800604 218a8: db cf rjmp .-74 ; 0x21860 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)); 218aa: 87 e5 ldi r24, 0x57 ; 87 218ac: 96 e5 ldi r25, 0x56 ; 86 218ae: e5 cf rjmp .-54 ; 0x2187a #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) && 218b0: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 218b4: 88 23 and r24, r24 218b6: 61 f1 breq .+88 ; 0x21910 } else if (((IS_SD_PRINTING) #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && 218b8: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 218bc: 81 11 cpse r24, r1 218be: 28 c0 rjmp .+80 ; 0x21910 (custom_message_type == CustomMsg::Status) && 218c0: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> 218c4: 82 30 cpi r24, 0x02 ; 2 218c6: 20 f5 brcc .+72 ; 0x21910 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 218c8: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.424> 218cc: 81 11 cpse r24, r1 218ce: 16 c0 rjmp .+44 ; 0x218fc (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); 218d0: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 218d4: 88 23 and r24, r24 218d6: 09 f4 brne .+2 ; 0x218da 218d8: 35 c0 rjmp .+106 ; 0x21944 218da: 8e ee ldi r24, 0xEE ; 238 218dc: 93 e1 ldi r25, 0x13 ; 19 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 218de: 20 91 62 0d lds r18, 0x0D62 ; 0x800d62 218e2: 64 e1 ldi r22, 0x14 ; 20 218e4: 82 0f add r24, r18 218e6: 91 1d adc r25, r1 218e8: 0e 94 17 73 call 0xe62e ; 0xe62e 218ec: 81 11 cpse r24, r1 218ee: 2d c0 rjmp .+90 ; 0x2194a { scrollstuff++; 218f0: 80 91 62 0d lds r24, 0x0D62 ; 0x800d62 218f4: 8f 5f subi r24, 0xFF ; 255 218f6: 80 93 62 0d sts 0x0D62, r24 ; 0x800d62 218fa: b2 cf rjmp .-156 ; 0x21860 218fc: 40 e2 ldi r20, 0x20 ; 32 218fe: 5e e4 ldi r21, 0x4E ; 78 21900: 60 e0 ldi r22, 0x00 ; 0 21902: 70 e0 ldi r23, 0x00 ; 0 21904: 8a e7 ldi r24, 0x7A ; 122 21906: 94 e0 ldi r25, 0x04 ; 4 21908: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> 2190c: 81 11 cpse r24, r1 2190e: e0 cf rjmp .-64 ; 0x218d0 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) 21910: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 21914: 81 11 cpse r24, r1 21916: 1c c0 rjmp .+56 ; 0x21950 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 21918: e0 91 5d 06 lds r30, 0x065D ; 0x80065d 2191c: ea 30 cpi r30, 0x0A ; 10 2191e: 08 f0 brcs .+2 ; 0x21922 21920: 9f cf rjmp .-194 ; 0x21860 21922: f0 e0 ldi r31, 0x00 ; 0 21924: 88 27 eor r24, r24 21926: e8 56 subi r30, 0x68 ; 104 21928: f3 4f sbci r31, 0xF3 ; 243 2192a: 8e 4f sbci r24, 0xFE ; 254 2192c: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 21930: 22 38 cpi r18, 0x82 ; 130 21932: 02 37 cpi r16, 0x72 ; 114 21934: 22 38 cpi r18, 0x82 ; 130 21936: e0 36 cpi r30, 0x60 ; 96 21938: e4 36 cpi r30, 0x64 ; 100 2193a: 8a 37 cpi r24, 0x7A ; 122 2193c: 22 38 cpi r18, 0x82 ; 130 2193e: 22 38 cpi r18, 0x82 ; 130 21940: 42 37 cpi r20, 0x72 ; 114 21942: 22 38 cpi r18, 0x82 ; 130 (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); 21944: 89 ed ldi r24, 0xD9 ; 217 21946: 93 e1 ldi r25, 0x13 ; 19 21948: ca cf rjmp .-108 ; 0x218de if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 2194a: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 2194e: 88 cf rjmp .-240 ; 0x21860 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 21950: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.424> 21954: 88 23 and r24, r24 21956: 01 f3 breq .-64 ; 0x21918 * 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; 21958: 0f 94 56 0b call 0x216ac ; 0x216ac 2195c: 00 91 7b 04 lds r16, 0x047B ; 0x80047b <_ZL26lcd_status_message_timeout.lto_priv.424+0x1> 21960: 10 91 7c 04 lds r17, 0x047C ; 0x80047c <_ZL26lcd_status_message_timeout.lto_priv.424+0x2> 21964: 20 91 7d 04 lds r18, 0x047D ; 0x80047d <_ZL26lcd_status_message_timeout.lto_priv.424+0x3> 21968: 30 91 7e 04 lds r19, 0x047E ; 0x80047e <_ZL26lcd_status_message_timeout.lto_priv.424+0x4> 2196c: 60 1b sub r22, r16 2196e: 71 0b sbc r23, r17 21970: 82 0b sbc r24, r18 21972: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 21974: 60 3a cpi r22, 0xA0 ; 160 21976: 7f 40 sbci r23, 0x0F ; 15 21978: 81 05 cpc r24, r1 2197a: 91 05 cpc r25, r1 2197c: 68 f6 brcc .-102 ; 0x21918 2197e: 70 cf rjmp .-288 ; 0x21860 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); 21980: 63 e0 ldi r22, 0x03 ; 3 21982: 80 91 64 04 lds r24, 0x0464 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.420> 21986: 0e 94 2a 6f call 0xde54 ; 0xde54 const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 2198a: 80 91 64 04 lds r24, 0x0464 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.420> 2198e: c4 e1 ldi r28, 0x14 ; 20 21990: 6c 2f mov r22, r28 21992: 68 1b sub r22, r24 21994: 90 e0 ldi r25, 0x00 ; 0 21996: 8b 59 subi r24, 0x9B ; 155 21998: 9b 4f sbci r25, 0xFB ; 251 2199a: 0e 94 17 73 call 0xe62e ; 0xe62e lcd_status_message_idx = LCD_WIDTH - padding; 2199e: c8 1b sub r28, r24 219a0: c0 93 64 04 sts 0x0464, r28 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.420> 219a4: 5d cf rjmp .-326 ; 0x21860 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 219a6: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 219aa: 8b 30 cpi r24, 0x0B ; 11 219ac: 08 f1 brcs .+66 ; 0x219f0 lcd_set_cursor(0, 3); 219ae: 63 e0 ldi r22, 0x03 ; 3 219b0: 80 e0 ldi r24, 0x00 ; 0 219b2: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_space(LCD_WIDTH); 219b6: 84 e1 ldi r24, 0x14 ; 20 219b8: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 219bc: 8c e3 ldi r24, 0x3C ; 60 219be: 96 e5 ldi r25, 0x56 ; 86 219c0: 0e 94 0a 75 call 0xea14 ; 0xea14 219c4: ac 01 movw r20, r24 219c6: 63 e0 ldi r22, 0x03 ; 3 219c8: 80 e0 ldi r24, 0x00 ; 0 219ca: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_P(PSTR(" : ")); 219ce: 8f e7 ldi r24, 0x7F ; 127 219d0: 97 e9 ldi r25, 0x97 ; 151 219d2: 0e 94 ed 6e call 0xddda ; 0xddda lcd_print(custom_message_state - 10); 219d6: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 219da: 6a 50 subi r22, 0x0A ; 10 219dc: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 219de: 07 2e mov r0, r23 219e0: 00 0c add r0, r0 219e2: 88 0b sbc r24, r24 219e4: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 219e6: cf 91 pop r28 219e8: 1f 91 pop r17 219ea: 0f 91 pop r16 219ec: 0c 94 ab 71 jmp 0xe356 ; 0xe356 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) { 219f0: 83 30 cpi r24, 0x03 ; 3 219f2: 31 f4 brne .+12 ; 0x21a00 lcd_setstatuspgm(MSG_WELCOME); 219f4: 86 ee ldi r24, 0xE6 ; 230 219f6: 9b e6 ldi r25, 0x6B ; 107 219f8: 0e 94 85 dc call 0x1b90a ; 0x1b90a custom_message_type = CustomMsg::Status; 219fc: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } if (custom_message_state > 3 && custom_message_state <= 10) { 21a00: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21a04: 84 50 subi r24, 0x04 ; 4 21a06: 87 30 cpi r24, 0x07 ; 7 21a08: 08 f0 brcs .+2 ; 0x21a0c 21a0a: 2a cf rjmp .-428 ; 0x21860 lcd_set_cursor(0, 3); 21a0c: 63 e0 ldi r22, 0x03 ; 3 21a0e: 80 e0 ldi r24, 0x00 ; 0 21a10: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_space(19); 21a14: 83 e1 ldi r24, 0x13 ; 19 21a16: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 21a1a: 89 e2 ldi r24, 0x29 ; 41 21a1c: 96 e5 ldi r25, 0x56 ; 86 21a1e: 0e 94 0a 75 call 0xea14 ; 0xea14 21a22: ac 01 movw r20, r24 21a24: 63 e0 ldi r22, 0x03 ; 3 21a26: 80 e0 ldi r24, 0x00 ; 0 21a28: 0e 94 d7 6f call 0xdfae ; 0xdfae custom_message_state--; 21a2c: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21a30: 81 50 subi r24, 0x01 ; 1 21a32: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de 21a36: 14 cf rjmp .-472 ; 0x21860 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 21a38: 64 e1 ldi r22, 0x14 ; 20 21a3a: 85 e6 ldi r24, 0x65 ; 101 21a3c: 94 e0 ldi r25, 0x04 ; 4 21a3e: 0e 94 17 73 call 0xe62e ; 0xe62e if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 21a42: 20 91 02 06 lds r18, 0x0602 ; 0x800602 21a46: 30 91 03 06 lds r19, 0x0603 ; 0x800603 21a4a: 80 91 00 06 lds r24, 0x0600 ; 0x800600 21a4e: 90 91 01 06 lds r25, 0x0601 ; 0x800601 21a52: 82 17 cp r24, r18 21a54: 93 07 cpc r25, r19 21a56: 0c f4 brge .+2 ; 0x21a5a 21a58: 03 cf rjmp .-506 ; 0x21860 21a5a: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21a5e: 88 23 and r24, r24 21a60: 09 f4 brne .+2 ; 0x21a64 21a62: fe ce rjmp .-516 ; 0x21860 lcd_set_cursor(10, 3); 21a64: 63 e0 ldi r22, 0x03 ; 3 21a66: 8a e0 ldi r24, 0x0A ; 10 21a68: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 21a6c: 80 91 01 06 lds r24, 0x0601 ; 0x800601 21a70: 8f 93 push r24 21a72: 80 91 00 06 lds r24, 0x0600 ; 0x800600 21a76: 8f 93 push r24 21a78: 80 91 03 06 lds r24, 0x0603 ; 0x800603 21a7c: 8f 93 push r24 21a7e: 80 91 02 06 lds r24, 0x0602 ; 0x800602 21a82: 8f 93 push r24 21a84: 86 e7 ldi r24, 0x76 ; 118 21a86: 97 e9 ldi r25, 0x97 ; 151 } 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); 21a88: 9f 93 push r25 21a8a: 8f 93 push r24 21a8c: 0e 94 db 6e call 0xddb6 ; 0xddb6 21a90: 0f 90 pop r0 21a92: 0f 90 pop r0 21a94: 0f 90 pop r0 21a96: 0f 90 pop r0 21a98: 0f 90 pop r0 21a9a: 0f 90 pop r0 21a9c: e1 ce rjmp .-574 ; 0x21860 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); 21a9e: 63 e0 ldi r22, 0x03 ; 3 21aa0: 80 e0 ldi r24, 0x00 ; 0 21aa2: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 21aa6: c0 91 de 03 lds r28, 0x03DE ; 0x8003de 21aaa: 89 e7 ldi r24, 0x79 ; 121 21aac: 95 e4 ldi r25, 0x45 ; 69 21aae: 0e 94 0a 75 call 0xea14 ; 0xea14 21ab2: 1f 92 push r1 21ab4: cf 93 push r28 21ab6: 9f 93 push r25 21ab8: 8f 93 push r24 21aba: 88 e6 ldi r24, 0x68 ; 104 21abc: 97 e9 ldi r25, 0x97 ; 151 21abe: e4 cf rjmp .-56 ; 0x21a88 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 21ac0: 89 e1 ldi r24, 0x19 ; 25 21ac2: 96 e5 ldi r25, 0x56 ; 86 21ac4: 0e 94 0a 75 call 0xea14 ; 0xea14 21ac8: ac 01 movw r20, r24 21aca: 63 e0 ldi r22, 0x03 ; 3 21acc: 80 e0 ldi r24, 0x00 ; 0 21ace: 0e 94 d7 6f call 0xdfae ; 0xdfae if (custom_message_state <= PINDA_HEAT_T) { 21ad2: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21ad6: 89 37 cpi r24, 0x79 ; 121 21ad8: 08 f0 brcs .+2 ; 0x21adc 21ada: c2 ce rjmp .-636 ; 0x21860 lcd_puts_P(PSTR(": ")); 21adc: 85 e6 ldi r24, 0x65 ; 101 21ade: 97 e9 ldi r25, 0x97 ; 151 21ae0: 0e 94 ed 6e call 0xddda ; 0xddda } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 21ae4: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21ae8: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 21aec: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 21aee: cf 91 pop r28 21af0: 1f 91 pop r17 21af2: 0f 91 pop r16 21af4: 0c 94 72 70 jmp 0xe0e4 ; 0xe0e4 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 21af8: 88 e0 ldi r24, 0x08 ; 8 21afa: 96 e5 ldi r25, 0x56 ; 86 21afc: be ce rjmp .-644 ; 0x2187a 00021afe ::start()>: /** * @brief Start timer */ template void Timer::start() 21afe: cf 93 push r28 21b00: df 93 push r29 21b02: ec 01 movw r28, r24 { m_started = _millis(); 21b04: 0f 94 56 0b call 0x216ac ; 0x216ac 21b08: 69 83 std Y+1, r22 ; 0x01 21b0a: 7a 83 std Y+2, r23 ; 0x02 21b0c: 8b 83 std Y+3, r24 ; 0x03 21b0e: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 21b10: 81 e0 ldi r24, 0x01 ; 1 21b12: 88 83 st Y, r24 } 21b14: df 91 pop r29 21b16: cf 91 pop r28 21b18: 08 95 ret 00021b1a : //! 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) { 21b1a: cf 92 push r12 21b1c: df 92 push r13 21b1e: ef 92 push r14 21b20: ff 92 push r15 21b22: 1f 93 push r17 21b24: cf 93 push r28 21b26: df 93 push r29 21b28: cd b7 in r28, 0x3d ; 61 21b2a: de b7 in r29, 0x3e ; 62 21b2c: 64 97 sbiw r28, 0x14 ; 20 21b2e: 0f b6 in r0, 0x3f ; 63 21b30: f8 94 cli 21b32: de bf out 0x3e, r29 ; 62 21b34: 0f be out 0x3f, r0 ; 63 21b36: cd bf out 0x3d, r28 ; 61 21b38: 7c 01 movw r14, r24 21b3a: 16 2f mov r17, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 21b3c: 6e e2 ldi r22, 0x2E ; 46 21b3e: 77 e9 ldi r23, 0x97 ; 151 21b40: ce 01 movw r24, r28 21b42: 01 96 adiw r24, 0x01 ; 1 21b44: 0f 94 54 a1 call 0x342a8 ; 0x342a8 strcat_P(msg, type); 21b48: b7 01 movw r22, r14 21b4a: ce 01 movw r24, r28 21b4c: 01 96 adiw r24, 0x01 ; 1 21b4e: 0f 94 40 a1 call 0x34280 ; 0x34280 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 21b52: 83 e0 ldi r24, 0x03 ; 3 21b54: 0e 94 07 d8 call 0x1b00e ; 0x1b00e 21b58: 88 23 and r24, r24 21b5a: e1 f0 breq .+56 ; 0x21b94 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 21b5c: be 01 movw r22, r28 21b5e: 6f 5f subi r22, 0xFF ; 255 21b60: 7f 4f sbci r23, 0xFF ; 255 21b62: 85 e6 ldi r24, 0x65 ; 101 21b64: 94 e0 ldi r25, 0x04 ; 4 21b66: 0f 94 ff a9 call 0x353fe ; 0x353fe 21b6a: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 21b6c: 8a e7 ldi r24, 0x7A ; 122 21b6e: 94 e0 ldi r25, 0x04 ; 4 21b70: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> lcd_status_message_level = severity; 21b74: 83 e0 ldi r24, 0x03 ; 3 21b76: 80 93 c0 03 sts 0x03C0, r24 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> custom_message_type = CustomMsg::Status; 21b7a: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d custom_message_state = 0; 21b7e: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de if (!same) { 21b82: cd 28 or r12, r13 21b84: 39 f0 breq .+14 ; 0x21b94 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 21b86: 60 e0 ldi r22, 0x00 ; 0 21b88: ce 01 movw r24, r28 21b8a: 01 96 adiw r24, 0x01 ; 1 21b8c: 0e 94 ec d7 call 0x1afd8 ; 0x1afd8 lcd_return_to_status(); 21b90: 0f 94 6d 05 call 0x20ada ; 0x20ada lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 21b94: 81 eb ldi r24, 0xB1 ; 177 21b96: 91 ea ldi r25, 0xA1 ; 161 21b98: 0e 94 94 7a call 0xf528 ; 0xf528 if(e != EXTRUDERS) { 21b9c: 11 30 cpi r17, 0x01 ; 1 21b9e: 51 f0 breq .+20 ; 0x21bb4 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 21ba0: 61 2f mov r22, r17 21ba2: 70 e0 ldi r23, 0x00 ; 0 21ba4: 90 e0 ldi r25, 0x00 ; 0 21ba6: 80 e0 ldi r24, 0x00 ; 0 21ba8: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 21bac: 8b e2 ldi r24, 0x2B ; 43 21bae: 97 e9 ldi r25, 0x97 ; 151 21bb0: 0e 94 94 7a call 0xf528 ; 0xf528 } SERIAL_ERRORPGM("Heaters switched off. "); 21bb4: 84 e1 ldi r24, 0x14 ; 20 21bb6: 97 e9 ldi r25, 0x97 ; 151 21bb8: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORRPGM(type); 21bbc: c7 01 movw r24, r14 21bbe: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORLNPGM(" triggered!"); 21bc2: 88 e0 ldi r24, 0x08 ; 8 21bc4: 97 e9 ldi r25, 0x97 ; 151 21bc6: 0e 94 8d 7c call 0xf91a ; 0xf91a } 21bca: 64 96 adiw r28, 0x14 ; 20 21bcc: 0f b6 in r0, 0x3f ; 63 21bce: f8 94 cli 21bd0: de bf out 0x3e, r29 ; 62 21bd2: 0f be out 0x3f, r0 ; 63 21bd4: cd bf out 0x3d, r28 ; 61 21bd6: df 91 pop r29 21bd8: cf 91 pop r28 21bda: 1f 91 pop r17 21bdc: ff 90 pop r15 21bde: ef 90 pop r14 21be0: df 90 pop r13 21be2: cf 90 pop r12 21be4: 08 95 ret 00021be6 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 21be6: 1f 92 push r1 21be8: 0f 92 push r0 21bea: 0f b6 in r0, 0x3f ; 63 21bec: 0f 92 push r0 21bee: 11 24 eor r1, r1 21bf0: 2f 93 push r18 21bf2: 3f 93 push r19 21bf4: 8f 93 push r24 21bf6: 9f 93 push r25 21bf8: af 93 push r26 21bfa: 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; 21bfc: 80 91 f8 05 lds r24, 0x05F8 ; 0x8005f8 21c00: 90 91 f9 05 lds r25, 0x05F9 ; 0x8005f9 21c04: a0 91 fa 05 lds r26, 0x05FA ; 0x8005fa 21c08: b0 91 fb 05 lds r27, 0x05FB ; 0x8005fb unsigned char f = timer2_fract; 21c0c: 30 91 f7 05 lds r19, 0x05F7 ; 0x8005f7 m += MILLIS_INC; f += FRACT_INC; 21c10: 23 e0 ldi r18, 0x03 ; 3 21c12: 23 0f add r18, r19 if (f >= FRACT_MAX) 21c14: 2d 37 cpi r18, 0x7D ; 125 21c16: 58 f5 brcc .+86 ; 0x21c6e <__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; 21c18: 01 96 adiw r24, 0x01 ; 1 21c1a: a1 1d adc r26, r1 21c1c: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 21c1e: 20 93 f7 05 sts 0x05F7, r18 ; 0x8005f7 timer2_millis = m; 21c22: 80 93 f8 05 sts 0x05F8, r24 ; 0x8005f8 21c26: 90 93 f9 05 sts 0x05F9, r25 ; 0x8005f9 21c2a: a0 93 fa 05 sts 0x05FA, r26 ; 0x8005fa 21c2e: b0 93 fb 05 sts 0x05FB, r27 ; 0x8005fb timer2_overflow_count++; 21c32: 80 91 fc 05 lds r24, 0x05FC ; 0x8005fc 21c36: 90 91 fd 05 lds r25, 0x05FD ; 0x8005fd 21c3a: a0 91 fe 05 lds r26, 0x05FE ; 0x8005fe 21c3e: b0 91 ff 05 lds r27, 0x05FF ; 0x8005ff 21c42: 01 96 adiw r24, 0x01 ; 1 21c44: a1 1d adc r26, r1 21c46: b1 1d adc r27, r1 21c48: 80 93 fc 05 sts 0x05FC, r24 ; 0x8005fc 21c4c: 90 93 fd 05 sts 0x05FD, r25 ; 0x8005fd 21c50: a0 93 fe 05 sts 0x05FE, r26 ; 0x8005fe 21c54: b0 93 ff 05 sts 0x05FF, r27 ; 0x8005ff } 21c58: bf 91 pop r27 21c5a: af 91 pop r26 21c5c: 9f 91 pop r25 21c5e: 8f 91 pop r24 21c60: 3f 91 pop r19 21c62: 2f 91 pop r18 21c64: 0f 90 pop r0 21c66: 0f be out 0x3f, r0 ; 63 21c68: 0f 90 pop r0 21c6a: 1f 90 pop r1 21c6c: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 21c6e: 26 e8 ldi r18, 0x86 ; 134 21c70: 23 0f add r18, r19 m += 1; 21c72: 02 96 adiw r24, 0x02 ; 2 21c74: a1 1d adc r26, r1 21c76: b1 1d adc r27, r1 21c78: d2 cf rjmp .-92 ; 0x21c1e <__vector_15+0x38> 00021c7a : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 21c7a: cf 93 push r28 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 21c7c: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 21c80: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 21c84: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 21c88: 10 92 59 12 sts 0x1259, r1 ; 0x801259 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 21c8c: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 21c8e: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 21c90: 0e 94 f9 ff call 0x1fff2 ; 0x1fff2 temp_mgr_pid(); 21c94: 0e 94 36 fd call 0x1fa6c ; 0x1fa6c // 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); 21c98: 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; 21c9a: 10 92 28 06 sts 0x0628, r1 ; 0x800628 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 21c9e: cf bf out 0x3f, r28 ; 63 #endif } } 21ca0: cf 91 pop r28 21ca2: 08 95 ret 00021ca4 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 21ca4: 0f 94 3d 0e call 0x21c7a ; 0x21c7a fanSpeed = 0; 21ca8: 10 92 55 12 sts 0x1255, r1 ; 0x801255 lcd_return_to_status(); 21cac: 0d 94 6d 05 jmp 0x20ada ; 0x20ada 00021cb0 : // 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) { 21cb0: 1f 93 push r17 21cb2: cf 93 push r28 21cb4: df 93 push r29 21cb6: c8 2f mov r28, r24 21cb8: 16 2f mov r17, r22 21cba: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 21cbc: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 21cc0: 80 fd sbrc r24, 0 21cc2: 18 c0 rjmp .+48 ; 0x21cf4 21cc4: 80 91 73 12 lds r24, 0x1273 ; 0x801273 21cc8: 81 11 cpse r24, r1 21cca: 14 c0 rjmp .+40 ; 0x21cf4 saved_bed_temperature = target_temperature_bed; 21ccc: 80 91 59 12 lds r24, 0x1259 ; 0x801259 21cd0: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_temperature = target_temperature[index]; 21cd4: e6 2f mov r30, r22 21cd6: f0 e0 ldi r31, 0x00 ; 0 21cd8: ee 0f add r30, r30 21cda: ff 1f adc r31, r31 21cdc: e3 5a subi r30, 0xA3 ; 163 21cde: fd 4e sbci r31, 0xED ; 237 21ce0: 80 81 ld r24, Z 21ce2: 91 81 ldd r25, Z+1 ; 0x01 21ce4: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c 21ce8: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_fan_speed = fanSpeed; 21cec: 80 91 55 12 lds r24, 0x1255 ; 0x801255 21cf0: 80 93 54 12 sts 0x1254, r24 ; 0x801254 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 21cf4: 0f 94 3d 0e call 0x21c7a ; 0x21c7a void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 21cf8: 0e 94 72 77 call 0xeee4 ; 0xeee4 setExtruderAutoFanState(3); 21cfc: 83 e0 ldi r24, 0x03 ; 3 21cfe: 0e 94 7f 77 call 0xeefe ; 0xeefe SET_OUTPUT(FAN_PIN); 21d02: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 21d06: 88 60 ori r24, 0x08 ; 8 21d08: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 21d0c: 8f ef ldi r24, 0xFF ; 255 21d0e: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 21d12: 80 93 55 12 sts 0x1255, r24 ; 0x801255 hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 21d16: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 21d1a: 80 ff sbrs r24, 0 21d1c: 07 c0 rjmp .+14 ; 0x21d2c 21d1e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 21d22: 82 95 swap r24 21d24: 86 95 lsr r24 21d26: 87 70 andi r24, 0x07 ; 7 21d28: d8 17 cp r29, r24 21d2a: c0 f4 brcc .+48 ; 0x21d5c temp_error_state.source = (uint8_t)source; 21d2c: c3 70 andi r28, 0x03 ; 3 21d2e: cc 0f add r28, r28 21d30: cc 0f add r28, r28 21d32: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 21d36: 83 7f andi r24, 0xF3 ; 243 21d38: 8c 2b or r24, r28 21d3a: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> temp_error_state.index = index; 21d3e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 21d42: 10 fb bst r17, 0 21d44: 84 f9 bld r24, 4 21d46: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> temp_error_state.type = (uint8_t)type; 21d4a: d2 95 swap r29 21d4c: dd 0f add r29, r29 21d4e: d0 7e andi r29, 0xE0 ; 224 21d50: 40 91 cc 03 lds r20, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 21d54: 4f 71 andi r20, 0x1F ; 31 21d56: 4d 2b or r20, r29 21d58: 40 93 cc 03 sts 0x03CC, r20 ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> } // always set the error state temp_error_state.error = true; 21d5c: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 21d60: 81 60 ori r24, 0x01 ; 1 21d62: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> temp_error_state.assert = true; 21d66: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 21d6a: 82 60 ori r24, 0x02 ; 2 21d6c: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> } 21d70: df 91 pop r29 21d72: cf 91 pop r28 21d74: 1f 91 pop r17 21d76: 08 95 ret 00021d78 : 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) { 21d78: 2f 92 push r2 21d7a: 3f 92 push r3 21d7c: 4f 92 push r4 21d7e: 5f 92 push r5 21d80: 6f 92 push r6 21d82: 7f 92 push r7 21d84: 8f 92 push r8 21d86: 9f 92 push r9 21d88: af 92 push r10 21d8a: bf 92 push r11 21d8c: cf 92 push r12 21d8e: df 92 push r13 21d90: ef 92 push r14 21d92: ff 92 push r15 21d94: 0f 93 push r16 21d96: 1f 93 push r17 21d98: cf 93 push r28 21d9a: df 93 push r29 21d9c: cd b7 in r28, 0x3d ; 61 21d9e: de b7 in r29, 0x3e ; 62 21da0: 2c 97 sbiw r28, 0x0c ; 12 21da2: 0f b6 in r0, 0x3f ; 63 21da4: f8 94 cli 21da6: de bf out 0x3e, r29 ; 62 21da8: 0f be out 0x3f, r0 ; 63 21daa: cd bf out 0x3d, r28 ; 61 21dac: 28 2e mov r2, r24 21dae: 49 83 std Y+1, r20 ; 0x01 21db0: 5a 83 std Y+2, r21 ; 0x02 21db2: 6b 83 std Y+3, r22 ; 0x03 21db4: 7c 83 std Y+4, r23 ; 0x04 21db6: 28 01 movw r4, r16 21db8: 39 01 movw r6, r18 21dba: 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) 21dbc: 0f 94 56 0b call 0x216ac ; 0x216ac 21dc0: 02 2d mov r16, r2 21dc2: 10 e0 ldi r17, 0x00 ; 0 21dc4: 98 01 movw r18, r16 21dc6: 22 0f add r18, r18 21dc8: 33 1f adc r19, r19 21dca: 22 0f add r18, r18 21dcc: 33 1f adc r19, r19 21dce: 3c 87 std Y+12, r19 ; 0x0c 21dd0: 2b 87 std Y+11, r18 ; 0x0b 21dd2: f9 01 movw r30, r18 21dd4: e4 56 subi r30, 0x64 ; 100 21dd6: fa 4f sbci r31, 0xFA ; 250 21dd8: 80 80 ld r8, Z 21dda: 91 80 ldd r9, Z+1 ; 0x01 21ddc: a2 80 ldd r10, Z+2 ; 0x02 21dde: b3 80 ldd r11, Z+3 ; 0x03 21de0: 68 19 sub r22, r8 21de2: 79 09 sbc r23, r9 21de4: 8a 09 sbc r24, r10 21de6: 9b 09 sbc r25, r11 21de8: 61 3d cpi r22, 0xD1 ; 209 21dea: 77 40 sbci r23, 0x07 ; 7 21dec: 81 05 cpc r24, r1 21dee: 91 05 cpc r25, r1 21df0: 08 f4 brcc .+2 ; 0x21df4 21df2: ea c0 rjmp .+468 ; 0x21fc8 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 21df4: 33 20 and r3, r3 21df6: 09 f4 brne .+2 ; 0x21dfa 21df8: 75 c0 rjmp .+234 ; 0x21ee4 { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 21dfa: 88 e6 ldi r24, 0x68 ; 104 21dfc: 91 e0 ldi r25, 0x01 ; 1 21dfe: 9a 87 std Y+10, r25 ; 0x0a 21e00: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 21e02: 80 e0 ldi r24, 0x00 ; 0 21e04: 90 e0 ldi r25, 0x00 ; 0 21e06: a0 ea ldi r26, 0xA0 ; 160 21e08: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 21e0a: 8d 83 std Y+5, r24 ; 0x05 21e0c: 9e 83 std Y+6, r25 ; 0x06 21e0e: af 83 std Y+7, r26 ; 0x07 21e10: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 21e12: 0f 94 56 0b call 0x216ac ; 0x216ac 21e16: eb 85 ldd r30, Y+11 ; 0x0b 21e18: fc 85 ldd r31, Y+12 ; 0x0c 21e1a: e4 56 subi r30, 0x64 ; 100 21e1c: fa 4f sbci r31, 0xFA ; 250 21e1e: 60 83 st Z, r22 21e20: 71 83 std Z+1, r23 ; 0x01 21e22: 82 83 std Z+2, r24 ; 0x02 21e24: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 21e26: 20 e0 ldi r18, 0x00 ; 0 21e28: 30 e0 ldi r19, 0x00 ; 0 21e2a: a9 01 movw r20, r18 21e2c: c7 01 movw r24, r14 21e2e: b6 01 movw r22, r12 21e30: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 21e34: 81 11 cpse r24, r1 21e36: 07 c0 rjmp .+14 ; 0x21e46 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 21e38: f8 01 movw r30, r16 21e3a: ee 0f add r30, r30 21e3c: ff 1f adc r31, r31 21e3e: e8 56 subi r30, 0x68 ; 104 21e40: fa 4f sbci r31, 0xFA ; 250 21e42: 11 82 std Z+1, r1 ; 0x01 21e44: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 21e46: ab 85 ldd r26, Y+11 ; 0x0b 21e48: bc 85 ldd r27, Y+12 ; 0x0c 21e4a: a0 57 subi r26, 0x70 ; 112 21e4c: ba 4f sbci r27, 0xFA ; 250 21e4e: 5d 01 movw r10, r26 21e50: 29 81 ldd r18, Y+1 ; 0x01 21e52: 3a 81 ldd r19, Y+2 ; 0x02 21e54: 4b 81 ldd r20, Y+3 ; 0x03 21e56: 5c 81 ldd r21, Y+4 ; 0x04 21e58: 6d 91 ld r22, X+ 21e5a: 7d 91 ld r23, X+ 21e5c: 8d 91 ld r24, X+ 21e5e: 9c 91 ld r25, X 21e60: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 21e64: 88 23 and r24, r24 21e66: 09 f4 brne .+2 ; 0x21e6a 21e68: 91 c0 rjmp .+290 ; 0x21f8c { if (_target_temperature > 0) 21e6a: 20 e0 ldi r18, 0x00 ; 0 21e6c: 30 e0 ldi r19, 0x00 ; 0 21e6e: a9 01 movw r20, r18 21e70: 69 81 ldd r22, Y+1 ; 0x01 21e72: 7a 81 ldd r23, Y+2 ; 0x02 21e74: 8b 81 ldd r24, Y+3 ; 0x03 21e76: 9c 81 ldd r25, Y+4 ; 0x04 21e78: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 21e7c: f8 01 movw r30, r16 21e7e: e2 57 subi r30, 0x72 ; 114 21e80: fa 4f sbci r31, 0xFA ; 250 21e82: 18 16 cp r1, r24 21e84: c4 f5 brge .+112 ; 0x21ef6 { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 21e86: 81 e0 ldi r24, 0x01 ; 1 21e88: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 21e8a: 89 81 ldd r24, Y+1 ; 0x01 21e8c: 9a 81 ldd r25, Y+2 ; 0x02 21e8e: ab 81 ldd r26, Y+3 ; 0x03 21e90: bc 81 ldd r27, Y+4 ; 0x04 21e92: f5 01 movw r30, r10 21e94: 80 83 st Z, r24 21e96: 91 83 std Z+1, r25 ; 0x01 21e98: a2 83 std Z+2, r26 ; 0x02 21e9a: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 21e9c: eb 85 ldd r30, Y+11 ; 0x0b 21e9e: fc 85 ldd r31, Y+12 ; 0x0c 21ea0: ea 57 subi r30, 0x7A ; 122 21ea2: fa 4f sbci r31, 0xFA ; 250 21ea4: 40 82 st Z, r4 21ea6: 51 82 std Z+1, r5 ; 0x01 21ea8: 62 82 std Z+2, r6 ; 0x02 21eaa: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 21eac: f8 01 movw r30, r16 21eae: ec 57 subi r30, 0x7C ; 124 21eb0: fa 4f sbci r31, 0xFA ; 250 21eb2: 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)) 21eb4: a3 01 movw r20, r6 21eb6: 92 01 movw r18, r4 21eb8: bc 01 movw r22, r24 21eba: cd 01 movw r24, r26 21ebc: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 21ec0: 18 16 cp r1, r24 21ec2: 1c f5 brge .+70 ; 0x21f0a { __preheat_counter[_heater_id]++; 21ec4: f8 01 movw r30, r16 21ec6: ec 57 subi r30, 0x7C ; 124 21ec8: fa 4f sbci r31, 0xFA ; 250 21eca: 80 81 ld r24, Z 21ecc: 8f 5f subi r24, 0xFF ; 255 21ece: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 21ed0: 31 10 cpse r3, r1 21ed2: c7 c0 rjmp .+398 ; 0x22062 21ed4: 89 30 cpi r24, 0x09 ; 9 21ed6: c8 f0 brcs .+50 ; 0x21f0a { __delta=2.0; 21ed8: 81 2c mov r8, r1 21eda: 91 2c mov r9, r1 21edc: a1 2c mov r10, r1 21ede: 50 e4 ldi r21, 0x40 ; 64 21ee0: b5 2e mov r11, r21 21ee2: e8 c0 rjmp .+464 ; 0x220b4 #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 21ee4: ad e2 ldi r26, 0x2D ; 45 21ee6: b0 e0 ldi r27, 0x00 ; 0 21ee8: ba 87 std Y+10, r27 ; 0x0a 21eea: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 21eec: 80 e0 ldi r24, 0x00 ; 0 21eee: 90 e0 ldi r25, 0x00 ; 0 21ef0: a0 e7 ldi r26, 0x70 ; 112 21ef2: b1 e4 ldi r27, 0x41 ; 65 21ef4: 8a cf rjmp .-236 ; 0x21e0a __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 21ef6: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 21ef8: 89 81 ldd r24, Y+1 ; 0x01 21efa: 9a 81 ldd r25, Y+2 ; 0x02 21efc: ab 81 ldd r26, Y+3 ; 0x03 21efe: bc 81 ldd r27, Y+4 ; 0x04 21f00: f5 01 movw r30, r10 21f02: 80 83 st Z, r24 21f04: 91 83 std Z+1, r25 ; 0x01 21f06: a2 83 std Z+2, r26 ; 0x02 21f08: 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) 21f0a: 2d 81 ldd r18, Y+5 ; 0x05 21f0c: 3e 81 ldd r19, Y+6 ; 0x06 21f0e: 4f 81 ldd r20, Y+7 ; 0x07 21f10: 58 85 ldd r21, Y+8 ; 0x08 21f12: 69 81 ldd r22, Y+1 ; 0x01 21f14: 7a 81 ldd r23, Y+2 ; 0x02 21f16: 8b 81 ldd r24, Y+3 ; 0x03 21f18: 9c 81 ldd r25, Y+4 ; 0x04 21f1a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 21f1e: a3 01 movw r20, r6 21f20: 92 01 movw r18, r4 21f22: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 21f26: 87 ff sbrs r24, 7 21f28: 46 c0 rjmp .+140 ; 0x21fb6 21f2a: f8 01 movw r30, r16 21f2c: e2 57 subi r30, 0x72 ; 114 21f2e: fa 4f sbci r31, 0xFA ; 250 21f30: 80 81 ld r24, Z 21f32: 81 30 cpi r24, 0x01 ; 1 21f34: 49 f4 brne .+18 ; 0x21f48 { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 21f36: 82 e0 ldi r24, 0x02 ; 2 21f38: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 21f3a: f8 01 movw r30, r16 21f3c: ee 0f add r30, r30 21f3e: ff 1f adc r31, r31 21f40: e8 56 subi r30, 0x68 ; 104 21f42: fa 4f sbci r31, 0xFA ; 250 21f44: 11 82 std Z+1, r1 ; 0x01 21f46: 10 82 st Z, r1 } if (_output > 0) 21f48: 20 e0 ldi r18, 0x00 ; 0 21f4a: 30 e0 ldi r19, 0x00 ; 0 21f4c: a9 01 movw r20, r18 21f4e: c7 01 movw r24, r14 21f50: b6 01 movw r22, r12 21f52: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 21f56: 18 16 cp r1, r24 21f58: bc f5 brge .+110 ; 0x21fc8 if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 21f5a: 29 81 ldd r18, Y+1 ; 0x01 21f5c: 3a 81 ldd r19, Y+2 ; 0x02 21f5e: 4b 81 ldd r20, Y+3 ; 0x03 21f60: 5c 81 ldd r21, Y+4 ; 0x04 21f62: 6d 81 ldd r22, Y+5 ; 0x05 21f64: 7e 81 ldd r23, Y+6 ; 0x06 21f66: 8f 81 ldd r24, Y+7 ; 0x07 21f68: 98 85 ldd r25, Y+8 ; 0x08 21f6a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 21f6e: a3 01 movw r20, r6 21f70: 92 01 movw r18, r4 21f72: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 21f76: 18 16 cp r1, r24 21f78: 0c f0 brlt .+2 ; 0x21f7c 21f7a: 3f c0 rjmp .+126 ; 0x21ffa { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 21f7c: 00 0f add r16, r16 21f7e: 11 1f adc r17, r17 21f80: f8 01 movw r30, r16 21f82: e8 56 subi r30, 0x68 ; 104 21f84: fa 4f sbci r31, 0xFA ; 250 21f86: 11 82 std Z+1, r1 ; 0x01 21f88: 10 82 st Z, r1 21f8a: 1e c0 rjmp .+60 ; 0x21fc8 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)) 21f8c: a3 01 movw r20, r6 21f8e: 92 01 movw r18, r4 21f90: 69 81 ldd r22, Y+1 ; 0x01 21f92: 7a 81 ldd r23, Y+2 ; 0x02 21f94: 8b 81 ldd r24, Y+3 ; 0x03 21f96: 9c 81 ldd r25, Y+4 ; 0x04 21f98: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 21f9c: 18 16 cp r1, r24 21f9e: 0c f0 brlt .+2 ; 0x21fa2 21fa0: b4 cf rjmp .-152 ; 0x21f0a 21fa2: f8 01 movw r30, r16 21fa4: e2 57 subi r30, 0x72 ; 114 21fa6: fa 4f sbci r31, 0xFA ; 250 21fa8: 80 81 ld r24, Z 21faa: 81 30 cpi r24, 0x01 ; 1 21fac: 09 f0 breq .+2 ; 0x21fb0 21fae: ad cf rjmp .-166 ; 0x21f0a 21fb0: 89 cf rjmp .-238 ; 0x21ec4 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; 21fb2: 10 82 st Z, r1 21fb4: 97 c0 rjmp .+302 ; 0x220e4 temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 21fb6: 20 e0 ldi r18, 0x00 ; 0 21fb8: 30 e0 ldi r19, 0x00 ; 0 21fba: a9 01 movw r20, r18 21fbc: c7 01 movw r24, r14 21fbe: b6 01 movw r22, r12 21fc0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 21fc4: 18 16 cp r1, r24 21fc6: cc f0 brlt .+50 ; 0x21ffa } } } } } 21fc8: 2c 96 adiw r28, 0x0c ; 12 21fca: 0f b6 in r0, 0x3f ; 63 21fcc: f8 94 cli 21fce: de bf out 0x3e, r29 ; 62 21fd0: 0f be out 0x3f, r0 ; 63 21fd2: cd bf out 0x3d, r28 ; 61 21fd4: df 91 pop r29 21fd6: cf 91 pop r28 21fd8: 1f 91 pop r17 21fda: 0f 91 pop r16 21fdc: ff 90 pop r15 21fde: ef 90 pop r14 21fe0: df 90 pop r13 21fe2: cf 90 pop r12 21fe4: bf 90 pop r11 21fe6: af 90 pop r10 21fe8: 9f 90 pop r9 21fea: 8f 90 pop r8 21fec: 7f 90 pop r7 21fee: 6f 90 pop r6 21ff0: 5f 90 pop r5 21ff2: 4f 90 pop r4 21ff4: 3f 90 pop r3 21ff6: 2f 90 pop r2 21ff8: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 21ffa: f8 01 movw r30, r16 21ffc: e2 57 subi r30, 0x72 ; 114 21ffe: fa 4f sbci r31, 0xFA ; 250 22000: 80 81 ld r24, Z 22002: 82 30 cpi r24, 0x02 ; 2 22004: 08 f3 brcs .-62 ; 0x21fc8 { temp_runaway_error_counter[_heater_id]++; 22006: 00 0f add r16, r16 22008: 11 1f adc r17, r17 2200a: f8 01 movw r30, r16 2200c: e8 56 subi r30, 0x68 ; 104 2200e: fa 4f sbci r31, 0xFA ; 250 22010: 80 81 ld r24, Z 22012: 91 81 ldd r25, Z+1 ; 0x01 22014: 01 96 adiw r24, 0x01 ; 1 22016: 91 83 std Z+1, r25 ; 0x01 22018: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 2201a: 88 0f add r24, r24 2201c: 99 1f adc r25, r25 2201e: e9 85 ldd r30, Y+9 ; 0x09 22020: fa 85 ldd r31, Y+10 ; 0x0a 22022: e8 17 cp r30, r24 22024: f9 07 cpc r31, r25 22026: 80 f6 brcc .-96 ; 0x21fc8 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 22028: 43 e0 ldi r20, 0x03 ; 3 2202a: 62 2d mov r22, r2 2202c: 83 2d mov r24, r3 } } } } } 2202e: 2c 96 adiw r28, 0x0c ; 12 22030: 0f b6 in r0, 0x3f ; 63 22032: f8 94 cli 22034: de bf out 0x3e, r29 ; 62 22036: 0f be out 0x3f, r0 ; 63 22038: cd bf out 0x3d, r28 ; 61 2203a: df 91 pop r29 2203c: cf 91 pop r28 2203e: 1f 91 pop r17 22040: 0f 91 pop r16 22042: ff 90 pop r15 22044: ef 90 pop r14 22046: df 90 pop r13 22048: cf 90 pop r12 2204a: bf 90 pop r11 2204c: af 90 pop r10 2204e: 9f 90 pop r9 22050: 8f 90 pop r8 22052: 7f 90 pop r7 22054: 6f 90 pop r6 22056: 5f 90 pop r5 22058: 4f 90 pop r4 2205a: 3f 90 pop r3 2205c: 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); 2205e: 0d 94 58 0e jmp 0x21cb0 ; 0x21cb0 } 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 22062: 81 31 cpi r24, 0x11 ; 17 22064: 08 f4 brcc .+2 ; 0x22068 22066: 51 cf rjmp .-350 ; 0x21f0a { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 22068: 20 e0 ldi r18, 0x00 ; 0 2206a: 30 e0 ldi r19, 0x00 ; 0 2206c: 44 eb ldi r20, 0xB4 ; 180 2206e: 52 e4 ldi r21, 0x42 ; 66 22070: c3 01 movw r24, r6 22072: b2 01 movw r22, r4 22074: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 22078: 81 2c mov r8, r1 2207a: 91 2c mov r9, r1 2207c: e0 e4 ldi r30, 0x40 ; 64 2207e: ae 2e mov r10, r30 22080: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 22082: 18 16 cp r1, r24 22084: 2c f4 brge .+10 ; 0x22090 22086: 81 2c mov r8, r1 22088: 91 2c mov r9, r1 2208a: a1 2c mov r10, r1 2208c: 70 e4 ldi r23, 0x40 ; 64 2208e: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 22090: 20 e0 ldi r18, 0x00 ; 0 22092: 30 e0 ldi r19, 0x00 ; 0 22094: 42 ed ldi r20, 0xD2 ; 210 22096: 52 e4 ldi r21, 0x42 ; 66 22098: c3 01 movw r24, r6 2209a: b2 01 movw r22, r4 2209c: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 220a0: 18 16 cp r1, r24 220a2: 44 f4 brge .+16 ; 0x220b4 220a4: 6a e9 ldi r22, 0x9A ; 154 220a6: 86 2e mov r8, r22 220a8: 69 e9 ldi r22, 0x99 ; 153 220aa: 96 2e mov r9, r22 220ac: 69 e1 ldi r22, 0x19 ; 25 220ae: a6 2e mov r10, r22 220b0: 6f e3 ldi r22, 0x3F ; 63 220b2: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 220b4: eb 85 ldd r30, Y+11 ; 0x0b 220b6: fc 85 ldd r31, Y+12 ; 0x0c 220b8: ea 57 subi r30, 0x7A ; 122 220ba: fa 4f sbci r31, 0xFA ; 250 220bc: 20 81 ld r18, Z 220be: 31 81 ldd r19, Z+1 ; 0x01 220c0: 42 81 ldd r20, Z+2 ; 0x02 220c2: 53 81 ldd r21, Z+3 ; 0x03 220c4: c3 01 movw r24, r6 220c6: b2 01 movw r22, r4 220c8: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 220cc: a5 01 movw r20, r10 220ce: 94 01 movw r18, r8 220d0: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 220d4: f8 01 movw r30, r16 220d6: ee 57 subi r30, 0x7E ; 126 220d8: fa 4f sbci r31, 0xFA ; 250 220da: 87 ff sbrs r24, 7 220dc: 6a cf rjmp .-300 ; 0x21fb2 __preheat_errors[_heater_id]++; 220de: 80 81 ld r24, Z 220e0: 8f 5f subi r24, 0xFF ; 255 220e2: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 220e4: 80 81 ld r24, Z 220e6: 90 e0 ldi r25, 0x00 ; 0 220e8: 31 10 cpse r3, r1 220ea: 04 c0 rjmp .+8 ; 0x220f4 220ec: 06 97 sbiw r24, 0x06 ; 6 220ee: 4c f0 brlt .+18 ; 0x22102 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 220f0: 80 e0 ldi r24, 0x00 ; 0 220f2: 03 c0 rjmp .+6 ; 0x220fa __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 220f4: 04 97 sbiw r24, 0x04 ; 4 220f6: 2c f0 brlt .+10 ; 0x22102 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 220f8: 81 e0 ldi r24, 0x01 ; 1 220fa: 42 e0 ldi r20, 0x02 ; 2 220fc: 62 2d mov r22, r2 220fe: 0f 94 58 0e call 0x21cb0 ; 0x21cb0 __preheat_start[_heater_id] = _current_temperature; 22102: 2b 85 ldd r18, Y+11 ; 0x0b 22104: 3c 85 ldd r19, Y+12 ; 0x0c 22106: 2a 57 subi r18, 0x7A ; 122 22108: 3a 4f sbci r19, 0xFA ; 250 2210a: d9 01 movw r26, r18 2210c: 4d 92 st X+, r4 2210e: 5d 92 st X+, r5 22110: 6d 92 st X+, r6 22112: 7c 92 st X, r7 22114: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 22116: f8 01 movw r30, r16 22118: ec 57 subi r30, 0x7C ; 124 2211a: fa 4f sbci r31, 0xFA ; 250 2211c: 10 82 st Z, r1 2211e: f5 ce rjmp .-534 ; 0x21f0a 00022120 : //! @retval true firmware should do temperature compensation and allow calibration //! @retval false PINDA thermistor is not detected, disable temperature compensation and calibration //! @retval true/false when forced via LCD menu Settings->HW Setup->SuperPINDA //! bool has_temperature_compensation() { 22120: cf 93 push r28 #ifdef SUPERPINDA_SUPPORT #ifdef PINDA_TEMP_COMP uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 22122: 89 e2 ldi r24, 0x29 ; 41 22124: 9d e0 ldi r25, 0x0D ; 13 22126: 0f 94 9d a3 call 0x3473a ; 0x3473a if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) //Unkown PINDA temp compenstation, so check it. { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 2212a: c1 e0 ldi r28, 0x01 ; 1 bool has_temperature_compensation() { #ifdef SUPERPINDA_SUPPORT #ifdef PINDA_TEMP_COMP uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) //Unkown PINDA temp compenstation, so check it. 2212c: 8f 3f cpi r24, 0xFF ; 255 2212e: 91 f4 brne .+36 ; 0x22154 { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 22130: 20 e0 ldi r18, 0x00 ; 0 22132: 30 e0 ldi r19, 0x00 ; 0 22134: 40 ef ldi r20, 0xF0 ; 240 22136: 51 e4 ldi r21, 0x41 ; 65 22138: 60 91 85 03 lds r22, 0x0385 ; 0x800385 2213c: 70 91 86 03 lds r23, 0x0386 ; 0x800386 22140: 80 91 87 03 lds r24, 0x0387 ; 0x800387 22144: 90 91 88 03 lds r25, 0x0388 ; 0x800388 22148: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2214c: 87 ff sbrs r24, 7 2214e: 04 c0 rjmp .+8 ; 0x22158 #ifdef PINDA_TEMP_COMP } else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No] 22150: c0 e0 ldi r28, 0x00 ; 0 22152: 02 c0 rjmp .+4 ; 0x22158 22154: 81 11 cpse r24, r1 22156: fc cf rjmp .-8 ; 0x22150 else return false; //Overwritten via LCD menu SuperPINDA [YES] #endif //PINDA_TEMP_COMP #else return true; #endif } 22158: 8c 2f mov r24, r28 2215a: cf 91 pop r28 2215c: 08 95 ret 0002215e <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 2215e: 1f 92 push r1 22160: 0f 92 push r0 22162: 0f b6 in r0, 0x3f ; 63 22164: 0f 92 push r0 22166: 11 24 eor r1, r1 22168: 0b b6 in r0, 0x3b ; 59 2216a: 0f 92 push r0 2216c: ff 92 push r15 2216e: 0f 93 push r16 22170: 1f 93 push r17 22172: 2f 93 push r18 22174: 3f 93 push r19 22176: 4f 93 push r20 22178: 5f 93 push r21 2217a: 6f 93 push r22 2217c: 7f 93 push r23 2217e: 8f 93 push r24 22180: 9f 93 push r25 22182: af 93 push r26 22184: bf 93 push r27 22186: cf 93 push r28 22188: df 93 push r29 2218a: ef 93 push r30 2218c: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 2218e: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22192: 8b 7f andi r24, 0xFB ; 251 22194: 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(); 22198: 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) 2219a: 48 99 sbic 0x09, 0 ; 9 2219c: c6 c0 rjmp .+396 ; 0x2232a <__vector_14+0x1cc> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 2219e: 68 ec ldi r22, 0xC8 ; 200 221a0: 70 e0 ldi r23, 0x00 ; 0 221a2: 82 eb ldi r24, 0xB2 ; 178 221a4: 95 e0 ldi r25, 0x05 ; 5 221a6: 0f 94 ad 0b call 0x2175a ; 0x2175a ::expired_cont(unsigned short)> 221aa: 88 23 and r24, r24 221ac: b9 f0 breq .+46 ; 0x221dc <__vector_14+0x7e> buttonBlanking.start(); 221ae: 82 eb ldi r24, 0xB2 ; 178 221b0: 95 e0 ldi r25, 0x05 ; 5 221b2: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> safetyTimer.start(); 221b6: 8d ea ldi r24, 0xAD ; 173 221b8: 95 e0 ldi r25, 0x05 ; 5 221ba: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 221be: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 221c2: 81 11 cpse r24, r1 221c4: a3 c0 rjmp .+326 ; 0x2230c <__vector_14+0x1ae> 221c6: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 221ca: 81 11 cpse r24, r1 221cc: 9f c0 rjmp .+318 ; 0x2230c <__vector_14+0x1ae> { longPressTimer.start(); 221ce: 88 ea ldi r24, 0xA8 ; 168 221d0: 95 e0 ldi r25, 0x05 ; 5 221d2: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> lcd_button_pressed = 1; 221d6: 81 e0 ldi r24, 0x01 ; 1 221d8: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 221dc: 8c b1 in r24, 0x0c ; 12 221de: 80 95 com r24 221e0: 88 1f adc r24, r24 221e2: 88 27 eor r24, r24 221e4: 88 1f adc r24, r24 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 221e6: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 221ea: 93 ff sbrs r25, 3 221ec: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 221ee: e0 91 a5 05 lds r30, 0x05A5 ; 0x8005a5 221f2: e8 17 cp r30, r24 221f4: e1 f0 breq .+56 ; 0x2222e <__vector_14+0xd0> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 221f6: 24 e0 ldi r18, 0x04 ; 4 221f8: e2 9f mul r30, r18 221fa: f0 01 movw r30, r0 221fc: 11 24 eor r1, r1 221fe: e8 2b or r30, r24 22200: ec 5c subi r30, 0xCC ; 204 22202: f8 46 sbci r31, 0x68 ; 104 22204: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 22206: 90 91 a4 05 lds r25, 0x05A4 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.502> 2220a: e9 0f add r30, r25 2220c: e0 93 a4 05 sts 0x05A4, r30 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.502> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 22210: 0e 2e mov r0, r30 22212: 00 0c add r0, r0 22214: ff 0b sbc r31, r31 22216: f7 ff sbrs r31, 7 22218: 03 c0 rjmp .+6 ; 0x22220 <__vector_14+0xc2> 2221a: f1 95 neg r31 2221c: e1 95 neg r30 2221e: f1 09 sbc r31, r1 22220: 34 97 sbiw r30, 0x04 ; 4 22222: 1c f0 brlt .+6 ; 0x2222a <__vector_14+0xcc> lcd_backlight_wake_trigger = true; // flag event, knob rotated 22224: 91 e0 ldi r25, 0x01 ; 1 22226: 90 93 a6 05 sts 0x05A6, r25 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> } enc_bits_old = enc_bits; 2222a: 80 93 a5 05 sts 0x05A5, r24 ; 0x8005a5 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 2222e: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 22232: 81 11 cpse r24, r1 22234: 08 c0 rjmp .+16 ; 0x22246 <__vector_14+0xe8> { soft_pwm_0 = soft_pwm[0]; 22236: 80 91 f5 05 lds r24, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> 2223a: 80 93 bb 05 sts 0x05BB, r24 ; 0x8005bb if(soft_pwm_0 > 0) 2223e: 88 23 and r24, r24 22240: 09 f4 brne .+2 ; 0x22244 <__vector_14+0xe6> 22242: 87 c0 rjmp .+270 ; 0x22352 <__vector_14+0x1f4> { WRITE(HEATER_0_PIN,1); 22244: 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) 22246: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 2224a: 8f 70 andi r24, 0x0F ; 15 2224c: a9 f4 brne .+42 ; 0x22278 <__vector_14+0x11a> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 2224e: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 22252: 90 e0 ldi r25, 0x00 ; 0 22254: 24 e0 ldi r18, 0x04 ; 4 22256: 95 95 asr r25 22258: 87 95 ror r24 2225a: 2a 95 dec r18 2225c: e1 f7 brne .-8 ; 0x22256 <__vector_14+0xf8> 2225e: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.438> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 22262: 89 2b or r24, r25 22264: 09 f4 brne .+2 ; 0x22268 <__vector_14+0x10a> 22266: 77 c0 rjmp .+238 ; 0x22356 <__vector_14+0x1f8> 22268: 9f b7 in r25, 0x3f ; 63 2226a: f8 94 cli 2226c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22270: 88 60 ori r24, 0x08 ; 8 22272: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22276: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 22278: 90 91 bb 05 lds r25, 0x05BB ; 0x8005bb 2227c: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 22280: 98 17 cp r25, r24 22282: 08 f4 brcc .+2 ; 0x22286 <__vector_14+0x128> { WRITE(HEATER_0_PIN,0); 22284: 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); 22286: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 2228a: 8f 70 andi r24, 0x0F ; 15 2228c: 90 91 0f 04 lds r25, 0x040F ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.438> 22290: 98 17 cp r25, r24 22292: 40 f4 brcc .+16 ; 0x222a4 <__vector_14+0x146> 22294: 9f b7 in r25, 0x3f ; 63 22296: f8 94 cli 22298: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2229c: 87 7f andi r24, 0xF7 ; 247 2229e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 222a2: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 222a4: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 222a8: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 222aa: 8f 77 andi r24, 0x7F ; 127 222ac: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 222b0: 10 e0 ldi r17, 0x00 ; 0 222b2: 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 222b4: e8 01 movw r28, r16 222b6: cc 0f add r28, r28 222b8: dd 1f adc r29, r29 222ba: c1 58 subi r28, 0x81 ; 129 222bc: dc 4f sbci r29, 0xFC ; 252 222be: 88 81 ld r24, Y 222c0: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 222c2: 18 16 cp r1, r24 222c4: 19 06 cpc r1, r25 222c6: 0c f0 brlt .+2 ; 0x222ca <__vector_14+0x16c> 222c8: 4c c0 rjmp .+152 ; 0x22362 <__vector_14+0x204> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 222ca: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 222cc: f8 94 cli babystep(axis,/*fwd*/true); 222ce: 61 e0 ldi r22, 0x01 ; 1 222d0: 80 2f mov r24, r16 222d2: 0f 94 5a 00 call 0x200b4 ; 0x200b4 babystepsTodo[axis]--; //less to do next time 222d6: 88 81 ld r24, Y 222d8: 99 81 ldd r25, Y+1 ; 0x01 222da: 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 222dc: 99 83 std Y+1, r25 ; 0x01 222de: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 222e0: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 222e2: 0f 5f subi r16, 0xFF ; 255 222e4: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 222e6: 03 30 cpi r16, 0x03 ; 3 222e8: 11 05 cpc r17, r1 222ea: 21 f7 brne .-56 ; 0x222b4 <__vector_14+0x156> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 222ec: 80 91 37 17 lds r24, 0x1737 ; 0x801737 <__bss_end+0x20> 222f0: 90 91 38 17 lds r25, 0x1738 ; 0x801738 <__bss_end+0x21> 222f4: a0 91 39 17 lds r26, 0x1739 ; 0x801739 <__bss_end+0x22> 222f8: b0 91 3a 17 lds r27, 0x173A ; 0x80173a <__bss_end+0x23> 222fc: 82 3a cpi r24, 0xA2 ; 162 222fe: 92 4a sbci r25, 0xA2 ; 162 22300: a1 05 cpc r26, r1 22302: b1 05 cpc r27, r1 22304: d9 f1 breq .+118 ; 0x2237c <__vector_14+0x21e> crash_and_burn(dump_crash_reason::bad_isr); } #endif //EMERGENCY_HANDLERS void stack_error() { crash_and_burn(dump_crash_reason::stack_error); 22306: 81 e0 ldi r24, 0x01 ; 1 22308: 0e 94 bf 84 call 0x1097e ; 0x1097e if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 2230c: 68 ee ldi r22, 0xE8 ; 232 2230e: 73 e0 ldi r23, 0x03 ; 3 22310: 88 ea ldi r24, 0xA8 ; 168 22312: 95 e0 ldi r25, 0x05 ; 5 22314: 0f 94 85 0b call 0x2170a ; 0x2170a ::expired(unsigned short)> 22318: 88 23 and r24, r24 2231a: 09 f4 brne .+2 ; 0x2231e <__vector_14+0x1c0> 2231c: 5f cf rjmp .-322 ; 0x221dc <__vector_14+0x7e> { lcd_long_press_active = 1; 2231e: 81 e0 ldi r24, 0x01 ; 1 22320: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab lcd_longpress_trigger = 1; 22324: 80 93 a7 05 sts 0x05A7, r24 ; 0x8005a7 22328: 59 cf rjmp .-334 ; 0x221dc <__vector_14+0x7e> } } } else { //button not pressed if (lcd_button_pressed) 2232a: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 2232e: 88 23 and r24, r24 22330: 09 f4 brne .+2 ; 0x22334 <__vector_14+0x1d6> 22332: 54 cf rjmp .-344 ; 0x221dc <__vector_14+0x7e> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 22334: 10 92 ac 05 sts 0x05AC, r1 ; 0x8005ac if (!lcd_long_press_active) 22338: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 2233c: 81 11 cpse r24, r1 2233e: 03 c0 rjmp .+6 ; 0x22346 <__vector_14+0x1e8> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 22340: 81 e0 ldi r24, 0x01 ; 1 22342: 80 93 95 03 sts 0x0395, r24 ; 0x800395 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 22346: 81 e0 ldi r24, 0x01 ; 1 22348: 80 93 a6 05 sts 0x05A6, r24 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> lcd_long_press_active = 0; 2234c: 10 92 ab 05 sts 0x05AB, r1 ; 0x8005ab 22350: 45 cf rjmp .-374 ; 0x221dc <__vector_14+0x7e> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 22352: 75 98 cbi 0x0e, 5 ; 14 22354: 78 cf rjmp .-272 ; 0x22246 <__vector_14+0xe8> #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); 22356: 9f b7 in r25, 0x3f ; 63 22358: f8 94 cli 2235a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2235e: 87 7f andi r24, 0xF7 ; 247 22360: 88 cf rjmp .-240 ; 0x22272 <__vector_14+0x114> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 22362: 89 2b or r24, r25 22364: 09 f4 brne .+2 ; 0x22368 <__vector_14+0x20a> 22366: bd cf rjmp .-134 ; 0x222e2 <__vector_14+0x184> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22368: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2236a: f8 94 cli babystep(axis,/*fwd*/false); 2236c: 60 e0 ldi r22, 0x00 ; 0 2236e: 80 2f mov r24, r16 22370: 0f 94 5a 00 call 0x200b4 ; 0x200b4 babystepsTodo[axis]++; //less to do next time 22374: 88 81 ld r24, Y 22376: 99 81 ldd r25, Y+1 ; 0x01 22378: 01 96 adiw r24, 0x01 ; 1 2237a: b0 cf rjmp .-160 ; 0x222dc <__vector_14+0x17e> #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]) { 2237c: 96 b1 in r25, 0x06 ; 6 2237e: 80 91 b9 05 lds r24, 0x05B9 ; 0x8005b9 22382: 99 1f adc r25, r25 22384: 99 27 eor r25, r25 22386: 99 1f adc r25, r25 22388: 98 17 cp r25, r24 2238a: 91 f0 breq .+36 ; 0x223b0 <__vector_14+0x252> if(fan_measuring) fan_edge_counter[0] ++; 2238c: 90 91 b6 03 lds r25, 0x03B6 ; 0x8003b6 22390: 99 23 and r25, r25 22392: 51 f0 breq .+20 ; 0x223a8 <__vector_14+0x24a> 22394: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 22398: 30 91 b6 05 lds r19, 0x05B6 ; 0x8005b6 2239c: 2f 5f subi r18, 0xFF ; 255 2239e: 3f 4f sbci r19, 0xFF ; 255 223a0: 30 93 b6 05 sts 0x05B6, r19 ; 0x8005b6 223a4: 20 93 b5 05 sts 0x05B5, r18 ; 0x8005b5 fan_state[0] = !fan_state[0]; 223a8: 91 e0 ldi r25, 0x01 ; 1 223aa: 89 27 eor r24, r25 223ac: 80 93 b9 05 sts 0x05B9, r24 ; 0x8005b9 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 223b0: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 223b2: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 223b6: 84 60 ori r24, 0x04 ; 4 223b8: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 223bc: ff 91 pop r31 223be: ef 91 pop r30 223c0: df 91 pop r29 223c2: cf 91 pop r28 223c4: bf 91 pop r27 223c6: af 91 pop r26 223c8: 9f 91 pop r25 223ca: 8f 91 pop r24 223cc: 7f 91 pop r23 223ce: 6f 91 pop r22 223d0: 5f 91 pop r21 223d2: 4f 91 pop r20 223d4: 3f 91 pop r19 223d6: 2f 91 pop r18 223d8: 1f 91 pop r17 223da: 0f 91 pop r16 223dc: ff 90 pop r15 223de: 0f 90 pop r0 223e0: 0b be out 0x3b, r0 ; 59 223e2: 0f 90 pop r0 223e4: 0f be out 0x3f, r0 ; 63 223e6: 0f 90 pop r0 223e8: 1f 90 pop r1 223ea: 18 95 reti 000223ec : 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) { 223ec: 4f 92 push r4 223ee: 5f 92 push r5 223f0: 6f 92 push r6 223f2: 7f 92 push r7 223f4: af 92 push r10 223f6: bf 92 push r11 223f8: cf 92 push r12 223fa: df 92 push r13 223fc: ef 92 push r14 223fe: ff 92 push r15 22400: 0f 93 push r16 22402: 1f 93 push r17 22404: cf 93 push r28 22406: df 93 push r29 22408: 24 e0 ldi r18, 0x04 ; 4 2240a: 30 e0 ldi r19, 0x00 ; 0 2240c: 41 e0 ldi r20, 0x01 ; 1 2240e: 50 e0 ldi r21, 0x00 ; 0 22410: d9 01 movw r26, r18 22412: a6 5a subi r26, 0xA6 ; 166 22414: ba 46 sbci r27, 0x6A ; 106 float celsius = 0; byte i; for (i=1; i raw) 22416: fd 01 movw r30, r26 22418: 65 91 lpm r22, Z+ 2241a: 74 91 lpm r23, Z 2241c: 86 17 cp r24, r22 2241e: 97 07 cpc r25, r23 22420: 0c f0 brlt .+2 ; 0x22424 22422: 80 c0 rjmp .+256 ; 0x22524 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22424: 41 50 subi r20, 0x01 ; 1 22426: 51 09 sbc r21, r1 22428: 44 0f add r20, r20 2242a: 55 1f adc r21, r21 2242c: 44 0f add r20, r20 2242e: 55 1f adc r21, r21 22430: 8a 01 movw r16, r20 22432: 04 5a subi r16, 0xA4 ; 164 22434: 1a 46 sbci r17, 0x6A ; 106 22436: f8 01 movw r30, r16 22438: c5 90 lpm r12, Z+ 2243a: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 2243c: 46 5a subi r20, 0xA6 ; 166 2243e: 5a 46 sbci r21, 0x6A ; 106 22440: fa 01 movw r30, r20 22442: 65 91 lpm r22, Z+ 22444: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22446: f9 01 movw r30, r18 22448: e4 5a subi r30, 0xA4 ; 164 2244a: fa 46 sbci r31, 0x6A ; 106 2244c: c5 91 lpm r28, Z+ 2244e: d4 91 lpm r29, Z 22450: f8 01 movw r30, r16 22452: 05 91 lpm r16, Z+ 22454: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 22456: fd 01 movw r30, r26 22458: e5 90 lpm r14, Z+ 2245a: f4 90 lpm r15, Z 2245c: fa 01 movw r30, r20 2245e: a5 90 lpm r10, Z+ 22460: 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])) * 22462: 86 1b sub r24, r22 22464: 97 0b sbc r25, r23 22466: bc 01 movw r22, r24 22468: 99 0f add r25, r25 2246a: 88 0b sbc r24, r24 2246c: 99 0b sbc r25, r25 2246e: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 22472: 2b 01 movw r4, r22 22474: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22476: be 01 movw r22, r28 22478: 60 1b sub r22, r16 2247a: 71 0b sbc r23, r17 2247c: 07 2e mov r0, r23 2247e: 00 0c add r0, r0 22480: 88 0b sbc r24, r24 22482: 99 0b sbc r25, r25 22484: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 22488: 9b 01 movw r18, r22 2248a: 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])) * 2248c: c3 01 movw r24, r6 2248e: b2 01 movw r22, r4 22490: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 22494: 2b 01 movw r4, r22 22496: 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])); 22498: b7 01 movw r22, r14 2249a: 6a 19 sub r22, r10 2249c: 7b 09 sbc r23, r11 2249e: 07 2e mov r0, r23 224a0: 00 0c add r0, r0 224a2: 88 0b sbc r24, r24 224a4: 99 0b sbc r25, r25 224a6: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 224aa: 9b 01 movw r18, r22 224ac: 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])) / 224ae: c3 01 movw r24, r6 224b0: b2 01 movw r22, r4 224b2: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 224b6: 2b 01 movw r4, r22 224b8: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 224ba: b6 01 movw r22, r12 224bc: dd 0c add r13, r13 224be: 88 0b sbc r24, r24 224c0: 99 0b sbc r25, r25 224c2: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 224c6: 9b 01 movw r18, r22 224c8: ac 01 movw r20, r24 224ca: c3 01 movw r24, r6 224cc: b2 01 movw r22, r4 224ce: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 224d2: 6b 01 movw r12, r22 224d4: 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) 224d6: 20 e0 ldi r18, 0x00 ; 0 224d8: 30 e0 ldi r19, 0x00 ; 0 224da: 40 e2 ldi r20, 0x20 ; 32 224dc: 52 e4 ldi r21, 0x42 ; 66 224de: c7 01 movw r24, r14 224e0: b6 01 movw r22, r12 224e2: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 224e6: 87 fd sbrc r24, 7 224e8: 30 c0 rjmp .+96 ; 0x2254a 224ea: 20 e0 ldi r18, 0x00 ; 0 224ec: 30 e0 ldi r19, 0x00 ; 0 224ee: 48 e4 ldi r20, 0x48 ; 72 224f0: 52 e4 ldi r21, 0x42 ; 66 224f2: c7 01 movw r24, r14 224f4: b6 01 movw r22, r12 224f6: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 224fa: 18 16 cp r1, r24 224fc: 34 f1 brlt .+76 ; 0x2254a { celsius = celsius + (_first_koef * (celsius - _offset_start)); 224fe: 20 e0 ldi r18, 0x00 ; 0 22500: 30 e0 ldi r19, 0x00 ; 0 22502: 40 e2 ldi r20, 0x20 ; 32 22504: 52 e4 ldi r21, 0x42 ; 66 22506: c7 01 movw r24, r14 22508: b6 01 movw r22, r12 2250a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2250e: 20 e0 ldi r18, 0x00 ; 0 22510: 30 e0 ldi r19, 0x00 ; 0 22512: 40 e0 ldi r20, 0x00 ; 0 22514: 5f e3 ldi r21, 0x3F ; 63 22516: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2251a: 9b 01 movw r18, r22 2251c: 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; 2251e: c7 01 movw r24, r14 22520: b6 01 movw r22, r12 22522: 43 c0 rjmp .+134 ; 0x225aa 22524: 4f 5f subi r20, 0xFF ; 255 22526: 5f 4f sbci r21, 0xFF ; 255 22528: 2c 5f subi r18, 0xFC ; 252 2252a: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 22532: 6e cf rjmp .-292 ; 0x22410 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22534: ec e4 ldi r30, 0x4C ; 76 22536: f6 e9 ldi r31, 0x96 ; 150 22538: 65 91 lpm r22, Z+ 2253a: 74 91 lpm r23, Z 2253c: 07 2e mov r0, r23 2253e: 00 0c add r0, r0 22540: 88 0b sbc r24, r24 22542: 99 0b sbc r25, r25 22544: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 22548: c4 cf rjmp .-120 ; 0x224d2 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 2254a: 20 e0 ldi r18, 0x00 ; 0 2254c: 30 e0 ldi r19, 0x00 ; 0 2254e: 48 e4 ldi r20, 0x48 ; 72 22550: 52 e4 ldi r21, 0x42 ; 66 22552: c7 01 movw r24, r14 22554: b6 01 movw r22, r12 22556: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2255a: 18 16 cp r1, r24 2255c: dc f5 brge .+118 ; 0x225d4 2255e: 20 e0 ldi r18, 0x00 ; 0 22560: 30 e0 ldi r19, 0x00 ; 0 22562: 48 ec ldi r20, 0xC8 ; 200 22564: 52 e4 ldi r21, 0x42 ; 66 22566: c7 01 movw r24, r14 22568: b6 01 movw r22, r12 2256a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2256e: 18 16 cp r1, r24 22570: 8c f1 brlt .+98 ; 0x225d4 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 22572: 20 e0 ldi r18, 0x00 ; 0 22574: 30 e0 ldi r19, 0x00 ; 0 22576: 40 ea ldi r20, 0xA0 ; 160 22578: 50 e4 ldi r21, 0x40 ; 64 2257a: c7 01 movw r24, r14 2257c: b6 01 movw r22, r12 2257e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 22582: 2b 01 movw r4, r22 22584: 3c 01 movw r6, r24 22586: 20 e0 ldi r18, 0x00 ; 0 22588: 30 e0 ldi r19, 0x00 ; 0 2258a: 48 e4 ldi r20, 0x48 ; 72 2258c: 52 e4 ldi r21, 0x42 ; 66 2258e: c7 01 movw r24, r14 22590: b6 01 movw r22, r12 22592: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 22596: 2d ec ldi r18, 0xCD ; 205 22598: 3c ec ldi r19, 0xCC ; 204 2259a: 4c ec ldi r20, 0xCC ; 204 2259c: 5d e3 ldi r21, 0x3D ; 61 2259e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 225a2: 9b 01 movw r18, r22 225a4: ac 01 movw r20, r24 225a6: c3 01 movw r24, r6 225a8: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 225aa: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 225ae: 6b 01 movw r12, r22 225b0: 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 } 225b2: c7 01 movw r24, r14 225b4: b6 01 movw r22, r12 225b6: df 91 pop r29 225b8: cf 91 pop r28 225ba: 1f 91 pop r17 225bc: 0f 91 pop r16 225be: ff 90 pop r15 225c0: ef 90 pop r14 225c2: df 90 pop r13 225c4: cf 90 pop r12 225c6: bf 90 pop r11 225c8: af 90 pop r10 225ca: 7f 90 pop r7 225cc: 6f 90 pop r6 225ce: 5f 90 pop r5 225d0: 4f 90 pop r4 225d2: 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) 225d4: 20 e0 ldi r18, 0x00 ; 0 225d6: 30 e0 ldi r19, 0x00 ; 0 225d8: 48 ec ldi r20, 0xC8 ; 200 225da: 52 e4 ldi r21, 0x42 ; 66 225dc: c7 01 movw r24, r14 225de: b6 01 movw r22, r12 225e0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 225e4: 18 16 cp r1, r24 225e6: 2c f7 brge .-54 ; 0x225b2 { celsius = celsius + _offset; 225e8: 20 e0 ldi r18, 0x00 ; 0 225ea: 30 e0 ldi r19, 0x00 ; 0 225ec: 40 e2 ldi r20, 0x20 ; 32 225ee: 51 e4 ldi r21, 0x41 ; 65 225f0: 96 cf rjmp .-212 ; 0x2251e 000225f2 <__vector_32>: if (pid_tuning_finished) temp_mgr_pid(); } ISR(TIMERx_COMPA_vect) { 225f2: 1f 92 push r1 225f4: 0f 92 push r0 225f6: 0f b6 in r0, 0x3f ; 63 225f8: 0f 92 push r0 225fa: 11 24 eor r1, r1 225fc: 0b b6 in r0, 0x3b ; 59 225fe: 0f 92 push r0 22600: 4f 92 push r4 22602: 5f 92 push r5 22604: 6f 92 push r6 22606: 7f 92 push r7 22608: 8f 92 push r8 2260a: 9f 92 push r9 2260c: af 92 push r10 2260e: bf 92 push r11 22610: cf 92 push r12 22612: df 92 push r13 22614: ef 92 push r14 22616: ff 92 push r15 22618: 0f 93 push r16 2261a: 1f 93 push r17 2261c: 2f 93 push r18 2261e: 3f 93 push r19 22620: 4f 93 push r20 22622: 5f 93 push r21 22624: 6f 93 push r22 22626: 7f 93 push r23 22628: 8f 93 push r24 2262a: 9f 93 push r25 2262c: af 93 push r26 2262e: bf 93 push r27 22630: cf 93 push r28 22632: df 93 push r29 22634: ef 93 push r30 22636: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 22638: 80 91 f6 05 lds r24, 0x05F6 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.517> 2263c: 88 23 and r24, r24 2263e: 09 f4 brne .+2 ; 0x22642 <__vector_32+0x50> 22640: 22 c1 rjmp .+580 ; 0x22886 <__vector_32+0x294> adc_values_ready = false; 22642: 10 92 f6 05 sts 0x05F6, r1 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.517> adc_start_cycle(); 22646: 0e 94 c0 ba call 0x17580 ; 0x17580 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 2264a: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 2264e: 8d 7f andi r24, 0xFD ; 253 22650: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> #if !defined(__DOXYGEN__) /* Internal helper functions. */ static __inline__ uint8_t __iSeiRetVal(void) { sei(); 22654: 78 94 sei 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 2265a: 90 91 dd 05 lds r25, 0x05DD ; 0x8005dd 2265e: 0f 94 23 8f call 0x31e46 ; 0x31e46 22662: 4b 01 movw r8, r22 22664: 5c 01 movw r10, r24 22666: 80 92 f1 05 sts 0x05F1, r8 ; 0x8005f1 2266a: 90 92 f2 05 sts 0x05F2, r9 ; 0x8005f2 2266e: a0 92 f3 05 sts 0x05F3, r10 ; 0x8005f3 22672: b0 92 f4 05 sts 0x05F4, r11 ; 0x8005f4 current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 22676: 00 91 de 05 lds r16, 0x05DE ; 0x8005de 2267a: 10 91 df 05 lds r17, 0x05DF ; 0x8005df 2267e: c8 01 movw r24, r16 22680: 0f 94 f6 11 call 0x223ec ; 0x223ec 22684: 6b 01 movw r12, r22 22686: 7c 01 movw r14, r24 22688: c0 92 ea 05 sts 0x05EA, r12 ; 0x8005ea 2268c: d0 92 eb 05 sts 0x05EB, r13 ; 0x8005eb 22690: e0 92 ec 05 sts 0x05EC, r14 ; 0x8005ec 22694: f0 92 ed 05 sts 0x05ED, r15 ; 0x8005ed #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 22698: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 2269c: 90 91 db 05 lds r25, 0x05DB ; 0x8005db 226a0: 0f 94 f6 11 call 0x223ec ; 0x223ec 226a4: 60 93 d6 05 sts 0x05D6, r22 ; 0x8005d6 226a8: 70 93 d7 05 sts 0x05D7, r23 ; 0x8005d7 226ac: 80 93 d8 05 sts 0x05D8, r24 ; 0x8005d8 226b0: 90 93 d9 05 sts 0x05D9, r25 ; 0x8005d9 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) #endif temp_meas_ready = true; 226b4: 81 e0 ldi r24, 0x01 ; 1 226b6: 80 93 d5 05 sts 0x05D5, r24 ; 0x8005d5 { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 226ba: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 226be: 8d 7f andi r24, 0xFD ; 253 226c0: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 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]) { 226c4: c0 91 dc 05 lds r28, 0x05DC ; 0x8005dc 226c8: d0 91 dd 05 lds r29, 0x05DD ; 0x8005dd 226cc: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.431> 226d0: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.431+0x1> 226d4: 8c 17 cp r24, r28 226d6: 9d 07 cpc r25, r29 226d8: 2c f0 brlt .+10 ; 0x226e4 <__vector_32+0xf2> #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 226da: 40 e0 ldi r20, 0x00 ; 0 226dc: 60 e0 ldi r22, 0x00 ; 0 226de: 80 e0 ldi r24, 0x00 ; 0 226e0: 0f 94 58 0e call 0x21cb0 ; 0x21cb0 } //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) { 226e4: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.432> 226e8: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.432+0x1> 226ec: 80 17 cp r24, r16 226ee: 91 07 cpc r25, r17 226f0: 2c f0 brlt .+10 ; 0x226fc <__vector_32+0x10a> #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 226f2: 40 e0 ldi r20, 0x00 ; 0 226f4: 60 e0 ldi r22, 0x00 ; 0 226f6: 81 e0 ldi r24, 0x01 ; 1 226f8: 0f 94 58 0e call 0x21cb0 ; 0x21cb0 { // 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]) { 226fc: 60 91 0d 04 lds r22, 0x040D ; 0x80040d <_ZL8minttemp.lto_priv.428> 22700: 70 91 0e 04 lds r23, 0x040E ; 0x80040e <_ZL8minttemp.lto_priv.428+0x1> 22704: 80 91 ef 05 lds r24, 0x05EF ; 0x8005ef 22708: 90 91 f0 05 lds r25, 0x05F0 ; 0x8005f0 2270c: 68 17 cp r22, r24 2270e: 79 07 cpc r23, r25 22710: 0c f0 brlt .+2 ; 0x22714 <__vector_32+0x122> 22712: dc c0 rjmp .+440 ; 0x228cc <__vector_32+0x2da> // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 22714: 10 91 e7 05 lds r17, 0x05E7 ; 0x8005e7 22718: 11 11 cpse r17, r1 2271a: 12 c0 rjmp .+36 ; 0x22740 <__vector_32+0x14e> 2271c: 6b 5f subi r22, 0xFB ; 251 2271e: 7f 4f sbci r23, 0xFF ; 255 22720: 07 2e mov r0, r23 22722: 00 0c add r0, r0 22724: 88 0b sbc r24, r24 22726: 99 0b sbc r25, r25 22728: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2272c: 9b 01 movw r18, r22 2272e: ac 01 movw r20, r24 22730: 11 e0 ldi r17, 0x01 ; 1 22732: c5 01 movw r24, r10 22734: b4 01 movw r22, r8 22736: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2273a: 18 16 cp r1, r24 2273c: 0c f0 brlt .+2 ; 0x22740 <__vector_32+0x14e> 2273e: 10 e0 ldi r17, 0x00 ; 0 22740: 10 93 e7 05 sts 0x05E7, r17 ; 0x8005e7 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 22744: 68 e9 ldi r22, 0x98 ; 152 22746: 7a e3 ldi r23, 0x3A ; 58 22748: 84 ee ldi r24, 0xE4 ; 228 2274a: 95 e0 ldi r25, 0x05 ; 5 2274c: 0f 94 ad 0b call 0x2175a ; 0x2175a ::expired_cont(unsigned short)> 22750: 81 11 cpse r24, r1 22752: 02 c0 rjmp .+4 ; 0x22758 <__vector_32+0x166> 22754: 11 23 and r17, r17 22756: 79 f0 breq .+30 ; 0x22776 <__vector_32+0x184> bCheckingOnHeater=true; // not necessary 22758: 81 e0 ldi r24, 0x01 ; 1 2275a: 80 93 e7 05 sts 0x05E7, r24 ; 0x8005e7 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]) { 2275e: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.430> 22762: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.430+0x1> 22766: c8 17 cp r28, r24 22768: d9 07 cpc r29, r25 2276a: 2c f0 brlt .+10 ; 0x22776 <__vector_32+0x184> #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 2276c: 41 e0 ldi r20, 0x01 ; 1 2276e: 60 e0 ldi r22, 0x00 ; 0 22770: 80 e0 ldi r24, 0x00 ; 0 22772: 0f 94 58 0e call 0x21cb0 ; 0x21cb0 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 22776: 80 91 e8 05 lds r24, 0x05E8 ; 0x8005e8 2277a: 90 91 e9 05 lds r25, 0x05E9 ; 0x8005e9 2277e: 4f 97 sbiw r24, 0x1f ; 31 22780: 0c f4 brge .+2 ; 0x22784 <__vector_32+0x192> 22782: ab c0 rjmp .+342 ; 0x228da <__vector_32+0x2e8> // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 22784: c0 91 e3 05 lds r28, 0x05E3 ; 0x8005e3 22788: c1 11 cpse r28, r1 2278a: 0c c0 rjmp .+24 ; 0x227a4 <__vector_32+0x1b2> 2278c: c1 e0 ldi r28, 0x01 ; 1 2278e: 20 e0 ldi r18, 0x00 ; 0 22790: 30 e0 ldi r19, 0x00 ; 0 22792: 4c e0 ldi r20, 0x0C ; 12 22794: 52 e4 ldi r21, 0x42 ; 66 22796: c7 01 movw r24, r14 22798: b6 01 movw r22, r12 2279a: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2279e: 18 16 cp r1, r24 227a0: 0c f0 brlt .+2 ; 0x227a4 <__vector_32+0x1b2> 227a2: c0 e0 ldi r28, 0x00 ; 0 227a4: c0 93 e3 05 sts 0x05E3, r28 ; 0x8005e3 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 227a8: 60 e5 ldi r22, 0x50 ; 80 227aa: 73 ec ldi r23, 0xC3 ; 195 227ac: 80 ee ldi r24, 0xE0 ; 224 227ae: 95 e0 ldi r25, 0x05 ; 5 227b0: 0f 94 ad 0b call 0x2175a ; 0x2175a ::expired_cont(unsigned short)> 227b4: 81 11 cpse r24, r1 227b6: 02 c0 rjmp .+4 ; 0x227bc <__vector_32+0x1ca> 227b8: cc 23 and r28, r28 227ba: 99 f0 breq .+38 ; 0x227e2 <__vector_32+0x1f0> bCheckingOnBed=true; // not necessary 227bc: 81 e0 ldi r24, 0x01 ; 1 227be: 80 93 e3 05 sts 0x05E3, r24 ; 0x8005e3 } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 227c2: 20 91 de 05 lds r18, 0x05DE ; 0x8005de 227c6: 30 91 df 05 lds r19, 0x05DF ; 0x8005df 227ca: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.429> 227ce: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.429+0x1> 227d2: 28 17 cp r18, r24 227d4: 39 07 cpc r19, r25 227d6: 2c f0 brlt .+10 ; 0x227e2 <__vector_32+0x1f0> #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 227d8: 41 e0 ldi r20, 0x01 ; 1 227da: 60 e0 ldi r22, 0x00 ; 0 227dc: 81 e0 ldi r24, 0x01 ; 1 227de: 0f 94 58 0e call 0x21cb0 ; 0x21cb0 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); 227e2: 60 91 f5 05 lds r22, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> 227e6: 70 e0 ldi r23, 0x00 ; 0 227e8: 90 e0 ldi r25, 0x00 ; 0 227ea: 80 e0 ldi r24, 0x00 ; 0 227ec: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 227f0: 6b 01 movw r12, r22 227f2: 7c 01 movw r14, r24 227f4: 40 90 f1 05 lds r4, 0x05F1 ; 0x8005f1 227f8: 50 90 f2 05 lds r5, 0x05F2 ; 0x8005f2 227fc: 60 90 f3 05 lds r6, 0x05F3 ; 0x8005f3 22800: 70 90 f4 05 lds r7, 0x05F4 ; 0x8005f4 22804: 60 91 ef 05 lds r22, 0x05EF ; 0x8005ef 22808: 70 91 f0 05 lds r23, 0x05F0 ; 0x8005f0 2280c: 07 2e mov r0, r23 2280e: 00 0c add r0, r0 22810: 88 0b sbc r24, r24 22812: 99 0b sbc r25, r25 22814: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 22818: ab 01 movw r20, r22 2281a: bc 01 movw r22, r24 2281c: a1 2c mov r10, r1 2281e: 93 01 movw r18, r6 22820: 82 01 movw r16, r4 22822: 81 e0 ldi r24, 0x01 ; 1 22824: 0f 94 bc 0e call 0x21d78 ; 0x21d78 #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 22828: 60 91 ee 05 lds r22, 0x05EE ; 0x8005ee 2282c: 70 e0 ldi r23, 0x00 ; 0 2282e: 90 e0 ldi r25, 0x00 ; 0 22830: 80 e0 ldi r24, 0x00 ; 0 22832: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 22836: 6b 01 movw r12, r22 22838: 7c 01 movw r14, r24 2283a: 40 90 ea 05 lds r4, 0x05EA ; 0x8005ea 2283e: 50 90 eb 05 lds r5, 0x05EB ; 0x8005eb 22842: 60 90 ec 05 lds r6, 0x05EC ; 0x8005ec 22846: 70 90 ed 05 lds r7, 0x05ED ; 0x8005ed 2284a: 60 91 e8 05 lds r22, 0x05E8 ; 0x8005e8 2284e: 70 91 e9 05 lds r23, 0x05E9 ; 0x8005e9 22852: 07 2e mov r0, r23 22854: 00 0c add r0, r0 22856: 88 0b sbc r24, r24 22858: 99 0b sbc r25, r25 2285a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2285e: ab 01 movw r20, r22 22860: bc 01 movw r22, r24 22862: aa 24 eor r10, r10 22864: a3 94 inc r10 22866: 93 01 movw r18, r6 22868: 82 01 movw r16, r4 2286a: 80 e0 ldi r24, 0x00 ; 0 2286c: 0f 94 bc 0e call 0x21d78 ; 0x21d78 thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 22870: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.427> 22874: 81 11 cpse r24, r1 temp_mgr_pid(); 22876: 0e 94 36 fd call 0x1fa6c ; 0x1fa6c (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 2287a: f8 94 cli // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); } ENABLE_TEMP_MGR_INTERRUPT(); 2287c: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 22880: 82 60 ori r24, 0x02 ; 2 22882: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> } 22886: ff 91 pop r31 22888: ef 91 pop r30 2288a: df 91 pop r29 2288c: cf 91 pop r28 2288e: bf 91 pop r27 22890: af 91 pop r26 22892: 9f 91 pop r25 22894: 8f 91 pop r24 22896: 7f 91 pop r23 22898: 6f 91 pop r22 2289a: 5f 91 pop r21 2289c: 4f 91 pop r20 2289e: 3f 91 pop r19 228a0: 2f 91 pop r18 228a2: 1f 91 pop r17 228a4: 0f 91 pop r16 228a6: ff 90 pop r15 228a8: ef 90 pop r14 228aa: df 90 pop r13 228ac: cf 90 pop r12 228ae: bf 90 pop r11 228b0: af 90 pop r10 228b2: 9f 90 pop r9 228b4: 8f 90 pop r8 228b6: 7f 90 pop r7 228b8: 6f 90 pop r6 228ba: 5f 90 pop r5 228bc: 4f 90 pop r4 228be: 0f 90 pop r0 228c0: 0b be out 0x3b, r0 ; 59 228c2: 0f 90 pop r0 228c4: 0f be out 0x3f, r0 ; 63 228c6: 0f 90 pop r0 228c8: 1f 90 pop r1 228ca: 18 95 reti check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 228cc: 84 ee ldi r24, 0xE4 ; 228 228ce: 95 e0 ldi r25, 0x05 ; 5 228d0: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> bCheckingOnHeater=false; 228d4: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 228d8: 4e cf rjmp .-356 ; 0x22776 <__vector_32+0x184> check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 228da: 80 ee ldi r24, 0xE0 ; 224 228dc: 95 e0 ldi r25, 0x05 ; 5 228de: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> bCheckingOnBed=false; 228e2: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 228e6: 7d cf rjmp .-262 ; 0x227e2 <__vector_32+0x1f0> 000228e8 : 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; 228e8: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 228ec: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 228f0: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 228f4: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 228f8: 60 e0 ldi r22, 0x00 ; 0 228fa: 70 e0 ldi r23, 0x00 ; 0 228fc: 8f e7 ldi r24, 0x7F ; 127 228fe: 93 e4 ldi r25, 0x43 ; 67 22900: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 22904: 60 93 18 04 sts 0x0418, r22 ; 0x800418 <_ZL14iState_sum_max.lto_priv.436> 22908: 70 93 19 04 sts 0x0419, r23 ; 0x800419 <_ZL14iState_sum_max.lto_priv.436+0x1> 2290c: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14iState_sum_max.lto_priv.436+0x2> 22910: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14iState_sum_max.lto_priv.436+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 22914: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 22918: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 2291c: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 22920: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 22924: 60 e0 ldi r22, 0x00 ; 0 22926: 70 e0 ldi r23, 0x00 ; 0 22928: 8f e7 ldi r24, 0x7F ; 127 2292a: 93 e4 ldi r25, 0x43 ; 67 2292c: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 22930: 60 93 10 04 sts 0x0410, r22 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.434> 22934: 70 93 11 04 sts 0x0411, r23 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.434+0x1> 22938: 80 93 12 04 sts 0x0412, r24 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.434+0x2> 2293c: 90 93 13 04 sts 0x0413, r25 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.434+0x3> #endif } 22940: 08 95 ret 00022942 : return data; } static void swi2c_write(uint8_t data) { for (uint8_t bit = 8; bit-- > 0;) 22942: 98 e0 ldi r25, 0x08 ; 8 { WRITE(SWI2C_SDA, data & _BV(bit)); 22944: 28 2f mov r18, r24 22946: 30 e0 ldi r19, 0x00 ; 0 return data; } static void swi2c_write(uint8_t data) { for (uint8_t bit = 8; bit-- > 0;) 22948: 91 50 subi r25, 0x01 ; 1 2294a: 08 f4 brcc .+2 ; 0x2294e WRITE(SWI2C_SCL, 1); __delay(); WRITE(SWI2C_SCL, 0); __delay(); } } 2294c: 08 95 ret static void swi2c_write(uint8_t data) { for (uint8_t bit = 8; bit-- > 0;) { WRITE(SWI2C_SDA, data & _BV(bit)); 2294e: a9 01 movw r20, r18 22950: 09 2e mov r0, r25 22952: 02 c0 rjmp .+4 ; 0x22958 22954: 55 95 asr r21 22956: 47 95 ror r20 22958: 0a 94 dec r0 2295a: e2 f7 brpl .-8 ; 0x22954 2295c: 40 ff sbrs r20, 0 2295e: 1b c0 rjmp .+54 ; 0x22996 22960: 59 9a sbi 0x0b, 1 ; 11 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 22962: 88 e0 ldi r24, 0x08 ; 8 22964: 8a 95 dec r24 22966: f1 f7 brne .-4 ; 0x22964 __delay(); WRITE(SWI2C_SCL, 1); 22968: 4f b7 in r20, 0x3f ; 63 2296a: f8 94 cli 2296c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22970: 84 60 ori r24, 0x04 ; 4 22972: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22976: 4f bf out 0x3f, r20 ; 63 22978: 88 e0 ldi r24, 0x08 ; 8 2297a: 8a 95 dec r24 2297c: f1 f7 brne .-4 ; 0x2297a __delay(); WRITE(SWI2C_SCL, 0); 2297e: 4f b7 in r20, 0x3f ; 63 22980: f8 94 cli 22982: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22986: 8b 7f andi r24, 0xFB ; 251 22988: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2298c: 4f bf out 0x3f, r20 ; 63 2298e: 88 e0 ldi r24, 0x08 ; 8 22990: 8a 95 dec r24 22992: f1 f7 brne .-4 ; 0x22990 22994: d9 cf rjmp .-78 ; 0x22948 static void swi2c_write(uint8_t data) { for (uint8_t bit = 8; bit-- > 0;) { WRITE(SWI2C_SDA, data & _BV(bit)); 22996: 59 98 cbi 0x0b, 1 ; 11 22998: e4 cf rjmp .-56 ; 0x22962 0002299a : __delay(); } static uint8_t swi2c_wait_ack() { SET_INPUT(SWI2C_SDA); 2299a: 51 98 cbi 0x0a, 1 ; 10 2299c: 28 e0 ldi r18, 0x08 ; 8 2299e: 2a 95 dec r18 229a0: f1 f7 brne .-4 ; 0x2299e 229a2: 88 e0 ldi r24, 0x08 ; 8 229a4: 8a 95 dec r24 229a6: f1 f7 brne .-4 ; 0x229a4 __delay(); // WRITE(SWI2C_SDA, 1); __delay(); WRITE(SWI2C_SCL, 1); 229a8: 9f b7 in r25, 0x3f ; 63 229aa: f8 94 cli 229ac: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 229b0: 84 60 ori r24, 0x04 ; 4 229b2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 229b6: 9f bf out 0x3f, r25 ; 63 229b8: 81 e0 ldi r24, 0x01 ; 1 229ba: 98 e0 ldi r25, 0x08 ; 8 // __delay(); uint8_t ack = 0; uint16_t ackto = SWI2C_TMO; while (!(ack = (!READ(SWI2C_SDA))) && ackto--) __delay(); 229bc: 29 b1 in r18, 0x09 ; 9 229be: 32 2f mov r19, r18 229c0: 32 70 andi r19, 0x02 ; 2 229c2: 21 fd sbrc r18, 1 229c4: 18 c0 rjmp .+48 ; 0x229f6 WRITE(SWI2C_SCL, 0); 229c6: 9f b7 in r25, 0x3f ; 63 229c8: f8 94 cli 229ca: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 229ce: 8b 7f andi r24, 0xFB ; 251 229d0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 229d4: 9f bf out 0x3f, r25 ; 63 229d6: 88 e0 ldi r24, 0x08 ; 8 229d8: 8a 95 dec r24 229da: f1 f7 brne .-4 ; 0x229d8 __delay(); SET_OUTPUT(SWI2C_SDA); 229dc: 51 9a sbi 0x0a, 1 ; 10 229de: 28 e0 ldi r18, 0x08 ; 8 229e0: 2a 95 dec r18 229e2: f1 f7 brne .-4 ; 0x229e0 __delay(); WRITE(SWI2C_SDA, 0); 229e4: 59 98 cbi 0x0b, 1 ; 11 229e6: 88 e0 ldi r24, 0x08 ; 8 229e8: 8a 95 dec r24 229ea: f1 f7 brne .-4 ; 0x229e8 __delay(); WRITE(SWI2C_SCL, 1); // __delay(); uint8_t ack = 0; uint16_t ackto = SWI2C_TMO; while (!(ack = (!READ(SWI2C_SDA))) && ackto--) __delay(); 229ec: 81 e0 ldi r24, 0x01 ; 1 229ee: 33 23 and r19, r19 229f0: 41 f0 breq .+16 ; 0x22a02 229f2: 80 e0 ldi r24, 0x00 ; 0 229f4: 08 95 ret 229f6: 01 97 sbiw r24, 0x01 ; 1 229f8: 31 f3 breq .-52 ; 0x229c6 229fa: 28 e0 ldi r18, 0x08 ; 8 229fc: 2a 95 dec r18 229fe: f1 f7 brne .-4 ; 0x229fc 22a00: dd cf rjmp .-70 ; 0x229bc SET_OUTPUT(SWI2C_SDA); __delay(); WRITE(SWI2C_SDA, 0); __delay(); return ack; } 22a02: 08 95 ret 00022a04 : __delay(); } static void swi2c_stop(void) { WRITE(SWI2C_SCL, 1); 22a04: 9f b7 in r25, 0x3f ; 63 22a06: f8 94 cli 22a08: e2 e0 ldi r30, 0x02 ; 2 22a0a: f1 e0 ldi r31, 0x01 ; 1 22a0c: 80 81 ld r24, Z 22a0e: 84 60 ori r24, 0x04 ; 4 22a10: 80 83 st Z, r24 22a12: 9f bf out 0x3f, r25 ; 63 22a14: 88 e0 ldi r24, 0x08 ; 8 22a16: 8a 95 dec r24 22a18: f1 f7 brne .-4 ; 0x22a16 __delay(); WRITE(SWI2C_SDA, 1); 22a1a: 59 9a sbi 0x0b, 1 ; 11 22a1c: 88 e0 ldi r24, 0x08 ; 8 22a1e: 8a 95 dec r24 22a20: f1 f7 brne .-4 ; 0x22a1e __delay(); } 22a22: 08 95 ret 00022a24 : _delay_us(1.5); } static void swi2c_start(void) { WRITE(SWI2C_SDA, 0); 22a24: 59 98 cbi 0x0b, 1 ; 11 22a26: 88 e0 ldi r24, 0x08 ; 8 22a28: 8a 95 dec r24 22a2a: f1 f7 brne .-4 ; 0x22a28 __delay(); WRITE(SWI2C_SCL, 0); 22a2c: 9f b7 in r25, 0x3f ; 63 22a2e: f8 94 cli 22a30: e2 e0 ldi r30, 0x02 ; 2 22a32: f1 e0 ldi r31, 0x01 ; 1 22a34: 80 81 ld r24, Z 22a36: 8b 7f andi r24, 0xFB ; 251 22a38: 80 83 st Z, r24 22a3a: 9f bf out 0x3f, r25 ; 63 22a3c: 88 e0 ldi r24, 0x08 ; 8 22a3e: 8a 95 dec r24 22a40: f1 f7 brne .-4 ; 0x22a3e __delay(); } 22a42: 08 95 ret 00022a44 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 22a44: 0f 93 push r16 22a46: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 22a48: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 22a4c: 81 30 cpi r24, 0x01 ; 1 22a4e: 19 f5 brne .+70 ; 0x22a96 22a50: 0f 94 56 0b call 0x216ac ; 0x216ac 22a54: 00 91 7c 05 lds r16, 0x057C ; 0x80057c 22a58: 10 91 7d 05 lds r17, 0x057D ; 0x80057d 22a5c: 20 91 7e 05 lds r18, 0x057E ; 0x80057e 22a60: 30 91 7f 05 lds r19, 0x057F ; 0x80057f 22a64: 60 1b sub r22, r16 22a66: 71 0b sbc r23, r17 22a68: 82 0b sbc r24, r18 22a6a: 93 0b sbc r25, r19 22a6c: 28 ee ldi r18, 0xE8 ; 232 22a6e: 33 e0 ldi r19, 0x03 ; 3 22a70: 40 e0 ldi r20, 0x00 ; 0 22a72: 50 e0 ldi r21, 0x00 ; 0 22a74: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 22a78: 60 91 78 05 lds r22, 0x0578 ; 0x800578 22a7c: 70 91 79 05 lds r23, 0x0579 ; 0x800579 22a80: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 22a84: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 22a88: 62 0f add r22, r18 22a8a: 73 1f adc r23, r19 22a8c: 84 1f adc r24, r20 22a8e: 95 1f adc r25, r21 } 22a90: 1f 91 pop r17 22a92: 0f 91 pop r16 22a94: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 22a96: 60 91 0b 06 lds r22, 0x060B ; 0x80060b 22a9a: 70 91 0c 06 lds r23, 0x060C ; 0x80060c 22a9e: 80 91 0d 06 lds r24, 0x060D ; 0x80060d 22aa2: 90 91 0e 06 lds r25, 0x060E ; 0x80060e 22aa6: d6 cf rjmp .-84 ; 0x22a54 00022aa8 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 22aa8: 4f 92 push r4 22aaa: 5f 92 push r5 22aac: 6f 92 push r6 22aae: 7f 92 push r7 22ab0: 8f 92 push r8 22ab2: 9f 92 push r9 22ab4: af 92 push r10 22ab6: bf 92 push r11 22ab8: cf 92 push r12 22aba: df 92 push r13 22abc: ef 92 push r14 22abe: ff 92 push r15 22ac0: 0f 93 push r16 22ac2: 1f 93 push r17 22ac4: cf 93 push r28 22ac6: df 93 push r29 22ac8: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 22acc: 0e 94 10 66 call 0xcc20 ; 0xcc20 22ad0: 88 23 and r24, r24 22ad2: 09 f4 brne .+2 ; 0x22ad6 22ad4: 6e c0 rjmp .+220 ; 0x22bb2 { const float _met = ((float)total_filament_used) / (100000.f); 22ad6: 60 91 17 06 lds r22, 0x0617 ; 0x800617 22ada: 70 91 18 06 lds r23, 0x0618 ; 0x800618 22ade: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22ae2: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 22ae6: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 22aea: 20 e0 ldi r18, 0x00 ; 0 22aec: 30 e5 ldi r19, 0x50 ; 80 22aee: 43 ec ldi r20, 0xC3 ; 195 22af0: 57 e4 ldi r21, 0x47 ; 71 22af2: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 22af6: 56 2e mov r5, r22 22af8: 47 2e mov r4, r23 22afa: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 22afc: 0f 94 22 15 call 0x22a44 ; 0x22a44 22b00: 6b 01 movw r12, r22 22b02: 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(); 22b04: 0e 94 ef 6f call 0xdfde ; 0xdfde lcd_printf_P(_N( 22b08: 8f ec ldi r24, 0xCF ; 207 22b0a: 98 e5 ldi r25, 0x58 ; 88 22b0c: 0e 94 0a 75 call 0xea14 ; 0xea14 22b10: 18 2f mov r17, r24 22b12: 09 2f mov r16, r25 22b14: 8f eb ldi r24, 0xBF ; 191 22b16: 98 e5 ldi r25, 0x58 ; 88 22b18: 0e 94 0a 75 call 0xea14 ; 0xea14 22b1c: 78 2e mov r7, r24 22b1e: 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; 22b20: 8c e3 ldi r24, 0x3C ; 60 22b22: 88 2e mov r8, r24 22b24: 91 2c mov r9, r1 22b26: a1 2c mov r10, r1 22b28: b1 2c mov r11, r1 22b2a: c7 01 movw r24, r14 22b2c: b6 01 movw r22, r12 22b2e: a5 01 movw r20, r10 22b30: 94 01 movw r18, r8 22b32: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 22b36: 7f 93 push r23 22b38: 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; 22b3a: ca 01 movw r24, r20 22b3c: b9 01 movw r22, r18 22b3e: a5 01 movw r20, r10 22b40: 94 01 movw r18, r8 22b42: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 22b46: 7f 93 push r23 22b48: 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; 22b4a: c7 01 movw r24, r14 22b4c: b6 01 movw r22, r12 22b4e: 20 e1 ldi r18, 0x10 ; 16 22b50: 3e e0 ldi r19, 0x0E ; 14 22b52: 40 e0 ldi r20, 0x00 ; 0 22b54: 50 e0 ldi r21, 0x00 ; 0 22b56: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 22b5a: 5f 93 push r21 22b5c: 4f 93 push r20 22b5e: 3f 93 push r19 22b60: 2f 93 push r18 22b62: 0f 93 push r16 22b64: 1f 93 push r17 22b66: df 93 push r29 22b68: cf 93 push r28 22b6a: 4f 92 push r4 22b6c: 5f 92 push r5 22b6e: 6f 92 push r6 22b70: 7f 92 push r7 22b72: 81 e4 ldi r24, 0x41 ; 65 22b74: 9b e6 ldi r25, 0x6B ; 107 22b76: 9f 93 push r25 22b78: 8f 93 push r24 22b7a: 0e 94 db 6e call 0xddb6 ; 0xddb6 "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 22b7e: 8d b7 in r24, 0x3d ; 61 22b80: 9e b7 in r25, 0x3e ; 62 22b82: 42 96 adiw r24, 0x12 ; 18 22b84: 0f b6 in r0, 0x3f ; 63 22b86: f8 94 cli 22b88: 9e bf out 0x3e, r25 ; 62 22b8a: 0f be out 0x3f, r0 ; 63 22b8c: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 22b8e: df 91 pop r29 22b90: cf 91 pop r28 22b92: 1f 91 pop r17 22b94: 0f 91 pop r16 22b96: ff 90 pop r15 22b98: ef 90 pop r14 22b9a: df 90 pop r13 22b9c: cf 90 pop r12 22b9e: bf 90 pop r11 22ba0: af 90 pop r10 22ba2: 9f 90 pop r9 22ba4: 8f 90 pop r8 22ba6: 7f 90 pop r7 22ba8: 6f 90 pop r6 22baa: 5f 90 pop r5 22bac: 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(); 22bae: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 22bb2: 81 ef ldi r24, 0xF1 ; 241 22bb4: 9f e0 ldi r25, 0x0F ; 15 22bb6: 0f 94 a5 a3 call 0x3474a ; 0x3474a 22bba: 2b 01 movw r4, r22 22bbc: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 22bbe: 8d ee ldi r24, 0xED ; 237 22bc0: 9f e0 ldi r25, 0x0F ; 15 22bc2: 0f 94 a5 a3 call 0x3474a ; 0x3474a 22bc6: 6b 01 movw r12, r22 22bc8: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 22bca: 0e 94 ef 6f call 0xdfde ; 0xdfde lcd_printf_P(_N( 22bce: 8c ea ldi r24, 0xAC ; 172 22bd0: 98 e5 ldi r25, 0x58 ; 88 22bd2: 0e 94 0a 75 call 0xea14 ; 0xea14 22bd6: 98 2e mov r9, r24 22bd8: 89 2e mov r8, r25 22bda: 8b e9 ldi r24, 0x9B ; 155 22bdc: 98 e5 ldi r25, 0x58 ; 88 22bde: 0e 94 0a 75 call 0xea14 ; 0xea14 22be2: b8 2e mov r11, r24 22be4: 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; 22be6: c7 01 movw r24, r14 22be8: b6 01 movw r22, r12 22bea: 2c e3 ldi r18, 0x3C ; 60 22bec: 30 e0 ldi r19, 0x00 ; 0 22bee: 40 e0 ldi r20, 0x00 ; 0 22bf0: 50 e0 ldi r21, 0x00 ; 0 22bf2: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 22bf6: 7f 93 push r23 22bf8: 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; 22bfa: ca 01 movw r24, r20 22bfc: b9 01 movw r22, r18 22bfe: 28 e1 ldi r18, 0x18 ; 24 22c00: 30 e0 ldi r19, 0x00 ; 0 22c02: 40 e0 ldi r20, 0x00 ; 0 22c04: 50 e0 ldi r21, 0x00 ; 0 22c06: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22c0a: 7f 93 push r23 22c0c: 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; 22c0e: c7 01 movw r24, r14 22c10: b6 01 movw r22, r12 22c12: 20 ea ldi r18, 0xA0 ; 160 22c14: 35 e0 ldi r19, 0x05 ; 5 22c16: 40 e0 ldi r20, 0x00 ; 0 22c18: 50 e0 ldi r21, 0x00 ; 0 22c1a: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22c1e: 5f 93 push r21 22c20: 4f 93 push r20 22c22: 3f 93 push r19 22c24: 2f 93 push r18 22c26: 8f 92 push r8 22c28: 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; 22c2a: c3 01 movw r24, r6 22c2c: b2 01 movw r22, r4 22c2e: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 22c32: 20 e0 ldi r18, 0x00 ; 0 22c34: 30 e0 ldi r19, 0x00 ; 0 22c36: 48 ec ldi r20, 0xC8 ; 200 22c38: 52 e4 ldi r21, 0x42 ; 66 22c3a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22c3e: 9f 93 push r25 22c40: 8f 93 push r24 22c42: 7f 93 push r23 22c44: 6f 93 push r22 22c46: af 92 push r10 22c48: bf 92 push r11 22c4a: 8d e1 ldi r24, 0x1D ; 29 22c4c: 9b e6 ldi r25, 0x6B ; 107 22c4e: 9f 93 push r25 22c50: 8f 93 push r24 22c52: 0e 94 db 6e call 0xddb6 ; 0xddb6 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 22c56: 8d b7 in r24, 0x3d ; 61 22c58: 9e b7 in r25, 0x3e ; 62 22c5a: 42 96 adiw r24, 0x12 ; 18 22c5c: 0f b6 in r0, 0x3f ; 63 22c5e: f8 94 cli 22c60: 9e bf out 0x3e, r25 ; 62 22c62: 0f be out 0x3f, r0 ; 63 22c64: 8d bf out 0x3d, r24 ; 61 22c66: 93 cf rjmp .-218 ; 0x22b8e 00022c68 : SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } static void prusa_statistics_case0(uint8_t statnr) { 22c68: cf 93 push r28 22c6a: c8 2f mov r28, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 22c6c: 8b e7 ldi r24, 0x7B ; 123 22c6e: 0e 94 81 79 call 0xf302 ; 0xf302 SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); 22c72: 8c 2f mov r24, r28 22c74: 0f 94 35 06 call 0x20c6a ; 0x20c6a prusa_stat_farm_number(); 22c78: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 SERIAL_ECHO(current_temperature_bed); SERIAL_ECHO(']'); } static void prusa_stat_printinfo() { SERIAL_ECHOPGM("[TFU:"); 22c7c: 86 e1 ldi r24, 0x16 ; 22 22c7e: 99 e8 ldi r25, 0x89 ; 137 22c80: 0e 94 94 7a call 0xf528 ; 0xf528 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 22c84: 60 91 17 06 lds r22, 0x0617 ; 0x800617 22c88: 70 91 18 06 lds r23, 0x0618 ; 0x800618 22c8c: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22c90: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 22c94: 4a e0 ldi r20, 0x0A ; 10 22c96: 0e 94 95 79 call 0xf32a ; 0xf32a SERIAL_ECHO(total_filament_used); SERIAL_ECHOPGM("][PCD:"); 22c9a: 8f e0 ldi r24, 0x0F ; 15 22c9c: 99 e8 ldi r25, 0x89 ; 137 22c9e: 0e 94 94 7a call 0xf528 ; 0xf528 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;}; 22ca2: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 22ca6: 88 23 and r24, r24 22ca8: 09 f4 brne .+2 ; 0x22cac 22caa: 5e c0 rjmp .+188 ; 0x22d68 22cac: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 22cb0: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 22cb4: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 22cb8: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 22cbc: 00 97 sbiw r24, 0x00 ; 0 22cbe: a1 05 cpc r26, r1 22cc0: b1 05 cpc r27, r1 22cc2: 09 f4 brne .+2 ; 0x22cc6 22cc4: 51 c0 rjmp .+162 ; 0x22d68 22cc6: bc 01 movw r22, r24 22cc8: cd 01 movw r24, r26 22cca: 6d 59 subi r22, 0x9D ; 157 22ccc: 7f 4f sbci r23, 0xFF ; 255 22cce: 8f 4f sbci r24, 0xFF ; 255 22cd0: 9f 4f sbci r25, 0xFF ; 255 22cd2: 24 e6 ldi r18, 0x64 ; 100 22cd4: 30 e0 ldi r19, 0x00 ; 0 22cd6: 40 e0 ldi r20, 0x00 ; 0 22cd8: 50 e0 ldi r21, 0x00 ; 0 22cda: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 22cde: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 22ce2: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 22ce6: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 22cea: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 22cee: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 22cf2: 62 2f mov r22, r18 22cf4: 70 e0 ldi r23, 0x00 ; 0 22cf6: 90 e0 ldi r25, 0x00 ; 0 22cf8: 80 e0 ldi r24, 0x00 ; 0 22cfa: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); 22cfe: 88 e0 ldi r24, 0x08 ; 8 22d00: 99 e8 ldi r25, 0x89 ; 137 22d02: 0e 94 94 7a call 0xf528 ; 0xf528 22d06: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 22d0a: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 22d0e: 07 2e mov r0, r23 22d10: 00 0c add r0, r0 22d12: 88 0b sbc r24, r24 22d14: 99 0b sbc r25, r25 22d16: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); 22d1a: 81 e0 ldi r24, 0x01 ; 1 22d1c: 99 e8 ldi r25, 0x89 ; 137 22d1e: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 22d22: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 22d26: 81 11 cpse r24, r1 22d28: 21 c0 rjmp .+66 ; 0x22d6c 22d2a: 89 ed ldi r24, 0xD9 ; 217 22d2c: 93 e1 ldi r25, 0x13 ; 19 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 22d2e: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_ECHOPGM("][TIM:"); 22d32: 8a ef ldi r24, 0xFA ; 250 22d34: 98 e8 ldi r25, 0x88 ; 136 22d36: 0e 94 94 7a call 0xf528 ; 0xf528 if (print_job_timer.isRunning()) { 22d3a: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 22d3e: 81 30 cpi r24, 0x01 ; 1 22d40: c1 f4 brne .+48 ; 0x22d72 SERIAL_ECHO(print_job_timer.duration()); 22d42: 0f 94 22 15 call 0x22a44 ; 0x22a44 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 22d46: 4a e0 ldi r20, 0x0A ; 10 22d48: 0e 94 95 79 call 0xf32a ; 0xf32a } else { SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); 22d4c: 83 ef ldi r24, 0xF3 ; 243 22d4e: 98 e8 ldi r25, 0x88 ; 136 22d50: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 22d54: 8c ee ldi r24, 0xEC ; 236 22d56: 98 e8 ldi r25, 0x88 ; 136 22d58: 0e 94 94 7a call 0xf528 ; 0xf528 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 22d5c: 8d e5 ldi r24, 0x5D ; 93 22d5e: 0e 94 81 79 call 0xf302 ; 0xf302 static void prusa_statistics_case0(uint8_t statnr) { SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } 22d62: cf 91 pop r28 SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); SERIAL_ECHORPGM(FW_VERSION_STR_P()); SERIAL_ECHO(']'); prusa_stat_diameter(); 22d64: 0d 94 51 06 jmp 0x20ca2 ; 0x20ca2 22d68: 20 e0 ldi r18, 0x00 ; 0 22d6a: c3 cf rjmp .-122 ; 0x22cf2 SERIAL_ECHOPGM("][PCD:"); SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 22d6c: 8e ee ldi r24, 0xEE ; 238 22d6e: 93 e1 ldi r25, 0x13 ; 19 22d70: de cf rjmp .-68 ; 0x22d2e 22d72: 60 e0 ldi r22, 0x00 ; 0 22d74: 70 e0 ldi r23, 0x00 ; 0 22d76: cb 01 movw r24, r22 22d78: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 22d7c: e7 cf rjmp .-50 ; 0x22d4c 00022d7e : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 22d7e: 10 92 8b 03 sts 0x038B, r1 ; 0x80038b startTimestamp = 0; 22d82: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 22d86: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 22d8a: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e 22d8e: 10 92 7f 05 sts 0x057F, r1 ; 0x80057f stopTimestamp = 0; 22d92: 10 92 0b 06 sts 0x060B, r1 ; 0x80060b 22d96: 10 92 0c 06 sts 0x060C, r1 ; 0x80060c 22d9a: 10 92 0d 06 sts 0x060D, r1 ; 0x80060d 22d9e: 10 92 0e 06 sts 0x060E, r1 ; 0x80060e accumulator = 0; 22da2: 10 92 78 05 sts 0x0578, r1 ; 0x800578 22da6: 10 92 79 05 sts 0x0579, r1 ; 0x800579 22daa: 10 92 7a 05 sts 0x057A, r1 ; 0x80057a 22dae: 10 92 7b 05 sts 0x057B, r1 ; 0x80057b } 22db2: 08 95 ret 00022db4 : /** * @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; } 22db4: 80 91 8b 03 lds r24, 0x038B ; 0x80038b } else return false; } bool Stopwatch::start() { if (!isRunning()) { 22db8: 81 30 cpi r24, 0x01 ; 1 22dba: f1 f0 breq .+60 ; 0x22df8 if (isPaused()) accumulator = duration(); 22dbc: 82 30 cpi r24, 0x02 ; 2 22dbe: c9 f4 brne .+50 ; 0x22df2 22dc0: 0f 94 22 15 call 0x22a44 ; 0x22a44 22dc4: 60 93 78 05 sts 0x0578, r22 ; 0x800578 22dc8: 70 93 79 05 sts 0x0579, r23 ; 0x800579 22dcc: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a 22dd0: 90 93 7b 05 sts 0x057B, r25 ; 0x80057b else reset(); state = RUNNING; 22dd4: 81 e0 ldi r24, 0x01 ; 1 22dd6: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b startTimestamp = _millis(); 22dda: 0f 94 56 0b call 0x216ac ; 0x216ac 22dde: 60 93 7c 05 sts 0x057C, r22 ; 0x80057c 22de2: 70 93 7d 05 sts 0x057D, r23 ; 0x80057d 22de6: 80 93 7e 05 sts 0x057E, r24 ; 0x80057e 22dea: 90 93 7f 05 sts 0x057F, r25 ; 0x80057f 22dee: 81 e0 ldi r24, 0x01 ; 1 22df0: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 22df2: 0f 94 bf 16 call 0x22d7e ; 0x22d7e 22df6: ee cf rjmp .-36 ; 0x22dd4 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 22df8: 80 e0 ldi r24, 0x00 ; 0 } 22dfa: 08 95 ret 00022dfc : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 22dfc: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 22e00: 81 50 subi r24, 0x01 ; 1 22e02: 82 30 cpi r24, 0x02 ; 2 22e04: 70 f4 brcc .+28 ; 0x22e22 state = STOPPED; 22e06: 10 92 8b 03 sts 0x038B, r1 ; 0x80038b stopTimestamp = _millis(); 22e0a: 0f 94 56 0b call 0x216ac ; 0x216ac 22e0e: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 22e12: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 22e16: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 22e1a: 90 93 0e 06 sts 0x060E, r25 ; 0x80060e 22e1e: 81 e0 ldi r24, 0x01 ; 1 22e20: 08 95 ret return true; } else return false; 22e22: 80 e0 ldi r24, 0x00 ; 0 } 22e24: 08 95 ret 00022e26 : #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 22e26: 2f ef ldi r18, 0xFF ; 255 22e28: 30 e0 ldi r19, 0x00 ; 0 22e2a: dc 01 movw r26, r24 22e2c: 0f 94 bd a4 call 0x3497a ; 0x3497a <__usmulhisi3> 22e30: 20 ed ldi r18, 0xD0 ; 208 22e32: 37 e0 ldi r19, 0x07 ; 7 22e34: 40 e0 ldi r20, 0x00 ; 0 22e36: 50 e0 ldi r21, 0x00 ; 0 22e38: 0f 94 8e a4 call 0x3491c ; 0x3491c <__divmodsi4> 22e3c: b9 01 movw r22, r18 22e3e: 8c e2 ldi r24, 0x2C ; 44 22e40: 0c 94 5f d1 jmp 0x1a2be ; 0x1a2be 00022e44 : case 16: microstep_ms(driver,MICROSTEP16); break; } } void microstep_readings() { 22e44: cf 93 push r28 22e46: df 93 push r29 SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); 22e48: 85 ea ldi r24, 0xA5 ; 165 22e4a: 93 e9 ldi r25, 0x93 ; 147 22e4c: 0e 94 8d 7c call 0xf91a ; 0xf91a SERIAL_PROTOCOLPGM("X: "); 22e50: 81 ea ldi r24, 0xA1 ; 161 22e52: 93 e9 ldi r25, 0x93 ; 147 22e54: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL( READ(X_MS1_PIN)); 22e58: 62 b3 in r22, 0x12 ; 18 22e5a: 66 95 lsr r22 22e5c: 61 70 andi r22, 0x01 ; 1 22e5e: 70 e0 ldi r23, 0x00 ; 0 22e60: 90 e0 ldi r25, 0x00 ; 0 22e62: 80 e0 ldi r24, 0x00 ; 0 22e64: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOLLN( READ(X_MS2_PIN)); 22e68: 82 b3 in r24, 0x12 ; 18 22e6a: 81 70 andi r24, 0x01 ; 1 22e6c: 90 e0 ldi r25, 0x00 ; 0 22e6e: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e SERIAL_PROTOCOLPGM("Y: "); 22e72: 8d e9 ldi r24, 0x9D ; 157 22e74: 93 e9 ldi r25, 0x93 ; 147 22e76: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL( READ(Y_MS1_PIN)); 22e7a: c6 e0 ldi r28, 0x06 ; 6 22e7c: d1 e0 ldi r29, 0x01 ; 1 22e7e: 68 81 ld r22, Y 22e80: 06 2e mov r0, r22 22e82: 00 0c add r0, r0 22e84: 77 0b sbc r23, r23 22e86: 88 0b sbc r24, r24 22e88: 99 0b sbc r25, r25 22e8a: 66 27 eor r22, r22 22e8c: 97 fd sbrc r25, 7 22e8e: 63 95 inc r22 22e90: 77 27 eor r23, r23 22e92: 88 27 eor r24, r24 22e94: 99 27 eor r25, r25 22e96: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOLLN( READ(Y_MS2_PIN)); 22e9a: 82 b3 in r24, 0x12 ; 18 22e9c: 82 fb bst r24, 2 22e9e: 88 27 eor r24, r24 22ea0: 80 f9 bld r24, 0 22ea2: 90 e0 ldi r25, 0x00 ; 0 22ea4: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e SERIAL_PROTOCOLPGM("Z: "); 22ea8: 89 e9 ldi r24, 0x99 ; 153 22eaa: 93 e9 ldi r25, 0x93 ; 147 22eac: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL( READ(Z_MS1_PIN)); 22eb0: 68 81 ld r22, Y 22eb2: 66 fb bst r22, 6 22eb4: 66 27 eor r22, r22 22eb6: 60 f9 bld r22, 0 22eb8: 70 e0 ldi r23, 0x00 ; 0 22eba: 90 e0 ldi r25, 0x00 ; 0 22ebc: 80 e0 ldi r24, 0x00 ; 0 22ebe: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); 22ec2: 88 81 ld r24, Y 22ec4: 85 fb bst r24, 5 22ec6: 88 27 eor r24, r24 22ec8: 80 f9 bld r24, 0 22eca: 90 e0 ldi r25, 0x00 ; 0 22ecc: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e SERIAL_PROTOCOLPGM("E0: "); 22ed0: 84 e9 ldi r24, 0x94 ; 148 22ed2: 93 e9 ldi r25, 0x93 ; 147 22ed4: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOL( READ(E0_MS1_PIN)); 22ed8: 68 81 ld r22, Y 22eda: 63 fb bst r22, 3 22edc: 66 27 eor r22, r22 22ede: 60 f9 bld r22, 0 22ee0: 70 e0 ldi r23, 0x00 ; 0 22ee2: 90 e0 ldi r25, 0x00 ; 0 22ee4: 80 e0 ldi r24, 0x00 ; 0 22ee6: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 22eea: 88 81 ld r24, Y 22eec: 82 95 swap r24 22eee: 81 70 andi r24, 0x01 ; 1 22ef0: 90 e0 ldi r25, 0x00 ; 0 #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 SERIAL_PROTOCOLPGM("E1: "); SERIAL_PROTOCOL( READ(E1_MS1_PIN)); SERIAL_PROTOCOLLN( READ(E1_MS2_PIN)); #endif } 22ef2: df 91 pop r29 22ef4: cf 91 pop r28 SERIAL_PROTOCOLPGM("Z: "); SERIAL_PROTOCOL( READ(Z_MS1_PIN)); SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); SERIAL_PROTOCOLPGM("E0: "); SERIAL_PROTOCOL( READ(E0_MS1_PIN)); SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 22ef6: 0d 94 97 65 jmp 0x2cb2e ; 0x2cb2e 00022efa : #endif } void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) 22efa: 67 fd sbrc r22, 7 22efc: 08 c0 rjmp .+16 ; 0x22f0e 22efe: 81 30 cpi r24, 0x01 ; 1 22f00: 21 f1 breq .+72 ; 0x22f4a 22f02: d8 f0 brcs .+54 ; 0x22f3a 22f04: 82 30 cpi r24, 0x02 ; 2 22f06: 99 f1 breq .+102 ; 0x22f6e 22f08: 83 30 cpi r24, 0x03 ; 3 22f0a: 09 f4 brne .+2 ; 0x22f0e 22f0c: 42 c0 rjmp .+132 ; 0x22f92 case 3: WRITE(E0_MS1_PIN,ms1); break; #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 22f0e: 47 fd sbrc r20, 7 22f10: 4c c0 rjmp .+152 ; 0x22faa 22f12: 81 30 cpi r24, 0x01 ; 1 22f14: 09 f4 brne .+2 ; 0x22f18 22f16: 55 c0 rjmp .+170 ; 0x22fc2 22f18: 08 f4 brcc .+2 ; 0x22f1c 22f1a: 4d c0 rjmp .+154 ; 0x22fb6 22f1c: 82 30 cpi r24, 0x02 ; 2 22f1e: 09 f4 brne .+2 ; 0x22f22 22f20: 56 c0 rjmp .+172 ; 0x22fce 22f22: 83 30 cpi r24, 0x03 ; 3 22f24: 09 f0 breq .+2 ; 0x22f28 22f26: 41 c0 rjmp .+130 ; 0x22faa { case 0: WRITE( X_MS2_PIN,ms2); break; case 1: WRITE( Y_MS2_PIN,ms2); break; case 2: WRITE( Z_MS2_PIN,ms2); break; case 3: WRITE(E0_MS2_PIN,ms2); break; 22f28: 9f b7 in r25, 0x3f ; 63 22f2a: 44 23 and r20, r20 22f2c: 09 f4 brne .+2 ; 0x22f30 22f2e: 5f c0 rjmp .+190 ; 0x22fee 22f30: f8 94 cli 22f32: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f36: 80 61 ori r24, 0x10 ; 16 22f38: 51 c0 rjmp .+162 ; 0x22fdc void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; 22f3a: 66 23 and r22, r22 22f3c: 21 f0 breq .+8 ; 0x22f46 22f3e: a1 9a sbi 0x14, 1 ; 20 case 3: WRITE(E0_MS1_PIN,ms1); break; #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 22f40: 47 ff sbrs r20, 7 22f42: 39 c0 rjmp .+114 ; 0x22fb6 22f44: 08 95 ret void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; 22f46: a1 98 cbi 0x14, 1 ; 20 22f48: fb cf rjmp .-10 ; 0x22f40 case 1: WRITE( Y_MS1_PIN,ms1); break; 22f4a: 9f b7 in r25, 0x3f ; 63 22f4c: 66 23 and r22, r22 22f4e: 51 f0 breq .+20 ; 0x22f64 22f50: f8 94 cli 22f52: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f56: 80 68 ori r24, 0x80 ; 128 22f58: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f5c: 9f bf out 0x3f, r25 ; 63 case 3: WRITE(E0_MS1_PIN,ms1); break; #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 22f5e: 47 ff sbrs r20, 7 22f60: 30 c0 rjmp .+96 ; 0x22fc2 22f62: 08 95 ret void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; case 1: WRITE( Y_MS1_PIN,ms1); break; 22f64: f8 94 cli 22f66: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f6a: 8f 77 andi r24, 0x7F ; 127 22f6c: f5 cf rjmp .-22 ; 0x22f58 case 2: WRITE( Z_MS1_PIN,ms1); break; 22f6e: 9f b7 in r25, 0x3f ; 63 22f70: 66 23 and r22, r22 22f72: 51 f0 breq .+20 ; 0x22f88 22f74: f8 94 cli 22f76: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f7a: 80 64 ori r24, 0x40 ; 64 22f7c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f80: 9f bf out 0x3f, r25 ; 63 case 3: WRITE(E0_MS1_PIN,ms1); break; #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 22f82: 47 ff sbrs r20, 7 22f84: 24 c0 rjmp .+72 ; 0x22fce 22f86: 08 95 ret { if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; case 1: WRITE( Y_MS1_PIN,ms1); break; case 2: WRITE( Z_MS1_PIN,ms1); break; 22f88: f8 94 cli 22f8a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f8e: 8f 7b andi r24, 0xBF ; 191 22f90: f5 cf rjmp .-22 ; 0x22f7c case 3: WRITE(E0_MS1_PIN,ms1); break; 22f92: 9f b7 in r25, 0x3f ; 63 22f94: 66 23 and r22, r22 22f96: 51 f0 breq .+20 ; 0x22fac 22f98: f8 94 cli 22f9a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f9e: 88 60 ori r24, 0x08 ; 8 22fa0: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fa4: 9f bf out 0x3f, r25 ; 63 #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 22fa6: 47 ff sbrs r20, 7 22fa8: bf cf rjmp .-130 ; 0x22f28 case 3: WRITE(E0_MS2_PIN,ms2); break; #if defined(E1_MS2_PIN) && E1_MS2_PIN > -1 case 4: WRITE(E1_MS2_PIN,ms2); break; #endif } } 22faa: 08 95 ret if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; case 1: WRITE( Y_MS1_PIN,ms1); break; case 2: WRITE( Z_MS1_PIN,ms1); break; case 3: WRITE(E0_MS1_PIN,ms1); break; 22fac: f8 94 cli 22fae: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fb2: 87 7f andi r24, 0xF7 ; 247 22fb4: f5 cf rjmp .-22 ; 0x22fa0 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) { case 0: WRITE( X_MS2_PIN,ms2); break; 22fb6: 44 23 and r20, r20 22fb8: 11 f0 breq .+4 ; 0x22fbe 22fba: a0 9a sbi 0x14, 0 ; 20 22fbc: 08 95 ret 22fbe: a0 98 cbi 0x14, 0 ; 20 22fc0: 08 95 ret case 1: WRITE( Y_MS2_PIN,ms2); break; 22fc2: 44 23 and r20, r20 22fc4: 11 f0 breq .+4 ; 0x22fca 22fc6: a2 9a sbi 0x14, 2 ; 20 22fc8: 08 95 ret 22fca: a2 98 cbi 0x14, 2 ; 20 22fcc: 08 95 ret case 2: WRITE( Z_MS2_PIN,ms2); break; 22fce: 9f b7 in r25, 0x3f ; 63 22fd0: 44 23 and r20, r20 22fd2: 41 f0 breq .+16 ; 0x22fe4 22fd4: f8 94 cli 22fd6: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fda: 80 62 ori r24, 0x20 ; 32 22fdc: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fe0: 9f bf out 0x3f, r25 ; 63 22fe2: 08 95 ret 22fe4: f8 94 cli 22fe6: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fea: 8f 7d andi r24, 0xDF ; 223 22fec: f7 cf rjmp .-18 ; 0x22fdc case 3: WRITE(E0_MS2_PIN,ms2); break; 22fee: f8 94 cli 22ff0: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22ff4: 8f 7e andi r24, 0xEF ; 239 22ff6: f2 cf rjmp .-28 ; 0x22fdc 00022ff8 : } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 22ff8: 64 30 cpi r22, 0x04 ; 4 22ffa: 81 f0 breq .+32 ; 0x2301c 22ffc: 30 f4 brcc .+12 ; 0x2300a 22ffe: 61 30 cpi r22, 0x01 ; 1 23000: 49 f0 breq .+18 ; 0x23014 { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; 23002: 40 e0 ldi r20, 0x00 ; 0 } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 23004: 62 30 cpi r22, 0x02 ; 2 23006: 69 f0 breq .+26 ; 0x23022 23008: 08 95 ret 2300a: 68 30 cpi r22, 0x08 ; 8 2300c: 49 f0 breq .+18 ; 0x23020 2300e: 60 31 cpi r22, 0x10 ; 16 23010: 39 f0 breq .+14 ; 0x23020 23012: 08 95 ret { case 1: microstep_ms(driver,MICROSTEP1); break; 23014: 40 e0 ldi r20, 0x00 ; 0 case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 23016: 60 e0 ldi r22, 0x00 ; 0 case 8: microstep_ms(driver,MICROSTEP8); break; 23018: 0d 94 7d 17 jmp 0x22efa ; 0x22efa { switch(stepping_mode) { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 2301c: 41 e0 ldi r20, 0x01 ; 1 2301e: fb cf rjmp .-10 ; 0x23016 case 8: microstep_ms(driver,MICROSTEP8); break; 23020: 41 e0 ldi r20, 0x01 ; 1 23022: 61 e0 ldi r22, 0x01 ; 1 23024: f9 cf rjmp .-14 ; 0x23018 00023026 : #endif } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { 23026: db 01 movw r26, r22 if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 23028: 81 11 cpse r24, r1 2302a: 0e c0 rjmp .+28 ; 0x23048 2302c: 2f ef ldi r18, 0xFF ; 255 2302e: 30 e0 ldi r19, 0x00 ; 0 23030: 0f 94 bd a4 call 0x3497a ; 0x3497a <__usmulhisi3> 23034: 20 ed ldi r18, 0xD0 ; 208 23036: 37 e0 ldi r19, 0x07 ; 7 23038: 40 e0 ldi r20, 0x00 ; 0 2303a: 50 e0 ldi r21, 0x00 ; 0 2303c: 0f 94 8e a4 call 0x3491c ; 0x3491c <__divmodsi4> 23040: b9 01 movw r22, r18 23042: 8e e2 ldi r24, 0x2E ; 46 if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 23044: 0c 94 5f d1 jmp 0x1a2be ; 0x1a2be 23048: 81 30 cpi r24, 0x01 ; 1 2304a: 69 f4 brne .+26 ; 0x23066 2304c: 2f ef ldi r18, 0xFF ; 255 2304e: 30 e0 ldi r19, 0x00 ; 0 23050: 0f 94 bd a4 call 0x3497a ; 0x3497a <__usmulhisi3> 23054: 20 ed ldi r18, 0xD0 ; 208 23056: 37 e0 ldi r19, 0x07 ; 7 23058: 40 e0 ldi r20, 0x00 ; 0 2305a: 50 e0 ldi r21, 0x00 ; 0 2305c: 0f 94 8e a4 call 0x3491c ; 0x3491c <__divmodsi4> 23060: b9 01 movw r22, r18 23062: 8d e2 ldi r24, 0x2D ; 45 23064: ef cf rjmp .-34 ; 0x23044 if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 23066: 82 30 cpi r24, 0x02 ; 2 23068: 19 f4 brne .+6 ; 0x23070 2306a: cb 01 movw r24, r22 2306c: 0d 94 13 17 jmp 0x22e26 ; 0x22e26 } 23070: 08 95 ret 00023072 : #ifndef TMC2130 void st_current_init() //Initialize Digipot Motor Current { #ifdef MOTOR_CURRENT_PWM_XY_PIN uint8_t SilentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 23072: 8f ef ldi r24, 0xFF ; 255 23074: 9f e0 ldi r25, 0x0F ; 15 23076: 0f 94 9d a3 call 0x3473a ; 0x3473a SilentModeMenu = SilentMode; 2307a: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); 2307e: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 23082: 98 60 ori r25, 0x08 ; 8 23084: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); 23088: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2308c: 90 61 ori r25, 0x10 ; 16 2308e: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); 23092: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 23096: 90 62 ori r25, 0x20 ; 32 23098: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> if((SilentMode == SILENT_MODE_OFF) || (farm_mode) ){ 2309c: 88 23 and r24, r24 2309e: 21 f0 breq .+8 ; 0x230a8 230a0: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 230a4: 88 23 and r24, r24 230a6: 59 f1 breq .+86 ; 0x230fe motor_current_setting[0] = motor_current_setting_loud[0]; 230a8: 8c e1 ldi r24, 0x1C ; 28 230aa: 92 e0 ldi r25, 0x02 ; 2 230ac: 90 93 60 02 sts 0x0260, r25 ; 0x800260 230b0: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f motor_current_setting[1] = motor_current_setting_loud[1]; 230b4: 8e e3 ldi r24, 0x3E ; 62 230b6: 93 e0 ldi r25, 0x03 ; 3 230b8: 90 93 62 02 sts 0x0262, r25 ; 0x800262 230bc: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[2] = motor_current_setting_loud[2]; 230c0: 84 ef ldi r24, 0xF4 ; 244 230c2: 91 e0 ldi r25, 0x01 ; 1 }else{ motor_current_setting[0] = motor_current_setting_silent[0]; motor_current_setting[1] = motor_current_setting_silent[1]; motor_current_setting[2] = motor_current_setting_silent[2]; 230c4: 90 93 64 02 sts 0x0264, r25 ; 0x800264 230c8: 80 93 63 02 sts 0x0263, r24 ; 0x800263 } st_current_set(0, motor_current_setting[0]); 230cc: 60 91 5f 02 lds r22, 0x025F ; 0x80025f 230d0: 70 91 60 02 lds r23, 0x0260 ; 0x800260 230d4: 80 e0 ldi r24, 0x00 ; 0 230d6: 0f 94 13 18 call 0x23026 ; 0x23026 st_current_set(1, motor_current_setting[1]); 230da: 6e e3 ldi r22, 0x3E ; 62 230dc: 73 e0 ldi r23, 0x03 ; 3 230de: 81 e0 ldi r24, 0x01 ; 1 230e0: 0f 94 13 18 call 0x23026 ; 0x23026 230e4: 80 91 63 02 lds r24, 0x0263 ; 0x800263 230e8: 90 91 64 02 lds r25, 0x0264 ; 0x800264 230ec: 0f 94 13 17 call 0x22e26 ; 0x22e26 st_current_set(2, motor_current_setting[2]); //Set timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise) TCCR5B = (TCCR5B & ~(_BV(CS50) | _BV(CS51) | _BV(CS52))) | _BV(CS50); 230f0: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 230f4: 88 7f andi r24, 0xF8 ; 248 230f6: 81 60 ori r24, 0x01 ; 1 230f8: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> #endif } 230fc: 08 95 ret motor_current_setting[1] = motor_current_setting_loud[1]; motor_current_setting[2] = motor_current_setting_loud[2]; }else{ motor_current_setting[0] = motor_current_setting_silent[0]; 230fe: 8e e0 ldi r24, 0x0E ; 14 23100: 91 e0 ldi r25, 0x01 ; 1 23102: 90 93 60 02 sts 0x0260, r25 ; 0x800260 23106: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f motor_current_setting[1] = motor_current_setting_silent[1]; 2310a: 8e e3 ldi r24, 0x3E ; 62 2310c: 93 e0 ldi r25, 0x03 ; 3 2310e: 90 93 62 02 sts 0x0262, r25 ; 0x800262 23112: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[2] = motor_current_setting_silent[2]; 23116: 82 ec ldi r24, 0xC2 ; 194 23118: 91 e0 ldi r25, 0x01 ; 1 2311a: d4 cf rjmp .-88 ; 0x230c4 0002311c : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 2311c: 2f b7 in r18, 0x3f ; 63 2311e: f8 94 cli count_pos = count_position[axis]; 23120: 94 e0 ldi r25, 0x04 ; 4 23122: 89 9f mul r24, r25 23124: f0 01 movw r30, r0 23126: 11 24 eor r1, r1 23128: e4 5b subi r30, 0xB4 ; 180 2312a: f9 4f sbci r31, 0xF9 ; 249 2312c: 60 81 ld r22, Z 2312e: 71 81 ldd r23, Z+1 ; 0x01 23130: 82 81 ldd r24, Z+2 ; 0x02 23132: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 23134: 2f bf out 0x3f, r18 ; 63 return count_pos; } 23136: 08 95 ret 00023138 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 23138: cf 93 push r28 2313a: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 2313c: 0f 94 8e 18 call 0x2311c ; 0x2311c 23140: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 23144: 24 e0 ldi r18, 0x04 ; 4 23146: c2 9f mul r28, r18 23148: f0 01 movw r30, r0 2314a: 11 24 eor r1, r1 2314c: e5 59 subi r30, 0x95 ; 149 2314e: f2 4f sbci r31, 0xF2 ; 242 23150: 20 81 ld r18, Z 23152: 31 81 ldd r19, Z+1 ; 0x01 23154: 42 81 ldd r20, Z+2 ; 0x02 23156: 53 81 ldd r21, Z+3 ; 0x03 23158: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> } 2315c: cf 91 pop r28 2315e: 08 95 ret 00023160 : 23160: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 23164: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f // Block until all buffered steps are executed void st_synchronize() { while(blocks_queued()) 23168: 98 17 cp r25, r24 2316a: 29 f0 breq .+10 ; 0x23176 manage_inactivity(true); lcd_update(0); } #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); 2316c: 90 e0 ldi r25, 0x00 ; 0 2316e: 80 e0 ldi r24, 0x00 ; 0 23170: 0e 94 7f 8c call 0x118fe ; 0x118fe 23174: f5 cf rjmp .-22 ; 0x23160 #endif //TMC2130 } } 23176: 08 95 ret 00023178 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 23178: cf 92 push r12 2317a: ef 92 push r14 2317c: ff 92 push r15 2317e: 0f 93 push r16 23180: 1f 93 push r17 23182: cf 93 push r28 23184: 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); 23186: 86 e4 ldi r24, 0x46 ; 70 23188: 98 e4 ldi r25, 0x48 ; 72 2318a: 0e 94 0a 75 call 0xea14 ; 0xea14 2318e: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__strlen_P> 23192: c8 2e mov r12, r24 23194: 86 e4 ldi r24, 0x46 ; 70 23196: 98 e5 ldi r25, 0x58 ; 88 23198: 0e 94 0a 75 call 0xea14 ; 0xea14 2319c: 7c 01 movw r14, r24 2319e: 8c e4 ldi r24, 0x4C ; 76 231a0: 98 e4 ldi r25, 0x48 ; 72 231a2: 0e 94 0a 75 call 0xea14 ; 0xea14 231a6: 8c 01 movw r16, r24 231a8: 86 e4 ldi r24, 0x46 ; 70 231aa: 98 e4 ldi r25, 0x48 ; 72 231ac: 0e 94 0a 75 call 0xea14 ; 0xea14 231b0: ec 01 movw r28, r24 231b2: 8b e1 ldi r24, 0x1B ; 27 231b4: 98 e5 ldi r25, 0x58 ; 88 231b6: 0e 94 0a 75 call 0xea14 ; 0xea14 231ba: c3 94 inc r12 231bc: c3 94 inc r12 231be: 9e 01 movw r18, r28 231c0: 40 e0 ldi r20, 0x00 ; 0 231c2: 60 e0 ldi r22, 0x00 ; 0 231c4: 0e 94 95 e2 call 0x1c52a ; 0x1c52a while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 231c8: 81 30 cpi r24, 0x01 ; 1 231ca: 29 f4 brne .+10 ; 0x231d6 load_filament_final_feed(); 231cc: 0e 94 bd 63 call 0xc77a ; 0xc77a st_synchronize(); 231d0: 0f 94 b0 18 call 0x23160 ; 0x23160 231d4: d8 cf rjmp .-80 ; 0x23186 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) { 231d6: 82 30 cpi r24, 0x02 ; 2 231d8: 61 f4 brne .+24 ; 0x231f2 unload_filament(FILAMENTCHANGE_FINALRETRACT); 231da: 60 e0 ldi r22, 0x00 ; 0 231dc: 70 e0 ldi r23, 0x00 ; 0 231de: cb 01 movw r24, r22 } } 231e0: df 91 pop r29 231e2: cf 91 pop r28 231e4: 1f 91 pop r17 231e6: 0f 91 pop r16 231e8: ff 90 pop r15 231ea: ef 90 pop r14 231ec: 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); 231ee: 0c 94 6f e1 jmp 0x1c2de ; 0x1c2de } } 231f2: df 91 pop r29 231f4: cf 91 pop r28 231f6: 1f 91 pop r17 231f8: 0f 91 pop r16 231fa: ff 90 pop r15 231fc: ef 90 pop r14 231fe: cf 90 pop r12 23200: 08 95 ret 00023202 : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 23202: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 23204: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 23208: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2320c: 80 ed ldi r24, 0xD0 ; 208 2320e: 97 e0 ldi r25, 0x07 ; 7 23210: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 23214: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 23218: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 2321c: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.439> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 23220: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> 23224: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 23228: 01 97 sbiw r24, 0x01 ; 1 2322a: 8e 3f cpi r24, 0xFE ; 254 2322c: 9f 4f sbci r25, 0xFF ; 255 2322e: 20 f4 brcc .+8 ; 0x23238 nextAdvanceISR = 0; 23230: 10 92 4d 04 sts 0x044D, r1 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 23234: 10 92 4c 04 sts 0x044C, r1 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> #endif } 23238: 08 95 ret 0002323a <__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) { 2323a: 1f 92 push r1 2323c: 0f 92 push r0 2323e: 0f b6 in r0, 0x3f ; 63 23240: 0f 92 push r0 23242: 11 24 eor r1, r1 23244: 0b b6 in r0, 0x3b ; 59 23246: 0f 92 push r0 23248: 4f 92 push r4 2324a: 5f 92 push r5 2324c: 6f 92 push r6 2324e: 7f 92 push r7 23250: 8f 92 push r8 23252: cf 92 push r12 23254: df 92 push r13 23256: ef 92 push r14 23258: ff 92 push r15 2325a: 1f 93 push r17 2325c: 2f 93 push r18 2325e: 3f 93 push r19 23260: 4f 93 push r20 23262: 5f 93 push r21 23264: 6f 93 push r22 23266: 7f 93 push r23 23268: 8f 93 push r24 2326a: 9f 93 push r25 2326c: af 93 push r26 2326e: bf 93 push r27 23270: cf 93 push r28 23272: df 93 push r29 23274: ef 93 push r30 23276: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 23278: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> 2327c: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 23280: 9c 01 movw r18, r24 23282: 21 50 subi r18, 0x01 ; 1 23284: 31 09 sbc r19, r1 23286: 2e 3f cpi r18, 0xFE ; 254 23288: 3f 4f sbci r19, 0xFF ; 255 2328a: 90 f4 brcc .+36 ; 0x232b0 <__vector_17+0x76> { if(nextAdvanceISR > OCR1A) 2328c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 23290: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 23294: 28 17 cp r18, r24 23296: 39 07 cpc r19, r25 23298: 08 f0 brcs .+2 ; 0x2329c <__vector_17+0x62> 2329a: f9 c0 rjmp .+498 ; 0x2348e <__vector_17+0x254> nextAdvanceISR -= OCR1A; 2329c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 232a0: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 232a4: 82 1b sub r24, r18 232a6: 93 0b sbc r25, r19 232a8: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 232ac: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 232b0: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 232b4: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 232b8: 80 91 4e 04 lds r24, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.439> 232bc: 90 91 4f 04 lds r25, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 232c0: 28 17 cp r18, r24 232c2: 39 07 cpc r19, r25 232c4: 08 f0 brcs .+2 ; 0x232c8 <__vector_17+0x8e> 232c6: e8 c0 rjmp .+464 ; 0x23498 <__vector_17+0x25e> nextMainISR -= OCR1A; 232c8: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 232cc: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 232d0: 82 1b sub r24, r18 232d2: 93 0b sbc r25, r19 232d4: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 232d8: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.439> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 232dc: 80 91 4e 04 lds r24, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.439> 232e0: 90 91 4f 04 lds r25, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 232e4: 89 2b or r24, r25 232e6: 11 f0 breq .+4 ; 0x232ec <__vector_17+0xb2> 232e8: 0d 94 08 22 jmp 0x24410 ; 0x24410 <__vector_17+0x11d6> 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) 232ec: e0 91 51 12 lds r30, 0x1251 ; 0x801251 232f0: f0 91 52 12 lds r31, 0x1252 ; 0x801252 232f4: 30 97 sbiw r30, 0x00 ; 0 232f6: 09 f0 breq .+2 ; 0x232fa <__vector_17+0xc0> 232f8: 82 c1 rjmp .+772 ; 0x235fe <__vector_17+0x3c4> // 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) { 232fa: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 232fe: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 23302: 98 17 cp r25, r24 23304: 09 f4 brne .+2 ; 0x23308 <__vector_17+0xce> 23306: 35 c3 rjmp .+1642 ; 0x23972 <__vector_17+0x738> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 23308: c0 91 3f 0d lds r28, 0x0D3F ; 0x800d3f 2330c: 2c 2f mov r18, r28 2330e: 30 e0 ldi r19, 0x00 ; 0 23310: 5e e6 ldi r21, 0x6E ; 110 23312: c5 9f mul r28, r21 23314: e0 01 movw r28, r0 23316: 11 24 eor r1, r1 23318: c2 5a subi r28, 0xA2 ; 162 2331a: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 2331c: fe 01 movw r30, r28 2331e: e9 5b subi r30, 0xB9 ; 185 23320: ff 4f sbci r31, 0xFF ; 255 23322: 41 e0 ldi r20, 0x01 ; 1 23324: 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(); 23326: d0 93 52 12 sts 0x1252, r29 ; 0x801252 2332a: c0 93 51 12 sts 0x1251, r28 ; 0x801251 if (current_block != NULL) { 2332e: 20 97 sbiw r28, 0x00 ; 0 23330: 09 f4 brne .+2 ; 0x23334 <__vector_17+0xfa> 23332: 1f c3 rjmp .+1598 ; 0x23972 <__vector_17+0x738> // 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; 23334: 10 92 74 05 sts 0x0574, r1 ; 0x800574 23338: 10 92 75 05 sts 0x0575, r1 ; 0x800575 2333c: 10 92 76 05 sts 0x0576, r1 ; 0x800576 23340: 10 92 77 05 sts 0x0577, r1 ; 0x800577 // 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; 23344: 10 92 73 05 sts 0x0573, r1 ; 0x800573 acc_step_rate = uint16_t(current_block->initial_rate); 23348: 8a ad ldd r24, Y+58 ; 0x3a 2334a: 9b ad ldd r25, Y+59 ; 0x3b 2334c: 90 93 72 05 sts 0x0572, r25 ; 0x800572 23350: 80 93 71 05 sts 0x0571, r24 ; 0x800571 #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; 23354: 81 34 cpi r24, 0x41 ; 65 23356: ac e9 ldi r26, 0x9C ; 156 23358: 9a 07 cpc r25, r26 2335a: 08 f0 brcs .+2 ; 0x2335e <__vector_17+0x124> 2335c: a2 c0 rjmp .+324 ; 0x234a2 <__vector_17+0x268> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2335e: 81 32 cpi r24, 0x21 ; 33 23360: be e4 ldi r27, 0x4E ; 78 23362: 9b 07 cpc r25, r27 23364: 08 f4 brcc .+2 ; 0x23368 <__vector_17+0x12e> 23366: a0 c0 rjmp .+320 ; 0x234a8 <__vector_17+0x26e> step_rate = (step_rate >> 2)&0x3fff; 23368: 96 95 lsr r25 2336a: 87 95 ror r24 2336c: 96 95 lsr r25 2336e: 87 95 ror r24 step_loops = 4; 23370: 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; 23372: 40 93 70 05 sts 0x0570, r20 ; 0x800570 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 23376: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 23378: 81 15 cp r24, r1 2337a: f8 e0 ldi r31, 0x08 ; 8 2337c: 9f 07 cpc r25, r31 2337e: 08 f4 brcc .+2 ; 0x23382 <__vector_17+0x148> 23380: a4 c0 rjmp .+328 ; 0x234ca <__vector_17+0x290> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 23382: e9 2f mov r30, r25 23384: ff 27 eor r31, r31 23386: ee 0f add r30, r30 23388: ff 1f adc r31, r31 2338a: ee 0f add r30, r30 2338c: ff 1f adc r31, r31 2338e: af 01 movw r20, r30 23390: 4c 56 subi r20, 0x6C ; 108 23392: 50 47 sbci r21, 0x70 ; 112 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 23394: fa 01 movw r30, r20 23396: 32 96 adiw r30, 0x02 ; 2 23398: a5 91 lpm r26, Z+ 2339a: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2339c: fa 01 movw r30, r20 2339e: 45 91 lpm r20, Z+ 233a0: 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. ); 233a2: b8 9f mul r27, r24 233a4: b0 01 movw r22, r0 233a6: a8 9f mul r26, r24 233a8: 00 0c add r0, r0 233aa: 61 1d adc r22, r1 233ac: 11 24 eor r1, r1 233ae: 71 1d adc r23, 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); 233b0: 46 1b sub r20, r22 233b2: 57 0b sbc r21, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 233b4: ca 01 movw r24, r20 233b6: 44 36 cpi r20, 0x64 ; 100 233b8: 51 05 cpc r21, r1 233ba: 10 f4 brcc .+4 ; 0x233c0 <__vector_17+0x186> 233bc: 84 e6 ldi r24, 0x64 ; 100 233be: 90 e0 ldi r25, 0x00 ; 0 233c0: b0 e0 ldi r27, 0x00 ; 0 233c2: a0 e0 ldi r26, 0x00 ; 0 233c4: 80 93 6c 05 sts 0x056C, r24 ; 0x80056c 233c8: 90 93 6d 05 sts 0x056D, r25 ; 0x80056d 233cc: a0 93 6e 05 sts 0x056E, r26 ; 0x80056e 233d0: b0 93 6f 05 sts 0x056F, r27 ; 0x80056f #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 233d4: 4e e6 ldi r20, 0x6E ; 110 233d6: 42 9f mul r20, r18 233d8: c0 01 movw r24, r0 233da: 43 9f mul r20, r19 233dc: 90 0d add r25, r0 233de: 11 24 eor r1, r1 233e0: 82 5a subi r24, 0xA2 ; 162 233e2: 99 4f sbci r25, 0xF9 ; 249 233e4: fc 01 movw r30, r24 233e6: e4 5b subi r30, 0xB4 ; 180 233e8: ff 4f sbci r31, 0xFF ; 255 233ea: 40 81 ld r20, Z 233ec: 44 23 and r20, r20 233ee: 49 f0 breq .+18 ; 0x23402 <__vector_17+0x1c8> target_adv_steps = current_block->max_adv_steps; 233f0: 81 5b subi r24, 0xB1 ; 177 233f2: 9f 4f sbci r25, 0xFF ; 255 233f4: dc 01 movw r26, r24 233f6: 8d 91 ld r24, X+ 233f8: 9c 91 ld r25, X 233fa: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 233fe: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a } e_steps = 0; 23402: 10 92 69 05 sts 0x0569, r1 ; 0x800569 nextAdvanceISR = ADV_NEVER; 23406: 8f ef ldi r24, 0xFF ; 255 23408: 9f ef ldi r25, 0xFF ; 255 2340a: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 2340e: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> LA_phase = -1; 23412: 80 93 68 05 sts 0x0568, r24 ; 0x800568 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 23416: 8e e6 ldi r24, 0x6E ; 110 23418: 82 9f mul r24, r18 2341a: f0 01 movw r30, r0 2341c: 83 9f mul r24, r19 2341e: f0 0d add r31, r0 23420: 11 24 eor r1, r1 23422: e2 5a subi r30, 0xA2 ; 162 23424: f9 4f sbci r31, 0xF9 ; 249 23426: 85 a9 ldd r24, Z+53 ; 0x35 23428: 84 ff sbrs r24, 4 2342a: 08 c0 rjmp .+16 ; 0x2343c <__vector_17+0x202> count_position[E_AXIS] = 0; 2342c: 10 92 58 06 sts 0x0658, r1 ; 0x800658 23430: 10 92 59 06 sts 0x0659, r1 ; 0x800659 23434: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 23438: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 2343c: 83 ff sbrs r24, 3 2343e: 61 c0 rjmp .+194 ; 0x23502 <__vector_17+0x2c8> const int16_t value = -(current_block->step_event_count.lo >> 1); 23440: 8e e6 ldi r24, 0x6E ; 110 23442: 82 9f mul r24, r18 23444: f0 01 movw r30, r0 23446: 83 9f mul r24, r19 23448: f0 0d add r31, r0 2344a: 11 24 eor r1, r1 2344c: e2 5a subi r30, 0xA2 ; 162 2344e: f9 4f sbci r31, 0xF9 ; 249 23450: 80 89 ldd r24, Z+16 ; 0x10 23452: 91 89 ldd r25, Z+17 ; 0x11 23454: 96 95 lsr r25 23456: 87 95 ror r24 23458: 91 95 neg r25 2345a: 81 95 neg r24 2345c: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 2345e: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23462: 80 93 58 05 sts 0x0558, r24 ; 0x800558 23466: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 2346a: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 2346e: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23472: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23476: 90 93 65 05 sts 0x0565, r25 ; 0x800565 2347a: 80 93 64 05 sts 0x0564, r24 ; 0x800564 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 2347e: 81 e0 ldi r24, 0x01 ; 1 23480: 24 85 ldd r18, Z+12 ; 0x0c 23482: 35 85 ldd r19, Z+13 ; 0x0d 23484: 23 2b or r18, r19 23486: 09 f0 breq .+2 ; 0x2348a <__vector_17+0x250> 23488: 7d c0 rjmp .+250 ; 0x23584 <__vector_17+0x34a> 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; 2348a: 80 e0 ldi r24, 0x00 ; 0 2348c: 7b c0 rjmp .+246 ; 0x23584 <__vector_17+0x34a> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 2348e: 10 92 4d 04 sts 0x044D, r1 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 23492: 10 92 4c 04 sts 0x044C, r1 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> 23496: 0c cf rjmp .-488 ; 0x232b0 <__vector_17+0x76> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 23498: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 2349c: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.439> 234a0: 1d cf rjmp .-454 ; 0x232dc <__vector_17+0xa2> #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; 234a2: 80 e4 ldi r24, 0x40 ; 64 234a4: 9c e9 ldi r25, 0x9C ; 156 234a6: 60 cf rjmp .-320 ; 0x23368 <__vector_17+0x12e> 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 234a8: 81 31 cpi r24, 0x11 ; 17 234aa: e7 e2 ldi r30, 0x27 ; 39 234ac: 9e 07 cpc r25, r30 234ae: 20 f0 brcs .+8 ; 0x234b8 <__vector_17+0x27e> step_rate = (step_rate >> 1)&0x7fff; 234b0: 96 95 lsr r25 234b2: 87 95 ror r24 step_loops = 2; 234b4: 42 e0 ldi r20, 0x02 ; 2 234b6: 5d cf rjmp .-326 ; 0x23372 <__vector_17+0x138> } else { step_loops = 1; 234b8: 40 93 70 05 sts 0x0570, r20 ; 0x800570 234bc: 80 32 cpi r24, 0x20 ; 32 234be: 91 05 cpc r25, r1 234c0: 08 f0 brcs .+2 ; 0x234c4 <__vector_17+0x28a> 234c2: 59 cf rjmp .-334 ; 0x23376 <__vector_17+0x13c> 234c4: 80 e2 ldi r24, 0x20 ; 32 234c6: 90 e0 ldi r25, 0x00 ; 0 234c8: 56 cf rjmp .-340 ; 0x23376 <__vector_17+0x13c> 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; 234ca: bc 01 movw r22, r24 234cc: 76 95 lsr r23 234ce: 67 95 ror r22 234d0: 6c 7f andi r22, 0xFC ; 252 234d2: 6c 56 subi r22, 0x6C ; 108 234d4: 74 47 sbci r23, 0x74 ; 116 timer = (unsigned short)pgm_read_word_near(table_address); 234d6: fb 01 movw r30, r22 234d8: 45 91 lpm r20, Z+ 234da: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 234dc: fb 01 movw r30, r22 234de: 32 96 adiw r30, 0x02 ; 2 234e0: a5 91 lpm r26, Z+ 234e2: b4 91 lpm r27, Z 234e4: 87 70 andi r24, 0x07 ; 7 234e6: 99 27 eor r25, r25 234e8: 8a 9f mul r24, r26 234ea: b0 01 movw r22, r0 234ec: 8b 9f mul r24, r27 234ee: 70 0d add r23, r0 234f0: 9a 9f mul r25, r26 234f2: 70 0d add r23, r0 234f4: 11 24 eor r1, r1 234f6: e3 e0 ldi r30, 0x03 ; 3 234f8: 76 95 lsr r23 234fa: 67 95 ror r22 234fc: ea 95 dec r30 234fe: e1 f7 brne .-8 ; 0x234f8 <__vector_17+0x2be> 23500: 57 cf rjmp .-338 ; 0x233b0 <__vector_17+0x176> } #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); 23502: 8e e6 ldi r24, 0x6E ; 110 23504: 82 9f mul r24, r18 23506: f0 01 movw r30, r0 23508: 83 9f mul r24, r19 2350a: f0 0d add r31, r0 2350c: 11 24 eor r1, r1 2350e: e2 5a subi r30, 0xA2 ; 162 23510: f9 4f sbci r31, 0xF9 ; 249 23512: 80 89 ldd r24, Z+16 ; 0x10 23514: 91 89 ldd r25, Z+17 ; 0x11 23516: a2 89 ldd r26, Z+18 ; 0x12 23518: b3 89 ldd r27, Z+19 ; 0x13 2351a: b6 95 lsr r27 2351c: a7 95 ror r26 2351e: 97 95 ror r25 23520: 87 95 ror r24 23522: b0 95 com r27 23524: a0 95 com r26 23526: 90 95 com r25 23528: 81 95 neg r24 2352a: 9f 4f sbci r25, 0xFF ; 255 2352c: af 4f sbci r26, 0xFF ; 255 2352e: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 23530: 80 93 58 05 sts 0x0558, r24 ; 0x800558 23534: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23538: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 2353c: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b 23540: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 23544: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23548: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 2354c: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f 23550: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23554: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23558: a0 93 62 05 sts 0x0562, r26 ; 0x800562 2355c: b0 93 63 05 sts 0x0563, r27 ; 0x800563 23560: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23564: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23568: a0 93 66 05 sts 0x0566, r26 ; 0x800566 2356c: b0 93 67 05 sts 0x0567, r27 ; 0x800567 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 23570: 81 e0 ldi r24, 0x01 ; 1 23572: 44 85 ldd r20, Z+12 ; 0x0c 23574: 55 85 ldd r21, Z+13 ; 0x0d 23576: 66 85 ldd r22, Z+14 ; 0x0e 23578: 77 85 ldd r23, Z+15 ; 0x0f 2357a: 45 2b or r20, r21 2357c: 46 2b or r20, r22 2357e: 47 2b or r20, r23 23580: 09 f4 brne .+2 ; 0x23584 <__vector_17+0x34a> 23582: 83 cf rjmp .-250 ; 0x2348a <__vector_17+0x250> 23584: 80 93 57 05 sts 0x0557, r24 ; 0x800557 #endif } step_events_completed.wide = 0; 23588: 10 92 53 05 sts 0x0553, r1 ; 0x800553 2358c: 10 92 54 05 sts 0x0554, r1 ; 0x800554 23590: 10 92 55 05 sts 0x0555, r1 ; 0x800555 23594: 10 92 56 05 sts 0x0556, r1 ; 0x800556 // Set directions. out_bits = current_block->direction_bits; 23598: 88 8d ldd r24, Y+24 ; 0x18 2359a: 80 93 52 05 sts 0x0552, r24 ; 0x800552 // 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); 235a2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 235a6: 8d 7f andi r24, 0xFD ; 253 235a8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 235ac: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 235ae: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if((out_bits & (1< 235b6: 81 ff sbrs r24, 1 235b8: cc c1 rjmp .+920 ; 0x23952 <__vector_17+0x718> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 235ba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 235be: 8e 7f andi r24, 0xFE ; 254 235c0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 235c4: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 235c6: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } if ((out_bits & (1< 235ce: 82 ff sbrs r24, 2 235d0: c7 c1 rjmp .+910 ; 0x23960 <__vector_17+0x726> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 235d2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 235d6: 8b 7f andi r24, 0xFB ; 251 235d8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 235dc: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 235de: 80 93 5d 02 sts 0x025D, r24 ; 0x80025d } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 235e2: 80 91 52 05 lds r24, 0x0552 ; 0x800552 235e6: 83 ff sbrs r24, 3 235e8: c2 c1 rjmp .+900 ; 0x2396e <__vector_17+0x734> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 235ea: 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; 235ec: 80 93 5e 02 sts 0x025E, r24 ; 0x80025e //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) 235f0: e0 91 51 12 lds r30, 0x1251 ; 0x801251 235f4: f0 91 52 12 lds r31, 0x1252 ; 0x801252 235f8: 30 97 sbiw r30, 0x00 ; 0 235fa: 09 f4 brne .+2 ; 0x235fe <__vector_17+0x3c4> 235fc: 09 c7 rjmp .+3602 ; 0x24410 <__vector_17+0x11d6> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 235fe: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.388> 23602: 50 91 4f 05 lds r21, 0x054F ; 0x80054f 23606: 88 23 and r24, r24 23608: 09 f4 brne .+2 ; 0x2360c <__vector_17+0x3d2> 2360a: 6c c0 rjmp .+216 ; 0x236e4 <__vector_17+0x4aa> { uint8_t _endstop_hit = endstop_hit; 2360c: 20 91 5e 04 lds r18, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.443> uint8_t _endstop = endstop; 23610: 80 91 51 05 lds r24, 0x0551 ; 0x800551 uint8_t _old_endstop = old_endstop; 23614: 90 91 50 05 lds r25, 0x0550 ; 0x800550 #ifndef COREXY if ((out_bits & (1< 2361c: 30 ff sbrs r19, 0 2361e: 1d c0 rjmp .+58 ; 0x2365a <__vector_17+0x420> #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, X_AXIS, (READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING)); 23620: 1e 9b sbis 0x03, 6 ; 3 23622: c6 c1 rjmp .+908 ; 0x239b0 <__vector_17+0x776> 23624: 81 60 ori r24, 0x01 ; 1 #endif if((_endstop & _old_endstop & _BV(X_AXIS)) && (current_block->steps[X_AXIS].wide > 0)) { 23626: 49 2f mov r20, r25 23628: 41 70 andi r20, 0x01 ; 1 2362a: 48 23 and r20, r24 2362c: b1 f0 breq .+44 ; 0x2365a <__vector_17+0x420> 2362e: c0 80 ld r12, Z 23630: d1 80 ldd r13, Z+1 ; 0x01 23632: e2 80 ldd r14, Z+2 ; 0x02 23634: f3 80 ldd r15, Z+3 ; 0x03 23636: 1c 14 cp r1, r12 23638: 1d 04 cpc r1, r13 2363a: 1e 04 cpc r1, r14 2363c: 1f 04 cpc r1, r15 2363e: 6c f4 brge .+26 ; 0x2365a <__vector_17+0x420> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[X_AXIS] = count_position[X_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(X_AXIS); 23640: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 23642: c0 88 ldd r12, Z+16 ; 0x10 23644: d1 88 ldd r13, Z+17 ; 0x11 23646: e2 88 ldd r14, Z+18 ; 0x12 23648: f3 88 ldd r15, Z+19 ; 0x13 2364a: c0 92 53 05 sts 0x0553, r12 ; 0x800553 2364e: d0 92 54 05 sts 0x0554, r13 ; 0x800554 23652: e0 92 55 05 sts 0x0555, r14 ; 0x800555 23656: f0 92 56 05 sts 0x0556, r15 ; 0x800556 } #endif } #ifndef COREXY if ((out_bits & (1< #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, Y_AXIS, (READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING)); 2365e: 1d 9b sbis 0x03, 5 ; 3 23660: a9 c1 rjmp .+850 ; 0x239b4 <__vector_17+0x77a> 23662: 82 60 ori r24, 0x02 ; 2 #endif if((_endstop & _old_endstop & _BV(Y_AXIS)) && (current_block->steps[Y_AXIS].wide > 0)) { 23664: 49 2f mov r20, r25 23666: 42 70 andi r20, 0x02 ; 2 23668: 48 23 and r20, r24 2366a: b1 f0 breq .+44 ; 0x23698 <__vector_17+0x45e> 2366c: c4 80 ldd r12, Z+4 ; 0x04 2366e: d5 80 ldd r13, Z+5 ; 0x05 23670: e6 80 ldd r14, Z+6 ; 0x06 23672: f7 80 ldd r15, Z+7 ; 0x07 23674: 1c 14 cp r1, r12 23676: 1d 04 cpc r1, r13 23678: 1e 04 cpc r1, r14 2367a: 1f 04 cpc r1, r15 2367c: 6c f4 brge .+26 ; 0x23698 <__vector_17+0x45e> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Y_AXIS); 2367e: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 23680: c0 88 ldd r12, Z+16 ; 0x10 23682: d1 88 ldd r13, Z+17 ; 0x11 23684: e2 88 ldd r14, Z+18 ; 0x12 23686: f3 88 ldd r15, Z+19 ; 0x13 23688: c0 92 53 05 sts 0x0553, r12 ; 0x800553 2368c: d0 92 54 05 sts 0x0554, r13 ; 0x800554 23690: e0 92 55 05 sts 0x0555, r14 ; 0x800555 23694: f0 92 56 05 sts 0x0556, r15 ; 0x800556 step_events_completed.wide = current_block->step_event_count.wide; } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 2369c: 51 11 cpse r21, r1 2369e: 1c c0 rjmp .+56 ; 0x236d8 <__vector_17+0x49e> 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))); #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 236a0: 1c 9b sbis 0x03, 4 ; 3 236a2: 8a c1 rjmp .+788 ; 0x239b8 <__vector_17+0x77e> 236a4: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 236a6: 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)) { 236a8: 98 23 and r25, r24 236aa: b1 f0 breq .+44 ; 0x236d8 <__vector_17+0x49e> 236ac: c0 84 ldd r12, Z+8 ; 0x08 236ae: d1 84 ldd r13, Z+9 ; 0x09 236b0: e2 84 ldd r14, Z+10 ; 0x0a 236b2: f3 84 ldd r15, Z+11 ; 0x0b 236b4: 1c 14 cp r1, r12 236b6: 1d 04 cpc r1, r13 236b8: 1e 04 cpc r1, r14 236ba: 1f 04 cpc r1, r15 236bc: 6c f4 brge .+26 ; 0x236d8 <__vector_17+0x49e> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Z_AXIS); 236be: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 236c0: c0 88 ldd r12, Z+16 ; 0x10 236c2: d1 88 ldd r13, Z+17 ; 0x11 236c4: e2 88 ldd r14, Z+18 ; 0x12 236c6: f3 88 ldd r15, Z+19 ; 0x13 236c8: c0 92 53 05 sts 0x0553, r12 ; 0x800553 236cc: d0 92 54 05 sts 0x0554, r13 ; 0x800554 236d0: e0 92 55 05 sts 0x0555, r14 ; 0x800555 236d4: f0 92 56 05 sts 0x0556, r15 ; 0x800556 } #endif } endstop = _endstop; 236d8: 80 93 51 05 sts 0x0551, r24 ; 0x800551 old_endstop = _endstop; //apply current endstop state to the old endstop 236dc: 80 93 50 05 sts 0x0550, r24 ; 0x800550 endstop_hit = _endstop_hit; 236e0: 20 93 5e 04 sts 0x045E, r18 ; 0x80045e <_ZL11endstop_hit.lto_priv.443> } // 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) { 236e4: 55 23 and r21, r21 236e6: f9 f0 breq .+62 ; 0x23726 <__vector_17+0x4ec> uint8_t _endstop_hit = endstop_hit; 236e8: 20 91 5e 04 lds r18, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.443> uint8_t _endstop = endstop; 236ec: 80 91 51 05 lds r24, 0x0551 ; 0x800551 uint8_t _old_endstop = old_endstop; 236f0: 90 91 50 05 lds r25, 0x0550 ; 0x800550 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))); #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 236f4: 1c 9b sbis 0x03, 4 ; 3 236f6: 69 c1 rjmp .+722 ; 0x239ca <__vector_17+0x790> 236f8: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if(_endstop & _old_endstop & _BV(Z_AXIS)) { 236fa: 94 70 andi r25, 0x04 ; 4 236fc: 98 23 and r25, r24 236fe: 69 f0 breq .+26 ; 0x2371a <__vector_17+0x4e0> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Z_AXIS); 23700: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 23702: 40 89 ldd r20, Z+16 ; 0x10 23704: 51 89 ldd r21, Z+17 ; 0x11 23706: 62 89 ldd r22, Z+18 ; 0x12 23708: 73 89 ldd r23, Z+19 ; 0x13 2370a: 40 93 53 05 sts 0x0553, r20 ; 0x800553 2370e: 50 93 54 05 sts 0x0554, r21 ; 0x800554 23712: 60 93 55 05 sts 0x0555, r22 ; 0x800555 23716: 70 93 56 05 sts 0x0556, r23 ; 0x800556 } endstop = _endstop; 2371a: 80 93 51 05 sts 0x0551, r24 ; 0x800551 old_endstop = _endstop; //apply current endstop state to the old endstop 2371e: 80 93 50 05 sts 0x0550, r24 ; 0x800550 endstop_hit = _endstop_hit; 23722: 20 93 5e 04 sts 0x045E, r18 ; 0x80045e <_ZL11endstop_hit.lto_priv.443> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 23726: 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) 23728: c0 e0 ldi r28, 0x00 ; 0 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2372a: 83 ff sbrs r24, 3 2372c: 50 c1 rjmp .+672 ; 0x239ce <__vector_17+0x794> } FORCE_INLINE void stepper_tick_lowres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 2372e: 80 91 70 05 lds r24, 0x0570 ; 0x800570 23732: c8 17 cp r28, r24 23734: 08 f0 brcs .+2 ; 0x23738 <__vector_17+0x4fe> 23736: bd c2 rjmp .+1402 ; 0x23cb2 <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 23738: 0f 94 d3 00 call 0x201a6 ; 0x201a6 // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 2373c: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23740: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23744: 80 81 ld r24, Z 23746: 91 81 ldd r25, Z+1 ; 0x01 23748: 20 91 58 05 lds r18, 0x0558 ; 0x800558 2374c: 30 91 59 05 lds r19, 0x0559 ; 0x800559 23750: 82 0f add r24, r18 23752: 93 1f adc r25, r19 23754: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23758: 80 93 58 05 sts 0x0558, r24 ; 0x800558 if (counter[X_AXIS].lo > 0) { 2375c: 18 16 cp r1, r24 2375e: 19 06 cpc r1, r25 23760: 6c f5 brge .+90 ; 0x237bc <__vector_17+0x582> STEP_NC_HI(X_AXIS); 23762: 40 9a sbi 0x08, 0 ; 8 #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; 23764: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23768: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2376c: 80 91 58 05 lds r24, 0x0558 ; 0x800558 23770: 90 91 59 05 lds r25, 0x0559 ; 0x800559 23774: 20 89 ldd r18, Z+16 ; 0x10 23776: 31 89 ldd r19, Z+17 ; 0x11 23778: 82 1b sub r24, r18 2377a: 93 0b sbc r25, r19 2377c: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23780: 80 93 58 05 sts 0x0558, r24 ; 0x800558 count_position[X_AXIS]+=count_direction[X_AXIS]; 23784: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 23788: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 2378c: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 23790: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 23794: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 23798: 89 2f mov r24, r25 2379a: 99 0f add r25, r25 2379c: 99 0b sbc r25, r25 2379e: aa 0b sbc r26, r26 237a0: bb 0b sbc r27, r27 237a2: 84 0f add r24, r20 237a4: 95 1f adc r25, r21 237a6: a6 1f adc r26, r22 237a8: b7 1f adc r27, r23 237aa: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 237ae: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 237b2: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 237b6: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f STEP_NC_LO(X_AXIS); 237ba: 40 98 cbi 0x08, 0 ; 8 #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; 237bc: e0 91 51 12 lds r30, 0x1251 ; 0x801251 237c0: f0 91 52 12 lds r31, 0x1252 ; 0x801252 237c4: 84 81 ldd r24, Z+4 ; 0x04 237c6: 95 81 ldd r25, Z+5 ; 0x05 237c8: 20 91 5c 05 lds r18, 0x055C ; 0x80055c 237cc: 30 91 5d 05 lds r19, 0x055D ; 0x80055d 237d0: 82 0f add r24, r18 237d2: 93 1f adc r25, r19 237d4: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 237d8: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c if (counter[Y_AXIS].lo > 0) { 237dc: 18 16 cp r1, r24 237de: 19 06 cpc r1, r25 237e0: 4c f5 brge .+82 ; 0x23834 <__vector_17+0x5fa> STEP_NC_HI(Y_AXIS); 237e2: 41 9a sbi 0x08, 1 ; 8 #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; 237e4: e0 91 51 12 lds r30, 0x1251 ; 0x801251 237e8: f0 91 52 12 lds r31, 0x1252 ; 0x801252 237ec: 20 89 ldd r18, Z+16 ; 0x10 237ee: 31 89 ldd r19, Z+17 ; 0x11 237f0: 82 1b sub r24, r18 237f2: 93 0b sbc r25, r19 237f4: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 237f8: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c count_position[Y_AXIS]+=count_direction[Y_AXIS]; 237fc: 90 91 5c 02 lds r25, 0x025C ; 0x80025c 23800: 40 91 50 06 lds r20, 0x0650 ; 0x800650 23804: 50 91 51 06 lds r21, 0x0651 ; 0x800651 23808: 60 91 52 06 lds r22, 0x0652 ; 0x800652 2380c: 70 91 53 06 lds r23, 0x0653 ; 0x800653 23810: 89 2f mov r24, r25 23812: 99 0f add r25, r25 23814: 99 0b sbc r25, r25 23816: aa 0b sbc r26, r26 23818: bb 0b sbc r27, r27 2381a: 84 0f add r24, r20 2381c: 95 1f adc r25, r21 2381e: a6 1f adc r26, r22 23820: b7 1f adc r27, r23 23822: 80 93 50 06 sts 0x0650, r24 ; 0x800650 23826: 90 93 51 06 sts 0x0651, r25 ; 0x800651 2382a: a0 93 52 06 sts 0x0652, r26 ; 0x800652 2382e: b0 93 53 06 sts 0x0653, r27 ; 0x800653 STEP_NC_LO(Y_AXIS); 23832: 41 98 cbi 0x08, 1 ; 8 #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; 23834: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23838: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2383c: 80 85 ldd r24, Z+8 ; 0x08 2383e: 91 85 ldd r25, Z+9 ; 0x09 23840: 20 91 60 05 lds r18, 0x0560 ; 0x800560 23844: 30 91 61 05 lds r19, 0x0561 ; 0x800561 23848: 82 0f add r24, r18 2384a: 93 1f adc r25, r19 2384c: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23850: 80 93 60 05 sts 0x0560, r24 ; 0x800560 if (counter[Z_AXIS].lo > 0) { 23854: 18 16 cp r1, r24 23856: 19 06 cpc r1, r25 23858: 4c f5 brge .+82 ; 0x238ac <__vector_17+0x672> STEP_NC_HI(Z_AXIS); 2385a: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 2385c: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23860: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23864: 20 89 ldd r18, Z+16 ; 0x10 23866: 31 89 ldd r19, Z+17 ; 0x11 23868: 82 1b sub r24, r18 2386a: 93 0b sbc r25, r19 2386c: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23870: 80 93 60 05 sts 0x0560, r24 ; 0x800560 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 23874: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 23878: 40 91 54 06 lds r20, 0x0654 ; 0x800654 2387c: 50 91 55 06 lds r21, 0x0655 ; 0x800655 23880: 60 91 56 06 lds r22, 0x0656 ; 0x800656 23884: 70 91 57 06 lds r23, 0x0657 ; 0x800657 23888: 89 2f mov r24, r25 2388a: 99 0f add r25, r25 2388c: 99 0b sbc r25, r25 2388e: aa 0b sbc r26, r26 23890: bb 0b sbc r27, r27 23892: 84 0f add r24, r20 23894: 95 1f adc r25, r21 23896: a6 1f adc r26, r22 23898: b7 1f adc r27, r23 2389a: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2389e: 90 93 55 06 sts 0x0655, r25 ; 0x800655 238a2: a0 93 56 06 sts 0x0656, r26 ; 0x800656 238a6: b0 93 57 06 sts 0x0657, r27 ; 0x800657 STEP_NC_LO(Z_AXIS); 238aa: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 238ac: e0 91 51 12 lds r30, 0x1251 ; 0x801251 238b0: f0 91 52 12 lds r31, 0x1252 ; 0x801252 238b4: 80 91 64 05 lds r24, 0x0564 ; 0x800564 238b8: 90 91 65 05 lds r25, 0x0565 ; 0x800565 238bc: 24 85 ldd r18, Z+12 ; 0x0c 238be: 35 85 ldd r19, Z+13 ; 0x0d 238c0: 82 0f add r24, r18 238c2: 93 1f adc r25, r19 238c4: 90 93 65 05 sts 0x0565, r25 ; 0x800565 238c8: 80 93 64 05 sts 0x0564, r24 ; 0x800564 238cc: 20 89 ldd r18, Z+16 ; 0x10 238ce: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 238d0: 18 16 cp r1, r24 238d2: 19 06 cpc r1, r25 238d4: 44 f5 brge .+80 ; 0x23926 <__vector_17+0x6ec> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 238d6: 82 1b sub r24, r18 238d8: 93 0b sbc r25, r19 238da: 90 93 65 05 sts 0x0565, r25 ; 0x800565 238de: 80 93 64 05 sts 0x0564, r24 ; 0x800564 count_position[E_AXIS] += count_direction[E_AXIS]; 238e2: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 238e6: 40 91 58 06 lds r20, 0x0658 ; 0x800658 238ea: 50 91 59 06 lds r21, 0x0659 ; 0x800659 238ee: 60 91 5a 06 lds r22, 0x065A ; 0x80065a 238f2: 70 91 5b 06 lds r23, 0x065B ; 0x80065b 238f6: 89 2f mov r24, r25 238f8: 99 0f add r25, r25 238fa: 99 0b sbc r25, r25 238fc: aa 0b sbc r26, r26 238fe: bb 0b sbc r27, r27 23900: 84 0f add r24, r20 23902: 95 1f adc r25, r21 23904: a6 1f adc r26, r22 23906: b7 1f adc r27, r23 23908: 80 93 58 06 sts 0x0658, r24 ; 0x800658 2390c: 90 93 59 06 sts 0x0659, r25 ; 0x800659 23910: a0 93 5a 06 sts 0x065A, r26 ; 0x80065a 23914: b0 93 5b 06 sts 0x065B, r27 ; 0x80065b #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 23918: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 2391c: 80 91 69 05 lds r24, 0x0569 ; 0x800569 23920: 89 0f add r24, r25 23922: 80 93 69 05 sts 0x0569, r24 ; 0x800569 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) 23926: 80 91 53 05 lds r24, 0x0553 ; 0x800553 2392a: 90 91 54 05 lds r25, 0x0554 ; 0x800554 2392e: 01 96 adiw r24, 0x01 ; 1 23930: 90 93 54 05 sts 0x0554, r25 ; 0x800554 23934: 80 93 53 05 sts 0x0553, r24 ; 0x800553 23938: 82 17 cp r24, r18 2393a: 93 07 cpc r25, r19 2393c: 08 f0 brcs .+2 ; 0x23940 <__vector_17+0x706> 2393e: b9 c1 rjmp .+882 ; 0x23cb2 <__vector_17+0xa78> } FORCE_INLINE void stepper_tick_lowres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 23940: cf 5f subi r28, 0xFF ; 255 23942: f5 ce rjmp .-534 ; 0x2372e <__vector_17+0x4f4> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 23948: 82 60 ori r24, 0x02 ; 2 2394a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 2394e: 81 e0 ldi r24, 0x01 ; 1 23950: 2e ce rjmp .-932 ; 0x235ae <__vector_17+0x374> } if((out_bits & (1< 23956: 81 60 ori r24, 0x01 ; 1 23958: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 2395c: 81 e0 ldi r24, 0x01 ; 1 2395e: 33 ce rjmp .-922 ; 0x235c6 <__vector_17+0x38c> } if ((out_bits & (1< 23964: 84 60 ori r24, 0x04 ; 4 23966: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 2396a: 81 e0 ldi r24, 0x01 ; 1 2396c: 38 ce rjmp .-912 ; 0x235de <__vector_17+0x3a4> 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; 2396e: 81 e0 ldi r24, 0x01 ; 1 23970: 3d ce rjmp .-902 ; 0x235ec <__vector_17+0x3b2> } } else { _NEXT_ISR(2000); // 1kHz. 23972: 80 ed ldi r24, 0xD0 ; 208 23974: 97 e0 ldi r25, 0x07 ; 7 23976: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 2397a: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.439> 2397e: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.441+0x1> 23982: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.441> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 23986: 8f ef ldi r24, 0xFF ; 255 23988: 9f ef ldi r25, 0xFF ; 255 2398a: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 2398e: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> e_steps = 0; 23992: 10 92 69 05 sts 0x0569, r1 ; 0x800569 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 23996: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 2399a: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 2399e: 00 97 sbiw r24, 0x00 ; 0 239a0: 09 f4 brne .+2 ; 0x239a4 <__vector_17+0x76a> 239a2: 26 ce rjmp .-948 ; 0x235f0 <__vector_17+0x3b6> --current_adv_steps; 239a4: 01 97 sbiw r24, 0x01 ; 1 239a6: 90 93 49 04 sts 0x0449, r25 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 239aa: 80 93 48 04 sts 0x0448, r24 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 239ae: 20 ce rjmp .-960 ; 0x235f0 <__vector_17+0x3b6> #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, X_AXIS, (READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING)); 239b0: 8e 7f andi r24, 0xFE ; 254 239b2: 39 ce rjmp .-910 ; 0x23626 <__vector_17+0x3ec> #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, Y_AXIS, (READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING)); 239b4: 8d 7f andi r24, 0xFD ; 253 239b6: 56 ce rjmp .-852 ; 0x23664 <__vector_17+0x42a> 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))); #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 239b8: 8b 7f andi r24, 0xFB ; 251 239ba: 75 ce rjmp .-790 ; 0x236a6 <__vector_17+0x46c> SET_BIT_TO(_endstop, Z_AXIS + 4, 0); else #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)); 239bc: 01 99 sbic 0x00, 1 ; 0 239be: 03 c0 rjmp .+6 ; 0x239c6 <__vector_17+0x78c> 239c0: 80 64 ori r24, 0x40 ; 64 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS + 4)) && (current_block->steps[Z_AXIS].wide > 0)) { 239c2: 90 74 andi r25, 0x40 ; 64 239c4: 71 ce rjmp .-798 ; 0x236a8 <__vector_17+0x46e> SET_BIT_TO(_endstop, Z_AXIS + 4, 0); else #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)); 239c6: 8f 7b andi r24, 0xBF ; 191 239c8: fc cf rjmp .-8 ; 0x239c2 <__vector_17+0x788> 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))); #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 239ca: 8b 7f andi r24, 0xFB ; 251 239cc: 96 ce rjmp .-724 ; 0x236fa <__vector_17+0x4c0> } } FORCE_INLINE void stepper_tick_highres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 239ce: 80 91 70 05 lds r24, 0x0570 ; 0x800570 239d2: c8 17 cp r28, r24 239d4: 08 f0 brcs .+2 ; 0x239d8 <__vector_17+0x79e> 239d6: 6d c1 rjmp .+730 ; 0x23cb2 <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 239d8: 0f 94 d3 00 call 0x201a6 ; 0x201a6 // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 239dc: e0 91 51 12 lds r30, 0x1251 ; 0x801251 239e0: f0 91 52 12 lds r31, 0x1252 ; 0x801252 239e4: 80 81 ld r24, Z 239e6: 91 81 ldd r25, Z+1 ; 0x01 239e8: a2 81 ldd r26, Z+2 ; 0x02 239ea: b3 81 ldd r27, Z+3 ; 0x03 239ec: 40 91 58 05 lds r20, 0x0558 ; 0x800558 239f0: 50 91 59 05 lds r21, 0x0559 ; 0x800559 239f4: 60 91 5a 05 lds r22, 0x055A ; 0x80055a 239f8: 70 91 5b 05 lds r23, 0x055B ; 0x80055b 239fc: 84 0f add r24, r20 239fe: 95 1f adc r25, r21 23a00: a6 1f adc r26, r22 23a02: b7 1f adc r27, r23 23a04: 80 93 58 05 sts 0x0558, r24 ; 0x800558 23a08: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23a0c: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 23a10: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b if (counter[X_AXIS].wide > 0) { 23a14: 18 16 cp r1, r24 23a16: 19 06 cpc r1, r25 23a18: 1a 06 cpc r1, r26 23a1a: 1b 06 cpc r1, r27 23a1c: cc f5 brge .+114 ; 0x23a90 <__vector_17+0x856> STEP_NC_HI(X_AXIS); 23a1e: 40 9a sbi 0x08, 0 ; 8 #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; 23a20: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23a24: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23a28: 80 91 58 05 lds r24, 0x0558 ; 0x800558 23a2c: 90 91 59 05 lds r25, 0x0559 ; 0x800559 23a30: a0 91 5a 05 lds r26, 0x055A ; 0x80055a 23a34: b0 91 5b 05 lds r27, 0x055B ; 0x80055b 23a38: 40 89 ldd r20, Z+16 ; 0x10 23a3a: 51 89 ldd r21, Z+17 ; 0x11 23a3c: 62 89 ldd r22, Z+18 ; 0x12 23a3e: 73 89 ldd r23, Z+19 ; 0x13 23a40: 84 1b sub r24, r20 23a42: 95 0b sbc r25, r21 23a44: a6 0b sbc r26, r22 23a46: b7 0b sbc r27, r23 23a48: 80 93 58 05 sts 0x0558, r24 ; 0x800558 23a4c: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23a50: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 23a54: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b count_position[X_AXIS]+=count_direction[X_AXIS]; 23a58: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 23a5c: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 23a60: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 23a64: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 23a68: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 23a6c: 89 2f mov r24, r25 23a6e: 99 0f add r25, r25 23a70: 99 0b sbc r25, r25 23a72: aa 0b sbc r26, r26 23a74: bb 0b sbc r27, r27 23a76: 84 0f add r24, r20 23a78: 95 1f adc r25, r21 23a7a: a6 1f adc r26, r22 23a7c: b7 1f adc r27, r23 23a7e: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 23a82: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 23a86: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 23a8a: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f STEP_NC_LO(X_AXIS); 23a8e: 40 98 cbi 0x08, 0 ; 8 #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; 23a90: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23a94: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23a98: 84 81 ldd r24, Z+4 ; 0x04 23a9a: 95 81 ldd r25, Z+5 ; 0x05 23a9c: a6 81 ldd r26, Z+6 ; 0x06 23a9e: b7 81 ldd r27, Z+7 ; 0x07 23aa0: 40 91 5c 05 lds r20, 0x055C ; 0x80055c 23aa4: 50 91 5d 05 lds r21, 0x055D ; 0x80055d 23aa8: 60 91 5e 05 lds r22, 0x055E ; 0x80055e 23aac: 70 91 5f 05 lds r23, 0x055F ; 0x80055f 23ab0: 84 0f add r24, r20 23ab2: 95 1f adc r25, r21 23ab4: a6 1f adc r26, r22 23ab6: b7 1f adc r27, r23 23ab8: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 23abc: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23ac0: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 23ac4: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f if (counter[Y_AXIS].wide > 0) { 23ac8: 18 16 cp r1, r24 23aca: 19 06 cpc r1, r25 23acc: 1a 06 cpc r1, r26 23ace: 1b 06 cpc r1, r27 23ad0: 8c f5 brge .+98 ; 0x23b34 <__vector_17+0x8fa> STEP_NC_HI(Y_AXIS); 23ad2: 41 9a sbi 0x08, 1 ; 8 #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; 23ad4: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23ad8: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23adc: 40 89 ldd r20, Z+16 ; 0x10 23ade: 51 89 ldd r21, Z+17 ; 0x11 23ae0: 62 89 ldd r22, Z+18 ; 0x12 23ae2: 73 89 ldd r23, Z+19 ; 0x13 23ae4: 84 1b sub r24, r20 23ae6: 95 0b sbc r25, r21 23ae8: a6 0b sbc r26, r22 23aea: b7 0b sbc r27, r23 23aec: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 23af0: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23af4: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 23af8: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f count_position[Y_AXIS]+=count_direction[Y_AXIS]; 23afc: 90 91 5c 02 lds r25, 0x025C ; 0x80025c 23b00: 40 91 50 06 lds r20, 0x0650 ; 0x800650 23b04: 50 91 51 06 lds r21, 0x0651 ; 0x800651 23b08: 60 91 52 06 lds r22, 0x0652 ; 0x800652 23b0c: 70 91 53 06 lds r23, 0x0653 ; 0x800653 23b10: 89 2f mov r24, r25 23b12: 99 0f add r25, r25 23b14: 99 0b sbc r25, r25 23b16: aa 0b sbc r26, r26 23b18: bb 0b sbc r27, r27 23b1a: 84 0f add r24, r20 23b1c: 95 1f adc r25, r21 23b1e: a6 1f adc r26, r22 23b20: b7 1f adc r27, r23 23b22: 80 93 50 06 sts 0x0650, r24 ; 0x800650 23b26: 90 93 51 06 sts 0x0651, r25 ; 0x800651 23b2a: a0 93 52 06 sts 0x0652, r26 ; 0x800652 23b2e: b0 93 53 06 sts 0x0653, r27 ; 0x800653 STEP_NC_LO(Y_AXIS); 23b32: 41 98 cbi 0x08, 1 ; 8 #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; 23b34: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23b38: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23b3c: 80 85 ldd r24, Z+8 ; 0x08 23b3e: 91 85 ldd r25, Z+9 ; 0x09 23b40: a2 85 ldd r26, Z+10 ; 0x0a 23b42: b3 85 ldd r27, Z+11 ; 0x0b 23b44: 40 91 60 05 lds r20, 0x0560 ; 0x800560 23b48: 50 91 61 05 lds r21, 0x0561 ; 0x800561 23b4c: 60 91 62 05 lds r22, 0x0562 ; 0x800562 23b50: 70 91 63 05 lds r23, 0x0563 ; 0x800563 23b54: 84 0f add r24, r20 23b56: 95 1f adc r25, r21 23b58: a6 1f adc r26, r22 23b5a: b7 1f adc r27, r23 23b5c: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23b60: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23b64: a0 93 62 05 sts 0x0562, r26 ; 0x800562 23b68: b0 93 63 05 sts 0x0563, r27 ; 0x800563 if (counter[Z_AXIS].wide > 0) { 23b6c: 18 16 cp r1, r24 23b6e: 19 06 cpc r1, r25 23b70: 1a 06 cpc r1, r26 23b72: 1b 06 cpc r1, r27 23b74: 8c f5 brge .+98 ; 0x23bd8 <__vector_17+0x99e> STEP_NC_HI(Z_AXIS); 23b76: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 23b78: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23b7c: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23b80: 40 89 ldd r20, Z+16 ; 0x10 23b82: 51 89 ldd r21, Z+17 ; 0x11 23b84: 62 89 ldd r22, Z+18 ; 0x12 23b86: 73 89 ldd r23, Z+19 ; 0x13 23b88: 84 1b sub r24, r20 23b8a: 95 0b sbc r25, r21 23b8c: a6 0b sbc r26, r22 23b8e: b7 0b sbc r27, r23 23b90: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23b94: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23b98: a0 93 62 05 sts 0x0562, r26 ; 0x800562 23b9c: b0 93 63 05 sts 0x0563, r27 ; 0x800563 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 23ba0: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 23ba4: 40 91 54 06 lds r20, 0x0654 ; 0x800654 23ba8: 50 91 55 06 lds r21, 0x0655 ; 0x800655 23bac: 60 91 56 06 lds r22, 0x0656 ; 0x800656 23bb0: 70 91 57 06 lds r23, 0x0657 ; 0x800657 23bb4: 89 2f mov r24, r25 23bb6: 99 0f add r25, r25 23bb8: 99 0b sbc r25, r25 23bba: aa 0b sbc r26, r26 23bbc: bb 0b sbc r27, r27 23bbe: 84 0f add r24, r20 23bc0: 95 1f adc r25, r21 23bc2: a6 1f adc r26, r22 23bc4: b7 1f adc r27, r23 23bc6: 80 93 54 06 sts 0x0654, r24 ; 0x800654 23bca: 90 93 55 06 sts 0x0655, r25 ; 0x800655 23bce: a0 93 56 06 sts 0x0656, r26 ; 0x800656 23bd2: b0 93 57 06 sts 0x0657, r27 ; 0x800657 STEP_NC_LO(Z_AXIS); 23bd6: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 23bd8: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23bdc: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23be0: 80 91 64 05 lds r24, 0x0564 ; 0x800564 23be4: 90 91 65 05 lds r25, 0x0565 ; 0x800565 23be8: a0 91 66 05 lds r26, 0x0566 ; 0x800566 23bec: b0 91 67 05 lds r27, 0x0567 ; 0x800567 23bf0: 44 85 ldd r20, Z+12 ; 0x0c 23bf2: 55 85 ldd r21, Z+13 ; 0x0d 23bf4: 66 85 ldd r22, Z+14 ; 0x0e 23bf6: 77 85 ldd r23, Z+15 ; 0x0f 23bf8: 84 0f add r24, r20 23bfa: 95 1f adc r25, r21 23bfc: a6 1f adc r26, r22 23bfe: b7 1f adc r27, r23 23c00: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23c04: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23c08: a0 93 66 05 sts 0x0566, r26 ; 0x800566 23c0c: b0 93 67 05 sts 0x0567, r27 ; 0x800567 23c10: 40 89 ldd r20, Z+16 ; 0x10 23c12: 51 89 ldd r21, Z+17 ; 0x11 23c14: 62 89 ldd r22, Z+18 ; 0x12 23c16: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 23c18: 18 16 cp r1, r24 23c1a: 19 06 cpc r1, r25 23c1c: 1a 06 cpc r1, r26 23c1e: 1b 06 cpc r1, r27 23c20: 74 f5 brge .+92 ; 0x23c7e <__vector_17+0xa44> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 23c22: 84 1b sub r24, r20 23c24: 95 0b sbc r25, r21 23c26: a6 0b sbc r26, r22 23c28: b7 0b sbc r27, r23 23c2a: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23c2e: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23c32: a0 93 66 05 sts 0x0566, r26 ; 0x800566 23c36: b0 93 67 05 sts 0x0567, r27 ; 0x800567 count_position[E_AXIS] += count_direction[E_AXIS]; 23c3a: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 23c3e: c0 90 58 06 lds r12, 0x0658 ; 0x800658 23c42: d0 90 59 06 lds r13, 0x0659 ; 0x800659 23c46: e0 90 5a 06 lds r14, 0x065A ; 0x80065a 23c4a: f0 90 5b 06 lds r15, 0x065B ; 0x80065b 23c4e: 89 2f mov r24, r25 23c50: 99 0f add r25, r25 23c52: 99 0b sbc r25, r25 23c54: aa 0b sbc r26, r26 23c56: bb 0b sbc r27, r27 23c58: 8c 0d add r24, r12 23c5a: 9d 1d adc r25, r13 23c5c: ae 1d adc r26, r14 23c5e: bf 1d adc r27, r15 23c60: 80 93 58 06 sts 0x0658, r24 ; 0x800658 23c64: 90 93 59 06 sts 0x0659, r25 ; 0x800659 23c68: a0 93 5a 06 sts 0x065A, r26 ; 0x80065a 23c6c: b0 93 5b 06 sts 0x065B, r27 ; 0x80065b #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 23c70: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 23c74: 80 91 69 05 lds r24, 0x0569 ; 0x800569 23c78: 89 0f add r24, r25 23c7a: 80 93 69 05 sts 0x0569, r24 ; 0x800569 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) 23c7e: 80 91 53 05 lds r24, 0x0553 ; 0x800553 23c82: 90 91 54 05 lds r25, 0x0554 ; 0x800554 23c86: a0 91 55 05 lds r26, 0x0555 ; 0x800555 23c8a: b0 91 56 05 lds r27, 0x0556 ; 0x800556 23c8e: 01 96 adiw r24, 0x01 ; 1 23c90: a1 1d adc r26, r1 23c92: b1 1d adc r27, r1 23c94: 80 93 53 05 sts 0x0553, r24 ; 0x800553 23c98: 90 93 54 05 sts 0x0554, r25 ; 0x800554 23c9c: a0 93 55 05 sts 0x0555, r26 ; 0x800555 23ca0: b0 93 56 05 sts 0x0556, r27 ; 0x800556 23ca4: 84 17 cp r24, r20 23ca6: 95 07 cpc r25, r21 23ca8: a6 07 cpc r26, r22 23caa: b7 07 cpc r27, r23 23cac: 10 f4 brcc .+4 ; 0x23cb2 <__vector_17+0xa78> } } FORCE_INLINE void stepper_tick_highres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 23cae: cf 5f subi r28, 0xFF ; 255 23cb0: 8e ce rjmp .-740 ; 0x239ce <__vector_17+0x794> else stepper_tick_highres(); #ifdef LIN_ADVANCE if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 23cb2: 80 91 69 05 lds r24, 0x0569 ; 0x800569 23cb6: 88 23 and r24, r24 23cb8: 39 f0 breq .+14 ; 0x23cc8 <__vector_17+0xa8e> 23cba: 87 ff sbrs r24, 7 23cbc: f2 c0 rjmp .+484 ; 0x23ea2 <__vector_17+0xc68> 23cbe: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23cc2: 80 64 ori r24, 0x40 ; 64 23cc4: 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) { 23cc8: 40 91 53 05 lds r20, 0x0553 ; 0x800553 23ccc: 50 91 54 05 lds r21, 0x0554 ; 0x800554 23cd0: 60 91 55 05 lds r22, 0x0555 ; 0x800555 23cd4: 70 91 56 05 lds r23, 0x0556 ; 0x800556 23cd8: c0 91 51 12 lds r28, 0x1251 ; 0x801251 23cdc: d0 91 52 12 lds r29, 0x1252 ; 0x801252 23ce0: 89 8d ldd r24, Y+25 ; 0x19 23ce2: 9a 8d ldd r25, Y+26 ; 0x1a 23ce4: ab 8d ldd r26, Y+27 ; 0x1b 23ce6: bc 8d ldd r27, Y+28 ; 0x1c 23ce8: 84 17 cp r24, r20 23cea: 95 07 cpc r25, r21 23cec: a6 07 cpc r26, r22 23cee: b7 07 cpc r27, r23 23cf0: 08 f4 brcc .+2 ; 0x23cf4 <__vector_17+0xaba> 23cf2: 37 c1 rjmp .+622 ; 0x23f62 <__vector_17+0xd28> // v = t * a -> acc_step_rate = acceleration_time * current_block->acceleration_rate acc_step_rate = MUL24x24R24(acceleration_time, current_block->acceleration_rate); 23cf4: c0 90 6c 05 lds r12, 0x056C ; 0x80056c 23cf8: d0 90 6d 05 lds r13, 0x056D ; 0x80056d 23cfc: e0 90 6e 05 lds r14, 0x056E ; 0x80056e 23d00: f0 90 6f 05 lds r15, 0x056F ; 0x80056f "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. ); 23d04: 2c 89 ldd r18, Y+20 ; 0x14 23d06: 3d 89 ldd r19, Y+21 ; 0x15 23d08: 4e 89 ldd r20, Y+22 ; 0x16 23d0a: aa 27 eor r26, r26 23d0c: c3 9e mul r12, r19 23d0e: b1 2d mov r27, r1 23d10: d4 9e mul r13, r20 23d12: c0 01 movw r24, r0 23d14: e4 9e mul r14, r20 23d16: 90 0d add r25, r0 23d18: e3 9e mul r14, r19 23d1a: 80 0d add r24, r0 23d1c: 91 1d adc r25, r1 23d1e: c4 9e mul r12, r20 23d20: b0 0d add r27, r0 23d22: 81 1d adc r24, r1 23d24: 9a 1f adc r25, r26 23d26: d3 9e mul r13, r19 23d28: b0 0d add r27, r0 23d2a: 81 1d adc r24, r1 23d2c: 9a 1f adc r25, r26 23d2e: e2 9e mul r14, r18 23d30: b0 0d add r27, r0 23d32: 81 1d adc r24, r1 23d34: 9a 1f adc r25, r26 23d36: d2 9e mul r13, r18 23d38: b1 0d add r27, r1 23d3a: 8a 1f adc r24, r26 23d3c: 9a 1f adc r25, r26 23d3e: bb 0f add r27, r27 23d40: 8a 1f adc r24, r26 23d42: 9a 1f adc r25, r26 23d44: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 23d46: 2a ad ldd r18, Y+58 ; 0x3a 23d48: 3b ad ldd r19, Y+59 ; 0x3b 23d4a: 82 0f add r24, r18 23d4c: 93 1f adc r25, r19 23d4e: 90 93 72 05 sts 0x0572, r25 ; 0x800572 23d52: 80 93 71 05 sts 0x0571, r24 ; 0x800571 // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 23d56: 2e a9 ldd r18, Y+54 ; 0x36 23d58: 3f a9 ldd r19, Y+55 ; 0x37 23d5a: 28 17 cp r18, r24 23d5c: 39 07 cpc r19, r25 23d5e: 20 f4 brcc .+8 ; 0x23d68 <__vector_17+0xb2e> acc_step_rate = current_block->nominal_rate; 23d60: 30 93 72 05 sts 0x0572, r19 ; 0x800572 23d64: 20 93 71 05 sts 0x0571, r18 ; 0x800571 // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 23d68: 80 91 71 05 lds r24, 0x0571 ; 0x800571 23d6c: 90 91 72 05 lds r25, 0x0572 ; 0x800572 #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; 23d70: 81 34 cpi r24, 0x41 ; 65 23d72: bc e9 ldi r27, 0x9C ; 156 23d74: 9b 07 cpc r25, r27 23d76: 08 f0 brcs .+2 ; 0x23d7a <__vector_17+0xb40> 23d78: 98 c0 rjmp .+304 ; 0x23eaa <__vector_17+0xc70> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 23d7a: 81 32 cpi r24, 0x21 ; 33 23d7c: ee e4 ldi r30, 0x4E ; 78 23d7e: 9e 07 cpc r25, r30 23d80: 08 f4 brcc .+2 ; 0x23d84 <__vector_17+0xb4a> 23d82: 96 c0 rjmp .+300 ; 0x23eb0 <__vector_17+0xc76> step_rate = (step_rate >> 2)&0x3fff; 23d84: 96 95 lsr r25 23d86: 87 95 ror r24 23d88: 96 95 lsr r25 23d8a: 87 95 ror r24 step_loops = 4; 23d8c: 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; 23d8e: 20 93 70 05 sts 0x0570, r18 ; 0x800570 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 23d92: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 23d94: 81 15 cp r24, r1 23d96: 28 e0 ldi r18, 0x08 ; 8 23d98: 92 07 cpc r25, r18 23d9a: 08 f4 brcc .+2 ; 0x23d9e <__vector_17+0xb64> 23d9c: 9b c0 rjmp .+310 ; 0x23ed4 <__vector_17+0xc9a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 23d9e: e9 2f mov r30, r25 23da0: ff 27 eor r31, r31 23da2: ee 0f add r30, r30 23da4: ff 1f adc r31, r31 23da6: ee 0f add r30, r30 23da8: ff 1f adc r31, r31 23daa: 9f 01 movw r18, r30 23dac: 2c 56 subi r18, 0x6C ; 108 23dae: 30 47 sbci r19, 0x70 ; 112 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 23db0: f9 01 movw r30, r18 23db2: 32 96 adiw r30, 0x02 ; 2 23db4: 45 91 lpm r20, Z+ 23db6: 54 91 lpm r21, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 23db8: f9 01 movw r30, r18 23dba: 25 91 lpm r18, Z+ 23dbc: 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. ); 23dbe: 58 9f mul r21, r24 23dc0: b0 01 movw r22, r0 23dc2: 48 9f mul r20, r24 23dc4: 00 0c add r0, r0 23dc6: 61 1d adc r22, r1 23dc8: 11 24 eor r1, r1 23dca: 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); 23dcc: 26 1b sub r18, r22 23dce: 37 0b sbc r19, r23 23dd0: c9 01 movw r24, r18 23dd2: 24 36 cpi r18, 0x64 ; 100 23dd4: 31 05 cpc r19, r1 23dd6: 10 f4 brcc .+4 ; 0x23ddc <__vector_17+0xba2> 23dd8: 84 e6 ldi r24, 0x64 ; 100 23dda: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 23ddc: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 23de0: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.439> 23de4: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.441+0x1> 23de8: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.441> acceleration_time += timer; 23dec: c8 0e add r12, r24 23dee: d9 1e adc r13, r25 23df0: e1 1c adc r14, r1 23df2: f1 1c adc r15, r1 23df4: c0 92 6c 05 sts 0x056C, r12 ; 0x80056c 23df8: d0 92 6d 05 sts 0x056D, r13 ; 0x80056d 23dfc: e0 92 6e 05 sts 0x056E, r14 ; 0x80056e 23e00: f0 92 6f 05 sts 0x056F, r15 ; 0x80056f #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 23e04: fe 01 movw r30, r28 23e06: e4 5b subi r30, 0xB4 ; 180 23e08: ff 4f sbci r31, 0xFF ; 255 23e0a: 80 81 ld r24, Z 23e0c: 81 11 cpse r24, r1 23e0e: 80 c0 rjmp .+256 ; 0x23f10 <__vector_17+0xcd6> 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; 23e10: 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) { 23e12: 80 ff sbrs r24, 0 23e14: 16 c0 rjmp .+44 ; 0x23e42 <__vector_17+0xc08> LA_phase = -1; 23e16: 9f ef ldi r25, 0xFF ; 255 23e18: 90 93 68 05 sts 0x0568, r25 ; 0x800568 if (current_adv_steps == target_adv_steps) { 23e1c: e0 91 48 04 lds r30, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 23e20: f0 91 49 04 lds r31, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 23e24: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 23e28: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 23e2c: e2 17 cp r30, r18 23e2e: f3 07 cpc r31, r19 23e30: 09 f0 breq .+2 ; 0x23e34 <__vector_17+0xbfa> 23e32: 27 c2 rjmp .+1102 ; 0x24282 <__vector_17+0x1048> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 23e34: 8f ef ldi r24, 0xFF ; 255 23e36: 9f ef ldi r25, 0xFF ; 255 23e38: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 23e3c: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> 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; 23e40: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 23e42: 80 fd sbrc r24, 0 23e44: 07 c0 rjmp .+14 ; 0x23e54 <__vector_17+0xc1a> 23e46: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> 23e4a: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 23e4e: 01 96 adiw r24, 0x01 ; 1 23e50: 09 f4 brne .+2 ; 0x23e54 <__vector_17+0xc1a> 23e52: b7 c2 rjmp .+1390 ; 0x243c2 <__vector_17+0x1188> // update timers & phase for the next iteration advance_spread(main_Rate); 23e54: e0 91 4a 04 lds r30, 0x044A ; 0x80044a <_ZL9main_Rate.lto_priv.441> 23e58: f0 91 4b 04 lds r31, 0x044B ; 0x80044b <_ZL9main_Rate.lto_priv.441+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 23e5c: 80 91 49 05 lds r24, 0x0549 ; 0x800549 23e60: 90 91 4a 05 lds r25, 0x054A ; 0x80054a 23e64: a0 91 4b 05 lds r26, 0x054B ; 0x80054b 23e68: b0 91 4c 05 lds r27, 0x054C ; 0x80054c 23e6c: 2c 01 movw r4, r24 23e6e: 3d 01 movw r6, r26 23e70: 4e 0e add r4, r30 23e72: 5f 1e adc r5, r31 23e74: 61 1c adc r6, r1 23e76: 71 1c adc r7, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 23e78: 9e 01 movw r18, r28 23e7a: 23 5b subi r18, 0xB3 ; 179 23e7c: 3f 4f sbci r19, 0xFF ; 255 23e7e: d9 01 movw r26, r18 23e80: cd 90 ld r12, X+ 23e82: dc 90 ld r13, X 23e84: f1 2c mov r15, r1 23e86: e1 2c mov r14, r1 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 23e88: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 23e8a: 4c 14 cp r4, r12 23e8c: 5d 04 cpc r5, r13 23e8e: 6e 04 cpc r6, r14 23e90: 7f 04 cpc r7, r15 23e92: 08 f4 brcc .+2 ; 0x23e96 <__vector_17+0xc5c> 23e94: 26 c2 rjmp .+1100 ; 0x242e2 <__vector_17+0x10a8> { ++ticks; 23e96: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 23e98: 4c 18 sub r4, r12 23e9a: 5d 08 sbc r5, r13 23e9c: 6e 08 sbc r6, r14 23e9e: 7f 08 sbc r7, r15 23ea0: f4 cf rjmp .-24 ; 0x23e8a <__vector_17+0xc50> else stepper_tick_highres(); #ifdef LIN_ADVANCE if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 23ea2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23ea6: 8f 7b andi r24, 0xBF ; 191 23ea8: 0d cf rjmp .-486 ; 0x23cc4 <__vector_17+0xa8a> #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; 23eaa: 80 e4 ldi r24, 0x40 ; 64 23eac: 9c e9 ldi r25, 0x9C ; 156 23eae: 6a cf rjmp .-300 ; 0x23d84 <__vector_17+0xb4a> 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 23eb0: 81 31 cpi r24, 0x11 ; 17 23eb2: f7 e2 ldi r31, 0x27 ; 39 23eb4: 9f 07 cpc r25, r31 23eb6: 20 f0 brcs .+8 ; 0x23ec0 <__vector_17+0xc86> step_rate = (step_rate >> 1)&0x7fff; 23eb8: 96 95 lsr r25 23eba: 87 95 ror r24 step_loops = 2; 23ebc: 22 e0 ldi r18, 0x02 ; 2 23ebe: 67 cf rjmp .-306 ; 0x23d8e <__vector_17+0xb54> } else { step_loops = 1; 23ec0: 21 e0 ldi r18, 0x01 ; 1 23ec2: 20 93 70 05 sts 0x0570, r18 ; 0x800570 23ec6: 80 32 cpi r24, 0x20 ; 32 23ec8: 91 05 cpc r25, r1 23eca: 08 f0 brcs .+2 ; 0x23ece <__vector_17+0xc94> 23ecc: 62 cf rjmp .-316 ; 0x23d92 <__vector_17+0xb58> 23ece: 80 e2 ldi r24, 0x20 ; 32 23ed0: 90 e0 ldi r25, 0x00 ; 0 23ed2: 5f cf rjmp .-322 ; 0x23d92 <__vector_17+0xb58> 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; 23ed4: ac 01 movw r20, r24 23ed6: 56 95 lsr r21 23ed8: 47 95 ror r20 23eda: 4c 7f andi r20, 0xFC ; 252 23edc: 4c 56 subi r20, 0x6C ; 108 23ede: 54 47 sbci r21, 0x74 ; 116 timer = (unsigned short)pgm_read_word_near(table_address); 23ee0: fa 01 movw r30, r20 23ee2: 25 91 lpm r18, Z+ 23ee4: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 23ee6: fa 01 movw r30, r20 23ee8: 32 96 adiw r30, 0x02 ; 2 23eea: 65 91 lpm r22, Z+ 23eec: 74 91 lpm r23, Z 23eee: 87 70 andi r24, 0x07 ; 7 23ef0: 99 27 eor r25, r25 23ef2: 86 9f mul r24, r22 23ef4: a0 01 movw r20, r0 23ef6: 87 9f mul r24, r23 23ef8: 50 0d add r21, r0 23efa: 96 9f mul r25, r22 23efc: 50 0d add r21, r0 23efe: 11 24 eor r1, r1 23f00: 73 e0 ldi r23, 0x03 ; 3 23f02: 56 95 lsr r21 23f04: 47 95 ror r20 23f06: 7a 95 dec r23 23f08: e1 f7 brne .-8 ; 0x23f02 <__vector_17+0xcc8> 23f0a: 24 1b sub r18, r20 23f0c: 35 0b sbc r19, r21 23f0e: 60 cf rjmp .-320 ; 0x23dd0 <__vector_17+0xb96> 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) { 23f10: 40 91 53 05 lds r20, 0x0553 ; 0x800553 23f14: 50 91 54 05 lds r21, 0x0554 ; 0x800554 23f18: 60 91 55 05 lds r22, 0x0555 ; 0x800555 23f1c: 70 91 56 05 lds r23, 0x0556 ; 0x800556 23f20: 80 91 70 05 lds r24, 0x0570 ; 0x800570 23f24: 90 e0 ldi r25, 0x00 ; 0 23f26: b0 e0 ldi r27, 0x00 ; 0 23f28: a0 e0 ldi r26, 0x00 ; 0 23f2a: 84 17 cp r24, r20 23f2c: 95 07 cpc r25, r21 23f2e: a6 07 cpc r26, r22 23f30: b7 07 cpc r27, r23 23f32: 08 f4 brcc .+2 ; 0x23f36 <__vector_17+0xcfc> 23f34: 6d cf rjmp .-294 ; 0x23e10 <__vector_17+0xbd6> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 23f36: 80 91 57 05 lds r24, 0x0557 ; 0x800557 23f3a: 81 11 cpse r24, r1 23f3c: 02 c0 rjmp .+4 ; 0x23f42 <__vector_17+0xd08> _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; 23f3e: 83 e0 ldi r24, 0x03 ; 3 23f40: 68 cf rjmp .-304 ; 0x23e12 <__vector_17+0xbd8> if (e_extruding && current_adv_steps > target_adv_steps) 23f42: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 23f46: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 23f4a: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 23f4e: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 23f52: 28 17 cp r18, r24 23f54: 39 07 cpc r19, r25 23f56: 98 f7 brcc .-26 ; 0x23f3e <__vector_17+0xd04> target_adv_steps = current_adv_steps; 23f58: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 23f5c: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a 23f60: ee cf rjmp .-36 ; 0x23f3e <__vector_17+0xd04> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 23f62: 80 91 53 05 lds r24, 0x0553 ; 0x800553 23f66: 90 91 54 05 lds r25, 0x0554 ; 0x800554 23f6a: a0 91 55 05 lds r26, 0x0555 ; 0x800555 23f6e: b0 91 56 05 lds r27, 0x0556 ; 0x800556 23f72: 4d 8d ldd r20, Y+29 ; 0x1d 23f74: 5e 8d ldd r21, Y+30 ; 0x1e 23f76: 6f 8d ldd r22, Y+31 ; 0x1f 23f78: 78 a1 ldd r23, Y+32 ; 0x20 23f7a: 48 17 cp r20, r24 23f7c: 59 07 cpc r21, r25 23f7e: 6a 07 cpc r22, r26 23f80: 7b 07 cpc r23, r27 23f82: 08 f0 brcs .+2 ; 0x23f86 <__vector_17+0xd4c> 23f84: e3 c0 rjmp .+454 ; 0x2414c <__vector_17+0xf12> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 23f86: c0 90 74 05 lds r12, 0x0574 ; 0x800574 23f8a: d0 90 75 05 lds r13, 0x0575 ; 0x800575 23f8e: e0 90 76 05 lds r14, 0x0576 ; 0x800576 23f92: f0 90 77 05 lds r15, 0x0577 ; 0x800577 "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. ); 23f96: 6c 88 ldd r6, Y+20 ; 0x14 23f98: 7d 88 ldd r7, Y+21 ; 0x15 23f9a: 8e 88 ldd r8, Y+22 ; 0x16 23f9c: aa 27 eor r26, r26 23f9e: c7 9c mul r12, r7 23fa0: b1 2d mov r27, r1 23fa2: d8 9c mul r13, r8 23fa4: f0 01 movw r30, r0 23fa6: e8 9c mul r14, r8 23fa8: f0 0d add r31, r0 23faa: e7 9c mul r14, r7 23fac: e0 0d add r30, r0 23fae: f1 1d adc r31, r1 23fb0: c8 9c mul r12, r8 23fb2: b0 0d add r27, r0 23fb4: e1 1d adc r30, r1 23fb6: fa 1f adc r31, r26 23fb8: d7 9c mul r13, r7 23fba: b0 0d add r27, r0 23fbc: e1 1d adc r30, r1 23fbe: fa 1f adc r31, r26 23fc0: e6 9c mul r14, r6 23fc2: b0 0d add r27, r0 23fc4: e1 1d adc r30, r1 23fc6: fa 1f adc r31, r26 23fc8: d6 9c mul r13, r6 23fca: b1 0d add r27, r1 23fcc: ea 1f adc r30, r26 23fce: fa 1f adc r31, r26 23fd0: bb 0f add r27, r27 23fd2: ea 1f adc r30, r26 23fd4: fa 1f adc r31, r26 23fd6: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 23fd8: 20 91 71 05 lds r18, 0x0571 ; 0x800571 23fdc: 30 91 72 05 lds r19, 0x0572 ; 0x800572 23fe0: 8e ad ldd r24, Y+62 ; 0x3e 23fe2: 9f ad ldd r25, Y+63 ; 0x3f 23fe4: 2e 17 cp r18, r30 23fe6: 3f 07 cpc r19, r31 23fe8: 30 f0 brcs .+12 ; 0x23ff6 <__vector_17+0xdbc> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 23fea: 2e 1b sub r18, r30 23fec: 3f 0b sbc r19, r31 23fee: 82 17 cp r24, r18 23ff0: 93 07 cpc r25, r19 23ff2: 08 f4 brcc .+2 ; 0x23ff6 <__vector_17+0xdbc> 23ff4: 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; 23ff6: 81 34 cpi r24, 0x41 ; 65 23ff8: ac e9 ldi r26, 0x9C ; 156 23ffa: 9a 07 cpc r25, r26 23ffc: 08 f0 brcs .+2 ; 0x24000 <__vector_17+0xdc6> 23ffe: 75 c0 rjmp .+234 ; 0x240ea <__vector_17+0xeb0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 24000: 81 32 cpi r24, 0x21 ; 33 24002: be e4 ldi r27, 0x4E ; 78 24004: 9b 07 cpc r25, r27 24006: 08 f4 brcc .+2 ; 0x2400a <__vector_17+0xdd0> 24008: 73 c0 rjmp .+230 ; 0x240f0 <__vector_17+0xeb6> step_rate = (step_rate >> 2)&0x3fff; 2400a: 96 95 lsr r25 2400c: 87 95 ror r24 2400e: 96 95 lsr r25 24010: 87 95 ror r24 step_loops = 4; 24012: 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; 24014: 20 93 70 05 sts 0x0570, r18 ; 0x800570 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 24018: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2401a: 81 15 cp r24, r1 2401c: f8 e0 ldi r31, 0x08 ; 8 2401e: 9f 07 cpc r25, r31 24020: 08 f4 brcc .+2 ; 0x24024 <__vector_17+0xdea> 24022: 78 c0 rjmp .+240 ; 0x24114 <__vector_17+0xeda> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 24024: e9 2f mov r30, r25 24026: ff 27 eor r31, r31 24028: ee 0f add r30, r30 2402a: ff 1f adc r31, r31 2402c: ee 0f add r30, r30 2402e: ff 1f adc r31, r31 24030: 9f 01 movw r18, r30 24032: 2c 56 subi r18, 0x6C ; 108 24034: 30 47 sbci r19, 0x70 ; 112 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 24036: f9 01 movw r30, r18 24038: 32 96 adiw r30, 0x02 ; 2 2403a: a5 91 lpm r26, Z+ 2403c: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2403e: f9 01 movw r30, r18 24040: 25 91 lpm r18, Z+ 24042: 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. ); 24044: b8 9f mul r27, r24 24046: f0 01 movw r30, r0 24048: a8 9f mul r26, r24 2404a: 00 0c add r0, r0 2404c: e1 1d adc r30, r1 2404e: 11 24 eor r1, r1 24050: 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); 24052: 2e 1b sub r18, r30 24054: 3f 0b sbc r19, r31 24056: c9 01 movw r24, r18 24058: 24 36 cpi r18, 0x64 ; 100 2405a: 31 05 cpc r19, r1 2405c: 10 f4 brcc .+4 ; 0x24062 <__vector_17+0xe28> 2405e: 84 e6 ldi r24, 0x64 ; 100 24060: 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); 24062: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 24066: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.439> 2406a: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.441+0x1> 2406e: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.441> deceleration_time += timer; 24072: c8 0e add r12, r24 24074: d9 1e adc r13, r25 24076: e1 1c adc r14, r1 24078: f1 1c adc r15, r1 2407a: c0 92 74 05 sts 0x0574, r12 ; 0x800574 2407e: d0 92 75 05 sts 0x0575, r13 ; 0x800575 24082: e0 92 76 05 sts 0x0576, r14 ; 0x800576 24086: f0 92 77 05 sts 0x0577, r15 ; 0x800577 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2408a: fe 01 movw r30, r28 2408c: e4 5b subi r30, 0xB4 ; 180 2408e: ff 4f sbci r31, 0xFF ; 255 24090: 80 81 ld r24, Z 24092: 88 23 and r24, r24 24094: 09 f4 brne .+2 ; 0x24098 <__vector_17+0xe5e> 24096: bc ce rjmp .-648 ; 0x23e10 <__vector_17+0xbd6> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 24098: 80 91 53 05 lds r24, 0x0553 ; 0x800553 2409c: 90 91 54 05 lds r25, 0x0554 ; 0x800554 240a0: a0 91 55 05 lds r26, 0x0555 ; 0x800555 240a4: b0 91 56 05 lds r27, 0x0556 ; 0x800556 240a8: 20 91 70 05 lds r18, 0x0570 ; 0x800570 240ac: 42 0f add r20, r18 240ae: 51 1d adc r21, r1 240b0: 61 1d adc r22, r1 240b2: 71 1d adc r23, r1 240b4: 48 17 cp r20, r24 240b6: 59 07 cpc r21, r25 240b8: 6a 07 cpc r22, r26 240ba: 7b 07 cpc r23, r27 240bc: 08 f4 brcc .+2 ; 0x240c0 <__vector_17+0xe86> 240be: a8 ce rjmp .-688 ; 0x23e10 <__vector_17+0xbd6> target_adv_steps = current_block->final_adv_steps; 240c0: 35 96 adiw r30, 0x05 ; 5 240c2: 20 81 ld r18, Z 240c4: 31 81 ldd r19, Z+1 ; 0x01 240c6: 30 93 6b 05 sts 0x056B, r19 ; 0x80056b 240ca: 20 93 6a 05 sts 0x056A, r18 ; 0x80056a la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 240ce: 80 91 57 05 lds r24, 0x0557 ; 0x800557 240d2: 88 23 and r24, r24 240d4: 09 f4 brne .+2 ; 0x240d8 <__vector_17+0xe9e> 240d6: 33 cf rjmp .-410 ; 0x23f3e <__vector_17+0xd04> 240d8: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 240dc: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 240e0: 82 17 cp r24, r18 240e2: 93 07 cpc r25, r19 240e4: 08 f0 brcs .+2 ; 0x240e8 <__vector_17+0xeae> 240e6: 2b cf rjmp .-426 ; 0x23f3e <__vector_17+0xd04> 240e8: 37 cf rjmp .-402 ; 0x23f58 <__vector_17+0xd1e> #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; 240ea: 80 e4 ldi r24, 0x40 ; 64 240ec: 9c e9 ldi r25, 0x9C ; 156 240ee: 8d cf rjmp .-230 ; 0x2400a <__vector_17+0xdd0> 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 240f0: 81 31 cpi r24, 0x11 ; 17 240f2: e7 e2 ldi r30, 0x27 ; 39 240f4: 9e 07 cpc r25, r30 240f6: 20 f0 brcs .+8 ; 0x24100 <__vector_17+0xec6> step_rate = (step_rate >> 1)&0x7fff; 240f8: 96 95 lsr r25 240fa: 87 95 ror r24 step_loops = 2; 240fc: 22 e0 ldi r18, 0x02 ; 2 240fe: 8a cf rjmp .-236 ; 0x24014 <__vector_17+0xdda> } else { step_loops = 1; 24100: 21 e0 ldi r18, 0x01 ; 1 24102: 20 93 70 05 sts 0x0570, r18 ; 0x800570 24106: 80 32 cpi r24, 0x20 ; 32 24108: 91 05 cpc r25, r1 2410a: 08 f0 brcs .+2 ; 0x2410e <__vector_17+0xed4> 2410c: 85 cf rjmp .-246 ; 0x24018 <__vector_17+0xdde> 2410e: 80 e2 ldi r24, 0x20 ; 32 24110: 90 e0 ldi r25, 0x00 ; 0 24112: 82 cf rjmp .-252 ; 0x24018 <__vector_17+0xdde> 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; 24114: dc 01 movw r26, r24 24116: b6 95 lsr r27 24118: a7 95 ror r26 2411a: ac 7f andi r26, 0xFC ; 252 2411c: ac 56 subi r26, 0x6C ; 108 2411e: b4 47 sbci r27, 0x74 ; 116 timer = (unsigned short)pgm_read_word_near(table_address); 24120: fd 01 movw r30, r26 24122: 25 91 lpm r18, Z+ 24124: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 24126: fd 01 movw r30, r26 24128: 32 96 adiw r30, 0x02 ; 2 2412a: a5 91 lpm r26, Z+ 2412c: b4 91 lpm r27, Z 2412e: 87 70 andi r24, 0x07 ; 7 24130: 99 27 eor r25, r25 24132: 8a 9f mul r24, r26 24134: f0 01 movw r30, r0 24136: 8b 9f mul r24, r27 24138: f0 0d add r31, r0 2413a: 9a 9f mul r25, r26 2413c: f0 0d add r31, r0 2413e: 11 24 eor r1, r1 24140: a3 e0 ldi r26, 0x03 ; 3 24142: f6 95 lsr r31 24144: e7 95 ror r30 24146: aa 95 dec r26 24148: e1 f7 brne .-8 ; 0x24142 <__vector_17+0xf08> 2414a: 83 cf rjmp .-250 ; 0x24052 <__vector_17+0xe18> } } #endif } else { if (! step_loops_nominal) { 2414c: 80 91 73 05 lds r24, 0x0573 ; 0x800573 24150: 88 23 and r24, r24 24152: 71 f0 breq .+28 ; 0x24170 <__vector_17+0xf36> 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; 24154: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 24156: 20 91 4d 05 lds r18, 0x054D ; 0x80054d 2415a: 30 91 4e 05 lds r19, 0x054E ; 0x80054e 2415e: 30 93 4f 04 sts 0x044F, r19 ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 24162: 20 93 4e 04 sts 0x044E, r18 ; 0x80044e <_ZL11nextMainISR.lto_priv.439> 24166: 30 93 4b 04 sts 0x044B, r19 ; 0x80044b <_ZL9main_Rate.lto_priv.441+0x1> 2416a: 20 93 4a 04 sts 0x044A, r18 ; 0x80044a <_ZL9main_Rate.lto_priv.441> 2416e: 51 ce rjmp .-862 ; 0x23e12 <__vector_17+0xbd8> } 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); 24170: 8e a9 ldd r24, Y+54 ; 0x36 24172: 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; 24174: 81 34 cpi r24, 0x41 ; 65 24176: 2c e9 ldi r18, 0x9C ; 156 24178: 92 07 cpc r25, r18 2417a: 08 f0 brcs .+2 ; 0x2417e <__vector_17+0xf44> 2417c: 4e c0 rjmp .+156 ; 0x2421a <__vector_17+0xfe0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2417e: 81 32 cpi r24, 0x21 ; 33 24180: 4e e4 ldi r20, 0x4E ; 78 24182: 94 07 cpc r25, r20 24184: 08 f4 brcc .+2 ; 0x24188 <__vector_17+0xf4e> 24186: 4c c0 rjmp .+152 ; 0x24220 <__vector_17+0xfe6> step_rate = (step_rate >> 2)&0x3fff; 24188: 96 95 lsr r25 2418a: 87 95 ror r24 2418c: 96 95 lsr r25 2418e: 87 95 ror r24 step_loops = 4; 24190: 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; 24192: 20 93 70 05 sts 0x0570, r18 ; 0x800570 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 24196: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 24198: 81 15 cp r24, r1 2419a: a8 e0 ldi r26, 0x08 ; 8 2419c: 9a 07 cpc r25, r26 2419e: 08 f4 brcc .+2 ; 0x241a2 <__vector_17+0xf68> 241a0: 51 c0 rjmp .+162 ; 0x24244 <__vector_17+0x100a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 241a2: e9 2f mov r30, r25 241a4: ff 27 eor r31, r31 241a6: ee 0f add r30, r30 241a8: ff 1f adc r31, r31 241aa: ee 0f add r30, r30 241ac: ff 1f adc r31, r31 241ae: 9f 01 movw r18, r30 241b0: 2c 56 subi r18, 0x6C ; 108 241b2: 30 47 sbci r19, 0x70 ; 112 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 241b4: f9 01 movw r30, r18 241b6: 32 96 adiw r30, 0x02 ; 2 241b8: 65 91 lpm r22, Z+ 241ba: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 241bc: f9 01 movw r30, r18 241be: 25 91 lpm r18, Z+ 241c0: 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. ); 241c2: 78 9f mul r23, r24 241c4: a0 01 movw r20, r0 241c6: 68 9f mul r22, r24 241c8: 00 0c add r0, r0 241ca: 41 1d adc r20, r1 241cc: 11 24 eor r1, r1 241ce: 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); 241d0: c9 01 movw r24, r18 241d2: 84 1b sub r24, r20 241d4: 95 0b sbc r25, r21 241d6: 84 36 cpi r24, 0x64 ; 100 241d8: 91 05 cpc r25, r1 241da: 10 f4 brcc .+4 ; 0x241e0 <__vector_17+0xfa6> 241dc: 84 e6 ldi r24, 0x64 ; 100 241de: 90 e0 ldi r25, 0x00 ; 0 241e0: 90 93 4e 05 sts 0x054E, r25 ; 0x80054e 241e4: 80 93 4d 05 sts 0x054D, r24 ; 0x80054d step_loops_nominal = step_loops; 241e8: 80 91 70 05 lds r24, 0x0570 ; 0x800570 241ec: 80 93 73 05 sts 0x0573, r24 ; 0x800573 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 241f0: fe 01 movw r30, r28 241f2: e4 5b subi r30, 0xB4 ; 180 241f4: ff 4f sbci r31, 0xFF ; 255 241f6: 80 81 ld r24, Z 241f8: 88 23 and r24, r24 241fa: 09 f4 brne .+2 ; 0x241fe <__vector_17+0xfc4> 241fc: ab cf rjmp .-170 ; 0x24154 <__vector_17+0xf1a> // 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) 241fe: 80 91 57 05 lds r24, 0x0557 ; 0x800557 24202: 88 23 and r24, r24 24204: 41 f0 breq .+16 ; 0x24216 <__vector_17+0xfdc> target_adv_steps = current_adv_steps; 24206: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 2420a: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 2420e: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 24212: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a #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; 24216: 81 e0 ldi r24, 0x01 ; 1 24218: 9e cf rjmp .-196 ; 0x24156 <__vector_17+0xf1c> #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; 2421a: 80 e4 ldi r24, 0x40 ; 64 2421c: 9c e9 ldi r25, 0x9C ; 156 2421e: b4 cf rjmp .-152 ; 0x24188 <__vector_17+0xf4e> 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 24220: 81 31 cpi r24, 0x11 ; 17 24222: 57 e2 ldi r21, 0x27 ; 39 24224: 95 07 cpc r25, r21 24226: 20 f0 brcs .+8 ; 0x24230 <__vector_17+0xff6> step_rate = (step_rate >> 1)&0x7fff; 24228: 96 95 lsr r25 2422a: 87 95 ror r24 step_loops = 2; 2422c: 22 e0 ldi r18, 0x02 ; 2 2422e: b1 cf rjmp .-158 ; 0x24192 <__vector_17+0xf58> } else { step_loops = 1; 24230: 21 e0 ldi r18, 0x01 ; 1 24232: 20 93 70 05 sts 0x0570, r18 ; 0x800570 24236: 80 32 cpi r24, 0x20 ; 32 24238: 91 05 cpc r25, r1 2423a: 08 f0 brcs .+2 ; 0x2423e <__vector_17+0x1004> 2423c: ac cf rjmp .-168 ; 0x24196 <__vector_17+0xf5c> 2423e: 80 e2 ldi r24, 0x20 ; 32 24240: 90 e0 ldi r25, 0x00 ; 0 24242: a9 cf rjmp .-174 ; 0x24196 <__vector_17+0xf5c> 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; 24244: 9c 01 movw r18, r24 24246: 36 95 lsr r19 24248: 27 95 ror r18 2424a: 2c 7f andi r18, 0xFC ; 252 2424c: 2c 56 subi r18, 0x6C ; 108 2424e: 34 47 sbci r19, 0x74 ; 116 timer = (unsigned short)pgm_read_word_near(table_address); 24250: f9 01 movw r30, r18 24252: 45 91 lpm r20, Z+ 24254: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 24256: f9 01 movw r30, r18 24258: 32 96 adiw r30, 0x02 ; 2 2425a: 65 91 lpm r22, Z+ 2425c: 74 91 lpm r23, Z 2425e: 87 70 andi r24, 0x07 ; 7 24260: 99 27 eor r25, r25 24262: 86 9f mul r24, r22 24264: 90 01 movw r18, r0 24266: 87 9f mul r24, r23 24268: 30 0d add r19, r0 2426a: 96 9f mul r25, r22 2426c: 30 0d add r19, r0 2426e: 11 24 eor r1, r1 24270: a3 e0 ldi r26, 0x03 ; 3 24272: 36 95 lsr r19 24274: 27 95 ror r18 24276: aa 95 dec r26 24278: e1 f7 brne .-8 ; 0x24272 <__vector_17+0x1038> 2427a: ca 01 movw r24, r20 2427c: 82 1b sub r24, r18 2427e: 93 0b sbc r25, r19 24280: aa cf rjmp .-172 ; 0x241d6 <__vector_17+0xf9c> la_state = 0; nextAdvanceISR = ADV_NEVER; } else { // reset error and iterations per loop for this phase eISR_Err = current_block->advance_rate; 24282: de 01 movw r26, r28 24284: a3 5b subi r26, 0xB3 ; 179 24286: bf 4f sbci r27, 0xFF ; 255 24288: 4d 91 ld r20, X+ 2428a: 5c 91 ld r21, X 2428c: 11 97 sbiw r26, 0x01 ; 1 2428e: 70 e0 ldi r23, 0x00 ; 0 24290: 60 e0 ldi r22, 0x00 ; 0 24292: 40 93 49 05 sts 0x0549, r20 ; 0x800549 24296: 50 93 4a 05 sts 0x054A, r21 ; 0x80054a 2429a: 60 93 4b 05 sts 0x054B, r22 ; 0x80054b 2429e: 70 93 4c 05 sts 0x054C, r23 ; 0x80054c e_step_loops = current_block->advance_step_loops; 242a2: 16 96 adiw r26, 0x06 ; 6 242a4: 9c 91 ld r25, X 242a6: 90 93 48 05 sts 0x0548, r25 ; 0x800548 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 242aa: 98 2f mov r25, r24 242ac: 92 70 andi r25, 0x02 ; 2 242ae: 09 f4 brne .+2 ; 0x242b2 <__vector_17+0x1078> 242b0: c8 cd rjmp .-1136 ; 0x23e42 <__vector_17+0xc08> 242b2: 90 91 57 05 lds r25, 0x0557 ; 0x800557 242b6: 99 23 and r25, r25 242b8: 09 f4 brne .+2 ; 0x242bc <__vector_17+0x1082> 242ba: c3 cd rjmp .-1146 ; 0x23e42 <__vector_17+0xc08> 242bc: 2e 17 cp r18, r30 242be: 3f 07 cpc r19, r31 242c0: 08 f0 brcs .+2 ; 0x242c4 <__vector_17+0x108a> 242c2: bf cd rjmp .-1154 ; 0x23e42 <__vector_17+0xc08> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 242c4: 44 0f add r20, r20 242c6: 55 1f adc r21, r21 242c8: 66 1f adc r22, r22 242ca: 77 1f adc r23, r23 242cc: 40 93 49 05 sts 0x0549, r20 ; 0x800549 242d0: 50 93 4a 05 sts 0x054A, r21 ; 0x80054a 242d4: 60 93 4b 05 sts 0x054B, r22 ; 0x80054b 242d8: 70 93 4c 05 sts 0x054C, r23 ; 0x80054c LA_phase = 0; 242dc: 10 92 68 05 sts 0x0568, r1 ; 0x800568 242e0: b0 cd rjmp .-1184 ; 0x23e42 <__vector_17+0xc08> 242e2: 40 92 49 05 sts 0x0549, r4 ; 0x800549 242e6: 50 92 4a 05 sts 0x054A, r5 ; 0x80054a 242ea: 60 92 4b 05 sts 0x054B, r6 ; 0x80054b 242ee: 70 92 4c 05 sts 0x054C, r7 ; 0x80054c while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 242f2: 61 11 cpse r22, r1 242f4: 1d c0 rjmp .+58 ; 0x24330 <__vector_17+0x10f6> { eISR_Rate = timer; 242f6: f0 93 47 05 sts 0x0547, r31 ; 0x800547 242fa: e0 93 46 05 sts 0x0546, r30 ; 0x800546 nextAdvanceISR = timer; 242fe: f0 93 4d 04 sts 0x044D, r31 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 24302: e0 93 4c 04 sts 0x044C, r30 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 24306: 80 91 68 05 lds r24, 0x0568 ; 0x800568 2430a: 87 fd sbrc r24, 7 2430c: 5a c0 rjmp .+180 ; 0x243c2 <__vector_17+0x1188> if (step_loops == e_step_loops) 2430e: 80 91 70 05 lds r24, 0x0570 ; 0x800570 24312: 10 91 48 05 lds r17, 0x0548 ; 0x800548 24316: c3 5b subi r28, 0xB3 ; 179 24318: df 4f sbci r29, 0xFF ; 255 2431a: 28 81 ld r18, Y 2431c: 39 81 ldd r19, Y+1 ; 0x01 2431e: 81 13 cpse r24, r17 24320: 35 c0 rjmp .+106 ; 0x2438c <__vector_17+0x1152> LA_phase = (current_block->advance_rate < main_Rate); 24322: 81 e0 ldi r24, 0x01 ; 1 24324: 2e 17 cp r18, r30 24326: 3f 07 cpc r19, r31 24328: 08 f4 brcc .+2 ; 0x2432c <__vector_17+0x10f2> 2432a: 49 c0 rjmp .+146 ; 0x243be <__vector_17+0x1184> 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); 2432c: 80 e0 ldi r24, 0x00 ; 0 2432e: 47 c0 rjmp .+142 ; 0x243be <__vector_17+0x1184> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 24330: 64 30 cpi r22, 0x04 ; 4 24332: 28 f5 brcc .+74 ; 0x2437e <__vector_17+0x1144> eISR_Rate = fastdiv(timer, ticks + 1); 24334: 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); 24336: 63 30 cpi r22, 0x03 ; 3 24338: a9 f0 breq .+42 ; 0x24364 <__vector_17+0x112a> 2433a: 66 95 lsr r22 2433c: af 01 movw r20, r30 2433e: 02 c0 rjmp .+4 ; 0x24344 <__vector_17+0x110a> 24340: 56 95 lsr r21 24342: 47 95 ror r20 24344: 6a 95 dec r22 24346: e2 f7 brpl .-8 ; 0x24340 <__vector_17+0x1106> 24348: 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); 2434a: 70 93 47 05 sts 0x0547, r23 ; 0x800547 2434e: 60 93 46 05 sts 0x0546, r22 ; 0x800546 } nextAdvanceISR = eISR_Rate; 24352: 80 91 46 05 lds r24, 0x0546 ; 0x800546 24356: 90 91 47 05 lds r25, 0x0547 ; 0x800547 2435a: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 2435e: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> 24362: d1 cf rjmp .-94 ; 0x24306 <__vector_17+0x10cc> // @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; 24364: 9f 01 movw r18, r30 24366: ab ea ldi r26, 0xAB ; 171 24368: ba ea ldi r27, 0xAA ; 170 2436a: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 2436e: 41 e1 ldi r20, 0x11 ; 17 24370: 96 95 lsr r25 24372: 87 95 ror r24 24374: 77 95 ror r23 24376: 67 95 ror r22 24378: 4a 95 dec r20 2437a: d1 f7 brne .-12 ; 0x24370 <__vector_17+0x1136> 2437c: e6 cf rjmp .-52 ; 0x2434a <__vector_17+0x1110> if (ticks <= 3) eISR_Rate = fastdiv(timer, ticks + 1); else { // >4 ticks are still possible on slow moves eISR_Rate = timer / (ticks + 1); 2437e: 70 e0 ldi r23, 0x00 ; 0 24380: 6f 5f subi r22, 0xFF ; 255 24382: 7f 4f sbci r23, 0xFF ; 255 24384: cf 01 movw r24, r30 24386: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 2438a: df cf rjmp .-66 ; 0x2434a <__vector_17+0x1110> #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); 2438c: 83 30 cpi r24, 0x03 ; 3 2438e: 09 f4 brne .+2 ; 0x24392 <__vector_17+0x1158> 24390: a2 c0 rjmp .+324 ; 0x244d6 <__vector_17+0x129c> 24392: 86 95 lsr r24 24394: a9 01 movw r20, r18 24396: 02 c0 rjmp .+4 ; 0x2439c <__vector_17+0x1162> 24398: 56 95 lsr r21 2439a: 47 95 ror r20 2439c: 8a 95 dec r24 2439e: e2 f7 brpl .-8 ; 0x24398 <__vector_17+0x115e> 243a0: 13 30 cpi r17, 0x03 ; 3 243a2: 09 f4 brne .+2 ; 0x243a6 <__vector_17+0x116c> 243a4: a6 c0 rjmp .+332 ; 0x244f2 <__vector_17+0x12b8> 243a6: 16 95 lsr r17 243a8: bf 01 movw r22, r30 243aa: 02 c0 rjmp .+4 ; 0x243b0 <__vector_17+0x1176> 243ac: 76 95 lsr r23 243ae: 67 95 ror r22 243b0: 1a 95 dec r17 243b2: e2 f7 brpl .-8 ; 0x243ac <__vector_17+0x1172> 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); 243b4: 81 e0 ldi r24, 0x01 ; 1 243b6: 46 17 cp r20, r22 243b8: 57 07 cpc r21, r23 243ba: 08 f0 brcs .+2 ; 0x243be <__vector_17+0x1184> 243bc: b7 cf rjmp .-146 ; 0x2432c <__vector_17+0x10f2> 243be: 80 93 68 05 sts 0x0568, r24 ; 0x800568 } } // 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(); 243c2: 0f 94 d3 00 call 0x201a6 ; 0x201a6 #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 243c6: 40 91 53 05 lds r20, 0x0553 ; 0x800553 243ca: 50 91 54 05 lds r21, 0x0554 ; 0x800554 243ce: 60 91 55 05 lds r22, 0x0555 ; 0x800555 243d2: 70 91 56 05 lds r23, 0x0556 ; 0x800556 243d6: e0 91 51 12 lds r30, 0x1251 ; 0x801251 243da: f0 91 52 12 lds r31, 0x1252 ; 0x801252 243de: 80 89 ldd r24, Z+16 ; 0x10 243e0: 91 89 ldd r25, Z+17 ; 0x11 243e2: a2 89 ldd r26, Z+18 ; 0x12 243e4: b3 89 ldd r27, Z+19 ; 0x13 243e6: 48 17 cp r20, r24 243e8: 59 07 cpc r21, r25 243ea: 6a 07 cpc r22, r26 243ec: 7b 07 cpc r23, r27 243ee: 80 f0 brcs .+32 ; 0x24410 <__vector_17+0x11d6> current_block = NULL; 243f0: 10 92 52 12 sts 0x1252, r1 ; 0x801252 243f4: 10 92 51 12 sts 0x1251, r1 ; 0x801251 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) { 243f8: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 243fc: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 24400: 98 17 cp r25, r24 24402: 31 f0 breq .+12 ; 0x24410 <__vector_17+0x11d6> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 24404: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 24408: 8f 5f subi r24, 0xFF ; 255 2440a: 8f 70 andi r24, 0x0F ; 15 2440c: 80 93 3f 0d sts 0x0D3F, r24 ; 0x800d3f WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 24410: 60 91 4c 04 lds r22, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> 24414: 70 91 4d 04 lds r23, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> if (eisr) 24418: 61 15 cp r22, r1 2441a: 71 05 cpc r23, r1 2441c: 09 f0 breq .+2 ; 0x24420 <__vector_17+0x11e6> 2441e: 46 c0 rjmp .+140 ; 0x244ac <__vector_17+0x1272> #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) { 24420: 40 91 48 04 lds r20, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 24424: 50 91 49 04 lds r21, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 24428: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 2442c: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 24430: 80 91 69 05 lds r24, 0x0569 ; 0x800569 24434: 24 17 cp r18, r20 24436: 35 07 cpc r19, r21 24438: 08 f0 brcs .+2 ; 0x2443c <__vector_17+0x1202> 2443a: 6c c0 rjmp .+216 ; 0x24514 <__vector_17+0x12da> // decompression if (e_step_loops != 1) { 2443c: 90 91 48 05 lds r25, 0x0548 ; 0x800548 24440: 91 30 cpi r25, 0x01 ; 1 24442: 41 f0 breq .+16 ; 0x24454 <__vector_17+0x121a> uint16_t d_steps = current_adv_steps - target_adv_steps; 24444: 42 1b sub r20, r18 24446: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 24448: 94 17 cp r25, r20 2444a: 15 06 cpc r1, r21 2444c: 19 f0 breq .+6 ; 0x24454 <__vector_17+0x121a> 2444e: 10 f0 brcs .+4 ; 0x24454 <__vector_17+0x121a> e_step_loops = d_steps; 24450: 40 93 48 05 sts 0x0548, r20 ; 0x800548 } e_steps -= e_step_loops; 24454: 90 91 48 05 lds r25, 0x0548 ; 0x800548 24458: 89 1b sub r24, r25 2445a: 80 93 69 05 sts 0x0569, r24 ; 0x800569 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2445e: 88 23 and r24, r24 24460: 39 f0 breq .+14 ; 0x24470 <__vector_17+0x1236> 24462: 87 ff sbrs r24, 7 24464: 53 c0 rjmp .+166 ; 0x2450c <__vector_17+0x12d2> 24466: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2446a: 80 64 ori r24, 0x40 ; 64 2446c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 24470: 20 91 48 05 lds r18, 0x0548 ; 0x800548 24474: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 24478: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 2447c: 82 1b sub r24, r18 2447e: 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; 24480: 90 93 49 04 sts 0x0449, r25 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 24484: 80 93 48 04 sts 0x0448, r24 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> } if (current_adv_steps == target_adv_steps) { 24488: 20 91 48 04 lds r18, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 2448c: 30 91 49 04 lds r19, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 24490: 80 91 6a 05 lds r24, 0x056A ; 0x80056a 24494: 90 91 6b 05 lds r25, 0x056B ; 0x80056b 24498: 28 17 cp r18, r24 2449a: 39 07 cpc r19, r25 2449c: 09 f0 breq .+2 ; 0x244a0 <__vector_17+0x1266> 2449e: 66 c0 rjmp .+204 ; 0x2456c <__vector_17+0x1332> // advance steps completed nextAdvanceISR = ADV_NEVER; 244a0: 8f ef ldi r24, 0xFF ; 255 244a2: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 244a4: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 244a8: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 244ac: 40 91 69 05 lds r20, 0x0569 ; 0x800569 244b0: 41 11 cpse r20, r1 244b2: 61 c0 rjmp .+194 ; 0x24576 <__vector_17+0x133c> 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) 244b4: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> 244b8: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 244bc: 20 91 4e 04 lds r18, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.439> 244c0: 30 91 4f 04 lds r19, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.439+0x1> 244c4: 8f 3f cpi r24, 0xFF ; 255 244c6: 98 07 cpc r25, r24 244c8: 09 f0 breq .+2 ; 0x244cc <__vector_17+0x1292> 244ca: 98 c0 rjmp .+304 ; 0x245fc <__vector_17+0x13c2> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 244cc: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 244d0: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 244d4: 9e c0 rjmp .+316 ; 0x24612 <__vector_17+0x13d8> // @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; 244d6: ab ea ldi r26, 0xAB ; 171 244d8: ba ea ldi r27, 0xAA ; 170 244da: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 244de: ab 01 movw r20, r22 244e0: bc 01 movw r22, r24 244e2: 31 e1 ldi r19, 0x11 ; 17 244e4: 76 95 lsr r23 244e6: 67 95 ror r22 244e8: 57 95 ror r21 244ea: 47 95 ror r20 244ec: 3a 95 dec r19 244ee: d1 f7 brne .-12 ; 0x244e4 <__vector_17+0x12aa> 244f0: 57 cf rjmp .-338 ; 0x243a0 <__vector_17+0x1166> 244f2: 9f 01 movw r18, r30 244f4: ab ea ldi r26, 0xAB ; 171 244f6: ba ea ldi r27, 0xAA ; 170 244f8: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 244fc: 21 e1 ldi r18, 0x11 ; 17 244fe: 96 95 lsr r25 24500: 87 95 ror r24 24502: 77 95 ror r23 24504: 67 95 ror r22 24506: 2a 95 dec r18 24508: d1 f7 brne .-12 ; 0x244fe <__vector_17+0x12c4> 2450a: 54 cf rjmp .-344 ; 0x243b4 <__vector_17+0x117a> 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); 2450c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24510: 8f 7b andi r24, 0xBF ; 191 24512: ac cf rjmp .-168 ; 0x2446c <__vector_17+0x1232> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 24514: 42 17 cp r20, r18 24516: 53 07 cpc r21, r19 24518: 08 f0 brcs .+2 ; 0x2451c <__vector_17+0x12e2> 2451a: b6 cf rjmp .-148 ; 0x24488 <__vector_17+0x124e> // compression if (e_step_loops != 1) { 2451c: 90 91 48 05 lds r25, 0x0548 ; 0x800548 24520: 91 30 cpi r25, 0x01 ; 1 24522: 41 f0 breq .+16 ; 0x24534 <__vector_17+0x12fa> uint16_t d_steps = target_adv_steps - current_adv_steps; 24524: 24 1b sub r18, r20 24526: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 24528: 92 17 cp r25, r18 2452a: 13 06 cpc r1, r19 2452c: 19 f0 breq .+6 ; 0x24534 <__vector_17+0x12fa> 2452e: 10 f0 brcs .+4 ; 0x24534 <__vector_17+0x12fa> e_step_loops = d_steps; 24530: 20 93 48 05 sts 0x0548, r18 ; 0x800548 } e_steps += e_step_loops; 24534: 90 91 48 05 lds r25, 0x0548 ; 0x800548 24538: 89 0f add r24, r25 2453a: 80 93 69 05 sts 0x0569, r24 ; 0x800569 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2453e: 88 23 and r24, r24 24540: 39 f0 breq .+14 ; 0x24550 <__vector_17+0x1316> 24542: 87 ff sbrs r24, 7 24544: 0f c0 rjmp .+30 ; 0x24564 <__vector_17+0x132a> 24546: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2454a: 80 64 ori r24, 0x40 ; 64 2454c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 24550: 80 91 48 05 lds r24, 0x0548 ; 0x800548 24554: 20 91 48 04 lds r18, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> 24558: 30 91 49 04 lds r19, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 2455c: 82 0f add r24, r18 2455e: 93 2f mov r25, r19 24560: 91 1d adc r25, r1 24562: 8e cf rjmp .-228 ; 0x24480 <__vector_17+0x1246> 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); 24564: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24568: 8f 7b andi r24, 0xBF ; 191 2456a: f0 cf rjmp .-32 ; 0x2454c <__vector_17+0x1312> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2456c: 80 91 46 05 lds r24, 0x0546 ; 0x800546 24570: 90 91 47 05 lds r25, 0x0547 ; 0x800547 24574: 97 cf rjmp .-210 ; 0x244a4 <__vector_17+0x126a> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 24576: 80 91 68 05 lds r24, 0x0568 ; 0x800568 2457a: 87 fd sbrc r24, 7 2457c: 0e c0 rjmp .+28 ; 0x2459a <__vector_17+0x1360> 2457e: 08 2e mov r0, r24 24580: 00 0c add r0, r0 24582: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 24584: 21 e0 ldi r18, 0x01 ; 1 24586: 30 e0 ldi r19, 0x00 ; 0 24588: 61 15 cp r22, r1 2458a: 71 05 cpc r23, r1 2458c: 11 f0 breq .+4 ; 0x24592 <__vector_17+0x1358> 2458e: 30 e0 ldi r19, 0x00 ; 0 24590: 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)) { 24592: 82 17 cp r24, r18 24594: 93 07 cpc r25, r19 24596: 09 f0 breq .+2 ; 0x2459a <__vector_17+0x1360> 24598: 8d cf rjmp .-230 ; 0x244b4 <__vector_17+0x127a> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 2459a: 20 91 48 05 lds r18, 0x0548 ; 0x800548 2459e: 67 2b or r22, r23 245a0: 11 f0 breq .+4 ; 0x245a6 <__vector_17+0x136c> 245a2: 20 91 70 05 lds r18, 0x0570 ; 0x800570 max_ticks = min(abs(e_steps), max_ticks); 245a6: 84 2f mov r24, r20 245a8: 04 2e mov r0, r20 245aa: 00 0c add r0, r0 245ac: 99 0b sbc r25, r25 245ae: 97 ff sbrs r25, 7 245b0: 03 c0 rjmp .+6 ; 0x245b8 <__vector_17+0x137e> 245b2: 91 95 neg r25 245b4: 81 95 neg r24 245b6: 91 09 sbc r25, r1 245b8: 30 e0 ldi r19, 0x00 ; 0 245ba: 28 17 cp r18, r24 245bc: 39 07 cpc r19, r25 245be: 0c f4 brge .+2 ; 0x245c2 <__vector_17+0x1388> 245c0: c9 01 movw r24, r18 245c2: 47 ff sbrs r20, 7 245c4: 17 c0 rjmp .+46 ; 0x245f4 <__vector_17+0x13ba> 245c6: 61 e0 ldi r22, 0x01 ; 1 245c8: 4f ef ldi r20, 0xFF ; 255 245ca: 5f ef ldi r21, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 245cc: 43 9a sbi 0x08, 3 ; 8 e_steps += (rev? 1: -1); 245ce: 90 91 69 05 lds r25, 0x0569 ; 0x800569 245d2: 96 0f add r25, r22 245d4: 90 93 69 05 sts 0x0569, r25 ; 0x800569 STEP_NC_LO(E_AXIS); 245d8: 43 98 cbi 0x08, 3 ; 8 void setJamDetectionEnabled(bool state, bool updateEEPROM = false); bool getJamDetectionEnabled() const { return jamDetection; } void stStep(bool rev) { //from stepper isr stepCount += rev ? -1 : 1; 245da: 20 91 02 17 lds r18, 0x1702 ; 0x801702 245de: 30 91 03 17 lds r19, 0x1703 ; 0x801703 245e2: 24 0f add r18, r20 245e4: 35 1f adc r19, r21 245e6: 30 93 03 17 sts 0x1703, r19 ; 0x801703 245ea: 20 93 02 17 sts 0x1702, r18 ; 0x801702 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.stStep(rev); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } while(--max_ticks); 245ee: 81 50 subi r24, 0x01 ; 1 245f0: 69 f7 brne .-38 ; 0x245cc <__vector_17+0x1392> 245f2: 60 cf rjmp .-320 ; 0x244b4 <__vector_17+0x127a> 245f4: 6f ef ldi r22, 0xFF ; 255 245f6: 41 e0 ldi r20, 0x01 ; 1 245f8: 50 e0 ldi r21, 0x00 ; 0 245fa: e8 cf rjmp .-48 ; 0x245cc <__vector_17+0x1392> } // 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) 245fc: ac 01 movw r20, r24 245fe: 48 5d subi r20, 0xD8 ; 216 24600: 5f 4f sbci r21, 0xFF ; 255 24602: 42 17 cp r20, r18 24604: 53 07 cpc r21, r19 24606: 08 f0 brcs .+2 ; 0x2460a <__vector_17+0x13d0> 24608: 61 cf rjmp .-318 ; 0x244cc <__vector_17+0x1292> OCR1A = nextAdvanceISR; 2460a: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2460e: 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) { 24612: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 24616: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2461a: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2461e: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 24622: 40 96 adiw r24, 0x10 ; 16 24624: 28 17 cp r18, r24 24626: 39 07 cpc r19, r25 24628: 48 f4 brcc .+18 ; 0x2463c <__vector_17+0x1402> // 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; 2462a: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2462e: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 24632: 40 96 adiw r24, 0x10 ; 16 24634: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24638: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 2463c: ff 91 pop r31 2463e: ef 91 pop r30 24640: df 91 pop r29 24642: cf 91 pop r28 24644: bf 91 pop r27 24646: af 91 pop r26 24648: 9f 91 pop r25 2464a: 8f 91 pop r24 2464c: 7f 91 pop r23 2464e: 6f 91 pop r22 24650: 5f 91 pop r21 24652: 4f 91 pop r20 24654: 3f 91 pop r19 24656: 2f 91 pop r18 24658: 1f 91 pop r17 2465a: ff 90 pop r15 2465c: ef 90 pop r14 2465e: df 90 pop r13 24660: cf 90 pop r12 24662: 8f 90 pop r8 24664: 7f 90 pop r7 24666: 6f 90 pop r6 24668: 5f 90 pop r5 2466a: 4f 90 pop r4 2466c: 0f 90 pop r0 2466e: 0b be out 0x3b, r0 ; 59 24670: 0f 90 pop r0 24672: 0f be out 0x3f, r0 ; 63 24674: 0f 90 pop r0 24676: 1f 90 pop r1 24678: 18 95 reti 0002467a : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 2467a: 90 91 4f 05 lds r25, 0x054F ; 0x80054f check_z_endstop = check; 2467e: 80 93 4f 05 sts 0x054F, r24 ; 0x80054f CRITICAL_SECTION_START; 24682: 2f b7 in r18, 0x3f ; 63 24684: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 24686: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.443> 2468a: 8b 7f andi r24, 0xFB ; 251 2468c: 80 93 5e 04 sts 0x045E, r24 ; 0x80045e <_ZL11endstop_hit.lto_priv.443> CRITICAL_SECTION_END; 24690: 2f bf out 0x3f, r18 ; 63 return old; } 24692: 89 2f mov r24, r25 24694: 08 95 ret 00024696 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 24696: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.443> CRITICAL_SECTION_START; 2469a: 2f b7 in r18, 0x3f ; 63 2469c: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2469e: 90 91 5e 04 lds r25, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.443> 246a2: 9b 7f andi r25, 0xFB ; 251 246a4: 90 93 5e 04 sts 0x045E, r25 ; 0x80045e <_ZL11endstop_hit.lto_priv.443> CRITICAL_SECTION_END; 246a8: 2f bf out 0x3f, r18 ; 63 return hit; } 246aa: 82 fb bst r24, 2 246ac: 88 27 eor r24, r24 246ae: 80 f9 bld r24, 0 246b0: 08 95 ret 000246b2 : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 246b2: 90 91 5e 04 lds r25, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.443> endstop_hit = 0; 246b6: 10 92 5e 04 sts 0x045E, r1 ; 0x80045e <_ZL11endstop_hit.lto_priv.443> return old; 246ba: 81 e0 ldi r24, 0x01 ; 1 246bc: 91 11 cpse r25, r1 246be: 01 c0 rjmp .+2 ; 0x246c2 246c0: 80 e0 ldi r24, 0x00 ; 0 } 246c2: 08 95 ret 000246c4 : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 246c4: 90 91 47 04 lds r25, 0x0447 ; 0x800447 246c8: 91 30 cpi r25, 0x01 ; 1 246ca: 99 f0 breq .+38 ; 0x246f2 246cc: 28 f0 brcs .+10 ; 0x246d8 246ce: 92 30 cpi r25, 0x02 ; 2 246d0: a1 f0 breq .+40 ; 0x246fa 246d2: 93 30 cpi r25, 0x03 ; 3 246d4: b1 f0 breq .+44 ; 0x24702 246d6: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 246d8: 81 11 cpse r24, r1 246da: 02 c0 rjmp .+4 ; 0x246e0 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(); 246dc: 0d 94 2d 01 jmp 0x2025a ; 0x2025a switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 246e0: 82 30 cpi r24, 0x02 ; 2 246e2: 11 f4 brne .+4 ; 0x246e8 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 246e4: 0d 94 ec 05 jmp 0x20bd8 ; 0x20bd8 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) 246e8: 85 30 cpi r24, 0x05 ; 5 246ea: 81 f5 brne .+96 ; 0x2474c Sound_DoSound_Alert(false); 246ec: 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); 246ee: 0d 94 19 01 jmp 0x20232 ; 0x20232 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) 246f2: 88 23 and r24, r24 246f4: 99 f3 breq .-26 ; 0x246dc Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 246f6: 82 30 cpi r24, 0x02 ; 2 246f8: a9 f3 breq .-22 ; 0x246e4 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 246fa: 85 30 cpi r24, 0x05 ; 5 246fc: 39 f5 brne .+78 ; 0x2474c Sound_DoSound_Alert(true); 246fe: 81 e0 ldi r24, 0x01 ; 1 24700: f6 cf rjmp .-20 ; 0x246ee 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) 24702: 88 23 and r24, r24 24704: 59 f3 breq .-42 ; 0x246dc Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 24706: 82 30 cpi r24, 0x02 ; 2 24708: 69 f3 breq .-38 ; 0x246e4 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2470a: 85 30 cpi r24, 0x05 ; 5 2470c: 79 f3 breq .-34 ; 0x246ec Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 2470e: 86 30 cpi r24, 0x06 ; 6 24710: 71 f4 brne .+28 ; 0x2472e 24712: 85 e0 ldi r24, 0x05 ; 5 24714: 27 e2 ldi r18, 0x27 ; 39 24716: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 24718: 72 9a sbi 0x0e, 2 ; 14 2471a: f9 01 movw r30, r18 2471c: 31 97 sbiw r30, 0x01 ; 1 2471e: f1 f7 brne .-4 ; 0x2471c delayMicroseconds(75); WRITE(BEEPER,LOW); 24720: 72 98 cbi 0x0e, 2 ; 14 24722: f9 01 movw r30, r18 24724: 31 97 sbiw r30, 0x01 ; 1 24726: f1 f7 brne .-4 ; 0x24724 24728: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 2472a: b1 f7 brne .-20 ; 0x24718 2472c: 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) 2472e: 87 30 cpi r24, 0x07 ; 7 24730: 69 f4 brne .+26 ; 0x2474c 24732: 84 e1 ldi r24, 0x14 ; 20 24734: 23 e7 ldi r18, 0x73 ; 115 24736: 31 e0 ldi r19, 0x01 ; 1 backlight_wake(1); uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 24738: 72 9a sbi 0x0e, 2 ; 14 2473a: f9 01 movw r30, r18 2473c: 31 97 sbiw r30, 0x01 ; 1 2473e: f1 f7 brne .-4 ; 0x2473c delayMicroseconds(94); WRITE(BEEPER,LOW); 24740: 72 98 cbi 0x0e, 2 ; 14 24742: f9 01 movw r30, r18 24744: 31 97 sbiw r30, 0x01 ; 1 24746: f1 f7 brne .-4 ; 0x24744 24748: 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++) 2474a: b1 f7 brne .-20 ; 0x24738 Sound_DoSound_Blind_Alert(); break; default: break; } } 2474c: 08 95 ret 0002474e : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 2474e: 0f 93 push r16 24750: 1f 93 push r17 24752: cf 93 push r28 24754: df 93 push r29 24756: 8c 01 movw r16, r24 24758: eb 01 movw r28, r22 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2475a: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 2475e: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 24762: 0f 94 15 02 call 0x2042a ; 0x2042a 24766: 81 11 cpse r24, r1 24768: 04 c0 rjmp .+8 ; 0x24772 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2476a: d0 93 5a 12 sts 0x125A, r29 ; 0x80125a 2476e: c0 93 59 12 sts 0x1259, r28 ; 0x801259 { const FilamentAction action = eFilamentAction; 24772: c0 91 94 03 lds r28, 0x0394 ; 0x800394 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 24776: 87 ef ldi r24, 0xF7 ; 247 24778: 8c 0f add r24, r28 2477a: 82 30 cpi r24, 0x02 ; 2 2477c: f8 f4 brcc .+62 ; 0x247bc { lcd_return_to_status(); 2477e: 0f 94 6d 05 call 0x20ada ; 0x20ada if (action == FilamentAction::Lay1Cal) 24782: ca 30 cpi r28, 0x0A ; 10 24784: 41 f4 brne .+16 ; 0x24796 { lcd_commands_type = LcdCommands::Layer1Cal; 24786: 84 e0 ldi r24, 0x04 ; 4 24788: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e } menu_back(); clearFilamentAction(); } } } 2478c: df 91 pop r29 2478e: cf 91 pop r28 24790: 1f 91 pop r17 24792: 0f 91 pop r16 24794: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 24796: 60 e0 ldi r22, 0x00 ; 0 24798: 70 e0 ldi r23, 0x00 ; 0 2479a: 80 e2 ldi r24, 0x20 ; 32 2479c: 91 e4 ldi r25, 0x41 ; 65 2479e: 0e 94 c6 6c call 0xd98c ; 0xd98c if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 247a2: 8f e5 ldi r24, 0x5F ; 95 247a4: 9f e0 ldi r25, 0x0F ; 15 247a6: 0f 94 9d a3 call 0x3473a ; 0x3473a 247aa: 88 23 and r24, r24 247ac: 79 f3 breq .-34 ; 0x2478c lcd_wizard(WizState::LoadFilHot); 247ae: 88 e0 ldi r24, 0x08 ; 8 } menu_back(); clearFilamentAction(); } } } 247b0: df 91 pop r29 247b2: cf 91 pop r28 247b4: 1f 91 pop r17 247b6: 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); 247b8: 0c 94 b4 e9 jmp 0x1d368 ; 0x1d368 247bc: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 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) 247c0: 80 91 16 06 lds r24, 0x0616 ; 0x800616 247c4: 81 11 cpse r24, r1 247c6: 12 c0 rjmp .+36 ; 0x247ec 247c8: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 247cc: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 247d0: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 247d4: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 247d8: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 247dc: 60 1b sub r22, r16 247de: 71 0b sbc r23, r17 247e0: 6c 5f subi r22, 0xFC ; 252 247e2: 7f 4f sbci r23, 0xFF ; 255 247e4: 69 30 cpi r22, 0x09 ; 9 247e6: 71 05 cpc r23, r1 247e8: 08 f0 brcs .+2 ; 0x247ec 247ea: 60 c0 rjmp .+192 ; 0x248ac { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 247ec: c1 50 subi r28, 0x01 ; 1 247ee: c8 30 cpi r28, 0x08 ; 8 247f0: 88 f5 brcc .+98 ; 0x24854 247f2: ec 2f mov r30, r28 247f4: f0 e0 ldi r31, 0x00 ; 0 247f6: 88 27 eor r24, r24 247f8: ef 5f subi r30, 0xFF ; 255 247fa: fb 4d sbci r31, 0xDB ; 219 247fc: 8e 4f sbci r24, 0xFE ; 254 247fe: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 24802: 6c 38 cpi r22, 0x8C ; 140 24804: 6c 38 cpi r22, 0x8C ; 140 24806: 6c 38 cpi r22, 0x8C ; 140 24808: 90 37 cpi r25, 0x70 ; 112 2480a: de 37 cpi r29, 0x7E ; 126 2480c: 2a 38 cpi r18, 0x8A ; 138 2480e: cc 36 cpi r28, 0x6C ; 108 24810: dc 36 cpi r29, 0x6C ; 108 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 24812: c8 e5 ldi r28, 0x58 ; 88 24814: de ec ldi r29, 0xCE ; 206 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 24816: 80 91 14 06 lds r24, 0x0614 ; 0x800614 2481a: 88 23 and r24, r24 2481c: 29 f0 breq .+10 ; 0x24828 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2481e: 82 e0 ldi r24, 0x02 ; 2 24820: 0f 94 62 23 call 0x246c4 ; 0x246c4 bFilamentWaitingFlag = false; 24824: 10 92 14 06 sts 0x0614, r1 ; 0x800614 } if (filamentActionMenu) { 24828: 20 97 sbiw r28, 0x00 ; 0 2482a: 09 f4 brne .+2 ; 0x2482e 2482c: af cf rjmp .-162 ; 0x2478c // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2482e: 0f 94 a9 02 call 0x20552 ; 0x20552 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 24832: 61 e0 ldi r22, 0x01 ; 1 24834: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 24836: df 91 pop r29 24838: cf 91 pop r28 2483a: 1f 91 pop r17 2483c: 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); 2483e: 0c 94 ad 62 jmp 0xc55a ; 0xc55a switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 24842: 80 91 14 06 lds r24, 0x0614 ; 0x800614 24846: 88 23 and r24, r24 24848: 41 f0 breq .+16 ; 0x2485a 2484a: 61 e0 ldi r22, 0x01 ; 1 2484c: 80 e2 ldi r24, 0x20 ; 32 2484e: 97 e3 ldi r25, 0x37 ; 55 24850: 0e 94 ad 62 call 0xc55a ; 0xc55a // 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; 24854: d0 e0 ldi r29, 0x00 ; 0 24856: c0 e0 ldi r28, 0x00 ; 0 24858: de cf rjmp .-68 ; 0x24816 case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2485a: 0f 94 a9 02 call 0x20552 ; 0x20552 if (eFilamentAction == FilamentAction::AutoLoad) { 2485e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 24862: 82 30 cpi r24, 0x02 ; 2 24864: 19 f4 brne .+6 ; 0x2486c // loading no longer cancellable eFilamentAction = FilamentAction::Load; 24866: 81 e0 ldi r24, 0x01 ; 1 24868: 80 93 94 03 sts 0x0394, r24 ; 0x800394 } if (eFilamentAction == FilamentAction::Load) 2486c: 80 91 94 03 lds r24, 0x0394 ; 0x800394 24870: 81 30 cpi r24, 0x01 ; 1 24872: 31 f4 brne .+12 ; 0x24880 enquecommand_P(MSG_M701); // load filament 24874: 61 e0 ldi r22, 0x01 ; 1 24876: 88 e1 ldi r24, 0x18 ; 24 24878: 9b e6 ldi r25, 0x6B ; 107 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2487a: 0e 94 da 8c call 0x119b4 ; 0x119b4 2487e: ea cf rjmp .-44 ; 0x24854 eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 24880: 83 30 cpi r24, 0x03 ; 3 24882: 41 f7 brne .-48 ; 0x24854 enquecommand_P(MSG_M702); // unload filament 24884: 61 e0 ldi r22, 0x01 ; 1 24886: 88 ec ldi r24, 0xC8 ; 200 24888: 98 e6 ldi r25, 0x68 ; 104 2488a: f7 cf rjmp .-18 ; 0x2487a break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2488c: c2 ed ldi r28, 0xD2 ; 210 2488e: dd ec ldi r29, 0xCD ; 205 24890: c2 cf rjmp .-124 ; 0x24816 break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 24892: 0f 94 a9 02 call 0x20552 ; 0x20552 MMU2::mmu2.unload(); 24896: 0f 94 2e 9d call 0x33a5c ; 0x33a5c // 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(); 2489a: 0f 94 62 09 call 0x212c4 ; 0x212c4 2489e: da cf rjmp .-76 ; 0x24854 break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 248a0: c0 e5 ldi r28, 0x50 ; 80 248a2: de ec ldi r29, 0xCE ; 206 248a4: b8 cf rjmp .-144 ; 0x24816 break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 248a6: c8 e4 ldi r28, 0x48 ; 72 248a8: de ec ldi r29, 0xCE ; 206 248aa: b5 cf rjmp .-150 ; 0x24816 menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 248ac: 80 91 14 06 lds r24, 0x0614 ; 0x800614 248b0: 88 23 and r24, r24 248b2: 21 f0 breq .+8 ; 0x248bc 248b4: 80 91 59 02 lds r24, 0x0259 ; 0x800259 248b8: 88 23 and r24, r24 248ba: a1 f1 breq .+104 ; 0x24924 // 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; 248bc: 81 e0 ldi r24, 0x01 ; 1 248be: 80 93 14 06 sts 0x0614, r24 ; 0x800614 // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 248c2: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_clear(); 248c6: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0,3, PSTR(">")); 248ca: 4e eb ldi r20, 0xBE ; 190 248cc: 58 e9 ldi r21, 0x98 ; 152 248ce: 63 e0 ldi r22, 0x03 ; 3 248d0: 80 e0 ldi r24, 0x00 ; 0 248d2: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_puts_at_P(1, 3, _T(MSG_CANCEL)); 248d6: 86 ed ldi r24, 0xD6 ; 214 248d8: 9c e3 ldi r25, 0x3C ; 60 248da: 0e 94 0a 75 call 0xea14 ; 0xea14 248de: ac 01 movw r20, r24 248e0: 63 e0 ldi r22, 0x03 ; 3 248e2: 81 e0 ldi r24, 0x01 ; 1 248e4: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_set_cursor(0, 1); 248e8: 61 e0 ldi r22, 0x01 ; 1 248ea: 80 e0 ldi r24, 0x00 ; 0 248ec: 0e 94 2a 6f call 0xde54 ; 0xde54 switch (eFilamentAction) 248f0: e0 91 94 03 lds r30, 0x0394 ; 0x800394 248f4: e1 50 subi r30, 0x01 ; 1 248f6: e8 30 cpi r30, 0x08 ; 8 248f8: a8 f4 brcc .+42 ; 0x24924 248fa: f0 e0 ldi r31, 0x00 ; 0 248fc: 88 27 eor r24, r24 248fe: ec 57 subi r30, 0x7C ; 124 24900: fb 4d sbci r31, 0xDB ; 219 24902: 8e 4f sbci r24, 0xFE ; 254 24904: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 24908: 14 38 cpi r17, 0x84 ; 132 2490a: 14 38 cpi r17, 0x84 ; 132 2490c: ee 37 cpi r30, 0x7E ; 126 2490e: 14 38 cpi r17, 0x84 ; 132 24910: ee 37 cpi r30, 0x7E ; 126 24912: f2 36 cpi r31, 0x62 ; 98 24914: 82 38 cpi r24, 0x82 ; 130 24916: 14 38 cpi r17, 0x84 ; 132 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 24918: 8b ef ldi r24, 0xFB ; 251 2491a: 97 e5 ldi r25, 0x57 ; 87 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2491c: 0e 94 0a 75 call 0xea14 ; 0xea14 24920: 0e 94 ed 6e call 0xddda ; 0xddda // handled earlier break; } } if (bFilamentWaitingFlag) { 24924: 80 91 14 06 lds r24, 0x0614 ; 0x800614 24928: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2492a: 0f 94 45 0a call 0x2148a ; 0x2148a } if (lcd_clicked()) 2492e: 0e 94 45 73 call 0xe68a ; 0xe68a 24932: 88 23 and r24, r24 24934: 09 f4 brne .+2 ; 0x24938 24936: 2a cf rjmp .-428 ; 0x2478c { // Filament action canceled while preheating bFilamentWaitingFlag = false; 24938: 10 92 14 06 sts 0x0614, r1 ; 0x800614 if (!bFilamentPreheatState) 2493c: 80 91 15 06 lds r24, 0x0615 ; 0x800615 24940: 81 11 cpse r24, r1 24942: 0e c0 rjmp .+28 ; 0x24960 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 24944: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 24948: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2494c: 0e 94 05 66 call 0xcc0a ; 0xcc0a 24950: 81 11 cpse r24, r1 24952: 04 c0 rjmp .+8 ; 0x2495c resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 24954: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 24958: 10 92 59 12 sts 0x1259, r1 ; 0x801259 menu_back(); 2495c: 0e 94 eb 62 call 0xc5d6 ; 0xc5d6 } menu_back(); 24960: 0e 94 eb 62 call 0xc5d6 ; 0xc5d6 clearFilamentAction(); } } } 24964: df 91 pop r29 24966: cf 91 pop r28 24968: 1f 91 pop r17 2496a: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2496c: 0d 94 62 09 jmp 0x212c4 ; 0x212c4 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)); 24970: 84 ee ldi r24, 0xE4 ; 228 24972: 97 e5 ldi r25, 0x57 ; 87 24974: d3 cf rjmp .-90 ; 0x2491c break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 24976: 8e ec ldi r24, 0xCE ; 206 24978: 97 e5 ldi r25, 0x57 ; 87 2497a: d0 cf rjmp .-96 ; 0x2491c break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2497c: 8a eb ldi r24, 0xBA ; 186 2497e: 97 e5 ldi r25, 0x57 ; 87 24980: cd cf rjmp .-102 ; 0x2491c 00024982 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 24982: 80 93 94 03 sts 0x0394, r24 ; 0x800394 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) ); 24986: 40 91 01 13 lds r20, 0x1301 ; 0x801301 2498a: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 2498e: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 24992: 41 30 cpi r20, 0x01 ; 1 24994: 59 f0 breq .+22 ; 0x249ac 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() 24996: 10 92 16 06 sts 0x0616, r1 ; 0x800616 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2499a: 80 91 57 02 lds r24, 0x0257 ; 0x800257 2499e: 90 91 58 02 lds r25, 0x0258 ; 0x800258 249a2: 28 17 cp r18, r24 249a4: 39 07 cpc r19, r25 249a6: 5c f4 brge .+22 ; 0x249be bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 249a8: 0d 94 65 09 jmp 0x212ca ; 0x212ca 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() 249ac: 90 91 d7 12 lds r25, 0x12D7 ; 0x8012d7 249b0: 91 11 cpse r25, r1 249b2: f1 cf rjmp .-30 ; 0x24996 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 249b4: 86 50 subi r24, 0x06 ; 6 249b6: 82 30 cpi r24, 0x02 ; 2 249b8: 70 f7 brcc .-36 ; 0x24996 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() 249ba: 40 93 16 06 sts 0x0616, r20 ; 0x800616 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 249be: 81 e0 ldi r24, 0x01 ; 1 249c0: 80 93 15 06 sts 0x0615, r24 ; 0x800615 mFilamentItem(target_temperature[0], target_temperature_bed); 249c4: 60 91 59 12 lds r22, 0x1259 ; 0x801259 249c8: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 249cc: c9 01 movw r24, r18 249ce: 0f 94 a7 23 call 0x2474e ; 0x2474e bFilamentSkipPreheat = false; // Reset flag 249d2: 10 92 16 06 sts 0x0616, r1 ; 0x800616 } else { lcd_generic_preheat_menu(); } } 249d6: 08 95 ret 000249d8 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 249d8: 82 e0 ldi r24, 0x02 ; 2 249da: 0d 94 c1 24 jmp 0x24982 ; 0x24982 000249de : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 249de: 81 e0 ldi r24, 0x01 ; 1 249e0: 0d 94 c1 24 jmp 0x24982 ; 0x24982 000249e4 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 249e4: 83 e0 ldi r24, 0x03 ; 3 249e6: 0d 94 c1 24 jmp 0x24982 ; 0x24982 000249ea : } } static void mFilamentItem_farm() { bFilamentPreheatState = false; 249ea: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP); 249ee: 60 e5 ldi r22, 0x50 ; 80 249f0: 70 e0 ldi r23, 0x00 ; 0 249f2: 8a ef ldi r24, 0xFA ; 250 249f4: 90 e0 ldi r25, 0x00 ; 0 249f6: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 000249fa : } static void mFilamentItem_farm_nozzle() { bFilamentPreheatState = false; 249fa: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); 249fe: 70 e0 ldi r23, 0x00 ; 0 24a00: 60 e0 ldi r22, 0x00 ; 0 24a02: 8a ef ldi r24, 0xFA ; 250 24a04: 90 e0 ldi r25, 0x00 ; 0 24a06: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a0a : } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 24a0a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 24a0e: 6c e3 ldi r22, 0x3C ; 60 24a10: 70 e0 ldi r23, 0x00 ; 0 24a12: 87 ed ldi r24, 0xD7 ; 215 24a14: 90 e0 ldi r25, 0x00 ; 0 24a16: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a1a : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 24a1a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 24a1e: 65 e5 ldi r22, 0x55 ; 85 24a20: 70 e0 ldi r23, 0x00 ; 0 24a22: 86 ee ldi r24, 0xE6 ; 230 24a24: 90 e0 ldi r25, 0x00 ; 0 24a26: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a2a : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 24a2a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 24a2e: 69 e6 ldi r22, 0x69 ; 105 24a30: 70 e0 ldi r23, 0x00 ; 0 24a32: 84 e0 ldi r24, 0x04 ; 4 24a34: 91 e0 ldi r25, 0x01 ; 1 24a36: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a3a : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 24a3a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 24a3e: 69 e6 ldi r22, 0x69 ; 105 24a40: 70 e0 ldi r23, 0x00 ; 0 24a42: 83 e1 ldi r24, 0x13 ; 19 24a44: 91 e0 ldi r25, 0x01 ; 1 24a46: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a4a : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 24a4a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 24a4e: 6b e4 ldi r22, 0x4B ; 75 24a50: 70 e0 ldi r23, 0x00 ; 0 24a52: 87 ed ldi r24, 0xD7 ; 215 24a54: 90 e0 ldi r25, 0x00 ; 0 24a56: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a5a : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 24a5a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 24a5e: 6a e5 ldi r22, 0x5A ; 90 24a60: 70 e0 ldi r23, 0x00 ; 0 24a62: 83 e1 ldi r24, 0x13 ; 19 24a64: 91 e0 ldi r25, 0x01 ; 1 24a66: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a6a : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 24a6a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 24a6e: 64 e6 ldi r22, 0x64 ; 100 24a70: 70 e0 ldi r23, 0x00 ; 0 24a72: 8f ef ldi r24, 0xFF ; 255 24a74: 90 e0 ldi r25, 0x00 ; 0 24a76: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a7a : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 24a7a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 24a7e: 64 e6 ldi r22, 0x64 ; 100 24a80: 70 e0 ldi r23, 0x00 ; 0 24a82: 8c ed ldi r24, 0xDC ; 220 24a84: 90 e0 ldi r25, 0x00 ; 0 24a86: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a8a : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 24a8a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 24a8e: 64 e6 ldi r22, 0x64 ; 100 24a90: 70 e0 ldi r23, 0x00 ; 0 24a92: 8e ef ldi r24, 0xFE ; 254 24a94: 90 e0 ldi r25, 0x00 ; 0 24a96: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024a9a : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 24a9a: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 24a9e: 62 e3 ldi r22, 0x32 ; 50 24aa0: 70 e0 ldi r23, 0x00 ; 0 24aa2: 80 ef ldi r24, 0xF0 ; 240 24aa4: 90 e0 ldi r25, 0x00 ; 0 24aa6: 0d 94 a7 23 jmp 0x2474e ; 0x2474e 00024aaa : } 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){ 24aaa: cf 92 push r12 24aac: df 92 push r13 24aae: ef 92 push r14 24ab0: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 24ab2: 41 11 cpse r20, r1 24ab4: 04 c0 rjmp .+8 ; 0x24abe 24ab6: 20 91 47 04 lds r18, 0x0447 ; 0x800447 24aba: 22 30 cpi r18, 0x02 ; 2 24abc: 61 f0 breq .+24 ; 0x24ad6 24abe: 9b 01 movw r18, r22 24ac0: 6c 01 movw r12, r24 24ac2: f1 2c mov r15, r1 24ac4: e1 2c mov r14, r1 if(!tone_) { 24ac6: 67 2b or r22, r23 24ac8: 59 f4 brne .+22 ; 0x24ae0 WRITE(BEEPER, HIGH); 24aca: 72 9a sbi 0x0e, 2 ; 14 _delay(ms); 24acc: c7 01 movw r24, r14 24ace: b6 01 movw r22, r12 24ad0: 0f 94 23 0b call 0x21646 ; 0x21646 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); 24ad4: 72 98 cbi 0x0e, 2 ; 14 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 24ad6: ff 90 pop r15 24ad8: ef 90 pop r14 24ada: df 90 pop r13 24adc: cf 90 pop r12 24ade: 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); 24ae0: 22 0f add r18, r18 24ae2: 33 1f adc r19, r19 24ae4: 50 e0 ldi r21, 0x00 ; 0 24ae6: 40 e0 ldi r20, 0x00 ; 0 24ae8: 60 e0 ldi r22, 0x00 ; 0 24aea: 74 e2 ldi r23, 0x24 ; 36 24aec: 84 ef ldi r24, 0xF4 ; 244 24aee: 90 e0 ldi r25, 0x00 ; 0 24af0: 0f 94 8e a4 call 0x3491c ; 0x3491c <__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; 24af4: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 24af6: 21 15 cp r18, r1 24af8: 31 05 cpc r19, r1 24afa: 81 e0 ldi r24, 0x01 ; 1 24afc: 48 07 cpc r20, r24 24afe: 51 05 cpc r21, r1 24b00: 44 f0 brlt .+16 ; 0x24b12 pwm_freq /= 64; // Increase prescaler to 64 24b02: 86 e0 ldi r24, 0x06 ; 6 24b04: 56 95 lsr r21 24b06: 47 95 ror r20 24b08: 37 95 ror r19 24b0a: 27 95 ror r18 24b0c: 8a 95 dec r24 24b0e: d1 f7 brne .-12 ; 0x24b04 prescalarbits = 0b011; 24b10: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 24b12: 21 50 subi r18, 0x01 ; 1 24b14: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 24b16: 4f b7 in r20, 0x3f ; 63 24b18: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 24b1a: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 24b1e: 88 7f andi r24, 0xF8 ; 248 24b20: 89 2b or r24, r25 24b22: 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); 24b26: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 24b2a: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24b2e: 26 9f mul r18, r22 24b30: c0 01 movw r24, r0 24b32: 27 9f mul r18, r23 24b34: 90 0d add r25, r0 24b36: 36 9f mul r19, r22 24b38: 90 0d add r25, r0 24b3a: 11 24 eor r1, r1 24b3c: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24b40: 6f ef ldi r22, 0xFF ; 255 24b42: 70 e0 ldi r23, 0x00 ; 0 24b44: 51 ff sbrs r21, 1 24b46: 04 c0 rjmp .+8 ; 0x24b50 24b48: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 24b4c: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24b50: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 24b54: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24b58: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 24b5c: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24b60: 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); 24b64: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24b68: 83 60 ori r24, 0x03 ; 3 24b6a: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 24b6e: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 24b70: c7 01 movw r24, r14 24b72: b6 01 movw r22, r12 24b74: 0f 94 23 0b call 0x21646 ; 0x21646 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 24b78: 2f b7 in r18, 0x3f ; 63 24b7a: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 24b7c: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 24b80: 88 7f andi r24, 0xF8 ; 248 24b82: 85 60 ori r24, 0x05 ; 5 24b84: 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); 24b88: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 24b8c: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24b90: 3f ef ldi r19, 0xFF ; 255 24b92: 34 9f mul r19, r20 24b94: c0 01 movw r24, r0 24b96: 35 9f mul r19, r21 24b98: 90 0d add r25, r0 24b9a: 11 24 eor r1, r1 24b9c: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24ba0: 6f ef ldi r22, 0xFF ; 255 24ba2: 70 e0 ldi r23, 0x00 ; 0 24ba4: 31 ff sbrs r19, 1 24ba6: 04 c0 rjmp .+8 ; 0x24bb0 24ba8: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 24bac: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24bb0: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 24bb4: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24bb8: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 24bbc: 8f ef ldi r24, 0xFF ; 255 24bbe: 90 e0 ldi r25, 0x00 ; 0 24bc0: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24bc4: 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)); 24bc8: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24bcc: 8c 7f andi r24, 0xFC ; 252 24bce: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 24bd2: 2f bf out 0x3f, r18 ; 63 24bd4: 7f cf rjmp .-258 ; 0x24ad4 00024bd6 : /// 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() { 24bd6: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 24bd8: c0 91 47 04 lds r28, 0x0447 ; 0x800447 24bdc: c2 30 cpi r28, 0x02 ; 2 24bde: 59 f1 breq .+86 ; 0x24c36 // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 24be0: c1 30 cpi r28, 0x01 ; 1 24be2: 69 f4 brne .+26 ; 0x24bfe if (bFirst) return; 24be4: 80 91 c1 04 lds r24, 0x04C1 ; 0x8004c1 <_ZL6bFirst.lto_priv.500> 24be8: 81 11 cpse r24, r1 24bea: 25 c0 rjmp .+74 ; 0x24c36 Sound_MakeCustom(80, 0, false); 24bec: 40 e0 ldi r20, 0x00 ; 0 24bee: 70 e0 ldi r23, 0x00 ; 0 24bf0: 60 e0 ldi r22, 0x00 ; 0 24bf2: 80 e5 ldi r24, 0x50 ; 80 24bf4: 90 e0 ldi r25, 0x00 ; 0 24bf6: 0f 94 55 25 call 0x24aaa ; 0x24aaa bFirst = true; 24bfa: c0 93 c1 04 sts 0x04C1, r28 ; 0x8004c1 <_ZL6bFirst.lto_priv.500> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 24bfe: 60 ed ldi r22, 0xD0 ; 208 24c00: 77 e0 ldi r23, 0x07 ; 7 24c02: 8e eb ldi r24, 0xBE ; 190 24c04: 94 e0 ldi r25, 0x04 ; 4 24c06: 0f 94 ad 0b call 0x2175a ; 0x2175a ::expired_cont(unsigned short)> 24c0a: 88 23 and r24, r24 24c0c: a1 f0 breq .+40 ; 0x24c36 beep_timer.start(); 24c0e: 8e eb ldi r24, 0xBE ; 190 24c10: 94 e0 ldi r25, 0x04 ; 4 24c12: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 24c16: 80 91 47 04 lds r24, 0x0447 ; 0x800447 24c1a: 81 11 cpse r24, r1 24c1c: 08 c0 rjmp .+16 ; 0x24c2e Sound_MakeCustom(80, 0, false); 24c1e: 40 e0 ldi r20, 0x00 ; 0 24c20: 70 e0 ldi r23, 0x00 ; 0 24c22: 60 e0 ldi r22, 0x00 ; 0 24c24: 80 e5 ldi r24, 0x50 ; 80 24c26: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 24c28: 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); 24c2a: 0d 94 55 25 jmp 0x24aaa ; 0x24aaa } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 24c2e: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 24c30: 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); 24c32: 0d 94 62 23 jmp 0x246c4 ; 0x246c4 } } #endif // BEEPER > 0 } 24c36: cf 91 pop r28 24c38: 08 95 ret 00024c3a : { #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 #else uint8_t portC = PORTC & 0xf0; 24c3a: 98 b1 in r25, 0x08 ; 8 24c3c: 90 7f andi r25, 0xF0 ; 240 PORTC = portC | (axes_mask & 0x0f); //set step signals by mask 24c3e: 89 2b or r24, r25 24c40: 88 b9 out 0x08, r24 ; 8 asm("nop"); 24c42: 00 00 nop PORTC = portC; //set step signals to zero 24c44: 98 b9 out 0x08, r25 ; 8 asm("nop"); 24c46: 00 00 nop #endif #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } 24c48: 08 95 ret 00024c4a : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 24c4a: 82 30 cpi r24, 0x02 ; 2 24c4c: b9 f0 breq .+46 ; 0x24c7c 24c4e: 83 30 cpi r24, 0x03 ; 3 24c50: e9 f0 breq .+58 ; 0x24c8c 24c52: 81 30 cpi r24, 0x01 ; 1 24c54: 59 f0 breq .+22 ; 0x24c6c { #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3)) case 0: if (dir == INVERT_X_DIR) PORTL |= 2; else PORTL &= ~2; break; 24c56: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24c5a: 61 11 cpse r22, r1 24c5c: 05 c0 rjmp .+10 ; 0x24c68 24c5e: 82 60 ori r24, 0x02 ; 2 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; 24c60: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 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; #endif } asm("nop"); 24c64: 00 00 nop } 24c66: 08 95 ret void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3)) case 0: if (dir == INVERT_X_DIR) PORTL |= 2; else PORTL &= ~2; break; 24c68: 8d 7f andi r24, 0xFD ; 253 24c6a: fa cf rjmp .-12 ; 0x24c60 case 1: if (dir == INVERT_Y_DIR) PORTL |= 1; else PORTL &= ~1; break; 24c6c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24c70: 61 11 cpse r22, r1 24c72: 02 c0 rjmp .+4 ; 0x24c78 24c74: 81 60 ori r24, 0x01 ; 1 24c76: f4 cf rjmp .-24 ; 0x24c60 24c78: 8e 7f andi r24, 0xFE ; 254 24c7a: f2 cf rjmp .-28 ; 0x24c60 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 24c7c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24c80: 61 11 cpse r22, r1 24c82: 02 c0 rjmp .+4 ; 0x24c88 24c84: 84 60 ori r24, 0x04 ; 4 24c86: ec cf rjmp .-40 ; 0x24c60 24c88: 8b 7f andi r24, 0xFB ; 251 24c8a: ea cf rjmp .-44 ; 0x24c60 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 24c8c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24c90: 61 30 cpi r22, 0x01 ; 1 24c92: 11 f4 brne .+4 ; 0x24c98 24c94: 80 64 ori r24, 0x40 ; 64 24c96: e4 cf rjmp .-56 ; 0x24c60 24c98: 8f 7b andi r24, 0xBF ; 191 24c9a: e2 cf rjmp .-60 ; 0x24c60 00024c9c : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 24c9c: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24c9e: 0d b4 in r0, 0x2d ; 45 24ca0: 07 fe sbrs r0, 7 24ca2: fd cf rjmp .-6 ; 0x24c9e } 24ca4: 08 95 ret 00024ca6 : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 24ca6: 8f ef ldi r24, 0xFF ; 255 24ca8: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24caa: 0d b4 in r0, 0x2d ; 45 24cac: 07 fe sbrs r0, 7 24cae: fd cf rjmp .-6 ; 0x24caa return SPDR; 24cb0: 8e b5 in r24, 0x2e ; 46 } 24cb2: 08 95 ret 00024cb4 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 24cb4: 8f 92 push r8 24cb6: 9f 92 push r9 24cb8: af 92 push r10 24cba: bf 92 push r11 24cbc: ef 92 push r14 24cbe: ff 92 push r15 24cc0: 0f 93 push r16 24cc2: 1f 93 push r17 24cc4: cf 93 push r28 24cc6: 7c 01 movw r14, r24 24cc8: c6 2f mov r28, r22 24cca: 49 01 movw r8, r18 24ccc: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 24cce: fc 01 movw r30, r24 24cd0: 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); 24cd2: 89 2f mov r24, r25 24cd4: 80 6a ori r24, 0xA0 ; 160 24cd6: 86 95 lsr r24 24cd8: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 24cda: 90 fd sbrc r25, 0 24cdc: 03 c0 rjmp .+6 ; 0x24ce4 24cde: 81 e0 ldi r24, 0x01 ; 1 24ce0: 96 30 cpi r25, 0x06 ; 6 24ce2: 09 f4 brne .+2 ; 0x24ce6 24ce4: 80 e0 ldi r24, 0x00 ; 0 24ce6: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 24ce8: 28 98 cbi 0x05, 0 ; 5 uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { // select card chipSelectLow(); // wait up to 300 ms if busy waitNotBusy(300); 24cea: 8c e2 ldi r24, 0x2C ; 44 24cec: 91 e0 ldi r25, 0x01 ; 1 24cee: 0f 94 b6 65 call 0x2cb6c ; 0x2cb6c // send command spiSend(cmd | 0x40); 24cf2: 8c 2f mov r24, r28 24cf4: 80 64 ori r24, 0x40 ; 64 24cf6: 0f 94 4e 26 call 0x24c9c ; 0x24c9c 24cfa: 08 e1 ldi r16, 0x18 ; 24 24cfc: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 24cfe: d5 01 movw r26, r10 24d00: c4 01 movw r24, r8 24d02: 00 2e mov r0, r16 24d04: 04 c0 rjmp .+8 ; 0x24d0e 24d06: b6 95 lsr r27 24d08: a7 95 ror r26 24d0a: 97 95 ror r25 24d0c: 87 95 ror r24 24d0e: 0a 94 dec r0 24d10: d2 f7 brpl .-12 ; 0x24d06 24d12: 0f 94 4e 26 call 0x24c9c ; 0x24c9c 24d16: 08 50 subi r16, 0x08 ; 8 24d18: 11 09 sbc r17, r1 24d1a: 08 3f cpi r16, 0xF8 ; 248 24d1c: ff ef ldi r31, 0xFF ; 255 24d1e: 1f 07 cpc r17, r31 24d20: 71 f7 brne .-36 ; 0x24cfe // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 24d22: 85 e9 ldi r24, 0x95 ; 149 24d24: cc 23 and r28, r28 24d26: 21 f0 breq .+8 ; 0x24d30 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 24d28: 87 e8 ldi r24, 0x87 ; 135 24d2a: c8 30 cpi r28, 0x08 ; 8 24d2c: 09 f0 breq .+2 ; 0x24d30 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 24d2e: 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); 24d30: 0f 94 4e 26 call 0x24c9c ; 0x24c9c // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 24d34: cc 30 cpi r28, 0x0C ; 12 24d36: 11 f4 brne .+4 ; 0x24d3c 24d38: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 24d3c: 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 */ } 24d3e: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 24d42: f7 01 movw r30, r14 24d44: 82 83 std Z+2, r24 ; 0x02 24d46: 87 ff sbrs r24, 7 24d48: 04 c0 rjmp .+8 ; 0x24d52 24d4a: cf 3f cpi r28, 0xFF ; 255 24d4c: 11 f0 breq .+4 ; 0x24d52 24d4e: cf 5f subi r28, 0xFF ; 255 24d50: f6 cf rjmp .-20 ; 0x24d3e return status_; } 24d52: cf 91 pop r28 24d54: 1f 91 pop r17 24d56: 0f 91 pop r16 24d58: ff 90 pop r15 24d5a: ef 90 pop r14 24d5c: bf 90 pop r11 24d5e: af 90 pop r10 24d60: 9f 90 pop r9 24d62: 8f 90 pop r8 24d64: 08 95 ret 00024d66 : * \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) { 24d66: 0f 93 push r16 24d68: 1f 93 push r17 24d6a: cf 93 push r28 24d6c: df 93 push r29 24d6e: ec 01 movw r28, r24 24d70: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 24d72: 8b 81 ldd r24, Y+3 ; 0x03 24d74: 83 30 cpi r24, 0x03 ; 3 24d76: 39 f0 breq .+14 ; 0x24d86 24d78: 89 e0 ldi r24, 0x09 ; 9 24d7a: 44 0f add r20, r20 24d7c: 55 1f adc r21, r21 24d7e: 66 1f adc r22, r22 24d80: 77 1f adc r23, r23 24d82: 8a 95 dec r24 24d84: d1 f7 brne .-12 ; 0x24d7a if (cardCommand(CMD24, blockNumber)) { 24d86: 9a 01 movw r18, r20 24d88: ab 01 movw r20, r22 24d8a: 68 e1 ldi r22, 0x18 ; 24 24d8c: ce 01 movw r24, r28 24d8e: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 24d92: 88 23 and r24, r24 24d94: 19 f0 breq .+6 ; 0x24d9c bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 24d96: 86 e0 ldi r24, 0x06 ; 6 24d98: 88 83 st Y, r24 24d9a: 39 c0 rjmp .+114 ; 0x24e0e } //------------------------------------------------------------------------------ /** 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; 24d9c: 8e ef ldi r24, 0xFE ; 254 24d9e: 8e bd out 0x2e, r24 ; 46 24da0: f8 01 movw r30, r16 24da2: c8 01 movw r24, r16 24da4: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24da6: 0d b4 in r0, 0x2d ; 45 24da8: 07 fe sbrs r0, 7 24daa: fd cf rjmp .-6 ; 0x24da6 SPDR = buf[i]; 24dac: 20 81 ld r18, Z 24dae: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24db0: 0d b4 in r0, 0x2d ; 45 24db2: 07 fe sbrs r0, 7 24db4: fd cf rjmp .-6 ; 0x24db0 SPDR = buf[i + 1]; 24db6: 21 81 ldd r18, Z+1 ; 0x01 24db8: 2e bd out 0x2e, r18 ; 46 24dba: 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) { 24dbc: e8 17 cp r30, r24 24dbe: f9 07 cpc r31, r25 24dc0: 91 f7 brne .-28 ; 0x24da6 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 */ } 24dc2: 0d b4 in r0, 0x2d ; 45 24dc4: 07 fe sbrs r0, 7 24dc6: fd cf rjmp .-6 ; 0x24dc2 //------------------------------------------------------------------------------ // 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 24dc8: 8f ef ldi r24, 0xFF ; 255 24dca: 0f 94 4e 26 call 0x24c9c ; 0x24c9c spiSend(0xff); // dummy crc 24dce: 8f ef ldi r24, 0xFF ; 255 24dd0: 0f 94 4e 26 call 0x24c9c ; 0x24c9c status_ = spiRec(); 24dd4: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 24dd8: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 24dda: 8f 71 andi r24, 0x1F ; 31 24ddc: 85 30 cpi r24, 0x05 ; 5 24dde: 99 f4 brne .+38 ; 0x24e06 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 24de0: 88 e5 ldi r24, 0x58 ; 88 24de2: 92 e0 ldi r25, 0x02 ; 2 24de4: 0f 94 b6 65 call 0x2cb6c ; 0x2cb6c 24de8: 18 2f mov r17, r24 24dea: 87 e1 ldi r24, 0x17 ; 23 24dec: 11 23 and r17, r17 24dee: a1 f2 breq .-88 ; 0x24d98 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 24df0: 20 e0 ldi r18, 0x00 ; 0 24df2: 30 e0 ldi r19, 0x00 ; 0 24df4: a9 01 movw r20, r18 24df6: 6d e0 ldi r22, 0x0D ; 13 24df8: ce 01 movw r24, r28 24dfa: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 24dfe: 88 23 and r24, r24 24e00: 51 f0 breq .+20 ; 0x24e16 24e02: 86 e1 ldi r24, 0x16 ; 22 24e04: c9 cf rjmp .-110 ; 0x24d98 24e06: 83 e1 ldi r24, 0x13 ; 19 24e08: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 24e0a: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 } chipSelectHigh(); return true; fail: chipSelectHigh(); 24e0e: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 return false; 24e12: 10 e0 ldi r17, 0x00 ; 0 24e14: 06 c0 rjmp .+12 ; 0x24e22 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()) { 24e16: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 24e1a: 81 11 cpse r24, r1 24e1c: f2 cf rjmp .-28 ; 0x24e02 error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 24e1e: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 return true; fail: chipSelectHigh(); return false; } 24e22: 81 2f mov r24, r17 24e24: df 91 pop r29 24e26: cf 91 pop r28 24e28: 1f 91 pop r17 24e2a: 0f 91 pop r16 24e2c: 08 95 ret 00024e2e : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 24e2e: cf 93 push r28 if (cacheDirty_) { 24e30: 80 91 42 0e lds r24, 0x0E42 ; 0x800e42 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 24e34: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 24e36: 88 23 and r24, r24 24e38: a1 f0 breq .+40 ; 0x24e62 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 24e3a: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 24e3e: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 24e42: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 24e46: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 24e4a: 26 e4 ldi r18, 0x46 ; 70 24e4c: 3e e0 ldi r19, 0x0E ; 14 24e4e: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 24e52: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 24e56: 0f 94 b3 26 call 0x24d66 ; 0x24d66 24e5a: c8 2f mov r28, r24 24e5c: 81 11 cpse r24, r1 24e5e: 04 c0 rjmp .+8 ; 0x24e68 cacheDirty_ = 0; } return true; fail: return false; 24e60: c0 e0 ldi r28, 0x00 ; 0 } 24e62: 8c 2f mov r24, r28 24e64: cf 91 pop r28 24e66: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 24e68: 40 91 3e 0e lds r20, 0x0E3E ; 0x800e3e 24e6c: 50 91 3f 0e lds r21, 0x0E3F ; 0x800e3f 24e70: 60 91 40 0e lds r22, 0x0E40 ; 0x800e40 24e74: 70 91 41 0e lds r23, 0x0E41 ; 0x800e41 24e78: 41 15 cp r20, r1 24e7a: 51 05 cpc r21, r1 24e7c: 61 05 cpc r22, r1 24e7e: 71 05 cpc r23, r1 24e80: 91 f0 breq .+36 ; 0x24ea6 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 24e82: 26 e4 ldi r18, 0x46 ; 70 24e84: 3e e0 ldi r19, 0x0E ; 14 24e86: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 24e8a: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 24e8e: 0f 94 b3 26 call 0x24d66 ; 0x24d66 24e92: 88 23 and r24, r24 24e94: 29 f3 breq .-54 ; 0x24e60 goto fail; } cacheMirrorBlock_ = 0; 24e96: 10 92 3e 0e sts 0x0E3E, r1 ; 0x800e3e 24e9a: 10 92 3f 0e sts 0x0E3F, r1 ; 0x800e3f 24e9e: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 24ea2: 10 92 41 0e sts 0x0E41, r1 ; 0x800e41 } cacheDirty_ = 0; 24ea6: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 24eaa: db cf rjmp .-74 ; 0x24e62 00024eac : * \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) { 24eac: 2f 92 push r2 24eae: 3f 92 push r3 24eb0: 4f 92 push r4 24eb2: 5f 92 push r5 24eb4: 6f 92 push r6 24eb6: 7f 92 push r7 24eb8: 8f 92 push r8 24eba: 9f 92 push r9 24ebc: af 92 push r10 24ebe: bf 92 push r11 24ec0: cf 92 push r12 24ec2: df 92 push r13 24ec4: ef 92 push r14 24ec6: ff 92 push r15 24ec8: 0f 93 push r16 24eca: 1f 93 push r17 24ecc: cf 93 push r28 24ece: df 93 push r29 24ed0: ec 01 movw r28, r24 24ed2: 2a 01 movw r4, r20 24ed4: 3b 01 movw r6, r22 24ed6: 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; 24ed8: 8b 81 ldd r24, Y+3 ; 0x03 24eda: 83 30 cpi r24, 0x03 ; 3 24edc: 39 f0 breq .+14 ; 0x24eec 24ede: 69 e0 ldi r22, 0x09 ; 9 24ee0: 44 0c add r4, r4 24ee2: 55 1c adc r5, r5 24ee4: 66 1c adc r6, r6 24ee6: 77 1c adc r7, r7 24ee8: 6a 95 dec r22 24eea: d1 f7 brne .-12 ; 0x24ee0 retry2: 24eec: 43 e0 ldi r20, 0x03 ; 3 24eee: 94 2e mov r9, r20 24ef0: 56 01 movw r10, r12 24ef2: 81 e0 ldi r24, 0x01 ; 1 24ef4: a8 1a sub r10, r24 24ef6: 8e ef ldi r24, 0xFE ; 254 24ef8: b8 0a sbc r11, r24 24efa: 16 01 movw r2, r12 24efc: ee ef ldi r30, 0xFE ; 254 24efe: 3e 1a sub r3, r30 24f00: 54 e0 ldi r21, 0x04 ; 4 24f02: 85 2e mov r8, r21 retryCnt --; 24f04: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 24f06: a3 01 movw r20, r6 24f08: 92 01 movw r18, r4 24f0a: 61 e1 ldi r22, 0x11 ; 17 24f0c: ce 01 movw r24, r28 24f0e: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 24f12: 88 23 and r24, r24 24f14: 79 f0 breq .+30 ; 0x24f34 24f16: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 24f18: 99 20 and r9, r9 24f1a: 09 f4 brne .+2 ; 0x24f1e 24f1c: 7a c0 rjmp .+244 ; 0x25012 if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 24f1e: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 24f22: 20 e0 ldi r18, 0x00 ; 0 24f24: 30 e0 ldi r19, 0x00 ; 0 24f26: a9 01 movw r20, r18 24f28: 6c e0 ldi r22, 0x0C ; 12 24f2a: ce 01 movw r24, r28 24f2c: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 errorCode_ = 0; 24f30: 18 82 st Y, r1 24f32: e8 cf rjmp .-48 ; 0x24f04 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 24f34: 0f 94 56 0b call 0x216ac ; 0x216ac 24f38: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 24f3a: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 24f3e: 8a 83 std Y+2, r24 ; 0x02 24f40: 8f 3f cpi r24, 0xFF ; 255 24f42: 91 f4 brne .+36 ; 0x24f68 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 24f44: 0f 94 56 0b call 0x216ac ; 0x216ac 24f48: 60 1b sub r22, r16 24f4a: 71 0b sbc r23, r17 24f4c: 6d 32 cpi r22, 0x2D ; 45 24f4e: 71 40 sbci r23, 0x01 ; 1 24f50: a0 f3 brcs .-24 ; 0x24f3a 24f52: 81 e1 ldi r24, 0x11 ; 17 24f54: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 24f56: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 24f5a: 8c 81 ldd r24, Y+4 ; 0x04 24f5c: 88 23 and r24, r24 24f5e: e1 f2 breq .-72 ; 0x24f18 spiSend(0XFF); 24f60: 8f ef ldi r24, 0xFF ; 255 24f62: 0f 94 4e 26 call 0x24c9c ; 0x24c9c 24f66: d8 cf rjmp .-80 ; 0x24f18 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 24f68: 8e 3f cpi r24, 0xFE ; 254 24f6a: 11 f0 breq .+4 ; 0x24f70 24f6c: 8f e0 ldi r24, 0x0F ; 15 24f6e: f2 cf rjmp .-28 ; 0x24f54 //------------------------------------------------------------------------------ /** 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; 24f70: 8f ef ldi r24, 0xFF ; 255 24f72: 8e bd out 0x2e, r24 ; 46 24f74: d6 01 movw r26, r12 24f76: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24f78: 0d b4 in r0, 0x2d ; 45 24f7a: 07 fe sbrs r0, 7 24f7c: fd cf rjmp .-6 ; 0x24f78 buf[i] = SPDR; 24f7e: 9e b5 in r25, 0x2e ; 46 24f80: 91 93 st Z+, r25 SPDR = 0XFF; 24f82: 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++) { 24f84: ea 15 cp r30, r10 24f86: fb 05 cpc r31, r11 24f88: b9 f7 brne .-18 ; 0x24f78 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24f8a: 0d b4 in r0, 0x2d ; 45 24f8c: 07 fe sbrs r0, 7 24f8e: fd cf rjmp .-6 ; 0x24f8a buf[nbyte] = SPDR; 24f90: 8e b5 in r24, 0x2e ; 46 24f92: f5 01 movw r30, r10 24f94: 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; 24f96: f1 2c mov r15, r1 24f98: 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); 24f9a: 8d 91 ld r24, X+ 24f9c: ef 2d mov r30, r15 24f9e: ff 27 eor r31, r31 24fa0: e8 27 eor r30, r24 24fa2: ee 0f add r30, r30 24fa4: ff 1f adc r31, r31 24fa6: e5 57 subi r30, 0x75 ; 117 24fa8: f6 47 sbci r31, 0x76 ; 118 24faa: 85 91 lpm r24, Z+ 24fac: 94 91 lpm r25, Z 24fae: fe 2c mov r15, r14 24fb0: ee 24 eor r14, r14 24fb2: e8 26 eor r14, r24 24fb4: 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++) { 24fb6: 2a 16 cp r2, r26 24fb8: 3b 06 cpc r3, r27 24fba: 79 f7 brne .-34 ; 0x24f9a spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 24fbc: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 24fc0: 08 2f mov r16, r24 24fc2: 10 e0 ldi r17, 0x00 ; 0 24fc4: 10 2f mov r17, r16 24fc6: 00 27 eor r16, r16 recvCrc |= spiRec(); 24fc8: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 24fcc: 08 2b or r16, r24 if (calcCrc != recvCrc) 24fce: 0e 15 cp r16, r14 24fd0: 1f 05 cpc r17, r15 24fd2: 19 f0 breq .+6 ; 0x24fda 24fd4: f0 e2 ldi r31, 0x20 ; 32 24fd6: f8 83 st Y, r31 24fd8: be cf rjmp .-132 ; 0x24f56 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 24fda: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 24fde: cc 81 ldd r28, Y+4 ; 0x04 24fe0: cc 23 and r28, r28 24fe2: d9 f0 breq .+54 ; 0x2501a spiSend(0XFF); 24fe4: 8f ef ldi r24, 0xFF ; 255 24fe6: 0f 94 4e 26 call 0x24c9c ; 0x24c9c #endif fail: chipSelectHigh(); return false; } 24fea: 8c 2f mov r24, r28 24fec: df 91 pop r29 24fee: cf 91 pop r28 24ff0: 1f 91 pop r17 24ff2: 0f 91 pop r16 24ff4: ff 90 pop r15 24ff6: ef 90 pop r14 24ff8: df 90 pop r13 24ffa: cf 90 pop r12 24ffc: bf 90 pop r11 24ffe: af 90 pop r10 25000: 9f 90 pop r9 25002: 8f 90 pop r8 25004: 7f 90 pop r7 25006: 6f 90 pop r6 25008: 5f 90 pop r5 2500a: 4f 90 pop r4 2500c: 3f 90 pop r3 2500e: 2f 90 pop r2 25010: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 25012: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 return false; 25016: c0 e0 ldi r28, 0x00 ; 0 25018: e8 cf rjmp .-48 ; 0x24fea if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2501a: c1 e0 ldi r28, 0x01 ; 1 2501c: e6 cf rjmp .-52 ; 0x24fea 0002501e : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2501e: cf 92 push r12 25020: df 92 push r13 25022: ef 92 push r14 25024: ff 92 push r15 25026: cf 93 push r28 25028: 6b 01 movw r12, r22 2502a: 7c 01 movw r14, r24 2502c: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2502e: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 25032: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 25036: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 2503a: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 2503e: 8c 15 cp r24, r12 25040: 9d 05 cpc r25, r13 25042: ae 05 cpc r26, r14 25044: bf 05 cpc r27, r15 25046: 01 f1 breq .+64 ; 0x25088 if (!cacheFlush()) goto fail; 25048: 0f 94 17 27 call 0x24e2e ; 0x24e2e 2504c: 81 11 cpse r24, r1 2504e: 08 c0 rjmp .+16 ; 0x25060 } if (dirty) cacheDirty_ = true; return true; fail: return false; 25050: c0 e0 ldi r28, 0x00 ; 0 } 25052: 8c 2f mov r24, r28 25054: cf 91 pop r28 25056: ff 90 pop r15 25058: ef 90 pop r14 2505a: df 90 pop r13 2505c: cf 90 pop r12 2505e: 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; 25060: 26 e4 ldi r18, 0x46 ; 70 25062: 3e e0 ldi r19, 0x0E ; 14 25064: b7 01 movw r22, r14 25066: a6 01 movw r20, r12 25068: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 2506c: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 25070: 0f 94 56 27 call 0x24eac ; 0x24eac 25074: 88 23 and r24, r24 25076: 61 f3 breq .-40 ; 0x25050 cacheBlockNumber_ = blockNumber; 25078: c0 92 3a 0e sts 0x0E3A, r12 ; 0x800e3a 2507c: d0 92 3b 0e sts 0x0E3B, r13 ; 0x800e3b 25080: e0 92 3c 0e sts 0x0E3C, r14 ; 0x800e3c 25084: f0 92 3d 0e sts 0x0E3D, r15 ; 0x800e3d } if (dirty) cacheDirty_ = true; 25088: cc 23 and r28, r28 2508a: 21 f0 breq .+8 ; 0x25094 2508c: 81 e0 ldi r24, 0x01 ; 1 2508e: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 25092: df cf rjmp .-66 ; 0x25052 return true; 25094: c1 e0 ldi r28, 0x01 ; 1 25096: dd cf rjmp .-70 ; 0x25052 00025098 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 25098: 4f 92 push r4 2509a: 5f 92 push r5 2509c: 6f 92 push r6 2509e: 7f 92 push r7 250a0: 8f 92 push r8 250a2: 9f 92 push r9 250a4: af 92 push r10 250a6: bf 92 push r11 250a8: cf 92 push r12 250aa: df 92 push r13 250ac: ef 92 push r14 250ae: ff 92 push r15 250b0: 0f 93 push r16 250b2: 1f 93 push r17 250b4: cf 93 push r28 250b6: df 93 push r29 250b8: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 250ba: 42 30 cpi r20, 0x02 ; 2 250bc: 51 05 cpc r21, r1 250be: 61 05 cpc r22, r1 250c0: 71 05 cpc r23, r1 250c2: 90 f4 brcc .+36 ; 0x250e8 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 250c4: 80 e0 ldi r24, 0x00 ; 0 } 250c6: df 91 pop r29 250c8: cf 91 pop r28 250ca: 1f 91 pop r17 250cc: 0f 91 pop r16 250ce: ff 90 pop r15 250d0: ef 90 pop r14 250d2: df 90 pop r13 250d4: cf 90 pop r12 250d6: bf 90 pop r11 250d8: af 90 pop r10 250da: 9f 90 pop r9 250dc: 8f 90 pop r8 250de: 7f 90 pop r7 250e0: 6f 90 pop r6 250e2: 5f 90 pop r5 250e4: 4f 90 pop r4 250e6: 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; 250e8: 89 85 ldd r24, Y+9 ; 0x09 250ea: 9a 85 ldd r25, Y+10 ; 0x0a 250ec: ab 85 ldd r26, Y+11 ; 0x0b 250ee: bc 85 ldd r27, Y+12 ; 0x0c 250f0: 01 96 adiw r24, 0x01 ; 1 250f2: a1 1d adc r26, r1 250f4: b1 1d adc r27, r1 250f6: 84 17 cp r24, r20 250f8: 95 07 cpc r25, r21 250fa: a6 07 cpc r26, r22 250fc: b7 07 cpc r27, r23 250fe: 10 f3 brcs .-60 ; 0x250c4 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 25100: 8f 89 ldd r24, Y+23 ; 0x17 25102: 80 31 cpi r24, 0x10 ; 16 25104: c9 f5 brne .+114 ; 0x25178 lba = fatStartBlock_ + (cluster >> 8); 25106: 85 2e mov r8, r21 25108: 96 2e mov r9, r22 2510a: a7 2e mov r10, r23 2510c: bb 24 eor r11, r11 2510e: 8b 89 ldd r24, Y+19 ; 0x13 25110: 9c 89 ldd r25, Y+20 ; 0x14 25112: ad 89 ldd r26, Y+21 ; 0x15 25114: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 25116: 88 0e add r8, r24 25118: 99 1e adc r9, r25 2511a: aa 1e adc r10, r26 2511c: bb 1e adc r11, r27 2511e: 28 01 movw r4, r16 25120: 39 01 movw r6, r18 25122: 6a 01 movw r12, r20 25124: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 25126: 41 e0 ldi r20, 0x01 ; 1 25128: c5 01 movw r24, r10 2512a: b4 01 movw r22, r8 2512c: 0f 94 0f 28 call 0x2501e ; 0x2501e 25130: 88 23 and r24, r24 25132: 41 f2 breq .-112 ; 0x250c4 // store entry if (fatType_ == 16) { 25134: 9f 89 ldd r25, Y+23 ; 0x17 25136: 90 31 cpi r25, 0x10 ; 16 25138: 81 f5 brne .+96 ; 0x2519a cacheBuffer_.fat16[cluster & 0XFF] = value; 2513a: dd 24 eor r13, r13 2513c: ee 24 eor r14, r14 2513e: ff 24 eor r15, r15 25140: f6 01 movw r30, r12 25142: ee 0f add r30, r30 25144: ff 1f adc r31, r31 25146: ea 5b subi r30, 0xBA ; 186 25148: f1 4f sbci r31, 0xF1 ; 241 2514a: 11 83 std Z+1, r17 ; 0x01 2514c: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2514e: 9a 89 ldd r25, Y+18 ; 0x12 25150: 92 30 cpi r25, 0x02 ; 2 25152: 08 f4 brcc .+2 ; 0x25156 25154: b8 cf rjmp .-144 ; 0x250c6 25156: 4d 81 ldd r20, Y+5 ; 0x05 25158: 5e 81 ldd r21, Y+6 ; 0x06 2515a: 6f 81 ldd r22, Y+7 ; 0x07 2515c: 78 85 ldd r23, Y+8 ; 0x08 2515e: 84 0e add r8, r20 25160: 95 1e adc r9, r21 25162: a6 1e adc r10, r22 25164: b7 1e adc r11, r23 25166: 80 92 3e 0e sts 0x0E3E, r8 ; 0x800e3e 2516a: 90 92 3f 0e sts 0x0E3F, r9 ; 0x800e3f 2516e: a0 92 40 0e sts 0x0E40, r10 ; 0x800e40 25172: b0 92 41 0e sts 0x0E41, r11 ; 0x800e41 25176: a7 cf rjmp .-178 ; 0x250c6 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 25178: 80 32 cpi r24, 0x20 ; 32 2517a: 09 f0 breq .+2 ; 0x2517e 2517c: a3 cf rjmp .-186 ; 0x250c4 lba = fatStartBlock_ + (cluster >> 7); 2517e: 8b 89 ldd r24, Y+19 ; 0x13 25180: 9c 89 ldd r25, Y+20 ; 0x14 25182: ad 89 ldd r26, Y+21 ; 0x15 25184: be 89 ldd r27, Y+22 ; 0x16 25186: 4a 01 movw r8, r20 25188: 5b 01 movw r10, r22 2518a: e7 e0 ldi r30, 0x07 ; 7 2518c: b6 94 lsr r11 2518e: a7 94 ror r10 25190: 97 94 ror r9 25192: 87 94 ror r8 25194: ea 95 dec r30 25196: d1 f7 brne .-12 ; 0x2518c 25198: be cf rjmp .-132 ; 0x25116 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2519a: e8 94 clt 2519c: c7 f8 bld r12, 7 2519e: dd 24 eor r13, r13 251a0: ee 24 eor r14, r14 251a2: ff 24 eor r15, r15 251a4: f6 01 movw r30, r12 251a6: ee 0f add r30, r30 251a8: ff 1f adc r31, r31 251aa: ee 0f add r30, r30 251ac: ff 1f adc r31, r31 251ae: ea 5b subi r30, 0xBA ; 186 251b0: f1 4f sbci r31, 0xF1 ; 241 251b2: 40 82 st Z, r4 251b4: 51 82 std Z+1, r5 ; 0x01 251b6: 62 82 std Z+2, r6 ; 0x02 251b8: 73 82 std Z+3, r7 ; 0x03 251ba: c9 cf rjmp .-110 ; 0x2514e 000251bc : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 251bc: cf 92 push r12 251be: df 92 push r13 251c0: ef 92 push r14 251c2: ff 92 push r15 251c4: 0f 93 push r16 251c6: 1f 93 push r17 251c8: cf 93 push r28 251ca: df 93 push r29 251cc: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 251ce: 81 85 ldd r24, Z+9 ; 0x09 251d0: 92 85 ldd r25, Z+10 ; 0x0a 251d2: a3 85 ldd r26, Z+11 ; 0x0b 251d4: b4 85 ldd r27, Z+12 ; 0x0c 251d6: 01 96 adiw r24, 0x01 ; 1 251d8: a1 1d adc r26, r1 251da: b1 1d adc r27, r1 251dc: 84 17 cp r24, r20 251de: 95 07 cpc r25, r21 251e0: a6 07 cpc r26, r22 251e2: b7 07 cpc r27, r23 251e4: 50 f4 brcc .+20 ; 0x251fa *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 251e6: 80 e0 ldi r24, 0x00 ; 0 } 251e8: df 91 pop r29 251ea: cf 91 pop r28 251ec: 1f 91 pop r17 251ee: 0f 91 pop r16 251f0: ff 90 pop r15 251f2: ef 90 pop r14 251f4: df 90 pop r13 251f6: cf 90 pop r12 251f8: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 251fa: 87 89 ldd r24, Z+23 ; 0x17 251fc: 80 31 cpi r24, 0x10 ; 16 251fe: a9 f5 brne .+106 ; 0x2526a lba = fatStartBlock_ + (cluster >> 8); 25200: bb 27 eor r27, r27 25202: a7 2f mov r26, r23 25204: 96 2f mov r25, r22 25206: 85 2f mov r24, r21 25208: c3 88 ldd r12, Z+19 ; 0x13 2520a: d4 88 ldd r13, Z+20 ; 0x14 2520c: e5 88 ldd r14, Z+21 ; 0x15 2520e: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 25210: 8c 0d add r24, r12 25212: 9d 1d adc r25, r13 25214: ae 1d adc r26, r14 25216: bf 1d adc r27, r15 25218: e9 01 movw r28, r18 2521a: 6a 01 movw r12, r20 2521c: 7b 01 movw r14, r22 2521e: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 25220: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 25224: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 25228: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 2522c: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 25230: 84 17 cp r24, r20 25232: 95 07 cpc r25, r21 25234: a6 07 cpc r26, r22 25236: b7 07 cpc r27, r23 25238: 49 f5 brne .+82 ; 0x2528c if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2523a: f8 01 movw r30, r16 2523c: 87 89 ldd r24, Z+23 ; 0x17 2523e: 80 31 cpi r24, 0x10 ; 16 25240: 69 f5 brne .+90 ; 0x2529c *value = cacheBuffer_.fat16[cluster & 0XFF]; 25242: b7 01 movw r22, r14 25244: a6 01 movw r20, r12 25246: 55 27 eor r21, r21 25248: 66 27 eor r22, r22 2524a: 77 27 eor r23, r23 2524c: 44 0f add r20, r20 2524e: 55 1f adc r21, r21 25250: 4a 5b subi r20, 0xBA ; 186 25252: 51 4f sbci r21, 0xF1 ; 241 25254: fa 01 movw r30, r20 25256: 80 81 ld r24, Z 25258: 91 81 ldd r25, Z+1 ; 0x01 2525a: b0 e0 ldi r27, 0x00 ; 0 2525c: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2525e: 88 83 st Y, r24 25260: 99 83 std Y+1, r25 ; 0x01 25262: aa 83 std Y+2, r26 ; 0x02 25264: bb 83 std Y+3, r27 ; 0x03 25266: 81 e0 ldi r24, 0x01 ; 1 25268: bf cf rjmp .-130 ; 0x251e8 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2526a: 80 32 cpi r24, 0x20 ; 32 2526c: 09 f0 breq .+2 ; 0x25270 2526e: bb cf rjmp .-138 ; 0x251e6 lba = fatStartBlock_ + (cluster >> 7); 25270: c3 88 ldd r12, Z+19 ; 0x13 25272: d4 88 ldd r13, Z+20 ; 0x14 25274: e5 88 ldd r14, Z+21 ; 0x15 25276: f6 88 ldd r15, Z+22 ; 0x16 25278: db 01 movw r26, r22 2527a: ca 01 movw r24, r20 2527c: c7 e0 ldi r28, 0x07 ; 7 2527e: b6 95 lsr r27 25280: a7 95 ror r26 25282: 97 95 ror r25 25284: 87 95 ror r24 25286: ca 95 dec r28 25288: d1 f7 brne .-12 ; 0x2527e 2528a: c2 cf rjmp .-124 ; 0x25210 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2528c: 40 e0 ldi r20, 0x00 ; 0 2528e: bc 01 movw r22, r24 25290: cd 01 movw r24, r26 25292: 0f 94 0f 28 call 0x2501e ; 0x2501e 25296: 81 11 cpse r24, r1 25298: d0 cf rjmp .-96 ; 0x2523a 2529a: a5 cf rjmp .-182 ; 0x251e6 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2529c: b7 01 movw r22, r14 2529e: a6 01 movw r20, r12 252a0: 4f 77 andi r20, 0x7F ; 127 252a2: 55 27 eor r21, r21 252a4: 66 27 eor r22, r22 252a6: 77 27 eor r23, r23 252a8: 44 0f add r20, r20 252aa: 55 1f adc r21, r21 252ac: 44 0f add r20, r20 252ae: 55 1f adc r21, r21 252b0: 4a 5b subi r20, 0xBA ; 186 252b2: 51 4f sbci r21, 0xF1 ; 241 252b4: fa 01 movw r30, r20 252b6: 80 81 ld r24, Z 252b8: 91 81 ldd r25, Z+1 ; 0x01 252ba: a2 81 ldd r26, Z+2 ; 0x02 252bc: b3 81 ldd r27, Z+3 ; 0x03 252be: bf 70 andi r27, 0x0F ; 15 252c0: ce cf rjmp .-100 ; 0x2525e 000252c2 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 252c2: 4f 92 push r4 252c4: 5f 92 push r5 252c6: 6f 92 push r6 252c8: 7f 92 push r7 252ca: af 92 push r10 252cc: bf 92 push r11 252ce: cf 92 push r12 252d0: df 92 push r13 252d2: ef 92 push r14 252d4: ff 92 push r15 252d6: 0f 93 push r16 252d8: 1f 93 push r17 252da: cf 93 push r28 252dc: df 93 push r29 252de: 00 d0 rcall .+0 ; 0x252e0 252e0: 1f 92 push r1 252e2: cd b7 in r28, 0x3d ; 61 252e4: de b7 in r29, 0x3e ; 62 252e6: 8c 01 movw r16, r24 252e8: 49 83 std Y+1, r20 ; 0x01 252ea: 5a 83 std Y+2, r21 ; 0x02 252ec: 6b 83 std Y+3, r22 ; 0x03 252ee: 7c 83 std Y+4, r23 ; 0x04 252f0: 59 01 movw r10, r18 uint32_t s = 0; 252f2: c1 2c mov r12, r1 252f4: d1 2c mov r13, r1 252f6: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 252f8: 41 2c mov r4, r1 252fa: 82 e0 ldi r24, 0x02 ; 2 252fc: 58 2e mov r5, r24 252fe: 61 2c mov r6, r1 25300: 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; 25302: 49 81 ldd r20, Y+1 ; 0x01 25304: 5a 81 ldd r21, Y+2 ; 0x02 25306: 6b 81 ldd r22, Y+3 ; 0x03 25308: 7c 81 ldd r23, Y+4 ; 0x04 2530a: 9e 01 movw r18, r28 2530c: 2f 5f subi r18, 0xFF ; 255 2530e: 3f 4f sbci r19, 0xFF ; 255 25310: c8 01 movw r24, r16 25312: 0f 94 de 28 call 0x251bc ; 0x251bc 25316: 88 23 and r24, r24 25318: 19 f1 breq .+70 ; 0x25360 s += 512UL << clusterSizeShift_; 2531a: f8 01 movw r30, r16 2531c: 85 85 ldd r24, Z+13 ; 0x0d 2531e: a3 01 movw r20, r6 25320: 92 01 movw r18, r4 25322: 04 c0 rjmp .+8 ; 0x2532c 25324: 22 0f add r18, r18 25326: 33 1f adc r19, r19 25328: 44 1f adc r20, r20 2532a: 55 1f adc r21, r21 2532c: 8a 95 dec r24 2532e: d2 f7 brpl .-12 ; 0x25324 25330: da 01 movw r26, r20 25332: c9 01 movw r24, r18 25334: c8 0e add r12, r24 25336: d9 1e adc r13, r25 25338: ea 1e adc r14, r26 2533a: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2533c: 49 81 ldd r20, Y+1 ; 0x01 2533e: 5a 81 ldd r21, Y+2 ; 0x02 25340: 6b 81 ldd r22, Y+3 ; 0x03 25342: 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; 25344: 87 89 ldd r24, Z+23 ; 0x17 25346: 80 31 cpi r24, 0x10 ; 16 25348: f1 f4 brne .+60 ; 0x25386 2534a: 81 e0 ldi r24, 0x01 ; 1 2534c: 48 3f cpi r20, 0xF8 ; 248 2534e: 5f 4f sbci r21, 0xFF ; 255 25350: 61 05 cpc r22, r1 25352: 71 05 cpc r23, r1 25354: b0 f2 brcs .-84 ; 0x25302 *size = s; 25356: f5 01 movw r30, r10 25358: c0 82 st Z, r12 2535a: d1 82 std Z+1, r13 ; 0x01 2535c: e2 82 std Z+2, r14 ; 0x02 2535e: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 25360: 0f 90 pop r0 25362: 0f 90 pop r0 25364: 0f 90 pop r0 25366: 0f 90 pop r0 25368: df 91 pop r29 2536a: cf 91 pop r28 2536c: 1f 91 pop r17 2536e: 0f 91 pop r16 25370: ff 90 pop r15 25372: ef 90 pop r14 25374: df 90 pop r13 25376: cf 90 pop r12 25378: bf 90 pop r11 2537a: af 90 pop r10 2537c: 7f 90 pop r7 2537e: 6f 90 pop r6 25380: 5f 90 pop r5 25382: 4f 90 pop r4 25384: 08 95 ret return cluster >= FAT32EOC_MIN; 25386: 81 e0 ldi r24, 0x01 ; 1 25388: 48 3f cpi r20, 0xF8 ; 248 2538a: 5f 4f sbci r21, 0xFF ; 255 2538c: 6f 4f sbci r22, 0xFF ; 255 2538e: 7f 40 sbci r23, 0x0F ; 15 25390: 08 f4 brcc .+2 ; 0x25394 25392: b7 cf rjmp .-146 ; 0x25302 25394: e0 cf rjmp .-64 ; 0x25356 00025396 : * \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) { 25396: 0f 93 push r16 25398: 1f 93 push r17 2539a: cf 93 push r28 2539c: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2539e: fc 01 movw r30, r24 253a0: 23 81 ldd r18, Z+3 ; 0x03 253a2: 22 23 and r18, r18 253a4: 31 f0 breq .+12 ; 0x253b2 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 253a6: 80 e0 ldi r24, 0x00 ; 0 } 253a8: df 91 pop r29 253aa: cf 91 pop r28 253ac: 1f 91 pop r17 253ae: 0f 91 pop r16 253b0: 08 95 ret 253b2: 8b 01 movw r16, r22 253b4: ec 01 movw r28, r24 253b6: fb 01 movw r30, r22 253b8: 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)) { 253ba: 80 31 cpi r24, 0x10 ; 16 253bc: 39 f5 brne .+78 ; 0x2540c type_ = FAT_FILE_TYPE_ROOT_FIXED; 253be: 82 e0 ldi r24, 0x02 ; 2 253c0: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 253c2: 1d 8a std Y+21, r1 ; 0x15 253c4: 1e 8a std Y+22, r1 ; 0x16 253c6: 1f 8a std Y+23, r1 ; 0x17 253c8: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 253ca: 80 8d ldd r24, Z+24 ; 0x18 253cc: 91 8d ldd r25, Z+25 ; 0x19 253ce: b0 e0 ldi r27, 0x00 ; 0 253d0: a0 e0 ldi r26, 0x00 ; 0 253d2: 25 e0 ldi r18, 0x05 ; 5 253d4: 88 0f add r24, r24 253d6: 99 1f adc r25, r25 253d8: aa 1f adc r26, r26 253da: bb 1f adc r27, r27 253dc: 2a 95 dec r18 253de: d1 f7 brne .-12 ; 0x253d4 253e0: 89 8b std Y+17, r24 ; 0x11 253e2: 9a 8b std Y+18, r25 ; 0x12 253e4: ab 8b std Y+19, r26 ; 0x13 253e6: 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; 253e8: 1a 8f std Y+26, r17 ; 0x1a 253ea: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 253ec: 81 e0 ldi r24, 0x01 ; 1 253ee: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 253f0: 1c 82 std Y+4, r1 ; 0x04 253f2: 1d 82 std Y+5, r1 ; 0x05 253f4: 1e 82 std Y+6, r1 ; 0x06 253f6: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 253f8: 18 86 std Y+8, r1 ; 0x08 253fa: 19 86 std Y+9, r1 ; 0x09 253fc: 1a 86 std Y+10, r1 ; 0x0a 253fe: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 25400: 1c 86 std Y+12, r1 ; 0x0c 25402: 1d 86 std Y+13, r1 ; 0x0d 25404: 1e 86 std Y+14, r1 ; 0x0e 25406: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 25408: 18 8a std Y+16, r1 ; 0x10 2540a: ce cf rjmp .-100 ; 0x253a8 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) { 2540c: 80 32 cpi r24, 0x20 ; 32 2540e: 59 f6 brne .-106 ; 0x253a6 type_ = FAT_FILE_TYPE_ROOT32; 25410: 83 e0 ldi r24, 0x03 ; 3 25412: 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_;} 25414: 42 8d ldd r20, Z+26 ; 0x1a 25416: 53 8d ldd r21, Z+27 ; 0x1b 25418: 64 8d ldd r22, Z+28 ; 0x1c 2541a: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2541c: 4d 8b std Y+21, r20 ; 0x15 2541e: 5e 8b std Y+22, r21 ; 0x16 25420: 6f 8b std Y+23, r22 ; 0x17 25422: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 25424: 9e 01 movw r18, r28 25426: 2f 5e subi r18, 0xEF ; 239 25428: 3f 4f sbci r19, 0xFF ; 255 2542a: c8 01 movw r24, r16 2542c: 0f 94 61 29 call 0x252c2 ; 0x252c2 25430: 81 11 cpse r24, r1 25432: da cf rjmp .-76 ; 0x253e8 25434: b8 cf rjmp .-144 ; 0x253a6 00025436 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 25436: cf 92 push r12 25438: df 92 push r13 2543a: ef 92 push r14 2543c: ff 92 push r15 2543e: 1f 93 push r17 25440: cf 93 push r28 25442: df 93 push r29 25444: ec 01 movw r28, r24 25446: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 25448: e1 11 cpse r30, r1 2544a: 09 c0 rjmp .+18 ; 0x2545e 2544c: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2544e: df 91 pop r29 25450: cf 91 pop r28 25452: 1f 91 pop r17 25454: ff 90 pop r15 25456: ef 90 pop r14 25458: df 90 pop r13 2545a: cf 90 pop r12 2545c: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2545e: 89 81 ldd r24, Y+1 ; 0x01 25460: 80 ff sbrs r24, 0 25462: f4 cf rjmp .-24 ; 0x2544c gfOffset = curPosition_ & 0X1FF; // offset in block 25464: 48 85 ldd r20, Y+8 ; 0x08 25466: 59 85 ldd r21, Y+9 ; 0x09 25468: 6a 85 ldd r22, Y+10 ; 0x0a 2546a: 7b 85 ldd r23, Y+11 ; 0x0b 2546c: 9a 01 movw r18, r20 2546e: 31 70 andi r19, 0x01 ; 1 25470: 3a a3 std Y+34, r19 ; 0x22 25472: 29 a3 std Y+33, r18 ; 0x21 25474: 89 8d ldd r24, Y+25 ; 0x19 25476: 9a 8d ldd r25, Y+26 ; 0x1a 25478: 6a 01 movw r12, r20 2547a: 7b 01 movw r14, r22 2547c: f9 e0 ldi r31, 0x09 ; 9 2547e: f6 94 lsr r15 25480: e7 94 ror r14 25482: d7 94 ror r13 25484: c7 94 ror r12 25486: fa 95 dec r31 25488: d1 f7 brne .-12 ; 0x2547e if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2548a: e2 30 cpi r30, 0x02 ; 2 2548c: 79 f4 brne .+30 ; 0x254ac // 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); 2548e: fc 01 movw r30, r24 25490: 82 8d ldd r24, Z+26 ; 0x1a 25492: 93 8d ldd r25, Z+27 ; 0x1b 25494: a4 8d ldd r26, Z+28 ; 0x1c 25496: b5 8d ldd r27, Z+29 ; 0x1d 25498: 8c 0d add r24, r12 2549a: 9d 1d adc r25, r13 2549c: ae 1d adc r26, r14 2549e: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 254a0: 8d 8f std Y+29, r24 ; 0x1d 254a2: 9e 8f std Y+30, r25 ; 0x1e 254a4: af 8f std Y+31, r26 ; 0x1f 254a6: b8 a3 std Y+32, r27 ; 0x20 } return true; 254a8: 81 e0 ldi r24, 0x01 ; 1 254aa: d1 cf rjmp .-94 ; 0x2544e 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);} 254ac: fc 01 movw r30, r24 254ae: 14 81 ldd r17, Z+4 ; 0x04 254b0: 11 50 subi r17, 0x01 ; 1 254b2: 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) { 254b4: 23 2b or r18, r19 254b6: 71 f4 brne .+28 ; 0x254d4 254b8: 11 11 cpse r17, r1 254ba: 0c c0 rjmp .+24 ; 0x254d4 // start of new cluster if (curPosition_ == 0) { 254bc: 45 2b or r20, r21 254be: 46 2b or r20, r22 254c0: 47 2b or r20, r23 254c2: 31 f5 brne .+76 ; 0x25510 // use first cluster in file curCluster_ = firstCluster_; 254c4: 8d 89 ldd r24, Y+21 ; 0x15 254c6: 9e 89 ldd r25, Y+22 ; 0x16 254c8: af 89 ldd r26, Y+23 ; 0x17 254ca: b8 8d ldd r27, Y+24 ; 0x18 254cc: 8c 83 std Y+4, r24 ; 0x04 254ce: 9d 83 std Y+5, r25 ; 0x05 254d0: ae 83 std Y+6, r26 ; 0x06 254d2: 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; 254d4: e9 8d ldd r30, Y+25 ; 0x19 254d6: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 254d8: 8c 81 ldd r24, Y+4 ; 0x04 254da: 9d 81 ldd r25, Y+5 ; 0x05 254dc: ae 81 ldd r26, Y+6 ; 0x06 254de: bf 81 ldd r27, Y+7 ; 0x07 254e0: 02 97 sbiw r24, 0x02 ; 2 254e2: a1 09 sbc r26, r1 254e4: b1 09 sbc r27, r1 254e6: 25 85 ldd r18, Z+13 ; 0x0d 254e8: 04 c0 rjmp .+8 ; 0x254f2 254ea: 88 0f add r24, r24 254ec: 99 1f adc r25, r25 254ee: aa 1f adc r26, r26 254f0: bb 1f adc r27, r27 254f2: 2a 95 dec r18 254f4: d2 f7 brpl .-12 ; 0x254ea 254f6: 46 85 ldd r20, Z+14 ; 0x0e 254f8: 57 85 ldd r21, Z+15 ; 0x0f 254fa: 60 89 ldd r22, Z+16 ; 0x10 254fc: 71 89 ldd r23, Z+17 ; 0x11 254fe: 84 0f add r24, r20 25500: 95 1f adc r25, r21 25502: a6 1f adc r26, r22 25504: b7 1f adc r27, r23 25506: 81 0f add r24, r17 25508: 91 1d adc r25, r1 2550a: a1 1d adc r26, r1 2550c: b1 1d adc r27, r1 2550e: c8 cf rjmp .-112 ; 0x254a0 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 25510: 4c 81 ldd r20, Y+4 ; 0x04 25512: 5d 81 ldd r21, Y+5 ; 0x05 25514: 6e 81 ldd r22, Y+6 ; 0x06 25516: 7f 81 ldd r23, Y+7 ; 0x07 25518: 9e 01 movw r18, r28 2551a: 2c 5f subi r18, 0xFC ; 252 2551c: 3f 4f sbci r19, 0xFF ; 255 2551e: 0f 94 de 28 call 0x251bc ; 0x251bc 25522: 81 11 cpse r24, r1 25524: d7 cf rjmp .-82 ; 0x254d4 25526: 92 cf rjmp .-220 ; 0x2544c 00025528 : * \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) { 25528: 8f 92 push r8 2552a: 9f 92 push r9 2552c: af 92 push r10 2552e: bf 92 push r11 25530: cf 92 push r12 25532: df 92 push r13 25534: ef 92 push r14 25536: ff 92 push r15 25538: 0f 93 push r16 2553a: 1f 93 push r17 2553c: cf 93 push r28 2553e: df 93 push r29 25540: ec 01 movw r28, r24 25542: 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; 25544: 81 11 cpse r24, r1 25546: 0e c0 rjmp .+28 ; 0x25564 done: return true; fail: return false; 25548: 80 e0 ldi r24, 0x00 ; 0 } 2554a: df 91 pop r29 2554c: cf 91 pop r28 2554e: 1f 91 pop r17 25550: 0f 91 pop r16 25552: ff 90 pop r15 25554: ef 90 pop r14 25556: df 90 pop r13 25558: cf 90 pop r12 2555a: bf 90 pop r11 2555c: af 90 pop r10 2555e: 9f 90 pop r9 25560: 8f 90 pop r8 25562: 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; 25564: 09 89 ldd r16, Y+17 ; 0x11 25566: 1a 89 ldd r17, Y+18 ; 0x12 25568: 2b 89 ldd r18, Y+19 ; 0x13 2556a: 3c 89 ldd r19, Y+20 ; 0x14 2556c: 04 17 cp r16, r20 2556e: 15 07 cpc r17, r21 25570: 26 07 cpc r18, r22 25572: 37 07 cpc r19, r23 25574: 48 f3 brcs .-46 ; 0x25548 25576: 4a 01 movw r8, r20 25578: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2557a: 82 30 cpi r24, 0x02 ; 2 2557c: 31 f4 brne .+12 ; 0x2558a curPosition_ = pos; 2557e: 88 86 std Y+8, r8 ; 0x08 25580: 99 86 std Y+9, r9 ; 0x09 25582: aa 86 std Y+10, r10 ; 0x0a 25584: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 25586: 81 e0 ldi r24, 0x01 ; 1 25588: e0 cf rjmp .-64 ; 0x2554a if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2558a: 81 14 cp r8, r1 2558c: 91 04 cpc r9, r1 2558e: a1 04 cpc r10, r1 25590: b1 04 cpc r11, r1 25592: 49 f4 brne .+18 ; 0x255a6 // set position to start of file curCluster_ = 0; 25594: 1c 82 std Y+4, r1 ; 0x04 25596: 1d 82 std Y+5, r1 ; 0x05 25598: 1e 82 std Y+6, r1 ; 0x06 2559a: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2559c: 18 86 std Y+8, r1 ; 0x08 2559e: 19 86 std Y+9, r1 ; 0x09 255a0: 1a 86 std Y+10, r1 ; 0x0a 255a2: 1b 86 std Y+11, r1 ; 0x0b 255a4: f0 cf rjmp .-32 ; 0x25586 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 255a6: 08 85 ldd r16, Y+8 ; 0x08 255a8: 19 85 ldd r17, Y+9 ; 0x09 255aa: 2a 85 ldd r18, Y+10 ; 0x0a 255ac: 3b 85 ldd r19, Y+11 ; 0x0b 255ae: e9 8d ldd r30, Y+25 ; 0x19 255b0: fa 8d ldd r31, Y+26 ; 0x1a 255b2: 85 85 ldd r24, Z+13 ; 0x0d 255b4: 90 e0 ldi r25, 0x00 ; 0 255b6: 09 96 adiw r24, 0x09 ; 9 255b8: b9 01 movw r22, r18 255ba: a8 01 movw r20, r16 255bc: 41 50 subi r20, 0x01 ; 1 255be: 51 09 sbc r21, r1 255c0: 61 09 sbc r22, r1 255c2: 71 09 sbc r23, r1 255c4: 08 2e mov r0, r24 255c6: 04 c0 rjmp .+8 ; 0x255d0 255c8: 76 95 lsr r23 255ca: 67 95 ror r22 255cc: 57 95 ror r21 255ce: 47 95 ror r20 255d0: 0a 94 dec r0 255d2: d2 f7 brpl .-12 ; 0x255c8 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 255d4: 75 01 movw r14, r10 255d6: 64 01 movw r12, r8 255d8: e1 e0 ldi r30, 0x01 ; 1 255da: ce 1a sub r12, r30 255dc: d1 08 sbc r13, r1 255de: e1 08 sbc r14, r1 255e0: f1 08 sbc r15, r1 255e2: 04 c0 rjmp .+8 ; 0x255ec 255e4: f6 94 lsr r15 255e6: e7 94 ror r14 255e8: d7 94 ror r13 255ea: c7 94 ror r12 255ec: 8a 95 dec r24 255ee: d2 f7 brpl .-12 ; 0x255e4 if (nNew < nCur || curPosition_ == 0) { 255f0: c4 16 cp r12, r20 255f2: d5 06 cpc r13, r21 255f4: e6 06 cpc r14, r22 255f6: f7 06 cpc r15, r23 255f8: 20 f0 brcs .+8 ; 0x25602 255fa: 01 2b or r16, r17 255fc: 02 2b or r16, r18 255fe: 03 2b or r16, r19 25600: 11 f5 brne .+68 ; 0x25646 // must follow chain from first cluster curCluster_ = firstCluster_; 25602: 8d 89 ldd r24, Y+21 ; 0x15 25604: 9e 89 ldd r25, Y+22 ; 0x16 25606: af 89 ldd r26, Y+23 ; 0x17 25608: b8 8d ldd r27, Y+24 ; 0x18 2560a: 8c 83 std Y+4, r24 ; 0x04 2560c: 9d 83 std Y+5, r25 ; 0x05 2560e: ae 83 std Y+6, r26 ; 0x06 25610: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 25612: 8e 01 movw r16, r28 25614: 0c 5f subi r16, 0xFC ; 252 25616: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 25618: c1 14 cp r12, r1 2561a: d1 04 cpc r13, r1 2561c: e1 04 cpc r14, r1 2561e: f1 04 cpc r15, r1 25620: 09 f4 brne .+2 ; 0x25624 25622: ad cf rjmp .-166 ; 0x2557e if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 25624: 4c 81 ldd r20, Y+4 ; 0x04 25626: 5d 81 ldd r21, Y+5 ; 0x05 25628: 6e 81 ldd r22, Y+6 ; 0x06 2562a: 7f 81 ldd r23, Y+7 ; 0x07 2562c: 98 01 movw r18, r16 2562e: 89 8d ldd r24, Y+25 ; 0x19 25630: 9a 8d ldd r25, Y+26 ; 0x1a 25632: 0f 94 de 28 call 0x251bc ; 0x251bc 25636: 91 e0 ldi r25, 0x01 ; 1 25638: c9 1a sub r12, r25 2563a: d1 08 sbc r13, r1 2563c: e1 08 sbc r14, r1 2563e: f1 08 sbc r15, r1 25640: 81 11 cpse r24, r1 25642: ea cf rjmp .-44 ; 0x25618 25644: 81 cf rjmp .-254 ; 0x25548 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 25646: c4 1a sub r12, r20 25648: d5 0a sbc r13, r21 2564a: e6 0a sbc r14, r22 2564c: f7 0a sbc r15, r23 2564e: e1 cf rjmp .-62 ; 0x25612 00025650 : 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() { 25650: 3f 92 push r3 25652: 4f 92 push r4 25654: 5f 92 push r5 25656: 6f 92 push r6 25658: 7f 92 push r7 2565a: 8f 92 push r8 2565c: 9f 92 push r9 2565e: af 92 push r10 25660: bf 92 push r11 25662: cf 92 push r12 25664: df 92 push r13 25666: ef 92 push r14 25668: ff 92 push r15 2566a: 0f 93 push r16 2566c: 1f 93 push r17 2566e: cf 93 push r28 25670: df 93 push r29 25672: cd b7 in r28, 0x3d ; 61 25674: de b7 in r29, 0x3e ; 62 25676: 2c 97 sbiw r28, 0x0c ; 12 25678: 0f b6 in r0, 0x3f ; 63 2567a: f8 94 cli 2567c: de bf out 0x3e, r29 ; 62 2567e: 0f be out 0x3f, r0 ; 63 25680: cd bf out 0x3d, r28 ; 61 25682: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 25684: dc 01 movw r26, r24 25686: 59 96 adiw r26, 0x19 ; 25 25688: 8d 90 ld r8, X+ 2568a: 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; 2568c: f4 01 movw r30, r8 2568e: 81 85 ldd r24, Z+9 ; 0x09 25690: 92 85 ldd r25, Z+10 ; 0x0a 25692: a3 85 ldd r26, Z+11 ; 0x0b 25694: b4 85 ldd r27, Z+12 ; 0x0c 25696: 9c 01 movw r18, r24 25698: ad 01 movw r20, r26 2569a: 2f 5f subi r18, 0xFF ; 255 2569c: 3f 4f sbci r19, 0xFF ; 255 2569e: 4f 4f sbci r20, 0xFF ; 255 256a0: 5f 4f sbci r21, 0xFF ; 255 256a2: 29 87 std Y+9, r18 ; 0x09 256a4: 3a 87 std Y+10, r19 ; 0x0a 256a6: 4b 87 std Y+11, r20 ; 0x0b 256a8: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 256aa: d5 01 movw r26, r10 256ac: 14 96 adiw r26, 0x04 ; 4 256ae: 4d 90 ld r4, X+ 256b0: 5d 90 ld r5, X+ 256b2: 6d 90 ld r6, X+ 256b4: 7c 90 ld r7, X 256b6: 17 97 sbiw r26, 0x07 ; 7 256b8: 41 14 cp r4, r1 256ba: 51 04 cpc r5, r1 256bc: 61 04 cpc r6, r1 256be: 71 04 cpc r7, r1 256c0: 09 f4 brne .+2 ; 0x256c4 256c2: 59 c0 rjmp .+178 ; 0x25776 // try to make file contiguous bgnCluster = *curCluster + 1; 256c4: bf ef ldi r27, 0xFF ; 255 256c6: 4b 1a sub r4, r27 256c8: 5b 0a sbc r5, r27 256ca: 6b 0a sbc r6, r27 256cc: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 256ce: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 256d0: 73 01 movw r14, r6 256d2: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 256d4: 1d 82 std Y+5, r1 ; 0x05 256d6: 1e 82 std Y+6, r1 ; 0x06 256d8: 1f 82 std Y+7, r1 ; 0x07 256da: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 256dc: f4 01 movw r30, r8 256de: 81 85 ldd r24, Z+9 ; 0x09 256e0: 92 85 ldd r25, Z+10 ; 0x0a 256e2: a3 85 ldd r26, Z+11 ; 0x0b 256e4: b4 85 ldd r27, Z+12 ; 0x0c 256e6: 2d 81 ldd r18, Y+5 ; 0x05 256e8: 3e 81 ldd r19, Y+6 ; 0x06 256ea: 4f 81 ldd r20, Y+7 ; 0x07 256ec: 58 85 ldd r21, Y+8 ; 0x08 256ee: 28 17 cp r18, r24 256f0: 39 07 cpc r19, r25 256f2: 4a 07 cpc r20, r26 256f4: 5b 07 cpc r21, r27 256f6: 08 f0 brcs .+2 ; 0x256fa 256f8: 56 c0 rjmp .+172 ; 0x257a6 // past end - start from beginning of FAT if (endCluster > fatEnd) { 256fa: 89 85 ldd r24, Y+9 ; 0x09 256fc: 9a 85 ldd r25, Y+10 ; 0x0a 256fe: ab 85 ldd r26, Y+11 ; 0x0b 25700: bc 85 ldd r27, Y+12 ; 0x0c 25702: 8c 15 cp r24, r12 25704: 9d 05 cpc r25, r13 25706: ae 05 cpc r26, r14 25708: bf 05 cpc r27, r15 2570a: 50 f4 brcc .+20 ; 0x25720 bgnCluster = endCluster = 2; 2570c: 82 e0 ldi r24, 0x02 ; 2 2570e: c8 2e mov r12, r24 25710: d1 2c mov r13, r1 25712: e1 2c mov r14, r1 25714: f1 2c mov r15, r1 25716: 92 e0 ldi r25, 0x02 ; 2 25718: 49 2e mov r4, r25 2571a: 51 2c mov r5, r1 2571c: 61 2c mov r6, r1 2571e: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 25720: 9e 01 movw r18, r28 25722: 2f 5f subi r18, 0xFF ; 255 25724: 3f 4f sbci r19, 0xFF ; 255 25726: b7 01 movw r22, r14 25728: a6 01 movw r20, r12 2572a: c4 01 movw r24, r8 2572c: 0f 94 de 28 call 0x251bc ; 0x251bc 25730: 88 23 and r24, r24 25732: c9 f1 breq .+114 ; 0x257a6 if (f != 0) { 25734: 89 81 ldd r24, Y+1 ; 0x01 25736: 9a 81 ldd r25, Y+2 ; 0x02 25738: ab 81 ldd r26, Y+3 ; 0x03 2573a: bc 81 ldd r27, Y+4 ; 0x04 2573c: 89 2b or r24, r25 2573e: 8a 2b or r24, r26 25740: 8b 2b or r24, r27 25742: 01 f1 breq .+64 ; 0x25784 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 25744: 26 01 movw r4, r12 25746: 37 01 movw r6, r14 25748: 9f ef ldi r25, 0xFF ; 255 2574a: 49 1a sub r4, r25 2574c: 59 0a sbc r5, r25 2574e: 69 0a sbc r6, r25 25750: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 25752: 2d 81 ldd r18, Y+5 ; 0x05 25754: 3e 81 ldd r19, Y+6 ; 0x06 25756: 4f 81 ldd r20, Y+7 ; 0x07 25758: 58 85 ldd r21, Y+8 ; 0x08 2575a: 2f 5f subi r18, 0xFF ; 255 2575c: 3f 4f sbci r19, 0xFF ; 255 2575e: 4f 4f sbci r20, 0xFF ; 255 25760: 5f 4f sbci r21, 0xFF ; 255 25762: 2d 83 std Y+5, r18 ; 0x05 25764: 3e 83 std Y+6, r19 ; 0x06 25766: 4f 83 std Y+7, r20 ; 0x07 25768: 58 87 std Y+8, r21 ; 0x08 2576a: 3f ef ldi r19, 0xFF ; 255 2576c: c3 1a sub r12, r19 2576e: d3 0a sbc r13, r19 25770: e3 0a sbc r14, r19 25772: f3 0a sbc r15, r19 25774: b3 cf rjmp .-154 ; 0x256dc // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 25776: 40 80 ld r4, Z 25778: 51 80 ldd r5, Z+1 ; 0x01 2577a: 62 80 ldd r6, Z+2 ; 0x02 2577c: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2577e: 33 24 eor r3, r3 25780: 33 94 inc r3 25782: a6 cf rjmp .-180 ; 0x256d0 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) { 25784: c4 14 cp r12, r4 25786: d5 04 cpc r13, r5 25788: e6 04 cpc r14, r6 2578a: f7 04 cpc r15, r7 2578c: 11 f7 brne .-60 ; 0x25752 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); 2578e: 0f ef ldi r16, 0xFF ; 255 25790: 1f ef ldi r17, 0xFF ; 255 25792: 2f ef ldi r18, 0xFF ; 255 25794: 3f e0 ldi r19, 0x0F ; 15 25796: b7 01 movw r22, r14 25798: a6 01 movw r20, r12 2579a: c4 01 movw r24, r8 2579c: 0f 94 4c 28 call 0x25098 ; 0x25098 257a0: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 257a2: 81 11 cpse r24, r1 257a4: 1a c0 rjmp .+52 ; 0x257da flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 257a6: 71 2c mov r7, r1 } 257a8: 87 2d mov r24, r7 257aa: 2c 96 adiw r28, 0x0c ; 12 257ac: 0f b6 in r0, 0x3f ; 63 257ae: f8 94 cli 257b0: de bf out 0x3e, r29 ; 62 257b2: 0f be out 0x3f, r0 ; 63 257b4: cd bf out 0x3d, r28 ; 61 257b6: df 91 pop r29 257b8: cf 91 pop r28 257ba: 1f 91 pop r17 257bc: 0f 91 pop r16 257be: ff 90 pop r15 257c0: ef 90 pop r14 257c2: df 90 pop r13 257c4: cf 90 pop r12 257c6: bf 90 pop r11 257c8: af 90 pop r10 257ca: 9f 90 pop r9 257cc: 8f 90 pop r8 257ce: 7f 90 pop r7 257d0: 6f 90 pop r6 257d2: 5f 90 pop r5 257d4: 4f 90 pop r4 257d6: 3f 90 pop r3 257d8: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 257da: f5 01 movw r30, r10 257dc: 44 81 ldd r20, Z+4 ; 0x04 257de: 55 81 ldd r21, Z+5 ; 0x05 257e0: 66 81 ldd r22, Z+6 ; 0x06 257e2: 77 81 ldd r23, Z+7 ; 0x07 257e4: 41 15 cp r20, r1 257e6: 51 05 cpc r21, r1 257e8: 61 05 cpc r22, r1 257ea: 71 05 cpc r23, r1 257ec: 39 f0 breq .+14 ; 0x257fc // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 257ee: 97 01 movw r18, r14 257f0: 86 01 movw r16, r12 257f2: c4 01 movw r24, r8 257f4: 0f 94 4c 28 call 0x25098 ; 0x25098 257f8: 88 23 and r24, r24 257fa: a9 f2 breq .-86 ; 0x257a6 } // return first cluster number to caller *curCluster = bgnCluster; 257fc: d5 01 movw r26, r10 257fe: 14 96 adiw r26, 0x04 ; 4 25800: cd 92 st X+, r12 25802: dd 92 st X+, r13 25804: ed 92 st X+, r14 25806: fc 92 st X, r15 25808: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2580a: 33 20 and r3, r3 2580c: 51 f0 breq .+20 ; 0x25822 2580e: d7 01 movw r26, r14 25810: c6 01 movw r24, r12 25812: 01 96 adiw r24, 0x01 ; 1 25814: a1 1d adc r26, r1 25816: b1 1d adc r27, r1 25818: f4 01 movw r30, r8 2581a: 80 83 st Z, r24 2581c: 91 83 std Z+1, r25 ; 0x01 2581e: a2 83 std Z+2, r26 ; 0x02 25820: 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) { 25822: f5 01 movw r30, r10 25824: 85 89 ldd r24, Z+21 ; 0x15 25826: 96 89 ldd r25, Z+22 ; 0x16 25828: a7 89 ldd r26, Z+23 ; 0x17 2582a: b0 8d ldd r27, Z+24 ; 0x18 2582c: 89 2b or r24, r25 2582e: 8a 2b or r24, r26 25830: 8b 2b or r24, r27 25832: 09 f0 breq .+2 ; 0x25836 25834: b9 cf rjmp .-142 ; 0x257a8 firstCluster_ = curCluster_; 25836: c5 8a std Z+21, r12 ; 0x15 25838: d6 8a std Z+22, r13 ; 0x16 2583a: e7 8a std Z+23, r14 ; 0x17 2583c: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2583e: 81 81 ldd r24, Z+1 ; 0x01 25840: 80 68 ori r24, 0x80 ; 128 25842: 81 83 std Z+1, r24 ; 0x01 25844: b1 cf rjmp .-158 ; 0x257a8 00025846 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 25846: cf 93 push r28 25848: df 93 push r29 2584a: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2584c: 46 2f mov r20, r22 2584e: 41 70 andi r20, 0x01 ; 1 25850: 6c 85 ldd r22, Y+12 ; 0x0c 25852: 7d 85 ldd r23, Y+13 ; 0x0d 25854: 8e 85 ldd r24, Y+14 ; 0x0e 25856: 9f 85 ldd r25, Y+15 ; 0x0f 25858: 0f 94 0f 28 call 0x2501e ; 0x2501e 2585c: 88 23 and r24, r24 2585e: 51 f0 breq .+20 ; 0x25874 return vol_->cache()->dir + dirIndex_; 25860: 88 89 ldd r24, Y+16 ; 0x10 25862: 20 e2 ldi r18, 0x20 ; 32 25864: 82 9f mul r24, r18 25866: c0 01 movw r24, r0 25868: 11 24 eor r1, r1 2586a: 8a 5b subi r24, 0xBA ; 186 2586c: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 2586e: df 91 pop r29 25870: cf 91 pop r28 25872: 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; 25874: 90 e0 ldi r25, 0x00 ; 0 25876: 80 e0 ldi r24, 0x00 ; 0 25878: fa cf rjmp .-12 ; 0x2586e 0002587a : * \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() { 2587a: cf 93 push r28 2587c: df 93 push r29 2587e: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 25880: 8b 81 ldd r24, Y+3 ; 0x03 25882: 88 23 and r24, r24 25884: 49 f1 breq .+82 ; 0x258d8 if (flags_ & F_FILE_DIR_DIRTY) { 25886: 89 81 ldd r24, Y+1 ; 0x01 25888: 87 ff sbrs r24, 7 2588a: 22 c0 rjmp .+68 ; 0x258d0 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2588c: 61 e0 ldi r22, 0x01 ; 1 2588e: ce 01 movw r24, r28 25890: 0f 94 23 2c call 0x25846 ; 0x25846 25894: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 25896: 89 2b or r24, r25 25898: f9 f0 breq .+62 ; 0x258d8 2589a: 80 81 ld r24, Z 2589c: 85 3e cpi r24, 0xE5 ; 229 2589e: e1 f0 breq .+56 ; 0x258d8 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 258a0: 8b 81 ldd r24, Y+3 ; 0x03 258a2: 82 30 cpi r24, 0x02 ; 2 258a4: 40 f4 brcc .+16 ; 0x258b6 258a6: 89 89 ldd r24, Y+17 ; 0x11 258a8: 9a 89 ldd r25, Y+18 ; 0x12 258aa: ab 89 ldd r26, Y+19 ; 0x13 258ac: bc 89 ldd r27, Y+20 ; 0x14 258ae: 84 8f std Z+28, r24 ; 0x1c 258b0: 95 8f std Z+29, r25 ; 0x1d 258b2: a6 8f std Z+30, r26 ; 0x1e 258b4: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 258b6: 8d 89 ldd r24, Y+21 ; 0x15 258b8: 9e 89 ldd r25, Y+22 ; 0x16 258ba: 93 8f std Z+27, r25 ; 0x1b 258bc: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 258be: 8d 89 ldd r24, Y+21 ; 0x15 258c0: 9e 89 ldd r25, Y+22 ; 0x16 258c2: af 89 ldd r26, Y+23 ; 0x17 258c4: b8 8d ldd r27, Y+24 ; 0x18 258c6: b5 8b std Z+21, r27 ; 0x15 258c8: 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; 258ca: 89 81 ldd r24, Y+1 ; 0x01 258cc: 8f 77 andi r24, 0x7F ; 127 258ce: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 258d0: df 91 pop r29 258d2: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 258d4: 0d 94 17 27 jmp 0x24e2e ; 0x24e2e fail: writeError = true; 258d8: 81 e0 ldi r24, 0x01 ; 1 258da: 88 83 st Y, r24 return false; } 258dc: 80 e0 ldi r24, 0x00 ; 0 258de: df 91 pop r29 258e0: cf 91 pop r28 258e2: 08 95 ret 000258e4 : * * \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() { 258e4: cf 93 push r28 258e6: df 93 push r29 258e8: ec 01 movw r28, r24 bool rtn = sync(); 258ea: 0f 94 3d 2c call 0x2587a ; 0x2587a type_ = FAT_FILE_TYPE_CLOSED; 258ee: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 258f0: df 91 pop r29 258f2: cf 91 pop r28 258f4: 08 95 ret 000258f6 : * \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) { 258f6: cf 93 push r28 258f8: df 93 push r29 258fa: eb 01 movw r28, r22 258fc: fc 01 movw r30, r24 258fe: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 25900: 21 11 cpse r18, r1 25902: 04 c0 rjmp .+8 ; 0x2590c 25904: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 25906: df 91 pop r29 25908: cf 91 pop r28 2590a: 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; 2590c: 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()) { 2590e: 22 30 cpi r18, 0x02 ; 2 25910: 28 f4 brcc .+10 ; 0x2591c name[0] = '/'; 25912: 8f e2 ldi r24, 0x2F ; 47 25914: 88 83 st Y, r24 name[1] = '\0'; 25916: 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; 25918: 81 e0 ldi r24, 0x01 ; 1 2591a: f5 cf rjmp .-22 ; 0x25906 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2591c: 60 e0 ldi r22, 0x00 ; 0 2591e: 0f 94 23 2c call 0x25846 ; 0x25846 if (!p) return false; 25922: 00 97 sbiw r24, 0x00 ; 0 25924: 79 f3 breq .-34 ; 0x25904 25926: 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; 25928: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2592a: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2592c: 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; 2592e: 2d 91 ld r18, X+ 25930: 20 32 cpi r18, 0x20 ; 32 25932: 99 f0 breq .+38 ; 0x2595a if (i == 8) name[j++] = '.'; 25934: 88 30 cpi r24, 0x08 ; 8 25936: 31 f4 brne .+12 ; 0x25944 25938: 9e 01 movw r18, r28 2593a: 26 0f add r18, r22 2593c: 31 1d adc r19, r1 2593e: f9 01 movw r30, r18 25940: 90 83 st Z, r25 25942: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 25944: 9e 01 movw r18, r28 25946: 26 0f add r18, r22 25948: 31 1d adc r19, r1 2594a: ad 01 movw r20, r26 2594c: 41 50 subi r20, 0x01 ; 1 2594e: 51 09 sbc r21, r1 25950: fa 01 movw r30, r20 25952: 40 81 ld r20, Z 25954: f9 01 movw r30, r18 25956: 40 83 st Z, r20 25958: 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++) { 2595a: 8f 5f subi r24, 0xFF ; 255 2595c: 8b 30 cpi r24, 0x0B ; 11 2595e: 39 f7 brne .-50 ; 0x2592e if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 25960: fe 01 movw r30, r28 25962: e6 0f add r30, r22 25964: f1 1d adc r31, r1 25966: 10 82 st Z, r1 25968: d7 cf rjmp .-82 ; 0x25918 0002596a : * 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) { 2596a: 2f 92 push r2 2596c: 3f 92 push r3 2596e: 4f 92 push r4 25970: 5f 92 push r5 25972: 6f 92 push r6 25974: 7f 92 push r7 25976: 8f 92 push r8 25978: 9f 92 push r9 2597a: af 92 push r10 2597c: bf 92 push r11 2597e: cf 92 push r12 25980: df 92 push r13 25982: ef 92 push r14 25984: ff 92 push r15 25986: 0f 93 push r16 25988: 1f 93 push r17 2598a: cf 93 push r28 2598c: df 93 push r29 2598e: 00 d0 rcall .+0 ; 0x25990 25990: 1f 92 push r1 25992: cd b7 in r28, 0x3d ; 61 25994: de b7 in r29, 0x3e ; 62 25996: 9c 83 std Y+4, r25 ; 0x04 25998: 8b 83 std Y+3, r24 ; 0x03 2599a: 4b 01 movw r8, r22 2599c: 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; 2599e: dc 01 movw r26, r24 259a0: 13 96 adiw r26, 0x03 ; 3 259a2: 8c 91 ld r24, X 259a4: 81 11 cpse r24, r1 259a6: 19 c0 rjmp .+50 ; 0x259da toRead -= n; } return nbyte; fail: return -1; 259a8: 8f ef ldi r24, 0xFF ; 255 259aa: 9f ef ldi r25, 0xFF ; 255 } 259ac: 0f 90 pop r0 259ae: 0f 90 pop r0 259b0: 0f 90 pop r0 259b2: 0f 90 pop r0 259b4: df 91 pop r29 259b6: cf 91 pop r28 259b8: 1f 91 pop r17 259ba: 0f 91 pop r16 259bc: ff 90 pop r15 259be: ef 90 pop r14 259c0: df 90 pop r13 259c2: cf 90 pop r12 259c4: bf 90 pop r11 259c6: af 90 pop r10 259c8: 9f 90 pop r9 259ca: 8f 90 pop r8 259cc: 7f 90 pop r7 259ce: 6f 90 pop r6 259d0: 5f 90 pop r5 259d2: 4f 90 pop r4 259d4: 3f 90 pop r3 259d6: 2f 90 pop r2 259d8: 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; 259da: eb 81 ldd r30, Y+3 ; 0x03 259dc: fc 81 ldd r31, Y+4 ; 0x04 259de: 81 81 ldd r24, Z+1 ; 0x01 259e0: 80 ff sbrs r24, 0 259e2: e2 cf rjmp .-60 ; 0x259a8 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 259e4: 01 89 ldd r16, Z+17 ; 0x11 259e6: 12 89 ldd r17, Z+18 ; 0x12 259e8: 23 89 ldd r18, Z+19 ; 0x13 259ea: 34 89 ldd r19, Z+20 ; 0x14 259ec: 40 85 ldd r20, Z+8 ; 0x08 259ee: 51 85 ldd r21, Z+9 ; 0x09 259f0: 62 85 ldd r22, Z+10 ; 0x0a 259f2: 73 85 ldd r23, Z+11 ; 0x0b 259f4: c7 01 movw r24, r14 259f6: b0 e0 ldi r27, 0x00 ; 0 259f8: a0 e0 ldi r26, 0x00 ; 0 259fa: 28 01 movw r4, r16 259fc: 39 01 movw r6, r18 259fe: 44 1a sub r4, r20 25a00: 55 0a sbc r5, r21 25a02: 66 0a sbc r6, r22 25a04: 77 0a sbc r7, r23 25a06: 84 15 cp r24, r4 25a08: 95 05 cpc r25, r5 25a0a: a6 05 cpc r26, r6 25a0c: b7 05 cpc r27, r7 25a0e: 18 f0 brcs .+6 ; 0x25a16 nbyte = fileSize_ - curPosition_; 25a10: 78 01 movw r14, r16 25a12: e4 1a sub r14, r20 25a14: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 25a16: 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; 25a18: 8b 81 ldd r24, Y+3 ; 0x03 25a1a: 9c 81 ldd r25, Y+4 ; 0x04 25a1c: 04 96 adiw r24, 0x04 ; 4 25a1e: 9a 83 std Y+2, r25 ; 0x02 25a20: 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; 25a22: 61 2c mov r6, r1 25a24: 32 e0 ldi r19, 0x02 ; 2 25a26: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 25a28: c1 14 cp r12, r1 25a2a: d1 04 cpc r13, r1 25a2c: 09 f4 brne .+2 ; 0x25a30 25a2e: b7 c0 rjmp .+366 ; 0x25b9e offset = curPosition_ & 0X1FF; // offset in block 25a30: ab 81 ldd r26, Y+3 ; 0x03 25a32: bc 81 ldd r27, Y+4 ; 0x04 25a34: 18 96 adiw r26, 0x08 ; 8 25a36: 4d 91 ld r20, X+ 25a38: 5d 91 ld r21, X+ 25a3a: 6d 91 ld r22, X+ 25a3c: 7c 91 ld r23, X 25a3e: 1b 97 sbiw r26, 0x0b ; 11 25a40: 5a 01 movw r10, r20 25a42: b1 e0 ldi r27, 0x01 ; 1 25a44: bb 22 and r11, r27 25a46: eb 81 ldd r30, Y+3 ; 0x03 25a48: fc 81 ldd r31, Y+4 ; 0x04 25a4a: 81 8d ldd r24, Z+25 ; 0x19 25a4c: 92 8d ldd r25, Z+26 ; 0x1a 25a4e: 1a 01 movw r2, r20 25a50: 2b 01 movw r4, r22 25a52: 29 e0 ldi r18, 0x09 ; 9 25a54: 56 94 lsr r5 25a56: 47 94 ror r4 25a58: 37 94 ror r3 25a5a: 27 94 ror r2 25a5c: 2a 95 dec r18 25a5e: d1 f7 brne .-12 ; 0x25a54 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 25a60: 23 81 ldd r18, Z+3 ; 0x03 25a62: 22 30 cpi r18, 0x02 ; 2 25a64: 91 f5 brne .+100 ; 0x25aca block = vol_->rootDirStart() + (curPosition_ >> 9); 25a66: dc 01 movw r26, r24 25a68: 5a 96 adiw r26, 0x1a ; 26 25a6a: 6d 91 ld r22, X+ 25a6c: 7d 91 ld r23, X+ 25a6e: 8d 91 ld r24, X+ 25a70: 9c 91 ld r25, X 25a72: 5d 97 sbiw r26, 0x1d ; 29 25a74: 62 0d add r22, r2 25a76: 73 1d adc r23, r3 25a78: 84 1d adc r24, r4 25a7a: 95 1d adc r25, r5 25a7c: 83 01 movw r16, r6 25a7e: 0a 19 sub r16, r10 25a80: 1b 09 sbc r17, r11 25a82: c0 16 cp r12, r16 25a84: d1 06 cpc r13, r17 25a86: 08 f4 brcc .+2 ; 0x25a8a 25a88: 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()) { 25a8a: 01 15 cp r16, r1 25a8c: b2 e0 ldi r27, 0x02 ; 2 25a8e: 1b 07 cpc r17, r27 25a90: 71 f4 brne .+28 ; 0x25aae 25a92: 20 91 3a 0e lds r18, 0x0E3A ; 0x800e3a 25a96: 30 91 3b 0e lds r19, 0x0E3B ; 0x800e3b 25a9a: 40 91 3c 0e lds r20, 0x0E3C ; 0x800e3c 25a9e: 50 91 3d 0e lds r21, 0x0E3D ; 0x800e3d 25aa2: 62 17 cp r22, r18 25aa4: 73 07 cpc r23, r19 25aa6: 84 07 cpc r24, r20 25aa8: 95 07 cpc r25, r21 25aaa: 09 f0 breq .+2 ; 0x25aae 25aac: 59 c0 rjmp .+178 ; 0x25b60 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; 25aae: 40 e0 ldi r20, 0x00 ; 0 25ab0: 0f 94 0f 28 call 0x2501e ; 0x2501e 25ab4: 88 23 and r24, r24 25ab6: 09 f4 brne .+2 ; 0x25aba 25ab8: 77 cf rjmp .-274 ; 0x259a8 uint8_t* src = vol_->cache()->data + offset; 25aba: b5 01 movw r22, r10 25abc: 6a 5b subi r22, 0xBA ; 186 25abe: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 25ac0: a8 01 movw r20, r16 25ac2: c4 01 movw r24, r8 25ac4: 0f 94 c6 a9 call 0x3538c ; 0x3538c 25ac8: 57 c0 rjmp .+174 ; 0x25b78 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);} 25aca: fc 01 movw r30, r24 25acc: 14 81 ldd r17, Z+4 ; 0x04 25ace: 11 50 subi r17, 0x01 ; 1 25ad0: 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) { 25ad2: a1 14 cp r10, r1 25ad4: b1 04 cpc r11, r1 25ad6: 81 f4 brne .+32 ; 0x25af8 25ad8: 11 11 cpse r17, r1 25ada: 0e c0 rjmp .+28 ; 0x25af8 // start of new cluster if (curPosition_ == 0) { 25adc: 45 2b or r20, r21 25ade: 46 2b or r20, r22 25ae0: 47 2b or r20, r23 25ae2: 79 f5 brne .+94 ; 0x25b42 // use first cluster in file curCluster_ = firstCluster_; 25ae4: eb 81 ldd r30, Y+3 ; 0x03 25ae6: fc 81 ldd r31, Y+4 ; 0x04 25ae8: 85 89 ldd r24, Z+21 ; 0x15 25aea: 96 89 ldd r25, Z+22 ; 0x16 25aec: a7 89 ldd r26, Z+23 ; 0x17 25aee: b0 8d ldd r27, Z+24 ; 0x18 25af0: 84 83 std Z+4, r24 ; 0x04 25af2: 95 83 std Z+5, r25 ; 0x05 25af4: a6 83 std Z+6, r26 ; 0x06 25af6: 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; 25af8: ab 81 ldd r26, Y+3 ; 0x03 25afa: bc 81 ldd r27, Y+4 ; 0x04 25afc: 59 96 adiw r26, 0x19 ; 25 25afe: ed 91 ld r30, X+ 25b00: fc 91 ld r31, X 25b02: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 25b04: 14 96 adiw r26, 0x04 ; 4 25b06: 6d 91 ld r22, X+ 25b08: 7d 91 ld r23, X+ 25b0a: 8d 91 ld r24, X+ 25b0c: 9c 91 ld r25, X 25b0e: 17 97 sbiw r26, 0x07 ; 7 25b10: 62 50 subi r22, 0x02 ; 2 25b12: 71 09 sbc r23, r1 25b14: 81 09 sbc r24, r1 25b16: 91 09 sbc r25, r1 25b18: 25 85 ldd r18, Z+13 ; 0x0d 25b1a: 04 c0 rjmp .+8 ; 0x25b24 25b1c: 66 0f add r22, r22 25b1e: 77 1f adc r23, r23 25b20: 88 1f adc r24, r24 25b22: 99 1f adc r25, r25 25b24: 2a 95 dec r18 25b26: d2 f7 brpl .-12 ; 0x25b1c 25b28: 26 85 ldd r18, Z+14 ; 0x0e 25b2a: 37 85 ldd r19, Z+15 ; 0x0f 25b2c: 40 89 ldd r20, Z+16 ; 0x10 25b2e: 51 89 ldd r21, Z+17 ; 0x11 25b30: 62 0f add r22, r18 25b32: 73 1f adc r23, r19 25b34: 84 1f adc r24, r20 25b36: 95 1f adc r25, r21 25b38: 61 0f add r22, r17 25b3a: 71 1d adc r23, r1 25b3c: 81 1d adc r24, r1 25b3e: 91 1d adc r25, r1 25b40: 9d cf rjmp .-198 ; 0x25a7c if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 25b42: ab 81 ldd r26, Y+3 ; 0x03 25b44: bc 81 ldd r27, Y+4 ; 0x04 25b46: 14 96 adiw r26, 0x04 ; 4 25b48: 4d 91 ld r20, X+ 25b4a: 5d 91 ld r21, X+ 25b4c: 6d 91 ld r22, X+ 25b4e: 7c 91 ld r23, X 25b50: 17 97 sbiw r26, 0x07 ; 7 25b52: 29 81 ldd r18, Y+1 ; 0x01 25b54: 3a 81 ldd r19, Y+2 ; 0x02 25b56: 0f 94 de 28 call 0x251bc ; 0x251bc 25b5a: 81 11 cpse r24, r1 25b5c: cd cf rjmp .-102 ; 0x25af8 25b5e: 24 cf rjmp .-440 ; 0x259a8 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);} 25b60: 94 01 movw r18, r8 25b62: ab 01 movw r20, r22 25b64: bc 01 movw r22, r24 25b66: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 25b6a: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 25b6e: 0f 94 56 27 call 0x24eac ; 0x24eac // 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; 25b72: 88 23 and r24, r24 25b74: 09 f4 brne .+2 ; 0x25b78 25b76: 18 cf rjmp .-464 ; 0x259a8 // 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; 25b78: 80 0e add r8, r16 25b7a: 91 1e adc r9, r17 curPosition_ += n; 25b7c: eb 81 ldd r30, Y+3 ; 0x03 25b7e: fc 81 ldd r31, Y+4 ; 0x04 25b80: 80 85 ldd r24, Z+8 ; 0x08 25b82: 91 85 ldd r25, Z+9 ; 0x09 25b84: a2 85 ldd r26, Z+10 ; 0x0a 25b86: b3 85 ldd r27, Z+11 ; 0x0b 25b88: 80 0f add r24, r16 25b8a: 91 1f adc r25, r17 25b8c: a1 1d adc r26, r1 25b8e: b1 1d adc r27, r1 25b90: 80 87 std Z+8, r24 ; 0x08 25b92: 91 87 std Z+9, r25 ; 0x09 25b94: a2 87 std Z+10, r26 ; 0x0a 25b96: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 25b98: c0 1a sub r12, r16 25b9a: d1 0a sbc r13, r17 25b9c: 45 cf rjmp .-374 ; 0x25a28 } return nbyte; 25b9e: c7 01 movw r24, r14 25ba0: 05 cf rjmp .-502 ; 0x259ac 00025ba2 : * 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) { 25ba2: df 92 push r13 25ba4: ef 92 push r14 25ba6: ff 92 push r15 25ba8: 0f 93 push r16 25baa: 1f 93 push r17 25bac: cf 93 push r28 25bae: df 93 push r29 25bb0: 8c 01 movw r16, r24 25bb2: eb 01 movw r28, r22 25bb4: 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; 25bb6: 8d e0 ldi r24, 0x0D ; 13 25bb8: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 25bba: 40 e2 ldi r20, 0x20 ; 32 25bbc: 50 e0 ldi r21, 0x00 ; 0 25bbe: be 01 movw r22, r28 25bc0: c8 01 movw r24, r16 25bc2: 0f 94 b5 2c call 0x2596a ; 0x2596a if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 25bc6: 80 32 cpi r24, 0x20 ; 32 25bc8: 91 05 cpc r25, r1 25bca: 71 f0 breq .+28 ; 0x25be8 25bcc: 21 e0 ldi r18, 0x01 ; 1 25bce: 89 2b or r24, r25 25bd0: 09 f4 brne .+2 ; 0x25bd4 25bd2: 20 e0 ldi r18, 0x00 ; 0 25bd4: 82 2f mov r24, r18 25bd6: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 25bd8: df 91 pop r29 25bda: cf 91 pop r28 25bdc: 1f 91 pop r17 25bde: 0f 91 pop r16 25be0: ff 90 pop r15 25be2: ef 90 pop r14 25be4: df 90 pop r13 25be6: 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; 25be8: 28 81 ld r18, Y 25bea: 22 23 and r18, r18 25bec: 09 f4 brne .+2 ; 0x25bf0 25bee: 3f c0 rjmp .+126 ; 0x25c6e // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 25bf0: 25 3e cpi r18, 0xE5 ; 229 25bf2: 19 f3 breq .-58 ; 0x25bba 25bf4: 2e 32 cpi r18, 0x2E ; 46 25bf6: 09 f3 breq .-62 ; 0x25bba //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) 25bf8: 3b 85 ldd r19, Y+11 ; 0x0b 25bfa: 3f 73 andi r19, 0x3F ; 63 25bfc: 3f 30 cpi r19, 0x0F ; 15 25bfe: 99 f5 brne .+102 ; 0x25c66 25c00: e1 14 cp r14, r1 25c02: f1 04 cpc r15, r1 25c04: 81 f1 breq .+96 ; 0x25c66 { 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) 25c06: 4a 8d ldd r20, Y+26 ; 0x1a 25c08: 5b 8d ldd r21, Y+27 ; 0x1b 25c0a: 45 2b or r20, r21 25c0c: 61 f5 brne .+88 ; 0x25c66 25c0e: 2f 71 andi r18, 0x1F ; 31 25c10: 3f ef ldi r19, 0xFF ; 255 25c12: 32 0f add r19, r18 25c14: 34 30 cpi r19, 0x04 ; 4 25c16: 38 f5 brcc .+78 ; 0x25c66 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 25c18: 21 50 subi r18, 0x01 ; 1 25c1a: 33 0b sbc r19, r19 25c1c: d2 9e mul r13, r18 25c1e: c0 01 movw r24, r0 25c20: d3 9e mul r13, r19 25c22: 90 0d add r25, r0 25c24: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 25c26: f7 01 movw r30, r14 25c28: e8 0f add r30, r24 25c2a: f9 1f adc r31, r25 25c2c: 29 81 ldd r18, Y+1 ; 0x01 25c2e: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 25c30: 2b 81 ldd r18, Y+3 ; 0x03 25c32: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 25c34: 2d 81 ldd r18, Y+5 ; 0x05 25c36: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 25c38: 2f 81 ldd r18, Y+7 ; 0x07 25c3a: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 25c3c: 29 85 ldd r18, Y+9 ; 0x09 25c3e: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 25c40: 2e 85 ldd r18, Y+14 ; 0x0e 25c42: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 25c44: 28 89 ldd r18, Y+16 ; 0x10 25c46: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 25c48: 2a 89 ldd r18, Y+18 ; 0x12 25c4a: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 25c4c: 2c 89 ldd r18, Y+20 ; 0x14 25c4e: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 25c50: 2e 89 ldd r18, Y+22 ; 0x16 25c52: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 25c54: 28 8d ldd r18, Y+24 ; 0x18 25c56: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 25c58: 2c 8d ldd r18, Y+28 ; 0x1c 25c5a: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 25c5c: 2e 8d ldd r18, Y+30 ; 0x1e 25c5e: 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) 25c60: 28 81 ld r18, Y 25c62: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 25c64: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 25c66: 2b 85 ldd r18, Y+11 ; 0x0b 25c68: 23 fd sbrc r18, 3 25c6a: a7 cf rjmp .-178 ; 0x25bba 25c6c: b5 cf rjmp .-150 ; 0x25bd8 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; 25c6e: 80 e0 ldi r24, 0x00 ; 0 25c70: b3 cf rjmp .-154 ; 0x25bd8 00025c72 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 25c72: 4f 92 push r4 25c74: 5f 92 push r5 25c76: 6f 92 push r6 25c78: 7f 92 push r7 25c7a: af 92 push r10 25c7c: bf 92 push r11 25c7e: cf 92 push r12 25c80: df 92 push r13 25c82: ef 92 push r14 25c84: ff 92 push r15 25c86: 0f 93 push r16 25c88: 1f 93 push r17 25c8a: cf 93 push r28 25c8c: df 93 push r29 25c8e: 1f 92 push r1 25c90: cd b7 in r28, 0x3d ; 61 25c92: de b7 in r29, 0x3e ; 62 25c94: 8c 01 movw r16, r24 25c96: 7b 01 movw r14, r22 25c98: 5a 01 movw r10, r20 25c9a: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 25c9c: db 01 movw r26, r22 25c9e: 59 96 adiw r26, 0x19 ; 25 25ca0: 8d 91 ld r24, X+ 25ca2: 9c 91 ld r25, X 25ca4: f8 01 movw r30, r16 25ca6: 92 8f std Z+26, r25 ; 0x1a 25ca8: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 25caa: cb 01 movw r24, r22 25cac: 0e 94 76 79 call 0xf2ec ; 0xf2ec } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 25cb0: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 25cb2: f7 01 movw r30, r14 25cb4: 80 85 ldd r24, Z+8 ; 0x08 25cb6: 91 85 ldd r25, Z+9 ; 0x09 25cb8: a2 85 ldd r26, Z+10 ; 0x0a 25cba: b3 85 ldd r27, Z+11 ; 0x0b 25cbc: 41 89 ldd r20, Z+17 ; 0x11 25cbe: 52 89 ldd r21, Z+18 ; 0x12 25cc0: 63 89 ldd r22, Z+19 ; 0x13 25cc2: 74 89 ldd r23, Z+20 ; 0x14 25cc4: 84 17 cp r24, r20 25cc6: 95 07 cpc r25, r21 25cc8: a6 07 cpc r26, r22 25cca: b7 07 cpc r27, r23 25ccc: 08 f0 brcs .+2 ; 0x25cd0 25cce: 52 c0 rjmp .+164 ; 0x25d74 index = 0XF & (dirFile->curPosition_ >> 5); 25cd0: 55 e0 ldi r21, 0x05 ; 5 25cd2: b6 95 lsr r27 25cd4: a7 95 ror r26 25cd6: 97 95 ror r25 25cd8: 87 95 ror r24 25cda: 5a 95 dec r21 25cdc: d1 f7 brne .-12 ; 0x25cd2 25cde: f8 2f mov r31, r24 25ce0: ff 70 andi r31, 0x0F ; 15 25ce2: 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; 25ce4: d7 01 movw r26, r14 25ce6: 13 96 adiw r26, 0x03 ; 3 25ce8: 8c 91 ld r24, X 25cea: 82 30 cpi r24, 0x02 ; 2 25cec: 10 f4 brcc .+4 ; 0x25cf2 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 25cee: 80 e0 ldi r24, 0x00 ; 0 25cf0: db c0 rjmp .+438 ; 0x25ea8 * \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; 25cf2: 41 e0 ldi r20, 0x01 ; 1 25cf4: 50 e0 ldi r21, 0x00 ; 0 25cf6: be 01 movw r22, r28 25cf8: 6f 5f subi r22, 0xFF ; 255 25cfa: 7f 4f sbci r23, 0xFF ; 255 25cfc: c7 01 movw r24, r14 25cfe: 0f 94 b5 2c call 0x2596a ; 0x2596a 25d02: 01 97 sbiw r24, 0x01 ; 1 25d04: a1 f7 brne .-24 ; 0x25cee // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 25d06: f7 01 movw r30, r14 25d08: 80 85 ldd r24, Z+8 ; 0x08 25d0a: 91 85 ldd r25, Z+9 ; 0x09 25d0c: a2 85 ldd r26, Z+10 ; 0x0a 25d0e: b3 85 ldd r27, Z+11 ; 0x0b 25d10: 4f 96 adiw r24, 0x1f ; 31 25d12: a1 1d adc r26, r1 25d14: b1 1d adc r27, r1 25d16: 80 87 std Z+8, r24 ; 0x08 25d18: 91 87 std Z+9, r25 ; 0x09 25d1a: a2 87 std Z+10, r26 ; 0x0a 25d1c: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 25d1e: f0 e2 ldi r31, 0x20 ; 32 25d20: df 9e mul r13, r31 25d22: b0 01 movw r22, r0 25d24: 11 24 eor r1, r1 25d26: 6a 5b subi r22, 0xBA ; 186 25d28: 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; 25d2a: 61 15 cp r22, r1 25d2c: 71 05 cpc r23, r1 25d2e: f9 f2 breq .-66 ; 0x25cee if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 25d30: db 01 movw r26, r22 25d32: 8c 91 ld r24, X 25d34: 88 23 and r24, r24 25d36: 41 f0 breq .+16 ; 0x25d48 25d38: 85 3e cpi r24, 0xE5 ; 229 25d3a: 09 f0 breq .+2 ; 0x25d3e 25d3c: 4c c0 rjmp .+152 ; 0x25dd6 // remember first empty slot if (!emptyFound) { 25d3e: 77 20 and r7, r7 25d40: 29 f0 breq .+10 ; 0x25d4c return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 25d42: 77 24 eor r7, r7 25d44: 73 94 inc r7 25d46: b5 cf rjmp .-150 ; 0x25cb2 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) { 25d48: 71 10 cpse r7, r1 25d4a: 0e c0 rjmp .+28 ; 0x25d68 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 25d4c: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 25d50: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 25d54: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 25d58: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 25d5c: f8 01 movw r30, r16 25d5e: 84 87 std Z+12, r24 ; 0x0c 25d60: 95 87 std Z+13, r25 ; 0x0d 25d62: a6 87 std Z+14, r26 ; 0x0e 25d64: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 25d66: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 25d68: db 01 movw r26, r22 25d6a: 8c 91 ld r24, X 25d6c: 81 11 cpse r24, r1 25d6e: e9 cf rjmp .-46 ; 0x25d42 25d70: 77 24 eor r7, r7 25d72: 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; 25d74: 8c 2d mov r24, r12 25d76: 82 74 andi r24, 0x42 ; 66 25d78: 82 34 cpi r24, 0x42 ; 66 25d7a: 09 f0 breq .+2 ; 0x25d7e 25d7c: b8 cf rjmp .-144 ; 0x25cee if (emptyFound) { 25d7e: 77 20 and r7, r7 25d80: 09 f4 brne .+2 ; 0x25d84 25d82: a2 c0 rjmp .+324 ; 0x25ec8 index = dirIndex_; 25d84: f8 01 movw r30, r16 25d86: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 25d88: 61 e0 ldi r22, 0x01 ; 1 25d8a: c8 01 movw r24, r16 25d8c: 0f 94 23 2c call 0x25846 ; 0x25846 if (!p) goto fail; 25d90: 00 97 sbiw r24, 0x00 ; 0 25d92: 09 f4 brne .+2 ; 0x25d96 25d94: ac cf rjmp .-168 ; 0x25cee // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 25d96: 20 e2 ldi r18, 0x20 ; 32 25d98: dc 01 movw r26, r24 25d9a: 1d 92 st X+, r1 25d9c: 2a 95 dec r18 25d9e: e9 f7 brne .-6 ; 0x25d9a memcpy(p->name, dname, 11); 25da0: 2b e0 ldi r18, 0x0B ; 11 25da2: f5 01 movw r30, r10 25da4: dc 01 movw r26, r24 25da6: 01 90 ld r0, Z+ 25da8: 0d 92 st X+, r0 25daa: 2a 95 dec r18 25dac: e1 f7 brne .-8 ; 0x25da6 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 25dae: 21 e2 ldi r18, 0x21 ; 33 25db0: 38 e2 ldi r19, 0x28 ; 40 25db2: fc 01 movw r30, r24 25db4: 31 8b std Z+17, r19 ; 0x11 25db6: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 25db8: 40 e0 ldi r20, 0x00 ; 0 25dba: 58 e0 ldi r21, 0x08 ; 8 25dbc: 57 87 std Z+15, r21 ; 0x0f 25dbe: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 25dc0: 33 8b std Z+19, r19 ; 0x13 25dc2: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 25dc4: 31 8f std Z+25, r19 ; 0x19 25dc6: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 25dc8: 57 8b std Z+23, r21 ; 0x17 25dca: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 25dcc: 0f 94 17 27 call 0x24e2e ; 0x24e2e 25dd0: 81 11 cpse r24, r1 25dd2: 09 c0 rjmp .+18 ; 0x25de6 25dd4: 8c cf rjmp .-232 ; 0x25cee dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 25dd6: 4b e0 ldi r20, 0x0B ; 11 25dd8: 50 e0 ldi r21, 0x00 ; 0 25dda: c5 01 movw r24, r10 25ddc: 0f 94 b9 a9 call 0x35372 ; 0x35372 25de0: 89 2b or r24, r25 25de2: 09 f0 breq .+2 ; 0x25de6 25de4: 66 cf rjmp .-308 ; 0x25cb2 } //------------------------------------------------------------------------------ // 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]; 25de6: f0 e2 ldi r31, 0x20 ; 32 25de8: df 9e mul r13, r31 25dea: d0 01 movw r26, r0 25dec: 11 24 eor r1, r1 25dee: 9d 01 movw r18, r26 25df0: 2a 5b subi r18, 0xBA ; 186 25df2: 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)) { 25df4: f9 01 movw r30, r18 25df6: 83 85 ldd r24, Z+11 ; 0x0b 25df8: 81 71 andi r24, 0x11 ; 17 25dfa: 21 f0 breq .+8 ; 0x25e04 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 25dfc: 8c 2d mov r24, r12 25dfe: 82 71 andi r24, 0x12 ; 18 25e00: 09 f0 breq .+2 ; 0x25e04 25e02: fc c0 rjmp .+504 ; 0x25ffc } //------------------------------------------------------------------------------ // 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]; 25e04: f8 01 movw r30, r16 25e06: 81 8d ldd r24, Z+25 ; 0x19 25e08: 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(); 25e0a: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 25e0e: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 25e12: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 25e16: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 25e1a: 44 87 std Z+12, r20 ; 0x0c 25e1c: 55 87 std Z+13, r21 ; 0x0d 25e1e: 66 87 std Z+14, r22 ; 0x0e 25e20: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 25e22: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 25e24: fd 01 movw r30, r26 25e26: ea 5b subi r30, 0xBA ; 186 25e28: f1 4f sbci r31, 0xF1 ; 241 25e2a: 44 88 ldd r4, Z+20 ; 0x14 25e2c: 55 88 ldd r5, Z+21 ; 0x15 25e2e: 71 2c mov r7, r1 25e30: 61 2c mov r6, r1 25e32: 32 01 movw r6, r4 25e34: 55 24 eor r5, r5 25e36: 44 24 eor r4, r4 25e38: d8 01 movw r26, r16 25e3a: 55 96 adiw r26, 0x15 ; 21 25e3c: 4d 92 st X+, r4 25e3e: 5d 92 st X+, r5 25e40: 6d 92 st X+, r6 25e42: 7c 92 st X, r7 25e44: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 25e46: 42 8d ldd r20, Z+26 ; 0x1a 25e48: 53 8d ldd r21, Z+27 ; 0x1b 25e4a: 70 e0 ldi r23, 0x00 ; 0 25e4c: 60 e0 ldi r22, 0x00 ; 0 25e4e: 44 29 or r20, r4 25e50: 55 29 or r21, r5 25e52: 66 29 or r22, r6 25e54: 77 29 or r23, r7 25e56: 55 96 adiw r26, 0x15 ; 21 25e58: 4d 93 st X+, r20 25e5a: 5d 93 st X+, r21 25e5c: 6d 93 st X+, r22 25e5e: 7c 93 st X, r23 25e60: 58 97 sbiw r26, 0x18 ; 24 25e62: d9 01 movw r26, r18 25e64: 1b 96 adiw r26, 0x0b ; 11 25e66: 2c 91 ld r18, X 25e68: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 25e6a: 09 f0 breq .+2 ; 0x25e6e 25e6c: b9 c0 rjmp .+370 ; 0x25fe0 fileSize_ = p->fileSize; 25e6e: 84 8d ldd r24, Z+28 ; 0x1c 25e70: 95 8d ldd r25, Z+29 ; 0x1d 25e72: a6 8d ldd r26, Z+30 ; 0x1e 25e74: b7 8d ldd r27, Z+31 ; 0x1f 25e76: f8 01 movw r30, r16 25e78: 81 8b std Z+17, r24 ; 0x11 25e7a: 92 8b std Z+18, r25 ; 0x12 25e7c: a3 8b std Z+19, r26 ; 0x13 25e7e: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 25e80: 81 e0 ldi r24, 0x01 ; 1 25e82: 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; 25e84: 8c 2d mov r24, r12 25e86: 8f 70 andi r24, 0x0F ; 15 25e88: f8 01 movw r30, r16 25e8a: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 25e8c: 14 82 std Z+4, r1 ; 0x04 25e8e: 15 82 std Z+5, r1 ; 0x05 25e90: 16 82 std Z+6, r1 ; 0x06 25e92: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 25e94: 10 86 std Z+8, r1 ; 0x08 25e96: 11 86 std Z+9, r1 ; 0x09 25e98: 12 86 std Z+10, r1 ; 0x0a 25e9a: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 25e9c: 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; 25e9e: c4 fe sbrs r12, 4 25ea0: 03 c0 rjmp .+6 ; 0x25ea8 25ea2: c8 01 movw r24, r16 25ea4: 0f 94 c9 68 call 0x2d192 ; 0x2d192 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 25ea8: 0f 90 pop r0 25eaa: df 91 pop r29 25eac: cf 91 pop r28 25eae: 1f 91 pop r17 25eb0: 0f 91 pop r16 25eb2: ff 90 pop r15 25eb4: ef 90 pop r14 25eb6: df 90 pop r13 25eb8: cf 90 pop r12 25eba: bf 90 pop r11 25ebc: af 90 pop r10 25ebe: 7f 90 pop r7 25ec0: 6f 90 pop r6 25ec2: 5f 90 pop r5 25ec4: 4f 90 pop r4 25ec6: 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; 25ec8: d7 01 movw r26, r14 25eca: 13 96 adiw r26, 0x03 ; 3 25ecc: 8c 91 ld r24, X 25ece: 13 97 sbiw r26, 0x03 ; 3 25ed0: 82 30 cpi r24, 0x02 ; 2 25ed2: 09 f4 brne .+2 ; 0x25ed6 25ed4: 0c cf rjmp .-488 ; 0x25cee // 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; 25ed6: 51 96 adiw r26, 0x11 ; 17 25ed8: 8d 91 ld r24, X+ 25eda: 9d 91 ld r25, X+ 25edc: 0d 90 ld r0, X+ 25ede: bc 91 ld r27, X 25ee0: a0 2d mov r26, r0 25ee2: 80 3e cpi r24, 0xE0 ; 224 25ee4: 9f 4f sbci r25, 0xFF ; 255 25ee6: af 41 sbci r26, 0x1F ; 31 25ee8: b1 05 cpc r27, r1 25eea: 08 f0 brcs .+2 ; 0x25eee 25eec: 00 cf rjmp .-512 ; 0x25cee if (!addCluster()) goto fail; 25eee: c7 01 movw r24, r14 25ef0: 0f 94 28 2b call 0x25650 ; 0x25650 25ef4: 88 23 and r24, r24 25ef6: 09 f4 brne .+2 ; 0x25efa 25ef8: fa ce rjmp .-524 ; 0x25cee if (!vol_->cacheFlush()) goto fail; 25efa: 0f 94 17 27 call 0x24e2e ; 0x24e2e 25efe: 88 23 and r24, r24 25f00: 09 f4 brne .+2 ; 0x25f04 25f02: f5 ce rjmp .-534 ; 0x25cee block = vol_->clusterStartBlock(curCluster_); 25f04: d7 01 movw r26, r14 25f06: 59 96 adiw r26, 0x19 ; 25 25f08: ed 91 ld r30, X+ 25f0a: fc 91 ld r31, X 25f0c: 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_);} 25f0e: 14 96 adiw r26, 0x04 ; 4 25f10: 4d 90 ld r4, X+ 25f12: 5d 90 ld r5, X+ 25f14: 6d 90 ld r6, X+ 25f16: 7c 90 ld r7, X 25f18: 17 97 sbiw r26, 0x07 ; 7 25f1a: b2 e0 ldi r27, 0x02 ; 2 25f1c: 4b 1a sub r4, r27 25f1e: 51 08 sbc r5, r1 25f20: 61 08 sbc r6, r1 25f22: 71 08 sbc r7, r1 25f24: 85 85 ldd r24, Z+13 ; 0x0d 25f26: 04 c0 rjmp .+8 ; 0x25f30 25f28: 44 0c add r4, r4 25f2a: 55 1c adc r5, r5 25f2c: 66 1c adc r6, r6 25f2e: 77 1c adc r7, r7 25f30: 8a 95 dec r24 25f32: d2 f7 brpl .-12 ; 0x25f28 25f34: 86 85 ldd r24, Z+14 ; 0x0e 25f36: 97 85 ldd r25, Z+15 ; 0x0f 25f38: a0 89 ldd r26, Z+16 ; 0x10 25f3a: b1 89 ldd r27, Z+17 ; 0x11 25f3c: 48 0e add r4, r24 25f3e: 59 1e adc r5, r25 25f40: 6a 1e adc r6, r26 25f42: 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; 25f44: 81 e0 ldi r24, 0x01 ; 1 25f46: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 cacheBlockNumber_ = blockNumber; 25f4a: 40 92 3a 0e sts 0x0E3A, r4 ; 0x800e3a 25f4e: 50 92 3b 0e sts 0x0E3B, r5 ; 0x800e3b 25f52: 60 92 3c 0e sts 0x0E3C, r6 ; 0x800e3c 25f56: 70 92 3d 0e sts 0x0E3D, r7 ; 0x800e3d // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 25f5a: e6 e4 ldi r30, 0x46 ; 70 25f5c: fe e0 ldi r31, 0x0E ; 14 25f5e: 80 e0 ldi r24, 0x00 ; 0 25f60: 92 e0 ldi r25, 0x02 ; 2 25f62: df 01 movw r26, r30 25f64: 9c 01 movw r18, r24 25f66: 1d 92 st X+, r1 25f68: 21 50 subi r18, 0x01 ; 1 25f6a: 30 40 sbci r19, 0x00 ; 0 25f6c: e1 f7 brne .-8 ; 0x25f66 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 25f6e: dd 24 eor r13, r13 25f70: d3 94 inc r13 25f72: d7 01 movw r26, r14 25f74: 59 96 adiw r26, 0x19 ; 25 25f76: ed 91 ld r30, X+ 25f78: fc 91 ld r31, X 25f7a: 84 81 ldd r24, Z+4 ; 0x04 25f7c: d8 16 cp r13, r24 25f7e: 98 f4 brcc .+38 ; 0x25fa6 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); 25f80: 26 e4 ldi r18, 0x46 ; 70 25f82: 3e e0 ldi r19, 0x0E ; 14 25f84: b3 01 movw r22, r6 25f86: a2 01 movw r20, r4 25f88: 4d 0d add r20, r13 25f8a: 51 1d adc r21, r1 25f8c: 61 1d adc r22, r1 25f8e: 71 1d adc r23, r1 25f90: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 25f94: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 25f98: 0f 94 b3 26 call 0x24d66 ; 0x24d66 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 25f9c: 88 23 and r24, r24 25f9e: 09 f4 brne .+2 ; 0x25fa2 25fa0: a6 ce rjmp .-692 ; 0x25cee // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 25fa2: d3 94 inc r13 25fa4: e6 cf rjmp .-52 ; 0x25f72 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 25fa6: 25 85 ldd r18, Z+13 ; 0x0d 25fa8: 80 e0 ldi r24, 0x00 ; 0 25faa: 92 e0 ldi r25, 0x02 ; 2 25fac: a0 e0 ldi r26, 0x00 ; 0 25fae: b0 e0 ldi r27, 0x00 ; 0 25fb0: 04 c0 rjmp .+8 ; 0x25fba 25fb2: 88 0f add r24, r24 25fb4: 99 1f adc r25, r25 25fb6: aa 1f adc r26, r26 25fb8: bb 1f adc r27, r27 25fba: 2a 95 dec r18 25fbc: d2 f7 brpl .-12 ; 0x25fb2 25fbe: f7 01 movw r30, r14 25fc0: 41 89 ldd r20, Z+17 ; 0x11 25fc2: 52 89 ldd r21, Z+18 ; 0x12 25fc4: 63 89 ldd r22, Z+19 ; 0x13 25fc6: 74 89 ldd r23, Z+20 ; 0x14 25fc8: 84 0f add r24, r20 25fca: 95 1f adc r25, r21 25fcc: a6 1f adc r26, r22 25fce: b7 1f adc r27, r23 25fd0: 81 8b std Z+17, r24 ; 0x11 25fd2: 92 8b std Z+18, r25 ; 0x12 25fd4: a3 8b std Z+19, r26 ; 0x13 25fd6: 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; 25fd8: 86 e4 ldi r24, 0x46 ; 70 25fda: 9e e0 ldi r25, 0x0E ; 14 index = 0; 25fdc: d1 2c mov r13, r1 25fde: db ce rjmp .-586 ; 0x25d96 // 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)) { 25fe0: 20 31 cpi r18, 0x10 ; 16 25fe2: 61 f4 brne .+24 ; 0x25ffc if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 25fe4: 98 01 movw r18, r16 25fe6: 2f 5e subi r18, 0xEF ; 239 25fe8: 3f 4f sbci r19, 0xFF ; 255 25fea: 0f 94 61 29 call 0x252c2 ; 0x252c2 25fee: 88 23 and r24, r24 25ff0: 29 f0 breq .+10 ; 0x25ffc type_ = FAT_FILE_TYPE_SUBDIR; 25ff2: 84 e0 ldi r24, 0x04 ; 4 25ff4: d8 01 movw r26, r16 25ff6: 13 96 adiw r26, 0x03 ; 3 25ff8: 8c 93 st X, r24 25ffa: 44 cf rjmp .-376 ; 0x25e84 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 25ffc: d8 01 movw r26, r16 25ffe: 13 96 adiw r26, 0x03 ; 3 26000: 1c 92 st X, r1 26002: 75 ce rjmp .-790 ; 0x25cee 00026004 : } } #endif //PRUSA_M28 void prusa_statistics(uint8_t _message) { 26004: cf 93 push r28 const uint8_t _fil_nr = 0; if (!farm_mode) 26006: 90 91 60 0d lds r25, 0x0D60 ; 0x800d60 2600a: 99 23 and r25, r25 2600c: 09 f4 brne .+2 ; 0x26010 2600e: f6 c0 rjmp .+492 ; 0x261fc 26010: c8 2f mov r28, r24 return; switch (_message) { 26012: 87 30 cpi r24, 0x07 ; 7 26014: 09 f4 brne .+2 ; 0x26018 26016: be c0 rjmp .+380 ; 0x26194 26018: 08 f0 brcs .+2 ; 0x2601c 2601a: 46 c0 rjmp .+140 ; 0x260a8 2601c: 83 30 cpi r24, 0x03 ; 3 2601e: 09 f4 brne .+2 ; 0x26022 26020: ed c0 rjmp .+474 ; 0x261fc 26022: 80 f5 brcc .+96 ; 0x26084 26024: 81 30 cpi r24, 0x01 ; 1 26026: 09 f4 brne .+2 ; 0x2602a 26028: 88 c0 rjmp .+272 ; 0x2613a 2602a: 08 f4 brcc .+2 ; 0x2602e 2602c: 60 c0 rjmp .+192 ; 0x260ee 2602e: 8b e7 ldi r24, 0x7B ; 123 26030: 0e 94 81 79 call 0xf302 ; 0xf302 farm_timer = 1; break; case 2: // heating done SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 26034: 83 e0 ldi r24, 0x03 ; 3 26036: 0f 94 35 06 call 0x20c6a ; 0x20c6a prusa_stat_farm_number(); 2603a: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 2603e: 8d e7 ldi r24, 0x7D ; 125 26040: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 26044: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_ECHOLN('}'); status_number = 3; 26048: c3 e0 ldi r28, 0x03 ; 3 2604a: c0 93 bd 04 sts 0x04BD, r28 ; 0x8004bd <_ZL13status_number.lto_priv.492> farm_timer = 1; 2604e: 81 e0 ldi r24, 0x01 ; 1 26050: 80 93 74 02 sts 0x0274, r24 ; 0x800274 if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 26054: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 26058: 81 11 cpse r24, r1 2605a: 05 c0 rjmp .+10 ; 0x26066 2605c: 80 91 94 03 lds r24, 0x0394 ; 0x800394 26060: 88 23 and r24, r24 26062: 09 f4 brne .+2 ; 0x26066 26064: 78 c0 rjmp .+240 ; 0x26156 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 26066: 8b e7 ldi r24, 0x7B ; 123 26068: 0e 94 81 79 call 0xf302 ; 0xf302 SERIAL_ECHO('{'); prusa_stat_printerstatus(4); 2606c: 84 e0 ldi r24, 0x04 ; 4 2606e: 0f 94 35 06 call 0x20c6a ; 0x20c6a prusa_stat_farm_number(); 26072: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 status_number = 4; 26076: 84 e0 ldi r24, 0x04 ; 4 26078: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.492> SERIAL_ECHO('{'); prusa_stat_printerstatus(3); prusa_stat_farm_number(); status_number = 3; } farm_timer = 1; 2607c: 81 e0 ldi r24, 0x01 ; 1 SERIAL_ECHOPGM("{[RES:1][FIL:"); MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; 2607e: 80 93 74 02 sts 0x0274, r24 ; 0x800274 26082: 1e c0 rjmp .+60 ; 0x260c0 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 26084: 85 30 cpi r24, 0x05 ; 5 26086: 09 f4 brne .+2 ; 0x2608a 26088: 71 c0 rjmp .+226 ; 0x2616c // must do a return here to prevent doing SERIAL_ECHOLN("}") at the very end of this function // saved a considerable amount of FLASH return; break; case 4: // print succesfull SERIAL_ECHOPGM("{[RES:1][FIL:"); 2608a: 8d e7 ldi r24, 0x7D ; 125 2608c: 99 e8 ldi r25, 0x89 ; 137 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 2608e: c6 30 cpi r28, 0x06 ; 6 26090: 08 f4 brcc .+2 ; 0x26094 26092: 6e c0 rjmp .+220 ; 0x26170 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 6: // print done SERIAL_ECHOPGM("{[PRN:8]"); 26094: 86 e6 ldi r24, 0x66 ; 102 26096: 99 e8 ldi r25, 0x89 ; 137 26098: 0e 94 94 7a call 0xf528 ; 0xf528 prusa_stat_farm_number(); 2609c: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 status_number = 8; 260a0: 88 e0 ldi r24, 0x08 ; 8 farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); prusa_stat_farm_number(); status_number = 9; 260a2: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.492> 260a6: 74 c0 rjmp .+232 ; 0x26190 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260a8: 86 31 cpi r24, 0x16 ; 22 260aa: 09 f4 brne .+2 ; 0x260ae 260ac: 9b c0 rjmp .+310 ; 0x261e4 260ae: 70 f4 brcc .+28 ; 0x260cc 260b0: 84 31 cpi r24, 0x14 ; 20 260b2: 09 f4 brne .+2 ; 0x260b6 260b4: 80 c0 rjmp .+256 ; 0x261b6 260b6: 08 f0 brcs .+2 ; 0x260ba 260b8: 89 c0 rjmp .+274 ; 0x261cc 260ba: 88 30 cpi r24, 0x08 ; 8 260bc: 09 f4 brne .+2 ; 0x260c0 260be: 72 c0 rjmp .+228 ; 0x261a4 260c0: 8d e7 ldi r24, 0x7D ; 125 260c2: 0e 94 81 79 call 0xf302 ; 0xf302 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 260c6: cf 91 pop r28 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 260c8: 0c 94 8c 7a jmp 0xf518 ; 0xf518 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260cc: 8b 35 cpi r24, 0x5B ; 91 260ce: 09 f4 brne .+2 ; 0x260d2 260d0: 91 c0 rjmp .+290 ; 0x261f4 260d2: 30 f4 brcc .+12 ; 0x260e0 prusa_stat_farm_number(); status_number = 5; break; case 90: // Error - Thermal Runaway prusa_statistics_err('1'); 260d4: 81 e3 ldi r24, 0x31 ; 49 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260d6: ca 35 cpi r28, 0x5A ; 90 260d8: 99 f7 brne .-26 ; 0x260c0 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 260da: 0f 94 42 06 call 0x20c84 ; 0x20c84 260de: f0 cf rjmp .-32 ; 0x260c0 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260e0: 8c 35 cpi r24, 0x5C ; 92 260e2: 09 f4 brne .+2 ; 0x260e6 260e4: 89 c0 rjmp .+274 ; 0x261f8 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 260e6: 84 e3 ldi r24, 0x34 ; 52 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260e8: cd 35 cpi r28, 0x5D ; 93 260ea: b9 f3 breq .-18 ; 0x260da 260ec: e9 cf rjmp .-46 ; 0x260c0 case 0: // default message if (busy_state == PAUSED_FOR_USER) { 260ee: 80 91 78 02 lds r24, 0x0278 ; 0x800278 260f2: 84 30 cpi r24, 0x04 ; 4 260f4: 21 f4 brne .+8 ; 0x260fe prusa_statistics_case0(15); 260f6: 8f e0 ldi r24, 0x0F ; 15 } else if (printingIsPaused()) { prusa_statistics_case0(14); 260f8: 0f 94 34 16 call 0x22c68 ; 0x22c68 260fc: e1 cf rjmp .-62 ; 0x260c0 switch (_message) { case 0: // default message if (busy_state == PAUSED_FOR_USER) { prusa_statistics_case0(15); } else if (printingIsPaused()) { 260fe: 0e 94 05 66 call 0xcc0a ; 0xcc0a 26102: 88 23 and r24, r24 26104: 11 f0 breq .+4 ; 0x2610a prusa_statistics_case0(14); 26106: 8e e0 ldi r24, 0x0E ; 14 26108: f7 cf rjmp .-18 ; 0x260f8 } else if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 2610a: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 2610e: 81 11 cpse r24, r1 26110: 04 c0 rjmp .+8 ; 0x2611a 26112: 80 91 94 03 lds r24, 0x0394 ; 0x800394 26116: 88 23 and r24, r24 26118: 11 f0 breq .+4 ; 0x2611e prusa_statistics_case0(4); 2611a: 84 e0 ldi r24, 0x04 ; 4 2611c: ed cf rjmp .-38 ; 0x260f8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2611e: 8b e7 ldi r24, 0x7B ; 123 26120: 0e 94 81 79 call 0xf302 ; 0xf302 } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(1); 26124: 81 e0 ldi r24, 0x01 ; 1 26126: 0f 94 35 06 call 0x20c6a ; 0x20c6a prusa_stat_farm_number(); 2612a: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 prusa_stat_diameter(); 2612e: 0f 94 51 06 call 0x20ca2 ; 0x20ca2 status_number = 1; 26132: 81 e0 ldi r24, 0x01 ; 1 prusa_stat_printerstatus(status_number); break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); prusa_stat_farm_number(); status_number = 5; 26134: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.492> 26138: c3 cf rjmp .-122 ; 0x260c0 2613a: 8b e7 ldi r24, 0x7B ; 123 2613c: 0e 94 81 79 call 0xf302 ; 0xf302 } break; case 1: // 1 heating SERIAL_ECHO('{'); prusa_stat_printerstatus(2); 26140: 82 e0 ldi r24, 0x02 ; 2 26142: 0f 94 35 06 call 0x20c6a ; 0x20c6a prusa_stat_farm_number(); 26146: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 status_number = 2; 2614a: 82 e0 ldi r24, 0x02 ; 2 2614c: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.492> farm_timer = 1; 26150: c0 93 74 02 sts 0x0274, r28 ; 0x800274 26154: b5 cf rjmp .-150 ; 0x260c0 26156: 8b e7 ldi r24, 0x7B ; 123 26158: 0e 94 81 79 call 0xf302 ; 0xf302 prusa_stat_farm_number(); status_number = 4; } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 2615c: 83 e0 ldi r24, 0x03 ; 3 2615e: 0f 94 35 06 call 0x20c6a ; 0x20c6a prusa_stat_farm_number(); 26162: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 status_number = 3; 26166: c0 93 bd 04 sts 0x04BD, r28 ; 0x8004bd <_ZL13status_number.lto_priv.492> 2616a: 88 cf rjmp .-240 ; 0x2607c prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 5: // print not succesfull SERIAL_ECHOPGM("{[RES:0][FIL:"); 2616c: 8f e6 ldi r24, 0x6F ; 111 2616e: 99 e8 ldi r25, 0x89 ; 137 // must do a return here to prevent doing SERIAL_ECHOLN("}") at the very end of this function // saved a considerable amount of FLASH return; break; case 4: // print succesfull SERIAL_ECHOPGM("{[RES:1][FIL:"); 26170: 0e 94 94 7a call 0xf528 ; 0xf528 26174: 60 e0 ldi r22, 0x00 ; 0 26176: 70 e0 ldi r23, 0x00 ; 0 26178: cb 01 movw r24, r22 2617a: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 2617e: 8d e5 ldi r24, 0x5D ; 93 26180: 0e 94 81 79 call 0xf302 ; 0xf302 MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); 26184: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.492> 26188: 0f 94 35 06 call 0x20c6a ; 0x20c6a prusa_stat_farm_number(); 2618c: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 farm_timer = 2; 26190: 82 e0 ldi r24, 0x02 ; 2 26192: 75 cf rjmp .-278 ; 0x2607e prusa_stat_farm_number(); status_number = 8; farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); 26194: 8d e5 ldi r24, 0x5D ; 93 26196: 99 e8 ldi r25, 0x89 ; 137 26198: 0e 94 94 7a call 0xf528 ; 0xf528 prusa_stat_farm_number(); 2619c: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 status_number = 9; 261a0: 89 e0 ldi r24, 0x09 ; 9 261a2: 7f cf rjmp .-258 ; 0x260a2 farm_timer = 2; break; case 8: // printer started SERIAL_ECHOPGM("{[PRN:0]"); 261a4: 84 e5 ldi r24, 0x54 ; 84 261a6: 99 e8 ldi r25, 0x89 ; 137 261a8: 0e 94 94 7a call 0xf528 ; 0xf528 prusa_stat_farm_number(); 261ac: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 status_number = 0; 261b0: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL13status_number.lto_priv.492> 261b4: ed cf rjmp .-38 ; 0x26190 261b6: 8b e7 ldi r24, 0x7B ; 123 261b8: 0e 94 81 79 call 0xf302 ; 0xf302 farm_timer = 2; break; case 20: // echo farm no SERIAL_ECHO('{'); prusa_stat_printerstatus(status_number); 261bc: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.492> 261c0: 0f 94 35 06 call 0x20c6a ; 0x20c6a prusa_stat_farm_number(); 261c4: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 farm_timer = 4; 261c8: 84 e0 ldi r24, 0x04 ; 4 261ca: 59 cf rjmp .-334 ; 0x2607e 261cc: 8b e7 ldi r24, 0x7B ; 123 261ce: 0e 94 81 79 call 0xf302 ; 0xf302 break; case 21: // temperatures SERIAL_ECHO('{'); prusa_stat_temperatures(); 261d2: 0f 94 f8 05 call 0x20bf0 ; 0x20bf0 prusa_stat_farm_number(); 261d6: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 prusa_stat_printerstatus(status_number); 261da: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.492> 261de: 0f 94 35 06 call 0x20c6a ; 0x20c6a 261e2: 6e cf rjmp .-292 ; 0x260c0 break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); 261e4: 8b e4 ldi r24, 0x4B ; 75 261e6: 99 e8 ldi r25, 0x89 ; 137 261e8: 0e 94 94 7a call 0xf528 ; 0xf528 prusa_stat_farm_number(); 261ec: 0f 94 e8 05 call 0x20bd0 ; 0x20bd0 status_number = 5; 261f0: 85 e0 ldi r24, 0x05 ; 5 261f2: a0 cf rjmp .-192 ; 0x26134 case 90: // Error - Thermal Runaway prusa_statistics_err('1'); break; case 91: // Error - Thermal Runaway Preheat prusa_statistics_err('2'); 261f4: 82 e3 ldi r24, 0x32 ; 50 261f6: 71 cf rjmp .-286 ; 0x260da break; case 92: // Error - Min temp prusa_statistics_err('3'); 261f8: 83 e3 ldi r24, 0x33 ; 51 261fa: 6f cf rjmp .-290 ; 0x260da prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 261fc: cf 91 pop r28 261fe: 08 95 ret 00026200 : 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()") { 26200: cf 92 push r12 26202: df 92 push r13 26204: ef 92 push r14 26206: ff 92 push r15 26208: 0f 93 push r16 2620a: 1f 93 push r17 2620c: cf 93 push r28 2620e: df 93 push r29 26210: 00 d0 rcall .+0 ; 0x26212 26212: 00 d0 rcall .+0 ; 0x26214 26214: 1f 92 push r1 26216: 1f 92 push r1 26218: cd b7 in r28, 0x3d ; 61 2621a: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 2621c: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 26220: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 26224: 00 97 sbiw r24, 0x00 ; 0 26226: e1 f1 breq .+120 ; 0x262a0 { const int16_t initial_feedmultiply = feedmultiply; 26228: 20 91 8e 02 lds r18, 0x028E ; 0x80028e 2622c: 30 91 8f 02 lds r19, 0x028F ; 0x80028f // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 26230: 24 36 cpi r18, 0x64 ; 100 26232: 31 05 cpc r19, r1 26234: 4c f4 brge .+18 ; 0x26248 26236: ac 01 movw r20, r24 26238: 42 0f add r20, r18 2623a: 53 1f adc r21, r19 2623c: 45 36 cpi r20, 0x65 ; 101 2623e: 51 05 cpc r21, r1 26240: 6c f4 brge .+26 ; 0x2625c 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; 26242: 82 0f add r24, r18 26244: 93 1f adc r25, r19 26246: 0c c0 rjmp .+24 ; 0x26260 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 26248: 24 36 cpi r18, 0x64 ; 100 2624a: 31 05 cpc r19, r1 2624c: 09 f4 brne .+2 ; 0x26250 2624e: 55 c0 rjmp .+170 ; 0x262fa (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 26250: ac 01 movw r20, r24 26252: 42 0f add r20, r18 26254: 53 1f adc r21, r19 26256: 44 36 cpi r20, 0x64 ; 100 26258: 51 05 cpc r21, r1 2625a: 9c f7 brge .-26 ; 0x26242 { feedmultiply = 100; 2625c: 84 e6 ldi r24, 0x64 ; 100 2625e: 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; 26260: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 26264: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e if (initial_feedmultiply != feedmultiply) { 26268: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 2626c: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 26270: 82 17 cp r24, r18 26272: 93 07 cpc r25, r19 26274: a9 f0 breq .+42 ; 0x262a0 feedmultiply = constrain(feedmultiply, 10, 999); 26276: 88 3e cpi r24, 0xE8 ; 232 26278: 53 e0 ldi r21, 0x03 ; 3 2627a: 95 07 cpc r25, r21 2627c: 14 f0 brlt .+4 ; 0x26282 2627e: 87 ee ldi r24, 0xE7 ; 231 26280: 93 e0 ldi r25, 0x03 ; 3 26282: 8a 30 cpi r24, 0x0A ; 10 26284: 91 05 cpc r25, r1 26286: 14 f4 brge .+4 ; 0x2628c 26288: 8a e0 ldi r24, 0x0A ; 10 2628a: 90 e0 ldi r25, 0x00 ; 0 2628c: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 26290: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e lcd_encoder = 0; // Consume rotation event 26294: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 26298: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e refresh_saved_feedrate_multiplier_in_ram(); 2629c: 0e 94 0d 64 call 0xc81a ; 0xc81a } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 262a0: 80 91 59 02 lds r24, 0x0259 ; 0x800259 262a4: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 262a6: 10 92 0a 06 sts 0x060A, r1 ; 0x80060a } if (lcd_status_update_delay) 262aa: 10 91 0a 06 lds r17, 0x060A ; 0x80060a 262ae: 11 23 and r17, r17 262b0: 91 f1 breq .+100 ; 0x26316 lcd_status_update_delay--; 262b2: 2f ef ldi r18, 0xFF ; 255 262b4: 21 0f add r18, r17 262b6: 20 93 0a 06 sts 0x060A, r18 ; 0x80060a if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 262ba: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 262be: 81 11 cpse r24, r1 262c0: 0d c0 rjmp .+26 ; 0x262dc 262c2: 0e 94 45 73 call 0xe68a ; 0xe68a 262c6: 88 23 and r24, r24 262c8: 49 f0 breq .+18 ; 0x262dc menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 262ca: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df menu_submenu(lcd_main_menu); 262ce: 60 e0 ldi r22, 0x00 ; 0 262d0: 8b ee ldi r24, 0xEB ; 235 262d2: 96 ec ldi r25, 0xC6 ; 198 262d4: 0e 94 ad 62 call 0xc55a ; 0xc55a lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 262d8: 0e 94 6f 70 call 0xe0de ; 0xe0de } } 262dc: 28 96 adiw r28, 0x08 ; 8 262de: 0f b6 in r0, 0x3f ; 63 262e0: f8 94 cli 262e2: de bf out 0x3e, r29 ; 62 262e4: 0f be out 0x3f, r0 ; 63 262e6: cd bf out 0x3d, r28 ; 61 262e8: df 91 pop r29 262ea: cf 91 pop r28 262ec: 1f 91 pop r17 262ee: 0f 91 pop r16 262f0: ff 90 pop r15 262f2: ef 90 pop r14 262f4: df 90 pop r13 262f6: cf 90 pop r12 262f8: 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) { 262fa: 8b 30 cpi r24, 0x0B ; 11 262fc: 91 05 cpc r25, r1 262fe: 1c f0 brlt .+6 ; 0x26306 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 26300: 86 5a subi r24, 0xA6 ; 166 26302: 9f 4f sbci r25, 0xFF ; 255 26304: ad cf rjmp .-166 ; 0x26260 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 26306: 86 3f cpi r24, 0xF6 ; 246 26308: 4f ef ldi r20, 0xFF ; 255 2630a: 94 07 cpc r25, r20 2630c: 0c f0 brlt .+2 ; 0x26310 2630e: ac cf rjmp .-168 ; 0x26268 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 26310: 82 59 subi r24, 0x92 ; 146 26312: 9f 4f sbci r25, 0xFF ; 255 26314: a5 cf rjmp .-182 ; 0x26260 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; 26316: 6a e0 ldi r22, 0x0A ; 10 26318: 60 93 0a 06 sts 0x060A, r22 ; 0x80060a ReInitLCD++; 2631c: 80 91 09 06 lds r24, 0x0609 ; 0x800609 26320: 8f 5f subi r24, 0xFF ; 255 26322: 80 93 09 06 sts 0x0609, r24 ; 0x800609 if (ReInitLCD == 30) 26326: 8e 31 cpi r24, 0x1E ; 30 26328: 09 f0 breq .+2 ; 0x2632c 2632a: 9f c0 rjmp .+318 ; 0x2646a { ReInitLCD = 0 ; 2632c: 10 92 09 06 sts 0x0609, r1 ; 0x800609 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 26330: 0e 94 6f 70 call 0xe0de ; 0xe0de lcd_status_message_idx = 0; // Re-draw message from beginning 26334: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.420> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 26338: 0e 94 b6 6e call 0xdd6c ; 0xdd6c lcd_home(); //line 0 2633c: 0e 94 ef 6f call 0xdfde ; 0xdfde return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 26340: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 26344: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 26348: 07 2e mov r0, r23 2634a: 00 0c add r0, r0 2634c: 88 0b sbc r24, r24 2634e: 99 0b sbc r25, r25 26350: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__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)); 26354: 20 e0 ldi r18, 0x00 ; 0 26356: 30 e0 ldi r19, 0x00 ; 0 26358: 40 e0 ldi r20, 0x00 ; 0 2635a: 5f e3 ldi r21, 0x3F ; 63 2635c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 26360: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 26364: 6b 01 movw r12, r22 26366: 20 e0 ldi r18, 0x00 ; 0 26368: 30 e0 ldi r19, 0x00 ; 0 2636a: 40 e0 ldi r20, 0x00 ; 0 2636c: 5f e3 ldi r21, 0x3F ; 63 2636e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 26372: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 26376: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2637a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2637e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 26382: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 26386: a6 01 movw r20, r12 26388: 82 e8 ldi r24, 0x82 ; 130 2638a: 0f 94 27 0a call 0x2144e ; 0x2144e lcd_space(3); //3 spaces 2638e: 83 e0 ldi r24, 0x03 ; 3 26390: 0e 94 f8 6e call 0xddf0 ; 0xddf0 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 26394: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 26398: 81 30 cpi r24, 0x01 ; 1 2639a: 09 f0 breq .+2 ; 0x2639e 2639c: 6e c0 rjmp .+220 ; 0x2647a lcd_puts_P(_N("Z --- ")); 2639e: 8a e6 ldi r24, 0x6A ; 106 263a0: 9a e6 ldi r25, 0x6A ; 106 263a2: 0e 94 ed 6e call 0xddda ; 0xddda lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 263a6: 61 e0 ldi r22, 0x01 ; 1 263a8: 80 e0 ldi r24, 0x00 ; 0 263aa: 0e 94 2a 6f call 0xde54 ; 0xde54 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 263ae: 60 91 59 12 lds r22, 0x1259 ; 0x801259 263b2: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 263b6: 07 2e mov r0, r23 263b8: 00 0c add r0, r0 263ba: 88 0b sbc r24, r24 263bc: 99 0b sbc r25, r25 263be: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 263c2: 20 e0 ldi r18, 0x00 ; 0 263c4: 30 e0 ldi r19, 0x00 ; 0 263c6: 40 e0 ldi r20, 0x00 ; 0 263c8: 5f e3 ldi r21, 0x3F ; 63 263ca: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 263ce: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 263d2: 6b 01 movw r12, r22 263d4: 20 e0 ldi r18, 0x00 ; 0 263d6: 30 e0 ldi r19, 0x00 ; 0 263d8: 40 e0 ldi r20, 0x00 ; 0 263da: 5f e3 ldi r21, 0x3F ; 63 263dc: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 263e0: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 263e4: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 263e8: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 263ec: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 263f0: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 263f4: a6 01 movw r20, r12 263f6: 80 e8 ldi r24, 0x80 ; 128 263f8: 0f 94 27 0a call 0x2144e ; 0x2144e lcd_space(3); //3 spaces 263fc: 83 e0 ldi r24, 0x03 ; 3 263fe: 0e 94 f8 6e call 0xddf0 ; 0xddf0 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 26402: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 26406: 8f 93 push r24 26408: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 2640c: 8f 93 push r24 2640e: 83 e7 ldi r24, 0x73 ; 115 26410: 9a e6 ldi r25, 0x6A ; 106 26412: 9f 93 push r25 26414: 8f 93 push r24 26416: 0e 94 db 6e call 0xddb6 ; 0xddb6 lcd_space(8 - chars); 2641a: 98 e0 ldi r25, 0x08 ; 8 2641c: 98 1b sub r25, r24 2641e: 89 2f mov r24, r25 26420: 0e 94 f8 6e call 0xddf0 ; 0xddf0 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 26424: 62 e0 ldi r22, 0x02 ; 2 26426: 80 e0 ldi r24, 0x00 ; 0 26428: 0e 94 2a 6f call 0xde54 ; 0xde54 } // 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(" ")); 2642c: 0f 90 pop r0 2642e: 0f 90 pop r0 26430: 0f 90 pop r0 26432: 0f 90 pop r0 26434: 80 91 42 12 lds r24, 0x1242 ; 0x801242 26438: e0 90 d7 13 lds r14, 0x13D7 ; 0x8013d7 2643c: 81 11 cpse r24, r1 2643e: 3e c0 rjmp .+124 ; 0x264bc 26440: 26 e8 ldi r18, 0x86 ; 134 26442: c2 2e mov r12, r18 26444: 2a e6 ldi r18, 0x6A ; 106 26446: d2 2e mov r13, r18 26448: e1 10 cpse r14, r1 2644a: 3c c0 rjmp .+120 ; 0x264c4 2644c: 8a e8 ldi r24, 0x8A ; 138 2644e: c8 2e mov r12, r24 26450: 8a e6 ldi r24, 0x6A ; 106 26452: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 26454: 0e 94 61 66 call 0xccc2 ; 0xccc2 26458: f8 2e mov r15, r24 2645a: 88 23 and r24, r24 2645c: d9 f1 breq .+118 ; 0x264d4 2645e: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 26462: 8f 3f cpi r24, 0xFF ; 255 26464: 89 f5 brne .+98 ; 0x264c8 26466: f1 2c mov r15, r1 26468: 35 c0 rjmp .+106 ; 0x264d4 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 2646a: 0f 94 58 a4 call 0x348b0 ; 0x348b0 <__divmodqi4> 2646e: 91 11 cpse r25, r1 26470: 63 cf rjmp .-314 ; 0x26338 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 26472: 80 e0 ldi r24, 0x00 ; 0 26474: 0e 94 2e 70 call 0xe05c ; 0xe05c 26478: 5d cf rjmp .-326 ; 0x26334 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]?' ':'?'); 2647a: 80 91 3b 06 lds r24, 0x063B ; 0x80063b 2647e: 88 23 and r24, r24 26480: d9 f0 breq .+54 ; 0x264b8 26482: 80 e2 ldi r24, 0x20 ; 32 26484: 1f 92 push r1 26486: 8f 93 push r24 26488: 80 91 6c 12 lds r24, 0x126C ; 0x80126c 2648c: 8f 93 push r24 2648e: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 26492: 8f 93 push r24 26494: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 26498: 8f 93 push r24 2649a: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2649e: 8f 93 push r24 264a0: 81 e6 ldi r24, 0x61 ; 97 264a2: 9a e6 ldi r25, 0x6A ; 106 264a4: 9f 93 push r25 264a6: 8f 93 push r24 264a8: 0e 94 db 6e call 0xddb6 ; 0xddb6 264ac: 0f b6 in r0, 0x3f ; 63 264ae: f8 94 cli 264b0: de bf out 0x3e, r29 ; 62 264b2: 0f be out 0x3f, r0 ; 63 264b4: cd bf out 0x3d, r28 ; 61 264b6: 77 cf rjmp .-274 ; 0x263a6 264b8: 8f e3 ldi r24, 0x3F ; 63 264ba: e4 cf rjmp .-56 ; 0x26484 } // 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(" ")); 264bc: 9e e8 ldi r25, 0x8E ; 142 264be: c9 2e mov r12, r25 264c0: 9a e6 ldi r25, 0x6A ; 106 264c2: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 264c4: ee 20 and r14, r14 264c6: 31 f2 breq .-116 ; 0x26454 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 264c8: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb // 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)); 264cc: ff 24 eor r15, r15 264ce: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 264d0: 88 23 and r24, r24 264d2: 99 f1 breq .+102 ; 0x2653a { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 264d4: 81 ea ldi r24, 0xA1 ; 161 264d6: 9d e0 ldi r25, 0x0D ; 13 264d8: 0f 94 9d a3 call 0x3473a ; 0x3473a 264dc: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 264de: 0e 94 66 78 call 0xf0cc ; 0xf0cc if ((nextSheet >= 0) && (sheetNR != nextSheet)) 264e2: 87 fd sbrc r24, 7 264e4: 2a c0 rjmp .+84 ; 0x2653a 264e6: 08 17 cp r16, r24 264e8: 41 f1 breq .+80 ; 0x2653a { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 264ea: 9b e0 ldi r25, 0x0B ; 11 264ec: 09 02 muls r16, r25 264ee: b0 01 movw r22, r0 264f0: 11 24 eor r1, r1 264f2: 67 5b subi r22, 0xB7 ; 183 264f4: 72 4f sbci r23, 0xF2 ; 242 264f6: 47 e0 ldi r20, 0x07 ; 7 264f8: 50 e0 ldi r21, 0x00 ; 0 264fa: 8e 01 movw r16, r28 264fc: 0f 5f subi r16, 0xFF ; 255 264fe: 1f 4f sbci r17, 0xFF ; 255 26500: c8 01 movw r24, r16 26502: 0f 94 8d a3 call 0x3471a ; 0x3471a sheet[7] = '\0'; 26506: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 26508: 1f 93 push r17 2650a: 0f 93 push r16 2650c: 87 e8 ldi r24, 0x87 ; 135 2650e: 97 e9 ldi r25, 0x97 ; 151 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 26510: 9f 93 push r25 26512: 8f 93 push r24 26514: 0e 94 db 6e call 0xddb6 ; 0xddb6 26518: 0f 90 pop r0 2651a: 0f 90 pop r0 2651c: 0f 90 pop r0 2651e: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 26520: 80 91 01 13 lds r24, 0x1301 ; 0x801301 26524: 81 30 cpi r24, 0x01 ; 1 26526: 09 f0 breq .+2 ; 0x2652a 26528: 5a c0 rjmp .+180 ; 0x265de // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 2652a: 0f 94 7e 05 call 0x20afc ; 0x20afc 2652e: 95 e0 ldi r25, 0x05 ; 5 26530: 98 1b sub r25, r24 26532: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 26534: 0e 94 f8 6e call 0xddf0 ; 0xddf0 26538: 5f c0 rjmp .+190 ; 0x265f8 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 2653a: e1 10 cpse r14, r1 2653c: 04 c0 rjmp .+8 ; 0x26546 2653e: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.422> 26542: 81 11 cpse r24, r1 26544: 42 c0 rjmp .+132 ; 0x265ca // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 26546: df 92 push r13 26548: cf 92 push r12 2654a: 83 e8 ldi r24, 0x83 ; 131 2654c: 97 e9 ldi r25, 0x97 ; 151 2654e: 9f 93 push r25 26550: 8f 93 push r24 26552: 0e 94 db 6e call 0xddb6 ; 0xddb6 26556: 0f 90 pop r0 26558: 0f 90 pop r0 2655a: 0f 90 pop r0 2655c: 0f 90 pop r0 else if (print_percent_done_silent <= 100) { percent_done = print_percent_done_silent; } #else if (print_percent_done_normal <= 100) 2655e: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 26562: 85 36 cpi r24, 0x65 ; 101 26564: d0 f1 brcs .+116 ; 0x265da 26566: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2656a: 88 23 and r24, r24 2656c: 19 f1 breq .+70 ; 0x265b4 2656e: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 26572: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 26576: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 2657a: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 2657e: 00 97 sbiw r24, 0x00 ; 0 26580: a1 05 cpc r26, r1 26582: b1 05 cpc r27, r1 26584: b9 f0 breq .+46 ; 0x265b4 26586: bc 01 movw r22, r24 26588: cd 01 movw r24, r26 2658a: 6d 59 subi r22, 0x9D ; 157 2658c: 7f 4f sbci r23, 0xFF ; 255 2658e: 8f 4f sbci r24, 0xFF ; 255 26590: 9f 4f sbci r25, 0xFF ; 255 26592: 24 e6 ldi r18, 0x64 ; 100 26594: 30 e0 ldi r19, 0x00 ; 0 26596: 40 e0 ldi r20, 0x00 ; 0 26598: 50 e0 ldi r21, 0x00 ; 0 2659a: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 2659e: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 265a2: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 265a6: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 265aa: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 265ae: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 265b2: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 265b4: 21 2f mov r18, r17 265b6: 30 e0 ldi r19, 0x00 ; 0 265b8: 80 e8 ldi r24, 0x80 ; 128 265ba: 9a e6 ldi r25, 0x6A ; 106 265bc: f1 10 cpse r15, r1 265be: 02 c0 rjmp .+4 ; 0x265c4 265c0: 8a e7 ldi r24, 0x7A ; 122 265c2: 9a e6 ldi r25, 0x6A ; 106 265c4: 3f 93 push r19 265c6: 2f 93 push r18 265c8: a3 cf rjmp .-186 ; 0x26510 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 265ca: 81 e0 ldi r24, 0x01 ; 1 265cc: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print(hostName); // Two characters 265d0: 85 e0 ldi r24, 0x05 ; 5 265d2: 96 e0 ldi r25, 0x06 ; 6 265d4: 0e 94 2f 73 call 0xe65e ; 0xe65e 265d8: c2 cf rjmp .-124 ; 0x2655e 265da: 18 2f mov r17, r24 265dc: eb cf rjmp .-42 ; 0x265b4 lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { 265de: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 265e2: 88 23 and r24, r24 265e4: 09 f4 brne .+2 ; 0x265e8 265e6: a5 c0 rjmp .+330 ; 0x26732 } // Print farm number (5 chars total) static void lcdui_print_farm(void) { lcd_printf_P(_N(" FRM ")); 265e8: 82 e9 ldi r24, 0x92 ; 146 265ea: 9a e6 ldi r25, 0x6A ; 106 265ec: 9f 93 push r25 265ee: 8f 93 push r24 265f0: 0e 94 db 6e call 0xddb6 ; 0xddb6 265f4: 0f 90 pop r0 265f6: 0f 90 pop r0 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()) { 265f8: 0e 94 61 66 call 0xccc2 ; 0xccc2 265fc: 88 23 and r24, r24 265fe: 09 f4 brne .+2 ; 0x26602 26600: ac c0 rjmp .+344 ; 0x2675a 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) 26602: c0 90 72 02 lds r12, 0x0272 ; 0x800272 26606: d0 90 73 02 lds r13, 0x0273 ; 0x800273 print_tr = print_time_remaining_normal; //#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT) 2660a: e0 90 70 02 lds r14, 0x0270 ; 0x800270 2660e: f0 90 71 02 lds r15, 0x0271 ; 0x800271 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 26612: 80 91 08 06 lds r24, 0x0608 ; 0x800608 26616: 8a 30 cpi r24, 0x0A ; 10 26618: 11 f4 brne .+4 ; 0x2661e clock_interval = 0; 2661a: 10 92 08 06 sts 0x0608, r1 ; 0x800608 clock_interval++; 2661e: 80 91 08 06 lds r24, 0x0608 ; 0x800608 26622: 8f 5f subi r24, 0xFF ; 255 26624: 80 93 08 06 sts 0x0608, r24 ; 0x800608 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 26628: 2f ef ldi r18, 0xFF ; 255 2662a: e2 16 cp r14, r18 2662c: f2 06 cpc r15, r18 2662e: 21 f0 breq .+8 ; 0x26638 26630: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 26632: 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) { 26634: 86 30 cpi r24, 0x06 ; 6 26636: 70 f4 brcc .+28 ; 0x26654 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 26638: 3f ef ldi r19, 0xFF ; 255 2663a: c3 16 cp r12, r19 2663c: d3 06 cpc r13, r19 2663e: 09 f0 breq .+2 ; 0x26642 26640: 7a c0 rjmp .+244 ; 0x26736 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 26642: 0f 94 22 15 call 0x22a44 ; 0x22a44 26646: 2c e3 ldi r18, 0x3C ; 60 26648: 30 e0 ldi r19, 0x00 ; 0 2664a: 40 e0 ldi r20, 0x00 ; 0 2664c: 50 e0 ldi r21, 0x00 ; 0 2664e: 0f 94 10 a4 call 0x34820 ; 0x34820 <__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 = ' '; 26652: 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)) { 26654: 40 91 8e 02 lds r20, 0x028E ; 0x80028e 26658: 50 91 8f 02 lds r21, 0x028F ; 0x80028f 2665c: 44 36 cpi r20, 0x64 ; 100 2665e: 51 05 cpc r21, r1 26660: 09 f4 brne .+2 ; 0x26664 26662: 6c c0 rjmp .+216 ; 0x2673c 26664: c2 16 cp r12, r18 26666: d3 06 cpc r13, r19 26668: 21 f0 breq .+8 ; 0x26672 2666a: e2 16 cp r14, r18 2666c: f3 06 cpc r15, r19 2666e: 09 f0 breq .+2 ; 0x26672 26670: 65 c0 rjmp .+202 ; 0x2673c 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); 26672: a4 e6 ldi r26, 0x64 ; 100 26674: b0 e0 ldi r27, 0x00 ; 0 26676: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 2667a: 9a 01 movw r18, r20 2667c: 55 0f add r21, r21 2667e: 44 0b sbc r20, r20 26680: 55 0b sbc r21, r21 26682: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 26686: 4f e3 ldi r20, 0x3F ; 63 26688: e4 2e mov r14, r20 2668a: 04 2e mov r0, r20 2668c: 00 0c add r0, r0 2668e: ff 08 sbc r15, r15 26690: e1 2f mov r30, r17 26692: 01 2e mov r0, r17 26694: 00 0c add r0, r0 26696: ff 0b sbc r31, r31 26698: c9 01 movw r24, r18 2669a: 6c e3 ldi r22, 0x3C ; 60 2669c: 70 e0 ldi r23, 0x00 ; 0 2669e: 0f 94 66 a4 call 0x348cc ; 0x348cc <__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 266a2: 20 37 cpi r18, 0x70 ; 112 266a4: 37 41 sbci r19, 0x17 ; 23 266a6: 08 f0 brcs .+2 ; 0x266aa 266a8: 4b c0 rjmp .+150 ; 0x26740 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 266aa: ff 92 push r15 266ac: 4f 93 push r20 266ae: ff 93 push r31 266b0: 1f 93 push r17 266b2: 9f 93 push r25 266b4: 8f 93 push r24 266b6: 7f 93 push r23 266b8: 6f 93 push r22 266ba: 8c ea ldi r24, 0xAC ; 172 266bc: 9a e6 ldi r25, 0x6A ; 106 266be: 9f 93 push r25 266c0: 8f 93 push r24 266c2: 0e 94 db 6e call 0xddb6 ; 0xddb6 else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 266c6: 0f b6 in r0, 0x3f ; 63 266c8: f8 94 cli 266ca: de bf out 0x3e, r29 ; 62 266cc: 0f be out 0x3f, r0 ; 63 266ce: 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); 266d0: 98 e0 ldi r25, 0x08 ; 8 266d2: 98 1b sub r25, r24 266d4: 89 2f mov r24, r25 266d6: 0e 94 f8 6e call 0xddf0 ; 0xddf0 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 266da: 63 e0 ldi r22, 0x03 ; 3 266dc: 80 e0 ldi r24, 0x00 ; 0 266de: 0e 94 2a 6f call 0xde54 ; 0xde54 #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 266e2: 0f 94 03 0c call 0x21806 ; 0x21806 void prusa_statistics_update_from_status_screen() { if (farm_mode) { 266e6: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 266ea: 88 23 and r24, r24 266ec: b1 f0 breq .+44 ; 0x2671a farm_timer--; 266ee: 80 91 74 02 lds r24, 0x0274 ; 0x800274 266f2: 81 50 subi r24, 0x01 ; 1 if (farm_timer < 1) { 266f4: d9 f1 breq .+118 ; 0x2676c SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; 266f6: 80 93 74 02 sts 0x0274, r24 ; 0x800274 if (farm_timer < 1) { farm_timer = 10; prusa_statistics(0); } switch (farm_timer) { 266fa: 80 91 74 02 lds r24, 0x0274 ; 0x800274 266fe: 85 30 cpi r24, 0x05 ; 5 26700: e1 f1 breq .+120 ; 0x2677a 26702: 88 30 cpi r24, 0x08 ; 8 26704: 51 f4 brne .+20 ; 0x2671a case 8: prusa_statistics(21); 26706: 85 e1 ldi r24, 0x15 ; 21 26708: 0f 94 02 30 call 0x26004 ; 0x26004 if(eFilamentAction != FilamentAction::None) 2670c: 80 91 94 03 lds r24, 0x0394 ; 0x800394 26710: 88 23 and r24, r24 26712: 19 f0 breq .+6 ; 0x2671a prusa_statistics(22); 26714: 86 e1 ldi r24, 0x16 ; 22 break; case 5: if (IS_SD_PRINTING) prusa_statistics(20); 26716: 0f 94 02 30 call 0x26004 ; 0x26004 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 2671a: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 2671e: 88 23 and r24, r24 26720: 09 f4 brne .+2 ; 0x26724 26722: cb cd rjmp .-1130 ; 0x262ba 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) { 26724: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 26728: 81 11 cpse r24, r1 2672a: c7 cd rjmp .-1138 ; 0x262ba 2672c: 0e 94 bf f3 call 0x1e77e ; 0x1e77e 26730: c4 cd rjmp .-1144 ; 0x262ba lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 26732: 85 e0 ldi r24, 0x05 ; 5 26734: ff ce rjmp .-514 ; 0x26534 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) { 26736: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 26738: 12 e5 ldi r17, 0x52 ; 82 2673a: 8c cf rjmp .-232 ; 0x26654 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 = ' '; 2673c: 40 e2 ldi r20, 0x20 ; 32 2673e: a4 cf rjmp .-184 ; 0x26688 } 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); 26740: ff 92 push r15 26742: 4f 93 push r20 26744: ff 93 push r31 26746: 1f 93 push r17 26748: 7f 93 push r23 2674a: 6f 93 push r22 2674c: 81 ea ldi r24, 0xA1 ; 161 2674e: 9a e6 ldi r25, 0x6A ; 106 26750: 9f 93 push r25 26752: 8f 93 push r24 26754: 0e 94 db 6e call 0xddb6 ; 0xddb6 26758: b6 cf rjmp .-148 ; 0x266c6 } else { #ifdef QUICK_NOZZLE_CHANGE chars = lcd_printf_P(PSTR("Nd %4.2f "),(float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); #else chars = lcd_printf_P(_N(LCD_STR_CLOCK "--:-- ")); 2675a: 88 e9 ldi r24, 0x98 ; 152 2675c: 9a e6 ldi r25, 0x6A ; 106 2675e: 9f 93 push r25 26760: 8f 93 push r24 26762: 0e 94 db 6e call 0xddb6 ; 0xddb6 26766: 0f 90 pop r0 26768: 0f 90 pop r0 2676a: b2 cf rjmp .-156 ; 0x266d0 void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; if (farm_timer < 1) { farm_timer = 10; 2676c: 8a e0 ldi r24, 0x0A ; 10 2676e: 80 93 74 02 sts 0x0274, r24 ; 0x800274 prusa_statistics(0); 26772: 80 e0 ldi r24, 0x00 ; 0 26774: 0f 94 02 30 call 0x26004 ; 0x26004 26778: c0 cf rjmp .-128 ; 0x266fa prusa_statistics(21); if(eFilamentAction != FilamentAction::None) prusa_statistics(22); break; case 5: if (IS_SD_PRINTING) 2677a: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 2677e: 88 23 and r24, r24 26780: 61 f2 breq .-104 ; 0x2671a prusa_statistics(20); 26782: 84 e1 ldi r24, 0x14 ; 20 26784: c8 cf rjmp .-112 ; 0x26716 00026786 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 26786: cf 93 push r28 26788: df 93 push r29 if(IsStopped() == false) { 2678a: 90 91 3b 12 lds r25, 0x123B ; 0x80123b 2678e: 91 11 cpse r25, r1 26790: 21 c0 rjmp .+66 ; 0x267d4 26792: c6 2f mov r28, r22 26794: d8 2f mov r29, r24 if (isPreheat) { 26796: 88 23 and r24, r24 26798: 09 f1 breq .+66 ; 0x267dc lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 2679a: 88 ee ldi r24, 0xE8 ; 232 2679c: 96 e9 ldi r25, 0x96 ; 150 2679e: 66 23 and r22, r22 267a0: 11 f0 breq .+4 ; 0x267a6 267a2: 86 ef ldi r24, 0xF6 ; 246 267a4: 96 e9 ldi r25, 0x96 ; 150 267a6: 63 e0 ldi r22, 0x03 ; 3 267a8: 0e 94 1d d8 call 0x1b03a ; 0x1b03a SERIAL_ERROR_START; 267ac: 81 eb ldi r24, 0xB1 ; 177 267ae: 91 ea ldi r25, 0xA1 ; 161 267b0: 0e 94 94 7a call 0xf528 ; 0xf528 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 267b4: 85 ec ldi r24, 0xC5 ; 197 267b6: 96 e9 ldi r25, 0x96 ; 150 { if(IsStopped() == false) { if (isPreheat) { lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 267b8: c1 11 cpse r28, r1 267ba: 02 c0 rjmp .+4 ; 0x267c0 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 267bc: 83 ea ldi r24, 0xA3 ; 163 267be: 96 e9 ldi r25, 0x96 ; 150 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"); 267c0: 0e 94 8d 7c call 0xf91a ; 0xf91a } } prusa_statistics(0); 267c4: 80 e0 ldi r24, 0x00 ; 0 267c6: 0f 94 02 30 call 0x26004 ; 0x26004 prusa_statistics(isPreheat? 91 : 90); 267ca: 8a e5 ldi r24, 0x5A ; 90 267cc: d1 11 cpse r29, r1 267ce: 8b e5 ldi r24, 0x5B ; 91 267d0: 0f 94 02 30 call 0x26004 ; 0x26004 } ThermalStop(); } 267d4: df 91 pop r29 267d6: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 267d8: 0d 94 27 67 jmp 0x2ce4e ; 0x2ce4e 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); 267dc: 8f e7 ldi r24, 0x7F ; 127 267de: 96 e9 ldi r25, 0x96 ; 150 267e0: 66 23 and r22, r22 267e2: 11 f0 breq .+4 ; 0x267e8 267e4: 8f e8 ldi r24, 0x8F ; 143 267e6: 96 e9 ldi r25, 0x96 ; 150 267e8: 63 e0 ldi r22, 0x03 ; 3 267ea: 0e 94 1d d8 call 0x1b03a ; 0x1b03a SERIAL_ERROR_START; 267ee: 81 eb ldi r24, 0xB1 ; 177 267f0: 91 ea ldi r25, 0xA1 ; 161 267f2: 0e 94 94 7a call 0xf528 ; 0xf528 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 267f6: 86 e6 ldi r24, 0x66 ; 102 267f8: 96 e9 ldi r25, 0x96 ; 150 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) { 267fa: c1 11 cpse r28, r1 267fc: e1 cf rjmp .-62 ; 0x267c0 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 267fe: 8e e4 ldi r24, 0x4E ; 78 26800: 96 e9 ldi r25, 0x96 ; 150 26802: de cf rjmp .-68 ; 0x267c0 00026804 : #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) { 26804: 2f 92 push r2 26806: 3f 92 push r3 26808: 4f 92 push r4 2680a: 5f 92 push r5 2680c: 6f 92 push r6 2680e: 7f 92 push r7 26810: 8f 92 push r8 26812: 9f 92 push r9 26814: af 92 push r10 26816: bf 92 push r11 26818: cf 92 push r12 2681a: df 92 push r13 2681c: ef 92 push r14 2681e: ff 92 push r15 26820: 0f 93 push r16 26822: 1f 93 push r17 26824: cf 93 push r28 26826: df 93 push r29 26828: cd b7 in r28, 0x3d ; 61 2682a: de b7 in r29, 0x3e ; 62 2682c: e0 97 sbiw r28, 0x30 ; 48 2682e: 0f b6 in r0, 0x3f ; 63 26830: f8 94 cli 26832: de bf out 0x3e, r29 ; 62 26834: 0f be out 0x3f, r0 ; 63 26836: cd bf out 0x3d, r28 ; 61 26838: 6a 87 std Y+10, r22 ; 0x0a 2683a: 7b 87 std Y+11, r23 ; 0x0b 2683c: 8c 87 std Y+12, r24 ; 0x0c 2683e: 9d 87 std Y+13, r25 ; 0x0d 26840: 1a 01 movw r2, r20 26842: 3a a7 std Y+42, r19 ; 0x2a 26844: 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(); 26846: 0f 94 3d 0e call 0x21c7a ; 0x21c7a pid_tuning_finished = false; 2684a: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.427> // 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; 2684e: 29 a5 ldd r18, Y+41 ; 0x29 26850: 3a a5 ldd r19, Y+42 ; 0x2a 26852: 30 93 01 06 sts 0x0601, r19 ; 0x800601 26856: 20 93 00 06 sts 0x0600, r18 ; 0x800600 float input = 0.0; pid_cycle=0; 2685a: 10 92 03 06 sts 0x0603, r1 ; 0x800603 2685e: 10 92 02 06 sts 0x0602, r1 ; 0x800602 bool heating = true; unsigned long temp_millis = _millis(); 26862: 0f 94 56 0b call 0x216ac ; 0x216ac 26866: 6e 83 std Y+6, r22 ; 0x06 26868: 7f 83 std Y+7, r23 ; 0x07 2686a: 88 87 std Y+8, r24 ; 0x08 2686c: 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 2686e: 37 fe sbrs r3, 7 26870: ff c0 rjmp .+510 ; 0x26a70 26872: 3d e2 ldi r19, 0x2D ; 45 26874: 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(); 26876: 0f 94 56 0b call 0x216ac ; 0x216ac 2687a: 6c a3 std Y+36, r22 ; 0x24 2687c: 7d a3 std Y+37, r23 ; 0x25 2687e: 8e a3 std Y+38, r24 ; 0x26 26880: 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."); 26882: 89 eb ldi r24, 0xB9 ; 185 26884: 94 e9 ldi r25, 0x94 ; 148 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); #endif if ((extruder >= EXTRUDERS) 26886: 12 14 cp r1, r2 26888: 13 04 cpc r1, r3 2688a: 0c f4 brge .+2 ; 0x2688e 2688c: 8a c2 rjmp .+1300 ; 0x26da2 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 2688e: 86 ea ldi r24, 0xA6 ; 166 26890: 94 e9 ldi r25, 0x94 ; 148 26892: 0e 94 8d 7c call 0xf91a ; 0xf91a 26896: 6a 85 ldd r22, Y+10 ; 0x0a 26898: 7b 85 ldd r23, Y+11 ; 0x0b 2689a: 8c 85 ldd r24, Y+12 ; 0x0c 2689c: 9d 85 ldd r25, Y+13 ; 0x0d 2689e: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 268a2: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 268a4: 21 14 cp r2, r1 268a6: 31 04 cpc r3, r1 268a8: 09 f4 brne .+2 ; 0x268ac 268aa: e5 c0 rjmp .+458 ; 0x26a76 { soft_pwm_bed = (MAX_BED_POWER)/2; 268ac: 20 93 ee 05 sts 0x05EE, r18 ; 0x8005ee bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 268b0: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 268b4: 60 93 59 12 sts 0x1259, r22 ; 0x801259 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 268b8: 8e 81 ldd r24, Y+6 ; 0x06 268ba: 9f 81 ldd r25, Y+7 ; 0x07 268bc: a8 85 ldd r26, Y+8 ; 0x08 268be: b9 85 ldd r27, Y+9 ; 0x09 268c0: 8e 87 std Y+14, r24 ; 0x0e 268c2: 9f 87 std Y+15, r25 ; 0x0f 268c4: a8 8b std Y+16, r26 ; 0x10 268c6: b9 8b std Y+17, r27 ; 0x11 268c8: 88 a3 std Y+32, r24 ; 0x20 268ca: 99 a3 std Y+33, r25 ; 0x21 268cc: aa a3 std Y+34, r26 ; 0x22 268ce: bb a3 std Y+35, r27 ; 0x23 268d0: 1a 8a std Y+18, r1 ; 0x12 268d2: 90 e4 ldi r25, 0x40 ; 64 268d4: 9b 8b std Y+19, r25 ; 0x13 268d6: ac e1 ldi r26, 0x1C ; 28 268d8: ac 8b std Y+20, r26 ; 0x14 268da: b6 e4 ldi r27, 0x46 ; 70 268dc: bd 8b std Y+21, r27 ; 0x15 268de: 1e 8a std Y+22, r1 ; 0x16 268e0: 1f 8a std Y+23, r1 ; 0x17 268e2: 18 8e std Y+24, r1 ; 0x18 268e4: 19 8e std Y+25, r1 ; 0x19 268e6: 6f e7 ldi r22, 0x7F ; 127 268e8: c6 2e mov r12, r22 268ea: d1 2c mov r13, r1 268ec: e1 2c mov r14, r1 268ee: f1 2c mov r15, r1 268f0: 00 e0 ldi r16, 0x00 ; 0 268f2: 10 e0 ldi r17, 0x00 ; 0 268f4: 18 aa std Y+48, r1 ; 0x30 268f6: 1f a6 std Y+47, r1 ; 0x2f 268f8: 1d 82 std Y+5, r1 ; 0x05 268fa: 2f e7 ldi r18, 0x7F ; 127 268fc: 30 e0 ldi r19, 0x00 ; 0 268fe: 40 e0 ldi r20, 0x00 ; 0 26900: 50 e0 ldi r21, 0x00 ; 0 26902: 29 83 std Y+1, r18 ; 0x01 26904: 3a 83 std Y+2, r19 ; 0x02 26906: 4b 83 std Y+3, r20 ; 0x03 26908: 5c 83 std Y+4, r21 ; 0x04 2690a: 1b 8e std Y+27, r1 ; 0x1b 2690c: 1c 8e std Y+28, r1 ; 0x1c 2690e: 1d 8e std Y+29, r1 ; 0x1d 26910: 1e 8e std Y+30, r1 ; 0x1e 26912: 31 e0 ldi r19, 0x01 ; 1 26914: 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(); 26916: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 26918: 40 91 d5 05 lds r20, 0x05D5 ; 0x8005d5 2691c: 48 a7 std Y+40, r20 ; 0x28 2691e: 44 23 and r20, r20 26920: 09 f4 brne .+2 ; 0x26924 26922: 2c c2 rjmp .+1112 ; 0x26d7c updateTemperatures(); 26924: 0f 94 0a 00 call 0x20014 ; 0x20014 input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 26928: 21 14 cp r2, r1 2692a: 31 04 cpc r3, r1 2692c: 09 f0 breq .+2 ; 0x26930 2692e: aa c0 rjmp .+340 ; 0x26a84 26930: 00 91 5a 0d lds r16, 0x0D5A ; 0x800d5a 26934: 10 91 5b 0d lds r17, 0x0D5B ; 0x800d5b 26938: 50 91 5c 0d lds r21, 0x0D5C ; 0x800d5c 2693c: 58 ab std Y+48, r21 ; 0x30 2693e: 80 91 5d 0d lds r24, 0x0D5D ; 0x800d5d 26942: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 26944: 2e 89 ldd r18, Y+22 ; 0x16 26946: 3f 89 ldd r19, Y+23 ; 0x17 26948: 48 8d ldd r20, Y+24 ; 0x18 2694a: 59 8d ldd r21, Y+25 ; 0x19 2694c: b8 01 movw r22, r16 2694e: 88 a9 ldd r24, Y+48 ; 0x30 26950: 9f a5 ldd r25, Y+47 ; 0x2f 26952: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 26956: 87 fd sbrc r24, 7 26958: 06 c0 rjmp .+12 ; 0x26966 2695a: 0e 8b std Y+22, r16 ; 0x16 2695c: 1f 8b std Y+23, r17 ; 0x17 2695e: b8 a9 ldd r27, Y+48 ; 0x30 26960: b8 8f std Y+24, r27 ; 0x18 26962: 2f a5 ldd r18, Y+47 ; 0x2f 26964: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 26966: 2a 89 ldd r18, Y+18 ; 0x12 26968: 3b 89 ldd r19, Y+19 ; 0x13 2696a: 4c 89 ldd r20, Y+20 ; 0x14 2696c: 5d 89 ldd r21, Y+21 ; 0x15 2696e: b8 01 movw r22, r16 26970: 88 a9 ldd r24, Y+48 ; 0x30 26972: 9f a5 ldd r25, Y+47 ; 0x2f 26974: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 26978: 18 16 cp r1, r24 2697a: 34 f0 brlt .+12 ; 0x26988 2697c: 0a 8b std Y+18, r16 ; 0x12 2697e: 1b 8b std Y+19, r17 ; 0x13 26980: 38 a9 ldd r19, Y+48 ; 0x30 26982: 3c 8b std Y+20, r19 ; 0x14 26984: 4f a5 ldd r20, Y+47 ; 0x2f 26986: 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) { 26988: 0f 94 56 0b call 0x216ac ; 0x216ac 2698c: 2c a1 ldd r18, Y+36 ; 0x24 2698e: 3d a1 ldd r19, Y+37 ; 0x25 26990: 4e a1 ldd r20, Y+38 ; 0x26 26992: 5f a1 ldd r21, Y+39 ; 0x27 26994: 62 1b sub r22, r18 26996: 73 0b sbc r23, r19 26998: 84 0b sbc r24, r20 2699a: 95 0b sbc r25, r21 2699c: 65 3c cpi r22, 0xC5 ; 197 2699e: 79 40 sbci r23, 0x09 ; 9 269a0: 81 05 cpc r24, r1 269a2: 91 05 cpc r25, r1 269a4: 40 f0 brcs .+16 ; 0x269b6 checkExtruderAutoFans(); 269a6: 0e 94 cb 77 call 0xef96 ; 0xef96 extruder_autofan_last_check = _millis(); 269aa: 0f 94 56 0b call 0x216ac ; 0x216ac 269ae: 6c a3 std Y+36, r22 ; 0x24 269b0: 7d a3 std Y+37, r23 ; 0x25 269b2: 8e a3 std Y+38, r24 ; 0x26 269b4: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 269b6: 4a 8d ldd r20, Y+26 ; 0x1a 269b8: 44 23 and r20, r20 269ba: 09 f4 brne .+2 ; 0x269be 269bc: 4c c0 rjmp .+152 ; 0x26a56 269be: 2a 85 ldd r18, Y+10 ; 0x0a 269c0: 3b 85 ldd r19, Y+11 ; 0x0b 269c2: 4c 85 ldd r20, Y+12 ; 0x0c 269c4: 5d 85 ldd r21, Y+13 ; 0x0d 269c6: b8 01 movw r22, r16 269c8: 88 a9 ldd r24, Y+48 ; 0x30 269ca: 9f a5 ldd r25, Y+47 ; 0x2f 269cc: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 269d0: 18 16 cp r1, r24 269d2: 0c f0 brlt .+2 ; 0x269d6 269d4: d3 c1 rjmp .+934 ; 0x26d7c if(_millis() - t2 > 5000) { 269d6: 0f 94 56 0b call 0x216ac ; 0x216ac 269da: 2e 85 ldd r18, Y+14 ; 0x0e 269dc: 3f 85 ldd r19, Y+15 ; 0x0f 269de: 48 89 ldd r20, Y+16 ; 0x10 269e0: 59 89 ldd r21, Y+17 ; 0x11 269e2: 62 1b sub r22, r18 269e4: 73 0b sbc r23, r19 269e6: 84 0b sbc r24, r20 269e8: 95 0b sbc r25, r21 269ea: 69 38 cpi r22, 0x89 ; 137 269ec: 73 41 sbci r23, 0x13 ; 19 269ee: 81 05 cpc r24, r1 269f0: 91 05 cpc r25, r1 269f2: 08 f4 brcc .+2 ; 0x269f6 269f4: c3 c1 rjmp .+902 ; 0x26d7c 269f6: d7 01 movw r26, r14 269f8: c6 01 movw r24, r12 269fa: 29 81 ldd r18, Y+1 ; 0x01 269fc: 3a 81 ldd r19, Y+2 ; 0x02 269fe: 4b 81 ldd r20, Y+3 ; 0x03 26a00: 5c 81 ldd r21, Y+4 ; 0x04 26a02: 82 1b sub r24, r18 26a04: 93 0b sbc r25, r19 26a06: a4 0b sbc r26, r20 26a08: b5 0b sbc r27, r21 26a0a: b5 95 asr r27 26a0c: a7 95 ror r26 26a0e: 97 95 ror r25 26a10: 87 95 ror r24 heating=false; if (extruder<0) { 26a12: 21 14 cp r2, r1 26a14: 31 04 cpc r3, r1 26a16: 09 f4 brne .+2 ; 0x26a1a 26a18: 40 c0 rjmp .+128 ; 0x26a9a soft_pwm_bed = (bias - d) >> 1; 26a1a: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 26a1e: 0f 94 56 0b call 0x216ac ; 0x216ac 26a22: 6e 83 std Y+6, r22 ; 0x06 26a24: 7f 83 std Y+7, r23 ; 0x07 26a26: 88 87 std Y+8, r24 ; 0x08 26a28: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 26a2a: dc 01 movw r26, r24 26a2c: cb 01 movw r24, r22 26a2e: 2e 85 ldd r18, Y+14 ; 0x0e 26a30: 3f 85 ldd r19, Y+15 ; 0x0f 26a32: 48 89 ldd r20, Y+16 ; 0x10 26a34: 59 89 ldd r21, Y+17 ; 0x11 26a36: 82 1b sub r24, r18 26a38: 93 0b sbc r25, r19 26a3a: a4 0b sbc r26, r20 26a3c: b5 0b sbc r27, r21 26a3e: 8b 8f std Y+27, r24 ; 0x1b 26a40: 9c 8f std Y+28, r25 ; 0x1c 26a42: ad 8f std Y+29, r26 ; 0x1d 26a44: be 8f std Y+30, r27 ; 0x1e max=temp; 26a46: 3a 85 ldd r19, Y+10 ; 0x0a 26a48: 3e 8b std Y+22, r19 ; 0x16 26a4a: 4b 85 ldd r20, Y+11 ; 0x0b 26a4c: 4f 8b std Y+23, r20 ; 0x17 26a4e: 5c 85 ldd r21, Y+12 ; 0x0c 26a50: 58 8f std Y+24, r21 ; 0x18 26a52: 8d 85 ldd r24, Y+13 ; 0x0d 26a54: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 26a56: 2a 85 ldd r18, Y+10 ; 0x0a 26a58: 3b 85 ldd r19, Y+11 ; 0x0b 26a5a: 4c 85 ldd r20, Y+12 ; 0x0c 26a5c: 5d 85 ldd r21, Y+13 ; 0x0d 26a5e: b8 01 movw r22, r16 26a60: 88 a9 ldd r24, Y+48 ; 0x30 26a62: 9f a5 ldd r25, Y+47 ; 0x2f 26a64: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 26a68: 87 fd sbrc r24, 7 26a6a: 1a c0 rjmp .+52 ; 0x26aa0 if(_millis() - t1 > 5000) { 26a6c: 1a 8e std Y+26, r1 ; 0x1a 26a6e: 86 c1 rjmp .+780 ; 0x26d7c 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 26a70: 4a e0 ldi r20, 0x0A ; 10 26a72: 4f 8f std Y+31, r20 ; 0x1f 26a74: 00 cf rjmp .-512 ; 0x26876 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; 26a76: 20 93 f5 05 sts 0x05F5, r18 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 26a7a: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 26a7e: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 26a82: 1a cf rjmp .-460 ; 0x268b8 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 26a84: 00 91 bc 03 lds r16, 0x03BC ; 0x8003bc 26a88: 10 91 bd 03 lds r17, 0x03BD ; 0x8003bd 26a8c: 90 91 be 03 lds r25, 0x03BE ; 0x8003be 26a90: 98 ab std Y+48, r25 ; 0x30 26a92: a0 91 bf 03 lds r26, 0x03BF ; 0x8003bf 26a96: af a7 std Y+47, r26 ; 0x2f 26a98: 55 cf rjmp .-342 ; 0x26944 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 26a9a: 80 93 f5 05 sts 0x05F5, r24 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> 26a9e: bf cf rjmp .-130 ; 0x26a1e t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 26aa0: 0f 94 56 0b call 0x216ac ; 0x216ac 26aa4: 2e 81 ldd r18, Y+6 ; 0x06 26aa6: 3f 81 ldd r19, Y+7 ; 0x07 26aa8: 48 85 ldd r20, Y+8 ; 0x08 26aaa: 59 85 ldd r21, Y+9 ; 0x09 26aac: 62 1b sub r22, r18 26aae: 73 0b sbc r23, r19 26ab0: 84 0b sbc r24, r20 26ab2: 95 0b sbc r25, r21 26ab4: 69 38 cpi r22, 0x89 ; 137 26ab6: 73 41 sbci r23, 0x13 ; 19 26ab8: 81 05 cpc r24, r1 26aba: 91 05 cpc r25, r1 26abc: b8 f2 brcs .-82 ; 0x26a6c heating=true; t2=_millis(); 26abe: 0f 94 56 0b call 0x216ac ; 0x216ac 26ac2: 6e 87 std Y+14, r22 ; 0x0e 26ac4: 7f 87 std Y+15, r23 ; 0x0f 26ac6: 88 8b std Y+16, r24 ; 0x10 26ac8: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 26aca: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26ace: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26ad2: 18 16 cp r1, r24 26ad4: 19 06 cpc r1, r25 26ad6: 0c f0 brlt .+2 ; 0x26ada 26ad8: 2c c1 rjmp .+600 ; 0x26d32 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 26ada: 8e 85 ldd r24, Y+14 ; 0x0e 26adc: 9f 85 ldd r25, Y+15 ; 0x0f 26ade: a8 89 ldd r26, Y+16 ; 0x10 26ae0: b9 89 ldd r27, Y+17 ; 0x11 26ae2: 2e 81 ldd r18, Y+6 ; 0x06 26ae4: 3f 81 ldd r19, Y+7 ; 0x07 26ae6: 48 85 ldd r20, Y+8 ; 0x08 26ae8: 59 85 ldd r21, Y+9 ; 0x09 26aea: 82 1b sub r24, r18 26aec: 93 0b sbc r25, r19 26aee: a4 0b sbc r26, r20 26af0: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 26af2: 4b 8c ldd r4, Y+27 ; 0x1b 26af4: 5c 8c ldd r5, Y+28 ; 0x1c 26af6: 6d 8c ldd r6, Y+29 ; 0x1d 26af8: 7e 8c ldd r7, Y+30 ; 0x1e 26afa: 48 0e add r4, r24 26afc: 59 1e adc r5, r25 26afe: 6a 1e adc r6, r26 26b00: 7b 1e adc r7, r27 26b02: 2b 8d ldd r18, Y+27 ; 0x1b 26b04: 3c 8d ldd r19, Y+28 ; 0x1c 26b06: 4d 8d ldd r20, Y+29 ; 0x1d 26b08: 5e 8d ldd r21, Y+30 ; 0x1e 26b0a: 28 1b sub r18, r24 26b0c: 39 0b sbc r19, r25 26b0e: 4a 0b sbc r20, r26 26b10: 5b 0b sbc r21, r27 26b12: 69 81 ldd r22, Y+1 ; 0x01 26b14: 7a 81 ldd r23, Y+2 ; 0x02 26b16: 8b 81 ldd r24, Y+3 ; 0x03 26b18: 9c 81 ldd r25, Y+4 ; 0x04 26b1a: 0f 94 00 a4 call 0x34800 ; 0x34800 <__mulsi3> 26b1e: a3 01 movw r20, r6 26b20: 92 01 movw r18, r4 26b22: 0f 94 8e a4 call 0x3491c ; 0x3491c <__divmodsi4> 26b26: da 01 movw r26, r20 26b28: c9 01 movw r24, r18 26b2a: 8c 0d add r24, r12 26b2c: 9d 1d adc r25, r13 26b2e: ae 1d adc r26, r14 26b30: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 26b32: 84 31 cpi r24, 0x14 ; 20 26b34: 91 05 cpc r25, r1 26b36: a1 05 cpc r26, r1 26b38: b1 05 cpc r27, r1 26b3a: 0c f4 brge .+2 ; 0x26b3e 26b3c: 3c c1 rjmp .+632 ; 0x26db6 26b3e: 6c 01 movw r12, r24 26b40: 7d 01 movw r14, r26 26b42: 3c ee ldi r19, 0xEC ; 236 26b44: c3 16 cp r12, r19 26b46: d1 04 cpc r13, r1 26b48: e1 04 cpc r14, r1 26b4a: f1 04 cpc r15, r1 26b4c: 2c f0 brlt .+10 ; 0x26b58 26b4e: 4b ee ldi r20, 0xEB ; 235 26b50: c4 2e mov r12, r20 26b52: d1 2c mov r13, r1 26b54: e1 2c mov r14, r1 26b56: 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; 26b58: 80 38 cpi r24, 0x80 ; 128 26b5a: 91 05 cpc r25, r1 26b5c: a1 05 cpc r26, r1 26b5e: b1 05 cpc r27, r1 26b60: 0c f4 brge .+2 ; 0x26b64 26b62: 37 c1 rjmp .+622 ; 0x26dd2 26b64: 8e ef ldi r24, 0xFE ; 254 26b66: 90 e0 ldi r25, 0x00 ; 0 26b68: a0 e0 ldi r26, 0x00 ; 0 26b6a: b0 e0 ldi r27, 0x00 ; 0 26b6c: 8c 19 sub r24, r12 26b6e: 9d 09 sbc r25, r13 26b70: ae 09 sbc r26, r14 26b72: bf 09 sbc r27, r15 26b74: 89 83 std Y+1, r24 ; 0x01 26b76: 9a 83 std Y+2, r25 ; 0x02 26b78: ab 83 std Y+3, r26 ; 0x03 26b7a: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 26b7c: 8e e9 ldi r24, 0x9E ; 158 26b7e: 94 e9 ldi r25, 0x94 ; 148 26b80: 0e 94 94 7a call 0xf528 ; 0xf528 26b84: c7 01 movw r24, r14 26b86: b6 01 movw r22, r12 26b88: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 26b8c: 89 e9 ldi r24, 0x99 ; 153 26b8e: 94 e9 ldi r25, 0x94 ; 148 26b90: 0e 94 94 7a call 0xf528 ; 0xf528 26b94: 69 81 ldd r22, Y+1 ; 0x01 26b96: 7a 81 ldd r23, Y+2 ; 0x02 26b98: 8b 81 ldd r24, Y+3 ; 0x03 26b9a: 9c 81 ldd r25, Y+4 ; 0x04 26b9c: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 26ba0: 82 e9 ldi r24, 0x92 ; 146 26ba2: 94 e9 ldi r25, 0x94 ; 148 26ba4: 0e 94 94 7a call 0xf528 ; 0xf528 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 26ba8: 42 e0 ldi r20, 0x02 ; 2 26baa: 6a 89 ldd r22, Y+18 ; 0x12 26bac: 7b 89 ldd r23, Y+19 ; 0x13 26bae: 8c 89 ldd r24, Y+20 ; 0x14 26bb0: 9d 89 ldd r25, Y+21 ; 0x15 26bb2: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 26bb6: 8b e8 ldi r24, 0x8B ; 139 26bb8: 94 e9 ldi r25, 0x94 ; 148 26bba: 0e 94 94 7a call 0xf528 ; 0xf528 26bbe: 6e 89 ldd r22, Y+22 ; 0x16 26bc0: 7f 89 ldd r23, Y+23 ; 0x17 26bc2: 88 8d ldd r24, Y+24 ; 0x18 26bc4: 99 8d ldd r25, Y+25 ; 0x19 26bc6: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 if(pid_cycle > 2) { 26bca: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26bce: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26bd2: 03 97 sbiw r24, 0x03 ; 3 26bd4: 0c f4 brge .+2 ; 0x26bd8 26bd6: ad c0 rjmp .+346 ; 0x26d32 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 26bd8: 69 81 ldd r22, Y+1 ; 0x01 26bda: 7a 81 ldd r23, Y+2 ; 0x02 26bdc: 8b 81 ldd r24, Y+3 ; 0x03 26bde: 9c 81 ldd r25, Y+4 ; 0x04 26be0: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 26be4: 20 e0 ldi r18, 0x00 ; 0 26be6: 30 e0 ldi r19, 0x00 ; 0 26be8: 40 e8 ldi r20, 0x80 ; 128 26bea: 50 e4 ldi r21, 0x40 ; 64 26bec: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 26bf0: 4b 01 movw r8, r22 26bf2: 5c 01 movw r10, r24 26bf4: 2a 89 ldd r18, Y+18 ; 0x12 26bf6: 3b 89 ldd r19, Y+19 ; 0x13 26bf8: 4c 89 ldd r20, Y+20 ; 0x14 26bfa: 5d 89 ldd r21, Y+21 ; 0x15 26bfc: 6e 89 ldd r22, Y+22 ; 0x16 26bfe: 7f 89 ldd r23, Y+23 ; 0x17 26c00: 88 8d ldd r24, Y+24 ; 0x18 26c02: 99 8d ldd r25, Y+25 ; 0x19 26c04: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 26c08: 20 ed ldi r18, 0xD0 ; 208 26c0a: 3f e0 ldi r19, 0x0F ; 15 26c0c: 49 e4 ldi r20, 0x49 ; 73 26c0e: 50 e4 ldi r21, 0x40 ; 64 26c10: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 26c14: 20 e0 ldi r18, 0x00 ; 0 26c16: 30 e0 ldi r19, 0x00 ; 0 26c18: 40 e0 ldi r20, 0x00 ; 0 26c1a: 5f e3 ldi r21, 0x3F ; 63 26c1c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 26c20: 9b 01 movw r18, r22 26c22: ac 01 movw r20, r24 26c24: c5 01 movw r24, r10 26c26: b4 01 movw r22, r8 26c28: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 26c2c: 4b 01 movw r8, r22 26c2e: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 26c30: c3 01 movw r24, r6 26c32: b2 01 movw r22, r4 26c34: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 26c38: 20 e0 ldi r18, 0x00 ; 0 26c3a: 30 e0 ldi r19, 0x00 ; 0 26c3c: 4a e7 ldi r20, 0x7A ; 122 26c3e: 54 e4 ldi r21, 0x44 ; 68 26c40: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 26c44: 2b 01 movw r4, r22 26c46: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 26c48: 85 e8 ldi r24, 0x85 ; 133 26c4a: 94 e9 ldi r25, 0x94 ; 148 26c4c: 0e 94 94 7a call 0xf528 ; 0xf528 26c50: 42 e0 ldi r20, 0x02 ; 2 26c52: c5 01 movw r24, r10 26c54: b4 01 movw r22, r8 26c56: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 26c5a: 8f e7 ldi r24, 0x7F ; 127 26c5c: 94 e9 ldi r25, 0x94 ; 148 26c5e: 0e 94 94 7a call 0xf528 ; 0xf528 26c62: c3 01 movw r24, r6 26c64: b2 01 movw r22, r4 26c66: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 _Kp = 0.6*Ku; 26c6a: 2a e9 ldi r18, 0x9A ; 154 26c6c: 39 e9 ldi r19, 0x99 ; 153 26c6e: 49 e1 ldi r20, 0x19 ; 25 26c70: 5f e3 ldi r21, 0x3F ; 63 26c72: c5 01 movw r24, r10 26c74: b4 01 movw r22, r8 26c76: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 26c7a: 4b 01 movw r8, r22 26c7c: 5c 01 movw r10, r24 26c7e: 80 92 da 03 sts 0x03DA, r8 ; 0x8003da <_Kp> 26c82: 90 92 db 03 sts 0x03DB, r9 ; 0x8003db <_Kp+0x1> 26c86: a0 92 dc 03 sts 0x03DC, r10 ; 0x8003dc <_Kp+0x2> 26c8a: b0 92 dd 03 sts 0x03DD, r11 ; 0x8003dd <_Kp+0x3> _Ki = 2*_Kp/Tu; 26c8e: ac 01 movw r20, r24 26c90: 9b 01 movw r18, r22 26c92: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 26c96: a3 01 movw r20, r6 26c98: 92 01 movw r18, r4 26c9a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 26c9e: 60 93 d6 03 sts 0x03D6, r22 ; 0x8003d6 <_Ki> 26ca2: 70 93 d7 03 sts 0x03D7, r23 ; 0x8003d7 <_Ki+0x1> 26ca6: 80 93 d8 03 sts 0x03D8, r24 ; 0x8003d8 <_Ki+0x2> 26caa: 90 93 d9 03 sts 0x03D9, r25 ; 0x8003d9 <_Ki+0x3> _Kd = _Kp*Tu/8; 26cae: a3 01 movw r20, r6 26cb0: 92 01 movw r18, r4 26cb2: c5 01 movw r24, r10 26cb4: b4 01 movw r22, r8 26cb6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 26cba: 20 e0 ldi r18, 0x00 ; 0 26cbc: 30 e0 ldi r19, 0x00 ; 0 26cbe: 40 e0 ldi r20, 0x00 ; 0 26cc0: 5e e3 ldi r21, 0x3E ; 62 26cc2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 26cc6: 60 93 d2 03 sts 0x03D2, r22 ; 0x8003d2 <_Kd> 26cca: 70 93 d3 03 sts 0x03D3, r23 ; 0x8003d3 <_Kd+0x1> 26cce: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 <_Kd+0x2> 26cd2: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 26cd6: 81 e7 ldi r24, 0x71 ; 113 26cd8: 94 e9 ldi r25, 0x94 ; 148 26cda: 0e 94 8d 7c call 0xf91a ; 0xf91a SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 26cde: 8b e6 ldi r24, 0x6B ; 107 26ce0: 94 e9 ldi r25, 0x94 ; 148 26ce2: 0e 94 94 7a call 0xf528 ; 0xf528 26ce6: 60 91 da 03 lds r22, 0x03DA ; 0x8003da <_Kp> 26cea: 70 91 db 03 lds r23, 0x03DB ; 0x8003db <_Kp+0x1> 26cee: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc <_Kp+0x2> 26cf2: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd <_Kp+0x3> 26cf6: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 26cfa: 85 e6 ldi r24, 0x65 ; 101 26cfc: 94 e9 ldi r25, 0x94 ; 148 26cfe: 0e 94 94 7a call 0xf528 ; 0xf528 26d02: 60 91 d6 03 lds r22, 0x03D6 ; 0x8003d6 <_Ki> 26d06: 70 91 d7 03 lds r23, 0x03D7 ; 0x8003d7 <_Ki+0x1> 26d0a: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 26d0e: 90 91 d9 03 lds r25, 0x03D9 ; 0x8003d9 <_Ki+0x3> 26d12: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 26d16: 8f e5 ldi r24, 0x5F ; 95 26d18: 94 e9 ldi r25, 0x94 ; 148 26d1a: 0e 94 94 7a call 0xf528 ; 0xf528 26d1e: 60 91 d2 03 lds r22, 0x03D2 ; 0x8003d2 <_Kd> 26d22: 70 91 d3 03 lds r23, 0x03D3 ; 0x8003d3 <_Kd+0x1> 26d26: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 26d2a: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_Kd+0x3> 26d2e: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 26d32: 89 81 ldd r24, Y+1 ; 0x01 26d34: 9a 81 ldd r25, Y+2 ; 0x02 26d36: ab 81 ldd r26, Y+3 ; 0x03 26d38: bc 81 ldd r27, Y+4 ; 0x04 26d3a: 8c 0d add r24, r12 26d3c: 9d 1d adc r25, r13 26d3e: ae 1d adc r26, r14 26d40: bf 1d adc r27, r15 26d42: b5 95 asr r27 26d44: a7 95 ror r26 26d46: 97 95 ror r25 26d48: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 26d4a: 21 14 cp r2, r1 26d4c: 31 04 cpc r3, r1 26d4e: 09 f4 brne .+2 ; 0x26d52 26d50: 45 c0 rjmp .+138 ; 0x26ddc { soft_pwm_bed = (bias + d) >> 1; 26d52: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 26d56: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26d5a: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26d5e: 01 96 adiw r24, 0x01 ; 1 26d60: 90 93 03 06 sts 0x0603, r25 ; 0x800603 26d64: 80 93 02 06 sts 0x0602, r24 ; 0x800602 min=temp; 26d68: 3a 85 ldd r19, Y+10 ; 0x0a 26d6a: 3a 8b std Y+18, r19 ; 0x12 26d6c: 4b 85 ldd r20, Y+11 ; 0x0b 26d6e: 4b 8b std Y+19, r20 ; 0x13 26d70: 5c 85 ldd r21, Y+12 ; 0x0c 26d72: 5c 8b std Y+20, r21 ; 0x14 26d74: 8d 85 ldd r24, Y+13 ; 0x0d 26d76: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 26d78: 98 a5 ldd r25, Y+40 ; 0x28 26d7a: 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)) { 26d7c: 20 e0 ldi r18, 0x00 ; 0 26d7e: 30 e0 ldi r19, 0x00 ; 0 26d80: 40 ea ldi r20, 0xA0 ; 160 26d82: 51 e4 ldi r21, 0x41 ; 65 26d84: 6a 85 ldd r22, Y+10 ; 0x0a 26d86: 7b 85 ldd r23, Y+11 ; 0x0b 26d88: 8c 85 ldd r24, Y+12 ; 0x0c 26d8a: 9d 85 ldd r25, Y+13 ; 0x0d 26d8c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 26d90: 98 01 movw r18, r16 26d92: 48 a9 ldd r20, Y+48 ; 0x30 26d94: 5f a5 ldd r21, Y+47 ; 0x2f 26d96: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 26d9a: 87 ff sbrs r24, 7 26d9c: 22 c0 rjmp .+68 ; 0x26de2 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 26d9e: 85 e3 ldi r24, 0x35 ; 53 26da0: 94 e9 ldi r25, 0x94 ; 148 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"); 26da2: 0e 94 8d 7c call 0xf91a ; 0xf91a pid_tuning_finished = true; 26da6: 81 e0 ldi r24, 0x01 ; 1 26da8: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.427> pid_cycle = 0; 26dac: 10 92 03 06 sts 0x0603, r1 ; 0x800603 26db0: 10 92 02 06 sts 0x0602, r1 ; 0x800602 26db4: 98 c0 rjmp .+304 ; 0x26ee6 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); 26db6: 34 e1 ldi r19, 0x14 ; 20 26db8: c3 2e mov r12, r19 26dba: d1 2c mov r13, r1 26dbc: e1 2c mov r14, r1 26dbe: f1 2c mov r15, r1 26dc0: 24 e1 ldi r18, 0x14 ; 20 26dc2: 30 e0 ldi r19, 0x00 ; 0 26dc4: 40 e0 ldi r20, 0x00 ; 0 26dc6: 50 e0 ldi r21, 0x00 ; 0 26dc8: 29 83 std Y+1, r18 ; 0x01 26dca: 3a 83 std Y+2, r19 ; 0x02 26dcc: 4b 83 std Y+3, r20 ; 0x03 26dce: 5c 83 std Y+4, r21 ; 0x04 26dd0: d5 ce rjmp .-598 ; 0x26b7c 26dd2: c9 82 std Y+1, r12 ; 0x01 26dd4: da 82 std Y+2, r13 ; 0x02 26dd6: eb 82 std Y+3, r14 ; 0x03 26dd8: fc 82 std Y+4, r15 ; 0x04 26dda: d0 ce rjmp .-608 ; 0x26b7c if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 26ddc: 80 93 f5 05 sts 0x05F5, r24 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> 26de0: ba cf rjmp .-140 ; 0x26d56 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 26de2: 0f 94 56 0b call 0x216ac ; 0x216ac 26de6: 28 a1 ldd r18, Y+32 ; 0x20 26de8: 39 a1 ldd r19, Y+33 ; 0x21 26dea: 4a a1 ldd r20, Y+34 ; 0x22 26dec: 5b a1 ldd r21, Y+35 ; 0x23 26dee: 62 1b sub r22, r18 26df0: 73 0b sbc r23, r19 26df2: 84 0b sbc r24, r20 26df4: 95 0b sbc r25, r21 26df6: 61 3d cpi r22, 0xD1 ; 209 26df8: 77 40 sbci r23, 0x07 ; 7 26dfa: 81 05 cpc r24, r1 26dfc: 91 05 cpc r25, r1 26dfe: 58 f1 brcs .+86 ; 0x26e56 int p; if (extruder<0){ p=soft_pwm_bed; 26e00: a0 90 ee 05 lds r10, 0x05EE ; 0x8005ee 26e04: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 26e06: 82 e3 ldi r24, 0x32 ; 50 26e08: 94 e9 ldi r25, 0x94 ; 148 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 26e0a: 21 14 cp r2, r1 26e0c: 31 04 cpc r3, r1 26e0e: 29 f4 brne .+10 ; 0x26e1a p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 26e10: a0 90 f5 05 lds r10, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.504> 26e14: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 26e16: 8f e2 ldi r24, 0x2F ; 47 26e18: 94 e9 ldi r25, 0x94 ; 148 26e1a: 0e 94 94 7a call 0xf528 ; 0xf528 26e1e: 42 e0 ldi r20, 0x02 ; 2 26e20: b8 01 movw r22, r16 26e22: 88 a9 ldd r24, Y+48 ; 0x30 26e24: 9f a5 ldd r25, Y+47 ; 0x2f 26e26: 0e 94 16 7a call 0xf42c ; 0xf42c } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 26e2a: 8b e2 ldi r24, 0x2B ; 43 26e2c: 94 e9 ldi r25, 0x94 ; 148 26e2e: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_PROTOCOLLN(p); 26e32: c5 01 movw r24, r10 26e34: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e if (safety_check_cycles == 0) { //save ambient temp 26e38: 4d 81 ldd r20, Y+5 ; 0x05 26e3a: 44 23 and r20, r20 26e3c: 09 f4 brne .+2 ; 0x26e40 26e3e: 6c c0 rjmp .+216 ; 0x26f18 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 26e40: 5f 8d ldd r21, Y+31 ; 0x1f 26e42: 45 17 cp r20, r21 26e44: 70 f5 brcc .+92 ; 0x26ea2 safety_check_cycles++; 26e46: 4f 5f subi r20, 0xFF ; 255 26e48: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 26e4a: 0f 94 56 0b call 0x216ac ; 0x216ac 26e4e: 68 a3 std Y+32, r22 ; 0x20 26e50: 79 a3 std Y+33, r23 ; 0x21 26e52: 8a a3 std Y+34, r24 ; 0x22 26e54: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 26e56: 0f 94 56 0b call 0x216ac ; 0x216ac 26e5a: 4b 01 movw r8, r22 26e5c: 5c 01 movw r10, r24 26e5e: 0f 94 56 0b call 0x216ac ; 0x216ac 26e62: 4e 80 ldd r4, Y+6 ; 0x06 26e64: 5f 80 ldd r5, Y+7 ; 0x07 26e66: 68 84 ldd r6, Y+8 ; 0x08 26e68: 79 84 ldd r7, Y+9 ; 0x09 26e6a: 2e 85 ldd r18, Y+14 ; 0x0e 26e6c: 3f 85 ldd r19, Y+15 ; 0x0f 26e6e: 48 89 ldd r20, Y+16 ; 0x10 26e70: 59 89 ldd r21, Y+17 ; 0x11 26e72: 42 0e add r4, r18 26e74: 53 1e adc r5, r19 26e76: 64 1e adc r6, r20 26e78: 75 1e adc r7, r21 26e7a: 84 18 sub r8, r4 26e7c: 95 08 sbc r9, r5 26e7e: a6 08 sbc r10, r6 26e80: b7 08 sbc r11, r7 26e82: 86 0e add r8, r22 26e84: 97 1e adc r9, r23 26e86: a8 1e adc r10, r24 26e88: b9 1e adc r11, r25 26e8a: 31 e8 ldi r19, 0x81 ; 129 26e8c: 83 16 cp r8, r19 26e8e: 3f e4 ldi r19, 0x4F ; 79 26e90: 93 06 cpc r9, r19 26e92: 32 e1 ldi r19, 0x12 ; 18 26e94: a3 06 cpc r10, r19 26e96: b1 04 cpc r11, r1 26e98: 08 f4 brcc .+2 ; 0x26e9c 26e9a: 47 c0 rjmp .+142 ; 0x26f2a SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 26e9c: 8e e0 ldi r24, 0x0E ; 14 26e9e: 94 e9 ldi r25, 0x94 ; 148 26ea0: 80 cf rjmp .-256 ; 0x26da2 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 26ea2: 8d 81 ldd r24, Y+5 ; 0x05 26ea4: 9f 8d ldd r25, Y+31 ; 0x1f 26ea6: 89 13 cpse r24, r25 26ea8: d0 cf rjmp .-96 ; 0x26e4a safety_check_cycles++; 26eaa: 8f 5f subi r24, 0xFF ; 255 26eac: 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) { 26eae: 2b a5 ldd r18, Y+43 ; 0x2b 26eb0: 3c a5 ldd r19, Y+44 ; 0x2c 26eb2: 4d a5 ldd r20, Y+45 ; 0x2d 26eb4: 5e a5 ldd r21, Y+46 ; 0x2e 26eb6: b8 01 movw r22, r16 26eb8: 88 a9 ldd r24, Y+48 ; 0x30 26eba: 9f a5 ldd r25, Y+47 ; 0x2f 26ebc: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 26ec0: 9f 77 andi r25, 0x7F ; 127 26ec2: 20 e0 ldi r18, 0x00 ; 0 26ec4: 30 e0 ldi r19, 0x00 ; 0 26ec6: 40 ea ldi r20, 0xA0 ; 160 26ec8: 50 e4 ldi r21, 0x40 ; 64 26eca: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 26ece: 87 ff sbrs r24, 7 26ed0: bc cf rjmp .-136 ; 0x26e4a temp_runaway_stop(false, (extruder<0)); 26ed2: 63 2d mov r22, r3 26ed4: 66 1f adc r22, r22 26ed6: 66 27 eor r22, r22 26ed8: 66 1f adc r22, r22 26eda: 80 e0 ldi r24, 0x00 ; 0 26edc: 0f 94 c3 33 call 0x26786 ; 0x26786 pid_tuning_finished = true; 26ee0: 81 e0 ldi r24, 0x01 ; 1 26ee2: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.427> pid_cycle = 0; return; } lcd_update(0); } } 26ee6: e0 96 adiw r28, 0x30 ; 48 26ee8: 0f b6 in r0, 0x3f ; 63 26eea: f8 94 cli 26eec: de bf out 0x3e, r29 ; 62 26eee: 0f be out 0x3f, r0 ; 63 26ef0: cd bf out 0x3d, r28 ; 61 26ef2: df 91 pop r29 26ef4: cf 91 pop r28 26ef6: 1f 91 pop r17 26ef8: 0f 91 pop r16 26efa: ff 90 pop r15 26efc: ef 90 pop r14 26efe: df 90 pop r13 26f00: cf 90 pop r12 26f02: bf 90 pop r11 26f04: af 90 pop r10 26f06: 9f 90 pop r9 26f08: 8f 90 pop r8 26f0a: 7f 90 pop r7 26f0c: 6f 90 pop r6 26f0e: 5f 90 pop r5 26f10: 4f 90 pop r4 26f12: 3f 90 pop r3 26f14: 2f 90 pop r2 26f16: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 26f18: 0b a7 std Y+43, r16 ; 0x2b 26f1a: 1c a7 std Y+44, r17 ; 0x2c 26f1c: a8 a9 ldd r26, Y+48 ; 0x30 26f1e: ad a7 std Y+45, r26 ; 0x2d 26f20: bf a5 ldd r27, Y+47 ; 0x2f 26f22: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 26f24: 21 e0 ldi r18, 0x01 ; 1 26f26: 2d 83 std Y+5, r18 ; 0x05 26f28: 90 cf rjmp .-224 ; 0x26e4a SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 26f2a: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26f2e: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26f32: 49 a5 ldd r20, Y+41 ; 0x29 26f34: 5a a5 ldd r21, Y+42 ; 0x2a 26f36: 48 17 cp r20, r24 26f38: 59 07 cpc r21, r25 26f3a: 1c f4 brge .+6 ; 0x26f42 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 26f3c: 82 eb ldi r24, 0xB2 ; 178 26f3e: 93 e9 ldi r25, 0x93 ; 147 26f40: 30 cf rjmp .-416 ; 0x26da2 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 26f42: 80 e0 ldi r24, 0x00 ; 0 26f44: 0e 94 c9 6e call 0xdd92 ; 0xdd92 26f48: e6 cc rjmp .-1588 ; 0x26916 00026f4a : } void handle_temp_error(); void manage_heater() { 26f4a: cf 92 push r12 26f4c: df 92 push r13 26f4e: ef 92 push r14 26f50: ff 92 push r15 26f52: 0f 93 push r16 26f54: 1f 93 push r17 26f56: cf 93 push r28 26f58: df 93 push r29 26f5a: 1f 92 push r1 26f5c: 1f 92 push r1 26f5e: cd b7 in r28, 0x3d ; 61 26f60: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 26f62: 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) 26f64: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 26f68: 88 23 and r24, r24 26f6a: 09 f4 brne .+2 ; 0x26f6e 26f6c: 29 c2 rjmp .+1106 ; 0x273c0 return; // syncronize temperatures with isr updateTemperatures(); 26f6e: 0f 94 0a 00 call 0x20014 ; 0x20014 if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 26f72: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 26f76: 88 23 and r24, r24 26f78: 89 f1 breq .+98 ; 0x26fdc #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 26f7a: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 26f7e: 82 95 swap r24 26f80: 86 95 lsr r24 26f82: 87 70 andi r24, 0x07 ; 7 26f84: 81 30 cpi r24, 0x01 ; 1 26f86: 01 f1 breq .+64 ; 0x26fc8 26f88: 08 f4 brcc .+2 ; 0x26f8c 26f8a: be c1 rjmp .+892 ; 0x27308 26f8c: 84 30 cpi r24, 0x04 ; 4 26f8e: 30 f5 brcc .+76 ; 0x26fdc #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 26f90: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 26f94: 86 95 lsr r24 26f96: 86 95 lsr r24 26f98: 83 70 andi r24, 0x03 ; 3 26f9a: 82 30 cpi r24, 0x02 ; 2 26f9c: f8 f4 brcc .+62 ; 0x26fdc case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 26f9e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 26fa2: 86 95 lsr r24 26fa4: 86 95 lsr r24 26fa6: 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), 26fa8: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 26fac: 92 95 swap r25 26fae: 96 95 lsr r25 26fb0: 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( 26fb2: 61 e0 ldi r22, 0x01 ; 1 26fb4: 81 30 cpi r24, 0x01 ; 1 26fb6: 09 f0 breq .+2 ; 0x26fba 26fb8: 60 e0 ldi r22, 0x00 ; 0 26fba: 81 e0 ldi r24, 0x01 ; 1 26fbc: 92 30 cpi r25, 0x02 ; 2 26fbe: 09 f0 breq .+2 ; 0x26fc2 26fc0: 80 e0 ldi r24, 0x00 ; 0 26fc2: 0f 94 c3 33 call 0x26786 ; 0x26786 26fc6: 0a c0 rjmp .+20 ; 0x26fdc void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 26fc8: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 26fcc: 86 95 lsr r24 26fce: 86 95 lsr r24 26fd0: 83 70 andi r24, 0x03 ; 3 26fd2: 09 f4 brne .+2 ; 0x26fd6 26fd4: 4b c1 rjmp .+662 ; 0x2726c 26fd6: 81 30 cpi r24, 0x01 ; 1 26fd8: 09 f4 brne .+2 ; 0x26fdc 26fda: 79 c1 rjmp .+754 ; 0x272ce #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)) { 26fdc: 0f 94 56 0b call 0x216ac ; 0x216ac 26fe0: 00 91 07 17 lds r16, 0x1707 ; 0x801707 26fe4: 10 91 08 17 lds r17, 0x1708 ; 0x801708 26fe8: 20 91 09 17 lds r18, 0x1709 ; 0x801709 26fec: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 26ff0: 60 1b sub r22, r16 26ff2: 71 0b sbc r23, r17 26ff4: 82 0b sbc r24, r18 26ff6: 93 0b sbc r25, r19 26ff8: 69 38 cpi r22, 0x89 ; 137 26ffa: 73 41 sbci r23, 0x13 ; 19 26ffc: 81 05 cpc r24, r1 26ffe: 91 05 cpc r25, r1 27000: d0 f0 brcs .+52 ; 0x27036 27002: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 27006: 81 11 cpse r24, r1 27008: 16 c0 rjmp .+44 ; 0x27036 extruder_autofan_last_check = _millis(); 2700a: 0f 94 56 0b call 0x216ac ; 0x216ac 2700e: 60 93 07 17 sts 0x1707, r22 ; 0x801707 27012: 70 93 08 17 sts 0x1708, r23 ; 0x801708 27016: 80 93 09 17 sts 0x1709, r24 ; 0x801709 2701a: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fanSpeedBckp = fanSpeedSoftPwm; 2701e: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 27022: 80 93 65 02 sts 0x0265, r24 ; 0x800265 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 27026: 8b 34 cpi r24, 0x4B ; 75 27028: 18 f0 brcs .+6 ; 0x27030 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 2702a: 8f ef ldi r24, 0xFF ; 255 2702c: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } fan_measuring = true; 27030: 81 e0 ldi r24, 0x01 ; 1 27032: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 27036: 0f 94 56 0b call 0x216ac ; 0x216ac 2703a: 00 91 07 17 lds r16, 0x1707 ; 0x801707 2703e: 10 91 08 17 lds r17, 0x1708 ; 0x801708 27042: 20 91 09 17 lds r18, 0x1709 ; 0x801709 27046: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 2704a: 60 1b sub r22, r16 2704c: 71 0b sbc r23, r17 2704e: 82 0b sbc r24, r18 27050: 93 0b sbc r25, r19 27052: 65 36 cpi r22, 0x65 ; 101 27054: 71 05 cpc r23, r1 27056: 81 05 cpc r24, r1 27058: 91 05 cpc r25, r1 2705a: 08 f4 brcc .+2 ; 0x2705e 2705c: a5 c1 rjmp .+842 ; 0x273a8 2705e: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 27062: 88 23 and r24, r24 27064: 09 f4 brne .+2 ; 0x27068 27066: a0 c1 rjmp .+832 ; 0x273a8 #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))); 27068: 60 91 b5 05 lds r22, 0x05B5 ; 0x8005b5 2706c: 70 91 b6 05 lds r23, 0x05B6 ; 0x8005b6 27070: 07 2e mov r0, r23 27072: 00 0c add r0, r0 27074: 88 0b sbc r24, r24 27076: 99 0b sbc r25, r25 27078: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2707c: 6b 01 movw r12, r22 2707e: 7c 01 movw r14, r24 27080: 0f 94 56 0b call 0x216ac ; 0x216ac 27084: 00 91 07 17 lds r16, 0x1707 ; 0x801707 27088: 10 91 08 17 lds r17, 0x1708 ; 0x801708 2708c: 20 91 09 17 lds r18, 0x1709 ; 0x801709 27090: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 27094: 60 1b sub r22, r16 27096: 71 0b sbc r23, r17 27098: 82 0b sbc r24, r18 2709a: 93 0b sbc r25, r19 2709c: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 270a0: 9b 01 movw r18, r22 270a2: ac 01 movw r20, r24 270a4: 60 e0 ldi r22, 0x00 ; 0 270a6: 70 e0 ldi r23, 0x00 ; 0 270a8: 8a e7 ldi r24, 0x7A ; 122 270aa: 93 e4 ldi r25, 0x43 ; 67 270ac: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 270b0: a7 01 movw r20, r14 270b2: 96 01 movw r18, r12 270b4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 270b8: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 270bc: 70 93 b8 03 sts 0x03B8, r23 ; 0x8003b8 270c0: 60 93 b7 03 sts 0x03B7, r22 ; 0x8003b7 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 270c4: 60 91 b7 05 lds r22, 0x05B7 ; 0x8005b7 270c8: 70 91 b8 05 lds r23, 0x05B8 ; 0x8005b8 270cc: 07 2e mov r0, r23 270ce: 00 0c add r0, r0 270d0: 88 0b sbc r24, r24 270d2: 99 0b sbc r25, r25 270d4: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 270d8: 6b 01 movw r12, r22 270da: 7c 01 movw r14, r24 270dc: 0f 94 56 0b call 0x216ac ; 0x216ac 270e0: 00 91 07 17 lds r16, 0x1707 ; 0x801707 270e4: 10 91 08 17 lds r17, 0x1708 ; 0x801708 270e8: 20 91 09 17 lds r18, 0x1709 ; 0x801709 270ec: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 270f0: 60 1b sub r22, r16 270f2: 71 0b sbc r23, r17 270f4: 82 0b sbc r24, r18 270f6: 93 0b sbc r25, r19 270f8: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 270fc: 9b 01 movw r18, r22 270fe: ac 01 movw r20, r24 27100: 60 e0 ldi r22, 0x00 ; 0 27102: 70 e0 ldi r23, 0x00 ; 0 27104: 8a e7 ldi r24, 0x7A ; 122 27106: 93 e4 ldi r25, 0x43 ; 67 27108: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 2710c: a7 01 movw r20, r14 2710e: 96 01 movw r18, r12 27110: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27114: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 27118: 70 93 ba 03 sts 0x03BA, r23 ; 0x8003ba 2711c: 60 93 b9 03 sts 0x03B9, r22 ; 0x8003b9 /*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; 27120: 10 92 b6 05 sts 0x05B6, r1 ; 0x8005b6 27124: 10 92 b5 05 sts 0x05B5, r1 ; 0x8005b5 fan_edge_counter[1] = 0; 27128: 10 92 b8 05 sts 0x05B8, r1 ; 0x8005b8 2712c: 10 92 b7 05 sts 0x05B7, r1 ; 0x8005b7 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 27130: 83 e0 ldi r24, 0x03 ; 3 27132: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 27134: 82 e0 ldi r24, 0x02 ; 2 27136: 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) 27138: 80 91 40 02 lds r24, 0x0240 ; 0x800240 2713c: 88 23 and r24, r24 2713e: 51 f0 breq .+20 ; 0x27154 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 27140: 87 e8 ldi r24, 0x87 ; 135 27142: 9f e0 ldi r25, 0x0F ; 15 27144: 0f 94 9d a3 call 0x3473a ; 0x3473a 27148: 91 e0 ldi r25, 0x01 ; 1 2714a: 81 11 cpse r24, r1 2714c: 01 c0 rjmp .+2 ; 0x27150 2714e: 90 e0 ldi r25, 0x00 ; 0 27150: 90 93 40 02 sts 0x0240, r25 ; 0x800240 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]++;} 27154: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 27158: 90 91 b8 03 lds r25, 0x03B8 ; 0x8003b8 2715c: 44 97 sbiw r24, 0x14 ; 20 2715e: 0c f0 brlt .+2 ; 0x27162 27160: f2 c0 rjmp .+484 ; 0x27346 27162: 20 e0 ldi r18, 0x00 ; 0 27164: 30 e0 ldi r19, 0x00 ; 0 27166: 48 e4 ldi r20, 0x48 ; 72 27168: 52 e4 ldi r21, 0x42 ; 66 2716a: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2716e: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 27172: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 27176: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2717a: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2717e: 18 16 cp r1, r24 27180: 0c f0 brlt .+2 ; 0x27184 27182: e1 c0 rjmp .+450 ; 0x27346 27184: 80 91 80 05 lds r24, 0x0580 ; 0x800580 27188: 8f 5f subi r24, 0xFF ; 255 2718a: 80 93 80 05 sts 0x0580, r24 ; 0x800580 if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; 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){ 2718e: 80 91 80 05 lds r24, 0x0580 ; 0x800580 27192: 81 11 cpse r24, r1 27194: 0b c0 rjmp .+22 ; 0x271ac 27196: 80 91 81 05 lds r24, 0x0581 ; 0x800581 2719a: 81 11 cpse r24, r1 2719c: 07 c0 rjmp .+14 ; 0x271ac 2719e: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 271a2: 82 30 cpi r24, 0x02 ; 2 271a4: 19 f4 brne .+6 ; 0x271ac // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 271a6: 81 e0 ldi r24, 0x01 ; 1 271a8: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 271ac: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 271b0: 81 30 cpi r24, 0x01 ; 1 271b2: 61 f4 brne .+24 ; 0x271cc 271b4: 0e 94 61 66 call 0xccc2 ; 0xccc2 271b8: 81 11 cpse r24, r1 271ba: 08 c0 rjmp .+16 ; 0x271cc fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 271bc: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 271c0: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> 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 271c4: 86 ee ldi r24, 0xE6 ; 230 271c6: 9b e6 ldi r25, 0x6B ; 107 271c8: 0e 94 85 dc call 0x1b90a ; 0x1b90a } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 271cc: 80 91 40 02 lds r24, 0x0240 ; 0x800240 271d0: 88 23 and r24, r24 271d2: 09 f4 brne .+2 ; 0x271d6 271d4: d9 c0 rjmp .+434 ; 0x27388 271d6: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 271da: 82 30 cpi r24, 0x02 ; 2 271dc: 09 f4 brne .+2 ; 0x271e0 271de: d4 c0 rjmp .+424 ; 0x27388 271e0: 80 e8 ldi r24, 0x80 ; 128 271e2: e8 2e mov r14, r24 271e4: 85 e0 ldi r24, 0x05 ; 5 271e6: f8 2e mov r15, r24 271e8: ce 01 movw r24, r28 271ea: 01 96 adiw r24, 0x01 ; 1 271ec: 6c 01 movw r12, r24 { for (uint8_t fan = 0; fan < 2; fan++) 271ee: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 271f0: 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]) 271f2: f7 01 movw r30, r14 271f4: 91 91 ld r25, Z+ 271f6: 7f 01 movw r14, r30 271f8: f6 01 movw r30, r12 271fa: 81 91 ld r24, Z+ 271fc: 6f 01 movw r12, r30 271fe: 89 17 cp r24, r25 27200: 80 f5 brcc .+96 ; 0x27262 { fan_speed_errors[fan] = 0; 27202: f7 01 movw r30, r14 27204: 31 97 sbiw r30, 0x01 ; 1 27206: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 27208: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 2720c: 82 30 cpi r24, 0x02 ; 2 2720e: 49 f1 breq .+82 ; 0x27262 fan_check_error = EFCE_REPORTED; 27210: 00 93 ce 03 sts 0x03CE, r16 ; 0x8003ce if (printJobOngoing()) { 27214: 0e 94 10 66 call 0xcc20 ; 0xcc20 27218: 88 23 and r24, r24 2721a: 09 f4 brne .+2 ; 0x2721e 2721c: 9a c0 rjmp .+308 ; 0x27352 // A print is ongoing, pause the print normally if(!printingIsPaused()) { 2721e: 0e 94 05 66 call 0xcc0a ; 0xcc0a 27222: 81 11 cpse r24, r1 27224: 07 c0 rjmp .+14 ; 0x27234 if (usb_timer.running()) 27226: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2722a: 88 23 and r24, r24 2722c: 09 f4 brne .+2 ; 0x27230 2722e: 8e c0 rjmp .+284 ; 0x2734c lcd_pause_usb_print(); 27230: 0f 94 69 05 call 0x20ad2 ; 0x20ad2 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 27234: 11 30 cpi r17, 0x01 ; 1 27236: 09 f4 brne .+2 ; 0x2723a 27238: 93 c0 rjmp .+294 ; 0x27360 //! 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); 2723a: 83 ee ldi r24, 0xE3 ; 227 2723c: 94 e9 ldi r25, 0x94 ; 148 2723e: 0e 94 8d 7c call 0xf91a ; 0xf91a if (get_message_level() == 0) { 27242: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> 27246: 81 11 cpse r24, r1 27248: 0c c0 rjmp .+24 ; 0x27262 Sound_MakeCustom(200,0,true); 2724a: 41 e0 ldi r20, 0x01 ; 1 2724c: 70 e0 ldi r23, 0x00 ; 0 2724e: 60 e0 ldi r22, 0x00 ; 0 27250: 88 ec ldi r24, 0xC8 ; 200 27252: 90 e0 ldi r25, 0x00 ; 0 27254: 0f 94 55 25 call 0x24aaa ; 0x24aaa LCD_ALERTMESSAGERPGM(lcdMsg); 27258: 62 e0 ldi r22, 0x02 ; 2 2725a: 82 e2 ldi r24, 0x22 ; 34 2725c: 98 e6 ldi r25, 0x68 ; 104 2725e: 0e 94 1d d8 call 0x1b03a ; 0x1b03a 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++) 27262: 11 30 cpi r17, 0x01 ; 1 27264: 09 f4 brne .+2 ; 0x27268 27266: 90 c0 rjmp .+288 ; 0x27388 27268: 11 e0 ldi r17, 0x01 ; 1 2726a: c3 cf rjmp .-122 ; 0x271f2 case TempErrorSource::hotend: if(temp_error_state.assert) { 2726c: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 27270: 81 ff sbrs r24, 1 27272: 12 c0 rjmp .+36 ; 0x27298 min_temp_error(temp_error_state.index); 27274: 60 91 cc 03 lds r22, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 27278: 62 95 swap r22 2727a: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 2727c: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 27280: 81 11 cpse r24, r1 27282: 07 c0 rjmp .+14 ; 0x27292 temp_error_messagepgm(err, e); 27284: 8e e3 ldi r24, 0x3E ; 62 27286: 95 e9 ldi r25, 0x95 ; 149 27288: 0f 94 8d 0d call 0x21b1a ; 0x21b1a prusa_statistics(92); 2728c: 8c e5 ldi r24, 0x5C ; 92 2728e: 0f 94 02 30 call 0x26004 ; 0x26004 } ThermalStop(); 27292: 0f 94 27 67 call 0x2ce4e ; 0x2ce4e 27296: a2 ce rjmp .-700 ; 0x26fdc // 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); 27298: 60 91 0d 04 lds r22, 0x040D ; 0x80040d <_ZL8minttemp.lto_priv.428> 2729c: 70 91 0e 04 lds r23, 0x040E ; 0x80040e <_ZL8minttemp.lto_priv.428+0x1> 272a0: 6b 5f subi r22, 0xFB ; 251 272a2: 7f 4f sbci r23, 0xFF ; 255 272a4: 07 2e mov r0, r23 272a6: 00 0c add r0, r0 272a8: 88 0b sbc r24, r24 272aa: 99 0b sbc r25, r25 272ac: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 272b0: 8b 01 movw r16, r22 272b2: 9c 01 movw r18, r24 272b4: 40 91 5a 0d lds r20, 0x0D5A ; 0x800d5a 272b8: 50 91 5b 0d lds r21, 0x0D5B ; 0x800d5b 272bc: 60 91 5c 0d lds r22, 0x0D5C ; 0x800d5c 272c0: 70 91 5d 0d lds r23, 0x0D5D ; 0x800d5d 272c4: 8a e6 ldi r24, 0x6A ; 106 272c6: 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); 272c8: 0f 94 af 05 call 0x20b5e ; 0x20b5e 272cc: 87 ce rjmp .-754 ; 0x26fdc // 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) { 272ce: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 272d2: 81 ff sbrs r24, 1 272d4: 0a c0 rjmp .+20 ; 0x272ea ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 272d6: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 272da: 81 11 cpse r24, r1 272dc: da cf rjmp .-76 ; 0x27292 temp_error_messagepgm(err); 272de: 61 e0 ldi r22, 0x01 ; 1 272e0: 82 e3 ldi r24, 0x32 ; 50 272e2: 95 e9 ldi r25, 0x95 ; 149 ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { temp_error_messagepgm(PSTR("MAXTEMP BED")); 272e4: 0f 94 8d 0d call 0x21b1a ; 0x21b1a 272e8: d4 cf rjmp .-88 ; 0x27292 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); 272ea: 40 91 bc 03 lds r20, 0x03BC ; 0x8003bc 272ee: 50 91 bd 03 lds r21, 0x03BD ; 0x8003bd 272f2: 60 91 be 03 lds r22, 0x03BE ; 0x8003be 272f6: 70 91 bf 03 lds r23, 0x03BF ; 0x8003bf 272fa: 00 e0 ldi r16, 0x00 ; 0 272fc: 10 e0 ldi r17, 0x00 ; 0 272fe: 2c e0 ldi r18, 0x0C ; 12 27300: 32 e4 ldi r19, 0x42 ; 66 27302: 86 e6 ldi r24, 0x66 ; 102 27304: 92 e0 ldi r25, 0x02 ; 2 27306: e0 cf rjmp .-64 ; 0x272c8 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 27308: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 2730c: 86 95 lsr r24 2730e: 86 95 lsr r24 27310: 83 70 andi r24, 0x03 ; 3 27312: 59 f0 breq .+22 ; 0x2732a 27314: 81 30 cpi r24, 0x01 ; 1 27316: 09 f0 breq .+2 ; 0x2731a 27318: 61 ce rjmp .-830 ; 0x26fdc } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 2731a: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2731e: 81 11 cpse r24, r1 27320: b8 cf rjmp .-144 ; 0x27292 temp_error_messagepgm(PSTR("MAXTEMP BED")); 27322: 61 e0 ldi r22, 0x01 ; 1 27324: 8e e4 ldi r24, 0x4E ; 78 27326: 95 e9 ldi r25, 0x95 ; 149 27328: dd cf rjmp .-70 ; 0x272e4 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 2732a: 60 91 cc 03 lds r22, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.426> 2732e: 62 95 swap r22 27330: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 27332: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 27336: 81 11 cpse r24, r1 27338: ac cf rjmp .-168 ; 0x27292 temp_error_messagepgm(PSTR("MAXTEMP"), e); 2733a: 86 e4 ldi r24, 0x46 ; 70 2733c: 95 e9 ldi r25, 0x95 ; 149 2733e: 0f 94 8d 0d call 0x21b1a ; 0x21b1a prusa_statistics(93); 27342: 8d e5 ldi r24, 0x5D ; 93 27344: a4 cf rjmp .-184 ; 0x2728e 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; 27346: 10 92 80 05 sts 0x0580, r1 ; 0x800580 2734a: 21 cf rjmp .-446 ; 0x2718e // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 2734c: 0f 94 62 0b call 0x216c4 ; 0x216c4 27350: 71 cf rjmp .-286 ; 0x27234 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 27352: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 27356: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 2735a: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb 2735e: 6a cf rjmp .-300 ; 0x27234 //! 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); 27360: 8b e0 ldi r24, 0x0B ; 11 27362: 95 e9 ldi r25, 0x95 ; 149 27364: 0e 94 8d 7c call 0xf91a ; 0xf91a if (get_message_level() == 0) { 27368: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.423> 2736c: 81 11 cpse r24, r1 2736e: 0c c0 rjmp .+24 ; 0x27388 Sound_MakeCustom(200,0,true); 27370: 41 e0 ldi r20, 0x01 ; 1 27372: 70 e0 ldi r23, 0x00 ; 0 27374: 60 e0 ldi r22, 0x00 ; 0 27376: 88 ec ldi r24, 0xC8 ; 200 27378: 90 e0 ldi r25, 0x00 ; 0 2737a: 0f 94 55 25 call 0x24aaa ; 0x24aaa LCD_ALERTMESSAGERPGM(lcdMsg); 2737e: 62 e0 ldi r22, 0x02 ; 2 27380: 83 e4 ldi r24, 0x43 ; 67 27382: 9a e6 ldi r25, 0x6A ; 106 27384: 0e 94 1d d8 call 0x1b03a ; 0x1b03a } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 27388: 80 91 65 02 lds r24, 0x0265 ; 0x800265 2738c: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d //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(); 27390: 0f 94 56 0b call 0x216ac ; 0x216ac 27394: 60 93 07 17 sts 0x1707, r22 ; 0x801707 27398: 70 93 08 17 sts 0x1708, r23 ; 0x801708 2739c: 80 93 09 17 sts 0x1709, r24 ; 0x801709 273a0: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fan_measuring = false; 273a4: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 273a8: 0f 90 pop r0 273aa: 0f 90 pop r0 273ac: df 91 pop r29 273ae: cf 91 pop r28 273b0: 1f 91 pop r17 273b2: 0f 91 pop r16 273b4: ff 90 pop r15 273b6: ef 90 pop r14 273b8: df 90 pop r13 273ba: cf 90 pop r12 } #endif //FANCHECK checkExtruderAutoFans(); 273bc: 0c 94 cb 77 jmp 0xef96 ; 0xef96 273c0: 0f 90 pop r0 273c2: 0f 90 pop r0 273c4: df 91 pop r29 273c6: cf 91 pop r28 273c8: 1f 91 pop r17 273ca: 0f 91 pop r16 273cc: ff 90 pop r15 273ce: ef 90 pop r14 273d0: df 90 pop r13 273d2: cf 90 pop r12 273d4: 08 95 ret 000273d6 : } #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; } 273d6: 20 91 38 12 lds r18, 0x1238 ; 0x801238 273da: 30 91 39 12 lds r19, 0x1239 ; 0x801239 273de: bc 01 movw r22, r24 273e0: c9 01 movw r24, r18 273e2: 82 5b subi r24, 0xB2 ; 178 273e4: 9f 4e sbci r25, 0xEF ; 239 273e6: 0f 94 a4 a1 call 0x34348 ; 0x34348 273ea: 9c 01 movw r18, r24 273ec: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 273f0: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 273f4: 81 e0 ldi r24, 0x01 ; 1 273f6: 23 2b or r18, r19 273f8: 09 f4 brne .+2 ; 0x273fc 273fa: 80 e0 ldi r24, 0x00 ; 0 273fc: 08 95 ret 000273fe : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 273fe: 60 91 3e 0d lds r22, 0x0D3E ; 0x800d3e uint8_t _block_buffer_tail = block_buffer_tail; 27402: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f uint16_t sdlen = 0; 27406: 30 e0 ldi r19, 0x00 ; 0 27408: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2740a: 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) 2740c: 96 17 cp r25, r22 2740e: 61 f0 breq .+24 ; 0x27428 { sdlen += block_buffer[_block_buffer_tail].sdlen; 27410: 89 9f mul r24, r25 27412: f0 01 movw r30, r0 27414: 11 24 eor r1, r1 27416: e6 53 subi r30, 0x36 ; 54 27418: f9 4f sbci r31, 0xF9 ; 249 2741a: 40 81 ld r20, Z 2741c: 51 81 ldd r21, Z+1 ; 0x01 2741e: 24 0f add r18, r20 27420: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 27422: 9f 5f subi r25, 0xFF ; 255 27424: 9f 70 andi r25, 0x0F ; 15 27426: f2 cf rjmp .-28 ; 0x2740c } return sdlen; } 27428: c9 01 movw r24, r18 2742a: 08 95 ret 0002742c : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2742c: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 27430: 20 91 3f 0d lds r18, 0x0D3F ; 0x800d3f 27434: 32 17 cp r19, r18 27436: 91 f0 breq .+36 ; 0x2745c // 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; 27438: e0 91 3e 0d lds r30, 0x0D3E ; 0x800d3e } // 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) 2743c: e1 11 cpse r30, r1 2743e: 01 c0 rjmp .+2 ; 0x27442 block_index = BLOCK_BUFFER_SIZE; 27440: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 27442: 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; 27444: 2e e6 ldi r18, 0x6E ; 110 27446: e2 9f mul r30, r18 27448: f0 01 movw r30, r0 2744a: 11 24 eor r1, r1 2744c: e6 53 subi r30, 0x36 ; 54 2744e: f9 4f sbci r31, 0xF9 ; 249 27450: 20 81 ld r18, Z 27452: 31 81 ldd r19, Z+1 ; 0x01 27454: 82 0f add r24, r18 27456: 93 1f adc r25, r19 27458: 91 83 std Z+1, r25 ; 0x01 2745a: 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. } } 2745c: 08 95 ret 0002745e : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2745e: cf 92 push r12 27460: df 92 push r13 27462: ef 92 push r14 27464: ff 92 push r15 27466: 0f 93 push r16 27468: 1f 93 push r17 2746a: cf 93 push r28 2746c: df 93 push r29 2746e: 0b e6 ldi r16, 0x6B ; 107 27470: 1d e0 ldi r17, 0x0D ; 13 27472: cb ea ldi r28, 0xAB ; 171 27474: d4 e0 ldi r29, 0x04 ; 4 27476: 8b eb ldi r24, 0xBB ; 187 27478: c8 2e mov r12, r24 2747a: 84 e0 ldi r24, 0x04 ; 4 2747c: d8 2e mov r13, r24 2747e: 78 01 movw r14, r16 27480: 0c 5f subi r16, 0xFC ; 252 27482: 1f 4f sbci r17, 0xFF ; 255 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]; 27484: f7 01 movw r30, r14 27486: 60 a1 ldd r22, Z+32 ; 0x20 27488: 71 a1 ldd r23, Z+33 ; 0x21 2748a: 82 a1 ldd r24, Z+34 ; 0x22 2748c: 93 a1 ldd r25, Z+35 ; 0x23 2748e: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 27492: f7 01 movw r30, r14 27494: 20 81 ld r18, Z 27496: 31 81 ldd r19, Z+1 ; 0x01 27498: 42 81 ldd r20, Z+2 ; 0x02 2749a: 53 81 ldd r21, Z+3 ; 0x03 2749c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 274a0: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 274a4: 69 93 st Y+, r22 274a6: 79 93 st Y+, r23 274a8: 89 93 st Y+, r24 274aa: 99 93 st Y+, r25 #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++) 274ac: cc 16 cp r12, r28 274ae: dd 06 cpc r13, r29 274b0: 31 f7 brne .-52 ; 0x2747e max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 274b2: df 91 pop r29 274b4: cf 91 pop r28 274b6: 1f 91 pop r17 274b8: 0f 91 pop r16 274ba: ff 90 pop r15 274bc: ef 90 pop r14 274be: df 90 pop r13 274c0: cf 90 pop r12 274c2: 08 95 ret 000274c4 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 274c4: fc 01 movw r30, r24 274c6: 40 81 ld r20, Z 274c8: 51 81 ldd r21, Z+1 ; 0x01 274ca: 62 81 ldd r22, Z+2 ; 0x02 274cc: 73 81 ldd r23, Z+3 ; 0x03 274ce: 40 93 42 04 sts 0x0442, r20 ; 0x800442 274d2: 50 93 43 04 sts 0x0443, r21 ; 0x800443 274d6: 60 93 44 04 sts 0x0444, r22 ; 0x800444 274da: 70 93 45 04 sts 0x0445, r23 ; 0x800445 #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 274de: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 274e2: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 274e6: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 274ea: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 274ee: 60 81 ld r22, Z 274f0: 71 81 ldd r23, Z+1 ; 0x01 274f2: 82 81 ldd r24, Z+2 ; 0x02 274f4: 93 81 ldd r25, Z+3 ; 0x03 274f6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 274fa: 0f 94 02 a8 call 0x35004 ; 0x35004 274fe: ec e3 ldi r30, 0x3C ; 60 27500: f6 e0 ldi r31, 0x06 ; 6 27502: 64 87 std Z+12, r22 ; 0x0c 27504: 75 87 std Z+13, r23 ; 0x0d 27506: 86 87 std Z+14, r24 ; 0x0e 27508: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2750a: 8f b7 in r24, 0x3f ; 63 2750c: f8 94 cli count_position[E_AXIS] = e; 2750e: 44 85 ldd r20, Z+12 ; 0x0c 27510: 55 85 ldd r21, Z+13 ; 0x0d 27512: 66 85 ldd r22, Z+14 ; 0x0e 27514: 77 85 ldd r23, Z+15 ; 0x0f 27516: 40 93 58 06 sts 0x0658, r20 ; 0x800658 2751a: 50 93 59 06 sts 0x0659, r21 ; 0x800659 2751e: 60 93 5a 06 sts 0x065A, r22 ; 0x80065a 27522: 70 93 5b 06 sts 0x065B, r23 ; 0x80065b CRITICAL_SECTION_END; 27526: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 27528: 08 95 ret 0002752a : // 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; 2752a: fc 01 movw r30, r24 2752c: 40 81 ld r20, Z 2752e: 51 81 ldd r21, Z+1 ; 0x01 27530: 62 81 ldd r22, Z+2 ; 0x02 27532: 73 81 ldd r23, Z+3 ; 0x03 27534: 40 93 3e 04 sts 0x043E, r20 ; 0x80043e 27538: 50 93 3f 04 sts 0x043F, r21 ; 0x80043f 2753c: 60 93 40 04 sts 0x0440, r22 ; 0x800440 27540: 70 93 41 04 sts 0x0441, r23 ; 0x800441 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 27544: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 27548: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 2754c: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 27550: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 27554: 60 81 ld r22, Z 27556: 71 81 ldd r23, Z+1 ; 0x01 27558: 82 81 ldd r24, Z+2 ; 0x02 2755a: 93 81 ldd r25, Z+3 ; 0x03 2755c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27560: 0f 94 02 a8 call 0x35004 ; 0x35004 27564: 60 93 44 06 sts 0x0644, r22 ; 0x800644 27568: 70 93 45 06 sts 0x0645, r23 ; 0x800645 2756c: 80 93 46 06 sts 0x0646, r24 ; 0x800646 27570: 90 93 47 06 sts 0x0647, r25 ; 0x800647 st_set_position(position); 27574: 0d 94 22 79 jmp 0x2f244 ; 0x2f244 00027578 : // 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) { 27578: 2f 92 push r2 2757a: 3f 92 push r3 2757c: 4f 92 push r4 2757e: 5f 92 push r5 27580: 6f 92 push r6 27582: 7f 92 push r7 27584: 8f 92 push r8 27586: 9f 92 push r9 27588: af 92 push r10 2758a: bf 92 push r11 2758c: cf 92 push r12 2758e: df 92 push r13 27590: ef 92 push r14 27592: ff 92 push r15 27594: 0f 93 push r16 27596: 1f 93 push r17 27598: cf 93 push r28 2759a: df 93 push r29 2759c: cd b7 in r28, 0x3d ; 61 2759e: de b7 in r29, 0x3e ; 62 275a0: c4 58 subi r28, 0x84 ; 132 275a2: d1 09 sbc r29, r1 275a4: 0f b6 in r0, 0x3f ; 63 275a6: f8 94 cli 275a8: de bf out 0x3e, r29 ; 62 275aa: 0f be out 0x3f, r0 ; 63 275ac: cd bf out 0x3d, r28 ; 61 275ae: 69 a3 std Y+33, r22 ; 0x21 275b0: 7a a3 std Y+34, r23 ; 0x22 275b2: 8b a3 std Y+35, r24 ; 0x23 275b4: 9c a3 std Y+36, r25 ; 0x24 275b6: 2d a3 std Y+37, r18 ; 0x25 275b8: 3e a3 std Y+38, r19 ; 0x26 275ba: 4f a3 std Y+39, r20 ; 0x27 275bc: 58 a7 std Y+40, r21 ; 0x28 275be: a7 96 adiw r28, 0x27 ; 39 275c0: ec ae std Y+60, r14 ; 0x3c 275c2: fd ae std Y+61, r15 ; 0x3d 275c4: 0e af std Y+62, r16 ; 0x3e 275c6: 1f af std Y+63, r17 ; 0x3f 275c8: a7 97 sbiw r28, 0x27 ; 39 275ca: a9 96 adiw r28, 0x29 ; 41 275cc: df ae std Y+63, r13 ; 0x3f 275ce: ce ae std Y+62, r12 ; 0x3e 275d0: a9 97 sbiw r28, 0x29 ; 41 275d2: 89 ae std Y+57, r8 ; 0x39 275d4: 99 aa std Y+49, r9 ; 0x31 275d6: ad ae std Y+61, r10 ; 0x3d 275d8: bd aa std Y+53, r11 ; 0x35 275da: c6 56 subi r28, 0x66 ; 102 275dc: df 4f sbci r29, 0xFF ; 255 275de: 08 81 ld r16, Y 275e0: 19 81 ldd r17, Y+1 ; 0x01 275e2: ca 59 subi r28, 0x9A ; 154 275e4: 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); 275e6: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 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) 275ea: 8f 5f subi r24, 0xFF ; 255 275ec: a0 96 adiw r28, 0x20 ; 32 275ee: 8f af std Y+63, r24 ; 0x3f 275f0: a0 97 sbiw r28, 0x20 ; 32 275f2: 80 31 cpi r24, 0x10 ; 16 275f4: 19 f4 brne .+6 ; 0x275fc block_index = 0; 275f6: a0 96 adiw r28, 0x20 ; 32 275f8: 1f ae std Y+63, r1 ; 0x3f 275fa: a0 97 sbiw r28, 0x20 ; 32 // 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) { 275fc: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 27600: a0 96 adiw r28, 0x20 ; 32 27602: 2f ad ldd r18, Y+63 ; 0x3f 27604: a0 97 sbiw r28, 0x20 ; 32 27606: 82 13 cpse r24, r18 27608: 0f c0 rjmp .+30 ; 0x27628 do { manage_heater(); 2760a: 0f 94 a5 37 call 0x26f4a ; 0x26f4a // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 2760e: 80 e0 ldi r24, 0x00 ; 0 27610: 0e 94 25 8a call 0x1144a ; 0x1144a lcd_update(0); 27614: 80 e0 ldi r24, 0x00 ; 0 27616: 0e 94 c9 6e call 0xdd92 ; 0xdd92 } while (block_buffer_tail == next_buffer_head); 2761a: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 2761e: a0 96 adiw r28, 0x20 ; 32 27620: 3f ad ldd r19, Y+63 ; 0x3f 27622: a0 97 sbiw r28, 0x20 ; 32 27624: 83 17 cp r24, r19 27626: 89 f3 breq .-30 ; 0x2760a } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 27628: 40 91 42 0d lds r20, 0x0D42 ; 0x800d42 2762c: a1 96 adiw r28, 0x21 ; 33 2762e: 4f af std Y+63, r20 ; 0x3f 27630: a1 97 sbiw r28, 0x21 ; 33 27632: 44 23 and r20, r20 27634: 11 f1 breq .+68 ; 0x2767a // avoid planning the block early if aborted SERIAL_ECHO_START; 27636: 8e ec ldi r24, 0xCE ; 206 27638: 91 ea ldi r25, 0xA1 ; 161 2763a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(_n("Move aborted")); 2763e: 86 e3 ldi r24, 0x36 ; 54 27640: 9a e6 ldi r25, 0x6A ; 106 27642: 0e 94 8d 7c call 0xf91a ; 0xf91a // 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(); } 27646: cc 57 subi r28, 0x7C ; 124 27648: df 4f sbci r29, 0xFF ; 255 2764a: 0f b6 in r0, 0x3f ; 63 2764c: f8 94 cli 2764e: de bf out 0x3e, r29 ; 62 27650: 0f be out 0x3f, r0 ; 63 27652: cd bf out 0x3d, r28 ; 61 27654: df 91 pop r29 27656: cf 91 pop r28 27658: 1f 91 pop r17 2765a: 0f 91 pop r16 2765c: ff 90 pop r15 2765e: ef 90 pop r14 27660: df 90 pop r13 27662: cf 90 pop r12 27664: bf 90 pop r11 27666: af 90 pop r10 27668: 9f 90 pop r9 2766a: 8f 90 pop r8 2766c: 7f 90 pop r7 2766e: 6f 90 pop r6 27670: 5f 90 pop r5 27672: 4f 90 pop r4 27674: 3f 90 pop r3 27676: 2f 90 pop r2 27678: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 2767a: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 2767e: 29 2e mov r2, r25 27680: 31 2c mov r3, r1 27682: 8e e6 ldi r24, 0x6E ; 110 27684: 98 9f mul r25, r24 27686: d0 01 movw r26, r0 27688: 11 24 eor r1, r1 2768a: a3 96 adiw r28, 0x23 ; 35 2768c: bf af std Y+63, r27 ; 0x3f 2768e: ae af std Y+62, r26 ; 0x3e 27690: a3 97 sbiw r28, 0x23 ; 35 // Mark block as not busy (Not executed by the stepper interrupt, could be still tinkered with.) block->busy = false; 27692: cd 01 movw r24, r26 27694: 82 5a subi r24, 0xA2 ; 162 27696: 99 4f sbci r25, 0xF9 ; 249 27698: fc 01 movw r30, r24 2769a: e9 5b subi r30, 0xB9 ; 185 2769c: ff 4f sbci r31, 0xFF ; 255 2769e: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 276a0: 84 59 subi r24, 0x94 ; 148 276a2: 9f 4f sbci r25, 0xFF ; 255 276a4: fc 01 movw r30, r24 276a6: 11 82 std Z+1, r1 ; 0x01 276a8: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 276aa: 01 15 cp r16, r1 276ac: 11 05 cpc r17, r1 276ae: 11 f4 brne .+4 ; 0x276b4 276b0: 0d 94 a9 45 jmp 0x28b52 ; 0x28b52 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 276b4: 80 e1 ldi r24, 0x10 ; 16 276b6: f8 01 movw r30, r16 276b8: aa 54 subi r26, 0x4A ; 74 276ba: b9 4f sbci r27, 0xF9 ; 249 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 276bc: 01 90 ld r0, Z+ 276be: 0d 92 st X+, r0 276c0: 8a 95 dec r24 276c2: e1 f7 brne .-8 ; 0x276bc // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 276c4: 8e e6 ldi r24, 0x6E ; 110 276c6: 82 9d mul r24, r2 276c8: 80 01 movw r16, r0 276ca: 83 9d mul r24, r3 276cc: 10 0d add r17, r0 276ce: 11 24 eor r1, r1 276d0: 02 5a subi r16, 0xA2 ; 162 276d2: 19 4f sbci r17, 0xF9 ; 249 276d4: f8 01 movw r30, r16 276d6: e8 59 subi r30, 0x98 ; 152 276d8: ff 4f sbci r31, 0xFF ; 255 276da: c4 56 subi r28, 0x64 ; 100 276dc: df 4f sbci r29, 0xFF ; 255 276de: 88 81 ld r24, Y 276e0: 99 81 ldd r25, Y+1 ; 0x01 276e2: cc 59 subi r28, 0x9C ; 156 276e4: d0 40 sbci r29, 0x00 ; 0 276e6: 91 83 std Z+1, r25 ; 0x01 276e8: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 276ea: 06 59 subi r16, 0x96 ; 150 276ec: 1f 4f sbci r17, 0xFF ; 255 276ee: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 276f2: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 276f6: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 276fa: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 276fe: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 27702: d8 01 movw r26, r16 27704: 6d 93 st X+, r22 27706: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 27708: 80 91 21 04 lds r24, 0x0421 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.444> 2770c: 88 23 and r24, r24 2770e: a9 f0 breq .+42 ; 0x2773a { position[E_AXIS] = 0; 27710: 10 92 48 06 sts 0x0648, r1 ; 0x800648 27714: 10 92 49 06 sts 0x0649, r1 ; 0x800649 27718: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 2771c: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 27720: 10 92 42 04 sts 0x0442, r1 ; 0x800442 27724: 10 92 43 04 sts 0x0443, r1 ; 0x800443 27728: 10 92 44 04 sts 0x0444, r1 ; 0x800444 2772c: 10 92 45 04 sts 0x0445, r1 ; 0x800445 #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; 27730: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.444> plan_reset_next_e_sched = true; 27734: 81 e0 ldi r24, 0x01 ; 1 27736: 80 93 20 04 sts 0x0420, r24 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.445> } // Apply the machine correction matrix. world2machine(x, y); 2773a: be 01 movw r22, r28 2773c: 6b 5d subi r22, 0xDB ; 219 2773e: 7f 4f sbci r23, 0xFF ; 255 27740: ce 01 movw r24, r28 27742: 81 96 adiw r24, 0x21 ; 33 27744: 0e 94 46 68 call 0xd08c ; 0xd08c // 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]); 27748: c9 a0 ldd r12, Y+33 ; 0x21 2774a: da a0 ldd r13, Y+34 ; 0x22 2774c: eb a0 ldd r14, Y+35 ; 0x23 2774e: fc a0 ldd r15, Y+36 ; 0x24 27750: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 27754: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 27758: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 2775c: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 27760: c7 01 movw r24, r14 27762: b6 01 movw r22, r12 27764: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27768: 0f 94 02 a8 call 0x35004 ; 0x35004 2776c: c3 58 subi r28, 0x83 ; 131 2776e: df 4f sbci r29, 0xFF ; 255 27770: 68 83 st Y, r22 27772: 79 83 std Y+1, r23 ; 0x01 27774: 8a 83 std Y+2, r24 ; 0x02 27776: 9b 83 std Y+3, r25 ; 0x03 27778: cd 57 subi r28, 0x7D ; 125 2777a: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 2777c: 8d a0 ldd r8, Y+37 ; 0x25 2777e: 9e a0 ldd r9, Y+38 ; 0x26 27780: af a0 ldd r10, Y+39 ; 0x27 27782: b8 a4 ldd r11, Y+40 ; 0x28 27784: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 27788: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 2778c: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 27790: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 27794: c5 01 movw r24, r10 27796: b4 01 movw r22, r8 27798: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2779c: 0f 94 02 a8 call 0x35004 ; 0x35004 277a0: cf 57 subi r28, 0x7F ; 127 277a2: df 4f sbci r29, 0xFF ; 255 277a4: 68 83 st Y, r22 277a6: 79 83 std Y+1, r23 ; 0x01 277a8: 8a 83 std Y+2, r24 ; 0x02 277aa: 9b 83 std Y+3, r25 ; 0x03 277ac: c1 58 subi r28, 0x81 ; 129 277ae: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 277b0: 80 91 09 13 lds r24, 0x1309 ; 0x801309 277b4: 88 23 and r24, r24 277b6: 11 f4 brne .+4 ; 0x277bc 277b8: 0d 94 b0 45 jmp 0x28b60 ; 0x28b60 target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 277bc: a5 01 movw r20, r10 277be: 94 01 movw r18, r8 277c0: c7 01 movw r24, r14 277c2: b6 01 movw r22, r12 277c4: 0f 94 35 91 call 0x3226a ; 0x3226a 277c8: a7 96 adiw r28, 0x27 ; 39 277ca: 2c ad ldd r18, Y+60 ; 0x3c 277cc: 3d ad ldd r19, Y+61 ; 0x3d 277ce: 4e ad ldd r20, Y+62 ; 0x3e 277d0: 5f ad ldd r21, Y+63 ; 0x3f 277d2: a7 97 sbiw r28, 0x27 ; 39 277d4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 277d8: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 277dc: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 277e0: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 277e4: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 277e8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 277ec: 0f 94 02 a8 call 0x35004 ; 0x35004 277f0: e5 96 adiw r28, 0x35 ; 53 277f2: 6c af std Y+60, r22 ; 0x3c 277f4: 7d af std Y+61, r23 ; 0x3d 277f6: 8e af std Y+62, r24 ; 0x3e 277f8: 9f af std Y+63, r25 ; 0x3f 277fa: e5 97 sbiw r28, 0x35 ; 53 } #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]); 277fc: a9 96 adiw r28, 0x29 ; 41 277fe: ee ad ldd r30, Y+62 ; 0x3e 27800: ff ad ldd r31, Y+63 ; 0x3f 27802: a9 97 sbiw r28, 0x29 ; 41 27804: 80 80 ld r8, Z 27806: 91 80 ldd r9, Z+1 ; 0x01 27808: a2 80 ldd r10, Z+2 ; 0x02 2780a: b3 80 ldd r11, Z+3 ; 0x03 2780c: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 27810: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 27814: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 27818: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 2781c: c5 01 movw r24, r10 2781e: b4 01 movw r22, r8 27820: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27824: 0f 94 02 a8 call 0x35004 ; 0x35004 27828: ad 96 adiw r28, 0x2d ; 45 2782a: 6c af std Y+60, r22 ; 0x3c 2782c: 7d af std Y+61, r23 ; 0x3d 2782e: 8e af std Y+62, r24 ; 0x3e 27830: 9f af std Y+63, r25 ; 0x3f 27832: ad 97 sbiw r28, 0x2d ; 45 // 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]; 27834: 80 91 48 06 lds r24, 0x0648 ; 0x800648 27838: 90 91 49 06 lds r25, 0x0649 ; 0x800649 2783c: a0 91 4a 06 lds r26, 0x064A ; 0x80064a 27840: b0 91 4b 06 lds r27, 0x064B ; 0x80064b 27844: ad 96 adiw r28, 0x2d ; 45 27846: 4c ac ldd r4, Y+60 ; 0x3c 27848: 5d ac ldd r5, Y+61 ; 0x3d 2784a: 6e ac ldd r6, Y+62 ; 0x3e 2784c: 7f ac ldd r7, Y+63 ; 0x3f 2784e: ad 97 sbiw r28, 0x2d ; 45 27850: 48 1a sub r4, r24 27852: 59 0a sbc r5, r25 27854: 6a 0a sbc r6, r26 27856: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 27858: 80 91 3c 06 lds r24, 0x063C ; 0x80063c 2785c: 90 91 3d 06 lds r25, 0x063D ; 0x80063d 27860: a0 91 3e 06 lds r26, 0x063E ; 0x80063e 27864: b0 91 3f 06 lds r27, 0x063F ; 0x80063f 27868: c3 58 subi r28, 0x83 ; 131 2786a: df 4f sbci r29, 0xFF ; 255 2786c: c8 80 ld r12, Y 2786e: d9 80 ldd r13, Y+1 ; 0x01 27870: ea 80 ldd r14, Y+2 ; 0x02 27872: fb 80 ldd r15, Y+3 ; 0x03 27874: cd 57 subi r28, 0x7D ; 125 27876: d0 40 sbci r29, 0x00 ; 0 27878: c8 1a sub r12, r24 2787a: d9 0a sbc r13, r25 2787c: ea 0a sbc r14, r26 2787e: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 27880: 80 91 40 06 lds r24, 0x0640 ; 0x800640 27884: 90 91 41 06 lds r25, 0x0641 ; 0x800641 27888: a0 91 42 06 lds r26, 0x0642 ; 0x800642 2788c: b0 91 43 06 lds r27, 0x0643 ; 0x800643 27890: cf 57 subi r28, 0x7F ; 127 27892: df 4f sbci r29, 0xFF ; 255 27894: 28 81 ld r18, Y 27896: 39 81 ldd r19, Y+1 ; 0x01 27898: 4a 81 ldd r20, Y+2 ; 0x02 2789a: 5b 81 ldd r21, Y+3 ; 0x03 2789c: c1 58 subi r28, 0x81 ; 129 2789e: d0 40 sbci r29, 0x00 ; 0 278a0: 28 1b sub r18, r24 278a2: 39 0b sbc r19, r25 278a4: 4a 0b sbc r20, r26 278a6: 5b 0b sbc r21, r27 278a8: 29 a7 std Y+41, r18 ; 0x29 278aa: 3a a7 std Y+42, r19 ; 0x2a 278ac: 4b a7 std Y+43, r20 ; 0x2b 278ae: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 278b0: 80 91 44 06 lds r24, 0x0644 ; 0x800644 278b4: 90 91 45 06 lds r25, 0x0645 ; 0x800645 278b8: a0 91 46 06 lds r26, 0x0646 ; 0x800646 278bc: b0 91 47 06 lds r27, 0x0647 ; 0x800647 278c0: e5 96 adiw r28, 0x35 ; 53 278c2: 2c ad ldd r18, Y+60 ; 0x3c 278c4: 3d ad ldd r19, Y+61 ; 0x3d 278c6: 4e ad ldd r20, Y+62 ; 0x3e 278c8: 5f ad ldd r21, Y+63 ; 0x3f 278ca: e5 97 sbiw r28, 0x35 ; 53 278cc: 28 1b sub r18, r24 278ce: 39 0b sbc r19, r25 278d0: 4a 0b sbc r20, r26 278d2: 5b 0b sbc r21, r27 278d4: 2d a7 std Y+45, r18 ; 0x2d 278d6: 3e a7 std Y+46, r19 ; 0x2e 278d8: 4f a7 std Y+47, r20 ; 0x2f 278da: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 278dc: 41 14 cp r4, r1 278de: 51 04 cpc r5, r1 278e0: 61 04 cpc r6, r1 278e2: 71 04 cpc r7, r1 278e4: 09 f4 brne .+2 ; 0x278e8 278e6: 80 c0 rjmp .+256 ; 0x279e8 { if((int)degHotend(active_extruder) 278ec: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 278f0: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 278f4: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 278f8: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 278fc: 20 91 57 02 lds r18, 0x0257 ; 0x800257 27900: 30 91 58 02 lds r19, 0x0258 ; 0x800258 27904: 62 17 cp r22, r18 27906: 73 07 cpc r23, r19 27908: 0c f5 brge .+66 ; 0x2794c { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2790a: ad 96 adiw r28, 0x2d ; 45 2790c: 8c ad ldd r24, Y+60 ; 0x3c 2790e: 9d ad ldd r25, Y+61 ; 0x3d 27910: ae ad ldd r26, Y+62 ; 0x3e 27912: bf ad ldd r27, Y+63 ; 0x3f 27914: ad 97 sbiw r28, 0x2d ; 45 27916: 80 93 48 06 sts 0x0648, r24 ; 0x800648 2791a: 90 93 49 06 sts 0x0649, r25 ; 0x800649 2791e: a0 93 4a 06 sts 0x064A, r26 ; 0x80064a 27922: b0 93 4b 06 sts 0x064B, r27 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 27926: 80 92 42 04 sts 0x0442, r8 ; 0x800442 2792a: 90 92 43 04 sts 0x0443, r9 ; 0x800443 2792e: a0 92 44 04 sts 0x0444, r10 ; 0x800444 27932: b0 92 45 04 sts 0x0445, r11 ; 0x800445 #endif de = 0; // no difference SERIAL_ECHO_START; 27936: 8e ec ldi r24, 0xCE ; 206 27938: 91 ea ldi r25, 0xA1 ; 161 2793a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 2793e: 8c e1 ldi r24, 0x1C ; 28 27940: 9a e6 ldi r25, 0x6A ; 106 27942: 0e 94 8d 7c call 0xf91a ; 0xf91a { 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 27946: 41 2c mov r4, r1 27948: 51 2c mov r5, r1 2794a: 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) 2794c: c3 01 movw r24, r6 2794e: b2 01 movw r22, r4 27950: 77 fe sbrs r7, 7 27952: 07 c0 rjmp .+14 ; 0x27962 27954: 66 27 eor r22, r22 27956: 77 27 eor r23, r23 27958: cb 01 movw r24, r22 2795a: 64 19 sub r22, r4 2795c: 75 09 sbc r23, r5 2795e: 86 09 sbc r24, r6 27960: 97 09 sbc r25, r7 27962: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 27966: 4b 01 movw r8, r22 27968: 5c 01 movw r10, r24 2796a: 20 e0 ldi r18, 0x00 ; 0 2796c: 30 e0 ldi r19, 0x00 ; 0 2796e: 48 ee ldi r20, 0xE8 ; 232 27970: 53 e4 ldi r21, 0x43 ; 67 27972: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 27976: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 2797a: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 2797e: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 27982: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27986: 9b 01 movw r18, r22 27988: ac 01 movw r20, r24 2798a: c5 01 movw r24, r10 2798c: b4 01 movw r22, r8 2798e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 27992: 18 16 cp r1, r24 27994: 4c f5 brge .+82 ; 0x279e8 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 27996: ad 96 adiw r28, 0x2d ; 45 27998: 2c ad ldd r18, Y+60 ; 0x3c 2799a: 3d ad ldd r19, Y+61 ; 0x3d 2799c: 4e ad ldd r20, Y+62 ; 0x3e 2799e: 5f ad ldd r21, Y+63 ; 0x3f 279a0: ad 97 sbiw r28, 0x2d ; 45 279a2: 20 93 48 06 sts 0x0648, r18 ; 0x800648 279a6: 30 93 49 06 sts 0x0649, r19 ; 0x800649 279aa: 40 93 4a 06 sts 0x064A, r20 ; 0x80064a 279ae: 50 93 4b 06 sts 0x064B, r21 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 279b2: a9 96 adiw r28, 0x29 ; 41 279b4: ee ad ldd r30, Y+62 ; 0x3e 279b6: ff ad ldd r31, Y+63 ; 0x3f 279b8: a9 97 sbiw r28, 0x29 ; 41 279ba: 80 81 ld r24, Z 279bc: 91 81 ldd r25, Z+1 ; 0x01 279be: a2 81 ldd r26, Z+2 ; 0x02 279c0: b3 81 ldd r27, Z+3 ; 0x03 279c2: 80 93 42 04 sts 0x0442, r24 ; 0x800442 279c6: 90 93 43 04 sts 0x0443, r25 ; 0x800443 279ca: a0 93 44 04 sts 0x0444, r26 ; 0x800444 279ce: b0 93 45 04 sts 0x0445, r27 ; 0x800445 #endif de = 0; // no difference SERIAL_ECHO_START; 279d2: 8e ec ldi r24, 0xCE ; 206 279d4: 91 ea ldi r25, 0xA1 ; 161 279d6: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 279da: 8e ef ldi r24, 0xFE ; 254 279dc: 99 e6 ldi r25, 0x69 ; 105 279de: 0e 94 8d 7c call 0xf91a ; 0xf91a { 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 279e2: 41 2c mov r4, r1 279e4: 51 2c mov r5, r1 279e6: 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); 279e8: 8e e6 ldi r24, 0x6E ; 110 279ea: 82 9d mul r24, r2 279ec: f0 01 movw r30, r0 279ee: 83 9d mul r24, r3 279f0: f0 0d add r31, r0 279f2: 11 24 eor r1, r1 279f4: e2 5a subi r30, 0xA2 ; 162 279f6: f9 4f sbci r31, 0xF9 ; 249 279f8: d7 01 movw r26, r14 279fa: c6 01 movw r24, r12 279fc: f7 fe sbrs r15, 7 279fe: 07 c0 rjmp .+14 ; 0x27a0e 27a00: 88 27 eor r24, r24 27a02: 99 27 eor r25, r25 27a04: dc 01 movw r26, r24 27a06: 8c 19 sub r24, r12 27a08: 9d 09 sbc r25, r13 27a0a: ae 09 sbc r26, r14 27a0c: bf 09 sbc r27, r15 27a0e: 80 83 st Z, r24 27a10: 91 83 std Z+1, r25 ; 0x01 27a12: a2 83 std Z+2, r26 ; 0x02 27a14: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 27a16: 8e e6 ldi r24, 0x6E ; 110 27a18: 82 9d mul r24, r2 27a1a: f0 01 movw r30, r0 27a1c: 83 9d mul r24, r3 27a1e: f0 0d add r31, r0 27a20: 11 24 eor r1, r1 27a22: e2 5a subi r30, 0xA2 ; 162 27a24: f9 4f sbci r31, 0xF9 ; 249 27a26: 89 a5 ldd r24, Y+41 ; 0x29 27a28: 9a a5 ldd r25, Y+42 ; 0x2a 27a2a: ab a5 ldd r26, Y+43 ; 0x2b 27a2c: bc a5 ldd r27, Y+44 ; 0x2c 27a2e: b7 ff sbrs r27, 7 27a30: 07 c0 rjmp .+14 ; 0x27a40 27a32: b0 95 com r27 27a34: a0 95 com r26 27a36: 90 95 com r25 27a38: 81 95 neg r24 27a3a: 9f 4f sbci r25, 0xFF ; 255 27a3c: af 4f sbci r26, 0xFF ; 255 27a3e: bf 4f sbci r27, 0xFF ; 255 27a40: 84 83 std Z+4, r24 ; 0x04 27a42: 95 83 std Z+5, r25 ; 0x05 27a44: a6 83 std Z+6, r26 ; 0x06 27a46: 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); 27a48: 8e e6 ldi r24, 0x6E ; 110 27a4a: 82 9d mul r24, r2 27a4c: f0 01 movw r30, r0 27a4e: 83 9d mul r24, r3 27a50: f0 0d add r31, r0 27a52: 11 24 eor r1, r1 27a54: e2 5a subi r30, 0xA2 ; 162 27a56: f9 4f sbci r31, 0xF9 ; 249 27a58: 8d a5 ldd r24, Y+45 ; 0x2d 27a5a: 9e a5 ldd r25, Y+46 ; 0x2e 27a5c: af a5 ldd r26, Y+47 ; 0x2f 27a5e: b8 a9 ldd r27, Y+48 ; 0x30 27a60: b7 ff sbrs r27, 7 27a62: 07 c0 rjmp .+14 ; 0x27a72 27a64: b0 95 com r27 27a66: a0 95 com r26 27a68: 90 95 com r25 27a6a: 81 95 neg r24 27a6c: 9f 4f sbci r25, 0xFF ; 255 27a6e: af 4f sbci r26, 0xFF ; 255 27a70: bf 4f sbci r27, 0xFF ; 255 27a72: 80 87 std Z+8, r24 ; 0x08 27a74: 91 87 std Z+9, r25 ; 0x09 27a76: a2 87 std Z+10, r26 ; 0x0a 27a78: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 27a7a: b3 01 movw r22, r6 27a7c: a2 01 movw r20, r4 27a7e: 77 fe sbrs r7, 7 27a80: 07 c0 rjmp .+14 ; 0x27a90 27a82: 44 27 eor r20, r20 27a84: 55 27 eor r21, r21 27a86: ba 01 movw r22, r20 27a88: 44 19 sub r20, r4 27a8a: 55 09 sbc r21, r5 27a8c: 66 09 sbc r22, r6 27a8e: 77 09 sbc r23, r7 27a90: 8e e6 ldi r24, 0x6E ; 110 27a92: 82 9d mul r24, r2 27a94: f0 01 movw r30, r0 27a96: 83 9d mul r24, r3 27a98: f0 0d add r31, r0 27a9a: 11 24 eor r1, r1 27a9c: e2 5a subi r30, 0xA2 ; 162 27a9e: f9 4f sbci r31, 0xF9 ; 249 27aa0: 44 87 std Z+12, r20 ; 0x0c 27aa2: 55 87 std Z+13, r21 ; 0x0d 27aa4: 66 87 std Z+14, r22 ; 0x0e 27aa6: 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))); 27aa8: 00 81 ld r16, Z 27aaa: 11 81 ldd r17, Z+1 ; 0x01 27aac: 22 81 ldd r18, Z+2 ; 0x02 27aae: 33 81 ldd r19, Z+3 ; 0x03 27ab0: 84 81 ldd r24, Z+4 ; 0x04 27ab2: 95 81 ldd r25, Z+5 ; 0x05 27ab4: a6 81 ldd r26, Z+6 ; 0x06 27ab6: b7 81 ldd r27, Z+7 ; 0x07 27ab8: 80 17 cp r24, r16 27aba: 91 07 cpc r25, r17 27abc: a2 07 cpc r26, r18 27abe: b3 07 cpc r27, r19 27ac0: 14 f4 brge .+4 ; 0x27ac6 27ac2: d9 01 movw r26, r18 27ac4: c8 01 movw r24, r16 27ac6: ee e6 ldi r30, 0x6E ; 110 27ac8: be 2e mov r11, r30 27aca: b2 9c mul r11, r2 27acc: f0 01 movw r30, r0 27ace: b3 9c mul r11, r3 27ad0: f0 0d add r31, r0 27ad2: 11 24 eor r1, r1 27ad4: e2 5a subi r30, 0xA2 ; 162 27ad6: f9 4f sbci r31, 0xF9 ; 249 27ad8: 80 84 ldd r8, Z+8 ; 0x08 27ada: 91 84 ldd r9, Z+9 ; 0x09 27adc: a2 84 ldd r10, Z+10 ; 0x0a 27ade: b3 84 ldd r11, Z+11 ; 0x0b 27ae0: 88 15 cp r24, r8 27ae2: 99 05 cpc r25, r9 27ae4: aa 05 cpc r26, r10 27ae6: bb 05 cpc r27, r11 27ae8: 14 f4 brge .+4 ; 0x27aee 27aea: d5 01 movw r26, r10 27aec: c4 01 movw r24, r8 27aee: 84 17 cp r24, r20 27af0: 95 07 cpc r25, r21 27af2: a6 07 cpc r26, r22 27af4: b7 07 cpc r27, r23 27af6: 14 f4 brge .+4 ; 0x27afc 27af8: db 01 movw r26, r22 27afa: ca 01 movw r24, r20 27afc: 4e e6 ldi r20, 0x6E ; 110 27afe: 42 9d mul r20, r2 27b00: f0 01 movw r30, r0 27b02: 43 9d mul r20, r3 27b04: f0 0d add r31, r0 27b06: 11 24 eor r1, r1 27b08: e2 5a subi r30, 0xA2 ; 162 27b0a: f9 4f sbci r31, 0xF9 ; 249 27b0c: 80 8b std Z+16, r24 ; 0x10 27b0e: 91 8b std Z+17, r25 ; 0x11 27b10: a2 8b std Z+18, r26 ; 0x12 27b12: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 27b14: 06 97 sbiw r24, 0x06 ; 6 27b16: a1 05 cpc r26, r1 27b18: b1 05 cpc r27, r1 27b1a: 0c f4 brge .+2 ; 0x27b1e 27b1c: 94 cd rjmp .-1240 ; 0x27646 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 27b1e: 80 91 55 12 lds r24, 0x1255 ; 0x801255 27b22: df 01 movw r26, r30 27b24: aa 5b subi r26, 0xBA ; 186 27b26: bf 4f sbci r27, 0xFF ; 255 27b28: 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); 27b2a: f7 fe sbrs r15, 7 27b2c: 02 c0 rjmp .+4 ; 0x27b32 27b2e: 0d 94 c0 45 jmp 0x28b80 ; 0x28b80 } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 27b32: 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); 27b34: 89 a5 ldd r24, Y+41 ; 0x29 27b36: 9a a5 ldd r25, Y+42 ; 0x2a 27b38: ab a5 ldd r26, Y+43 ; 0x2b 27b3a: bc a5 ldd r27, Y+44 ; 0x2c 27b3c: b7 ff sbrs r27, 7 27b3e: 0b c0 rjmp .+22 ; 0x27b56 27b40: 8e e6 ldi r24, 0x6E ; 110 27b42: 82 9d mul r24, r2 27b44: f0 01 movw r30, r0 27b46: 83 9d mul r24, r3 27b48: f0 0d add r31, r0 27b4a: 11 24 eor r1, r1 27b4c: e2 5a subi r30, 0xA2 ; 162 27b4e: f9 4f sbci r31, 0xF9 ; 249 27b50: 80 8d ldd r24, Z+24 ; 0x18 27b52: 82 60 ori r24, 0x02 ; 2 27b54: 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); 27b56: 8d a5 ldd r24, Y+45 ; 0x2d 27b58: 9e a5 ldd r25, Y+46 ; 0x2e 27b5a: af a5 ldd r26, Y+47 ; 0x2f 27b5c: b8 a9 ldd r27, Y+48 ; 0x30 27b5e: b7 ff sbrs r27, 7 27b60: 0b c0 rjmp .+22 ; 0x27b78 27b62: 8e e6 ldi r24, 0x6E ; 110 27b64: 82 9d mul r24, r2 27b66: f0 01 movw r30, r0 27b68: 83 9d mul r24, r3 27b6a: f0 0d add r31, r0 27b6c: 11 24 eor r1, r1 27b6e: e2 5a subi r30, 0xA2 ; 162 27b70: f9 4f sbci r31, 0xF9 ; 249 27b72: 80 8d ldd r24, Z+24 ; 0x18 27b74: 84 60 ori r24, 0x04 ; 4 27b76: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 27b78: 77 fe sbrs r7, 7 27b7a: 0b c0 rjmp .+22 ; 0x27b92 27b7c: 8e e6 ldi r24, 0x6E ; 110 27b7e: 82 9d mul r24, r2 27b80: f0 01 movw r30, r0 27b82: 83 9d mul r24, r3 27b84: f0 0d add r31, r0 27b86: 11 24 eor r1, r1 27b88: e2 5a subi r30, 0xA2 ; 162 27b8a: f9 4f sbci r31, 0xF9 ; 249 27b8c: 80 8d ldd r24, Z+24 ; 0x18 27b8e: 88 60 ori r24, 0x08 ; 8 27b90: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 27b92: 01 2b or r16, r17 27b94: 02 2b or r16, r18 27b96: 03 2b or r16, r19 27b98: 09 f0 breq .+2 ; 0x27b9c 27b9a: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 27b9c: 8e e6 ldi r24, 0x6E ; 110 27b9e: 82 9d mul r24, r2 27ba0: f0 01 movw r30, r0 27ba2: 83 9d mul r24, r3 27ba4: f0 0d add r31, r0 27ba6: 11 24 eor r1, r1 27ba8: e2 5a subi r30, 0xA2 ; 162 27baa: f9 4f sbci r31, 0xF9 ; 249 27bac: 84 81 ldd r24, Z+4 ; 0x04 27bae: 95 81 ldd r25, Z+5 ; 0x05 27bb0: a6 81 ldd r26, Z+6 ; 0x06 27bb2: b7 81 ldd r27, Z+7 ; 0x07 27bb4: 89 2b or r24, r25 27bb6: 8a 2b or r24, r26 27bb8: 8b 2b or r24, r27 27bba: 09 f0 breq .+2 ; 0x27bbe 27bbc: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 27bbe: 8e e6 ldi r24, 0x6E ; 110 27bc0: 82 9d mul r24, r2 27bc2: f0 01 movw r30, r0 27bc4: 83 9d mul r24, r3 27bc6: f0 0d add r31, r0 27bc8: 11 24 eor r1, r1 27bca: e2 5a subi r30, 0xA2 ; 162 27bcc: f9 4f sbci r31, 0xF9 ; 249 27bce: 80 85 ldd r24, Z+8 ; 0x08 27bd0: 91 85 ldd r25, Z+9 ; 0x09 27bd2: a2 85 ldd r26, Z+10 ; 0x0a 27bd4: b3 85 ldd r27, Z+11 ; 0x0b 27bd6: 89 2b or r24, r25 27bd8: 8a 2b or r24, r26 27bda: 8b 2b or r24, r27 27bdc: 09 f0 breq .+2 ; 0x27be0 27bde: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 27be0: 8e e6 ldi r24, 0x6E ; 110 27be2: 82 9d mul r24, r2 27be4: f0 01 movw r30, r0 27be6: 83 9d mul r24, r3 27be8: f0 0d add r31, r0 27bea: 11 24 eor r1, r1 27bec: e2 5a subi r30, 0xA2 ; 162 27bee: f9 4f sbci r31, 0xF9 ; 249 27bf0: 84 85 ldd r24, Z+12 ; 0x0c 27bf2: 95 85 ldd r25, Z+13 ; 0x0d 27bf4: a6 85 ldd r26, Z+14 ; 0x0e 27bf6: b7 85 ldd r27, Z+15 ; 0x0f 27bf8: 89 2b or r24, r25 27bfa: 8a 2b or r24, r26 27bfc: 8b 2b or r24, r27 27bfe: 09 f0 breq .+2 ; 0x27c02 27c00: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 27c02: 8e e6 ldi r24, 0x6E ; 110 27c04: 82 9d mul r24, r2 27c06: f0 01 movw r30, r0 27c08: 83 9d mul r24, r3 27c0a: f0 0d add r31, r0 27c0c: 11 24 eor r1, r1 27c0e: e2 5a subi r30, 0xA2 ; 162 27c10: f9 4f sbci r31, 0xF9 ; 249 27c12: 24 85 ldd r18, Z+12 ; 0x0c 27c14: 35 85 ldd r19, Z+13 ; 0x0d 27c16: 46 85 ldd r20, Z+14 ; 0x0e 27c18: 57 85 ldd r21, Z+15 ; 0x0f 27c1a: 2a 96 adiw r28, 0x0a ; 10 27c1c: 2c af std Y+60, r18 ; 0x3c 27c1e: 3d af std Y+61, r19 ; 0x3d 27c20: 4e af std Y+62, r20 ; 0x3e 27c22: 5f af std Y+63, r21 ; 0x3f 27c24: 2a 97 sbiw r28, 0x0a ; 10 27c26: 23 2b or r18, r19 27c28: 24 2b or r18, r20 27c2a: 25 2b or r18, r21 27c2c: 09 f0 breq .+2 ; 0x27c30 27c2e: ac c7 rjmp .+3928 ; 0x28b88 { if(feed_rate 27c34: b0 90 a8 0d lds r11, 0x0DA8 ; 0x800da8 27c38: 00 91 a9 0d lds r16, 0x0DA9 ; 0x800da9 27c3c: 10 91 aa 0d lds r17, 0x0DAA ; 0x800daa } else { if(feed_rate 27c50: 18 16 cp r1, r24 27c52: 24 f4 brge .+8 ; 0x27c5c 27c54: a9 ae std Y+57, r10 ; 0x39 27c56: b9 aa std Y+49, r11 ; 0x31 27c58: 0d af std Y+61, r16 ; 0x3d 27c5a: 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]; 27c5c: c7 01 movw r24, r14 27c5e: b6 01 movw r22, r12 27c60: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 27c64: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 27c68: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 27c6c: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 27c70: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 27c74: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 27c78: 4b 01 movw r8, r22 27c7a: 5c 01 movw r10, r24 27c7c: 89 82 std Y+1, r8 ; 0x01 27c7e: 9a 82 std Y+2, r9 ; 0x02 27c80: ab 82 std Y+3, r10 ; 0x03 27c82: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 27c84: 69 a5 ldd r22, Y+41 ; 0x29 27c86: 7a a5 ldd r23, Y+42 ; 0x2a 27c88: 8b a5 ldd r24, Y+43 ; 0x2b 27c8a: 9c a5 ldd r25, Y+44 ; 0x2c 27c8c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 27c90: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 27c94: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 27c98: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 27c9c: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 27ca0: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 27ca4: 6b 01 movw r12, r22 27ca6: 7c 01 movw r14, r24 27ca8: cd 82 std Y+5, r12 ; 0x05 27caa: de 82 std Y+6, r13 ; 0x06 27cac: ef 82 std Y+7, r14 ; 0x07 27cae: 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]; 27cb0: 6d a5 ldd r22, Y+45 ; 0x2d 27cb2: 7e a5 ldd r23, Y+46 ; 0x2e 27cb4: 8f a5 ldd r24, Y+47 ; 0x2f 27cb6: 98 a9 ldd r25, Y+48 ; 0x30 27cb8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 27cbc: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 27cc0: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 27cc4: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 27cc8: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 27ccc: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 27cd0: 22 96 adiw r28, 0x02 ; 2 27cd2: 6c af std Y+60, r22 ; 0x3c 27cd4: 7d af std Y+61, r23 ; 0x3d 27cd6: 8e af std Y+62, r24 ; 0x3e 27cd8: 9f af std Y+63, r25 ; 0x3f 27cda: 22 97 sbiw r28, 0x02 ; 2 27cdc: 69 87 std Y+9, r22 ; 0x09 27cde: 7a 87 std Y+10, r23 ; 0x0a 27ce0: 8b 87 std Y+11, r24 ; 0x0b 27ce2: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 27ce4: c3 01 movw r24, r6 27ce6: b2 01 movw r22, r4 27ce8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 27cec: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 27cf0: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 27cf4: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 27cf8: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 27cfc: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 27d00: 26 96 adiw r28, 0x06 ; 6 27d02: 6c af std Y+60, r22 ; 0x3c 27d04: 7d af std Y+61, r23 ; 0x3d 27d06: 8e af std Y+62, r24 ; 0x3e 27d08: 9f af std Y+63, r25 ; 0x3f 27d0a: 26 97 sbiw r28, 0x06 ; 6 27d0c: 6d 87 std Y+13, r22 ; 0x0d 27d0e: 7e 87 std Y+14, r23 ; 0x0e 27d10: 8f 87 std Y+15, r24 ; 0x0f 27d12: 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 ) 27d14: 8e e6 ldi r24, 0x6E ; 110 27d16: 82 9d mul r24, r2 27d18: f0 01 movw r30, r0 27d1a: 83 9d mul r24, r3 27d1c: f0 0d add r31, r0 27d1e: 11 24 eor r1, r1 27d20: e2 5a subi r30, 0xA2 ; 162 27d22: f9 4f sbci r31, 0xF9 ; 249 27d24: 80 81 ld r24, Z 27d26: 91 81 ldd r25, Z+1 ; 0x01 27d28: a2 81 ldd r26, Z+2 ; 0x02 27d2a: b3 81 ldd r27, Z+3 ; 0x03 27d2c: 2e 96 adiw r28, 0x0e ; 14 27d2e: 8c af std Y+60, r24 ; 0x3c 27d30: 9d af std Y+61, r25 ; 0x3d 27d32: ae af std Y+62, r26 ; 0x3e 27d34: bf af std Y+63, r27 ; 0x3f 27d36: 2e 97 sbiw r28, 0x0e ; 14 27d38: 06 97 sbiw r24, 0x06 ; 6 27d3a: a1 05 cpc r26, r1 27d3c: b1 05 cpc r27, r1 27d3e: 0c f0 brlt .+2 ; 0x27d42 27d40: 2c c7 rjmp .+3672 ; 0x28b9a 27d42: 84 81 ldd r24, Z+4 ; 0x04 27d44: 95 81 ldd r25, Z+5 ; 0x05 27d46: a6 81 ldd r26, Z+6 ; 0x06 27d48: b7 81 ldd r27, Z+7 ; 0x07 27d4a: 06 97 sbiw r24, 0x06 ; 6 27d4c: a1 05 cpc r26, r1 27d4e: b1 05 cpc r27, r1 27d50: 0c f0 brlt .+2 ; 0x27d54 27d52: 23 c7 rjmp .+3654 ; 0x28b9a 27d54: 80 85 ldd r24, Z+8 ; 0x08 27d56: 91 85 ldd r25, Z+9 ; 0x09 27d58: a2 85 ldd r26, Z+10 ; 0x0a 27d5a: b3 85 ldd r27, Z+11 ; 0x0b 27d5c: 06 97 sbiw r24, 0x06 ; 6 27d5e: a1 05 cpc r26, r1 27d60: b1 05 cpc r27, r1 27d62: 0c f0 brlt .+2 ; 0x27d66 27d64: 1a c7 rjmp .+3636 ; 0x28b9a { block->millimeters = fabs(delta_mm[E_AXIS]); 27d66: 26 96 adiw r28, 0x06 ; 6 27d68: 8c ad ldd r24, Y+60 ; 0x3c 27d6a: 9d ad ldd r25, Y+61 ; 0x3d 27d6c: ae ad ldd r26, Y+62 ; 0x3e 27d6e: bf ad ldd r27, Y+63 ; 0x3f 27d70: 26 97 sbiw r28, 0x06 ; 6 27d72: bf 77 andi r27, 0x7F ; 127 27d74: 85 a7 std Z+45, r24 ; 0x2d 27d76: 96 a7 std Z+46, r25 ; 0x2e 27d78: a7 a7 std Z+47, r26 ; 0x2f 27d7a: 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 27d7c: 8e e6 ldi r24, 0x6E ; 110 27d7e: 82 9d mul r24, r2 27d80: f0 01 movw r30, r0 27d82: 83 9d mul r24, r3 27d84: f0 0d add r31, r0 27d86: 11 24 eor r1, r1 27d88: e2 5a subi r30, 0xA2 ; 162 27d8a: f9 4f sbci r31, 0xF9 ; 249 27d8c: 45 a4 ldd r4, Z+45 ; 0x2d 27d8e: 56 a4 ldd r5, Z+46 ; 0x2e 27d90: 67 a4 ldd r6, Z+47 ; 0x2f 27d92: 70 a8 ldd r7, Z+48 ; 0x30 27d94: a3 01 movw r20, r6 27d96: 92 01 movw r18, r4 27d98: 60 e0 ldi r22, 0x00 ; 0 27d9a: 70 e0 ldi r23, 0x00 ; 0 27d9c: 80 e8 ldi r24, 0x80 ; 128 27d9e: 9f e3 ldi r25, 0x3F ; 63 27da0: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 27da4: 29 ad ldd r18, Y+57 ; 0x39 27da6: 39 a9 ldd r19, Y+49 ; 0x31 27da8: 4d ad ldd r20, Y+61 ; 0x3d 27daa: 5d a9 ldd r21, Y+53 ; 0x35 27dac: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27db0: 6b 01 movw r12, r22 27db2: 7c 01 movw r14, r24 return (block_buffer_head != block_buffer_tail); } //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); 27db4: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 27db8: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 27dbc: 89 1b sub r24, r25 27dbe: 8f 70 andi r24, 0x0F ; 15 27dc0: 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)) { 27dc2: 82 50 subi r24, 0x02 ; 2 27dc4: 86 30 cpi r24, 0x06 ; 6 27dc6: 08 f0 brcs .+2 ; 0x27dca 27dc8: 40 c0 rjmp .+128 ; 0x27e4a // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 27dca: a7 01 movw r20, r14 27dcc: 96 01 movw r18, r12 27dce: 60 e0 ldi r22, 0x00 ; 0 27dd0: 74 e2 ldi r23, 0x24 ; 36 27dd2: 84 e7 ldi r24, 0x74 ; 116 27dd4: 99 e4 ldi r25, 0x49 ; 73 27dd6: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 27dda: 0f 94 02 a8 call 0x35004 ; 0x35004 27dde: 4b 01 movw r8, r22 27de0: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 27de2: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 27de6: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 27dea: a0 91 ad 0d lds r26, 0x0DAD ; 0x800dad 27dee: b0 91 ae 0d lds r27, 0x0DAE ; 0x800dae 27df2: 88 16 cp r8, r24 27df4: 99 06 cpc r9, r25 27df6: aa 06 cpc r10, r26 27df8: bb 06 cpc r11, r27 27dfa: 38 f5 brcc .+78 ; 0x27e4a // 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)); 27dfc: bc 01 movw r22, r24 27dfe: cd 01 movw r24, r26 27e00: 68 19 sub r22, r8 27e02: 79 09 sbc r23, r9 27e04: 8a 09 sbc r24, r10 27e06: 9b 09 sbc r25, r11 27e08: 66 0f add r22, r22 27e0a: 77 1f adc r23, r23 27e0c: 88 1f adc r24, r24 27e0e: 99 1f adc r25, r25 27e10: ad ad ldd r26, Y+61 ; 0x3d 27e12: 2a 2f mov r18, r26 27e14: 30 e0 ldi r19, 0x00 ; 0 27e16: 50 e0 ldi r21, 0x00 ; 0 27e18: 40 e0 ldi r20, 0x00 ; 0 27e1a: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 27e1e: ca 01 movw r24, r20 27e20: b9 01 movw r22, r18 27e22: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 27e26: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 27e2a: 68 0d add r22, r8 27e2c: 79 1d adc r23, r9 27e2e: 8a 1d adc r24, r10 27e30: 9b 1d adc r25, r11 27e32: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 27e36: 9b 01 movw r18, r22 27e38: ac 01 movw r20, r24 27e3a: 60 e0 ldi r22, 0x00 ; 0 27e3c: 74 e2 ldi r23, 0x24 ; 36 27e3e: 84 e7 ldi r24, 0x74 ; 116 27e40: 99 e4 ldi r25, 0x49 ; 73 27e42: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 27e46: 6b 01 movw r12, r22 27e48: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 27e4a: a3 01 movw r20, r6 27e4c: 92 01 movw r18, r4 27e4e: c7 01 movw r24, r14 27e50: b6 01 movw r22, r12 27e52: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27e56: 6d ab std Y+53, r22 ; 0x35 27e58: 7e ab std Y+54, r23 ; 0x36 27e5a: 8f ab std Y+55, r24 ; 0x37 27e5c: 98 af std Y+56, r25 ; 0x38 27e5e: 8e e6 ldi r24, 0x6E ; 110 27e60: 82 9d mul r24, r2 27e62: 80 01 movw r16, r0 27e64: 83 9d mul r24, r3 27e66: 10 0d add r17, r0 27e68: 11 24 eor r1, r1 27e6a: 02 5a subi r16, 0xA2 ; 162 27e6c: 19 4f sbci r17, 0xF9 ; 249 27e6e: 2d a9 ldd r18, Y+53 ; 0x35 27e70: 3e a9 ldd r19, Y+54 ; 0x36 27e72: 4f a9 ldd r20, Y+55 ; 0x37 27e74: 58 ad ldd r21, Y+56 ; 0x38 27e76: d8 01 movw r26, r16 27e78: 91 96 adiw r26, 0x21 ; 33 27e7a: 2d 93 st X+, r18 27e7c: 3d 93 st X+, r19 27e7e: 4d 93 st X+, r20 27e80: 5c 93 st X, r21 27e82: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 27e84: 50 96 adiw r26, 0x10 ; 16 27e86: 6d 91 ld r22, X+ 27e88: 7d 91 ld r23, X+ 27e8a: 8d 91 ld r24, X+ 27e8c: 9c 91 ld r25, X 27e8e: 53 97 sbiw r26, 0x13 ; 19 27e90: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 27e94: 69 af std Y+57, r22 ; 0x39 27e96: 7a af std Y+58, r23 ; 0x3a 27e98: 8b af std Y+59, r24 ; 0x3b 27e9a: 9c af std Y+60, r25 ; 0x3c 27e9c: 9b 01 movw r18, r22 27e9e: ac 01 movw r20, r24 27ea0: c7 01 movw r24, r14 27ea2: b6 01 movw r22, r12 27ea4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27ea8: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 27eac: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 27eb0: 62 96 adiw r28, 0x12 ; 18 27eb2: 6c af std Y+60, r22 ; 0x3c 27eb4: 7d af std Y+61, r23 ; 0x3d 27eb6: 8e af std Y+62, r24 ; 0x3e 27eb8: 9f af std Y+63, r25 ; 0x3f 27eba: 62 97 sbiw r28, 0x12 ; 18 27ebc: f8 01 movw r30, r16 27ebe: 66 ab std Z+54, r22 ; 0x36 27ec0: 77 ab std Z+55, r23 ; 0x37 27ec2: 80 af std Z+56, r24 ; 0x38 27ec4: 91 af std Z+57, r25 ; 0x39 27ec6: 9e 01 movw r18, r28 27ec8: 2f 5f subi r18, 0xFF ; 255 27eca: 3f 4f sbci r19, 0xFF ; 255 27ecc: 3a ab std Y+50, r19 ; 0x32 27ece: 29 ab std Y+49, r18 ; 0x31 27ed0: ae 01 movw r20, r28 27ed2: 4f 5e subi r20, 0xEF ; 239 27ed4: 5f 4f sbci r21, 0xFF ; 255 27ed6: 6e 96 adiw r28, 0x1e ; 30 27ed8: 5f af std Y+63, r21 ; 0x3f 27eda: 4e af std Y+62, r20 ; 0x3e 27edc: 6e 97 sbiw r28, 0x1e ; 30 27ede: 8b e7 ldi r24, 0x7B ; 123 27ee0: 9d e0 ldi r25, 0x0D ; 13 27ee2: 68 96 adiw r28, 0x18 ; 24 27ee4: 9f af std Y+63, r25 ; 0x3f 27ee6: 8e af std Y+62, r24 ; 0x3e 27ee8: 68 97 sbiw r28, 0x18 ; 24 27eea: 6c 96 adiw r28, 0x1c ; 28 27eec: 5f af std Y+63, r21 ; 0x3f 27eee: 4e af std Y+62, r20 ; 0x3e 27ef0: 6c 97 sbiw r28, 0x1c ; 28 // Calculate and limit speed in mm/sec for each axis float current_speed[4]; float speed_factor = 1.0; //factor <=1 do decrease speed 27ef2: 19 a6 std Y+41, r1 ; 0x29 27ef4: 1d a6 std Y+45, r1 ; 0x2d 27ef6: 00 e8 ldi r16, 0x80 ; 128 27ef8: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 27efa: a9 a9 ldd r26, Y+49 ; 0x31 27efc: ba a9 ldd r27, Y+50 ; 0x32 27efe: 2d 91 ld r18, X+ 27f00: 3d 91 ld r19, X+ 27f02: 4d 91 ld r20, X+ 27f04: 5d 91 ld r21, X+ 27f06: ba ab std Y+50, r27 ; 0x32 27f08: a9 ab std Y+49, r26 ; 0x31 27f0a: c7 01 movw r24, r14 27f0c: b6 01 movw r22, r12 27f0e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27f12: 6c 96 adiw r28, 0x1c ; 28 27f14: ee ad ldd r30, Y+62 ; 0x3e 27f16: ff ad ldd r31, Y+63 ; 0x3f 27f18: 6c 97 sbiw r28, 0x1c ; 28 27f1a: 61 93 st Z+, r22 27f1c: 71 93 st Z+, r23 27f1e: 81 93 st Z+, r24 27f20: 91 93 st Z+, r25 27f22: 6c 96 adiw r28, 0x1c ; 28 27f24: ff af std Y+63, r31 ; 0x3f 27f26: ee af std Y+62, r30 ; 0x3e 27f28: 6c 97 sbiw r28, 0x1c ; 28 if(fabs(current_speed[i]) > max_feedrate[i]) 27f2a: 4b 01 movw r8, r22 27f2c: 5c 01 movw r10, r24 27f2e: e8 94 clt 27f30: b7 f8 bld r11, 7 27f32: 68 96 adiw r28, 0x18 ; 24 27f34: ae ad ldd r26, Y+62 ; 0x3e 27f36: bf ad ldd r27, Y+63 ; 0x3f 27f38: 68 97 sbiw r28, 0x18 ; 24 27f3a: 2d 91 ld r18, X+ 27f3c: 3d 91 ld r19, X+ 27f3e: 4d 91 ld r20, X+ 27f40: 5d 91 ld r21, X+ 27f42: 68 96 adiw r28, 0x18 ; 24 27f44: bf af std Y+63, r27 ; 0x3f 27f46: ae af std Y+62, r26 ; 0x3e 27f48: 68 97 sbiw r28, 0x18 ; 24 27f4a: 66 96 adiw r28, 0x16 ; 22 27f4c: 2c af std Y+60, r18 ; 0x3c 27f4e: 3d af std Y+61, r19 ; 0x3d 27f50: 4e af std Y+62, r20 ; 0x3e 27f52: 5f af std Y+63, r21 ; 0x3f 27f54: 66 97 sbiw r28, 0x16 ; 22 27f56: c5 01 movw r24, r10 27f58: b4 01 movw r22, r8 27f5a: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 27f5e: 18 16 cp r1, r24 27f60: b4 f4 brge .+44 ; 0x27f8e { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 27f62: a5 01 movw r20, r10 27f64: 94 01 movw r18, r8 27f66: 66 96 adiw r28, 0x16 ; 22 27f68: 6c ad ldd r22, Y+60 ; 0x3c 27f6a: 7d ad ldd r23, Y+61 ; 0x3d 27f6c: 8e ad ldd r24, Y+62 ; 0x3e 27f6e: 9f ad ldd r25, Y+63 ; 0x3f 27f70: 66 97 sbiw r28, 0x16 ; 22 27f72: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 27f76: 4b 01 movw r8, r22 27f78: 5c 01 movw r10, r24 27f7a: 29 a5 ldd r18, Y+41 ; 0x29 27f7c: 3d a5 ldd r19, Y+45 ; 0x2d 27f7e: a8 01 movw r20, r16 27f80: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 27f84: 18 16 cp r1, r24 27f86: 1c f0 brlt .+6 ; 0x27f8e 27f88: 89 a6 std Y+41, r8 ; 0x29 27f8a: 9d a6 std Y+45, r9 ; 0x2d 27f8c: 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++) 27f8e: 6e 96 adiw r28, 0x1e ; 30 27f90: ee ad ldd r30, Y+62 ; 0x3e 27f92: ff ad ldd r31, Y+63 ; 0x3f 27f94: 6e 97 sbiw r28, 0x1e ; 30 27f96: 29 a9 ldd r18, Y+49 ; 0x31 27f98: 3a a9 ldd r19, Y+50 ; 0x32 27f9a: e2 17 cp r30, r18 27f9c: f3 07 cpc r31, r19 27f9e: 09 f0 breq .+2 ; 0x27fa2 27fa0: ac cf rjmp .-168 ; 0x27efa speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 27fa2: 20 e0 ldi r18, 0x00 ; 0 27fa4: 30 e0 ldi r19, 0x00 ; 0 27fa6: 40 e8 ldi r20, 0x80 ; 128 27fa8: 5f e3 ldi r21, 0x3F ; 63 27faa: 69 a5 ldd r22, Y+41 ; 0x29 27fac: 7d a5 ldd r23, Y+45 ; 0x2d 27fae: c8 01 movw r24, r16 27fb0: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 27fb4: 87 ff sbrs r24, 7 27fb6: 50 c0 rjmp .+160 ; 0x28058 27fb8: 6e 96 adiw r28, 0x1e ; 30 27fba: ae ac ldd r10, Y+62 ; 0x3e 27fbc: bf ac ldd r11, Y+63 ; 0x3f 27fbe: 6e 97 sbiw r28, 0x1e ; 30 27fc0: 30 e1 ldi r19, 0x10 ; 16 27fc2: a3 0e add r10, r19 27fc4: b1 1c adc r11, r1 27fc6: 6e 96 adiw r28, 0x1e ; 30 27fc8: ce ac ldd r12, Y+62 ; 0x3e 27fca: df ac ldd r13, Y+63 ; 0x3f 27fcc: 6e 97 sbiw r28, 0x1e ; 30 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 27fce: d6 01 movw r26, r12 27fd0: 6d 91 ld r22, X+ 27fd2: 7d 91 ld r23, X+ 27fd4: 8d 91 ld r24, X+ 27fd6: 9d 91 ld r25, X+ 27fd8: 6d 01 movw r12, r26 27fda: 7d 01 movw r14, r26 27fdc: b4 e0 ldi r27, 0x04 ; 4 27fde: eb 1a sub r14, r27 27fe0: f1 08 sbc r15, r1 27fe2: 29 a5 ldd r18, Y+41 ; 0x29 27fe4: 3d a5 ldd r19, Y+45 ; 0x2d 27fe6: a8 01 movw r20, r16 27fe8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 27fec: f7 01 movw r30, r14 27fee: 60 83 st Z, r22 27ff0: 71 83 std Z+1, r23 ; 0x01 27ff2: 82 83 std Z+2, r24 ; 0x02 27ff4: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 27ff6: ac 14 cp r10, r12 27ff8: bd 04 cpc r11, r13 27ffa: 49 f7 brne .-46 ; 0x27fce { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 27ffc: 2e e6 ldi r18, 0x6E ; 110 27ffe: 22 9d mul r18, r2 28000: c0 01 movw r24, r0 28002: 23 9d mul r18, r3 28004: 90 0d add r25, r0 28006: 11 24 eor r1, r1 28008: 9c 01 movw r18, r24 2800a: 22 5a subi r18, 0xA2 ; 162 2800c: 39 4f sbci r19, 0xF9 ; 249 2800e: 79 01 movw r14, r18 28010: 29 a5 ldd r18, Y+41 ; 0x29 28012: 3d a5 ldd r19, Y+45 ; 0x2d 28014: a8 01 movw r20, r16 28016: 6d a9 ldd r22, Y+53 ; 0x35 28018: 7e a9 ldd r23, Y+54 ; 0x36 2801a: 8f a9 ldd r24, Y+55 ; 0x37 2801c: 98 ad ldd r25, Y+56 ; 0x38 2801e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28022: d7 01 movw r26, r14 28024: 91 96 adiw r26, 0x21 ; 33 28026: 6d 93 st X+, r22 28028: 7d 93 st X+, r23 2802a: 8d 93 st X+, r24 2802c: 9c 93 st X, r25 2802e: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 28030: 62 96 adiw r28, 0x12 ; 18 28032: 6c ad ldd r22, Y+60 ; 0x3c 28034: 7d ad ldd r23, Y+61 ; 0x3d 28036: 8e ad ldd r24, Y+62 ; 0x3e 28038: 9f ad ldd r25, Y+63 ; 0x3f 2803a: 62 97 sbiw r28, 0x12 ; 18 2803c: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 28040: 29 a5 ldd r18, Y+41 ; 0x29 28042: 3d a5 ldd r19, Y+45 ; 0x2d 28044: a8 01 movw r20, r16 28046: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2804a: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 2804e: f7 01 movw r30, r14 28050: 66 ab std Z+54, r22 ; 0x36 28052: 77 ab std Z+55, r23 ; 0x37 28054: 80 af std Z+56, r24 ; 0x38 28056: 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; 28058: a3 01 movw r20, r6 2805a: 92 01 movw r18, r4 2805c: 69 ad ldd r22, Y+57 ; 0x39 2805e: 7a ad ldd r23, Y+58 ; 0x3a 28060: 8b ad ldd r24, Y+59 ; 0x3b 28062: 9c ad ldd r25, Y+60 ; 0x3c 28064: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28068: 69 a7 std Y+41, r22 ; 0x29 2806a: 7a a7 std Y+42, r23 ; 0x2a 2806c: 8b a7 std Y+43, r24 ; 0x2b 2806e: 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) 28070: 2e 96 adiw r28, 0x0e ; 14 28072: 2c ad ldd r18, Y+60 ; 0x3c 28074: 3d ad ldd r19, Y+61 ; 0x3d 28076: 4e ad ldd r20, Y+62 ; 0x3e 28078: 5f ad ldd r21, Y+63 ; 0x3f 2807a: 2e 97 sbiw r28, 0x0e ; 14 2807c: 23 2b or r18, r19 2807e: 24 2b or r18, r20 28080: 25 2b or r18, r21 28082: 09 f0 breq .+2 ; 0x28086 28084: b9 c5 rjmp .+2930 ; 0x28bf8 28086: 8e e6 ldi r24, 0x6E ; 110 28088: 82 9d mul r24, r2 2808a: 80 01 movw r16, r0 2808c: 83 9d mul r24, r3 2808e: 10 0d add r17, r0 28090: 11 24 eor r1, r1 28092: 02 5a subi r16, 0xA2 ; 162 28094: 19 4f sbci r17, 0xF9 ; 249 28096: f8 01 movw r30, r16 28098: 84 81 ldd r24, Z+4 ; 0x04 2809a: 95 81 ldd r25, Z+5 ; 0x05 2809c: a6 81 ldd r26, Z+6 ; 0x06 2809e: b7 81 ldd r27, Z+7 ; 0x07 280a0: 89 2b or r24, r25 280a2: 8a 2b or r24, r26 280a4: 8b 2b or r24, r27 280a6: 09 f0 breq .+2 ; 0x280aa 280a8: a7 c5 rjmp .+2894 ; 0x28bf8 280aa: 80 85 ldd r24, Z+8 ; 0x08 280ac: 91 85 ldd r25, Z+9 ; 0x09 280ae: a2 85 ldd r26, Z+10 ; 0x0a 280b0: b3 85 ldd r27, Z+11 ; 0x0b 280b2: 89 2b or r24, r25 280b4: 8a 2b or r24, r26 280b6: 8b 2b or r24, r27 280b8: 09 f0 breq .+2 ; 0x280bc 280ba: 9e c5 rjmp .+2876 ; 0x28bf8 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 280bc: 20 91 9f 0d lds r18, 0x0D9F ; 0x800d9f 280c0: 30 91 a0 0d lds r19, 0x0DA0 ; 0x800da0 280c4: 40 91 a1 0d lds r20, 0x0DA1 ; 0x800da1 280c8: 50 91 a2 0d lds r21, 0x0DA2 ; 0x800da2 280cc: 69 a5 ldd r22, Y+41 ; 0x29 280ce: 7a a5 ldd r23, Y+42 ; 0x2a 280d0: 8b a5 ldd r24, Y+43 ; 0x2b 280d2: 9c a5 ldd r25, Y+44 ; 0x2c 280d4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 280d8: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 280dc: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 280e0: 2b 01 movw r4, r22 280e2: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 280e4: f8 01 movw r30, r16 280e6: e4 5b subi r30, 0xB4 ; 180 280e8: ff 4f sbci r31, 0xFF ; 255 280ea: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 280ec: 6a 96 adiw r28, 0x1a ; 26 280ee: 1c ae std Y+60, r1 ; 0x3c 280f0: 1d ae std Y+61, r1 ; 0x3d 280f2: 1e ae std Y+62, r1 ; 0x3e 280f4: 1f ae std Y+63, r1 ; 0x3f 280f6: 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; 280f8: 8e e6 ldi r24, 0x6E ; 110 280fa: 82 9d mul r24, r2 280fc: 80 01 movw r16, r0 280fe: 83 9d mul r24, r3 28100: 10 0d add r17, r0 28102: 11 24 eor r1, r1 28104: 02 5a subi r16, 0xA2 ; 162 28106: 19 4f sbci r17, 0xF9 ; 249 28108: f8 01 movw r30, r16 2810a: ee 5b subi r30, 0xBE ; 190 2810c: ff 4f sbci r31, 0xFF ; 255 2810e: 40 82 st Z, r4 28110: 51 82 std Z+1, r5 ; 0x01 28112: 62 82 std Z+2, r6 ; 0x02 28114: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 28116: c3 01 movw r24, r6 28118: b2 01 movw r22, r4 2811a: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 2811e: 6b 01 movw r12, r22 28120: 7c 01 movw r14, r24 28122: 29 a5 ldd r18, Y+41 ; 0x29 28124: 3a a5 ldd r19, Y+42 ; 0x2a 28126: 4b a5 ldd r20, Y+43 ; 0x2b 28128: 5c a5 ldd r21, Y+44 ; 0x2c 2812a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 2812e: e1 96 adiw r28, 0x31 ; 49 28130: 6c af std Y+60, r22 ; 0x3c 28132: 7d af std Y+61, r23 ; 0x3d 28134: 8e af std Y+62, r24 ; 0x3e 28136: 9f af std Y+63, r25 ; 0x3f 28138: e1 97 sbiw r28, 0x31 ; 49 2813a: f8 01 movw r30, r16 2813c: 61 ab std Z+49, r22 ; 0x31 2813e: 72 ab std Z+50, r23 ; 0x32 28140: 83 ab std Z+51, r24 ; 0x33 28142: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 28144: 2d eb ldi r18, 0xBD ; 189 28146: 37 e3 ldi r19, 0x37 ; 55 28148: 46 e0 ldi r20, 0x06 ; 6 2814a: 51 e4 ldi r21, 0x41 ; 65 2814c: c7 01 movw r24, r14 2814e: b6 01 movw r22, r12 28150: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28154: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 28158: d8 01 movw r26, r16 2815a: 54 96 adiw r26, 0x14 ; 20 2815c: 6d 93 st X+, r22 2815e: 7d 93 st X+, r23 28160: 8d 93 st X+, r24 28162: 9c 93 st X, r25 28164: 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; 28166: 91 96 adiw r26, 0x21 ; 33 28168: bc 91 ld r27, X 2816a: 27 96 adiw r28, 0x07 ; 7 2816c: bf af std Y+63, r27 ; 0x3f 2816e: 27 97 sbiw r28, 0x07 ; 7 28170: f8 01 movw r30, r16 28172: f2 a1 ldd r31, Z+34 ; 0x22 28174: 2b 96 adiw r28, 0x0b ; 11 28176: ff af std Y+63, r31 ; 0x3f 28178: 2b 97 sbiw r28, 0x0b ; 11 2817a: d8 01 movw r26, r16 2817c: 93 96 adiw r26, 0x23 ; 35 2817e: bc 91 ld r27, X 28180: 2f 96 adiw r28, 0x0f ; 15 28182: bf af std Y+63, r27 ; 0x3f 28184: 2f 97 sbiw r28, 0x0f ; 15 28186: f8 01 movw r30, r16 28188: f4 a1 ldd r31, Z+36 ; 0x24 2818a: 63 96 adiw r28, 0x13 ; 19 2818c: ff af std Y+63, r31 ; 0x3f 2818e: 63 97 sbiw r28, 0x13 ; 19 28190: 2f ea ldi r18, 0xAF ; 175 28192: 3d e0 ldi r19, 0x0D ; 13 28194: ed 96 adiw r28, 0x3d ; 61 28196: 3f af std Y+63, r19 ; 0x3f 28198: 2e af std Y+62, r18 ; 0x3e 2819a: ed 97 sbiw r28, 0x3d ; 61 2819c: 6e 96 adiw r28, 0x1e ; 30 2819e: 4e ac ldd r4, Y+62 ; 0x3e 281a0: 5f ac ldd r5, Y+63 ; 0x3f 281a2: 6e 97 sbiw r28, 0x1e ; 30 281a4: 30 e1 ldi r19, 0x10 ; 16 281a6: 43 0e add r4, r19 281a8: 51 1c adc r5, r1 281aa: 0f ea ldi r16, 0xAF ; 175 281ac: 1d e0 ldi r17, 0x0D ; 13 281ae: 6e 96 adiw r28, 0x1e ; 30 281b0: 6e ac ldd r6, Y+62 ; 0x3e 281b2: 7f ac ldd r7, Y+63 ; 0x3f 281b4: 6e 97 sbiw r28, 0x1e ; 30 281b6: 27 96 adiw r28, 0x07 ; 7 281b8: 4f ad ldd r20, Y+63 ; 0x3f 281ba: 27 97 sbiw r28, 0x07 ; 7 281bc: 49 a7 std Y+41, r20 ; 0x29 281be: 2b 96 adiw r28, 0x0b ; 11 281c0: 5f ad ldd r21, Y+63 ; 0x3f 281c2: 2b 97 sbiw r28, 0x0b ; 11 281c4: 5d a7 std Y+45, r21 ; 0x2d 281c6: b9 af std Y+57, r27 ; 0x39 281c8: f9 ab std Y+49, r31 ; 0x31 bool limited = false; 281ca: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 281cc: d3 01 movw r26, r6 281ce: 8d 90 ld r8, X+ 281d0: 9d 90 ld r9, X+ 281d2: ad 90 ld r10, X+ 281d4: bd 90 ld r11, X+ 281d6: 3d 01 movw r6, r26 281d8: e8 94 clt 281da: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 281dc: f8 01 movw r30, r16 281de: c1 90 ld r12, Z+ 281e0: d1 90 ld r13, Z+ 281e2: e1 90 ld r14, Z+ 281e4: f1 90 ld r15, Z+ 281e6: 8f 01 movw r16, r30 281e8: a5 01 movw r20, r10 281ea: 94 01 movw r18, r8 281ec: c7 01 movw r24, r14 281ee: b6 01 movw r22, r12 281f0: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 281f4: 87 ff sbrs r24, 7 281f6: 3a c0 rjmp .+116 ; 0x2826c // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 281f8: fd a9 ldd r31, Y+53 ; 0x35 281fa: ff 23 and r31, r31 281fc: 09 f4 brne .+2 ; 0x28200 281fe: 7e c6 rjmp .+3324 ; 0x28efc // 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; 28200: 29 a5 ldd r18, Y+41 ; 0x29 28202: 3d a5 ldd r19, Y+45 ; 0x2d 28204: 49 ad ldd r20, Y+57 ; 0x39 28206: 59 a9 ldd r21, Y+49 ; 0x31 28208: c5 01 movw r24, r10 2820a: b4 01 movw r22, r8 2820c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28210: 4b 01 movw r8, r22 28212: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 28214: a7 01 movw r20, r14 28216: 96 01 movw r18, r12 28218: 27 96 adiw r28, 0x07 ; 7 2821a: 6f ad ldd r22, Y+63 ; 0x3f 2821c: 27 97 sbiw r28, 0x07 ; 7 2821e: 2b 96 adiw r28, 0x0b ; 11 28220: 7f ad ldd r23, Y+63 ; 0x3f 28222: 2b 97 sbiw r28, 0x0b ; 11 28224: 2f 96 adiw r28, 0x0f ; 15 28226: 8f ad ldd r24, Y+63 ; 0x3f 28228: 2f 97 sbiw r28, 0x0f ; 15 2822a: 63 96 adiw r28, 0x13 ; 19 2822c: 9f ad ldd r25, Y+63 ; 0x3f 2822e: 63 97 sbiw r28, 0x13 ; 19 28230: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28234: 6b 01 movw r12, r22 28236: 7c 01 movw r14, r24 if (jerk > mjerk) { 28238: ac 01 movw r20, r24 2823a: 9b 01 movw r18, r22 2823c: c5 01 movw r24, r10 2823e: b4 01 movw r22, r8 28240: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28244: 18 16 cp r1, r24 28246: 94 f4 brge .+36 ; 0x2826c safe_speed *= mjerk / jerk; 28248: a5 01 movw r20, r10 2824a: 94 01 movw r18, r8 2824c: c7 01 movw r24, r14 2824e: b6 01 movw r22, r12 28250: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28254: 9b 01 movw r18, r22 28256: ac 01 movw r20, r24 28258: 69 a5 ldd r22, Y+41 ; 0x29 2825a: 7d a5 ldd r23, Y+45 ; 0x2d 2825c: 89 ad ldd r24, Y+57 ; 0x39 2825e: 99 a9 ldd r25, Y+49 ; 0x31 28260: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28264: 69 a7 std Y+41, r22 ; 0x29 28266: 7d a7 std Y+45, r23 ; 0x2d 28268: 89 af std Y+57, r24 ; 0x39 2826a: 99 ab std Y+49, r25 ; 0x31 // 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) { 2826c: 46 14 cp r4, r6 2826e: 57 04 cpc r5, r7 28270: 09 f0 breq .+2 ; 0x28274 28272: ac cf rjmp .-168 ; 0x281cc } } } // Reset the block flag. block->flag = 0; 28274: 8e e6 ldi r24, 0x6E ; 110 28276: 82 9d mul r24, r2 28278: f0 01 movw r30, r0 2827a: 83 9d mul r24, r3 2827c: f0 0d add r31, r0 2827e: 11 24 eor r1, r1 28280: e2 5a subi r30, 0xA2 ; 162 28282: f9 4f sbci r31, 0xF9 ; 249 28284: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 28286: 80 91 20 04 lds r24, 0x0420 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.445> 2828a: 88 23 and r24, r24 2828c: 21 f0 breq .+8 ; 0x28296 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 2828e: 80 e1 ldi r24, 0x10 ; 16 28290: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 28292: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.445> 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) { 28296: 3d ad ldd r19, Y+61 ; 0x3d 28298: 32 30 cpi r19, 0x02 ; 2 2829a: 08 f4 brcc .+2 ; 0x2829e 2829c: 8f c6 rjmp .+3358 ; 0x28fbc 2829e: 40 91 22 04 lds r20, 0x0422 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.446> 282a2: 6b 96 adiw r28, 0x1b ; 27 282a4: 4f af std Y+63, r20 ; 0x3f 282a6: 6b 97 sbiw r28, 0x1b ; 27 282a8: 50 91 23 04 lds r21, 0x0423 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.446+0x1> 282ac: 6f 96 adiw r28, 0x1f ; 31 282ae: 5f af std Y+63, r21 ; 0x3f 282b0: 6f 97 sbiw r28, 0x1f ; 31 282b2: 00 91 24 04 lds r16, 0x0424 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.446+0x2> 282b6: 10 91 25 04 lds r17, 0x0425 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.446+0x3> 282ba: 27 e1 ldi r18, 0x17 ; 23 282bc: 37 eb ldi r19, 0xB7 ; 183 282be: 41 ed ldi r20, 0xD1 ; 209 282c0: 58 e3 ldi r21, 0x38 ; 56 282c2: 6b 96 adiw r28, 0x1b ; 27 282c4: 6f ad ldd r22, Y+63 ; 0x3f 282c6: 6b 97 sbiw r28, 0x1b ; 27 282c8: 6f 96 adiw r28, 0x1f ; 31 282ca: 7f ad ldd r23, Y+63 ; 0x3f 282cc: 6f 97 sbiw r28, 0x1f ; 31 282ce: c8 01 movw r24, r16 282d0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 282d4: 18 16 cp r1, r24 282d6: 0c f0 brlt .+2 ; 0x282da 282d8: 71 c6 rjmp .+3298 ; 0x28fbc // 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); 282da: 6b 96 adiw r28, 0x1b ; 27 282dc: 2f ad ldd r18, Y+63 ; 0x3f 282de: 6b 97 sbiw r28, 0x1b ; 27 282e0: 6f 96 adiw r28, 0x1f ; 31 282e2: 3f ad ldd r19, Y+63 ; 0x3f 282e4: 6f 97 sbiw r28, 0x1f ; 31 282e6: a8 01 movw r20, r16 282e8: 27 96 adiw r28, 0x07 ; 7 282ea: 6f ad ldd r22, Y+63 ; 0x3f 282ec: 27 97 sbiw r28, 0x07 ; 7 282ee: 2b 96 adiw r28, 0x0b ; 11 282f0: 7f ad ldd r23, Y+63 ; 0x3f 282f2: 2b 97 sbiw r28, 0x0b ; 11 282f4: 2f 96 adiw r28, 0x0f ; 15 282f6: 8f ad ldd r24, Y+63 ; 0x3f 282f8: 2f 97 sbiw r28, 0x0f ; 15 282fa: 63 96 adiw r28, 0x13 ; 19 282fc: 9f ad ldd r25, Y+63 ; 0x3f 282fe: 63 97 sbiw r28, 0x13 ; 19 28300: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28304: 87 ff sbrs r24, 7 28306: 01 c6 rjmp .+3074 ; 0x28f0a 28308: 6b 96 adiw r28, 0x1b ; 27 2830a: 2f ad ldd r18, Y+63 ; 0x3f 2830c: 6b 97 sbiw r28, 0x1b ; 27 2830e: 6f 96 adiw r28, 0x1f ; 31 28310: 3f ad ldd r19, Y+63 ; 0x3f 28312: 6f 97 sbiw r28, 0x1f ; 31 28314: a8 01 movw r20, r16 28316: 27 96 adiw r28, 0x07 ; 7 28318: 6f ad ldd r22, Y+63 ; 0x3f 2831a: 27 97 sbiw r28, 0x07 ; 7 2831c: 2b 96 adiw r28, 0x0b ; 11 2831e: 7f ad ldd r23, Y+63 ; 0x3f 28320: 2b 97 sbiw r28, 0x0b ; 11 28322: 2f 96 adiw r28, 0x0f ; 15 28324: 8f ad ldd r24, Y+63 ; 0x3f 28326: 2f 97 sbiw r28, 0x0f ; 15 28328: 63 96 adiw r28, 0x13 ; 19 2832a: 9f ad ldd r25, Y+63 ; 0x3f 2832c: 63 97 sbiw r28, 0x13 ; 19 2832e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28332: eb 96 adiw r28, 0x3b ; 59 28334: 6c af std Y+60, r22 ; 0x3c 28336: 7d af std Y+61, r23 ; 0x3d 28338: 8e af std Y+62, r24 ; 0x3e 2833a: 9f af std Y+63, r25 ; 0x3f 2833c: eb 97 sbiw r28, 0x3b ; 59 // 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; 2833e: 27 96 adiw r28, 0x07 ; 7 28340: 8f ad ldd r24, Y+63 ; 0x3f 28342: 27 97 sbiw r28, 0x07 ; 7 28344: 8d af std Y+61, r24 ; 0x3d 28346: 2b 96 adiw r28, 0x0b ; 11 28348: 9f ad ldd r25, Y+63 ; 0x3f 2834a: 2b 97 sbiw r28, 0x0b ; 11 2834c: 9d ab std Y+53, r25 ; 0x35 2834e: 2f 96 adiw r28, 0x0f ; 15 28350: af ad ldd r26, Y+63 ; 0x3f 28352: 2f 97 sbiw r28, 0x0f ; 15 28354: ae af std Y+62, r26 ; 0x3e 28356: 63 96 adiw r28, 0x13 ; 19 28358: bf ad ldd r27, Y+63 ; 0x3f 2835a: 63 97 sbiw r28, 0x13 ; 19 2835c: 23 96 adiw r28, 0x03 ; 3 2835e: bf af std Y+63, r27 ; 0x3f 28360: 23 97 sbiw r28, 0x03 ; 3 28362: 26 e2 ldi r18, 0x26 ; 38 28364: 34 e0 ldi r19, 0x04 ; 4 28366: e7 96 adiw r28, 0x37 ; 55 28368: 3f af std Y+63, r19 ; 0x3f 2836a: 2e af std Y+62, r18 ; 0x3e 2836c: e7 97 sbiw r28, 0x37 ; 55 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 2836e: 41 2c mov r4, r1 28370: 51 2c mov r5, r1 28372: 30 e8 ldi r19, 0x80 ; 128 28374: 63 2e mov r6, r19 28376: 3f e3 ldi r19, 0x3F ; 63 28378: 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]; 2837a: e7 96 adiw r28, 0x37 ; 55 2837c: ae ad ldd r26, Y+62 ; 0x3e 2837e: bf ad ldd r27, Y+63 ; 0x3f 28380: e7 97 sbiw r28, 0x37 ; 55 28382: 8d 90 ld r8, X+ 28384: 9d 90 ld r9, X+ 28386: ad 90 ld r10, X+ 28388: bd 90 ld r11, X+ 2838a: e7 96 adiw r28, 0x37 ; 55 2838c: bf af std Y+63, r27 ; 0x3f 2838e: ae af std Y+62, r26 ; 0x3e 28390: e7 97 sbiw r28, 0x37 ; 55 float v_entry = current_speed [axis]; 28392: 6e 96 adiw r28, 0x1e ; 30 28394: ee ad ldd r30, Y+62 ; 0x3e 28396: ff ad ldd r31, Y+63 ; 0x3f 28398: 6e 97 sbiw r28, 0x1e ; 30 2839a: c1 90 ld r12, Z+ 2839c: d1 90 ld r13, Z+ 2839e: e1 90 ld r14, Z+ 283a0: f1 90 ld r15, Z+ 283a2: 6e 96 adiw r28, 0x1e ; 30 283a4: ff af std Y+63, r31 ; 0x3f 283a6: ee af std Y+62, r30 ; 0x3e 283a8: 6e 97 sbiw r28, 0x1e ; 30 if (prev_speed_larger) 283aa: 6b 96 adiw r28, 0x1b ; 27 283ac: 2f ad ldd r18, Y+63 ; 0x3f 283ae: 6b 97 sbiw r28, 0x1b ; 27 283b0: 6f 96 adiw r28, 0x1f ; 31 283b2: 3f ad ldd r19, Y+63 ; 0x3f 283b4: 6f 97 sbiw r28, 0x1f ; 31 283b6: a8 01 movw r20, r16 283b8: 27 96 adiw r28, 0x07 ; 7 283ba: 6f ad ldd r22, Y+63 ; 0x3f 283bc: 27 97 sbiw r28, 0x07 ; 7 283be: 2b 96 adiw r28, 0x0b ; 11 283c0: 7f ad ldd r23, Y+63 ; 0x3f 283c2: 2b 97 sbiw r28, 0x0b ; 11 283c4: 2f 96 adiw r28, 0x0f ; 15 283c6: 8f ad ldd r24, Y+63 ; 0x3f 283c8: 2f 97 sbiw r28, 0x0f ; 15 283ca: 63 96 adiw r28, 0x13 ; 19 283cc: 9f ad ldd r25, Y+63 ; 0x3f 283ce: 63 97 sbiw r28, 0x13 ; 19 283d0: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 283d4: 87 ff sbrs r24, 7 283d6: 0c c0 rjmp .+24 ; 0x283f0 v_exit *= smaller_speed_factor; 283d8: eb 96 adiw r28, 0x3b ; 59 283da: 2c ad ldd r18, Y+60 ; 0x3c 283dc: 3d ad ldd r19, Y+61 ; 0x3d 283de: 4e ad ldd r20, Y+62 ; 0x3e 283e0: 5f ad ldd r21, Y+63 ; 0x3f 283e2: eb 97 sbiw r28, 0x3b ; 59 283e4: c5 01 movw r24, r10 283e6: b4 01 movw r22, r8 283e8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 283ec: 4b 01 movw r8, r22 283ee: 5c 01 movw r10, r24 if (limited) { 283f0: a1 96 adiw r28, 0x21 ; 33 283f2: ff ad ldd r31, Y+63 ; 0x3f 283f4: a1 97 sbiw r28, 0x21 ; 33 283f6: ff 23 and r31, r31 283f8: 81 f0 breq .+32 ; 0x2841a v_exit *= v_factor; 283fa: a3 01 movw r20, r6 283fc: 92 01 movw r18, r4 283fe: c5 01 movw r24, r10 28400: b4 01 movw r22, r8 28402: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28406: 4b 01 movw r8, r22 28408: 5c 01 movw r10, r24 v_entry *= v_factor; 2840a: a3 01 movw r20, r6 2840c: 92 01 movw r18, r4 2840e: c7 01 movw r24, r14 28410: b6 01 movw r22, r12 28412: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28416: 6b 01 movw r12, r22 28418: 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) ? 2841a: a7 01 movw r20, r14 2841c: 96 01 movw r18, r12 2841e: c5 01 movw r24, r10 28420: b4 01 movw r22, r8 28422: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 28426: 20 e0 ldi r18, 0x00 ; 0 28428: 30 e0 ldi r19, 0x00 ; 0 2842a: 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) ? 2842c: 18 16 cp r1, r24 2842e: 0c f0 brlt .+2 ; 0x28432 28430: a3 c5 rjmp .+2886 ; 0x28f78 ((v_entry > 0.f || v_exit < 0.f) ? 28432: c7 01 movw r24, r14 28434: b6 01 movw r22, r12 28436: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2843a: 18 16 cp r1, r24 2843c: 4c f0 brlt .+18 ; 0x28450 2843e: 20 e0 ldi r18, 0x00 ; 0 28440: 30 e0 ldi r19, 0x00 ; 0 28442: a9 01 movw r20, r18 28444: c5 01 movw r24, r10 28446: b4 01 movw r22, r8 28448: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2844c: 87 ff sbrs r24, 7 2844e: 85 c5 rjmp .+2826 ; 0x28f5a 28450: a7 01 movw r20, r14 28452: 96 01 movw r18, r12 28454: c5 01 movw r24, r10 28456: 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) ? 28458: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2845c: 6b 01 movw r12, r22 2845e: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 28460: ed 96 adiw r28, 0x3d ; 61 28462: ae ad ldd r26, Y+62 ; 0x3e 28464: bf ad ldd r27, Y+63 ; 0x3f 28466: ed 97 sbiw r28, 0x3d ; 61 28468: 8d 90 ld r8, X+ 2846a: 9d 90 ld r9, X+ 2846c: ad 90 ld r10, X+ 2846e: bd 90 ld r11, X+ 28470: ed 96 adiw r28, 0x3d ; 61 28472: bf af std Y+63, r27 ; 0x3f 28474: ae af std Y+62, r26 ; 0x3e 28476: ed 97 sbiw r28, 0x3d ; 61 28478: a5 01 movw r20, r10 2847a: 94 01 movw r18, r8 2847c: c7 01 movw r24, r14 2847e: b6 01 movw r22, r12 28480: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28484: 18 16 cp r1, r24 28486: 94 f4 brge .+36 ; 0x284ac v_factor *= cs.max_jerk[axis] / jerk; 28488: a7 01 movw r20, r14 2848a: 96 01 movw r18, r12 2848c: c5 01 movw r24, r10 2848e: b4 01 movw r22, r8 28490: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28494: 9b 01 movw r18, r22 28496: ac 01 movw r20, r24 28498: c3 01 movw r24, r6 2849a: b2 01 movw r22, r4 2849c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 284a0: 2b 01 movw r4, r22 284a2: 3c 01 movw r6, r24 limited = true; 284a4: b1 e0 ldi r27, 0x01 ; 1 284a6: a1 96 adiw r28, 0x21 ; 33 284a8: bf af std Y+63, r27 ; 0x3f 284aa: a1 97 sbiw r28, 0x21 ; 33 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) { 284ac: e6 e3 ldi r30, 0x36 ; 54 284ae: f4 e0 ldi r31, 0x04 ; 4 284b0: e7 96 adiw r28, 0x37 ; 55 284b2: 2e ad ldd r18, Y+62 ; 0x3e 284b4: 3f ad ldd r19, Y+63 ; 0x3f 284b6: e7 97 sbiw r28, 0x37 ; 55 284b8: e2 17 cp r30, r18 284ba: f3 07 cpc r31, r19 284bc: 09 f0 breq .+2 ; 0x284c0 284be: 5d cf rjmp .-326 ; 0x2837a if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 284c0: a1 96 adiw r28, 0x21 ; 33 284c2: 3f ad ldd r19, Y+63 ; 0x3f 284c4: a1 97 sbiw r28, 0x21 ; 33 284c6: 33 23 and r19, r19 284c8: 81 f0 breq .+32 ; 0x284ea vmax_junction *= v_factor; 284ca: a3 01 movw r20, r6 284cc: 92 01 movw r18, r4 284ce: 6d ad ldd r22, Y+61 ; 0x3d 284d0: 7d a9 ldd r23, Y+53 ; 0x35 284d2: 8e ad ldd r24, Y+62 ; 0x3e 284d4: 23 96 adiw r28, 0x03 ; 3 284d6: 9f ad ldd r25, Y+63 ; 0x3f 284d8: 23 97 sbiw r28, 0x03 ; 3 284da: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 284de: 6d af std Y+61, r22 ; 0x3d 284e0: 7d ab std Y+53, r23 ; 0x35 284e2: 8e af std Y+62, r24 ; 0x3e 284e4: 23 96 adiw r28, 0x03 ; 3 284e6: 9f af std Y+63, r25 ; 0x3f 284e8: 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; 284ea: 24 ea ldi r18, 0xA4 ; 164 284ec: 30 e7 ldi r19, 0x70 ; 112 284ee: 4d e7 ldi r20, 0x7D ; 125 284f0: 5f e3 ldi r21, 0x3F ; 63 284f2: 6d ad ldd r22, Y+61 ; 0x3d 284f4: 7d a9 ldd r23, Y+53 ; 0x35 284f6: 8e ad ldd r24, Y+62 ; 0x3e 284f8: 23 96 adiw r28, 0x03 ; 3 284fa: 9f ad ldd r25, Y+63 ; 0x3f 284fc: 23 97 sbiw r28, 0x03 ; 3 284fe: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28502: 6b 01 movw r12, r22 28504: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 28506: ac 01 movw r20, r24 28508: 9b 01 movw r18, r22 2850a: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 2850e: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 28512: 80 91 a5 04 lds r24, 0x04A5 ; 0x8004a5 28516: 90 91 a6 04 lds r25, 0x04A6 ; 0x8004a6 2851a: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2851e: 18 16 cp r1, r24 28520: fc f4 brge .+62 ; 0x28560 28522: 29 a5 ldd r18, Y+41 ; 0x29 28524: 3d a5 ldd r19, Y+45 ; 0x2d 28526: 49 ad ldd r20, Y+57 ; 0x39 28528: 59 a9 ldd r21, Y+49 ; 0x31 2852a: c7 01 movw r24, r14 2852c: b6 01 movw r22, r12 2852e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28532: 87 ff sbrs r24, 7 28534: 15 c0 rjmp .+42 ; 0x28560 // 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; 28536: 8e e6 ldi r24, 0x6E ; 110 28538: 82 9d mul r24, r2 2853a: f0 01 movw r30, r0 2853c: 83 9d mul r24, r3 2853e: f0 0d add r31, r0 28540: 11 24 eor r1, r1 28542: e2 5a subi r30, 0xA2 ; 162 28544: f9 4f sbci r31, 0xF9 ; 249 28546: 85 a9 ldd r24, Z+53 ; 0x35 28548: 84 60 ori r24, 0x04 ; 4 2854a: 85 ab std Z+53, r24 ; 0x35 2854c: 49 a5 ldd r20, Y+41 ; 0x29 2854e: 4d af std Y+61, r20 ; 0x3d 28550: 5d a5 ldd r21, Y+45 ; 0x2d 28552: 5d ab std Y+53, r21 ; 0x35 28554: 89 ad ldd r24, Y+57 ; 0x39 28556: 8e af std Y+62, r24 ; 0x3e 28558: 99 a9 ldd r25, Y+49 ; 0x31 2855a: 23 96 adiw r28, 0x03 ; 3 2855c: 9f af std Y+63, r25 ; 0x3f 2855e: 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; 28560: 8e e6 ldi r24, 0x6E ; 110 28562: 82 9d mul r24, r2 28564: 80 01 movw r16, r0 28566: 83 9d mul r24, r3 28568: 10 0d add r17, r0 2856a: 11 24 eor r1, r1 2856c: 02 5a subi r16, 0xA2 ; 162 2856e: 19 4f sbci r17, 0xF9 ; 249 28570: 8d ad ldd r24, Y+61 ; 0x3d 28572: 9d a9 ldd r25, Y+53 ; 0x35 28574: ae ad ldd r26, Y+62 ; 0x3e 28576: 23 96 adiw r28, 0x03 ; 3 28578: bf ad ldd r27, Y+63 ; 0x3f 2857a: 23 97 sbiw r28, 0x03 ; 3 2857c: f8 01 movw r30, r16 2857e: 81 a7 std Z+41, r24 ; 0x29 28580: 92 a7 std Z+42, r25 ; 0x2a 28582: a3 a7 std Z+43, r26 ; 0x2b 28584: 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); 28586: 29 a5 ldd r18, Y+41 ; 0x29 28588: 3d a5 ldd r19, Y+45 ; 0x2d 2858a: 49 ad ldd r20, Y+57 ; 0x39 2858c: 59 a9 ldd r21, Y+49 ; 0x31 2858e: 69 a5 ldd r22, Y+41 ; 0x29 28590: 7d a5 ldd r23, Y+45 ; 0x2d 28592: 89 ad ldd r24, Y+57 ; 0x39 28594: 99 a9 ldd r25, Y+49 ; 0x31 28596: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2859a: 6b 01 movw r12, r22 2859c: 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); 2859e: e1 96 adiw r28, 0x31 ; 49 285a0: 6c ad ldd r22, Y+60 ; 0x3c 285a2: 7d ad ldd r23, Y+61 ; 0x3d 285a4: 8e ad ldd r24, Y+62 ; 0x3e 285a6: 9f ad ldd r25, Y+63 ; 0x3f 285a8: e1 97 sbiw r28, 0x31 ; 49 285aa: 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); 285ac: 9b 01 movw r18, r22 285ae: ac 01 movw r20, r24 285b0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 285b4: d8 01 movw r26, r16 285b6: 9d 96 adiw r26, 0x2d ; 45 285b8: 2d 91 ld r18, X+ 285ba: 3d 91 ld r19, X+ 285bc: 4d 91 ld r20, X+ 285be: 5c 91 ld r21, X 285c0: d0 97 sbiw r26, 0x30 ; 48 285c2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 285c6: 9b 01 movw r18, r22 285c8: ac 01 movw r20, r24 285ca: c7 01 movw r24, r14 285cc: b6 01 movw r22, r12 285ce: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 285d2: 0f 94 93 a8 call 0x35126 ; 0x35126 285d6: d6 2e mov r13, r22 285d8: e7 2e mov r14, r23 285da: 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); 285dc: 2d ad ldd r18, Y+61 ; 0x3d 285de: 3d a9 ldd r19, Y+53 ; 0x35 285e0: 4e ad ldd r20, Y+62 ; 0x3e 285e2: 23 96 adiw r28, 0x03 ; 3 285e4: 5f ad ldd r21, Y+63 ; 0x3f 285e6: 23 97 sbiw r28, 0x03 ; 3 285e8: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 285ec: 18 16 cp r1, r24 285ee: 34 f0 brlt .+12 ; 0x285fc 285f0: dd ae std Y+61, r13 ; 0x3d 285f2: ed aa std Y+53, r14 ; 0x35 285f4: 0e af std Y+62, r16 ; 0x3e 285f6: 23 96 adiw r28, 0x03 ; 3 285f8: 1f af std Y+63, r17 ; 0x3f 285fa: 23 97 sbiw r28, 0x03 ; 3 285fc: 8e e6 ldi r24, 0x6E ; 110 285fe: 82 9d mul r24, r2 28600: f0 01 movw r30, r0 28602: 83 9d mul r24, r3 28604: f0 0d add r31, r0 28606: 11 24 eor r1, r1 28608: e2 5a subi r30, 0xA2 ; 162 2860a: f9 4f sbci r31, 0xF9 ; 249 2860c: 8d ad ldd r24, Y+61 ; 0x3d 2860e: 9d a9 ldd r25, Y+53 ; 0x35 28610: ae ad ldd r26, Y+62 ; 0x3e 28612: 23 96 adiw r28, 0x03 ; 3 28614: bf ad ldd r27, Y+63 ; 0x3f 28616: 23 97 sbiw r28, 0x03 ; 3 28618: 85 a3 std Z+37, r24 ; 0x25 2861a: 96 a3 std Z+38, r25 ; 0x26 2861c: a7 a3 std Z+39, r26 ; 0x27 2861e: 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; 28620: f5 a8 ldd r15, Z+53 ; 0x35 28622: 2d 2d mov r18, r13 28624: 3e 2d mov r19, r14 28626: a8 01 movw r20, r16 28628: 27 96 adiw r28, 0x07 ; 7 2862a: 6f ad ldd r22, Y+63 ; 0x3f 2862c: 27 97 sbiw r28, 0x07 ; 7 2862e: 2b 96 adiw r28, 0x0b ; 11 28630: 7f ad ldd r23, Y+63 ; 0x3f 28632: 2b 97 sbiw r28, 0x0b ; 11 28634: 2f 96 adiw r28, 0x0f ; 15 28636: 8f ad ldd r24, Y+63 ; 0x3f 28638: 2f 97 sbiw r28, 0x0f ; 15 2863a: 63 96 adiw r28, 0x13 ; 19 2863c: 9f ad ldd r25, Y+63 ; 0x3f 2863e: 63 97 sbiw r28, 0x13 ; 19 28640: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28644: 18 16 cp r1, r24 28646: 0c f4 brge .+2 ; 0x2864a 28648: cf c4 rjmp .+2462 ; 0x28fe8 2864a: 83 e0 ldi r24, 0x03 ; 3 2864c: 9e e6 ldi r25, 0x6E ; 110 2864e: 92 9d mul r25, r2 28650: 80 01 movw r16, r0 28652: 93 9d mul r25, r3 28654: 10 0d add r17, r0 28656: 11 24 eor r1, r1 28658: 02 5a subi r16, 0xA2 ; 162 2865a: 19 4f sbci r17, 0xF9 ; 249 2865c: f8 2a or r15, r24 2865e: f8 01 movw r30, r16 28660: 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[] 28662: 80 e1 ldi r24, 0x10 ; 16 28664: fe 01 movw r30, r28 28666: 71 96 adiw r30, 0x11 ; 17 28668: a6 e2 ldi r26, 0x26 ; 38 2866a: b4 e0 ldi r27, 0x04 ; 4 2866c: 01 90 ld r0, Z+ 2866e: 0d 92 st X+, r0 28670: 8a 95 dec r24 28672: e1 f7 brne .-8 ; 0x2866c previous_nominal_speed = block->nominal_speed; 28674: 27 96 adiw r28, 0x07 ; 7 28676: 8f ad ldd r24, Y+63 ; 0x3f 28678: 27 97 sbiw r28, 0x07 ; 7 2867a: 2b 96 adiw r28, 0x0b ; 11 2867c: 9f ad ldd r25, Y+63 ; 0x3f 2867e: 2b 97 sbiw r28, 0x0b ; 11 28680: 2f 96 adiw r28, 0x0f ; 15 28682: af ad ldd r26, Y+63 ; 0x3f 28684: 2f 97 sbiw r28, 0x0f ; 15 28686: 63 96 adiw r28, 0x13 ; 19 28688: bf ad ldd r27, Y+63 ; 0x3f 2868a: 63 97 sbiw r28, 0x13 ; 19 2868c: 80 93 22 04 sts 0x0422, r24 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.446> 28690: 90 93 23 04 sts 0x0423, r25 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.446+0x1> 28694: a0 93 24 04 sts 0x0424, r26 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.446+0x2> 28698: b0 93 25 04 sts 0x0425, r27 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.446+0x3> previous_safe_speed = safe_speed; 2869c: 89 a5 ldd r24, Y+41 ; 0x29 2869e: 9d a5 ldd r25, Y+45 ; 0x2d 286a0: a9 ad ldd r26, Y+57 ; 0x39 286a2: b9 a9 ldd r27, Y+49 ; 0x31 286a4: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 286a8: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 286ac: a0 93 a5 04 sts 0x04A5, r26 ; 0x8004a5 286b0: b0 93 a6 04 sts 0x04A6, r27 ; 0x8004a6 // 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; 286b4: d8 01 movw r26, r16 286b6: d6 96 adiw r26, 0x36 ; 54 286b8: 6d 91 ld r22, X+ 286ba: 7d 91 ld r23, X+ 286bc: 8d 91 ld r24, X+ 286be: 9c 91 ld r25, X 286c0: d9 97 sbiw r26, 0x39 ; 57 286c2: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 286c6: 27 96 adiw r28, 0x07 ; 7 286c8: 2f ad ldd r18, Y+63 ; 0x3f 286ca: 27 97 sbiw r28, 0x07 ; 7 286cc: 2b 96 adiw r28, 0x0b ; 11 286ce: 3f ad ldd r19, Y+63 ; 0x3f 286d0: 2b 97 sbiw r28, 0x0b ; 11 286d2: 2f 96 adiw r28, 0x0f ; 15 286d4: 4f ad ldd r20, Y+63 ; 0x3f 286d6: 2f 97 sbiw r28, 0x0f ; 15 286d8: 63 96 adiw r28, 0x13 ; 19 286da: 5f ad ldd r21, Y+63 ; 0x3f 286dc: 63 97 sbiw r28, 0x13 ; 19 286de: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 286e2: 2b 01 movw r4, r22 286e4: 3c 01 movw r6, r24 286e6: f8 01 movw r30, r16 286e8: e8 5b subi r30, 0xB8 ; 184 286ea: ff 4f sbci r31, 0xFF ; 255 286ec: 40 82 st Z, r4 286ee: 51 82 std Z+1, r5 ; 0x01 286f0: 62 82 std Z+2, r6 ; 0x02 286f2: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 286f4: 34 96 adiw r30, 0x04 ; 4 286f6: 80 81 ld r24, Z 286f8: 88 23 and r24, r24 286fa: 09 f4 brne .+2 ; 0x286fe 286fc: 89 c0 rjmp .+274 ; 0x28810 // 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)) 286fe: 20 91 a7 04 lds r18, 0x04A7 ; 0x8004a7 28702: 30 91 a8 04 lds r19, 0x04A8 ; 0x8004a8 28706: 40 91 a9 04 lds r20, 0x04A9 ; 0x8004a9 2870a: 50 91 aa 04 lds r21, 0x04AA ; 0x8004aa 2870e: 6a 96 adiw r28, 0x1a ; 26 28710: 6c ad ldd r22, Y+60 ; 0x3c 28712: 7d ad ldd r23, Y+61 ; 0x3d 28714: 8e ad ldd r24, Y+62 ; 0x3e 28716: 9f ad ldd r25, Y+63 ; 0x3f 28718: 6a 97 sbiw r28, 0x1a ; 26 2871a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2871e: 4b 01 movw r8, r22 28720: 5c 01 movw r10, r24 28722: c0 90 77 0d lds r12, 0x0D77 ; 0x800d77 28726: d0 90 78 0d lds r13, 0x0D78 ; 0x800d78 2872a: e0 90 79 0d lds r14, 0x0D79 ; 0x800d79 2872e: f0 90 7a 0d lds r15, 0x0D7A ; 0x800d7a block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 28732: 0c 5a subi r16, 0xAC ; 172 28734: 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)) 28736: a7 01 movw r20, r14 28738: 96 01 movw r18, r12 2873a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2873e: a3 01 movw r20, r6 28740: 92 01 movw r18, r4 28742: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28746: f8 01 movw r30, r16 28748: 60 83 st Z, r22 2874a: 71 83 std Z+1, r23 ; 0x01 2874c: 82 83 std Z+2, r24 ; 0x02 2874e: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 28750: 20 e0 ldi r18, 0x00 ; 0 28752: 30 e0 ldi r19, 0x00 ; 0 28754: a9 01 movw r20, r18 28756: 6a 96 adiw r28, 0x1a ; 26 28758: 6c ad ldd r22, Y+60 ; 0x3c 2875a: 7d ad ldd r23, Y+61 ; 0x3d 2875c: 8e ad ldd r24, Y+62 ; 0x3e 2875e: 9f ad ldd r25, Y+63 ; 0x3f 28760: 6a 97 sbiw r28, 0x1a ; 26 28762: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28766: 18 16 cp r1, r24 28768: 0c f0 brlt .+2 ; 0x2876c 2876a: 40 c4 rjmp .+2176 ; 0x28fec advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 2876c: a5 01 movw r20, r10 2876e: 94 01 movw r18, r8 28770: e1 96 adiw r28, 0x31 ; 49 28772: 6c ad ldd r22, Y+60 ; 0x3c 28774: 7d ad ldd r23, Y+61 ; 0x3d 28776: 8e ad ldd r24, Y+62 ; 0x3e 28778: 9f ad ldd r25, Y+63 ; 0x3f 2877a: e1 97 sbiw r28, 0x31 ; 49 2877c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28780: a7 01 movw r20, r14 28782: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 28784: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28788: 6b 01 movw r12, r22 2878a: 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; 2878c: 20 e0 ldi r18, 0x00 ; 0 2878e: 30 e4 ldi r19, 0x40 ; 64 28790: 4c e1 ldi r20, 0x1C ; 28 28792: 57 e4 ldi r21, 0x47 ; 71 28794: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28798: 18 16 cp r1, r24 2879a: 3c f4 brge .+14 ; 0x287aa 2879c: c1 2c mov r12, r1 2879e: 20 e4 ldi r18, 0x40 ; 64 287a0: d2 2e mov r13, r18 287a2: 2c e1 ldi r18, 0x1C ; 28 287a4: e2 2e mov r14, r18 287a6: 27 e4 ldi r18, 0x47 ; 71 287a8: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 287aa: a7 01 movw r20, r14 287ac: 96 01 movw r18, r12 287ae: 60 e0 ldi r22, 0x00 ; 0 287b0: 74 e2 ldi r23, 0x24 ; 36 287b2: 84 ef ldi r24, 0xF4 ; 244 287b4: 99 e4 ldi r25, 0x49 ; 73 287b6: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 287ba: 4b 01 movw r8, r22 287bc: 5c 01 movw r10, r24 if (advance_speed > 20000) { 287be: 20 e0 ldi r18, 0x00 ; 0 287c0: 30 e4 ldi r19, 0x40 ; 64 287c2: 4c e9 ldi r20, 0x9C ; 156 287c4: 56 e4 ldi r21, 0x46 ; 70 287c6: c7 01 movw r24, r14 287c8: b6 01 movw r22, r12 287ca: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 287ce: 18 16 cp r1, r24 287d0: 0c f0 brlt .+2 ; 0x287d4 287d2: 17 c4 rjmp .+2094 ; 0x29002 block->advance_rate = advance_rate * 4; 287d4: 8e e6 ldi r24, 0x6E ; 110 287d6: 82 9d mul r24, r2 287d8: 80 01 movw r16, r0 287da: 83 9d mul r24, r3 287dc: 10 0d add r17, r0 287de: 11 24 eor r1, r1 287e0: 02 5a subi r16, 0xA2 ; 162 287e2: 19 4f sbci r17, 0xF9 ; 249 287e4: 78 01 movw r14, r16 287e6: fd e4 ldi r31, 0x4D ; 77 287e8: ef 0e add r14, r31 287ea: f1 1c adc r15, r1 287ec: 20 e0 ldi r18, 0x00 ; 0 287ee: 30 e0 ldi r19, 0x00 ; 0 287f0: 40 e8 ldi r20, 0x80 ; 128 287f2: 50 e4 ldi r21, 0x40 ; 64 287f4: c5 01 movw r24, r10 287f6: b4 01 movw r22, r8 287f8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 287fc: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 28800: d7 01 movw r26, r14 28802: 6d 93 st X+, r22 28804: 7c 93 st X, r23 block->advance_step_loops = 4; 28806: f8 01 movw r30, r16 28808: ed 5a subi r30, 0xAD ; 173 2880a: ff 4f sbci r31, 0xFF ; 255 2880c: 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; 2880e: 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); 28810: 09 a5 ldd r16, Y+41 ; 0x29 28812: 1d a5 ldd r17, Y+45 ; 0x2d 28814: 29 ad ldd r18, Y+57 ; 0x39 28816: 39 a9 ldd r19, Y+49 ; 0x31 28818: 4d ad ldd r20, Y+61 ; 0x3d 2881a: 5d a9 ldd r21, Y+53 ; 0x35 2881c: 6e ad ldd r22, Y+62 ; 0x3e 2881e: 23 96 adiw r28, 0x03 ; 3 28820: 7f ad ldd r23, Y+63 ; 0x3f 28822: 23 97 sbiw r28, 0x03 ; 3 28824: a3 96 adiw r28, 0x23 ; 35 28826: 8e ad ldd r24, Y+62 ; 0x3e 28828: 9f ad ldd r25, Y+63 ; 0x3f 2882a: a3 97 sbiw r28, 0x23 ; 35 2882c: 82 5a subi r24, 0xA2 ; 162 2882e: 99 4f sbci r25, 0xF9 ; 249 28830: 0f 94 62 06 call 0x20cc4 ; 0x20cc4 if (block->step_event_count.wide <= 32767) 28834: 8e e6 ldi r24, 0x6E ; 110 28836: 82 9d mul r24, r2 28838: f0 01 movw r30, r0 2883a: 83 9d mul r24, r3 2883c: f0 0d add r31, r0 2883e: 11 24 eor r1, r1 28840: e2 5a subi r30, 0xA2 ; 162 28842: f9 4f sbci r31, 0xF9 ; 249 28844: 80 89 ldd r24, Z+16 ; 0x10 28846: 91 89 ldd r25, Z+17 ; 0x11 28848: a2 89 ldd r26, Z+18 ; 0x12 2884a: b3 89 ldd r27, Z+19 ; 0x13 2884c: 81 15 cp r24, r1 2884e: 90 48 sbci r25, 0x80 ; 128 28850: a1 05 cpc r26, r1 28852: b1 05 cpc r27, r1 28854: 18 f4 brcc .+6 ; 0x2885c block->flag |= BLOCK_FLAG_DDA_LOWRES; 28856: 85 a9 ldd r24, Z+53 ; 0x35 28858: 88 60 ori r24, 0x08 ; 8 2885a: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2885c: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2885e: 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; 28860: 90 91 42 0d lds r25, 0x0D42 ; 0x800d42 28864: 91 11 cpse r25, r1 28866: 93 c4 rjmp .+2342 ; 0x2918e block_buffer_head = next_buffer_head; 28868: a0 96 adiw r28, 0x20 ; 32 2886a: 3f ad ldd r19, Y+63 ; 0x3f 2886c: a0 97 sbiw r28, 0x20 ; 32 2886e: 30 93 3e 0d sts 0x0D3E, r19 ; 0x800d3e (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28872: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 28874: c3 58 subi r28, 0x83 ; 131 28876: df 4f sbci r29, 0xFF ; 255 28878: 88 81 ld r24, Y 2887a: 99 81 ldd r25, Y+1 ; 0x01 2887c: aa 81 ldd r26, Y+2 ; 0x02 2887e: bb 81 ldd r27, Y+3 ; 0x03 28880: cd 57 subi r28, 0x7D ; 125 28882: d0 40 sbci r29, 0x00 ; 0 28884: 80 93 3c 06 sts 0x063C, r24 ; 0x80063c 28888: 90 93 3d 06 sts 0x063D, r25 ; 0x80063d 2888c: a0 93 3e 06 sts 0x063E, r26 ; 0x80063e 28890: b0 93 3f 06 sts 0x063F, r27 ; 0x80063f 28894: cf 57 subi r28, 0x7F ; 127 28896: df 4f sbci r29, 0xFF ; 255 28898: 28 81 ld r18, Y 2889a: 39 81 ldd r19, Y+1 ; 0x01 2889c: 4a 81 ldd r20, Y+2 ; 0x02 2889e: 5b 81 ldd r21, Y+3 ; 0x03 288a0: c1 58 subi r28, 0x81 ; 129 288a2: d0 40 sbci r29, 0x00 ; 0 288a4: 20 93 40 06 sts 0x0640, r18 ; 0x800640 288a8: 30 93 41 06 sts 0x0641, r19 ; 0x800641 288ac: 40 93 42 06 sts 0x0642, r20 ; 0x800642 288b0: 50 93 43 06 sts 0x0643, r21 ; 0x800643 288b4: e5 96 adiw r28, 0x35 ; 53 288b6: 8c ad ldd r24, Y+60 ; 0x3c 288b8: 9d ad ldd r25, Y+61 ; 0x3d 288ba: ae ad ldd r26, Y+62 ; 0x3e 288bc: bf ad ldd r27, Y+63 ; 0x3f 288be: e5 97 sbiw r28, 0x35 ; 53 288c0: 80 93 44 06 sts 0x0644, r24 ; 0x800644 288c4: 90 93 45 06 sts 0x0645, r25 ; 0x800645 288c8: a0 93 46 06 sts 0x0646, r26 ; 0x800646 288cc: b0 93 47 06 sts 0x0647, r27 ; 0x800647 288d0: ad 96 adiw r28, 0x2d ; 45 288d2: 2c ad ldd r18, Y+60 ; 0x3c 288d4: 3d ad ldd r19, Y+61 ; 0x3d 288d6: 4e ad ldd r20, Y+62 ; 0x3e 288d8: 5f ad ldd r21, Y+63 ; 0x3f 288da: ad 97 sbiw r28, 0x2d ; 45 288dc: 20 93 48 06 sts 0x0648, r18 ; 0x800648 288e0: 30 93 49 06 sts 0x0649, r19 ; 0x800649 288e4: 40 93 4a 06 sts 0x064A, r20 ; 0x80064a 288e8: 50 93 4b 06 sts 0x064B, r21 ; 0x80064b #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 288ec: 89 a1 ldd r24, Y+33 ; 0x21 288ee: 9a a1 ldd r25, Y+34 ; 0x22 288f0: ab a1 ldd r26, Y+35 ; 0x23 288f2: bc a1 ldd r27, Y+36 ; 0x24 288f4: 80 93 36 04 sts 0x0436, r24 ; 0x800436 288f8: 90 93 37 04 sts 0x0437, r25 ; 0x800437 288fc: a0 93 38 04 sts 0x0438, r26 ; 0x800438 28900: b0 93 39 04 sts 0x0439, r27 ; 0x800439 position_float[Y_AXIS] = y; 28904: 8d a1 ldd r24, Y+37 ; 0x25 28906: 9e a1 ldd r25, Y+38 ; 0x26 28908: af a1 ldd r26, Y+39 ; 0x27 2890a: b8 a5 ldd r27, Y+40 ; 0x28 2890c: 80 93 3a 04 sts 0x043A, r24 ; 0x80043a 28910: 90 93 3b 04 sts 0x043B, r25 ; 0x80043b 28914: a0 93 3c 04 sts 0x043C, r26 ; 0x80043c 28918: b0 93 3d 04 sts 0x043D, r27 ; 0x80043d position_float[Z_AXIS] = z; 2891c: a7 96 adiw r28, 0x27 ; 39 2891e: 8c ad ldd r24, Y+60 ; 0x3c 28920: 9d ad ldd r25, Y+61 ; 0x3d 28922: ae ad ldd r26, Y+62 ; 0x3e 28924: bf ad ldd r27, Y+63 ; 0x3f 28926: a7 97 sbiw r28, 0x27 ; 39 28928: 80 93 3e 04 sts 0x043E, r24 ; 0x80043e 2892c: 90 93 3f 04 sts 0x043F, r25 ; 0x80043f 28930: a0 93 40 04 sts 0x0440, r26 ; 0x800440 28934: b0 93 41 04 sts 0x0441, r27 ; 0x800441 position_float[E_AXIS] = e; 28938: a9 96 adiw r28, 0x29 ; 41 2893a: ee ad ldd r30, Y+62 ; 0x3e 2893c: ff ad ldd r31, Y+63 ; 0x3f 2893e: a9 97 sbiw r28, 0x29 ; 41 28940: 80 81 ld r24, Z 28942: 91 81 ldd r25, Z+1 ; 0x01 28944: a2 81 ldd r26, Z+2 ; 0x02 28946: b3 81 ldd r27, Z+3 ; 0x03 28948: 80 93 42 04 sts 0x0442, r24 ; 0x800442 2894c: 90 93 43 04 sts 0x0443, r25 ; 0x800443 28950: a0 93 44 04 sts 0x0444, r26 ; 0x800444 28954: b0 93 45 04 sts 0x0445, r27 ; 0x800445 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; 28958: f0 90 3f 0d lds r15, 0x0D3F ; 0x800d3f 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); 2895c: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 28960: 8f 19 sub r24, r15 28962: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 28964: 83 30 cpi r24, 0x03 ; 3 28966: 40 f1 brcs .+80 ; 0x289b8 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 28968: 10 91 3e 0d lds r17, 0x0D3E ; 0x800d3e } // 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) 2896c: 11 11 cpse r17, r1 2896e: 01 c0 rjmp .+2 ; 0x28972 block_index = BLOCK_BUFFER_SIZE; 28970: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 28972: 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; 28974: fe e6 ldi r31, 0x6E ; 110 28976: 1f 9f mul r17, r31 28978: c0 01 movw r24, r0 2897a: 11 24 eor r1, r1 2897c: 9c 01 movw r18, r24 2897e: 22 5a subi r18, 0xA2 ; 162 28980: 39 4f sbci r19, 0xF9 ; 249 28982: 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) 28984: 11 11 cpse r17, r1 28986: 01 c0 rjmp .+2 ; 0x2898a block_index = BLOCK_BUFFER_SIZE; 28988: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 2898a: 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)); 2898c: 3e e6 ldi r19, 0x6E ; 110 2898e: 13 9f mul r17, r19 28990: c0 01 movw r24, r0 28992: 11 24 eor r1, r1 28994: ac 01 movw r20, r24 28996: 42 5a subi r20, 0xA2 ; 162 28998: 59 4f sbci r21, 0xF9 ; 249 2899a: 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)); 2899c: 9e e6 ldi r25, 0x6E ; 110 2899e: 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) { 289a0: f1 16 cp r15, r17 289a2: 69 f0 breq .+26 ; 0x289be if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 289a4: d6 01 movw r26, r12 289a6: d5 96 adiw r26, 0x35 ; 53 289a8: 0c 91 ld r16, X 289aa: 02 ff sbrs r16, 2 289ac: 7e c3 rjmp .+1788 ; 0x290aa // 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); 289ae: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 289b2: 81 1b sub r24, r17 289b4: 8f 70 andi r24, 0x0F ; 15 289b6: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 289b8: 82 30 cpi r24, 0x02 ; 2 289ba: 08 f4 brcc .+2 ; 0x289be 289bc: a3 c0 rjmp .+326 ; 0x28b04 // 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; 289be: 3e e6 ldi r19, 0x6E ; 110 289c0: f3 9e mul r15, r19 289c2: c0 01 movw r24, r0 289c4: 11 24 eor r1, r1 289c6: ac 01 movw r20, r24 289c8: 42 5a subi r20, 0xA2 ; 162 289ca: 59 4f sbci r21, 0xF9 ; 249 289cc: 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) 289ce: f3 94 inc r15 289d0: 50 e1 ldi r21, 0x10 ; 16 289d2: f5 12 cpse r15, r21 289d4: 01 c0 rjmp .+2 ; 0x289d8 block_index = 0; 289d6: 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)); 289d8: ae e6 ldi r26, 0x6E ; 110 289da: fa 9e mul r15, r26 289dc: c0 01 movw r24, r0 289de: 11 24 eor r1, r1 289e0: fc 01 movw r30, r24 289e2: e2 5a subi r30, 0xA2 ; 162 289e4: f9 4f sbci r31, 0xF9 ; 249 289e6: 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)); 289e8: 8e e6 ldi r24, 0x6E ; 110 289ea: 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) { 289ec: d5 01 movw r26, r10 289ee: d5 96 adiw r26, 0x35 ; 53 289f0: 8c 91 ld r24, X 289f2: d5 97 sbiw r26, 0x35 ; 53 289f4: 81 fd sbrc r24, 1 289f6: 5a c0 rjmp .+180 ; 0x28aac 289f8: 95 96 adiw r26, 0x25 ; 37 289fa: 4d 90 ld r4, X+ 289fc: 5d 90 ld r5, X+ 289fe: 6d 90 ld r6, X+ 28a00: 7c 90 ld r7, X 28a02: 98 97 sbiw r26, 0x28 ; 40 28a04: f6 01 movw r30, r12 28a06: 95 a0 ldd r9, Z+37 ; 0x25 28a08: e6 a0 ldd r14, Z+38 ; 0x26 28a0a: 07 a1 ldd r16, Z+39 ; 0x27 28a0c: 10 a5 ldd r17, Z+40 ; 0x28 28a0e: 29 2d mov r18, r9 28a10: 3e 2d mov r19, r14 28a12: a8 01 movw r20, r16 28a14: c3 01 movw r24, r6 28a16: b2 01 movw r22, r4 28a18: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28a1c: 87 ff sbrs r24, 7 28a1e: 46 c0 rjmp .+140 ; 0x28aac // 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); 28a20: a3 01 movw r20, r6 28a22: 92 01 movw r18, r4 28a24: c3 01 movw r24, r6 28a26: b2 01 movw r22, r4 28a28: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28a2c: 2b 01 movw r4, r22 28a2e: 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)); 28a30: d5 01 movw r26, r10 28a32: d1 96 adiw r26, 0x31 ; 49 28a34: 6d 91 ld r22, X+ 28a36: 7d 91 ld r23, X+ 28a38: 8d 91 ld r24, X+ 28a3a: 9c 91 ld r25, X 28a3c: d4 97 sbiw r26, 0x34 ; 52 28a3e: 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); 28a40: 9b 01 movw r18, r22 28a42: ac 01 movw r20, r24 28a44: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 28a48: f5 01 movw r30, r10 28a4a: 25 a5 ldd r18, Z+45 ; 0x2d 28a4c: 36 a5 ldd r19, Z+46 ; 0x2e 28a4e: 47 a5 ldd r20, Z+47 ; 0x2f 28a50: 50 a9 ldd r21, Z+48 ; 0x30 28a52: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28a56: 9b 01 movw r18, r22 28a58: ac 01 movw r20, r24 28a5a: c3 01 movw r24, r6 28a5c: b2 01 movw r22, r4 28a5e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 28a62: 0f 94 93 a8 call 0x35126 ; 0x35126 28a66: 2b 01 movw r4, r22 28a68: 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)); 28a6a: 9b 01 movw r18, r22 28a6c: ac 01 movw r20, r24 28a6e: 69 2d mov r22, r9 28a70: 7e 2d mov r23, r14 28a72: c8 01 movw r24, r16 28a74: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28a78: 87 ff sbrs r24, 7 28a7a: 03 c0 rjmp .+6 ; 0x28a82 28a7c: 49 2c mov r4, r9 28a7e: 5e 2c mov r5, r14 28a80: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 28a82: 92 01 movw r18, r4 28a84: a3 01 movw r20, r6 28a86: 69 2d mov r22, r9 28a88: 7e 2d mov r23, r14 28a8a: c8 01 movw r24, r16 28a8c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28a90: 88 23 and r24, r24 28a92: 61 f0 breq .+24 ; 0x28aac 28a94: d6 01 movw r26, r12 28a96: d5 96 adiw r26, 0x35 ; 53 28a98: 2c 91 ld r18, X current->entry_speed = entry_speed; 28a9a: c2 01 movw r24, r4 28a9c: d3 01 movw r26, r6 28a9e: f6 01 movw r30, r12 28aa0: 85 a3 std Z+37, r24 ; 0x25 28aa2: 96 a3 std Z+38, r25 ; 0x26 28aa4: a7 a3 std Z+39, r26 ; 0x27 28aa6: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 28aa8: 21 60 ori r18, 0x01 ; 1 28aaa: 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) { 28aac: d5 01 movw r26, r10 28aae: d5 96 adiw r26, 0x35 ; 53 28ab0: 8c 91 ld r24, X 28ab2: d5 97 sbiw r26, 0x35 ; 53 28ab4: f6 01 movw r30, r12 28ab6: 95 a9 ldd r25, Z+53 ; 0x35 28ab8: 89 2b or r24, r25 28aba: 80 ff sbrs r24, 0 28abc: 14 c0 rjmp .+40 ; 0x28ae6 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 28abe: 05 a1 ldd r16, Z+37 ; 0x25 28ac0: 16 a1 ldd r17, Z+38 ; 0x26 28ac2: 27 a1 ldd r18, Z+39 ; 0x27 28ac4: 30 a5 ldd r19, Z+40 ; 0x28 28ac6: 95 96 adiw r26, 0x25 ; 37 28ac8: 4d 91 ld r20, X+ 28aca: 5d 91 ld r21, X+ 28acc: 6d 91 ld r22, X+ 28ace: 7c 91 ld r23, X 28ad0: 98 97 sbiw r26, 0x28 ; 40 28ad2: c5 01 movw r24, r10 28ad4: 0f 94 62 06 call 0x20cc4 ; 0x20cc4 // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 28ad8: d5 01 movw r26, r10 28ada: d5 96 adiw r26, 0x35 ; 53 28adc: 8c 91 ld r24, X 28ade: d5 97 sbiw r26, 0x35 ; 53 28ae0: 8e 7f andi r24, 0xFE ; 254 28ae2: d5 96 adiw r26, 0x35 ; 53 28ae4: 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) 28ae6: f3 94 inc r15 28ae8: b0 e1 ldi r27, 0x10 ; 16 28aea: fb 12 cpse r15, r27 28aec: 01 c0 rjmp .+2 ; 0x28af0 block_index = 0; 28aee: 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)); 28af0: f8 9c mul r15, r8 28af2: c0 01 movw r24, r0 28af4: 11 24 eor r1, r1 28af6: 82 5a subi r24, 0xA2 ; 162 28af8: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 28afa: 20 91 3e 0d lds r18, 0x0D3E ; 0x800d3e // 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; 28afe: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 28b00: f2 12 cpse r15, r18 28b02: 43 c3 rjmp .+1670 ; 0x2918a } // 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); 28b04: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e } // 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) 28b08: 81 11 cpse r24, r1 28b0a: 01 c0 rjmp .+2 ; 0x28b0e block_index = BLOCK_BUFFER_SIZE; 28b0c: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 28b0e: 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); 28b10: ee e6 ldi r30, 0x6E ; 110 28b12: 8e 9f mul r24, r30 28b14: c0 01 movw r24, r0 28b16: 11 24 eor r1, r1 28b18: 9c 01 movw r18, r24 28b1a: 22 5a subi r18, 0xA2 ; 162 28b1c: 39 4f sbci r19, 0xF9 ; 249 28b1e: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 28b20: d9 01 movw r26, r18 28b22: 95 96 adiw r26, 0x25 ; 37 28b24: 4d 91 ld r20, X+ 28b26: 5d 91 ld r21, X+ 28b28: 6d 91 ld r22, X+ 28b2a: 7c 91 ld r23, X 28b2c: 98 97 sbiw r26, 0x28 ; 40 28b2e: 09 a5 ldd r16, Y+41 ; 0x29 28b30: 1d a5 ldd r17, Y+45 ; 0x2d 28b32: 29 ad ldd r18, Y+57 ; 0x39 28b34: 39 a9 ldd r19, Y+49 ; 0x31 28b36: c7 01 movw r24, r14 28b38: 0f 94 62 06 call 0x20cc4 ; 0x20cc4 current->flag &= ~BLOCK_FLAG_RECALCULATE; 28b3c: f7 01 movw r30, r14 28b3e: 85 a9 ldd r24, Z+53 ; 0x35 28b40: 8e 7f andi r24, 0xFE ; 254 28b42: 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(); 28b44: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 28b48: 82 60 ori r24, 0x02 ; 2 28b4a: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 28b4e: 0d 94 23 3b jmp 0x27646 ; 0x27646 // 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)); 28b52: aa 54 subi r26, 0x4A ; 74 28b54: b9 4f sbci r27, 0xF9 ; 249 28b56: 80 e1 ldi r24, 0x10 ; 16 28b58: e1 e6 ldi r30, 0x61 ; 97 28b5a: f2 e1 ldi r31, 0x12 ; 18 28b5c: 0d 94 5e 3b jmp 0x276bc ; 0x276bc 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]); 28b60: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 28b64: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 28b68: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 28b6c: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 28b70: a7 96 adiw r28, 0x27 ; 39 28b72: 6c ad ldd r22, Y+60 ; 0x3c 28b74: 7d ad ldd r23, Y+61 ; 0x3d 28b76: 8e ad ldd r24, Y+62 ; 0x3e 28b78: 9f ad ldd r25, Y+63 ; 0x3f 28b7a: a7 97 sbiw r28, 0x27 ; 39 28b7c: 0d 94 f4 3b jmp 0x277e8 ; 0x277e8 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); 28b80: 81 e0 ldi r24, 0x01 ; 1 28b82: 80 8f std Z+24, r24 ; 0x18 28b84: 0d 94 9a 3d jmp 0x27b34 ; 0x27b34 { if(feed_rate 28b8c: b0 90 a4 0d lds r11, 0x0DA4 ; 0x800da4 28b90: 00 91 a5 0d lds r16, 0x0DA5 ; 0x800da5 28b94: 10 91 a6 0d lds r17, 0x0DA6 ; 0x800da6 28b98: 53 c8 rjmp .-3930 ; 0x27c40 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])); 28b9a: c5 01 movw r24, r10 28b9c: b4 01 movw r22, r8 28b9e: 0f 94 66 9e call 0x33ccc ; 0x33ccc 28ba2: 4b 01 movw r8, r22 28ba4: 5c 01 movw r10, r24 28ba6: c7 01 movw r24, r14 28ba8: b6 01 movw r22, r12 28baa: 0f 94 66 9e call 0x33ccc ; 0x33ccc 28bae: 9b 01 movw r18, r22 28bb0: ac 01 movw r20, r24 28bb2: c5 01 movw r24, r10 28bb4: b4 01 movw r22, r8 28bb6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 28bba: 6b 01 movw r12, r22 28bbc: 7c 01 movw r14, r24 28bbe: 22 96 adiw r28, 0x02 ; 2 28bc0: 6c ad ldd r22, Y+60 ; 0x3c 28bc2: 7d ad ldd r23, Y+61 ; 0x3d 28bc4: 8e ad ldd r24, Y+62 ; 0x3e 28bc6: 9f ad ldd r25, Y+63 ; 0x3f 28bc8: 22 97 sbiw r28, 0x02 ; 2 28bca: 0f 94 66 9e call 0x33ccc ; 0x33ccc 28bce: 9b 01 movw r18, r22 28bd0: ac 01 movw r20, r24 28bd2: c7 01 movw r24, r14 28bd4: b6 01 movw r22, r12 28bd6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 28bda: 0f 94 93 a8 call 0x35126 ; 0x35126 28bde: 2e e6 ldi r18, 0x6E ; 110 28be0: 22 9d mul r18, r2 28be2: f0 01 movw r30, r0 28be4: 23 9d mul r18, r3 28be6: f0 0d add r31, r0 28be8: 11 24 eor r1, r1 28bea: e2 5a subi r30, 0xA2 ; 162 28bec: f9 4f sbci r31, 0xF9 ; 249 28bee: 65 a7 std Z+45, r22 ; 0x2d 28bf0: 76 a7 std Z+46, r23 ; 0x2e 28bf2: 87 a7 std Z+47, r24 ; 0x2f 28bf4: 90 ab std Z+48, r25 ; 0x30 28bf6: c2 c8 rjmp .-3708 ; 0x27d7c 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 28bf8: 2a 96 adiw r28, 0x0a ; 10 28bfa: 2c ad ldd r18, Y+60 ; 0x3c 28bfc: 3d ad ldd r19, Y+61 ; 0x3d 28bfe: 4e ad ldd r20, Y+62 ; 0x3e 28c00: 5f ad ldd r21, Y+63 ; 0x3f 28c02: 2a 97 sbiw r28, 0x0a ; 10 28c04: 23 2b or r18, r19 28c06: 24 2b or r18, r20 28c08: 25 2b or r18, r21 28c0a: 09 f4 brne .+2 ; 0x28c0e 28c0c: 0e c1 rjmp .+540 ; 0x28e2a 28c0e: 60 91 9b 0d lds r22, 0x0D9B ; 0x800d9b 28c12: 70 91 9c 0d lds r23, 0x0D9C ; 0x800d9c 28c16: 80 91 9d 0d lds r24, 0x0D9D ; 0x800d9d 28c1a: 90 91 9e 0d lds r25, 0x0D9E ; 0x800d9e 28c1e: 29 a5 ldd r18, Y+41 ; 0x29 28c20: 3a a5 ldd r19, Y+42 ; 0x2a 28c22: 4b a5 ldd r20, Y+43 ; 0x2b 28c24: 5c a5 ldd r21, Y+44 ; 0x2c 28c26: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28c2a: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 28c2e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 28c32: 2b 01 movw r4, r22 28c34: 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 28c36: 80 91 a7 04 lds r24, 0x04A7 ; 0x8004a7 28c3a: 90 91 a8 04 lds r25, 0x04A8 ; 0x8004a8 28c3e: a0 91 a9 04 lds r26, 0x04A9 ; 0x8004a9 28c42: b0 91 aa 04 lds r27, 0x04AA ; 0x8004aa 28c46: 8d a7 std Y+45, r24 ; 0x2d 28c48: 9e a7 std Y+46, r25 ; 0x2e 28c4a: af a7 std Y+47, r26 ; 0x2f 28c4c: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 28c4e: 20 e0 ldi r18, 0x00 ; 0 28c50: 30 e0 ldi r19, 0x00 ; 0 28c52: a9 01 movw r20, r18 28c54: bc 01 movw r22, r24 28c56: cd 01 movw r24, r26 28c58: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28c5c: 18 16 cp r1, r24 28c5e: 0c f0 brlt .+2 ; 0x28c62 28c60: ed c0 rjmp .+474 ; 0x28e3c * 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 28c62: 20 e0 ldi r18, 0x00 ; 0 28c64: 30 e0 ldi r19, 0x00 ; 0 28c66: a9 01 movw r20, r18 28c68: 26 96 adiw r28, 0x06 ; 6 28c6a: 6c ad ldd r22, Y+60 ; 0x3c 28c6c: 7d ad ldd r23, Y+61 ; 0x3d 28c6e: 8e ad ldd r24, Y+62 ; 0x3e 28c70: 9f ad ldd r25, Y+63 ; 0x3f 28c72: 26 97 sbiw r28, 0x06 ; 6 28c74: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28c78: 87 fd sbrc r24, 7 28c7a: e0 c0 rjmp .+448 ; 0x28e3c && fabs(delta_mm[Z_AXIS]) < 0.5; 28c7c: 22 96 adiw r28, 0x02 ; 2 28c7e: 6c ad ldd r22, Y+60 ; 0x3c 28c80: 7d ad ldd r23, Y+61 ; 0x3d 28c82: 8e ad ldd r24, Y+62 ; 0x3e 28c84: 9f ad ldd r25, Y+63 ; 0x3f 28c86: 22 97 sbiw r28, 0x02 ; 2 28c88: 9f 77 andi r25, 0x7F ; 127 28c8a: 20 e0 ldi r18, 0x00 ; 0 28c8c: 30 e0 ldi r19, 0x00 ; 0 28c8e: 40 e0 ldi r20, 0x00 ; 0 28c90: 5f e3 ldi r21, 0x3F ; 63 28c92: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28c96: 87 ff sbrs r24, 7 28c98: d1 c0 rjmp .+418 ; 0x28e3c * * 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 28c9a: 8e e6 ldi r24, 0x6E ; 110 28c9c: 82 9d mul r24, r2 28c9e: 80 01 movw r16, r0 28ca0: 83 9d mul r24, r3 28ca2: 10 0d add r17, r0 28ca4: 11 24 eor r1, r1 28ca6: 06 55 subi r16, 0x56 ; 86 28ca8: 19 4f sbci r17, 0xF9 ; 249 28caa: 81 e0 ldi r24, 0x01 ; 1 28cac: d8 01 movw r26, r16 28cae: 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]) 28cb0: 20 91 36 04 lds r18, 0x0436 ; 0x800436 28cb4: 30 91 37 04 lds r19, 0x0437 ; 0x800437 28cb8: 40 91 38 04 lds r20, 0x0438 ; 0x800438 28cbc: 50 91 39 04 lds r21, 0x0439 ; 0x800439 28cc0: 69 a1 ldd r22, Y+33 ; 0x21 28cc2: 7a a1 ldd r23, Y+34 ; 0x22 28cc4: 8b a1 ldd r24, Y+35 ; 0x23 28cc6: 9c a1 ldd r25, Y+36 ; 0x24 28cc8: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 28ccc: 69 ab std Y+49, r22 ; 0x31 28cce: 7a ab std Y+50, r23 ; 0x32 28cd0: 8b ab std Y+51, r24 ; 0x33 28cd2: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 28cd4: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 28cd8: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 28cdc: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 28ce0: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 28ce4: 6d a1 ldd r22, Y+37 ; 0x25 28ce6: 7e a1 ldd r23, Y+38 ; 0x26 28ce8: 8f a1 ldd r24, Y+39 ; 0x27 28cea: 98 a5 ldd r25, Y+40 ; 0x28 28cec: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 28cf0: 4b 01 movw r8, r22 28cf2: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 28cf4: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 28cf8: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 28cfc: 40 91 40 04 lds r20, 0x0440 ; 0x800440 28d00: 50 91 41 04 lds r21, 0x0441 ; 0x800441 28d04: a7 96 adiw r28, 0x27 ; 39 28d06: 6c ad ldd r22, Y+60 ; 0x3c 28d08: 7d ad ldd r23, Y+61 ; 0x3d 28d0a: 8e ad ldd r24, Y+62 ; 0x3e 28d0c: 9f ad ldd r25, Y+63 ; 0x3f 28d0e: a7 97 sbiw r28, 0x27 ; 39 28d10: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 28d14: 6b 01 movw r12, r22 28d16: 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]) 28d18: 29 a9 ldd r18, Y+49 ; 0x31 28d1a: 3a a9 ldd r19, Y+50 ; 0x32 28d1c: 4b a9 ldd r20, Y+51 ; 0x33 28d1e: 5c a9 ldd r21, Y+52 ; 0x34 28d20: ca 01 movw r24, r20 28d22: b9 01 movw r22, r18 28d24: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28d28: 69 ab std Y+49, r22 ; 0x31 28d2a: 7a ab std Y+50, r23 ; 0x32 28d2c: 8b ab std Y+51, r24 ; 0x33 28d2e: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 28d30: a5 01 movw r20, r10 28d32: 94 01 movw r18, r8 28d34: c5 01 movw r24, r10 28d36: b4 01 movw r22, r8 28d38: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28d3c: 9b 01 movw r18, r22 28d3e: ac 01 movw r20, r24 28d40: 69 a9 ldd r22, Y+49 ; 0x31 28d42: 7a a9 ldd r23, Y+50 ; 0x32 28d44: 8b a9 ldd r24, Y+51 ; 0x33 28d46: 9c a9 ldd r25, Y+52 ; 0x34 28d48: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 28d4c: 4b 01 movw r8, r22 28d4e: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 28d50: a7 01 movw r20, r14 28d52: 96 01 movw r18, r12 28d54: c7 01 movw r24, r14 28d56: b6 01 movw r22, r12 28d58: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28d5c: 9b 01 movw r18, r22 28d5e: ac 01 movw r20, r24 28d60: c5 01 movw r24, r10 28d62: b4 01 movw r22, r8 28d64: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__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]) 28d68: 0f 94 93 a8 call 0x35126 ; 0x35126 28d6c: 6b 01 movw r12, r22 28d6e: 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]); 28d70: 20 91 42 04 lds r18, 0x0442 ; 0x800442 28d74: 30 91 43 04 lds r19, 0x0443 ; 0x800443 28d78: 40 91 44 04 lds r20, 0x0444 ; 0x800444 28d7c: 50 91 45 04 lds r21, 0x0445 ; 0x800445 28d80: a9 96 adiw r28, 0x29 ; 41 28d82: ee ad ldd r30, Y+62 ; 0x3e 28d84: ff ad ldd r31, Y+63 ; 0x3f 28d86: a9 97 sbiw r28, 0x29 ; 41 28d88: 60 81 ld r22, Z 28d8a: 71 81 ldd r23, Z+1 ; 0x01 28d8c: 82 81 ldd r24, Z+2 ; 0x02 28d8e: 93 81 ldd r25, Z+3 ; 0x03 28d90: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__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; 28d94: a7 01 movw r20, r14 28d96: 96 01 movw r18, r12 28d98: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28d9c: 6a 96 adiw r28, 0x1a ; 26 28d9e: 6c af std Y+60, r22 ; 0x3c 28da0: 7d af std Y+61, r23 ; 0x3d 28da2: 8e af std Y+62, r24 ; 0x3e 28da4: 9f af std Y+63, r25 ; 0x3f 28da6: 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) 28da8: 20 e0 ldi r18, 0x00 ; 0 28daa: 30 e0 ldi r19, 0x00 ; 0 28dac: 40 e4 ldi r20, 0x40 ; 64 28dae: 50 e4 ldi r21, 0x40 ; 64 28db0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28db4: 18 16 cp r1, r24 28db6: 0c f4 brge .+2 ; 0x28dba 28db8: 9e c0 rjmp .+316 ; 0x28ef6 block->use_advance_lead = false; else if (e_D_ratio > 0) { 28dba: 20 e0 ldi r18, 0x00 ; 0 28dbc: 30 e0 ldi r19, 0x00 ; 0 28dbe: a9 01 movw r20, r18 28dc0: 6a 96 adiw r28, 0x1a ; 26 28dc2: 6c ad ldd r22, Y+60 ; 0x3c 28dc4: 7d ad ldd r23, Y+61 ; 0x3d 28dc6: 8e ad ldd r24, Y+62 ; 0x3e 28dc8: 9f ad ldd r25, Y+63 ; 0x3f 28dca: 6a 97 sbiw r28, 0x1a ; 26 28dcc: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28dd0: 18 16 cp r1, r24 28dd2: 0c f0 brlt .+2 ; 0x28dd6 28dd4: 42 c0 rjmp .+132 ; 0x28e5a const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 28dd6: 6a 96 adiw r28, 0x1a ; 26 28dd8: 2c ad ldd r18, Y+60 ; 0x3c 28dda: 3d ad ldd r19, Y+61 ; 0x3d 28ddc: 4e ad ldd r20, Y+62 ; 0x3e 28dde: 5f ad ldd r21, Y+63 ; 0x3f 28de0: 6a 97 sbiw r28, 0x1a ; 26 28de2: 6d a5 ldd r22, Y+45 ; 0x2d 28de4: 7e a5 ldd r23, Y+46 ; 0x2e 28de6: 8f a5 ldd r24, Y+47 ; 0x2f 28de8: 98 a9 ldd r25, Y+48 ; 0x30 28dea: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28dee: 9b 01 movw r18, r22 28df0: ac 01 movw r20, r24 28df2: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 28df6: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 28dfa: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 28dfe: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 28e02: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28e06: 29 a5 ldd r18, Y+41 ; 0x29 28e08: 3a a5 ldd r19, Y+42 ; 0x2a 28e0a: 4b a5 ldd r20, Y+43 ; 0x2b 28e0c: 5c a5 ldd r21, Y+44 ; 0x2c 28e0e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28e12: 0f 94 a3 a5 call 0x34b46 ; 0x34b46 28e16: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 28e1a: 64 15 cp r22, r4 28e1c: 75 05 cpc r23, r5 28e1e: 86 05 cpc r24, r6 28e20: 97 05 cpc r25, r7 28e22: d8 f4 brcc .+54 ; 0x28e5a 28e24: 2b 01 movw r4, r22 28e26: 3c 01 movw r6, r24 28e28: 18 c0 rjmp .+48 ; 0x28e5a 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 28e2a: 60 91 27 0e lds r22, 0x0E27 ; 0x800e27 28e2e: 70 91 28 0e lds r23, 0x0E28 ; 0x800e28 28e32: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 28e36: 90 91 2a 0e lds r25, 0x0E2A ; 0x800e2a 28e3a: f1 ce rjmp .-542 ; 0x28c1e * * 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 28e3c: 8e e6 ldi r24, 0x6E ; 110 28e3e: 82 9d mul r24, r2 28e40: f0 01 movw r30, r0 28e42: 83 9d mul r24, r3 28e44: f0 0d add r31, r0 28e46: 11 24 eor r1, r1 28e48: e6 55 subi r30, 0x56 ; 86 28e4a: f9 4f sbci r31, 0xF9 ; 249 28e4c: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 28e4e: 6a 96 adiw r28, 0x1a ; 26 28e50: 1c ae std Y+60, r1 ; 0x3c 28e52: 1d ae std Y+61, r1 ; 0x3d 28e54: 1e ae std Y+62, r1 ; 0x3e 28e56: 1f ae std Y+63, r1 ; 0x3f 28e58: 6a 97 sbiw r28, 0x1a ; 26 28e5a: 10 e0 ldi r17, 0x00 ; 0 28e5c: 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) 28e5e: a3 96 adiw r28, 0x23 ; 35 28e60: ee ad ldd r30, Y+62 ; 0x3e 28e62: ff ad ldd r31, Y+63 ; 0x3f 28e64: a3 97 sbiw r28, 0x23 ; 35 28e66: e0 0f add r30, r16 28e68: f1 1f adc r31, r17 28e6a: e2 5a subi r30, 0xA2 ; 162 28e6c: f9 4f sbci r31, 0xF9 ; 249 28e6e: c0 80 ld r12, Z 28e70: d1 80 ldd r13, Z+1 ; 0x01 28e72: e2 80 ldd r14, Z+2 ; 0x02 28e74: f3 80 ldd r15, Z+3 ; 0x03 28e76: c1 14 cp r12, r1 28e78: d1 04 cpc r13, r1 28e7a: e1 04 cpc r14, r1 28e7c: f1 04 cpc r15, r1 28e7e: a1 f1 breq .+104 ; 0x28ee8 28e80: f8 01 movw r30, r16 28e82: e5 55 subi r30, 0x55 ; 85 28e84: fb 4f sbci r31, 0xFB ; 251 28e86: 60 81 ld r22, Z 28e88: 71 81 ldd r23, Z+1 ; 0x01 28e8a: 82 81 ldd r24, Z+2 ; 0x02 28e8c: 93 81 ldd r25, Z+3 ; 0x03 28e8e: 64 15 cp r22, r4 28e90: 75 05 cpc r23, r5 28e92: 86 05 cpc r24, r6 28e94: 97 05 cpc r25, r7 28e96: 40 f5 brcc .+80 ; 0x28ee8 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 28e98: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 28e9c: 29 ad ldd r18, Y+57 ; 0x39 28e9e: 3a ad ldd r19, Y+58 ; 0x3a 28ea0: 4b ad ldd r20, Y+59 ; 0x3b 28ea2: 5c ad ldd r21, Y+60 ; 0x3c 28ea4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 28ea8: 4b 01 movw r8, r22 28eaa: 5c 01 movw r10, r24 28eac: c7 01 movw r24, r14 28eae: b6 01 movw r22, r12 28eb0: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 28eb4: 9b 01 movw r18, r22 28eb6: ac 01 movw r20, r24 28eb8: c5 01 movw r24, r10 28eba: b4 01 movw r22, r8 28ebc: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28ec0: 6b 01 movw r12, r22 28ec2: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 28ec4: c3 01 movw r24, r6 28ec6: b2 01 movw r22, r4 28ec8: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 28ecc: 9b 01 movw r18, r22 28ece: ac 01 movw r20, r24 28ed0: c7 01 movw r24, r14 28ed2: b6 01 movw r22, r12 28ed4: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28ed8: 87 ff sbrs r24, 7 28eda: 06 c0 rjmp .+12 ; 0x28ee8 28edc: c7 01 movw r24, r14 28ede: b6 01 movw r22, r12 28ee0: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 28ee4: 2b 01 movw r4, r22 28ee6: 3c 01 movw r6, r24 28ee8: 0c 5f subi r16, 0xFC ; 252 28eea: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 28eec: 00 31 cpi r16, 0x10 ; 16 28eee: 11 05 cpc r17, r1 28ef0: 09 f0 breq .+2 ; 0x28ef4 28ef2: b5 cf rjmp .-150 ; 0x28e5e 28ef4: 01 c9 rjmp .-3582 ; 0x280f8 // 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; 28ef6: d8 01 movw r26, r16 28ef8: 1c 92 st X, r1 28efa: af cf rjmp .-162 ; 0x28e5a if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 28efc: c9 a6 std Y+41, r12 ; 0x29 28efe: dd a6 std Y+45, r13 ; 0x2d 28f00: e9 ae std Y+57, r14 ; 0x39 28f02: f9 aa std Y+49, r15 ; 0x31 limited = true; 28f04: 21 e0 ldi r18, 0x01 ; 1 28f06: 2d ab std Y+53, r18 ; 0x35 28f08: b1 c9 rjmp .-3230 ; 0x2826c // 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); 28f0a: 27 96 adiw r28, 0x07 ; 7 28f0c: 2f ad ldd r18, Y+63 ; 0x3f 28f0e: 27 97 sbiw r28, 0x07 ; 7 28f10: 2b 96 adiw r28, 0x0b ; 11 28f12: 3f ad ldd r19, Y+63 ; 0x3f 28f14: 2b 97 sbiw r28, 0x0b ; 11 28f16: 2f 96 adiw r28, 0x0f ; 15 28f18: 4f ad ldd r20, Y+63 ; 0x3f 28f1a: 2f 97 sbiw r28, 0x0f ; 15 28f1c: 63 96 adiw r28, 0x13 ; 19 28f1e: 5f ad ldd r21, Y+63 ; 0x3f 28f20: 63 97 sbiw r28, 0x13 ; 19 28f22: 6b 96 adiw r28, 0x1b ; 27 28f24: 6f ad ldd r22, Y+63 ; 0x3f 28f26: 6b 97 sbiw r28, 0x1b ; 27 28f28: 6f 96 adiw r28, 0x1f ; 31 28f2a: 7f ad ldd r23, Y+63 ; 0x3f 28f2c: 6f 97 sbiw r28, 0x1f ; 31 28f2e: c8 01 movw r24, r16 28f30: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 28f34: eb 96 adiw r28, 0x3b ; 59 28f36: 6c af std Y+60, r22 ; 0x3c 28f38: 7d af std Y+61, r23 ; 0x3d 28f3a: 8e af std Y+62, r24 ; 0x3e 28f3c: 9f af std Y+63, r25 ; 0x3f 28f3e: eb 97 sbiw r28, 0x3b ; 59 // 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; 28f40: 6b 96 adiw r28, 0x1b ; 27 28f42: ef ad ldd r30, Y+63 ; 0x3f 28f44: 6b 97 sbiw r28, 0x1b ; 27 28f46: ed af std Y+61, r30 ; 0x3d 28f48: 6f 96 adiw r28, 0x1f ; 31 28f4a: ff ad ldd r31, Y+63 ; 0x3f 28f4c: 6f 97 sbiw r28, 0x1f ; 31 28f4e: fd ab std Y+53, r31 ; 0x35 28f50: 0e af std Y+62, r16 ; 0x3e 28f52: 23 96 adiw r28, 0x03 ; 3 28f54: 1f af std Y+63, r17 ; 0x3f 28f56: 23 97 sbiw r28, 0x03 ; 3 28f58: 04 ca rjmp .-3064 ; 0x28362 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 28f5a: f7 fa bst r15, 7 28f5c: f0 94 com r15 28f5e: f7 f8 bld r15, 7 28f60: f0 94 com r15 28f62: a5 01 movw r20, r10 28f64: 94 01 movw r18, r8 28f66: c7 01 movw r24, r14 28f68: b6 01 movw r22, r12 28f6a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28f6e: 87 ff sbrs r24, 7 28f70: 77 ca rjmp .-2834 ; 0x28460 // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 28f72: 75 01 movw r14, r10 28f74: 64 01 movw r12, r8 28f76: 74 ca rjmp .-2840 ; 0x28460 // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 28f78: c7 01 movw r24, r14 28f7a: b6 01 movw r22, r12 28f7c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 28f80: 87 fd sbrc r24, 7 28f82: 09 c0 rjmp .+18 ; 0x28f96 28f84: 20 e0 ldi r18, 0x00 ; 0 28f86: 30 e0 ldi r19, 0x00 ; 0 28f88: a9 01 movw r20, r18 28f8a: c5 01 movw r24, r10 28f8c: b4 01 movw r22, r8 28f8e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28f92: 18 16 cp r1, r24 28f94: 2c f4 brge .+10 ; 0x28fa0 28f96: a5 01 movw r20, r10 28f98: 94 01 movw r18, r8 28f9a: c7 01 movw r24, r14 28f9c: b6 01 movw r22, r12 28f9e: 5c ca rjmp .-2888 ; 0x28458 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 28fa0: b7 fa bst r11, 7 28fa2: b0 94 com r11 28fa4: b7 f8 bld r11, 7 28fa6: b0 94 com r11 28fa8: a7 01 movw r20, r14 28faa: 96 01 movw r18, r12 28fac: c5 01 movw r24, r10 28fae: b4 01 movw r22, r8 28fb0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 28fb4: 18 16 cp r1, r24 28fb6: 0c f0 brlt .+2 ; 0x28fba 28fb8: 53 ca rjmp .-2906 ; 0x28460 28fba: db cf rjmp .-74 ; 0x28f72 // 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; 28fbc: 8e e6 ldi r24, 0x6E ; 110 28fbe: 82 9d mul r24, r2 28fc0: f0 01 movw r30, r0 28fc2: 83 9d mul r24, r3 28fc4: f0 0d add r31, r0 28fc6: 11 24 eor r1, r1 28fc8: e2 5a subi r30, 0xA2 ; 162 28fca: f9 4f sbci r31, 0xF9 ; 249 28fcc: 85 a9 ldd r24, Z+53 ; 0x35 28fce: 84 60 ori r24, 0x04 ; 4 28fd0: 85 ab std Z+53, r24 ; 0x35 28fd2: a9 a5 ldd r26, Y+41 ; 0x29 28fd4: ad af std Y+61, r26 ; 0x3d 28fd6: bd a5 ldd r27, Y+45 ; 0x2d 28fd8: bd ab std Y+53, r27 ; 0x35 28fda: e9 ad ldd r30, Y+57 ; 0x39 28fdc: ee af std Y+62, r30 ; 0x3e 28fde: f9 a9 ldd r31, Y+49 ; 0x31 28fe0: 23 96 adiw r28, 0x03 ; 3 28fe2: ff af std Y+63, r31 ; 0x3f 28fe4: 23 97 sbiw r28, 0x03 ; 3 28fe6: bc ca rjmp .-2696 ; 0x28560 // 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; 28fe8: 81 e0 ldi r24, 0x01 ; 1 28fea: 30 cb rjmp .-2464 ; 0x2864c 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]; 28fec: 20 91 bb 0d lds r18, 0x0DBB ; 0x800dbb 28ff0: 30 91 bc 0d lds r19, 0x0DBC ; 0x800dbc 28ff4: 40 91 bd 0d lds r20, 0x0DBD ; 0x800dbd 28ff8: 50 91 be 0d lds r21, 0x0DBE ; 0x800dbe 28ffc: c7 01 movw r24, r14 28ffe: b6 01 movw r22, r12 29000: c1 cb rjmp .-2174 ; 0x28784 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) { 29002: 20 e0 ldi r18, 0x00 ; 0 29004: 30 e4 ldi r19, 0x40 ; 64 29006: 4c e1 ldi r20, 0x1C ; 28 29008: 56 e4 ldi r21, 0x46 ; 70 2900a: c7 01 movw r24, r14 2900c: b6 01 movw r22, r12 2900e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 29012: 18 16 cp r1, r24 29014: d4 f4 brge .+52 ; 0x2904a block->advance_rate = advance_rate * 2; 29016: 8e e6 ldi r24, 0x6E ; 110 29018: 82 9d mul r24, r2 2901a: 80 01 movw r16, r0 2901c: 83 9d mul r24, r3 2901e: 10 0d add r17, r0 29020: 11 24 eor r1, r1 29022: 02 5a subi r16, 0xA2 ; 162 29024: 19 4f sbci r17, 0xF9 ; 249 29026: 78 01 movw r14, r16 29028: bd e4 ldi r27, 0x4D ; 77 2902a: eb 0e add r14, r27 2902c: f1 1c adc r15, r1 2902e: a5 01 movw r20, r10 29030: 94 01 movw r18, r8 29032: c5 01 movw r24, r10 29034: b4 01 movw r22, r8 29036: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2903a: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 2903e: f7 01 movw r30, r14 29040: 71 83 std Z+1, r23 ; 0x01 29042: 60 83 st Z, r22 block->advance_step_loops = 2; 29044: 36 96 adiw r30, 0x06 ; 6 29046: 82 e0 ldi r24, 0x02 ; 2 29048: e2 cb rjmp .-2108 ; 0x2880e } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 2904a: 20 e0 ldi r18, 0x00 ; 0 2904c: 3f ef ldi r19, 0xFF ; 255 2904e: 4f e7 ldi r20, 0x7F ; 127 29050: 57 e4 ldi r21, 0x47 ; 71 29052: c5 01 movw r24, r10 29054: b4 01 movw r22, r8 29056: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2905a: 87 ff sbrs r24, 7 2905c: 19 c0 rjmp .+50 ; 0x29090 block->advance_rate = advance_rate; 2905e: 8e e6 ldi r24, 0x6E ; 110 29060: 82 9d mul r24, r2 29062: 80 01 movw r16, r0 29064: 83 9d mul r24, r3 29066: 10 0d add r17, r0 29068: 11 24 eor r1, r1 2906a: 05 55 subi r16, 0x55 ; 85 2906c: 19 4f sbci r17, 0xF9 ; 249 2906e: c5 01 movw r24, r10 29070: b4 01 movw r22, r8 29072: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 29076: d8 01 movw r26, r16 29078: 6d 93 st X+, r22 2907a: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 2907c: 8e e6 ldi r24, 0x6E ; 110 2907e: 82 9d mul r24, r2 29080: f0 01 movw r30, r0 29082: 83 9d mul r24, r3 29084: f0 0d add r31, r0 29086: 11 24 eor r1, r1 29088: ef 54 subi r30, 0x4F ; 79 2908a: f9 4f sbci r31, 0xF9 ; 249 2908c: 81 e0 ldi r24, 0x01 ; 1 2908e: bf cb rjmp .-2178 ; 0x2880e { // 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; 29090: 8e e6 ldi r24, 0x6E ; 110 29092: 82 9d mul r24, r2 29094: f0 01 movw r30, r0 29096: 83 9d mul r24, r3 29098: f0 0d add r31, r0 2909a: 11 24 eor r1, r1 2909c: e5 55 subi r30, 0x55 ; 85 2909e: f9 4f sbci r31, 0xF9 ; 249 290a0: 8f ef ldi r24, 0xFF ; 255 290a2: 9f ef ldi r25, 0xFF ; 255 290a4: 91 83 std Z+1, r25 ; 0x01 290a6: 80 83 st Z, r24 290a8: e9 cf rjmp .-46 ; 0x2907c 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) { 290aa: f6 01 movw r30, r12 290ac: 71 a4 ldd r7, Z+41 ; 0x29 290ae: 82 a4 ldd r8, Z+42 ; 0x2a 290b0: 93 a4 ldd r9, Z+43 ; 0x2b 290b2: e4 a4 ldd r14, Z+44 ; 0x2c 290b4: 27 2d mov r18, r7 290b6: 38 2d mov r19, r8 290b8: 49 2d mov r20, r9 290ba: 5e 2d mov r21, r14 290bc: 65 a1 ldd r22, Z+37 ; 0x25 290be: 76 a1 ldd r23, Z+38 ; 0x26 290c0: 87 a1 ldd r24, Z+39 ; 0x27 290c2: 90 a5 ldd r25, Z+40 ; 0x28 290c4: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 290c8: 88 23 and r24, r24 290ca: 09 f4 brne .+2 ; 0x290ce 290cc: 51 c0 rjmp .+162 ; 0x29170 // 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) ? 290ce: 01 fd sbrc r16, 1 290d0: 44 c0 rjmp .+136 ; 0x2915a 290d2: d5 01 movw r26, r10 290d4: 95 96 adiw r26, 0x25 ; 37 290d6: 2d 90 ld r2, X+ 290d8: 3d 90 ld r3, X+ 290da: 4d 90 ld r4, X+ 290dc: 5c 90 ld r5, X 290de: 98 97 sbiw r26, 0x28 ; 40 290e0: a2 01 movw r20, r4 290e2: 91 01 movw r18, r2 290e4: 67 2d mov r22, r7 290e6: 78 2d mov r23, r8 290e8: 89 2d mov r24, r9 290ea: 9e 2d mov r25, r14 290ec: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 290f0: 18 16 cp r1, r24 290f2: 9c f5 brge .+102 ; 0x2915a // 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); 290f4: a2 01 movw r20, r4 290f6: 91 01 movw r18, r2 290f8: c2 01 movw r24, r4 290fa: b1 01 movw r22, r2 290fc: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 29100: 1b 01 movw r2, r22 29102: 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)); 29104: f6 01 movw r30, r12 29106: 61 a9 ldd r22, Z+49 ; 0x31 29108: 72 a9 ldd r23, Z+50 ; 0x32 2910a: 83 a9 ldd r24, Z+51 ; 0x33 2910c: 94 a9 ldd r25, Z+52 ; 0x34 2910e: 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); 29110: 9b 01 movw r18, r22 29112: ac 01 movw r20, r24 29114: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 29118: d6 01 movw r26, r12 2911a: 9d 96 adiw r26, 0x2d ; 45 2911c: 2d 91 ld r18, X+ 2911e: 3d 91 ld r19, X+ 29120: 4d 91 ld r20, X+ 29122: 5c 91 ld r21, X 29124: d0 97 sbiw r26, 0x30 ; 48 29126: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2912a: 9b 01 movw r18, r22 2912c: ac 01 movw r20, r24 2912e: c2 01 movw r24, r4 29130: b1 01 movw r22, r2 29132: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 29136: 0f 94 93 a8 call 0x35126 ; 0x35126 2913a: 2b 01 movw r4, r22 2913c: 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)); 2913e: 9b 01 movw r18, r22 29140: ac 01 movw r20, r24 29142: 67 2d mov r22, r7 29144: 78 2d mov r23, r8 29146: 89 2d mov r24, r9 29148: 9e 2d mov r25, r14 2914a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2914e: 87 fd sbrc r24, 7 29150: 04 c0 rjmp .+8 ; 0x2915a 29152: 74 2c mov r7, r4 29154: 85 2c mov r8, r5 29156: 9a 2c mov r9, r10 29158: 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) ? 2915a: 87 2d mov r24, r7 2915c: 98 2d mov r25, r8 2915e: a9 2d mov r26, r9 29160: be 2d mov r27, r14 29162: f6 01 movw r30, r12 29164: 85 a3 std Z+37, r24 ; 0x25 29166: 96 a3 std Z+38, r25 ; 0x26 29168: a7 a3 std Z+39, r26 ; 0x27 2916a: 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; 2916c: 01 60 ori r16, 0x01 ; 1 2916e: 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) 29170: 11 11 cpse r17, r1 29172: 01 c0 rjmp .+2 ; 0x29176 block_index = BLOCK_BUFFER_SIZE; 29174: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 29176: 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)); 29178: 16 9d mul r17, r6 2917a: c0 01 movw r24, r0 2917c: 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; 2917e: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 29180: 9c 01 movw r18, r24 29182: 22 5a subi r18, 0xA2 ; 162 29184: 39 4f sbci r19, 0xF9 ; 249 29186: 69 01 movw r12, r18 29188: 0b cc rjmp .-2026 ; 0x289a0 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)); 2918a: 6c 01 movw r12, r24 2918c: 2f cc rjmp .-1954 ; 0x289ec 2918e: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 29190: 0d 94 23 3b jmp 0x27646 ; 0x27646 00029194 : 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(){ 29194: 4f 92 push r4 29196: 5f 92 push r5 29198: 6f 92 push r6 2919a: 7f 92 push r7 2919c: 8f 92 push r8 2919e: 9f 92 push r9 291a0: af 92 push r10 291a2: bf 92 push r11 291a4: cf 92 push r12 291a6: df 92 push r13 291a8: ef 92 push r14 291aa: ff 92 push r15 291ac: cf 93 push r28 291ae: df 93 push r29 291b0: cd b7 in r28, 0x3d ; 61 291b2: de b7 in r29, 0x3e ; 62 291b4: 2c 97 sbiw r28, 0x0c ; 12 291b6: 0f b6 in r0, 0x3f ; 63 291b8: f8 94 cli 291ba: de bf out 0x3e, r29 ; 62 291bc: 0f be out 0x3f, r0 ; 63 291be: 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]); 291c0: c0 90 69 12 lds r12, 0x1269 ; 0x801269 291c4: d0 90 6a 12 lds r13, 0x126A ; 0x80126a 291c8: e0 90 6b 12 lds r14, 0x126B ; 0x80126b 291cc: f0 90 6c 12 lds r15, 0x126C ; 0x80126c 291d0: 80 91 65 12 lds r24, 0x1265 ; 0x801265 291d4: 90 91 66 12 lds r25, 0x1266 ; 0x801266 291d8: a0 91 67 12 lds r26, 0x1267 ; 0x801267 291dc: b0 91 68 12 lds r27, 0x1268 ; 0x801268 291e0: 40 91 61 12 lds r20, 0x1261 ; 0x801261 291e4: 50 91 62 12 lds r21, 0x1262 ; 0x801262 291e8: 60 91 63 12 lds r22, 0x1263 ; 0x801263 291ec: 70 91 64 12 lds r23, 0x1264 ; 0x801264 291f0: 4d 83 std Y+5, r20 ; 0x05 291f2: 5e 83 std Y+6, r21 ; 0x06 291f4: 6f 83 std Y+7, r22 ; 0x07 291f6: 78 87 std Y+8, r23 ; 0x08 291f8: 89 83 std Y+1, r24 ; 0x01 291fa: 9a 83 std Y+2, r25 ; 0x02 291fc: ab 83 std Y+3, r26 ; 0x03 291fe: 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); 29200: be 01 movw r22, r28 29202: 6f 5f subi r22, 0xFF ; 255 29204: 7f 4f sbci r23, 0xFF ; 255 29206: ce 01 movw r24, r28 29208: 05 96 adiw r24, 0x05 ; 5 2920a: 0e 94 46 68 call 0xd08c ; 0xd08c position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 2920e: 4d 80 ldd r4, Y+5 ; 0x05 29210: 5e 80 ldd r5, Y+6 ; 0x06 29212: 6f 80 ldd r6, Y+7 ; 0x07 29214: 78 84 ldd r7, Y+8 ; 0x08 29216: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 2921a: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 2921e: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 29222: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 29226: c3 01 movw r24, r6 29228: b2 01 movw r22, r4 2922a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2922e: 0f 94 02 a8 call 0x35004 ; 0x35004 29232: 60 93 3c 06 sts 0x063C, r22 ; 0x80063c 29236: 70 93 3d 06 sts 0x063D, r23 ; 0x80063d 2923a: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 2923e: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 29242: 89 80 ldd r8, Y+1 ; 0x01 29244: 9a 80 ldd r9, Y+2 ; 0x02 29246: ab 80 ldd r10, Y+3 ; 0x03 29248: bc 80 ldd r11, Y+4 ; 0x04 2924a: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 2924e: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 29252: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 29256: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 2925a: c5 01 movw r24, r10 2925c: b4 01 movw r22, r8 2925e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 29262: 0f 94 02 a8 call 0x35004 ; 0x35004 29266: 60 93 40 06 sts 0x0640, r22 ; 0x800640 2926a: 70 93 41 06 sts 0x0641, r23 ; 0x800641 2926e: 80 93 42 06 sts 0x0642, r24 ; 0x800642 29272: 90 93 43 06 sts 0x0643, r25 ; 0x800643 #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 29276: 80 91 09 13 lds r24, 0x1309 ; 0x801309 2927a: 88 23 and r24, r24 2927c: 09 f4 brne .+2 ; 0x29280 2927e: 8c c0 rjmp .+280 ; 0x29398 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 29280: a5 01 movw r20, r10 29282: 94 01 movw r18, r8 29284: c3 01 movw r24, r6 29286: b2 01 movw r22, r4 29288: 0f 94 35 91 call 0x3226a ; 0x3226a 2928c: 9b 01 movw r18, r22 2928e: ac 01 movw r20, r24 29290: c7 01 movw r24, r14 29292: b6 01 movw r22, r12 29294: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 29298: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 2929c: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 292a0: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 292a4: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 lround(z*cs.axis_steps_per_mm[Z_AXIS]); 292a8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__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 ? 292ac: 0f 94 02 a8 call 0x35004 ; 0x35004 292b0: 60 93 44 06 sts 0x0644, r22 ; 0x800644 292b4: 70 93 45 06 sts 0x0645, r23 ; 0x800645 292b8: 80 93 46 06 sts 0x0646, r24 ; 0x800646 292bc: 90 93 47 06 sts 0x0647, r25 ; 0x800647 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]); 292c0: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 292c4: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 292c8: a0 91 6f 12 lds r26, 0x126F ; 0x80126f 292cc: b0 91 70 12 lds r27, 0x1270 ; 0x801270 292d0: 89 87 std Y+9, r24 ; 0x09 292d2: 9a 87 std Y+10, r25 ; 0x0a 292d4: ab 87 std Y+11, r26 ; 0x0b 292d6: bc 87 std Y+12, r27 ; 0x0c 292d8: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 292dc: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 292e0: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 292e4: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 292e8: bc 01 movw r22, r24 292ea: cd 01 movw r24, r26 292ec: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 292f0: 0f 94 02 a8 call 0x35004 ; 0x35004 292f4: 60 93 48 06 sts 0x0648, r22 ; 0x800648 292f8: 70 93 49 06 sts 0x0649, r23 ; 0x800649 292fc: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a 29300: 90 93 4b 06 sts 0x064B, r25 ; 0x80064b #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 29304: 40 92 36 04 sts 0x0436, r4 ; 0x800436 29308: 50 92 37 04 sts 0x0437, r5 ; 0x800437 2930c: 60 92 38 04 sts 0x0438, r6 ; 0x800438 29310: 70 92 39 04 sts 0x0439, r7 ; 0x800439 position_float[Y_AXIS] = y; 29314: 80 92 3a 04 sts 0x043A, r8 ; 0x80043a 29318: 90 92 3b 04 sts 0x043B, r9 ; 0x80043b 2931c: a0 92 3c 04 sts 0x043C, r10 ; 0x80043c 29320: b0 92 3d 04 sts 0x043D, r11 ; 0x80043d position_float[Z_AXIS] = z; 29324: c0 92 3e 04 sts 0x043E, r12 ; 0x80043e 29328: d0 92 3f 04 sts 0x043F, r13 ; 0x80043f 2932c: e0 92 40 04 sts 0x0440, r14 ; 0x800440 29330: f0 92 41 04 sts 0x0441, r15 ; 0x800441 position_float[E_AXIS] = e; 29334: 89 85 ldd r24, Y+9 ; 0x09 29336: 9a 85 ldd r25, Y+10 ; 0x0a 29338: ab 85 ldd r26, Y+11 ; 0x0b 2933a: bc 85 ldd r27, Y+12 ; 0x0c 2933c: 80 93 42 04 sts 0x0442, r24 ; 0x800442 29340: 90 93 43 04 sts 0x0443, r25 ; 0x800443 29344: a0 93 44 04 sts 0x0444, r26 ; 0x800444 29348: b0 93 45 04 sts 0x0445, r27 ; 0x800445 #endif st_set_position(position); 2934c: 0f 94 22 79 call 0x2f244 ; 0x2f244 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 29350: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.446> 29354: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.446+0x1> 29358: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.446+0x2> 2935c: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.446+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 29360: e6 e2 ldi r30, 0x26 ; 38 29362: f4 e0 ldi r31, 0x04 ; 4 29364: 80 e1 ldi r24, 0x10 ; 16 29366: df 01 movw r26, r30 29368: 1d 92 st X+, r1 2936a: 8a 95 dec r24 2936c: e9 f7 brne .-6 ; 0x29368 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]); } 2936e: 2c 96 adiw r28, 0x0c ; 12 29370: 0f b6 in r0, 0x3f ; 63 29372: f8 94 cli 29374: de bf out 0x3e, r29 ; 62 29376: 0f be out 0x3f, r0 ; 63 29378: cd bf out 0x3d, r28 ; 61 2937a: df 91 pop r29 2937c: cf 91 pop r28 2937e: ff 90 pop r15 29380: ef 90 pop r14 29382: df 90 pop r13 29384: cf 90 pop r12 29386: bf 90 pop r11 29388: af 90 pop r10 2938a: 9f 90 pop r9 2938c: 8f 90 pop r8 2938e: 7f 90 pop r7 29390: 6f 90 pop r6 29392: 5f 90 pop r5 29394: 4f 90 pop r4 29396: 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]); 29398: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 2939c: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 293a0: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 293a4: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 293a8: c7 01 movw r24, r14 293aa: b6 01 movw r22, r12 293ac: 7d cf rjmp .-262 ; 0x292a8 000293ae : 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) { 293ae: 8f 92 push r8 293b0: 9f 92 push r9 293b2: af 92 push r10 293b4: bf 92 push r11 293b6: cf 92 push r12 293b8: df 92 push r13 293ba: ef 92 push r14 293bc: ff 92 push r15 293be: 0f 93 push r16 293c0: 1f 93 push r17 293c2: 4b 01 movw r8, r22 293c4: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 293c6: e9 e2 ldi r30, 0x29 ; 41 293c8: f6 e0 ldi r31, 0x06 ; 6 293ca: e0 84 ldd r14, Z+8 ; 0x08 293cc: f1 84 ldd r15, Z+9 ; 0x09 293ce: 02 85 ldd r16, Z+10 ; 0x0a 293d0: 13 85 ldd r17, Z+11 ; 0x0b 293d2: 24 81 ldd r18, Z+4 ; 0x04 293d4: 35 81 ldd r19, Z+5 ; 0x05 293d6: 46 81 ldd r20, Z+6 ; 0x06 293d8: 57 81 ldd r21, Z+7 ; 0x07 293da: 60 81 ld r22, Z 293dc: 71 81 ldd r23, Z+1 ; 0x01 293de: 82 81 ldd r24, Z+2 ; 0x02 293e0: 93 81 ldd r25, Z+3 ; 0x03 293e2: 1f 92 push r1 293e4: 1f 92 push r1 293e6: 1f 92 push r1 293e8: 1f 92 push r1 293ea: e5 e3 ldi r30, 0x35 ; 53 293ec: ce 2e mov r12, r30 293ee: e6 e0 ldi r30, 0x06 ; 6 293f0: de 2e mov r13, r30 293f2: 0f 94 bc 3a call 0x27578 ; 0x27578 293f6: 0f 90 pop r0 293f8: 0f 90 pop r0 293fa: 0f 90 pop r0 293fc: 0f 90 pop r0 } 293fe: 1f 91 pop r17 29400: 0f 91 pop r16 29402: ff 90 pop r15 29404: ef 90 pop r14 29406: df 90 pop r13 29408: cf 90 pop r12 2940a: bf 90 pop r11 2940c: af 90 pop r10 2940e: 9f 90 pop r9 29410: 8f 90 pop r8 29412: 08 95 ret 00029414 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 29414: 8f 92 push r8 29416: 9f 92 push r9 29418: af 92 push r10 2941a: bf 92 push r11 2941c: cf 92 push r12 2941e: df 92 push r13 29420: ef 92 push r14 29422: ff 92 push r15 29424: 0f 93 push r16 29426: 1f 93 push r17 29428: 4b 01 movw r8, r22 2942a: 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); 2942c: e1 e6 ldi r30, 0x61 ; 97 2942e: f2 e1 ldi r31, 0x12 ; 18 29430: e0 84 ldd r14, Z+8 ; 0x08 29432: f1 84 ldd r15, Z+9 ; 0x09 29434: 02 85 ldd r16, Z+10 ; 0x0a 29436: 13 85 ldd r17, Z+11 ; 0x0b 29438: 24 81 ldd r18, Z+4 ; 0x04 2943a: 35 81 ldd r19, Z+5 ; 0x05 2943c: 46 81 ldd r20, Z+6 ; 0x06 2943e: 57 81 ldd r21, Z+7 ; 0x07 29440: 60 81 ld r22, Z 29442: 71 81 ldd r23, Z+1 ; 0x01 29444: 82 81 ldd r24, Z+2 ; 0x02 29446: 93 81 ldd r25, Z+3 ; 0x03 29448: 1f 92 push r1 2944a: 1f 92 push r1 2944c: 1f 92 push r1 2944e: 1f 92 push r1 29450: ed e6 ldi r30, 0x6D ; 109 29452: ce 2e mov r12, r30 29454: e2 e1 ldi r30, 0x12 ; 18 29456: de 2e mov r13, r30 29458: 0f 94 bc 3a call 0x27578 ; 0x27578 2945c: 0f 90 pop r0 2945e: 0f 90 pop r0 29460: 0f 90 pop r0 29462: 0f 90 pop r0 } 29464: 1f 91 pop r17 29466: 0f 91 pop r16 29468: ff 90 pop r15 2946a: ef 90 pop r14 2946c: df 90 pop r13 2946e: cf 90 pop r12 29470: bf 90 pop r11 29472: af 90 pop r10 29474: 9f 90 pop r9 29476: 8f 90 pop r8 29478: 08 95 ret 0002947a <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 2947a: 2f 92 push r2 2947c: 3f 92 push r3 2947e: 4f 92 push r4 29480: 5f 92 push r5 29482: 6f 92 push r6 29484: 7f 92 push r7 29486: 9f 92 push r9 29488: af 92 push r10 2948a: bf 92 push r11 2948c: cf 92 push r12 2948e: df 92 push r13 29490: ef 92 push r14 29492: ff 92 push r15 29494: 0f 93 push r16 29496: 1f 93 push r17 29498: cf 93 push r28 2949a: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 2949c: 70 91 71 12 lds r23, 0x1271 ; 0x801271 294a0: 71 11 cpse r23, r1 294a2: 04 c0 rjmp .+8 ; 0x294ac <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x32> 294a4: 70 91 72 12 lds r23, 0x1272 ; 0x801272 294a8: 77 23 and r23, r23 294aa: 99 f0 breq .+38 ; 0x294d2 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+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(); } 294ac: df 91 pop r29 294ae: cf 91 pop r28 294b0: 1f 91 pop r17 294b2: 0f 91 pop r16 294b4: ff 90 pop r15 294b6: ef 90 pop r14 294b8: df 90 pop r13 294ba: cf 90 pop r12 294bc: bf 90 pop r11 294be: af 90 pop r10 294c0: 9f 90 pop r9 294c2: 7f 90 pop r7 294c4: 6f 90 pop r6 294c6: 5f 90 pop r5 294c8: 4f 90 pop r4 294ca: 3f 90 pop r3 294cc: 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(); 294ce: 0c 94 eb 62 jmp 0xc5d6 ; 0xc5d6 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) 294d2: 70 91 96 03 lds r23, 0x0396 ; 0x800396 294d6: 71 11 cpse r23, r1 294d8: 09 c0 rjmp .+18 ; 0x294ec <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 294da: 70 91 77 02 lds r23, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.388> check_endstops = check; 294de: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> { _md->endstopsEnabledPrevious = enable_endstops(false); 294e2: 70 93 97 03 sts 0x0397, r23 ; 0x800397 _md->initialized = true; 294e6: 71 e0 ldi r23, 0x01 ; 1 294e8: 70 93 96 03 sts 0x0396, r23 ; 0x800396 294ec: 19 01 movw r2, r18 294ee: 6a 01 movw r12, r20 294f0: c6 2f mov r28, r22 294f2: d9 2f mov r29, r25 294f4: 98 2e mov r9, r24 } if (lcd_encoder != 0) 294f6: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 294fa: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 294fe: 89 2b or r24, r25 29500: 09 f4 brne .+2 ; 0x29504 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x8a> 29502: 71 c0 rjmp .+226 ; 0x295e6 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x16c> { refresh_cmd_timeout(); 29504: 0e 94 11 65 call 0xca22 ; 0xca22 } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 29508: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 2950c: 8f 5f subi r24, 0xFF ; 255 2950e: 80 31 cpi r24, 0x10 ; 16 29510: 09 f4 brne .+2 ; 0x29514 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x9a> next_block_index = 0; 29512: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 29514: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) 29518: 98 17 cp r25, r24 2951a: 09 f4 brne .+2 ; 0x2951e <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0xa4> 2951c: 64 c0 rjmp .+200 ; 0x295e6 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x16c> { current_position[axis] += lcd_encoder; 2951e: 84 e0 ldi r24, 0x04 ; 4 29520: c8 9f mul r28, r24 29522: 80 01 movw r16, r0 29524: 11 24 eor r1, r1 29526: f8 01 movw r30, r16 29528: ef 59 subi r30, 0x9F ; 159 2952a: fd 4e sbci r31, 0xED ; 237 2952c: 5f 01 movw r10, r30 2952e: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 29532: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 29536: 07 2e mov r0, r23 29538: 00 0c add r0, r0 2953a: 88 0b sbc r24, r24 2953c: 99 0b sbc r25, r25 2953e: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 29542: f5 01 movw r30, r10 29544: 20 81 ld r18, Z 29546: 31 81 ldd r19, Z+1 ; 0x01 29548: 42 81 ldd r20, Z+2 ; 0x02 2954a: 53 81 ldd r21, Z+3 ; 0x03 2954c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 29550: 2b 01 movw r4, r22 29552: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 29554: b6 01 movw r22, r12 29556: dd 0c add r13, r13 29558: 88 0b sbc r24, r24 2955a: 99 0b sbc r25, r25 2955c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 29560: 6b 01 movw r12, r22 29562: 7c 01 movw r14, r24 29564: ac 01 movw r20, r24 29566: 9b 01 movw r18, r22 29568: c3 01 movw r24, r6 2956a: b2 01 movw r22, r4 2956c: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 29570: f5 01 movw r30, r10 29572: 87 fd sbrc r24, 7 29574: 7d c0 rjmp .+250 ; 0x29670 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x1f6> if (lcd_encoder != 0) { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; 29576: 40 82 st Z, r4 29578: 51 82 std Z+1, r5 ; 0x01 2957a: 62 82 std Z+2, r6 ; 0x02 2957c: 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; 2957e: b1 01 movw r22, r2 29580: 33 0c add r3, r3 29582: 88 0b sbc r24, r24 29584: 99 0b sbc r25, r25 29586: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2958a: 2b 01 movw r4, r22 2958c: 3c 01 movw r6, r24 2958e: c8 01 movw r24, r16 29590: 8f 59 subi r24, 0x9F ; 159 29592: 9d 4e sbci r25, 0xED ; 237 29594: 7c 01 movw r14, r24 29596: a3 01 movw r20, r6 29598: 92 01 movw r18, r4 2959a: fc 01 movw r30, r24 2959c: 60 81 ld r22, Z 2959e: 71 81 ldd r23, Z+1 ; 0x01 295a0: 82 81 ldd r24, Z+2 ; 0x02 295a2: 93 81 ldd r25, Z+3 ; 0x03 295a4: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 295a8: 18 16 cp r1, r24 295aa: 2c f4 brge .+10 ; 0x295b6 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x13c> 295ac: f7 01 movw r30, r14 295ae: 40 82 st Z, r4 295b0: 51 82 std Z+1, r5 ; 0x01 295b2: 62 82 std Z+2, r6 ; 0x02 295b4: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 295b6: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 295ba: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 295be: 65 e6 ldi r22, 0x65 ; 101 295c0: 72 e1 ldi r23, 0x12 ; 18 295c2: 81 e6 ldi r24, 0x61 ; 97 295c4: 92 e1 ldi r25, 0x12 ; 18 295c6: 0e 94 ee 68 call 0xd1dc ; 0xd1dc plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 295ca: f8 01 movw r30, r16 295cc: e0 52 subi r30, 0x20 ; 32 295ce: fd 4f sbci r31, 0xFD ; 253 295d0: 60 81 ld r22, Z 295d2: 71 81 ldd r23, Z+1 ; 0x01 295d4: 82 81 ldd r24, Z+2 ; 0x02 295d6: 93 81 ldd r25, Z+3 ; 0x03 295d8: 0e 94 15 65 call 0xca2a ; 0xca2a 295dc: 0f 94 0a 4a call 0x29414 ; 0x29414 lcd_draw_update = 1; 295e0: 81 e0 ldi r24, 0x01 ; 1 295e2: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } } if (lcd_draw_update) 295e6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 295ea: 88 23 and r24, r24 295ec: 11 f1 breq .+68 ; 0x29632 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x1b8> { lcd_set_cursor(0, 1); 295ee: 61 e0 ldi r22, 0x01 ; 1 295f0: 80 e0 ldi r24, 0x00 ; 0 295f2: 0e 94 2a 6f call 0xde54 ; 0xde54 menu_draw_float31(name, current_position[axis]); 295f6: 84 e0 ldi r24, 0x04 ; 4 295f8: c8 9f mul r28, r24 295fa: f0 01 movw r30, r0 295fc: 11 24 eor r1, r1 295fe: ef 59 subi r30, 0x9F ; 159 29600: fd 4e sbci r31, 0xED ; 237 //! 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); 29602: 83 81 ldd r24, Z+3 ; 0x03 29604: 8f 93 push r24 29606: 82 81 ldd r24, Z+2 ; 0x02 29608: 8f 93 push r24 2960a: 81 81 ldd r24, Z+1 ; 0x01 2960c: 8f 93 push r24 2960e: 80 81 ld r24, Z 29610: 8f 93 push r24 29612: df 93 push r29 29614: 9f 92 push r9 29616: 88 e3 ldi r24, 0x38 ; 56 29618: 92 e8 ldi r25, 0x82 ; 130 2961a: 9f 93 push r25 2961c: 8f 93 push r24 2961e: 0e 94 db 6e call 0xddb6 ; 0xddb6 29622: ed b7 in r30, 0x3d ; 61 29624: fe b7 in r31, 0x3e ; 62 29626: 38 96 adiw r30, 0x08 ; 8 29628: 0f b6 in r0, 0x3f ; 63 2962a: f8 94 cli 2962c: fe bf out 0x3e, r31 ; 62 2962e: 0f be out 0x3f, r0 ; 63 29630: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 29632: 80 91 c4 03 lds r24, 0x03C4 ; 0x8003c4 29636: 81 11 cpse r24, r1 29638: 04 c0 rjmp .+8 ; 0x29642 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x1c8> 2963a: 80 91 95 03 lds r24, 0x0395 ; 0x800395 2963e: 88 23 and r24, r24 29640: 21 f0 breq .+8 ; 0x2964a <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x1d0> 29642: 80 91 97 03 lds r24, 0x0397 ; 0x800397 29646: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.388> menu_back_if_clicked(); } 2964a: df 91 pop r29 2964c: cf 91 pop r28 2964e: 1f 91 pop r17 29650: 0f 91 pop r16 29652: ff 90 pop r15 29654: ef 90 pop r14 29656: df 90 pop r13 29658: cf 90 pop r12 2965a: bf 90 pop r11 2965c: af 90 pop r10 2965e: 9f 90 pop r9 29660: 7f 90 pop r7 29662: 6f 90 pop r6 29664: 5f 90 pop r5 29666: 4f 90 pop r4 29668: 3f 90 pop r3 2966a: 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(); 2966c: 0c 94 d6 73 jmp 0xe7ac ; 0xe7ac { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 29670: c0 82 st Z, r12 29672: d1 82 std Z+1, r13 ; 0x01 29674: e2 82 std Z+2, r14 ; 0x02 29676: f3 82 std Z+3, r15 ; 0x03 29678: 82 cf rjmp .-252 ; 0x2957e <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.409]+0x104> 0002967a : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 2967a: 4f 92 push r4 2967c: 5f 92 push r5 2967e: 6f 92 push r6 29680: 7f 92 push r7 29682: 8f 92 push r8 29684: 9f 92 push r9 29686: af 92 push r10 29688: bf 92 push r11 2968a: cf 92 push r12 2968c: df 92 push r13 2968e: ef 92 push r14 29690: ff 92 push r15 29692: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 29694: 80 e0 ldi r24, 0x00 ; 0 29696: 0f 94 8e 18 call 0x2311c ; 0x2311c 2969a: 60 93 3c 06 sts 0x063C, r22 ; 0x80063c 2969e: 70 93 3d 06 sts 0x063D, r23 ; 0x80063d 296a2: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 296a6: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f position[Y_AXIS] = st_get_position(Y_AXIS); 296aa: 81 e0 ldi r24, 0x01 ; 1 296ac: 0f 94 8e 18 call 0x2311c ; 0x2311c 296b0: 60 93 40 06 sts 0x0640, r22 ; 0x800640 296b4: 70 93 41 06 sts 0x0641, r23 ; 0x800641 296b8: 80 93 42 06 sts 0x0642, r24 ; 0x800642 296bc: 90 93 43 06 sts 0x0643, r25 ; 0x800643 position[Z_AXIS] = st_get_position(Z_AXIS); 296c0: 82 e0 ldi r24, 0x02 ; 2 296c2: 0f 94 8e 18 call 0x2311c ; 0x2311c 296c6: 60 93 44 06 sts 0x0644, r22 ; 0x800644 296ca: 70 93 45 06 sts 0x0645, r23 ; 0x800645 296ce: 80 93 46 06 sts 0x0646, r24 ; 0x800646 296d2: 90 93 47 06 sts 0x0647, r25 ; 0x800647 position[E_AXIS] = st_get_position(E_AXIS); 296d6: 83 e0 ldi r24, 0x03 ; 3 296d8: 0f 94 8e 18 call 0x2311c ; 0x2311c 296dc: 60 93 48 06 sts 0x0648, r22 ; 0x800648 296e0: 70 93 49 06 sts 0x0649, r23 ; 0x800649 296e4: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a 296e8: 90 93 4b 06 sts 0x064B, r25 ; 0x80064b // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 296ec: 80 e0 ldi r24, 0x00 ; 0 296ee: 0f 94 9c 18 call 0x23138 ; 0x23138 296f2: 60 93 61 12 sts 0x1261, r22 ; 0x801261 296f6: 70 93 62 12 sts 0x1262, r23 ; 0x801262 296fa: 80 93 63 12 sts 0x1263, r24 ; 0x801263 296fe: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 29702: 81 e0 ldi r24, 0x01 ; 1 29704: 0f 94 9c 18 call 0x23138 ; 0x23138 29708: 60 93 65 12 sts 0x1265, r22 ; 0x801265 2970c: 70 93 66 12 sts 0x1266, r23 ; 0x801266 29710: 80 93 67 12 sts 0x1267, r24 ; 0x801267 29714: 90 93 68 12 sts 0x1268, r25 ; 0x801268 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 29718: 82 e0 ldi r24, 0x02 ; 2 2971a: 0f 94 9c 18 call 0x23138 ; 0x23138 2971e: 60 93 69 12 sts 0x1269, r22 ; 0x801269 29722: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 29726: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 2972a: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c current_position[E_AXIS] = st_get_position_mm(E_AXIS); 2972e: 83 e0 ldi r24, 0x03 ; 3 29730: 0f 94 9c 18 call 0x23138 ; 0x23138 29734: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 29738: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 2973c: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 29740: 90 93 70 12 sts 0x1270, r25 ; 0x801270 // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 29744: 80 91 09 13 lds r24, 0x1309 ; 0x801309 29748: 88 23 and r24, r24 2974a: 31 f1 breq .+76 ; 0x29798 #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]); 2974c: 20 91 65 12 lds r18, 0x1265 ; 0x801265 29750: 30 91 66 12 lds r19, 0x1266 ; 0x801266 29754: 40 91 67 12 lds r20, 0x1267 ; 0x801267 29758: 50 91 68 12 lds r21, 0x1268 ; 0x801268 2975c: 60 91 61 12 lds r22, 0x1261 ; 0x801261 29760: 70 91 62 12 lds r23, 0x1262 ; 0x801262 29764: 80 91 63 12 lds r24, 0x1263 ; 0x801263 29768: 90 91 64 12 lds r25, 0x1264 ; 0x801264 2976c: 0f 94 35 91 call 0x3226a ; 0x3226a 29770: 9b 01 movw r18, r22 29772: ac 01 movw r20, r24 29774: 60 91 69 12 lds r22, 0x1269 ; 0x801269 29778: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 2977c: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 29780: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 29784: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 29788: 60 93 69 12 sts 0x1269, r22 ; 0x801269 2978c: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 29790: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 29794: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 29798: c0 91 a2 04 lds r28, 0x04A2 ; 0x8004a2 2979c: cc 23 and r28, r28 2979e: 09 f4 brne .+2 ; 0x297a2 297a0: 9a c0 rjmp .+308 ; 0x298d6 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 297a2: c0 ff sbrs r28, 0 297a4: 34 c0 rjmp .+104 ; 0x2980e // Then add the offset. x -= world2machine_shift[0]; 297a6: 20 91 9a 04 lds r18, 0x049A ; 0x80049a 297aa: 30 91 9b 04 lds r19, 0x049B ; 0x80049b 297ae: 40 91 9c 04 lds r20, 0x049C ; 0x80049c 297b2: 50 91 9d 04 lds r21, 0x049D ; 0x80049d 297b6: 60 91 61 12 lds r22, 0x1261 ; 0x801261 297ba: 70 91 62 12 lds r23, 0x1262 ; 0x801262 297be: 80 91 63 12 lds r24, 0x1263 ; 0x801263 297c2: 90 91 64 12 lds r25, 0x1264 ; 0x801264 297c6: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 297ca: 60 93 61 12 sts 0x1261, r22 ; 0x801261 297ce: 70 93 62 12 sts 0x1262, r23 ; 0x801262 297d2: 80 93 63 12 sts 0x1263, r24 ; 0x801263 297d6: 90 93 64 12 sts 0x1264, r25 ; 0x801264 y -= world2machine_shift[1]; 297da: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 297de: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 297e2: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 297e6: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 297ea: 60 91 65 12 lds r22, 0x1265 ; 0x801265 297ee: 70 91 66 12 lds r23, 0x1266 ; 0x801266 297f2: 80 91 67 12 lds r24, 0x1267 ; 0x801267 297f6: 90 91 68 12 lds r25, 0x1268 ; 0x801268 297fa: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 297fe: 60 93 65 12 sts 0x1265, r22 ; 0x801265 29802: 70 93 66 12 sts 0x1266, r23 ; 0x801266 29806: 80 93 67 12 sts 0x1267, r24 ; 0x801267 2980a: 90 93 68 12 sts 0x1268, r25 ; 0x801268 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 2980e: c1 ff sbrs r28, 1 29810: 62 c0 rjmp .+196 ; 0x298d6 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 29812: 80 90 61 12 lds r8, 0x1261 ; 0x801261 29816: 90 90 62 12 lds r9, 0x1262 ; 0x801262 2981a: a0 90 63 12 lds r10, 0x1263 ; 0x801263 2981e: b0 90 64 12 lds r11, 0x1264 ; 0x801264 29822: c0 90 65 12 lds r12, 0x1265 ; 0x801265 29826: d0 90 66 12 lds r13, 0x1266 ; 0x801266 2982a: e0 90 67 12 lds r14, 0x1267 ; 0x801267 2982e: f0 90 68 12 lds r15, 0x1268 ; 0x801268 float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 29832: 20 91 92 04 lds r18, 0x0492 ; 0x800492 29836: 30 91 93 04 lds r19, 0x0493 ; 0x800493 2983a: 40 91 94 04 lds r20, 0x0494 ; 0x800494 2983e: 50 91 95 04 lds r21, 0x0495 ; 0x800495 29842: c5 01 movw r24, r10 29844: b4 01 movw r22, r8 29846: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2984a: 2b 01 movw r4, r22 2984c: 3c 01 movw r6, r24 2984e: 20 91 96 04 lds r18, 0x0496 ; 0x800496 29852: 30 91 97 04 lds r19, 0x0497 ; 0x800497 29856: 40 91 98 04 lds r20, 0x0498 ; 0x800498 2985a: 50 91 99 04 lds r21, 0x0499 ; 0x800499 2985e: c7 01 movw r24, r14 29860: b6 01 movw r22, r12 29862: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 29866: 9b 01 movw r18, r22 29868: ac 01 movw r20, r24 2986a: c3 01 movw r24, r6 2986c: b2 01 movw r22, r4 2986e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 29872: 2b 01 movw r4, r22 29874: 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; 29876: 20 91 8a 04 lds r18, 0x048A ; 0x80048a 2987a: 30 91 8b 04 lds r19, 0x048B ; 0x80048b 2987e: 40 91 8c 04 lds r20, 0x048C ; 0x80048c 29882: 50 91 8d 04 lds r21, 0x048D ; 0x80048d 29886: c5 01 movw r24, r10 29888: b4 01 movw r22, r8 2988a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2988e: 4b 01 movw r8, r22 29890: 5c 01 movw r10, r24 29892: 20 91 8e 04 lds r18, 0x048E ; 0x80048e 29896: 30 91 8f 04 lds r19, 0x048F ; 0x80048f 2989a: 40 91 90 04 lds r20, 0x0490 ; 0x800490 2989e: 50 91 91 04 lds r21, 0x0491 ; 0x800491 298a2: c7 01 movw r24, r14 298a4: b6 01 movw r22, r12 298a6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 298aa: 9b 01 movw r18, r22 298ac: ac 01 movw r20, r24 298ae: c5 01 movw r24, r10 298b0: b4 01 movw r22, r8 298b2: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 298b6: 60 93 61 12 sts 0x1261, r22 ; 0x801261 298ba: 70 93 62 12 sts 0x1262, r23 ; 0x801262 298be: 80 93 63 12 sts 0x1263, r24 ; 0x801263 298c2: 90 93 64 12 sts 0x1264, r25 ; 0x801264 y = out_y; 298c6: 40 92 65 12 sts 0x1265, r4 ; 0x801265 298ca: 50 92 66 12 sts 0x1266, r5 ; 0x801266 298ce: 60 92 67 12 sts 0x1267, r6 ; 0x801267 298d2: 70 92 68 12 sts 0x1268, r7 ; 0x801268 } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 298d6: 0e 94 7e 66 call 0xccfc ; 0xccfc #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 298da: 80 e1 ldi r24, 0x10 ; 16 298dc: e1 e6 ldi r30, 0x61 ; 97 298de: f2 e1 ldi r31, 0x12 ; 18 298e0: a6 e3 ldi r26, 0x36 ; 54 298e2: b4 e0 ldi r27, 0x04 ; 4 298e4: 01 90 ld r0, Z+ 298e6: 0d 92 st X+, r0 298e8: 8a 95 dec r24 298ea: e1 f7 brne .-8 ; 0x298e4 #endif } 298ec: cf 91 pop r28 298ee: ff 90 pop r15 298f0: ef 90 pop r14 298f2: df 90 pop r13 298f4: cf 90 pop r12 298f6: bf 90 pop r11 298f8: af 90 pop r10 298fa: 9f 90 pop r9 298fc: 8f 90 pop r8 298fe: 7f 90 pop r7 29900: 6f 90 pop r6 29902: 5f 90 pop r5 29904: 4f 90 pop r4 29906: 08 95 ret 00029908 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 29908: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2990c: 8d 7f andi r24, 0xFD ; 253 2990e: 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(); 29912: 0f 94 3d 4b call 0x2967a ; 0x2967a // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 29916: 81 e0 ldi r24, 0x01 ; 1 29918: 80 93 42 0d sts 0x0D42, r24 ; 0x800d42 } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 2991c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 29920: 8d 7f andi r24, 0xFD ; 253 29922: 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); 29926: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 2992a: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f while (blocks_queued()) plan_discard_current_block(); 2992e: 98 17 cp r25, r24 29930: 69 f0 breq .+26 ; 0x2994c 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) { 29932: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 29936: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 2993a: 98 17 cp r25, r24 2993c: a1 f3 breq .-24 ; 0x29926 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2993e: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 29942: 8f 5f subi r24, 0xFF ; 255 29944: 8f 70 andi r24, 0x0F ; 15 29946: 80 93 3f 0d sts 0x0D3F, r24 ; 0x800d3f 2994a: ed cf rjmp .-38 ; 0x29926 current_block = NULL; 2994c: 10 92 52 12 sts 0x1252, r1 ; 0x801252 29950: 10 92 51 12 sts 0x1251, r1 ; 0x801251 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 29954: 8f ef ldi r24, 0xFF ; 255 29956: 9f ef ldi r25, 0xFF ; 255 29958: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.440+0x1> 2995c: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.440> current_adv_steps = 0; 29960: 10 92 49 04 sts 0x0449, r1 ; 0x800449 <_ZL17current_adv_steps.lto_priv.442+0x1> 29964: 10 92 48 04 sts 0x0448, r1 ; 0x800448 <_ZL17current_adv_steps.lto_priv.442> #endif st_reset_timer(); 29968: 0f 94 01 19 call 0x23202 ; 0x23202 ENABLE_STEPPER_DRIVER_INTERRUPT(); 2996c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 29970: 82 60 ori r24, 0x02 ; 2 29972: 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; 29976: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.446> 2997a: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.446+0x1> 2997e: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.446+0x2> 29982: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.446+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 29986: e6 e2 ldi r30, 0x26 ; 38 29988: f4 e0 ldi r31, 0x04 ; 4 2998a: 80 e1 ldi r24, 0x10 ; 16 2998c: df 01 movw r26, r30 2998e: 1d 92 st X+, r1 29990: 8a 95 dec r24 29992: e9 f7 brne .-6 ; 0x2998e // Reset position sync requests plan_reset_next_e_queue = false; 29994: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.444> plan_reset_next_e_sched = false; 29998: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.445> } 2999c: 08 95 ret 0002999e : pat9125_PID2 = 0xff; return 0; } static void pat9125_wr_reg(uint8_t addr, uint8_t data) { 2999e: cf 93 push r28 299a0: df 93 push r29 299a2: d8 2f mov r29, r24 299a4: c6 2f mov r28, r22 return 1; } uint8_t swi2c_writeByte_A8(uint8_t dev_addr, uint8_t addr, uint8_t* pbyte) { swi2c_start(); 299a6: 0f 94 12 15 call 0x22a24 ; 0x22a24 swi2c_write(SWI2C_WMSK | ((dev_addr & SWI2C_DMSK) << SWI2C_ASHF)); 299aa: 8a ee ldi r24, 0xEA ; 234 299ac: 0f 94 a1 14 call 0x22942 ; 0x22942 if (!swi2c_wait_ack()) { swi2c_stop(); return 0; } 299b0: 0f 94 cd 14 call 0x2299a ; 0x2299a 299b4: 81 11 cpse r24, r1 299b6: 0a c0 rjmp .+20 ; 0x299cc 299b8: 0f 94 02 15 call 0x22a04 ; 0x22a04 goto error; #endif return; error: pat9125_PID1 = 0xff; 299bc: 8f ef ldi r24, 0xFF ; 255 299be: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = 0xff; 299c2: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 return; } 299c6: df 91 pop r29 299c8: cf 91 pop r28 299ca: 08 95 ret swi2c_write(addr & 0xff); 299cc: 8d 2f mov r24, r29 299ce: 0f 94 a1 14 call 0x22942 ; 0x22942 if (!swi2c_wait_ack()) return 0; 299d2: 0f 94 cd 14 call 0x2299a ; 0x2299a 299d6: 88 23 and r24, r24 299d8: 89 f3 breq .-30 ; 0x299bc swi2c_write(*pbyte); 299da: 8c 2f mov r24, r28 299dc: 0f 94 a1 14 call 0x22942 ; 0x22942 if (!swi2c_wait_ack()) return 0; 299e0: 0f 94 cd 14 call 0x2299a ; 0x2299a 299e4: 88 23 and r24, r24 299e6: 51 f3 breq .-44 ; 0x299bc 299e8: df 91 pop r29 299ea: cf 91 pop r28 swi2c_stop(); 299ec: 0d 94 02 15 jmp 0x22a04 ; 0x22a04 000299f0 : } return 0; } static uint8_t pat9125_rd_reg(uint8_t addr) { 299f0: 0f 93 push r16 299f2: 1f 93 push r17 299f4: cf 93 push r28 299f6: c8 2f mov r28, r24 #ifdef SWI2C_A8 //8bit address uint8_t swi2c_readByte_A8(uint8_t dev_addr, uint8_t addr, uint8_t* pbyte) { swi2c_start(); 299f8: 0f 94 12 15 call 0x22a24 ; 0x22a24 swi2c_write(SWI2C_WMSK | ((dev_addr & SWI2C_DMSK) << SWI2C_ASHF)); 299fc: 8a ee ldi r24, 0xEA ; 234 299fe: 0f 94 a1 14 call 0x22942 ; 0x22942 if (!swi2c_wait_ack()) { swi2c_stop(); return 0; } 29a02: 0f 94 cd 14 call 0x2299a ; 0x2299a 29a06: 81 11 cpse r24, r1 29a08: 09 c0 rjmp .+18 ; 0x29a1c 29a0a: 0f 94 02 15 call 0x22a04 ; 0x22a04 goto error; #endif return data; error: pat9125_PID1 = 0xff; 29a0e: 8f ef ldi r24, 0xFF ; 255 29a10: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = 0xff; 29a14: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 return 0; 29a18: c0 e0 ldi r28, 0x00 ; 0 29a1a: 1e c0 rjmp .+60 ; 0x29a58 swi2c_write(addr & 0xff); 29a1c: 8c 2f mov r24, r28 29a1e: 0f 94 a1 14 call 0x22942 ; 0x22942 if (!swi2c_wait_ack()) return 0; 29a22: 0f 94 cd 14 call 0x2299a ; 0x2299a 29a26: 88 23 and r24, r24 29a28: 91 f3 breq .-28 ; 0x29a0e swi2c_stop(); 29a2a: 0f 94 02 15 call 0x22a04 ; 0x22a04 swi2c_start(); 29a2e: 0f 94 12 15 call 0x22a24 ; 0x22a24 swi2c_write(SWI2C_RMSK | ((dev_addr & SWI2C_DMSK) << SWI2C_ASHF)); 29a32: 8b ee ldi r24, 0xEB ; 235 29a34: 0f 94 a1 14 call 0x22942 ; 0x22942 if (!swi2c_wait_ack()) return 0; 29a38: 0f 94 cd 14 call 0x2299a ; 0x2299a 29a3c: 88 23 and r24, r24 29a3e: 39 f3 breq .-50 ; 0x29a0e return ack; } static uint8_t swi2c_read(void) { WRITE(SWI2C_SDA, 1); 29a40: 59 9a sbi 0x0b, 1 ; 11 29a42: 88 e0 ldi r24, 0x08 ; 8 29a44: 8a 95 dec r24 29a46: f1 f7 brne .-4 ; 0x29a44 __delay(); SET_INPUT(SWI2C_SDA); 29a48: 51 98 cbi 0x0a, 1 ; 10 uint8_t data = 0; for (uint8_t bit = 8; bit-- > 0;) 29a4a: 88 e0 ldi r24, 0x08 ; 8 static uint8_t swi2c_read(void) { WRITE(SWI2C_SDA, 1); __delay(); SET_INPUT(SWI2C_SDA); uint8_t data = 0; 29a4c: c0 e0 ldi r28, 0x00 ; 0 for (uint8_t bit = 8; bit-- > 0;) 29a4e: 81 50 subi r24, 0x01 ; 1 29a50: 40 f4 brcc .+16 ; 0x29a62 __delay(); data |= (READ(SWI2C_SDA)) << bit; WRITE(SWI2C_SCL, 0); __delay(); } SET_OUTPUT(SWI2C_SDA); 29a52: 51 9a sbi 0x0a, 1 ; 10 swi2c_stop(); swi2c_start(); swi2c_write(SWI2C_RMSK | ((dev_addr & SWI2C_DMSK) << SWI2C_ASHF)); if (!swi2c_wait_ack()) return 0; uint8_t byte = swi2c_read(); swi2c_stop(); 29a54: 0f 94 02 15 call 0x22a04 ; 0x22a04 } 29a58: 8c 2f mov r24, r28 29a5a: cf 91 pop r28 29a5c: 1f 91 pop r17 29a5e: 0f 91 pop r16 29a60: 08 95 ret __delay(); SET_INPUT(SWI2C_SDA); uint8_t data = 0; for (uint8_t bit = 8; bit-- > 0;) { WRITE(SWI2C_SCL, 1); 29a62: 2f b7 in r18, 0x3f ; 63 29a64: f8 94 cli 29a66: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29a6a: 94 60 ori r25, 0x04 ; 4 29a6c: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29a70: 2f bf out 0x3f, r18 ; 63 29a72: 98 e0 ldi r25, 0x08 ; 8 29a74: 9a 95 dec r25 29a76: f1 f7 brne .-4 ; 0x29a74 __delay(); data |= (READ(SWI2C_SDA)) << bit; 29a78: 99 b1 in r25, 0x09 ; 9 29a7a: 91 fb bst r25, 1 29a7c: 00 27 eor r16, r16 29a7e: 00 f9 bld r16, 0 29a80: 10 e0 ldi r17, 0x00 ; 0 29a82: 98 01 movw r18, r16 29a84: 08 2e mov r0, r24 29a86: 01 c0 rjmp .+2 ; 0x29a8a 29a88: 22 0f add r18, r18 29a8a: 0a 94 dec r0 29a8c: ea f7 brpl .-6 ; 0x29a88 29a8e: c2 2b or r28, r18 WRITE(SWI2C_SCL, 0); 29a90: 2f b7 in r18, 0x3f ; 63 29a92: f8 94 cli 29a94: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29a98: 9b 7f andi r25, 0xFB ; 251 29a9a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29a9e: 2f bf out 0x3f, r18 ; 63 29aa0: 98 e0 ldi r25, 0x08 ; 8 29aa2: 9a 95 dec r25 29aa4: f1 f7 brne .-4 ; 0x29aa2 29aa6: d3 cf rjmp .-90 ; 0x29a4e 00029aa8 : pat9125_wr_reg(addr, data); return pat9125_rd_reg(addr) == data; } static uint8_t pat9125_wr_seq(const uint8_t* seq) { 29aa8: 0f 93 push r16 29aaa: 1f 93 push r17 29aac: cf 93 push r28 29aae: df 93 push r29 29ab0: 8c 01 movw r16, r24 for (;;) { const uint8_t addr = pgm_read_byte(seq++); 29ab2: f8 01 movw r30, r16 29ab4: d4 91 lpm r29, Z if (addr == 0xff) 29ab6: df 3f cpi r29, 0xFF ; 255 29ab8: 99 f0 breq .+38 ; 0x29ae0 break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 29aba: 31 96 adiw r30, 0x01 ; 1 29abc: c4 91 lpm r28, Z return; } static uint8_t pat9125_wr_reg_verify(uint8_t addr, uint8_t data) { pat9125_wr_reg(addr, data); 29abe: 6c 2f mov r22, r28 29ac0: 8d 2f mov r24, r29 29ac2: 0f 94 cf 4c call 0x2999e ; 0x2999e return pat9125_rd_reg(addr) == data; 29ac6: 8d 2f mov r24, r29 29ac8: 0f 94 f8 4c call 0x299f0 ; 0x299f0 { for (;;) { const uint8_t addr = pgm_read_byte(seq++); if (addr == 0xff) break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 29acc: 0e 5f subi r16, 0xFE ; 254 29ace: 1f 4f sbci r17, 0xFF ; 255 29ad0: c8 17 cp r28, r24 29ad2: 79 f3 breq .-34 ; 0x29ab2 // Verification of the register write failed. return 0; 29ad4: 80 e0 ldi r24, 0x00 ; 0 } return 1; } 29ad6: df 91 pop r29 29ad8: cf 91 pop r28 29ada: 1f 91 pop r17 29adc: 0f 91 pop r16 29ade: 08 95 ret break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) // Verification of the register write failed. return 0; } return 1; 29ae0: 81 e0 ldi r24, 0x01 ; 1 29ae2: f9 cf rjmp .-14 ; 0x29ad6 00029ae4 : return 1; } uint8_t pat9125_update(void) { 29ae4: cf 93 push r28 29ae6: df 93 push r29 if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 29ae8: 80 91 66 0d lds r24, 0x0D66 ; 0x800d66 29aec: 81 33 cpi r24, 0x31 ; 49 29aee: 21 f0 breq .+8 ; 0x29af8 pat9125_x += iDX; pat9125_y += iDY; } return 1; } return 0; 29af0: 80 e0 ldi r24, 0x00 ; 0 } 29af2: df 91 pop r29 29af4: cf 91 pop r28 29af6: 08 95 ret return 1; } uint8_t pat9125_update(void) { if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 29af8: 80 91 65 0d lds r24, 0x0D65 ; 0x800d65 29afc: 81 39 cpi r24, 0x91 ; 145 29afe: c1 f7 brne .-16 ; 0x29af0 { uint8_t ucMotion = pat9125_rd_reg(PAT9125_MOTION); 29b00: 82 e0 ldi r24, 0x02 ; 2 29b02: 0f 94 f8 4c call 0x299f0 ; 0x299f0 29b06: c8 2f mov r28, r24 pat9125_b = pat9125_rd_reg(PAT9125_FRAME); 29b08: 87 e1 ldi r24, 0x17 ; 23 29b0a: 0f 94 f8 4c call 0x299f0 ; 0x299f0 29b0e: 80 93 63 0d sts 0x0D63, r24 ; 0x800d63 pat9125_s = pat9125_rd_reg(PAT9125_SHUTTER); 29b12: 84 e1 ldi r24, 0x14 ; 20 29b14: 0f 94 f8 4c call 0x299f0 ; 0x299f0 29b18: 80 93 64 0d sts 0x0D64, r24 ; 0x800d64 if (pat9125_PID1 == 0xff) return 0; 29b1c: 80 91 66 0d lds r24, 0x0D66 ; 0x800d66 29b20: 8f 3f cpi r24, 0xFF ; 255 29b22: 31 f3 breq .-52 ; 0x29af0 if (ucMotion & 0x80) 29b24: c7 ff sbrs r28, 7 29b26: 36 c0 rjmp .+108 ; 0x29b94 { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); 29b28: 83 e0 ldi r24, 0x03 ; 3 29b2a: 0f 94 f8 4c call 0x299f0 ; 0x299f0 29b2e: d8 2f mov r29, r24 uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); 29b30: 84 e0 ldi r24, 0x04 ; 4 29b32: 0f 94 f8 4c call 0x299f0 ; 0x299f0 29b36: c8 2f mov r28, r24 uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 29b38: 82 e1 ldi r24, 0x12 ; 18 29b3a: 0f 94 f8 4c call 0x299f0 ; 0x299f0 if (pat9125_PID1 == 0xff) return 0; 29b3e: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 29b42: 9f 3f cpi r25, 0xFF ; 255 29b44: a9 f2 breq .-86 ; 0x29af0 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); 29b46: 90 e0 ldi r25, 0x00 ; 0 if (pat9125_PID1 == 0xff) return 0; int16_t iDX = ucXL | ((ucXYH << 4) & 0xf00); 29b48: 9c 01 movw r18, r24 29b4a: 44 e0 ldi r20, 0x04 ; 4 29b4c: 22 0f add r18, r18 29b4e: 33 1f adc r19, r19 29b50: 4a 95 dec r20 29b52: e1 f7 brne .-8 ; 0x29b4c 29b54: 22 27 eor r18, r18 29b56: 3f 70 andi r19, 0x0F ; 15 29b58: 2d 2b or r18, r29 int16_t iDY = ucYL | ((ucXYH << 8) & 0xf00); 29b5a: 98 2f mov r25, r24 29b5c: 88 27 eor r24, r24 29b5e: 88 27 eor r24, r24 29b60: 9f 70 andi r25, 0x0F ; 15 29b62: 8c 2b or r24, r28 if (iDX & 0x800) iDX -= 4096; 29b64: 33 fd sbrc r19, 3 29b66: 30 51 subi r19, 0x10 ; 16 if (iDY & 0x800) iDY -= 4096; 29b68: 93 fd sbrc r25, 3 29b6a: 90 51 subi r25, 0x10 ; 16 pat9125_x += iDX; 29b6c: 40 91 89 03 lds r20, 0x0389 ; 0x800389 29b70: 50 91 8a 03 lds r21, 0x038A ; 0x80038a 29b74: 24 0f add r18, r20 29b76: 35 1f adc r19, r21 29b78: 30 93 8a 03 sts 0x038A, r19 ; 0x80038a 29b7c: 20 93 89 03 sts 0x0389, r18 ; 0x800389 pat9125_y += iDY; 29b80: 20 91 38 0e lds r18, 0x0E38 ; 0x800e38 29b84: 30 91 39 0e lds r19, 0x0E39 ; 0x800e39 29b88: 82 0f add r24, r18 29b8a: 93 1f adc r25, r19 29b8c: 90 93 39 0e sts 0x0E39, r25 ; 0x800e39 29b90: 80 93 38 0e sts 0x0E38, r24 ; 0x800e38 } return 1; 29b94: 81 e0 ldi r24, 0x01 ; 1 29b96: ad cf rjmp .-166 ; 0x29af2 00029b98 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 29b98: 81 e0 ldi r24, 0x01 ; 1 29b9a: 0c 94 08 70 jmp 0xe010 ; 0xe010 00029b9e : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 29b9e: 0f 93 push r16 29ba0: 1f 93 push r17 29ba2: cf 93 push r28 29ba4: 8c 01 movw r16, r24 29ba6: c6 2f mov r28, r22 lcd_update_enable(false); 29ba8: 80 e0 ldi r24, 0x00 ; 0 29baa: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_clear(); 29bae: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 1, pgmS); 29bb2: a8 01 movw r20, r16 29bb4: 61 e0 ldi r22, 0x01 ; 1 29bb6: 80 e0 ldi r24, 0x00 ; 0 29bb8: 0e 94 d7 6f call 0xdfae ; 0xdfae } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 29bbc: 80 e2 ldi r24, 0x20 ; 32 29bbe: 0e 94 72 70 call 0xe0e4 ; 0xe0e4 lcd_print(' '); lcd_print(slot + 1); 29bc2: 6c 2f mov r22, r28 29bc4: 70 e0 ldi r23, 0x00 ; 0 29bc6: 6f 5f subi r22, 0xFF ; 255 29bc8: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 29bca: 07 2e mov r0, r23 29bcc: 00 0c add r0, r0 29bce: 88 0b sbc r24, r24 29bd0: 99 0b sbc r25, r25 } 29bd2: cf 91 pop r28 29bd4: 1f 91 pop r17 29bd6: 0f 91 pop r16 29bd8: 0c 94 ab 71 jmp 0xe356 ; 0xe356 00029bdc : 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); 29bdc: 82 ed ldi r24, 0xD2 ; 210 29bde: 9e e0 ldi r25, 0x0E ; 14 29be0: 0e 94 4c 78 call 0xf098 ; 0xf098 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 29be4: 83 ed ldi r24, 0xD3 ; 211 29be6: 9e e0 ldi r25, 0x0E ; 14 29be8: 0c 94 3f 78 jmp 0xf07e ; 0xf07e 00029bec : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 29bec: 41 e0 ldi r20, 0x01 ; 1 29bee: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 29bf2: 81 11 cpse r24, r1 29bf4: 01 c0 rjmp .+2 ; 0x29bf8 29bf6: 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'); 29bf8: 40 5d subi r20, 0xD0 ; 208 29bfa: 62 e0 ldi r22, 0x02 ; 2 29bfc: 83 e0 ldi r24, 0x03 ; 3 29bfe: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 29c02: 41 e0 ldi r20, 0x01 ; 1 29c04: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 29c08: 81 11 cpse r24, r1 29c0a: 01 c0 rjmp .+2 ; 0x29c0e 29c0c: 40 e0 ldi r20, 0x00 ; 0 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 29c0e: 40 5d subi r20, 0xD0 ; 208 29c10: 62 e0 ldi r22, 0x02 ; 2 29c12: 88 e0 ldi r24, 0x08 ; 8 29c14: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 // print active/changing filament slot lcd_set_cursor(10, 2); 29c18: 62 e0 ldi r22, 0x02 ; 2 29c1a: 8a e0 ldi r24, 0x0A ; 10 29c1c: 0e 94 2a 6f call 0xde54 ; 0xde54 lcdui_print_extruder(); 29c20: 0f 94 7e 05 call 0x20afc ; 0x20afc // Print active extruder temperature lcd_set_cursor(16, 2); 29c24: 62 e0 ldi r22, 0x02 ; 2 29c26: 80 e1 ldi r24, 0x10 ; 16 29c28: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 29c2c: 20 e0 ldi r18, 0x00 ; 0 29c2e: 30 e0 ldi r19, 0x00 ; 0 29c30: 40 e0 ldi r20, 0x00 ; 0 29c32: 5f e3 ldi r21, 0x3F ; 63 29c34: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 29c38: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 29c3c: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 29c40: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 29c44: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 29c48: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 29c4c: 7f 93 push r23 29c4e: 6f 93 push r22 29c50: 83 ed ldi r24, 0xD3 ; 211 29c52: 97 e8 ldi r25, 0x87 ; 135 29c54: 9f 93 push r25 29c56: 8f 93 push r24 29c58: 0e 94 db 6e call 0xddb6 ; 0xddb6 29c5c: 0f 90 pop r0 29c5e: 0f 90 pop r0 29c60: 0f 90 pop r0 29c62: 0f 90 pop r0 } 29c64: 08 95 ret 00029c66 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 29c66: 8a 30 cpi r24, 0x0A ; 10 29c68: 20 f0 brcs .+8 ; 0x29c72 29c6a: 80 31 cpi r24, 0x10 ; 16 29c6c: 20 f4 brcc .+8 ; 0x29c76 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 29c6e: 89 5a subi r24, 0xA9 ; 169 29c70: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 29c72: 80 5d subi r24, 0xD0 ; 208 29c74: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 29c76: 80 e0 ldi r24, 0x00 ; 0 } } 29c78: 08 95 ret 00029c7a : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 29c7a: 0f 93 push r16 29c7c: 1f 93 push r17 29c7e: cf 93 push r28 29c80: df 93 push r29 29c82: 08 2f mov r16, r24 29c84: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 29c86: 90 e0 ldi r25, 0x00 ; 0 29c88: 24 e0 ldi r18, 0x04 ; 4 29c8a: 95 95 asr r25 29c8c: 87 95 ror r24 29c8e: 2a 95 dec r18 29c90: e1 f7 brne .-8 ; 0x29c8a uint8_t charsOut = 1; 29c92: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 29c94: 00 97 sbiw r24, 0x00 ; 0 29c96: 21 f0 breq .+8 ; 0x29ca0 *dst = Nibble2Char(v); 29c98: 0f 94 33 4e call 0x29c66 ; 0x29c66 29c9c: 89 93 st Y+, r24 ++dst; charsOut = 2; 29c9e: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 29ca0: 80 2f mov r24, r16 29ca2: 8f 70 andi r24, 0x0F ; 15 29ca4: 0f 94 33 4e call 0x29c66 ; 0x29c66 29ca8: 88 83 st Y, r24 return charsOut; } 29caa: 81 2f mov r24, r17 29cac: df 91 pop r29 29cae: cf 91 pop r28 29cb0: 1f 91 pop r17 29cb2: 0f 91 pop r16 29cb4: 08 95 ret 00029cb6 : } 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) { 29cb6: 80 33 cpi r24, 0x30 ; 48 29cb8: 30 f0 brcs .+12 ; 0x29cc6 29cba: 8a 33 cpi r24, 0x3A ; 58 29cbc: 30 f0 brcs .+12 ; 0x29cca 29cbe: 9f e9 ldi r25, 0x9F ; 159 29cc0: 98 0f add r25, r24 29cc2: 96 30 cpi r25, 0x06 ; 6 29cc4: 20 f0 brcs .+8 ; 0x29cce case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 29cc6: 80 e0 ldi r24, 0x00 ; 0 } } 29cc8: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 29cca: 80 53 subi r24, 0x30 ; 48 29ccc: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 29cce: 87 55 subi r24, 0x57 ; 87 29cd0: 08 95 ret 00029cd2 : /// 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 { 29cd2: cf 93 push r28 29cd4: df 93 push r29 29cd6: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 29cd8: 68 81 ld r22, Y 29cda: 80 e0 ldi r24, 0x00 ; 0 29cdc: 0f 94 3b 01 call 0x20276 ; 0x20276 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 29ce0: 69 81 ldd r22, Y+1 ; 0x01 29ce2: 0f 94 3b 01 call 0x20276 ; 0x20276 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 29ce6: 6a 81 ldd r22, Y+2 ; 0x02 29ce8: 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]); 29cea: 0f 94 3b 01 call 0x20276 ; 0x20276 29cee: 6c 2f mov r22, r28 return crc; } 29cf0: df 91 pop r29 29cf2: cf 91 pop r28 29cf4: 0d 94 3b 01 jmp 0x20276 ; 0x20276 00029cf8 : 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 { 29cf8: cf 93 push r28 29cfa: df 93 push r29 29cfc: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 29cfe: 0f 94 69 4e call 0x29cd2 ; 0x29cd2 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 29d02: 6d 81 ldd r22, Y+5 ; 0x05 29d04: 0f 94 3b 01 call 0x20276 ; 0x20276 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 29d08: 6e 81 ldd r22, Y+6 ; 0x06 29d0a: cf 81 ldd r28, Y+7 ; 0x07 29d0c: 0f 94 3b 01 call 0x20276 ; 0x20276 29d10: 6c 2f mov r22, r28 return crc; } 29d12: df 91 pop r29 29d14: cf 91 pop r28 29d16: 0d 94 3b 01 jmp 0x20276 ; 0x20276 00029d1a : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 29d1a: cf 93 push r28 29d1c: df 93 push r29 29d1e: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 29d20: 68 83 st Y, r22 29d22: 49 83 std Y+1, r20 ; 0x01 29d24: 1b 82 std Y+3, r1 ; 0x03 29d26: 1a 82 std Y+2, r1 ; 0x02 29d28: 0f 94 69 4e call 0x29cd2 ; 0x29cd2 29d2c: 8c 83 std Y+4, r24 ; 0x04 } 29d2e: df 91 pop r29 29d30: cf 91 pop r28 29d32: 08 95 ret 00029d34 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 29d34: 14 9a sbi 0x02, 4 ; 2 } 29d36: 08 95 ret 00029d38 : 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) { 29d38: cf 92 push r12 29d3a: df 92 push r13 29d3c: ef 92 push r14 29d3e: ff 92 push r15 29d40: cf 93 push r28 29d42: df 93 push r29 29d44: 69 01 movw r12, r18 29d46: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 29d48: c1 e6 ldi r28, 0x61 ; 97 29d4a: d2 e1 ldi r29, 0x12 ; 18 29d4c: 9b 01 movw r18, r22 29d4e: ac 01 movw r20, r24 29d50: 6c 85 ldd r22, Y+12 ; 0x0c 29d52: 7d 85 ldd r23, Y+13 ; 0x0d 29d54: 8e 85 ldd r24, Y+14 ; 0x0e 29d56: 9f 85 ldd r25, Y+15 ; 0x0f 29d58: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 29d5c: 6c 87 std Y+12, r22 ; 0x0c 29d5e: 7d 87 std Y+13, r23 ; 0x0d 29d60: 8e 87 std Y+14, r24 ; 0x0e 29d62: 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); 29d64: c7 01 movw r24, r14 29d66: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 29d68: df 91 pop r29 29d6a: cf 91 pop r28 29d6c: ff 90 pop r15 29d6e: ef 90 pop r14 29d70: df 90 pop r13 29d72: 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); 29d74: 0d 94 0a 4a jmp 0x29414 ; 0x29414 00029d78 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 29d78: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 29d7c: 0d 94 b0 18 jmp 0x23160 ; 0x23160 00029d80 : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 29d80: cf 93 push r28 29d82: df 93 push r29 29d84: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 29d86: 8e ec ldi r24, 0xCE ; 206 29d88: 91 ea ldi r25, 0xA1 ; 161 29d8a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_MMU2(); 29d8e: 8d ec ldi r24, 0xCD ; 205 29d90: 97 e8 ldi r25, 0x87 ; 135 29d92: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(msg); 29d96: ce 01 movw r24, r28 } 29d98: df 91 pop r29 29d9a: 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); 29d9c: 0c 94 8d 7c jmp 0xf91a ; 0xf91a 00029da0 : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 29da0: 81 e0 ldi r24, 0x01 ; 1 29da2: 90 91 fe 16 lds r25, 0x16FE ; 0x8016fe 29da6: 91 11 cpse r25, r1 29da8: 01 c0 rjmp .+2 ; 0x29dac 29daa: 80 e0 ldi r24, 0x00 ; 0 } 29dac: 08 95 ret 00029dae : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29dae: 89 32 cpi r24, 0x29 ; 41 29db0: 20 e8 ldi r18, 0x80 ; 128 29db2: 92 07 cpc r25, r18 29db4: 09 f4 brne .+2 ; 0x29db8 29db6: 97 c0 rjmp .+302 ; 0x29ee6 29db8: 08 f0 brcs .+2 ; 0x29dbc 29dba: 48 c0 rjmp .+144 ; 0x29e4c 29dbc: 86 30 cpi r24, 0x06 ; 6 29dbe: 60 e8 ldi r22, 0x80 ; 128 29dc0: 96 07 cpc r25, r22 29dc2: 09 f4 brne .+2 ; 0x29dc6 29dc4: 9a c0 rjmp .+308 ; 0x29efa 29dc6: 30 f5 brcc .+76 ; 0x29e14 29dc8: 83 30 cpi r24, 0x03 ; 3 29dca: 40 e8 ldi r20, 0x80 ; 128 29dcc: 94 07 cpc r25, r20 29dce: 09 f4 brne .+2 ; 0x29dd2 29dd0: 80 c0 rjmp .+256 ; 0x29ed2 29dd2: a8 f4 brcc .+42 ; 0x29dfe 29dd4: 81 30 cpi r24, 0x01 ; 1 29dd6: 20 e8 ldi r18, 0x80 ; 128 29dd8: 92 07 cpc r25, r18 29dda: 09 f4 brne .+2 ; 0x29dde 29ddc: 17 c1 rjmp .+558 ; 0x2a00c 29dde: 82 30 cpi r24, 0x02 ; 2 29de0: 40 e8 ldi r20, 0x80 ; 128 29de2: 94 07 cpc r25, r20 29de4: 09 f4 brne .+2 ; 0x29de8 29de6: 73 c0 rjmp .+230 ; 0x29ece 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); 29de8: 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)) { 29dea: 86 ff sbrs r24, 6 29dec: 8e c0 rjmp .+284 ; 0x29f0a 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); 29dee: 22 27 eor r18, r18 29df0: 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) { 29df2: 21 15 cp r18, r1 29df4: 32 4c sbci r19, 0xC2 ; 194 29df6: 09 f0 breq .+2 ; 0x29dfa 29df8: 9e c0 rjmp .+316 ; 0x29f36 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 29dfa: 8e e1 ldi r24, 0x1E ; 30 29dfc: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29dfe: 84 30 cpi r24, 0x04 ; 4 29e00: 60 e8 ldi r22, 0x80 ; 128 29e02: 96 07 cpc r25, r22 29e04: 09 f4 brne .+2 ; 0x29e08 29e06: 67 c0 rjmp .+206 ; 0x29ed6 29e08: 85 30 cpi r24, 0x05 ; 5 29e0a: 20 e8 ldi r18, 0x80 ; 128 29e0c: 92 07 cpc r25, r18 29e0e: 61 f7 brne .-40 ; 0x29de8 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); 29e10: 84 e2 ldi r24, 0x24 ; 36 29e12: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29e14: 8a 30 cpi r24, 0x0A ; 10 29e16: 40 e8 ldi r20, 0x80 ; 128 29e18: 94 07 cpc r25, r20 29e1a: 09 f4 brne .+2 ; 0x29e1e 29e1c: 5e c0 rjmp .+188 ; 0x29eda 29e1e: 58 f4 brcc .+22 ; 0x29e36 29e20: 88 30 cpi r24, 0x08 ; 8 29e22: 20 e8 ldi r18, 0x80 ; 128 29e24: 92 07 cpc r25, r18 29e26: 09 f4 brne .+2 ; 0x29e2a 29e28: 6e c0 rjmp .+220 ; 0x29f06 29e2a: 89 30 cpi r24, 0x09 ; 9 29e2c: 40 e8 ldi r20, 0x80 ; 128 29e2e: 94 07 cpc r25, r20 29e30: d9 f6 brne .-74 ; 0x29de8 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); 29e32: 85 e0 ldi r24, 0x05 ; 5 29e34: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29e36: 8c 30 cpi r24, 0x0C ; 12 29e38: 60 e8 ldi r22, 0x80 ; 128 29e3a: 96 07 cpc r25, r22 29e3c: 09 f4 brne .+2 ; 0x29e40 29e3e: 51 c0 rjmp .+162 ; 0x29ee2 29e40: 8d 30 cpi r24, 0x0D ; 13 29e42: 20 e8 ldi r18, 0x80 ; 128 29e44: 92 07 cpc r25, r18 29e46: 81 f6 brne .-96 ; 0x29de8 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); 29e48: 81 e2 ldi r24, 0x21 ; 33 29e4a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29e4c: 8f 32 cpi r24, 0x2F ; 47 29e4e: 40 e8 ldi r20, 0x80 ; 128 29e50: 94 07 cpc r25, r20 29e52: 09 f4 brne .+2 ; 0x29e56 29e54: 56 c0 rjmp .+172 ; 0x29f02 29e56: e0 f4 brcc .+56 ; 0x29e90 29e58: 8c 32 cpi r24, 0x2C ; 44 29e5a: 20 e8 ldi r18, 0x80 ; 128 29e5c: 92 07 cpc r25, r18 29e5e: 09 f4 brne .+2 ; 0x29e62 29e60: 4e c0 rjmp .+156 ; 0x29efe 29e62: 58 f4 brcc .+22 ; 0x29e7a 29e64: 8a 32 cpi r24, 0x2A ; 42 29e66: 60 e8 ldi r22, 0x80 ; 128 29e68: 96 07 cpc r25, r22 29e6a: c9 f1 breq .+114 ; 0x29ede 29e6c: 8b 32 cpi r24, 0x2B ; 43 29e6e: 20 e8 ldi r18, 0x80 ; 128 29e70: 92 07 cpc r25, r18 29e72: 09 f0 breq .+2 ; 0x29e76 29e74: b9 cf rjmp .-142 ; 0x29de8 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); 29e76: 86 e2 ldi r24, 0x26 ; 38 29e78: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29e7a: 8d 32 cpi r24, 0x2D ; 45 29e7c: 40 e8 ldi r20, 0x80 ; 128 29e7e: 94 07 cpc r25, r20 29e80: d1 f1 breq .+116 ; 0x29ef6 29e82: 8e 32 cpi r24, 0x2E ; 46 29e84: 60 e8 ldi r22, 0x80 ; 128 29e86: 96 07 cpc r25, r22 29e88: 09 f0 breq .+2 ; 0x29e8c 29e8a: ae cf rjmp .-164 ; 0x29de8 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); 29e8c: 82 e2 ldi r24, 0x22 ; 34 29e8e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29e90: 87 38 cpi r24, 0x87 ; 135 29e92: 20 e8 ldi r18, 0x80 ; 128 29e94: 92 07 cpc r25, r18 29e96: 49 f1 breq .+82 ; 0x29eea 29e98: 58 f4 brcc .+22 ; 0x29eb0 29e9a: 87 34 cpi r24, 0x47 ; 71 29e9c: 60 e8 ldi r22, 0x80 ; 128 29e9e: 96 07 cpc r25, r22 29ea0: 29 f0 breq .+10 ; 0x29eac 29ea2: 8b 34 cpi r24, 0x4B ; 75 29ea4: 20 e8 ldi r18, 0x80 ; 128 29ea6: 92 07 cpc r25, r18 29ea8: 09 f0 breq .+2 ; 0x29eac 29eaa: 9e cf rjmp .-196 ; 0x29de8 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); 29eac: 84 e0 ldi r24, 0x04 ; 4 29eae: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29eb0: 87 30 cpi r24, 0x07 ; 7 29eb2: 41 e8 ldi r20, 0x81 ; 129 29eb4: 94 07 cpc r25, r20 29eb6: d9 f0 breq .+54 ; 0x29eee 29eb8: 8b 30 cpi r24, 0x0B ; 11 29eba: 61 e8 ldi r22, 0x81 ; 129 29ebc: 96 07 cpc r25, r22 29ebe: c9 f0 breq .+50 ; 0x29ef2 29ec0: 8b 38 cpi r24, 0x8B ; 139 29ec2: 20 e8 ldi r18, 0x80 ; 128 29ec4: 92 07 cpc r25, r18 29ec6: 09 f0 breq .+2 ; 0x29eca 29ec8: 8f cf rjmp .-226 ; 0x29de8 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); 29eca: 89 e0 ldi r24, 0x09 ; 9 29ecc: 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); 29ece: 81 e0 ldi r24, 0x01 ; 1 29ed0: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 29ed2: 82 e0 ldi r24, 0x02 ; 2 29ed4: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 29ed6: 83 e0 ldi r24, 0x03 ; 3 29ed8: 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); 29eda: 86 e0 ldi r24, 0x06 ; 6 29edc: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 29ede: 87 e0 ldi r24, 0x07 ; 7 29ee0: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 29ee2: 8a e2 ldi r24, 0x2A ; 42 29ee4: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 29ee6: 8b e2 ldi r24, 0x2B ; 43 29ee8: 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); 29eea: 88 e0 ldi r24, 0x08 ; 8 29eec: 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); 29eee: 8a e0 ldi r24, 0x0A ; 10 29ef0: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 29ef2: 8b e0 ldi r24, 0x0B ; 11 29ef4: 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); 29ef6: 83 e2 ldi r24, 0x23 ; 35 29ef8: 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); 29efa: 85 e2 ldi r24, 0x25 ; 37 29efc: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 29efe: 87 e2 ldi r24, 0x27 ; 39 29f00: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 29f02: 88 e2 ldi r24, 0x28 ; 40 29f04: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 29f06: 89 e2 ldi r24, 0x29 ; 41 29f08: 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)) { 29f0a: 87 ff sbrs r24, 7 29f0c: 07 c0 rjmp .+14 ; 0x29f1c 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); 29f0e: 22 27 eor r18, r18 29f10: 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) { 29f12: 21 15 cp r18, r1 29f14: 32 4c sbci r19, 0xC2 ; 194 29f16: a1 f5 brne .+104 ; 0x29f80 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 29f18: 8f e1 ldi r24, 0x1F ; 31 29f1a: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 29f1c: 22 27 eor r18, r18 29f1e: 31 70 andi r19, 0x01 ; 1 29f20: 90 ff sbrs r25, 0 29f22: 52 c0 rjmp .+164 ; 0x29fc8 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); 29f24: ac 01 movw r20, r24 29f26: 44 27 eor r20, r20 29f28: 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) { 29f2a: 41 15 cp r20, r1 29f2c: 52 4c sbci r21, 0xC2 ; 194 29f2e: 09 f0 breq .+2 ; 0x29f32 29f30: 4b c0 rjmp .+150 ; 0x29fc8 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 29f32: 80 e2 ldi r24, 0x20 ; 32 29f34: 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; 29f36: 9c 01 movw r18, r24 29f38: 22 27 eor r18, r18 29f3a: 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)) { 29f3c: 23 2b or r18, r19 29f3e: 09 f0 breq .+2 ; 0x29f42 29f40: 67 c0 rjmp .+206 ; 0x2a010 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; 29f42: 9c 01 movw r18, r24 29f44: 22 27 eor r18, r18 29f46: 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)) { 29f48: 23 2b or r18, r19 29f4a: 09 f0 breq .+2 ; 0x29f4e 29f4c: 63 c0 rjmp .+198 ; 0x2a014 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; 29f4e: 9c 01 movw r18, r24 29f50: 22 27 eor r18, r18 29f52: 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)) { 29f54: 23 2b or r18, r19 29f56: 09 f0 breq .+2 ; 0x29f5a 29f58: 5f c0 rjmp .+190 ; 0x2a018 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; 29f5a: 9c 01 movw r18, r24 29f5c: 22 27 eor r18, r18 29f5e: 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)) { 29f60: 23 2b or r18, r19 29f62: 09 f0 breq .+2 ; 0x29f66 29f64: 5b c0 rjmp .+182 ; 0x2a01c 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; 29f66: 9c 01 movw r18, r24 29f68: 22 27 eor r18, r18 29f6a: 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)) { 29f6c: 23 2b or r18, r19 29f6e: 09 f0 breq .+2 ; 0x29f72 29f70: 57 c0 rjmp .+174 ; 0x2a020 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; 29f72: 88 27 eor r24, r24 29f74: 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)) { 29f76: 89 2b or r24, r25 29f78: 09 f4 brne .+2 ; 0x29f7c 29f7a: 68 c0 rjmp .+208 ; 0x2a04c return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 29f7c: 8f e0 ldi r24, 0x0F ; 15 29f7e: 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; 29f80: 9c 01 movw r18, r24 29f82: 22 27 eor r18, r18 29f84: 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)) { 29f86: 23 2b or r18, r19 29f88: 09 f0 breq .+2 ; 0x29f8c 29f8a: 4c c0 rjmp .+152 ; 0x2a024 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; 29f8c: 9c 01 movw r18, r24 29f8e: 22 27 eor r18, r18 29f90: 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)) { 29f92: 23 2b or r18, r19 29f94: 09 f0 breq .+2 ; 0x29f98 29f96: 48 c0 rjmp .+144 ; 0x2a028 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; 29f98: 9c 01 movw r18, r24 29f9a: 22 27 eor r18, r18 29f9c: 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)) { 29f9e: 23 2b or r18, r19 29fa0: 09 f0 breq .+2 ; 0x29fa4 29fa2: 44 c0 rjmp .+136 ; 0x2a02c 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; 29fa4: 9c 01 movw r18, r24 29fa6: 22 27 eor r18, r18 29fa8: 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)) { 29faa: 23 2b or r18, r19 29fac: 09 f0 breq .+2 ; 0x29fb0 29fae: 40 c0 rjmp .+128 ; 0x2a030 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; 29fb0: 9c 01 movw r18, r24 29fb2: 22 27 eor r18, r18 29fb4: 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)) { 29fb6: 23 2b or r18, r19 29fb8: e9 f5 brne .+122 ; 0x2a034 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; 29fba: 88 27 eor r24, r24 29fbc: 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)) { 29fbe: 89 2b or r24, r25 29fc0: 09 f4 brne .+2 ; 0x29fc4 29fc2: 44 c0 rjmp .+136 ; 0x2a04c return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 29fc4: 80 e1 ldi r24, 0x10 ; 16 29fc6: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 29fc8: 23 2b or r18, r19 29fca: 09 f4 brne .+2 ; 0x29fce 29fcc: 3f c0 rjmp .+126 ; 0x2a04c 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; 29fce: 9c 01 movw r18, r24 29fd0: 22 27 eor r18, r18 29fd2: 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)) { 29fd4: 23 2b or r18, r19 29fd6: 81 f5 brne .+96 ; 0x2a038 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; 29fd8: 9c 01 movw r18, r24 29fda: 22 27 eor r18, r18 29fdc: 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)) { 29fde: 23 2b or r18, r19 29fe0: 69 f5 brne .+90 ; 0x2a03c 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; 29fe2: 9c 01 movw r18, r24 29fe4: 22 27 eor r18, r18 29fe6: 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)) { 29fe8: 23 2b or r18, r19 29fea: 51 f5 brne .+84 ; 0x2a040 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; 29fec: 9c 01 movw r18, r24 29fee: 22 27 eor r18, r18 29ff0: 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)) { 29ff2: 23 2b or r18, r19 29ff4: 39 f5 brne .+78 ; 0x2a044 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; 29ff6: 9c 01 movw r18, r24 29ff8: 22 27 eor r18, r18 29ffa: 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)) { 29ffc: 23 2b or r18, r19 29ffe: 21 f5 brne .+72 ; 0x2a048 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; 2a000: 88 27 eor r24, r24 2a002: 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)) { 2a004: 89 2b or r24, r25 2a006: 11 f1 breq .+68 ; 0x2a04c return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 2a008: 81 e1 ldi r24, 0x11 ; 17 2a00a: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 2a00c: 80 e0 ldi r24, 0x00 ; 0 2a00e: 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); 2a010: 82 e1 ldi r24, 0x12 ; 18 2a012: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 2a014: 85 e1 ldi r24, 0x15 ; 21 2a016: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 2a018: 88 e1 ldi r24, 0x18 ; 24 2a01a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 2a01c: 8b e1 ldi r24, 0x1B ; 27 2a01e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 2a020: 8c e0 ldi r24, 0x0C ; 12 2a022: 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); 2a024: 83 e1 ldi r24, 0x13 ; 19 2a026: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 2a028: 86 e1 ldi r24, 0x16 ; 22 2a02a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 2a02c: 89 e1 ldi r24, 0x19 ; 25 2a02e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 2a030: 8c e1 ldi r24, 0x1C ; 28 2a032: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 2a034: 8d e0 ldi r24, 0x0D ; 13 2a036: 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); 2a038: 84 e1 ldi r24, 0x14 ; 20 2a03a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 2a03c: 87 e1 ldi r24, 0x17 ; 23 2a03e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 2a040: 8a e1 ldi r24, 0x1A ; 26 2a042: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 2a044: 8d e1 ldi r24, 0x1D ; 29 2a046: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 2a048: 8e e0 ldi r24, 0x0E ; 14 2a04a: 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); 2a04c: 8c e2 ldi r24, 0x2C ; 44 } 2a04e: 08 95 ret 0002a050 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 2a050: cf 92 push r12 2a052: df 92 push r13 2a054: ef 92 push r14 2a056: ff 92 push r15 2a058: 0f 93 push r16 2a05a: 1f 93 push r17 2a05c: cf 93 push r28 2a05e: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 2a060: 20 91 d2 12 lds r18, 0x12D2 ; 0x8012d2 2a064: 30 91 d3 12 lds r19, 0x12D3 ; 0x8012d3 2a068: 21 30 cpi r18, 0x01 ; 1 2a06a: 31 05 cpc r19, r1 2a06c: 39 f4 brne .+14 ; 0x2a07c 2a06e: 20 91 fb 12 lds r18, 0x12FB ; 0x8012fb 2a072: 21 30 cpi r18, 0x01 ; 1 2a074: 19 f4 brne .+6 ; 0x2a07c // 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; 2a076: 22 e0 ldi r18, 0x02 ; 2 2a078: 20 93 89 04 sts 0x0489, r18 ; 0x800489 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 2a07c: 0f 94 d7 4e call 0x29dae ; 0x29dae 2a080: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 2a082: 80 91 89 04 lds r24, 0x0489 ; 0x800489 2a086: 81 30 cpi r24, 0x01 ; 1 2a088: 09 f4 brne .+2 ; 0x2a08c 2a08a: 64 c0 rjmp .+200 ; 0x2a154 2a08c: 60 f0 brcs .+24 ; 0x2a0a6 2a08e: 82 30 cpi r24, 0x02 ; 2 2a090: 09 f4 brne .+2 ; 0x2a094 2a092: f4 c0 rjmp .+488 ; 0x2a27c ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 2a094: df 91 pop r29 2a096: cf 91 pop r28 2a098: 1f 91 pop r17 2a09a: 0f 91 pop r16 2a09c: ff 90 pop r15 2a09e: ef 90 pop r14 2a0a0: df 90 pop r13 2a0a2: cf 90 pop r12 2a0a4: 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); 2a0a6: 84 e0 ldi r24, 0x04 ; 4 2a0a8: 80 93 78 02 sts 0x0278, r24 ; 0x800278 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); 2a0ac: 0d 2f mov r16, r29 2a0ae: 10 e0 ldi r17, 0x00 ; 0 2a0b0: f8 01 movw r30, r16 2a0b2: e9 5c subi r30, 0xC9 ; 201 2a0b4: f7 47 sbci r31, 0x77 ; 119 2a0b6: 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); 2a0b8: fc 2e mov r15, r28 2a0ba: f2 94 swap r15 2a0bc: 6f e0 ldi r22, 0x0F ; 15 2a0be: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 2a0c0: 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); 2a0c2: 80 e0 ldi r24, 0x00 ; 0 2a0c4: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_clear(); 2a0c8: 0e 94 f6 6f call 0xdfec ; 0xdfec // 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); 2a0cc: 00 0f add r16, r16 2a0ce: 11 1f adc r17, r17 2a0d0: f8 01 movw r30, r16 2a0d2: ec 59 subi r30, 0x9C ; 156 2a0d4: f7 47 sbci r31, 0x77 ; 119 2a0d6: c5 90 lpm r12, Z+ 2a0d8: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 2a0da: 00 5e subi r16, 0xE0 ; 224 2a0dc: 10 46 sbci r17, 0x60 ; 96 2a0de: f8 01 movw r30, r16 2a0e0: 85 91 lpm r24, Z+ 2a0e2: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 2a0e4: 0e 94 0a 75 call 0xea14 ; 0xea14 2a0e8: df 92 push r13 2a0ea: cf 92 push r12 2a0ec: 9f 93 push r25 2a0ee: 8f 93 push r24 2a0f0: 80 ed ldi r24, 0xD0 ; 208 2a0f2: 98 e8 ldi r25, 0x88 ; 136 2a0f4: 9f 93 push r25 2a0f6: 8f 93 push r24 2a0f8: 0e 94 db 6e call 0xddb6 ; 0xddb6 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)); 2a0fc: 4b ea ldi r20, 0xAB ; 171 2a0fe: 5f e9 ldi r21, 0x9F ; 159 2a100: 62 e0 ldi r22, 0x02 ; 2 2a102: 80 e0 ldi r24, 0x00 ; 0 2a104: 0e 94 d7 6f call 0xdfae ; 0xdfae 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()); 2a108: 0f 90 pop r0 2a10a: 0f 90 pop r0 2a10c: 0f 90 pop r0 2a10e: 0f 90 pop r0 2a110: 0f 90 pop r0 2a112: 0f 90 pop r0 2a114: f1 10 cpse r15, r1 2a116: c6 c0 rjmp .+396 ; 0x2a2a4 2a118: 10 e0 ldi r17, 0x00 ; 0 2a11a: 00 e0 ldi r16, 0x00 ; 0 2a11c: 42 e1 ldi r20, 0x12 ; 18 2a11e: e4 2e mov r14, r20 2a120: 5c ef ldi r21, 0xFC ; 252 2a122: c5 2e mov r12, r21 2a124: 59 e6 ldi r21, 0x69 ; 105 2a126: 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); 2a128: ec 2f mov r30, r28 2a12a: f0 e0 ldi r31, 0x00 ; 0 2a12c: ee 0f add r30, r30 2a12e: ff 1f adc r31, r31 2a130: e4 54 subi r30, 0x44 ; 68 2a132: f7 47 sbci r31, 0x77 ; 119 2a134: 85 91 lpm r24, Z+ 2a136: 94 91 lpm r25, Z 2a138: 0e 94 0a 75 call 0xea14 ; 0xea14 2a13c: bc 01 movw r22, r24 2a13e: 81 e0 ldi r24, 0x01 ; 1 2a140: f1 10 cpse r15, r1 2a142: 01 c0 rjmp .+2 ; 0x2a146 2a144: 80 e0 ldi r24, 0x00 ; 0 2a146: 2e 2d mov r18, r14 2a148: a6 01 movw r20, r12 2a14a: 0e 94 62 dd call 0x1bac4 ; 0x1bac4 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 2a14e: 81 e0 ldi r24, 0x01 ; 1 2a150: 80 93 89 04 sts 0x0489, r24 ; 0x800489 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 2a154: 81 e0 ldi r24, 0x01 ; 1 2a156: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.448> ReportErrorHookDynamicRender(); // Render dynamic characters 2a15a: 0f 94 f6 4d call 0x29bec ; 0x29bec sound_wait_for_user(); 2a15e: 0f 94 eb 25 call 0x24bd6 ; 0x24bd6 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); 2a162: 0d 2f mov r16, r29 2a164: 10 e0 ldi r17, 0x00 ; 0 2a166: f8 01 movw r30, r16 2a168: e9 5c subi r30, 0xC9 ; 201 2a16a: f7 47 sbci r31, 0x77 ; 119 2a16c: 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); 2a16e: dc 2f mov r29, r28 2a170: d2 95 swap r29 2a172: 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; 2a174: 80 91 81 04 lds r24, 0x0481 ; 0x800481 2a178: 81 11 cpse r24, r1 2a17a: 09 c0 rjmp .+18 ; 0x2a18e 2a17c: 81 e0 ldi r24, 0x01 ; 1 2a17e: d1 11 cpse r29, r1 2a180: 01 c0 rjmp .+2 ; 0x2a184 2a182: 80 e0 ldi r24, 0x00 ; 0 2a184: 80 93 80 04 sts 0x0480, r24 ; 0x800480 2a188: 81 e0 ldi r24, 0x01 ; 1 2a18a: 80 93 81 04 sts 0x0481, r24 ; 0x800481 static int8_t choice_selected = -1; if (reset_button_selection) { 2a18e: 80 91 7f 04 lds r24, 0x047F ; 0x80047f 2a192: 88 23 and r24, r24 2a194: 41 f0 breq .+16 ; 0x2a1a6 // 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; 2a196: 81 e0 ldi r24, 0x01 ; 1 2a198: d1 11 cpse r29, r1 2a19a: 01 c0 rjmp .+2 ; 0x2a19e 2a19c: 80 e0 ldi r24, 0x00 ; 0 2a19e: 80 93 80 04 sts 0x0480, r24 ; 0x800480 choice_selected = -1; reset_button_selection = 0; 2a1a2: 10 92 7f 04 sts 0x047F, r1 ; 0x80047f } // Check if knob was rotated if (lcd_encoder) { 2a1a6: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 2a1aa: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 2a1ae: 21 15 cp r18, r1 2a1b0: 31 05 cpc r19, r1 2a1b2: b9 f1 breq .+110 ; 0x2a222 2a1b4: 80 91 80 04 lds r24, 0x0480 ; 0x800480 if (two_choices == false) { // third_choice is not nullptr, safe to dereference 2a1b8: dd 23 and r29, r29 2a1ba: 61 f0 breq .+24 ; 0x2a1d4 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2a1bc: 37 ff sbrs r19, 7 2a1be: 06 c0 rjmp .+12 ; 0x2a1cc 2a1c0: 88 23 and r24, r24 2a1c2: 69 f0 breq .+26 ; 0x2a1de // Rotating knob counter clockwise current_selection--; 2a1c4: 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; 2a1c6: 80 93 80 04 sts 0x0480, r24 ; 0x800480 2a1ca: 09 c0 rjmp .+18 ; 0x2a1de 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) { 2a1cc: 82 30 cpi r24, 0x02 ; 2 2a1ce: 39 f0 breq .+14 ; 0x2a1de // Rotating knob clockwise current_selection++; 2a1d0: 8f 5f subi r24, 0xFF ; 255 2a1d2: f9 cf rjmp .-14 ; 0x2a1c6 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2a1d4: 37 ff sbrs r19, 7 2a1d6: 41 c0 rjmp .+130 ; 0x2a25a 2a1d8: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 2a1da: 10 92 80 04 sts 0x0480, r1 ; 0x800480 //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 2a1de: 80 91 80 04 lds r24, 0x0480 ; 0x800480 2a1e2: 4e e3 ldi r20, 0x3E ; 62 2a1e4: 81 11 cpse r24, r1 2a1e6: 40 e2 ldi r20, 0x20 ; 32 2a1e8: 63 e0 ldi r22, 0x03 ; 3 2a1ea: 80 e0 ldi r24, 0x00 ; 0 2a1ec: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 2a1f0: 80 91 80 04 lds r24, 0x0480 ; 0x800480 if (two_choices == false) 2a1f4: dd 23 and r29, r29 2a1f6: b1 f1 breq .+108 ; 0x2a264 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2a1f8: 4e e3 ldi r20, 0x3E ; 62 2a1fa: 81 30 cpi r24, 0x01 ; 1 2a1fc: 09 f0 breq .+2 ; 0x2a200 2a1fe: 40 e2 ldi r20, 0x20 ; 32 2a200: 63 e0 ldi r22, 0x03 ; 3 2a202: 89 e0 ldi r24, 0x09 ; 9 2a204: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 2a208: 80 91 80 04 lds r24, 0x0480 ; 0x800480 2a20c: 82 30 cpi r24, 0x02 ; 2 2a20e: 61 f5 brne .+88 ; 0x2a268 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2a210: 4e e3 ldi r20, 0x3E ; 62 2a212: 63 e0 ldi r22, 0x03 ; 3 2a214: 82 e1 ldi r24, 0x12 ; 18 2a216: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 } // Consume rotation event lcd_encoder = 0; 2a21a: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 2a21e: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } // Check if knob was clicked and consume the event if (lcd_clicked()) { 2a222: 0e 94 45 73 call 0xe68a ; 0xe68a 2a226: 88 23 and r24, r24 2a228: 09 f4 brne .+2 ; 0x2a22c 2a22a: 34 cf rjmp .-408 ; 0x2a094 choice_selected = current_selection; 2a22c: 80 91 80 04 lds r24, 0x0480 ; 0x800480 } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 2a230: d1 11 cpse r29, r1 2a232: 1c c0 rjmp .+56 ; 0x2a26c 2a234: 81 30 cpi r24, 0x01 ; 1 2a236: 89 f5 brne .+98 ; 0x2a29a 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); 2a238: f8 01 movw r30, r16 2a23a: ee 0f add r30, r30 2a23c: ff 1f adc r31, r31 2a23e: e3 52 subi r30, 0x23 ; 35 2a240: f8 47 sbci r31, 0x78 ; 120 2a242: 85 91 lpm r24, Z+ 2a244: 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))); 2a246: 0e 94 0a 75 call 0xea14 ; 0xea14 2a24a: 0e 94 85 e8 call 0x1d10a ; 0x1d10a SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a24e: 81 e0 ldi r24, 0x01 ; 1 2a250: 80 93 7f 04 sts 0x047F, r24 ; 0x80047f 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; 2a254: 10 92 89 04 sts 0x0489, r1 ; 0x800489 2a258: 1d cf rjmp .-454 ; 0x2a094 } } 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) { 2a25a: 81 30 cpi r24, 0x01 ; 1 2a25c: 09 f4 brne .+2 ; 0x2a260 2a25e: bf cf rjmp .-130 ; 0x2a1de // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 2a260: 81 e0 ldi r24, 0x01 ; 1 2a262: b1 cf rjmp .-158 ; 0x2a1c6 { 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 ? '>': ' '); 2a264: 81 30 cpi r24, 0x01 ; 1 2a266: a1 f2 breq .-88 ; 0x2a210 2a268: 40 e2 ldi r20, 0x20 ; 32 2a26a: d3 cf rjmp .-90 ; 0x2a212 // 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 2a26c: 82 30 cpi r24, 0x02 ; 2 2a26e: 21 f3 breq .-56 ; 0x2a238 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 2a270: 81 30 cpi r24, 0x01 ; 1 2a272: 99 f4 brne .+38 ; 0x2a29a return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 2a274: d0 93 44 0d sts 0x0D44, r29 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a278: 80 93 7f 04 sts 0x047F, r24 ; 0x80047f // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 2a27c: 81 e0 ldi r24, 0x01 ; 1 2a27e: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_return_to_status(); 2a282: 0f 94 6d 05 call 0x20ada ; 0x20ada 2a286: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL10beep_timer.lto_priv.499> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 2a28a: 10 92 c1 04 sts 0x04C1, r1 ; 0x8004c1 <_ZL6bFirst.lto_priv.500> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 2a28e: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.448> KEEPALIVE_STATE(IN_HANDLER); 2a292: 82 e0 ldi r24, 0x02 ; 2 2a294: 80 93 78 02 sts 0x0278, r24 ; 0x800278 2a298: dd cf rjmp .-70 ; 0x2a254 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); 2a29a: cf 70 andi r28, 0x0F ; 15 2a29c: c0 93 44 0d sts 0x0D44, r28 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a2a0: 81 e0 ldi r24, 0x01 ; 1 2a2a2: ea cf rjmp .-44 ; 0x2a278 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); 2a2a4: ef 2d mov r30, r15 2a2a6: f0 e0 ldi r31, 0x00 ; 0 2a2a8: ee 0f add r30, r30 2a2aa: ff 1f adc r31, r31 2a2ac: e4 54 subi r30, 0x44 ; 68 2a2ae: f7 47 sbci r31, 0x77 ; 119 2a2b0: 85 91 lpm r24, Z+ 2a2b2: 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()); 2a2b4: 0e 94 0a 75 call 0xea14 ; 0xea14 2a2b8: 6c 01 movw r12, r24 2a2ba: 0c ef ldi r16, 0xFC ; 252 2a2bc: 19 e6 ldi r17, 0x69 ; 105 2a2be: 99 e0 ldi r25, 0x09 ; 9 2a2c0: e9 2e mov r14, r25 2a2c2: 32 cf rjmp .-412 ; 0x2a128 0002a2c4 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 2a2c4: 0f 94 d7 4e call 0x29dae ; 0x29dae // 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); 2a2c8: e8 2f mov r30, r24 2a2ca: f0 e0 ldi r31, 0x00 ; 0 2a2cc: ee 0f add r30, r30 2a2ce: ff 1f adc r31, r31 2a2d0: ec 59 subi r30, 0x9C ; 156 2a2d2: f7 47 sbci r31, 0x77 ; 119 2a2d4: 25 91 lpm r18, Z+ 2a2d6: 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) ) { 2a2d8: 23 33 cpi r18, 0x33 ; 51 2a2da: 81 e0 ldi r24, 0x01 ; 1 2a2dc: 38 07 cpc r19, r24 2a2de: 08 f0 brcs .+2 ; 0x2a2e2 2a2e0: 41 c0 rjmp .+130 ; 0x2a364 2a2e2: 2d 32 cpi r18, 0x2D ; 45 2a2e4: 81 e0 ldi r24, 0x01 ; 1 2a2e6: 38 07 cpc r19, r24 2a2e8: 78 f5 brcc .+94 ; 0x2a348 2a2ea: 2e 37 cpi r18, 0x7E ; 126 2a2ec: 31 05 cpc r19, r1 2a2ee: 09 f4 brne .+2 ; 0x2a2f2 2a2f0: 83 c0 rjmp .+262 ; 0x2a3f8 2a2f2: f0 f4 brcc .+60 ; 0x2a330 2a2f4: 2c 36 cpi r18, 0x6C ; 108 2a2f6: 31 05 cpc r19, r1 2a2f8: 09 f4 brne .+2 ; 0x2a2fc 2a2fa: 85 c0 rjmp .+266 ; 0x2a406 2a2fc: 30 f4 brcc .+12 ; 0x2a30a 2a2fe: 25 36 cpi r18, 0x65 ; 101 2a300: 31 05 cpc r19, r1 2a302: 08 f0 brcs .+2 ; 0x2a306 2a304: 79 c0 rjmp .+242 ; 0x2a3f8 default: break; } return Buttons::NoButton; 2a306: 8f ef ldi r24, 0xFF ; 255 2a308: 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) ) { 2a30a: 24 37 cpi r18, 0x74 ; 116 2a30c: 31 05 cpc r19, r1 2a30e: 09 f4 brne .+2 ; 0x2a312 2a310: 73 c0 rjmp .+230 ; 0x2a3f8 2a312: 2d 37 cpi r18, 0x7D ; 125 2a314: 31 05 cpc r19, r1 2a316: 19 f0 breq .+6 ; 0x2a31e 2a318: 23 37 cpi r18, 0x73 ; 115 2a31a: 31 05 cpc r19, r1 2a31c: a1 f7 brne .-24 ; 0x2a306 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 2a31e: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a322: 81 30 cpi r24, 0x01 ; 1 2a324: 09 f4 brne .+2 ; 0x2a328 2a326: 6d c0 rjmp .+218 ; 0x2a402 2a328: 87 30 cpi r24, 0x07 ; 7 2a32a: 69 f7 brne .-38 ; 0x2a306 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 2a32c: 88 e0 ldi r24, 0x08 ; 8 2a32e: 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) ) { 2a330: 23 3d cpi r18, 0xD3 ; 211 2a332: 31 05 cpc r19, r1 2a334: 09 f4 brne .+2 ; 0x2a338 2a336: 6e c0 rjmp .+220 ; 0x2a414 2a338: 50 f4 brcc .+20 ; 0x2a34e 2a33a: 29 3c cpi r18, 0xC9 ; 201 2a33c: 31 05 cpc r19, r1 2a33e: 09 f4 brne .+2 ; 0x2a342 2a340: 69 c0 rjmp .+210 ; 0x2a414 2a342: 2a 3c cpi r18, 0xCA ; 202 2a344: 31 05 cpc r19, r1 2a346: f9 f6 brne .-66 ; 0x2a306 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) { 2a348: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a34c: 67 c0 rjmp .+206 ; 0x2a41c // 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) ) { 2a34e: 2d 3d cpi r18, 0xDD ; 221 2a350: 31 05 cpc r19, r1 2a352: 09 f4 brne .+2 ; 0x2a356 2a354: 5f c0 rjmp .+190 ; 0x2a414 2a356: 2e 3d cpi r18, 0xDE ; 222 2a358: 31 05 cpc r19, r1 2a35a: b1 f3 breq .-20 ; 0x2a348 2a35c: 24 3d cpi r18, 0xD4 ; 212 2a35e: 31 05 cpc r19, r1 2a360: 91 f6 brne .-92 ; 0x2a306 2a362: f2 cf rjmp .-28 ; 0x2a348 2a364: 25 3f cpi r18, 0xF5 ; 245 2a366: 81 e0 ldi r24, 0x01 ; 1 2a368: 38 07 cpc r19, r24 2a36a: 09 f4 brne .+2 ; 0x2a36e 2a36c: 5c c0 rjmp .+184 ; 0x2a426 2a36e: f8 f4 brcc .+62 ; 0x2a3ae 2a370: 26 34 cpi r18, 0x46 ; 70 2a372: 81 e0 ldi r24, 0x01 ; 1 2a374: 38 07 cpc r19, r24 2a376: 58 f4 brcc .+22 ; 0x2a38e 2a378: 21 34 cpi r18, 0x41 ; 65 2a37a: 81 e0 ldi r24, 0x01 ; 1 2a37c: 38 07 cpc r19, r24 2a37e: 20 f7 brcc .-56 ; 0x2a348 2a380: 27 53 subi r18, 0x37 ; 55 2a382: 31 40 sbci r19, 0x01 ; 1 2a384: 25 30 cpi r18, 0x05 ; 5 2a386: 31 05 cpc r19, r1 2a388: 08 f0 brcs .+2 ; 0x2a38c 2a38a: bd cf rjmp .-134 ; 0x2a306 2a38c: dd cf rjmp .-70 ; 0x2a348 2a38e: 21 59 subi r18, 0x91 ; 145 2a390: 31 40 sbci r19, 0x01 ; 1 2a392: 22 30 cpi r18, 0x02 ; 2 2a394: 31 05 cpc r19, r1 2a396: 08 f0 brcs .+2 ; 0x2a39a 2a398: b6 cf rjmp .-148 ; 0x2a306 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 2a39a: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a39e: 83 30 cpi r24, 0x03 ; 3 2a3a0: 09 f4 brne .+2 ; 0x2a3a4 2a3a2: 3f c0 rjmp .+126 ; 0x2a422 2a3a4: 89 30 cpi r24, 0x09 ; 9 2a3a6: 09 f0 breq .+2 ; 0x2a3aa 2a3a8: ae cf rjmp .-164 ; 0x2a306 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 2a3aa: 87 e0 ldi r24, 0x07 ; 7 2a3ac: 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) ) { 2a3ae: 29 3f cpi r18, 0xF9 ; 249 2a3b0: 81 e0 ldi r24, 0x01 ; 1 2a3b2: 38 07 cpc r19, r24 2a3b4: 49 f2 breq .-110 ; 0x2a348 2a3b6: 70 f4 brcc .+28 ; 0x2a3d4 2a3b8: 27 3f cpi r18, 0xF7 ; 247 2a3ba: 81 e0 ldi r24, 0x01 ; 1 2a3bc: 38 07 cpc r19, r24 2a3be: 21 f2 breq .-120 ; 0x2a348 2a3c0: 60 f7 brcc .-40 ; 0x2a39a break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 2a3c2: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a3c6: 83 30 cpi r24, 0x03 ; 3 2a3c8: 61 f1 breq .+88 ; 0x2a422 2a3ca: 88 30 cpi r24, 0x08 ; 8 2a3cc: 09 f0 breq .+2 ; 0x2a3d0 2a3ce: 9b cf rjmp .-202 ; 0x2a306 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 2a3d0: 86 e0 ldi r24, 0x06 ; 6 2a3d2: 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) ) { 2a3d4: 2b 3f cpi r18, 0xFB ; 251 2a3d6: 81 e0 ldi r24, 0x01 ; 1 2a3d8: 38 07 cpc r19, r24 2a3da: a9 f0 breq .+42 ; 0x2a406 2a3dc: 68 f0 brcs .+26 ; 0x2a3f8 2a3de: 2c 3f cpi r18, 0xFC ; 252 2a3e0: 31 40 sbci r19, 0x01 ; 1 2a3e2: 09 f0 breq .+2 ; 0x2a3e6 2a3e4: 90 cf rjmp .-224 ; 0x2a306 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 2a3e6: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a3ea: 85 30 cpi r24, 0x05 ; 5 2a3ec: 89 f0 breq .+34 ; 0x2a410 2a3ee: 86 30 cpi r24, 0x06 ; 6 2a3f0: 09 f0 breq .+2 ; 0x2a3f4 2a3f2: 89 cf rjmp .-238 ; 0x2a306 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 2a3f4: 85 e0 ldi r24, 0x05 ; 5 2a3f6: 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) { 2a3f8: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a3fc: 81 30 cpi r24, 0x01 ; 1 2a3fe: 09 f0 breq .+2 ; 0x2a402 2a400: 82 cf rjmp .-252 ; 0x2a306 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; 2a402: 81 e0 ldi r24, 0x01 ; 1 2a404: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 2a406: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a40a: 82 30 cpi r24, 0x02 ; 2 2a40c: d1 f3 breq .-12 ; 0x2a402 2a40e: 7b cf rjmp .-266 ; 0x2a306 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 2a410: 84 e0 ldi r24, 0x04 ; 4 2a412: 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) { 2a414: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a418: 82 30 cpi r24, 0x02 ; 2 2a41a: 61 f0 breq .+24 ; 0x2a434 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) { 2a41c: 83 30 cpi r24, 0x03 ; 3 2a41e: 09 f0 breq .+2 ; 0x2a422 2a420: 72 cf rjmp .-284 ; 0x2a306 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; 2a422: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 2a424: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 2a426: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 2a42a: 82 30 cpi r24, 0x02 ; 2 2a42c: 29 f0 breq .+10 ; 0x2a438 2a42e: 84 30 cpi r24, 0x04 ; 4 2a430: 09 f0 breq .+2 ; 0x2a434 2a432: 69 cf rjmp .-302 ; 0x2a306 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; 2a434: 82 e0 ldi r24, 0x02 ; 2 2a436: 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; 2a438: 80 e0 ldi r24, 0x00 ; 0 2a43a: 08 95 ret 0002a43c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.375]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 2a43c: cf 93 push r28 2a43e: df 93 push r29 2a440: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 2a442: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2a446: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2a44a: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2a44e: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2a452: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 2a456: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 2a45a: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 2a45e: c9 01 movw r24, r18 2a460: 86 1b sub r24, r22 2a462: 97 0b sbc r25, r23 2a464: 06 97 sbiw r24, 0x06 ; 6 2a466: 24 f0 brlt .+8 ; 0x2a470 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.375]+0x34> void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 2a468: ce 01 movw r24, r28 2a46a: 0e 94 7f 8c call 0x118fe ; 0x118fe 2a46e: e9 cf rjmp .-46 ; 0x2a442 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.375]+0x6> f(); safe_delay_keep_alive(delay); } } 2a470: df 91 pop r29 2a472: cf 91 pop r28 2a474: 08 95 ret 0002a476 : } //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) { 2a476: cf 93 push r28 2a478: df 93 push r29 2a47a: 00 d0 rcall .+0 ; 0x2a47c 2a47c: 00 d0 rcall .+0 ; 0x2a47e 2a47e: 1f 92 push r1 2a480: cd b7 in r28, 0x3d ; 61 2a482: 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)) 2a484: 87 30 cpi r24, 0x07 ; 7 2a486: 50 f5 brcc .+84 ; 0x2a4dc 2a488: 67 30 cpi r22, 0x07 ; 7 2a48a: 40 f5 brcc .+80 ; 0x2a4dc return false; uint8_t valid_points_mask[7] = { 2a48c: 97 e0 ldi r25, 0x07 ; 7 2a48e: ed eb ldi r30, 0xBD ; 189 2a490: f2 e0 ldi r31, 0x02 ; 2 2a492: de 01 movw r26, r28 2a494: 11 96 adiw r26, 0x01 ; 1 2a496: 01 90 ld r0, Z+ 2a498: 0d 92 st X+, r0 2a49a: 9a 95 dec r25 2a49c: e1 f7 brne .-8 ; 0x2a496 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 2a49e: 46 e0 ldi r20, 0x06 ; 6 2a4a0: 50 e0 ldi r21, 0x00 ; 0 2a4a2: fa 01 movw r30, r20 2a4a4: e6 1b sub r30, r22 2a4a6: f1 09 sbc r31, r1 2a4a8: 21 e0 ldi r18, 0x01 ; 1 2a4aa: 30 e0 ldi r19, 0x00 ; 0 2a4ac: 2c 0f add r18, r28 2a4ae: 3d 1f adc r19, r29 2a4b0: e2 0f add r30, r18 2a4b2: f3 1f adc r31, r19 2a4b4: 20 81 ld r18, Z 2a4b6: 30 e0 ldi r19, 0x00 ; 0 2a4b8: 48 1b sub r20, r24 2a4ba: 51 09 sbc r21, r1 2a4bc: c9 01 movw r24, r18 2a4be: 02 c0 rjmp .+4 ; 0x2a4c4 2a4c0: 95 95 asr r25 2a4c2: 87 95 ror r24 2a4c4: 4a 95 dec r20 2a4c6: e2 f7 brpl .-8 ; 0x2a4c0 2a4c8: 81 70 andi r24, 0x01 ; 1 } 2a4ca: 27 96 adiw r28, 0x07 ; 7 2a4cc: 0f b6 in r0, 0x3f ; 63 2a4ce: f8 94 cli 2a4d0: de bf out 0x3e, r29 ; 62 2a4d2: 0f be out 0x3f, r0 ; 63 2a4d4: cd bf out 0x3d, r28 ; 61 2a4d6: df 91 pop r29 2a4d8: cf 91 pop r28 2a4da: 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; 2a4dc: 80 e0 ldi r24, 0x00 ; 0 2a4de: f5 cf rjmp .-22 ; 0x2a4ca 0002a4e0 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 2a4e0: 0f 93 push r16 2a4e2: 1f 93 push r17 2a4e4: cf 93 push r28 2a4e6: df 93 push r29 2a4e8: 00 d0 rcall .+0 ; 0x2a4ea 2a4ea: 1f 92 push r1 2a4ec: cd b7 in r28, 0x3d ; 61 2a4ee: de b7 in r29, 0x3e ; 62 2a4f0: 9b 01 movw r18, r22 2a4f2: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 2a4f4: 01 e6 ldi r16, 0x61 ; 97 2a4f6: 12 e1 ldi r17, 0x12 ; 18 2a4f8: f8 01 movw r30, r16 2a4fa: 60 85 ldd r22, Z+8 ; 0x08 2a4fc: 71 85 ldd r23, Z+9 ; 0x09 2a4fe: 82 85 ldd r24, Z+10 ; 0x0a 2a500: 93 85 ldd r25, Z+11 ; 0x0b 2a502: 69 83 std Y+1, r22 ; 0x01 2a504: 7a 83 std Y+2, r23 ; 0x02 2a506: 8b 83 std Y+3, r24 ; 0x03 2a508: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 2a50a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2a50e: f8 01 movw r30, r16 2a510: 60 87 std Z+8, r22 ; 0x08 2a512: 71 87 std Z+9, r23 ; 0x09 2a514: 82 87 std Z+10, r24 ; 0x0a 2a516: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 2a518: 65 e5 ldi r22, 0x55 ; 85 2a51a: 75 e5 ldi r23, 0x55 ; 85 2a51c: 85 e5 ldi r24, 0x55 ; 85 2a51e: 91 e4 ldi r25, 0x41 ; 65 2a520: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 2a524: 0f 94 b0 18 call 0x23160 ; 0x23160 current_position[Z_AXIS] = curpos_z; 2a528: 89 81 ldd r24, Y+1 ; 0x01 2a52a: 9a 81 ldd r25, Y+2 ; 0x02 2a52c: ab 81 ldd r26, Y+3 ; 0x03 2a52e: bc 81 ldd r27, Y+4 ; 0x04 2a530: f8 01 movw r30, r16 2a532: 80 87 std Z+8, r24 ; 0x08 2a534: 91 87 std Z+9, r25 ; 0x09 2a536: a2 87 std Z+10, r26 ; 0x0a 2a538: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 2a53a: ce 01 movw r24, r28 2a53c: 01 96 adiw r24, 0x01 ; 1 2a53e: 0f 94 95 3a call 0x2752a ; 0x2752a } 2a542: 0f 90 pop r0 2a544: 0f 90 pop r0 2a546: 0f 90 pop r0 2a548: 0f 90 pop r0 2a54a: df 91 pop r29 2a54c: cf 91 pop r28 2a54e: 1f 91 pop r17 2a550: 0f 91 pop r16 2a552: 08 95 ret 0002a554 : 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])); 2a554: 60 91 26 06 lds r22, 0x0626 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.453> 2a558: 70 91 27 06 lds r23, 0x0627 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.453+0x1> 2a55c: 07 2e mov r0, r23 2a55e: 00 0c add r0, r0 2a560: 88 0b sbc r24, r24 2a562: 99 0b sbc r25, r25 2a564: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2a568: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 2a56c: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 2a570: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 2a574: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 2a578: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 2a57c: 0f 94 70 52 call 0x2a4e0 ; 0x2a4e0 babystepLoadZ = 0; 2a580: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.453+0x1> 2a584: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.453> } 2a588: 08 95 ret 0002a58a : // 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() { 2a58a: 2f 92 push r2 2a58c: 3f 92 push r3 2a58e: 4f 92 push r4 2a590: 5f 92 push r5 2a592: 6f 92 push r6 2a594: 7f 92 push r7 2a596: 8f 92 push r8 2a598: 9f 92 push r9 2a59a: af 92 push r10 2a59c: bf 92 push r11 2a59e: cf 92 push r12 2a5a0: df 92 push r13 2a5a2: ef 92 push r14 2a5a4: ff 92 push r15 2a5a6: 0f 93 push r16 2a5a8: 1f 93 push r17 2a5aa: cf 93 push r28 2a5ac: df 93 push r29 2a5ae: 00 d0 rcall .+0 ; 0x2a5b0 2a5b0: 00 d0 rcall .+0 ; 0x2a5b2 2a5b2: cd b7 in r28, 0x3d ; 61 2a5b4: de b7 in r29, 0x3e ; 62 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2a5b6: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.388> 2a5ba: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 2a5bc: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif bool endstops_enabled = enable_endstops(false); bool endstop_z_enabled = enable_z_endstop(false); 2a5c0: 80 e0 ldi r24, 0x00 ; 0 2a5c2: 0f 94 3d 23 call 0x2467a ; 0x2467a 2a5c6: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 2a5c8: 0e 94 11 65 call 0xca22 ; 0xca22 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 2a5cc: 83 e5 ldi r24, 0x53 ; 83 2a5ce: 91 e6 ldi r25, 0x61 ; 97 2a5d0: 0e 94 0a 75 call 0xea14 ; 0xea14 2a5d4: 0e 94 9a de call 0x1bd34 ; 0x1bd34 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 2a5d8: 48 ef ldi r20, 0xF8 ; 248 2a5da: 59 e6 ldi r21, 0x69 ; 105 2a5dc: 63 e0 ldi r22, 0x03 ; 3 2a5de: 80 e0 ldi r24, 0x00 ; 0 2a5e0: 0e 94 d7 6f call 0xdfae ; 0xdfae 2a5e4: 81 e0 ldi r24, 0x01 ; 1 2a5e6: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.388> // 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; 2a5ea: 80 e0 ldi r24, 0x00 ; 0 2a5ec: 90 e0 ldi r25, 0x00 ; 0 2a5ee: a0 ea ldi r26, 0xA0 ; 160 2a5f0: b0 e4 ldi r27, 0x40 ; 64 2a5f2: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2a5f6: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 2a5fa: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 2a5fe: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/60); 2a602: 65 e5 ldi r22, 0x55 ; 85 2a604: 75 e5 ldi r23, 0x55 ; 85 2a606: 85 e5 ldi r24, 0x55 ; 85 2a608: 91 e4 ldi r25, 0x41 ; 65 2a60a: 0f 94 bc 4e call 0x29d78 ; 0x29d78 2a60e: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> check_Z_crash(); #endif enable_endstops(false); // Move XY to first point current_position[X_AXIS] = BED_X0; 2a612: 80 e0 ldi r24, 0x00 ; 0 2a614: 90 e0 ldi r25, 0x00 ; 0 2a616: a0 e8 ldi r26, 0x80 ; 128 2a618: bf e3 ldi r27, 0x3F ; 63 2a61a: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2a61e: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2a622: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2a626: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = BED_Y0; 2a62a: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2a62e: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2a632: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2a636: b0 93 68 12 sts 0x1268, r27 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 2a63a: 65 e6 ldi r22, 0x65 ; 101 2a63c: 72 e1 ldi r23, 0x12 ; 18 2a63e: 81 e6 ldi r24, 0x61 ; 97 2a640: 92 e1 ldi r25, 0x12 ; 18 2a642: 0e 94 ee 68 call 0xd1dc ; 0xd1dc go_to_current(homing_feedrate[X_AXIS]/60); 2a646: 60 e0 ldi r22, 0x00 ; 0 2a648: 70 e0 ldi r23, 0x00 ; 0 2a64a: 88 e4 ldi r24, 0x48 ; 72 2a64c: 92 e4 ldi r25, 0x42 ; 66 2a64e: 0f 94 bc 4e call 0x29d78 ; 0x29d78 set_destination_to_current(); 2a652: 0e 94 7e 66 call 0xccfc ; 0xccfc homeaxis(Z_AXIS); 2a656: 82 e0 ldi r24, 0x02 ; 2 2a658: 0f 94 6b 79 call 0x2f2d6 ; 0x2f2d6 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 2a65c: 43 e0 ldi r20, 0x03 ; 3 2a65e: 60 e0 ldi r22, 0x00 ; 0 2a660: 70 e0 ldi r23, 0x00 ; 0 2a662: 80 e2 ldi r24, 0x20 ; 32 2a664: 91 ec ldi r25, 0xC1 ; 193 2a666: 0f 94 aa 7b call 0x2f754 ; 0x2f754 2a66a: 81 11 cpse r24, r1 2a66c: 06 c0 rjmp .+12 ; 0x2a67a 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)); 2a66e: 80 ea ldi r24, 0xA0 ; 160 2a670: 95 e5 ldi r25, 0x55 ; 85 2a672: 0e 94 0a 75 call 0xea14 ; 0xea14 2a676: 0e 94 f3 82 call 0x105e6 ; 0x105e6 2a67a: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2a67e: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2a682: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2a686: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2a68a: 80 93 0a 13 sts 0x130A, r24 ; 0x80130a 2a68e: 90 93 0b 13 sts 0x130B, r25 ; 0x80130b 2a692: a0 93 0c 13 sts 0x130C, r26 ; 0x80130c 2a696: b0 93 0d 13 sts 0x130D, r27 ; 0x80130d 2a69a: e2 e0 ldi r30, 0x02 ; 2 2a69c: f0 e0 ldi r31, 0x00 ; 0 2a69e: fa 83 std Y+2, r31 ; 0x02 2a6a0: 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; 2a6a2: c1 2c mov r12, r1 2a6a4: d1 2c mov r13, r1 2a6a6: 30 ea ldi r19, 0xA0 ; 160 2a6a8: e3 2e mov r14, r19 2a6aa: 30 e4 ldi r19, 0x40 ; 64 2a6ac: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 2a6ae: 43 e0 ldi r20, 0x03 ; 3 2a6b0: 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 2a6b2: 52 e0 ldi r21, 0x02 ; 2 2a6b4: 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); 2a6b6: 08 ec ldi r16, 0xC8 ; 200 2a6b8: 17 e8 ldi r17, 0x87 ; 135 2a6ba: 67 e0 ldi r22, 0x07 ; 7 2a6bc: 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(); 2a6be: 0e 94 11 65 call 0xca22 ; 0xca22 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 2a6c2: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2a6c6: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2a6ca: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2a6ce: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/60); 2a6d2: 65 e5 ldi r22, 0x55 ; 85 2a6d4: 75 e5 ldi r23, 0x55 ; 85 2a6d6: 85 e5 ldi r24, 0x55 ; 85 2a6d8: 91 e4 ldi r25, 0x41 ; 65 2a6da: 0f 94 bc 4e call 0x29d78 ; 0x29d78 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 2a6de: 29 81 ldd r18, Y+1 ; 0x01 2a6e0: 21 50 subi r18, 0x01 ; 1 2a6e2: 82 2f mov r24, r18 2a6e4: 6b 2d mov r22, r11 2a6e6: 0f 94 4c a4 call 0x34898 ; 0x34898 <__udivmodqi4> 2a6ea: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 2a6ec: 82 2f mov r24, r18 2a6ee: 0f 94 58 a4 call 0x348b0 ; 0x348b0 <__divmodqi4> 2a6f2: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 2a6f4: 80 ff sbrs r24, 0 2a6f6: 03 c0 rjmp .+6 ; 0x2a6fe 2a6f8: f9 2d mov r31, r9 2a6fa: f8 19 sub r31, r8 2a6fc: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 2a6fe: 88 2d mov r24, r8 2a700: 88 0f add r24, r24 2a702: 88 0d add r24, r8 2a704: 0e 94 b0 5e call 0xbd60 ; 0xbd60 2a708: 60 93 61 12 sts 0x1261, r22 ; 0x801261 2a70c: 70 93 62 12 sts 0x1262, r23 ; 0x801262 2a710: 80 93 63 12 sts 0x1263, r24 ; 0x801263 2a714: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = BED_Y(iy * 3); 2a718: 87 2d mov r24, r7 2a71a: 88 0f add r24, r24 2a71c: 87 0d add r24, r7 2a71e: 0e 94 b0 5e call 0xbd60 ; 0xbd60 2a722: 60 93 65 12 sts 0x1265, r22 ; 0x801265 2a726: 70 93 66 12 sts 0x1266, r23 ; 0x801266 2a72a: 80 93 67 12 sts 0x1267, r24 ; 0x801267 2a72e: 90 93 68 12 sts 0x1268, r25 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 2a732: 65 e6 ldi r22, 0x65 ; 101 2a734: 72 e1 ldi r23, 0x12 ; 18 2a736: 81 e6 ldi r24, 0x61 ; 97 2a738: 92 e1 ldi r25, 0x12 ; 18 2a73a: 0e 94 ee 68 call 0xd1dc ; 0xd1dc go_to_current(homing_feedrate[X_AXIS]/60); 2a73e: 60 e0 ldi r22, 0x00 ; 0 2a740: 70 e0 ldi r23, 0x00 ; 0 2a742: 88 e4 ldi r24, 0x48 ; 72 2a744: 92 e4 ldi r25, 0x42 ; 66 2a746: 0f 94 bc 4e call 0x29d78 ; 0x29d78 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 2a74a: 63 e0 ldi r22, 0x03 ; 3 2a74c: 80 e0 ldi r24, 0x00 ; 0 2a74e: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%d/9"),mesh_point+1); 2a752: 8a 81 ldd r24, Y+2 ; 0x02 2a754: 8f 93 push r24 2a756: 99 81 ldd r25, Y+1 ; 0x01 2a758: 9f 93 push r25 2a75a: 1f 93 push r17 2a75c: 0f 93 push r16 2a75e: 0e 94 db 6e call 0xddb6 ; 0xddb6 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 2a762: 43 e0 ldi r20, 0x03 ; 3 2a764: 60 e0 ldi r22, 0x00 ; 0 2a766: 70 e0 ldi r23, 0x00 ; 0 2a768: 80 e2 ldi r24, 0x20 ; 32 2a76a: 91 ec ldi r25, 0xC1 ; 193 2a76c: 0f 94 aa 7b call 0x2f754 ; 0x2f754 2a770: 58 2e mov r5, r24 2a772: 0f 90 pop r0 2a774: 0f 90 pop r0 2a776: 0f 90 pop r0 2a778: 0f 90 pop r0 2a77a: 88 23 and r24, r24 2a77c: 09 f4 brne .+2 ; 0x2a780 2a77e: 77 cf rjmp .-274 ; 0x2a66e 2a780: a7 9c mul r10, r7 2a782: f0 01 movw r30, r0 2a784: 11 24 eor r1, r1 2a786: e8 0d add r30, r8 2a788: f1 1d adc r31, r1 2a78a: ee 0f add r30, r30 2a78c: ff 1f adc r31, r31 2a78e: ee 0f add r30, r30 2a790: ff 1f adc r31, r31 2a792: e7 5f subi r30, 0xF7 ; 247 2a794: fc 4e sbci r31, 0xEC ; 236 2a796: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2a79a: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2a79e: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2a7a2: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2a7a6: 81 83 std Z+1, r24 ; 0x01 2a7a8: 92 83 std Z+2, r25 ; 0x02 2a7aa: a3 83 std Z+3, r26 ; 0x03 2a7ac: b4 83 std Z+4, r27 ; 0x04 2a7ae: e9 81 ldd r30, Y+1 ; 0x01 2a7b0: fa 81 ldd r31, Y+2 ; 0x02 2a7b2: 31 96 adiw r30, 0x01 ; 1 2a7b4: fa 83 std Y+2, r31 ; 0x02 2a7b6: 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) { 2a7b8: 3a 97 sbiw r30, 0x0a ; 10 2a7ba: 09 f0 breq .+2 ; 0x2a7be 2a7bc: 80 cf rjmp .-256 ; 0x2a6be mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 2a7be: 60 90 0a 13 lds r6, 0x130A ; 0x80130a 2a7c2: 70 90 0b 13 lds r7, 0x130B ; 0x80130b 2a7c6: 80 90 0c 13 lds r8, 0x130C ; 0x80130c 2a7ca: 90 90 0d 13 lds r9, 0x130D ; 0x80130d float zmax = zmin; 2a7ce: 46 2c mov r4, r6 2a7d0: a7 2c mov r10, r7 2a7d2: b8 2c mov r11, r8 2a7d4: 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]; 2a7d6: 1e 82 std Y+6, r1 ; 0x06 2a7d8: 1d 82 std Y+5, r1 ; 0x05 2a7da: 09 e0 ldi r16, 0x09 ; 9 2a7dc: 13 e1 ldi r17, 0x13 ; 19 2a7de: 8d 81 ldd r24, Y+5 ; 0x05 2a7e0: 9e 81 ldd r25, Y+6 ; 0x06 2a7e2: 86 5f subi r24, 0xF6 ; 246 2a7e4: 9c 4e sbci r25, 0xEC ; 236 2a7e6: 9a 83 std Y+2, r25 ; 0x02 2a7e8: 89 83 std Y+1, r24 ; 0x01 2a7ea: 93 e0 ldi r25, 0x03 ; 3 2a7ec: 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]); 2a7ee: e9 81 ldd r30, Y+1 ; 0x01 2a7f0: fa 81 ldd r31, Y+2 ; 0x02 2a7f2: c1 90 ld r12, Z+ 2a7f4: d1 90 ld r13, Z+ 2a7f6: e1 90 ld r14, Z+ 2a7f8: f1 90 ld r15, Z+ 2a7fa: fa 83 std Y+2, r31 ; 0x02 2a7fc: e9 83 std Y+1, r30 ; 0x01 2a7fe: 93 01 movw r18, r6 2a800: a4 01 movw r20, r8 2a802: c7 01 movw r24, r14 2a804: b6 01 movw r22, r12 2a806: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2a80a: 18 16 cp r1, r24 2a80c: 14 f0 brlt .+4 ; 0x2a812 2a80e: 36 01 movw r6, r12 2a810: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 2a812: 24 2d mov r18, r4 2a814: 3a 2d mov r19, r10 2a816: 4b 2d mov r20, r11 2a818: 52 2d mov r21, r2 2a81a: c7 01 movw r24, r14 2a81c: b6 01 movw r22, r12 2a81e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2a822: 87 fd sbrc r24, 7 2a824: 04 c0 rjmp .+8 ; 0x2a82e 2a826: 4c 2c mov r4, r12 2a828: ad 2c mov r10, r13 2a82a: be 2c mov r11, r14 2a82c: 2f 2c mov r2, r15 2a82e: 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) { 2a830: 31 10 cpse r3, r1 2a832: dd cf rjmp .-70 ; 0x2a7ee 2a834: 8d 81 ldd r24, Y+5 ; 0x05 2a836: 9e 81 ldd r25, Y+6 ; 0x06 2a838: 4c 96 adiw r24, 0x1c ; 28 2a83a: 9e 83 std Y+6, r25 ; 0x06 2a83c: 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) 2a83e: 84 35 cpi r24, 0x54 ; 84 2a840: 91 05 cpc r25, r1 2a842: 59 f6 brne .-106 ; 0x2a7da 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) { 2a844: 93 01 movw r18, r6 2a846: a4 01 movw r20, r8 2a848: 64 2d mov r22, r4 2a84a: 7a 2d mov r23, r10 2a84c: 8b 2d mov r24, r11 2a84e: 92 2d mov r25, r2 2a850: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2a854: 20 e0 ldi r18, 0x00 ; 0 2a856: 30 e0 ldi r19, 0x00 ; 0 2a858: 40 e4 ldi r20, 0x40 ; 64 2a85a: 50 e4 ldi r21, 0x40 ; 64 2a85c: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2a860: 18 16 cp r1, r24 2a862: 2c f5 brge .+74 ; 0x2a8ae // 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!"); 2a864: 8b ea ldi r24, 0xAB ; 171 2a866: 97 e8 ldi r25, 0x87 ; 135 2a868: 0e 94 8d 7c call 0xf91a ; 0xf91a // 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; 2a86c: 51 2c mov r5, r1 2a86e: fc 81 ldd r31, Y+4 ; 0x04 2a870: f0 93 77 02 sts 0x0277, r31 ; 0x800277 <_ZL14check_endstops.lto_priv.388> go_home_with_z_lift(); result = true; end: enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2a874: 8b 81 ldd r24, Y+3 ; 0x03 2a876: 0f 94 3d 23 call 0x2467a ; 0x2467a #ifdef TMC2130 tmc2130_home_exit(); #endif return result; } 2a87a: 85 2d mov r24, r5 2a87c: 26 96 adiw r28, 0x06 ; 6 2a87e: 0f b6 in r0, 0x3f ; 63 2a880: f8 94 cli 2a882: de bf out 0x3e, r29 ; 62 2a884: 0f be out 0x3f, r0 ; 63 2a886: cd bf out 0x3d, r28 ; 61 2a888: df 91 pop r29 2a88a: cf 91 pop r28 2a88c: 1f 91 pop r17 2a88e: 0f 91 pop r16 2a890: ff 90 pop r15 2a892: ef 90 pop r14 2a894: df 90 pop r13 2a896: cf 90 pop r12 2a898: bf 90 pop r11 2a89a: af 90 pop r10 2a89c: 9f 90 pop r9 2a89e: 8f 90 pop r8 2a8a0: 7f 90 pop r7 2a8a2: 6f 90 pop r6 2a8a4: 5f 90 pop r5 2a8a6: 4f 90 pop r4 2a8a8: 3f 90 pop r3 2a8aa: 2f 90 pop r2 2a8ac: 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) 2a8ae: 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; 2a8b0: 85 ec ldi r24, 0xC5 ; 197 2a8b2: e8 2e mov r14, r24 2a8b4: 8f e0 ldi r24, 0x0F ; 15 2a8b6: f8 2e mov r15, r24 2a8b8: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 2a8ba: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 2a8bc: 9d 81 ldd r25, Y+5 ; 0x05 2a8be: 91 11 cpse r25, r1 2a8c0: 03 c0 rjmp .+6 ; 0x2a8c8 2a8c2: e9 81 ldd r30, Y+1 ; 0x01 2a8c4: ee 23 and r30, r30 2a8c6: 29 f1 breq .+74 ; 0x2a912 continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 2a8c8: 20 91 0a 13 lds r18, 0x130A ; 0x80130a 2a8cc: 30 91 0b 13 lds r19, 0x130B ; 0x80130b 2a8d0: 40 91 0c 13 lds r20, 0x130C ; 0x80130c 2a8d4: 50 91 0d 13 lds r21, 0x130D ; 0x80130d 2a8d8: f6 01 movw r30, r12 2a8da: 61 81 ldd r22, Z+1 ; 0x01 2a8dc: 72 81 ldd r23, Z+2 ; 0x02 2a8de: 83 81 ldd r24, Z+3 ; 0x03 2a8e0: 94 81 ldd r25, Z+4 ; 0x04 2a8e2: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 2a8e6: 20 e0 ldi r18, 0x00 ; 0 2a8e8: 30 e0 ldi r19, 0x00 ; 0 2a8ea: 48 ec ldi r20, 0xC8 ; 200 2a8ec: 52 e4 ldi r21, 0x42 ; 66 2a8ee: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2a8f2: 20 e0 ldi r18, 0x00 ; 0 2a8f4: 30 e0 ldi r19, 0x00 ; 0 2a8f6: 40 e0 ldi r20, 0x00 ; 0 2a8f8: 5f e3 ldi r21, 0x3F ; 63 2a8fa: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2a8fe: 0f 94 6c a6 call 0x34cd8 ; 0x34cd8 2a902: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2a906: c7 01 movw r24, r14 2a908: 0f 94 df a3 call 0x347be ; 0x347be SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 2a90c: f2 e0 ldi r31, 0x02 ; 2 2a90e: ef 0e add r14, r31 2a910: f1 1c adc r15, r1 2a912: 84 e0 ldi r24, 0x04 ; 4 2a914: c8 0e add r12, r24 2a916: d1 1c adc r13, r1 2a918: 9d 81 ldd r25, Y+5 ; 0x05 2a91a: 9f 5f subi r25, 0xFF ; 255 2a91c: 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) { 2a91e: 93 30 cpi r25, 0x03 ; 3 2a920: 69 f6 brne .-102 ; 0x2a8bc 2a922: 04 5e subi r16, 0xE4 ; 228 2a924: 1f 4f sbci r17, 0xFF ; 255 2a926: e9 81 ldd r30, Y+1 ; 0x01 2a928: ef 5f subi r30, 0xFF ; 255 2a92a: 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) 2a92c: e3 30 cpi r30, 0x03 ; 3 2a92e: 21 f6 brne .-120 ; 0x2a8b8 #endif addr += 2; } } mbl.reset(); 2a930: 0f 94 a0 7b call 0x2f740 ; 0x2f740 go_home_with_z_lift(); 2a934: 0e 94 0d 6a call 0xd41a ; 0xd41a 2a938: 9a cf rjmp .-204 ; 0x2a86e 0002a93a : * 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) { 2a93a: 2f 92 push r2 2a93c: 3f 92 push r3 2a93e: 4f 92 push r4 2a940: 5f 92 push r5 2a942: 6f 92 push r6 2a944: 7f 92 push r7 2a946: 8f 92 push r8 2a948: 9f 92 push r9 2a94a: af 92 push r10 2a94c: bf 92 push r11 2a94e: cf 92 push r12 2a950: df 92 push r13 2a952: ef 92 push r14 2a954: ff 92 push r15 2a956: 0f 93 push r16 2a958: 1f 93 push r17 2a95a: cf 93 push r28 2a95c: df 93 push r29 2a95e: cd b7 in r28, 0x3d ; 61 2a960: de b7 in r29, 0x3e ; 62 2a962: c2 54 subi r28, 0x42 ; 66 2a964: d1 09 sbc r29, r1 2a966: 0f b6 in r0, 0x3f ; 63 2a968: f8 94 cli 2a96a: de bf out 0x3e, r29 ; 62 2a96c: 0f be out 0x3f, r0 ; 63 2a96e: cd bf out 0x3d, r28 ; 61 2a970: 4c 01 movw r8, r24 2a972: 5b 01 movw r10, r22 2a974: 6a 01 movw r12, r20 2a976: 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) {} 2a978: 19 82 std Y+1, r1 ; 0x01 2a97a: 1c 82 std Y+4, r1 ; 0x04 2a97c: 1c 8e std Y+28, r1 ; 0x1c 2a97e: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 2a980: 67 2b or r22, r23 2a982: 21 f5 brne .+72 ; 0x2a9cc sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 2a984: 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; 2a986: ce 01 movw r24, r28 2a988: 4c 96 adiw r24, 0x1c ; 28 2a98a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 2a98e: ce 01 movw r24, r28 2a990: 01 96 adiw r24, 0x01 ; 1 2a992: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } return open(parent, dname, oflag); fail: return false; } 2a996: 81 2f mov r24, r17 2a998: ce 5b subi r28, 0xBE ; 190 2a99a: df 4f sbci r29, 0xFF ; 255 2a99c: 0f b6 in r0, 0x3f ; 63 2a99e: f8 94 cli 2a9a0: de bf out 0x3e, r29 ; 62 2a9a2: 0f be out 0x3f, r0 ; 63 2a9a4: cd bf out 0x3d, r28 ; 61 2a9a6: df 91 pop r29 2a9a8: cf 91 pop r28 2a9aa: 1f 91 pop r17 2a9ac: 0f 91 pop r16 2a9ae: ff 90 pop r15 2a9b0: ef 90 pop r14 2a9b2: df 90 pop r13 2a9b4: cf 90 pop r12 2a9b6: bf 90 pop r11 2a9b8: af 90 pop r10 2a9ba: 9f 90 pop r9 2a9bc: 8f 90 pop r8 2a9be: 7f 90 pop r7 2a9c0: 6f 90 pop r6 2a9c2: 5f 90 pop r5 2a9c4: 4f 90 pop r4 2a9c6: 3f 90 pop r3 2a9c8: 2f 90 pop r2 2a9ca: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 2a9cc: fc 01 movw r30, r24 2a9ce: 83 81 ldd r24, Z+3 ; 0x03 2a9d0: 81 11 cpse r24, r1 2a9d2: d8 cf rjmp .-80 ; 0x2a984 if (*path == '/') { 2a9d4: fa 01 movw r30, r20 2a9d6: 80 81 ld r24, Z 2a9d8: 8f 32 cpi r24, 0x2F ; 47 2a9da: c1 f4 brne .+48 ; 0x2aa0c 2a9dc: ca 01 movw r24, r20 2a9de: 6c 01 movw r12, r24 2a9e0: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 2a9e2: f6 01 movw r30, r12 2a9e4: 20 81 ld r18, Z 2a9e6: 2f 32 cpi r18, 0x2F ; 47 2a9e8: d1 f3 breq .-12 ; 0x2a9de 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; 2a9ea: f5 01 movw r30, r10 2a9ec: 83 81 ldd r24, Z+3 ; 0x03 2a9ee: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 2a9f0: 82 30 cpi r24, 0x02 ; 2 2a9f2: 60 f0 brcs .+24 ; 0x2aa0c if (!dir2.openRoot(dirFile->vol_)) goto fail; 2a9f4: 61 8d ldd r22, Z+25 ; 0x19 2a9f6: 72 8d ldd r23, Z+26 ; 0x1a 2a9f8: ce 01 movw r24, r28 2a9fa: 4c 96 adiw r24, 0x1c ; 28 2a9fc: 0f 94 cb 29 call 0x25396 ; 0x25396 parent = &dir2; 2aa00: 8e 01 movw r16, r28 2aa02: 04 5e subi r16, 0xE4 ; 228 2aa04: 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; 2aa06: 81 11 cpse r24, r1 2aa08: 02 c0 rjmp .+4 ; 0x2aa0e 2aa0a: bc cf rjmp .-136 ; 0x2a984 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 2aa0c: 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; 2aa0e: ce 01 movw r24, r28 2aa10: 01 96 adiw r24, 0x01 ; 1 2aa12: 7c 01 movw r14, r24 2aa14: 3c 01 movw r6, r24 2aa16: 2e 01 movw r4, r28 2aa18: 9c e1 ldi r25, 0x1C ; 28 2aa1a: 49 0e add r4, r25 2aa1c: 51 1c adc r5, r1 2aa1e: 23 96 adiw r28, 0x03 ; 3 2aa20: ef ae std Y+63, r14 ; 0x3f 2aa22: 23 97 sbiw r28, 0x03 ; 3 2aa24: 2f 2c mov r2, r15 2aa26: fe 01 movw r30, r28 2aa28: f7 96 adiw r30, 0x37 ; 55 2aa2a: cf 01 movw r24, r30 2aa2c: 0b 96 adiw r24, 0x0b ; 11 2aa2e: 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++] = ' '; 2aa30: 20 e2 ldi r18, 0x20 ; 32 2aa32: 21 93 st Z+, r18 2aa34: e8 17 cp r30, r24 2aa36: f9 07 cpc r31, r25 2aa38: d9 f7 brne .-10 ; 0x2aa30 2aa3a: 96 01 movw r18, r12 i = 0; 2aa3c: 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 2aa3e: 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 != '/') { 2aa40: d9 01 movw r26, r18 2aa42: 8d 91 ld r24, X+ 2aa44: 88 23 and r24, r24 2aa46: 49 f1 breq .+82 ; 0x2aa9a 2aa48: 8f 32 cpi r24, 0x2F ; 47 2aa4a: 39 f1 breq .+78 ; 0x2aa9a c = *str++; 2aa4c: 28 2f mov r18, r24 if (c == '.') { 2aa4e: 8e 32 cpi r24, 0x2E ; 46 2aa50: 39 f4 brne .+14 ; 0x2aa60 if (n == 10) goto fail; // only one dot allowed 2aa52: 6a 30 cpi r22, 0x0A ; 10 2aa54: 09 f4 brne .+2 ; 0x2aa58 2aa56: 96 cf rjmp .-212 ; 0x2a984 n = 10; // max index for full 8.3 name i = 8; // place for extension 2aa58: 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 2aa5a: 6a e0 ldi r22, 0x0A ; 10 2aa5c: 9d 01 movw r18, r26 2aa5e: f0 cf rjmp .-32 ; 0x2aa40 2aa60: eb e8 ldi r30, 0x8B ; 139 2aa62: fb e8 ldi r31, 0x8B ; 139 //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; 2aa64: 34 91 lpm r19, Z 2aa66: 33 23 and r19, r19 2aa68: 21 f0 breq .+8 ; 0x2aa72 2aa6a: 31 96 adiw r30, 0x01 ; 1 2aa6c: 83 13 cpse r24, r19 2aa6e: fa cf rjmp .-12 ; 0x2aa64 2aa70: 89 cf rjmp .-238 ; 0x2a984 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 2aa72: 69 17 cp r22, r25 2aa74: 08 f4 brcc .+2 ; 0x2aa78 2aa76: 86 cf rjmp .-244 ; 0x2a984 2aa78: 3f ed ldi r19, 0xDF ; 223 2aa7a: 38 0f add r19, r24 2aa7c: 3e 35 cpi r19, 0x5E ; 94 2aa7e: 08 f0 brcs .+2 ; 0x2aa82 2aa80: 81 cf rjmp .-254 ; 0x2a984 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 2aa82: 3f e9 ldi r19, 0x9F ; 159 2aa84: 38 0f add r19, r24 2aa86: 3a 31 cpi r19, 0x1A ; 26 2aa88: 10 f4 brcc .+4 ; 0x2aa8e 2aa8a: 20 ee ldi r18, 0xE0 ; 224 2aa8c: 28 0f add r18, r24 2aa8e: fa 01 movw r30, r20 2aa90: e9 0f add r30, r25 2aa92: f1 1d adc r31, r1 2aa94: 20 83 st Z, r18 2aa96: 9f 5f subi r25, 0xFF ; 255 2aa98: e1 cf rjmp .-62 ; 0x2aa5c if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 2aa9a: 8f a9 ldd r24, Y+55 ; 0x37 2aa9c: 80 32 cpi r24, 0x20 ; 32 2aa9e: 09 f4 brne .+2 ; 0x2aaa2 2aaa0: 71 cf rjmp .-286 ; 0x2a984 2aaa2: 69 01 movw r12, r18 while (*path == '/') path++; 2aaa4: f9 01 movw r30, r18 2aaa6: 80 81 ld r24, Z 2aaa8: 2f 5f subi r18, 0xFF ; 255 2aaaa: 3f 4f sbci r19, 0xFF ; 255 2aaac: 8f 32 cpi r24, 0x2F ; 47 2aaae: c9 f3 breq .-14 ; 0x2aaa2 if (!*path) break; 2aab0: 88 23 and r24, r24 2aab2: d9 f0 breq .+54 ; 0x2aaea if (!sub->open(parent, dname, O_READ)) goto fail; 2aab4: 21 e0 ldi r18, 0x01 ; 1 2aab6: b8 01 movw r22, r16 2aab8: c7 01 movw r24, r14 2aaba: 0f 94 39 2e call 0x25c72 ; 0x25c72 2aabe: 88 23 and r24, r24 2aac0: 09 f4 brne .+2 ; 0x2aac4 2aac2: 60 cf rjmp .-320 ; 0x2a984 if (parent != dirFile) parent->close(); 2aac4: 0a 15 cp r16, r10 2aac6: 1b 05 cpc r17, r11 2aac8: 19 f0 breq .+6 ; 0x2aad0 2aaca: c8 01 movw r24, r16 2aacc: 0f 94 72 2c call 0x258e4 ; 0x258e4 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 2aad0: 94 2d mov r25, r4 2aad2: 85 2d mov r24, r5 2aad4: 6e 14 cp r6, r14 2aad6: 7f 04 cpc r7, r15 2aad8: 21 f0 breq .+8 ; 0x2aae2 2aada: 23 96 adiw r28, 0x03 ; 3 2aadc: 9f ad ldd r25, Y+63 ; 0x3f 2aade: 23 97 sbiw r28, 0x03 ; 3 2aae0: 82 2d mov r24, r2 2aae2: 87 01 movw r16, r14 2aae4: e9 2e mov r14, r25 2aae6: f8 2e mov r15, r24 2aae8: 9e cf rjmp .-196 ; 0x2aa26 } return open(parent, dname, oflag); 2aaea: 23 2d mov r18, r3 2aaec: b8 01 movw r22, r16 2aaee: c4 01 movw r24, r8 2aaf0: 0f 94 39 2e call 0x25c72 ; 0x25c72 2aaf4: 18 2f mov r17, r24 2aaf6: 47 cf rjmp .-370 ; 0x2a986 0002aaf8 : } // 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; 2aaf8: ef e6 ldi r30, 0x6F ; 111 2aafa: f6 e1 ldi r31, 0x16 ; 22 2aafc: 40 81 ld r20, Z 2aafe: 51 81 ldd r21, Z+1 ; 0x01 2ab00: 62 81 ldd r22, Z+2 ; 0x02 2ab02: 73 81 ldd r23, Z+3 ; 0x03 2ab04: 48 0f add r20, r24 2ab06: 59 1f adc r21, r25 2ab08: 61 1d adc r22, r1 2ab0a: 71 1d adc r23, r1 2ab0c: 40 83 st Z, r20 2ab0e: 51 83 std Z+1, r21 ; 0x01 2ab10: 62 83 std Z+2, r22 ; 0x02 2ab12: 73 83 std Z+3, r23 ; 0x03 } 2ab14: 08 95 ret 0002ab16 : 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){ 2ab16: 2f 92 push r2 2ab18: 3f 92 push r3 2ab1a: 4f 92 push r4 2ab1c: 5f 92 push r5 2ab1e: 6f 92 push r6 2ab20: 7f 92 push r7 2ab22: 8f 92 push r8 2ab24: 9f 92 push r9 2ab26: af 92 push r10 2ab28: bf 92 push r11 2ab2a: cf 92 push r12 2ab2c: df 92 push r13 2ab2e: ef 92 push r14 2ab30: ff 92 push r15 2ab32: 0f 93 push r16 2ab34: 1f 93 push r17 2ab36: cf 93 push r28 2ab38: df 93 push r29 2ab3a: 00 d0 rcall .+0 ; 0x2ab3c 2ab3c: 1f 92 push r1 2ab3e: 1f 92 push r1 2ab40: cd b7 in r28, 0x3d ; 61 2ab42: de b7 in r29, 0x3e ; 62 2ab44: 1c 01 movw r2, r24 2ab46: 2a 01 movw r4, r20 2ab48: 3b 01 movw r6, r22 2ab4a: 00 e2 ldi r16, 0x20 ; 32 2ab4c: 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){ 2ab4e: 19 82 std Y+1, r1 ; 0x01 2ab50: 99 81 ldd r25, Y+1 ; 0x01 2ab52: 89 2f mov r24, r25 2ab54: 90 e0 ldi r25, 0x00 ; 0 2ab56: 9b 83 std Y+3, r25 ; 0x03 2ab58: 8a 83 std Y+2, r24 ; 0x02 2ab5a: 80 17 cp r24, r16 2ab5c: 91 07 cpc r25, r17 2ab5e: 9c f5 brge .+102 ; 0x2abc6 if (points[j] > points[j + 1]) 2ab60: 88 0f add r24, r24 2ab62: 99 1f adc r25, r25 2ab64: 88 0f add r24, r24 2ab66: 99 1f adc r25, r25 2ab68: 9d 83 std Y+5, r25 ; 0x05 2ab6a: 8c 83 std Y+4, r24 ; 0x04 2ab6c: 82 0d add r24, r2 2ab6e: 93 1d adc r25, r3 2ab70: 9b 83 std Y+3, r25 ; 0x03 2ab72: 8a 83 std Y+2, r24 ; 0x02 2ab74: fc 01 movw r30, r24 2ab76: c0 80 ld r12, Z 2ab78: d1 80 ldd r13, Z+1 ; 0x01 2ab7a: e2 80 ldd r14, Z+2 ; 0x02 2ab7c: f3 80 ldd r15, Z+3 ; 0x03 2ab7e: 8c 81 ldd r24, Y+4 ; 0x04 2ab80: 9d 81 ldd r25, Y+5 ; 0x05 2ab82: 04 96 adiw r24, 0x04 ; 4 2ab84: 82 0d add r24, r2 2ab86: 93 1d adc r25, r3 2ab88: 9d 83 std Y+5, r25 ; 0x05 2ab8a: 8c 83 std Y+4, r24 ; 0x04 2ab8c: fc 01 movw r30, r24 2ab8e: 80 80 ld r8, Z 2ab90: 91 80 ldd r9, Z+1 ; 0x01 2ab92: a2 80 ldd r10, Z+2 ; 0x02 2ab94: b3 80 ldd r11, Z+3 ; 0x03 2ab96: a5 01 movw r20, r10 2ab98: 94 01 movw r18, r8 2ab9a: c7 01 movw r24, r14 2ab9c: b6 01 movw r22, r12 2ab9e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2aba2: 18 16 cp r1, r24 2aba4: 64 f4 brge .+24 ; 0x2abbe SWAP(points[j], points[j + 1]); 2aba6: ea 81 ldd r30, Y+2 ; 0x02 2aba8: fb 81 ldd r31, Y+3 ; 0x03 2abaa: 80 82 st Z, r8 2abac: 91 82 std Z+1, r9 ; 0x01 2abae: a2 82 std Z+2, r10 ; 0x02 2abb0: b3 82 std Z+3, r11 ; 0x03 2abb2: ec 81 ldd r30, Y+4 ; 0x04 2abb4: fd 81 ldd r31, Y+5 ; 0x05 2abb6: c0 82 st Z, r12 2abb8: d1 82 std Z+1, r13 ; 0x01 2abba: e2 82 std Z+2, r14 ; 0x02 2abbc: 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){ 2abbe: f9 81 ldd r31, Y+1 ; 0x01 2abc0: ff 5f subi r31, 0xFF ; 255 2abc2: f9 83 std Y+1, r31 ; 0x01 2abc4: c5 cf rjmp .-118 ; 0x2ab50 2abc6: 01 50 subi r16, 0x01 ; 1 2abc8: 11 09 sbc r17, r1 2abca: 08 f6 brcc .-126 ; 0x2ab4e /// 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]; 2abcc: f1 01 movw r30, r2 2abce: e0 5c subi r30, 0xC0 ; 192 2abd0: 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); 2abd2: 20 81 ld r18, Z 2abd4: 31 81 ldd r19, Z+1 ; 0x01 2abd6: 42 81 ldd r20, Z+2 ; 0x02 2abd8: 53 81 ldd r21, Z+3 ; 0x03 2abda: c3 01 movw r24, r6 2abdc: b2 01 movw r22, r4 2abde: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2abe2: 6b 01 movw r12, r22 2abe4: 7c 01 movw r14, r24 2abe6: 20 e0 ldi r18, 0x00 ; 0 2abe8: 30 e0 ldi r19, 0x00 ; 0 2abea: 40 e0 ldi r20, 0x00 ; 0 2abec: 5f eb ldi r21, 0xBF ; 191 2abee: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2abf2: 87 fd sbrc r24, 7 2abf4: 10 c0 rjmp .+32 ; 0x2ac16 2abf6: 20 e0 ldi r18, 0x00 ; 0 2abf8: 30 e0 ldi r19, 0x00 ; 0 2abfa: 40 e0 ldi r20, 0x00 ; 0 2abfc: 5f e3 ldi r21, 0x3F ; 63 2abfe: c7 01 movw r24, r14 2ac00: b6 01 movw r22, r12 2ac02: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2ac06: 18 16 cp r1, r24 2ac08: 5c f4 brge .+22 ; 0x2ac20 2ac0a: c1 2c mov r12, r1 2ac0c: d1 2c mov r13, r1 2ac0e: e1 2c mov r14, r1 2ac10: 8f e3 ldi r24, 0x3F ; 63 2ac12: f8 2e mov r15, r24 2ac14: 05 c0 rjmp .+10 ; 0x2ac20 2ac16: c1 2c mov r12, r1 2ac18: d1 2c mov r13, r1 2ac1a: e1 2c mov r14, r1 2ac1c: 9f eb ldi r25, 0xBF ; 191 2ac1e: f9 2e mov r15, r25 } 2ac20: c7 01 movw r24, r14 2ac22: b6 01 movw r22, r12 2ac24: 0f 90 pop r0 2ac26: 0f 90 pop r0 2ac28: 0f 90 pop r0 2ac2a: 0f 90 pop r0 2ac2c: 0f 90 pop r0 2ac2e: df 91 pop r29 2ac30: cf 91 pop r28 2ac32: 1f 91 pop r17 2ac34: 0f 91 pop r16 2ac36: ff 90 pop r15 2ac38: ef 90 pop r14 2ac3a: df 90 pop r13 2ac3c: cf 90 pop r12 2ac3e: bf 90 pop r11 2ac40: af 90 pop r10 2ac42: 9f 90 pop r9 2ac44: 8f 90 pop r8 2ac46: 7f 90 pop r7 2ac48: 6f 90 pop r6 2ac4a: 5f 90 pop r5 2ac4c: 4f 90 pop r4 2ac4e: 3f 90 pop r3 2ac50: 2f 90 pop r2 2ac52: 08 95 ret 0002ac54 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2ac54: 0f 94 56 0b call 0x216ac ; 0x216ac 2ac58: 60 93 a1 12 sts 0x12A1, r22 ; 0x8012a1 2ac5c: 70 93 a2 12 sts 0x12A2, r23 ; 0x8012a2 2ac60: 80 93 a3 12 sts 0x12A3, r24 ; 0x8012a3 2ac64: 90 93 a4 12 sts 0x12A4, r25 ; 0x8012a4 } 2ac68: 08 95 ret 0002ac6a : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2ac6a: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 2ac6e: 88 23 and r24, r24 2ac70: 69 f0 breq .+26 ; 0x2ac8c 2ac72: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2ac76: 88 23 and r24, r24 2ac78: 49 f0 breq .+18 ; 0x2ac8c SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2ac7a: 85 e4 ldi r24, 0x45 ; 69 2ac7c: 91 ea ldi r25, 0xA1 ; 161 2ac7e: 0e 94 8d 7c call 0xf91a ; 0xf91a retryAttempts--; 2ac82: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2ac86: 81 50 subi r24, 0x01 ; 1 2ac88: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 } } 2ac8c: 08 95 ret 0002ac8e : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2ac8e: 9f 92 push r9 2ac90: af 92 push r10 2ac92: bf 92 push r11 2ac94: cf 92 push r12 2ac96: df 92 push r13 2ac98: ef 92 push r14 2ac9a: ff 92 push r15 2ac9c: 0f 93 push r16 2ac9e: 1f 93 push r17 2aca0: cf 93 push r28 2aca2: df 93 push r29 2aca4: cd b7 in r28, 0x3d ; 61 2aca6: de b7 in r29, 0x3e ; 62 2aca8: e0 97 sbiw r28, 0x30 ; 48 2acaa: 0f b6 in r0, 0x3f ; 63 2acac: f8 94 cli 2acae: de bf out 0x3e, r29 ; 62 2acb0: 0f be out 0x3f, r0 ; 63 2acb2: cd bf out 0x3d, r28 ; 61 2acb4: 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()]; 2acb6: e0 90 cf 12 lds r14, 0x12CF ; 0x8012cf 2acba: fe 01 movw r30, r28 2acbc: 31 96 adiw r30, 0x01 ; 1 2acbe: 21 e0 ldi r18, 0x01 ; 1 2acc0: 30 e0 ldi r19, 0x00 ; 0 2acc2: 5f 01 movw r10, r30 2acc4: f1 2c mov r15, r1 2acc6: 40 e1 ldi r20, 0x10 ; 16 2acc8: c4 2e mov r12, r20 2acca: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2accc: 50 e2 ldi r21, 0x20 ; 32 2acce: 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()]; 2acd0: c7 01 movw r24, r14 2acd2: 82 1b sub r24, r18 2acd4: 93 0b sbc r25, r19 2acd6: b6 01 movw r22, r12 2acd8: 0f 94 7a a4 call 0x348f4 ; 0x348f4 <__divmodhi4> 2acdc: dc 01 movw r26, r24 2acde: bb 27 eor r27, r27 2ace0: ae 56 subi r26, 0x6E ; 110 2ace2: bd 4e sbci r27, 0xED ; 237 2ace4: 9d 96 adiw r26, 0x2d ; 45 2ace6: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2ace8: 48 2f mov r20, r24 2acea: 50 e0 ldi r21, 0x00 ; 0 2acec: 94 e0 ldi r25, 0x04 ; 4 2acee: 55 95 asr r21 2acf0: 47 95 ror r20 2acf2: 9a 95 dec r25 2acf4: e1 f7 brne .-8 ; 0x2acee lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2acf6: 96 ef ldi r25, 0xF6 ; 246 2acf8: 94 0f add r25, r20 2acfa: 96 30 cpi r25, 0x06 ; 6 2acfc: a8 f1 brcs .+106 ; 0x2ad68 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2acfe: 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); 2ad00: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2ad02: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2ad04: 96 ef ldi r25, 0xF6 ; 246 2ad06: 98 0f add r25, r24 2ad08: 96 30 cpi r25, 0x06 ; 6 2ad0a: 80 f1 brcs .+96 ; 0x2ad6c case 5: case 6: case 7: case 8: case 9: return c + '0'; 2ad0c: 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); 2ad0e: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2ad10: 92 82 std Z+2, r9 ; 0x02 2ad12: 2f 5f subi r18, 0xFF ; 255 2ad14: 3f 4f sbci r19, 0xFF ; 255 2ad16: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2ad18: 21 31 cpi r18, 0x11 ; 17 2ad1a: 31 05 cpc r19, r1 2ad1c: c9 f6 brne .-78 ; 0x2acd0 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 2ad1e: 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); 2ad20: 8e ec ldi r24, 0xCE ; 206 2ad22: 91 ea ldi r25, 0xA1 ; 161 2ad24: 0e 94 94 7a call 0xf528 ; 0xf528 2ad28: 88 ec ldi r24, 0xC8 ; 200 2ad2a: 91 ea ldi r25, 0xA1 ; 161 2ad2c: 0e 94 94 7a call 0xf528 ; 0xf528 2ad30: c8 01 movw r24, r16 2ad32: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOPGM(", last bytes: "); 2ad36: 80 e7 ldi r24, 0x70 ; 112 2ad38: 91 ea ldi r25, 0xA1 ; 161 2ad3a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(lrb); 2ad3e: c5 01 movw r24, r10 2ad40: 0e 94 92 85 call 0x10b24 ; 0x10b24 } 2ad44: e0 96 adiw r28, 0x30 ; 48 2ad46: 0f b6 in r0, 0x3f ; 63 2ad48: f8 94 cli 2ad4a: de bf out 0x3e, r29 ; 62 2ad4c: 0f be out 0x3f, r0 ; 63 2ad4e: cd bf out 0x3d, r28 ; 61 2ad50: df 91 pop r29 2ad52: cf 91 pop r28 2ad54: 1f 91 pop r17 2ad56: 0f 91 pop r16 2ad58: ff 90 pop r15 2ad5a: ef 90 pop r14 2ad5c: df 90 pop r13 2ad5e: cf 90 pop r12 2ad60: bf 90 pop r11 2ad62: af 90 pop r10 2ad64: 9f 90 pop r9 2ad66: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2ad68: 49 5a subi r20, 0xA9 ; 169 2ad6a: ca cf rjmp .-108 ; 0x2ad00 2ad6c: 89 5a subi r24, 0xA9 ; 169 2ad6e: cf cf rjmp .-98 ; 0x2ad0e 0002ad70 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2ad70: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2ad72: 90 91 a6 12 lds r25, 0x12A6 ; 0x8012a6 2ad76: 9a 30 cpi r25, 0x0A ; 10 2ad78: 11 f4 brne .+4 ; 0x2ad7e cause = ss; 2ad7a: 60 93 a5 12 sts 0x12A5, r22 ; 0x8012a5 } --occurrences; 2ad7e: 91 50 subi r25, 0x01 ; 1 2ad80: 90 93 a6 12 sts 0x12A6, r25 ; 0x8012a6 FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2ad84: 91 11 cpse r25, r1 2ad86: 0d c0 rjmp .+26 ; 0x2ada2 2ad88: c9 01 movw r24, r18 LogError(msg_P); 2ad8a: 0f 94 47 56 call 0x2ac8e ; 0x2ac8e SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2ad8e: 81 e6 ldi r24, 0x61 ; 97 2ad90: 91 ea ldi r25, 0xA1 ; 161 2ad92: 0e 94 8d 7c call 0xf91a ; 0xf91a /// @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; } 2ad96: 8a e0 ldi r24, 0x0A ; 10 2ad98: 80 93 a6 12 sts 0x12A6, r24 ; 0x8012a6 2ad9c: 80 91 a5 12 lds r24, 0x12A5 ; 0x8012a5 2ada0: 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 2ada2: 80 e0 ldi r24, 0x00 ; 0 } } 2ada4: 08 95 ret 0002ada6 : } *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) { 2ada6: cf 93 push r28 2ada8: df 93 push r29 2adaa: cd b7 in r28, 0x3d ; 61 2adac: de b7 in r29, 0x3e ; 62 2adae: 2e 97 sbiw r28, 0x0e ; 14 2adb0: 0f b6 in r0, 0x3f ; 63 2adb2: f8 94 cli 2adb4: de bf out 0x3e, r29 ; 62 2adb6: 0f be out 0x3f, r0 ; 63 2adb8: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2adba: 2e e3 ldi r18, 0x3E ; 62 2adbc: 30 e0 ldi r19, 0x00 ; 0 2adbe: 3a 83 std Y+2, r19 ; 0x02 2adc0: 29 83 std Y+1, r18 ; 0x01 2adc2: fe 01 movw r30, r28 2adc4: 33 96 adiw r30, 0x03 ; 3 2adc6: 2c e0 ldi r18, 0x0C ; 12 2adc8: df 01 movw r26, r30 2adca: 1d 92 st X+, r1 2adcc: 2a 95 dec r18 2adce: e9 f7 brne .-6 ; 0x2adca 2add0: de 01 movw r26, r28 2add2: 12 96 adiw r26, 0x02 ; 2 2add4: 48 2f mov r20, r24 2add6: fc 01 movw r30, r24 2add8: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2adda: 8e 2f mov r24, r30 2addc: 84 1b sub r24, r20 2adde: 86 17 cp r24, r22 2ade0: 40 f4 brcc .+16 ; 0x2adf2 uint8_t b = txbuff[i]; 2ade2: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2ade4: 90 ee ldi r25, 0xE0 ; 224 2ade6: 98 0f add r25, r24 2ade8: 90 36 cpi r25, 0x60 ; 96 2adea: 08 f0 brcs .+2 ; 0x2adee b = '.'; 2adec: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2adee: 8d 93 st X+, r24 2adf0: f4 cf rjmp .-24 ; 0x2adda } tmp[size + 1] = 0; 2adf2: f9 01 movw r30, r18 2adf4: e6 0f add r30, r22 2adf6: f1 1d adc r31, r1 2adf8: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2adfa: 4e e0 ldi r20, 0x0E ; 14 2adfc: 50 e0 ldi r21, 0x00 ; 0 2adfe: 64 ed ldi r22, 0xD4 ; 212 2ae00: 71 ea ldi r23, 0xA1 ; 161 2ae02: ce 01 movw r24, r28 2ae04: 01 96 adiw r24, 0x01 ; 1 2ae06: 0f 94 7c a1 call 0x342f8 ; 0x342f8 2ae0a: 89 2b or r24, r25 2ae0c: 59 f4 brne .+22 ; 0x2ae24 2ae0e: 4e e0 ldi r20, 0x0E ; 14 2ae10: 50 e0 ldi r21, 0x00 ; 0 2ae12: be 01 movw r22, r28 2ae14: 6f 5f subi r22, 0xFF ; 255 2ae16: 7f 4f sbci r23, 0xFF ; 255 2ae18: 82 e8 ldi r24, 0x82 ; 130 2ae1a: 92 e1 ldi r25, 0x12 ; 18 2ae1c: 0f 94 0f aa call 0x3541e ; 0x3541e 2ae20: 89 2b or r24, r25 2ae22: 61 f0 breq .+24 ; 0x2ae3c // 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); 2ae24: 8e ec ldi r24, 0xCE ; 206 2ae26: 91 ea ldi r25, 0xA1 ; 161 2ae28: 0e 94 94 7a call 0xf528 ; 0xf528 2ae2c: 88 ec ldi r24, 0xC8 ; 200 2ae2e: 91 ea ldi r25, 0xA1 ; 161 2ae30: 0e 94 94 7a call 0xf528 ; 0xf528 2ae34: ce 01 movw r24, r28 2ae36: 01 96 adiw r24, 0x01 ; 1 2ae38: 0e 94 92 85 call 0x10b24 ; 0x10b24 } strncpy(lastMsg, tmp, rqs); 2ae3c: 4e e0 ldi r20, 0x0E ; 14 2ae3e: 50 e0 ldi r21, 0x00 ; 0 2ae40: be 01 movw r22, r28 2ae42: 6f 5f subi r22, 0xFF ; 255 2ae44: 7f 4f sbci r23, 0xFF ; 255 2ae46: 82 e8 ldi r24, 0x82 ; 130 2ae48: 92 e1 ldi r25, 0x12 ; 18 2ae4a: 0f 94 1d aa call 0x3543a ; 0x3543a } 2ae4e: 2e 96 adiw r28, 0x0e ; 14 2ae50: 0f b6 in r0, 0x3f ; 63 2ae52: f8 94 cli 2ae54: de bf out 0x3e, r29 ; 62 2ae56: 0f be out 0x3f, r0 ; 63 2ae58: cd bf out 0x3d, r28 ; 61 2ae5a: df 91 pop r29 2ae5c: cf 91 pop r28 2ae5e: 08 95 ret 0002ae60 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2ae60: cf 92 push r12 2ae62: df 92 push r13 2ae64: ef 92 push r14 2ae66: ff 92 push r15 2ae68: 1f 93 push r17 2ae6a: cf 93 push r28 2ae6c: df 93 push r29 2ae6e: cd b7 in r28, 0x3d ; 61 2ae70: de b7 in r29, 0x3e ; 62 2ae72: 62 97 sbiw r28, 0x12 ; 18 2ae74: 0f b6 in r0, 0x3f ; 63 2ae76: f8 94 cli 2ae78: de bf out 0x3e, r29 ; 62 2ae7a: 0f be out 0x3f, r0 ; 63 2ae7c: cd bf out 0x3d, r28 ; 61 2ae7e: 4e 87 std Y+14, r20 ; 0x0e 2ae80: 5f 87 std Y+15, r21 ; 0x0f 2ae82: 68 8b std Y+16, r22 ; 0x10 2ae84: 79 8b std Y+17, r23 ; 0x11 2ae86: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2ae88: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2ae8a: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2ae8c: 51 11 cpse r21, r1 2ae8e: 31 c0 rjmp .+98 ; 0x2aef2 *dst = '0'; 2ae90: 80 e3 ldi r24, 0x30 ; 48 2ae92: 8a 83 std Y+2, r24 ; 0x02 return 1; 2ae94: 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); 2ae96: e1 e0 ldi r30, 0x01 ; 1 2ae98: e1 0f add r30, r17 2ae9a: 81 e0 ldi r24, 0x01 ; 1 2ae9c: 90 e0 ldi r25, 0x00 ; 0 2ae9e: 8c 0f add r24, r28 2aea0: 9d 1f adc r25, r29 2aea2: 8e 0f add r24, r30 2aea4: 91 1d adc r25, r1 2aea6: fc 01 movw r30, r24 2aea8: 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 2aeaa: 9a e2 ldi r25, 0x2A ; 42 2aeac: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2aeae: 81 11 cpse r24, r1 2aeb0: 27 c0 rjmp .+78 ; 0x2af00 *dst = '0'; 2aeb2: 80 e3 ldi r24, 0x30 ; 48 2aeb4: 81 83 std Z+1, r24 ; 0x01 return 1; 2aeb6: 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); 2aeb8: 1e 5f subi r17, 0xFE ; 254 2aeba: 18 0f add r17, r24 txbuff[i] = '\n'; 2aebc: e1 e0 ldi r30, 0x01 ; 1 2aebe: f0 e0 ldi r31, 0x00 ; 0 2aec0: ec 0f add r30, r28 2aec2: fd 1f adc r31, r29 2aec4: e1 0f add r30, r17 2aec6: f1 1d adc r31, r1 2aec8: 8a e0 ldi r24, 0x0A ; 10 2aeca: 80 83 st Z, r24 ++i; 2aecc: 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); 2aece: fe 01 movw r30, r28 2aed0: 31 96 adiw r30, 0x01 ; 1 2aed2: 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--){ 2aed4: 6f 01 movw r12, r30 2aed6: c1 0e add r12, r17 2aed8: d1 1c adc r13, r1 2aeda: ec 14 cp r14, r12 2aedc: fd 04 cpc r15, r13 2aede: b1 f0 breq .+44 ; 0x2af0c fputc(*buffer, uart2io); 2aee0: f7 01 movw r30, r14 2aee2: 81 91 ld r24, Z+ 2aee4: 7f 01 movw r14, r30 2aee6: 64 e7 ldi r22, 0x74 ; 116 2aee8: 72 e1 ldi r23, 0x12 ; 18 2aeea: 90 e0 ldi r25, 0x00 ; 0 2aeec: 0f 94 05 a2 call 0x3440a ; 0x3440a 2aef0: f4 cf rjmp .-24 ; 0x2aeda 2aef2: be 01 movw r22, r28 2aef4: 6e 5f subi r22, 0xFE ; 254 2aef6: 7f 4f sbci r23, 0xFF ; 255 2aef8: 0f 94 3d 4e call 0x29c7a ; 0x29c7a 2aefc: 18 2f mov r17, r24 2aefe: cb cf rjmp .-106 ; 0x2ae96 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); 2af00: bf 01 movw r22, r30 2af02: 6f 5f subi r22, 0xFF ; 255 2af04: 7f 4f sbci r23, 0xFF ; 255 2af06: 0f 94 3d 4e call 0x29c7a ; 0x29c7a 2af0a: d6 cf rjmp .-84 ; 0x2aeb8 LogRequestMsg(txbuff, len); 2af0c: 61 2f mov r22, r17 2af0e: ce 01 movw r24, r28 2af10: 01 96 adiw r24, 0x01 ; 1 2af12: 0f 94 d3 56 call 0x2ada6 ; 0x2ada6 RecordUARTActivity(); 2af16: 0f 94 2a 56 call 0x2ac54 ; 0x2ac54 } 2af1a: 62 96 adiw r28, 0x12 ; 18 2af1c: 0f b6 in r0, 0x3f ; 63 2af1e: f8 94 cli 2af20: de bf out 0x3e, r29 ; 62 2af22: 0f be out 0x3f, r0 ; 63 2af24: cd bf out 0x3d, r28 ; 61 2af26: df 91 pop r29 2af28: cf 91 pop r28 2af2a: 1f 91 pop r17 2af2c: ff 90 pop r15 2af2e: ef 90 pop r14 2af30: df 90 pop r13 2af32: cf 90 pop r12 2af34: 08 95 ret 0002af36 : 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) { 2af36: 8f 92 push r8 2af38: 9f 92 push r9 2af3a: af 92 push r10 2af3c: bf 92 push r11 2af3e: df 92 push r13 2af40: ef 92 push r14 2af42: ff 92 push r15 2af44: 0f 93 push r16 2af46: 1f 93 push r17 2af48: cf 93 push r28 2af4a: df 93 push r29 2af4c: cd b7 in r28, 0x3d ; 61 2af4e: de b7 in r29, 0x3e ; 62 2af50: 67 97 sbiw r28, 0x17 ; 23 2af52: 0f b6 in r0, 0x3f ; 63 2af54: f8 94 cli 2af56: de bf out 0x3e, r29 ; 62 2af58: 0f be out 0x3f, r0 ; 63 2af5a: cd bf out 0x3d, r28 ; 61 2af5c: 18 2f mov r17, r24 2af5e: 7b 01 movw r14, r22 2af60: d4 2e mov r13, r20 /// @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()) { 2af62: 07 e5 ldi r16, 0x57 ; 87 2af64: 0b 8b std Y+19, r16 ; 0x13 2af66: 8c 8b std Y+20, r24 ; 0x14 2af68: 7e 8b std Y+22, r23 ; 0x16 2af6a: 6d 8b std Y+21, r22 ; 0x15 2af6c: ce 01 movw r24, r28 2af6e: 43 96 adiw r24, 0x13 ; 19 2af70: 0f 94 69 4e call 0x29cd2 ; 0x29cd2 2af74: 8f 8b std Y+23, r24 ; 0x17 2af76: 0e 87 std Y+14, r16 ; 0x0e 2af78: 1f 87 std Y+15, r17 ; 0x0f 2af7a: f9 8a std Y+17, r15 ; 0x11 2af7c: e8 8a std Y+16, r14 ; 0x10 2af7e: ce 01 movw r24, r28 2af80: 0e 96 adiw r24, 0x0e ; 14 2af82: 0f 94 69 4e call 0x29cd2 ; 0x29cd2 2af86: 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; 2af88: 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) { 2af8a: 11 11 cpse r17, r1 2af8c: 27 c0 rjmp .+78 ; 0x2afdc *dst = '0'; 2af8e: 80 e3 ldi r24, 0x30 ; 48 2af90: 8a 83 std Y+2, r24 ; 0x02 return 1; 2af92: 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); 2af94: e1 e0 ldi r30, 0x01 ; 1 2af96: e8 0f add r30, r24 dst[i] = ' '; 2af98: 21 e0 ldi r18, 0x01 ; 1 2af9a: 30 e0 ldi r19, 0x00 ; 0 2af9c: 2c 0f add r18, r28 2af9e: 3d 1f adc r19, r29 2afa0: 2e 0f add r18, r30 2afa2: 31 1d adc r19, r1 2afa4: f9 01 movw r30, r18 2afa6: 90 e2 ldi r25, 0x20 ; 32 2afa8: 90 83 st Z, r25 return i + 1; 2afaa: 02 e0 ldi r16, 0x02 ; 2 2afac: 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); 2afae: aa 24 eor r10, r10 2afb0: a3 94 inc r10 2afb2: b1 2c mov r11, r1 2afb4: ac 0e add r10, r28 2afb6: bd 1e adc r11, r29 2afb8: a0 0e add r10, r16 2afba: 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) { 2afbc: e1 14 cp r14, r1 2afbe: f1 04 cpc r15, r1 2afc0: 39 f1 breq .+78 ; 0x2b010 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2afc2: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2afc4: c7 01 movw r24, r14 2afc6: 88 27 eor r24, r24 2afc8: 90 7f andi r25, 0xF0 ; 240 2afca: 89 2b or r24, r25 2afcc: 71 f4 brne .+28 ; 0x2afea value <<= 4U; 2afce: 24 e0 ldi r18, 0x04 ; 4 2afd0: ee 0c add r14, r14 2afd2: ff 1c adc r15, r15 2afd4: 2a 95 dec r18 2afd6: e1 f7 brne .-8 ; 0x2afd0 --charsOut; 2afd8: 11 50 subi r17, 0x01 ; 1 2afda: f4 cf rjmp .-24 ; 0x2afc4 2afdc: be 01 movw r22, r28 2afde: 6e 5f subi r22, 0xFE ; 254 2afe0: 7f 4f sbci r23, 0xFF ; 255 2afe2: 81 2f mov r24, r17 2afe4: 0f 94 3d 4e call 0x29c7a ; 0x29c7a 2afe8: d5 cf rjmp .-86 ; 0x2af94 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2afea: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2afec: 88 2d mov r24, r8 2afee: 8a 19 sub r24, r10 2aff0: 81 17 cp r24, r17 2aff2: 90 f4 brcc .+36 ; 0x2b018 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2aff4: 8f 2d mov r24, r15 2aff6: 82 95 swap r24 2aff8: 8f 70 andi r24, 0x0F ; 15 2affa: 94 e0 ldi r25, 0x04 ; 4 2affc: ee 0c add r14, r14 2affe: ff 1c adc r15, r15 2b000: 9a 95 dec r25 2b002: e1 f7 brne .-8 ; 0x2affc 2b004: 0f 94 33 4e call 0x29c66 ; 0x29c66 2b008: f4 01 movw r30, r8 2b00a: 81 93 st Z+, r24 2b00c: 4f 01 movw r8, r30 2b00e: ee cf rjmp .-36 ; 0x2afec } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2b010: 80 e3 ldi r24, 0x30 ; 48 2b012: f5 01 movw r30, r10 2b014: 80 83 st Z, r24 return 1; 2b016: 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); 2b018: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2b01a: e1 e0 ldi r30, 0x01 ; 1 2b01c: f0 e0 ldi r31, 0x00 ; 0 2b01e: ec 0f add r30, r28 2b020: fd 1f adc r31, r29 2b022: e1 0f add r30, r17 2b024: f1 1d adc r31, r1 2b026: 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 2b028: 9a e2 ldi r25, 0x2A ; 42 2b02a: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2b02c: 81 11 cpse r24, r1 2b02e: 21 c0 rjmp .+66 ; 0x2b072 *dst = '0'; 2b030: 80 e3 ldi r24, 0x30 ; 48 2b032: 81 83 std Z+1, r24 ; 0x01 return 1; 2b034: 81 e0 ldi r24, 0x01 ; 1 2b036: 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); 2b038: 18 0f add r17, r24 txbuff[i] = '\n'; 2b03a: e1 e0 ldi r30, 0x01 ; 1 2b03c: f0 e0 ldi r31, 0x00 ; 0 2b03e: ec 0f add r30, r28 2b040: fd 1f adc r31, r29 2b042: e1 0f add r30, r17 2b044: f1 1d adc r31, r1 2b046: 8a e0 ldi r24, 0x0A ; 10 2b048: 80 83 st Z, r24 ++i; 2b04a: 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); 2b04c: 9e 01 movw r18, r28 2b04e: 2f 5f subi r18, 0xFF ; 255 2b050: 3f 4f sbci r19, 0xFF ; 255 2b052: 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--){ 2b054: 59 01 movw r10, r18 2b056: a1 0e add r10, r17 2b058: b1 1c adc r11, r1 2b05a: ea 14 cp r14, r10 2b05c: fb 04 cpc r15, r11 2b05e: 79 f0 breq .+30 ; 0x2b07e fputc(*buffer, uart2io); 2b060: f7 01 movw r30, r14 2b062: 81 91 ld r24, Z+ 2b064: 7f 01 movw r14, r30 2b066: 64 e7 ldi r22, 0x74 ; 116 2b068: 72 e1 ldi r23, 0x12 ; 18 2b06a: 90 e0 ldi r25, 0x00 ; 0 2b06c: 0f 94 05 a2 call 0x3440a ; 0x3440a 2b070: f4 cf rjmp .-24 ; 0x2b05a 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); 2b072: bf 01 movw r22, r30 2b074: 6f 5f subi r22, 0xFF ; 255 2b076: 7f 4f sbci r23, 0xFF ; 255 2b078: 0f 94 3d 4e call 0x29c7a ; 0x29c7a 2b07c: dc cf rjmp .-72 ; 0x2b036 LogRequestMsg(txbuff, len); 2b07e: 61 2f mov r22, r17 2b080: ce 01 movw r24, r28 2b082: 01 96 adiw r24, 0x01 ; 1 2b084: 0f 94 d3 56 call 0x2ada6 ; 0x2ada6 RecordUARTActivity(); 2b088: 0f 94 2a 56 call 0x2ac54 ; 0x2ac54 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2b08c: d0 92 95 12 sts 0x1295, r13 ; 0x801295 } 2b090: 67 96 adiw r28, 0x17 ; 23 2b092: 0f b6 in r0, 0x3f ; 63 2b094: f8 94 cli 2b096: de bf out 0x3e, r29 ; 62 2b098: 0f be out 0x3f, r0 ; 63 2b09a: cd bf out 0x3d, r28 ; 61 2b09c: df 91 pop r29 2b09e: cf 91 pop r28 2b0a0: 1f 91 pop r17 2b0a2: 0f 91 pop r16 2b0a4: ff 90 pop r15 2b0a6: ef 90 pop r14 2b0a8: df 90 pop r13 2b0aa: bf 90 pop r11 2b0ac: af 90 pop r10 2b0ae: 9f 90 pop r9 2b0b0: 8f 90 pop r8 2b0b2: 08 95 ret 0002b0b4 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2b0b4: 20 91 e0 12 lds r18, 0x12E0 ; 0x8012e0 2b0b8: 2f 5f subi r18, 0xFF ; 255 2b0ba: 20 93 e0 12 sts 0x12E0, r18 ; 0x8012e0 if (regIndex >= initRegs8Count) { 2b0be: 22 30 cpi r18, 0x02 ; 2 2b0c0: 78 f4 brcc .+30 ; 0x2b0e0 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2b0c2: 30 e0 ldi r19, 0x00 ; 0 2b0c4: f9 01 movw r30, r18 2b0c6: e1 5a subi r30, 0xA1 ; 161 2b0c8: fe 45 sbci r31, 0x5E ; 94 2b0ca: 84 91 lpm r24, Z 2b0cc: 22 52 subi r18, 0x22 ; 34 2b0ce: 3d 4e sbci r19, 0xED ; 237 2b0d0: f9 01 movw r30, r18 2b0d2: 60 81 ld r22, Z 2b0d4: 70 e0 ldi r23, 0x00 ; 0 2b0d6: 49 e0 ldi r20, 0x09 ; 9 2b0d8: 0f 94 9b 57 call 0x2af36 ; 0x2af36 } return false; 2b0dc: 80 e0 ldi r24, 0x00 ; 0 2b0de: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2b0e0: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2b0e2: 08 95 ret 0002b0e4 : } /// 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){ 2b0e4: 2f 92 push r2 2b0e6: 3f 92 push r3 2b0e8: 4f 92 push r4 2b0ea: 5f 92 push r5 2b0ec: 6f 92 push r6 2b0ee: 7f 92 push r7 2b0f0: 8f 92 push r8 2b0f2: 9f 92 push r9 2b0f4: af 92 push r10 2b0f6: bf 92 push r11 2b0f8: cf 92 push r12 2b0fa: df 92 push r13 2b0fc: ef 92 push r14 2b0fe: ff 92 push r15 2b100: 0f 93 push r16 2b102: 1f 93 push r17 2b104: cf 93 push r28 2b106: df 93 push r29 2b108: 00 d0 rcall .+0 ; 0x2b10a 2b10a: 1f 92 push r1 2b10c: 1f 92 push r1 2b10e: cd b7 in r28, 0x3d ; 61 2b110: de b7 in r29, 0x3e ; 62 2b112: 2b 01 movw r4, r22 2b114: 1a 01 movw r2, r20 2b116: f1 2c mov r15, r1 2b118: 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; 2b11a: 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; 2b11c: 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; 2b11e: 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){ 2b120: 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); 2b122: 66 24 eor r6, r6 2b124: 63 94 inc r6 2b126: 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){ 2b128: 70 e0 ldi r23, 0x00 ; 0 2b12a: 60 e0 ldi r22, 0x00 ; 0 2b12c: 97 01 movw r18, r14 2b12e: 22 5a subi r18, 0xA2 ; 162 2b130: 39 4f sbci r19, 0xF9 ; 249 2b132: 3a 83 std Y+2, r19 ; 0x02 2b134: 29 83 std Y+1, r18 ; 0x01 2b136: 86 2e mov r8, r22 2b138: c9 80 ldd r12, Y+1 ; 0x01 2b13a: da 80 ldd r13, Y+2 ; 0x02 2b13c: c6 0e add r12, r22 2b13e: d7 1e adc r13, r23 2b140: 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; 2b142: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2b144: 40 e0 ldi r20, 0x00 ; 0 2b146: 30 e0 ldi r19, 0x00 ; 0 2b148: 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; 2b14a: ae ef ldi r26, 0xFE ; 254 2b14c: a4 0f add r26, r20 2b14e: 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; 2b150: 44 23 and r20, r20 2b152: 19 f0 breq .+6 ; 0x2b15a 2b154: 4b 30 cpi r20, 0x0B ; 11 2b156: 09 f0 breq .+2 ; 0x2b15a 2b158: 7d c0 rjmp .+250 ; 0x2b254 2b15a: ae ef ldi r26, 0xFE ; 254 2b15c: a2 0f add r26, r18 2b15e: a8 30 cpi r26, 0x08 ; 8 2b160: 08 f4 brcc .+2 ; 0x2b164 2b162: 7a c0 rjmp .+244 ; 0x2b258 2b164: 2f 5f subi r18, 0xFF ; 255 2b166: 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){ 2b168: 2c 30 cpi r18, 0x0C ; 12 2b16a: 31 05 cpc r19, r1 2b16c: 89 f7 brne .-30 ; 0x2b150 /// 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){ 2b16e: 4f 5f subi r20, 0xFF ; 255 2b170: 20 e2 ldi r18, 0x20 ; 32 2b172: c2 0e add r12, r18 2b174: d1 1c adc r13, r1 2b176: 32 96 adiw r30, 0x02 ; 2 2b178: 4c 30 cpi r20, 0x0C ; 12 2b17a: 29 f7 brne .-54 ; 0x2b146 // 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){ 2b17c: 3c 81 ldd r19, Y+4 ; 0x04 2b17e: 30 17 cp r19, r16 2b180: 18 f4 brcc .+6 ; 0x2b188 2b182: 0c 83 std Y+4, r16 ; 0x04 2b184: 5d 83 std Y+5, r21 ; 0x05 2b186: 18 2d mov r17, r8 2b188: 6f 5f subi r22, 0xFF ; 255 2b18a: 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){ 2b18c: 64 31 cpi r22, 0x14 ; 20 2b18e: 71 05 cpc r23, r1 2b190: 91 f6 brne .-92 ; 0x2b136 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){ 2b192: 5f 5f subi r21, 0xFF ; 255 2b194: a0 e2 ldi r26, 0x20 ; 32 2b196: ea 0e add r14, r26 2b198: f1 1c adc r15, r1 2b19a: 54 31 cpi r21, 0x14 ; 20 2b19c: 29 f6 brne .-118 ; 0x2b128 // 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); 2b19e: ec 81 ldd r30, Y+4 ; 0x04 2b1a0: 6e 2f mov r22, r30 2b1a2: 70 e0 ldi r23, 0x00 ; 0 2b1a4: 90 e0 ldi r25, 0x00 ; 0 2b1a6: 80 e0 ldi r24, 0x00 ; 0 2b1a8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2b1ac: 23 ec ldi r18, 0xC3 ; 195 2b1ae: 35 ef ldi r19, 0xF5 ; 245 2b1b0: 48 ea ldi r20, 0xA8 ; 168 2b1b2: 5f e3 ldi r21, 0x3F ; 63 2b1b4: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 2b1b8: 9f 93 push r25 2b1ba: 8f 93 push r24 2b1bc: 7f 93 push r23 2b1be: 6f 93 push r22 2b1c0: fd 81 ldd r31, Y+5 ; 0x05 2b1c2: 6f 2f mov r22, r31 2b1c4: 70 e0 ldi r23, 0x00 ; 0 2b1c6: 90 e0 ldi r25, 0x00 ; 0 2b1c8: 80 e0 ldi r24, 0x00 ; 0 2b1ca: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2b1ce: 20 e0 ldi r18, 0x00 ; 0 2b1d0: 30 e0 ldi r19, 0x00 ; 0 2b1d2: 40 eb ldi r20, 0xB0 ; 176 2b1d4: 50 e4 ldi r21, 0x40 ; 64 2b1d6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2b1da: 9f 93 push r25 2b1dc: 8f 93 push r24 2b1de: 7f 93 push r23 2b1e0: 6f 93 push r22 2b1e2: 61 2f mov r22, r17 2b1e4: 70 e0 ldi r23, 0x00 ; 0 2b1e6: 90 e0 ldi r25, 0x00 ; 0 2b1e8: 80 e0 ldi r24, 0x00 ; 0 2b1ea: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2b1ee: 20 e0 ldi r18, 0x00 ; 0 2b1f0: 30 e0 ldi r19, 0x00 ; 0 2b1f2: 40 eb ldi r20, 0xB0 ; 176 2b1f4: 50 e4 ldi r21, 0x40 ; 64 2b1f6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2b1fa: 9f 93 push r25 2b1fc: 8f 93 push r24 2b1fe: 7f 93 push r23 2b200: 6f 93 push r22 2b202: 81 ec ldi r24, 0xC1 ; 193 2b204: 9c e9 ldi r25, 0x9C ; 156 2b206: 9f 93 push r25 2b208: 8f 93 push r24 2b20a: 0f 94 5f a2 call 0x344be ; 0x344be *pc = max_c; 2b20e: f2 01 movw r30, r4 2b210: 10 83 st Z, r17 *pr = max_r; 2b212: 2d 81 ldd r18, Y+5 ; 0x05 2b214: f1 01 movw r30, r2 2b216: 20 83 st Z, r18 2b218: 0f b6 in r0, 0x3f ; 63 2b21a: f8 94 cli 2b21c: de bf out 0x3e, r29 ; 62 2b21e: 0f be out 0x3f, r0 ; 63 2b220: cd bf out 0x3d, r28 ; 61 return max_match; } 2b222: 8c 81 ldd r24, Y+4 ; 0x04 2b224: 0f 90 pop r0 2b226: 0f 90 pop r0 2b228: 0f 90 pop r0 2b22a: 0f 90 pop r0 2b22c: 0f 90 pop r0 2b22e: df 91 pop r29 2b230: cf 91 pop r28 2b232: 1f 91 pop r17 2b234: 0f 91 pop r16 2b236: ff 90 pop r15 2b238: ef 90 pop r14 2b23a: df 90 pop r13 2b23c: cf 90 pop r12 2b23e: bf 90 pop r11 2b240: af 90 pop r10 2b242: 9f 90 pop r9 2b244: 8f 90 pop r8 2b246: 7f 90 pop r7 2b248: 6f 90 pop r6 2b24a: 5f 90 pop r5 2b24c: 4f 90 pop r4 2b24e: 3f 90 pop r3 2b250: 2f 90 pop r2 2b252: 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; 2b254: 22 23 and r18, r18 2b256: 11 f0 breq .+4 ; 0x2b25c 2b258: 2b 30 cpi r18, 0x0B ; 11 2b25a: 21 f4 brne .+8 ; 0x2b264 2b25c: ab 81 ldd r26, Y+3 ; 0x03 2b25e: a8 30 cpi r26, 0x08 ; 8 2b260: 08 f0 brcs .+2 ; 0x2b264 2b262: 80 cf rjmp .-256 ; 0x2b164 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2b264: 99 24 eor r9, r9 2b266: 93 94 inc r9 2b268: d6 01 movw r26, r12 2b26a: a2 0f add r26, r18 2b26c: b3 1f adc r27, r19 2b26e: ac 91 ld r26, X 2b270: a1 31 cpi r26, 0x11 ; 17 2b272: 08 f4 brcc .+2 ; 0x2b276 2b274: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2b276: a0 80 ld r10, Z 2b278: b1 80 ldd r11, Z+1 ; 0x01 2b27a: d3 01 movw r26, r6 2b27c: 02 2e mov r0, r18 2b27e: 02 c0 rjmp .+4 ; 0x2b284 2b280: aa 0f add r26, r26 2b282: bb 1f adc r27, r27 2b284: 0a 94 dec r0 2b286: e2 f7 brpl .-8 ; 0x2b280 2b288: aa 21 and r26, r10 2b28a: bb 21 and r27, r11 2b28c: bb 24 eor r11, r11 2b28e: b3 94 inc r11 2b290: ab 2b or r26, r27 2b292: 09 f4 brne .+2 ; 0x2b296 2b294: b1 2c mov r11, r1 if (high_pix == high_pat) 2b296: 9b 10 cpse r9, r11 2b298: 65 cf rjmp .-310 ; 0x2b164 match++; 2b29a: 0f 5f subi r16, 0xFF ; 255 2b29c: 63 cf rjmp .-314 ; 0x2b164 0002b29e : * \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) { 2b29e: 8f 92 push r8 2b2a0: 9f 92 push r9 2b2a2: af 92 push r10 2b2a4: bf 92 push r11 2b2a6: cf 92 push r12 2b2a8: df 92 push r13 2b2aa: ef 92 push r14 2b2ac: ff 92 push r15 2b2ae: cf 93 push r28 2b2b0: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2b2b2: 24 e4 ldi r18, 0x44 ; 68 2b2b4: 36 e1 ldi r19, 0x16 ; 22 2b2b6: 30 93 44 0e sts 0x0E44, r19 ; 0x800e44 2b2ba: 20 93 43 0e sts 0x0E43, r18 ; 0x800e43 fatType_ = 0; 2b2be: 10 92 60 16 sts 0x1660, r1 ; 0x801660 allocSearchStart_ = 2; 2b2c2: 42 e0 ldi r20, 0x02 ; 2 2b2c4: 50 e0 ldi r21, 0x00 ; 0 2b2c6: 60 e0 ldi r22, 0x00 ; 0 2b2c8: 70 e0 ldi r23, 0x00 ; 0 2b2ca: 40 93 49 16 sts 0x1649, r20 ; 0x801649 2b2ce: 50 93 4a 16 sts 0x164A, r21 ; 0x80164a 2b2d2: 60 93 4b 16 sts 0x164B, r22 ; 0x80164b 2b2d6: 70 93 4c 16 sts 0x164C, r23 ; 0x80164c cacheDirty_ = 0; // cacheFlush() will write block if true 2b2da: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 cacheMirrorBlock_ = 0; 2b2de: 10 92 3e 0e sts 0x0E3E, r1 ; 0x800e3e 2b2e2: 10 92 3f 0e sts 0x0E3F, r1 ; 0x800e3f 2b2e6: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 2b2ea: 10 92 41 0e sts 0x0E41, r1 ; 0x800e41 cacheBlockNumber_ = 0XFFFFFFFF; 2b2ee: 4f ef ldi r20, 0xFF ; 255 2b2f0: 5f ef ldi r21, 0xFF ; 255 2b2f2: ba 01 movw r22, r20 2b2f4: 40 93 3a 0e sts 0x0E3A, r20 ; 0x800e3a 2b2f8: 50 93 3b 0e sts 0x0E3B, r21 ; 0x800e3b 2b2fc: 60 93 3c 0e sts 0x0E3C, r22 ; 0x800e3c 2b300: 70 93 3d 0e sts 0x0E3D, r23 ; 0x800e3d // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2b304: 88 23 and r24, r24 2b306: 09 f4 brne .+2 ; 0x2b30a 2b308: 70 c0 rjmp .+224 ; 0x2b3ea if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2b30a: 40 e0 ldi r20, 0x00 ; 0 2b30c: 60 e0 ldi r22, 0x00 ; 0 2b30e: 70 e0 ldi r23, 0x00 ; 0 2b310: cb 01 movw r24, r22 2b312: 0f 94 0f 28 call 0x2501e ; 0x2501e 2b316: 81 11 cpse r24, r1 2b318: 0d c0 rjmp .+26 ; 0x2b334 fatType_ = 32; } return true; fail: return false; 2b31a: c0 e0 ldi r28, 0x00 ; 0 } 2b31c: 8c 2f mov r24, r28 2b31e: df 91 pop r29 2b320: cf 91 pop r28 2b322: ff 90 pop r15 2b324: ef 90 pop r14 2b326: df 90 pop r13 2b328: cf 90 pop r12 2b32a: bf 90 pop r11 2b32c: af 90 pop r10 2b32e: 9f 90 pop r9 2b330: 8f 90 pop r8 2b332: 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 || 2b334: 80 91 04 10 lds r24, 0x1004 ; 0x801004 2b338: 8f 77 andi r24, 0x7F ; 127 2b33a: 79 f7 brne .-34 ; 0x2b31a 2b33c: 80 91 10 10 lds r24, 0x1010 ; 0x801010 2b340: 90 91 11 10 lds r25, 0x1011 ; 0x801011 2b344: a0 91 12 10 lds r26, 0x1012 ; 0x801012 2b348: b0 91 13 10 lds r27, 0x1013 ; 0x801013 2b34c: 84 36 cpi r24, 0x64 ; 100 2b34e: 91 05 cpc r25, r1 2b350: a1 05 cpc r26, r1 2b352: b1 05 cpc r27, r1 2b354: 10 f3 brcs .-60 ; 0x2b31a p->totalSectors < 100 || p->firstSector == 0) { 2b356: c0 90 0c 10 lds r12, 0x100C ; 0x80100c 2b35a: d0 90 0d 10 lds r13, 0x100D ; 0x80100d 2b35e: e0 90 0e 10 lds r14, 0x100E ; 0x80100e 2b362: f0 90 0f 10 lds r15, 0x100F ; 0x80100f 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 || 2b366: c1 14 cp r12, r1 2b368: d1 04 cpc r13, r1 2b36a: e1 04 cpc r14, r1 2b36c: f1 04 cpc r15, r1 2b36e: a9 f2 breq .-86 ; 0x2b31a // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2b370: 40 e0 ldi r20, 0x00 ; 0 2b372: c7 01 movw r24, r14 2b374: b6 01 movw r22, r12 2b376: 0f 94 0f 28 call 0x2501e ; 0x2501e 2b37a: c8 2f mov r28, r24 2b37c: 88 23 and r24, r24 2b37e: 69 f2 breq .-102 ; 0x2b31a fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2b380: 80 91 51 0e lds r24, 0x0E51 ; 0x800e51 2b384: 90 91 52 0e lds r25, 0x0E52 ; 0x800e52 2b388: 81 15 cp r24, r1 2b38a: 92 40 sbci r25, 0x02 ; 2 2b38c: 31 f6 brne .-116 ; 0x2b31a fbs->fatCount == 0 || 2b38e: a0 91 56 0e lds r26, 0x0E56 ; 0x800e56 } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2b392: aa 23 and r26, r26 2b394: 11 f2 breq .-124 ; 0x2b31a fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2b396: 60 91 54 0e lds r22, 0x0E54 ; 0x800e54 2b39a: 70 91 55 0e lds r23, 0x0E55 ; 0x800e55 volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2b39e: 61 15 cp r22, r1 2b3a0: 71 05 cpc r23, r1 2b3a2: 09 f4 brne .+2 ; 0x2b3a6 2b3a4: ba cf rjmp .-140 ; 0x2b31a fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2b3a6: 20 91 53 0e lds r18, 0x0E53 ; 0x800e53 } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2b3aa: 22 23 and r18, r18 2b3ac: 09 f4 brne .+2 ; 0x2b3b0 2b3ae: b5 cf rjmp .-150 ; 0x2b31a fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2b3b0: a0 93 5b 16 sts 0x165B, r26 ; 0x80165b blocksPerCluster_ = fbs->sectorsPerCluster; 2b3b4: 20 93 4d 16 sts 0x164D, r18 ; 0x80164d // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2b3b8: 90 e0 ldi r25, 0x00 ; 0 2b3ba: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2b3bc: 30 e0 ldi r19, 0x00 ; 0 2b3be: e1 e0 ldi r30, 0x01 ; 1 2b3c0: f0 e0 ldi r31, 0x00 ; 0 2b3c2: d8 2f mov r29, r24 2b3c4: af 01 movw r20, r30 2b3c6: 08 2e mov r0, r24 2b3c8: 02 c0 rjmp .+4 ; 0x2b3ce 2b3ca: 44 0f add r20, r20 2b3cc: 55 1f adc r21, r21 2b3ce: 0a 94 dec r0 2b3d0: e2 f7 brpl .-8 ; 0x2b3ca 2b3d2: 24 17 cp r18, r20 2b3d4: 35 07 cpc r19, r21 2b3d6: 69 f0 breq .+26 ; 0x2b3f2 2b3d8: 41 e0 ldi r20, 0x01 ; 1 2b3da: 48 0f add r20, r24 2b3dc: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2b3de: 89 30 cpi r24, 0x09 ; 9 2b3e0: 91 05 cpc r25, r1 2b3e2: 79 f7 brne .-34 ; 0x2b3c2 2b3e4: 40 93 56 16 sts 0x1656, r20 ; 0x801656 2b3e8: 98 cf rjmp .-208 ; 0x2b31a * 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; 2b3ea: c1 2c mov r12, r1 2b3ec: d1 2c mov r13, r1 2b3ee: 76 01 movw r14, r12 2b3f0: bf cf rjmp .-130 ; 0x2b370 2b3f2: 80 93 56 16 sts 0x1656, r24 ; 0x801656 clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2b3f6: 20 91 5c 0e lds r18, 0x0E5C ; 0x800e5c 2b3fa: 30 91 5d 0e lds r19, 0x0E5D ; 0x800e5d 2b3fe: 50 e0 ldi r21, 0x00 ; 0 2b400: 40 e0 ldi r20, 0x00 ; 0 2b402: 21 15 cp r18, r1 2b404: 31 05 cpc r19, r1 2b406: 41 f4 brne .+16 ; 0x2b418 2b408: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 2b40c: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 2b410: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 2b414: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 2b418: 20 93 4e 16 sts 0x164E, r18 ; 0x80164e 2b41c: 30 93 4f 16 sts 0x164F, r19 ; 0x80164f 2b420: 40 93 50 16 sts 0x1650, r20 ; 0x801650 2b424: 50 93 51 16 sts 0x1651, r21 ; 0x801651 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2b428: 46 01 movw r8, r12 2b42a: 57 01 movw r10, r14 2b42c: 86 0e add r8, r22 2b42e: 97 1e adc r9, r23 2b430: a1 1c adc r10, r1 2b432: b1 1c adc r11, r1 2b434: 80 92 5c 16 sts 0x165C, r8 ; 0x80165c 2b438: 90 92 5d 16 sts 0x165D, r9 ; 0x80165d 2b43c: a0 92 5e 16 sts 0x165E, r10 ; 0x80165e 2b440: b0 92 5f 16 sts 0x165F, r11 ; 0x80165f // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2b444: e0 91 57 0e lds r30, 0x0E57 ; 0x800e57 2b448: f0 91 58 0e lds r31, 0x0E58 ; 0x800e58 2b44c: f0 93 62 16 sts 0x1662, r31 ; 0x801662 2b450: e0 93 61 16 sts 0x1661, r30 ; 0x801661 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2b454: b0 e0 ldi r27, 0x00 ; 0 2b456: 0f 94 32 a4 call 0x34864 ; 0x34864 <__muluhisi3> 2b45a: dc 01 movw r26, r24 2b45c: cb 01 movw r24, r22 2b45e: 88 0d add r24, r8 2b460: 99 1d adc r25, r9 2b462: aa 1d adc r26, r10 2b464: bb 1d adc r27, r11 2b466: 80 93 63 16 sts 0x1663, r24 ; 0x801663 2b46a: 90 93 64 16 sts 0x1664, r25 ; 0x801664 2b46e: a0 93 65 16 sts 0x1665, r26 ; 0x801665 2b472: b0 93 66 16 sts 0x1666, r27 ; 0x801666 // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2b476: 25 e0 ldi r18, 0x05 ; 5 2b478: ee 0f add r30, r30 2b47a: ff 1f adc r31, r31 2b47c: 2a 95 dec r18 2b47e: e1 f7 brne .-8 ; 0x2b478 2b480: e1 50 subi r30, 0x01 ; 1 2b482: fe 4f sbci r31, 0xFE ; 254 2b484: ef 2f mov r30, r31 2b486: ff 27 eor r31, r31 2b488: e6 95 lsr r30 2b48a: 8e 0f add r24, r30 2b48c: 9f 1f adc r25, r31 2b48e: a1 1d adc r26, r1 2b490: b1 1d adc r27, r1 2b492: 80 93 57 16 sts 0x1657, r24 ; 0x801657 2b496: 90 93 58 16 sts 0x1658, r25 ; 0x801658 2b49a: a0 93 59 16 sts 0x1659, r26 ; 0x801659 2b49e: b0 93 5a 16 sts 0x165A, r27 ; 0x80165a // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2b4a2: 80 90 59 0e lds r8, 0x0E59 ; 0x800e59 2b4a6: 90 90 5a 0e lds r9, 0x0E5A ; 0x800e5a 2b4aa: b1 2c mov r11, r1 2b4ac: a1 2c mov r10, r1 2b4ae: 81 14 cp r8, r1 2b4b0: 91 04 cpc r9, r1 2b4b2: 41 f4 brne .+16 ; 0x2b4c4 2b4b4: 80 90 66 0e lds r8, 0x0E66 ; 0x800e66 2b4b8: 90 90 67 0e lds r9, 0x0E67 ; 0x800e67 2b4bc: a0 90 68 0e lds r10, 0x0E68 ; 0x800e68 2b4c0: b0 90 69 0e lds r11, 0x0E69 ; 0x800e69 fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2b4c4: c8 1a sub r12, r24 2b4c6: d9 0a sbc r13, r25 2b4c8: ea 0a sbc r14, r26 2b4ca: fb 0a sbc r15, r27 2b4cc: c8 0c add r12, r8 2b4ce: d9 1c adc r13, r9 2b4d0: ea 1c adc r14, r10 2b4d2: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2b4d4: 04 c0 rjmp .+8 ; 0x2b4de 2b4d6: f6 94 lsr r15 2b4d8: e7 94 ror r14 2b4da: d7 94 ror r13 2b4dc: c7 94 ror r12 2b4de: da 95 dec r29 2b4e0: d2 f7 brpl .-12 ; 0x2b4d6 2b4e2: c0 92 52 16 sts 0x1652, r12 ; 0x801652 2b4e6: d0 92 53 16 sts 0x1653, r13 ; 0x801653 2b4ea: e0 92 54 16 sts 0x1654, r14 ; 0x801654 2b4ee: f0 92 55 16 sts 0x1655, r15 ; 0x801655 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2b4f2: 85 ef ldi r24, 0xF5 ; 245 2b4f4: c8 16 cp r12, r24 2b4f6: 8f e0 ldi r24, 0x0F ; 15 2b4f8: d8 06 cpc r13, r24 2b4fa: e1 04 cpc r14, r1 2b4fc: f1 04 cpc r15, r1 2b4fe: 20 f4 brcc .+8 ; 0x2b508 fatType_ = 12; 2b500: 8c e0 ldi r24, 0x0C ; 12 2b502: 80 93 60 16 sts 0x1660, r24 ; 0x801660 2b506: 09 cf rjmp .-494 ; 0x2b31a if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2b508: 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) { 2b50a: 25 ef ldi r18, 0xF5 ; 245 2b50c: c2 16 cp r12, r18 2b50e: 2f ef ldi r18, 0xFF ; 255 2b510: d2 06 cpc r13, r18 2b512: e1 04 cpc r14, r1 2b514: f1 04 cpc r15, r1 2b516: 88 f0 brcs .+34 ; 0x2b53a fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2b518: 80 91 72 0e lds r24, 0x0E72 ; 0x800e72 2b51c: 90 91 73 0e lds r25, 0x0E73 ; 0x800e73 2b520: a0 91 74 0e lds r26, 0x0E74 ; 0x800e74 2b524: b0 91 75 0e lds r27, 0x0E75 ; 0x800e75 2b528: 80 93 63 16 sts 0x1663, r24 ; 0x801663 2b52c: 90 93 64 16 sts 0x1664, r25 ; 0x801664 2b530: a0 93 65 16 sts 0x1665, r26 ; 0x801665 2b534: b0 93 66 16 sts 0x1666, r27 ; 0x801666 fatType_ = 32; 2b538: 80 e2 ldi r24, 0x20 ; 32 2b53a: 80 93 60 16 sts 0x1660, r24 ; 0x801660 2b53e: ee ce rjmp .-548 ; 0x2b31c 0002b540 : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2b540: 0f 93 push r16 2b542: 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_ ){ 2b544: 60 91 84 16 lds r22, 0x1684 ; 0x801684 2b548: 70 91 85 16 lds r23, 0x1685 ; 0x801685 2b54c: 80 91 86 16 lds r24, 0x1686 ; 0x801686 2b550: 90 91 87 16 lds r25, 0x1687 ; 0x801687 2b554: 00 91 3a 0e lds r16, 0x0E3A ; 0x800e3a 2b558: 10 91 3b 0e lds r17, 0x0E3B ; 0x800e3b 2b55c: 20 91 3c 0e lds r18, 0x0E3C ; 0x800e3c 2b560: 30 91 3d 0e lds r19, 0x0E3D ; 0x800e3d 2b564: 60 17 cp r22, r16 2b566: 71 07 cpc r23, r17 2b568: 82 07 cpc r24, r18 2b56a: 93 07 cpc r25, r19 2b56c: 39 f1 breq .+78 ; 0x2b5bc if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2b56e: 40 e0 ldi r20, 0x00 ; 0 2b570: 0f 94 0f 28 call 0x2501e ; 0x2501e 2b574: 88 23 and r24, r24 2b576: f9 f0 breq .+62 ; 0x2b5b6 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2b578: 20 91 88 16 lds r18, 0x1688 ; 0x801688 2b57c: 30 91 89 16 lds r19, 0x1689 ; 0x801689 2b580: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2b584: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2b588: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2b58c: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2b590: 42 1b sub r20, r18 2b592: 53 0b sbc r21, r19 2b594: 61 09 sbc r22, r1 2b596: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2b598: 41 30 cpi r20, 0x01 ; 1 2b59a: 92 e0 ldi r25, 0x02 ; 2 2b59c: 59 07 cpc r21, r25 2b59e: 61 05 cpc r22, r1 2b5a0: 71 05 cpc r23, r1 2b5a2: 20 f0 brcs .+8 ; 0x2b5ac 2b5a4: 40 e0 ldi r20, 0x00 ; 0 2b5a6: 52 e0 ldi r21, 0x02 ; 2 2b5a8: 60 e0 ldi r22, 0x00 ; 0 2b5aa: 70 e0 ldi r23, 0x00 ; 0 2b5ac: 4a 5b subi r20, 0xBA ; 186 2b5ae: 51 4f sbci r21, 0xF1 ; 241 2b5b0: 9a e0 ldi r25, 0x0A ; 10 2b5b2: fa 01 movw r30, r20 2b5b4: 90 83 st Z, r25 } return true; } 2b5b6: 1f 91 pop r17 2b5b8: 0f 91 pop r16 2b5ba: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2b5bc: 81 e0 ldi r24, 0x01 ; 1 2b5be: fb cf rjmp .-10 ; 0x2b5b6 0002b5c0 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2b5c0: 20 e0 ldi r18, 0x00 ; 0 2b5c2: 30 e0 ldi r19, 0x00 ; 0 2b5c4: 40 ea ldi r20, 0xA0 ; 160 2b5c6: 52 e4 ldi r21, 0x42 ; 66 2b5c8: 60 e0 ldi r22, 0x00 ; 0 2b5ca: 70 e0 ldi r23, 0x00 ; 0 2b5cc: 80 ea ldi r24, 0xA0 ; 160 2b5ce: 92 ec ldi r25, 0xC2 ; 194 2b5d0: 0d 94 9c 4e jmp 0x29d38 ; 0x29d38 0002b5d4 : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2b5d4: 90 91 02 13 lds r25, 0x1302 ; 0x801302 2b5d8: 91 fd sbrc r25, 1 2b5da: 17 c0 rjmp .+46 ; 0x2b60a return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2b5dc: 88 23 and r24, r24 2b5de: a9 f0 breq .+42 ; 0x2b60a 2b5e0: 92 fd sbrc r25, 2 2b5e2: 13 c0 rjmp .+38 ; 0x2b60a Disable_E0(); 2b5e4: 0f 94 9a 4e call 0x29d34 ; 0x29d34 resume_hotend_temp = thermal_degTargetHotend(); 2b5e8: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 2b5ec: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 2b5f0: 90 93 f7 12 sts 0x12F7, r25 ; 0x8012f7 2b5f4: 80 93 f6 12 sts 0x12F6, r24 ; 0x8012f6 mmu_print_saved |= SavedState::CooldownPending; 2b5f8: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b5fc: 84 60 ori r24, 0x04 ; 4 2b5fe: 80 93 02 13 sts 0x1302, r24 ; 0x801302 LogEchoEvent_P(PSTR("Heater cooldown pending")); 2b602: 8d ef ldi r24, 0xFD ; 253 2b604: 9d e9 ldi r25, 0x9D ; 157 2b606: 0d 94 c0 4e jmp 0x29d80 ; 0x29d80 } } 2b60a: 08 95 ret 0002b60c : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2b60c: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b610: 80 ff sbrs r24, 0 2b612: 45 c0 rjmp .+138 ; 0x2b69e LogEchoEvent_P(PSTR("Resuming XYZ")); 2b614: 85 e1 ldi r24, 0x15 ; 21 2b616: 9e e9 ldi r25, 0x9E ; 158 2b618: 0f 94 c0 4e call 0x29d80 ; 0x29d80 // 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)); 2b61c: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee 2b620: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef 2b624: a0 91 f0 12 lds r26, 0x12F0 ; 0x8012f0 2b628: b0 91 f1 12 lds r27, 0x12F1 ; 0x8012f1 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; 2b62c: 40 91 ea 12 lds r20, 0x12EA ; 0x8012ea 2b630: 50 91 eb 12 lds r21, 0x12EB ; 0x8012eb 2b634: 60 91 ec 12 lds r22, 0x12EC ; 0x8012ec 2b638: 70 91 ed 12 lds r23, 0x12ED ; 0x8012ed 2b63c: 40 93 61 12 sts 0x1261, r20 ; 0x801261 2b640: 50 93 62 12 sts 0x1262, r21 ; 0x801262 2b644: 60 93 63 12 sts 0x1263, r22 ; 0x801263 2b648: 70 93 64 12 sts 0x1264, r23 ; 0x801264 current_position[Y_AXIS] = ry; 2b64c: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2b650: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2b654: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2b658: b0 93 68 12 sts 0x1268, r27 ; 0x801268 planner_line_to_current_position_sync(feedRate_mm_s); 2b65c: 60 e0 ldi r22, 0x00 ; 0 2b65e: 70 e0 ldi r23, 0x00 ; 0 2b660: 88 e4 ldi r24, 0x48 ; 72 2b662: 92 e4 ldi r25, 0x42 ; 66 2b664: 0f 94 bc 4e call 0x29d78 ; 0x29d78 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2b668: 80 91 f2 12 lds r24, 0x12F2 ; 0x8012f2 2b66c: 90 91 f3 12 lds r25, 0x12F3 ; 0x8012f3 2b670: a0 91 f4 12 lds r26, 0x12F4 ; 0x8012f4 2b674: b0 91 f5 12 lds r27, 0x12F5 ; 0x8012f5 2b678: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2b67c: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 2b680: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 2b684: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c planner_line_to_current_position_sync(feedRate_mm_s); 2b688: 60 e0 ldi r22, 0x00 ; 0 2b68a: 70 e0 ldi r23, 0x00 ; 0 2b68c: 80 e7 ldi r24, 0x70 ; 112 2b68e: 91 e4 ldi r25, 0x41 ; 65 2b690: 0f 94 bc 4e call 0x29d78 ; 0x29d78 // 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); 2b694: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b698: 8e 7f andi r24, 0xFE ; 254 2b69a: 80 93 02 13 sts 0x1302, r24 ; 0x801302 } } 2b69e: 08 95 ret 0002b6a0 : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2b6a0: 0f 93 push r16 2b6a2: 1f 93 push r17 2b6a4: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2b6a6: 90 91 02 13 lds r25, 0x1302 ; 0x801302 2b6aa: 91 11 cpse r25, r1 2b6ac: 72 c0 rjmp .+228 ; 0x2b792 2b6ae: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2b6b0: 8a ee ldi r24, 0xEA ; 234 2b6b2: 9d e9 ldi r25, 0x9D ; 157 2b6b4: 0f 94 c0 4e call 0x29d80 ; 0x29d80 Disable_E0(); 2b6b8: 0f 94 9a 4e call 0x29d34 ; 0x29d34 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2b6bc: 0f 94 b0 18 call 0x23160 ; 0x23160 /// 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; 2b6c0: 80 91 73 12 lds r24, 0x1273 ; 0x801273 2b6c4: 81 11 cpse r24, r1 2b6c6: 02 c0 rjmp .+4 ; 0x2b6cc 2b6c8: 0e 94 76 63 call 0xc6ec ; 0xc6ec // 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) { 2b6cc: cc 23 and r28, r28 2b6ce: 09 f4 brne .+2 ; 0x2b6d2 2b6d0: 60 c0 rjmp .+192 ; 0x2b792 mmu_print_saved |= SavedState::ParkExtruder; 2b6d2: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b6d6: 81 60 ori r24, 0x01 ; 1 2b6d8: 80 93 02 13 sts 0x1302, r24 ; 0x801302 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]); 2b6dc: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2b6e0: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2b6e4: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2b6e8: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2b6ec: 40 91 65 12 lds r20, 0x1265 ; 0x801265 2b6f0: 50 91 66 12 lds r21, 0x1266 ; 0x801266 2b6f4: 60 91 67 12 lds r22, 0x1267 ; 0x801267 2b6f8: 70 91 68 12 lds r23, 0x1268 ; 0x801268 resume_position = planner_current_position(); // save current pos 2b6fc: 00 91 61 12 lds r16, 0x1261 ; 0x801261 2b700: 10 91 62 12 lds r17, 0x1262 ; 0x801262 2b704: 20 91 63 12 lds r18, 0x1263 ; 0x801263 2b708: 30 91 64 12 lds r19, 0x1264 ; 0x801264 2b70c: 00 93 ea 12 sts 0x12EA, r16 ; 0x8012ea 2b710: 10 93 eb 12 sts 0x12EB, r17 ; 0x8012eb 2b714: 20 93 ec 12 sts 0x12EC, r18 ; 0x8012ec 2b718: 30 93 ed 12 sts 0x12ED, r19 ; 0x8012ed 2b71c: 40 93 ee 12 sts 0x12EE, r20 ; 0x8012ee 2b720: 50 93 ef 12 sts 0x12EF, r21 ; 0x8012ef 2b724: 60 93 f0 12 sts 0x12F0, r22 ; 0x8012f0 2b728: 70 93 f1 12 sts 0x12F1, r23 ; 0x8012f1 2b72c: 80 93 f2 12 sts 0x12F2, r24 ; 0x8012f2 2b730: 90 93 f3 12 sts 0x12F3, r25 ; 0x8012f3 2b734: a0 93 f4 12 sts 0x12F4, r26 ; 0x8012f4 2b738: b0 93 f5 12 sts 0x12F5, r27 ; 0x8012f5 current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2b73c: 60 e0 ldi r22, 0x00 ; 0 2b73e: 70 e0 ldi r23, 0x00 ; 0 2b740: 80 ea ldi r24, 0xA0 ; 160 2b742: 91 e4 ldi r25, 0x41 ; 65 2b744: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2b748: 80 91 39 06 lds r24, 0x0639 ; 0x800639 2b74c: 88 23 and r24, r24 2b74e: 09 f1 breq .+66 ; 0x2b792 2b750: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 2b754: 88 23 and r24, r24 2b756: e9 f0 breq .+58 ; 0x2b792 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; 2b758: 80 e0 ldi r24, 0x00 ; 0 2b75a: 90 e0 ldi r25, 0x00 ; 0 2b75c: aa ef ldi r26, 0xFA ; 250 2b75e: b2 e4 ldi r27, 0x42 ; 66 2b760: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2b764: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2b768: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2b76c: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2b770: 10 92 65 12 sts 0x1265, r1 ; 0x801265 2b774: 10 92 66 12 sts 0x1266, r1 ; 0x801266 2b778: 10 92 67 12 sts 0x1267, r1 ; 0x801267 2b77c: 10 92 68 12 sts 0x1268, r1 ; 0x801268 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2b780: 60 e0 ldi r22, 0x00 ; 0 2b782: 70 e0 ldi r23, 0x00 ; 0 2b784: 88 e4 ldi r24, 0x48 ; 72 2b786: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2b788: cf 91 pop r28 2b78a: 1f 91 pop r17 2b78c: 0f 91 pop r16 2b78e: 0d 94 bc 4e jmp 0x29d78 ; 0x29d78 2b792: cf 91 pop r28 2b794: 1f 91 pop r17 2b796: 0f 91 pop r16 2b798: 08 95 ret 0002b79a : /// 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){ 2b79a: 2f 92 push r2 2b79c: 3f 92 push r3 2b79e: 4f 92 push r4 2b7a0: 5f 92 push r5 2b7a2: 6f 92 push r6 2b7a4: 7f 92 push r7 2b7a6: 8f 92 push r8 2b7a8: 9f 92 push r9 2b7aa: af 92 push r10 2b7ac: bf 92 push r11 2b7ae: cf 92 push r12 2b7b0: df 92 push r13 2b7b2: ef 92 push r14 2b7b4: ff 92 push r15 2b7b6: 0f 93 push r16 2b7b8: 1f 93 push r17 2b7ba: cf 93 push r28 2b7bc: df 93 push r29 2b7be: cd b7 in r28, 0x3d ; 61 2b7c0: de b7 in r29, 0x3e ; 62 2b7c2: cd 5b subi r28, 0xBD ; 189 2b7c4: d1 40 sbci r29, 0x01 ; 1 2b7c6: 0f b6 in r0, 0x3f ; 63 2b7c8: f8 94 cli 2b7ca: de bf out 0x3e, r29 ; 62 2b7cc: 0f be out 0x3f, r0 ; 63 2b7ce: cd bf out 0x3d, r28 ; 61 2b7d0: c3 57 subi r28, 0x73 ; 115 2b7d2: de 4f sbci r29, 0xFE ; 254 2b7d4: 99 83 std Y+1, r25 ; 0x01 2b7d6: 88 83 st Y, r24 2b7d8: cd 58 subi r28, 0x8D ; 141 2b7da: d1 40 sbci r29, 0x01 ; 1 2b7dc: c1 57 subi r28, 0x71 ; 113 2b7de: de 4f sbci r29, 0xFE ; 254 2b7e0: 79 83 std Y+1, r23 ; 0x01 2b7e2: 68 83 st Y, r22 2b7e4: cf 58 subi r28, 0x8F ; 143 2b7e6: d1 40 sbci r29, 0x01 ; 1 2b7e8: ce 56 subi r28, 0x6E ; 110 2b7ea: de 4f sbci r29, 0xFE ; 254 2b7ec: 59 83 std Y+1, r21 ; 0x01 2b7ee: 48 83 st Y, r20 2b7f0: c2 59 subi r28, 0x92 ; 146 2b7f2: d1 40 sbci r29, 0x01 ; 1 2b7f4: 84 e1 ldi r24, 0x14 ; 20 2b7f6: cf 56 subi r28, 0x6F ; 111 2b7f8: de 4f sbci r29, 0xFE ; 254 2b7fa: 88 83 st Y, r24 2b7fc: c1 59 subi r28, 0x91 ; 145 2b7fe: 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; 2b800: ce 56 subi r28, 0x6E ; 110 2b802: de 4f sbci r29, 0xFE ; 254 2b804: a8 81 ld r26, Y 2b806: b9 81 ldd r27, Y+1 ; 0x01 2b808: c2 59 subi r28, 0x92 ; 146 2b80a: d1 40 sbci r29, 0x01 ; 1 2b80c: 8d 91 ld r24, X+ 2b80e: 9d 91 ld r25, X+ 2b810: 0d 90 ld r0, X+ 2b812: bc 91 ld r27, X 2b814: a0 2d mov r26, r0 2b816: c6 56 subi r28, 0x66 ; 102 2b818: de 4f sbci r29, 0xFE ; 254 2b81a: 88 83 st Y, r24 2b81c: 99 83 std Y+1, r25 ; 0x01 2b81e: aa 83 std Y+2, r26 ; 0x02 2b820: bb 83 std Y+3, r27 ; 0x03 2b822: ca 59 subi r28, 0x9A ; 154 2b824: d1 40 sbci r29, 0x01 ; 1 2b826: c1 57 subi r28, 0x71 ; 113 2b828: de 4f sbci r29, 0xFE ; 254 2b82a: a8 81 ld r26, Y 2b82c: b9 81 ldd r27, Y+1 ; 0x01 2b82e: cf 58 subi r28, 0x8F ; 143 2b830: d1 40 sbci r29, 0x01 ; 1 2b832: 8d 91 ld r24, X+ 2b834: 9d 91 ld r25, X+ 2b836: 0d 90 ld r0, X+ 2b838: bc 91 ld r27, X 2b83a: a0 2d mov r26, r0 2b83c: ca 54 subi r28, 0x4A ; 74 2b83e: de 4f sbci r29, 0xFE ; 254 2b840: 88 83 st Y, r24 2b842: 99 83 std Y+1, r25 ; 0x01 2b844: aa 83 std Y+2, r26 ; 0x02 2b846: bb 83 std Y+3, r27 ; 0x03 2b848: c6 5b subi r28, 0xB6 ; 182 2b84a: d1 40 sbci r29, 0x01 ; 1 2b84c: c3 57 subi r28, 0x73 ; 115 2b84e: de 4f sbci r29, 0xFE ; 254 2b850: a8 81 ld r26, Y 2b852: b9 81 ldd r27, Y+1 ; 0x01 2b854: cd 58 subi r28, 0x8D ; 141 2b856: d1 40 sbci r29, 0x01 ; 1 2b858: 8d 91 ld r24, X+ 2b85a: 9d 91 ld r25, X+ 2b85c: 0d 90 ld r0, X+ 2b85e: bc 91 ld r27, X 2b860: a0 2d mov r26, r0 2b862: c6 54 subi r28, 0x46 ; 70 2b864: de 4f sbci r29, 0xFE ; 254 2b866: 88 83 st Y, r24 2b868: 99 83 std Y+1, r25 ; 0x01 2b86a: aa 83 std Y+2, r26 ; 0x02 2b86c: bb 83 std Y+3, r27 ; 0x03 2b86e: ca 5b subi r28, 0xBA ; 186 2b870: d1 40 sbci r29, 0x01 ; 1 2b872: fe 01 movw r30, r28 2b874: e7 5f subi r30, 0xF7 ; 247 2b876: fe 4f sbci r31, 0xFE ; 254 2b878: c8 55 subi r28, 0x58 ; 88 2b87a: de 4f sbci r29, 0xFE ; 254 2b87c: f9 83 std Y+1, r31 ; 0x01 2b87e: e8 83 st Y, r30 2b880: c8 5a subi r28, 0xA8 ; 168 2b882: d1 40 sbci r29, 0x01 ; 1 2b884: ce 01 movw r24, r28 2b886: 8b 57 subi r24, 0x7B ; 123 2b888: 9f 4f sbci r25, 0xFF ; 255 2b88a: ca 55 subi r28, 0x5A ; 90 2b88c: de 4f sbci r29, 0xFE ; 254 2b88e: 99 83 std Y+1, r25 ; 0x01 2b890: 88 83 st Y, r24 2b892: c6 5a subi r28, 0xA6 ; 166 2b894: d1 40 sbci r29, 0x01 ; 1 2b896: de 01 movw r26, r28 2b898: 11 96 adiw r26, 0x01 ; 1 2b89a: c8 56 subi r28, 0x68 ; 104 2b89c: de 4f sbci r29, 0xFE ; 254 2b89e: b9 83 std Y+1, r27 ; 0x01 2b8a0: a8 83 st Y, r26 2b8a2: c8 59 subi r28, 0x98 ; 152 2b8a4: d1 40 sbci r29, 0x01 ; 1 2b8a6: 31 2c mov r3, r1 2b8a8: 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; 2b8aa: b1 01 movw r22, r2 2b8ac: 03 2c mov r0, r3 2b8ae: 00 0c add r0, r0 2b8b0: 88 0b sbc r24, r24 2b8b2: 99 0b sbc r25, r25 2b8b4: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2b8b8: 2a e1 ldi r18, 0x1A ; 26 2b8ba: 38 ef ldi r19, 0xF8 ; 248 2b8bc: 42 e4 ldi r20, 0x42 ; 66 2b8be: 5e e3 ldi r21, 0x3E ; 62 2b8c0: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2b8c4: 6b 01 movw r12, r22 2b8c6: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2b8c8: 0f 94 85 a8 call 0x3510a ; 0x3510a 2b8cc: c2 56 subi r28, 0x62 ; 98 2b8ce: de 4f sbci r29, 0xFE ; 254 2b8d0: 68 83 st Y, r22 2b8d2: 79 83 std Y+1, r23 ; 0x01 2b8d4: 8a 83 std Y+2, r24 ; 0x02 2b8d6: 9b 83 std Y+3, r25 ; 0x03 2b8d8: ce 59 subi r28, 0x9E ; 158 2b8da: d1 40 sbci r29, 0x01 ; 1 2b8dc: c7 01 movw r24, r14 2b8de: b6 01 movw r22, r12 2b8e0: 0f 94 bf a5 call 0x34b7e ; 0x34b7e 2b8e4: ce 55 subi r28, 0x5E ; 94 2b8e6: de 4f sbci r29, 0xFE ; 254 2b8e8: 68 83 st Y, r22 2b8ea: 79 83 std Y+1, r23 ; 0x01 2b8ec: 8a 83 std Y+2, r24 ; 0x02 2b8ee: 9b 83 std Y+3, r25 ; 0x03 2b8f0: c2 5a subi r28, 0xA2 ; 162 2b8f2: d1 40 sbci r29, 0x01 ; 1 2b8f4: 9b 01 movw r18, r22 2b8f6: ac 01 movw r20, r24 2b8f8: c6 56 subi r28, 0x66 ; 102 2b8fa: de 4f sbci r29, 0xFE ; 254 2b8fc: 68 81 ld r22, Y 2b8fe: 79 81 ldd r23, Y+1 ; 0x01 2b900: 8a 81 ldd r24, Y+2 ; 0x02 2b902: 9b 81 ldd r25, Y+3 ; 0x03 2b904: ca 59 subi r28, 0x9A ; 154 2b906: d1 40 sbci r29, 0x01 ; 1 2b908: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2b90c: c6 54 subi r28, 0x46 ; 70 2b90e: de 4f sbci r29, 0xFE ; 254 2b910: 28 81 ld r18, Y 2b912: 39 81 ldd r19, Y+1 ; 0x01 2b914: 4a 81 ldd r20, Y+2 ; 0x02 2b916: 5b 81 ldd r21, Y+3 ; 0x03 2b918: ca 5b subi r28, 0xBA ; 186 2b91a: d1 40 sbci r29, 0x01 ; 1 2b91c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2b920: 6b 01 movw r12, r22 2b922: 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) 2b924: 20 e0 ldi r18, 0x00 ; 0 2b926: 30 e0 ldi r19, 0x00 ; 0 2b928: a9 01 movw r20, r18 2b92a: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2b92e: 18 16 cp r1, r24 2b930: 0c f0 brlt .+2 ; 0x2b934 2b932: 7a c2 rjmp .+1268 ; 0x2be28 // 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; 2b934: c2 56 subi r28, 0x62 ; 98 2b936: de 4f sbci r29, 0xFE ; 254 2b938: 28 81 ld r18, Y 2b93a: 39 81 ldd r19, Y+1 ; 0x01 2b93c: 4a 81 ldd r20, Y+2 ; 0x02 2b93e: 5b 81 ldd r21, Y+3 ; 0x03 2b940: ce 59 subi r28, 0x9E ; 158 2b942: d1 40 sbci r29, 0x01 ; 1 2b944: c6 56 subi r28, 0x66 ; 102 2b946: de 4f sbci r29, 0xFE ; 254 2b948: 68 81 ld r22, Y 2b94a: 79 81 ldd r23, Y+1 ; 0x01 2b94c: 8a 81 ldd r24, Y+2 ; 0x02 2b94e: 9b 81 ldd r25, Y+3 ; 0x03 2b950: ca 59 subi r28, 0x9A ; 154 2b952: d1 40 sbci r29, 0x01 ; 1 2b954: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2b958: ca 54 subi r28, 0x4A ; 74 2b95a: de 4f sbci r29, 0xFE ; 254 2b95c: 28 81 ld r18, Y 2b95e: 39 81 ldd r19, Y+1 ; 0x01 2b960: 4a 81 ldd r20, Y+2 ; 0x02 2b962: 5b 81 ldd r21, Y+3 ; 0x03 2b964: c6 5b subi r28, 0xB6 ; 182 2b966: d1 40 sbci r29, 0x01 ; 1 2b968: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2b96c: 4b 01 movw r8, r22 2b96e: 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) 2b970: 20 e0 ldi r18, 0x00 ; 0 2b972: 30 e0 ldi r19, 0x00 ; 0 2b974: a9 01 movw r20, r18 2b976: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2b97a: 18 16 cp r1, r24 2b97c: 0c f0 brlt .+2 ; 0x2b980 2b97e: 54 c2 rjmp .+1192 ; 0x2be28 2b980: 20 e0 ldi r18, 0x00 ; 0 2b982: 30 e0 ldi r19, 0x00 ; 0 2b984: 48 ef ldi r20, 0xF8 ; 248 2b986: 51 e4 ldi r21, 0x41 ; 65 2b988: c7 01 movw r24, r14 2b98a: b6 01 movw r22, r12 2b98c: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2b990: 87 ff sbrs r24, 7 2b992: 4a c2 rjmp .+1172 ; 0x2be28 2b994: 20 e0 ldi r18, 0x00 ; 0 2b996: 30 e0 ldi r19, 0x00 ; 0 2b998: 48 ef ldi r20, 0xF8 ; 248 2b99a: 51 e4 ldi r21, 0x41 ; 65 2b99c: c5 01 movw r24, r10 2b99e: b4 01 movw r22, r8 2b9a0: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2b9a4: 87 ff sbrs r24, 7 2b9a6: 40 c2 rjmp .+1152 ; 0x2be28 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2b9a8: c7 01 movw r24, r14 2b9aa: b6 01 movw r22, r12 2b9ac: 0f 94 6c a6 call 0x34cd8 ; 0x34cd8 2b9b0: 9b 01 movw r18, r22 2b9b2: ac 01 movw r20, r24 2b9b4: c7 01 movw r24, r14 2b9b6: b6 01 movw r22, r12 2b9b8: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2b9bc: 2b 01 movw r4, r22 2b9be: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2b9c0: c5 01 movw r24, r10 2b9c2: b4 01 movw r22, r8 2b9c4: 0f 94 6c a6 call 0x34cd8 ; 0x34cd8 2b9c8: 9b 01 movw r18, r22 2b9ca: ac 01 movw r20, r24 2b9cc: c5 01 movw r24, r10 2b9ce: b4 01 movw r22, r8 2b9d0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2b9d4: cc 56 subi r28, 0x6C ; 108 2b9d6: de 4f sbci r29, 0xFE ; 254 2b9d8: 68 83 st Y, r22 2b9da: 79 83 std Y+1, r23 ; 0x01 2b9dc: 8a 83 std Y+2, r24 ; 0x02 2b9de: 9b 83 std Y+3, r25 ; 0x03 2b9e0: c4 59 subi r28, 0x94 ; 148 2b9e2: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2b9e4: a3 01 movw r20, r6 2b9e6: 92 01 movw r18, r4 2b9e8: 60 e0 ldi r22, 0x00 ; 0 2b9ea: 70 e0 ldi r23, 0x00 ; 0 2b9ec: 80 e8 ldi r24, 0x80 ; 128 2b9ee: 9f e3 ldi r25, 0x3F ; 63 2b9f0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2b9f4: c2 55 subi r28, 0x52 ; 82 2b9f6: de 4f sbci r29, 0xFE ; 254 2b9f8: 68 83 st Y, r22 2b9fa: 79 83 std Y+1, r23 ; 0x01 2b9fc: 8a 83 std Y+2, r24 ; 0x02 2b9fe: 9b 83 std Y+3, r25 ; 0x03 2ba00: ce 5a subi r28, 0xAE ; 174 2ba02: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2ba04: cc 56 subi r28, 0x6C ; 108 2ba06: de 4f sbci r29, 0xFE ; 254 2ba08: 28 81 ld r18, Y 2ba0a: 39 81 ldd r19, Y+1 ; 0x01 2ba0c: 4a 81 ldd r20, Y+2 ; 0x02 2ba0e: 5b 81 ldd r21, Y+3 ; 0x03 2ba10: c4 59 subi r28, 0x94 ; 148 2ba12: d1 40 sbci r29, 0x01 ; 1 2ba14: 60 e0 ldi r22, 0x00 ; 0 2ba16: 70 e0 ldi r23, 0x00 ; 0 2ba18: 80 e8 ldi r24, 0x80 ; 128 2ba1a: 9f e3 ldi r25, 0x3F ; 63 2ba1c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2ba20: ce 54 subi r28, 0x4E ; 78 2ba22: de 4f sbci r29, 0xFE ; 254 2ba24: 68 83 st Y, r22 2ba26: 79 83 std Y+1, r23 ; 0x01 2ba28: 8a 83 std Y+2, r24 ; 0x02 2ba2a: 9b 83 std Y+3, r25 ; 0x03 2ba2c: c2 5b subi r28, 0xB2 ; 178 2ba2e: 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; 2ba30: c7 01 movw r24, r14 2ba32: b6 01 movw r22, r12 2ba34: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 2ba38: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2ba3a: fb 01 movw r30, r22 2ba3c: 31 96 adiw r30, 0x01 ; 1 2ba3e: c6 55 subi r28, 0x56 ; 86 2ba40: de 4f sbci r29, 0xFE ; 254 2ba42: f9 83 std Y+1, r31 ; 0x01 2ba44: e8 83 st Y, r30 2ba46: ca 5a subi r28, 0xAA ; 170 2ba48: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2ba4a: c5 01 movw r24, r10 2ba4c: b4 01 movw r22, r8 2ba4e: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2ba52: 8b 01 movw r16, r22 2ba54: 95 e0 ldi r25, 0x05 ; 5 2ba56: 00 0f add r16, r16 2ba58: 11 1f adc r17, r17 2ba5a: 9a 95 dec r25 2ba5c: e1 f7 brne .-8 ; 0x2ba56 const uint16_t idx01 = c0 + 32 * r1; 2ba5e: c8 01 movw r24, r16 2ba60: 80 96 adiw r24, 0x20 ; 32 2ba62: c4 55 subi r28, 0x54 ; 84 2ba64: de 4f sbci r29, 0xFE ; 254 2ba66: 99 83 std Y+1, r25 ; 0x01 2ba68: 88 83 st Y, r24 2ba6a: cc 5a subi r28, 0xAC ; 172 2ba6c: 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]; 2ba6e: f8 01 movw r30, r16 2ba70: ec 0d add r30, r12 2ba72: fd 1d adc r31, r13 2ba74: e2 5a subi r30, 0xA2 ; 162 2ba76: f9 4f sbci r31, 0xF9 ; 249 2ba78: 60 81 ld r22, Z 2ba7a: 70 e0 ldi r23, 0x00 ; 0 2ba7c: 90 e0 ldi r25, 0x00 ; 0 2ba7e: 80 e0 ldi r24, 0x00 ; 0 2ba80: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2ba84: 4b 01 movw r8, r22 2ba86: 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; 2ba88: ce 54 subi r28, 0x4E ; 78 2ba8a: de 4f sbci r29, 0xFE ; 254 2ba8c: 28 81 ld r18, Y 2ba8e: 39 81 ldd r19, Y+1 ; 0x01 2ba90: 4a 81 ldd r20, Y+2 ; 0x02 2ba92: 5b 81 ldd r21, Y+3 ; 0x03 2ba94: c2 5b subi r28, 0xB2 ; 178 2ba96: d1 40 sbci r29, 0x01 ; 1 2ba98: c2 55 subi r28, 0x52 ; 82 2ba9a: de 4f sbci r29, 0xFE ; 254 2ba9c: 68 81 ld r22, Y 2ba9e: 79 81 ldd r23, Y+1 ; 0x01 2baa0: 8a 81 ldd r24, Y+2 ; 0x02 2baa2: 9b 81 ldd r25, Y+3 ; 0x03 2baa4: ce 5a subi r28, 0xAE ; 174 2baa6: d1 40 sbci r29, 0x01 ; 1 2baa8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2baac: 9b 01 movw r18, r22 2baae: 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]; 2bab0: c5 01 movw r24, r10 2bab2: b4 01 movw r22, r8 2bab4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bab8: 4b 01 movw r8, r22 2baba: 5c 01 movw r10, r24 2babc: c4 55 subi r28, 0x54 ; 84 2babe: de 4f sbci r29, 0xFE ; 254 2bac0: e8 81 ld r30, Y 2bac2: f9 81 ldd r31, Y+1 ; 0x01 2bac4: cc 5a subi r28, 0xAC ; 172 2bac6: d1 40 sbci r29, 0x01 ; 1 2bac8: ec 0d add r30, r12 2baca: fd 1d adc r31, r13 2bacc: e2 5a subi r30, 0xA2 ; 162 2bace: f9 4f sbci r31, 0xF9 ; 249 2bad0: 60 81 ld r22, Z 2bad2: 70 e0 ldi r23, 0x00 ; 0 2bad4: 90 e0 ldi r25, 0x00 ; 0 2bad6: 80 e0 ldi r24, 0x00 ; 0 2bad8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2badc: 6b 01 movw r12, r22 2bade: 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; 2bae0: c2 55 subi r28, 0x52 ; 82 2bae2: de 4f sbci r29, 0xFE ; 254 2bae4: 28 81 ld r18, Y 2bae6: 39 81 ldd r19, Y+1 ; 0x01 2bae8: 4a 81 ldd r20, Y+2 ; 0x02 2baea: 5b 81 ldd r21, Y+3 ; 0x03 2baec: ce 5a subi r28, 0xAE ; 174 2baee: d1 40 sbci r29, 0x01 ; 1 2baf0: cc 56 subi r28, 0x6C ; 108 2baf2: de 4f sbci r29, 0xFE ; 254 2baf4: 68 81 ld r22, Y 2baf6: 79 81 ldd r23, Y+1 ; 0x01 2baf8: 8a 81 ldd r24, Y+2 ; 0x02 2bafa: 9b 81 ldd r25, Y+3 ; 0x03 2bafc: c4 59 subi r28, 0x94 ; 148 2bafe: d1 40 sbci r29, 0x01 ; 1 2bb00: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bb04: 9b 01 movw r18, r22 2bb06: 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]; 2bb08: c7 01 movw r24, r14 2bb0a: b6 01 movw r22, r12 2bb0c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bb10: 9b 01 movw r18, r22 2bb12: ac 01 movw r20, r24 2bb14: c5 01 movw r24, r10 2bb16: b4 01 movw r22, r8 2bb18: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2bb1c: 6b 01 movw r12, r22 2bb1e: 7c 01 movw r14, r24 2bb20: c6 55 subi r28, 0x56 ; 86 2bb22: de 4f sbci r29, 0xFE ; 254 2bb24: a8 81 ld r26, Y 2bb26: b9 81 ldd r27, Y+1 ; 0x01 2bb28: ca 5a subi r28, 0xAA ; 170 2bb2a: d1 40 sbci r29, 0x01 ; 1 2bb2c: 0a 0f add r16, r26 2bb2e: 1b 1f adc r17, r27 2bb30: f8 01 movw r30, r16 2bb32: e2 5a subi r30, 0xA2 ; 162 2bb34: f9 4f sbci r31, 0xF9 ; 249 2bb36: 60 81 ld r22, Z 2bb38: 70 e0 ldi r23, 0x00 ; 0 2bb3a: 90 e0 ldi r25, 0x00 ; 0 2bb3c: 80 e0 ldi r24, 0x00 ; 0 2bb3e: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2bb42: 4b 01 movw r8, r22 2bb44: 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; 2bb46: ce 54 subi r28, 0x4E ; 78 2bb48: de 4f sbci r29, 0xFE ; 254 2bb4a: 28 81 ld r18, Y 2bb4c: 39 81 ldd r19, Y+1 ; 0x01 2bb4e: 4a 81 ldd r20, Y+2 ; 0x02 2bb50: 5b 81 ldd r21, Y+3 ; 0x03 2bb52: c2 5b subi r28, 0xB2 ; 178 2bb54: d1 40 sbci r29, 0x01 ; 1 2bb56: c3 01 movw r24, r6 2bb58: b2 01 movw r22, r4 2bb5a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bb5e: 9b 01 movw r18, r22 2bb60: 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]; 2bb62: c5 01 movw r24, r10 2bb64: b4 01 movw r22, r8 2bb66: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bb6a: 9b 01 movw r18, r22 2bb6c: ac 01 movw r20, r24 2bb6e: c7 01 movw r24, r14 2bb70: b6 01 movw r22, r12 2bb72: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2bb76: 6b 01 movw r12, r22 2bb78: 7c 01 movw r14, r24 2bb7a: c6 55 subi r28, 0x56 ; 86 2bb7c: de 4f sbci r29, 0xFE ; 254 2bb7e: e8 81 ld r30, Y 2bb80: f9 81 ldd r31, Y+1 ; 0x01 2bb82: ca 5a subi r28, 0xAA ; 170 2bb84: d1 40 sbci r29, 0x01 ; 1 2bb86: c4 55 subi r28, 0x54 ; 84 2bb88: de 4f sbci r29, 0xFE ; 254 2bb8a: 88 81 ld r24, Y 2bb8c: 99 81 ldd r25, Y+1 ; 0x01 2bb8e: cc 5a subi r28, 0xAC ; 172 2bb90: d1 40 sbci r29, 0x01 ; 1 2bb92: e8 0f add r30, r24 2bb94: f9 1f adc r31, r25 2bb96: e2 5a subi r30, 0xA2 ; 162 2bb98: f9 4f sbci r31, 0xF9 ; 249 2bb9a: 60 81 ld r22, Z 2bb9c: 70 e0 ldi r23, 0x00 ; 0 2bb9e: 90 e0 ldi r25, 0x00 ; 0 2bba0: 80 e0 ldi r24, 0x00 ; 0 2bba2: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2bba6: 4b 01 movw r8, r22 2bba8: 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; 2bbaa: cc 56 subi r28, 0x6C ; 108 2bbac: de 4f sbci r29, 0xFE ; 254 2bbae: 28 81 ld r18, Y 2bbb0: 39 81 ldd r19, Y+1 ; 0x01 2bbb2: 4a 81 ldd r20, Y+2 ; 0x02 2bbb4: 5b 81 ldd r21, Y+3 ; 0x03 2bbb6: c4 59 subi r28, 0x94 ; 148 2bbb8: d1 40 sbci r29, 0x01 ; 1 2bbba: c3 01 movw r24, r6 2bbbc: b2 01 movw r22, r4 2bbbe: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bbc2: 9b 01 movw r18, r22 2bbc4: 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]; 2bbc6: c5 01 movw r24, r10 2bbc8: b4 01 movw r22, r8 2bbca: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bbce: 9b 01 movw r18, r22 2bbd0: ac 01 movw r20, r24 2bbd2: c7 01 movw r24, r14 2bbd4: b6 01 movw r22, r12 2bbd6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__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; 2bbda: 20 e0 ldi r18, 0x00 ; 0 2bbdc: 30 e0 ldi r19, 0x00 ; 0 2bbde: 40 e0 ldi r20, 0x00 ; 0 2bbe0: 52 e4 ldi r21, 0x42 ; 66 2bbe2: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2bbe6: 6b 01 movw r12, r22 2bbe8: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2bbea: ac 01 movw r20, r24 2bbec: 9b 01 movw r18, r22 2bbee: ce 55 subi r28, 0x5E ; 94 2bbf0: de 4f sbci r29, 0xFE ; 254 2bbf2: 68 81 ld r22, Y 2bbf4: 79 81 ldd r23, Y+1 ; 0x01 2bbf6: 8a 81 ldd r24, Y+2 ; 0x02 2bbf8: 9b 81 ldd r25, Y+3 ; 0x03 2bbfa: c2 5a subi r28, 0xA2 ; 162 2bbfc: d1 40 sbci r29, 0x01 ; 1 2bbfe: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bc02: c8 55 subi r28, 0x58 ; 88 2bc04: de 4f sbci r29, 0xFE ; 254 2bc06: a8 81 ld r26, Y 2bc08: b9 81 ldd r27, Y+1 ; 0x01 2bc0a: c8 5a subi r28, 0xA8 ; 168 2bc0c: d1 40 sbci r29, 0x01 ; 1 2bc0e: 6d 93 st X+, r22 2bc10: 7d 93 st X+, r23 2bc12: 8d 93 st X+, r24 2bc14: 9d 93 st X+, r25 2bc16: c8 55 subi r28, 0x58 ; 88 2bc18: de 4f sbci r29, 0xFE ; 254 2bc1a: b9 83 std Y+1, r27 ; 0x01 2bc1c: a8 83 st Y, r26 2bc1e: c8 5a subi r28, 0xA8 ; 168 2bc20: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2bc22: a7 01 movw r20, r14 2bc24: 96 01 movw r18, r12 2bc26: c2 56 subi r28, 0x62 ; 98 2bc28: de 4f sbci r29, 0xFE ; 254 2bc2a: 68 81 ld r22, Y 2bc2c: 79 81 ldd r23, Y+1 ; 0x01 2bc2e: 8a 81 ldd r24, Y+2 ; 0x02 2bc30: 9b 81 ldd r25, Y+3 ; 0x03 2bc32: ce 59 subi r28, 0x9E ; 158 2bc34: d1 40 sbci r29, 0x01 ; 1 2bc36: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bc3a: ca 55 subi r28, 0x5A ; 90 2bc3c: de 4f sbci r29, 0xFE ; 254 2bc3e: e8 81 ld r30, Y 2bc40: f9 81 ldd r31, Y+1 ; 0x01 2bc42: c6 5a subi r28, 0xA6 ; 166 2bc44: d1 40 sbci r29, 0x01 ; 1 2bc46: 61 93 st Z+, r22 2bc48: 71 93 st Z+, r23 2bc4a: 81 93 st Z+, r24 2bc4c: 91 93 st Z+, r25 2bc4e: ca 55 subi r28, 0x5A ; 90 2bc50: de 4f sbci r29, 0xFE ; 254 2bc52: f9 83 std Y+1, r31 ; 0x01 2bc54: e8 83 st Y, r30 2bc56: c6 5a subi r28, 0xA6 ; 166 2bc58: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2bc5a: c8 56 subi r28, 0x68 ; 104 2bc5c: de 4f sbci r29, 0xFE ; 254 2bc5e: a8 81 ld r26, Y 2bc60: b9 81 ldd r27, Y+1 ; 0x01 2bc62: c8 59 subi r28, 0x98 ; 152 2bc64: d1 40 sbci r29, 0x01 ; 1 2bc66: cd 92 st X+, r12 2bc68: dd 92 st X+, r13 2bc6a: ed 92 st X+, r14 2bc6c: fd 92 st X+, r15 2bc6e: c8 56 subi r28, 0x68 ; 104 2bc70: de 4f sbci r29, 0xFE ; 254 2bc72: b9 83 std Y+1, r27 ; 0x01 2bc74: a8 83 st Y, r26 2bc76: c8 59 subi r28, 0x98 ; 152 2bc78: d1 40 sbci r29, 0x01 ; 1 2bc7a: bf ef ldi r27, 0xFF ; 255 2bc7c: 2b 1a sub r2, r27 2bc7e: 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){ 2bc80: e1 e2 ldi r30, 0x21 ; 33 2bc82: 2e 16 cp r2, r30 2bc84: 31 04 cpc r3, r1 2bc86: 09 f0 breq .+2 ; 0x2bc8a 2bc88: 10 ce rjmp .-992 ; 0x2b8aa 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); 2bc8a: 40 e0 ldi r20, 0x00 ; 0 2bc8c: 50 e0 ldi r21, 0x00 ; 0 2bc8e: 60 e0 ldi r22, 0x00 ; 0 2bc90: 7d e3 ldi r23, 0x3D ; 61 2bc92: ce 01 movw r24, r28 2bc94: 87 5f subi r24, 0xF7 ; 247 2bc96: 9e 4f sbci r25, 0xFE ; 254 2bc98: 0f 94 8b 55 call 0x2ab16 ; 0x2ab16 2bc9c: 9b 01 movw r18, r22 2bc9e: ac 01 movw r20, r24 2bca0: c3 57 subi r28, 0x73 ; 115 2bca2: de 4f sbci r29, 0xFE ; 254 2bca4: a8 81 ld r26, Y 2bca6: b9 81 ldd r27, Y+1 ; 0x01 2bca8: cd 58 subi r28, 0x8D ; 141 2bcaa: d1 40 sbci r29, 0x01 ; 1 2bcac: 6d 91 ld r22, X+ 2bcae: 7d 91 ld r23, X+ 2bcb0: 8d 91 ld r24, X+ 2bcb2: 9c 91 ld r25, X 2bcb4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2bcb8: c3 57 subi r28, 0x73 ; 115 2bcba: de 4f sbci r29, 0xFE ; 254 2bcbc: e8 81 ld r30, Y 2bcbe: f9 81 ldd r31, Y+1 ; 0x01 2bcc0: cd 58 subi r28, 0x8D ; 141 2bcc2: d1 40 sbci r29, 0x01 ; 1 2bcc4: 60 83 st Z, r22 2bcc6: 71 83 std Z+1, r23 ; 0x01 2bcc8: 82 83 std Z+2, r24 ; 0x02 2bcca: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2bccc: 40 e0 ldi r20, 0x00 ; 0 2bcce: 50 e0 ldi r21, 0x00 ; 0 2bcd0: 60 e0 ldi r22, 0x00 ; 0 2bcd2: 7d e3 ldi r23, 0x3D ; 61 2bcd4: ce 01 movw r24, r28 2bcd6: 8b 57 subi r24, 0x7B ; 123 2bcd8: 9f 4f sbci r25, 0xFF ; 255 2bcda: 0f 94 8b 55 call 0x2ab16 ; 0x2ab16 2bcde: 9b 01 movw r18, r22 2bce0: ac 01 movw r20, r24 2bce2: c1 57 subi r28, 0x71 ; 113 2bce4: de 4f sbci r29, 0xFE ; 254 2bce6: a8 81 ld r26, Y 2bce8: b9 81 ldd r27, Y+1 ; 0x01 2bcea: cf 58 subi r28, 0x8F ; 143 2bcec: d1 40 sbci r29, 0x01 ; 1 2bcee: 6d 91 ld r22, X+ 2bcf0: 7d 91 ld r23, X+ 2bcf2: 8d 91 ld r24, X+ 2bcf4: 9c 91 ld r25, X 2bcf6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2bcfa: c1 57 subi r28, 0x71 ; 113 2bcfc: de 4f sbci r29, 0xFE ; 254 2bcfe: e8 81 ld r30, Y 2bd00: f9 81 ldd r31, Y+1 ; 0x01 2bd02: cf 58 subi r28, 0x8F ; 143 2bd04: d1 40 sbci r29, 0x01 ; 1 2bd06: 60 83 st Z, r22 2bd08: 71 83 std Z+1, r23 ; 0x01 2bd0a: 82 83 std Z+2, r24 ; 0x02 2bd0c: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2bd0e: 40 e0 ldi r20, 0x00 ; 0 2bd10: 50 e0 ldi r21, 0x00 ; 0 2bd12: 60 e8 ldi r22, 0x80 ; 128 2bd14: 7c e3 ldi r23, 0x3C ; 60 2bd16: ce 01 movw r24, r28 2bd18: 01 96 adiw r24, 0x01 ; 1 2bd1a: 0f 94 8b 55 call 0x2ab16 ; 0x2ab16 2bd1e: ce 56 subi r28, 0x6E ; 110 2bd20: de 4f sbci r29, 0xFE ; 254 2bd22: a8 81 ld r26, Y 2bd24: b9 81 ldd r27, Y+1 ; 0x01 2bd26: c2 59 subi r28, 0x92 ; 146 2bd28: d1 40 sbci r29, 0x01 ; 1 2bd2a: 2d 91 ld r18, X+ 2bd2c: 3d 91 ld r19, X+ 2bd2e: 4d 91 ld r20, X+ 2bd30: 5c 91 ld r21, X 2bd32: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2bd36: 16 2f mov r17, r22 2bd38: 07 2f mov r16, r23 2bd3a: f8 2e mov r15, r24 2bd3c: e9 2e mov r14, r25 r = MAX(2, r); 2bd3e: 20 e0 ldi r18, 0x00 ; 0 2bd40: 30 e0 ldi r19, 0x00 ; 0 2bd42: 40 e0 ldi r20, 0x00 ; 0 2bd44: 50 e4 ldi r21, 0x40 ; 64 2bd46: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2bd4a: 18 16 cp r1, r24 2bd4c: 2c f0 brlt .+10 ; 0x2bd58 2bd4e: 10 e0 ldi r17, 0x00 ; 0 2bd50: 00 e0 ldi r16, 0x00 ; 0 2bd52: f1 2c mov r15, r1 2bd54: 80 e4 ldi r24, 0x40 ; 64 2bd56: e8 2e mov r14, r24 2bd58: a8 01 movw r20, r16 2bd5a: 97 01 movw r18, r14 2bd5c: 85 2f mov r24, r21 2bd5e: 90 2f mov r25, r16 2bd60: a3 2f mov r26, r19 2bd62: be 2d mov r27, r14 2bd64: ce 56 subi r28, 0x6E ; 110 2bd66: de 4f sbci r29, 0xFE ; 254 2bd68: e8 81 ld r30, Y 2bd6a: f9 81 ldd r31, Y+1 ; 0x01 2bd6c: c2 59 subi r28, 0x92 ; 146 2bd6e: d1 40 sbci r29, 0x01 ; 1 2bd70: 80 83 st Z, r24 2bd72: 91 83 std Z+1, r25 ; 0x01 2bd74: a2 83 std Z+2, r26 ; 0x02 2bd76: b3 83 std Z+3, r27 ; 0x03 2bd78: cf 56 subi r28, 0x6F ; 111 2bd7a: de 4f sbci r29, 0xFE ; 254 2bd7c: f8 81 ld r31, Y 2bd7e: c1 59 subi r28, 0x91 ; 145 2bd80: d1 40 sbci r29, 0x01 ; 1 2bd82: f1 50 subi r31, 0x01 ; 1 2bd84: cf 56 subi r28, 0x6F ; 111 2bd86: de 4f sbci r29, 0xFE ; 254 2bd88: f8 83 st Y, r31 2bd8a: c1 59 subi r28, 0x91 ; 145 2bd8c: 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){ 2bd8e: f1 11 cpse r31, r1 2bd90: 37 cd rjmp .-1426 ; 0x2b800 r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2bd92: ef 92 push r14 2bd94: ff 92 push r15 2bd96: 0f 93 push r16 2bd98: 1f 93 push r17 2bd9a: c1 57 subi r28, 0x71 ; 113 2bd9c: de 4f sbci r29, 0xFE ; 254 2bd9e: a8 81 ld r26, Y 2bda0: b9 81 ldd r27, Y+1 ; 0x01 2bda2: cf 58 subi r28, 0x8F ; 143 2bda4: d1 40 sbci r29, 0x01 ; 1 2bda6: 13 96 adiw r26, 0x03 ; 3 2bda8: 8c 91 ld r24, X 2bdaa: 13 97 sbiw r26, 0x03 ; 3 2bdac: 8f 93 push r24 2bdae: 12 96 adiw r26, 0x02 ; 2 2bdb0: 8c 91 ld r24, X 2bdb2: 12 97 sbiw r26, 0x02 ; 2 2bdb4: 8f 93 push r24 2bdb6: 11 96 adiw r26, 0x01 ; 1 2bdb8: 8c 91 ld r24, X 2bdba: 11 97 sbiw r26, 0x01 ; 1 2bdbc: 8f 93 push r24 2bdbe: 8c 91 ld r24, X 2bdc0: 8f 93 push r24 2bdc2: c3 57 subi r28, 0x73 ; 115 2bdc4: de 4f sbci r29, 0xFE ; 254 2bdc6: e8 81 ld r30, Y 2bdc8: f9 81 ldd r31, Y+1 ; 0x01 2bdca: cd 58 subi r28, 0x8D ; 141 2bdcc: d1 40 sbci r29, 0x01 ; 1 2bdce: 83 81 ldd r24, Z+3 ; 0x03 2bdd0: 8f 93 push r24 2bdd2: 82 81 ldd r24, Z+2 ; 0x02 2bdd4: 8f 93 push r24 2bdd6: 81 81 ldd r24, Z+1 ; 0x01 2bdd8: 8f 93 push r24 2bdda: 80 81 ld r24, Z 2bddc: 8f 93 push r24 2bdde: 85 ee ldi r24, 0xE5 ; 229 2bde0: 9c e9 ldi r25, 0x9C ; 156 2bde2: 9f 93 push r25 2bde4: 8f 93 push r24 2bde6: 0f 94 5f a2 call 0x344be ; 0x344be 2bdea: 0f b6 in r0, 0x3f ; 63 2bdec: f8 94 cli 2bdee: de bf out 0x3e, r29 ; 62 2bdf0: 0f be out 0x3f, r0 ; 63 2bdf2: cd bf out 0x3d, r28 ; 61 } 2bdf4: c3 54 subi r28, 0x43 ; 67 2bdf6: de 4f sbci r29, 0xFE ; 254 2bdf8: 0f b6 in r0, 0x3f ; 63 2bdfa: f8 94 cli 2bdfc: de bf out 0x3e, r29 ; 62 2bdfe: 0f be out 0x3f, r0 ; 63 2be00: cd bf out 0x3d, r28 ; 61 2be02: df 91 pop r29 2be04: cf 91 pop r28 2be06: 1f 91 pop r17 2be08: 0f 91 pop r16 2be0a: ff 90 pop r15 2be0c: ef 90 pop r14 2be0e: df 90 pop r13 2be10: cf 90 pop r12 2be12: bf 90 pop r11 2be14: af 90 pop r10 2be16: 9f 90 pop r9 2be18: 8f 90 pop r8 2be1a: 7f 90 pop r7 2be1c: 6f 90 pop r6 2be1e: 5f 90 pop r5 2be20: 4f 90 pop r4 2be22: 3f 90 pop r3 2be24: 2f 90 pop r2 2be26: 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; 2be28: 60 e0 ldi r22, 0x00 ; 0 2be2a: 70 e0 ldi r23, 0x00 ; 0 2be2c: cb 01 movw r24, r22 2be2e: d5 ce rjmp .-598 ; 0x2bbda 0002be30 : 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){ 2be30: ef 92 push r14 2be32: ff 92 push r15 2be34: 0f 93 push r16 2be36: 1f 93 push r17 2be38: cf 93 push r28 2be3a: df 93 push r29 2be3c: 1f 92 push r1 2be3e: 1f 92 push r1 2be40: cd b7 in r28, 0x3d ; 61 2be42: de b7 in r29, 0x3e ; 62 2be44: f8 2e mov r15, r24 2be46: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2be48: 80 e1 ldi r24, 0x10 ; 16 2be4a: 97 e2 ldi r25, 0x27 ; 39 2be4c: 9a 83 std Y+2, r25 ; 0x02 2be4e: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2be50: 8a 01 movw r16, r20 2be52: 16 95 lsr r17 2be54: 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); 2be56: 8f 2d mov r24, r15 2be58: 0e 94 67 d3 call 0x1a6ce ; 0x1a6ce while (steps--){ 2be5c: 01 50 subi r16, 0x01 ; 1 2be5e: 11 09 sbc r17, r1 2be60: 78 f0 brcs .+30 ; 0x2be80 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2be62: 28 ec ldi r18, 0xC8 ; 200 2be64: 30 e0 ldi r19, 0x00 ; 0 2be66: ae 01 movw r20, r28 2be68: 4f 5f subi r20, 0xFF ; 255 2be6a: 5f 4f sbci r21, 0xFF ; 255 2be6c: 68 ee ldi r22, 0xE8 ; 232 2be6e: 73 e0 ldi r23, 0x03 ; 3 2be70: 8f 2d mov r24, r15 2be72: 0e 94 36 d2 call 0x1a46c ; 0x1a46c update_position_1_step(axes, dir); 2be76: 6e 2d mov r22, r14 2be78: 8f 2d mov r24, r15 2be7a: 0e 94 80 d3 call 0x1a700 ; 0x1a700 2be7e: ee cf rjmp .-36 ; 0x2be5c } /// \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); 2be80: 6e 2d mov r22, r14 2be82: 8f 2d mov r24, r15 2be84: 0e 94 67 d3 call 0x1a6ce ; 0x1a6ce 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); } 2be88: 0f 90 pop r0 2be8a: 0f 90 pop r0 2be8c: df 91 pop r29 2be8e: cf 91 pop r28 2be90: 1f 91 pop r17 2be92: 0f 91 pop r16 2be94: ff 90 pop r15 2be96: ef 90 pop r14 2be98: 08 95 ret 0002be9a : /// 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) 2be9a: 2f 92 push r2 2be9c: 3f 92 push r3 2be9e: 4f 92 push r4 2bea0: 5f 92 push r5 2bea2: 6f 92 push r6 2bea4: 7f 92 push r7 2bea6: 8f 92 push r8 2bea8: 9f 92 push r9 2beaa: af 92 push r10 2beac: bf 92 push r11 2beae: cf 92 push r12 2beb0: df 92 push r13 2beb2: ef 92 push r14 2beb4: ff 92 push r15 2beb6: 0f 93 push r16 2beb8: 1f 93 push r17 2beba: cf 93 push r28 2bebc: df 93 push r29 2bebe: cd b7 in r28, 0x3d ; 61 2bec0: de b7 in r29, 0x3e ; 62 2bec2: 6c 97 sbiw r28, 0x1c ; 28 2bec4: 0f b6 in r0, 0x3f ; 63 2bec6: f8 94 cli 2bec8: de bf out 0x3e, r29 ; 62 2beca: 0f be out 0x3f, r0 ; 63 2becc: cd bf out 0x3d, r28 ; 61 2bece: 6c 01 movw r12, r24 2bed0: 5b 01 movw r10, r22 2bed2: 4a 01 movw r8, r20 2bed4: 19 01 movw r2, r18 2bed6: 18 87 std Y+8, r17 ; 0x08 2bed8: 0f 83 std Y+7, r16 ; 0x07 2beda: fa 82 std Y+2, r15 ; 0x02 2bedc: 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; 2bede: d7 01 movw r26, r14 2bee0: 8d 91 ld r24, X+ 2bee2: 9c 91 ld r25, X 2bee4: 60 ed ldi r22, 0xD0 ; 208 2bee6: 72 e0 ldi r23, 0x02 ; 2 2bee8: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 2beec: 9c 8f std Y+28, r25 ; 0x1c 2beee: 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); 2bef0: 9f 93 push r25 2bef2: 8f 93 push r24 2bef4: 3f 92 push r3 2bef6: 2f 93 push r18 2bef8: 1f 92 push r1 2befa: 84 e6 ldi r24, 0x64 ; 100 2befc: 8f 93 push r24 2befe: 9f 92 push r9 2bf00: 8f 92 push r8 2bf02: bf 92 push r11 2bf04: af 92 push r10 2bf06: df 92 push r13 2bf08: cf 92 push r12 2bf0a: 83 e6 ldi r24, 0x63 ; 99 2bf0c: 9c e9 ldi r25, 0x9C ; 156 2bf0e: 9f 93 push r25 2bf10: 8f 93 push r24 2bf12: 0f 94 5f a2 call 0x344be ; 0x344be 2bf16: 0f b6 in r0, 0x3f ; 63 2bf18: f8 94 cli 2bf1a: de bf out 0x3e, r29 ; 62 2bf1c: 0f be out 0x3f, r0 ; 63 2bf1e: 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; 2bf20: 22 27 eor r18, r18 2bf22: 33 27 eor r19, r19 2bf24: 22 19 sub r18, r2 2bf26: 33 09 sbc r19, r3 2bf28: 3a 8f std Y+26, r19 ; 0x1a 2bf2a: 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)); 2bf2c: c4 01 movw r24, r8 2bf2e: 99 0c add r9, r9 2bf30: aa 0b sbc r26, r26 2bf32: bb 0b sbc r27, r27 2bf34: 89 87 std Y+9, r24 ; 0x09 2bf36: 9a 87 std Y+10, r25 ; 0x0a 2bf38: ab 87 std Y+11, r26 ; 0x0b 2bf3a: 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)); 2bf3c: 95 01 movw r18, r10 2bf3e: bb 0c add r11, r11 2bf40: 44 0b sbc r20, r20 2bf42: 55 0b sbc r21, r21 2bf44: 29 8b std Y+17, r18 ; 0x11 2bf46: 3a 8b std Y+18, r19 ; 0x12 2bf48: 4b 8b std Y+19, r20 ; 0x13 2bf4a: 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)); 2bf4c: c6 01 movw r24, r12 2bf4e: dd 0c add r13, r13 2bf50: aa 0b sbc r26, r26 2bf52: bb 0b sbc r27, r27 2bf54: 8d 8b std Y+21, r24 ; 0x15 2bf56: 9e 8b std Y+22, r25 ; 0x16 2bf58: af 8b std Y+23, r26 ; 0x17 2bf5a: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2bf5c: 12 14 cp r1, r2 2bf5e: 13 04 cpc r1, r3 2bf60: 0c f0 brlt .+2 ; 0x2bf64 2bf62: ba c0 rjmp .+372 ; 0x2c0d8 { dad = dad_max - (ad / k); 2bf64: 8b 8d ldd r24, Y+27 ; 0x1b 2bf66: 9c 8d ldd r25, Y+28 ; 0x1c 2bf68: 6c e3 ldi r22, 0x3C ; 60 2bf6a: 70 e0 ldi r23, 0x00 ; 0 2bf6c: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 2bf70: 10 e1 ldi r17, 0x10 ; 16 2bf72: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2bf74: 2b 8d ldd r18, Y+27 ; 0x1b 2bf76: 3c 8d ldd r19, Y+28 ; 0x1c 2bf78: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2bf7a: 0f 94 bd a4 call 0x3497a ; 0x3497a <__usmulhisi3> 2bf7e: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 2bf82: 20 e0 ldi r18, 0x00 ; 0 2bf84: 30 e0 ldi r19, 0x00 ; 0 2bf86: 44 e3 ldi r20, 0x34 ; 52 2bf88: 54 e4 ldi r21, 0x44 ; 68 2bf8a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 2bf8e: 6b 01 movw r12, r22 2bf90: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2bf92: 6f 81 ldd r22, Y+7 ; 0x07 2bf94: 78 85 ldd r23, Y+8 ; 0x08 2bf96: eb 8d ldd r30, Y+27 ; 0x1b 2bf98: fc 8d ldd r31, Y+28 ; 0x1c 2bf9a: 6e 0f add r22, r30 2bf9c: 7f 1f adc r23, r31 2bf9e: 90 e0 ldi r25, 0x00 ; 0 2bfa0: 80 e0 ldi r24, 0x00 ; 0 2bfa2: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 2bfa6: 25 e3 ldi r18, 0x35 ; 53 2bfa8: 3a ef ldi r19, 0xFA ; 250 2bfaa: 4e e8 ldi r20, 0x8E ; 142 2bfac: 5c e3 ldi r21, 0x3C ; 60 2bfae: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2bfb2: 4b 01 movw r8, r22 2bfb4: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2bfb6: 0f 94 bf a5 call 0x34b7e ; 0x34b7e 2bfba: 6b 83 std Y+3, r22 ; 0x03 2bfbc: 7c 83 std Y+4, r23 ; 0x04 2bfbe: 8d 83 std Y+5, r24 ; 0x05 2bfc0: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2bfc2: c5 01 movw r24, r10 2bfc4: b4 01 movw r22, r8 2bfc6: 0f 94 85 a8 call 0x3510a ; 0x3510a 2bfca: 2b 01 movw r4, r22 2bfcc: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2bfce: 69 85 ldd r22, Y+9 ; 0x09 2bfd0: 7a 85 ldd r23, Y+10 ; 0x0a 2bfd2: 8b 85 ldd r24, Y+11 ; 0x0b 2bfd4: 9c 85 ldd r25, Y+12 ; 0x0c 2bfd6: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2bfda: 4b 01 movw r8, r22 2bfdc: 5c 01 movw r10, r24 2bfde: 2b 8d ldd r18, Y+27 ; 0x1b 2bfe0: 3c 8d ldd r19, Y+28 ; 0x1c 2bfe2: a4 e6 ldi r26, 0x64 ; 100 2bfe4: b0 e0 ldi r27, 0x00 ; 0 2bfe6: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 2bfea: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2bfee: 20 e0 ldi r18, 0x00 ; 0 2bff0: 30 e0 ldi r19, 0x00 ; 0 2bff2: 44 e3 ldi r20, 0x34 ; 52 2bff4: 54 e4 ldi r21, 0x44 ; 68 2bff6: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 2bffa: 9b 01 movw r18, r22 2bffc: ac 01 movw r20, r24 2bffe: c5 01 movw r24, r10 2c000: b4 01 movw r22, r8 2c002: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2c006: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 2c00a: 6d 87 std Y+13, r22 ; 0x0d 2c00c: 7e 87 std Y+14, r23 ; 0x0e 2c00e: 8f 87 std Y+15, r24 ; 0x0f 2c010: 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)); 2c012: 69 89 ldd r22, Y+17 ; 0x11 2c014: 7a 89 ldd r23, Y+18 ; 0x12 2c016: 8b 89 ldd r24, Y+19 ; 0x13 2c018: 9c 89 ldd r25, Y+20 ; 0x14 2c01a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2c01e: 4b 01 movw r8, r22 2c020: 5c 01 movw r10, r24 2c022: a3 01 movw r20, r6 2c024: 92 01 movw r18, r4 2c026: c7 01 movw r24, r14 2c028: b6 01 movw r22, r12 2c02a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2c02e: 9b 01 movw r18, r22 2c030: ac 01 movw r20, r24 2c032: c5 01 movw r24, r10 2c034: b4 01 movw r22, r8 2c036: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2c03a: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 2c03e: 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)); 2c040: 6d 89 ldd r22, Y+21 ; 0x15 2c042: 7e 89 ldd r23, Y+22 ; 0x16 2c044: 8f 89 ldd r24, Y+23 ; 0x17 2c046: 98 8d ldd r25, Y+24 ; 0x18 2c048: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2c04c: 2b 01 movw r4, r22 2c04e: 3c 01 movw r6, r24 2c050: a7 01 movw r20, r14 2c052: 96 01 movw r18, r12 2c054: 6b 81 ldd r22, Y+3 ; 0x03 2c056: 7c 81 ldd r23, Y+4 ; 0x04 2c058: 8d 81 ldd r24, Y+5 ; 0x05 2c05a: 9e 81 ldd r25, Y+6 ; 0x06 2c05c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2c060: 9b 01 movw r18, r22 2c062: ac 01 movw r20, r24 2c064: c3 01 movw r24, r6 2c066: b2 01 movw r22, r4 2c068: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2c06c: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 2c070: 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)) 2c072: 01 e0 ldi r16, 0x01 ; 1 2c074: 20 e4 ldi r18, 0x40 ; 64 2c076: 31 e0 ldi r19, 0x01 ; 1 2c078: 4d 85 ldd r20, Y+13 ; 0x0d 2c07a: 5e 85 ldd r21, Y+14 ; 0x0e 2c07c: b4 01 movw r22, r8 2c07e: 0e 94 c0 d3 call 0x1a780 ; 0x1a780 2c082: 21 2f mov r18, r17 2c084: 30 e0 ldi r19, 0x00 ; 0 2c086: 88 23 and r24, r24 2c088: b9 f1 breq .+110 ; 0x2c0f8 2c08a: 4b 8d ldd r20, Y+27 ; 0x1b 2c08c: 5c 8d ldd r21, Y+28 ; 0x1c 2c08e: 42 0f add r20, r18 2c090: 53 1f adc r21, r19 { ad += dad + 1; 2c092: 4f 5f subi r20, 0xFF ; 255 2c094: 5f 4f sbci r21, 0xFF ; 255 2c096: 5c 8f std Y+28, r21 ; 0x1c 2c098: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2c09a: eb 8d ldd r30, Y+27 ; 0x1b 2c09c: fc 8d ldd r31, Y+28 ; 0x1c 2c09e: a9 81 ldd r26, Y+1 ; 0x01 2c0a0: ba 81 ldd r27, Y+2 ; 0x02 2c0a2: ed 93 st X+, r30 2c0a4: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2c0a6: 6c 96 adiw r28, 0x1c ; 28 2c0a8: 0f b6 in r0, 0x3f ; 63 2c0aa: f8 94 cli 2c0ac: de bf out 0x3e, r29 ; 62 2c0ae: 0f be out 0x3f, r0 ; 63 2c0b0: cd bf out 0x3d, r28 ; 61 2c0b2: df 91 pop r29 2c0b4: cf 91 pop r28 2c0b6: 1f 91 pop r17 2c0b8: 0f 91 pop r16 2c0ba: ff 90 pop r15 2c0bc: ef 90 pop r14 2c0be: df 90 pop r13 2c0c0: cf 90 pop r12 2c0c2: bf 90 pop r11 2c0c4: af 90 pop r10 2c0c6: 9f 90 pop r9 2c0c8: 8f 90 pop r8 2c0ca: 7f 90 pop r7 2c0cc: 6f 90 pop r6 2c0ce: 5f 90 pop r5 2c0d0: 4f 90 pop r4 2c0d2: 3f 90 pop r3 2c0d4: 2f 90 pop r2 2c0d6: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2c0d8: 2f ec ldi r18, 0xCF ; 207 2c0da: 32 e0 ldi r19, 0x02 ; 2 2c0dc: ab 8d ldd r26, Y+27 ; 0x1b 2c0de: bc 8d ldd r27, Y+28 ; 0x1c 2c0e0: 2a 1b sub r18, r26 2c0e2: 3b 0b sbc r19, r27 2c0e4: c9 01 movw r24, r18 2c0e6: 6c e3 ldi r22, 0x3C ; 60 2c0e8: 70 e0 ldi r23, 0x00 ; 0 2c0ea: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 2c0ee: 10 e1 ldi r17, 0x10 ; 16 2c0f0: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2c0f2: a9 8d ldd r26, Y+25 ; 0x19 2c0f4: ba 8d ldd r27, Y+26 ; 0x1a 2c0f6: 41 cf rjmp .-382 ; 0x2bf7a // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2c0f8: 2f 5f subi r18, 0xFF ; 255 2c0fa: 3f 4f sbci r19, 0xFF ; 255 2c0fc: ab 8d ldd r26, Y+27 ; 0x1b 2c0fe: bc 8d ldd r27, Y+28 ; 0x1c 2c100: a2 0f add r26, r18 2c102: b3 1f adc r27, r19 2c104: bc 8f std Y+28, r27 ; 0x1c 2c106: ab 8f std Y+27, r26 ; 0x1b 2c108: a0 3d cpi r26, 0xD0 ; 208 2c10a: b2 40 sbci r27, 0x02 ; 2 2c10c: 08 f4 brcc .+2 ; 0x2c110 2c10e: 26 cf rjmp .-436 ; 0x2bf5c 2c110: c4 cf rjmp .-120 ; 0x2c09a 0002c112 : 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){ 2c112: 2f 92 push r2 2c114: 3f 92 push r3 2c116: 4f 92 push r4 2c118: 5f 92 push r5 2c11a: 6f 92 push r6 2c11c: 7f 92 push r7 2c11e: 8f 92 push r8 2c120: 9f 92 push r9 2c122: af 92 push r10 2c124: bf 92 push r11 2c126: cf 92 push r12 2c128: df 92 push r13 2c12a: ef 92 push r14 2c12c: ff 92 push r15 2c12e: 0f 93 push r16 2c130: 1f 93 push r17 2c132: cf 93 push r28 2c134: df 93 push r29 2c136: cd b7 in r28, 0x3d ; 61 2c138: de b7 in r29, 0x3e ; 62 2c13a: ca 55 subi r28, 0x5A ; 90 2c13c: d1 09 sbc r29, r1 2c13e: 0f b6 in r0, 0x3f ; 63 2c140: f8 94 cli 2c142: de bf out 0x3e, r29 ; 62 2c144: 0f be out 0x3f, r0 ; 63 2c146: cd bf out 0x3d, r28 ; 61 2c148: 63 96 adiw r28, 0x13 ; 19 2c14a: 9f af std Y+63, r25 ; 0x3f 2c14c: 8e af std Y+62, r24 ; 0x3e 2c14e: 63 97 sbiw r28, 0x13 ; 19 2c150: 8b 01 movw r16, r22 2c152: 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 2c154: 7e 01 movw r14, r28 2c156: 25 e4 ldi r18, 0x45 ; 69 2c158: e2 0e add r14, r18 2c15a: f1 1c adc r15, r1 2c15c: 80 e1 ldi r24, 0x10 ; 16 2c15e: 97 e2 ldi r25, 0x27 ; 39 2c160: f7 01 movw r30, r14 2c162: 91 83 std Z+1, r25 ; 0x01 2c164: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2c166: 80 eb ldi r24, 0xB0 ; 176 2c168: 9c e9 ldi r25, 0x9C ; 156 2c16a: 9f 93 push r25 2c16c: 8f 93 push r24 2c16e: 0f 94 5f a2 call 0x344be ; 0x344be 2c172: 2e e5 ldi r18, 0x5E ; 94 2c174: 36 e0 ldi r19, 0x06 ; 6 2c176: 61 96 adiw r28, 0x11 ; 17 2c178: 3f af std Y+63, r19 ; 0x3f 2c17a: 2e af std Y+62, r18 ; 0x3e 2c17c: 61 97 sbiw r28, 0x11 ; 17 2c17e: c8 01 movw r24, r16 2c180: 80 5e subi r24, 0xE0 ; 224 2c182: 93 40 sbci r25, 0x03 ; 3 2c184: 2b 96 adiw r28, 0x0b ; 11 2c186: 9f af std Y+63, r25 ; 0x3f 2c188: 8e af std Y+62, r24 ; 0x3e 2c18a: 2b 97 sbiw r28, 0x0b ; 11 2c18c: 0f 90 pop r0 2c18e: 0f 90 pop r0 2c190: e0 e4 ldi r30, 0x40 ; 64 2c192: f0 e0 ldi r31, 0x00 ; 0 2c194: 29 96 adiw r28, 0x09 ; 9 2c196: ff af std Y+63, r31 ; 0x3f 2c198: ee af std Y+62, r30 ; 0x3e 2c19a: 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); 2c19c: 63 96 adiw r28, 0x13 ; 19 2c19e: 2e ad ldd r18, Y+62 ; 0x3e 2c1a0: 3f ad ldd r19, Y+63 ; 0x3f 2c1a2: 63 97 sbiw r28, 0x13 ; 19 2c1a4: 20 5e subi r18, 0xE0 ; 224 2c1a6: 33 40 sbci r19, 0x03 ; 3 2c1a8: 69 96 adiw r28, 0x19 ; 25 2c1aa: 3f af std Y+63, r19 ; 0x3f 2c1ac: 2e af std Y+62, r18 ; 0x3e 2c1ae: 69 97 sbiw r28, 0x19 ; 25 2c1b0: 29 96 adiw r28, 0x09 ; 9 2c1b2: 4e ac ldd r4, Y+62 ; 0x3e 2c1b4: 5f ac ldd r5, Y+63 ; 0x3f 2c1b6: 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){ 2c1b8: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2c1ba: 63 96 adiw r28, 0x13 ; 19 2c1bc: 8e ad ldd r24, Y+62 ; 0x3e 2c1be: 9f ad ldd r25, Y+63 ; 0x3f 2c1c0: 63 97 sbiw r28, 0x13 ; 19 2c1c2: 80 52 subi r24, 0x20 ; 32 2c1c4: 9c 4f sbci r25, 0xFC ; 252 2c1c6: 6b 96 adiw r28, 0x1b ; 27 2c1c8: 9f af std Y+63, r25 ; 0x3f 2c1ca: 8e af std Y+62, r24 ; 0x3e 2c1cc: 6b 97 sbiw r28, 0x1b ; 27 2c1ce: 60 90 54 06 lds r6, 0x0654 ; 0x800654 2c1d2: 70 90 55 06 lds r7, 0x0655 ; 0x800655 2c1d6: 80 90 56 06 lds r8, 0x0656 ; 0x800656 2c1da: 90 90 57 06 lds r9, 0x0657 ; 0x800657 2c1de: 6b 96 adiw r28, 0x1b ; 27 2c1e0: ae ac ldd r10, Y+62 ; 0x3e 2c1e2: bf ac ldd r11, Y+63 ; 0x3f 2c1e4: 6b 97 sbiw r28, 0x1b ; 27 2c1e6: 31 10 cpse r3, r1 2c1e8: 04 c0 rjmp .+8 ; 0x2c1f2 2c1ea: 69 96 adiw r28, 0x19 ; 25 2c1ec: ae ac ldd r10, Y+62 ; 0x3e 2c1ee: bf ac ldd r11, Y+63 ; 0x3f 2c1f0: 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; 2c1f2: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2c1f6: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2c1fa: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2c1fe: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2c202: f5 01 movw r30, r10 2c204: e8 1b sub r30, r24 2c206: f9 0b sbc r31, r25 2c208: 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) 2c20a: 71 f0 breq .+28 ; 0x2c228 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)); 2c20c: af 01 movw r20, r30 2c20e: f7 ff sbrs r31, 7 2c210: 04 c0 rjmp .+8 ; 0x2c21a 2c212: 44 27 eor r20, r20 2c214: 55 27 eor r21, r21 2c216: 4e 1b sub r20, r30 2c218: 5f 0b sbc r21, r31 2c21a: 69 2f mov r22, r25 2c21c: 66 1f adc r22, r22 2c21e: 66 27 eor r22, r22 2c220: 66 1f adc r22, r22 2c222: 81 e0 ldi r24, 0x01 ; 1 2c224: 0f 94 18 5f call 0x2be30 ; 0x2be30 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2c228: 80 91 50 06 lds r24, 0x0650 ; 0x800650 2c22c: 90 91 51 06 lds r25, 0x0651 ; 0x800651 2c230: a0 91 52 06 lds r26, 0x0652 ; 0x800652 2c234: b0 91 53 06 lds r27, 0x0653 ; 0x800653 2c238: 2b 96 adiw r28, 0x0b ; 11 2c23a: 4e ad ldd r20, Y+62 ; 0x3e 2c23c: 5f ad ldd r21, Y+63 ; 0x3f 2c23e: 2b 97 sbiw r28, 0x0b ; 11 2c240: 48 1b sub r20, r24 2c242: 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)); 2c244: 57 fd sbrc r21, 7 2c246: b2 c0 rjmp .+356 ; 0x2c3ac 2c248: 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) 2c24a: 41 15 cp r20, r1 2c24c: 51 05 cpc r21, r1 2c24e: 09 f0 breq .+2 ; 0x2c252 2c250: ae c0 rjmp .+348 ; 0x2c3ae // 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; 2c252: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c256: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c25a: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c25e: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c262: 68 1a sub r6, r24 2c264: 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)); 2c266: 77 fc sbrc r7, 7 2c268: ab c0 rjmp .+342 ; 0x2c3c0 2c26a: 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) 2c26c: 61 14 cp r6, r1 2c26e: 71 04 cpc r7, r1 2c270: 09 f0 breq .+2 ; 0x2c274 2c272: a7 c0 rjmp .+334 ; 0x2c3c2 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); 2c274: 40 91 54 06 lds r20, 0x0654 ; 0x800654 2c278: 50 91 55 06 lds r21, 0x0655 ; 0x800655 2c27c: 60 91 56 06 lds r22, 0x0656 ; 0x800656 2c280: 70 91 57 06 lds r23, 0x0657 ; 0x800657 2c284: 00 e0 ldi r16, 0x00 ; 0 2c286: 28 ec ldi r18, 0xC8 ; 200 2c288: 30 e0 ldi r19, 0x00 ; 0 2c28a: 2b 96 adiw r28, 0x0b ; 11 2c28c: 6e ad ldd r22, Y+62 ; 0x3e 2c28e: 7f ad ldd r23, Y+63 ; 0x3f 2c290: 2b 97 sbiw r28, 0x0b ; 11 2c292: c5 01 movw r24, r10 2c294: 0e 94 c0 d3 call 0x1a780 ; 0x1a780 sm4_set_dir(X_AXIS, d); 2c298: 63 2d mov r22, r3 2c29a: 80 e0 ldi r24, 0x00 ; 0 2c29c: 0f 94 25 26 call 0x24c4a ; 0x24c4a //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2c2a0: 5f 92 push r5 2c2a2: 4f 92 push r4 2c2a4: 8c ea ldi r24, 0xAC ; 172 2c2a6: 9c e9 ldi r25, 0x9C ; 156 2c2a8: 9f 93 push r25 2c2aa: 8f 93 push r24 2c2ac: 0f 94 5f a2 call 0x344be ; 0x344be lcd_set_cursor(4,3); 2c2b0: 63 e0 ldi r22, 0x03 ; 3 2c2b2: 84 e0 ldi r24, 0x04 ; 4 2c2b4: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2c2b8: 5f 92 push r5 2c2ba: 4f 92 push r4 2c2bc: 8d e9 ldi r24, 0x9D ; 157 2c2be: 9c e9 ldi r25, 0x9C ; 156 2c2c0: 9f 93 push r25 2c2c2: 8f 93 push r24 2c2c4: 0e 94 db 6e call 0xddb6 ; 0xddb6 2c2c8: 0f b6 in r0, 0x3f ; 63 2c2ca: f8 94 cli 2c2cc: de bf out 0x3e, r29 ; 62 2c2ce: 0f be out 0x3f, r0 ; 63 2c2d0: cd bf out 0x3d, r28 ; 61 2c2d2: 21 e0 ldi r18, 0x01 ; 1 2c2d4: 30 e0 ldi r19, 0x00 ; 0 2c2d6: 31 10 cpse r3, r1 2c2d8: 02 c0 rjmp .+4 ; 0x2c2de 2c2da: 2f ef ldi r18, 0xFF ; 255 2c2dc: 3f ef ldi r19, 0xFF ; 255 2c2de: 40 ec ldi r20, 0xC0 ; 192 2c2e0: 42 03 mulsu r20, r18 2c2e2: c0 01 movw r24, r0 2c2e4: 43 9f mul r20, r19 2c2e6: 90 0d add r25, r0 2c2e8: 11 24 eor r1, r1 2c2ea: 67 96 adiw r28, 0x17 ; 23 2c2ec: 9f af std Y+63, r25 ; 0x3f 2c2ee: 8e af std Y+62, r24 ; 0x3e 2c2f0: 67 97 sbiw r28, 0x17 ; 23 2c2f2: 40 ee ldi r20, 0xE0 ; 224 2c2f4: 53 e0 ldi r21, 0x03 ; 3 2c2f6: 24 9f mul r18, r20 2c2f8: 40 01 movw r8, r0 2c2fa: 25 9f mul r18, r21 2c2fc: 90 0c add r9, r0 2c2fe: 34 9f mul r19, r20 2c300: 90 0c add r9, r0 2c302: 11 24 eor r1, r1 2c304: 63 96 adiw r28, 0x13 ; 19 2c306: ee ad ldd r30, Y+62 ; 0x3e 2c308: ff ad ldd r31, Y+63 ; 0x3f 2c30a: 63 97 sbiw r28, 0x13 ; 19 2c30c: 8e 0e add r8, r30 2c30e: 9f 1e adc r9, r31 2c310: 9e 01 movw r18, r28 2c312: 2f 5f subi r18, 0xFF ; 255 2c314: 3f 4f sbci r19, 0xFF ; 255 2c316: 2d 96 adiw r28, 0x0d ; 13 2c318: 3f af std Y+63, r19 ; 0x3f 2c31a: 2e af std Y+62, r18 ; 0x3e 2c31c: 2d 97 sbiw r28, 0x0d ; 13 2c31e: 61 96 adiw r28, 0x11 ; 17 2c320: 8e ad ldd r24, Y+62 ; 0x3e 2c322: 9f ad ldd r25, Y+63 ; 0x3f 2c324: 61 97 sbiw r28, 0x11 ; 17 2c326: 2f 96 adiw r28, 0x0f ; 15 2c328: 9f af std Y+63, r25 ; 0x3f 2c32a: 8e af std Y+62, r24 ; 0x3e 2c32c: 2f 97 sbiw r28, 0x0f ; 15 2c32e: 71 2c mov r7, r1 2c330: 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; 2c332: e0 e1 ldi r30, 0x10 ; 16 2c334: f7 e2 ldi r31, 0x27 ; 39 2c336: 27 96 adiw r28, 0x07 ; 7 2c338: ff af std Y+63, r31 ; 0x3f 2c33a: ee af std Y+62, r30 ; 0x3e 2c33c: 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); 2c33e: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2c342: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2c346: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2c34a: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2c34e: 84 01 movw r16, r8 2c350: 08 1b sub r16, r24 2c352: 19 0b sbc r17, r25 2c354: 17 ff sbrs r17, 7 2c356: 03 c0 rjmp .+6 ; 0x2c35e 2c358: 11 95 neg r17 2c35a: 01 95 neg r16 2c35c: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2c35e: 98 01 movw r18, r16 2c360: 35 95 asr r19 2c362: 27 95 ror r18 2c364: 65 96 adiw r28, 0x15 ; 21 2c366: 3f af std Y+63, r19 ; 0x3f 2c368: 2e af std Y+62, r18 ; 0x3e 2c36a: 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; 2c36c: 1c 9b sbis 0x03, 4 ; 3 2c36e: 33 c0 rjmp .+102 ; 0x2c3d6 2c370: 45 e0 ldi r20, 0x05 ; 5 2c372: 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); 2c374: 65 96 adiw r28, 0x15 ; 21 2c376: ae ac ldd r10, Y+62 ; 0x3e 2c378: bf ac ldd r11, Y+63 ; 0x3f 2c37a: 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); 2c37c: 63 2d mov r22, r3 2c37e: 82 2d mov r24, r2 2c380: 0e 94 67 d3 call 0x1a6ce ; 0x1a6ce while (steps--){ 2c384: 31 e0 ldi r19, 0x01 ; 1 2c386: a3 1a sub r10, r19 2c388: b1 08 sbc r11, r1 2c38a: 40 f1 brcs .+80 ; 0x2c3dc accelerate_1_step(axes, acc, delay_us, min_delay_us); 2c38c: 28 ec ldi r18, 0xC8 ; 200 2c38e: 30 e0 ldi r19, 0x00 ; 0 2c390: a7 01 movw r20, r14 2c392: 68 ee ldi r22, 0xE8 ; 232 2c394: 73 e0 ldi r23, 0x03 ; 3 2c396: 82 2d mov r24, r2 2c398: 0e 94 36 d2 call 0x1a46c ; 0x1a46c update_position_1_step(axes, dir); 2c39c: 63 2d mov r22, r3 2c39e: 82 2d mov r24, r2 2c3a0: 0e 94 80 d3 call 0x1a700 ; 0x1a700 2c3a4: ef cf rjmp .-34 ; 0x2c384 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){ 2c3a6: 33 24 eor r3, r3 2c3a8: 33 94 inc r3 2c3aa: 11 cf rjmp .-478 ; 0x2c1ce 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)); 2c3ac: 62 e0 ldi r22, 0x02 ; 2 2c3ae: 57 ff sbrs r21, 7 2c3b0: 03 c0 rjmp .+6 ; 0x2c3b8 2c3b2: 51 95 neg r21 2c3b4: 41 95 neg r20 2c3b6: 51 09 sbc r21, r1 2c3b8: 82 e0 ldi r24, 0x02 ; 2 2c3ba: 0f 94 18 5f call 0x2be30 ; 0x2be30 2c3be: 49 cf rjmp .-366 ; 0x2c252 // 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)); 2c3c0: 64 e0 ldi r22, 0x04 ; 4 2c3c2: a3 01 movw r20, r6 2c3c4: 77 fe sbrs r7, 7 2c3c6: 03 c0 rjmp .+6 ; 0x2c3ce 2c3c8: 51 95 neg r21 2c3ca: 41 95 neg r20 2c3cc: 51 09 sbc r21, r1 2c3ce: 84 e0 ldi r24, 0x04 ; 4 2c3d0: 0f 94 18 5f call 0x2be30 ; 0x2be30 2c3d4: 4f cf rjmp .-354 ; 0x2c274 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; 2c3d6: 22 24 eor r2, r2 2c3d8: 23 94 inc r2 2c3da: cc cf rjmp .-104 ; 0x2c374 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); 2c3dc: 65 96 adiw r28, 0x15 ; 21 2c3de: ee ad ldd r30, Y+62 ; 0x3e 2c3e0: ff ad ldd r31, Y+63 ; 0x3f 2c3e2: 65 97 sbiw r28, 0x15 ; 21 2c3e4: 0e 1b sub r16, r30 2c3e6: 1f 0b sbc r17, r31 2c3e8: 23 96 adiw r28, 0x03 ; 3 2c3ea: 1f af std Y+63, r17 ; 0x3f 2c3ec: 0e af std Y+62, r16 ; 0x3e 2c3ee: 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); 2c3f0: 63 2d mov r22, r3 2c3f2: 82 2d mov r24, r2 2c3f4: 0e 94 67 d3 call 0x1a6ce ; 0x1a6ce while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2c3f8: 9e 01 movw r18, r28 2c3fa: 2f 5b subi r18, 0xBF ; 191 2c3fc: 3f 4f sbci r19, 0xFF ; 255 2c3fe: a7 01 movw r20, r14 2c400: 68 ee ldi r22, 0xE8 ; 232 2c402: 73 e0 ldi r23, 0x03 ; 3 2c404: 82 2d mov r24, r2 2c406: 0e 94 dd d2 call 0x1a5ba ; 0x1a5ba 2c40a: 88 23 and r24, r24 2c40c: 29 f0 breq .+10 ; 0x2c418 update_position_1_step(axes, dir); 2c40e: 63 2d mov r22, r3 2c410: 82 2d mov r24, r2 2c412: 0e 94 80 d3 call 0x1a700 ; 0x1a700 2c416: f0 cf rjmp .-32 ; 0x2c3f8 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2c418: 60 e0 ldi r22, 0x00 ; 0 2c41a: 82 e0 ldi r24, 0x02 ; 2 2c41c: 0f 94 25 26 call 0x24c4a ; 0x24c4a /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2c420: 20 e1 ldi r18, 0x10 ; 16 2c422: 37 e2 ldi r19, 0x27 ; 39 2c424: 27 96 adiw r28, 0x07 ; 7 2c426: 3f af std Y+63, r19 ; 0x3f 2c428: 2e af std Y+62, r18 ; 0x3e 2c42a: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2c42c: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c430: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c434: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c438: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2c43c: 00 5a subi r16, 0xA0 ; 160 2c43e: 16 4f sbci r17, 0xF6 ; 246 2c440: 17 ff sbrs r17, 7 2c442: 02 c0 rjmp .+4 ; 0x2c448 2c444: 0f 5f subi r16, 0xFF ; 255 2c446: 1f 4f sbci r17, 0xFF ; 255 2c448: 15 95 asr r17 2c44a: 07 95 ror r16 2c44c: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c450: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c454: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c458: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c45c: 80 17 cp r24, r16 2c45e: 91 07 cpc r25, r17 2c460: f4 f4 brge .+60 ; 0x2c49e if (!_PINDA){ 2c462: 1c 9b sbis 0x03, 4 ; 3 2c464: 1c c0 rjmp .+56 ; 0x2c49e break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2c466: 28 ec ldi r18, 0xC8 ; 200 2c468: 30 e0 ldi r19, 0x00 ; 0 2c46a: a7 01 movw r20, r14 2c46c: 68 ee ldi r22, 0xE8 ; 232 2c46e: 73 e0 ldi r23, 0x03 ; 3 2c470: 84 e0 ldi r24, 0x04 ; 4 2c472: 0e 94 36 d2 call 0x1a46c ; 0x1a46c /// 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_){ 2c476: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c47a: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c47e: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c482: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c486: 01 96 adiw r24, 0x01 ; 1 2c488: a1 1d adc r26, r1 2c48a: b1 1d adc r27, r1 2c48c: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c490: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c494: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c498: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c49c: d7 cf rjmp .-82 ; 0x2c44c break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2c49e: 1c 9b sbis 0x03, 4 ; 3 2c4a0: 3f c0 rjmp .+126 ; 0x2c520 steps_to_go = MAX(0, max_z - _Z); 2c4a2: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c4a6: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c4aa: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c4ae: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c4b2: e0 e6 ldi r30, 0x60 ; 96 2c4b4: f9 e0 ldi r31, 0x09 ; 9 2c4b6: e8 1b sub r30, r24 2c4b8: f9 0b sbc r31, r25 2c4ba: cf 01 movw r24, r30 2c4bc: f7 ff sbrs r31, 7 2c4be: 02 c0 rjmp .+4 ; 0x2c4c4 2c4c0: 90 e0 ldi r25, 0x00 ; 0 2c4c2: 80 e0 ldi r24, 0x00 ; 0 2c4c4: 25 96 adiw r28, 0x05 ; 5 2c4c6: 9f af std Y+63, r25 ; 0x3f 2c4c8: 8e af std Y+62, r24 ; 0x3e 2c4ca: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2c4cc: 1c 9b sbis 0x03, 4 ; 3 2c4ce: 28 c0 rjmp .+80 ; 0x2c520 2c4d0: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c4d4: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c4d8: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c4dc: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c4e0: 80 36 cpi r24, 0x60 ; 96 2c4e2: 99 40 sbci r25, 0x09 ; 9 2c4e4: ec f4 brge .+58 ; 0x2c520 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2c4e6: 9e 01 movw r18, r28 2c4e8: 2d 5b subi r18, 0xBD ; 189 2c4ea: 3f 4f sbci r19, 0xFF ; 255 2c4ec: a7 01 movw r20, r14 2c4ee: 68 ee ldi r22, 0xE8 ; 232 2c4f0: 73 e0 ldi r23, 0x03 ; 3 2c4f2: 84 e0 ldi r24, 0x04 ; 4 2c4f4: 0e 94 dd d2 call 0x1a5ba ; 0x1a5ba ++_Z_; 2c4f8: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c4fc: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c500: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c504: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c508: 01 96 adiw r24, 0x01 ; 1 2c50a: a1 1d adc r26, r1 2c50c: b1 1d adc r27, r1 2c50e: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c512: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c516: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c51a: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c51e: d6 cf rjmp .-84 ; 0x2c4cc /// \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); 2c520: 60 e0 ldi r22, 0x00 ; 0 2c522: 84 e0 ldi r24, 0x04 ; 4 2c524: 0e 94 67 d3 call 0x1a6ce ; 0x1a6ce while (delay_us < MAX_DELAY){ 2c528: f7 01 movw r30, r14 2c52a: 20 81 ld r18, Z 2c52c: 31 81 ldd r19, Z+1 ; 0x01 2c52e: 20 31 cpi r18, 0x10 ; 16 2c530: f7 e2 ldi r31, 0x27 ; 39 2c532: 3f 07 cpc r19, r31 2c534: 58 f4 brcc .+22 ; 0x2c54c accelerate_1_step(axes, -dec, delay_us, delay_us); 2c536: a7 01 movw r20, r14 2c538: 68 e1 ldi r22, 0x18 ; 24 2c53a: 7c ef ldi r23, 0xFC ; 252 2c53c: 84 e0 ldi r24, 0x04 ; 4 2c53e: 0e 94 36 d2 call 0x1a46c ; 0x1a46c update_position_1_step(axes, dir); 2c542: 60 e0 ldi r22, 0x00 ; 0 2c544: 84 e0 ldi r24, 0x04 ; 4 2c546: 0e 94 80 d3 call 0x1a700 ; 0x1a700 2c54a: ee cf rjmp .-36 ; 0x2c528 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2c54c: 61 e0 ldi r22, 0x01 ; 1 2c54e: 82 e0 ldi r24, 0x02 ; 2 2c550: 0f 94 25 26 call 0x24c4a ; 0x24c4a /// speed up current_delay_us = MAX_DELAY; 2c554: 20 e1 ldi r18, 0x10 ; 16 2c556: 37 e2 ldi r19, 0x27 ; 39 2c558: f7 01 movw r30, r14 2c55a: 31 83 std Z+1, r19 ; 0x01 2c55c: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2c55e: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c562: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c566: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c56a: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2c56e: 0c 0d add r16, r12 2c570: 1d 1d adc r17, r13 2c572: 17 ff sbrs r17, 7 2c574: 02 c0 rjmp .+4 ; 0x2c57a 2c576: 0f 5f subi r16, 0xFF ; 255 2c578: 1f 4f sbci r17, 0xFF ; 255 2c57a: 15 95 asr r17 2c57c: 07 95 ror r16 2c57e: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c582: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c586: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c58a: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c58e: 08 17 cp r16, r24 2c590: 19 07 cpc r17, r25 2c592: 0c f0 brlt .+2 ; 0x2c596 2c594: d9 c0 rjmp .+434 ; 0x2c748 if (_PINDA){ 2c596: 1c 9b sbis 0x03, 4 ; 3 2c598: bb c0 rjmp .+374 ; 0x2c710 z_trig = _Z; 2c59a: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c59e: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c5a2: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c5a6: 30 91 57 06 lds r19, 0x0657 ; 0x800657 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 2c5aa: 1c 99 sbic 0x03, 4 ; 3 2c5ac: 28 c0 rjmp .+80 ; 0x2c5fe steps_to_go = MAX(0, _Z - min_z); 2c5ae: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c5b2: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c5b6: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c5ba: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c5be: 8c 19 sub r24, r12 2c5c0: 9d 09 sbc r25, r13 2c5c2: 97 ff sbrs r25, 7 2c5c4: 02 c0 rjmp .+4 ; 0x2c5ca 2c5c6: 90 e0 ldi r25, 0x00 ; 0 2c5c8: 80 e0 ldi r24, 0x00 ; 0 2c5ca: 25 96 adiw r28, 0x05 ; 5 2c5cc: 9f af std Y+63, r25 ; 0x3f 2c5ce: 8e af std Y+62, r24 ; 0x3e 2c5d0: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2c5d2: 1c 99 sbic 0x03, 4 ; 3 2c5d4: 0c c0 rjmp .+24 ; 0x2c5ee 2c5d6: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c5da: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c5de: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c5e2: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c5e6: c8 16 cp r12, r24 2c5e8: d9 06 cpc r13, r25 2c5ea: 0c f4 brge .+2 ; 0x2c5ee 2c5ec: af c0 rjmp .+350 ; 0x2c74c go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2c5ee: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c5f2: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c5f6: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c5fa: 30 91 57 06 lds r19, 0x0657 ; 0x800657 } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 2c5fe: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c602: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c606: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c60a: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c60e: c8 16 cp r12, r24 2c610: d9 06 cpc r13, r25 2c612: 3c f4 brge .+14 ; 0x2c622 2c614: f7 01 movw r30, r14 2c616: 80 81 ld r24, Z 2c618: 91 81 ldd r25, Z+1 ; 0x01 2c61a: 80 31 cpi r24, 0x10 ; 16 2c61c: 97 42 sbci r25, 0x27 ; 39 2c61e: 08 f4 brcc .+2 ; 0x2c622 2c620: b2 c0 rjmp .+356 ; 0x2c786 2c622: 0c 19 sub r16, r12 2c624: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2c626: 31 10 cpse r3, r1 2c628: ca c0 rjmp .+404 ; 0x2c7be line_buffer[c] = (uint16_t)(z_trig - min_z); 2c62a: f3 01 movw r30, r6 2c62c: ee 0f add r30, r30 2c62e: ff 1f adc r31, r31 2c630: 21 e0 ldi r18, 0x01 ; 1 2c632: 30 e0 ldi r19, 0x00 ; 0 2c634: 2c 0f add r18, r28 2c636: 3d 1f adc r19, r29 2c638: e2 0f add r30, r18 2c63a: f3 1f adc r31, r19 2c63c: 11 83 std Z+1, r17 ; 0x01 2c63e: 00 83 st Z, r16 2c640: ff ef ldi r31, 0xFF ; 255 2c642: 6f 1a sub r6, r31 2c644: 7f 0a sbc r7, r31 2c646: 67 96 adiw r28, 0x17 ; 23 2c648: 2e ad ldd r18, Y+62 ; 0x3e 2c64a: 3f ad ldd r19, Y+63 ; 0x3f 2c64c: 67 97 sbiw r28, 0x17 ; 23 2c64e: 82 0e add r8, r18 2c650: 93 1e adc r9, r19 2c652: 2d 96 adiw r28, 0x0d ; 13 2c654: 8e ad ldd r24, Y+62 ; 0x3e 2c656: 9f ad ldd r25, Y+63 ; 0x3f 2c658: 2d 97 sbiw r28, 0x0d ; 13 2c65a: 02 97 sbiw r24, 0x02 ; 2 2c65c: 2d 96 adiw r28, 0x0d ; 13 2c65e: 9f af std Y+63, r25 ; 0x3f 2c660: 8e af std Y+62, r24 ; 0x3e 2c662: 2d 97 sbiw r28, 0x0d ; 13 2c664: 2f 96 adiw r28, 0x0f ; 15 2c666: ee ad ldd r30, Y+62 ; 0x3e 2c668: ff ad ldd r31, Y+63 ; 0x3f 2c66a: 2f 97 sbiw r28, 0x0f ; 15 2c66c: 31 97 sbiw r30, 0x01 ; 1 2c66e: 2f 96 adiw r28, 0x0f ; 15 2c670: ff af std Y+63, r31 ; 0x3f 2c672: ee af std Y+62, r30 ; 0x3e 2c674: 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 2c676: f0 e2 ldi r31, 0x20 ; 32 2c678: 6f 16 cp r6, r31 2c67a: 71 04 cpc r7, r1 2c67c: 09 f0 breq .+2 ; 0x2c680 2c67e: 59 ce rjmp .-846 ; 0x2c332 2c680: 21 e0 ldi r18, 0x01 ; 1 2c682: 42 1a sub r4, r18 2c684: 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){ 2c686: 31 e0 ldi r19, 0x01 ; 1 2c688: 33 12 cpse r3, r19 2c68a: 8d ce rjmp .-742 ; 0x2c3a6 2c68c: 61 96 adiw r28, 0x11 ; 17 2c68e: 8e ad ldd r24, Y+62 ; 0x3e 2c690: 9f ad ldd r25, Y+63 ; 0x3f 2c692: 61 97 sbiw r28, 0x11 ; 17 2c694: 80 96 adiw r24, 0x20 ; 32 2c696: 61 96 adiw r28, 0x11 ; 17 2c698: 9f af std Y+63, r25 ; 0x3f 2c69a: 8e af std Y+62, r24 ; 0x3e 2c69c: 61 97 sbiw r28, 0x11 ; 17 2c69e: 2b 96 adiw r28, 0x0b ; 11 2c6a0: ee ad ldd r30, Y+62 ; 0x3e 2c6a2: ff ad ldd r31, Y+63 ; 0x3f 2c6a4: 2b 97 sbiw r28, 0x0b ; 11 2c6a6: e0 5c subi r30, 0xC0 ; 192 2c6a8: ff 4f sbci r31, 0xFF ; 255 2c6aa: 2b 96 adiw r28, 0x0b ; 11 2c6ac: ff af std Y+63, r31 ; 0x3f 2c6ae: ee af std Y+62, r30 ; 0x3e 2c6b0: 2b 97 sbiw r28, 0x0b ; 11 2c6b2: 29 96 adiw r28, 0x09 ; 9 2c6b4: 2e ad ldd r18, Y+62 ; 0x3e 2c6b6: 3f ad ldd r19, Y+63 ; 0x3f 2c6b8: 29 97 sbiw r28, 0x09 ; 9 2c6ba: 22 50 subi r18, 0x02 ; 2 2c6bc: 31 09 sbc r19, r1 2c6be: 29 96 adiw r28, 0x09 ; 9 2c6c0: 3f af std Y+63, r19 ; 0x3f 2c6c2: 2e af std Y+62, r18 ; 0x3e 2c6c4: 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 2c6c6: 23 2b or r18, r19 2c6c8: 09 f0 breq .+2 ; 0x2c6cc 2c6ca: 72 cd rjmp .-1308 ; 0x2c1b0 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); 2c6cc: 8b e9 ldi r24, 0x9B ; 155 2c6ce: 9c e9 ldi r25, 0x9C ; 156 2c6d0: 9f 93 push r25 2c6d2: 8f 93 push r24 2c6d4: 0f 94 5f a2 call 0x344be ; 0x344be 2c6d8: 0f 90 pop r0 2c6da: 0f 90 pop r0 } 2c6dc: c6 5a subi r28, 0xA6 ; 166 2c6de: df 4f sbci r29, 0xFF ; 255 2c6e0: 0f b6 in r0, 0x3f ; 63 2c6e2: f8 94 cli 2c6e4: de bf out 0x3e, r29 ; 62 2c6e6: 0f be out 0x3f, r0 ; 63 2c6e8: cd bf out 0x3d, r28 ; 61 2c6ea: df 91 pop r29 2c6ec: cf 91 pop r28 2c6ee: 1f 91 pop r17 2c6f0: 0f 91 pop r16 2c6f2: ff 90 pop r15 2c6f4: ef 90 pop r14 2c6f6: df 90 pop r13 2c6f8: cf 90 pop r12 2c6fa: bf 90 pop r11 2c6fc: af 90 pop r10 2c6fe: 9f 90 pop r9 2c700: 8f 90 pop r8 2c702: 7f 90 pop r7 2c704: 6f 90 pop r6 2c706: 5f 90 pop r5 2c708: 4f 90 pop r4 2c70a: 3f 90 pop r3 2c70c: 2f 90 pop r2 2c70e: 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); 2c710: 28 ec ldi r18, 0xC8 ; 200 2c712: 30 e0 ldi r19, 0x00 ; 0 2c714: a7 01 movw r20, r14 2c716: 68 ee ldi r22, 0xE8 ; 232 2c718: 73 e0 ldi r23, 0x03 ; 3 2c71a: 84 e0 ldi r24, 0x04 ; 4 2c71c: 0e 94 36 d2 call 0x1a46c ; 0x1a46c /// 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_){ 2c720: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c724: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c728: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c72c: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c730: 01 97 sbiw r24, 0x01 ; 1 2c732: a1 09 sbc r26, r1 2c734: b1 09 sbc r27, r1 2c736: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c73a: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c73e: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c742: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c746: 1b cf rjmp .-458 ; 0x2c57e 2c748: 86 01 movw r16, r12 2c74a: 2f cf rjmp .-418 ; 0x2c5aa } /// 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); 2c74c: 9e 01 movw r18, r28 2c74e: 2d 5b subi r18, 0xBD ; 189 2c750: 3f 4f sbci r19, 0xFF ; 255 2c752: a7 01 movw r20, r14 2c754: 68 ee ldi r22, 0xE8 ; 232 2c756: 73 e0 ldi r23, 0x03 ; 3 2c758: 84 e0 ldi r24, 0x04 ; 4 2c75a: 0e 94 dd d2 call 0x1a5ba ; 0x1a5ba --_Z_; 2c75e: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c762: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c766: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c76a: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c76e: 01 97 sbiw r24, 0x01 ; 1 2c770: a1 09 sbc r26, r1 2c772: b1 09 sbc r27, r1 2c774: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c778: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c77c: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c780: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c784: 26 cf rjmp .-436 ; 0x2c5d2 } 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); 2c786: 28 ec ldi r18, 0xC8 ; 200 2c788: 30 e0 ldi r19, 0x00 ; 0 2c78a: a7 01 movw r20, r14 2c78c: 68 e1 ldi r22, 0x18 ; 24 2c78e: 7c ef ldi r23, 0xFC ; 252 2c790: 84 e0 ldi r24, 0x04 ; 4 2c792: 0e 94 36 d2 call 0x1a46c ; 0x1a46c --_Z_; 2c796: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c79a: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c79e: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c7a2: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c7a6: 01 97 sbiw r24, 0x01 ; 1 2c7a8: a1 09 sbc r26, r1 2c7aa: b1 09 sbc r27, r1 2c7ac: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c7b0: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c7b4: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c7b8: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c7bc: 20 cf rjmp .-448 ; 0x2c5fe 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); 2c7be: 2d 96 adiw r28, 0x0d ; 13 2c7c0: ee ad ldd r30, Y+62 ; 0x3e 2c7c2: ff ad ldd r31, Y+63 ; 0x3f 2c7c4: 2d 97 sbiw r28, 0x0d ; 13 2c7c6: 86 ad ldd r24, Z+62 ; 0x3e 2c7c8: 97 ad ldd r25, Z+63 ; 0x3f 2c7ca: 01 2e mov r0, r17 2c7cc: 00 0c add r0, r0 2c7ce: 22 0b sbc r18, r18 2c7d0: 33 0b sbc r19, r19 2c7d2: 08 0f add r16, r24 2c7d4: 19 1f adc r17, r25 2c7d6: 21 1d adc r18, r1 2c7d8: 31 1d adc r19, r1 2c7da: 36 95 lsr r19 2c7dc: 27 95 ror r18 2c7de: 17 95 ror r17 2c7e0: 07 95 ror r16 2c7e2: 0f 3f cpi r16, 0xFF ; 255 2c7e4: 11 05 cpc r17, r1 2c7e6: 21 05 cpc r18, r1 2c7e8: 31 05 cpc r19, r1 2c7ea: 29 f0 breq .+10 ; 0x2c7f6 2c7ec: 20 f0 brcs .+8 ; 0x2c7f6 2c7ee: 0f ef ldi r16, 0xFF ; 255 2c7f0: 10 e0 ldi r17, 0x00 ; 0 2c7f2: 20 e0 ldi r18, 0x00 ; 0 2c7f4: 30 e0 ldi r19, 0x00 ; 0 2c7f6: 2f 96 adiw r28, 0x0f ; 15 2c7f8: ee ad ldd r30, Y+62 ; 0x3e 2c7fa: ff ad ldd r31, Y+63 ; 0x3f 2c7fc: 2f 97 sbiw r28, 0x0f ; 15 2c7fe: 07 8f std Z+31, r16 ; 0x1f 2c800: 1f cf rjmp .-450 ; 0x2c640 0002c802 : 2c802: ef 92 push r14 2c804: ff 92 push r15 2c806: 0f 93 push r16 2c808: 1f 93 push r17 2c80a: cf 93 push r28 2c80c: df 93 push r29 2c80e: cd b7 in r28, 0x3d ; 61 2c810: de b7 in r29, 0x3e ; 62 2c812: 2f 97 sbiw r28, 0x0f ; 15 2c814: 0f b6 in r0, 0x3f ; 63 2c816: f8 94 cli 2c818: de bf out 0x3e, r29 ; 62 2c81a: 0f be out 0x3f, r0 ; 63 2c81c: cd bf out 0x3d, r28 ; 61 2c81e: 10 92 90 12 sts 0x1290, r1 ; 0x801290 2c822: 02 e9 ldi r16, 0x92 ; 146 2c824: 12 e1 ldi r17, 0x12 ; 18 2c826: ee 24 eor r14, r14 2c828: e3 94 inc r14 2c82a: f1 2c mov r15, r1 2c82c: d8 01 movw r26, r16 2c82e: 11 96 adiw r26, 0x01 ; 1 2c830: fc 92 st X, r15 2c832: ee 92 st -X, r14 2c834: 12 96 adiw r26, 0x02 ; 2 2c836: 1c 92 st X, r1 2c838: 12 97 sbiw r26, 0x02 ; 2 2c83a: 82 e8 ldi r24, 0x82 ; 130 2c83c: 13 96 adiw r26, 0x03 ; 3 2c83e: 8c 93 st X, r24 2c840: 40 e0 ldi r20, 0x00 ; 0 2c842: 60 e0 ldi r22, 0x00 ; 0 2c844: 87 e9 ldi r24, 0x97 ; 151 2c846: 92 e1 ldi r25, 0x12 ; 18 2c848: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 2c84c: 40 e0 ldi r20, 0x00 ; 0 2c84e: 60 e0 ldi r22, 0x00 ; 0 2c850: 8c e9 ldi r24, 0x9C ; 156 2c852: 92 e1 ldi r25, 0x12 ; 18 2c854: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 2c858: f8 01 movw r30, r16 2c85a: 17 86 std Z+15, r1 ; 0x0f 2c85c: 10 8a std Z+16, r1 ; 0x10 2c85e: 11 8a std Z+17, r1 ; 0x11 2c860: 12 8a std Z+18, r1 ; 0x12 2c862: 13 8a std Z+19, r1 ; 0x13 2c864: 8a e0 ldi r24, 0x0A ; 10 2c866: 84 8b std Z+20, r24 ; 0x14 2c868: 40 e0 ldi r20, 0x00 ; 0 2c86a: 60 e0 ldi r22, 0x00 ; 0 2c86c: ce 01 movw r24, r28 2c86e: 01 96 adiw r24, 0x01 ; 1 2c870: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 2c874: 85 e0 ldi r24, 0x05 ; 5 2c876: fe 01 movw r30, r28 2c878: 31 96 adiw r30, 0x01 ; 1 2c87a: de 01 movw r26, r28 2c87c: 16 96 adiw r26, 0x06 ; 6 2c87e: 01 90 ld r0, Z+ 2c880: 0d 92 st X+, r0 2c882: 8a 95 dec r24 2c884: e1 f7 brne .-8 ; 0x2c87e 2c886: 85 e0 ldi r24, 0x05 ; 5 2c888: fe 01 movw r30, r28 2c88a: 36 96 adiw r30, 0x06 ; 6 2c88c: a7 ea ldi r26, 0xA7 ; 167 2c88e: b2 e1 ldi r27, 0x12 ; 18 2c890: 01 90 ld r0, Z+ 2c892: 0d 92 st X+, r0 2c894: 8a 95 dec r24 2c896: e1 f7 brne .-8 ; 0x2c890 2c898: d8 01 movw r26, r16 2c89a: 5a 96 adiw r26, 0x1a ; 26 2c89c: 1c 92 st X, r1 2c89e: 5a 97 sbiw r26, 0x1a ; 26 2c8a0: 5c 96 adiw r26, 0x1c ; 28 2c8a2: 1c 92 st X, r1 2c8a4: 1e 92 st -X, r1 2c8a6: 5b 97 sbiw r26, 0x1b ; 27 2c8a8: 87 ea ldi r24, 0xA7 ; 167 2c8aa: 92 e1 ldi r25, 0x12 ; 18 2c8ac: 0f 94 7c 4e call 0x29cf8 ; 0x29cf8 2c8b0: f8 01 movw r30, r16 2c8b2: 81 8f std Z+25, r24 ; 0x19 2c8b4: 15 8e std Z+29, r1 ; 0x1d 2c8b6: 16 8e std Z+30, r1 ; 0x1e 2c8b8: 40 e0 ldi r20, 0x00 ; 0 2c8ba: 60 e0 ldi r22, 0x00 ; 0 2c8bc: 81 eb ldi r24, 0xB1 ; 177 2c8be: 92 e1 ldi r25, 0x12 ; 18 2c8c0: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 2c8c4: d8 01 movw r26, r16 2c8c6: 94 96 adiw r26, 0x24 ; 36 2c8c8: 1c 92 st X, r1 2c8ca: 40 e0 ldi r20, 0x00 ; 0 2c8cc: 60 e0 ldi r22, 0x00 ; 0 2c8ce: ce 01 movw r24, r28 2c8d0: 0b 96 adiw r24, 0x0b ; 11 2c8d2: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 2c8d6: 85 e0 ldi r24, 0x05 ; 5 2c8d8: fe 01 movw r30, r28 2c8da: 3b 96 adiw r30, 0x0b ; 11 2c8dc: de 01 movw r26, r28 2c8de: 11 96 adiw r26, 0x01 ; 1 2c8e0: 01 90 ld r0, Z+ 2c8e2: 0d 92 st X+, r0 2c8e4: 8a 95 dec r24 2c8e6: e1 f7 brne .-8 ; 0x2c8e0 2c8e8: 85 e0 ldi r24, 0x05 ; 5 2c8ea: fe 01 movw r30, r28 2c8ec: 31 96 adiw r30, 0x01 ; 1 2c8ee: a7 eb ldi r26, 0xB7 ; 183 2c8f0: b2 e1 ldi r27, 0x12 ; 18 2c8f2: 01 90 ld r0, Z+ 2c8f4: 0d 92 st X+, r0 2c8f6: 8a 95 dec r24 2c8f8: e1 f7 brne .-8 ; 0x2c8f2 2c8fa: f8 01 movw r30, r16 2c8fc: 12 a6 std Z+42, r1 ; 0x2a 2c8fe: 14 a6 std Z+44, r1 ; 0x2c 2c900: 13 a6 std Z+43, r1 ; 0x2b 2c902: 87 eb ldi r24, 0xB7 ; 183 2c904: 92 e1 ldi r25, 0x12 ; 18 2c906: 0f 94 7c 4e call 0x29cf8 ; 0x29cf8 2c90a: d8 01 movw r26, r16 2c90c: 99 96 adiw r26, 0x29 ; 41 2c90e: 8c 93 st X, r24 2c910: 99 97 sbiw r26, 0x29 ; 41 2c912: dd 96 adiw r26, 0x3d ; 61 2c914: 1c 92 st X, r1 2c916: dd 97 sbiw r26, 0x3d ; 61 2c918: 81 e9 ldi r24, 0x91 ; 145 2c91a: 92 e1 ldi r25, 0x12 ; 18 2c91c: df 96 adiw r26, 0x3f ; 63 2c91e: 9c 93 st X, r25 2c920: 8e 93 st -X, r24 2c922: de 97 sbiw r26, 0x3e ; 62 2c924: f0 92 d3 12 sts 0x12D3, r15 ; 0x8012d3 2c928: e0 92 d2 12 sts 0x12D2, r14 ; 0x8012d2 2c92c: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 2c930: 1f ef ldi r17, 0xFF ; 255 2c932: 10 93 d5 12 sts 0x12D5, r17 ; 0x8012d5 2c936: 0f 94 d0 4e call 0x29da0 ; 0x29da0 2c93a: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 2c93e: 10 92 d7 12 sts 0x12D7, r1 ; 0x8012d7 2c942: 10 92 d8 12 sts 0x12D8, r1 ; 0x8012d8 2c946: 10 92 d9 12 sts 0x12D9, r1 ; 0x8012d9 2c94a: 10 92 db 12 sts 0x12DB, r1 ; 0x8012db 2c94e: 10 92 da 12 sts 0x12DA, r1 ; 0x8012da 2c952: 10 92 dd 12 sts 0x12DD, r1 ; 0x8012dd 2c956: 10 92 dc 12 sts 0x12DC, r1 ; 0x8012dc 2c95a: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 2c95e: 10 92 e1 12 sts 0x12E1, r1 ; 0x8012e1 2c962: 10 92 e2 12 sts 0x12E2, r1 ; 0x8012e2 2c966: 10 92 e3 12 sts 0x12E3, r1 ; 0x8012e3 2c96a: 83 e0 ldi r24, 0x03 ; 3 2c96c: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 2c970: 10 92 e7 12 sts 0x12E7, r1 ; 0x8012e7 2c974: 85 e1 ldi r24, 0x15 ; 21 2c976: 80 93 de 12 sts 0x12DE, r24 ; 0x8012de 2c97a: 84 e1 ldi r24, 0x14 ; 20 2c97c: 80 93 df 12 sts 0x12DF, r24 ; 0x8012df 2c980: 83 e6 ldi r24, 0x63 ; 99 2c982: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 2c986: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 2c98a: 10 92 ea 12 sts 0x12EA, r1 ; 0x8012ea 2c98e: 10 92 eb 12 sts 0x12EB, r1 ; 0x8012eb 2c992: 10 92 ec 12 sts 0x12EC, r1 ; 0x8012ec 2c996: 10 92 ed 12 sts 0x12ED, r1 ; 0x8012ed 2c99a: 10 92 ee 12 sts 0x12EE, r1 ; 0x8012ee 2c99e: 10 92 ef 12 sts 0x12EF, r1 ; 0x8012ef 2c9a2: 10 92 f0 12 sts 0x12F0, r1 ; 0x8012f0 2c9a6: 10 92 f1 12 sts 0x12F1, r1 ; 0x8012f1 2c9aa: 10 92 f2 12 sts 0x12F2, r1 ; 0x8012f2 2c9ae: 10 92 f3 12 sts 0x12F3, r1 ; 0x8012f3 2c9b2: 10 92 f4 12 sts 0x12F4, r1 ; 0x8012f4 2c9b6: 10 92 f5 12 sts 0x12F5, r1 ; 0x8012f5 2c9ba: 10 92 f7 12 sts 0x12F7, r1 ; 0x8012f7 2c9be: 10 92 f6 12 sts 0x12F6, r1 ; 0x8012f6 2c9c2: 10 92 f8 12 sts 0x12F8, r1 ; 0x8012f8 2c9c6: 8e e2 ldi r24, 0x2E ; 46 2c9c8: 90 e8 ldi r25, 0x80 ; 128 2c9ca: 90 93 fa 12 sts 0x12FA, r25 ; 0x8012fa 2c9ce: 80 93 f9 12 sts 0x12F9, r24 ; 0x8012f9 2c9d2: 10 93 fb 12 sts 0x12FB, r17 ; 0x8012fb 2c9d6: 10 93 fc 12 sts 0x12FC, r17 ; 0x8012fc 2c9da: 10 92 fe 12 sts 0x12FE, r1 ; 0x8012fe 2c9de: 10 92 fd 12 sts 0x12FD, r1 ; 0x8012fd 2c9e2: 10 93 ff 12 sts 0x12FF, r17 ; 0x8012ff 2c9e6: 82 e0 ldi r24, 0x02 ; 2 2c9e8: 80 93 00 13 sts 0x1300, r24 ; 0x801300 2c9ec: 10 92 01 13 sts 0x1301, r1 ; 0x801301 2c9f0: 10 92 02 13 sts 0x1302, r1 ; 0x801302 2c9f4: 10 92 03 13 sts 0x1303, r1 ; 0x801303 2c9f8: 10 92 04 13 sts 0x1304, r1 ; 0x801304 2c9fc: 10 92 06 13 sts 0x1306, r1 ; 0x801306 2ca00: 10 92 05 13 sts 0x1305, r1 ; 0x801305 2ca04: 10 92 08 13 sts 0x1308, r1 ; 0x801308 2ca08: 10 92 07 13 sts 0x1307, r1 ; 0x801307 2ca0c: 0f 94 a0 7b call 0x2f740 ; 0x2f740 2ca10: e5 ed ldi r30, 0xD5 ; 213 2ca12: f3 e1 ldi r31, 0x13 ; 19 2ca14: 10 92 5d 14 sts 0x145D, r1 ; 0x80145d 2ca18: 10 92 60 14 sts 0x1460, r1 ; 0x801460 2ca1c: 10 92 82 14 sts 0x1482, r1 ; 0x801482 2ca20: 10 92 85 14 sts 0x1485, r1 ; 0x801485 2ca24: 89 e1 ldi r24, 0x19 ; 25 2ca26: 80 93 44 16 sts 0x1644, r24 ; 0x801644 2ca2a: 10 92 47 16 sts 0x1647, r1 ; 0x801647 2ca2e: 10 92 48 16 sts 0x1648, r1 ; 0x801648 2ca32: 10 92 60 16 sts 0x1660, r1 ; 0x801660 2ca36: 10 92 67 16 sts 0x1667, r1 ; 0x801667 2ca3a: 10 92 6a 16 sts 0x166A, r1 ; 0x80166a 2ca3e: 10 92 e8 16 sts 0x16E8, r1 ; 0x8016e8 2ca42: 10 92 ea 16 sts 0x16EA, r1 ; 0x8016ea 2ca46: 10 92 e9 16 sts 0x16E9, r1 ; 0x8016e9 2ca4a: 10 92 79 15 sts 0x1579, r1 ; 0x801579 2ca4e: 10 92 78 15 sts 0x1578, r1 ; 0x801578 2ca52: 10 92 e4 16 sts 0x16E4, r1 ; 0x8016e4 2ca56: 10 92 e5 16 sts 0x16E5, r1 ; 0x8016e5 2ca5a: 10 92 e6 16 sts 0x16E6, r1 ; 0x8016e6 2ca5e: 10 92 e7 16 sts 0x16E7, r1 ; 0x8016e7 2ca62: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 2ca66: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 2ca6a: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 2ca6e: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee 2ca72: 12 82 std Z+2, r1 ; 0x02 2ca74: 13 82 std Z+3, r1 ; 0x03 2ca76: 10 82 st Z, r1 2ca78: 11 82 std Z+1, r1 ; 0x01 2ca7a: 10 92 77 15 sts 0x1577, r1 ; 0x801577 2ca7e: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a 2ca82: e5 ea ldi r30, 0xA5 ; 165 2ca84: f4 e1 ldi r31, 0x14 ; 20 2ca86: 82 ed ldi r24, 0xD2 ; 210 2ca88: df 01 movw r26, r30 2ca8a: 1d 92 st X+, r1 2ca8c: 8a 95 dec r24 2ca8e: e9 f7 brne .-6 ; 0x2ca8a 2ca90: 10 92 26 14 sts 0x1426, r1 ; 0x801426 2ca94: 10 92 25 14 sts 0x1425, r1 ; 0x801425 2ca98: 10 92 24 14 sts 0x1424, r1 ; 0x801424 2ca9c: 88 ee ldi r24, 0xE8 ; 232 2ca9e: 96 e1 ldi r25, 0x16 ; 22 2caa0: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> 2caa4: ee ec ldi r30, 0xCE ; 206 2caa6: f3 e1 ldi r31, 0x13 ; 19 2caa8: 11 82 std Z+1, r1 ; 0x01 2caaa: 12 82 std Z+2, r1 ; 0x02 2caac: 13 82 std Z+3, r1 ; 0x03 2caae: 14 82 std Z+4, r1 ; 0x04 2cab0: 15 82 std Z+5, r1 ; 0x05 2cab2: 16 82 std Z+6, r1 ; 0x06 2cab4: 10 83 st Z, r17 2cab6: e1 ef ldi r30, 0xF1 ; 241 2cab8: f6 e1 ldi r31, 0x16 ; 22 2caba: 15 82 std Z+5, r1 ; 0x05 2cabc: 17 82 std Z+7, r1 ; 0x07 2cabe: 16 82 std Z+6, r1 ; 0x06 2cac0: 11 86 std Z+9, r1 ; 0x09 2cac2: 13 86 std Z+11, r1 ; 0x0b 2cac4: 12 86 std Z+10, r1 ; 0x0a 2cac6: 0f 94 56 0b call 0x216ac ; 0x216ac 2caca: 60 93 07 17 sts 0x1707, r22 ; 0x801707 2cace: 70 93 08 17 sts 0x1708, r23 ; 0x801708 2cad2: 80 93 09 17 sts 0x1709, r24 ; 0x801709 2cad6: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a 2cada: 2f 96 adiw r28, 0x0f ; 15 2cadc: 0f b6 in r0, 0x3f ; 63 2cade: f8 94 cli 2cae0: de bf out 0x3e, r29 ; 62 2cae2: 0f be out 0x3f, r0 ; 63 2cae4: cd bf out 0x3d, r28 ; 61 2cae6: df 91 pop r29 2cae8: cf 91 pop r28 2caea: 1f 91 pop r17 2caec: 0f 91 pop r16 2caee: ff 90 pop r15 2caf0: ef 90 pop r14 2caf2: 08 95 ret 0002caf4 : 2caf4: 42 e0 ldi r20, 0x02 ; 2 2caf6: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2cafa: 0c 94 8c 7a jmp 0xf518 ; 0xf518 0002cafe : 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; 2cafe: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 2cb02: 83 36 cpi r24, 0x63 ; 99 2cb04: 09 f4 brne .+2 ; 0x2cb08 2cb06: 8f ef ldi r24, 0xFF ; 255 } 2cb08: 08 95 ret 0002cb0a : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2cb0a: 8c ed ldi r24, 0xDC ; 220 2cb0c: 91 ea ldi r25, 0xA1 ; 161 2cb0e: 0e 94 94 7a call 0xf528 ; 0xf528 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2cb12: 60 e0 ldi r22, 0x00 ; 0 2cb14: 8c ea ldi r24, 0xAC ; 172 2cb16: 9c e0 ldi r25, 0x0C ; 12 2cb18: 0e 94 2d 78 call 0xf05a ; 0xf05a if (status == 1) { 2cb1c: 81 30 cpi r24, 0x01 ; 1 2cb1e: 21 f4 brne .+8 ; 0x2cb28 SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2cb20: 8c e9 ldi r24, 0x9C ; 156 2cb22: 92 e6 ldi r25, 0x62 ; 98 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2cb24: 0c 94 8d 7c jmp 0xf91a ; 0xf91a 2cb28: 86 e9 ldi r24, 0x96 ; 150 2cb2a: 92 e6 ldi r25, 0x62 ; 98 2cb2c: fb cf rjmp .-10 ; 0x2cb24 0002cb2e : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2cb2e: bc 01 movw r22, r24 2cb30: 99 0f add r25, r25 2cb32: 88 0b sbc r24, r24 2cb34: 99 0b sbc r25, r25 2cb36: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2cb3a: 0c 94 8c 7a jmp 0xf518 ; 0xf518 0002cb3e : 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){ 2cb3e: cf 93 push r28 2cb40: c8 2f mov r28, r24 extruder = ex; 2cb42: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 2cb46: 8e ec ldi r24, 0xCE ; 206 2cb48: 91 ea ldi r25, 0xA1 ; 161 2cb4a: 0e 94 94 7a call 0xf528 ; 0xf528 2cb4e: 82 ec ldi r24, 0xC2 ; 194 2cb50: 91 ea ldi r25, 0xA1 ; 161 2cb52: 0e 94 94 7a call 0xf528 ; 0xf528 2cb56: 88 eb ldi r24, 0xB8 ; 184 2cb58: 91 ea ldi r25, 0xA1 ; 161 2cb5a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN((int)ex); 2cb5e: 8c 2f mov r24, r28 2cb60: 90 e0 ldi r25, 0x00 ; 0 } 2cb62: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 2cb64: 0d 94 97 65 jmp 0x2cb2e ; 0x2cb2e 0002cb68 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2cb68: 28 9a sbi 0x05, 0 ; 5 } 2cb6a: 08 95 ret 0002cb6c : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2cb6c: 0f 93 push r16 2cb6e: 1f 93 push r17 2cb70: cf 93 push r28 2cb72: df 93 push r29 2cb74: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2cb76: 0f 94 56 0b call 0x216ac ; 0x216ac 2cb7a: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2cb7c: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2cb80: 8f 3f cpi r24, 0xFF ; 255 2cb82: 69 f0 breq .+26 ; 0x2cb9e if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2cb84: 0f 94 56 0b call 0x216ac ; 0x216ac 2cb88: 60 1b sub r22, r16 2cb8a: 71 0b sbc r23, r17 2cb8c: 6c 17 cp r22, r28 2cb8e: 7d 07 cpc r23, r29 2cb90: a8 f3 brcs .-22 ; 0x2cb7c } return true; fail: return false; 2cb92: 80 e0 ldi r24, 0x00 ; 0 } 2cb94: df 91 pop r29 2cb96: cf 91 pop r28 2cb98: 1f 91 pop r17 2cb9a: 0f 91 pop r16 2cb9c: 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; 2cb9e: 81 e0 ldi r24, 0x01 ; 1 2cba0: f9 cf rjmp .-14 ; 0x2cb94 0002cba2 : lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 2cba2: 87 e6 ldi r24, 0x67 ; 103 2cba4: 96 e1 ldi r25, 0x16 ; 22 2cba6: 0f 94 3d 2c call 0x2587a ; 0x2587a file.close(); 2cbaa: 87 e6 ldi r24, 0x67 ; 103 2cbac: 96 e1 ldi r25, 0x16 ; 22 2cbae: 0f 94 72 2c call 0x258e4 ; 0x258e4 saving = false; 2cbb2: e5 ed ldi r30, 0xD5 ; 213 2cbb4: f3 e1 ldi r31, 0x13 ; 19 2cbb6: 10 82 st Z, r1 logging = false; 2cbb8: 11 82 std Z+1, r1 ; 0x01 // so one can unplug the printer and continue printing the next day. } } 2cbba: 08 95 ret 0002cbbc : //! If printing from sd card, position in file is saved. //! 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) 2cbbc: cf 92 push r12 2cbbe: df 92 push r13 2cbc0: ef 92 push r14 2cbc2: ff 92 push r15 2cbc4: 0f 93 push r16 2cbc6: 1f 93 push r17 2cbc8: cf 93 push r28 2cbca: df 93 push r29 { if (saved_printing) return; 2cbcc: 20 91 73 12 lds r18, 0x1273 ; 0x801273 2cbd0: 21 11 cpse r18, r1 2cbd2: d9 c0 rjmp .+434 ; 0x2cd86 2cbd4: 09 2f mov r16, r25 2cbd6: 18 2f mov r17, r24 2cbd8: eb 01 movw r28, r22 cli(); 2cbda: f8 94 cli void save_print_file_state() { uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { 2cbdc: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 2cbe0: 88 23 and r24, r24 2cbe2: 09 f4 brne .+2 ; 0x2cbe6 2cbe4: d9 c0 rjmp .+434 ; 0x2cd98 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue 2cbe6: 80 91 49 12 lds r24, 0x1249 ; 0x801249 2cbea: 90 91 4a 12 lds r25, 0x124A ; 0x80124a 2cbee: a0 91 4b 12 lds r26, 0x124B ; 0x80124b 2cbf2: b0 91 4c 12 lds r27, 0x124C ; 0x80124c 2cbf6: 80 93 45 12 sts 0x1245, r24 ; 0x801245 2cbfa: 90 93 46 12 sts 0x1246, r25 ; 0x801246 2cbfe: a0 93 47 12 sts 0x1247, r26 ; 0x801247 2cc02: b0 93 48 12 sts 0x1248, r27 ; 0x801248 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner 2cc06: 0f 94 ff 39 call 0x273fe ; 0x273fe saved_sdpos -= sdlen_planner; 2cc0a: c0 90 45 12 lds r12, 0x1245 ; 0x801245 2cc0e: d0 90 46 12 lds r13, 0x1246 ; 0x801246 2cc12: e0 90 47 12 lds r14, 0x1247 ; 0x801247 2cc16: f0 90 48 12 lds r15, 0x1248 ; 0x801248 2cc1a: c8 1a sub r12, r24 2cc1c: d9 0a sbc r13, r25 2cc1e: e1 08 sbc r14, r1 2cc20: f1 08 sbc r15, r1 2cc22: c0 92 45 12 sts 0x1245, r12 ; 0x801245 2cc26: d0 92 46 12 sts 0x1246, r13 ; 0x801246 2cc2a: e0 92 47 12 sts 0x1247, r14 ; 0x801247 2cc2e: f0 92 48 12 sts 0x1248, r15 ; 0x801248 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue 2cc32: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 saved_sdpos -= sdlen_cmdqueue; 2cc36: c8 1a sub r12, r24 2cc38: d9 0a sbc r13, r25 2cc3a: e1 08 sbc r14, r1 2cc3c: f1 08 sbc r15, r1 2cc3e: c0 92 45 12 sts 0x1245, r12 ; 0x801245 2cc42: d0 92 46 12 sts 0x1246, r13 ; 0x801246 2cc46: e0 92 47 12 sts 0x1247, r14 ; 0x801247 2cc4a: f0 92 48 12 sts 0x1248, r15 ; 0x801248 saved_printing_type = PowerPanic::PRINT_TYPE_SD; 2cc4e: 10 92 79 02 sts 0x0279, r1 ; 0x800279 cli(); save_print_file_state(); // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 2cc52: 80 91 72 12 lds r24, 0x1272 ; 0x801272 2cc56: f0 90 71 12 lds r15, 0x1271 ; 0x801271 2cc5a: 81 11 cpse r24, r1 2cc5c: f8 2e mov r15, r24 //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) 2cc5e: 20 91 51 12 lds r18, 0x1251 ; 0x801251 2cc62: 30 91 52 12 lds r19, 0x1252 ; 0x801252 2cc66: 21 15 cp r18, r1 2cc68: 31 05 cpc r19, r1 2cc6a: 09 f4 brne .+2 ; 0x2cc6e 2cc6c: d1 c0 rjmp .+418 ; 0x2ce10 2cc6e: 81 11 cpse r24, r1 2cc70: cf c0 rjmp .+414 ; 0x2ce10 2cc72: 80 91 71 12 lds r24, 0x1271 ; 0x801271 2cc76: 81 11 cpse r24, r1 2cc78: cb c0 rjmp .+406 ; 0x2ce10 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); 2cc7a: f9 01 movw r30, r18 2cc7c: e8 5a subi r30, 0xA8 ; 168 2cc7e: ff 4f sbci r31, 0xFF ; 255 2cc80: 80 e1 ldi r24, 0x10 ; 16 2cc82: ae e7 ldi r26, 0x7E ; 126 2cc84: b2 e0 ldi r27, 0x02 ; 2 2cc86: 01 90 ld r0, Z+ 2cc88: 0d 92 st X+, r0 2cc8a: 8a 95 dec r24 2cc8c: e1 f7 brne .-8 ; 0x2cc86 saved_feedrate2 = current_block->gcode_feedrate; 2cc8e: f9 01 movw r30, r18 2cc90: e6 59 subi r30, 0x96 ; 150 2cc92: ff 4f sbci r31, 0xFF ; 255 2cc94: 80 81 ld r24, Z 2cc96: 91 81 ldd r25, Z+1 ; 0x01 2cc98: 90 93 50 12 sts 0x1250, r25 ; 0x801250 2cc9c: 80 93 4f 12 sts 0x124F, r24 ; 0x80124f saved_segment_idx = current_block->segment_idx; 2cca0: 28 59 subi r18, 0x98 ; 152 2cca2: 3f 4f sbci r19, 0xFF ; 255 2cca4: f9 01 movw r30, r18 2cca6: 80 81 ld r24, Z 2cca8: 91 81 ldd r25, Z+1 ; 0x01 2ccaa: 90 93 4e 12 sts 0x124E, r25 ; 0x80124e 2ccae: 80 93 4d 12 sts 0x124D, r24 ; 0x80124d // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; save_planner_global_state(); planner_abort_hard(); //abort printing 2ccb2: 0f 94 84 4c call 0x29908 ; 0x29908 memcpy(saved_pos, current_position, sizeof(saved_pos)); 2ccb6: 80 e1 ldi r24, 0x10 ; 16 2ccb8: e1 e6 ldi r30, 0x61 ; 97 2ccba: f2 e1 ldi r31, 0x12 ; 18 2ccbc: a0 e9 ldi r26, 0x90 ; 144 2ccbe: b2 e0 ldi r27, 0x02 ; 2 2ccc0: 01 90 ld r0, Z+ 2ccc2: 0d 92 st X+, r0 2ccc4: 8a 95 dec r24 2ccc6: e1 f7 brne .-8 ; 0x2ccc0 if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 2ccc8: ff 20 and r15, r15 2ccca: 61 f0 breq .+24 ; 0x2cce4 2cccc: 80 e0 ldi r24, 0x00 ; 0 2ccce: 90 e0 ldi r25, 0x00 ; 0 2ccd0: a0 e8 ldi r26, 0x80 ; 128 2ccd2: bf eb ldi r27, 0xBF ; 191 2ccd4: 80 93 90 02 sts 0x0290, r24 ; 0x800290 2ccd8: 90 93 91 02 sts 0x0291, r25 ; 0x800291 2ccdc: a0 93 92 02 sts 0x0292, r26 ; 0x800292 2cce0: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_feedmultiply2 = feedmultiply; //save feedmultiply 2cce4: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 2cce8: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 2ccec: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.498+0x1> 2ccf0: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.498> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 2ccf4: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 2ccf8: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 2ccfc: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c 2cd00: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_bed_temperature = (uint8_t)degTargetBed(); 2cd04: 80 91 59 12 lds r24, 0x1259 ; 0x801259 2cd08: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 2cd0c: 80 91 57 12 lds r24, 0x1257 ; 0x801257 2cd10: 83 fb bst r24, 3 2cd12: 88 27 eor r24, r24 2cd14: 80 f9 bld r24, 0 2cd16: 80 93 56 12 sts 0x1256, r24 ; 0x801256 saved_fan_speed = fanSpeed; 2cd1a: 80 91 55 12 lds r24, 0x1255 ; 0x801255 2cd1e: 80 93 54 12 sts 0x1254, r24 ; 0x801254 cmdqueue_reset(); //empty cmdqueue 2cd22: 0e 94 34 83 call 0x10668 ; 0x10668 card.sdprinting = false; 2cd26: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 // card.closefile(); saved_printing = true; 2cd2a: 81 e0 ldi r24, 0x01 ; 1 2cd2c: 80 93 73 12 sts 0x1273, r24 ; 0x801273 // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 2cd30: 0f 94 01 19 call 0x23202 ; 0x23202 sei(); 2cd34: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 2cd36: 20 e0 ldi r18, 0x00 ; 0 2cd38: 30 e0 ldi r19, 0x00 ; 0 2cd3a: a9 01 movw r20, r18 2cd3c: f8 01 movw r30, r16 2cd3e: 6c 2f mov r22, r28 2cd40: 7d 2f mov r23, r29 2cd42: 8f 2f mov r24, r31 2cd44: 90 2f mov r25, r16 2cd46: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2cd4a: 88 23 and r24, r24 2cd4c: e1 f0 breq .+56 ; 0x2cd86 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 2cd4e: 80 91 56 12 lds r24, 0x1256 ; 0x801256 2cd52: 81 11 cpse r24, r1 2cd54: 05 c0 rjmp .+10 ; 0x2cd60 enquecommand_P(MSG_M83); 2cd56: 61 e0 ldi r22, 0x01 ; 1 2cd58: 83 eb ldi r24, 0xB3 ; 179 2cd5a: 9c e6 ldi r25, 0x6C ; 108 2cd5c: 0e 94 da 8c call 0x119b4 ; 0x119b4 // 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); 2cd60: 0f 93 push r16 2cd62: 1f 93 push r17 2cd64: df 93 push r29 2cd66: cf 93 push r28 2cd68: 83 ea ldi r24, 0xA3 ; 163 2cd6a: 9c e6 ldi r25, 0x6C ; 108 2cd6c: 9f 93 push r25 2cd6e: 8f 93 push r24 2cd70: 0e 94 a8 8d call 0x11b50 ; 0x11b50 2cd74: 81 e0 ldi r24, 0x01 ; 1 2cd76: 80 93 53 12 sts 0x1253, r24 ; 0x801253 2cd7a: 0f 90 pop r0 2cd7c: 0f 90 pop r0 2cd7e: 0f 90 pop r0 2cd80: 0f 90 pop r0 2cd82: 0f 90 pop r0 2cd84: 0f 90 pop r0 // 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(); } } 2cd86: df 91 pop r29 2cd88: cf 91 pop r28 2cd8a: 1f 91 pop r17 2cd8c: 0f 91 pop r16 2cd8e: ff 90 pop r15 2cd90: ef 90 pop r14 2cd92: df 90 pop r13 2cd94: cf 90 pop r12 2cd96: 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 2cd98: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2cd9c: 88 23 and r24, r24 2cd9e: b1 f1 breq .+108 ; 0x2ce0c saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue 2cda0: 80 91 3e 12 lds r24, 0x123E ; 0x80123e 2cda4: 90 91 3f 12 lds r25, 0x123F ; 0x80123f 2cda8: a0 91 40 12 lds r26, 0x1240 ; 0x801240 2cdac: b0 91 41 12 lds r27, 0x1241 ; 0x801241 2cdb0: 80 93 45 12 sts 0x1245, r24 ; 0x801245 2cdb4: 90 93 46 12 sts 0x1246, r25 ; 0x801246 2cdb8: a0 93 47 12 sts 0x1247, r26 ; 0x801247 2cdbc: b0 93 48 12 sts 0x1248, r27 ; 0x801248 //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 2cdc0: 0f 94 ff 39 call 0x273fe ; 0x273fe saved_sdpos -= nlines; 2cdc4: 40 91 45 12 lds r20, 0x1245 ; 0x801245 2cdc8: 50 91 46 12 lds r21, 0x1246 ; 0x801246 2cdcc: 60 91 47 12 lds r22, 0x1247 ; 0x801247 2cdd0: 70 91 48 12 lds r23, 0x1248 ; 0x801248 2cdd4: 48 1b sub r20, r24 2cdd6: 51 09 sbc r21, r1 2cdd8: 61 09 sbc r22, r1 2cdda: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer 2cddc: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 2cde0: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 2cde4: 09 2e mov r0, r25 2cde6: 00 0c add r0, r0 2cde8: aa 0b sbc r26, r26 2cdea: bb 0b sbc r27, r27 2cdec: 48 1b sub r20, r24 2cdee: 59 0b sbc r21, r25 2cdf0: 6a 0b sbc r22, r26 2cdf2: 7b 0b sbc r23, r27 2cdf4: 40 93 45 12 sts 0x1245, r20 ; 0x801245 2cdf8: 50 93 46 12 sts 0x1246, r21 ; 0x801246 2cdfc: 60 93 47 12 sts 0x1247, r22 ; 0x801247 2ce00: 70 93 48 12 sts 0x1248, r23 ; 0x801248 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; 2ce04: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; 2ce06: 80 93 79 02 sts 0x0279, r24 ; 0x800279 2ce0a: 23 cf rjmp .-442 ; 0x2cc52 2ce0c: 82 e0 ldi r24, 0x02 ; 2 2ce0e: fb cf rjmp .-10 ; 0x2ce06 saved_feedrate2 = current_block->gcode_feedrate; saved_segment_idx = current_block->segment_idx; } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; 2ce10: 80 e0 ldi r24, 0x00 ; 0 2ce12: 90 e0 ldi r25, 0x00 ; 0 2ce14: a0 e8 ldi r26, 0x80 ; 128 2ce16: bf eb ldi r27, 0xBF ; 191 2ce18: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e 2ce1c: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f 2ce20: a0 93 80 02 sts 0x0280, r26 ; 0x800280 2ce24: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_feedrate2 = feedrate; 2ce28: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 2ce2c: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 2ce30: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2ce34: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 2ce38: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 2ce3c: 70 93 50 12 sts 0x1250, r23 ; 0x801250 2ce40: 60 93 4f 12 sts 0x124F, r22 ; 0x80124f saved_segment_idx = 0; 2ce44: 10 92 4e 12 sts 0x124E, r1 ; 0x80124e 2ce48: 10 92 4d 12 sts 0x124D, r1 ; 0x80124d 2ce4c: 32 cf rjmp .-412 ; 0x2ccb2 0002ce4e : // "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) { if(Stopped == false) { 2ce4e: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2ce52: 81 11 cpse r24, r1 2ce54: 1d c0 rjmp .+58 ; 0x2ce90 Stopped = true; 2ce56: 81 e0 ldi r24, 0x01 ; 1 2ce58: 80 93 3b 12 sts 0x123B, r24 ; 0x80123b saved_extruder_temperature = ext_temp; saved_fan_speed = fan_speed; } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); 2ce5c: 61 e0 ldi r22, 0x01 ; 1 2ce5e: 80 e0 ldi r24, 0x00 ; 0 2ce60: 0e 94 ea dc call 0x1b9d4 ; 0x1b9d4 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); 2ce64: 81 eb ldi r24, 0xB1 ; 177 2ce66: 91 ea ldi r25, 0xA1 ; 161 2ce68: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); 2ce6c: 8e e6 ldi r24, 0x6E ; 110 2ce6e: 9c e6 ldi r25, 0x6C ; 108 2ce70: 0e 94 8d 7c call 0xf91a ; 0xf91a // 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)); 2ce74: 89 e8 ldi r24, 0x89 ; 137 2ce76: 92 e6 ldi r25, 0x62 ; 98 2ce78: 0e 94 0a 75 call 0xea14 ; 0xea14 2ce7c: 0e 94 85 dc call 0x1b90a ; 0x1b90a // 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); 2ce80: 72 9a sbi 0x0e, 2 ; 14 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); 2ce82: 0f 94 6d 05 call 0x20ada ; 0x20ada if(!allow_recovery) { // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); 2ce86: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2ce8a: 81 60 ori r24, 0x01 ; 1 2ce8c: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a } } } 2ce90: 08 95 ret 0002ce92 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2ce92: 0f 93 push r16 2ce94: 1f 93 push r17 2ce96: cf 93 push r28 2ce98: df 93 push r29 2ce9a: ec 01 movw r28, r24 2ce9c: 0f 94 5b a1 call 0x342b6 ; 0x342b6 <__strlen_P> 2cea0: 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) 2cea2: 80 36 cpi r24, 0x60 ; 96 2cea4: 91 05 cpc r25, r1 2cea6: 08 f0 brcs .+2 ; 0x2ceaa 2cea8: 85 c0 rjmp .+266 ; 0x2cfb4 return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2ceaa: 80 91 53 12 lds r24, 0x1253 ; 0x801253 2ceae: 81 11 cpse r24, r1 2ceb0: 05 c0 rjmp .+10 ; 0x2cebc cmdqueue_pop_front(); 2ceb2: 0e 94 13 79 call 0xf226 ; 0xf226 cmdbuffer_front_already_processed = true; 2ceb6: 81 e0 ldi r24, 0x01 ; 1 2ceb8: 80 93 53 12 sts 0x1253, r24 ; 0x801253 } if (bufindr == bufindw && buflen > 0) 2cebc: 40 91 38 12 lds r20, 0x1238 ; 0x801238 2cec0: 50 91 39 12 lds r21, 0x1239 ; 0x801239 2cec4: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.514> 2cec8: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.514+0x1> 2cecc: 48 17 cp r20, r24 2cece: 59 07 cpc r21, r25 2ced0: 41 f4 brne .+16 ; 0x2cee2 2ced2: 20 91 3c 12 lds r18, 0x123C ; 0x80123c 2ced6: 30 91 3d 12 lds r19, 0x123D ; 0x80123d 2ceda: 12 16 cp r1, r18 2cedc: 13 06 cpc r1, r19 2cede: 0c f4 brge .+2 ; 0x2cee2 2cee0: 69 c0 rjmp .+210 ; 0x2cfb4 // 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; 2cee2: 20 91 47 10 lds r18, 0x1047 ; 0x801047 2cee6: 30 91 48 10 lds r19, 0x1048 ; 0x801048 2ceea: 12 16 cp r1, r18 2ceec: 13 06 cpc r1, r19 2ceee: 0c f0 brlt .+2 ; 0x2cef2 2cef0: 41 c0 rjmp .+130 ; 0x2cf74 2cef2: 9c 01 movw r18, r24 2cef4: 2f 59 subi r18, 0x9F ; 159 2cef6: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2cef8: 84 17 cp r24, r20 2cefa: 95 07 cpc r25, r21 2cefc: e8 f5 brcc .+122 ; 0x2cf78 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2cefe: 44 50 subi r20, 0x04 ; 4 2cf00: 51 09 sbc r21, r1 2cf02: 40 1b sub r20, r16 2cf04: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2cf06: 42 17 cp r20, r18 2cf08: 53 07 cpc r21, r19 2cf0a: 0c f4 brge .+2 ; 0x2cf0e 2cf0c: 53 c0 rjmp .+166 ; 0x2cfb4 } } 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); 2cf0e: 50 93 39 12 sts 0x1239, r21 ; 0x801239 2cf12: 40 93 38 12 sts 0x1238, r20 ; 0x801238 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; 2cf16: 80 91 38 12 lds r24, 0x1238 ; 0x801238 2cf1a: 90 91 39 12 lds r25, 0x1239 ; 0x801239 2cf1e: fc 01 movw r30, r24 2cf20: e5 5b subi r30, 0xB5 ; 181 2cf22: ff 4e sbci r31, 0xEF ; 239 2cf24: 23 e0 ldi r18, 0x03 ; 3 2cf26: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2cf28: be 01 movw r22, r28 2cf2a: 82 5b subi r24, 0xB2 ; 178 2cf2c: 9f 4e sbci r25, 0xEF ; 239 2cf2e: 0f 94 54 a1 call 0x342a8 ; 0x342a8 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2cf32: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 2cf36: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 2cf3a: 01 96 adiw r24, 0x01 ; 1 2cf3c: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 2cf40: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c SERIAL_ECHO_START; 2cf44: 8e ec ldi r24, 0xCE ; 206 2cf46: 91 ea ldi r25, 0xA1 ; 161 2cf48: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(enqueingFront); 2cf4c: 88 e9 ldi r24, 0x98 ; 152 2cf4e: 91 ea ldi r25, 0xA1 ; 161 2cf50: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2cf54: 80 91 38 12 lds r24, 0x1238 ; 0x801238 2cf58: 90 91 39 12 lds r25, 0x1239 ; 0x801239 2cf5c: 82 5b subi r24, 0xB2 ; 178 2cf5e: 9f 4e sbci r25, 0xEF ; 239 2cf60: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_ECHOLNPGM("\""); 2cf64: 86 e9 ldi r24, 0x96 ; 150 2cf66: 91 ea ldi r25, 0xA1 ; 161 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2cf68: df 91 pop r29 2cf6a: cf 91 pop r28 2cf6c: 1f 91 pop r17 2cf6e: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2cf70: 0c 94 8d 7c jmp 0xf91a ; 0xf91a // 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) 2cf74: 9c 01 movw r18, r24 2cf76: c0 cf rjmp .-128 ; 0x2cef8 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2cf78: c8 01 movw r24, r16 2cf7a: 04 96 adiw r24, 0x04 ; 4 2cf7c: 48 17 cp r20, r24 2cf7e: 59 07 cpc r21, r25 2cf80: 28 f0 brcs .+10 ; 0x2cf8c // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2cf82: 44 50 subi r20, 0x04 ; 4 2cf84: 51 09 sbc r21, r1 2cf86: 40 1b sub r20, r16 2cf88: 51 0b sbc r21, r17 2cf8a: c1 cf rjmp .-126 ; 0x2cf0e return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2cf8c: 89 ee ldi r24, 0xE9 ; 233 2cf8e: 91 e0 ldi r25, 0x01 ; 1 2cf90: bc 01 movw r22, r24 2cf92: 60 1b sub r22, r16 2cf94: 71 0b sbc r23, r17 2cf96: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2cf98: 62 17 cp r22, r18 2cf9a: 73 07 cpc r23, r19 2cf9c: 5c f0 brlt .+22 ; 0x2cfb4 memset(cmdbuffer, 0, bufindr); 2cf9e: 70 e0 ldi r23, 0x00 ; 0 2cfa0: 60 e0 ldi r22, 0x00 ; 0 2cfa2: 8b e4 ldi r24, 0x4B ; 75 2cfa4: 90 e1 ldi r25, 0x10 ; 16 2cfa6: 0f 94 cf a9 call 0x3539e ; 0x3539e bufindr = bufindr_new; 2cfaa: 10 93 39 12 sts 0x1239, r17 ; 0x801239 2cfae: 00 93 38 12 sts 0x1238, r16 ; 0x801238 2cfb2: b1 cf rjmp .-158 ; 0x2cf16 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2cfb4: 81 eb ldi r24, 0xB1 ; 177 2cfb6: 91 ea ldi r25, 0xA1 ; 161 2cfb8: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(enqueingFront); 2cfbc: 88 e9 ldi r24, 0x98 ; 152 2cfbe: 91 ea ldi r25, 0xA1 ; 161 2cfc0: 0e 94 94 7a call 0xf528 ; 0xf528 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2cfc4: ce 01 movw r24, r28 2cfc6: 0e 94 94 7a call 0xf528 ; 0xf528 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2cfca: 8f e7 ldi r24, 0x7F ; 127 2cfcc: 91 ea ldi r25, 0xA1 ; 161 2cfce: cc cf rjmp .-104 ; 0x2cf68 0002cfd0 : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2cfd0: ab 01 movw r20, r22 2cfd2: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2cfd4: 87 e6 ldi r24, 0x67 ; 103 2cfd6: 96 e1 ldi r25, 0x16 ; 22 2cfd8: 0f 94 94 2a call 0x25528 ; 0x25528 2cfdc: 81 11 cpse r24, r1 2cfde: 02 c0 rjmp .+4 ; 0x2cfe4 2cfe0: 80 e0 ldi r24, 0x00 ; 0 2cfe2: 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() ) 2cfe4: 87 e6 ldi r24, 0x67 ; 103 2cfe6: 96 e1 ldi r25, 0x16 ; 22 2cfe8: 0f 94 1b 2a call 0x25436 ; 0x25436 2cfec: 88 23 and r24, r24 2cfee: c1 f3 breq .-16 ; 0x2cfe0 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; 2cff0: 20 91 88 16 lds r18, 0x1688 ; 0x801688 2cff4: 30 91 89 16 lds r19, 0x1689 ; 0x801689 2cff8: 2a 5b subi r18, 0xBA ; 186 2cffa: 31 4f sbci r19, 0xF1 ; 241 2cffc: 30 93 83 16 sts 0x1683, r19 ; 0x801683 2d000: 20 93 82 16 sts 0x1682, r18 ; 0x801682 bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2d004: 08 95 ret 0002d006 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2d006: 8f 92 push r8 2d008: 9f 92 push r9 2d00a: af 92 push r10 2d00c: bf 92 push r11 2d00e: cf 92 push r12 2d010: df 92 push r13 2d012: ef 92 push r14 2d014: ff 92 push r15 2d016: 0f 93 push r16 2d018: 1f 93 push r17 2d01a: cf 93 push r28 2d01c: df 93 push r29 2d01e: cd b7 in r28, 0x3d ; 61 2d020: de b7 in r29, 0x3e ; 62 2d022: ee 97 sbiw r28, 0x3e ; 62 2d024: 0f b6 in r0, 0x3f ; 63 2d026: f8 94 cli 2d028: de bf out 0x3e, r29 ; 62 2d02a: 0f be out 0x3f, r0 ; 63 2d02c: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2d02e: 80 91 25 14 lds r24, 0x1425 ; 0x801425 2d032: 8f 93 push r24 2d034: 80 91 24 14 lds r24, 0x1424 ; 0x801424 2d038: 8f 93 push r24 2d03a: 8a e3 ldi r24, 0x3A ; 58 2d03c: 91 ea ldi r25, 0xA1 ; 161 2d03e: 9f 93 push r25 2d040: 8f 93 push r24 2d042: 8e 01 movw r16, r28 2d044: 0f 5d subi r16, 0xDF ; 223 2d046: 1f 4f sbci r17, 0xFF ; 255 2d048: 1f 93 push r17 2d04a: 0f 93 push r16 2d04c: 0f 94 b4 a2 call 0x34568 ; 0x34568 2d050: 0f 90 pop r0 2d052: 0f 90 pop r0 2d054: 0f 90 pop r0 2d056: 0f 90 pop r0 2d058: 0f 90 pop r0 2d05a: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2d05c: f1 2c mov r15, r1 2d05e: f8 01 movw r30, r16 2d060: 01 90 ld r0, Z+ 2d062: 00 20 and r0, r0 2d064: e9 f7 brne .-6 ; 0x2d060 2d066: 31 97 sbiw r30, 0x01 ; 1 2d068: e0 1b sub r30, r16 2d06a: f1 0b sbc r31, r17 2d06c: fe 16 cp r15, r30 2d06e: 84 f4 brge .+32 ; 0x2d090 autoname[i]=tolower(autoname[i]); 2d070: 68 01 movw r12, r16 2d072: cf 0c add r12, r15 2d074: d1 1c adc r13, r1 2d076: f7 fc sbrc r15, 7 2d078: da 94 dec r13 2d07a: f6 01 movw r30, r12 2d07c: 80 81 ld r24, Z 2d07e: 08 2e mov r0, r24 2d080: 00 0c add r0, r0 2d082: 99 0b sbc r25, r25 2d084: 0f 94 b1 a9 call 0x35362 ; 0x35362 2d088: f6 01 movw r30, r12 2d08a: 80 83 st Z, r24 2d08c: f3 94 inc r15 2d08e: e7 cf rjmp .-50 ; 0x2d05e dir_t p; root.rewind(); 2d090: 8d e5 ldi r24, 0x5D ; 93 2d092: 94 e1 ldi r25, 0x14 ; 20 2d094: 0e 94 76 79 call 0xf2ec ; 0xf2ec bool found=false; 2d098: a1 2c mov r10, r1 2d09a: ce 01 movw r24, r28 2d09c: 01 96 adiw r24, 0x01 ; 1 2d09e: 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); 2d0a0: 87 e6 ldi r24, 0x67 ; 103 2d0a2: c8 2e mov r12, r24 2d0a4: 8c e6 ldi r24, 0x6C ; 108 2d0a6: 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; 2d0a8: 80 91 60 14 lds r24, 0x1460 ; 0x801460 2d0ac: 82 30 cpi r24, 0x02 ; 2 2d0ae: 08 f4 brcc .+2 ; 0x2d0b2 2d0b0: 50 c0 rjmp .+160 ; 0x2d152 2d0b2: 80 91 65 14 lds r24, 0x1465 ; 0x801465 2d0b6: 90 91 66 14 lds r25, 0x1466 ; 0x801466 2d0ba: a0 91 67 14 lds r26, 0x1467 ; 0x801467 2d0be: b0 91 68 14 lds r27, 0x1468 ; 0x801468 2d0c2: 8f 71 andi r24, 0x1F ; 31 2d0c4: 99 27 eor r25, r25 2d0c6: aa 27 eor r26, r26 2d0c8: bb 27 eor r27, r27 2d0ca: 89 2b or r24, r25 2d0cc: 8a 2b or r24, r26 2d0ce: 8b 2b or r24, r27 2d0d0: 09 f0 breq .+2 ; 0x2d0d4 2d0d2: 3f c0 rjmp .+126 ; 0x2d152 2d0d4: 50 e0 ldi r21, 0x00 ; 0 2d0d6: 40 e0 ldi r20, 0x00 ; 0 2d0d8: b7 01 movw r22, r14 2d0da: 8d e5 ldi r24, 0x5D ; 93 2d0dc: 94 e1 ldi r25, 0x14 ; 20 2d0de: 0f 94 d1 2d call 0x25ba2 ; 0x25ba2 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2d0e2: 18 16 cp r1, r24 2d0e4: b4 f5 brge .+108 ; 0x2d152 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2d0e6: b1 2c mov r11, r1 2d0e8: f7 01 movw r30, r14 2d0ea: 01 90 ld r0, Z+ 2d0ec: 00 20 and r0, r0 2d0ee: e9 f7 brne .-6 ; 0x2d0ea 2d0f0: 31 97 sbiw r30, 0x01 ; 1 2d0f2: ee 19 sub r30, r14 2d0f4: ff 09 sbc r31, r15 2d0f6: be 16 cp r11, r30 2d0f8: 74 f4 brge .+28 ; 0x2d116 p.name[i]=tolower(p.name[i]); 2d0fa: 47 01 movw r8, r14 2d0fc: 8b 0c add r8, r11 2d0fe: 91 1c adc r9, r1 2d100: b7 fc sbrc r11, 7 2d102: 9a 94 dec r9 2d104: f4 01 movw r30, r8 2d106: 80 81 ld r24, Z 2d108: 90 e0 ldi r25, 0x00 ; 0 2d10a: 0f 94 b1 a9 call 0x35362 ; 0x35362 2d10e: f4 01 movw r30, r8 2d110: 80 83 st Z, r24 2d112: b3 94 inc r11 2d114: e9 cf rjmp .-46 ; 0x2d0e8 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2d116: 8a 85 ldd r24, Y+10 ; 0x0a 2d118: 8e 37 cpi r24, 0x7E ; 126 2d11a: 31 f2 breq .-116 ; 0x2d0a8 if(strncmp((char*)p.name,autoname,5)==0) 2d11c: 45 e0 ldi r20, 0x05 ; 5 2d11e: 50 e0 ldi r21, 0x00 ; 0 2d120: b8 01 movw r22, r16 2d122: c7 01 movw r24, r14 2d124: 0f 94 0f aa call 0x3541e ; 0x3541e 2d128: 89 2b or r24, r25 2d12a: 09 f0 breq .+2 ; 0x2d12e 2d12c: bd cf rjmp .-134 ; 0x2d0a8 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2d12e: 1f 93 push r17 2d130: 0f 93 push r16 2d132: df 92 push r13 2d134: cf 92 push r12 2d136: 0e 94 a8 8d call 0x11b50 ; 0x11b50 // M24: Start/resume SD print enquecommand_P(MSG_M24); 2d13a: 61 e0 ldi r22, 0x01 ; 1 2d13c: 83 e6 ldi r24, 0x63 ; 99 2d13e: 9c e6 ldi r25, 0x6C ; 108 2d140: 0e 94 da 8c call 0x119b4 ; 0x119b4 2d144: 0f 90 pop r0 2d146: 0f 90 pop r0 2d148: 0f 90 pop r0 2d14a: 0f 90 pop r0 found=true; 2d14c: aa 24 eor r10, r10 2d14e: a3 94 inc r10 2d150: ab cf rjmp .-170 ; 0x2d0a8 } } if(!found) lastnr=-1; 2d152: 8f ef ldi r24, 0xFF ; 255 2d154: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2d156: aa 20 and r10, r10 2d158: 29 f0 breq .+10 ; 0x2d164 lastnr=-1; else lastnr++; 2d15a: 80 91 24 14 lds r24, 0x1424 ; 0x801424 2d15e: 90 91 25 14 lds r25, 0x1425 ; 0x801425 2d162: 01 96 adiw r24, 0x01 ; 1 2d164: 90 93 25 14 sts 0x1425, r25 ; 0x801425 2d168: 80 93 24 14 sts 0x1424, r24 ; 0x801424 } 2d16c: ee 96 adiw r28, 0x3e ; 62 2d16e: 0f b6 in r0, 0x3f ; 63 2d170: f8 94 cli 2d172: de bf out 0x3e, r29 ; 62 2d174: 0f be out 0x3f, r0 ; 63 2d176: cd bf out 0x3d, r28 ; 61 2d178: df 91 pop r29 2d17a: cf 91 pop r28 2d17c: 1f 91 pop r17 2d17e: 0f 91 pop r16 2d180: ff 90 pop r15 2d182: ef 90 pop r14 2d184: df 90 pop r13 2d186: cf 90 pop r12 2d188: bf 90 pop r11 2d18a: af 90 pop r10 2d18c: 9f 90 pop r9 2d18e: 8f 90 pop r8 2d190: 08 95 ret 0002d192 : * \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) { 2d192: 8f 92 push r8 2d194: 9f 92 push r9 2d196: af 92 push r10 2d198: bf 92 push r11 2d19a: cf 92 push r12 2d19c: df 92 push r13 2d19e: ef 92 push r14 2d1a0: ff 92 push r15 2d1a2: 0f 93 push r16 2d1a4: 1f 93 push r17 2d1a6: cf 93 push r28 2d1a8: df 93 push r29 2d1aa: 00 d0 rcall .+0 ; 0x2d1ac 2d1ac: 1f 92 push r1 2d1ae: cd b7 in r28, 0x3d ; 61 2d1b0: de b7 in r29, 0x3e ; 62 2d1b2: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2d1b4: 83 81 ldd r24, Z+3 ; 0x03 2d1b6: 81 30 cpi r24, 0x01 ; 1 2d1b8: 11 f0 breq .+4 ; 0x2d1be // set file to correct position return seekSet(newPos); fail: return false; 2d1ba: 80 e0 ldi r24, 0x00 ; 0 2d1bc: 60 c0 rjmp .+192 ; 0x2d27e * \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; 2d1be: 81 81 ldd r24, Z+1 ; 0x01 2d1c0: 81 ff sbrs r24, 1 2d1c2: fb cf rjmp .-10 ; 0x2d1ba // 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; 2d1c4: 81 89 ldd r24, Z+17 ; 0x11 2d1c6: 92 89 ldd r25, Z+18 ; 0x12 2d1c8: a3 89 ldd r26, Z+19 ; 0x13 2d1ca: b4 89 ldd r27, Z+20 ; 0x14 2d1cc: 89 2b or r24, r25 2d1ce: 8a 2b or r24, r26 2d1d0: 8b 2b or r24, r27 2d1d2: 09 f4 brne .+2 ; 0x2d1d6 2d1d4: 6e c0 rjmp .+220 ; 0x2d2b2 2d1d6: 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; 2d1d8: 40 e0 ldi r20, 0x00 ; 0 2d1da: 50 e0 ldi r21, 0x00 ; 0 2d1dc: ba 01 movw r22, r20 2d1de: cf 01 movw r24, r30 2d1e0: 0f 94 94 2a call 0x25528 ; 0x25528 2d1e4: 88 23 and r24, r24 2d1e6: 49 f3 breq .-46 ; 0x2d1ba if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2d1e8: f7 01 movw r30, r14 2d1ea: c1 8c ldd r12, Z+25 ; 0x19 2d1ec: d2 8c ldd r13, Z+26 ; 0x1a 2d1ee: 85 88 ldd r8, Z+21 ; 0x15 2d1f0: 96 88 ldd r9, Z+22 ; 0x16 2d1f2: a7 88 ldd r10, Z+23 ; 0x17 2d1f4: 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; 2d1f6: 82 e0 ldi r24, 0x02 ; 2 2d1f8: 90 e0 ldi r25, 0x00 ; 0 2d1fa: a0 e0 ldi r26, 0x00 ; 0 2d1fc: b0 e0 ldi r27, 0x00 ; 0 2d1fe: f6 01 movw r30, r12 2d200: 80 83 st Z, r24 2d202: 91 83 std Z+1, r25 ; 0x01 2d204: a2 83 std Z+2, r26 ; 0x02 2d206: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2d208: 9e 01 movw r18, r28 2d20a: 2f 5f subi r18, 0xFF ; 255 2d20c: 3f 4f sbci r19, 0xFF ; 255 2d20e: b5 01 movw r22, r10 2d210: a4 01 movw r20, r8 2d212: c6 01 movw r24, r12 2d214: 0f 94 de 28 call 0x251bc ; 0x251bc 2d218: 88 23 and r24, r24 2d21a: 79 f2 breq .-98 ; 0x2d1ba // free cluster if (!fatPut(cluster, 0)) goto fail; 2d21c: 00 e0 ldi r16, 0x00 ; 0 2d21e: 10 e0 ldi r17, 0x00 ; 0 2d220: 98 01 movw r18, r16 2d222: b5 01 movw r22, r10 2d224: a4 01 movw r20, r8 2d226: c6 01 movw r24, r12 2d228: 0f 94 4c 28 call 0x25098 ; 0x25098 2d22c: 88 23 and r24, r24 2d22e: 29 f2 breq .-118 ; 0x2d1ba cluster = next; 2d230: 89 80 ldd r8, Y+1 ; 0x01 2d232: 9a 80 ldd r9, Y+2 ; 0x02 2d234: ab 80 ldd r10, Y+3 ; 0x03 2d236: 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; 2d238: f6 01 movw r30, r12 2d23a: 87 89 ldd r24, Z+23 ; 0x17 2d23c: 80 31 cpi r24, 0x10 ; 16 2d23e: 81 f5 brne .+96 ; 0x2d2a0 2d240: f8 ef ldi r31, 0xF8 ; 248 2d242: 8f 16 cp r8, r31 2d244: ff ef ldi r31, 0xFF ; 255 2d246: 9f 06 cpc r9, r31 2d248: a1 04 cpc r10, r1 2d24a: b1 04 cpc r11, r1 2d24c: e8 f2 brcs .-70 ; 0x2d208 firstCluster_ = 0; 2d24e: f7 01 movw r30, r14 2d250: 15 8a std Z+21, r1 ; 0x15 2d252: 16 8a std Z+22, r1 ; 0x16 2d254: 17 8a std Z+23, r1 ; 0x17 2d256: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2d258: 11 8a std Z+17, r1 ; 0x11 2d25a: 12 8a std Z+18, r1 ; 0x12 2d25c: 13 8a std Z+19, r1 ; 0x13 2d25e: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2d260: 81 81 ldd r24, Z+1 ; 0x01 2d262: 80 68 ori r24, 0x80 ; 128 2d264: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2d266: c7 01 movw r24, r14 2d268: 0f 94 3d 2c call 0x2587a ; 0x2587a 2d26c: 88 23 and r24, r24 2d26e: 09 f4 brne .+2 ; 0x2d272 2d270: a4 cf rjmp .-184 ; 0x2d1ba // set file to correct position return seekSet(newPos); 2d272: 40 e0 ldi r20, 0x00 ; 0 2d274: 50 e0 ldi r21, 0x00 ; 0 2d276: ba 01 movw r22, r20 2d278: c7 01 movw r24, r14 2d27a: 0f 94 94 2a call 0x25528 ; 0x25528 fail: return false; } 2d27e: 0f 90 pop r0 2d280: 0f 90 pop r0 2d282: 0f 90 pop r0 2d284: 0f 90 pop r0 2d286: df 91 pop r29 2d288: cf 91 pop r28 2d28a: 1f 91 pop r17 2d28c: 0f 91 pop r16 2d28e: ff 90 pop r15 2d290: ef 90 pop r14 2d292: df 90 pop r13 2d294: cf 90 pop r12 2d296: bf 90 pop r11 2d298: af 90 pop r10 2d29a: 9f 90 pop r9 2d29c: 8f 90 pop r8 2d29e: 08 95 ret return cluster >= FAT32EOC_MIN; 2d2a0: 88 ef ldi r24, 0xF8 ; 248 2d2a2: 88 16 cp r8, r24 2d2a4: 8f ef ldi r24, 0xFF ; 255 2d2a6: 98 06 cpc r9, r24 2d2a8: a8 06 cpc r10, r24 2d2aa: 8f e0 ldi r24, 0x0F ; 15 2d2ac: b8 06 cpc r11, r24 2d2ae: 78 f6 brcc .-98 ; 0x2d24e 2d2b0: ab cf rjmp .-170 ; 0x2d208 // 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; 2d2b2: 81 e0 ldi r24, 0x01 ; 1 2d2b4: e4 cf rjmp .-56 ; 0x2d27e 0002d2b6 : +* 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) { 2d2b6: 2f 92 push r2 2d2b8: 3f 92 push r3 2d2ba: 4f 92 push r4 2d2bc: 5f 92 push r5 2d2be: 6f 92 push r6 2d2c0: 7f 92 push r7 2d2c2: 8f 92 push r8 2d2c4: 9f 92 push r9 2d2c6: af 92 push r10 2d2c8: bf 92 push r11 2d2ca: cf 92 push r12 2d2cc: df 92 push r13 2d2ce: ef 92 push r14 2d2d0: ff 92 push r15 2d2d2: 0f 93 push r16 2d2d4: 1f 93 push r17 2d2d6: cf 93 push r28 2d2d8: df 93 push r29 2d2da: cd b7 in r28, 0x3d ; 61 2d2dc: de b7 in r29, 0x3e ; 62 2d2de: c6 57 subi r28, 0x76 ; 118 2d2e0: d1 09 sbc r29, r1 2d2e2: 0f b6 in r0, 0x3f ; 63 2d2e4: f8 94 cli 2d2e6: de bf out 0x3e, r29 ; 62 2d2e8: 0f be out 0x3f, r0 ; 63 2d2ea: cd bf out 0x3d, r28 ; 61 2d2ec: 4c 01 movw r8, r24 2d2ee: 6b 01 movw r12, r22 2d2f0: 3a 01 movw r6, r20 2d2f2: e5 96 adiw r28, 0x35 ; 53 2d2f4: 2f af std Y+63, r18 ; 0x3f 2d2f6: e5 97 sbiw r28, 0x35 ; 53 2d2f8: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2d2fa: 2d b6 in r2, 0x3d ; 61 2d2fc: 3e b6 in r3, 0x3e ; 62 2d2fe: 10 2f mov r17, r16 2d300: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2d302: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d306: 8f 5f subi r24, 0xFF ; 255 2d308: 80 93 45 0e sts 0x0E45, r24 ; 0x800e45 } 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()) { 2d30c: fb 01 movw r30, r22 2d30e: 80 85 ldd r24, Z+8 ; 0x08 2d310: 91 85 ldd r25, Z+9 ; 0x09 2d312: a2 85 ldd r26, Z+10 ; 0x0a 2d314: b3 85 ldd r27, Z+11 ; 0x0b 2d316: 80 93 ea 13 sts 0x13EA, r24 ; 0x8013ea 2d31a: 90 93 eb 13 sts 0x13EB, r25 ; 0x8013eb 2d31e: a0 93 ec 13 sts 0x13EC, r26 ; 0x8013ec 2d322: b0 93 ed 13 sts 0x13ED, r27 ; 0x8013ed _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2d326: 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); 2d328: 5e 01 movw r10, r28 2d32a: f7 e6 ldi r31, 0x67 ; 103 2d32c: af 0e add r10, r31 2d32e: 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; 2d330: f6 01 movw r30, r12 2d332: 83 81 ldd r24, Z+3 ; 0x03 2d334: 82 30 cpi r24, 0x02 ; 2 2d336: 08 f4 brcc .+2 ; 0x2d33a 2d338: c0 c1 rjmp .+896 ; 0x2d6ba 2d33a: 80 85 ldd r24, Z+8 ; 0x08 2d33c: 91 85 ldd r25, Z+9 ; 0x09 2d33e: a2 85 ldd r26, Z+10 ; 0x0a 2d340: b3 85 ldd r27, Z+11 ; 0x0b 2d342: 8f 71 andi r24, 0x1F ; 31 2d344: 99 27 eor r25, r25 2d346: aa 27 eor r26, r26 2d348: bb 27 eor r27, r27 2d34a: 89 2b or r24, r25 2d34c: 8a 2b or r24, r26 2d34e: 8b 2b or r24, r27 2d350: 09 f0 breq .+2 ; 0x2d354 2d352: b3 c1 rjmp .+870 ; 0x2d6ba //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'; 2d354: 10 92 ee 13 sts 0x13EE, r1 ; 0x8013ee 2d358: 4e ee ldi r20, 0xEE ; 238 2d35a: 53 e1 ldi r21, 0x13 ; 19 2d35c: be 01 movw r22, r28 2d35e: 69 5b subi r22, 0xB9 ; 185 2d360: 7f 4f sbci r23, 0xFF ; 255 2d362: c6 01 movw r24, r12 2d364: 0f 94 d1 2d call 0x25ba2 ; 0x25ba2 } 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()) { 2d368: 18 16 cp r1, r24 2d36a: 0c f0 brlt .+2 ; 0x2d36e 2d36c: a6 c1 rjmp .+844 ; 0x2d6ba if (recursionCnt > MAX_DIR_DEPTH) 2d36e: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d372: 87 30 cpi r24, 0x07 ; 7 2d374: 08 f0 brcs .+2 ; 0x2d378 2d376: a1 c1 rjmp .+834 ; 0x2d6ba return; uint8_t pn0 = p.name[0]; 2d378: 28 96 adiw r28, 0x08 ; 8 2d37a: 8f ad ldd r24, Y+63 ; 0x3f 2d37c: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2d37e: 88 23 and r24, r24 2d380: 09 f4 brne .+2 ; 0x2d384 2d382: 9b c1 rjmp .+822 ; 0x2d6ba if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2d384: 85 3e cpi r24, 0xE5 ; 229 2d386: 09 f4 brne .+2 ; 0x2d38a 2d388: 39 c1 rjmp .+626 ; 0x2d5fc 2d38a: 8e 32 cpi r24, 0x2E ; 46 2d38c: 09 f4 brne .+2 ; 0x2d390 2d38e: 36 c1 rjmp .+620 ; 0x2d5fc if (longFilename[0] == '.') continue; 2d390: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d394: 8e 32 cpi r24, 0x2E ; 46 2d396: 09 f4 brne .+2 ; 0x2d39a 2d398: 31 c1 rjmp .+610 ; 0x2d5fc 2d39a: 63 96 adiw r28, 0x13 ; 19 2d39c: 8f ad ldd r24, Y+63 ; 0x3f 2d39e: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2d3a0: 98 2f mov r25, r24 2d3a2: 9a 70 andi r25, 0x0A ; 10 2d3a4: 09 f0 breq .+2 ; 0x2d3a8 2d3a6: 2a c1 rjmp .+596 ; 0x2d5fc 2d3a8: 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; 2d3aa: 91 e0 ldi r25, 0x01 ; 1 2d3ac: 80 31 cpi r24, 0x10 ; 16 2d3ae: 19 f0 breq .+6 ; 0x2d3b6 2d3b0: 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 2d3b2: 80 31 cpi r24, 0x10 ; 16 2d3b4: 31 f4 brne .+12 ; 0x2d3c2 2d3b6: e5 96 adiw r28, 0x35 ; 53 2d3b8: ff ad ldd r31, Y+63 ; 0x3f 2d3ba: e5 97 sbiw r28, 0x35 ; 53 2d3bc: ff 23 and r31, r31 2d3be: 09 f4 brne .+2 ; 0x2d3c2 2d3c0: 94 c0 rjmp .+296 ; 0x2d4ea if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2d3c2: 90 93 23 14 sts 0x1423, r25 ; 0x801423 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2d3c6: 80 31 cpi r24, 0x10 ; 16 2d3c8: 61 f0 breq .+24 ; 0x2d3e2 2d3ca: 60 96 adiw r28, 0x10 ; 16 2d3cc: 8f ad ldd r24, Y+63 ; 0x3f 2d3ce: 60 97 sbiw r28, 0x10 ; 16 2d3d0: 87 34 cpi r24, 0x47 ; 71 2d3d2: 09 f0 breq .+2 ; 0x2d3d6 2d3d4: 13 c1 rjmp .+550 ; 0x2d5fc 2d3d6: 61 96 adiw r28, 0x11 ; 17 2d3d8: 8f ad ldd r24, Y+63 ; 0x3f 2d3da: 61 97 sbiw r28, 0x11 ; 17 2d3dc: 8e 37 cpi r24, 0x7E ; 126 2d3de: 09 f4 brne .+2 ; 0x2d3e2 2d3e0: 0d c1 rjmp .+538 ; 0x2d5fc switch (lsAction) { 2d3e2: e5 96 adiw r28, 0x35 ; 53 2d3e4: ff ad ldd r31, Y+63 ; 0x3f 2d3e6: e5 97 sbiw r28, 0x35 ; 53 2d3e8: f1 30 cpi r31, 0x01 ; 1 2d3ea: 09 f4 brne .+2 ; 0x2d3ee 2d3ec: 1b c1 rjmp .+566 ; 0x2d624 2d3ee: f2 30 cpi r31, 0x02 ; 2 2d3f0: 09 f4 brne .+2 ; 0x2d3f4 2d3f2: 25 c1 rjmp .+586 ; 0x2d63e case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2d3f4: be 01 movw r22, r28 2d3f6: 69 5b subi r22, 0xB9 ; 185 2d3f8: 7f 4f sbci r23, 0xFF ; 255 2d3fa: 89 ed ldi r24, 0xD9 ; 217 2d3fc: 93 e1 ldi r25, 0x13 ; 19 2d3fe: 0e 94 60 79 call 0xf2c0 ; 0xf2c0 2d402: c4 01 movw r24, r8 2d404: 0e 94 86 85 call 0x10b0c ; 0x10b0c 2d408: 89 ed ldi r24, 0xD9 ; 217 2d40a: 93 e1 ldi r25, 0x13 ; 19 2d40c: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2d410: 80 e2 ldi r24, 0x20 ; 32 2d412: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2d416: a7 96 adiw r28, 0x27 ; 39 2d418: 6c ad ldd r22, Y+60 ; 0x3c 2d41a: 7d ad ldd r23, Y+61 ; 0x3d 2d41c: 8e ad ldd r24, Y+62 ; 0x3e 2d41e: 9f ad ldd r25, Y+63 ; 0x3f 2d420: a7 97 sbiw r28, 0x27 ; 39 2d422: 4a e0 ldi r20, 0x0A ; 10 2d424: 0e 94 95 79 call 0xf32a ; 0xf32a SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2d428: 51 fe sbrs r5, 1 2d42a: 45 c0 rjmp .+138 ; 0x2d4b6 { crmodDate = p.lastWriteDate; 2d42c: a1 96 adiw r28, 0x21 ; 33 2d42e: 2e ad ldd r18, Y+62 ; 0x3e 2d430: 3f ad ldd r19, Y+63 ; 0x3f 2d432: a1 97 sbiw r28, 0x21 ; 33 2d434: 30 93 e9 13 sts 0x13E9, r19 ; 0x8013e9 2d438: 20 93 e8 13 sts 0x13E8, r18 ; 0x8013e8 crmodTime = p.lastWriteTime; 2d43c: 6f 96 adiw r28, 0x1f ; 31 2d43e: 4e ad ldd r20, Y+62 ; 0x3e 2d440: 5f ad ldd r21, Y+63 ; 0x3f 2d442: 6f 97 sbiw r28, 0x1f ; 31 2d444: 50 93 e7 13 sts 0x13E7, r21 ; 0x8013e7 2d448: 40 93 e6 13 sts 0x13E6, r20 ; 0x8013e6 if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2d44c: 69 96 adiw r28, 0x19 ; 25 2d44e: 8e ad ldd r24, Y+62 ; 0x3e 2d450: 9f ad ldd r25, Y+63 ; 0x3f 2d452: 69 97 sbiw r28, 0x19 ; 25 2d454: 28 17 cp r18, r24 2d456: 39 07 cpc r19, r25 2d458: 50 f0 brcs .+20 ; 0x2d46e 2d45a: 28 17 cp r18, r24 2d45c: 39 07 cpc r19, r25 2d45e: 99 f4 brne .+38 ; 0x2d486 2d460: 67 96 adiw r28, 0x17 ; 23 2d462: 2e ad ldd r18, Y+62 ; 0x3e 2d464: 3f ad ldd r19, Y+63 ; 0x3f 2d466: 67 97 sbiw r28, 0x17 ; 23 2d468: 42 17 cp r20, r18 2d46a: 53 07 cpc r21, r19 2d46c: 60 f4 brcc .+24 ; 0x2d486 crmodDate = p.creationDate; 2d46e: 90 93 e9 13 sts 0x13E9, r25 ; 0x8013e9 2d472: 80 93 e8 13 sts 0x13E8, r24 ; 0x8013e8 crmodTime = p.creationTime; 2d476: 67 96 adiw r28, 0x17 ; 23 2d478: 8e ad ldd r24, Y+62 ; 0x3e 2d47a: 9f ad ldd r25, Y+63 ; 0x3f 2d47c: 67 97 sbiw r28, 0x17 ; 23 2d47e: 90 93 e7 13 sts 0x13E7, r25 ; 0x8013e7 2d482: 80 93 e6 13 sts 0x13E6, r24 ; 0x8013e6 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2d486: 80 91 e9 13 lds r24, 0x13E9 ; 0x8013e9 2d48a: 8f 93 push r24 2d48c: 80 91 e8 13 lds r24, 0x13E8 ; 0x8013e8 2d490: 8f 93 push r24 2d492: 80 91 e7 13 lds r24, 0x13E7 ; 0x8013e7 2d496: 8f 93 push r24 2d498: 80 91 e6 13 lds r24, 0x13E6 ; 0x8013e6 2d49c: 8f 93 push r24 2d49e: 27 e1 ldi r18, 0x17 ; 23 2d4a0: 31 ea ldi r19, 0xA1 ; 161 2d4a2: 3f 93 push r19 2d4a4: 2f 93 push r18 2d4a6: 0f 94 5f a2 call 0x344be ; 0x344be 2d4aa: 0f 90 pop r0 2d4ac: 0f 90 pop r0 2d4ae: 0f 90 pop r0 2d4b0: 0f 90 pop r0 2d4b2: 0f 90 pop r0 2d4b4: 0f 90 pop r0 } if (lsParams.LFN) 2d4b6: 11 23 and r17, r17 2d4b8: 99 f0 breq .+38 ; 0x2d4e0 printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2d4ba: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d4be: 88 23 and r24, r24 2d4c0: 09 f4 brne .+2 ; 0x2d4c4 2d4c2: ba c0 rjmp .+372 ; 0x2d638 2d4c4: 8e ee ldi r24, 0xEE ; 238 2d4c6: 93 e1 ldi r25, 0x13 ; 19 2d4c8: 9f 93 push r25 2d4ca: 8f 93 push r24 2d4cc: e1 e1 ldi r30, 0x11 ; 17 2d4ce: f1 ea ldi r31, 0xA1 ; 161 2d4d0: ff 93 push r31 2d4d2: ef 93 push r30 2d4d4: 0f 94 5f a2 call 0x344be ; 0x344be 2d4d8: 0f 90 pop r0 2d4da: 0f 90 pop r0 2d4dc: 0f 90 pop r0 2d4de: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2d4e0: 0e 94 8c 7a call 0xf518 ; 0xf518 manage_heater(); 2d4e4: 0f 94 a5 37 call 0x26f4a ; 0x26f4a 2d4e8: 89 c0 rjmp .+274 ; 0x2d5fc } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2d4ea: 2d b7 in r18, 0x3d ; 61 2d4ec: 3e b7 in r19, 0x3e ; 62 2d4ee: e7 96 adiw r28, 0x37 ; 55 2d4f0: 3f af std Y+63, r19 ; 0x3f 2d4f2: 2e af std Y+62, r18 ; 0x3e 2d4f4: 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); 2d4f6: be 01 movw r22, r28 2d4f8: 69 5b subi r22, 0xB9 ; 185 2d4fa: 7f 4f sbci r23, 0xFF ; 255 2d4fc: c5 01 movw r24, r10 2d4fe: 0e 94 60 79 call 0xf2c0 ; 0xf2c0 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2d502: f4 01 movw r30, r8 2d504: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2d506: 88 23 and r24, r24 2d508: 09 f4 brne .+2 ; 0x2d50c 2d50a: 86 c0 rjmp .+268 ; 0x2d618 2d50c: 01 90 ld r0, Z+ 2d50e: 00 20 and r0, r0 2d510: e9 f7 brne .-6 ; 0x2d50c 2d512: 31 97 sbiw r30, 0x01 ; 1 2d514: e8 19 sub r30, r8 2d516: f9 09 sbc r31, r9 2d518: d5 01 movw r26, r10 2d51a: 0d 90 ld r0, X+ 2d51c: 00 20 and r0, r0 2d51e: e9 f7 brne .-6 ; 0x2d51a 2d520: ea 19 sub r30, r10 2d522: fb 09 sbc r31, r11 char path[len]; 2d524: ea 0f add r30, r26 2d526: fb 1f adc r31, r27 2d528: 31 96 adiw r30, 0x01 ; 1 2d52a: 2d b7 in r18, 0x3d ; 61 2d52c: 3e b7 in r19, 0x3e ; 62 2d52e: 2e 1b sub r18, r30 2d530: 3f 0b sbc r19, r31 2d532: 0f b6 in r0, 0x3f ; 63 2d534: f8 94 cli 2d536: 3e bf out 0x3e, r19 ; 62 2d538: 0f be out 0x3f, r0 ; 63 2d53a: 2d bf out 0x3d, r18 ; 61 2d53c: ed b7 in r30, 0x3d ; 61 2d53e: fe b7 in r31, 0x3e ; 62 2d540: 31 96 adiw r30, 0x01 ; 1 2d542: 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 2d544: 60 ef ldi r22, 0xF0 ; 240 2d546: 72 e0 ldi r23, 0x02 ; 2 2d548: 81 11 cpse r24, r1 2d54a: b4 01 movw r22, r8 2d54c: c7 01 movw r24, r14 2d54e: 0f 94 08 aa call 0x35410 ; 0x35410 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2d552: b5 01 movw r22, r10 2d554: c7 01 movw r24, r14 2d556: 0f 94 e9 a9 call 0x353d2 ; 0x353d2 strcat(path, "/"); // 1 character 2d55a: 60 ef ldi r22, 0xF0 ; 240 2d55c: 72 e0 ldi r23, 0x02 ; 2 2d55e: c7 01 movw r24, r14 2d560: 0f 94 e9 a9 call 0x353d2 ; 0x353d2 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2d564: 11 23 and r17, r17 2d566: a9 f0 breq .+42 ; 0x2d592 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2d568: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d56c: 81 11 cpse r24, r1 2d56e: 57 c0 rjmp .+174 ; 0x2d61e 2d570: c5 01 movw r24, r10 2d572: 9f 93 push r25 2d574: 8f 93 push r24 2d576: ff 92 push r15 2d578: ef 92 push r14 2d57a: 26 e2 ldi r18, 0x26 ; 38 2d57c: 31 ea ldi r19, 0xA1 ; 161 2d57e: 3f 93 push r19 2d580: 2f 93 push r18 2d582: 0f 94 5f a2 call 0x344be ; 0x344be 2d586: 0f 90 pop r0 2d588: 0f 90 pop r0 2d58a: 0f 90 pop r0 2d58c: 0f 90 pop r0 2d58e: 0f 90 pop r0 2d590: 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) {} 2d592: 1c a2 std Y+36, r1 ; 0x24 2d594: 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); 2d596: 21 e0 ldi r18, 0x01 ; 1 2d598: a5 01 movw r20, r10 2d59a: b6 01 movw r22, r12 2d59c: ce 01 movw r24, r28 2d59e: 84 96 adiw r24, 0x24 ; 36 2d5a0: 0f 94 9d 54 call 0x2a93a ; 0x2a93a 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); 2d5a4: 83 e2 ldi r24, 0x23 ; 35 2d5a6: fe 01 movw r30, r28 2d5a8: b4 96 adiw r30, 0x24 ; 36 2d5aa: de 01 movw r26, r28 2d5ac: 11 96 adiw r26, 0x01 ; 1 2d5ae: 01 90 ld r0, Z+ 2d5b0: 0d 92 st X+, r0 2d5b2: 8a 95 dec r24 2d5b4: e1 f7 brne .-8 ; 0x2d5ae 2d5b6: 10 fb bst r17, 0 2d5b8: 50 f8 bld r5, 0 2d5ba: 05 2d mov r16, r5 2d5bc: 20 e0 ldi r18, 0x00 ; 0 2d5be: 50 e0 ldi r21, 0x00 ; 0 2d5c0: 40 e0 ldi r20, 0x00 ; 0 2d5c2: be 01 movw r22, r28 2d5c4: 6f 5f subi r22, 0xFF ; 255 2d5c6: 7f 4f sbci r23, 0xFF ; 255 2d5c8: c7 01 movw r24, r14 2d5ca: 0f 94 5b 69 call 0x2d2b6 ; 0x2d2b6 2d5ce: ce 01 movw r24, r28 2d5d0: 01 96 adiw r24, 0x01 ; 1 2d5d2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2d5d6: 11 23 and r17, r17 2d5d8: 21 f0 breq .+8 ; 0x2d5e2 puts_P(PSTR("DIR_EXIT")); 2d5da: 8d e1 ldi r24, 0x1D ; 29 2d5dc: 91 ea ldi r25, 0xA1 ; 161 2d5de: 0f 94 86 a2 call 0x3450c ; 0x3450c 2d5e2: ce 01 movw r24, r28 2d5e4: 84 96 adiw r24, 0x24 ; 36 2d5e6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 2d5ea: e7 96 adiw r28, 0x37 ; 55 2d5ec: ee ad ldd r30, Y+62 ; 0x3e 2d5ee: ff ad ldd r31, Y+63 ; 0x3f 2d5f0: e7 97 sbiw r28, 0x37 ; 55 2d5f2: 0f b6 in r0, 0x3f ; 63 2d5f4: f8 94 cli 2d5f6: fe bf out 0x3e, r31 ; 62 2d5f8: 0f be out 0x3f, r0 ; 63 2d5fa: 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()) { 2d5fc: f6 01 movw r30, r12 2d5fe: 80 85 ldd r24, Z+8 ; 0x08 2d600: 91 85 ldd r25, Z+9 ; 0x09 2d602: a2 85 ldd r26, Z+10 ; 0x0a 2d604: b3 85 ldd r27, Z+11 ; 0x0b 2d606: 80 93 ea 13 sts 0x13EA, r24 ; 0x8013ea 2d60a: 90 93 eb 13 sts 0x13EB, r25 ; 0x8013eb 2d60e: a0 93 ec 13 sts 0x13EC, r26 ; 0x8013ec 2d612: b0 93 ed 13 sts 0x13ED, r27 ; 0x8013ed 2d616: 8c ce rjmp .-744 ; 0x2d330 // 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; 2d618: e1 e0 ldi r30, 0x01 ; 1 2d61a: f0 e0 ldi r31, 0x00 ; 0 2d61c: 7d cf rjmp .-262 ; 0x2d518 // 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); 2d61e: 8e ee ldi r24, 0xEE ; 238 2d620: 93 e1 ldi r25, 0x13 ; 19 2d622: a7 cf rjmp .-178 ; 0x2d572 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2d624: 80 91 ef 16 lds r24, 0x16EF ; 0x8016ef 2d628: 90 91 f0 16 lds r25, 0x16F0 ; 0x8016f0 2d62c: 01 96 adiw r24, 0x01 ; 1 2d62e: 90 93 f0 16 sts 0x16F0, r25 ; 0x8016f0 2d632: 80 93 ef 16 sts 0x16EF, r24 ; 0x8016ef 2d636: e2 cf rjmp .-60 ; 0x2d5fc } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2d638: 89 ed ldi r24, 0xD9 ; 217 2d63a: 93 e1 ldi r25, 0x13 ; 19 2d63c: 45 cf rjmp .-374 ; 0x2d4c8 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2d63e: be 01 movw r22, r28 2d640: 69 5b subi r22, 0xB9 ; 185 2d642: 7f 4f sbci r23, 0xFF ; 255 2d644: 89 ed ldi r24, 0xD9 ; 217 2d646: 93 e1 ldi r25, 0x13 ; 19 2d648: 0e 94 60 79 call 0xf2c0 ; 0xf2c0 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2d64c: a1 96 adiw r28, 0x21 ; 33 2d64e: 2e ad ldd r18, Y+62 ; 0x3e 2d650: 3f ad ldd r19, Y+63 ; 0x3f 2d652: a1 97 sbiw r28, 0x21 ; 33 2d654: 30 93 e9 13 sts 0x13E9, r19 ; 0x8013e9 2d658: 20 93 e8 13 sts 0x13E8, r18 ; 0x8013e8 crmodTime = p.lastWriteTime; 2d65c: 6f 96 adiw r28, 0x1f ; 31 2d65e: 4e ad ldd r20, Y+62 ; 0x3e 2d660: 5f ad ldd r21, Y+63 ; 0x3f 2d662: 6f 97 sbiw r28, 0x1f ; 31 2d664: 50 93 e7 13 sts 0x13E7, r21 ; 0x8013e7 2d668: 40 93 e6 13 sts 0x13E6, r20 ; 0x8013e6 // 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 ) ){ 2d66c: 69 96 adiw r28, 0x19 ; 25 2d66e: 8e ad ldd r24, Y+62 ; 0x3e 2d670: 9f ad ldd r25, Y+63 ; 0x3f 2d672: 69 97 sbiw r28, 0x19 ; 25 2d674: 28 17 cp r18, r24 2d676: 39 07 cpc r19, r25 2d678: 50 f0 brcs .+20 ; 0x2d68e 2d67a: 28 17 cp r18, r24 2d67c: 39 07 cpc r19, r25 2d67e: 99 f4 brne .+38 ; 0x2d6a6 2d680: 67 96 adiw r28, 0x17 ; 23 2d682: 2e ad ldd r18, Y+62 ; 0x3e 2d684: 3f ad ldd r19, Y+63 ; 0x3f 2d686: 67 97 sbiw r28, 0x17 ; 23 2d688: 42 17 cp r20, r18 2d68a: 53 07 cpc r21, r19 2d68c: 60 f4 brcc .+24 ; 0x2d6a6 crmodDate = p.creationDate; 2d68e: 90 93 e9 13 sts 0x13E9, r25 ; 0x8013e9 2d692: 80 93 e8 13 sts 0x13E8, r24 ; 0x8013e8 crmodTime = p.creationTime; 2d696: 67 96 adiw r28, 0x17 ; 23 2d698: 8e ad ldd r24, Y+62 ; 0x3e 2d69a: 9f ad ldd r25, Y+63 ; 0x3f 2d69c: 67 97 sbiw r28, 0x17 ; 23 2d69e: 90 93 e7 13 sts 0x13E7, r25 ; 0x8013e7 2d6a2: 80 93 e6 13 sts 0x13E6, r24 ; 0x8013e6 } //writeDate = p.lastAccessDate; if (match != NULL) { 2d6a6: 61 14 cp r6, r1 2d6a8: 71 04 cpc r7, r1 2d6aa: 59 f1 breq .+86 ; 0x2d702 if (strcasecmp(match, filename) == 0) return; 2d6ac: 69 ed ldi r22, 0xD9 ; 217 2d6ae: 73 e1 ldi r23, 0x13 ; 19 2d6b0: c3 01 movw r24, r6 2d6b2: 0f 94 d6 a9 call 0x353ac ; 0x353ac 2d6b6: 89 2b or r24, r25 2d6b8: 59 f5 brne .+86 ; 0x2d710 // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2d6ba: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d6be: 81 50 subi r24, 0x01 ; 1 2d6c0: 80 93 45 0e sts 0x0E45, r24 ; 0x800e45 cnt++; break; } } } // while readDir } 2d6c4: 0f b6 in r0, 0x3f ; 63 2d6c6: f8 94 cli 2d6c8: 3e be out 0x3e, r3 ; 62 2d6ca: 0f be out 0x3f, r0 ; 63 2d6cc: 2d be out 0x3d, r2 ; 61 2d6ce: ca 58 subi r28, 0x8A ; 138 2d6d0: df 4f sbci r29, 0xFF ; 255 2d6d2: 0f b6 in r0, 0x3f ; 63 2d6d4: f8 94 cli 2d6d6: de bf out 0x3e, r29 ; 62 2d6d8: 0f be out 0x3f, r0 ; 63 2d6da: cd bf out 0x3d, r28 ; 61 2d6dc: df 91 pop r29 2d6de: cf 91 pop r28 2d6e0: 1f 91 pop r17 2d6e2: 0f 91 pop r16 2d6e4: ff 90 pop r15 2d6e6: ef 90 pop r14 2d6e8: df 90 pop r13 2d6ea: cf 90 pop r12 2d6ec: bf 90 pop r11 2d6ee: af 90 pop r10 2d6f0: 9f 90 pop r9 2d6f2: 8f 90 pop r8 2d6f4: 7f 90 pop r7 2d6f6: 6f 90 pop r6 2d6f8: 5f 90 pop r5 2d6fa: 4f 90 pop r4 2d6fc: 3f 90 pop r3 2d6fe: 2f 90 pop r2 2d700: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2d702: 80 91 ef 16 lds r24, 0x16EF ; 0x8016ef 2d706: 90 91 f0 16 lds r25, 0x16F0 ; 0x8016f0 2d70a: 48 16 cp r4, r24 2d70c: 19 06 cpc r1, r25 2d70e: a9 f2 breq .-86 ; 0x2d6ba cnt++; 2d710: 43 94 inc r4 2d712: 74 cf rjmp .-280 ; 0x2d5fc 0002d714 : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2d714: cf 92 push r12 2d716: df 92 push r13 2d718: ef 92 push r14 2d71a: ff 92 push r15 2d71c: 0f 93 push r16 2d71e: cf 93 push r28 2d720: df 93 push r29 2d722: cd b7 in r28, 0x3d ; 61 2d724: de b7 in r29, 0x3e ; 62 2d726: a3 97 sbiw r28, 0x23 ; 35 2d728: 0f b6 in r0, 0x3f ; 63 2d72a: f8 94 cli 2d72c: de bf out 0x3e, r29 ; 62 2d72e: 0f be out 0x3f, r0 ; 63 2d730: cd bf out 0x3d, r28 ; 61 2d732: 6c 01 movw r12, r24 { curDir=&workDir; 2d734: 80 e8 ldi r24, 0x80 ; 128 2d736: e8 2e mov r14, r24 2d738: 84 e1 ldi r24, 0x14 ; 20 2d73a: f8 2e mov r15, r24 2d73c: 82 e8 ldi r24, 0x82 ; 130 2d73e: 94 e1 ldi r25, 0x14 ; 20 2d740: d7 01 movw r26, r14 2d742: 8d 93 st X+, r24 2d744: 9c 93 st X, r25 nrFiles=nr; 2d746: 10 92 f0 16 sts 0x16F0, r1 ; 0x8016f0 2d74a: 10 92 ef 16 sts 0x16EF, r1 ; 0x8016ef curDir->rewind(); 2d74e: 0e 94 76 79 call 0xf2ec ; 0xf2ec }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2d752: 00 e0 ldi r16, 0x00 ; 0 2d754: 0e 7f andi r16, 0xFE ; 254 2d756: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2d758: d7 01 movw r26, r14 2d75a: ed 91 ld r30, X+ 2d75c: fc 91 ld r31, X 2d75e: 83 e2 ldi r24, 0x23 ; 35 2d760: de 01 movw r26, r28 2d762: 11 96 adiw r26, 0x01 ; 1 2d764: 01 90 ld r0, Z+ 2d766: 0d 92 st X+, r0 2d768: 8a 95 dec r24 2d76a: e1 f7 brne .-8 ; 0x2d764 2d76c: 22 e0 ldi r18, 0x02 ; 2 2d76e: a6 01 movw r20, r12 2d770: be 01 movw r22, r28 2d772: 6f 5f subi r22, 0xFF ; 255 2d774: 7f 4f sbci r23, 0xFF ; 255 2d776: 8f ed ldi r24, 0xDF ; 223 2d778: 92 e0 ldi r25, 0x02 ; 2 2d77a: 0f 94 5b 69 call 0x2d2b6 ; 0x2d2b6 2d77e: ce 01 movw r24, r28 2d780: 01 96 adiw r24, 0x01 ; 1 2d782: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } 2d786: a3 96 adiw r28, 0x23 ; 35 2d788: 0f b6 in r0, 0x3f ; 63 2d78a: f8 94 cli 2d78c: de bf out 0x3e, r29 ; 62 2d78e: 0f be out 0x3f, r0 ; 63 2d790: cd bf out 0x3d, r28 ; 61 2d792: df 91 pop r29 2d794: cf 91 pop r28 2d796: 0f 91 pop r16 2d798: ff 90 pop r15 2d79a: ef 90 pop r14 2d79c: df 90 pop r13 2d79e: cf 90 pop r12 2d7a0: 08 95 ret 0002d7a2 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2d7a2: ef 92 push r14 2d7a4: ff 92 push r15 2d7a6: 0f 93 push r16 2d7a8: cf 93 push r28 2d7aa: df 93 push r29 2d7ac: cd b7 in r28, 0x3d ; 61 2d7ae: de b7 in r29, 0x3e ; 62 2d7b0: a3 97 sbiw r28, 0x23 ; 35 2d7b2: 0f b6 in r0, 0x3f ; 63 2d7b4: f8 94 cli 2d7b6: de bf out 0x3e, r29 ; 62 2d7b8: 0f be out 0x3f, r0 ; 63 2d7ba: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2d7bc: 20 e8 ldi r18, 0x80 ; 128 2d7be: e2 2e mov r14, r18 2d7c0: 24 e1 ldi r18, 0x14 ; 20 2d7c2: f2 2e mov r15, r18 2d7c4: 22 e8 ldi r18, 0x82 ; 130 2d7c6: 34 e1 ldi r19, 0x14 ; 20 2d7c8: d7 01 movw r26, r14 2d7ca: 2d 93 st X+, r18 2d7cc: 3c 93 st X, r19 nrFiles = 0; 2d7ce: 10 92 f0 16 sts 0x16F0, r1 ; 0x8016f0 2d7d2: 10 92 ef 16 sts 0x16EF, r1 ; 0x8016ef curDir->seekSet((uint32_t)entry << 5); 2d7d6: b0 e0 ldi r27, 0x00 ; 0 2d7d8: a0 e0 ldi r26, 0x00 ; 0 2d7da: ac 01 movw r20, r24 2d7dc: bd 01 movw r22, r26 2d7de: e5 e0 ldi r30, 0x05 ; 5 2d7e0: 44 0f add r20, r20 2d7e2: 55 1f adc r21, r21 2d7e4: 66 1f adc r22, r22 2d7e6: 77 1f adc r23, r23 2d7e8: ea 95 dec r30 2d7ea: d1 f7 brne .-12 ; 0x2d7e0 2d7ec: c9 01 movw r24, r18 2d7ee: 0f 94 94 2a call 0x25528 ; 0x25528 2d7f2: 00 e0 ldi r16, 0x00 ; 0 2d7f4: 0e 7f andi r16, 0xFE ; 254 2d7f6: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2d7f8: d7 01 movw r26, r14 2d7fa: ed 91 ld r30, X+ 2d7fc: fc 91 ld r31, X 2d7fe: 83 e2 ldi r24, 0x23 ; 35 2d800: de 01 movw r26, r28 2d802: 11 96 adiw r26, 0x01 ; 1 2d804: 01 90 ld r0, Z+ 2d806: 0d 92 st X+, r0 2d808: 8a 95 dec r24 2d80a: e1 f7 brne .-8 ; 0x2d804 2d80c: 22 e0 ldi r18, 0x02 ; 2 2d80e: 50 e0 ldi r21, 0x00 ; 0 2d810: 40 e0 ldi r20, 0x00 ; 0 2d812: be 01 movw r22, r28 2d814: 6f 5f subi r22, 0xFF ; 255 2d816: 7f 4f sbci r23, 0xFF ; 255 2d818: 8f ed ldi r24, 0xDF ; 223 2d81a: 92 e0 ldi r25, 0x02 ; 2 2d81c: 0f 94 5b 69 call 0x2d2b6 ; 0x2d2b6 2d820: ce 01 movw r24, r28 2d822: 01 96 adiw r24, 0x01 ; 1 2d824: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } 2d828: a3 96 adiw r28, 0x23 ; 35 2d82a: 0f b6 in r0, 0x3f ; 63 2d82c: f8 94 cli 2d82e: de bf out 0x3e, r29 ; 62 2d830: 0f be out 0x3f, r0 ; 63 2d832: cd bf out 0x3d, r28 ; 61 2d834: df 91 pop r29 2d836: cf 91 pop r28 2d838: 0f 91 pop r16 2d83a: ff 90 pop r15 2d83c: ef 90 pop r14 2d83e: 08 95 ret 0002d840 : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2d840: cf 92 push r12 2d842: df 92 push r13 2d844: ef 92 push r14 2d846: ff 92 push r15 2d848: 0f 93 push r16 2d84a: cf 93 push r28 2d84c: df 93 push r29 2d84e: cd b7 in r28, 0x3d ; 61 2d850: de b7 in r29, 0x3e ; 62 2d852: a3 97 sbiw r28, 0x23 ; 35 2d854: 0f b6 in r0, 0x3f ; 63 2d856: f8 94 cli 2d858: de bf out 0x3e, r29 ; 62 2d85a: 0f be out 0x3f, r0 ; 63 2d85c: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2d85e: 80 e8 ldi r24, 0x80 ; 128 2d860: c8 2e mov r12, r24 2d862: 84 e1 ldi r24, 0x14 ; 20 2d864: d8 2e mov r13, r24 2d866: 82 e8 ldi r24, 0x82 ; 130 2d868: 94 e1 ldi r25, 0x14 ; 20 2d86a: d6 01 movw r26, r12 2d86c: 8d 93 st X+, r24 2d86e: 9c 93 st X, r25 nrFiles=0; 2d870: 2f ee ldi r18, 0xEF ; 239 2d872: e2 2e mov r14, r18 2d874: 26 e1 ldi r18, 0x16 ; 22 2d876: f2 2e mov r15, r18 2d878: f7 01 movw r30, r14 2d87a: 11 82 std Z+1, r1 ; 0x01 2d87c: 10 82 st Z, r1 curDir->rewind(); 2d87e: 0e 94 76 79 call 0xf2ec ; 0xf2ec 2d882: 00 e0 ldi r16, 0x00 ; 0 2d884: 0e 7f andi r16, 0xFE ; 254 2d886: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2d888: d6 01 movw r26, r12 2d88a: ed 91 ld r30, X+ 2d88c: fc 91 ld r31, X 2d88e: 83 e2 ldi r24, 0x23 ; 35 2d890: de 01 movw r26, r28 2d892: 11 96 adiw r26, 0x01 ; 1 2d894: 01 90 ld r0, Z+ 2d896: 0d 92 st X+, r0 2d898: 8a 95 dec r24 2d89a: e1 f7 brne .-8 ; 0x2d894 2d89c: 21 e0 ldi r18, 0x01 ; 1 2d89e: 50 e0 ldi r21, 0x00 ; 0 2d8a0: 40 e0 ldi r20, 0x00 ; 0 2d8a2: be 01 movw r22, r28 2d8a4: 6f 5f subi r22, 0xFF ; 255 2d8a6: 7f 4f sbci r23, 0xFF ; 255 2d8a8: 8f ed ldi r24, 0xDF ; 223 2d8aa: 92 e0 ldi r25, 0x02 ; 2 2d8ac: 0f 94 5b 69 call 0x2d2b6 ; 0x2d2b6 2d8b0: ce 01 movw r24, r28 2d8b2: 01 96 adiw r24, 0x01 ; 1 2d8b4: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2d8b8: f7 01 movw r30, r14 2d8ba: 80 81 ld r24, Z 2d8bc: 91 81 ldd r25, Z+1 ; 0x01 2d8be: a3 96 adiw r28, 0x23 ; 35 2d8c0: 0f b6 in r0, 0x3f ; 63 2d8c2: f8 94 cli 2d8c4: de bf out 0x3e, r29 ; 62 2d8c6: 0f be out 0x3f, r0 ; 63 2d8c8: cd bf out 0x3d, r28 ; 61 2d8ca: df 91 pop r29 2d8cc: cf 91 pop r28 2d8ce: 0f 91 pop r16 2d8d0: ff 90 pop r15 2d8d2: ef 90 pop r14 2d8d4: df 90 pop r13 2d8d6: cf 90 pop r12 2d8d8: 08 95 ret 0002d8da : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2d8da: cf 93 push r28 2d8dc: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2d8de: 8f e2 ldi r24, 0x2F ; 47 2d8e0: 0e 94 81 79 call 0xf302 ; 0xf302 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d8e4: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2d8e6: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d8e8: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2d8ec: c8 17 cp r28, r24 2d8ee: 60 f4 brcc .+24 ; 0x2d908 { SERIAL_PROTOCOL(dir_names[i]); 2d8f0: cd 9f mul r28, r29 2d8f2: c0 01 movw r24, r0 2d8f4: 11 24 eor r1, r1 2d8f6: 89 5d subi r24, 0xD9 ; 217 2d8f8: 9b 4e sbci r25, 0xEB ; 235 2d8fa: 0e 94 86 85 call 0x10b0c ; 0x10b0c 2d8fe: 8f e2 ldi r24, 0x2F ; 47 2d900: 0e 94 81 79 call 0xf302 ; 0xf302 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d904: cf 5f subi r28, 0xFF ; 255 2d906: f0 cf rjmp .-32 ; 0x2d8e8 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2d908: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d90c: 81 11 cpse r24, r1 2d90e: 06 c0 rjmp .+12 ; 0x2d91c 2d910: 89 ed ldi r24, 0xD9 ; 217 2d912: 93 e1 ldi r25, 0x13 ; 19 } 2d914: df 91 pop r29 2d916: cf 91 pop r28 2d918: 0c 94 86 85 jmp 0x10b0c ; 0x10b0c for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2d91c: 8e ee ldi r24, 0xEE ; 238 2d91e: 93 e1 ldi r25, 0x13 ; 19 2d920: f9 cf rjmp .-14 ; 0x2d914 0002d922 : 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) { 2d922: cf 92 push r12 2d924: df 92 push r13 2d926: ef 92 push r14 2d928: ff 92 push r15 2d92a: 6b 01 movw r12, r22 2d92c: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2d92e: 88 ea ldi r24, 0xA8 ; 168 2d930: 9c e0 ldi r25, 0x0C ; 12 2d932: 0f 94 a5 a3 call 0x3474a ; 0x3474a 2d936: ab 01 movw r20, r22 2d938: bc 01 movw r22, r24 2d93a: 4c 0d add r20, r12 2d93c: 5d 1d adc r21, r13 2d93e: 6e 1d adc r22, r14 2d940: 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); 2d942: 88 ea ldi r24, 0xA8 ; 168 2d944: 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); } 2d946: ff 90 pop r15 2d948: ef 90 pop r14 2d94a: df 90 pop r13 2d94c: 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); 2d94e: 0d 94 f3 a3 jmp 0x347e6 ; 0x347e6 0002d952 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2d952: cf 93 push r28 2d954: df 93 push r29 2d956: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2d958: 0f 94 a5 a3 call 0x3474a ; 0x3474a if (val == EEPROM_EMPTY_VALUE32) { 2d95c: 6f 3f cpi r22, 0xFF ; 255 2d95e: 2f ef ldi r18, 0xFF ; 255 2d960: 72 07 cpc r23, r18 2d962: 82 07 cpc r24, r18 2d964: 92 07 cpc r25, r18 2d966: 49 f4 brne .+18 ; 0x2d97a 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); 2d968: 40 e0 ldi r20, 0x00 ; 0 2d96a: 50 e0 ldi r21, 0x00 ; 0 2d96c: ba 01 movw r22, r20 2d96e: ce 01 movw r24, r28 2d970: 0f 94 f3 a3 call 0x347e6 ; 0x347e6 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; 2d974: 60 e0 ldi r22, 0x00 ; 0 2d976: 70 e0 ldi r23, 0x00 ; 0 2d978: cb 01 movw r24, r22 } return val; } 2d97a: df 91 pop r29 2d97c: cf 91 pop r28 2d97e: 08 95 ret 0002d980 : : "z" (startP) /* input of the ASM code - in our case the Z register as well (R30:R31) */ \ : "r22" /* modifying register R22 - so that the compiler knows */ \ ) // avoid calling the default heavy-weight read() for just one byte int16_t SdFile::readFilteredGcode(){ 2d980: 0f 93 push r16 2d982: 1f 93 push r17 2d984: cf 93 push r28 2d986: df 93 push r29 if( ! gfEnsureBlock() ){ 2d988: 0f 94 a0 5a call 0x2b540 ; 0x2b540 2d98c: 88 23 and r24, r24 2d98e: 39 f1 breq .+78 ; 0x2d9de 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; 2d990: 20 91 82 16 lds r18, 0x1682 ; 0x801682 2d994: 30 91 83 16 lds r19, 0x1683 ; 0x801683 // 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; 2d998: e9 01 movw r28, 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; 2d99a: 1b ef ldi r17, 0xFB ; 251 // the same applies to gfXBegin, codesize dropped another 100B! const uint8_t *blockBuffBegin = gfBlockBuffBegin(); uint8_t consecutiveCommentLines = 0; while( *rdPtr == ';' ){ 2d99c: 88 81 ld r24, Y 2d99e: 8b 33 cpi r24, 0x3B ; 59 2d9a0: 51 f5 brne .+84 ; 0x2d9f6 // 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); 2d9a2: fe 01 movw r30, r28 0002d9a4 : 2d9a4: 61 91 ld r22, Z+ 2d9a6: 6a 30 cpi r22, 0x0A ; 10 2d9a8: e9 f7 brne .-6 ; 0x2d9a4 2d9aa: ef 01 movw r28, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 2d9ac: cf 01 movw r24, r30 2d9ae: 86 54 subi r24, 0x46 ; 70 2d9b0: 9e 40 sbci r25, 0x0E ; 14 2d9b2: 81 30 cpi r24, 0x01 ; 1 2d9b4: 92 40 sbci r25, 0x02 ; 2 2d9b6: e4 f0 brlt .+56 ; 0x2d9f0 // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 2d9b8: ce 01 movw r24, r28 2d9ba: 82 1b sub r24, r18 2d9bc: 93 0b sbc r25, r19 2d9be: 01 97 sbiw r24, 0x01 ; 1 2d9c0: 0f 94 7c 55 call 0x2aaf8 ; 0x2aaf8 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2d9c4: 87 e6 ldi r24, 0x67 ; 103 2d9c6: 96 e1 ldi r25, 0x16 ; 22 2d9c8: 0f 94 1b 2a call 0x25436 ; 0x25436 2d9cc: 88 23 and r24, r24 2d9ce: 39 f0 breq .+14 ; 0x2d9de if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 2d9d0: 0f 94 a0 5a call 0x2b540 ; 0x2b540 rdPtr = start = blockBuffBegin; 2d9d4: 26 e4 ldi r18, 0x46 ; 70 2d9d6: 3e e0 ldi r19, 0x0E ; 14 2d9d8: e9 01 movw r28, 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 2d9da: 81 11 cpse r24, r1 2d9dc: e2 cf rjmp .-60 ; 0x2d9a2 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 2d9de: 86 e4 ldi r24, 0x46 ; 70 2d9e0: 90 e1 ldi r25, 0x10 ; 16 2d9e2: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2d9e6: 80 93 82 16 sts 0x1682, r24 ; 0x801682 return -1; 2d9ea: cf ef ldi r28, 0xFF ; 255 2d9ec: df ef ldi r29, 0xFF ; 255 2d9ee: 34 c0 rjmp .+104 ; 0x2da58 2d9f0: 11 50 subi r17, 0x01 ; 1 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){ 2d9f2: c1 f5 brne .+112 ; 0x2da64 // 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 2d9f4: 21 97 sbiw r28, 0x01 ; 1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 2d9f6: ce 01 movw r24, r28 2d9f8: 82 1b sub r24, r18 2d9fa: 93 0b sbc r25, r19 2d9fc: 01 96 adiw r24, 0x01 ; 1 2d9fe: 0f 94 7c 55 call 0x2aaf8 ; 0x2aaf8 int16_t rv = *rdPtr++; 2da02: ce 01 movw r24, r28 2da04: 01 96 adiw r24, 0x01 ; 1 2da06: c8 81 ld r28, Y 2da08: d0 e0 ldi r29, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 2da0a: 00 91 6f 16 lds r16, 0x166F ; 0x80166f 2da0e: 10 91 70 16 lds r17, 0x1670 ; 0x801670 2da12: 20 91 71 16 lds r18, 0x1671 ; 0x801671 2da16: 30 91 72 16 lds r19, 0x1672 ; 0x801672 2da1a: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2da1e: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2da22: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2da26: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2da2a: 04 17 cp r16, r20 2da2c: 15 07 cpc r17, r21 2da2e: 26 07 cpc r18, r22 2da30: 37 07 cpc r19, r23 2da32: a8 f6 brcc .-86 ; 0x2d9de // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 2da34: 9c 01 movw r18, r24 2da36: 26 54 subi r18, 0x46 ; 70 2da38: 3e 40 sbci r19, 0x0E ; 14 2da3a: 21 15 cp r18, r1 2da3c: 32 40 sbci r19, 0x02 ; 2 2da3e: 44 f0 brlt .+16 ; 0x2da50 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2da40: 87 e6 ldi r24, 0x67 ; 103 2da42: 96 e1 ldi r25, 0x16 ; 22 2da44: 0f 94 1b 2a call 0x25436 ; 0x25436 2da48: 88 23 and r24, r24 2da4a: 49 f2 breq .-110 ; 0x2d9de // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 2da4c: 86 e4 ldi r24, 0x46 ; 70 2da4e: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 2da50: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2da54: 80 93 82 16 sts 0x1682, r24 ; 0x801682 eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } 2da58: ce 01 movw r24, r28 2da5a: df 91 pop r29 2da5c: cf 91 pop r28 2da5e: 1f 91 pop r17 2da60: 0f 91 pop r16 2da62: 08 95 ret 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 == ';' ){ 2da64: 88 81 ld r24, Y 2da66: 8b 33 cpi r24, 0x3B ; 59 2da68: 09 f4 brne .+2 ; 0x2da6c 2da6a: 98 cf rjmp .-208 ; 0x2d99c 2da6c: c3 cf rjmp .-122 ; 0x2d9f4 0002da6e : ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } return ret; } void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } 2da6e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2da70: f8 94 cli 2da72: 10 92 03 17 sts 0x1703, r1 ; 0x801703 2da76: 10 92 02 17 sts 0x1702, r1 ; 0x801702 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2da7a: 8f bf out 0x3f, r24 ; 63 } 2da7c: 08 95 ret 0002da7e : 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); 2da7e: 87 e6 ldi r24, 0x67 ; 103 2da80: 9f e0 ldi r25, 0x0F ; 15 2da82: 0f 94 9d a3 call 0x3473a ; 0x3473a 2da86: 91 e0 ldi r25, 0x01 ; 1 2da88: 81 11 cpse r24, r1 2da8a: 01 c0 rjmp .+2 ; 0x2da8e 2da8c: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { 2da8e: 81 e0 ldi r24, 0x01 ; 1 2da90: 20 91 f1 16 lds r18, 0x16F1 ; 0x8016f1 2da94: 21 11 cpse r18, r1 2da96: 01 c0 rjmp .+2 ; 0x2da9a 2da98: 80 e0 ldi r24, 0x00 ; 0 2da9a: 98 13 cpse r25, r24 state = enabled ? State::initializing : State::disabled; 2da9c: 90 93 f1 16 sts 0x16F1, r25 ; 0x8016f1 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); 2daa0: 87 e0 ldi r24, 0x07 ; 7 2daa2: 9f e0 ldi r25, 0x0F ; 15 2daa4: 0f 94 9d a3 call 0x3473a ; 0x3473a 2daa8: 91 e0 ldi r25, 0x01 ; 1 2daaa: 81 11 cpse r24, r1 2daac: 01 c0 rjmp .+2 ; 0x2dab0 2daae: 90 e0 ldi r25, 0x00 ; 0 2dab0: 90 93 f2 16 sts 0x16F2, r25 ; 0x8016f2 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); 2dab4: 85 ed ldi r24, 0xD5 ; 213 2dab6: 9e e0 ldi r25, 0x0E ; 14 2dab8: 0f 94 9d a3 call 0x3473a ; 0x3473a 2dabc: 91 e0 ldi r25, 0x01 ; 1 2dabe: 81 11 cpse r24, r1 2dac0: 01 c0 rjmp .+2 ; 0x2dac4 2dac2: 90 e0 ldi r25, 0x00 ; 0 2dac4: 90 93 f3 16 sts 0x16F3, r25 ; 0x8016f3 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); 2dac8: 87 e4 ldi r24, 0x47 ; 71 2daca: 9d e0 ldi r25, 0x0D ; 13 2dacc: 0f 94 9d a3 call 0x3473a ; 0x3473a if (sensorActionOnError == SensorActionOnError::_Undef) { 2dad0: 8f 3f cpi r24, 0xFF ; 255 2dad2: c9 f0 breq .+50 ; 0x2db06 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); 2dad4: 80 93 f9 16 sts 0x16F9, r24 ; 0x8016f9 } 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)); 2dad8: 8d ea ldi r24, 0xAD ; 173 2dada: 9c e0 ldi r25, 0x0C ; 12 2dadc: 0f 94 9d a3 call 0x3473a ; 0x3473a 2dae0: 91 e0 ldi r25, 0x01 ; 1 2dae2: 81 11 cpse r24, r1 2dae4: 01 c0 rjmp .+2 ; 0x2dae8 2dae6: 90 e0 ldi r25, 0x00 ; 0 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2dae8: 90 93 ff 16 sts 0x16FF, r25 ; 0x8016ff oldPos = pat9125_y; 2daec: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 2daf0: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 2daf4: 90 93 01 17 sts 0x1701, r25 ; 0x801701 2daf8: 80 93 00 17 sts 0x1700, r24 ; 0x801700 resetStepCount(); 2dafc: 0f 94 37 6d call 0x2da6e ; 0x2da6e jamErrCnt = 0; 2db00: 10 92 06 17 sts 0x1706, r1 ; 0x801706 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)); } 2db04: 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; 2db06: 10 92 f9 16 sts 0x16F9, r1 ; 0x8016f9 2db0a: e6 cf rjmp .-52 ; 0x2dad8 0002db0c : #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) { 2db0c: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 2db10: 83 30 cpi r24, 0x03 ; 3 2db12: 21 f4 brne .+8 ; 0x2db1c } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; 2db14: 10 92 f1 16 sts 0x16F1, r1 ; 0x8016f1 filter = 0; 2db18: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd 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 2db1c: 0f 94 3f 6d call 0x2da7e ; 0x2da7e int16_t stepCount; int16_t chunkSteps; uint8_t jamErrCnt; constexpr void calcChunkSteps(float u) { chunkSteps = (int16_t)(1.25 * u); //[mm] 2db20: 20 e0 ldi r18, 0x00 ; 0 2db22: 30 e0 ldi r19, 0x00 ; 0 2db24: 40 ea ldi r20, 0xA0 ; 160 2db26: 5f e3 ldi r21, 0x3F ; 63 2db28: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 2db2c: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 2db30: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 2db34: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 2db38: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2db3c: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 2db40: 70 93 05 17 sts 0x1705, r23 ; 0x801705 2db44: 60 93 04 17 sts 0x1704, r22 ; 0x801704 static void swi2c_write(uint8_t data); void swi2c_init(void) { SET_INPUT(SWI2C_SDA); 2db48: 51 98 cbi 0x0a, 1 ; 10 WRITE(SWI2C_SDA, 1); //SDA must be input with pullups while we are not sure if the slave is outputing or not 2db4a: 59 9a sbi 0x0b, 1 ; 11 WRITE(SWI2C_SCL, 0); 2db4c: 9f b7 in r25, 0x3f ; 63 2db4e: f8 94 cli 2db50: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2db54: 8b 7f andi r24, 0xFB ; 251 2db56: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2db5a: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(SWI2C_SCL); //SCL can be an output at all times. The bus is not in a multi-master configuration. 2db5c: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 2db60: 84 60 ori r24, 0x04 ; 4 2db62: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 2db66: 84 e6 ldi r24, 0x64 ; 100 2db68: 98 e0 ldi r25, 0x08 ; 8 2db6a: 9a 95 dec r25 2db6c: f1 f7 brne .-4 ; 0x2db6a 2db6e: 81 50 subi r24, 0x01 ; 1 for (uint8_t i = 0; i < 100; i++) //wait. Not sure what for, but wait anyway. 2db70: d9 f7 brne .-10 ; 0x2db68 2db72: 8a e0 ldi r24, 0x0A ; 10 } */ static void swi2c_nack(void) { WRITE(SWI2C_SDA, 1); 2db74: 59 9a sbi 0x0b, 1 ; 11 2db76: 98 e0 ldi r25, 0x08 ; 8 2db78: 9a 95 dec r25 2db7a: f1 f7 brne .-4 ; 0x2db78 __delay(); WRITE(SWI2C_SCL, 1); 2db7c: 2f b7 in r18, 0x3f ; 63 2db7e: f8 94 cli 2db80: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2db84: 94 60 ori r25, 0x04 ; 4 2db86: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2db8a: 2f bf out 0x3f, r18 ; 63 2db8c: 98 e0 ldi r25, 0x08 ; 8 2db8e: 9a 95 dec r25 2db90: f1 f7 brne .-4 ; 0x2db8e __delay(); WRITE(SWI2C_SCL, 0); 2db92: 2f b7 in r18, 0x3f ; 63 2db94: f8 94 cli 2db96: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2db9a: 9b 7f andi r25, 0xFB ; 251 2db9c: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2dba0: 2f bf out 0x3f, r18 ; 63 2dba2: 98 e0 ldi r25, 0x08 ; 8 2dba4: 9a 95 dec r25 2dba6: f1 f7 brne .-4 ; 0x2dba4 2dba8: 81 50 subi r24, 0x01 ; 1 SET_OUTPUT(SWI2C_SCL); //SCL can be an output at all times. The bus is not in a multi-master configuration. for (uint8_t i = 0; i < 100; i++) //wait. Not sure what for, but wait anyway. __delay(); for (uint8_t i = 0; i < 10; i++) { //send nack 10 times. This makes sure that the slave gets a nack regardless of it's state when we init the bus. 2dbaa: 21 f7 brne .-56 ; 0x2db74 swi2c_nack(); } swi2c_stop(); //"release" the bus by sending a stop condition. 2dbac: 0f 94 02 15 call 0x22a04 ; 0x22a04 SET_OUTPUT(SWI2C_SDA); //finally make the SDA line an output since the bus is idle for sure. 2dbb0: 51 9a sbi 0x0a, 1 ; 10 } } uint8_t swi2c_check(uint8_t dev_addr) { swi2c_start(); 2dbb2: 0f 94 12 15 call 0x22a24 ; 0x22a24 swi2c_write((dev_addr & SWI2C_DMSK) << SWI2C_ASHF); 2dbb6: 8a ee ldi r24, 0xEA ; 234 2dbb8: 0f 94 a1 14 call 0x22942 ; 0x22942 if (!swi2c_wait_ack()) { swi2c_stop(); return 1; } 2dbbc: 0f 94 cd 14 call 0x2299a ; 0x2299a 2dbc0: 81 11 cpse r24, r1 2dbc2: 08 c0 rjmp .+16 ; 0x2dbd4 2dbc4: 0f 94 02 15 call 0x22a04 ; 0x22a04 void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; filter = 0; 2dbc8: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 2dbcc: 83 e0 ldi r24, 0x03 ; 3 2dbce: 80 93 f1 16 sts 0x16F1, r24 ; 0x8016f1 #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { ; // MK3 fw on MK3S printer } #endif // IR_SENSOR_PIN } 2dbd2: 08 95 ret swi2c_stop(); 2dbd4: 0f 94 02 15 call 0x22a04 ; 0x22a04 { 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); 2dbd8: 60 e0 ldi r22, 0x00 ; 0 2dbda: 8f e7 ldi r24, 0x7F ; 127 2dbdc: 0f 94 cf 4c call 0x2999e ; 0x2999e // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2dbe0: 80 e0 ldi r24, 0x00 ; 0 2dbe2: 0f 94 f8 4c call 0x299f0 ; 0x299f0 2dbe6: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2dbea: 81 e0 ldi r24, 0x01 ; 1 2dbec: 0f 94 f8 4c call 0x299f0 ; 0x299f0 2dbf0: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2dbf4: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 2dbf8: 91 33 cpi r25, 0x31 ; 49 2dbfa: b1 f5 brne .+108 ; 0x2dc68 2dbfc: 81 39 cpi r24, 0x91 ; 145 2dbfe: a1 f5 brne .+104 ; 0x2dc68 } #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); 2dc00: 67 e9 ldi r22, 0x97 ; 151 2dc02: 86 e0 ldi r24, 0x06 ; 6 2dc04: 0f 94 cf 4c call 0x2999e ; 0x2999e #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2dc08: 8f e9 ldi r24, 0x9F ; 159 2dc0a: 9f e0 ldi r25, 0x0F ; 15 2dc0c: 01 97 sbiw r24, 0x01 ; 1 2dc0e: f1 f7 brne .-4 ; 0x2dc0c 2dc10: 00 c0 rjmp .+0 ; 0x2dc12 2dc12: 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)) 2dc14: 80 e0 ldi r24, 0x00 ; 0 2dc16: 91 ea ldi r25, 0xA1 ; 161 2dc18: 0f 94 54 4d call 0x29aa8 ; 0x29aa8 2dc1c: 88 23 and r24, r24 2dc1e: a1 f2 breq .-88 ; 0x2dbc8 2dc20: 8f e3 ldi r24, 0x3F ; 63 2dc22: 9c e9 ldi r25, 0x9C ; 156 2dc24: 01 97 sbiw r24, 0x01 ; 1 2dc26: f1 f7 brne .-4 ; 0x2dc24 2dc28: 00 c0 rjmp .+0 ; 0x2dc2a 2dc2a: 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); 2dc2c: 61 e0 ldi r22, 0x01 ; 1 2dc2e: 8f e7 ldi r24, 0x7F ; 127 2dc30: 0f 94 cf 4c call 0x2999e ; 0x2999e //Write init sequence in bank1. MUST ALREADY BE IN bank1. if (!pat9125_wr_seq(pat9125_init_bank1)) 2dc34: 8d ec ldi r24, 0xCD ; 205 2dc36: 90 ea ldi r25, 0xA0 ; 160 2dc38: 0f 94 54 4d call 0x29aa8 ; 0x29aa8 2dc3c: 88 23 and r24, r24 2dc3e: 21 f2 breq .-120 ; 0x2dbc8 return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x00); 2dc40: 60 e0 ldi r22, 0x00 ; 0 2dc42: 8f e7 ldi r24, 0x7F ; 127 2dc44: 0f 94 cf 4c call 0x2999e ; 0x2999e // Enable write protect. pat9125_wr_reg(PAT9125_WP, 0x00); //prevents writing to registers over 0x09 2dc48: 60 e0 ldi r22, 0x00 ; 0 2dc4a: 89 e0 ldi r24, 0x09 ; 9 2dc4c: 0f 94 cf 4c call 0x2999e ; 0x2999e pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2dc50: 80 e0 ldi r24, 0x00 ; 0 2dc52: 0f 94 f8 4c call 0x299f0 ; 0x299f0 2dc56: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2dc5a: 81 e0 ldi r24, 0x01 ; 1 2dc5c: 0f 94 f8 4c call 0x299f0 ; 0x299f0 2dc60: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 deinit(); triggerError(); ; // } #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { 2dc64: 89 b1 in r24, 0x09 ; 9 2dc66: 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); 2dc68: 80 e0 ldi r24, 0x00 ; 0 2dc6a: 0f 94 f8 4c call 0x299f0 ; 0x299f0 2dc6e: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2dc72: 81 e0 ldi r24, 0x01 ; 1 2dc74: 0f 94 f8 4c call 0x299f0 ; 0x299f0 2dc78: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2dc7c: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 2dc80: 91 33 cpi r25, 0x31 ; 49 2dc82: 09 f0 breq .+2 ; 0x2dc86 2dc84: a1 cf rjmp .-190 ; 0x2dbc8 2dc86: 81 39 cpi r24, 0x91 ; 145 2dc88: 09 f0 breq .+2 ; 0x2dc8c 2dc8a: 9e cf rjmp .-196 ; 0x2dbc8 2dc8c: b9 cf rjmp .-142 ; 0x2dc00 0002dc8e : 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() { 2dc8e: cf 93 push r28 2dc90: df 93 push r29 if (jamDetection) { 2dc92: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 2dc96: 88 23 and r24, r24 2dc98: 09 f4 brne .+2 ; 0x2dc9c 2dc9a: 60 c0 rjmp .+192 ; 0x2dd5c setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } int16_t PAT9125_sensor::getStepCount() { int16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } 2dc9c: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2dc9e: f8 94 cli 2dca0: c0 91 02 17 lds r28, 0x1702 ; 0x801702 2dca4: d0 91 03 17 lds r29, 0x1703 ; 0x801703 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2dca8: 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 2dcaa: ce 01 movw r24, r28 2dcac: d7 ff sbrs r29, 7 2dcae: 04 c0 rjmp .+8 ; 0x2dcb8 2dcb0: 88 27 eor r24, r24 2dcb2: 99 27 eor r25, r25 2dcb4: 8c 1b sub r24, r28 2dcb6: 9d 0b sbc r25, r29 2dcb8: 20 91 04 17 lds r18, 0x1704 ; 0x801704 2dcbc: 30 91 05 17 lds r19, 0x1705 ; 0x801705 2dcc0: 82 17 cp r24, r18 2dcc2: 93 07 cpc r25, r19 2dcc4: 4c f1 brlt .+82 ; 0x2dd18 resetStepCount(); 2dcc6: 0f 94 37 6d call 0x2da6e ; 0x2da6e if (!pat9125_update()) { // get up to date data. reinit on error. 2dcca: 0f 94 72 4d call 0x29ae4 ; 0x29ae4 2dcce: 81 11 cpse r24, r1 2dcd0: 02 c0 rjmp .+4 ; 0x2dcd6 init(); // try to reinit. 2dcd2: 0f 94 86 6d call 0x2db0c ; 0x2db0c } bool fsDir = (pat9125_y - oldPos) > 0; 2dcd6: 20 91 38 0e lds r18, 0x0E38 ; 0x800e38 2dcda: 30 91 39 0e lds r19, 0x0E39 ; 0x800e39 2dcde: 80 91 06 17 lds r24, 0x1706 ; 0x801706 2dce2: 40 91 00 17 lds r20, 0x1700 ; 0x801700 2dce6: 50 91 01 17 lds r21, 0x1701 ; 0x801701 2dcea: b9 01 movw r22, r18 2dcec: 64 1b sub r22, r20 2dcee: 75 0b sbc r23, r21 2dcf0: 41 e0 ldi r20, 0x01 ; 1 2dcf2: 16 16 cp r1, r22 2dcf4: 17 06 cpc r1, r23 2dcf6: 0c f0 brlt .+2 ; 0x2dcfa 2dcf8: 40 e0 ldi r20, 0x00 ; 0 bool stDir = _stepCount > 0; 2dcfa: 91 e0 ldi r25, 0x01 ; 1 2dcfc: 1c 16 cp r1, r28 2dcfe: 1d 06 cpc r1, r29 2dd00: 0c f0 brlt .+2 ; 0x2dd04 2dd02: 90 e0 ldi r25, 0x00 ; 0 if (fsDir != stDir) { 2dd04: 49 17 cp r20, r25 2dd06: 09 f4 brne .+2 ; 0x2dd0a 2dd08: 61 c0 rjmp .+194 ; 0x2ddcc jamErrCnt++; 2dd0a: 8f 5f subi r24, 0xFF ; 255 } else if (jamErrCnt) { jamErrCnt--; 2dd0c: 80 93 06 17 sts 0x1706, r24 ; 0x801706 } oldPos = pat9125_y; 2dd10: 30 93 01 17 sts 0x1701, r19 ; 0x801701 2dd14: 20 93 00 17 sts 0x1700, r18 ; 0x801700 } if (jamErrCnt > 10) { 2dd18: 80 91 06 17 lds r24, 0x1706 ; 0x801706 2dd1c: 8b 30 cpi r24, 0x0B ; 11 2dd1e: f0 f0 brcs .+60 ; 0x2dd5c jamErrCnt = 0; 2dd20: 10 92 06 17 sts 0x1706, r1 ; 0x801706 void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } } void PAT9125_sensor::filJam() { runoutEnabled = false; 2dd24: 10 92 f3 16 sts 0x16F3, r1 ; 0x8016f3 autoLoadEnabled = false; 2dd28: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 jamDetection = false; 2dd2c: 10 92 ff 16 sts 0x16FF, r1 ; 0x8016ff stop_and_save_print_to_ram(0, 0); 2dd30: 60 e0 ldi r22, 0x00 ; 0 2dd32: 70 e0 ldi r23, 0x00 ; 0 2dd34: cb 01 movw r24, r22 2dd36: 0f 94 de 65 call 0x2cbbc ; 0x2cbbc restore_print_from_ram_and_continue(0); 2dd3a: 60 e0 ldi r22, 0x00 ; 0 2dd3c: 70 e0 ldi r23, 0x00 ; 0 2dd3e: cb 01 movw r24, r22 2dd40: 0e 94 88 66 call 0xcd10 ; 0xcd10 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 2dd44: 85 e6 ldi r24, 0x65 ; 101 2dd46: 9f e0 ldi r25, 0x0F ; 15 2dd48: 0e 94 4c 78 call 0xf098 ; 0xf098 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 2dd4c: 81 e0 ldi r24, 0x01 ; 1 2dd4e: 9f e0 ldi r25, 0x0F ; 15 2dd50: 0e 94 3f 78 call 0xf07e ; 0xf07e enquecommand_front_P(MSG_M600); 2dd54: 8e e5 ldi r24, 0x5E ; 94 2dd56: 9c e6 ldi r25, 0x6C ; 108 2dd58: 0f 94 49 67 call 0x2ce92 ; 0x2ce92 jamErrCnt = 0; filJam(); } } if (pollingTimer.expired_cont(pollingPeriod)) { 2dd5c: 6a e0 ldi r22, 0x0A ; 10 2dd5e: 70 e0 ldi r23, 0x00 ; 0 2dd60: 8a ef ldi r24, 0xFA ; 250 2dd62: 96 e1 ldi r25, 0x16 ; 22 2dd64: 0f 94 ad 0b call 0x2175a ; 0x2175a ::expired_cont(unsigned short)> 2dd68: c8 2f mov r28, r24 2dd6a: 88 23 and r24, r24 2dd6c: 39 f1 breq .+78 ; 0x2ddbc pollingTimer.start(); 2dd6e: 8a ef ldi r24, 0xFA ; 250 2dd70: 96 e1 ldi r25, 0x16 ; 22 2dd72: 0f 94 b4 0b call 0x21768 ; 0x21768 ::start()> if (!pat9125_update()) { 2dd76: 0f 94 72 4d call 0x29ae4 ; 0x29ae4 2dd7a: 81 11 cpse r24, r1 2dd7c: 02 c0 rjmp .+4 ; 0x2dd82 init(); // try to reinit. 2dd7e: 0f 94 86 6d call 0x2db0c ; 0x2db0c } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); 2dd82: 80 91 64 0d lds r24, 0x0D64 ; 0x800d64 2dd86: 81 31 cpi r24, 0x11 ; 17 2dd88: 30 f0 brcs .+12 ; 0x2dd96 2dd8a: c1 e0 ldi r28, 0x01 ; 1 2dd8c: 80 91 63 0d lds r24, 0x0D63 ; 0x800d63 2dd90: 82 33 cpi r24, 0x32 ; 50 2dd92: 08 f4 brcc .+2 ; 0x2dd96 2dd94: c0 e0 ldi r28, 0x00 ; 0 2dd96: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd if (present != filterFilPresent) { 2dd9a: 20 91 fe 16 lds r18, 0x16FE ; 0x8016fe 2dd9e: 30 e0 ldi r19, 0x00 ; 0 2dda0: c2 17 cp r28, r18 2dda2: 13 06 cpc r1, r19 2dda4: c1 f0 breq .+48 ; 0x2ddd6 filter++; 2dda6: 8f 5f subi r24, 0xFF ; 255 } else if (filter) { filter--; 2dda8: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd } if (filter >= filterCnt) { 2ddac: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd 2ddb0: 85 30 cpi r24, 0x05 ; 5 2ddb2: 20 f0 brcs .+8 ; 0x2ddbc filter = 0; 2ddb4: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd filterFilPresent = present; 2ddb8: c0 93 fe 16 sts 0x16FE, r28 ; 0x8016fe } } return (filter == 0); // return stability 2ddbc: 81 e0 ldi r24, 0x01 ; 1 2ddbe: 90 91 fd 16 lds r25, 0x16FD ; 0x8016fd 2ddc2: 91 11 cpse r25, r1 2ddc4: 80 e0 ldi r24, 0x00 ; 0 } 2ddc6: df 91 pop r29 2ddc8: cf 91 pop r28 2ddca: 08 95 ret } bool fsDir = (pat9125_y - oldPos) > 0; bool stDir = _stepCount > 0; if (fsDir != stDir) { jamErrCnt++; } else if (jamErrCnt) { 2ddcc: 88 23 and r24, r24 2ddce: 09 f4 brne .+2 ; 0x2ddd2 2ddd0: 9f cf rjmp .-194 ; 0x2dd10 jamErrCnt--; 2ddd2: 81 50 subi r24, 0x01 ; 1 2ddd4: 9b cf rjmp .-202 ; 0x2dd0c } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); if (present != filterFilPresent) { filter++; } else if (filter) { 2ddd6: 88 23 and r24, r24 2ddd8: 49 f3 breq .-46 ; 0x2ddac filter--; 2ddda: 81 50 subi r24, 0x01 ; 1 2dddc: e5 cf rjmp .-54 ; 0x2dda8 0002ddde : * 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() { 2ddde: 2f 92 push r2 2dde0: 3f 92 push r3 2dde2: 4f 92 push r4 2dde4: 5f 92 push r5 2dde6: 6f 92 push r6 2dde8: 7f 92 push r7 2ddea: 8f 92 push r8 2ddec: 9f 92 push r9 2ddee: af 92 push r10 2ddf0: bf 92 push r11 2ddf2: cf 92 push r12 2ddf4: df 92 push r13 2ddf6: ef 92 push r14 2ddf8: ff 92 push r15 2ddfa: 0f 93 push r16 2ddfc: 1f 93 push r17 2ddfe: cf 93 push r28 2de00: df 93 push r29 2de02: cd b7 in r28, 0x3d ; 61 2de04: de b7 in r29, 0x3e ; 62 2de06: ed 97 sbiw r28, 0x3d ; 61 2de08: 0f b6 in r0, 0x3f ; 63 2de0a: f8 94 cli 2de0c: de bf out 0x3e, r29 ; 62 2de0e: 0f be out 0x3f, r0 ; 63 2de10: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2de12: 10 92 79 15 sts 0x1579, r1 ; 0x801579 2de16: 10 92 78 15 sts 0x1578, r1 ; 0x801578 lastSortedFilePosition = 0; 2de1a: 10 92 43 16 sts 0x1643, r1 ; 0x801643 2de1e: 10 92 42 16 sts 0x1642, r1 ; 0x801642 */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2de22: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2de26: 82 fd sbrc r24, 2 2de28: f7 c0 rjmp .+494 ; 0x2e018 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2de2a: 89 e0 ldi r24, 0x09 ; 9 2de2c: 9f e0 ldi r25, 0x0F ; 15 2de2e: 0f 94 9d a3 call 0x3473a ; 0x3473a 2de32: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2de34: 82 e0 ldi r24, 0x02 ; 2 2de36: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2de3a: 0f 94 20 6c call 0x2d840 ; 0x2d840 2de3e: 6c 01 movw r12, r24 if (fileCnt > 0) { 2de40: 00 97 sbiw r24, 0x00 ; 0 2de42: 09 f4 brne .+2 ; 0x2de46 2de44: e6 c0 rjmp .+460 ; 0x2e012 // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2de46: 85 36 cpi r24, 0x65 ; 101 2de48: 91 05 cpc r25, r1 2de4a: 80 f0 brcs .+32 ; 0x2de6c if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2de4c: 32 e0 ldi r19, 0x02 ; 2 2de4e: 33 16 cp r3, r19 2de50: 51 f0 breq .+20 ; 0x2de66 2de52: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2de56: 81 11 cpse r24, r1 2de58: 06 c0 rjmp .+12 ; 0x2de66 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2de5a: 86 e3 ldi r24, 0x36 ; 54 2de5c: 92 e6 ldi r25, 0x62 ; 98 2de5e: 0e 94 0a 75 call 0xea14 ; 0xea14 2de62: 0e 94 85 e8 call 0x1d10a ; 0x1d10a } fileCnt = SDSORT_LIMIT; 2de66: f4 e6 ldi r31, 0x64 ; 100 2de68: cf 2e mov r12, r31 2de6a: d1 2c mov r13, r1 } sort_count = fileCnt; 2de6c: d0 92 79 15 sts 0x1579, r13 ; 0x801579 2de70: c0 92 78 15 sts 0x1578, r12 ; 0x801578 2de74: 6a e7 ldi r22, 0x7A ; 122 2de76: 66 2e mov r6, r22 2de78: 65 e1 ldi r22, 0x15 ; 21 2de7a: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2de7c: f1 2c mov r15, r1 2de7e: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2de80: 72 e8 ldi r23, 0x82 ; 130 2de82: a7 2e mov r10, r23 2de84: 74 e1 ldi r23, 0x14 ; 20 2de86: b7 2e mov r11, r23 nrFiles = 1; 2de88: 88 24 eor r8, r8 2de8a: 83 94 inc r8 2de8c: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2de8e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2de92: 82 fd sbrc r24, 2 2de94: c1 c0 rjmp .+386 ; 0x2e018 manage_heater(); 2de96: 0f 94 a5 37 call 0x26f4a ; 0x26f4a if (i == 0) 2de9a: e1 14 cp r14, r1 2de9c: f1 04 cpc r15, r1 2de9e: 09 f0 breq .+2 ; 0x2dea2 2dea0: d4 c0 rjmp .+424 ; 0x2e04a getfilename(0); 2dea2: 90 e0 ldi r25, 0x00 ; 0 2dea4: 80 e0 ldi r24, 0x00 ; 0 2dea6: 0f 94 8a 6b call 0x2d714 ; 0x2d714 else getfilename_next(position); sort_entries[i] = position >> 5; 2deaa: 80 91 ea 13 lds r24, 0x13EA ; 0x8013ea 2deae: 90 91 eb 13 lds r25, 0x13EB ; 0x8013eb 2deb2: a0 91 ec 13 lds r26, 0x13EC ; 0x8013ec 2deb6: b0 91 ed 13 lds r27, 0x13ED ; 0x8013ed 2deba: 55 e0 ldi r21, 0x05 ; 5 2debc: b6 95 lsr r27 2debe: a7 95 ror r26 2dec0: 97 95 ror r25 2dec2: 87 95 ror r24 2dec4: 5a 95 dec r21 2dec6: d1 f7 brne .-12 ; 0x2debc 2dec8: f3 01 movw r30, r6 2deca: 81 93 st Z+, r24 2decc: 91 93 st Z+, r25 2dece: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2ded0: ff ef ldi r31, 0xFF ; 255 2ded2: ef 1a sub r14, r31 2ded4: ff 0a sbc r15, r31 2ded6: ce 14 cp r12, r14 2ded8: df 04 cpc r13, r15 2deda: c9 f6 brne .-78 ; 0x2de8e else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2dedc: 21 e0 ldi r18, 0x01 ; 1 2dede: e2 16 cp r14, r18 2dee0: f1 04 cpc r15, r1 2dee2: 09 f4 brne .+2 ; 0x2dee6 2dee4: 96 c0 rjmp .+300 ; 0x2e012 2dee6: 32 e0 ldi r19, 0x02 ; 2 2dee8: 33 16 cp r3, r19 2deea: 09 f4 brne .+2 ; 0x2deee 2deec: 92 c0 rjmp .+292 ; 0x2e012 2deee: 20 91 60 0d lds r18, 0x0D60 ; 0x800d60 2def2: 21 11 cpse r18, r1 2def4: 8e c0 rjmp .+284 ; 0x2e012 #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2def6: 90 93 43 16 sts 0x1643, r25 ; 0x801643 2defa: 80 93 42 16 sts 0x1642, r24 ; 0x801642 #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)); 2defe: 86 e2 ldi r24, 0x26 ; 38 2df00: 92 e6 ldi r25, 0x62 ; 98 2df02: 0e 94 0a 75 call 0xea14 ; 0xea14 2df06: ee 9c mul r14, r14 2df08: 90 01 movw r18, r0 2df0a: ef 9c mul r14, r15 2df0c: 30 0d add r19, r0 2df0e: 30 0d add r19, r0 2df10: 11 24 eor r1, r1 2df12: bc 01 movw r22, r24 2df14: c9 01 movw r24, r18 2df16: 96 95 lsr r25 2df18: 87 95 ror r24 2df1a: 0e 94 e1 71 call 0xe3c2 ; 0xe3c2 2df1e: 3c e7 ldi r19, 0x7C ; 124 2df20: a3 2e mov r10, r19 2df22: 35 e1 ldi r19, 0x15 ; 21 2df24: 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; 2df26: 91 2c mov r9, r1 2df28: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2df2a: cc 24 eor r12, r12 2df2c: c3 94 inc r12 2df2e: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2df30: c4 01 movw r24, r8 2df32: 0e 94 17 71 call 0xe22e ; 0xe22e counter += i; 2df36: 8c 0c add r8, r12 2df38: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2df3a: f5 01 movw r30, r10 2df3c: 01 90 ld r0, Z+ 2df3e: f0 81 ld r31, Z 2df40: e0 2d mov r30, r0 2df42: f9 af std Y+57, r31 ; 0x39 2df44: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2df46: cf 01 movw r24, r30 2df48: 0f 94 d1 6b call 0x2d7a2 ; 0x2d7a2 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2df4c: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2df50: 69 ed ldi r22, 0xD9 ; 217 2df52: 73 e1 ldi r23, 0x13 ; 19 2df54: 88 23 and r24, r24 2df56: 11 f0 breq .+4 ; 0x2df5c 2df58: 6e ee ldi r22, 0xEE ; 238 2df5a: 73 e1 ldi r23, 0x13 ; 19 2df5c: ce 01 movw r24, r28 2df5e: 01 96 adiw r24, 0x01 ; 1 2df60: 0f 94 08 aa call 0x35410 ; 0x35410 crmod_date_bckp = crmodDate; 2df64: 60 90 e8 13 lds r6, 0x13E8 ; 0x8013e8 2df68: 70 90 e9 13 lds r7, 0x13E9 ; 0x8013e9 crmod_time_bckp = crmodTime; 2df6c: 20 91 e6 13 lds r18, 0x13E6 ; 0x8013e6 2df70: 30 91 e7 13 lds r19, 0x13E7 ; 0x8013e7 2df74: 3b af std Y+59, r19 ; 0x3b 2df76: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2df78: 20 90 23 14 lds r2, 0x1423 ; 0x801423 2df7c: bf aa std Y+55, r11 ; 0x37 2df7e: ae aa std Y+54, r10 ; 0x36 2df80: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2df82: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2df86: 82 fd sbrc r24, 2 2df88: 47 c0 rjmp .+142 ; 0x2e018 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2df8a: 0f 94 a5 37 call 0x26f4a ; 0x26f4a const uint16_t o2 = sort_entries[j - 1]; 2df8e: c8 01 movw r24, r16 2df90: 01 97 sbiw r24, 0x01 ; 1 2df92: 9d af std Y+61, r25 ; 0x3d 2df94: 8c af std Y+60, r24 ; 0x3c 2df96: ee a9 ldd r30, Y+54 ; 0x36 2df98: ff a9 ldd r31, Y+55 ; 0x37 2df9a: 52 90 ld r5, -Z 2df9c: 42 90 ld r4, -Z 2df9e: ff ab std Y+55, r31 ; 0x37 2dfa0: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2dfa2: c2 01 movw r24, r4 2dfa4: 0f 94 d1 6b call 0x2d7a2 ; 0x2d7a2 char *name2 = LONGEST_FILENAME; // use the string in-place 2dfa8: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2dfac: 69 ed ldi r22, 0xD9 ; 217 2dfae: 73 e1 ldi r23, 0x13 ; 19 2dfb0: 88 23 and r24, r24 2dfb2: 11 f0 breq .+4 ; 0x2dfb8 2dfb4: 6e ee ldi r22, 0xEE ; 238 2dfb6: 73 e1 ldi r23, 0x13 ; 19 // Sort the current pair according to settings. if ( 2dfb8: 31 10 cpse r3, r1 2dfba: 8a c0 rjmp .+276 ; 0x2e0d0 2dfbc: 80 91 23 14 lds r24, 0x1423 ; 0x801423 2dfc0: 28 12 cpse r2, r24 2dfc2: 83 c0 rjmp .+262 ; 0x2e0ca #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2dfc4: 80 91 e8 13 lds r24, 0x13E8 ; 0x8013e8 2dfc8: 90 91 e9 13 lds r25, 0x13E9 ; 0x8013e9 2dfcc: 68 16 cp r6, r24 2dfce: 79 06 cpc r7, r25 2dfd0: 09 f0 breq .+2 ; 0x2dfd4 2dfd2: 6c c0 rjmp .+216 ; 0x2e0ac 2dfd4: 80 91 e6 13 lds r24, 0x13E6 ; 0x8013e6 2dfd8: 90 91 e7 13 lds r25, 0x13E7 ; 0x8013e7 2dfdc: 2a ad ldd r18, Y+58 ; 0x3a 2dfde: 3b ad ldd r19, Y+59 ; 0x3b 2dfe0: 82 17 cp r24, r18 2dfe2: 93 07 cpc r25, r19 2dfe4: 08 f0 brcs .+2 ; 0x2dfe8 2dfe6: 66 c0 rjmp .+204 ; 0x2e0b4 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2dfe8: 00 0f add r16, r16 2dfea: 11 1f adc r17, r17 2dfec: f8 01 movw r30, r16 2dfee: e6 58 subi r30, 0x86 ; 134 2dff0: fa 4e sbci r31, 0xEA ; 234 2dff2: 28 ad ldd r18, Y+56 ; 0x38 2dff4: 39 ad ldd r19, Y+57 ; 0x39 2dff6: 31 83 std Z+1, r19 ; 0x01 2dff8: 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){ 2dffa: 3f ef ldi r19, 0xFF ; 255 2dffc: c3 1a sub r12, r19 2dffe: d3 0a sbc r13, r19 2e000: 82 e0 ldi r24, 0x02 ; 2 2e002: a8 0e add r10, r24 2e004: b1 1c adc r11, r1 2e006: ec 14 cp r14, r12 2e008: fd 04 cpc r15, r13 2e00a: 09 f0 breq .+2 ; 0x2e00e 2e00c: 91 cf rjmp .-222 ; 0x2df30 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2e00e: 0e 94 38 71 call 0xe270 ; 0xe270 } } KEEPALIVE_STATE(NOT_BUSY); 2e012: 81 e0 ldi r24, 0x01 ; 1 2e014: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } 2e018: ed 96 adiw r28, 0x3d ; 61 2e01a: 0f b6 in r0, 0x3f ; 63 2e01c: f8 94 cli 2e01e: de bf out 0x3e, r29 ; 62 2e020: 0f be out 0x3f, r0 ; 63 2e022: cd bf out 0x3d, r28 ; 61 2e024: df 91 pop r29 2e026: cf 91 pop r28 2e028: 1f 91 pop r17 2e02a: 0f 91 pop r16 2e02c: ff 90 pop r15 2e02e: ef 90 pop r14 2e030: df 90 pop r13 2e032: cf 90 pop r12 2e034: bf 90 pop r11 2e036: af 90 pop r10 2e038: 9f 90 pop r9 2e03a: 8f 90 pop r8 2e03c: 7f 90 pop r7 2e03e: 6f 90 pop r6 2e040: 5f 90 pop r5 2e042: 4f 90 pop r4 2e044: 3f 90 pop r3 2e046: 2f 90 pop r2 2e048: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2e04a: 40 91 ea 13 lds r20, 0x13EA ; 0x8013ea 2e04e: 50 91 eb 13 lds r21, 0x13EB ; 0x8013eb 2e052: 60 91 ec 13 lds r22, 0x13EC ; 0x8013ec 2e056: 70 91 ed 13 lds r23, 0x13ED ; 0x8013ed lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2e05a: b0 92 81 14 sts 0x1481, r11 ; 0x801481 2e05e: a0 92 80 14 sts 0x1480, r10 ; 0x801480 nrFiles = 1; 2e062: 90 92 f0 16 sts 0x16F0, r9 ; 0x8016f0 2e066: 80 92 ef 16 sts 0x16EF, r8 ; 0x8016ef curDir->seekSet(position); 2e06a: 82 e8 ldi r24, 0x82 ; 130 2e06c: 94 e1 ldi r25, 0x14 ; 20 2e06e: 0f 94 94 2a call 0x25528 ; 0x25528 2e072: 1e 7f andi r17, 0xFE ; 254 2e074: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2e076: e0 91 80 14 lds r30, 0x1480 ; 0x801480 2e07a: f0 91 81 14 lds r31, 0x1481 ; 0x801481 2e07e: 83 e2 ldi r24, 0x23 ; 35 2e080: de 01 movw r26, r28 2e082: 11 96 adiw r26, 0x01 ; 1 2e084: 01 90 ld r0, Z+ 2e086: 0d 92 st X+, r0 2e088: 8a 95 dec r24 2e08a: e1 f7 brne .-8 ; 0x2e084 2e08c: 01 2f mov r16, r17 2e08e: 22 e0 ldi r18, 0x02 ; 2 2e090: 50 e0 ldi r21, 0x00 ; 0 2e092: 40 e0 ldi r20, 0x00 ; 0 2e094: be 01 movw r22, r28 2e096: 6f 5f subi r22, 0xFF ; 255 2e098: 7f 4f sbci r23, 0xFF ; 255 2e09a: 8f ed ldi r24, 0xDF ; 223 2e09c: 92 e0 ldi r25, 0x02 ; 2 2e09e: 0f 94 5b 69 call 0x2d2b6 ; 0x2d2b6 2e0a2: ce 01 movw r24, r28 2e0a4: 01 96 adiw r24, 0x01 ; 1 2e0a6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 2e0aa: ff ce rjmp .-514 ; 0x2deaa 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)) 2e0ac: 86 15 cp r24, r6 2e0ae: 97 05 cpc r25, r7 2e0b0: 08 f4 brcc .+2 ; 0x2e0b4 2e0b2: 9a cf rjmp .-204 ; 0x2dfe8 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2e0b4: ee a9 ldd r30, Y+54 ; 0x36 2e0b6: ff a9 ldd r31, Y+55 ; 0x37 2e0b8: 53 82 std Z+3, r5 ; 0x03 2e0ba: 42 82 std Z+2, r4 ; 0x02 2e0bc: 0c ad ldd r16, Y+60 ; 0x3c 2e0be: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2e0c0: 01 15 cp r16, r1 2e0c2: 11 05 cpc r17, r1 2e0c4: 09 f0 breq .+2 ; 0x2e0c8 2e0c6: 5d cf rjmp .-326 ; 0x2df82 2e0c8: 8f cf rjmp .-226 ; 0x2dfe8 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)) 2e0ca: 22 20 and r2, r2 2e0cc: 99 f3 breq .-26 ; 0x2e0b4 2e0ce: 8c cf rjmp .-232 ; 0x2dfe8 2e0d0: 31 e0 ldi r19, 0x01 ; 1 2e0d2: 33 12 cpse r3, r19 2e0d4: ef cf rjmp .-34 ; 0x2e0b4 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2e0d6: 80 91 23 14 lds r24, 0x1423 ; 0x801423 2e0da: 28 12 cpse r2, r24 2e0dc: 07 c0 rjmp .+14 ; 0x2e0ec #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2e0de: ce 01 movw r24, r28 2e0e0: 01 96 adiw r24, 0x01 ; 1 2e0e2: 0f 94 d6 a9 call 0x353ac ; 0x353ac 2e0e6: 97 fd sbrc r25, 7 2e0e8: e5 cf rjmp .-54 ; 0x2e0b4 2e0ea: 7e cf rjmp .-260 ; 0x2dfe8 2e0ec: 21 10 cpse r2, r1 2e0ee: e2 cf rjmp .-60 ; 0x2e0b4 2e0f0: 7b cf rjmp .-266 ; 0x2dfe8 0002e0f2 : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2e0f2: cf 92 push r12 2e0f4: df 92 push r13 2e0f6: ef 92 push r14 2e0f8: ff 92 push r15 2e0fa: 0f 93 push r16 2e0fc: 1f 93 push r17 2e0fe: cf 93 push r28 2e100: df 93 push r29 2e102: cd b7 in r28, 0x3d ; 61 2e104: de b7 in r29, 0x3e ; 62 2e106: a3 97 sbiw r28, 0x23 ; 35 2e108: 0f b6 in r0, 0x3f ; 63 2e10a: f8 94 cli 2e10c: de bf out 0x3e, r29 ; 62 2e10e: 0f be out 0x3f, r0 ; 63 2e110: cd bf out 0x3d, r28 ; 61 2e112: 7c 01 movw r14, r24 2e114: 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) {} 2e116: 19 82 std Y+1, r1 ; 0x01 2e118: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2e11a: 80 91 85 14 lds r24, 0x1485 ; 0x801485 parent=&workDir; 2e11e: 92 e8 ldi r25, 0x82 ; 130 2e120: c9 2e mov r12, r25 2e122: 94 e1 ldi r25, 0x14 ; 20 2e124: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2e126: 81 11 cpse r24, r1 2e128: 04 c0 rjmp .+8 ; 0x2e132 } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2e12a: 8d e5 ldi r24, 0x5D ; 93 2e12c: c8 2e mov r12, r24 2e12e: 84 e1 ldi r24, 0x14 ; 20 2e130: 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); 2e132: 21 e0 ldi r18, 0x01 ; 1 2e134: a7 01 movw r20, r14 2e136: b6 01 movw r22, r12 2e138: ce 01 movw r24, r28 2e13a: 01 96 adiw r24, 0x01 ; 1 2e13c: 0f 94 9d 54 call 0x2a93a ; 0x2a93a 2e140: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2e142: 88 23 and r24, r24 2e144: 21 f1 breq .+72 ; 0x2e18e 2e146: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2e14a: 85 30 cpi r24, 0x05 ; 5 2e14c: 00 f5 brcc .+64 ; 0x2e18e SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2e14e: 29 e0 ldi r18, 0x09 ; 9 2e150: 82 9f mul r24, r18 2e152: c0 01 movw r24, r0 2e154: 11 24 eor r1, r1 2e156: b7 01 movw r22, r14 2e158: 89 5d subi r24, 0xD9 ; 217 2e15a: 9b 4e sbci r25, 0xEB ; 235 2e15c: 0f 94 08 aa call 0x35410 ; 0x35410 puts(relpath); 2e160: c7 01 movw r24, r14 2e162: 0f 94 2c aa call 0x35458 ; 0x35458 if (workDirDepth < MAX_DIR_DEPTH) { 2e166: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2e16a: 86 30 cpi r24, 0x06 ; 6 2e16c: 80 f1 brcs .+96 ; 0x2e1ce for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2e16e: 83 e2 ldi r24, 0x23 ; 35 2e170: fe 01 movw r30, r28 2e172: 31 96 adiw r30, 0x01 ; 1 2e174: a2 e8 ldi r26, 0x82 ; 130 2e176: b4 e1 ldi r27, 0x14 ; 20 2e178: 01 90 ld r0, Z+ 2e17a: 0d 92 st X+, r0 2e17c: 8a 95 dec r24 2e17e: e1 f7 brne .-8 ; 0x2e178 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2e180: 00 23 and r16, r16 2e182: 09 f4 brne .+2 ; 0x2e186 2e184: 4c c0 rjmp .+152 ; 0x2e21e presort(); 2e186: 0f 94 ef 6e call 0x2ddde ; 0x2ddde else presort_flag = true; #endif return 1; 2e18a: 10 2f mov r17, r16 2e18c: 0c c0 rjmp .+24 ; 0x2e1a6 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2e18e: 8e ec ldi r24, 0xCE ; 206 2e190: 91 ea ldi r25, 0xA1 ; 161 2e192: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2e196: 88 e4 ldi r24, 0x48 ; 72 2e198: 9c e6 ldi r25, 0x6C ; 108 2e19a: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(relpath); 2e19e: c7 01 movw r24, r14 2e1a0: 0e 94 92 85 call 0x10b24 ; 0x10b24 return 0; 2e1a4: 10 e0 ldi r17, 0x00 ; 0 2e1a6: ce 01 movw r24, r28 2e1a8: 01 96 adiw r24, 0x01 ; 1 2e1aa: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 else presort_flag = true; #endif return 1; } } 2e1ae: 81 2f mov r24, r17 2e1b0: a3 96 adiw r28, 0x23 ; 35 2e1b2: 0f b6 in r0, 0x3f ; 63 2e1b4: f8 94 cli 2e1b6: de bf out 0x3e, r29 ; 62 2e1b8: 0f be out 0x3f, r0 ; 63 2e1ba: cd bf out 0x3d, r28 ; 61 2e1bc: df 91 pop r29 2e1be: cf 91 pop r28 2e1c0: 1f 91 pop r17 2e1c2: 0f 91 pop r16 2e1c4: ff 90 pop r15 2e1c6: ef 90 pop r14 2e1c8: df 90 pop r13 2e1ca: cf 90 pop r12 2e1cc: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2e1ce: 8f 5f subi r24, 0xFF ; 255 2e1d0: 80 93 77 15 sts 0x1577, r24 ; 0x801577 workDirParents[d+1] = workDirParents[d]; 2e1d4: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2e1d6: 81 50 subi r24, 0x01 ; 1 2e1d8: c8 f0 brcs .+50 ; 0x2e20c workDirParents[d+1] = workDirParents[d]; 2e1da: 28 2f mov r18, r24 2e1dc: 30 e0 ldi r19, 0x00 ; 0 2e1de: a9 01 movw r20, r18 2e1e0: 4f 5f subi r20, 0xFF ; 255 2e1e2: 5f 4f sbci r21, 0xFF ; 255 2e1e4: 94 9f mul r25, r20 2e1e6: d0 01 movw r26, r0 2e1e8: 95 9f mul r25, r21 2e1ea: b0 0d add r27, r0 2e1ec: 11 24 eor r1, r1 2e1ee: ab 55 subi r26, 0x5B ; 91 2e1f0: bb 4e sbci r27, 0xEB ; 235 2e1f2: 92 9f mul r25, r18 2e1f4: f0 01 movw r30, r0 2e1f6: 93 9f mul r25, r19 2e1f8: f0 0d add r31, r0 2e1fa: 11 24 eor r1, r1 2e1fc: eb 55 subi r30, 0x5B ; 91 2e1fe: fb 4e sbci r31, 0xEB ; 235 2e200: 29 2f mov r18, r25 2e202: 01 90 ld r0, Z+ 2e204: 0d 92 st X+, r0 2e206: 2a 95 dec r18 2e208: e1 f7 brne .-8 ; 0x2e202 2e20a: e5 cf rjmp .-54 ; 0x2e1d6 workDirParents[0]=*parent; 2e20c: 83 e2 ldi r24, 0x23 ; 35 2e20e: f6 01 movw r30, r12 2e210: a5 ea ldi r26, 0xA5 ; 165 2e212: b4 e1 ldi r27, 0x14 ; 20 2e214: 01 90 ld r0, Z+ 2e216: 0d 92 st X+, r0 2e218: 8a 95 dec r24 2e21a: e1 f7 brne .-8 ; 0x2e214 2e21c: a8 cf rjmp .-176 ; 0x2e16e #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2e21e: 81 e0 ldi r24, 0x01 ; 1 2e220: 80 93 26 14 sts 0x1426, r24 ; 0x801426 2e224: c0 cf rjmp .-128 ; 0x2e1a6 0002e226 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2e226: 93 e2 ldi r25, 0x23 ; 35 2e228: ed e5 ldi r30, 0x5D ; 93 2e22a: f4 e1 ldi r31, 0x14 ; 20 2e22c: a2 e8 ldi r26, 0x82 ; 130 2e22e: b4 e1 ldi r27, 0x14 ; 20 2e230: 01 90 ld r0, Z+ 2e232: 0d 92 st X+, r0 2e234: 9a 95 dec r25 2e236: e1 f7 brne .-8 ; 0x2e230 workDirDepth = 0; 2e238: 10 92 77 15 sts 0x1577, r1 ; 0x801577 curDir=&workDir; 2e23c: 22 e8 ldi r18, 0x82 ; 130 2e23e: 34 e1 ldi r19, 0x14 ; 20 2e240: 30 93 81 14 sts 0x1481, r19 ; 0x801481 2e244: 20 93 80 14 sts 0x1480, r18 ; 0x801480 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2e248: 81 11 cpse r24, r1 presort(); 2e24a: 0d 94 ef 6e jmp 0x2ddde ; 0x2ddde else presort_flag = true; 2e24e: 81 e0 ldi r24, 0x01 ; 1 2e250: 80 93 26 14 sts 0x1426, r24 ; 0x801426 #endif } 2e254: 08 95 ret 0002e256 : * * @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) 2e256: 8f 92 push r8 2e258: 9f 92 push r9 2e25a: af 92 push r10 2e25c: bf 92 push r11 2e25e: cf 92 push r12 2e260: df 92 push r13 2e262: ef 92 push r14 2e264: ff 92 push r15 2e266: 0f 93 push r16 2e268: 1f 93 push r17 2e26a: cf 93 push r28 2e26c: df 93 push r29 2e26e: cd b7 in r28, 0x3d ; 61 2e270: de b7 in r29, 0x3e ; 62 2e272: 2d 97 sbiw r28, 0x0d ; 13 2e274: 0f b6 in r0, 0x3f ; 63 2e276: f8 94 cli 2e278: de bf out 0x3e, r29 ; 62 2e27a: 0f be out 0x3f, r0 ; 63 2e27c: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2e27e: 2d e5 ldi r18, 0x5D ; 93 2e280: 34 e1 ldi r19, 0x14 ; 20 2e282: 30 93 81 14 sts 0x1481, r19 ; 0x801481 2e286: 20 93 80 14 sts 0x1480, r18 ; 0x801480 if (!fileName) 2e28a: dc 01 movw r26, r24 2e28c: ed 91 ld r30, X+ 2e28e: fc 91 ld r31, X 2e290: 30 97 sbiw r30, 0x00 ; 0 2e292: a1 f4 brne .+40 ; 0x2e2bc } else //relative path { curDir = &workDir; } return 1; 2e294: 81 e0 ldi r24, 0x01 ; 1 } 2e296: 2d 96 adiw r28, 0x0d ; 13 2e298: 0f b6 in r0, 0x3f ; 63 2e29a: f8 94 cli 2e29c: de bf out 0x3e, r29 ; 62 2e29e: 0f be out 0x3f, r0 ; 63 2e2a0: cd bf out 0x3d, r28 ; 61 2e2a2: df 91 pop r29 2e2a4: cf 91 pop r28 2e2a6: 1f 91 pop r17 2e2a8: 0f 91 pop r16 2e2aa: ff 90 pop r15 2e2ac: ef 90 pop r14 2e2ae: df 90 pop r13 2e2b0: cf 90 pop r12 2e2b2: bf 90 pop r11 2e2b4: af 90 pop r10 2e2b6: 9f 90 pop r9 2e2b8: 8f 90 pop r8 2e2ba: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2e2bc: 20 81 ld r18, Z 2e2be: 2f 32 cpi r18, 0x2F ; 47 2e2c0: 09 f0 breq .+2 ; 0x2e2c4 2e2c2: 47 c0 rjmp .+142 ; 0x2e352 2e2c4: 6c 01 movw r12, r24 { cdroot(false); 2e2c6: 80 e0 ldi r24, 0x00 ; 0 2e2c8: 0f 94 13 71 call 0x2e226 ; 0x2e226 dirname_start = fileName + 1; 2e2cc: f6 01 movw r30, r12 2e2ce: 00 81 ld r16, Z 2e2d0: 11 81 ldd r17, Z+1 ; 0x01 2e2d2: 0f 5f subi r16, 0xFF ; 255 2e2d4: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2e2d6: 92 e8 ldi r25, 0x82 ; 130 2e2d8: 89 2e mov r8, r25 2e2da: 94 e1 ldi r25, 0x14 ; 20 2e2dc: 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) 2e2de: d8 01 movw r26, r16 2e2e0: 8c 91 ld r24, X 2e2e2: 88 23 and r24, r24 2e2e4: b9 f2 breq .-82 ; 0x2e294 { dirname_end = strchr(dirname_start, '/'); 2e2e6: 6f e2 ldi r22, 0x2F ; 47 2e2e8: 70 e0 ldi r23, 0x00 ; 0 2e2ea: c8 01 movw r24, r16 2e2ec: 0f 94 f4 a9 call 0x353e8 ; 0x353e8 2e2f0: 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) 2e2f2: 00 97 sbiw r24, 0x00 ; 0 2e2f4: 51 f1 breq .+84 ; 0x2e34a 2e2f6: 08 17 cp r16, r24 2e2f8: 19 07 cpc r17, r25 2e2fa: 38 f5 brcc .+78 ; 0x2e34a { 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); 2e2fc: 7c 01 movw r14, r24 2e2fe: e0 1a sub r14, r16 2e300: f1 0a sbc r15, r17 2e302: bd e0 ldi r27, 0x0D ; 13 2e304: eb 16 cp r14, r27 2e306: f1 04 cpc r15, r1 2e308: 18 f0 brcs .+6 ; 0x2e310 2e30a: 8c e0 ldi r24, 0x0C ; 12 2e30c: e8 2e mov r14, r24 2e30e: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2e310: a7 01 movw r20, r14 2e312: b8 01 movw r22, r16 2e314: ce 01 movw r24, r28 2e316: 01 96 adiw r24, 0x01 ; 1 2e318: 0f 94 1d aa call 0x3543a ; 0x3543a subdirname[len] = 0; 2e31c: e1 e0 ldi r30, 0x01 ; 1 2e31e: f0 e0 ldi r31, 0x00 ; 0 2e320: ec 0f add r30, r28 2e322: fd 1f adc r31, r29 2e324: ee 0d add r30, r14 2e326: ff 1d adc r31, r15 2e328: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2e32a: 60 e0 ldi r22, 0x00 ; 0 2e32c: ce 01 movw r24, r28 2e32e: 01 96 adiw r24, 0x01 ; 1 2e330: 0f 94 79 70 call 0x2e0f2 ; 0x2e0f2 2e334: 88 23 and r24, r24 2e336: 09 f4 brne .+2 ; 0x2e33a 2e338: ae cf rjmp .-164 ; 0x2e296 return 0; curDir = &workDir; 2e33a: 90 92 81 14 sts 0x1481, r9 ; 0x801481 2e33e: 80 92 80 14 sts 0x1480, r8 ; 0x801480 dirname_start = dirname_end + 1; 2e342: 85 01 movw r16, r10 2e344: 0f 5f subi r16, 0xFF ; 255 2e346: 1f 4f sbci r17, 0xFF ; 255 2e348: ca cf rjmp .-108 ; 0x2e2de } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2e34a: f6 01 movw r30, r12 2e34c: 11 83 std Z+1, r17 ; 0x01 2e34e: 00 83 st Z, r16 2e350: a1 cf rjmp .-190 ; 0x2e294 } } else //relative path { curDir = &workDir; 2e352: 82 e8 ldi r24, 0x82 ; 130 2e354: 94 e1 ldi r25, 0x14 ; 20 2e356: 90 93 81 14 sts 0x1481, r25 ; 0x801481 2e35a: 80 93 80 14 sts 0x1480, r24 ; 0x801480 2e35e: 9a cf rjmp .-204 ; 0x2e294 0002e360 : 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*/){ 2e360: bf 92 push r11 2e362: cf 92 push r12 2e364: df 92 push r13 2e366: ef 92 push r14 2e368: ff 92 push r15 2e36a: 0f 93 push r16 2e36c: 1f 93 push r17 2e36e: cf 93 push r28 2e370: df 93 push r29 2e372: 1f 92 push r1 2e374: 1f 92 push r1 2e376: cd b7 in r28, 0x3d ; 61 2e378: de b7 in r29, 0x3e ; 62 if(!mounted) 2e37a: 20 91 d8 13 lds r18, 0x13D8 ; 0x8013d8 2e37e: 22 23 and r18, r18 2e380: 09 f4 brne .+2 ; 0x2e384 2e382: ef c0 rjmp .+478 ; 0x2e562 2e384: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2e386: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2e38a: 88 23 and r24, r24 2e38c: 09 f4 brne .+2 ; 0x2e390 2e38e: 04 c1 rjmp .+520 ; 0x2e598 if(!replace_current){ 2e390: 61 11 cpse r22, r1 2e392: f6 c0 rjmp .+492 ; 0x2e580 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2e394: d0 90 8a 16 lds r13, 0x168A ; 0x80168a 2e398: dd 20 and r13, r13 2e39a: 21 f0 breq .+8 ; 0x2e3a4 // 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); 2e39c: 88 e9 ldi r24, 0x98 ; 152 2e39e: 90 ea ldi r25, 0xA0 ; 160 2e3a0: 0e 94 f3 82 call 0x105e6 ; 0x105e6 return; } SERIAL_ECHO_START; 2e3a4: 8e ec ldi r24, 0xCE ; 206 2e3a6: 91 ea ldi r25, 0xA1 ; 161 2e3a8: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(ofSubroutineCallTgt); 2e3ac: 8f e7 ldi r24, 0x7F ; 127 2e3ae: 90 ea ldi r25, 0xA0 ; 160 2e3b0: 0e 94 94 7a call 0xf528 ; 0xf528 2e3b4: c7 01 movw r24, r14 2e3b6: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2e3ba: 84 e7 ldi r24, 0x74 ; 116 2e3bc: 90 ea ldi r25, 0xA0 ; 160 2e3be: 0e 94 94 7a call 0xf528 ; 0xf528 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2e3c2: 00 91 8a 16 lds r16, 0x168A ; 0x80168a 2e3c6: 25 e5 ldi r18, 0x55 ; 85 2e3c8: 02 9f mul r16, r18 2e3ca: 80 01 movw r16, r0 2e3cc: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2e3ce: 01 57 subi r16, 0x71 ; 113 2e3d0: 19 4e sbci r17, 0xE9 ; 233 2e3d2: 8f e2 ldi r24, 0x2F ; 47 2e3d4: f8 01 movw r30, r16 2e3d6: 81 93 st Z+, r24 2e3d8: 8f 01 movw r16, r30 2e3da: cc 24 eor r12, r12 2e3dc: c3 94 inc r12 for(uint8_t i=0;i 2e3e6: d8 16 cp r13, r24 2e3e8: b0 f4 brcc .+44 ; 0x2e416 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2e3ea: db 9c mul r13, r11 2e3ec: c0 01 movw r24, r0 2e3ee: 11 24 eor r1, r1 2e3f0: b8 01 movw r22, r16 2e3f2: 8b 55 subi r24, 0x5B ; 91 2e3f4: 9b 4e sbci r25, 0xEB ; 235 2e3f6: 0f 94 7b 2c call 0x258f6 ; 0x258f6 2e3fa: c8 01 movw r24, r16 2e3fc: 8c 01 movw r16, r24 2e3fe: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 2e400: f8 01 movw r30, r16 2e402: 20 81 ld r18, Z 2e404: 22 23 and r18, r18 2e406: 29 f0 breq .+10 ; 0x2e412 2e408: f4 e5 ldi r31, 0x54 ; 84 2e40a: fc 15 cp r31, r12 2e40c: 10 f0 brcs .+4 ; 0x2e412 {t++;cnt++;} //crawl counter forward. 2e40e: c3 94 inc r12 2e410: f5 cf rjmp .-22 ; 0x2e3fc 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) 2e416: 27 e4 ldi r18, 0x47 ; 71 2e418: 2c 15 cp r18, r12 2e41a: 08 f4 brcc .+2 ; 0x2e41e 2e41c: ae c0 rjmp .+348 ; 0x2e57a file.getFilename(t); 2e41e: b8 01 movw r22, r16 2e420: 87 e6 ldi r24, 0x67 ; 103 2e422: 96 e1 ldi r25, 0x16 ; 22 2e424: 0f 94 7b 2c call 0x258f6 ; 0x258f6 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2e428: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e42c: f5 e5 ldi r31, 0x55 ; 85 2e42e: 8f 9f mul r24, r31 2e430: c0 01 movw r24, r0 2e432: 11 24 eor r1, r1 2e434: 81 57 subi r24, 0x71 ; 113 2e436: 99 4e sbci r25, 0xE9 ; 233 2e438: 0e 94 86 85 call 0x10b0c ; 0x10b0c SERIAL_ECHORPGM(ofPos); 2e43c: 8e e6 ldi r24, 0x6E ; 110 2e43e: 90 ea ldi r25, 0xA0 ; 160 2e440: 0e 94 94 7a call 0xf528 ; 0xf528 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2e444: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 2e448: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 2e44c: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 2e450: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 2e454: 4a e0 ldi r20, 0x0A ; 10 2e456: 0e 94 95 79 call 0xf32a ; 0xf32a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2e45a: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2e45e: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e462: 24 e0 ldi r18, 0x04 ; 4 2e464: 82 9f mul r24, r18 2e466: f0 01 movw r30, r0 2e468: 11 24 eor r1, r1 2e46a: e5 57 subi r30, 0x75 ; 117 2e46c: f9 4e sbci r31, 0xE9 ; 233 2e46e: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 2e472: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 2e476: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 2e47a: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 2e47e: 40 83 st Z, r20 2e480: 51 83 std Z+1, r21 ; 0x01 2e482: 62 83 std Z+2, r22 ; 0x02 2e484: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2e486: 8f 5f subi r24, 0xFF ; 255 2e488: 80 93 8a 16 sts 0x168A, r24 ; 0x80168a } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 2e48c: 87 e6 ldi r24, 0x67 ; 103 2e48e: 96 e1 ldi r25, 0x16 ; 22 2e490: 0f 94 72 2c call 0x258e4 ; 0x258e4 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; 2e494: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 2e498: fa 82 std Y+2, r15 ; 0x02 2e49a: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 2e49c: ce 01 movw r24, r28 2e49e: 01 96 adiw r24, 0x01 ; 1 2e4a0: 0f 94 2b 71 call 0x2e256 ; 0x2e256 2e4a4: 88 23 and r24, r24 2e4a6: 09 f4 brne .+2 ; 0x2e4aa 2e4a8: 5c c0 rjmp .+184 ; 0x2e562 */ 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) ){ 2e4aa: 49 81 ldd r20, Y+1 ; 0x01 2e4ac: 5a 81 ldd r21, Y+2 ; 0x02 2e4ae: 60 91 80 14 lds r22, 0x1480 ; 0x801480 2e4b2: 70 91 81 14 lds r23, 0x1481 ; 0x801481 2e4b6: 21 e0 ldi r18, 0x01 ; 1 2e4b8: 87 e6 ldi r24, 0x67 ; 103 2e4ba: 96 e1 ldi r25, 0x16 ; 22 2e4bc: 0f 94 9d 54 call 0x2a93a ; 0x2a93a 2e4c0: 88 23 and r24, r24 2e4c2: 09 f4 brne .+2 ; 0x2e4c6 2e4c4: 77 c0 rjmp .+238 ; 0x2e5b4 // compute the block to start with if( ! gfComputeNextFileBlock() ) 2e4c6: 87 e6 ldi r24, 0x67 ; 103 2e4c8: 96 e1 ldi r25, 0x16 ; 22 2e4ca: 0f 94 1b 2a call 0x25436 ; 0x25436 2e4ce: 88 23 and r24, r24 2e4d0: 09 f4 brne .+2 ; 0x2e4d4 2e4d2: 70 c0 rjmp .+224 ; 0x2e5b4 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; 2e4d4: 80 91 88 16 lds r24, 0x1688 ; 0x801688 2e4d8: 90 91 89 16 lds r25, 0x1689 ; 0x801689 2e4dc: 8a 5b subi r24, 0xBA ; 186 2e4de: 91 4f sbci r25, 0xF1 ; 241 2e4e0: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2e4e4: 80 93 82 16 sts 0x1682, r24 ; 0x801682 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 2e4e8: 89 81 ldd r24, Y+1 ; 0x01 2e4ea: 9a 81 ldd r25, Y+2 ; 0x02 2e4ec: 0f 94 8a 6b call 0x2d714 ; 0x2d714 filesize = file.fileSize(); 2e4f0: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2e4f4: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2e4f8: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2e4fc: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2e500: 80 93 e4 16 sts 0x16E4, r24 ; 0x8016e4 2e504: 90 93 e5 16 sts 0x16E5, r25 ; 0x8016e5 2e508: a0 93 e6 16 sts 0x16E6, r26 ; 0x8016e6 2e50c: b0 93 e7 16 sts 0x16E7, r27 ; 0x8016e7 SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 2e510: 8e e3 ldi r24, 0x3E ; 62 2e512: 90 ea ldi r25, 0xA0 ; 160 2e514: 0e 94 94 7a call 0xf528 ; 0xf528 printAbsFilenameFast(); 2e518: 0f 94 6d 6c call 0x2d8da ; 0x2d8da SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 2e51c: 86 e3 ldi r24, 0x36 ; 54 2e51e: 90 ea ldi r25, 0xA0 ; 160 2e520: 0e 94 94 7a call 0xf528 ; 0xf528 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2e524: 60 91 e4 16 lds r22, 0x16E4 ; 0x8016e4 2e528: 70 91 e5 16 lds r23, 0x16E5 ; 0x8016e5 2e52c: 80 91 e6 16 lds r24, 0x16E6 ; 0x8016e6 2e530: 90 91 e7 16 lds r25, 0x16E7 ; 0x8016e7 2e534: 4a e0 ldi r20, 0x0A ; 10 2e536: 0e 94 95 79 call 0xf32a ; 0xf32a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2e53a: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 2e53e: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 2e542: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 2e546: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 2e54a: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2e54e: 88 e2 ldi r24, 0x28 ; 40 2e550: 90 ea ldi r25, 0xA0 ; 160 2e552: 0e 94 8d 7c call 0xf91a ; 0xf91a lcd_setstatuspgm(ofFileSelected); 2e556: 88 e2 ldi r24, 0x28 ; 40 2e558: 90 ea ldi r25, 0xA0 ; 160 2e55a: 0e 94 85 dc call 0x1b90a ; 0x1b90a scrollstuff = 0; 2e55e: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 2e562: 0f 90 pop r0 2e564: 0f 90 pop r0 2e566: df 91 pop r29 2e568: cf 91 pop r28 2e56a: 1f 91 pop r17 2e56c: 0f 91 pop r16 2e56e: ff 90 pop r15 2e570: ef 90 pop r14 2e572: df 90 pop r13 2e574: cf 90 pop r12 2e576: bf 90 pop r11 2e578: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 2e57a: f8 01 movw r30, r16 2e57c: 10 82 st Z, r1 2e57e: 54 cf rjmp .-344 ; 0x2e428 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 2e580: 8e ec ldi r24, 0xCE ; 206 2e582: 91 ea ldi r25, 0xA1 ; 161 2e584: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(ofNowDoingFile); 2e588: 8d e5 ldi r24, 0x5D ; 93 2e58a: 90 ea ldi r25, 0xA0 ; 160 2e58c: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(name); 2e590: c7 01 movw r24, r14 2e592: 0e 94 92 85 call 0x10b24 ; 0x10b24 2e596: 7a cf rjmp .-268 ; 0x2e48c } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 2e598: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a SERIAL_ECHO_START; 2e59c: 8e ec ldi r24, 0xCE ; 206 2e59e: 91 ea ldi r25, 0xA1 ; 161 2e5a0: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(ofNowFreshFile); 2e5a4: 8c e4 ldi r24, 0x4C ; 76 2e5a6: 90 ea ldi r25, 0xA0 ; 160 2e5a8: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(name); 2e5ac: c7 01 movw r24, r14 2e5ae: 0e 94 92 85 call 0x10b24 ; 0x10b24 2e5b2: 70 cf rjmp .-288 ; 0x2e494 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2e5b4: 84 e3 ldi r24, 0x34 ; 52 2e5b6: 9c e6 ldi r25, 0x6C ; 108 2e5b8: 0e 94 94 7a call 0xf528 ; 0xf528 2e5bc: 89 81 ldd r24, Y+1 ; 0x01 2e5be: 9a 81 ldd r25, Y+2 ; 0x02 2e5c0: 0e 94 86 85 call 0x10b0c ; 0x10b0c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2e5c4: 8e e2 ldi r24, 0x2E ; 46 2e5c6: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2e5ca: 0e 94 8c 7a call 0xf518 ; 0xf518 2e5ce: c9 cf rjmp .-110 ; 0x2e562 0002e5d0 : void CardReader::printingHasFinished() { st_synchronize(); 2e5d0: 0f 94 b0 18 call 0x23160 ; 0x23160 file.close(); 2e5d4: 87 e6 ldi r24, 0x67 ; 103 2e5d6: 96 e1 ldi r25, 0x16 ; 22 2e5d8: 0f 94 72 2c call 0x258e4 ; 0x258e4 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 2e5dc: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e5e0: 88 23 and r24, r24 2e5e2: 69 f1 breq .+90 ; 0x2e63e { file_subcall_ctr--; 2e5e4: 81 50 subi r24, 0x01 ; 1 2e5e6: 80 93 8a 16 sts 0x168A, r24 ; 0x80168a openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 2e5ea: 25 e5 ldi r18, 0x55 ; 85 2e5ec: 82 9f mul r24, r18 2e5ee: c0 01 movw r24, r0 2e5f0: 11 24 eor r1, r1 2e5f2: 61 e0 ldi r22, 0x01 ; 1 2e5f4: 81 57 subi r24, 0x71 ; 113 2e5f6: 99 4e sbci r25, 0xE9 ; 233 2e5f8: 0f 94 b0 71 call 0x2e360 ; 0x2e360 setIndex(filespos[file_subcall_ctr]); 2e5fc: e0 91 8a 16 lds r30, 0x168A ; 0x80168a 2e600: 84 e0 ldi r24, 0x04 ; 4 2e602: e8 9f mul r30, r24 2e604: f0 01 movw r30, r0 2e606: 11 24 eor r1, r1 2e608: e5 57 subi r30, 0x75 ; 117 2e60a: f9 4e sbci r31, 0xE9 ; 233 2e60c: 60 81 ld r22, Z 2e60e: 71 81 ldd r23, Z+1 ; 0x01 2e610: 82 81 ldd r24, Z+2 ; 0x02 2e612: 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);}; 2e614: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb 2e618: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec 2e61c: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed 2e620: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee 2e624: 0f 94 e8 67 call 0x2cfd0 ; 0x2cfd0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 2e628: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 2e62c: 88 23 and r24, r24 2e62e: 71 f0 breq .+28 ; 0x2e64c { sdprinting = true; 2e630: 81 e0 ldi r24, 0x01 ; 1 2e632: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 2e636: 85 e0 ldi r24, 0x05 ; 5 2e638: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> 2e63c: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 2e63e: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 2e642: 83 e0 ldi r24, 0x03 ; 3 2e644: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.387> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 2e648: 0c 94 4d 84 jmp 0x1089a ; 0x1089a autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 2e64c: 08 95 ret 0002e64e : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 2e64e: cf 92 push r12 2e650: df 92 push r13 2e652: ef 92 push r14 2e654: ff 92 push r15 2e656: 0f 93 push r16 2e658: 1f 93 push r17 2e65a: cf 93 push r28 2e65c: df 93 push r29 2e65e: 08 2f mov r16, r24 { mounted = false; 2e660: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 if(root.isOpen()) 2e664: 80 91 60 14 lds r24, 0x1460 ; 0x801460 2e668: 88 23 and r24, r24 2e66a: 21 f0 breq .+8 ; 0x2e674 root.close(); 2e66c: 8d e5 ldi r24, 0x5D ; 93 2e66e: 94 e1 ldi r25, 0x14 ; 20 2e670: 0f 94 72 2c call 0x258e4 ; 0x258e4 * \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; 2e674: 10 92 47 16 sts 0x1647, r1 ; 0x801647 2e678: 10 92 44 16 sts 0x1644, r1 ; 0x801644 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 2e67c: 0f 94 56 0b call 0x216ac ; 0x216ac 2e680: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 2e682: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 SET_OUTPUT(SDSS); 2e686: 20 9a sbi 0x04, 0 ; 4 SET_INPUT(MISO); 2e688: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 2e68a: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 2e68c: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 2e68e: 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); 2e690: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 2e692: 85 e0 ldi r24, 0x05 ; 5 2e694: 80 93 45 16 sts 0x1645, r24 ; 0x801645 * 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); 2e698: 82 e5 ldi r24, 0x52 ; 82 2e69a: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2e69c: 1d bc out 0x2d, r1 ; 45 2e69e: 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); 2e6a0: 8f ef ldi r24, 0xFF ; 255 2e6a2: 0f 94 4e 26 call 0x24c9c ; 0x24c9c 2e6a6: 11 50 subi r17, 0x01 ; 1 2e6a8: d9 f7 brne .-10 ; 0x2e6a0 WRITE(MISO, 1); // temporarily enable the MISO line pullup 2e6aa: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 2e6ac: 20 e0 ldi r18, 0x00 ; 0 2e6ae: 30 e0 ldi r19, 0x00 ; 0 2e6b0: a9 01 movw r20, r18 2e6b2: 60 e0 ldi r22, 0x00 ; 0 2e6b4: 84 e4 ldi r24, 0x44 ; 68 2e6b6: 96 e1 ldi r25, 0x16 ; 22 2e6b8: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 2e6bc: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e6c0: 81 30 cpi r24, 0x01 ; 1 2e6c2: 61 f0 breq .+24 ; 0x2e6dc if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 2e6c4: 0f 94 56 0b call 0x216ac ; 0x216ac 2e6c8: 6c 1b sub r22, r28 2e6ca: 7d 0b sbc r23, r29 2e6cc: 61 3d cpi r22, 0xD1 ; 209 2e6ce: 77 40 sbci r23, 0x07 ; 7 2e6d0: 68 f3 brcs .-38 ; 0x2e6ac WRITE(MISO, 0); // disable the MISO line pullup 2e6d2: 2b 98 cbi 0x05, 3 ; 5 2e6d4: 81 e0 ldi r24, 0x01 ; 1 2e6d6: 80 93 44 16 sts 0x1644, r24 ; 0x801644 2e6da: 22 c0 rjmp .+68 ; 0x2e720 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 2e6dc: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 2e6de: 0f 94 56 0b call 0x216ac ; 0x216ac 2e6e2: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 2e6e4: 8b e1 ldi r24, 0x1B ; 27 2e6e6: 90 ea ldi r25, 0xA0 ; 160 2e6e8: 0e 94 8d 7c call 0xf91a ; 0xf91a spiSend(0XFF); 2e6ec: 8f ef ldi r24, 0xFF ; 255 2e6ee: 0f 94 4e 26 call 0x24c9c ; 0x24c9c while ((status_ = spiRec()) != 0xFF) 2e6f2: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2e6f6: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e6fa: 8f 3f cpi r24, 0xFF ; 255 2e6fc: 59 f1 breq .+86 ; 0x2e754 { spiSend(0XFF); 2e6fe: 8f ef ldi r24, 0xFF ; 255 2e700: 0f 94 4e 26 call 0x24c9c ; 0x24c9c if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 2e704: 0f 94 56 0b call 0x216ac ; 0x216ac 2e708: 6c 1b sub r22, r28 2e70a: 7d 0b sbc r23, r29 2e70c: 62 32 cpi r22, 0x22 ; 34 2e70e: 71 05 cpc r23, r1 2e710: 80 f3 brcs .-32 ; 0x2e6f2 2e712: 82 e0 ldi r24, 0x02 ; 2 2e714: 80 93 44 16 sts 0x1644, r24 ; 0x801644 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 2e718: 8a e0 ldi r24, 0x0A ; 10 2e71a: 90 ea ldi r25, 0xA0 ; 160 2e71c: 0e 94 8d 7c call 0xf91a ; 0xf91a #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 2e720: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 2e724: 8e ec ldi r24, 0xCE ; 206 2e726: 91 ea ldi r25, 0xA1 ; 161 2e728: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 2e72c: 87 e2 ldi r24, 0x27 ; 39 2e72e: 9c e6 ldi r25, 0x6C ; 108 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 2e730: 0e 94 8d 7c call 0xf91a ; 0xf91a } if (mounted) 2e734: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 2e738: 88 23 and r24, r24 2e73a: 09 f4 brne .+2 ; 0x2e73e 2e73c: 9a c0 rjmp .+308 ; 0x2e872 { cdroot(doPresort); 2e73e: 80 2f mov r24, r16 } } 2e740: df 91 pop r29 2e742: cf 91 pop r28 2e744: 1f 91 pop r17 2e746: 0f 91 pop r16 2e748: ff 90 pop r15 2e74a: ef 90 pop r14 2e74c: df 90 pop r13 2e74e: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 2e750: 0d 94 13 71 jmp 0x2e226 ; 0x2e226 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 2e754: 2a ea ldi r18, 0xAA ; 170 2e756: 31 e0 ldi r19, 0x01 ; 1 2e758: 40 e0 ldi r20, 0x00 ; 0 2e75a: 50 e0 ldi r21, 0x00 ; 0 2e75c: 68 e0 ldi r22, 0x08 ; 8 2e75e: 84 e4 ldi r24, 0x44 ; 68 2e760: 96 e1 ldi r25, 0x16 ; 22 2e762: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 2e766: 82 ff sbrs r24, 2 2e768: 2b c0 rjmp .+86 ; 0x2e7c0 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;} 2e76a: 81 e0 ldi r24, 0x01 ; 1 2e76c: 80 93 47 16 sts 0x1647, r24 ; 0x801647 goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 2e770: 80 91 47 16 lds r24, 0x1647 ; 0x801647 2e774: c1 2c mov r12, r1 2e776: d1 2c mov r13, r1 2e778: 76 01 movw r14, r12 2e77a: 82 30 cpi r24, 0x02 ; 2 2e77c: 29 f4 brne .+10 ; 0x2e788 2e77e: c1 2c mov r12, r1 2e780: d1 2c mov r13, r1 2e782: e1 2c mov r14, r1 2e784: 80 e4 ldi r24, 0x40 ; 64 2e786: 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); 2e788: 20 e0 ldi r18, 0x00 ; 0 2e78a: 30 e0 ldi r19, 0x00 ; 0 2e78c: a9 01 movw r20, r18 2e78e: 67 e3 ldi r22, 0x37 ; 55 2e790: 84 e4 ldi r24, 0x44 ; 68 2e792: 96 e1 ldi r25, 0x16 ; 22 2e794: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 return cardCommand(cmd, arg); 2e798: a7 01 movw r20, r14 2e79a: 96 01 movw r18, r12 2e79c: 69 e2 ldi r22, 0x29 ; 41 2e79e: 84 e4 ldi r24, 0x44 ; 68 2e7a0: 96 e1 ldi r25, 0x16 ; 22 2e7a2: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 2e7a6: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e7aa: 88 23 and r24, r24 2e7ac: b1 f0 breq .+44 ; 0x2e7da // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 2e7ae: 0f 94 56 0b call 0x216ac ; 0x216ac 2e7b2: 6c 1b sub r22, r28 2e7b4: 7d 0b sbc r23, r29 2e7b6: 61 3d cpi r22, 0xD1 ; 209 2e7b8: 77 40 sbci r23, 0x07 ; 7 2e7ba: 30 f3 brcs .-52 ; 0x2e788 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2e7bc: 8a e0 ldi r24, 0x0A ; 10 2e7be: 8b cf rjmp .-234 ; 0x2e6d6 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 2e7c0: 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(); 2e7c2: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2e7c6: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e7ca: 11 50 subi r17, 0x01 ; 1 2e7cc: d1 f7 brne .-12 ; 0x2e7c2 if (status_ != 0XAA) { 2e7ce: 8a 3a cpi r24, 0xAA ; 170 2e7d0: 11 f0 breq .+4 ; 0x2e7d6 2e7d2: 82 e0 ldi r24, 0x02 ; 2 2e7d4: 80 cf rjmp .-256 ; 0x2e6d6 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;} 2e7d6: 82 e0 ldi r24, 0x02 ; 2 2e7d8: c9 cf rjmp .-110 ; 0x2e76c error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 2e7da: 80 91 47 16 lds r24, 0x1647 ; 0x801647 2e7de: 82 30 cpi r24, 0x02 ; 2 2e7e0: d1 f4 brne .+52 ; 0x2e816 if (cardCommand(CMD58, 0)) { 2e7e2: 20 e0 ldi r18, 0x00 ; 0 2e7e4: 30 e0 ldi r19, 0x00 ; 0 2e7e6: a9 01 movw r20, r18 2e7e8: 6a e3 ldi r22, 0x3A ; 58 2e7ea: 84 e4 ldi r24, 0x44 ; 68 2e7ec: 96 e1 ldi r25, 0x16 ; 22 2e7ee: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 2e7f2: 88 23 and r24, r24 2e7f4: 11 f0 breq .+4 ; 0x2e7fa bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2e7f6: 88 e0 ldi r24, 0x08 ; 8 2e7f8: 6e cf rjmp .-292 ; 0x2e6d6 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 2e7fa: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2e7fe: 80 7c andi r24, 0xC0 ; 192 2e800: 80 3c cpi r24, 0xC0 ; 192 2e802: 19 f4 brne .+6 ; 0x2e80a 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;} 2e804: 83 e0 ldi r24, 0x03 ; 3 2e806: 80 93 47 16 sts 0x1647, r24 ; 0x801647 // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 2e80a: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2e80e: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2e812: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 } chipSelectHigh(); 2e816: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 2e81a: 10 92 45 16 sts 0x1645, r1 ; 0x801645 * \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);} 2e81e: 81 e0 ldi r24, 0x01 ; 1 2e820: 0f 94 4f 59 call 0x2b29e ; 0x2b29e 2e824: 81 11 cpse r24, r1 2e826: 0c c0 rjmp .+24 ; 0x2e840 2e828: 80 e0 ldi r24, 0x00 ; 0 2e82a: 0f 94 4f 59 call 0x2b29e ; 0x2b29e #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 2e82e: 81 11 cpse r24, r1 2e830: 07 c0 rjmp .+14 ; 0x2e840 { SERIAL_ERROR_START; 2e832: 81 eb ldi r24, 0xB1 ; 177 2e834: 91 ea ldi r25, 0xA1 ; 161 2e836: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 2e83a: 84 e1 ldi r24, 0x14 ; 20 2e83c: 9c e6 ldi r25, 0x6C ; 108 2e83e: 78 cf rjmp .-272 ; 0x2e730 } else if (!root.openRoot(&volume)) 2e840: 69 e4 ldi r22, 0x49 ; 73 2e842: 76 e1 ldi r23, 0x16 ; 22 2e844: 8d e5 ldi r24, 0x5D ; 93 2e846: 94 e1 ldi r25, 0x14 ; 20 2e848: 0f 94 cb 29 call 0x25396 ; 0x25396 2e84c: 81 11 cpse r24, r1 2e84e: 07 c0 rjmp .+14 ; 0x2e85e { SERIAL_ERROR_START; 2e850: 81 eb ldi r24, 0xB1 ; 177 2e852: 91 ea ldi r25, 0xA1 ; 161 2e854: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 2e858: 84 e0 ldi r24, 0x04 ; 4 2e85a: 9c e6 ldi r25, 0x6C ; 108 2e85c: 69 cf rjmp .-302 ; 0x2e730 } else { mounted = true; 2e85e: 81 e0 ldi r24, 0x01 ; 1 2e860: 80 93 d8 13 sts 0x13D8, r24 ; 0x8013d8 SERIAL_ECHO_START; 2e864: 8e ec ldi r24, 0xCE ; 206 2e866: 91 ea ldi r25, 0xA1 ; 161 2e868: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 2e86c: 89 ef ldi r24, 0xF9 ; 249 2e86e: 9b e6 ldi r25, 0x6B ; 107 2e870: 5f cf rjmp .-322 ; 0x2e730 if (mounted) { cdroot(doPresort); } } 2e872: df 91 pop r29 2e874: cf 91 pop r28 2e876: 1f 91 pop r17 2e878: 0f 91 pop r16 2e87a: ff 90 pop r15 2e87c: ef 90 pop r14 2e87e: df 90 pop r13 2e880: cf 90 pop r12 2e882: 08 95 ret 0002e884 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 2e884: 4f 92 push r4 2e886: 5f 92 push r5 2e888: 6f 92 push r6 2e88a: 7f 92 push r7 2e88c: 8f 92 push r8 2e88e: 9f 92 push r9 2e890: af 92 push r10 2e892: bf 92 push r11 2e894: cf 92 push r12 2e896: df 92 push r13 2e898: ef 92 push r14 2e89a: ff 92 push r15 2e89c: 4b 01 movw r8, r22 2e89e: 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]; 2e8a0: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2e8a4: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2e8a8: 07 2e mov r0, r23 2e8aa: 00 0c add r0, r0 2e8ac: 88 0b sbc r24, r24 2e8ae: 99 0b sbc r25, r25 2e8b0: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> if (!degTargetHotend(extruder)) 2e8b4: 20 e0 ldi r18, 0x00 ; 0 2e8b6: 30 e0 ldi r19, 0x00 ; 0 2e8b8: a9 01 movw r20, r18 2e8ba: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2e8be: 88 23 and r24, r24 2e8c0: d1 f0 breq .+52 ; 0x2e8f6 #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; 2e8c2: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.392> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 2e8c6: cc 24 eor r12, r12 2e8c8: ca 94 dec r12 2e8ca: dc 2c mov r13, r12 2e8cc: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 2e8ce: 98 ee ldi r25, 0xE8 ; 232 2e8d0: 49 2e mov r4, r25 2e8d2: 93 e0 ldi r25, 0x03 ; 3 2e8d4: 59 2e mov r5, r25 2e8d6: 61 2c mov r6, r1 2e8d8: 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) || 2e8da: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.392> 2e8de: 81 11 cpse r24, r1 2e8e0: 0a c0 rjmp .+20 ; 0x2e8f6 2e8e2: 2f ef ldi r18, 0xFF ; 255 2e8e4: c2 16 cp r12, r18 2e8e6: d2 06 cpc r13, r18 2e8e8: e2 06 cpc r14, r18 2e8ea: f2 06 cpc r15, r18 2e8ec: 89 f4 brne .+34 ; 0x2e910 (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) { 2e8ee: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 2e8f2: 82 30 cpi r24, 0x02 ; 2 2e8f4: b9 f4 brne .+46 ; 0x2e924 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 2e8f6: ff 90 pop r15 2e8f8: ef 90 pop r14 2e8fa: df 90 pop r13 2e8fc: cf 90 pop r12 2e8fe: bf 90 pop r11 2e900: af 90 pop r10 2e902: 9f 90 pop r9 2e904: 8f 90 pop r8 2e906: 7f 90 pop r7 2e908: 6f 90 pop r6 2e90a: 5f 90 pop r5 2e90c: 4f 90 pop r4 2e90e: 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) || 2e910: f7 fc sbrc r15, 7 2e912: f1 cf rjmp .-30 ; 0x2e8f6 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 2e914: 0f 94 56 0b call 0x216ac ; 0x216ac 2e918: 6c 19 sub r22, r12 2e91a: 7d 09 sbc r23, r13 2e91c: 68 3b cpi r22, 0xB8 ; 184 2e91e: 7b 40 sbci r23, 0x0B ; 11 2e920: 30 f3 brcs .-52 ; 0x2e8ee 2e922: e9 cf rjmp .-46 ; 0x2e8f6 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) 2e924: 0f 94 56 0b call 0x216ac ; 0x216ac 2e928: 68 19 sub r22, r8 2e92a: 79 09 sbc r23, r9 2e92c: 8a 09 sbc r24, r10 2e92e: 9b 09 sbc r25, r11 2e930: 69 3e cpi r22, 0xE9 ; 233 2e932: 73 40 sbci r23, 0x03 ; 3 2e934: 81 05 cpc r24, r1 2e936: 91 05 cpc r25, r1 2e938: 08 f4 brcc .+2 ; 0x2e93c 2e93a: 42 c0 rjmp .+132 ; 0x2e9c0 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { 2e93c: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2e940: 81 11 cpse r24, r1 2e942: 3a c0 rjmp .+116 ; 0x2e9b8 SERIAL_PROTOCOLPGM("T:"); 2e944: 87 e0 ldi r24, 0x07 ; 7 2e946: 90 ea ldi r25, 0xA0 ; 160 2e948: 0e 94 94 7a call 0xf528 ; 0xf528 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2e94c: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2e950: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2e954: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2e958: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2e95c: 41 e0 ldi r20, 0x01 ; 1 2e95e: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 2e962: 83 e0 ldi r24, 0x03 ; 3 2e964: 90 ea ldi r25, 0xA0 ; 160 2e966: 0e 94 94 7a call 0xf528 ; 0xf528 2e96a: 60 e0 ldi r22, 0x00 ; 0 2e96c: 70 e0 ldi r23, 0x00 ; 0 2e96e: cb 01 movw r24, r22 2e970: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 2e974: 8f ef ldi r24, 0xFF ; 255 2e976: 9f e9 ldi r25, 0x9F ; 159 2e978: 0e 94 94 7a call 0xf528 ; 0xf528 if (residencyStart > -1) 2e97c: f7 fc sbrc r15, 7 2e97e: 52 c0 rjmp .+164 ; 0x2ea24 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 2e980: 0f 94 56 0b call 0x216ac ; 0x216ac 2e984: 46 01 movw r8, r12 2e986: 57 01 movw r10, r14 2e988: 58 eb ldi r21, 0xB8 ; 184 2e98a: 85 0e add r8, r21 2e98c: 5b e0 ldi r21, 0x0B ; 11 2e98e: 95 1e adc r9, r21 2e990: a1 1c adc r10, r1 2e992: b1 1c adc r11, r1 2e994: a5 01 movw r20, r10 2e996: 94 01 movw r18, r8 2e998: 26 1b sub r18, r22 2e99a: 37 0b sbc r19, r23 2e99c: 48 0b sbc r20, r24 2e99e: 59 0b sbc r21, r25 2e9a0: ca 01 movw r24, r20 2e9a2: b9 01 movw r22, r18 2e9a4: a3 01 movw r20, r6 2e9a6: 92 01 movw r18, r4 2e9a8: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 2e9ac: ca 01 movw r24, r20 2e9ae: b9 01 movw r22, r18 2e9b0: 0e 94 fa 79 call 0xf3f4 ; 0xf3f4 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2e9b4: 0e 94 8c 7a call 0xf518 ; 0xf518 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 2e9b8: 0f 94 56 0b call 0x216ac ; 0x216ac 2e9bc: 4b 01 movw r8, r22 2e9be: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 2e9c0: 90 e0 ldi r25, 0x00 ; 0 2e9c2: 80 e0 ldi r24, 0x00 ; 0 2e9c4: 0e 94 7f 8c call 0x118fe ; 0x118fe #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))) || 2e9c8: 3f ef ldi r19, 0xFF ; 255 2e9ca: c3 16 cp r12, r19 2e9cc: d3 06 cpc r13, r19 2e9ce: e3 06 cpc r14, r19 2e9d0: f3 06 cpc r15, r19 2e9d2: 09 f0 breq .+2 ; 0x2e9d6 2e9d4: 46 c0 rjmp .+140 ; 0x2ea62 } 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))) || 2e9d6: 80 91 59 0d lds r24, 0x0D59 ; 0x800d59 <_ZL16target_direction.lto_priv.490> 2e9da: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2e9de: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2e9e2: 88 23 and r24, r24 2e9e4: 19 f1 breq .+70 ; 0x2ea2c 2e9e6: 07 2e mov r0, r23 2e9e8: 00 0c add r0, r0 2e9ea: 88 0b sbc r24, r24 2e9ec: 99 0b sbc r25, r25 2e9ee: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2e9f2: 20 e0 ldi r18, 0x00 ; 0 2e9f4: 30 e0 ldi r19, 0x00 ; 0 2e9f6: 40 e8 ldi r20, 0x80 ; 128 2e9f8: 5f e3 ldi r21, 0x3F ; 63 2e9fa: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2e9fe: 9b 01 movw r18, r22 2ea00: ac 01 movw r20, r24 2ea02: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2ea06: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2ea0a: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2ea0e: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2ea12: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2ea16: 87 fd sbrc r24, 7 2ea18: 60 cf rjmp .-320 ; 0x2e8da (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 2ea1a: 0f 94 56 0b call 0x216ac ; 0x216ac 2ea1e: 6b 01 movw r12, r22 2ea20: 7c 01 movw r14, r24 2ea22: 5b cf rjmp .-330 ; 0x2e8da } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2ea24: 8f e3 ldi r24, 0x3F ; 63 2ea26: 0e 94 81 79 call 0xf302 ; 0xf302 2ea2a: c4 cf rjmp .-120 ; 0x2e9b4 2ea2c: 07 2e mov r0, r23 2ea2e: 00 0c add r0, r0 2ea30: 88 0b sbc r24, r24 2ea32: 99 0b sbc r25, r25 2ea34: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__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))) || 2ea38: 20 e0 ldi r18, 0x00 ; 0 2ea3a: 30 e0 ldi r19, 0x00 ; 0 2ea3c: 40 e8 ldi r20, 0x80 ; 128 2ea3e: 5f e3 ldi r21, 0x3F ; 63 2ea40: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2ea44: 9b 01 movw r18, r22 2ea46: ac 01 movw r20, r24 2ea48: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2ea4c: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2ea50: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2ea54: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2ea58: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2ea5c: 18 16 cp r1, r24 2ea5e: ec f6 brge .-70 ; 0x2ea1a 2ea60: 3c cf rjmp .-392 ; 0x2e8da 2ea62: f7 fc sbrc r15, 7 2ea64: 3a cf rjmp .-396 ; 0x2e8da 2ea66: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2ea6a: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2ea6e: 07 2e mov r0, r23 2ea70: 00 0c add r0, r0 2ea72: 88 0b sbc r24, r24 2ea74: 99 0b sbc r25, r25 2ea76: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2ea7a: 9b 01 movw r18, r22 2ea7c: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 2ea7e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2ea82: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2ea86: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2ea8a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2ea8e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2ea92: 9f 77 andi r25, 0x7F ; 127 2ea94: 20 e0 ldi r18, 0x00 ; 0 2ea96: 30 e0 ldi r19, 0x00 ; 0 2ea98: 40 ea ldi r20, 0xA0 ; 160 2ea9a: 50 e4 ldi r21, 0x40 ; 64 2ea9c: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2eaa0: 18 16 cp r1, r24 2eaa2: 0c f0 brlt .+2 ; 0x2eaa6 2eaa4: 1a cf rjmp .-460 ; 0x2e8da 2eaa6: b9 cf rjmp .-142 ; 0x2ea1a 0002eaa8 : // 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) { 2eaa8: 1f 93 push r17 2eaaa: cf 93 push r28 2eaac: df 93 push r29 2eaae: ec 01 movw r28, r24 2eab0: 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()) { 2eab2: 80 91 d4 12 lds r24, 0x12D4 ; 0x8012d4 2eab6: 83 30 cpi r24, 0x03 ; 3 2eab8: 09 f4 brne .+2 ; 0x2eabc 2eaba: 4e c0 rjmp .+156 ; 0x2eb58 2eabc: 8c 31 cpi r24, 0x1C ; 28 2eabe: 09 f4 brne .+2 ; 0x2eac2 2eac0: 52 c0 rjmp .+164 ; 0x2eb66 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 2eac2: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 2eac6: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 2eaca: 8c 17 cp r24, r28 2eacc: 9d 07 cpc r25, r29 2eace: 79 f1 breq .+94 ; 0x2eb2e lastErrorCode = ec; 2ead0: d0 93 fa 12 sts 0x12FA, r29 ; 0x8012fa 2ead4: c0 93 f9 12 sts 0x12F9, r28 ; 0x8012f9 lastErrorSource = res; 2ead8: 10 93 fb 12 sts 0x12FB, r17 ; 0x8012fb LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 2eadc: ce 01 movw r24, r28 2eade: 0f 94 d7 4e call 0x29dae ; 0x29dae 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); 2eae2: e8 2f mov r30, r24 2eae4: f0 e0 ldi r31, 0x00 ; 0 2eae6: ee 0f add r30, r30 2eae8: ff 1f adc r31, r31 2eaea: e0 5e subi r30, 0xE0 ; 224 2eaec: f0 46 sbci r31, 0x60 ; 96 2eaee: 85 91 lpm r24, Z+ 2eaf0: 94 91 lpm r25, Z 2eaf2: 02 96 adiw r24, 0x02 ; 2 2eaf4: 0f 94 c0 4e call 0x29d80 ; 0x29d80 if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 2eaf8: c1 30 cpi r28, 0x01 ; 1 2eafa: d1 05 cpc r29, r1 2eafc: c1 f0 breq .+48 ; 0x2eb2e 2eafe: cc 30 cpi r28, 0x0C ; 12 2eb00: 80 e8 ldi r24, 0x80 ; 128 2eb02: d8 07 cpc r29, r24 2eb04: a1 f0 breq .+40 ; 0x2eb2e 2eb06: c9 32 cpi r28, 0x29 ; 41 2eb08: 80 e8 ldi r24, 0x80 ; 128 2eb0a: d8 07 cpc r29, r24 2eb0c: 81 f0 breq .+32 ; 0x2eb2e IncrementMMUFails(); 2eb0e: 0f 94 ee 4d call 0x29bdc ; 0x29bdc | (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 2eb12: ce 01 movw r24, r28 2eb14: 88 27 eor r24, r24 2eb16: 9e 77 andi r25, 0x7E ; 126 2eb18: 89 2b or r24, r25 2eb1a: 49 f0 breq .+18 ; 0x2eb2e /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 2eb1c: 80 91 07 13 lds r24, 0x1307 ; 0x801307 2eb20: 90 91 08 13 lds r25, 0x1308 ; 0x801308 2eb24: 01 96 adiw r24, 0x01 ; 1 2eb26: 90 93 08 13 sts 0x1308, r25 ; 0x801308 2eb2a: 80 93 07 13 sts 0x1307, r24 ; 0x801307 return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 2eb2e: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2eb32: 88 23 and r24, r24 2eb34: d9 f0 breq .+54 ; 0x2eb6c return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 2eb36: 11 e0 ldi r17, 0x01 ; 1 2eb38: 10 93 44 0d sts 0x0D44, r17 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 2eb3c: ce 01 movw r24, r28 2eb3e: 0f 94 62 51 call 0x2a2c4 ; 0x2a2c4 2eb42: 8f 3f cpi r24, 0xFF ; 255 2eb44: 99 f0 breq .+38 ; 0x2eb6c void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 2eb46: 10 93 e7 12 sts 0x12E7, r17 ; 0x8012e7 logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 2eb4a: 8d e0 ldi r24, 0x0D ; 13 2eb4c: 9f e9 ldi r25, 0x9F ; 159 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 2eb4e: df 91 pop r29 2eb50: cf 91 pop r28 2eb52: 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"); 2eb54: 0c 94 8d 7c jmp 0xf91a ; 0xf91a // 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; 2eb58: 10 92 04 13 sts 0x1304, r1 ; 0x801304 float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 2eb5c: 0f 94 84 4c call 0x29908 ; 0x29908 // 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; 2eb60: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 2eb64: ae cf rjmp .-164 ; 0x2eac2 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; 2eb66: 10 92 03 13 sts 0x1303, r1 ; 0x801303 2eb6a: f8 cf rjmp .-16 ; 0x2eb5c 2eb6c: 10 92 e7 12 sts 0x12E7, r1 ; 0x8012e7 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2eb70: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.452> 2eb74: 81 11 cpse r24, r1 2eb76: 06 c0 rjmp .+12 ; 0x2eb84 2eb78: 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"); } 2eb7a: df 91 pop r29 2eb7c: cf 91 pop r28 2eb7e: 1f 91 pop r17 2eb80: 0d 94 28 50 jmp 0x2a050 ; 0x2a050 2eb84: df 91 pop r29 2eb86: cf 91 pop r28 2eb88: 1f 91 pop r17 2eb8a: 08 95 ret 0002eb8c : * \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) { 2eb8c: 2f 92 push r2 2eb8e: 3f 92 push r3 2eb90: 4f 92 push r4 2eb92: 5f 92 push r5 2eb94: 6f 92 push r6 2eb96: 7f 92 push r7 2eb98: 8f 92 push r8 2eb9a: 9f 92 push r9 2eb9c: af 92 push r10 2eb9e: bf 92 push r11 2eba0: cf 92 push r12 2eba2: df 92 push r13 2eba4: ef 92 push r14 2eba6: ff 92 push r15 2eba8: 0f 93 push r16 2ebaa: 1f 93 push r17 2ebac: cf 93 push r28 2ebae: df 93 push r29 2ebb0: 00 d0 rcall .+0 ; 0x2ebb2 2ebb2: 1f 92 push r1 2ebb4: cd b7 in r28, 0x3d ; 61 2ebb6: de b7 in r29, 0x3e ; 62 2ebb8: 5c 01 movw r10, r24 2ebba: 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; 2ebbc: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2ebc0: 81 30 cpi r24, 0x01 ; 1 2ebc2: 09 f0 breq .+2 ; 0x2ebc6 2ebc4: de c0 rjmp .+444 ; 0x2ed82 2ebc6: 80 91 68 16 lds r24, 0x1668 ; 0x801668 2ebca: 81 ff sbrs r24, 1 2ebcc: da c0 rjmp .+436 ; 0x2ed82 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 2ebce: 82 fd sbrc r24, 2 2ebd0: bc c0 rjmp .+376 ; 0x2ed4a * \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) { 2ebd2: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2ebd4: 21 2c mov r2, r1 2ebd6: 32 e0 ldi r19, 0x02 ; 2 2ebd8: 33 2e mov r3, r19 2ebda: 00 91 6f 16 lds r16, 0x166F ; 0x80166f 2ebde: 10 91 70 16 lds r17, 0x1670 ; 0x801670 2ebe2: 20 91 71 16 lds r18, 0x1671 ; 0x801671 2ebe6: 30 91 72 16 lds r19, 0x1672 ; 0x801672 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 2ebea: e1 14 cp r14, r1 2ebec: f1 04 cpc r15, r1 2ebee: 09 f4 brne .+2 ; 0x2ebf2 2ebf0: 30 c1 rjmp .+608 ; 0x2ee52 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 2ebf2: 80 91 80 16 lds r24, 0x1680 ; 0x801680 2ebf6: 90 91 81 16 lds r25, 0x1681 ; 0x801681 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);} 2ebfa: dc 01 movw r26, r24 2ebfc: 14 96 adiw r26, 0x04 ; 4 2ebfe: 7c 90 ld r7, X 2ec00: 7a 94 dec r7 2ec02: b9 01 movw r22, r18 2ec04: a8 01 movw r20, r16 2ec06: 29 e0 ldi r18, 0x09 ; 9 2ec08: 76 95 lsr r23 2ec0a: 67 95 ror r22 2ec0c: 57 95 ror r21 2ec0e: 47 95 ror r20 2ec10: 2a 95 dec r18 2ec12: d1 f7 brne .-12 ; 0x2ec08 2ec14: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 2ec16: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 2ec18: 71 10 cpse r7, r1 2ec1a: 25 c0 rjmp .+74 ; 0x2ec66 2ec1c: 01 15 cp r16, r1 2ec1e: 11 05 cpc r17, r1 2ec20: 11 f5 brne .+68 ; 0x2ec66 2ec22: 40 91 6b 16 lds r20, 0x166B ; 0x80166b 2ec26: 50 91 6c 16 lds r21, 0x166C ; 0x80166c 2ec2a: 60 91 6d 16 lds r22, 0x166D ; 0x80166d 2ec2e: 70 91 6e 16 lds r23, 0x166E ; 0x80166e // start of new cluster if (curCluster_ == 0) { 2ec32: 41 15 cp r20, r1 2ec34: 51 05 cpc r21, r1 2ec36: 61 05 cpc r22, r1 2ec38: 71 05 cpc r23, r1 2ec3a: 09 f0 breq .+2 ; 0x2ec3e 2ec3c: a8 c0 rjmp .+336 ; 0x2ed8e if (firstCluster_ == 0) { 2ec3e: 80 91 7c 16 lds r24, 0x167C ; 0x80167c 2ec42: 90 91 7d 16 lds r25, 0x167D ; 0x80167d 2ec46: a0 91 7e 16 lds r26, 0x167E ; 0x80167e 2ec4a: b0 91 7f 16 lds r27, 0x167F ; 0x80167f 2ec4e: 00 97 sbiw r24, 0x00 ; 0 2ec50: a1 05 cpc r26, r1 2ec52: b1 05 cpc r27, r1 2ec54: 09 f0 breq .+2 ; 0x2ec58 2ec56: b4 c0 rjmp .+360 ; 0x2edc0 } 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; 2ec58: 87 e6 ldi r24, 0x67 ; 103 2ec5a: 96 e1 ldi r25, 0x16 ; 22 2ec5c: 0f 94 28 2b call 0x25650 ; 0x25650 2ec60: 88 23 and r24, r24 2ec62: 09 f4 brne .+2 ; 0x2ec66 2ec64: 8e c0 rjmp .+284 ; 0x2ed82 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2ec66: c1 01 movw r24, r2 2ec68: 80 1b sub r24, r16 2ec6a: 91 0b sbc r25, r17 2ec6c: 67 01 movw r12, r14 2ec6e: 8e 15 cp r24, r14 2ec70: 9f 05 cpc r25, r15 2ec72: 08 f4 brcc .+2 ; 0x2ec76 2ec74: 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; 2ec76: e0 91 80 16 lds r30, 0x1680 ; 0x801680 2ec7a: f0 91 81 16 lds r31, 0x1681 ; 0x801681 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2ec7e: 80 91 6b 16 lds r24, 0x166B ; 0x80166b 2ec82: 90 91 6c 16 lds r25, 0x166C ; 0x80166c 2ec86: a0 91 6d 16 lds r26, 0x166D ; 0x80166d 2ec8a: b0 91 6e 16 lds r27, 0x166E ; 0x80166e 2ec8e: 02 97 sbiw r24, 0x02 ; 2 2ec90: a1 09 sbc r26, r1 2ec92: b1 09 sbc r27, r1 2ec94: 25 85 ldd r18, Z+13 ; 0x0d 2ec96: 04 c0 rjmp .+8 ; 0x2eca0 2ec98: 88 0f add r24, r24 2ec9a: 99 1f adc r25, r25 2ec9c: aa 1f adc r26, r26 2ec9e: bb 1f adc r27, r27 2eca0: 2a 95 dec r18 2eca2: d2 f7 brpl .-12 ; 0x2ec98 2eca4: 46 85 ldd r20, Z+14 ; 0x0e 2eca6: 57 85 ldd r21, Z+15 ; 0x0f 2eca8: 60 89 ldd r22, Z+16 ; 0x10 2ecaa: 71 89 ldd r23, Z+17 ; 0x11 2ecac: 84 0f add r24, r20 2ecae: 95 1f adc r25, r21 2ecb0: a6 1f adc r26, r22 2ecb2: b7 1f adc r27, r23 2ecb4: 9c 01 movw r18, r24 2ecb6: ad 01 movw r20, r26 2ecb8: 27 0d add r18, r7 2ecba: 31 1d adc r19, r1 2ecbc: 41 1d adc r20, r1 2ecbe: 51 1d adc r21, r1 2ecc0: 29 01 movw r4, r18 2ecc2: 3a 01 movw r6, r20 if (n == 512) { 2ecc4: c1 14 cp r12, r1 2ecc6: 32 e0 ldi r19, 0x02 ; 2 2ecc8: d3 06 cpc r13, r19 2ecca: 09 f0 breq .+2 ; 0x2ecce 2eccc: 8a c0 rjmp .+276 ; 0x2ede2 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 2ecce: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 2ecd2: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 2ecd6: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 2ecda: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 2ecde: 48 16 cp r4, r24 2ece0: 59 06 cpc r5, r25 2ece2: 6a 06 cpc r6, r26 2ece4: 7b 06 cpc r7, r27 2ece6: 69 f4 brne .+26 ; 0x2ed02 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; 2ece8: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 cacheBlockNumber_ = blockNumber; 2ecec: 8f ef ldi r24, 0xFF ; 255 2ecee: 9f ef ldi r25, 0xFF ; 255 2ecf0: dc 01 movw r26, r24 2ecf2: 80 93 3a 0e sts 0x0E3A, r24 ; 0x800e3a 2ecf6: 90 93 3b 0e sts 0x0E3B, r25 ; 0x800e3b 2ecfa: a0 93 3c 0e sts 0x0E3C, r26 ; 0x800e3c 2ecfe: b0 93 3d 0e sts 0x0E3D, r27 ; 0x800e3d 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); 2ed02: 95 01 movw r18, r10 2ed04: b3 01 movw r22, r6 2ed06: a2 01 movw r20, r4 2ed08: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 2ed0c: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 2ed10: 0f 94 b3 26 call 0x24d66 ; 0x24d66 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 2ed14: 88 23 and r24, r24 2ed16: a9 f1 breq .+106 ; 0x2ed82 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 2ed18: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 2ed1c: 90 91 70 16 lds r25, 0x1670 ; 0x801670 2ed20: a0 91 71 16 lds r26, 0x1671 ; 0x801671 2ed24: b0 91 72 16 lds r27, 0x1672 ; 0x801672 2ed28: 8c 0d add r24, r12 2ed2a: 9d 1d adc r25, r13 2ed2c: a1 1d adc r26, r1 2ed2e: b1 1d adc r27, r1 2ed30: 80 93 6f 16 sts 0x166F, r24 ; 0x80166f 2ed34: 90 93 70 16 sts 0x1670, r25 ; 0x801670 2ed38: a0 93 71 16 sts 0x1671, r26 ; 0x801671 2ed3c: b0 93 72 16 sts 0x1672, r27 ; 0x801672 src += n; 2ed40: ac 0c add r10, r12 2ed42: bd 1c adc r11, r13 nToWrite -= n; 2ed44: ec 18 sub r14, r12 2ed46: fd 08 sbc r15, r13 2ed48: 48 cf rjmp .-368 ; 0x2ebda // 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_) { 2ed4a: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2ed4e: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2ed52: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2ed56: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2ed5a: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 2ed5e: 90 91 70 16 lds r25, 0x1670 ; 0x801670 2ed62: a0 91 71 16 lds r26, 0x1671 ; 0x801671 2ed66: b0 91 72 16 lds r27, 0x1672 ; 0x801672 2ed6a: 48 17 cp r20, r24 2ed6c: 59 07 cpc r21, r25 2ed6e: 6a 07 cpc r22, r26 2ed70: 7b 07 cpc r23, r27 2ed72: 09 f4 brne .+2 ; 0x2ed76 2ed74: 2e cf rjmp .-420 ; 0x2ebd2 } /** 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);} 2ed76: 87 e6 ldi r24, 0x67 ; 103 2ed78: 96 e1 ldi r25, 0x16 ; 22 2ed7a: 0f 94 94 2a call 0x25528 ; 0x25528 if (!seekEnd()) goto fail; 2ed7e: 81 11 cpse r24, r1 2ed80: 28 cf rjmp .-432 ; 0x2ebd2 } return nbyte; fail: // return for write error writeError = true; 2ed82: 81 e0 ldi r24, 0x01 ; 1 2ed84: 80 93 67 16 sts 0x1667, r24 ; 0x801667 return -1; 2ed88: 8f ef ldi r24, 0xFF ; 255 2ed8a: 9f ef ldi r25, 0xFF ; 255 2ed8c: 81 c0 rjmp .+258 ; 0x2ee90 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 2ed8e: 9e 01 movw r18, r28 2ed90: 2f 5f subi r18, 0xFF ; 255 2ed92: 3f 4f sbci r19, 0xFF ; 255 2ed94: 0f 94 de 28 call 0x251bc ; 0x251bc 2ed98: 88 23 and r24, r24 2ed9a: 99 f3 breq .-26 ; 0x2ed82 if (vol_->isEOC(next)) { 2ed9c: 89 81 ldd r24, Y+1 ; 0x01 2ed9e: 9a 81 ldd r25, Y+2 ; 0x02 2eda0: ab 81 ldd r26, Y+3 ; 0x03 2eda2: 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; 2eda4: e0 91 80 16 lds r30, 0x1680 ; 0x801680 2eda8: f0 91 81 16 lds r31, 0x1681 ; 0x801681 2edac: 27 89 ldd r18, Z+23 ; 0x17 2edae: 20 31 cpi r18, 0x10 ; 16 2edb0: 81 f4 brne .+32 ; 0x2edd2 2edb2: 88 3f cpi r24, 0xF8 ; 248 2edb4: ef ef ldi r30, 0xFF ; 255 2edb6: 9e 07 cpc r25, r30 2edb8: a1 05 cpc r26, r1 2edba: b1 05 cpc r27, r1 2edbc: 08 f0 brcs .+2 ; 0x2edc0 2edbe: 4c cf rjmp .-360 ; 0x2ec58 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 2edc0: 80 93 6b 16 sts 0x166B, r24 ; 0x80166b 2edc4: 90 93 6c 16 sts 0x166C, r25 ; 0x80166c 2edc8: a0 93 6d 16 sts 0x166D, r26 ; 0x80166d 2edcc: b0 93 6e 16 sts 0x166E, r27 ; 0x80166e 2edd0: 4a cf rjmp .-364 ; 0x2ec66 return cluster >= FAT32EOC_MIN; 2edd2: 88 3f cpi r24, 0xF8 ; 248 2edd4: ff ef ldi r31, 0xFF ; 255 2edd6: 9f 07 cpc r25, r31 2edd8: af 07 cpc r26, r31 2edda: ff e0 ldi r31, 0x0F ; 15 2eddc: bf 07 cpc r27, r31 2edde: 80 f3 brcs .-32 ; 0x2edc0 2ede0: 3b cf rjmp .-394 ; 0x2ec58 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 2ede2: 01 15 cp r16, r1 2ede4: 11 05 cpc r17, r1 2ede6: 69 f5 brne .+90 ; 0x2ee42 2ede8: 40 91 6f 16 lds r20, 0x166F ; 0x80166f 2edec: 50 91 70 16 lds r21, 0x1670 ; 0x801670 2edf0: 60 91 71 16 lds r22, 0x1671 ; 0x801671 2edf4: 70 91 72 16 lds r23, 0x1672 ; 0x801672 2edf8: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2edfc: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2ee00: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2ee04: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2ee08: 48 17 cp r20, r24 2ee0a: 59 07 cpc r21, r25 2ee0c: 6a 07 cpc r22, r26 2ee0e: 7b 07 cpc r23, r27 2ee10: c0 f0 brcs .+48 ; 0x2ee42 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 2ee12: 0f 94 17 27 call 0x24e2e ; 0x24e2e 2ee16: 88 23 and r24, r24 2ee18: 09 f4 brne .+2 ; 0x2ee1c 2ee1a: b3 cf rjmp .-154 ; 0x2ed82 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; 2ee1c: 81 e0 ldi r24, 0x01 ; 1 2ee1e: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 cacheBlockNumber_ = blockNumber; 2ee22: 40 92 3a 0e sts 0x0E3A, r4 ; 0x800e3a 2ee26: 50 92 3b 0e sts 0x0E3B, r5 ; 0x800e3b 2ee2a: 60 92 3c 0e sts 0x0E3C, r6 ; 0x800e3c 2ee2e: 70 92 3d 0e sts 0x0E3D, r7 ; 0x800e3d } 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); 2ee32: a6 01 movw r20, r12 2ee34: b5 01 movw r22, r10 2ee36: c8 01 movw r24, r16 2ee38: 8a 5b subi r24, 0xBA ; 186 2ee3a: 91 4f sbci r25, 0xF1 ; 241 2ee3c: 0f 94 c6 a9 call 0x3538c ; 0x3538c 2ee40: 6b cf rjmp .-298 ; 0x2ed18 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; 2ee42: 41 e0 ldi r20, 0x01 ; 1 2ee44: c3 01 movw r24, r6 2ee46: b2 01 movw r22, r4 2ee48: 0f 94 0f 28 call 0x2501e ; 0x2501e 2ee4c: 81 11 cpse r24, r1 2ee4e: f1 cf rjmp .-30 ; 0x2ee32 2ee50: 98 cf rjmp .-208 ; 0x2ed82 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 2ee52: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2ee56: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2ee5a: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2ee5e: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2ee62: 80 17 cp r24, r16 2ee64: 91 07 cpc r25, r17 2ee66: a2 07 cpc r26, r18 2ee68: b3 07 cpc r27, r19 2ee6a: 68 f4 brcc .+26 ; 0x2ee86 2ee6c: 80 91 68 16 lds r24, 0x1668 ; 0x801668 // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 2ee70: 00 93 78 16 sts 0x1678, r16 ; 0x801678 2ee74: 10 93 79 16 sts 0x1679, r17 ; 0x801679 2ee78: 20 93 7a 16 sts 0x167A, r18 ; 0x80167a 2ee7c: 30 93 7b 16 sts 0x167B, r19 ; 0x80167b flags_ |= F_FILE_DIR_DIRTY; 2ee80: 80 68 ori r24, 0x80 ; 128 2ee82: 80 93 68 16 sts 0x1668, r24 ; 0x801668 } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 2ee86: 80 91 68 16 lds r24, 0x1668 ; 0x801668 2ee8a: 83 fd sbrc r24, 3 2ee8c: 18 c0 rjmp .+48 ; 0x2eebe if (!sync()) goto fail; } return nbyte; 2ee8e: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 2ee90: 0f 90 pop r0 2ee92: 0f 90 pop r0 2ee94: 0f 90 pop r0 2ee96: 0f 90 pop r0 2ee98: df 91 pop r29 2ee9a: cf 91 pop r28 2ee9c: 1f 91 pop r17 2ee9e: 0f 91 pop r16 2eea0: ff 90 pop r15 2eea2: ef 90 pop r14 2eea4: df 90 pop r13 2eea6: cf 90 pop r12 2eea8: bf 90 pop r11 2eeaa: af 90 pop r10 2eeac: 9f 90 pop r9 2eeae: 8f 90 pop r8 2eeb0: 7f 90 pop r7 2eeb2: 6f 90 pop r6 2eeb4: 5f 90 pop r5 2eeb6: 4f 90 pop r4 2eeb8: 3f 90 pop r3 2eeba: 2f 90 pop r2 2eebc: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 2eebe: 87 e6 ldi r24, 0x67 ; 103 2eec0: 96 e1 ldi r25, 0x16 ; 22 2eec2: 0f 94 3d 2c call 0x2587a ; 0x2587a 2eec6: 81 11 cpse r24, r1 2eec8: e2 cf rjmp .-60 ; 0x2ee8e 2eeca: 5b cf rjmp .-330 ; 0x2ed82 0002eecc : #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) { 2eecc: 0f 93 push r16 2eece: cf 93 push r28 2eed0: df 93 push r29 2eed2: cd b7 in r28, 0x3d ; 61 2eed4: de b7 in r29, 0x3e ; 62 2eed6: a3 97 sbiw r28, 0x23 ; 35 2eed8: 0f b6 in r0, 0x3f ; 63 2eeda: f8 94 cli 2eedc: de bf out 0x3e, r29 ; 62 2eede: 0f be out 0x3f, r0 ; 63 2eee0: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 2eee2: 20 91 78 15 lds r18, 0x1578 ; 0x801578 2eee6: 30 91 79 15 lds r19, 0x1579 ; 0x801579 2eeea: 82 17 cp r24, r18 2eeec: 93 07 cpc r25, r19 2eeee: d8 f4 brcc .+54 ; 0x2ef26 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 2eef0: 61 30 cpi r22, 0x01 ; 1 2eef2: 31 f4 brne .+12 ; 0x2ef00 2eef4: 21 50 subi r18, 0x01 ; 1 2eef6: 31 09 sbc r19, r1 2eef8: a9 01 movw r20, r18 2eefa: 48 1b sub r20, r24 2eefc: 59 0b sbc r21, r25 2eefe: ca 01 movw r24, r20 2ef00: 88 0f add r24, r24 2ef02: 99 1f adc r25, r25 2ef04: fc 01 movw r30, r24 2ef06: e6 58 subi r30, 0x86 ; 134 2ef08: fa 4e sbci r31, 0xEA ; 234 2ef0a: 80 81 ld r24, Z 2ef0c: 91 81 ldd r25, Z+1 ; 0x01 2ef0e: 0f 94 d1 6b call 0x2d7a2 ; 0x2d7a2 else getfilename_afterMaxSorting(nr); } 2ef12: a3 96 adiw r28, 0x23 ; 35 2ef14: 0f b6 in r0, 0x3f ; 63 2ef16: f8 94 cli 2ef18: de bf out 0x3e, r29 ; 62 2ef1a: 0f be out 0x3f, r0 ; 63 2ef1c: cd bf out 0x3d, r28 ; 61 2ef1e: df 91 pop r29 2ef20: cf 91 pop r28 2ef22: 0f 91 pop r16 2ef24: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 2ef26: 42 e8 ldi r20, 0x82 ; 130 2ef28: 54 e1 ldi r21, 0x14 ; 20 2ef2a: 50 93 81 14 sts 0x1481, r21 ; 0x801481 2ef2e: 40 93 80 14 sts 0x1480, r20 ; 0x801480 nrFiles = entry - sort_count + 1; 2ef32: 82 1b sub r24, r18 2ef34: 93 0b sbc r25, r19 2ef36: 01 96 adiw r24, 0x01 ; 1 2ef38: 90 93 f0 16 sts 0x16F0, r25 ; 0x8016f0 2ef3c: 80 93 ef 16 sts 0x16EF, r24 ; 0x8016ef curDir->seekSet(lastSortedFilePosition << 5); 2ef40: 40 91 42 16 lds r20, 0x1642 ; 0x801642 2ef44: 50 91 43 16 lds r21, 0x1643 ; 0x801643 2ef48: 85 e0 ldi r24, 0x05 ; 5 2ef4a: 44 0f add r20, r20 2ef4c: 55 1f adc r21, r21 2ef4e: 8a 95 dec r24 2ef50: e1 f7 brne .-8 ; 0x2ef4a 2ef52: 70 e0 ldi r23, 0x00 ; 0 2ef54: 60 e0 ldi r22, 0x00 ; 0 2ef56: 82 e8 ldi r24, 0x82 ; 130 2ef58: 94 e1 ldi r25, 0x14 ; 20 2ef5a: 0f 94 94 2a call 0x25528 ; 0x25528 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2ef5e: 00 e0 ldi r16, 0x00 ; 0 2ef60: 0e 7f andi r16, 0xFE ; 254 2ef62: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2ef64: e0 91 80 14 lds r30, 0x1480 ; 0x801480 2ef68: f0 91 81 14 lds r31, 0x1481 ; 0x801481 2ef6c: 83 e2 ldi r24, 0x23 ; 35 2ef6e: de 01 movw r26, r28 2ef70: 11 96 adiw r26, 0x01 ; 1 2ef72: 01 90 ld r0, Z+ 2ef74: 0d 92 st X+, r0 2ef76: 8a 95 dec r24 2ef78: e1 f7 brne .-8 ; 0x2ef72 2ef7a: 22 e0 ldi r18, 0x02 ; 2 2ef7c: 50 e0 ldi r21, 0x00 ; 0 2ef7e: 40 e0 ldi r20, 0x00 ; 0 2ef80: be 01 movw r22, r28 2ef82: 6f 5f subi r22, 0xFF ; 255 2ef84: 7f 4f sbci r23, 0xFF ; 255 2ef86: 8f ed ldi r24, 0xDF ; 223 2ef88: 92 e0 ldi r25, 0x02 ; 2 2ef8a: 0f 94 5b 69 call 0x2d2b6 ; 0x2d2b6 2ef8e: ce 01 movw r24, r28 2ef90: 01 96 adiw r24, 0x01 ; 1 2ef92: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 2ef96: bd cf rjmp .-134 ; 0x2ef12 0002ef98 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 2ef98: 0f 93 push r16 2ef9a: 1f 93 push r17 2ef9c: cf 93 push r28 2ef9e: df 93 push r29 2efa0: 1f 92 push r1 2efa2: 1f 92 push r1 2efa4: cd b7 in r28, 0x3d ; 61 2efa6: de b7 in r29, 0x3e ; 62 { if(!mounted) 2efa8: 20 91 d8 13 lds r18, 0x13D8 ; 0x8013d8 2efac: 22 23 and r18, r18 2efae: 69 f1 breq .+90 ; 0x2f00a 2efb0: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2efb2: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2efb6: 88 23 and r24, r24 2efb8: 79 f1 breq .+94 ; 0x2f018 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 2efba: 84 e3 ldi r24, 0x34 ; 52 2efbc: 9e e9 ldi r25, 0x9E ; 158 2efbe: 0e 94 8d 7c call 0xf91a ; 0xf91a 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; 2efc2: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 2efc6: 1a 83 std Y+2, r17 ; 0x02 2efc8: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 2efca: ce 01 movw r24, r28 2efcc: 01 96 adiw r24, 0x01 ; 1 2efce: 0f 94 2b 71 call 0x2e256 ; 0x2e256 2efd2: 88 23 and r24, r24 2efd4: d1 f0 breq .+52 ; 0x2f00a return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 2efd6: 49 81 ldd r20, Y+1 ; 0x01 2efd8: 5a 81 ldd r21, Y+2 ; 0x02 2efda: 60 91 80 14 lds r22, 0x1480 ; 0x801480 2efde: 70 91 81 14 lds r23, 0x1481 ; 0x801481 2efe2: 26 e5 ldi r18, 0x56 ; 86 2efe4: 87 e6 ldi r24, 0x67 ; 103 2efe6: 96 e1 ldi r25, 0x16 ; 22 2efe8: 0f 94 9d 54 call 0x2a93a ; 0x2a93a 2efec: 81 11 cpse r24, r1 2efee: 22 c0 rjmp .+68 ; 0x2f034 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2eff0: 84 e3 ldi r24, 0x34 ; 52 2eff2: 9c e6 ldi r25, 0x6C ; 108 2eff4: 0e 94 94 7a call 0xf528 ; 0xf528 2eff8: 89 81 ldd r24, Y+1 ; 0x01 2effa: 9a 81 ldd r25, Y+2 ; 0x02 2effc: 0e 94 86 85 call 0x10b0c ; 0x10b0c 2f000: 8e e2 ldi r24, 0x2E ; 46 2f002: 0e 94 81 79 call 0xf302 ; 0xf302 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2f006: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 2f00a: 0f 90 pop r0 2f00c: 0f 90 pop r0 2f00e: df 91 pop r29 2f010: cf 91 pop r28 2f012: 1f 91 pop r17 2f014: 0f 91 pop r16 2f016: 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 2f018: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a SERIAL_ECHO_START; 2f01c: 8e ec ldi r24, 0xCE ; 206 2f01e: 91 ea ldi r25, 0xA1 ; 161 2f020: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHORPGM(ofNowFreshFile); 2f024: 8c e4 ldi r24, 0x4C ; 76 2f026: 90 ea ldi r25, 0xA0 ; 160 2f028: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN(name); 2f02c: c8 01 movw r24, r16 2f02e: 0e 94 92 85 call 0x10b24 ; 0x10b24 2f032: c7 cf rjmp .-114 ; 0x2efc2 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; 2f034: 81 e0 ldi r24, 0x01 ; 1 2f036: 80 93 d5 13 sts 0x13D5, r24 ; 0x8013d5 getfilename(0, fname); 2f03a: 89 81 ldd r24, Y+1 ; 0x01 2f03c: 9a 81 ldd r25, Y+2 ; 0x02 2f03e: 0f 94 8a 6b call 0x2d714 ; 0x2d714 SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 2f042: 82 e2 ldi r24, 0x22 ; 34 2f044: 9e e9 ldi r25, 0x9E ; 158 2f046: 0e 94 94 7a call 0xf528 ; 0xf528 printAbsFilenameFast(); 2f04a: 0f 94 6d 6c call 0x2d8da ; 0x2d8da SERIAL_PROTOCOLLN(); 2f04e: 0e 94 8c 7a call 0xf518 ; 0xf518 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2f052: 88 e2 ldi r24, 0x28 ; 40 2f054: 90 ea ldi r25, 0xA0 ; 160 2f056: 0e 94 8d 7c call 0xf91a ; 0xf91a lcd_setstatuspgm(ofFileSelected); 2f05a: 88 e2 ldi r24, 0x28 ; 40 2f05c: 90 ea ldi r25, 0xA0 ; 160 2f05e: 0e 94 85 dc call 0x1b90a ; 0x1b90a scrollstuff = 0; 2f062: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 2f066: d1 cf rjmp .-94 ; 0x2f00a 0002f068 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 2f068: 0f 93 push r16 2f06a: 1f 93 push r17 2f06c: cf 93 push r28 2f06e: df 93 push r29 2f070: ec 01 movw r28, r24 { memset(ip, 0, 4); 2f072: 84 e0 ldi r24, 0x04 ; 4 2f074: fe 01 movw r30, r28 2f076: 11 92 st Z+, r1 2f078: 8a 95 dec r24 2f07a: e9 f7 brne .-6 ; 0x2f076 /** 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 2f07c: 23 e0 ldi r18, 0x03 ; 3 2f07e: 30 ea ldi r19, 0xA0 ; 160 2f080: 4a e0 ldi r20, 0x0A ; 10 2f082: 50 e9 ldi r21, 0x90 ; 144 2f084: 60 e3 ldi r22, 0x30 ; 48 2f086: 84 e4 ldi r24, 0x44 ; 68 2f088: 96 e1 ldi r25, 0x16 ; 22 2f08a: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 2f08e: 88 23 and r24, r24 2f090: 91 f0 breq .+36 ; 0x2f0b6 2f092: 23 e0 ldi r18, 0x03 ; 3 2f094: 30 ea ldi r19, 0xA0 ; 160 2f096: 4a e0 ldi r20, 0x0A ; 10 2f098: 50 e9 ldi r21, 0x90 ; 144 2f09a: 61 e1 ldi r22, 0x11 ; 17 2f09c: 84 e4 ldi r24, 0x44 ; 68 2f09e: 96 e1 ldi r25, 0x16 ; 22 2f0a0: 0f 94 5a 26 call 0x24cb4 ; 0x24cb4 2f0a4: 88 23 and r24, r24 2f0a6: 39 f0 breq .+14 ; 0x2f0b6 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2f0a8: 80 e8 ldi r24, 0x80 ; 128 2f0aa: 80 93 44 16 sts 0x1644, r24 ; 0x801644 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 2f0ae: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 return false; 2f0b2: 80 e0 ldi r24, 0x00 ; 0 2f0b4: 2f c0 rjmp .+94 ; 0x2f114 //------------------------------------------------------------------------------ /** 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(); 2f0b6: 0f 94 56 0b call 0x216ac ; 0x216ac 2f0ba: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2f0bc: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2f0c0: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2f0c4: 8f 3f cpi r24, 0xFF ; 255 2f0c6: 69 f4 brne .+26 ; 0x2f0e2 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2f0c8: 0f 94 56 0b call 0x216ac ; 0x216ac 2f0cc: 60 1b sub r22, r16 2f0ce: 71 0b sbc r23, r17 2f0d0: 6d 32 cpi r22, 0x2D ; 45 2f0d2: 71 40 sbci r23, 0x01 ; 1 2f0d4: 98 f3 brcs .-26 ; 0x2f0bc 2f0d6: 81 e1 ldi r24, 0x11 ; 17 2f0d8: 80 93 44 16 sts 0x1644, r24 ; 0x801644 goto fail; } return true; fail: chipSelectHigh(); 2f0dc: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 2f0e0: e6 cf rjmp .-52 ; 0x2f0ae if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2f0e2: 8e 3f cpi r24, 0xFE ; 254 2f0e4: 11 f0 breq .+4 ; 0x2f0ea 2f0e6: 8f e0 ldi r24, 0x0F ; 15 2f0e8: f7 cf rjmp .-18 ; 0x2f0d8 2f0ea: 8e 01 movw r16, r28 2f0ec: 0c 5f subi r16, 0xFC ; 252 2f0ee: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 2f0f0: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2f0f4: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 2f0f6: c0 17 cp r28, r16 2f0f8: d1 07 cpc r29, r17 2f0fa: d1 f7 brne .-12 ; 0x2f0f0 2f0fc: ce ef ldi r28, 0xFE ; 254 2f0fe: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 2f100: 0f 94 53 26 call 0x24ca6 ; 0x24ca6 2f104: 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) { 2f106: e1 f7 brne .-8 ; 0x2f100 spiRec(); } chipSelectHigh(); 2f108: 0f 94 b4 65 call 0x2cb68 ; 0x2cb68 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 2f10c: 8f ef ldi r24, 0xFF ; 255 2f10e: 0f 94 4e 26 call 0x24c9c ; 0x24c9c 2f112: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 2f114: df 91 pop r29 2f116: cf 91 pop r28 2f118: 1f 91 pop r17 2f11a: 0f 91 pop r16 2f11c: 08 95 ret 0002f11e : } 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) 2f11e: cf 92 push r12 2f120: df 92 push r13 2f122: ef 92 push r14 2f124: ff 92 push r15 2f126: 0f 93 push r16 2f128: 1f 93 push r17 2f12a: cf 93 push r28 2f12c: df 93 push r29 2f12e: ec 01 movw r28, r24 2f130: 8b 01 movw r16, r22 2f132: e4 2e mov r14, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) XFLASH_SPI_ENTER(); #endif while (count) 2f134: 01 15 cp r16, r1 2f136: 11 05 cpc r17, r1 2f138: 09 f4 brne .+2 ; 0x2f13c 2f13a: 41 c0 rjmp .+130 ; 0x2f1be void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); #endif print_hex_byte((val >> 8) & 0xFF); 2f13c: 8d 2f mov r24, r29 2f13e: 0e 94 c8 78 call 0xf190 ; 0xf190 print_hex_byte(val & 0xFF); 2f142: 8c 2f mov r24, r28 2f144: 0e 94 c8 78 call 0xf190 ; 0xf190 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 2f148: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f14c: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f150: 80 e2 ldi r24, 0x20 ; 32 2f152: 90 e0 ldi r25, 0x00 ; 0 2f154: 0f 94 05 a2 call 0x3440a ; 0x3440a 2f158: 6e 01 movw r12, r28 2f15a: 80 e1 ldi r24, 0x10 ; 16 2f15c: c8 0e add r12, r24 2f15e: d1 1c adc r13, r1 uint8_t count_line = countperline; while (count && count_line) { uint8_t data = 0; switch (type) 2f160: 81 e0 ldi r24, 0x01 ; 1 2f162: e8 16 cp r14, r24 2f164: 39 f1 breq .+78 ; 0x2f1b4 { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 2f166: f8 80 ld r15, Y case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 2f168: 21 96 adiw r28, 0x01 ; 1 putchar(' '); 2f16a: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f16e: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f172: 80 e2 ldi r24, 0x20 ; 32 2f174: 90 e0 ldi r25, 0x00 ; 0 2f176: 0f 94 05 a2 call 0x3440a ; 0x3440a print_hex_byte(data); 2f17a: 8f 2d mov r24, r15 2f17c: 0e 94 c8 78 call 0xf190 ; 0xf190 count_line--; count--; 2f180: 01 50 subi r16, 0x01 ; 1 2f182: 11 09 sbc r17, 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)) 2f184: 0f b6 in r0, 0x3f ; 63 2f186: 07 fe sbrs r0, 7 2f188: 06 c0 rjmp .+12 ; 0x2f196 2f18a: c8 01 movw r24, r16 2f18c: 9f 71 andi r25, 0x1F ; 31 2f18e: 89 2b or r24, r25 2f190: 29 f4 brne .+10 ; 0x2f19c manage_heater(); 2f192: 0f 94 a5 37 call 0x26f4a ; 0x26f4a while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 2f196: 01 15 cp r16, r1 2f198: 11 05 cpc r17, r1 2f19a: 19 f0 breq .+6 ; 0x2f1a2 2f19c: cc 15 cp r28, r12 2f19e: dd 05 cpc r29, r13 2f1a0: f9 f6 brne .-66 ; 0x2f160 // 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'); 2f1a2: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f1a6: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f1aa: 8a e0 ldi r24, 0x0A ; 10 2f1ac: 90 e0 ldi r25, 0x00 ; 0 2f1ae: 0f 94 05 a2 call 0x3440a ; 0x3440a 2f1b2: c0 cf rjmp .-128 ; 0x2f134 { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 2f1b4: ce 01 movw r24, r28 2f1b6: 0f 94 9d a3 call 0x3473a ; 0x3473a 2f1ba: f8 2e mov r15, r24 2f1bc: d5 cf rjmp .-86 ; 0x2f168 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 2f1be: df 91 pop r29 2f1c0: cf 91 pop r28 2f1c2: 1f 91 pop r17 2f1c4: 0f 91 pop r16 2f1c6: ff 90 pop r15 2f1c8: ef 90 pop r14 2f1ca: df 90 pop r13 2f1cc: cf 90 pop r12 2f1ce: 08 95 ret 0002f1d0 : #include "planner.h" #include "temperature.h" #include "ultralcd.h" #ifdef FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { 2f1d0: cf 93 push r28 2f1d2: 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; 2f1d4: c1 ef ldi r28, 0xF1 ; 241 2f1d6: d6 e1 ldi r29, 0x16 ; 22 2f1d8: 1a 82 std Y+2, r1 ; 0x02 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2f1da: 19 82 std Y+1, r1 ; 0x01 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2f1dc: 1e 86 std Y+14, r1 ; 0x0e oldPos = pat9125_y; 2f1de: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 2f1e2: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 2f1e6: 98 8b std Y+16, r25 ; 0x10 2f1e8: 8f 87 std Y+15, r24 ; 0x0f resetStepCount(); 2f1ea: 0f 94 37 6d call 0x2da6e ; 0x2da6e jamErrCnt = 0; 2f1ee: 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"); } 2f1f0: df 91 pop r29 2f1f2: cf 91 pop r28 2f1f4: 08 95 ret 0002f1f6 : //! //! @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) 2f1f6: cf 92 push r12 2f1f8: df 92 push r13 2f1fa: ef 92 push r14 2f1fc: ff 92 push r15 2f1fe: 69 01 movw r12, r18 2f200: 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); 2f202: 2d ec ldi r18, 0xCD ; 205 2f204: 3c ec ldi r19, 0xCC ; 204 2f206: 4c e4 ldi r20, 0x4C ; 76 2f208: 5e e3 ldi r21, 0x3E ; 62 2f20a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2f20e: 2d ec ldi r18, 0xCD ; 205 2f210: 3c ec ldi r19, 0xCC ; 204 2f212: 4c e4 ldi r20, 0x4C ; 76 2f214: 5e e3 ldi r21, 0x3E ; 62 2f216: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f21a: 2d ef ldi r18, 0xFD ; 253 2f21c: 3d ea ldi r19, 0xAD ; 173 2f21e: 40 e0 ldi r20, 0x00 ; 0 2f220: 5d e3 ldi r21, 0x3D ; 61 2f222: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2f226: a7 01 movw r20, r14 2f228: 96 01 movw r18, r12 2f22a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f22e: 24 e2 ldi r18, 0x24 ; 36 2f230: 30 ef ldi r19, 0xF0 ; 240 2f232: 49 e1 ldi r20, 0x19 ; 25 2f234: 50 e4 ldi r21, 0x40 ; 64 2f236: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> } 2f23a: ff 90 pop r15 2f23c: ef 90 pop r14 2f23e: df 90 pop r13 2f240: cf 90 pop r12 2f242: 08 95 ret 0002f244 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 2f244: 9f b7 in r25, 0x3f ; 63 2f246: 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)); 2f248: 80 e1 ldi r24, 0x10 ; 16 2f24a: ec e3 ldi r30, 0x3C ; 60 2f24c: f6 e0 ldi r31, 0x06 ; 6 2f24e: ac e4 ldi r26, 0x4C ; 76 2f250: b6 e0 ldi r27, 0x06 ; 6 2f252: 01 90 ld r0, Z+ 2f254: 0d 92 st X+, r0 2f256: 8a 95 dec r24 2f258: e1 f7 brne .-8 ; 0x2f252 CRITICAL_SECTION_END; 2f25a: 9f bf out 0x3f, r25 ; 63 } 2f25c: 08 95 ret 0002f25e : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 2f25e: 89 e0 ldi r24, 0x09 ; 9 2f260: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d }; 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])) 2f264: ea e4 ldi r30, 0x4A ; 74 2f266: fe e9 ldi r31, 0x9E ; 158 2f268: 85 91 lpm r24, Z+ 2f26a: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2f26c: 0e 94 0a 75 call 0xea14 ; 0xea14 2f270: 0c 94 85 dc jmp 0x1b90a ; 0x1b90a 0002f274 : 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) { 2f274: 1f 93 push r17 2f276: cf 93 push r28 2f278: df 93 push r29 2f27a: ec 01 movw r28, r24 2f27c: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2f27e: 0f 94 b0 18 call 0x23160 ; 0x23160 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))); 2f282: fe 01 movw r30, r28 2f284: 34 96 adiw r30, 0x04 ; 4 2f286: 25 91 lpm r18, Z+ 2f288: 35 91 lpm r19, Z+ 2f28a: 45 91 lpm r20, Z+ 2f28c: 54 91 lpm r21, Z 2f28e: fe 01 movw r30, r28 2f290: 65 91 lpm r22, Z+ 2f292: 75 91 lpm r23, Z+ 2f294: 85 91 lpm r24, Z+ 2f296: 94 91 lpm r25, Z 2f298: 0f 94 9c 4e call 0x29d38 ; 0x29d38 step++; 2f29c: 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) { 2f29e: 11 50 subi r17, 0x01 ; 1 2f2a0: 81 f7 brne .-32 ; 0x2f282 2f2a2: 0f 94 b0 18 call 0x23160 ; 0x23160 // 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(); } 2f2a6: df 91 pop r29 2f2a8: cf 91 pop r28 2f2aa: 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(); 2f2ac: 0d 94 9a 4e jmp 0x29d34 ; 0x29d34 0002f2b0 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 2f2b0: 0e 94 10 66 call 0xcc20 ; 0xcc20 2f2b4: 81 11 cpse r24, r1 2f2b6: 04 c0 rjmp .+8 ; 0x2f2c0 lcd_setstatuspgm(MSG_WELCOME); 2f2b8: 86 ee ldi r24, 0xE6 ; 230 2f2ba: 9b e6 ldi r25, 0x6B ; 107 2f2bc: 0e 94 85 dc call 0x1b90a ; 0x1b90a } custom_message_type = CustomMsg::Status; 2f2c0: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } 2f2c4: 08 95 ret 0002f2c6 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 2f2c6: 80 91 01 13 lds r24, 0x1301 ; 0x801301 2f2ca: 88 23 and r24, r24 2f2cc: 11 f0 breq .+4 ; 0x2f2d2 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; 2f2ce: 81 e0 ldi r24, 0x01 ; 1 2f2d0: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 2f2d2: 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; } } 2f2d4: 08 95 ret 0002f2d6 : } #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) 2f2d6: 2f 92 push r2 2f2d8: 3f 92 push r3 2f2da: 4f 92 push r4 2f2dc: 5f 92 push r5 2f2de: 6f 92 push r6 2f2e0: 7f 92 push r7 2f2e2: 8f 92 push r8 2f2e4: 9f 92 push r9 2f2e6: af 92 push r10 2f2e8: bf 92 push r11 2f2ea: cf 92 push r12 2f2ec: df 92 push r13 2f2ee: ef 92 push r14 2f2f0: ff 92 push r15 2f2f2: 0f 93 push r16 2f2f4: 1f 93 push r17 2f2f6: cf 93 push r28 2f2f8: df 93 push r29 2f2fa: 00 d0 rcall .+0 ; 0x2f2fc 2f2fc: 00 d0 rcall .+0 ; 0x2f2fe 2f2fe: 00 d0 rcall .+0 ; 0x2f300 2f300: 1f 92 push r1 2f302: 1f 92 push r1 2f304: cd b7 in r28, 0x3d ; 61 2f306: de b7 in r29, 0x3e ; 62 2f308: 8b 83 std Y+3, r24 ; 0x03 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2f30a: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.388> 2f30e: 2d 83 std Y+5, r18 ; 0x05 check_endstops = check; 2f310: 81 e0 ldi r24, 0x01 ; 1 2f312: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.388> #endif //TMC2130 { 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) 2f316: 9b 81 ldd r25, Y+3 ; 0x03 2f318: 92 30 cpi r25, 0x02 ; 2 2f31a: 09 f4 brne .+2 ; 0x2f31e 2f31c: 5b c1 rjmp .+694 ; 0x2f5d4 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); 2f31e: a9 2f mov r26, r25 2f320: b0 e0 ldi r27, 0x00 ; 0 2f322: ba 83 std Y+2, r27 ; 0x02 2f324: a9 83 std Y+1, r26 ; 0x01 2f326: fd 01 movw r30, r26 2f328: e7 5e subi r30, 0xE7 ; 231 2f32a: f2 46 sbci r31, 0x62 ; 98 #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); 2f32c: 24 91 lpm r18, Z 2f32e: 2c 83 std Y+4, r18 ; 0x04 #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); feedrate = homing_feedrate[axis]; 2f330: 8d 01 movw r16, r26 2f332: 00 0f add r16, r16 2f334: 11 1f adc r17, r17 2f336: 00 0f add r16, r16 2f338: 11 1f adc r17, r17 2f33a: f8 01 movw r30, r16 2f33c: ee 50 subi r30, 0x0E ; 14 2f33e: fd 4f sbci r31, 0xFD ; 253 2f340: 40 80 ld r4, Z 2f342: 51 80 ldd r5, Z+1 ; 0x01 2f344: 62 80 ldd r6, Z+2 ; 0x02 2f346: 73 80 ldd r7, Z+3 ; 0x03 2f348: 40 92 7a 02 sts 0x027A, r4 ; 0x80027a 2f34c: 50 92 7b 02 sts 0x027B, r5 ; 0x80027b 2f350: 60 92 7c 02 sts 0x027C, r6 ; 0x80027c 2f354: 70 92 7d 02 sts 0x027D, r7 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f358: c3 01 movw r24, r6 2f35a: b2 01 movw r22, r4 2f35c: 0e 94 15 65 call 0xca2a ; 0xca2a 2f360: 4b 01 movw r8, r22 2f362: 5c 01 movw r10, r24 // 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; 2f364: c8 01 movw r24, r16 2f366: 8f 59 subi r24, 0x9F ; 159 2f368: 9d 4e sbci r25, 0xED ; 237 2f36a: 1c 01 movw r2, r24 2f36c: dc 01 movw r26, r24 2f36e: 1d 92 st X+, r1 2f370: 1d 92 st X+, r1 2f372: 1d 92 st X+, r1 2f374: 1c 92 st X, r1 2f376: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); 2f378: 0f 94 ca 48 call 0x29194 ; 0x29194 set_destination_to_current(); 2f37c: 0e 94 7e 66 call 0xccfc ; 0xccfc // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; 2f380: bc 81 ldd r27, Y+4 ; 0x04 2f382: 6b 2f mov r22, r27 2f384: bb 0f add r27, r27 2f386: 77 0b sbc r23, r23 2f388: 88 0b sbc r24, r24 2f38a: 99 0b sbc r25, r25 2f38c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2f390: 6b 01 movw r12, r22 2f392: 7c 01 movw r14, r24 2f394: f8 01 movw r30, r16 2f396: e7 5d subi r30, 0xD7 ; 215 2f398: f9 4f sbci r31, 0xF9 ; 249 2f39a: fb 87 std Y+11, r31 ; 0x0b 2f39c: ea 87 std Y+10, r30 ; 0x0a 2f39e: 20 e0 ldi r18, 0x00 ; 0 2f3a0: 30 e0 ldi r19, 0x00 ; 0 2f3a2: 40 e4 ldi r20, 0x40 ; 64 2f3a4: 50 ec ldi r21, 0xC0 ; 192 2f3a6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f3aa: aa 85 ldd r26, Y+10 ; 0x0a 2f3ac: bb 85 ldd r27, Y+11 ; 0x0b 2f3ae: 6d 93 st X+, r22 2f3b0: 7d 93 st X+, r23 2f3b2: 8d 93 st X+, r24 2f3b4: 9c 93 st X, r25 2f3b6: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f3b8: c5 01 movw r24, r10 2f3ba: b4 01 movw r22, r8 2f3bc: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f3c0: 0f 94 b0 18 call 0x23160 ; 0x23160 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); 2f3c4: 0f 94 59 23 call 0x246b2 ; 0x246b2 2f3c8: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> enable_endstops(false); current_position[axis] = 0; 2f3cc: f1 01 movw r30, r2 2f3ce: 10 82 st Z, r1 2f3d0: 11 82 std Z+1, r1 ; 0x01 2f3d2: 12 82 std Z+2, r1 ; 0x02 2f3d4: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2f3d6: 0f 94 ca 48 call 0x29194 ; 0x29194 destination[axis] = 1. * axis_home_dir; 2f3da: aa 85 ldd r26, Y+10 ; 0x0a 2f3dc: bb 85 ldd r27, Y+11 ; 0x0b 2f3de: cd 92 st X+, r12 2f3e0: dd 92 st X+, r13 2f3e2: ed 92 st X+, r14 2f3e4: fc 92 st X, r15 2f3e6: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f3e8: c5 01 movw r24, r10 2f3ea: b4 01 movw r22, r8 2f3ec: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f3f0: 0f 94 b0 18 call 0x23160 ; 0x23160 2f3f4: b1 e0 ldi r27, 0x01 ; 1 2f3f6: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.388> { 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); 2f3fa: f8 01 movw r30, r16 2f3fc: e3 5f subi r30, 0xF3 ; 243 2f3fe: f2 46 sbci r31, 0x62 ; 98 #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); 2f400: 85 91 lpm r24, Z+ 2f402: 95 91 lpm r25, Z+ 2f404: a5 91 lpm r26, Z+ 2f406: b4 91 lpm r27, Z 2f408: 8e 83 std Y+6, r24 ; 0x06 2f40a: 9f 83 std Y+7, r25 ; 0x07 2f40c: a8 87 std Y+8, r26 ; 0x08 2f40e: b9 87 std Y+9, r27 ; 0x09 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); 2f410: 2d ec ldi r18, 0xCD ; 205 2f412: 3c ec ldi r19, 0xCC ; 204 2f414: 4c e8 ldi r20, 0x8C ; 140 2f416: 5f e3 ldi r21, 0x3F ; 63 2f418: c7 01 movw r24, r14 2f41a: b6 01 movw r22, r12 2f41c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f420: 2e 81 ldd r18, Y+6 ; 0x06 2f422: 3f 81 ldd r19, Y+7 ; 0x07 2f424: 48 85 ldd r20, Y+8 ; 0x08 2f426: 59 85 ldd r21, Y+9 ; 0x09 2f428: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f42c: aa 85 ldd r26, Y+10 ; 0x0a 2f42e: bb 85 ldd r27, Y+11 ; 0x0b 2f430: 6d 93 st X+, r22 2f432: 7d 93 st X+, r23 2f434: 8d 93 st X+, r24 2f436: 9c 93 st X, r25 2f438: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f43a: c5 01 movw r24, r10 2f43c: b4 01 movw r22, r8 2f43e: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f442: 0f 94 b0 18 call 0x23160 ; 0x23160 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(); 2f446: 0f 94 59 23 call 0x246b2 ; 0x246b2 2f44a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> enable_endstops(false); current_position[axis] = 0; 2f44e: f1 01 movw r30, r2 2f450: 10 82 st Z, r1 2f452: 11 82 std Z+1, r1 ; 0x01 2f454: 12 82 std Z+2, r1 ; 0x02 2f456: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2f458: 0f 94 ca 48 call 0x29194 ; 0x29194 destination[axis] = -10.f * axis_home_dir; 2f45c: 20 e0 ldi r18, 0x00 ; 0 2f45e: 30 e0 ldi r19, 0x00 ; 0 2f460: 40 e2 ldi r20, 0x20 ; 32 2f462: 51 ec ldi r21, 0xC1 ; 193 2f464: c7 01 movw r24, r14 2f466: b6 01 movw r22, r12 2f468: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f46c: aa 85 ldd r26, Y+10 ; 0x0a 2f46e: bb 85 ldd r27, Y+11 ; 0x0b 2f470: 6d 93 st X+, r22 2f472: 7d 93 st X+, r23 2f474: 8d 93 st X+, r24 2f476: 9c 93 st X, r25 2f478: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f47a: c5 01 movw r24, r10 2f47c: b4 01 movw r22, r8 2f47e: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f482: 0f 94 b0 18 call 0x23160 ; 0x23160 endstops_hit_on_purpose(); 2f486: 0f 94 59 23 call 0x246b2 ; 0x246b2 2f48a: b1 e0 ldi r27, 0x01 ; 1 2f48c: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.388> // Now move left up to the collision, this time with a repeatable velocity. enable_endstops(true); destination[axis] = 11.f * axis_home_dir; 2f490: 20 e0 ldi r18, 0x00 ; 0 2f492: 30 e0 ldi r19, 0x00 ; 0 2f494: 40 e3 ldi r20, 0x30 ; 48 2f496: 51 e4 ldi r21, 0x41 ; 65 2f498: c7 01 movw r24, r14 2f49a: b6 01 movw r22, r12 2f49c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f4a0: ea 85 ldd r30, Y+10 ; 0x0a 2f4a2: fb 85 ldd r31, Y+11 ; 0x0b 2f4a4: 60 83 st Z, r22 2f4a6: 71 83 std Z+1, r23 ; 0x01 2f4a8: 82 83 std Z+2, r24 ; 0x02 2f4aa: 93 83 std Z+3, r25 ; 0x03 #ifdef TMC2130 feedrate = homing_feedrate[axis]; #else //TMC2130 feedrate = homing_feedrate[axis] / 2; 2f4ac: 20 e0 ldi r18, 0x00 ; 0 2f4ae: 30 e0 ldi r19, 0x00 ; 0 2f4b0: 40 e0 ldi r20, 0x00 ; 0 2f4b2: 5f e3 ldi r21, 0x3F ; 63 2f4b4: c3 01 movw r24, r6 2f4b6: b2 01 movw r22, r4 2f4b8: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f4bc: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 2f4c0: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 2f4c4: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2f4c8: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f4cc: 0e 94 15 65 call 0xca2a ; 0xca2a 2f4d0: 6b 01 movw r12, r22 2f4d2: 7c 01 movw r14, r24 #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f4d4: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f4d8: 0f 94 b0 18 call 0x23160 ; 0x23160 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(); 2f4dc: 0f 94 59 23 call 0x246b2 ; 0x246b2 2f4e0: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); tmc2130_home_exit(); #endif //TMC2130 axis_is_at_home(axis); 2f4e4: 8b 81 ldd r24, Y+3 ; 0x03 2f4e6: 0e 94 5f 65 call 0xcabe ; 0xcabe axis_known_position[axis] = true; 2f4ea: e9 81 ldd r30, Y+1 ; 0x01 2f4ec: fa 81 ldd r31, Y+2 ; 0x02 2f4ee: e7 5c subi r30, 0xC7 ; 199 2f4f0: f9 4f sbci r31, 0xF9 ; 249 2f4f2: 21 e0 ldi r18, 0x01 ; 1 2f4f4: 20 83 st Z, r18 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; 2f4f6: 8c 81 ldd r24, Y+4 ; 0x04 2f4f8: 99 27 eor r25, r25 2f4fa: 81 95 neg r24 2f4fc: 0c f4 brge .+2 ; 0x2f500 2f4fe: 90 95 com r25 2f500: bc 01 movw r22, r24 2f502: 07 2e mov r0, r23 2f504: 00 0c add r0, r0 2f506: 88 0b sbc r24, r24 2f508: 99 0b sbc r25, r25 2f50a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2f50e: 2a e0 ldi r18, 0x0A ; 10 2f510: 37 ed ldi r19, 0xD7 ; 215 2f512: 43 e2 ldi r20, 0x23 ; 35 2f514: 5c e3 ldi r21, 0x3C ; 60 2f516: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f51a: 20 e0 ldi r18, 0x00 ; 0 2f51c: 30 e0 ldi r19, 0x00 ; 0 2f51e: 40 e8 ldi r20, 0x80 ; 128 2f520: 52 e4 ldi r21, 0x42 ; 66 2f522: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f526: 4b 01 movw r8, r22 2f528: 5c 01 movw r10, r24 #endif //TMC2130 current_position[axis] -= dist; 2f52a: ac 01 movw r20, r24 2f52c: 9b 01 movw r18, r22 2f52e: d1 01 movw r26, r2 2f530: 6d 91 ld r22, X+ 2f532: 7d 91 ld r23, X+ 2f534: 8d 91 ld r24, X+ 2f536: 9c 91 ld r25, X 2f538: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2f53c: f1 01 movw r30, r2 2f53e: 60 83 st Z, r22 2f540: 71 83 std Z+1, r23 ; 0x01 2f542: 82 83 std Z+2, r24 ; 0x02 2f544: 93 83 std Z+3, r25 ; 0x03 plan_set_position_curposXYZE(); 2f546: 0f 94 ca 48 call 0x29194 ; 0x29194 current_position[axis] += dist; 2f54a: d1 01 movw r26, r2 2f54c: 2d 91 ld r18, X+ 2f54e: 3d 91 ld r19, X+ 2f550: 4d 91 ld r20, X+ 2f552: 5c 91 ld r21, X 2f554: c5 01 movw r24, r10 2f556: b4 01 movw r22, r8 2f558: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2f55c: f1 01 movw r30, r2 2f55e: 60 83 st Z, r22 2f560: 71 83 std Z+1, r23 ; 0x01 2f562: 82 83 std Z+2, r24 ; 0x02 2f564: 93 83 std Z+3, r25 ; 0x03 destination[axis] = current_position[axis]; 2f566: aa 85 ldd r26, Y+10 ; 0x0a 2f568: bb 85 ldd r27, Y+11 ; 0x0b 2f56a: 6d 93 st X+, r22 2f56c: 7d 93 st X+, r23 2f56e: 8d 93 st X+, r24 2f570: 9c 93 st X, r25 2f572: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); 2f574: 20 e0 ldi r18, 0x00 ; 0 2f576: 30 e0 ldi r19, 0x00 ; 0 2f578: 40 e0 ldi r20, 0x00 ; 0 2f57a: 5f e3 ldi r21, 0x3F ; 63 2f57c: c7 01 movw r24, r14 2f57e: b6 01 movw r22, r12 2f580: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f584: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f588: 0f 94 b0 18 call 0x23160 ; 0x23160 feedrate = 0.0; 2f58c: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2f590: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2f594: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2f598: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d 2f59c: 2d 81 ldd r18, Y+5 ; 0x05 2f59e: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.388> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } 2f5a2: 2b 96 adiw r28, 0x0b ; 11 2f5a4: 0f b6 in r0, 0x3f ; 63 2f5a6: f8 94 cli 2f5a8: de bf out 0x3e, r29 ; 62 2f5aa: 0f be out 0x3f, r0 ; 63 2f5ac: cd bf out 0x3d, r28 ; 61 2f5ae: df 91 pop r29 2f5b0: cf 91 pop r28 2f5b2: 1f 91 pop r17 2f5b4: 0f 91 pop r16 2f5b6: ff 90 pop r15 2f5b8: ef 90 pop r14 2f5ba: df 90 pop r13 2f5bc: cf 90 pop r12 2f5be: bf 90 pop r11 2f5c0: af 90 pop r10 2f5c2: 9f 90 pop r9 2f5c4: 8f 90 pop r8 2f5c6: 7f 90 pop r7 2f5c8: 6f 90 pop r6 2f5ca: 5f 90 pop r5 2f5cc: 4f 90 pop r4 2f5ce: 3f 90 pop r3 2f5d0: 2f 90 pop r2 2f5d2: 08 95 ret #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); 2f5d4: eb e1 ldi r30, 0x1B ; 27 2f5d6: fd e9 ldi r31, 0x9D ; 157 2f5d8: b4 91 lpm r27, Z 2f5da: 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; 2f5dc: 10 92 69 12 sts 0x1269, r1 ; 0x801269 2f5e0: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 2f5e4: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 2f5e8: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 2f5ec: 0f 94 ca 48 call 0x29194 ; 0x29194 #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); 2f5f0: e5 e1 ldi r30, 0x15 ; 21 2f5f2: fd e9 ldi r31, 0x9D ; 157 2f5f4: 85 90 lpm r8, Z+ 2f5f6: 95 90 lpm r9, Z+ 2f5f8: a5 90 lpm r10, Z+ 2f5fa: 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; 2f5fc: e9 81 ldd r30, Y+1 ; 0x01 2f5fe: 6e 2f mov r22, r30 2f600: ee 0f add r30, r30 2f602: 77 0b sbc r23, r23 2f604: 88 0b sbc r24, r24 2f606: 99 0b sbc r25, r25 2f608: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2f60c: 6b 01 movw r12, r22 2f60e: 7c 01 movw r14, r24 2f610: 20 e0 ldi r18, 0x00 ; 0 2f612: 30 e0 ldi r19, 0x00 ; 0 2f614: 40 ec ldi r20, 0xC0 ; 192 2f616: 5f e3 ldi r21, 0x3F ; 63 2f618: c5 01 movw r24, r10 2f61a: b4 01 movw r22, r8 2f61c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f620: a7 01 movw r20, r14 2f622: 96 01 movw r18, r12 2f624: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f628: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f62c: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f630: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f634: 90 93 34 06 sts 0x0634, r25 ; 0x800634 feedrate = homing_feedrate[axis]; 2f638: 80 e0 ldi r24, 0x00 ; 0 2f63a: 90 e0 ldi r25, 0x00 ; 0 2f63c: a8 e4 ldi r26, 0x48 ; 72 2f63e: b4 e4 ldi r27, 0x44 ; 68 2f640: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2f644: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2f648: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2f64c: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f650: bc 01 movw r22, r24 2f652: cd 01 movw r24, r26 2f654: 0e 94 15 65 call 0xca2a ; 0xca2a 2f658: 4b 01 movw r8, r22 2f65a: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f65c: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f660: 0f 94 b0 18 call 0x23160 ; 0x23160 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; 2f664: 10 92 69 12 sts 0x1269, r1 ; 0x801269 2f668: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 2f66c: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 2f670: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 2f674: 0f 94 ca 48 call 0x29194 ; 0x29194 #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); 2f678: 09 e0 ldi r16, 0x09 ; 9 2f67a: 1d e9 ldi r17, 0x9D ; 157 2f67c: f8 01 movw r30, r16 2f67e: 65 91 lpm r22, Z+ 2f680: 75 91 lpm r23, Z+ 2f682: 85 91 lpm r24, Z+ 2f684: 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; 2f686: 90 58 subi r25, 0x80 ; 128 2f688: a7 01 movw r20, r14 2f68a: 96 01 movw r18, r12 2f68c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f690: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f694: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f698: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f69c: 90 93 34 06 sts 0x0634, r25 ; 0x800634 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f6a0: c5 01 movw r24, r10 2f6a2: b4 01 movw r22, r8 2f6a4: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f6a8: 0f 94 b0 18 call 0x23160 ; 0x23160 #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); 2f6ac: f8 01 movw r30, r16 2f6ae: 65 91 lpm r22, Z+ 2f6b0: 75 91 lpm r23, Z+ 2f6b2: 85 91 lpm r24, Z+ 2f6b4: 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; 2f6b6: 9b 01 movw r18, r22 2f6b8: ac 01 movw r20, r24 2f6ba: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2f6be: a7 01 movw r20, r14 2f6c0: 96 01 movw r18, r12 2f6c2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 2f6c6: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f6ca: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f6ce: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f6d2: 90 93 34 06 sts 0x0634, r25 ; 0x800634 feedrate = homing_feedrate[axis] / 2; 2f6d6: 80 e0 ldi r24, 0x00 ; 0 2f6d8: 90 e0 ldi r25, 0x00 ; 0 2f6da: a8 ec ldi r26, 0xC8 ; 200 2f6dc: b3 e4 ldi r27, 0x43 ; 67 2f6de: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2f6e2: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2f6e6: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2f6ea: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f6ee: bc 01 movw r22, r24 2f6f0: cd 01 movw r24, r26 2f6f2: 0e 94 15 65 call 0xca2a ; 0xca2a plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f6f6: 0f 94 d7 49 call 0x293ae ; 0x293ae st_synchronize(); 2f6fa: 0f 94 b0 18 call 0x23160 ; 0x23160 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 axis_is_at_home(axis); 2f6fe: 82 e0 ldi r24, 0x02 ; 2 2f700: 0e 94 5f 65 call 0xcabe ; 0xcabe destination[axis] = current_position[axis]; 2f704: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2f708: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2f70c: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2f710: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2f714: 80 93 31 06 sts 0x0631, r24 ; 0x800631 2f718: 90 93 32 06 sts 0x0632, r25 ; 0x800632 2f71c: a0 93 33 06 sts 0x0633, r26 ; 0x800633 2f720: b0 93 34 06 sts 0x0634, r27 ; 0x800634 feedrate = 0.0; 2f724: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2f728: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2f72c: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2f730: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d endstops_hit_on_purpose(); 2f734: 0f 94 59 23 call 0x246b2 ; 0x246b2 axis_known_position[axis] = true; 2f738: f1 e0 ldi r31, 0x01 ; 1 2f73a: f0 93 3b 06 sts 0x063B, r31 ; 0x80063b 2f73e: 2e cf rjmp .-420 ; 0x2f59c 0002f740 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 2f740: 10 92 09 13 sts 0x1309, r1 ; 0x801309 memset(z_values, 0, sizeof(z_values)); 2f744: ea e0 ldi r30, 0x0A ; 10 2f746: f3 e1 ldi r31, 0x13 ; 19 2f748: 84 ec ldi r24, 0xC4 ; 196 2f74a: df 01 movw r26, r30 2f74c: 1d 92 st X+, r1 2f74e: 8a 95 dec r24 2f750: e9 f7 brne .-6 ; 0x2f74c } 2f752: 08 95 ret 0002f754 : 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 2f754: 2f 92 push r2 2f756: 3f 92 push r3 2f758: 4f 92 push r4 2f75a: 5f 92 push r5 2f75c: 6f 92 push r6 2f75e: 7f 92 push r7 2f760: 8f 92 push r8 2f762: 9f 92 push r9 2f764: af 92 push r10 2f766: bf 92 push r11 2f768: cf 92 push r12 2f76a: df 92 push r13 2f76c: ef 92 push r14 2f76e: ff 92 push r15 2f770: 0f 93 push r16 2f772: 1f 93 push r17 2f774: cf 93 push r28 2f776: df 93 push r29 2f778: 00 d0 rcall .+0 ; 0x2f77a 2f77a: cd b7 in r28, 0x3d ; 61 2f77c: de b7 in r29, 0x3e ; 62 2f77e: 4b 01 movw r8, r22 2f780: 5c 01 movw r10, r24 2f782: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 2f784: 81 e0 ldi r24, 0x01 ; 1 2f786: 80 93 28 06 sts 0x0628, r24 ; 0x800628 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2f78a: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.388> 2f78e: 29 83 std Y+1, r18 ; 0x01 check_endstops = check; 2f790: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.388> //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); 2f794: 80 e0 ldi r24, 0x00 ; 0 2f796: 0f 94 3d 23 call 0x2467a ; 0x2467a 2f79a: 18 2f mov r17, r24 float z = 0.f; endstop_z_hit_on_purpose(); 2f79c: 0f 94 4b 23 call 0x24696 ; 0x24696 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 2f7a0: 80 92 69 12 sts 0x1269, r8 ; 0x801269 2f7a4: 90 92 6a 12 sts 0x126A, r9 ; 0x80126a 2f7a8: a0 92 6b 12 sts 0x126B, r10 ; 0x80126b 2f7ac: b0 92 6c 12 sts 0x126C, r11 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/60); 2f7b0: 65 e5 ldi r22, 0x55 ; 85 2f7b2: 75 e5 ldi r23, 0x55 ; 85 2f7b4: 85 e5 ldi r24, 0x55 ; 85 2f7b6: 91 e4 ldi r25, 0x41 ; 65 2f7b8: 0f 94 bc 4e call 0x29d78 ; 0x29d78 // 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(); 2f7bc: 0e 94 c3 5e call 0xbd86 ; 0xbd86 if (! endstop_z_hit_on_purpose()) 2f7c0: 0f 94 4b 23 call 0x24696 ; 0x24696 2f7c4: 8b 83 std Y+3, r24 ; 0x03 2f7c6: 88 23 and r24, r24 2f7c8: 09 f4 brne .+2 ; 0x2f7cc 2f7ca: eb c0 rjmp .+470 ; 0x2f9a2 { //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) 2f7cc: 1a 82 std Y+2, r1 ; 0x02 #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; 2f7ce: c1 2c mov r12, r1 2f7d0: d1 2c mov r13, r1 2f7d2: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 2f7d4: 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) 2f7d6: 8a 81 ldd r24, Y+2 ; 0x02 2f7d8: 80 17 cp r24, r16 2f7da: 08 f0 brcs .+2 ; 0x2f7de 2f7dc: a4 c0 rjmp .+328 ; 0x2f926 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 2f7de: 60 91 69 12 lds r22, 0x1269 ; 0x801269 2f7e2: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 2f7e6: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 2f7ea: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 2f7ee: 20 e0 ldi r18, 0x00 ; 0 2f7f0: 30 e0 ldi r19, 0x00 ; 0 2f7f2: 40 e0 ldi r20, 0x00 ; 0 2f7f4: 5f e3 ldi r21, 0x3F ; 63 2f7f6: 31 10 cpse r3, r1 2f7f8: 04 c0 rjmp .+8 ; 0x2f802 2f7fa: 2d ec ldi r18, 0xCD ; 205 2f7fc: 3c ec ldi r19, 0xCC ; 204 2f7fe: 4c e4 ldi r20, 0x4C ; 76 2f800: 5e e3 ldi r21, 0x3E ; 62 2f802: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2f806: 2b 01 movw r4, r22 2f808: 3c 01 movw r6, r24 2f80a: 40 92 69 12 sts 0x1269, r4 ; 0x801269 2f80e: 50 92 6a 12 sts 0x126A, r5 ; 0x80126a 2f812: 60 92 6b 12 sts 0x126B, r6 ; 0x80126b 2f816: 70 92 6c 12 sts 0x126C, r7 ; 0x80126c float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 2f81a: 65 e5 ldi r22, 0x55 ; 85 2f81c: 75 e5 ldi r23, 0x55 ; 85 2f81e: 85 e5 ldi r24, 0x55 ; 85 2f820: 91 e4 ldi r25, 0x41 ; 65 2f822: 0f 94 bc 4e call 0x29d78 ; 0x29d78 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 2f826: 80 92 69 12 sts 0x1269, r8 ; 0x801269 2f82a: 90 92 6a 12 sts 0x126A, r9 ; 0x80126a 2f82e: a0 92 6b 12 sts 0x126B, r10 ; 0x80126b 2f832: b0 92 6c 12 sts 0x126C, r11 ; 0x80126c //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)); 2f836: 65 e5 ldi r22, 0x55 ; 85 2f838: 75 e5 ldi r23, 0x55 ; 85 2f83a: 85 e5 ldi r24, 0x55 ; 85 2f83c: 90 e4 ldi r25, 0x40 ; 64 2f83e: 0f 94 bc 4e call 0x29d78 ; 0x29d78 // 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(); 2f842: 0e 94 c3 5e call 0xbd86 ; 0xbd86 //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) { 2f846: a3 01 movw r20, r6 2f848: 92 01 movw r18, r4 2f84a: 60 91 69 12 lds r22, 0x1269 ; 0x801269 2f84e: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 2f852: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 2f856: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 2f85a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2f85e: 9f 77 andi r25, 0x7F ; 127 2f860: 2d ec ldi r18, 0xCD ; 205 2f862: 3c ec ldi r19, 0xCC ; 204 2f864: 4c ec ldi r20, 0xCC ; 204 2f866: 5c e3 ldi r21, 0x3C ; 60 2f868: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2f86c: 87 ff sbrs r24, 7 2f86e: 16 c0 rjmp .+44 ; 0x2f89c //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 2f870: 60 e0 ldi r22, 0x00 ; 0 2f872: 70 e0 ldi r23, 0x00 ; 0 2f874: 80 e0 ldi r24, 0x00 ; 0 2f876: 9f e3 ldi r25, 0x3F ; 63 2f878: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 current_position[Z_AXIS] = minimum_z; 2f87c: 80 92 69 12 sts 0x1269, r8 ; 0x801269 2f880: 90 92 6a 12 sts 0x126A, r9 ; 0x80126a 2f884: a0 92 6b 12 sts 0x126B, r10 ; 0x80126b 2f888: b0 92 6c 12 sts 0x126C, r11 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 2f88c: 65 e5 ldi r22, 0x55 ; 85 2f88e: 75 e5 ldi r23, 0x55 ; 85 2f890: 85 e5 ldi r24, 0x55 ; 85 2f892: 90 e4 ldi r25, 0x40 ; 64 2f894: 0f 94 bc 4e call 0x29d78 ; 0x29d78 // 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(); 2f898: 0e 94 c3 5e call 0xbd86 ; 0xbd86 } if (!endstop_z_hit_on_purpose()) 2f89c: 0f 94 4b 23 call 0x24696 ; 0x24696 2f8a0: 28 2e mov r2, r24 2f8a2: 88 23 and r24, r24 2f8a4: 09 f4 brne .+2 ; 0x2f8a8 2f8a6: 7d c0 rjmp .+250 ; 0x2f9a2 2f8a8: 40 90 69 12 lds r4, 0x1269 ; 0x801269 2f8ac: 50 90 6a 12 lds r5, 0x126A ; 0x80126a 2f8b0: 60 90 6b 12 lds r6, 0x126B ; 0x80126b 2f8b4: 70 90 6c 12 lds r7, 0x126C ; 0x80126c } #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; 2f8b8: 9a 81 ldd r25, Y+2 ; 0x02 2f8ba: 99 23 and r25, r25 2f8bc: d9 f0 breq .+54 ; 0x2f8f4 2f8be: 69 2f mov r22, r25 2f8c0: 70 e0 ldi r23, 0x00 ; 0 2f8c2: 90 e0 ldi r25, 0x00 ; 0 2f8c4: 80 e0 ldi r24, 0x00 ; 0 2f8c6: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 2f8ca: 9b 01 movw r18, r22 2f8cc: ac 01 movw r20, r24 2f8ce: c7 01 movw r24, r14 2f8d0: b6 01 movw r22, r12 2f8d2: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 2f8d6: 9b 01 movw r18, r22 2f8d8: ac 01 movw r20, r24 2f8da: c3 01 movw r24, r6 2f8dc: b2 01 movw r22, r4 2f8de: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 2f8e2: 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 2f8e4: 2d ec ldi r18, 0xCD ; 205 2f8e6: 3c ec ldi r19, 0xCC ; 204 2f8e8: 4c e4 ldi r20, 0x4C ; 76 2f8ea: 5d e3 ldi r21, 0x3D ; 61 2f8ec: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2f8f0: 18 16 cp r1, r24 2f8f2: 64 f0 brlt .+24 ; 0x2f90c #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]; 2f8f4: a3 01 movw r20, r6 2f8f6: 92 01 movw r18, r4 2f8f8: c7 01 movw r24, r14 2f8fa: b6 01 movw r22, r12 2f8fc: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2f900: 6b 01 movw r12, r22 2f902: 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) 2f904: 8a 81 ldd r24, Y+2 ; 0x02 2f906: 8f 5f subi r24, 0xFF ; 255 2f908: 8a 83 std Y+2, r24 ; 0x02 2f90a: 65 cf rjmp .-310 ; 0x2f7d6 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 2f90c: 31 10 cpse r3, r1 2f90e: 49 c0 rjmp .+146 ; 0x2f9a2 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 2f910: 84 ef ldi r24, 0xF4 ; 244 2f912: 91 e0 ldi r25, 0x01 ; 1 2f914: 0e 94 7f 8c call 0x118fe ; 0x118fe //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; 2f918: 32 2c mov r3, r2 i = -1; 2f91a: 2f ef ldi r18, 0xFF ; 255 2f91c: 2a 83 std Y+2, r18 ; 0x02 z = 0; 2f91e: c1 2c mov r12, r1 2f920: d1 2c mov r13, r1 2f922: 76 01 movw r14, r12 2f924: ef cf rjmp .-34 ; 0x2f904 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 2f926: 02 30 cpi r16, 0x02 ; 2 2f928: 38 f5 brcc .+78 ; 0x2f978 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 2f92a: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2f92e: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2f932: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2f936: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2f93a: 99 81 ldd r25, Y+1 ; 0x01 2f93c: 90 93 77 02 sts 0x0277, r25 ; 0x800277 <_ZL14check_endstops.lto_priv.388> if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2f940: 81 2f mov r24, r17 2f942: 0f 94 3d 23 call 0x2467a ; 0x2467a // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2f946: 10 92 28 06 sts 0x0628, r1 ; 0x800628 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 2f94a: 8b 81 ldd r24, Y+3 ; 0x03 2f94c: 0f 90 pop r0 2f94e: 0f 90 pop r0 2f950: 0f 90 pop r0 2f952: df 91 pop r29 2f954: cf 91 pop r28 2f956: 1f 91 pop r17 2f958: 0f 91 pop r16 2f95a: ff 90 pop r15 2f95c: ef 90 pop r14 2f95e: df 90 pop r13 2f960: cf 90 pop r12 2f962: bf 90 pop r11 2f964: af 90 pop r10 2f966: 9f 90 pop r9 2f968: 8f 90 pop r8 2f96a: 7f 90 pop r7 2f96c: 6f 90 pop r6 2f96e: 5f 90 pop r5 2f970: 4f 90 pop r4 2f972: 3f 90 pop r3 2f974: 2f 90 pop r2 2f976: 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); 2f978: 60 2f mov r22, r16 2f97a: 70 e0 ldi r23, 0x00 ; 0 2f97c: 90 e0 ldi r25, 0x00 ; 0 2f97e: 80 e0 ldi r24, 0x00 ; 0 2f980: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 2f984: 9b 01 movw r18, r22 2f986: ac 01 movw r20, r24 2f988: c7 01 movw r24, r14 2f98a: b6 01 movw r22, r12 2f98c: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 2f990: 60 93 69 12 sts 0x1269, r22 ; 0x801269 2f994: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 2f998: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 2f99c: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c 2f9a0: cc cf rjmp .-104 ; 0x2f93a 2f9a2: 29 81 ldd r18, Y+1 ; 0x01 2f9a4: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.388> return true; error: // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 4"); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2f9a8: 81 2f mov r24, r17 2f9aa: 0f 94 3d 23 call 0x2467a ; 0x2467a #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2f9ae: 10 92 28 06 sts 0x0628, r1 ; 0x800628 return false; 2f9b2: 1b 82 std Y+3, r1 ; 0x03 2f9b4: ca cf rjmp .-108 ; 0x2f94a 0002f9b6 : //! @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) 2f9b6: 2f 92 push r2 2f9b8: 3f 92 push r3 2f9ba: 4f 92 push r4 2f9bc: 5f 92 push r5 2f9be: 6f 92 push r6 2f9c0: 7f 92 push r7 2f9c2: 8f 92 push r8 2f9c4: 9f 92 push r9 2f9c6: af 92 push r10 2f9c8: bf 92 push r11 2f9ca: cf 92 push r12 2f9cc: df 92 push r13 2f9ce: ef 92 push r14 2f9d0: ff 92 push r15 2f9d2: 0f 93 push r16 2f9d4: 1f 93 push r17 2f9d6: cf 93 push r28 2f9d8: df 93 push r29 2f9da: cd b7 in r28, 0x3d ; 61 2f9dc: de b7 in r29, 0x3e ; 62 2f9de: ce 5c subi r28, 0xCE ; 206 2f9e0: d1 09 sbc r29, r1 2f9e2: 0f b6 in r0, 0x3f ; 63 2f9e4: f8 94 cli 2f9e6: de bf out 0x3e, r29 ; 62 2f9e8: 0f be out 0x3f, r0 ; 63 2f9ea: cd bf out 0x3d, r28 ; 61 2f9ec: 18 2f mov r17, r24 #endif // TMC2130 FORCE_BL_ON_START; // Only Z calibration? if (!onlyZ) 2f9ee: 81 11 cpse r24, r1 2f9f0: 04 c0 rjmp .+8 ; 0x2f9fa { disable_heater(); 2f9f2: 0f 94 3d 0e call 0x21c7a ; 0x21c7a eeprom_adjust_bed_reset(); //reset bed level correction 2f9f6: 0e 94 af 78 call 0xf15e ; 0xf15e } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 2f9fa: 80 e0 ldi r24, 0x00 ; 0 2f9fc: 0e 94 08 70 call 0xe010 ; 0xe010 // Let the planner use the uncorrected coordinates. mbl.reset(); 2fa00: 0f 94 a0 7b call 0x2f740 ; 0x2f740 // 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(); 2fa04: 0e 94 fd 61 call 0xc3fa ; 0xc3fa babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 2fa08: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.453+0x1> 2fa0c: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.453> // 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)); 2fa10: e9 e3 ldi r30, 0x39 ; 57 2fa12: f6 e0 ldi r31, 0x06 ; 6 2fa14: 83 e0 ldi r24, 0x03 ; 3 2fa16: df 01 movw r26, r30 2fa18: 1d 92 st X+, r1 2fa1a: 8a 95 dec r24 2fa1c: e9 f7 brne .-6 ; 0x2fa18 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 2fa1e: 81 e0 ldi r24, 0x01 ; 1 2fa20: 0e 94 36 65 call 0xca6c ; 0xca6c 2fa24: c7 55 subi r28, 0x57 ; 87 2fa26: df 4f sbci r29, 0xFF ; 255 2fa28: 99 83 std Y+1, r25 ; 0x01 2fa2a: 88 83 st Y, r24 2fa2c: c9 5a subi r28, 0xA9 ; 169 2fa2e: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 2fa30: 81 ec ldi r24, 0xC1 ; 193 2fa32: 91 e6 ldi r25, 0x61 ; 97 2fa34: 0e 94 0a 75 call 0xea14 ; 0xea14 2fa38: 0e 94 9a de call 0x1bd34 ; 0x1bd34 raise_z_above(MESH_HOME_Z_SEARCH); 2fa3c: 60 e0 ldi r22, 0x00 ; 0 2fa3e: 70 e0 ldi r23, 0x00 ; 0 2fa40: 80 ea ldi r24, 0xA0 ; 160 2fa42: 90 e4 ldi r25, 0x40 ; 64 2fa44: 0e 94 c6 6c call 0xd98c ; 0xd98c } /**/ void home_xy() { set_destination_to_current(); 2fa48: 0e 94 7e 66 call 0xccfc ; 0xccfc homeaxis(X_AXIS); 2fa4c: 80 e0 ldi r24, 0x00 ; 0 2fa4e: 0f 94 6b 79 call 0x2f2d6 ; 0x2f2d6 homeaxis(Y_AXIS); 2fa52: 81 e0 ldi r24, 0x01 ; 1 2fa54: 0f 94 6b 79 call 0x2f2d6 ; 0x2f2d6 plan_set_position_curposXYZE(); 2fa58: 0f 94 ca 48 call 0x29194 ; 0x29194 endstops_hit_on_purpose(); 2fa5c: 0f 94 59 23 call 0x246b2 ; 0x246b2 2fa60: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> 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; 2fa64: 20 e0 ldi r18, 0x00 ; 0 2fa66: 30 e0 ldi r19, 0x00 ; 0 2fa68: 40 ea ldi r20, 0xA0 ; 160 2fa6a: 50 e4 ldi r21, 0x40 ; 64 2fa6c: 60 91 61 12 lds r22, 0x1261 ; 0x801261 2fa70: 70 91 62 12 lds r23, 0x1262 ; 0x801262 2fa74: 80 91 63 12 lds r24, 0x1263 ; 0x801263 2fa78: 90 91 64 12 lds r25, 0x1264 ; 0x801264 2fa7c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2fa80: 60 93 61 12 sts 0x1261, r22 ; 0x801261 2fa84: 70 93 62 12 sts 0x1262, r23 ; 0x801262 2fa88: 80 93 63 12 sts 0x1263, r24 ; 0x801263 2fa8c: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] += 5; 2fa90: 20 e0 ldi r18, 0x00 ; 0 2fa92: 30 e0 ldi r19, 0x00 ; 0 2fa94: 40 ea ldi r20, 0xA0 ; 160 2fa96: 50 e4 ldi r21, 0x40 ; 64 2fa98: 60 91 65 12 lds r22, 0x1265 ; 0x801265 2fa9c: 70 91 66 12 lds r23, 0x1266 ; 0x801266 2faa0: 80 91 67 12 lds r24, 0x1267 ; 0x801267 2faa4: 90 91 68 12 lds r25, 0x1268 ; 0x801268 2faa8: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 2faac: 60 93 65 12 sts 0x1265, r22 ; 0x801265 2fab0: 70 93 66 12 sts 0x1266, r23 ; 0x801266 2fab4: 80 93 67 12 sts 0x1267, r24 ; 0x801267 2fab8: 90 93 68 12 sts 0x1268, r25 ; 0x801268 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 2fabc: 60 e0 ldi r22, 0x00 ; 0 2fabe: 70 e0 ldi r23, 0x00 ; 0 2fac0: 80 ea ldi r24, 0xA0 ; 160 2fac2: 91 e4 ldi r25, 0x41 ; 65 2fac4: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 2fac8: 0f 94 b0 18 call 0x23160 ; 0x23160 // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) 2facc: 81 2f mov r24, r17 2face: 0e 94 c5 f9 call 0x1f38a ; 0x1f38a 2fad2: e5 96 adiw r28, 0x35 ; 53 2fad4: 8f af std Y+63, r24 ; 0x3f 2fad6: e5 97 sbiw r28, 0x35 ; 53 2fad8: 81 11 cpse r24, r1 2fada: 04 c0 rjmp .+8 ; 0x2fae4 //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 2fadc: e5 96 adiw r28, 0x35 ; 53 2fade: 1f ae std Y+63, r1 ; 0x3f 2fae0: e5 97 sbiw r28, 0x35 ; 53 2fae2: 6f c4 rjmp .+2270 ; 0x303c2 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 2fae4: 85 e8 ldi r24, 0x85 ; 133 2fae6: 91 e6 ldi r25, 0x61 ; 97 2fae8: 0e 94 0a 75 call 0xea14 ; 0xea14 2faec: 0e 94 85 e8 call 0x1d10a ; 0x1d10a if(onlyZ){ 2faf0: 11 23 and r17, r17 2faf2: 09 f4 brne .+2 ; 0x2faf6 2faf4: 41 c4 rjmp .+2178 ; 0x30378 prompt_steel_sheet_on_bed(true); 2faf6: 81 e0 ldi r24, 0x01 ; 1 2faf8: 0e 94 51 e9 call 0x1d2a2 ; 0x1d2a2 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 2fafc: 83 e5 ldi r24, 0x53 ; 83 2fafe: 91 e6 ldi r25, 0x61 ; 97 2fb00: 0e 94 0a 75 call 0xea14 ; 0xea14 2fb04: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_puts_at_P(0,3,_n("1/9")); 2fb08: 42 ee ldi r20, 0xE2 ; 226 2fb0a: 5b e6 ldi r21, 0x6B ; 107 }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")); 2fb0c: 63 e0 ldi r22, 0x03 ; 3 2fb0e: 80 e0 ldi r24, 0x00 ; 0 2fb10: 0e 94 d7 6f call 0xdfae ; 0xdfae } refresh_cmd_timeout(); 2fb14: 0e 94 11 65 call 0xca22 ; 0xca22 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 2fb18: 11 11 cpse r17, r1 2fb1a: 1b c0 rjmp .+54 ; 0x2fb52 { KEEPALIVE_STATE(PAUSED_FOR_USER); 2fb1c: 84 e0 ldi r24, 0x04 ; 4 2fb1e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 prompt_steel_sheet_on_bed(false); 2fb22: 80 e0 ldi r24, 0x00 ; 0 2fb24: 0e 94 51 e9 call 0x1d2a2 ; 0x1d2a2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 2fb28: 89 e9 ldi r24, 0x99 ; 153 2fb2a: 90 e6 ldi r25, 0x60 ; 96 2fb2c: 0e 94 0a 75 call 0xea14 ; 0xea14 2fb30: 0e 94 85 e8 call 0x1d10a ; 0x1d10a KEEPALIVE_STATE(IN_HANDLER); 2fb34: 82 e0 ldi r24, 0x02 ; 2 2fb36: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 2fb3a: 81 e3 ldi r24, 0x31 ; 49 2fb3c: 91 e6 ldi r25, 0x61 ; 97 2fb3e: 0e 94 0a 75 call 0xea14 ; 0xea14 2fb42: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_puts_at_P(0,3,_n("1/4")); 2fb46: 4a ed ldi r20, 0xDA ; 218 2fb48: 5b e6 ldi r21, 0x6B ; 107 2fb4a: 63 e0 ldi r22, 0x03 ; 3 2fb4c: 80 e0 ldi r24, 0x00 ; 0 2fb4e: 0e 94 d7 6f call 0xdfae ; 0xdfae return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2fb52: 00 91 77 02 lds r16, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.388> check_endstops = check; 2fb56: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.388> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 2fb5a: 60 e0 ldi r22, 0x00 ; 0 2fb5c: 70 e0 ldi r23, 0x00 ; 0 2fb5e: 80 e8 ldi r24, 0x80 ; 128 2fb60: 9f eb ldi r25, 0xBF ; 191 2fb62: 0e 94 64 6c call 0xd8c8 ; 0xd8c8 // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 2fb66: c1 2c mov r12, r1 2fb68: d1 2c mov r13, r1 2fb6a: b0 ea ldi r27, 0xA0 ; 160 2fb6c: eb 2e mov r14, r27 2fb6e: b0 e4 ldi r27, 0x40 ; 64 2fb70: fb 2e mov r15, r27 2fb72: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2fb76: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2fb7a: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2fb7e: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2fb82: 81 e0 ldi r24, 0x01 ; 1 2fb84: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.388> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 2fb88: 60 e0 ldi r22, 0x00 ; 0 2fb8a: 70 e0 ldi r23, 0x00 ; 0 2fb8c: 80 ea ldi r24, 0xA0 ; 160 2fb8e: 91 e4 ldi r25, 0x41 ; 65 2fb90: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 2fb94: 0f 94 b0 18 call 0x23160 ; 0x23160 2fb98: 00 93 77 02 sts 0x0277, r16 ; 0x800277 <_ZL14check_endstops.lto_priv.388> #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)) && 2fb9c: 82 e0 ldi r24, 0x02 ; 2 2fb9e: 0f 94 9c 18 call 0x23138 ; 0x23138 2fba2: 2d ec ldi r18, 0xCD ; 205 2fba4: 3c ec ldi r19, 0xCC ; 204 2fba6: 44 ea ldi r20, 0xA4 ; 164 2fba8: 50 e4 ldi r21, 0x40 ; 64 2fbaa: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 2fbae: 18 16 cp r1, r24 2fbb0: 0c f4 brge .+2 ; 0x2fbb4 2fbb2: eb c3 rjmp .+2006 ; 0x3038a (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 2fbb4: 82 e0 ldi r24, 0x02 ; 2 2fbb6: 0f 94 9c 18 call 0x23138 ; 0x23138 #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)) && 2fbba: 23 e3 ldi r18, 0x33 ; 51 2fbbc: 33 e3 ldi r19, 0x33 ; 51 2fbbe: 4b e9 ldi r20, 0x9B ; 155 2fbc0: 50 e4 ldi r21, 0x40 ; 64 2fbc2: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 2fbc6: 87 fd sbrc r24, 7 2fbc8: e0 c3 rjmp .+1984 ; 0x3038a (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 2fbca: 11 11 cpse r17, r1 2fbcc: e3 c3 rjmp .+1990 ; 0x30394 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 2fbce: 80 e1 ldi r24, 0x10 ; 16 2fbd0: 0e 94 ea d4 call 0x1a9d4 ; 0x1a9d4 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 2fbd4: 81 ea ldi r24, 0xA1 ; 161 2fbd6: 9d e0 ldi r25, 0x0D ; 13 2fbd8: 0f 94 9d a3 call 0x3473a ; 0x3473a 2fbdc: bb e0 ldi r27, 0x0B ; 11 2fbde: 8b 9f mul r24, r27 2fbe0: c0 01 movw r24, r0 2fbe2: 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); 2fbe4: 70 e0 ldi r23, 0x00 ; 0 2fbe6: 60 e0 ldi r22, 0x00 ; 0 2fbe8: 80 5b subi r24, 0xB0 ; 176 2fbea: 92 4f sbci r25, 0xF2 ; 242 2fbec: 0f 94 df a3 call 0x347be ; 0x347be } 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(); 2fbf0: 0e 94 11 65 call 0xca22 ; 0xca22 // 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); 2fbf4: ea e0 ldi r30, 0x0A ; 10 2fbf6: f3 e1 ldi r31, 0x13 ; 19 2fbf8: 84 ec ldi r24, 0xC4 ; 196 2fbfa: df 01 movw r26, r30 2fbfc: 1d 92 st X+, r1 2fbfe: 8a 95 dec r24 2fc00: e9 f7 brne .-6 ; 0x2fbfc { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 2fc02: 85 e2 ldi r24, 0x25 ; 37 2fc04: 9c e9 ldi r25, 0x9C ; 156 2fc06: 0e 94 94 7a call 0xf528 ; 0xf528 MYSERIAL.println(int(iteration + 1)); 2fc0a: 81 e0 ldi r24, 0x01 ; 1 2fc0c: 90 e0 ldi r25, 0x00 ; 0 2fc0e: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e 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)); 2fc12: 81 e3 ldi r24, 0x31 ; 49 2fc14: 91 e6 ldi r25, 0x61 ; 97 2fc16: 0e 94 0a 75 call 0xea14 ; 0xea14 2fc1a: 0e 94 9a de call 0x1bd34 ; 0x1bd34 #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; 2fc1e: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2fc22: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2fc26: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2fc2a: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2fc2e: b2 e0 ldi r27, 0x02 ; 2 2fc30: e1 96 adiw r28, 0x31 ; 49 2fc32: bf af std Y+63, r27 ; 0x3f 2fc34: e1 97 sbiw r28, 0x31 ; 49 2fc36: 20 e0 ldi r18, 0x00 ; 0 2fc38: 3c e9 ldi r19, 0x9C ; 156 2fc3a: cd 56 subi r28, 0x6D ; 109 2fc3c: df 4f sbci r29, 0xFF ; 255 2fc3e: 39 83 std Y+1, r19 ; 0x01 2fc40: 28 83 st Y, r18 2fc42: c3 59 subi r28, 0x93 ; 147 2fc44: d0 40 sbci r29, 0x00 ; 0 2fc46: 49 e0 ldi r20, 0x09 ; 9 2fc48: 53 e1 ldi r21, 0x13 ; 19 2fc4a: cf 56 subi r28, 0x6F ; 111 2fc4c: df 4f sbci r29, 0xFF ; 255 2fc4e: 59 83 std Y+1, r21 ; 0x01 2fc50: 48 83 st Y, r20 2fc52: c1 59 subi r28, 0x91 ; 145 2fc54: d0 40 sbci r29, 0x00 ; 0 2fc56: a0 96 adiw r28, 0x20 ; 32 2fc58: 5f af std Y+63, r21 ; 0x3f 2fc5a: 4e af std Y+62, r20 ; 0x3e 2fc5c: a0 97 sbiw r28, 0x20 ; 32 2fc5e: e0 96 adiw r28, 0x30 ; 48 2fc60: 3f af std Y+63, r19 ; 0x3f 2fc62: 2e af std Y+62, r18 ; 0x3e 2fc64: 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; 2fc66: a7 96 adiw r28, 0x27 ; 39 2fc68: 1f ae std Y+63, r1 ; 0x3f 2fc6a: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 2fc6c: 31 2c mov r3, r1 2fc6e: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 2fc70: 0e 94 11 65 call 0xca22 ; 0xca22 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 2fc74: 63 e0 ldi r22, 0x03 ; 3 2fc76: 80 e0 ldi r24, 0x00 ; 0 2fc78: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_printf_P(PSTR("%d/4"),(k+1)); 2fc7c: bf ef ldi r27, 0xFF ; 255 2fc7e: 2b 1a sub r2, r27 2fc80: 3b 0a sbc r3, r27 2fc82: 3f 92 push r3 2fc84: 2f 92 push r2 2fc86: e0 e2 ldi r30, 0x20 ; 32 2fc88: fc e9 ldi r31, 0x9C ; 156 2fc8a: ff 93 push r31 2fc8c: ef 93 push r30 2fc8e: 0e 94 db 6e call 0xddb6 ; 0xddb6 } #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); 2fc92: 65 e5 ldi r22, 0x55 ; 85 2fc94: 75 e5 ldi r23, 0x55 ; 85 2fc96: 85 e5 ldi r24, 0x55 ; 85 2fc98: 91 e4 ldi r25, 0x41 ; 65 2fc9a: 0f 94 bc 4e call 0x29d78 ; 0x29d78 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); 2fc9e: e0 96 adiw r28, 0x30 ; 48 2fca0: ee ad ldd r30, Y+62 ; 0x3e 2fca2: ff ad ldd r31, Y+63 ; 0x3f 2fca4: e0 97 sbiw r28, 0x30 ; 48 2fca6: 85 91 lpm r24, Z+ 2fca8: 95 91 lpm r25, Z+ 2fcaa: a5 91 lpm r26, Z+ 2fcac: b4 91 lpm r27, Z 2fcae: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2fcb2: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2fcb6: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2fcba: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 2fcbe: e0 96 adiw r28, 0x30 ; 48 2fcc0: ee ad ldd r30, Y+62 ; 0x3e 2fcc2: ff ad ldd r31, Y+63 ; 0x3f 2fcc4: e0 97 sbiw r28, 0x30 ; 48 2fcc6: 34 96 adiw r30, 0x04 ; 4 2fcc8: 85 91 lpm r24, Z+ 2fcca: 95 91 lpm r25, Z+ 2fccc: a5 91 lpm r26, Z+ 2fcce: b4 91 lpm r27, Z 2fcd0: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2fcd4: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2fcd8: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2fcdc: b0 93 68 12 sts 0x1268, r27 ; 0x801268 MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 2fce0: 60 e0 ldi r22, 0x00 ; 0 2fce2: 70 e0 ldi r23, 0x00 ; 0 2fce4: 88 e4 ldi r24, 0x48 ; 72 2fce6: 92 e4 ldi r25, 0x42 ; 66 2fce8: 0f 94 bc 4e call 0x29d78 ; 0x29d78 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 2fcec: 45 e8 ldi r20, 0x85 ; 133 2fcee: 5a e9 ldi r21, 0x9A ; 154 2fcf0: 5f 93 push r21 2fcf2: 4f 93 push r20 2fcf4: 0f 94 5f a2 call 0x344be ; 0x344be lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 2fcf8: 44 e7 ldi r20, 0x74 ; 116 2fcfa: 5a e9 ldi r21, 0x9A ; 154 2fcfc: 63 e0 ldi r22, 0x03 ; 3 2fcfe: 84 e0 ldi r24, 0x04 ; 4 2fd00: 0e 94 d7 6f call 0xdfae ; 0xdfae // disable heaters and stop motion before we initialize sm4 disable_heater(); 2fd04: 0f 94 3d 0e call 0x21c7a ; 0x21c7a st_synchronize(); 2fd08: 0f 94 b0 18 call 0x23160 ; 0x23160 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 2fd0c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2fd10: 8d 7f andi r24, 0xFD ; 253 2fd12: 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" ); 2fd16: 0f b6 in r0, 0x3f ; 63 2fd18: f8 94 cli 2fd1a: a8 95 wdr 2fd1c: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2fd20: 88 61 ori r24, 0x18 ; 24 2fd22: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2fd26: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2fd2a: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 2fd2c: 10 92 25 06 sts 0x0625, r1 ; 0x800625 2fd30: 10 92 24 06 sts 0x0624, r1 ; 0x800624 sm4_update_pos_cb = xyzcal_update_pos; 2fd34: 8d e4 ldi r24, 0x4D ; 77 2fd36: 9b eb ldi r25, 0xBB ; 187 2fd38: 90 93 23 06 sts 0x0623, r25 ; 0x800623 2fd3c: 80 93 22 06 sts 0x0622, r24 ; 0x800622 sm4_calc_delay_cb = xyzcal_calc_delay; 2fd40: a8 e4 ldi r26, 0x48 ; 72 2fd42: bb eb ldi r27, 0xBB ; 187 2fd44: b0 93 21 06 sts 0x0621, r27 ; 0x800621 2fd48: a0 93 20 06 sts 0x0620, r26 ; 0x800620 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]); 2fd4c: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2fd50: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2fd54: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2fd58: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2fd5c: 40 91 50 06 lds r20, 0x0650 ; 0x800650 2fd60: 50 91 51 06 lds r21, 0x0651 ; 0x800651 2fd64: 60 91 52 06 lds r22, 0x0652 ; 0x800652 2fd68: 70 91 53 06 lds r23, 0x0653 ; 0x800653 2fd6c: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2fd70: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2fd74: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2fd78: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2fd7c: 3f 93 push r19 2fd7e: 2f 93 push r18 2fd80: 1f 93 push r17 2fd82: 0f 93 push r16 2fd84: 7f 93 push r23 2fd86: 6f 93 push r22 2fd88: 5f 93 push r21 2fd8a: 4f 93 push r20 2fd8c: bf 93 push r27 2fd8e: af 93 push r26 2fd90: 9f 93 push r25 2fd92: 8f 93 push r24 2fd94: e4 e2 ldi r30, 0x24 ; 36 2fd96: fb e9 ldi r31, 0x9B ; 155 2fd98: ff 93 push r31 2fd9a: ef 93 push r30 2fd9c: 0f 94 5f a2 call 0x344be ; 0x344be int16_t x0 = _X; 2fda0: 40 90 4c 06 lds r4, 0x064C ; 0x80064c 2fda4: 50 90 4d 06 lds r5, 0x064D ; 0x80064d 2fda8: 60 90 4e 06 lds r6, 0x064E ; 0x80064e 2fdac: 70 90 4f 06 lds r7, 0x064F ; 0x80064f 2fdb0: b4 2c mov r11, r4 2fdb2: a5 2c mov r10, r5 int16_t y0 = _Y; 2fdb4: 80 91 50 06 lds r24, 0x0650 ; 0x800650 2fdb8: 90 91 51 06 lds r25, 0x0651 ; 0x800651 2fdbc: a0 91 52 06 lds r26, 0x0652 ; 0x800652 2fdc0: b0 91 53 06 lds r27, 0x0653 ; 0x800653 2fdc4: a6 96 adiw r28, 0x26 ; 38 2fdc6: 8c af std Y+60, r24 ; 0x3c 2fdc8: 9d af std Y+61, r25 ; 0x3d 2fdca: ae af std Y+62, r26 ; 0x3e 2fdcc: bf af std Y+63, r27 ; 0x3f 2fdce: a6 97 sbiw r28, 0x26 ; 38 2fdd0: a3 96 adiw r28, 0x23 ; 35 2fdd2: 9f ac ldd r9, Y+63 ; 0x3f 2fdd4: a3 97 sbiw r28, 0x23 ; 35 2fdd6: a4 96 adiw r28, 0x24 ; 36 2fdd8: 8f ac ldd r8, Y+63 ; 0x3f 2fdda: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 2fddc: c0 90 54 06 lds r12, 0x0654 ; 0x800654 2fde0: d0 90 55 06 lds r13, 0x0655 ; 0x800655 2fde4: e0 90 56 06 lds r14, 0x0656 ; 0x800656 2fde8: f0 90 57 06 lds r15, 0x0657 ; 0x800657 2fdec: 0f b6 in r0, 0x3f ; 63 2fdee: f8 94 cli 2fdf0: de bf out 0x3e, r29 ; 62 2fdf2: 0f be out 0x3f, r0 ; 63 2fdf4: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 2fdf6: b5 e0 ldi r27, 0x05 ; 5 2fdf8: cb 16 cp r12, r27 2fdfa: b7 ef ldi r27, 0xF7 ; 247 2fdfc: db 06 cpc r13, r27 2fdfe: 0c f4 brge .+2 ; 0x2fe02 2fe00: 3a c3 rjmp .+1652 ; 0x30476 } 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; 2fe02: 1a 82 std Y+2, r1 ; 0x02 2fe04: 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); 2fe06: 1f 92 push r1 2fe08: 1f 92 push r1 2fe0a: e3 e0 ldi r30, 0x03 ; 3 2fe0c: ef 93 push r30 2fe0e: f4 e8 ldi r31, 0x84 ; 132 2fe10: ff 93 push r31 2fe12: 1f 92 push r1 2fe14: 24 e6 ldi r18, 0x64 ; 100 2fe16: 2f 93 push r18 2fe18: df 92 push r13 2fe1a: cf 92 push r12 2fe1c: 8f 92 push r8 2fe1e: 9f 92 push r9 2fe20: af 92 push r10 2fe22: bf 92 push r11 2fe24: 4b e9 ldi r20, 0x9B ; 155 2fe26: 5a e9 ldi r21, 0x9A ; 154 2fe28: 5f 93 push r21 2fe2a: 4f 93 push r20 2fe2c: 0f 94 5f a2 call 0x344be ; 0x344be if (!ret && (ad < 720)) 2fe30: 0f b6 in r0, 0x3f ; 63 2fe32: f8 94 cli 2fe34: de bf out 0x3e, r29 ; 62 2fe36: 0f be out 0x3f, r0 ; 63 2fe38: cd bf out 0x3d, r28 ; 61 2fe3a: 89 81 ldd r24, Y+1 ; 0x01 2fe3c: 9a 81 ldd r25, Y+2 ; 0x02 2fe3e: 80 3d cpi r24, 0xD0 ; 208 2fe40: 92 40 sbci r25, 0x02 ; 2 2fe42: 08 f4 brcc .+2 ; 0x2fe46 2fe44: e3 c2 rjmp .+1478 ; 0x3040c if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 2fe46: 89 81 ldd r24, Y+1 ; 0x01 2fe48: 9a 81 ldd r25, Y+2 ; 0x02 2fe4a: 80 3a cpi r24, 0xA0 ; 160 2fe4c: 95 40 sbci r25, 0x05 ; 5 2fe4e: 10 f0 brcs .+4 ; 0x2fe54 2fe50: 0d 94 10 8e jmp 0x31c20 ; 0x31c20 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 2fe54: 9e 01 movw r18, r28 2fe56: 2f 5f subi r18, 0xFF ; 255 2fe58: 3f 4f sbci r19, 0xFF ; 255 2fe5a: 79 01 movw r14, r18 2fe5c: 10 e0 ldi r17, 0x00 ; 0 2fe5e: 00 e0 ldi r16, 0x00 ; 0 2fe60: 2c e7 ldi r18, 0x7C ; 124 2fe62: 3c ef ldi r19, 0xFC ; 252 2fe64: a6 01 movw r20, r12 2fe66: 44 56 subi r20, 0x64 ; 100 2fe68: 51 09 sbc r21, r1 2fe6a: 69 2d mov r22, r9 2fe6c: 78 2d mov r23, r8 2fe6e: 8b 2d mov r24, r11 2fe70: 9a 2d mov r25, r10 2fe72: 0f 94 4d 5f call 0x2be9a ; 0x2be9a 2fe76: 88 23 and r24, r24 2fe78: 11 f4 brne .+4 ; 0x2fe7e 2fe7a: 0d 94 10 8e jmp 0x31c20 ; 0x31c20 ad += 720; 2fe7e: 89 81 ldd r24, Y+1 ; 0x01 2fe80: 9a 81 ldd r25, Y+2 ; 0x02 2fe82: 80 53 subi r24, 0x30 ; 48 2fe84: 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); 2fe86: c0 90 54 06 lds r12, 0x0654 ; 0x800654 2fe8a: d0 90 55 06 lds r13, 0x0655 ; 0x800655 2fe8e: e0 90 56 06 lds r14, 0x0656 ; 0x800656 2fe92: f0 90 57 06 lds r15, 0x0657 ; 0x800657 2fe96: 00 91 50 06 lds r16, 0x0650 ; 0x800650 2fe9a: 10 91 51 06 lds r17, 0x0651 ; 0x800651 2fe9e: 20 91 52 06 lds r18, 0x0652 ; 0x800652 2fea2: 30 91 53 06 lds r19, 0x0653 ; 0x800653 2fea6: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 2feaa: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 2feae: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 2feb2: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 2feb6: 9f 93 push r25 2feb8: 8f 93 push r24 2feba: df 92 push r13 2febc: cf 92 push r12 2febe: 1f 93 push r17 2fec0: 0f 93 push r16 2fec2: 5f 93 push r21 2fec4: 4f 93 push r20 2fec6: 80 e0 ldi r24, 0x00 ; 0 2fec8: 9b e9 ldi r25, 0x9B ; 155 2feca: 9f 93 push r25 2fecc: 8f 93 push r24 2fece: 0f 94 5f a2 call 0x344be ; 0x344be /// 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); 2fed2: 40 91 54 06 lds r20, 0x0654 ; 0x800654 2fed6: 50 91 55 06 lds r21, 0x0655 ; 0x800655 2feda: 60 91 56 06 lds r22, 0x0656 ; 0x800656 2fede: 70 91 57 06 lds r23, 0x0657 ; 0x800657 2fee2: 48 54 subi r20, 0x48 ; 72 2fee4: 51 09 sbc r21, r1 2fee6: 00 e0 ldi r16, 0x00 ; 0 2fee8: 28 ec ldi r18, 0xC8 ; 200 2feea: 30 e0 ldi r19, 0x00 ; 0 2feec: a3 96 adiw r28, 0x23 ; 35 2feee: 6f ad ldd r22, Y+63 ; 0x3f 2fef0: a3 97 sbiw r28, 0x23 ; 35 2fef2: a4 96 adiw r28, 0x24 ; 36 2fef4: 7f ad ldd r23, Y+63 ; 0x3f 2fef6: a4 97 sbiw r28, 0x24 ; 36 2fef8: c2 01 movw r24, r4 2fefa: 0e 94 c0 d3 call 0x1a780 ; 0x1a780 /// 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; 2fefe: 20 91 4c 06 lds r18, 0x064C ; 0x80064c 2ff02: 30 91 4d 06 lds r19, 0x064D ; 0x80064d 2ff06: 40 91 4e 06 lds r20, 0x064E ; 0x80064e 2ff0a: 50 91 4f 06 lds r21, 0x064F ; 0x80064f 2ff0e: 6e 96 adiw r28, 0x1e ; 30 2ff10: 2c af std Y+60, r18 ; 0x3c 2ff12: 3d af std Y+61, r19 ; 0x3d 2ff14: 4e af std Y+62, r20 ; 0x3e 2ff16: 5f af std Y+63, r21 ; 0x3f 2ff18: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 2ff1a: 80 91 50 06 lds r24, 0x0650 ; 0x800650 2ff1e: 90 91 51 06 lds r25, 0x0651 ; 0x800651 2ff22: a0 91 52 06 lds r26, 0x0652 ; 0x800652 2ff26: b0 91 53 06 lds r27, 0x0653 ; 0x800653 2ff2a: ae 96 adiw r28, 0x2e ; 46 2ff2c: 8c af std Y+60, r24 ; 0x3c 2ff2e: 9d af std Y+61, r25 ; 0x3d 2ff30: ae af std Y+62, r26 ; 0x3e 2ff32: bf af std Y+63, r27 ; 0x3f 2ff34: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 2ff36: 20 91 54 06 lds r18, 0x0654 ; 0x800654 2ff3a: 30 91 55 06 lds r19, 0x0655 ; 0x800655 2ff3e: 40 91 56 06 lds r20, 0x0656 ; 0x800656 2ff42: 50 91 57 06 lds r21, 0x0657 ; 0x800657 2ff46: e9 96 adiw r28, 0x39 ; 57 2ff48: 2c af std Y+60, r18 ; 0x3c 2ff4a: 3d af std Y+61, r19 ; 0x3d 2ff4c: 4e af std Y+62, r20 ; 0x3e 2ff4e: 5f af std Y+63, r21 ; 0x3f 2ff50: e9 97 sbiw r28, 0x39 ; 57 2ff52: ae e5 ldi r26, 0x5E ; 94 2ff54: ba e0 ldi r27, 0x0A ; 10 2ff56: 0f b6 in r0, 0x3f ; 63 2ff58: f8 94 cli 2ff5a: de bf out 0x3e, r29 ; 62 2ff5c: 0f be out 0x3f, r0 ; 63 2ff5e: cd bf out 0x3d, r28 ; 61 2ff60: 90 e0 ldi r25, 0x00 ; 0 2ff62: 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)); 2ff64: fc 01 movw r30, r24 2ff66: e5 56 subi r30, 0x65 ; 101 2ff68: f4 46 sbci r31, 0x64 ; 100 2ff6a: 25 91 lpm r18, Z+ 2ff6c: 34 91 lpm r19, Z 2ff6e: 2d 93 st X+, r18 2ff70: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 2ff72: fc 01 movw r30, r24 2ff74: ed 57 subi r30, 0x7D ; 125 2ff76: f4 46 sbci r31, 0x64 ; 100 2ff78: 25 91 lpm r18, Z+ 2ff7a: 34 91 lpm r19, Z 2ff7c: 57 96 adiw r26, 0x17 ; 23 2ff7e: 3c 93 st X, r19 2ff80: 2e 93 st -X, r18 2ff82: 56 97 sbiw r26, 0x16 ; 22 2ff84: 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++){ 2ff86: 88 31 cpi r24, 0x18 ; 24 2ff88: 91 05 cpc r25, r1 2ff8a: 61 f7 brne .-40 ; 0x2ff64 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); 2ff8c: e7 96 adiw r28, 0x37 ; 55 2ff8e: 4e ad ldd r20, Y+62 ; 0x3e 2ff90: 5f ad ldd r21, Y+63 ; 0x3f 2ff92: e7 97 sbiw r28, 0x37 ; 55 2ff94: ac 96 adiw r28, 0x2c ; 44 2ff96: 6e ad ldd r22, Y+62 ; 0x3e 2ff98: 7f ad ldd r23, Y+63 ; 0x3f 2ff9a: ac 97 sbiw r28, 0x2c ; 44 2ff9c: 6c 96 adiw r28, 0x1c ; 28 2ff9e: 8e ad ldd r24, Y+62 ; 0x3e 2ffa0: 9f ad ldd r25, Y+63 ; 0x3f 2ffa2: 6c 97 sbiw r28, 0x1c ; 28 2ffa4: 0f 94 89 60 call 0x2c112 ; 0x2c112 2ffa8: 2e e5 ldi r18, 0x5E ; 94 2ffaa: 36 e0 ldi r19, 0x06 ; 6 2ffac: a4 96 adiw r28, 0x24 ; 36 2ffae: 3f af std Y+63, r19 ; 0x3f 2ffb0: 2e af std Y+62, r18 ; 0x3e 2ffb2: a4 97 sbiw r28, 0x24 ; 36 2ffb4: 79 01 movw r14, r18 2ffb6: f0 e2 ldi r31, 0x20 ; 32 2ffb8: 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]); 2ffba: a6 e4 ldi r26, 0x46 ; 70 2ffbc: ca 2e mov r12, r26 2ffbe: ab e9 ldi r26, 0x9B ; 155 2ffc0: da 2e mov r13, r26 } DBG(endl); 2ffc2: 0b e9 ldi r16, 0x9B ; 155 2ffc4: 1c e9 ldi r17, 0x9C ; 156 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); 2ffc6: 57 01 movw r10, r14 2ffc8: e0 e2 ldi r30, 0x20 ; 32 2ffca: 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]); 2ffcc: d5 01 movw r26, r10 2ffce: 8d 91 ld r24, X+ 2ffd0: 5d 01 movw r10, r26 2ffd2: 1f 92 push r1 2ffd4: 8f 93 push r24 2ffd6: df 92 push r13 2ffd8: cf 92 push r12 2ffda: 0f 94 5f a2 call 0x344be ; 0x344be 2ffde: 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){ 2ffe0: 0f 90 pop r0 2ffe2: 0f 90 pop r0 2ffe4: 0f 90 pop r0 2ffe6: 0f 90 pop r0 2ffe8: 81 10 cpse r8, r1 2ffea: f0 cf rjmp .-32 ; 0x2ffcc DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 2ffec: 1f 93 push r17 2ffee: 0f 93 push r16 2fff0: 0f 94 5f a2 call 0x344be ; 0x344be 2fff4: 9a 94 dec r9 2fff6: b0 e2 ldi r27, 0x20 ; 32 2fff8: eb 0e add r14, r27 2fffa: 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){ 2fffc: 0f 90 pop r0 2fffe: 0f 90 pop r0 30000: 91 10 cpse r9, r1 30002: e1 cf rjmp .-62 ; 0x2ffc6 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 30004: 1f 93 push r17 30006: 0f 93 push r16 30008: 0f 94 5f a2 call 0x344be ; 0x344be 3000c: 6e e5 ldi r22, 0x5E ; 94 3000e: 7a e0 ldi r23, 0x0A ; 10 30010: 0f 90 pop r0 30012: 0f 90 pop r0 30014: ee e5 ldi r30, 0x5E ; 94 30016: 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; 30018: 90 e0 ldi r25, 0x00 ; 0 3001a: 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; 3001c: 50 e0 ldi r21, 0x00 ; 0 3001e: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 30020: 21 91 ld r18, Z+ 30022: 21 11 cpse r18, r1 30024: 67 c4 rjmp .+2254 ; 0x308f4 ++mins; 30026: 4f 5f subi r20, 0xFF ; 255 30028: 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){ 3002a: 6e 17 cp r22, r30 3002c: 7f 07 cpc r23, r31 3002e: c1 f7 brne .-16 ; 0x30020 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 30030: 9a 01 movw r18, r20 30032: 28 0f add r18, r24 30034: 39 1f adc r19, r25 30036: 25 38 cpi r18, 0x85 ; 133 30038: 33 40 sbci r19, 0x03 ; 3 3003a: a4 f0 brlt .+40 ; 0x30064 && mins > threshold_extreme 3003c: 43 33 cpi r20, 0x33 ; 51 3003e: 51 05 cpc r21, r1 30040: 8c f0 brlt .+34 ; 0x30064 && maxs > threshold_extreme 30042: 83 33 cpi r24, 0x33 ; 51 30044: 91 05 cpc r25, r1 30046: 74 f0 brlt .+28 ; 0x30064 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 30048: 20 e0 ldi r18, 0x00 ; 0 3004a: 34 e0 ldi r19, 0x04 ; 4 3004c: 24 1b sub r18, r20 3004e: 35 0b sbc r19, r21 30050: 28 1b sub r18, r24 30052: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 30054: 24 17 cp r18, r20 30056: 35 07 cpc r19, r21 30058: 2c f4 brge .+10 ; 0x30064 } 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; 3005a: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 3005c: 28 17 cp r18, r24 3005e: 39 07 cpc r19, r25 30060: 0c f4 brge .+2 ; 0x30064 30062: 39 c2 rjmp .+1138 ; 0x304d6 } /// 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; 30064: 66 96 adiw r28, 0x16 ; 22 30066: 1f ae std Y+63, r1 ; 0x3f 30068: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 3006a: 62 96 adiw r28, 0x12 ; 18 3006c: 1f ae std Y+63, r1 ; 0x3f 3006e: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 30070: 22 96 adiw r28, 0x02 ; 2 30072: 1f ae std Y+63, r1 ; 0x3f 30074: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 30076: 19 82 std Y+1, r1 ; 0x01 30078: ae 01 movw r20, r28 3007a: 4f 5a subi r20, 0xAF ; 175 3007c: 5f 4f sbci r21, 0xFF ; 255 3007e: be 01 movw r22, r28 30080: 6b 5a subi r22, 0xAB ; 171 30082: 7f 4f sbci r23, 0xFF ; 255 30084: 8e e5 ldi r24, 0x5E ; 94 30086: 9a e0 ldi r25, 0x0A ; 10 30088: 0f 94 72 58 call 0x2b0e4 ; 0x2b0e4 3008c: 08 2f mov r16, r24 3008e: ae 01 movw r20, r28 30090: 4f 5f subi r20, 0xFF ; 255 30092: 5f 4f sbci r21, 0xFF ; 255 30094: be 01 movw r22, r28 30096: 6f 5b subi r22, 0xBF ; 191 30098: 7f 4f sbci r23, 0xFF ; 255 3009a: 86 e7 ldi r24, 0x76 ; 118 3009c: 9a e0 ldi r25, 0x0A ; 10 3009e: 0f 94 72 58 call 0x2b0e4 ; 0x2b0e4 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; 300a2: 66 96 adiw r28, 0x16 ; 22 300a4: 6f ad ldd r22, Y+63 ; 0x3f 300a6: 66 97 sbiw r28, 0x16 ; 22 row = r08; 300a8: 62 96 adiw r28, 0x12 ; 18 300aa: 1f ad ldd r17, Y+63 ; 0x3f 300ac: 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){ 300ae: 80 17 cp r24, r16 300b0: 28 f0 brcs .+10 ; 0x300bc col = c08; row = r08; return match08; } col = c10; 300b2: 22 96 adiw r28, 0x02 ; 2 300b4: 6f ad ldd r22, Y+63 ; 0x3f 300b6: 22 97 sbiw r28, 0x02 ; 2 row = r10; 300b8: 19 81 ldd r17, Y+1 ; 0x01 300ba: 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){ 300bc: 08 35 cpi r16, 0x58 ; 88 300be: 08 f4 brcc .+2 ; 0x300c2 300c0: 1e c4 rjmp .+2108 ; 0x308fe /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 300c2: 70 e0 ldi r23, 0x00 ; 0 300c4: 90 e0 ldi r25, 0x00 ; 0 300c6: 80 e0 ldi r24, 0x00 ; 0 300c8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 300cc: 20 e0 ldi r18, 0x00 ; 0 300ce: 30 e0 ldi r19, 0x00 ; 0 300d0: 40 eb ldi r20, 0xB0 ; 176 300d2: 50 e4 ldi r21, 0x40 ; 64 300d4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 300d8: 2b 01 movw r4, r22 300da: 3c 01 movw r6, r24 300dc: 65 96 adiw r28, 0x15 ; 21 300de: 4c ae std Y+60, r4 ; 0x3c 300e0: 5d ae std Y+61, r5 ; 0x3d 300e2: 6e ae std Y+62, r6 ; 0x3e 300e4: 7f ae std Y+63, r7 ; 0x3f 300e6: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 300e8: 61 2f mov r22, r17 300ea: 70 e0 ldi r23, 0x00 ; 0 300ec: 90 e0 ldi r25, 0x00 ; 0 300ee: 80 e0 ldi r24, 0x00 ; 0 300f0: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 300f4: 20 e0 ldi r18, 0x00 ; 0 300f6: 30 e0 ldi r19, 0x00 ; 0 300f8: 40 eb ldi r20, 0xB0 ; 176 300fa: 50 e4 ldi r21, 0x40 ; 64 300fc: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30100: 4b 01 movw r8, r22 30102: 5c 01 movw r10, r24 30104: 25 96 adiw r28, 0x05 ; 5 30106: 8c ae std Y+60, r8 ; 0x3c 30108: 9d ae std Y+61, r9 ; 0x3d 3010a: ae ae std Y+62, r10 ; 0x3e 3010c: bf ae std Y+63, r11 ; 0x3f 3010e: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 30110: 20 e0 ldi r18, 0x00 ; 0 30112: 30 e0 ldi r19, 0x00 ; 0 30114: 40 e9 ldi r20, 0x90 ; 144 30116: 50 e4 ldi r21, 0x40 ; 64 30118: 29 83 std Y+1, r18 ; 0x01 3011a: 3a 83 std Y+2, r19 ; 0x02 3011c: 4b 83 std Y+3, r20 ; 0x03 3011e: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 30120: ae 01 movw r20, r28 30122: 4f 5f subi r20, 0xFF ; 255 30124: 5f 4f sbci r21, 0xFF ; 255 30126: be 01 movw r22, r28 30128: 6f 5b subi r22, 0xBF ; 191 3012a: 7f 4f sbci r23, 0xFF ; 255 3012c: ce 01 movw r24, r28 3012e: 8f 5a subi r24, 0xAF ; 175 30130: 9f 4f sbci r25, 0xFF ; 255 30132: 0f 94 cd 5b call 0x2b79a ; 0x2b79a if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 30136: a3 01 movw r20, r6 30138: 92 01 movw r18, r4 3013a: 65 96 adiw r28, 0x15 ; 21 3013c: 6c ad ldd r22, Y+60 ; 0x3c 3013e: 7d ad ldd r23, Y+61 ; 0x3d 30140: 8e ad ldd r24, Y+62 ; 0x3e 30142: 9f ad ldd r25, Y+63 ; 0x3f 30144: 65 97 sbiw r28, 0x15 ; 21 30146: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3014a: 6b 01 movw r12, r22 3014c: 7c 01 movw r14, r24 3014e: 9f 77 andi r25, 0x7F ; 127 30150: 20 e0 ldi r18, 0x00 ; 0 30152: 30 e0 ldi r19, 0x00 ; 0 30154: 40 e4 ldi r20, 0x40 ; 64 30156: 50 e4 ldi r21, 0x40 ; 64 30158: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 3015c: 18 16 cp r1, r24 3015e: 34 f1 brlt .+76 ; 0x301ac 30160: a5 01 movw r20, r10 30162: 94 01 movw r18, r8 30164: 25 96 adiw r28, 0x05 ; 5 30166: 6c ad ldd r22, Y+60 ; 0x3c 30168: 7d ad ldd r23, Y+61 ; 0x3d 3016a: 8e ad ldd r24, Y+62 ; 0x3e 3016c: 9f ad ldd r25, Y+63 ; 0x3f 3016e: 25 97 sbiw r28, 0x05 ; 5 30170: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30174: 9f 77 andi r25, 0x7F ; 127 30176: 20 e0 ldi r18, 0x00 ; 0 30178: 30 e0 ldi r19, 0x00 ; 0 3017a: 40 e4 ldi r20, 0x40 ; 64 3017c: 50 e4 ldi r21, 0x40 ; 64 3017e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 30182: 18 16 cp r1, r24 30184: 9c f0 brlt .+38 ; 0x301ac 30186: 20 e0 ldi r18, 0x00 ; 0 30188: 30 e0 ldi r19, 0x00 ; 0 3018a: 40 ea ldi r20, 0xA0 ; 160 3018c: 50 e4 ldi r21, 0x40 ; 64 3018e: 69 81 ldd r22, Y+1 ; 0x01 30190: 7a 81 ldd r23, Y+2 ; 0x02 30192: 8b 81 ldd r24, Y+3 ; 0x03 30194: 9c 81 ldd r25, Y+4 ; 0x04 30196: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3019a: 9f 77 andi r25, 0x7F ; 127 3019c: 20 e0 ldi r18, 0x00 ; 0 3019e: 30 e0 ldi r19, 0x00 ; 0 301a0: 40 e4 ldi r20, 0x40 ; 64 301a2: 50 e4 ldi r21, 0x40 ; 64 301a4: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 301a8: 18 16 cp r1, r24 301aa: bc f5 brge .+110 ; 0x3021a //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 301ac: 20 e0 ldi r18, 0x00 ; 0 301ae: 30 e0 ldi r19, 0x00 ; 0 301b0: 40 ea ldi r20, 0xA0 ; 160 301b2: 50 e4 ldi r21, 0x40 ; 64 301b4: 69 81 ldd r22, Y+1 ; 0x01 301b6: 7a 81 ldd r23, Y+2 ; 0x02 301b8: 8b 81 ldd r24, Y+3 ; 0x03 301ba: 9c 81 ldd r25, Y+4 ; 0x04 301bc: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 301c0: 9f 93 push r25 301c2: 8f 93 push r24 301c4: 7f 93 push r23 301c6: 6f 93 push r22 301c8: a5 01 movw r20, r10 301ca: 94 01 movw r18, r8 301cc: 25 96 adiw r28, 0x05 ; 5 301ce: 6c ad ldd r22, Y+60 ; 0x3c 301d0: 7d ad ldd r23, Y+61 ; 0x3d 301d2: 8e ad ldd r24, Y+62 ; 0x3e 301d4: 9f ad ldd r25, Y+63 ; 0x3f 301d6: 25 97 sbiw r28, 0x05 ; 5 301d8: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 301dc: 9f 93 push r25 301de: 8f 93 push r24 301e0: 7f 93 push r23 301e2: 6f 93 push r22 301e4: ff 92 push r15 301e6: ef 92 push r14 301e8: df 92 push r13 301ea: cf 92 push r12 301ec: 87 e6 ldi r24, 0x67 ; 103 301ee: 9b e9 ldi r25, 0x9B ; 155 301f0: 9f 93 push r25 301f2: 8f 93 push r24 301f4: 0f 94 5f a2 call 0x344be ; 0x344be /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 301f8: 65 96 adiw r28, 0x15 ; 21 301fa: 4c ae std Y+60, r4 ; 0x3c 301fc: 5d ae std Y+61, r5 ; 0x3d 301fe: 6e ae std Y+62, r6 ; 0x3e 30200: 7f ae std Y+63, r7 ; 0x3f 30202: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 30204: 25 96 adiw r28, 0x05 ; 5 30206: 8c ae std Y+60, r8 ; 0x3c 30208: 9d ae std Y+61, r9 ; 0x3d 3020a: ae ae std Y+62, r10 ; 0x3e 3020c: bf ae std Y+63, r11 ; 0x3f 3020e: 25 97 sbiw r28, 0x05 ; 5 30210: 0f b6 in r0, 0x3f ; 63 30212: f8 94 cli 30214: de bf out 0x3e, r29 ; 62 30216: 0f be out 0x3f, r0 ; 63 30218: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 3021a: 20 e0 ldi r18, 0x00 ; 0 3021c: 30 e0 ldi r19, 0x00 ; 0 3021e: 48 e7 ldi r20, 0x78 ; 120 30220: 51 e4 ldi r21, 0x41 ; 65 30222: 65 96 adiw r28, 0x15 ; 21 30224: 6c ad ldd r22, Y+60 ; 0x3c 30226: 7d ad ldd r23, Y+61 ; 0x3d 30228: 8e ad ldd r24, Y+62 ; 0x3e 3022a: 9f ad ldd r25, Y+63 ; 0x3f 3022c: 65 97 sbiw r28, 0x15 ; 21 3022e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30232: 20 e0 ldi r18, 0x00 ; 0 30234: 30 e0 ldi r19, 0x00 ; 0 30236: 40 e8 ldi r20, 0x80 ; 128 30238: 52 e4 ldi r21, 0x42 ; 66 3023a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3023e: 6b 01 movw r12, r22 30240: 7c 01 movw r14, r24 30242: 6c 96 adiw r28, 0x1c ; 28 30244: ae ad ldd r26, Y+62 ; 0x3e 30246: bf ad ldd r27, Y+63 ; 0x3f 30248: 6c 97 sbiw r28, 0x1c ; 28 3024a: bd 01 movw r22, r26 3024c: bb 0f add r27, r27 3024e: 88 0b sbc r24, r24 30250: 99 0b sbc r25, r25 30252: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 30256: 9b 01 movw r18, r22 30258: ac 01 movw r20, r24 3025a: c7 01 movw r24, r14 3025c: b6 01 movw r22, r12 3025e: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30262: 6b 01 movw r12, r22 30264: 7c 01 movw r14, r24 30266: 65 96 adiw r28, 0x15 ; 21 30268: cc ae std Y+60, r12 ; 0x3c 3026a: dd ae std Y+61, r13 ; 0x3d 3026c: ee ae std Y+62, r14 ; 0x3e 3026e: ff ae std Y+63, r15 ; 0x3f 30270: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 30272: 20 e0 ldi r18, 0x00 ; 0 30274: 30 e0 ldi r19, 0x00 ; 0 30276: 48 e7 ldi r20, 0x78 ; 120 30278: 51 e4 ldi r21, 0x41 ; 65 3027a: 25 96 adiw r28, 0x05 ; 5 3027c: 6c ad ldd r22, Y+60 ; 0x3c 3027e: 7d ad ldd r23, Y+61 ; 0x3d 30280: 8e ad ldd r24, Y+62 ; 0x3e 30282: 9f ad ldd r25, Y+63 ; 0x3f 30284: 25 97 sbiw r28, 0x05 ; 5 30286: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3028a: 20 e0 ldi r18, 0x00 ; 0 3028c: 30 e0 ldi r19, 0x00 ; 0 3028e: 40 e8 ldi r20, 0x80 ; 128 30290: 52 e4 ldi r21, 0x42 ; 66 30292: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30296: 4b 01 movw r8, r22 30298: 5c 01 movw r10, r24 3029a: ac 96 adiw r28, 0x2c ; 44 3029c: ee ad ldd r30, Y+62 ; 0x3e 3029e: ff ad ldd r31, Y+63 ; 0x3f 302a0: ac 97 sbiw r28, 0x2c ; 44 302a2: bf 01 movw r22, r30 302a4: ff 0f add r31, r31 302a6: 88 0b sbc r24, r24 302a8: 99 0b sbc r25, r25 302aa: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 302ae: 9b 01 movw r18, r22 302b0: ac 01 movw r20, r24 302b2: c5 01 movw r24, r10 302b4: b4 01 movw r22, r8 302b6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 302ba: 25 96 adiw r28, 0x05 ; 5 302bc: 6c af std Y+60, r22 ; 0x3c 302be: 7d af std Y+61, r23 ; 0x3d 302c0: 8e af std Y+62, r24 ; 0x3e 302c2: 9f af std Y+63, r25 ; 0x3f 302c4: 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; 302c6: 2a e0 ldi r18, 0x0A ; 10 302c8: 37 ed ldi r19, 0xD7 ; 215 302ca: 43 e2 ldi r20, 0x23 ; 35 302cc: 5c e3 ldi r21, 0x3C ; 60 302ce: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__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)); 302d2: 9f 93 push r25 302d4: 8f 93 push r24 302d6: 7f 93 push r23 302d8: 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; 302da: 2a e0 ldi r18, 0x0A ; 10 302dc: 37 ed ldi r19, 0xD7 ; 215 302de: 43 e2 ldi r20, 0x23 ; 35 302e0: 5c e3 ldi r21, 0x3C ; 60 302e2: c7 01 movw r24, r14 302e4: b6 01 movw r22, r12 302e6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__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)); 302ea: 9f 93 push r25 302ec: 8f 93 push r24 302ee: 7f 93 push r23 302f0: 6f 93 push r22 302f2: 8b e4 ldi r24, 0x4B ; 75 302f4: 9b e9 ldi r25, 0x9B ; 155 302f6: 9f 93 push r25 302f8: 8f 93 push r24 302fa: 0f 94 5f a2 call 0x344be ; 0x344be uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 302fe: 20 e0 ldi r18, 0x00 ; 0 30300: 30 e0 ldi r19, 0x00 ; 0 30302: 40 e0 ldi r20, 0x00 ; 0 30304: 5f e3 ldi r21, 0x3F ; 63 30306: 25 96 adiw r28, 0x05 ; 5 30308: 6c ad ldd r22, Y+60 ; 0x3c 3030a: 7d ad ldd r23, Y+61 ; 0x3d 3030c: 8e ad ldd r24, Y+62 ; 0x3e 3030e: 9f ad ldd r25, Y+63 ; 0x3f 30310: 25 97 sbiw r28, 0x05 ; 5 30312: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30316: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 3031a: 6b 01 movw r12, r22 3031c: 20 e0 ldi r18, 0x00 ; 0 3031e: 30 e0 ldi r19, 0x00 ; 0 30320: 40 e0 ldi r20, 0x00 ; 0 30322: 5f e3 ldi r21, 0x3F ; 63 30324: 65 96 adiw r28, 0x15 ; 21 30326: 6c ad ldd r22, Y+60 ; 0x3c 30328: 7d ad ldd r23, Y+61 ; 0x3d 3032a: 8e ad ldd r24, Y+62 ; 0x3e 3032c: 9f ad ldd r25, Y+63 ; 0x3f 3032e: 65 97 sbiw r28, 0x15 ; 21 30330: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30334: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> 30338: 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); 3033a: 00 e0 ldi r16, 0x00 ; 0 3033c: 28 ec ldi r18, 0xC8 ; 200 3033e: 30 e0 ldi r19, 0x00 ; 0 30340: e7 96 adiw r28, 0x37 ; 55 30342: 4e ad ldd r20, Y+62 ; 0x3e 30344: 5f ad ldd r21, Y+63 ; 0x3f 30346: e7 97 sbiw r28, 0x37 ; 55 30348: b6 01 movw r22, r12 3034a: 0e 94 c0 d3 call 0x1a780 ; 0x1a780 3034e: 0f b6 in r0, 0x3f ; 63 30350: f8 94 cli 30352: de bf out 0x3e, r29 ; 62 30354: 0f be out 0x3f, r0 ; 63 30356: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 30358: 10 e0 ldi r17, 0x00 ; 0 3035a: 8e e3 ldi r24, 0x3E ; 62 3035c: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 3035e: a4 96 adiw r28, 0x24 ; 36 30360: ae ad ldd r26, Y+62 ; 0x3e 30362: bf ad ldd r27, Y+63 ; 0x3f 30364: a4 97 sbiw r28, 0x24 ; 36 30366: 1d 92 st X+, r1 30368: a4 96 adiw r28, 0x24 ; 36 3036a: bf af std Y+63, r27 ; 0x3f 3036c: ae af std Y+62, r26 ; 0x3e 3036e: 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++) 30370: 8a 17 cp r24, r26 30372: 9b 07 cpc r25, r27 30374: a1 f7 brne .-24 ; 0x3035e 30376: af c0 rjmp .+350 ; 0x304d6 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)); 30378: 81 e3 ldi r24, 0x31 ; 49 3037a: 91 e6 ldi r25, 0x61 ; 97 3037c: 0e 94 0a 75 call 0xea14 ; 0xea14 30380: 0e 94 9a de call 0x1bd34 ; 0x1bd34 lcd_puts_at_P(0,3,_n("1/4")); 30384: 4e ed ldi r20, 0xDE ; 222 30386: 5b e6 ldi r21, 0x6B ; 107 30388: c1 cb rjmp .-2174 ; 0x2fb0c } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 3038a: 81 e3 ldi r24, 0x31 ; 49 3038c: 9c e9 ldi r25, 0x9C ; 156 // 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); 3038e: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 30392: a4 cb rjmp .-2232 ; 0x2fadc 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); 30394: c7 55 subi r28, 0x57 ; 87 30396: df 4f sbci r29, 0xFF ; 255 30398: 88 81 ld r24, Y 3039a: 99 81 ldd r25, Y+1 ; 0x01 3039c: c9 5a subi r28, 0xA9 ; 169 3039e: d0 40 sbci r29, 0x00 ; 0 303a0: 0e 94 1c 65 call 0xca38 ; 0xca38 // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 303a4: 0e 94 96 60 call 0xc12c ; 0xc12c // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 303a8: 0e 94 d2 5e call 0xbda4 ; 0xbda4 //FIXME bool result = sample_mesh_and_store_reference(); 303ac: 0f 94 c5 52 call 0x2a58a ; 0x2a58a 303b0: e5 96 adiw r28, 0x35 ; 53 303b2: 8f af std Y+63, r24 ; 0x3f 303b4: e5 97 sbiw r28, 0x35 ; 53 if (result) 303b6: 88 23 and r24, r24 303b8: 09 f4 brne .+2 ; 0x303bc 303ba: 90 cb rjmp .-2272 ; 0x2fadc { calibration_status_set(CALIBRATION_STATUS_Z); 303bc: 84 e0 ldi r24, 0x04 ; 4 303be: 0e 94 3f d5 call 0x1aa7e ; 0x1aa7e } else { // Timeouted. } lcd_update_enable(true); 303c2: 81 e0 ldi r24, 0x01 ; 1 303c4: 0e 94 08 70 call 0xe010 ; 0xe010 #endif // TMC2130 FORCE_BL_ON_END; return final_result; } 303c8: e5 96 adiw r28, 0x35 ; 53 303ca: 8f ad ldd r24, Y+63 ; 0x3f 303cc: e5 97 sbiw r28, 0x35 ; 53 303ce: c2 53 subi r28, 0x32 ; 50 303d0: df 4f sbci r29, 0xFF ; 255 303d2: 0f b6 in r0, 0x3f ; 63 303d4: f8 94 cli 303d6: de bf out 0x3e, r29 ; 62 303d8: 0f be out 0x3f, r0 ; 63 303da: cd bf out 0x3d, r28 ; 61 303dc: df 91 pop r29 303de: cf 91 pop r28 303e0: 1f 91 pop r17 303e2: 0f 91 pop r16 303e4: ff 90 pop r15 303e6: ef 90 pop r14 303e8: df 90 pop r13 303ea: cf 90 pop r12 303ec: bf 90 pop r11 303ee: af 90 pop r10 303f0: 9f 90 pop r9 303f2: 8f 90 pop r8 303f4: 7f 90 pop r7 303f6: 6f 90 pop r6 303f8: 5f 90 pop r5 303fa: 4f 90 pop r4 303fc: 3f 90 pop r3 303fe: 2f 90 pop r2 30400: 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) { 30402: e1 e0 ldi r30, 0x01 ; 1 30404: e1 96 adiw r28, 0x31 ; 49 30406: ef af std Y+63, r30 ; 0x3f 30408: e1 97 sbiw r28, 0x31 ; 49 3040a: 15 cc rjmp .-2006 ; 0x2fc36 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) 3040c: fe 01 movw r30, r28 3040e: 31 96 adiw r30, 0x01 ; 1 30410: 7f 01 movw r14, r30 30412: 10 e0 ldi r17, 0x00 ; 0 30414: 00 e0 ldi r16, 0x00 ; 0 30416: 24 e8 ldi r18, 0x84 ; 132 30418: 33 e0 ldi r19, 0x03 ; 3 3041a: a6 01 movw r20, r12 3041c: 69 2d mov r22, r9 3041e: 78 2d mov r23, r8 30420: 8b 2d mov r24, r11 30422: 9a 2d mov r25, r10 30424: 0f 94 4d 5f call 0x2be9a ; 0x2be9a ad += 0; if (!ret && (ad < 1440)) 30428: 88 23 and r24, r24 3042a: 09 f4 brne .+2 ; 0x3042e 3042c: 0c cd rjmp .-1512 ; 0x2fe46 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; 3042e: 89 81 ldd r24, Y+1 ; 0x01 30430: 9a 81 ldd r25, Y+2 ; 0x02 30432: 29 cd rjmp .-1454 ; 0x2fe86 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)) 30434: 89 81 ldd r24, Y+1 ; 0x01 30436: 9a 81 ldd r25, Y+2 ; 0x02 30438: 80 34 cpi r24, 0x40 ; 64 3043a: 9b 40 sbci r25, 0x0B ; 11 3043c: b8 f4 brcc .+46 ; 0x3046c if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 3043e: ce 01 movw r24, r28 30440: 01 96 adiw r24, 0x01 ; 1 30442: 7c 01 movw r14, r24 30444: 04 eb ldi r16, 0xB4 ; 180 30446: 10 e0 ldi r17, 0x00 ; 0 30448: 2c e7 ldi r18, 0x7C ; 124 3044a: 3c ef ldi r19, 0xFC ; 252 3044c: a6 01 movw r20, r12 3044e: 4c 52 subi r20, 0x2C ; 44 30450: 51 40 sbci r21, 0x01 ; 1 30452: 69 2d mov r22, r9 30454: 78 2d mov r23, r8 30456: 8b 2d mov r24, r11 30458: 9a 2d mov r25, r10 3045a: 0f 94 4d 5f call 0x2be9a ; 0x2be9a 3045e: 88 23 and r24, r24 30460: 29 f0 breq .+10 ; 0x3046c ad += 2160; 30462: 89 81 ldd r24, Y+1 ; 0x01 30464: 9a 81 ldd r25, Y+2 ; 0x02 30466: 80 59 subi r24, 0x90 ; 144 30468: 97 4f sbci r25, 0xF7 ; 247 3046a: 0d cd rjmp .-1510 ; 0x2fe86 /// 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; 3046c: 90 e9 ldi r25, 0x90 ; 144 3046e: c9 1a sub r12, r25 30470: 91 e0 ldi r25, 0x01 ; 1 30472: d9 0a sbc r13, r25 30474: c0 cc rjmp .-1664 ; 0x2fdf6 } //@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]); 30476: 00 91 54 06 lds r16, 0x0654 ; 0x800654 3047a: 10 91 55 06 lds r17, 0x0655 ; 0x800655 3047e: 20 91 56 06 lds r18, 0x0656 ; 0x800656 30482: 30 91 57 06 lds r19, 0x0657 ; 0x800657 30486: 40 91 50 06 lds r20, 0x0650 ; 0x800650 3048a: 50 91 51 06 lds r21, 0x0651 ; 0x800651 3048e: 60 91 52 06 lds r22, 0x0652 ; 0x800652 30492: 70 91 53 06 lds r23, 0x0653 ; 0x800653 30496: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 3049a: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 3049e: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 304a2: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 304a6: 3f 93 push r19 304a8: 2f 93 push r18 304aa: 1f 93 push r17 304ac: 0f 93 push r16 304ae: 7f 93 push r23 304b0: 6f 93 push r22 304b2: 5f 93 push r21 304b4: 4f 93 push r20 304b6: bf 93 push r27 304b8: af 93 push r26 304ba: 9f 93 push r25 304bc: 8f 93 push r24 304be: 83 ed ldi r24, 0xD3 ; 211 304c0: 9a e9 ldi r25, 0x9A ; 154 304c2: 9f 93 push r25 304c4: 8f 93 push r24 304c6: 0f 94 5f a2 call 0x344be ; 0x344be 304ca: 0f b6 in r0, 0x3f ; 63 304cc: f8 94 cli 304ce: de bf out 0x3e, r29 ; 62 304d0: 0f be out 0x3f, r0 ; 63 304d2: 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; 304d4: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 304d6: 83 eb ldi r24, 0xB3 ; 179 304d8: 9b e9 ldi r25, 0x9B ; 155 304da: 9f 93 push r25 304dc: 8f 93 push r24 304de: 0f 94 5f a2 call 0x344be ; 0x344be lcd_set_cursor(4,3); 304e2: 63 e0 ldi r22, 0x03 ; 3 304e4: 84 e0 ldi r24, 0x04 ; 4 304e6: 0e 94 2a 6f call 0xde54 ; 0xde54 lcd_space(16); 304ea: 80 e1 ldi r24, 0x10 ; 16 304ec: 0e 94 f8 6e call 0xddf0 ; 0xddf0 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 304f0: 0f 94 3d 4b call 0x2967a ; 0x2967a : "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" ); 304f4: 88 e1 ldi r24, 0x18 ; 24 304f6: 98 e2 ldi r25, 0x28 ; 40 304f8: 0f b6 in r0, 0x3f ; 63 304fa: f8 94 cli 304fc: a8 95 wdr 304fe: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 30502: 0f be out 0x3f, r0 ; 63 30504: 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); 30508: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3050c: 80 64 ori r24, 0x40 ; 64 3050e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 30512: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30516: 82 60 ori r24, 0x02 ; 2 30518: 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){ 3051c: 0f 90 pop r0 3051e: 0f 90 pop r0 30520: 1d 3f cpi r17, 0xFD ; 253 30522: 09 f4 brne .+2 ; 0x30526 30524: ee c1 rjmp .+988 ; 0x30902 30526: 1f 3f cpi r17, 0xFF ; 255 30528: 11 f4 brne .+4 ; 0x3052e 3052a: 0d 94 cc 8d jmp 0x31b98 ; 0x31b98 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); 3052e: 20 e0 ldi r18, 0x00 ; 0 30530: 30 e0 ldi r19, 0x00 ; 0 30532: a9 01 movw r20, r18 30534: a0 96 adiw r28, 0x20 ; 32 30536: ee ad ldd r30, Y+62 ; 0x3e 30538: ff ad ldd r31, Y+63 ; 0x3f 3053a: a0 97 sbiw r28, 0x20 ; 32 3053c: 61 81 ldd r22, Z+1 ; 0x01 3053e: 72 81 ldd r23, Z+2 ; 0x02 30540: 83 81 ldd r24, Z+3 ; 0x03 30542: 94 81 ldd r25, Z+4 ; 0x04 30544: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 30548: 20 91 61 12 lds r18, 0x1261 ; 0x801261 3054c: 30 91 62 12 lds r19, 0x1262 ; 0x801262 30550: 40 91 63 12 lds r20, 0x1263 ; 0x801263 30554: 50 91 64 12 lds r21, 0x1264 ; 0x801264 30558: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 3055c: a0 96 adiw r28, 0x20 ; 32 3055e: ae ad ldd r26, Y+62 ; 0x3e 30560: bf ad ldd r27, Y+63 ; 0x3f 30562: a0 97 sbiw r28, 0x20 ; 32 30564: 11 96 adiw r26, 0x01 ; 1 30566: 6d 93 st X+, r22 30568: 7d 93 st X+, r23 3056a: 8d 93 st X+, r24 3056c: 9c 93 st X, r25 3056e: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 30570: c0 90 65 12 lds r12, 0x1265 ; 0x801265 30574: d0 90 66 12 lds r13, 0x1266 ; 0x801266 30578: e0 90 67 12 lds r14, 0x1267 ; 0x801267 3057c: f0 90 68 12 lds r15, 0x1268 ; 0x801268 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); 30580: 20 e0 ldi r18, 0x00 ; 0 30582: 30 e0 ldi r19, 0x00 ; 0 30584: a9 01 movw r20, r18 30586: 15 96 adiw r26, 0x05 ; 5 30588: 6d 91 ld r22, X+ 3058a: 7d 91 ld r23, X+ 3058c: 8d 91 ld r24, X+ 3058e: 9c 91 ld r25, X 30590: 18 97 sbiw r26, 0x08 ; 8 30592: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 30596: a7 01 movw r20, r14 30598: 96 01 movw r18, r12 3059a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 3059e: a0 96 adiw r28, 0x20 ; 32 305a0: ee ad ldd r30, Y+62 ; 0x3e 305a2: ff ad ldd r31, Y+63 ; 0x3f 305a4: a0 97 sbiw r28, 0x20 ; 32 305a6: 65 83 std Z+5, r22 ; 0x05 305a8: 76 83 std Z+6, r23 ; 0x06 305aa: 87 83 std Z+7, r24 ; 0x07 305ac: 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) 305ae: 20 e0 ldi r18, 0x00 ; 0 305b0: 30 e0 ldi r19, 0x00 ; 0 305b2: 40 e8 ldi r20, 0x80 ; 128 305b4: 50 ec ldi r21, 0xC0 ; 192 305b6: c7 01 movw r24, r14 305b8: b6 01 movw r22, r12 305ba: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 305be: 87 ff sbrs r24, 7 305c0: 0c c0 rjmp .+24 ; 0x305da current_position[Y_AXIS] = Y_MIN_POS; 305c2: 80 e0 ldi r24, 0x00 ; 0 305c4: 90 e0 ldi r25, 0x00 ; 0 305c6: a0 e8 ldi r26, 0x80 ; 128 305c8: b0 ec ldi r27, 0xC0 ; 192 305ca: 80 93 65 12 sts 0x1265, r24 ; 0x801265 305ce: 90 93 66 12 sts 0x1266, r25 ; 0x801266 305d2: a0 93 67 12 sts 0x1267, r26 ; 0x801267 305d6: b0 93 68 12 sts 0x1268, r27 ; 0x801268 // 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; 305da: 20 e0 ldi r18, 0x00 ; 0 305dc: 30 e0 ldi r19, 0x00 ; 0 305de: 40 e4 ldi r20, 0x40 ; 64 305e0: 50 e4 ldi r21, 0x40 ; 64 305e2: 60 91 69 12 lds r22, 0x1269 ; 0x801269 305e6: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 305ea: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 305ee: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 305f2: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 305f6: 60 93 69 12 sts 0x1269, r22 ; 0x801269 305fa: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 305fe: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 30602: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c 30606: e0 96 adiw r28, 0x30 ; 48 30608: 2e ad ldd r18, Y+62 ; 0x3e 3060a: 3f ad ldd r19, Y+63 ; 0x3f 3060c: e0 97 sbiw r28, 0x30 ; 48 3060e: 28 5f subi r18, 0xF8 ; 248 30610: 3f 4f sbci r19, 0xFF ; 255 30612: e0 96 adiw r28, 0x30 ; 48 30614: 3f af std Y+63, r19 ; 0x3f 30616: 2e af std Y+62, r18 ; 0x3e 30618: e0 97 sbiw r28, 0x30 ; 48 3061a: a0 96 adiw r28, 0x20 ; 32 3061c: 4e ad ldd r20, Y+62 ; 0x3e 3061e: 5f ad ldd r21, Y+63 ; 0x3f 30620: a0 97 sbiw r28, 0x20 ; 32 30622: 48 5f subi r20, 0xF8 ; 248 30624: 5f 4f sbci r21, 0xFF ; 255 30626: a0 96 adiw r28, 0x20 ; 32 30628: 5f af std Y+63, r21 ; 0x3f 3062a: 4e af std Y+62, r20 ; 0x3e 3062c: 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) { 3062e: 54 e0 ldi r21, 0x04 ; 4 30630: 25 16 cp r2, r21 30632: 31 04 cpc r3, r1 30634: 09 f0 breq .+2 ; 0x30638 30636: 1c cb rjmp .-2504 ; 0x2fc70 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 30638: a7 96 adiw r28, 0x27 ; 39 3063a: 6f ad ldd r22, Y+63 ; 0x3f 3063c: a7 97 sbiw r28, 0x27 ; 39 3063e: 66 23 and r22, r22 30640: 31 f0 breq .+12 ; 0x3064e 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) { 30642: e1 96 adiw r28, 0x31 ; 49 30644: 8f ad ldd r24, Y+63 ; 0x3f 30646: e1 97 sbiw r28, 0x31 ; 49 30648: 81 30 cpi r24, 0x01 ; 1 3064a: 09 f0 breq .+2 ; 0x3064e 3064c: da ce rjmp .-588 ; 0x30402 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 3064e: 89 eb ldi r24, 0xB9 ; 185 30650: 9b e6 ldi r25, 0x6B ; 107 30652: 9f 93 push r25 30654: 8f 93 push r24 30656: 0f 94 5f a2 call 0x344be ; 0x344be delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 3065a: 90 e0 ldi r25, 0x00 ; 0 3065c: 80 e0 ldi r24, 0x00 ; 0 3065e: 0e 94 7f 8c call 0x118fe ; 0x118fe 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) { 30662: 0f 90 pop r0 30664: 0f 90 pop r0 30666: 20 e0 ldi r18, 0x00 ; 0 30668: 30 e0 ldi r19, 0x00 ; 0 3066a: 40 e9 ldi r20, 0x90 ; 144 3066c: 50 ec ldi r21, 0xC0 ; 192 3066e: 60 91 0e 13 lds r22, 0x130E ; 0x80130e 30672: 70 91 0f 13 lds r23, 0x130F ; 0x80130f 30676: 80 91 10 13 lds r24, 0x1310 ; 0x801310 3067a: 90 91 11 13 lds r25, 0x1311 ; 0x801311 3067e: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 30682: 87 ff sbrs r24, 7 30684: 45 c1 rjmp .+650 ; 0x30910 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 30686: 8f ef ldi r24, 0xFF ; 255 30688: 9b e9 ldi r25, 0x9B ; 155 3068a: 0e 94 8d 7c call 0xf91a ; 0xf91a SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 3068e: 8d ec ldi r24, 0xCD ; 205 30690: 9b e9 ldi r25, 0x9B ; 155 30692: 0e 94 94 7a call 0xf528 ; 0xf528 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 30696: 60 91 0e 13 lds r22, 0x130E ; 0x80130e 3069a: 70 91 0f 13 lds r23, 0x130F ; 0x80130f 3069e: 80 91 10 13 lds r24, 0x1310 ; 0x801310 306a2: 90 91 11 13 lds r25, 0x1311 ; 0x801311 306a6: 42 e0 ldi r20, 0x02 ; 2 306a8: 0e 94 16 7a call 0xf42c ; 0xf42c MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 306ac: 89 ec ldi r24, 0xC9 ; 201 306ae: 9b e9 ldi r25, 0x9B ; 155 306b0: 0e 94 94 7a call 0xf528 ; 0xf528 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 306b4: 60 e0 ldi r22, 0x00 ; 0 306b6: 70 e0 ldi r23, 0x00 ; 0 306b8: 80 e9 ldi r24, 0x90 ; 144 306ba: 90 ec ldi r25, 0xC0 ; 192 306bc: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 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 306c0: 92 e0 ldi r25, 0x02 ; 2 306c2: af 96 adiw r28, 0x2f ; 47 306c4: 9f af std Y+63, r25 ; 0x3f 306c6: 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; 306c8: 10 92 3a 13 sts 0x133A, r1 ; 0x80133a 306cc: 10 92 3b 13 sts 0x133B, r1 ; 0x80133b 306d0: 10 92 3c 13 sts 0x133C, r1 ; 0x80133c 306d4: 10 92 3d 13 sts 0x133D, r1 ; 0x80133d cntr[1] = 0.f; 306d8: 10 92 3e 13 sts 0x133E, r1 ; 0x80133e 306dc: 10 92 3f 13 sts 0x133F, r1 ; 0x80133f 306e0: 10 92 40 13 sts 0x1340, r1 ; 0x801340 306e4: 10 92 41 13 sts 0x1341, r1 ; 0x801341 306e8: a4 e6 ldi r26, 0x64 ; 100 306ea: e6 96 adiw r28, 0x36 ; 54 306ec: af af std Y+63, r26 ; 0x3f 306ee: 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; 306f0: a2 96 adiw r28, 0x22 ; 34 306f2: 1c ae std Y+60, r1 ; 0x3c 306f4: 1d ae std Y+61, r1 ; 0x3d 306f6: 1e ae std Y+62, r1 ; 0x3e 306f8: 1f ae std Y+63, r1 ; 0x3f 306fa: 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; 306fc: a6 96 adiw r28, 0x26 ; 38 306fe: 1c ae std Y+60, r1 ; 0x3c 30700: 1d ae std Y+61, r1 ; 0x3d 30702: 1e ae std Y+62, r1 ; 0x3e 30704: 1f ae std Y+63, r1 ; 0x3f 30706: 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 }; 30708: fe 01 movw r30, r28 3070a: 31 96 adiw r30, 0x01 ; 1 3070c: 68 96 adiw r28, 0x18 ; 24 3070e: ff af std Y+63, r31 ; 0x3f 30710: ee af std Y+62, r30 ; 0x3e 30712: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 30714: 9e 01 movw r18, r28 30716: 2f 5b subi r18, 0xBF ; 191 30718: 3f 4f sbci r19, 0xFF ; 255 3071a: 6a 96 adiw r28, 0x1a ; 26 3071c: 3f af std Y+63, r19 ; 0x3f 3071e: 2e af std Y+62, r18 ; 0x3e 30720: 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; 30722: a6 96 adiw r28, 0x26 ; 38 30724: 6c ad ldd r22, Y+60 ; 0x3c 30726: 7d ad ldd r23, Y+61 ; 0x3d 30728: 8e ad ldd r24, Y+62 ; 0x3e 3072a: 9f ad ldd r25, Y+63 ; 0x3f 3072c: a6 97 sbiw r28, 0x26 ; 38 3072e: 0f 94 bf a5 call 0x34b7e ; 0x34b7e 30732: 6e 96 adiw r28, 0x1e ; 30 30734: 6c af std Y+60, r22 ; 0x3c 30736: 7d af std Y+61, r23 ; 0x3d 30738: 8e af std Y+62, r24 ; 0x3e 3073a: 9f af std Y+63, r25 ; 0x3f 3073c: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 3073e: a6 96 adiw r28, 0x26 ; 38 30740: 6c ad ldd r22, Y+60 ; 0x3c 30742: 7d ad ldd r23, Y+61 ; 0x3d 30744: 8e ad ldd r24, Y+62 ; 0x3e 30746: 9f ad ldd r25, Y+63 ; 0x3f 30748: a6 97 sbiw r28, 0x26 ; 38 3074a: 0f 94 85 a8 call 0x3510a ; 0x3510a 3074e: cb 57 subi r28, 0x7B ; 123 30750: df 4f sbci r29, 0xFF ; 255 30752: 68 83 st Y, r22 30754: 79 83 std Y+1, r23 ; 0x01 30756: 8a 83 std Y+2, r24 ; 0x02 30758: 9b 83 std Y+3, r25 ; 0x03 3075a: c5 58 subi r28, 0x85 ; 133 3075c: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 3075e: a2 96 adiw r28, 0x22 ; 34 30760: 6c ad ldd r22, Y+60 ; 0x3c 30762: 7d ad ldd r23, Y+61 ; 0x3d 30764: 8e ad ldd r24, Y+62 ; 0x3e 30766: 9f ad ldd r25, Y+63 ; 0x3f 30768: a2 97 sbiw r28, 0x22 ; 34 3076a: 0f 94 bf a5 call 0x34b7e ; 0x34b7e 3076e: c7 57 subi r28, 0x77 ; 119 30770: df 4f sbci r29, 0xFF ; 255 30772: 68 83 st Y, r22 30774: 79 83 std Y+1, r23 ; 0x01 30776: 8a 83 std Y+2, r24 ; 0x02 30778: 9b 83 std Y+3, r25 ; 0x03 3077a: c9 58 subi r28, 0x89 ; 137 3077c: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 3077e: a2 96 adiw r28, 0x22 ; 34 30780: 6c ad ldd r22, Y+60 ; 0x3c 30782: 7d ad ldd r23, Y+61 ; 0x3d 30784: 8e ad ldd r24, Y+62 ; 0x3e 30786: 9f ad ldd r25, Y+63 ; 0x3f 30788: a2 97 sbiw r28, 0x22 ; 34 3078a: 0f 94 85 a8 call 0x3510a ; 0x3510a 3078e: cb 56 subi r28, 0x6B ; 107 30790: df 4f sbci r29, 0xFF ; 255 30792: 68 83 st Y, r22 30794: 79 83 std Y+1, r23 ; 0x01 30796: 8a 83 std Y+2, r24 ; 0x02 30798: 9b 83 std Y+3, r25 ; 0x03 3079a: c5 59 subi r28, 0x95 ; 149 3079c: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 3079e: 68 96 adiw r28, 0x18 ; 24 307a0: ae ad ldd r26, Y+62 ; 0x3e 307a2: bf ad ldd r27, Y+63 ; 0x3f 307a4: 68 97 sbiw r28, 0x18 ; 24 307a6: e0 e4 ldi r30, 0x40 ; 64 307a8: 1d 92 st X+, r1 307aa: ea 95 dec r30 307ac: e9 f7 brne .-6 ; 0x307a8 float b[4] = { 0.f }; 307ae: 80 e1 ldi r24, 0x10 ; 16 307b0: 6a 96 adiw r28, 0x1a ; 26 307b2: ae ad ldd r26, Y+62 ; 0x3e 307b4: bf ad ldd r27, Y+63 ; 0x3f 307b6: 6a 97 sbiw r28, 0x1a ; 26 307b8: 1d 92 st X+, r1 307ba: 8a 95 dec r24 307bc: e9 f7 brne .-6 ; 0x307b8 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 307be: 90 e0 ldi r25, 0x00 ; 0 307c0: 80 e0 ldi r24, 0x00 ; 0 307c2: 0e 94 7f 8c call 0x118fe ; 0x118fe 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); 307c6: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 307ca: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 307ce: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 307d2: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 307d6: c5 55 subi r28, 0x55 ; 85 307d8: df 4f sbci r29, 0xFF ; 255 307da: 28 83 st Y, r18 307dc: 39 83 std Y+1, r19 ; 0x01 307de: 4a 83 std Y+2, r20 ; 0x02 307e0: 5b 83 std Y+3, r21 ; 0x03 307e2: cb 5a subi r28, 0xAB ; 171 307e4: 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); 307e6: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 307ea: 90 91 3f 13 lds r25, 0x133F ; 0x80133f 307ee: a0 91 40 13 lds r26, 0x1340 ; 0x801340 307f2: b0 91 41 13 lds r27, 0x1341 ; 0x801341 307f6: c1 55 subi r28, 0x51 ; 81 307f8: df 4f sbci r29, 0xFF ; 255 307fa: 88 83 st Y, r24 307fc: 99 83 std Y+1, r25 ; 0x01 307fe: aa 83 std Y+2, r26 ; 0x02 30800: bb 83 std Y+3, r27 ; 0x03 30802: cf 5a subi r28, 0xAF ; 175 30804: d0 40 sbci r29, 0x00 ; 0 30806: de 01 movw r26, r28 30808: af 5b subi r26, 0xBF ; 191 3080a: bf 4f sbci r27, 0xFF ; 255 3080c: c7 56 subi r28, 0x67 ; 103 3080e: df 4f sbci r29, 0xFF ; 255 30810: b9 83 std Y+1, r27 ; 0x01 30812: a8 83 st Y, r26 30814: c9 59 subi r28, 0x99 ; 153 30816: d0 40 sbci r29, 0x00 ; 0 30818: fe 01 movw r30, r28 3081a: 31 96 adiw r30, 0x01 ; 1 3081c: ac 96 adiw r28, 0x2c ; 44 3081e: ff af std Y+63, r31 ; 0x3f 30820: ee af std Y+62, r30 ; 0x3e 30822: 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) { 30824: 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])); 30826: cb 56 subi r28, 0x6B ; 107 30828: df 4f sbci r29, 0xFF ; 255 3082a: 28 81 ld r18, Y 3082c: 39 81 ldd r19, Y+1 ; 0x01 3082e: 4a 81 ldd r20, Y+2 ; 0x02 30830: 5b 81 ldd r21, Y+3 ; 0x03 30832: c5 59 subi r28, 0x95 ; 149 30834: d0 40 sbci r29, 0x00 ; 0 30836: 50 58 subi r21, 0x80 ; 128 30838: ed 96 adiw r28, 0x3d ; 61 3083a: 2c af std Y+60, r18 ; 0x3c 3083c: 3d af std Y+61, r19 ; 0x3d 3083e: 4e af std Y+62, r20 ; 0x3e 30840: 5f af std Y+63, r21 ; 0x3f 30842: 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])); 30844: c7 57 subi r28, 0x77 ; 119 30846: df 4f sbci r29, 0xFF ; 255 30848: 88 81 ld r24, Y 3084a: 99 81 ldd r25, Y+1 ; 0x01 3084c: aa 81 ldd r26, Y+2 ; 0x02 3084e: bb 81 ldd r27, Y+3 ; 0x03 30850: c9 58 subi r28, 0x89 ; 137 30852: d0 40 sbci r29, 0x00 ; 0 30854: b0 58 subi r27, 0x80 ; 128 30856: c3 58 subi r28, 0x83 ; 131 30858: df 4f sbci r29, 0xFF ; 255 3085a: 88 83 st Y, r24 3085c: 99 83 std Y+1, r25 ; 0x01 3085e: aa 83 std Y+2, r26 ; 0x02 30860: bb 83 std Y+3, r27 ; 0x03 30862: cd 57 subi r28, 0x7D ; 125 30864: 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]) : 30866: cb 57 subi r28, 0x7B ; 123 30868: df 4f sbci r29, 0xFF ; 255 3086a: 28 81 ld r18, Y 3086c: 39 81 ldd r19, Y+1 ; 0x01 3086e: 4a 81 ldd r20, Y+2 ; 0x02 30870: 5b 81 ldd r21, Y+3 ; 0x03 30872: c5 58 subi r28, 0x85 ; 133 30874: d0 40 sbci r29, 0x00 ; 0 30876: 50 58 subi r21, 0x80 ; 128 30878: cf 57 subi r28, 0x7F ; 127 3087a: df 4f sbci r29, 0xFF ; 255 3087c: 28 83 st Y, r18 3087e: 39 83 std Y+1, r19 ; 0x01 30880: 4a 83 std Y+2, r20 ; 0x02 30882: 5b 83 std Y+3, r21 ; 0x03 30884: c1 58 subi r28, 0x81 ; 129 30886: 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) { 30888: ac 96 adiw r28, 0x2c ; 44 3088a: 2e ac ldd r2, Y+62 ; 0x3e 3088c: 3f ac ldd r3, Y+63 ; 0x3f 3088e: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 30890: 10 e0 ldi r17, 0x00 ; 0 30892: 69 e0 ldi r22, 0x09 ; 9 30894: 46 2e mov r4, r22 30896: 63 e1 ldi r22, 0x13 ; 19 30898: 56 2e mov r5, r22 3089a: 74 e0 ldi r23, 0x04 ; 4 3089c: 77 2e mov r7, r23 acc = 0; 3089e: c1 2c mov r12, r1 308a0: d1 2c mov r13, r1 308a2: 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) { 308a4: 01 30 cpi r16, 0x01 ; 1 308a6: 11 f4 brne .+4 ; 0x308ac 308a8: 0d 94 80 8e jmp 0x31d00 ; 0x31d00 308ac: 11 30 cpi r17, 0x01 ; 1 308ae: 11 f4 brne .+4 ; 0x308b4 308b0: 0d 94 32 8e jmp 0x31c64 ; 0x31c64 float a = (r == 0) ? 1.f : 308b4: 00 23 and r16, r16 308b6: 11 f4 brne .+4 ; 0x308bc 308b8: 0d 94 72 8e jmp 0x31ce4 ; 0x31ce4 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 308bc: 02 30 cpi r16, 0x02 ; 2 308be: 61 f5 brne .+88 ; 0x30918 308c0: d2 01 movw r26, r4 308c2: 11 96 adiw r26, 0x01 ; 1 308c4: 2d 91 ld r18, X+ 308c6: 3d 91 ld r19, X+ 308c8: 4d 91 ld r20, X+ 308ca: 5c 91 ld r21, X 308cc: 14 97 sbiw r26, 0x04 ; 4 308ce: cf 57 subi r28, 0x7F ; 127 308d0: df 4f sbci r29, 0xFF ; 255 308d2: 68 81 ld r22, Y 308d4: 79 81 ldd r23, Y+1 ; 0x01 308d6: 8a 81 ldd r24, Y+2 ; 0x02 308d8: 9b 81 ldd r25, Y+3 ; 0x03 308da: c1 58 subi r28, 0x81 ; 129 308dc: d0 40 sbci r29, 0x00 ; 0 308de: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 308e2: 4b 01 movw r8, r22 308e4: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 308e6: 11 11 cpse r17, r1 308e8: 25 c0 rjmp .+74 ; 0x30934 308ea: 60 e0 ldi r22, 0x00 ; 0 308ec: 70 e0 ldi r23, 0x00 ; 0 308ee: 80 e8 ldi r24, 0x80 ; 128 308f0: 9f e3 ldi r25, 0x3F ; 63 308f2: 35 c0 rjmp .+106 ; 0x3095e int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 308f4: 2f 3f cpi r18, 0xFF ; 255 308f6: 09 f0 breq .+2 ; 0x308fa 308f8: 98 cb rjmp .-2256 ; 0x3002a ++maxs; 308fa: 01 96 adiw r24, 0x01 ; 1 308fc: 96 cb rjmp .-2260 ; 0x3002a /// 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; 308fe: 1f ef ldi r17, 0xFF ; 255 30900: 2c cd rjmp .-1448 ; 0x3035a 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; 30902: e5 96 adiw r28, 0x35 ; 53 30904: bf ad ldd r27, Y+63 ; 0x3f 30906: e5 97 sbiw r28, 0x35 ; 53 30908: a7 96 adiw r28, 0x27 ; 39 3090a: bf af std Y+63, r27 ; 0x3f 3090c: a7 97 sbiw r28, 0x27 ; 39 3090e: 0f ce rjmp .-994 ; 0x3052e // 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; 30910: af 96 adiw r28, 0x2f ; 47 30912: 1f ae std Y+63, r1 ; 0x3f 30914: af 97 sbiw r28, 0x2f ; 47 30916: d8 ce rjmp .-592 ; 0x306c8 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]) : 30918: f2 01 movw r30, r4 3091a: 25 81 ldd r18, Z+5 ; 0x05 3091c: 36 81 ldd r19, Z+6 ; 0x06 3091e: 47 81 ldd r20, Z+7 ; 0x07 30920: 50 85 ldd r21, Z+8 ; 0x08 30922: c3 58 subi r28, 0x83 ; 131 30924: df 4f sbci r29, 0xFF ; 255 30926: 68 81 ld r22, Y 30928: 79 81 ldd r23, Y+1 ; 0x01 3092a: 8a 81 ldd r24, Y+2 ; 0x02 3092c: 9b 81 ldd r25, Y+3 ; 0x03 3092e: cd 57 subi r28, 0x7D ; 125 30930: d0 40 sbci r29, 0x00 ; 0 30932: d5 cf rjmp .-86 ; 0x308de (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 30934: 12 30 cpi r17, 0x02 ; 2 30936: 11 f0 breq .+4 ; 0x3093c 30938: 0d 94 73 8d jmp 0x31ae6 ; 0x31ae6 3093c: d2 01 movw r26, r4 3093e: 11 96 adiw r26, 0x01 ; 1 30940: 2d 91 ld r18, X+ 30942: 3d 91 ld r19, X+ 30944: 4d 91 ld r20, X+ 30946: 5c 91 ld r21, X 30948: 14 97 sbiw r26, 0x04 ; 4 3094a: cf 57 subi r28, 0x7F ; 127 3094c: df 4f sbci r29, 0xFF ; 255 3094e: 68 81 ld r22, Y 30950: 79 81 ldd r23, Y+1 ; 0x01 30952: 8a 81 ldd r24, Y+2 ; 0x02 30954: 9b 81 ldd r25, Y+3 ; 0x03 30956: c1 58 subi r28, 0x81 ; 129 30958: d0 40 sbci r29, 0x00 ; 0 3095a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 3095e: 9b 01 movw r18, r22 30960: ac 01 movw r20, r24 30962: c5 01 movw r24, r10 30964: b4 01 movw r22, r8 30966: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3096a: 9b 01 movw r18, r22 3096c: ac 01 movw r20, r24 3096e: c7 01 movw r24, r14 30970: b6 01 movw r22, r12 30972: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30976: 6b 01 movw r12, r22 30978: 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) { 3097a: 01 11 cpse r16, r1 3097c: 0d 94 8a 8e jmp 0x31d14 ; 0x31d14 30980: 7a 94 dec r7 30982: f8 e0 ldi r31, 0x08 ; 8 30984: 4f 0e add r4, r31 30986: 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) { 30988: 71 10 cpse r7, r1 3098a: 8c cf rjmp .-232 ; 0x308a4 (-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; 3098c: d1 01 movw r26, r2 3098e: cd 92 st X+, r12 30990: dd 92 st X+, r13 30992: ed 92 st X+, r14 30994: fd 92 st X+, r15 30996: 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) { 30998: 1f 5f subi r17, 0xFF ; 255 3099a: 14 30 cpi r17, 0x04 ; 4 3099c: 09 f0 breq .+2 ; 0x309a0 3099e: 79 cf rjmp .-270 ; 0x30892 309a0: 30 e0 ldi r19, 0x00 ; 0 309a2: 23 2e mov r2, r19 309a4: 3c e9 ldi r19, 0x9C ; 156 309a6: 33 2e mov r3, r19 309a8: e9 e0 ldi r30, 0x09 ; 9 309aa: f3 e1 ldi r31, 0x13 ; 19 309ac: a8 96 adiw r28, 0x28 ; 40 309ae: ff af std Y+63, r31 ; 0x3f 309b0: ee af std Y+62, r30 ; 0x3e 309b2: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 309b4: c3 57 subi r28, 0x73 ; 115 309b6: df 4f sbci r29, 0xFF ; 255 309b8: 18 82 st Y, r1 309ba: cd 58 subi r28, 0x8D ; 141 309bc: d0 40 sbci r29, 0x00 ; 0 309be: c3 56 subi r28, 0x63 ; 99 309c0: df 4f sbci r29, 0xFF ; 255 309c2: 18 82 st Y, r1 309c4: cd 59 subi r28, 0x9D ; 157 309c6: d0 40 sbci r29, 0x00 ; 0 309c8: cf 55 subi r28, 0x5F ; 95 309ca: df 4f sbci r29, 0xFF ; 255 309cc: 18 82 st Y, r1 309ce: c1 5a subi r28, 0xA1 ; 161 309d0: d0 40 sbci r29, 0x00 ; 0 309d2: 10 e0 ldi r17, 0x00 ; 0 309d4: a8 96 adiw r28, 0x28 ; 40 309d6: ae ad ldd r26, Y+62 ; 0x3e 309d8: bf ad ldd r27, Y+63 ; 0x3f 309da: a8 97 sbiw r28, 0x28 ; 40 309dc: 11 96 adiw r26, 0x01 ; 1 309de: 2d 91 ld r18, X+ 309e0: 3d 91 ld r19, X+ 309e2: 4d 91 ld r20, X+ 309e4: 5c 91 ld r21, X 309e6: 14 97 sbiw r26, 0x04 ; 4 309e8: e4 96 adiw r28, 0x34 ; 52 309ea: 2c af std Y+60, r18 ; 0x3c 309ec: 3d af std Y+61, r19 ; 0x3d 309ee: 4e af std Y+62, r20 ; 0x3e 309f0: 5f af std Y+63, r21 ; 0x3f 309f2: e4 97 sbiw r28, 0x34 ; 52 309f4: 15 96 adiw r26, 0x05 ; 5 309f6: 4d 90 ld r4, X+ 309f8: 5d 90 ld r5, X+ 309fa: 6d 90 ld r6, X+ 309fc: 7c 90 ld r7, X 309fe: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 30a00: 00 23 and r16, r16 30a02: 11 f4 brne .+4 ; 0x30a08 30a04: 0d 94 a6 8d jmp 0x31b4c ; 0x31b4c ((r == 1) ? 0.f : 30a08: 81 2c mov r8, r1 30a0a: 91 2c mov r9, r1 30a0c: 54 01 movw r10, r8 30a0e: 01 30 cpi r16, 0x01 ; 1 30a10: 81 f0 breq .+32 ; 0x30a32 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 30a12: 02 30 cpi r16, 0x02 ; 2 30a14: 11 f0 breq .+4 ; 0x30a1a 30a16: 0d 94 9a 8d jmp 0x31b34 ; 0x31b34 30a1a: cf 57 subi r28, 0x7F ; 127 30a1c: df 4f sbci r29, 0xFF ; 255 30a1e: 68 81 ld r22, Y 30a20: 79 81 ldd r23, Y+1 ; 0x01 30a22: 8a 81 ldd r24, Y+2 ; 0x02 30a24: 9b 81 ldd r25, Y+3 ; 0x03 30a26: c1 58 subi r28, 0x81 ; 129 30a28: d0 40 sbci r29, 0x00 ; 0 30a2a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30a2e: 4b 01 movw r8, r22 30a30: 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); 30a32: e4 96 adiw r28, 0x34 ; 52 30a34: 2c ad ldd r18, Y+60 ; 0x3c 30a36: 3d ad ldd r19, Y+61 ; 0x3d 30a38: 4e ad ldd r20, Y+62 ; 0x3e 30a3a: 5f ad ldd r21, Y+63 ; 0x3f 30a3c: e4 97 sbiw r28, 0x34 ; 52 30a3e: 6e 96 adiw r28, 0x1e ; 30 30a40: 6c ad ldd r22, Y+60 ; 0x3c 30a42: 7d ad ldd r23, Y+61 ; 0x3d 30a44: 8e ad ldd r24, Y+62 ; 0x3e 30a46: 9f ad ldd r25, Y+63 ; 0x3f 30a48: 6e 97 sbiw r28, 0x1e ; 30 30a4a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30a4e: 6b 01 movw r12, r22 30a50: 7c 01 movw r14, r24 30a52: f1 01 movw r30, r2 30a54: 25 91 lpm r18, Z+ 30a56: 35 91 lpm r19, Z+ 30a58: 45 91 lpm r20, Z+ 30a5a: 54 91 lpm r21, Z 30a5c: cb 55 subi r28, 0x5B ; 91 30a5e: df 4f sbci r29, 0xFF ; 255 30a60: 28 83 st Y, r18 30a62: 39 83 std Y+1, r19 ; 0x01 30a64: 4a 83 std Y+2, r20 ; 0x02 30a66: 5b 83 std Y+3, r21 ; 0x03 30a68: c5 5a subi r28, 0xA5 ; 165 30a6a: d0 40 sbci r29, 0x00 ; 0 30a6c: a3 01 movw r20, r6 30a6e: 92 01 movw r18, r4 30a70: cb 56 subi r28, 0x6B ; 107 30a72: df 4f sbci r29, 0xFF ; 255 30a74: 68 81 ld r22, Y 30a76: 79 81 ldd r23, Y+1 ; 0x01 30a78: 8a 81 ldd r24, Y+2 ; 0x02 30a7a: 9b 81 ldd r25, Y+3 ; 0x03 30a7c: c5 59 subi r28, 0x95 ; 149 30a7e: d0 40 sbci r29, 0x00 ; 0 30a80: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30a84: 9b 01 movw r18, r22 30a86: ac 01 movw r20, r24 30a88: c7 01 movw r24, r14 30a8a: b6 01 movw r22, r12 30a8c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30a90: c5 55 subi r28, 0x55 ; 85 30a92: df 4f sbci r29, 0xFF ; 255 30a94: 28 81 ld r18, Y 30a96: 39 81 ldd r19, Y+1 ; 0x01 30a98: 4a 81 ldd r20, Y+2 ; 0x02 30a9a: 5b 81 ldd r21, Y+3 ; 0x03 30a9c: cb 5a subi r28, 0xAB ; 171 30a9e: d0 40 sbci r29, 0x00 ; 0 30aa0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30aa4: cb 55 subi r28, 0x5B ; 91 30aa6: df 4f sbci r29, 0xFF ; 255 30aa8: 28 81 ld r18, Y 30aaa: 39 81 ldd r19, Y+1 ; 0x01 30aac: 4a 81 ldd r20, Y+2 ; 0x02 30aae: 5b 81 ldd r21, Y+3 ; 0x03 30ab0: c5 5a subi r28, 0xA5 ; 165 30ab2: d0 40 sbci r29, 0x00 ; 0 30ab4: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 30ab8: a5 01 movw r20, r10 30aba: 94 01 movw r18, r8 30abc: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30ac0: c3 57 subi r28, 0x73 ; 115 30ac2: df 4f sbci r29, 0xFF ; 255 30ac4: 28 81 ld r18, Y 30ac6: cd 58 subi r28, 0x8D ; 141 30ac8: d0 40 sbci r29, 0x00 ; 0 30aca: c3 56 subi r28, 0x63 ; 99 30acc: df 4f sbci r29, 0xFF ; 255 30ace: 38 81 ld r19, Y 30ad0: cd 59 subi r28, 0x9D ; 157 30ad2: d0 40 sbci r29, 0x00 ; 0 30ad4: cf 55 subi r28, 0x5F ; 95 30ad6: df 4f sbci r29, 0xFF ; 255 30ad8: 48 81 ld r20, Y 30ada: c1 5a subi r28, 0xA1 ; 161 30adc: d0 40 sbci r29, 0x00 ; 0 30ade: 51 2f mov r21, r17 30ae0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30ae4: c3 57 subi r28, 0x73 ; 115 30ae6: df 4f sbci r29, 0xFF ; 255 30ae8: 68 83 st Y, r22 30aea: 79 83 std Y+1, r23 ; 0x01 30aec: 8a 83 std Y+2, r24 ; 0x02 30aee: 9b 83 std Y+3, r25 ; 0x03 30af0: cd 58 subi r28, 0x8D ; 141 30af2: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 30af4: 00 23 and r16, r16 30af6: 11 f4 brne .+4 ; 0x30afc 30af8: 0d 94 ae 8d jmp 0x31b5c ; 0x31b5c ((r == 1) ? 1.f : 30afc: 01 30 cpi r16, 0x01 ; 1 30afe: 11 f4 brne .+4 ; 0x30b04 30b00: 0d 94 b3 8d jmp 0x31b66 ; 0x31b66 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 30b04: 02 30 cpi r16, 0x02 ; 2 30b06: 61 f0 breq .+24 ; 0x30b20 30b08: a3 01 movw r20, r6 30b0a: 92 01 movw r18, r4 30b0c: ed 96 adiw r28, 0x3d ; 61 30b0e: 6c ad ldd r22, Y+60 ; 0x3c 30b10: 7d ad ldd r23, Y+61 ; 0x3d 30b12: 8e ad ldd r24, Y+62 ; 0x3e 30b14: 9f ad ldd r25, Y+63 ; 0x3f 30b16: ed 97 sbiw r28, 0x3d ; 61 30b18: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30b1c: 6b 01 movw r12, r22 30b1e: 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); 30b20: f1 01 movw r30, r2 30b22: 34 96 adiw r30, 0x04 ; 4 30b24: 85 90 lpm r8, Z+ 30b26: 95 90 lpm r9, Z+ 30b28: a5 90 lpm r10, Z+ 30b2a: b4 90 lpm r11, Z 30b2c: e4 96 adiw r28, 0x34 ; 52 30b2e: 2c ad ldd r18, Y+60 ; 0x3c 30b30: 3d ad ldd r19, Y+61 ; 0x3d 30b32: 4e ad ldd r20, Y+62 ; 0x3e 30b34: 5f ad ldd r21, Y+63 ; 0x3f 30b36: e4 97 sbiw r28, 0x34 ; 52 30b38: cb 57 subi r28, 0x7B ; 123 30b3a: df 4f sbci r29, 0xFF ; 255 30b3c: 68 81 ld r22, Y 30b3e: 79 81 ldd r23, Y+1 ; 0x01 30b40: 8a 81 ldd r24, Y+2 ; 0x02 30b42: 9b 81 ldd r25, Y+3 ; 0x03 30b44: c5 58 subi r28, 0x85 ; 133 30b46: d0 40 sbci r29, 0x00 ; 0 30b48: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30b4c: e4 96 adiw r28, 0x34 ; 52 30b4e: 6c af std Y+60, r22 ; 0x3c 30b50: 7d af std Y+61, r23 ; 0x3d 30b52: 8e af std Y+62, r24 ; 0x3e 30b54: 9f af std Y+63, r25 ; 0x3f 30b56: e4 97 sbiw r28, 0x34 ; 52 30b58: a3 01 movw r20, r6 30b5a: 92 01 movw r18, r4 30b5c: c7 57 subi r28, 0x77 ; 119 30b5e: df 4f sbci r29, 0xFF ; 255 30b60: 68 81 ld r22, Y 30b62: 79 81 ldd r23, Y+1 ; 0x01 30b64: 8a 81 ldd r24, Y+2 ; 0x02 30b66: 9b 81 ldd r25, Y+3 ; 0x03 30b68: c9 58 subi r28, 0x89 ; 137 30b6a: d0 40 sbci r29, 0x00 ; 0 30b6c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30b70: 9b 01 movw r18, r22 30b72: ac 01 movw r20, r24 30b74: e4 96 adiw r28, 0x34 ; 52 30b76: 6c ad ldd r22, Y+60 ; 0x3c 30b78: 7d ad ldd r23, Y+61 ; 0x3d 30b7a: 8e ad ldd r24, Y+62 ; 0x3e 30b7c: 9f ad ldd r25, Y+63 ; 0x3f 30b7e: e4 97 sbiw r28, 0x34 ; 52 30b80: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30b84: c1 55 subi r28, 0x51 ; 81 30b86: df 4f sbci r29, 0xFF ; 255 30b88: 28 81 ld r18, Y 30b8a: 39 81 ldd r19, Y+1 ; 0x01 30b8c: 4a 81 ldd r20, Y+2 ; 0x02 30b8e: 5b 81 ldd r21, Y+3 ; 0x03 30b90: cf 5a subi r28, 0xAF ; 175 30b92: d0 40 sbci r29, 0x00 ; 0 30b94: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30b98: a5 01 movw r20, r10 30b9a: 94 01 movw r18, r8 30b9c: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 30ba0: a7 01 movw r20, r14 30ba2: 96 01 movw r18, r12 30ba4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30ba8: c3 57 subi r28, 0x73 ; 115 30baa: df 4f sbci r29, 0xFF ; 255 30bac: 28 81 ld r18, Y 30bae: 39 81 ldd r19, Y+1 ; 0x01 30bb0: 4a 81 ldd r20, Y+2 ; 0x02 30bb2: 5b 81 ldd r21, Y+3 ; 0x03 30bb4: cd 58 subi r28, 0x8D ; 141 30bb6: d0 40 sbci r29, 0x00 ; 0 30bb8: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 30bbc: c3 57 subi r28, 0x73 ; 115 30bbe: df 4f sbci r29, 0xFF ; 255 30bc0: 68 83 st Y, r22 30bc2: cd 58 subi r28, 0x8D ; 141 30bc4: d0 40 sbci r29, 0x00 ; 0 30bc6: c3 56 subi r28, 0x63 ; 99 30bc8: df 4f sbci r29, 0xFF ; 255 30bca: 78 83 st Y, r23 30bcc: cd 59 subi r28, 0x9D ; 157 30bce: d0 40 sbci r29, 0x00 ; 0 30bd0: cf 55 subi r28, 0x5F ; 95 30bd2: df 4f sbci r29, 0xFF ; 255 30bd4: 88 83 st Y, r24 30bd6: c1 5a subi r28, 0xA1 ; 161 30bd8: d0 40 sbci r29, 0x00 ; 0 30bda: 19 2f mov r17, r25 30bdc: a8 96 adiw r28, 0x28 ; 40 30bde: 4e ad ldd r20, Y+62 ; 0x3e 30be0: 5f ad ldd r21, Y+63 ; 0x3f 30be2: a8 97 sbiw r28, 0x28 ; 40 30be4: 48 5f subi r20, 0xF8 ; 248 30be6: 5f 4f sbci r21, 0xFF ; 255 30be8: a8 96 adiw r28, 0x28 ; 40 30bea: 5f af std Y+63, r21 ; 0x3f 30bec: 4e af std Y+62, r20 ; 0x3e 30bee: a8 97 sbiw r28, 0x28 ; 40 30bf0: 58 e0 ldi r21, 0x08 ; 8 30bf2: 25 0e add r2, r21 30bf4: 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) { 30bf6: a9 e2 ldi r26, 0x29 ; 41 30bf8: b3 e1 ldi r27, 0x13 ; 19 30bfa: a8 96 adiw r28, 0x28 ; 40 30bfc: ee ad ldd r30, Y+62 ; 0x3e 30bfe: ff ad ldd r31, Y+63 ; 0x3f 30c00: a8 97 sbiw r28, 0x28 ; 40 30c02: ae 17 cp r26, r30 30c04: bf 07 cpc r27, r31 30c06: 09 f0 breq .+2 ; 0x30c0a 30c08: e5 ce rjmp .-566 ; 0x309d4 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; 30c0a: 90 58 subi r25, 0x80 ; 128 30c0c: c7 56 subi r28, 0x67 ; 103 30c0e: df 4f sbci r29, 0xFF ; 255 30c10: a8 81 ld r26, Y 30c12: b9 81 ldd r27, Y+1 ; 0x01 30c14: c9 59 subi r28, 0x99 ; 153 30c16: d0 40 sbci r29, 0x00 ; 0 30c18: 6d 93 st X+, r22 30c1a: 7d 93 st X+, r23 30c1c: 8d 93 st X+, r24 30c1e: 9d 93 st X+, r25 30c20: c7 56 subi r28, 0x67 ; 103 30c22: df 4f sbci r29, 0xFF ; 255 30c24: b9 83 std Y+1, r27 ; 0x01 30c26: a8 83 st Y, r26 30c28: c9 59 subi r28, 0x99 ; 153 30c2a: 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) { 30c2c: 0f 5f subi r16, 0xFF ; 255 30c2e: ac 96 adiw r28, 0x2c ; 44 30c30: ee ad ldd r30, Y+62 ; 0x3e 30c32: ff ad ldd r31, Y+63 ; 0x3f 30c34: ac 97 sbiw r28, 0x2c ; 44 30c36: 70 96 adiw r30, 0x10 ; 16 30c38: ac 96 adiw r28, 0x2c ; 44 30c3a: ff af std Y+63, r31 ; 0x3f 30c3c: ee af std Y+62, r30 ; 0x3e 30c3e: ac 97 sbiw r28, 0x2c ; 44 30c40: 04 30 cpi r16, 0x04 ; 4 30c42: 09 f0 breq .+2 ; 0x30c46 30c44: 21 ce rjmp .-958 ; 0x30888 } // 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]; 30c46: 25 96 adiw r28, 0x05 ; 5 30c48: 2c ad ldd r18, Y+60 ; 0x3c 30c4a: 3d ad ldd r19, Y+61 ; 0x3d 30c4c: 4e ad ldd r20, Y+62 ; 0x3e 30c4e: 5f ad ldd r21, Y+63 ; 0x3f 30c50: 25 97 sbiw r28, 0x05 ; 5 30c52: ae 96 adiw r28, 0x2e ; 46 30c54: 2c af std Y+60, r18 ; 0x3c 30c56: 3d af std Y+61, r19 ; 0x3d 30c58: 4e af std Y+62, r20 ; 0x3e 30c5a: 5f af std Y+63, r21 ; 0x3f 30c5c: ae 97 sbiw r28, 0x2e ; 46 30c5e: 8d 81 ldd r24, Y+5 ; 0x05 30c60: 9e 81 ldd r25, Y+6 ; 0x06 30c62: af 81 ldd r26, Y+7 ; 0x07 30c64: b8 85 ldd r27, Y+8 ; 0x08 30c66: e4 96 adiw r28, 0x34 ; 52 30c68: 8c af std Y+60, r24 ; 0x3c 30c6a: 9d af std Y+61, r25 ; 0x3d 30c6c: ae af std Y+62, r26 ; 0x3e 30c6e: bf af std Y+63, r27 ; 0x3f 30c70: e4 97 sbiw r28, 0x34 ; 52 30c72: 29 85 ldd r18, Y+9 ; 0x09 30c74: 3a 85 ldd r19, Y+10 ; 0x0a 30c76: 4b 85 ldd r20, Y+11 ; 0x0b 30c78: 5c 85 ldd r21, Y+12 ; 0x0c 30c7a: ed 96 adiw r28, 0x3d ; 61 30c7c: 2c af std Y+60, r18 ; 0x3c 30c7e: 3d af std Y+61, r19 ; 0x3d 30c80: 4e af std Y+62, r20 ; 0x3e 30c82: 5f af std Y+63, r21 ; 0x3f 30c84: ed 97 sbiw r28, 0x3d ; 61 30c86: 8d 85 ldd r24, Y+13 ; 0x0d 30c88: 9e 85 ldd r25, Y+14 ; 0x0e 30c8a: af 85 ldd r26, Y+15 ; 0x0f 30c8c: b8 89 ldd r27, Y+16 ; 0x10 30c8e: c3 58 subi r28, 0x83 ; 131 30c90: df 4f sbci r29, 0xFF ; 255 30c92: 88 83 st Y, r24 30c94: 99 83 std Y+1, r25 ; 0x01 30c96: aa 83 std Y+2, r26 ; 0x02 30c98: bb 83 std Y+3, r27 ; 0x03 30c9a: cd 57 subi r28, 0x7D ; 125 30c9c: d0 40 sbci r29, 0x00 ; 0 30c9e: 29 81 ldd r18, Y+1 ; 0x01 30ca0: 3a 81 ldd r19, Y+2 ; 0x02 30ca2: 4b 81 ldd r20, Y+3 ; 0x03 30ca4: 5c 81 ldd r21, Y+4 ; 0x04 30ca6: cf 57 subi r28, 0x7F ; 127 30ca8: df 4f sbci r29, 0xFF ; 255 30caa: 28 83 st Y, r18 30cac: 39 83 std Y+1, r19 ; 0x01 30cae: 4a 83 std Y+2, r20 ; 0x02 30cb0: 5b 83 std Y+3, r21 ; 0x03 30cb2: c1 58 subi r28, 0x81 ; 129 30cb4: 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]; 30cb6: 29 96 adiw r28, 0x09 ; 9 30cb8: 8c ad ldd r24, Y+60 ; 0x3c 30cba: 9d ad ldd r25, Y+61 ; 0x3d 30cbc: ae ad ldd r26, Y+62 ; 0x3e 30cbe: bf ad ldd r27, Y+63 ; 0x3f 30cc0: 29 97 sbiw r28, 0x09 ; 9 30cc2: cb 57 subi r28, 0x7B ; 123 30cc4: df 4f sbci r29, 0xFF ; 255 30cc6: 88 83 st Y, r24 30cc8: 99 83 std Y+1, r25 ; 0x01 30cca: aa 83 std Y+2, r26 ; 0x02 30ccc: bb 83 std Y+3, r27 ; 0x03 30cce: c5 58 subi r28, 0x85 ; 133 30cd0: d0 40 sbci r29, 0x00 ; 0 30cd2: 29 89 ldd r18, Y+17 ; 0x11 30cd4: 3a 89 ldd r19, Y+18 ; 0x12 30cd6: 4b 89 ldd r20, Y+19 ; 0x13 30cd8: 5c 89 ldd r21, Y+20 ; 0x14 30cda: c7 57 subi r28, 0x77 ; 119 30cdc: df 4f sbci r29, 0xFF ; 255 30cde: 28 83 st Y, r18 30ce0: 39 83 std Y+1, r19 ; 0x01 30ce2: 4a 83 std Y+2, r20 ; 0x02 30ce4: 5b 83 std Y+3, r21 ; 0x03 30ce6: c9 58 subi r28, 0x89 ; 137 30ce8: d0 40 sbci r29, 0x00 ; 0 30cea: 89 8d ldd r24, Y+25 ; 0x19 30cec: 9a 8d ldd r25, Y+26 ; 0x1a 30cee: ab 8d ldd r26, Y+27 ; 0x1b 30cf0: bc 8d ldd r27, Y+28 ; 0x1c 30cf2: cb 56 subi r28, 0x6B ; 107 30cf4: df 4f sbci r29, 0xFF ; 255 30cf6: 88 83 st Y, r24 30cf8: 99 83 std Y+1, r25 ; 0x01 30cfa: aa 83 std Y+2, r26 ; 0x02 30cfc: bb 83 std Y+3, r27 ; 0x03 30cfe: c5 59 subi r28, 0x95 ; 149 30d00: d0 40 sbci r29, 0x00 ; 0 30d02: 2d 8d ldd r18, Y+29 ; 0x1d 30d04: 3e 8d ldd r19, Y+30 ; 0x1e 30d06: 4f 8d ldd r20, Y+31 ; 0x1f 30d08: 58 a1 ldd r21, Y+32 ; 0x20 30d0a: c7 56 subi r28, 0x67 ; 103 30d0c: df 4f sbci r29, 0xFF ; 255 30d0e: 28 83 st Y, r18 30d10: 39 83 std Y+1, r19 ; 0x01 30d12: 4a 83 std Y+2, r20 ; 0x02 30d14: 5b 83 std Y+3, r21 ; 0x03 30d16: c9 59 subi r28, 0x99 ; 153 30d18: d0 40 sbci r29, 0x00 ; 0 30d1a: 8d 89 ldd r24, Y+21 ; 0x15 30d1c: 9e 89 ldd r25, Y+22 ; 0x16 30d1e: af 89 ldd r26, Y+23 ; 0x17 30d20: b8 8d ldd r27, Y+24 ; 0x18 30d22: c3 57 subi r28, 0x73 ; 115 30d24: df 4f sbci r29, 0xFF ; 255 30d26: 88 83 st Y, r24 30d28: 99 83 std Y+1, r25 ; 0x01 30d2a: aa 83 std Y+2, r26 ; 0x02 30d2c: bb 83 std Y+3, r27 ; 0x03 30d2e: cd 58 subi r28, 0x8D ; 141 30d30: 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]; 30d32: 2d 96 adiw r28, 0x0d ; 13 30d34: 2c ad ldd r18, Y+60 ; 0x3c 30d36: 3d ad ldd r19, Y+61 ; 0x3d 30d38: 4e ad ldd r20, Y+62 ; 0x3e 30d3a: 5f ad ldd r21, Y+63 ; 0x3f 30d3c: 2d 97 sbiw r28, 0x0d ; 13 30d3e: c3 56 subi r28, 0x63 ; 99 30d40: df 4f sbci r29, 0xFF ; 255 30d42: 28 83 st Y, r18 30d44: 39 83 std Y+1, r19 ; 0x01 30d46: 4a 83 std Y+2, r20 ; 0x02 30d48: 5b 83 std Y+3, r21 ; 0x03 30d4a: cd 59 subi r28, 0x9D ; 157 30d4c: d0 40 sbci r29, 0x00 ; 0 30d4e: 89 a1 ldd r24, Y+33 ; 0x21 30d50: 9a a1 ldd r25, Y+34 ; 0x22 30d52: ab a1 ldd r26, Y+35 ; 0x23 30d54: bc a1 ldd r27, Y+36 ; 0x24 30d56: cf 55 subi r28, 0x5F ; 95 30d58: df 4f sbci r29, 0xFF ; 255 30d5a: 88 83 st Y, r24 30d5c: 99 83 std Y+1, r25 ; 0x01 30d5e: aa 83 std Y+2, r26 ; 0x02 30d60: bb 83 std Y+3, r27 ; 0x03 30d62: c1 5a subi r28, 0xA1 ; 161 30d64: d0 40 sbci r29, 0x00 ; 0 30d66: 2d a1 ldd r18, Y+37 ; 0x25 30d68: 3e a1 ldd r19, Y+38 ; 0x26 30d6a: 4f a1 ldd r20, Y+39 ; 0x27 30d6c: 58 a5 ldd r21, Y+40 ; 0x28 30d6e: cb 55 subi r28, 0x5B ; 91 30d70: df 4f sbci r29, 0xFF ; 255 30d72: 28 83 st Y, r18 30d74: 39 83 std Y+1, r19 ; 0x01 30d76: 4a 83 std Y+2, r20 ; 0x02 30d78: 5b 83 std Y+3, r21 ; 0x03 30d7a: c5 5a subi r28, 0xA5 ; 165 30d7c: d0 40 sbci r29, 0x00 ; 0 30d7e: 8d a5 ldd r24, Y+45 ; 0x2d 30d80: 9e a5 ldd r25, Y+46 ; 0x2e 30d82: af a5 ldd r26, Y+47 ; 0x2f 30d84: b8 a9 ldd r27, Y+48 ; 0x30 30d86: cd 54 subi r28, 0x4D ; 77 30d88: df 4f sbci r29, 0xFF ; 255 30d8a: 88 83 st Y, r24 30d8c: 99 83 std Y+1, r25 ; 0x01 30d8e: aa 83 std Y+2, r26 ; 0x02 30d90: bb 83 std Y+3, r27 ; 0x03 30d92: c3 5b subi r28, 0xB3 ; 179 30d94: d0 40 sbci r29, 0x00 ; 0 30d96: 29 a5 ldd r18, Y+41 ; 0x29 30d98: 3a a5 ldd r19, Y+42 ; 0x2a 30d9a: 4b a5 ldd r20, Y+43 ; 0x2b 30d9c: 5c a5 ldd r21, Y+44 ; 0x2c 30d9e: c9 54 subi r28, 0x49 ; 73 30da0: df 4f sbci r29, 0xFF ; 255 30da2: 28 83 st Y, r18 30da4: 39 83 std Y+1, r19 ; 0x01 30da6: 4a 83 std Y+2, r20 ; 0x02 30da8: 5b 83 std Y+3, r21 ; 0x03 30daa: c7 5b subi r28, 0xB7 ; 183 30dac: 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]; 30dae: 61 96 adiw r28, 0x11 ; 17 30db0: 8c ad ldd r24, Y+60 ; 0x3c 30db2: 9d ad ldd r25, Y+61 ; 0x3d 30db4: ae ad ldd r26, Y+62 ; 0x3e 30db6: bf ad ldd r27, Y+63 ; 0x3f 30db8: 61 97 sbiw r28, 0x11 ; 17 30dba: c5 54 subi r28, 0x45 ; 69 30dbc: df 4f sbci r29, 0xFF ; 255 30dbe: 88 83 st Y, r24 30dc0: 99 83 std Y+1, r25 ; 0x01 30dc2: aa 83 std Y+2, r26 ; 0x02 30dc4: bb 83 std Y+3, r27 ; 0x03 30dc6: cb 5b subi r28, 0xBB ; 187 30dc8: d0 40 sbci r29, 0x00 ; 0 30dca: 29 a9 ldd r18, Y+49 ; 0x31 30dcc: 3a a9 ldd r19, Y+50 ; 0x32 30dce: 4b a9 ldd r20, Y+51 ; 0x33 30dd0: 5c a9 ldd r21, Y+52 ; 0x34 30dd2: c1 54 subi r28, 0x41 ; 65 30dd4: df 4f sbci r29, 0xFF ; 255 30dd6: 28 83 st Y, r18 30dd8: 39 83 std Y+1, r19 ; 0x01 30dda: 4a 83 std Y+2, r20 ; 0x02 30ddc: 5b 83 std Y+3, r21 ; 0x03 30dde: cf 5b subi r28, 0xBF ; 191 30de0: d0 40 sbci r29, 0x00 ; 0 30de2: 8d a9 ldd r24, Y+53 ; 0x35 30de4: 9e a9 ldd r25, Y+54 ; 0x36 30de6: af a9 ldd r26, Y+55 ; 0x37 30de8: b8 ad ldd r27, Y+56 ; 0x38 30dea: cd 53 subi r28, 0x3D ; 61 30dec: df 4f sbci r29, 0xFF ; 255 30dee: 88 83 st Y, r24 30df0: 99 83 std Y+1, r25 ; 0x01 30df2: aa 83 std Y+2, r26 ; 0x02 30df4: bb 83 std Y+3, r27 ; 0x03 30df6: c3 5c subi r28, 0xC3 ; 195 30df8: d0 40 sbci r29, 0x00 ; 0 30dfa: 29 ad ldd r18, Y+57 ; 0x39 30dfc: 3a ad ldd r19, Y+58 ; 0x3a 30dfe: 4b ad ldd r20, Y+59 ; 0x3b 30e00: 5c ad ldd r21, Y+60 ; 0x3c 30e02: c9 53 subi r28, 0x39 ; 57 30e04: df 4f sbci r29, 0xFF ; 255 30e06: 28 83 st Y, r18 30e08: 39 83 std Y+1, r19 ; 0x01 30e0a: 4a 83 std Y+2, r20 ; 0x02 30e0c: 5b 83 std Y+3, r21 ; 0x03 30e0e: c7 5c subi r28, 0xC7 ; 199 30e10: d0 40 sbci r29, 0x00 ; 0 30e12: 21 96 adiw r28, 0x01 ; 1 30e14: 8c ad ldd r24, Y+60 ; 0x3c 30e16: 9d ad ldd r25, Y+61 ; 0x3d 30e18: ae ad ldd r26, Y+62 ; 0x3e 30e1a: bf ad ldd r27, Y+63 ; 0x3f 30e1c: 21 97 sbiw r28, 0x01 ; 1 30e1e: c5 53 subi r28, 0x35 ; 53 30e20: df 4f sbci r29, 0xFF ; 255 30e22: 88 83 st Y, r24 30e24: 99 83 std Y+1, r25 ; 0x01 30e26: aa 83 std Y+2, r26 ; 0x02 30e28: bb 83 std Y+3, r27 ; 0x03 30e2a: cb 5c subi r28, 0xCB ; 203 30e2c: d0 40 sbci r29, 0x00 ; 0 30e2e: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 30e30: c1 2c mov r12, r1 30e32: d1 2c mov r13, r1 30e34: 76 01 movw r14, r12 30e36: 46 01 movw r8, r12 30e38: 57 01 movw r10, r14 30e3a: 26 01 movw r4, r12 30e3c: 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]; 30e3e: a3 01 movw r20, r6 30e40: 92 01 movw r18, r4 30e42: e4 96 adiw r28, 0x34 ; 52 30e44: 6c ad ldd r22, Y+60 ; 0x3c 30e46: 7d ad ldd r23, Y+61 ; 0x3d 30e48: 8e ad ldd r24, Y+62 ; 0x3e 30e4a: 9f ad ldd r25, Y+63 ; 0x3f 30e4c: e4 97 sbiw r28, 0x34 ; 52 30e4e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30e52: 9b 01 movw r18, r22 30e54: ac 01 movw r20, r24 30e56: ae 96 adiw r28, 0x2e ; 46 30e58: 6c ad ldd r22, Y+60 ; 0x3c 30e5a: 7d ad ldd r23, Y+61 ; 0x3d 30e5c: 8e ad ldd r24, Y+62 ; 0x3e 30e5e: 9f ad ldd r25, Y+63 ; 0x3f 30e60: ae 97 sbiw r28, 0x2e ; 46 30e62: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30e66: 2b 01 movw r4, r22 30e68: 3c 01 movw r6, r24 30e6a: a5 01 movw r20, r10 30e6c: 94 01 movw r18, r8 30e6e: ed 96 adiw r28, 0x3d ; 61 30e70: 6c ad ldd r22, Y+60 ; 0x3c 30e72: 7d ad ldd r23, Y+61 ; 0x3d 30e74: 8e ad ldd r24, Y+62 ; 0x3e 30e76: 9f ad ldd r25, Y+63 ; 0x3f 30e78: ed 97 sbiw r28, 0x3d ; 61 30e7a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30e7e: 9b 01 movw r18, r22 30e80: ac 01 movw r20, r24 30e82: c3 01 movw r24, r6 30e84: b2 01 movw r22, r4 30e86: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30e8a: 2b 01 movw r4, r22 30e8c: 3c 01 movw r6, r24 30e8e: a7 01 movw r20, r14 30e90: 96 01 movw r18, r12 30e92: c3 58 subi r28, 0x83 ; 131 30e94: df 4f sbci r29, 0xFF ; 255 30e96: 68 81 ld r22, Y 30e98: 79 81 ldd r23, Y+1 ; 0x01 30e9a: 8a 81 ldd r24, Y+2 ; 0x02 30e9c: 9b 81 ldd r25, Y+3 ; 0x03 30e9e: cd 57 subi r28, 0x7D ; 125 30ea0: d0 40 sbci r29, 0x00 ; 0 30ea2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30ea6: 9b 01 movw r18, r22 30ea8: ac 01 movw r20, r24 30eaa: c3 01 movw r24, r6 30eac: b2 01 movw r22, r4 30eae: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30eb2: cf 57 subi r28, 0x7F ; 127 30eb4: df 4f sbci r29, 0xFF ; 255 30eb6: 28 81 ld r18, Y 30eb8: 39 81 ldd r19, Y+1 ; 0x01 30eba: 4a 81 ldd r20, Y+2 ; 0x02 30ebc: 5b 81 ldd r21, Y+3 ; 0x03 30ebe: c1 58 subi r28, 0x81 ; 129 30ec0: d0 40 sbci r29, 0x00 ; 0 30ec2: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 30ec6: 6e 96 adiw r28, 0x1e ; 30 30ec8: 6c af std Y+60, r22 ; 0x3c 30eca: 7d af std Y+61, r23 ; 0x3d 30ecc: 8e af std Y+62, r24 ; 0x3e 30ece: 9f af std Y+63, r25 ; 0x3f 30ed0: 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]; 30ed2: c7 57 subi r28, 0x77 ; 119 30ed4: df 4f sbci r29, 0xFF ; 255 30ed6: 28 81 ld r18, Y 30ed8: 39 81 ldd r19, Y+1 ; 0x01 30eda: 4a 81 ldd r20, Y+2 ; 0x02 30edc: 5b 81 ldd r21, Y+3 ; 0x03 30ede: c9 58 subi r28, 0x89 ; 137 30ee0: d0 40 sbci r29, 0x00 ; 0 30ee2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30ee6: 9b 01 movw r18, r22 30ee8: ac 01 movw r20, r24 30eea: cb 57 subi r28, 0x7B ; 123 30eec: df 4f sbci r29, 0xFF ; 255 30eee: 68 81 ld r22, Y 30ef0: 79 81 ldd r23, Y+1 ; 0x01 30ef2: 8a 81 ldd r24, Y+2 ; 0x02 30ef4: 9b 81 ldd r25, Y+3 ; 0x03 30ef6: c5 58 subi r28, 0x85 ; 133 30ef8: d0 40 sbci r29, 0x00 ; 0 30efa: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30efe: 2b 01 movw r4, r22 30f00: 3c 01 movw r6, r24 30f02: a5 01 movw r20, r10 30f04: 94 01 movw r18, r8 30f06: cb 56 subi r28, 0x6B ; 107 30f08: df 4f sbci r29, 0xFF ; 255 30f0a: 68 81 ld r22, Y 30f0c: 79 81 ldd r23, Y+1 ; 0x01 30f0e: 8a 81 ldd r24, Y+2 ; 0x02 30f10: 9b 81 ldd r25, Y+3 ; 0x03 30f12: c5 59 subi r28, 0x95 ; 149 30f14: d0 40 sbci r29, 0x00 ; 0 30f16: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30f1a: 9b 01 movw r18, r22 30f1c: ac 01 movw r20, r24 30f1e: c3 01 movw r24, r6 30f20: b2 01 movw r22, r4 30f22: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30f26: 4b 01 movw r8, r22 30f28: 5c 01 movw r10, r24 30f2a: a7 01 movw r20, r14 30f2c: 96 01 movw r18, r12 30f2e: c7 56 subi r28, 0x67 ; 103 30f30: df 4f sbci r29, 0xFF ; 255 30f32: 68 81 ld r22, Y 30f34: 79 81 ldd r23, Y+1 ; 0x01 30f36: 8a 81 ldd r24, Y+2 ; 0x02 30f38: 9b 81 ldd r25, Y+3 ; 0x03 30f3a: c9 59 subi r28, 0x99 ; 153 30f3c: d0 40 sbci r29, 0x00 ; 0 30f3e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30f42: 9b 01 movw r18, r22 30f44: ac 01 movw r20, r24 30f46: c5 01 movw r24, r10 30f48: b4 01 movw r22, r8 30f4a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30f4e: c3 57 subi r28, 0x73 ; 115 30f50: df 4f sbci r29, 0xFF ; 255 30f52: 28 81 ld r18, Y 30f54: 39 81 ldd r19, Y+1 ; 0x01 30f56: 4a 81 ldd r20, Y+2 ; 0x02 30f58: 5b 81 ldd r21, Y+3 ; 0x03 30f5a: cd 58 subi r28, 0x8D ; 141 30f5c: d0 40 sbci r29, 0x00 ; 0 30f5e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 30f62: 2b 01 movw r4, r22 30f64: 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]; 30f66: cf 55 subi r28, 0x5F ; 95 30f68: df 4f sbci r29, 0xFF ; 255 30f6a: 28 81 ld r18, Y 30f6c: 39 81 ldd r19, Y+1 ; 0x01 30f6e: 4a 81 ldd r20, Y+2 ; 0x02 30f70: 5b 81 ldd r21, Y+3 ; 0x03 30f72: c1 5a subi r28, 0xA1 ; 161 30f74: d0 40 sbci r29, 0x00 ; 0 30f76: 6e 96 adiw r28, 0x1e ; 30 30f78: 6c ad ldd r22, Y+60 ; 0x3c 30f7a: 7d ad ldd r23, Y+61 ; 0x3d 30f7c: 8e ad ldd r24, Y+62 ; 0x3e 30f7e: 9f ad ldd r25, Y+63 ; 0x3f 30f80: 6e 97 sbiw r28, 0x1e ; 30 30f82: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30f86: 9b 01 movw r18, r22 30f88: ac 01 movw r20, r24 30f8a: c3 56 subi r28, 0x63 ; 99 30f8c: df 4f sbci r29, 0xFF ; 255 30f8e: 68 81 ld r22, Y 30f90: 79 81 ldd r23, Y+1 ; 0x01 30f92: 8a 81 ldd r24, Y+2 ; 0x02 30f94: 9b 81 ldd r25, Y+3 ; 0x03 30f96: cd 59 subi r28, 0x9D ; 157 30f98: d0 40 sbci r29, 0x00 ; 0 30f9a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30f9e: 4b 01 movw r8, r22 30fa0: 5c 01 movw r10, r24 30fa2: cb 55 subi r28, 0x5B ; 91 30fa4: df 4f sbci r29, 0xFF ; 255 30fa6: 28 81 ld r18, Y 30fa8: 39 81 ldd r19, Y+1 ; 0x01 30faa: 4a 81 ldd r20, Y+2 ; 0x02 30fac: 5b 81 ldd r21, Y+3 ; 0x03 30fae: c5 5a subi r28, 0xA5 ; 165 30fb0: d0 40 sbci r29, 0x00 ; 0 30fb2: c3 01 movw r24, r6 30fb4: b2 01 movw r22, r4 30fb6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30fba: 9b 01 movw r18, r22 30fbc: ac 01 movw r20, r24 30fbe: c5 01 movw r24, r10 30fc0: b4 01 movw r22, r8 30fc2: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30fc6: 4b 01 movw r8, r22 30fc8: 5c 01 movw r10, r24 30fca: a7 01 movw r20, r14 30fcc: 96 01 movw r18, r12 30fce: cd 54 subi r28, 0x4D ; 77 30fd0: df 4f sbci r29, 0xFF ; 255 30fd2: 68 81 ld r22, Y 30fd4: 79 81 ldd r23, Y+1 ; 0x01 30fd6: 8a 81 ldd r24, Y+2 ; 0x02 30fd8: 9b 81 ldd r25, Y+3 ; 0x03 30fda: c3 5b subi r28, 0xB3 ; 179 30fdc: d0 40 sbci r29, 0x00 ; 0 30fde: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 30fe2: 9b 01 movw r18, r22 30fe4: ac 01 movw r20, r24 30fe6: c5 01 movw r24, r10 30fe8: b4 01 movw r22, r8 30fea: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 30fee: c9 54 subi r28, 0x49 ; 73 30ff0: df 4f sbci r29, 0xFF ; 255 30ff2: 28 81 ld r18, Y 30ff4: 39 81 ldd r19, Y+1 ; 0x01 30ff6: 4a 81 ldd r20, Y+2 ; 0x02 30ff8: 5b 81 ldd r21, Y+3 ; 0x03 30ffa: c7 5b subi r28, 0xB7 ; 183 30ffc: d0 40 sbci r29, 0x00 ; 0 30ffe: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 31002: 4b 01 movw r8, r22 31004: 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]; 31006: c1 54 subi r28, 0x41 ; 65 31008: df 4f sbci r29, 0xFF ; 255 3100a: 28 81 ld r18, Y 3100c: 39 81 ldd r19, Y+1 ; 0x01 3100e: 4a 81 ldd r20, Y+2 ; 0x02 31010: 5b 81 ldd r21, Y+3 ; 0x03 31012: cf 5b subi r28, 0xBF ; 191 31014: d0 40 sbci r29, 0x00 ; 0 31016: 6e 96 adiw r28, 0x1e ; 30 31018: 6c ad ldd r22, Y+60 ; 0x3c 3101a: 7d ad ldd r23, Y+61 ; 0x3d 3101c: 8e ad ldd r24, Y+62 ; 0x3e 3101e: 9f ad ldd r25, Y+63 ; 0x3f 31020: 6e 97 sbiw r28, 0x1e ; 30 31022: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31026: 9b 01 movw r18, r22 31028: ac 01 movw r20, r24 3102a: c5 54 subi r28, 0x45 ; 69 3102c: df 4f sbci r29, 0xFF ; 255 3102e: 68 81 ld r22, Y 31030: 79 81 ldd r23, Y+1 ; 0x01 31032: 8a 81 ldd r24, Y+2 ; 0x02 31034: 9b 81 ldd r25, Y+3 ; 0x03 31036: cb 5b subi r28, 0xBB ; 187 31038: d0 40 sbci r29, 0x00 ; 0 3103a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3103e: 6b 01 movw r12, r22 31040: 7c 01 movw r14, r24 31042: cd 53 subi r28, 0x3D ; 61 31044: df 4f sbci r29, 0xFF ; 255 31046: 28 81 ld r18, Y 31048: 39 81 ldd r19, Y+1 ; 0x01 3104a: 4a 81 ldd r20, Y+2 ; 0x02 3104c: 5b 81 ldd r21, Y+3 ; 0x03 3104e: c3 5c subi r28, 0xC3 ; 195 31050: d0 40 sbci r29, 0x00 ; 0 31052: c3 01 movw r24, r6 31054: b2 01 movw r22, r4 31056: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3105a: 9b 01 movw r18, r22 3105c: ac 01 movw r20, r24 3105e: c7 01 movw r24, r14 31060: b6 01 movw r22, r12 31062: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 31066: 6b 01 movw r12, r22 31068: 7c 01 movw r14, r24 3106a: c9 53 subi r28, 0x39 ; 57 3106c: df 4f sbci r29, 0xFF ; 255 3106e: 28 81 ld r18, Y 31070: 39 81 ldd r19, Y+1 ; 0x01 31072: 4a 81 ldd r20, Y+2 ; 0x02 31074: 5b 81 ldd r21, Y+3 ; 0x03 31076: c7 5c subi r28, 0xC7 ; 199 31078: d0 40 sbci r29, 0x00 ; 0 3107a: c5 01 movw r24, r10 3107c: b4 01 movw r22, r8 3107e: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31082: 9b 01 movw r18, r22 31084: ac 01 movw r20, r24 31086: c7 01 movw r24, r14 31088: b6 01 movw r22, r12 3108a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3108e: c5 53 subi r28, 0x35 ; 53 31090: df 4f sbci r29, 0xFF ; 255 31092: 28 81 ld r18, Y 31094: 39 81 ldd r19, Y+1 ; 0x01 31096: 4a 81 ldd r20, Y+2 ; 0x02 31098: 5b 81 ldd r21, Y+3 ; 0x03 3109a: cb 5c subi r28, 0xCB ; 203 3109c: d0 40 sbci r29, 0x00 ; 0 3109e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 310a2: 6b 01 movw r12, r22 310a4: 7c 01 movw r14, r24 310a6: 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) { 310a8: 09 f0 breq .+2 ; 0x310ac 310aa: c9 ce rjmp .-622 ; 0x30e3e // 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]; 310ac: 6e 96 adiw r28, 0x1e ; 30 310ae: 2c ad ldd r18, Y+60 ; 0x3c 310b0: 3d ad ldd r19, Y+61 ; 0x3d 310b2: 4e ad ldd r20, Y+62 ; 0x3e 310b4: 5f ad ldd r21, Y+63 ; 0x3f 310b6: 6e 97 sbiw r28, 0x1e ; 30 310b8: c5 55 subi r28, 0x55 ; 85 310ba: df 4f sbci r29, 0xFF ; 255 310bc: 68 81 ld r22, Y 310be: 79 81 ldd r23, Y+1 ; 0x01 310c0: 8a 81 ldd r24, Y+2 ; 0x02 310c2: 9b 81 ldd r25, Y+3 ; 0x03 310c4: cb 5a subi r28, 0xAB ; 171 310c6: d0 40 sbci r29, 0x00 ; 0 310c8: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 310cc: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 310d0: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 310d4: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 310d8: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d cntr[1] += h[1]; 310dc: a3 01 movw r20, r6 310de: 92 01 movw r18, r4 310e0: c1 55 subi r28, 0x51 ; 81 310e2: df 4f sbci r29, 0xFF ; 255 310e4: 68 81 ld r22, Y 310e6: 79 81 ldd r23, Y+1 ; 0x01 310e8: 8a 81 ldd r24, Y+2 ; 0x02 310ea: 9b 81 ldd r25, Y+3 ; 0x03 310ec: cf 5a subi r28, 0xAF ; 175 310ee: d0 40 sbci r29, 0x00 ; 0 310f0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 310f4: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 310f8: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 310fc: 80 93 40 13 sts 0x1340, r24 ; 0x801340 31100: 90 93 41 13 sts 0x1341, r25 ; 0x801341 a1 += h[2]; 31104: a5 01 movw r20, r10 31106: 94 01 movw r18, r8 31108: a6 96 adiw r28, 0x26 ; 38 3110a: 6c ad ldd r22, Y+60 ; 0x3c 3110c: 7d ad ldd r23, Y+61 ; 0x3d 3110e: 8e ad ldd r24, Y+62 ; 0x3e 31110: 9f ad ldd r25, Y+63 ; 0x3f 31112: a6 97 sbiw r28, 0x26 ; 38 31114: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31118: a6 96 adiw r28, 0x26 ; 38 3111a: 6c af std Y+60, r22 ; 0x3c 3111c: 7d af std Y+61, r23 ; 0x3d 3111e: 8e af std Y+62, r24 ; 0x3e 31120: 9f af std Y+63, r25 ; 0x3f 31122: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 31124: a7 01 movw r20, r14 31126: 96 01 movw r18, r12 31128: a2 96 adiw r28, 0x22 ; 34 3112a: 6c ad ldd r22, Y+60 ; 0x3c 3112c: 7d ad ldd r23, Y+61 ; 0x3d 3112e: 8e ad ldd r24, Y+62 ; 0x3e 31130: 9f ad ldd r25, Y+63 ; 0x3f 31132: a2 97 sbiw r28, 0x22 ; 34 31134: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31138: a2 96 adiw r28, 0x22 ; 34 3113a: 6c af std Y+60, r22 ; 0x3c 3113c: 7d af std Y+61, r23 ; 0x3d 3113e: 8e af std Y+62, r24 ; 0x3e 31140: 9f af std Y+63, r25 ; 0x3f 31142: a2 97 sbiw r28, 0x22 ; 34 31144: e6 96 adiw r28, 0x36 ; 54 31146: 9f ad ldd r25, Y+63 ; 0x3f 31148: e6 97 sbiw r28, 0x36 ; 54 3114a: 91 50 subi r25, 0x01 ; 1 3114c: e6 96 adiw r28, 0x36 ; 54 3114e: 9f af std Y+63, r25 ; 0x3f 31150: 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) { 31152: 91 11 cpse r25, r1 31154: e6 ca rjmp .-2612 ; 0x30722 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 31156: a6 96 adiw r28, 0x26 ; 38 31158: 6c ad ldd r22, Y+60 ; 0x3c 3115a: 7d ad ldd r23, Y+61 ; 0x3d 3115c: 8e ad ldd r24, Y+62 ; 0x3e 3115e: 9f ad ldd r25, Y+63 ; 0x3f 31160: a6 97 sbiw r28, 0x26 ; 38 31162: 0f 94 bf a5 call 0x34b7e ; 0x34b7e 31166: 60 93 2a 13 sts 0x132A, r22 ; 0x80132a 3116a: 70 93 2b 13 sts 0x132B, r23 ; 0x80132b 3116e: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 31172: 90 93 2d 13 sts 0x132D, r25 ; 0x80132d vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 31176: a6 96 adiw r28, 0x26 ; 38 31178: 6c ad ldd r22, Y+60 ; 0x3c 3117a: 7d ad ldd r23, Y+61 ; 0x3d 3117c: 8e ad ldd r24, Y+62 ; 0x3e 3117e: 9f ad ldd r25, Y+63 ; 0x3f 31180: a6 97 sbiw r28, 0x26 ; 38 31182: 0f 94 85 a8 call 0x3510a ; 0x3510a 31186: 60 93 2e 13 sts 0x132E, r22 ; 0x80132e 3118a: 70 93 2f 13 sts 0x132F, r23 ; 0x80132f 3118e: 80 93 30 13 sts 0x1330, r24 ; 0x801330 31192: 90 93 31 13 sts 0x1331, r25 ; 0x801331 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 31196: a2 96 adiw r28, 0x22 ; 34 31198: 6c ad ldd r22, Y+60 ; 0x3c 3119a: 7d ad ldd r23, Y+61 ; 0x3d 3119c: 8e ad ldd r24, Y+62 ; 0x3e 3119e: 9f ad ldd r25, Y+63 ; 0x3f 311a0: a2 97 sbiw r28, 0x22 ; 34 311a2: 0f 94 85 a8 call 0x3510a ; 0x3510a 311a6: 90 58 subi r25, 0x80 ; 128 311a8: 60 93 32 13 sts 0x1332, r22 ; 0x801332 311ac: 70 93 33 13 sts 0x1333, r23 ; 0x801333 311b0: 80 93 34 13 sts 0x1334, r24 ; 0x801334 311b4: 90 93 35 13 sts 0x1335, r25 ; 0x801335 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 311b8: a2 96 adiw r28, 0x22 ; 34 311ba: 6c ad ldd r22, Y+60 ; 0x3c 311bc: 7d ad ldd r23, Y+61 ; 0x3d 311be: 8e ad ldd r24, Y+62 ; 0x3e 311c0: 9f ad ldd r25, Y+63 ; 0x3f 311c2: a2 97 sbiw r28, 0x22 ; 34 311c4: 0f 94 bf a5 call 0x34b7e ; 0x34b7e 311c8: 60 93 36 13 sts 0x1336, r22 ; 0x801336 311cc: 70 93 37 13 sts 0x1337, r23 ; 0x801337 311d0: 80 93 38 13 sts 0x1338, r24 ; 0x801338 311d4: 90 93 39 13 sts 0x1339, r25 ; 0x801339 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 311d8: a6 96 adiw r28, 0x26 ; 38 311da: 2c ad ldd r18, Y+60 ; 0x3c 311dc: 3d ad ldd r19, Y+61 ; 0x3d 311de: 4e ad ldd r20, Y+62 ; 0x3e 311e0: 5f ad ldd r21, Y+63 ; 0x3f 311e2: a6 97 sbiw r28, 0x26 ; 38 311e4: a2 96 adiw r28, 0x22 ; 34 311e6: 6c ad ldd r22, Y+60 ; 0x3c 311e8: 7d ad ldd r23, Y+61 ; 0x3d 311ea: 8e ad ldd r24, Y+62 ; 0x3e 311ec: 9f ad ldd r25, Y+63 ; 0x3f 311ee: a2 97 sbiw r28, 0x22 ; 34 311f0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 311f4: 4b 01 movw r8, r22 311f6: 5c 01 movw r10, r24 311f8: 7c 01 movw r14, r24 311fa: 6b 01 movw r12, r22 311fc: e8 94 clt 311fe: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 31200: 21 ee ldi r18, 0xE1 ; 225 31202: 3e e2 ldi r19, 0x2E ; 46 31204: 45 e6 ldi r20, 0x65 ; 101 31206: 52 e4 ldi r21, 0x42 ; 66 31208: a2 96 adiw r28, 0x22 ; 34 3120a: 6c ad ldd r22, Y+60 ; 0x3c 3120c: 7d ad ldd r23, Y+61 ; 0x3d 3120e: 8e ad ldd r24, Y+62 ; 0x3e 31210: 9f ad ldd r25, Y+63 ; 0x3f 31212: a2 97 sbiw r28, 0x22 ; 34 31214: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31218: 9f 93 push r25 3121a: 8f 93 push r24 3121c: 7f 93 push r23 3121e: 6f 93 push r22 31220: 21 ee ldi r18, 0xE1 ; 225 31222: 3e e2 ldi r19, 0x2E ; 46 31224: 45 e6 ldi r20, 0x65 ; 101 31226: 52 e4 ldi r21, 0x42 ; 66 31228: c5 01 movw r24, r10 3122a: b4 01 movw r22, r8 3122c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31230: 9f 93 push r25 31232: 8f 93 push r24 31234: 7f 93 push r23 31236: 6f 93 push r22 31238: 85 e6 ldi r24, 0x65 ; 101 3123a: 9b e6 ldi r25, 0x6B ; 107 3123c: 9f 93 push r25 3123e: 8f 93 push r24 31240: 0f 94 5f a2 call 0x344be ; 0x344be if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 31244: b7 01 movw r22, r14 31246: a6 01 movw r20, r12 31248: 80 e6 ldi r24, 0x60 ; 96 3124a: 9f e0 ldi r25, 0x0F ; 15 3124c: 0f 94 d3 a3 call 0x347a6 ; 0x347a6 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) 31250: 0f b6 in r0, 0x3f ; 63 31252: f8 94 cli 31254: de bf out 0x3e, r29 ; 62 31256: 0f be out 0x3f, r0 ; 63 31258: cd bf out 0x3d, r28 ; 61 3125a: 2f e1 ldi r18, 0x1F ; 31 3125c: 32 e4 ldi r19, 0x42 ; 66 3125e: 49 e0 ldi r20, 0x09 ; 9 31260: 5b e3 ldi r21, 0x3B ; 59 31262: c7 01 movw r24, r14 31264: b6 01 movw r22, r12 31266: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__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; 3126a: 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) 3126c: 18 16 cp r1, r24 3126e: 64 f4 brge .+24 ; 0x31288 result = (angleDiff > bed_skew_angle_extreme) ? 31270: 25 e3 ldi r18, 0x35 ; 53 31272: 3a ef ldi r19, 0xFA ; 250 31274: 4e e8 ldi r20, 0x8E ; 142 31276: 5b e3 ldi r21, 0x3B ; 59 31278: c7 01 movw r24, r14 3127a: b6 01 movw r22, r12 3127c: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 31280: 12 e0 ldi r17, 0x02 ; 2 31282: 18 16 cp r1, r24 31284: 0c f0 brlt .+2 ; 0x31288 31286: 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 || 31288: 25 e3 ldi r18, 0x35 ; 53 3128a: 3a ef ldi r19, 0xFA ; 250 3128c: 4e e8 ldi r20, 0x8E ; 142 3128e: 5b e3 ldi r21, 0x3B ; 59 31290: a6 96 adiw r28, 0x26 ; 38 31292: 6c ad ldd r22, Y+60 ; 0x3c 31294: 7d ad ldd r23, Y+61 ; 0x3d 31296: 8e ad ldd r24, Y+62 ; 0x3e 31298: 9f ad ldd r25, Y+63 ; 0x3f 3129a: a6 97 sbiw r28, 0x26 ; 38 3129c: 9f 77 andi r25, 0x7F ; 127 3129e: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 312a2: 18 16 cp r1, r24 312a4: 0c f4 brge .+2 ; 0x312a8 312a6: 67 c4 rjmp .+2254 ; 0x31b76 312a8: 25 e3 ldi r18, 0x35 ; 53 312aa: 3a ef ldi r19, 0xFA ; 250 312ac: 4e e8 ldi r20, 0x8E ; 142 312ae: 5b e3 ldi r21, 0x3B ; 59 312b0: a2 96 adiw r28, 0x22 ; 34 312b2: 6c ad ldd r22, Y+60 ; 0x3c 312b4: 7d ad ldd r23, Y+61 ; 0x3d 312b6: 8e ad ldd r24, Y+62 ; 0x3e 312b8: 9f ad ldd r25, Y+63 ; 0x3f 312ba: a2 97 sbiw r28, 0x22 ; 34 312bc: 9f 77 andi r25, 0x7F ; 127 312be: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 312c2: 18 16 cp r1, r24 312c4: 0c f4 brge .+2 ; 0x312c8 312c6: 57 c4 rjmp .+2222 ; 0x31b76 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]; 312c8: 20 91 2a 13 lds r18, 0x132A ; 0x80132a 312cc: 30 91 2b 13 lds r19, 0x132B ; 0x80132b 312d0: 40 91 2c 13 lds r20, 0x132C ; 0x80132c 312d4: 50 91 2d 13 lds r21, 0x132D ; 0x80132d 312d8: ae 96 adiw r28, 0x2e ; 46 312da: 2c af std Y+60, r18 ; 0x3c 312dc: 3d af std Y+61, r19 ; 0x3d 312de: 4e af std Y+62, r20 ; 0x3e 312e0: 5f af std Y+63, r21 ; 0x3f 312e2: ae 97 sbiw r28, 0x2e ; 46 312e4: 80 91 32 13 lds r24, 0x1332 ; 0x801332 312e8: 90 91 33 13 lds r25, 0x1333 ; 0x801333 312ec: a0 91 34 13 lds r26, 0x1334 ; 0x801334 312f0: b0 91 35 13 lds r27, 0x1335 ; 0x801335 312f4: e9 96 adiw r28, 0x39 ; 57 312f6: 8c af std Y+60, r24 ; 0x3c 312f8: 9d af std Y+61, r25 ; 0x3d 312fa: ae af std Y+62, r26 ; 0x3e 312fc: bf af std Y+63, r27 ; 0x3f 312fe: e9 97 sbiw r28, 0x39 ; 57 31300: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 31304: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 31308: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 3130c: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 31310: e4 96 adiw r28, 0x34 ; 52 31312: 2c af std Y+60, r18 ; 0x3c 31314: 3d af std Y+61, r19 ; 0x3d 31316: 4e af std Y+62, r20 ; 0x3e 31318: 5f af std Y+63, r21 ; 0x3f 3131a: 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]; 3131c: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 31320: 90 91 2f 13 lds r25, 0x132F ; 0x80132f 31324: a0 91 30 13 lds r26, 0x1330 ; 0x801330 31328: b0 91 31 13 lds r27, 0x1331 ; 0x801331 3132c: ed 96 adiw r28, 0x3d ; 61 3132e: 8c af std Y+60, r24 ; 0x3c 31330: 9d af std Y+61, r25 ; 0x3d 31332: ae af std Y+62, r26 ; 0x3e 31334: bf af std Y+63, r27 ; 0x3f 31336: ed 97 sbiw r28, 0x3d ; 61 31338: 20 91 36 13 lds r18, 0x1336 ; 0x801336 3133c: 30 91 37 13 lds r19, 0x1337 ; 0x801337 31340: 40 91 38 13 lds r20, 0x1338 ; 0x801338 31344: 50 91 39 13 lds r21, 0x1339 ; 0x801339 31348: c3 58 subi r28, 0x83 ; 131 3134a: df 4f sbci r29, 0xFF ; 255 3134c: 28 83 st Y, r18 3134e: 39 83 std Y+1, r19 ; 0x01 31350: 4a 83 std Y+2, r20 ; 0x02 31352: 5b 83 std Y+3, r21 ; 0x03 31354: cd 57 subi r28, 0x7D ; 125 31356: d0 40 sbci r29, 0x00 ; 0 31358: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 3135c: 90 91 3f 13 lds r25, 0x133F ; 0x80133f 31360: a0 91 40 13 lds r26, 0x1340 ; 0x801340 31364: b0 91 41 13 lds r27, 0x1341 ; 0x801341 31368: cf 57 subi r28, 0x7F ; 127 3136a: df 4f sbci r29, 0xFF ; 255 3136c: 88 83 st Y, r24 3136e: 99 83 std Y+1, r25 ; 0x01 31370: aa 83 std Y+2, r26 ; 0x02 31372: bb 83 std Y+3, r27 ; 0x03 31374: c1 58 subi r28, 0x81 ; 129 31376: d0 40 sbci r29, 0x00 ; 0 31378: a0 e0 ldi r26, 0x00 ; 0 3137a: bc e9 ldi r27, 0x9C ; 156 3137c: 6c 96 adiw r28, 0x1c ; 28 3137e: bf af std Y+63, r27 ; 0x3f 31380: ae af std Y+62, r26 ; 0x3e 31382: 6c 97 sbiw r28, 0x1c ; 28 31384: 89 e0 ldi r24, 0x09 ; 9 31386: 28 2e mov r2, r24 31388: 83 e1 ldi r24, 0x13 ; 19 3138a: 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]; 3138c: f1 01 movw r30, r2 3138e: c1 80 ldd r12, Z+1 ; 0x01 31390: d2 80 ldd r13, Z+2 ; 0x02 31392: e3 80 ldd r14, Z+3 ; 0x03 31394: f4 80 ldd r15, Z+4 ; 0x04 31396: 45 80 ldd r4, Z+5 ; 0x05 31398: 56 80 ldd r5, Z+6 ; 0x06 3139a: 67 80 ldd r6, Z+7 ; 0x07 3139c: 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; 3139e: 6c 96 adiw r28, 0x1c ; 28 313a0: ee ad ldd r30, Y+62 ; 0x3e 313a2: ff ad ldd r31, Y+63 ; 0x3f 313a4: 6c 97 sbiw r28, 0x1c ; 28 313a6: 25 91 lpm r18, Z+ 313a8: 35 91 lpm r19, Z+ 313aa: 45 91 lpm r20, Z+ 313ac: 54 91 lpm r21, Z 313ae: cb 57 subi r28, 0x7B ; 123 313b0: df 4f sbci r29, 0xFF ; 255 313b2: 28 83 st Y, r18 313b4: 39 83 std Y+1, r19 ; 0x01 313b6: 4a 83 std Y+2, r20 ; 0x02 313b8: 5b 83 std Y+3, r21 ; 0x03 313ba: c5 58 subi r28, 0x85 ; 133 313bc: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 313be: 6c 96 adiw r28, 0x1c ; 28 313c0: ee ad ldd r30, Y+62 ; 0x3e 313c2: ff ad ldd r31, Y+63 ; 0x3f 313c4: 6c 97 sbiw r28, 0x1c ; 28 313c6: 34 96 adiw r30, 0x04 ; 4 313c8: 85 90 lpm r8, Z+ 313ca: 95 90 lpm r9, Z+ 313cc: a5 90 lpm r10, Z+ 313ce: 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]; 313d0: ed 96 adiw r28, 0x3d ; 61 313d2: 2c ad ldd r18, Y+60 ; 0x3c 313d4: 3d ad ldd r19, Y+61 ; 0x3d 313d6: 4e ad ldd r20, Y+62 ; 0x3e 313d8: 5f ad ldd r21, Y+63 ; 0x3f 313da: ed 97 sbiw r28, 0x3d ; 61 313dc: c7 01 movw r24, r14 313de: b6 01 movw r22, r12 313e0: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 313e4: c7 57 subi r28, 0x77 ; 119 313e6: df 4f sbci r29, 0xFF ; 255 313e8: 68 83 st Y, r22 313ea: 79 83 std Y+1, r23 ; 0x01 313ec: 8a 83 std Y+2, r24 ; 0x02 313ee: 9b 83 std Y+3, r25 ; 0x03 313f0: c9 58 subi r28, 0x89 ; 137 313f2: d0 40 sbci r29, 0x00 ; 0 313f4: c3 58 subi r28, 0x83 ; 131 313f6: df 4f sbci r29, 0xFF ; 255 313f8: 28 81 ld r18, Y 313fa: 39 81 ldd r19, Y+1 ; 0x01 313fc: 4a 81 ldd r20, Y+2 ; 0x02 313fe: 5b 81 ldd r21, Y+3 ; 0x03 31400: cd 57 subi r28, 0x7D ; 125 31402: d0 40 sbci r29, 0x00 ; 0 31404: c3 01 movw r24, r6 31406: b2 01 movw r22, r4 31408: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3140c: 9b 01 movw r18, r22 3140e: ac 01 movw r20, r24 31410: c7 57 subi r28, 0x77 ; 119 31412: df 4f sbci r29, 0xFF ; 255 31414: 68 81 ld r22, Y 31416: 79 81 ldd r23, Y+1 ; 0x01 31418: 8a 81 ldd r24, Y+2 ; 0x02 3141a: 9b 81 ldd r25, Y+3 ; 0x03 3141c: c9 58 subi r28, 0x89 ; 137 3141e: d0 40 sbci r29, 0x00 ; 0 31420: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31424: cf 57 subi r28, 0x7F ; 127 31426: df 4f sbci r29, 0xFF ; 255 31428: 28 81 ld r18, Y 3142a: 39 81 ldd r19, Y+1 ; 0x01 3142c: 4a 81 ldd r20, Y+2 ; 0x02 3142e: 5b 81 ldd r21, Y+3 ; 0x03 31430: c1 58 subi r28, 0x81 ; 129 31432: d0 40 sbci r29, 0x00 ; 0 31434: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31438: 9b 01 movw r18, r22 3143a: 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; 3143c: c5 01 movw r24, r10 3143e: b4 01 movw r22, r8 31440: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 31444: 4b 01 movw r8, r22 31446: 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]; 31448: a7 01 movw r20, r14 3144a: 96 01 movw r18, r12 3144c: ae 96 adiw r28, 0x2e ; 46 3144e: 6c ad ldd r22, Y+60 ; 0x3c 31450: 7d ad ldd r23, Y+61 ; 0x3d 31452: 8e ad ldd r24, Y+62 ; 0x3e 31454: 9f ad ldd r25, Y+63 ; 0x3f 31456: ae 97 sbiw r28, 0x2e ; 46 31458: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3145c: 6b 01 movw r12, r22 3145e: 7c 01 movw r14, r24 31460: a3 01 movw r20, r6 31462: 92 01 movw r18, r4 31464: e9 96 adiw r28, 0x39 ; 57 31466: 6c ad ldd r22, Y+60 ; 0x3c 31468: 7d ad ldd r23, Y+61 ; 0x3d 3146a: 8e ad ldd r24, Y+62 ; 0x3e 3146c: 9f ad ldd r25, Y+63 ; 0x3f 3146e: e9 97 sbiw r28, 0x39 ; 57 31470: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31474: 9b 01 movw r18, r22 31476: ac 01 movw r20, r24 31478: c7 01 movw r24, r14 3147a: b6 01 movw r22, r12 3147c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31480: e4 96 adiw r28, 0x34 ; 52 31482: 2c ad ldd r18, Y+60 ; 0x3c 31484: 3d ad ldd r19, Y+61 ; 0x3d 31486: 4e ad ldd r20, Y+62 ; 0x3e 31488: 5f ad ldd r21, Y+63 ; 0x3f 3148a: e4 97 sbiw r28, 0x34 ; 52 3148c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31490: 9b 01 movw r18, r22 31492: 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; 31494: cb 57 subi r28, 0x7B ; 123 31496: df 4f sbci r29, 0xFF ; 255 31498: 68 81 ld r22, Y 3149a: 79 81 ldd r23, Y+1 ; 0x01 3149c: 8a 81 ldd r24, Y+2 ; 0x02 3149e: 9b 81 ldd r25, Y+3 ; 0x03 314a0: c5 58 subi r28, 0x85 ; 133 314a2: d0 40 sbci r29, 0x00 ; 0 314a4: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 314a8: a5 01 movw r20, r10 314aa: 94 01 movw r18, r8 314ac: 0f 94 61 a7 call 0x34ec2 ; 0x34ec2 } 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) { 314b0: 2d ec ldi r18, 0xCD ; 205 314b2: 3c ec ldi r19, 0xCC ; 204 314b4: 4c e4 ldi r20, 0x4C ; 76 314b6: 5f e3 ldi r21, 0x3F ; 63 314b8: 0f 94 4e a7 call 0x34e9c ; 0x34e9c <__gesf2> 314bc: 18 16 cp r1, r24 314be: 0c f4 brge .+2 ; 0x314c2 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 314c0: 1e ef ldi r17, 0xFE ; 254 314c2: 38 e0 ldi r19, 0x08 ; 8 314c4: 23 0e add r2, r19 314c6: 31 1c adc r3, r1 314c8: 6c 96 adiw r28, 0x1c ; 28 314ca: 4e ad ldd r20, Y+62 ; 0x3e 314cc: 5f ad ldd r21, Y+63 ; 0x3f 314ce: 6c 97 sbiw r28, 0x1c ; 28 314d0: 48 5f subi r20, 0xF8 ; 248 314d2: 5f 4f sbci r21, 0xFF ; 255 314d4: 6c 96 adiw r28, 0x1c ; 28 314d6: 5f af std Y+63, r21 ; 0x3f 314d8: 4e af std Y+62, r20 ; 0x3e 314da: 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) { 314dc: a8 96 adiw r28, 0x28 ; 40 314de: 8e ad ldd r24, Y+62 ; 0x3e 314e0: 9f ad ldd r25, Y+63 ; 0x3f 314e2: a8 97 sbiw r28, 0x28 ; 40 314e4: 82 15 cp r24, r2 314e6: 93 05 cpc r25, r3 314e8: 09 f0 breq .+2 ; 0x314ec 314ea: 50 cf rjmp .-352 ; 0x3138c MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 314ec: 11 11 cpse r17, r1 314ee: 62 c1 rjmp .+708 ; 0x317b4 #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); 314f0: a2 96 adiw r28, 0x22 ; 34 314f2: 2c ad ldd r18, Y+60 ; 0x3c 314f4: 3d ad ldd r19, Y+61 ; 0x3d 314f6: 4e ad ldd r20, Y+62 ; 0x3e 314f8: 5f ad ldd r21, Y+63 ; 0x3f 314fa: a2 97 sbiw r28, 0x22 ; 34 314fc: a6 96 adiw r28, 0x26 ; 38 314fe: 6c ad ldd r22, Y+60 ; 0x3c 31500: 7d ad ldd r23, Y+61 ; 0x3d 31502: 8e ad ldd r24, Y+62 ; 0x3e 31504: 9f ad ldd r25, Y+63 ; 0x3f 31506: a6 97 sbiw r28, 0x26 ; 38 31508: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 3150c: 20 e0 ldi r18, 0x00 ; 0 3150e: 30 e0 ldi r19, 0x00 ; 0 31510: 40 e0 ldi r20, 0x00 ; 0 31512: 5f e3 ldi r21, 0x3F ; 63 31514: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31518: 6b 01 movw r12, r22 3151a: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 3151c: 0f 94 bf a5 call 0x34b7e ; 0x34b7e 31520: a2 96 adiw r28, 0x22 ; 34 31522: 6c af std Y+60, r22 ; 0x3c 31524: 7d af std Y+61, r23 ; 0x3d 31526: 8e af std Y+62, r24 ; 0x3e 31528: 9f af std Y+63, r25 ; 0x3f 3152a: a2 97 sbiw r28, 0x22 ; 34 3152c: 60 93 2a 13 sts 0x132A, r22 ; 0x80132a 31530: 70 93 2b 13 sts 0x132B, r23 ; 0x80132b 31534: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 31538: 90 93 2d 13 sts 0x132D, r25 ; 0x80132d vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 3153c: c7 01 movw r24, r14 3153e: b6 01 movw r22, r12 31540: 0f 94 85 a8 call 0x3510a ; 0x3510a 31544: a6 96 adiw r28, 0x26 ; 38 31546: 6c af std Y+60, r22 ; 0x3c 31548: 7d af std Y+61, r23 ; 0x3d 3154a: 8e af std Y+62, r24 ; 0x3e 3154c: 9f af std Y+63, r25 ; 0x3f 3154e: a6 97 sbiw r28, 0x26 ; 38 31550: 60 93 2e 13 sts 0x132E, r22 ; 0x80132e 31554: 70 93 2f 13 sts 0x132F, r23 ; 0x80132f 31558: 80 93 30 13 sts 0x1330, r24 ; 0x801330 3155c: 90 93 31 13 sts 0x1331, r25 ; 0x801331 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 31560: 9b 01 movw r18, r22 31562: ac 01 movw r20, r24 31564: 50 58 subi r21, 0x80 ; 128 31566: aa 96 adiw r28, 0x2a ; 42 31568: 2c af std Y+60, r18 ; 0x3c 3156a: 3d af std Y+61, r19 ; 0x3d 3156c: 4e af std Y+62, r20 ; 0x3e 3156e: 5f af std Y+63, r21 ; 0x3f 31570: aa 97 sbiw r28, 0x2a ; 42 31572: 20 93 32 13 sts 0x1332, r18 ; 0x801332 31576: 30 93 33 13 sts 0x1333, r19 ; 0x801333 3157a: 40 93 34 13 sts 0x1334, r20 ; 0x801334 3157e: 50 93 35 13 sts 0x1335, r21 ; 0x801335 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 31582: a2 96 adiw r28, 0x22 ; 34 31584: 8c ad ldd r24, Y+60 ; 0x3c 31586: 9d ad ldd r25, Y+61 ; 0x3d 31588: ae ad ldd r26, Y+62 ; 0x3e 3158a: bf ad ldd r27, Y+63 ; 0x3f 3158c: a2 97 sbiw r28, 0x22 ; 34 3158e: 80 93 36 13 sts 0x1336, r24 ; 0x801336 31592: 90 93 37 13 sts 0x1337, r25 ; 0x801337 31596: a0 93 38 13 sts 0x1338, r26 ; 0x801338 3159a: b0 93 39 13 sts 0x1339, r27 ; 0x801339 // Refresh the offset. cntr[0] = 0.f; 3159e: 10 92 3a 13 sts 0x133A, r1 ; 0x80133a 315a2: 10 92 3b 13 sts 0x133B, r1 ; 0x80133b 315a6: 10 92 3c 13 sts 0x133C, r1 ; 0x80133c 315aa: 10 92 3d 13 sts 0x133D, r1 ; 0x80133d cntr[1] = 0.f; 315ae: 10 92 3e 13 sts 0x133E, r1 ; 0x80133e 315b2: 10 92 3f 13 sts 0x133F, r1 ; 0x80133f 315b6: 10 92 40 13 sts 0x1340, r1 ; 0x801340 315ba: 10 92 41 13 sts 0x1341, r1 ; 0x801341 float wx = 0.f; 315be: 41 2c mov r4, r1 315c0: 51 2c mov r5, r1 315c2: 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]; 315c4: cf 56 subi r28, 0x6F ; 111 315c6: df 4f sbci r29, 0xFF ; 255 315c8: a8 81 ld r26, Y 315ca: b9 81 ldd r27, Y+1 ; 0x01 315cc: c1 59 subi r28, 0x91 ; 145 315ce: d0 40 sbci r29, 0x00 ; 0 315d0: 11 96 adiw r26, 0x01 ; 1 315d2: 8d 90 ld r8, X+ 315d4: 9d 90 ld r9, X+ 315d6: ad 90 ld r10, X+ 315d8: bc 90 ld r11, X 315da: 14 97 sbiw r26, 0x04 ; 4 315dc: 15 96 adiw r26, 0x05 ; 5 315de: 2d 91 ld r18, X+ 315e0: 3d 91 ld r19, X+ 315e2: 4d 91 ld r20, X+ 315e4: 5c 91 ld r21, X 315e6: 18 97 sbiw r26, 0x08 ; 8 315e8: 6e 96 adiw r28, 0x1e ; 30 315ea: 2c af std Y+60, r18 ; 0x3c 315ec: 3d af std Y+61, r19 ; 0x3d 315ee: 4e af std Y+62, r20 ; 0x3e 315f0: 5f af std Y+63, r21 ; 0x3f 315f2: 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); 315f4: cd 56 subi r28, 0x6D ; 109 315f6: df 4f sbci r29, 0xFF ; 255 315f8: e8 81 ld r30, Y 315fa: f9 81 ldd r31, Y+1 ; 0x01 315fc: c3 59 subi r28, 0x93 ; 147 315fe: d0 40 sbci r29, 0x00 ; 0 31600: c5 90 lpm r12, Z+ 31602: d5 90 lpm r13, Z+ 31604: e5 90 lpm r14, Z+ 31606: 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]; 31608: a5 01 movw r20, r10 3160a: 94 01 movw r18, r8 3160c: a2 96 adiw r28, 0x22 ; 34 3160e: 6c ad ldd r22, Y+60 ; 0x3c 31610: 7d ad ldd r23, Y+61 ; 0x3d 31612: 8e ad ldd r24, Y+62 ; 0x3e 31614: 9f ad ldd r25, Y+63 ; 0x3f 31616: a2 97 sbiw r28, 0x22 ; 34 31618: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3161c: ae 96 adiw r28, 0x2e ; 46 3161e: 6c af std Y+60, r22 ; 0x3c 31620: 7d af std Y+61, r23 ; 0x3d 31622: 8e af std Y+62, r24 ; 0x3e 31624: 9f af std Y+63, r25 ; 0x3f 31626: ae 97 sbiw r28, 0x2e ; 46 31628: 6e 96 adiw r28, 0x1e ; 30 3162a: 2c ad ldd r18, Y+60 ; 0x3c 3162c: 3d ad ldd r19, Y+61 ; 0x3d 3162e: 4e ad ldd r20, Y+62 ; 0x3e 31630: 5f ad ldd r21, Y+63 ; 0x3f 31632: 6e 97 sbiw r28, 0x1e ; 30 31634: aa 96 adiw r28, 0x2a ; 42 31636: 6c ad ldd r22, Y+60 ; 0x3c 31638: 7d ad ldd r23, Y+61 ; 0x3d 3163a: 8e ad ldd r24, Y+62 ; 0x3e 3163c: 9f ad ldd r25, Y+63 ; 0x3f 3163e: aa 97 sbiw r28, 0x2a ; 42 31640: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31644: 9b 01 movw r18, r22 31646: ac 01 movw r20, r24 31648: ae 96 adiw r28, 0x2e ; 46 3164a: 6c ad ldd r22, Y+60 ; 0x3c 3164c: 7d ad ldd r23, Y+61 ; 0x3d 3164e: 8e ad ldd r24, Y+62 ; 0x3e 31650: 9f ad ldd r25, Y+63 ; 0x3f 31652: ae 97 sbiw r28, 0x2e ; 46 31654: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31658: 9b 01 movw r18, r22 3165a: 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); 3165c: c7 01 movw r24, r14 3165e: b6 01 movw r22, r12 31660: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 31664: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 31668: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 3166c: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 31670: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 31674: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31678: 6b 01 movw r12, r22 3167a: 7c 01 movw r14, r24 3167c: c0 92 3a 13 sts 0x133A, r12 ; 0x80133a 31680: d0 92 3b 13 sts 0x133B, r13 ; 0x80133b 31684: e0 92 3c 13 sts 0x133C, r14 ; 0x80133c 31688: f0 92 3d 13 sts 0x133D, r15 ; 0x80133d wx += w; 3168c: 20 e0 ldi r18, 0x00 ; 0 3168e: 30 e0 ldi r19, 0x00 ; 0 31690: 40 e8 ldi r20, 0x80 ; 128 31692: 5f e3 ldi r21, 0x3F ; 63 31694: c3 01 movw r24, r6 31696: b2 01 movw r22, r4 31698: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 3169c: 2b 01 movw r4, r22 3169e: 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); 316a0: cd 56 subi r28, 0x6D ; 109 316a2: df 4f sbci r29, 0xFF ; 255 316a4: e8 81 ld r30, Y 316a6: f9 81 ldd r31, Y+1 ; 0x01 316a8: c3 59 subi r28, 0x93 ; 147 316aa: d0 40 sbci r29, 0x00 ; 0 316ac: 34 96 adiw r30, 0x04 ; 4 316ae: 25 91 lpm r18, Z+ 316b0: 35 91 lpm r19, Z+ 316b2: 45 91 lpm r20, Z+ 316b4: 54 91 lpm r21, Z 316b6: ae 96 adiw r28, 0x2e ; 46 316b8: 2c af std Y+60, r18 ; 0x3c 316ba: 3d af std Y+61, r19 ; 0x3d 316bc: 4e af std Y+62, r20 ; 0x3e 316be: 5f af std Y+63, r21 ; 0x3f 316c0: 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]; 316c2: a5 01 movw r20, r10 316c4: 94 01 movw r18, r8 316c6: a6 96 adiw r28, 0x26 ; 38 316c8: 6c ad ldd r22, Y+60 ; 0x3c 316ca: 7d ad ldd r23, Y+61 ; 0x3d 316cc: 8e ad ldd r24, Y+62 ; 0x3e 316ce: 9f ad ldd r25, Y+63 ; 0x3f 316d0: a6 97 sbiw r28, 0x26 ; 38 316d2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 316d6: 4b 01 movw r8, r22 316d8: 5c 01 movw r10, r24 316da: 6e 96 adiw r28, 0x1e ; 30 316dc: 2c ad ldd r18, Y+60 ; 0x3c 316de: 3d ad ldd r19, Y+61 ; 0x3d 316e0: 4e ad ldd r20, Y+62 ; 0x3e 316e2: 5f ad ldd r21, Y+63 ; 0x3f 316e4: 6e 97 sbiw r28, 0x1e ; 30 316e6: a2 96 adiw r28, 0x22 ; 34 316e8: 6c ad ldd r22, Y+60 ; 0x3c 316ea: 7d ad ldd r23, Y+61 ; 0x3d 316ec: 8e ad ldd r24, Y+62 ; 0x3e 316ee: 9f ad ldd r25, Y+63 ; 0x3f 316f0: a2 97 sbiw r28, 0x22 ; 34 316f2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 316f6: 9b 01 movw r18, r22 316f8: ac 01 movw r20, r24 316fa: c5 01 movw r24, r10 316fc: b4 01 movw r22, r8 316fe: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31702: 9b 01 movw r18, r22 31704: 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); 31706: ae 96 adiw r28, 0x2e ; 46 31708: 6c ad ldd r22, Y+60 ; 0x3c 3170a: 7d ad ldd r23, Y+61 ; 0x3d 3170c: 8e ad ldd r24, Y+62 ; 0x3e 3170e: 9f ad ldd r25, Y+63 ; 0x3f 31710: ae 97 sbiw r28, 0x2e ; 46 31712: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 31716: 20 91 3e 13 lds r18, 0x133E ; 0x80133e 3171a: 30 91 3f 13 lds r19, 0x133F ; 0x80133f 3171e: 40 91 40 13 lds r20, 0x1340 ; 0x801340 31722: 50 91 41 13 lds r21, 0x1341 ; 0x801341 31726: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 3172a: 4b 01 movw r8, r22 3172c: 5c 01 movw r10, r24 3172e: 80 92 3e 13 sts 0x133E, r8 ; 0x80133e 31732: 90 92 3f 13 sts 0x133F, r9 ; 0x80133f 31736: a0 92 40 13 sts 0x1340, r10 ; 0x801340 3173a: b0 92 41 13 sts 0x1341, r11 ; 0x801341 3173e: cf 56 subi r28, 0x6F ; 111 31740: df 4f sbci r29, 0xFF ; 255 31742: 48 81 ld r20, Y 31744: 59 81 ldd r21, Y+1 ; 0x01 31746: c1 59 subi r28, 0x91 ; 145 31748: d0 40 sbci r29, 0x00 ; 0 3174a: 48 5f subi r20, 0xF8 ; 248 3174c: 5f 4f sbci r21, 0xFF ; 255 3174e: cf 56 subi r28, 0x6F ; 111 31750: df 4f sbci r29, 0xFF ; 255 31752: 59 83 std Y+1, r21 ; 0x01 31754: 48 83 st Y, r20 31756: c1 59 subi r28, 0x91 ; 145 31758: d0 40 sbci r29, 0x00 ; 0 3175a: cd 56 subi r28, 0x6D ; 109 3175c: df 4f sbci r29, 0xFF ; 255 3175e: 88 81 ld r24, Y 31760: 99 81 ldd r25, Y+1 ; 0x01 31762: c3 59 subi r28, 0x93 ; 147 31764: d0 40 sbci r29, 0x00 ; 0 31766: 08 96 adiw r24, 0x08 ; 8 31768: cd 56 subi r28, 0x6D ; 109 3176a: df 4f sbci r29, 0xFF ; 255 3176c: 99 83 std Y+1, r25 ; 0x01 3176e: 88 83 st Y, r24 31770: c3 59 subi r28, 0x93 ; 147 31772: 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) { 31774: 24 16 cp r2, r20 31776: 35 06 cpc r3, r21 31778: 09 f0 breq .+2 ; 0x3177c 3177a: 24 cf rjmp .-440 ; 0x315c4 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 3177c: a3 01 movw r20, r6 3177e: 92 01 movw r18, r4 31780: c7 01 movw r24, r14 31782: b6 01 movw r22, r12 31784: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 31788: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 3178c: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 31790: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 31794: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d cntr[1] /= wy; 31798: a3 01 movw r20, r6 3179a: 92 01 movw r18, r4 3179c: c5 01 movw r24, r10 3179e: b4 01 movw r22, r8 317a0: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 317a4: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 317a8: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 317ac: 80 93 40 13 sts 0x1340, r24 ; 0x801340 317b0: 90 93 41 13 sts 0x1341, r25 ; 0x801341 #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]; 317b4: 40 90 2a 13 lds r4, 0x132A ; 0x80132a 317b8: 50 90 2b 13 lds r5, 0x132B ; 0x80132b 317bc: 60 90 2c 13 lds r6, 0x132C ; 0x80132c 317c0: 70 90 2d 13 lds r7, 0x132D ; 0x80132d 317c4: c0 90 36 13 lds r12, 0x1336 ; 0x801336 317c8: d0 90 37 13 lds r13, 0x1337 ; 0x801337 317cc: e0 90 38 13 lds r14, 0x1338 ; 0x801338 317d0: f0 90 39 13 lds r15, 0x1339 ; 0x801339 317d4: 20 91 2e 13 lds r18, 0x132E ; 0x80132e 317d8: 30 91 2f 13 lds r19, 0x132F ; 0x80132f 317dc: 40 91 30 13 lds r20, 0x1330 ; 0x801330 317e0: 50 91 31 13 lds r21, 0x1331 ; 0x801331 317e4: a2 96 adiw r28, 0x22 ; 34 317e6: 2c af std Y+60, r18 ; 0x3c 317e8: 3d af std Y+61, r19 ; 0x3d 317ea: 4e af std Y+62, r20 ; 0x3e 317ec: 5f af std Y+63, r21 ; 0x3f 317ee: a2 97 sbiw r28, 0x22 ; 34 317f0: 80 91 32 13 lds r24, 0x1332 ; 0x801332 317f4: 90 91 33 13 lds r25, 0x1333 ; 0x801333 317f8: a0 91 34 13 lds r26, 0x1334 ; 0x801334 317fc: b0 91 35 13 lds r27, 0x1335 ; 0x801335 31800: a6 96 adiw r28, 0x26 ; 38 31802: 8c af std Y+60, r24 ; 0x3c 31804: 9d af std Y+61, r25 ; 0x3d 31806: ae af std Y+62, r26 ; 0x3e 31808: bf af std Y+63, r27 ; 0x3f 3180a: a6 97 sbiw r28, 0x26 ; 38 3180c: a7 01 movw r20, r14 3180e: 96 01 movw r18, r12 31810: c3 01 movw r24, r6 31812: b2 01 movw r22, r4 31814: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31818: 4b 01 movw r8, r22 3181a: 5c 01 movw r10, r24 3181c: a6 96 adiw r28, 0x26 ; 38 3181e: 2c ad ldd r18, Y+60 ; 0x3c 31820: 3d ad ldd r19, Y+61 ; 0x3d 31822: 4e ad ldd r20, Y+62 ; 0x3e 31824: 5f ad ldd r21, Y+63 ; 0x3f 31826: a6 97 sbiw r28, 0x26 ; 38 31828: a2 96 adiw r28, 0x22 ; 34 3182a: 6c ad ldd r22, Y+60 ; 0x3c 3182c: 7d ad ldd r23, Y+61 ; 0x3d 3182e: 8e ad ldd r24, Y+62 ; 0x3e 31830: 9f ad ldd r25, Y+63 ; 0x3f 31832: a2 97 sbiw r28, 0x22 ; 34 31834: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31838: 9b 01 movw r18, r22 3183a: ac 01 movw r20, r24 3183c: c5 01 movw r24, r10 3183e: b4 01 movw r22, r8 31840: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 31844: 4b 01 movw r8, r22 31846: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 31848: ac 01 movw r20, r24 3184a: 9b 01 movw r18, r22 3184c: c7 01 movw r24, r14 3184e: b6 01 movw r22, r12 31850: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 31854: 6b 01 movw r12, r22 31856: 7c 01 movw r14, r24 31858: a6 96 adiw r28, 0x26 ; 38 3185a: 6c ad ldd r22, Y+60 ; 0x3c 3185c: 7d ad ldd r23, Y+61 ; 0x3d 3185e: 8e ad ldd r24, Y+62 ; 0x3e 31860: 9f ad ldd r25, Y+63 ; 0x3f 31862: a6 97 sbiw r28, 0x26 ; 38 31864: 90 58 subi r25, 0x80 ; 128 31866: a5 01 movw r20, r10 31868: 94 01 movw r18, r8 3186a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 3186e: a6 96 adiw r28, 0x26 ; 38 31870: 6c af std Y+60, r22 ; 0x3c 31872: 7d af std Y+61, r23 ; 0x3d 31874: 8e af std Y+62, r24 ; 0x3e 31876: 9f af std Y+63, r25 ; 0x3f 31878: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 3187a: a2 96 adiw r28, 0x22 ; 34 3187c: 6c ad ldd r22, Y+60 ; 0x3c 3187e: 7d ad ldd r23, Y+61 ; 0x3d 31880: 8e ad ldd r24, Y+62 ; 0x3e 31882: 9f ad ldd r25, Y+63 ; 0x3f 31884: a2 97 sbiw r28, 0x22 ; 34 31886: 90 58 subi r25, 0x80 ; 128 31888: a5 01 movw r20, r10 3188a: 94 01 movw r18, r8 3188c: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 31890: aa 96 adiw r28, 0x2a ; 42 31892: 6c af std Y+60, r22 ; 0x3c 31894: 7d af std Y+61, r23 ; 0x3d 31896: 8e af std Y+62, r24 ; 0x3e 31898: 9f af std Y+63, r25 ; 0x3f 3189a: aa 97 sbiw r28, 0x2a ; 42 3189c: a5 01 movw r20, r10 3189e: 94 01 movw r18, r8 318a0: c3 01 movw r24, r6 318a2: b2 01 movw r22, r4 318a4: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 318a8: 4b 01 movw r8, r22 318aa: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 318ac: 40 90 3a 13 lds r4, 0x133A ; 0x80133a 318b0: 50 90 3b 13 lds r5, 0x133B ; 0x80133b 318b4: 60 90 3c 13 lds r6, 0x133C ; 0x80133c 318b8: 70 90 3d 13 lds r7, 0x133D ; 0x80133d 318bc: 20 91 3e 13 lds r18, 0x133E ; 0x80133e 318c0: 30 91 3f 13 lds r19, 0x133F ; 0x80133f 318c4: 40 91 40 13 lds r20, 0x1340 ; 0x801340 318c8: 50 91 41 13 lds r21, 0x1341 ; 0x801341 318cc: a2 96 adiw r28, 0x22 ; 34 318ce: 2c af std Y+60, r18 ; 0x3c 318d0: 3d af std Y+61, r19 ; 0x3d 318d2: 4e af std Y+62, r20 ; 0x3e 318d4: 5f af std Y+63, r21 ; 0x3f 318d6: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 318d8: c0 92 2a 13 sts 0x132A, r12 ; 0x80132a 318dc: d0 92 2b 13 sts 0x132B, r13 ; 0x80132b 318e0: e0 92 2c 13 sts 0x132C, r14 ; 0x80132c 318e4: f0 92 2d 13 sts 0x132D, r15 ; 0x80132d vec_x[1] = Ainv[1][0]; 318e8: aa 96 adiw r28, 0x2a ; 42 318ea: 8c ad ldd r24, Y+60 ; 0x3c 318ec: 9d ad ldd r25, Y+61 ; 0x3d 318ee: ae ad ldd r26, Y+62 ; 0x3e 318f0: bf ad ldd r27, Y+63 ; 0x3f 318f2: aa 97 sbiw r28, 0x2a ; 42 318f4: 80 93 2e 13 sts 0x132E, r24 ; 0x80132e 318f8: 90 93 2f 13 sts 0x132F, r25 ; 0x80132f 318fc: a0 93 30 13 sts 0x1330, r26 ; 0x801330 31900: b0 93 31 13 sts 0x1331, r27 ; 0x801331 vec_y[0] = Ainv[0][1]; 31904: a6 96 adiw r28, 0x26 ; 38 31906: 2c ad ldd r18, Y+60 ; 0x3c 31908: 3d ad ldd r19, Y+61 ; 0x3d 3190a: 4e ad ldd r20, Y+62 ; 0x3e 3190c: 5f ad ldd r21, Y+63 ; 0x3f 3190e: a6 97 sbiw r28, 0x26 ; 38 31910: 20 93 32 13 sts 0x1332, r18 ; 0x801332 31914: 30 93 33 13 sts 0x1333, r19 ; 0x801333 31918: 40 93 34 13 sts 0x1334, r20 ; 0x801334 3191c: 50 93 35 13 sts 0x1335, r21 ; 0x801335 vec_y[1] = Ainv[1][1]; 31920: 80 92 36 13 sts 0x1336, r8 ; 0x801336 31924: 90 92 37 13 sts 0x1337, r9 ; 0x801337 31928: a0 92 38 13 sts 0x1338, r10 ; 0x801338 3192c: b0 92 39 13 sts 0x1339, r11 ; 0x801339 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], 31930: c7 01 movw r24, r14 31932: b6 01 movw r22, r12 31934: 90 58 subi r25, 0x80 ; 128 31936: a3 01 movw r20, r6 31938: 92 01 movw r18, r4 3193a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3193e: 6b 01 movw r12, r22 31940: 7c 01 movw r14, r24 31942: a2 96 adiw r28, 0x22 ; 34 31944: 2c ad ldd r18, Y+60 ; 0x3c 31946: 3d ad ldd r19, Y+61 ; 0x3d 31948: 4e ad ldd r20, Y+62 ; 0x3e 3194a: 5f ad ldd r21, Y+63 ; 0x3f 3194c: a2 97 sbiw r28, 0x22 ; 34 3194e: a6 96 adiw r28, 0x26 ; 38 31950: 6c ad ldd r22, Y+60 ; 0x3c 31952: 7d ad ldd r23, Y+61 ; 0x3d 31954: 8e ad ldd r24, Y+62 ; 0x3e 31956: 9f ad ldd r25, Y+63 ; 0x3f 31958: a6 97 sbiw r28, 0x26 ; 38 3195a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3195e: 9b 01 movw r18, r22 31960: ac 01 movw r20, r24 31962: c7 01 movw r24, r14 31964: b6 01 movw r22, r12 31966: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__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]; 3196a: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 3196e: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 31972: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 31976: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d { 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] 3197a: aa 96 adiw r28, 0x2a ; 42 3197c: 6c ad ldd r22, Y+60 ; 0x3c 3197e: 7d ad ldd r23, Y+61 ; 0x3d 31980: 8e ad ldd r24, Y+62 ; 0x3e 31982: 9f ad ldd r25, Y+63 ; 0x3f 31984: aa 97 sbiw r28, 0x2a ; 42 31986: 90 58 subi r25, 0x80 ; 128 31988: a3 01 movw r20, r6 3198a: 92 01 movw r18, r4 3198c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31990: 6b 01 movw r12, r22 31992: 7c 01 movw r14, r24 31994: a2 96 adiw r28, 0x22 ; 34 31996: 2c ad ldd r18, Y+60 ; 0x3c 31998: 3d ad ldd r19, Y+61 ; 0x3d 3199a: 4e ad ldd r20, Y+62 ; 0x3e 3199c: 5f ad ldd r21, Y+63 ; 0x3f 3199e: a2 97 sbiw r28, 0x22 ; 34 319a0: c5 01 movw r24, r10 319a2: b4 01 movw r22, r8 319a4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 319a8: 9b 01 movw r18, r22 319aa: ac 01 movw r20, r24 319ac: c7 01 movw r24, r14 319ae: b6 01 movw r22, r12 319b0: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__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]; 319b4: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 319b8: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 319bc: 80 93 40 13 sts 0x1340, r24 ; 0x801340 319c0: 90 93 41 13 sts 0x1341, r25 ; 0x801341 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 319c4: 90 e0 ldi r25, 0x00 ; 0 319c6: 80 e0 ldi r24, 0x00 ; 0 319c8: 0e 94 7f 8c call 0x118fe ; 0x118fe if (result >= 0) { 319cc: 17 fd sbrc r17, 7 319ce: d5 c0 rjmp .+426 ; 0x31b7a DBG(_n("Calibration success.\n")); 319d0: 83 ea ldi r24, 0xA3 ; 163 319d2: 9b e6 ldi r25, 0x6B ; 107 319d4: 9f 93 push r25 319d6: 8f 93 push r24 319d8: 0f 94 5f a2 call 0x344be ; 0x344be world2machine_update(vec_x, vec_y, cntr); 319dc: 4a e3 ldi r20, 0x3A ; 58 319de: 53 e1 ldi r21, 0x13 ; 19 319e0: 62 e3 ldi r22, 0x32 ; 50 319e2: 73 e1 ldi r23, 0x13 ; 19 319e4: 8a e2 ldi r24, 0x2A ; 42 319e6: 93 e1 ldi r25, 0x13 ; 19 319e8: 0e 94 4d 5f call 0xbe9a ; 0xbe9a #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); 319ec: 48 e0 ldi r20, 0x08 ; 8 319ee: 50 e0 ldi r21, 0x00 ; 0 319f0: 65 ee ldi r22, 0xE5 ; 229 319f2: 7f e0 ldi r23, 0x0F ; 15 319f4: 8a e3 ldi r24, 0x3A ; 58 319f6: 93 e1 ldi r25, 0x13 ; 19 319f8: 0f 94 b1 a3 call 0x34762 ; 0x34762 319fc: 48 e0 ldi r20, 0x08 ; 8 319fe: 50 e0 ldi r21, 0x00 ; 0 31a00: 6d ed ldi r22, 0xDD ; 221 31a02: 7f e0 ldi r23, 0x0F ; 15 31a04: 8a e2 ldi r24, 0x2A ; 42 31a06: 93 e1 ldi r25, 0x13 ; 19 31a08: 0f 94 b1 a3 call 0x34762 ; 0x34762 31a0c: 48 e0 ldi r20, 0x08 ; 8 31a0e: 50 e0 ldi r21, 0x00 ; 0 31a10: 65 ed ldi r22, 0xD5 ; 213 31a12: 7f e0 ldi r23, 0x0F ; 15 31a14: 82 e3 ldi r24, 0x32 ; 50 31a16: 93 e1 ldi r25, 0x13 ; 19 31a18: 0f 94 b1 a3 call 0x34762 ; 0x34762 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(); 31a1c: 0e 94 d2 5e call 0xbda4 ; 0xbda4 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 31a20: 0f 90 pop r0 31a22: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 31a24: c7 55 subi r28, 0x57 ; 87 31a26: df 4f sbci r29, 0xFF ; 255 31a28: 88 81 ld r24, Y 31a2a: 99 81 ldd r25, Y+1 ; 0x01 31a2c: c9 5a subi r28, 0xA9 ; 169 31a2e: d0 40 sbci r29, 0x00 ; 0 31a30: 0e 94 1c 65 call 0xca38 ; 0xca38 // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31a34: 80 e0 ldi r24, 0x00 ; 0 31a36: 90 e0 ldi r25, 0x00 ; 0 31a38: a0 ea ldi r26, 0xA0 ; 160 31a3a: b0 e4 ldi r27, 0x40 ; 64 31a3c: 80 93 69 12 sts 0x1269, r24 ; 0x801269 31a40: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 31a44: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 31a48: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31a4c: 60 e0 ldi r22, 0x00 ; 0 31a4e: 70 e0 ldi r23, 0x00 ; 0 31a50: 80 ea ldi r24, 0xA0 ; 160 31a52: 91 e4 ldi r25, 0x41 ; 65 31a54: 0f 94 0a 4a call 0x29414 ; 0x29414 st_synchronize(); 31a58: 0f 94 b0 18 call 0x23160 ; 0x23160 //#ifndef NEW_XYZCAL if (result >= 0) 31a5c: 17 fd sbrc r17, 7 31a5e: 22 c0 rjmp .+68 ; 0x31aa4 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; 31a60: 10 92 69 12 sts 0x1269, r1 ; 0x801269 31a64: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 31a68: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 31a6c: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c destination[Z_AXIS] = 150.F; 31a70: 80 e0 ldi r24, 0x00 ; 0 31a72: 90 e0 ldi r25, 0x00 ; 0 31a74: a6 e1 ldi r26, 0x16 ; 22 31a76: b3 e4 ldi r27, 0x43 ; 67 31a78: 80 93 31 06 sts 0x0631, r24 ; 0x800631 31a7c: 90 93 32 06 sts 0x0632, r25 ; 0x800632 31a80: a0 93 33 06 sts 0x0633, r26 ; 0x800633 31a84: b0 93 34 06 sts 0x0634, r27 ; 0x800634 plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 31a88: 65 e5 ldi r22, 0x55 ; 85 31a8a: 75 e5 ldi r23, 0x55 ; 85 31a8c: 85 e5 ldi r24, 0x55 ; 85 31a8e: 91 e4 ldi r25, 0x41 ; 65 31a90: 0f 94 d7 49 call 0x293ae ; 0x293ae lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 31a94: 83 ed ldi r24, 0xD3 ; 211 31a96: 9f e5 ldi r25, 0x5F ; 95 31a98: 0e 94 0a 75 call 0xea14 ; 0xea14 31a9c: 0e 94 85 e8 call 0x1d10a ; 0x1d10a // 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()) 31aa0: 0f 94 c5 52 call 0x2a58a ; 0x2a58a st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 31aa4: 81 e0 ldi r24, 0x01 ; 1 31aa6: 0e 94 08 70 call 0xe010 ; 0xe010 lcd_update(2); 31aaa: 82 e0 ldi r24, 0x02 ; 2 31aac: 0e 94 c9 6e call 0xdd92 ; 0xdd92 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)); 31ab0: 84 e9 ldi r24, 0x94 ; 148 31ab2: 9f e5 ldi r25, 0x5F ; 95 } 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) { 31ab4: 1f 3f cpi r17, 0xFF ; 255 31ab6: 99 f0 breq .+38 ; 0x31ade 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) { 31ab8: 1e 3f cpi r17, 0xFE ; 254 31aba: 09 f0 breq .+2 ; 0x31abe 31abc: 73 c0 rjmp .+230 ; 0x31ba4 if (point_too_far_mask == 0) 31abe: af 96 adiw r28, 0x2f ; 47 31ac0: 4f ad ldd r20, Y+63 ; 0x3f 31ac2: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 31ac4: 8f e5 ldi r24, 0x5F ; 95 31ac6: 9f e5 ldi r25, 0x5F ; 95 { 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) 31ac8: 44 23 and r20, r20 31aca: 49 f0 breq .+18 ; 0x31ade msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 31acc: af 96 adiw r28, 0x2f ; 47 31ace: 5f ad ldd r21, Y+63 ; 0x3f 31ad0: 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); 31ad2: 8d e1 ldi r24, 0x1D ; 29 31ad4: 9f e5 ldi r25, 0x5F ; 95 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) 31ad6: 52 30 cpi r21, 0x02 ; 2 31ad8: 11 f0 breq .+4 ; 0x31ade // 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); 31ada: 86 ed ldi r24, 0xD6 ; 214 31adc: 9e e5 ldi r25, 0x5E ; 94 31ade: 0e 94 0a 75 call 0xea14 ; 0xea14 31ae2: 0d 94 c7 81 jmp 0x3038e ; 0x3038e (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]) : 31ae6: f2 01 movw r30, r4 31ae8: 25 81 ldd r18, Z+5 ; 0x05 31aea: 36 81 ldd r19, Z+6 ; 0x06 31aec: 47 81 ldd r20, Z+7 ; 0x07 31aee: 50 85 ldd r21, Z+8 ; 0x08 31af0: c3 58 subi r28, 0x83 ; 131 31af2: df 4f sbci r29, 0xFF ; 255 31af4: 68 81 ld r22, Y 31af6: 79 81 ldd r23, Y+1 ; 0x01 31af8: 8a 81 ldd r24, Y+2 ; 0x02 31afa: 9b 81 ldd r25, Y+3 ; 0x03 31afc: cd 57 subi r28, 0x7D ; 125 31afe: d0 40 sbci r29, 0x00 ; 0 31b00: 0d 94 ad 84 jmp 0x3095a ; 0x3095a // 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]) : 31b04: f2 01 movw r30, r4 31b06: 25 81 ldd r18, Z+5 ; 0x05 31b08: 36 81 ldd r19, Z+6 ; 0x06 31b0a: 47 81 ldd r20, Z+7 ; 0x07 31b0c: 50 85 ldd r21, Z+8 ; 0x08 31b0e: ed 96 adiw r28, 0x3d ; 61 31b10: 6c ad ldd r22, Y+60 ; 0x3c 31b12: 7d ad ldd r23, Y+61 ; 0x3d 31b14: 8e ad ldd r24, Y+62 ; 0x3e 31b16: 9f ad ldd r25, Y+63 ; 0x3f 31b18: ed 97 sbiw r28, 0x3d ; 61 31b1a: b8 c0 rjmp .+368 ; 0x31c8c (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 31b1c: f2 01 movw r30, r4 31b1e: 25 81 ldd r18, Z+5 ; 0x05 31b20: 36 81 ldd r19, Z+6 ; 0x06 31b22: 47 81 ldd r20, Z+7 ; 0x07 31b24: 50 85 ldd r21, Z+8 ; 0x08 31b26: ed 96 adiw r28, 0x3d ; 61 31b28: 6c ad ldd r22, Y+60 ; 0x3c 31b2a: 7d ad ldd r23, Y+61 ; 0x3d 31b2c: 8e ad ldd r24, Y+62 ; 0x3e 31b2e: 9f ad ldd r25, Y+63 ; 0x3f 31b30: ed 97 sbiw r28, 0x3d ; 61 31b32: c6 c0 rjmp .+396 ; 0x31cc0 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]) : 31b34: a3 01 movw r20, r6 31b36: 92 01 movw r18, r4 31b38: c3 58 subi r28, 0x83 ; 131 31b3a: df 4f sbci r29, 0xFF ; 255 31b3c: 68 81 ld r22, Y 31b3e: 79 81 ldd r23, Y+1 ; 0x01 31b40: 8a 81 ldd r24, Y+2 ; 0x02 31b42: 9b 81 ldd r25, Y+3 ; 0x03 31b44: cd 57 subi r28, 0x7D ; 125 31b46: d0 40 sbci r29, 0x00 ; 0 31b48: 0d 94 15 85 jmp 0x30a2a ; 0x30a2a // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 31b4c: 81 2c mov r8, r1 31b4e: 91 2c mov r9, r1 31b50: 20 e8 ldi r18, 0x80 ; 128 31b52: a2 2e mov r10, r18 31b54: 2f e3 ldi r18, 0x3F ; 63 31b56: b2 2e mov r11, r18 31b58: 0d 94 19 85 jmp 0x30a32 ; 0x30a32 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 31b5c: c1 2c mov r12, r1 31b5e: d1 2c mov r13, r1 31b60: 76 01 movw r14, r12 31b62: 0d 94 90 85 jmp 0x30b20 ; 0x30b20 ((r == 1) ? 1.f : 31b66: c1 2c mov r12, r1 31b68: d1 2c mov r13, r1 31b6a: 90 e8 ldi r25, 0x80 ; 128 31b6c: e9 2e mov r14, r25 31b6e: 9f e3 ldi r25, 0x3F ; 63 31b70: f9 2e mov r15, r25 31b72: 0d 94 90 85 jmp 0x30b20 ; 0x30b20 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; 31b76: 12 e0 ldi r17, 0x02 ; 2 31b78: a7 cb rjmp .-2226 ; 0x312c8 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 31b7a: 1e 3f cpi r17, 0xFE ; 254 31b7c: 89 f4 brne .+34 ; 0x31ba0 31b7e: af 96 adiw r28, 0x2f ; 47 31b80: 3f ad ldd r19, Y+63 ; 0x3f 31b82: af 97 sbiw r28, 0x2f ; 47 31b84: 32 30 cpi r19, 0x02 ; 2 31b86: 09 f0 breq .+2 ; 0x31b8a 31b88: 4d cf rjmp .-358 ; 0x31a24 DBG(_n("Fitting failed => calibration failed.\n")); 31b8a: 8c e7 ldi r24, 0x7C ; 124 31b8c: 9b e6 ldi r25, 0x6B ; 107 31b8e: 9f 93 push r25 31b90: 8f 93 push r24 31b92: 0f 94 5f a2 call 0x344be ; 0x344be 31b96: 44 cf rjmp .-376 ; 0x31a20 // 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; 31b98: af 96 adiw r28, 0x2f ; 47 31b9a: 1f ae std Y+63, r1 ; 0x3f 31b9c: af 97 sbiw r28, 0x2f ; 47 31b9e: 42 cf rjmp .-380 ; 0x31a24 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 31ba0: 1f ef ldi r17, 0xFF ; 255 31ba2: 40 cf rjmp .-384 ; 0x31a24 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) { 31ba4: af 96 adiw r28, 0x2f ; 47 31ba6: 6f ad ldd r22, Y+63 ; 0x3f 31ba8: af 97 sbiw r28, 0x2f ; 47 31baa: 61 11 cpse r22, r1 31bac: 13 c0 rjmp .+38 ; 0x31bd4 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); 31bae: 8b eb ldi r24, 0xBB ; 187 31bb0: 9d e5 ldi r25, 0x5D ; 93 // 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) { 31bb2: 11 30 cpi r17, 0x01 ; 1 31bb4: 51 f0 breq .+20 ; 0x31bca 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); 31bb6: 88 e7 ldi r24, 0x78 ; 120 31bb8: 9d e5 ldi r25, 0x5D ; 93 // 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) { 31bba: 12 30 cpi r17, 0x02 ; 2 31bbc: 31 f0 breq .+12 ; 0x31bca default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 31bbe: 8f e5 ldi r24, 0x5F ; 95 31bc0: 9f e5 ldi r25, 0x5F ; 95 // 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) { 31bc2: 11 11 cpse r17, r1 31bc4: 02 c0 rjmp .+4 ; 0x31bca 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); 31bc6: 80 e0 ldi r24, 0x00 ; 0 31bc8: 9e e5 ldi r25, 0x5E ; 94 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); 31bca: 0e 94 0a 75 call 0xea14 ; 0xea14 break; } lcd_show_fullscreen_message_and_wait_P(msg); 31bce: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 31bd2: 0d c0 rjmp .+26 ; 0x31bee // 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) 31bd4: af 96 adiw r28, 0x2f ; 47 31bd6: 8f ad ldd r24, Y+63 ; 0x3f 31bd8: af 97 sbiw r28, 0x2f ; 47 31bda: 82 30 cpi r24, 0x02 ; 2 31bdc: f1 f4 brne .+60 ; 0x31c1a // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 31bde: 8f e8 ldi r24, 0x8F ; 143 31be0: 9e e5 ldi r25, 0x5E ; 94 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); 31be2: 0e 94 0a 75 call 0xea14 ; 0xea14 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); 31be6: 0e 94 85 e8 call 0x1d10a ; 0x1d10a } if (point_too_far_mask == 0 || result > 0) { 31bea: 11 16 cp r1, r17 31bec: 04 f3 brlt .-64 ; 0x31bae //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 31bee: 1f 3f cpi r17, 0xFF ; 255 31bf0: 11 f4 brne .+4 ; 0x31bf6 31bf2: 0d 94 6e 7d jmp 0x2fadc ; 0x2fadc { // 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); 31bf6: 86 e0 ldi r24, 0x06 ; 6 31bf8: 0e 94 3f d5 call 0x1aa7e ; 0x1aa7e if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 31bfc: 8f e5 ldi r24, 0x5F ; 95 31bfe: 9f e0 ldi r25, 0x0F ; 15 31c00: 0f 94 9d a3 call 0x3473a ; 0x3473a 31c04: 81 11 cpse r24, r1 31c06: 0d 94 e1 81 jmp 0x303c2 ; 0x303c2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 31c0a: 8a ef ldi r24, 0xFA ; 250 31c0c: 9f e5 ldi r25, 0x5F ; 95 31c0e: 0e 94 0a 75 call 0xea14 ; 0xea14 31c12: 0e 94 85 e8 call 0x1d10a ; 0x1d10a 31c16: 0d 94 e1 81 jmp 0x303c2 ; 0x303c2 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); 31c1a: 83 e4 ldi r24, 0x43 ; 67 31c1c: 9e e5 ldi r25, 0x5E ; 94 31c1e: e1 cf rjmp .-62 ; 0x31be2 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)) 31c20: 89 81 ldd r24, Y+1 ; 0x01 31c22: 9a 81 ldd r25, Y+2 ; 0x02 31c24: 80 37 cpi r24, 0x70 ; 112 31c26: 98 40 sbci r25, 0x08 ; 8 31c28: 10 f0 brcs .+4 ; 0x31c2e 31c2a: 0d 94 1a 82 jmp 0x30434 ; 0x30434 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 31c2e: ae 01 movw r20, r28 31c30: 4f 5f subi r20, 0xFF ; 255 31c32: 5f 4f sbci r21, 0xFF ; 255 31c34: 7a 01 movw r14, r20 31c36: 04 eb ldi r16, 0xB4 ; 180 31c38: 10 e0 ldi r17, 0x00 ; 0 31c3a: 24 e8 ldi r18, 0x84 ; 132 31c3c: 33 e0 ldi r19, 0x03 ; 3 31c3e: a6 01 movw r20, r12 31c40: 48 5c subi r20, 0xC8 ; 200 31c42: 51 09 sbc r21, r1 31c44: 69 2d mov r22, r9 31c46: 78 2d mov r23, r8 31c48: 8b 2d mov r24, r11 31c4a: 9a 2d mov r25, r10 31c4c: 0f 94 4d 5f call 0x2be9a ; 0x2be9a 31c50: 88 23 and r24, r24 31c52: 11 f4 brne .+4 ; 0x31c58 31c54: 0d 94 1a 82 jmp 0x30434 ; 0x30434 ad += 1440; 31c58: 89 81 ldd r24, Y+1 ; 0x01 31c5a: 9a 81 ldd r25, Y+2 ; 0x02 31c5c: 80 56 subi r24, 0x60 ; 96 31c5e: 9a 4f sbci r25, 0xFA ; 250 31c60: 0d 94 43 7f jmp 0x2fe86 ; 0x2fe86 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) { 31c64: 00 23 and r16, r16 31c66: 11 f4 brne .+4 ; 0x31c6c 31c68: 0d 94 c0 84 jmp 0x30980 ; 0x30980 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 31c6c: 02 30 cpi r16, 0x02 ; 2 31c6e: 09 f0 breq .+2 ; 0x31c72 31c70: 49 cf rjmp .-366 ; 0x31b04 31c72: d2 01 movw r26, r4 31c74: 11 96 adiw r26, 0x01 ; 1 31c76: 2d 91 ld r18, X+ 31c78: 3d 91 ld r19, X+ 31c7a: 4d 91 ld r20, X+ 31c7c: 5c 91 ld r21, X 31c7e: 14 97 sbiw r26, 0x04 ; 4 31c80: 6e 96 adiw r28, 0x1e ; 30 31c82: 6c ad ldd r22, Y+60 ; 0x3c 31c84: 7d ad ldd r23, Y+61 ; 0x3d 31c86: 8e ad ldd r24, Y+62 ; 0x3e 31c88: 9f ad ldd r25, Y+63 ; 0x3f 31c8a: 6e 97 sbiw r28, 0x1e ; 30 31c8c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31c90: 4b 01 movw r8, r22 31c92: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 31c94: 60 e0 ldi r22, 0x00 ; 0 31c96: 70 e0 ldi r23, 0x00 ; 0 31c98: 80 e8 ldi r24, 0x80 ; 128 31c9a: 9f e3 ldi r25, 0x3F ; 63 31c9c: 11 30 cpi r17, 0x01 ; 1 31c9e: 91 f0 breq .+36 ; 0x31cc4 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 31ca0: 12 30 cpi r17, 0x02 ; 2 31ca2: 09 f0 breq .+2 ; 0x31ca6 31ca4: 3b cf rjmp .-394 ; 0x31b1c 31ca6: d2 01 movw r26, r4 31ca8: 11 96 adiw r26, 0x01 ; 1 31caa: 2d 91 ld r18, X+ 31cac: 3d 91 ld r19, X+ 31cae: 4d 91 ld r20, X+ 31cb0: 5c 91 ld r21, X 31cb2: 14 97 sbiw r26, 0x04 ; 4 31cb4: 6e 96 adiw r28, 0x1e ; 30 31cb6: 6c ad ldd r22, Y+60 ; 0x3c 31cb8: 7d ad ldd r23, Y+61 ; 0x3d 31cba: 8e ad ldd r24, Y+62 ; 0x3e 31cbc: 9f ad ldd r25, Y+63 ; 0x3f 31cbe: 6e 97 sbiw r28, 0x1e ; 30 31cc0: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 31cc4: 9b 01 movw r18, r22 31cc6: ac 01 movw r20, r24 31cc8: c5 01 movw r24, r10 31cca: b4 01 movw r22, r8 31ccc: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31cd0: 9b 01 movw r18, r22 31cd2: ac 01 movw r20, r24 31cd4: c7 01 movw r24, r14 31cd6: b6 01 movw r22, r12 31cd8: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 31cdc: 6b 01 movw r12, r22 31cde: 7c 01 movw r14, r24 31ce0: 0d 94 c0 84 jmp 0x30980 ; 0x30980 // 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 : 31ce4: 81 2c mov r8, r1 31ce6: 91 2c mov r9, r1 31ce8: 50 e8 ldi r21, 0x80 ; 128 31cea: a5 2e mov r10, r21 31cec: 5f e3 ldi r21, 0x3F ; 63 31cee: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 31cf0: 11 11 cpse r17, r1 31cf2: 0d 94 9a 84 jmp 0x30934 ; 0x30934 ((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; 31cf6: 20 e0 ldi r18, 0x00 ; 0 31cf8: 30 e0 ldi r19, 0x00 ; 0 31cfa: 40 e8 ldi r20, 0x80 ; 128 31cfc: 5f e3 ldi r21, 0x3F ; 63 31cfe: ea cf rjmp .-44 ; 0x31cd4 // 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 : 31d00: 81 2c mov r8, r1 31d02: 91 2c mov r9, r1 31d04: 40 e8 ldi r20, 0x80 ; 128 31d06: a4 2e mov r10, r20 31d08: 4f e3 ldi r20, 0x3F ; 63 31d0a: 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) { 31d0c: 11 11 cpse r17, r1 31d0e: c2 cf rjmp .-124 ; 0x31c94 31d10: 0d 94 c0 84 jmp 0x30980 ; 0x30980 31d14: 11 11 cpse r17, r1 31d16: aa cf rjmp .-172 ; 0x31c6c 31d18: 0d 94 c0 84 jmp 0x30980 ; 0x30980 00031d1c : 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, 31d1c: 1f 93 push r17 31d1e: cf 93 push r28 31d20: df 93 push r29 31d22: c8 2f mov r28, r24 31d24: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 31d26: 0e 94 f6 6f call 0xdfec ; 0xdfec lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 31d2a: 8d e6 ldi r24, 0x6D ; 109 31d2c: 9d e5 ldi r25, 0x5D ; 93 31d2e: 0e 94 0a 75 call 0xea14 ; 0xea14 31d32: ac 01 movw r20, r24 31d34: 60 e0 ldi r22, 0x00 ; 0 31d36: 80 e0 ldi r24, 0x00 ; 0 31d38: 0e 94 d7 6f call 0xdfae ; 0xdfae 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)); 31d3c: 87 e4 ldi r24, 0x47 ; 71 31d3e: 9d e5 ldi r25, 0x5D ; 93 31d40: c1 11 cpse r28, r1 31d42: 02 c0 rjmp .+4 ; 0x31d48 31d44: 8a e5 ldi r24, 0x5A ; 90 31d46: 9d e5 ldi r25, 0x5D ; 93 31d48: 0e 94 0a 75 call 0xea14 ; 0xea14 31d4c: ac 01 movw r20, r24 31d4e: 61 e0 ldi r22, 0x01 ; 1 31d50: 80 e0 ldi r24, 0x00 ; 0 31d52: 0e 94 d7 6f call 0xdfae ; 0xdfae } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 31d56: 8f ef ldi r24, 0xFF ; 255 31d58: 80 93 55 12 sts 0x1255, r24 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 31d5c: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #endif manage_heater(); 31d60: 0f 94 a5 37 call 0x26f4a ; 0x26f4a // object cooling fan lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_HOTEND_FAN) : _T(MSG_SELFTEST_PART_FAN)); lcd_selftest_setfan(255); break; } _delay(500); 31d64: 64 ef ldi r22, 0xF4 ; 244 31d66: 71 e0 ldi r23, 0x01 ; 1 31d68: 80 e0 ldi r24, 0x00 ; 0 31d6a: 90 e0 ldi r25, 0x00 ; 0 31d6c: 0f 94 23 0b call 0x21646 ; 0x21646 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 31d70: 8c e3 ldi r24, 0x3C ; 60 31d72: 9d e5 ldi r25, 0x5D ; 93 31d74: 0e 94 0a 75 call 0xea14 ; 0xea14 31d78: ac 01 movw r20, r24 31d7a: 62 e0 ldi r22, 0x02 ; 2 31d7c: 81 e0 ldi r24, 0x01 ; 1 31d7e: 0e 94 d7 6f call 0xdfae ; 0xdfae lcd_putc_at(0, 3, '>'); 31d82: 4e e3 ldi r20, 0x3E ; 62 31d84: 63 e0 ldi r22, 0x03 ; 3 31d86: 80 e0 ldi r24, 0x00 ; 0 31d88: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 31d8c: 8d e2 ldi r24, 0x2D ; 45 31d8e: 9d e5 ldi r25, 0x5D ; 93 31d90: 0e 94 0a 75 call 0xea14 ; 0xea14 31d94: 0e 94 ed 6e call 0xddda ; 0xddda lcd_encoder = _default; 31d98: 6d 2f mov r22, r29 31d9a: 70 e0 ldi r23, 0x00 ; 0 31d9c: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f 31da0: 60 93 1e 06 sts 0x061E, r22 ; 0x80061e KEEPALIVE_STATE(PAUSED_FOR_USER); 31da4: 84 e0 ldi r24, 0x04 ; 4 31da6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 31daa: 0e 94 40 73 call 0xe680 ; 0xe680 31dae: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 31db0: 11 e0 ldi r17, 0x01 ; 1 31db2: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 31db4: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 31db8: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 31dbc: 00 97 sbiw r24, 0x00 ; 0 31dbe: 19 f1 breq .+70 ; 0x31e06 if (lcd_encoder < 0) { 31dc0: 97 ff sbrs r25, 7 31dc2: 0b c0 rjmp .+22 ; 0x31dda _result = !check_opposite; 31dc4: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 31dc6: 4e e3 ldi r20, 0x3E ; 62 31dc8: 62 e0 ldi r22, 0x02 ; 2 31dca: 80 e0 ldi r24, 0x00 ; 0 31dcc: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_putc_at(0, 3, ' '); 31dd0: 40 e2 ldi r20, 0x20 ; 32 31dd2: 63 e0 ldi r22, 0x03 ; 3 31dd4: 80 e0 ldi r24, 0x00 ; 0 31dd6: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 } if (lcd_encoder > 0) { 31dda: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 31dde: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 31de2: 18 16 cp r1, r24 31de4: 19 06 cpc r1, r25 31de6: 5c f4 brge .+22 ; 0x31dfe _result = check_opposite; lcd_putc_at(0, 2, ' '); 31de8: 40 e2 ldi r20, 0x20 ; 32 31dea: 62 e0 ldi r22, 0x02 ; 2 31dec: 80 e0 ldi r24, 0x00 ; 0 31dee: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 lcd_putc_at(0, 3, '>'); 31df2: 4e e3 ldi r20, 0x3E ; 62 31df4: 63 e0 ldi r22, 0x03 ; 3 31df6: 80 e0 ldi r24, 0x00 ; 0 31df8: 0e 94 e3 6f call 0xdfc6 ; 0xdfc6 31dfc: dc 2f mov r29, r28 } lcd_encoder = 0; 31dfe: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 31e02: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } manage_heater(); 31e06: 0f 94 a5 37 call 0x26f4a ; 0x26f4a manage_inactivity(true); 31e0a: 81 e0 ldi r24, 0x01 ; 1 31e0c: 0e 94 25 8a call 0x1144a ; 0x1144a _delay(100); 31e10: 64 e6 ldi r22, 0x64 ; 100 31e12: 70 e0 ldi r23, 0x00 ; 0 31e14: 80 e0 ldi r24, 0x00 ; 0 31e16: 90 e0 ldi r25, 0x00 ; 0 31e18: 0f 94 23 0b call 0x21646 ; 0x21646 } while (!lcd_clicked()); 31e1c: 0e 94 45 73 call 0xe68a ; 0xe68a 31e20: 88 23 and r24, r24 31e22: 41 f2 breq .-112 ; 0x31db4 KEEPALIVE_STATE(IN_HANDLER); 31e24: 82 e0 ldi r24, 0x02 ; 2 31e26: 80 93 78 02 sts 0x0278, r24 ; 0x800278 setExtruderAutoFanState(0); // Turn off hotend fan 31e2a: 80 e0 ldi r24, 0x00 ; 0 31e2c: 0e 94 7f 77 call 0xeefe ; 0xeefe } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 31e30: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 31e34: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 31e38: 0f 94 a5 37 call 0x26f4a ; 0x26f4a KEEPALIVE_STATE(IN_HANDLER); setExtruderAutoFanState(0); // Turn off hotend fan lcd_selftest_setfan(0); // Turn off print fan return _result; } 31e3c: 8d 2f mov r24, r29 31e3e: df 91 pop r29 31e40: cf 91 pop r28 31e42: 1f 91 pop r17 31e44: 08 95 ret 00031e46 : #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) { 31e46: 4f 92 push r4 31e48: 5f 92 push r5 31e4a: 6f 92 push r6 31e4c: 7f 92 push r7 31e4e: af 92 push r10 31e50: bf 92 push r11 31e52: cf 92 push r12 31e54: df 92 push r13 31e56: ef 92 push r14 31e58: ff 92 push r15 31e5a: 0f 93 push r16 31e5c: 1f 93 push r17 31e5e: cf 93 push r28 31e60: df 93 push r29 31e62: 24 e0 ldi r18, 0x04 ; 4 31e64: 30 e0 ldi r19, 0x00 ; 0 31e66: 41 e0 ldi r20, 0x01 ; 1 31e68: 50 e0 ldi r21, 0x00 ; 0 31e6a: d9 01 movw r26, r18 31e6c: ac 50 subi r26, 0x0C ; 12 31e6e: b6 46 sbci r27, 0x66 ; 102 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 31e70: fd 01 movw r30, r26 31e72: 65 91 lpm r22, Z+ 31e74: 74 91 lpm r23, Z 31e76: 86 17 cp r24, r22 31e78: 97 07 cpc r25, r23 31e7a: 0c f0 brlt .+2 ; 0x31e7e 31e7c: 66 c0 rjmp .+204 ; 0x31f4a { celsius = PGM_RD_W((*tt)[i-1][1]) + 31e7e: 41 50 subi r20, 0x01 ; 1 31e80: 51 09 sbc r21, r1 31e82: 44 0f add r20, r20 31e84: 55 1f adc r21, r21 31e86: 44 0f add r20, r20 31e88: 55 1f adc r21, r21 31e8a: ea 01 movw r28, r20 31e8c: ca 50 subi r28, 0x0A ; 10 31e8e: d6 46 sbci r29, 0x66 ; 102 31e90: fe 01 movw r30, r28 31e92: 05 91 lpm r16, Z+ 31e94: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 31e96: 4c 50 subi r20, 0x0C ; 12 31e98: 56 46 sbci r21, 0x66 ; 102 31e9a: fa 01 movw r30, r20 31e9c: 65 91 lpm r22, Z+ 31e9e: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 31ea0: f9 01 movw r30, r18 31ea2: ea 50 subi r30, 0x0A ; 10 31ea4: f6 46 sbci r31, 0x66 ; 102 31ea6: e5 90 lpm r14, Z+ 31ea8: f4 90 lpm r15, Z 31eaa: fe 01 movw r30, r28 31eac: c5 90 lpm r12, Z+ 31eae: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 31eb0: fd 01 movw r30, r26 31eb2: c5 91 lpm r28, Z+ 31eb4: d4 91 lpm r29, Z 31eb6: fa 01 movw r30, r20 31eb8: a5 90 lpm r10, Z+ 31eba: 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])) * 31ebc: 86 1b sub r24, r22 31ebe: 97 0b sbc r25, r23 31ec0: bc 01 movw r22, r24 31ec2: 99 0f add r25, r25 31ec4: 88 0b sbc r24, r24 31ec6: 99 0b sbc r25, r25 31ec8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 31ecc: 2b 01 movw r4, r22 31ece: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 31ed0: b7 01 movw r22, r14 31ed2: 6c 19 sub r22, r12 31ed4: 7d 09 sbc r23, r13 31ed6: 07 2e mov r0, r23 31ed8: 00 0c add r0, r0 31eda: 88 0b sbc r24, r24 31edc: 99 0b sbc r25, r25 31ede: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 31ee2: 9b 01 movw r18, r22 31ee4: 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])) * 31ee6: c3 01 movw r24, r6 31ee8: b2 01 movw r22, r4 31eea: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 31eee: 6b 01 movw r12, r22 31ef0: 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])); 31ef2: be 01 movw r22, r28 31ef4: 6a 19 sub r22, r10 31ef6: 7b 09 sbc r23, r11 31ef8: 07 2e mov r0, r23 31efa: 00 0c add r0, r0 31efc: 88 0b sbc r24, r24 31efe: 99 0b sbc r25, r25 31f00: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 31f04: 9b 01 movw r18, r22 31f06: 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])) / 31f08: c7 01 movw r24, r14 31f0a: b6 01 movw r22, r12 31f0c: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 31f10: 6b 01 movw r12, r22 31f12: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 31f14: b8 01 movw r22, r16 31f16: 11 0f add r17, r17 31f18: 88 0b sbc r24, r24 31f1a: 99 0b sbc r25, r25 31f1c: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 31f20: 9b 01 movw r18, r22 31f22: ac 01 movw r20, r24 31f24: c7 01 movw r24, r14 31f26: b6 01 movw r22, r12 31f28: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__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; } 31f2c: df 91 pop r29 31f2e: cf 91 pop r28 31f30: 1f 91 pop r17 31f32: 0f 91 pop r16 31f34: ff 90 pop r15 31f36: ef 90 pop r14 31f38: df 90 pop r13 31f3a: cf 90 pop r12 31f3c: bf 90 pop r11 31f3e: af 90 pop r10 31f40: 7f 90 pop r7 31f42: 6f 90 pop r6 31f44: 5f 90 pop r5 31f46: 4f 90 pop r4 31f48: 08 95 ret 31f4a: 4f 5f subi r20, 0xFF ; 255 31f4c: 5f 4f sbci r21, 0xFF ; 255 31f4e: 2c 5f subi r18, 0xFC ; 252 31f50: 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 31f58: 88 cf rjmp .-240 ; 0x31e6a break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 31f5a: e2 e7 ldi r30, 0x72 ; 114 31f5c: fa e9 ldi r31, 0x9A ; 154 31f5e: 65 91 lpm r22, Z+ 31f60: 74 91 lpm r23, Z 31f62: 07 2e mov r0, r23 31f64: 00 0c add r0, r0 31f66: 88 0b sbc r24, r24 31f68: 99 0b sbc r25, r25 31f6a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 31f6e: de cf rjmp .-68 ; 0x31f2c 00031f70 : useU2X = false; } #endif // set up the first (original serial port) if (useU2X) { M_UCSRxA = 1 << M_U2Xx; 31f70: 22 e0 ldi r18, 0x02 ; 2 31f72: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> M_UCSRxA = 0; baud_setting = (F_CPU / 8 / baud - 1) / 2; } // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) M_UBRRxH = baud_setting >> 8; 31f76: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> M_UBRRxL = baud_setting; 31f7a: 90 e1 ldi r25, 0x10 ; 16 31f7c: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> sbi(M_UCSRxB, M_RXENx); 31f80: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 31f84: 80 61 ori r24, 0x10 ; 16 31f86: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_TXENx); 31f8a: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 31f8e: 88 60 ori r24, 0x08 ; 8 31f90: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_RXCIEx); 31f94: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 31f98: 80 68 ori r24, 0x80 ; 128 31f9a: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> if (selectedSerialPort == 1) { //set up also the second serial port 31f9e: 80 91 1c 06 lds r24, 0x061C ; 0x80061c 31fa2: 81 30 cpi r24, 0x01 ; 1 31fa4: a9 f4 brne .+42 ; 0x31fd0 if (useU2X) { UCSR1A = 1 << U2X1; 31fa6: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> UCSR1A = 0; baud_setting = (F_CPU / 8 / baud - 1) / 2; } // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) UBRR1H = baud_setting >> 8; 31faa: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> UBRR1L = baud_setting; 31fae: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> sbi(UCSR1B, RXEN1); 31fb2: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 31fb6: 80 61 ori r24, 0x10 ; 16 31fb8: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, TXEN1); 31fbc: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 31fc0: 88 60 ori r24, 0x08 ; 8 31fc2: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, RXCIE1); 31fc6: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 31fca: 80 68 ori r24, 0x80 ; 128 31fcc: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> } } 31fd0: 08 95 ret 00031fd2 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 31fd2: 8f 92 push r8 31fd4: 9f 92 push r9 31fd6: af 92 push r10 31fd8: bf 92 push r11 31fda: cf 92 push r12 31fdc: df 92 push r13 31fde: ef 92 push r14 31fe0: ff 92 push r15 31fe2: 90 91 1b 06 lds r25, 0x061B ; 0x80061b // 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]) { 31fe6: 88 23 and r24, r24 31fe8: 09 f4 brne .+2 ; 0x31fec 31fea: 9d c0 rjmp .+314 ; 0x32126 31fec: 91 11 cpse r25, r1 31fee: 92 c0 rjmp .+292 ; 0x32114 st_synchronize(); 31ff0: 0f 94 b0 18 call 0x23160 ; 0x23160 set_destination_to_current(); 31ff4: 0e 94 7e 66 call 0xccfc ; 0xccfc current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 31ff8: 60 91 75 02 lds r22, 0x0275 ; 0x800275 31ffc: 70 91 76 02 lds r23, 0x0276 ; 0x800276 32000: 07 2e mov r0, r23 32002: 00 0c add r0, r0 32004: 88 0b sbc r24, r24 32006: 99 0b sbc r25, r25 32008: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 3200c: 20 91 ea 0d lds r18, 0x0DEA ; 0x800dea 32010: 30 91 eb 0d lds r19, 0x0DEB ; 0x800deb 32014: 40 91 ec 0d lds r20, 0x0DEC ; 0x800dec 32018: 50 91 ed 0d lds r21, 0x0DED ; 0x800ded 3201c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32020: 2a e0 ldi r18, 0x0A ; 10 32022: 37 ed ldi r19, 0xD7 ; 215 32024: 43 e2 ldi r20, 0x23 ; 35 32026: 5c e3 ldi r21, 0x3C ; 60 32028: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3202c: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 32030: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 32034: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 32038: 50 91 70 12 lds r21, 0x1270 ; 0x801270 3203c: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 32040: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 32044: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 32048: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 3204c: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); 32050: 8d e6 ldi r24, 0x6D ; 109 32052: 92 e1 ldi r25, 0x12 ; 18 32054: 0f 94 62 3a call 0x274c4 ; 0x274c4 float oldFeedrate = feedrate; 32058: c0 90 7a 02 lds r12, 0x027A ; 0x80027a 3205c: d0 90 7b 02 lds r13, 0x027B ; 0x80027b 32060: e0 90 7c 02 lds r14, 0x027C ; 0x80027c 32064: f0 90 7d 02 lds r15, 0x027D ; 0x80027d feedrate=cs.retract_feedrate*60; 32068: 20 e0 ldi r18, 0x00 ; 0 3206a: 30 e0 ldi r19, 0x00 ; 0 3206c: 40 e7 ldi r20, 0x70 ; 112 3206e: 52 e4 ldi r21, 0x42 ; 66 32070: 60 91 ee 0d lds r22, 0x0DEE ; 0x800dee 32074: 70 91 ef 0d lds r23, 0x0DEF ; 0x800def 32078: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 3207c: 90 91 f1 0d lds r25, 0x0DF1 ; 0x800df1 32080: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32084: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 32088: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 3208c: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 32090: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d retracted[active_extruder]=true; 32094: 81 e0 ldi r24, 0x01 ; 1 32096: 80 93 1b 06 sts 0x061B, r24 ; 0x80061b prepare_move(); 3209a: 90 e0 ldi r25, 0x00 ; 0 3209c: 80 e0 ldi r24, 0x00 ; 0 3209e: 0e 94 8b 6a call 0xd516 ; 0xd516 if(cs.retract_zlift) { 320a2: 20 e0 ldi r18, 0x00 ; 0 320a4: 30 e0 ldi r19, 0x00 ; 0 320a6: a9 01 movw r20, r18 320a8: 60 91 f2 0d lds r22, 0x0DF2 ; 0x800df2 320ac: 70 91 f3 0d lds r23, 0x0DF3 ; 0x800df3 320b0: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 320b4: 90 91 f5 0d lds r25, 0x0DF5 ; 0x800df5 320b8: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 320bc: 88 23 and r24, r24 320be: 11 f1 breq .+68 ; 0x32104 st_synchronize(); 320c0: 0f 94 b0 18 call 0x23160 ; 0x23160 current_position[Z_AXIS]-=cs.retract_zlift; 320c4: 20 91 f2 0d lds r18, 0x0DF2 ; 0x800df2 320c8: 30 91 f3 0d lds r19, 0x0DF3 ; 0x800df3 320cc: 40 91 f4 0d lds r20, 0x0DF4 ; 0x800df4 320d0: 50 91 f5 0d lds r21, 0x0DF5 ; 0x800df5 320d4: 60 91 69 12 lds r22, 0x1269 ; 0x801269 320d8: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 320dc: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 320e0: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 320e4: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 320e8: 60 93 69 12 sts 0x1269, r22 ; 0x801269 320ec: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 320f0: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 320f4: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_position_curposXYZE(); 320f8: 0f 94 ca 48 call 0x29194 ; 0x29194 prepare_move(); 320fc: 90 e0 ldi r25, 0x00 ; 0 320fe: 80 e0 ldi r24, 0x00 ; 0 32100: 0e 94 8b 6a call 0xd516 ; 0xd516 } feedrate = oldFeedrate; 32104: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a 32108: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b 3210c: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c 32110: f0 92 7d 02 sts 0x027D, r15 ; 0x80027d plan_set_e_position(current_position[E_AXIS]); retracted[active_extruder]=false; prepare_move(); feedrate = oldFeedrate; } } //retract 32114: ff 90 pop r15 32116: ef 90 pop r14 32118: df 90 pop r13 3211a: cf 90 pop r12 3211c: bf 90 pop r11 3211e: af 90 pop r10 32120: 9f 90 pop r9 32122: 8f 90 pop r8 32124: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 32126: 99 23 and r25, r25 32128: a9 f3 breq .-22 ; 0x32114 st_synchronize(); 3212a: 0f 94 b0 18 call 0x23160 ; 0x23160 set_destination_to_current(); 3212e: 0e 94 7e 66 call 0xccfc ; 0xccfc float oldFeedrate = feedrate; 32132: 80 90 7a 02 lds r8, 0x027A ; 0x80027a 32136: 90 90 7b 02 lds r9, 0x027B ; 0x80027b 3213a: a0 90 7c 02 lds r10, 0x027C ; 0x80027c 3213e: b0 90 7d 02 lds r11, 0x027D ; 0x80027d feedrate=cs.retract_recover_feedrate*60; 32142: 20 e0 ldi r18, 0x00 ; 0 32144: 30 e0 ldi r19, 0x00 ; 0 32146: 40 e7 ldi r20, 0x70 ; 112 32148: 52 e4 ldi r21, 0x42 ; 66 3214a: 60 91 fa 0d lds r22, 0x0DFA ; 0x800dfa 3214e: 70 91 fb 0d lds r23, 0x0DFB ; 0x800dfb 32152: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 32156: 90 91 fd 0d lds r25, 0x0DFD ; 0x800dfd 3215a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3215e: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 32162: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 32166: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 3216a: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d if(cs.retract_zlift) { 3216e: c0 90 f2 0d lds r12, 0x0DF2 ; 0x800df2 32172: d0 90 f3 0d lds r13, 0x0DF3 ; 0x800df3 32176: e0 90 f4 0d lds r14, 0x0DF4 ; 0x800df4 3217a: f0 90 f5 0d lds r15, 0x0DF5 ; 0x800df5 3217e: 20 e0 ldi r18, 0x00 ; 0 32180: 30 e0 ldi r19, 0x00 ; 0 32182: a9 01 movw r20, r18 32184: c7 01 movw r24, r14 32186: b6 01 movw r22, r12 32188: 0f 94 ba a5 call 0x34b74 ; 0x34b74 <__cmpsf2> 3218c: 88 23 and r24, r24 3218e: e1 f0 breq .+56 ; 0x321c8 current_position[Z_AXIS]+=cs.retract_zlift; 32190: a7 01 movw r20, r14 32192: 96 01 movw r18, r12 32194: 60 91 69 12 lds r22, 0x1269 ; 0x801269 32198: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 3219c: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 321a0: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 321a4: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 321a8: 60 93 69 12 sts 0x1269, r22 ; 0x801269 321ac: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 321b0: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 321b4: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_position_curposXYZE(); 321b8: 0f 94 ca 48 call 0x29194 ; 0x29194 prepare_move(); 321bc: 90 e0 ldi r25, 0x00 ; 0 321be: 80 e0 ldi r24, 0x00 ; 0 321c0: 0e 94 8b 6a call 0xd516 ; 0xd516 st_synchronize(); 321c4: 0f 94 b0 18 call 0x23160 ; 0x23160 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 321c8: 20 91 f6 0d lds r18, 0x0DF6 ; 0x800df6 321cc: 30 91 f7 0d lds r19, 0x0DF7 ; 0x800df7 321d0: 40 91 f8 0d lds r20, 0x0DF8 ; 0x800df8 321d4: 50 91 f9 0d lds r21, 0x0DF9 ; 0x800df9 321d8: 60 91 ea 0d lds r22, 0x0DEA ; 0x800dea 321dc: 70 91 eb 0d lds r23, 0x0DEB ; 0x800deb 321e0: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 321e4: 90 91 ed 0d lds r25, 0x0DED ; 0x800ded 321e8: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 321ec: 6b 01 movw r12, r22 321ee: 7c 01 movw r14, r24 321f0: 60 91 75 02 lds r22, 0x0275 ; 0x800275 321f4: 70 91 76 02 lds r23, 0x0276 ; 0x800276 321f8: 07 2e mov r0, r23 321fa: 00 0c add r0, r0 321fc: 88 0b sbc r24, r24 321fe: 99 0b sbc r25, r25 32200: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 32204: 9b 01 movw r18, r22 32206: ac 01 movw r20, r24 32208: c7 01 movw r24, r14 3220a: b6 01 movw r22, r12 3220c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32210: 2a e0 ldi r18, 0x0A ; 10 32212: 37 ed ldi r19, 0xD7 ; 215 32214: 43 e2 ldi r20, 0x23 ; 35 32216: 5c e3 ldi r21, 0x3C ; 60 32218: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3221c: 9b 01 movw r18, r22 3221e: ac 01 movw r20, r24 32220: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 32224: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 32228: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 3222c: 90 91 70 12 lds r25, 0x1270 ; 0x801270 32230: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 32234: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 32238: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 3223c: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 32240: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); 32244: 8d e6 ldi r24, 0x6D ; 109 32246: 92 e1 ldi r25, 0x12 ; 18 32248: 0f 94 62 3a call 0x274c4 ; 0x274c4 retracted[active_extruder]=false; 3224c: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b prepare_move(); 32250: 90 e0 ldi r25, 0x00 ; 0 32252: 80 e0 ldi r24, 0x00 ; 0 32254: 0e 94 8b 6a call 0xd516 ; 0xd516 feedrate = oldFeedrate; 32258: 80 92 7a 02 sts 0x027A, r8 ; 0x80027a 3225c: 90 92 7b 02 sts 0x027B, r9 ; 0x80027b 32260: a0 92 7c 02 sts 0x027C, r10 ; 0x80027c 32264: b0 92 7d 02 sts 0x027D, r11 ; 0x80027d 32268: 55 cf rjmp .-342 ; 0x32114 0003226a : float mesh_bed_leveling::get_z(float x, float y) { 3226a: 2f 92 push r2 3226c: 3f 92 push r3 3226e: 4f 92 push r4 32270: 5f 92 push r5 32272: 6f 92 push r6 32274: 7f 92 push r7 32276: 8f 92 push r8 32278: 9f 92 push r9 3227a: af 92 push r10 3227c: bf 92 push r11 3227e: cf 92 push r12 32280: df 92 push r13 32282: ef 92 push r14 32284: ff 92 push r15 32286: 0f 93 push r16 32288: 1f 93 push r17 3228a: cf 93 push r28 3228c: df 93 push r29 3228e: 00 d0 rcall .+0 ; 0x32290 32290: 00 d0 rcall .+0 ; 0x32292 32292: 00 d0 rcall .+0 ; 0x32294 32294: 1f 92 push r1 32296: cd b7 in r28, 0x3d ; 61 32298: de b7 in r29, 0x3e ; 62 3229a: 2b 01 movw r4, r22 3229c: 3c 01 movw r6, r24 3229e: 49 01 movw r8, r18 322a0: 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)); 322a2: 20 e0 ldi r18, 0x00 ; 0 322a4: 30 e0 ldi r19, 0x00 ; 0 322a6: 40 ec ldi r20, 0xC0 ; 192 322a8: 51 e4 ldi r21, 0x41 ; 65 322aa: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 322ae: 20 e0 ldi r18, 0x00 ; 0 322b0: 30 e0 ldi r19, 0x00 ; 0 322b2: 48 e0 ldi r20, 0x08 ; 8 322b4: 52 e4 ldi r21, 0x42 ; 66 322b6: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 322ba: 6b 01 movw r12, r22 322bc: 7c 01 movw r14, r24 322be: 0f 94 6c a6 call 0x34cd8 ; 0x34cd8 322c2: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> if (i < 0) { i = 0; 322c6: 31 2c mov r3, r1 322c8: 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) { 322ca: 77 fd sbrc r23, 7 322cc: 1e c0 rjmp .+60 ; 0x3230a 322ce: 1b 01 movw r2, r22 322d0: 66 30 cpi r22, 0x06 ; 6 322d2: 71 05 cpc r23, r1 322d4: 1c f0 brlt .+6 ; 0x322dc 322d6: 45 e0 ldi r20, 0x05 ; 5 322d8: 24 2e mov r2, r20 322da: 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; } 322dc: 82 2d mov r24, r2 322de: 0e 94 b0 5e call 0xbd60 ; 0xbd60 322e2: 20 e0 ldi r18, 0x00 ; 0 322e4: 30 e0 ldi r19, 0x00 ; 0 322e6: 48 eb ldi r20, 0xB8 ; 184 322e8: 51 e4 ldi r21, 0x41 ; 65 322ea: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 322ee: 9b 01 movw r18, r22 322f0: 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; 322f2: c3 01 movw r24, r6 322f4: b2 01 movw r22, r4 322f6: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 322fa: 20 e0 ldi r18, 0x00 ; 0 322fc: 30 e0 ldi r19, 0x00 ; 0 322fe: 48 e0 ldi r20, 0x08 ; 8 32300: 52 e4 ldi r21, 0x42 ; 66 32302: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 32306: 6b 01 movw r12, r22 32308: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 3230a: 20 e0 ldi r18, 0x00 ; 0 3230c: 30 e0 ldi r19, 0x00 ; 0 3230e: 40 ec ldi r20, 0xC0 ; 192 32310: 50 e4 ldi r21, 0x40 ; 64 32312: c5 01 movw r24, r10 32314: b4 01 movw r22, r8 32316: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3231a: 20 e0 ldi r18, 0x00 ; 0 3231c: 30 e0 ldi r19, 0x00 ; 0 3231e: 48 e0 ldi r20, 0x08 ; 8 32320: 52 e4 ldi r21, 0x42 ; 66 32322: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 32326: 69 83 std Y+1, r22 ; 0x01 32328: 7a 83 std Y+2, r23 ; 0x02 3232a: 8b 83 std Y+3, r24 ; 0x03 3232c: 9c 83 std Y+4, r25 ; 0x04 3232e: 0f 94 6c a6 call 0x34cd8 ; 0x34cd8 32332: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> if (j < 0) { 32336: 77 fd sbrc r23, 7 32338: da c0 rjmp .+436 ; 0x324ee 3233a: 7a 87 std Y+10, r23 ; 0x0a 3233c: 69 87 std Y+9, r22 ; 0x09 3233e: 66 30 cpi r22, 0x06 ; 6 32340: 71 05 cpc r23, r1 32342: 24 f0 brlt .+8 ; 0x3234c 32344: e5 e0 ldi r30, 0x05 ; 5 32346: f0 e0 ldi r31, 0x00 ; 0 32348: fa 87 std Y+10, r31 ; 0x0a 3234a: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 3234c: 89 85 ldd r24, Y+9 ; 0x09 3234e: 0e 94 b0 5e call 0xbd60 ; 0xbd60 32352: 20 e0 ldi r18, 0x00 ; 0 32354: 30 e0 ldi r19, 0x00 ; 0 32356: 40 ea ldi r20, 0xA0 ; 160 32358: 50 e4 ldi r21, 0x40 ; 64 3235a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 3235e: 9b 01 movw r18, r22 32360: 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; 32362: c5 01 movw r24, r10 32364: b4 01 movw r22, r8 32366: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3236a: 20 e0 ldi r18, 0x00 ; 0 3236c: 30 e0 ldi r19, 0x00 ; 0 3236e: 48 e0 ldi r20, 0x08 ; 8 32370: 52 e4 ldi r21, 0x42 ; 66 32372: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 32376: 69 83 std Y+1, r22 ; 0x01 32378: 7a 83 std Y+2, r23 ; 0x02 3237a: 8b 83 std Y+3, r24 ; 0x03 3237c: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 3237e: a7 01 movw r20, r14 32380: 96 01 movw r18, r12 32382: 60 e0 ldi r22, 0x00 ; 0 32384: 70 e0 ldi r23, 0x00 ; 0 32386: 80 e8 ldi r24, 0x80 ; 128 32388: 9f e3 ldi r25, 0x3F ; 63 3238a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3238e: 2b 01 movw r4, r22 32390: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 32392: 91 01 movw r18, r2 32394: 2f 5f subi r18, 0xFF ; 255 32396: 3f 4f sbci r19, 0xFF ; 255 32398: 3e 83 std Y+6, r19 ; 0x06 3239a: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 3239c: 89 85 ldd r24, Y+9 ; 0x09 3239e: 9a 85 ldd r25, Y+10 ; 0x0a 323a0: 01 96 adiw r24, 0x01 ; 1 323a2: 98 87 std Y+8, r25 ; 0x08 323a4: 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]; 323a6: 27 e0 ldi r18, 0x07 ; 7 323a8: e9 85 ldd r30, Y+9 ; 0x09 323aa: fa 85 ldd r31, Y+10 ; 0x0a 323ac: 2e 9f mul r18, r30 323ae: 80 01 movw r16, r0 323b0: 2f 9f mul r18, r31 323b2: 10 0d add r17, r0 323b4: 11 24 eor r1, r1 323b6: f8 01 movw r30, r16 323b8: e2 0d add r30, r2 323ba: f3 1d adc r31, r3 323bc: ee 0f add r30, r30 323be: ff 1f adc r31, r31 323c0: ee 0f add r30, r30 323c2: ff 1f adc r31, r31 323c4: e7 5f subi r30, 0xF7 ; 247 323c6: fc 4e sbci r31, 0xEC ; 236 323c8: 21 81 ldd r18, Z+1 ; 0x01 323ca: 32 81 ldd r19, Z+2 ; 0x02 323cc: 43 81 ldd r20, Z+3 ; 0x03 323ce: 54 81 ldd r21, Z+4 ; 0x04 323d0: c3 01 movw r24, r6 323d2: b2 01 movw r22, r4 323d4: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 323d8: 4b 01 movw r8, r22 323da: 5c 01 movw r10, r24 323dc: ed 81 ldd r30, Y+5 ; 0x05 323de: fe 81 ldd r31, Y+6 ; 0x06 323e0: e0 0f add r30, r16 323e2: f1 1f adc r31, r17 323e4: ee 0f add r30, r30 323e6: ff 1f adc r31, r31 323e8: ee 0f add r30, r30 323ea: ff 1f adc r31, r31 323ec: e7 5f subi r30, 0xF7 ; 247 323ee: fc 4e sbci r31, 0xEC ; 236 323f0: 21 81 ldd r18, Z+1 ; 0x01 323f2: 32 81 ldd r19, Z+2 ; 0x02 323f4: 43 81 ldd r20, Z+3 ; 0x03 323f6: 54 81 ldd r21, Z+4 ; 0x04 323f8: c7 01 movw r24, r14 323fa: b6 01 movw r22, r12 323fc: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32400: 9b 01 movw r18, r22 32402: ac 01 movw r20, r24 32404: c5 01 movw r24, r10 32406: b4 01 movw r22, r8 32408: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 3240c: 4b 01 movw r8, r22 3240e: 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; 32410: 29 81 ldd r18, Y+1 ; 0x01 32412: 3a 81 ldd r19, Y+2 ; 0x02 32414: 4b 81 ldd r20, Y+3 ; 0x03 32416: 5c 81 ldd r21, Y+4 ; 0x04 32418: 60 e0 ldi r22, 0x00 ; 0 3241a: 70 e0 ldi r23, 0x00 ; 0 3241c: 80 e8 ldi r24, 0x80 ; 128 3241e: 9f e3 ldi r25, 0x3F ; 63 32420: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 32424: 9b 01 movw r18, r22 32426: ac 01 movw r20, r24 32428: c5 01 movw r24, r10 3242a: b4 01 movw r22, r8 3242c: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32430: 4b 01 movw r8, r22 32432: 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]; 32434: 27 e0 ldi r18, 0x07 ; 7 32436: ef 81 ldd r30, Y+7 ; 0x07 32438: f8 85 ldd r31, Y+8 ; 0x08 3243a: 2e 9f mul r18, r30 3243c: c0 01 movw r24, r0 3243e: 2f 9f mul r18, r31 32440: 90 0d add r25, r0 32442: 11 24 eor r1, r1 32444: 9a 87 std Y+10, r25 ; 0x0a 32446: 89 87 std Y+9, r24 ; 0x09 32448: fc 01 movw r30, r24 3244a: e2 0d add r30, r2 3244c: f3 1d adc r31, r3 3244e: ee 0f add r30, r30 32450: ff 1f adc r31, r31 32452: ee 0f add r30, r30 32454: ff 1f adc r31, r31 32456: e7 5f subi r30, 0xF7 ; 247 32458: fc 4e sbci r31, 0xEC ; 236 3245a: 21 81 ldd r18, Z+1 ; 0x01 3245c: 32 81 ldd r19, Z+2 ; 0x02 3245e: 43 81 ldd r20, Z+3 ; 0x03 32460: 54 81 ldd r21, Z+4 ; 0x04 32462: c3 01 movw r24, r6 32464: b2 01 movw r22, r4 32466: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3246a: 2b 01 movw r4, r22 3246c: 3c 01 movw r6, r24 3246e: 89 85 ldd r24, Y+9 ; 0x09 32470: 9a 85 ldd r25, Y+10 ; 0x0a 32472: ed 81 ldd r30, Y+5 ; 0x05 32474: fe 81 ldd r31, Y+6 ; 0x06 32476: 8e 0f add r24, r30 32478: 9f 1f adc r25, r31 3247a: 88 0f add r24, r24 3247c: 99 1f adc r25, r25 3247e: 88 0f add r24, r24 32480: 99 1f adc r25, r25 32482: 87 5f subi r24, 0xF7 ; 247 32484: 9c 4e sbci r25, 0xEC ; 236 32486: fc 01 movw r30, r24 32488: 21 81 ldd r18, Z+1 ; 0x01 3248a: 32 81 ldd r19, Z+2 ; 0x02 3248c: 43 81 ldd r20, Z+3 ; 0x03 3248e: 54 81 ldd r21, Z+4 ; 0x04 32490: c7 01 movw r24, r14 32492: b6 01 movw r22, r12 32494: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32498: 9b 01 movw r18, r22 3249a: ac 01 movw r20, r24 3249c: c3 01 movw r24, r6 3249e: b2 01 movw r22, r4 324a0: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> return (1.f-t) * z0 + t * z1; 324a4: 29 81 ldd r18, Y+1 ; 0x01 324a6: 3a 81 ldd r19, Y+2 ; 0x02 324a8: 4b 81 ldd r20, Y+3 ; 0x03 324aa: 5c 81 ldd r21, Y+4 ; 0x04 324ac: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 324b0: 9b 01 movw r18, r22 324b2: ac 01 movw r20, r24 324b4: c5 01 movw r24, r10 324b6: b4 01 movw r22, r8 324b8: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> } 324bc: 2a 96 adiw r28, 0x0a ; 10 324be: 0f b6 in r0, 0x3f ; 63 324c0: f8 94 cli 324c2: de bf out 0x3e, r29 ; 62 324c4: 0f be out 0x3f, r0 ; 63 324c6: cd bf out 0x3d, r28 ; 61 324c8: df 91 pop r29 324ca: cf 91 pop r28 324cc: 1f 91 pop r17 324ce: 0f 91 pop r16 324d0: ff 90 pop r15 324d2: ef 90 pop r14 324d4: df 90 pop r13 324d6: cf 90 pop r12 324d8: bf 90 pop r11 324da: af 90 pop r10 324dc: 9f 90 pop r9 324de: 8f 90 pop r8 324e0: 7f 90 pop r7 324e2: 6f 90 pop r6 324e4: 5f 90 pop r5 324e6: 4f 90 pop r4 324e8: 3f 90 pop r3 324ea: 2f 90 pop r2 324ec: 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; 324ee: 1a 86 std Y+10, r1 ; 0x0a 324f0: 19 86 std Y+9, r1 ; 0x09 324f2: 45 cf rjmp .-374 ; 0x3237e 000324f4 : 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() 324f4: 2f 92 push r2 324f6: 3f 92 push r3 324f8: 4f 92 push r4 324fa: 5f 92 push r5 324fc: 6f 92 push r6 324fe: 7f 92 push r7 32500: 8f 92 push r8 32502: 9f 92 push r9 32504: af 92 push r10 32506: bf 92 push r11 32508: cf 92 push r12 3250a: df 92 push r13 3250c: ef 92 push r14 3250e: ff 92 push r15 32510: 0f 93 push r16 32512: 1f 93 push r17 32514: cf 93 push r28 32516: df 93 push r29 32518: 00 d0 rcall .+0 ; 0x3251a 3251a: 00 d0 rcall .+0 ; 0x3251c 3251c: 00 d0 rcall .+0 ; 0x3251e 3251e: cd b7 in r28, 0x3d ; 61 32520: de b7 in r29, 0x3e ; 62 32522: 09 e0 ldi r16, 0x09 ; 9 32524: 13 e1 ldi r17, 0x13 ; 19 32526: 1f 83 std Y+7, r17 ; 0x07 32528: 0e 83 std Y+6, r16 ; 0x06 3252a: 2e 80 ldd r2, Y+6 ; 0x06 3252c: 3f 80 ldd r3, Y+7 ; 0x07 3252e: 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])) 32530: f1 01 movw r30, r2 32532: 61 81 ldd r22, Z+1 ; 0x01 32534: 72 81 ldd r23, Z+2 ; 0x02 32536: 83 81 ldd r24, Z+3 ; 0x03 32538: 94 81 ldd r25, Z+4 ; 0x04 3253a: 9b 01 movw r18, r22 3253c: ac 01 movw r20, r24 3253e: 0f 94 d3 a8 call 0x351a6 ; 0x351a6 <__unordsf2> 32542: 88 23 and r24, r24 32544: 09 f4 brne .+2 ; 0x32548 32546: 7c c0 rjmp .+248 ; 0x32640 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 32548: 89 81 ldd r24, Y+1 ; 0x01 3254a: 0e 94 b0 5e call 0xbd60 ; 0xbd60 3254e: 20 e0 ldi r18, 0x00 ; 0 32550: 30 e0 ldi r19, 0x00 ; 0 32552: 48 eb ldi r20, 0xB8 ; 184 32554: 51 e4 ldi r21, 0x41 ; 65 32556: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 3255a: 6b 01 movw r12, r22 3255c: 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)) + 3255e: 20 e0 ldi r18, 0x00 ; 0 32560: 30 e0 ldi r19, 0x00 ; 0 32562: 4c ef ldi r20, 0xFC ; 252 32564: 52 e4 ldi r21, 0x42 ; 66 32566: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3256a: 2b 01 movw r4, r22 3256c: 3c 01 movw r6, r24 3256e: 20 e0 ldi r18, 0x00 ; 0 32570: 30 e0 ldi r19, 0x00 ; 0 32572: 44 e6 ldi r20, 0x64 ; 100 32574: 53 e4 ldi r21, 0x43 ; 67 32576: c7 01 movw r24, r14 32578: b6 01 movw r22, r12 3257a: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 3257e: 4b 01 movw r8, r22 32580: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 32582: 20 e0 ldi r18, 0x00 ; 0 32584: 30 e0 ldi r19, 0x00 ; 0 32586: 40 ec ldi r20, 0xC0 ; 192 32588: 51 e4 ldi r21, 0x41 ; 65 3258a: c7 01 movw r24, r14 3258c: b6 01 movw r22, r12 3258e: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 32592: 6b 01 movw r12, r22 32594: 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)) + 32596: ee 81 ldd r30, Y+6 ; 0x06 32598: ff 81 ldd r31, Y+7 ; 0x07 3259a: 21 81 ldd r18, Z+1 ; 0x01 3259c: 32 81 ldd r19, Z+2 ; 0x02 3259e: 43 81 ldd r20, Z+3 ; 0x03 325a0: 54 81 ldd r21, Z+4 ; 0x04 325a2: c3 01 movw r24, r6 325a4: b2 01 movw r22, r4 325a6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 325aa: a5 01 movw r20, r10 325ac: 94 01 movw r18, r8 325ae: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 325b2: 20 e0 ldi r18, 0x00 ; 0 325b4: 30 e9 ldi r19, 0x90 ; 144 325b6: 42 ea ldi r20, 0xA2 ; 162 325b8: 56 e4 ldi r21, 0x46 ; 70 325ba: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 325be: 6a 83 std Y+2, r22 ; 0x02 325c0: 7b 83 std Y+3, r23 ; 0x03 325c2: 8c 83 std Y+4, r24 ; 0x04 325c4: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 325c6: ee 81 ldd r30, Y+6 ; 0x06 325c8: ff 81 ldd r31, Y+7 ; 0x07 325ca: 25 85 ldd r18, Z+13 ; 0x0d 325cc: 36 85 ldd r19, Z+14 ; 0x0e 325ce: 47 85 ldd r20, Z+15 ; 0x0f 325d0: 50 89 ldd r21, Z+16 ; 0x10 325d2: c7 01 movw r24, r14 325d4: b6 01 movw r22, r12 325d6: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 325da: a5 01 movw r20, r10 325dc: 94 01 movw r18, r8 325de: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 325e2: 20 e0 ldi r18, 0x00 ; 0 325e4: 30 e9 ldi r19, 0x90 ; 144 325e6: 42 e2 ldi r20, 0x22 ; 34 325e8: 56 ec ldi r21, 0xC6 ; 198 325ea: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 325ee: 9b 01 movw r18, r22 325f0: 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)) + 325f2: 6a 81 ldd r22, Y+2 ; 0x02 325f4: 7b 81 ldd r23, Y+3 ; 0x03 325f6: 8c 81 ldd r24, Y+4 ; 0x04 325f8: 9d 81 ldd r25, Y+5 ; 0x05 325fa: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 325fe: 4b 01 movw r8, r22 32600: 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)); 32602: ee 81 ldd r30, Y+6 ; 0x06 32604: ff 81 ldd r31, Y+7 ; 0x07 32606: 21 8d ldd r18, Z+25 ; 0x19 32608: 32 8d ldd r19, Z+26 ; 0x1a 3260a: 43 8d ldd r20, Z+27 ; 0x1b 3260c: 54 8d ldd r21, Z+28 ; 0x1c 3260e: c7 01 movw r24, r14 32610: b6 01 movw r22, r12 32612: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32616: a3 01 movw r20, r6 32618: 92 01 movw r18, r4 3261a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3261e: 20 e0 ldi r18, 0x00 ; 0 32620: 30 e9 ldi r19, 0x90 ; 144 32622: 42 ea ldi r20, 0xA2 ; 162 32624: 56 e4 ldi r21, 0x46 ; 70 32626: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 3262a: 9b 01 movw r18, r22 3262c: 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)) + 3262e: c5 01 movw r24, r10 32630: b4 01 movw r22, r8 32632: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__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] = 32636: f1 01 movw r30, r2 32638: 61 83 std Z+1, r22 ; 0x01 3263a: 72 83 std Z+2, r23 ; 0x02 3263c: 83 83 std Z+3, r24 ; 0x03 3263e: 94 83 std Z+4, r25 ; 0x04 32640: f4 e0 ldi r31, 0x04 ; 4 32642: 2f 0e add r2, r31 32644: 31 1c adc r3, r1 32646: 29 81 ldd r18, Y+1 ; 0x01 32648: 2f 5f subi r18, 0xFF ; 255 3264a: 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) { 3264c: 27 30 cpi r18, 0x07 ; 7 3264e: 09 f0 breq .+2 ; 0x32652 32650: 6f cf rjmp .-290 ; 0x32530 32652: 8e 81 ldd r24, Y+6 ; 0x06 32654: 9f 81 ldd r25, Y+7 ; 0x07 32656: 4c 96 adiw r24, 0x1c ; 28 32658: 9f 83 std Y+7, r25 ; 0x07 3265a: 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) { 3265c: 8d 5c subi r24, 0xCD ; 205 3265e: 93 41 sbci r25, 0x13 ; 19 32660: 09 f0 breq .+2 ; 0x32664 32662: 63 cf rjmp .-314 ; 0x3252a 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() 32664: 19 87 std Y+9, r17 ; 0x09 32666: 08 87 std Y+8, r16 ; 0x08 32668: f1 e0 ldi r31, 0x01 ; 1 3266a: 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)) + 3266c: c8 01 movw r24, r16 3266e: 8b 5a subi r24, 0xAB ; 171 32670: 9f 4f sbci r25, 0xFF ; 255 32672: 9f 83 std Y+7, r25 ; 0x07 32674: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 32676: 18 01 movw r2, r16 32678: 99 ea ldi r25, 0xA9 ; 169 3267a: 29 0e add r2, r25 3267c: 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])) 3267e: e8 85 ldd r30, Y+8 ; 0x08 32680: f9 85 ldd r31, Y+9 ; 0x09 32682: 65 8d ldd r22, Z+29 ; 0x1d 32684: 76 8d ldd r23, Z+30 ; 0x1e 32686: 87 8d ldd r24, Z+31 ; 0x1f 32688: 90 a1 ldd r25, Z+32 ; 0x20 3268a: 9b 01 movw r18, r22 3268c: ac 01 movw r20, r24 3268e: 0f 94 d3 a8 call 0x351a6 ; 0x351a6 <__unordsf2> 32692: 88 23 and r24, r24 32694: 09 f4 brne .+2 ; 0x32698 32696: 79 c0 rjmp .+242 ; 0x3278a static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 32698: 89 81 ldd r24, Y+1 ; 0x01 3269a: 0e 94 b0 5e call 0xbd60 ; 0xbd60 3269e: 20 e0 ldi r18, 0x00 ; 0 326a0: 30 e0 ldi r19, 0x00 ; 0 326a2: 40 ea ldi r20, 0xA0 ; 160 326a4: 50 e4 ldi r21, 0x40 ; 64 326a6: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 326aa: 6b 01 movw r12, r22 326ac: 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)) + 326ae: 20 e0 ldi r18, 0x00 ; 0 326b0: 30 e0 ldi r19, 0x00 ; 0 326b2: 48 ed ldi r20, 0xD8 ; 216 326b4: 52 e4 ldi r21, 0x42 ; 66 326b6: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 326ba: 2b 01 movw r4, r22 326bc: 3c 01 movw r6, r24 326be: 20 e0 ldi r18, 0x00 ; 0 326c0: 30 e0 ldi r19, 0x00 ; 0 326c2: 42 e5 ldi r20, 0x52 ; 82 326c4: 53 e4 ldi r21, 0x43 ; 67 326c6: c7 01 movw r24, r14 326c8: b6 01 movw r22, r12 326ca: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 326ce: 4b 01 movw r8, r22 326d0: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 326d2: 20 e0 ldi r18, 0x00 ; 0 326d4: 30 e0 ldi r19, 0x00 ; 0 326d6: 40 ec ldi r20, 0xC0 ; 192 326d8: 50 e4 ldi r21, 0x40 ; 64 326da: c7 01 movw r24, r14 326dc: b6 01 movw r22, r12 326de: 0f 94 c4 a4 call 0x34988 ; 0x34988 <__subsf3> 326e2: 6b 01 movw r12, r22 326e4: 7c 01 movw r14, r24 326e6: ee 81 ldd r30, Y+6 ; 0x06 326e8: ff 81 ldd r31, Y+7 ; 0x07 326ea: 20 81 ld r18, Z 326ec: 31 81 ldd r19, Z+1 ; 0x01 326ee: 42 81 ldd r20, Z+2 ; 0x02 326f0: 53 81 ldd r21, Z+3 ; 0x03 326f2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 326f6: a5 01 movw r20, r10 326f8: 94 01 movw r18, r8 326fa: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 326fe: 20 e0 ldi r18, 0x00 ; 0 32700: 30 e9 ldi r19, 0x90 ; 144 32702: 42 e2 ldi r20, 0x22 ; 34 32704: 56 ec ldi r21, 0xC6 ; 198 32706: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 3270a: 6a 83 std Y+2, r22 ; 0x02 3270c: 7b 83 std Y+3, r23 ; 0x03 3270e: 8c 83 std Y+4, r24 ; 0x04 32710: 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)) + 32712: f8 01 movw r30, r16 32714: 21 81 ldd r18, Z+1 ; 0x01 32716: 32 81 ldd r19, Z+2 ; 0x02 32718: 43 81 ldd r20, Z+3 ; 0x03 3271a: 54 81 ldd r21, Z+4 ; 0x04 3271c: c3 01 movw r24, r6 3271e: b2 01 movw r22, r4 32720: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32724: a5 01 movw r20, r10 32726: 94 01 movw r18, r8 32728: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3272c: 20 e0 ldi r18, 0x00 ; 0 3272e: 30 e9 ldi r19, 0x90 ; 144 32730: 42 ea ldi r20, 0xA2 ; 162 32732: 56 e4 ldi r21, 0x46 ; 70 32734: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 32738: 9b 01 movw r18, r22 3273a: ac 01 movw r20, r24 3273c: 6a 81 ldd r22, Y+2 ; 0x02 3273e: 7b 81 ldd r23, Y+3 ; 0x03 32740: 8c 81 ldd r24, Y+4 ; 0x04 32742: 9d 81 ldd r25, Y+5 ; 0x05 32744: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 32748: 4b 01 movw r8, r22 3274a: 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)); 3274c: f1 01 movw r30, r2 3274e: 20 81 ld r18, Z 32750: 31 81 ldd r19, Z+1 ; 0x01 32752: 42 81 ldd r20, Z+2 ; 0x02 32754: 53 81 ldd r21, Z+3 ; 0x03 32756: c7 01 movw r24, r14 32758: b6 01 movw r22, r12 3275a: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 3275e: a3 01 movw r20, r6 32760: 92 01 movw r18, r4 32762: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 32766: 20 e0 ldi r18, 0x00 ; 0 32768: 30 e9 ldi r19, 0x90 ; 144 3276a: 42 ea ldi r20, 0xA2 ; 162 3276c: 56 e4 ldi r21, 0x46 ; 70 3276e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 <__divsf3> 32772: 9b 01 movw r18, r22 32774: 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)) + 32776: c5 01 movw r24, r10 32778: b4 01 movw r22, r8 3277a: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__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] = 3277e: e8 85 ldd r30, Y+8 ; 0x08 32780: f9 85 ldd r31, Y+9 ; 0x09 32782: 65 8f std Z+29, r22 ; 0x1d 32784: 76 8f std Z+30, r23 ; 0x1e 32786: 87 8f std Z+31, r24 ; 0x1f 32788: 90 a3 std Z+32, r25 ; 0x20 3278a: 88 85 ldd r24, Y+8 ; 0x08 3278c: 99 85 ldd r25, Y+9 ; 0x09 3278e: 4c 96 adiw r24, 0x1c ; 28 32790: 99 87 std Y+9, r25 ; 0x09 32792: 88 87 std Y+8, r24 ; 0x08 32794: 99 81 ldd r25, Y+1 ; 0x01 32796: 9f 5f subi r25, 0xFF ; 255 32798: 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) { 3279a: 96 30 cpi r25, 0x06 ; 6 3279c: 09 f0 breq .+2 ; 0x327a0 3279e: 6f cf rjmp .-290 ; 0x3267e 327a0: 0c 5f subi r16, 0xFC ; 252 327a2: 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) { 327a4: e3 e1 ldi r30, 0x13 ; 19 327a6: 05 32 cpi r16, 0x25 ; 37 327a8: 1e 07 cpc r17, r30 327aa: 09 f0 breq .+2 ; 0x327ae 327ac: 5b cf rjmp .-330 ; 0x32664 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 327ae: 29 96 adiw r28, 0x09 ; 9 327b0: 0f b6 in r0, 0x3f ; 63 327b2: f8 94 cli 327b4: de bf out 0x3e, r29 ; 62 327b6: 0f be out 0x3f, r0 ; 63 327b8: cd bf out 0x3d, r28 ; 61 327ba: df 91 pop r29 327bc: cf 91 pop r28 327be: 1f 91 pop r17 327c0: 0f 91 pop r16 327c2: ff 90 pop r15 327c4: ef 90 pop r14 327c6: df 90 pop r13 327c8: cf 90 pop r12 327ca: bf 90 pop r11 327cc: af 90 pop r10 327ce: 9f 90 pop r9 327d0: 8f 90 pop r8 327d2: 7f 90 pop r7 327d4: 6f 90 pop r6 327d6: 5f 90 pop r5 327d8: 4f 90 pop r4 327da: 3f 90 pop r3 327dc: 2f 90 pop r2 327de: 08 95 ret 000327e0 : 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) { 327e0: 1f 93 push r17 327e2: cf 93 push r28 327e4: df 93 push r29 327e6: 00 d0 rcall .+0 ; 0x327e8 327e8: 1f 92 push r1 327ea: 1f 92 push r1 327ec: cd b7 in r28, 0x3d ; 61 327ee: de b7 in r29, 0x3e ; 62 327f0: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 327f2: 48 2f mov r20, r24 327f4: 62 e5 ldi r22, 0x52 ; 82 327f6: ce 01 movw r24, r28 327f8: 01 96 adiw r24, 0x01 ; 1 327fa: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 327fe: 49 81 ldd r20, Y+1 ; 0x01 32800: 5a 81 ldd r21, Y+2 ; 0x02 32802: 6b 81 ldd r22, Y+3 ; 0x03 32804: 7c 81 ldd r23, Y+4 ; 0x04 32806: 8d 81 ldd r24, Y+5 ; 0x05 32808: 0f 94 30 57 call 0x2ae60 ; 0x2ae60 scopeState = nextState; 3280c: 10 93 95 12 sts 0x1295, r17 ; 0x801295 } 32810: 0f 90 pop r0 32812: 0f 90 pop r0 32814: 0f 90 pop r0 32816: 0f 90 pop r0 32818: 0f 90 pop r0 3281a: df 91 pop r29 3281c: cf 91 pop r28 3281e: 1f 91 pop r17 32820: 08 95 ret 00032822 : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 32822: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 32826: ec e5 ldi r30, 0x5C ; 92 32828: f1 ea ldi r31, 0xA1 ; 161 3282a: 84 91 lpm r24, Z 3282c: 67 e0 ldi r22, 0x07 ; 7 3282e: 0d 94 f0 93 jmp 0x327e0 ; 0x327e0 00032832 : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 32832: e0 91 e0 12 lds r30, 0x12E0 ; 0x8012e0 32836: ae 2f mov r26, r30 32838: b0 e0 ldi r27, 0x00 ; 0 3283a: aa 0f add r26, r26 3283c: bb 1f adc r27, r27 3283e: a6 52 subi r26, 0x26 ; 38 32840: bd 4e sbci r27, 0xED ; 237 32842: 20 91 ad 12 lds r18, 0x12AD ; 0x8012ad 32846: 30 91 ae 12 lds r19, 0x12AE ; 0x8012ae 3284a: 2d 93 st X+, r18 3284c: 3c 93 st X, r19 ++regIndex; 3284e: ef 5f subi r30, 0xFF ; 255 32850: e0 93 e0 12 sts 0x12E0, r30 ; 0x8012e0 if (regIndex >= regs16Count) { 32854: e2 30 cpi r30, 0x02 ; 2 32856: 40 f4 brcc .+16 ; 0x32868 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32858: f0 e0 ldi r31, 0x00 ; 0 3285a: ed 5b subi r30, 0xBD ; 189 3285c: fe 45 sbci r31, 0x5E ; 94 3285e: 84 91 lpm r24, Z 32860: 68 e0 ldi r22, 0x08 ; 8 32862: 0f 94 f0 93 call 0x327e0 ; 0x327e0 } return ScopeState::Reading16bitRegisters; 32866: 88 e0 ldi r24, 0x08 ; 8 } 32868: 08 95 ret 0003286a : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 3286a: e0 91 e0 12 lds r30, 0x12E0 ; 0x8012e0 3286e: ae 2f mov r26, r30 32870: b0 e0 ldi r27, 0x00 ; 0 32872: a9 52 subi r26, 0x29 ; 41 32874: bd 4e sbci r27, 0xED ; 237 32876: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 3287a: 8c 93 st X, r24 ++regIndex; 3287c: ef 5f subi r30, 0xFF ; 255 3287e: e0 93 e0 12 sts 0x12E0, r30 ; 0x8012e0 if (regIndex >= regs8Count) { 32882: e3 30 cpi r30, 0x03 ; 3 32884: 40 f0 brcs .+16 ; 0x32896 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 32886: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 3288a: e3 e4 ldi r30, 0x43 ; 67 3288c: f1 ea ldi r31, 0xA1 ; 161 3288e: 84 91 lpm r24, Z 32890: 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); 32892: 0d 94 f0 93 jmp 0x327e0 ; 0x327e0 32896: f0 e0 ldi r31, 0x00 ; 0 32898: e4 5a subi r30, 0xA4 ; 164 3289a: fe 45 sbci r31, 0x5E ; 94 3289c: 84 91 lpm r24, Z 3289e: 67 e0 ldi r22, 0x07 ; 7 328a0: f8 cf rjmp .-16 ; 0x32892 000328a2 : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 328a2: cf 93 push r28 328a4: df 93 push r29 328a6: 00 d0 rcall .+0 ; 0x328a8 328a8: 00 d0 rcall .+0 ; 0x328aa 328aa: 00 d0 rcall .+0 ; 0x328ac 328ac: 1f 92 push r1 328ae: cd b7 in r28, 0x3d ; 61 328b0: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 328b2: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 328b6: 82 34 cpi r24, 0x42 ; 66 328b8: 09 f4 brne .+2 ; 0x328bc 328ba: 46 c0 rjmp .+140 ; 0x32948 328bc: b8 f5 brcc .+110 ; 0x3292c 328be: 88 23 and r24, r24 328c0: 09 f4 brne .+2 ; 0x328c4 328c2: 72 c0 rjmp .+228 ; 0x329a8 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 328c4: 84 e0 ldi r24, 0x04 ; 4 328c6: 80 93 94 12 sts 0x1294, r24 ; 0x801294 328ca: 85 e0 ldi r24, 0x05 ; 5 328cc: ec e9 ldi r30, 0x9C ; 156 328ce: f2 e1 ldi r31, 0x12 ; 18 328d0: de 01 movw r26, r28 328d2: 16 96 adiw r26, 0x06 ; 6 328d4: 01 90 ld r0, Z+ 328d6: 0d 92 st X+, r0 328d8: 8a 95 dec r24 328da: e1 f7 brne .-8 ; 0x328d4 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 328dc: 85 e0 ldi r24, 0x05 ; 5 328de: fe 01 movw r30, r28 328e0: 36 96 adiw r30, 0x06 ; 6 328e2: a7 e9 ldi r26, 0x97 ; 151 328e4: b2 e1 ldi r27, 0x12 ; 18 328e6: 01 90 ld r0, Z+ 328e8: 0d 92 st X+, r0 328ea: 8a 95 dec r24 328ec: e1 f7 brne .-8 ; 0x328e6 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 328ee: 40 e0 ldi r20, 0x00 ; 0 328f0: 60 e0 ldi r22, 0x00 ; 0 328f2: ce 01 movw r24, r28 328f4: 01 96 adiw r24, 0x01 ; 1 328f6: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 328fa: 85 e0 ldi r24, 0x05 ; 5 328fc: fe 01 movw r30, r28 328fe: 31 96 adiw r30, 0x01 ; 1 32900: ac e9 ldi r26, 0x9C ; 156 32902: b2 e1 ldi r27, 0x12 ; 18 32904: 01 90 ld r0, Z+ 32906: 0d 92 st X+, r0 32908: 8a 95 dec r24 3290a: e1 f7 brne .-8 ; 0x32904 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3290c: 85 e0 ldi r24, 0x05 ; 5 3290e: 80 93 95 12 sts 0x1295, r24 ; 0x801295 SendMsg(rq); 32912: 40 91 97 12 lds r20, 0x1297 ; 0x801297 32916: 50 91 98 12 lds r21, 0x1298 ; 0x801298 3291a: 60 91 99 12 lds r22, 0x1299 ; 0x801299 3291e: 70 91 9a 12 lds r23, 0x129A ; 0x80129a 32922: 80 91 9b 12 lds r24, 0x129B ; 0x80129b 32926: 0f 94 30 57 call 0x2ae60 ; 0x2ae60 3292a: 2e c0 rjmp .+92 ; 0x32988 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 3292c: 82 35 cpi r24, 0x52 ; 82 3292e: b1 f1 breq .+108 ; 0x3299c 32930: 87 35 cpi r24, 0x57 ; 87 32932: 41 f6 brne .-112 ; 0x328c4 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); 32934: 60 91 9e 12 lds r22, 0x129E ; 0x80129e 32938: 70 91 9f 12 lds r23, 0x129F ; 0x80129f 3293c: 4c e0 ldi r20, 0x0C ; 12 3293e: 80 91 9d 12 lds r24, 0x129D ; 0x80129d 32942: 0f 94 9b 57 call 0x2af36 ; 0x2af36 32946: 11 c0 rjmp .+34 ; 0x3296a SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 32948: 40 91 9d 12 lds r20, 0x129D ; 0x80129d 3294c: 62 e4 ldi r22, 0x42 ; 66 3294e: ce 01 movw r24, r28 32950: 01 96 adiw r24, 0x01 ; 1 32952: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 32956: 49 81 ldd r20, Y+1 ; 0x01 32958: 5a 81 ldd r21, Y+2 ; 0x02 3295a: 6b 81 ldd r22, Y+3 ; 0x03 3295c: 7c 81 ldd r23, Y+4 ; 0x04 3295e: 8d 81 ldd r24, Y+5 ; 0x05 32960: 0f 94 30 57 call 0x2ae60 ; 0x2ae60 scopeState = ScopeState::ButtonSent; 32964: 8a e0 ldi r24, 0x0A ; 10 32966: 80 93 95 12 sts 0x1295, r24 ; 0x801295 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); 3296a: 40 e0 ldi r20, 0x00 ; 0 3296c: 60 e0 ldi r22, 0x00 ; 0 3296e: ce 01 movw r24, r28 32970: 01 96 adiw r24, 0x01 ; 1 32972: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 32976: 85 e0 ldi r24, 0x05 ; 5 32978: fe 01 movw r30, r28 3297a: 31 96 adiw r30, 0x01 ; 1 3297c: ac e9 ldi r26, 0x9C ; 156 3297e: b2 e1 ldi r27, 0x12 ; 18 32980: 01 90 ld r0, Z+ 32982: 0d 92 st X+, r0 32984: 8a 95 dec r24 32986: e1 f7 brne .-8 ; 0x32980 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 32988: 81 e0 ldi r24, 0x01 ; 1 } } 3298a: 2a 96 adiw r28, 0x0a ; 10 3298c: 0f b6 in r0, 0x3f ; 63 3298e: f8 94 cli 32990: de bf out 0x3e, r29 ; 62 32992: 0f be out 0x3f, r0 ; 63 32994: cd bf out 0x3d, r28 ; 61 32996: df 91 pop r29 32998: cf 91 pop r28 3299a: 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); 3299c: 6b e0 ldi r22, 0x0B ; 11 3299e: 80 91 9d 12 lds r24, 0x129D ; 0x80129d 329a2: 0f 94 f0 93 call 0x327e0 ; 0x327e0 329a6: e1 cf rjmp .-62 ; 0x3296a case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 329a8: 80 e0 ldi r24, 0x00 ; 0 329aa: ef cf rjmp .-34 ; 0x3298a 000329ac : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 329ac: cf 93 push r28 329ae: df 93 push r29 329b0: 00 d0 rcall .+0 ; 0x329b2 329b2: 1f 92 push r1 329b4: 1f 92 push r1 329b6: cd b7 in r28, 0x3d ; 61 329b8: de b7 in r29, 0x3e ; 62 329ba: 49 83 std Y+1, r20 ; 0x01 329bc: 5a 83 std Y+2, r21 ; 0x02 329be: 6b 83 std Y+3, r22 ; 0x03 329c0: 7c 83 std Y+4, r23 ; 0x04 329c2: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 329c4: 85 e0 ldi r24, 0x05 ; 5 329c6: fe 01 movw r30, r28 329c8: 31 96 adiw r30, 0x01 ; 1 329ca: ac e9 ldi r26, 0x9C ; 156 329cc: b2 e1 ldi r27, 0x12 ; 18 329ce: 01 90 ld r0, Z+ 329d0: 0d 92 st X+, r0 329d2: 8a 95 dec r24 329d4: e1 f7 brne .-8 ; 0x329ce if (!ExpectsResponse()) { 329d6: 80 91 95 12 lds r24, 0x1295 ; 0x801295 329da: 87 ff sbrs r24, 7 329dc: 09 c0 rjmp .+18 ; 0x329f0 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 329de: 0f 90 pop r0 329e0: 0f 90 pop r0 329e2: 0f 90 pop r0 329e4: 0f 90 pop r0 329e6: 0f 90 pop r0 329e8: df 91 pop r29 329ea: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 329ec: 0d 94 51 94 jmp 0x328a2 ; 0x328a2 } // otherwise wait for an empty window to activate the request } 329f0: 0f 90 pop r0 329f2: 0f 90 pop r0 329f4: 0f 90 pop r0 329f6: 0f 90 pop r0 329f8: 0f 90 pop r0 329fa: df 91 pop r29 329fc: cf 91 pop r28 329fe: 08 95 ret 00032a00 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 32a00: cf 93 push r28 32a02: df 93 push r29 32a04: 00 d0 rcall .+0 ; 0x32a06 32a06: 1f 92 push r1 32a08: 1f 92 push r1 32a0a: cd b7 in r28, 0x3d ; 61 32a0c: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 32a0e: 48 2f mov r20, r24 32a10: 68 e5 ldi r22, 0x58 ; 88 32a12: ce 01 movw r24, r28 32a14: 01 96 adiw r24, 0x01 ; 1 32a16: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 32a1a: 49 81 ldd r20, Y+1 ; 0x01 32a1c: 5a 81 ldd r21, Y+2 ; 0x02 32a1e: 6b 81 ldd r22, Y+3 ; 0x03 32a20: 7c 81 ldd r23, Y+4 ; 0x04 32a22: 8d 81 ldd r24, Y+5 ; 0x05 32a24: 0f 94 d6 94 call 0x329ac ; 0x329ac } 32a28: 0f 90 pop r0 32a2a: 0f 90 pop r0 32a2c: 0f 90 pop r0 32a2e: 0f 90 pop r0 32a30: 0f 90 pop r0 32a32: df 91 pop r29 32a34: cf 91 pop r28 32a36: 08 95 ret 00032a38 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 32a38: 1f 93 push r17 32a3a: cf 93 push r28 32a3c: df 93 push r29 32a3e: 00 d0 rcall .+0 ; 0x32a40 32a40: 1f 92 push r1 32a42: 1f 92 push r1 32a44: cd b7 in r28, 0x3d ; 61 32a46: de b7 in r29, 0x3e ; 62 32a48: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 32a4a: 48 2f mov r20, r24 32a4c: 63 e5 ldi r22, 0x53 ; 83 32a4e: ce 01 movw r24, r28 32a50: 01 96 adiw r24, 0x01 ; 1 32a52: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 32a56: 49 81 ldd r20, Y+1 ; 0x01 32a58: 5a 81 ldd r21, Y+2 ; 0x02 32a5a: 6b 81 ldd r22, Y+3 ; 0x03 32a5c: 7c 81 ldd r23, Y+4 ; 0x04 32a5e: 8d 81 ldd r24, Y+5 ; 0x05 32a60: 0f 94 30 57 call 0x2ae60 ; 0x2ae60 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 32a64: 10 93 95 12 sts 0x1295, r17 ; 0x801295 } 32a68: 0f 90 pop r0 32a6a: 0f 90 pop r0 32a6c: 0f 90 pop r0 32a6e: 0f 90 pop r0 32a70: 0f 90 pop r0 32a72: df 91 pop r29 32a74: cf 91 pop r28 32a76: 1f 91 pop r17 32a78: 08 95 ret 00032a7a : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 32a7a: 1f 93 push r17 32a7c: cf 93 push r28 32a7e: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 32a80: e1 e0 ldi r30, 0x01 ; 1 32a82: f1 e0 ldi r31, 0x01 ; 1 32a84: 80 81 ld r24, Z 32a86: 8e 7f andi r24, 0xFE ; 254 32a88: 80 83 st Z, r24 PORTH |= 0x01; 32a8a: e2 e0 ldi r30, 0x02 ; 2 32a8c: f1 e0 ldi r31, 0x01 ; 1 32a8e: 80 81 ld r24, Z 32a90: 81 60 ori r24, 0x01 ; 1 32a92: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 32a94: e5 e4 ldi r30, 0x45 ; 69 32a96: fd e0 ldi r31, 0x0D ; 13 32a98: 90 e1 ldi r25, 0x10 ; 16 32a9a: 90 83 st Z, r25 ptr[1] = 0; 32a9c: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 32a9e: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 32aa0: e0 ed ldi r30, 0xD0 ; 208 32aa2: f0 e0 ldi r31, 0x00 ; 0 32aa4: 80 81 ld r24, Z 32aa6: 82 60 ori r24, 0x02 ; 2 32aa8: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 32aaa: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 32aae: e1 ed ldi r30, 0xD1 ; 209 32ab0: f0 e0 ldi r31, 0x00 ; 0 32ab2: 88 e1 ldi r24, 0x18 ; 24 32ab4: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 32ab6: 80 81 ld r24, Z 32ab8: 80 68 ori r24, 0x80 ; 128 32aba: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 32abc: e4 e7 ldi r30, 0x74 ; 116 32abe: f2 e1 ldi r31, 0x12 ; 18 32ac0: 87 e0 ldi r24, 0x07 ; 7 32ac2: 9d ef ldi r25, 0xFD ; 253 32ac4: 91 87 std Z+9, r25 ; 0x09 32ac6: 80 87 std Z+8, r24 ; 0x08 32ac8: 8f ee ldi r24, 0xEF ; 239 32aca: 9c ef ldi r25, 0xFC ; 252 32acc: 93 87 std Z+11, r25 ; 0x0b 32ace: 82 87 std Z+10, r24 ; 0x0a 32ad0: 13 e0 ldi r17, 0x03 ; 3 32ad2: 13 83 std Z+3, r17 ; 0x03 32ad4: 15 86 std Z+13, r1 ; 0x0d 32ad6: 14 86 std Z+12, r1 ; 0x0c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 32ad8: 80 e0 ldi r24, 0x00 ; 0 32ada: 0f 94 00 95 call 0x32a00 ; 0x32a00 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 32ade: 83 e6 ldi r24, 0x63 ; 99 32ae0: 0f 94 9f 65 call 0x2cb3e ; 0x2cb3e retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 32ae4: 88 e9 ldi r24, 0x98 ; 152 32ae6: 9f e9 ldi r25, 0x9F ; 159 32ae8: 0e 94 8d 7c call 0xf91a ; 0xf91a retryAttempts = MAX_RETRIES; 32aec: c2 e9 ldi r28, 0x92 ; 146 32aee: d2 e1 ldi r29, 0x12 ; 18 32af0: 10 93 e6 12 sts 0x12E6, r17 ; 0x8012e6 } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 32af4: 81 e6 ldi r24, 0x61 ; 97 32af6: 91 ea ldi r25, 0xA1 ; 161 32af8: 0e 94 8d 7c call 0xf91a ; 0xf91a /// @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; } 32afc: 8a e0 ldi r24, 0x0A ; 10 32afe: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 32b00: 82 e0 ldi r24, 0x02 ; 2 32b02: 80 93 01 13 sts 0x1301, r24 ; 0x801301 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 32b06: 81 e0 ldi r24, 0x01 ; 1 32b08: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 32b0a: 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; 32b0c: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 32b0e: 86 e0 ldi r24, 0x06 ; 6 32b10: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 32b12: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 32b14: df 91 pop r29 32b16: cf 91 pop r28 32b18: 1f 91 pop r17 32b1a: 0d 94 1c 95 jmp 0x32a38 ; 0x32a38 00032b1e : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 32b1e: cf 93 push r28 32b20: df 93 push r29 32b22: 00 d0 rcall .+0 ; 0x32b24 32b24: 1f 92 push r1 32b26: 1f 92 push r1 32b28: cd b7 in r28, 0x3d ; 61 32b2a: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 32b2c: 40 e0 ldi r20, 0x00 ; 0 32b2e: 61 e5 ldi r22, 0x51 ; 81 32b30: ce 01 movw r24, r28 32b32: 01 96 adiw r24, 0x01 ; 1 32b34: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 32b38: 49 81 ldd r20, Y+1 ; 0x01 32b3a: 5a 81 ldd r21, Y+2 ; 0x02 32b3c: 6b 81 ldd r22, Y+3 ; 0x03 32b3e: 7c 81 ldd r23, Y+4 ; 0x04 32b40: 8d 81 ldd r24, Y+5 ; 0x05 32b42: 0f 94 30 57 call 0x2ae60 ; 0x2ae60 scopeState = ScopeState::QuerySent; 32b46: 84 e0 ldi r24, 0x04 ; 4 32b48: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } 32b4c: 0f 90 pop r0 32b4e: 0f 90 pop r0 32b50: 0f 90 pop r0 32b52: 0f 90 pop r0 32b54: 0f 90 pop r0 32b56: df 91 pop r29 32b58: cf 91 pop r28 32b5a: 08 95 ret 00032b5c : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 32b5c: cf 93 push r28 32b5e: df 93 push r29 32b60: 00 d0 rcall .+0 ; 0x32b62 32b62: 1f 92 push r1 32b64: 1f 92 push r1 32b66: cd b7 in r28, 0x3d ; 61 32b68: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 32b6a: 0f 94 d0 4e call 0x29da0 ; 0x29da0 32b6e: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 32b72: 48 2f mov r20, r24 32b74: 66 e6 ldi r22, 0x66 ; 102 32b76: ce 01 movw r24, r28 32b78: 01 96 adiw r24, 0x01 ; 1 32b7a: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 32b7e: 49 81 ldd r20, Y+1 ; 0x01 32b80: 5a 81 ldd r21, Y+2 ; 0x02 32b82: 6b 81 ldd r22, Y+3 ; 0x03 32b84: 7c 81 ldd r23, Y+4 ; 0x04 32b86: 8d 81 ldd r24, Y+5 ; 0x05 32b88: 0f 94 30 57 call 0x2ae60 ; 0x2ae60 scopeState = ScopeState::FilamentSensorStateSent; 32b8c: 86 e0 ldi r24, 0x06 ; 6 32b8e: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } 32b92: 0f 90 pop r0 32b94: 0f 90 pop r0 32b96: 0f 90 pop r0 32b98: 0f 90 pop r0 32b9a: 0f 90 pop r0 32b9c: df 91 pop r29 32b9e: cf 91 pop r28 32ba0: 08 95 ret 00032ba2 : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 32ba2: cf 93 push r28 32ba4: df 93 push r29 32ba6: 00 d0 rcall .+0 ; 0x32ba8 32ba8: 1f 92 push r1 32baa: 1f 92 push r1 32bac: cd b7 in r28, 0x3d ; 61 32bae: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 32bb0: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 32bb4: 85 34 cpi r24, 0x45 ; 69 32bb6: f1 f0 breq .+60 ; 0x32bf4 32bb8: 20 f4 brcc .+8 ; 0x32bc2 32bba: 82 34 cpi r24, 0x42 ; 66 32bbc: 51 f1 breq .+84 ; 0x32c12 } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 32bbe: 85 e0 ldi r24, 0x05 ; 5 32bc0: 11 c0 rjmp .+34 ; 0x32be4 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 32bc2: 86 34 cpi r24, 0x46 ; 70 32bc4: 71 f1 breq .+92 ; 0x32c22 32bc6: 80 35 cpi r24, 0x50 ; 80 32bc8: d1 f7 brne .-12 ; 0x32bbe case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 32bca: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32bce: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = ErrorCode::OK; 32bd2: 81 e0 ldi r24, 0x01 ; 1 32bd4: 90 e0 ldi r25, 0x00 ; 0 32bd6: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32bda: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 32bde: 0f 94 ae 95 call 0x32b5c ; 0x32b5c return Processing; 32be2: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 32be4: 0f 90 pop r0 32be6: 0f 90 pop r0 32be8: 0f 90 pop r0 32bea: 0f 90 pop r0 32bec: 0f 90 pop r0 32bee: df 91 pop r29 32bf0: cf 91 pop r28 32bf2: 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; 32bf4: 8c e0 ldi r24, 0x0C ; 12 32bf6: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = static_cast(rsp.paramValue); 32bfa: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32bfe: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 32c02: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32c06: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 // 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(); 32c0a: 0f 94 ae 95 call 0x32b5c ; 0x32b5c return CommandError; 32c0e: 87 e0 ldi r24, 0x07 ; 7 32c10: e9 cf rjmp .-46 ; 0x32be4 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); 32c12: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32c16: 80 93 d5 12 sts 0x12D5, r24 ; 0x8012d5 SendAndUpdateFilamentSensor(); 32c1a: 0f 94 ae 95 call 0x32b5c ; 0x32b5c return ButtonPushed; 32c1e: 8b e0 ldi r24, 0x0B ; 11 32c20: e1 cf rjmp .-62 ; 0x32be4 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) { 32c22: 90 91 97 12 lds r25, 0x1297 ; 0x801297 32c26: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 32c2a: 98 13 cpse r25, r24 32c2c: 22 c0 rjmp .+68 ; 0x32c72 32c2e: 90 91 98 12 lds r25, 0x1298 ; 0x801298 32c32: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 32c36: 98 13 cpse r25, r24 32c38: 1c c0 rjmp .+56 ; 0x32c72 progressCode = ProgressCode::OK; 32c3a: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::OK; 32c3e: 81 e0 ldi r24, 0x01 ; 1 32c40: 90 e0 ldi r25, 0x00 ; 0 32c42: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32c46: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 scopeState = ScopeState::Ready; 32c4a: 82 e8 ldi r24, 0x82 ; 130 32c4c: 80 93 95 12 sts 0x1295, r24 ; 0x801295 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 32c50: 40 e0 ldi r20, 0x00 ; 0 32c52: 60 e0 ldi r22, 0x00 ; 0 32c54: ce 01 movw r24, r28 32c56: 01 96 adiw r24, 0x01 ; 1 32c58: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 32c5c: 85 e0 ldi r24, 0x05 ; 5 32c5e: fe 01 movw r30, r28 32c60: 31 96 adiw r30, 0x01 ; 1 32c62: a7 e9 ldi r26, 0x97 ; 151 32c64: b2 e1 ldi r27, 0x12 ; 18 32c66: 01 90 ld r0, Z+ 32c68: 0d 92 st X+, r0 32c6a: 8a 95 dec r24 32c6c: e1 f7 brne .-8 ; 0x32c66 32c6e: 82 e0 ldi r24, 0x02 ; 2 32c70: b9 cf rjmp .-142 ; 0x32be4 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 32c72: 83 e0 ldi r24, 0x03 ; 3 32c74: b7 cf rjmp .-146 ; 0x32be4 00032c76 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 32c76: 1f 93 push r17 32c78: cf 93 push r28 32c7a: df 93 push r29 32c7c: 00 d0 rcall .+0 ; 0x32c7e 32c7e: 1f 92 push r1 32c80: 1f 92 push r1 32c82: cd b7 in r28, 0x3d ; 61 32c84: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 32c86: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 32c8a: 81 11 cpse r24, r1 32c8c: 2a c0 rjmp .+84 ; 0x32ce2 auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 32c8e: 10 91 fc 12 lds r17, 0x12FC ; 0x8012fc 32c92: 1f 3f cpi r17, 0xFF ; 255 32c94: 91 f5 brne .+100 ; 0x32cfa btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 32c96: 80 91 fb 12 lds r24, 0x12FB ; 0x8012fb 32c9a: 81 11 cpse r24, r1 32c9c: 60 c0 rjmp .+192 ; 0x32d5e 32c9e: 1f 3f cpi r17, 0xFF ; 255 32ca0: b9 f0 breq .+46 ; 0x32cd0 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 32ca2: 81 e0 ldi r24, 0x01 ; 1 32ca4: 90 e0 ldi r25, 0x00 ; 0 32ca6: 90 93 93 12 sts 0x1293, r25 ; 0x801293 32caa: 80 93 92 12 sts 0x1292, r24 ; 0x801292 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 32cae: 90 93 fa 12 sts 0x12FA, r25 ; 0x8012fa 32cb2: 80 93 f9 12 sts 0x12F9, r24 ; 0x8012f9 lastErrorSource = ErrorSource::ErrorSourceNone; 32cb6: 8f ef ldi r24, 0xFF ; 255 32cb8: 80 93 fb 12 sts 0x12FB, r24 ; 0x8012fb // 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) { 32cbc: 13 30 cpi r17, 0x03 ; 3 32cbe: 09 f4 brne .+2 ; 0x32cc2 32cc0: 82 c0 rjmp .+260 ; 0x32dc6 32cc2: f8 f0 brcs .+62 ; 0x32d02 32cc4: 16 30 cpi r17, 0x06 ; 6 32cc6: 08 f4 brcc .+2 ; 0x32cca 32cc8: 7b c0 rjmp .+246 ; 0x32dc0 32cca: 17 30 cpi r17, 0x07 ; 7 32ccc: 09 f4 brne .+2 ; 0x32cd0 32cce: 7f c0 rjmp .+254 ; 0x32dce // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 32cd0: 0f 90 pop r0 32cd2: 0f 90 pop r0 32cd4: 0f 90 pop r0 32cd6: 0f 90 pop r0 32cd8: 0f 90 pop r0 32cda: df 91 pop r29 32cdc: cf 91 pop r28 32cde: 1f 91 pop r17 32ce0: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 32ce2: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32ce6: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32cea: 0f 94 62 51 call 0x2a2c4 ; 0x2a2c4 32cee: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 32cf0: 10 92 44 0d sts 0x0D44, r1 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.451> 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) { 32cf4: 8f 3f cpi r24, 0xFF ; 255 32cf6: 79 f6 brne .-98 ; 0x32c96 32cf8: ca cf rjmp .-108 ; 0x32c8e btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 32cfa: 8f ef ldi r24, 0xFF ; 255 32cfc: 80 93 fc 12 sts 0x12FC, r24 ; 0x8012fc 32d00: ca cf rjmp .-108 ; 0x32c96 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 32d02: 81 e8 ldi r24, 0x81 ; 129 32d04: 9f e9 ldi r25, 0x9F ; 159 32d06: 0e 94 94 7a call 0xf528 ; 0xf528 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 32d0a: 81 2f mov r24, r17 32d0c: 90 e0 ldi r25, 0x00 ; 0 32d0e: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 32d12: 0f 94 05 9c call 0x3380a ; 0x3380a if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 32d16: 80 91 fb 12 lds r24, 0x12FB ; 0x8012fb 32d1a: 81 30 cpi r24, 0x01 ; 1 32d1c: 89 f4 brne .+34 ; 0x32d40 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 32d1e: 8a e7 ldi r24, 0x7A ; 122 32d20: 9f e9 ldi r25, 0x9F ; 159 32d22: 0f 94 c0 4e call 0x29d80 ; 0x29d80 void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 32d26: 41 2f mov r20, r17 32d28: 62 e4 ldi r22, 0x42 ; 66 32d2a: ce 01 movw r24, r28 32d2c: 01 96 adiw r24, 0x01 ; 1 32d2e: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 32d32: 49 81 ldd r20, Y+1 ; 0x01 32d34: 5a 81 ldd r21, Y+2 ; 0x02 32d36: 6b 81 ldd r22, Y+3 ; 0x03 32d38: 7c 81 ldd r23, Y+4 ; 0x04 32d3a: 8d 81 ldd r24, Y+5 ; 0x05 32d3c: 0f 94 d6 94 call 0x329ac ; 0x329ac } // 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) { 32d40: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32d44: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32d48: 84 30 cpi r24, 0x04 ; 4 32d4a: 20 e8 ldi r18, 0x80 ; 128 32d4c: 92 07 cpc r25, r18 32d4e: 21 f0 breq .+8 ; 0x32d58 32d50: 89 30 cpi r24, 0x09 ; 9 32d52: 90 48 sbci r25, 0x80 ; 128 32d54: 09 f0 breq .+2 ; 0x32d58 32d56: bc cf rjmp .-136 ; 0x32cd0 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 32d58: 0f 94 e0 5a call 0x2b5c0 ; 0x2b5c0 32d5c: b9 cf rjmp .-142 ; 0x32cd0 // 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) { 32d5e: 19 30 cpi r17, 0x09 ; 9 32d60: 08 f0 brcs .+2 ; 0x32d64 32d62: b6 cf rjmp .-148 ; 0x32cd0 32d64: e1 2f mov r30, r17 32d66: f0 e0 ldi r31, 0x00 ; 0 32d68: 88 27 eor r24, r24 32d6a: e6 54 subi r30, 0x46 ; 70 32d6c: f9 46 sbci r31, 0x69 ; 105 32d6e: 8e 4f sbci r24, 0xFE ; 254 32d70: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 32d74: 28 38 cpi r18, 0x88 ; 136 32d76: 28 38 cpi r18, 0x88 ; 136 32d78: 28 38 cpi r18, 0x88 ; 136 32d7a: 38 37 cpi r19, 0x78 ; 120 32d7c: d2 37 cpi r29, 0x72 ; 114 32d7e: d2 37 cpi r29, 0x72 ; 114 32d80: 94 37 cpi r25, 0x74 ; 116 32d82: ec 37 cpi r30, 0x7C ; 124 32d84: b4 38 cpi r27, 0x84 ; 132 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 32d86: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32d8a: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32d8e: 87 38 cpi r24, 0x87 ; 135 32d90: 20 e8 ldi r18, 0x80 ; 128 32d92: 92 07 cpc r25, r18 32d94: 21 f0 breq .+8 ; 0x32d9e 32d96: 87 30 cpi r24, 0x07 ; 7 32d98: 91 48 sbci r25, 0x81 ; 129 32d9a: 09 f0 breq .+2 ; 0x32d9e 32d9c: 99 cf rjmp .-206 ; 0x32cd0 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 32d9e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 32da2: 84 30 cpi r24, 0x04 ; 4 32da4: 21 f4 brne .+8 ; 0x32dae ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 32da6: 80 91 97 12 lds r24, 0x1297 ; 0x801297 32daa: 81 11 cpse r24, r1 32dac: 91 cf rjmp .-222 ; 0x32cd0 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 32dae: 81 e0 ldi r24, 0x01 ; 1 32db0: 80 93 43 0d sts 0x0D43, r24 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.452> menu_submenu(tuneIdlerStallguardThresholdMenu); 32db4: 60 e0 ldi r22, 0x00 ; 0 32db6: 86 e8 ldi r24, 0x86 ; 134 32db8: 98 e3 ldi r25, 0x38 ; 56 32dba: 0e 94 ad 62 call 0xc55a ; 0xc55a 32dbe: 88 cf rjmp .-240 ; 0x32cd0 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 32dc0: 10 93 ff 12 sts 0x12FF, r17 ; 0x8012ff 32dc4: 85 cf rjmp .-246 ; 0x32cd0 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 32dc6: 80 e0 ldi r24, 0x00 ; 0 32dc8: 0f 94 00 95 call 0x32a00 ; 0x32a00 32dcc: 81 cf rjmp .-254 ; 0x32cd0 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 32dce: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 32dd2: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 32dd6: 10 92 94 12 sts 0x1294, r1 ; 0x801294 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 32dda: 60 e0 ldi r22, 0x00 ; 0 32ddc: 8c ea ldi r24, 0xAC ; 172 32dde: 9c e0 ldi r25, 0x0C ; 12 32de0: 0f 94 c1 a3 call 0x34782 ; 0x34782 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 32de4: 0f 94 85 65 call 0x2cb0a ; 0x2cb0a 32de8: 73 cf rjmp .-282 ; 0x32cd0 00032dea : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 32dea: 4f 92 push r4 32dec: 5f 92 push r5 32dee: 6f 92 push r6 32df0: 7f 92 push r7 32df2: 8f 92 push r8 32df4: 9f 92 push r9 32df6: af 92 push r10 32df8: bf 92 push r11 32dfa: cf 92 push r12 32dfc: df 92 push r13 32dfe: ef 92 push r14 32e00: ff 92 push r15 32e02: 0f 93 push r16 32e04: 1f 93 push r17 32e06: cf 93 push r28 32e08: df 93 push r29 32e0a: cd b7 in r28, 0x3d ; 61 32e0c: de b7 in r29, 0x3e ; 62 32e0e: a0 97 sbiw r28, 0x20 ; 32 32e10: 0f b6 in r0, 0x3f ; 63 32e12: f8 94 cli 32e14: de bf out 0x3e, r29 ; 62 32e16: 0f be out 0x3f, r0 ; 63 32e18: cd bf out 0x3d, r28 ; 61 32e1a: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 32e1c: 0f 94 3b 96 call 0x32c76 ; 0x32c76 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 32e20: 80 91 95 12 lds r24, 0x1295 ; 0x801295 32e24: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 32e26: 0f 94 51 94 call 0x328a2 ; 0x328a2 32e2a: 90 91 95 12 lds r25, 0x1295 ; 0x801295 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 32e2e: 97 ff sbrs r25, 7 32e30: 7d c0 rjmp .+250 ; 0x32f2c // we are waiting for something switch (currentScope) { 32e32: 80 91 94 12 lds r24, 0x1294 ; 0x801294 32e36: 82 30 cpi r24, 0x02 ; 2 32e38: b1 f0 breq .+44 ; 0x32e66 32e3a: 08 f4 brcc .+2 ; 0x32e3e 32e3c: 75 c0 rjmp .+234 ; 0x32f28 32e3e: 83 30 cpi r24, 0x03 ; 3 32e40: e1 f1 breq .+120 ; 0x32eba 32e42: 84 30 cpi r24, 0x04 ; 4 32e44: 09 f4 brne .+2 ; 0x32e48 32e46: 54 c0 rjmp .+168 ; 0x32ef0 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 32e48: 0f 94 51 94 call 0x328a2 ; 0x328a2 32e4c: 81 11 cpse r24, r1 32e4e: 6b c3 rjmp .+1750 ; 0x33526 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 32e50: 82 e0 ldi r24, 0x02 ; 2 32e52: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::Idle; 32e56: 83 e0 ldi r24, 0x03 ; 3 32e58: 80 93 94 12 sts 0x1294, r24 ; 0x801294 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 32e5c: 82 e8 ldi r24, 0x82 ; 130 32e5e: 80 93 95 12 sts 0x1295, r24 ; 0x801295 // 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()) { 32e62: 12 e0 ldi r17, 0x02 ; 2 32e64: db c2 rjmp .+1462 ; 0x3341c IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 32e66: 0f 94 56 0b call 0x216ac ; 0x216ac 32e6a: ab 01 movw r20, r22 32e6c: bc 01 movw r22, r24 32e6e: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 32e72: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 32e76: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 32e7a: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 32e7e: 88 51 subi r24, 0x18 ; 24 32e80: 9c 4f sbci r25, 0xFC ; 252 32e82: af 4f sbci r26, 0xFF ; 255 32e84: 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 32e86: 48 17 cp r20, r24 32e88: 59 07 cpc r21, r25 32e8a: 6a 07 cpc r22, r26 32e8c: 7b 07 cpc r23, r27 32e8e: 08 f4 brcc .+2 ; 0x32e92 32e90: 4b c0 rjmp .+150 ; 0x32f28 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 32e92: 84 e7 ldi r24, 0x74 ; 116 32e94: 92 e1 ldi r25, 0x12 ; 18 32e96: 0f 94 c9 a1 call 0x34392 ; 0x34392 while (uart->read() != -1) 32e9a: 01 96 adiw r24, 0x01 ; 1 32e9c: d1 f7 brne .-12 ; 0x32e92 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 32e9e: 81 e0 ldi r24, 0x01 ; 1 32ea0: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::StartSeq; 32ea4: 80 93 94 12 sts 0x1294, r24 ; 0x801294 32ea8: 10 92 b6 12 sts 0x12B6, r1 ; 0x8012b6 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 32eac: 86 e0 ldi r24, 0x06 ; 6 32eae: 80 93 96 12 sts 0x1296, r24 ; 0x801296 SendVersion(0); 32eb2: 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); 32eb4: 0f 94 1c 95 call 0x32a38 ; 0x32a38 32eb8: 37 c0 rjmp .+110 ; 0x32f28 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 32eba: 92 38 cpi r25, 0x82 ; 130 32ebc: 29 f6 brne .-118 ; 0x32e48 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 32ebe: 0f 94 56 0b call 0x216ac ; 0x216ac 32ec2: ab 01 movw r20, r22 32ec4: bc 01 movw r22, r24 32ec6: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 32eca: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 32ece: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 32ed2: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 32ed6: 88 51 subi r24, 0x18 ; 24 32ed8: 9c 4f sbci r25, 0xFC ; 252 32eda: af 4f sbci r26, 0xFF ; 255 32edc: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 32ede: 48 17 cp r20, r24 32ee0: 59 07 cpc r21, r25 32ee2: 6a 07 cpc r22, r26 32ee4: 7b 07 cpc r23, r27 32ee6: 08 f4 brcc .+2 ; 0x32eea 32ee8: af cf rjmp .-162 ; 0x32e48 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 32eea: 0f 94 8f 95 call 0x32b1e ; 0x32b1e 32eee: 1c c0 rjmp .+56 ; 0x32f28 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 32ef0: 0f 94 56 0b call 0x216ac ; 0x216ac 32ef4: ab 01 movw r20, r22 32ef6: bc 01 movw r22, r24 32ef8: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 32efc: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 32f00: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 32f04: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 32f08: 88 51 subi r24, 0x18 ; 24 32f0a: 9c 4f sbci r25, 0xFC ; 252 32f0c: af 4f sbci r26, 0xFF ; 255 32f0e: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 32f10: 48 17 cp r20, r24 32f12: 59 07 cpc r21, r25 32f14: 6a 07 cpc r22, r26 32f16: 7b 07 cpc r23, r27 32f18: 40 f7 brcc .-48 ; 0x32eea }; 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(); 32f1a: 0f 94 d0 4e call 0x29da0 ; 0x29da0 if (fs != lastFSensor) { 32f1e: 90 91 d6 12 lds r25, 0x12D6 ; 0x8012d6 32f22: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 32f24: 0f 94 ae 95 call 0x32b5c ; 0x32b5c // 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; 32f28: 10 e0 ldi r17, 0x00 ; 0 32f2a: 78 c2 rjmp .+1264 ; 0x3341c StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 32f2c: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 32f2e: d1 2c mov r13, r1 32f30: 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; 32f32: 99 24 eor r9, r9 32f34: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 32f36: 55 e0 ldi r21, 0x05 ; 5 32f38: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 32f3a: 63 e0 ldi r22, 0x03 ; 3 32f3c: 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; 32f3e: 74 e0 ldi r23, 0x04 ; 4 32f40: 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; 32f42: e2 e0 ldi r30, 0x02 ; 2 32f44: 6e 2e mov r6, r30 32f46: 66 c0 rjmp .+204 ; 0x33014 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 32f48: 23 30 cpi r18, 0x03 ; 3 32f4a: 09 f4 brne .+2 ; 0x32f4e 32f4c: e0 c0 rjmp .+448 ; 0x3310e 32f4e: 24 30 cpi r18, 0x04 ; 4 32f50: 09 f0 breq .+2 ; 0x32f54 32f52: 83 c0 rjmp .+262 ; 0x3305a } 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'); 32f54: 20 ed ldi r18, 0xD0 ; 208 32f56: 28 0f add r18, r24 32f58: 2a 30 cpi r18, 0x0A ; 10 32f5a: 08 f4 brcc .+2 ; 0x32f5e 32f5c: f8 c0 rjmp .+496 ; 0x3314e 32f5e: 2f e9 ldi r18, 0x9F ; 159 32f60: 28 0f add r18, r24 32f62: 26 30 cpi r18, 0x06 ; 6 32f64: 08 f4 brcc .+2 ; 0x32f68 32f66: f3 c0 rjmp .+486 ; 0x3314e ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 32f68: 8a 30 cpi r24, 0x0A ; 10 32f6a: 09 f0 breq .+2 ; 0x32f6e 32f6c: fa c0 rjmp .+500 ; 0x33162 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()) { 32f6e: 40 90 bb 12 lds r4, 0x12BB ; 0x8012bb 32f72: 87 eb ldi r24, 0xB7 ; 183 32f74: 92 e1 ldi r25, 0x12 ; 18 32f76: 0f 94 7c 4e call 0x29cf8 ; 0x29cf8 32f7a: 48 12 cpse r4, r24 32f7c: b8 c0 rjmp .+368 ; 0x330ee // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 32f7e: 10 92 b6 12 sts 0x12B6, r1 ; 0x8012b6 /// @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; } 32f82: 88 e0 ldi r24, 0x08 ; 8 32f84: e7 eb ldi r30, 0xB7 ; 183 32f86: f2 e1 ldi r31, 0x12 ; 18 32f88: de 01 movw r26, r28 32f8a: 51 96 adiw r26, 0x11 ; 17 32f8c: 01 90 ld r0, Z+ 32f8e: 0d 92 st X+, r0 32f90: 8a 95 dec r24 32f92: e1 f7 brne .-8 ; 0x32f8c 32f94: 88 e0 ldi r24, 0x08 ; 8 32f96: fe 01 movw r30, r28 32f98: 71 96 adiw r30, 0x11 ; 17 32f9a: de 01 movw r26, r28 32f9c: 59 96 adiw r26, 0x19 ; 25 32f9e: 01 90 ld r0, Z+ 32fa0: 0d 92 st X+, r0 32fa2: 8a 95 dec r24 32fa4: e1 f7 brne .-8 ; 0x32f9e while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 32fa6: 88 e0 ldi r24, 0x08 ; 8 32fa8: fe 01 movw r30, r28 32faa: 79 96 adiw r30, 0x19 ; 25 32fac: a7 ea ldi r26, 0xA7 ; 167 32fae: b2 e1 ldi r27, 0x12 ; 18 32fb0: 01 90 ld r0, Z+ 32fb2: 0d 92 st X+, r0 32fb4: 8a 95 dec r24 32fb6: e1 f7 brne .-8 ; 0x32fb0 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 32fb8: 8c e3 ldi r24, 0x3C ; 60 32fba: 89 83 std Y+1, r24 ; 0x01 32fbc: fe 01 movw r30, r28 32fbe: 32 96 adiw r30, 0x02 ; 2 32fc0: af eb ldi r26, 0xBF ; 191 32fc2: b2 e1 ldi r27, 0x12 ; 18 for (uint8_t i = 0; i < lrb; ++i) { 32fc4: 20 e0 ldi r18, 0x00 ; 0 32fc6: cf 01 movw r24, r30 32fc8: 52 16 cp r5, r18 32fca: 09 f4 brne .+2 ; 0x32fce 32fcc: cd c0 rjmp .+410 ; 0x33168 uint8_t b = lastReceivedBytes[i]; 32fce: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 32fd0: 40 ee ldi r20, 0xE0 ; 224 32fd2: 43 0f add r20, r19 32fd4: 40 36 cpi r20, 0x60 ; 96 32fd6: 08 f0 brcs .+2 ; 0x32fda b = '.'; 32fd8: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 32fda: 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) { 32fdc: 2f 5f subi r18, 0xFF ; 255 32fde: f4 cf rjmp .-24 ; 0x32fc8 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 32fe0: 8e 34 cpi r24, 0x4E ; 78 32fe2: 08 f0 brcs .+2 ; 0x32fe6 32fe4: 56 c0 rjmp .+172 ; 0x33092 32fe6: 8b 34 cpi r24, 0x4B ; 75 32fe8: 08 f0 brcs .+2 ; 0x32fec 32fea: 46 c0 rjmp .+140 ; 0x33078 32fec: 82 34 cpi r24, 0x42 ; 66 32fee: 09 f4 brne .+2 ; 0x32ff2 32ff0: 43 c0 rjmp .+134 ; 0x33078 32ff2: e0 f5 brcc .+120 ; 0x3306c 32ff4: 8a 30 cpi r24, 0x0A ; 10 32ff6: 59 f0 breq .+22 ; 0x3300e 32ff8: 8d 30 cpi r24, 0x0D ; 13 32ffa: 49 f0 breq .+18 ; 0x3300e } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 32ffc: b0 92 b6 12 sts 0x12B6, r11 ; 0x8012b6 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') { 33000: a1 10 cpse r10, r1 33002: 05 c1 rjmp .+522 ; 0x3320e 33004: 1f 36 cpi r17, 0x6F ; 111 33006: 09 f0 breq .+2 ; 0x3300a 33008: fa c3 rjmp .+2036 ; 0x337fe ++ok; 3300a: aa 24 eor r10, r10 3300c: 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; 3300e: 4f ef ldi r20, 0xFF ; 255 33010: c4 1a sub r12, r20 33012: d4 0a sbc r13, r20 33014: 84 e7 ldi r24, 0x74 ; 116 33016: 92 e1 ldi r25, 0x12 ; 18 33018: 0f 94 c9 a1 call 0x34392 ; 0x34392 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) { 3301c: 97 fd sbrc r25, 7 3301e: 00 c1 rjmp .+512 ; 0x33220 ++bytesConsumed; RecordReceivedByte(c); 33020: 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]; 33022: 20 91 cf 12 lds r18, 0x12CF ; 0x8012cf 33026: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 33028: f9 01 movw r30, r18 3302a: ee 56 subi r30, 0x6E ; 110 3302c: fd 4e sbci r31, 0xED ; 237 3302e: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 33030: 79 01 movw r14, r18 33032: ef ef ldi r30, 0xFF ; 255 33034: ee 1a sub r14, r30 33036: fe 0a sbc r15, r30 33038: ff e0 ldi r31, 0x0F ; 15 3303a: ef 22 and r14, r31 3303c: ff 24 eor r15, r15 3303e: 5e 2c mov r5, r14 33040: e0 92 cf 12 sts 0x12CF, r14 ; 0x8012cf ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 33044: 20 91 b6 12 lds r18, 0x12B6 ; 0x8012b6 33048: 22 30 cpi r18, 0x02 ; 2 3304a: 09 f4 brne .+2 ; 0x3304e 3304c: 48 c0 rjmp .+144 ; 0x330de 3304e: 08 f0 brcs .+2 ; 0x33052 33050: 7b cf rjmp .-266 ; 0x32f48 33052: 22 23 and r18, r18 33054: 29 f2 breq .-118 ; 0x32fe0 33056: 21 30 cpi r18, 0x01 ; 1 33058: 51 f1 breq .+84 ; 0x330ae ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 3305a: 1a 30 cpi r17, 0x0A ; 10 3305c: 09 f4 brne .+2 ; 0x33060 3305e: 8f cf rjmp .-226 ; 0x32f7e 33060: 1d 30 cpi r17, 0x0D ; 13 33062: 09 f4 brne .+2 ; 0x33066 33064: 8c cf rjmp .-232 ; 0x32f7e default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 33066: 10 92 bc 12 sts 0x12BC, r1 ; 0x8012bc 3306a: ca cf rjmp .-108 ; 0x33000 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 3306c: 85 34 cpi r24, 0x45 ; 69 3306e: 30 f2 brcs .-116 ; 0x32ffc 33070: 87 34 cpi r24, 0x47 ; 71 33072: 10 f0 brcs .+4 ; 0x33078 33074: 88 34 cpi r24, 0x48 ; 72 33076: 11 f6 brne .-124 ; 0x32ffc case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 33078: 80 93 b7 12 sts 0x12B7, r24 ; 0x8012b7 responseMsg.request.value = 0; 3307c: 10 92 b8 12 sts 0x12B8, r1 ; 0x8012b8 responseMsg.request.value2 = 0; 33080: 10 92 ba 12 sts 0x12BA, r1 ; 0x8012ba 33084: 10 92 b9 12 sts 0x12B9, r1 ; 0x8012b9 responseMsg.request.crc8 = 0; 33088: 10 92 bb 12 sts 0x12BB, r1 ; 0x8012bb rspState = ResponseStates::RequestValue; 3308c: 90 92 b6 12 sts 0x12B6, r9 ; 0x8012b6 33090: be cf rjmp .-132 ; 0x3300e } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33092: 89 35 cpi r24, 0x59 ; 89 33094: 40 f4 brcc .+16 ; 0x330a6 33096: 87 35 cpi r24, 0x57 ; 87 33098: 78 f7 brcc .-34 ; 0x33078 3309a: 20 eb ldi r18, 0xB0 ; 176 3309c: 28 0f add r18, r24 3309e: 26 30 cpi r18, 0x06 ; 6 330a0: 08 f0 brcs .+2 ; 0x330a4 330a2: ac cf rjmp .-168 ; 0x32ffc 330a4: e9 cf rjmp .-46 ; 0x33078 330a6: 86 36 cpi r24, 0x66 ; 102 330a8: 09 f0 breq .+2 ; 0x330ac 330aa: a8 cf rjmp .-176 ; 0x32ffc 330ac: e5 cf rjmp .-54 ; 0x33078 } 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'); 330ae: 20 ed ldi r18, 0xD0 ; 208 330b0: 28 0f add r18, r24 330b2: 2a 30 cpi r18, 0x0A ; 10 330b4: 50 f0 brcs .+20 ; 0x330ca 330b6: 2f e9 ldi r18, 0x9F ; 159 330b8: 28 0f add r18, r24 330ba: 26 30 cpi r18, 0x06 ; 6 330bc: 30 f0 brcs .+12 ; 0x330ca case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 330be: 80 32 cpi r24, 0x20 ; 32 330c0: 09 f0 breq .+2 ; 0x330c4 330c2: 9c cf rjmp .-200 ; 0x32ffc rspState = ResponseStates::ParamCode; 330c4: 60 92 b6 12 sts 0x12B6, r6 ; 0x8012b6 330c8: a2 cf rjmp .-188 ; 0x3300e return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 330ca: 0f 94 5b 4e call 0x29cb6 ; 0x29cb6 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 330ce: 90 91 b8 12 lds r25, 0x12B8 ; 0x8012b8 330d2: 92 95 swap r25 330d4: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 330d6: 89 0f add r24, r25 330d8: 80 93 b8 12 sts 0x12B8, r24 ; 0x8012b8 330dc: 98 cf rjmp .-208 ; 0x3300e } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 330de: 87 34 cpi r24, 0x47 ; 71 330e0: 48 f4 brcc .+18 ; 0x330f4 330e2: 85 34 cpi r24, 0x45 ; 69 330e4: 58 f4 brcc .+22 ; 0x330fc 330e6: 2f eb ldi r18, 0xBF ; 191 330e8: 28 0f add r18, r24 330ea: 22 30 cpi r18, 0x02 ; 2 330ec: 38 f0 brcs .+14 ; 0x330fc return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 330ee: 10 92 bc 12 sts 0x12BC, r1 ; 0x8012bc 330f2: 84 cf rjmp .-248 ; 0x32ffc } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 330f4: 80 35 cpi r24, 0x50 ; 80 330f6: 11 f0 breq .+4 ; 0x330fc 330f8: 82 35 cpi r24, 0x52 ; 82 330fa: c9 f7 brne .-14 ; 0x330ee case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 330fc: 80 92 b6 12 sts 0x12B6, r8 ; 0x8012b6 responseMsg.paramCode = (ResponseMsgParamCodes)c; 33100: 80 93 bc 12 sts 0x12BC, r24 ; 0x8012bc responseMsg.paramValue = 0; 33104: 10 92 be 12 sts 0x12BE, r1 ; 0x8012be 33108: 10 92 bd 12 sts 0x12BD, r1 ; 0x8012bd 3310c: 80 cf rjmp .-256 ; 0x3300e 3310e: 20 ed ldi r18, 0xD0 ; 208 33110: 28 0f add r18, r24 33112: 2a 30 cpi r18, 0x0A ; 10 33114: 48 f0 brcs .+18 ; 0x33128 33116: 2f e9 ldi r18, 0x9F ; 159 33118: 28 0f add r18, r24 3311a: 26 30 cpi r18, 0x06 ; 6 3311c: 28 f0 brcs .+10 ; 0x33128 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 3311e: 8a 32 cpi r24, 0x2A ; 42 33120: 31 f7 brne .-52 ; 0x330ee rspState = ResponseStates::CRC; 33122: 70 92 b6 12 sts 0x12B6, r7 ; 0x8012b6 33126: 73 cf rjmp .-282 ; 0x3300e return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 33128: 0f 94 5b 4e call 0x29cb6 ; 0x29cb6 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 3312c: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd 33130: 30 91 be 12 lds r19, 0x12BE ; 0x8012be 33134: 44 e0 ldi r20, 0x04 ; 4 33136: 22 0f add r18, r18 33138: 33 1f adc r19, r19 3313a: 4a 95 dec r20 3313c: e1 f7 brne .-8 ; 0x33136 responseMsg.paramValue += Char2Nibble(c); 3313e: 82 0f add r24, r18 33140: 93 2f mov r25, r19 33142: 91 1d adc r25, r1 33144: 90 93 be 12 sts 0x12BE, r25 ; 0x8012be 33148: 80 93 bd 12 sts 0x12BD, r24 ; 0x8012bd 3314c: 60 cf rjmp .-320 ; 0x3300e return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 3314e: 0f 94 5b 4e call 0x29cb6 ; 0x29cb6 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 33152: 90 91 bb 12 lds r25, 0x12BB ; 0x8012bb 33156: 92 95 swap r25 33158: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 3315a: 89 0f add r24, r25 3315c: 80 93 bb 12 sts 0x12BB, r24 ; 0x8012bb 33160: 56 cf rjmp .-340 ; 0x3300e ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 33162: 8d 30 cpi r24, 0x0D ; 13 33164: 21 f6 brne .-120 ; 0x330ee 33166: 03 cf rjmp .-506 ; 0x32f6e if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 33168: e8 0e add r14, r24 3316a: f9 1e adc r15, r25 3316c: f7 01 movw r30, r14 3316e: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 33170: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 33174: 8e ec ldi r24, 0xCE ; 206 33176: 91 ea ldi r25, 0xA1 ; 161 33178: 0e 94 94 7a call 0xf528 ; 0xf528 3317c: 88 ec ldi r24, 0xC8 ; 200 3317e: 91 ea ldi r25, 0xA1 ; 161 33180: 0e 94 94 7a call 0xf528 ; 0xf528 33184: ce 01 movw r24, r28 33186: 01 96 adiw r24, 0x01 ; 1 33188: 0e 94 92 85 call 0x10b24 ; 0x10b24 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 3318c: 0f 94 2a 56 call 0x2ac54 ; 0x2ac54 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 33190: 80 91 94 12 lds r24, 0x1294 ; 0x801294 33194: 81 30 cpi r24, 0x01 ; 1 33196: 09 f4 brne .+2 ; 0x3319a 33198: 74 c0 rjmp .+232 ; 0x33282 3319a: 08 f4 brcc .+2 ; 0x3319e 3319c: c5 ce rjmp .-630 ; 0x32f28 3319e: 83 30 cpi r24, 0x03 ; 3 331a0: 09 f4 brne .+2 ; 0x331a4 331a2: d1 c0 rjmp .+418 ; 0x33346 331a4: 84 30 cpi r24, 0x04 ; 4 331a6: 09 f0 breq .+2 ; 0x331aa 331a8: 4f ce rjmp .-866 ; 0x32e48 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 331aa: 80 91 95 12 lds r24, 0x1295 ; 0x801295 331ae: 86 30 cpi r24, 0x06 ; 6 331b0: 09 f4 brne .+2 ; 0x331b4 331b2: 6c c1 rjmp .+728 ; 0x3348c 331b4: 08 f0 brcs .+2 ; 0x331b8 331b6: 93 c1 rjmp .+806 ; 0x334de 331b8: 84 30 cpi r24, 0x04 ; 4 331ba: 09 f4 brne .+2 ; 0x331be 331bc: 09 c1 rjmp .+530 ; 0x333d0 331be: 85 30 cpi r24, 0x05 ; 5 331c0: 09 f0 breq .+2 ; 0x331c4 331c2: cc c0 rjmp .+408 ; 0x3335c case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 331c4: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 331c8: 81 34 cpi r24, 0x41 ; 65 331ca: 09 f4 brne .+2 ; 0x331ce 331cc: 96 c1 rjmp .+812 ; 0x334fa 331ce: 82 35 cpi r24, 0x52 ; 82 331d0: 09 f0 breq .+2 ; 0x331d4 331d2: c4 c0 rjmp .+392 ; 0x3335c errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 331d4: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::PROTOCOL_ERROR; 331d8: 8d e2 ldi r24, 0x2D ; 45 331da: 90 e8 ldi r25, 0x80 ; 128 331dc: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 331e0: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 } 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")); 331e4: 8a ee ldi r24, 0xEA ; 234 331e6: 9e e9 ldi r25, 0x9E ; 158 331e8: 0f 94 47 56 call 0x2ac8e ; 0x2ac8e void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 331ec: 85 e0 ldi r24, 0x05 ; 5 331ee: 80 93 95 12 sts 0x1295, r24 ; 0x801295 SendMsg(rq); 331f2: 40 91 97 12 lds r20, 0x1297 ; 0x801297 331f6: 50 91 98 12 lds r21, 0x1298 ; 0x801298 331fa: 60 91 99 12 lds r22, 0x1299 ; 0x801299 331fe: 70 91 9a 12 lds r23, 0x129A ; 0x80129a 33202: 80 91 9b 12 lds r24, 0x129B ; 0x80129b 33206: 0f 94 30 57 call 0x2ae60 ; 0x2ae60 3320a: 16 e0 ldi r17, 0x06 ; 6 3320c: 07 c1 rjmp .+526 ; 0x3341c 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') { 3320e: 1b 36 cpi r17, 0x6B ; 107 33210: 09 f0 breq .+2 ; 0x33214 33212: f5 c2 rjmp .+1514 ; 0x337fe 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")); 33214: 8b ec ldi r24, 0xCB ; 203 33216: 9e e9 ldi r25, 0x9E ; 158 33218: 0f 94 47 56 call 0x2ac8e ; 0x2ac8e 3321c: 18 e0 ldi r17, 0x08 ; 8 3321e: fe c0 rjmp .+508 ; 0x3341c default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 33220: cd 28 or r12, r13 33222: 19 f0 breq .+6 ; 0x3322a RecordUARTActivity(); // something has happened on the UART, update the timeout record 33224: 0f 94 2a 56 call 0x2ac54 ; 0x2ac54 33228: 7f ce rjmp .-770 ; 0x32f28 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3322a: 0f 94 56 0b call 0x216ac ; 0x216ac 3322e: ab 01 movw r20, r22 33230: bc 01 movw r22, r24 33232: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 33236: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 3323a: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 3323e: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 33242: 80 53 subi r24, 0x30 ; 48 33244: 98 4f sbci r25, 0xF8 ; 248 33246: af 4f sbci r26, 0xFF ; 255 33248: 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) { 3324a: 48 17 cp r20, r24 3324c: 59 07 cpc r21, r25 3324e: 6a 07 cpc r22, r26 33250: 7b 07 cpc r23, r27 33252: 08 f4 brcc .+2 ; 0x33256 33254: 69 ce rjmp .-814 ; 0x32f28 33256: 80 91 94 12 lds r24, 0x1294 ; 0x801294 3325a: 88 23 and r24, r24 3325c: 09 f4 brne .+2 ; 0x33260 3325e: 64 ce rjmp .-824 ; 0x32f28 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 33260: 10 92 b6 12 sts 0x12B6, r1 ; 0x8012b6 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 33264: 81 e0 ldi r24, 0x01 ; 1 33266: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::StartSeq; 3326a: 80 93 94 12 sts 0x1294, r24 ; 0x801294 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 3326e: 86 e0 ldi r24, 0x06 ; 6 33270: 80 93 96 12 sts 0x1296, r24 ; 0x801296 SendVersion(0); 33274: 80 e0 ldi r24, 0x00 ; 0 33276: 0f 94 1c 95 call 0x32a38 ; 0x32a38 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 3327a: 64 e0 ldi r22, 0x04 ; 4 3327c: 83 ea ldi r24, 0xA3 ; 163 3327e: 9e e9 ldi r25, 0x9E ; 158 33280: 79 c0 rjmp .+242 ; 0x33374 return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 33282: 10 91 95 12 lds r17, 0x1295 ; 0x801295 33286: 13 30 cpi r17, 0x03 ; 3 33288: b1 f1 breq .+108 ; 0x332f6 3328a: 60 f0 brcs .+24 ; 0x332a4 3328c: 16 30 cpi r17, 0x06 ; 6 3328e: 09 f4 brne .+2 ; 0x33292 33290: 50 c0 rjmp .+160 ; 0x33332 33292: 19 30 cpi r17, 0x09 ; 9 33294: 09 f0 breq .+2 ; 0x33298 33296: be cf rjmp .-132 ; 0x33214 // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 33298: 0f 94 5a 58 call 0x2b0b4 ; 0x2b0b4 3329c: 88 23 and r24, r24 3329e: 09 f4 brne .+2 ; 0x332a2 332a0: 43 ce rjmp .-890 ; 0x32f28 332a2: 40 ce rjmp .-896 ; 0x32f24 void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 332a4: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 332a8: 83 35 cpi r24, 0x53 ; 83 332aa: 21 f4 brne .+8 ; 0x332b4 332ac: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 332b0: 18 17 cp r17, r24 332b2: 11 f0 breq .+4 ; 0x332b8 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 332b4: 81 2f mov r24, r17 332b6: fe cd rjmp .-1028 ; 0x32eb4 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; 332b8: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 332bc: e1 2f mov r30, r17 332be: f0 e0 ldi r31, 0x00 ; 0 332c0: df 01 movw r26, r30 332c2: af 51 subi r26, 0x1F ; 31 332c4: bd 4e sbci r27, 0xED ; 237 332c6: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 332c8: e8 53 subi r30, 0x38 ; 56 332ca: f1 46 sbci r31, 0x61 ; 97 332cc: e4 91 lpm r30, Z 332ce: 8e 17 cp r24, r30 332d0: 41 f0 breq .+16 ; 0x332e2 if (--retries == 0) { 332d2: 80 91 96 12 lds r24, 0x1296 ; 0x801296 332d6: 81 50 subi r24, 0x01 ; 1 332d8: 80 93 96 12 sts 0x1296, r24 ; 0x801296 332dc: 81 11 cpse r24, r1 332de: ea cf rjmp .-44 ; 0x332b4 332e0: 99 cf rjmp .-206 ; 0x33214 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 332e2: 81 e6 ldi r24, 0x61 ; 97 332e4: 91 ea ldi r25, 0xA1 ; 161 332e6: 0e 94 8d 7c call 0xf91a ; 0xf91a /// @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; } 332ea: 8a e0 ldi r24, 0x0A ; 10 332ec: 80 93 a6 12 sts 0x12A6, r24 ; 0x8012a6 } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 332f0: 81 e0 ldi r24, 0x01 ; 1 332f2: 81 0f add r24, r17 332f4: df cd rjmp .-1090 ; 0x32eb4 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) { 332f6: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 332fa: 83 35 cpi r24, 0x53 ; 83 332fc: 21 f4 brne .+8 ; 0x33306 332fe: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 33302: 83 30 cpi r24, 0x03 ; 3 33304: 11 f0 breq .+4 ; 0x3330a // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 33306: 83 e0 ldi r24, 0x03 ; 3 33308: d5 cd rjmp .-1110 ; 0x32eb4 } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 3330a: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 3330e: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 33312: 90 93 e5 12 sts 0x12E5, r25 ; 0x8012e5 33316: 80 93 e4 12 sts 0x12E4, r24 ; 0x8012e4 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 3331a: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 3331e: ef e5 ldi r30, 0x5F ; 95 33320: f1 ea ldi r31, 0xA1 ; 161 33322: 84 91 lpm r24, Z 33324: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 33328: 70 e0 ldi r23, 0x00 ; 0 3332a: 49 e0 ldi r20, 0x09 ; 9 3332c: 0f 94 9b 57 call 0x2af36 ; 0x2af36 33330: fb cd rjmp .-1034 ; 0x32f28 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 33332: 82 e0 ldi r24, 0x02 ; 2 33334: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::Idle; 33338: 83 e0 ldi r24, 0x03 ; 3 3333a: 80 93 94 12 sts 0x1294, r24 ; 0x801294 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 3333e: 82 e8 ldi r24, 0x82 ; 130 33340: 80 93 95 12 sts 0x1295, r24 ; 0x801295 33344: d2 cd rjmp .-1116 ; 0x32eea } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 33346: 80 91 95 12 lds r24, 0x1295 ; 0x801295 3334a: 88 30 cpi r24, 0x08 ; 8 3334c: 09 f4 brne .+2 ; 0x33350 3334e: b7 c0 rjmp .+366 ; 0x334be 33350: a8 f4 brcc .+42 ; 0x3337c 33352: 84 30 cpi r24, 0x04 ; 4 33354: d9 f0 breq .+54 ; 0x3338c 33356: 87 30 cpi r24, 0x07 ; 7 33358: 09 f4 brne .+2 ; 0x3335c 3335a: ae c0 rjmp .+348 ; 0x334b8 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 3335c: 81 e0 ldi r24, 0x01 ; 1 3335e: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::DelayedRestart; 33362: 82 e0 ldi r24, 0x02 ; 2 33364: 80 93 94 12 sts 0x1294, r24 ; 0x801294 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 33368: 83 e8 ldi r24, 0x83 ; 131 3336a: 80 93 95 12 sts 0x1295, r24 ; 0x801295 StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 3336e: 65 e0 ldi r22, 0x05 ; 5 33370: 89 eb ldi r24, 0xB9 ; 185 33372: 9e e9 ldi r25, 0x9E ; 158 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 33374: 0f 94 b8 56 call 0x2ad70 ; 0x2ad70 33378: 18 2f mov r17, r24 3337a: 50 c0 rjmp .+160 ; 0x3341c } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 3337c: 8a 30 cpi r24, 0x0A ; 10 3337e: 09 f4 brne .+2 ; 0x33382 33380: a7 c0 rjmp .+334 ; 0x334d0 33382: 60 f3 brcs .-40 ; 0x3335c 33384: 8d 30 cpi r24, 0x0D ; 13 33386: 08 f4 brcc .+2 ; 0x3338a 33388: 5f cd rjmp .-1346 ; 0x32e48 3338a: e8 cf rjmp .-48 ; 0x3335c 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) { 3338c: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 33390: 8e 34 cpi r24, 0x4E ; 78 33392: 60 f5 brcc .+88 ; 0x333ec 33394: 8b 34 cpi r24, 0x4B ; 75 33396: 10 f4 brcc .+4 ; 0x3339c 33398: 85 34 cpi r24, 0x45 ; 69 3339a: 01 f7 brne .-64 ; 0x3335c case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 3339c: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 333a0: 86 34 cpi r24, 0x46 ; 70 333a2: 09 f4 brne .+2 ; 0x333a6 333a4: 73 c0 rjmp .+230 ; 0x3348c return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 333a6: 84 e0 ldi r24, 0x04 ; 4 333a8: 80 93 94 12 sts 0x1294, r24 ; 0x801294 333ac: 85 e0 ldi r24, 0x05 ; 5 333ae: e7 ea ldi r30, 0xA7 ; 167 333b0: f2 e1 ldi r31, 0x12 ; 18 333b2: de 01 movw r26, r28 333b4: 11 96 adiw r26, 0x01 ; 1 333b6: 01 90 ld r0, Z+ 333b8: 0d 92 st X+, r0 333ba: 8a 95 dec r24 333bc: e1 f7 brne .-8 ; 0x333b6 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 333be: 85 e0 ldi r24, 0x05 ; 5 333c0: fe 01 movw r30, r28 333c2: 31 96 adiw r30, 0x01 ; 1 333c4: a7 e9 ldi r26, 0x97 ; 151 333c6: b2 e1 ldi r27, 0x12 ; 18 333c8: 01 90 ld r0, Z+ 333ca: 0d 92 st X+, r0 333cc: 8a 95 dec r24 333ce: e1 f7 brne .-8 ; 0x333c8 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 333d0: 0f 94 d1 95 call 0x32ba2 ; 0x32ba2 333d4: 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) { 333d6: 85 30 cpi r24, 0x05 ; 5 333d8: 09 f2 breq .-126 ; 0x3335c 333da: 08 f0 brcs .+2 ; 0x333de 333dc: 9c c0 rjmp .+312 ; 0x33516 333de: 82 30 cpi r24, 0x02 ; 2 333e0: 09 f4 brne .+2 ; 0x333e4 333e2: 32 cd rjmp .-1436 ; 0x32e48 333e4: 84 30 cpi r24, 0x04 ; 4 333e6: 09 f4 brne .+2 ; 0x333ea 333e8: 3b cf rjmp .-394 ; 0x33260 333ea: 18 c0 rjmp .+48 ; 0x3341c 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) { 333ec: 84 35 cpi r24, 0x54 ; 84 333ee: 08 f4 brcc .+2 ; 0x333f2 333f0: b5 cf rjmp .-150 ; 0x3335c 333f2: 86 35 cpi r24, 0x56 ; 86 333f4: 98 f2 brcs .-90 ; 0x3339c 333f6: 88 35 cpi r24, 0x58 ; 88 333f8: 09 f0 breq .+2 ; 0x333fc 333fa: b0 cf rjmp .-160 ; 0x3335c 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) { 333fc: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 33400: 86 34 cpi r24, 0x46 ; 70 33402: 89 f1 breq .+98 ; 0x33466 33404: 80 35 cpi r24, 0x50 ; 80 33406: c1 f1 breq .+112 ; 0x33478 33408: 82 34 cpi r24, 0x42 ; 66 3340a: 09 f0 breq .+2 ; 0x3340e 3340c: 42 c0 rjmp .+132 ; 0x33492 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); 3340e: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 33412: 80 93 d5 12 sts 0x12D5, r24 ; 0x8012d5 StartReading8bitRegisters(); 33416: 0f 94 11 94 call 0x32822 ; 0x32822 return ButtonPushed; 3341a: 1b e0 ldi r17, 0x0B ; 11 3341c: 80 91 92 12 lds r24, 0x1292 ; 0x801292 33420: 90 91 93 12 lds r25, 0x1293 ; 0x801293 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 33424: 81 30 cpi r24, 0x01 ; 1 33426: 91 05 cpc r25, r1 33428: 09 f0 breq .+2 ; 0x3342c 3342a: ec c1 rjmp .+984 ; 0x33804 const StepStatus ss = logic.Step(); switch (ss) { 3342c: 12 30 cpi r17, 0x02 ; 2 3342e: 09 f4 brne .+2 ; 0x33432 33430: 90 c0 rjmp .+288 ; 0x33552 33432: 08 f0 brcs .+2 ; 0x33436 33434: 7d c0 rjmp .+250 ; 0x33530 33436: 11 23 and r17, r17 33438: 09 f4 brne .+2 ; 0x3343c 3343a: 16 c1 rjmp .+556 ; 0x33668 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 3343c: 00 23 and r16, r16 3343e: 09 f4 brne .+2 ; 0x33442 33440: e2 c0 rjmp .+452 ; 0x33606 switch (ss) { 33442: 17 30 cpi r17, 0x07 ; 7 33444: 09 f4 brne .+2 ; 0x33448 33446: c2 c1 rjmp .+900 ; 0x337cc 33448: 08 f0 brcs .+2 ; 0x3344c 3344a: b6 c1 rjmp .+876 ; 0x337b8 3344c: 14 30 cpi r17, 0x04 ; 4 3344e: 09 f4 brne .+2 ; 0x33452 33450: c5 c1 rjmp .+906 ; 0x337dc 33452: 15 30 cpi r17, 0x05 ; 5 33454: 09 f0 breq .+2 ; 0x33458 33456: d7 c0 rjmp .+430 ; 0x33606 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 33458: 82 e0 ldi r24, 0x02 ; 2 3345a: 80 93 01 13 sts 0x1301, r24 ; 0x801301 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 3345e: 60 e0 ldi r22, 0x00 ; 0 33460: 8d e2 ldi r24, 0x2D ; 45 33462: 90 e8 ldi r25, 0x80 ; 128 33464: b8 c1 rjmp .+880 ; 0x337d6 // 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) { 33466: 80 91 97 12 lds r24, 0x1297 ; 0x801297 3346a: 88 23 and r24, r24 3346c: 29 f0 breq .+10 ; 0x33478 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 3346e: 82 e8 ldi r24, 0x82 ; 130 33470: 80 93 95 12 sts 0x1295, r24 ; 0x801295 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; 33474: 13 e0 ldi r17, 0x03 ; 3 33476: d2 cf rjmp .-92 ; 0x3341c } [[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); 33478: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 3347c: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = ErrorCode::OK; 33480: 81 e0 ldi r24, 0x01 ; 1 33482: 90 e0 ldi r25, 0x00 ; 0 33484: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 33488: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 3348c: 0f 94 11 94 call 0x32822 ; 0x32822 33490: 4b cd rjmp .-1386 ; 0x32f28 // 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; 33492: 8c e0 ldi r24, 0x0C ; 12 33494: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = static_cast(rsp.paramValue); 33498: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 3349c: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 334a0: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 334a4: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 StartReading8bitRegisters(); // continue Idle state without restarting the communication 334a8: 0f 94 11 94 call 0x32822 ; 0x32822 // @@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")); 334ac: 8c ed ldi r24, 0xDC ; 220 334ae: 9e e9 ldi r25, 0x9E ; 158 334b0: 0f 94 47 56 call 0x2ac8e ; 0x2ac8e 334b4: 17 e0 ldi r17, 0x07 ; 7 334b6: b2 cf rjmp .-156 ; 0x3341c return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 334b8: 0f 94 35 94 call 0x3286a ; 0x3286a 334bc: 35 cd rjmp .-1430 ; 0x32f28 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 334be: 82 e8 ldi r24, 0x82 ; 130 334c0: 0f 94 19 94 call 0x32832 ; 0x32832 334c4: 80 93 95 12 sts 0x1295, r24 ; 0x801295 return scopeState == ScopeState::Ready ? Finished : Processing; 334c8: 82 38 cpi r24, 0x82 ; 130 334ca: 09 f0 breq .+2 ; 0x334ce 334cc: 2d cd rjmp .-1446 ; 0x32f28 334ce: bc cc rjmp .-1672 ; 0x32e48 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 334d0: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 334d4: 81 34 cpi r24, 0x41 ; 65 334d6: d1 f6 brne .-76 ; 0x3348c // Button was accepted, decrement the retry. DecrementRetryAttempts(); 334d8: 0f 94 35 56 call 0x2ac6a ; 0x2ac6a 334dc: d7 cf rjmp .-82 ; 0x3348c return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 334de: 88 30 cpi r24, 0x08 ; 8 334e0: b1 f0 breq .+44 ; 0x3350e 334e2: 50 f3 brcs .-44 ; 0x334b8 334e4: 8a 30 cpi r24, 0x0A ; 10 334e6: 09 f0 breq .+2 ; 0x334ea 334e8: 39 cf rjmp .-398 ; 0x3335c return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 334ea: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 334ee: 81 34 cpi r24, 0x41 ; 65 334f0: 09 f0 breq .+2 ; 0x334f4 334f2: 18 cd rjmp .-1488 ; 0x32f24 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 334f4: 0f 94 35 56 call 0x2ac6a ; 0x2ac6a 334f8: 15 cd rjmp .-1494 ; 0x32f24 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; 334fa: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::RUNNING; 334fe: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 33502: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 scopeState = ScopeState::Wait; 33506: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 33508: 80 93 95 12 sts 0x1295, r24 ; 0x801295 3350c: 0d cd rjmp .-1510 ; 0x32f28 3350e: 81 e8 ldi r24, 0x81 ; 129 33510: 0f 94 19 94 call 0x32832 ; 0x32832 33514: f9 cf rjmp .-14 ; 0x33508 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 33516: 87 30 cpi r24, 0x07 ; 7 33518: 49 f2 breq .-110 ; 0x334ac 3351a: 08 f4 brcc .+2 ; 0x3351e 3351c: 63 ce rjmp .-826 ; 0x331e4 3351e: 88 30 cpi r24, 0x08 ; 8 33520: 09 f4 brne .+2 ; 0x33524 33522: 78 ce rjmp .-784 ; 0x33214 33524: 7b cf rjmp .-266 ; 0x3341c // 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()) { 33526: 80 91 95 12 lds r24, 0x1295 ; 0x801295 3352a: 87 fd sbrc r24, 7 3352c: 9a cc rjmp .-1740 ; 0x32e62 3352e: fc cc rjmp .-1544 ; 0x32f28 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 33530: 13 30 cpi r17, 0x03 ; 3 33532: 09 f4 brne .+2 ; 0x33536 33534: 68 c0 rjmp .+208 ; 0x33606 33536: 1b 30 cpi r17, 0x0B ; 11 33538: 09 f0 breq .+2 ; 0x3353c 3353a: 80 cf rjmp .-256 ; 0x3343c case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 3353c: 80 91 d5 12 lds r24, 0x12D5 ; 0x8012d5 33540: 80 93 fc 12 sts 0x12FC, r24 ; 0x8012fc LogEchoEvent_P(PSTR("MMU Button pushed")); 33544: 8b ef ldi r24, 0xFB ; 251 33546: 9e e9 ldi r25, 0x9E ; 158 33548: 0f 94 c0 4e call 0x29d80 ; 0x29d80 CheckUserInput(); // Process the button immediately 3354c: 0f 94 3b 96 call 0x32c76 ; 0x32c76 33550: 5a c0 rjmp .+180 ; 0x33606 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 33552: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 33556: 81 11 cpse r24, r1 33558: 56 c0 rjmp .+172 ; 0x33606 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() 3355a: 0e 94 10 66 call 0xcc20 ; 0xcc20 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 3355e: 88 23 and r24, r24 33560: 09 f4 brne .+2 ; 0x33564 33562: 51 c0 rjmp .+162 ; 0x33606 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 33564: 80 91 40 0d lds r24, 0x0D40 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.489> 33568: 90 91 41 0d lds r25, 0x0D41 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.489+0x1> 3356c: 88 35 cpi r24, 0x58 ; 88 3356e: 92 40 sbci r25, 0x02 ; 2 33570: 09 f4 brne .+2 ; 0x33574 33572: 49 c0 rjmp .+146 ; 0x33606 && !saved_printing 33574: 80 91 73 12 lds r24, 0x1273 ; 0x801273 33578: 81 11 cpse r24, r1 3357a: 45 c0 rjmp .+138 ; 0x33606 && !mesh_bed_leveling_flag 3357c: 80 91 72 12 lds r24, 0x1272 ; 0x801272 33580: 81 11 cpse r24, r1 33582: 41 c0 rjmp .+130 ; 0x33606 && !homing_flag 33584: 80 91 71 12 lds r24, 0x1271 ; 0x801271 33588: 81 11 cpse r24, r1 3358a: 3d c0 rjmp .+122 ; 0x33606 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 3358c: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 33590: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 33594: 98 17 cp r25, r24 33596: b9 f1 breq .+110 ; 0x33606 { uint8_t block_index = block_buffer_tail; 33598: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f } #endif bool e_active() { unsigned char e_active = 0; 3359c: 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++; 3359e: 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) 335a0: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 335a4: 38 17 cp r19, r24 335a6: 89 f0 breq .+34 ; 0x335ca { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 335a8: 28 9f mul r18, r24 335aa: f0 01 movw r30, r0 335ac: 11 24 eor r1, r1 335ae: e2 5a subi r30, 0xA2 ; 162 335b0: f9 4f sbci r31, 0xF9 ; 249 335b2: 44 85 ldd r20, Z+12 ; 0x0c 335b4: 55 85 ldd r21, Z+13 ; 0x0d 335b6: 66 85 ldd r22, Z+14 ; 0x0e 335b8: 77 85 ldd r23, Z+15 ; 0x0f 335ba: 45 2b or r20, r21 335bc: 46 2b or r20, r22 335be: 47 2b or r20, r23 335c0: 09 f0 breq .+2 ; 0x335c4 335c2: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 335c4: 8f 5f subi r24, 0xFF ; 255 335c6: 8f 70 andi r24, 0x0F ; 15 335c8: eb cf rjmp .-42 ; 0x335a0 && e_active(); 335ca: 99 23 and r25, r25 335cc: e1 f0 breq .+56 ; 0x33606 SERIAL_ECHOLNPGM("FINDA filament runout!"); 335ce: 8c e8 ldi r24, 0x8C ; 140 335d0: 9e e9 ldi r25, 0x9E ; 158 335d2: 0e 94 8d 7c call 0xf91a ; 0xf91a 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); 335d6: 60 e0 ldi r22, 0x00 ; 0 335d8: 70 e0 ldi r23, 0x00 ; 0 335da: cb 01 movw r24, r22 335dc: 0f 94 de 65 call 0x2cbbc ; 0x2cbbc marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 335e0: 60 e0 ldi r22, 0x00 ; 0 335e2: 70 e0 ldi r23, 0x00 ; 0 335e4: cb 01 movw r24, r22 335e6: 0e 94 88 66 call 0xcd10 ; 0xcd10 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 335ea: 86 ed ldi r24, 0xD6 ; 214 335ec: 9e e0 ldi r25, 0x0E ; 14 335ee: 0f 94 9d a3 call 0x3473a ; 0x3473a 335f2: 81 30 cpi r24, 0x01 ; 1 335f4: 21 f4 brne .+8 ; 0x335fe if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 335f6: 0f 94 7f 65 call 0x2cafe ; 0x2cafe 335fa: 8f 3f cpi r24, 0xFF ; 255 335fc: 91 f5 brne .+100 ; 0x33662 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 335fe: 8e e5 ldi r24, 0x5E ; 94 33600: 9c e6 ldi r25, 0x6C ; 108 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 33602: 0f 94 49 67 call 0x2ce92 ; 0x2ce92 break; } } } if (logic.Running()) { 33606: 80 91 af 12 lds r24, 0x12AF ; 0x8012af 3360a: 82 30 cpi r24, 0x02 ; 2 3360c: 19 f4 brne .+6 ; 0x33614 state = xState::Active; 3360e: 81 e0 ldi r24, 0x01 ; 1 33610: 80 93 01 13 sts 0x1301, r24 ; 0x801301 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 33614: 10 93 00 13 sts 0x1300, r17 ; 0x801300 // 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) { 33618: 80 91 5c 06 lds r24, 0x065C ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.448> 3361c: 88 23 and r24, r24 3361e: 51 f0 breq .+20 ; 0x33634 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 33620: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.452> 33624: 81 11 cpse r24, r1 33626: 06 c0 rjmp .+12 ; 0x33634 33628: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 3362c: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 33630: 0f 94 28 50 call 0x2a050 ; 0x2a050 CheckErrorScreenUserInput(); } 33634: a0 96 adiw r28, 0x20 ; 32 33636: 0f b6 in r0, 0x3f ; 63 33638: f8 94 cli 3363a: de bf out 0x3e, r29 ; 62 3363c: 0f be out 0x3f, r0 ; 63 3363e: cd bf out 0x3d, r28 ; 61 33640: df 91 pop r29 33642: cf 91 pop r28 33644: 1f 91 pop r17 33646: 0f 91 pop r16 33648: ff 90 pop r15 3364a: ef 90 pop r14 3364c: df 90 pop r13 3364e: cf 90 pop r12 33650: bf 90 pop r11 33652: af 90 pop r10 33654: 9f 90 pop r9 33656: 8f 90 pop r8 33658: 7f 90 pop r7 3365a: 6f 90 pop r6 3365c: 5f 90 pop r5 3365e: 4f 90 pop r4 33660: 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 33662: 82 e8 ldi r24, 0x82 ; 130 33664: 9e e9 ldi r25, 0x9E ; 158 33666: cd cf rjmp .-102 ; 0x33602 33668: 00 91 d4 12 lds r16, 0x12D4 ; 0x8012d4 ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 3366c: 80 91 f8 12 lds r24, 0x12F8 ; 0x8012f8 33670: 08 17 cp r16, r24 33672: 09 f4 brne .+2 ; 0x33676 33674: 49 c0 rjmp .+146 ; 0x33708 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 33676: 80 91 94 12 lds r24, 0x1294 ; 0x801294 3367a: 84 30 cpi r24, 0x04 ; 4 3367c: b9 f4 brne .+46 ; 0x336ac break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 3367e: 80 91 97 12 lds r24, 0x1297 ; 0x801297 33682: 88 23 and r24, r24 33684: 99 f0 breq .+38 ; 0x336ac custom_message_type = CustomMsg::MMUProgress; 33686: 89 e0 ldi r24, 0x09 ; 9 33688: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d : static_cast(pgm_read_ptr(&progressTexts[0])); 3368c: e8 e4 ldi r30, 0x48 ; 72 3368e: fe e9 ldi r31, 0x9E ; 158 }; 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])) 33690: 0e 31 cpi r16, 0x1E ; 30 33692: 30 f4 brcc .+12 ; 0x336a0 33694: e0 2f mov r30, r16 33696: f0 e0 ldi r31, 0x00 ; 0 33698: ee 0f add r30, r30 3369a: ff 1f adc r31, r31 3369c: e8 5b subi r30, 0xB8 ; 184 3369e: f1 46 sbci r31, 0x61 ; 97 : static_cast(pgm_read_ptr(&progressTexts[0])); 336a0: 85 91 lpm r24, Z+ 336a2: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 336a4: 0e 94 0a 75 call 0xea14 ; 0xea14 336a8: 0e 94 85 dc call 0x1b90a ; 0x1b90a 336ac: e8 e4 ldi r30, 0x48 ; 72 336ae: fe e9 ldi r31, 0x9E ; 158 }; 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])) 336b0: 0e 31 cpi r16, 0x1E ; 30 336b2: 30 f4 brcc .+12 ; 0x336c0 336b4: e0 2f mov r30, r16 336b6: f0 e0 ldi r31, 0x00 ; 0 336b8: ee 0f add r30, r30 336ba: ff 1f adc r31, r31 336bc: e8 5b subi r30, 0xB8 ; 184 336be: f1 46 sbci r31, 0x61 ; 97 : static_cast(pgm_read_ptr(&progressTexts[0])); 336c0: 85 91 lpm r24, Z+ 336c2: 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))); 336c4: 02 96 adiw r24, 0x02 ; 2 336c6: 0f 94 c0 4e call 0x29d80 ; 0x29d80 } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 336ca: 00 93 f8 12 sts 0x12F8, r16 ; 0x8012f8 switch (pc) { 336ce: 03 30 cpi r16, 0x03 ; 3 336d0: 49 f0 breq .+18 ; 0x336e4 336d2: 0c 31 cpi r16, 0x1C ; 28 336d4: 09 f0 breq .+2 ; 0x336d8 336d6: 97 cf rjmp .-210 ; 0x33606 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 336d8: 0f 94 b0 18 call 0x23160 ; 0x23160 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 336dc: 81 e0 ldi r24, 0x01 ; 1 336de: 80 93 03 13 sts 0x1303, r24 ; 0x801303 336e2: 91 cf rjmp .-222 ; 0x33606 336e4: 80 91 94 12 lds r24, 0x1294 ; 0x801294 336e8: 84 30 cpi r24, 0x04 ; 4 336ea: 31 f4 brne .+12 ; 0x336f8 ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 336ec: 80 91 97 12 lds r24, 0x1297 ; 0x801297 336f0: 84 55 subi r24, 0x54 ; 84 336f2: 82 30 cpi r24, 0x02 ; 2 336f4: 08 f4 brcc .+2 ; 0x336f8 336f6: 87 cf rjmp .-242 ; 0x33606 336f8: 0f 94 b0 18 call 0x23160 ; 0x23160 // 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; 336fc: 81 e0 ldi r24, 0x01 ; 1 336fe: 80 93 04 13 sts 0x1304, r24 ; 0x801304 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(); 33702: 0f 94 e0 5a call 0x2b5c0 ; 0x2b5c0 33706: 7f cf rjmp .-258 ; 0x33606 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) { 33708: 03 30 cpi r16, 0x03 ; 3 3370a: 71 f1 breq .+92 ; 0x33768 3370c: 0c 31 cpi r16, 0x1C ; 28 3370e: 09 f0 breq .+2 ; 0x33712 33710: 7a cf rjmp .-268 ; 0x33606 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 33712: 80 91 03 13 lds r24, 0x1303 ; 0x801303 33716: 88 23 and r24, r24 33718: 09 f4 brne .+2 ; 0x3371c 3371a: 75 cf rjmp .-278 ; 0x33606 switch (WhereIsFilament()) { 3371c: 0f 94 d0 4e call 0x29da0 ; 0x29da0 33720: 88 23 and r24, r24 33722: b1 f1 breq .+108 ; 0x33790 33724: 81 30 cpi r24, 0x01 ; 1 33726: 09 f0 breq .+2 ; 0x3372a 33728: 6e cf rjmp .-292 ; 0x33606 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 3372a: 10 92 03 13 sts 0x1303, r1 ; 0x801303 float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 3372e: 0f 94 84 4c call 0x29908 ; 0x29908 // 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; 33732: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 33736: 60 91 df 12 lds r22, 0x12DF ; 0x8012df 3373a: 70 e0 ldi r23, 0x00 ; 0 3373c: 90 e0 ldi r25, 0x00 ; 0 3373e: 80 e0 ldi r24, 0x00 ; 0 33740: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 33744: 6b 01 movw r12, r22 33746: 7c 01 movw r14, r24 33748: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 3374c: 70 e0 ldi r23, 0x00 ; 0 3374e: 6e 5f subi r22, 0xFE ; 254 33750: 7f 4f sbci r23, 0xFF ; 255 33752: 07 2e mov r0, r23 33754: 00 0c add r0, r0 33756: 88 0b sbc r24, r24 33758: 99 0b sbc r25, r25 3375a: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 3375e: a7 01 movw r20, r14 33760: 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()); 33762: 0f 94 9c 4e call 0x29d38 ; 0x29d38 33766: 4f cf rjmp .-354 ; 0x33606 } 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 33768: 80 91 04 13 lds r24, 0x1304 ; 0x801304 3376c: 88 23 and r24, r24 3376e: 09 f4 brne .+2 ; 0x33772 33770: 4a cf rjmp .-364 ; 0x33606 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); 33772: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 33776: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 3377a: 98 13 cpse r25, r24 3377c: 44 cf rjmp .-376 ; 0x33606 switch (WhereIsFilament()) { 3377e: 0f 94 d0 4e call 0x29da0 ; 0x29da0 33782: 81 50 subi r24, 0x01 ; 1 33784: 83 30 cpi r24, 0x03 ; 3 33786: 08 f4 brcc .+2 ; 0x3378a 33788: bc cf rjmp .-136 ; 0x33702 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; 3378a: 10 92 04 13 sts 0x1304, r1 ; 0x801304 3378e: 3b cf rjmp .-394 ; 0x33606 33790: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 33794: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 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 33798: 98 13 cpse r25, r24 3379a: 35 cf rjmp .-406 ; 0x33606 // 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()); 3379c: 60 91 df 12 lds r22, 0x12DF ; 0x8012df 337a0: 70 e0 ldi r23, 0x00 ; 0 337a2: 90 e0 ldi r25, 0x00 ; 0 337a4: 80 e0 ldi r24, 0x00 ; 0 337a6: 0f 94 29 9e call 0x33c52 ; 0x33c52 <__floatunsisf> 337aa: 9b 01 movw r18, r22 337ac: ac 01 movw r20, r24 337ae: 60 e0 ldi r22, 0x00 ; 0 337b0: 70 e0 ldi r23, 0x00 ; 0 337b2: 8f ea ldi r24, 0xAF ; 175 337b4: 93 e4 ldi r25, 0x43 ; 67 337b6: d5 cf rjmp .-86 ; 0x33762 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 337b8: 18 30 cpi r17, 0x08 ; 8 337ba: b9 f0 breq .+46 ; 0x337ea 337bc: 19 30 cpi r17, 0x09 ; 9 337be: 09 f0 breq .+2 ; 0x337c2 337c0: 22 cf rjmp .-444 ; 0x33606 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 337c2: 60 e0 ldi r22, 0x00 ; 0 337c4: 0f 94 54 75 call 0x2eaa8 ; 0x2eaa8 337c8: 19 e0 ldi r17, 0x09 ; 9 337ca: 1d cf rjmp .-454 ; 0x33606 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 337cc: 61 e0 ldi r22, 0x01 ; 1 337ce: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 337d2: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 337d6: 0f 94 54 75 call 0x2eaa8 ; 0x2eaa8 337da: 15 cf rjmp .-470 ; 0x33606 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 337dc: 82 e0 ldi r24, 0x02 ; 2 337de: 80 93 01 13 sts 0x1301, r24 ; 0x801301 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 337e2: 60 e0 ldi r22, 0x00 ; 0 337e4: 8e e2 ldi r24, 0x2E ; 46 337e6: 90 e8 ldi r25, 0x80 ; 128 337e8: f6 cf rjmp .-20 ; 0x337d6 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 337ea: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 337ee: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 337f2: 10 92 94 12 sts 0x1294, r1 ; 0x801294 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 337f6: 60 e0 ldi r22, 0x00 ; 0 337f8: 8c e2 ldi r24, 0x2C ; 44 337fa: 90 e8 ldi r25, 0x80 ; 128 337fc: ec cf rjmp .-40 ; 0x337d6 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 337fe: 0f 94 2a 56 call 0x2ac54 ; 0x2ac54 33802: ac cd rjmp .-1192 ; 0x3335c case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33804: 00 23 and r16, r16 33806: 01 f3 breq .-64 ; 0x337c8 33808: dc cf rjmp .-72 ; 0x337c2 0003380a : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 3380a: 80 91 02 13 lds r24, 0x1302 ; 0x801302 3380e: 82 ff sbrs r24, 2 33810: 07 c0 rjmp .+14 ; 0x33820 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 33812: 8b 7f andi r24, 0xFB ; 251 33814: 80 93 02 13 sts 0x1302, r24 ; 0x801302 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 33818: 89 ee ldi r24, 0xE9 ; 233 3381a: 9f e9 ldi r25, 0x9F ; 159 3381c: 0f 94 c0 4e call 0x29d80 ; 0x29d80 } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 33820: 80 91 02 13 lds r24, 0x1302 ; 0x801302 33824: 81 ff sbrs r24, 1 33826: 52 c0 rjmp .+164 ; 0x338cc 33828: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 3382c: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 33830: 89 2b or r24, r25 33832: 09 f4 brne .+2 ; 0x33836 33834: 4b c0 rjmp .+150 ; 0x338cc LogEchoEvent_P(PSTR("Resuming Temp")); 33836: 8b ed ldi r24, 0xDB ; 219 33838: 9f e9 ldi r25, 0x9F ; 159 3383a: 0f 94 c0 4e call 0x29d80 ; 0x29d80 // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 3383e: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 33842: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 33846: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e mmu_print_saved &= ~(SavedState::Cooldown); 3384a: 80 91 02 13 lds r24, 0x1302 ; 0x801302 3384e: 8d 7f andi r24, 0xFD ; 253 33850: 80 93 02 13 sts 0x1302, r24 ; 0x801302 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 33854: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 33858: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 3385c: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 33860: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 33864: 80 e0 ldi r24, 0x00 ; 0 33866: 92 e6 ldi r25, 0x62 ; 98 33868: 0e 94 0a 75 call 0xea14 ; 0xea14 3386c: 0e 94 9a de call 0x1bd34 ; 0x1bd34 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)); 33870: 4b ea ldi r20, 0xAB ; 171 33872: 5f e9 ldi r21, 0x9F ; 159 33874: 62 e0 ldi r22, 0x02 ; 2 33876: 80 e0 ldi r24, 0x00 ; 0 33878: 0e 94 d7 6f call 0xdfae ; 0xdfae int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 3387c: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 33880: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 33884: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 33888: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 3388c: 0f 94 36 a6 call 0x34c6c ; 0x34c6c <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 33890: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 33894: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 33898: c9 01 movw r24, r18 3389a: 86 1b sub r24, r22 3389c: 97 0b sbc r25, r23 3389e: 06 97 sbiw r24, 0x06 ; 6 338a0: 6c f0 brlt .+26 ; 0x338bc void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 338a2: 81 e0 ldi r24, 0x01 ; 1 338a4: 0e 94 25 8a call 0x1144a ; 0x1144a 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); 338a8: 80 e0 ldi r24, 0x00 ; 0 338aa: 0f 94 f5 96 call 0x32dea ; 0x32dea ReportErrorHookDynamicRender(); 338ae: 0f 94 f6 4d call 0x29bec ; 0x29bec void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 338b2: 84 e6 ldi r24, 0x64 ; 100 338b4: 90 e0 ldi r25, 0x00 ; 0 338b6: 0e 94 7f 8c call 0x118fe ; 0x118fe 338ba: e0 cf rjmp .-64 ; 0x3387c }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 338bc: 0f 94 cc 4d call 0x29b98 ; 0x29b98 LogEchoEvent_P(PSTR("Hotend temperature reached")); 338c0: 80 ec ldi r24, 0xC0 ; 192 338c2: 9f e9 ldi r25, 0x9F ; 159 338c4: 0f 94 c0 4e call 0x29d80 ; 0x29d80 void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 338c8: 0c 94 f6 6f jmp 0xdfec ; 0xdfec ScreenClear(); } } 338cc: 08 95 ret 000338ce : /// 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) { 338ce: 0f 93 push r16 338d0: 1f 93 push r17 338d2: cf 93 push r28 338d4: df 93 push r29 338d6: 00 d0 rcall .+0 ; 0x338d8 338d8: 1f 92 push r1 338da: 1f 92 push r1 338dc: cd b7 in r28, 0x3d ; 61 338de: de b7 in r29, 0x3e ; 62 338e0: 18 2f mov r17, r24 338e2: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 338e4: 10 92 02 13 sts 0x1302, r1 ; 0x801302 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 338e8: 83 e0 ldi r24, 0x03 ; 3 338ea: 80 93 78 02 sts 0x0278, r24 ; 0x800278 LongTimer nozzleTimeout; 338ee: 19 82 std Y+1, r1 ; 0x01 338f0: 1a 82 std Y+2, r1 ; 0x02 338f2: 1b 82 std Y+3, r1 ; 0x03 338f4: 1c 82 std Y+4, r1 ; 0x04 338f6: 1d 82 std Y+5, r1 ; 0x05 338f8: 90 e0 ldi r25, 0x00 ; 0 338fa: 80 e0 ldi r24, 0x00 ; 0 338fc: 0e 94 7f 8c call 0x118fe ; 0x118fe // - 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) { 33900: 90 91 02 13 lds r25, 0x1302 ; 0x801302 33904: 89 81 ldd r24, Y+1 ; 0x01 33906: 92 ff sbrs r25, 2 33908: 37 c0 rjmp .+110 ; 0x33978 if (!nozzleTimeout.running()) { 3390a: 81 11 cpse r24, r1 3390c: 1e c0 rjmp .+60 ; 0x3394a nozzleTimeout.start(); 3390e: ce 01 movw r24, r28 33910: 01 96 adiw r24, 0x01 ; 1 33912: 0f 94 7f 0d call 0x21afe ; 0x21afe ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 33916: 82 ed ldi r24, 0xD2 ; 210 33918: 9d e9 ldi r25, 0x9D ; 157 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); } } else if (nozzleTimeout.running()) { nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 3391a: 0f 94 c0 4e call 0x29d80 ; 0x29d80 } switch (logicStepLastStatus) { 3391e: e0 91 00 13 lds r30, 0x1300 ; 0x801300 33922: e2 50 subi r30, 0x02 ; 2 33924: ea 30 cpi r30, 0x0A ; 10 33926: 40 f7 brcc .-48 ; 0x338f8 33928: f0 e0 ldi r31, 0x00 ; 0 3392a: 88 27 eor r24, r24 3392c: e5 56 subi r30, 0x65 ; 101 3392e: f3 46 sbci r31, 0x63 ; 99 33930: 8e 4f sbci r24, 0xFE ; 254 33932: 0d 94 ad a4 jmp 0x3495a ; 0x3495a <__tablejump2__> 33936: 98 37 cpi r25, 0x78 ; 120 33938: 8a 38 cpi r24, 0x8A ; 138 3393a: ae 38 cpi r26, 0x8E ; 142 3393c: ae 38 cpi r26, 0x8E ; 142 3393e: f6 37 cpi r31, 0x76 ; 118 33940: ae 38 cpi r26, 0x8E ; 142 33942: e8 36 cpi r30, 0x68 ; 104 33944: 3e 37 cpi r19, 0x7E ; 126 33946: e8 37 cpi r30, 0x78 ; 120 33948: ae 38 cpi r26, 0x8E ; 142 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. 3394a: 40 e4 ldi r20, 0x40 ; 64 3394c: 57 e7 ldi r21, 0x77 ; 119 3394e: 6b e1 ldi r22, 0x1B ; 27 33950: 70 e0 ldi r23, 0x00 ; 0 33952: ce 01 movw r24, r28 33954: 01 96 adiw r24, 0x01 ; 1 33956: 0f 94 c0 0b call 0x21780 ; 0x21780 ::expired(unsigned long)> 3395a: 88 23 and r24, r24 3395c: 01 f3 breq .-64 ; 0x3391e mmu_print_saved &= ~(SavedState::CooldownPending); 3395e: 80 91 02 13 lds r24, 0x1302 ; 0x801302 33962: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 33964: 82 60 ori r24, 0x02 ; 2 33966: 80 93 02 13 sts 0x1302, r24 ; 0x801302 3396a: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 3396e: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 33972: 82 ec ldi r24, 0xC2 ; 194 33974: 9d e9 ldi r25, 0x9D ; 157 33976: d1 cf rjmp .-94 ; 0x3391a } } else if (nozzleTimeout.running()) { 33978: 88 23 and r24, r24 3397a: 89 f2 breq .-94 ; 0x3391e 3397c: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 3397e: 8c ea ldi r24, 0xAC ; 172 33980: 9d e9 ldi r25, 0x9D ; 157 33982: cb cf rjmp .-106 ; 0x3391a 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(); 33984: 0f 94 05 9c call 0x3380a ; 0x3380a ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 33988: 0f 94 06 5b call 0x2b60c ; 0x2b60c if (!TuneMenuEntered()) { 3398c: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.452> 33990: 81 11 cpse r24, r1 33992: 07 c0 rjmp .+14 ; 0x339a2 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 33994: 88 e9 ldi r24, 0x98 ; 152 33996: 9f e9 ldi r25, 0x9F ; 159 33998: 0e 94 8d 7c call 0xf91a ; 0xf91a retryAttempts = MAX_RETRIES; 3399c: 83 e0 ldi r24, 0x03 ; 3 3399e: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 339a2: 0f 94 b0 18 call 0x23160 ; 0x23160 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; 339a6: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 339a8: 0f 90 pop r0 339aa: 0f 90 pop r0 339ac: 0f 90 pop r0 339ae: 0f 90 pop r0 339b0: 0f 90 pop r0 339b2: df 91 pop r29 339b4: cf 91 pop r28 339b6: 1f 91 pop r17 339b8: 0f 91 pop r16 339ba: 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(); 339bc: 0f 94 3b 96 call 0x32c76 ; 0x32c76 339c0: f2 cf rjmp .-28 ; 0x339a6 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 339c2: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 339c6: 81 11 cpse r24, r1 339c8: 97 cf rjmp .-210 ; 0x338f8 // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 339ca: 81 2f mov r24, r17 339cc: 0f 94 50 5b call 0x2b6a0 ; 0x2b6a0 SaveHotendTemp(turn_off_nozzle); 339d0: 80 2f mov r24, r16 339d2: 0f 94 ea 5a call 0x2b5d4 ; 0x2b5d4 CheckUserInput(); 339d6: 0f 94 3b 96 call 0x32c76 ; 0x32c76 339da: 8e cf rjmp .-228 ; 0x338f8 } 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(); 339dc: 0f 94 05 9c call 0x3380a ; 0x3380a ResumeUnpark(); 339e0: 0f 94 06 5b call 0x2b60c ; 0x2b60c 339e4: 89 cf rjmp .-238 ; 0x338f8 } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 339e6: 80 e0 ldi r24, 0x00 ; 0 339e8: df cf rjmp .-66 ; 0x339a8 000339ea : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 339ea: cf 93 push r28 339ec: df 93 push r29 339ee: 00 d0 rcall .+0 ; 0x339f0 339f0: 1f 92 push r1 339f2: 1f 92 push r1 339f4: cd b7 in r28, 0x3d ; 61 339f6: de b7 in r29, 0x3e ; 62 FSensorBlockRunout blockRunout; 339f8: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 339fc: 62 e1 ldi r22, 0x12 ; 18 339fe: 8c e1 ldi r24, 0x1C ; 28 33a00: 9d e9 ldi r25, 0x9D ; 157 33a02: 0f 94 3a 79 call 0x2f274 ; 0x2f274 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(); 33a06: 0f 94 9a 4e call 0x29d34 ; 0x29d34 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 33a0a: 40 e0 ldi r20, 0x00 ; 0 33a0c: 65 e5 ldi r22, 0x55 ; 85 33a0e: ce 01 movw r24, r28 33a10: 01 96 adiw r24, 0x01 ; 1 33a12: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 33a16: 49 81 ldd r20, Y+1 ; 0x01 33a18: 5a 81 ldd r21, Y+2 ; 0x02 33a1a: 6b 81 ldd r22, Y+3 ; 0x03 33a1c: 7c 81 ldd r23, Y+4 ; 0x04 33a1e: 8d 81 ldd r24, Y+5 ; 0x05 33a20: 0f 94 d6 94 call 0x329ac ; 0x329ac logic.UnloadFilament(); if (manage_response(false, true)) { 33a24: 61 e0 ldi r22, 0x01 ; 1 33a26: 80 e0 ldi r24, 0x00 ; 0 33a28: 0f 94 67 9c call 0x338ce ; 0x338ce 33a2c: 81 11 cpse r24, r1 33a2e: 03 c0 rjmp .+6 ; 0x33a36 break; } IncrementMMUFails(); 33a30: 0f 94 ee 4d call 0x29bdc ; 0x29bdc 33a34: e8 cf rjmp .-48 ; 0x33a06 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); 33a36: 83 e0 ldi r24, 0x03 ; 3 33a38: 0f 94 62 23 call 0x246c4 ; 0x246c4 } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 33a3c: 83 e6 ldi r24, 0x63 ; 99 33a3e: 0f 94 9f 65 call 0x2cb3e ; 0x2cb3e tool_change_extruder = MMU2_NO_TOOL; 33a42: 83 e6 ldi r24, 0x63 ; 99 33a44: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 33a48: 0f 94 3f 6d call 0x2da7e ; 0x2da7e } 33a4c: 0f 90 pop r0 33a4e: 0f 90 pop r0 33a50: 0f 90 pop r0 33a52: 0f 90 pop r0 33a54: 0f 90 pop r0 33a56: df 91 pop r29 33a58: cf 91 pop r28 33a5a: 08 95 ret 00033a5c : bool MMU2::unload() { 33a5c: cf 93 push r28 if (!WaitForMMUReady()) { 33a5e: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 33a62: c8 2f mov r28, r24 33a64: 88 23 and r24, r24 33a66: 79 f0 breq .+30 ; 0x33a86 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 33a68: 88 ec ldi r24, 0xC8 ; 200 33a6a: 90 e0 ldi r25, 0x00 ; 0 33a6c: 0f 94 1e 52 call 0x2a43c ; 0x2a43c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.375]> 33a70: 82 e0 ldi r24, 0x02 ; 2 33a72: 0f 94 62 23 call 0x246c4 ; 0x246c4 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33a76: 0f 94 2f 79 call 0x2f25e ; 0x2f25e WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 33a7a: 0f 94 f5 9c call 0x339ea ; 0x339ea explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33a7e: 0f 94 58 79 call 0x2f2b0 ; 0x2f2b0 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 33a82: 0f 94 cc 4d call 0x29b98 ; 0x29b98 return true; } 33a86: 8c 2f mov r24, r28 33a88: cf 91 pop r28 33a8a: 08 95 ret 00033a8c : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 33a8c: 0f 93 push r16 33a8e: 1f 93 push r17 33a90: cf 93 push r28 33a92: df 93 push r29 33a94: 00 d0 rcall .+0 ; 0x33a96 33a96: 1f 92 push r1 33a98: 1f 92 push r1 33a9a: cd b7 in r28, 0x3d ; 61 33a9c: de b7 in r29, 0x3e ; 62 33a9e: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 33aa0: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 33aa4: 18 2f mov r17, r24 33aa6: 88 23 and r24, r24 33aa8: 49 f1 breq .+82 ; 0x33afc void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 33aaa: 8d ee ldi r24, 0xED ; 237 33aac: 91 e6 ldi r25, 0x61 ; 97 33aae: 0e 94 0a 75 call 0xea14 ; 0xea14 33ab2: 60 2f mov r22, r16 33ab4: 0f 94 cf 4d call 0x29b9e ; 0x29b9e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33ab8: 0f 94 2f 79 call 0x2f25e ; 0x2f25e FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 33abc: 0f 94 9a 4e call 0x29d34 ; 0x29d34 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 33ac0: 40 2f mov r20, r16 33ac2: 6c e4 ldi r22, 0x4C ; 76 33ac4: ce 01 movw r24, r28 33ac6: 01 96 adiw r24, 0x01 ; 1 33ac8: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 33acc: 49 81 ldd r20, Y+1 ; 0x01 33ace: 5a 81 ldd r21, Y+2 ; 0x02 33ad0: 6b 81 ldd r22, Y+3 ; 0x03 33ad2: 7c 81 ldd r23, Y+4 ; 0x04 33ad4: 8d 81 ldd r24, Y+5 ; 0x05 33ad6: 0f 94 d6 94 call 0x329ac ; 0x329ac logic.LoadFilament(slot); if (manage_response(false, false)) { 33ada: 60 e0 ldi r22, 0x00 ; 0 33adc: 80 e0 ldi r24, 0x00 ; 0 33ade: 0f 94 67 9c call 0x338ce ; 0x338ce 33ae2: 18 2f mov r17, r24 33ae4: 81 11 cpse r24, r1 33ae6: 03 c0 rjmp .+6 ; 0x33aee break; } IncrementMMUFails(); 33ae8: 0f 94 ee 4d call 0x29bdc ; 0x29bdc 33aec: e7 cf rjmp .-50 ; 0x33abc 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); 33aee: 83 e0 ldi r24, 0x03 ; 3 33af0: 0f 94 62 23 call 0x246c4 ; 0x246c4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33af4: 0f 94 58 79 call 0x2f2b0 ; 0x2f2b0 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 33af8: 0f 94 cc 4d call 0x29b98 ; 0x29b98 return true; } 33afc: 81 2f mov r24, r17 33afe: 0f 90 pop r0 33b00: 0f 90 pop r0 33b02: 0f 90 pop r0 33b04: 0f 90 pop r0 33b06: 0f 90 pop r0 33b08: df 91 pop r29 33b0a: cf 91 pop r28 33b0c: 1f 91 pop r17 33b0e: 0f 91 pop r16 33b10: 08 95 ret 00033b12 : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 33b12: ff 92 push r15 33b14: 0f 93 push r16 33b16: 1f 93 push r17 33b18: cf 93 push r28 33b1a: df 93 push r29 33b1c: 00 d0 rcall .+0 ; 0x33b1e 33b1e: 1f 92 push r1 33b20: 1f 92 push r1 33b22: cd b7 in r28, 0x3d ; 61 33b24: de b7 in r29, 0x3e ; 62 33b26: 08 2f mov r16, r24 33b28: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 33b2a: 0f 94 63 79 call 0x2f2c6 ; 0x2f2c6 33b2e: 18 2f mov r17, r24 33b30: 88 23 and r24, r24 33b32: b1 f1 breq .+108 ; 0x33ba0 return false; } if (enableFullScreenMsg) { 33b34: ff 20 and r15, r15 33b36: 39 f0 breq .+14 ; 0x33b46 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 33b38: 8c ed ldi r24, 0xDC ; 220 33b3a: 91 e6 ldi r25, 0x61 ; 97 33b3c: 0e 94 0a 75 call 0xea14 ; 0xea14 33b40: 60 2f mov r22, r16 33b42: 0f 94 cf 4d call 0x29b9e ; 0x29b9e FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 33b46: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 33b4a: 81 11 cpse r24, r1 unload(); 33b4c: 0f 94 2e 9d call 0x33a5c ; 0x33a5c struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33b50: 0f 94 2f 79 call 0x2f25e ; 0x2f25e unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 33b54: 0f 94 9a 4e call 0x29d34 ; 0x29d34 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 33b58: 40 2f mov r20, r16 33b5a: 65 e4 ldi r22, 0x45 ; 69 33b5c: ce 01 movw r24, r28 33b5e: 01 96 adiw r24, 0x01 ; 1 33b60: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 33b64: 49 81 ldd r20, Y+1 ; 0x01 33b66: 5a 81 ldd r21, Y+2 ; 0x02 33b68: 6b 81 ldd r22, Y+3 ; 0x03 33b6a: 7c 81 ldd r23, Y+4 ; 0x04 33b6c: 8d 81 ldd r24, Y+5 ; 0x05 33b6e: 0f 94 d6 94 call 0x329ac ; 0x329ac logic.EjectFilament(slot); if (manage_response(false, true)) { 33b72: 61 e0 ldi r22, 0x01 ; 1 33b74: 80 e0 ldi r24, 0x00 ; 0 33b76: 0f 94 67 9c call 0x338ce ; 0x338ce 33b7a: 18 2f mov r17, r24 33b7c: 81 11 cpse r24, r1 33b7e: 03 c0 rjmp .+6 ; 0x33b86 break; } IncrementMMUFails(); 33b80: 0f 94 ee 4d call 0x29bdc ; 0x29bdc 33b84: e7 cf rjmp .-50 ; 0x33b54 } SetCurrentTool(MMU2_NO_TOOL); 33b86: 83 e6 ldi r24, 0x63 ; 99 33b88: 0f 94 9f 65 call 0x2cb3e ; 0x2cb3e tool_change_extruder = MMU2_NO_TOOL; 33b8c: 83 e6 ldi r24, 0x63 ; 99 33b8e: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 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); 33b92: 83 e0 ldi r24, 0x03 ; 3 33b94: 0f 94 62 23 call 0x246c4 ; 0x246c4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33b98: 0f 94 58 79 call 0x2f2b0 ; 0x2f2b0 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 33b9c: 0f 94 cc 4d call 0x29b98 ; 0x29b98 return true; } 33ba0: 81 2f mov r24, r17 33ba2: 0f 90 pop r0 33ba4: 0f 90 pop r0 33ba6: 0f 90 pop r0 33ba8: 0f 90 pop r0 33baa: 0f 90 pop r0 33bac: df 91 pop r29 33bae: cf 91 pop r28 33bb0: 1f 91 pop r17 33bb2: 0f 91 pop r16 33bb4: ff 90 pop r15 33bb6: 08 95 ret 00033bb8 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 33bb8: 1f 93 push r17 33bba: cf 93 push r28 33bbc: df 93 push r29 33bbe: 00 d0 rcall .+0 ; 0x33bc0 33bc0: 1f 92 push r1 33bc2: 1f 92 push r1 33bc4: cd b7 in r28, 0x3d ; 61 33bc6: de b7 in r29, 0x3e ; 62 33bc8: 18 2f mov r17, r24 for (;;) { Disable_E0(); 33bca: 0f 94 9a 4e call 0x29d34 ; 0x29d34 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 33bce: 41 2f mov r20, r17 33bd0: 6b e4 ldi r22, 0x4B ; 75 33bd2: ce 01 movw r24, r28 33bd4: 01 96 adiw r24, 0x01 ; 1 33bd6: 0f 94 8d 4e call 0x29d1a ; 0x29d1a 33bda: 49 81 ldd r20, Y+1 ; 0x01 33bdc: 5a 81 ldd r21, Y+2 ; 0x02 33bde: 6b 81 ldd r22, Y+3 ; 0x03 33be0: 7c 81 ldd r23, Y+4 ; 0x04 33be2: 8d 81 ldd r24, Y+5 ; 0x05 33be4: 0f 94 d6 94 call 0x329ac ; 0x329ac logic.CutFilament(slot); if (manage_response(false, true)) { 33be8: 61 e0 ldi r22, 0x01 ; 1 33bea: 80 e0 ldi r24, 0x00 ; 0 33bec: 0f 94 67 9c call 0x338ce ; 0x338ce 33bf0: 81 11 cpse r24, r1 33bf2: 03 c0 rjmp .+6 ; 0x33bfa break; } IncrementMMUFails(); 33bf4: 0f 94 ee 4d call 0x29bdc ; 0x29bdc 33bf8: e8 cf rjmp .-48 ; 0x33bca } } 33bfa: 0f 90 pop r0 33bfc: 0f 90 pop r0 33bfe: 0f 90 pop r0 33c00: 0f 90 pop r0 33c02: 0f 90 pop r0 33c04: df 91 pop r29 33c06: cf 91 pop r28 33c08: 1f 91 pop r17 33c0a: 08 95 ret 00033c0c : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 33c0c: cf 93 push r28 33c0e: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 33c10: 8d ec ldi r24, 0xCD ; 205 33c12: 91 e6 ldi r25, 0x61 ; 97 33c14: 0e 94 0a 75 call 0xea14 ; 0xea14 33c18: 6c 2f mov r22, r28 33c1a: 0f 94 cf 4d call 0x29b9e ; 0x29b9e if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 33c1e: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 33c22: 81 11 cpse r24, r1 unload(); 33c24: 0f 94 2e 9d call 0x33a5c ; 0x33a5c struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33c28: 0f 94 2f 79 call 0x2f25e ; 0x2f25e if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 33c2c: 8c 2f mov r24, r28 33c2e: 0f 94 dc 9d call 0x33bb8 ; 0x33bb8 SetCurrentTool(MMU2_NO_TOOL); 33c32: 83 e6 ldi r24, 0x63 ; 99 33c34: 0f 94 9f 65 call 0x2cb3e ; 0x2cb3e tool_change_extruder = MMU2_NO_TOOL; 33c38: 83 e6 ldi r24, 0x63 ; 99 33c3a: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 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); 33c3e: 83 e0 ldi r24, 0x03 ; 3 33c40: 0f 94 62 23 call 0x246c4 ; 0x246c4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33c44: 0f 94 58 79 call 0x2f2b0 ; 0x2f2b0 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 33c48: 0f 94 cc 4d call 0x29b98 ; 0x29b98 return true; } 33c4c: 81 e0 ldi r24, 0x01 ; 1 33c4e: cf 91 pop r28 33c50: 08 95 ret 00033c52 <__floatunsisf>: 33c52: e8 94 clt 33c54: 09 c0 rjmp .+18 ; 0x33c68 <__floatsisf+0x12> 00033c56 <__floatsisf>: 33c56: 97 fb bst r25, 7 33c58: 3e f4 brtc .+14 ; 0x33c68 <__floatsisf+0x12> 33c5a: 90 95 com r25 33c5c: 80 95 com r24 33c5e: 70 95 com r23 33c60: 61 95 neg r22 33c62: 7f 4f sbci r23, 0xFF ; 255 33c64: 8f 4f sbci r24, 0xFF ; 255 33c66: 9f 4f sbci r25, 0xFF ; 255 33c68: 99 23 and r25, r25 33c6a: a9 f0 breq .+42 ; 0x33c96 <__floatsisf+0x40> 33c6c: f9 2f mov r31, r25 33c6e: 96 e9 ldi r25, 0x96 ; 150 33c70: bb 27 eor r27, r27 33c72: 93 95 inc r25 33c74: f6 95 lsr r31 33c76: 87 95 ror r24 33c78: 77 95 ror r23 33c7a: 67 95 ror r22 33c7c: b7 95 ror r27 33c7e: f1 11 cpse r31, r1 33c80: f8 cf rjmp .-16 ; 0x33c72 <__floatsisf+0x1c> 33c82: fa f4 brpl .+62 ; 0x33cc2 <__floatsisf+0x6c> 33c84: bb 0f add r27, r27 33c86: 11 f4 brne .+4 ; 0x33c8c <__floatsisf+0x36> 33c88: 60 ff sbrs r22, 0 33c8a: 1b c0 rjmp .+54 ; 0x33cc2 <__floatsisf+0x6c> 33c8c: 6f 5f subi r22, 0xFF ; 255 33c8e: 7f 4f sbci r23, 0xFF ; 255 33c90: 8f 4f sbci r24, 0xFF ; 255 33c92: 9f 4f sbci r25, 0xFF ; 255 33c94: 16 c0 rjmp .+44 ; 0x33cc2 <__floatsisf+0x6c> 33c96: 88 23 and r24, r24 33c98: 11 f0 breq .+4 ; 0x33c9e <__floatsisf+0x48> 33c9a: 96 e9 ldi r25, 0x96 ; 150 33c9c: 11 c0 rjmp .+34 ; 0x33cc0 <__floatsisf+0x6a> 33c9e: 77 23 and r23, r23 33ca0: 21 f0 breq .+8 ; 0x33caa <__floatsisf+0x54> 33ca2: 9e e8 ldi r25, 0x8E ; 142 33ca4: 87 2f mov r24, r23 33ca6: 76 2f mov r23, r22 33ca8: 05 c0 rjmp .+10 ; 0x33cb4 <__floatsisf+0x5e> 33caa: 66 23 and r22, r22 33cac: 71 f0 breq .+28 ; 0x33cca <__floatsisf+0x74> 33cae: 96 e8 ldi r25, 0x86 ; 134 33cb0: 86 2f mov r24, r22 33cb2: 70 e0 ldi r23, 0x00 ; 0 33cb4: 60 e0 ldi r22, 0x00 ; 0 33cb6: 2a f0 brmi .+10 ; 0x33cc2 <__floatsisf+0x6c> 33cb8: 9a 95 dec r25 33cba: 66 0f add r22, r22 33cbc: 77 1f adc r23, r23 33cbe: 88 1f adc r24, r24 33cc0: da f7 brpl .-10 ; 0x33cb8 <__floatsisf+0x62> 33cc2: 88 0f add r24, r24 33cc4: 96 95 lsr r25 33cc6: 87 95 ror r24 33cc8: 97 f9 bld r25, 7 33cca: 08 95 ret 00033ccc : 33ccc: 9b 01 movw r18, r22 33cce: ac 01 movw r20, r24 33cd0: 0d 94 6a 9e jmp 0x33cd4 ; 0x33cd4 <__mulsf3> 00033cd4 <__mulsf3>: 33cd4: 0f 94 7d 9e call 0x33cfa ; 0x33cfa <__mulsf3x> 33cd8: 0d 94 ee 9e jmp 0x33ddc ; 0x33ddc <__fp_round> 33cdc: 0f 94 e0 9e call 0x33dc0 ; 0x33dc0 <__fp_pscA> 33ce0: 38 f0 brcs .+14 ; 0x33cf0 <__mulsf3+0x1c> 33ce2: 0f 94 e7 9e call 0x33dce ; 0x33dce <__fp_pscB> 33ce6: 20 f0 brcs .+8 ; 0x33cf0 <__mulsf3+0x1c> 33ce8: 95 23 and r25, r21 33cea: 11 f0 breq .+4 ; 0x33cf0 <__mulsf3+0x1c> 33cec: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 33cf0: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 33cf4: 11 24 eor r1, r1 33cf6: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 00033cfa <__mulsf3x>: 33cfa: 0f 94 ff 9e call 0x33dfe ; 0x33dfe <__fp_split3> 33cfe: 70 f3 brcs .-36 ; 0x33cdc <__mulsf3+0x8> 00033d00 <__mulsf3_pse>: 33d00: 95 9f mul r25, r21 33d02: c1 f3 breq .-16 ; 0x33cf4 <__mulsf3+0x20> 33d04: 95 0f add r25, r21 33d06: 50 e0 ldi r21, 0x00 ; 0 33d08: 55 1f adc r21, r21 33d0a: 62 9f mul r22, r18 33d0c: f0 01 movw r30, r0 33d0e: 72 9f mul r23, r18 33d10: bb 27 eor r27, r27 33d12: f0 0d add r31, r0 33d14: b1 1d adc r27, r1 33d16: 63 9f mul r22, r19 33d18: aa 27 eor r26, r26 33d1a: f0 0d add r31, r0 33d1c: b1 1d adc r27, r1 33d1e: aa 1f adc r26, r26 33d20: 64 9f mul r22, r20 33d22: 66 27 eor r22, r22 33d24: b0 0d add r27, r0 33d26: a1 1d adc r26, r1 33d28: 66 1f adc r22, r22 33d2a: 82 9f mul r24, r18 33d2c: 22 27 eor r18, r18 33d2e: b0 0d add r27, r0 33d30: a1 1d adc r26, r1 33d32: 62 1f adc r22, r18 33d34: 73 9f mul r23, r19 33d36: b0 0d add r27, r0 33d38: a1 1d adc r26, r1 33d3a: 62 1f adc r22, r18 33d3c: 83 9f mul r24, r19 33d3e: a0 0d add r26, r0 33d40: 61 1d adc r22, r1 33d42: 22 1f adc r18, r18 33d44: 74 9f mul r23, r20 33d46: 33 27 eor r19, r19 33d48: a0 0d add r26, r0 33d4a: 61 1d adc r22, r1 33d4c: 23 1f adc r18, r19 33d4e: 84 9f mul r24, r20 33d50: 60 0d add r22, r0 33d52: 21 1d adc r18, r1 33d54: 82 2f mov r24, r18 33d56: 76 2f mov r23, r22 33d58: 6a 2f mov r22, r26 33d5a: 11 24 eor r1, r1 33d5c: 9f 57 subi r25, 0x7F ; 127 33d5e: 50 40 sbci r21, 0x00 ; 0 33d60: 9a f0 brmi .+38 ; 0x33d88 <__mulsf3_pse+0x88> 33d62: f1 f0 breq .+60 ; 0x33da0 <__mulsf3_pse+0xa0> 33d64: 88 23 and r24, r24 33d66: 4a f0 brmi .+18 ; 0x33d7a <__mulsf3_pse+0x7a> 33d68: ee 0f add r30, r30 33d6a: ff 1f adc r31, r31 33d6c: bb 1f adc r27, r27 33d6e: 66 1f adc r22, r22 33d70: 77 1f adc r23, r23 33d72: 88 1f adc r24, r24 33d74: 91 50 subi r25, 0x01 ; 1 33d76: 50 40 sbci r21, 0x00 ; 0 33d78: a9 f7 brne .-22 ; 0x33d64 <__mulsf3_pse+0x64> 33d7a: 9e 3f cpi r25, 0xFE ; 254 33d7c: 51 05 cpc r21, r1 33d7e: 80 f0 brcs .+32 ; 0x33da0 <__mulsf3_pse+0xa0> 33d80: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 33d84: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 33d88: 5f 3f cpi r21, 0xFF ; 255 33d8a: e4 f3 brlt .-8 ; 0x33d84 <__mulsf3_pse+0x84> 33d8c: 98 3e cpi r25, 0xE8 ; 232 33d8e: d4 f3 brlt .-12 ; 0x33d84 <__mulsf3_pse+0x84> 33d90: 86 95 lsr r24 33d92: 77 95 ror r23 33d94: 67 95 ror r22 33d96: b7 95 ror r27 33d98: f7 95 ror r31 33d9a: e7 95 ror r30 33d9c: 9f 5f subi r25, 0xFF ; 255 33d9e: c1 f7 brne .-16 ; 0x33d90 <__mulsf3_pse+0x90> 33da0: fe 2b or r31, r30 33da2: 88 0f add r24, r24 33da4: 91 1d adc r25, r1 33da6: 96 95 lsr r25 33da8: 87 95 ror r24 33daa: 97 f9 bld r25, 7 33dac: 08 95 ret 00033dae <__fp_inf>: 33dae: 97 f9 bld r25, 7 33db0: 9f 67 ori r25, 0x7F ; 127 33db2: 80 e8 ldi r24, 0x80 ; 128 33db4: 70 e0 ldi r23, 0x00 ; 0 33db6: 60 e0 ldi r22, 0x00 ; 0 33db8: 08 95 ret 00033dba <__fp_nan>: 33dba: 9f ef ldi r25, 0xFF ; 255 33dbc: 80 ec ldi r24, 0xC0 ; 192 33dbe: 08 95 ret 00033dc0 <__fp_pscA>: 33dc0: 00 24 eor r0, r0 33dc2: 0a 94 dec r0 33dc4: 16 16 cp r1, r22 33dc6: 17 06 cpc r1, r23 33dc8: 18 06 cpc r1, r24 33dca: 09 06 cpc r0, r25 33dcc: 08 95 ret 00033dce <__fp_pscB>: 33dce: 00 24 eor r0, r0 33dd0: 0a 94 dec r0 33dd2: 12 16 cp r1, r18 33dd4: 13 06 cpc r1, r19 33dd6: 14 06 cpc r1, r20 33dd8: 05 06 cpc r0, r21 33dda: 08 95 ret 00033ddc <__fp_round>: 33ddc: 09 2e mov r0, r25 33dde: 03 94 inc r0 33de0: 00 0c add r0, r0 33de2: 11 f4 brne .+4 ; 0x33de8 <__fp_round+0xc> 33de4: 88 23 and r24, r24 33de6: 52 f0 brmi .+20 ; 0x33dfc <__fp_round+0x20> 33de8: bb 0f add r27, r27 33dea: 40 f4 brcc .+16 ; 0x33dfc <__fp_round+0x20> 33dec: bf 2b or r27, r31 33dee: 11 f4 brne .+4 ; 0x33df4 <__fp_round+0x18> 33df0: 60 ff sbrs r22, 0 33df2: 04 c0 rjmp .+8 ; 0x33dfc <__fp_round+0x20> 33df4: 6f 5f subi r22, 0xFF ; 255 33df6: 7f 4f sbci r23, 0xFF ; 255 33df8: 8f 4f sbci r24, 0xFF ; 255 33dfa: 9f 4f sbci r25, 0xFF ; 255 33dfc: 08 95 ret 00033dfe <__fp_split3>: 33dfe: 57 fd sbrc r21, 7 33e00: 90 58 subi r25, 0x80 ; 128 33e02: 44 0f add r20, r20 33e04: 55 1f adc r21, r21 33e06: 59 f0 breq .+22 ; 0x33e1e <__fp_splitA+0x10> 33e08: 5f 3f cpi r21, 0xFF ; 255 33e0a: 71 f0 breq .+28 ; 0x33e28 <__fp_splitA+0x1a> 33e0c: 47 95 ror r20 00033e0e <__fp_splitA>: 33e0e: 88 0f add r24, r24 33e10: 97 fb bst r25, 7 33e12: 99 1f adc r25, r25 33e14: 61 f0 breq .+24 ; 0x33e2e <__fp_splitA+0x20> 33e16: 9f 3f cpi r25, 0xFF ; 255 33e18: 79 f0 breq .+30 ; 0x33e38 <__fp_splitA+0x2a> 33e1a: 87 95 ror r24 33e1c: 08 95 ret 33e1e: 12 16 cp r1, r18 33e20: 13 06 cpc r1, r19 33e22: 14 06 cpc r1, r20 33e24: 55 1f adc r21, r21 33e26: f2 cf rjmp .-28 ; 0x33e0c <__fp_split3+0xe> 33e28: 46 95 lsr r20 33e2a: f1 df rcall .-30 ; 0x33e0e <__fp_splitA> 33e2c: 08 c0 rjmp .+16 ; 0x33e3e <__fp_splitA+0x30> 33e2e: 16 16 cp r1, r22 33e30: 17 06 cpc r1, r23 33e32: 18 06 cpc r1, r24 33e34: 99 1f adc r25, r25 33e36: f1 cf rjmp .-30 ; 0x33e1a <__fp_splitA+0xc> 33e38: 86 95 lsr r24 33e3a: 71 05 cpc r23, r1 33e3c: 61 05 cpc r22, r1 33e3e: 08 94 sec 33e40: 08 95 ret 00033e42 <__fp_zero>: 33e42: e8 94 clt 00033e44 <__fp_szero>: 33e44: bb 27 eor r27, r27 33e46: 66 27 eor r22, r22 33e48: 77 27 eor r23, r23 33e4a: cb 01 movw r24, r22 33e4c: 97 f9 bld r25, 7 33e4e: 08 95 ret 00033e50 : 33e50: 3f 92 push r3 33e52: 4f 92 push r4 33e54: 5f 92 push r5 33e56: 6f 92 push r6 33e58: 7f 92 push r7 33e5a: 8f 92 push r8 33e5c: 9f 92 push r9 33e5e: af 92 push r10 33e60: bf 92 push r11 33e62: cf 92 push r12 33e64: df 92 push r13 33e66: ef 92 push r14 33e68: ff 92 push r15 33e6a: 0f 93 push r16 33e6c: 1f 93 push r17 33e6e: cf 93 push r28 33e70: df 93 push r29 33e72: 5c 01 movw r10, r24 33e74: 6b 01 movw r12, r22 33e76: 7a 01 movw r14, r20 33e78: 61 15 cp r22, r1 33e7a: 71 05 cpc r23, r1 33e7c: 19 f0 breq .+6 ; 0x33e84 33e7e: fb 01 movw r30, r22 33e80: 91 83 std Z+1, r25 ; 0x01 33e82: 80 83 st Z, r24 33e84: e1 14 cp r14, r1 33e86: f1 04 cpc r15, r1 33e88: 51 f0 breq .+20 ; 0x33e9e 33e8a: c7 01 movw r24, r14 33e8c: 02 97 sbiw r24, 0x02 ; 2 33e8e: 83 97 sbiw r24, 0x23 ; 35 33e90: 30 f0 brcs .+12 ; 0x33e9e 33e92: 40 e0 ldi r20, 0x00 ; 0 33e94: 30 e0 ldi r19, 0x00 ; 0 33e96: 20 e0 ldi r18, 0x00 ; 0 33e98: 90 e0 ldi r25, 0x00 ; 0 33e9a: 6b c0 rjmp .+214 ; 0x33f72 33e9c: 5e 01 movw r10, r28 33e9e: e5 01 movw r28, r10 33ea0: 21 96 adiw r28, 0x01 ; 1 33ea2: f5 01 movw r30, r10 33ea4: 10 81 ld r17, Z 33ea6: 81 2f mov r24, r17 33ea8: 90 e0 ldi r25, 0x00 ; 0 33eaa: 0f 94 2e a1 call 0x3425c ; 0x3425c 33eae: 89 2b or r24, r25 33eb0: a9 f7 brne .-22 ; 0x33e9c 33eb2: 1d 32 cpi r17, 0x2D ; 45 33eb4: 01 f5 brne .+64 ; 0x33ef6 33eb6: 21 96 adiw r28, 0x01 ; 1 33eb8: f5 01 movw r30, r10 33eba: 11 81 ldd r17, Z+1 ; 0x01 33ebc: 01 e0 ldi r16, 0x01 ; 1 33ebe: e1 14 cp r14, r1 33ec0: f1 04 cpc r15, r1 33ec2: 09 f4 brne .+2 ; 0x33ec6 33ec4: e6 c0 rjmp .+460 ; 0x34092 33ec6: f0 e1 ldi r31, 0x10 ; 16 33ec8: ef 16 cp r14, r31 33eca: f1 04 cpc r15, r1 33ecc: 09 f0 breq .+2 ; 0x33ed0 33ece: 88 c0 rjmp .+272 ; 0x33fe0 33ed0: 10 33 cpi r17, 0x30 ; 48 33ed2: 59 f4 brne .+22 ; 0x33eea 33ed4: 88 81 ld r24, Y 33ed6: 8f 7d andi r24, 0xDF ; 223 33ed8: 88 35 cpi r24, 0x58 ; 88 33eda: 09 f0 breq .+2 ; 0x33ede 33edc: 7c c0 rjmp .+248 ; 0x33fd6 33ede: 19 81 ldd r17, Y+1 ; 0x01 33ee0: 22 96 adiw r28, 0x02 ; 2 33ee2: 02 60 ori r16, 0x02 ; 2 33ee4: f0 e1 ldi r31, 0x10 ; 16 33ee6: ef 2e mov r14, r31 33ee8: f1 2c mov r15, r1 33eea: 81 2c mov r8, r1 33eec: 91 2c mov r9, r1 33eee: a1 2c mov r10, r1 33ef0: 88 e0 ldi r24, 0x08 ; 8 33ef2: b8 2e mov r11, r24 33ef4: 92 c0 rjmp .+292 ; 0x3401a 33ef6: 1b 32 cpi r17, 0x2B ; 43 33ef8: 21 f4 brne .+8 ; 0x33f02 33efa: e5 01 movw r28, r10 33efc: 22 96 adiw r28, 0x02 ; 2 33efe: f5 01 movw r30, r10 33f00: 11 81 ldd r17, Z+1 ; 0x01 33f02: 00 e0 ldi r16, 0x00 ; 0 33f04: dc cf rjmp .-72 ; 0x33ebe 33f06: ea e0 ldi r30, 0x0A ; 10 33f08: ee 16 cp r14, r30 33f0a: f1 04 cpc r15, r1 33f0c: 09 f4 brne .+2 ; 0x33f10 33f0e: c7 c0 rjmp .+398 ; 0x3409e 33f10: f0 e1 ldi r31, 0x10 ; 16 33f12: ef 16 cp r14, r31 33f14: f1 04 cpc r15, r1 33f16: 09 f0 breq .+2 ; 0x33f1a 33f18: 73 c0 rjmp .+230 ; 0x34000 33f1a: e7 cf rjmp .-50 ; 0x33eea 33f1c: 78 e0 ldi r23, 0x08 ; 8 33f1e: e7 2e mov r14, r23 33f20: f1 2c mov r15, r1 33f22: 81 2c mov r8, r1 33f24: 91 2c mov r9, r1 33f26: a1 2c mov r10, r1 33f28: 60 e1 ldi r22, 0x10 ; 16 33f2a: b6 2e mov r11, r22 33f2c: 76 c0 rjmp .+236 ; 0x3401a 33f2e: 21 e0 ldi r18, 0x01 ; 1 33f30: ad c0 rjmp .+346 ; 0x3408c 33f32: 30 2f mov r19, r16 33f34: 31 70 andi r19, 0x01 ; 1 33f36: c1 14 cp r12, r1 33f38: d1 04 cpc r13, r1 33f3a: 31 f0 breq .+12 ; 0x33f48 33f3c: 22 23 and r18, r18 33f3e: 71 f1 breq .+92 ; 0x33f9c 33f40: 21 97 sbiw r28, 0x01 ; 1 33f42: f6 01 movw r30, r12 33f44: d1 83 std Z+1, r29 ; 0x01 33f46: c0 83 st Z, r28 33f48: 27 ff sbrs r18, 7 33f4a: 2e c0 rjmp .+92 ; 0x33fa8 33f4c: 60 e0 ldi r22, 0x00 ; 0 33f4e: 70 e0 ldi r23, 0x00 ; 0 33f50: 80 e0 ldi r24, 0x00 ; 0 33f52: 90 e8 ldi r25, 0x80 ; 128 33f54: 31 11 cpse r19, r1 33f56: 04 c0 rjmp .+8 ; 0x33f60 33f58: 6f ef ldi r22, 0xFF ; 255 33f5a: 7f ef ldi r23, 0xFF ; 255 33f5c: 8f ef ldi r24, 0xFF ; 255 33f5e: 9f e7 ldi r25, 0x7F ; 127 33f60: 22 e2 ldi r18, 0x22 ; 34 33f62: 30 e0 ldi r19, 0x00 ; 0 33f64: 30 93 0c 17 sts 0x170C, r19 ; 0x80170c 33f68: 20 93 0b 17 sts 0x170B, r18 ; 0x80170b 33f6c: 46 2f mov r20, r22 33f6e: 37 2f mov r19, r23 33f70: 28 2f mov r18, r24 33f72: 64 2f mov r22, r20 33f74: 73 2f mov r23, r19 33f76: 82 2f mov r24, r18 33f78: df 91 pop r29 33f7a: cf 91 pop r28 33f7c: 1f 91 pop r17 33f7e: 0f 91 pop r16 33f80: ff 90 pop r15 33f82: ef 90 pop r14 33f84: df 90 pop r13 33f86: cf 90 pop r12 33f88: bf 90 pop r11 33f8a: af 90 pop r10 33f8c: 9f 90 pop r9 33f8e: 8f 90 pop r8 33f90: 7f 90 pop r7 33f92: 6f 90 pop r6 33f94: 5f 90 pop r5 33f96: 4f 90 pop r4 33f98: 3f 90 pop r3 33f9a: 08 95 ret 33f9c: 01 ff sbrs r16, 1 33f9e: 04 c0 rjmp .+8 ; 0x33fa8 33fa0: 22 97 sbiw r28, 0x02 ; 2 33fa2: f6 01 movw r30, r12 33fa4: d1 83 std Z+1, r29 ; 0x01 33fa6: c0 83 st Z, r28 33fa8: 33 23 and r19, r19 33faa: 41 f0 breq .+16 ; 0x33fbc 33fac: 90 95 com r25 33fae: 80 95 com r24 33fb0: 70 95 com r23 33fb2: 61 95 neg r22 33fb4: 7f 4f sbci r23, 0xFF ; 255 33fb6: 8f 4f sbci r24, 0xFF ; 255 33fb8: 9f 4f sbci r25, 0xFF ; 255 33fba: d8 cf rjmp .-80 ; 0x33f6c 33fbc: 97 ff sbrs r25, 7 33fbe: d6 cf rjmp .-84 ; 0x33f6c 33fc0: 82 e2 ldi r24, 0x22 ; 34 33fc2: 90 e0 ldi r25, 0x00 ; 0 33fc4: 90 93 0c 17 sts 0x170C, r25 ; 0x80170c 33fc8: 80 93 0b 17 sts 0x170B, r24 ; 0x80170b 33fcc: 6f ef ldi r22, 0xFF ; 255 33fce: 7f ef ldi r23, 0xFF ; 255 33fd0: 8f ef ldi r24, 0xFF ; 255 33fd2: 9f e7 ldi r25, 0x7F ; 127 33fd4: cb cf rjmp .-106 ; 0x33f6c 33fd6: 10 e3 ldi r17, 0x30 ; 48 33fd8: e1 14 cp r14, r1 33fda: f1 04 cpc r15, r1 33fdc: 09 f4 brne .+2 ; 0x33fe0 33fde: 9e cf rjmp .-196 ; 0x33f1c 33fe0: 28 e0 ldi r18, 0x08 ; 8 33fe2: e2 16 cp r14, r18 33fe4: f1 04 cpc r15, r1 33fe6: 09 f4 brne .+2 ; 0x33fea 33fe8: 9c cf rjmp .-200 ; 0x33f22 33fea: 0c f0 brlt .+2 ; 0x33fee 33fec: 8c cf rjmp .-232 ; 0x33f06 33fee: 81 2c mov r8, r1 33ff0: 91 2c mov r9, r1 33ff2: a1 2c mov r10, r1 33ff4: e0 e4 ldi r30, 0x40 ; 64 33ff6: be 2e mov r11, r30 33ff8: 82 e0 ldi r24, 0x02 ; 2 33ffa: e8 16 cp r14, r24 33ffc: f1 04 cpc r15, r1 33ffe: 69 f0 breq .+26 ; 0x3401a 34000: 60 e0 ldi r22, 0x00 ; 0 34002: 70 e0 ldi r23, 0x00 ; 0 34004: 80 e0 ldi r24, 0x00 ; 0 34006: 90 e8 ldi r25, 0x80 ; 128 34008: 97 01 movw r18, r14 3400a: 0f 2c mov r0, r15 3400c: 00 0c add r0, r0 3400e: 44 0b sbc r20, r20 34010: 55 0b sbc r21, r21 34012: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 34016: 49 01 movw r8, r18 34018: 5a 01 movw r10, r20 3401a: 20 e0 ldi r18, 0x00 ; 0 3401c: 60 e0 ldi r22, 0x00 ; 0 3401e: 70 e0 ldi r23, 0x00 ; 0 34020: cb 01 movw r24, r22 34022: 27 01 movw r4, r14 34024: 0f 2c mov r0, r15 34026: 00 0c add r0, r0 34028: 66 08 sbc r6, r6 3402a: 77 08 sbc r7, r7 3402c: fe 01 movw r30, r28 3402e: 50 ed ldi r21, 0xD0 ; 208 34030: 35 2e mov r3, r21 34032: 31 0e add r3, r17 34034: 39 e0 ldi r19, 0x09 ; 9 34036: 33 15 cp r19, r3 34038: 70 f4 brcc .+28 ; 0x34056 3403a: 3f eb ldi r19, 0xBF ; 191 3403c: 31 0f add r19, r17 3403e: 49 ec ldi r20, 0xC9 ; 201 34040: 34 2e mov r3, r20 34042: 3a 31 cpi r19, 0x1A ; 26 34044: 38 f0 brcs .+14 ; 0x34054 34046: 3f e9 ldi r19, 0x9F ; 159 34048: 31 0f add r19, r17 3404a: 3a 31 cpi r19, 0x1A ; 26 3404c: 08 f0 brcs .+2 ; 0x34050 3404e: 71 cf rjmp .-286 ; 0x33f32 34050: 39 ea ldi r19, 0xA9 ; 169 34052: 33 2e mov r3, r19 34054: 31 0e add r3, r17 34056: 3e 14 cp r3, r14 34058: 1f 04 cpc r1, r15 3405a: 0c f0 brlt .+2 ; 0x3405e 3405c: 6a cf rjmp .-300 ; 0x33f32 3405e: 27 fd sbrc r18, 7 34060: 15 c0 rjmp .+42 ; 0x3408c 34062: 86 16 cp r8, r22 34064: 97 06 cpc r9, r23 34066: a8 06 cpc r10, r24 34068: b9 06 cpc r11, r25 3406a: 78 f0 brcs .+30 ; 0x3408a 3406c: a3 01 movw r20, r6 3406e: 92 01 movw r18, r4 34070: 0f 94 00 a4 call 0x34800 ; 0x34800 <__mulsi3> 34074: 63 0d add r22, r3 34076: 71 1d adc r23, r1 34078: 81 1d adc r24, r1 3407a: 91 1d adc r25, r1 3407c: 61 30 cpi r22, 0x01 ; 1 3407e: 71 05 cpc r23, r1 34080: 81 05 cpc r24, r1 34082: 20 e8 ldi r18, 0x80 ; 128 34084: 92 07 cpc r25, r18 34086: 08 f4 brcc .+2 ; 0x3408a 34088: 52 cf rjmp .-348 ; 0x33f2e 3408a: 2f ef ldi r18, 0xFF ; 255 3408c: 21 96 adiw r28, 0x01 ; 1 3408e: 10 81 ld r17, Z 34090: cd cf rjmp .-102 ; 0x3402c 34092: 10 33 cpi r17, 0x30 ; 48 34094: 09 f4 brne .+2 ; 0x34098 34096: 1e cf rjmp .-452 ; 0x33ed4 34098: 2a e0 ldi r18, 0x0A ; 10 3409a: e2 2e mov r14, r18 3409c: f1 2c mov r15, r1 3409e: 9c ec ldi r25, 0xCC ; 204 340a0: 89 2e mov r8, r25 340a2: 98 2c mov r9, r8 340a4: a8 2c mov r10, r8 340a6: 9c e0 ldi r25, 0x0C ; 12 340a8: b9 2e mov r11, r25 340aa: b7 cf rjmp .-146 ; 0x3401a 000340ac <__ftoa_engine>: 340ac: 28 30 cpi r18, 0x08 ; 8 340ae: 08 f0 brcs .+2 ; 0x340b2 <__ftoa_engine+0x6> 340b0: 27 e0 ldi r18, 0x07 ; 7 340b2: 33 27 eor r19, r19 340b4: da 01 movw r26, r20 340b6: 99 0f add r25, r25 340b8: 31 1d adc r19, r1 340ba: 87 fd sbrc r24, 7 340bc: 91 60 ori r25, 0x01 ; 1 340be: 00 96 adiw r24, 0x00 ; 0 340c0: 61 05 cpc r22, r1 340c2: 71 05 cpc r23, r1 340c4: 39 f4 brne .+14 ; 0x340d4 <__ftoa_engine+0x28> 340c6: 32 60 ori r19, 0x02 ; 2 340c8: 2e 5f subi r18, 0xFE ; 254 340ca: 3d 93 st X+, r19 340cc: 30 e3 ldi r19, 0x30 ; 48 340ce: 2a 95 dec r18 340d0: e1 f7 brne .-8 ; 0x340ca <__ftoa_engine+0x1e> 340d2: 08 95 ret 340d4: 9f 3f cpi r25, 0xFF ; 255 340d6: 30 f0 brcs .+12 ; 0x340e4 <__ftoa_engine+0x38> 340d8: 80 38 cpi r24, 0x80 ; 128 340da: 71 05 cpc r23, r1 340dc: 61 05 cpc r22, r1 340de: 09 f0 breq .+2 ; 0x340e2 <__ftoa_engine+0x36> 340e0: 3c 5f subi r19, 0xFC ; 252 340e2: 3c 5f subi r19, 0xFC ; 252 340e4: 3d 93 st X+, r19 340e6: 91 30 cpi r25, 0x01 ; 1 340e8: 08 f0 brcs .+2 ; 0x340ec <__ftoa_engine+0x40> 340ea: 80 68 ori r24, 0x80 ; 128 340ec: 91 1d adc r25, r1 340ee: df 93 push r29 340f0: cf 93 push r28 340f2: 1f 93 push r17 340f4: 0f 93 push r16 340f6: ff 92 push r15 340f8: ef 92 push r14 340fa: 19 2f mov r17, r25 340fc: 98 7f andi r25, 0xF8 ; 248 340fe: 96 95 lsr r25 34100: e9 2f mov r30, r25 34102: 96 95 lsr r25 34104: 96 95 lsr r25 34106: e9 0f add r30, r25 34108: ff 27 eor r31, r31 3410a: e6 52 subi r30, 0x26 ; 38 3410c: fe 48 sbci r31, 0x8E ; 142 3410e: 99 27 eor r25, r25 34110: 33 27 eor r19, r19 34112: ee 24 eor r14, r14 34114: ff 24 eor r15, r15 34116: a7 01 movw r20, r14 34118: e7 01 movw r28, r14 3411a: 05 90 lpm r0, Z+ 3411c: 08 94 sec 3411e: 07 94 ror r0 34120: 28 f4 brcc .+10 ; 0x3412c <__ftoa_engine+0x80> 34122: 36 0f add r19, r22 34124: e7 1e adc r14, r23 34126: f8 1e adc r15, r24 34128: 49 1f adc r20, r25 3412a: 51 1d adc r21, r1 3412c: 66 0f add r22, r22 3412e: 77 1f adc r23, r23 34130: 88 1f adc r24, r24 34132: 99 1f adc r25, r25 34134: 06 94 lsr r0 34136: a1 f7 brne .-24 ; 0x34120 <__ftoa_engine+0x74> 34138: 05 90 lpm r0, Z+ 3413a: 07 94 ror r0 3413c: 28 f4 brcc .+10 ; 0x34148 <__ftoa_engine+0x9c> 3413e: e7 0e add r14, r23 34140: f8 1e adc r15, r24 34142: 49 1f adc r20, r25 34144: 56 1f adc r21, r22 34146: c1 1d adc r28, r1 34148: 77 0f add r23, r23 3414a: 88 1f adc r24, r24 3414c: 99 1f adc r25, r25 3414e: 66 1f adc r22, r22 34150: 06 94 lsr r0 34152: a1 f7 brne .-24 ; 0x3413c <__ftoa_engine+0x90> 34154: 05 90 lpm r0, Z+ 34156: 07 94 ror r0 34158: 28 f4 brcc .+10 ; 0x34164 <__ftoa_engine+0xb8> 3415a: f8 0e add r15, r24 3415c: 49 1f adc r20, r25 3415e: 56 1f adc r21, r22 34160: c7 1f adc r28, r23 34162: d1 1d adc r29, r1 34164: 88 0f add r24, r24 34166: 99 1f adc r25, r25 34168: 66 1f adc r22, r22 3416a: 77 1f adc r23, r23 3416c: 06 94 lsr r0 3416e: a1 f7 brne .-24 ; 0x34158 <__ftoa_engine+0xac> 34170: 05 90 lpm r0, Z+ 34172: 07 94 ror r0 34174: 20 f4 brcc .+8 ; 0x3417e <__ftoa_engine+0xd2> 34176: 49 0f add r20, r25 34178: 56 1f adc r21, r22 3417a: c7 1f adc r28, r23 3417c: d8 1f adc r29, r24 3417e: 99 0f add r25, r25 34180: 66 1f adc r22, r22 34182: 77 1f adc r23, r23 34184: 88 1f adc r24, r24 34186: 06 94 lsr r0 34188: a9 f7 brne .-22 ; 0x34174 <__ftoa_engine+0xc8> 3418a: 84 91 lpm r24, Z 3418c: 10 95 com r17 3418e: 17 70 andi r17, 0x07 ; 7 34190: 41 f0 breq .+16 ; 0x341a2 <__ftoa_engine+0xf6> 34192: d6 95 lsr r29 34194: c7 95 ror r28 34196: 57 95 ror r21 34198: 47 95 ror r20 3419a: f7 94 ror r15 3419c: e7 94 ror r14 3419e: 1a 95 dec r17 341a0: c1 f7 brne .-16 ; 0x34192 <__ftoa_engine+0xe6> 341a2: e0 e8 ldi r30, 0x80 ; 128 341a4: f1 e7 ldi r31, 0x71 ; 113 341a6: 68 94 set 341a8: 15 90 lpm r1, Z+ 341aa: 15 91 lpm r17, Z+ 341ac: 35 91 lpm r19, Z+ 341ae: 65 91 lpm r22, Z+ 341b0: 95 91 lpm r25, Z+ 341b2: 05 90 lpm r0, Z+ 341b4: 7f e2 ldi r23, 0x2F ; 47 341b6: 73 95 inc r23 341b8: e1 18 sub r14, r1 341ba: f1 0a sbc r15, r17 341bc: 43 0b sbc r20, r19 341be: 56 0b sbc r21, r22 341c0: c9 0b sbc r28, r25 341c2: d0 09 sbc r29, r0 341c4: c0 f7 brcc .-16 ; 0x341b6 <__ftoa_engine+0x10a> 341c6: e1 0c add r14, r1 341c8: f1 1e adc r15, r17 341ca: 43 1f adc r20, r19 341cc: 56 1f adc r21, r22 341ce: c9 1f adc r28, r25 341d0: d0 1d adc r29, r0 341d2: 7e f4 brtc .+30 ; 0x341f2 <__ftoa_engine+0x146> 341d4: 70 33 cpi r23, 0x30 ; 48 341d6: 11 f4 brne .+4 ; 0x341dc <__ftoa_engine+0x130> 341d8: 8a 95 dec r24 341da: e6 cf rjmp .-52 ; 0x341a8 <__ftoa_engine+0xfc> 341dc: e8 94 clt 341de: 01 50 subi r16, 0x01 ; 1 341e0: 30 f0 brcs .+12 ; 0x341ee <__ftoa_engine+0x142> 341e2: 08 0f add r16, r24 341e4: 0a f4 brpl .+2 ; 0x341e8 <__ftoa_engine+0x13c> 341e6: 00 27 eor r16, r16 341e8: 02 17 cp r16, r18 341ea: 08 f4 brcc .+2 ; 0x341ee <__ftoa_engine+0x142> 341ec: 20 2f mov r18, r16 341ee: 23 95 inc r18 341f0: 02 2f mov r16, r18 341f2: 7a 33 cpi r23, 0x3A ; 58 341f4: 28 f0 brcs .+10 ; 0x34200 <__ftoa_engine+0x154> 341f6: 79 e3 ldi r23, 0x39 ; 57 341f8: 7d 93 st X+, r23 341fa: 2a 95 dec r18 341fc: e9 f7 brne .-6 ; 0x341f8 <__ftoa_engine+0x14c> 341fe: 10 c0 rjmp .+32 ; 0x34220 <__ftoa_engine+0x174> 34200: 7d 93 st X+, r23 34202: 2a 95 dec r18 34204: 89 f6 brne .-94 ; 0x341a8 <__ftoa_engine+0xfc> 34206: 06 94 lsr r0 34208: 97 95 ror r25 3420a: 67 95 ror r22 3420c: 37 95 ror r19 3420e: 17 95 ror r17 34210: 17 94 ror r1 34212: e1 18 sub r14, r1 34214: f1 0a sbc r15, r17 34216: 43 0b sbc r20, r19 34218: 56 0b sbc r21, r22 3421a: c9 0b sbc r28, r25 3421c: d0 09 sbc r29, r0 3421e: 98 f0 brcs .+38 ; 0x34246 <__ftoa_engine+0x19a> 34220: 23 95 inc r18 34222: 7e 91 ld r23, -X 34224: 73 95 inc r23 34226: 7a 33 cpi r23, 0x3A ; 58 34228: 08 f0 brcs .+2 ; 0x3422c <__ftoa_engine+0x180> 3422a: 70 e3 ldi r23, 0x30 ; 48 3422c: 7c 93 st X, r23 3422e: 20 13 cpse r18, r16 34230: b8 f7 brcc .-18 ; 0x34220 <__ftoa_engine+0x174> 34232: 7e 91 ld r23, -X 34234: 70 61 ori r23, 0x10 ; 16 34236: 7d 93 st X+, r23 34238: 30 f0 brcs .+12 ; 0x34246 <__ftoa_engine+0x19a> 3423a: 83 95 inc r24 3423c: 71 e3 ldi r23, 0x31 ; 49 3423e: 7d 93 st X+, r23 34240: 70 e3 ldi r23, 0x30 ; 48 34242: 2a 95 dec r18 34244: e1 f7 brne .-8 ; 0x3423e <__ftoa_engine+0x192> 34246: 11 24 eor r1, r1 34248: ef 90 pop r14 3424a: ff 90 pop r15 3424c: 0f 91 pop r16 3424e: 1f 91 pop r17 34250: cf 91 pop r28 34252: df 91 pop r29 34254: 99 27 eor r25, r25 34256: 87 fd sbrc r24, 7 34258: 90 95 com r25 3425a: 08 95 ret 0003425c : 3425c: 91 11 cpse r25, r1 3425e: 0d 94 8a a3 jmp 0x34714 ; 0x34714 <__ctype_isfalse> 34262: 80 32 cpi r24, 0x20 ; 32 34264: 19 f0 breq .+6 ; 0x3426c 34266: 89 50 subi r24, 0x09 ; 9 34268: 85 50 subi r24, 0x05 ; 5 3426a: c8 f7 brcc .-14 ; 0x3425e 3426c: 08 95 ret 0003426e : 3426e: fb 01 movw r30, r22 34270: dc 01 movw r26, r24 34272: 02 c0 rjmp .+4 ; 0x34278 34274: 05 90 lpm r0, Z+ 34276: 0d 92 st X+, r0 34278: 41 50 subi r20, 0x01 ; 1 3427a: 50 40 sbci r21, 0x00 ; 0 3427c: d8 f7 brcc .-10 ; 0x34274 3427e: 08 95 ret 00034280 : 34280: fb 01 movw r30, r22 34282: dc 01 movw r26, r24 34284: 0d 90 ld r0, X+ 34286: 00 20 and r0, r0 34288: e9 f7 brne .-6 ; 0x34284 3428a: 11 97 sbiw r26, 0x01 ; 1 3428c: 05 90 lpm r0, Z+ 3428e: 0d 92 st X+, r0 34290: 00 20 and r0, r0 34292: e1 f7 brne .-8 ; 0x3428c 34294: 08 95 ret 00034296 : 34296: fb 01 movw r30, r22 34298: dc 01 movw r26, r24 3429a: 8d 91 ld r24, X+ 3429c: 05 90 lpm r0, Z+ 3429e: 80 19 sub r24, r0 342a0: 01 10 cpse r0, r1 342a2: d9 f3 breq .-10 ; 0x3429a 342a4: 99 0b sbc r25, r25 342a6: 08 95 ret 000342a8 : 342a8: fb 01 movw r30, r22 342aa: dc 01 movw r26, r24 342ac: 05 90 lpm r0, Z+ 342ae: 0d 92 st X+, r0 342b0: 00 20 and r0, r0 342b2: e1 f7 brne .-8 ; 0x342ac 342b4: 08 95 ret 000342b6 <__strlen_P>: 342b6: fc 01 movw r30, r24 342b8: 05 90 lpm r0, Z+ 342ba: 00 20 and r0, r0 342bc: e9 f7 brne .-6 ; 0x342b8 <__strlen_P+0x2> 342be: 80 95 com r24 342c0: 90 95 com r25 342c2: 8e 0f add r24, r30 342c4: 9f 1f adc r25, r31 342c6: 08 95 ret 000342c8 : 342c8: fb 01 movw r30, r22 342ca: dc 01 movw r26, r24 342cc: 41 50 subi r20, 0x01 ; 1 342ce: 50 40 sbci r21, 0x00 ; 0 342d0: 88 f0 brcs .+34 ; 0x342f4 342d2: 8d 91 ld r24, X+ 342d4: 81 34 cpi r24, 0x41 ; 65 342d6: 1c f0 brlt .+6 ; 0x342de 342d8: 8b 35 cpi r24, 0x5B ; 91 342da: 0c f4 brge .+2 ; 0x342de 342dc: 80 5e subi r24, 0xE0 ; 224 342de: 65 91 lpm r22, Z+ 342e0: 61 34 cpi r22, 0x41 ; 65 342e2: 1c f0 brlt .+6 ; 0x342ea 342e4: 6b 35 cpi r22, 0x5B ; 91 342e6: 0c f4 brge .+2 ; 0x342ea 342e8: 60 5e subi r22, 0xE0 ; 224 342ea: 86 1b sub r24, r22 342ec: 61 11 cpse r22, r1 342ee: 71 f3 breq .-36 ; 0x342cc 342f0: 99 0b sbc r25, r25 342f2: 08 95 ret 342f4: 88 1b sub r24, r24 342f6: fc cf rjmp .-8 ; 0x342f0 000342f8 : 342f8: fb 01 movw r30, r22 342fa: dc 01 movw r26, r24 342fc: 41 50 subi r20, 0x01 ; 1 342fe: 50 40 sbci r21, 0x00 ; 0 34300: 30 f0 brcs .+12 ; 0x3430e 34302: 8d 91 ld r24, X+ 34304: 05 90 lpm r0, Z+ 34306: 80 19 sub r24, r0 34308: 19 f4 brne .+6 ; 0x34310 3430a: 00 20 and r0, r0 3430c: b9 f7 brne .-18 ; 0x342fc 3430e: 88 1b sub r24, r24 34310: 99 0b sbc r25, r25 34312: 08 95 ret 00034314 : 34314: fb 01 movw r30, r22 34316: dc 01 movw r26, r24 34318: 41 50 subi r20, 0x01 ; 1 3431a: 50 40 sbci r21, 0x00 ; 0 3431c: 48 f0 brcs .+18 ; 0x34330 3431e: 05 90 lpm r0, Z+ 34320: 0d 92 st X+, r0 34322: 00 20 and r0, r0 34324: c9 f7 brne .-14 ; 0x34318 34326: 01 c0 rjmp .+2 ; 0x3432a 34328: 1d 92 st X+, r1 3432a: 41 50 subi r20, 0x01 ; 1 3432c: 50 40 sbci r21, 0x00 ; 0 3432e: e0 f7 brcc .-8 ; 0x34328 34330: 08 95 ret 00034332 : 34332: fc 01 movw r30, r24 34334: 05 90 lpm r0, Z+ 34336: 61 50 subi r22, 0x01 ; 1 34338: 70 40 sbci r23, 0x00 ; 0 3433a: 01 10 cpse r0, r1 3433c: d8 f7 brcc .-10 ; 0x34334 3433e: 80 95 com r24 34340: 90 95 com r25 34342: 8e 0f add r24, r30 34344: 9f 1f adc r25, r31 34346: 08 95 ret 00034348 : 34348: fb 01 movw r30, r22 3434a: 55 91 lpm r21, Z+ 3434c: 55 23 and r21, r21 3434e: a9 f0 breq .+42 ; 0x3437a 34350: bf 01 movw r22, r30 34352: dc 01 movw r26, r24 34354: 4d 91 ld r20, X+ 34356: 45 17 cp r20, r21 34358: 41 11 cpse r20, r1 3435a: e1 f7 brne .-8 ; 0x34354 3435c: 59 f4 brne .+22 ; 0x34374 3435e: cd 01 movw r24, r26 34360: 05 90 lpm r0, Z+ 34362: 00 20 and r0, r0 34364: 49 f0 breq .+18 ; 0x34378 34366: 4d 91 ld r20, X+ 34368: 40 15 cp r20, r0 3436a: 41 11 cpse r20, r1 3436c: c9 f3 breq .-14 ; 0x34360 3436e: fb 01 movw r30, r22 34370: 41 11 cpse r20, r1 34372: ef cf rjmp .-34 ; 0x34352 34374: 81 e0 ldi r24, 0x01 ; 1 34376: 90 e0 ldi r25, 0x00 ; 0 34378: 01 97 sbiw r24, 0x01 ; 1 3437a: 08 95 ret 0003437c : 3437c: fc 01 movw r30, r24 3437e: 61 50 subi r22, 0x01 ; 1 34380: 70 40 sbci r23, 0x00 ; 0 34382: 01 90 ld r0, Z+ 34384: 01 10 cpse r0, r1 34386: d8 f7 brcc .-10 ; 0x3437e 34388: 80 95 com r24 3438a: 90 95 com r25 3438c: 8e 0f add r24, r30 3438e: 9f 1f adc r25, r31 34390: 08 95 ret 00034392 : 34392: cf 93 push r28 34394: df 93 push r29 34396: ec 01 movw r28, r24 34398: 2b 81 ldd r18, Y+3 ; 0x03 3439a: 20 ff sbrs r18, 0 3439c: 1a c0 rjmp .+52 ; 0x343d2 3439e: 26 ff sbrs r18, 6 343a0: 0c c0 rjmp .+24 ; 0x343ba 343a2: 2f 7b andi r18, 0xBF ; 191 343a4: 2b 83 std Y+3, r18 ; 0x03 343a6: 8e 81 ldd r24, Y+6 ; 0x06 343a8: 9f 81 ldd r25, Y+7 ; 0x07 343aa: 01 96 adiw r24, 0x01 ; 1 343ac: 9f 83 std Y+7, r25 ; 0x07 343ae: 8e 83 std Y+6, r24 ; 0x06 343b0: 8a 81 ldd r24, Y+2 ; 0x02 343b2: 90 e0 ldi r25, 0x00 ; 0 343b4: df 91 pop r29 343b6: cf 91 pop r28 343b8: 08 95 ret 343ba: 22 ff sbrs r18, 2 343bc: 18 c0 rjmp .+48 ; 0x343ee 343be: e8 81 ld r30, Y 343c0: f9 81 ldd r31, Y+1 ; 0x01 343c2: 80 81 ld r24, Z 343c4: 08 2e mov r0, r24 343c6: 00 0c add r0, r0 343c8: 99 0b sbc r25, r25 343ca: 00 97 sbiw r24, 0x00 ; 0 343cc: 29 f4 brne .+10 ; 0x343d8 343ce: 20 62 ori r18, 0x20 ; 32 343d0: 2b 83 std Y+3, r18 ; 0x03 343d2: 8f ef ldi r24, 0xFF ; 255 343d4: 9f ef ldi r25, 0xFF ; 255 343d6: ee cf rjmp .-36 ; 0x343b4 343d8: 31 96 adiw r30, 0x01 ; 1 343da: f9 83 std Y+1, r31 ; 0x01 343dc: e8 83 st Y, r30 343de: 2e 81 ldd r18, Y+6 ; 0x06 343e0: 3f 81 ldd r19, Y+7 ; 0x07 343e2: 2f 5f subi r18, 0xFF ; 255 343e4: 3f 4f sbci r19, 0xFF ; 255 343e6: 3f 83 std Y+7, r19 ; 0x07 343e8: 2e 83 std Y+6, r18 ; 0x06 343ea: 99 27 eor r25, r25 343ec: e3 cf rjmp .-58 ; 0x343b4 343ee: ea 85 ldd r30, Y+10 ; 0x0a 343f0: fb 85 ldd r31, Y+11 ; 0x0b 343f2: 19 95 eicall 343f4: 97 ff sbrs r25, 7 343f6: f3 cf rjmp .-26 ; 0x343de 343f8: 2b 81 ldd r18, Y+3 ; 0x03 343fa: 01 96 adiw r24, 0x01 ; 1 343fc: 21 f0 breq .+8 ; 0x34406 343fe: 80 e2 ldi r24, 0x20 ; 32 34400: 82 2b or r24, r18 34402: 8b 83 std Y+3, r24 ; 0x03 34404: e6 cf rjmp .-52 ; 0x343d2 34406: 80 e1 ldi r24, 0x10 ; 16 34408: fb cf rjmp .-10 ; 0x34400 0003440a : 3440a: 0f 93 push r16 3440c: 1f 93 push r17 3440e: cf 93 push r28 34410: df 93 push r29 34412: 18 2f mov r17, r24 34414: 09 2f mov r16, r25 34416: eb 01 movw r28, r22 34418: 8b 81 ldd r24, Y+3 ; 0x03 3441a: 81 fd sbrc r24, 1 3441c: 09 c0 rjmp .+18 ; 0x34430 3441e: 1f ef ldi r17, 0xFF ; 255 34420: 0f ef ldi r16, 0xFF ; 255 34422: 81 2f mov r24, r17 34424: 90 2f mov r25, r16 34426: df 91 pop r29 34428: cf 91 pop r28 3442a: 1f 91 pop r17 3442c: 0f 91 pop r16 3442e: 08 95 ret 34430: 82 ff sbrs r24, 2 34432: 14 c0 rjmp .+40 ; 0x3445c 34434: 2e 81 ldd r18, Y+6 ; 0x06 34436: 3f 81 ldd r19, Y+7 ; 0x07 34438: 8c 81 ldd r24, Y+4 ; 0x04 3443a: 9d 81 ldd r25, Y+5 ; 0x05 3443c: 28 17 cp r18, r24 3443e: 39 07 cpc r19, r25 34440: 3c f4 brge .+14 ; 0x34450 34442: e8 81 ld r30, Y 34444: f9 81 ldd r31, Y+1 ; 0x01 34446: cf 01 movw r24, r30 34448: 01 96 adiw r24, 0x01 ; 1 3444a: 99 83 std Y+1, r25 ; 0x01 3444c: 88 83 st Y, r24 3444e: 10 83 st Z, r17 34450: 8e 81 ldd r24, Y+6 ; 0x06 34452: 9f 81 ldd r25, Y+7 ; 0x07 34454: 01 96 adiw r24, 0x01 ; 1 34456: 9f 83 std Y+7, r25 ; 0x07 34458: 8e 83 std Y+6, r24 ; 0x06 3445a: e3 cf rjmp .-58 ; 0x34422 3445c: e8 85 ldd r30, Y+8 ; 0x08 3445e: f9 85 ldd r31, Y+9 ; 0x09 34460: 81 2f mov r24, r17 34462: 19 95 eicall 34464: 89 2b or r24, r25 34466: a1 f3 breq .-24 ; 0x34450 34468: da cf rjmp .-76 ; 0x3441e 0003446a : 3446a: ef 92 push r14 3446c: ff 92 push r15 3446e: 0f 93 push r16 34470: 1f 93 push r17 34472: cf 93 push r28 34474: df 93 push r29 34476: 8c 01 movw r16, r24 34478: 7b 01 movw r14, r22 3447a: db 01 movw r26, r22 3447c: 13 96 adiw r26, 0x03 ; 3 3447e: 8c 91 ld r24, X 34480: d0 e0 ldi r29, 0x00 ; 0 34482: c0 e0 ldi r28, 0x00 ; 0 34484: 81 fd sbrc r24, 1 34486: 0f c0 rjmp .+30 ; 0x344a6 34488: cf ef ldi r28, 0xFF ; 255 3448a: df ef ldi r29, 0xFF ; 255 3448c: 10 c0 rjmp .+32 ; 0x344ae 3448e: d7 01 movw r26, r14 34490: 18 96 adiw r26, 0x08 ; 8 34492: ed 91 ld r30, X+ 34494: fc 91 ld r31, X 34496: b7 01 movw r22, r14 34498: 19 95 eicall 3449a: 89 2b or r24, r25 3449c: 11 f0 breq .+4 ; 0x344a2 3449e: cf ef ldi r28, 0xFF ; 255 344a0: df ef ldi r29, 0xFF ; 255 344a2: 0f 5f subi r16, 0xFF ; 255 344a4: 1f 4f sbci r17, 0xFF ; 255 344a6: f8 01 movw r30, r16 344a8: 84 91 lpm r24, Z 344aa: 81 11 cpse r24, r1 344ac: f0 cf rjmp .-32 ; 0x3448e 344ae: ce 01 movw r24, r28 344b0: df 91 pop r29 344b2: cf 91 pop r28 344b4: 1f 91 pop r17 344b6: 0f 91 pop r16 344b8: ff 90 pop r15 344ba: ef 90 pop r14 344bc: 08 95 ret 000344be : 344be: 0f 93 push r16 344c0: 1f 93 push r17 344c2: cf 93 push r28 344c4: df 93 push r29 344c6: cd b7 in r28, 0x3d ; 61 344c8: de b7 in r29, 0x3e ; 62 344ca: ae 01 movw r20, r28 344cc: 48 5f subi r20, 0xF8 ; 248 344ce: 5f 4f sbci r21, 0xFF ; 255 344d0: da 01 movw r26, r20 344d2: 6d 91 ld r22, X+ 344d4: 7d 91 ld r23, X+ 344d6: ad 01 movw r20, r26 344d8: 01 e1 ldi r16, 0x11 ; 17 344da: 17 e1 ldi r17, 0x17 ; 23 344dc: f8 01 movw r30, r16 344de: 82 81 ldd r24, Z+2 ; 0x02 344e0: 93 81 ldd r25, Z+3 ; 0x03 344e2: dc 01 movw r26, r24 344e4: 13 96 adiw r26, 0x03 ; 3 344e6: 2c 91 ld r18, X 344e8: 13 97 sbiw r26, 0x03 ; 3 344ea: 28 60 ori r18, 0x08 ; 8 344ec: 13 96 adiw r26, 0x03 ; 3 344ee: 2c 93 st X, r18 344f0: 0e 94 27 51 call 0xa24e ; 0xa24e 344f4: d8 01 movw r26, r16 344f6: 12 96 adiw r26, 0x02 ; 2 344f8: ed 91 ld r30, X+ 344fa: fc 91 ld r31, X 344fc: 23 81 ldd r18, Z+3 ; 0x03 344fe: 27 7f andi r18, 0xF7 ; 247 34500: 23 83 std Z+3, r18 ; 0x03 34502: df 91 pop r29 34504: cf 91 pop r28 34506: 1f 91 pop r17 34508: 0f 91 pop r16 3450a: 08 95 ret 0003450c : 3450c: 0f 93 push r16 3450e: 1f 93 push r17 34510: cf 93 push r28 34512: df 93 push r29 34514: 8c 01 movw r16, r24 34516: e0 91 13 17 lds r30, 0x1713 ; 0x801713 <__iob+0x2> 3451a: f0 91 14 17 lds r31, 0x1714 ; 0x801714 <__iob+0x3> 3451e: 83 81 ldd r24, Z+3 ; 0x03 34520: d0 e0 ldi r29, 0x00 ; 0 34522: c0 e0 ldi r28, 0x00 ; 0 34524: 81 fd sbrc r24, 1 34526: 0a c0 rjmp .+20 ; 0x3453c 34528: cf ef ldi r28, 0xFF ; 255 3452a: df ef ldi r29, 0xFF ; 255 3452c: 17 c0 rjmp .+46 ; 0x3455c 3452e: 19 95 eicall 34530: 89 2b or r24, r25 34532: 11 f0 breq .+4 ; 0x34538 34534: cf ef ldi r28, 0xFF ; 255 34536: df ef ldi r29, 0xFF ; 255 34538: 0f 5f subi r16, 0xFF ; 255 3453a: 1f 4f sbci r17, 0xFF ; 255 3453c: f8 01 movw r30, r16 3453e: 84 91 lpm r24, Z 34540: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 34544: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 34548: db 01 movw r26, r22 3454a: 18 96 adiw r26, 0x08 ; 8 3454c: ed 91 ld r30, X+ 3454e: fc 91 ld r31, X 34550: 81 11 cpse r24, r1 34552: ed cf rjmp .-38 ; 0x3452e 34554: 8a e0 ldi r24, 0x0A ; 10 34556: 19 95 eicall 34558: 89 2b or r24, r25 3455a: 31 f7 brne .-52 ; 0x34528 3455c: ce 01 movw r24, r28 3455e: df 91 pop r29 34560: cf 91 pop r28 34562: 1f 91 pop r17 34564: 0f 91 pop r16 34566: 08 95 ret 00034568 : 34568: 0f 93 push r16 3456a: 1f 93 push r17 3456c: cf 93 push r28 3456e: df 93 push r29 34570: cd b7 in r28, 0x3d ; 61 34572: de b7 in r29, 0x3e ; 62 34574: 2e 97 sbiw r28, 0x0e ; 14 34576: 0f b6 in r0, 0x3f ; 63 34578: f8 94 cli 3457a: de bf out 0x3e, r29 ; 62 3457c: 0f be out 0x3f, r0 ; 63 3457e: cd bf out 0x3d, r28 ; 61 34580: 0e 89 ldd r16, Y+22 ; 0x16 34582: 1f 89 ldd r17, Y+23 ; 0x17 34584: 8e e0 ldi r24, 0x0E ; 14 34586: 8c 83 std Y+4, r24 ; 0x04 34588: 1a 83 std Y+2, r17 ; 0x02 3458a: 09 83 std Y+1, r16 ; 0x01 3458c: 8f ef ldi r24, 0xFF ; 255 3458e: 9f e7 ldi r25, 0x7F ; 127 34590: 9e 83 std Y+6, r25 ; 0x06 34592: 8d 83 std Y+5, r24 ; 0x05 34594: ae 01 movw r20, r28 34596: 46 5e subi r20, 0xE6 ; 230 34598: 5f 4f sbci r21, 0xFF ; 255 3459a: 68 8d ldd r22, Y+24 ; 0x18 3459c: 79 8d ldd r23, Y+25 ; 0x19 3459e: ce 01 movw r24, r28 345a0: 01 96 adiw r24, 0x01 ; 1 345a2: 0e 94 27 51 call 0xa24e ; 0xa24e 345a6: 2f 81 ldd r18, Y+7 ; 0x07 345a8: 38 85 ldd r19, Y+8 ; 0x08 345aa: 02 0f add r16, r18 345ac: 13 1f adc r17, r19 345ae: f8 01 movw r30, r16 345b0: 10 82 st Z, r1 345b2: 2e 96 adiw r28, 0x0e ; 14 345b4: 0f b6 in r0, 0x3f ; 63 345b6: f8 94 cli 345b8: de bf out 0x3e, r29 ; 62 345ba: 0f be out 0x3f, r0 ; 63 345bc: cd bf out 0x3d, r28 ; 61 345be: df 91 pop r29 345c0: cf 91 pop r28 345c2: 1f 91 pop r17 345c4: 0f 91 pop r16 345c6: 08 95 ret 000345c8 : 345c8: cf 93 push r28 345ca: df 93 push r29 345cc: ec 01 movw r28, r24 345ce: 8b 81 ldd r24, Y+3 ; 0x03 345d0: 88 60 ori r24, 0x08 ; 8 345d2: 8b 83 std Y+3, r24 ; 0x03 345d4: ce 01 movw r24, r28 345d6: 0e 94 27 51 call 0xa24e ; 0xa24e 345da: 2b 81 ldd r18, Y+3 ; 0x03 345dc: 27 7f andi r18, 0xF7 ; 247 345de: 2b 83 std Y+3, r18 ; 0x03 345e0: df 91 pop r29 345e2: cf 91 pop r28 345e4: 08 95 ret 000345e6 : 345e6: 0f 93 push r16 345e8: 1f 93 push r17 345ea: cf 93 push r28 345ec: df 93 push r29 345ee: cd b7 in r28, 0x3d ; 61 345f0: de b7 in r29, 0x3e ; 62 345f2: 2e 97 sbiw r28, 0x0e ; 14 345f4: 0f b6 in r0, 0x3f ; 63 345f6: f8 94 cli 345f8: de bf out 0x3e, r29 ; 62 345fa: 0f be out 0x3f, r0 ; 63 345fc: cd bf out 0x3d, r28 ; 61 345fe: 8c 01 movw r16, r24 34600: fa 01 movw r30, r20 34602: 8e e0 ldi r24, 0x0E ; 14 34604: 8c 83 std Y+4, r24 ; 0x04 34606: 1a 83 std Y+2, r17 ; 0x02 34608: 09 83 std Y+1, r16 ; 0x01 3460a: 77 ff sbrs r23, 7 3460c: 02 c0 rjmp .+4 ; 0x34612 3460e: 60 e0 ldi r22, 0x00 ; 0 34610: 70 e8 ldi r23, 0x80 ; 128 34612: 61 50 subi r22, 0x01 ; 1 34614: 71 09 sbc r23, r1 34616: 7e 83 std Y+6, r23 ; 0x06 34618: 6d 83 std Y+5, r22 ; 0x05 3461a: a9 01 movw r20, r18 3461c: bf 01 movw r22, r30 3461e: ce 01 movw r24, r28 34620: 01 96 adiw r24, 0x01 ; 1 34622: 0e 94 27 51 call 0xa24e ; 0xa24e 34626: 4d 81 ldd r20, Y+5 ; 0x05 34628: 5e 81 ldd r21, Y+6 ; 0x06 3462a: 57 fd sbrc r21, 7 3462c: 0a c0 rjmp .+20 ; 0x34642 3462e: 2f 81 ldd r18, Y+7 ; 0x07 34630: 38 85 ldd r19, Y+8 ; 0x08 34632: 42 17 cp r20, r18 34634: 53 07 cpc r21, r19 34636: 0c f4 brge .+2 ; 0x3463a 34638: 9a 01 movw r18, r20 3463a: 02 0f add r16, r18 3463c: 13 1f adc r17, r19 3463e: f8 01 movw r30, r16 34640: 10 82 st Z, r1 34642: 2e 96 adiw r28, 0x0e ; 14 34644: 0f b6 in r0, 0x3f ; 63 34646: f8 94 cli 34648: de bf out 0x3e, r29 ; 62 3464a: 0f be out 0x3f, r0 ; 63 3464c: cd bf out 0x3d, r28 ; 61 3464e: df 91 pop r29 34650: cf 91 pop r28 34652: 1f 91 pop r17 34654: 0f 91 pop r16 34656: 08 95 ret 00034658 <__ultoa_invert>: 34658: fa 01 movw r30, r20 3465a: aa 27 eor r26, r26 3465c: 28 30 cpi r18, 0x08 ; 8 3465e: 51 f1 breq .+84 ; 0x346b4 <__ultoa_invert+0x5c> 34660: 20 31 cpi r18, 0x10 ; 16 34662: 81 f1 breq .+96 ; 0x346c4 <__ultoa_invert+0x6c> 34664: e8 94 clt 34666: 6f 93 push r22 34668: 6e 7f andi r22, 0xFE ; 254 3466a: 6e 5f subi r22, 0xFE ; 254 3466c: 7f 4f sbci r23, 0xFF ; 255 3466e: 8f 4f sbci r24, 0xFF ; 255 34670: 9f 4f sbci r25, 0xFF ; 255 34672: af 4f sbci r26, 0xFF ; 255 34674: b1 e0 ldi r27, 0x01 ; 1 34676: 3e d0 rcall .+124 ; 0x346f4 <__ultoa_invert+0x9c> 34678: b4 e0 ldi r27, 0x04 ; 4 3467a: 3c d0 rcall .+120 ; 0x346f4 <__ultoa_invert+0x9c> 3467c: 67 0f add r22, r23 3467e: 78 1f adc r23, r24 34680: 89 1f adc r24, r25 34682: 9a 1f adc r25, r26 34684: a1 1d adc r26, r1 34686: 68 0f add r22, r24 34688: 79 1f adc r23, r25 3468a: 8a 1f adc r24, r26 3468c: 91 1d adc r25, r1 3468e: a1 1d adc r26, r1 34690: 6a 0f add r22, r26 34692: 71 1d adc r23, r1 34694: 81 1d adc r24, r1 34696: 91 1d adc r25, r1 34698: a1 1d adc r26, r1 3469a: 20 d0 rcall .+64 ; 0x346dc <__ultoa_invert+0x84> 3469c: 09 f4 brne .+2 ; 0x346a0 <__ultoa_invert+0x48> 3469e: 68 94 set 346a0: 3f 91 pop r19 346a2: 2a e0 ldi r18, 0x0A ; 10 346a4: 26 9f mul r18, r22 346a6: 11 24 eor r1, r1 346a8: 30 19 sub r19, r0 346aa: 30 5d subi r19, 0xD0 ; 208 346ac: 31 93 st Z+, r19 346ae: de f6 brtc .-74 ; 0x34666 <__ultoa_invert+0xe> 346b0: cf 01 movw r24, r30 346b2: 08 95 ret 346b4: 46 2f mov r20, r22 346b6: 47 70 andi r20, 0x07 ; 7 346b8: 40 5d subi r20, 0xD0 ; 208 346ba: 41 93 st Z+, r20 346bc: b3 e0 ldi r27, 0x03 ; 3 346be: 0f d0 rcall .+30 ; 0x346de <__ultoa_invert+0x86> 346c0: c9 f7 brne .-14 ; 0x346b4 <__ultoa_invert+0x5c> 346c2: f6 cf rjmp .-20 ; 0x346b0 <__ultoa_invert+0x58> 346c4: 46 2f mov r20, r22 346c6: 4f 70 andi r20, 0x0F ; 15 346c8: 40 5d subi r20, 0xD0 ; 208 346ca: 4a 33 cpi r20, 0x3A ; 58 346cc: 18 f0 brcs .+6 ; 0x346d4 <__ultoa_invert+0x7c> 346ce: 49 5d subi r20, 0xD9 ; 217 346d0: 31 fd sbrc r19, 1 346d2: 40 52 subi r20, 0x20 ; 32 346d4: 41 93 st Z+, r20 346d6: 02 d0 rcall .+4 ; 0x346dc <__ultoa_invert+0x84> 346d8: a9 f7 brne .-22 ; 0x346c4 <__ultoa_invert+0x6c> 346da: ea cf rjmp .-44 ; 0x346b0 <__ultoa_invert+0x58> 346dc: b4 e0 ldi r27, 0x04 ; 4 346de: a6 95 lsr r26 346e0: 97 95 ror r25 346e2: 87 95 ror r24 346e4: 77 95 ror r23 346e6: 67 95 ror r22 346e8: ba 95 dec r27 346ea: c9 f7 brne .-14 ; 0x346de <__ultoa_invert+0x86> 346ec: 00 97 sbiw r24, 0x00 ; 0 346ee: 61 05 cpc r22, r1 346f0: 71 05 cpc r23, r1 346f2: 08 95 ret 346f4: 9b 01 movw r18, r22 346f6: ac 01 movw r20, r24 346f8: 0a 2e mov r0, r26 346fa: 06 94 lsr r0 346fc: 57 95 ror r21 346fe: 47 95 ror r20 34700: 37 95 ror r19 34702: 27 95 ror r18 34704: ba 95 dec r27 34706: c9 f7 brne .-14 ; 0x346fa <__ultoa_invert+0xa2> 34708: 62 0f add r22, r18 3470a: 73 1f adc r23, r19 3470c: 84 1f adc r24, r20 3470e: 95 1f adc r25, r21 34710: a0 1d adc r26, r0 34712: 08 95 ret 00034714 <__ctype_isfalse>: 34714: 99 27 eor r25, r25 34716: 88 27 eor r24, r24 00034718 <__ctype_istrue>: 34718: 08 95 ret 0003471a : 3471a: dc 01 movw r26, r24 3471c: cb 01 movw r24, r22 0003471e : 3471e: fc 01 movw r30, r24 34720: f9 99 sbic 0x1f, 1 ; 31 34722: fe cf rjmp .-4 ; 0x34720 34724: 06 c0 rjmp .+12 ; 0x34732 34726: f2 bd out 0x22, r31 ; 34 34728: e1 bd out 0x21, r30 ; 33 3472a: f8 9a sbi 0x1f, 0 ; 31 3472c: 31 96 adiw r30, 0x01 ; 1 3472e: 00 b4 in r0, 0x20 ; 32 34730: 0d 92 st X+, r0 34732: 41 50 subi r20, 0x01 ; 1 34734: 50 40 sbci r21, 0x00 ; 0 34736: b8 f7 brcc .-18 ; 0x34726 34738: 08 95 ret 0003473a : 3473a: f9 99 sbic 0x1f, 1 ; 31 3473c: fe cf rjmp .-4 ; 0x3473a 3473e: 92 bd out 0x22, r25 ; 34 34740: 81 bd out 0x21, r24 ; 33 34742: f8 9a sbi 0x1f, 0 ; 31 34744: 99 27 eor r25, r25 34746: 80 b5 in r24, 0x20 ; 32 34748: 08 95 ret 0003474a : 3474a: a6 e1 ldi r26, 0x16 ; 22 3474c: b0 e0 ldi r27, 0x00 ; 0 3474e: 44 e0 ldi r20, 0x04 ; 4 34750: 50 e0 ldi r21, 0x00 ; 0 34752: 0d 94 8f a3 jmp 0x3471e ; 0x3471e 00034756 : 34756: a8 e1 ldi r26, 0x18 ; 24 34758: b0 e0 ldi r27, 0x00 ; 0 3475a: 42 e0 ldi r20, 0x02 ; 2 3475c: 50 e0 ldi r21, 0x00 ; 0 3475e: 0d 94 8f a3 jmp 0x3471e ; 0x3471e 00034762 : 34762: dc 01 movw r26, r24 34764: a4 0f add r26, r20 34766: b5 1f adc r27, r21 34768: 41 50 subi r20, 0x01 ; 1 3476a: 50 40 sbci r21, 0x00 ; 0 3476c: 48 f0 brcs .+18 ; 0x34780 3476e: cb 01 movw r24, r22 34770: 84 0f add r24, r20 34772: 95 1f adc r25, r21 34774: 2e 91 ld r18, -X 34776: 0f 94 c2 a3 call 0x34784 ; 0x34784 3477a: 41 50 subi r20, 0x01 ; 1 3477c: 50 40 sbci r21, 0x00 ; 0 3477e: d0 f7 brcc .-12 ; 0x34774 34780: 08 95 ret 00034782 : 34782: 26 2f mov r18, r22 00034784 : 34784: f9 99 sbic 0x1f, 1 ; 31 34786: fe cf rjmp .-4 ; 0x34784 34788: 92 bd out 0x22, r25 ; 34 3478a: 81 bd out 0x21, r24 ; 33 3478c: f8 9a sbi 0x1f, 0 ; 31 3478e: 01 97 sbiw r24, 0x01 ; 1 34790: 00 b4 in r0, 0x20 ; 32 34792: 02 16 cp r0, r18 34794: 39 f0 breq .+14 ; 0x347a4 34796: 1f ba out 0x1f, r1 ; 31 34798: 20 bd out 0x20, r18 ; 32 3479a: 0f b6 in r0, 0x3f ; 63 3479c: f8 94 cli 3479e: fa 9a sbi 0x1f, 2 ; 31 347a0: f9 9a sbi 0x1f, 1 ; 31 347a2: 0f be out 0x3f, r0 ; 63 347a4: 08 95 ret 000347a6 : 347a6: 03 96 adiw r24, 0x03 ; 3 347a8: 27 2f mov r18, r23 347aa: 0f 94 c2 a3 call 0x34784 ; 0x34784 347ae: 0f 94 c1 a3 call 0x34782 ; 0x34782 347b2: 25 2f mov r18, r21 347b4: 0f 94 c2 a3 call 0x34784 ; 0x34784 347b8: 24 2f mov r18, r20 347ba: 0d 94 c2 a3 jmp 0x34784 ; 0x34784 000347be : 347be: 01 96 adiw r24, 0x01 ; 1 347c0: 27 2f mov r18, r23 347c2: 0f 94 c2 a3 call 0x34784 ; 0x34784 347c6: 0d 94 c1 a3 jmp 0x34782 ; 0x34782 000347ca : 347ca: 26 2f mov r18, r22 000347cc : 347cc: f9 99 sbic 0x1f, 1 ; 31 347ce: fe cf rjmp .-4 ; 0x347cc 347d0: 1f ba out 0x1f, r1 ; 31 347d2: 92 bd out 0x22, r25 ; 34 347d4: 81 bd out 0x21, r24 ; 33 347d6: 20 bd out 0x20, r18 ; 32 347d8: 0f b6 in r0, 0x3f ; 63 347da: f8 94 cli 347dc: fa 9a sbi 0x1f, 2 ; 31 347de: f9 9a sbi 0x1f, 1 ; 31 347e0: 0f be out 0x3f, r0 ; 63 347e2: 01 96 adiw r24, 0x01 ; 1 347e4: 08 95 ret 000347e6 : 347e6: 24 2f mov r18, r20 347e8: 0f 94 e6 a3 call 0x347cc ; 0x347cc 347ec: 25 2f mov r18, r21 347ee: 0f 94 e6 a3 call 0x347cc ; 0x347cc 347f2: 0d 94 fb a3 jmp 0x347f6 ; 0x347f6 000347f6 : 347f6: 0f 94 e5 a3 call 0x347ca ; 0x347ca 347fa: 27 2f mov r18, r23 347fc: 0d 94 e6 a3 jmp 0x347cc ; 0x347cc 00034800 <__mulsi3>: 34800: db 01 movw r26, r22 34802: 8f 93 push r24 34804: 9f 93 push r25 34806: 0f 94 32 a4 call 0x34864 ; 0x34864 <__muluhisi3> 3480a: bf 91 pop r27 3480c: af 91 pop r26 3480e: a2 9f mul r26, r18 34810: 80 0d add r24, r0 34812: 91 1d adc r25, r1 34814: a3 9f mul r26, r19 34816: 90 0d add r25, r0 34818: b2 9f mul r27, r18 3481a: 90 0d add r25, r0 3481c: 11 24 eor r1, r1 3481e: 08 95 ret 00034820 <__udivmodsi4>: 34820: a1 e2 ldi r26, 0x21 ; 33 34822: 1a 2e mov r1, r26 34824: aa 1b sub r26, r26 34826: bb 1b sub r27, r27 34828: fd 01 movw r30, r26 3482a: 0d c0 rjmp .+26 ; 0x34846 <__udivmodsi4_ep> 0003482c <__udivmodsi4_loop>: 3482c: aa 1f adc r26, r26 3482e: bb 1f adc r27, r27 34830: ee 1f adc r30, r30 34832: ff 1f adc r31, r31 34834: a2 17 cp r26, r18 34836: b3 07 cpc r27, r19 34838: e4 07 cpc r30, r20 3483a: f5 07 cpc r31, r21 3483c: 20 f0 brcs .+8 ; 0x34846 <__udivmodsi4_ep> 3483e: a2 1b sub r26, r18 34840: b3 0b sbc r27, r19 34842: e4 0b sbc r30, r20 34844: f5 0b sbc r31, r21 00034846 <__udivmodsi4_ep>: 34846: 66 1f adc r22, r22 34848: 77 1f adc r23, r23 3484a: 88 1f adc r24, r24 3484c: 99 1f adc r25, r25 3484e: 1a 94 dec r1 34850: 69 f7 brne .-38 ; 0x3482c <__udivmodsi4_loop> 34852: 60 95 com r22 34854: 70 95 com r23 34856: 80 95 com r24 34858: 90 95 com r25 3485a: 9b 01 movw r18, r22 3485c: ac 01 movw r20, r24 3485e: bd 01 movw r22, r26 34860: cf 01 movw r24, r30 34862: 08 95 ret 00034864 <__muluhisi3>: 34864: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 34868: a5 9f mul r26, r21 3486a: 90 0d add r25, r0 3486c: b4 9f mul r27, r20 3486e: 90 0d add r25, r0 34870: a4 9f mul r26, r20 34872: 80 0d add r24, r0 34874: 91 1d adc r25, r1 34876: 11 24 eor r1, r1 34878: 08 95 ret 0003487a <__umulhisi3>: 3487a: a2 9f mul r26, r18 3487c: b0 01 movw r22, r0 3487e: b3 9f mul r27, r19 34880: c0 01 movw r24, r0 34882: a3 9f mul r26, r19 34884: 70 0d add r23, r0 34886: 81 1d adc r24, r1 34888: 11 24 eor r1, r1 3488a: 91 1d adc r25, r1 3488c: b2 9f mul r27, r18 3488e: 70 0d add r23, r0 34890: 81 1d adc r24, r1 34892: 11 24 eor r1, r1 34894: 91 1d adc r25, r1 34896: 08 95 ret 00034898 <__udivmodqi4>: 34898: 99 1b sub r25, r25 3489a: 79 e0 ldi r23, 0x09 ; 9 3489c: 04 c0 rjmp .+8 ; 0x348a6 <__udivmodqi4_ep> 0003489e <__udivmodqi4_loop>: 3489e: 99 1f adc r25, r25 348a0: 96 17 cp r25, r22 348a2: 08 f0 brcs .+2 ; 0x348a6 <__udivmodqi4_ep> 348a4: 96 1b sub r25, r22 000348a6 <__udivmodqi4_ep>: 348a6: 88 1f adc r24, r24 348a8: 7a 95 dec r23 348aa: c9 f7 brne .-14 ; 0x3489e <__udivmodqi4_loop> 348ac: 80 95 com r24 348ae: 08 95 ret 000348b0 <__divmodqi4>: 348b0: 87 fb bst r24, 7 348b2: 08 2e mov r0, r24 348b4: 06 26 eor r0, r22 348b6: 87 fd sbrc r24, 7 348b8: 81 95 neg r24 348ba: 67 fd sbrc r22, 7 348bc: 61 95 neg r22 348be: 0f 94 4c a4 call 0x34898 ; 0x34898 <__udivmodqi4> 348c2: 0e f4 brtc .+2 ; 0x348c6 <__divmodqi4_1> 348c4: 91 95 neg r25 000348c6 <__divmodqi4_1>: 348c6: 07 fc sbrc r0, 7 348c8: 81 95 neg r24 000348ca <__divmodqi4_exit>: 348ca: 08 95 ret 000348cc <__udivmodhi4>: 348cc: aa 1b sub r26, r26 348ce: bb 1b sub r27, r27 348d0: 51 e1 ldi r21, 0x11 ; 17 348d2: 07 c0 rjmp .+14 ; 0x348e2 <__udivmodhi4_ep> 000348d4 <__udivmodhi4_loop>: 348d4: aa 1f adc r26, r26 348d6: bb 1f adc r27, r27 348d8: a6 17 cp r26, r22 348da: b7 07 cpc r27, r23 348dc: 10 f0 brcs .+4 ; 0x348e2 <__udivmodhi4_ep> 348de: a6 1b sub r26, r22 348e0: b7 0b sbc r27, r23 000348e2 <__udivmodhi4_ep>: 348e2: 88 1f adc r24, r24 348e4: 99 1f adc r25, r25 348e6: 5a 95 dec r21 348e8: a9 f7 brne .-22 ; 0x348d4 <__udivmodhi4_loop> 348ea: 80 95 com r24 348ec: 90 95 com r25 348ee: bc 01 movw r22, r24 348f0: cd 01 movw r24, r26 348f2: 08 95 ret 000348f4 <__divmodhi4>: 348f4: 97 fb bst r25, 7 348f6: 07 2e mov r0, r23 348f8: 16 f4 brtc .+4 ; 0x348fe <__divmodhi4+0xa> 348fa: 00 94 com r0 348fc: 07 d0 rcall .+14 ; 0x3490c <__divmodhi4_neg1> 348fe: 77 fd sbrc r23, 7 34900: 09 d0 rcall .+18 ; 0x34914 <__divmodhi4_neg2> 34902: 0f 94 66 a4 call 0x348cc ; 0x348cc <__udivmodhi4> 34906: 07 fc sbrc r0, 7 34908: 05 d0 rcall .+10 ; 0x34914 <__divmodhi4_neg2> 3490a: 3e f4 brtc .+14 ; 0x3491a <__divmodhi4_exit> 0003490c <__divmodhi4_neg1>: 3490c: 90 95 com r25 3490e: 81 95 neg r24 34910: 9f 4f sbci r25, 0xFF ; 255 34912: 08 95 ret 00034914 <__divmodhi4_neg2>: 34914: 70 95 com r23 34916: 61 95 neg r22 34918: 7f 4f sbci r23, 0xFF ; 255 0003491a <__divmodhi4_exit>: 3491a: 08 95 ret 0003491c <__divmodsi4>: 3491c: 05 2e mov r0, r21 3491e: 97 fb bst r25, 7 34920: 1e f4 brtc .+6 ; 0x34928 <__divmodsi4+0xc> 34922: 00 94 com r0 34924: 0f 94 a5 a4 call 0x3494a ; 0x3494a <__negsi2> 34928: 57 fd sbrc r21, 7 3492a: 07 d0 rcall .+14 ; 0x3493a <__divmodsi4_neg2> 3492c: 0f 94 10 a4 call 0x34820 ; 0x34820 <__udivmodsi4> 34930: 07 fc sbrc r0, 7 34932: 03 d0 rcall .+6 ; 0x3493a <__divmodsi4_neg2> 34934: 4e f4 brtc .+18 ; 0x34948 <__divmodsi4_exit> 34936: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a <__negsi2> 0003493a <__divmodsi4_neg2>: 3493a: 50 95 com r21 3493c: 40 95 com r20 3493e: 30 95 com r19 34940: 21 95 neg r18 34942: 3f 4f sbci r19, 0xFF ; 255 34944: 4f 4f sbci r20, 0xFF ; 255 34946: 5f 4f sbci r21, 0xFF ; 255 00034948 <__divmodsi4_exit>: 34948: 08 95 ret 0003494a <__negsi2>: 3494a: 90 95 com r25 3494c: 80 95 com r24 3494e: 70 95 com r23 34950: 61 95 neg r22 34952: 7f 4f sbci r23, 0xFF ; 255 34954: 8f 4f sbci r24, 0xFF ; 255 34956: 9f 4f sbci r25, 0xFF ; 255 34958: 08 95 ret 0003495a <__tablejump2__>: 3495a: ee 0f add r30, r30 3495c: ff 1f adc r31, r31 3495e: 88 1f adc r24, r24 34960: 8b bf out 0x3b, r24 ; 59 34962: 07 90 elpm r0, Z+ 34964: f6 91 elpm r31, Z 34966: e0 2d mov r30, r0 34968: 19 94 eijmp 0003496a <__mulhisi3>: 3496a: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 3496e: 33 23 and r19, r19 34970: 12 f4 brpl .+4 ; 0x34976 <__mulhisi3+0xc> 34972: 8a 1b sub r24, r26 34974: 9b 0b sbc r25, r27 34976: 0d 94 bf a4 jmp 0x3497e ; 0x3497e <__usmulhisi3_tail> 0003497a <__usmulhisi3>: 3497a: 0f 94 3d a4 call 0x3487a ; 0x3487a <__umulhisi3> 0003497e <__usmulhisi3_tail>: 3497e: b7 ff sbrs r27, 7 34980: 08 95 ret 34982: 82 1b sub r24, r18 34984: 93 0b sbc r25, r19 34986: 08 95 ret 00034988 <__subsf3>: 34988: 50 58 subi r21, 0x80 ; 128 0003498a <__addsf3>: 3498a: bb 27 eor r27, r27 3498c: aa 27 eor r26, r26 3498e: 0f 94 dc a4 call 0x349b8 ; 0x349b8 <__addsf3x> 34992: 0d 94 ee 9e jmp 0x33ddc ; 0x33ddc <__fp_round> 34996: 0f 94 e0 9e call 0x33dc0 ; 0x33dc0 <__fp_pscA> 3499a: 38 f0 brcs .+14 ; 0x349aa <__addsf3+0x20> 3499c: 0f 94 e7 9e call 0x33dce ; 0x33dce <__fp_pscB> 349a0: 20 f0 brcs .+8 ; 0x349aa <__addsf3+0x20> 349a2: 39 f4 brne .+14 ; 0x349b2 <__addsf3+0x28> 349a4: 9f 3f cpi r25, 0xFF ; 255 349a6: 19 f4 brne .+6 ; 0x349ae <__addsf3+0x24> 349a8: 26 f4 brtc .+8 ; 0x349b2 <__addsf3+0x28> 349aa: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 349ae: 0e f4 brtc .+2 ; 0x349b2 <__addsf3+0x28> 349b0: e0 95 com r30 349b2: e7 fb bst r30, 7 349b4: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 000349b8 <__addsf3x>: 349b8: e9 2f mov r30, r25 349ba: 0f 94 ff 9e call 0x33dfe ; 0x33dfe <__fp_split3> 349be: 58 f3 brcs .-42 ; 0x34996 <__addsf3+0xc> 349c0: ba 17 cp r27, r26 349c2: 62 07 cpc r22, r18 349c4: 73 07 cpc r23, r19 349c6: 84 07 cpc r24, r20 349c8: 95 07 cpc r25, r21 349ca: 20 f0 brcs .+8 ; 0x349d4 <__addsf3x+0x1c> 349cc: 79 f4 brne .+30 ; 0x349ec <__addsf3x+0x34> 349ce: a6 f5 brtc .+104 ; 0x34a38 <__addsf3x+0x80> 349d0: 0d 94 21 9f jmp 0x33e42 ; 0x33e42 <__fp_zero> 349d4: 0e f4 brtc .+2 ; 0x349d8 <__addsf3x+0x20> 349d6: e0 95 com r30 349d8: 0b 2e mov r0, r27 349da: ba 2f mov r27, r26 349dc: a0 2d mov r26, r0 349de: 0b 01 movw r0, r22 349e0: b9 01 movw r22, r18 349e2: 90 01 movw r18, r0 349e4: 0c 01 movw r0, r24 349e6: ca 01 movw r24, r20 349e8: a0 01 movw r20, r0 349ea: 11 24 eor r1, r1 349ec: ff 27 eor r31, r31 349ee: 59 1b sub r21, r25 349f0: 99 f0 breq .+38 ; 0x34a18 <__addsf3x+0x60> 349f2: 59 3f cpi r21, 0xF9 ; 249 349f4: 50 f4 brcc .+20 ; 0x34a0a <__addsf3x+0x52> 349f6: 50 3e cpi r21, 0xE0 ; 224 349f8: 68 f1 brcs .+90 ; 0x34a54 <__addsf3x+0x9c> 349fa: 1a 16 cp r1, r26 349fc: f0 40 sbci r31, 0x00 ; 0 349fe: a2 2f mov r26, r18 34a00: 23 2f mov r18, r19 34a02: 34 2f mov r19, r20 34a04: 44 27 eor r20, r20 34a06: 58 5f subi r21, 0xF8 ; 248 34a08: f3 cf rjmp .-26 ; 0x349f0 <__addsf3x+0x38> 34a0a: 46 95 lsr r20 34a0c: 37 95 ror r19 34a0e: 27 95 ror r18 34a10: a7 95 ror r26 34a12: f0 40 sbci r31, 0x00 ; 0 34a14: 53 95 inc r21 34a16: c9 f7 brne .-14 ; 0x34a0a <__addsf3x+0x52> 34a18: 7e f4 brtc .+30 ; 0x34a38 <__addsf3x+0x80> 34a1a: 1f 16 cp r1, r31 34a1c: ba 0b sbc r27, r26 34a1e: 62 0b sbc r22, r18 34a20: 73 0b sbc r23, r19 34a22: 84 0b sbc r24, r20 34a24: ba f0 brmi .+46 ; 0x34a54 <__addsf3x+0x9c> 34a26: 91 50 subi r25, 0x01 ; 1 34a28: a1 f0 breq .+40 ; 0x34a52 <__addsf3x+0x9a> 34a2a: ff 0f add r31, r31 34a2c: bb 1f adc r27, r27 34a2e: 66 1f adc r22, r22 34a30: 77 1f adc r23, r23 34a32: 88 1f adc r24, r24 34a34: c2 f7 brpl .-16 ; 0x34a26 <__addsf3x+0x6e> 34a36: 0e c0 rjmp .+28 ; 0x34a54 <__addsf3x+0x9c> 34a38: ba 0f add r27, r26 34a3a: 62 1f adc r22, r18 34a3c: 73 1f adc r23, r19 34a3e: 84 1f adc r24, r20 34a40: 48 f4 brcc .+18 ; 0x34a54 <__addsf3x+0x9c> 34a42: 87 95 ror r24 34a44: 77 95 ror r23 34a46: 67 95 ror r22 34a48: b7 95 ror r27 34a4a: f7 95 ror r31 34a4c: 9e 3f cpi r25, 0xFE ; 254 34a4e: 08 f0 brcs .+2 ; 0x34a52 <__addsf3x+0x9a> 34a50: b0 cf rjmp .-160 ; 0x349b2 <__addsf3+0x28> 34a52: 93 95 inc r25 34a54: 88 0f add r24, r24 34a56: 08 f0 brcs .+2 ; 0x34a5a <__addsf3x+0xa2> 34a58: 99 27 eor r25, r25 34a5a: ee 0f add r30, r30 34a5c: 97 95 ror r25 34a5e: 87 95 ror r24 34a60: 08 95 ret 34a62: 0f 94 e0 9e call 0x33dc0 ; 0x33dc0 <__fp_pscA> 34a66: 60 f0 brcs .+24 ; 0x34a80 <__addsf3x+0xc8> 34a68: 80 e8 ldi r24, 0x80 ; 128 34a6a: 91 e0 ldi r25, 0x01 ; 1 34a6c: 09 f4 brne .+2 ; 0x34a70 <__addsf3x+0xb8> 34a6e: 9e ef ldi r25, 0xFE ; 254 34a70: 0f 94 e7 9e call 0x33dce ; 0x33dce <__fp_pscB> 34a74: 28 f0 brcs .+10 ; 0x34a80 <__addsf3x+0xc8> 34a76: 40 e8 ldi r20, 0x80 ; 128 34a78: 51 e0 ldi r21, 0x01 ; 1 34a7a: 71 f4 brne .+28 ; 0x34a98 34a7c: 5e ef ldi r21, 0xFE ; 254 34a7e: 0c c0 rjmp .+24 ; 0x34a98 34a80: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 34a84: 0d 94 21 9f jmp 0x33e42 ; 0x33e42 <__fp_zero> 00034a88 : 34a88: e9 2f mov r30, r25 34a8a: e0 78 andi r30, 0x80 ; 128 34a8c: 0f 94 ff 9e call 0x33dfe ; 0x33dfe <__fp_split3> 34a90: 40 f3 brcs .-48 ; 0x34a62 <__addsf3x+0xaa> 34a92: 09 2e mov r0, r25 34a94: 05 2a or r0, r21 34a96: b1 f3 breq .-20 ; 0x34a84 <__addsf3x+0xcc> 34a98: 26 17 cp r18, r22 34a9a: 37 07 cpc r19, r23 34a9c: 48 07 cpc r20, r24 34a9e: 59 07 cpc r21, r25 34aa0: 38 f0 brcs .+14 ; 0x34ab0 34aa2: 0e 2e mov r0, r30 34aa4: 07 f8 bld r0, 7 34aa6: e0 25 eor r30, r0 34aa8: 69 f0 breq .+26 ; 0x34ac4 34aaa: e0 25 eor r30, r0 34aac: e0 64 ori r30, 0x40 ; 64 34aae: 0a c0 rjmp .+20 ; 0x34ac4 34ab0: ef 63 ori r30, 0x3F ; 63 34ab2: 07 f8 bld r0, 7 34ab4: 00 94 com r0 34ab6: 07 fa bst r0, 7 34ab8: db 01 movw r26, r22 34aba: b9 01 movw r22, r18 34abc: 9d 01 movw r18, r26 34abe: dc 01 movw r26, r24 34ac0: ca 01 movw r24, r20 34ac2: ad 01 movw r20, r26 34ac4: ef 93 push r30 34ac6: 0f 94 db a5 call 0x34bb6 ; 0x34bb6 <__divsf3_pse> 34aca: 0f 94 ee 9e call 0x33ddc ; 0x33ddc <__fp_round> 34ace: 0f 94 74 a5 call 0x34ae8 ; 0x34ae8 34ad2: 5f 91 pop r21 34ad4: 55 23 and r21, r21 34ad6: 39 f0 breq .+14 ; 0x34ae6 34ad8: 2b ed ldi r18, 0xDB ; 219 34ada: 3f e0 ldi r19, 0x0F ; 15 34adc: 49 e4 ldi r20, 0x49 ; 73 34ade: 50 fd sbrc r21, 0 34ae0: 49 ec ldi r20, 0xC9 ; 201 34ae2: 0d 94 c5 a4 jmp 0x3498a ; 0x3498a <__addsf3> 34ae6: 08 95 ret 00034ae8 : 34ae8: df 93 push r29 34aea: dd 27 eor r29, r29 34aec: b9 2f mov r27, r25 34aee: bf 77 andi r27, 0x7F ; 127 34af0: 40 e8 ldi r20, 0x80 ; 128 34af2: 5f e3 ldi r21, 0x3F ; 63 34af4: 16 16 cp r1, r22 34af6: 17 06 cpc r1, r23 34af8: 48 07 cpc r20, r24 34afa: 5b 07 cpc r21, r27 34afc: 18 f4 brcc .+6 ; 0x34b04 34afe: d9 2f mov r29, r25 34b00: 0f 94 c0 a7 call 0x34f80 ; 0x34f80 34b04: 9f 93 push r25 34b06: 8f 93 push r24 34b08: 7f 93 push r23 34b0a: 6f 93 push r22 34b0c: 0f 94 66 9e call 0x33ccc ; 0x33ccc 34b10: e7 eb ldi r30, 0xB7 ; 183 34b12: fc e6 ldi r31, 0x6C ; 108 34b14: 0f 94 d0 a6 call 0x34da0 ; 0x34da0 <__fp_powser> 34b18: 0f 94 ee 9e call 0x33ddc ; 0x33ddc <__fp_round> 34b1c: 2f 91 pop r18 34b1e: 3f 91 pop r19 34b20: 4f 91 pop r20 34b22: 5f 91 pop r21 34b24: 0f 94 7d 9e call 0x33cfa ; 0x33cfa <__mulsf3x> 34b28: dd 23 and r29, r29 34b2a: 51 f0 breq .+20 ; 0x34b40 34b2c: 90 58 subi r25, 0x80 ; 128 34b2e: a2 ea ldi r26, 0xA2 ; 162 34b30: 2a ed ldi r18, 0xDA ; 218 34b32: 3f e0 ldi r19, 0x0F ; 15 34b34: 49 ec ldi r20, 0xC9 ; 201 34b36: 5f e3 ldi r21, 0x3F ; 63 34b38: d0 78 andi r29, 0x80 ; 128 34b3a: 5d 27 eor r21, r29 34b3c: 0f 94 dc a4 call 0x349b8 ; 0x349b8 <__addsf3x> 34b40: df 91 pop r29 34b42: 0d 94 ee 9e jmp 0x33ddc ; 0x33ddc <__fp_round> 00034b46 : 34b46: 0f 94 36 a7 call 0x34e6c ; 0x34e6c <__fp_trunc> 34b4a: 90 f0 brcs .+36 ; 0x34b70 34b4c: 9f 37 cpi r25, 0x7F ; 127 34b4e: 48 f4 brcc .+18 ; 0x34b62 34b50: 91 11 cpse r25, r1 34b52: 16 f4 brtc .+4 ; 0x34b58 34b54: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 34b58: 60 e0 ldi r22, 0x00 ; 0 34b5a: 70 e0 ldi r23, 0x00 ; 0 34b5c: 80 e8 ldi r24, 0x80 ; 128 34b5e: 9f e3 ldi r25, 0x3F ; 63 34b60: 08 95 ret 34b62: 26 f0 brts .+8 ; 0x34b6c 34b64: 1b 16 cp r1, r27 34b66: 61 1d adc r22, r1 34b68: 71 1d adc r23, r1 34b6a: 81 1d adc r24, r1 34b6c: 0d 94 a7 a6 jmp 0x34d4e ; 0x34d4e <__fp_mintl> 34b70: 0d 94 c2 a6 jmp 0x34d84 ; 0x34d84 <__fp_mpack> 00034b74 <__cmpsf2>: 34b74: 0f 94 83 a6 call 0x34d06 ; 0x34d06 <__fp_cmp> 34b78: 08 f4 brcc .+2 ; 0x34b7c <__cmpsf2+0x8> 34b7a: 81 e0 ldi r24, 0x01 ; 1 34b7c: 08 95 ret 00034b7e : 34b7e: 0f 94 f9 a6 call 0x34df2 ; 0x34df2 <__fp_rempio2> 34b82: e3 95 inc r30 34b84: 0d 94 22 a7 jmp 0x34e44 ; 0x34e44 <__fp_sinus> 00034b88 <__divsf3>: 34b88: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 <__divsf3x> 34b8c: 0d 94 ee 9e jmp 0x33ddc ; 0x33ddc <__fp_round> 34b90: 0f 94 e7 9e call 0x33dce ; 0x33dce <__fp_pscB> 34b94: 58 f0 brcs .+22 ; 0x34bac <__divsf3+0x24> 34b96: 0f 94 e0 9e call 0x33dc0 ; 0x33dc0 <__fp_pscA> 34b9a: 40 f0 brcs .+16 ; 0x34bac <__divsf3+0x24> 34b9c: 29 f4 brne .+10 ; 0x34ba8 <__divsf3+0x20> 34b9e: 5f 3f cpi r21, 0xFF ; 255 34ba0: 29 f0 breq .+10 ; 0x34bac <__divsf3+0x24> 34ba2: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 34ba6: 51 11 cpse r21, r1 34ba8: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 34bac: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 00034bb0 <__divsf3x>: 34bb0: 0f 94 ff 9e call 0x33dfe ; 0x33dfe <__fp_split3> 34bb4: 68 f3 brcs .-38 ; 0x34b90 <__divsf3+0x8> 00034bb6 <__divsf3_pse>: 34bb6: 99 23 and r25, r25 34bb8: b1 f3 breq .-20 ; 0x34ba6 <__divsf3+0x1e> 34bba: 55 23 and r21, r21 34bbc: 91 f3 breq .-28 ; 0x34ba2 <__divsf3+0x1a> 34bbe: 95 1b sub r25, r21 34bc0: 55 0b sbc r21, r21 34bc2: bb 27 eor r27, r27 34bc4: aa 27 eor r26, r26 34bc6: 62 17 cp r22, r18 34bc8: 73 07 cpc r23, r19 34bca: 84 07 cpc r24, r20 34bcc: 38 f0 brcs .+14 ; 0x34bdc <__divsf3_pse+0x26> 34bce: 9f 5f subi r25, 0xFF ; 255 34bd0: 5f 4f sbci r21, 0xFF ; 255 34bd2: 22 0f add r18, r18 34bd4: 33 1f adc r19, r19 34bd6: 44 1f adc r20, r20 34bd8: aa 1f adc r26, r26 34bda: a9 f3 breq .-22 ; 0x34bc6 <__divsf3_pse+0x10> 34bdc: 35 d0 rcall .+106 ; 0x34c48 <__divsf3_pse+0x92> 34bde: 0e 2e mov r0, r30 34be0: 3a f0 brmi .+14 ; 0x34bf0 <__divsf3_pse+0x3a> 34be2: e0 e8 ldi r30, 0x80 ; 128 34be4: 32 d0 rcall .+100 ; 0x34c4a <__divsf3_pse+0x94> 34be6: 91 50 subi r25, 0x01 ; 1 34be8: 50 40 sbci r21, 0x00 ; 0 34bea: e6 95 lsr r30 34bec: 00 1c adc r0, r0 34bee: ca f7 brpl .-14 ; 0x34be2 <__divsf3_pse+0x2c> 34bf0: 2b d0 rcall .+86 ; 0x34c48 <__divsf3_pse+0x92> 34bf2: fe 2f mov r31, r30 34bf4: 29 d0 rcall .+82 ; 0x34c48 <__divsf3_pse+0x92> 34bf6: 66 0f add r22, r22 34bf8: 77 1f adc r23, r23 34bfa: 88 1f adc r24, r24 34bfc: bb 1f adc r27, r27 34bfe: 26 17 cp r18, r22 34c00: 37 07 cpc r19, r23 34c02: 48 07 cpc r20, r24 34c04: ab 07 cpc r26, r27 34c06: b0 e8 ldi r27, 0x80 ; 128 34c08: 09 f0 breq .+2 ; 0x34c0c <__divsf3_pse+0x56> 34c0a: bb 0b sbc r27, r27 34c0c: 80 2d mov r24, r0 34c0e: bf 01 movw r22, r30 34c10: ff 27 eor r31, r31 34c12: 93 58 subi r25, 0x83 ; 131 34c14: 5f 4f sbci r21, 0xFF ; 255 34c16: 3a f0 brmi .+14 ; 0x34c26 <__divsf3_pse+0x70> 34c18: 9e 3f cpi r25, 0xFE ; 254 34c1a: 51 05 cpc r21, r1 34c1c: 78 f0 brcs .+30 ; 0x34c3c <__divsf3_pse+0x86> 34c1e: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 34c22: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 34c26: 5f 3f cpi r21, 0xFF ; 255 34c28: e4 f3 brlt .-8 ; 0x34c22 <__divsf3_pse+0x6c> 34c2a: 98 3e cpi r25, 0xE8 ; 232 34c2c: d4 f3 brlt .-12 ; 0x34c22 <__divsf3_pse+0x6c> 34c2e: 86 95 lsr r24 34c30: 77 95 ror r23 34c32: 67 95 ror r22 34c34: b7 95 ror r27 34c36: f7 95 ror r31 34c38: 9f 5f subi r25, 0xFF ; 255 34c3a: c9 f7 brne .-14 ; 0x34c2e <__divsf3_pse+0x78> 34c3c: 88 0f add r24, r24 34c3e: 91 1d adc r25, r1 34c40: 96 95 lsr r25 34c42: 87 95 ror r24 34c44: 97 f9 bld r25, 7 34c46: 08 95 ret 34c48: e1 e0 ldi r30, 0x01 ; 1 34c4a: 66 0f add r22, r22 34c4c: 77 1f adc r23, r23 34c4e: 88 1f adc r24, r24 34c50: bb 1f adc r27, r27 34c52: 62 17 cp r22, r18 34c54: 73 07 cpc r23, r19 34c56: 84 07 cpc r24, r20 34c58: ba 07 cpc r27, r26 34c5a: 20 f0 brcs .+8 ; 0x34c64 <__divsf3_pse+0xae> 34c5c: 62 1b sub r22, r18 34c5e: 73 0b sbc r23, r19 34c60: 84 0b sbc r24, r20 34c62: ba 0b sbc r27, r26 34c64: ee 1f adc r30, r30 34c66: 88 f7 brcc .-30 ; 0x34c4a <__divsf3_pse+0x94> 34c68: e0 95 com r30 34c6a: 08 95 ret 00034c6c <__fixsfsi>: 34c6c: 0f 94 3d a6 call 0x34c7a ; 0x34c7a <__fixunssfsi> 34c70: 68 94 set 34c72: b1 11 cpse r27, r1 34c74: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 34c78: 08 95 ret 00034c7a <__fixunssfsi>: 34c7a: 0f 94 07 9f call 0x33e0e ; 0x33e0e <__fp_splitA> 34c7e: 88 f0 brcs .+34 ; 0x34ca2 <__fixunssfsi+0x28> 34c80: 9f 57 subi r25, 0x7F ; 127 34c82: 98 f0 brcs .+38 ; 0x34caa <__fixunssfsi+0x30> 34c84: b9 2f mov r27, r25 34c86: 99 27 eor r25, r25 34c88: b7 51 subi r27, 0x17 ; 23 34c8a: b0 f0 brcs .+44 ; 0x34cb8 <__fixunssfsi+0x3e> 34c8c: e1 f0 breq .+56 ; 0x34cc6 <__fixunssfsi+0x4c> 34c8e: 66 0f add r22, r22 34c90: 77 1f adc r23, r23 34c92: 88 1f adc r24, r24 34c94: 99 1f adc r25, r25 34c96: 1a f0 brmi .+6 ; 0x34c9e <__fixunssfsi+0x24> 34c98: ba 95 dec r27 34c9a: c9 f7 brne .-14 ; 0x34c8e <__fixunssfsi+0x14> 34c9c: 14 c0 rjmp .+40 ; 0x34cc6 <__fixunssfsi+0x4c> 34c9e: b1 30 cpi r27, 0x01 ; 1 34ca0: 91 f0 breq .+36 ; 0x34cc6 <__fixunssfsi+0x4c> 34ca2: 0f 94 21 9f call 0x33e42 ; 0x33e42 <__fp_zero> 34ca6: b1 e0 ldi r27, 0x01 ; 1 34ca8: 08 95 ret 34caa: 0d 94 21 9f jmp 0x33e42 ; 0x33e42 <__fp_zero> 34cae: 67 2f mov r22, r23 34cb0: 78 2f mov r23, r24 34cb2: 88 27 eor r24, r24 34cb4: b8 5f subi r27, 0xF8 ; 248 34cb6: 39 f0 breq .+14 ; 0x34cc6 <__fixunssfsi+0x4c> 34cb8: b9 3f cpi r27, 0xF9 ; 249 34cba: cc f3 brlt .-14 ; 0x34cae <__fixunssfsi+0x34> 34cbc: 86 95 lsr r24 34cbe: 77 95 ror r23 34cc0: 67 95 ror r22 34cc2: b3 95 inc r27 34cc4: d9 f7 brne .-10 ; 0x34cbc <__fixunssfsi+0x42> 34cc6: 3e f4 brtc .+14 ; 0x34cd6 <__fixunssfsi+0x5c> 34cc8: 90 95 com r25 34cca: 80 95 com r24 34ccc: 70 95 com r23 34cce: 61 95 neg r22 34cd0: 7f 4f sbci r23, 0xFF ; 255 34cd2: 8f 4f sbci r24, 0xFF ; 255 34cd4: 9f 4f sbci r25, 0xFF ; 255 34cd6: 08 95 ret 00034cd8 : 34cd8: 0f 94 36 a7 call 0x34e6c ; 0x34e6c <__fp_trunc> 34cdc: 90 f0 brcs .+36 ; 0x34d02 34cde: 9f 37 cpi r25, 0x7F ; 127 34ce0: 48 f4 brcc .+18 ; 0x34cf4 34ce2: 91 11 cpse r25, r1 34ce4: 16 f0 brts .+4 ; 0x34cea 34ce6: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 34cea: 60 e0 ldi r22, 0x00 ; 0 34cec: 70 e0 ldi r23, 0x00 ; 0 34cee: 80 e8 ldi r24, 0x80 ; 128 34cf0: 9f eb ldi r25, 0xBF ; 191 34cf2: 08 95 ret 34cf4: 26 f4 brtc .+8 ; 0x34cfe 34cf6: 1b 16 cp r1, r27 34cf8: 61 1d adc r22, r1 34cfa: 71 1d adc r23, r1 34cfc: 81 1d adc r24, r1 34cfe: 0d 94 a7 a6 jmp 0x34d4e ; 0x34d4e <__fp_mintl> 34d02: 0d 94 c2 a6 jmp 0x34d84 ; 0x34d84 <__fp_mpack> 00034d06 <__fp_cmp>: 34d06: 99 0f add r25, r25 34d08: 00 08 sbc r0, r0 34d0a: 55 0f add r21, r21 34d0c: aa 0b sbc r26, r26 34d0e: e0 e8 ldi r30, 0x80 ; 128 34d10: fe ef ldi r31, 0xFE ; 254 34d12: 16 16 cp r1, r22 34d14: 17 06 cpc r1, r23 34d16: e8 07 cpc r30, r24 34d18: f9 07 cpc r31, r25 34d1a: c0 f0 brcs .+48 ; 0x34d4c <__fp_cmp+0x46> 34d1c: 12 16 cp r1, r18 34d1e: 13 06 cpc r1, r19 34d20: e4 07 cpc r30, r20 34d22: f5 07 cpc r31, r21 34d24: 98 f0 brcs .+38 ; 0x34d4c <__fp_cmp+0x46> 34d26: 62 1b sub r22, r18 34d28: 73 0b sbc r23, r19 34d2a: 84 0b sbc r24, r20 34d2c: 95 0b sbc r25, r21 34d2e: 39 f4 brne .+14 ; 0x34d3e <__fp_cmp+0x38> 34d30: 0a 26 eor r0, r26 34d32: 61 f0 breq .+24 ; 0x34d4c <__fp_cmp+0x46> 34d34: 23 2b or r18, r19 34d36: 24 2b or r18, r20 34d38: 25 2b or r18, r21 34d3a: 21 f4 brne .+8 ; 0x34d44 <__fp_cmp+0x3e> 34d3c: 08 95 ret 34d3e: 0a 26 eor r0, r26 34d40: 09 f4 brne .+2 ; 0x34d44 <__fp_cmp+0x3e> 34d42: a1 40 sbci r26, 0x01 ; 1 34d44: a6 95 lsr r26 34d46: 8f ef ldi r24, 0xFF ; 255 34d48: 81 1d adc r24, r1 34d4a: 81 1d adc r24, r1 34d4c: 08 95 ret 00034d4e <__fp_mintl>: 34d4e: 88 23 and r24, r24 34d50: 71 f4 brne .+28 ; 0x34d6e <__fp_mintl+0x20> 34d52: 77 23 and r23, r23 34d54: 21 f0 breq .+8 ; 0x34d5e <__fp_mintl+0x10> 34d56: 98 50 subi r25, 0x08 ; 8 34d58: 87 2b or r24, r23 34d5a: 76 2f mov r23, r22 34d5c: 07 c0 rjmp .+14 ; 0x34d6c <__fp_mintl+0x1e> 34d5e: 66 23 and r22, r22 34d60: 11 f4 brne .+4 ; 0x34d66 <__fp_mintl+0x18> 34d62: 99 27 eor r25, r25 34d64: 0d c0 rjmp .+26 ; 0x34d80 <__fp_mintl+0x32> 34d66: 90 51 subi r25, 0x10 ; 16 34d68: 86 2b or r24, r22 34d6a: 70 e0 ldi r23, 0x00 ; 0 34d6c: 60 e0 ldi r22, 0x00 ; 0 34d6e: 2a f0 brmi .+10 ; 0x34d7a <__fp_mintl+0x2c> 34d70: 9a 95 dec r25 34d72: 66 0f add r22, r22 34d74: 77 1f adc r23, r23 34d76: 88 1f adc r24, r24 34d78: da f7 brpl .-10 ; 0x34d70 <__fp_mintl+0x22> 34d7a: 88 0f add r24, r24 34d7c: 96 95 lsr r25 34d7e: 87 95 ror r24 34d80: 97 f9 bld r25, 7 34d82: 08 95 ret 00034d84 <__fp_mpack>: 34d84: 9f 3f cpi r25, 0xFF ; 255 34d86: 31 f0 breq .+12 ; 0x34d94 <__fp_mpack_finite+0xc> 00034d88 <__fp_mpack_finite>: 34d88: 91 50 subi r25, 0x01 ; 1 34d8a: 20 f4 brcc .+8 ; 0x34d94 <__fp_mpack_finite+0xc> 34d8c: 87 95 ror r24 34d8e: 77 95 ror r23 34d90: 67 95 ror r22 34d92: b7 95 ror r27 34d94: 88 0f add r24, r24 34d96: 91 1d adc r25, r1 34d98: 96 95 lsr r25 34d9a: 87 95 ror r24 34d9c: 97 f9 bld r25, 7 34d9e: 08 95 ret 00034da0 <__fp_powser>: 34da0: df 93 push r29 34da2: cf 93 push r28 34da4: 1f 93 push r17 34da6: 0f 93 push r16 34da8: ff 92 push r15 34daa: ef 92 push r14 34dac: df 92 push r13 34dae: 7b 01 movw r14, r22 34db0: 8c 01 movw r16, r24 34db2: 68 94 set 34db4: 06 c0 rjmp .+12 ; 0x34dc2 <__fp_powser+0x22> 34db6: da 2e mov r13, r26 34db8: ef 01 movw r28, r30 34dba: 0f 94 7d 9e call 0x33cfa ; 0x33cfa <__mulsf3x> 34dbe: fe 01 movw r30, r28 34dc0: e8 94 clt 34dc2: a5 91 lpm r26, Z+ 34dc4: 25 91 lpm r18, Z+ 34dc6: 35 91 lpm r19, Z+ 34dc8: 45 91 lpm r20, Z+ 34dca: 55 91 lpm r21, Z+ 34dcc: a6 f3 brts .-24 ; 0x34db6 <__fp_powser+0x16> 34dce: ef 01 movw r28, r30 34dd0: 0f 94 dc a4 call 0x349b8 ; 0x349b8 <__addsf3x> 34dd4: fe 01 movw r30, r28 34dd6: 97 01 movw r18, r14 34dd8: a8 01 movw r20, r16 34dda: da 94 dec r13 34ddc: 69 f7 brne .-38 ; 0x34db8 <__fp_powser+0x18> 34dde: df 90 pop r13 34de0: ef 90 pop r14 34de2: ff 90 pop r15 34de4: 0f 91 pop r16 34de6: 1f 91 pop r17 34de8: cf 91 pop r28 34dea: df 91 pop r29 34dec: 08 95 ret 34dee: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 00034df2 <__fp_rempio2>: 34df2: 0f 94 07 9f call 0x33e0e ; 0x33e0e <__fp_splitA> 34df6: d8 f3 brcs .-10 ; 0x34dee <__fp_powser+0x4e> 34df8: e8 94 clt 34dfa: e0 e0 ldi r30, 0x00 ; 0 34dfc: bb 27 eor r27, r27 34dfe: 9f 57 subi r25, 0x7F ; 127 34e00: f0 f0 brcs .+60 ; 0x34e3e <__fp_rempio2+0x4c> 34e02: 2a ed ldi r18, 0xDA ; 218 34e04: 3f e0 ldi r19, 0x0F ; 15 34e06: 49 ec ldi r20, 0xC9 ; 201 34e08: 06 c0 rjmp .+12 ; 0x34e16 <__fp_rempio2+0x24> 34e0a: ee 0f add r30, r30 34e0c: bb 0f add r27, r27 34e0e: 66 1f adc r22, r22 34e10: 77 1f adc r23, r23 34e12: 88 1f adc r24, r24 34e14: 28 f0 brcs .+10 ; 0x34e20 <__fp_rempio2+0x2e> 34e16: b2 3a cpi r27, 0xA2 ; 162 34e18: 62 07 cpc r22, r18 34e1a: 73 07 cpc r23, r19 34e1c: 84 07 cpc r24, r20 34e1e: 28 f0 brcs .+10 ; 0x34e2a <__fp_rempio2+0x38> 34e20: b2 5a subi r27, 0xA2 ; 162 34e22: 62 0b sbc r22, r18 34e24: 73 0b sbc r23, r19 34e26: 84 0b sbc r24, r20 34e28: e3 95 inc r30 34e2a: 9a 95 dec r25 34e2c: 72 f7 brpl .-36 ; 0x34e0a <__fp_rempio2+0x18> 34e2e: 80 38 cpi r24, 0x80 ; 128 34e30: 30 f4 brcc .+12 ; 0x34e3e <__fp_rempio2+0x4c> 34e32: 9a 95 dec r25 34e34: bb 0f add r27, r27 34e36: 66 1f adc r22, r22 34e38: 77 1f adc r23, r23 34e3a: 88 1f adc r24, r24 34e3c: d2 f7 brpl .-12 ; 0x34e32 <__fp_rempio2+0x40> 34e3e: 90 48 sbci r25, 0x80 ; 128 34e40: 0d 94 c4 a6 jmp 0x34d88 ; 0x34d88 <__fp_mpack_finite> 00034e44 <__fp_sinus>: 34e44: ef 93 push r30 34e46: e0 ff sbrs r30, 0 34e48: 07 c0 rjmp .+14 ; 0x34e58 <__fp_sinus+0x14> 34e4a: a2 ea ldi r26, 0xA2 ; 162 34e4c: 2a ed ldi r18, 0xDA ; 218 34e4e: 3f e0 ldi r19, 0x0F ; 15 34e50: 49 ec ldi r20, 0xC9 ; 201 34e52: 5f eb ldi r21, 0xBF ; 191 34e54: 0f 94 dc a4 call 0x349b8 ; 0x349b8 <__addsf3x> 34e58: 0f 94 ee 9e call 0x33ddc ; 0x33ddc <__fp_round> 34e5c: 0f 90 pop r0 34e5e: 03 94 inc r0 34e60: 01 fc sbrc r0, 1 34e62: 90 58 subi r25, 0x80 ; 128 34e64: e4 ee ldi r30, 0xE4 ; 228 34e66: fc e6 ldi r31, 0x6C ; 108 34e68: 0d 94 19 a9 jmp 0x35232 ; 0x35232 <__fp_powsodd> 00034e6c <__fp_trunc>: 34e6c: 0f 94 07 9f call 0x33e0e ; 0x33e0e <__fp_splitA> 34e70: a0 f0 brcs .+40 ; 0x34e9a <__fp_trunc+0x2e> 34e72: be e7 ldi r27, 0x7E ; 126 34e74: b9 17 cp r27, r25 34e76: 88 f4 brcc .+34 ; 0x34e9a <__fp_trunc+0x2e> 34e78: bb 27 eor r27, r27 34e7a: 9f 38 cpi r25, 0x8F ; 143 34e7c: 60 f4 brcc .+24 ; 0x34e96 <__fp_trunc+0x2a> 34e7e: 16 16 cp r1, r22 34e80: b1 1d adc r27, r1 34e82: 67 2f mov r22, r23 34e84: 78 2f mov r23, r24 34e86: 88 27 eor r24, r24 34e88: 98 5f subi r25, 0xF8 ; 248 34e8a: f7 cf rjmp .-18 ; 0x34e7a <__fp_trunc+0xe> 34e8c: 86 95 lsr r24 34e8e: 77 95 ror r23 34e90: 67 95 ror r22 34e92: b1 1d adc r27, r1 34e94: 93 95 inc r25 34e96: 96 39 cpi r25, 0x96 ; 150 34e98: c8 f3 brcs .-14 ; 0x34e8c <__fp_trunc+0x20> 34e9a: 08 95 ret 00034e9c <__gesf2>: 34e9c: 0f 94 83 a6 call 0x34d06 ; 0x34d06 <__fp_cmp> 34ea0: 08 f4 brcc .+2 ; 0x34ea4 <__gesf2+0x8> 34ea2: 8f ef ldi r24, 0xFF ; 255 34ea4: 08 95 ret 34ea6: 0f 94 e0 9e call 0x33dc0 ; 0x33dc0 <__fp_pscA> 34eaa: 29 f0 breq .+10 ; 0x34eb6 <__gesf2+0x1a> 34eac: 0f 94 e7 9e call 0x33dce ; 0x33dce <__fp_pscB> 34eb0: 11 f0 breq .+4 ; 0x34eb6 <__gesf2+0x1a> 34eb2: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 34eb6: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 34eba: b9 01 movw r22, r18 34ebc: ca 01 movw r24, r20 34ebe: 0d 94 c2 a6 jmp 0x34d84 ; 0x34d84 <__fp_mpack> 00034ec2 : 34ec2: 9f 77 andi r25, 0x7F ; 127 34ec4: 5f 77 andi r21, 0x7F ; 127 34ec6: 0f 94 ff 9e call 0x33dfe ; 0x33dfe <__fp_split3> 34eca: 68 f3 brcs .-38 ; 0x34ea6 <__gesf2+0xa> 34ecc: 99 23 and r25, r25 34ece: a9 f3 breq .-22 ; 0x34eba <__gesf2+0x1e> 34ed0: 55 23 and r21, r21 34ed2: a9 f3 breq .-22 ; 0x34ebe <__gesf2+0x22> 34ed4: ff 27 eor r31, r31 34ed6: 95 17 cp r25, r21 34ed8: 58 f4 brcc .+22 ; 0x34ef0 34eda: e5 2f mov r30, r21 34edc: e9 1b sub r30, r25 34ede: ed 30 cpi r30, 0x0D ; 13 34ee0: 60 f7 brcc .-40 ; 0x34eba <__gesf2+0x1e> 34ee2: 5e 3b cpi r21, 0xBE ; 190 34ee4: 10 f0 brcs .+4 ; 0x34eea 34ee6: f1 e4 ldi r31, 0x41 ; 65 34ee8: 1c c0 rjmp .+56 ; 0x34f22 34eea: 90 34 cpi r25, 0x40 ; 64 34eec: e0 f4 brcc .+56 ; 0x34f26 34eee: 0a c0 rjmp .+20 ; 0x34f04 34ef0: e9 2f mov r30, r25 34ef2: e5 1b sub r30, r21 34ef4: ed 30 cpi r30, 0x0D ; 13 34ef6: 18 f7 brcc .-58 ; 0x34ebe <__gesf2+0x22> 34ef8: 9e 3b cpi r25, 0xBE ; 190 34efa: 10 f0 brcs .+4 ; 0x34f00 34efc: f1 e4 ldi r31, 0x41 ; 65 34efe: 11 c0 rjmp .+34 ; 0x34f22 34f00: 50 34 cpi r21, 0x40 ; 64 34f02: 88 f4 brcc .+34 ; 0x34f26 34f04: f9 ea ldi r31, 0xA9 ; 169 34f06: 88 23 and r24, r24 34f08: 2a f0 brmi .+10 ; 0x34f14 34f0a: 9a 95 dec r25 34f0c: 66 0f add r22, r22 34f0e: 77 1f adc r23, r23 34f10: 88 1f adc r24, r24 34f12: da f7 brpl .-10 ; 0x34f0a 34f14: 44 23 and r20, r20 34f16: 2a f0 brmi .+10 ; 0x34f22 34f18: 5a 95 dec r21 34f1a: 22 0f add r18, r18 34f1c: 33 1f adc r19, r19 34f1e: 44 1f adc r20, r20 34f20: da f7 brpl .-10 ; 0x34f18 34f22: 9f 1b sub r25, r31 34f24: 5f 1b sub r21, r31 34f26: ff 93 push r31 34f28: 1f 93 push r17 34f2a: 0f 93 push r16 34f2c: ff 92 push r15 34f2e: ef 92 push r14 34f30: 79 01 movw r14, r18 34f32: 8a 01 movw r16, r20 34f34: bb 27 eor r27, r27 34f36: ab 2f mov r26, r27 34f38: 9b 01 movw r18, r22 34f3a: ac 01 movw r20, r24 34f3c: 0f 94 80 9e call 0x33d00 ; 0x33d00 <__mulsf3_pse> 34f40: 97 01 movw r18, r14 34f42: a8 01 movw r20, r16 34f44: bf 93 push r27 34f46: 7b 01 movw r14, r22 34f48: 8c 01 movw r16, r24 34f4a: aa 27 eor r26, r26 34f4c: ba 2f mov r27, r26 34f4e: b9 01 movw r22, r18 34f50: ca 01 movw r24, r20 34f52: 0f 94 80 9e call 0x33d00 ; 0x33d00 <__mulsf3_pse> 34f56: af 91 pop r26 34f58: 97 01 movw r18, r14 34f5a: a8 01 movw r20, r16 34f5c: ef 90 pop r14 34f5e: ff 90 pop r15 34f60: 0f 91 pop r16 34f62: 1f 91 pop r17 34f64: 0f 94 dc a4 call 0x349b8 ; 0x349b8 <__addsf3x> 34f68: 0f 94 ee 9e call 0x33ddc ; 0x33ddc <__fp_round> 34f6c: 0f 94 93 a8 call 0x35126 ; 0x35126 34f70: 4f 91 pop r20 34f72: 40 ff sbrs r20, 0 34f74: 08 95 ret 34f76: 55 27 eor r21, r21 34f78: 47 fd sbrc r20, 7 34f7a: 50 95 com r21 34f7c: 0d 94 cc a7 jmp 0x34f98 ; 0x34f98 00034f80 : 34f80: 9b 01 movw r18, r22 34f82: ac 01 movw r20, r24 34f84: 60 e0 ldi r22, 0x00 ; 0 34f86: 70 e0 ldi r23, 0x00 ; 0 34f88: 80 e8 ldi r24, 0x80 ; 128 34f8a: 9f e3 ldi r25, 0x3F ; 63 34f8c: 0d 94 c4 a5 jmp 0x34b88 ; 0x34b88 <__divsf3> 34f90: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 34f94: 0d 94 c2 a6 jmp 0x34d84 ; 0x34d84 <__fp_mpack> 00034f98 : 34f98: 0f 94 07 9f call 0x33e0e ; 0x33e0e <__fp_splitA> 34f9c: d8 f3 brcs .-10 ; 0x34f94 34f9e: 99 23 and r25, r25 34fa0: c9 f3 breq .-14 ; 0x34f94 34fa2: 94 0f add r25, r20 34fa4: 51 1d adc r21, r1 34fa6: a3 f3 brvs .-24 ; 0x34f90 34fa8: 91 50 subi r25, 0x01 ; 1 34faa: 50 40 sbci r21, 0x00 ; 0 34fac: 94 f0 brlt .+36 ; 0x34fd2 34fae: 59 f0 breq .+22 ; 0x34fc6 34fb0: 88 23 and r24, r24 34fb2: 32 f0 brmi .+12 ; 0x34fc0 34fb4: 66 0f add r22, r22 34fb6: 77 1f adc r23, r23 34fb8: 88 1f adc r24, r24 34fba: 91 50 subi r25, 0x01 ; 1 34fbc: 50 40 sbci r21, 0x00 ; 0 34fbe: c1 f7 brne .-16 ; 0x34fb0 34fc0: 9e 3f cpi r25, 0xFE ; 254 34fc2: 51 05 cpc r21, r1 34fc4: 2c f7 brge .-54 ; 0x34f90 34fc6: 88 0f add r24, r24 34fc8: 91 1d adc r25, r1 34fca: 96 95 lsr r25 34fcc: 87 95 ror r24 34fce: 97 f9 bld r25, 7 34fd0: 08 95 ret 34fd2: 5f 3f cpi r21, 0xFF ; 255 34fd4: ac f0 brlt .+42 ; 0x35000 34fd6: 98 3e cpi r25, 0xE8 ; 232 34fd8: 9c f0 brlt .+38 ; 0x35000 34fda: bb 27 eor r27, r27 34fdc: 86 95 lsr r24 34fde: 77 95 ror r23 34fe0: 67 95 ror r22 34fe2: b7 95 ror r27 34fe4: 08 f4 brcc .+2 ; 0x34fe8 34fe6: b1 60 ori r27, 0x01 ; 1 34fe8: 93 95 inc r25 34fea: c1 f7 brne .-16 ; 0x34fdc 34fec: bb 0f add r27, r27 34fee: 58 f7 brcc .-42 ; 0x34fc6 34ff0: 11 f4 brne .+4 ; 0x34ff6 34ff2: 60 ff sbrs r22, 0 34ff4: e8 cf rjmp .-48 ; 0x34fc6 34ff6: 6f 5f subi r22, 0xFF ; 255 34ff8: 7f 4f sbci r23, 0xFF ; 255 34ffa: 8f 4f sbci r24, 0xFF ; 255 34ffc: 9f 4f sbci r25, 0xFF ; 255 34ffe: e3 cf rjmp .-58 ; 0x34fc6 35000: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 00035004 : 35004: 0f 94 07 9f call 0x33e0e ; 0x33e0e <__fp_splitA> 35008: 58 f1 brcs .+86 ; 0x35060 3500a: 9e 57 subi r25, 0x7E ; 126 3500c: 60 f1 brcs .+88 ; 0x35066 3500e: 98 51 subi r25, 0x18 ; 24 35010: a0 f0 brcs .+40 ; 0x3503a 35012: e9 f0 breq .+58 ; 0x3504e 35014: 98 30 cpi r25, 0x08 ; 8 35016: 20 f5 brcc .+72 ; 0x35060 35018: 09 2e mov r0, r25 3501a: 99 27 eor r25, r25 3501c: 66 0f add r22, r22 3501e: 77 1f adc r23, r23 35020: 88 1f adc r24, r24 35022: 99 1f adc r25, r25 35024: 0a 94 dec r0 35026: d1 f7 brne .-12 ; 0x3501c 35028: 12 c0 rjmp .+36 ; 0x3504e 3502a: 06 2e mov r0, r22 3502c: 67 2f mov r22, r23 3502e: 78 2f mov r23, r24 35030: 88 27 eor r24, r24 35032: 98 5f subi r25, 0xF8 ; 248 35034: 11 f4 brne .+4 ; 0x3503a 35036: 00 0c add r0, r0 35038: 07 c0 rjmp .+14 ; 0x35048 3503a: 99 3f cpi r25, 0xF9 ; 249 3503c: b4 f3 brlt .-20 ; 0x3502a 3503e: 86 95 lsr r24 35040: 77 95 ror r23 35042: 67 95 ror r22 35044: 93 95 inc r25 35046: d9 f7 brne .-10 ; 0x3503e 35048: 61 1d adc r22, r1 3504a: 71 1d adc r23, r1 3504c: 81 1d adc r24, r1 3504e: 3e f4 brtc .+14 ; 0x3505e 35050: 90 95 com r25 35052: 80 95 com r24 35054: 70 95 com r23 35056: 61 95 neg r22 35058: 7f 4f sbci r23, 0xFF ; 255 3505a: 8f 4f sbci r24, 0xFF ; 255 3505c: 9f 4f sbci r25, 0xFF ; 255 3505e: 08 95 ret 35060: 68 94 set 35062: 0d 94 22 9f jmp 0x33e44 ; 0x33e44 <__fp_szero> 35066: 0d 94 21 9f jmp 0x33e42 ; 0x33e42 <__fp_zero> 0003506a : 3506a: fa 01 movw r30, r20 3506c: ee 0f add r30, r30 3506e: ff 1f adc r31, r31 35070: 30 96 adiw r30, 0x00 ; 0 35072: 21 05 cpc r18, r1 35074: 31 05 cpc r19, r1 35076: a1 f1 breq .+104 ; 0x350e0 35078: 61 15 cp r22, r1 3507a: 71 05 cpc r23, r1 3507c: 61 f4 brne .+24 ; 0x35096 3507e: 80 38 cpi r24, 0x80 ; 128 35080: bf e3 ldi r27, 0x3F ; 63 35082: 9b 07 cpc r25, r27 35084: 49 f1 breq .+82 ; 0x350d8 35086: 68 94 set 35088: 90 38 cpi r25, 0x80 ; 128 3508a: 81 05 cpc r24, r1 3508c: 61 f0 breq .+24 ; 0x350a6 3508e: 80 38 cpi r24, 0x80 ; 128 35090: bf ef ldi r27, 0xFF ; 255 35092: 9b 07 cpc r25, r27 35094: 41 f0 breq .+16 ; 0x350a6 35096: 99 23 and r25, r25 35098: 4a f5 brpl .+82 ; 0x350ec 3509a: ff 3f cpi r31, 0xFF ; 255 3509c: e1 05 cpc r30, r1 3509e: 31 05 cpc r19, r1 350a0: 21 05 cpc r18, r1 350a2: 19 f1 breq .+70 ; 0x350ea 350a4: e8 94 clt 350a6: 08 94 sec 350a8: e7 95 ror r30 350aa: d9 01 movw r26, r18 350ac: aa 23 and r26, r26 350ae: 29 f4 brne .+10 ; 0x350ba 350b0: ab 2f mov r26, r27 350b2: be 2f mov r27, r30 350b4: f8 5f subi r31, 0xF8 ; 248 350b6: d0 f3 brcs .-12 ; 0x350ac 350b8: 10 c0 rjmp .+32 ; 0x350da 350ba: ff 5f subi r31, 0xFF ; 255 350bc: 70 f4 brcc .+28 ; 0x350da 350be: a6 95 lsr r26 350c0: e0 f7 brcc .-8 ; 0x350ba 350c2: f7 39 cpi r31, 0x97 ; 151 350c4: 50 f0 brcs .+20 ; 0x350da 350c6: 19 f0 breq .+6 ; 0x350ce 350c8: ff 3a cpi r31, 0xAF ; 175 350ca: 38 f4 brcc .+14 ; 0x350da 350cc: 9f 77 andi r25, 0x7F ; 127 350ce: 9f 93 push r25 350d0: 0d d0 rcall .+26 ; 0x350ec 350d2: 0f 90 pop r0 350d4: 07 fc sbrc r0, 7 350d6: 90 58 subi r25, 0x80 ; 128 350d8: 08 95 ret 350da: 46 f0 brts .+16 ; 0x350ec 350dc: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 350e0: 60 e0 ldi r22, 0x00 ; 0 350e2: 70 e0 ldi r23, 0x00 ; 0 350e4: 80 e8 ldi r24, 0x80 ; 128 350e6: 9f e3 ldi r25, 0x3F ; 63 350e8: 08 95 ret 350ea: 4f e7 ldi r20, 0x7F ; 127 350ec: 9f 77 andi r25, 0x7F ; 127 350ee: 5f 93 push r21 350f0: 4f 93 push r20 350f2: 3f 93 push r19 350f4: 2f 93 push r18 350f6: 0f 94 35 a9 call 0x3526a ; 0x3526a 350fa: 2f 91 pop r18 350fc: 3f 91 pop r19 350fe: 4f 91 pop r20 35100: 5f 91 pop r21 35102: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 35106: 0d 94 e0 a8 jmp 0x351c0 ; 0x351c0 0003510a : 3510a: 9f 93 push r25 3510c: 0f 94 f9 a6 call 0x34df2 ; 0x34df2 <__fp_rempio2> 35110: 0f 90 pop r0 35112: 07 fc sbrc r0, 7 35114: ee 5f subi r30, 0xFE ; 254 35116: 0d 94 22 a7 jmp 0x34e44 ; 0x34e44 <__fp_sinus> 3511a: 19 f4 brne .+6 ; 0x35122 3511c: 16 f4 brtc .+4 ; 0x35122 3511e: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 35122: 0d 94 c2 a6 jmp 0x34d84 ; 0x34d84 <__fp_mpack> 00035126 : 35126: 0f 94 07 9f call 0x33e0e ; 0x33e0e <__fp_splitA> 3512a: b8 f3 brcs .-18 ; 0x3511a 3512c: 99 23 and r25, r25 3512e: c9 f3 breq .-14 ; 0x35122 35130: b6 f3 brts .-20 ; 0x3511e 35132: 9f 57 subi r25, 0x7F ; 127 35134: 55 0b sbc r21, r21 35136: 87 ff sbrs r24, 7 35138: 0f 94 12 a9 call 0x35224 ; 0x35224 <__fp_norm2> 3513c: 00 24 eor r0, r0 3513e: a0 e6 ldi r26, 0x60 ; 96 35140: 40 ea ldi r20, 0xA0 ; 160 35142: 90 01 movw r18, r0 35144: 80 58 subi r24, 0x80 ; 128 35146: 56 95 lsr r21 35148: 97 95 ror r25 3514a: 28 f4 brcc .+10 ; 0x35156 3514c: 80 5c subi r24, 0xC0 ; 192 3514e: 66 0f add r22, r22 35150: 77 1f adc r23, r23 35152: 88 1f adc r24, r24 35154: 20 f0 brcs .+8 ; 0x3515e 35156: 26 17 cp r18, r22 35158: 37 07 cpc r19, r23 3515a: 48 07 cpc r20, r24 3515c: 30 f4 brcc .+12 ; 0x3516a 3515e: 62 1b sub r22, r18 35160: 73 0b sbc r23, r19 35162: 84 0b sbc r24, r20 35164: 20 29 or r18, r0 35166: 31 29 or r19, r1 35168: 4a 2b or r20, r26 3516a: a6 95 lsr r26 3516c: 17 94 ror r1 3516e: 07 94 ror r0 35170: 20 25 eor r18, r0 35172: 31 25 eor r19, r1 35174: 4a 27 eor r20, r26 35176: 58 f7 brcc .-42 ; 0x3514e 35178: 66 0f add r22, r22 3517a: 77 1f adc r23, r23 3517c: 88 1f adc r24, r24 3517e: 20 f0 brcs .+8 ; 0x35188 35180: 26 17 cp r18, r22 35182: 37 07 cpc r19, r23 35184: 48 07 cpc r20, r24 35186: 30 f4 brcc .+12 ; 0x35194 35188: 62 0b sbc r22, r18 3518a: 73 0b sbc r23, r19 3518c: 84 0b sbc r24, r20 3518e: 20 0d add r18, r0 35190: 31 1d adc r19, r1 35192: 41 1d adc r20, r1 35194: a0 95 com r26 35196: 81 f7 brne .-32 ; 0x35178 35198: b9 01 movw r22, r18 3519a: 84 2f mov r24, r20 3519c: 91 58 subi r25, 0x81 ; 129 3519e: 88 0f add r24, r24 351a0: 96 95 lsr r25 351a2: 87 95 ror r24 351a4: 08 95 ret 000351a6 <__unordsf2>: 351a6: 0f 94 83 a6 call 0x34d06 ; 0x34d06 <__fp_cmp> 351aa: 88 0b sbc r24, r24 351ac: 99 0b sbc r25, r25 351ae: 08 95 ret 351b0: 29 f4 brne .+10 ; 0x351bc <__unordsf2+0x16> 351b2: 16 f0 brts .+4 ; 0x351b8 <__unordsf2+0x12> 351b4: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 351b8: 0d 94 21 9f jmp 0x33e42 ; 0x33e42 <__fp_zero> 351bc: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 000351c0 : 351c0: 0f 94 07 9f call 0x33e0e ; 0x33e0e <__fp_splitA> 351c4: a8 f3 brcs .-22 ; 0x351b0 <__unordsf2+0xa> 351c6: 96 38 cpi r25, 0x86 ; 134 351c8: a0 f7 brcc .-24 ; 0x351b2 <__unordsf2+0xc> 351ca: 07 f8 bld r0, 7 351cc: 0f 92 push r0 351ce: e8 94 clt 351d0: 2b e3 ldi r18, 0x3B ; 59 351d2: 3a ea ldi r19, 0xAA ; 170 351d4: 48 eb ldi r20, 0xB8 ; 184 351d6: 5f e7 ldi r21, 0x7F ; 127 351d8: 0f 94 80 9e call 0x33d00 ; 0x33d00 <__mulsf3_pse> 351dc: 0f 92 push r0 351de: 0f 92 push r0 351e0: 0f 92 push r0 351e2: 4d b7 in r20, 0x3d ; 61 351e4: 5e b7 in r21, 0x3e ; 62 351e6: 0f 92 push r0 351e8: 0f 94 7d a9 call 0x352fa ; 0x352fa 351ec: e2 e0 ldi r30, 0x02 ; 2 351ee: fd e6 ldi r31, 0x6D ; 109 351f0: 0f 94 d0 a6 call 0x34da0 ; 0x34da0 <__fp_powser> 351f4: 4f 91 pop r20 351f6: 5f 91 pop r21 351f8: ef 91 pop r30 351fa: ff 91 pop r31 351fc: e5 95 asr r30 351fe: ee 1f adc r30, r30 35200: ff 1f adc r31, r31 35202: 49 f0 breq .+18 ; 0x35216 35204: fe 57 subi r31, 0x7E ; 126 35206: e0 68 ori r30, 0x80 ; 128 35208: 44 27 eor r20, r20 3520a: ee 0f add r30, r30 3520c: 44 1f adc r20, r20 3520e: fa 95 dec r31 35210: e1 f7 brne .-8 ; 0x3520a 35212: 41 95 neg r20 35214: 55 0b sbc r21, r21 35216: 0f 94 cc a7 call 0x34f98 ; 0x34f98 3521a: 0f 90 pop r0 3521c: 07 fe sbrs r0, 7 3521e: 0d 94 c0 a7 jmp 0x34f80 ; 0x34f80 35222: 08 95 ret 00035224 <__fp_norm2>: 35224: 91 50 subi r25, 0x01 ; 1 35226: 50 40 sbci r21, 0x00 ; 0 35228: 66 0f add r22, r22 3522a: 77 1f adc r23, r23 3522c: 88 1f adc r24, r24 3522e: d2 f7 brpl .-12 ; 0x35224 <__fp_norm2> 35230: 08 95 ret 00035232 <__fp_powsodd>: 35232: 9f 93 push r25 35234: 8f 93 push r24 35236: 7f 93 push r23 35238: 6f 93 push r22 3523a: ff 93 push r31 3523c: ef 93 push r30 3523e: 9b 01 movw r18, r22 35240: ac 01 movw r20, r24 35242: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 <__mulsf3> 35246: ef 91 pop r30 35248: ff 91 pop r31 3524a: 0f 94 d0 a6 call 0x34da0 ; 0x34da0 <__fp_powser> 3524e: 2f 91 pop r18 35250: 3f 91 pop r19 35252: 4f 91 pop r20 35254: 5f 91 pop r21 35256: 0d 94 6a 9e jmp 0x33cd4 ; 0x33cd4 <__mulsf3> 3525a: 16 f0 brts .+4 ; 0x35260 <__fp_powsodd+0x2e> 3525c: 0d 94 c2 a6 jmp 0x34d84 ; 0x34d84 <__fp_mpack> 35260: 0d 94 dd 9e jmp 0x33dba ; 0x33dba <__fp_nan> 35264: 68 94 set 35266: 0d 94 d7 9e jmp 0x33dae ; 0x33dae <__fp_inf> 0003526a : 3526a: 0f 94 07 9f call 0x33e0e ; 0x33e0e <__fp_splitA> 3526e: a8 f3 brcs .-22 ; 0x3525a <__fp_powsodd+0x28> 35270: 99 23 and r25, r25 35272: c1 f3 breq .-16 ; 0x35264 <__fp_powsodd+0x32> 35274: ae f3 brts .-22 ; 0x35260 <__fp_powsodd+0x2e> 35276: df 93 push r29 35278: cf 93 push r28 3527a: 1f 93 push r17 3527c: 0f 93 push r16 3527e: ff 92 push r15 35280: c9 2f mov r28, r25 35282: dd 27 eor r29, r29 35284: 88 23 and r24, r24 35286: 2a f0 brmi .+10 ; 0x35292 35288: 21 97 sbiw r28, 0x01 ; 1 3528a: 66 0f add r22, r22 3528c: 77 1f adc r23, r23 3528e: 88 1f adc r24, r24 35290: da f7 brpl .-10 ; 0x35288 35292: 20 e0 ldi r18, 0x00 ; 0 35294: 30 e0 ldi r19, 0x00 ; 0 35296: 40 e8 ldi r20, 0x80 ; 128 35298: 5f eb ldi r21, 0xBF ; 191 3529a: 9f e3 ldi r25, 0x3F ; 63 3529c: 88 39 cpi r24, 0x98 ; 152 3529e: 20 f0 brcs .+8 ; 0x352a8 352a0: 80 3e cpi r24, 0xE0 ; 224 352a2: 38 f0 brcs .+14 ; 0x352b2 352a4: 21 96 adiw r28, 0x01 ; 1 352a6: 8f 77 andi r24, 0x7F ; 127 352a8: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 352ac: ea e2 ldi r30, 0x2A ; 42 352ae: fd e6 ldi r31, 0x6D ; 109 352b0: 04 c0 rjmp .+8 ; 0x352ba 352b2: 0f 94 c5 a4 call 0x3498a ; 0x3498a <__addsf3> 352b6: e7 e5 ldi r30, 0x57 ; 87 352b8: fd e6 ldi r31, 0x6D ; 109 352ba: 0f 94 d0 a6 call 0x34da0 ; 0x34da0 <__fp_powser> 352be: 8b 01 movw r16, r22 352c0: be 01 movw r22, r28 352c2: ec 01 movw r28, r24 352c4: fb 2e mov r15, r27 352c6: 6f 57 subi r22, 0x7F ; 127 352c8: 71 09 sbc r23, r1 352ca: 75 95 asr r23 352cc: 77 1f adc r23, r23 352ce: 88 0b sbc r24, r24 352d0: 99 0b sbc r25, r25 352d2: 0f 94 2b 9e call 0x33c56 ; 0x33c56 <__floatsisf> 352d6: 28 e1 ldi r18, 0x18 ; 24 352d8: 32 e7 ldi r19, 0x72 ; 114 352da: 41 e3 ldi r20, 0x31 ; 49 352dc: 5f e3 ldi r21, 0x3F ; 63 352de: 0f 94 7d 9e call 0x33cfa ; 0x33cfa <__mulsf3x> 352e2: af 2d mov r26, r15 352e4: 98 01 movw r18, r16 352e6: ae 01 movw r20, r28 352e8: ff 90 pop r15 352ea: 0f 91 pop r16 352ec: 1f 91 pop r17 352ee: cf 91 pop r28 352f0: df 91 pop r29 352f2: 0f 94 dc a4 call 0x349b8 ; 0x349b8 <__addsf3x> 352f6: 0d 94 ee 9e jmp 0x33ddc ; 0x33ddc <__fp_round> 000352fa : 352fa: fa 01 movw r30, r20 352fc: dc 01 movw r26, r24 352fe: aa 0f add r26, r26 35300: bb 1f adc r27, r27 35302: 9b 01 movw r18, r22 35304: ac 01 movw r20, r24 35306: bf 57 subi r27, 0x7F ; 127 35308: 28 f4 brcc .+10 ; 0x35314 3530a: 22 27 eor r18, r18 3530c: 33 27 eor r19, r19 3530e: 44 27 eor r20, r20 35310: 50 78 andi r21, 0x80 ; 128 35312: 20 c0 rjmp .+64 ; 0x35354 35314: b7 51 subi r27, 0x17 ; 23 35316: 90 f4 brcc .+36 ; 0x3533c 35318: ab 2f mov r26, r27 3531a: 00 24 eor r0, r0 3531c: 46 95 lsr r20 3531e: 37 95 ror r19 35320: 27 95 ror r18 35322: 01 1c adc r0, r1 35324: a3 95 inc r26 35326: d2 f3 brmi .-12 ; 0x3531c 35328: 00 20 and r0, r0 3532a: 71 f0 breq .+28 ; 0x35348 3532c: 22 0f add r18, r18 3532e: 33 1f adc r19, r19 35330: 44 1f adc r20, r20 35332: b3 95 inc r27 35334: da f3 brmi .-10 ; 0x3532c 35336: 0e d0 rcall .+28 ; 0x35354 35338: 0d 94 c4 a4 jmp 0x34988 ; 0x34988 <__subsf3> 3533c: 61 30 cpi r22, 0x01 ; 1 3533e: 71 05 cpc r23, r1 35340: a0 e8 ldi r26, 0x80 ; 128 35342: 8a 07 cpc r24, r26 35344: b9 46 sbci r27, 0x69 ; 105 35346: 30 f4 brcc .+12 ; 0x35354 35348: 9b 01 movw r18, r22 3534a: ac 01 movw r20, r24 3534c: 66 27 eor r22, r22 3534e: 77 27 eor r23, r23 35350: 88 27 eor r24, r24 35352: 90 78 andi r25, 0x80 ; 128 35354: 30 96 adiw r30, 0x00 ; 0 35356: 21 f0 breq .+8 ; 0x35360 35358: 20 83 st Z, r18 3535a: 31 83 std Z+1, r19 ; 0x01 3535c: 42 83 std Z+2, r20 ; 0x02 3535e: 53 83 std Z+3, r21 ; 0x03 35360: 08 95 ret 00035362 : 35362: 91 11 cpse r25, r1 35364: 08 95 ret 35366: 81 54 subi r24, 0x41 ; 65 35368: 8a 51 subi r24, 0x1A ; 26 3536a: 08 f4 brcc .+2 ; 0x3536e 3536c: 80 5e subi r24, 0xE0 ; 224 3536e: 85 5a subi r24, 0xA5 ; 165 35370: 08 95 ret 00035372 : 35372: fb 01 movw r30, r22 35374: dc 01 movw r26, r24 35376: 04 c0 rjmp .+8 ; 0x35380 35378: 8d 91 ld r24, X+ 3537a: 01 90 ld r0, Z+ 3537c: 80 19 sub r24, r0 3537e: 21 f4 brne .+8 ; 0x35388 35380: 41 50 subi r20, 0x01 ; 1 35382: 50 40 sbci r21, 0x00 ; 0 35384: c8 f7 brcc .-14 ; 0x35378 35386: 88 1b sub r24, r24 35388: 99 0b sbc r25, r25 3538a: 08 95 ret 0003538c : 3538c: fb 01 movw r30, r22 3538e: dc 01 movw r26, r24 35390: 02 c0 rjmp .+4 ; 0x35396 35392: 01 90 ld r0, Z+ 35394: 0d 92 st X+, r0 35396: 41 50 subi r20, 0x01 ; 1 35398: 50 40 sbci r21, 0x00 ; 0 3539a: d8 f7 brcc .-10 ; 0x35392 3539c: 08 95 ret 0003539e : 3539e: dc 01 movw r26, r24 353a0: 01 c0 rjmp .+2 ; 0x353a4 353a2: 6d 93 st X+, r22 353a4: 41 50 subi r20, 0x01 ; 1 353a6: 50 40 sbci r21, 0x00 ; 0 353a8: e0 f7 brcc .-8 ; 0x353a2 353aa: 08 95 ret 000353ac : 353ac: fb 01 movw r30, r22 353ae: dc 01 movw r26, r24 353b0: 8d 91 ld r24, X+ 353b2: 81 34 cpi r24, 0x41 ; 65 353b4: 1c f0 brlt .+6 ; 0x353bc 353b6: 8b 35 cpi r24, 0x5B ; 91 353b8: 0c f4 brge .+2 ; 0x353bc 353ba: 80 5e subi r24, 0xE0 ; 224 353bc: 61 91 ld r22, Z+ 353be: 61 34 cpi r22, 0x41 ; 65 353c0: 1c f0 brlt .+6 ; 0x353c8 353c2: 6b 35 cpi r22, 0x5B ; 91 353c4: 0c f4 brge .+2 ; 0x353c8 353c6: 60 5e subi r22, 0xE0 ; 224 353c8: 86 1b sub r24, r22 353ca: 61 11 cpse r22, r1 353cc: 89 f3 breq .-30 ; 0x353b0 353ce: 99 0b sbc r25, r25 353d0: 08 95 ret 000353d2 : 353d2: fb 01 movw r30, r22 353d4: dc 01 movw r26, r24 353d6: 0d 90 ld r0, X+ 353d8: 00 20 and r0, r0 353da: e9 f7 brne .-6 ; 0x353d6 353dc: 11 97 sbiw r26, 0x01 ; 1 353de: 01 90 ld r0, Z+ 353e0: 0d 92 st X+, r0 353e2: 00 20 and r0, r0 353e4: e1 f7 brne .-8 ; 0x353de 353e6: 08 95 ret 000353e8 : 353e8: fc 01 movw r30, r24 353ea: 81 91 ld r24, Z+ 353ec: 86 17 cp r24, r22 353ee: 21 f0 breq .+8 ; 0x353f8 353f0: 88 23 and r24, r24 353f2: d9 f7 brne .-10 ; 0x353ea 353f4: 99 27 eor r25, r25 353f6: 08 95 ret 353f8: 31 97 sbiw r30, 0x01 ; 1 353fa: cf 01 movw r24, r30 353fc: 08 95 ret 000353fe : 353fe: fb 01 movw r30, r22 35400: dc 01 movw r26, r24 35402: 8d 91 ld r24, X+ 35404: 01 90 ld r0, Z+ 35406: 80 19 sub r24, r0 35408: 01 10 cpse r0, r1 3540a: d9 f3 breq .-10 ; 0x35402 3540c: 99 0b sbc r25, r25 3540e: 08 95 ret 00035410 : 35410: fb 01 movw r30, r22 35412: dc 01 movw r26, r24 35414: 01 90 ld r0, Z+ 35416: 0d 92 st X+, r0 35418: 00 20 and r0, r0 3541a: e1 f7 brne .-8 ; 0x35414 3541c: 08 95 ret 0003541e : 3541e: fb 01 movw r30, r22 35420: dc 01 movw r26, r24 35422: 41 50 subi r20, 0x01 ; 1 35424: 50 40 sbci r21, 0x00 ; 0 35426: 30 f0 brcs .+12 ; 0x35434 35428: 8d 91 ld r24, X+ 3542a: 01 90 ld r0, Z+ 3542c: 80 19 sub r24, r0 3542e: 19 f4 brne .+6 ; 0x35436 35430: 00 20 and r0, r0 35432: b9 f7 brne .-18 ; 0x35422 35434: 88 1b sub r24, r24 35436: 99 0b sbc r25, r25 35438: 08 95 ret 0003543a : 3543a: fb 01 movw r30, r22 3543c: dc 01 movw r26, r24 3543e: 41 50 subi r20, 0x01 ; 1 35440: 50 40 sbci r21, 0x00 ; 0 35442: 48 f0 brcs .+18 ; 0x35456 35444: 01 90 ld r0, Z+ 35446: 0d 92 st X+, r0 35448: 00 20 and r0, r0 3544a: c9 f7 brne .-14 ; 0x3543e 3544c: 01 c0 rjmp .+2 ; 0x35450 3544e: 1d 92 st X+, r1 35450: 41 50 subi r20, 0x01 ; 1 35452: 50 40 sbci r21, 0x00 ; 0 35454: e0 f7 brcc .-8 ; 0x3544e 35456: 08 95 ret 00035458 : 35458: 0f 93 push r16 3545a: 1f 93 push r17 3545c: cf 93 push r28 3545e: df 93 push r29 35460: e0 91 13 17 lds r30, 0x1713 ; 0x801713 <__iob+0x2> 35464: f0 91 14 17 lds r31, 0x1714 ; 0x801714 <__iob+0x3> 35468: 23 81 ldd r18, Z+3 ; 0x03 3546a: ec 01 movw r28, r24 3546c: 10 e0 ldi r17, 0x00 ; 0 3546e: 00 e0 ldi r16, 0x00 ; 0 35470: 21 fd sbrc r18, 1 35472: 08 c0 rjmp .+16 ; 0x35484 35474: 0f ef ldi r16, 0xFF ; 255 35476: 1f ef ldi r17, 0xFF ; 255 35478: 14 c0 rjmp .+40 ; 0x354a2 3547a: 19 95 eicall 3547c: 89 2b or r24, r25 3547e: 11 f0 breq .+4 ; 0x35484 35480: 0f ef ldi r16, 0xFF ; 255 35482: 1f ef ldi r17, 0xFF ; 255 35484: 89 91 ld r24, Y+ 35486: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 3548a: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 3548e: db 01 movw r26, r22 35490: 18 96 adiw r26, 0x08 ; 8 35492: ed 91 ld r30, X+ 35494: fc 91 ld r31, X 35496: 81 11 cpse r24, r1 35498: f0 cf rjmp .-32 ; 0x3547a 3549a: 8a e0 ldi r24, 0x0A ; 10 3549c: 19 95 eicall 3549e: 89 2b or r24, r25 354a0: 49 f7 brne .-46 ; 0x35474 354a2: c8 01 movw r24, r16 354a4: df 91 pop r29 354a6: cf 91 pop r28 354a8: 1f 91 pop r17 354aa: 0f 91 pop r16 354ac: 08 95 ret 000354ae <__do_global_dtors>: 354ae: 10 e5 ldi r17, 0x50 ; 80 354b0: c3 ef ldi r28, 0xF3 ; 243 354b2: d0 e5 ldi r29, 0x50 ; 80 354b4: 00 e0 ldi r16, 0x00 ; 0 354b6: 06 c0 rjmp .+12 ; 0x354c4 <__do_global_dtors+0x16> 354b8: 80 2f mov r24, r16 354ba: fe 01 movw r30, r28 354bc: 0f 94 ad a4 call 0x3495a ; 0x3495a <__tablejump2__> 354c0: 21 96 adiw r28, 0x01 ; 1 354c2: 01 1d adc r16, r1 354c4: c4 3f cpi r28, 0xF4 ; 244 354c6: d1 07 cpc r29, r17 354c8: 80 e0 ldi r24, 0x00 ; 0 354ca: 08 07 cpc r16, r24 354cc: a9 f7 brne .-22 ; 0x354b8 <__do_global_dtors+0xa> 354ce: f8 94 cli 000354d0 <__stop_program>: 354d0: ff cf rjmp .-2 ; 0x354d0 <__stop_program>